From 62ea657ac121084262a3fa6a871c1ec977fd112f Mon Sep 17 00:00:00 2001 From: everbrez Date: Sun, 21 Jan 2024 10:55:46 +0000 Subject: [PATCH] deploy: 2b8efcff85483fe4f20c3aacf508fc8224fdfef2 --- ...ssMode.9c40aad4.js => cssMode.b3903c5b.js} | 2 +- ...r2.8484e5c8.js => freemarker2.99824c06.js} | 2 +- ...ars.1296dc2c.js => handlebars.c3f8044d.js} | 2 +- assets/{html.88b2a518.js => html.c57dab11.js} | 2 +- ...lMode.cd274e43.js => htmlMode.f8eb8ad7.js} | 2 +- .../{index.b7fee645.js => index.e0b83891.js} | 496 +++++++++--------- ...ipt.fe852d41.js => javascript.0f9cbf01.js} | 2 +- ...nMode.fdf27383.js => jsonMode.f3303325.js} | 2 +- ...{liquid.2fea4883.js => liquid.88902e43.js} | 2 +- assets/{mdx.8e3968ec.js => mdx.cb22bf12.js} | 2 +- ...{python.b3efcf1e.js => python.6b3a176a.js} | 2 +- .../{razor.f6f86f4c.js => razor.185f6816.js} | 2 +- ...{tsMode.cdbe9b4c.js => tsMode.f71d2839.js} | 2 +- ...ipt.c49ce84c.js => typescript.d26c4d00.js} | 2 +- assets/{xml.0e2004a8.js => xml.9a07e129.js} | 2 +- assets/{yaml.d8d18b9a.js => yaml.c0e89368.js} | 2 +- index.html | 2 +- 17 files changed, 266 insertions(+), 262 deletions(-) rename assets/{cssMode.9c40aad4.js => cssMode.b3903c5b.js} (99%) rename assets/{freemarker2.8484e5c8.js => freemarker2.99824c06.js} (99%) rename assets/{handlebars.1296dc2c.js => handlebars.c3f8044d.js} (99%) rename assets/{html.88b2a518.js => html.c57dab11.js} (98%) rename assets/{htmlMode.cd274e43.js => htmlMode.f8eb8ad7.js} (99%) rename assets/{index.b7fee645.js => index.e0b83891.js} (71%) rename assets/{javascript.fe852d41.js => javascript.0f9cbf01.js} (89%) rename assets/{jsonMode.fdf27383.js => jsonMode.f3303325.js} (99%) rename assets/{liquid.2fea4883.js => liquid.88902e43.js} (98%) rename assets/{mdx.8e3968ec.js => mdx.cb22bf12.js} (98%) rename assets/{python.b3efcf1e.js => python.6b3a176a.js} (98%) rename assets/{razor.f6f86f4c.js => razor.185f6816.js} (99%) rename assets/{tsMode.cdbe9b4c.js => tsMode.f71d2839.js} (99%) rename assets/{typescript.c49ce84c.js => typescript.d26c4d00.js} (98%) rename assets/{xml.0e2004a8.js => xml.9a07e129.js} (97%) rename assets/{yaml.d8d18b9a.js => yaml.c0e89368.js} (98%) diff --git a/assets/cssMode.9c40aad4.js b/assets/cssMode.b3903c5b.js similarity index 99% rename from assets/cssMode.9c40aad4.js rename to assets/cssMode.b3903c5b.js index f4029c7..233ace3 100644 --- a/assets/cssMode.9c40aad4.js +++ b/assets/cssMode.b3903c5b.js @@ -1,4 +1,4 @@ -var Le=Object.defineProperty;var je=(e,n,i)=>n in e?Le(e,n,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[n]=i;var k=(e,n,i)=>(je(e,typeof n!="symbol"?n+"":n,i),i);import{m as Ne}from"./index.b7fee645.js";/*!----------------------------------------------------------------------------- +var Le=Object.defineProperty;var je=(e,n,i)=>n in e?Le(e,n,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[n]=i;var k=(e,n,i)=>(je(e,typeof n!="symbol"?n+"":n,i),i);import{m as Ne}from"./index.e0b83891.js";/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.44.0(3e047efd345ff102c8c61b5398fb30845aaac166) * Released under the MIT license diff --git a/assets/freemarker2.8484e5c8.js b/assets/freemarker2.99824c06.js similarity index 99% rename from assets/freemarker2.8484e5c8.js rename to assets/freemarker2.99824c06.js index 91aed42..b6239c4 100644 --- a/assets/freemarker2.8484e5c8.js +++ b/assets/freemarker2.99824c06.js @@ -1,4 +1,4 @@ -import{m as F}from"./index.b7fee645.js";/*!----------------------------------------------------------------------------- +import{m as F}from"./index.e0b83891.js";/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.44.0(3e047efd345ff102c8c61b5398fb30845aaac166) * Released under the MIT license diff --git a/assets/handlebars.1296dc2c.js b/assets/handlebars.c3f8044d.js similarity index 99% rename from assets/handlebars.1296dc2c.js rename to assets/handlebars.c3f8044d.js index 69073c2..a8581eb 100644 --- a/assets/handlebars.1296dc2c.js +++ b/assets/handlebars.c3f8044d.js @@ -1,4 +1,4 @@ -import{m as i}from"./index.b7fee645.js";/*!----------------------------------------------------------------------------- +import{m as i}from"./index.e0b83891.js";/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.44.0(3e047efd345ff102c8c61b5398fb30845aaac166) * Released under the MIT license diff --git a/assets/html.88b2a518.js b/assets/html.c57dab11.js similarity index 98% rename from assets/html.88b2a518.js rename to assets/html.c57dab11.js index d26ee82..c6817c8 100644 --- a/assets/html.88b2a518.js +++ b/assets/html.c57dab11.js @@ -1,4 +1,4 @@ -import{m as d}from"./index.b7fee645.js";/*!----------------------------------------------------------------------------- +import{m as d}from"./index.e0b83891.js";/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.44.0(3e047efd345ff102c8c61b5398fb30845aaac166) * Released under the MIT license diff --git a/assets/htmlMode.cd274e43.js b/assets/htmlMode.f8eb8ad7.js similarity index 99% rename from assets/htmlMode.cd274e43.js rename to assets/htmlMode.f8eb8ad7.js index f652489..c01af28 100644 --- a/assets/htmlMode.cd274e43.js +++ b/assets/htmlMode.f8eb8ad7.js @@ -1,4 +1,4 @@ -var $e=Object.defineProperty;var qe=(e,n,i)=>n in e?$e(e,n,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[n]=i;var k=(e,n,i)=>(qe(e,typeof n!="symbol"?n+"":n,i),i);import{m as Qe}from"./index.b7fee645.js";/*!----------------------------------------------------------------------------- +var $e=Object.defineProperty;var qe=(e,n,i)=>n in e?$e(e,n,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[n]=i;var k=(e,n,i)=>(qe(e,typeof n!="symbol"?n+"":n,i),i);import{m as Qe}from"./index.e0b83891.js";/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.44.0(3e047efd345ff102c8c61b5398fb30845aaac166) * Released under the MIT license diff --git a/assets/index.b7fee645.js b/assets/index.e0b83891.js similarity index 71% rename from assets/index.b7fee645.js rename to assets/index.e0b83891.js index 2c1661f..3c3a47f 100644 --- a/assets/index.b7fee645.js +++ b/assets/index.e0b83891.js @@ -1,37 +1,37 @@ -var hNe=Object.defineProperty;var fNe=(i,e,t)=>e in i?hNe(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;var Tt=(i,e,t)=>(fNe(i,typeof e!="symbol"?e+"":e,t),t),l8=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)};var ht=(i,e,t)=>(l8(i,e,"read from private field"),t?t.call(i):e.get(i)),Oo=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},su=(i,e,t,n)=>(l8(i,e,"write to private field"),n?n.call(i,t):e.set(i,t),t),tx=(i,e,t,n)=>({set _(o){su(i,e,o,t)},get _(){return ht(i,e,n)}}),gh=(i,e,t)=>(l8(i,e,"access private method"),t);function Eue(i,e){return e.forEach(function(t){t&&typeof t!="string"&&!Array.isArray(t)&&Object.keys(t).forEach(function(n){if(n!=="default"&&!(n in i)){var o=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(i,n,o.get?o:{enumerable:!0,get:function(){return t[n]}})}})}),Object.freeze(Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}))}const gNe=function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))n(o);new MutationObserver(o=>{for(const r of o)if(r.type==="childList")for(const s of r.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&n(s)}).observe(document,{childList:!0,subtree:!0});function t(o){const r={};return o.integrity&&(r.integrity=o.integrity),o.referrerpolicy&&(r.referrerPolicy=o.referrerpolicy),o.crossorigin==="use-credentials"?r.credentials="include":o.crossorigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function n(o){if(o.ep)return;o.ep=!0;const r=t(o);fetch(o.href,r)}};gNe();var nx=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{},x={exports:{}},Ui={};/* +var SNe=Object.defineProperty;var xNe=(i,e,t)=>e in i?SNe(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;var Ct=(i,e,t)=>(xNe(i,typeof e!="symbol"?e+"":e,t),t),l8=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)};var ht=(i,e,t)=>(l8(i,e,"read from private field"),t?t.call(i):e.get(i)),Oo=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},au=(i,e,t,n)=>(l8(i,e,"write to private field"),n?n.call(i,t):e.set(i,t),t),nx=(i,e,t,n)=>({set _(o){au(i,e,o,t)},get _(){return ht(i,e,n)}}),mh=(i,e,t)=>(l8(i,e,"access private method"),t);function Tue(i,e){return e.forEach(function(t){t&&typeof t!="string"&&!Array.isArray(t)&&Object.keys(t).forEach(function(n){if(n!=="default"&&!(n in i)){var o=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(i,n,o.get?o:{enumerable:!0,get:function(){return t[n]}})}})}),Object.freeze(Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}))}const LNe=function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))n(o);new MutationObserver(o=>{for(const r of o)if(r.type==="childList")for(const s of r.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&n(s)}).observe(document,{childList:!0,subtree:!0});function t(o){const r={};return o.integrity&&(r.integrity=o.integrity),o.referrerpolicy&&(r.referrerPolicy=o.referrerpolicy),o.crossorigin==="use-credentials"?r.credentials="include":o.crossorigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function n(o){if(o.ep)return;o.ep=!0;const r=t(o);fetch(o.href,r)}};LNe();var ix=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{},x={exports:{}},Ui={};/* object-assign (c) Sindre Sorhus @license MIT -*/var nJ=Object.getOwnPropertySymbols,pNe=Object.prototype.hasOwnProperty,mNe=Object.prototype.propertyIsEnumerable;function vNe(i){if(i==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(i)}function _Ne(){try{if(!Object.assign)return!1;var i=new String("abc");if(i[5]="de",Object.getOwnPropertyNames(i)[0]==="5")return!1;for(var e={},t=0;t<10;t++)e["_"+String.fromCharCode(t)]=t;var n=Object.getOwnPropertyNames(e).map(function(r){return e[r]});if(n.join("")!=="0123456789")return!1;var o={};return"abcdefghijklmnopqrst".split("").forEach(function(r){o[r]=r}),Object.keys(Object.assign({},o)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}var Due=_Ne()?Object.assign:function(i,e){for(var t,n=vNe(i),o,r=1;r=_},o=function(){},i.unstable_forceFrameRate=function(j){0>j||125>>1,he=j[de];if(he!==void 0&&0I(be,X))Fe!==void 0&&0>I(Fe,be)?(j[de]=Fe,j[Se]=X,de=Se):(j[de]=be,j[pe]=X,de=pe);else if(Fe!==void 0&&0>I(Fe,X))j[de]=Fe,j[Se]=X,de=Se;else break e}}return G}return null}function I(j,G){var X=j.sortIndex-G.sortIndex;return X!==0?X:j.id-G.id}var k=[],R=[],A=1,P=null,N=3,M=!1,H=!1,W=!1;function F(j){for(var G=D(R);G!==null;){if(G.callback===null)E(R);else if(G.startTime<=j)E(R),G.sortIndex=G.expirationTime,L(k,G);else break;G=D(R)}}function $(j){if(W=!1,F(j),!H)if(D(k)!==null)H=!0,e(z);else{var G=D(R);G!==null&&t($,G.startTime-j)}}function z(j,G){H=!1,W&&(W=!1,n()),M=!0;var X=N;try{for(F(G),P=D(k);P!==null&&(!(P.expirationTime>G)||j&&!i.unstable_shouldYield());){var de=P.callback;if(typeof de=="function"){P.callback=null,N=P.priorityLevel;var he=de(P.expirationTime<=G);G=i.unstable_now(),typeof he=="function"?P.callback=he:P===D(k)&&E(k),F(G)}else E(k);P=D(k)}if(P!==null)var pe=!0;else{var be=D(R);be!==null&&t($,be.startTime-G),pe=!1}return pe}finally{P=null,N=X,M=!1}}var K=o;i.unstable_IdlePriority=5,i.unstable_ImmediatePriority=1,i.unstable_LowPriority=4,i.unstable_NormalPriority=3,i.unstable_Profiling=null,i.unstable_UserBlockingPriority=2,i.unstable_cancelCallback=function(j){j.callback=null},i.unstable_continueExecution=function(){H||M||(H=!0,e(z))},i.unstable_getCurrentPriorityLevel=function(){return N},i.unstable_getFirstCallbackNode=function(){return D(k)},i.unstable_next=function(j){switch(N){case 1:case 2:case 3:var G=3;break;default:G=N}var X=N;N=G;try{return j()}finally{N=X}},i.unstable_pauseExecution=function(){},i.unstable_requestPaint=K,i.unstable_runWithPriority=function(j,G){switch(j){case 1:case 2:case 3:case 4:case 5:break;default:j=3}var X=N;N=j;try{return G()}finally{N=X}},i.unstable_scheduleCallback=function(j,G,X){var de=i.unstable_now();switch(typeof X=="object"&&X!==null?(X=X.delay,X=typeof X=="number"&&0de?(j.sortIndex=X,L(R,j),D(k)===null&&j===D(R)&&(W?n():W=!0,t($,X-de))):(j.sortIndex=he,L(k,j),H||M||(H=!0,e(z))),j},i.unstable_wrapCallback=function(j){var G=N;return function(){var X=N;N=G;try{return j.apply(this,arguments)}finally{N=X}}}})(Hue);WL.exports=Hue;/** @license React v17.0.2 + */(function(i){var e,t,n,o;if(typeof performance=="object"&&typeof performance.now=="function"){var r=performance;i.unstable_now=function(){return r.now()}}else{var s=Date,a=s.now();i.unstable_now=function(){return s.now()-a}}if(typeof window=="undefined"||typeof MessageChannel!="function"){var l=null,c=null,u=function(){if(l!==null)try{var j=i.unstable_now();l(!0,j),l=null}catch(G){throw setTimeout(u,0),G}};e=function(j){l!==null?setTimeout(e,0,j):(l=j,setTimeout(u,0))},t=function(j,G){c=setTimeout(j,G)},n=function(){clearTimeout(c)},i.unstable_shouldYield=function(){return!1},o=i.unstable_forceFrameRate=function(){}}else{var d=window.setTimeout,h=window.clearTimeout;if(typeof console!="undefined"){var f=window.cancelAnimationFrame;typeof window.requestAnimationFrame!="function"&&console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills"),typeof f!="function"&&console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills")}var g=!1,p=null,v=-1,m=5,_=0;i.unstable_shouldYield=function(){return i.unstable_now()>=_},o=function(){},i.unstable_forceFrameRate=function(j){0>j||125>>1,fe=j[de];if(fe!==void 0&&0I(be,X))Fe!==void 0&&0>I(Fe,be)?(j[de]=Fe,j[Se]=X,de=Se):(j[de]=be,j[pe]=X,de=pe);else if(Fe!==void 0&&0>I(Fe,X))j[de]=Fe,j[Se]=X,de=Se;else break e}}return G}return null}function I(j,G){var X=j.sortIndex-G.sortIndex;return X!==0?X:j.id-G.id}var k=[],R=[],A=1,P=null,N=3,M=!1,H=!1,B=!1;function F(j){for(var G=D(R);G!==null;){if(G.callback===null)E(R);else if(G.startTime<=j)E(R),G.sortIndex=G.expirationTime,L(k,G);else break;G=D(R)}}function $(j){if(B=!1,F(j),!H)if(D(k)!==null)H=!0,e(z);else{var G=D(R);G!==null&&t($,G.startTime-j)}}function z(j,G){H=!1,B&&(B=!1,n()),M=!0;var X=N;try{for(F(G),P=D(k);P!==null&&(!(P.expirationTime>G)||j&&!i.unstable_shouldYield());){var de=P.callback;if(typeof de=="function"){P.callback=null,N=P.priorityLevel;var fe=de(P.expirationTime<=G);G=i.unstable_now(),typeof fe=="function"?P.callback=fe:P===D(k)&&E(k),F(G)}else E(k);P=D(k)}if(P!==null)var pe=!0;else{var be=D(R);be!==null&&t($,be.startTime-G),pe=!1}return pe}finally{P=null,N=X,M=!1}}var K=o;i.unstable_IdlePriority=5,i.unstable_ImmediatePriority=1,i.unstable_LowPriority=4,i.unstable_NormalPriority=3,i.unstable_Profiling=null,i.unstable_UserBlockingPriority=2,i.unstable_cancelCallback=function(j){j.callback=null},i.unstable_continueExecution=function(){H||M||(H=!0,e(z))},i.unstable_getCurrentPriorityLevel=function(){return N},i.unstable_getFirstCallbackNode=function(){return D(k)},i.unstable_next=function(j){switch(N){case 1:case 2:case 3:var G=3;break;default:G=N}var X=N;N=G;try{return j()}finally{N=X}},i.unstable_pauseExecution=function(){},i.unstable_requestPaint=K,i.unstable_runWithPriority=function(j,G){switch(j){case 1:case 2:case 3:case 4:case 5:break;default:j=3}var X=N;N=j;try{return G()}finally{N=X}},i.unstable_scheduleCallback=function(j,G,X){var de=i.unstable_now();switch(typeof X=="object"&&X!==null?(X=X.delay,X=typeof X=="number"&&0de?(j.sortIndex=X,L(R,j),D(k)===null&&j===D(R)&&(B?n():B=!0,t($,X-de))):(j.sortIndex=fe,L(k,j),H||M||(H=!0,e(z))),j},i.unstable_wrapCallback=function(j){var G=N;return function(){var X=N;N=G;try{return j.apply(this,arguments)}finally{N=X}}}})(jue);VL.exports=jue;/** @license React v17.0.2 * react-dom.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var AO=x.exports,ar=Due,Vs=WL.exports;function It(i){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+i,t=1;te}return!1}function fl(i,e,t,n,o,r,s){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=n,this.attributeNamespace=o,this.mustUseProperty=t,this.propertyName=i,this.type=e,this.sanitizeURL=r,this.removeEmptyString=s}var ca={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(i){ca[i]=new fl(i,0,!1,i,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(i){var e=i[0];ca[e]=new fl(e,1,!1,i[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(i){ca[i]=new fl(i,2,!1,i.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(i){ca[i]=new fl(i,2,!1,i,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(i){ca[i]=new fl(i,3,!1,i.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(i){ca[i]=new fl(i,3,!0,i,null,!1,!1)});["capture","download"].forEach(function(i){ca[i]=new fl(i,4,!1,i,null,!1,!1)});["cols","rows","size","span"].forEach(function(i){ca[i]=new fl(i,6,!1,i,null,!1,!1)});["rowSpan","start"].forEach(function(i){ca[i]=new fl(i,5,!1,i.toLowerCase(),null,!1,!1)});var sj=/[\-:]([a-z])/g;function aj(i){return i[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(i){var e=i.replace(sj,aj);ca[e]=new fl(e,1,!1,i,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(i){var e=i.replace(sj,aj);ca[e]=new fl(e,1,!1,i,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(i){var e=i.replace(sj,aj);ca[e]=new fl(e,1,!1,i,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(i){ca[i]=new fl(i,1,!1,i.toLowerCase(),null,!1,!1)});ca.xlinkHref=new fl("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(i){ca[i]=new fl(i,1,!1,i.toLowerCase(),null,!0,!0)});function lj(i,e,t,n){var o=ca.hasOwnProperty(e)?ca[e]:null,r=o!==null?o.type===0:n?!1:!(!(2e}return!1}function gl(i,e,t,n,o,r,s){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=n,this.attributeNamespace=o,this.mustUseProperty=t,this.propertyName=i,this.type=e,this.sanitizeURL=r,this.removeEmptyString=s}var ua={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(i){ua[i]=new gl(i,0,!1,i,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(i){var e=i[0];ua[e]=new gl(e,1,!1,i[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(i){ua[i]=new gl(i,2,!1,i.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(i){ua[i]=new gl(i,2,!1,i,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(i){ua[i]=new gl(i,3,!1,i.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(i){ua[i]=new gl(i,3,!0,i,null,!1,!1)});["capture","download"].forEach(function(i){ua[i]=new gl(i,4,!1,i,null,!1,!1)});["cols","rows","size","span"].forEach(function(i){ua[i]=new gl(i,6,!1,i,null,!1,!1)});["rowSpan","start"].forEach(function(i){ua[i]=new gl(i,5,!1,i.toLowerCase(),null,!1,!1)});var uj=/[\-:]([a-z])/g;function dj(i){return i[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(i){var e=i.replace(uj,dj);ua[e]=new gl(e,1,!1,i,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(i){var e=i.replace(uj,dj);ua[e]=new gl(e,1,!1,i,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(i){var e=i.replace(uj,dj);ua[e]=new gl(e,1,!1,i,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(i){ua[i]=new gl(i,1,!1,i.toLowerCase(),null,!1,!1)});ua.xlinkHref=new gl("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(i){ua[i]=new gl(i,1,!1,i.toLowerCase(),null,!0,!0)});function hj(i,e,t,n){var o=ua.hasOwnProperty(e)?ua[e]:null,r=o!==null?o.type===0:n?!1:!(!(2a||o[s]!==r[a])return` -`+o[s].replace(" at new "," at ");while(1<=s&&0<=a);break}}}finally{d8=!1,Error.prepareStackTrace=t}return(i=i?i.displayName||i.name:"")?aL(i):""}function kNe(i){switch(i.tag){case 5:return aL(i.type);case 16:return aL("Lazy");case 13:return aL("Suspense");case 19:return aL("SuspenseList");case 0:case 2:case 15:return i=gN(i.type,!1),i;case 11:return i=gN(i.type.render,!1),i;case 22:return i=gN(i.type._render,!1),i;case 1:return i=gN(i.type,!0),i;default:return""}}function JC(i){if(i==null)return null;if(typeof i=="function")return i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case om:return"Fragment";case G_:return"Portal";case VL:return"Profiler";case cj:return"StrictMode";case HL:return"Suspense";case RM:return"SuspenseList"}if(typeof i=="object")switch(i.$$typeof){case dj:return(i.displayName||"Context")+".Consumer";case uj:return(i._context.displayName||"Context")+".Provider";case PO:var e=i.render;return e=e.displayName||e.name||"",i.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case OO:return JC(i.type);case fj:return JC(i._render);case hj:e=i._payload,i=i._init;try{return JC(i(e))}catch{}}return null}function av(i){switch(typeof i){case"boolean":case"number":case"object":case"string":case"undefined":return i;default:return""}}function Uue(i){var e=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function INe(i){var e=Uue(i)?"checked":"value",t=Object.getOwnPropertyDescriptor(i.constructor.prototype,e),n=""+i[e];if(!i.hasOwnProperty(e)&&typeof t!="undefined"&&typeof t.get=="function"&&typeof t.set=="function"){var o=t.get,r=t.set;return Object.defineProperty(i,e,{configurable:!0,get:function(){return o.call(this)},set:function(s){n=""+s,r.call(this,s)}}),Object.defineProperty(i,e,{enumerable:t.enumerable}),{getValue:function(){return n},setValue:function(s){n=""+s},stopTracking:function(){i._valueTracker=null,delete i[e]}}}}function pN(i){i._valueTracker||(i._valueTracker=INe(i))}function jue(i){if(!i)return!1;var e=i._valueTracker;if(!e)return!0;var t=e.getValue(),n="";return i&&(n=Uue(i)?i.checked?"true":"false":i.value),i=n,i!==t?(e.setValue(i),!0):!1}function MM(i){if(i=i||(typeof document!="undefined"?document:void 0),typeof i=="undefined")return null;try{return i.activeElement||i.body}catch{return i.body}}function F7(i,e){var t=e.checked;return ar({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:t!=null?t:i._wrapperState.initialChecked})}function cJ(i,e){var t=e.defaultValue==null?"":e.defaultValue,n=e.checked!=null?e.checked:e.defaultChecked;t=av(e.value!=null?e.value:t),i._wrapperState={initialChecked:n,initialValue:t,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function Kue(i,e){e=e.checked,e!=null&&lj(i,"checked",e,!1)}function B7(i,e){Kue(i,e);var t=av(e.value),n=e.type;if(t!=null)n==="number"?(t===0&&i.value===""||i.value!=t)&&(i.value=""+t):i.value!==""+t&&(i.value=""+t);else if(n==="submit"||n==="reset"){i.removeAttribute("value");return}e.hasOwnProperty("value")?W7(i,e.type,t):e.hasOwnProperty("defaultValue")&&W7(i,e.type,av(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(i.defaultChecked=!!e.defaultChecked)}function uJ(i,e,t){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var n=e.type;if(!(n!=="submit"&&n!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+i._wrapperState.initialValue,t||e===i.value||(i.value=e),i.defaultValue=e}t=i.name,t!==""&&(i.name=""),i.defaultChecked=!!i._wrapperState.initialChecked,t!==""&&(i.name=t)}function W7(i,e,t){(e!=="number"||MM(i.ownerDocument)!==i)&&(t==null?i.defaultValue=""+i._wrapperState.initialValue:i.defaultValue!==""+t&&(i.defaultValue=""+t))}function TNe(i){var e="";return AO.Children.forEach(i,function(t){t!=null&&(e+=t)}),e}function V7(i,e){return i=ar({children:void 0},e),(e=TNe(e.children))&&(i.children=e),i}function ew(i,e,t,n){if(i=i.options,e){e={};for(var o=0;o=t.length))throw Error(It(93));t=t[0]}e=t}e==null&&(e=""),t=e}i._wrapperState={initialValue:av(t)}}function que(i,e){var t=av(e.value),n=av(e.defaultValue);t!=null&&(t=""+t,t!==i.value&&(i.value=t),e.defaultValue==null&&i.defaultValue!==t&&(i.defaultValue=t)),n!=null&&(i.defaultValue=""+n)}function hJ(i){var e=i.textContent;e===i._wrapperState.initialValue&&e!==""&&e!==null&&(i.value=e)}var $7={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg"};function Gue(i){switch(i){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function z7(i,e){return i==null||i==="http://www.w3.org/1999/xhtml"?Gue(e):i==="http://www.w3.org/2000/svg"&&e==="foreignObject"?"http://www.w3.org/1999/xhtml":i}var mN,Xue=function(i){return typeof MSApp!="undefined"&&MSApp.execUnsafeLocalFunction?function(e,t,n,o){MSApp.execUnsafeLocalFunction(function(){return i(e,t,n,o)})}:i}(function(i,e){if(i.namespaceURI!==$7.svg||"innerHTML"in i)i.innerHTML=e;else{for(mN=mN||document.createElement("div"),mN.innerHTML=""+e.valueOf().toString()+"",e=mN.firstChild;i.firstChild;)i.removeChild(i.firstChild);for(;e.firstChild;)i.appendChild(e.firstChild)}});function VE(i,e){if(e){var t=i.firstChild;if(t&&t===i.lastChild&&t.nodeType===3){t.nodeValue=e;return}}i.textContent=e}var $L={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},NNe=["Webkit","ms","Moz","O"];Object.keys($L).forEach(function(i){NNe.forEach(function(e){e=e+i.charAt(0).toUpperCase()+i.substring(1),$L[e]=$L[i]})});function Yue(i,e,t){return e==null||typeof e=="boolean"||e===""?"":t||typeof e!="number"||e===0||$L.hasOwnProperty(i)&&$L[i]?(""+e).trim():e+"px"}function Zue(i,e){i=i.style;for(var t in e)if(e.hasOwnProperty(t)){var n=t.indexOf("--")===0,o=Yue(t,e[t],n);t==="float"&&(t="cssFloat"),n?i.setProperty(t,o):i[t]=o}}var RNe=ar({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function U7(i,e){if(e){if(RNe[i]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(It(137,i));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(It(60));if(!(typeof e.dangerouslySetInnerHTML=="object"&&"__html"in e.dangerouslySetInnerHTML))throw Error(It(61))}if(e.style!=null&&typeof e.style!="object")throw Error(It(62))}}function j7(i,e){if(i.indexOf("-")===-1)return typeof e.is=="string";switch(i){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}function mj(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var K7=null,tw=null,nw=null;function fJ(i){if(i=fI(i)){if(typeof K7!="function")throw Error(It(280));var e=i.stateNode;e&&(e=$O(e),K7(i.stateNode,i.type,e))}}function Que(i){tw?nw?nw.push(i):nw=[i]:tw=i}function Jue(){if(tw){var i=tw,e=nw;if(nw=tw=null,fJ(i),e)for(i=0;in?0:1<t;t++)e.push(i);return e}function BO(i,e,t){i.pendingLanes|=e;var n=e-1;i.suspendedLanes&=n,i.pingedLanes&=n,i=i.eventTimes,e=31-lv(e),i[e]=t}var lv=Math.clz32?Math.clz32:GNe,KNe=Math.log,qNe=Math.LN2;function GNe(i){return i===0?32:31-(KNe(i)/qNe|0)|0}var XNe=Vs.unstable_UserBlockingPriority,YNe=Vs.unstable_runWithPriority,CR=!0;function ZNe(i,e,t,n){X_||_j();var o=Sj,r=X_;X_=!0;try{ede(o,i,e,t,n)}finally{(X_=r)||bj()}}function QNe(i,e,t,n){YNe(XNe,Sj.bind(null,i,e,t,n))}function Sj(i,e,t,n){if(CR){var o;if((o=(e&4)===0)&&0=UL),SJ=String.fromCharCode(32),xJ=!1;function vde(i,e){switch(i){case"keyup":return w2e.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function _de(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var vC=!1;function S2e(i,e){switch(i){case"compositionend":return _de(e);case"keypress":return e.which!==32?null:(xJ=!0,SJ);case"textInput":return i=e.data,i===SJ&&xJ?null:i;default:return null}}function x2e(i,e){if(vC)return i==="compositionend"||!kj&&vde(i,e)?(i=pde(),wR=Lj=fm=null,vC=!1,i):null;switch(i){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1=e)return{node:t,offset:e-i};i=n}e:{for(;t;){if(t.nextSibling){t=t.nextSibling;break e}t=t.parentNode}t=void 0}t=kJ(t)}}function yde(i,e){return i&&e?i===e?!0:i&&i.nodeType===3?!1:e&&e.nodeType===3?yde(i,e.parentNode):"contains"in i?i.contains(e):i.compareDocumentPosition?!!(i.compareDocumentPosition(e)&16):!1:!1}function TJ(){for(var i=window,e=MM();e instanceof i.HTMLIFrameElement;){try{var t=typeof e.contentWindow.location.href=="string"}catch{t=!1}if(t)i=e.contentWindow;else break;e=MM(i.document)}return e}function Z7(i){var e=i&&i.nodeName&&i.nodeName.toLowerCase();return e&&(e==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||e==="textarea"||i.contentEditable==="true")}var A2e=Jg&&"documentMode"in document&&11>=document.documentMode,_C=null,Q7=null,KL=null,J7=!1;function NJ(i,e,t){var n=t.window===t?t.document:t.nodeType===9?t:t.ownerDocument;J7||_C==null||_C!==MM(n)||(n=_C,"selectionStart"in n&&Z7(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),KL&&KE(KL,n)||(KL=n,n=FM(Q7,"onSelect"),0CC||(i.current=tB[CC],tB[CC]=null,CC--)}function Er(i,e){CC++,tB[CC]=i.current,i.current=e}var cv={},Pa=zv(cv),zl=zv(!1),F0=cv;function Yw(i,e){var t=i.type.contextTypes;if(!t)return cv;var n=i.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===e)return n.__reactInternalMemoizedMaskedChildContext;var o={},r;for(r in t)o[r]=e[r];return n&&(i=i.stateNode,i.__reactInternalMemoizedUnmaskedChildContext=e,i.__reactInternalMemoizedMaskedChildContext=o),o}function Ul(i){return i=i.childContextTypes,i!=null}function VM(){Xo(zl),Xo(Pa)}function VJ(i,e,t){if(Pa.current!==cv)throw Error(It(168));Er(Pa,e),Er(zl,t)}function Tde(i,e,t){var n=i.stateNode;if(i=e.childContextTypes,typeof n.getChildContext!="function")return t;n=n.getChildContext();for(var o in n)if(!(o in i))throw Error(It(108,JC(e)||"Unknown",o));return ar({},t,n)}function SR(i){return i=(i=i.stateNode)&&i.__reactInternalMemoizedMergedChildContext||cv,F0=Pa.current,Er(Pa,i),Er(zl,zl.current),!0}function HJ(i,e,t){var n=i.stateNode;if(!n)throw Error(It(169));t?(i=Tde(i,e,F0),n.__reactInternalMemoizedMergedChildContext=i,Xo(zl),Xo(Pa),Er(Pa,i)):Xo(zl),Er(zl,t)}var Tj=null,b0=null,F2e=Vs.unstable_runWithPriority,Nj=Vs.unstable_scheduleCallback,nB=Vs.unstable_cancelCallback,B2e=Vs.unstable_shouldYield,$J=Vs.unstable_requestPaint,iB=Vs.unstable_now,W2e=Vs.unstable_getCurrentPriorityLevel,zO=Vs.unstable_ImmediatePriority,Nde=Vs.unstable_UserBlockingPriority,Rde=Vs.unstable_NormalPriority,Mde=Vs.unstable_LowPriority,Ade=Vs.unstable_IdlePriority,x8={},V2e=$J!==void 0?$J:function(){},ug=null,xR=null,L8=!1,zJ=iB(),Na=1e4>zJ?iB:function(){return iB()-zJ};function Zw(){switch(W2e()){case zO:return 99;case Nde:return 98;case Rde:return 97;case Mde:return 96;case Ade:return 95;default:throw Error(It(332))}}function Pde(i){switch(i){case 99:return zO;case 98:return Nde;case 97:return Rde;case 96:return Mde;case 95:return Ade;default:throw Error(It(332))}}function B0(i,e){return i=Pde(i),F2e(i,e)}function GE(i,e,t){return i=Pde(i),Nj(i,e,t)}function Lf(){if(xR!==null){var i=xR;xR=null,nB(i)}Ode()}function Ode(){if(!L8&&ug!==null){L8=!0;var i=0;try{var e=ug;B0(99,function(){for(;iE?(I=D,D=null):I=D.sibling;var k=h(v,D,_[E],w);if(k===null){D===null&&(D=I);break}i&&D&&k.alternate===null&&e(v,D),m=r(k,m,E),L===null?y=k:L.sibling=k,L=k,D=I}if(E===_.length)return t(v,D),y;if(D===null){for(;E<_.length;E++)D=d(v,_[E],w),D!==null&&(m=r(D,m,E),L===null?y=D:L.sibling=D,L=D);return y}for(D=n(v,D);E<_.length;E++)I=f(D,v,E,_[E],w),I!==null&&(i&&I.alternate!==null&&D.delete(I.key===null?E:I.key),m=r(I,m,E),L===null?y=I:L.sibling=I,L=I);return i&&D.forEach(function(R){return e(v,R)}),y}function p(v,m,_,w){var y=ix(_);if(typeof y!="function")throw Error(It(150));if(_=y.call(_),_==null)throw Error(It(151));for(var L=y=null,D=m,E=m=0,I=null,k=_.next();D!==null&&!k.done;E++,k=_.next()){D.index>E?(I=D,D=null):I=D.sibling;var R=h(v,D,k.value,w);if(R===null){D===null&&(D=I);break}i&&D&&R.alternate===null&&e(v,D),m=r(R,m,E),L===null?y=R:L.sibling=R,L=R,D=I}if(k.done)return t(v,D),y;if(D===null){for(;!k.done;E++,k=_.next())k=d(v,k.value,w),k!==null&&(m=r(k,m,E),L===null?y=k:L.sibling=k,L=k);return y}for(D=n(v,D);!k.done;E++,k=_.next())k=f(D,v,E,k.value,w),k!==null&&(i&&k.alternate!==null&&D.delete(k.key===null?E:k.key),m=r(k,m,E),L===null?y=k:L.sibling=k,L=k);return i&&D.forEach(function(A){return e(v,A)}),y}return function(v,m,_,w){var y=typeof _=="object"&&_!==null&&_.type===om&&_.key===null;y&&(_=_.props.children);var L=typeof _=="object"&&_!==null;if(L)switch(_.$$typeof){case sL:e:{for(L=_.key,y=m;y!==null;){if(y.key===L){switch(y.tag){case 7:if(_.type===om){t(v,y.sibling),m=o(y,_.props.children),m.return=v,v=m;break e}break;default:if(y.elementType===_.type){t(v,y.sibling),m=o(y,_.props),m.ref=cx(v,y,_),m.return=v,v=m;break e}}t(v,y);break}else e(v,y);y=y.sibling}_.type===om?(m=lw(_.props.children,v.mode,w,_.key),m.return=v,v=m):(w=kR(_.type,_.key,_.props,null,v.mode,w),w.ref=cx(v,m,_),w.return=v,v=w)}return s(v);case G_:e:{for(y=_.key;m!==null;){if(m.key===y)if(m.tag===4&&m.stateNode.containerInfo===_.containerInfo&&m.stateNode.implementation===_.implementation){t(v,m.sibling),m=o(m,_.children||[]),m.return=v,v=m;break e}else{t(v,m);break}else e(v,m);m=m.sibling}m=N8(_,v.mode,w),m.return=v,v=m}return s(v)}if(typeof _=="string"||typeof _=="number")return _=""+_,m!==null&&m.tag===6?(t(v,m.sibling),m=o(m,_),m.return=v,v=m):(t(v,m),m=T8(_,v.mode,w),m.return=v,v=m),s(v);if(bN(_))return g(v,m,_,w);if(ix(_))return p(v,m,_,w);if(L&&CN(v,_),typeof _=="undefined"&&!y)switch(v.tag){case 1:case 22:case 0:case 11:case 15:throw Error(It(152,JC(v.type)||"Component"))}return t(v,m)}}var jM=Hde(!0),$de=Hde(!1),gI={},ef=zv(gI),YE=zv(gI),ZE=zv(gI);function Z_(i){if(i===gI)throw Error(It(174));return i}function rB(i,e){switch(Er(ZE,e),Er(YE,i),Er(ef,gI),i=e.nodeType,i){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:z7(null,"");break;default:i=i===8?e.parentNode:e,e=i.namespaceURI||null,i=i.tagName,e=z7(e,i)}Xo(ef),Er(ef,e)}function Qw(){Xo(ef),Xo(YE),Xo(ZE)}function GJ(i){Z_(ZE.current);var e=Z_(ef.current),t=z7(e,i.type);e!==t&&(Er(YE,i),Er(ef,t))}function Pj(i){YE.current===i&&(Xo(ef),Xo(YE))}var Sr=zv(0);function KM(i){for(var e=i;e!==null;){if(e.tag===13){var t=e.memoizedState;if(t!==null&&(t=t.dehydrated,t===null||t.data==="$?"||t.data==="$!"))return e}else if(e.tag===19&&e.memoizedProps.revealOrder!==void 0){if((e.flags&64)!==0)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===i)break;for(;e.sibling===null;){if(e.return===null||e.return===i)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var kg=null,pm=null,tf=!1;function zde(i,e){var t=_u(5,null,null,0);t.elementType="DELETED",t.type="DELETED",t.stateNode=e,t.return=i,t.flags=8,i.lastEffect!==null?(i.lastEffect.nextEffect=t,i.lastEffect=t):i.firstEffect=i.lastEffect=t}function XJ(i,e){switch(i.tag){case 5:var t=i.type;return e=e.nodeType!==1||t.toLowerCase()!==e.nodeName.toLowerCase()?null:e,e!==null?(i.stateNode=e,!0):!1;case 6:return e=i.pendingProps===""||e.nodeType!==3?null:e,e!==null?(i.stateNode=e,!0):!1;case 13:return!1;default:return!1}}function sB(i){if(tf){var e=pm;if(e){var t=e;if(!XJ(i,e)){if(e=iw(t.nextSibling),!e||!XJ(i,e)){i.flags=i.flags&-1025|2,tf=!1,kg=i;return}zde(kg,t)}kg=i,pm=iw(e.firstChild)}else i.flags=i.flags&-1025|2,tf=!1,kg=i}}function YJ(i){for(i=i.return;i!==null&&i.tag!==5&&i.tag!==3&&i.tag!==13;)i=i.return;kg=i}function wN(i){if(i!==kg)return!1;if(!tf)return YJ(i),tf=!0,!1;var e=i.type;if(i.tag!==5||e!=="head"&&e!=="body"&&!eB(e,i.memoizedProps))for(e=pm;e;)zde(i,e),e=iw(e.nextSibling);if(YJ(i),i.tag===13){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(It(317));e:{for(i=i.nextSibling,e=0;i;){if(i.nodeType===8){var t=i.data;if(t==="/$"){if(e===0){pm=iw(i.nextSibling);break e}e--}else t!=="$"&&t!=="$!"&&t!=="$?"||e++}i=i.nextSibling}pm=null}}else pm=kg?iw(i.stateNode.nextSibling):null;return!0}function E8(){pm=kg=null,tf=!1}var rw=[];function Oj(){for(var i=0;ir))throw Error(It(301));r+=1,Ys=Ea=null,e.updateQueue=null,qL.current=j2e,i=t(n,o)}while(GL)}if(qL.current=ZM,e=Ea!==null&&Ea.next!==null,QE=0,Ys=Ea=zr=null,qM=!1,e)throw Error(It(300));return i}function Q_(){var i={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ys===null?zr.memoizedState=Ys=i:Ys=Ys.next=i,Ys}function Nb(){if(Ea===null){var i=zr.alternate;i=i!==null?i.memoizedState:null}else i=Ea.next;var e=Ys===null?zr.memoizedState:Ys.next;if(e!==null)Ys=e,Ea=i;else{if(i===null)throw Error(It(310));Ea=i,i={memoizedState:Ea.memoizedState,baseState:Ea.baseState,baseQueue:Ea.baseQueue,queue:Ea.queue,next:null},Ys===null?zr.memoizedState=Ys=i:Ys=Ys.next=i}return Ys}function Hh(i,e){return typeof e=="function"?e(i):e}function ux(i){var e=Nb(),t=e.queue;if(t===null)throw Error(It(311));t.lastRenderedReducer=i;var n=Ea,o=n.baseQueue,r=t.pending;if(r!==null){if(o!==null){var s=o.next;o.next=r.next,r.next=s}n.baseQueue=o=r,t.pending=null}if(o!==null){o=o.next,n=n.baseState;var a=s=r=null,l=o;do{var c=l.lane;if((QE&c)===c)a!==null&&(a=a.next={lane:0,action:l.action,eagerReducer:l.eagerReducer,eagerState:l.eagerState,next:null}),n=l.eagerReducer===i?l.eagerState:i(n,l.action);else{var u={lane:c,action:l.action,eagerReducer:l.eagerReducer,eagerState:l.eagerState,next:null};a===null?(s=a=u,r=n):a=a.next=u,zr.lanes|=c,pI|=c}l=l.next}while(l!==null&&l!==o);a===null?r=n:a.next=s,vu(n,e.memoizedState)||(Id=!0),e.memoizedState=n,e.baseState=r,e.baseQueue=a,t.lastRenderedState=n}return[e.memoizedState,t.dispatch]}function dx(i){var e=Nb(),t=e.queue;if(t===null)throw Error(It(311));t.lastRenderedReducer=i;var n=t.dispatch,o=t.pending,r=e.memoizedState;if(o!==null){t.pending=null;var s=o=o.next;do r=i(r,s.action),s=s.next;while(s!==o);vu(r,e.memoizedState)||(Id=!0),e.memoizedState=r,e.baseQueue===null&&(e.baseState=r),t.lastRenderedState=r}return[r,n]}function ZJ(i,e,t){var n=e._getVersion;n=n(e._source);var o=e._workInProgressVersionPrimary;if(o!==null?i=o===n:(i=i.mutableReadLanes,(i=(QE&i)===i)&&(e._workInProgressVersionPrimary=n,rw.push(e))),i)return t(e._source);throw rw.push(e),Error(It(350))}function Ude(i,e,t,n){var o=rl;if(o===null)throw Error(It(349));var r=e._getVersion,s=r(e._source),a=qL.current,l=a.useState(function(){return ZJ(o,e,t)}),c=l[1],u=l[0];l=Ys;var d=i.memoizedState,h=d.refs,f=h.getSnapshot,g=d.source;d=d.subscribe;var p=zr;return i.memoizedState={refs:h,source:e,subscribe:n},a.useEffect(function(){h.getSnapshot=t,h.setSnapshot=c;var v=r(e._source);if(!vu(s,v)){v=t(e._source),vu(u,v)||(c(v),v=Bm(p),o.mutableReadLanes|=v&o.pendingLanes),v=o.mutableReadLanes,o.entangledLanes|=v;for(var m=o.entanglements,_=v;0<_;){var w=31-lv(_),y=1<t?98:t,function(){i(!0)}),B0(97<\/script>",i=i.removeChild(i.firstChild)):typeof n.is=="string"?i=s.createElement(t,{is:n.is}):(i=s.createElement(t),t==="select"&&(s=i,n.multiple?s.multiple=!0:n.size&&(s.size=n.size))):i=s.createElementNS(i,t),i[gm]=e,i[WM]=n,Jde(i,e,!1,!1),e.stateNode=i,s=j7(t,n),t){case"dialog":Ko("cancel",i),Ko("close",i),o=n;break;case"iframe":case"object":case"embed":Ko("load",i),o=n;break;case"video":case"audio":for(o=0;omB&&(e.flags|=64,r=!0,fx(n,!1),e.lanes=33554432)}else{if(!r)if(i=KM(s),i!==null){if(e.flags|=64,r=!0,t=i.updateQueue,t!==null&&(e.updateQueue=t,e.flags|=4),fx(n,!0),n.tail===null&&n.tailMode==="hidden"&&!s.alternate&&!tf)return e=e.lastEffect=n.lastEffect,e!==null&&(e.nextEffect=null),null}else 2*Na()-n.renderingStartTime>mB&&t!==1073741824&&(e.flags|=64,r=!0,fx(n,!1),e.lanes=33554432);n.isBackwards?(s.sibling=e.child,e.child=s):(t=n.last,t!==null?t.sibling=s:e.child=s,n.last=s)}return n.tail!==null?(t=n.tail,n.rendering=t,n.tail=t.sibling,n.lastEffect=e.lastEffect,n.renderingStartTime=Na(),t.sibling=null,e=Sr.current,Er(Sr,r?e&1|2:e&1),t):null;case 23:case 24:return Kj(),i!==null&&i.memoizedState!==null!=(e.memoizedState!==null)&&n.mode!=="unstable-defer-without-hiding"&&(e.flags|=4),null}throw Error(It(156,e.tag))}function G2e(i){switch(i.tag){case 1:Ul(i.type)&&VM();var e=i.flags;return e&4096?(i.flags=e&-4097|64,i):null;case 3:if(Qw(),Xo(zl),Xo(Pa),Oj(),e=i.flags,(e&64)!==0)throw Error(It(285));return i.flags=e&-4097|64,i;case 5:return Pj(i),null;case 13:return Xo(Sr),e=i.flags,e&4096?(i.flags=e&-4097|64,i):null;case 19:return Xo(Sr),null;case 4:return Qw(),null;case 10:return Mj(i),null;case 23:case 24:return Kj(),null;default:return null}}function $j(i,e){try{var t="",n=e;do t+=kNe(n),n=n.return;while(n);var o=t}catch(r){o=` +`+o[s].replace(" at new "," at ");while(1<=s&&0<=a);break}}}finally{d8=!1,Error.prepareStackTrace=t}return(i=i?i.displayName||i.name:"")?lL(i):""}function WNe(i){switch(i.tag){case 5:return lL(i.type);case 16:return lL("Lazy");case 13:return lL("Suspense");case 19:return lL("SuspenseList");case 0:case 2:case 15:return i=vN(i.type,!1),i;case 11:return i=vN(i.type.render,!1),i;case 22:return i=vN(i.type._render,!1),i;case 1:return i=vN(i.type,!0),i;default:return""}}function JC(i){if(i==null)return null;if(typeof i=="function")return i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case rm:return"Fragment";case X_:return"Portal";case HL:return"Profiler";case fj:return"StrictMode";case $L:return"Suspense";case PM:return"SuspenseList"}if(typeof i=="object")switch(i.$$typeof){case pj:return(i.displayName||"Context")+".Consumer";case gj:return(i._context.displayName||"Context")+".Provider";case BO:var e=i.render;return e=e.displayName||e.name||"",i.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case WO:return JC(i.type);case vj:return JC(i._render);case mj:e=i._payload,i=i._init;try{return JC(i(e))}catch{}}return null}function lv(i){switch(typeof i){case"boolean":case"number":case"object":case"string":case"undefined":return i;default:return""}}function Gue(i){var e=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function VNe(i){var e=Gue(i)?"checked":"value",t=Object.getOwnPropertyDescriptor(i.constructor.prototype,e),n=""+i[e];if(!i.hasOwnProperty(e)&&typeof t!="undefined"&&typeof t.get=="function"&&typeof t.set=="function"){var o=t.get,r=t.set;return Object.defineProperty(i,e,{configurable:!0,get:function(){return o.call(this)},set:function(s){n=""+s,r.call(this,s)}}),Object.defineProperty(i,e,{enumerable:t.enumerable}),{getValue:function(){return n},setValue:function(s){n=""+s},stopTracking:function(){i._valueTracker=null,delete i[e]}}}}function _N(i){i._valueTracker||(i._valueTracker=VNe(i))}function Xue(i){if(!i)return!1;var e=i._valueTracker;if(!e)return!0;var t=e.getValue(),n="";return i&&(n=Gue(i)?i.checked?"true":"false":i.value),i=n,i!==t?(e.setValue(i),!0):!1}function OM(i){if(i=i||(typeof document!="undefined"?document:void 0),typeof i=="undefined")return null;try{return i.activeElement||i.body}catch{return i.body}}function V7(i,e){var t=e.checked;return ar({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:t!=null?t:i._wrapperState.initialChecked})}function vJ(i,e){var t=e.defaultValue==null?"":e.defaultValue,n=e.checked!=null?e.checked:e.defaultChecked;t=lv(e.value!=null?e.value:t),i._wrapperState={initialChecked:n,initialValue:t,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function Yue(i,e){e=e.checked,e!=null&&hj(i,"checked",e,!1)}function H7(i,e){Yue(i,e);var t=lv(e.value),n=e.type;if(t!=null)n==="number"?(t===0&&i.value===""||i.value!=t)&&(i.value=""+t):i.value!==""+t&&(i.value=""+t);else if(n==="submit"||n==="reset"){i.removeAttribute("value");return}e.hasOwnProperty("value")?$7(i,e.type,t):e.hasOwnProperty("defaultValue")&&$7(i,e.type,lv(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(i.defaultChecked=!!e.defaultChecked)}function _J(i,e,t){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var n=e.type;if(!(n!=="submit"&&n!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+i._wrapperState.initialValue,t||e===i.value||(i.value=e),i.defaultValue=e}t=i.name,t!==""&&(i.name=""),i.defaultChecked=!!i._wrapperState.initialChecked,t!==""&&(i.name=t)}function $7(i,e,t){(e!=="number"||OM(i.ownerDocument)!==i)&&(t==null?i.defaultValue=""+i._wrapperState.initialValue:i.defaultValue!==""+t&&(i.defaultValue=""+t))}function HNe(i){var e="";return FO.Children.forEach(i,function(t){t!=null&&(e+=t)}),e}function z7(i,e){return i=ar({children:void 0},e),(e=HNe(e.children))&&(i.children=e),i}function ey(i,e,t,n){if(i=i.options,e){e={};for(var o=0;o=t.length))throw Error(Tt(93));t=t[0]}e=t}e==null&&(e=""),t=e}i._wrapperState={initialValue:lv(t)}}function Zue(i,e){var t=lv(e.value),n=lv(e.defaultValue);t!=null&&(t=""+t,t!==i.value&&(i.value=t),e.defaultValue==null&&i.defaultValue!==t&&(i.defaultValue=t)),n!=null&&(i.defaultValue=""+n)}function CJ(i){var e=i.textContent;e===i._wrapperState.initialValue&&e!==""&&e!==null&&(i.value=e)}var j7={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg"};function Que(i){switch(i){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function K7(i,e){return i==null||i==="http://www.w3.org/1999/xhtml"?Que(e):i==="http://www.w3.org/2000/svg"&&e==="foreignObject"?"http://www.w3.org/1999/xhtml":i}var bN,Jue=function(i){return typeof MSApp!="undefined"&&MSApp.execUnsafeLocalFunction?function(e,t,n,o){MSApp.execUnsafeLocalFunction(function(){return i(e,t,n,o)})}:i}(function(i,e){if(i.namespaceURI!==j7.svg||"innerHTML"in i)i.innerHTML=e;else{for(bN=bN||document.createElement("div"),bN.innerHTML=""+e.valueOf().toString()+"",e=bN.firstChild;i.firstChild;)i.removeChild(i.firstChild);for(;e.firstChild;)i.appendChild(e.firstChild)}});function HE(i,e){if(e){var t=i.firstChild;if(t&&t===i.lastChild&&t.nodeType===3){t.nodeValue=e;return}}i.textContent=e}var zL={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},$Ne=["Webkit","ms","Moz","O"];Object.keys(zL).forEach(function(i){$Ne.forEach(function(e){e=e+i.charAt(0).toUpperCase()+i.substring(1),zL[e]=zL[i]})});function ede(i,e,t){return e==null||typeof e=="boolean"||e===""?"":t||typeof e!="number"||e===0||zL.hasOwnProperty(i)&&zL[i]?(""+e).trim():e+"px"}function tde(i,e){i=i.style;for(var t in e)if(e.hasOwnProperty(t)){var n=t.indexOf("--")===0,o=ede(t,e[t],n);t==="float"&&(t="cssFloat"),n?i.setProperty(t,o):i[t]=o}}var zNe=ar({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function q7(i,e){if(e){if(zNe[i]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(Tt(137,i));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(Tt(60));if(!(typeof e.dangerouslySetInnerHTML=="object"&&"__html"in e.dangerouslySetInnerHTML))throw Error(Tt(61))}if(e.style!=null&&typeof e.style!="object")throw Error(Tt(62))}}function G7(i,e){if(i.indexOf("-")===-1)return typeof e.is=="string";switch(i){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}function Cj(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var X7=null,ty=null,ny=null;function yJ(i){if(i=fI(i)){if(typeof X7!="function")throw Error(Tt(280));var e=i.stateNode;e&&(e=jO(e),X7(i.stateNode,i.type,e))}}function nde(i){ty?ny?ny.push(i):ny=[i]:ty=i}function ide(){if(ty){var i=ty,e=ny;if(ny=ty=null,yJ(i),e)for(i=0;in?0:1<t;t++)e.push(i);return e}function HO(i,e,t){i.pendingLanes|=e;var n=e-1;i.suspendedLanes&=n,i.pingedLanes&=n,i=i.eventTimes,e=31-cv(e),i[e]=t}var cv=Math.clz32?Math.clz32:r2e,i2e=Math.log,o2e=Math.LN2;function r2e(i){return i===0?32:31-(i2e(i)/o2e|0)|0}var s2e=Vs.unstable_UserBlockingPriority,a2e=Vs.unstable_runWithPriority,SR=!0;function l2e(i,e,t,n){Y_||wj();var o=Dj,r=Y_;Y_=!0;try{ode(o,i,e,t,n)}finally{(Y_=r)||Sj()}}function c2e(i,e,t,n){a2e(s2e,Dj.bind(null,i,e,t,n))}function Dj(i,e,t,n){if(SR){var o;if((o=(e&4)===0)&&0<$h.length&&-1=jL),NJ=String.fromCharCode(32),RJ=!1;function yde(i,e){switch(i){case"keyup":return R2e.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function wde(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var vC=!1;function A2e(i,e){switch(i){case"compositionend":return wde(e);case"keypress":return e.which!==32?null:(RJ=!0,NJ);case"textInput":return i=e.data,i===NJ&&RJ?null:i;default:return null}}function P2e(i,e){if(vC)return i==="compositionend"||!Rj&&yde(i,e)?(i=bde(),xR=Ij=gm=null,vC=!1,i):null;switch(i){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1=e)return{node:t,offset:e-i};i=n}e:{for(;t;){if(t.nextSibling){t=t.nextSibling;break e}t=t.parentNode}t=void 0}t=OJ(t)}}function Ede(i,e){return i&&e?i===e?!0:i&&i.nodeType===3?!1:e&&e.nodeType===3?Ede(i,e.parentNode):"contains"in i?i.contains(e):i.compareDocumentPosition?!!(i.compareDocumentPosition(e)&16):!1:!1}function BJ(){for(var i=window,e=OM();e instanceof i.HTMLIFrameElement;){try{var t=typeof e.contentWindow.location.href=="string"}catch{t=!1}if(t)i=e.contentWindow;else break;e=OM(i.document)}return e}function eB(i){var e=i&&i.nodeName&&i.nodeName.toLowerCase();return e&&(e==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||e==="textarea"||i.contentEditable==="true")}var j2e=ep&&"documentMode"in document&&11>=document.documentMode,_C=null,tB=null,qL=null,nB=!1;function WJ(i,e,t){var n=t.window===t?t.document:t.nodeType===9?t:t.ownerDocument;nB||_C==null||_C!==OM(n)||(n=_C,"selectionStart"in n&&eB(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),qL&&qE(qL,n)||(qL=n,n=VM(tB,"onSelect"),0CC||(i.current=oB[CC],oB[CC]=null,CC--)}function Er(i,e){CC++,oB[CC]=i.current,i.current=e}var uv={},Oa=Uv(uv),Ul=Uv(!1),B0=uv;function Yy(i,e){var t=i.type.contextTypes;if(!t)return uv;var n=i.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===e)return n.__reactInternalMemoizedMaskedChildContext;var o={},r;for(r in t)o[r]=e[r];return n&&(i=i.stateNode,i.__reactInternalMemoizedUnmaskedChildContext=e,i.__reactInternalMemoizedMaskedChildContext=o),o}function jl(i){return i=i.childContextTypes,i!=null}function zM(){Xo(Ul),Xo(Oa)}function GJ(i,e,t){if(Oa.current!==uv)throw Error(Tt(168));Er(Oa,e),Er(Ul,t)}function Ade(i,e,t){var n=i.stateNode;if(i=e.childContextTypes,typeof n.getChildContext!="function")return t;n=n.getChildContext();for(var o in n)if(!(o in i))throw Error(Tt(108,JC(e)||"Unknown",o));return ar({},t,n)}function ER(i){return i=(i=i.stateNode)&&i.__reactInternalMemoizedMergedChildContext||uv,B0=Oa.current,Er(Oa,i),Er(Ul,Ul.current),!0}function XJ(i,e,t){var n=i.stateNode;if(!n)throw Error(Tt(169));t?(i=Ade(i,e,B0),n.__reactInternalMemoizedMergedChildContext=i,Xo(Ul),Xo(Oa),Er(Oa,i)):Xo(Ul),Er(Ul,t)}var Aj=null,C0=null,G2e=Vs.unstable_runWithPriority,Pj=Vs.unstable_scheduleCallback,rB=Vs.unstable_cancelCallback,X2e=Vs.unstable_shouldYield,YJ=Vs.unstable_requestPaint,sB=Vs.unstable_now,Y2e=Vs.unstable_getCurrentPriorityLevel,KO=Vs.unstable_ImmediatePriority,Pde=Vs.unstable_UserBlockingPriority,Ode=Vs.unstable_NormalPriority,Fde=Vs.unstable_LowPriority,Bde=Vs.unstable_IdlePriority,x8={},Z2e=YJ!==void 0?YJ:function(){},dg=null,DR=null,L8=!1,ZJ=sB(),Ra=1e4>ZJ?sB:function(){return sB()-ZJ};function Zy(){switch(Y2e()){case KO:return 99;case Pde:return 98;case Ode:return 97;case Fde:return 96;case Bde:return 95;default:throw Error(Tt(332))}}function Wde(i){switch(i){case 99:return KO;case 98:return Pde;case 97:return Ode;case 96:return Fde;case 95:return Bde;default:throw Error(Tt(332))}}function W0(i,e){return i=Wde(i),G2e(i,e)}function XE(i,e,t){return i=Wde(i),Pj(i,e,t)}function Ef(){if(DR!==null){var i=DR;DR=null,rB(i)}Vde()}function Vde(){if(!L8&&dg!==null){L8=!0;var i=0;try{var e=dg;W0(99,function(){for(;iE?(I=D,D=null):I=D.sibling;var k=h(v,D,_[E],y);if(k===null){D===null&&(D=I);break}i&&D&&k.alternate===null&&e(v,D),m=r(k,m,E),L===null?w=k:L.sibling=k,L=k,D=I}if(E===_.length)return t(v,D),w;if(D===null){for(;E<_.length;E++)D=d(v,_[E],y),D!==null&&(m=r(D,m,E),L===null?w=D:L.sibling=D,L=D);return w}for(D=n(v,D);E<_.length;E++)I=f(D,v,E,_[E],y),I!==null&&(i&&I.alternate!==null&&D.delete(I.key===null?E:I.key),m=r(I,m,E),L===null?w=I:L.sibling=I,L=I);return i&&D.forEach(function(R){return e(v,R)}),w}function p(v,m,_,y){var w=ox(_);if(typeof w!="function")throw Error(Tt(150));if(_=w.call(_),_==null)throw Error(Tt(151));for(var L=w=null,D=m,E=m=0,I=null,k=_.next();D!==null&&!k.done;E++,k=_.next()){D.index>E?(I=D,D=null):I=D.sibling;var R=h(v,D,k.value,y);if(R===null){D===null&&(D=I);break}i&&D&&R.alternate===null&&e(v,D),m=r(R,m,E),L===null?w=R:L.sibling=R,L=R,D=I}if(k.done)return t(v,D),w;if(D===null){for(;!k.done;E++,k=_.next())k=d(v,k.value,y),k!==null&&(m=r(k,m,E),L===null?w=k:L.sibling=k,L=k);return w}for(D=n(v,D);!k.done;E++,k=_.next())k=f(D,v,E,k.value,y),k!==null&&(i&&k.alternate!==null&&D.delete(k.key===null?E:k.key),m=r(k,m,E),L===null?w=k:L.sibling=k,L=k);return i&&D.forEach(function(A){return e(v,A)}),w}return function(v,m,_,y){var w=typeof _=="object"&&_!==null&&_.type===rm&&_.key===null;w&&(_=_.props.children);var L=typeof _=="object"&&_!==null;if(L)switch(_.$$typeof){case aL:e:{for(L=_.key,w=m;w!==null;){if(w.key===L){switch(w.tag){case 7:if(_.type===rm){t(v,w.sibling),m=o(w,_.props.children),m.return=v,v=m;break e}break;default:if(w.elementType===_.type){t(v,w.sibling),m=o(w,_.props),m.ref=ux(v,w,_),m.return=v,v=m;break e}}t(v,w);break}else e(v,w);w=w.sibling}_.type===rm?(m=ly(_.props.children,v.mode,y,_.key),m.return=v,v=m):(y=NR(_.type,_.key,_.props,null,v.mode,y),y.ref=ux(v,m,_),y.return=v,v=y)}return s(v);case X_:e:{for(w=_.key;m!==null;){if(m.key===w)if(m.tag===4&&m.stateNode.containerInfo===_.containerInfo&&m.stateNode.implementation===_.implementation){t(v,m.sibling),m=o(m,_.children||[]),m.return=v,v=m;break e}else{t(v,m);break}else e(v,m);m=m.sibling}m=N8(_,v.mode,y),m.return=v,v=m}return s(v)}if(typeof _=="string"||typeof _=="number")return _=""+_,m!==null&&m.tag===6?(t(v,m.sibling),m=o(m,_),m.return=v,v=m):(t(v,m),m=T8(_,v.mode,y),m.return=v,v=m),s(v);if(wN(_))return g(v,m,_,y);if(ox(_))return p(v,m,_,y);if(L&&SN(v,_),typeof _=="undefined"&&!w)switch(v.tag){case 1:case 22:case 0:case 11:case 15:throw Error(Tt(152,JC(v.type)||"Component"))}return t(v,m)}}var GM=jde(!0),Kde=jde(!1),gI={},nf=Uv(gI),ZE=Uv(gI),QE=Uv(gI);function Q_(i){if(i===gI)throw Error(Tt(174));return i}function lB(i,e){switch(Er(QE,e),Er(ZE,i),Er(nf,gI),i=e.nodeType,i){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:K7(null,"");break;default:i=i===8?e.parentNode:e,e=i.namespaceURI||null,i=i.tagName,e=K7(e,i)}Xo(nf),Er(nf,e)}function Qy(){Xo(nf),Xo(ZE),Xo(QE)}function nee(i){Q_(QE.current);var e=Q_(nf.current),t=K7(e,i.type);e!==t&&(Er(ZE,i),Er(nf,t))}function Wj(i){ZE.current===i&&(Xo(nf),Xo(ZE))}var xr=Uv(0);function XM(i){for(var e=i;e!==null;){if(e.tag===13){var t=e.memoizedState;if(t!==null&&(t=t.dehydrated,t===null||t.data==="$?"||t.data==="$!"))return e}else if(e.tag===19&&e.memoizedProps.revealOrder!==void 0){if((e.flags&64)!==0)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===i)break;for(;e.sibling===null;){if(e.return===null||e.return===i)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var Ig=null,mm=null,of=!1;function qde(i,e){var t=_u(5,null,null,0);t.elementType="DELETED",t.type="DELETED",t.stateNode=e,t.return=i,t.flags=8,i.lastEffect!==null?(i.lastEffect.nextEffect=t,i.lastEffect=t):i.firstEffect=i.lastEffect=t}function iee(i,e){switch(i.tag){case 5:var t=i.type;return e=e.nodeType!==1||t.toLowerCase()!==e.nodeName.toLowerCase()?null:e,e!==null?(i.stateNode=e,!0):!1;case 6:return e=i.pendingProps===""||e.nodeType!==3?null:e,e!==null?(i.stateNode=e,!0):!1;case 13:return!1;default:return!1}}function cB(i){if(of){var e=mm;if(e){var t=e;if(!iee(i,e)){if(e=iy(t.nextSibling),!e||!iee(i,e)){i.flags=i.flags&-1025|2,of=!1,Ig=i;return}qde(Ig,t)}Ig=i,mm=iy(e.firstChild)}else i.flags=i.flags&-1025|2,of=!1,Ig=i}}function oee(i){for(i=i.return;i!==null&&i.tag!==5&&i.tag!==3&&i.tag!==13;)i=i.return;Ig=i}function xN(i){if(i!==Ig)return!1;if(!of)return oee(i),of=!0,!1;var e=i.type;if(i.tag!==5||e!=="head"&&e!=="body"&&!iB(e,i.memoizedProps))for(e=mm;e;)qde(i,e),e=iy(e.nextSibling);if(oee(i),i.tag===13){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(Tt(317));e:{for(i=i.nextSibling,e=0;i;){if(i.nodeType===8){var t=i.data;if(t==="/$"){if(e===0){mm=iy(i.nextSibling);break e}e--}else t!=="$"&&t!=="$!"&&t!=="$?"||e++}i=i.nextSibling}mm=null}}else mm=Ig?iy(i.stateNode.nextSibling):null;return!0}function E8(){mm=Ig=null,of=!1}var ry=[];function Vj(){for(var i=0;ir))throw Error(Tt(301));r+=1,Zs=Da=null,e.updateQueue=null,GL.current=nRe,i=t(n,o)}while(XL)}if(GL.current=eA,e=Da!==null&&Da.next!==null,JE=0,Zs=Da=zr=null,YM=!1,e)throw Error(Tt(300));return i}function J_(){var i={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Zs===null?zr.memoizedState=Zs=i:Zs=Zs.next=i,Zs}function Rb(){if(Da===null){var i=zr.alternate;i=i!==null?i.memoizedState:null}else i=Da.next;var e=Zs===null?zr.memoizedState:Zs.next;if(e!==null)Zs=e,Da=i;else{if(i===null)throw Error(Tt(310));Da=i,i={memoizedState:Da.memoizedState,baseState:Da.baseState,baseQueue:Da.baseQueue,queue:Da.queue,next:null},Zs===null?zr.memoizedState=Zs=i:Zs=Zs.next=i}return Zs}function zh(i,e){return typeof e=="function"?e(i):e}function dx(i){var e=Rb(),t=e.queue;if(t===null)throw Error(Tt(311));t.lastRenderedReducer=i;var n=Da,o=n.baseQueue,r=t.pending;if(r!==null){if(o!==null){var s=o.next;o.next=r.next,r.next=s}n.baseQueue=o=r,t.pending=null}if(o!==null){o=o.next,n=n.baseState;var a=s=r=null,l=o;do{var c=l.lane;if((JE&c)===c)a!==null&&(a=a.next={lane:0,action:l.action,eagerReducer:l.eagerReducer,eagerState:l.eagerState,next:null}),n=l.eagerReducer===i?l.eagerState:i(n,l.action);else{var u={lane:c,action:l.action,eagerReducer:l.eagerReducer,eagerState:l.eagerState,next:null};a===null?(s=a=u,r=n):a=a.next=u,zr.lanes|=c,pI|=c}l=l.next}while(l!==null&&l!==o);a===null?r=n:a.next=s,vu(n,e.memoizedState)||(Id=!0),e.memoizedState=n,e.baseState=r,e.baseQueue=a,t.lastRenderedState=n}return[e.memoizedState,t.dispatch]}function hx(i){var e=Rb(),t=e.queue;if(t===null)throw Error(Tt(311));t.lastRenderedReducer=i;var n=t.dispatch,o=t.pending,r=e.memoizedState;if(o!==null){t.pending=null;var s=o=o.next;do r=i(r,s.action),s=s.next;while(s!==o);vu(r,e.memoizedState)||(Id=!0),e.memoizedState=r,e.baseQueue===null&&(e.baseState=r),t.lastRenderedState=r}return[r,n]}function ree(i,e,t){var n=e._getVersion;n=n(e._source);var o=e._workInProgressVersionPrimary;if(o!==null?i=o===n:(i=i.mutableReadLanes,(i=(JE&i)===i)&&(e._workInProgressVersionPrimary=n,ry.push(e))),i)return t(e._source);throw ry.push(e),Error(Tt(350))}function Gde(i,e,t,n){var o=sl;if(o===null)throw Error(Tt(349));var r=e._getVersion,s=r(e._source),a=GL.current,l=a.useState(function(){return ree(o,e,t)}),c=l[1],u=l[0];l=Zs;var d=i.memoizedState,h=d.refs,f=h.getSnapshot,g=d.source;d=d.subscribe;var p=zr;return i.memoizedState={refs:h,source:e,subscribe:n},a.useEffect(function(){h.getSnapshot=t,h.setSnapshot=c;var v=r(e._source);if(!vu(s,v)){v=t(e._source),vu(u,v)||(c(v),v=Wm(p),o.mutableReadLanes|=v&o.pendingLanes),v=o.mutableReadLanes,o.entangledLanes|=v;for(var m=o.entanglements,_=v;0<_;){var y=31-cv(_),w=1<t?98:t,function(){i(!0)}),W0(97<\/script>",i=i.removeChild(i.firstChild)):typeof n.is=="string"?i=s.createElement(t,{is:n.is}):(i=s.createElement(t),t==="select"&&(s=i,n.multiple?s.multiple=!0:n.size&&(s.size=n.size))):i=s.createElementNS(i,t),i[pm]=e,i[$M]=n,ihe(i,e,!1,!1),e.stateNode=i,s=G7(t,n),t){case"dialog":Ko("cancel",i),Ko("close",i),o=n;break;case"iframe":case"object":case"embed":Ko("load",i),o=n;break;case"video":case"audio":for(o=0;obB&&(e.flags|=64,r=!0,gx(n,!1),e.lanes=33554432)}else{if(!r)if(i=XM(s),i!==null){if(e.flags|=64,r=!0,t=i.updateQueue,t!==null&&(e.updateQueue=t,e.flags|=4),gx(n,!0),n.tail===null&&n.tailMode==="hidden"&&!s.alternate&&!of)return e=e.lastEffect=n.lastEffect,e!==null&&(e.nextEffect=null),null}else 2*Ra()-n.renderingStartTime>bB&&t!==1073741824&&(e.flags|=64,r=!0,gx(n,!1),e.lanes=33554432);n.isBackwards?(s.sibling=e.child,e.child=s):(t=n.last,t!==null?t.sibling=s:e.child=s,n.last=s)}return n.tail!==null?(t=n.tail,n.rendering=t,n.tail=t.sibling,n.lastEffect=e.lastEffect,n.renderingStartTime=Ra(),t.sibling=null,e=xr.current,Er(xr,r?e&1|2:e&1),t):null;case 23:case 24:return Yj(),i!==null&&i.memoizedState!==null!=(e.memoizedState!==null)&&n.mode!=="unstable-defer-without-hiding"&&(e.flags|=4),null}throw Error(Tt(156,e.tag))}function rRe(i){switch(i.tag){case 1:jl(i.type)&&zM();var e=i.flags;return e&4096?(i.flags=e&-4097|64,i):null;case 3:if(Qy(),Xo(Ul),Xo(Oa),Vj(),e=i.flags,(e&64)!==0)throw Error(Tt(285));return i.flags=e&-4097|64,i;case 5:return Wj(i),null;case 13:return Xo(xr),e=i.flags,e&4096?(i.flags=e&-4097|64,i):null;case 19:return Xo(xr),null;case 4:return Qy(),null;case 10:return Fj(i),null;case 23:case 24:return Yj(),null;default:return null}}function Kj(i,e){try{var t="",n=e;do t+=WNe(n),n=n.return;while(n);var o=t}catch(r){o=` Error generating stack: `+r.message+` -`+r.stack}return{value:i,source:e,stack:o}}function dB(i,e){try{console.error(e.value)}catch(t){setTimeout(function(){throw t})}}var X2e=typeof WeakMap=="function"?WeakMap:Map;function nhe(i,e,t){t=Om(-1,t),t.tag=3,t.payload={element:null};var n=e.value;return t.callback=function(){JM||(JM=!0,vB=n),dB(i,e)},t}function ihe(i,e,t){t=Om(-1,t),t.tag=3;var n=i.type.getDerivedStateFromError;if(typeof n=="function"){var o=e.value;t.payload=function(){return dB(i,e),n(o)}}var r=i.stateNode;return r!==null&&typeof r.componentDidCatch=="function"&&(t.callback=function(){typeof n!="function"&&($h===null?$h=new Set([this]):$h.add(this),dB(i,e));var s=e.stack;this.componentDidCatch(e.value,{componentStack:s!==null?s:""})}),t}var Y2e=typeof WeakSet=="function"?WeakSet:Set;function uee(i){var e=i.ref;if(e!==null)if(typeof e=="function")try{e(null)}catch(t){Vm(i,t)}else e.current=null}function Z2e(i,e){switch(e.tag){case 0:case 11:case 15:case 22:return;case 1:if(e.flags&256&&i!==null){var t=i.memoizedProps,n=i.memoizedState;i=e.stateNode,e=i.getSnapshotBeforeUpdate(e.elementType===e.type?t:cd(e.type,t),n),i.__reactInternalSnapshotBeforeUpdate=e}return;case 3:e.flags&256&&Ij(e.stateNode.containerInfo);return;case 5:case 6:case 4:case 17:return}throw Error(It(163))}function Q2e(i,e,t){switch(t.tag){case 0:case 11:case 15:case 22:if(e=t.updateQueue,e=e!==null?e.lastEffect:null,e!==null){i=e=e.next;do{if((i.tag&3)===3){var n=i.create;i.destroy=n()}i=i.next}while(i!==e)}if(e=t.updateQueue,e=e!==null?e.lastEffect:null,e!==null){i=e=e.next;do{var o=i;n=o.next,o=o.tag,(o&4)!==0&&(o&1)!==0&&(hhe(t,i),sRe(t,i)),i=n}while(i!==e)}return;case 1:i=t.stateNode,t.flags&4&&(e===null?i.componentDidMount():(n=t.elementType===t.type?e.memoizedProps:cd(t.type,e.memoizedProps),i.componentDidUpdate(n,e.memoizedState,i.__reactInternalSnapshotBeforeUpdate))),e=t.updateQueue,e!==null&&jJ(t,e,i);return;case 3:if(e=t.updateQueue,e!==null){if(i=null,t.child!==null)switch(t.child.tag){case 5:i=t.child.stateNode;break;case 1:i=t.child.stateNode}jJ(t,e,i)}return;case 5:i=t.stateNode,e===null&&t.flags&4&&kde(t.type,t.memoizedProps)&&i.focus();return;case 6:return;case 4:return;case 12:return;case 13:t.memoizedState===null&&(t=t.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&ade(t))));return;case 19:case 17:case 20:case 21:case 23:case 24:return}throw Error(It(163))}function dee(i,e){for(var t=i;;){if(t.tag===5){var n=t.stateNode;if(e)n=n.style,typeof n.setProperty=="function"?n.setProperty("display","none","important"):n.display="none";else{n=t.stateNode;var o=t.memoizedProps.style;o=o!=null&&o.hasOwnProperty("display")?o.display:null,n.style.display=Yue("display",o)}}else if(t.tag===6)t.stateNode.nodeValue=e?"":t.memoizedProps;else if((t.tag!==23&&t.tag!==24||t.memoizedState===null||t===i)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===i)break;for(;t.sibling===null;){if(t.return===null||t.return===i)return;t=t.return}t.sibling.return=t.return,t=t.sibling}}function hee(i,e){if(b0&&typeof b0.onCommitFiberUnmount=="function")try{b0.onCommitFiberUnmount(Tj,e)}catch{}switch(e.tag){case 0:case 11:case 14:case 15:case 22:if(i=e.updateQueue,i!==null&&(i=i.lastEffect,i!==null)){var t=i=i.next;do{var n=t,o=n.destroy;if(n=n.tag,o!==void 0)if((n&4)!==0)hhe(e,t);else{n=e;try{o()}catch(r){Vm(n,r)}}t=t.next}while(t!==i)}break;case 1:if(uee(e),i=e.stateNode,typeof i.componentWillUnmount=="function")try{i.props=e.memoizedProps,i.state=e.memoizedState,i.componentWillUnmount()}catch(r){Vm(e,r)}break;case 5:uee(e);break;case 4:ohe(i,e)}}function fee(i){i.alternate=null,i.child=null,i.dependencies=null,i.firstEffect=null,i.lastEffect=null,i.memoizedProps=null,i.memoizedState=null,i.pendingProps=null,i.return=null,i.updateQueue=null}function gee(i){return i.tag===5||i.tag===3||i.tag===4}function pee(i){e:{for(var e=i.return;e!==null;){if(gee(e))break e;e=e.return}throw Error(It(160))}var t=e;switch(e=t.stateNode,t.tag){case 5:var n=!1;break;case 3:e=e.containerInfo,n=!0;break;case 4:e=e.containerInfo,n=!0;break;default:throw Error(It(161))}t.flags&16&&(VE(e,""),t.flags&=-17);e:t:for(t=i;;){for(;t.sibling===null;){if(t.return===null||gee(t.return)){t=null;break e}t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue t;t.child.return=t,t=t.child}if(!(t.flags&2)){t=t.stateNode;break e}}n?hB(i,t,e):fB(i,t,e)}function hB(i,e,t){var n=i.tag,o=n===5||n===6;if(o)i=o?i.stateNode:i.stateNode.instance,e?t.nodeType===8?t.parentNode.insertBefore(i,e):t.insertBefore(i,e):(t.nodeType===8?(e=t.parentNode,e.insertBefore(i,t)):(e=t,e.appendChild(i)),t=t._reactRootContainer,t!=null||e.onclick!==null||(e.onclick=BM));else if(n!==4&&(i=i.child,i!==null))for(hB(i,e,t),i=i.sibling;i!==null;)hB(i,e,t),i=i.sibling}function fB(i,e,t){var n=i.tag,o=n===5||n===6;if(o)i=o?i.stateNode:i.stateNode.instance,e?t.insertBefore(i,e):t.appendChild(i);else if(n!==4&&(i=i.child,i!==null))for(fB(i,e,t),i=i.sibling;i!==null;)fB(i,e,t),i=i.sibling}function ohe(i,e){for(var t=e,n=!1,o,r;;){if(!n){n=t.return;e:for(;;){if(n===null)throw Error(It(160));switch(o=n.stateNode,n.tag){case 5:r=!1;break e;case 3:o=o.containerInfo,r=!0;break e;case 4:o=o.containerInfo,r=!0;break e}n=n.return}n=!0}if(t.tag===5||t.tag===6){e:for(var s=i,a=t,l=a;;)if(hee(s,l),l.child!==null&&l.tag!==4)l.child.return=l,l=l.child;else{if(l===a)break e;for(;l.sibling===null;){if(l.return===null||l.return===a)break e;l=l.return}l.sibling.return=l.return,l=l.sibling}r?(s=o,a=t.stateNode,s.nodeType===8?s.parentNode.removeChild(a):s.removeChild(a)):o.removeChild(t.stateNode)}else if(t.tag===4){if(t.child!==null){o=t.stateNode.containerInfo,r=!0,t.child.return=t,t=t.child;continue}}else if(hee(i,t),t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return;t=t.return,t.tag===4&&(n=!1)}t.sibling.return=t.return,t=t.sibling}}function I8(i,e){switch(e.tag){case 0:case 11:case 14:case 15:case 22:var t=e.updateQueue;if(t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do(n.tag&3)===3&&(i=n.destroy,n.destroy=void 0,i!==void 0&&i()),n=n.next;while(n!==t)}return;case 1:return;case 5:if(t=e.stateNode,t!=null){n=e.memoizedProps;var o=i!==null?i.memoizedProps:n;i=e.type;var r=e.updateQueue;if(e.updateQueue=null,r!==null){for(t[WM]=n,i==="input"&&n.type==="radio"&&n.name!=null&&Kue(t,n),j7(i,o),e=j7(i,n),o=0;oo&&(o=s),t&=~r}if(t=o,t=Na()-t,t=(120>t?120:480>t?480:1080>t?1080:1920>t?1920:3e3>t?3e3:4320>t?4320:1960*eRe(t/1960))-t,10o&&(o=s),t&=~r}if(t=o,t=Ra()-t,t=(120>t?120:480>t?480:1080>t?1080:1920>t?1920:3e3>t?3e3:4320>t?4320:1960*dRe(t/1960))-t,10 component higher in the tree to provide a loading indicator or placeholder to display.`)}Zs!==5&&(Zs=2),l=$j(l,a),h=s;do{switch(h.tag){case 3:r=l,h.flags|=4096,e&=-e,h.lanes|=e;var L=nhe(h,r,e);UJ(h,L);break e;case 1:r=l;var D=h.type,E=h.stateNode;if((h.flags&64)===0&&(typeof D.getDerivedStateFromError=="function"||E!==null&&typeof E.componentDidCatch=="function"&&($h===null||!$h.has(E)))){h.flags|=4096,e&=-e,h.lanes|=e;var I=ihe(h,r,e);UJ(h,I);break e}}h=h.return}while(h!==null)}dhe(t)}catch(k){e=k,_s===t&&t!==null&&(_s=t=t.return);continue}break}while(1)}function che(){var i=QM.current;return QM.current=ZM,i===null?ZM:i}function uL(i,e){var t=Zn;Zn|=16;var n=che();rl===i&&Ma===e||aw(i,e);do try{nRe();break}catch(o){lhe(i,o)}while(1);if(Rj(),Zn=t,QM.current=n,_s!==null)throw Error(It(261));return rl=null,Ma=0,Zs}function nRe(){for(;_s!==null;)uhe(_s)}function iRe(){for(;_s!==null&&!B2e();)uhe(_s)}function uhe(i){var e=fhe(i.alternate,i,W0);i.memoizedProps=i.pendingProps,e===null?dhe(i):_s=e,zj.current=null}function dhe(i){var e=i;do{var t=e.alternate;if(i=e.return,(e.flags&2048)===0){if(t=q2e(t,e,W0),t!==null){_s=t;return}if(t=e,t.tag!==24&&t.tag!==23||t.memoizedState===null||(W0&1073741824)!==0||(t.mode&4)===0){for(var n=0,o=t.child;o!==null;)n|=o.lanes|o.childLanes,o=o.sibling;t.childLanes=n}i!==null&&(i.flags&2048)===0&&(i.firstEffect===null&&(i.firstEffect=e.firstEffect),e.lastEffect!==null&&(i.lastEffect!==null&&(i.lastEffect.nextEffect=e.firstEffect),i.lastEffect=e.lastEffect),1s&&(a=s,s=L,L=a),a=IJ(_,L),r=IJ(_,s),a&&r&&(y.rangeCount!==1||y.anchorNode!==a.node||y.anchorOffset!==a.offset||y.focusNode!==r.node||y.focusOffset!==r.offset)&&(w=w.createRange(),w.setStart(a.node,a.offset),y.removeAllRanges(),L>s?(y.addRange(w),y.extend(r.node,r.offset)):(w.setEnd(r.node,r.offset),y.addRange(w)))))),w=[],y=_;y=y.parentNode;)y.nodeType===1&&w.push({element:y,left:y.scrollLeft,top:y.scrollTop});for(typeof _.focus=="function"&&_.focus(),_=0;_Na()-jj?aw(i,0):Uj|=t),Au(i,e)}function cRe(i,e){var t=i.stateNode;t!==null&&t.delete(e),e=0,e===0&&(e=i.mode,(e&2)===0?e=1:(e&4)===0?e=Zw()===99?1:2:(wg===0&&(wg=iS),e=sC(62914560&~wg),e===0&&(e=4194304))),t=Tc(),i=KO(i,e),i!==null&&(BO(i,e,t),Au(i,t))}var fhe;fhe=function(i,e,t){var n=e.lanes;if(i!==null)if(i.memoizedProps!==e.pendingProps||zl.current)Id=!0;else if((t&n)!==0)Id=(i.flags&16384)!==0;else{switch(Id=!1,e.tag){case 3:iee(e),E8();break;case 5:GJ(e);break;case 1:Ul(e.type)&&SR(e);break;case 4:rB(e,e.stateNode.containerInfo);break;case 10:n=e.memoizedProps.value;var o=e.type._context;Er(HM,o._currentValue),o._currentValue=n;break;case 13:if(e.memoizedState!==null)return(t&e.child.childLanes)!==0?oee(i,e,t):(Er(Sr,Sr.current&1),e=Ig(i,e,t),e!==null?e.sibling:null);Er(Sr,Sr.current&1);break;case 19:if(n=(t&e.childLanes)!==0,(i.flags&64)!==0){if(n)return cee(i,e,t);e.flags|=64}if(o=e.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),Er(Sr,Sr.current),n)break;return null;case 23:case 24:return e.lanes=0,D8(i,e,t)}return Ig(i,e,t)}else Id=!1;switch(e.lanes=0,e.tag){case 2:if(n=e.type,i!==null&&(i.alternate=null,e.alternate=null,e.flags|=2),i=e.pendingProps,o=Yw(e,Pa.current),ow(e,t),o=Bj(null,e,n,i,o,t),e.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0){if(e.tag=1,e.memoizedState=null,e.updateQueue=null,Ul(n)){var r=!0;SR(e)}else r=!1;e.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,Aj(e);var s=n.getDerivedStateFromProps;typeof s=="function"&&UM(e,n,s,i),o.updater=UO,e.stateNode=o,o._reactInternals=e,oB(e,n,i,t),e=cB(null,e,n,!0,r,t)}else e.tag=0,Il(null,e,o,t),e=e.child;return e;case 16:o=e.elementType;e:{switch(i!==null&&(i.alternate=null,e.alternate=null,e.flags|=2),i=e.pendingProps,r=o._init,o=r(o._payload),e.type=o,r=e.tag=dRe(o),i=cd(o,i),r){case 0:e=lB(null,e,o,i,t);break e;case 1:e=nee(null,e,o,i,t);break e;case 11:e=eee(null,e,o,i,t);break e;case 14:e=tee(null,e,o,cd(o.type,i),n,t);break e}throw Error(It(306,o,""))}return e;case 0:return n=e.type,o=e.pendingProps,o=e.elementType===n?o:cd(n,o),lB(i,e,n,o,t);case 1:return n=e.type,o=e.pendingProps,o=e.elementType===n?o:cd(n,o),nee(i,e,n,o,t);case 3:if(iee(e),n=e.updateQueue,i===null||n===null)throw Error(It(282));if(n=e.pendingProps,o=e.memoizedState,o=o!==null?o.element:null,Bde(i,e),XE(e,n,null,t),n=e.memoizedState.element,n===o)E8(),e=Ig(i,e,t);else{if(o=e.stateNode,(r=o.hydrate)&&(pm=iw(e.stateNode.containerInfo.firstChild),kg=e,r=tf=!0),r){if(i=o.mutableSourceEagerHydrationData,i!=null)for(o=0;oWL.exports.unstable_runWithPriority(WL.exports.unstable_NormalPriority,i):i=>i(),wRe=i=>i;function yRe(i){const e=x.exports.createContext({[IR]:{v:{current:i},n:{current:-1},l:new Set,u:n=>n()}});var t;return e[bRe]=e.Provider,e.Provider=(t=e.Provider,({value:n,children:o})=>{const r=x.exports.useRef(n),s=x.exports.useRef(0),[a,l]=x.exports.useState(null);a&&(a(n),l(null));const c=x.exports.useRef();if(!c.current){const u=new Set,d=(h,f)=>{uf.exports.unstable_batchedUpdates(()=>{s.current+=1;const g={n:s.current};f!=null&&f.suspense&&(g.n*=-1,g.p=new Promise(p=>{l(()=>v=>{g.v=v,delete g.p,p(v)})})),u.forEach(p=>p(g)),h()})};c.current={[IR]:{v:r,n:s,l:u,u:d}}}return mhe(()=>{r.current=n,s.current+=1,CRe(()=>{c.current[IR].l.forEach(u=>{u({n:s.current,v:n})})})},[n]),x.exports.createElement(t,{value:c.current},o)}),delete e.Consumer,e}function vhe(i,e){const t=x.exports.useContext(i)[IR],{v:{current:n},n:{current:o},l:r}=t,s=e(n),[a,l]=x.exports.useReducer((c,u)=>{if(!u)return[n,s];if("p"in u)throw u.p;if(u.n===o)return Object.is(c[1],s)?c:[n,s];try{if("v"in u){if(Object.is(c[0],u.v))return c;const d=e(u.v);return Object.is(c[1],d)?c:[u.v,d]}}catch{}return[...c]},[n,s]);return Object.is(a[1],s)||l(),mhe(()=>(r.add(l),()=>{r.delete(l)}),[r]),a[1]}function SRe(i){return vhe(i,wRe)}function ha(i){if(typeof i=="string"||typeof i=="number")return""+i;let e="";if(Array.isArray(i))for(let t=0,n;t component higher in the tree to provide a loading indicator or placeholder to display.`)}Qs!==5&&(Qs=2),l=Kj(l,a),h=s;do{switch(h.tag){case 3:r=l,h.flags|=4096,e&=-e,h.lanes|=e;var L=she(h,r,e);QJ(h,L);break e;case 1:r=l;var D=h.type,E=h.stateNode;if((h.flags&64)===0&&(typeof D.getDerivedStateFromError=="function"||E!==null&&typeof E.componentDidCatch=="function"&&(Uh===null||!Uh.has(E)))){h.flags|=4096,e&=-e,h.lanes|=e;var I=ahe(h,r,e);QJ(h,I);break e}}h=h.return}while(h!==null)}phe(t)}catch(k){e=k,bs===t&&t!==null&&(bs=t=t.return);continue}break}while(1)}function fhe(){var i=tA.current;return tA.current=eA,i===null?eA:i}function dL(i,e){var t=Zn;Zn|=16;var n=fhe();sl===i&&Aa===e||ay(i,e);do try{fRe();break}catch(o){hhe(i,o)}while(1);if(Oj(),Zn=t,tA.current=n,bs!==null)throw Error(Tt(261));return sl=null,Aa=0,Qs}function fRe(){for(;bs!==null;)ghe(bs)}function gRe(){for(;bs!==null&&!X2e();)ghe(bs)}function ghe(i){var e=vhe(i.alternate,i,V0);i.memoizedProps=i.pendingProps,e===null?phe(i):bs=e,qj.current=null}function phe(i){var e=i;do{var t=e.alternate;if(i=e.return,(e.flags&2048)===0){if(t=oRe(t,e,V0),t!==null){bs=t;return}if(t=e,t.tag!==24&&t.tag!==23||t.memoizedState===null||(V0&1073741824)!==0||(t.mode&4)===0){for(var n=0,o=t.child;o!==null;)n|=o.lanes|o.childLanes,o=o.sibling;t.childLanes=n}i!==null&&(i.flags&2048)===0&&(i.firstEffect===null&&(i.firstEffect=e.firstEffect),e.lastEffect!==null&&(i.lastEffect!==null&&(i.lastEffect.nextEffect=e.firstEffect),i.lastEffect=e.lastEffect),1s&&(a=s,s=L,L=a),a=FJ(_,L),r=FJ(_,s),a&&r&&(w.rangeCount!==1||w.anchorNode!==a.node||w.anchorOffset!==a.offset||w.focusNode!==r.node||w.focusOffset!==r.offset)&&(y=y.createRange(),y.setStart(a.node,a.offset),w.removeAllRanges(),L>s?(w.addRange(y),w.extend(r.node,r.offset)):(y.setEnd(r.node,r.offset),w.addRange(y)))))),y=[],w=_;w=w.parentNode;)w.nodeType===1&&y.push({element:w,left:w.scrollLeft,top:w.scrollTop});for(typeof _.focus=="function"&&_.focus(),_=0;_Ra()-Xj?ay(i,0):Gj|=t),Pu(i,e)}function CRe(i,e){var t=i.stateNode;t!==null&&t.delete(e),e=0,e===0&&(e=i.mode,(e&2)===0?e=1:(e&4)===0?e=Zy()===99?1:2:(wg===0&&(wg=oS),e=sC(62914560&~wg),e===0&&(e=4194304))),t=Nc(),i=XO(i,e),i!==null&&(HO(i,e,t),Pu(i,t))}var vhe;vhe=function(i,e,t){var n=e.lanes;if(i!==null)if(i.memoizedProps!==e.pendingProps||Ul.current)Id=!0;else if((t&n)!==0)Id=(i.flags&16384)!==0;else{switch(Id=!1,e.tag){case 3:dee(e),E8();break;case 5:nee(e);break;case 1:jl(e.type)&&ER(e);break;case 4:lB(e,e.stateNode.containerInfo);break;case 10:n=e.memoizedProps.value;var o=e.type._context;Er(UM,o._currentValue),o._currentValue=n;break;case 13:if(e.memoizedState!==null)return(t&e.child.childLanes)!==0?hee(i,e,t):(Er(xr,xr.current&1),e=Tg(i,e,t),e!==null?e.sibling:null);Er(xr,xr.current&1);break;case 19:if(n=(t&e.childLanes)!==0,(i.flags&64)!==0){if(n)return vee(i,e,t);e.flags|=64}if(o=e.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),Er(xr,xr.current),n)break;return null;case 23:case 24:return e.lanes=0,D8(i,e,t)}return Tg(i,e,t)}else Id=!1;switch(e.lanes=0,e.tag){case 2:if(n=e.type,i!==null&&(i.alternate=null,e.alternate=null,e.flags|=2),i=e.pendingProps,o=Yy(e,Oa.current),oy(e,t),o=$j(null,e,n,i,o,t),e.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0){if(e.tag=1,e.memoizedState=null,e.updateQueue=null,jl(n)){var r=!0;ER(e)}else r=!1;e.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,Bj(e);var s=n.getDerivedStateFromProps;typeof s=="function"&&qM(e,n,s,i),o.updater=qO,e.stateNode=o,o._reactInternals=e,aB(e,n,i,t),e=hB(null,e,n,!0,r,t)}else e.tag=0,Tl(null,e,o,t),e=e.child;return e;case 16:o=e.elementType;e:{switch(i!==null&&(i.alternate=null,e.alternate=null,e.flags|=2),i=e.pendingProps,r=o._init,o=r(o._payload),e.type=o,r=e.tag=wRe(o),i=ud(o,i),r){case 0:e=dB(null,e,o,i,t);break e;case 1:e=uee(null,e,o,i,t);break e;case 11:e=lee(null,e,o,i,t);break e;case 14:e=cee(null,e,o,ud(o.type,i),n,t);break e}throw Error(Tt(306,o,""))}return e;case 0:return n=e.type,o=e.pendingProps,o=e.elementType===n?o:ud(n,o),dB(i,e,n,o,t);case 1:return n=e.type,o=e.pendingProps,o=e.elementType===n?o:ud(n,o),uee(i,e,n,o,t);case 3:if(dee(e),n=e.updateQueue,i===null||n===null)throw Error(Tt(282));if(n=e.pendingProps,o=e.memoizedState,o=o!==null?o.element:null,$de(i,e),YE(e,n,null,t),n=e.memoizedState.element,n===o)E8(),e=Tg(i,e,t);else{if(o=e.stateNode,(r=o.hydrate)&&(mm=iy(e.stateNode.containerInfo.firstChild),Ig=e,r=of=!0),r){if(i=o.mutableSourceEagerHydrationData,i!=null)for(o=0;oVL.exports.unstable_runWithPriority(VL.exports.unstable_NormalPriority,i):i=>i(),RRe=i=>i;function yhe(i){const e=x.exports.createContext({[RR]:{v:{current:i},n:{current:-1},l:new Set,u:n=>n()}});var t;return e[TRe]=e.Provider,e.Provider=(t=e.Provider,({value:n,children:o})=>{const r=x.exports.useRef(n),s=x.exports.useRef(0),[a,l]=x.exports.useState(null);a&&(a(n),l(null));const c=x.exports.useRef();if(!c.current){const u=new Set,d=(h,f)=>{zd.exports.unstable_batchedUpdates(()=>{s.current+=1;const g={n:s.current};f!=null&&f.suspense&&(g.n*=-1,g.p=new Promise(p=>{l(()=>v=>{g.v=v,delete g.p,p(v)})})),u.forEach(p=>p(g)),h()})};c.current={[RR]:{v:r,n:s,l:u,u:d}}}return Che(()=>{r.current=n,s.current+=1,NRe(()=>{c.current[RR].l.forEach(u=>{u({n:s.current,v:n})})})},[n]),x.exports.createElement(t,{value:c.current},o)}),delete e.Consumer,e}function whe(i,e){const t=x.exports.useContext(i)[RR],{v:{current:n},n:{current:o},l:r}=t,s=e(n),[a,l]=x.exports.useReducer((c,u)=>{if(!u)return[n,s];if("p"in u)throw u.p;if(u.n===o)return Object.is(c[1],s)?c:[n,s];try{if("v"in u){if(Object.is(c[0],u.v))return c;const d=e(u.v);return Object.is(c[1],d)?c:[u.v,d]}}catch{}return[...c]},[n,s]);return Object.is(a[1],s)||l(),Che(()=>(r.add(l),()=>{r.delete(l)}),[r]),a[1]}function She(i){return whe(i,RRe)}function fa(i){if(typeof i=="string"||typeof i=="number")return""+i;let e="";if(Array.isArray(i))for(let t=0,n;t component higher in the tree to provide a loading * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var Jw=x.exports;function xRe(i,e){return i===e&&(i!==0||1/i===1/e)||i!==i&&e!==e}var LRe=typeof Object.is=="function"?Object.is:xRe,ERe=Jw.useState,DRe=Jw.useEffect,kRe=Jw.useLayoutEffect,IRe=Jw.useDebugValue;function TRe(i,e){var t=e(),n=ERe({inst:{value:t,getSnapshot:e}}),o=n[0].inst,r=n[1];return kRe(function(){o.value=t,o.getSnapshot=e,M8(o)&&r({inst:o})},[i,t,e]),DRe(function(){return M8(o)&&r({inst:o}),i(function(){M8(o)&&r({inst:o})})},[i]),IRe(t),t}function M8(i){var e=i.getSnapshot;i=i.value;try{var t=e();return!LRe(i,t)}catch{return!0}}function NRe(i,e){return e()}var RRe=typeof window=="undefined"||typeof window.document=="undefined"||typeof window.document.createElement=="undefined"?NRe:TRe;whe.useSyncExternalStore=Jw.useSyncExternalStore!==void 0?Jw.useSyncExternalStore:RRe;Che.exports=whe;/** + */var Jy=x.exports;function MRe(i,e){return i===e&&(i!==0||1/i===1/e)||i!==i&&e!==e}var ARe=typeof Object.is=="function"?Object.is:MRe,PRe=Jy.useState,ORe=Jy.useEffect,FRe=Jy.useLayoutEffect,BRe=Jy.useDebugValue;function WRe(i,e){var t=e(),n=PRe({inst:{value:t,getSnapshot:e}}),o=n[0].inst,r=n[1];return FRe(function(){o.value=t,o.getSnapshot=e,M8(o)&&r({inst:o})},[i,t,e]),ORe(function(){return M8(o)&&r({inst:o}),i(function(){M8(o)&&r({inst:o})})},[i]),BRe(t),t}function M8(i){var e=i.getSnapshot;i=i.value;try{var t=e();return!ARe(i,t)}catch{return!0}}function VRe(i,e){return e()}var HRe=typeof window=="undefined"||typeof window.document=="undefined"||typeof window.document.createElement=="undefined"?VRe:WRe;Dhe.useSyncExternalStore=Jy.useSyncExternalStore!==void 0?Jy.useSyncExternalStore:HRe;Ehe.exports=Dhe;/** * @license React * use-sync-external-store-shim/with-selector.production.min.js * @@ -47,19 +47,19 @@ Add a component higher in the tree to provide a loading * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var GO=x.exports,MRe=Che.exports;function ARe(i,e){return i===e&&(i!==0||1/i===1/e)||i!==i&&e!==e}var PRe=typeof Object.is=="function"?Object.is:ARe,ORe=MRe.useSyncExternalStore,FRe=GO.useRef,BRe=GO.useEffect,WRe=GO.useMemo,VRe=GO.useDebugValue;bhe.useSyncExternalStoreWithSelector=function(i,e,t,n,o){var r=FRe(null);if(r.current===null){var s={hasValue:!1,value:null};r.current=s}else s=r.current;r=WRe(function(){function l(f){if(!c){if(c=!0,u=f,f=n(f),o!==void 0&&s.hasValue){var g=s.value;if(o(g,f))return d=g}return d=f}if(g=d,PRe(u,f))return g;var p=n(f);return o!==void 0&&o(g,p)?g:(u=f,d=p)}var c=!1,u,d,h=t===void 0?null:t;return[function(){return l(e())},h===null?void 0:function(){return l(h())}]},[e,t,n,o]);var a=ORe(i,r[0],r[1]);return BRe(function(){s.hasValue=!0,s.value=a},[a]),VRe(a),a};_he.exports=bhe;var HRe=_he.exports;const bee=i=>{let e;const t=new Set,n=(u,d)=>{const h=typeof u=="function"?u(e):u;if(!Object.is(h,e)){const f=e;e=(d!=null?d:typeof h!="object"||h===null)?h:Object.assign({},e,h),t.forEach(g=>g(e,f))}},o=()=>e,l={setState:n,getState:o,getInitialState:()=>c,subscribe:u=>(t.add(u),()=>t.delete(u)),destroy:()=>{t.clear()}},c=e=i(n,o,l);return l},$Re=i=>i?bee(i):bee,{useDebugValue:zRe}=Bt,{useSyncExternalStoreWithSelector:URe}=HRe,jRe=i=>i;function yhe(i,e=jRe,t){const n=URe(i.subscribe,i.getState,i.getServerState||i.getInitialState,e,t);return zRe(n),n}const Cee=(i,e)=>{const t=$Re(i),n=(o,r=e)=>yhe(t,o,r);return Object.assign(n,t),n},KRe=(i,e)=>i?Cee(i,e):Cee;function Hs(i,e){if(Object.is(i,e))return!0;if(typeof i!="object"||i===null||typeof e!="object"||e===null)return!1;if(i instanceof Map&&e instanceof Map){if(i.size!==e.size)return!1;for(const[n,o]of i)if(!Object.is(o,e.get(n)))return!1;return!0}if(i instanceof Set&&e instanceof Set){if(i.size!==e.size)return!1;for(const n of i)if(!e.has(n))return!1;return!0}const t=Object.keys(i);if(t.length!==Object.keys(e).length)return!1;for(let n=0;n{}};function XO(){for(var i=0,e=arguments.length,t={},n;i=0&&(n=t.slice(o+1),t=t.slice(0,o)),t&&!e.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:n}})}TR.prototype=XO.prototype={constructor:TR,on:function(i,e){var t=this._,n=GRe(i+"",t),o,r=-1,s=n.length;if(arguments.length<2){for(;++r0)for(var t=new Array(o),n=0,o,r;n=0&&(e=i.slice(0,t))!=="xmlns"&&(i=i.slice(t+1)),yee.hasOwnProperty(e)?{space:yee[e],local:i}:i}function YRe(i){return function(){var e=this.ownerDocument,t=this.namespaceURI;return t===yB&&e.documentElement.namespaceURI===yB?e.createElement(i):e.createElementNS(t,i)}}function ZRe(i){return function(){return this.ownerDocument.createElementNS(i.space,i.local)}}function She(i){var e=YO(i);return(e.local?ZRe:YRe)(e)}function QRe(){}function Qj(i){return i==null?QRe:function(){return this.querySelector(i)}}function JRe(i){typeof i!="function"&&(i=Qj(i));for(var e=this._groups,t=e.length,n=new Array(t),o=0;o=w&&(w=_+1);!(L=v[w])&&++w=0;)(s=n[o])&&(r&&s.compareDocumentPosition(r)^4&&r.parentNode.insertBefore(s,r),r=s);return this}function xMe(i){i||(i=LMe);function e(d,h){return d&&h?i(d.__data__,h.__data__):!d-!h}for(var t=this._groups,n=t.length,o=new Array(n),r=0;re?1:i>=e?0:NaN}function EMe(){var i=arguments[0];return arguments[0]=this,i.apply(null,arguments),this}function DMe(){return Array.from(this)}function kMe(){for(var i=this._groups,e=0,t=i.length;e1?this.each((e==null?WMe:typeof e=="function"?HMe:VMe)(i,e,t==null?"":t)):ey(this.node(),i)}function ey(i,e){return i.style.getPropertyValue(e)||khe(i).getComputedStyle(i,null).getPropertyValue(e)}function zMe(i){return function(){delete this[i]}}function UMe(i,e){return function(){this[i]=e}}function jMe(i,e){return function(){var t=e.apply(this,arguments);t==null?delete this[i]:this[i]=t}}function KMe(i,e){return arguments.length>1?this.each((e==null?zMe:typeof e=="function"?jMe:UMe)(i,e)):this.node()[i]}function Ihe(i){return i.trim().split(/^|\s+/)}function Jj(i){return i.classList||new The(i)}function The(i){this._node=i,this._names=Ihe(i.getAttribute("class")||"")}The.prototype={add:function(i){var e=this._names.indexOf(i);e<0&&(this._names.push(i),this._node.setAttribute("class",this._names.join(" ")))},remove:function(i){var e=this._names.indexOf(i);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(i){return this._names.indexOf(i)>=0}};function Nhe(i,e){for(var t=Jj(i),n=-1,o=e.length;++n=0&&(t=e.slice(n+1),e=e.slice(0,n)),{type:e,name:t}})}function CAe(i){return function(){var e=this.__on;if(!!e){for(var t=0,n=-1,o=e.length,r;t()=>i;function SB(i,{sourceEvent:e,subject:t,target:n,identifier:o,active:r,x:s,y:a,dx:l,dy:c,dispatch:u}){Object.defineProperties(this,{type:{value:i,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},subject:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},identifier:{value:o,enumerable:!0,configurable:!0},active:{value:r,enumerable:!0,configurable:!0},x:{value:s,enumerable:!0,configurable:!0},y:{value:a,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:c,enumerable:!0,configurable:!0},_:{value:u}})}SB.prototype.on=function(){var i=this._.on.apply(this._,arguments);return i===this._?this:i};function TAe(i){return!i.ctrlKey&&!i.button}function NAe(){return this.parentNode}function RAe(i,e){return e==null?{x:i.x,y:i.y}:e}function MAe(){return navigator.maxTouchPoints||"ontouchstart"in this}function AAe(){var i=TAe,e=NAe,t=RAe,n=MAe,o={},r=XO("start","drag","end"),s=0,a,l,c,u,d=0;function h(y){y.on("mousedown.drag",f).filter(n).on("touchstart.drag",v).on("touchmove.drag",m,IAe).on("touchend.drag touchcancel.drag",_).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function f(y,L){if(!(u||!i.call(this,y,L))){var D=w(this,e.call(this,y,L),y,L,"mouse");!D||(bu(y.view).on("mousemove.drag",g,JE).on("mouseup.drag",p,JE),Phe(y.view),A8(y),c=!1,a=y.clientX,l=y.clientY,D("start",y))}}function g(y){if(cw(y),!c){var L=y.clientX-a,D=y.clientY-l;c=L*L+D*D>d}o.mouse("drag",y)}function p(y){bu(y.view).on("mousemove.drag mouseup.drag",null),Ohe(y.view,c),cw(y),o.mouse("end",y)}function v(y,L){if(!!i.call(this,y,L)){var D=y.changedTouches,E=e.call(this,y,L),I=D.length,k,R;for(k=0;k>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):t===8?EN(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):t===4?EN(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=OAe.exec(i))?new Bl(e[1],e[2],e[3],1):(e=FAe.exec(i))?new Bl(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=BAe.exec(i))?EN(e[1],e[2],e[3],e[4]):(e=WAe.exec(i))?EN(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=VAe.exec(i))?Iee(e[1],e[2]/100,e[3]/100,1):(e=HAe.exec(i))?Iee(e[1],e[2]/100,e[3]/100,e[4]):See.hasOwnProperty(i)?Eee(See[i]):i==="transparent"?new Bl(NaN,NaN,NaN,0):null}function Eee(i){return new Bl(i>>16&255,i>>8&255,i&255,1)}function EN(i,e,t,n){return n<=0&&(i=e=t=NaN),new Bl(i,e,t,n)}function UAe(i){return i instanceof _I||(i=nD(i)),i?(i=i.rgb(),new Bl(i.r,i.g,i.b,i.opacity)):new Bl}function xB(i,e,t,n){return arguments.length===1?UAe(i):new Bl(i,e,t,n==null?1:n)}function Bl(i,e,t,n){this.r=+i,this.g=+e,this.b=+t,this.opacity=+n}eK(Bl,xB,Fhe(_I,{brighter(i){return i=i==null?nA:Math.pow(nA,i),new Bl(this.r*i,this.g*i,this.b*i,this.opacity)},darker(i){return i=i==null?eD:Math.pow(eD,i),new Bl(this.r*i,this.g*i,this.b*i,this.opacity)},rgb(){return this},clamp(){return new Bl(C0(this.r),C0(this.g),C0(this.b),iA(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Dee,formatHex:Dee,formatHex8:jAe,formatRgb:kee,toString:kee}));function Dee(){return`#${J_(this.r)}${J_(this.g)}${J_(this.b)}`}function jAe(){return`#${J_(this.r)}${J_(this.g)}${J_(this.b)}${J_((isNaN(this.opacity)?1:this.opacity)*255)}`}function kee(){const i=iA(this.opacity);return`${i===1?"rgb(":"rgba("}${C0(this.r)}, ${C0(this.g)}, ${C0(this.b)}${i===1?")":`, ${i})`}`}function iA(i){return isNaN(i)?1:Math.max(0,Math.min(1,i))}function C0(i){return Math.max(0,Math.min(255,Math.round(i)||0))}function J_(i){return i=C0(i),(i<16?"0":"")+i.toString(16)}function Iee(i,e,t,n){return n<=0?i=e=t=NaN:t<=0||t>=1?i=e=NaN:e<=0&&(i=NaN),new xd(i,e,t,n)}function Bhe(i){if(i instanceof xd)return new xd(i.h,i.s,i.l,i.opacity);if(i instanceof _I||(i=nD(i)),!i)return new xd;if(i instanceof xd)return i;i=i.rgb();var e=i.r/255,t=i.g/255,n=i.b/255,o=Math.min(e,t,n),r=Math.max(e,t,n),s=NaN,a=r-o,l=(r+o)/2;return a?(e===r?s=(t-n)/a+(t0&&l<1?0:s,new xd(s,a,l,i.opacity)}function KAe(i,e,t,n){return arguments.length===1?Bhe(i):new xd(i,e,t,n==null?1:n)}function xd(i,e,t,n){this.h=+i,this.s=+e,this.l=+t,this.opacity=+n}eK(xd,KAe,Fhe(_I,{brighter(i){return i=i==null?nA:Math.pow(nA,i),new xd(this.h,this.s,this.l*i,this.opacity)},darker(i){return i=i==null?eD:Math.pow(eD,i),new xd(this.h,this.s,this.l*i,this.opacity)},rgb(){var i=this.h%360+(this.h<0)*360,e=isNaN(i)||isNaN(this.s)?0:this.s,t=this.l,n=t+(t<.5?t:1-t)*e,o=2*t-n;return new Bl(P8(i>=240?i-240:i+120,o,n),P8(i,o,n),P8(i<120?i+240:i-120,o,n),this.opacity)},clamp(){return new xd(Tee(this.h),DN(this.s),DN(this.l),iA(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const i=iA(this.opacity);return`${i===1?"hsl(":"hsla("}${Tee(this.h)}, ${DN(this.s)*100}%, ${DN(this.l)*100}%${i===1?")":`, ${i})`}`}}));function Tee(i){return i=(i||0)%360,i<0?i+360:i}function DN(i){return Math.max(0,Math.min(1,i||0))}function P8(i,e,t){return(i<60?e+(t-e)*i/60:i<180?t:i<240?e+(t-e)*(240-i)/60:e)*255}var Whe=i=>()=>i;function qAe(i,e){return function(t){return i+t*e}}function GAe(i,e,t){return i=Math.pow(i,t),e=Math.pow(e,t)-i,t=1/t,function(n){return Math.pow(i+n*e,t)}}function XAe(i){return(i=+i)==1?Vhe:function(e,t){return t-e?GAe(e,t,i):Whe(isNaN(e)?t:e)}}function Vhe(i,e){var t=e-i;return t?qAe(i,t):Whe(isNaN(i)?e:i)}var Nee=function i(e){var t=XAe(e);function n(o,r){var s=t((o=xB(o)).r,(r=xB(r)).r),a=t(o.g,r.g),l=t(o.b,r.b),c=Vhe(o.opacity,r.opacity);return function(u){return o.r=s(u),o.g=a(u),o.b=l(u),o.opacity=c(u),o+""}}return n.gamma=i,n}(1);function Qp(i,e){return i=+i,e=+e,function(t){return i*(1-t)+e*t}}var LB=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,O8=new RegExp(LB.source,"g");function YAe(i){return function(){return i}}function ZAe(i){return function(e){return i(e)+""}}function QAe(i,e){var t=LB.lastIndex=O8.lastIndex=0,n,o,r,s=-1,a=[],l=[];for(i=i+"",e=e+"";(n=LB.exec(i))&&(o=O8.exec(e));)(r=o.index)>t&&(r=e.slice(t,r),a[s]?a[s]+=r:a[++s]=r),(n=n[0])===(o=o[0])?a[s]?a[s]+=o:a[++s]=o:(a[++s]=null,l.push({i:s,x:Qp(n,o)})),t=O8.lastIndex;return t180?u+=360:u-c>180&&(c+=360),h.push({i:d.push(o(d)+"rotate(",null,n)-2,x:Qp(c,u)})):u&&d.push(o(d)+"rotate("+u+n)}function a(c,u,d,h){c!==u?h.push({i:d.push(o(d)+"skewX(",null,n)-2,x:Qp(c,u)}):u&&d.push(o(d)+"skewX("+u+n)}function l(c,u,d,h,f,g){if(c!==d||u!==h){var p=f.push(o(f)+"scale(",null,",",null,")");g.push({i:p-4,x:Qp(c,d)},{i:p-2,x:Qp(u,h)})}else(d!==1||h!==1)&&f.push(o(f)+"scale("+d+","+h+")")}return function(c,u){var d=[],h=[];return c=i(c),u=i(u),r(c.translateX,c.translateY,u.translateX,u.translateY,d,h),s(c.rotate,u.rotate,d,h),a(c.skewX,u.skewX,d,h),l(c.scaleX,c.scaleY,u.scaleX,u.scaleY,d,h),c=u=null,function(f){for(var g=-1,p=h.length,v;++g=0&&i._call.call(void 0,e),i=i._next;--ty}function Aee(){V0=(rA=iD.now())+ZO,ty=dL=0;try{lPe()}finally{ty=0,uPe(),V0=0}}function cPe(){var i=iD.now(),e=i-rA;e>zhe&&(ZO-=e,rA=i)}function uPe(){for(var i,e=oA,t,n=1/0;e;)e._call?(n>e._time&&(n=e._time),i=e,e=e._next):(t=e._next,e._next=null,e=i?i._next=t:oA=t);hL=i,DB(n)}function DB(i){if(!ty){dL&&(dL=clearTimeout(dL));var e=i-V0;e>24?(i<1/0&&(dL=setTimeout(Aee,i-iD.now()-ZO)),px&&(px=clearInterval(px))):(px||(rA=iD.now(),px=setInterval(cPe,zhe)),ty=1,Uhe(Aee))}}function Pee(i,e,t){var n=new sA;return e=e==null?0:+e,n.restart(o=>{n.stop(),i(o+e)},e,t),n}var dPe=XO("start","end","cancel","interrupt"),hPe=[],Khe=0,Oee=1,kB=2,NR=3,Fee=4,IB=5,RR=6;function QO(i,e,t,n,o,r){var s=i.__transition;if(!s)i.__transition={};else if(t in s)return;fPe(i,t,{name:e,index:n,group:o,on:dPe,tween:hPe,time:r.time,delay:r.delay,duration:r.duration,ease:r.ease,timer:null,state:Khe})}function nK(i,e){var t=Qd(i,e);if(t.state>Khe)throw new Error("too late; already scheduled");return t}function Ef(i,e){var t=Qd(i,e);if(t.state>NR)throw new Error("too late; already running");return t}function Qd(i,e){var t=i.__transition;if(!t||!(t=t[e]))throw new Error("transition not found");return t}function fPe(i,e,t){var n=i.__transition,o;n[e]=t,t.timer=jhe(r,0,t.time);function r(c){t.state=Oee,t.timer.restart(s,t.delay,t.time),t.delay<=c&&s(c-t.delay)}function s(c){var u,d,h,f;if(t.state!==Oee)return l();for(u in n)if(f=n[u],f.name===t.name){if(f.state===NR)return Pee(s);f.state===Fee?(f.state=RR,f.timer.stop(),f.on.call("interrupt",i,i.__data__,f.index,f.group),delete n[u]):+ukB&&n.state=0&&(e=e.slice(0,t)),!e||e==="start"})}function zPe(i,e,t){var n,o,r=$Pe(e)?nK:Ef;return function(){var s=r(this,i),a=s.on;a!==n&&(o=(n=a).copy()).on(e,t),s.on=o}}function UPe(i,e){var t=this._id;return arguments.length<2?Qd(this.node(),t).on.on(i):this.each(zPe(t,i,e))}function jPe(i){return function(){var e=this.parentNode;for(var t in this.__transition)if(+t!==i)return;e&&e.removeChild(this)}}function KPe(){return this.on("end.remove",jPe(this._id))}function qPe(i){var e=this._name,t=this._id;typeof i!="function"&&(i=Qj(i));for(var n=this._groups,o=n.length,r=new Array(o),s=0;s()=>i;function _Oe(i,{sourceEvent:e,target:t,transform:n,dispatch:o}){Object.defineProperties(this,{type:{value:i,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:t,enumerable:!0,configurable:!0},transform:{value:n,enumerable:!0,configurable:!0},_:{value:o}})}function Tg(i,e,t){this.k=i,this.x=e,this.y=t}Tg.prototype={constructor:Tg,scale:function(i){return i===1?this:new Tg(this.k*i,this.x,this.y)},translate:function(i,e){return i===0&e===0?this:new Tg(this.k,this.x+this.k*i,this.y+this.k*e)},apply:function(i){return[i[0]*this.k+this.x,i[1]*this.k+this.y]},applyX:function(i){return i*this.k+this.x},applyY:function(i){return i*this.k+this.y},invert:function(i){return[(i[0]-this.x)/this.k,(i[1]-this.y)/this.k]},invertX:function(i){return(i-this.x)/this.k},invertY:function(i){return(i-this.y)/this.k},rescaleX:function(i){return i.copy().domain(i.range().map(this.invertX,this).map(i.invert,i))},rescaleY:function(i){return i.copy().domain(i.range().map(this.invertY,this).map(i.invert,i))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var $g=new Tg(1,0,0);Tg.prototype;function F8(i){i.stopImmediatePropagation()}function mx(i){i.preventDefault(),i.stopImmediatePropagation()}function bOe(i){return(!i.ctrlKey||i.type==="wheel")&&!i.button}function COe(){var i=this;return i instanceof SVGElement?(i=i.ownerSVGElement||i,i.hasAttribute("viewBox")?(i=i.viewBox.baseVal,[[i.x,i.y],[i.x+i.width,i.y+i.height]]):[[0,0],[i.width.baseVal.value,i.height.baseVal.value]]):[[0,0],[i.clientWidth,i.clientHeight]]}function Bee(){return this.__zoom||$g}function wOe(i){return-i.deltaY*(i.deltaMode===1?.05:i.deltaMode?1:.002)*(i.ctrlKey?10:1)}function yOe(){return navigator.maxTouchPoints||"ontouchstart"in this}function SOe(i,e,t){var n=i.invertX(e[0][0])-t[0][0],o=i.invertX(e[1][0])-t[1][0],r=i.invertY(e[0][1])-t[0][1],s=i.invertY(e[1][1])-t[1][1];return i.translate(o>n?(n+o)/2:Math.min(0,n)||Math.max(0,o),s>r?(r+s)/2:Math.min(0,r)||Math.max(0,s))}function Yhe(){var i=bOe,e=COe,t=SOe,n=wOe,o=yOe,r=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],a=250,l=sPe,c=XO("start","zoom","end"),u,d,h,f=500,g=150,p=0,v=10;function m(M){M.property("__zoom",Bee).on("wheel.zoom",I,{passive:!1}).on("mousedown.zoom",k).on("dblclick.zoom",R).filter(o).on("touchstart.zoom",A).on("touchmove.zoom",P).on("touchend.zoom touchcancel.zoom",N).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}m.transform=function(M,H,W,F){var $=M.selection?M.selection():M;$.property("__zoom",Bee),M!==$?L(M,H,W,F):$.interrupt().each(function(){D(this,arguments).event(F).start().zoom(null,typeof H=="function"?H.apply(this,arguments):H).end()})},m.scaleBy=function(M,H,W,F){m.scaleTo(M,function(){var $=this.__zoom.k,z=typeof H=="function"?H.apply(this,arguments):H;return $*z},W,F)},m.scaleTo=function(M,H,W,F){m.transform(M,function(){var $=e.apply(this,arguments),z=this.__zoom,K=W==null?y($):typeof W=="function"?W.apply(this,arguments):W,j=z.invert(K),G=typeof H=="function"?H.apply(this,arguments):H;return t(w(_(z,G),K,j),$,s)},W,F)},m.translateBy=function(M,H,W,F){m.transform(M,function(){return t(this.__zoom.translate(typeof H=="function"?H.apply(this,arguments):H,typeof W=="function"?W.apply(this,arguments):W),e.apply(this,arguments),s)},null,F)},m.translateTo=function(M,H,W,F,$){m.transform(M,function(){var z=e.apply(this,arguments),K=this.__zoom,j=F==null?y(z):typeof F=="function"?F.apply(this,arguments):F;return t($g.translate(j[0],j[1]).scale(K.k).translate(typeof H=="function"?-H.apply(this,arguments):-H,typeof W=="function"?-W.apply(this,arguments):-W),z,s)},F,$)};function _(M,H){return H=Math.max(r[0],Math.min(r[1],H)),H===M.k?M:new Tg(H,M.x,M.y)}function w(M,H,W){var F=H[0]-W[0]*M.k,$=H[1]-W[1]*M.k;return F===M.x&&$===M.y?M:new Tg(M.k,F,$)}function y(M){return[(+M[0][0]+ +M[1][0])/2,(+M[0][1]+ +M[1][1])/2]}function L(M,H,W,F){M.on("start.zoom",function(){D(this,arguments).event(F).start()}).on("interrupt.zoom end.zoom",function(){D(this,arguments).event(F).end()}).tween("zoom",function(){var $=this,z=arguments,K=D($,z).event(F),j=e.apply($,z),G=W==null?y(j):typeof W=="function"?W.apply($,z):W,X=Math.max(j[1][0]-j[0][0],j[1][1]-j[0][1]),de=$.__zoom,he=typeof H=="function"?H.apply($,z):H,pe=l(de.invert(G).concat(X/de.k),he.invert(G).concat(X/he.k));return function(be){if(be===1)be=he;else{var Se=pe(be),Fe=X/Se[2];be=new Tg(Fe,G[0]-Se[0]*Fe,G[1]-Se[1]*Fe)}K.zoom(null,be)}})}function D(M,H,W){return!W&&M.__zooming||new E(M,H)}function E(M,H){this.that=M,this.args=H,this.active=0,this.sourceEvent=null,this.extent=e.apply(M,H),this.taps=0}E.prototype={event:function(M){return M&&(this.sourceEvent=M),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(M,H){return this.mouse&&M!=="mouse"&&(this.mouse[1]=H.invert(this.mouse[0])),this.touch0&&M!=="touch"&&(this.touch0[1]=H.invert(this.touch0[0])),this.touch1&&M!=="touch"&&(this.touch1[1]=H.invert(this.touch1[0])),this.that.__zoom=H,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(M){var H=bu(this.that).datum();c.call(M,this.that,new _Oe(M,{sourceEvent:this.sourceEvent,target:m,type:M,transform:this.that.__zoom,dispatch:c}),H)}};function I(M,...H){if(!i.apply(this,arguments))return;var W=D(this,H).event(M),F=this.__zoom,$=Math.max(r[0],Math.min(r[1],F.k*Math.pow(2,n.apply(this,arguments)))),z=fd(M);if(W.wheel)(W.mouse[0][0]!==z[0]||W.mouse[0][1]!==z[1])&&(W.mouse[1]=F.invert(W.mouse[0]=z)),clearTimeout(W.wheel);else{if(F.k===$)return;W.mouse=[z,F.invert(z)],MR(this),W.start()}mx(M),W.wheel=setTimeout(K,g),W.zoom("mouse",t(w(_(F,$),W.mouse[0],W.mouse[1]),W.extent,s));function K(){W.wheel=null,W.end()}}function k(M,...H){if(h||!i.apply(this,arguments))return;var W=M.currentTarget,F=D(this,H,!0).event(M),$=bu(M.view).on("mousemove.zoom",G,!0).on("mouseup.zoom",X,!0),z=fd(M,W),K=M.clientX,j=M.clientY;Phe(M.view),F8(M),F.mouse=[z,this.__zoom.invert(z)],MR(this),F.start();function G(de){if(mx(de),!F.moved){var he=de.clientX-K,pe=de.clientY-j;F.moved=he*he+pe*pe>p}F.event(de).zoom("mouse",t(w(F.that.__zoom,F.mouse[0]=fd(de,W),F.mouse[1]),F.extent,s))}function X(de){$.on("mousemove.zoom mouseup.zoom",null),Ohe(de.view,F.moved),mx(de),F.event(de).end()}}function R(M,...H){if(!!i.apply(this,arguments)){var W=this.__zoom,F=fd(M.changedTouches?M.changedTouches[0]:M,this),$=W.invert(F),z=W.k*(M.shiftKey?.5:2),K=t(w(_(W,z),F,$),e.apply(this,H),s);mx(M),a>0?bu(this).transition().duration(a).call(L,K,F,M):bu(this).call(m.transform,K,F,M)}}function A(M,...H){if(!!i.apply(this,arguments)){var W=M.touches,F=W.length,$=D(this,H,M.changedTouches.length===F).event(M),z,K,j,G;for(F8(M),K=0;K{let e;const t=new Set,n=(u,d)=>{const h=typeof u=="function"?u(e):u;if(!Object.is(h,e)){const f=e;e=(d!=null?d:typeof h!="object"||h===null)?h:Object.assign({},e,h),t.forEach(g=>g(e,f))}},o=()=>e,l={setState:n,getState:o,getInitialState:()=>c,subscribe:u=>(t.add(u),()=>t.delete(u)),destroy:()=>{t.clear()}},c=e=i(n,o,l);return l},ZRe=i=>i?Dee(i):Dee,{useDebugValue:QRe}=Bt,{useSyncExternalStoreWithSelector:JRe}=YRe,eMe=i=>i;function khe(i,e=eMe,t){const n=JRe(i.subscribe,i.getState,i.getServerState||i.getInitialState,e,t);return QRe(n),n}const kee=(i,e)=>{const t=ZRe(i),n=(o,r=e)=>khe(t,o,r);return Object.assign(n,t),n},tMe=(i,e)=>i?kee(i,e):kee;function Hs(i,e){if(Object.is(i,e))return!0;if(typeof i!="object"||i===null||typeof e!="object"||e===null)return!1;if(i instanceof Map&&e instanceof Map){if(i.size!==e.size)return!1;for(const[n,o]of i)if(!Object.is(o,e.get(n)))return!1;return!0}if(i instanceof Set&&e instanceof Set){if(i.size!==e.size)return!1;for(const n of i)if(!e.has(n))return!1;return!0}const t=Object.keys(i);if(t.length!==Object.keys(e).length)return!1;for(let n=0;n{}};function QO(){for(var i=0,e=arguments.length,t={},n;i=0&&(n=t.slice(o+1),t=t.slice(0,o)),t&&!e.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:n}})}MR.prototype=QO.prototype={constructor:MR,on:function(i,e){var t=this._,n=iMe(i+"",t),o,r=-1,s=n.length;if(arguments.length<2){for(;++r0)for(var t=new Array(o),n=0,o,r;n=0&&(e=i.slice(0,t))!=="xmlns"&&(i=i.slice(t+1)),Tee.hasOwnProperty(e)?{space:Tee[e],local:i}:i}function rMe(i){return function(){var e=this.ownerDocument,t=this.namespaceURI;return t===LB&&e.documentElement.namespaceURI===LB?e.createElement(i):e.createElementNS(t,i)}}function sMe(i){return function(){return this.ownerDocument.createElementNS(i.space,i.local)}}function Ihe(i){var e=JO(i);return(e.local?sMe:rMe)(e)}function aMe(){}function nK(i){return i==null?aMe:function(){return this.querySelector(i)}}function lMe(i){typeof i!="function"&&(i=nK(i));for(var e=this._groups,t=e.length,n=new Array(t),o=0;o=y&&(y=_+1);!(L=v[y])&&++y=0;)(s=n[o])&&(r&&s.compareDocumentPosition(r)^4&&r.parentNode.insertBefore(s,r),r=s);return this}function MMe(i){i||(i=AMe);function e(d,h){return d&&h?i(d.__data__,h.__data__):!d-!h}for(var t=this._groups,n=t.length,o=new Array(n),r=0;re?1:i>=e?0:NaN}function PMe(){var i=arguments[0];return arguments[0]=this,i.apply(null,arguments),this}function OMe(){return Array.from(this)}function FMe(){for(var i=this._groups,e=0,t=i.length;e1?this.each((e==null?GMe:typeof e=="function"?YMe:XMe)(i,e,t==null?"":t)):ew(this.node(),i)}function ew(i,e){return i.style.getPropertyValue(e)||Ahe(i).getComputedStyle(i,null).getPropertyValue(e)}function QMe(i){return function(){delete this[i]}}function JMe(i,e){return function(){this[i]=e}}function eAe(i,e){return function(){var t=e.apply(this,arguments);t==null?delete this[i]:this[i]=t}}function tAe(i,e){return arguments.length>1?this.each((e==null?QMe:typeof e=="function"?eAe:JMe)(i,e)):this.node()[i]}function Phe(i){return i.trim().split(/^|\s+/)}function iK(i){return i.classList||new Ohe(i)}function Ohe(i){this._node=i,this._names=Phe(i.getAttribute("class")||"")}Ohe.prototype={add:function(i){var e=this._names.indexOf(i);e<0&&(this._names.push(i),this._node.setAttribute("class",this._names.join(" ")))},remove:function(i){var e=this._names.indexOf(i);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(i){return this._names.indexOf(i)>=0}};function Fhe(i,e){for(var t=iK(i),n=-1,o=e.length;++n=0&&(t=e.slice(n+1),e=e.slice(0,n)),{type:e,name:t}})}function IAe(i){return function(){var e=this.__on;if(!!e){for(var t=0,n=-1,o=e.length,r;t()=>i;function EB(i,{sourceEvent:e,subject:t,target:n,identifier:o,active:r,x:s,y:a,dx:l,dy:c,dispatch:u}){Object.defineProperties(this,{type:{value:i,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},subject:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},identifier:{value:o,enumerable:!0,configurable:!0},active:{value:r,enumerable:!0,configurable:!0},x:{value:s,enumerable:!0,configurable:!0},y:{value:a,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:c,enumerable:!0,configurable:!0},_:{value:u}})}EB.prototype.on=function(){var i=this._.on.apply(this._,arguments);return i===this._?this:i};function WAe(i){return!i.ctrlKey&&!i.button}function VAe(){return this.parentNode}function HAe(i,e){return e==null?{x:i.x,y:i.y}:e}function $Ae(){return navigator.maxTouchPoints||"ontouchstart"in this}function zAe(){var i=WAe,e=VAe,t=HAe,n=$Ae,o={},r=QO("start","drag","end"),s=0,a,l,c,u,d=0;function h(w){w.on("mousedown.drag",f).filter(n).on("touchstart.drag",v).on("touchmove.drag",m,BAe).on("touchend.drag touchcancel.drag",_).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function f(w,L){if(!(u||!i.call(this,w,L))){var D=y(this,e.call(this,w,L),w,L,"mouse");!D||(bu(w.view).on("mousemove.drag",g,eD).on("mouseup.drag",p,eD),Hhe(w.view),A8(w),c=!1,a=w.clientX,l=w.clientY,D("start",w))}}function g(w){if(cy(w),!c){var L=w.clientX-a,D=w.clientY-l;c=L*L+D*D>d}o.mouse("drag",w)}function p(w){bu(w.view).on("mousemove.drag mouseup.drag",null),$he(w.view,c),cy(w),o.mouse("end",w)}function v(w,L){if(!!i.call(this,w,L)){var D=w.changedTouches,E=e.call(this,w,L),I=D.length,k,R;for(k=0;k>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):t===8?IN(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):t===4?IN(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=jAe.exec(i))?new Wl(e[1],e[2],e[3],1):(e=KAe.exec(i))?new Wl(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=qAe.exec(i))?IN(e[1],e[2],e[3],e[4]):(e=GAe.exec(i))?IN(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=XAe.exec(i))?Fee(e[1],e[2]/100,e[3]/100,1):(e=YAe.exec(i))?Fee(e[1],e[2]/100,e[3]/100,e[4]):Nee.hasOwnProperty(i)?Aee(Nee[i]):i==="transparent"?new Wl(NaN,NaN,NaN,0):null}function Aee(i){return new Wl(i>>16&255,i>>8&255,i&255,1)}function IN(i,e,t,n){return n<=0&&(i=e=t=NaN),new Wl(i,e,t,n)}function JAe(i){return i instanceof _I||(i=iD(i)),i?(i=i.rgb(),new Wl(i.r,i.g,i.b,i.opacity)):new Wl}function DB(i,e,t,n){return arguments.length===1?JAe(i):new Wl(i,e,t,n==null?1:n)}function Wl(i,e,t,n){this.r=+i,this.g=+e,this.b=+t,this.opacity=+n}oK(Wl,DB,zhe(_I,{brighter(i){return i=i==null?rA:Math.pow(rA,i),new Wl(this.r*i,this.g*i,this.b*i,this.opacity)},darker(i){return i=i==null?tD:Math.pow(tD,i),new Wl(this.r*i,this.g*i,this.b*i,this.opacity)},rgb(){return this},clamp(){return new Wl(y0(this.r),y0(this.g),y0(this.b),sA(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Pee,formatHex:Pee,formatHex8:ePe,formatRgb:Oee,toString:Oee}));function Pee(){return`#${e0(this.r)}${e0(this.g)}${e0(this.b)}`}function ePe(){return`#${e0(this.r)}${e0(this.g)}${e0(this.b)}${e0((isNaN(this.opacity)?1:this.opacity)*255)}`}function Oee(){const i=sA(this.opacity);return`${i===1?"rgb(":"rgba("}${y0(this.r)}, ${y0(this.g)}, ${y0(this.b)}${i===1?")":`, ${i})`}`}function sA(i){return isNaN(i)?1:Math.max(0,Math.min(1,i))}function y0(i){return Math.max(0,Math.min(255,Math.round(i)||0))}function e0(i){return i=y0(i),(i<16?"0":"")+i.toString(16)}function Fee(i,e,t,n){return n<=0?i=e=t=NaN:t<=0||t>=1?i=e=NaN:e<=0&&(i=NaN),new Ld(i,e,t,n)}function Uhe(i){if(i instanceof Ld)return new Ld(i.h,i.s,i.l,i.opacity);if(i instanceof _I||(i=iD(i)),!i)return new Ld;if(i instanceof Ld)return i;i=i.rgb();var e=i.r/255,t=i.g/255,n=i.b/255,o=Math.min(e,t,n),r=Math.max(e,t,n),s=NaN,a=r-o,l=(r+o)/2;return a?(e===r?s=(t-n)/a+(t0&&l<1?0:s,new Ld(s,a,l,i.opacity)}function tPe(i,e,t,n){return arguments.length===1?Uhe(i):new Ld(i,e,t,n==null?1:n)}function Ld(i,e,t,n){this.h=+i,this.s=+e,this.l=+t,this.opacity=+n}oK(Ld,tPe,zhe(_I,{brighter(i){return i=i==null?rA:Math.pow(rA,i),new Ld(this.h,this.s,this.l*i,this.opacity)},darker(i){return i=i==null?tD:Math.pow(tD,i),new Ld(this.h,this.s,this.l*i,this.opacity)},rgb(){var i=this.h%360+(this.h<0)*360,e=isNaN(i)||isNaN(this.s)?0:this.s,t=this.l,n=t+(t<.5?t:1-t)*e,o=2*t-n;return new Wl(P8(i>=240?i-240:i+120,o,n),P8(i,o,n),P8(i<120?i+240:i-120,o,n),this.opacity)},clamp(){return new Ld(Bee(this.h),TN(this.s),TN(this.l),sA(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const i=sA(this.opacity);return`${i===1?"hsl(":"hsla("}${Bee(this.h)}, ${TN(this.s)*100}%, ${TN(this.l)*100}%${i===1?")":`, ${i})`}`}}));function Bee(i){return i=(i||0)%360,i<0?i+360:i}function TN(i){return Math.max(0,Math.min(1,i||0))}function P8(i,e,t){return(i<60?e+(t-e)*i/60:i<180?t:i<240?e+(t-e)*(240-i)/60:e)*255}var jhe=i=>()=>i;function nPe(i,e){return function(t){return i+t*e}}function iPe(i,e,t){return i=Math.pow(i,t),e=Math.pow(e,t)-i,t=1/t,function(n){return Math.pow(i+n*e,t)}}function oPe(i){return(i=+i)==1?Khe:function(e,t){return t-e?iPe(e,t,i):jhe(isNaN(e)?t:e)}}function Khe(i,e){var t=e-i;return t?nPe(i,t):jhe(isNaN(i)?e:i)}var Wee=function i(e){var t=oPe(e);function n(o,r){var s=t((o=DB(o)).r,(r=DB(r)).r),a=t(o.g,r.g),l=t(o.b,r.b),c=Khe(o.opacity,r.opacity);return function(u){return o.r=s(u),o.g=a(u),o.b=l(u),o.opacity=c(u),o+""}}return n.gamma=i,n}(1);function Jp(i,e){return i=+i,e=+e,function(t){return i*(1-t)+e*t}}var kB=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,O8=new RegExp(kB.source,"g");function rPe(i){return function(){return i}}function sPe(i){return function(e){return i(e)+""}}function aPe(i,e){var t=kB.lastIndex=O8.lastIndex=0,n,o,r,s=-1,a=[],l=[];for(i=i+"",e=e+"";(n=kB.exec(i))&&(o=O8.exec(e));)(r=o.index)>t&&(r=e.slice(t,r),a[s]?a[s]+=r:a[++s]=r),(n=n[0])===(o=o[0])?a[s]?a[s]+=o:a[++s]=o:(a[++s]=null,l.push({i:s,x:Jp(n,o)})),t=O8.lastIndex;return t180?u+=360:u-c>180&&(c+=360),h.push({i:d.push(o(d)+"rotate(",null,n)-2,x:Jp(c,u)})):u&&d.push(o(d)+"rotate("+u+n)}function a(c,u,d,h){c!==u?h.push({i:d.push(o(d)+"skewX(",null,n)-2,x:Jp(c,u)}):u&&d.push(o(d)+"skewX("+u+n)}function l(c,u,d,h,f,g){if(c!==d||u!==h){var p=f.push(o(f)+"scale(",null,",",null,")");g.push({i:p-4,x:Jp(c,d)},{i:p-2,x:Jp(u,h)})}else(d!==1||h!==1)&&f.push(o(f)+"scale("+d+","+h+")")}return function(c,u){var d=[],h=[];return c=i(c),u=i(u),r(c.translateX,c.translateY,u.translateX,u.translateY,d,h),s(c.rotate,u.rotate,d,h),a(c.skewX,u.skewX,d,h),l(c.scaleX,c.scaleY,u.scaleX,u.scaleY,d,h),c=u=null,function(f){for(var g=-1,p=h.length,v;++g=0&&i._call.call(void 0,e),i=i._next;--tw}function $ee(){H0=(lA=oD.now())+e4,tw=hL=0;try{vPe()}finally{tw=0,bPe(),H0=0}}function _Pe(){var i=oD.now(),e=i-lA;e>Xhe&&(e4-=e,lA=i)}function bPe(){for(var i,e=aA,t,n=1/0;e;)e._call?(n>e._time&&(n=e._time),i=e,e=e._next):(t=e._next,e._next=null,e=i?i._next=t:aA=t);fL=i,TB(n)}function TB(i){if(!tw){hL&&(hL=clearTimeout(hL));var e=i-H0;e>24?(i<1/0&&(hL=setTimeout($ee,i-oD.now()-e4)),mx&&(mx=clearInterval(mx))):(mx||(lA=oD.now(),mx=setInterval(_Pe,Xhe)),tw=1,Yhe($ee))}}function zee(i,e,t){var n=new cA;return e=e==null?0:+e,n.restart(o=>{n.stop(),i(o+e)},e,t),n}var CPe=QO("start","end","cancel","interrupt"),yPe=[],Qhe=0,Uee=1,NB=2,AR=3,jee=4,RB=5,PR=6;function t4(i,e,t,n,o,r){var s=i.__transition;if(!s)i.__transition={};else if(t in s)return;wPe(i,t,{name:e,index:n,group:o,on:CPe,tween:yPe,time:r.time,delay:r.delay,duration:r.duration,ease:r.ease,timer:null,state:Qhe})}function sK(i,e){var t=Jd(i,e);if(t.state>Qhe)throw new Error("too late; already scheduled");return t}function Df(i,e){var t=Jd(i,e);if(t.state>AR)throw new Error("too late; already running");return t}function Jd(i,e){var t=i.__transition;if(!t||!(t=t[e]))throw new Error("transition not found");return t}function wPe(i,e,t){var n=i.__transition,o;n[e]=t,t.timer=Zhe(r,0,t.time);function r(c){t.state=Uee,t.timer.restart(s,t.delay,t.time),t.delay<=c&&s(c-t.delay)}function s(c){var u,d,h,f;if(t.state!==Uee)return l();for(u in n)if(f=n[u],f.name===t.name){if(f.state===AR)return zee(s);f.state===jee?(f.state=PR,f.timer.stop(),f.on.call("interrupt",i,i.__data__,f.index,f.group),delete n[u]):+uNB&&n.state=0&&(e=e.slice(0,t)),!e||e==="start"})}function QPe(i,e,t){var n,o,r=ZPe(e)?sK:Df;return function(){var s=r(this,i),a=s.on;a!==n&&(o=(n=a).copy()).on(e,t),s.on=o}}function JPe(i,e){var t=this._id;return arguments.length<2?Jd(this.node(),t).on.on(i):this.each(QPe(t,i,e))}function eOe(i){return function(){var e=this.parentNode;for(var t in this.__transition)if(+t!==i)return;e&&e.removeChild(this)}}function tOe(){return this.on("end.remove",eOe(this._id))}function nOe(i){var e=this._name,t=this._id;typeof i!="function"&&(i=nK(i));for(var n=this._groups,o=n.length,r=new Array(o),s=0;s()=>i;function DOe(i,{sourceEvent:e,target:t,transform:n,dispatch:o}){Object.defineProperties(this,{type:{value:i,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:t,enumerable:!0,configurable:!0},transform:{value:n,enumerable:!0,configurable:!0},_:{value:o}})}function Ng(i,e,t){this.k=i,this.x=e,this.y=t}Ng.prototype={constructor:Ng,scale:function(i){return i===1?this:new Ng(this.k*i,this.x,this.y)},translate:function(i,e){return i===0&e===0?this:new Ng(this.k,this.x+this.k*i,this.y+this.k*e)},apply:function(i){return[i[0]*this.k+this.x,i[1]*this.k+this.y]},applyX:function(i){return i*this.k+this.x},applyY:function(i){return i*this.k+this.y},invert:function(i){return[(i[0]-this.x)/this.k,(i[1]-this.y)/this.k]},invertX:function(i){return(i-this.x)/this.k},invertY:function(i){return(i-this.y)/this.k},rescaleX:function(i){return i.copy().domain(i.range().map(this.invertX,this).map(i.invert,i))},rescaleY:function(i){return i.copy().domain(i.range().map(this.invertY,this).map(i.invert,i))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var zg=new Ng(1,0,0);Ng.prototype;function F8(i){i.stopImmediatePropagation()}function vx(i){i.preventDefault(),i.stopImmediatePropagation()}function kOe(i){return(!i.ctrlKey||i.type==="wheel")&&!i.button}function IOe(){var i=this;return i instanceof SVGElement?(i=i.ownerSVGElement||i,i.hasAttribute("viewBox")?(i=i.viewBox.baseVal,[[i.x,i.y],[i.x+i.width,i.y+i.height]]):[[0,0],[i.width.baseVal.value,i.height.baseVal.value]]):[[0,0],[i.clientWidth,i.clientHeight]]}function Kee(){return this.__zoom||zg}function TOe(i){return-i.deltaY*(i.deltaMode===1?.05:i.deltaMode?1:.002)*(i.ctrlKey?10:1)}function NOe(){return navigator.maxTouchPoints||"ontouchstart"in this}function ROe(i,e,t){var n=i.invertX(e[0][0])-t[0][0],o=i.invertX(e[1][0])-t[1][0],r=i.invertY(e[0][1])-t[0][1],s=i.invertY(e[1][1])-t[1][1];return i.translate(o>n?(n+o)/2:Math.min(0,n)||Math.max(0,o),s>r?(r+s)/2:Math.min(0,r)||Math.max(0,s))}function nfe(){var i=kOe,e=IOe,t=ROe,n=TOe,o=NOe,r=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],a=250,l=pPe,c=QO("start","zoom","end"),u,d,h,f=500,g=150,p=0,v=10;function m(M){M.property("__zoom",Kee).on("wheel.zoom",I,{passive:!1}).on("mousedown.zoom",k).on("dblclick.zoom",R).filter(o).on("touchstart.zoom",A).on("touchmove.zoom",P).on("touchend.zoom touchcancel.zoom",N).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}m.transform=function(M,H,B,F){var $=M.selection?M.selection():M;$.property("__zoom",Kee),M!==$?L(M,H,B,F):$.interrupt().each(function(){D(this,arguments).event(F).start().zoom(null,typeof H=="function"?H.apply(this,arguments):H).end()})},m.scaleBy=function(M,H,B,F){m.scaleTo(M,function(){var $=this.__zoom.k,z=typeof H=="function"?H.apply(this,arguments):H;return $*z},B,F)},m.scaleTo=function(M,H,B,F){m.transform(M,function(){var $=e.apply(this,arguments),z=this.__zoom,K=B==null?w($):typeof B=="function"?B.apply(this,arguments):B,j=z.invert(K),G=typeof H=="function"?H.apply(this,arguments):H;return t(y(_(z,G),K,j),$,s)},B,F)},m.translateBy=function(M,H,B,F){m.transform(M,function(){return t(this.__zoom.translate(typeof H=="function"?H.apply(this,arguments):H,typeof B=="function"?B.apply(this,arguments):B),e.apply(this,arguments),s)},null,F)},m.translateTo=function(M,H,B,F,$){m.transform(M,function(){var z=e.apply(this,arguments),K=this.__zoom,j=F==null?w(z):typeof F=="function"?F.apply(this,arguments):F;return t(zg.translate(j[0],j[1]).scale(K.k).translate(typeof H=="function"?-H.apply(this,arguments):-H,typeof B=="function"?-B.apply(this,arguments):-B),z,s)},F,$)};function _(M,H){return H=Math.max(r[0],Math.min(r[1],H)),H===M.k?M:new Ng(H,M.x,M.y)}function y(M,H,B){var F=H[0]-B[0]*M.k,$=H[1]-B[1]*M.k;return F===M.x&&$===M.y?M:new Ng(M.k,F,$)}function w(M){return[(+M[0][0]+ +M[1][0])/2,(+M[0][1]+ +M[1][1])/2]}function L(M,H,B,F){M.on("start.zoom",function(){D(this,arguments).event(F).start()}).on("interrupt.zoom end.zoom",function(){D(this,arguments).event(F).end()}).tween("zoom",function(){var $=this,z=arguments,K=D($,z).event(F),j=e.apply($,z),G=B==null?w(j):typeof B=="function"?B.apply($,z):B,X=Math.max(j[1][0]-j[0][0],j[1][1]-j[0][1]),de=$.__zoom,fe=typeof H=="function"?H.apply($,z):H,pe=l(de.invert(G).concat(X/de.k),fe.invert(G).concat(X/fe.k));return function(be){if(be===1)be=fe;else{var Se=pe(be),Fe=X/Se[2];be=new Ng(Fe,G[0]-Se[0]*Fe,G[1]-Se[1]*Fe)}K.zoom(null,be)}})}function D(M,H,B){return!B&&M.__zooming||new E(M,H)}function E(M,H){this.that=M,this.args=H,this.active=0,this.sourceEvent=null,this.extent=e.apply(M,H),this.taps=0}E.prototype={event:function(M){return M&&(this.sourceEvent=M),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(M,H){return this.mouse&&M!=="mouse"&&(this.mouse[1]=H.invert(this.mouse[0])),this.touch0&&M!=="touch"&&(this.touch0[1]=H.invert(this.touch0[0])),this.touch1&&M!=="touch"&&(this.touch1[1]=H.invert(this.touch1[0])),this.that.__zoom=H,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(M){var H=bu(this.that).datum();c.call(M,this.that,new DOe(M,{sourceEvent:this.sourceEvent,target:m,type:M,transform:this.that.__zoom,dispatch:c}),H)}};function I(M,...H){if(!i.apply(this,arguments))return;var B=D(this,H).event(M),F=this.__zoom,$=Math.max(r[0],Math.min(r[1],F.k*Math.pow(2,n.apply(this,arguments)))),z=gd(M);if(B.wheel)(B.mouse[0][0]!==z[0]||B.mouse[0][1]!==z[1])&&(B.mouse[1]=F.invert(B.mouse[0]=z)),clearTimeout(B.wheel);else{if(F.k===$)return;B.mouse=[z,F.invert(z)],OR(this),B.start()}vx(M),B.wheel=setTimeout(K,g),B.zoom("mouse",t(y(_(F,$),B.mouse[0],B.mouse[1]),B.extent,s));function K(){B.wheel=null,B.end()}}function k(M,...H){if(h||!i.apply(this,arguments))return;var B=M.currentTarget,F=D(this,H,!0).event(M),$=bu(M.view).on("mousemove.zoom",G,!0).on("mouseup.zoom",X,!0),z=gd(M,B),K=M.clientX,j=M.clientY;Hhe(M.view),F8(M),F.mouse=[z,this.__zoom.invert(z)],OR(this),F.start();function G(de){if(vx(de),!F.moved){var fe=de.clientX-K,pe=de.clientY-j;F.moved=fe*fe+pe*pe>p}F.event(de).zoom("mouse",t(y(F.that.__zoom,F.mouse[0]=gd(de,B),F.mouse[1]),F.extent,s))}function X(de){$.on("mousemove.zoom mouseup.zoom",null),$he(de.view,F.moved),vx(de),F.event(de).end()}}function R(M,...H){if(!!i.apply(this,arguments)){var B=this.__zoom,F=gd(M.changedTouches?M.changedTouches[0]:M,this),$=B.invert(F),z=B.k*(M.shiftKey?.5:2),K=t(y(_(B,z),F,$),e.apply(this,H),s);vx(M),a>0?bu(this).transition().duration(a).call(L,K,F,M):bu(this).call(m.transform,K,F,M)}}function A(M,...H){if(!!i.apply(this,arguments)){var B=M.touches,F=B.length,$=D(this,H,M.changedTouches.length===F).event(M),z,K,j,G;for(F8(M),K=0;K"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:i=>`Node type "${i}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:i=>`The old edge with id=${i} does not exist.`,error009:i=>`Marker type "${i}" doesn't exist.`,error008:(i,e)=>`Couldn't create edge for ${i?"target":"source"} handle id: "${i?e.targetHandle:e.sourceHandle}", edge id: ${e.id}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:i=>`Edge type "${i}" not found. Using fallback type "default".`,error012:i=>`Node with id "${i}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`},Jhe=tp.error001();function mo(i,e){const t=x.exports.useContext(e4);if(t===null)throw new Error(Jhe);return yhe(t,i,e)}const ls=()=>{const i=x.exports.useContext(e4);if(i===null)throw new Error(Jhe);return x.exports.useMemo(()=>({getState:i.getState,setState:i.setState,subscribe:i.subscribe,destroy:i.destroy}),[i])},IOe=i=>i.userSelectionActive?"none":"all";function oD({position:i,children:e,className:t,style:n,...o}){const r=mo(IOe),s=`${i}`.split("-");return fe("div",{className:ha(["react-flow__panel",t,...s]),style:{...n,pointerEvents:r},...o,children:e})}function TOe({proOptions:i,position:e="bottom-right"}){return i!=null&&i.hideAttribution?null:fe(oD,{position:e,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://reactflow.dev/pro",children:fe("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const NOe=({x:i,y:e,label:t,labelStyle:n={},labelShowBg:o=!0,labelBgStyle:r={},labelBgPadding:s=[2,4],labelBgBorderRadius:a=2,children:l,className:c,...u})=>{const d=x.exports.useRef(null),[h,f]=x.exports.useState({x:0,y:0,width:0,height:0}),g=ha(["react-flow__edge-textwrapper",c]);return x.exports.useEffect(()=>{if(d.current){const p=d.current.getBBox();f({x:p.x,y:p.y,width:p.width,height:p.height})}},[t]),typeof t=="undefined"||!t?null:vn("g",{transform:`translate(${i-h.width/2} ${e-h.height/2})`,className:g,visibility:h.width?"visible":"hidden",...u,children:[o&&fe("rect",{width:h.width+2*s[0],x:-s[0],y:-s[1],height:h.height+2*s[1],className:"react-flow__edge-textbg",style:r,rx:a,ry:a}),fe("text",{className:"react-flow__edge-text",y:h.height/2,dy:"0.3em",ref:d,style:n,children:t}),l]})};var ROe=x.exports.memo(NOe);const oK=i=>({width:i.offsetWidth,height:i.offsetHeight}),ny=(i,e=0,t=1)=>Math.min(Math.max(i,e),t),rK=(i={x:0,y:0},e)=>({x:ny(i.x,e[0][0],e[1][0]),y:ny(i.y,e[0][1],e[1][1])}),Vee=(i,e,t)=>it?-ny(Math.abs(i-t),1,50)/50:0,efe=(i,e)=>{const t=Vee(i.x,35,e.width-35)*20,n=Vee(i.y,35,e.height-35)*20;return[t,n]},tfe=i=>{var e;return((e=i.getRootNode)==null?void 0:e.call(i))||(window==null?void 0:window.document)},nfe=(i,e)=>({x:Math.min(i.x,e.x),y:Math.min(i.y,e.y),x2:Math.max(i.x2,e.x2),y2:Math.max(i.y2,e.y2)}),rD=({x:i,y:e,width:t,height:n})=>({x:i,y:e,x2:i+t,y2:e+n}),ife=({x:i,y:e,x2:t,y2:n})=>({x:i,y:e,width:t-i,height:n-e}),Hee=i=>({...i.positionAbsolute||{x:0,y:0},width:i.width||0,height:i.height||0}),MOe=(i,e)=>ife(nfe(rD(i),rD(e))),TB=(i,e)=>{const t=Math.max(0,Math.min(i.x+i.width,e.x+e.width)-Math.max(i.x,e.x)),n=Math.max(0,Math.min(i.y+i.height,e.y+e.height)-Math.max(i.y,e.y));return Math.ceil(t*n)},AOe=i=>Cu(i.width)&&Cu(i.height)&&Cu(i.x)&&Cu(i.y),Cu=i=>!isNaN(i)&&isFinite(i),Cs=Symbol.for("internals"),ofe=["Enter"," ","Escape"],POe=(i,e)=>{},OOe=i=>"nativeEvent"in i;function NB(i){var o,r;const e=OOe(i)?i.nativeEvent:i,t=((r=(o=e.composedPath)==null?void 0:o.call(e))==null?void 0:r[0])||i.target;return["INPUT","SELECT","TEXTAREA"].includes(t==null?void 0:t.nodeName)||(t==null?void 0:t.hasAttribute("contenteditable"))||!!(t!=null&&t.closest(".nokey"))}const rfe=i=>"clientX"in i,Hm=(i,e)=>{var r,s,a,l;const t=rfe(i),n=t?i.clientX:(r=i.touches)==null?void 0:r[0].clientX,o=t?i.clientY:(s=i.touches)==null?void 0:s[0].clientY;return{x:n-((a=e==null?void 0:e.left)!=null?a:0),y:o-((l=e==null?void 0:e.top)!=null?l:0)}},aA=()=>{var i;return typeof navigator!="undefined"&&((i=navigator==null?void 0:navigator.userAgent)==null?void 0:i.indexOf("Mac"))>=0},CI=({id:i,path:e,labelX:t,labelY:n,label:o,labelStyle:r,labelShowBg:s,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:c,style:u,markerEnd:d,markerStart:h,interactionWidth:f=20})=>vn(Ds,{children:[fe("path",{id:i,style:u,d:e,fill:"none",className:"react-flow__edge-path",markerEnd:d,markerStart:h}),f&&fe("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:f,className:"react-flow__edge-interaction"}),o&&Cu(t)&&Cu(n)?fe(ROe,{x:t,y:n,label:o,labelStyle:r,labelShowBg:s,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:c}):null]});CI.displayName="BaseEdge";function vx(i,e,t){return t===void 0?t:n=>{const o=e().edges.find(r=>r.id===i);o&&t(n,{...o})}}function sfe({sourceX:i,sourceY:e,targetX:t,targetY:n}){const o=Math.abs(t-i)/2,r=t{const[v,m,_]=lfe({sourceX:i,sourceY:e,sourcePosition:o,targetX:t,targetY:n,targetPosition:r});return fe(CI,{path:v,labelX:m,labelY:_,label:s,labelStyle:a,labelShowBg:l,labelBgStyle:c,labelBgPadding:u,labelBgBorderRadius:d,style:h,markerEnd:f,markerStart:g,interactionWidth:p})});sK.displayName="SimpleBezierEdge";const zee={[pn.Left]:{x:-1,y:0},[pn.Right]:{x:1,y:0},[pn.Top]:{x:0,y:-1},[pn.Bottom]:{x:0,y:1}},FOe=({source:i,sourcePosition:e=pn.Bottom,target:t})=>e===pn.Left||e===pn.Right?i.xMath.sqrt(Math.pow(e.x-i.x,2)+Math.pow(e.y-i.y,2));function BOe({source:i,sourcePosition:e=pn.Bottom,target:t,targetPosition:n=pn.Top,center:o,offset:r}){const s=zee[e],a=zee[n],l={x:i.x+s.x*r,y:i.y+s.y*r},c={x:t.x+a.x*r,y:t.y+a.y*r},u=FOe({source:l,sourcePosition:e,target:c}),d=u.x!==0?"x":"y",h=u[d];let f=[],g,p;const v={x:0,y:0},m={x:0,y:0},[_,w,y,L]=sfe({sourceX:i.x,sourceY:i.y,targetX:t.x,targetY:t.y});if(s[d]*a[d]===-1){g=o.x||_,p=o.y||w;const E=[{x:g,y:l.y},{x:g,y:c.y}],I=[{x:l.x,y:p},{x:c.x,y:p}];s[d]===h?f=d==="x"?E:I:f=d==="x"?I:E}else{const E=[{x:l.x,y:c.y}],I=[{x:c.x,y:l.y}];if(d==="x"?f=s.x===h?I:E:f=s.y===h?E:I,e===n){const N=Math.abs(i[d]-t[d]);if(N<=r){const M=Math.min(r-1,r-N);s[d]===h?v[d]=(l[d]>i[d]?-1:1)*M:m[d]=(c[d]>t[d]?-1:1)*M}}if(e!==n){const N=d==="x"?"y":"x",M=s[d]===a[N],H=l[N]>c[N],W=l[N]=P?(g=(k.x+R.x)/2,p=f[0].y):(g=f[0].x,p=(k.y+R.y)/2)}return[[i,{x:l.x+v.x,y:l.y+v.y},...f,{x:c.x+m.x,y:c.y+m.y},t],g,p,y,L]}function WOe(i,e,t,n){const o=Math.min(Uee(i,e)/2,Uee(e,t)/2,n),{x:r,y:s}=e;if(i.x===r&&r===t.x||i.y===s&&s===t.y)return`L${r} ${s}`;if(i.y===s){const c=i.x{let w="";return _>0&&_{const[m,_,w]=RB({sourceX:i,sourceY:e,sourcePosition:d,targetX:t,targetY:n,targetPosition:h,borderRadius:p==null?void 0:p.borderRadius,offset:p==null?void 0:p.offset});return fe(CI,{path:m,labelX:_,labelY:w,label:o,labelStyle:r,labelShowBg:s,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:c,style:u,markerEnd:f,markerStart:g,interactionWidth:v})});t4.displayName="SmoothStepEdge";const aK=x.exports.memo(i=>{var e;return fe(t4,{...i,pathOptions:x.exports.useMemo(()=>{var t;return{borderRadius:0,offset:(t=i.pathOptions)==null?void 0:t.offset}},[(e=i.pathOptions)==null?void 0:e.offset])})});aK.displayName="StepEdge";function VOe({sourceX:i,sourceY:e,targetX:t,targetY:n}){const[o,r,s,a]=sfe({sourceX:i,sourceY:e,targetX:t,targetY:n});return[`M ${i},${e}L ${t},${n}`,o,r,s,a]}const lK=x.exports.memo(({sourceX:i,sourceY:e,targetX:t,targetY:n,label:o,labelStyle:r,labelShowBg:s,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:c,style:u,markerEnd:d,markerStart:h,interactionWidth:f})=>{const[g,p,v]=VOe({sourceX:i,sourceY:e,targetX:t,targetY:n});return fe(CI,{path:g,labelX:p,labelY:v,label:o,labelStyle:r,labelShowBg:s,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:c,style:u,markerEnd:d,markerStart:h,interactionWidth:f})});lK.displayName="StraightEdge";function TN(i,e){return i>=0?.5*i:e*25*Math.sqrt(-i)}function jee({pos:i,x1:e,y1:t,x2:n,y2:o,c:r}){switch(i){case pn.Left:return[e-TN(e-n,r),t];case pn.Right:return[e+TN(n-e,r),t];case pn.Top:return[e,t-TN(t-o,r)];case pn.Bottom:return[e,t+TN(o-t,r)]}}function cfe({sourceX:i,sourceY:e,sourcePosition:t=pn.Bottom,targetX:n,targetY:o,targetPosition:r=pn.Top,curvature:s=.25}){const[a,l]=jee({pos:t,x1:i,y1:e,x2:n,y2:o,c:s}),[c,u]=jee({pos:r,x1:n,y1:o,x2:i,y2:e,c:s}),[d,h,f,g]=afe({sourceX:i,sourceY:e,targetX:n,targetY:o,sourceControlX:a,sourceControlY:l,targetControlX:c,targetControlY:u});return[`M${i},${e} C${a},${l} ${c},${u} ${n},${o}`,d,h,f,g]}const cA=x.exports.memo(({sourceX:i,sourceY:e,targetX:t,targetY:n,sourcePosition:o=pn.Bottom,targetPosition:r=pn.Top,label:s,labelStyle:a,labelShowBg:l,labelBgStyle:c,labelBgPadding:u,labelBgBorderRadius:d,style:h,markerEnd:f,markerStart:g,pathOptions:p,interactionWidth:v})=>{const[m,_,w]=cfe({sourceX:i,sourceY:e,sourcePosition:o,targetX:t,targetY:n,targetPosition:r,curvature:p==null?void 0:p.curvature});return fe(CI,{path:m,labelX:_,labelY:w,label:s,labelStyle:a,labelShowBg:l,labelBgStyle:c,labelBgPadding:u,labelBgBorderRadius:d,style:h,markerEnd:f,markerStart:g,interactionWidth:v})});cA.displayName="BezierEdge";const cK=x.exports.createContext(null),HOe=cK.Provider;cK.Consumer;const $Oe=()=>x.exports.useContext(cK),MB=i=>"id"in i&&"source"in i&&"target"in i,zOe=({source:i,sourceHandle:e,target:t,targetHandle:n})=>`reactflow__edge-${i}${e||""}-${t}${n||""}`,AB=(i,e)=>typeof i=="undefined"?"":typeof i=="string"?i:`${e?`${e}__`:""}${Object.keys(i).sort().map(n=>`${n}=${i[n]}`).join("&")}`,UOe=(i,e)=>e.some(t=>t.source===i.source&&t.target===i.target&&(t.sourceHandle===i.sourceHandle||!t.sourceHandle&&!i.sourceHandle)&&(t.targetHandle===i.targetHandle||!t.targetHandle&&!i.targetHandle)),ufe=(i,e)=>{if(!i.source||!i.target)return e;let t;return MB(i)?t={...i}:t={...i,id:zOe(i)},UOe(t,e)?e:e.concat(t)},PB=({x:i,y:e},[t,n,o],r,[s,a])=>{const l={x:(i-t)/o,y:(e-n)/o};return r?{x:s*Math.round(l.x/s),y:a*Math.round(l.y/a)}:l},dfe=({x:i,y:e},[t,n,o])=>({x:i*o+t,y:e*o+n}),w0=(i,e=[0,0])=>{var r,s;if(!i)return{x:0,y:0,positionAbsolute:{x:0,y:0}};const t=((r=i.width)!=null?r:0)*e[0],n=((s=i.height)!=null?s:0)*e[1],o={x:i.position.x-t,y:i.position.y-n};return{...o,positionAbsolute:i.positionAbsolute?{x:i.positionAbsolute.x-t,y:i.positionAbsolute.y-n}:o}},n4=(i,e=[0,0])=>{if(i.length===0)return{x:0,y:0,width:0,height:0};const t=i.reduce((n,o)=>{const{x:r,y:s}=w0(o,e);return nfe(n,rD({x:r,y:s,width:o.width||0,height:o.height||0}))},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return ife(t)},hfe=(i,e,[t,n,o]=[0,0,1],r=!1,s=!1,a=[0,0])=>{const l={x:(e.x-t)/o,y:(e.y-n)/o,width:e.width/o,height:e.height/o},c=[];return i.forEach(u=>{const{width:d,height:h,selectable:f=!0,hidden:g=!1}=u;if(s&&!f||g)return!1;const{positionAbsolute:p}=w0(u,a),v={x:p.x,y:p.y,width:d||0,height:h||0},m=TB(l,v),_=typeof d=="undefined"||typeof h=="undefined"||d===null||h===null,w=r&&m>0,y=(d||0)*(h||0);(_||w||m>=y||u.dragging)&&c.push(u)}),c},ffe=(i,e)=>{const t=i.map(n=>n.id);return e.filter(n=>t.includes(n.source)||t.includes(n.target))},gfe=(i,e,t,n,o,r=.1)=>{const s=e/(i.width*(1+r)),a=t/(i.height*(1+r)),l=Math.min(s,a),c=ny(l,n,o),u=i.x+i.width/2,d=i.y+i.height/2,h=e/2-u*c,f=t/2-d*c;return{x:h,y:f,zoom:c}},D_=(i,e=0)=>i.transition().duration(e);function Kee(i,e,t,n){return(e[t]||[]).reduce((o,r)=>{var s,a,l,c;return`${i.id}-${r.id}-${t}`!==n&&o.push({id:r.id||null,type:t,nodeId:i.id,x:((a=(s=i.positionAbsolute)==null?void 0:s.x)!=null?a:0)+r.x+r.width/2,y:((c=(l=i.positionAbsolute)==null?void 0:l.y)!=null?c:0)+r.y+r.height/2}),o},[])}function jOe(i,e,t,n,o,r){const{x:s,y:a}=Hm(i),c=e.elementsFromPoint(s,a).find(g=>g.classList.contains("react-flow__handle"));if(c){const g=c.getAttribute("data-nodeid");if(g){const p=uK(void 0,c),v=c.getAttribute("data-handleid"),m=r({nodeId:g,id:v,type:p});if(m){const _=o.find(w=>w.nodeId===g&&w.type===p&&w.id===v);return{handle:{id:v,type:p,nodeId:g,x:(_==null?void 0:_.x)||t.x,y:(_==null?void 0:_.y)||t.y},validHandleResult:m}}}}let u=[],d=1/0;if(o.forEach(g=>{const p=Math.sqrt((g.x-t.x)**2+(g.y-t.y)**2);if(p<=n){const v=r(g);p<=d&&(pg.isValid),f=u.some(({handle:g})=>g.type==="target");return u.find(({handle:g,validHandleResult:p})=>f?g.type==="target":h?p.isValid:!0)||u[0]}const KOe={source:null,target:null,sourceHandle:null,targetHandle:null},pfe=()=>({handleDomNode:null,isValid:!1,connection:KOe,endHandle:null});function mfe(i,e,t,n,o,r,s){const a=o==="target",l=s.querySelector(`.react-flow__handle[data-id="${i==null?void 0:i.nodeId}-${i==null?void 0:i.id}-${i==null?void 0:i.type}"]`),c={...pfe(),handleDomNode:l};if(l){const u=uK(void 0,l),d=l.getAttribute("data-nodeid"),h=l.getAttribute("data-handleid"),f=l.classList.contains("connectable"),g=l.classList.contains("connectableend"),p={source:a?d:t,sourceHandle:a?h:n,target:a?t:d,targetHandle:a?n:h};c.connection=p,f&&g&&(e===H0.Strict?a&&u==="source"||!a&&u==="target":d!==t||h!==n)&&(c.endHandle={nodeId:d,handleId:h,type:u},c.isValid=r(p))}return c}function qOe({nodes:i,nodeId:e,handleId:t,handleType:n}){return i.reduce((o,r)=>{if(r[Cs]){const{handleBounds:s}=r[Cs];let a=[],l=[];s&&(a=Kee(r,s,"source",`${e}-${t}-${n}`),l=Kee(r,s,"target",`${e}-${t}-${n}`)),o.push(...a,...l)}return o},[])}function uK(i,e){return i||(e!=null&&e.classList.contains("target")?"target":e!=null&&e.classList.contains("source")?"source":null)}function B8(i){i==null||i.classList.remove("valid","connecting","react-flow__handle-valid","react-flow__handle-connecting")}function GOe(i,e){let t=null;return e?t="valid":i&&!e&&(t="invalid"),t}function vfe({event:i,handleId:e,nodeId:t,onConnect:n,isTarget:o,getState:r,setState:s,isValidConnection:a,edgeUpdaterType:l,onEdgeUpdateEnd:c}){const u=tfe(i.target),{connectionMode:d,domNode:h,autoPanOnConnect:f,connectionRadius:g,onConnectStart:p,panBy:v,getNodes:m,cancelConnection:_}=r();let w=0,y;const{x:L,y:D}=Hm(i),E=u==null?void 0:u.elementFromPoint(L,D),I=uK(l,E),k=h==null?void 0:h.getBoundingClientRect();if(!k||!I)return;let R,A=Hm(i,k),P=!1,N=null,M=!1,H=null;const W=qOe({nodes:m(),nodeId:t,handleId:e,handleType:I}),F=()=>{if(!f)return;const[K,j]=efe(A,k);v({x:K,y:j}),w=requestAnimationFrame(F)};s({connectionPosition:A,connectionStatus:null,connectionNodeId:t,connectionHandleId:e,connectionHandleType:I,connectionStartHandle:{nodeId:t,handleId:e,type:I},connectionEndHandle:null}),p==null||p(i,{nodeId:t,handleId:e,handleType:I});function $(K){const{transform:j}=r();A=Hm(K,k);const{handle:G,validHandleResult:X}=jOe(K,u,PB(A,j,!1,[1,1]),g,W,de=>mfe(de,d,t,e,o?"target":"source",a,u));if(y=G,P||(F(),P=!0),H=X.handleDomNode,N=X.connection,M=X.isValid,s({connectionPosition:y&&M?dfe({x:y.x,y:y.y},j):A,connectionStatus:GOe(!!y,M),connectionEndHandle:X.endHandle}),!y&&!M&&!H)return B8(R);N.source!==N.target&&H&&(B8(R),R=H,H.classList.add("connecting","react-flow__handle-connecting"),H.classList.toggle("valid",M),H.classList.toggle("react-flow__handle-valid",M))}function z(K){var j,G;(y||H)&&N&&M&&(n==null||n(N)),(G=(j=r()).onConnectEnd)==null||G.call(j,K),l&&(c==null||c(K)),B8(R),_(),cancelAnimationFrame(w),P=!1,M=!1,N=null,H=null,u.removeEventListener("mousemove",$),u.removeEventListener("mouseup",z),u.removeEventListener("touchmove",$),u.removeEventListener("touchend",z)}u.addEventListener("mousemove",$),u.addEventListener("mouseup",z),u.addEventListener("touchmove",$),u.addEventListener("touchend",z)}const qee=()=>!0,XOe=i=>({connectionStartHandle:i.connectionStartHandle,connectOnClick:i.connectOnClick,noPanClassName:i.noPanClassName}),YOe=(i,e,t)=>n=>{const{connectionStartHandle:o,connectionEndHandle:r,connectionClickStartHandle:s}=n;return{connecting:(o==null?void 0:o.nodeId)===i&&(o==null?void 0:o.handleId)===e&&(o==null?void 0:o.type)===t||(r==null?void 0:r.nodeId)===i&&(r==null?void 0:r.handleId)===e&&(r==null?void 0:r.type)===t,clickConnecting:(s==null?void 0:s.nodeId)===i&&(s==null?void 0:s.handleId)===e&&(s==null?void 0:s.type)===t}},_fe=x.exports.forwardRef(({type:i="source",position:e=pn.Top,isValidConnection:t,isConnectable:n=!0,isConnectableStart:o=!0,isConnectableEnd:r=!0,id:s,onConnect:a,children:l,className:c,onMouseDown:u,onTouchStart:d,...h},f)=>{var k,R;const g=s||null,p=i==="target",v=ls(),m=$Oe(),{connectOnClick:_,noPanClassName:w}=mo(XOe,Hs),{connecting:y,clickConnecting:L}=mo(YOe(m,g,i),Hs);m||(R=(k=v.getState()).onError)==null||R.call(k,"010",tp.error010());const D=A=>{const{defaultEdgeOptions:P,onConnect:N,hasDefaultEdges:M}=v.getState(),H={...P,...A};if(M){const{edges:W,setEdges:F}=v.getState();F(ufe(H,W))}N==null||N(H),a==null||a(H)},E=A=>{if(!m)return;const P=rfe(A);o&&(P&&A.button===0||!P)&&vfe({event:A,handleId:g,nodeId:m,onConnect:D,isTarget:p,getState:v.getState,setState:v.setState,isValidConnection:t||v.getState().isValidConnection||qee}),P?u==null||u(A):d==null||d(A)},I=A=>{const{onClickConnectStart:P,onClickConnectEnd:N,connectionClickStartHandle:M,connectionMode:H,isValidConnection:W}=v.getState();if(!m||!M&&!o)return;if(!M){P==null||P(A,{nodeId:m,handleId:g,handleType:i}),v.setState({connectionClickStartHandle:{nodeId:m,type:i,handleId:g}});return}const F=tfe(A.target),$=t||W||qee,{connection:z,isValid:K}=mfe({nodeId:m,id:g,type:i},H,M.nodeId,M.handleId||null,M.type,$,F);K&&D(z),N==null||N(A),v.setState({connectionClickStartHandle:null})};return fe("div",{"data-handleid":g,"data-nodeid":m,"data-handlepos":e,"data-id":`${m}-${g}-${i}`,className:ha(["react-flow__handle",`react-flow__handle-${e}`,"nodrag",w,c,{source:!p,target:p,connectable:n,connectablestart:o,connectableend:r,connecting:L,connectionindicator:n&&(o&&!y||r&&y)}]),onMouseDown:E,onTouchStart:E,onClick:_?I:void 0,ref:f,...h,children:l})});_fe.displayName="Handle";var aD=x.exports.memo(_fe);const bfe=({data:i,isConnectable:e,targetPosition:t=pn.Top,sourcePosition:n=pn.Bottom})=>vn(Ds,{children:[fe(aD,{type:"target",position:t,isConnectable:e}),i==null?void 0:i.label,fe(aD,{type:"source",position:n,isConnectable:e})]});bfe.displayName="DefaultNode";var OB=x.exports.memo(bfe);const Cfe=({data:i,isConnectable:e,sourcePosition:t=pn.Bottom})=>vn(Ds,{children:[i==null?void 0:i.label,fe(aD,{type:"source",position:t,isConnectable:e})]});Cfe.displayName="InputNode";var wfe=x.exports.memo(Cfe);const yfe=({data:i,isConnectable:e,targetPosition:t=pn.Top})=>vn(Ds,{children:[fe(aD,{type:"target",position:t,isConnectable:e}),i==null?void 0:i.label]});yfe.displayName="OutputNode";var Sfe=x.exports.memo(yfe);const dK=()=>null;dK.displayName="GroupNode";const ZOe=i=>({selectedNodes:i.getNodes().filter(e=>e.selected),selectedEdges:i.edges.filter(e=>e.selected)}),NN=i=>i.id;function QOe(i,e){return Hs(i.selectedNodes.map(NN),e.selectedNodes.map(NN))&&Hs(i.selectedEdges.map(NN),e.selectedEdges.map(NN))}const xfe=x.exports.memo(({onSelectionChange:i})=>{const e=ls(),{selectedNodes:t,selectedEdges:n}=mo(ZOe,QOe);return x.exports.useEffect(()=>{const o={nodes:t,edges:n};i==null||i(o),e.getState().onSelectionChange.forEach(r=>r(o))},[t,n,i]),null});xfe.displayName="SelectionListener";const JOe=i=>!!i.onSelectionChange;function e4e({onSelectionChange:i}){const e=mo(JOe);return i||e?fe(xfe,{onSelectionChange:i}):null}const t4e=i=>({setNodes:i.setNodes,setEdges:i.setEdges,setDefaultNodesAndEdges:i.setDefaultNodesAndEdges,setMinZoom:i.setMinZoom,setMaxZoom:i.setMaxZoom,setTranslateExtent:i.setTranslateExtent,setNodeExtent:i.setNodeExtent,reset:i.reset});function C1(i,e){x.exports.useEffect(()=>{typeof i!="undefined"&&e(i)},[i])}function _i(i,e,t){x.exports.useEffect(()=>{typeof e!="undefined"&&t({[i]:e})},[e])}const n4e=({nodes:i,edges:e,defaultNodes:t,defaultEdges:n,onConnect:o,onConnectStart:r,onConnectEnd:s,onClickConnectStart:a,onClickConnectEnd:l,nodesDraggable:c,nodesConnectable:u,nodesFocusable:d,edgesFocusable:h,edgesUpdatable:f,elevateNodesOnSelect:g,minZoom:p,maxZoom:v,nodeExtent:m,onNodesChange:_,onEdgesChange:w,elementsSelectable:y,connectionMode:L,snapGrid:D,snapToGrid:E,translateExtent:I,connectOnClick:k,defaultEdgeOptions:R,fitView:A,fitViewOptions:P,onNodesDelete:N,onEdgesDelete:M,onNodeDrag:H,onNodeDragStart:W,onNodeDragStop:F,onSelectionDrag:$,onSelectionDragStart:z,onSelectionDragStop:K,noPanClassName:j,nodeOrigin:G,rfId:X,autoPanOnConnect:de,autoPanOnNodeDrag:he,onError:pe,connectionRadius:be,isValidConnection:Se,nodeDragThreshold:Fe})=>{const{setNodes:De,setEdges:ce,setDefaultNodesAndEdges:Pe,setMinZoom:Oe,setMaxZoom:xe,setTranslateExtent:Ee,setNodeExtent:tt,reset:nt}=mo(t4e,Hs),Qe=ls();return x.exports.useEffect(()=>{const Ge=n==null?void 0:n.map(re=>({...re,...R}));return Pe(t,Ge),()=>{nt()}},[]),_i("defaultEdgeOptions",R,Qe.setState),_i("connectionMode",L,Qe.setState),_i("onConnect",o,Qe.setState),_i("onConnectStart",r,Qe.setState),_i("onConnectEnd",s,Qe.setState),_i("onClickConnectStart",a,Qe.setState),_i("onClickConnectEnd",l,Qe.setState),_i("nodesDraggable",c,Qe.setState),_i("nodesConnectable",u,Qe.setState),_i("nodesFocusable",d,Qe.setState),_i("edgesFocusable",h,Qe.setState),_i("edgesUpdatable",f,Qe.setState),_i("elementsSelectable",y,Qe.setState),_i("elevateNodesOnSelect",g,Qe.setState),_i("snapToGrid",E,Qe.setState),_i("snapGrid",D,Qe.setState),_i("onNodesChange",_,Qe.setState),_i("onEdgesChange",w,Qe.setState),_i("connectOnClick",k,Qe.setState),_i("fitViewOnInit",A,Qe.setState),_i("fitViewOnInitOptions",P,Qe.setState),_i("onNodesDelete",N,Qe.setState),_i("onEdgesDelete",M,Qe.setState),_i("onNodeDrag",H,Qe.setState),_i("onNodeDragStart",W,Qe.setState),_i("onNodeDragStop",F,Qe.setState),_i("onSelectionDrag",$,Qe.setState),_i("onSelectionDragStart",z,Qe.setState),_i("onSelectionDragStop",K,Qe.setState),_i("noPanClassName",j,Qe.setState),_i("nodeOrigin",G,Qe.setState),_i("rfId",X,Qe.setState),_i("autoPanOnConnect",de,Qe.setState),_i("autoPanOnNodeDrag",he,Qe.setState),_i("onError",pe,Qe.setState),_i("connectionRadius",be,Qe.setState),_i("isValidConnection",Se,Qe.setState),_i("nodeDragThreshold",Fe,Qe.setState),C1(i,De),C1(e,ce),C1(p,Oe),C1(v,xe),C1(I,Ee),C1(m,tt),null},Gee={display:"none"},i4e={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},Lfe="react-flow__node-desc",Efe="react-flow__edge-desc",o4e="react-flow__aria-live",r4e=i=>i.ariaLiveMessage;function s4e({rfId:i}){const e=mo(r4e);return fe("div",{id:`${o4e}-${i}`,"aria-live":"assertive","aria-atomic":"true",style:i4e,children:e})}function a4e({rfId:i,disableKeyboardA11y:e}){return vn(Ds,{children:[vn("div",{id:`${Lfe}-${i}`,style:Gee,children:["Press enter or space to select a node.",!e&&"You can then use the arrow keys to move the node around."," Press delete to remove it and escape to cancel."," "]}),fe("div",{id:`${Efe}-${i}`,style:Gee,children:"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel."}),!e&&fe(s4e,{rfId:i})]})}var lD=(i=null,e={actInsideInputWithModifier:!0})=>{const[t,n]=x.exports.useState(!1),o=x.exports.useRef(!1),r=x.exports.useRef(new Set([])),[s,a]=x.exports.useMemo(()=>{if(i!==null){const c=(Array.isArray(i)?i:[i]).filter(d=>typeof d=="string").map(d=>d.split("+")),u=c.reduce((d,h)=>d.concat(...h),[]);return[c,u]}return[[],[]]},[i]);return x.exports.useEffect(()=>{const l=typeof document!="undefined"?document:null,c=(e==null?void 0:e.target)||l;if(i!==null){const u=f=>{if(o.current=f.ctrlKey||f.metaKey||f.shiftKey,(!o.current||o.current&&!e.actInsideInputWithModifier)&&NB(f))return!1;const p=Yee(f.code,a);r.current.add(f[p]),Xee(s,r.current,!1)&&(f.preventDefault(),n(!0))},d=f=>{if((!o.current||o.current&&!e.actInsideInputWithModifier)&&NB(f))return!1;const p=Yee(f.code,a);Xee(s,r.current,!0)?(n(!1),r.current.clear()):r.current.delete(f[p]),f.key==="Meta"&&r.current.clear(),o.current=!1},h=()=>{r.current.clear(),n(!1)};return c==null||c.addEventListener("keydown",u),c==null||c.addEventListener("keyup",d),window.addEventListener("blur",h),()=>{c==null||c.removeEventListener("keydown",u),c==null||c.removeEventListener("keyup",d),window.removeEventListener("blur",h)}}},[i,n]),t};function Xee(i,e,t){return i.filter(n=>t||n.length===e.size).some(n=>n.every(o=>e.has(o)))}function Yee(i,e){return e.includes(i)?"code":"key"}function Dfe(i,e,t,n){var s,a,l,c,u,d,h,f;if(!i.parentNode)return t;const o=e.get(i.parentNode),r=w0(o,n);return Dfe(o,e,{x:((s=t.x)!=null?s:0)+r.x,y:((a=t.y)!=null?a:0)+r.y,z:((c=(l=o[Cs])==null?void 0:l.z)!=null?c:0)>((u=t.z)!=null?u:0)?(h=(d=o[Cs])==null?void 0:d.z)!=null?h:0:(f=t.z)!=null?f:0},n)}function kfe(i,e,t){i.forEach(n=>{var o,r;if(n.parentNode&&!i.has(n.parentNode))throw new Error(`Parent node ${n.parentNode} not found`);if(n.parentNode||(t==null?void 0:t[n.id])){const{x:s,y:a,z:l}=Dfe(n,i,{...n.position,z:(r=(o=n[Cs])==null?void 0:o.z)!=null?r:0},e);n.positionAbsolute={x:s,y:a},n[Cs].z=l,t!=null&&t[n.id]&&(n[Cs].isParent=!0)}})}function W8(i,e,t,n){const o=new Map,r={},s=n?1e3:0;return i.forEach(a=>{var d;const l=(Cu(a.zIndex)?a.zIndex:0)+(a.selected?s:0),c=e.get(a.id),u={width:c==null?void 0:c.width,height:c==null?void 0:c.height,...a,positionAbsolute:{x:a.position.x,y:a.position.y}};a.parentNode&&(u.parentNode=a.parentNode,r[a.parentNode]=!0),Object.defineProperty(u,Cs,{enumerable:!1,value:{handleBounds:(d=c==null?void 0:c[Cs])==null?void 0:d.handleBounds,z:l}}),o.set(a.id,u)}),kfe(o,t,r),o}function Ife(i,e={}){var g,p,v;const{getNodes:t,width:n,height:o,minZoom:r,maxZoom:s,d3Zoom:a,d3Selection:l,fitViewOnInitDone:c,fitViewOnInit:u,nodeOrigin:d}=i(),h=e.initial&&!c&&u;if(a&&l&&(h||!e.initial)){const m=t().filter(w=>{var L;const y=e.includeHiddenNodes?w.width&&w.height:!w.hidden;return(L=e.nodes)!=null&&L.length?y&&e.nodes.some(D=>D.id===w.id):y}),_=m.every(w=>w.width&&w.height);if(m.length>0&&_){const w=n4(m,d),{x:y,y:L,zoom:D}=gfe(w,n,o,(g=e.minZoom)!=null?g:r,(p=e.maxZoom)!=null?p:s,(v=e.padding)!=null?v:.1),E=$g.translate(y,L).scale(D);return typeof e.duration=="number"&&e.duration>0?a.transform(D_(l,e.duration),E):a.transform(l,E),!0}}return!1}function l4e(i,e){return i.forEach(t=>{const n=e.get(t.id);n&&e.set(n.id,{...n,[Cs]:n[Cs],selected:t.selected})}),new Map(e)}function c4e(i,e){return e.map(t=>{const n=i.find(o=>o.id===t.id);return n&&(t.selected=n.selected),t})}function RN({changedNodes:i,changedEdges:e,get:t,set:n}){const{nodeInternals:o,edges:r,onNodesChange:s,onEdgesChange:a,hasDefaultNodes:l,hasDefaultEdges:c}=t();i!=null&&i.length&&(l&&n({nodeInternals:l4e(i,o)}),s==null||s(i)),e!=null&&e.length&&(c&&n({edges:c4e(e,r)}),a==null||a(e))}const w1=()=>{},u4e={zoomIn:w1,zoomOut:w1,zoomTo:w1,getZoom:()=>1,setViewport:w1,getViewport:()=>({x:0,y:0,zoom:1}),fitView:()=>!1,setCenter:w1,fitBounds:w1,project:i=>i,screenToFlowPosition:i=>i,flowToScreenPosition:i=>i,viewportInitialized:!1},d4e=i=>({d3Zoom:i.d3Zoom,d3Selection:i.d3Selection}),h4e=()=>{const i=ls(),{d3Zoom:e,d3Selection:t}=mo(d4e,Hs);return x.exports.useMemo(()=>t&&e?{zoomIn:o=>e.scaleBy(D_(t,o==null?void 0:o.duration),1.2),zoomOut:o=>e.scaleBy(D_(t,o==null?void 0:o.duration),1/1.2),zoomTo:(o,r)=>e.scaleTo(D_(t,r==null?void 0:r.duration),o),getZoom:()=>i.getState().transform[2],setViewport:(o,r)=>{var u,d,h;const[s,a,l]=i.getState().transform,c=$g.translate((u=o.x)!=null?u:s,(d=o.y)!=null?d:a).scale((h=o.zoom)!=null?h:l);e.transform(D_(t,r==null?void 0:r.duration),c)},getViewport:()=>{const[o,r,s]=i.getState().transform;return{x:o,y:r,zoom:s}},fitView:o=>Ife(i.getState,o),setCenter:(o,r,s)=>{const{width:a,height:l,maxZoom:c}=i.getState(),u=typeof(s==null?void 0:s.zoom)!="undefined"?s.zoom:c,d=a/2-o*u,h=l/2-r*u,f=$g.translate(d,h).scale(u);e.transform(D_(t,s==null?void 0:s.duration),f)},fitBounds:(o,r)=>{var g;const{width:s,height:a,minZoom:l,maxZoom:c}=i.getState(),{x:u,y:d,zoom:h}=gfe(o,s,a,l,c,(g=r==null?void 0:r.padding)!=null?g:.1),f=$g.translate(u,d).scale(h);e.transform(D_(t,r==null?void 0:r.duration),f)},project:o=>{const{transform:r,snapToGrid:s,snapGrid:a}=i.getState();return console.warn("[DEPRECATED] `project` is deprecated. Instead use `screenToFlowPosition`. There is no need to subtract the react flow bounds anymore! https://reactflow.dev/api-reference/types/react-flow-instance#screen-to-flow-position"),PB(o,r,s,a)},screenToFlowPosition:o=>{const{transform:r,snapToGrid:s,snapGrid:a,domNode:l}=i.getState();if(!l)return o;const{x:c,y:u}=l.getBoundingClientRect(),d={x:o.x-c,y:o.y-u};return PB(d,r,s,a)},flowToScreenPosition:o=>{const{transform:r,domNode:s}=i.getState();if(!s)return o;const{x:a,y:l}=s.getBoundingClientRect(),c=dfe(o,r);return{x:c.x+a,y:c.y+l}},viewportInitialized:!0}:u4e,[e,t])};function hK(){const i=h4e(),e=ls(),t=x.exports.useCallback(()=>e.getState().getNodes().map(p=>({...p})),[]),n=x.exports.useCallback(p=>e.getState().nodeInternals.get(p),[]),o=x.exports.useCallback(()=>{const{edges:p=[]}=e.getState();return p.map(v=>({...v}))},[]),r=x.exports.useCallback(p=>{const{edges:v=[]}=e.getState();return v.find(m=>m.id===p)},[]),s=x.exports.useCallback(p=>{const{getNodes:v,setNodes:m,hasDefaultNodes:_,onNodesChange:w}=e.getState(),y=v(),L=typeof p=="function"?p(y):p;if(_)m(L);else if(w){const D=L.length===0?y.map(E=>({type:"remove",id:E.id})):L.map(E=>({item:E,type:"reset"}));w(D)}},[]),a=x.exports.useCallback(p=>{const{edges:v=[],setEdges:m,hasDefaultEdges:_,onEdgesChange:w}=e.getState(),y=typeof p=="function"?p(v):p;if(_)m(y);else if(w){const L=y.length===0?v.map(D=>({type:"remove",id:D.id})):y.map(D=>({item:D,type:"reset"}));w(L)}},[]),l=x.exports.useCallback(p=>{const v=Array.isArray(p)?p:[p],{getNodes:m,setNodes:_,hasDefaultNodes:w,onNodesChange:y}=e.getState();if(w){const D=[...m(),...v];_(D)}else if(y){const L=v.map(D=>({item:D,type:"add"}));y(L)}},[]),c=x.exports.useCallback(p=>{const v=Array.isArray(p)?p:[p],{edges:m=[],setEdges:_,hasDefaultEdges:w,onEdgesChange:y}=e.getState();if(w)_([...m,...v]);else if(y){const L=v.map(D=>({item:D,type:"add"}));y(L)}},[]),u=x.exports.useCallback(()=>{const{getNodes:p,edges:v=[],transform:m}=e.getState(),[_,w,y]=m;return{nodes:p().map(L=>({...L})),edges:v.map(L=>({...L})),viewport:{x:_,y:w,zoom:y}}},[]),d=x.exports.useCallback(({nodes:p,edges:v})=>{const{nodeInternals:m,getNodes:_,edges:w,hasDefaultNodes:y,hasDefaultEdges:L,onNodesDelete:D,onEdgesDelete:E,onNodesChange:I,onEdgesChange:k}=e.getState(),R=(p||[]).map(H=>H.id),A=(v||[]).map(H=>H.id),P=_().reduce((H,W)=>{const F=!R.includes(W.id)&&W.parentNode&&H.find(z=>z.id===W.parentNode);return(typeof W.deletable=="boolean"?W.deletable:!0)&&(R.includes(W.id)||F)&&H.push(W),H},[]),N=w.filter(H=>typeof H.deletable=="boolean"?H.deletable:!0),M=N.filter(H=>A.includes(H.id));if(P||M){const H=ffe(P,N),W=[...M,...H],F=W.reduce(($,z)=>($.includes(z.id)||$.push(z.id),$),[]);if((L||y)&&(L&&e.setState({edges:w.filter($=>!F.includes($.id))}),y&&(P.forEach($=>{m.delete($.id)}),e.setState({nodeInternals:new Map(m)}))),F.length>0&&(E==null||E(W),k&&k(F.map($=>({id:$,type:"remove"})))),P.length>0&&(D==null||D(P),I)){const $=P.map(z=>({id:z.id,type:"remove"}));I($)}}},[]),h=x.exports.useCallback(p=>{const v=AOe(p),m=v?null:e.getState().nodeInternals.get(p.id);return!v&&!m?[null,null,v]:[v?p:Hee(m),m,v]},[]),f=x.exports.useCallback((p,v=!0,m)=>{const[_,w,y]=h(p);return _?(m||e.getState().getNodes()).filter(L=>{if(!y&&(L.id===w.id||!L.positionAbsolute))return!1;const D=Hee(L),E=TB(D,_);return v&&E>0||E>=_.width*_.height}):[]},[]),g=x.exports.useCallback((p,v,m=!0)=>{const[_]=h(p);if(!_)return!1;const w=TB(_,v);return m&&w>0||w>=_.width*_.height},[]);return x.exports.useMemo(()=>({...i,getNodes:t,getNode:n,getEdges:o,getEdge:r,setNodes:s,setEdges:a,addNodes:l,addEdges:c,toObject:u,deleteElements:d,getIntersectingNodes:f,isNodeIntersecting:g}),[i,t,n,o,r,s,a,l,c,u,d,f,g])}const f4e={actInsideInputWithModifier:!1};var g4e=({deleteKeyCode:i,multiSelectionKeyCode:e})=>{const t=ls(),{deleteElements:n}=hK(),o=lD(i,f4e),r=lD(e);x.exports.useEffect(()=>{if(o){const{edges:s,getNodes:a}=t.getState(),l=a().filter(u=>u.selected),c=s.filter(u=>u.selected);n({nodes:l,edges:c}),t.setState({nodesSelectionActive:!1})}},[o]),x.exports.useEffect(()=>{t.setState({multiSelectionActive:r})},[r])};function p4e(i){const e=ls();x.exports.useEffect(()=>{let t;const n=()=>{var r,s;if(!i.current)return;const o=oK(i.current);(o.height===0||o.width===0)&&((s=(r=e.getState()).onError)==null||s.call(r,"004",tp.error004())),e.setState({width:o.width||500,height:o.height||500})};return n(),window.addEventListener("resize",n),i.current&&(t=new ResizeObserver(()=>n()),t.observe(i.current)),()=>{window.removeEventListener("resize",n),t&&i.current&&t.unobserve(i.current)}},[])}const fK={position:"absolute",width:"100%",height:"100%",top:0,left:0},m4e=(i,e)=>i.x!==e.x||i.y!==e.y||i.zoom!==e.k,MN=i=>({x:i.x,y:i.y,zoom:i.k}),y1=(i,e)=>i.target.closest(`.${e}`),Zee=(i,e)=>e===2&&Array.isArray(i)&&i.includes(2),Qee=i=>{const e=i.ctrlKey&&aA()?10:1;return-i.deltaY*(i.deltaMode===1?.05:i.deltaMode?1:.002)*e},v4e=i=>({d3Zoom:i.d3Zoom,d3Selection:i.d3Selection,d3ZoomHandler:i.d3ZoomHandler,userSelectionActive:i.userSelectionActive}),_4e=({onMove:i,onMoveStart:e,onMoveEnd:t,onPaneContextMenu:n,zoomOnScroll:o=!0,zoomOnPinch:r=!0,panOnScroll:s=!1,panOnScrollSpeed:a=.5,panOnScrollMode:l=e0.Free,zoomOnDoubleClick:c=!0,elementsSelectable:u,panOnDrag:d=!0,defaultViewport:h,translateExtent:f,minZoom:g,maxZoom:p,zoomActivationKeyCode:v,preventScrolling:m=!0,children:_,noWheelClassName:w,noPanClassName:y})=>{const L=x.exports.useRef(),D=ls(),E=x.exports.useRef(!1),I=x.exports.useRef(!1),k=x.exports.useRef(null),R=x.exports.useRef({x:0,y:0,zoom:0}),{d3Zoom:A,d3Selection:P,d3ZoomHandler:N,userSelectionActive:M}=mo(v4e,Hs),H=lD(v),W=x.exports.useRef(0),F=x.exports.useRef(!1),$=x.exports.useRef();return p4e(k),x.exports.useEffect(()=>{if(k.current){const z=k.current.getBoundingClientRect(),K=Yhe().scaleExtent([g,p]).translateExtent(f),j=bu(k.current).call(K),G=$g.translate(h.x,h.y).scale(ny(h.zoom,g,p)),X=[[0,0],[z.width,z.height]],de=K.constrain()(G,X,f);K.transform(j,de),K.wheelDelta(Qee),D.setState({d3Zoom:K,d3Selection:j,d3ZoomHandler:j.on("wheel.zoom"),transform:[de.x,de.y,de.k],domNode:k.current.closest(".react-flow")})}},[]),x.exports.useEffect(()=>{P&&A&&(s&&!H&&!M?P.on("wheel.zoom",z=>{if(y1(z,w))return!1;z.preventDefault(),z.stopImmediatePropagation();const K=P.property("__zoom").k||1,j=aA();if(z.ctrlKey&&r&&j){const Fe=fd(z),De=Qee(z),ce=K*Math.pow(2,De);A.scaleTo(P,ce,Fe,z);return}const G=z.deltaMode===1?20:1;let X=l===e0.Vertical?0:z.deltaX*G,de=l===e0.Horizontal?0:z.deltaY*G;!j&&z.shiftKey&&l!==e0.Vertical&&(X=z.deltaY*G,de=0),A.translateBy(P,-(X/K)*a,-(de/K)*a,{internal:!0});const he=MN(P.property("__zoom")),{onViewportChangeStart:pe,onViewportChange:be,onViewportChangeEnd:Se}=D.getState();clearTimeout($.current),F.current||(F.current=!0,e==null||e(z,he),pe==null||pe(he)),F.current&&(i==null||i(z,he),be==null||be(he),$.current=setTimeout(()=>{t==null||t(z,he),Se==null||Se(he),F.current=!1},150))},{passive:!1}):typeof N!="undefined"&&P.on("wheel.zoom",function(z,K){if(!m||y1(z,w))return null;z.preventDefault(),N.call(this,z,K)},{passive:!1}))},[M,s,l,P,A,N,H,r,m,w,e,i,t]),x.exports.useEffect(()=>{A&&A.on("start",z=>{var G,X;if(!z.sourceEvent||z.sourceEvent.internal)return null;W.current=(G=z.sourceEvent)==null?void 0:G.button;const{onViewportChangeStart:K}=D.getState(),j=MN(z.transform);E.current=!0,R.current=j,((X=z.sourceEvent)==null?void 0:X.type)==="mousedown"&&D.setState({paneDragging:!0}),K==null||K(j),e==null||e(z.sourceEvent,j)})},[A,e]),x.exports.useEffect(()=>{A&&(M&&!E.current?A.on("zoom",null):M||A.on("zoom",z=>{var j,G;const{onViewportChange:K}=D.getState();if(D.setState({transform:[z.transform.x,z.transform.y,z.transform.k]}),I.current=!!(n&&Zee(d,(j=W.current)!=null?j:0)),(i||K)&&!((G=z.sourceEvent)!=null&&G.internal)){const X=MN(z.transform);K==null||K(X),i==null||i(z.sourceEvent,X)}}))},[M,A,i,d,n]),x.exports.useEffect(()=>{A&&A.on("end",z=>{var j;if(!z.sourceEvent||z.sourceEvent.internal)return null;const{onViewportChangeEnd:K}=D.getState();if(E.current=!1,D.setState({paneDragging:!1}),n&&Zee(d,(j=W.current)!=null?j:0)&&!I.current&&n(z.sourceEvent),I.current=!1,(t||K)&&m4e(R.current,z.transform)){const G=MN(z.transform);R.current=G,clearTimeout(L.current),L.current=setTimeout(()=>{K==null||K(G),t==null||t(z.sourceEvent,G)},s?150:0)}})},[A,s,d,t,n]),x.exports.useEffect(()=>{A&&A.filter(z=>{const K=H||o,j=r&&z.ctrlKey;if((d===!0||Array.isArray(d)&&d.includes(1))&&z.button===1&&z.type==="mousedown"&&(y1(z,"react-flow__node")||y1(z,"react-flow__edge")))return!0;if(!d&&!K&&!s&&!c&&!r||M||!c&&z.type==="dblclick"||y1(z,w)&&z.type==="wheel"||y1(z,y)&&(z.type!=="wheel"||s&&z.type==="wheel"&&!H)||!r&&z.ctrlKey&&z.type==="wheel"||!K&&!s&&!j&&z.type==="wheel"||!d&&(z.type==="mousedown"||z.type==="touchstart")||Array.isArray(d)&&!d.includes(z.button)&&(z.type==="mousedown"||z.type==="touchstart"))return!1;const G=Array.isArray(d)&&d.includes(z.button)||!z.button||z.button<=1;return(!z.ctrlKey||z.type==="wheel")&&G})},[M,A,o,r,s,c,d,u,H]),fe("div",{className:"react-flow__renderer",ref:k,style:fK,children:_})},b4e=i=>({userSelectionActive:i.userSelectionActive,userSelectionRect:i.userSelectionRect});function C4e(){const{userSelectionActive:i,userSelectionRect:e}=mo(b4e,Hs);return i&&e?fe("div",{className:"react-flow__selection react-flow__container",style:{width:e.width,height:e.height,transform:`translate(${e.x}px, ${e.y}px)`}}):null}function Jee(i,e){var n,o;const t=i.find(r=>r.id===e.parentNode);if(t){const r=e.position.x+e.width-t.width,s=e.position.y+e.height-t.height;if(r>0||s>0||e.position.x<0||e.position.y<0){if(t.style={...t.style},t.style.width=(n=t.style.width)!=null?n:t.width,t.style.height=(o=t.style.height)!=null?o:t.height,r>0&&(t.style.width+=r),s>0&&(t.style.height+=s),e.position.x<0){const a=Math.abs(e.position.x);t.position.x=t.position.x-a,t.style.width+=a,e.position.x=0}if(e.position.y<0){const a=Math.abs(e.position.y);t.position.y=t.position.y-a,t.style.height+=a,e.position.y=0}t.width=t.style.width,t.height=t.style.height}}}function Tfe(i,e){if(i.some(n=>n.type==="reset"))return i.filter(n=>n.type==="reset").map(n=>n.item);const t=i.filter(n=>n.type==="add").map(n=>n.item);return e.reduce((n,o)=>{const r=i.filter(a=>a.id===o.id);if(r.length===0)return n.push(o),n;const s={...o};for(const a of r)if(a)switch(a.type){case"select":{s.selected=a.selected;break}case"position":{typeof a.position!="undefined"&&(s.position=a.position),typeof a.positionAbsolute!="undefined"&&(s.positionAbsolute=a.positionAbsolute),typeof a.dragging!="undefined"&&(s.dragging=a.dragging),s.expandParent&&Jee(n,s);break}case"dimensions":{typeof a.dimensions!="undefined"&&(s.width=a.dimensions.width,s.height=a.dimensions.height),typeof a.updateStyle!="undefined"&&(s.style={...s.style||{},...a.dimensions}),typeof a.resizing=="boolean"&&(s.resizing=a.resizing),s.expandParent&&Jee(n,s);break}case"remove":return n}return n.push(s),n},t)}function Nfe(i,e){return Tfe(i,e)}function w4e(i,e){return Tfe(i,e)}const Jp=(i,e)=>({id:i,type:"select",selected:e});function yC(i,e){return i.reduce((t,n)=>{const o=e.includes(n.id);return!n.selected&&o?(n.selected=!0,t.push(Jp(n.id,!0))):n.selected&&!o&&(n.selected=!1,t.push(Jp(n.id,!1))),t},[])}const V8=(i,e)=>t=>{t.target===e.current&&(i==null||i(t))},y4e=i=>({userSelectionActive:i.userSelectionActive,elementsSelectable:i.elementsSelectable,dragging:i.paneDragging}),Rfe=x.exports.memo(({isSelecting:i,selectionMode:e=sD.Full,panOnDrag:t,onSelectionStart:n,onSelectionEnd:o,onPaneClick:r,onPaneContextMenu:s,onPaneScroll:a,onPaneMouseEnter:l,onPaneMouseMove:c,onPaneMouseLeave:u,children:d})=>{const h=x.exports.useRef(null),f=ls(),g=x.exports.useRef(0),p=x.exports.useRef(0),v=x.exports.useRef(),{userSelectionActive:m,elementsSelectable:_,dragging:w}=mo(y4e,Hs),y=()=>{f.setState({userSelectionActive:!1,userSelectionRect:null}),g.current=0,p.current=0},L=N=>{r==null||r(N),f.getState().resetSelectedElements(),f.setState({nodesSelectionActive:!1})},D=N=>{if(Array.isArray(t)&&(t==null?void 0:t.includes(2))){N.preventDefault();return}s==null||s(N)},E=a?N=>a(N):void 0,I=N=>{const{resetSelectedElements:M,domNode:H}=f.getState();if(v.current=H==null?void 0:H.getBoundingClientRect(),!_||!i||N.button!==0||N.target!==h.current||!v.current)return;const{x:W,y:F}=Hm(N,v.current);M(),f.setState({userSelectionRect:{width:0,height:0,startX:W,startY:F,x:W,y:F}}),n==null||n(N)},k=N=>{var De,ce;const{userSelectionRect:M,nodeInternals:H,edges:W,transform:F,onNodesChange:$,onEdgesChange:z,nodeOrigin:K,getNodes:j}=f.getState();if(!i||!v.current||!M)return;f.setState({userSelectionActive:!0,nodesSelectionActive:!1});const G=Hm(N,v.current),X=(De=M.startX)!=null?De:0,de=(ce=M.startY)!=null?ce:0,he={...M,x:G.xPe.id),Fe=be.map(Pe=>Pe.id);if(g.current!==Fe.length){g.current=Fe.length;const Pe=yC(pe,Fe);Pe.length&&($==null||$(Pe))}if(p.current!==Se.length){p.current=Se.length;const Pe=yC(W,Se);Pe.length&&(z==null||z(Pe))}f.setState({userSelectionRect:he})},R=N=>{if(N.button!==0)return;const{userSelectionRect:M}=f.getState();!m&&M&&N.target===h.current&&(L==null||L(N)),f.setState({nodesSelectionActive:g.current>0}),y(),o==null||o(N)},A=N=>{m&&(f.setState({nodesSelectionActive:g.current>0}),o==null||o(N)),y()},P=_&&(i||m);return vn("div",{className:ha(["react-flow__pane",{dragging:w,selection:i}]),onClick:P?void 0:V8(L,h),onContextMenu:V8(D,h),onWheel:V8(E,h),onMouseEnter:P?void 0:l,onMouseDown:P?I:void 0,onMouseMove:P?k:c,onMouseUp:P?R:void 0,onMouseLeave:P?A:u,ref:h,style:fK,children:[d,fe(C4e,{})]})});Rfe.displayName="Pane";function Mfe(i,e){if(!i.parentNode)return!1;const t=e.get(i.parentNode);return t?t.selected?!0:Mfe(t,e):!1}function ete(i,e,t){let n=i;do{if(n!=null&&n.matches(e))return!0;if(n===t.current)return!1;n=n.parentElement}while(n);return!1}function S4e(i,e,t,n){return Array.from(i.values()).filter(o=>(o.selected||o.id===n)&&(!o.parentNode||!Mfe(o,i))&&(o.draggable||e&&typeof o.draggable=="undefined")).map(o=>{var r,s,a,l;return{id:o.id,position:o.position||{x:0,y:0},positionAbsolute:o.positionAbsolute||{x:0,y:0},distance:{x:t.x-((s=(r=o.positionAbsolute)==null?void 0:r.x)!=null?s:0),y:t.y-((l=(a=o.positionAbsolute)==null?void 0:a.y)!=null?l:0)},delta:{x:0,y:0},extent:o.extent,parentNode:o.parentNode,width:o.width,height:o.height,expandParent:o.expandParent}})}function x4e(i,e){return!e||e==="parent"?e:[e[0],[e[1][0]-(i.width||0),e[1][1]-(i.height||0)]]}function Afe(i,e,t,n,o=[0,0],r){const s=x4e(i,i.extent||n);let a=s;if(i.extent==="parent"&&!i.expandParent)if(i.parentNode&&i.width&&i.height){const u=t.get(i.parentNode),{x:d,y:h}=w0(u,o).positionAbsolute;a=u&&Cu(d)&&Cu(h)&&Cu(u.width)&&Cu(u.height)?[[d+i.width*o[0],h+i.height*o[1]],[d+u.width-i.width+i.width*o[0],h+u.height-i.height+i.height*o[1]]]:a}else r==null||r("005",tp.error005()),a=s;else if(i.extent&&i.parentNode&&i.extent!=="parent"){const u=t.get(i.parentNode),{x:d,y:h}=w0(u,o).positionAbsolute;a=[[i.extent[0][0]+d,i.extent[0][1]+h],[i.extent[1][0]+d,i.extent[1][1]+h]]}let l={x:0,y:0};if(i.parentNode){const u=t.get(i.parentNode);l=w0(u,o).positionAbsolute}const c=a&&a!=="parent"?rK(e,a):e;return{position:{x:c.x-l.x,y:c.y-l.y},positionAbsolute:c}}function H8({nodeId:i,dragItems:e,nodeInternals:t}){const n=e.map(o=>({...t.get(o.id),position:o.position,positionAbsolute:o.positionAbsolute}));return[i?n.find(o=>o.id===i):n[0],n]}const tte=(i,e,t,n)=>{const o=e.querySelectorAll(i);if(!o||!o.length)return null;const r=Array.from(o),s=e.getBoundingClientRect(),a={x:s.width*n[0],y:s.height*n[1]};return r.map(l=>{const c=l.getBoundingClientRect();return{id:l.getAttribute("data-handleid"),position:l.getAttribute("data-handlepos"),x:(c.left-s.left-a.x)/t,y:(c.top-s.top-a.y)/t,...oK(l)}})};function _x(i,e,t){return t===void 0?t:n=>{const o=e().nodeInternals.get(i);o&&t(n,{...o})}}function FB({id:i,store:e,unselect:t=!1,nodeRef:n}){const{addSelectedNodes:o,unselectNodesAndEdges:r,multiSelectionActive:s,nodeInternals:a,onError:l}=e.getState(),c=a.get(i);if(!c){l==null||l("012",tp.error012(i));return}e.setState({nodesSelectionActive:!1}),c.selected?(t||c.selected&&s)&&(r({nodes:[c],edges:[]}),requestAnimationFrame(()=>{var u;return(u=n==null?void 0:n.current)==null?void 0:u.blur()})):o([i])}function L4e(){const i=ls();return x.exports.useCallback(({sourceEvent:t})=>{const{transform:n,snapGrid:o,snapToGrid:r}=i.getState(),s=t.touches?t.touches[0].clientX:t.clientX,a=t.touches?t.touches[0].clientY:t.clientY,l={x:(s-n[0])/n[2],y:(a-n[1])/n[2]};return{xSnapped:r?o[0]*Math.round(l.x/o[0]):l.x,ySnapped:r?o[1]*Math.round(l.y/o[1]):l.y,...l}},[])}function $8(i){return(e,t,n)=>i==null?void 0:i(e,n)}function Pfe({nodeRef:i,disabled:e=!1,noDragClassName:t,handleSelector:n,nodeId:o,isSelectable:r,selectNodesOnDrag:s}){const a=ls(),[l,c]=x.exports.useState(!1),u=x.exports.useRef([]),d=x.exports.useRef({x:null,y:null}),h=x.exports.useRef(0),f=x.exports.useRef(null),g=x.exports.useRef({x:0,y:0}),p=x.exports.useRef(null),v=x.exports.useRef(!1),m=x.exports.useRef(!1),_=L4e();return x.exports.useEffect(()=>{if(i!=null&&i.current){const w=bu(i.current),y=({x:E,y:I})=>{const{nodeInternals:k,onNodeDrag:R,onSelectionDrag:A,updateNodePositions:P,nodeExtent:N,snapGrid:M,snapToGrid:H,nodeOrigin:W,onError:F}=a.getState();d.current={x:E,y:I};let $=!1,z={x:0,y:0,x2:0,y2:0};if(u.current.length>1&&N){const j=n4(u.current,W);z=rD(j)}if(u.current=u.current.map(j=>{var he,pe;const G={x:E-j.distance.x,y:I-j.distance.y};H&&(G.x=M[0]*Math.round(G.x/M[0]),G.y=M[1]*Math.round(G.y/M[1]));const X=[[N[0][0],N[0][1]],[N[1][0],N[1][1]]];u.current.length>1&&N&&!j.extent&&(X[0][0]=j.positionAbsolute.x-z.x+N[0][0],X[1][0]=j.positionAbsolute.x+((he=j.width)!=null?he:0)-z.x2+N[1][0],X[0][1]=j.positionAbsolute.y-z.y+N[0][1],X[1][1]=j.positionAbsolute.y+((pe=j.height)!=null?pe:0)-z.y2+N[1][1]);const de=Afe(j,G,k,X,W,F);return $=$||j.position.x!==de.position.x||j.position.y!==de.position.y,j.position=de.position,j.positionAbsolute=de.positionAbsolute,j}),!$)return;P(u.current,!0,!0),c(!0);const K=o?R:$8(A);if(K&&p.current){const[j,G]=H8({nodeId:o,dragItems:u.current,nodeInternals:k});K(p.current,j,G)}},L=()=>{var k,R;if(!f.current)return;const[E,I]=efe(g.current,f.current);if(E!==0||I!==0){const{transform:A,panBy:P}=a.getState();d.current.x=((k=d.current.x)!=null?k:0)-E/A[2],d.current.y=((R=d.current.y)!=null?R:0)-I/A[2],P({x:E,y:I})&&y(d.current)}h.current=requestAnimationFrame(L)},D=E=>{var W;const{nodeInternals:I,multiSelectionActive:k,nodesDraggable:R,unselectNodesAndEdges:A,onNodeDragStart:P,onSelectionDragStart:N}=a.getState();m.current=!0;const M=o?P:$8(N);(!s||!r)&&!k&&o&&((W=I.get(o))!=null&&W.selected||A()),o&&r&&s&&FB({id:o,store:a,nodeRef:i});const H=_(E);if(d.current=H,u.current=S4e(I,R,H,o),M&&u.current){const[F,$]=H8({nodeId:o,dragItems:u.current,nodeInternals:I});M(E.sourceEvent,F,$)}};if(e)w.on(".drag",null);else{const E=AAe().on("start",I=>{const{domNode:k,nodeDragThreshold:R}=a.getState();R===0&&D(I);const A=_(I);d.current=A,f.current=(k==null?void 0:k.getBoundingClientRect())||null,g.current=Hm(I.sourceEvent,f.current)}).on("drag",I=>{var P,N,M,H;const k=_(I),{autoPanOnNodeDrag:R,nodeDragThreshold:A}=a.getState();if(!v.current&&m.current&&R&&(v.current=!0,L()),!m.current){const W=k.xSnapped-((N=(P=d==null?void 0:d.current)==null?void 0:P.x)!=null?N:0),F=k.ySnapped-((H=(M=d==null?void 0:d.current)==null?void 0:M.y)!=null?H:0);Math.sqrt(W*W+F*F)>A&&D(I)}(d.current.x!==k.xSnapped||d.current.y!==k.ySnapped)&&u.current&&m.current&&(p.current=I.sourceEvent,g.current=Hm(I.sourceEvent,f.current),y(k))}).on("end",I=>{if(!!m.current&&(c(!1),v.current=!1,m.current=!1,cancelAnimationFrame(h.current),u.current)){const{updateNodePositions:k,nodeInternals:R,onNodeDragStop:A,onSelectionDragStop:P}=a.getState(),N=o?A:$8(P);if(k(u.current,!1,!1),N){const[M,H]=H8({nodeId:o,dragItems:u.current,nodeInternals:R});N(I.sourceEvent,M,H)}}}).filter(I=>{const k=I.target;return!I.button&&(!t||!ete(k,`.${t}`,i))&&(!n||ete(k,n,i))});return w.call(E),()=>{w.on(".drag",null)}}}},[i,e,t,n,r,a,o,s,_]),l}function Ofe(){const i=ls();return x.exports.useCallback(t=>{const{nodeInternals:n,nodeExtent:o,updateNodePositions:r,getNodes:s,snapToGrid:a,snapGrid:l,onError:c,nodesDraggable:u}=i.getState(),d=s().filter(_=>_.selected&&(_.draggable||u&&typeof _.draggable=="undefined")),h=a?l[0]:5,f=a?l[1]:5,g=t.isShiftPressed?4:1,p=t.x*h*g,v=t.y*f*g,m=d.map(_=>{if(_.positionAbsolute){const w={x:_.positionAbsolute.x+p,y:_.positionAbsolute.y+v};a&&(w.x=l[0]*Math.round(w.x/l[0]),w.y=l[1]*Math.round(w.y/l[1]));const{positionAbsolute:y,position:L}=Afe(_,w,n,o,void 0,c);_.position=L,_.positionAbsolute=y}return _});r(m,!0,!1)},[])}const dw={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};var bx=i=>{const e=({id:t,type:n,data:o,xPos:r,yPos:s,xPosOrigin:a,yPosOrigin:l,selected:c,onClick:u,onMouseEnter:d,onMouseMove:h,onMouseLeave:f,onContextMenu:g,onDoubleClick:p,style:v,className:m,isDraggable:_,isSelectable:w,isConnectable:y,isFocusable:L,selectNodesOnDrag:D,sourcePosition:E,targetPosition:I,hidden:k,resizeObserver:R,dragHandle:A,zIndex:P,isParent:N,noDragClassName:M,noPanClassName:H,initialized:W,disableKeyboardA11y:F,ariaLabel:$,rfId:z})=>{const K=ls(),j=x.exports.useRef(null),G=x.exports.useRef(E),X=x.exports.useRef(I),de=x.exports.useRef(n),he=w||_||u||d||h||f,pe=Ofe(),be=_x(t,K.getState,d),Se=_x(t,K.getState,h),Fe=_x(t,K.getState,f),De=_x(t,K.getState,g),ce=_x(t,K.getState,p),Pe=Ee=>{const{nodeDragThreshold:tt}=K.getState();if(w&&(!D||!_||tt>0)&&FB({id:t,store:K,nodeRef:j}),u){const nt=K.getState().nodeInternals.get(t);nt&&u(Ee,{...nt})}},Oe=Ee=>{if(!NB(Ee))if(ofe.includes(Ee.key)&&w){const tt=Ee.key==="Escape";FB({id:t,store:K,unselect:tt,nodeRef:j})}else!F&&_&&c&&Object.prototype.hasOwnProperty.call(dw,Ee.key)&&(K.setState({ariaLiveMessage:`Moved selected node ${Ee.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~r}, y: ${~~s}`}),pe({x:dw[Ee.key].x,y:dw[Ee.key].y,isShiftPressed:Ee.shiftKey}))};x.exports.useEffect(()=>{if(j.current&&!k){const Ee=j.current;return R==null||R.observe(Ee),()=>R==null?void 0:R.unobserve(Ee)}},[k]),x.exports.useEffect(()=>{const Ee=de.current!==n,tt=G.current!==E,nt=X.current!==I;j.current&&(Ee||tt||nt)&&(Ee&&(de.current=n),tt&&(G.current=E),nt&&(X.current=I),K.getState().updateNodeDimensions([{id:t,nodeElement:j.current,forceUpdate:!0}]))},[t,n,E,I]);const xe=Pfe({nodeRef:j,disabled:k||!_,noDragClassName:M,handleSelector:A,nodeId:t,isSelectable:w,selectNodesOnDrag:D});return k?null:fe("div",{className:ha(["react-flow__node",`react-flow__node-${n}`,{[H]:_},m,{selected:c,selectable:w,parent:N,dragging:xe}]),ref:j,style:{zIndex:P,transform:`translate(${a}px,${l}px)`,pointerEvents:he?"all":"none",visibility:W?"visible":"hidden",...v},"data-id":t,"data-testid":`rf__node-${t}`,onMouseEnter:be,onMouseMove:Se,onMouseLeave:Fe,onContextMenu:De,onClick:Pe,onDoubleClick:ce,onKeyDown:L?Oe:void 0,tabIndex:L?0:void 0,role:L?"button":void 0,"aria-describedby":F?void 0:`${Lfe}-${z}`,"aria-label":$,children:fe(HOe,{value:t,children:fe(i,{id:t,data:o,type:n,xPos:r,yPos:s,selected:c,isConnectable:y,sourcePosition:E,targetPosition:I,dragging:xe,dragHandle:A,zIndex:P})})})};return e.displayName="NodeWrapper",x.exports.memo(e)};const E4e=i=>{const e=i.getNodes().filter(t=>t.selected);return{...n4(e,i.nodeOrigin),transformString:`translate(${i.transform[0]}px,${i.transform[1]}px) scale(${i.transform[2]})`,userSelectionActive:i.userSelectionActive}};function D4e({onSelectionContextMenu:i,noPanClassName:e,disableKeyboardA11y:t}){const n=ls(),{width:o,height:r,x:s,y:a,transformString:l,userSelectionActive:c}=mo(E4e,Hs),u=Ofe(),d=x.exports.useRef(null);if(x.exports.useEffect(()=>{var g;t||(g=d.current)==null||g.focus({preventScroll:!0})},[t]),Pfe({nodeRef:d}),c||!o||!r)return null;const h=i?g=>{const p=n.getState().getNodes().filter(v=>v.selected);i(g,p)}:void 0,f=g=>{Object.prototype.hasOwnProperty.call(dw,g.key)&&u({x:dw[g.key].x,y:dw[g.key].y,isShiftPressed:g.shiftKey})};return fe("div",{className:ha(["react-flow__nodesselection","react-flow__container",e]),style:{transform:l},children:fe("div",{ref:d,className:"react-flow__nodesselection-rect",onContextMenu:h,tabIndex:t?void 0:-1,onKeyDown:t?void 0:f,style:{width:o,height:r,top:a,left:s}})})}var k4e=x.exports.memo(D4e);const I4e=i=>i.nodesSelectionActive,Ffe=({children:i,onPaneClick:e,onPaneMouseEnter:t,onPaneMouseMove:n,onPaneMouseLeave:o,onPaneContextMenu:r,onPaneScroll:s,deleteKeyCode:a,onMove:l,onMoveStart:c,onMoveEnd:u,selectionKeyCode:d,selectionOnDrag:h,selectionMode:f,onSelectionStart:g,onSelectionEnd:p,multiSelectionKeyCode:v,panActivationKeyCode:m,zoomActivationKeyCode:_,elementsSelectable:w,zoomOnScroll:y,zoomOnPinch:L,panOnScroll:D,panOnScrollSpeed:E,panOnScrollMode:I,zoomOnDoubleClick:k,panOnDrag:R,defaultViewport:A,translateExtent:P,minZoom:N,maxZoom:M,preventScrolling:H,onSelectionContextMenu:W,noWheelClassName:F,noPanClassName:$,disableKeyboardA11y:z})=>{const K=mo(I4e),j=lD(d),G=lD(m),X=G||R,de=G||D,he=j||h&&X!==!0;return g4e({deleteKeyCode:a,multiSelectionKeyCode:v}),fe(_4e,{onMove:l,onMoveStart:c,onMoveEnd:u,onPaneContextMenu:r,elementsSelectable:w,zoomOnScroll:y,zoomOnPinch:L,panOnScroll:de,panOnScrollSpeed:E,panOnScrollMode:I,zoomOnDoubleClick:k,panOnDrag:!j&&X,defaultViewport:A,translateExtent:P,minZoom:N,maxZoom:M,zoomActivationKeyCode:_,preventScrolling:H,noWheelClassName:F,noPanClassName:$,children:vn(Rfe,{onSelectionStart:g,onSelectionEnd:p,onPaneClick:e,onPaneMouseEnter:t,onPaneMouseMove:n,onPaneMouseLeave:o,onPaneContextMenu:r,onPaneScroll:s,panOnDrag:X,isSelecting:!!he,selectionMode:f,children:[i,K&&fe(k4e,{onSelectionContextMenu:W,noPanClassName:$,disableKeyboardA11y:z})]})})};Ffe.displayName="FlowRenderer";var T4e=x.exports.memo(Ffe);function N4e(i){return mo(x.exports.useCallback(t=>i?hfe(t.nodeInternals,{x:0,y:0,width:t.width,height:t.height},t.transform,!0):t.getNodes(),[i]))}function R4e(i){const e={input:bx(i.input||wfe),default:bx(i.default||OB),output:bx(i.output||Sfe),group:bx(i.group||dK)},t={},n=Object.keys(i).filter(o=>!["input","default","output","group"].includes(o)).reduce((o,r)=>(o[r]=bx(i[r]||OB),o),t);return{...e,...n}}const M4e=({x:i,y:e,width:t,height:n,origin:o})=>!t||!n?{x:i,y:e}:o[0]<0||o[1]<0||o[0]>1||o[1]>1?{x:i,y:e}:{x:i-t*o[0],y:e-n*o[1]},A4e=i=>({nodesDraggable:i.nodesDraggable,nodesConnectable:i.nodesConnectable,nodesFocusable:i.nodesFocusable,elementsSelectable:i.elementsSelectable,updateNodeDimensions:i.updateNodeDimensions,onError:i.onError}),Bfe=i=>{const{nodesDraggable:e,nodesConnectable:t,nodesFocusable:n,elementsSelectable:o,updateNodeDimensions:r,onError:s}=mo(A4e,Hs),a=N4e(i.onlyRenderVisibleElements),l=x.exports.useRef(),c=x.exports.useMemo(()=>{if(typeof ResizeObserver=="undefined")return null;const u=new ResizeObserver(d=>{const h=d.map(f=>({id:f.target.getAttribute("data-id"),nodeElement:f.target,forceUpdate:!0}));r(h)});return l.current=u,u},[]);return x.exports.useEffect(()=>()=>{var u;(u=l==null?void 0:l.current)==null||u.disconnect()},[]),fe("div",{className:"react-flow__nodes",style:fK,children:a.map(u=>{var L,D,E,I,k,R,A;let d=u.type||"default";i.nodeTypes[d]||(s==null||s("003",tp.error003(d)),d="default");const h=i.nodeTypes[d]||i.nodeTypes.default,f=!!(u.draggable||e&&typeof u.draggable=="undefined"),g=!!(u.selectable||o&&typeof u.selectable=="undefined"),p=!!(u.connectable||t&&typeof u.connectable=="undefined"),v=!!(u.focusable||n&&typeof u.focusable=="undefined"),m=i.nodeExtent?rK(u.positionAbsolute,i.nodeExtent):u.positionAbsolute,_=(L=m==null?void 0:m.x)!=null?L:0,w=(D=m==null?void 0:m.y)!=null?D:0,y=M4e({x:_,y:w,width:(E=u.width)!=null?E:0,height:(I=u.height)!=null?I:0,origin:i.nodeOrigin});return fe(h,{id:u.id,className:u.className,style:u.style,type:d,data:u.data,sourcePosition:u.sourcePosition||pn.Bottom,targetPosition:u.targetPosition||pn.Top,hidden:u.hidden,xPos:_,yPos:w,xPosOrigin:y.x,yPosOrigin:y.y,selectNodesOnDrag:i.selectNodesOnDrag,onClick:i.onNodeClick,onMouseEnter:i.onNodeMouseEnter,onMouseMove:i.onNodeMouseMove,onMouseLeave:i.onNodeMouseLeave,onContextMenu:i.onNodeContextMenu,onDoubleClick:i.onNodeDoubleClick,selected:!!u.selected,isDraggable:f,isSelectable:g,isConnectable:p,isFocusable:v,resizeObserver:c,dragHandle:u.dragHandle,zIndex:(R=(k=u[Cs])==null?void 0:k.z)!=null?R:0,isParent:!!((A=u[Cs])!=null&&A.isParent),noDragClassName:i.noDragClassName,noPanClassName:i.noPanClassName,initialized:!!u.width&&!!u.height,rfId:i.rfId,disableKeyboardA11y:i.disableKeyboardA11y,ariaLabel:u.ariaLabel},u.id)})})};Bfe.displayName="NodeRenderer";var P4e=x.exports.memo(Bfe);const O4e=(i,e,t)=>t===pn.Left?i-e:t===pn.Right?i+e:i,F4e=(i,e,t)=>t===pn.Top?i-e:t===pn.Bottom?i+e:i,nte="react-flow__edgeupdater",ite=({position:i,centerX:e,centerY:t,radius:n=10,onMouseDown:o,onMouseEnter:r,onMouseOut:s,type:a})=>fe("circle",{onMouseDown:o,onMouseEnter:r,onMouseOut:s,className:ha([nte,`${nte}-${a}`]),cx:O4e(e,n,i),cy:F4e(t,n,i),r:n,stroke:"transparent",fill:"transparent"}),B4e=()=>!0;var S1=i=>{const e=({id:t,className:n,type:o,data:r,onClick:s,onEdgeDoubleClick:a,selected:l,animated:c,label:u,labelStyle:d,labelShowBg:h,labelBgStyle:f,labelBgPadding:g,labelBgBorderRadius:p,style:v,source:m,target:_,sourceX:w,sourceY:y,targetX:L,targetY:D,sourcePosition:E,targetPosition:I,elementsSelectable:k,hidden:R,sourceHandleId:A,targetHandleId:P,onContextMenu:N,onMouseEnter:M,onMouseMove:H,onMouseLeave:W,edgeUpdaterRadius:F,onEdgeUpdate:$,onEdgeUpdateStart:z,onEdgeUpdateEnd:K,markerEnd:j,markerStart:G,rfId:X,ariaLabel:de,isFocusable:he,isUpdatable:pe,pathOptions:be,interactionWidth:Se})=>{const Fe=x.exports.useRef(null),[De,ce]=x.exports.useState(!1),[Pe,Oe]=x.exports.useState(!1),xe=ls(),Ee=x.exports.useMemo(()=>`url(#${AB(G,X)})`,[G,X]),tt=x.exports.useMemo(()=>`url(#${AB(j,X)})`,[j,X]);if(R)return null;const nt=We=>{var xt;const{edges:je,addSelectedEdges:mt,unselectNodesAndEdges:Et,multiSelectionActive:At}=xe.getState(),Je=je.find(Ot=>Ot.id===t);!Je||(k&&(xe.setState({nodesSelectionActive:!1}),Je.selected&&At?(Et({nodes:[],edges:[Je]}),(xt=Fe.current)==null||xt.blur()):mt([t])),s&&s(We,Je))},Qe=vx(t,xe.getState,a),Ge=vx(t,xe.getState,N),re=vx(t,xe.getState,M),ie=vx(t,xe.getState,H),se=vx(t,xe.getState,W),U=(We,je)=>{if(We.button!==0)return;const{edges:mt,isValidConnection:Et}=xe.getState(),At=je?_:m,Je=(je?P:A)||null,xt=je?"target":"source",Ot=Et||B4e,Vn=je,Lt=mt.find(cn=>cn.id===t);Oe(!0),z==null||z(We,Lt,xt);const tn=cn=>{Oe(!1),K==null||K(cn,Lt,xt)};vfe({event:We,handleId:Je,nodeId:At,onConnect:cn=>$==null?void 0:$(Lt,cn),isTarget:Vn,getState:xe.getState,setState:xe.setState,isValidConnection:Ot,edgeUpdaterType:xt,onEdgeUpdateEnd:tn})},Y=We=>U(We,!0),oe=We=>U(We,!1),te=()=>ce(!0),we=()=>ce(!1),Le=!k&&!s,Te=We=>{var je;if(ofe.includes(We.key)&&k){const{unselectNodesAndEdges:mt,addSelectedEdges:Et,edges:At}=xe.getState();We.key==="Escape"?((je=Fe.current)==null||je.blur(),mt({edges:[At.find(xt=>xt.id===t)]})):Et([t])}};return vn("g",{className:ha(["react-flow__edge",`react-flow__edge-${o}`,n,{selected:l,animated:c,inactive:Le,updating:De}]),onClick:nt,onDoubleClick:Qe,onContextMenu:Ge,onMouseEnter:re,onMouseMove:ie,onMouseLeave:se,onKeyDown:he?Te:void 0,tabIndex:he?0:void 0,role:he?"button":"img","data-testid":`rf__edge-${t}`,"aria-label":de===null?void 0:de||`Edge from ${m} to ${_}`,"aria-describedby":he?`${Efe}-${X}`:void 0,ref:Fe,children:[!Pe&&fe(i,{id:t,source:m,target:_,selected:l,animated:c,label:u,labelStyle:d,labelShowBg:h,labelBgStyle:f,labelBgPadding:g,labelBgBorderRadius:p,data:r,style:v,sourceX:w,sourceY:y,targetX:L,targetY:D,sourcePosition:E,targetPosition:I,sourceHandleId:A,targetHandleId:P,markerStart:Ee,markerEnd:tt,pathOptions:be,interactionWidth:Se}),pe&&vn(Ds,{children:[(pe==="source"||pe===!0)&&fe(ite,{position:E,centerX:w,centerY:y,radius:F,onMouseDown:Y,onMouseEnter:te,onMouseOut:we,type:"source"}),(pe==="target"||pe===!0)&&fe(ite,{position:I,centerX:L,centerY:D,radius:F,onMouseDown:oe,onMouseEnter:te,onMouseOut:we,type:"target"})]})]})};return e.displayName="EdgeWrapper",x.exports.memo(e)};function W4e(i){const e={default:S1(i.default||cA),straight:S1(i.bezier||lK),step:S1(i.step||aK),smoothstep:S1(i.step||t4),simplebezier:S1(i.simplebezier||sK)},t={},n=Object.keys(i).filter(o=>!["default","bezier"].includes(o)).reduce((o,r)=>(o[r]=S1(i[r]||cA),o),t);return{...e,...n}}function ote(i,e,t=null){const n=((t==null?void 0:t.x)||0)+e.x,o=((t==null?void 0:t.y)||0)+e.y,r=(t==null?void 0:t.width)||e.width,s=(t==null?void 0:t.height)||e.height;switch(i){case pn.Top:return{x:n+r/2,y:o};case pn.Right:return{x:n+r,y:o+s/2};case pn.Bottom:return{x:n+r/2,y:o+s};case pn.Left:return{x:n,y:o+s/2}}}function rte(i,e){return i?i.length===1||!e?i[0]:e&&i.find(t=>t.id===e)||null:null}const V4e=(i,e,t,n,o,r)=>{const s=ote(t,i,e),a=ote(r,n,o);return{sourceX:s.x,sourceY:s.y,targetX:a.x,targetY:a.y}};function H4e({sourcePos:i,targetPos:e,sourceWidth:t,sourceHeight:n,targetWidth:o,targetHeight:r,width:s,height:a,transform:l}){const c={x:Math.min(i.x,e.x),y:Math.min(i.y,e.y),x2:Math.max(i.x+t,e.x+o),y2:Math.max(i.y+n,e.y+r)};c.x===c.x2&&(c.x2+=1),c.y===c.y2&&(c.y2+=1);const u=rD({x:(0-l[0])/l[2],y:(0-l[1])/l[2],width:s/l[2],height:a/l[2]}),d=Math.max(0,Math.min(u.x2,c.x2)-Math.max(u.x,c.x)),h=Math.max(0,Math.min(u.y2,c.y2)-Math.max(u.y,c.y));return Math.ceil(d*h)>0}function ste(i){var n,o,r,s,a;const e=((n=i==null?void 0:i[Cs])==null?void 0:n.handleBounds)||null,t=e&&(i==null?void 0:i.width)&&(i==null?void 0:i.height)&&typeof((o=i==null?void 0:i.positionAbsolute)==null?void 0:o.x)!="undefined"&&typeof((r=i==null?void 0:i.positionAbsolute)==null?void 0:r.y)!="undefined";return[{x:((s=i==null?void 0:i.positionAbsolute)==null?void 0:s.x)||0,y:((a=i==null?void 0:i.positionAbsolute)==null?void 0:a.y)||0,width:(i==null?void 0:i.width)||0,height:(i==null?void 0:i.height)||0},e,!!t]}const $4e=[{level:0,isMaxLevel:!0,edges:[]}];function z4e(i,e,t=!1){let n=-1;const o=i.reduce((s,a)=>{var u,d;const l=Cu(a.zIndex);let c=l?a.zIndex:0;if(t){const h=e.get(a.target),f=e.get(a.source),g=a.selected||(h==null?void 0:h.selected)||(f==null?void 0:f.selected),p=Math.max(((u=f==null?void 0:f[Cs])==null?void 0:u.z)||0,((d=h==null?void 0:h[Cs])==null?void 0:d.z)||0,1e3);c=(l?a.zIndex:0)+(g?p:0)}return s[c]?s[c].push(a):s[c]=[a],n=c>n?c:n,s},{}),r=Object.entries(o).map(([s,a])=>{const l=+s;return{edges:a,level:l,isMaxLevel:l===n}});return r.length===0?$4e:r}function U4e(i,e,t){const n=mo(x.exports.useCallback(o=>i?o.edges.filter(r=>{const s=e.get(r.source),a=e.get(r.target);return(s==null?void 0:s.width)&&(s==null?void 0:s.height)&&(a==null?void 0:a.width)&&(a==null?void 0:a.height)&&H4e({sourcePos:s.positionAbsolute||{x:0,y:0},targetPos:a.positionAbsolute||{x:0,y:0},sourceWidth:s.width,sourceHeight:s.height,targetWidth:a.width,targetHeight:a.height,width:o.width,height:o.height,transform:o.transform})}):o.edges,[i,e]));return z4e(n,e,t)}const j4e=({color:i="none",strokeWidth:e=1})=>fe("polyline",{style:{stroke:i,strokeWidth:e},strokeLinecap:"round",strokeLinejoin:"round",fill:"none",points:"-5,-4 0,0 -5,4"}),K4e=({color:i="none",strokeWidth:e=1})=>fe("polyline",{style:{stroke:i,fill:i,strokeWidth:e},strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"}),ate={[lA.Arrow]:j4e,[lA.ArrowClosed]:K4e};function q4e(i){const e=ls();return x.exports.useMemo(()=>{var o,r;return Object.prototype.hasOwnProperty.call(ate,i)?ate[i]:((r=(o=e.getState()).onError)==null||r.call(o,"009",tp.error009(i)),null)},[i])}const G4e=({id:i,type:e,color:t,width:n=12.5,height:o=12.5,markerUnits:r="strokeWidth",strokeWidth:s,orient:a="auto-start-reverse"})=>{const l=q4e(e);return l?fe("marker",{className:"react-flow__arrowhead",id:i,markerWidth:`${n}`,markerHeight:`${o}`,viewBox:"-10 -10 20 20",markerUnits:r,orient:a,refX:"0",refY:"0",children:fe(l,{color:t,strokeWidth:s})}):null},X4e=({defaultColor:i,rfId:e})=>t=>{const n=[];return t.edges.reduce((o,r)=>([r.markerStart,r.markerEnd].forEach(s=>{if(s&&typeof s=="object"){const a=AB(s,e);n.includes(a)||(o.push({id:a,color:s.color||i,...s}),n.push(a))}}),o),[]).sort((o,r)=>o.id.localeCompare(r.id))},Wfe=({defaultColor:i,rfId:e})=>{const t=mo(x.exports.useCallback(X4e({defaultColor:i,rfId:e}),[i,e]),(n,o)=>!(n.length!==o.length||n.some((r,s)=>r.id!==o[s].id)));return fe("defs",{children:t.map(n=>fe(G4e,{id:n.id,type:n.type,color:n.color,width:n.width,height:n.height,markerUnits:n.markerUnits,strokeWidth:n.strokeWidth,orient:n.orient},n.id))})};Wfe.displayName="MarkerDefinitions";var Y4e=x.exports.memo(Wfe);const Z4e=i=>({nodesConnectable:i.nodesConnectable,edgesFocusable:i.edgesFocusable,edgesUpdatable:i.edgesUpdatable,elementsSelectable:i.elementsSelectable,width:i.width,height:i.height,connectionMode:i.connectionMode,nodeInternals:i.nodeInternals,onError:i.onError}),Vfe=({defaultMarkerColor:i,onlyRenderVisibleElements:e,elevateEdgesOnSelect:t,rfId:n,edgeTypes:o,noPanClassName:r,onEdgeUpdate:s,onEdgeContextMenu:a,onEdgeMouseEnter:l,onEdgeMouseMove:c,onEdgeMouseLeave:u,onEdgeClick:d,edgeUpdaterRadius:h,onEdgeDoubleClick:f,onEdgeUpdateStart:g,onEdgeUpdateEnd:p,children:v})=>{const{edgesFocusable:m,edgesUpdatable:_,elementsSelectable:w,width:y,height:L,connectionMode:D,nodeInternals:E,onError:I}=mo(Z4e,Hs),k=U4e(e,E,t);return y?vn(Ds,{children:[k.map(({level:R,edges:A,isMaxLevel:P})=>vn("svg",{style:{zIndex:R},width:y,height:L,className:"react-flow__edges react-flow__container",children:[P&&fe(Y4e,{defaultColor:i,rfId:n}),fe("g",{children:A.map(N=>{var Oe,xe;const[M,H,W]=ste(E.get(N.source)),[F,$,z]=ste(E.get(N.target));if(!W||!z)return null;let K=N.type||"default";o[K]||(I==null||I("011",tp.error011(K)),K="default");const j=o[K]||o.default,G=D===H0.Strict?$.target:((Oe=$.target)!=null?Oe:[]).concat((xe=$.source)!=null?xe:[]),X=rte(H.source,N.sourceHandle),de=rte(G,N.targetHandle),he=(X==null?void 0:X.position)||pn.Bottom,pe=(de==null?void 0:de.position)||pn.Top,be=!!(N.focusable||m&&typeof N.focusable=="undefined"),Se=typeof s!="undefined"&&(N.updatable||_&&typeof N.updatable=="undefined");if(!X||!de)return I==null||I("008",tp.error008(X,N)),null;const{sourceX:Fe,sourceY:De,targetX:ce,targetY:Pe}=V4e(M,X,he,F,de,pe);return fe(j,{id:N.id,className:ha([N.className,r]),type:K,data:N.data,selected:!!N.selected,animated:!!N.animated,hidden:!!N.hidden,label:N.label,labelStyle:N.labelStyle,labelShowBg:N.labelShowBg,labelBgStyle:N.labelBgStyle,labelBgPadding:N.labelBgPadding,labelBgBorderRadius:N.labelBgBorderRadius,style:N.style,source:N.source,target:N.target,sourceHandleId:N.sourceHandle,targetHandleId:N.targetHandle,markerEnd:N.markerEnd,markerStart:N.markerStart,sourceX:Fe,sourceY:De,targetX:ce,targetY:Pe,sourcePosition:he,targetPosition:pe,elementsSelectable:w,onEdgeUpdate:s,onContextMenu:a,onMouseEnter:l,onMouseMove:c,onMouseLeave:u,onClick:d,edgeUpdaterRadius:h,onEdgeDoubleClick:f,onEdgeUpdateStart:g,onEdgeUpdateEnd:p,rfId:n,ariaLabel:N.ariaLabel,isFocusable:be,isUpdatable:Se,pathOptions:"pathOptions"in N?N.pathOptions:void 0,interactionWidth:N.interactionWidth},N.id)})})]},R)),v]}):null};Vfe.displayName="EdgeRenderer";var Q4e=x.exports.memo(Vfe);const J4e=i=>`translate(${i.transform[0]}px,${i.transform[1]}px) scale(${i.transform[2]})`;function e5e({children:i}){const e=mo(J4e);return fe("div",{className:"react-flow__viewport react-flow__container",style:{transform:e},children:i})}function t5e(i){const e=hK(),t=x.exports.useRef(!1);x.exports.useEffect(()=>{!t.current&&e.viewportInitialized&&i&&(setTimeout(()=>i(e),1),t.current=!0)},[i,e.viewportInitialized])}const n5e={[pn.Left]:pn.Right,[pn.Right]:pn.Left,[pn.Top]:pn.Bottom,[pn.Bottom]:pn.Top},Hfe=({nodeId:i,handleType:e,style:t,type:n=rm.Bezier,CustomComponent:o,connectionStatus:r})=>{var D,E,I,k,R,A,P;const{fromNode:s,handleId:a,toX:l,toY:c,connectionMode:u}=mo(x.exports.useCallback(N=>({fromNode:N.nodeInternals.get(i),handleId:N.connectionHandleId,toX:(N.connectionPosition.x-N.transform[0])/N.transform[2],toY:(N.connectionPosition.y-N.transform[1])/N.transform[2],connectionMode:N.connectionMode}),[i]),Hs),d=(D=s==null?void 0:s[Cs])==null?void 0:D.handleBounds;let h=d==null?void 0:d[e];if(u===H0.Loose&&(h=h||(d==null?void 0:d[e==="source"?"target":"source"])),!s||!h)return null;const f=a?h.find(N=>N.id===a):h[0],g=f?f.x+f.width/2:((E=s.width)!=null?E:0)/2,p=f?f.y+f.height/2:(I=s.height)!=null?I:0,v=((R=(k=s.positionAbsolute)==null?void 0:k.x)!=null?R:0)+g,m=((P=(A=s.positionAbsolute)==null?void 0:A.y)!=null?P:0)+p,_=f==null?void 0:f.position,w=_?n5e[_]:null;if(!_||!w)return null;if(o)return fe(o,{connectionLineType:n,connectionLineStyle:t,fromNode:s,fromHandle:f,fromX:v,fromY:m,toX:l,toY:c,fromPosition:_,toPosition:w,connectionStatus:r});let y="";const L={sourceX:v,sourceY:m,sourcePosition:_,targetX:l,targetY:c,targetPosition:w};return n===rm.Bezier?[y]=cfe(L):n===rm.Step?[y]=RB({...L,borderRadius:0}):n===rm.SmoothStep?[y]=RB(L):n===rm.SimpleBezier?[y]=lfe(L):y=`M${v},${m} ${l},${c}`,fe("path",{d:y,fill:"none",className:"react-flow__connection-path",style:t})};Hfe.displayName="ConnectionLine";const i5e=i=>({nodeId:i.connectionNodeId,handleType:i.connectionHandleType,nodesConnectable:i.nodesConnectable,connectionStatus:i.connectionStatus,width:i.width,height:i.height});function o5e({containerStyle:i,style:e,type:t,component:n}){const{nodeId:o,handleType:r,nodesConnectable:s,width:a,height:l,connectionStatus:c}=mo(i5e,Hs);return!(o&&r&&a&&s)?null:fe("svg",{style:i,width:a,height:l,className:"react-flow__edges react-flow__connectionline react-flow__container",children:fe("g",{className:ha(["react-flow__connection",c]),children:fe(Hfe,{nodeId:o,handleType:r,style:e,type:t,CustomComponent:n,connectionStatus:c})})})}function lte(i,e){return x.exports.useRef(null),ls(),x.exports.useMemo(()=>e(i),[i])}const $fe=({nodeTypes:i,edgeTypes:e,onMove:t,onMoveStart:n,onMoveEnd:o,onInit:r,onNodeClick:s,onEdgeClick:a,onNodeDoubleClick:l,onEdgeDoubleClick:c,onNodeMouseEnter:u,onNodeMouseMove:d,onNodeMouseLeave:h,onNodeContextMenu:f,onSelectionContextMenu:g,onSelectionStart:p,onSelectionEnd:v,connectionLineType:m,connectionLineStyle:_,connectionLineComponent:w,connectionLineContainerStyle:y,selectionKeyCode:L,selectionOnDrag:D,selectionMode:E,multiSelectionKeyCode:I,panActivationKeyCode:k,zoomActivationKeyCode:R,deleteKeyCode:A,onlyRenderVisibleElements:P,elementsSelectable:N,selectNodesOnDrag:M,defaultViewport:H,translateExtent:W,minZoom:F,maxZoom:$,preventScrolling:z,defaultMarkerColor:K,zoomOnScroll:j,zoomOnPinch:G,panOnScroll:X,panOnScrollSpeed:de,panOnScrollMode:he,zoomOnDoubleClick:pe,panOnDrag:be,onPaneClick:Se,onPaneMouseEnter:Fe,onPaneMouseMove:De,onPaneMouseLeave:ce,onPaneScroll:Pe,onPaneContextMenu:Oe,onEdgeUpdate:xe,onEdgeContextMenu:Ee,onEdgeMouseEnter:tt,onEdgeMouseMove:nt,onEdgeMouseLeave:Qe,edgeUpdaterRadius:Ge,onEdgeUpdateStart:re,onEdgeUpdateEnd:ie,noDragClassName:se,noWheelClassName:U,noPanClassName:Y,elevateEdgesOnSelect:oe,disableKeyboardA11y:te,nodeOrigin:we,nodeExtent:Le,rfId:Te})=>{const We=lte(i,R4e),je=lte(e,W4e);return t5e(r),fe(T4e,{onPaneClick:Se,onPaneMouseEnter:Fe,onPaneMouseMove:De,onPaneMouseLeave:ce,onPaneContextMenu:Oe,onPaneScroll:Pe,deleteKeyCode:A,selectionKeyCode:L,selectionOnDrag:D,selectionMode:E,onSelectionStart:p,onSelectionEnd:v,multiSelectionKeyCode:I,panActivationKeyCode:k,zoomActivationKeyCode:R,elementsSelectable:N,onMove:t,onMoveStart:n,onMoveEnd:o,zoomOnScroll:j,zoomOnPinch:G,zoomOnDoubleClick:pe,panOnScroll:X,panOnScrollSpeed:de,panOnScrollMode:he,panOnDrag:be,defaultViewport:H,translateExtent:W,minZoom:F,maxZoom:$,onSelectionContextMenu:g,preventScrolling:z,noDragClassName:se,noWheelClassName:U,noPanClassName:Y,disableKeyboardA11y:te,children:vn(e5e,{children:[fe(Q4e,{edgeTypes:je,onEdgeClick:a,onEdgeDoubleClick:c,onEdgeUpdate:xe,onlyRenderVisibleElements:P,onEdgeContextMenu:Ee,onEdgeMouseEnter:tt,onEdgeMouseMove:nt,onEdgeMouseLeave:Qe,onEdgeUpdateStart:re,onEdgeUpdateEnd:ie,edgeUpdaterRadius:Ge,defaultMarkerColor:K,noPanClassName:Y,elevateEdgesOnSelect:!!oe,disableKeyboardA11y:te,rfId:Te,children:fe(o5e,{style:_,type:m,component:w,containerStyle:y})}),fe("div",{className:"react-flow__edgelabel-renderer"}),fe(P4e,{nodeTypes:We,onNodeClick:s,onNodeDoubleClick:l,onNodeMouseEnter:u,onNodeMouseMove:d,onNodeMouseLeave:h,onNodeContextMenu:f,selectNodesOnDrag:M,onlyRenderVisibleElements:P,noPanClassName:Y,noDragClassName:se,disableKeyboardA11y:te,nodeOrigin:we,nodeExtent:Le,rfId:Te})]})})};$fe.displayName="GraphView";var r5e=x.exports.memo($fe);const BB=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Rp={rfId:"1",width:0,height:0,transform:[0,0,1],nodeInternals:new Map,edges:[],onNodesChange:null,onEdgesChange:null,hasDefaultNodes:!1,hasDefaultEdges:!1,d3Zoom:null,d3Selection:null,d3ZoomHandler:void 0,minZoom:.5,maxZoom:2,translateExtent:BB,nodeExtent:BB,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionNodeId:null,connectionHandleId:null,connectionHandleType:"source",connectionPosition:{x:0,y:0},connectionStatus:null,connectionMode:H0.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:[0,0],nodeDragThreshold:0,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesUpdatable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,fitViewOnInit:!1,fitViewOnInitDone:!1,fitViewOnInitOptions:void 0,onSelectionChange:[],multiSelectionActive:!1,connectionStartHandle:null,connectionEndHandle:null,connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,connectionRadius:20,onError:POe,isValidConnection:void 0},s5e=()=>KRe((i,e)=>({...Rp,setNodes:t=>{const{nodeInternals:n,nodeOrigin:o,elevateNodesOnSelect:r}=e();i({nodeInternals:W8(t,n,o,r)})},getNodes:()=>Array.from(e().nodeInternals.values()),setEdges:t=>{const{defaultEdgeOptions:n={}}=e();i({edges:t.map(o=>({...n,...o}))})},setDefaultNodesAndEdges:(t,n)=>{const o=typeof t!="undefined",r=typeof n!="undefined",s=o?W8(t,new Map,e().nodeOrigin,e().elevateNodesOnSelect):new Map;i({nodeInternals:s,edges:r?n:[],hasDefaultNodes:o,hasDefaultEdges:r})},updateNodeDimensions:t=>{const{onNodesChange:n,nodeInternals:o,fitViewOnInit:r,fitViewOnInitDone:s,fitViewOnInitOptions:a,domNode:l,nodeOrigin:c}=e(),u=l==null?void 0:l.querySelector(".react-flow__viewport");if(!u)return;const d=window.getComputedStyle(u),{m22:h}=new window.DOMMatrixReadOnly(d.transform),f=t.reduce((p,v)=>{const m=o.get(v.id);if(m){const _=oK(v.nodeElement);!!(_.width&&_.height&&(m.width!==_.width||m.height!==_.height||v.forceUpdate))&&(o.set(m.id,{...m,[Cs]:{...m[Cs],handleBounds:{source:tte(".source",v.nodeElement,h,c),target:tte(".target",v.nodeElement,h,c)}},..._}),p.push({id:m.id,type:"dimensions",dimensions:_}))}return p},[]);kfe(o,c);const g=s||r&&!s&&Ife(e,{initial:!0,...a});i({nodeInternals:new Map(o),fitViewOnInitDone:g}),(f==null?void 0:f.length)>0&&(n==null||n(f))},updateNodePositions:(t,n=!0,o=!1)=>{const{triggerNodeChanges:r}=e(),s=t.map(a=>{const l={id:a.id,type:"position",dragging:o};return n&&(l.positionAbsolute=a.positionAbsolute,l.position=a.position),l});r(s)},triggerNodeChanges:t=>{const{onNodesChange:n,nodeInternals:o,hasDefaultNodes:r,nodeOrigin:s,getNodes:a,elevateNodesOnSelect:l}=e();if(t!=null&&t.length){if(r){const c=Nfe(t,a()),u=W8(c,o,s,l);i({nodeInternals:u})}n==null||n(t)}},addSelectedNodes:t=>{const{multiSelectionActive:n,edges:o,getNodes:r}=e();let s,a=null;n?s=t.map(l=>Jp(l,!0)):(s=yC(r(),t),a=yC(o,[])),RN({changedNodes:s,changedEdges:a,get:e,set:i})},addSelectedEdges:t=>{const{multiSelectionActive:n,edges:o,getNodes:r}=e();let s,a=null;n?s=t.map(l=>Jp(l,!0)):(s=yC(o,t),a=yC(r(),[])),RN({changedNodes:a,changedEdges:s,get:e,set:i})},unselectNodesAndEdges:({nodes:t,edges:n}={})=>{const{edges:o,getNodes:r}=e(),s=t||r(),a=n||o,l=s.map(u=>(u.selected=!1,Jp(u.id,!1))),c=a.map(u=>Jp(u.id,!1));RN({changedNodes:l,changedEdges:c,get:e,set:i})},setMinZoom:t=>{const{d3Zoom:n,maxZoom:o}=e();n==null||n.scaleExtent([t,o]),i({minZoom:t})},setMaxZoom:t=>{const{d3Zoom:n,minZoom:o}=e();n==null||n.scaleExtent([o,t]),i({maxZoom:t})},setTranslateExtent:t=>{var n;(n=e().d3Zoom)==null||n.translateExtent(t),i({translateExtent:t})},resetSelectedElements:()=>{const{edges:t,getNodes:n}=e(),r=n().filter(a=>a.selected).map(a=>Jp(a.id,!1)),s=t.filter(a=>a.selected).map(a=>Jp(a.id,!1));RN({changedNodes:r,changedEdges:s,get:e,set:i})},setNodeExtent:t=>{const{nodeInternals:n}=e();n.forEach(o=>{o.positionAbsolute=rK(o.position,t)}),i({nodeExtent:t,nodeInternals:new Map(n)})},panBy:t=>{const{transform:n,width:o,height:r,d3Zoom:s,d3Selection:a,translateExtent:l}=e();if(!s||!a||!t.x&&!t.y)return!1;const c=$g.translate(n[0]+t.x,n[1]+t.y).scale(n[2]),u=[[0,0],[o,r]],d=s==null?void 0:s.constrain()(c,u,l);return s.transform(a,d),n[0]!==d.x||n[1]!==d.y||n[2]!==d.k},cancelConnection:()=>i({connectionNodeId:Rp.connectionNodeId,connectionHandleId:Rp.connectionHandleId,connectionHandleType:Rp.connectionHandleType,connectionStatus:Rp.connectionStatus,connectionStartHandle:Rp.connectionStartHandle,connectionEndHandle:Rp.connectionEndHandle}),reset:()=>i({...Rp})}),Object.is),gK=({children:i})=>{const e=x.exports.useRef(null);return e.current||(e.current=s5e()),fe(kOe,{value:e.current,children:i})};gK.displayName="ReactFlowProvider";const zfe=({children:i})=>x.exports.useContext(e4)?fe(Ds,{children:i}):fe(gK,{children:i});zfe.displayName="ReactFlowWrapper";const a5e={input:wfe,default:OB,output:Sfe,group:dK},l5e={default:cA,straight:lK,step:aK,smoothstep:t4,simplebezier:sK},c5e=[0,0],u5e=[15,15],d5e={x:0,y:0,zoom:1},h5e={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0},Ufe=x.exports.forwardRef(({nodes:i,edges:e,defaultNodes:t,defaultEdges:n,className:o,nodeTypes:r=a5e,edgeTypes:s=l5e,onNodeClick:a,onEdgeClick:l,onInit:c,onMove:u,onMoveStart:d,onMoveEnd:h,onConnect:f,onConnectStart:g,onConnectEnd:p,onClickConnectStart:v,onClickConnectEnd:m,onNodeMouseEnter:_,onNodeMouseMove:w,onNodeMouseLeave:y,onNodeContextMenu:L,onNodeDoubleClick:D,onNodeDragStart:E,onNodeDrag:I,onNodeDragStop:k,onNodesDelete:R,onEdgesDelete:A,onSelectionChange:P,onSelectionDragStart:N,onSelectionDrag:M,onSelectionDragStop:H,onSelectionContextMenu:W,onSelectionStart:F,onSelectionEnd:$,connectionMode:z=H0.Strict,connectionLineType:K=rm.Bezier,connectionLineStyle:j,connectionLineComponent:G,connectionLineContainerStyle:X,deleteKeyCode:de="Backspace",selectionKeyCode:he="Shift",selectionOnDrag:pe=!1,selectionMode:be=sD.Full,panActivationKeyCode:Se="Space",multiSelectionKeyCode:Fe=aA()?"Meta":"Control",zoomActivationKeyCode:De=aA()?"Meta":"Control",snapToGrid:ce=!1,snapGrid:Pe=u5e,onlyRenderVisibleElements:Oe=!1,selectNodesOnDrag:xe=!0,nodesDraggable:Ee,nodesConnectable:tt,nodesFocusable:nt,nodeOrigin:Qe=c5e,edgesFocusable:Ge,edgesUpdatable:re,elementsSelectable:ie,defaultViewport:se=d5e,minZoom:U=.5,maxZoom:Y=2,translateExtent:oe=BB,preventScrolling:te=!0,nodeExtent:we,defaultMarkerColor:Le="#b1b1b7",zoomOnScroll:Te=!0,zoomOnPinch:We=!0,panOnScroll:je=!1,panOnScrollSpeed:mt=.5,panOnScrollMode:Et=e0.Free,zoomOnDoubleClick:At=!0,panOnDrag:Je=!0,onPaneClick:xt,onPaneMouseEnter:Ot,onPaneMouseMove:Vn,onPaneMouseLeave:Lt,onPaneScroll:tn,onPaneContextMenu:ui,children:cn,onEdgeUpdate:qn,onEdgeContextMenu:bn,onEdgeDoubleClick:Pt,onEdgeMouseEnter:qt,onEdgeMouseMove:Nt,onEdgeMouseLeave:jt,onEdgeUpdateStart:Gt,onEdgeUpdateEnd:kt,edgeUpdaterRadius:Ft=10,onNodesChange:bt,onEdgesChange:Zt,noDragClassName:yn="nodrag",noWheelClassName:Dn="nowheel",noPanClassName:Gn="nopan",fitView:Un=!1,fitViewOptions:Zi,connectOnClick:an=!0,attributionPosition:Xt,proOptions:oi,defaultEdgeOptions:Ze,elevateNodesOnSelect:ue=!0,elevateEdgesOnSelect:Ve=!1,disableKeyboardA11y:ot=!1,autoPanOnConnect:Sn=!0,autoPanOnNodeDrag:$n=!0,connectionRadius:Ci=20,isValidConnection:An,onError:lo,style:Qo,id:zo,nodeDragThreshold:ic,...Xc},Gr)=>{const za=zo||"1";return fe("div",{...Xc,style:{...Qo,...h5e},ref:Gr,className:ha(["react-flow",o]),"data-testid":"rf__wrapper",id:zo,children:vn(zfe,{children:[fe(r5e,{onInit:c,onMove:u,onMoveStart:d,onMoveEnd:h,onNodeClick:a,onEdgeClick:l,onNodeMouseEnter:_,onNodeMouseMove:w,onNodeMouseLeave:y,onNodeContextMenu:L,onNodeDoubleClick:D,nodeTypes:r,edgeTypes:s,connectionLineType:K,connectionLineStyle:j,connectionLineComponent:G,connectionLineContainerStyle:X,selectionKeyCode:he,selectionOnDrag:pe,selectionMode:be,deleteKeyCode:de,multiSelectionKeyCode:Fe,panActivationKeyCode:Se,zoomActivationKeyCode:De,onlyRenderVisibleElements:Oe,selectNodesOnDrag:xe,defaultViewport:se,translateExtent:oe,minZoom:U,maxZoom:Y,preventScrolling:te,zoomOnScroll:Te,zoomOnPinch:We,zoomOnDoubleClick:At,panOnScroll:je,panOnScrollSpeed:mt,panOnScrollMode:Et,panOnDrag:Je,onPaneClick:xt,onPaneMouseEnter:Ot,onPaneMouseMove:Vn,onPaneMouseLeave:Lt,onPaneScroll:tn,onPaneContextMenu:ui,onSelectionContextMenu:W,onSelectionStart:F,onSelectionEnd:$,onEdgeUpdate:qn,onEdgeContextMenu:bn,onEdgeDoubleClick:Pt,onEdgeMouseEnter:qt,onEdgeMouseMove:Nt,onEdgeMouseLeave:jt,onEdgeUpdateStart:Gt,onEdgeUpdateEnd:kt,edgeUpdaterRadius:Ft,defaultMarkerColor:Le,noDragClassName:yn,noWheelClassName:Dn,noPanClassName:Gn,elevateEdgesOnSelect:Ve,rfId:za,disableKeyboardA11y:ot,nodeOrigin:Qe,nodeExtent:we}),fe(n4e,{nodes:i,edges:e,defaultNodes:t,defaultEdges:n,onConnect:f,onConnectStart:g,onConnectEnd:p,onClickConnectStart:v,onClickConnectEnd:m,nodesDraggable:Ee,nodesConnectable:tt,nodesFocusable:nt,edgesFocusable:Ge,edgesUpdatable:re,elementsSelectable:ie,elevateNodesOnSelect:ue,minZoom:U,maxZoom:Y,nodeExtent:we,onNodesChange:bt,onEdgesChange:Zt,snapToGrid:ce,snapGrid:Pe,connectionMode:z,translateExtent:oe,connectOnClick:an,defaultEdgeOptions:Ze,fitView:Un,fitViewOptions:Zi,onNodesDelete:R,onEdgesDelete:A,onNodeDragStart:E,onNodeDrag:I,onNodeDragStop:k,onSelectionDrag:M,onSelectionDragStart:N,onSelectionDragStop:H,noPanClassName:Gn,nodeOrigin:Qe,rfId:za,autoPanOnConnect:Sn,autoPanOnNodeDrag:$n,onError:lo,connectionRadius:Ci,isValidConnection:An,nodeDragThreshold:ic}),fe(e4e,{onSelectionChange:P}),cn,fe(TOe,{proOptions:oi,position:Xt}),fe(a4e,{rfId:za,disableKeyboardA11y:ot})]})})});Ufe.displayName="ReactFlow";function f5e(){const i=ls();return x.exports.useCallback(e=>{const{domNode:t,updateNodeDimensions:n}=i.getState(),r=(Array.isArray(e)?e:[e]).reduce((s,a)=>{const l=t==null?void 0:t.querySelector(`.react-flow__node[data-id="${a}"]`);return l&&s.push({id:a,nodeElement:l,forceUpdate:!0}),s},[]);requestAnimationFrame(()=>n(r))},[])}const jfe=({id:i,x:e,y:t,width:n,height:o,style:r,color:s,strokeColor:a,strokeWidth:l,className:c,borderRadius:u,shapeRendering:d,onClick:h,selected:f})=>{const{background:g,backgroundColor:p}=r||{},v=s||g||p;return fe("rect",{className:ha(["react-flow__minimap-node",{selected:f},c]),x:e,y:t,rx:u,ry:u,width:n,height:o,fill:v,stroke:a,strokeWidth:l,shapeRendering:d,onClick:h?m=>h(m,i):void 0})};jfe.displayName="MiniMapNode";var g5e=x.exports.memo(jfe);const p5e=i=>i.nodeOrigin,m5e=i=>i.getNodes().filter(e=>!e.hidden&&e.width&&e.height),z8=i=>i instanceof Function?i:()=>i;function v5e({nodeStrokeColor:i="transparent",nodeColor:e="#e2e2e2",nodeClassName:t="",nodeBorderRadius:n=5,nodeStrokeWidth:o=2,nodeComponent:r=g5e,onClick:s}){const a=mo(m5e,Hs),l=mo(p5e),c=z8(e),u=z8(i),d=z8(t),h=typeof window=="undefined"||!!window.chrome?"crispEdges":"geometricPrecision";return fe(Ds,{children:a.map(f=>{const{x:g,y:p}=w0(f,l).positionAbsolute;return fe(r,{x:g,y:p,width:f.width,height:f.height,style:f.style,selected:f.selected,className:d(f),color:c(f),borderRadius:n,strokeColor:u(f),strokeWidth:o,shapeRendering:h,onClick:s,id:f.id},f.id)})})}var _5e=x.exports.memo(v5e);const b5e=200,C5e=150,w5e=i=>{const e=i.getNodes(),t={x:-i.transform[0]/i.transform[2],y:-i.transform[1]/i.transform[2],width:i.width/i.transform[2],height:i.height/i.transform[2]};return{viewBB:t,boundingRect:e.length>0?MOe(n4(e,i.nodeOrigin),t):t,rfId:i.rfId}},y5e="react-flow__minimap-desc";function Kfe({style:i,className:e,nodeStrokeColor:t="transparent",nodeColor:n="#e2e2e2",nodeClassName:o="",nodeBorderRadius:r=5,nodeStrokeWidth:s=2,nodeComponent:a,maskColor:l="rgb(240, 240, 240, 0.6)",maskStrokeColor:c="none",maskStrokeWidth:u=1,position:d="bottom-right",onClick:h,onNodeClick:f,pannable:g=!1,zoomable:p=!1,ariaLabel:v="React Flow mini map",inversePan:m=!1,zoomStep:_=10,offsetScale:w=5}){var he,pe;const y=ls(),L=x.exports.useRef(null),{boundingRect:D,viewBB:E,rfId:I}=mo(w5e,Hs),k=(he=i==null?void 0:i.width)!=null?he:b5e,R=(pe=i==null?void 0:i.height)!=null?pe:C5e,A=D.width/k,P=D.height/R,N=Math.max(A,P),M=N*k,H=N*R,W=w*N,F=D.x-(M-D.width)/2-W,$=D.y-(H-D.height)/2-W,z=M+W*2,K=H+W*2,j=`${y5e}-${I}`,G=x.exports.useRef(0);G.current=N,x.exports.useEffect(()=>{if(L.current){const be=bu(L.current),Se=ce=>{const{transform:Pe,d3Selection:Oe,d3Zoom:xe}=y.getState();if(ce.sourceEvent.type!=="wheel"||!Oe||!xe)return;const Ee=-ce.sourceEvent.deltaY*(ce.sourceEvent.deltaMode===1?.05:ce.sourceEvent.deltaMode?1:.002)*_,tt=Pe[2]*Math.pow(2,Ee);xe.scaleTo(Oe,tt)},Fe=ce=>{const{transform:Pe,d3Selection:Oe,d3Zoom:xe,translateExtent:Ee,width:tt,height:nt}=y.getState();if(ce.sourceEvent.type!=="mousemove"||!Oe||!xe)return;const Qe=G.current*Math.max(1,Pe[2])*(m?-1:1),Ge={x:Pe[0]-ce.sourceEvent.movementX*Qe,y:Pe[1]-ce.sourceEvent.movementY*Qe},re=[[0,0],[tt,nt]],ie=$g.translate(Ge.x,Ge.y).scale(Pe[2]),se=xe.constrain()(ie,re,Ee);xe.transform(Oe,se)},De=Yhe().on("zoom",g?Fe:null).on("zoom.wheel",p?Se:null);return be.call(De),()=>{be.on("zoom",null)}}},[g,p,m,_]);const X=h?be=>{const Se=fd(be);h(be,{x:Se[0],y:Se[1]})}:void 0,de=f?(be,Se)=>{const Fe=y.getState().nodeInternals.get(Se);f(be,Fe)}:void 0;return fe(oD,{position:d,style:i,className:ha(["react-flow__minimap",e]),"data-testid":"rf__minimap",children:vn("svg",{width:k,height:R,viewBox:`${F} ${$} ${z} ${K}`,role:"img","aria-labelledby":j,ref:L,onClick:X,children:[v&&fe("title",{id:j,children:v}),fe(_5e,{onClick:de,nodeColor:n,nodeStrokeColor:t,nodeBorderRadius:r,nodeClassName:o,nodeStrokeWidth:s,nodeComponent:a}),fe("path",{className:"react-flow__minimap-mask",d:`M${F-W},${$-W}h${z+W*2}v${K+W*2}h${-z-W*2}z - M${E.x},${E.y}h${E.width}v${E.height}h${-E.width}z`,fill:l,fillRule:"evenodd",stroke:c,strokeWidth:u,pointerEvents:"none"})]})})}Kfe.displayName="MiniMap";var S5e=x.exports.memo(Kfe);function x5e(){return fe("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:fe("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function L5e(){return fe("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:fe("path",{d:"M0 0h32v4.2H0z"})})}function E5e(){return fe("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:fe("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function D5e(){return fe("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:fe("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function k5e(){return fe("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:fe("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}const fL=({children:i,className:e,...t})=>fe("button",{type:"button",className:ha(["react-flow__controls-button",e]),...t,children:i});fL.displayName="ControlButton";const I5e=i=>({isInteractive:i.nodesDraggable||i.nodesConnectable||i.elementsSelectable,minZoomReached:i.transform[2]<=i.minZoom,maxZoomReached:i.transform[2]>=i.maxZoom}),qfe=({style:i,showZoom:e=!0,showFitView:t=!0,showInteractive:n=!0,fitViewOptions:o,onZoomIn:r,onZoomOut:s,onFitView:a,onInteractiveChange:l,className:c,children:u,position:d="bottom-left"})=>{const h=ls(),[f,g]=x.exports.useState(!1),{isInteractive:p,minZoomReached:v,maxZoomReached:m}=mo(I5e,Hs),{zoomIn:_,zoomOut:w,fitView:y}=hK();if(x.exports.useEffect(()=>{g(!0)},[]),!f)return null;const L=()=>{_(),r==null||r()},D=()=>{w(),s==null||s()},E=()=>{y(o),a==null||a()},I=()=>{h.setState({nodesDraggable:!p,nodesConnectable:!p,elementsSelectable:!p}),l==null||l(!p)};return vn(oD,{className:ha(["react-flow__controls",c]),position:d,style:i,"data-testid":"rf__controls",children:[e&&vn(Ds,{children:[fe(fL,{onClick:L,className:"react-flow__controls-zoomin",title:"zoom in","aria-label":"zoom in",disabled:m,children:fe(x5e,{})}),fe(fL,{onClick:D,className:"react-flow__controls-zoomout",title:"zoom out","aria-label":"zoom out",disabled:v,children:fe(L5e,{})})]}),t&&fe(fL,{className:"react-flow__controls-fitview",onClick:E,title:"fit view","aria-label":"fit view",children:fe(E5e,{})}),n&&fe(fL,{className:"react-flow__controls-interactive",onClick:I,title:"toggle interactivity","aria-label":"toggle interactivity",children:p?fe(k5e,{}):fe(D5e,{})}),u]})};qfe.displayName="Controls";var T5e=x.exports.memo(qfe),Du;(function(i){i.Lines="lines",i.Dots="dots",i.Cross="cross"})(Du||(Du={}));function N5e({color:i,dimensions:e,lineWidth:t}){return fe("path",{stroke:i,strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`})}function R5e({color:i,radius:e}){return fe("circle",{cx:e,cy:e,r:e,fill:i})}const M5e={[Du.Dots]:"#91919a",[Du.Lines]:"#eee",[Du.Cross]:"#e2e2e2"},A5e={[Du.Dots]:1,[Du.Lines]:1,[Du.Cross]:6},P5e=i=>({transform:i.transform,patternId:`pattern-${i.rfId}`});function Gfe({id:i,variant:e=Du.Dots,gap:t=20,size:n,lineWidth:o=1,offset:r=2,color:s,style:a,className:l}){const c=x.exports.useRef(null),{transform:u,patternId:d}=mo(P5e,Hs),h=s||M5e[e],f=n||A5e[e],g=e===Du.Dots,p=e===Du.Cross,v=Array.isArray(t)?t:[t,t],m=[v[0]*u[2]||1,v[1]*u[2]||1],_=f*u[2],w=p?[_,_]:m,y=g?[_/r,_/r]:[w[0]/r,w[1]/r];return vn("svg",{className:ha(["react-flow__background",l]),style:{...a,position:"absolute",width:"100%",height:"100%",top:0,left:0},ref:c,"data-testid":"rf__background",children:[fe("pattern",{id:d+i,x:u[0]%m[0],y:u[1]%m[1],width:m[0],height:m[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${y[0]},-${y[1]})`,children:g?fe(R5e,{color:h,radius:_/r}):fe(N5e,{dimensions:w,color:h,lineWidth:o})}),fe("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${d+i})`})]})}Gfe.displayName="Background";var O5e=x.exports.memo(Gfe);let AN;const F5e=new Uint8Array(16);function B5e(){if(!AN&&(AN=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!AN))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return AN(F5e)}const Ks=[];for(let i=0;i<256;++i)Ks.push((i+256).toString(16).slice(1));function W5e(i,e=0){return Ks[i[e+0]]+Ks[i[e+1]]+Ks[i[e+2]]+Ks[i[e+3]]+"-"+Ks[i[e+4]]+Ks[i[e+5]]+"-"+Ks[i[e+6]]+Ks[i[e+7]]+"-"+Ks[i[e+8]]+Ks[i[e+9]]+"-"+Ks[i[e+10]]+Ks[i[e+11]]+Ks[i[e+12]]+Ks[i[e+13]]+Ks[i[e+14]]+Ks[i[e+15]]}const V5e=typeof crypto!="undefined"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);var cte={randomUUID:V5e};function i4(i,e,t){if(cte.randomUUID&&!e&&!i)return cte.randomUUID();i=i||{};const n=i.random||(i.rng||B5e)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,e){t=t||0;for(let o=0;o<16;++o)e[t+o]=n[o];return e}return W5e(n)}class o4{constructor(e){Tt(this,"id");Tt(this,"name");Tt(this,"children",[]);Tt(this,"nodes",[]);Tt(this,"edges",[]);Tt(this,"parentLayerId");Tt(this,"relativeNodeId");this.id=i4(),this.name=e}}function wc(i,e){if(i.id===e)return i;for(const t of i.children){const n=wc(t,e);if(n)return n}}function H5e(i){var o;const e=[i];let t=e.pop();const n=[];for(;t;)n.push(t),(o=t==null?void 0:t.children)!=null&&o.length&&e.push(...t.children),t=e.pop();return n.reverse(),n}var $5e=function(i){return function(e,t){var n=x.exports.useRef(!1);i(function(){return function(){n.current=!1}},[]),i(function(){if(!n.current)n.current=!0;else return e()},t)}},z5e=function(i){return typeof i=="function"},U5e=!1,j5e=U5e;function x1(i){j5e&&(z5e(i)||console.error("useMemoizedFn expected parameter is a function, got ".concat(typeof i)));var e=x.exports.useRef(i);e.current=x.exports.useMemo(function(){return i},[i]);var t=x.exports.useRef();return t.current||(t.current=function(){for(var n=[],o=0;o0},i.prototype.connect_=function(){!WB||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),Q5e?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},i.prototype.disconnect_=function(){!WB||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},i.prototype.onTransitionEnd_=function(e){var t=e.propertyName,n=t===void 0?"":t,o=Z5e.some(function(r){return!!~n.indexOf(r)});o&&this.refresh()},i.getInstance=function(){return this.instance_||(this.instance_=new i),this.instance_},i.instance_=null,i}(),Yfe=function(i,e){for(var t=0,n=Object.keys(e);t0},i}(),Qfe=typeof WeakMap!="undefined"?new WeakMap:new Xfe,Jfe=function(){function i(e){if(!(this instanceof i))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var t=J5e.getInstance(),n=new cFe(e,t,this);Qfe.set(this,n)}return i}();["observe","unobserve","disconnect"].forEach(function(i){Jfe.prototype[i]=function(){var e;return(e=Qfe.get(this))[i].apply(e,arguments)}});var uFe=function(){return typeof dA.ResizeObserver!="undefined"?dA.ResizeObserver:Jfe}();function dFe(){return`$flow_${i4()}`}function hFe(i,e){return i.target===e.target&&i.targetHandle===e.targetHandle}function fFe(i,e){return i.source===e.source&&i.sourceHandle===e.sourceHandle}async function gFe(i){return await new Promise(e=>setTimeout(e,i))}var ege={exports:{}};/*! + */var MOe=x.exports,ife=60103;bI.Fragment=60107;if(typeof Symbol=="function"&&Symbol.for){var qee=Symbol.for;ife=qee("react.element"),bI.Fragment=qee("react.fragment")}var AOe=MOe.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,POe=Object.prototype.hasOwnProperty,OOe={key:!0,ref:!0,__self:!0,__source:!0};function ofe(i,e,t){var n,o={},r=null,s=null;t!==void 0&&(r=""+t),e.key!==void 0&&(r=""+e.key),e.ref!==void 0&&(s=e.ref);for(n in e)POe.call(e,n)&&!OOe.hasOwnProperty(n)&&(o[n]=e[n]);if(i&&i.defaultProps)for(n in e=i.defaultProps,e)o[n]===void 0&&(o[n]=e[n]);return{$$typeof:ife,type:i,key:r,ref:s,props:o,_owner:AOe.current}}bI.jsx=ofe;bI.jsxs=ofe;n4.exports=bI;const he=n4.exports.jsx,fn=n4.exports.jsxs,ks=n4.exports.Fragment,i4=x.exports.createContext(null),FOe=i4.Provider,np={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:i=>`Node type "${i}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:i=>`The old edge with id=${i} does not exist.`,error009:i=>`Marker type "${i}" doesn't exist.`,error008:(i,e)=>`Couldn't create edge for ${i?"target":"source"} handle id: "${i?e.targetHandle:e.sourceHandle}", edge id: ${e.id}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:i=>`Edge type "${i}" not found. Using fallback type "default".`,error012:i=>`Node with id "${i}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`},rfe=np.error001();function mo(i,e){const t=x.exports.useContext(i4);if(t===null)throw new Error(rfe);return khe(t,i,e)}const cs=()=>{const i=x.exports.useContext(i4);if(i===null)throw new Error(rfe);return x.exports.useMemo(()=>({getState:i.getState,setState:i.setState,subscribe:i.subscribe,destroy:i.destroy}),[i])},BOe=i=>i.userSelectionActive?"none":"all";function rD({position:i,children:e,className:t,style:n,...o}){const r=mo(BOe),s=`${i}`.split("-");return he("div",{className:fa(["react-flow__panel",t,...s]),style:{...n,pointerEvents:r},...o,children:e})}function WOe({proOptions:i,position:e="bottom-right"}){return i!=null&&i.hideAttribution?null:he(rD,{position:e,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://reactflow.dev/pro",children:he("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const VOe=({x:i,y:e,label:t,labelStyle:n={},labelShowBg:o=!0,labelBgStyle:r={},labelBgPadding:s=[2,4],labelBgBorderRadius:a=2,children:l,className:c,...u})=>{const d=x.exports.useRef(null),[h,f]=x.exports.useState({x:0,y:0,width:0,height:0}),g=fa(["react-flow__edge-textwrapper",c]);return x.exports.useEffect(()=>{if(d.current){const p=d.current.getBBox();f({x:p.x,y:p.y,width:p.width,height:p.height})}},[t]),typeof t=="undefined"||!t?null:fn("g",{transform:`translate(${i-h.width/2} ${e-h.height/2})`,className:g,visibility:h.width?"visible":"hidden",...u,children:[o&&he("rect",{width:h.width+2*s[0],x:-s[0],y:-s[1],height:h.height+2*s[1],className:"react-flow__edge-textbg",style:r,rx:a,ry:a}),he("text",{className:"react-flow__edge-text",y:h.height/2,dy:"0.3em",ref:d,style:n,children:t}),l]})};var HOe=x.exports.memo(VOe);const lK=i=>({width:i.offsetWidth,height:i.offsetHeight}),nw=(i,e=0,t=1)=>Math.min(Math.max(i,e),t),cK=(i={x:0,y:0},e)=>({x:nw(i.x,e[0][0],e[1][0]),y:nw(i.y,e[0][1],e[1][1])}),Gee=(i,e,t)=>it?-nw(Math.abs(i-t),1,50)/50:0,sfe=(i,e)=>{const t=Gee(i.x,35,e.width-35)*20,n=Gee(i.y,35,e.height-35)*20;return[t,n]},afe=i=>{var e;return((e=i.getRootNode)==null?void 0:e.call(i))||(window==null?void 0:window.document)},lfe=(i,e)=>({x:Math.min(i.x,e.x),y:Math.min(i.y,e.y),x2:Math.max(i.x2,e.x2),y2:Math.max(i.y2,e.y2)}),sD=({x:i,y:e,width:t,height:n})=>({x:i,y:e,x2:i+t,y2:e+n}),cfe=({x:i,y:e,x2:t,y2:n})=>({x:i,y:e,width:t-i,height:n-e}),Xee=i=>({...i.positionAbsolute||{x:0,y:0},width:i.width||0,height:i.height||0}),$Oe=(i,e)=>cfe(lfe(sD(i),sD(e))),MB=(i,e)=>{const t=Math.max(0,Math.min(i.x+i.width,e.x+e.width)-Math.max(i.x,e.x)),n=Math.max(0,Math.min(i.y+i.height,e.y+e.height)-Math.max(i.y,e.y));return Math.ceil(t*n)},zOe=i=>yu(i.width)&&yu(i.height)&&yu(i.x)&&yu(i.y),yu=i=>!isNaN(i)&&isFinite(i),ys=Symbol.for("internals"),ufe=["Enter"," ","Escape"],UOe=(i,e)=>{},jOe=i=>"nativeEvent"in i;function AB(i){var o,r;const e=jOe(i)?i.nativeEvent:i,t=((r=(o=e.composedPath)==null?void 0:o.call(e))==null?void 0:r[0])||i.target;return["INPUT","SELECT","TEXTAREA"].includes(t==null?void 0:t.nodeName)||(t==null?void 0:t.hasAttribute("contenteditable"))||!!(t!=null&&t.closest(".nokey"))}const dfe=i=>"clientX"in i,$m=(i,e)=>{var r,s,a,l;const t=dfe(i),n=t?i.clientX:(r=i.touches)==null?void 0:r[0].clientX,o=t?i.clientY:(s=i.touches)==null?void 0:s[0].clientY;return{x:n-((a=e==null?void 0:e.left)!=null?a:0),y:o-((l=e==null?void 0:e.top)!=null?l:0)}},uA=()=>{var i;return typeof navigator!="undefined"&&((i=navigator==null?void 0:navigator.userAgent)==null?void 0:i.indexOf("Mac"))>=0},CI=({id:i,path:e,labelX:t,labelY:n,label:o,labelStyle:r,labelShowBg:s,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:c,style:u,markerEnd:d,markerStart:h,interactionWidth:f=20})=>fn(ks,{children:[he("path",{id:i,style:u,d:e,fill:"none",className:"react-flow__edge-path",markerEnd:d,markerStart:h}),f&&he("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:f,className:"react-flow__edge-interaction"}),o&&yu(t)&&yu(n)?he(HOe,{x:t,y:n,label:o,labelStyle:r,labelShowBg:s,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:c}):null]});CI.displayName="BaseEdge";function _x(i,e,t){return t===void 0?t:n=>{const o=e().edges.find(r=>r.id===i);o&&t(n,{...o})}}function hfe({sourceX:i,sourceY:e,targetX:t,targetY:n}){const o=Math.abs(t-i)/2,r=t{const[v,m,_]=gfe({sourceX:i,sourceY:e,sourcePosition:o,targetX:t,targetY:n,targetPosition:r});return he(CI,{path:v,labelX:m,labelY:_,label:s,labelStyle:a,labelShowBg:l,labelBgStyle:c,labelBgPadding:u,labelBgBorderRadius:d,style:h,markerEnd:f,markerStart:g,interactionWidth:p})});uK.displayName="SimpleBezierEdge";const Zee={[mn.Left]:{x:-1,y:0},[mn.Right]:{x:1,y:0},[mn.Top]:{x:0,y:-1},[mn.Bottom]:{x:0,y:1}},KOe=({source:i,sourcePosition:e=mn.Bottom,target:t})=>e===mn.Left||e===mn.Right?i.xMath.sqrt(Math.pow(e.x-i.x,2)+Math.pow(e.y-i.y,2));function qOe({source:i,sourcePosition:e=mn.Bottom,target:t,targetPosition:n=mn.Top,center:o,offset:r}){const s=Zee[e],a=Zee[n],l={x:i.x+s.x*r,y:i.y+s.y*r},c={x:t.x+a.x*r,y:t.y+a.y*r},u=KOe({source:l,sourcePosition:e,target:c}),d=u.x!==0?"x":"y",h=u[d];let f=[],g,p;const v={x:0,y:0},m={x:0,y:0},[_,y,w,L]=hfe({sourceX:i.x,sourceY:i.y,targetX:t.x,targetY:t.y});if(s[d]*a[d]===-1){g=o.x||_,p=o.y||y;const E=[{x:g,y:l.y},{x:g,y:c.y}],I=[{x:l.x,y:p},{x:c.x,y:p}];s[d]===h?f=d==="x"?E:I:f=d==="x"?I:E}else{const E=[{x:l.x,y:c.y}],I=[{x:c.x,y:l.y}];if(d==="x"?f=s.x===h?I:E:f=s.y===h?E:I,e===n){const N=Math.abs(i[d]-t[d]);if(N<=r){const M=Math.min(r-1,r-N);s[d]===h?v[d]=(l[d]>i[d]?-1:1)*M:m[d]=(c[d]>t[d]?-1:1)*M}}if(e!==n){const N=d==="x"?"y":"x",M=s[d]===a[N],H=l[N]>c[N],B=l[N]=P?(g=(k.x+R.x)/2,p=f[0].y):(g=f[0].x,p=(k.y+R.y)/2)}return[[i,{x:l.x+v.x,y:l.y+v.y},...f,{x:c.x+m.x,y:c.y+m.y},t],g,p,w,L]}function GOe(i,e,t,n){const o=Math.min(Qee(i,e)/2,Qee(e,t)/2,n),{x:r,y:s}=e;if(i.x===r&&r===t.x||i.y===s&&s===t.y)return`L${r} ${s}`;if(i.y===s){const c=i.x{let y="";return _>0&&_{const[m,_,y]=PB({sourceX:i,sourceY:e,sourcePosition:d,targetX:t,targetY:n,targetPosition:h,borderRadius:p==null?void 0:p.borderRadius,offset:p==null?void 0:p.offset});return he(CI,{path:m,labelX:_,labelY:y,label:o,labelStyle:r,labelShowBg:s,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:c,style:u,markerEnd:f,markerStart:g,interactionWidth:v})});o4.displayName="SmoothStepEdge";const dK=x.exports.memo(i=>{var e;return he(o4,{...i,pathOptions:x.exports.useMemo(()=>{var t;return{borderRadius:0,offset:(t=i.pathOptions)==null?void 0:t.offset}},[(e=i.pathOptions)==null?void 0:e.offset])})});dK.displayName="StepEdge";function XOe({sourceX:i,sourceY:e,targetX:t,targetY:n}){const[o,r,s,a]=hfe({sourceX:i,sourceY:e,targetX:t,targetY:n});return[`M ${i},${e}L ${t},${n}`,o,r,s,a]}const hK=x.exports.memo(({sourceX:i,sourceY:e,targetX:t,targetY:n,label:o,labelStyle:r,labelShowBg:s,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:c,style:u,markerEnd:d,markerStart:h,interactionWidth:f})=>{const[g,p,v]=XOe({sourceX:i,sourceY:e,targetX:t,targetY:n});return he(CI,{path:g,labelX:p,labelY:v,label:o,labelStyle:r,labelShowBg:s,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:c,style:u,markerEnd:d,markerStart:h,interactionWidth:f})});hK.displayName="StraightEdge";function MN(i,e){return i>=0?.5*i:e*25*Math.sqrt(-i)}function Jee({pos:i,x1:e,y1:t,x2:n,y2:o,c:r}){switch(i){case mn.Left:return[e-MN(e-n,r),t];case mn.Right:return[e+MN(n-e,r),t];case mn.Top:return[e,t-MN(t-o,r)];case mn.Bottom:return[e,t+MN(o-t,r)]}}function pfe({sourceX:i,sourceY:e,sourcePosition:t=mn.Bottom,targetX:n,targetY:o,targetPosition:r=mn.Top,curvature:s=.25}){const[a,l]=Jee({pos:t,x1:i,y1:e,x2:n,y2:o,c:s}),[c,u]=Jee({pos:r,x1:n,y1:o,x2:i,y2:e,c:s}),[d,h,f,g]=ffe({sourceX:i,sourceY:e,targetX:n,targetY:o,sourceControlX:a,sourceControlY:l,targetControlX:c,targetControlY:u});return[`M${i},${e} C${a},${l} ${c},${u} ${n},${o}`,d,h,f,g]}const hA=x.exports.memo(({sourceX:i,sourceY:e,targetX:t,targetY:n,sourcePosition:o=mn.Bottom,targetPosition:r=mn.Top,label:s,labelStyle:a,labelShowBg:l,labelBgStyle:c,labelBgPadding:u,labelBgBorderRadius:d,style:h,markerEnd:f,markerStart:g,pathOptions:p,interactionWidth:v})=>{const[m,_,y]=pfe({sourceX:i,sourceY:e,sourcePosition:o,targetX:t,targetY:n,targetPosition:r,curvature:p==null?void 0:p.curvature});return he(CI,{path:m,labelX:_,labelY:y,label:s,labelStyle:a,labelShowBg:l,labelBgStyle:c,labelBgPadding:u,labelBgBorderRadius:d,style:h,markerEnd:f,markerStart:g,interactionWidth:v})});hA.displayName="BezierEdge";const fK=x.exports.createContext(null),YOe=fK.Provider;fK.Consumer;const ZOe=()=>x.exports.useContext(fK),OB=i=>"id"in i&&"source"in i&&"target"in i,QOe=({source:i,sourceHandle:e,target:t,targetHandle:n})=>`reactflow__edge-${i}${e||""}-${t}${n||""}`,FB=(i,e)=>typeof i=="undefined"?"":typeof i=="string"?i:`${e?`${e}__`:""}${Object.keys(i).sort().map(n=>`${n}=${i[n]}`).join("&")}`,JOe=(i,e)=>e.some(t=>t.source===i.source&&t.target===i.target&&(t.sourceHandle===i.sourceHandle||!t.sourceHandle&&!i.sourceHandle)&&(t.targetHandle===i.targetHandle||!t.targetHandle&&!i.targetHandle)),mfe=(i,e)=>{if(!i.source||!i.target)return e;let t;return OB(i)?t={...i}:t={...i,id:QOe(i)},JOe(t,e)?e:e.concat(t)},BB=({x:i,y:e},[t,n,o],r,[s,a])=>{const l={x:(i-t)/o,y:(e-n)/o};return r?{x:s*Math.round(l.x/s),y:a*Math.round(l.y/a)}:l},vfe=({x:i,y:e},[t,n,o])=>({x:i*o+t,y:e*o+n}),w0=(i,e=[0,0])=>{var r,s;if(!i)return{x:0,y:0,positionAbsolute:{x:0,y:0}};const t=((r=i.width)!=null?r:0)*e[0],n=((s=i.height)!=null?s:0)*e[1],o={x:i.position.x-t,y:i.position.y-n};return{...o,positionAbsolute:i.positionAbsolute?{x:i.positionAbsolute.x-t,y:i.positionAbsolute.y-n}:o}},r4=(i,e=[0,0])=>{if(i.length===0)return{x:0,y:0,width:0,height:0};const t=i.reduce((n,o)=>{const{x:r,y:s}=w0(o,e);return lfe(n,sD({x:r,y:s,width:o.width||0,height:o.height||0}))},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return cfe(t)},_fe=(i,e,[t,n,o]=[0,0,1],r=!1,s=!1,a=[0,0])=>{const l={x:(e.x-t)/o,y:(e.y-n)/o,width:e.width/o,height:e.height/o},c=[];return i.forEach(u=>{const{width:d,height:h,selectable:f=!0,hidden:g=!1}=u;if(s&&!f||g)return!1;const{positionAbsolute:p}=w0(u,a),v={x:p.x,y:p.y,width:d||0,height:h||0},m=MB(l,v),_=typeof d=="undefined"||typeof h=="undefined"||d===null||h===null,y=r&&m>0,w=(d||0)*(h||0);(_||y||m>=w||u.dragging)&&c.push(u)}),c},bfe=(i,e)=>{const t=i.map(n=>n.id);return e.filter(n=>t.includes(n.source)||t.includes(n.target))},Cfe=(i,e,t,n,o,r=.1)=>{const s=e/(i.width*(1+r)),a=t/(i.height*(1+r)),l=Math.min(s,a),c=nw(l,n,o),u=i.x+i.width/2,d=i.y+i.height/2,h=e/2-u*c,f=t/2-d*c;return{x:h,y:f,zoom:c}},D_=(i,e=0)=>i.transition().duration(e);function ete(i,e,t,n){return(e[t]||[]).reduce((o,r)=>{var s,a,l,c;return`${i.id}-${r.id}-${t}`!==n&&o.push({id:r.id||null,type:t,nodeId:i.id,x:((a=(s=i.positionAbsolute)==null?void 0:s.x)!=null?a:0)+r.x+r.width/2,y:((c=(l=i.positionAbsolute)==null?void 0:l.y)!=null?c:0)+r.y+r.height/2}),o},[])}function e4e(i,e,t,n,o,r){const{x:s,y:a}=$m(i),c=e.elementsFromPoint(s,a).find(g=>g.classList.contains("react-flow__handle"));if(c){const g=c.getAttribute("data-nodeid");if(g){const p=gK(void 0,c),v=c.getAttribute("data-handleid"),m=r({nodeId:g,id:v,type:p});if(m){const _=o.find(y=>y.nodeId===g&&y.type===p&&y.id===v);return{handle:{id:v,type:p,nodeId:g,x:(_==null?void 0:_.x)||t.x,y:(_==null?void 0:_.y)||t.y},validHandleResult:m}}}}let u=[],d=1/0;if(o.forEach(g=>{const p=Math.sqrt((g.x-t.x)**2+(g.y-t.y)**2);if(p<=n){const v=r(g);p<=d&&(pg.isValid),f=u.some(({handle:g})=>g.type==="target");return u.find(({handle:g,validHandleResult:p})=>f?g.type==="target":h?p.isValid:!0)||u[0]}const t4e={source:null,target:null,sourceHandle:null,targetHandle:null},yfe=()=>({handleDomNode:null,isValid:!1,connection:t4e,endHandle:null});function wfe(i,e,t,n,o,r,s){const a=o==="target",l=s.querySelector(`.react-flow__handle[data-id="${i==null?void 0:i.nodeId}-${i==null?void 0:i.id}-${i==null?void 0:i.type}"]`),c={...yfe(),handleDomNode:l};if(l){const u=gK(void 0,l),d=l.getAttribute("data-nodeid"),h=l.getAttribute("data-handleid"),f=l.classList.contains("connectable"),g=l.classList.contains("connectableend"),p={source:a?d:t,sourceHandle:a?h:n,target:a?t:d,targetHandle:a?n:h};c.connection=p,f&&g&&(e===$0.Strict?a&&u==="source"||!a&&u==="target":d!==t||h!==n)&&(c.endHandle={nodeId:d,handleId:h,type:u},c.isValid=r(p))}return c}function n4e({nodes:i,nodeId:e,handleId:t,handleType:n}){return i.reduce((o,r)=>{if(r[ys]){const{handleBounds:s}=r[ys];let a=[],l=[];s&&(a=ete(r,s,"source",`${e}-${t}-${n}`),l=ete(r,s,"target",`${e}-${t}-${n}`)),o.push(...a,...l)}return o},[])}function gK(i,e){return i||(e!=null&&e.classList.contains("target")?"target":e!=null&&e.classList.contains("source")?"source":null)}function B8(i){i==null||i.classList.remove("valid","connecting","react-flow__handle-valid","react-flow__handle-connecting")}function i4e(i,e){let t=null;return e?t="valid":i&&!e&&(t="invalid"),t}function Sfe({event:i,handleId:e,nodeId:t,onConnect:n,isTarget:o,getState:r,setState:s,isValidConnection:a,edgeUpdaterType:l,onEdgeUpdateEnd:c}){const u=afe(i.target),{connectionMode:d,domNode:h,autoPanOnConnect:f,connectionRadius:g,onConnectStart:p,panBy:v,getNodes:m,cancelConnection:_}=r();let y=0,w;const{x:L,y:D}=$m(i),E=u==null?void 0:u.elementFromPoint(L,D),I=gK(l,E),k=h==null?void 0:h.getBoundingClientRect();if(!k||!I)return;let R,A=$m(i,k),P=!1,N=null,M=!1,H=null;const B=n4e({nodes:m(),nodeId:t,handleId:e,handleType:I}),F=()=>{if(!f)return;const[K,j]=sfe(A,k);v({x:K,y:j}),y=requestAnimationFrame(F)};s({connectionPosition:A,connectionStatus:null,connectionNodeId:t,connectionHandleId:e,connectionHandleType:I,connectionStartHandle:{nodeId:t,handleId:e,type:I},connectionEndHandle:null}),p==null||p(i,{nodeId:t,handleId:e,handleType:I});function $(K){const{transform:j}=r();A=$m(K,k);const{handle:G,validHandleResult:X}=e4e(K,u,BB(A,j,!1,[1,1]),g,B,de=>wfe(de,d,t,e,o?"target":"source",a,u));if(w=G,P||(F(),P=!0),H=X.handleDomNode,N=X.connection,M=X.isValid,s({connectionPosition:w&&M?vfe({x:w.x,y:w.y},j):A,connectionStatus:i4e(!!w,M),connectionEndHandle:X.endHandle}),!w&&!M&&!H)return B8(R);N.source!==N.target&&H&&(B8(R),R=H,H.classList.add("connecting","react-flow__handle-connecting"),H.classList.toggle("valid",M),H.classList.toggle("react-flow__handle-valid",M))}function z(K){var j,G;(w||H)&&N&&M&&(n==null||n(N)),(G=(j=r()).onConnectEnd)==null||G.call(j,K),l&&(c==null||c(K)),B8(R),_(),cancelAnimationFrame(y),P=!1,M=!1,N=null,H=null,u.removeEventListener("mousemove",$),u.removeEventListener("mouseup",z),u.removeEventListener("touchmove",$),u.removeEventListener("touchend",z)}u.addEventListener("mousemove",$),u.addEventListener("mouseup",z),u.addEventListener("touchmove",$),u.addEventListener("touchend",z)}const tte=()=>!0,o4e=i=>({connectionStartHandle:i.connectionStartHandle,connectOnClick:i.connectOnClick,noPanClassName:i.noPanClassName}),r4e=(i,e,t)=>n=>{const{connectionStartHandle:o,connectionEndHandle:r,connectionClickStartHandle:s}=n;return{connecting:(o==null?void 0:o.nodeId)===i&&(o==null?void 0:o.handleId)===e&&(o==null?void 0:o.type)===t||(r==null?void 0:r.nodeId)===i&&(r==null?void 0:r.handleId)===e&&(r==null?void 0:r.type)===t,clickConnecting:(s==null?void 0:s.nodeId)===i&&(s==null?void 0:s.handleId)===e&&(s==null?void 0:s.type)===t}},xfe=x.exports.forwardRef(({type:i="source",position:e=mn.Top,isValidConnection:t,isConnectable:n=!0,isConnectableStart:o=!0,isConnectableEnd:r=!0,id:s,onConnect:a,children:l,className:c,onMouseDown:u,onTouchStart:d,...h},f)=>{var k,R;const g=s||null,p=i==="target",v=cs(),m=ZOe(),{connectOnClick:_,noPanClassName:y}=mo(o4e,Hs),{connecting:w,clickConnecting:L}=mo(r4e(m,g,i),Hs);m||(R=(k=v.getState()).onError)==null||R.call(k,"010",np.error010());const D=A=>{const{defaultEdgeOptions:P,onConnect:N,hasDefaultEdges:M}=v.getState(),H={...P,...A};if(M){const{edges:B,setEdges:F}=v.getState();F(mfe(H,B))}N==null||N(H),a==null||a(H)},E=A=>{if(!m)return;const P=dfe(A);o&&(P&&A.button===0||!P)&&Sfe({event:A,handleId:g,nodeId:m,onConnect:D,isTarget:p,getState:v.getState,setState:v.setState,isValidConnection:t||v.getState().isValidConnection||tte}),P?u==null||u(A):d==null||d(A)},I=A=>{const{onClickConnectStart:P,onClickConnectEnd:N,connectionClickStartHandle:M,connectionMode:H,isValidConnection:B}=v.getState();if(!m||!M&&!o)return;if(!M){P==null||P(A,{nodeId:m,handleId:g,handleType:i}),v.setState({connectionClickStartHandle:{nodeId:m,type:i,handleId:g}});return}const F=afe(A.target),$=t||B||tte,{connection:z,isValid:K}=wfe({nodeId:m,id:g,type:i},H,M.nodeId,M.handleId||null,M.type,$,F);K&&D(z),N==null||N(A),v.setState({connectionClickStartHandle:null})};return he("div",{"data-handleid":g,"data-nodeid":m,"data-handlepos":e,"data-id":`${m}-${g}-${i}`,className:fa(["react-flow__handle",`react-flow__handle-${e}`,"nodrag",y,c,{source:!p,target:p,connectable:n,connectablestart:o,connectableend:r,connecting:L,connectionindicator:n&&(o&&!w||r&&w)}]),onMouseDown:E,onTouchStart:E,onClick:_?I:void 0,ref:f,...h,children:l})});xfe.displayName="Handle";var lD=x.exports.memo(xfe);const Lfe=({data:i,isConnectable:e,targetPosition:t=mn.Top,sourcePosition:n=mn.Bottom})=>fn(ks,{children:[he(lD,{type:"target",position:t,isConnectable:e}),i==null?void 0:i.label,he(lD,{type:"source",position:n,isConnectable:e})]});Lfe.displayName="DefaultNode";var WB=x.exports.memo(Lfe);const Efe=({data:i,isConnectable:e,sourcePosition:t=mn.Bottom})=>fn(ks,{children:[i==null?void 0:i.label,he(lD,{type:"source",position:t,isConnectable:e})]});Efe.displayName="InputNode";var Dfe=x.exports.memo(Efe);const kfe=({data:i,isConnectable:e,targetPosition:t=mn.Top})=>fn(ks,{children:[he(lD,{type:"target",position:t,isConnectable:e}),i==null?void 0:i.label]});kfe.displayName="OutputNode";var Ife=x.exports.memo(kfe);const pK=()=>null;pK.displayName="GroupNode";const s4e=i=>({selectedNodes:i.getNodes().filter(e=>e.selected),selectedEdges:i.edges.filter(e=>e.selected)}),AN=i=>i.id;function a4e(i,e){return Hs(i.selectedNodes.map(AN),e.selectedNodes.map(AN))&&Hs(i.selectedEdges.map(AN),e.selectedEdges.map(AN))}const Tfe=x.exports.memo(({onSelectionChange:i})=>{const e=cs(),{selectedNodes:t,selectedEdges:n}=mo(s4e,a4e);return x.exports.useEffect(()=>{const o={nodes:t,edges:n};i==null||i(o),e.getState().onSelectionChange.forEach(r=>r(o))},[t,n,i]),null});Tfe.displayName="SelectionListener";const l4e=i=>!!i.onSelectionChange;function c4e({onSelectionChange:i}){const e=mo(l4e);return i||e?he(Tfe,{onSelectionChange:i}):null}const u4e=i=>({setNodes:i.setNodes,setEdges:i.setEdges,setDefaultNodesAndEdges:i.setDefaultNodesAndEdges,setMinZoom:i.setMinZoom,setMaxZoom:i.setMaxZoom,setTranslateExtent:i.setTranslateExtent,setNodeExtent:i.setNodeExtent,reset:i.reset});function y1(i,e){x.exports.useEffect(()=>{typeof i!="undefined"&&e(i)},[i])}function _i(i,e,t){x.exports.useEffect(()=>{typeof e!="undefined"&&t({[i]:e})},[e])}const d4e=({nodes:i,edges:e,defaultNodes:t,defaultEdges:n,onConnect:o,onConnectStart:r,onConnectEnd:s,onClickConnectStart:a,onClickConnectEnd:l,nodesDraggable:c,nodesConnectable:u,nodesFocusable:d,edgesFocusable:h,edgesUpdatable:f,elevateNodesOnSelect:g,minZoom:p,maxZoom:v,nodeExtent:m,onNodesChange:_,onEdgesChange:y,elementsSelectable:w,connectionMode:L,snapGrid:D,snapToGrid:E,translateExtent:I,connectOnClick:k,defaultEdgeOptions:R,fitView:A,fitViewOptions:P,onNodesDelete:N,onEdgesDelete:M,onNodeDrag:H,onNodeDragStart:B,onNodeDragStop:F,onSelectionDrag:$,onSelectionDragStart:z,onSelectionDragStop:K,noPanClassName:j,nodeOrigin:G,rfId:X,autoPanOnConnect:de,autoPanOnNodeDrag:fe,onError:pe,connectionRadius:be,isValidConnection:Se,nodeDragThreshold:Fe})=>{const{setNodes:De,setEdges:ce,setDefaultNodesAndEdges:Pe,setMinZoom:Oe,setMaxZoom:xe,setTranslateExtent:Ee,setNodeExtent:tt,reset:nt}=mo(u4e,Hs),Qe=cs();return x.exports.useEffect(()=>{const Ge=n==null?void 0:n.map(re=>({...re,...R}));return Pe(t,Ge),()=>{nt()}},[]),_i("defaultEdgeOptions",R,Qe.setState),_i("connectionMode",L,Qe.setState),_i("onConnect",o,Qe.setState),_i("onConnectStart",r,Qe.setState),_i("onConnectEnd",s,Qe.setState),_i("onClickConnectStart",a,Qe.setState),_i("onClickConnectEnd",l,Qe.setState),_i("nodesDraggable",c,Qe.setState),_i("nodesConnectable",u,Qe.setState),_i("nodesFocusable",d,Qe.setState),_i("edgesFocusable",h,Qe.setState),_i("edgesUpdatable",f,Qe.setState),_i("elementsSelectable",w,Qe.setState),_i("elevateNodesOnSelect",g,Qe.setState),_i("snapToGrid",E,Qe.setState),_i("snapGrid",D,Qe.setState),_i("onNodesChange",_,Qe.setState),_i("onEdgesChange",y,Qe.setState),_i("connectOnClick",k,Qe.setState),_i("fitViewOnInit",A,Qe.setState),_i("fitViewOnInitOptions",P,Qe.setState),_i("onNodesDelete",N,Qe.setState),_i("onEdgesDelete",M,Qe.setState),_i("onNodeDrag",H,Qe.setState),_i("onNodeDragStart",B,Qe.setState),_i("onNodeDragStop",F,Qe.setState),_i("onSelectionDrag",$,Qe.setState),_i("onSelectionDragStart",z,Qe.setState),_i("onSelectionDragStop",K,Qe.setState),_i("noPanClassName",j,Qe.setState),_i("nodeOrigin",G,Qe.setState),_i("rfId",X,Qe.setState),_i("autoPanOnConnect",de,Qe.setState),_i("autoPanOnNodeDrag",fe,Qe.setState),_i("onError",pe,Qe.setState),_i("connectionRadius",be,Qe.setState),_i("isValidConnection",Se,Qe.setState),_i("nodeDragThreshold",Fe,Qe.setState),y1(i,De),y1(e,ce),y1(p,Oe),y1(v,xe),y1(I,Ee),y1(m,tt),null},nte={display:"none"},h4e={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},Nfe="react-flow__node-desc",Rfe="react-flow__edge-desc",f4e="react-flow__aria-live",g4e=i=>i.ariaLiveMessage;function p4e({rfId:i}){const e=mo(g4e);return he("div",{id:`${f4e}-${i}`,"aria-live":"assertive","aria-atomic":"true",style:h4e,children:e})}function m4e({rfId:i,disableKeyboardA11y:e}){return fn(ks,{children:[fn("div",{id:`${Nfe}-${i}`,style:nte,children:["Press enter or space to select a node.",!e&&"You can then use the arrow keys to move the node around."," Press delete to remove it and escape to cancel."," "]}),he("div",{id:`${Rfe}-${i}`,style:nte,children:"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel."}),!e&&he(p4e,{rfId:i})]})}var cD=(i=null,e={actInsideInputWithModifier:!0})=>{const[t,n]=x.exports.useState(!1),o=x.exports.useRef(!1),r=x.exports.useRef(new Set([])),[s,a]=x.exports.useMemo(()=>{if(i!==null){const c=(Array.isArray(i)?i:[i]).filter(d=>typeof d=="string").map(d=>d.split("+")),u=c.reduce((d,h)=>d.concat(...h),[]);return[c,u]}return[[],[]]},[i]);return x.exports.useEffect(()=>{const l=typeof document!="undefined"?document:null,c=(e==null?void 0:e.target)||l;if(i!==null){const u=f=>{if(o.current=f.ctrlKey||f.metaKey||f.shiftKey,(!o.current||o.current&&!e.actInsideInputWithModifier)&&AB(f))return!1;const p=ote(f.code,a);r.current.add(f[p]),ite(s,r.current,!1)&&(f.preventDefault(),n(!0))},d=f=>{if((!o.current||o.current&&!e.actInsideInputWithModifier)&&AB(f))return!1;const p=ote(f.code,a);ite(s,r.current,!0)?(n(!1),r.current.clear()):r.current.delete(f[p]),f.key==="Meta"&&r.current.clear(),o.current=!1},h=()=>{r.current.clear(),n(!1)};return c==null||c.addEventListener("keydown",u),c==null||c.addEventListener("keyup",d),window.addEventListener("blur",h),()=>{c==null||c.removeEventListener("keydown",u),c==null||c.removeEventListener("keyup",d),window.removeEventListener("blur",h)}}},[i,n]),t};function ite(i,e,t){return i.filter(n=>t||n.length===e.size).some(n=>n.every(o=>e.has(o)))}function ote(i,e){return e.includes(i)?"code":"key"}function Mfe(i,e,t,n){var s,a,l,c,u,d,h,f;if(!i.parentNode)return t;const o=e.get(i.parentNode),r=w0(o,n);return Mfe(o,e,{x:((s=t.x)!=null?s:0)+r.x,y:((a=t.y)!=null?a:0)+r.y,z:((c=(l=o[ys])==null?void 0:l.z)!=null?c:0)>((u=t.z)!=null?u:0)?(h=(d=o[ys])==null?void 0:d.z)!=null?h:0:(f=t.z)!=null?f:0},n)}function Afe(i,e,t){i.forEach(n=>{var o,r;if(n.parentNode&&!i.has(n.parentNode))throw new Error(`Parent node ${n.parentNode} not found`);if(n.parentNode||(t==null?void 0:t[n.id])){const{x:s,y:a,z:l}=Mfe(n,i,{...n.position,z:(r=(o=n[ys])==null?void 0:o.z)!=null?r:0},e);n.positionAbsolute={x:s,y:a},n[ys].z=l,t!=null&&t[n.id]&&(n[ys].isParent=!0)}})}function W8(i,e,t,n){const o=new Map,r={},s=n?1e3:0;return i.forEach(a=>{var d;const l=(yu(a.zIndex)?a.zIndex:0)+(a.selected?s:0),c=e.get(a.id),u={width:c==null?void 0:c.width,height:c==null?void 0:c.height,...a,positionAbsolute:{x:a.position.x,y:a.position.y}};a.parentNode&&(u.parentNode=a.parentNode,r[a.parentNode]=!0),Object.defineProperty(u,ys,{enumerable:!1,value:{handleBounds:(d=c==null?void 0:c[ys])==null?void 0:d.handleBounds,z:l}}),o.set(a.id,u)}),Afe(o,t,r),o}function Pfe(i,e={}){var g,p,v;const{getNodes:t,width:n,height:o,minZoom:r,maxZoom:s,d3Zoom:a,d3Selection:l,fitViewOnInitDone:c,fitViewOnInit:u,nodeOrigin:d}=i(),h=e.initial&&!c&&u;if(a&&l&&(h||!e.initial)){const m=t().filter(y=>{var L;const w=e.includeHiddenNodes?y.width&&y.height:!y.hidden;return(L=e.nodes)!=null&&L.length?w&&e.nodes.some(D=>D.id===y.id):w}),_=m.every(y=>y.width&&y.height);if(m.length>0&&_){const y=r4(m,d),{x:w,y:L,zoom:D}=Cfe(y,n,o,(g=e.minZoom)!=null?g:r,(p=e.maxZoom)!=null?p:s,(v=e.padding)!=null?v:.1),E=zg.translate(w,L).scale(D);return typeof e.duration=="number"&&e.duration>0?a.transform(D_(l,e.duration),E):a.transform(l,E),!0}}return!1}function v4e(i,e){return i.forEach(t=>{const n=e.get(t.id);n&&e.set(n.id,{...n,[ys]:n[ys],selected:t.selected})}),new Map(e)}function _4e(i,e){return e.map(t=>{const n=i.find(o=>o.id===t.id);return n&&(t.selected=n.selected),t})}function PN({changedNodes:i,changedEdges:e,get:t,set:n}){const{nodeInternals:o,edges:r,onNodesChange:s,onEdgesChange:a,hasDefaultNodes:l,hasDefaultEdges:c}=t();i!=null&&i.length&&(l&&n({nodeInternals:v4e(i,o)}),s==null||s(i)),e!=null&&e.length&&(c&&n({edges:_4e(e,r)}),a==null||a(e))}const w1=()=>{},b4e={zoomIn:w1,zoomOut:w1,zoomTo:w1,getZoom:()=>1,setViewport:w1,getViewport:()=>({x:0,y:0,zoom:1}),fitView:()=>!1,setCenter:w1,fitBounds:w1,project:i=>i,screenToFlowPosition:i=>i,flowToScreenPosition:i=>i,viewportInitialized:!1},C4e=i=>({d3Zoom:i.d3Zoom,d3Selection:i.d3Selection}),y4e=()=>{const i=cs(),{d3Zoom:e,d3Selection:t}=mo(C4e,Hs);return x.exports.useMemo(()=>t&&e?{zoomIn:o=>e.scaleBy(D_(t,o==null?void 0:o.duration),1.2),zoomOut:o=>e.scaleBy(D_(t,o==null?void 0:o.duration),1/1.2),zoomTo:(o,r)=>e.scaleTo(D_(t,r==null?void 0:r.duration),o),getZoom:()=>i.getState().transform[2],setViewport:(o,r)=>{var u,d,h;const[s,a,l]=i.getState().transform,c=zg.translate((u=o.x)!=null?u:s,(d=o.y)!=null?d:a).scale((h=o.zoom)!=null?h:l);e.transform(D_(t,r==null?void 0:r.duration),c)},getViewport:()=>{const[o,r,s]=i.getState().transform;return{x:o,y:r,zoom:s}},fitView:o=>Pfe(i.getState,o),setCenter:(o,r,s)=>{const{width:a,height:l,maxZoom:c}=i.getState(),u=typeof(s==null?void 0:s.zoom)!="undefined"?s.zoom:c,d=a/2-o*u,h=l/2-r*u,f=zg.translate(d,h).scale(u);e.transform(D_(t,s==null?void 0:s.duration),f)},fitBounds:(o,r)=>{var g;const{width:s,height:a,minZoom:l,maxZoom:c}=i.getState(),{x:u,y:d,zoom:h}=Cfe(o,s,a,l,c,(g=r==null?void 0:r.padding)!=null?g:.1),f=zg.translate(u,d).scale(h);e.transform(D_(t,r==null?void 0:r.duration),f)},project:o=>{const{transform:r,snapToGrid:s,snapGrid:a}=i.getState();return console.warn("[DEPRECATED] `project` is deprecated. Instead use `screenToFlowPosition`. There is no need to subtract the react flow bounds anymore! https://reactflow.dev/api-reference/types/react-flow-instance#screen-to-flow-position"),BB(o,r,s,a)},screenToFlowPosition:o=>{const{transform:r,snapToGrid:s,snapGrid:a,domNode:l}=i.getState();if(!l)return o;const{x:c,y:u}=l.getBoundingClientRect(),d={x:o.x-c,y:o.y-u};return BB(d,r,s,a)},flowToScreenPosition:o=>{const{transform:r,domNode:s}=i.getState();if(!s)return o;const{x:a,y:l}=s.getBoundingClientRect(),c=vfe(o,r);return{x:c.x+a,y:c.y+l}},viewportInitialized:!0}:b4e,[e,t])};function mK(){const i=y4e(),e=cs(),t=x.exports.useCallback(()=>e.getState().getNodes().map(p=>({...p})),[]),n=x.exports.useCallback(p=>e.getState().nodeInternals.get(p),[]),o=x.exports.useCallback(()=>{const{edges:p=[]}=e.getState();return p.map(v=>({...v}))},[]),r=x.exports.useCallback(p=>{const{edges:v=[]}=e.getState();return v.find(m=>m.id===p)},[]),s=x.exports.useCallback(p=>{const{getNodes:v,setNodes:m,hasDefaultNodes:_,onNodesChange:y}=e.getState(),w=v(),L=typeof p=="function"?p(w):p;if(_)m(L);else if(y){const D=L.length===0?w.map(E=>({type:"remove",id:E.id})):L.map(E=>({item:E,type:"reset"}));y(D)}},[]),a=x.exports.useCallback(p=>{const{edges:v=[],setEdges:m,hasDefaultEdges:_,onEdgesChange:y}=e.getState(),w=typeof p=="function"?p(v):p;if(_)m(w);else if(y){const L=w.length===0?v.map(D=>({type:"remove",id:D.id})):w.map(D=>({item:D,type:"reset"}));y(L)}},[]),l=x.exports.useCallback(p=>{const v=Array.isArray(p)?p:[p],{getNodes:m,setNodes:_,hasDefaultNodes:y,onNodesChange:w}=e.getState();if(y){const D=[...m(),...v];_(D)}else if(w){const L=v.map(D=>({item:D,type:"add"}));w(L)}},[]),c=x.exports.useCallback(p=>{const v=Array.isArray(p)?p:[p],{edges:m=[],setEdges:_,hasDefaultEdges:y,onEdgesChange:w}=e.getState();if(y)_([...m,...v]);else if(w){const L=v.map(D=>({item:D,type:"add"}));w(L)}},[]),u=x.exports.useCallback(()=>{const{getNodes:p,edges:v=[],transform:m}=e.getState(),[_,y,w]=m;return{nodes:p().map(L=>({...L})),edges:v.map(L=>({...L})),viewport:{x:_,y,zoom:w}}},[]),d=x.exports.useCallback(({nodes:p,edges:v})=>{const{nodeInternals:m,getNodes:_,edges:y,hasDefaultNodes:w,hasDefaultEdges:L,onNodesDelete:D,onEdgesDelete:E,onNodesChange:I,onEdgesChange:k}=e.getState(),R=(p||[]).map(H=>H.id),A=(v||[]).map(H=>H.id),P=_().reduce((H,B)=>{const F=!R.includes(B.id)&&B.parentNode&&H.find(z=>z.id===B.parentNode);return(typeof B.deletable=="boolean"?B.deletable:!0)&&(R.includes(B.id)||F)&&H.push(B),H},[]),N=y.filter(H=>typeof H.deletable=="boolean"?H.deletable:!0),M=N.filter(H=>A.includes(H.id));if(P||M){const H=bfe(P,N),B=[...M,...H],F=B.reduce(($,z)=>($.includes(z.id)||$.push(z.id),$),[]);if((L||w)&&(L&&e.setState({edges:y.filter($=>!F.includes($.id))}),w&&(P.forEach($=>{m.delete($.id)}),e.setState({nodeInternals:new Map(m)}))),F.length>0&&(E==null||E(B),k&&k(F.map($=>({id:$,type:"remove"})))),P.length>0&&(D==null||D(P),I)){const $=P.map(z=>({id:z.id,type:"remove"}));I($)}}},[]),h=x.exports.useCallback(p=>{const v=zOe(p),m=v?null:e.getState().nodeInternals.get(p.id);return!v&&!m?[null,null,v]:[v?p:Xee(m),m,v]},[]),f=x.exports.useCallback((p,v=!0,m)=>{const[_,y,w]=h(p);return _?(m||e.getState().getNodes()).filter(L=>{if(!w&&(L.id===y.id||!L.positionAbsolute))return!1;const D=Xee(L),E=MB(D,_);return v&&E>0||E>=_.width*_.height}):[]},[]),g=x.exports.useCallback((p,v,m=!0)=>{const[_]=h(p);if(!_)return!1;const y=MB(_,v);return m&&y>0||y>=_.width*_.height},[]);return x.exports.useMemo(()=>({...i,getNodes:t,getNode:n,getEdges:o,getEdge:r,setNodes:s,setEdges:a,addNodes:l,addEdges:c,toObject:u,deleteElements:d,getIntersectingNodes:f,isNodeIntersecting:g}),[i,t,n,o,r,s,a,l,c,u,d,f,g])}const w4e={actInsideInputWithModifier:!1};var S4e=({deleteKeyCode:i,multiSelectionKeyCode:e})=>{const t=cs(),{deleteElements:n}=mK(),o=cD(i,w4e),r=cD(e);x.exports.useEffect(()=>{if(o){const{edges:s,getNodes:a}=t.getState(),l=a().filter(u=>u.selected),c=s.filter(u=>u.selected);n({nodes:l,edges:c}),t.setState({nodesSelectionActive:!1})}},[o]),x.exports.useEffect(()=>{t.setState({multiSelectionActive:r})},[r])};function x4e(i){const e=cs();x.exports.useEffect(()=>{let t;const n=()=>{var r,s;if(!i.current)return;const o=lK(i.current);(o.height===0||o.width===0)&&((s=(r=e.getState()).onError)==null||s.call(r,"004",np.error004())),e.setState({width:o.width||500,height:o.height||500})};return n(),window.addEventListener("resize",n),i.current&&(t=new ResizeObserver(()=>n()),t.observe(i.current)),()=>{window.removeEventListener("resize",n),t&&i.current&&t.unobserve(i.current)}},[])}const vK={position:"absolute",width:"100%",height:"100%",top:0,left:0},L4e=(i,e)=>i.x!==e.x||i.y!==e.y||i.zoom!==e.k,ON=i=>({x:i.x,y:i.y,zoom:i.k}),S1=(i,e)=>i.target.closest(`.${e}`),rte=(i,e)=>e===2&&Array.isArray(i)&&i.includes(2),ste=i=>{const e=i.ctrlKey&&uA()?10:1;return-i.deltaY*(i.deltaMode===1?.05:i.deltaMode?1:.002)*e},E4e=i=>({d3Zoom:i.d3Zoom,d3Selection:i.d3Selection,d3ZoomHandler:i.d3ZoomHandler,userSelectionActive:i.userSelectionActive}),D4e=({onMove:i,onMoveStart:e,onMoveEnd:t,onPaneContextMenu:n,zoomOnScroll:o=!0,zoomOnPinch:r=!0,panOnScroll:s=!1,panOnScrollSpeed:a=.5,panOnScrollMode:l=t0.Free,zoomOnDoubleClick:c=!0,elementsSelectable:u,panOnDrag:d=!0,defaultViewport:h,translateExtent:f,minZoom:g,maxZoom:p,zoomActivationKeyCode:v,preventScrolling:m=!0,children:_,noWheelClassName:y,noPanClassName:w})=>{const L=x.exports.useRef(),D=cs(),E=x.exports.useRef(!1),I=x.exports.useRef(!1),k=x.exports.useRef(null),R=x.exports.useRef({x:0,y:0,zoom:0}),{d3Zoom:A,d3Selection:P,d3ZoomHandler:N,userSelectionActive:M}=mo(E4e,Hs),H=cD(v),B=x.exports.useRef(0),F=x.exports.useRef(!1),$=x.exports.useRef();return x4e(k),x.exports.useEffect(()=>{if(k.current){const z=k.current.getBoundingClientRect(),K=nfe().scaleExtent([g,p]).translateExtent(f),j=bu(k.current).call(K),G=zg.translate(h.x,h.y).scale(nw(h.zoom,g,p)),X=[[0,0],[z.width,z.height]],de=K.constrain()(G,X,f);K.transform(j,de),K.wheelDelta(ste),D.setState({d3Zoom:K,d3Selection:j,d3ZoomHandler:j.on("wheel.zoom"),transform:[de.x,de.y,de.k],domNode:k.current.closest(".react-flow")})}},[]),x.exports.useEffect(()=>{P&&A&&(s&&!H&&!M?P.on("wheel.zoom",z=>{if(S1(z,y))return!1;z.preventDefault(),z.stopImmediatePropagation();const K=P.property("__zoom").k||1,j=uA();if(z.ctrlKey&&r&&j){const Fe=gd(z),De=ste(z),ce=K*Math.pow(2,De);A.scaleTo(P,ce,Fe,z);return}const G=z.deltaMode===1?20:1;let X=l===t0.Vertical?0:z.deltaX*G,de=l===t0.Horizontal?0:z.deltaY*G;!j&&z.shiftKey&&l!==t0.Vertical&&(X=z.deltaY*G,de=0),A.translateBy(P,-(X/K)*a,-(de/K)*a,{internal:!0});const fe=ON(P.property("__zoom")),{onViewportChangeStart:pe,onViewportChange:be,onViewportChangeEnd:Se}=D.getState();clearTimeout($.current),F.current||(F.current=!0,e==null||e(z,fe),pe==null||pe(fe)),F.current&&(i==null||i(z,fe),be==null||be(fe),$.current=setTimeout(()=>{t==null||t(z,fe),Se==null||Se(fe),F.current=!1},150))},{passive:!1}):typeof N!="undefined"&&P.on("wheel.zoom",function(z,K){if(!m||S1(z,y))return null;z.preventDefault(),N.call(this,z,K)},{passive:!1}))},[M,s,l,P,A,N,H,r,m,y,e,i,t]),x.exports.useEffect(()=>{A&&A.on("start",z=>{var G,X;if(!z.sourceEvent||z.sourceEvent.internal)return null;B.current=(G=z.sourceEvent)==null?void 0:G.button;const{onViewportChangeStart:K}=D.getState(),j=ON(z.transform);E.current=!0,R.current=j,((X=z.sourceEvent)==null?void 0:X.type)==="mousedown"&&D.setState({paneDragging:!0}),K==null||K(j),e==null||e(z.sourceEvent,j)})},[A,e]),x.exports.useEffect(()=>{A&&(M&&!E.current?A.on("zoom",null):M||A.on("zoom",z=>{var j,G;const{onViewportChange:K}=D.getState();if(D.setState({transform:[z.transform.x,z.transform.y,z.transform.k]}),I.current=!!(n&&rte(d,(j=B.current)!=null?j:0)),(i||K)&&!((G=z.sourceEvent)!=null&&G.internal)){const X=ON(z.transform);K==null||K(X),i==null||i(z.sourceEvent,X)}}))},[M,A,i,d,n]),x.exports.useEffect(()=>{A&&A.on("end",z=>{var j;if(!z.sourceEvent||z.sourceEvent.internal)return null;const{onViewportChangeEnd:K}=D.getState();if(E.current=!1,D.setState({paneDragging:!1}),n&&rte(d,(j=B.current)!=null?j:0)&&!I.current&&n(z.sourceEvent),I.current=!1,(t||K)&&L4e(R.current,z.transform)){const G=ON(z.transform);R.current=G,clearTimeout(L.current),L.current=setTimeout(()=>{K==null||K(G),t==null||t(z.sourceEvent,G)},s?150:0)}})},[A,s,d,t,n]),x.exports.useEffect(()=>{A&&A.filter(z=>{const K=H||o,j=r&&z.ctrlKey;if((d===!0||Array.isArray(d)&&d.includes(1))&&z.button===1&&z.type==="mousedown"&&(S1(z,"react-flow__node")||S1(z,"react-flow__edge")))return!0;if(!d&&!K&&!s&&!c&&!r||M||!c&&z.type==="dblclick"||S1(z,y)&&z.type==="wheel"||S1(z,w)&&(z.type!=="wheel"||s&&z.type==="wheel"&&!H)||!r&&z.ctrlKey&&z.type==="wheel"||!K&&!s&&!j&&z.type==="wheel"||!d&&(z.type==="mousedown"||z.type==="touchstart")||Array.isArray(d)&&!d.includes(z.button)&&(z.type==="mousedown"||z.type==="touchstart"))return!1;const G=Array.isArray(d)&&d.includes(z.button)||!z.button||z.button<=1;return(!z.ctrlKey||z.type==="wheel")&&G})},[M,A,o,r,s,c,d,u,H]),he("div",{className:"react-flow__renderer",ref:k,style:vK,children:_})},k4e=i=>({userSelectionActive:i.userSelectionActive,userSelectionRect:i.userSelectionRect});function I4e(){const{userSelectionActive:i,userSelectionRect:e}=mo(k4e,Hs);return i&&e?he("div",{className:"react-flow__selection react-flow__container",style:{width:e.width,height:e.height,transform:`translate(${e.x}px, ${e.y}px)`}}):null}function ate(i,e){var n,o;const t=i.find(r=>r.id===e.parentNode);if(t){const r=e.position.x+e.width-t.width,s=e.position.y+e.height-t.height;if(r>0||s>0||e.position.x<0||e.position.y<0){if(t.style={...t.style},t.style.width=(n=t.style.width)!=null?n:t.width,t.style.height=(o=t.style.height)!=null?o:t.height,r>0&&(t.style.width+=r),s>0&&(t.style.height+=s),e.position.x<0){const a=Math.abs(e.position.x);t.position.x=t.position.x-a,t.style.width+=a,e.position.x=0}if(e.position.y<0){const a=Math.abs(e.position.y);t.position.y=t.position.y-a,t.style.height+=a,e.position.y=0}t.width=t.style.width,t.height=t.style.height}}}function Ofe(i,e){if(i.some(n=>n.type==="reset"))return i.filter(n=>n.type==="reset").map(n=>n.item);const t=i.filter(n=>n.type==="add").map(n=>n.item);return e.reduce((n,o)=>{const r=i.filter(a=>a.id===o.id);if(r.length===0)return n.push(o),n;const s={...o};for(const a of r)if(a)switch(a.type){case"select":{s.selected=a.selected;break}case"position":{typeof a.position!="undefined"&&(s.position=a.position),typeof a.positionAbsolute!="undefined"&&(s.positionAbsolute=a.positionAbsolute),typeof a.dragging!="undefined"&&(s.dragging=a.dragging),s.expandParent&&ate(n,s);break}case"dimensions":{typeof a.dimensions!="undefined"&&(s.width=a.dimensions.width,s.height=a.dimensions.height),typeof a.updateStyle!="undefined"&&(s.style={...s.style||{},...a.dimensions}),typeof a.resizing=="boolean"&&(s.resizing=a.resizing),s.expandParent&&ate(n,s);break}case"remove":return n}return n.push(s),n},t)}function Ffe(i,e){return Ofe(i,e)}function T4e(i,e){return Ofe(i,e)}const em=(i,e)=>({id:i,type:"select",selected:e});function wC(i,e){return i.reduce((t,n)=>{const o=e.includes(n.id);return!n.selected&&o?(n.selected=!0,t.push(em(n.id,!0))):n.selected&&!o&&(n.selected=!1,t.push(em(n.id,!1))),t},[])}const V8=(i,e)=>t=>{t.target===e.current&&(i==null||i(t))},N4e=i=>({userSelectionActive:i.userSelectionActive,elementsSelectable:i.elementsSelectable,dragging:i.paneDragging}),Bfe=x.exports.memo(({isSelecting:i,selectionMode:e=aD.Full,panOnDrag:t,onSelectionStart:n,onSelectionEnd:o,onPaneClick:r,onPaneContextMenu:s,onPaneScroll:a,onPaneMouseEnter:l,onPaneMouseMove:c,onPaneMouseLeave:u,children:d})=>{const h=x.exports.useRef(null),f=cs(),g=x.exports.useRef(0),p=x.exports.useRef(0),v=x.exports.useRef(),{userSelectionActive:m,elementsSelectable:_,dragging:y}=mo(N4e,Hs),w=()=>{f.setState({userSelectionActive:!1,userSelectionRect:null}),g.current=0,p.current=0},L=N=>{r==null||r(N),f.getState().resetSelectedElements(),f.setState({nodesSelectionActive:!1})},D=N=>{if(Array.isArray(t)&&(t==null?void 0:t.includes(2))){N.preventDefault();return}s==null||s(N)},E=a?N=>a(N):void 0,I=N=>{const{resetSelectedElements:M,domNode:H}=f.getState();if(v.current=H==null?void 0:H.getBoundingClientRect(),!_||!i||N.button!==0||N.target!==h.current||!v.current)return;const{x:B,y:F}=$m(N,v.current);M(),f.setState({userSelectionRect:{width:0,height:0,startX:B,startY:F,x:B,y:F}}),n==null||n(N)},k=N=>{var De,ce;const{userSelectionRect:M,nodeInternals:H,edges:B,transform:F,onNodesChange:$,onEdgesChange:z,nodeOrigin:K,getNodes:j}=f.getState();if(!i||!v.current||!M)return;f.setState({userSelectionActive:!0,nodesSelectionActive:!1});const G=$m(N,v.current),X=(De=M.startX)!=null?De:0,de=(ce=M.startY)!=null?ce:0,fe={...M,x:G.xPe.id),Fe=be.map(Pe=>Pe.id);if(g.current!==Fe.length){g.current=Fe.length;const Pe=wC(pe,Fe);Pe.length&&($==null||$(Pe))}if(p.current!==Se.length){p.current=Se.length;const Pe=wC(B,Se);Pe.length&&(z==null||z(Pe))}f.setState({userSelectionRect:fe})},R=N=>{if(N.button!==0)return;const{userSelectionRect:M}=f.getState();!m&&M&&N.target===h.current&&(L==null||L(N)),f.setState({nodesSelectionActive:g.current>0}),w(),o==null||o(N)},A=N=>{m&&(f.setState({nodesSelectionActive:g.current>0}),o==null||o(N)),w()},P=_&&(i||m);return fn("div",{className:fa(["react-flow__pane",{dragging:y,selection:i}]),onClick:P?void 0:V8(L,h),onContextMenu:V8(D,h),onWheel:V8(E,h),onMouseEnter:P?void 0:l,onMouseDown:P?I:void 0,onMouseMove:P?k:c,onMouseUp:P?R:void 0,onMouseLeave:P?A:u,ref:h,style:vK,children:[d,he(I4e,{})]})});Bfe.displayName="Pane";function Wfe(i,e){if(!i.parentNode)return!1;const t=e.get(i.parentNode);return t?t.selected?!0:Wfe(t,e):!1}function lte(i,e,t){let n=i;do{if(n!=null&&n.matches(e))return!0;if(n===t.current)return!1;n=n.parentElement}while(n);return!1}function R4e(i,e,t,n){return Array.from(i.values()).filter(o=>(o.selected||o.id===n)&&(!o.parentNode||!Wfe(o,i))&&(o.draggable||e&&typeof o.draggable=="undefined")).map(o=>{var r,s,a,l;return{id:o.id,position:o.position||{x:0,y:0},positionAbsolute:o.positionAbsolute||{x:0,y:0},distance:{x:t.x-((s=(r=o.positionAbsolute)==null?void 0:r.x)!=null?s:0),y:t.y-((l=(a=o.positionAbsolute)==null?void 0:a.y)!=null?l:0)},delta:{x:0,y:0},extent:o.extent,parentNode:o.parentNode,width:o.width,height:o.height,expandParent:o.expandParent}})}function M4e(i,e){return!e||e==="parent"?e:[e[0],[e[1][0]-(i.width||0),e[1][1]-(i.height||0)]]}function Vfe(i,e,t,n,o=[0,0],r){const s=M4e(i,i.extent||n);let a=s;if(i.extent==="parent"&&!i.expandParent)if(i.parentNode&&i.width&&i.height){const u=t.get(i.parentNode),{x:d,y:h}=w0(u,o).positionAbsolute;a=u&&yu(d)&&yu(h)&&yu(u.width)&&yu(u.height)?[[d+i.width*o[0],h+i.height*o[1]],[d+u.width-i.width+i.width*o[0],h+u.height-i.height+i.height*o[1]]]:a}else r==null||r("005",np.error005()),a=s;else if(i.extent&&i.parentNode&&i.extent!=="parent"){const u=t.get(i.parentNode),{x:d,y:h}=w0(u,o).positionAbsolute;a=[[i.extent[0][0]+d,i.extent[0][1]+h],[i.extent[1][0]+d,i.extent[1][1]+h]]}let l={x:0,y:0};if(i.parentNode){const u=t.get(i.parentNode);l=w0(u,o).positionAbsolute}const c=a&&a!=="parent"?cK(e,a):e;return{position:{x:c.x-l.x,y:c.y-l.y},positionAbsolute:c}}function H8({nodeId:i,dragItems:e,nodeInternals:t}){const n=e.map(o=>({...t.get(o.id),position:o.position,positionAbsolute:o.positionAbsolute}));return[i?n.find(o=>o.id===i):n[0],n]}const cte=(i,e,t,n)=>{const o=e.querySelectorAll(i);if(!o||!o.length)return null;const r=Array.from(o),s=e.getBoundingClientRect(),a={x:s.width*n[0],y:s.height*n[1]};return r.map(l=>{const c=l.getBoundingClientRect();return{id:l.getAttribute("data-handleid"),position:l.getAttribute("data-handlepos"),x:(c.left-s.left-a.x)/t,y:(c.top-s.top-a.y)/t,...lK(l)}})};function bx(i,e,t){return t===void 0?t:n=>{const o=e().nodeInternals.get(i);o&&t(n,{...o})}}function VB({id:i,store:e,unselect:t=!1,nodeRef:n}){const{addSelectedNodes:o,unselectNodesAndEdges:r,multiSelectionActive:s,nodeInternals:a,onError:l}=e.getState(),c=a.get(i);if(!c){l==null||l("012",np.error012(i));return}e.setState({nodesSelectionActive:!1}),c.selected?(t||c.selected&&s)&&(r({nodes:[c],edges:[]}),requestAnimationFrame(()=>{var u;return(u=n==null?void 0:n.current)==null?void 0:u.blur()})):o([i])}function A4e(){const i=cs();return x.exports.useCallback(({sourceEvent:t})=>{const{transform:n,snapGrid:o,snapToGrid:r}=i.getState(),s=t.touches?t.touches[0].clientX:t.clientX,a=t.touches?t.touches[0].clientY:t.clientY,l={x:(s-n[0])/n[2],y:(a-n[1])/n[2]};return{xSnapped:r?o[0]*Math.round(l.x/o[0]):l.x,ySnapped:r?o[1]*Math.round(l.y/o[1]):l.y,...l}},[])}function $8(i){return(e,t,n)=>i==null?void 0:i(e,n)}function Hfe({nodeRef:i,disabled:e=!1,noDragClassName:t,handleSelector:n,nodeId:o,isSelectable:r,selectNodesOnDrag:s}){const a=cs(),[l,c]=x.exports.useState(!1),u=x.exports.useRef([]),d=x.exports.useRef({x:null,y:null}),h=x.exports.useRef(0),f=x.exports.useRef(null),g=x.exports.useRef({x:0,y:0}),p=x.exports.useRef(null),v=x.exports.useRef(!1),m=x.exports.useRef(!1),_=A4e();return x.exports.useEffect(()=>{if(i!=null&&i.current){const y=bu(i.current),w=({x:E,y:I})=>{const{nodeInternals:k,onNodeDrag:R,onSelectionDrag:A,updateNodePositions:P,nodeExtent:N,snapGrid:M,snapToGrid:H,nodeOrigin:B,onError:F}=a.getState();d.current={x:E,y:I};let $=!1,z={x:0,y:0,x2:0,y2:0};if(u.current.length>1&&N){const j=r4(u.current,B);z=sD(j)}if(u.current=u.current.map(j=>{var fe,pe;const G={x:E-j.distance.x,y:I-j.distance.y};H&&(G.x=M[0]*Math.round(G.x/M[0]),G.y=M[1]*Math.round(G.y/M[1]));const X=[[N[0][0],N[0][1]],[N[1][0],N[1][1]]];u.current.length>1&&N&&!j.extent&&(X[0][0]=j.positionAbsolute.x-z.x+N[0][0],X[1][0]=j.positionAbsolute.x+((fe=j.width)!=null?fe:0)-z.x2+N[1][0],X[0][1]=j.positionAbsolute.y-z.y+N[0][1],X[1][1]=j.positionAbsolute.y+((pe=j.height)!=null?pe:0)-z.y2+N[1][1]);const de=Vfe(j,G,k,X,B,F);return $=$||j.position.x!==de.position.x||j.position.y!==de.position.y,j.position=de.position,j.positionAbsolute=de.positionAbsolute,j}),!$)return;P(u.current,!0,!0),c(!0);const K=o?R:$8(A);if(K&&p.current){const[j,G]=H8({nodeId:o,dragItems:u.current,nodeInternals:k});K(p.current,j,G)}},L=()=>{var k,R;if(!f.current)return;const[E,I]=sfe(g.current,f.current);if(E!==0||I!==0){const{transform:A,panBy:P}=a.getState();d.current.x=((k=d.current.x)!=null?k:0)-E/A[2],d.current.y=((R=d.current.y)!=null?R:0)-I/A[2],P({x:E,y:I})&&w(d.current)}h.current=requestAnimationFrame(L)},D=E=>{var B;const{nodeInternals:I,multiSelectionActive:k,nodesDraggable:R,unselectNodesAndEdges:A,onNodeDragStart:P,onSelectionDragStart:N}=a.getState();m.current=!0;const M=o?P:$8(N);(!s||!r)&&!k&&o&&((B=I.get(o))!=null&&B.selected||A()),o&&r&&s&&VB({id:o,store:a,nodeRef:i});const H=_(E);if(d.current=H,u.current=R4e(I,R,H,o),M&&u.current){const[F,$]=H8({nodeId:o,dragItems:u.current,nodeInternals:I});M(E.sourceEvent,F,$)}};if(e)y.on(".drag",null);else{const E=zAe().on("start",I=>{const{domNode:k,nodeDragThreshold:R}=a.getState();R===0&&D(I);const A=_(I);d.current=A,f.current=(k==null?void 0:k.getBoundingClientRect())||null,g.current=$m(I.sourceEvent,f.current)}).on("drag",I=>{var P,N,M,H;const k=_(I),{autoPanOnNodeDrag:R,nodeDragThreshold:A}=a.getState();if(!v.current&&m.current&&R&&(v.current=!0,L()),!m.current){const B=k.xSnapped-((N=(P=d==null?void 0:d.current)==null?void 0:P.x)!=null?N:0),F=k.ySnapped-((H=(M=d==null?void 0:d.current)==null?void 0:M.y)!=null?H:0);Math.sqrt(B*B+F*F)>A&&D(I)}(d.current.x!==k.xSnapped||d.current.y!==k.ySnapped)&&u.current&&m.current&&(p.current=I.sourceEvent,g.current=$m(I.sourceEvent,f.current),w(k))}).on("end",I=>{if(!!m.current&&(c(!1),v.current=!1,m.current=!1,cancelAnimationFrame(h.current),u.current)){const{updateNodePositions:k,nodeInternals:R,onNodeDragStop:A,onSelectionDragStop:P}=a.getState(),N=o?A:$8(P);if(k(u.current,!1,!1),N){const[M,H]=H8({nodeId:o,dragItems:u.current,nodeInternals:R});N(I.sourceEvent,M,H)}}}).filter(I=>{const k=I.target;return!I.button&&(!t||!lte(k,`.${t}`,i))&&(!n||lte(k,n,i))});return y.call(E),()=>{y.on(".drag",null)}}}},[i,e,t,n,r,a,o,s,_]),l}function $fe(){const i=cs();return x.exports.useCallback(t=>{const{nodeInternals:n,nodeExtent:o,updateNodePositions:r,getNodes:s,snapToGrid:a,snapGrid:l,onError:c,nodesDraggable:u}=i.getState(),d=s().filter(_=>_.selected&&(_.draggable||u&&typeof _.draggable=="undefined")),h=a?l[0]:5,f=a?l[1]:5,g=t.isShiftPressed?4:1,p=t.x*h*g,v=t.y*f*g,m=d.map(_=>{if(_.positionAbsolute){const y={x:_.positionAbsolute.x+p,y:_.positionAbsolute.y+v};a&&(y.x=l[0]*Math.round(y.x/l[0]),y.y=l[1]*Math.round(y.y/l[1]));const{positionAbsolute:w,position:L}=Vfe(_,y,n,o,void 0,c);_.position=L,_.positionAbsolute=w}return _});r(m,!0,!1)},[])}const dy={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};var Cx=i=>{const e=({id:t,type:n,data:o,xPos:r,yPos:s,xPosOrigin:a,yPosOrigin:l,selected:c,onClick:u,onMouseEnter:d,onMouseMove:h,onMouseLeave:f,onContextMenu:g,onDoubleClick:p,style:v,className:m,isDraggable:_,isSelectable:y,isConnectable:w,isFocusable:L,selectNodesOnDrag:D,sourcePosition:E,targetPosition:I,hidden:k,resizeObserver:R,dragHandle:A,zIndex:P,isParent:N,noDragClassName:M,noPanClassName:H,initialized:B,disableKeyboardA11y:F,ariaLabel:$,rfId:z})=>{const K=cs(),j=x.exports.useRef(null),G=x.exports.useRef(E),X=x.exports.useRef(I),de=x.exports.useRef(n),fe=y||_||u||d||h||f,pe=$fe(),be=bx(t,K.getState,d),Se=bx(t,K.getState,h),Fe=bx(t,K.getState,f),De=bx(t,K.getState,g),ce=bx(t,K.getState,p),Pe=Ee=>{const{nodeDragThreshold:tt}=K.getState();if(y&&(!D||!_||tt>0)&&VB({id:t,store:K,nodeRef:j}),u){const nt=K.getState().nodeInternals.get(t);nt&&u(Ee,{...nt})}},Oe=Ee=>{if(!AB(Ee))if(ufe.includes(Ee.key)&&y){const tt=Ee.key==="Escape";VB({id:t,store:K,unselect:tt,nodeRef:j})}else!F&&_&&c&&Object.prototype.hasOwnProperty.call(dy,Ee.key)&&(K.setState({ariaLiveMessage:`Moved selected node ${Ee.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~r}, y: ${~~s}`}),pe({x:dy[Ee.key].x,y:dy[Ee.key].y,isShiftPressed:Ee.shiftKey}))};x.exports.useEffect(()=>{if(j.current&&!k){const Ee=j.current;return R==null||R.observe(Ee),()=>R==null?void 0:R.unobserve(Ee)}},[k]),x.exports.useEffect(()=>{const Ee=de.current!==n,tt=G.current!==E,nt=X.current!==I;j.current&&(Ee||tt||nt)&&(Ee&&(de.current=n),tt&&(G.current=E),nt&&(X.current=I),K.getState().updateNodeDimensions([{id:t,nodeElement:j.current,forceUpdate:!0}]))},[t,n,E,I]);const xe=Hfe({nodeRef:j,disabled:k||!_,noDragClassName:M,handleSelector:A,nodeId:t,isSelectable:y,selectNodesOnDrag:D});return k?null:he("div",{className:fa(["react-flow__node",`react-flow__node-${n}`,{[H]:_},m,{selected:c,selectable:y,parent:N,dragging:xe}]),ref:j,style:{zIndex:P,transform:`translate(${a}px,${l}px)`,pointerEvents:fe?"all":"none",visibility:B?"visible":"hidden",...v},"data-id":t,"data-testid":`rf__node-${t}`,onMouseEnter:be,onMouseMove:Se,onMouseLeave:Fe,onContextMenu:De,onClick:Pe,onDoubleClick:ce,onKeyDown:L?Oe:void 0,tabIndex:L?0:void 0,role:L?"button":void 0,"aria-describedby":F?void 0:`${Nfe}-${z}`,"aria-label":$,children:he(YOe,{value:t,children:he(i,{id:t,data:o,type:n,xPos:r,yPos:s,selected:c,isConnectable:w,sourcePosition:E,targetPosition:I,dragging:xe,dragHandle:A,zIndex:P})})})};return e.displayName="NodeWrapper",x.exports.memo(e)};const P4e=i=>{const e=i.getNodes().filter(t=>t.selected);return{...r4(e,i.nodeOrigin),transformString:`translate(${i.transform[0]}px,${i.transform[1]}px) scale(${i.transform[2]})`,userSelectionActive:i.userSelectionActive}};function O4e({onSelectionContextMenu:i,noPanClassName:e,disableKeyboardA11y:t}){const n=cs(),{width:o,height:r,x:s,y:a,transformString:l,userSelectionActive:c}=mo(P4e,Hs),u=$fe(),d=x.exports.useRef(null);if(x.exports.useEffect(()=>{var g;t||(g=d.current)==null||g.focus({preventScroll:!0})},[t]),Hfe({nodeRef:d}),c||!o||!r)return null;const h=i?g=>{const p=n.getState().getNodes().filter(v=>v.selected);i(g,p)}:void 0,f=g=>{Object.prototype.hasOwnProperty.call(dy,g.key)&&u({x:dy[g.key].x,y:dy[g.key].y,isShiftPressed:g.shiftKey})};return he("div",{className:fa(["react-flow__nodesselection","react-flow__container",e]),style:{transform:l},children:he("div",{ref:d,className:"react-flow__nodesselection-rect",onContextMenu:h,tabIndex:t?void 0:-1,onKeyDown:t?void 0:f,style:{width:o,height:r,top:a,left:s}})})}var F4e=x.exports.memo(O4e);const B4e=i=>i.nodesSelectionActive,zfe=({children:i,onPaneClick:e,onPaneMouseEnter:t,onPaneMouseMove:n,onPaneMouseLeave:o,onPaneContextMenu:r,onPaneScroll:s,deleteKeyCode:a,onMove:l,onMoveStart:c,onMoveEnd:u,selectionKeyCode:d,selectionOnDrag:h,selectionMode:f,onSelectionStart:g,onSelectionEnd:p,multiSelectionKeyCode:v,panActivationKeyCode:m,zoomActivationKeyCode:_,elementsSelectable:y,zoomOnScroll:w,zoomOnPinch:L,panOnScroll:D,panOnScrollSpeed:E,panOnScrollMode:I,zoomOnDoubleClick:k,panOnDrag:R,defaultViewport:A,translateExtent:P,minZoom:N,maxZoom:M,preventScrolling:H,onSelectionContextMenu:B,noWheelClassName:F,noPanClassName:$,disableKeyboardA11y:z})=>{const K=mo(B4e),j=cD(d),G=cD(m),X=G||R,de=G||D,fe=j||h&&X!==!0;return S4e({deleteKeyCode:a,multiSelectionKeyCode:v}),he(D4e,{onMove:l,onMoveStart:c,onMoveEnd:u,onPaneContextMenu:r,elementsSelectable:y,zoomOnScroll:w,zoomOnPinch:L,panOnScroll:de,panOnScrollSpeed:E,panOnScrollMode:I,zoomOnDoubleClick:k,panOnDrag:!j&&X,defaultViewport:A,translateExtent:P,minZoom:N,maxZoom:M,zoomActivationKeyCode:_,preventScrolling:H,noWheelClassName:F,noPanClassName:$,children:fn(Bfe,{onSelectionStart:g,onSelectionEnd:p,onPaneClick:e,onPaneMouseEnter:t,onPaneMouseMove:n,onPaneMouseLeave:o,onPaneContextMenu:r,onPaneScroll:s,panOnDrag:X,isSelecting:!!fe,selectionMode:f,children:[i,K&&he(F4e,{onSelectionContextMenu:B,noPanClassName:$,disableKeyboardA11y:z})]})})};zfe.displayName="FlowRenderer";var W4e=x.exports.memo(zfe);function V4e(i){return mo(x.exports.useCallback(t=>i?_fe(t.nodeInternals,{x:0,y:0,width:t.width,height:t.height},t.transform,!0):t.getNodes(),[i]))}function H4e(i){const e={input:Cx(i.input||Dfe),default:Cx(i.default||WB),output:Cx(i.output||Ife),group:Cx(i.group||pK)},t={},n=Object.keys(i).filter(o=>!["input","default","output","group"].includes(o)).reduce((o,r)=>(o[r]=Cx(i[r]||WB),o),t);return{...e,...n}}const $4e=({x:i,y:e,width:t,height:n,origin:o})=>!t||!n?{x:i,y:e}:o[0]<0||o[1]<0||o[0]>1||o[1]>1?{x:i,y:e}:{x:i-t*o[0],y:e-n*o[1]},z4e=i=>({nodesDraggable:i.nodesDraggable,nodesConnectable:i.nodesConnectable,nodesFocusable:i.nodesFocusable,elementsSelectable:i.elementsSelectable,updateNodeDimensions:i.updateNodeDimensions,onError:i.onError}),Ufe=i=>{const{nodesDraggable:e,nodesConnectable:t,nodesFocusable:n,elementsSelectable:o,updateNodeDimensions:r,onError:s}=mo(z4e,Hs),a=V4e(i.onlyRenderVisibleElements),l=x.exports.useRef(),c=x.exports.useMemo(()=>{if(typeof ResizeObserver=="undefined")return null;const u=new ResizeObserver(d=>{const h=d.map(f=>({id:f.target.getAttribute("data-id"),nodeElement:f.target,forceUpdate:!0}));r(h)});return l.current=u,u},[]);return x.exports.useEffect(()=>()=>{var u;(u=l==null?void 0:l.current)==null||u.disconnect()},[]),he("div",{className:"react-flow__nodes",style:vK,children:a.map(u=>{var L,D,E,I,k,R,A;let d=u.type||"default";i.nodeTypes[d]||(s==null||s("003",np.error003(d)),d="default");const h=i.nodeTypes[d]||i.nodeTypes.default,f=!!(u.draggable||e&&typeof u.draggable=="undefined"),g=!!(u.selectable||o&&typeof u.selectable=="undefined"),p=!!(u.connectable||t&&typeof u.connectable=="undefined"),v=!!(u.focusable||n&&typeof u.focusable=="undefined"),m=i.nodeExtent?cK(u.positionAbsolute,i.nodeExtent):u.positionAbsolute,_=(L=m==null?void 0:m.x)!=null?L:0,y=(D=m==null?void 0:m.y)!=null?D:0,w=$4e({x:_,y,width:(E=u.width)!=null?E:0,height:(I=u.height)!=null?I:0,origin:i.nodeOrigin});return he(h,{id:u.id,className:u.className,style:u.style,type:d,data:u.data,sourcePosition:u.sourcePosition||mn.Bottom,targetPosition:u.targetPosition||mn.Top,hidden:u.hidden,xPos:_,yPos:y,xPosOrigin:w.x,yPosOrigin:w.y,selectNodesOnDrag:i.selectNodesOnDrag,onClick:i.onNodeClick,onMouseEnter:i.onNodeMouseEnter,onMouseMove:i.onNodeMouseMove,onMouseLeave:i.onNodeMouseLeave,onContextMenu:i.onNodeContextMenu,onDoubleClick:i.onNodeDoubleClick,selected:!!u.selected,isDraggable:f,isSelectable:g,isConnectable:p,isFocusable:v,resizeObserver:c,dragHandle:u.dragHandle,zIndex:(R=(k=u[ys])==null?void 0:k.z)!=null?R:0,isParent:!!((A=u[ys])!=null&&A.isParent),noDragClassName:i.noDragClassName,noPanClassName:i.noPanClassName,initialized:!!u.width&&!!u.height,rfId:i.rfId,disableKeyboardA11y:i.disableKeyboardA11y,ariaLabel:u.ariaLabel},u.id)})})};Ufe.displayName="NodeRenderer";var U4e=x.exports.memo(Ufe);const j4e=(i,e,t)=>t===mn.Left?i-e:t===mn.Right?i+e:i,K4e=(i,e,t)=>t===mn.Top?i-e:t===mn.Bottom?i+e:i,ute="react-flow__edgeupdater",dte=({position:i,centerX:e,centerY:t,radius:n=10,onMouseDown:o,onMouseEnter:r,onMouseOut:s,type:a})=>he("circle",{onMouseDown:o,onMouseEnter:r,onMouseOut:s,className:fa([ute,`${ute}-${a}`]),cx:j4e(e,n,i),cy:K4e(t,n,i),r:n,stroke:"transparent",fill:"transparent"}),q4e=()=>!0;var x1=i=>{const e=({id:t,className:n,type:o,data:r,onClick:s,onEdgeDoubleClick:a,selected:l,animated:c,label:u,labelStyle:d,labelShowBg:h,labelBgStyle:f,labelBgPadding:g,labelBgBorderRadius:p,style:v,source:m,target:_,sourceX:y,sourceY:w,targetX:L,targetY:D,sourcePosition:E,targetPosition:I,elementsSelectable:k,hidden:R,sourceHandleId:A,targetHandleId:P,onContextMenu:N,onMouseEnter:M,onMouseMove:H,onMouseLeave:B,edgeUpdaterRadius:F,onEdgeUpdate:$,onEdgeUpdateStart:z,onEdgeUpdateEnd:K,markerEnd:j,markerStart:G,rfId:X,ariaLabel:de,isFocusable:fe,isUpdatable:pe,pathOptions:be,interactionWidth:Se})=>{const Fe=x.exports.useRef(null),[De,ce]=x.exports.useState(!1),[Pe,Oe]=x.exports.useState(!1),xe=cs(),Ee=x.exports.useMemo(()=>`url(#${FB(G,X)})`,[G,X]),tt=x.exports.useMemo(()=>`url(#${FB(j,X)})`,[j,X]);if(R)return null;const nt=We=>{var Lt;const{edges:je,addSelectedEdges:mt,unselectNodesAndEdges:Dt,multiSelectionActive:At}=xe.getState(),Je=je.find(Ot=>Ot.id===t);!Je||(k&&(xe.setState({nodesSelectionActive:!1}),Je.selected&&At?(Dt({nodes:[],edges:[Je]}),(Lt=Fe.current)==null||Lt.blur()):mt([t])),s&&s(We,Je))},Qe=_x(t,xe.getState,a),Ge=_x(t,xe.getState,N),re=_x(t,xe.getState,M),ie=_x(t,xe.getState,H),se=_x(t,xe.getState,B),U=(We,je)=>{if(We.button!==0)return;const{edges:mt,isValidConnection:Dt}=xe.getState(),At=je?_:m,Je=(je?P:A)||null,Lt=je?"target":"source",Ot=Dt||q4e,Vn=je,Et=mt.find(cn=>cn.id===t);Oe(!0),z==null||z(We,Et,Lt);const tn=cn=>{Oe(!1),K==null||K(cn,Et,Lt)};Sfe({event:We,handleId:Je,nodeId:At,onConnect:cn=>$==null?void 0:$(Et,cn),isTarget:Vn,getState:xe.getState,setState:xe.setState,isValidConnection:Ot,edgeUpdaterType:Lt,onEdgeUpdateEnd:tn})},Y=We=>U(We,!0),oe=We=>U(We,!1),te=()=>ce(!0),ye=()=>ce(!1),Le=!k&&!s,Te=We=>{var je;if(ufe.includes(We.key)&&k){const{unselectNodesAndEdges:mt,addSelectedEdges:Dt,edges:At}=xe.getState();We.key==="Escape"?((je=Fe.current)==null||je.blur(),mt({edges:[At.find(Lt=>Lt.id===t)]})):Dt([t])}};return fn("g",{className:fa(["react-flow__edge",`react-flow__edge-${o}`,n,{selected:l,animated:c,inactive:Le,updating:De}]),onClick:nt,onDoubleClick:Qe,onContextMenu:Ge,onMouseEnter:re,onMouseMove:ie,onMouseLeave:se,onKeyDown:fe?Te:void 0,tabIndex:fe?0:void 0,role:fe?"button":"img","data-testid":`rf__edge-${t}`,"aria-label":de===null?void 0:de||`Edge from ${m} to ${_}`,"aria-describedby":fe?`${Rfe}-${X}`:void 0,ref:Fe,children:[!Pe&&he(i,{id:t,source:m,target:_,selected:l,animated:c,label:u,labelStyle:d,labelShowBg:h,labelBgStyle:f,labelBgPadding:g,labelBgBorderRadius:p,data:r,style:v,sourceX:y,sourceY:w,targetX:L,targetY:D,sourcePosition:E,targetPosition:I,sourceHandleId:A,targetHandleId:P,markerStart:Ee,markerEnd:tt,pathOptions:be,interactionWidth:Se}),pe&&fn(ks,{children:[(pe==="source"||pe===!0)&&he(dte,{position:E,centerX:y,centerY:w,radius:F,onMouseDown:Y,onMouseEnter:te,onMouseOut:ye,type:"source"}),(pe==="target"||pe===!0)&&he(dte,{position:I,centerX:L,centerY:D,radius:F,onMouseDown:oe,onMouseEnter:te,onMouseOut:ye,type:"target"})]})]})};return e.displayName="EdgeWrapper",x.exports.memo(e)};function G4e(i){const e={default:x1(i.default||hA),straight:x1(i.bezier||hK),step:x1(i.step||dK),smoothstep:x1(i.step||o4),simplebezier:x1(i.simplebezier||uK)},t={},n=Object.keys(i).filter(o=>!["default","bezier"].includes(o)).reduce((o,r)=>(o[r]=x1(i[r]||hA),o),t);return{...e,...n}}function hte(i,e,t=null){const n=((t==null?void 0:t.x)||0)+e.x,o=((t==null?void 0:t.y)||0)+e.y,r=(t==null?void 0:t.width)||e.width,s=(t==null?void 0:t.height)||e.height;switch(i){case mn.Top:return{x:n+r/2,y:o};case mn.Right:return{x:n+r,y:o+s/2};case mn.Bottom:return{x:n+r/2,y:o+s};case mn.Left:return{x:n,y:o+s/2}}}function fte(i,e){return i?i.length===1||!e?i[0]:e&&i.find(t=>t.id===e)||null:null}const X4e=(i,e,t,n,o,r)=>{const s=hte(t,i,e),a=hte(r,n,o);return{sourceX:s.x,sourceY:s.y,targetX:a.x,targetY:a.y}};function Y4e({sourcePos:i,targetPos:e,sourceWidth:t,sourceHeight:n,targetWidth:o,targetHeight:r,width:s,height:a,transform:l}){const c={x:Math.min(i.x,e.x),y:Math.min(i.y,e.y),x2:Math.max(i.x+t,e.x+o),y2:Math.max(i.y+n,e.y+r)};c.x===c.x2&&(c.x2+=1),c.y===c.y2&&(c.y2+=1);const u=sD({x:(0-l[0])/l[2],y:(0-l[1])/l[2],width:s/l[2],height:a/l[2]}),d=Math.max(0,Math.min(u.x2,c.x2)-Math.max(u.x,c.x)),h=Math.max(0,Math.min(u.y2,c.y2)-Math.max(u.y,c.y));return Math.ceil(d*h)>0}function gte(i){var n,o,r,s,a;const e=((n=i==null?void 0:i[ys])==null?void 0:n.handleBounds)||null,t=e&&(i==null?void 0:i.width)&&(i==null?void 0:i.height)&&typeof((o=i==null?void 0:i.positionAbsolute)==null?void 0:o.x)!="undefined"&&typeof((r=i==null?void 0:i.positionAbsolute)==null?void 0:r.y)!="undefined";return[{x:((s=i==null?void 0:i.positionAbsolute)==null?void 0:s.x)||0,y:((a=i==null?void 0:i.positionAbsolute)==null?void 0:a.y)||0,width:(i==null?void 0:i.width)||0,height:(i==null?void 0:i.height)||0},e,!!t]}const Z4e=[{level:0,isMaxLevel:!0,edges:[]}];function Q4e(i,e,t=!1){let n=-1;const o=i.reduce((s,a)=>{var u,d;const l=yu(a.zIndex);let c=l?a.zIndex:0;if(t){const h=e.get(a.target),f=e.get(a.source),g=a.selected||(h==null?void 0:h.selected)||(f==null?void 0:f.selected),p=Math.max(((u=f==null?void 0:f[ys])==null?void 0:u.z)||0,((d=h==null?void 0:h[ys])==null?void 0:d.z)||0,1e3);c=(l?a.zIndex:0)+(g?p:0)}return s[c]?s[c].push(a):s[c]=[a],n=c>n?c:n,s},{}),r=Object.entries(o).map(([s,a])=>{const l=+s;return{edges:a,level:l,isMaxLevel:l===n}});return r.length===0?Z4e:r}function J4e(i,e,t){const n=mo(x.exports.useCallback(o=>i?o.edges.filter(r=>{const s=e.get(r.source),a=e.get(r.target);return(s==null?void 0:s.width)&&(s==null?void 0:s.height)&&(a==null?void 0:a.width)&&(a==null?void 0:a.height)&&Y4e({sourcePos:s.positionAbsolute||{x:0,y:0},targetPos:a.positionAbsolute||{x:0,y:0},sourceWidth:s.width,sourceHeight:s.height,targetWidth:a.width,targetHeight:a.height,width:o.width,height:o.height,transform:o.transform})}):o.edges,[i,e]));return Q4e(n,e,t)}const e5e=({color:i="none",strokeWidth:e=1})=>he("polyline",{style:{stroke:i,strokeWidth:e},strokeLinecap:"round",strokeLinejoin:"round",fill:"none",points:"-5,-4 0,0 -5,4"}),t5e=({color:i="none",strokeWidth:e=1})=>he("polyline",{style:{stroke:i,fill:i,strokeWidth:e},strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"}),pte={[dA.Arrow]:e5e,[dA.ArrowClosed]:t5e};function n5e(i){const e=cs();return x.exports.useMemo(()=>{var o,r;return Object.prototype.hasOwnProperty.call(pte,i)?pte[i]:((r=(o=e.getState()).onError)==null||r.call(o,"009",np.error009(i)),null)},[i])}const i5e=({id:i,type:e,color:t,width:n=12.5,height:o=12.5,markerUnits:r="strokeWidth",strokeWidth:s,orient:a="auto-start-reverse"})=>{const l=n5e(e);return l?he("marker",{className:"react-flow__arrowhead",id:i,markerWidth:`${n}`,markerHeight:`${o}`,viewBox:"-10 -10 20 20",markerUnits:r,orient:a,refX:"0",refY:"0",children:he(l,{color:t,strokeWidth:s})}):null},o5e=({defaultColor:i,rfId:e})=>t=>{const n=[];return t.edges.reduce((o,r)=>([r.markerStart,r.markerEnd].forEach(s=>{if(s&&typeof s=="object"){const a=FB(s,e);n.includes(a)||(o.push({id:a,color:s.color||i,...s}),n.push(a))}}),o),[]).sort((o,r)=>o.id.localeCompare(r.id))},jfe=({defaultColor:i,rfId:e})=>{const t=mo(x.exports.useCallback(o5e({defaultColor:i,rfId:e}),[i,e]),(n,o)=>!(n.length!==o.length||n.some((r,s)=>r.id!==o[s].id)));return he("defs",{children:t.map(n=>he(i5e,{id:n.id,type:n.type,color:n.color,width:n.width,height:n.height,markerUnits:n.markerUnits,strokeWidth:n.strokeWidth,orient:n.orient},n.id))})};jfe.displayName="MarkerDefinitions";var r5e=x.exports.memo(jfe);const s5e=i=>({nodesConnectable:i.nodesConnectable,edgesFocusable:i.edgesFocusable,edgesUpdatable:i.edgesUpdatable,elementsSelectable:i.elementsSelectable,width:i.width,height:i.height,connectionMode:i.connectionMode,nodeInternals:i.nodeInternals,onError:i.onError}),Kfe=({defaultMarkerColor:i,onlyRenderVisibleElements:e,elevateEdgesOnSelect:t,rfId:n,edgeTypes:o,noPanClassName:r,onEdgeUpdate:s,onEdgeContextMenu:a,onEdgeMouseEnter:l,onEdgeMouseMove:c,onEdgeMouseLeave:u,onEdgeClick:d,edgeUpdaterRadius:h,onEdgeDoubleClick:f,onEdgeUpdateStart:g,onEdgeUpdateEnd:p,children:v})=>{const{edgesFocusable:m,edgesUpdatable:_,elementsSelectable:y,width:w,height:L,connectionMode:D,nodeInternals:E,onError:I}=mo(s5e,Hs),k=J4e(e,E,t);return w?fn(ks,{children:[k.map(({level:R,edges:A,isMaxLevel:P})=>fn("svg",{style:{zIndex:R},width:w,height:L,className:"react-flow__edges react-flow__container",children:[P&&he(r5e,{defaultColor:i,rfId:n}),he("g",{children:A.map(N=>{var Oe,xe;const[M,H,B]=gte(E.get(N.source)),[F,$,z]=gte(E.get(N.target));if(!B||!z)return null;let K=N.type||"default";o[K]||(I==null||I("011",np.error011(K)),K="default");const j=o[K]||o.default,G=D===$0.Strict?$.target:((Oe=$.target)!=null?Oe:[]).concat((xe=$.source)!=null?xe:[]),X=fte(H.source,N.sourceHandle),de=fte(G,N.targetHandle),fe=(X==null?void 0:X.position)||mn.Bottom,pe=(de==null?void 0:de.position)||mn.Top,be=!!(N.focusable||m&&typeof N.focusable=="undefined"),Se=typeof s!="undefined"&&(N.updatable||_&&typeof N.updatable=="undefined");if(!X||!de)return I==null||I("008",np.error008(X,N)),null;const{sourceX:Fe,sourceY:De,targetX:ce,targetY:Pe}=X4e(M,X,fe,F,de,pe);return he(j,{id:N.id,className:fa([N.className,r]),type:K,data:N.data,selected:!!N.selected,animated:!!N.animated,hidden:!!N.hidden,label:N.label,labelStyle:N.labelStyle,labelShowBg:N.labelShowBg,labelBgStyle:N.labelBgStyle,labelBgPadding:N.labelBgPadding,labelBgBorderRadius:N.labelBgBorderRadius,style:N.style,source:N.source,target:N.target,sourceHandleId:N.sourceHandle,targetHandleId:N.targetHandle,markerEnd:N.markerEnd,markerStart:N.markerStart,sourceX:Fe,sourceY:De,targetX:ce,targetY:Pe,sourcePosition:fe,targetPosition:pe,elementsSelectable:y,onEdgeUpdate:s,onContextMenu:a,onMouseEnter:l,onMouseMove:c,onMouseLeave:u,onClick:d,edgeUpdaterRadius:h,onEdgeDoubleClick:f,onEdgeUpdateStart:g,onEdgeUpdateEnd:p,rfId:n,ariaLabel:N.ariaLabel,isFocusable:be,isUpdatable:Se,pathOptions:"pathOptions"in N?N.pathOptions:void 0,interactionWidth:N.interactionWidth},N.id)})})]},R)),v]}):null};Kfe.displayName="EdgeRenderer";var a5e=x.exports.memo(Kfe);const l5e=i=>`translate(${i.transform[0]}px,${i.transform[1]}px) scale(${i.transform[2]})`;function c5e({children:i}){const e=mo(l5e);return he("div",{className:"react-flow__viewport react-flow__container",style:{transform:e},children:i})}function u5e(i){const e=mK(),t=x.exports.useRef(!1);x.exports.useEffect(()=>{!t.current&&e.viewportInitialized&&i&&(setTimeout(()=>i(e),1),t.current=!0)},[i,e.viewportInitialized])}const d5e={[mn.Left]:mn.Right,[mn.Right]:mn.Left,[mn.Top]:mn.Bottom,[mn.Bottom]:mn.Top},qfe=({nodeId:i,handleType:e,style:t,type:n=sm.Bezier,CustomComponent:o,connectionStatus:r})=>{var D,E,I,k,R,A,P;const{fromNode:s,handleId:a,toX:l,toY:c,connectionMode:u}=mo(x.exports.useCallback(N=>({fromNode:N.nodeInternals.get(i),handleId:N.connectionHandleId,toX:(N.connectionPosition.x-N.transform[0])/N.transform[2],toY:(N.connectionPosition.y-N.transform[1])/N.transform[2],connectionMode:N.connectionMode}),[i]),Hs),d=(D=s==null?void 0:s[ys])==null?void 0:D.handleBounds;let h=d==null?void 0:d[e];if(u===$0.Loose&&(h=h||(d==null?void 0:d[e==="source"?"target":"source"])),!s||!h)return null;const f=a?h.find(N=>N.id===a):h[0],g=f?f.x+f.width/2:((E=s.width)!=null?E:0)/2,p=f?f.y+f.height/2:(I=s.height)!=null?I:0,v=((R=(k=s.positionAbsolute)==null?void 0:k.x)!=null?R:0)+g,m=((P=(A=s.positionAbsolute)==null?void 0:A.y)!=null?P:0)+p,_=f==null?void 0:f.position,y=_?d5e[_]:null;if(!_||!y)return null;if(o)return he(o,{connectionLineType:n,connectionLineStyle:t,fromNode:s,fromHandle:f,fromX:v,fromY:m,toX:l,toY:c,fromPosition:_,toPosition:y,connectionStatus:r});let w="";const L={sourceX:v,sourceY:m,sourcePosition:_,targetX:l,targetY:c,targetPosition:y};return n===sm.Bezier?[w]=pfe(L):n===sm.Step?[w]=PB({...L,borderRadius:0}):n===sm.SmoothStep?[w]=PB(L):n===sm.SimpleBezier?[w]=gfe(L):w=`M${v},${m} ${l},${c}`,he("path",{d:w,fill:"none",className:"react-flow__connection-path",style:t})};qfe.displayName="ConnectionLine";const h5e=i=>({nodeId:i.connectionNodeId,handleType:i.connectionHandleType,nodesConnectable:i.nodesConnectable,connectionStatus:i.connectionStatus,width:i.width,height:i.height});function f5e({containerStyle:i,style:e,type:t,component:n}){const{nodeId:o,handleType:r,nodesConnectable:s,width:a,height:l,connectionStatus:c}=mo(h5e,Hs);return!(o&&r&&a&&s)?null:he("svg",{style:i,width:a,height:l,className:"react-flow__edges react-flow__connectionline react-flow__container",children:he("g",{className:fa(["react-flow__connection",c]),children:he(qfe,{nodeId:o,handleType:r,style:e,type:t,CustomComponent:n,connectionStatus:c})})})}function mte(i,e){return x.exports.useRef(null),cs(),x.exports.useMemo(()=>e(i),[i])}const Gfe=({nodeTypes:i,edgeTypes:e,onMove:t,onMoveStart:n,onMoveEnd:o,onInit:r,onNodeClick:s,onEdgeClick:a,onNodeDoubleClick:l,onEdgeDoubleClick:c,onNodeMouseEnter:u,onNodeMouseMove:d,onNodeMouseLeave:h,onNodeContextMenu:f,onSelectionContextMenu:g,onSelectionStart:p,onSelectionEnd:v,connectionLineType:m,connectionLineStyle:_,connectionLineComponent:y,connectionLineContainerStyle:w,selectionKeyCode:L,selectionOnDrag:D,selectionMode:E,multiSelectionKeyCode:I,panActivationKeyCode:k,zoomActivationKeyCode:R,deleteKeyCode:A,onlyRenderVisibleElements:P,elementsSelectable:N,selectNodesOnDrag:M,defaultViewport:H,translateExtent:B,minZoom:F,maxZoom:$,preventScrolling:z,defaultMarkerColor:K,zoomOnScroll:j,zoomOnPinch:G,panOnScroll:X,panOnScrollSpeed:de,panOnScrollMode:fe,zoomOnDoubleClick:pe,panOnDrag:be,onPaneClick:Se,onPaneMouseEnter:Fe,onPaneMouseMove:De,onPaneMouseLeave:ce,onPaneScroll:Pe,onPaneContextMenu:Oe,onEdgeUpdate:xe,onEdgeContextMenu:Ee,onEdgeMouseEnter:tt,onEdgeMouseMove:nt,onEdgeMouseLeave:Qe,edgeUpdaterRadius:Ge,onEdgeUpdateStart:re,onEdgeUpdateEnd:ie,noDragClassName:se,noWheelClassName:U,noPanClassName:Y,elevateEdgesOnSelect:oe,disableKeyboardA11y:te,nodeOrigin:ye,nodeExtent:Le,rfId:Te})=>{const We=mte(i,H4e),je=mte(e,G4e);return u5e(r),he(W4e,{onPaneClick:Se,onPaneMouseEnter:Fe,onPaneMouseMove:De,onPaneMouseLeave:ce,onPaneContextMenu:Oe,onPaneScroll:Pe,deleteKeyCode:A,selectionKeyCode:L,selectionOnDrag:D,selectionMode:E,onSelectionStart:p,onSelectionEnd:v,multiSelectionKeyCode:I,panActivationKeyCode:k,zoomActivationKeyCode:R,elementsSelectable:N,onMove:t,onMoveStart:n,onMoveEnd:o,zoomOnScroll:j,zoomOnPinch:G,zoomOnDoubleClick:pe,panOnScroll:X,panOnScrollSpeed:de,panOnScrollMode:fe,panOnDrag:be,defaultViewport:H,translateExtent:B,minZoom:F,maxZoom:$,onSelectionContextMenu:g,preventScrolling:z,noDragClassName:se,noWheelClassName:U,noPanClassName:Y,disableKeyboardA11y:te,children:fn(c5e,{children:[he(a5e,{edgeTypes:je,onEdgeClick:a,onEdgeDoubleClick:c,onEdgeUpdate:xe,onlyRenderVisibleElements:P,onEdgeContextMenu:Ee,onEdgeMouseEnter:tt,onEdgeMouseMove:nt,onEdgeMouseLeave:Qe,onEdgeUpdateStart:re,onEdgeUpdateEnd:ie,edgeUpdaterRadius:Ge,defaultMarkerColor:K,noPanClassName:Y,elevateEdgesOnSelect:!!oe,disableKeyboardA11y:te,rfId:Te,children:he(f5e,{style:_,type:m,component:y,containerStyle:w})}),he("div",{className:"react-flow__edgelabel-renderer"}),he(U4e,{nodeTypes:We,onNodeClick:s,onNodeDoubleClick:l,onNodeMouseEnter:u,onNodeMouseMove:d,onNodeMouseLeave:h,onNodeContextMenu:f,selectNodesOnDrag:M,onlyRenderVisibleElements:P,noPanClassName:Y,noDragClassName:se,disableKeyboardA11y:te,nodeOrigin:ye,nodeExtent:Le,rfId:Te})]})})};Gfe.displayName="GraphView";var g5e=x.exports.memo(Gfe);const HB=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Ap={rfId:"1",width:0,height:0,transform:[0,0,1],nodeInternals:new Map,edges:[],onNodesChange:null,onEdgesChange:null,hasDefaultNodes:!1,hasDefaultEdges:!1,d3Zoom:null,d3Selection:null,d3ZoomHandler:void 0,minZoom:.5,maxZoom:2,translateExtent:HB,nodeExtent:HB,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionNodeId:null,connectionHandleId:null,connectionHandleType:"source",connectionPosition:{x:0,y:0},connectionStatus:null,connectionMode:$0.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:[0,0],nodeDragThreshold:0,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesUpdatable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,fitViewOnInit:!1,fitViewOnInitDone:!1,fitViewOnInitOptions:void 0,onSelectionChange:[],multiSelectionActive:!1,connectionStartHandle:null,connectionEndHandle:null,connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,connectionRadius:20,onError:UOe,isValidConnection:void 0},p5e=()=>tMe((i,e)=>({...Ap,setNodes:t=>{const{nodeInternals:n,nodeOrigin:o,elevateNodesOnSelect:r}=e();i({nodeInternals:W8(t,n,o,r)})},getNodes:()=>Array.from(e().nodeInternals.values()),setEdges:t=>{const{defaultEdgeOptions:n={}}=e();i({edges:t.map(o=>({...n,...o}))})},setDefaultNodesAndEdges:(t,n)=>{const o=typeof t!="undefined",r=typeof n!="undefined",s=o?W8(t,new Map,e().nodeOrigin,e().elevateNodesOnSelect):new Map;i({nodeInternals:s,edges:r?n:[],hasDefaultNodes:o,hasDefaultEdges:r})},updateNodeDimensions:t=>{const{onNodesChange:n,nodeInternals:o,fitViewOnInit:r,fitViewOnInitDone:s,fitViewOnInitOptions:a,domNode:l,nodeOrigin:c}=e(),u=l==null?void 0:l.querySelector(".react-flow__viewport");if(!u)return;const d=window.getComputedStyle(u),{m22:h}=new window.DOMMatrixReadOnly(d.transform),f=t.reduce((p,v)=>{const m=o.get(v.id);if(m){const _=lK(v.nodeElement);!!(_.width&&_.height&&(m.width!==_.width||m.height!==_.height||v.forceUpdate))&&(o.set(m.id,{...m,[ys]:{...m[ys],handleBounds:{source:cte(".source",v.nodeElement,h,c),target:cte(".target",v.nodeElement,h,c)}},..._}),p.push({id:m.id,type:"dimensions",dimensions:_}))}return p},[]);Afe(o,c);const g=s||r&&!s&&Pfe(e,{initial:!0,...a});i({nodeInternals:new Map(o),fitViewOnInitDone:g}),(f==null?void 0:f.length)>0&&(n==null||n(f))},updateNodePositions:(t,n=!0,o=!1)=>{const{triggerNodeChanges:r}=e(),s=t.map(a=>{const l={id:a.id,type:"position",dragging:o};return n&&(l.positionAbsolute=a.positionAbsolute,l.position=a.position),l});r(s)},triggerNodeChanges:t=>{const{onNodesChange:n,nodeInternals:o,hasDefaultNodes:r,nodeOrigin:s,getNodes:a,elevateNodesOnSelect:l}=e();if(t!=null&&t.length){if(r){const c=Ffe(t,a()),u=W8(c,o,s,l);i({nodeInternals:u})}n==null||n(t)}},addSelectedNodes:t=>{const{multiSelectionActive:n,edges:o,getNodes:r}=e();let s,a=null;n?s=t.map(l=>em(l,!0)):(s=wC(r(),t),a=wC(o,[])),PN({changedNodes:s,changedEdges:a,get:e,set:i})},addSelectedEdges:t=>{const{multiSelectionActive:n,edges:o,getNodes:r}=e();let s,a=null;n?s=t.map(l=>em(l,!0)):(s=wC(o,t),a=wC(r(),[])),PN({changedNodes:a,changedEdges:s,get:e,set:i})},unselectNodesAndEdges:({nodes:t,edges:n}={})=>{const{edges:o,getNodes:r}=e(),s=t||r(),a=n||o,l=s.map(u=>(u.selected=!1,em(u.id,!1))),c=a.map(u=>em(u.id,!1));PN({changedNodes:l,changedEdges:c,get:e,set:i})},setMinZoom:t=>{const{d3Zoom:n,maxZoom:o}=e();n==null||n.scaleExtent([t,o]),i({minZoom:t})},setMaxZoom:t=>{const{d3Zoom:n,minZoom:o}=e();n==null||n.scaleExtent([o,t]),i({maxZoom:t})},setTranslateExtent:t=>{var n;(n=e().d3Zoom)==null||n.translateExtent(t),i({translateExtent:t})},resetSelectedElements:()=>{const{edges:t,getNodes:n}=e(),r=n().filter(a=>a.selected).map(a=>em(a.id,!1)),s=t.filter(a=>a.selected).map(a=>em(a.id,!1));PN({changedNodes:r,changedEdges:s,get:e,set:i})},setNodeExtent:t=>{const{nodeInternals:n}=e();n.forEach(o=>{o.positionAbsolute=cK(o.position,t)}),i({nodeExtent:t,nodeInternals:new Map(n)})},panBy:t=>{const{transform:n,width:o,height:r,d3Zoom:s,d3Selection:a,translateExtent:l}=e();if(!s||!a||!t.x&&!t.y)return!1;const c=zg.translate(n[0]+t.x,n[1]+t.y).scale(n[2]),u=[[0,0],[o,r]],d=s==null?void 0:s.constrain()(c,u,l);return s.transform(a,d),n[0]!==d.x||n[1]!==d.y||n[2]!==d.k},cancelConnection:()=>i({connectionNodeId:Ap.connectionNodeId,connectionHandleId:Ap.connectionHandleId,connectionHandleType:Ap.connectionHandleType,connectionStatus:Ap.connectionStatus,connectionStartHandle:Ap.connectionStartHandle,connectionEndHandle:Ap.connectionEndHandle}),reset:()=>i({...Ap})}),Object.is),_K=({children:i})=>{const e=x.exports.useRef(null);return e.current||(e.current=p5e()),he(FOe,{value:e.current,children:i})};_K.displayName="ReactFlowProvider";const Xfe=({children:i})=>x.exports.useContext(i4)?he(ks,{children:i}):he(_K,{children:i});Xfe.displayName="ReactFlowWrapper";const m5e={input:Dfe,default:WB,output:Ife,group:pK},v5e={default:hA,straight:hK,step:dK,smoothstep:o4,simplebezier:uK},_5e=[0,0],b5e=[15,15],C5e={x:0,y:0,zoom:1},y5e={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0},Yfe=x.exports.forwardRef(({nodes:i,edges:e,defaultNodes:t,defaultEdges:n,className:o,nodeTypes:r=m5e,edgeTypes:s=v5e,onNodeClick:a,onEdgeClick:l,onInit:c,onMove:u,onMoveStart:d,onMoveEnd:h,onConnect:f,onConnectStart:g,onConnectEnd:p,onClickConnectStart:v,onClickConnectEnd:m,onNodeMouseEnter:_,onNodeMouseMove:y,onNodeMouseLeave:w,onNodeContextMenu:L,onNodeDoubleClick:D,onNodeDragStart:E,onNodeDrag:I,onNodeDragStop:k,onNodesDelete:R,onEdgesDelete:A,onSelectionChange:P,onSelectionDragStart:N,onSelectionDrag:M,onSelectionDragStop:H,onSelectionContextMenu:B,onSelectionStart:F,onSelectionEnd:$,connectionMode:z=$0.Strict,connectionLineType:K=sm.Bezier,connectionLineStyle:j,connectionLineComponent:G,connectionLineContainerStyle:X,deleteKeyCode:de="Backspace",selectionKeyCode:fe="Shift",selectionOnDrag:pe=!1,selectionMode:be=aD.Full,panActivationKeyCode:Se="Space",multiSelectionKeyCode:Fe=uA()?"Meta":"Control",zoomActivationKeyCode:De=uA()?"Meta":"Control",snapToGrid:ce=!1,snapGrid:Pe=b5e,onlyRenderVisibleElements:Oe=!1,selectNodesOnDrag:xe=!0,nodesDraggable:Ee,nodesConnectable:tt,nodesFocusable:nt,nodeOrigin:Qe=_5e,edgesFocusable:Ge,edgesUpdatable:re,elementsSelectable:ie,defaultViewport:se=C5e,minZoom:U=.5,maxZoom:Y=2,translateExtent:oe=HB,preventScrolling:te=!0,nodeExtent:ye,defaultMarkerColor:Le="#b1b1b7",zoomOnScroll:Te=!0,zoomOnPinch:We=!0,panOnScroll:je=!1,panOnScrollSpeed:mt=.5,panOnScrollMode:Dt=t0.Free,zoomOnDoubleClick:At=!0,panOnDrag:Je=!0,onPaneClick:Lt,onPaneMouseEnter:Ot,onPaneMouseMove:Vn,onPaneMouseLeave:Et,onPaneScroll:tn,onPaneContextMenu:ui,children:cn,onEdgeUpdate:qn,onEdgeContextMenu:bn,onEdgeDoubleClick:Pt,onEdgeMouseEnter:qt,onEdgeMouseMove:Nt,onEdgeMouseLeave:jt,onEdgeUpdateStart:Gt,onEdgeUpdateEnd:It,edgeUpdaterRadius:Ft=10,onNodesChange:bt,onEdgesChange:Zt,noDragClassName:wn="nodrag",noWheelClassName:Dn="nowheel",noPanClassName:Gn="nopan",fitView:Un=!1,fitViewOptions:Zi,connectOnClick:an=!0,attributionPosition:Xt,proOptions:oi,defaultEdgeOptions:Ze,elevateNodesOnSelect:ue=!0,elevateEdgesOnSelect:Ve=!1,disableKeyboardA11y:ot=!1,autoPanOnConnect:Sn=!0,autoPanOnNodeDrag:$n=!0,connectionRadius:Ci=20,isValidConnection:An,onError:lo,style:Qo,id:zo,nodeDragThreshold:oc,...Yc},Gr)=>{const Ua=zo||"1";return he("div",{...Yc,style:{...Qo,...y5e},ref:Gr,className:fa(["react-flow",o]),"data-testid":"rf__wrapper",id:zo,children:fn(Xfe,{children:[he(g5e,{onInit:c,onMove:u,onMoveStart:d,onMoveEnd:h,onNodeClick:a,onEdgeClick:l,onNodeMouseEnter:_,onNodeMouseMove:y,onNodeMouseLeave:w,onNodeContextMenu:L,onNodeDoubleClick:D,nodeTypes:r,edgeTypes:s,connectionLineType:K,connectionLineStyle:j,connectionLineComponent:G,connectionLineContainerStyle:X,selectionKeyCode:fe,selectionOnDrag:pe,selectionMode:be,deleteKeyCode:de,multiSelectionKeyCode:Fe,panActivationKeyCode:Se,zoomActivationKeyCode:De,onlyRenderVisibleElements:Oe,selectNodesOnDrag:xe,defaultViewport:se,translateExtent:oe,minZoom:U,maxZoom:Y,preventScrolling:te,zoomOnScroll:Te,zoomOnPinch:We,zoomOnDoubleClick:At,panOnScroll:je,panOnScrollSpeed:mt,panOnScrollMode:Dt,panOnDrag:Je,onPaneClick:Lt,onPaneMouseEnter:Ot,onPaneMouseMove:Vn,onPaneMouseLeave:Et,onPaneScroll:tn,onPaneContextMenu:ui,onSelectionContextMenu:B,onSelectionStart:F,onSelectionEnd:$,onEdgeUpdate:qn,onEdgeContextMenu:bn,onEdgeDoubleClick:Pt,onEdgeMouseEnter:qt,onEdgeMouseMove:Nt,onEdgeMouseLeave:jt,onEdgeUpdateStart:Gt,onEdgeUpdateEnd:It,edgeUpdaterRadius:Ft,defaultMarkerColor:Le,noDragClassName:wn,noWheelClassName:Dn,noPanClassName:Gn,elevateEdgesOnSelect:Ve,rfId:Ua,disableKeyboardA11y:ot,nodeOrigin:Qe,nodeExtent:ye}),he(d4e,{nodes:i,edges:e,defaultNodes:t,defaultEdges:n,onConnect:f,onConnectStart:g,onConnectEnd:p,onClickConnectStart:v,onClickConnectEnd:m,nodesDraggable:Ee,nodesConnectable:tt,nodesFocusable:nt,edgesFocusable:Ge,edgesUpdatable:re,elementsSelectable:ie,elevateNodesOnSelect:ue,minZoom:U,maxZoom:Y,nodeExtent:ye,onNodesChange:bt,onEdgesChange:Zt,snapToGrid:ce,snapGrid:Pe,connectionMode:z,translateExtent:oe,connectOnClick:an,defaultEdgeOptions:Ze,fitView:Un,fitViewOptions:Zi,onNodesDelete:R,onEdgesDelete:A,onNodeDragStart:E,onNodeDrag:I,onNodeDragStop:k,onSelectionDrag:M,onSelectionDragStart:N,onSelectionDragStop:H,noPanClassName:Gn,nodeOrigin:Qe,rfId:Ua,autoPanOnConnect:Sn,autoPanOnNodeDrag:$n,onError:lo,connectionRadius:Ci,isValidConnection:An,nodeDragThreshold:oc}),he(c4e,{onSelectionChange:P}),cn,he(WOe,{proOptions:oi,position:Xt}),he(m4e,{rfId:Ua,disableKeyboardA11y:ot})]})})});Yfe.displayName="ReactFlow";function w5e(){const i=cs();return x.exports.useCallback(e=>{const{domNode:t,updateNodeDimensions:n}=i.getState(),r=(Array.isArray(e)?e:[e]).reduce((s,a)=>{const l=t==null?void 0:t.querySelector(`.react-flow__node[data-id="${a}"]`);return l&&s.push({id:a,nodeElement:l,forceUpdate:!0}),s},[]);requestAnimationFrame(()=>n(r))},[])}const Zfe=({id:i,x:e,y:t,width:n,height:o,style:r,color:s,strokeColor:a,strokeWidth:l,className:c,borderRadius:u,shapeRendering:d,onClick:h,selected:f})=>{const{background:g,backgroundColor:p}=r||{},v=s||g||p;return he("rect",{className:fa(["react-flow__minimap-node",{selected:f},c]),x:e,y:t,rx:u,ry:u,width:n,height:o,fill:v,stroke:a,strokeWidth:l,shapeRendering:d,onClick:h?m=>h(m,i):void 0})};Zfe.displayName="MiniMapNode";var S5e=x.exports.memo(Zfe);const x5e=i=>i.nodeOrigin,L5e=i=>i.getNodes().filter(e=>!e.hidden&&e.width&&e.height),z8=i=>i instanceof Function?i:()=>i;function E5e({nodeStrokeColor:i="transparent",nodeColor:e="#e2e2e2",nodeClassName:t="",nodeBorderRadius:n=5,nodeStrokeWidth:o=2,nodeComponent:r=S5e,onClick:s}){const a=mo(L5e,Hs),l=mo(x5e),c=z8(e),u=z8(i),d=z8(t),h=typeof window=="undefined"||!!window.chrome?"crispEdges":"geometricPrecision";return he(ks,{children:a.map(f=>{const{x:g,y:p}=w0(f,l).positionAbsolute;return he(r,{x:g,y:p,width:f.width,height:f.height,style:f.style,selected:f.selected,className:d(f),color:c(f),borderRadius:n,strokeColor:u(f),strokeWidth:o,shapeRendering:h,onClick:s,id:f.id},f.id)})})}var D5e=x.exports.memo(E5e);const k5e=200,I5e=150,T5e=i=>{const e=i.getNodes(),t={x:-i.transform[0]/i.transform[2],y:-i.transform[1]/i.transform[2],width:i.width/i.transform[2],height:i.height/i.transform[2]};return{viewBB:t,boundingRect:e.length>0?$Oe(r4(e,i.nodeOrigin),t):t,rfId:i.rfId}},N5e="react-flow__minimap-desc";function Qfe({style:i,className:e,nodeStrokeColor:t="transparent",nodeColor:n="#e2e2e2",nodeClassName:o="",nodeBorderRadius:r=5,nodeStrokeWidth:s=2,nodeComponent:a,maskColor:l="rgb(240, 240, 240, 0.6)",maskStrokeColor:c="none",maskStrokeWidth:u=1,position:d="bottom-right",onClick:h,onNodeClick:f,pannable:g=!1,zoomable:p=!1,ariaLabel:v="React Flow mini map",inversePan:m=!1,zoomStep:_=10,offsetScale:y=5}){var fe,pe;const w=cs(),L=x.exports.useRef(null),{boundingRect:D,viewBB:E,rfId:I}=mo(T5e,Hs),k=(fe=i==null?void 0:i.width)!=null?fe:k5e,R=(pe=i==null?void 0:i.height)!=null?pe:I5e,A=D.width/k,P=D.height/R,N=Math.max(A,P),M=N*k,H=N*R,B=y*N,F=D.x-(M-D.width)/2-B,$=D.y-(H-D.height)/2-B,z=M+B*2,K=H+B*2,j=`${N5e}-${I}`,G=x.exports.useRef(0);G.current=N,x.exports.useEffect(()=>{if(L.current){const be=bu(L.current),Se=ce=>{const{transform:Pe,d3Selection:Oe,d3Zoom:xe}=w.getState();if(ce.sourceEvent.type!=="wheel"||!Oe||!xe)return;const Ee=-ce.sourceEvent.deltaY*(ce.sourceEvent.deltaMode===1?.05:ce.sourceEvent.deltaMode?1:.002)*_,tt=Pe[2]*Math.pow(2,Ee);xe.scaleTo(Oe,tt)},Fe=ce=>{const{transform:Pe,d3Selection:Oe,d3Zoom:xe,translateExtent:Ee,width:tt,height:nt}=w.getState();if(ce.sourceEvent.type!=="mousemove"||!Oe||!xe)return;const Qe=G.current*Math.max(1,Pe[2])*(m?-1:1),Ge={x:Pe[0]-ce.sourceEvent.movementX*Qe,y:Pe[1]-ce.sourceEvent.movementY*Qe},re=[[0,0],[tt,nt]],ie=zg.translate(Ge.x,Ge.y).scale(Pe[2]),se=xe.constrain()(ie,re,Ee);xe.transform(Oe,se)},De=nfe().on("zoom",g?Fe:null).on("zoom.wheel",p?Se:null);return be.call(De),()=>{be.on("zoom",null)}}},[g,p,m,_]);const X=h?be=>{const Se=gd(be);h(be,{x:Se[0],y:Se[1]})}:void 0,de=f?(be,Se)=>{const Fe=w.getState().nodeInternals.get(Se);f(be,Fe)}:void 0;return he(rD,{position:d,style:i,className:fa(["react-flow__minimap",e]),"data-testid":"rf__minimap",children:fn("svg",{width:k,height:R,viewBox:`${F} ${$} ${z} ${K}`,role:"img","aria-labelledby":j,ref:L,onClick:X,children:[v&&he("title",{id:j,children:v}),he(D5e,{onClick:de,nodeColor:n,nodeStrokeColor:t,nodeBorderRadius:r,nodeClassName:o,nodeStrokeWidth:s,nodeComponent:a}),he("path",{className:"react-flow__minimap-mask",d:`M${F-B},${$-B}h${z+B*2}v${K+B*2}h${-z-B*2}z + M${E.x},${E.y}h${E.width}v${E.height}h${-E.width}z`,fill:l,fillRule:"evenodd",stroke:c,strokeWidth:u,pointerEvents:"none"})]})})}Qfe.displayName="MiniMap";var R5e=x.exports.memo(Qfe);function M5e(){return he("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:he("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function A5e(){return he("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:he("path",{d:"M0 0h32v4.2H0z"})})}function P5e(){return he("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:he("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function O5e(){return he("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:he("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function F5e(){return he("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:he("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}const gL=({children:i,className:e,...t})=>he("button",{type:"button",className:fa(["react-flow__controls-button",e]),...t,children:i});gL.displayName="ControlButton";const B5e=i=>({isInteractive:i.nodesDraggable||i.nodesConnectable||i.elementsSelectable,minZoomReached:i.transform[2]<=i.minZoom,maxZoomReached:i.transform[2]>=i.maxZoom}),Jfe=({style:i,showZoom:e=!0,showFitView:t=!0,showInteractive:n=!0,fitViewOptions:o,onZoomIn:r,onZoomOut:s,onFitView:a,onInteractiveChange:l,className:c,children:u,position:d="bottom-left"})=>{const h=cs(),[f,g]=x.exports.useState(!1),{isInteractive:p,minZoomReached:v,maxZoomReached:m}=mo(B5e,Hs),{zoomIn:_,zoomOut:y,fitView:w}=mK();if(x.exports.useEffect(()=>{g(!0)},[]),!f)return null;const L=()=>{_(),r==null||r()},D=()=>{y(),s==null||s()},E=()=>{w(o),a==null||a()},I=()=>{h.setState({nodesDraggable:!p,nodesConnectable:!p,elementsSelectable:!p}),l==null||l(!p)};return fn(rD,{className:fa(["react-flow__controls",c]),position:d,style:i,"data-testid":"rf__controls",children:[e&&fn(ks,{children:[he(gL,{onClick:L,className:"react-flow__controls-zoomin",title:"zoom in","aria-label":"zoom in",disabled:m,children:he(M5e,{})}),he(gL,{onClick:D,className:"react-flow__controls-zoomout",title:"zoom out","aria-label":"zoom out",disabled:v,children:he(A5e,{})})]}),t&&he(gL,{className:"react-flow__controls-fitview",onClick:E,title:"fit view","aria-label":"fit view",children:he(P5e,{})}),n&&he(gL,{className:"react-flow__controls-interactive",onClick:I,title:"toggle interactivity","aria-label":"toggle interactivity",children:p?he(F5e,{}):he(O5e,{})}),u]})};Jfe.displayName="Controls";var W5e=x.exports.memo(Jfe),ku;(function(i){i.Lines="lines",i.Dots="dots",i.Cross="cross"})(ku||(ku={}));function V5e({color:i,dimensions:e,lineWidth:t}){return he("path",{stroke:i,strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`})}function H5e({color:i,radius:e}){return he("circle",{cx:e,cy:e,r:e,fill:i})}const $5e={[ku.Dots]:"#91919a",[ku.Lines]:"#eee",[ku.Cross]:"#e2e2e2"},z5e={[ku.Dots]:1,[ku.Lines]:1,[ku.Cross]:6},U5e=i=>({transform:i.transform,patternId:`pattern-${i.rfId}`});function ege({id:i,variant:e=ku.Dots,gap:t=20,size:n,lineWidth:o=1,offset:r=2,color:s,style:a,className:l}){const c=x.exports.useRef(null),{transform:u,patternId:d}=mo(U5e,Hs),h=s||$5e[e],f=n||z5e[e],g=e===ku.Dots,p=e===ku.Cross,v=Array.isArray(t)?t:[t,t],m=[v[0]*u[2]||1,v[1]*u[2]||1],_=f*u[2],y=p?[_,_]:m,w=g?[_/r,_/r]:[y[0]/r,y[1]/r];return fn("svg",{className:fa(["react-flow__background",l]),style:{...a,position:"absolute",width:"100%",height:"100%",top:0,left:0},ref:c,"data-testid":"rf__background",children:[he("pattern",{id:d+i,x:u[0]%m[0],y:u[1]%m[1],width:m[0],height:m[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${w[0]},-${w[1]})`,children:g?he(H5e,{color:h,radius:_/r}):he(V5e,{dimensions:y,color:h,lineWidth:o})}),he("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${d+i})`})]})}ege.displayName="Background";var j5e=x.exports.memo(ege);let FN;const K5e=new Uint8Array(16);function q5e(){if(!FN&&(FN=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!FN))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return FN(K5e)}const Ks=[];for(let i=0;i<256;++i)Ks.push((i+256).toString(16).slice(1));function G5e(i,e=0){return Ks[i[e+0]]+Ks[i[e+1]]+Ks[i[e+2]]+Ks[i[e+3]]+"-"+Ks[i[e+4]]+Ks[i[e+5]]+"-"+Ks[i[e+6]]+Ks[i[e+7]]+"-"+Ks[i[e+8]]+Ks[i[e+9]]+"-"+Ks[i[e+10]]+Ks[i[e+11]]+Ks[i[e+12]]+Ks[i[e+13]]+Ks[i[e+14]]+Ks[i[e+15]]}const X5e=typeof crypto!="undefined"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);var vte={randomUUID:X5e};function yI(i,e,t){if(vte.randomUUID&&!e&&!i)return vte.randomUUID();i=i||{};const n=i.random||(i.rng||q5e)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,e){t=t||0;for(let o=0;o<16;++o)e[t+o]=n[o];return e}return G5e(n)}class wI{constructor(e){Ct(this,"id");Ct(this,"name");Ct(this,"children",[]);Ct(this,"nodes",[]);Ct(this,"edges",[]);Ct(this,"parentLayerId");Ct(this,"relativeNodeId");Ct(this,"relativeOperatorType");this.id=yI(),this.name=e}}function wc(i,e){if(i.id===e)return i;for(const t of i.children){const n=wc(t,e);if(n)return n}}function Y5e(i){var o;const e=[i];let t=e.pop();const n=[];for(;t;)n.push(t),(o=t==null?void 0:t.children)!=null&&o.length&&e.push(...t.children),t=e.pop();return n.reverse(),n}var Z5e=function(i){return function(e,t){var n=x.exports.useRef(!1);i(function(){return function(){n.current=!1}},[]),i(function(){if(!n.current)n.current=!0;else return e()},t)}},Q5e=function(i){return typeof i=="function"},J5e=!1,eFe=J5e;function k_(i){eFe&&(Q5e(i)||console.error("useMemoizedFn expected parameter is a function, got ".concat(typeof i)));var e=x.exports.useRef(i);e.current=x.exports.useMemo(function(){return i},[i]);var t=x.exports.useRef();return t.current||(t.current=function(){for(var n=[],o=0;o0},i.prototype.connect_=function(){!$B||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),aFe?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},i.prototype.disconnect_=function(){!$B||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},i.prototype.onTransitionEnd_=function(e){var t=e.propertyName,n=t===void 0?"":t,o=sFe.some(function(r){return!!~n.indexOf(r)});o&&this.refresh()},i.getInstance=function(){return this.instance_||(this.instance_=new i),this.instance_},i.instance_=null,i}(),nge=function(i,e){for(var t=0,n=Object.keys(e);t0},i}(),oge=typeof WeakMap!="undefined"?new WeakMap:new tge,rge=function(){function i(e){if(!(this instanceof i))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var t=lFe.getInstance(),n=new _Fe(e,t,this);oge.set(this,n)}return i}();["observe","unobserve","disconnect"].forEach(function(i){rge.prototype[i]=function(){var e;return(e=oge.get(this))[i].apply(e,arguments)}});var bFe=function(){return typeof gA.ResizeObserver!="undefined"?gA.ResizeObserver:rge}();function sge(){return`$flow_${yI()}`}function CFe(i,e){return i.target===e.target&&i.targetHandle===e.targetHandle}function yFe(i,e){return i.source===e.source&&i.sourceHandle===e.sourceHandle}async function wFe(i){return await new Promise(e=>setTimeout(e,i))}var age={exports:{}};/*! Copyright (c) 2018 Jed Watson. Licensed under the MIT License (MIT), see http://jedwatson.github.io/classnames -*/(function(i){(function(){var e={}.hasOwnProperty;function t(){for(var r="",s=0;s component higher in the tree to provide a loading * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var mK=Symbol.for("react.element"),vK=Symbol.for("react.portal"),s4=Symbol.for("react.fragment"),a4=Symbol.for("react.strict_mode"),l4=Symbol.for("react.profiler"),c4=Symbol.for("react.provider"),u4=Symbol.for("react.context"),pFe=Symbol.for("react.server_context"),d4=Symbol.for("react.forward_ref"),h4=Symbol.for("react.suspense"),f4=Symbol.for("react.suspense_list"),g4=Symbol.for("react.memo"),p4=Symbol.for("react.lazy"),mFe=Symbol.for("react.offscreen"),tge;tge=Symbol.for("react.module.reference");function Hu(i){if(typeof i=="object"&&i!==null){var e=i.$$typeof;switch(e){case mK:switch(i=i.type,i){case s4:case l4:case a4:case h4:case f4:return i;default:switch(i=i&&i.$$typeof,i){case pFe:case u4:case d4:case p4:case g4:case c4:return i;default:return e}}case vK:return e}}}vo.ContextConsumer=u4;vo.ContextProvider=c4;vo.Element=mK;vo.ForwardRef=d4;vo.Fragment=s4;vo.Lazy=p4;vo.Memo=g4;vo.Portal=vK;vo.Profiler=l4;vo.StrictMode=a4;vo.Suspense=h4;vo.SuspenseList=f4;vo.isAsyncMode=function(){return!1};vo.isConcurrentMode=function(){return!1};vo.isContextConsumer=function(i){return Hu(i)===u4};vo.isContextProvider=function(i){return Hu(i)===c4};vo.isElement=function(i){return typeof i=="object"&&i!==null&&i.$$typeof===mK};vo.isForwardRef=function(i){return Hu(i)===d4};vo.isFragment=function(i){return Hu(i)===s4};vo.isLazy=function(i){return Hu(i)===p4};vo.isMemo=function(i){return Hu(i)===g4};vo.isPortal=function(i){return Hu(i)===vK};vo.isProfiler=function(i){return Hu(i)===l4};vo.isStrictMode=function(i){return Hu(i)===a4};vo.isSuspense=function(i){return Hu(i)===h4};vo.isSuspenseList=function(i){return Hu(i)===f4};vo.isValidElementType=function(i){return typeof i=="string"||typeof i=="function"||i===s4||i===l4||i===a4||i===h4||i===f4||i===mFe||typeof i=="object"&&i!==null&&(i.$$typeof===p4||i.$$typeof===g4||i.$$typeof===c4||i.$$typeof===u4||i.$$typeof===d4||i.$$typeof===tge||i.getModuleId!==void 0)};vo.typeOf=Hu;pK.exports=vo;function np(i){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=[];return Bt.Children.forEach(i,function(n){n==null&&!e.keepEmpty||(Array.isArray(n)?t=t.concat(np(n)):pK.exports.isFragment(n)&&n.props?t=t.concat(np(n.props.children,e)):t.push(n))}),t}var VB={},vFe=function(e){};function _Fe(i,e){}function bFe(i,e){}function CFe(){VB={}}function nge(i,e,t){!e&&!VB[t]&&(i(!1,t),VB[t]=!0)}function rr(i,e){nge(_Fe,i,e)}function wFe(i,e){nge(bFe,i,e)}rr.preMessage=vFe;rr.resetWarned=CFe;rr.noteOnce=wFe;function Kn(i){return Kn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Kn(i)}function yFe(i,e){if(Kn(i)!="object"||!i)return i;var t=i[Symbol.toPrimitive];if(t!==void 0){var n=t.call(i,e||"default");if(Kn(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(i)}function ige(i){var e=yFe(i,"string");return Kn(e)=="symbol"?e:String(e)}function me(i,e,t){return e=ige(e),e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function dte(i,e){var t=Object.keys(i);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(i);e&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(i,o).enumerable})),t.push.apply(t,n)}return t}function Ce(i){for(var e=1;ei.length)&&(e=i.length);for(var t=0,n=new Array(e);t1&&arguments[1]!==void 0?arguments[1]:1;fte+=1;var n=fte;function o(r){if(r===0)lge(n),e();else{var s=sge(function(){o(r-1)});wK.set(n,s)}}return o(t),n};Xi.cancel=function(i){var e=wK.get(i);return lge(i),age(e)};function cge(i){if(Array.isArray(i))return i}function AFe(i,e){var t=i==null?null:typeof Symbol!="undefined"&&i[Symbol.iterator]||i["@@iterator"];if(t!=null){var n,o,r,s,a=[],l=!0,c=!1;try{if(r=(t=t.call(i)).next,e===0){if(Object(t)!==t)return;l=!1}else for(;!(l=(n=r.call(t)).done)&&(a.push(n.value),a.length!==e);l=!0);}catch(u){c=!0,o=u}finally{try{if(!l&&t.return!=null&&(s=t.return(),Object(s)!==s))return}finally{if(c)throw o}}return a}}function uge(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ne(i,e){return cge(i)||AFe(i,e)||CK(i,e)||uge()}function gA(i){for(var e=0,t,n=0,o=i.length;o>=4;++n,o-=4)t=i.charCodeAt(n)&255|(i.charCodeAt(++n)&255)<<8|(i.charCodeAt(++n)&255)<<16|(i.charCodeAt(++n)&255)<<24,t=(t&65535)*1540483477+((t>>>16)*59797<<16),t^=t>>>24,e=(t&65535)*1540483477+((t>>>16)*59797<<16)^(e&65535)*1540483477+((e>>>16)*59797<<16);switch(o){case 3:e^=(i.charCodeAt(n+2)&255)<<16;case 2:e^=(i.charCodeAt(n+1)&255)<<8;case 1:e^=i.charCodeAt(n)&255,e=(e&65535)*1540483477+((e>>>16)*59797<<16)}return e^=e>>>13,e=(e&65535)*1540483477+((e>>>16)*59797<<16),((e^e>>>15)>>>0).toString(36)}function Oa(){return!!(typeof window!="undefined"&&window.document&&window.document.createElement)}function UB(i,e){if(!i)return!1;if(i.contains)return i.contains(e);for(var t=e;t;){if(t===i)return!0;t=t.parentNode}return!1}var gte="data-rc-order",pte="data-rc-priority",PFe="rc-util-key",jB=new Map;function dge(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=i.mark;return e?e.startsWith("data-")?e:"data-".concat(e):PFe}function v4(i){if(i.attachTo)return i.attachTo;var e=document.querySelector("head");return e||document.body}function OFe(i){return i==="queue"?"prependQueue":i?"prepend":"append"}function hge(i){return Array.from((jB.get(i)||i).children).filter(function(e){return e.tagName==="STYLE"})}function fge(i){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Oa())return null;var t=e.csp,n=e.prepend,o=e.priority,r=o===void 0?0:o,s=OFe(n),a=s==="prependQueue",l=document.createElement("style");l.setAttribute(gte,s),a&&r&&l.setAttribute(pte,"".concat(r)),t!=null&&t.nonce&&(l.nonce=t==null?void 0:t.nonce),l.innerHTML=i;var c=v4(e),u=c.firstChild;if(n){if(a){var d=hge(c).filter(function(h){if(!["prepend","prependQueue"].includes(h.getAttribute(gte)))return!1;var f=Number(h.getAttribute(pte)||0);return r>=f});if(d.length)return c.insertBefore(l,d[d.length-1].nextSibling),l}c.insertBefore(l,u)}else c.appendChild(l);return l}function gge(i){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=v4(e);return hge(t).find(function(n){return n.getAttribute(dge(e))===i})}function cD(i){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=gge(i,e);if(t){var n=v4(e);n.removeChild(t)}}function FFe(i,e){var t=jB.get(i);if(!t||!UB(document,t)){var n=fge("",e),o=n.parentNode;jB.set(i,o),i.removeChild(n)}}function fv(i,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=v4(t);FFe(n,t);var o=gge(e,t);if(o){var r,s;if((r=t.csp)!==null&&r!==void 0&&r.nonce&&o.nonce!==((s=t.csp)===null||s===void 0?void 0:s.nonce)){var a;o.nonce=(a=t.csp)===null||a===void 0?void 0:a.nonce}return o.innerHTML!==i&&(o.innerHTML=i),o}var l=fge(i,t);return l.setAttribute(dge(t),e),l}function BFe(i,e){if(i==null)return{};var t={},n=Object.keys(i),o,r;for(r=0;r=0)&&(t[o]=i[o]);return t}function Hn(i,e){if(i==null)return{};var t=BFe(i,e),n,o;if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(i);for(o=0;o=0)&&(!Object.prototype.propertyIsEnumerable.call(i,n)||(t[n]=i[n]))}return t}function _4(i,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,n=new Set;function o(r,s){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,l=n.has(r);if(rr(!l,"Warning: There may be circular references"),l)return!1;if(r===s)return!0;if(t&&a>1)return!1;n.add(r);var c=a+1;if(Array.isArray(r)){if(!Array.isArray(s)||r.length!==s.length)return!1;for(var u=0;u1&&arguments[1]!==void 0?arguments[1]:!1,s={map:this.cache};return t.forEach(function(a){if(!s)s=void 0;else{var l;s=(l=s)===null||l===void 0||(l=l.map)===null||l===void 0?void 0:l.get(a)}}),(n=s)!==null&&n!==void 0&&n.value&&r&&(s.value[1]=this.cacheCallTimes++),(o=s)===null||o===void 0?void 0:o.value}},{key:"get",value:function(t){var n;return(n=this.internalGet(t,!0))===null||n===void 0?void 0:n[0]}},{key:"has",value:function(t){return!!this.internalGet(t)}},{key:"set",value:function(t,n){var o=this;if(!this.has(t)){if(this.size()+1>i.MAX_CACHE_SIZE+i.MAX_CACHE_OFFSET){var r=this.keys.reduce(function(c,u){var d=Ne(c,2),h=d[1];return o.internalGet(u)[1]0,void 0),vte+=1}return ga(i,[{key:"getDerivativeToken",value:function(t){return this.derivatives.reduce(function(n,o){return o(t,n)},void 0)}}]),i}(),U8=new yK;function KB(i){var e=Array.isArray(i)?i:[i];return U8.has(e)||U8.set(e,new pge(e)),U8.get(e)}var zFe=new WeakMap,j8={};function UFe(i,e){for(var t=zFe,n=0;n3&&arguments[3]!==void 0?arguments[3]:{},r=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;if(r)return i;var s=Ce(Ce({},o),{},(n={},me(n,oy,e),me(n,Ad,t),n)),a=Object.keys(s).map(function(l){var c=s[l];return c?"".concat(l,'="').concat(c,'"'):null}).filter(function(l){return l}).join(" ");return"")}var vge=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";return"--".concat(t?"".concat(t,"-"):"").concat(e).replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/([A-Z]+)([A-Z][a-z0-9]+)/g,"$1-$2").replace(/([a-z])([A-Z0-9])/g,"$1-$2").toLowerCase()},qFe=function(e,t,n){return Object.keys(e).length?".".concat(t).concat(n!=null&&n.scope?".".concat(n.scope):"","{").concat(Object.entries(e).map(function(o){var r=Ne(o,2),s=r[0],a=r[1];return"".concat(s,":").concat(a,";")}).join(""),"}"):""},_ge=function(e,t,n){var o={},r={};return Object.entries(e).forEach(function(s){var a,l,c=Ne(s,2),u=c[0],d=c[1];if(n!=null&&(a=n.preserve)!==null&&a!==void 0&&a[u])r[u]=d;else if((typeof d=="string"||typeof d=="number")&&!(n!=null&&(l=n.ignore)!==null&&l!==void 0&&l[u])){var h,f=vge(u,n==null?void 0:n.prefix);o[f]=typeof d=="number"&&!(n!=null&&(h=n.unitless)!==null&&h!==void 0&&h[u])?"".concat(d,"px"):String(d),r[u]="var(".concat(f,")")}}),[r,qFe(o,t,{scope:n==null?void 0:n.scope})]},Cte=Oa()?x.exports.useLayoutEffect:x.exports.useEffect,go=function(e,t){var n=x.exports.useRef(!0);Cte(function(){return e(n.current)},t),Cte(function(){return n.current=!1,function(){n.current=!0}},[])},GB=function(e,t){go(function(n){if(!n)return e()},t)},GFe=Ce({},dI),wte=GFe.useInsertionEffect,XFe=function(e,t,n){x.exports.useMemo(e,n),go(function(){return t(!0)},n)},YFe=wte?function(i,e,t){return wte(function(){return i(),e()},t)}:XFe,ZFe=YFe,QFe=Ce({},dI),JFe=QFe.useInsertionEffect,e3e=function(e){var t=[],n=!1;function o(r){n||t.push(r)}return x.exports.useEffect(function(){return n=!1,function(){n=!0,t.length&&t.forEach(function(r){return r()})}},e),o},t3e=function(){return function(e){e()}},n3e=typeof JFe!="undefined"?e3e:t3e,i3e=n3e;function SK(i,e,t,n,o){var r=x.exports.useContext(b4),s=r.cache,a=[i].concat(_t(e)),l=a.join("_"),c=i3e([l]),u=function(g){s.update(a,function(p){var v=p||[void 0,void 0],m=Ne(v,2),_=m[0],w=_===void 0?0:_,y=m[1],L=y,D=L||t(),E=[w,D];return g?g(E):E})};x.exports.useMemo(function(){u()},[l]);var d=s.get(a),h=d[1];return ZFe(function(){o==null||o(h)},function(f){return u(function(g){var p=Ne(g,2),v=p[0],m=p[1];return f&&v===0&&(o==null||o(h)),[v+1,m]}),function(){s.update(a,function(g){var p=g||[],v=Ne(p,2),m=v[0],_=m===void 0?0:m,w=v[1],y=_-1;return y===0?(c(function(){(f||!s.get(a))&&(n==null||n(w,!1))}),null):[_-1,w]})}},[l]),h}var o3e={},r3e="css",F_=new Map;function s3e(i){F_.set(i,(F_.get(i)||0)+1)}function a3e(i,e){if(typeof document!="undefined"){var t=document.querySelectorAll("style[".concat(oy,'="').concat(i,'"]'));t.forEach(function(n){if(n[vm]===e){var o;(o=n.parentNode)===null||o===void 0||o.removeChild(n)}})}}var l3e=0;function c3e(i,e){F_.set(i,(F_.get(i)||0)-1);var t=Array.from(F_.keys()),n=t.filter(function(o){var r=F_.get(o)||0;return r<=0});t.length-n.length>l3e&&n.forEach(function(o){a3e(o,e),F_.delete(o)})}var u3e=function(e,t,n,o){var r=n.getDerivativeToken(e),s=Ce(Ce({},r),t);return o&&(s=o(s)),s},bge="token";function d3e(i,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=x.exports.useContext(b4),o=n.cache.instanceId,r=n.container,s=t.salt,a=s===void 0?"":s,l=t.override,c=l===void 0?o3e:l,u=t.formatToken,d=t.getComputedToken,h=t.cssVar,f=UFe(function(){return Object.assign.apply(Object,[{}].concat(_t(e)))},e),g=JL(f),p=JL(c),v=h?JL(h):"",m=SK(bge,[a,i.id,g,p,v],function(){var _,w=d?d(f,c,i):u3e(f,c,i,u),y=Ce({},w),L="";if(h){var D=_ge(w,h.key,{prefix:h.prefix,ignore:h.ignore,unitless:h.unitless,preserve:h.preserve}),E=Ne(D,2);w=E[0],L=E[1]}var I=bte(w,a);w._tokenKey=I,y._tokenKey=bte(y,a);var k=(_=h==null?void 0:h.key)!==null&&_!==void 0?_:I;w._themeKey=k,s3e(k);var R="".concat(r3e,"-").concat(gA(I));return w._hashId=R,[w,R,y,L,(h==null?void 0:h.key)||""]},function(_){c3e(_[0]._themeKey,o)},function(_){var w=Ne(_,4),y=w[0],L=w[3];if(h&&L){var D=fv(L,gA("css-variables-".concat(y._themeKey)),{mark:Ad,prepend:"queue",attachTo:r,priority:-999});D[vm]=o,D.setAttribute(oy,y._themeKey)}});return m}var h3e=function(e,t,n){var o=Ne(e,5),r=o[2],s=o[3],a=o[4],l=n||{},c=l.plain;if(!s)return null;var u=r._tokenKey,d=-999,h={"data-rc-order":"prependQueue","data-rc-priority":"".concat(d)},f=pA(s,a,u,h,c);return[d,u,f]},f3e={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},Cge="comm",wge="rule",yge="decl",g3e="@import",p3e="@keyframes",m3e="@layer",Sge=Math.abs,xK=String.fromCharCode;function xge(i){return i.trim()}function AR(i,e,t){return i.replace(e,t)}function v3e(i,e,t){return i.indexOf(e,t)}function uD(i,e){return i.charCodeAt(e)|0}function dD(i,e,t){return i.slice(e,t)}function dg(i){return i.length}function _3e(i){return i.length}function PN(i,e){return e.push(i),i}var C4=1,ry=1,Lge=0,Pu=0,es=0,sS="";function LK(i,e,t,n,o,r,s,a){return{value:i,root:e,parent:t,type:n,props:o,children:r,line:C4,column:ry,length:s,return:"",siblings:a}}function b3e(){return es}function C3e(){return es=Pu>0?uD(sS,--Pu):0,ry--,es===10&&(ry=1,C4--),es}function Pd(){return es=Pu2||XB(es)>3?"":" "}function x3e(i,e){for(;--e&&Pd()&&!(es<48||es>102||es>57&&es<65||es>70&&es<97););return w4(i,PR()+(e<6&&y0()==32&&Pd()==32))}function YB(i){for(;Pd();)switch(es){case i:return Pu;case 34:case 39:i!==34&&i!==39&&YB(es);break;case 40:i===41&&YB(i);break;case 92:Pd();break}return Pu}function L3e(i,e){for(;Pd()&&i+es!==47+10;)if(i+es===42+42&&y0()===47)break;return"/*"+w4(e,Pu-1)+"*"+xK(i===47?i:Pd())}function E3e(i){for(;!XB(y0());)Pd();return w4(i,Pu)}function D3e(i){return y3e(OR("",null,null,null,[""],i=w3e(i),0,[0],i))}function OR(i,e,t,n,o,r,s,a,l){for(var c=0,u=0,d=s,h=0,f=0,g=0,p=1,v=1,m=1,_=0,w="",y=o,L=r,D=n,E=w;v;)switch(g=_,_=Pd()){case 40:if(g!=108&&uD(E,d-1)==58){v3e(E+=AR(q8(_),"&","&\f"),"&\f",Sge(c?a[c-1]:0))!=-1&&(m=-1);break}case 34:case 39:case 91:E+=q8(_);break;case 9:case 10:case 13:case 32:E+=S3e(g);break;case 92:E+=x3e(PR()-1,7);continue;case 47:switch(y0()){case 42:case 47:PN(k3e(L3e(Pd(),PR()),e,t,l),l);break;default:E+="/"}break;case 123*p:a[c++]=dg(E)*m;case 125*p:case 59:case 0:switch(_){case 0:case 125:v=0;case 59+u:m==-1&&(E=AR(E,/\f/g,"")),f>0&&dg(E)-d&&PN(f>32?Ste(E+";",n,t,d-1,l):Ste(AR(E," ","")+";",n,t,d-2,l),l);break;case 59:E+=";";default:if(PN(D=yte(E,e,t,c,u,o,a,w,y=[],L=[],d,r),r),_===123)if(u===0)OR(E,e,D,D,y,r,d,a,L);else switch(h===99&&uD(E,3)===110?100:h){case 100:case 108:case 109:case 115:OR(i,D,D,n&&PN(yte(i,D,D,0,0,o,a,w,o,y=[],d,L),L),o,L,d,a,n?y:L);break;default:OR(E,D,D,D,[""],L,0,a,L)}}c=u=f=0,p=m=1,w=E="",d=s;break;case 58:d=1+dg(E),f=g;default:if(p<1){if(_==123)--p;else if(_==125&&p++==0&&C3e()==125)continue}switch(E+=xK(_),_*p){case 38:m=u>0?1:(E+="\f",-1);break;case 44:a[c++]=(dg(E)-1)*m,m=1;break;case 64:y0()===45&&(E+=q8(Pd())),h=y0(),u=d=dg(w=E+=E3e(PR())),_++;break;case 45:g===45&&dg(E)==2&&(p=0)}}return r}function yte(i,e,t,n,o,r,s,a,l,c,u,d){for(var h=o-1,f=o===0?r:[""],g=_3e(f),p=0,v=0,m=0;p0?f[_]+" "+w:AR(w,/&\f/g,f[_])))&&(l[m++]=y);return LK(i,e,t,o===0?wge:a,l,c,u,d)}function k3e(i,e,t,n){return LK(i,e,t,Cge,xK(b3e()),dD(i,2,-2),0,n)}function Ste(i,e,t,n,o){return LK(i,e,t,yge,dD(i,0,n),dD(i,n+1,-1),n,o)}function ZB(i,e){for(var t="",n=0;n1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{root:!0,parentSelectors:[]},o=n.root,r=n.injectHash,s=n.parentSelectors,a=t.hashId,l=t.layer;t.path;var c=t.hashPriority,u=t.transformers,d=u===void 0?[]:u;t.linters;var h="",f={};function g(w){var y=w.getName(a);if(!f[y]){var L=i(w.style,t,{root:!1,parentSelectors:s}),D=Ne(L,1),E=D[0];f[y]="@keyframes ".concat(w.getName(a)).concat(E)}}function p(w){var y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return w.forEach(function(L){Array.isArray(L)?p(L,y):L&&y.push(L)}),y}var v=p(Array.isArray(e)?e:[e]);if(v.forEach(function(w){var y=typeof w=="string"&&!o?{}:w;if(typeof y=="string")h+="".concat(y,` -`);else if(y._keyframe)g(y);else{var L=d.reduce(function(D,E){var I;return(E==null||(I=E.visit)===null||I===void 0?void 0:I.call(E,D))||D},y);Object.keys(L).forEach(function(D){var E=L[D];if(Kn(E)==="object"&&E&&(D!=="animationName"||!E._keyframe)&&!A3e(E)){var I=!1,k=D.trim(),R=!1;(o||r)&&a?k.startsWith("@")?I=!0:k=P3e(D,a,c):o&&!a&&(k==="&"||k==="")&&(k="",R=!0);var A=i(E,t,{root:R,injectHash:I,parentSelectors:[].concat(_t(s),[k])}),P=Ne(A,2),N=P[0],M=P[1];f=Ce(Ce({},f),M),h+="".concat(k).concat(N)}else{let F=function($,z){var K=$.replace(/[A-Z]/g,function(G){return"-".concat(G.toLowerCase())}),j=z;!f3e[$]&&typeof j=="number"&&j!==0&&(j="".concat(j,"px")),$==="animationName"&&z!==null&&z!==void 0&&z._keyframe&&(g(z),j=z.getName(a)),h+="".concat(K,":").concat(j,";")};var H,W=(H=E==null?void 0:E.value)!==null&&H!==void 0?H:E;Kn(E)==="object"&&E!==null&&E!==void 0&&E[kge]&&Array.isArray(W)?W.forEach(function($){F(D,$)}):F(D,W)}})}}),!o)h="{".concat(h,"}");else if(l&&KFe()){var m=l.split(","),_=m[m.length-1].trim();h="@layer ".concat(_," {").concat(h,"}"),m.length>1&&(h="@layer ".concat(l,"{%%%:%}").concat(h))}return[h,f]};function Ige(i,e){return gA("".concat(i.join("%")).concat(e))}function F3e(){return null}var Tge="style";function JB(i,e){var t=i.token,n=i.path,o=i.hashId,r=i.layer,s=i.nonce,a=i.clientOnly,l=i.order,c=l===void 0?0:l,u=x.exports.useContext(b4),d=u.autoClear;u.mock;var h=u.defaultCache,f=u.hashPriority,g=u.container,p=u.ssrInline,v=u.transformers,m=u.linters,_=u.cache,w=t._tokenKey,y=[w].concat(_t(n)),L=qB,D=SK(Tge,y,function(){var A=y.join("|");if(N3e(A)){var P=R3e(A),N=Ne(P,2),M=N[0],H=N[1];if(M)return[M,w,H,{},a,c]}var W=e(),F=O3e(W,{hashId:o,hashPriority:f,layer:r,path:n.join("-"),transformers:v,linters:m}),$=Ne(F,2),z=$[0],K=$[1],j=QB(z),G=Ige(y,j);return[j,w,G,K,a,c]},function(A,P){var N=Ne(A,3),M=N[2];(P||d)&&qB&&cD(M,{mark:Ad})},function(A){var P=Ne(A,4),N=P[0];P[1];var M=P[2],H=P[3];if(L&&N!==Ege){var W={mark:Ad,prepend:"queue",attachTo:g,priority:c},F=typeof s=="function"?s():s;F&&(W.csp={nonce:F});var $=fv(N,M,W);$[vm]=_.instanceId,$.setAttribute(oy,w),Object.keys(H).forEach(function(z){fv(QB(H[z]),"_effect-".concat(z),W)})}}),E=Ne(D,3),I=E[0],k=E[1],R=E[2];return function(A){var P;if(!p||L||!h)P=x.exports.createElement(F3e,null);else{var N;P=x.exports.createElement("style",Ct({},(N={},me(N,oy,k),me(N,Ad,R),N),{dangerouslySetInnerHTML:{__html:I}}))}return x.exports.createElement(x.exports.Fragment,null,P,A)}}var B3e=function(e,t,n){var o=Ne(e,6),r=o[0],s=o[1],a=o[2],l=o[3],c=o[4],u=o[5],d=n||{},h=d.plain;if(c)return null;var f=r,g={"data-rc-order":"prependQueue","data-rc-priority":"".concat(u)};return f=pA(r,s,a,g,h),l&&Object.keys(l).forEach(function(p){if(!t[p]){t[p]=!0;var v=QB(l[p]);f+=pA(v,s,"_effect-".concat(p),g,h)}}),[u,a,f]},Nge="cssVar",W3e=function(e,t){var n=e.key,o=e.prefix,r=e.unitless,s=e.ignore,a=e.token,l=e.scope,c=l===void 0?"":l,u=x.exports.useContext(b4),d=u.cache.instanceId,h=u.container,f=a._tokenKey,g=[].concat(_t(e.path),[n,c,f]),p=SK(Nge,g,function(){var v=t(),m=_ge(v,n,{prefix:o,unitless:r,ignore:s,scope:c}),_=Ne(m,2),w=_[0],y=_[1],L=Ige(g,y);return[w,y,L,n]},function(v){var m=Ne(v,3),_=m[2];qB&&cD(_,{mark:Ad})},function(v){var m=Ne(v,3),_=m[1],w=m[2];if(!!_){var y=fv(_,w,{mark:Ad,prepend:"queue",attachTo:h,priority:-999});y[vm]=d,y.setAttribute(oy,n)}});return p},V3e=function(e,t,n){var o=Ne(e,4),r=o[1],s=o[2],a=o[3],l=n||{},c=l.plain;if(!r)return null;var u=-999,d={"data-rc-order":"prependQueue","data-rc-priority":"".concat(u)},h=pA(r,a,s,d,c);return[u,s,h]},Cx;Cx={},me(Cx,Tge,B3e),me(Cx,bge,h3e),me(Cx,Nge,V3e);var ji=function(){function i(e,t){fa(this,i),me(this,"name",void 0),me(this,"style",void 0),me(this,"_keyframe",!0),this.name=e,this.style=t}return ga(i,[{key:"getName",value:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return t?"".concat(t,"-").concat(this.name):this.name}}]),i}();function L1(i){return i.notSplit=!0,i}L1(["borderTop","borderBottom"]),L1(["borderTop"]),L1(["borderBottom"]),L1(["borderLeft","borderRight"]),L1(["borderLeft"]),L1(["borderRight"]);var H3e=x.exports.createContext({}),EK=H3e;function Rge(i){return cge(i)||rge(i)||CK(i)||uge()}function zh(i,e){for(var t=i,n=0;n3&&arguments[3]!==void 0?arguments[3]:!1;return e.length&&n&&t===void 0&&!zh(i,e.slice(0,-1))?i:Mge(i,e,t,n)}function $3e(i){return Kn(i)==="object"&&i!==null&&Object.getPrototypeOf(i)===Object.prototype}function Lte(i){return Array.isArray(i)?[]:{}}var z3e=typeof Reflect=="undefined"?Object.keys:Reflect.ownKeys;function SC(){for(var i=arguments.length,e=new Array(i),t=0;t{const i=()=>{};return i.deprecated=U3e,i};var Age=x.exports.createContext(void 0),K3e={items_per_page:"/ page",jump_to:"Go to",jump_to_confirm:"confirm",page:"Page",prev_page:"Previous Page",next_page:"Next Page",prev_5:"Previous 5 Pages",next_5:"Next 5 Pages",prev_3:"Previous 3 Pages",next_3:"Next 3 Pages",page_size:"Page Size"},q3e={locale:"en_US",today:"Today",now:"Now",backToToday:"Back to today",ok:"OK",clear:"Clear",month:"Month",year:"Year",timeSelect:"select time",dateSelect:"select date",weekSelect:"Choose a week",monthSelect:"Choose a month",yearSelect:"Choose a year",decadeSelect:"Choose a decade",yearFormat:"YYYY",dateFormat:"M/D/YYYY",dayFormat:"D",dateTimeFormat:"M/D/YYYY HH:mm:ss",monthBeforeYear:!0,previousMonth:"Previous month (PageUp)",nextMonth:"Next month (PageDown)",previousYear:"Last year (Control + left)",nextYear:"Next year (Control + right)",previousDecade:"Last decade",nextDecade:"Next decade",previousCentury:"Last century",nextCentury:"Next century"};const G3e={placeholder:"Select time",rangePlaceholder:["Start time","End time"]};var Pge=G3e;const X3e={lang:Object.assign({placeholder:"Select date",yearPlaceholder:"Select year",quarterPlaceholder:"Select quarter",monthPlaceholder:"Select month",weekPlaceholder:"Select week",rangePlaceholder:["Start date","End date"],rangeYearPlaceholder:["Start year","End year"],rangeQuarterPlaceholder:["Start quarter","End quarter"],rangeMonthPlaceholder:["Start month","End month"],rangeWeekPlaceholder:["Start week","End week"]},q3e),timePickerLocale:Object.assign({},Pge)};var Ete=X3e;const dc="${label} is not a valid ${type}",Y3e={locale:"en",Pagination:K3e,DatePicker:Ete,TimePicker:Pge,Calendar:Ete,global:{placeholder:"Please select"},Table:{filterTitle:"Filter menu",filterConfirm:"OK",filterReset:"Reset",filterEmptyText:"No filters",filterCheckall:"Select all items",filterSearchPlaceholder:"Search in filters",emptyText:"No data",selectAll:"Select current page",selectInvert:"Invert current page",selectNone:"Clear all data",selectionAll:"Select all data",sortTitle:"Sort",expand:"Expand row",collapse:"Collapse row",triggerDesc:"Click to sort descending",triggerAsc:"Click to sort ascending",cancelSort:"Click to cancel sorting"},Tour:{Next:"Next",Previous:"Previous",Finish:"Finish"},Modal:{okText:"OK",cancelText:"Cancel",justOkText:"OK"},Popconfirm:{okText:"OK",cancelText:"Cancel"},Transfer:{titles:["",""],searchPlaceholder:"Search here",itemUnit:"item",itemsUnit:"items",remove:"Remove",selectCurrent:"Select current page",removeCurrent:"Remove current page",selectAll:"Select all data",removeAll:"Remove all data",selectInvert:"Invert current page"},Upload:{uploading:"Uploading...",removeFile:"Remove file",uploadError:"Upload error",previewFile:"Preview file",downloadFile:"Download file"},Empty:{description:"No data"},Icon:{icon:"icon"},Text:{edit:"Edit",copy:"Copy",copied:"Copied",expand:"Expand"},PageHeader:{back:"Back"},Form:{optional:"(optional)",defaultValidateMessages:{default:"Field validation error for ${label}",required:"Please enter ${label}",enum:"${label} must be one of [${enum}]",whitespace:"${label} cannot be a blank character",date:{format:"${label} date format is invalid",parse:"${label} cannot be converted to a date",invalid:"${label} is an invalid date"},types:{string:dc,method:dc,array:dc,object:dc,number:dc,date:dc,boolean:dc,integer:dc,float:dc,regexp:dc,email:dc,url:dc,hex:dc},string:{len:"${label} must be ${len} characters",min:"${label} must be at least ${min} characters",max:"${label} must be up to ${max} characters",range:"${label} must be between ${min}-${max} characters"},number:{len:"${label} must be equal to ${len}",min:"${label} must be minimum ${min}",max:"${label} must be maximum ${max}",range:"${label} must be between ${min}-${max}"},array:{len:"Must be ${len} ${label}",min:"At least ${min} ${label}",max:"At most ${max} ${label}",range:"The amount of ${label} must be between ${min}-${max}"},pattern:{mismatch:"${label} does not match the pattern ${pattern}"}}},Image:{preview:"Preview"},QRCode:{expired:"QR code expired",refresh:"Refresh",scanned:"Scanned"},ColorPicker:{presetEmpty:"Empty"}};var gv=Y3e;let FR=Object.assign({},gv.Modal),BR=[];const Dte=()=>BR.reduce((i,e)=>Object.assign(Object.assign({},i),e),gv.Modal);function Z3e(i){if(i){const e=Object.assign({},i);return BR.push(e),FR=Dte(),()=>{BR=BR.filter(t=>t!==e),FR=Dte()}}FR=Object.assign({},gv.Modal)}function Oge(){return FR}const Q3e=x.exports.createContext(void 0);var DK=Q3e;const J3e=(i,e)=>{const t=x.exports.useContext(DK),n=x.exports.useMemo(()=>{var r;const s=e||gv[i],a=(r=t==null?void 0:t[i])!==null&&r!==void 0?r:{};return Object.assign(Object.assign({},typeof s=="function"?s():s),a||{})},[i,e,t]),o=x.exports.useMemo(()=>{const r=t==null?void 0:t.locale;return(t==null?void 0:t.exist)&&!r?gv.locale:r},[t]);return[n,o]};var yI=J3e;const e8e="internalMark",t8e=i=>{const{locale:e={},children:t,_ANT_MARK__:n}=i;x.exports.useEffect(()=>Z3e(e&&e.Modal),[e]);const o=x.exports.useMemo(()=>Object.assign(Object.assign({},e),{exist:!0}),[e]);return x.exports.createElement(DK.Provider,{value:o},t)};var n8e=t8e;function sa(i,e){i8e(i)&&(i="100%");var t=o8e(i);return i=e===360?i:Math.min(e,Math.max(0,parseFloat(i))),t&&(i=parseInt(String(i*e),10)/100),Math.abs(i-e)<1e-6?1:(e===360?i=(i<0?i%e+e:i%e)/parseFloat(String(e)):i=i%e/parseFloat(String(e)),i)}function ON(i){return Math.min(1,Math.max(0,i))}function i8e(i){return typeof i=="string"&&i.indexOf(".")!==-1&&parseFloat(i)===1}function o8e(i){return typeof i=="string"&&i.indexOf("%")!==-1}function Fge(i){return i=parseFloat(i),(isNaN(i)||i<0||i>1)&&(i=1),i}function FN(i){return i<=1?"".concat(Number(i)*100,"%"):i}function t0(i){return i.length===1?"0"+i:String(i)}function r8e(i,e,t){return{r:sa(i,255)*255,g:sa(e,255)*255,b:sa(t,255)*255}}function kte(i,e,t){i=sa(i,255),e=sa(e,255),t=sa(t,255);var n=Math.max(i,e,t),o=Math.min(i,e,t),r=0,s=0,a=(n+o)/2;if(n===o)s=0,r=0;else{var l=n-o;switch(s=a>.5?l/(2-n-o):l/(n+o),n){case i:r=(e-t)/l+(e1&&(t-=1),t<1/6?i+(e-i)*(6*t):t<1/2?e:t<2/3?i+(e-i)*(2/3-t)*6:i}function s8e(i,e,t){var n,o,r;if(i=sa(i,360),e=sa(e,100),t=sa(t,100),e===0)o=t,r=t,n=t;else{var s=t<.5?t*(1+e):t+e-t*e,a=2*t-s;n=G8(a,s,i+1/3),o=G8(a,s,i),r=G8(a,s,i-1/3)}return{r:n*255,g:o*255,b:r*255}}function eW(i,e,t){i=sa(i,255),e=sa(e,255),t=sa(t,255);var n=Math.max(i,e,t),o=Math.min(i,e,t),r=0,s=n,a=n-o,l=n===0?0:a/n;if(n===o)r=0;else{switch(n){case i:r=(e-t)/a+(e>16,g:(i&65280)>>8,b:i&255}}var nW={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function aC(i){var e={r:0,g:0,b:0},t=1,n=null,o=null,r=null,s=!1,a=!1;return typeof i=="string"&&(i=f8e(i)),typeof i=="object"&&(Kf(i.r)&&Kf(i.g)&&Kf(i.b)?(e=r8e(i.r,i.g,i.b),s=!0,a=String(i.r).substr(-1)==="%"?"prgb":"rgb"):Kf(i.h)&&Kf(i.s)&&Kf(i.v)?(n=FN(i.s),o=FN(i.v),e=a8e(i.h,n,o),s=!0,a="hsv"):Kf(i.h)&&Kf(i.s)&&Kf(i.l)&&(n=FN(i.s),r=FN(i.l),e=s8e(i.h,n,r),s=!0,a="hsl"),Object.prototype.hasOwnProperty.call(i,"a")&&(t=i.a)),t=Fge(t),{ok:s,format:i.format||a,r:Math.min(255,Math.max(e.r,0)),g:Math.min(255,Math.max(e.g,0)),b:Math.min(255,Math.max(e.b,0)),a:t}}var d8e="[-\\+]?\\d+%?",h8e="[-\\+]?\\d*\\.\\d+%?",_m="(?:".concat(h8e,")|(?:").concat(d8e,")"),X8="[\\s|\\(]+(".concat(_m,")[,|\\s]+(").concat(_m,")[,|\\s]+(").concat(_m,")\\s*\\)?"),Y8="[\\s|\\(]+(".concat(_m,")[,|\\s]+(").concat(_m,")[,|\\s]+(").concat(_m,")[,|\\s]+(").concat(_m,")\\s*\\)?"),id={CSS_UNIT:new RegExp(_m),rgb:new RegExp("rgb"+X8),rgba:new RegExp("rgba"+Y8),hsl:new RegExp("hsl"+X8),hsla:new RegExp("hsla"+Y8),hsv:new RegExp("hsv"+X8),hsva:new RegExp("hsva"+Y8),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function f8e(i){if(i=i.trim().toLowerCase(),i.length===0)return!1;var e=!1;if(nW[i])i=nW[i],e=!0;else if(i==="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var t=id.rgb.exec(i);return t?{r:t[1],g:t[2],b:t[3]}:(t=id.rgba.exec(i),t?{r:t[1],g:t[2],b:t[3],a:t[4]}:(t=id.hsl.exec(i),t?{h:t[1],s:t[2],l:t[3]}:(t=id.hsla.exec(i),t?{h:t[1],s:t[2],l:t[3],a:t[4]}:(t=id.hsv.exec(i),t?{h:t[1],s:t[2],v:t[3]}:(t=id.hsva.exec(i),t?{h:t[1],s:t[2],v:t[3],a:t[4]}:(t=id.hex8.exec(i),t?{r:pc(t[1]),g:pc(t[2]),b:pc(t[3]),a:Ite(t[4]),format:e?"name":"hex8"}:(t=id.hex6.exec(i),t?{r:pc(t[1]),g:pc(t[2]),b:pc(t[3]),format:e?"name":"hex"}:(t=id.hex4.exec(i),t?{r:pc(t[1]+t[1]),g:pc(t[2]+t[2]),b:pc(t[3]+t[3]),a:Ite(t[4]+t[4]),format:e?"name":"hex8"}:(t=id.hex3.exec(i),t?{r:pc(t[1]+t[1]),g:pc(t[2]+t[2]),b:pc(t[3]+t[3]),format:e?"name":"hex"}:!1)))))))))}function Kf(i){return Boolean(id.CSS_UNIT.exec(String(i)))}var ta=function(){function i(e,t){e===void 0&&(e=""),t===void 0&&(t={});var n;if(e instanceof i)return e;typeof e=="number"&&(e=u8e(e)),this.originalInput=e;var o=aC(e);this.originalInput=e,this.r=o.r,this.g=o.g,this.b=o.b,this.a=o.a,this.roundA=Math.round(100*this.a)/100,this.format=(n=t.format)!==null&&n!==void 0?n:o.format,this.gradientType=t.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=o.ok}return i.prototype.isDark=function(){return this.getBrightness()<128},i.prototype.isLight=function(){return!this.isDark()},i.prototype.getBrightness=function(){var e=this.toRgb();return(e.r*299+e.g*587+e.b*114)/1e3},i.prototype.getLuminance=function(){var e=this.toRgb(),t,n,o,r=e.r/255,s=e.g/255,a=e.b/255;return r<=.03928?t=r/12.92:t=Math.pow((r+.055)/1.055,2.4),s<=.03928?n=s/12.92:n=Math.pow((s+.055)/1.055,2.4),a<=.03928?o=a/12.92:o=Math.pow((a+.055)/1.055,2.4),.2126*t+.7152*n+.0722*o},i.prototype.getAlpha=function(){return this.a},i.prototype.setAlpha=function(e){return this.a=Fge(e),this.roundA=Math.round(100*this.a)/100,this},i.prototype.isMonochrome=function(){var e=this.toHsl().s;return e===0},i.prototype.toHsv=function(){var e=eW(this.r,this.g,this.b);return{h:e.h*360,s:e.s,v:e.v,a:this.a}},i.prototype.toHsvString=function(){var e=eW(this.r,this.g,this.b),t=Math.round(e.h*360),n=Math.round(e.s*100),o=Math.round(e.v*100);return this.a===1?"hsv(".concat(t,", ").concat(n,"%, ").concat(o,"%)"):"hsva(".concat(t,", ").concat(n,"%, ").concat(o,"%, ").concat(this.roundA,")")},i.prototype.toHsl=function(){var e=kte(this.r,this.g,this.b);return{h:e.h*360,s:e.s,l:e.l,a:this.a}},i.prototype.toHslString=function(){var e=kte(this.r,this.g,this.b),t=Math.round(e.h*360),n=Math.round(e.s*100),o=Math.round(e.l*100);return this.a===1?"hsl(".concat(t,", ").concat(n,"%, ").concat(o,"%)"):"hsla(".concat(t,", ").concat(n,"%, ").concat(o,"%, ").concat(this.roundA,")")},i.prototype.toHex=function(e){return e===void 0&&(e=!1),tW(this.r,this.g,this.b,e)},i.prototype.toHexString=function(e){return e===void 0&&(e=!1),"#"+this.toHex(e)},i.prototype.toHex8=function(e){return e===void 0&&(e=!1),l8e(this.r,this.g,this.b,this.a,e)},i.prototype.toHex8String=function(e){return e===void 0&&(e=!1),"#"+this.toHex8(e)},i.prototype.toHexShortString=function(e){return e===void 0&&(e=!1),this.a===1?this.toHexString(e):this.toHex8String(e)},i.prototype.toRgb=function(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}},i.prototype.toRgbString=function(){var e=Math.round(this.r),t=Math.round(this.g),n=Math.round(this.b);return this.a===1?"rgb(".concat(e,", ").concat(t,", ").concat(n,")"):"rgba(".concat(e,", ").concat(t,", ").concat(n,", ").concat(this.roundA,")")},i.prototype.toPercentageRgb=function(){var e=function(t){return"".concat(Math.round(sa(t,255)*100),"%")};return{r:e(this.r),g:e(this.g),b:e(this.b),a:this.a}},i.prototype.toPercentageRgbString=function(){var e=function(t){return Math.round(sa(t,255)*100)};return this.a===1?"rgb(".concat(e(this.r),"%, ").concat(e(this.g),"%, ").concat(e(this.b),"%)"):"rgba(".concat(e(this.r),"%, ").concat(e(this.g),"%, ").concat(e(this.b),"%, ").concat(this.roundA,")")},i.prototype.toName=function(){if(this.a===0)return"transparent";if(this.a<1)return!1;for(var e="#"+tW(this.r,this.g,this.b,!1),t=0,n=Object.entries(nW);t=0,r=!t&&o&&(e.startsWith("hex")||e==="name");return r?e==="name"&&this.a===0?this.toName():this.toRgbString():(e==="rgb"&&(n=this.toRgbString()),e==="prgb"&&(n=this.toPercentageRgbString()),(e==="hex"||e==="hex6")&&(n=this.toHexString()),e==="hex3"&&(n=this.toHexString(!0)),e==="hex4"&&(n=this.toHex8String(!0)),e==="hex8"&&(n=this.toHex8String()),e==="name"&&(n=this.toName()),e==="hsl"&&(n=this.toHslString()),e==="hsv"&&(n=this.toHsvString()),n||this.toHexString())},i.prototype.toNumber=function(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)},i.prototype.clone=function(){return new i(this.toString())},i.prototype.lighten=function(e){e===void 0&&(e=10);var t=this.toHsl();return t.l+=e/100,t.l=ON(t.l),new i(t)},i.prototype.brighten=function(e){e===void 0&&(e=10);var t=this.toRgb();return t.r=Math.max(0,Math.min(255,t.r-Math.round(255*-(e/100)))),t.g=Math.max(0,Math.min(255,t.g-Math.round(255*-(e/100)))),t.b=Math.max(0,Math.min(255,t.b-Math.round(255*-(e/100)))),new i(t)},i.prototype.darken=function(e){e===void 0&&(e=10);var t=this.toHsl();return t.l-=e/100,t.l=ON(t.l),new i(t)},i.prototype.tint=function(e){return e===void 0&&(e=10),this.mix("white",e)},i.prototype.shade=function(e){return e===void 0&&(e=10),this.mix("black",e)},i.prototype.desaturate=function(e){e===void 0&&(e=10);var t=this.toHsl();return t.s-=e/100,t.s=ON(t.s),new i(t)},i.prototype.saturate=function(e){e===void 0&&(e=10);var t=this.toHsl();return t.s+=e/100,t.s=ON(t.s),new i(t)},i.prototype.greyscale=function(){return this.desaturate(100)},i.prototype.spin=function(e){var t=this.toHsl(),n=(t.h+e)%360;return t.h=n<0?360+n:n,new i(t)},i.prototype.mix=function(e,t){t===void 0&&(t=50);var n=this.toRgb(),o=new i(e).toRgb(),r=t/100,s={r:(o.r-n.r)*r+n.r,g:(o.g-n.g)*r+n.g,b:(o.b-n.b)*r+n.b,a:(o.a-n.a)*r+n.a};return new i(s)},i.prototype.analogous=function(e,t){e===void 0&&(e=6),t===void 0&&(t=30);var n=this.toHsl(),o=360/t,r=[this];for(n.h=(n.h-(o*e>>1)+720)%360;--e;)n.h=(n.h+o)%360,r.push(new i(n));return r},i.prototype.complement=function(){var e=this.toHsl();return e.h=(e.h+180)%360,new i(e)},i.prototype.monochromatic=function(e){e===void 0&&(e=6);for(var t=this.toHsv(),n=t.h,o=t.s,r=t.v,s=[],a=1/e;e--;)s.push(new i({h:n,s:o,v:r})),r=(r+a)%1;return s},i.prototype.splitcomplement=function(){var e=this.toHsl(),t=e.h;return[this,new i({h:(t+72)%360,s:e.s,l:e.l}),new i({h:(t+216)%360,s:e.s,l:e.l})]},i.prototype.onBackground=function(e){var t=this.toRgb(),n=new i(e).toRgb(),o=t.a+n.a*(1-t.a);return new i({r:(t.r*t.a+n.r*n.a*(1-t.a))/o,g:(t.g*t.a+n.g*n.a*(1-t.a))/o,b:(t.b*t.a+n.b*n.a*(1-t.a))/o,a:o})},i.prototype.triad=function(){return this.polyad(3)},i.prototype.tetrad=function(){return this.polyad(4)},i.prototype.polyad=function(e){for(var t=this.toHsl(),n=t.h,o=[this],r=360/e,s=1;s=60&&Math.round(i.h)<=240?n=t?Math.round(i.h)-BN*e:Math.round(i.h)+BN*e:n=t?Math.round(i.h)+BN*e:Math.round(i.h)-BN*e,n<0?n+=360:n>=360&&(n-=360),n}function Mte(i,e,t){if(i.h===0&&i.s===0)return i.s;var n;return t?n=i.s-Tte*e:e===Wge?n=i.s+Tte:n=i.s+g8e*e,n>1&&(n=1),t&&e===Bge&&n>.1&&(n=.1),n<.06&&(n=.06),Number(n.toFixed(2))}function Ate(i,e,t){var n;return t?n=i.v+p8e*e:n=i.v-m8e*e,n>1&&(n=1),Number(n.toFixed(2))}function $0(i){for(var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=[],n=aC(i),o=Bge;o>0;o-=1){var r=Nte(n),s=WN(aC({h:Rte(r,o,!0),s:Mte(r,o,!0),v:Ate(r,o,!0)}));t.push(s)}t.push(WN(n));for(var a=1;a<=Wge;a+=1){var l=Nte(n),c=WN(aC({h:Rte(l,a),s:Mte(l,a),v:Ate(l,a)}));t.push(c)}return e.theme==="dark"?v8e.map(function(u){var d=u.index,h=u.opacity,f=WN(_8e(aC(e.backgroundColor||"#141414"),aC(t[d]),h*100));return f}):t}var Z8={red:"#F5222D",volcano:"#FA541C",orange:"#FA8C16",gold:"#FAAD14",yellow:"#FADB14",lime:"#A0D911",green:"#52C41A",cyan:"#13C2C2",blue:"#1677FF",geekblue:"#2F54EB",purple:"#722ED1",magenta:"#EB2F96",grey:"#666666"},WR={},Q8={};Object.keys(Z8).forEach(function(i){WR[i]=$0(Z8[i]),WR[i].primary=WR[i][5],Q8[i]=$0(Z8[i],{theme:"dark",backgroundColor:"#141414"}),Q8[i].primary=Q8[i][5]});var b8e=WR.blue;const C8e=i=>{const{controlHeight:e}=i;return{controlHeightSM:e*.75,controlHeightXS:e*.5,controlHeightLG:e*1.25}};var w8e=C8e;function y8e(i){const{sizeUnit:e,sizeStep:t}=i;return{sizeXXL:e*(t+8),sizeXL:e*(t+4),sizeLG:e*(t+2),sizeMD:e*(t+1),sizeMS:e*t,size:e*t,sizeSM:e*(t-1),sizeXS:e*(t-2),sizeXXS:e*(t-3)}}const Vge={blue:"#1677ff",purple:"#722ED1",cyan:"#13C2C2",green:"#52C41A",magenta:"#EB2F96",pink:"#eb2f96",red:"#F5222D",orange:"#FA8C16",yellow:"#FADB14",volcano:"#FA541C",geekblue:"#2F54EB",gold:"#FAAD14",lime:"#A0D911"},S8e=Object.assign(Object.assign({},Vge),{colorPrimary:"#1677ff",colorSuccess:"#52c41a",colorWarning:"#faad14",colorError:"#ff4d4f",colorInfo:"#1677ff",colorLink:"",colorTextBase:"",colorBgBase:"",fontFamily:`-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, + */var CK=Symbol.for("react.element"),yK=Symbol.for("react.portal"),a4=Symbol.for("react.fragment"),l4=Symbol.for("react.strict_mode"),c4=Symbol.for("react.profiler"),u4=Symbol.for("react.provider"),d4=Symbol.for("react.context"),SFe=Symbol.for("react.server_context"),h4=Symbol.for("react.forward_ref"),f4=Symbol.for("react.suspense"),g4=Symbol.for("react.suspense_list"),p4=Symbol.for("react.memo"),m4=Symbol.for("react.lazy"),xFe=Symbol.for("react.offscreen"),lge;lge=Symbol.for("react.module.reference");function $u(i){if(typeof i=="object"&&i!==null){var e=i.$$typeof;switch(e){case CK:switch(i=i.type,i){case a4:case c4:case l4:case f4:case g4:return i;default:switch(i=i&&i.$$typeof,i){case SFe:case d4:case h4:case m4:case p4:case u4:return i;default:return e}}case yK:return e}}}vo.ContextConsumer=d4;vo.ContextProvider=u4;vo.Element=CK;vo.ForwardRef=h4;vo.Fragment=a4;vo.Lazy=m4;vo.Memo=p4;vo.Portal=yK;vo.Profiler=c4;vo.StrictMode=l4;vo.Suspense=f4;vo.SuspenseList=g4;vo.isAsyncMode=function(){return!1};vo.isConcurrentMode=function(){return!1};vo.isContextConsumer=function(i){return $u(i)===d4};vo.isContextProvider=function(i){return $u(i)===u4};vo.isElement=function(i){return typeof i=="object"&&i!==null&&i.$$typeof===CK};vo.isForwardRef=function(i){return $u(i)===h4};vo.isFragment=function(i){return $u(i)===a4};vo.isLazy=function(i){return $u(i)===m4};vo.isMemo=function(i){return $u(i)===p4};vo.isPortal=function(i){return $u(i)===yK};vo.isProfiler=function(i){return $u(i)===c4};vo.isStrictMode=function(i){return $u(i)===l4};vo.isSuspense=function(i){return $u(i)===f4};vo.isSuspenseList=function(i){return $u(i)===g4};vo.isValidElementType=function(i){return typeof i=="string"||typeof i=="function"||i===a4||i===c4||i===l4||i===f4||i===g4||i===xFe||typeof i=="object"&&i!==null&&(i.$$typeof===m4||i.$$typeof===p4||i.$$typeof===u4||i.$$typeof===d4||i.$$typeof===h4||i.$$typeof===lge||i.getModuleId!==void 0)};vo.typeOf=$u;bK.exports=vo;function ip(i){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=[];return Bt.Children.forEach(i,function(n){n==null&&!e.keepEmpty||(Array.isArray(n)?t=t.concat(ip(n)):bK.exports.isFragment(n)&&n.props?t=t.concat(ip(n.props.children,e)):t.push(n))}),t}var zB={},LFe=function(e){};function EFe(i,e){}function DFe(i,e){}function kFe(){zB={}}function cge(i,e,t){!e&&!zB[t]&&(i(!1,t),zB[t]=!0)}function rr(i,e){cge(EFe,i,e)}function IFe(i,e){cge(DFe,i,e)}rr.preMessage=LFe;rr.resetWarned=kFe;rr.noteOnce=IFe;function Kn(i){return Kn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Kn(i)}function TFe(i,e){if(Kn(i)!="object"||!i)return i;var t=i[Symbol.toPrimitive];if(t!==void 0){var n=t.call(i,e||"default");if(Kn(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(i)}function uge(i){var e=TFe(i,"string");return Kn(e)=="symbol"?e:String(e)}function me(i,e,t){return e=uge(e),e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function bte(i,e){var t=Object.keys(i);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(i);e&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(i,o).enumerable})),t.push.apply(t,n)}return t}function Ce(i){for(var e=1;ei.length)&&(e=i.length);for(var t=0,n=new Array(e);t1&&arguments[1]!==void 0?arguments[1]:1;yte+=1;var n=yte;function o(r){if(r===0)pge(n),e();else{var s=fge(function(){o(r-1)});LK.set(n,s)}}return o(t),n};Xi.cancel=function(i){var e=LK.get(i);return pge(i),gge(e)};function mge(i){if(Array.isArray(i))return i}function $Fe(i,e){var t=i==null?null:typeof Symbol!="undefined"&&i[Symbol.iterator]||i["@@iterator"];if(t!=null){var n,o,r,s,a=[],l=!0,c=!1;try{if(r=(t=t.call(i)).next,e===0){if(Object(t)!==t)return;l=!1}else for(;!(l=(n=r.call(t)).done)&&(a.push(n.value),a.length!==e);l=!0);}catch(u){c=!0,o=u}finally{try{if(!l&&t.return!=null&&(s=t.return(),Object(s)!==s))return}finally{if(c)throw o}}return a}}function vge(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ne(i,e){return mge(i)||$Fe(i,e)||xK(i,e)||vge()}function vA(i){for(var e=0,t,n=0,o=i.length;o>=4;++n,o-=4)t=i.charCodeAt(n)&255|(i.charCodeAt(++n)&255)<<8|(i.charCodeAt(++n)&255)<<16|(i.charCodeAt(++n)&255)<<24,t=(t&65535)*1540483477+((t>>>16)*59797<<16),t^=t>>>24,e=(t&65535)*1540483477+((t>>>16)*59797<<16)^(e&65535)*1540483477+((e>>>16)*59797<<16);switch(o){case 3:e^=(i.charCodeAt(n+2)&255)<<16;case 2:e^=(i.charCodeAt(n+1)&255)<<8;case 1:e^=i.charCodeAt(n)&255,e=(e&65535)*1540483477+((e>>>16)*59797<<16)}return e^=e>>>13,e=(e&65535)*1540483477+((e>>>16)*59797<<16),((e^e>>>15)>>>0).toString(36)}function Fa(){return!!(typeof window!="undefined"&&window.document&&window.document.createElement)}function qB(i,e){if(!i)return!1;if(i.contains)return i.contains(e);for(var t=e;t;){if(t===i)return!0;t=t.parentNode}return!1}var wte="data-rc-order",Ste="data-rc-priority",zFe="rc-util-key",GB=new Map;function _ge(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=i.mark;return e?e.startsWith("data-")?e:"data-".concat(e):zFe}function _4(i){if(i.attachTo)return i.attachTo;var e=document.querySelector("head");return e||document.body}function UFe(i){return i==="queue"?"prependQueue":i?"prepend":"append"}function bge(i){return Array.from((GB.get(i)||i).children).filter(function(e){return e.tagName==="STYLE"})}function Cge(i){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Fa())return null;var t=e.csp,n=e.prepend,o=e.priority,r=o===void 0?0:o,s=UFe(n),a=s==="prependQueue",l=document.createElement("style");l.setAttribute(wte,s),a&&r&&l.setAttribute(Ste,"".concat(r)),t!=null&&t.nonce&&(l.nonce=t==null?void 0:t.nonce),l.innerHTML=i;var c=_4(e),u=c.firstChild;if(n){if(a){var d=bge(c).filter(function(h){if(!["prepend","prependQueue"].includes(h.getAttribute(wte)))return!1;var f=Number(h.getAttribute(Ste)||0);return r>=f});if(d.length)return c.insertBefore(l,d[d.length-1].nextSibling),l}c.insertBefore(l,u)}else c.appendChild(l);return l}function yge(i){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=_4(e);return bge(t).find(function(n){return n.getAttribute(_ge(e))===i})}function uD(i){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=yge(i,e);if(t){var n=_4(e);n.removeChild(t)}}function jFe(i,e){var t=GB.get(i);if(!t||!qB(document,t)){var n=Cge("",e),o=n.parentNode;GB.set(i,o),i.removeChild(n)}}function gv(i,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=_4(t);jFe(n,t);var o=yge(e,t);if(o){var r,s;if((r=t.csp)!==null&&r!==void 0&&r.nonce&&o.nonce!==((s=t.csp)===null||s===void 0?void 0:s.nonce)){var a;o.nonce=(a=t.csp)===null||a===void 0?void 0:a.nonce}return o.innerHTML!==i&&(o.innerHTML=i),o}var l=Cge(i,t);return l.setAttribute(_ge(t),e),l}function KFe(i,e){if(i==null)return{};var t={},n=Object.keys(i),o,r;for(r=0;r=0)&&(t[o]=i[o]);return t}function Hn(i,e){if(i==null)return{};var t=KFe(i,e),n,o;if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(i);for(o=0;o=0)&&(!Object.prototype.propertyIsEnumerable.call(i,n)||(t[n]=i[n]))}return t}function b4(i,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,n=new Set;function o(r,s){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,l=n.has(r);if(rr(!l,"Warning: There may be circular references"),l)return!1;if(r===s)return!0;if(t&&a>1)return!1;n.add(r);var c=a+1;if(Array.isArray(r)){if(!Array.isArray(s)||r.length!==s.length)return!1;for(var u=0;u1&&arguments[1]!==void 0?arguments[1]:!1,s={map:this.cache};return t.forEach(function(a){if(!s)s=void 0;else{var l;s=(l=s)===null||l===void 0||(l=l.map)===null||l===void 0?void 0:l.get(a)}}),(n=s)!==null&&n!==void 0&&n.value&&r&&(s.value[1]=this.cacheCallTimes++),(o=s)===null||o===void 0?void 0:o.value}},{key:"get",value:function(t){var n;return(n=this.internalGet(t,!0))===null||n===void 0?void 0:n[0]}},{key:"has",value:function(t){return!!this.internalGet(t)}},{key:"set",value:function(t,n){var o=this;if(!this.has(t)){if(this.size()+1>i.MAX_CACHE_SIZE+i.MAX_CACHE_OFFSET){var r=this.keys.reduce(function(c,u){var d=Ne(c,2),h=d[1];return o.internalGet(u)[1]0,void 0),Lte+=1}return pa(i,[{key:"getDerivativeToken",value:function(t){return this.derivatives.reduce(function(n,o){return o(t,n)},void 0)}}]),i}(),U8=new EK;function XB(i){var e=Array.isArray(i)?i:[i];return U8.has(e)||U8.set(e,new wge(e)),U8.get(e)}var ZFe=new WeakMap,j8={};function QFe(i,e){for(var t=ZFe,n=0;n3&&arguments[3]!==void 0?arguments[3]:{},r=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;if(r)return i;var s=Ce(Ce({},o),{},(n={},me(n,ow,e),me(n,Ad,t),n)),a=Object.keys(s).map(function(l){var c=s[l];return c?"".concat(l,'="').concat(c,'"'):null}).filter(function(l){return l}).join(" ");return"")}var xge=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";return"--".concat(t?"".concat(t,"-"):"").concat(e).replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/([A-Z]+)([A-Z][a-z0-9]+)/g,"$1-$2").replace(/([a-z])([A-Z0-9])/g,"$1-$2").toLowerCase()},t3e=function(e,t,n){return Object.keys(e).length?".".concat(t).concat(n!=null&&n.scope?".".concat(n.scope):"","{").concat(Object.entries(e).map(function(o){var r=Ne(o,2),s=r[0],a=r[1];return"".concat(s,":").concat(a,";")}).join(""),"}"):""},Lge=function(e,t,n){var o={},r={};return Object.entries(e).forEach(function(s){var a,l,c=Ne(s,2),u=c[0],d=c[1];if(n!=null&&(a=n.preserve)!==null&&a!==void 0&&a[u])r[u]=d;else if((typeof d=="string"||typeof d=="number")&&!(n!=null&&(l=n.ignore)!==null&&l!==void 0&&l[u])){var h,f=xge(u,n==null?void 0:n.prefix);o[f]=typeof d=="number"&&!(n!=null&&(h=n.unitless)!==null&&h!==void 0&&h[u])?"".concat(d,"px"):String(d),r[u]="var(".concat(f,")")}}),[r,t3e(o,t,{scope:n==null?void 0:n.scope})]},kte=Fa()?x.exports.useLayoutEffect:x.exports.useEffect,go=function(e,t){var n=x.exports.useRef(!0);kte(function(){return e(n.current)},t),kte(function(){return n.current=!1,function(){n.current=!0}},[])},ZB=function(e,t){go(function(n){if(!n)return e()},t)},n3e=Ce({},dI),Ite=n3e.useInsertionEffect,i3e=function(e,t,n){x.exports.useMemo(e,n),go(function(){return t(!0)},n)},o3e=Ite?function(i,e,t){return Ite(function(){return i(),e()},t)}:i3e,r3e=o3e,s3e=Ce({},dI),a3e=s3e.useInsertionEffect,l3e=function(e){var t=[],n=!1;function o(r){n||t.push(r)}return x.exports.useEffect(function(){return n=!1,function(){n=!0,t.length&&t.forEach(function(r){return r()})}},e),o},c3e=function(){return function(e){e()}},u3e=typeof a3e!="undefined"?l3e:c3e,d3e=u3e;function DK(i,e,t,n,o){var r=x.exports.useContext(C4),s=r.cache,a=[i].concat(_t(e)),l=a.join("_"),c=d3e([l]),u=function(g){s.update(a,function(p){var v=p||[void 0,void 0],m=Ne(v,2),_=m[0],y=_===void 0?0:_,w=m[1],L=w,D=L||t(),E=[y,D];return g?g(E):E})};x.exports.useMemo(function(){u()},[l]);var d=s.get(a),h=d[1];return r3e(function(){o==null||o(h)},function(f){return u(function(g){var p=Ne(g,2),v=p[0],m=p[1];return f&&v===0&&(o==null||o(h)),[v+1,m]}),function(){s.update(a,function(g){var p=g||[],v=Ne(p,2),m=v[0],_=m===void 0?0:m,y=v[1],w=_-1;return w===0?(c(function(){(f||!s.get(a))&&(n==null||n(y,!1))}),null):[_-1,y]})}},[l]),h}var h3e={},f3e="css",B_=new Map;function g3e(i){B_.set(i,(B_.get(i)||0)+1)}function p3e(i,e){if(typeof document!="undefined"){var t=document.querySelectorAll("style[".concat(ow,'="').concat(i,'"]'));t.forEach(function(n){if(n[_m]===e){var o;(o=n.parentNode)===null||o===void 0||o.removeChild(n)}})}}var m3e=0;function v3e(i,e){B_.set(i,(B_.get(i)||0)-1);var t=Array.from(B_.keys()),n=t.filter(function(o){var r=B_.get(o)||0;return r<=0});t.length-n.length>m3e&&n.forEach(function(o){p3e(o,e),B_.delete(o)})}var _3e=function(e,t,n,o){var r=n.getDerivativeToken(e),s=Ce(Ce({},r),t);return o&&(s=o(s)),s},Ege="token";function b3e(i,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=x.exports.useContext(C4),o=n.cache.instanceId,r=n.container,s=t.salt,a=s===void 0?"":s,l=t.override,c=l===void 0?h3e:l,u=t.formatToken,d=t.getComputedToken,h=t.cssVar,f=QFe(function(){return Object.assign.apply(Object,[{}].concat(_t(e)))},e),g=eE(f),p=eE(c),v=h?eE(h):"",m=DK(Ege,[a,i.id,g,p,v],function(){var _,y=d?d(f,c,i):_3e(f,c,i,u),w=Ce({},y),L="";if(h){var D=Lge(y,h.key,{prefix:h.prefix,ignore:h.ignore,unitless:h.unitless,preserve:h.preserve}),E=Ne(D,2);y=E[0],L=E[1]}var I=Dte(y,a);y._tokenKey=I,w._tokenKey=Dte(w,a);var k=(_=h==null?void 0:h.key)!==null&&_!==void 0?_:I;y._themeKey=k,g3e(k);var R="".concat(f3e,"-").concat(vA(I));return y._hashId=R,[y,R,w,L,(h==null?void 0:h.key)||""]},function(_){v3e(_[0]._themeKey,o)},function(_){var y=Ne(_,4),w=y[0],L=y[3];if(h&&L){var D=gv(L,vA("css-variables-".concat(w._themeKey)),{mark:Ad,prepend:"queue",attachTo:r,priority:-999});D[_m]=o,D.setAttribute(ow,w._themeKey)}});return m}var C3e=function(e,t,n){var o=Ne(e,5),r=o[2],s=o[3],a=o[4],l=n||{},c=l.plain;if(!s)return null;var u=r._tokenKey,d=-999,h={"data-rc-order":"prependQueue","data-rc-priority":"".concat(d)},f=_A(s,a,u,h,c);return[d,u,f]},y3e={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},Dge="comm",kge="rule",Ige="decl",w3e="@import",S3e="@keyframes",x3e="@layer",Tge=Math.abs,kK=String.fromCharCode;function Nge(i){return i.trim()}function FR(i,e,t){return i.replace(e,t)}function L3e(i,e,t){return i.indexOf(e,t)}function dD(i,e){return i.charCodeAt(e)|0}function hD(i,e,t){return i.slice(e,t)}function hg(i){return i.length}function E3e(i){return i.length}function BN(i,e){return e.push(i),i}var y4=1,rw=1,Rge=0,Ou=0,es=0,aS="";function IK(i,e,t,n,o,r,s,a){return{value:i,root:e,parent:t,type:n,props:o,children:r,line:y4,column:rw,length:s,return:"",siblings:a}}function D3e(){return es}function k3e(){return es=Ou>0?dD(aS,--Ou):0,rw--,es===10&&(rw=1,y4--),es}function Pd(){return es=Ou2||QB(es)>3?"":" "}function R3e(i,e){for(;--e&&Pd()&&!(es<48||es>102||es>57&&es<65||es>70&&es<97););return w4(i,BR()+(e<6&&S0()==32&&Pd()==32))}function JB(i){for(;Pd();)switch(es){case i:return Ou;case 34:case 39:i!==34&&i!==39&&JB(es);break;case 40:i===41&&JB(i);break;case 92:Pd();break}return Ou}function M3e(i,e){for(;Pd()&&i+es!==47+10;)if(i+es===42+42&&S0()===47)break;return"/*"+w4(e,Ou-1)+"*"+kK(i===47?i:Pd())}function A3e(i){for(;!QB(S0());)Pd();return w4(i,Ou)}function P3e(i){return T3e(WR("",null,null,null,[""],i=I3e(i),0,[0],i))}function WR(i,e,t,n,o,r,s,a,l){for(var c=0,u=0,d=s,h=0,f=0,g=0,p=1,v=1,m=1,_=0,y="",w=o,L=r,D=n,E=y;v;)switch(g=_,_=Pd()){case 40:if(g!=108&&dD(E,d-1)==58){L3e(E+=FR(q8(_),"&","&\f"),"&\f",Tge(c?a[c-1]:0))!=-1&&(m=-1);break}case 34:case 39:case 91:E+=q8(_);break;case 9:case 10:case 13:case 32:E+=N3e(g);break;case 92:E+=R3e(BR()-1,7);continue;case 47:switch(S0()){case 42:case 47:BN(O3e(M3e(Pd(),BR()),e,t,l),l);break;default:E+="/"}break;case 123*p:a[c++]=hg(E)*m;case 125*p:case 59:case 0:switch(_){case 0:case 125:v=0;case 59+u:m==-1&&(E=FR(E,/\f/g,"")),f>0&&hg(E)-d&&BN(f>32?Nte(E+";",n,t,d-1,l):Nte(FR(E," ","")+";",n,t,d-2,l),l);break;case 59:E+=";";default:if(BN(D=Tte(E,e,t,c,u,o,a,y,w=[],L=[],d,r),r),_===123)if(u===0)WR(E,e,D,D,w,r,d,a,L);else switch(h===99&&dD(E,3)===110?100:h){case 100:case 108:case 109:case 115:WR(i,D,D,n&&BN(Tte(i,D,D,0,0,o,a,y,o,w=[],d,L),L),o,L,d,a,n?w:L);break;default:WR(E,D,D,D,[""],L,0,a,L)}}c=u=f=0,p=m=1,y=E="",d=s;break;case 58:d=1+hg(E),f=g;default:if(p<1){if(_==123)--p;else if(_==125&&p++==0&&k3e()==125)continue}switch(E+=kK(_),_*p){case 38:m=u>0?1:(E+="\f",-1);break;case 44:a[c++]=(hg(E)-1)*m,m=1;break;case 64:S0()===45&&(E+=q8(Pd())),h=S0(),u=d=hg(y=E+=A3e(BR())),_++;break;case 45:g===45&&hg(E)==2&&(p=0)}}return r}function Tte(i,e,t,n,o,r,s,a,l,c,u,d){for(var h=o-1,f=o===0?r:[""],g=E3e(f),p=0,v=0,m=0;p0?f[_]+" "+y:FR(y,/&\f/g,f[_])))&&(l[m++]=w);return IK(i,e,t,o===0?kge:a,l,c,u,d)}function O3e(i,e,t,n){return IK(i,e,t,Dge,kK(D3e()),hD(i,2,-2),0,n)}function Nte(i,e,t,n,o){return IK(i,e,t,Ige,hD(i,0,n),hD(i,n+1,-1),n,o)}function eW(i,e){for(var t="",n=0;n1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{root:!0,parentSelectors:[]},o=n.root,r=n.injectHash,s=n.parentSelectors,a=t.hashId,l=t.layer;t.path;var c=t.hashPriority,u=t.transformers,d=u===void 0?[]:u;t.linters;var h="",f={};function g(y){var w=y.getName(a);if(!f[w]){var L=i(y.style,t,{root:!1,parentSelectors:s}),D=Ne(L,1),E=D[0];f[w]="@keyframes ".concat(y.getName(a)).concat(E)}}function p(y){var w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return y.forEach(function(L){Array.isArray(L)?p(L,w):L&&w.push(L)}),w}var v=p(Array.isArray(e)?e:[e]);if(v.forEach(function(y){var w=typeof y=="string"&&!o?{}:y;if(typeof w=="string")h+="".concat(w,` +`);else if(w._keyframe)g(w);else{var L=d.reduce(function(D,E){var I;return(E==null||(I=E.visit)===null||I===void 0?void 0:I.call(E,D))||D},w);Object.keys(L).forEach(function(D){var E=L[D];if(Kn(E)==="object"&&E&&(D!=="animationName"||!E._keyframe)&&!$3e(E)){var I=!1,k=D.trim(),R=!1;(o||r)&&a?k.startsWith("@")?I=!0:k=z3e(D,a,c):o&&!a&&(k==="&"||k==="")&&(k="",R=!0);var A=i(E,t,{root:R,injectHash:I,parentSelectors:[].concat(_t(s),[k])}),P=Ne(A,2),N=P[0],M=P[1];f=Ce(Ce({},f),M),h+="".concat(k).concat(N)}else{let F=function($,z){var K=$.replace(/[A-Z]/g,function(G){return"-".concat(G.toLowerCase())}),j=z;!y3e[$]&&typeof j=="number"&&j!==0&&(j="".concat(j,"px")),$==="animationName"&&z!==null&&z!==void 0&&z._keyframe&&(g(z),j=z.getName(a)),h+="".concat(K,":").concat(j,";")};var H,B=(H=E==null?void 0:E.value)!==null&&H!==void 0?H:E;Kn(E)==="object"&&E!==null&&E!==void 0&&E[Pge]&&Array.isArray(B)?B.forEach(function($){F(D,$)}):F(D,B)}})}}),!o)h="{".concat(h,"}");else if(l&&e3e()){var m=l.split(","),_=m[m.length-1].trim();h="@layer ".concat(_," {").concat(h,"}"),m.length>1&&(h="@layer ".concat(l,"{%%%:%}").concat(h))}return[h,f]};function Oge(i,e){return vA("".concat(i.join("%")).concat(e))}function j3e(){return null}var Fge="style";function nW(i,e){var t=i.token,n=i.path,o=i.hashId,r=i.layer,s=i.nonce,a=i.clientOnly,l=i.order,c=l===void 0?0:l,u=x.exports.useContext(C4),d=u.autoClear;u.mock;var h=u.defaultCache,f=u.hashPriority,g=u.container,p=u.ssrInline,v=u.transformers,m=u.linters,_=u.cache,y=t._tokenKey,w=[y].concat(_t(n)),L=YB,D=DK(Fge,w,function(){var A=w.join("|");if(W3e(A)){var P=V3e(A),N=Ne(P,2),M=N[0],H=N[1];if(M)return[M,y,H,{},a,c]}var B=e(),F=U3e(B,{hashId:o,hashPriority:f,layer:r,path:n.join("-"),transformers:v,linters:m}),$=Ne(F,2),z=$[0],K=$[1],j=tW(z),G=Oge(w,j);return[j,y,G,K,a,c]},function(A,P){var N=Ne(A,3),M=N[2];(P||d)&&YB&&uD(M,{mark:Ad})},function(A){var P=Ne(A,4),N=P[0];P[1];var M=P[2],H=P[3];if(L&&N!==Mge){var B={mark:Ad,prepend:"queue",attachTo:g,priority:c},F=typeof s=="function"?s():s;F&&(B.csp={nonce:F});var $=gv(N,M,B);$[_m]=_.instanceId,$.setAttribute(ow,y),Object.keys(H).forEach(function(z){gv(tW(H[z]),"_effect-".concat(z),B)})}}),E=Ne(D,3),I=E[0],k=E[1],R=E[2];return function(A){var P;if(!p||L||!h)P=x.exports.createElement(j3e,null);else{var N;P=x.exports.createElement("style",yt({},(N={},me(N,ow,k),me(N,Ad,R),N),{dangerouslySetInnerHTML:{__html:I}}))}return x.exports.createElement(x.exports.Fragment,null,P,A)}}var K3e=function(e,t,n){var o=Ne(e,6),r=o[0],s=o[1],a=o[2],l=o[3],c=o[4],u=o[5],d=n||{},h=d.plain;if(c)return null;var f=r,g={"data-rc-order":"prependQueue","data-rc-priority":"".concat(u)};return f=_A(r,s,a,g,h),l&&Object.keys(l).forEach(function(p){if(!t[p]){t[p]=!0;var v=tW(l[p]);f+=_A(v,s,"_effect-".concat(p),g,h)}}),[u,a,f]},Bge="cssVar",q3e=function(e,t){var n=e.key,o=e.prefix,r=e.unitless,s=e.ignore,a=e.token,l=e.scope,c=l===void 0?"":l,u=x.exports.useContext(C4),d=u.cache.instanceId,h=u.container,f=a._tokenKey,g=[].concat(_t(e.path),[n,c,f]),p=DK(Bge,g,function(){var v=t(),m=Lge(v,n,{prefix:o,unitless:r,ignore:s,scope:c}),_=Ne(m,2),y=_[0],w=_[1],L=Oge(g,w);return[y,w,L,n]},function(v){var m=Ne(v,3),_=m[2];YB&&uD(_,{mark:Ad})},function(v){var m=Ne(v,3),_=m[1],y=m[2];if(!!_){var w=gv(_,y,{mark:Ad,prepend:"queue",attachTo:h,priority:-999});w[_m]=d,w.setAttribute(ow,n)}});return p},G3e=function(e,t,n){var o=Ne(e,4),r=o[1],s=o[2],a=o[3],l=n||{},c=l.plain;if(!r)return null;var u=-999,d={"data-rc-order":"prependQueue","data-rc-priority":"".concat(u)},h=_A(r,a,s,d,c);return[u,s,h]},yx;yx={},me(yx,Fge,K3e),me(yx,Ege,C3e),me(yx,Bge,G3e);var ji=function(){function i(e,t){ga(this,i),me(this,"name",void 0),me(this,"style",void 0),me(this,"_keyframe",!0),this.name=e,this.style=t}return pa(i,[{key:"getName",value:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return t?"".concat(t,"-").concat(this.name):this.name}}]),i}();function L1(i){return i.notSplit=!0,i}L1(["borderTop","borderBottom"]),L1(["borderTop"]),L1(["borderBottom"]),L1(["borderLeft","borderRight"]),L1(["borderLeft"]),L1(["borderRight"]);var X3e=x.exports.createContext({}),TK=X3e;function Wge(i){return mge(i)||hge(i)||xK(i)||vge()}function jh(i,e){for(var t=i,n=0;n3&&arguments[3]!==void 0?arguments[3]:!1;return e.length&&n&&t===void 0&&!jh(i,e.slice(0,-1))?i:Vge(i,e,t,n)}function Y3e(i){return Kn(i)==="object"&&i!==null&&Object.getPrototypeOf(i)===Object.prototype}function Mte(i){return Array.isArray(i)?[]:{}}var Z3e=typeof Reflect=="undefined"?Object.keys:Reflect.ownKeys;function SC(){for(var i=arguments.length,e=new Array(i),t=0;t{const i=()=>{};return i.deprecated=Q3e,i};var Hge=x.exports.createContext(void 0),e8e={items_per_page:"/ page",jump_to:"Go to",jump_to_confirm:"confirm",page:"Page",prev_page:"Previous Page",next_page:"Next Page",prev_5:"Previous 5 Pages",next_5:"Next 5 Pages",prev_3:"Previous 3 Pages",next_3:"Next 3 Pages",page_size:"Page Size"},t8e={locale:"en_US",today:"Today",now:"Now",backToToday:"Back to today",ok:"OK",clear:"Clear",month:"Month",year:"Year",timeSelect:"select time",dateSelect:"select date",weekSelect:"Choose a week",monthSelect:"Choose a month",yearSelect:"Choose a year",decadeSelect:"Choose a decade",yearFormat:"YYYY",dateFormat:"M/D/YYYY",dayFormat:"D",dateTimeFormat:"M/D/YYYY HH:mm:ss",monthBeforeYear:!0,previousMonth:"Previous month (PageUp)",nextMonth:"Next month (PageDown)",previousYear:"Last year (Control + left)",nextYear:"Next year (Control + right)",previousDecade:"Last decade",nextDecade:"Next decade",previousCentury:"Last century",nextCentury:"Next century"};const n8e={placeholder:"Select time",rangePlaceholder:["Start time","End time"]};var $ge=n8e;const i8e={lang:Object.assign({placeholder:"Select date",yearPlaceholder:"Select year",quarterPlaceholder:"Select quarter",monthPlaceholder:"Select month",weekPlaceholder:"Select week",rangePlaceholder:["Start date","End date"],rangeYearPlaceholder:["Start year","End year"],rangeQuarterPlaceholder:["Start quarter","End quarter"],rangeMonthPlaceholder:["Start month","End month"],rangeWeekPlaceholder:["Start week","End week"]},t8e),timePickerLocale:Object.assign({},$ge)};var Ate=i8e;const hc="${label} is not a valid ${type}",o8e={locale:"en",Pagination:e8e,DatePicker:Ate,TimePicker:$ge,Calendar:Ate,global:{placeholder:"Please select"},Table:{filterTitle:"Filter menu",filterConfirm:"OK",filterReset:"Reset",filterEmptyText:"No filters",filterCheckall:"Select all items",filterSearchPlaceholder:"Search in filters",emptyText:"No data",selectAll:"Select current page",selectInvert:"Invert current page",selectNone:"Clear all data",selectionAll:"Select all data",sortTitle:"Sort",expand:"Expand row",collapse:"Collapse row",triggerDesc:"Click to sort descending",triggerAsc:"Click to sort ascending",cancelSort:"Click to cancel sorting"},Tour:{Next:"Next",Previous:"Previous",Finish:"Finish"},Modal:{okText:"OK",cancelText:"Cancel",justOkText:"OK"},Popconfirm:{okText:"OK",cancelText:"Cancel"},Transfer:{titles:["",""],searchPlaceholder:"Search here",itemUnit:"item",itemsUnit:"items",remove:"Remove",selectCurrent:"Select current page",removeCurrent:"Remove current page",selectAll:"Select all data",removeAll:"Remove all data",selectInvert:"Invert current page"},Upload:{uploading:"Uploading...",removeFile:"Remove file",uploadError:"Upload error",previewFile:"Preview file",downloadFile:"Download file"},Empty:{description:"No data"},Icon:{icon:"icon"},Text:{edit:"Edit",copy:"Copy",copied:"Copied",expand:"Expand"},PageHeader:{back:"Back"},Form:{optional:"(optional)",defaultValidateMessages:{default:"Field validation error for ${label}",required:"Please enter ${label}",enum:"${label} must be one of [${enum}]",whitespace:"${label} cannot be a blank character",date:{format:"${label} date format is invalid",parse:"${label} cannot be converted to a date",invalid:"${label} is an invalid date"},types:{string:hc,method:hc,array:hc,object:hc,number:hc,date:hc,boolean:hc,integer:hc,float:hc,regexp:hc,email:hc,url:hc,hex:hc},string:{len:"${label} must be ${len} characters",min:"${label} must be at least ${min} characters",max:"${label} must be up to ${max} characters",range:"${label} must be between ${min}-${max} characters"},number:{len:"${label} must be equal to ${len}",min:"${label} must be minimum ${min}",max:"${label} must be maximum ${max}",range:"${label} must be between ${min}-${max}"},array:{len:"Must be ${len} ${label}",min:"At least ${min} ${label}",max:"At most ${max} ${label}",range:"The amount of ${label} must be between ${min}-${max}"},pattern:{mismatch:"${label} does not match the pattern ${pattern}"}}},Image:{preview:"Preview"},QRCode:{expired:"QR code expired",refresh:"Refresh",scanned:"Scanned"},ColorPicker:{presetEmpty:"Empty"}};var pv=o8e;let VR=Object.assign({},pv.Modal),HR=[];const Pte=()=>HR.reduce((i,e)=>Object.assign(Object.assign({},i),e),pv.Modal);function r8e(i){if(i){const e=Object.assign({},i);return HR.push(e),VR=Pte(),()=>{HR=HR.filter(t=>t!==e),VR=Pte()}}VR=Object.assign({},pv.Modal)}function zge(){return VR}const s8e=x.exports.createContext(void 0);var NK=s8e;const a8e=(i,e)=>{const t=x.exports.useContext(NK),n=x.exports.useMemo(()=>{var r;const s=e||pv[i],a=(r=t==null?void 0:t[i])!==null&&r!==void 0?r:{};return Object.assign(Object.assign({},typeof s=="function"?s():s),a||{})},[i,e,t]),o=x.exports.useMemo(()=>{const r=t==null?void 0:t.locale;return(t==null?void 0:t.exist)&&!r?pv.locale:r},[t]);return[n,o]};var xI=a8e;const l8e="internalMark",c8e=i=>{const{locale:e={},children:t,_ANT_MARK__:n}=i;x.exports.useEffect(()=>r8e(e&&e.Modal),[e]);const o=x.exports.useMemo(()=>Object.assign(Object.assign({},e),{exist:!0}),[e]);return x.exports.createElement(NK.Provider,{value:o},t)};var u8e=c8e;function aa(i,e){d8e(i)&&(i="100%");var t=h8e(i);return i=e===360?i:Math.min(e,Math.max(0,parseFloat(i))),t&&(i=parseInt(String(i*e),10)/100),Math.abs(i-e)<1e-6?1:(e===360?i=(i<0?i%e+e:i%e)/parseFloat(String(e)):i=i%e/parseFloat(String(e)),i)}function WN(i){return Math.min(1,Math.max(0,i))}function d8e(i){return typeof i=="string"&&i.indexOf(".")!==-1&&parseFloat(i)===1}function h8e(i){return typeof i=="string"&&i.indexOf("%")!==-1}function Uge(i){return i=parseFloat(i),(isNaN(i)||i<0||i>1)&&(i=1),i}function VN(i){return i<=1?"".concat(Number(i)*100,"%"):i}function n0(i){return i.length===1?"0"+i:String(i)}function f8e(i,e,t){return{r:aa(i,255)*255,g:aa(e,255)*255,b:aa(t,255)*255}}function Ote(i,e,t){i=aa(i,255),e=aa(e,255),t=aa(t,255);var n=Math.max(i,e,t),o=Math.min(i,e,t),r=0,s=0,a=(n+o)/2;if(n===o)s=0,r=0;else{var l=n-o;switch(s=a>.5?l/(2-n-o):l/(n+o),n){case i:r=(e-t)/l+(e1&&(t-=1),t<1/6?i+(e-i)*(6*t):t<1/2?e:t<2/3?i+(e-i)*(2/3-t)*6:i}function g8e(i,e,t){var n,o,r;if(i=aa(i,360),e=aa(e,100),t=aa(t,100),e===0)o=t,r=t,n=t;else{var s=t<.5?t*(1+e):t+e-t*e,a=2*t-s;n=G8(a,s,i+1/3),o=G8(a,s,i),r=G8(a,s,i-1/3)}return{r:n*255,g:o*255,b:r*255}}function iW(i,e,t){i=aa(i,255),e=aa(e,255),t=aa(t,255);var n=Math.max(i,e,t),o=Math.min(i,e,t),r=0,s=n,a=n-o,l=n===0?0:a/n;if(n===o)r=0;else{switch(n){case i:r=(e-t)/a+(e>16,g:(i&65280)>>8,b:i&255}}var rW={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function aC(i){var e={r:0,g:0,b:0},t=1,n=null,o=null,r=null,s=!1,a=!1;return typeof i=="string"&&(i=y8e(i)),typeof i=="object"&&(Kf(i.r)&&Kf(i.g)&&Kf(i.b)?(e=f8e(i.r,i.g,i.b),s=!0,a=String(i.r).substr(-1)==="%"?"prgb":"rgb"):Kf(i.h)&&Kf(i.s)&&Kf(i.v)?(n=VN(i.s),o=VN(i.v),e=p8e(i.h,n,o),s=!0,a="hsv"):Kf(i.h)&&Kf(i.s)&&Kf(i.l)&&(n=VN(i.s),r=VN(i.l),e=g8e(i.h,n,r),s=!0,a="hsl"),Object.prototype.hasOwnProperty.call(i,"a")&&(t=i.a)),t=Uge(t),{ok:s,format:i.format||a,r:Math.min(255,Math.max(e.r,0)),g:Math.min(255,Math.max(e.g,0)),b:Math.min(255,Math.max(e.b,0)),a:t}}var b8e="[-\\+]?\\d+%?",C8e="[-\\+]?\\d*\\.\\d+%?",bm="(?:".concat(C8e,")|(?:").concat(b8e,")"),X8="[\\s|\\(]+(".concat(bm,")[,|\\s]+(").concat(bm,")[,|\\s]+(").concat(bm,")\\s*\\)?"),Y8="[\\s|\\(]+(".concat(bm,")[,|\\s]+(").concat(bm,")[,|\\s]+(").concat(bm,")[,|\\s]+(").concat(bm,")\\s*\\)?"),od={CSS_UNIT:new RegExp(bm),rgb:new RegExp("rgb"+X8),rgba:new RegExp("rgba"+Y8),hsl:new RegExp("hsl"+X8),hsla:new RegExp("hsla"+Y8),hsv:new RegExp("hsv"+X8),hsva:new RegExp("hsva"+Y8),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function y8e(i){if(i=i.trim().toLowerCase(),i.length===0)return!1;var e=!1;if(rW[i])i=rW[i],e=!0;else if(i==="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var t=od.rgb.exec(i);return t?{r:t[1],g:t[2],b:t[3]}:(t=od.rgba.exec(i),t?{r:t[1],g:t[2],b:t[3],a:t[4]}:(t=od.hsl.exec(i),t?{h:t[1],s:t[2],l:t[3]}:(t=od.hsla.exec(i),t?{h:t[1],s:t[2],l:t[3],a:t[4]}:(t=od.hsv.exec(i),t?{h:t[1],s:t[2],v:t[3]}:(t=od.hsva.exec(i),t?{h:t[1],s:t[2],v:t[3],a:t[4]}:(t=od.hex8.exec(i),t?{r:mc(t[1]),g:mc(t[2]),b:mc(t[3]),a:Fte(t[4]),format:e?"name":"hex8"}:(t=od.hex6.exec(i),t?{r:mc(t[1]),g:mc(t[2]),b:mc(t[3]),format:e?"name":"hex"}:(t=od.hex4.exec(i),t?{r:mc(t[1]+t[1]),g:mc(t[2]+t[2]),b:mc(t[3]+t[3]),a:Fte(t[4]+t[4]),format:e?"name":"hex8"}:(t=od.hex3.exec(i),t?{r:mc(t[1]+t[1]),g:mc(t[2]+t[2]),b:mc(t[3]+t[3]),format:e?"name":"hex"}:!1)))))))))}function Kf(i){return Boolean(od.CSS_UNIT.exec(String(i)))}var na=function(){function i(e,t){e===void 0&&(e=""),t===void 0&&(t={});var n;if(e instanceof i)return e;typeof e=="number"&&(e=_8e(e)),this.originalInput=e;var o=aC(e);this.originalInput=e,this.r=o.r,this.g=o.g,this.b=o.b,this.a=o.a,this.roundA=Math.round(100*this.a)/100,this.format=(n=t.format)!==null&&n!==void 0?n:o.format,this.gradientType=t.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=o.ok}return i.prototype.isDark=function(){return this.getBrightness()<128},i.prototype.isLight=function(){return!this.isDark()},i.prototype.getBrightness=function(){var e=this.toRgb();return(e.r*299+e.g*587+e.b*114)/1e3},i.prototype.getLuminance=function(){var e=this.toRgb(),t,n,o,r=e.r/255,s=e.g/255,a=e.b/255;return r<=.03928?t=r/12.92:t=Math.pow((r+.055)/1.055,2.4),s<=.03928?n=s/12.92:n=Math.pow((s+.055)/1.055,2.4),a<=.03928?o=a/12.92:o=Math.pow((a+.055)/1.055,2.4),.2126*t+.7152*n+.0722*o},i.prototype.getAlpha=function(){return this.a},i.prototype.setAlpha=function(e){return this.a=Uge(e),this.roundA=Math.round(100*this.a)/100,this},i.prototype.isMonochrome=function(){var e=this.toHsl().s;return e===0},i.prototype.toHsv=function(){var e=iW(this.r,this.g,this.b);return{h:e.h*360,s:e.s,v:e.v,a:this.a}},i.prototype.toHsvString=function(){var e=iW(this.r,this.g,this.b),t=Math.round(e.h*360),n=Math.round(e.s*100),o=Math.round(e.v*100);return this.a===1?"hsv(".concat(t,", ").concat(n,"%, ").concat(o,"%)"):"hsva(".concat(t,", ").concat(n,"%, ").concat(o,"%, ").concat(this.roundA,")")},i.prototype.toHsl=function(){var e=Ote(this.r,this.g,this.b);return{h:e.h*360,s:e.s,l:e.l,a:this.a}},i.prototype.toHslString=function(){var e=Ote(this.r,this.g,this.b),t=Math.round(e.h*360),n=Math.round(e.s*100),o=Math.round(e.l*100);return this.a===1?"hsl(".concat(t,", ").concat(n,"%, ").concat(o,"%)"):"hsla(".concat(t,", ").concat(n,"%, ").concat(o,"%, ").concat(this.roundA,")")},i.prototype.toHex=function(e){return e===void 0&&(e=!1),oW(this.r,this.g,this.b,e)},i.prototype.toHexString=function(e){return e===void 0&&(e=!1),"#"+this.toHex(e)},i.prototype.toHex8=function(e){return e===void 0&&(e=!1),m8e(this.r,this.g,this.b,this.a,e)},i.prototype.toHex8String=function(e){return e===void 0&&(e=!1),"#"+this.toHex8(e)},i.prototype.toHexShortString=function(e){return e===void 0&&(e=!1),this.a===1?this.toHexString(e):this.toHex8String(e)},i.prototype.toRgb=function(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}},i.prototype.toRgbString=function(){var e=Math.round(this.r),t=Math.round(this.g),n=Math.round(this.b);return this.a===1?"rgb(".concat(e,", ").concat(t,", ").concat(n,")"):"rgba(".concat(e,", ").concat(t,", ").concat(n,", ").concat(this.roundA,")")},i.prototype.toPercentageRgb=function(){var e=function(t){return"".concat(Math.round(aa(t,255)*100),"%")};return{r:e(this.r),g:e(this.g),b:e(this.b),a:this.a}},i.prototype.toPercentageRgbString=function(){var e=function(t){return Math.round(aa(t,255)*100)};return this.a===1?"rgb(".concat(e(this.r),"%, ").concat(e(this.g),"%, ").concat(e(this.b),"%)"):"rgba(".concat(e(this.r),"%, ").concat(e(this.g),"%, ").concat(e(this.b),"%, ").concat(this.roundA,")")},i.prototype.toName=function(){if(this.a===0)return"transparent";if(this.a<1)return!1;for(var e="#"+oW(this.r,this.g,this.b,!1),t=0,n=Object.entries(rW);t=0,r=!t&&o&&(e.startsWith("hex")||e==="name");return r?e==="name"&&this.a===0?this.toName():this.toRgbString():(e==="rgb"&&(n=this.toRgbString()),e==="prgb"&&(n=this.toPercentageRgbString()),(e==="hex"||e==="hex6")&&(n=this.toHexString()),e==="hex3"&&(n=this.toHexString(!0)),e==="hex4"&&(n=this.toHex8String(!0)),e==="hex8"&&(n=this.toHex8String()),e==="name"&&(n=this.toName()),e==="hsl"&&(n=this.toHslString()),e==="hsv"&&(n=this.toHsvString()),n||this.toHexString())},i.prototype.toNumber=function(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)},i.prototype.clone=function(){return new i(this.toString())},i.prototype.lighten=function(e){e===void 0&&(e=10);var t=this.toHsl();return t.l+=e/100,t.l=WN(t.l),new i(t)},i.prototype.brighten=function(e){e===void 0&&(e=10);var t=this.toRgb();return t.r=Math.max(0,Math.min(255,t.r-Math.round(255*-(e/100)))),t.g=Math.max(0,Math.min(255,t.g-Math.round(255*-(e/100)))),t.b=Math.max(0,Math.min(255,t.b-Math.round(255*-(e/100)))),new i(t)},i.prototype.darken=function(e){e===void 0&&(e=10);var t=this.toHsl();return t.l-=e/100,t.l=WN(t.l),new i(t)},i.prototype.tint=function(e){return e===void 0&&(e=10),this.mix("white",e)},i.prototype.shade=function(e){return e===void 0&&(e=10),this.mix("black",e)},i.prototype.desaturate=function(e){e===void 0&&(e=10);var t=this.toHsl();return t.s-=e/100,t.s=WN(t.s),new i(t)},i.prototype.saturate=function(e){e===void 0&&(e=10);var t=this.toHsl();return t.s+=e/100,t.s=WN(t.s),new i(t)},i.prototype.greyscale=function(){return this.desaturate(100)},i.prototype.spin=function(e){var t=this.toHsl(),n=(t.h+e)%360;return t.h=n<0?360+n:n,new i(t)},i.prototype.mix=function(e,t){t===void 0&&(t=50);var n=this.toRgb(),o=new i(e).toRgb(),r=t/100,s={r:(o.r-n.r)*r+n.r,g:(o.g-n.g)*r+n.g,b:(o.b-n.b)*r+n.b,a:(o.a-n.a)*r+n.a};return new i(s)},i.prototype.analogous=function(e,t){e===void 0&&(e=6),t===void 0&&(t=30);var n=this.toHsl(),o=360/t,r=[this];for(n.h=(n.h-(o*e>>1)+720)%360;--e;)n.h=(n.h+o)%360,r.push(new i(n));return r},i.prototype.complement=function(){var e=this.toHsl();return e.h=(e.h+180)%360,new i(e)},i.prototype.monochromatic=function(e){e===void 0&&(e=6);for(var t=this.toHsv(),n=t.h,o=t.s,r=t.v,s=[],a=1/e;e--;)s.push(new i({h:n,s:o,v:r})),r=(r+a)%1;return s},i.prototype.splitcomplement=function(){var e=this.toHsl(),t=e.h;return[this,new i({h:(t+72)%360,s:e.s,l:e.l}),new i({h:(t+216)%360,s:e.s,l:e.l})]},i.prototype.onBackground=function(e){var t=this.toRgb(),n=new i(e).toRgb(),o=t.a+n.a*(1-t.a);return new i({r:(t.r*t.a+n.r*n.a*(1-t.a))/o,g:(t.g*t.a+n.g*n.a*(1-t.a))/o,b:(t.b*t.a+n.b*n.a*(1-t.a))/o,a:o})},i.prototype.triad=function(){return this.polyad(3)},i.prototype.tetrad=function(){return this.polyad(4)},i.prototype.polyad=function(e){for(var t=this.toHsl(),n=t.h,o=[this],r=360/e,s=1;s=60&&Math.round(i.h)<=240?n=t?Math.round(i.h)-HN*e:Math.round(i.h)+HN*e:n=t?Math.round(i.h)+HN*e:Math.round(i.h)-HN*e,n<0?n+=360:n>=360&&(n-=360),n}function Hte(i,e,t){if(i.h===0&&i.s===0)return i.s;var n;return t?n=i.s-Bte*e:e===Kge?n=i.s+Bte:n=i.s+w8e*e,n>1&&(n=1),t&&e===jge&&n>.1&&(n=.1),n<.06&&(n=.06),Number(n.toFixed(2))}function $te(i,e,t){var n;return t?n=i.v+S8e*e:n=i.v-x8e*e,n>1&&(n=1),Number(n.toFixed(2))}function z0(i){for(var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=[],n=aC(i),o=jge;o>0;o-=1){var r=Wte(n),s=$N(aC({h:Vte(r,o,!0),s:Hte(r,o,!0),v:$te(r,o,!0)}));t.push(s)}t.push($N(n));for(var a=1;a<=Kge;a+=1){var l=Wte(n),c=$N(aC({h:Vte(l,a),s:Hte(l,a),v:$te(l,a)}));t.push(c)}return e.theme==="dark"?L8e.map(function(u){var d=u.index,h=u.opacity,f=$N(E8e(aC(e.backgroundColor||"#141414"),aC(t[d]),h*100));return f}):t}var Z8={red:"#F5222D",volcano:"#FA541C",orange:"#FA8C16",gold:"#FAAD14",yellow:"#FADB14",lime:"#A0D911",green:"#52C41A",cyan:"#13C2C2",blue:"#1677FF",geekblue:"#2F54EB",purple:"#722ED1",magenta:"#EB2F96",grey:"#666666"},$R={},Q8={};Object.keys(Z8).forEach(function(i){$R[i]=z0(Z8[i]),$R[i].primary=$R[i][5],Q8[i]=z0(Z8[i],{theme:"dark",backgroundColor:"#141414"}),Q8[i].primary=Q8[i][5]});var D8e=$R.blue;const k8e=i=>{const{controlHeight:e}=i;return{controlHeightSM:e*.75,controlHeightXS:e*.5,controlHeightLG:e*1.25}};var I8e=k8e;function T8e(i){const{sizeUnit:e,sizeStep:t}=i;return{sizeXXL:e*(t+8),sizeXL:e*(t+4),sizeLG:e*(t+2),sizeMD:e*(t+1),sizeMS:e*t,size:e*t,sizeSM:e*(t-1),sizeXS:e*(t-2),sizeXXS:e*(t-3)}}const qge={blue:"#1677ff",purple:"#722ED1",cyan:"#13C2C2",green:"#52C41A",magenta:"#EB2F96",pink:"#eb2f96",red:"#F5222D",orange:"#FA8C16",yellow:"#FADB14",volcano:"#FA541C",geekblue:"#2F54EB",gold:"#FAAD14",lime:"#A0D911"},N8e=Object.assign(Object.assign({},qge),{colorPrimary:"#1677ff",colorSuccess:"#52c41a",colorWarning:"#faad14",colorError:"#ff4d4f",colorInfo:"#1677ff",colorLink:"",colorTextBase:"",colorBgBase:"",fontFamily:`-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', -'Noto Color Emoji'`,fontFamilyCode:"'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace",fontSize:14,lineWidth:1,lineType:"solid",motionUnit:.1,motionBase:0,motionEaseOutCirc:"cubic-bezier(0.08, 0.82, 0.17, 1)",motionEaseInOutCirc:"cubic-bezier(0.78, 0.14, 0.15, 0.86)",motionEaseOut:"cubic-bezier(0.215, 0.61, 0.355, 1)",motionEaseInOut:"cubic-bezier(0.645, 0.045, 0.355, 1)",motionEaseOutBack:"cubic-bezier(0.12, 0.4, 0.29, 1.46)",motionEaseInBack:"cubic-bezier(0.71, -0.46, 0.88, 0.6)",motionEaseInQuint:"cubic-bezier(0.755, 0.05, 0.855, 0.06)",motionEaseOutQuint:"cubic-bezier(0.23, 1, 0.32, 1)",borderRadius:6,sizeUnit:4,sizeStep:4,sizePopupArrow:16,controlHeight:32,zIndexBase:0,zIndexPopupBase:1e3,opacityImage:1,wireframe:!1,motion:!0});var hD=S8e;function x8e(i,e){let{generateColorPalettes:t,generateNeutralColorPalettes:n}=e;const{colorSuccess:o,colorWarning:r,colorError:s,colorInfo:a,colorPrimary:l,colorBgBase:c,colorTextBase:u}=i,d=t(l),h=t(o),f=t(r),g=t(s),p=t(a),v=n(c,u),m=i.colorLink||i.colorInfo,_=t(m);return Object.assign(Object.assign({},v),{colorPrimaryBg:d[1],colorPrimaryBgHover:d[2],colorPrimaryBorder:d[3],colorPrimaryBorderHover:d[4],colorPrimaryHover:d[5],colorPrimary:d[6],colorPrimaryActive:d[7],colorPrimaryTextHover:d[8],colorPrimaryText:d[9],colorPrimaryTextActive:d[10],colorSuccessBg:h[1],colorSuccessBgHover:h[2],colorSuccessBorder:h[3],colorSuccessBorderHover:h[4],colorSuccessHover:h[4],colorSuccess:h[6],colorSuccessActive:h[7],colorSuccessTextHover:h[8],colorSuccessText:h[9],colorSuccessTextActive:h[10],colorErrorBg:g[1],colorErrorBgHover:g[2],colorErrorBorder:g[3],colorErrorBorderHover:g[4],colorErrorHover:g[5],colorError:g[6],colorErrorActive:g[7],colorErrorTextHover:g[8],colorErrorText:g[9],colorErrorTextActive:g[10],colorWarningBg:f[1],colorWarningBgHover:f[2],colorWarningBorder:f[3],colorWarningBorderHover:f[4],colorWarningHover:f[4],colorWarning:f[6],colorWarningActive:f[7],colorWarningTextHover:f[8],colorWarningText:f[9],colorWarningTextActive:f[10],colorInfoBg:p[1],colorInfoBgHover:p[2],colorInfoBorder:p[3],colorInfoBorderHover:p[4],colorInfoHover:p[4],colorInfo:p[6],colorInfoActive:p[7],colorInfoTextHover:p[8],colorInfoText:p[9],colorInfoTextActive:p[10],colorLinkHover:_[4],colorLink:_[6],colorLinkActive:_[7],colorBgMask:new ta("#000").setAlpha(.45).toRgbString(),colorWhite:"#fff"})}const L8e=i=>{let e=i,t=i,n=i,o=i;return i<6&&i>=5?e=i+1:i<16&&i>=6?e=i+2:i>=16&&(e=16),i<7&&i>=5?t=4:i<8&&i>=7?t=5:i<14&&i>=8?t=6:i<16&&i>=14?t=7:i>=16&&(t=8),i<6&&i>=2?n=1:i>=6&&(n=2),i>4&&i<8?o=4:i>=8&&(o=6),{borderRadius:i,borderRadiusXS:n,borderRadiusSM:t,borderRadiusLG:e,borderRadiusOuter:o}};var E8e=L8e;function D8e(i){const{motionUnit:e,motionBase:t,borderRadius:n,lineWidth:o}=i;return Object.assign({motionDurationFast:`${(t+e).toFixed(1)}s`,motionDurationMid:`${(t+e*2).toFixed(1)}s`,motionDurationSlow:`${(t+e*3).toFixed(1)}s`,lineWidthBold:o+1},E8e(n))}const qf=(i,e)=>new ta(i).setAlpha(e).toRgbString(),wx=(i,e)=>new ta(i).darken(e).toHexString(),k8e=i=>{const e=$0(i);return{1:e[0],2:e[1],3:e[2],4:e[3],5:e[4],6:e[5],7:e[6],8:e[4],9:e[5],10:e[6]}},I8e=(i,e)=>{const t=i||"#fff",n=e||"#000";return{colorBgBase:t,colorTextBase:n,colorText:qf(n,.88),colorTextSecondary:qf(n,.65),colorTextTertiary:qf(n,.45),colorTextQuaternary:qf(n,.25),colorFill:qf(n,.15),colorFillSecondary:qf(n,.06),colorFillTertiary:qf(n,.04),colorFillQuaternary:qf(n,.02),colorBgLayout:wx(t,4),colorBgContainer:wx(t,0),colorBgElevated:wx(t,0),colorBgSpotlight:qf(n,.85),colorBgBlur:"transparent",colorBorder:wx(t,15),colorBorderSecondary:wx(t,6)}};function VR(i){return(i+8)/i}function T8e(i){const e=new Array(10).fill(null).map((t,n)=>{const o=n-1,r=i*Math.pow(2.71828,o/5),s=n>1?Math.floor(r):Math.ceil(r);return Math.floor(s/2)*2});return e[1]=i,e.map(t=>({size:t,lineHeight:VR(t)}))}const N8e=i=>{const e=T8e(i),t=e.map(u=>u.size),n=e.map(u=>u.lineHeight),o=t[1],r=t[0],s=t[2],a=n[1],l=n[0],c=n[2];return{fontSizeSM:r,fontSize:o,fontSizeLG:s,fontSizeXL:t[3],fontSizeHeading1:t[6],fontSizeHeading2:t[5],fontSizeHeading3:t[4],fontSizeHeading4:t[3],fontSizeHeading5:t[2],lineHeight:a,lineHeightLG:c,lineHeightSM:l,fontHeight:Math.round(a*o),fontHeightLG:Math.round(c*s),fontHeightSM:Math.round(l*r),lineHeightHeading1:n[6],lineHeightHeading2:n[5],lineHeightHeading3:n[4],lineHeightHeading4:n[3],lineHeightHeading5:n[2]}};var R8e=N8e;function M8e(i){const e=Object.keys(Vge).map(t=>{const n=$0(i[t]);return new Array(10).fill(1).reduce((o,r,s)=>(o[`${t}-${s+1}`]=n[s],o[`${t}${s+1}`]=n[s],o),{})}).reduce((t,n)=>(t=Object.assign(Object.assign({},t),n),t),{});return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},i),e),x8e(i,{generateColorPalettes:k8e,generateNeutralColorPalettes:I8e})),R8e(i.fontSize)),y8e(i)),w8e(i)),D8e(i))}const Hge=KB(M8e),$ge={token:hD,override:{override:hD},hashed:!0},zge=Bt.createContext($ge),kK="anticon",A8e=(i,e)=>e||(i?`ant-${i}`:"ant"),Hi=x.exports.createContext({getPrefixCls:A8e,iconPrefixCls:kK}),P8e=`-ant-${Date.now()}-${Math.random()}`;function O8e(i,e){const t={},n=(s,a)=>{let l=s.clone();return l=(a==null?void 0:a(l))||l,l.toRgbString()},o=(s,a)=>{const l=new ta(s),c=$0(l.toRgbString());t[`${a}-color`]=n(l),t[`${a}-color-disabled`]=c[1],t[`${a}-color-hover`]=c[4],t[`${a}-color-active`]=c[6],t[`${a}-color-outline`]=l.clone().setAlpha(.2).toRgbString(),t[`${a}-color-deprecated-bg`]=c[0],t[`${a}-color-deprecated-border`]=c[2]};if(e.primaryColor){o(e.primaryColor,"primary");const s=new ta(e.primaryColor),a=$0(s.toRgbString());a.forEach((c,u)=>{t[`primary-${u+1}`]=c}),t["primary-color-deprecated-l-35"]=n(s,c=>c.lighten(35)),t["primary-color-deprecated-l-20"]=n(s,c=>c.lighten(20)),t["primary-color-deprecated-t-20"]=n(s,c=>c.tint(20)),t["primary-color-deprecated-t-50"]=n(s,c=>c.tint(50)),t["primary-color-deprecated-f-12"]=n(s,c=>c.setAlpha(c.getAlpha()*.12));const l=new ta(a[0]);t["primary-color-active-deprecated-f-30"]=n(l,c=>c.setAlpha(c.getAlpha()*.3)),t["primary-color-active-deprecated-d-02"]=n(l,c=>c.darken(2))}return e.successColor&&o(e.successColor,"success"),e.warningColor&&o(e.warningColor,"warning"),e.errorColor&&o(e.errorColor,"error"),e.infoColor&&o(e.infoColor,"info"),` +'Noto Color Emoji'`,fontFamilyCode:"'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace",fontSize:14,lineWidth:1,lineType:"solid",motionUnit:.1,motionBase:0,motionEaseOutCirc:"cubic-bezier(0.08, 0.82, 0.17, 1)",motionEaseInOutCirc:"cubic-bezier(0.78, 0.14, 0.15, 0.86)",motionEaseOut:"cubic-bezier(0.215, 0.61, 0.355, 1)",motionEaseInOut:"cubic-bezier(0.645, 0.045, 0.355, 1)",motionEaseOutBack:"cubic-bezier(0.12, 0.4, 0.29, 1.46)",motionEaseInBack:"cubic-bezier(0.71, -0.46, 0.88, 0.6)",motionEaseInQuint:"cubic-bezier(0.755, 0.05, 0.855, 0.06)",motionEaseOutQuint:"cubic-bezier(0.23, 1, 0.32, 1)",borderRadius:6,sizeUnit:4,sizeStep:4,sizePopupArrow:16,controlHeight:32,zIndexBase:0,zIndexPopupBase:1e3,opacityImage:1,wireframe:!1,motion:!0});var fD=N8e;function R8e(i,e){let{generateColorPalettes:t,generateNeutralColorPalettes:n}=e;const{colorSuccess:o,colorWarning:r,colorError:s,colorInfo:a,colorPrimary:l,colorBgBase:c,colorTextBase:u}=i,d=t(l),h=t(o),f=t(r),g=t(s),p=t(a),v=n(c,u),m=i.colorLink||i.colorInfo,_=t(m);return Object.assign(Object.assign({},v),{colorPrimaryBg:d[1],colorPrimaryBgHover:d[2],colorPrimaryBorder:d[3],colorPrimaryBorderHover:d[4],colorPrimaryHover:d[5],colorPrimary:d[6],colorPrimaryActive:d[7],colorPrimaryTextHover:d[8],colorPrimaryText:d[9],colorPrimaryTextActive:d[10],colorSuccessBg:h[1],colorSuccessBgHover:h[2],colorSuccessBorder:h[3],colorSuccessBorderHover:h[4],colorSuccessHover:h[4],colorSuccess:h[6],colorSuccessActive:h[7],colorSuccessTextHover:h[8],colorSuccessText:h[9],colorSuccessTextActive:h[10],colorErrorBg:g[1],colorErrorBgHover:g[2],colorErrorBorder:g[3],colorErrorBorderHover:g[4],colorErrorHover:g[5],colorError:g[6],colorErrorActive:g[7],colorErrorTextHover:g[8],colorErrorText:g[9],colorErrorTextActive:g[10],colorWarningBg:f[1],colorWarningBgHover:f[2],colorWarningBorder:f[3],colorWarningBorderHover:f[4],colorWarningHover:f[4],colorWarning:f[6],colorWarningActive:f[7],colorWarningTextHover:f[8],colorWarningText:f[9],colorWarningTextActive:f[10],colorInfoBg:p[1],colorInfoBgHover:p[2],colorInfoBorder:p[3],colorInfoBorderHover:p[4],colorInfoHover:p[4],colorInfo:p[6],colorInfoActive:p[7],colorInfoTextHover:p[8],colorInfoText:p[9],colorInfoTextActive:p[10],colorLinkHover:_[4],colorLink:_[6],colorLinkActive:_[7],colorBgMask:new na("#000").setAlpha(.45).toRgbString(),colorWhite:"#fff"})}const M8e=i=>{let e=i,t=i,n=i,o=i;return i<6&&i>=5?e=i+1:i<16&&i>=6?e=i+2:i>=16&&(e=16),i<7&&i>=5?t=4:i<8&&i>=7?t=5:i<14&&i>=8?t=6:i<16&&i>=14?t=7:i>=16&&(t=8),i<6&&i>=2?n=1:i>=6&&(n=2),i>4&&i<8?o=4:i>=8&&(o=6),{borderRadius:i,borderRadiusXS:n,borderRadiusSM:t,borderRadiusLG:e,borderRadiusOuter:o}};var A8e=M8e;function P8e(i){const{motionUnit:e,motionBase:t,borderRadius:n,lineWidth:o}=i;return Object.assign({motionDurationFast:`${(t+e).toFixed(1)}s`,motionDurationMid:`${(t+e*2).toFixed(1)}s`,motionDurationSlow:`${(t+e*3).toFixed(1)}s`,lineWidthBold:o+1},A8e(n))}const qf=(i,e)=>new na(i).setAlpha(e).toRgbString(),wx=(i,e)=>new na(i).darken(e).toHexString(),O8e=i=>{const e=z0(i);return{1:e[0],2:e[1],3:e[2],4:e[3],5:e[4],6:e[5],7:e[6],8:e[4],9:e[5],10:e[6]}},F8e=(i,e)=>{const t=i||"#fff",n=e||"#000";return{colorBgBase:t,colorTextBase:n,colorText:qf(n,.88),colorTextSecondary:qf(n,.65),colorTextTertiary:qf(n,.45),colorTextQuaternary:qf(n,.25),colorFill:qf(n,.15),colorFillSecondary:qf(n,.06),colorFillTertiary:qf(n,.04),colorFillQuaternary:qf(n,.02),colorBgLayout:wx(t,4),colorBgContainer:wx(t,0),colorBgElevated:wx(t,0),colorBgSpotlight:qf(n,.85),colorBgBlur:"transparent",colorBorder:wx(t,15),colorBorderSecondary:wx(t,6)}};function zR(i){return(i+8)/i}function B8e(i){const e=new Array(10).fill(null).map((t,n)=>{const o=n-1,r=i*Math.pow(2.71828,o/5),s=n>1?Math.floor(r):Math.ceil(r);return Math.floor(s/2)*2});return e[1]=i,e.map(t=>({size:t,lineHeight:zR(t)}))}const W8e=i=>{const e=B8e(i),t=e.map(u=>u.size),n=e.map(u=>u.lineHeight),o=t[1],r=t[0],s=t[2],a=n[1],l=n[0],c=n[2];return{fontSizeSM:r,fontSize:o,fontSizeLG:s,fontSizeXL:t[3],fontSizeHeading1:t[6],fontSizeHeading2:t[5],fontSizeHeading3:t[4],fontSizeHeading4:t[3],fontSizeHeading5:t[2],lineHeight:a,lineHeightLG:c,lineHeightSM:l,fontHeight:Math.round(a*o),fontHeightLG:Math.round(c*s),fontHeightSM:Math.round(l*r),lineHeightHeading1:n[6],lineHeightHeading2:n[5],lineHeightHeading3:n[4],lineHeightHeading4:n[3],lineHeightHeading5:n[2]}};var V8e=W8e;function H8e(i){const e=Object.keys(qge).map(t=>{const n=z0(i[t]);return new Array(10).fill(1).reduce((o,r,s)=>(o[`${t}-${s+1}`]=n[s],o[`${t}${s+1}`]=n[s],o),{})}).reduce((t,n)=>(t=Object.assign(Object.assign({},t),n),t),{});return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},i),e),R8e(i,{generateColorPalettes:O8e,generateNeutralColorPalettes:F8e})),V8e(i.fontSize)),T8e(i)),I8e(i)),P8e(i))}const Gge=XB(H8e),Xge={token:fD,override:{override:fD},hashed:!0},Yge=Bt.createContext(Xge),RK="anticon",$8e=(i,e)=>e||(i?`ant-${i}`:"ant"),Hi=x.exports.createContext({getPrefixCls:$8e,iconPrefixCls:RK}),z8e=`-ant-${Date.now()}-${Math.random()}`;function U8e(i,e){const t={},n=(s,a)=>{let l=s.clone();return l=(a==null?void 0:a(l))||l,l.toRgbString()},o=(s,a)=>{const l=new na(s),c=z0(l.toRgbString());t[`${a}-color`]=n(l),t[`${a}-color-disabled`]=c[1],t[`${a}-color-hover`]=c[4],t[`${a}-color-active`]=c[6],t[`${a}-color-outline`]=l.clone().setAlpha(.2).toRgbString(),t[`${a}-color-deprecated-bg`]=c[0],t[`${a}-color-deprecated-border`]=c[2]};if(e.primaryColor){o(e.primaryColor,"primary");const s=new na(e.primaryColor),a=z0(s.toRgbString());a.forEach((c,u)=>{t[`primary-${u+1}`]=c}),t["primary-color-deprecated-l-35"]=n(s,c=>c.lighten(35)),t["primary-color-deprecated-l-20"]=n(s,c=>c.lighten(20)),t["primary-color-deprecated-t-20"]=n(s,c=>c.tint(20)),t["primary-color-deprecated-t-50"]=n(s,c=>c.tint(50)),t["primary-color-deprecated-f-12"]=n(s,c=>c.setAlpha(c.getAlpha()*.12));const l=new na(a[0]);t["primary-color-active-deprecated-f-30"]=n(l,c=>c.setAlpha(c.getAlpha()*.3)),t["primary-color-active-deprecated-d-02"]=n(l,c=>c.darken(2))}return e.successColor&&o(e.successColor,"success"),e.warningColor&&o(e.warningColor,"warning"),e.errorColor&&o(e.errorColor,"error"),e.infoColor&&o(e.infoColor,"info"),` :root { ${Object.keys(t).map(s=>`--${i}-${s}: ${t[s]};`).join(` `)} } - `.trim()}function F8e(i,e){const t=O8e(i,e);Oa()&&fv(t,`${P8e}-dynamic-theme`)}const iW=x.exports.createContext(!1),IK=i=>{let{children:e,disabled:t}=i;const n=x.exports.useContext(iW);return x.exports.createElement(iW.Provider,{value:t!=null?t:n},e)};var aS=iW;const oW=x.exports.createContext(void 0),B8e=i=>{let{children:e,size:t}=i;const n=x.exports.useContext(oW);return x.exports.createElement(oW.Provider,{value:t||n},e)};var SI=oW;function W8e(){const i=x.exports.useContext(aS),e=x.exports.useContext(SI);return{componentDisabled:i,componentSize:e}}const mA=["blue","purple","cyan","green","magenta","pink","red","orange","yellow","volcano","geekblue","lime","gold"];var V8e="5.13.2";function J8(i){return i>=0&&i<=255}function VN(i,e){const{r:t,g:n,b:o,a:r}=new ta(i).toRgb();if(r<1)return i;const{r:s,g:a,b:l}=new ta(e).toRgb();for(let c=.01;c<=1;c+=.01){const u=Math.round((t-s*(1-c))/c),d=Math.round((n-a*(1-c))/c),h=Math.round((o-l*(1-c))/c);if(J8(u)&&J8(d)&&J8(h))return new ta({r:u,g:d,b:h,a:Math.round(c*100)/100}).toRgbString()}return new ta({r:t,g:n,b:o,a:1}).toRgbString()}var H8e=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(i);o{delete n[h]});const o=Object.assign(Object.assign({},t),n),r=480,s=576,a=768,l=992,c=1200,u=1600;if(o.motion===!1){const h="0s";o.motionDurationFast=h,o.motionDurationMid=h,o.motionDurationSlow=h}return Object.assign(Object.assign(Object.assign({},o),{colorFillContent:o.colorFillSecondary,colorFillContentHover:o.colorFill,colorFillAlter:o.colorFillQuaternary,colorBgContainerDisabled:o.colorFillTertiary,colorBorderBg:o.colorBgContainer,colorSplit:VN(o.colorBorderSecondary,o.colorBgContainer),colorTextPlaceholder:o.colorTextQuaternary,colorTextDisabled:o.colorTextQuaternary,colorTextHeading:o.colorText,colorTextLabel:o.colorTextSecondary,colorTextDescription:o.colorTextTertiary,colorTextLightSolid:o.colorWhite,colorHighlight:o.colorError,colorBgTextHover:o.colorFillSecondary,colorBgTextActive:o.colorFill,colorIcon:o.colorTextTertiary,colorIconHover:o.colorText,colorErrorOutline:VN(o.colorErrorBg,o.colorBgContainer),colorWarningOutline:VN(o.colorWarningBg,o.colorBgContainer),fontSizeIcon:o.fontSizeSM,lineWidthFocus:o.lineWidth*4,lineWidth:o.lineWidth,controlOutlineWidth:o.lineWidth*2,controlInteractiveSize:o.controlHeight/2,controlItemBgHover:o.colorFillTertiary,controlItemBgActive:o.colorPrimaryBg,controlItemBgActiveHover:o.colorPrimaryBgHover,controlItemBgActiveDisabled:o.colorFill,controlTmpOutline:o.colorFillQuaternary,controlOutline:VN(o.colorPrimaryBg,o.colorBgContainer),lineType:o.lineType,borderRadius:o.borderRadius,borderRadiusXS:o.borderRadiusXS,borderRadiusSM:o.borderRadiusSM,borderRadiusLG:o.borderRadiusLG,fontWeightStrong:600,opacityLoading:.65,linkDecoration:"none",linkHoverDecoration:"none",linkFocusDecoration:"none",controlPaddingHorizontal:12,controlPaddingHorizontalSM:8,paddingXXS:o.sizeXXS,paddingXS:o.sizeXS,paddingSM:o.sizeSM,padding:o.size,paddingMD:o.sizeMD,paddingLG:o.sizeLG,paddingXL:o.sizeXL,paddingContentHorizontalLG:o.sizeLG,paddingContentVerticalLG:o.sizeMS,paddingContentHorizontal:o.sizeMS,paddingContentVertical:o.sizeSM,paddingContentHorizontalSM:o.size,paddingContentVerticalSM:o.sizeXS,marginXXS:o.sizeXXS,marginXS:o.sizeXS,marginSM:o.sizeSM,margin:o.size,marginMD:o.sizeMD,marginLG:o.sizeLG,marginXL:o.sizeXL,marginXXL:o.sizeXXL,boxShadow:` + `.trim()}function j8e(i,e){const t=U8e(i,e);Fa()&&gv(t,`${z8e}-dynamic-theme`)}const sW=x.exports.createContext(!1),MK=i=>{let{children:e,disabled:t}=i;const n=x.exports.useContext(sW);return x.exports.createElement(sW.Provider,{value:t!=null?t:n},e)};var lS=sW;const aW=x.exports.createContext(void 0),K8e=i=>{let{children:e,size:t}=i;const n=x.exports.useContext(aW);return x.exports.createElement(aW.Provider,{value:t||n},e)};var LI=aW;function q8e(){const i=x.exports.useContext(lS),e=x.exports.useContext(LI);return{componentDisabled:i,componentSize:e}}const bA=["blue","purple","cyan","green","magenta","pink","red","orange","yellow","volcano","geekblue","lime","gold"];var G8e="5.13.2";function J8(i){return i>=0&&i<=255}function zN(i,e){const{r:t,g:n,b:o,a:r}=new na(i).toRgb();if(r<1)return i;const{r:s,g:a,b:l}=new na(e).toRgb();for(let c=.01;c<=1;c+=.01){const u=Math.round((t-s*(1-c))/c),d=Math.round((n-a*(1-c))/c),h=Math.round((o-l*(1-c))/c);if(J8(u)&&J8(d)&&J8(h))return new na({r:u,g:d,b:h,a:Math.round(c*100)/100}).toRgbString()}return new na({r:t,g:n,b:o,a:1}).toRgbString()}var X8e=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(i);o{delete n[h]});const o=Object.assign(Object.assign({},t),n),r=480,s=576,a=768,l=992,c=1200,u=1600;if(o.motion===!1){const h="0s";o.motionDurationFast=h,o.motionDurationMid=h,o.motionDurationSlow=h}return Object.assign(Object.assign(Object.assign({},o),{colorFillContent:o.colorFillSecondary,colorFillContentHover:o.colorFill,colorFillAlter:o.colorFillQuaternary,colorBgContainerDisabled:o.colorFillTertiary,colorBorderBg:o.colorBgContainer,colorSplit:zN(o.colorBorderSecondary,o.colorBgContainer),colorTextPlaceholder:o.colorTextQuaternary,colorTextDisabled:o.colorTextQuaternary,colorTextHeading:o.colorText,colorTextLabel:o.colorTextSecondary,colorTextDescription:o.colorTextTertiary,colorTextLightSolid:o.colorWhite,colorHighlight:o.colorError,colorBgTextHover:o.colorFillSecondary,colorBgTextActive:o.colorFill,colorIcon:o.colorTextTertiary,colorIconHover:o.colorText,colorErrorOutline:zN(o.colorErrorBg,o.colorBgContainer),colorWarningOutline:zN(o.colorWarningBg,o.colorBgContainer),fontSizeIcon:o.fontSizeSM,lineWidthFocus:o.lineWidth*4,lineWidth:o.lineWidth,controlOutlineWidth:o.lineWidth*2,controlInteractiveSize:o.controlHeight/2,controlItemBgHover:o.colorFillTertiary,controlItemBgActive:o.colorPrimaryBg,controlItemBgActiveHover:o.colorPrimaryBgHover,controlItemBgActiveDisabled:o.colorFill,controlTmpOutline:o.colorFillQuaternary,controlOutline:zN(o.colorPrimaryBg,o.colorBgContainer),lineType:o.lineType,borderRadius:o.borderRadius,borderRadiusXS:o.borderRadiusXS,borderRadiusSM:o.borderRadiusSM,borderRadiusLG:o.borderRadiusLG,fontWeightStrong:600,opacityLoading:.65,linkDecoration:"none",linkHoverDecoration:"none",linkFocusDecoration:"none",controlPaddingHorizontal:12,controlPaddingHorizontalSM:8,paddingXXS:o.sizeXXS,paddingXS:o.sizeXS,paddingSM:o.sizeSM,padding:o.size,paddingMD:o.sizeMD,paddingLG:o.sizeLG,paddingXL:o.sizeXL,paddingContentHorizontalLG:o.sizeLG,paddingContentVerticalLG:o.sizeMS,paddingContentHorizontal:o.sizeMS,paddingContentVertical:o.sizeSM,paddingContentHorizontalSM:o.size,paddingContentVerticalSM:o.sizeXS,marginXXS:o.sizeXXS,marginXS:o.sizeXS,marginSM:o.sizeSM,margin:o.size,marginMD:o.sizeMD,marginLG:o.sizeLG,marginXL:o.sizeXL,marginXXL:o.sizeXXL,boxShadow:` 0 6px 16px 0 rgba(0, 0, 0, 0.08), 0 3px 6px -4px rgba(0, 0, 0, 0.12), 0 9px 28px 8px rgba(0, 0, 0, 0.05) @@ -90,9 +90,9 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho 0 1px 6px -1px rgba(0, 0, 0, 0.02), 0 2px 4px 0 rgba(0, 0, 0, 0.02) `,screenXS:r,screenXSMin:r,screenXSMax:s-1,screenSM:s,screenSMMin:s,screenSMMax:a-1,screenMD:a,screenMDMin:a,screenMDMax:l-1,screenLG:l,screenLGMin:l,screenLGMax:c-1,screenXL:c,screenXLMin:c,screenXLMax:u-1,screenXXL:u,screenXXLMin:u,boxShadowPopoverArrow:"2px 2px 5px rgba(0, 0, 0, 0.05)",boxShadowCard:` - 0 1px 2px -2px ${new ta("rgba(0, 0, 0, 0.16)").toRgbString()}, - 0 3px 6px 0 ${new ta("rgba(0, 0, 0, 0.12)").toRgbString()}, - 0 5px 12px 4px ${new ta("rgba(0, 0, 0, 0.09)").toRgbString()} + 0 1px 2px -2px ${new na("rgba(0, 0, 0, 0.16)").toRgbString()}, + 0 3px 6px 0 ${new na("rgba(0, 0, 0, 0.12)").toRgbString()}, + 0 5px 12px 4px ${new na("rgba(0, 0, 0, 0.09)").toRgbString()} `,boxShadowDrawerRight:` -6px 0 16px 0 rgba(0, 0, 0, 0.08), -3px 0 6px -4px rgba(0, 0, 0, 0.12), @@ -109,8 +109,8 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho 0 -6px 16px 0 rgba(0, 0, 0, 0.08), 0 -3px 6px -4px rgba(0, 0, 0, 0.12), 0 -9px 28px 8px rgba(0, 0, 0, 0.05) - `,boxShadowTabsOverflowLeft:"inset 10px 0 8px -8px rgba(0, 0, 0, 0.08)",boxShadowTabsOverflowRight:"inset -10px 0 8px -8px rgba(0, 0, 0, 0.08)",boxShadowTabsOverflowTop:"inset 0 10px 8px -8px rgba(0, 0, 0, 0.08)",boxShadowTabsOverflowBottom:"inset 0 -10px 8px -8px rgba(0, 0, 0, 0.08)"}),n)}var Pte=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(i);o{const n=t.getDerivativeToken(i),{override:o}=e,r=Pte(e,["override"]);let s=Object.assign(Object.assign({},n),{override:o});return s=Uge(s),r&&Object.entries(r).forEach(a=>{let[l,c]=a;const{theme:u}=c,d=Pte(c,["theme"]);let h=d;u&&(h=qge(Object.assign(Object.assign({},s),d),{override:d},u)),s[l]=h}),s};function Fa(){const{token:i,hashed:e,theme:t,override:n,cssVar:o}=Bt.useContext(zge),r=`${V8e}-${e||""}`,s=t||Hge,[a,l,c]=d3e(s,[hD,i],{salt:r,override:n,getComputedToken:qge,formatToken:Uge,cssVar:o&&{prefix:o.prefix,key:o.key,unitless:jge,ignore:Kge,preserve:$8e}});return[s,c,e?l:"",a,o]}function el(i){var e=x.exports.useRef();e.current=i;var t=x.exports.useCallback(function(){for(var n,o=arguments.length,r=new Array(o),s=0;s1&&arguments[1]!==void 0?arguments[1]:!1;return{boxSizing:"border-box",margin:0,padding:0,color:i.colorText,fontSize:i.fontSize,lineHeight:i.lineHeight,listStyle:"none",fontFamily:e?"inherit":i.fontFamily}},TK=()=>({display:"inline-flex",alignItems:"center",color:"inherit",fontStyle:"normal",lineHeight:0,textAlign:"center",textTransform:"none",verticalAlign:"-0.125em",textRendering:"optimizeLegibility","-webkit-font-smoothing":"antialiased","-moz-osx-font-smoothing":"grayscale","> *":{lineHeight:1},svg:{display:"inline-block"}}),Gge=()=>({"&::before":{display:"table",content:'""'},"&::after":{display:"table",clear:"both",content:'""'}}),z8e=i=>({a:{color:i.colorLink,textDecoration:i.linkDecoration,backgroundColor:"transparent",outline:"none",cursor:"pointer",transition:`color ${i.motionDurationSlow}`,"-webkit-text-decoration-skip":"objects","&:hover":{color:i.colorLinkHover},"&:active":{color:i.colorLinkActive},[`&:active, - &:hover`]:{textDecoration:i.linkHoverDecoration,outline:0},"&:focus":{textDecoration:i.linkFocusDecoration,outline:0},"&[disabled]":{color:i.colorTextDisabled,cursor:"not-allowed"}}}),U8e=(i,e)=>{const{fontFamily:t,fontSize:n}=i,o=`[class^="${e}"], [class*=" ${e}"]`;return{[o]:{fontFamily:t,fontSize:n,boxSizing:"border-box","&::before, &::after":{boxSizing:"border-box"},[o]:{boxSizing:"border-box","&::before, &::after":{boxSizing:"border-box"}}}}},NK=i=>({outline:`${rt(i.lineWidthFocus)} solid ${i.colorPrimaryBorder}`,outlineOffset:1,transition:"outline-offset 0s, outline 0s"}),S4=i=>({"&:focus-visible":Object.assign({},NK(i))});let j8e=ga(function i(){fa(this,i)});var Xge=j8e;function K8e(i,e,t){return e=hv(e),bK(i,m4()?Reflect.construct(e,t||[],hv(i).constructor):e.apply(i,t))}let q8e=function(i){dp(e,i);function e(t){var n;return fa(this,e),n=K8e(this,e),n.result=0,t instanceof e?n.result=t.result:typeof t=="number"&&(n.result=t),n}return ga(e,[{key:"add",value:function(n){return n instanceof e?this.result+=n.result:typeof n=="number"&&(this.result+=n),this}},{key:"sub",value:function(n){return n instanceof e?this.result-=n.result:typeof n=="number"&&(this.result-=n),this}},{key:"mul",value:function(n){return n instanceof e?this.result*=n.result:typeof n=="number"&&(this.result*=n),this}},{key:"div",value:function(n){return n instanceof e?this.result/=n.result:typeof n=="number"&&(this.result/=n),this}},{key:"equal",value:function(){return this.result}}]),e}(Xge);function G8e(i,e,t){return e=hv(e),bK(i,m4()?Reflect.construct(e,t||[],hv(i).constructor):e.apply(i,t))}const Yge="CALC_UNIT";function t6(i){return typeof i=="number"?`${i}${Yge}`:i}let X8e=function(i){dp(e,i);function e(t){var n;return fa(this,e),n=G8e(this,e),n.result="",t instanceof e?n.result=`(${t.result})`:typeof t=="number"?n.result=t6(t):typeof t=="string"&&(n.result=t),n}return ga(e,[{key:"add",value:function(n){return n instanceof e?this.result=`${this.result} + ${n.getResult()}`:(typeof n=="number"||typeof n=="string")&&(this.result=`${this.result} + ${t6(n)}`),this.lowPriority=!0,this}},{key:"sub",value:function(n){return n instanceof e?this.result=`${this.result} - ${n.getResult()}`:(typeof n=="number"||typeof n=="string")&&(this.result=`${this.result} - ${t6(n)}`),this.lowPriority=!0,this}},{key:"mul",value:function(n){return this.lowPriority&&(this.result=`(${this.result})`),n instanceof e?this.result=`${this.result} * ${n.getResult(!0)}`:(typeof n=="number"||typeof n=="string")&&(this.result=`${this.result} * ${n}`),this.lowPriority=!1,this}},{key:"div",value:function(n){return this.lowPriority&&(this.result=`(${this.result})`),n instanceof e?this.result=`${this.result} / ${n.getResult(!0)}`:(typeof n=="number"||typeof n=="string")&&(this.result=`${this.result} / ${n}`),this.lowPriority=!1,this}},{key:"getResult",value:function(n){return this.lowPriority||n?`(${this.result})`:this.result}},{key:"equal",value:function(n){const{unit:o=!0}=n||{},r=new RegExp(`${Yge}`,"g");return this.result=this.result.replace(r,o?"px":""),typeof this.lowPriority!="undefined"?`calc(${this.result})`:this.result}}]),e}(Xge);const Y8e=i=>{const e=i==="css"?X8e:q8e;return t=>new e(t)};var Z8e=Y8e;function Q8e(i){return i==="js"?{max:Math.max,min:Math.min}:{max:function(){for(var e=arguments.length,t=new Array(e),n=0;nrt(o)).join(",")})`},min:function(){for(var e=arguments.length,t=new Array(e),n=0;nrt(o)).join(",")})`}}}const Zge=typeof CSSINJS_STATISTIC!="undefined";let rW=!0;function lr(){for(var i=arguments.length,e=new Array(i),t=0;t{Object.keys(o).forEach(s=>{Object.defineProperty(n,s,{configurable:!0,enumerable:!0,get:()=>o[s]})})}),rW=!0,n}const Ote={};function J8e(){}const e6e=i=>{let e,t=i,n=J8e;return Zge&&typeof Proxy!="undefined"&&(e=new Set,t=new Proxy(i,{get(o,r){return rW&&e.add(r),o[r]}}),n=(o,r)=>{var s;Ote[o]={global:Array.from(e),component:Object.assign(Object.assign({},(s=Ote[o])===null||s===void 0?void 0:s.component),r)}}),{token:t,keys:e,flush:n}},t6e=(i,e)=>{const[t,n]=Fa();return JB({theme:t,token:n,hashId:"",path:["ant-design-icons",i],nonce:()=>e==null?void 0:e.nonce},()=>[{[`.${i}`]:Object.assign(Object.assign({},TK()),{[`.${i} .${i}-icon`]:{display:"block"}})}])};var Qge=t6e;const Jge=(i,e,t)=>{var n;return typeof t=="function"?t(lr(e,(n=e[i])!==null&&n!==void 0?n:{})):t!=null?t:{}},epe=(i,e,t,n)=>{const o=Object.assign({},e[i]);if(n!=null&&n.deprecatedTokens){const{deprecatedTokens:s}=n;s.forEach(a=>{let[l,c]=a;var u;((o==null?void 0:o[l])||(o==null?void 0:o[c]))&&((u=o[c])!==null&&u!==void 0||(o[c]=o==null?void 0:o[l]))})}const r=Object.assign(Object.assign({},t),o);return Object.keys(r).forEach(s=>{r[s]===e[s]&&delete r[s]}),r},n6e=(i,e)=>`${[e,i.replace(/([A-Z]+)([A-Z][a-z]+)/g,"$1-$2").replace(/([a-z])([A-Z])/g,"$1-$2")].filter(Boolean).join("-")}`;function RK(i,e,t){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const o=Array.isArray(i)?i:[i,i],[r]=o,s=o.join("-");return a=>{const[l,c,u,d,h]=Fa(),{getPrefixCls:f,iconPrefixCls:g,csp:p}=x.exports.useContext(Hi),v=f(),m=h?"css":"js",_=Z8e(m),{max:w,min:y}=Q8e(m),L={theme:l,token:d,hashId:u,nonce:()=>p==null?void 0:p.nonce,clientOnly:n.clientOnly,order:n.order||-999};return JB(Object.assign(Object.assign({},L),{clientOnly:!1,path:["Shared",v]}),()=>[{"&":z8e(d)}]),Qge(g,p),[JB(Object.assign(Object.assign({},L),{path:[s,a,g]}),()=>{if(n.injectStyle===!1)return[];const{token:E,flush:I}=e6e(d),k=Jge(r,c,t),R=`.${a}`,A=epe(r,c,k,{deprecatedTokens:n.deprecatedTokens});h&&Object.keys(k).forEach(M=>{k[M]=`var(${vge(M,n6e(r,h.prefix))})`});const P=lr(E,{componentCls:R,prefixCls:a,iconCls:`.${g}`,antCls:`.${v}`,calc:_,max:w,min:y},h?k:A),N=e(P,{hashId:u,prefixCls:a,rootPrefixCls:v,iconPrefixCls:g});return I(r,A),[n.resetStyle===!1?null:U8e(P,a),N]}),u]}}const MK=(i,e,t,n)=>{const o=RK(i,e,t,Object.assign({resetStyle:!1,order:-998},n));return s=>{let{prefixCls:a}=s;return o(a),null}},i6e=(i,e,t)=>{function n(c){return`${i}${c.slice(0,1).toUpperCase()}${c.slice(1)}`}const{unitless:o={},injectStyle:r=!0}=t!=null?t:{},s={[n("zIndexPopup")]:!0};Object.keys(o).forEach(c=>{s[n(c)]=o[c]});const a=c=>{let{rootCls:u,cssVar:d}=c;const[,h]=Fa();return W3e({path:[i],prefix:d.prefix,key:d==null?void 0:d.key,unitless:Object.assign(Object.assign({},jge),s),ignore:Kge,token:h,scope:u},()=>{const f=Jge(i,h,e),g=epe(i,h,f,{deprecatedTokens:t==null?void 0:t.deprecatedTokens});return Object.keys(f).forEach(p=>{g[n(p)]=g[p],delete g[p]}),g}),null};return c=>{const[,,,,u]=Fa();return[d=>r&&u?vn(Ds,{children:[fe(a,{rootCls:c,cssVar:u,component:i}),d]}):d,u==null?void 0:u.key]}},Uc=(i,e,t,n)=>{const o=RK(i,e,t,n),r=i6e(Array.isArray(i)?i[0]:i,t,n);return function(s){let a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:s;const[,l]=o(s),[c,u]=r(a);return[c,l,u]}};function o6e(i,e){return mA.reduce((t,n)=>{const o=i[`${n}1`],r=i[`${n}3`],s=i[`${n}6`],a=i[`${n}7`];return Object.assign(Object.assign({},t),e(n,{lightColor:o,lightBorderColor:r,darkColor:s,textColor:a}))},{})}const r6e=Object.assign({},dI),{useId:Fte}=r6e,s6e=()=>"",a6e=typeof Fte=="undefined"?s6e:Fte;var l6e=a6e;function c6e(i,e){y4();const t=i||{},n=t.inherit===!1||!e?$ge:e,o=l6e();return wI(()=>{var r,s;if(!i)return e;const a=Object.assign({},n.components);Object.keys(i.components||{}).forEach(u=>{a[u]=Object.assign(Object.assign({},a[u]),i.components[u])});const l=`css-var-${o.replace(/:/g,"")}`,c=((r=t.cssVar)!==null&&r!==void 0?r:n.cssVar)&&Object.assign(Object.assign(Object.assign({prefix:"ant"},typeof n.cssVar=="object"?n.cssVar:{}),typeof t.cssVar=="object"?t.cssVar:{}),{key:typeof t.cssVar=="object"&&((s=t.cssVar)===null||s===void 0?void 0:s.key)||l});return Object.assign(Object.assign(Object.assign({},n),t),{token:Object.assign(Object.assign({},n.token),t.token),components:a,cssVar:c})},[t,n],(r,s)=>r.some((a,l)=>{const c=s[l];return!_4(a,c,!0)}))}var u6e=["children"],tpe=x.exports.createContext({});function d6e(i){var e=i.children,t=Hn(i,u6e);return x.exports.createElement(tpe.Provider,{value:t},e)}var h6e=function(i){dp(t,i);var e=Mb(t);function t(){return fa(this,t),e.apply(this,arguments)}return ga(t,[{key:"render",value:function(){return this.props.children}}]),t}(x.exports.Component),k_="none",HN="appear",$N="enter",zN="leave",Bte="none",pd="prepare",xC="start",LC="active",AK="end",npe="prepared";function Wte(i,e){var t={};return t[i.toLowerCase()]=e.toLowerCase(),t["Webkit".concat(i)]="webkit".concat(e),t["Moz".concat(i)]="moz".concat(e),t["ms".concat(i)]="MS".concat(e),t["O".concat(i)]="o".concat(e.toLowerCase()),t}function f6e(i,e){var t={animationend:Wte("Animation","AnimationEnd"),transitionend:Wte("Transition","TransitionEnd")};return i&&("AnimationEvent"in e||delete t.animationend.animation,"TransitionEvent"in e||delete t.transitionend.transition),t}var g6e=f6e(Oa(),typeof window!="undefined"?window:{}),ipe={};if(Oa()){var p6e=document.createElement("div");ipe=p6e.style}var UN={};function ope(i){if(UN[i])return UN[i];var e=g6e[i];if(e)for(var t=Object.keys(e),n=t.length,o=0;o1&&arguments[1]!==void 0?arguments[1]:2;e();var r=Xi(function(){o<=1?n({isCanceled:function(){return r!==i.current}}):t(n,o-1)});i.current=r}return x.exports.useEffect(function(){return function(){e()}},[]),[t,e]},_6e=[pd,xC,LC,AK],b6e=[pd,npe],cpe=!1,C6e=!0;function upe(i){return i===LC||i===AK}var w6e=function(i,e,t){var n=$m(Bte),o=Ne(n,2),r=o[0],s=o[1],a=v6e(),l=Ne(a,2),c=l[0],u=l[1];function d(){s(pd,!0)}var h=e?b6e:_6e;return lpe(function(){if(r!==Bte&&r!==AK){var f=h.indexOf(r),g=h[f+1],p=t(r);p===cpe?s(g,!0):g&&c(function(v){function m(){v.isCanceled()||s(g,!0)}p===!0?m():Promise.resolve(p).then(m)})}},[i,r]),x.exports.useEffect(function(){return function(){u()}},[]),[d,r]};function y6e(i,e,t,n){var o=n.motionEnter,r=o===void 0?!0:o,s=n.motionAppear,a=s===void 0?!0:s,l=n.motionLeave,c=l===void 0?!0:l,u=n.motionDeadline,d=n.motionLeaveImmediately,h=n.onAppearPrepare,f=n.onEnterPrepare,g=n.onLeavePrepare,p=n.onAppearStart,v=n.onEnterStart,m=n.onLeaveStart,_=n.onAppearActive,w=n.onEnterActive,y=n.onLeaveActive,L=n.onAppearEnd,D=n.onEnterEnd,E=n.onLeaveEnd,I=n.onVisibleChanged,k=$m(),R=Ne(k,2),A=R[0],P=R[1],N=$m(k_),M=Ne(N,2),H=M[0],W=M[1],F=$m(null),$=Ne(F,2),z=$[0],K=$[1],j=x.exports.useRef(!1),G=x.exports.useRef(null);function X(){return t()}var de=x.exports.useRef(!1);function he(){W(k_,!0),K(null,!0)}function pe(Ge){var re=X();if(!(Ge&&!Ge.deadline&&Ge.target!==re)){var ie=de.current,se;H===HN&&ie?se=L==null?void 0:L(re,Ge):H===$N&&ie?se=D==null?void 0:D(re,Ge):H===zN&&ie&&(se=E==null?void 0:E(re,Ge)),H!==k_&&ie&&se!==!1&&he()}}var be=m6e(pe),Se=Ne(be,1),Fe=Se[0],De=function(re){var ie,se,U;switch(re){case HN:return ie={},me(ie,pd,h),me(ie,xC,p),me(ie,LC,_),ie;case $N:return se={},me(se,pd,f),me(se,xC,v),me(se,LC,w),se;case zN:return U={},me(U,pd,g),me(U,xC,m),me(U,LC,y),U;default:return{}}},ce=x.exports.useMemo(function(){return De(H)},[H]),Pe=w6e(H,!i,function(Ge){if(Ge===pd){var re=ce[pd];return re?re(X()):cpe}if(Ee in ce){var ie;K(((ie=ce[Ee])===null||ie===void 0?void 0:ie.call(ce,X(),null))||null)}return Ee===LC&&(Fe(X()),u>0&&(clearTimeout(G.current),G.current=setTimeout(function(){pe({deadline:!0})},u))),Ee===npe&&he(),C6e}),Oe=Ne(Pe,2),xe=Oe[0],Ee=Oe[1],tt=upe(Ee);de.current=tt,lpe(function(){P(e);var Ge=j.current;j.current=!0;var re;!Ge&&e&&a&&(re=HN),Ge&&e&&r&&(re=$N),(Ge&&!e&&c||!Ge&&d&&!e&&c)&&(re=zN);var ie=De(re);re&&(i||ie[pd])?(W(re),xe()):W(k_)},[e]),x.exports.useEffect(function(){(H===HN&&!a||H===$N&&!r||H===zN&&!c)&&W(k_)},[a,r,c]),x.exports.useEffect(function(){return function(){j.current=!1,clearTimeout(G.current)}},[]);var nt=x.exports.useRef(!1);x.exports.useEffect(function(){A&&(nt.current=!0),A!==void 0&&H===k_&&((nt.current||A)&&(I==null||I(A)),nt.current=!0)},[A,H]);var Qe=z;return ce[pd]&&Ee===xC&&(Qe=Ce({transition:"none"},Qe)),[H,Ee,Qe,A!=null?A:e]}function S6e(i){var e=i;Kn(i)==="object"&&(e=i.transitionSupport);function t(o,r){return!!(o.motionName&&e&&r!==!1)}var n=x.exports.forwardRef(function(o,r){var s=o.visible,a=s===void 0?!0:s,l=o.removeOnLeave,c=l===void 0?!0:l,u=o.forceRender,d=o.children,h=o.motionName,f=o.leavedClassName,g=o.eventProps,p=x.exports.useContext(tpe),v=p.motion,m=t(o,v),_=x.exports.useRef(),w=x.exports.useRef();function y(){try{return _.current instanceof HTMLElement?_.current:QL(w.current)}catch{return null}}var L=y6e(m,a,y,o),D=Ne(L,4),E=D[0],I=D[1],k=D[2],R=D[3],A=x.exports.useRef(R);R&&(A.current=!0);var P=x.exports.useCallback(function(K){_.current=K,_K(r,K)},[r]),N,M=Ce(Ce({},g),{},{visible:a});if(!d)N=null;else if(E===k_)R?N=d(Ce({},M),P):!c&&A.current&&f?N=d(Ce(Ce({},M),{},{className:f}),P):u||!c&&!f?N=d(Ce(Ce({},M),{},{style:{display:"none"}}),P):N=null;else{var H,W;I===pd?W="prepare":upe(I)?W="active":I===xC&&(W="start");var F=$te(h,"".concat(E,"-").concat(W));N=d(Ce(Ce({},M),{},{className:Ue($te(h,E),(H={},me(H,F,F&&W),me(H,h,typeof h=="string"),H)),style:k}),P)}if(x.exports.isValidElement(N)&&jv(N)){var $=N,z=$.ref;z||(N=x.exports.cloneElement(N,{ref:P}))}return x.exports.createElement(h6e,{ref:w},N)});return n.displayName="CSSMotion",n}var eh=S6e(ape),sW="add",aW="keep",lW="remove",n6="removed";function x6e(i){var e;return i&&Kn(i)==="object"&&"key"in i?e=i:e={key:i},Ce(Ce({},e),{},{key:String(e.key)})}function cW(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return i.map(x6e)}function L6e(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],t=[],n=0,o=e.length,r=cW(i),s=cW(e);r.forEach(function(c){for(var u=!1,d=n;d1});return l.forEach(function(c){t=t.filter(function(u){var d=u.key,h=u.status;return d!==c||h!==lW}),t.forEach(function(u){u.key===c&&(u.status=aW)})}),t}var E6e=["component","children","onVisibleChanged","onAllRemoved"],D6e=["status"],k6e=["eventProps","visible","children","motionName","motionAppear","motionEnter","motionLeave","motionLeaveImmediately","motionDeadline","removeOnLeave","leavedClassName","onAppearPrepare","onAppearStart","onAppearActive","onAppearEnd","onEnterStart","onEnterActive","onEnterEnd","onLeaveStart","onLeaveActive","onLeaveEnd"];function I6e(i){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:eh,t=function(n){dp(r,n);var o=Mb(r);function r(){var s;fa(this,r);for(var a=arguments.length,l=new Array(a),c=0;cnull,R6e=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(i);oe.endsWith("Color"))}const F6e=i=>{const{prefixCls:e,iconPrefixCls:t,theme:n,holderRender:o}=i;e!==void 0&&(_A=e),t!==void 0&&(hpe=t),"holderRender"in i&&(gpe=o),n&&(O6e(n)?F8e(HR(),n):fpe=n)},PK=()=>({getPrefixCls:(i,e)=>e||(i?`${HR()}-${i}`:HR()),getIconPrefixCls:P6e,getRootPrefixCls:()=>_A||HR(),getTheme:()=>fpe,holderRender:gpe}),B6e=i=>{const{children:e,csp:t,autoInsertSpaceInButton:n,alert:o,anchor:r,form:s,locale:a,componentSize:l,direction:c,space:u,virtual:d,dropdownMatchSelectWidth:h,popupMatchSelectWidth:f,popupOverflow:g,legacyLocale:p,parentContext:v,iconPrefixCls:m,theme:_,componentDisabled:w,segmented:y,statistic:L,spin:D,calendar:E,carousel:I,cascader:k,collapse:R,typography:A,checkbox:P,descriptions:N,divider:M,drawer:H,skeleton:W,steps:F,image:$,layout:z,list:K,mentions:j,modal:G,progress:X,result:de,slider:he,breadcrumb:pe,menu:be,pagination:Se,input:Fe,empty:De,badge:ce,radio:Pe,rate:Oe,switch:xe,transfer:Ee,avatar:tt,message:nt,tag:Qe,table:Ge,card:re,tabs:ie,timeline:se,timePicker:U,upload:Y,notification:oe,tree:te,colorPicker:we,datePicker:Le,rangePicker:Te,flex:We,wave:je,dropdown:mt,warning:Et}=i,At=x.exports.useCallback((Pt,qt)=>{const{prefixCls:Nt}=i;if(qt)return qt;const jt=Nt||v.getPrefixCls("");return Pt?`${jt}-${Pt}`:jt},[v.getPrefixCls,i.prefixCls]),Je=m||v.iconPrefixCls||kK,xt=t||v.csp;Qge(Je,xt);const Ot=c6e(_,v.theme),Vn={csp:xt,autoInsertSpaceInButton:n,alert:o,anchor:r,locale:a||p,direction:c,space:u,virtual:d,popupMatchSelectWidth:f!=null?f:h,popupOverflow:g,getPrefixCls:At,iconPrefixCls:Je,theme:Ot,segmented:y,statistic:L,spin:D,calendar:E,carousel:I,cascader:k,collapse:R,typography:A,checkbox:P,descriptions:N,divider:M,drawer:H,skeleton:W,steps:F,image:$,input:Fe,layout:z,list:K,mentions:j,modal:G,progress:X,result:de,slider:he,breadcrumb:pe,menu:be,pagination:Se,empty:De,badge:ce,radio:Pe,rate:Oe,switch:xe,transfer:Ee,avatar:tt,message:nt,tag:Qe,table:Ge,card:re,tabs:ie,timeline:se,timePicker:U,upload:Y,notification:oe,tree:te,colorPicker:we,datePicker:Le,rangePicker:Te,flex:We,wave:je,dropdown:mt,warning:Et},Lt=Object.assign({},v);Object.keys(Vn).forEach(Pt=>{Vn[Pt]!==void 0&&(Lt[Pt]=Vn[Pt])}),M6e.forEach(Pt=>{const qt=i[Pt];qt&&(Lt[Pt]=qt)});const tn=wI(()=>Lt,Lt,(Pt,qt)=>{const Nt=Object.keys(Pt),jt=Object.keys(qt);return Nt.length!==jt.length||Nt.some(Gt=>Pt[Gt]!==qt[Gt])}),ui=x.exports.useMemo(()=>({prefixCls:Je,csp:xt}),[Je,xt]);let cn=x.exports.createElement(x.exports.Fragment,null,x.exports.createElement(N6e,{dropdownMatchSelectWidth:h}),e);const qn=x.exports.useMemo(()=>{var Pt,qt,Nt,jt;return SC(((Pt=gv.Form)===null||Pt===void 0?void 0:Pt.defaultValidateMessages)||{},((Nt=(qt=tn.locale)===null||qt===void 0?void 0:qt.Form)===null||Nt===void 0?void 0:Nt.defaultValidateMessages)||{},((jt=tn.form)===null||jt===void 0?void 0:jt.validateMessages)||{},(s==null?void 0:s.validateMessages)||{})},[tn,s==null?void 0:s.validateMessages]);Object.keys(qn).length>0&&(cn=x.exports.createElement(Age.Provider,{value:qn},cn)),a&&(cn=x.exports.createElement(n8e,{locale:a,_ANT_MARK__:e8e},cn)),(Je||xt)&&(cn=x.exports.createElement(EK.Provider,{value:ui},cn)),l&&(cn=x.exports.createElement(B8e,{size:l},cn)),cn=x.exports.createElement(T6e,null,cn);const bn=x.exports.useMemo(()=>{const Pt=Ot||{},{algorithm:qt,token:Nt,components:jt,cssVar:Gt}=Pt,kt=R6e(Pt,["algorithm","token","components","cssVar"]),Ft=qt&&(!Array.isArray(qt)||qt.length>0)?KB(qt):Hge,bt={};Object.entries(jt||{}).forEach(yn=>{let[Dn,Gn]=yn;const Un=Object.assign({},Gn);"algorithm"in Un&&(Un.algorithm===!0?Un.theme=Ft:(Array.isArray(Un.algorithm)||typeof Un.algorithm=="function")&&(Un.theme=KB(Un.algorithm)),delete Un.algorithm),bt[Dn]=Un});const Zt=Object.assign(Object.assign({},hD),Nt);return Object.assign(Object.assign({},kt),{theme:Ft,token:Zt,components:bt,override:Object.assign({override:Zt},bt),cssVar:Gt})},[Ot]);return _&&(cn=x.exports.createElement(zge.Provider,{value:bn},cn)),tn.warning&&(cn=x.exports.createElement(j3e.Provider,{value:tn.warning},cn)),w!==void 0&&(cn=x.exports.createElement(IK,{disabled:w},cn)),x.exports.createElement(Hi.Provider,{value:tn},cn)},hp=i=>{const e=x.exports.useContext(Hi),t=x.exports.useContext(DK);return x.exports.createElement(B6e,Object.assign({parentContext:e,legacyLocale:t},i))};hp.ConfigContext=Hi;hp.SizeContext=SI;hp.config=F6e;hp.useConfig=W8e;Object.defineProperty(hp,"SizeContext",{get:()=>SI});var W6e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm193.5 301.7l-210.6 292a31.8 31.8 0 01-51.7 0L318.5 484.9c-3.8-5.3 0-12.7 6.5-12.7h46.9c10.2 0 19.9 4.9 25.9 13.3l71.2 98.8 157.2-218c6-8.3 15.6-13.3 25.9-13.3H699c6.5 0 10.3 7.4 6.5 12.7z"}}]},name:"check-circle",theme:"filled"},V6e=W6e;function ppe(i){var e;return i==null||(e=i.getRootNode)===null||e===void 0?void 0:e.call(i)}function H6e(i){return ppe(i)instanceof ShadowRoot}function bA(i){return H6e(i)?ppe(i):null}function $6e(i){return i.replace(/-(.)/g,function(e,t){return t.toUpperCase()})}function z6e(i,e){rr(i,"[@ant-design/icons] ".concat(e))}function zte(i){return Kn(i)==="object"&&typeof i.name=="string"&&typeof i.theme=="string"&&(Kn(i.icon)==="object"||typeof i.icon=="function")}function Ute(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return Object.keys(i).reduce(function(e,t){var n=i[t];switch(t){case"class":e.className=n,delete e.class;break;default:delete e[t],e[$6e(t)]=n}return e},{})}function uW(i,e,t){return t?Bt.createElement(i.tag,Ce(Ce({key:e},Ute(i.attrs)),t),(i.children||[]).map(function(n,o){return uW(n,"".concat(e,"-").concat(i.tag,"-").concat(o))})):Bt.createElement(i.tag,Ce({key:e},Ute(i.attrs)),(i.children||[]).map(function(n,o){return uW(n,"".concat(e,"-").concat(i.tag,"-").concat(o))}))}function mpe(i){return $0(i)[0]}function vpe(i){return i?Array.isArray(i)?i:[i]:[]}var U6e=` + `,boxShadowTabsOverflowLeft:"inset 10px 0 8px -8px rgba(0, 0, 0, 0.08)",boxShadowTabsOverflowRight:"inset -10px 0 8px -8px rgba(0, 0, 0, 0.08)",boxShadowTabsOverflowTop:"inset 0 10px 8px -8px rgba(0, 0, 0, 0.08)",boxShadowTabsOverflowBottom:"inset 0 -10px 8px -8px rgba(0, 0, 0, 0.08)"}),n)}var zte=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(i);o{const n=t.getDerivativeToken(i),{override:o}=e,r=zte(e,["override"]);let s=Object.assign(Object.assign({},n),{override:o});return s=Zge(s),r&&Object.entries(r).forEach(a=>{let[l,c]=a;const{theme:u}=c,d=zte(c,["theme"]);let h=d;u&&(h=epe(Object.assign(Object.assign({},s),d),{override:d},u)),s[l]=h}),s};function Ba(){const{token:i,hashed:e,theme:t,override:n,cssVar:o}=Bt.useContext(Yge),r=`${G8e}-${e||""}`,s=t||Gge,[a,l,c]=b3e(s,[fD,i],{salt:r,override:n,getComputedToken:epe,formatToken:Zge,cssVar:o&&{prefix:o.prefix,key:o.key,unitless:Qge,ignore:Jge,preserve:Y8e}});return[s,c,e?l:"",a,o]}function tl(i){var e=x.exports.useRef();e.current=i;var t=x.exports.useCallback(function(){for(var n,o=arguments.length,r=new Array(o),s=0;s1&&arguments[1]!==void 0?arguments[1]:!1;return{boxSizing:"border-box",margin:0,padding:0,color:i.colorText,fontSize:i.fontSize,lineHeight:i.lineHeight,listStyle:"none",fontFamily:e?"inherit":i.fontFamily}},AK=()=>({display:"inline-flex",alignItems:"center",color:"inherit",fontStyle:"normal",lineHeight:0,textAlign:"center",textTransform:"none",verticalAlign:"-0.125em",textRendering:"optimizeLegibility","-webkit-font-smoothing":"antialiased","-moz-osx-font-smoothing":"grayscale","> *":{lineHeight:1},svg:{display:"inline-block"}}),tpe=()=>({"&::before":{display:"table",content:'""'},"&::after":{display:"table",clear:"both",content:'""'}}),Z8e=i=>({a:{color:i.colorLink,textDecoration:i.linkDecoration,backgroundColor:"transparent",outline:"none",cursor:"pointer",transition:`color ${i.motionDurationSlow}`,"-webkit-text-decoration-skip":"objects","&:hover":{color:i.colorLinkHover},"&:active":{color:i.colorLinkActive},[`&:active, + &:hover`]:{textDecoration:i.linkHoverDecoration,outline:0},"&:focus":{textDecoration:i.linkFocusDecoration,outline:0},"&[disabled]":{color:i.colorTextDisabled,cursor:"not-allowed"}}}),Q8e=(i,e)=>{const{fontFamily:t,fontSize:n}=i,o=`[class^="${e}"], [class*=" ${e}"]`;return{[o]:{fontFamily:t,fontSize:n,boxSizing:"border-box","&::before, &::after":{boxSizing:"border-box"},[o]:{boxSizing:"border-box","&::before, &::after":{boxSizing:"border-box"}}}}},PK=i=>({outline:`${rt(i.lineWidthFocus)} solid ${i.colorPrimaryBorder}`,outlineOffset:1,transition:"outline-offset 0s, outline 0s"}),x4=i=>({"&:focus-visible":Object.assign({},PK(i))});let J8e=pa(function i(){ga(this,i)});var npe=J8e;function e6e(i,e,t){return e=fv(e),SK(i,v4()?Reflect.construct(e,t||[],fv(i).constructor):e.apply(i,t))}let t6e=function(i){hp(e,i);function e(t){var n;return ga(this,e),n=e6e(this,e),n.result=0,t instanceof e?n.result=t.result:typeof t=="number"&&(n.result=t),n}return pa(e,[{key:"add",value:function(n){return n instanceof e?this.result+=n.result:typeof n=="number"&&(this.result+=n),this}},{key:"sub",value:function(n){return n instanceof e?this.result-=n.result:typeof n=="number"&&(this.result-=n),this}},{key:"mul",value:function(n){return n instanceof e?this.result*=n.result:typeof n=="number"&&(this.result*=n),this}},{key:"div",value:function(n){return n instanceof e?this.result/=n.result:typeof n=="number"&&(this.result/=n),this}},{key:"equal",value:function(){return this.result}}]),e}(npe);function n6e(i,e,t){return e=fv(e),SK(i,v4()?Reflect.construct(e,t||[],fv(i).constructor):e.apply(i,t))}const ipe="CALC_UNIT";function t6(i){return typeof i=="number"?`${i}${ipe}`:i}let i6e=function(i){hp(e,i);function e(t){var n;return ga(this,e),n=n6e(this,e),n.result="",t instanceof e?n.result=`(${t.result})`:typeof t=="number"?n.result=t6(t):typeof t=="string"&&(n.result=t),n}return pa(e,[{key:"add",value:function(n){return n instanceof e?this.result=`${this.result} + ${n.getResult()}`:(typeof n=="number"||typeof n=="string")&&(this.result=`${this.result} + ${t6(n)}`),this.lowPriority=!0,this}},{key:"sub",value:function(n){return n instanceof e?this.result=`${this.result} - ${n.getResult()}`:(typeof n=="number"||typeof n=="string")&&(this.result=`${this.result} - ${t6(n)}`),this.lowPriority=!0,this}},{key:"mul",value:function(n){return this.lowPriority&&(this.result=`(${this.result})`),n instanceof e?this.result=`${this.result} * ${n.getResult(!0)}`:(typeof n=="number"||typeof n=="string")&&(this.result=`${this.result} * ${n}`),this.lowPriority=!1,this}},{key:"div",value:function(n){return this.lowPriority&&(this.result=`(${this.result})`),n instanceof e?this.result=`${this.result} / ${n.getResult(!0)}`:(typeof n=="number"||typeof n=="string")&&(this.result=`${this.result} / ${n}`),this.lowPriority=!1,this}},{key:"getResult",value:function(n){return this.lowPriority||n?`(${this.result})`:this.result}},{key:"equal",value:function(n){const{unit:o=!0}=n||{},r=new RegExp(`${ipe}`,"g");return this.result=this.result.replace(r,o?"px":""),typeof this.lowPriority!="undefined"?`calc(${this.result})`:this.result}}]),e}(npe);const o6e=i=>{const e=i==="css"?i6e:t6e;return t=>new e(t)};var r6e=o6e;function s6e(i){return i==="js"?{max:Math.max,min:Math.min}:{max:function(){for(var e=arguments.length,t=new Array(e),n=0;nrt(o)).join(",")})`},min:function(){for(var e=arguments.length,t=new Array(e),n=0;nrt(o)).join(",")})`}}}const ope=typeof CSSINJS_STATISTIC!="undefined";let lW=!0;function lr(){for(var i=arguments.length,e=new Array(i),t=0;t{Object.keys(o).forEach(s=>{Object.defineProperty(n,s,{configurable:!0,enumerable:!0,get:()=>o[s]})})}),lW=!0,n}const Ute={};function a6e(){}const l6e=i=>{let e,t=i,n=a6e;return ope&&typeof Proxy!="undefined"&&(e=new Set,t=new Proxy(i,{get(o,r){return lW&&e.add(r),o[r]}}),n=(o,r)=>{var s;Ute[o]={global:Array.from(e),component:Object.assign(Object.assign({},(s=Ute[o])===null||s===void 0?void 0:s.component),r)}}),{token:t,keys:e,flush:n}},c6e=(i,e)=>{const[t,n]=Ba();return nW({theme:t,token:n,hashId:"",path:["ant-design-icons",i],nonce:()=>e==null?void 0:e.nonce},()=>[{[`.${i}`]:Object.assign(Object.assign({},AK()),{[`.${i} .${i}-icon`]:{display:"block"}})}])};var rpe=c6e;const spe=(i,e,t)=>{var n;return typeof t=="function"?t(lr(e,(n=e[i])!==null&&n!==void 0?n:{})):t!=null?t:{}},ape=(i,e,t,n)=>{const o=Object.assign({},e[i]);if(n!=null&&n.deprecatedTokens){const{deprecatedTokens:s}=n;s.forEach(a=>{let[l,c]=a;var u;((o==null?void 0:o[l])||(o==null?void 0:o[c]))&&((u=o[c])!==null&&u!==void 0||(o[c]=o==null?void 0:o[l]))})}const r=Object.assign(Object.assign({},t),o);return Object.keys(r).forEach(s=>{r[s]===e[s]&&delete r[s]}),r},u6e=(i,e)=>`${[e,i.replace(/([A-Z]+)([A-Z][a-z]+)/g,"$1-$2").replace(/([a-z])([A-Z])/g,"$1-$2")].filter(Boolean).join("-")}`;function OK(i,e,t){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const o=Array.isArray(i)?i:[i,i],[r]=o,s=o.join("-");return a=>{const[l,c,u,d,h]=Ba(),{getPrefixCls:f,iconPrefixCls:g,csp:p}=x.exports.useContext(Hi),v=f(),m=h?"css":"js",_=r6e(m),{max:y,min:w}=s6e(m),L={theme:l,token:d,hashId:u,nonce:()=>p==null?void 0:p.nonce,clientOnly:n.clientOnly,order:n.order||-999};return nW(Object.assign(Object.assign({},L),{clientOnly:!1,path:["Shared",v]}),()=>[{"&":Z8e(d)}]),rpe(g,p),[nW(Object.assign(Object.assign({},L),{path:[s,a,g]}),()=>{if(n.injectStyle===!1)return[];const{token:E,flush:I}=l6e(d),k=spe(r,c,t),R=`.${a}`,A=ape(r,c,k,{deprecatedTokens:n.deprecatedTokens});h&&Object.keys(k).forEach(M=>{k[M]=`var(${xge(M,u6e(r,h.prefix))})`});const P=lr(E,{componentCls:R,prefixCls:a,iconCls:`.${g}`,antCls:`.${v}`,calc:_,max:y,min:w},h?k:A),N=e(P,{hashId:u,prefixCls:a,rootPrefixCls:v,iconPrefixCls:g});return I(r,A),[n.resetStyle===!1?null:Q8e(P,a),N]}),u]}}const FK=(i,e,t,n)=>{const o=OK(i,e,t,Object.assign({resetStyle:!1,order:-998},n));return s=>{let{prefixCls:a}=s;return o(a),null}},d6e=(i,e,t)=>{function n(c){return`${i}${c.slice(0,1).toUpperCase()}${c.slice(1)}`}const{unitless:o={},injectStyle:r=!0}=t!=null?t:{},s={[n("zIndexPopup")]:!0};Object.keys(o).forEach(c=>{s[n(c)]=o[c]});const a=c=>{let{rootCls:u,cssVar:d}=c;const[,h]=Ba();return q3e({path:[i],prefix:d.prefix,key:d==null?void 0:d.key,unitless:Object.assign(Object.assign({},Qge),s),ignore:Jge,token:h,scope:u},()=>{const f=spe(i,h,e),g=ape(i,h,f,{deprecatedTokens:t==null?void 0:t.deprecatedTokens});return Object.keys(f).forEach(p=>{g[n(p)]=g[p],delete g[p]}),g}),null};return c=>{const[,,,,u]=Ba();return[d=>r&&u?fn(ks,{children:[he(a,{rootCls:c,cssVar:u,component:i}),d]}):d,u==null?void 0:u.key]}},jc=(i,e,t,n)=>{const o=OK(i,e,t,n),r=d6e(Array.isArray(i)?i[0]:i,t,n);return function(s){let a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:s;const[,l]=o(s),[c,u]=r(a);return[c,l,u]}};function h6e(i,e){return bA.reduce((t,n)=>{const o=i[`${n}1`],r=i[`${n}3`],s=i[`${n}6`],a=i[`${n}7`];return Object.assign(Object.assign({},t),e(n,{lightColor:o,lightBorderColor:r,darkColor:s,textColor:a}))},{})}const f6e=Object.assign({},dI),{useId:jte}=f6e,g6e=()=>"",p6e=typeof jte=="undefined"?g6e:jte;var m6e=p6e;function v6e(i,e){S4();const t=i||{},n=t.inherit===!1||!e?Xge:e,o=m6e();return SI(()=>{var r,s;if(!i)return e;const a=Object.assign({},n.components);Object.keys(i.components||{}).forEach(u=>{a[u]=Object.assign(Object.assign({},a[u]),i.components[u])});const l=`css-var-${o.replace(/:/g,"")}`,c=((r=t.cssVar)!==null&&r!==void 0?r:n.cssVar)&&Object.assign(Object.assign(Object.assign({prefix:"ant"},typeof n.cssVar=="object"?n.cssVar:{}),typeof t.cssVar=="object"?t.cssVar:{}),{key:typeof t.cssVar=="object"&&((s=t.cssVar)===null||s===void 0?void 0:s.key)||l});return Object.assign(Object.assign(Object.assign({},n),t),{token:Object.assign(Object.assign({},n.token),t.token),components:a,cssVar:c})},[t,n],(r,s)=>r.some((a,l)=>{const c=s[l];return!b4(a,c,!0)}))}var _6e=["children"],lpe=x.exports.createContext({});function b6e(i){var e=i.children,t=Hn(i,_6e);return x.exports.createElement(lpe.Provider,{value:t},e)}var C6e=function(i){hp(t,i);var e=Ab(t);function t(){return ga(this,t),e.apply(this,arguments)}return pa(t,[{key:"render",value:function(){return this.props.children}}]),t}(x.exports.Component),I_="none",UN="appear",jN="enter",KN="leave",Kte="none",md="prepare",xC="start",LC="active",BK="end",cpe="prepared";function qte(i,e){var t={};return t[i.toLowerCase()]=e.toLowerCase(),t["Webkit".concat(i)]="webkit".concat(e),t["Moz".concat(i)]="moz".concat(e),t["ms".concat(i)]="MS".concat(e),t["O".concat(i)]="o".concat(e.toLowerCase()),t}function y6e(i,e){var t={animationend:qte("Animation","AnimationEnd"),transitionend:qte("Transition","TransitionEnd")};return i&&("AnimationEvent"in e||delete t.animationend.animation,"TransitionEvent"in e||delete t.transitionend.transition),t}var w6e=y6e(Fa(),typeof window!="undefined"?window:{}),upe={};if(Fa()){var S6e=document.createElement("div");upe=S6e.style}var qN={};function dpe(i){if(qN[i])return qN[i];var e=w6e[i];if(e)for(var t=Object.keys(e),n=t.length,o=0;o1&&arguments[1]!==void 0?arguments[1]:2;e();var r=Xi(function(){o<=1?n({isCanceled:function(){return r!==i.current}}):t(n,o-1)});i.current=r}return x.exports.useEffect(function(){return function(){e()}},[]),[t,e]},E6e=[md,xC,LC,BK],D6e=[md,cpe],mpe=!1,k6e=!0;function vpe(i){return i===LC||i===BK}var I6e=function(i,e,t){var n=zm(Kte),o=Ne(n,2),r=o[0],s=o[1],a=L6e(),l=Ne(a,2),c=l[0],u=l[1];function d(){s(md,!0)}var h=e?D6e:E6e;return ppe(function(){if(r!==Kte&&r!==BK){var f=h.indexOf(r),g=h[f+1],p=t(r);p===mpe?s(g,!0):g&&c(function(v){function m(){v.isCanceled()||s(g,!0)}p===!0?m():Promise.resolve(p).then(m)})}},[i,r]),x.exports.useEffect(function(){return function(){u()}},[]),[d,r]};function T6e(i,e,t,n){var o=n.motionEnter,r=o===void 0?!0:o,s=n.motionAppear,a=s===void 0?!0:s,l=n.motionLeave,c=l===void 0?!0:l,u=n.motionDeadline,d=n.motionLeaveImmediately,h=n.onAppearPrepare,f=n.onEnterPrepare,g=n.onLeavePrepare,p=n.onAppearStart,v=n.onEnterStart,m=n.onLeaveStart,_=n.onAppearActive,y=n.onEnterActive,w=n.onLeaveActive,L=n.onAppearEnd,D=n.onEnterEnd,E=n.onLeaveEnd,I=n.onVisibleChanged,k=zm(),R=Ne(k,2),A=R[0],P=R[1],N=zm(I_),M=Ne(N,2),H=M[0],B=M[1],F=zm(null),$=Ne(F,2),z=$[0],K=$[1],j=x.exports.useRef(!1),G=x.exports.useRef(null);function X(){return t()}var de=x.exports.useRef(!1);function fe(){B(I_,!0),K(null,!0)}function pe(Ge){var re=X();if(!(Ge&&!Ge.deadline&&Ge.target!==re)){var ie=de.current,se;H===UN&&ie?se=L==null?void 0:L(re,Ge):H===jN&&ie?se=D==null?void 0:D(re,Ge):H===KN&&ie&&(se=E==null?void 0:E(re,Ge)),H!==I_&&ie&&se!==!1&&fe()}}var be=x6e(pe),Se=Ne(be,1),Fe=Se[0],De=function(re){var ie,se,U;switch(re){case UN:return ie={},me(ie,md,h),me(ie,xC,p),me(ie,LC,_),ie;case jN:return se={},me(se,md,f),me(se,xC,v),me(se,LC,y),se;case KN:return U={},me(U,md,g),me(U,xC,m),me(U,LC,w),U;default:return{}}},ce=x.exports.useMemo(function(){return De(H)},[H]),Pe=I6e(H,!i,function(Ge){if(Ge===md){var re=ce[md];return re?re(X()):mpe}if(Ee in ce){var ie;K(((ie=ce[Ee])===null||ie===void 0?void 0:ie.call(ce,X(),null))||null)}return Ee===LC&&(Fe(X()),u>0&&(clearTimeout(G.current),G.current=setTimeout(function(){pe({deadline:!0})},u))),Ee===cpe&&fe(),k6e}),Oe=Ne(Pe,2),xe=Oe[0],Ee=Oe[1],tt=vpe(Ee);de.current=tt,ppe(function(){P(e);var Ge=j.current;j.current=!0;var re;!Ge&&e&&a&&(re=UN),Ge&&e&&r&&(re=jN),(Ge&&!e&&c||!Ge&&d&&!e&&c)&&(re=KN);var ie=De(re);re&&(i||ie[md])?(B(re),xe()):B(I_)},[e]),x.exports.useEffect(function(){(H===UN&&!a||H===jN&&!r||H===KN&&!c)&&B(I_)},[a,r,c]),x.exports.useEffect(function(){return function(){j.current=!1,clearTimeout(G.current)}},[]);var nt=x.exports.useRef(!1);x.exports.useEffect(function(){A&&(nt.current=!0),A!==void 0&&H===I_&&((nt.current||A)&&(I==null||I(A)),nt.current=!0)},[A,H]);var Qe=z;return ce[md]&&Ee===xC&&(Qe=Ce({transition:"none"},Qe)),[H,Ee,Qe,A!=null?A:e]}function N6e(i){var e=i;Kn(i)==="object"&&(e=i.transitionSupport);function t(o,r){return!!(o.motionName&&e&&r!==!1)}var n=x.exports.forwardRef(function(o,r){var s=o.visible,a=s===void 0?!0:s,l=o.removeOnLeave,c=l===void 0?!0:l,u=o.forceRender,d=o.children,h=o.motionName,f=o.leavedClassName,g=o.eventProps,p=x.exports.useContext(lpe),v=p.motion,m=t(o,v),_=x.exports.useRef(),y=x.exports.useRef();function w(){try{return _.current instanceof HTMLElement?_.current:JL(y.current)}catch{return null}}var L=T6e(m,a,w,o),D=Ne(L,4),E=D[0],I=D[1],k=D[2],R=D[3],A=x.exports.useRef(R);R&&(A.current=!0);var P=x.exports.useCallback(function(K){_.current=K,wK(r,K)},[r]),N,M=Ce(Ce({},g),{},{visible:a});if(!d)N=null;else if(E===I_)R?N=d(Ce({},M),P):!c&&A.current&&f?N=d(Ce(Ce({},M),{},{className:f}),P):u||!c&&!f?N=d(Ce(Ce({},M),{},{style:{display:"none"}}),P):N=null;else{var H,B;I===md?B="prepare":vpe(I)?B="active":I===xC&&(B="start");var F=Yte(h,"".concat(E,"-").concat(B));N=d(Ce(Ce({},M),{},{className:Ue(Yte(h,E),(H={},me(H,F,F&&B),me(H,h,typeof h=="string"),H)),style:k}),P)}if(x.exports.isValidElement(N)&&Kv(N)){var $=N,z=$.ref;z||(N=x.exports.cloneElement(N,{ref:P}))}return x.exports.createElement(C6e,{ref:y},N)});return n.displayName="CSSMotion",n}var th=N6e(gpe),cW="add",uW="keep",dW="remove",n6="removed";function R6e(i){var e;return i&&Kn(i)==="object"&&"key"in i?e=i:e={key:i},Ce(Ce({},e),{},{key:String(e.key)})}function hW(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return i.map(R6e)}function M6e(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],t=[],n=0,o=e.length,r=hW(i),s=hW(e);r.forEach(function(c){for(var u=!1,d=n;d1});return l.forEach(function(c){t=t.filter(function(u){var d=u.key,h=u.status;return d!==c||h!==dW}),t.forEach(function(u){u.key===c&&(u.status=uW)})}),t}var A6e=["component","children","onVisibleChanged","onAllRemoved"],P6e=["status"],O6e=["eventProps","visible","children","motionName","motionAppear","motionEnter","motionLeave","motionLeaveImmediately","motionDeadline","removeOnLeave","leavedClassName","onAppearPrepare","onAppearStart","onAppearActive","onAppearEnd","onEnterStart","onEnterActive","onEnterEnd","onLeaveStart","onLeaveActive","onLeaveEnd"];function F6e(i){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:th,t=function(n){hp(r,n);var o=Ab(r);function r(){var s;ga(this,r);for(var a=arguments.length,l=new Array(a),c=0;cnull,V6e=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(i);oe.endsWith("Color"))}const j6e=i=>{const{prefixCls:e,iconPrefixCls:t,theme:n,holderRender:o}=i;e!==void 0&&(yA=e),t!==void 0&&(bpe=t),"holderRender"in i&&(ype=o),n&&(U6e(n)?j8e(UR(),n):Cpe=n)},WK=()=>({getPrefixCls:(i,e)=>e||(i?`${UR()}-${i}`:UR()),getIconPrefixCls:z6e,getRootPrefixCls:()=>yA||UR(),getTheme:()=>Cpe,holderRender:ype}),K6e=i=>{const{children:e,csp:t,autoInsertSpaceInButton:n,alert:o,anchor:r,form:s,locale:a,componentSize:l,direction:c,space:u,virtual:d,dropdownMatchSelectWidth:h,popupMatchSelectWidth:f,popupOverflow:g,legacyLocale:p,parentContext:v,iconPrefixCls:m,theme:_,componentDisabled:y,segmented:w,statistic:L,spin:D,calendar:E,carousel:I,cascader:k,collapse:R,typography:A,checkbox:P,descriptions:N,divider:M,drawer:H,skeleton:B,steps:F,image:$,layout:z,list:K,mentions:j,modal:G,progress:X,result:de,slider:fe,breadcrumb:pe,menu:be,pagination:Se,input:Fe,empty:De,badge:ce,radio:Pe,rate:Oe,switch:xe,transfer:Ee,avatar:tt,message:nt,tag:Qe,table:Ge,card:re,tabs:ie,timeline:se,timePicker:U,upload:Y,notification:oe,tree:te,colorPicker:ye,datePicker:Le,rangePicker:Te,flex:We,wave:je,dropdown:mt,warning:Dt}=i,At=x.exports.useCallback((Pt,qt)=>{const{prefixCls:Nt}=i;if(qt)return qt;const jt=Nt||v.getPrefixCls("");return Pt?`${jt}-${Pt}`:jt},[v.getPrefixCls,i.prefixCls]),Je=m||v.iconPrefixCls||RK,Lt=t||v.csp;rpe(Je,Lt);const Ot=v6e(_,v.theme),Vn={csp:Lt,autoInsertSpaceInButton:n,alert:o,anchor:r,locale:a||p,direction:c,space:u,virtual:d,popupMatchSelectWidth:f!=null?f:h,popupOverflow:g,getPrefixCls:At,iconPrefixCls:Je,theme:Ot,segmented:w,statistic:L,spin:D,calendar:E,carousel:I,cascader:k,collapse:R,typography:A,checkbox:P,descriptions:N,divider:M,drawer:H,skeleton:B,steps:F,image:$,input:Fe,layout:z,list:K,mentions:j,modal:G,progress:X,result:de,slider:fe,breadcrumb:pe,menu:be,pagination:Se,empty:De,badge:ce,radio:Pe,rate:Oe,switch:xe,transfer:Ee,avatar:tt,message:nt,tag:Qe,table:Ge,card:re,tabs:ie,timeline:se,timePicker:U,upload:Y,notification:oe,tree:te,colorPicker:ye,datePicker:Le,rangePicker:Te,flex:We,wave:je,dropdown:mt,warning:Dt},Et=Object.assign({},v);Object.keys(Vn).forEach(Pt=>{Vn[Pt]!==void 0&&(Et[Pt]=Vn[Pt])}),H6e.forEach(Pt=>{const qt=i[Pt];qt&&(Et[Pt]=qt)});const tn=SI(()=>Et,Et,(Pt,qt)=>{const Nt=Object.keys(Pt),jt=Object.keys(qt);return Nt.length!==jt.length||Nt.some(Gt=>Pt[Gt]!==qt[Gt])}),ui=x.exports.useMemo(()=>({prefixCls:Je,csp:Lt}),[Je,Lt]);let cn=x.exports.createElement(x.exports.Fragment,null,x.exports.createElement(W6e,{dropdownMatchSelectWidth:h}),e);const qn=x.exports.useMemo(()=>{var Pt,qt,Nt,jt;return SC(((Pt=pv.Form)===null||Pt===void 0?void 0:Pt.defaultValidateMessages)||{},((Nt=(qt=tn.locale)===null||qt===void 0?void 0:qt.Form)===null||Nt===void 0?void 0:Nt.defaultValidateMessages)||{},((jt=tn.form)===null||jt===void 0?void 0:jt.validateMessages)||{},(s==null?void 0:s.validateMessages)||{})},[tn,s==null?void 0:s.validateMessages]);Object.keys(qn).length>0&&(cn=x.exports.createElement(Hge.Provider,{value:qn},cn)),a&&(cn=x.exports.createElement(u8e,{locale:a,_ANT_MARK__:l8e},cn)),(Je||Lt)&&(cn=x.exports.createElement(TK.Provider,{value:ui},cn)),l&&(cn=x.exports.createElement(K8e,{size:l},cn)),cn=x.exports.createElement(B6e,null,cn);const bn=x.exports.useMemo(()=>{const Pt=Ot||{},{algorithm:qt,token:Nt,components:jt,cssVar:Gt}=Pt,It=V6e(Pt,["algorithm","token","components","cssVar"]),Ft=qt&&(!Array.isArray(qt)||qt.length>0)?XB(qt):Gge,bt={};Object.entries(jt||{}).forEach(wn=>{let[Dn,Gn]=wn;const Un=Object.assign({},Gn);"algorithm"in Un&&(Un.algorithm===!0?Un.theme=Ft:(Array.isArray(Un.algorithm)||typeof Un.algorithm=="function")&&(Un.theme=XB(Un.algorithm)),delete Un.algorithm),bt[Dn]=Un});const Zt=Object.assign(Object.assign({},fD),Nt);return Object.assign(Object.assign({},It),{theme:Ft,token:Zt,components:bt,override:Object.assign({override:Zt},bt),cssVar:Gt})},[Ot]);return _&&(cn=x.exports.createElement(Yge.Provider,{value:bn},cn)),tn.warning&&(cn=x.exports.createElement(J3e.Provider,{value:tn.warning},cn)),y!==void 0&&(cn=x.exports.createElement(MK,{disabled:y},cn)),x.exports.createElement(Hi.Provider,{value:tn},cn)},fp=i=>{const e=x.exports.useContext(Hi),t=x.exports.useContext(NK);return x.exports.createElement(K6e,Object.assign({parentContext:e,legacyLocale:t},i))};fp.ConfigContext=Hi;fp.SizeContext=LI;fp.config=j6e;fp.useConfig=q8e;Object.defineProperty(fp,"SizeContext",{get:()=>LI});var q6e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm193.5 301.7l-210.6 292a31.8 31.8 0 01-51.7 0L318.5 484.9c-3.8-5.3 0-12.7 6.5-12.7h46.9c10.2 0 19.9 4.9 25.9 13.3l71.2 98.8 157.2-218c6-8.3 15.6-13.3 25.9-13.3H699c6.5 0 10.3 7.4 6.5 12.7z"}}]},name:"check-circle",theme:"filled"},G6e=q6e;function wpe(i){var e;return i==null||(e=i.getRootNode)===null||e===void 0?void 0:e.call(i)}function X6e(i){return wpe(i)instanceof ShadowRoot}function wA(i){return X6e(i)?wpe(i):null}function Y6e(i){return i.replace(/-(.)/g,function(e,t){return t.toUpperCase()})}function Z6e(i,e){rr(i,"[@ant-design/icons] ".concat(e))}function Zte(i){return Kn(i)==="object"&&typeof i.name=="string"&&typeof i.theme=="string"&&(Kn(i.icon)==="object"||typeof i.icon=="function")}function Qte(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return Object.keys(i).reduce(function(e,t){var n=i[t];switch(t){case"class":e.className=n,delete e.class;break;default:delete e[t],e[Y6e(t)]=n}return e},{})}function fW(i,e,t){return t?Bt.createElement(i.tag,Ce(Ce({key:e},Qte(i.attrs)),t),(i.children||[]).map(function(n,o){return fW(n,"".concat(e,"-").concat(i.tag,"-").concat(o))})):Bt.createElement(i.tag,Ce({key:e},Qte(i.attrs)),(i.children||[]).map(function(n,o){return fW(n,"".concat(e,"-").concat(i.tag,"-").concat(o))}))}function Spe(i){return z0(i)[0]}function xpe(i){return i?Array.isArray(i)?i:[i]:[]}var Q6e=` .anticon { display: inline-block; color: inherit; @@ -164,7 +164,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho transform: rotate(360deg); } } -`,j6e=function(e){var t=x.exports.useContext(EK),n=t.csp,o=t.prefixCls,r=U6e;o&&(r=r.replace(/anticon/g,o)),x.exports.useEffect(function(){var s=e.current,a=bA(s);fv(r,"@ant-design-icons",{prepend:!0,csp:n,attachTo:a})},[])},K6e=["icon","className","onClick","style","primaryColor","secondaryColor"],tE={primaryColor:"#333",secondaryColor:"#E6E6E6",calculated:!1};function q6e(i){var e=i.primaryColor,t=i.secondaryColor;tE.primaryColor=e,tE.secondaryColor=t||mpe(e),tE.calculated=!!t}function G6e(){return Ce({},tE)}var x4=function(e){var t=e.icon,n=e.className,o=e.onClick,r=e.style,s=e.primaryColor,a=e.secondaryColor,l=Hn(e,K6e),c=x.exports.useRef(),u=tE;if(s&&(u={primaryColor:s,secondaryColor:a||mpe(s)}),j6e(c),z6e(zte(t),"icon should be icon definiton, but got ".concat(t)),!zte(t))return null;var d=t;return d&&typeof d.icon=="function"&&(d=Ce(Ce({},d),{},{icon:d.icon(u.primaryColor,u.secondaryColor)})),uW(d.icon,"svg-".concat(d.name),Ce(Ce({className:n,onClick:o,style:r,"data-icon":d.name,width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},l),{},{ref:c}))};x4.displayName="IconReact";x4.getTwoToneColors=G6e;x4.setTwoToneColors=q6e;var OK=x4;function _pe(i){var e=vpe(i),t=Ne(e,2),n=t[0],o=t[1];return OK.setTwoToneColors({primaryColor:n,secondaryColor:o})}function X6e(){var i=OK.getTwoToneColors();return i.calculated?[i.primaryColor,i.secondaryColor]:i.primaryColor}var Y6e=["className","icon","spin","rotate","tabIndex","onClick","twoToneColor"];_pe(b8e.primary);var L4=x.exports.forwardRef(function(i,e){var t,n=i.className,o=i.icon,r=i.spin,s=i.rotate,a=i.tabIndex,l=i.onClick,c=i.twoToneColor,u=Hn(i,Y6e),d=x.exports.useContext(EK),h=d.prefixCls,f=h===void 0?"anticon":h,g=d.rootClassName,p=Ue(g,f,(t={},me(t,"".concat(f,"-").concat(o.name),!!o.name),me(t,"".concat(f,"-spin"),!!r||o.name==="loading"),t),n),v=a;v===void 0&&l&&(v=-1);var m=s?{msTransform:"rotate(".concat(s,"deg)"),transform:"rotate(".concat(s,"deg)")}:void 0,_=vpe(c),w=Ne(_,2),y=w[0],L=w[1];return x.exports.createElement("span",Ct({role:"img","aria-label":o.name},u,{ref:e,tabIndex:v,onClick:l,className:p}),x.exports.createElement(OK,{icon:o,primaryColor:y,secondaryColor:L,style:m}))});L4.displayName="AntdIcon";L4.getTwoToneColor=X6e;L4.setTwoToneColor=_pe;var cr=L4,Z6e=function(e,t){return x.exports.createElement(cr,Ct({},e,{ref:t,icon:V6e}))},FK=x.exports.forwardRef(Z6e),Q6e={icon:{tag:"svg",attrs:{"fill-rule":"evenodd",viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64c247.4 0 448 200.6 448 448S759.4 960 512 960 64 759.4 64 512 264.6 64 512 64zm127.98 274.82h-.04l-.08.06L512 466.75 384.14 338.88c-.04-.05-.06-.06-.08-.06a.12.12 0 00-.07 0c-.03 0-.05.01-.09.05l-45.02 45.02a.2.2 0 00-.05.09.12.12 0 000 .07v.02a.27.27 0 00.06.06L466.75 512 338.88 639.86c-.05.04-.06.06-.06.08a.12.12 0 000 .07c0 .03.01.05.05.09l45.02 45.02a.2.2 0 00.09.05.12.12 0 00.07 0c.02 0 .04-.01.08-.05L512 557.25l127.86 127.87c.04.04.06.05.08.05a.12.12 0 00.07 0c.03 0 .05-.01.09-.05l45.02-45.02a.2.2 0 00.05-.09.12.12 0 000-.07v-.02a.27.27 0 00-.05-.06L557.25 512l127.87-127.86c.04-.04.05-.06.05-.08a.12.12 0 000-.07c0-.03-.01-.05-.05-.09l-45.02-45.02a.2.2 0 00-.09-.05.12.12 0 00-.07 0z"}}]},name:"close-circle",theme:"filled"},J6e=Q6e,e9e=function(e,t){return x.exports.createElement(cr,Ct({},e,{ref:t,icon:J6e}))},lS=x.exports.forwardRef(e9e),t9e={icon:{tag:"svg",attrs:{"fill-rule":"evenodd",viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M799.86 166.31c.02 0 .04.02.08.06l57.69 57.7c.04.03.05.05.06.08a.12.12 0 010 .06c0 .03-.02.05-.06.09L569.93 512l287.7 287.7c.04.04.05.06.06.09a.12.12 0 010 .07c0 .02-.02.04-.06.08l-57.7 57.69c-.03.04-.05.05-.07.06a.12.12 0 01-.07 0c-.03 0-.05-.02-.09-.06L512 569.93l-287.7 287.7c-.04.04-.06.05-.09.06a.12.12 0 01-.07 0c-.02 0-.04-.02-.08-.06l-57.69-57.7c-.04-.03-.05-.05-.06-.07a.12.12 0 010-.07c0-.03.02-.05.06-.09L454.07 512l-287.7-287.7c-.04-.04-.05-.06-.06-.09a.12.12 0 010-.07c0-.02.02-.04.06-.08l57.7-57.69c.03-.04.05-.05.07-.06a.12.12 0 01.07 0c.03 0 .05.02.09.06L512 454.07l287.7-287.7c.04-.04.06-.05.09-.06a.12.12 0 01.07 0z"}}]},name:"close",theme:"outlined"},n9e=t9e,i9e=function(e,t){return x.exports.createElement(cr,Ct({},e,{ref:t,icon:n9e}))},cS=x.exports.forwardRef(i9e),o9e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm-32 232c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V296zm32 440a48.01 48.01 0 010-96 48.01 48.01 0 010 96z"}}]},name:"exclamation-circle",theme:"filled"},r9e=o9e,s9e=function(e,t){return x.exports.createElement(cr,Ct({},e,{ref:t,icon:r9e}))},BK=x.exports.forwardRef(s9e),a9e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm32 664c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V456c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272zm-32-344a48.01 48.01 0 010-96 48.01 48.01 0 010 96z"}}]},name:"info-circle",theme:"filled"},l9e=a9e,c9e=function(e,t){return x.exports.createElement(cr,Ct({},e,{ref:t,icon:l9e}))},bpe=x.exports.forwardRef(c9e),u9e=`accept acceptCharset accessKey action allowFullScreen allowTransparency +`,J6e=function(e){var t=x.exports.useContext(TK),n=t.csp,o=t.prefixCls,r=Q6e;o&&(r=r.replace(/anticon/g,o)),x.exports.useEffect(function(){var s=e.current,a=wA(s);gv(r,"@ant-design-icons",{prepend:!0,csp:n,attachTo:a})},[])},e9e=["icon","className","onClick","style","primaryColor","secondaryColor"],nE={primaryColor:"#333",secondaryColor:"#E6E6E6",calculated:!1};function t9e(i){var e=i.primaryColor,t=i.secondaryColor;nE.primaryColor=e,nE.secondaryColor=t||Spe(e),nE.calculated=!!t}function n9e(){return Ce({},nE)}var L4=function(e){var t=e.icon,n=e.className,o=e.onClick,r=e.style,s=e.primaryColor,a=e.secondaryColor,l=Hn(e,e9e),c=x.exports.useRef(),u=nE;if(s&&(u={primaryColor:s,secondaryColor:a||Spe(s)}),J6e(c),Z6e(Zte(t),"icon should be icon definiton, but got ".concat(t)),!Zte(t))return null;var d=t;return d&&typeof d.icon=="function"&&(d=Ce(Ce({},d),{},{icon:d.icon(u.primaryColor,u.secondaryColor)})),fW(d.icon,"svg-".concat(d.name),Ce(Ce({className:n,onClick:o,style:r,"data-icon":d.name,width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},l),{},{ref:c}))};L4.displayName="IconReact";L4.getTwoToneColors=n9e;L4.setTwoToneColors=t9e;var VK=L4;function Lpe(i){var e=xpe(i),t=Ne(e,2),n=t[0],o=t[1];return VK.setTwoToneColors({primaryColor:n,secondaryColor:o})}function i9e(){var i=VK.getTwoToneColors();return i.calculated?[i.primaryColor,i.secondaryColor]:i.primaryColor}var o9e=["className","icon","spin","rotate","tabIndex","onClick","twoToneColor"];Lpe(D8e.primary);var E4=x.exports.forwardRef(function(i,e){var t,n=i.className,o=i.icon,r=i.spin,s=i.rotate,a=i.tabIndex,l=i.onClick,c=i.twoToneColor,u=Hn(i,o9e),d=x.exports.useContext(TK),h=d.prefixCls,f=h===void 0?"anticon":h,g=d.rootClassName,p=Ue(g,f,(t={},me(t,"".concat(f,"-").concat(o.name),!!o.name),me(t,"".concat(f,"-spin"),!!r||o.name==="loading"),t),n),v=a;v===void 0&&l&&(v=-1);var m=s?{msTransform:"rotate(".concat(s,"deg)"),transform:"rotate(".concat(s,"deg)")}:void 0,_=xpe(c),y=Ne(_,2),w=y[0],L=y[1];return x.exports.createElement("span",yt({role:"img","aria-label":o.name},u,{ref:e,tabIndex:v,onClick:l,className:p}),x.exports.createElement(VK,{icon:o,primaryColor:w,secondaryColor:L,style:m}))});E4.displayName="AntdIcon";E4.getTwoToneColor=i9e;E4.setTwoToneColor=Lpe;var cr=E4,r9e=function(e,t){return x.exports.createElement(cr,yt({},e,{ref:t,icon:G6e}))},HK=x.exports.forwardRef(r9e),s9e={icon:{tag:"svg",attrs:{"fill-rule":"evenodd",viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64c247.4 0 448 200.6 448 448S759.4 960 512 960 64 759.4 64 512 264.6 64 512 64zm127.98 274.82h-.04l-.08.06L512 466.75 384.14 338.88c-.04-.05-.06-.06-.08-.06a.12.12 0 00-.07 0c-.03 0-.05.01-.09.05l-45.02 45.02a.2.2 0 00-.05.09.12.12 0 000 .07v.02a.27.27 0 00.06.06L466.75 512 338.88 639.86c-.05.04-.06.06-.06.08a.12.12 0 000 .07c0 .03.01.05.05.09l45.02 45.02a.2.2 0 00.09.05.12.12 0 00.07 0c.02 0 .04-.01.08-.05L512 557.25l127.86 127.87c.04.04.06.05.08.05a.12.12 0 00.07 0c.03 0 .05-.01.09-.05l45.02-45.02a.2.2 0 00.05-.09.12.12 0 000-.07v-.02a.27.27 0 00-.05-.06L557.25 512l127.87-127.86c.04-.04.05-.06.05-.08a.12.12 0 000-.07c0-.03-.01-.05-.05-.09l-45.02-45.02a.2.2 0 00-.09-.05.12.12 0 00-.07 0z"}}]},name:"close-circle",theme:"filled"},a9e=s9e,l9e=function(e,t){return x.exports.createElement(cr,yt({},e,{ref:t,icon:a9e}))},cS=x.exports.forwardRef(l9e),c9e={icon:{tag:"svg",attrs:{"fill-rule":"evenodd",viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M799.86 166.31c.02 0 .04.02.08.06l57.69 57.7c.04.03.05.05.06.08a.12.12 0 010 .06c0 .03-.02.05-.06.09L569.93 512l287.7 287.7c.04.04.05.06.06.09a.12.12 0 010 .07c0 .02-.02.04-.06.08l-57.7 57.69c-.03.04-.05.05-.07.06a.12.12 0 01-.07 0c-.03 0-.05-.02-.09-.06L512 569.93l-287.7 287.7c-.04.04-.06.05-.09.06a.12.12 0 01-.07 0c-.02 0-.04-.02-.08-.06l-57.69-57.7c-.04-.03-.05-.05-.06-.07a.12.12 0 010-.07c0-.03.02-.05.06-.09L454.07 512l-287.7-287.7c-.04-.04-.05-.06-.06-.09a.12.12 0 010-.07c0-.02.02-.04.06-.08l57.7-57.69c.03-.04.05-.05.07-.06a.12.12 0 01.07 0c.03 0 .05.02.09.06L512 454.07l287.7-287.7c.04-.04.06-.05.09-.06a.12.12 0 01.07 0z"}}]},name:"close",theme:"outlined"},u9e=c9e,d9e=function(e,t){return x.exports.createElement(cr,yt({},e,{ref:t,icon:u9e}))},uS=x.exports.forwardRef(d9e),h9e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm-32 232c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V296zm32 440a48.01 48.01 0 010-96 48.01 48.01 0 010 96z"}}]},name:"exclamation-circle",theme:"filled"},f9e=h9e,g9e=function(e,t){return x.exports.createElement(cr,yt({},e,{ref:t,icon:f9e}))},$K=x.exports.forwardRef(g9e),p9e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm32 664c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V456c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272zm-32-344a48.01 48.01 0 010-96 48.01 48.01 0 010 96z"}}]},name:"info-circle",theme:"filled"},m9e=p9e,v9e=function(e,t){return x.exports.createElement(cr,yt({},e,{ref:t,icon:m9e}))},Epe=x.exports.forwardRef(v9e),_9e=`accept acceptCharset accessKey action allowFullScreen allowTransparency alt async autoComplete autoFocus autoPlay capture cellPadding cellSpacing challenge charSet checked classID className colSpan cols content contentEditable contextMenu controls coords crossOrigin data dateTime default defer dir disabled download draggable @@ -175,26 +175,26 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho optimum pattern placeholder poster preload radioGroup readOnly rel required reversed role rowSpan rows sandbox scope scoped scrolling seamless selected shape size sizes span spellCheck src srcDoc srcLang srcSet start step style - summary tabIndex target title type useMap value width wmode wrap`,d9e=`onCopy onCut onPaste onCompositionEnd onCompositionStart onCompositionUpdate onKeyDown + summary tabIndex target title type useMap value width wmode wrap`,b9e=`onCopy onCut onPaste onCompositionEnd onCompositionStart onCompositionUpdate onKeyDown onKeyPress onKeyUp onFocus onBlur onChange onInput onSubmit onClick onContextMenu onDoubleClick onDrag onDragEnd onDragEnter onDragExit onDragLeave onDragOver onDragStart onDrop onMouseDown onMouseEnter onMouseLeave onMouseMove onMouseOut onMouseOver onMouseUp onSelect onTouchCancel onTouchEnd onTouchMove onTouchStart onScroll onWheel onAbort onCanPlay onCanPlayThrough onDurationChange onEmptied onEncrypted onEnded onError onLoadedData onLoadedMetadata - onLoadStart onPause onPlay onPlaying onProgress onRateChange onSeeked onSeeking onStalled onSuspend onTimeUpdate onVolumeChange onWaiting onLoad onError`,h9e="".concat(u9e," ").concat(d9e).split(/[\s\n]+/),f9e="aria-",g9e="data-";function jte(i,e){return i.indexOf(e)===0}function z0(i){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,t;e===!1?t={aria:!0,data:!0,attr:!0}:e===!0?t={aria:!0}:t=Ce({},e);var n={};return Object.keys(i).forEach(function(o){(t.aria&&(o==="role"||jte(o,f9e))||t.data&&jte(o,g9e)||t.attr&&h9e.includes(o))&&(n[o]=i[o])}),n}const{isValidElement:sy}=dI;function Cpe(i){return i&&sy(i)&&i.type===x.exports.Fragment}function p9e(i,e,t){return sy(i)?x.exports.cloneElement(i,typeof t=="function"?t(i.props||{}):t):e}function pv(i,e){return p9e(i,i,e)}const Kte=i=>typeof i=="object"&&i!=null&&i.nodeType===1,qte=(i,e)=>(!e||i!=="hidden")&&i!=="visible"&&i!=="clip",i6=(i,e)=>{if(i.clientHeight{const o=(r=>{if(!r.ownerDocument||!r.ownerDocument.defaultView)return null;try{return r.ownerDocument.defaultView.frameElement}catch{return null}})(n);return!!o&&(o.clientHeightre||r>i&&s=e&&a>=t?r-i-n:s>e&&at?s-e+o:0,m9e=i=>{const e=i.parentElement;return e==null?i.getRootNode().host||null:e},Gte=(i,e)=>{var t,n,o,r;if(typeof document=="undefined")return[];const{scrollMode:s,block:a,inline:l,boundary:c,skipOverflowHiddenElements:u}=e,d=typeof c=="function"?c:W=>W!==c;if(!Kte(i))throw new TypeError("Invalid target");const h=document.scrollingElement||document.documentElement,f=[];let g=i;for(;Kte(g)&&d(g);){if(g=m9e(g),g===h){f.push(g);break}g!=null&&g===document.body&&i6(g)&&!i6(document.documentElement)||g!=null&&i6(g,u)&&f.push(g)}const p=(n=(t=window.visualViewport)==null?void 0:t.width)!=null?n:innerWidth,v=(r=(o=window.visualViewport)==null?void 0:o.height)!=null?r:innerHeight,{scrollX:m,scrollY:_}=window,{height:w,width:y,top:L,right:D,bottom:E,left:I}=i.getBoundingClientRect(),{top:k,right:R,bottom:A,left:P}=(W=>{const F=window.getComputedStyle(W);return{top:parseFloat(F.scrollMarginTop)||0,right:parseFloat(F.scrollMarginRight)||0,bottom:parseFloat(F.scrollMarginBottom)||0,left:parseFloat(F.scrollMarginLeft)||0}})(i);let N=a==="start"||a==="nearest"?L-k:a==="end"?E+A:L+w/2-k+A,M=l==="center"?I+y/2-P+R:l==="end"?D+R:I-P;const H=[];for(let W=0;W=0&&I>=0&&E<=v&&D<=p&&L>=K&&E<=G&&I>=X&&D<=j)return H;const de=getComputedStyle(F),he=parseInt(de.borderLeftWidth,10),pe=parseInt(de.borderTopWidth,10),be=parseInt(de.borderRightWidth,10),Se=parseInt(de.borderBottomWidth,10);let Fe=0,De=0;const ce="offsetWidth"in F?F.offsetWidth-F.clientWidth-he-be:0,Pe="offsetHeight"in F?F.offsetHeight-F.clientHeight-pe-Se:0,Oe="offsetWidth"in F?F.offsetWidth===0?0:z/F.offsetWidth:0,xe="offsetHeight"in F?F.offsetHeight===0?0:$/F.offsetHeight:0;if(h===F)Fe=a==="start"?N:a==="end"?N-v:a==="nearest"?jN(_,_+v,v,pe,Se,_+N,_+N+w,w):N-v/2,De=l==="start"?M:l==="center"?M-p/2:l==="end"?M-p:jN(m,m+p,p,he,be,m+M,m+M+y,y),Fe=Math.max(0,Fe+_),De=Math.max(0,De+m);else{Fe=a==="start"?N-K-pe:a==="end"?N-G+Se+Pe:a==="nearest"?jN(K,G,$,pe,Se+Pe,N,N+w,w):N-(K+$/2)+Pe/2,De=l==="start"?M-X-he:l==="center"?M-(X+z/2)+ce/2:l==="end"?M-j+be+ce:jN(X,j,z,he,be+ce,M,M+y,y);const{scrollLeft:Ee,scrollTop:tt}=F;Fe=xe===0?0:Math.max(0,Math.min(tt+Fe/xe,F.scrollHeight-$/xe+Pe)),De=Oe===0?0:Math.max(0,Math.min(Ee+De/Oe,F.scrollWidth-z/Oe+ce)),N+=tt-Fe,M+=Ee-De}H.push({el:F,top:Fe,left:De})}return H},v9e=i=>i===!1?{block:"end",inline:"nearest"}:(e=>e===Object(e)&&Object.keys(e).length!==0)(i)?i:{block:"start",inline:"nearest"};function _9e(i,e){if(!i.isConnected||!(o=>{let r=o;for(;r&&r.parentNode;){if(r.parentNode===document)return!0;r=r.parentNode instanceof ShadowRoot?r.parentNode.host:r.parentNode}return!1})(i))return;const t=(o=>{const r=window.getComputedStyle(o);return{top:parseFloat(r.scrollMarginTop)||0,right:parseFloat(r.scrollMarginRight)||0,bottom:parseFloat(r.scrollMarginBottom)||0,left:parseFloat(r.scrollMarginLeft)||0}})(i);if((o=>typeof o=="object"&&typeof o.behavior=="function")(e))return e.behavior(Gte(i,e));const n=typeof e=="boolean"||e==null?void 0:e.behavior;for(const{el:o,top:r,left:s}of Gte(i,v9e(e))){const a=r-t.top+t.bottom,l=s-t.left+t.right;o.scroll({top:a,left:l,behavior:n})}}const b9e=i=>{const[,,,,e]=Fa();return e?`${i}-css-var`:""};var th=b9e,at={MAC_ENTER:3,BACKSPACE:8,TAB:9,NUM_CENTER:12,ENTER:13,SHIFT:16,CTRL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:44,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,QUESTION_MARK:63,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,META:91,WIN_KEY_RIGHT:92,CONTEXT_MENU:93,NUM_ZERO:96,NUM_ONE:97,NUM_TWO:98,NUM_THREE:99,NUM_FOUR:100,NUM_FIVE:101,NUM_SIX:102,NUM_SEVEN:103,NUM_EIGHT:104,NUM_NINE:105,NUM_MULTIPLY:106,NUM_PLUS:107,NUM_MINUS:109,NUM_PERIOD:110,NUM_DIVISION:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,NUMLOCK:144,SEMICOLON:186,DASH:189,EQUALS:187,COMMA:188,PERIOD:190,SLASH:191,APOSTROPHE:192,SINGLE_QUOTE:222,OPEN_SQUARE_BRACKET:219,BACKSLASH:220,CLOSE_SQUARE_BRACKET:221,WIN_KEY:224,MAC_FF_META:224,WIN_IME:229,isTextModifyingKeyEvent:function(e){var t=e.keyCode;if(e.altKey&&!e.ctrlKey||e.metaKey||t>=at.F1&&t<=at.F12)return!1;switch(t){case at.ALT:case at.CAPS_LOCK:case at.CONTEXT_MENU:case at.CTRL:case at.DOWN:case at.END:case at.ESC:case at.HOME:case at.INSERT:case at.LEFT:case at.MAC_FF_META:case at.META:case at.NUMLOCK:case at.NUM_CENTER:case at.PAGE_DOWN:case at.PAGE_UP:case at.PAUSE:case at.PRINT_SCREEN:case at.RIGHT:case at.SHIFT:case at.UP:case at.WIN_KEY:case at.WIN_KEY_RIGHT:return!1;default:return!0}},isCharacterKey:function(e){if(e>=at.ZERO&&e<=at.NINE||e>=at.NUM_ZERO&&e<=at.NUM_MULTIPLY||e>=at.A&&e<=at.Z||window.navigator.userAgent.indexOf("WebKit")!==-1&&e===0)return!0;switch(e){case at.SPACE:case at.QUESTION_MARK:case at.NUM_PLUS:case at.NUM_MINUS:case at.NUM_PERIOD:case at.NUM_DIVISION:case at.SEMICOLON:case at.DASH:case at.EQUALS:case at.COMMA:case at.PERIOD:case at.SLASH:case at.APOSTROPHE:case at.SINGLE_QUOTE:case at.OPEN_SQUARE_BRACKET:case at.BACKSLASH:case at.CLOSE_SQUARE_BRACKET:return!0;default:return!1}}},wpe=x.exports.forwardRef(function(i,e){var t=i.prefixCls,n=i.style,o=i.className,r=i.duration,s=r===void 0?4.5:r,a=i.eventKey,l=i.content,c=i.closable,u=i.closeIcon,d=u===void 0?"x":u,h=i.props,f=i.onClick,g=i.onNoticeClose,p=i.times,v=i.hovering,m=x.exports.useState(!1),_=Ne(m,2),w=_[0],y=_[1],L=v||w,D=function(){g(a)},E=function(R){(R.key==="Enter"||R.code==="Enter"||R.keyCode===at.ENTER)&&D()};x.exports.useEffect(function(){if(!L&&s>0){var k=setTimeout(function(){D()},s*1e3);return function(){clearTimeout(k)}}},[s,L,p]);var I="".concat(t,"-notice");return x.exports.createElement("div",Ct({},h,{ref:e,className:Ue(I,o,me({},"".concat(I,"-closable"),c)),style:n,onMouseEnter:function(R){var A;y(!0),h==null||(A=h.onMouseEnter)===null||A===void 0||A.call(h,R)},onMouseLeave:function(R){var A;y(!1),h==null||(A=h.onMouseLeave)===null||A===void 0||A.call(h,R)},onClick:f}),x.exports.createElement("div",{className:"".concat(I,"-content")},l),c&&x.exports.createElement("a",{tabIndex:0,className:"".concat(I,"-close"),onKeyDown:E,onClick:function(R){R.preventDefault(),R.stopPropagation(),D()}},d))}),ype=Bt.createContext({}),C9e=function(e){var t=e.children,n=e.classNames;return Bt.createElement(ype.Provider,{value:{classNames:n}},t)},Xte=8,Yte=3,Zte=16,w9e=function(e){var t={offset:Xte,threshold:Yte,gap:Zte};if(e&&Kn(e)==="object"){var n,o,r;t.offset=(n=e.offset)!==null&&n!==void 0?n:Xte,t.threshold=(o=e.threshold)!==null&&o!==void 0?o:Yte,t.gap=(r=e.gap)!==null&&r!==void 0?r:Zte}return[!!e,t]},y9e=["className","style","classNames","styles"],S9e=function(e){var t,n=e.configList,o=e.placement,r=e.prefixCls,s=e.className,a=e.style,l=e.motion,c=e.onAllNoticeRemoved,u=e.onNoticeClose,d=e.stack,h=x.exports.useContext(ype),f=h.classNames,g=x.exports.useRef({}),p=x.exports.useState(null),v=Ne(p,2),m=v[0],_=v[1],w=x.exports.useState([]),y=Ne(w,2),L=y[0],D=y[1],E=n.map(function(F){return{config:F,key:String(F.key)}}),I=w9e(d),k=Ne(I,2),R=k[0],A=k[1],P=A.offset,N=A.threshold,M=A.gap,H=R&&(L.length>0||E.length<=N),W=typeof l=="function"?l(o):l;return x.exports.useEffect(function(){R&&L.length>1&&D(function(F){return F.filter(function($){return E.some(function(z){var K=z.key;return $===K})})})},[L,E,R]),x.exports.useEffect(function(){var F;if(R&&g.current[(F=E[E.length-1])===null||F===void 0?void 0:F.key]){var $;_(g.current[($=E[E.length-1])===null||$===void 0?void 0:$.key])}},[E,R]),fe(dpe,{className:Ue(r,"".concat(r,"-").concat(o),f==null?void 0:f.list,s,(t={},me(t,"".concat(r,"-stack"),!!R),me(t,"".concat(r,"-stack-expanded"),H),t)),style:a,keys:E,motionAppear:!0,...W,onAllRemoved:function(){c(o)},children:function(F,$){var z=F.config,K=F.className,j=F.style,G=F.index,X=z,de=X.key,he=X.times,pe=String(de),be=z,Se=be.className,Fe=be.style,De=be.classNames,ce=be.styles,Pe=Hn(be,y9e),Oe=E.findIndex(function(oe){return oe.key===pe}),xe={};if(R){var Ee=E.length-1-(Oe>-1?Oe:G-1),tt=o==="top"||o==="bottom"?"-50%":"0";if(Ee>0){var nt,Qe,Ge;xe.height=H?(nt=g.current[pe])===null||nt===void 0?void 0:nt.offsetHeight:m==null?void 0:m.offsetHeight;for(var re=0,ie=0;ie-1?g.current[pe]=te:delete g.current[pe]},prefixCls:r,classNames:De,styles:ce,className:Ue(Se,f==null?void 0:f.notice),style:Fe,times:he,key:de,eventKey:de,onNoticeClose:u,hovering:R&&L.length>0})})}},o)},x9e=x.exports.forwardRef(function(i,e){var t=i.prefixCls,n=t===void 0?"rc-notification":t,o=i.container,r=i.motion,s=i.maxCount,a=i.className,l=i.style,c=i.onAllRemoved,u=i.stack,d=i.renderNotifications,h=x.exports.useState([]),f=Ne(h,2),g=f[0],p=f[1],v=function(k){var R,A=g.find(function(P){return P.key===k});A==null||(R=A.onClose)===null||R===void 0||R.call(A),p(function(P){return P.filter(function(N){return N.key!==k})})};x.exports.useImperativeHandle(e,function(){return{open:function(k){p(function(R){var A=_t(R),P=A.findIndex(function(H){return H.key===k.key}),N=Ce({},k);if(P>=0){var M;N.times=(((M=R[P])===null||M===void 0?void 0:M.times)||0)+1,A[P]=N}else N.times=0,A.push(N);return s>0&&A.length>s&&(A=A.slice(-s)),A})},close:function(k){v(k)},destroy:function(){p([])}}});var m=x.exports.useState({}),_=Ne(m,2),w=_[0],y=_[1];x.exports.useEffect(function(){var I={};g.forEach(function(k){var R=k.placement,A=R===void 0?"topRight":R;A&&(I[A]=I[A]||[],I[A].push(k))}),Object.keys(w).forEach(function(k){I[k]=I[k]||[]}),y(I)},[g]);var L=function(k){y(function(R){var A=Ce({},R),P=A[k]||[];return P.length||delete A[k],A})},D=x.exports.useRef(!1);if(x.exports.useEffect(function(){Object.keys(w).length>0?D.current=!0:D.current&&(c==null||c(),D.current=!1)},[w]),!o)return null;var E=Object.keys(w);return uf.exports.createPortal(x.exports.createElement(x.exports.Fragment,null,E.map(function(I){var k=w[I],R=x.exports.createElement(S9e,{key:I,configList:k,placement:I,prefixCls:n,className:a==null?void 0:a(I),style:l==null?void 0:l(I),motion:r,onNoticeClose:v,onAllNoticeRemoved:L,stack:u});return d?d(R,{prefixCls:n,key:I}):R})),o)}),L9e=["getContainer","motion","prefixCls","maxCount","className","style","onAllRemoved","stack","renderNotifications"],E9e=function(){return document.body},Qte=0;function D9e(){for(var i={},e=arguments.length,t=new Array(e),n=0;n0&&arguments[0]!==void 0?arguments[0]:{},e=i.getContainer,t=e===void 0?E9e:e,n=i.motion,o=i.prefixCls,r=i.maxCount,s=i.className,a=i.style,l=i.onAllRemoved,c=i.stack,u=i.renderNotifications,d=Hn(i,L9e),h=x.exports.useState(),f=Ne(h,2),g=f[0],p=f[1],v=x.exports.useRef(),m=x.exports.createElement(x9e,{container:g,ref:v,prefixCls:o,motion:n,maxCount:r,className:s,style:a,onAllRemoved:l,stack:c,renderNotifications:u}),_=x.exports.useState([]),w=Ne(_,2),y=w[0],L=w[1],D=x.exports.useMemo(function(){return{open:function(I){var k=D9e(d,I);(k.key===null||k.key===void 0)&&(k.key="rc-notification-".concat(Qte),Qte+=1),L(function(R){return[].concat(_t(R),[{type:"open",config:k}])})},close:function(I){L(function(k){return[].concat(_t(k),[{type:"close",key:I}])})},destroy:function(){L(function(I){return[].concat(_t(I),[{type:"destroy"}])})}}},[]);return x.exports.useEffect(function(){p(t())}),x.exports.useEffect(function(){v.current&&y.length&&(y.forEach(function(E){switch(E.type){case"open":v.current.open(E.config);break;case"close":v.current.close(E.key);break;case"destroy":v.current.destroy();break}}),L(function(E){return E.filter(function(I){return!y.includes(I)})}))},[y]),[D,m]}var I9e={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z"}}]},name:"loading",theme:"outlined"},T9e=I9e,N9e=function(e,t){return x.exports.createElement(cr,Ct({},e,{ref:t,icon:T9e}))},xI=x.exports.forwardRef(N9e);const R9e=Bt.createContext(void 0);var WK=R9e;const I_=100,M9e=10,VK=I_*M9e,Spe={Modal:I_,Drawer:I_,Popover:I_,Popconfirm:I_,Tooltip:I_,Tour:I_},A9e={SelectLike:50,Dropdown:50,DatePicker:50,Menu:50,ImagePreview:1};function P9e(i){return i in Spe}function HK(i,e){const[,t]=Fa(),n=Bt.useContext(WK),o=P9e(i);if(e!==void 0)return[e,e];let r=n!=null?n:0;return o?(r+=(n?0:t.zIndexPopupBase)+Spe[i],r=Math.min(r,t.zIndexPopupBase+VK)):r+=A9e[i],[n===void 0?e:r,r]}const O9e=i=>{const{componentCls:e,iconCls:t,boxShadow:n,colorText:o,colorSuccess:r,colorError:s,colorWarning:a,colorInfo:l,fontSizeLG:c,motionEaseInOutCirc:u,motionDurationSlow:d,marginXS:h,paddingXS:f,borderRadiusLG:g,zIndexPopup:p,contentPadding:v,contentBg:m}=i,_=`${e}-notice`,w=new ji("MessageMoveIn",{"0%":{padding:0,transform:"translateY(-100%)",opacity:0},"100%":{padding:f,transform:"translateY(0)",opacity:1}}),y=new ji("MessageMoveOut",{"0%":{maxHeight:i.height,padding:f,opacity:1},"100%":{maxHeight:0,padding:0,opacity:0}}),L={padding:f,textAlign:"center",[`${e}-custom-content > ${t}`]:{verticalAlign:"text-bottom",marginInlineEnd:h,fontSize:c},[`${_}-content`]:{display:"inline-block",padding:v,background:m,borderRadius:g,boxShadow:n,pointerEvents:"all"},[`${e}-success > ${t}`]:{color:r},[`${e}-error > ${t}`]:{color:s},[`${e}-warning > ${t}`]:{color:a},[`${e}-info > ${t}, - ${e}-loading > ${t}`]:{color:l}};return[{[e]:Object.assign(Object.assign({},Aa(i)),{color:o,position:"fixed",top:h,width:"100%",pointerEvents:"none",zIndex:p,[`${e}-move-up`]:{animationFillMode:"forwards"},[` + onLoadStart onPause onPlay onPlaying onProgress onRateChange onSeeked onSeeking onStalled onSuspend onTimeUpdate onVolumeChange onWaiting onLoad onError`,C9e="".concat(_9e," ").concat(b9e).split(/[\s\n]+/),y9e="aria-",w9e="data-";function Jte(i,e){return i.indexOf(e)===0}function U0(i){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,t;e===!1?t={aria:!0,data:!0,attr:!0}:e===!0?t={aria:!0}:t=Ce({},e);var n={};return Object.keys(i).forEach(function(o){(t.aria&&(o==="role"||Jte(o,y9e))||t.data&&Jte(o,w9e)||t.attr&&C9e.includes(o))&&(n[o]=i[o])}),n}const{isValidElement:sw}=dI;function Dpe(i){return i&&sw(i)&&i.type===x.exports.Fragment}function S9e(i,e,t){return sw(i)?x.exports.cloneElement(i,typeof t=="function"?t(i.props||{}):t):e}function mv(i,e){return S9e(i,i,e)}const ene=i=>typeof i=="object"&&i!=null&&i.nodeType===1,tne=(i,e)=>(!e||i!=="hidden")&&i!=="visible"&&i!=="clip",i6=(i,e)=>{if(i.clientHeight{const o=(r=>{if(!r.ownerDocument||!r.ownerDocument.defaultView)return null;try{return r.ownerDocument.defaultView.frameElement}catch{return null}})(n);return!!o&&(o.clientHeightre||r>i&&s=e&&a>=t?r-i-n:s>e&&at?s-e+o:0,x9e=i=>{const e=i.parentElement;return e==null?i.getRootNode().host||null:e},nne=(i,e)=>{var t,n,o,r;if(typeof document=="undefined")return[];const{scrollMode:s,block:a,inline:l,boundary:c,skipOverflowHiddenElements:u}=e,d=typeof c=="function"?c:B=>B!==c;if(!ene(i))throw new TypeError("Invalid target");const h=document.scrollingElement||document.documentElement,f=[];let g=i;for(;ene(g)&&d(g);){if(g=x9e(g),g===h){f.push(g);break}g!=null&&g===document.body&&i6(g)&&!i6(document.documentElement)||g!=null&&i6(g,u)&&f.push(g)}const p=(n=(t=window.visualViewport)==null?void 0:t.width)!=null?n:innerWidth,v=(r=(o=window.visualViewport)==null?void 0:o.height)!=null?r:innerHeight,{scrollX:m,scrollY:_}=window,{height:y,width:w,top:L,right:D,bottom:E,left:I}=i.getBoundingClientRect(),{top:k,right:R,bottom:A,left:P}=(B=>{const F=window.getComputedStyle(B);return{top:parseFloat(F.scrollMarginTop)||0,right:parseFloat(F.scrollMarginRight)||0,bottom:parseFloat(F.scrollMarginBottom)||0,left:parseFloat(F.scrollMarginLeft)||0}})(i);let N=a==="start"||a==="nearest"?L-k:a==="end"?E+A:L+y/2-k+A,M=l==="center"?I+w/2-P+R:l==="end"?D+R:I-P;const H=[];for(let B=0;B=0&&I>=0&&E<=v&&D<=p&&L>=K&&E<=G&&I>=X&&D<=j)return H;const de=getComputedStyle(F),fe=parseInt(de.borderLeftWidth,10),pe=parseInt(de.borderTopWidth,10),be=parseInt(de.borderRightWidth,10),Se=parseInt(de.borderBottomWidth,10);let Fe=0,De=0;const ce="offsetWidth"in F?F.offsetWidth-F.clientWidth-fe-be:0,Pe="offsetHeight"in F?F.offsetHeight-F.clientHeight-pe-Se:0,Oe="offsetWidth"in F?F.offsetWidth===0?0:z/F.offsetWidth:0,xe="offsetHeight"in F?F.offsetHeight===0?0:$/F.offsetHeight:0;if(h===F)Fe=a==="start"?N:a==="end"?N-v:a==="nearest"?GN(_,_+v,v,pe,Se,_+N,_+N+y,y):N-v/2,De=l==="start"?M:l==="center"?M-p/2:l==="end"?M-p:GN(m,m+p,p,fe,be,m+M,m+M+w,w),Fe=Math.max(0,Fe+_),De=Math.max(0,De+m);else{Fe=a==="start"?N-K-pe:a==="end"?N-G+Se+Pe:a==="nearest"?GN(K,G,$,pe,Se+Pe,N,N+y,y):N-(K+$/2)+Pe/2,De=l==="start"?M-X-fe:l==="center"?M-(X+z/2)+ce/2:l==="end"?M-j+be+ce:GN(X,j,z,fe,be+ce,M,M+w,w);const{scrollLeft:Ee,scrollTop:tt}=F;Fe=xe===0?0:Math.max(0,Math.min(tt+Fe/xe,F.scrollHeight-$/xe+Pe)),De=Oe===0?0:Math.max(0,Math.min(Ee+De/Oe,F.scrollWidth-z/Oe+ce)),N+=tt-Fe,M+=Ee-De}H.push({el:F,top:Fe,left:De})}return H},L9e=i=>i===!1?{block:"end",inline:"nearest"}:(e=>e===Object(e)&&Object.keys(e).length!==0)(i)?i:{block:"start",inline:"nearest"};function E9e(i,e){if(!i.isConnected||!(o=>{let r=o;for(;r&&r.parentNode;){if(r.parentNode===document)return!0;r=r.parentNode instanceof ShadowRoot?r.parentNode.host:r.parentNode}return!1})(i))return;const t=(o=>{const r=window.getComputedStyle(o);return{top:parseFloat(r.scrollMarginTop)||0,right:parseFloat(r.scrollMarginRight)||0,bottom:parseFloat(r.scrollMarginBottom)||0,left:parseFloat(r.scrollMarginLeft)||0}})(i);if((o=>typeof o=="object"&&typeof o.behavior=="function")(e))return e.behavior(nne(i,e));const n=typeof e=="boolean"||e==null?void 0:e.behavior;for(const{el:o,top:r,left:s}of nne(i,L9e(e))){const a=r-t.top+t.bottom,l=s-t.left+t.right;o.scroll({top:a,left:l,behavior:n})}}const D9e=i=>{const[,,,,e]=Ba();return e?`${i}-css-var`:""};var nh=D9e,at={MAC_ENTER:3,BACKSPACE:8,TAB:9,NUM_CENTER:12,ENTER:13,SHIFT:16,CTRL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:44,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,QUESTION_MARK:63,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,META:91,WIN_KEY_RIGHT:92,CONTEXT_MENU:93,NUM_ZERO:96,NUM_ONE:97,NUM_TWO:98,NUM_THREE:99,NUM_FOUR:100,NUM_FIVE:101,NUM_SIX:102,NUM_SEVEN:103,NUM_EIGHT:104,NUM_NINE:105,NUM_MULTIPLY:106,NUM_PLUS:107,NUM_MINUS:109,NUM_PERIOD:110,NUM_DIVISION:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,NUMLOCK:144,SEMICOLON:186,DASH:189,EQUALS:187,COMMA:188,PERIOD:190,SLASH:191,APOSTROPHE:192,SINGLE_QUOTE:222,OPEN_SQUARE_BRACKET:219,BACKSLASH:220,CLOSE_SQUARE_BRACKET:221,WIN_KEY:224,MAC_FF_META:224,WIN_IME:229,isTextModifyingKeyEvent:function(e){var t=e.keyCode;if(e.altKey&&!e.ctrlKey||e.metaKey||t>=at.F1&&t<=at.F12)return!1;switch(t){case at.ALT:case at.CAPS_LOCK:case at.CONTEXT_MENU:case at.CTRL:case at.DOWN:case at.END:case at.ESC:case at.HOME:case at.INSERT:case at.LEFT:case at.MAC_FF_META:case at.META:case at.NUMLOCK:case at.NUM_CENTER:case at.PAGE_DOWN:case at.PAGE_UP:case at.PAUSE:case at.PRINT_SCREEN:case at.RIGHT:case at.SHIFT:case at.UP:case at.WIN_KEY:case at.WIN_KEY_RIGHT:return!1;default:return!0}},isCharacterKey:function(e){if(e>=at.ZERO&&e<=at.NINE||e>=at.NUM_ZERO&&e<=at.NUM_MULTIPLY||e>=at.A&&e<=at.Z||window.navigator.userAgent.indexOf("WebKit")!==-1&&e===0)return!0;switch(e){case at.SPACE:case at.QUESTION_MARK:case at.NUM_PLUS:case at.NUM_MINUS:case at.NUM_PERIOD:case at.NUM_DIVISION:case at.SEMICOLON:case at.DASH:case at.EQUALS:case at.COMMA:case at.PERIOD:case at.SLASH:case at.APOSTROPHE:case at.SINGLE_QUOTE:case at.OPEN_SQUARE_BRACKET:case at.BACKSLASH:case at.CLOSE_SQUARE_BRACKET:return!0;default:return!1}}},kpe=x.exports.forwardRef(function(i,e){var t=i.prefixCls,n=i.style,o=i.className,r=i.duration,s=r===void 0?4.5:r,a=i.eventKey,l=i.content,c=i.closable,u=i.closeIcon,d=u===void 0?"x":u,h=i.props,f=i.onClick,g=i.onNoticeClose,p=i.times,v=i.hovering,m=x.exports.useState(!1),_=Ne(m,2),y=_[0],w=_[1],L=v||y,D=function(){g(a)},E=function(R){(R.key==="Enter"||R.code==="Enter"||R.keyCode===at.ENTER)&&D()};x.exports.useEffect(function(){if(!L&&s>0){var k=setTimeout(function(){D()},s*1e3);return function(){clearTimeout(k)}}},[s,L,p]);var I="".concat(t,"-notice");return x.exports.createElement("div",yt({},h,{ref:e,className:Ue(I,o,me({},"".concat(I,"-closable"),c)),style:n,onMouseEnter:function(R){var A;w(!0),h==null||(A=h.onMouseEnter)===null||A===void 0||A.call(h,R)},onMouseLeave:function(R){var A;w(!1),h==null||(A=h.onMouseLeave)===null||A===void 0||A.call(h,R)},onClick:f}),x.exports.createElement("div",{className:"".concat(I,"-content")},l),c&&x.exports.createElement("a",{tabIndex:0,className:"".concat(I,"-close"),onKeyDown:E,onClick:function(R){R.preventDefault(),R.stopPropagation(),D()}},d))}),Ipe=Bt.createContext({}),k9e=function(e){var t=e.children,n=e.classNames;return Bt.createElement(Ipe.Provider,{value:{classNames:n}},t)},ine=8,one=3,rne=16,I9e=function(e){var t={offset:ine,threshold:one,gap:rne};if(e&&Kn(e)==="object"){var n,o,r;t.offset=(n=e.offset)!==null&&n!==void 0?n:ine,t.threshold=(o=e.threshold)!==null&&o!==void 0?o:one,t.gap=(r=e.gap)!==null&&r!==void 0?r:rne}return[!!e,t]},T9e=["className","style","classNames","styles"],N9e=function(e){var t,n=e.configList,o=e.placement,r=e.prefixCls,s=e.className,a=e.style,l=e.motion,c=e.onAllNoticeRemoved,u=e.onNoticeClose,d=e.stack,h=x.exports.useContext(Ipe),f=h.classNames,g=x.exports.useRef({}),p=x.exports.useState(null),v=Ne(p,2),m=v[0],_=v[1],y=x.exports.useState([]),w=Ne(y,2),L=w[0],D=w[1],E=n.map(function(F){return{config:F,key:String(F.key)}}),I=I9e(d),k=Ne(I,2),R=k[0],A=k[1],P=A.offset,N=A.threshold,M=A.gap,H=R&&(L.length>0||E.length<=N),B=typeof l=="function"?l(o):l;return x.exports.useEffect(function(){R&&L.length>1&&D(function(F){return F.filter(function($){return E.some(function(z){var K=z.key;return $===K})})})},[L,E,R]),x.exports.useEffect(function(){var F;if(R&&g.current[(F=E[E.length-1])===null||F===void 0?void 0:F.key]){var $;_(g.current[($=E[E.length-1])===null||$===void 0?void 0:$.key])}},[E,R]),he(_pe,{className:Ue(r,"".concat(r,"-").concat(o),f==null?void 0:f.list,s,(t={},me(t,"".concat(r,"-stack"),!!R),me(t,"".concat(r,"-stack-expanded"),H),t)),style:a,keys:E,motionAppear:!0,...B,onAllRemoved:function(){c(o)},children:function(F,$){var z=F.config,K=F.className,j=F.style,G=F.index,X=z,de=X.key,fe=X.times,pe=String(de),be=z,Se=be.className,Fe=be.style,De=be.classNames,ce=be.styles,Pe=Hn(be,T9e),Oe=E.findIndex(function(oe){return oe.key===pe}),xe={};if(R){var Ee=E.length-1-(Oe>-1?Oe:G-1),tt=o==="top"||o==="bottom"?"-50%":"0";if(Ee>0){var nt,Qe,Ge;xe.height=H?(nt=g.current[pe])===null||nt===void 0?void 0:nt.offsetHeight:m==null?void 0:m.offsetHeight;for(var re=0,ie=0;ie-1?g.current[pe]=te:delete g.current[pe]},prefixCls:r,classNames:De,styles:ce,className:Ue(Se,f==null?void 0:f.notice),style:Fe,times:fe,key:de,eventKey:de,onNoticeClose:u,hovering:R&&L.length>0})})}},o)},R9e=x.exports.forwardRef(function(i,e){var t=i.prefixCls,n=t===void 0?"rc-notification":t,o=i.container,r=i.motion,s=i.maxCount,a=i.className,l=i.style,c=i.onAllRemoved,u=i.stack,d=i.renderNotifications,h=x.exports.useState([]),f=Ne(h,2),g=f[0],p=f[1],v=function(k){var R,A=g.find(function(P){return P.key===k});A==null||(R=A.onClose)===null||R===void 0||R.call(A),p(function(P){return P.filter(function(N){return N.key!==k})})};x.exports.useImperativeHandle(e,function(){return{open:function(k){p(function(R){var A=_t(R),P=A.findIndex(function(H){return H.key===k.key}),N=Ce({},k);if(P>=0){var M;N.times=(((M=R[P])===null||M===void 0?void 0:M.times)||0)+1,A[P]=N}else N.times=0,A.push(N);return s>0&&A.length>s&&(A=A.slice(-s)),A})},close:function(k){v(k)},destroy:function(){p([])}}});var m=x.exports.useState({}),_=Ne(m,2),y=_[0],w=_[1];x.exports.useEffect(function(){var I={};g.forEach(function(k){var R=k.placement,A=R===void 0?"topRight":R;A&&(I[A]=I[A]||[],I[A].push(k))}),Object.keys(y).forEach(function(k){I[k]=I[k]||[]}),w(I)},[g]);var L=function(k){w(function(R){var A=Ce({},R),P=A[k]||[];return P.length||delete A[k],A})},D=x.exports.useRef(!1);if(x.exports.useEffect(function(){Object.keys(y).length>0?D.current=!0:D.current&&(c==null||c(),D.current=!1)},[y]),!o)return null;var E=Object.keys(y);return zd.exports.createPortal(x.exports.createElement(x.exports.Fragment,null,E.map(function(I){var k=y[I],R=x.exports.createElement(N9e,{key:I,configList:k,placement:I,prefixCls:n,className:a==null?void 0:a(I),style:l==null?void 0:l(I),motion:r,onNoticeClose:v,onAllNoticeRemoved:L,stack:u});return d?d(R,{prefixCls:n,key:I}):R})),o)}),M9e=["getContainer","motion","prefixCls","maxCount","className","style","onAllRemoved","stack","renderNotifications"],A9e=function(){return document.body},sne=0;function P9e(){for(var i={},e=arguments.length,t=new Array(e),n=0;n0&&arguments[0]!==void 0?arguments[0]:{},e=i.getContainer,t=e===void 0?A9e:e,n=i.motion,o=i.prefixCls,r=i.maxCount,s=i.className,a=i.style,l=i.onAllRemoved,c=i.stack,u=i.renderNotifications,d=Hn(i,M9e),h=x.exports.useState(),f=Ne(h,2),g=f[0],p=f[1],v=x.exports.useRef(),m=x.exports.createElement(R9e,{container:g,ref:v,prefixCls:o,motion:n,maxCount:r,className:s,style:a,onAllRemoved:l,stack:c,renderNotifications:u}),_=x.exports.useState([]),y=Ne(_,2),w=y[0],L=y[1],D=x.exports.useMemo(function(){return{open:function(I){var k=P9e(d,I);(k.key===null||k.key===void 0)&&(k.key="rc-notification-".concat(sne),sne+=1),L(function(R){return[].concat(_t(R),[{type:"open",config:k}])})},close:function(I){L(function(k){return[].concat(_t(k),[{type:"close",key:I}])})},destroy:function(){L(function(I){return[].concat(_t(I),[{type:"destroy"}])})}}},[]);return x.exports.useEffect(function(){p(t())}),x.exports.useEffect(function(){v.current&&w.length&&(w.forEach(function(E){switch(E.type){case"open":v.current.open(E.config);break;case"close":v.current.close(E.key);break;case"destroy":v.current.destroy();break}}),L(function(E){return E.filter(function(I){return!w.includes(I)})}))},[w]),[D,m]}var F9e={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z"}}]},name:"loading",theme:"outlined"},B9e=F9e,W9e=function(e,t){return x.exports.createElement(cr,yt({},e,{ref:t,icon:B9e}))},EI=x.exports.forwardRef(W9e);const V9e=Bt.createContext(void 0);var zK=V9e;const T_=100,H9e=10,UK=T_*H9e,Tpe={Modal:T_,Drawer:T_,Popover:T_,Popconfirm:T_,Tooltip:T_,Tour:T_},$9e={SelectLike:50,Dropdown:50,DatePicker:50,Menu:50,ImagePreview:1};function z9e(i){return i in Tpe}function jK(i,e){const[,t]=Ba(),n=Bt.useContext(zK),o=z9e(i);if(e!==void 0)return[e,e];let r=n!=null?n:0;return o?(r+=(n?0:t.zIndexPopupBase)+Tpe[i],r=Math.min(r,t.zIndexPopupBase+UK)):r+=$9e[i],[n===void 0?e:r,r]}const U9e=i=>{const{componentCls:e,iconCls:t,boxShadow:n,colorText:o,colorSuccess:r,colorError:s,colorWarning:a,colorInfo:l,fontSizeLG:c,motionEaseInOutCirc:u,motionDurationSlow:d,marginXS:h,paddingXS:f,borderRadiusLG:g,zIndexPopup:p,contentPadding:v,contentBg:m}=i,_=`${e}-notice`,y=new ji("MessageMoveIn",{"0%":{padding:0,transform:"translateY(-100%)",opacity:0},"100%":{padding:f,transform:"translateY(0)",opacity:1}}),w=new ji("MessageMoveOut",{"0%":{maxHeight:i.height,padding:f,opacity:1},"100%":{maxHeight:0,padding:0,opacity:0}}),L={padding:f,textAlign:"center",[`${e}-custom-content > ${t}`]:{verticalAlign:"text-bottom",marginInlineEnd:h,fontSize:c},[`${_}-content`]:{display:"inline-block",padding:v,background:m,borderRadius:g,boxShadow:n,pointerEvents:"all"},[`${e}-success > ${t}`]:{color:r},[`${e}-error > ${t}`]:{color:s},[`${e}-warning > ${t}`]:{color:a},[`${e}-info > ${t}, + ${e}-loading > ${t}`]:{color:l}};return[{[e]:Object.assign(Object.assign({},Pa(i)),{color:o,position:"fixed",top:h,width:"100%",pointerEvents:"none",zIndex:p,[`${e}-move-up`]:{animationFillMode:"forwards"},[` ${e}-move-up-appear, ${e}-move-up-enter - `]:{animationName:w,animationDuration:d,animationPlayState:"paused",animationTimingFunction:u},[` + `]:{animationName:y,animationDuration:d,animationPlayState:"paused",animationTimingFunction:u},[` ${e}-move-up-appear${e}-move-up-appear-active, ${e}-move-up-enter${e}-move-up-enter-active - `]:{animationPlayState:"running"},[`${e}-move-up-leave`]:{animationName:y,animationDuration:d,animationPlayState:"paused",animationTimingFunction:u},[`${e}-move-up-leave${e}-move-up-leave-active`]:{animationPlayState:"running"},"&-rtl":{direction:"rtl",span:{direction:"rtl"}}})},{[e]:{[`${_}-wrapper`]:Object.assign({},L)}},{[`${e}-notice-pure-panel`]:Object.assign(Object.assign({},L),{padding:0,textAlign:"start"})}]},F9e=i=>({zIndexPopup:i.zIndexPopupBase+VK+10,contentBg:i.colorBgElevated,contentPadding:`${(i.controlHeightLG-i.fontSize*i.lineHeight)/2}px ${i.paddingSM}px`});var xpe=Uc("Message",i=>{const e=lr(i,{height:150});return[O9e(e)]},F9e),B9e=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(i);o{let{prefixCls:e,type:t,icon:n,children:o}=i;return x.exports.createElement("div",{className:Ue(`${e}-custom-content`,`${e}-${t}`)},n||W9e[t],x.exports.createElement("span",null,o))},V9e=i=>{const{prefixCls:e,className:t,type:n,icon:o,content:r}=i,s=B9e(i,["prefixCls","className","type","icon","content"]),{getPrefixCls:a}=x.exports.useContext(Hi),l=e||a("message"),c=th(l),[u,d,h]=xpe(l,c);return u(x.exports.createElement(wpe,Object.assign({},s,{prefixCls:l,className:Ue(t,d,`${l}-notice-pure-panel`,h,c),eventKey:"pure",duration:null,content:x.exports.createElement(Lpe,{prefixCls:l,type:n,icon:o},r)})))};var H9e=V9e;function $9e(i,e){return{motionName:e!=null?e:`${i}-move-up`}}function $K(i){let e;const t=new Promise(o=>{e=i(()=>{o(!0)})}),n=()=>{e==null||e()};return n.then=(o,r)=>t.then(o,r),n.promise=t,n}var z9e=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(i);o{let{children:e,prefixCls:t}=i;const n=th(t),[o,r,s]=xpe(t,n);return o(x.exports.createElement(C9e,{classNames:{list:Ue(r,s,n)}},e))},q9e=(i,e)=>{let{prefixCls:t,key:n}=e;return x.exports.createElement(K9e,{prefixCls:t,key:n},i)},G9e=x.exports.forwardRef((i,e)=>{const{top:t,prefixCls:n,getContainer:o,maxCount:r,duration:s=j9e,rtl:a,transitionName:l,onAllRemoved:c}=i,{getPrefixCls:u,getPopupContainer:d,message:h,direction:f}=x.exports.useContext(Hi),g=n||u("message"),p=()=>({left:"50%",transform:"translateX(-50%)",top:t!=null?t:U9e}),v=()=>Ue({[`${g}-rtl`]:a!=null?a:f==="rtl"}),m=()=>$9e(g,l),_=x.exports.createElement("span",{className:`${g}-close-x`},x.exports.createElement(cS,{className:`${g}-close-icon`})),[w,y]=k9e({prefixCls:g,style:p,className:v,motion:m,closable:!1,closeIcon:_,duration:s,getContainer:()=>(o==null?void 0:o())||(d==null?void 0:d())||document.body,maxCount:r,onAllRemoved:c,renderNotifications:q9e});return x.exports.useImperativeHandle(e,()=>Object.assign(Object.assign({},w),{prefixCls:g,message:h})),y});let Jte=0;function Epe(i){const e=x.exports.useRef(null);return y4(),[x.exports.useMemo(()=>{const n=l=>{var c;(c=e.current)===null||c===void 0||c.close(l)},o=l=>{if(!e.current){const D=()=>{};return D.then=()=>{},D}const{open:c,prefixCls:u,message:d}=e.current,h=`${u}-notice`,{content:f,icon:g,type:p,key:v,className:m,style:_,onClose:w}=l,y=z9e(l,["content","icon","type","key","className","style","onClose"]);let L=v;return L==null&&(Jte+=1,L=`antd-message-${Jte}`),$K(D=>(c(Object.assign(Object.assign({},y),{key:L,content:x.exports.createElement(Lpe,{prefixCls:u,type:p,icon:g},f),placement:"top",className:Ue(p&&`${h}-${p}`,m,d==null?void 0:d.className),style:Object.assign(Object.assign({},d==null?void 0:d.style),_),onClose:()=>{w==null||w(),D()}})),()=>{n(L)}))},s={open:o,destroy:l=>{var c;l!==void 0?n(l):(c=e.current)===null||c===void 0||c.destroy()}};return["info","success","warning","error","loading"].forEach(l=>{const c=(u,d,h)=>{let f;u&&typeof u=="object"&&"content"in u?f=u:f={content:u};let g,p;typeof d=="function"?p=d:(g=d,p=h);const v=Object.assign(Object.assign({onClose:p,duration:g},f),{type:l});return o(v)};s[l]=c}),s},[]),x.exports.createElement(G9e,Object.assign({key:"message-holder"},i,{ref:e}))]}function X9e(i){return Epe(i)}function Y9e(){const[i,e]=x.exports.useState([]),t=x.exports.useCallback(n=>(e(o=>[].concat(_t(o),[n])),()=>{e(o=>o.filter(r=>r!==n))}),[]);return[i,t]}function ul(){ul=function(){return e};var i,e={},t=Object.prototype,n=t.hasOwnProperty,o=Object.defineProperty||function(W,F,$){W[F]=$.value},r=typeof Symbol=="function"?Symbol:{},s=r.iterator||"@@iterator",a=r.asyncIterator||"@@asyncIterator",l=r.toStringTag||"@@toStringTag";function c(W,F,$){return Object.defineProperty(W,F,{value:$,enumerable:!0,configurable:!0,writable:!0}),W[F]}try{c({},"")}catch{c=function($,z,K){return $[z]=K}}function u(W,F,$,z){var K=F&&F.prototype instanceof m?F:m,j=Object.create(K.prototype),G=new M(z||[]);return o(j,"_invoke",{value:R(W,$,G)}),j}function d(W,F,$){try{return{type:"normal",arg:W.call(F,$)}}catch(z){return{type:"throw",arg:z}}}e.wrap=u;var h="suspendedStart",f="suspendedYield",g="executing",p="completed",v={};function m(){}function _(){}function w(){}var y={};c(y,s,function(){return this});var L=Object.getPrototypeOf,D=L&&L(L(H([])));D&&D!==t&&n.call(D,s)&&(y=D);var E=w.prototype=m.prototype=Object.create(y);function I(W){["next","throw","return"].forEach(function(F){c(W,F,function($){return this._invoke(F,$)})})}function k(W,F){function $(K,j,G,X){var de=d(W[K],W,j);if(de.type!=="throw"){var he=de.arg,pe=he.value;return pe&&Kn(pe)=="object"&&n.call(pe,"__await")?F.resolve(pe.__await).then(function(be){$("next",be,G,X)},function(be){$("throw",be,G,X)}):F.resolve(pe).then(function(be){he.value=be,G(he)},function(be){return $("throw",be,G,X)})}X(de.arg)}var z;o(this,"_invoke",{value:function(j,G){function X(){return new F(function(de,he){$(j,G,de,he)})}return z=z?z.then(X,X):X()}})}function R(W,F,$){var z=h;return function(K,j){if(z===g)throw new Error("Generator is already running");if(z===p){if(K==="throw")throw j;return{value:i,done:!0}}for($.method=K,$.arg=j;;){var G=$.delegate;if(G){var X=A(G,$);if(X){if(X===v)continue;return X}}if($.method==="next")$.sent=$._sent=$.arg;else if($.method==="throw"){if(z===h)throw z=p,$.arg;$.dispatchException($.arg)}else $.method==="return"&&$.abrupt("return",$.arg);z=g;var de=d(W,F,$);if(de.type==="normal"){if(z=$.done?p:f,de.arg===v)continue;return{value:de.arg,done:$.done}}de.type==="throw"&&(z=p,$.method="throw",$.arg=de.arg)}}}function A(W,F){var $=F.method,z=W.iterator[$];if(z===i)return F.delegate=null,$==="throw"&&W.iterator.return&&(F.method="return",F.arg=i,A(W,F),F.method==="throw")||$!=="return"&&(F.method="throw",F.arg=new TypeError("The iterator does not provide a '"+$+"' method")),v;var K=d(z,W.iterator,F.arg);if(K.type==="throw")return F.method="throw",F.arg=K.arg,F.delegate=null,v;var j=K.arg;return j?j.done?(F[W.resultName]=j.value,F.next=W.nextLoc,F.method!=="return"&&(F.method="next",F.arg=i),F.delegate=null,v):j:(F.method="throw",F.arg=new TypeError("iterator result is not an object"),F.delegate=null,v)}function P(W){var F={tryLoc:W[0]};1 in W&&(F.catchLoc=W[1]),2 in W&&(F.finallyLoc=W[2],F.afterLoc=W[3]),this.tryEntries.push(F)}function N(W){var F=W.completion||{};F.type="normal",delete F.arg,W.completion=F}function M(W){this.tryEntries=[{tryLoc:"root"}],W.forEach(P,this),this.reset(!0)}function H(W){if(W||W===""){var F=W[s];if(F)return F.call(W);if(typeof W.next=="function")return W;if(!isNaN(W.length)){var $=-1,z=function K(){for(;++$=0;--K){var j=this.tryEntries[K],G=j.completion;if(j.tryLoc==="root")return z("end");if(j.tryLoc<=this.prev){var X=n.call(j,"catchLoc"),de=n.call(j,"finallyLoc");if(X&&de){if(this.prev=0;--z){var K=this.tryEntries[z];if(K.tryLoc<=this.prev&&n.call(K,"finallyLoc")&&this.prev=0;--$){var z=this.tryEntries[$];if(z.finallyLoc===F)return this.complete(z.completion,z.afterLoc),N(z),v}},catch:function(F){for(var $=this.tryEntries.length-1;$>=0;--$){var z=this.tryEntries[$];if(z.tryLoc===F){var K=z.completion;if(K.type==="throw"){var j=K.arg;N(z)}return j}}throw new Error("illegal catch attempt")},delegateYield:function(F,$,z){return this.delegate={iterator:H(F),resultName:$,nextLoc:z},this.method==="next"&&(this.arg=i),v}},e}function ene(i,e,t,n,o,r,s){try{var a=i[r](s),l=a.value}catch(c){t(c);return}a.done?e(l):Promise.resolve(l).then(n,o)}function Ab(i){return function(){var e=this,t=arguments;return new Promise(function(n,o){var r=i.apply(e,t);function s(l){ene(r,n,o,s,a,"next",l)}function a(l){ene(r,n,o,s,a,"throw",l)}s(void 0)})}}var LI=Ce({},_Re),Z9e=LI.version,Q9e=LI.render,J9e=LI.unmountComponentAtNode,E4;try{var e7e=Number((Z9e||"").split(".")[0]);e7e>=18&&(E4=LI.createRoot)}catch{}function tne(i){var e=LI.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;e&&Kn(e)==="object"&&(e.usingClientEntryPoint=i)}var CA="__rc_react_root__";function t7e(i,e){tne(!0);var t=e[CA]||E4(e);tne(!1),t.render(i),e[CA]=t}function n7e(i,e){Q9e(i,e)}function zK(i,e){if(E4){t7e(i,e);return}n7e(i,e)}function i7e(i){return dW.apply(this,arguments)}function dW(){return dW=Ab(ul().mark(function i(e){return ul().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",Promise.resolve().then(function(){var o;(o=e[CA])===null||o===void 0||o.unmount(),delete e[CA]}));case 1:case"end":return n.stop()}},i)})),dW.apply(this,arguments)}function o7e(i){J9e(i)}function Dpe(i){return hW.apply(this,arguments)}function hW(){return hW=Ab(ul().mark(function i(e){return ul().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(E4===void 0){n.next=2;break}return n.abrupt("return",i7e(e));case 2:o7e(e);case 3:case"end":return n.stop()}},i)})),hW.apply(this,arguments)}const o6=()=>({height:0,opacity:0}),nne=i=>{const{scrollHeight:e}=i;return{height:e,opacity:1}},r7e=i=>({height:i?i.offsetHeight:0}),r6=(i,e)=>(e==null?void 0:e.deadline)===!0||e.propertyName==="height",s7e=function(){return{motionName:`${arguments.length>0&&arguments[0]!==void 0?arguments[0]:"ant"}-motion-collapse`,onAppearStart:o6,onEnterStart:o6,onAppearActive:nne,onEnterActive:nne,onLeaveStart:r7e,onLeaveActive:o6,onAppearEnd:r6,onEnterEnd:r6,onLeaveEnd:r6,motionDeadline:500}},U0=(i,e,t)=>t!==void 0?t:`${i}-${e}`;var fW=s7e,D4=function(i){if(!i)return!1;if(i instanceof Element){if(i.offsetParent)return!0;if(i.getBBox){var e=i.getBBox(),t=e.width,n=e.height;if(t||n)return!0}if(i.getBoundingClientRect){var o=i.getBoundingClientRect(),r=o.width,s=o.height;if(r||s)return!0}}return!1};const a7e=i=>{const{componentCls:e,colorPrimary:t}=i;return{[e]:{position:"absolute",background:"transparent",pointerEvents:"none",boxSizing:"border-box",color:`var(--wave-color, ${t})`,boxShadow:"0 0 0 0 currentcolor",opacity:.2,"&.wave-motion-appear":{transition:[`box-shadow 0.4s ${i.motionEaseOutCirc}`,`opacity 2s ${i.motionEaseOutCirc}`].join(","),"&-active":{boxShadow:"0 0 0 6px currentcolor",opacity:0},"&.wave-quick":{transition:[`box-shadow 0.3s ${i.motionEaseInOut}`,`opacity 0.35s ${i.motionEaseInOut}`].join(",")}}}}};var l7e=RK("Wave",i=>[a7e(i)]);function c7e(i){const e=(i||"").match(/rgba?\((\d*), (\d*), (\d*)(, [\d.]*)?\)/);return e&&e[1]&&e[2]&&e[3]?!(e[1]===e[2]&&e[2]===e[3]):!0}function s6(i){return i&&i!=="#fff"&&i!=="#ffffff"&&i!=="rgb(255, 255, 255)"&&i!=="rgba(255, 255, 255, 1)"&&c7e(i)&&!/rgba\((?:\d*, ){3}0\)/.test(i)&&i!=="transparent"}function u7e(i){const{borderTopColor:e,borderColor:t,backgroundColor:n}=getComputedStyle(i);return s6(e)?e:s6(t)?t:s6(n)?n:null}const kpe="ant-wave-target";function a6(i){return Number.isNaN(i)?0:i}const d7e=i=>{const{className:e,target:t,component:n}=i,o=x.exports.useRef(null),[r,s]=x.exports.useState(null),[a,l]=x.exports.useState([]),[c,u]=x.exports.useState(0),[d,h]=x.exports.useState(0),[f,g]=x.exports.useState(0),[p,v]=x.exports.useState(0),[m,_]=x.exports.useState(!1),w={left:c,top:d,width:f,height:p,borderRadius:a.map(D=>`${D}px`).join(" ")};r&&(w["--wave-color"]=r);function y(){const D=getComputedStyle(t);s(u7e(t));const E=D.position==="static",{borderLeftWidth:I,borderTopWidth:k}=D;u(E?t.offsetLeft:a6(-parseFloat(I))),h(E?t.offsetTop:a6(-parseFloat(k))),g(t.offsetWidth),v(t.offsetHeight);const{borderTopLeftRadius:R,borderTopRightRadius:A,borderBottomLeftRadius:P,borderBottomRightRadius:N}=D;l([R,A,N,P].map(M=>a6(parseFloat(M))))}if(x.exports.useEffect(()=>{if(t){const D=Xi(()=>{y(),_(!0)});let E;return typeof ResizeObserver!="undefined"&&(E=new ResizeObserver(y),E.observe(t)),()=>{Xi.cancel(D),E==null||E.disconnect()}}},[]),!m)return null;const L=(n==="Checkbox"||n==="Radio")&&(t==null?void 0:t.classList.contains(kpe));return x.exports.createElement(eh,{visible:!0,motionAppear:!0,motionName:"wave-motion",motionDeadline:5e3,onAppearEnd:(D,E)=>{var I;if(E.deadline||E.propertyName==="opacity"){const k=(I=o.current)===null||I===void 0?void 0:I.parentElement;Dpe(k).then(()=>{k==null||k.remove()})}return!1}},D=>{let{className:E}=D;return x.exports.createElement("div",{ref:o,className:Ue(e,{"wave-quick":L},E),style:w})})},h7e=(i,e)=>{var t;const{component:n}=e;if(n==="Checkbox"&&!(!((t=i.querySelector("input"))===null||t===void 0)&&t.checked))return;const o=document.createElement("div");o.style.position="absolute",o.style.left="0px",o.style.top="0px",i==null||i.insertBefore(o,i==null?void 0:i.firstChild),zK(x.exports.createElement(d7e,Object.assign({},e,{target:i})),o)};var f7e=h7e;function g7e(i,e,t){const{wave:n}=x.exports.useContext(Hi),[,o,r]=Fa(),s=el(c=>{const u=i.current;if((n==null?void 0:n.disabled)||!u)return;const d=u.querySelector(`.${kpe}`)||u,{showEffect:h}=n||{};(h||f7e)(d,{className:e,token:o,component:t,event:c,hashId:r})}),a=x.exports.useRef();return c=>{Xi.cancel(a.current),a.current=Xi(()=>{s(c)})}}const p7e=i=>{const{children:e,disabled:t,component:n}=i,{getPrefixCls:o}=x.exports.useContext(Hi),r=x.exports.useRef(null),s=o("wave"),[,a]=l7e(s),l=g7e(r,Ue(s,a),n);if(Bt.useEffect(()=>{const u=r.current;if(!u||u.nodeType!==1||t)return;const d=h=>{!D4(h.target)||!u.getAttribute||u.getAttribute("disabled")||u.disabled||u.className.includes("disabled")||u.className.includes("-leave")||l(h)};return u.addEventListener("click",d,!0),()=>{u.removeEventListener("click",d,!0)}},[t]),!Bt.isValidElement(e))return e!=null?e:null;const c=jv(e)?Jd(e.ref,r):r;return pv(e,{ref:c})};var m7e=p7e;const v7e=i=>{const e=Bt.useContext(SI);return Bt.useMemo(()=>i?typeof i=="string"?i!=null?i:e:i instanceof Function?i(e):e:e,[i,e])};var Pb=v7e;globalThis&&globalThis.__rest;const Ipe=x.exports.createContext(null),k4=(i,e)=>{const t=x.exports.useContext(Ipe),n=x.exports.useMemo(()=>{if(!t)return"";const{compactDirection:o,isFirstItem:r,isLastItem:s}=t,a=o==="vertical"?"-vertical-":"-";return Ue(`${i}-compact${a}item`,{[`${i}-compact${a}first-item`]:r,[`${i}-compact${a}last-item`]:s,[`${i}-compact${a}item-rtl`]:e==="rtl"})},[i,e,t]);return{compactSize:t==null?void 0:t.compactSize,compactDirection:t==null?void 0:t.compactDirection,compactItemClassnames:n}},wA=i=>{let{children:e}=i;return x.exports.createElement(Ipe.Provider,{value:null},e)};var _7e=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(i);o{const{getPrefixCls:e,direction:t}=x.exports.useContext(Hi),{prefixCls:n,size:o,className:r}=i,s=_7e(i,["prefixCls","size","className"]),a=e("btn-group",n),[,,l]=Fa();let c="";switch(o){case"large":c="lg";break;case"small":c="sm";break}const u=Ue(a,{[`${a}-${c}`]:c,[`${a}-rtl`]:t==="rtl"},r,l);return x.exports.createElement(Tpe.Provider,{value:o},x.exports.createElement("div",Object.assign({},s,{className:u})))};var C7e=b7e;const ine=/^[\u4e00-\u9fa5]{2}$/,gW=ine.test.bind(ine);function Npe(i){return i==="danger"?{danger:!0}:{type:i}}function one(i){return typeof i=="string"}function l6(i){return i==="text"||i==="link"}function w7e(i,e){if(i==null)return;const t=e?" ":"";return typeof i!="string"&&typeof i!="number"&&one(i.type)&&gW(i.props.children)?pv(i,{children:i.props.children.split("").join(t)}):one(i)?gW(i)?Bt.createElement("span",null,i.split("").join(t)):Bt.createElement("span",null,i):Cpe(i)?Bt.createElement("span",null,i):i}function y7e(i,e){let t=!1;const n=[];return Bt.Children.forEach(i,o=>{const r=typeof o,s=r==="string"||r==="number";if(t&&s){const a=n.length-1,l=n[a];n[a]=`${l}${o}`}else n.push(o);t=s}),Bt.Children.map(n,o=>w7e(o,e))}const S7e=x.exports.forwardRef((i,e)=>{const{className:t,style:n,children:o,prefixCls:r}=i,s=Ue(`${r}-icon`,t);return fe("span",{ref:e,className:s,style:n,children:o})});var Rpe=S7e;const rne=x.exports.forwardRef((i,e)=>{let{prefixCls:t,className:n,style:o,iconClassName:r}=i;const s=Ue(`${t}-loading-icon`,n);return fe(Rpe,{prefixCls:t,className:s,style:o,ref:e,children:fe(xI,{className:r})})}),c6=()=>({width:0,opacity:0,transform:"scale(0)"}),u6=i=>({width:i.scrollWidth,opacity:1,transform:"scale(1)"}),x7e=i=>{const{prefixCls:e,loading:t,existIcon:n,className:o,style:r}=i,s=!!t;return n?fe(rne,{prefixCls:e,className:o,style:r}):fe(eh,{visible:s,motionName:`${e}-loading-icon-motion`,motionLeave:s,removeOnLeave:!0,onAppearStart:c6,onAppearActive:u6,onEnterStart:c6,onEnterActive:u6,onLeaveStart:u6,onLeaveActive:c6,children:(a,l)=>{let{className:c,style:u}=a;return fe(rne,{prefixCls:e,className:o,style:Object.assign(Object.assign({},r),u),ref:l,iconClassName:c})}})};var L7e=x7e;const sne=(i,e)=>({[`> span, > ${i}`]:{"&:not(:last-child)":{[`&, & > ${i}`]:{"&:not(:disabled)":{borderInlineEndColor:e}}},"&:not(:first-child)":{[`&, & > ${i}`]:{"&:not(:disabled)":{borderInlineStartColor:e}}}}}),E7e=i=>{const{componentCls:e,fontSize:t,lineWidth:n,groupBorderColor:o,colorErrorHover:r}=i;return{[`${e}-group`]:[{position:"relative",display:"inline-flex",[`> span, > ${e}`]:{"&:not(:last-child)":{[`&, & > ${e}`]:{borderStartEndRadius:0,borderEndEndRadius:0}},"&:not(:first-child)":{marginInlineStart:i.calc(n).mul(-1).equal(),[`&, & > ${e}`]:{borderStartStartRadius:0,borderEndStartRadius:0}}},[e]:{position:"relative",zIndex:1,[`&:hover, + `]:{animationPlayState:"running"},[`${e}-move-up-leave`]:{animationName:w,animationDuration:d,animationPlayState:"paused",animationTimingFunction:u},[`${e}-move-up-leave${e}-move-up-leave-active`]:{animationPlayState:"running"},"&-rtl":{direction:"rtl",span:{direction:"rtl"}}})},{[e]:{[`${_}-wrapper`]:Object.assign({},L)}},{[`${e}-notice-pure-panel`]:Object.assign(Object.assign({},L),{padding:0,textAlign:"start"})}]},j9e=i=>({zIndexPopup:i.zIndexPopupBase+UK+10,contentBg:i.colorBgElevated,contentPadding:`${(i.controlHeightLG-i.fontSize*i.lineHeight)/2}px ${i.paddingSM}px`});var Npe=jc("Message",i=>{const e=lr(i,{height:150});return[U9e(e)]},j9e),K9e=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(i);o{let{prefixCls:e,type:t,icon:n,children:o}=i;return x.exports.createElement("div",{className:Ue(`${e}-custom-content`,`${e}-${t}`)},n||q9e[t],x.exports.createElement("span",null,o))},G9e=i=>{const{prefixCls:e,className:t,type:n,icon:o,content:r}=i,s=K9e(i,["prefixCls","className","type","icon","content"]),{getPrefixCls:a}=x.exports.useContext(Hi),l=e||a("message"),c=nh(l),[u,d,h]=Npe(l,c);return u(x.exports.createElement(kpe,Object.assign({},s,{prefixCls:l,className:Ue(t,d,`${l}-notice-pure-panel`,h,c),eventKey:"pure",duration:null,content:x.exports.createElement(Rpe,{prefixCls:l,type:n,icon:o},r)})))};var X9e=G9e;function Y9e(i,e){return{motionName:e!=null?e:`${i}-move-up`}}function KK(i){let e;const t=new Promise(o=>{e=i(()=>{o(!0)})}),n=()=>{e==null||e()};return n.then=(o,r)=>t.then(o,r),n.promise=t,n}var Z9e=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(i);o{let{children:e,prefixCls:t}=i;const n=nh(t),[o,r,s]=Npe(t,n);return o(x.exports.createElement(k9e,{classNames:{list:Ue(r,s,n)}},e))},t7e=(i,e)=>{let{prefixCls:t,key:n}=e;return x.exports.createElement(e7e,{prefixCls:t,key:n},i)},n7e=x.exports.forwardRef((i,e)=>{const{top:t,prefixCls:n,getContainer:o,maxCount:r,duration:s=J9e,rtl:a,transitionName:l,onAllRemoved:c}=i,{getPrefixCls:u,getPopupContainer:d,message:h,direction:f}=x.exports.useContext(Hi),g=n||u("message"),p=()=>({left:"50%",transform:"translateX(-50%)",top:t!=null?t:Q9e}),v=()=>Ue({[`${g}-rtl`]:a!=null?a:f==="rtl"}),m=()=>Y9e(g,l),_=x.exports.createElement("span",{className:`${g}-close-x`},x.exports.createElement(uS,{className:`${g}-close-icon`})),[y,w]=O9e({prefixCls:g,style:p,className:v,motion:m,closable:!1,closeIcon:_,duration:s,getContainer:()=>(o==null?void 0:o())||(d==null?void 0:d())||document.body,maxCount:r,onAllRemoved:c,renderNotifications:t7e});return x.exports.useImperativeHandle(e,()=>Object.assign(Object.assign({},y),{prefixCls:g,message:h})),w});let ane=0;function Mpe(i){const e=x.exports.useRef(null);return S4(),[x.exports.useMemo(()=>{const n=l=>{var c;(c=e.current)===null||c===void 0||c.close(l)},o=l=>{if(!e.current){const D=()=>{};return D.then=()=>{},D}const{open:c,prefixCls:u,message:d}=e.current,h=`${u}-notice`,{content:f,icon:g,type:p,key:v,className:m,style:_,onClose:y}=l,w=Z9e(l,["content","icon","type","key","className","style","onClose"]);let L=v;return L==null&&(ane+=1,L=`antd-message-${ane}`),KK(D=>(c(Object.assign(Object.assign({},w),{key:L,content:x.exports.createElement(Rpe,{prefixCls:u,type:p,icon:g},f),placement:"top",className:Ue(p&&`${h}-${p}`,m,d==null?void 0:d.className),style:Object.assign(Object.assign({},d==null?void 0:d.style),_),onClose:()=>{y==null||y(),D()}})),()=>{n(L)}))},s={open:o,destroy:l=>{var c;l!==void 0?n(l):(c=e.current)===null||c===void 0||c.destroy()}};return["info","success","warning","error","loading"].forEach(l=>{const c=(u,d,h)=>{let f;u&&typeof u=="object"&&"content"in u?f=u:f={content:u};let g,p;typeof d=="function"?p=d:(g=d,p=h);const v=Object.assign(Object.assign({onClose:p,duration:g},f),{type:l});return o(v)};s[l]=c}),s},[]),x.exports.createElement(n7e,Object.assign({key:"message-holder"},i,{ref:e}))]}function i7e(i){return Mpe(i)}function o7e(){const[i,e]=x.exports.useState([]),t=x.exports.useCallback(n=>(e(o=>[].concat(_t(o),[n])),()=>{e(o=>o.filter(r=>r!==n))}),[]);return[i,t]}function dl(){dl=function(){return e};var i,e={},t=Object.prototype,n=t.hasOwnProperty,o=Object.defineProperty||function(B,F,$){B[F]=$.value},r=typeof Symbol=="function"?Symbol:{},s=r.iterator||"@@iterator",a=r.asyncIterator||"@@asyncIterator",l=r.toStringTag||"@@toStringTag";function c(B,F,$){return Object.defineProperty(B,F,{value:$,enumerable:!0,configurable:!0,writable:!0}),B[F]}try{c({},"")}catch{c=function($,z,K){return $[z]=K}}function u(B,F,$,z){var K=F&&F.prototype instanceof m?F:m,j=Object.create(K.prototype),G=new M(z||[]);return o(j,"_invoke",{value:R(B,$,G)}),j}function d(B,F,$){try{return{type:"normal",arg:B.call(F,$)}}catch(z){return{type:"throw",arg:z}}}e.wrap=u;var h="suspendedStart",f="suspendedYield",g="executing",p="completed",v={};function m(){}function _(){}function y(){}var w={};c(w,s,function(){return this});var L=Object.getPrototypeOf,D=L&&L(L(H([])));D&&D!==t&&n.call(D,s)&&(w=D);var E=y.prototype=m.prototype=Object.create(w);function I(B){["next","throw","return"].forEach(function(F){c(B,F,function($){return this._invoke(F,$)})})}function k(B,F){function $(K,j,G,X){var de=d(B[K],B,j);if(de.type!=="throw"){var fe=de.arg,pe=fe.value;return pe&&Kn(pe)=="object"&&n.call(pe,"__await")?F.resolve(pe.__await).then(function(be){$("next",be,G,X)},function(be){$("throw",be,G,X)}):F.resolve(pe).then(function(be){fe.value=be,G(fe)},function(be){return $("throw",be,G,X)})}X(de.arg)}var z;o(this,"_invoke",{value:function(j,G){function X(){return new F(function(de,fe){$(j,G,de,fe)})}return z=z?z.then(X,X):X()}})}function R(B,F,$){var z=h;return function(K,j){if(z===g)throw new Error("Generator is already running");if(z===p){if(K==="throw")throw j;return{value:i,done:!0}}for($.method=K,$.arg=j;;){var G=$.delegate;if(G){var X=A(G,$);if(X){if(X===v)continue;return X}}if($.method==="next")$.sent=$._sent=$.arg;else if($.method==="throw"){if(z===h)throw z=p,$.arg;$.dispatchException($.arg)}else $.method==="return"&&$.abrupt("return",$.arg);z=g;var de=d(B,F,$);if(de.type==="normal"){if(z=$.done?p:f,de.arg===v)continue;return{value:de.arg,done:$.done}}de.type==="throw"&&(z=p,$.method="throw",$.arg=de.arg)}}}function A(B,F){var $=F.method,z=B.iterator[$];if(z===i)return F.delegate=null,$==="throw"&&B.iterator.return&&(F.method="return",F.arg=i,A(B,F),F.method==="throw")||$!=="return"&&(F.method="throw",F.arg=new TypeError("The iterator does not provide a '"+$+"' method")),v;var K=d(z,B.iterator,F.arg);if(K.type==="throw")return F.method="throw",F.arg=K.arg,F.delegate=null,v;var j=K.arg;return j?j.done?(F[B.resultName]=j.value,F.next=B.nextLoc,F.method!=="return"&&(F.method="next",F.arg=i),F.delegate=null,v):j:(F.method="throw",F.arg=new TypeError("iterator result is not an object"),F.delegate=null,v)}function P(B){var F={tryLoc:B[0]};1 in B&&(F.catchLoc=B[1]),2 in B&&(F.finallyLoc=B[2],F.afterLoc=B[3]),this.tryEntries.push(F)}function N(B){var F=B.completion||{};F.type="normal",delete F.arg,B.completion=F}function M(B){this.tryEntries=[{tryLoc:"root"}],B.forEach(P,this),this.reset(!0)}function H(B){if(B||B===""){var F=B[s];if(F)return F.call(B);if(typeof B.next=="function")return B;if(!isNaN(B.length)){var $=-1,z=function K(){for(;++$=0;--K){var j=this.tryEntries[K],G=j.completion;if(j.tryLoc==="root")return z("end");if(j.tryLoc<=this.prev){var X=n.call(j,"catchLoc"),de=n.call(j,"finallyLoc");if(X&&de){if(this.prev=0;--z){var K=this.tryEntries[z];if(K.tryLoc<=this.prev&&n.call(K,"finallyLoc")&&this.prev=0;--$){var z=this.tryEntries[$];if(z.finallyLoc===F)return this.complete(z.completion,z.afterLoc),N(z),v}},catch:function(F){for(var $=this.tryEntries.length-1;$>=0;--$){var z=this.tryEntries[$];if(z.tryLoc===F){var K=z.completion;if(K.type==="throw"){var j=K.arg;N(z)}return j}}throw new Error("illegal catch attempt")},delegateYield:function(F,$,z){return this.delegate={iterator:H(F),resultName:$,nextLoc:z},this.method==="next"&&(this.arg=i),v}},e}function lne(i,e,t,n,o,r,s){try{var a=i[r](s),l=a.value}catch(c){t(c);return}a.done?e(l):Promise.resolve(l).then(n,o)}function Pb(i){return function(){var e=this,t=arguments;return new Promise(function(n,o){var r=i.apply(e,t);function s(l){lne(r,n,o,s,a,"next",l)}function a(l){lne(r,n,o,s,a,"throw",l)}s(void 0)})}}var DI=Ce({},IRe),r7e=DI.version,s7e=DI.render,a7e=DI.unmountComponentAtNode,D4;try{var l7e=Number((r7e||"").split(".")[0]);l7e>=18&&(D4=DI.createRoot)}catch{}function cne(i){var e=DI.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;e&&Kn(e)==="object"&&(e.usingClientEntryPoint=i)}var SA="__rc_react_root__";function c7e(i,e){cne(!0);var t=e[SA]||D4(e);cne(!1),t.render(i),e[SA]=t}function u7e(i,e){s7e(i,e)}function qK(i,e){if(D4){c7e(i,e);return}u7e(i,e)}function d7e(i){return gW.apply(this,arguments)}function gW(){return gW=Pb(dl().mark(function i(e){return dl().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",Promise.resolve().then(function(){var o;(o=e[SA])===null||o===void 0||o.unmount(),delete e[SA]}));case 1:case"end":return n.stop()}},i)})),gW.apply(this,arguments)}function h7e(i){a7e(i)}function Ape(i){return pW.apply(this,arguments)}function pW(){return pW=Pb(dl().mark(function i(e){return dl().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(D4===void 0){n.next=2;break}return n.abrupt("return",d7e(e));case 2:h7e(e);case 3:case"end":return n.stop()}},i)})),pW.apply(this,arguments)}const o6=()=>({height:0,opacity:0}),une=i=>{const{scrollHeight:e}=i;return{height:e,opacity:1}},f7e=i=>({height:i?i.offsetHeight:0}),r6=(i,e)=>(e==null?void 0:e.deadline)===!0||e.propertyName==="height",g7e=function(){return{motionName:`${arguments.length>0&&arguments[0]!==void 0?arguments[0]:"ant"}-motion-collapse`,onAppearStart:o6,onEnterStart:o6,onAppearActive:une,onEnterActive:une,onLeaveStart:f7e,onLeaveActive:o6,onAppearEnd:r6,onEnterEnd:r6,onLeaveEnd:r6,motionDeadline:500}},j0=(i,e,t)=>t!==void 0?t:`${i}-${e}`;var mW=g7e,k4=function(i){if(!i)return!1;if(i instanceof Element){if(i.offsetParent)return!0;if(i.getBBox){var e=i.getBBox(),t=e.width,n=e.height;if(t||n)return!0}if(i.getBoundingClientRect){var o=i.getBoundingClientRect(),r=o.width,s=o.height;if(r||s)return!0}}return!1};const p7e=i=>{const{componentCls:e,colorPrimary:t}=i;return{[e]:{position:"absolute",background:"transparent",pointerEvents:"none",boxSizing:"border-box",color:`var(--wave-color, ${t})`,boxShadow:"0 0 0 0 currentcolor",opacity:.2,"&.wave-motion-appear":{transition:[`box-shadow 0.4s ${i.motionEaseOutCirc}`,`opacity 2s ${i.motionEaseOutCirc}`].join(","),"&-active":{boxShadow:"0 0 0 6px currentcolor",opacity:0},"&.wave-quick":{transition:[`box-shadow 0.3s ${i.motionEaseInOut}`,`opacity 0.35s ${i.motionEaseInOut}`].join(",")}}}}};var m7e=OK("Wave",i=>[p7e(i)]);function v7e(i){const e=(i||"").match(/rgba?\((\d*), (\d*), (\d*)(, [\d.]*)?\)/);return e&&e[1]&&e[2]&&e[3]?!(e[1]===e[2]&&e[2]===e[3]):!0}function s6(i){return i&&i!=="#fff"&&i!=="#ffffff"&&i!=="rgb(255, 255, 255)"&&i!=="rgba(255, 255, 255, 1)"&&v7e(i)&&!/rgba\((?:\d*, ){3}0\)/.test(i)&&i!=="transparent"}function _7e(i){const{borderTopColor:e,borderColor:t,backgroundColor:n}=getComputedStyle(i);return s6(e)?e:s6(t)?t:s6(n)?n:null}const Ppe="ant-wave-target";function a6(i){return Number.isNaN(i)?0:i}const b7e=i=>{const{className:e,target:t,component:n}=i,o=x.exports.useRef(null),[r,s]=x.exports.useState(null),[a,l]=x.exports.useState([]),[c,u]=x.exports.useState(0),[d,h]=x.exports.useState(0),[f,g]=x.exports.useState(0),[p,v]=x.exports.useState(0),[m,_]=x.exports.useState(!1),y={left:c,top:d,width:f,height:p,borderRadius:a.map(D=>`${D}px`).join(" ")};r&&(y["--wave-color"]=r);function w(){const D=getComputedStyle(t);s(_7e(t));const E=D.position==="static",{borderLeftWidth:I,borderTopWidth:k}=D;u(E?t.offsetLeft:a6(-parseFloat(I))),h(E?t.offsetTop:a6(-parseFloat(k))),g(t.offsetWidth),v(t.offsetHeight);const{borderTopLeftRadius:R,borderTopRightRadius:A,borderBottomLeftRadius:P,borderBottomRightRadius:N}=D;l([R,A,N,P].map(M=>a6(parseFloat(M))))}if(x.exports.useEffect(()=>{if(t){const D=Xi(()=>{w(),_(!0)});let E;return typeof ResizeObserver!="undefined"&&(E=new ResizeObserver(w),E.observe(t)),()=>{Xi.cancel(D),E==null||E.disconnect()}}},[]),!m)return null;const L=(n==="Checkbox"||n==="Radio")&&(t==null?void 0:t.classList.contains(Ppe));return x.exports.createElement(th,{visible:!0,motionAppear:!0,motionName:"wave-motion",motionDeadline:5e3,onAppearEnd:(D,E)=>{var I;if(E.deadline||E.propertyName==="opacity"){const k=(I=o.current)===null||I===void 0?void 0:I.parentElement;Ape(k).then(()=>{k==null||k.remove()})}return!1}},D=>{let{className:E}=D;return x.exports.createElement("div",{ref:o,className:Ue(e,{"wave-quick":L},E),style:y})})},C7e=(i,e)=>{var t;const{component:n}=e;if(n==="Checkbox"&&!(!((t=i.querySelector("input"))===null||t===void 0)&&t.checked))return;const o=document.createElement("div");o.style.position="absolute",o.style.left="0px",o.style.top="0px",i==null||i.insertBefore(o,i==null?void 0:i.firstChild),qK(x.exports.createElement(b7e,Object.assign({},e,{target:i})),o)};var y7e=C7e;function w7e(i,e,t){const{wave:n}=x.exports.useContext(Hi),[,o,r]=Ba(),s=tl(c=>{const u=i.current;if((n==null?void 0:n.disabled)||!u)return;const d=u.querySelector(`.${Ppe}`)||u,{showEffect:h}=n||{};(h||y7e)(d,{className:e,token:o,component:t,event:c,hashId:r})}),a=x.exports.useRef();return c=>{Xi.cancel(a.current),a.current=Xi(()=>{s(c)})}}const S7e=i=>{const{children:e,disabled:t,component:n}=i,{getPrefixCls:o}=x.exports.useContext(Hi),r=x.exports.useRef(null),s=o("wave"),[,a]=m7e(s),l=w7e(r,Ue(s,a),n);if(Bt.useEffect(()=>{const u=r.current;if(!u||u.nodeType!==1||t)return;const d=h=>{!k4(h.target)||!u.getAttribute||u.getAttribute("disabled")||u.disabled||u.className.includes("disabled")||u.className.includes("-leave")||l(h)};return u.addEventListener("click",d,!0),()=>{u.removeEventListener("click",d,!0)}},[t]),!Bt.isValidElement(e))return e!=null?e:null;const c=Kv(e)?eh(e.ref,r):r;return mv(e,{ref:c})};var x7e=S7e;const L7e=i=>{const e=Bt.useContext(LI);return Bt.useMemo(()=>i?typeof i=="string"?i!=null?i:e:i instanceof Function?i(e):e:e,[i,e])};var Ob=L7e;globalThis&&globalThis.__rest;const Ope=x.exports.createContext(null),I4=(i,e)=>{const t=x.exports.useContext(Ope),n=x.exports.useMemo(()=>{if(!t)return"";const{compactDirection:o,isFirstItem:r,isLastItem:s}=t,a=o==="vertical"?"-vertical-":"-";return Ue(`${i}-compact${a}item`,{[`${i}-compact${a}first-item`]:r,[`${i}-compact${a}last-item`]:s,[`${i}-compact${a}item-rtl`]:e==="rtl"})},[i,e,t]);return{compactSize:t==null?void 0:t.compactSize,compactDirection:t==null?void 0:t.compactDirection,compactItemClassnames:n}},xA=i=>{let{children:e}=i;return x.exports.createElement(Ope.Provider,{value:null},e)};var E7e=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(i);o{const{getPrefixCls:e,direction:t}=x.exports.useContext(Hi),{prefixCls:n,size:o,className:r}=i,s=E7e(i,["prefixCls","size","className"]),a=e("btn-group",n),[,,l]=Ba();let c="";switch(o){case"large":c="lg";break;case"small":c="sm";break}const u=Ue(a,{[`${a}-${c}`]:c,[`${a}-rtl`]:t==="rtl"},r,l);return x.exports.createElement(Fpe.Provider,{value:o},x.exports.createElement("div",Object.assign({},s,{className:u})))};var k7e=D7e;const dne=/^[\u4e00-\u9fa5]{2}$/,vW=dne.test.bind(dne);function Bpe(i){return i==="danger"?{danger:!0}:{type:i}}function hne(i){return typeof i=="string"}function l6(i){return i==="text"||i==="link"}function I7e(i,e){if(i==null)return;const t=e?" ":"";return typeof i!="string"&&typeof i!="number"&&hne(i.type)&&vW(i.props.children)?mv(i,{children:i.props.children.split("").join(t)}):hne(i)?vW(i)?Bt.createElement("span",null,i.split("").join(t)):Bt.createElement("span",null,i):Dpe(i)?Bt.createElement("span",null,i):i}function T7e(i,e){let t=!1;const n=[];return Bt.Children.forEach(i,o=>{const r=typeof o,s=r==="string"||r==="number";if(t&&s){const a=n.length-1,l=n[a];n[a]=`${l}${o}`}else n.push(o);t=s}),Bt.Children.map(n,o=>I7e(o,e))}const N7e=x.exports.forwardRef((i,e)=>{const{className:t,style:n,children:o,prefixCls:r}=i,s=Ue(`${r}-icon`,t);return he("span",{ref:e,className:s,style:n,children:o})});var Wpe=N7e;const fne=x.exports.forwardRef((i,e)=>{let{prefixCls:t,className:n,style:o,iconClassName:r}=i;const s=Ue(`${t}-loading-icon`,n);return he(Wpe,{prefixCls:t,className:s,style:o,ref:e,children:he(EI,{className:r})})}),c6=()=>({width:0,opacity:0,transform:"scale(0)"}),u6=i=>({width:i.scrollWidth,opacity:1,transform:"scale(1)"}),R7e=i=>{const{prefixCls:e,loading:t,existIcon:n,className:o,style:r}=i,s=!!t;return n?he(fne,{prefixCls:e,className:o,style:r}):he(th,{visible:s,motionName:`${e}-loading-icon-motion`,motionLeave:s,removeOnLeave:!0,onAppearStart:c6,onAppearActive:u6,onEnterStart:c6,onEnterActive:u6,onLeaveStart:u6,onLeaveActive:c6,children:(a,l)=>{let{className:c,style:u}=a;return he(fne,{prefixCls:e,className:o,style:Object.assign(Object.assign({},r),u),ref:l,iconClassName:c})}})};var M7e=R7e;const gne=(i,e)=>({[`> span, > ${i}`]:{"&:not(:last-child)":{[`&, & > ${i}`]:{"&:not(:disabled)":{borderInlineEndColor:e}}},"&:not(:first-child)":{[`&, & > ${i}`]:{"&:not(:disabled)":{borderInlineStartColor:e}}}}}),A7e=i=>{const{componentCls:e,fontSize:t,lineWidth:n,groupBorderColor:o,colorErrorHover:r}=i;return{[`${e}-group`]:[{position:"relative",display:"inline-flex",[`> span, > ${e}`]:{"&:not(:last-child)":{[`&, & > ${e}`]:{borderStartEndRadius:0,borderEndEndRadius:0}},"&:not(:first-child)":{marginInlineStart:i.calc(n).mul(-1).equal(),[`&, & > ${e}`]:{borderStartStartRadius:0,borderEndStartRadius:0}}},[e]:{position:"relative",zIndex:1,[`&:hover, &:focus, - &:active`]:{zIndex:2},"&[disabled]":{zIndex:0}},[`${e}-icon-only`]:{fontSize:t}},sne(`${e}-primary`,o),sne(`${e}-danger`,r)]}};var D7e=E7e;const Mpe=i=>{const{paddingInline:e,onlyIconSize:t,paddingBlock:n}=i;return lr(i,{buttonPaddingHorizontal:e,buttonPaddingVertical:n,buttonIconOnlyFontSize:t})},Ape=i=>{var e,t,n,o,r,s;const a=(e=i.contentFontSize)!==null&&e!==void 0?e:i.fontSize,l=(t=i.contentFontSizeSM)!==null&&t!==void 0?t:i.fontSize,c=(n=i.contentFontSizeLG)!==null&&n!==void 0?n:i.fontSizeLG,u=(o=i.contentLineHeight)!==null&&o!==void 0?o:VR(a),d=(r=i.contentLineHeightSM)!==null&&r!==void 0?r:VR(l),h=(s=i.contentLineHeightLG)!==null&&s!==void 0?s:VR(c);return{fontWeight:400,defaultShadow:`0 ${i.controlOutlineWidth}px 0 ${i.controlTmpOutline}`,primaryShadow:`0 ${i.controlOutlineWidth}px 0 ${i.controlOutline}`,dangerShadow:`0 ${i.controlOutlineWidth}px 0 ${i.colorErrorOutline}`,primaryColor:i.colorTextLightSolid,dangerColor:i.colorTextLightSolid,borderColorDisabled:i.colorBorder,defaultGhostColor:i.colorBgContainer,ghostBg:"transparent",defaultGhostBorderColor:i.colorBgContainer,paddingInline:i.paddingContentHorizontal-i.lineWidth,paddingInlineLG:i.paddingContentHorizontal-i.lineWidth,paddingInlineSM:8-i.lineWidth,onlyIconSize:i.fontSizeLG,onlyIconSizeSM:i.fontSizeLG-2,onlyIconSizeLG:i.fontSizeLG+2,groupBorderColor:i.colorPrimaryHover,linkHoverBg:"transparent",textHoverBg:i.colorBgTextHover,defaultColor:i.colorText,defaultBg:i.colorBgContainer,defaultBorderColor:i.colorBorder,defaultBorderColorDisabled:i.colorBorder,contentFontSize:a,contentFontSizeSM:l,contentFontSizeLG:c,contentLineHeight:u,contentLineHeightSM:d,contentLineHeightLG:h,paddingBlock:Math.max((i.controlHeight-a*u)/2-i.lineWidth,0),paddingBlockSM:Math.max((i.controlHeightSM-l*d)/2-i.lineWidth,0),paddingBlockLG:Math.max((i.controlHeightLG-c*h)/2-i.lineWidth,0)}},k7e=i=>{const{componentCls:e,iconCls:t,fontWeight:n}=i;return{[e]:{outline:"none",position:"relative",display:"inline-block",fontWeight:n,whiteSpace:"nowrap",textAlign:"center",backgroundImage:"none",background:"transparent",border:`${rt(i.lineWidth)} ${i.lineType} transparent`,cursor:"pointer",transition:`all ${i.motionDurationMid} ${i.motionEaseInOut}`,userSelect:"none",touchAction:"manipulation",color:i.colorText,"&:disabled > *":{pointerEvents:"none"},"> span":{display:"inline-block"},[`${e}-icon`]:{lineHeight:0},[`> ${t} + span, > span + ${t}`]:{marginInlineStart:i.marginXS},[`&:not(${e}-icon-only) > ${e}-icon`]:{[`&${e}-loading-icon, &:not(:last-child)`]:{marginInlineEnd:i.marginXS}},"> a":{color:"currentColor"},"&:not(:disabled)":Object.assign({},S4(i)),[`&${e}-two-chinese-chars::first-letter`]:{letterSpacing:"0.34em"},[`&${e}-two-chinese-chars > *:not(${t})`]:{marginInlineEnd:"-0.34em",letterSpacing:"0.34em"},[`&-icon-only${e}-compact-item`]:{flex:"none"}}}},ip=(i,e,t)=>({[`&:not(:disabled):not(${i}-disabled)`]:{"&:hover":e,"&:active":t}}),I7e=i=>({minWidth:i.controlHeight,paddingInlineStart:0,paddingInlineEnd:0,borderRadius:"50%"}),T7e=i=>({borderRadius:i.controlHeight,paddingInlineStart:i.calc(i.controlHeight).div(2).equal(),paddingInlineEnd:i.calc(i.controlHeight).div(2).equal()}),N7e=i=>({cursor:"not-allowed",borderColor:i.borderColorDisabled,color:i.colorTextDisabled,background:i.colorBgContainerDisabled,boxShadow:"none"}),fD=(i,e,t,n,o,r,s,a)=>({[`&${i}-background-ghost`]:Object.assign(Object.assign({color:t||void 0,background:e,borderColor:n||void 0,boxShadow:"none"},ip(i,Object.assign({background:e},s),Object.assign({background:e},a))),{"&:disabled":{cursor:"not-allowed",color:o||void 0,borderColor:r||void 0}})}),UK=i=>({[`&:disabled, &${i.componentCls}-disabled`]:Object.assign({},N7e(i))}),Ppe=i=>Object.assign({},UK(i)),yA=i=>({[`&:disabled, &${i.componentCls}-disabled`]:{cursor:"not-allowed",color:i.colorTextDisabled}}),Ope=i=>Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},Ppe(i)),{background:i.defaultBg,borderColor:i.defaultBorderColor,color:i.defaultColor,boxShadow:i.defaultShadow}),ip(i.componentCls,{color:i.colorPrimaryHover,borderColor:i.colorPrimaryHover},{color:i.colorPrimaryActive,borderColor:i.colorPrimaryActive})),fD(i.componentCls,i.ghostBg,i.defaultGhostColor,i.defaultGhostBorderColor,i.colorTextDisabled,i.colorBorder)),{[`&${i.componentCls}-dangerous`]:Object.assign(Object.assign(Object.assign({color:i.colorError,borderColor:i.colorError},ip(i.componentCls,{color:i.colorErrorHover,borderColor:i.colorErrorBorderHover},{color:i.colorErrorActive,borderColor:i.colorErrorActive})),fD(i.componentCls,i.ghostBg,i.colorError,i.colorError,i.colorTextDisabled,i.colorBorder)),UK(i))}),R7e=i=>Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},Ppe(i)),{color:i.primaryColor,background:i.colorPrimary,boxShadow:i.primaryShadow}),ip(i.componentCls,{color:i.colorTextLightSolid,background:i.colorPrimaryHover},{color:i.colorTextLightSolid,background:i.colorPrimaryActive})),fD(i.componentCls,i.ghostBg,i.colorPrimary,i.colorPrimary,i.colorTextDisabled,i.colorBorder,{color:i.colorPrimaryHover,borderColor:i.colorPrimaryHover},{color:i.colorPrimaryActive,borderColor:i.colorPrimaryActive})),{[`&${i.componentCls}-dangerous`]:Object.assign(Object.assign(Object.assign({background:i.colorError,boxShadow:i.dangerShadow,color:i.dangerColor},ip(i.componentCls,{background:i.colorErrorHover},{background:i.colorErrorActive})),fD(i.componentCls,i.ghostBg,i.colorError,i.colorError,i.colorTextDisabled,i.colorBorder,{color:i.colorErrorHover,borderColor:i.colorErrorHover},{color:i.colorErrorActive,borderColor:i.colorErrorActive})),UK(i))}),M7e=i=>Object.assign(Object.assign({},Ope(i)),{borderStyle:"dashed"}),A7e=i=>Object.assign(Object.assign(Object.assign({color:i.colorLink},ip(i.componentCls,{color:i.colorLinkHover,background:i.linkHoverBg},{color:i.colorLinkActive})),yA(i)),{[`&${i.componentCls}-dangerous`]:Object.assign(Object.assign({color:i.colorError},ip(i.componentCls,{color:i.colorErrorHover},{color:i.colorErrorActive})),yA(i))}),P7e=i=>Object.assign(Object.assign(Object.assign({},ip(i.componentCls,{color:i.colorText,background:i.textHoverBg},{color:i.colorText,background:i.colorBgTextActive})),yA(i)),{[`&${i.componentCls}-dangerous`]:Object.assign(Object.assign({color:i.colorError},yA(i)),ip(i.componentCls,{color:i.colorErrorHover,background:i.colorErrorBg},{color:i.colorErrorHover,background:i.colorErrorBg}))}),O7e=i=>{const{componentCls:e}=i;return{[`${e}-default`]:Ope(i),[`${e}-primary`]:R7e(i),[`${e}-dashed`]:M7e(i),[`${e}-link`]:A7e(i),[`${e}-text`]:P7e(i),[`${e}-ghost`]:fD(i.componentCls,i.ghostBg,i.colorBgContainer,i.colorBgContainer,i.colorTextDisabled,i.colorBorder)}},jK=function(i){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const{componentCls:t,controlHeight:n,fontSize:o,lineHeight:r,borderRadius:s,buttonPaddingHorizontal:a,iconCls:l,buttonPaddingVertical:c}=i,u=`${t}-icon-only`;return[{[`${t}${e}`]:{fontSize:o,lineHeight:r,height:n,padding:`${rt(c)} ${rt(a)}`,borderRadius:s,[`&${u}`]:{width:n,paddingInlineStart:0,paddingInlineEnd:0,[`&${t}-round`]:{width:"auto"},[l]:{fontSize:i.buttonIconOnlyFontSize}},[`&${t}-loading`]:{opacity:i.opacityLoading,cursor:"default"},[`${t}-loading-icon`]:{transition:`width ${i.motionDurationSlow} ${i.motionEaseInOut}, opacity ${i.motionDurationSlow} ${i.motionEaseInOut}`}}},{[`${t}${t}-circle${e}`]:I7e(i)},{[`${t}${t}-round${e}`]:T7e(i)}]},F7e=i=>jK(lr(i,{fontSize:i.contentFontSize,lineHeight:i.contentLineHeight})),B7e=i=>{const e=lr(i,{controlHeight:i.controlHeightSM,fontSize:i.contentFontSizeSM,lineHeight:i.contentLineHeightSM,padding:i.paddingXS,buttonPaddingHorizontal:i.paddingInlineSM,buttonPaddingVertical:i.paddingBlockSM,borderRadius:i.borderRadiusSM,buttonIconOnlyFontSize:i.onlyIconSizeSM});return jK(e,`${i.componentCls}-sm`)},W7e=i=>{const e=lr(i,{controlHeight:i.controlHeightLG,fontSize:i.contentFontSizeLG,lineHeight:i.contentLineHeightLG,buttonPaddingHorizontal:i.paddingInlineLG,buttonPaddingVertical:i.paddingBlockLG,borderRadius:i.borderRadiusLG,buttonIconOnlyFontSize:i.onlyIconSizeLG});return jK(e,`${i.componentCls}-lg`)},V7e=i=>{const{componentCls:e}=i;return{[e]:{[`&${e}-block`]:{width:"100%"}}}};var H7e=Uc("Button",i=>{const e=Mpe(i);return[k7e(e),B7e(e),F7e(e),W7e(e),V7e(e),O7e(e),D7e(e)]},Ape,{unitless:{fontWeight:!0,contentLineHeight:!0,contentLineHeightSM:!0,contentLineHeightLG:!0}});function $7e(i,e,t){const{focusElCls:n,focus:o,borderElCls:r}=t,s=r?"> *":"",a=["hover",o?"focus":null,"active"].filter(Boolean).map(l=>`&:${l} ${s}`).join(",");return{[`&-item:not(${e}-last-item)`]:{marginInlineEnd:i.calc(i.lineWidth).mul(-1).equal()},"&-item":Object.assign(Object.assign({[a]:{zIndex:2}},n?{[`&${n}`]:{zIndex:2}}:{}),{[`&[disabled] ${s}`]:{zIndex:0}})}}function z7e(i,e,t){const{borderElCls:n}=t,o=n?`> ${n}`:"";return{[`&-item:not(${e}-first-item):not(${e}-last-item) ${o}`]:{borderRadius:0},[`&-item:not(${e}-last-item)${e}-first-item`]:{[`& ${o}, &${i}-sm ${o}, &${i}-lg ${o}`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`&-item:not(${e}-first-item)${e}-last-item`]:{[`& ${o}, &${i}-sm ${o}, &${i}-lg ${o}`]:{borderStartStartRadius:0,borderEndStartRadius:0}}}}function KK(i){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{focus:!0};const{componentCls:t}=i,n=`${t}-compact`;return{[n]:Object.assign(Object.assign({},$7e(i,n,e)),z7e(t,n,e))}}function U7e(i,e){return{[`&-item:not(${e}-last-item)`]:{marginBottom:i.calc(i.lineWidth).mul(-1).equal()},"&-item":{"&:hover,&:focus,&:active":{zIndex:2},"&[disabled]":{zIndex:0}}}}function j7e(i,e){return{[`&-item:not(${e}-first-item):not(${e}-last-item)`]:{borderRadius:0},[`&-item${e}-first-item:not(${e}-last-item)`]:{[`&, &${i}-sm, &${i}-lg`]:{borderEndEndRadius:0,borderEndStartRadius:0}},[`&-item${e}-last-item:not(${e}-first-item)`]:{[`&, &${i}-sm, &${i}-lg`]:{borderStartStartRadius:0,borderStartEndRadius:0}}}}function K7e(i){const e=`${i.componentCls}-compact-vertical`;return{[e]:Object.assign(Object.assign({},U7e(i,e)),j7e(i.componentCls,e))}}const q7e=i=>{const{componentCls:e,calc:t}=i;return{[e]:{[`&-compact-item${e}-primary`]:{[`&:not([disabled]) + ${e}-compact-item${e}-primary:not([disabled])`]:{position:"relative","&:before":{position:"absolute",top:t(i.lineWidth).mul(-1).equal(),insetInlineStart:t(i.lineWidth).mul(-1).equal(),display:"inline-block",width:i.lineWidth,height:`calc(100% + ${rt(i.lineWidth)} * 2)`,backgroundColor:i.colorPrimaryHover,content:'""'}}},"&-compact-vertical-item":{[`&${e}-primary`]:{[`&:not([disabled]) + ${e}-compact-vertical-item${e}-primary:not([disabled])`]:{position:"relative","&:before":{position:"absolute",top:t(i.lineWidth).mul(-1).equal(),insetInlineStart:t(i.lineWidth).mul(-1).equal(),display:"inline-block",width:`calc(100% + ${rt(i.lineWidth)} * 2)`,height:i.lineWidth,backgroundColor:i.colorPrimaryHover,content:'""'}}}}}}};var G7e=MK(["Button","compact"],i=>{const e=Mpe(i);return[KK(e),K7e(e),q7e(e)]},Ape),X7e=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(i);o{var t,n;const{loading:o=!1,prefixCls:r,type:s="default",danger:a,shape:l="default",size:c,styles:u,disabled:d,className:h,rootClassName:f,children:g,icon:p,ghost:v=!1,block:m=!1,htmlType:_="button",classNames:w,style:y={}}=i,L=X7e(i,["loading","prefixCls","type","danger","shape","size","styles","disabled","className","rootClassName","children","icon","ghost","block","htmlType","classNames","style"]),{getPrefixCls:D,autoInsertSpaceInButton:E,direction:I,button:k}=x.exports.useContext(Hi),R=D("btn",r),[A,P,N]=H7e(R),M=x.exports.useContext(aS),H=d!=null?d:M,W=x.exports.useContext(Tpe),F=x.exports.useMemo(()=>Y7e(o),[o]),[$,z]=x.exports.useState(F.loading),[K,j]=x.exports.useState(!1),X=Jd(e,x.exports.createRef()),de=x.exports.Children.count(g)===1&&!p&&!l6(s);x.exports.useEffect(()=>{let ie=null;F.delay>0?ie=setTimeout(()=>{ie=null,z(!0)},F.delay):z(F.loading);function se(){ie&&(clearTimeout(ie),ie=null)}return se},[F]),x.exports.useEffect(()=>{if(!X||!X.current||E===!1)return;const ie=X.current.textContent;de&&gW(ie)?K||j(!0):K&&j(!1)},[X]);const he=ie=>{const{onClick:se}=i;if($||H){ie.preventDefault();return}se==null||se(ie)},pe=E!==!1,{compactSize:be,compactItemClassnames:Se}=k4(R,I),Fe={large:"lg",small:"sm",middle:void 0},De=Pb(ie=>{var se,U;return(U=(se=c!=null?c:be)!==null&&se!==void 0?se:W)!==null&&U!==void 0?U:ie}),ce=De&&Fe[De]||"",Pe=$?"loading":p,Oe=Df(L,["navigate"]),xe=Ue(R,P,N,{[`${R}-${l}`]:l!=="default"&&l,[`${R}-${s}`]:s,[`${R}-${ce}`]:ce,[`${R}-icon-only`]:!g&&g!==0&&!!Pe,[`${R}-background-ghost`]:v&&!l6(s),[`${R}-loading`]:$,[`${R}-two-chinese-chars`]:K&&pe&&!$,[`${R}-block`]:m,[`${R}-dangerous`]:!!a,[`${R}-rtl`]:I==="rtl"},Se,h,f,k==null?void 0:k.className),Ee=Object.assign(Object.assign({},k==null?void 0:k.style),y),tt=Ue(w==null?void 0:w.icon,(t=k==null?void 0:k.classNames)===null||t===void 0?void 0:t.icon),nt=Object.assign(Object.assign({},(u==null?void 0:u.icon)||{}),((n=k==null?void 0:k.styles)===null||n===void 0?void 0:n.icon)||{}),Qe=p&&!$?fe(Rpe,{prefixCls:R,className:tt,style:nt,children:p}):fe(L7e,{existIcon:!!p,prefixCls:R,loading:!!$}),Ge=g||g===0?y7e(g,de&&pe):null;if(Oe.href!==void 0)return A(vn("a",{...Object.assign({},Oe,{className:Ue(xe,{[`${R}-disabled`]:H}),href:H?void 0:Oe.href,style:Ee,onClick:he,ref:X,tabIndex:H?-1:0}),children:[Qe,Ge]}));let re=vn("button",{...Object.assign({},L,{type:_,className:xe,style:Ee,onClick:he,disabled:H,ref:X}),children:[Qe,Ge,!!Se&&fe(G7e,{prefixCls:R},"compact")]});return l6(s)||(re=fe(m7e,{component:"Button",disabled:!!$,children:re})),A(re)},qK=x.exports.forwardRef(Z7e);qK.Group=C7e;qK.__ANT_BUTTON=!0;var Bs=qK;function ane(i){return!!(i&&i.then)}const Q7e=i=>{const{type:e,children:t,prefixCls:n,buttonProps:o,close:r,autoFocus:s,emitEvent:a,isSilent:l,quitOnNullishReturnValue:c,actionFn:u}=i,d=x.exports.useRef(!1),h=x.exports.useRef(null),[f,g]=$m(!1),p=function(){r==null||r.apply(void 0,arguments)};x.exports.useEffect(()=>{let _=null;return s&&(_=setTimeout(()=>{var w;(w=h.current)===null||w===void 0||w.focus()})),()=>{_&&clearTimeout(_)}},[]);const v=_=>{!ane(_)||(g(!0),_.then(function(){g(!1,!0),p.apply(void 0,arguments),d.current=!1},w=>{if(g(!1,!0),d.current=!1,!(l!=null&&l()))return Promise.reject(w)}))},m=_=>{if(d.current)return;if(d.current=!0,!u){p();return}let w;if(a){if(w=u(_),c&&!ane(w)){d.current=!1,p(_);return}}else if(u.length)w=u(r),d.current=!1;else if(w=u(),!w){p();return}v(w)};return x.exports.createElement(Bs,Object.assign({},Npe(e),{onClick:m,loading:f,prefixCls:n},o,{ref:h}),t)};var Fpe=Q7e;const EI=Bt.createContext({}),{Provider:Bpe}=EI,J7e=()=>{const{autoFocusButton:i,cancelButtonProps:e,cancelTextLocale:t,isSilent:n,mergedOkCancel:o,rootPrefixCls:r,close:s,onCancel:a,onConfirm:l}=x.exports.useContext(EI);return o?fe(Fpe,{isSilent:n,actionFn:a,close:function(){s==null||s.apply(void 0,arguments),l==null||l(!1)},autoFocus:i==="cancel",buttonProps:e,prefixCls:`${r}-btn`,children:t}):null};var lne=J7e;const eBe=()=>{const{autoFocusButton:i,close:e,isSilent:t,okButtonProps:n,rootPrefixCls:o,okTextLocale:r,okType:s,onConfirm:a,onOk:l}=x.exports.useContext(EI);return fe(Fpe,{isSilent:t,type:s||"primary",actionFn:l,close:function(){e==null||e.apply(void 0,arguments),a==null||a(!0)},autoFocus:i==="ok",buttonProps:n,prefixCls:`${o}-btn`,children:r})};var cne=eBe,Wpe=x.exports.createContext(null),une=[];function tBe(i,e){var t=x.exports.useState(function(){if(!Oa())return null;var g=document.createElement("div");return g}),n=Ne(t,1),o=n[0],r=x.exports.useRef(!1),s=x.exports.useContext(Wpe),a=x.exports.useState(une),l=Ne(a,2),c=l[0],u=l[1],d=s||(r.current?void 0:function(g){u(function(p){var v=[g].concat(_t(p));return v})});function h(){o.parentElement||document.body.appendChild(o),r.current=!0}function f(){var g;(g=o.parentElement)===null||g===void 0||g.removeChild(o),r.current=!1}return go(function(){return i?s?s(h):h():f(),f},[i]),go(function(){c.length&&(c.forEach(function(g){return g()}),u(une))},[c]),[o,d]}var d6;function nBe(i){if(typeof document=="undefined")return 0;if(i||d6===void 0){var e=document.createElement("div");e.style.width="100%",e.style.height="200px";var t=document.createElement("div"),n=t.style;n.position="absolute",n.top="0",n.left="0",n.pointerEvents="none",n.visibility="hidden",n.width="200px",n.height="150px",n.overflow="hidden",t.appendChild(e),document.body.appendChild(t);var o=e.offsetWidth;t.style.overflow="scroll";var r=e.offsetWidth;o===r&&(r=t.clientWidth),document.body.removeChild(t),d6=o-r}return d6}function dne(i){var e=i.match(/^(.*)px$/),t=Number(e==null?void 0:e[1]);return Number.isNaN(t)?nBe():t}function iBe(i){if(typeof document=="undefined"||!i||!(i instanceof Element))return{width:0,height:0};var e=getComputedStyle(i,"::-webkit-scrollbar"),t=e.width,n=e.height;return{width:dne(t),height:dne(n)}}function oBe(){return document.body.scrollHeight>(window.innerHeight||document.documentElement.clientHeight)&&window.innerWidth>document.body.offsetWidth}var rBe="rc-util-locker-".concat(Date.now()),hne=0;function sBe(i){var e=!!i,t=x.exports.useState(function(){return hne+=1,"".concat(rBe,"_").concat(hne)}),n=Ne(t,1),o=n[0];go(function(){if(e){var r=iBe(document.body).width,s=oBe();fv(` + &:active`]:{zIndex:2},"&[disabled]":{zIndex:0}},[`${e}-icon-only`]:{fontSize:t}},gne(`${e}-primary`,o),gne(`${e}-danger`,r)]}};var P7e=A7e;const Vpe=i=>{const{paddingInline:e,onlyIconSize:t,paddingBlock:n}=i;return lr(i,{buttonPaddingHorizontal:e,buttonPaddingVertical:n,buttonIconOnlyFontSize:t})},Hpe=i=>{var e,t,n,o,r,s;const a=(e=i.contentFontSize)!==null&&e!==void 0?e:i.fontSize,l=(t=i.contentFontSizeSM)!==null&&t!==void 0?t:i.fontSize,c=(n=i.contentFontSizeLG)!==null&&n!==void 0?n:i.fontSizeLG,u=(o=i.contentLineHeight)!==null&&o!==void 0?o:zR(a),d=(r=i.contentLineHeightSM)!==null&&r!==void 0?r:zR(l),h=(s=i.contentLineHeightLG)!==null&&s!==void 0?s:zR(c);return{fontWeight:400,defaultShadow:`0 ${i.controlOutlineWidth}px 0 ${i.controlTmpOutline}`,primaryShadow:`0 ${i.controlOutlineWidth}px 0 ${i.controlOutline}`,dangerShadow:`0 ${i.controlOutlineWidth}px 0 ${i.colorErrorOutline}`,primaryColor:i.colorTextLightSolid,dangerColor:i.colorTextLightSolid,borderColorDisabled:i.colorBorder,defaultGhostColor:i.colorBgContainer,ghostBg:"transparent",defaultGhostBorderColor:i.colorBgContainer,paddingInline:i.paddingContentHorizontal-i.lineWidth,paddingInlineLG:i.paddingContentHorizontal-i.lineWidth,paddingInlineSM:8-i.lineWidth,onlyIconSize:i.fontSizeLG,onlyIconSizeSM:i.fontSizeLG-2,onlyIconSizeLG:i.fontSizeLG+2,groupBorderColor:i.colorPrimaryHover,linkHoverBg:"transparent",textHoverBg:i.colorBgTextHover,defaultColor:i.colorText,defaultBg:i.colorBgContainer,defaultBorderColor:i.colorBorder,defaultBorderColorDisabled:i.colorBorder,contentFontSize:a,contentFontSizeSM:l,contentFontSizeLG:c,contentLineHeight:u,contentLineHeightSM:d,contentLineHeightLG:h,paddingBlock:Math.max((i.controlHeight-a*u)/2-i.lineWidth,0),paddingBlockSM:Math.max((i.controlHeightSM-l*d)/2-i.lineWidth,0),paddingBlockLG:Math.max((i.controlHeightLG-c*h)/2-i.lineWidth,0)}},O7e=i=>{const{componentCls:e,iconCls:t,fontWeight:n}=i;return{[e]:{outline:"none",position:"relative",display:"inline-block",fontWeight:n,whiteSpace:"nowrap",textAlign:"center",backgroundImage:"none",background:"transparent",border:`${rt(i.lineWidth)} ${i.lineType} transparent`,cursor:"pointer",transition:`all ${i.motionDurationMid} ${i.motionEaseInOut}`,userSelect:"none",touchAction:"manipulation",color:i.colorText,"&:disabled > *":{pointerEvents:"none"},"> span":{display:"inline-block"},[`${e}-icon`]:{lineHeight:0},[`> ${t} + span, > span + ${t}`]:{marginInlineStart:i.marginXS},[`&:not(${e}-icon-only) > ${e}-icon`]:{[`&${e}-loading-icon, &:not(:last-child)`]:{marginInlineEnd:i.marginXS}},"> a":{color:"currentColor"},"&:not(:disabled)":Object.assign({},x4(i)),[`&${e}-two-chinese-chars::first-letter`]:{letterSpacing:"0.34em"},[`&${e}-two-chinese-chars > *:not(${t})`]:{marginInlineEnd:"-0.34em",letterSpacing:"0.34em"},[`&-icon-only${e}-compact-item`]:{flex:"none"}}}},op=(i,e,t)=>({[`&:not(:disabled):not(${i}-disabled)`]:{"&:hover":e,"&:active":t}}),F7e=i=>({minWidth:i.controlHeight,paddingInlineStart:0,paddingInlineEnd:0,borderRadius:"50%"}),B7e=i=>({borderRadius:i.controlHeight,paddingInlineStart:i.calc(i.controlHeight).div(2).equal(),paddingInlineEnd:i.calc(i.controlHeight).div(2).equal()}),W7e=i=>({cursor:"not-allowed",borderColor:i.borderColorDisabled,color:i.colorTextDisabled,background:i.colorBgContainerDisabled,boxShadow:"none"}),gD=(i,e,t,n,o,r,s,a)=>({[`&${i}-background-ghost`]:Object.assign(Object.assign({color:t||void 0,background:e,borderColor:n||void 0,boxShadow:"none"},op(i,Object.assign({background:e},s),Object.assign({background:e},a))),{"&:disabled":{cursor:"not-allowed",color:o||void 0,borderColor:r||void 0}})}),GK=i=>({[`&:disabled, &${i.componentCls}-disabled`]:Object.assign({},W7e(i))}),$pe=i=>Object.assign({},GK(i)),LA=i=>({[`&:disabled, &${i.componentCls}-disabled`]:{cursor:"not-allowed",color:i.colorTextDisabled}}),zpe=i=>Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},$pe(i)),{background:i.defaultBg,borderColor:i.defaultBorderColor,color:i.defaultColor,boxShadow:i.defaultShadow}),op(i.componentCls,{color:i.colorPrimaryHover,borderColor:i.colorPrimaryHover},{color:i.colorPrimaryActive,borderColor:i.colorPrimaryActive})),gD(i.componentCls,i.ghostBg,i.defaultGhostColor,i.defaultGhostBorderColor,i.colorTextDisabled,i.colorBorder)),{[`&${i.componentCls}-dangerous`]:Object.assign(Object.assign(Object.assign({color:i.colorError,borderColor:i.colorError},op(i.componentCls,{color:i.colorErrorHover,borderColor:i.colorErrorBorderHover},{color:i.colorErrorActive,borderColor:i.colorErrorActive})),gD(i.componentCls,i.ghostBg,i.colorError,i.colorError,i.colorTextDisabled,i.colorBorder)),GK(i))}),V7e=i=>Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},$pe(i)),{color:i.primaryColor,background:i.colorPrimary,boxShadow:i.primaryShadow}),op(i.componentCls,{color:i.colorTextLightSolid,background:i.colorPrimaryHover},{color:i.colorTextLightSolid,background:i.colorPrimaryActive})),gD(i.componentCls,i.ghostBg,i.colorPrimary,i.colorPrimary,i.colorTextDisabled,i.colorBorder,{color:i.colorPrimaryHover,borderColor:i.colorPrimaryHover},{color:i.colorPrimaryActive,borderColor:i.colorPrimaryActive})),{[`&${i.componentCls}-dangerous`]:Object.assign(Object.assign(Object.assign({background:i.colorError,boxShadow:i.dangerShadow,color:i.dangerColor},op(i.componentCls,{background:i.colorErrorHover},{background:i.colorErrorActive})),gD(i.componentCls,i.ghostBg,i.colorError,i.colorError,i.colorTextDisabled,i.colorBorder,{color:i.colorErrorHover,borderColor:i.colorErrorHover},{color:i.colorErrorActive,borderColor:i.colorErrorActive})),GK(i))}),H7e=i=>Object.assign(Object.assign({},zpe(i)),{borderStyle:"dashed"}),$7e=i=>Object.assign(Object.assign(Object.assign({color:i.colorLink},op(i.componentCls,{color:i.colorLinkHover,background:i.linkHoverBg},{color:i.colorLinkActive})),LA(i)),{[`&${i.componentCls}-dangerous`]:Object.assign(Object.assign({color:i.colorError},op(i.componentCls,{color:i.colorErrorHover},{color:i.colorErrorActive})),LA(i))}),z7e=i=>Object.assign(Object.assign(Object.assign({},op(i.componentCls,{color:i.colorText,background:i.textHoverBg},{color:i.colorText,background:i.colorBgTextActive})),LA(i)),{[`&${i.componentCls}-dangerous`]:Object.assign(Object.assign({color:i.colorError},LA(i)),op(i.componentCls,{color:i.colorErrorHover,background:i.colorErrorBg},{color:i.colorErrorHover,background:i.colorErrorBg}))}),U7e=i=>{const{componentCls:e}=i;return{[`${e}-default`]:zpe(i),[`${e}-primary`]:V7e(i),[`${e}-dashed`]:H7e(i),[`${e}-link`]:$7e(i),[`${e}-text`]:z7e(i),[`${e}-ghost`]:gD(i.componentCls,i.ghostBg,i.colorBgContainer,i.colorBgContainer,i.colorTextDisabled,i.colorBorder)}},XK=function(i){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const{componentCls:t,controlHeight:n,fontSize:o,lineHeight:r,borderRadius:s,buttonPaddingHorizontal:a,iconCls:l,buttonPaddingVertical:c}=i,u=`${t}-icon-only`;return[{[`${t}${e}`]:{fontSize:o,lineHeight:r,height:n,padding:`${rt(c)} ${rt(a)}`,borderRadius:s,[`&${u}`]:{width:n,paddingInlineStart:0,paddingInlineEnd:0,[`&${t}-round`]:{width:"auto"},[l]:{fontSize:i.buttonIconOnlyFontSize}},[`&${t}-loading`]:{opacity:i.opacityLoading,cursor:"default"},[`${t}-loading-icon`]:{transition:`width ${i.motionDurationSlow} ${i.motionEaseInOut}, opacity ${i.motionDurationSlow} ${i.motionEaseInOut}`}}},{[`${t}${t}-circle${e}`]:F7e(i)},{[`${t}${t}-round${e}`]:B7e(i)}]},j7e=i=>XK(lr(i,{fontSize:i.contentFontSize,lineHeight:i.contentLineHeight})),K7e=i=>{const e=lr(i,{controlHeight:i.controlHeightSM,fontSize:i.contentFontSizeSM,lineHeight:i.contentLineHeightSM,padding:i.paddingXS,buttonPaddingHorizontal:i.paddingInlineSM,buttonPaddingVertical:i.paddingBlockSM,borderRadius:i.borderRadiusSM,buttonIconOnlyFontSize:i.onlyIconSizeSM});return XK(e,`${i.componentCls}-sm`)},q7e=i=>{const e=lr(i,{controlHeight:i.controlHeightLG,fontSize:i.contentFontSizeLG,lineHeight:i.contentLineHeightLG,buttonPaddingHorizontal:i.paddingInlineLG,buttonPaddingVertical:i.paddingBlockLG,borderRadius:i.borderRadiusLG,buttonIconOnlyFontSize:i.onlyIconSizeLG});return XK(e,`${i.componentCls}-lg`)},G7e=i=>{const{componentCls:e}=i;return{[e]:{[`&${e}-block`]:{width:"100%"}}}};var X7e=jc("Button",i=>{const e=Vpe(i);return[O7e(e),K7e(e),j7e(e),q7e(e),G7e(e),U7e(e),P7e(e)]},Hpe,{unitless:{fontWeight:!0,contentLineHeight:!0,contentLineHeightSM:!0,contentLineHeightLG:!0}});function Y7e(i,e,t){const{focusElCls:n,focus:o,borderElCls:r}=t,s=r?"> *":"",a=["hover",o?"focus":null,"active"].filter(Boolean).map(l=>`&:${l} ${s}`).join(",");return{[`&-item:not(${e}-last-item)`]:{marginInlineEnd:i.calc(i.lineWidth).mul(-1).equal()},"&-item":Object.assign(Object.assign({[a]:{zIndex:2}},n?{[`&${n}`]:{zIndex:2}}:{}),{[`&[disabled] ${s}`]:{zIndex:0}})}}function Z7e(i,e,t){const{borderElCls:n}=t,o=n?`> ${n}`:"";return{[`&-item:not(${e}-first-item):not(${e}-last-item) ${o}`]:{borderRadius:0},[`&-item:not(${e}-last-item)${e}-first-item`]:{[`& ${o}, &${i}-sm ${o}, &${i}-lg ${o}`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`&-item:not(${e}-first-item)${e}-last-item`]:{[`& ${o}, &${i}-sm ${o}, &${i}-lg ${o}`]:{borderStartStartRadius:0,borderEndStartRadius:0}}}}function YK(i){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{focus:!0};const{componentCls:t}=i,n=`${t}-compact`;return{[n]:Object.assign(Object.assign({},Y7e(i,n,e)),Z7e(t,n,e))}}function Q7e(i,e){return{[`&-item:not(${e}-last-item)`]:{marginBottom:i.calc(i.lineWidth).mul(-1).equal()},"&-item":{"&:hover,&:focus,&:active":{zIndex:2},"&[disabled]":{zIndex:0}}}}function J7e(i,e){return{[`&-item:not(${e}-first-item):not(${e}-last-item)`]:{borderRadius:0},[`&-item${e}-first-item:not(${e}-last-item)`]:{[`&, &${i}-sm, &${i}-lg`]:{borderEndEndRadius:0,borderEndStartRadius:0}},[`&-item${e}-last-item:not(${e}-first-item)`]:{[`&, &${i}-sm, &${i}-lg`]:{borderStartStartRadius:0,borderStartEndRadius:0}}}}function eBe(i){const e=`${i.componentCls}-compact-vertical`;return{[e]:Object.assign(Object.assign({},Q7e(i,e)),J7e(i.componentCls,e))}}const tBe=i=>{const{componentCls:e,calc:t}=i;return{[e]:{[`&-compact-item${e}-primary`]:{[`&:not([disabled]) + ${e}-compact-item${e}-primary:not([disabled])`]:{position:"relative","&:before":{position:"absolute",top:t(i.lineWidth).mul(-1).equal(),insetInlineStart:t(i.lineWidth).mul(-1).equal(),display:"inline-block",width:i.lineWidth,height:`calc(100% + ${rt(i.lineWidth)} * 2)`,backgroundColor:i.colorPrimaryHover,content:'""'}}},"&-compact-vertical-item":{[`&${e}-primary`]:{[`&:not([disabled]) + ${e}-compact-vertical-item${e}-primary:not([disabled])`]:{position:"relative","&:before":{position:"absolute",top:t(i.lineWidth).mul(-1).equal(),insetInlineStart:t(i.lineWidth).mul(-1).equal(),display:"inline-block",width:`calc(100% + ${rt(i.lineWidth)} * 2)`,height:i.lineWidth,backgroundColor:i.colorPrimaryHover,content:'""'}}}}}}};var nBe=FK(["Button","compact"],i=>{const e=Vpe(i);return[YK(e),eBe(e),tBe(e)]},Hpe),iBe=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(i);o{var t,n;const{loading:o=!1,prefixCls:r,type:s="default",danger:a,shape:l="default",size:c,styles:u,disabled:d,className:h,rootClassName:f,children:g,icon:p,ghost:v=!1,block:m=!1,htmlType:_="button",classNames:y,style:w={}}=i,L=iBe(i,["loading","prefixCls","type","danger","shape","size","styles","disabled","className","rootClassName","children","icon","ghost","block","htmlType","classNames","style"]),{getPrefixCls:D,autoInsertSpaceInButton:E,direction:I,button:k}=x.exports.useContext(Hi),R=D("btn",r),[A,P,N]=X7e(R),M=x.exports.useContext(lS),H=d!=null?d:M,B=x.exports.useContext(Fpe),F=x.exports.useMemo(()=>oBe(o),[o]),[$,z]=x.exports.useState(F.loading),[K,j]=x.exports.useState(!1),X=eh(e,x.exports.createRef()),de=x.exports.Children.count(g)===1&&!p&&!l6(s);x.exports.useEffect(()=>{let ie=null;F.delay>0?ie=setTimeout(()=>{ie=null,z(!0)},F.delay):z(F.loading);function se(){ie&&(clearTimeout(ie),ie=null)}return se},[F]),x.exports.useEffect(()=>{if(!X||!X.current||E===!1)return;const ie=X.current.textContent;de&&vW(ie)?K||j(!0):K&&j(!1)},[X]);const fe=ie=>{const{onClick:se}=i;if($||H){ie.preventDefault();return}se==null||se(ie)},pe=E!==!1,{compactSize:be,compactItemClassnames:Se}=I4(R,I),Fe={large:"lg",small:"sm",middle:void 0},De=Ob(ie=>{var se,U;return(U=(se=c!=null?c:be)!==null&&se!==void 0?se:B)!==null&&U!==void 0?U:ie}),ce=De&&Fe[De]||"",Pe=$?"loading":p,Oe=kf(L,["navigate"]),xe=Ue(R,P,N,{[`${R}-${l}`]:l!=="default"&&l,[`${R}-${s}`]:s,[`${R}-${ce}`]:ce,[`${R}-icon-only`]:!g&&g!==0&&!!Pe,[`${R}-background-ghost`]:v&&!l6(s),[`${R}-loading`]:$,[`${R}-two-chinese-chars`]:K&&pe&&!$,[`${R}-block`]:m,[`${R}-dangerous`]:!!a,[`${R}-rtl`]:I==="rtl"},Se,h,f,k==null?void 0:k.className),Ee=Object.assign(Object.assign({},k==null?void 0:k.style),w),tt=Ue(y==null?void 0:y.icon,(t=k==null?void 0:k.classNames)===null||t===void 0?void 0:t.icon),nt=Object.assign(Object.assign({},(u==null?void 0:u.icon)||{}),((n=k==null?void 0:k.styles)===null||n===void 0?void 0:n.icon)||{}),Qe=p&&!$?he(Wpe,{prefixCls:R,className:tt,style:nt,children:p}):he(M7e,{existIcon:!!p,prefixCls:R,loading:!!$}),Ge=g||g===0?T7e(g,de&&pe):null;if(Oe.href!==void 0)return A(fn("a",{...Object.assign({},Oe,{className:Ue(xe,{[`${R}-disabled`]:H}),href:H?void 0:Oe.href,style:Ee,onClick:fe,ref:X,tabIndex:H?-1:0}),children:[Qe,Ge]}));let re=fn("button",{...Object.assign({},L,{type:_,className:xe,style:Ee,onClick:fe,disabled:H,ref:X}),children:[Qe,Ge,!!Se&&he(nBe,{prefixCls:R},"compact")]});return l6(s)||(re=he(x7e,{component:"Button",disabled:!!$,children:re})),A(re)},ZK=x.exports.forwardRef(rBe);ZK.Group=k7e;ZK.__ANT_BUTTON=!0;var ts=ZK;function pne(i){return!!(i&&i.then)}const sBe=i=>{const{type:e,children:t,prefixCls:n,buttonProps:o,close:r,autoFocus:s,emitEvent:a,isSilent:l,quitOnNullishReturnValue:c,actionFn:u}=i,d=x.exports.useRef(!1),h=x.exports.useRef(null),[f,g]=zm(!1),p=function(){r==null||r.apply(void 0,arguments)};x.exports.useEffect(()=>{let _=null;return s&&(_=setTimeout(()=>{var y;(y=h.current)===null||y===void 0||y.focus()})),()=>{_&&clearTimeout(_)}},[]);const v=_=>{!pne(_)||(g(!0),_.then(function(){g(!1,!0),p.apply(void 0,arguments),d.current=!1},y=>{if(g(!1,!0),d.current=!1,!(l!=null&&l()))return Promise.reject(y)}))},m=_=>{if(d.current)return;if(d.current=!0,!u){p();return}let y;if(a){if(y=u(_),c&&!pne(y)){d.current=!1,p(_);return}}else if(u.length)y=u(r),d.current=!1;else if(y=u(),!y){p();return}v(y)};return x.exports.createElement(ts,Object.assign({},Bpe(e),{onClick:m,loading:f,prefixCls:n},o,{ref:h}),t)};var Upe=sBe;const kI=Bt.createContext({}),{Provider:jpe}=kI,aBe=()=>{const{autoFocusButton:i,cancelButtonProps:e,cancelTextLocale:t,isSilent:n,mergedOkCancel:o,rootPrefixCls:r,close:s,onCancel:a,onConfirm:l}=x.exports.useContext(kI);return o?he(Upe,{isSilent:n,actionFn:a,close:function(){s==null||s.apply(void 0,arguments),l==null||l(!1)},autoFocus:i==="cancel",buttonProps:e,prefixCls:`${r}-btn`,children:t}):null};var mne=aBe;const lBe=()=>{const{autoFocusButton:i,close:e,isSilent:t,okButtonProps:n,rootPrefixCls:o,okTextLocale:r,okType:s,onConfirm:a,onOk:l}=x.exports.useContext(kI);return he(Upe,{isSilent:t,type:s||"primary",actionFn:l,close:function(){e==null||e.apply(void 0,arguments),a==null||a(!0)},autoFocus:i==="ok",buttonProps:n,prefixCls:`${o}-btn`,children:r})};var vne=lBe,Kpe=x.exports.createContext(null),_ne=[];function cBe(i,e){var t=x.exports.useState(function(){if(!Fa())return null;var g=document.createElement("div");return g}),n=Ne(t,1),o=n[0],r=x.exports.useRef(!1),s=x.exports.useContext(Kpe),a=x.exports.useState(_ne),l=Ne(a,2),c=l[0],u=l[1],d=s||(r.current?void 0:function(g){u(function(p){var v=[g].concat(_t(p));return v})});function h(){o.parentElement||document.body.appendChild(o),r.current=!0}function f(){var g;(g=o.parentElement)===null||g===void 0||g.removeChild(o),r.current=!1}return go(function(){return i?s?s(h):h():f(),f},[i]),go(function(){c.length&&(c.forEach(function(g){return g()}),u(_ne))},[c]),[o,d]}var d6;function uBe(i){if(typeof document=="undefined")return 0;if(i||d6===void 0){var e=document.createElement("div");e.style.width="100%",e.style.height="200px";var t=document.createElement("div"),n=t.style;n.position="absolute",n.top="0",n.left="0",n.pointerEvents="none",n.visibility="hidden",n.width="200px",n.height="150px",n.overflow="hidden",t.appendChild(e),document.body.appendChild(t);var o=e.offsetWidth;t.style.overflow="scroll";var r=e.offsetWidth;o===r&&(r=t.clientWidth),document.body.removeChild(t),d6=o-r}return d6}function bne(i){var e=i.match(/^(.*)px$/),t=Number(e==null?void 0:e[1]);return Number.isNaN(t)?uBe():t}function dBe(i){if(typeof document=="undefined"||!i||!(i instanceof Element))return{width:0,height:0};var e=getComputedStyle(i,"::-webkit-scrollbar"),t=e.width,n=e.height;return{width:bne(t),height:bne(n)}}function hBe(){return document.body.scrollHeight>(window.innerHeight||document.documentElement.clientHeight)&&window.innerWidth>document.body.offsetWidth}var fBe="rc-util-locker-".concat(Date.now()),Cne=0;function gBe(i){var e=!!i,t=x.exports.useState(function(){return Cne+=1,"".concat(fBe,"_").concat(Cne)}),n=Ne(t,1),o=n[0];go(function(){if(e){var r=dBe(document.body).width,s=hBe();gv(` html body { overflow-y: hidden; `.concat(s?"width: calc(100% - ".concat(r,"px);"):"",` -}`),o)}else cD(o);return function(){cD(o)}},[e,o])}var fne=!1;function aBe(i){return typeof i=="boolean"&&(fne=i),fne}var gne=function(e){return e===!1?!1:!Oa()||!e?null:typeof e=="string"?document.querySelector(e):typeof e=="function"?e():e},GK=x.exports.forwardRef(function(i,e){var t=i.open,n=i.autoLock,o=i.getContainer;i.debug;var r=i.autoDestroy,s=r===void 0?!0:r,a=i.children,l=x.exports.useState(t),c=Ne(l,2),u=c[0],d=c[1],h=u||t;x.exports.useEffect(function(){(s||t)&&d(t)},[t,s]);var f=x.exports.useState(function(){return gne(o)}),g=Ne(f,2),p=g[0],v=g[1];x.exports.useEffect(function(){var A=gne(o);v(A!=null?A:null)});var m=tBe(h&&!p),_=Ne(m,2),w=_[0],y=_[1],L=p!=null?p:w;sBe(n&&t&&Oa()&&(L===w||L===document.body));var D=null;if(a&&jv(a)&&e){var E=a;D=E.ref}var I=Rb(D,e);if(!h||!Oa()||p===void 0)return null;var k=L===!1||aBe(),R=a;return e&&(R=x.exports.cloneElement(a,{ref:I})),x.exports.createElement(Wpe.Provider,{value:y},k?R:uf.exports.createPortal(R,L))}),Vpe=x.exports.createContext({});function lBe(){var i=Ce({},dI);return i.useId}var pne=0,mne=lBe(),Hpe=mne?function(e){var t=mne();return e||t}:function(e){var t=x.exports.useState("ssr-id"),n=Ne(t,2),o=n[0],r=n[1];return x.exports.useEffect(function(){var s=pne;pne+=1,r("rc_unique_".concat(s))},[]),e||o};function vne(i,e,t){var n=e;return!n&&t&&(n="".concat(i,"-").concat(t)),n}function _ne(i,e){var t=i["page".concat(e?"Y":"X","Offset")],n="scroll".concat(e?"Top":"Left");if(typeof t!="number"){var o=i.document;t=o.documentElement[n],typeof t!="number"&&(t=o.body[n])}return t}function cBe(i){var e=i.getBoundingClientRect(),t={left:e.left,top:e.top},n=i.ownerDocument,o=n.defaultView||n.parentWindow;return t.left+=_ne(o),t.top+=_ne(o,!0),t}var uBe=x.exports.memo(function(i){var e=i.children;return e},function(i,e){var t=e.shouldUpdate;return!t}),bne={width:0,height:0,overflow:"hidden",outline:"none"},$pe=Bt.forwardRef(function(i,e){var t=i.prefixCls,n=i.className,o=i.style,r=i.title,s=i.ariaId,a=i.footer,l=i.closable,c=i.closeIcon,u=i.onClose,d=i.children,h=i.bodyStyle,f=i.bodyProps,g=i.modalRender,p=i.onMouseDown,v=i.onMouseUp,m=i.holderRef,_=i.visible,w=i.forceRender,y=i.width,L=i.height,D=i.classNames,E=i.styles,I=Bt.useContext(Vpe),k=I.panel,R=Rb(m,k),A=x.exports.useRef(),P=x.exports.useRef();Bt.useImperativeHandle(e,function(){return{focus:function(){var z;(z=A.current)===null||z===void 0||z.focus()},changeActive:function(z){var K=document,j=K.activeElement;z&&j===P.current?A.current.focus():!z&&j===A.current&&P.current.focus()}}});var N={};y!==void 0&&(N.width=y),L!==void 0&&(N.height=L);var M;a&&(M=fe("div",{className:Ue("".concat(t,"-footer"),D==null?void 0:D.footer),style:Ce({},E==null?void 0:E.footer),children:a}));var H;r&&(H=fe("div",{className:Ue("".concat(t,"-header"),D==null?void 0:D.header),style:Ce({},E==null?void 0:E.header),children:fe("div",{className:"".concat(t,"-title"),id:s,children:r})}));var W;l&&(W=fe("button",{type:"button",onClick:u,"aria-label":"Close",className:"".concat(t,"-close"),children:c||fe("span",{className:"".concat(t,"-close-x")})}));var F=vn("div",{className:Ue("".concat(t,"-content"),D==null?void 0:D.content),style:E==null?void 0:E.content,children:[W,H,fe("div",{className:Ue("".concat(t,"-body"),D==null?void 0:D.body),style:Ce(Ce({},h),E==null?void 0:E.body),...f,children:d}),M]});return vn("div",{role:"dialog","aria-labelledby":r?s:null,"aria-modal":"true",ref:R,style:Ce(Ce({},o),N),className:Ue(t,n),onMouseDown:p,onMouseUp:v,children:[fe("div",{tabIndex:0,ref:A,style:bne,"aria-hidden":"true"}),fe(uBe,{shouldUpdate:_||w,children:g?g(F):F}),fe("div",{tabIndex:0,ref:P,style:bne,"aria-hidden":"true"})]},"dialog-element")}),zpe=x.exports.forwardRef(function(i,e){var t=i.prefixCls,n=i.title,o=i.style,r=i.className,s=i.visible,a=i.forceRender,l=i.destroyOnClose,c=i.motionName,u=i.ariaId,d=i.onVisibleChanged,h=i.mousePosition,f=x.exports.useRef(),g=x.exports.useState(),p=Ne(g,2),v=p[0],m=p[1],_={};v&&(_.transformOrigin=v);function w(){var y=cBe(f.current);m(h?"".concat(h.x-y.left,"px ").concat(h.y-y.top,"px"):"")}return x.exports.createElement(eh,{visible:s,onVisibleChanged:d,onAppearPrepare:w,onEnterPrepare:w,forceRender:a,motionName:c,removeOnLeave:l,ref:f},function(y,L){var D=y.className,E=y.style;return x.exports.createElement($pe,Ct({},i,{ref:e,title:n,ariaId:u,prefixCls:t,holderRef:L,style:Ce(Ce(Ce({},E),o),_),className:Ue(r,D)}))})});zpe.displayName="Content";function dBe(i){var e=i.prefixCls,t=i.style,n=i.visible,o=i.maskProps,r=i.motionName,s=i.className;return x.exports.createElement(eh,{key:"mask",visible:n,motionName:r,leavedClassName:"".concat(e,"-mask-hidden")},function(a,l){var c=a.className,u=a.style;return x.exports.createElement("div",Ct({ref:l,style:Ce(Ce({},u),t),className:Ue("".concat(e,"-mask"),c,s)},o))})}function hBe(i){var e=i.prefixCls,t=e===void 0?"rc-dialog":e,n=i.zIndex,o=i.visible,r=o===void 0?!1:o,s=i.keyboard,a=s===void 0?!0:s,l=i.focusTriggerAfterClose,c=l===void 0?!0:l,u=i.wrapStyle,d=i.wrapClassName,h=i.wrapProps,f=i.onClose,g=i.afterOpenChange,p=i.afterClose,v=i.transitionName,m=i.animation,_=i.closable,w=_===void 0?!0:_,y=i.mask,L=y===void 0?!0:y,D=i.maskTransitionName,E=i.maskAnimation,I=i.maskClosable,k=I===void 0?!0:I,R=i.maskStyle,A=i.maskProps,P=i.rootClassName,N=i.classNames,M=i.styles,H=x.exports.useRef(),W=x.exports.useRef(),F=x.exports.useRef(),$=x.exports.useState(r),z=Ne($,2),K=z[0],j=z[1],G=Hpe();function X(){UB(W.current,document.activeElement)||(H.current=document.activeElement)}function de(){if(!UB(W.current,document.activeElement)){var Oe;(Oe=F.current)===null||Oe===void 0||Oe.focus()}}function he(Oe){if(Oe)de();else{if(j(!1),L&&H.current&&c){try{H.current.focus({preventScroll:!0})}catch{}H.current=null}K&&(p==null||p())}g==null||g(Oe)}function pe(Oe){f==null||f(Oe)}var be=x.exports.useRef(!1),Se=x.exports.useRef(),Fe=function(){clearTimeout(Se.current),be.current=!0},De=function(){Se.current=setTimeout(function(){be.current=!1})},ce=null;k&&(ce=function(xe){be.current?be.current=!1:W.current===xe.target&&pe(xe)});function Pe(Oe){if(a&&Oe.keyCode===at.ESC){Oe.stopPropagation(),pe(Oe);return}r&&Oe.keyCode===at.TAB&&F.current.changeActive(!Oe.shiftKey)}return x.exports.useEffect(function(){r&&(j(!0),X())},[r]),x.exports.useEffect(function(){return function(){clearTimeout(Se.current)}},[]),x.exports.createElement("div",Ct({className:Ue("".concat(t,"-root"),P)},z0(i,{data:!0})),x.exports.createElement(dBe,{prefixCls:t,visible:L&&r,motionName:vne(t,D,E),style:Ce(Ce({zIndex:n},R),M==null?void 0:M.mask),maskProps:A,className:N==null?void 0:N.mask}),x.exports.createElement("div",Ct({tabIndex:-1,onKeyDown:Pe,className:Ue("".concat(t,"-wrap"),d,N==null?void 0:N.wrapper),ref:W,onClick:ce,style:Ce(Ce(Ce({zIndex:n},u),M==null?void 0:M.wrapper),{},{display:K?null:"none"})},h),x.exports.createElement(zpe,Ct({},i,{onMouseDown:Fe,onMouseUp:De,ref:F,closable:w,ariaId:G,prefixCls:t,visible:r&&K,onClose:pe,onVisibleChanged:he,motionName:vne(t,v,m)}))))}var Upe=function(e){var t=e.visible,n=e.getContainer,o=e.forceRender,r=e.destroyOnClose,s=r===void 0?!1:r,a=e.afterClose,l=e.panelRef,c=x.exports.useState(t),u=Ne(c,2),d=u[0],h=u[1],f=x.exports.useMemo(function(){return{panel:l}},[l]);return x.exports.useEffect(function(){t&&h(!0)},[t]),!o&&s&&!d?null:x.exports.createElement(Vpe.Provider,{value:f},x.exports.createElement(GK,{open:t||o||d,autoDestroy:!1,getContainer:n,autoLock:t||d},x.exports.createElement(hBe,Ct({},e,{destroyOnClose:s,afterClose:function(){a==null||a(),h(!1)}}))))};Upe.displayName="Dialog";function fBe(i,e,t){return typeof i=="boolean"?i:e===void 0?!!t:e!==!1&&e!==null}function gBe(i,e,t){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:Bt.createElement(cS,null),o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;if(!fBe(i,e,o))return[!1,null];const s=typeof e=="boolean"||e===void 0||e===null?n:e;return[!0,t?t(s):s]}const pBe=()=>Oa()&&window.document.documentElement;var n0="RC_FORM_INTERNAL_HOOKS",bo=function(){rr(!1,"Can not find FormContext. Please make sure you wrap Field under Form.")},j0=x.exports.createContext({getFieldValue:bo,getFieldsValue:bo,getFieldError:bo,getFieldWarning:bo,getFieldsError:bo,isFieldsTouched:bo,isFieldTouched:bo,isFieldValidating:bo,isFieldsValidating:bo,resetFields:bo,setFields:bo,setFieldValue:bo,setFieldsValue:bo,validateFields:bo,submit:bo,getInternalHooks:function(){return bo(),{dispatch:bo,initEntityValue:bo,registerField:bo,useSubscribe:bo,setInitialValues:bo,destroyForm:bo,setCallbacks:bo,registerWatch:bo,getFields:bo,setValidateMessages:bo,setPreserve:bo,getInitialValue:bo}}}),gD=x.exports.createContext(null);function pW(i){return i==null?[]:Array.isArray(i)?i:[i]}function mBe(i){return i&&!!i._init}function i0(){return i0=Object.assign?Object.assign.bind():function(i){for(var e=1;e1?e-1:0),n=1;n=r)return a;switch(a){case"%s":return String(t[o++]);case"%d":return Number(t[o++]);case"%j":try{return JSON.stringify(t[o++])}catch{return"[Circular]"}break;default:return a}});return s}return i}function yBe(i){return i==="string"||i==="url"||i==="hex"||i==="email"||i==="date"||i==="pattern"}function ys(i,e){return!!(i==null||e==="array"&&Array.isArray(i)&&!i.length||yBe(e)&&typeof i=="string"&&!i)}function SBe(i,e,t){var n=[],o=0,r=i.length;function s(a){n.push.apply(n,a||[]),o++,o===r&&t(n)}i.forEach(function(a){e(a,s)})}function Cne(i,e,t){var n=0,o=i.length;function r(s){if(s&&s.length){t(s);return}var a=n;n=n+1,a3&&arguments[3]!==void 0?arguments[3]:Bt.createElement(uS,null),o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;if(!yBe(i,e,o))return[!1,null];const s=typeof e=="boolean"||e===void 0||e===null?n:e;return[!0,t?t(s):s]}const SBe=()=>Fa()&&window.document.documentElement;var i0="RC_FORM_INTERNAL_HOOKS",bo=function(){rr(!1,"Can not find FormContext. Please make sure you wrap Field under Form.")},K0=x.exports.createContext({getFieldValue:bo,getFieldsValue:bo,getFieldError:bo,getFieldWarning:bo,getFieldsError:bo,isFieldsTouched:bo,isFieldTouched:bo,isFieldValidating:bo,isFieldsValidating:bo,resetFields:bo,setFields:bo,setFieldValue:bo,setFieldsValue:bo,validateFields:bo,submit:bo,getInternalHooks:function(){return bo(),{dispatch:bo,initEntityValue:bo,registerField:bo,useSubscribe:bo,setInitialValues:bo,destroyForm:bo,setCallbacks:bo,registerWatch:bo,getFields:bo,setValidateMessages:bo,setPreserve:bo,getInitialValue:bo}}}),pD=x.exports.createContext(null);function _W(i){return i==null?[]:Array.isArray(i)?i:[i]}function xBe(i){return i&&!!i._init}function o0(){return o0=Object.assign?Object.assign.bind():function(i){for(var e=1;e1?e-1:0),n=1;n=r)return a;switch(a){case"%s":return String(t[o++]);case"%d":return Number(t[o++]);case"%j":try{return JSON.stringify(t[o++])}catch{return"[Circular]"}break;default:return a}});return s}return i}function TBe(i){return i==="string"||i==="url"||i==="hex"||i==="email"||i==="date"||i==="pattern"}function Ss(i,e){return!!(i==null||e==="array"&&Array.isArray(i)&&!i.length||TBe(e)&&typeof i=="string"&&!i)}function NBe(i,e,t){var n=[],o=0,r=i.length;function s(a){n.push.apply(n,a||[]),o++,o===r&&t(n)}i.forEach(function(a){e(a,s)})}function kne(i,e,t){var n=0,o=i.length;function r(s){if(s&&s.length){t(s);return}var a=n;n=n+1,a()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+\.)+[a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}))$/,hex:/^#?([a-f0-9]{6}|[a-f0-9]{3})$/i},gL={integer:function(e){return gL.number(e)&&parseInt(e,10)===e},float:function(e){return gL.number(e)&&!gL.integer(e)},array:function(e){return Array.isArray(e)},regexp:function(e){if(e instanceof RegExp)return!0;try{return!!new RegExp(e)}catch{return!1}},date:function(e){return typeof e.getTime=="function"&&typeof e.getMonth=="function"&&typeof e.getYear=="function"&&!isNaN(e.getTime())},number:function(e){return isNaN(e)?!1:typeof e=="number"},object:function(e){return typeof e=="object"&&!gL.array(e)},method:function(e){return typeof e=="function"},email:function(e){return typeof e=="string"&&e.length<=320&&!!e.match(xne.email)},url:function(e){return typeof e=="string"&&e.length<=2048&&!!e.match(IBe())},hex:function(e){return typeof e=="string"&&!!e.match(xne.hex)}},TBe=function(e,t,n,o,r){if(e.required&&t===void 0){jpe(e,t,n,o,r);return}var s=["integer","float","array","regexp","object","method","email","number","date","url","hex"],a=e.type;s.indexOf(a)>-1?gL[a](t)||o.push(Ec(r.messages.types[a],e.fullField,e.type)):a&&typeof t!==e.type&&o.push(Ec(r.messages.types[a],e.fullField,e.type))},NBe=function(e,t,n,o,r){var s=typeof e.len=="number",a=typeof e.min=="number",l=typeof e.max=="number",c=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,u=t,d=null,h=typeof t=="number",f=typeof t=="string",g=Array.isArray(t);if(h?d="number":f?d="string":g&&(d="array"),!d)return!1;g&&(u=t.length),f&&(u=t.replace(c,"_").length),s?u!==e.len&&o.push(Ec(r.messages[d].len,e.fullField,e.len)):a&&!l&&ue.max?o.push(Ec(r.messages[d].max,e.fullField,e.max)):a&&l&&(ue.max)&&o.push(Ec(r.messages[d].range,e.fullField,e.min,e.max))},E1="enum",RBe=function(e,t,n,o,r){e[E1]=Array.isArray(e[E1])?e[E1]:[],e[E1].indexOf(t)===-1&&o.push(Ec(r.messages[E1],e.fullField,e[E1].join(", ")))},MBe=function(e,t,n,o,r){if(e.pattern){if(e.pattern instanceof RegExp)e.pattern.lastIndex=0,e.pattern.test(t)||o.push(Ec(r.messages.pattern.mismatch,e.fullField,t,e.pattern));else if(typeof e.pattern=="string"){var s=new RegExp(e.pattern);s.test(t)||o.push(Ec(r.messages.pattern.mismatch,e.fullField,t,e.pattern))}}},ki={required:jpe,whitespace:kBe,type:TBe,range:NBe,enum:RBe,pattern:MBe},ABe=function(e,t,n,o,r){var s=[],a=e.required||!e.required&&o.hasOwnProperty(e.field);if(a){if(ys(t,"string")&&!e.required)return n();ki.required(e,t,o,s,r,"string"),ys(t,"string")||(ki.type(e,t,o,s,r),ki.range(e,t,o,s,r),ki.pattern(e,t,o,s,r),e.whitespace===!0&&ki.whitespace(e,t,o,s,r))}n(s)},PBe=function(e,t,n,o,r){var s=[],a=e.required||!e.required&&o.hasOwnProperty(e.field);if(a){if(ys(t)&&!e.required)return n();ki.required(e,t,o,s,r),t!==void 0&&ki.type(e,t,o,s,r)}n(s)},OBe=function(e,t,n,o,r){var s=[],a=e.required||!e.required&&o.hasOwnProperty(e.field);if(a){if(t===""&&(t=void 0),ys(t)&&!e.required)return n();ki.required(e,t,o,s,r),t!==void 0&&(ki.type(e,t,o,s,r),ki.range(e,t,o,s,r))}n(s)},FBe=function(e,t,n,o,r){var s=[],a=e.required||!e.required&&o.hasOwnProperty(e.field);if(a){if(ys(t)&&!e.required)return n();ki.required(e,t,o,s,r),t!==void 0&&ki.type(e,t,o,s,r)}n(s)},BBe=function(e,t,n,o,r){var s=[],a=e.required||!e.required&&o.hasOwnProperty(e.field);if(a){if(ys(t)&&!e.required)return n();ki.required(e,t,o,s,r),ys(t)||ki.type(e,t,o,s,r)}n(s)},WBe=function(e,t,n,o,r){var s=[],a=e.required||!e.required&&o.hasOwnProperty(e.field);if(a){if(ys(t)&&!e.required)return n();ki.required(e,t,o,s,r),t!==void 0&&(ki.type(e,t,o,s,r),ki.range(e,t,o,s,r))}n(s)},VBe=function(e,t,n,o,r){var s=[],a=e.required||!e.required&&o.hasOwnProperty(e.field);if(a){if(ys(t)&&!e.required)return n();ki.required(e,t,o,s,r),t!==void 0&&(ki.type(e,t,o,s,r),ki.range(e,t,o,s,r))}n(s)},HBe=function(e,t,n,o,r){var s=[],a=e.required||!e.required&&o.hasOwnProperty(e.field);if(a){if(t==null&&!e.required)return n();ki.required(e,t,o,s,r,"array"),t!=null&&(ki.type(e,t,o,s,r),ki.range(e,t,o,s,r))}n(s)},$Be=function(e,t,n,o,r){var s=[],a=e.required||!e.required&&o.hasOwnProperty(e.field);if(a){if(ys(t)&&!e.required)return n();ki.required(e,t,o,s,r),t!==void 0&&ki.type(e,t,o,s,r)}n(s)},zBe="enum",UBe=function(e,t,n,o,r){var s=[],a=e.required||!e.required&&o.hasOwnProperty(e.field);if(a){if(ys(t)&&!e.required)return n();ki.required(e,t,o,s,r),t!==void 0&&ki[zBe](e,t,o,s,r)}n(s)},jBe=function(e,t,n,o,r){var s=[],a=e.required||!e.required&&o.hasOwnProperty(e.field);if(a){if(ys(t,"string")&&!e.required)return n();ki.required(e,t,o,s,r),ys(t,"string")||ki.pattern(e,t,o,s,r)}n(s)},KBe=function(e,t,n,o,r){var s=[],a=e.required||!e.required&&o.hasOwnProperty(e.field);if(a){if(ys(t,"date")&&!e.required)return n();if(ki.required(e,t,o,s,r),!ys(t,"date")){var l;t instanceof Date?l=t:l=new Date(t),ki.type(e,l,o,s,r),l&&ki.range(e,l.getTime(),o,s,r)}}n(s)},qBe=function(e,t,n,o,r){var s=[],a=Array.isArray(t)?"array":typeof t;ki.required(e,t,o,s,r,a),n(s)},h6=function(e,t,n,o,r){var s=e.type,a=[],l=e.required||!e.required&&o.hasOwnProperty(e.field);if(l){if(ys(t,s)&&!e.required)return n();ki.required(e,t,o,a,r,s),ys(t,s)||ki.type(e,t,o,a,r)}n(a)},GBe=function(e,t,n,o,r){var s=[],a=e.required||!e.required&&o.hasOwnProperty(e.field);if(a){if(ys(t)&&!e.required)return n();ki.required(e,t,o,s,r)}n(s)},nE={string:ABe,method:PBe,number:OBe,boolean:FBe,regexp:BBe,integer:WBe,float:VBe,array:HBe,object:$Be,enum:UBe,pattern:jBe,date:KBe,url:h6,hex:h6,email:h6,required:qBe,any:GBe};function bW(){return{default:"Validation error on field %s",required:"%s is required",enum:"%s must be one of %s",whitespace:"%s cannot be empty",date:{format:"%s date %s is invalid for format %s",parse:"%s date could not be parsed, %s is invalid ",invalid:"%s date %s is invalid"},types:{string:"%s is not a %s",method:"%s is not a %s (function)",array:"%s is not an %s",object:"%s is not an %s",number:"%s is not a %s",date:"%s is not a %s",boolean:"%s is not a %s",integer:"%s is not an %s",float:"%s is not a %s",regexp:"%s is not a valid %s",email:"%s is not a valid %s",url:"%s is not a valid %s",hex:"%s is not a valid %s"},string:{len:"%s must be exactly %s characters",min:"%s must be at least %s characters",max:"%s cannot be longer than %s characters",range:"%s must be between %s and %s characters"},number:{len:"%s must equal %s",min:"%s cannot be less than %s",max:"%s cannot be greater than %s",range:"%s must be between %s and %s"},array:{len:"%s must be exactly %s in length",min:"%s cannot be less than %s in length",max:"%s cannot be greater than %s in length",range:"%s must be between %s and %s in length"},pattern:{mismatch:"%s value %s does not match pattern %s"},clone:function(){var e=JSON.parse(JSON.stringify(this));return e.clone=this.clone,e}}}var CW=bW(),DI=function(){function i(t){this.rules=null,this._messages=CW,this.define(t)}var e=i.prototype;return e.define=function(n){var o=this;if(!n)throw new Error("Cannot configure a schema with no rules");if(typeof n!="object"||Array.isArray(n))throw new Error("Rules must be an object");this.rules={},Object.keys(n).forEach(function(r){var s=n[r];o.rules[r]=Array.isArray(s)?s:[s]})},e.messages=function(n){return n&&(this._messages=Sne(bW(),n)),this._messages},e.validate=function(n,o,r){var s=this;o===void 0&&(o={}),r===void 0&&(r=function(){});var a=n,l=o,c=r;if(typeof l=="function"&&(c=l,l={}),!this.rules||Object.keys(this.rules).length===0)return c&&c(null,a),Promise.resolve(a);function u(p){var v=[],m={};function _(y){if(Array.isArray(y)){var L;v=(L=v).concat.apply(L,y)}else v.push(y)}for(var w=0;w2&&arguments[2]!==void 0?arguments[2]:!1;return i&&i.some(function(n){return qpe(e,n,t)})}function qpe(i,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return!i||!e||!t&&i.length!==e.length?!1:e.every(function(n,o){return i[o]===n})}function JBe(i,e){if(i===e)return!0;if(!i&&e||i&&!e||!i||!e||Kn(i)!=="object"||Kn(e)!=="object")return!1;var t=Object.keys(i),n=Object.keys(e),o=new Set([].concat(t,n));return _t(o).every(function(r){var s=i[r],a=e[r];return typeof s=="function"&&typeof a=="function"?!0:s===a})}function eWe(i){var e=arguments.length<=1?void 0:arguments[1];return e&&e.target&&Kn(e.target)==="object"&&i in e.target?e.target[i]:e}function kne(i,e,t){var n=i.length;if(e<0||e>=n||t<0||t>=n)return i;var o=i[e],r=e-t;return r>0?[].concat(_t(i.slice(0,t)),[o],_t(i.slice(t,e)),_t(i.slice(e+1,n))):r<0?[].concat(_t(i.slice(0,e)),_t(i.slice(e+1,t+1)),[o],_t(i.slice(t+1,n))):i}var tWe=["name"],au=[];function Ine(i,e,t,n,o,r){return typeof i=="function"?i(e,t,"source"in r?{source:r.source}:{}):n!==o}var XK=function(i){dp(t,i);var e=Mb(t);function t(n){var o;if(fa(this,t),o=e.call(this,n),me(ci(o),"state",{resetCount:0}),me(ci(o),"cancelRegisterFunc",null),me(ci(o),"mounted",!1),me(ci(o),"touched",!1),me(ci(o),"dirty",!1),me(ci(o),"validatePromise",void 0),me(ci(o),"prevValidating",void 0),me(ci(o),"errors",au),me(ci(o),"warnings",au),me(ci(o),"cancelRegister",function(){var l=o.props,c=l.preserve,u=l.isListField,d=l.name;o.cancelRegisterFunc&&o.cancelRegisterFunc(u,c,Ar(d)),o.cancelRegisterFunc=null}),me(ci(o),"getNamePath",function(){var l=o.props,c=l.name,u=l.fieldContext,d=u.prefixName,h=d===void 0?[]:d;return c!==void 0?[].concat(_t(h),_t(c)):[]}),me(ci(o),"getRules",function(){var l=o.props,c=l.rules,u=c===void 0?[]:c,d=l.fieldContext;return u.map(function(h){return typeof h=="function"?h(d):h})}),me(ci(o),"refresh",function(){!o.mounted||o.setState(function(l){var c=l.resetCount;return{resetCount:c+1}})}),me(ci(o),"metaCache",null),me(ci(o),"triggerMetaEvent",function(l){var c=o.props.onMetaChange;if(c){var u=Ce(Ce({},o.getMeta()),{},{destroy:l});_4(o.metaCache,u)||c(u),o.metaCache=u}else o.metaCache=null}),me(ci(o),"onStoreChange",function(l,c,u){var d=o.props,h=d.shouldUpdate,f=d.dependencies,g=f===void 0?[]:f,p=d.onReset,v=u.store,m=o.getNamePath(),_=o.getValue(l),w=o.getValue(v),y=c&&hw(c,m);switch(u.type==="valueUpdate"&&u.source==="external"&&_!==w&&(o.touched=!0,o.dirty=!0,o.validatePromise=null,o.errors=au,o.warnings=au,o.triggerMetaEvent()),u.type){case"reset":if(!c||y){o.touched=!1,o.dirty=!1,o.validatePromise=void 0,o.errors=au,o.warnings=au,o.triggerMetaEvent(),p==null||p(),o.refresh();return}break;case"remove":{if(h){o.reRender();return}break}case"setField":{var L=u.data;if(y){"touched"in L&&(o.touched=L.touched),"validating"in L&&!("originRCField"in L)&&(o.validatePromise=L.validating?Promise.resolve([]):null),"errors"in L&&(o.errors=L.errors||au),"warnings"in L&&(o.warnings=L.warnings||au),o.dirty=!0,o.triggerMetaEvent(),o.reRender();return}else if("value"in L&&hw(c,m,!0)){o.reRender();return}if(h&&!m.length&&Ine(h,l,v,_,w,u)){o.reRender();return}break}case"dependenciesUpdate":{var D=g.map(Ar);if(D.some(function(E){return hw(u.relatedFields,E)})){o.reRender();return}break}default:if(y||(!g.length||m.length||h)&&Ine(h,l,v,_,w,u)){o.reRender();return}break}h===!0&&o.reRender()}),me(ci(o),"validateRules",function(l){var c=o.getNamePath(),u=o.getValue(),d=l||{},h=d.triggerName,f=d.validateOnly,g=f===void 0?!1:f,p=Promise.resolve().then(Ab(ul().mark(function v(){var m,_,w,y,L,D,E;return ul().wrap(function(k){for(;;)switch(k.prev=k.next){case 0:if(o.mounted){k.next=2;break}return k.abrupt("return",[]);case 2:if(m=o.props,_=m.validateFirst,w=_===void 0?!1:_,y=m.messageVariables,L=m.validateDebounce,D=o.getRules(),h&&(D=D.filter(function(R){return R}).filter(function(R){var A=R.validateTrigger;if(!A)return!0;var P=pW(A);return P.includes(h)})),!(L&&h)){k.next=10;break}return k.next=8,new Promise(function(R){setTimeout(R,L)});case 8:if(o.validatePromise===p){k.next=10;break}return k.abrupt("return",[]);case 10:return E=YBe(c,u,D,l,w,y),E.catch(function(R){return R}).then(function(){var R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:au;if(o.validatePromise===p){var A;o.validatePromise=null;var P=[],N=[];(A=R.forEach)===null||A===void 0||A.call(R,function(M){var H=M.rule.warningOnly,W=M.errors,F=W===void 0?au:W;H?N.push.apply(N,_t(F)):P.push.apply(P,_t(F))}),o.errors=P,o.warnings=N,o.triggerMetaEvent(),o.reRender()}}),k.abrupt("return",E);case 13:case"end":return k.stop()}},v)})));return g||(o.validatePromise=p,o.dirty=!0,o.errors=au,o.warnings=au,o.triggerMetaEvent(),o.reRender()),p}),me(ci(o),"isFieldValidating",function(){return!!o.validatePromise}),me(ci(o),"isFieldTouched",function(){return o.touched}),me(ci(o),"isFieldDirty",function(){if(o.dirty||o.props.initialValue!==void 0)return!0;var l=o.props.fieldContext,c=l.getInternalHooks(n0),u=c.getInitialValue;return u(o.getNamePath())!==void 0}),me(ci(o),"getErrors",function(){return o.errors}),me(ci(o),"getWarnings",function(){return o.warnings}),me(ci(o),"isListField",function(){return o.props.isListField}),me(ci(o),"isList",function(){return o.props.isList}),me(ci(o),"isPreserve",function(){return o.props.preserve}),me(ci(o),"getMeta",function(){o.prevValidating=o.isFieldValidating();var l={touched:o.isFieldTouched(),validating:o.prevValidating,errors:o.errors,warnings:o.warnings,name:o.getNamePath(),validated:o.validatePromise===null};return l}),me(ci(o),"getOnlyChild",function(l){if(typeof l=="function"){var c=o.getMeta();return Ce(Ce({},o.getOnlyChild(l(o.getControlled(),c,o.props.fieldContext))),{},{isFunction:!0})}var u=np(l);return u.length!==1||!x.exports.isValidElement(u[0])?{child:u,isFunction:!1}:{child:u[0],isFunction:!1}}),me(ci(o),"getValue",function(l){var c=o.props.fieldContext.getFieldsValue,u=o.getNamePath();return zh(l||c(!0),u)}),me(ci(o),"getControlled",function(){var l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},c=o.props,u=c.trigger,d=c.validateTrigger,h=c.getValueFromEvent,f=c.normalize,g=c.valuePropName,p=c.getValueProps,v=c.fieldContext,m=d!==void 0?d:v.validateTrigger,_=o.getNamePath(),w=v.getInternalHooks,y=v.getFieldsValue,L=w(n0),D=L.dispatch,E=o.getValue(),I=p||function(P){return me({},g,P)},k=l[u],R=Ce(Ce({},l),I(E));R[u]=function(){o.touched=!0,o.dirty=!0,o.triggerMetaEvent();for(var P,N=arguments.length,M=new Array(N),H=0;H=0&&R<=A.length?(u.keys=[].concat(_t(u.keys.slice(0,R)),[u.id],_t(u.keys.slice(R))),w([].concat(_t(A.slice(0,R)),[k],_t(A.slice(R))))):(u.keys=[].concat(_t(u.keys),[u.id]),w([].concat(_t(A),[k]))),u.id+=1},remove:function(k){var R=L(),A=new Set(Array.isArray(k)?k:[k]);A.size<=0||(u.keys=u.keys.filter(function(P,N){return!A.has(N)}),w(R.filter(function(P,N){return!A.has(N)})))},move:function(k,R){if(k!==R){var A=L();k<0||k>=A.length||R<0||R>=A.length||(u.keys=kne(u.keys,k,R),w(kne(A,k,R)))}}},E=_||[];return Array.isArray(E)||(E=[]),n(E.map(function(I,k){var R=u.keys[k];return R===void 0&&(u.keys[k]=u.id,R=u.keys[k],u.id+=1),{name:k,key:R,isListField:!0}}),D,v)})))}function nWe(i){var e=!1,t=i.length,n=[];return i.length?new Promise(function(o,r){i.forEach(function(s,a){s.catch(function(l){return e=!0,l}).then(function(l){t-=1,n[a]=l,!(t>0)&&(e&&r(n),o(n))})})}):Promise.resolve([])}var Xpe="__@field_split__";function f6(i){return i.map(function(e){return"".concat(Kn(e),":").concat(e)}).join(Xpe)}var D1=function(){function i(){fa(this,i),me(this,"kvs",new Map)}return ga(i,[{key:"set",value:function(t,n){this.kvs.set(f6(t),n)}},{key:"get",value:function(t){return this.kvs.get(f6(t))}},{key:"update",value:function(t,n){var o=this.get(t),r=n(o);r?this.set(t,r):this.delete(t)}},{key:"delete",value:function(t){this.kvs.delete(f6(t))}},{key:"map",value:function(t){return _t(this.kvs.entries()).map(function(n){var o=Ne(n,2),r=o[0],s=o[1],a=r.split(Xpe);return t({key:a.map(function(l){var c=l.match(/^([^:]*):(.*)$/),u=Ne(c,3),d=u[1],h=u[2];return d==="number"?Number(h):h}),value:s})})}},{key:"toJSON",value:function(){var t={};return this.map(function(n){var o=n.key,r=n.value;return t[o.join(".")]=r,null}),t}}]),i}(),iWe=["name"],oWe=ga(function i(e){var t=this;fa(this,i),me(this,"formHooked",!1),me(this,"forceRootUpdate",void 0),me(this,"subscribable",!0),me(this,"store",{}),me(this,"fieldEntities",[]),me(this,"initialValues",{}),me(this,"callbacks",{}),me(this,"validateMessages",null),me(this,"preserve",null),me(this,"lastValidatePromise",null),me(this,"getForm",function(){return{getFieldValue:t.getFieldValue,getFieldsValue:t.getFieldsValue,getFieldError:t.getFieldError,getFieldWarning:t.getFieldWarning,getFieldsError:t.getFieldsError,isFieldsTouched:t.isFieldsTouched,isFieldTouched:t.isFieldTouched,isFieldValidating:t.isFieldValidating,isFieldsValidating:t.isFieldsValidating,resetFields:t.resetFields,setFields:t.setFields,setFieldValue:t.setFieldValue,setFieldsValue:t.setFieldsValue,validateFields:t.validateFields,submit:t.submit,_init:!0,getInternalHooks:t.getInternalHooks}}),me(this,"getInternalHooks",function(n){return n===n0?(t.formHooked=!0,{dispatch:t.dispatch,initEntityValue:t.initEntityValue,registerField:t.registerField,useSubscribe:t.useSubscribe,setInitialValues:t.setInitialValues,destroyForm:t.destroyForm,setCallbacks:t.setCallbacks,setValidateMessages:t.setValidateMessages,getFields:t.getFields,setPreserve:t.setPreserve,getInitialValue:t.getInitialValue,registerWatch:t.registerWatch}):(rr(!1,"`getInternalHooks` is internal usage. Should not call directly."),null)}),me(this,"useSubscribe",function(n){t.subscribable=n}),me(this,"prevWithoutPreserves",null),me(this,"setInitialValues",function(n,o){if(t.initialValues=n||{},o){var r,s=SC(n,t.store);(r=t.prevWithoutPreserves)===null||r===void 0||r.map(function(a){var l=a.key;s=gd(s,l,zh(n,l))}),t.prevWithoutPreserves=null,t.updateStore(s)}}),me(this,"destroyForm",function(){var n=new D1;t.getFieldEntities(!0).forEach(function(o){t.isMergedPreserve(o.isPreserve())||n.set(o.getNamePath(),!0)}),t.prevWithoutPreserves=n}),me(this,"getInitialValue",function(n){var o=zh(t.initialValues,n);return n.length?SC(o):o}),me(this,"setCallbacks",function(n){t.callbacks=n}),me(this,"setValidateMessages",function(n){t.validateMessages=n}),me(this,"setPreserve",function(n){t.preserve=n}),me(this,"watchList",[]),me(this,"registerWatch",function(n){return t.watchList.push(n),function(){t.watchList=t.watchList.filter(function(o){return o!==n})}}),me(this,"notifyWatch",function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];if(t.watchList.length){var o=t.getFieldsValue(),r=t.getFieldsValue(!0);t.watchList.forEach(function(s){s(o,r,n)})}}),me(this,"timeoutId",null),me(this,"warningUnhooked",function(){}),me(this,"updateStore",function(n){t.store=n}),me(this,"getFieldEntities",function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return n?t.fieldEntities.filter(function(o){return o.getNamePath().length}):t.fieldEntities}),me(this,"getFieldsMap",function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,o=new D1;return t.getFieldEntities(n).forEach(function(r){var s=r.getNamePath();o.set(s,r)}),o}),me(this,"getFieldEntitiesForNamePathList",function(n){if(!n)return t.getFieldEntities(!0);var o=t.getFieldsMap(!0);return n.map(function(r){var s=Ar(r);return o.get(s)||{INVALIDATE_NAME_PATH:Ar(r)}})}),me(this,"getFieldsValue",function(n,o){t.warningUnhooked();var r,s,a;if(n===!0||Array.isArray(n)?(r=n,s=o):n&&Kn(n)==="object"&&(a=n.strict,s=n.filter),r===!0&&!s)return t.store;var l=t.getFieldEntitiesForNamePathList(Array.isArray(r)?r:null),c=[];return l.forEach(function(u){var d,h,f="INVALIDATE_NAME_PATH"in u?u.INVALIDATE_NAME_PATH:u.getNamePath();if(a){var g,p;if((g=(p=u).isList)!==null&&g!==void 0&&g.call(p))return}else if(!r&&(d=(h=u).isListField)!==null&&d!==void 0&&d.call(h))return;if(!s)c.push(f);else{var v="getMeta"in u?u.getMeta():null;s(v)&&c.push(f)}}),Dne(t.store,c.map(Ar))}),me(this,"getFieldValue",function(n){t.warningUnhooked();var o=Ar(n);return zh(t.store,o)}),me(this,"getFieldsError",function(n){t.warningUnhooked();var o=t.getFieldEntitiesForNamePathList(n);return o.map(function(r,s){return r&&!("INVALIDATE_NAME_PATH"in r)?{name:r.getNamePath(),errors:r.getErrors(),warnings:r.getWarnings()}:{name:Ar(n[s]),errors:[],warnings:[]}})}),me(this,"getFieldError",function(n){t.warningUnhooked();var o=Ar(n),r=t.getFieldsError([o])[0];return r.errors}),me(this,"getFieldWarning",function(n){t.warningUnhooked();var o=Ar(n),r=t.getFieldsError([o])[0];return r.warnings}),me(this,"isFieldsTouched",function(){t.warningUnhooked();for(var n=arguments.length,o=new Array(n),r=0;r0&&arguments[0]!==void 0?arguments[0]:{},o=new D1,r=t.getFieldEntities(!0);r.forEach(function(l){var c=l.props.initialValue,u=l.getNamePath();if(c!==void 0){var d=o.get(u)||new Set;d.add({entity:l,value:c}),o.set(u,d)}});var s=function(c){c.forEach(function(u){var d=u.props.initialValue;if(d!==void 0){var h=u.getNamePath(),f=t.getInitialValue(h);if(f!==void 0)rr(!1,"Form already set 'initialValues' with path '".concat(h.join("."),"'. Field can not overwrite it."));else{var g=o.get(h);if(g&&g.size>1)rr(!1,"Multiple Field with path '".concat(h.join("."),"' set 'initialValue'. Can not decide which one to pick."));else if(g){var p=t.getFieldValue(h),v=u.isListField();!v&&(!n.skipExist||p===void 0)&&t.updateStore(gd(t.store,h,_t(g)[0].value))}}}})},a;n.entities?a=n.entities:n.namePathList?(a=[],n.namePathList.forEach(function(l){var c=o.get(l);if(c){var u;(u=a).push.apply(u,_t(_t(c).map(function(d){return d.entity})))}})):a=r,s(a)}),me(this,"resetFields",function(n){t.warningUnhooked();var o=t.store;if(!n){t.updateStore(SC(t.initialValues)),t.resetWithFieldInitialValue(),t.notifyObservers(o,null,{type:"reset"}),t.notifyWatch();return}var r=n.map(Ar);r.forEach(function(s){var a=t.getInitialValue(s);t.updateStore(gd(t.store,s,a))}),t.resetWithFieldInitialValue({namePathList:r}),t.notifyObservers(o,r,{type:"reset"}),t.notifyWatch(r)}),me(this,"setFields",function(n){t.warningUnhooked();var o=t.store,r=[];n.forEach(function(s){var a=s.name,l=Hn(s,iWe),c=Ar(a);r.push(c),"value"in l&&t.updateStore(gd(t.store,c,l.value)),t.notifyObservers(o,[c],{type:"setField",data:s})}),t.notifyWatch(r)}),me(this,"getFields",function(){var n=t.getFieldEntities(!0),o=n.map(function(r){var s=r.getNamePath(),a=r.getMeta(),l=Ce(Ce({},a),{},{name:s,value:t.getFieldValue(s)});return Object.defineProperty(l,"originRCField",{value:!0}),l});return o}),me(this,"initEntityValue",function(n){var o=n.props.initialValue;if(o!==void 0){var r=n.getNamePath(),s=zh(t.store,r);s===void 0&&t.updateStore(gd(t.store,r,o))}}),me(this,"isMergedPreserve",function(n){var o=n!==void 0?n:t.preserve;return o!=null?o:!0}),me(this,"registerField",function(n){t.fieldEntities.push(n);var o=n.getNamePath();if(t.notifyWatch([o]),n.props.initialValue!==void 0){var r=t.store;t.resetWithFieldInitialValue({entities:[n],skipExist:!0}),t.notifyObservers(r,[n.getNamePath()],{type:"valueUpdate",source:"internal"})}return function(s,a){var l=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];if(t.fieldEntities=t.fieldEntities.filter(function(d){return d!==n}),!t.isMergedPreserve(a)&&(!s||l.length>1)){var c=s?void 0:t.getInitialValue(o);if(o.length&&t.getFieldValue(o)!==c&&t.fieldEntities.every(function(d){return!qpe(d.getNamePath(),o)})){var u=t.store;t.updateStore(gd(u,o,c,!0)),t.notifyObservers(u,[o],{type:"remove"}),t.triggerDependenciesUpdate(u,o)}}t.notifyWatch([o])}}),me(this,"dispatch",function(n){switch(n.type){case"updateValue":{var o=n.namePath,r=n.value;t.updateValue(o,r);break}case"validateField":{var s=n.namePath,a=n.triggerName;t.validateFields([s],{triggerName:a});break}}}),me(this,"notifyObservers",function(n,o,r){if(t.subscribable){var s=Ce(Ce({},r),{},{store:t.getFieldsValue(!0)});t.getFieldEntities().forEach(function(a){var l=a.onStoreChange;l(n,o,s)})}else t.forceRootUpdate()}),me(this,"triggerDependenciesUpdate",function(n,o){var r=t.getDependencyChildrenFields(o);return r.length&&t.validateFields(r),t.notifyObservers(n,r,{type:"dependenciesUpdate",relatedFields:[o].concat(_t(r))}),r}),me(this,"updateValue",function(n,o){var r=Ar(n),s=t.store;t.updateStore(gd(t.store,r,o)),t.notifyObservers(s,[r],{type:"valueUpdate",source:"internal"}),t.notifyWatch([r]);var a=t.triggerDependenciesUpdate(s,r),l=t.callbacks.onValuesChange;if(l){var c=Dne(t.store,[r]);l(c,t.getFieldsValue())}t.triggerOnFieldsChange([r].concat(_t(a)))}),me(this,"setFieldsValue",function(n){t.warningUnhooked();var o=t.store;if(n){var r=SC(t.store,n);t.updateStore(r)}t.notifyObservers(o,null,{type:"valueUpdate",source:"external"}),t.notifyWatch()}),me(this,"setFieldValue",function(n,o){t.setFields([{name:n,value:o}])}),me(this,"getDependencyChildrenFields",function(n){var o=new Set,r=[],s=new D1;t.getFieldEntities().forEach(function(l){var c=l.props.dependencies;(c||[]).forEach(function(u){var d=Ar(u);s.update(d,function(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:new Set;return h.add(l),h})})});var a=function l(c){var u=s.get(c)||new Set;u.forEach(function(d){if(!o.has(d)){o.add(d);var h=d.getNamePath();d.isFieldDirty()&&h.length&&(r.push(h),l(h))}})};return a(n),r}),me(this,"triggerOnFieldsChange",function(n,o){var r=t.callbacks.onFieldsChange;if(r){var s=t.getFields();if(o){var a=new D1;o.forEach(function(c){var u=c.name,d=c.errors;a.set(u,d)}),s.forEach(function(c){c.errors=a.get(c.name)||c.errors})}var l=s.filter(function(c){var u=c.name;return hw(n,u)});l.length&&r(l,s)}}),me(this,"validateFields",function(n,o){t.warningUnhooked();var r,s;Array.isArray(n)||typeof n=="string"||typeof o=="string"?(r=n,s=o):s=n;var a=!!r,l=a?r.map(Ar):[],c=[],u=String(Date.now()),d=new Set,h=s||{},f=h.recursive,g=h.dirty;t.getFieldEntities(!0).forEach(function(_){if(a||l.push(_.getNamePath()),!(!_.props.rules||!_.props.rules.length)&&!(g&&!_.isFieldDirty())){var w=_.getNamePath();if(d.add(w.join(u)),!a||hw(l,w,f)){var y=_.validateRules(Ce({validateMessages:Ce(Ce({},Kpe),t.validateMessages)},s));c.push(y.then(function(){return{name:w,errors:[],warnings:[]}}).catch(function(L){var D,E=[],I=[];return(D=L.forEach)===null||D===void 0||D.call(L,function(k){var R=k.rule.warningOnly,A=k.errors;R?I.push.apply(I,_t(A)):E.push.apply(E,_t(A))}),E.length?Promise.reject({name:w,errors:E,warnings:I}):{name:w,errors:E,warnings:I}}))}}});var p=nWe(c);t.lastValidatePromise=p,p.catch(function(_){return _}).then(function(_){var w=_.map(function(y){var L=y.name;return L});t.notifyObservers(t.store,w,{type:"validateFinish"}),t.triggerOnFieldsChange(w,_)});var v=p.then(function(){return t.lastValidatePromise===p?Promise.resolve(t.getFieldsValue(l)):Promise.reject([])}).catch(function(_){var w=_.filter(function(y){return y&&y.errors.length});return Promise.reject({values:t.getFieldsValue(l),errorFields:w,outOfDate:t.lastValidatePromise!==p})});v.catch(function(_){return _});var m=l.filter(function(_){return d.has(_.join(u))});return t.triggerOnFieldsChange(m),v}),me(this,"submit",function(){t.warningUnhooked(),t.validateFields().then(function(n){var o=t.callbacks.onFinish;if(o)try{o(n)}catch(r){console.error(r)}}).catch(function(n){var o=t.callbacks.onFinishFailed;o&&o(n)})}),this.forceRootUpdate=e});function ZK(i){var e=x.exports.useRef(),t=x.exports.useState({}),n=Ne(t,2),o=n[1];if(!e.current)if(i)e.current=i;else{var r=function(){o({})},s=new oWe(r);e.current=s.getForm()}return[e.current]}var LW=x.exports.createContext({triggerFormChange:function(){},triggerFormFinish:function(){},registerForm:function(){},unregisterForm:function(){}}),Ype=function(e){var t=e.validateMessages,n=e.onFormChange,o=e.onFormFinish,r=e.children,s=x.exports.useContext(LW),a=x.exports.useRef({});return x.exports.createElement(LW.Provider,{value:Ce(Ce({},s),{},{validateMessages:Ce(Ce({},s.validateMessages),t),triggerFormChange:function(c,u){n&&n(c,{changedFields:u,forms:a.current}),s.triggerFormChange(c,u)},triggerFormFinish:function(c,u){o&&o(c,{values:u,forms:a.current}),s.triggerFormFinish(c,u)},registerForm:function(c,u){c&&(a.current=Ce(Ce({},a.current),{},me({},c,u))),s.registerForm(c,u)},unregisterForm:function(c){var u=Ce({},a.current);delete u[c],a.current=u,s.unregisterForm(c)}})},r)},rWe=["name","initialValues","fields","form","preserve","children","component","validateMessages","validateTrigger","onValuesChange","onFieldsChange","onFinish","onFinishFailed"],sWe=function(e,t){var n=e.name,o=e.initialValues,r=e.fields,s=e.form,a=e.preserve,l=e.children,c=e.component,u=c===void 0?"form":c,d=e.validateMessages,h=e.validateTrigger,f=h===void 0?"onChange":h,g=e.onValuesChange,p=e.onFieldsChange,v=e.onFinish,m=e.onFinishFailed,_=Hn(e,rWe),w=x.exports.useContext(LW),y=ZK(s),L=Ne(y,1),D=L[0],E=D.getInternalHooks(n0),I=E.useSubscribe,k=E.setInitialValues,R=E.setCallbacks,A=E.setValidateMessages,P=E.setPreserve,N=E.destroyForm;x.exports.useImperativeHandle(t,function(){return D}),x.exports.useEffect(function(){return w.registerForm(n,D),function(){w.unregisterForm(n)}},[w,D,n]),A(Ce(Ce({},w.validateMessages),d)),R({onValuesChange:g,onFieldsChange:function(G){if(w.triggerFormChange(n,G),p){for(var X=arguments.length,de=new Array(X>1?X-1:0),he=1;he{}}),Qpe=x.exports.createContext(null),Jpe=i=>{const e=Df(i,["prefixCls"]);return x.exports.createElement(Ype,Object.assign({},e))},QK=x.exports.createContext({prefixCls:""}),zd=x.exports.createContext({}),EW=i=>{let{children:e,status:t,override:n}=i;const o=x.exports.useContext(zd),r=x.exports.useMemo(()=>{const s=Object.assign({},o);return n&&delete s.isFormItemInput,t&&(delete s.status,delete s.hasFeedback,delete s.feedbackIcon),s},[t,n,o]);return x.exports.createElement(zd.Provider,{value:r},e)},eme=x.exports.createContext(void 0);function Nne(){}const lWe=x.exports.createContext({add:Nne,remove:Nne});function cWe(i){const e=x.exports.useContext(lWe),t=x.exports.useRef();return el(o=>{if(o){const r=i?o.querySelector(i):o;e.add(r),t.current=r}else e.remove(t.current)})}const uWe=()=>{const{cancelButtonProps:i,cancelTextLocale:e,onCancel:t}=x.exports.useContext(EI);return fe(Bs,{...Object.assign({onClick:t},i),children:e})};var Rne=uWe;const dWe=()=>{const{confirmLoading:i,okButtonProps:e,okType:t,okTextLocale:n,onOk:o}=x.exports.useContext(EI);return fe(Bs,{...Object.assign({},Npe(t),{loading:i,onClick:o},e),children:n})};var Mne=dWe;function tme(i,e){return Bt.createElement("span",{className:`${i}-close-x`},e||Bt.createElement(cS,{className:`${i}-close-icon`}))}const nme=i=>{const{okText:e,okType:t="primary",cancelText:n,confirmLoading:o,onOk:r,onCancel:s,okButtonProps:a,cancelButtonProps:l,footer:c}=i,[u]=yI("Modal",Oge()),d=e||(u==null?void 0:u.okText),h=n||(u==null?void 0:u.cancelText),f={confirmLoading:o,okButtonProps:a,cancelButtonProps:l,okTextLocale:d,cancelTextLocale:h,okType:t,onOk:r,onCancel:s},g=Bt.useMemo(()=>f,_t(Object.values(f)));let p;return typeof c=="function"||typeof c=="undefined"?(p=Bt.createElement(Bt.Fragment,null,Bt.createElement(Rne,null),Bt.createElement(Mne,null)),typeof c=="function"&&(p=c(p,{OkBtn:Mne,CancelBtn:Rne})),p=Bt.createElement(Bpe,{value:g},p)):p=c,Bt.createElement(IK,{disabled:!1},p)},hWe=i=>({animationDuration:i,animationFillMode:"both"}),fWe=i=>({animationDuration:i,animationFillMode:"both"}),I4=function(i,e,t,n){const r=(arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1)?"&":"";return{[` +`).replace(/\s*\/\/.*$/gm,"").replace(/\n/g,"").trim(),r=new RegExp("(?:^"+t+"$)|(?:^"+o+"$)"),s=new RegExp("^"+t+"$"),a=new RegExp("^"+o+"$"),l=function(w){return w&&w.exact?r:new RegExp("(?:"+e(w)+t+e(w)+")|(?:"+e(w)+o+e(w)+")","g")};l.v4=function(y){return y&&y.exact?s:new RegExp(""+e(y)+t+e(y),"g")},l.v6=function(y){return y&&y.exact?a:new RegExp(""+e(y)+o+e(y),"g")};var c="(?:(?:[a-z]+:)?//)",u="(?:\\S+(?::\\S*)?@)?",d=l.v4().source,h=l.v6().source,f="(?:(?:[a-z\\u00a1-\\uffff0-9][-_]*)*[a-z\\u00a1-\\uffff0-9]+)",g="(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*",p="(?:\\.(?:[a-z\\u00a1-\\uffff]{2,}))",v="(?::\\d{2,5})?",m='(?:[/?#][^\\s"]*)?',_="(?:"+c+"|www\\.)"+u+"(?:localhost|"+d+"|"+h+"|"+f+g+p+")"+v+m;return XN=new RegExp("(?:^"+_+"$)","i"),XN},Rne={email:/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+\.)+[a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}))$/,hex:/^#?([a-f0-9]{6}|[a-f0-9]{3})$/i},pL={integer:function(e){return pL.number(e)&&parseInt(e,10)===e},float:function(e){return pL.number(e)&&!pL.integer(e)},array:function(e){return Array.isArray(e)},regexp:function(e){if(e instanceof RegExp)return!0;try{return!!new RegExp(e)}catch{return!1}},date:function(e){return typeof e.getTime=="function"&&typeof e.getMonth=="function"&&typeof e.getYear=="function"&&!isNaN(e.getTime())},number:function(e){return isNaN(e)?!1:typeof e=="number"},object:function(e){return typeof e=="object"&&!pL.array(e)},method:function(e){return typeof e=="function"},email:function(e){return typeof e=="string"&&e.length<=320&&!!e.match(Rne.email)},url:function(e){return typeof e=="string"&&e.length<=2048&&!!e.match(FBe())},hex:function(e){return typeof e=="string"&&!!e.match(Rne.hex)}},BBe=function(e,t,n,o,r){if(e.required&&t===void 0){Qpe(e,t,n,o,r);return}var s=["integer","float","array","regexp","object","method","email","number","date","url","hex"],a=e.type;s.indexOf(a)>-1?pL[a](t)||o.push(Dc(r.messages.types[a],e.fullField,e.type)):a&&typeof t!==e.type&&o.push(Dc(r.messages.types[a],e.fullField,e.type))},WBe=function(e,t,n,o,r){var s=typeof e.len=="number",a=typeof e.min=="number",l=typeof e.max=="number",c=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,u=t,d=null,h=typeof t=="number",f=typeof t=="string",g=Array.isArray(t);if(h?d="number":f?d="string":g&&(d="array"),!d)return!1;g&&(u=t.length),f&&(u=t.replace(c,"_").length),s?u!==e.len&&o.push(Dc(r.messages[d].len,e.fullField,e.len)):a&&!l&&ue.max?o.push(Dc(r.messages[d].max,e.fullField,e.max)):a&&l&&(ue.max)&&o.push(Dc(r.messages[d].range,e.fullField,e.min,e.max))},E1="enum",VBe=function(e,t,n,o,r){e[E1]=Array.isArray(e[E1])?e[E1]:[],e[E1].indexOf(t)===-1&&o.push(Dc(r.messages[E1],e.fullField,e[E1].join(", ")))},HBe=function(e,t,n,o,r){if(e.pattern){if(e.pattern instanceof RegExp)e.pattern.lastIndex=0,e.pattern.test(t)||o.push(Dc(r.messages.pattern.mismatch,e.fullField,t,e.pattern));else if(typeof e.pattern=="string"){var s=new RegExp(e.pattern);s.test(t)||o.push(Dc(r.messages.pattern.mismatch,e.fullField,t,e.pattern))}}},ki={required:Qpe,whitespace:OBe,type:BBe,range:WBe,enum:VBe,pattern:HBe},$Be=function(e,t,n,o,r){var s=[],a=e.required||!e.required&&o.hasOwnProperty(e.field);if(a){if(Ss(t,"string")&&!e.required)return n();ki.required(e,t,o,s,r,"string"),Ss(t,"string")||(ki.type(e,t,o,s,r),ki.range(e,t,o,s,r),ki.pattern(e,t,o,s,r),e.whitespace===!0&&ki.whitespace(e,t,o,s,r))}n(s)},zBe=function(e,t,n,o,r){var s=[],a=e.required||!e.required&&o.hasOwnProperty(e.field);if(a){if(Ss(t)&&!e.required)return n();ki.required(e,t,o,s,r),t!==void 0&&ki.type(e,t,o,s,r)}n(s)},UBe=function(e,t,n,o,r){var s=[],a=e.required||!e.required&&o.hasOwnProperty(e.field);if(a){if(t===""&&(t=void 0),Ss(t)&&!e.required)return n();ki.required(e,t,o,s,r),t!==void 0&&(ki.type(e,t,o,s,r),ki.range(e,t,o,s,r))}n(s)},jBe=function(e,t,n,o,r){var s=[],a=e.required||!e.required&&o.hasOwnProperty(e.field);if(a){if(Ss(t)&&!e.required)return n();ki.required(e,t,o,s,r),t!==void 0&&ki.type(e,t,o,s,r)}n(s)},KBe=function(e,t,n,o,r){var s=[],a=e.required||!e.required&&o.hasOwnProperty(e.field);if(a){if(Ss(t)&&!e.required)return n();ki.required(e,t,o,s,r),Ss(t)||ki.type(e,t,o,s,r)}n(s)},qBe=function(e,t,n,o,r){var s=[],a=e.required||!e.required&&o.hasOwnProperty(e.field);if(a){if(Ss(t)&&!e.required)return n();ki.required(e,t,o,s,r),t!==void 0&&(ki.type(e,t,o,s,r),ki.range(e,t,o,s,r))}n(s)},GBe=function(e,t,n,o,r){var s=[],a=e.required||!e.required&&o.hasOwnProperty(e.field);if(a){if(Ss(t)&&!e.required)return n();ki.required(e,t,o,s,r),t!==void 0&&(ki.type(e,t,o,s,r),ki.range(e,t,o,s,r))}n(s)},XBe=function(e,t,n,o,r){var s=[],a=e.required||!e.required&&o.hasOwnProperty(e.field);if(a){if(t==null&&!e.required)return n();ki.required(e,t,o,s,r,"array"),t!=null&&(ki.type(e,t,o,s,r),ki.range(e,t,o,s,r))}n(s)},YBe=function(e,t,n,o,r){var s=[],a=e.required||!e.required&&o.hasOwnProperty(e.field);if(a){if(Ss(t)&&!e.required)return n();ki.required(e,t,o,s,r),t!==void 0&&ki.type(e,t,o,s,r)}n(s)},ZBe="enum",QBe=function(e,t,n,o,r){var s=[],a=e.required||!e.required&&o.hasOwnProperty(e.field);if(a){if(Ss(t)&&!e.required)return n();ki.required(e,t,o,s,r),t!==void 0&&ki[ZBe](e,t,o,s,r)}n(s)},JBe=function(e,t,n,o,r){var s=[],a=e.required||!e.required&&o.hasOwnProperty(e.field);if(a){if(Ss(t,"string")&&!e.required)return n();ki.required(e,t,o,s,r),Ss(t,"string")||ki.pattern(e,t,o,s,r)}n(s)},eWe=function(e,t,n,o,r){var s=[],a=e.required||!e.required&&o.hasOwnProperty(e.field);if(a){if(Ss(t,"date")&&!e.required)return n();if(ki.required(e,t,o,s,r),!Ss(t,"date")){var l;t instanceof Date?l=t:l=new Date(t),ki.type(e,l,o,s,r),l&&ki.range(e,l.getTime(),o,s,r)}}n(s)},tWe=function(e,t,n,o,r){var s=[],a=Array.isArray(t)?"array":typeof t;ki.required(e,t,o,s,r,a),n(s)},h6=function(e,t,n,o,r){var s=e.type,a=[],l=e.required||!e.required&&o.hasOwnProperty(e.field);if(l){if(Ss(t,s)&&!e.required)return n();ki.required(e,t,o,a,r,s),Ss(t,s)||ki.type(e,t,o,a,r)}n(a)},nWe=function(e,t,n,o,r){var s=[],a=e.required||!e.required&&o.hasOwnProperty(e.field);if(a){if(Ss(t)&&!e.required)return n();ki.required(e,t,o,s,r)}n(s)},iE={string:$Be,method:zBe,number:UBe,boolean:jBe,regexp:KBe,integer:qBe,float:GBe,array:XBe,object:YBe,enum:QBe,pattern:JBe,date:eWe,url:h6,hex:h6,email:h6,required:tWe,any:nWe};function wW(){return{default:"Validation error on field %s",required:"%s is required",enum:"%s must be one of %s",whitespace:"%s cannot be empty",date:{format:"%s date %s is invalid for format %s",parse:"%s date could not be parsed, %s is invalid ",invalid:"%s date %s is invalid"},types:{string:"%s is not a %s",method:"%s is not a %s (function)",array:"%s is not an %s",object:"%s is not an %s",number:"%s is not a %s",date:"%s is not a %s",boolean:"%s is not a %s",integer:"%s is not an %s",float:"%s is not a %s",regexp:"%s is not a valid %s",email:"%s is not a valid %s",url:"%s is not a valid %s",hex:"%s is not a valid %s"},string:{len:"%s must be exactly %s characters",min:"%s must be at least %s characters",max:"%s cannot be longer than %s characters",range:"%s must be between %s and %s characters"},number:{len:"%s must equal %s",min:"%s cannot be less than %s",max:"%s cannot be greater than %s",range:"%s must be between %s and %s"},array:{len:"%s must be exactly %s in length",min:"%s cannot be less than %s in length",max:"%s cannot be greater than %s in length",range:"%s must be between %s and %s in length"},pattern:{mismatch:"%s value %s does not match pattern %s"},clone:function(){var e=JSON.parse(JSON.stringify(this));return e.clone=this.clone,e}}}var SW=wW(),II=function(){function i(t){this.rules=null,this._messages=SW,this.define(t)}var e=i.prototype;return e.define=function(n){var o=this;if(!n)throw new Error("Cannot configure a schema with no rules");if(typeof n!="object"||Array.isArray(n))throw new Error("Rules must be an object");this.rules={},Object.keys(n).forEach(function(r){var s=n[r];o.rules[r]=Array.isArray(s)?s:[s]})},e.messages=function(n){return n&&(this._messages=Nne(wW(),n)),this._messages},e.validate=function(n,o,r){var s=this;o===void 0&&(o={}),r===void 0&&(r=function(){});var a=n,l=o,c=r;if(typeof l=="function"&&(c=l,l={}),!this.rules||Object.keys(this.rules).length===0)return c&&c(null,a),Promise.resolve(a);function u(p){var v=[],m={};function _(w){if(Array.isArray(w)){var L;v=(L=v).concat.apply(L,w)}else v.push(w)}for(var y=0;y2&&arguments[2]!==void 0?arguments[2]:!1;return i&&i.some(function(n){return eme(e,n,t)})}function eme(i,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return!i||!e||!t&&i.length!==e.length?!1:e.every(function(n,o){return i[o]===n})}function aWe(i,e){if(i===e)return!0;if(!i&&e||i&&!e||!i||!e||Kn(i)!=="object"||Kn(e)!=="object")return!1;var t=Object.keys(i),n=Object.keys(e),o=new Set([].concat(t,n));return _t(o).every(function(r){var s=i[r],a=e[r];return typeof s=="function"&&typeof a=="function"?!0:s===a})}function lWe(i){var e=arguments.length<=1?void 0:arguments[1];return e&&e.target&&Kn(e.target)==="object"&&i in e.target?e.target[i]:e}function One(i,e,t){var n=i.length;if(e<0||e>=n||t<0||t>=n)return i;var o=i[e],r=e-t;return r>0?[].concat(_t(i.slice(0,t)),[o],_t(i.slice(t,e)),_t(i.slice(e+1,n))):r<0?[].concat(_t(i.slice(0,e)),_t(i.slice(e+1,t+1)),[o],_t(i.slice(t+1,n))):i}var cWe=["name"],lu=[];function Fne(i,e,t,n,o,r){return typeof i=="function"?i(e,t,"source"in r?{source:r.source}:{}):n!==o}var JK=function(i){hp(t,i);var e=Ab(t);function t(n){var o;if(ga(this,t),o=e.call(this,n),me(ci(o),"state",{resetCount:0}),me(ci(o),"cancelRegisterFunc",null),me(ci(o),"mounted",!1),me(ci(o),"touched",!1),me(ci(o),"dirty",!1),me(ci(o),"validatePromise",void 0),me(ci(o),"prevValidating",void 0),me(ci(o),"errors",lu),me(ci(o),"warnings",lu),me(ci(o),"cancelRegister",function(){var l=o.props,c=l.preserve,u=l.isListField,d=l.name;o.cancelRegisterFunc&&o.cancelRegisterFunc(u,c,Ar(d)),o.cancelRegisterFunc=null}),me(ci(o),"getNamePath",function(){var l=o.props,c=l.name,u=l.fieldContext,d=u.prefixName,h=d===void 0?[]:d;return c!==void 0?[].concat(_t(h),_t(c)):[]}),me(ci(o),"getRules",function(){var l=o.props,c=l.rules,u=c===void 0?[]:c,d=l.fieldContext;return u.map(function(h){return typeof h=="function"?h(d):h})}),me(ci(o),"refresh",function(){!o.mounted||o.setState(function(l){var c=l.resetCount;return{resetCount:c+1}})}),me(ci(o),"metaCache",null),me(ci(o),"triggerMetaEvent",function(l){var c=o.props.onMetaChange;if(c){var u=Ce(Ce({},o.getMeta()),{},{destroy:l});b4(o.metaCache,u)||c(u),o.metaCache=u}else o.metaCache=null}),me(ci(o),"onStoreChange",function(l,c,u){var d=o.props,h=d.shouldUpdate,f=d.dependencies,g=f===void 0?[]:f,p=d.onReset,v=u.store,m=o.getNamePath(),_=o.getValue(l),y=o.getValue(v),w=c&&hy(c,m);switch(u.type==="valueUpdate"&&u.source==="external"&&_!==y&&(o.touched=!0,o.dirty=!0,o.validatePromise=null,o.errors=lu,o.warnings=lu,o.triggerMetaEvent()),u.type){case"reset":if(!c||w){o.touched=!1,o.dirty=!1,o.validatePromise=void 0,o.errors=lu,o.warnings=lu,o.triggerMetaEvent(),p==null||p(),o.refresh();return}break;case"remove":{if(h){o.reRender();return}break}case"setField":{var L=u.data;if(w){"touched"in L&&(o.touched=L.touched),"validating"in L&&!("originRCField"in L)&&(o.validatePromise=L.validating?Promise.resolve([]):null),"errors"in L&&(o.errors=L.errors||lu),"warnings"in L&&(o.warnings=L.warnings||lu),o.dirty=!0,o.triggerMetaEvent(),o.reRender();return}else if("value"in L&&hy(c,m,!0)){o.reRender();return}if(h&&!m.length&&Fne(h,l,v,_,y,u)){o.reRender();return}break}case"dependenciesUpdate":{var D=g.map(Ar);if(D.some(function(E){return hy(u.relatedFields,E)})){o.reRender();return}break}default:if(w||(!g.length||m.length||h)&&Fne(h,l,v,_,y,u)){o.reRender();return}break}h===!0&&o.reRender()}),me(ci(o),"validateRules",function(l){var c=o.getNamePath(),u=o.getValue(),d=l||{},h=d.triggerName,f=d.validateOnly,g=f===void 0?!1:f,p=Promise.resolve().then(Pb(dl().mark(function v(){var m,_,y,w,L,D,E;return dl().wrap(function(k){for(;;)switch(k.prev=k.next){case 0:if(o.mounted){k.next=2;break}return k.abrupt("return",[]);case 2:if(m=o.props,_=m.validateFirst,y=_===void 0?!1:_,w=m.messageVariables,L=m.validateDebounce,D=o.getRules(),h&&(D=D.filter(function(R){return R}).filter(function(R){var A=R.validateTrigger;if(!A)return!0;var P=_W(A);return P.includes(h)})),!(L&&h)){k.next=10;break}return k.next=8,new Promise(function(R){setTimeout(R,L)});case 8:if(o.validatePromise===p){k.next=10;break}return k.abrupt("return",[]);case 10:return E=oWe(c,u,D,l,y,w),E.catch(function(R){return R}).then(function(){var R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:lu;if(o.validatePromise===p){var A;o.validatePromise=null;var P=[],N=[];(A=R.forEach)===null||A===void 0||A.call(R,function(M){var H=M.rule.warningOnly,B=M.errors,F=B===void 0?lu:B;H?N.push.apply(N,_t(F)):P.push.apply(P,_t(F))}),o.errors=P,o.warnings=N,o.triggerMetaEvent(),o.reRender()}}),k.abrupt("return",E);case 13:case"end":return k.stop()}},v)})));return g||(o.validatePromise=p,o.dirty=!0,o.errors=lu,o.warnings=lu,o.triggerMetaEvent(),o.reRender()),p}),me(ci(o),"isFieldValidating",function(){return!!o.validatePromise}),me(ci(o),"isFieldTouched",function(){return o.touched}),me(ci(o),"isFieldDirty",function(){if(o.dirty||o.props.initialValue!==void 0)return!0;var l=o.props.fieldContext,c=l.getInternalHooks(i0),u=c.getInitialValue;return u(o.getNamePath())!==void 0}),me(ci(o),"getErrors",function(){return o.errors}),me(ci(o),"getWarnings",function(){return o.warnings}),me(ci(o),"isListField",function(){return o.props.isListField}),me(ci(o),"isList",function(){return o.props.isList}),me(ci(o),"isPreserve",function(){return o.props.preserve}),me(ci(o),"getMeta",function(){o.prevValidating=o.isFieldValidating();var l={touched:o.isFieldTouched(),validating:o.prevValidating,errors:o.errors,warnings:o.warnings,name:o.getNamePath(),validated:o.validatePromise===null};return l}),me(ci(o),"getOnlyChild",function(l){if(typeof l=="function"){var c=o.getMeta();return Ce(Ce({},o.getOnlyChild(l(o.getControlled(),c,o.props.fieldContext))),{},{isFunction:!0})}var u=ip(l);return u.length!==1||!x.exports.isValidElement(u[0])?{child:u,isFunction:!1}:{child:u[0],isFunction:!1}}),me(ci(o),"getValue",function(l){var c=o.props.fieldContext.getFieldsValue,u=o.getNamePath();return jh(l||c(!0),u)}),me(ci(o),"getControlled",function(){var l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},c=o.props,u=c.trigger,d=c.validateTrigger,h=c.getValueFromEvent,f=c.normalize,g=c.valuePropName,p=c.getValueProps,v=c.fieldContext,m=d!==void 0?d:v.validateTrigger,_=o.getNamePath(),y=v.getInternalHooks,w=v.getFieldsValue,L=y(i0),D=L.dispatch,E=o.getValue(),I=p||function(P){return me({},g,P)},k=l[u],R=Ce(Ce({},l),I(E));R[u]=function(){o.touched=!0,o.dirty=!0,o.triggerMetaEvent();for(var P,N=arguments.length,M=new Array(N),H=0;H=0&&R<=A.length?(u.keys=[].concat(_t(u.keys.slice(0,R)),[u.id],_t(u.keys.slice(R))),y([].concat(_t(A.slice(0,R)),[k],_t(A.slice(R))))):(u.keys=[].concat(_t(u.keys),[u.id]),y([].concat(_t(A),[k]))),u.id+=1},remove:function(k){var R=L(),A=new Set(Array.isArray(k)?k:[k]);A.size<=0||(u.keys=u.keys.filter(function(P,N){return!A.has(N)}),y(R.filter(function(P,N){return!A.has(N)})))},move:function(k,R){if(k!==R){var A=L();k<0||k>=A.length||R<0||R>=A.length||(u.keys=One(u.keys,k,R),y(One(A,k,R)))}}},E=_||[];return Array.isArray(E)||(E=[]),n(E.map(function(I,k){var R=u.keys[k];return R===void 0&&(u.keys[k]=u.id,R=u.keys[k],u.id+=1),{name:k,key:R,isListField:!0}}),D,v)})))}function uWe(i){var e=!1,t=i.length,n=[];return i.length?new Promise(function(o,r){i.forEach(function(s,a){s.catch(function(l){return e=!0,l}).then(function(l){t-=1,n[a]=l,!(t>0)&&(e&&r(n),o(n))})})}):Promise.resolve([])}var nme="__@field_split__";function f6(i){return i.map(function(e){return"".concat(Kn(e),":").concat(e)}).join(nme)}var D1=function(){function i(){ga(this,i),me(this,"kvs",new Map)}return pa(i,[{key:"set",value:function(t,n){this.kvs.set(f6(t),n)}},{key:"get",value:function(t){return this.kvs.get(f6(t))}},{key:"update",value:function(t,n){var o=this.get(t),r=n(o);r?this.set(t,r):this.delete(t)}},{key:"delete",value:function(t){this.kvs.delete(f6(t))}},{key:"map",value:function(t){return _t(this.kvs.entries()).map(function(n){var o=Ne(n,2),r=o[0],s=o[1],a=r.split(nme);return t({key:a.map(function(l){var c=l.match(/^([^:]*):(.*)$/),u=Ne(c,3),d=u[1],h=u[2];return d==="number"?Number(h):h}),value:s})})}},{key:"toJSON",value:function(){var t={};return this.map(function(n){var o=n.key,r=n.value;return t[o.join(".")]=r,null}),t}}]),i}(),dWe=["name"],hWe=pa(function i(e){var t=this;ga(this,i),me(this,"formHooked",!1),me(this,"forceRootUpdate",void 0),me(this,"subscribable",!0),me(this,"store",{}),me(this,"fieldEntities",[]),me(this,"initialValues",{}),me(this,"callbacks",{}),me(this,"validateMessages",null),me(this,"preserve",null),me(this,"lastValidatePromise",null),me(this,"getForm",function(){return{getFieldValue:t.getFieldValue,getFieldsValue:t.getFieldsValue,getFieldError:t.getFieldError,getFieldWarning:t.getFieldWarning,getFieldsError:t.getFieldsError,isFieldsTouched:t.isFieldsTouched,isFieldTouched:t.isFieldTouched,isFieldValidating:t.isFieldValidating,isFieldsValidating:t.isFieldsValidating,resetFields:t.resetFields,setFields:t.setFields,setFieldValue:t.setFieldValue,setFieldsValue:t.setFieldsValue,validateFields:t.validateFields,submit:t.submit,_init:!0,getInternalHooks:t.getInternalHooks}}),me(this,"getInternalHooks",function(n){return n===i0?(t.formHooked=!0,{dispatch:t.dispatch,initEntityValue:t.initEntityValue,registerField:t.registerField,useSubscribe:t.useSubscribe,setInitialValues:t.setInitialValues,destroyForm:t.destroyForm,setCallbacks:t.setCallbacks,setValidateMessages:t.setValidateMessages,getFields:t.getFields,setPreserve:t.setPreserve,getInitialValue:t.getInitialValue,registerWatch:t.registerWatch}):(rr(!1,"`getInternalHooks` is internal usage. Should not call directly."),null)}),me(this,"useSubscribe",function(n){t.subscribable=n}),me(this,"prevWithoutPreserves",null),me(this,"setInitialValues",function(n,o){if(t.initialValues=n||{},o){var r,s=SC(n,t.store);(r=t.prevWithoutPreserves)===null||r===void 0||r.map(function(a){var l=a.key;s=pd(s,l,jh(n,l))}),t.prevWithoutPreserves=null,t.updateStore(s)}}),me(this,"destroyForm",function(){var n=new D1;t.getFieldEntities(!0).forEach(function(o){t.isMergedPreserve(o.isPreserve())||n.set(o.getNamePath(),!0)}),t.prevWithoutPreserves=n}),me(this,"getInitialValue",function(n){var o=jh(t.initialValues,n);return n.length?SC(o):o}),me(this,"setCallbacks",function(n){t.callbacks=n}),me(this,"setValidateMessages",function(n){t.validateMessages=n}),me(this,"setPreserve",function(n){t.preserve=n}),me(this,"watchList",[]),me(this,"registerWatch",function(n){return t.watchList.push(n),function(){t.watchList=t.watchList.filter(function(o){return o!==n})}}),me(this,"notifyWatch",function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];if(t.watchList.length){var o=t.getFieldsValue(),r=t.getFieldsValue(!0);t.watchList.forEach(function(s){s(o,r,n)})}}),me(this,"timeoutId",null),me(this,"warningUnhooked",function(){}),me(this,"updateStore",function(n){t.store=n}),me(this,"getFieldEntities",function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return n?t.fieldEntities.filter(function(o){return o.getNamePath().length}):t.fieldEntities}),me(this,"getFieldsMap",function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,o=new D1;return t.getFieldEntities(n).forEach(function(r){var s=r.getNamePath();o.set(s,r)}),o}),me(this,"getFieldEntitiesForNamePathList",function(n){if(!n)return t.getFieldEntities(!0);var o=t.getFieldsMap(!0);return n.map(function(r){var s=Ar(r);return o.get(s)||{INVALIDATE_NAME_PATH:Ar(r)}})}),me(this,"getFieldsValue",function(n,o){t.warningUnhooked();var r,s,a;if(n===!0||Array.isArray(n)?(r=n,s=o):n&&Kn(n)==="object"&&(a=n.strict,s=n.filter),r===!0&&!s)return t.store;var l=t.getFieldEntitiesForNamePathList(Array.isArray(r)?r:null),c=[];return l.forEach(function(u){var d,h,f="INVALIDATE_NAME_PATH"in u?u.INVALIDATE_NAME_PATH:u.getNamePath();if(a){var g,p;if((g=(p=u).isList)!==null&&g!==void 0&&g.call(p))return}else if(!r&&(d=(h=u).isListField)!==null&&d!==void 0&&d.call(h))return;if(!s)c.push(f);else{var v="getMeta"in u?u.getMeta():null;s(v)&&c.push(f)}}),Pne(t.store,c.map(Ar))}),me(this,"getFieldValue",function(n){t.warningUnhooked();var o=Ar(n);return jh(t.store,o)}),me(this,"getFieldsError",function(n){t.warningUnhooked();var o=t.getFieldEntitiesForNamePathList(n);return o.map(function(r,s){return r&&!("INVALIDATE_NAME_PATH"in r)?{name:r.getNamePath(),errors:r.getErrors(),warnings:r.getWarnings()}:{name:Ar(n[s]),errors:[],warnings:[]}})}),me(this,"getFieldError",function(n){t.warningUnhooked();var o=Ar(n),r=t.getFieldsError([o])[0];return r.errors}),me(this,"getFieldWarning",function(n){t.warningUnhooked();var o=Ar(n),r=t.getFieldsError([o])[0];return r.warnings}),me(this,"isFieldsTouched",function(){t.warningUnhooked();for(var n=arguments.length,o=new Array(n),r=0;r0&&arguments[0]!==void 0?arguments[0]:{},o=new D1,r=t.getFieldEntities(!0);r.forEach(function(l){var c=l.props.initialValue,u=l.getNamePath();if(c!==void 0){var d=o.get(u)||new Set;d.add({entity:l,value:c}),o.set(u,d)}});var s=function(c){c.forEach(function(u){var d=u.props.initialValue;if(d!==void 0){var h=u.getNamePath(),f=t.getInitialValue(h);if(f!==void 0)rr(!1,"Form already set 'initialValues' with path '".concat(h.join("."),"'. Field can not overwrite it."));else{var g=o.get(h);if(g&&g.size>1)rr(!1,"Multiple Field with path '".concat(h.join("."),"' set 'initialValue'. Can not decide which one to pick."));else if(g){var p=t.getFieldValue(h),v=u.isListField();!v&&(!n.skipExist||p===void 0)&&t.updateStore(pd(t.store,h,_t(g)[0].value))}}}})},a;n.entities?a=n.entities:n.namePathList?(a=[],n.namePathList.forEach(function(l){var c=o.get(l);if(c){var u;(u=a).push.apply(u,_t(_t(c).map(function(d){return d.entity})))}})):a=r,s(a)}),me(this,"resetFields",function(n){t.warningUnhooked();var o=t.store;if(!n){t.updateStore(SC(t.initialValues)),t.resetWithFieldInitialValue(),t.notifyObservers(o,null,{type:"reset"}),t.notifyWatch();return}var r=n.map(Ar);r.forEach(function(s){var a=t.getInitialValue(s);t.updateStore(pd(t.store,s,a))}),t.resetWithFieldInitialValue({namePathList:r}),t.notifyObservers(o,r,{type:"reset"}),t.notifyWatch(r)}),me(this,"setFields",function(n){t.warningUnhooked();var o=t.store,r=[];n.forEach(function(s){var a=s.name,l=Hn(s,dWe),c=Ar(a);r.push(c),"value"in l&&t.updateStore(pd(t.store,c,l.value)),t.notifyObservers(o,[c],{type:"setField",data:s})}),t.notifyWatch(r)}),me(this,"getFields",function(){var n=t.getFieldEntities(!0),o=n.map(function(r){var s=r.getNamePath(),a=r.getMeta(),l=Ce(Ce({},a),{},{name:s,value:t.getFieldValue(s)});return Object.defineProperty(l,"originRCField",{value:!0}),l});return o}),me(this,"initEntityValue",function(n){var o=n.props.initialValue;if(o!==void 0){var r=n.getNamePath(),s=jh(t.store,r);s===void 0&&t.updateStore(pd(t.store,r,o))}}),me(this,"isMergedPreserve",function(n){var o=n!==void 0?n:t.preserve;return o!=null?o:!0}),me(this,"registerField",function(n){t.fieldEntities.push(n);var o=n.getNamePath();if(t.notifyWatch([o]),n.props.initialValue!==void 0){var r=t.store;t.resetWithFieldInitialValue({entities:[n],skipExist:!0}),t.notifyObservers(r,[n.getNamePath()],{type:"valueUpdate",source:"internal"})}return function(s,a){var l=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];if(t.fieldEntities=t.fieldEntities.filter(function(d){return d!==n}),!t.isMergedPreserve(a)&&(!s||l.length>1)){var c=s?void 0:t.getInitialValue(o);if(o.length&&t.getFieldValue(o)!==c&&t.fieldEntities.every(function(d){return!eme(d.getNamePath(),o)})){var u=t.store;t.updateStore(pd(u,o,c,!0)),t.notifyObservers(u,[o],{type:"remove"}),t.triggerDependenciesUpdate(u,o)}}t.notifyWatch([o])}}),me(this,"dispatch",function(n){switch(n.type){case"updateValue":{var o=n.namePath,r=n.value;t.updateValue(o,r);break}case"validateField":{var s=n.namePath,a=n.triggerName;t.validateFields([s],{triggerName:a});break}}}),me(this,"notifyObservers",function(n,o,r){if(t.subscribable){var s=Ce(Ce({},r),{},{store:t.getFieldsValue(!0)});t.getFieldEntities().forEach(function(a){var l=a.onStoreChange;l(n,o,s)})}else t.forceRootUpdate()}),me(this,"triggerDependenciesUpdate",function(n,o){var r=t.getDependencyChildrenFields(o);return r.length&&t.validateFields(r),t.notifyObservers(n,r,{type:"dependenciesUpdate",relatedFields:[o].concat(_t(r))}),r}),me(this,"updateValue",function(n,o){var r=Ar(n),s=t.store;t.updateStore(pd(t.store,r,o)),t.notifyObservers(s,[r],{type:"valueUpdate",source:"internal"}),t.notifyWatch([r]);var a=t.triggerDependenciesUpdate(s,r),l=t.callbacks.onValuesChange;if(l){var c=Pne(t.store,[r]);l(c,t.getFieldsValue())}t.triggerOnFieldsChange([r].concat(_t(a)))}),me(this,"setFieldsValue",function(n){t.warningUnhooked();var o=t.store;if(n){var r=SC(t.store,n);t.updateStore(r)}t.notifyObservers(o,null,{type:"valueUpdate",source:"external"}),t.notifyWatch()}),me(this,"setFieldValue",function(n,o){t.setFields([{name:n,value:o}])}),me(this,"getDependencyChildrenFields",function(n){var o=new Set,r=[],s=new D1;t.getFieldEntities().forEach(function(l){var c=l.props.dependencies;(c||[]).forEach(function(u){var d=Ar(u);s.update(d,function(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:new Set;return h.add(l),h})})});var a=function l(c){var u=s.get(c)||new Set;u.forEach(function(d){if(!o.has(d)){o.add(d);var h=d.getNamePath();d.isFieldDirty()&&h.length&&(r.push(h),l(h))}})};return a(n),r}),me(this,"triggerOnFieldsChange",function(n,o){var r=t.callbacks.onFieldsChange;if(r){var s=t.getFields();if(o){var a=new D1;o.forEach(function(c){var u=c.name,d=c.errors;a.set(u,d)}),s.forEach(function(c){c.errors=a.get(c.name)||c.errors})}var l=s.filter(function(c){var u=c.name;return hy(n,u)});l.length&&r(l,s)}}),me(this,"validateFields",function(n,o){t.warningUnhooked();var r,s;Array.isArray(n)||typeof n=="string"||typeof o=="string"?(r=n,s=o):s=n;var a=!!r,l=a?r.map(Ar):[],c=[],u=String(Date.now()),d=new Set,h=s||{},f=h.recursive,g=h.dirty;t.getFieldEntities(!0).forEach(function(_){if(a||l.push(_.getNamePath()),!(!_.props.rules||!_.props.rules.length)&&!(g&&!_.isFieldDirty())){var y=_.getNamePath();if(d.add(y.join(u)),!a||hy(l,y,f)){var w=_.validateRules(Ce({validateMessages:Ce(Ce({},Jpe),t.validateMessages)},s));c.push(w.then(function(){return{name:y,errors:[],warnings:[]}}).catch(function(L){var D,E=[],I=[];return(D=L.forEach)===null||D===void 0||D.call(L,function(k){var R=k.rule.warningOnly,A=k.errors;R?I.push.apply(I,_t(A)):E.push.apply(E,_t(A))}),E.length?Promise.reject({name:y,errors:E,warnings:I}):{name:y,errors:E,warnings:I}}))}}});var p=uWe(c);t.lastValidatePromise=p,p.catch(function(_){return _}).then(function(_){var y=_.map(function(w){var L=w.name;return L});t.notifyObservers(t.store,y,{type:"validateFinish"}),t.triggerOnFieldsChange(y,_)});var v=p.then(function(){return t.lastValidatePromise===p?Promise.resolve(t.getFieldsValue(l)):Promise.reject([])}).catch(function(_){var y=_.filter(function(w){return w&&w.errors.length});return Promise.reject({values:t.getFieldsValue(l),errorFields:y,outOfDate:t.lastValidatePromise!==p})});v.catch(function(_){return _});var m=l.filter(function(_){return d.has(_.join(u))});return t.triggerOnFieldsChange(m),v}),me(this,"submit",function(){t.warningUnhooked(),t.validateFields().then(function(n){var o=t.callbacks.onFinish;if(o)try{o(n)}catch(r){console.error(r)}}).catch(function(n){var o=t.callbacks.onFinishFailed;o&&o(n)})}),this.forceRootUpdate=e});function tq(i){var e=x.exports.useRef(),t=x.exports.useState({}),n=Ne(t,2),o=n[1];if(!e.current)if(i)e.current=i;else{var r=function(){o({})},s=new hWe(r);e.current=s.getForm()}return[e.current]}var kW=x.exports.createContext({triggerFormChange:function(){},triggerFormFinish:function(){},registerForm:function(){},unregisterForm:function(){}}),ime=function(e){var t=e.validateMessages,n=e.onFormChange,o=e.onFormFinish,r=e.children,s=x.exports.useContext(kW),a=x.exports.useRef({});return x.exports.createElement(kW.Provider,{value:Ce(Ce({},s),{},{validateMessages:Ce(Ce({},s.validateMessages),t),triggerFormChange:function(c,u){n&&n(c,{changedFields:u,forms:a.current}),s.triggerFormChange(c,u)},triggerFormFinish:function(c,u){o&&o(c,{values:u,forms:a.current}),s.triggerFormFinish(c,u)},registerForm:function(c,u){c&&(a.current=Ce(Ce({},a.current),{},me({},c,u))),s.registerForm(c,u)},unregisterForm:function(c){var u=Ce({},a.current);delete u[c],a.current=u,s.unregisterForm(c)}})},r)},fWe=["name","initialValues","fields","form","preserve","children","component","validateMessages","validateTrigger","onValuesChange","onFieldsChange","onFinish","onFinishFailed"],gWe=function(e,t){var n=e.name,o=e.initialValues,r=e.fields,s=e.form,a=e.preserve,l=e.children,c=e.component,u=c===void 0?"form":c,d=e.validateMessages,h=e.validateTrigger,f=h===void 0?"onChange":h,g=e.onValuesChange,p=e.onFieldsChange,v=e.onFinish,m=e.onFinishFailed,_=Hn(e,fWe),y=x.exports.useContext(kW),w=tq(s),L=Ne(w,1),D=L[0],E=D.getInternalHooks(i0),I=E.useSubscribe,k=E.setInitialValues,R=E.setCallbacks,A=E.setValidateMessages,P=E.setPreserve,N=E.destroyForm;x.exports.useImperativeHandle(t,function(){return D}),x.exports.useEffect(function(){return y.registerForm(n,D),function(){y.unregisterForm(n)}},[y,D,n]),A(Ce(Ce({},y.validateMessages),d)),R({onValuesChange:g,onFieldsChange:function(G){if(y.triggerFormChange(n,G),p){for(var X=arguments.length,de=new Array(X>1?X-1:0),fe=1;fe{}}),rme=x.exports.createContext(null),sme=i=>{const e=kf(i,["prefixCls"]);return x.exports.createElement(ime,Object.assign({},e))},nq=x.exports.createContext({prefixCls:""}),Ud=x.exports.createContext({}),IW=i=>{let{children:e,status:t,override:n}=i;const o=x.exports.useContext(Ud),r=x.exports.useMemo(()=>{const s=Object.assign({},o);return n&&delete s.isFormItemInput,t&&(delete s.status,delete s.hasFeedback,delete s.feedbackIcon),s},[t,n,o]);return x.exports.createElement(Ud.Provider,{value:r},e)},ame=x.exports.createContext(void 0);function Wne(){}const mWe=x.exports.createContext({add:Wne,remove:Wne});function vWe(i){const e=x.exports.useContext(mWe),t=x.exports.useRef();return tl(o=>{if(o){const r=i?o.querySelector(i):o;e.add(r),t.current=r}else e.remove(t.current)})}const _We=()=>{const{cancelButtonProps:i,cancelTextLocale:e,onCancel:t}=x.exports.useContext(kI);return he(ts,{...Object.assign({onClick:t},i),children:e})};var Vne=_We;const bWe=()=>{const{confirmLoading:i,okButtonProps:e,okType:t,okTextLocale:n,onOk:o}=x.exports.useContext(kI);return he(ts,{...Object.assign({},Bpe(t),{loading:i,onClick:o},e),children:n})};var Hne=bWe;function lme(i,e){return Bt.createElement("span",{className:`${i}-close-x`},e||Bt.createElement(uS,{className:`${i}-close-icon`}))}const cme=i=>{const{okText:e,okType:t="primary",cancelText:n,confirmLoading:o,onOk:r,onCancel:s,okButtonProps:a,cancelButtonProps:l,footer:c}=i,[u]=xI("Modal",zge()),d=e||(u==null?void 0:u.okText),h=n||(u==null?void 0:u.cancelText),f={confirmLoading:o,okButtonProps:a,cancelButtonProps:l,okTextLocale:d,cancelTextLocale:h,okType:t,onOk:r,onCancel:s},g=Bt.useMemo(()=>f,_t(Object.values(f)));let p;return typeof c=="function"||typeof c=="undefined"?(p=Bt.createElement(Bt.Fragment,null,Bt.createElement(Vne,null),Bt.createElement(Hne,null)),typeof c=="function"&&(p=c(p,{OkBtn:Hne,CancelBtn:Vne})),p=Bt.createElement(jpe,{value:g},p)):p=c,Bt.createElement(MK,{disabled:!1},p)},CWe=i=>({animationDuration:i,animationFillMode:"both"}),yWe=i=>({animationDuration:i,animationFillMode:"both"}),T4=function(i,e,t,n){const r=(arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1)?"&":"";return{[` ${r}${i}-enter, ${r}${i}-appear - `]:Object.assign(Object.assign({},hWe(n)),{animationPlayState:"paused"}),[`${r}${i}-leave`]:Object.assign(Object.assign({},fWe(n)),{animationPlayState:"paused"}),[` + `]:Object.assign(Object.assign({},CWe(n)),{animationPlayState:"paused"}),[`${r}${i}-leave`]:Object.assign(Object.assign({},yWe(n)),{animationPlayState:"paused"}),[` ${r}${i}-enter${i}-enter-active, ${r}${i}-appear${i}-appear-active - `]:{animationName:e,animationPlayState:"running"},[`${r}${i}-leave${i}-leave-active`]:{animationName:t,animationPlayState:"running",pointerEvents:"none"}}},gWe=new ji("antFadeIn",{"0%":{opacity:0},"100%":{opacity:1}}),pWe=new ji("antFadeOut",{"0%":{opacity:1},"100%":{opacity:0}}),mWe=function(i){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const{antCls:t}=i,n=`${t}-fade`,o=e?"&":"";return[I4(n,gWe,pWe,i.motionDurationMid,e),{[` + `]:{animationName:e,animationPlayState:"running"},[`${r}${i}-leave${i}-leave-active`]:{animationName:t,animationPlayState:"running",pointerEvents:"none"}}},wWe=new ji("antFadeIn",{"0%":{opacity:0},"100%":{opacity:1}}),SWe=new ji("antFadeOut",{"0%":{opacity:1},"100%":{opacity:0}}),xWe=function(i){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const{antCls:t}=i,n=`${t}-fade`,o=e?"&":"";return[T4(n,wWe,SWe,i.motionDurationMid,e),{[` ${o}${n}-enter, ${o}${n}-appear - `]:{opacity:0,animationTimingFunction:"linear"},[`${o}${n}-leave`]:{animationTimingFunction:"linear"}}]},vWe=new ji("antMoveDownIn",{"0%":{transform:"translate3d(0, 100%, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),_We=new ji("antMoveDownOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(0, 100%, 0)",transformOrigin:"0 0",opacity:0}}),bWe=new ji("antMoveLeftIn",{"0%":{transform:"translate3d(-100%, 0, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),CWe=new ji("antMoveLeftOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(-100%, 0, 0)",transformOrigin:"0 0",opacity:0}}),wWe=new ji("antMoveRightIn",{"0%":{transform:"translate3d(100%, 0, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),yWe=new ji("antMoveRightOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(100%, 0, 0)",transformOrigin:"0 0",opacity:0}}),SWe=new ji("antMoveUpIn",{"0%":{transform:"translate3d(0, -100%, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),xWe=new ji("antMoveUpOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(0, -100%, 0)",transformOrigin:"0 0",opacity:0}}),LWe={"move-up":{inKeyframes:SWe,outKeyframes:xWe},"move-down":{inKeyframes:vWe,outKeyframes:_We},"move-left":{inKeyframes:bWe,outKeyframes:CWe},"move-right":{inKeyframes:wWe,outKeyframes:yWe}},Ane=(i,e)=>{const{antCls:t}=i,n=`${t}-${e}`,{inKeyframes:o,outKeyframes:r}=LWe[e];return[I4(n,o,r,i.motionDurationMid),{[` + `]:{opacity:0,animationTimingFunction:"linear"},[`${o}${n}-leave`]:{animationTimingFunction:"linear"}}]},LWe=new ji("antMoveDownIn",{"0%":{transform:"translate3d(0, 100%, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),EWe=new ji("antMoveDownOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(0, 100%, 0)",transformOrigin:"0 0",opacity:0}}),DWe=new ji("antMoveLeftIn",{"0%":{transform:"translate3d(-100%, 0, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),kWe=new ji("antMoveLeftOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(-100%, 0, 0)",transformOrigin:"0 0",opacity:0}}),IWe=new ji("antMoveRightIn",{"0%":{transform:"translate3d(100%, 0, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),TWe=new ji("antMoveRightOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(100%, 0, 0)",transformOrigin:"0 0",opacity:0}}),NWe=new ji("antMoveUpIn",{"0%":{transform:"translate3d(0, -100%, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),RWe=new ji("antMoveUpOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(0, -100%, 0)",transformOrigin:"0 0",opacity:0}}),MWe={"move-up":{inKeyframes:NWe,outKeyframes:RWe},"move-down":{inKeyframes:LWe,outKeyframes:EWe},"move-left":{inKeyframes:DWe,outKeyframes:kWe},"move-right":{inKeyframes:IWe,outKeyframes:TWe}},$ne=(i,e)=>{const{antCls:t}=i,n=`${t}-${e}`,{inKeyframes:o,outKeyframes:r}=MWe[e];return[T4(n,o,r,i.motionDurationMid),{[` ${n}-enter, ${n}-appear - `]:{opacity:0,animationTimingFunction:i.motionEaseOutCirc},[`${n}-leave`]:{animationTimingFunction:i.motionEaseInOutCirc}}]},ime=new ji("antSlideUpIn",{"0%":{transform:"scaleY(0.8)",transformOrigin:"0% 0%",opacity:0},"100%":{transform:"scaleY(1)",transformOrigin:"0% 0%",opacity:1}}),ome=new ji("antSlideUpOut",{"0%":{transform:"scaleY(1)",transformOrigin:"0% 0%",opacity:1},"100%":{transform:"scaleY(0.8)",transformOrigin:"0% 0%",opacity:0}}),rme=new ji("antSlideDownIn",{"0%":{transform:"scaleY(0.8)",transformOrigin:"100% 100%",opacity:0},"100%":{transform:"scaleY(1)",transformOrigin:"100% 100%",opacity:1}}),sme=new ji("antSlideDownOut",{"0%":{transform:"scaleY(1)",transformOrigin:"100% 100%",opacity:1},"100%":{transform:"scaleY(0.8)",transformOrigin:"100% 100%",opacity:0}}),EWe=new ji("antSlideLeftIn",{"0%":{transform:"scaleX(0.8)",transformOrigin:"0% 0%",opacity:0},"100%":{transform:"scaleX(1)",transformOrigin:"0% 0%",opacity:1}}),DWe=new ji("antSlideLeftOut",{"0%":{transform:"scaleX(1)",transformOrigin:"0% 0%",opacity:1},"100%":{transform:"scaleX(0.8)",transformOrigin:"0% 0%",opacity:0}}),kWe=new ji("antSlideRightIn",{"0%":{transform:"scaleX(0.8)",transformOrigin:"100% 0%",opacity:0},"100%":{transform:"scaleX(1)",transformOrigin:"100% 0%",opacity:1}}),IWe=new ji("antSlideRightOut",{"0%":{transform:"scaleX(1)",transformOrigin:"100% 0%",opacity:1},"100%":{transform:"scaleX(0.8)",transformOrigin:"100% 0%",opacity:0}}),TWe={"slide-up":{inKeyframes:ime,outKeyframes:ome},"slide-down":{inKeyframes:rme,outKeyframes:sme},"slide-left":{inKeyframes:EWe,outKeyframes:DWe},"slide-right":{inKeyframes:kWe,outKeyframes:IWe}},SA=(i,e)=>{const{antCls:t}=i,n=`${t}-${e}`,{inKeyframes:o,outKeyframes:r}=TWe[e];return[I4(n,o,r,i.motionDurationMid),{[` + `]:{opacity:0,animationTimingFunction:i.motionEaseOutCirc},[`${n}-leave`]:{animationTimingFunction:i.motionEaseInOutCirc}}]},ume=new ji("antSlideUpIn",{"0%":{transform:"scaleY(0.8)",transformOrigin:"0% 0%",opacity:0},"100%":{transform:"scaleY(1)",transformOrigin:"0% 0%",opacity:1}}),dme=new ji("antSlideUpOut",{"0%":{transform:"scaleY(1)",transformOrigin:"0% 0%",opacity:1},"100%":{transform:"scaleY(0.8)",transformOrigin:"0% 0%",opacity:0}}),hme=new ji("antSlideDownIn",{"0%":{transform:"scaleY(0.8)",transformOrigin:"100% 100%",opacity:0},"100%":{transform:"scaleY(1)",transformOrigin:"100% 100%",opacity:1}}),fme=new ji("antSlideDownOut",{"0%":{transform:"scaleY(1)",transformOrigin:"100% 100%",opacity:1},"100%":{transform:"scaleY(0.8)",transformOrigin:"100% 100%",opacity:0}}),AWe=new ji("antSlideLeftIn",{"0%":{transform:"scaleX(0.8)",transformOrigin:"0% 0%",opacity:0},"100%":{transform:"scaleX(1)",transformOrigin:"0% 0%",opacity:1}}),PWe=new ji("antSlideLeftOut",{"0%":{transform:"scaleX(1)",transformOrigin:"0% 0%",opacity:1},"100%":{transform:"scaleX(0.8)",transformOrigin:"0% 0%",opacity:0}}),OWe=new ji("antSlideRightIn",{"0%":{transform:"scaleX(0.8)",transformOrigin:"100% 0%",opacity:0},"100%":{transform:"scaleX(1)",transformOrigin:"100% 0%",opacity:1}}),FWe=new ji("antSlideRightOut",{"0%":{transform:"scaleX(1)",transformOrigin:"100% 0%",opacity:1},"100%":{transform:"scaleX(0.8)",transformOrigin:"100% 0%",opacity:0}}),BWe={"slide-up":{inKeyframes:ume,outKeyframes:dme},"slide-down":{inKeyframes:hme,outKeyframes:fme},"slide-left":{inKeyframes:AWe,outKeyframes:PWe},"slide-right":{inKeyframes:OWe,outKeyframes:FWe}},EA=(i,e)=>{const{antCls:t}=i,n=`${t}-${e}`,{inKeyframes:o,outKeyframes:r}=BWe[e];return[T4(n,o,r,i.motionDurationMid),{[` ${n}-enter, ${n}-appear - `]:{transform:"scale(0)",transformOrigin:"0% 0%",opacity:0,animationTimingFunction:i.motionEaseOutQuint,["&-prepare"]:{transform:"scale(1)"}},[`${n}-leave`]:{animationTimingFunction:i.motionEaseInQuint}}]},JK=new ji("antZoomIn",{"0%":{transform:"scale(0.2)",opacity:0},"100%":{transform:"scale(1)",opacity:1}}),NWe=new ji("antZoomOut",{"0%":{transform:"scale(1)"},"100%":{transform:"scale(0.2)",opacity:0}}),Pne=new ji("antZoomBigIn",{"0%":{transform:"scale(0.8)",opacity:0},"100%":{transform:"scale(1)",opacity:1}}),One=new ji("antZoomBigOut",{"0%":{transform:"scale(1)"},"100%":{transform:"scale(0.8)",opacity:0}}),RWe=new ji("antZoomUpIn",{"0%":{transform:"scale(0.8)",transformOrigin:"50% 0%",opacity:0},"100%":{transform:"scale(1)",transformOrigin:"50% 0%"}}),MWe=new ji("antZoomUpOut",{"0%":{transform:"scale(1)",transformOrigin:"50% 0%"},"100%":{transform:"scale(0.8)",transformOrigin:"50% 0%",opacity:0}}),AWe=new ji("antZoomLeftIn",{"0%":{transform:"scale(0.8)",transformOrigin:"0% 50%",opacity:0},"100%":{transform:"scale(1)",transformOrigin:"0% 50%"}}),PWe=new ji("antZoomLeftOut",{"0%":{transform:"scale(1)",transformOrigin:"0% 50%"},"100%":{transform:"scale(0.8)",transformOrigin:"0% 50%",opacity:0}}),OWe=new ji("antZoomRightIn",{"0%":{transform:"scale(0.8)",transformOrigin:"100% 50%",opacity:0},"100%":{transform:"scale(1)",transformOrigin:"100% 50%"}}),FWe=new ji("antZoomRightOut",{"0%":{transform:"scale(1)",transformOrigin:"100% 50%"},"100%":{transform:"scale(0.8)",transformOrigin:"100% 50%",opacity:0}}),BWe=new ji("antZoomDownIn",{"0%":{transform:"scale(0.8)",transformOrigin:"50% 100%",opacity:0},"100%":{transform:"scale(1)",transformOrigin:"50% 100%"}}),WWe=new ji("antZoomDownOut",{"0%":{transform:"scale(1)",transformOrigin:"50% 100%"},"100%":{transform:"scale(0.8)",transformOrigin:"50% 100%",opacity:0}}),VWe={zoom:{inKeyframes:JK,outKeyframes:NWe},"zoom-big":{inKeyframes:Pne,outKeyframes:One},"zoom-big-fast":{inKeyframes:Pne,outKeyframes:One},"zoom-left":{inKeyframes:AWe,outKeyframes:PWe},"zoom-right":{inKeyframes:OWe,outKeyframes:FWe},"zoom-up":{inKeyframes:RWe,outKeyframes:MWe},"zoom-down":{inKeyframes:BWe,outKeyframes:WWe}},ame=(i,e)=>{const{antCls:t}=i,n=`${t}-${e}`,{inKeyframes:o,outKeyframes:r}=VWe[e];return[I4(n,o,r,e==="zoom-big-fast"?i.motionDurationFast:i.motionDurationMid),{[` + `]:{transform:"scale(0)",transformOrigin:"0% 0%",opacity:0,animationTimingFunction:i.motionEaseOutQuint,["&-prepare"]:{transform:"scale(1)"}},[`${n}-leave`]:{animationTimingFunction:i.motionEaseInQuint}}]},iq=new ji("antZoomIn",{"0%":{transform:"scale(0.2)",opacity:0},"100%":{transform:"scale(1)",opacity:1}}),WWe=new ji("antZoomOut",{"0%":{transform:"scale(1)"},"100%":{transform:"scale(0.2)",opacity:0}}),zne=new ji("antZoomBigIn",{"0%":{transform:"scale(0.8)",opacity:0},"100%":{transform:"scale(1)",opacity:1}}),Une=new ji("antZoomBigOut",{"0%":{transform:"scale(1)"},"100%":{transform:"scale(0.8)",opacity:0}}),VWe=new ji("antZoomUpIn",{"0%":{transform:"scale(0.8)",transformOrigin:"50% 0%",opacity:0},"100%":{transform:"scale(1)",transformOrigin:"50% 0%"}}),HWe=new ji("antZoomUpOut",{"0%":{transform:"scale(1)",transformOrigin:"50% 0%"},"100%":{transform:"scale(0.8)",transformOrigin:"50% 0%",opacity:0}}),$We=new ji("antZoomLeftIn",{"0%":{transform:"scale(0.8)",transformOrigin:"0% 50%",opacity:0},"100%":{transform:"scale(1)",transformOrigin:"0% 50%"}}),zWe=new ji("antZoomLeftOut",{"0%":{transform:"scale(1)",transformOrigin:"0% 50%"},"100%":{transform:"scale(0.8)",transformOrigin:"0% 50%",opacity:0}}),UWe=new ji("antZoomRightIn",{"0%":{transform:"scale(0.8)",transformOrigin:"100% 50%",opacity:0},"100%":{transform:"scale(1)",transformOrigin:"100% 50%"}}),jWe=new ji("antZoomRightOut",{"0%":{transform:"scale(1)",transformOrigin:"100% 50%"},"100%":{transform:"scale(0.8)",transformOrigin:"100% 50%",opacity:0}}),KWe=new ji("antZoomDownIn",{"0%":{transform:"scale(0.8)",transformOrigin:"50% 100%",opacity:0},"100%":{transform:"scale(1)",transformOrigin:"50% 100%"}}),qWe=new ji("antZoomDownOut",{"0%":{transform:"scale(1)",transformOrigin:"50% 100%"},"100%":{transform:"scale(0.8)",transformOrigin:"50% 100%",opacity:0}}),GWe={zoom:{inKeyframes:iq,outKeyframes:WWe},"zoom-big":{inKeyframes:zne,outKeyframes:Une},"zoom-big-fast":{inKeyframes:zne,outKeyframes:Une},"zoom-left":{inKeyframes:$We,outKeyframes:zWe},"zoom-right":{inKeyframes:UWe,outKeyframes:jWe},"zoom-up":{inKeyframes:VWe,outKeyframes:HWe},"zoom-down":{inKeyframes:KWe,outKeyframes:qWe}},gme=(i,e)=>{const{antCls:t}=i,n=`${t}-${e}`,{inKeyframes:o,outKeyframes:r}=GWe[e];return[T4(n,o,r,e==="zoom-big-fast"?i.motionDurationFast:i.motionDurationMid),{[` ${n}-enter, ${n}-appear - `]:{transform:"scale(0)",opacity:0,animationTimingFunction:i.motionEaseOutCirc,"&-prepare":{transform:"none"}},[`${n}-leave`]:{animationTimingFunction:i.motionEaseInOutCirc}}]},HWe=i=>({[i.componentCls]:{[`${i.antCls}-motion-collapse-legacy`]:{overflow:"hidden","&-active":{transition:`height ${i.motionDurationMid} ${i.motionEaseInOut}, + `]:{transform:"scale(0)",opacity:0,animationTimingFunction:i.motionEaseOutCirc,"&-prepare":{transform:"none"}},[`${n}-leave`]:{animationTimingFunction:i.motionEaseInOutCirc}}]},XWe=i=>({[i.componentCls]:{[`${i.antCls}-motion-collapse-legacy`]:{overflow:"hidden","&-active":{transition:`height ${i.motionDurationMid} ${i.motionEaseInOut}, opacity ${i.motionDurationMid} ${i.motionEaseInOut} !important`}},[`${i.antCls}-motion-collapse`]:{overflow:"hidden",transition:`height ${i.motionDurationMid} ${i.motionEaseInOut}, - opacity ${i.motionDurationMid} ${i.motionEaseInOut} !important`}}});var lme=HWe;function Fne(i){return{position:i,inset:0}}const $We=i=>{const{componentCls:e,antCls:t}=i;return[{[`${e}-root`]:{[`${e}${t}-zoom-enter, ${e}${t}-zoom-appear`]:{transform:"none",opacity:0,animationDuration:i.motionDurationSlow,userSelect:"none"},[`${e}${t}-zoom-leave ${e}-content`]:{pointerEvents:"none"},[`${e}-mask`]:Object.assign(Object.assign({},Fne("fixed")),{zIndex:i.zIndexPopupBase,height:"100%",backgroundColor:i.colorBgMask,pointerEvents:"none",[`${e}-hidden`]:{display:"none"}}),[`${e}-wrap`]:Object.assign(Object.assign({},Fne("fixed")),{zIndex:i.zIndexPopupBase,overflow:"auto",outline:0,WebkitOverflowScrolling:"touch",[`&:has(${e}${t}-zoom-enter), &:has(${e}${t}-zoom-appear)`]:{pointerEvents:"none"}})}},{[`${e}-root`]:mWe(i)}]},zWe=i=>{const{componentCls:e}=i;return[{[`${e}-root`]:{[`${e}-wrap-rtl`]:{direction:"rtl"},[`${e}-centered`]:{textAlign:"center","&::before":{display:"inline-block",width:0,height:"100%",verticalAlign:"middle",content:'""'},[e]:{top:0,display:"inline-block",paddingBottom:0,textAlign:"start",verticalAlign:"middle"}},[`@media (max-width: ${i.screenSMMax}px)`]:{[e]:{maxWidth:"calc(100vw - 16px)",margin:`${rt(i.marginXS)} auto`},[`${e}-centered`]:{[e]:{flex:1}}}}},{[e]:Object.assign(Object.assign({},Aa(i)),{pointerEvents:"none",position:"relative",top:100,width:"auto",maxWidth:`calc(100vw - ${rt(i.calc(i.margin).mul(2).equal())})`,margin:"0 auto",paddingBottom:i.paddingLG,[`${e}-title`]:{margin:0,color:i.titleColor,fontWeight:i.fontWeightStrong,fontSize:i.titleFontSize,lineHeight:i.titleLineHeight,wordWrap:"break-word"},[`${e}-content`]:{position:"relative",backgroundColor:i.contentBg,backgroundClip:"padding-box",border:0,borderRadius:i.borderRadiusLG,boxShadow:i.boxShadow,pointerEvents:"auto",padding:i.contentPadding},[`${e}-close`]:Object.assign({position:"absolute",top:i.calc(i.modalHeaderHeight).sub(i.modalCloseBtnSize).div(2).equal(),insetInlineEnd:i.calc(i.modalHeaderHeight).sub(i.modalCloseBtnSize).div(2).equal(),zIndex:i.calc(i.zIndexPopupBase).add(10).equal(),padding:0,color:i.modalCloseIconColor,fontWeight:i.fontWeightStrong,lineHeight:1,textDecoration:"none",background:"transparent",borderRadius:i.borderRadiusSM,width:i.modalCloseBtnSize,height:i.modalCloseBtnSize,border:0,outline:0,cursor:"pointer",transition:`color ${i.motionDurationMid}, background-color ${i.motionDurationMid}`,"&-x":{display:"flex",fontSize:i.fontSizeLG,fontStyle:"normal",lineHeight:`${rt(i.modalCloseBtnSize)}`,justifyContent:"center",textTransform:"none",textRendering:"auto"},"&:hover":{color:i.modalIconHoverColor,backgroundColor:i.closeBtnHoverBg,textDecoration:"none"},"&:active":{backgroundColor:i.closeBtnActiveBg}},S4(i)),[`${e}-header`]:{color:i.colorText,background:i.headerBg,borderRadius:`${rt(i.borderRadiusLG)} ${rt(i.borderRadiusLG)} 0 0`,marginBottom:i.headerMarginBottom,padding:i.headerPadding,borderBottom:i.headerBorderBottom},[`${e}-body`]:{fontSize:i.fontSize,lineHeight:i.lineHeight,wordWrap:"break-word",padding:i.bodyPadding},[`${e}-footer`]:{textAlign:"end",background:i.footerBg,marginTop:i.footerMarginTop,padding:i.footerPadding,borderTop:i.footerBorderTop,borderRadius:i.footerBorderRadius,[`> ${i.antCls}-btn + ${i.antCls}-btn`]:{marginInlineStart:i.marginXS}},[`${e}-open`]:{overflow:"hidden"}})},{[`${e}-pure-panel`]:{top:"auto",padding:0,display:"flex",flexDirection:"column",[`${e}-content, + opacity ${i.motionDurationMid} ${i.motionEaseInOut} !important`}}});var pme=XWe;function jne(i){return{position:i,inset:0}}const YWe=i=>{const{componentCls:e,antCls:t}=i;return[{[`${e}-root`]:{[`${e}${t}-zoom-enter, ${e}${t}-zoom-appear`]:{transform:"none",opacity:0,animationDuration:i.motionDurationSlow,userSelect:"none"},[`${e}${t}-zoom-leave ${e}-content`]:{pointerEvents:"none"},[`${e}-mask`]:Object.assign(Object.assign({},jne("fixed")),{zIndex:i.zIndexPopupBase,height:"100%",backgroundColor:i.colorBgMask,pointerEvents:"none",[`${e}-hidden`]:{display:"none"}}),[`${e}-wrap`]:Object.assign(Object.assign({},jne("fixed")),{zIndex:i.zIndexPopupBase,overflow:"auto",outline:0,WebkitOverflowScrolling:"touch",[`&:has(${e}${t}-zoom-enter), &:has(${e}${t}-zoom-appear)`]:{pointerEvents:"none"}})}},{[`${e}-root`]:xWe(i)}]},ZWe=i=>{const{componentCls:e}=i;return[{[`${e}-root`]:{[`${e}-wrap-rtl`]:{direction:"rtl"},[`${e}-centered`]:{textAlign:"center","&::before":{display:"inline-block",width:0,height:"100%",verticalAlign:"middle",content:'""'},[e]:{top:0,display:"inline-block",paddingBottom:0,textAlign:"start",verticalAlign:"middle"}},[`@media (max-width: ${i.screenSMMax}px)`]:{[e]:{maxWidth:"calc(100vw - 16px)",margin:`${rt(i.marginXS)} auto`},[`${e}-centered`]:{[e]:{flex:1}}}}},{[e]:Object.assign(Object.assign({},Pa(i)),{pointerEvents:"none",position:"relative",top:100,width:"auto",maxWidth:`calc(100vw - ${rt(i.calc(i.margin).mul(2).equal())})`,margin:"0 auto",paddingBottom:i.paddingLG,[`${e}-title`]:{margin:0,color:i.titleColor,fontWeight:i.fontWeightStrong,fontSize:i.titleFontSize,lineHeight:i.titleLineHeight,wordWrap:"break-word"},[`${e}-content`]:{position:"relative",backgroundColor:i.contentBg,backgroundClip:"padding-box",border:0,borderRadius:i.borderRadiusLG,boxShadow:i.boxShadow,pointerEvents:"auto",padding:i.contentPadding},[`${e}-close`]:Object.assign({position:"absolute",top:i.calc(i.modalHeaderHeight).sub(i.modalCloseBtnSize).div(2).equal(),insetInlineEnd:i.calc(i.modalHeaderHeight).sub(i.modalCloseBtnSize).div(2).equal(),zIndex:i.calc(i.zIndexPopupBase).add(10).equal(),padding:0,color:i.modalCloseIconColor,fontWeight:i.fontWeightStrong,lineHeight:1,textDecoration:"none",background:"transparent",borderRadius:i.borderRadiusSM,width:i.modalCloseBtnSize,height:i.modalCloseBtnSize,border:0,outline:0,cursor:"pointer",transition:`color ${i.motionDurationMid}, background-color ${i.motionDurationMid}`,"&-x":{display:"flex",fontSize:i.fontSizeLG,fontStyle:"normal",lineHeight:`${rt(i.modalCloseBtnSize)}`,justifyContent:"center",textTransform:"none",textRendering:"auto"},"&:hover":{color:i.modalIconHoverColor,backgroundColor:i.closeBtnHoverBg,textDecoration:"none"},"&:active":{backgroundColor:i.closeBtnActiveBg}},x4(i)),[`${e}-header`]:{color:i.colorText,background:i.headerBg,borderRadius:`${rt(i.borderRadiusLG)} ${rt(i.borderRadiusLG)} 0 0`,marginBottom:i.headerMarginBottom,padding:i.headerPadding,borderBottom:i.headerBorderBottom},[`${e}-body`]:{fontSize:i.fontSize,lineHeight:i.lineHeight,wordWrap:"break-word",padding:i.bodyPadding},[`${e}-footer`]:{textAlign:"end",background:i.footerBg,marginTop:i.footerMarginTop,padding:i.footerPadding,borderTop:i.footerBorderTop,borderRadius:i.footerBorderRadius,[`> ${i.antCls}-btn + ${i.antCls}-btn`]:{marginInlineStart:i.marginXS}},[`${e}-open`]:{overflow:"hidden"}})},{[`${e}-pure-panel`]:{top:"auto",padding:0,display:"flex",flexDirection:"column",[`${e}-content, ${e}-body, - ${e}-confirm-body-wrapper`]:{display:"flex",flexDirection:"column",flex:"auto"},[`${e}-confirm-body`]:{marginBottom:"auto"}}}]},UWe=i=>{const{componentCls:e}=i;return{[`${e}-root`]:{[`${e}-wrap-rtl`]:{direction:"rtl",[`${e}-confirm-body`]:{direction:"rtl"}}}}},cme=i=>{const e=i.padding,t=i.fontSizeHeading5,n=i.lineHeightHeading5;return lr(i,{modalHeaderHeight:i.calc(i.calc(n).mul(t).equal()).add(i.calc(e).mul(2).equal()).equal(),modalFooterBorderColorSplit:i.colorSplit,modalFooterBorderStyle:i.lineType,modalFooterBorderWidth:i.lineWidth,modalIconHoverColor:i.colorIconHover,modalCloseIconColor:i.colorIcon,modalCloseBtnSize:i.fontHeight,modalConfirmIconSize:i.fontHeight,modalTitleHeight:i.calc(i.titleFontSize).mul(i.titleLineHeight).equal()})},ume=i=>({footerBg:"transparent",headerBg:i.colorBgElevated,titleLineHeight:i.lineHeightHeading5,titleFontSize:i.fontSizeHeading5,contentBg:i.colorBgElevated,titleColor:i.colorTextHeading,closeBtnHoverBg:i.wireframe?"transparent":i.colorFillContent,closeBtnActiveBg:i.wireframe?"transparent":i.colorFillContentHover,contentPadding:i.wireframe?0:`${rt(i.paddingMD)} ${rt(i.paddingContentHorizontalLG)}`,headerPadding:i.wireframe?`${rt(i.padding)} ${rt(i.paddingLG)}`:0,headerBorderBottom:i.wireframe?`${rt(i.lineWidth)} ${i.lineType} ${i.colorSplit}`:"none",headerMarginBottom:i.wireframe?0:i.marginXS,bodyPadding:i.wireframe?i.paddingLG:0,footerPadding:i.wireframe?`${rt(i.paddingXS)} ${rt(i.padding)}`:0,footerBorderTop:i.wireframe?`${rt(i.lineWidth)} ${i.lineType} ${i.colorSplit}`:"none",footerBorderRadius:i.wireframe?`0 0 ${rt(i.borderRadiusLG)} ${rt(i.borderRadiusLG)}`:0,footerMarginTop:i.wireframe?0:i.marginSM,confirmBodyPadding:i.wireframe?`${rt(i.padding*2)} ${rt(i.padding*2)} ${rt(i.paddingLG)}`:0,confirmIconMarginInlineEnd:i.wireframe?i.margin:i.marginSM,confirmBtnsMarginTop:i.wireframe?i.marginLG:i.marginSM});var dme=Uc("Modal",i=>{const e=cme(i);return[zWe(e),UWe(e),$We(e),ame(e,"zoom")]},ume,{unitless:{titleLineHeight:!0}}),jWe=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(i);o{DW={x:i.pageX,y:i.pageY},setTimeout(()=>{DW=null},100)};pBe()&&document.documentElement.addEventListener("click",KWe,!0);const qWe=i=>{var e;const{getPopupContainer:t,getPrefixCls:n,direction:o,modal:r}=x.exports.useContext(Hi),s=G=>{const{onCancel:X}=i;X==null||X(G)},a=G=>{const{onOk:X}=i;X==null||X(G)},{prefixCls:l,className:c,rootClassName:u,open:d,wrapClassName:h,centered:f,getContainer:g,closeIcon:p,closable:v,focusTriggerAfterClose:m=!0,style:_,visible:w,width:y=520,footer:L,classNames:D,styles:E}=i,I=jWe(i,["prefixCls","className","rootClassName","open","wrapClassName","centered","getContainer","closeIcon","closable","focusTriggerAfterClose","style","visible","width","footer","classNames","styles"]),k=n("modal",l),R=n(),A=th(k),[P,N,M]=dme(k,A),H=Ue(h,{[`${k}-centered`]:!!f,[`${k}-wrap-rtl`]:o==="rtl"}),W=L!==null&&x.exports.createElement(nme,Object.assign({},i,{onOk:a,onCancel:s})),[F,$]=gBe(v,p,G=>tme(k,G),x.exports.createElement(cS,{className:`${k}-close-icon`}),!0),z=cWe(`.${k}-content`),[K,j]=HK("Modal",I.zIndex);return P(x.exports.createElement(wA,null,x.exports.createElement(EW,{status:!0,override:!0},x.exports.createElement(WK.Provider,{value:j},x.exports.createElement(Upe,Object.assign({width:y},I,{zIndex:K,getContainer:g===void 0?t:g,prefixCls:k,rootClassName:Ue(N,u,M,A),footer:W,visible:d!=null?d:w,mousePosition:(e=I.mousePosition)!==null&&e!==void 0?e:DW,onClose:s,closable:F,closeIcon:$,focusTriggerAfterClose:m,transitionName:U0(R,"zoom",i.transitionName),maskTransitionName:U0(R,"fade",i.maskTransitionName),className:Ue(N,c,r==null?void 0:r.className),style:Object.assign(Object.assign({},r==null?void 0:r.style),_),classNames:Object.assign(Object.assign({wrapper:H},r==null?void 0:r.classNames),D),styles:Object.assign(Object.assign({},r==null?void 0:r.styles),E),panelRef:z}))))))};var hme=qWe;const GWe=i=>{const{componentCls:e,titleFontSize:t,titleLineHeight:n,modalConfirmIconSize:o,fontSize:r,lineHeight:s,modalTitleHeight:a,fontHeight:l,confirmBodyPadding:c}=i,u=`${e}-confirm`;return{[u]:{"&-rtl":{direction:"rtl"},[`${i.antCls}-modal-header`]:{display:"none"},[`${u}-body-wrapper`]:Object.assign({},Gge()),[`&${e} ${e}-body`]:{padding:c},[`${u}-body`]:{display:"flex",flexWrap:"nowrap",alignItems:"start",[`> ${i.iconCls}`]:{flex:"none",fontSize:o,marginInlineEnd:i.confirmIconMarginInlineEnd,marginTop:i.calc(i.calc(l).sub(o).equal()).div(2).equal()},[`&-has-title > ${i.iconCls}`]:{marginTop:i.calc(i.calc(a).sub(o).equal()).div(2).equal()}},[`${u}-paragraph`]:{display:"flex",flexDirection:"column",flex:"auto",rowGap:i.marginXS,maxWidth:`calc(100% - ${rt(i.calc(i.modalConfirmIconSize).add(i.marginSM).equal())})`},[`${u}-title`]:{color:i.colorTextHeading,fontWeight:i.fontWeightStrong,fontSize:t,lineHeight:n},[`${u}-content`]:{color:i.colorText,fontSize:r,lineHeight:s},[`${u}-btns`]:{textAlign:"end",marginTop:i.confirmBtnsMarginTop,[`${i.antCls}-btn + ${i.antCls}-btn`]:{marginBottom:0,marginInlineStart:i.marginXS}}},[`${u}-error ${u}-body > ${i.iconCls}`]:{color:i.colorError},[`${u}-warning ${u}-body > ${i.iconCls}, - ${u}-confirm ${u}-body > ${i.iconCls}`]:{color:i.colorWarning},[`${u}-info ${u}-body > ${i.iconCls}`]:{color:i.colorInfo},[`${u}-success ${u}-body > ${i.iconCls}`]:{color:i.colorSuccess}}};var XWe=MK(["Modal","confirm"],i=>{const e=cme(i);return[GWe(e)]},ume,{order:-1e3}),YWe=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(i);o_,_t(Object.values(_))),y=x.exports.createElement(x.exports.Fragment,null,x.exports.createElement(lne,null),x.exports.createElement(cne,null)),L=i.title!==void 0&&i.title!==null,D=`${r}-body`;return x.exports.createElement("div",{className:`${r}-body-wrapper`},x.exports.createElement("div",{className:Ue(D,{[`${D}-has-title`]:L})},d,x.exports.createElement("div",{className:`${r}-paragraph`},L&&x.exports.createElement("span",{className:`${r}-title`},i.title),x.exports.createElement("div",{className:`${r}-content`},i.content))),l===void 0||typeof l=="function"?x.exports.createElement(Bpe,{value:w},x.exports.createElement("div",{className:`${r}-btns`},typeof l=="function"?l(y,{OkBtn:cne,CancelBtn:lne}):y)):l,x.exports.createElement(XWe,{prefixCls:e}))}const ZWe=i=>{const{close:e,zIndex:t,afterClose:n,open:o,keyboard:r,centered:s,getContainer:a,maskStyle:l,direction:c,prefixCls:u,wrapClassName:d,rootPrefixCls:h,bodyStyle:f,closable:g=!1,closeIcon:p,modalRender:v,focusTriggerAfterClose:m,onConfirm:_,styles:w}=i,y=`${u}-confirm`,L=i.width||416,D=i.style||{},E=i.mask===void 0?!0:i.mask,I=i.maskClosable===void 0?!1:i.maskClosable,k=Ue(y,`${y}-${i.type}`,{[`${y}-rtl`]:c==="rtl"},i.className),[,R]=Fa(),A=x.exports.useMemo(()=>t!==void 0?t:R.zIndexPopupBase+VK,[t,R]);return x.exports.createElement(hme,{prefixCls:u,className:k,wrapClassName:Ue({[`${y}-centered`]:!!i.centered},d),onCancel:()=>{e==null||e({triggerCancel:!0}),_==null||_(!1)},open:o,title:"",footer:null,transitionName:U0(h||"","zoom",i.transitionName),maskTransitionName:U0(h||"","fade",i.maskTransitionName),mask:E,maskClosable:I,style:D,styles:Object.assign({body:f,mask:l},w),width:L,zIndex:A,afterClose:n,keyboard:r,centered:s,getContainer:a,closable:g,closeIcon:p,modalRender:v,focusTriggerAfterClose:m},x.exports.createElement(fme,Object.assign({},i,{confirmPrefixCls:y})))},gme=i=>{const{rootPrefixCls:e,iconPrefixCls:t,direction:n,theme:o}=i;return x.exports.createElement(hp,{prefixCls:e,iconPrefixCls:t,direction:n,theme:o},x.exports.createElement(ZWe,Object.assign({},i)))},QWe=[];var o0=QWe;let pme="";function mme(){return pme}const JWe=i=>{var e,t;const{prefixCls:n,getContainer:o,direction:r}=i,s=Oge(),a=x.exports.useContext(Hi),l=mme()||a.getPrefixCls(),c=n||`${l}-modal`;let u=o;return u===!1&&(u=void 0),fe(gme,{...Object.assign({},i,{rootPrefixCls:l,prefixCls:c,iconPrefixCls:a.iconPrefixCls,theme:a.theme,direction:r!=null?r:a.direction,locale:(t=(e=a.locale)===null||e===void 0?void 0:e.Modal)!==null&&t!==void 0?t:s,getContainer:u})})};function kI(i){const e=PK(),t=document.createDocumentFragment();let n=Object.assign(Object.assign({},i),{close:a,open:!0}),o;function r(){for(var c=arguments.length,u=new Array(c),d=0;df&&f.triggerCancel);i.onCancel&&h&&i.onCancel.apply(i,[()=>{}].concat(_t(u.slice(1))));for(let f=0;f{const u=e.getPrefixCls(void 0,mme()),d=e.getIconPrefixCls(),h=e.getTheme(),f=fe(JWe,{...Object.assign({},c)});zK(fe(hp,{prefixCls:u,iconPrefixCls:d,theme:h,children:e.holderRender?e.holderRender(f):f}),t)})}function a(){for(var c=arguments.length,u=new Array(c),d=0;d{typeof i.afterClose=="function"&&i.afterClose(),r.apply(this,u)}}),n.visible&&delete n.visible,s(n)}function l(c){typeof c=="function"?n=c(n):n=Object.assign(Object.assign({},n),c),s(n)}return s(n),o0.push(a),{destroy:a,update:l}}function vme(i){return Object.assign(Object.assign({},i),{type:"warning"})}function _me(i){return Object.assign(Object.assign({},i),{type:"info"})}function bme(i){return Object.assign(Object.assign({},i),{type:"success"})}function Cme(i){return Object.assign(Object.assign({},i),{type:"error"})}function wme(i){return Object.assign(Object.assign({},i),{type:"confirm"})}function eVe(i){let{rootPrefixCls:e}=i;pme=e}var tVe=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(i);o{var t,{afterClose:n,config:o}=i,r=tVe(i,["afterClose","config"]);const[s,a]=x.exports.useState(!0),[l,c]=x.exports.useState(o),{direction:u,getPrefixCls:d}=x.exports.useContext(Hi),h=d("modal"),f=d(),g=()=>{var _;n(),(_=l.afterClose)===null||_===void 0||_.call(l)},p=function(){a(!1);for(var _=arguments.length,w=new Array(_),y=0;y<_;y++)w[y]=arguments[y];const L=w.some(D=>D&&D.triggerCancel);l.onCancel&&L&&l.onCancel.apply(l,[()=>{}].concat(_t(w.slice(1))))};x.exports.useImperativeHandle(e,()=>({destroy:p,update:_=>{c(w=>Object.assign(Object.assign({},w),_))}}));const v=(t=l.okCancel)!==null&&t!==void 0?t:l.type==="confirm",[m]=yI("Modal",gv.Modal);return x.exports.createElement(gme,Object.assign({prefixCls:h,rootPrefixCls:f},l,{close:p,open:s,afterClose:g,okText:l.okText||(v?m==null?void 0:m.okText:m==null?void 0:m.justOkText),direction:l.direction||u,cancelText:l.cancelText||(m==null?void 0:m.cancelText)},r))};var iVe=x.exports.forwardRef(nVe);let Bne=0;const oVe=x.exports.memo(x.exports.forwardRef((i,e)=>{const[t,n]=Y9e();return x.exports.useImperativeHandle(e,()=>({patchElement:n}),[]),x.exports.createElement(x.exports.Fragment,null,t)}));function rVe(){const i=x.exports.useRef(null),[e,t]=x.exports.useState([]);x.exports.useEffect(()=>{e.length&&(_t(e).forEach(s=>{s()}),t([]))},[e]);const n=x.exports.useCallback(r=>function(a){var l;Bne+=1;const c=x.exports.createRef();let u;const d=new Promise(v=>{u=v});let h=!1,f;const g=x.exports.createElement(iVe,{key:`modal-${Bne}`,config:r(a),ref:c,afterClose:()=>{f==null||f()},isSilent:()=>h,onConfirm:v=>{u(v)}});return f=(l=i.current)===null||l===void 0?void 0:l.patchElement(g),f&&o0.push(f),{destroy:()=>{function v(){var m;(m=c.current)===null||m===void 0||m.destroy()}c.current?v():t(m=>[].concat(_t(m),[v]))},update:v=>{function m(){var _;(_=c.current)===null||_===void 0||_.update(v)}c.current?m():t(_=>[].concat(_t(_),[m]))},then:v=>(h=!0,d.then(v))}},[]);return[x.exports.useMemo(()=>({info:n(_me),success:n(bme),error:n(Cme),warning:n(vme),confirm:n(wme)}),[]),x.exports.createElement(oVe,{key:"modal-holder",ref:i})]}const sVe=Bt.createContext({});function yme(i){return e=>x.exports.createElement(hp,{theme:{token:{motion:!1,zIndexPopupBase:0}}},x.exports.createElement(i,Object.assign({},e)))}const aVe=(i,e,t,n)=>yme(r=>{const{prefixCls:s,style:a}=r,l=x.exports.useRef(null),[c,u]=x.exports.useState(0),[d,h]=x.exports.useState(0),[f,g]=jl(!1,{value:r.open}),{getPrefixCls:p}=x.exports.useContext(Hi),v=p(e||"select",s);x.exports.useEffect(()=>{if(g(!0),typeof ResizeObserver!="undefined"){const w=new ResizeObserver(L=>{const D=L[0].target;u(D.offsetHeight+8),h(D.offsetWidth)}),y=setInterval(()=>{var L;const D=t?`.${t(v)}`:`.${v}-dropdown`,E=(L=l.current)===null||L===void 0?void 0:L.querySelector(D);E&&(clearInterval(y),w.observe(E))},10);return()=>{clearInterval(y),w.disconnect()}}},[]);let m=Object.assign(Object.assign({},r),{style:Object.assign(Object.assign({},a),{margin:0}),open:f,visible:f,getPopupContainer:()=>l.current});n&&(m=n(m));const _={paddingBottom:c,position:"relative",minWidth:d};return x.exports.createElement("div",{ref:l,style:_},x.exports.createElement(i,Object.assign({},m)))});var lVe=aVe,eq=function(){if(typeof navigator=="undefined"||typeof window=="undefined")return!1;var i=navigator.userAgent||navigator.vendor||window.opera;return/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(i)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(i==null?void 0:i.substr(0,4))},T4=function(e){var t=e.className,n=e.customizeIcon,o=e.customizeIconProps,r=e.children,s=e.onMouseDown,a=e.onClick,l=typeof n=="function"?n(o):n;return x.exports.createElement("span",{className:t,onMouseDown:function(u){u.preventDefault(),s==null||s(u)},style:{userSelect:"none",WebkitUserSelect:"none"},unselectable:"on",onClick:a,"aria-hidden":!0},l!==void 0?l:x.exports.createElement("span",{className:Ue(t.split(/\s+/).map(function(c){return"".concat(c,"-icon")}))},r))},cVe=function(e,t,n,o,r){var s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!1,a=arguments.length>6?arguments[6]:void 0,l=arguments.length>7?arguments[7]:void 0,c=Bt.useMemo(function(){if(Kn(o)==="object")return o.clearIcon;if(r)return r},[o,r]),u=Bt.useMemo(function(){return!!(!s&&!!o&&(n.length||a)&&!(l==="combobox"&&a===""))},[o,s,n.length,a,l]);return{allowClear:u,clearIcon:Bt.createElement(T4,{className:"".concat(e,"-clear"),onMouseDown:t,customizeIcon:c},"\xD7")}},Sme=x.exports.createContext(null);function uVe(){return x.exports.useContext(Sme)}function dVe(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:10,e=x.exports.useState(!1),t=Ne(e,2),n=t[0],o=t[1],r=x.exports.useRef(null),s=function(){window.clearTimeout(r.current)};x.exports.useEffect(function(){return s},[]);var a=function(c,u){s(),r.current=window.setTimeout(function(){o(c),u&&u()},i)};return[n,a,s]}function xme(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:250,e=x.exports.useRef(null),t=x.exports.useRef(null);x.exports.useEffect(function(){return function(){window.clearTimeout(t.current)}},[]);function n(o){(o||e.current===null)&&(e.current=o),window.clearTimeout(t.current),t.current=window.setTimeout(function(){e.current=null},i)}return[function(){return e.current},n]}function hVe(i,e,t,n){var o=x.exports.useRef(null);o.current={open:e,triggerOpen:t,customizedTrigger:n},x.exports.useEffect(function(){function r(s){var a;if(!((a=o.current)!==null&&a!==void 0&&a.customizedTrigger)){var l=s.target;l.shadowRoot&&s.composed&&(l=s.composedPath()[0]||l),o.current.open&&i().filter(function(c){return c}).every(function(c){return!c.contains(l)&&c!==l})&&o.current.triggerOpen(!1)}}return window.addEventListener("mousedown",r),function(){return window.removeEventListener("mousedown",r)}},[])}var fVe=["prefixCls","invalidate","item","renderItem","responsive","responsiveDisabled","registerSize","itemKey","className","style","children","display","order","component"],k1=void 0;function gVe(i,e){var t=i.prefixCls,n=i.invalidate,o=i.item,r=i.renderItem,s=i.responsive,a=i.responsiveDisabled,l=i.registerSize,c=i.itemKey,u=i.className,d=i.style,h=i.children,f=i.display,g=i.order,p=i.component,v=p===void 0?"div":p,m=Hn(i,fVe),_=s&&!f;function w(I){l(c,I)}x.exports.useEffect(function(){return function(){w(null)}},[]);var y=r&&o!==k1?r(o):h,L;n||(L={opacity:_?0:1,height:_?0:k1,overflowY:_?"hidden":k1,order:s?g:k1,pointerEvents:_?"none":k1,position:_?"absolute":k1});var D={};_&&(D["aria-hidden"]=!0);var E=x.exports.createElement(v,Ct({className:Ue(!n&&t,u),style:Ce(Ce({},L),d)},D,m,{ref:e}),y);return s&&(E=x.exports.createElement(Md,{onResize:function(k){var R=k.offsetWidth;w(R)},disabled:a},E)),E}var iE=x.exports.forwardRef(gVe);iE.displayName="Item";function pVe(i){if(typeof MessageChannel=="undefined")Xi(i);else{var e=new MessageChannel;e.port1.onmessage=function(){return i()},e.port2.postMessage(void 0)}}function mVe(){var i=x.exports.useRef(null),e=function(n){i.current||(i.current=[],pVe(function(){uf.exports.unstable_batchedUpdates(function(){i.current.forEach(function(o){o()}),i.current=null})})),i.current.push(n)};return e}function yx(i,e){var t=x.exports.useState(e),n=Ne(t,2),o=n[0],r=n[1],s=el(function(a){i(function(){r(a)})});return[o,s]}var xA=Bt.createContext(null),vVe=["component"],_Ve=["className"],bVe=["className"],CVe=function(e,t){var n=x.exports.useContext(xA);if(!n){var o=e.component,r=o===void 0?"div":o,s=Hn(e,vVe);return x.exports.createElement(r,Ct({},s,{ref:t}))}var a=n.className,l=Hn(n,_Ve),c=e.className,u=Hn(e,bVe);return x.exports.createElement(xA.Provider,{value:null},x.exports.createElement(iE,Ct({ref:t,className:Ue(a,c)},l,u)))},Lme=x.exports.forwardRef(CVe);Lme.displayName="RawItem";var wVe=["prefixCls","data","renderItem","renderRawItem","itemKey","itemWidth","ssr","style","className","maxCount","renderRest","renderRawRest","suffix","component","itemComponent","onVisibleChange"],Eme="responsive",Dme="invalidate";function yVe(i){return"+ ".concat(i.length," ...")}function SVe(i,e){var t=i.prefixCls,n=t===void 0?"rc-overflow":t,o=i.data,r=o===void 0?[]:o,s=i.renderItem,a=i.renderRawItem,l=i.itemKey,c=i.itemWidth,u=c===void 0?10:c,d=i.ssr,h=i.style,f=i.className,g=i.maxCount,p=i.renderRest,v=i.renderRawRest,m=i.suffix,_=i.component,w=_===void 0?"div":_,y=i.itemComponent,L=i.onVisibleChange,D=Hn(i,wVe),E=d==="full",I=mVe(),k=yx(I,null),R=Ne(k,2),A=R[0],P=R[1],N=A||0,M=yx(I,new Map),H=Ne(M,2),W=H[0],F=H[1],$=yx(I,0),z=Ne($,2),K=z[0],j=z[1],G=yx(I,0),X=Ne(G,2),de=X[0],he=X[1],pe=yx(I,0),be=Ne(pe,2),Se=be[0],Fe=be[1],De=x.exports.useState(null),ce=Ne(De,2),Pe=ce[0],Oe=ce[1],xe=x.exports.useState(null),Ee=Ne(xe,2),tt=Ee[0],nt=Ee[1],Qe=x.exports.useMemo(function(){return tt===null&&E?Number.MAX_SAFE_INTEGER:tt||0},[tt,A]),Ge=x.exports.useState(!1),re=Ne(Ge,2),ie=re[0],se=re[1],U="".concat(n,"-item"),Y=Math.max(K,de),oe=g===Eme,te=r.length&&oe,we=g===Dme,Le=te||typeof g=="number"&&r.length>g,Te=x.exports.useMemo(function(){var Nt=r;return te?A===null&&E?Nt=r:Nt=r.slice(0,Math.min(r.length,N/u)):typeof g=="number"&&(Nt=r.slice(0,g)),Nt},[r,u,A,g,te]),We=x.exports.useMemo(function(){return te?r.slice(Qe+1):r.slice(Te.length)},[r,Te,te,Qe]),je=x.exports.useCallback(function(Nt,jt){var Gt;return typeof l=="function"?l(Nt):(Gt=l&&(Nt==null?void 0:Nt[l]))!==null&&Gt!==void 0?Gt:jt},[l]),mt=x.exports.useCallback(s||function(Nt){return Nt},[s]);function Et(Nt,jt,Gt){tt===Nt&&(jt===void 0||jt===Pe)||(nt(Nt),Gt||(se(NtN){Et(kt-1,Nt-Ft-Se+de);break}}m&&Vn(0)+Se>N&&Oe(null)}},[N,W,de,Se,je,Te]);var Lt=ie&&!!We.length,tn={};Pe!==null&&te&&(tn={position:"absolute",left:Pe,top:0});var ui={prefixCls:U,responsive:te,component:y,invalidate:we},cn=a?function(Nt,jt){var Gt=je(Nt,jt);return x.exports.createElement(xA.Provider,{key:Gt,value:Ce(Ce({},ui),{},{order:jt,item:Nt,itemKey:Gt,registerSize:Je,display:jt<=Qe})},a(Nt,jt))}:function(Nt,jt){var Gt=je(Nt,jt);return x.exports.createElement(iE,Ct({},ui,{order:jt,key:Gt,item:Nt,renderItem:mt,itemKey:Gt,registerSize:Je,display:jt<=Qe}))},qn,bn={order:Lt?Qe:Number.MAX_SAFE_INTEGER,className:"".concat(U,"-rest"),registerSize:xt,display:Lt};if(v)v&&(qn=x.exports.createElement(xA.Provider,{value:Ce(Ce({},ui),bn)},v(We)));else{var Pt=p||yVe;qn=x.exports.createElement(iE,Ct({},ui,bn),typeof Pt=="function"?Pt(We):Pt)}var qt=x.exports.createElement(w,Ct({className:Ue(!we&&n,f),style:h,ref:e},D),Te.map(cn),Le?qn:null,m&&x.exports.createElement(iE,Ct({},ui,{responsive:oe,responsiveDisabled:!te,order:Qe,className:"".concat(U,"-suffix"),registerSize:Ot,display:!0,style:tn}),m));return oe&&(qt=x.exports.createElement(Md,{onResize:At,disabled:!te},qt)),qt}var of=x.exports.forwardRef(SVe);of.displayName="Overflow";of.Item=Lme;of.RESPONSIVE=Eme;of.INVALIDATE=Dme;var xVe=function(e,t){var n,o=e.prefixCls,r=e.id,s=e.inputElement,a=e.disabled,l=e.tabIndex,c=e.autoFocus,u=e.autoComplete,d=e.editable,h=e.activeDescendantId,f=e.value,g=e.maxLength,p=e.onKeyDown,v=e.onMouseDown,m=e.onChange,_=e.onPaste,w=e.onCompositionStart,y=e.onCompositionEnd,L=e.open,D=e.attrs,E=s||x.exports.createElement("input",null),I=E,k=I.ref,R=I.props,A=R.onKeyDown,P=R.onChange,N=R.onMouseDown,M=R.onCompositionStart,H=R.onCompositionEnd,W=R.style;return"maxLength"in E.props,E=x.exports.cloneElement(E,Ce(Ce(Ce({type:"search"},R),{},{id:r,ref:Jd(t,k),disabled:a,tabIndex:l,autoComplete:u||"off",autoFocus:c,className:Ue("".concat(o,"-selection-search-input"),(n=E)===null||n===void 0||(n=n.props)===null||n===void 0?void 0:n.className),role:"combobox","aria-expanded":L||!1,"aria-haspopup":"listbox","aria-owns":"".concat(r,"_list"),"aria-autocomplete":"list","aria-controls":"".concat(r,"_list"),"aria-activedescendant":L?h:void 0},D),{},{value:d?f:"",maxLength:g,readOnly:!d,unselectable:d?null:"on",style:Ce(Ce({},W),{},{opacity:d?null:0}),onKeyDown:function($){p($),A&&A($)},onMouseDown:function($){v($),N&&N($)},onChange:function($){m($),P&&P($)},onCompositionStart:function($){w($),M&&M($)},onCompositionEnd:function($){y($),H&&H($)},onPaste:_})),E},kme=x.exports.forwardRef(xVe);function Ime(i){return Array.isArray(i)?i:i!==void 0?[i]:[]}var LVe=typeof window!="undefined"&&window.document&&window.document.documentElement,EVe=LVe;function DVe(i){return i!=null}function kVe(i){return!i&&i!==0}function Wne(i){return["string","number"].includes(Kn(i))}function Tme(i){var e=void 0;return i&&(Wne(i.title)?e=i.title.toString():Wne(i.label)&&(e=i.label.toString())),e}function IVe(i,e){EVe?x.exports.useLayoutEffect(i,e):x.exports.useEffect(i,e)}function TVe(i){var e;return(e=i.key)!==null&&e!==void 0?e:i.value}var Vne=function(e){e.preventDefault(),e.stopPropagation()},NVe=function(e){var t=e.id,n=e.prefixCls,o=e.values,r=e.open,s=e.searchValue,a=e.autoClearSearchValue,l=e.inputRef,c=e.placeholder,u=e.disabled,d=e.mode,h=e.showSearch,f=e.autoFocus,g=e.autoComplete,p=e.activeDescendantId,v=e.tabIndex,m=e.removeIcon,_=e.maxTagCount,w=e.maxTagTextLength,y=e.maxTagPlaceholder,L=y===void 0?function(Oe){return"+ ".concat(Oe.length," ...")}:y,D=e.tagRender,E=e.onToggleOpen,I=e.onRemove,k=e.onInputChange,R=e.onInputPaste,A=e.onInputKeyDown,P=e.onInputMouseDown,N=e.onInputCompositionStart,M=e.onInputCompositionEnd,H=x.exports.useRef(null),W=x.exports.useState(0),F=Ne(W,2),$=F[0],z=F[1],K=x.exports.useState(!1),j=Ne(K,2),G=j[0],X=j[1],de="".concat(n,"-selection"),he=r||d==="multiple"&&a===!1||d==="tags"?s:"",pe=d==="tags"||d==="multiple"&&a===!1||h&&(r||G);IVe(function(){z(H.current.scrollWidth)},[he]);var be=function(xe,Ee,tt,nt,Qe){return x.exports.createElement("span",{title:Tme(xe),className:Ue("".concat(de,"-item"),me({},"".concat(de,"-item-disabled"),tt))},x.exports.createElement("span",{className:"".concat(de,"-item-content")},Ee),nt&&x.exports.createElement(T4,{className:"".concat(de,"-item-remove"),onMouseDown:Vne,onClick:Qe,customizeIcon:m},"\xD7"))},Se=function(xe,Ee,tt,nt,Qe){var Ge=function(ie){Vne(ie),E(!r)};return x.exports.createElement("span",{onMouseDown:Ge},D({label:Ee,value:xe,disabled:tt,closable:nt,onClose:Qe}))},Fe=function(xe){var Ee=xe.disabled,tt=xe.label,nt=xe.value,Qe=!u&&!Ee,Ge=tt;if(typeof w=="number"&&(typeof tt=="string"||typeof tt=="number")){var re=String(Ge);re.length>w&&(Ge="".concat(re.slice(0,w),"..."))}var ie=function(U){U&&U.stopPropagation(),I(xe)};return typeof D=="function"?Se(nt,Ge,Ee,Qe,ie):be(xe,Ge,Ee,Qe,ie)},De=function(xe){var Ee=typeof L=="function"?L(xe):L;return be({title:Ee},Ee,!1)},ce=x.exports.createElement("div",{className:"".concat(de,"-search"),style:{width:$},onFocus:function(){X(!0)},onBlur:function(){X(!1)}},x.exports.createElement(kme,{ref:l,open:r,prefixCls:n,id:t,inputElement:null,disabled:u,autoFocus:f,autoComplete:g,editable:pe,activeDescendantId:p,value:he,onKeyDown:A,onMouseDown:P,onChange:k,onPaste:R,onCompositionStart:N,onCompositionEnd:M,tabIndex:v,attrs:z0(e,!0)}),x.exports.createElement("span",{ref:H,className:"".concat(de,"-search-mirror"),"aria-hidden":!0},he,"\xA0")),Pe=x.exports.createElement(of,{prefixCls:"".concat(de,"-overflow"),data:o,renderItem:Fe,renderRest:De,suffix:ce,itemKey:TVe,maxCount:_});return x.exports.createElement(x.exports.Fragment,null,Pe,!o.length&&!he&&x.exports.createElement("span",{className:"".concat(de,"-placeholder")},c))},RVe=function(e){var t=e.inputElement,n=e.prefixCls,o=e.id,r=e.inputRef,s=e.disabled,a=e.autoFocus,l=e.autoComplete,c=e.activeDescendantId,u=e.mode,d=e.open,h=e.values,f=e.placeholder,g=e.tabIndex,p=e.showSearch,v=e.searchValue,m=e.activeValue,_=e.maxLength,w=e.onInputKeyDown,y=e.onInputMouseDown,L=e.onInputChange,D=e.onInputPaste,E=e.onInputCompositionStart,I=e.onInputCompositionEnd,k=e.title,R=x.exports.useState(!1),A=Ne(R,2),P=A[0],N=A[1],M=u==="combobox",H=M||p,W=h[0],F=v||"";M&&m&&!P&&(F=m),x.exports.useEffect(function(){M&&N(!1)},[M,m]);var $=u!=="combobox"&&!d&&!p?!1:!!F,z=k===void 0?Tme(W):k,K=x.exports.useMemo(function(){return W?null:x.exports.createElement("span",{className:"".concat(n,"-selection-placeholder"),style:$?{visibility:"hidden"}:void 0},f)},[W,$,f,n]);return x.exports.createElement(x.exports.Fragment,null,x.exports.createElement("span",{className:"".concat(n,"-selection-search")},x.exports.createElement(kme,{ref:r,prefixCls:n,id:o,open:d,inputElement:t,disabled:s,autoFocus:a,autoComplete:l,editable:H,activeDescendantId:c,value:F,onKeyDown:w,onMouseDown:y,onChange:function(G){N(!0),L(G)},onPaste:D,onCompositionStart:E,onCompositionEnd:I,tabIndex:g,attrs:z0(e,!0),maxLength:M?_:void 0})),!M&&W?x.exports.createElement("span",{className:"".concat(n,"-selection-item"),title:z,style:$?{visibility:"hidden"}:void 0},W.label):null,K)};function MVe(i){return![at.ESC,at.SHIFT,at.BACKSPACE,at.TAB,at.WIN_KEY,at.ALT,at.META,at.WIN_KEY_RIGHT,at.CTRL,at.SEMICOLON,at.EQUALS,at.CAPS_LOCK,at.CONTEXT_MENU,at.F1,at.F2,at.F3,at.F4,at.F5,at.F6,at.F7,at.F8,at.F9,at.F10,at.F11,at.F12].includes(i)}var AVe=function(e,t){var n=x.exports.useRef(null),o=x.exports.useRef(!1),r=e.prefixCls,s=e.open,a=e.mode,l=e.showSearch,c=e.tokenWithEnter,u=e.autoClearSearchValue,d=e.onSearch,h=e.onSearchSubmit,f=e.onToggleOpen,g=e.onInputKeyDown,p=e.domRef;x.exports.useImperativeHandle(t,function(){return{focus:function(){n.current.focus()},blur:function(){n.current.blur()}}});var v=xme(0),m=Ne(v,2),_=m[0],w=m[1],y=function(F){var $=F.which;($===at.UP||$===at.DOWN)&&F.preventDefault(),g&&g(F),$===at.ENTER&&a==="tags"&&!o.current&&!s&&(h==null||h(F.target.value)),MVe($)&&f(!0)},L=function(){w(!0)},D=x.exports.useRef(null),E=function(F){d(F,!0,o.current)!==!1&&f(!0)},I=function(){o.current=!0},k=function(F){o.current=!1,a!=="combobox"&&E(F.target.value)},R=function(F){var $=F.target.value;if(c&&D.current&&/[\r\n]/.test(D.current)){var z=D.current.replace(/[\r\n]+$/,"").replace(/\r\n/g," ").replace(/[\r\n]/g," ");$=$.replace(z,D.current)}D.current=null,E($)},A=function(F){var $=F.clipboardData,z=$==null?void 0:$.getData("text");D.current=z||""},P=function(F){var $=F.target;if($!==n.current){var z=document.body.style.msTouchAction!==void 0;z?setTimeout(function(){n.current.focus()}):n.current.focus()}},N=function(F){var $=_();F.target!==n.current&&!$&&a!=="combobox"&&F.preventDefault(),(a!=="combobox"&&(!l||!$)||!s)&&(s&&u!==!1&&d("",!0,!1),f())},M={inputRef:n,onInputKeyDown:y,onInputMouseDown:L,onInputChange:R,onInputPaste:A,onInputCompositionStart:I,onInputCompositionEnd:k},H=a==="multiple"||a==="tags"?x.exports.createElement(NVe,Ct({},e,M)):x.exports.createElement(RVe,Ct({},e,M));return x.exports.createElement("div",{ref:p,className:"".concat(r,"-selector"),onClick:P,onMouseDown:N},H)},PVe=x.exports.forwardRef(AVe);function OVe(i){var e=i.prefixCls,t=i.align,n=i.arrow,o=i.arrowPos,r=n||{},s=r.className,a=r.content,l=o.x,c=l===void 0?0:l,u=o.y,d=u===void 0?0:u,h=x.exports.useRef();if(!t||!t.points)return null;var f={position:"absolute"};if(t.autoArrow!==!1){var g=t.points[0],p=t.points[1],v=g[0],m=g[1],_=p[0],w=p[1];v===_||!["t","b"].includes(v)?f.top=d:v==="t"?f.top=0:f.bottom=0,m===w||!["l","r"].includes(m)?f.left=c:m==="l"?f.left=0:f.right=0}return x.exports.createElement("div",{ref:h,className:Ue("".concat(e,"-arrow"),s),style:f},a)}function FVe(i){var e=i.prefixCls,t=i.open,n=i.zIndex,o=i.mask,r=i.motion;return o?x.exports.createElement(eh,Ct({},r,{motionAppear:!0,visible:t,removeOnLeave:!0}),function(s){var a=s.className;return x.exports.createElement("div",{style:{zIndex:n},className:Ue("".concat(e,"-mask"),a)})}):null}var BVe=x.exports.memo(function(i){var e=i.children;return e},function(i,e){return e.cache}),WVe=x.exports.forwardRef(function(i,e){var t=i.popup,n=i.className,o=i.prefixCls,r=i.style,s=i.target,a=i.onVisibleChanged,l=i.open,c=i.keepDom,u=i.fresh,d=i.onClick,h=i.mask,f=i.arrow,g=i.arrowPos,p=i.align,v=i.motion,m=i.maskMotion,_=i.forceRender,w=i.getPopupContainer,y=i.autoDestroy,L=i.portal,D=i.zIndex,E=i.onMouseEnter,I=i.onMouseLeave,k=i.onPointerEnter,R=i.ready,A=i.offsetX,P=i.offsetY,N=i.offsetR,M=i.offsetB,H=i.onAlign,W=i.onPrepare,F=i.stretch,$=i.targetWidth,z=i.targetHeight,K=typeof t=="function"?t():t,j=l||c,G=(w==null?void 0:w.length)>0,X=x.exports.useState(!w||!G),de=Ne(X,2),he=de[0],pe=de[1];if(go(function(){!he&&G&&s&&pe(!0)},[he,G,s]),!he)return null;var be="auto",Se={left:"-1000vw",top:"-1000vh",right:be,bottom:be};if(R||!l){var Fe,De=p.points,ce=p.dynamicInset||((Fe=p._experimental)===null||Fe===void 0?void 0:Fe.dynamicInset),Pe=ce&&De[0][1]==="r",Oe=ce&&De[0][0]==="b";Pe?(Se.right=N,Se.left=be):(Se.left=A,Se.right=be),Oe?(Se.bottom=M,Se.top=be):(Se.top=P,Se.bottom=be)}var xe={};return F&&(F.includes("height")&&z?xe.height=z:F.includes("minHeight")&&z&&(xe.minHeight=z),F.includes("width")&&$?xe.width=$:F.includes("minWidth")&&$&&(xe.minWidth=$)),l||(xe.pointerEvents="none"),x.exports.createElement(L,{open:_||j,getContainer:w&&function(){return w(s)},autoDestroy:y},x.exports.createElement(FVe,{prefixCls:o,open:l,zIndex:D,mask:h,motion:m}),x.exports.createElement(Md,{onResize:H,disabled:!l},function(Ee){return x.exports.createElement(eh,Ct({motionAppear:!0,motionEnter:!0,motionLeave:!0,removeOnLeave:!1,forceRender:_,leavedClassName:"".concat(o,"-hidden")},v,{onAppearPrepare:W,onEnterPrepare:W,visible:l,onVisibleChanged:function(nt){var Qe;v==null||(Qe=v.onVisibleChanged)===null||Qe===void 0||Qe.call(v,nt),a(nt)}}),function(tt,nt){var Qe=tt.className,Ge=tt.style,re=Ue(o,Qe,n);return x.exports.createElement("div",{ref:Jd(Ee,e,nt),className:re,style:Ce(Ce(Ce(Ce({"--arrow-x":"".concat(g.x||0,"px"),"--arrow-y":"".concat(g.y||0,"px")},Se),xe),Ge),{},{boxSizing:"border-box",zIndex:D},r),onMouseEnter:E,onMouseLeave:I,onPointerEnter:k,onClick:d},f&&x.exports.createElement(OVe,{prefixCls:o,arrow:f,arrowPos:g,align:p}),x.exports.createElement(BVe,{cache:!l&&!u},K))})}))}),VVe=x.exports.forwardRef(function(i,e){var t=i.children,n=i.getTriggerDOMNode,o=jv(t),r=x.exports.useCallback(function(a){_K(e,n?n(a):a)},[n]),s=Rb(r,t.ref);return o?x.exports.cloneElement(t,{ref:s}):t}),Hne=x.exports.createContext(null);function $ne(i){return i?Array.isArray(i)?i:[i]:[]}function HVe(i,e,t,n){return x.exports.useMemo(function(){var o=$ne(t!=null?t:e),r=$ne(n!=null?n:e),s=new Set(o),a=new Set(r);return i&&(s.has("hover")&&(s.delete("hover"),s.add("click")),a.has("hover")&&(a.delete("hover"),a.add("click"))),[s,a]},[i,e,t,n])}function $Ve(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],t=arguments.length>2?arguments[2]:void 0;return t?i[0]===e[0]:i[0]===e[0]&&i[1]===e[1]}function zVe(i,e,t,n){for(var o=t.points,r=Object.keys(i),s=0;s1&&arguments[1]!==void 0?arguments[1]:1;return Number.isNaN(i)?e:i}function Sx(i){return mD(parseFloat(i),0)}function Une(i,e){var t=Ce({},i);return(e||[]).forEach(function(n){if(!(n instanceof HTMLBodyElement||n instanceof HTMLHtmlElement)){var o=II(n).getComputedStyle(n),r=o.overflow,s=o.overflowClipMargin,a=o.borderTopWidth,l=o.borderBottomWidth,c=o.borderLeftWidth,u=o.borderRightWidth,d=n.getBoundingClientRect(),h=n.offsetHeight,f=n.clientHeight,g=n.offsetWidth,p=n.clientWidth,v=Sx(a),m=Sx(l),_=Sx(c),w=Sx(u),y=mD(Math.round(d.width/g*1e3)/1e3),L=mD(Math.round(d.height/h*1e3)/1e3),D=(g-p-_-w)*y,E=(h-f-v-m)*L,I=v*L,k=m*L,R=_*y,A=w*y,P=0,N=0;if(r==="clip"){var M=Sx(s);P=M*y,N=M*L}var H=d.x+R-P,W=d.y+I-N,F=H+d.width+2*P-R-A-D,$=W+d.height+2*N-I-k-E;t.left=Math.max(t.left,H),t.top=Math.max(t.top,W),t.right=Math.min(t.right,F),t.bottom=Math.min(t.bottom,$)}}),t}function jne(i){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,t="".concat(e),n=t.match(/^(.*)\%$/);return n?i*(parseFloat(n[1])/100):parseFloat(t)}function Kne(i,e){var t=e||[],n=Ne(t,2),o=n[0],r=n[1];return[jne(i.width,o),jne(i.height,r)]}function qne(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return[i[0],i[1]]}function I1(i,e){var t=e[0],n=e[1],o,r;return t==="t"?r=i.y:t==="b"?r=i.y+i.height:r=i.y+i.height/2,n==="l"?o=i.x:n==="r"?o=i.x+i.width:o=i.x+i.width/2,{x:o,y:r}}function Mp(i,e){var t={t:"b",b:"t",l:"r",r:"l"};return i.map(function(n,o){return o===e?t[n]||"c":n}).join("")}function UVe(i,e,t,n,o,r,s){var a=x.exports.useState({ready:!1,offsetX:0,offsetY:0,offsetR:0,offsetB:0,arrowX:0,arrowY:0,scaleX:1,scaleY:1,align:o[n]||{}}),l=Ne(a,2),c=l[0],u=l[1],d=x.exports.useRef(0),h=x.exports.useMemo(function(){return e?kW(e):[]},[e]),f=x.exports.useRef({}),g=function(){f.current={}};i||g();var p=el(function(){if(e&&t&&i){let er=function(Zc,Mf){var Af=arguments.length>2&&arguments[2]!==void 0?arguments[2]:re,Pf=K.x+Zc,wp=K.y+Mf,yp=Pf+Fe,n1=wp+Se,OS=Math.max(Pf,Af.left),FS=Math.max(wp,Af.top),i1=Math.min(yp,Af.right),BS=Math.min(n1,Af.bottom);return Math.max(0,(i1-OS)*(BS-FS))},s_=function(){Zi=K.y+Pt,an=Zi+Se,Xt=K.x+bn,oi=Xt+Fe};var _,w,y=e,L=y.ownerDocument,D=II(y),E=D.getComputedStyle(y),I=E.width,k=E.height,R=E.position,A=y.style.left,P=y.style.top,N=y.style.right,M=y.style.bottom,H=y.style.overflow,W=Ce(Ce({},o[n]),r),F=L.createElement("div");(_=y.parentElement)===null||_===void 0||_.appendChild(F),F.style.left="".concat(y.offsetLeft,"px"),F.style.top="".concat(y.offsetTop,"px"),F.style.position=R,F.style.height="".concat(y.offsetHeight,"px"),F.style.width="".concat(y.offsetWidth,"px"),y.style.left="0",y.style.top="0",y.style.right="auto",y.style.bottom="auto",y.style.overflow="hidden";var $;if(Array.isArray(t))$={x:t[0],y:t[1],width:0,height:0};else{var z=t.getBoundingClientRect();$={x:z.x,y:z.y,width:z.width,height:z.height}}var K=y.getBoundingClientRect(),j=L.documentElement,G=j.clientWidth,X=j.clientHeight,de=j.scrollWidth,he=j.scrollHeight,pe=j.scrollTop,be=j.scrollLeft,Se=K.height,Fe=K.width,De=$.height,ce=$.width,Pe={left:0,top:0,right:G,bottom:X},Oe={left:-be,top:-pe,right:de-be,bottom:he-pe},xe=W.htmlRegion,Ee="visible",tt="visibleFirst";xe!=="scroll"&&xe!==tt&&(xe=Ee);var nt=xe===tt,Qe=Une(Oe,h),Ge=Une(Pe,h),re=xe===Ee?Ge:Qe,ie=nt?Ge:re;y.style.left="auto",y.style.top="auto",y.style.right="0",y.style.bottom="0";var se=y.getBoundingClientRect();y.style.left=A,y.style.top=P,y.style.right=N,y.style.bottom=M,y.style.overflow=H,(w=y.parentElement)===null||w===void 0||w.removeChild(F);var U=mD(Math.round(Fe/parseFloat(I)*1e3)/1e3),Y=mD(Math.round(Se/parseFloat(k)*1e3)/1e3);if(U===0||Y===0||fA(t)&&!D4(t))return;var oe=W.offset,te=W.targetOffset,we=Kne(K,oe),Le=Ne(we,2),Te=Le[0],We=Le[1],je=Kne($,te),mt=Ne(je,2),Et=mt[0],At=mt[1];$.x-=Et,$.y-=At;var Je=W.points||[],xt=Ne(Je,2),Ot=xt[0],Vn=xt[1],Lt=qne(Vn),tn=qne(Ot),ui=I1($,Lt),cn=I1(K,tn),qn=Ce({},W),bn=ui.x-cn.x+Te,Pt=ui.y-cn.y+We,qt=er(bn,Pt),Nt=er(bn,Pt,Ge),jt=I1($,["t","l"]),Gt=I1(K,["t","l"]),kt=I1($,["b","r"]),Ft=I1(K,["b","r"]),bt=W.overflow||{},Zt=bt.adjustX,yn=bt.adjustY,Dn=bt.shiftX,Gn=bt.shiftY,Un=function(Mf){return typeof Mf=="boolean"?Mf:Mf>=0},Zi,an,Xt,oi;s_();var Ze=Un(yn),ue=tn[0]===Lt[0];if(Ze&&tn[0]==="t"&&(an>ie.bottom||f.current.bt)){var Ve=Pt;ue?Ve-=Se-De:Ve=jt.y-Ft.y-We;var ot=er(bn,Ve),Sn=er(bn,Ve,Ge);ot>qt||ot===qt&&(!nt||Sn>=Nt)?(f.current.bt=!0,Pt=Ve,We=-We,qn.points=[Mp(tn,0),Mp(Lt,0)]):f.current.bt=!1}if(Ze&&tn[0]==="b"&&(Ziqt||Ci===qt&&(!nt||An>=Nt)?(f.current.tb=!0,Pt=$n,We=-We,qn.points=[Mp(tn,0),Mp(Lt,0)]):f.current.tb=!1}var lo=Un(Zt),Qo=tn[1]===Lt[1];if(lo&&tn[1]==="l"&&(oi>ie.right||f.current.rl)){var zo=bn;Qo?zo-=Fe-ce:zo=jt.x-Ft.x-Te;var ic=er(zo,Pt),Xc=er(zo,Pt,Ge);ic>qt||ic===qt&&(!nt||Xc>=Nt)?(f.current.rl=!0,bn=zo,Te=-Te,qn.points=[Mp(tn,1),Mp(Lt,1)]):f.current.rl=!1}if(lo&&tn[1]==="r"&&(Xtqt||za===qt&&(!nt||ml>=Nt)?(f.current.lr=!0,bn=Gr,Te=-Te,qn.points=[Mp(tn,1),Mp(Lt,1)]):f.current.lr=!1}s_();var _a=Dn===!0?0:Dn;typeof _a=="number"&&(XtGe.right&&(bn-=oi-Ge.right-Te,$.x>Ge.right-_a&&(bn+=$.x-Ge.right+_a)));var vl=Gn===!0?0:Gn;typeof vl=="number"&&(ZiGe.bottom&&(Pt-=an-Ge.bottom-We,$.y>Ge.bottom-vl&&(Pt+=$.y-Ge.bottom+vl)));var oc=K.x+bn,Yc=oc+Fe,ba=K.y+Pt,Xu=ba+Se,_l=$.x,mi=_l+ce,gi=$.y,Kt=gi+De,on=Math.max(oc,_l),vi=Math.min(Yc,mi),Uo=(on+vi)/2,Qi=Uo-oc,Jo=Math.max(ba,gi),vr=Math.min(Xu,Kt),zs=(Jo+vr)/2,Tr=zs-ba;s==null||s(e,qn);var cs=se.right-K.x-(bn+K.width),Is=se.bottom-K.y-(Pt+K.height);u({ready:!0,offsetX:bn/U,offsetY:Pt/Y,offsetR:cs/U,offsetB:Is/Y,arrowX:Qi/U,arrowY:Tr/Y,scaleX:U,scaleY:Y,align:qn})}}),v=function(){d.current+=1;var w=d.current;Promise.resolve().then(function(){d.current===w&&p()})},m=function(){u(function(w){return Ce(Ce({},w),{},{ready:!1})})};return go(m,[n]),go(function(){i||m()},[i]),[c.ready,c.offsetX,c.offsetY,c.offsetR,c.offsetB,c.arrowX,c.arrowY,c.scaleX,c.scaleY,c.align,v]}function jVe(i,e,t,n,o){go(function(){if(i&&e&&t){let d=function(){n(),o()};var r=e,s=t,a=kW(r),l=kW(s),c=II(s),u=new Set([c].concat(_t(a),_t(l)));return u.forEach(function(h){h.addEventListener("scroll",d,{passive:!0})}),c.addEventListener("resize",d,{passive:!0}),n(),function(){u.forEach(function(h){h.removeEventListener("scroll",d),c.removeEventListener("resize",d)})}}},[i,e,t])}function KVe(i,e,t,n,o,r,s,a){var l=x.exports.useRef(i),c=x.exports.useRef(!1);l.current!==i&&(c.current=!0,l.current=i),x.exports.useEffect(function(){var u=Xi(function(){c.current=!1});return function(){Xi.cancel(u)}},[i]),x.exports.useEffect(function(){if(e&&n&&(!o||r)){var u=function(){var D=!1,E=function(R){var A=R.target;D=s(A)},I=function(R){var A=R.target;!c.current&&l.current&&!D&&!s(A)&&a(!1)};return[E,I]},d=u(),h=Ne(d,2),f=h[0],g=h[1],p=u(),v=Ne(p,2),m=v[0],_=v[1],w=II(n);w.addEventListener("mousedown",f,!0),w.addEventListener("click",g,!0),w.addEventListener("contextmenu",g,!0);var y=bA(t);return y&&(y.addEventListener("mousedown",m,!0),y.addEventListener("click",_,!0),y.addEventListener("contextmenu",_,!0)),function(){w.removeEventListener("mousedown",f,!0),w.removeEventListener("click",g,!0),w.removeEventListener("contextmenu",g,!0),y&&(y.removeEventListener("mousedown",m,!0),y.removeEventListener("click",_,!0),y.removeEventListener("contextmenu",_,!0))}}},[e,t,n,o,r])}var qVe=["prefixCls","children","action","showAction","hideAction","popupVisible","defaultPopupVisible","onPopupVisibleChange","afterPopupVisibleChange","mouseEnterDelay","mouseLeaveDelay","focusDelay","blurDelay","mask","maskClosable","getPopupContainer","forceRender","autoDestroy","destroyPopupOnHide","popup","popupClassName","popupStyle","popupPlacement","builtinPlacements","popupAlign","zIndex","stretch","getPopupClassNameFromAlign","fresh","alignPoint","onPopupClick","onPopupAlign","arrow","popupMotion","maskMotion","popupTransitionName","popupAnimation","maskTransitionName","maskAnimation","className","getTriggerDOMNode"];function GVe(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:GK,e=x.exports.forwardRef(function(t,n){var o=t.prefixCls,r=o===void 0?"rc-trigger-popup":o,s=t.children,a=t.action,l=a===void 0?"hover":a,c=t.showAction,u=t.hideAction,d=t.popupVisible,h=t.defaultPopupVisible,f=t.onPopupVisibleChange,g=t.afterPopupVisibleChange,p=t.mouseEnterDelay,v=t.mouseLeaveDelay,m=v===void 0?.1:v,_=t.focusDelay,w=t.blurDelay,y=t.mask,L=t.maskClosable,D=L===void 0?!0:L,E=t.getPopupContainer,I=t.forceRender,k=t.autoDestroy,R=t.destroyPopupOnHide,A=t.popup,P=t.popupClassName,N=t.popupStyle,M=t.popupPlacement,H=t.builtinPlacements,W=H===void 0?{}:H,F=t.popupAlign,$=t.zIndex,z=t.stretch,K=t.getPopupClassNameFromAlign,j=t.fresh,G=t.alignPoint,X=t.onPopupClick,de=t.onPopupAlign,he=t.arrow,pe=t.popupMotion,be=t.maskMotion,Se=t.popupTransitionName,Fe=t.popupAnimation,De=t.maskTransitionName,ce=t.maskAnimation,Pe=t.className,Oe=t.getTriggerDOMNode,xe=Hn(t,qVe),Ee=k||R||!1,tt=x.exports.useState(!1),nt=Ne(tt,2),Qe=nt[0],Ge=nt[1];go(function(){Ge(eq())},[]);var re=x.exports.useRef({}),ie=x.exports.useContext(Hne),se=x.exports.useMemo(function(){return{registerSubPopup:function(Xn,tr){re.current[Xn]=tr,ie==null||ie.registerSubPopup(Xn,tr)}}},[ie]),U=Hpe(),Y=x.exports.useState(null),oe=Ne(Y,2),te=oe[0],we=oe[1],Le=el(function(rn){fA(rn)&&te!==rn&&we(rn),ie==null||ie.registerSubPopup(U,rn)}),Te=x.exports.useState(null),We=Ne(Te,2),je=We[0],mt=We[1],Et=x.exports.useRef(null),At=el(function(rn){fA(rn)&&je!==rn&&(mt(rn),Et.current=rn)}),Je=x.exports.Children.only(s),xt=(Je==null?void 0:Je.props)||{},Ot={},Vn=el(function(rn){var Xn,tr,ur=je;return(ur==null?void 0:ur.contains(rn))||((Xn=bA(ur))===null||Xn===void 0?void 0:Xn.host)===rn||rn===ur||(te==null?void 0:te.contains(rn))||((tr=bA(te))===null||tr===void 0?void 0:tr.host)===rn||rn===te||Object.values(re.current).some(function(nr){return(nr==null?void 0:nr.contains(rn))||rn===nr})}),Lt=zne(r,pe,Fe,Se),tn=zne(r,be,ce,De),ui=x.exports.useState(h||!1),cn=Ne(ui,2),qn=cn[0],bn=cn[1],Pt=d!=null?d:qn,qt=el(function(rn){d===void 0&&bn(rn)});go(function(){bn(d||!1)},[d]);var Nt=x.exports.useRef(Pt);Nt.current=Pt;var jt=x.exports.useRef([]);jt.current=[];var Gt=el(function(rn){var Xn;qt(rn),((Xn=jt.current[jt.current.length-1])!==null&&Xn!==void 0?Xn:Pt)!==rn&&(jt.current.push(rn),f==null||f(rn))}),kt=x.exports.useRef(),Ft=function(){clearTimeout(kt.current)},bt=function(Xn){var tr=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;Ft(),tr===0?Gt(Xn):kt.current=setTimeout(function(){Gt(Xn)},tr*1e3)};x.exports.useEffect(function(){return Ft},[]);var Zt=x.exports.useState(!1),yn=Ne(Zt,2),Dn=yn[0],Gn=yn[1];go(function(rn){(!rn||Pt)&&Gn(!0)},[Pt]);var Un=x.exports.useState(null),Zi=Ne(Un,2),an=Zi[0],Xt=Zi[1],oi=x.exports.useState([0,0]),Ze=Ne(oi,2),ue=Ze[0],Ve=Ze[1],ot=function(Xn){Ve([Xn.clientX,Xn.clientY])},Sn=UVe(Pt,te,G?ue:je,M,W,F,de),$n=Ne(Sn,11),Ci=$n[0],An=$n[1],lo=$n[2],Qo=$n[3],zo=$n[4],ic=$n[5],Xc=$n[6],Gr=$n[7],za=$n[8],ml=$n[9],_a=$n[10],vl=HVe(Qe,l,c,u),oc=Ne(vl,2),Yc=oc[0],ba=oc[1],Xu=Yc.has("click"),_l=ba.has("click")||ba.has("contextMenu"),mi=el(function(){Dn||_a()}),gi=function(){Nt.current&&G&&_l&&bt(!1)};jVe(Pt,je,te,mi,gi),go(function(){mi()},[ue,M]),go(function(){Pt&&!(W!=null&&W[M])&&mi()},[JSON.stringify(F)]);var Kt=x.exports.useMemo(function(){var rn=zVe(W,r,ml,G);return Ue(rn,K==null?void 0:K(ml))},[ml,K,W,r,G]);x.exports.useImperativeHandle(n,function(){return{nativeElement:Et.current,forceAlign:mi}});var on=x.exports.useState(0),vi=Ne(on,2),Uo=vi[0],Qi=vi[1],Jo=x.exports.useState(0),vr=Ne(Jo,2),zs=vr[0],Tr=vr[1],cs=function(){if(z&&je){var Xn=je.getBoundingClientRect();Qi(Xn.width),Tr(Xn.height)}},Is=function(){cs(),mi()},er=function(Xn){Gn(!1),_a(),g==null||g(Xn)},s_=function(){return new Promise(function(Xn){cs(),Xt(function(){return Xn})})};go(function(){an&&(_a(),an(),Xt(null))},[an]);function Zc(rn,Xn,tr,ur){Ot[rn]=function(nr){var o1;ur==null||ur(nr),bt(Xn,tr);for(var WS=arguments.length,DT=new Array(WS>1?WS-1:0),r1=1;r11?tr-1:0),nr=1;nr1?tr-1:0),nr=1;nr1&&arguments[1]!==void 0?arguments[1]:{},t=e.fieldNames,n=e.childrenAsData,o=[],r=Nme(t,!1),s=r.label,a=r.value,l=r.options,c=r.groupLabel;function u(d,h){!Array.isArray(d)||d.forEach(function(f){if(h||!(l in f)){var g=f[a];o.push({key:Gne(f,o.length),groupOption:h,data:f,label:f[s],value:g})}else{var p=f[c];p===void 0&&n&&(p=f.label),o.push({key:Gne(f,o.length),group:!0,data:f,label:p}),u(f[l],!0)}})}return u(i,!1),o}function IW(i){var e=Ce({},i);return"props"in e||Object.defineProperty(e,"props",{get:function(){return rr(!1,"Return type is option instead of Option instance. Please read value directly instead of reading from `props`."),e}}),e}var eHe=function(e,t,n){if(!t||!t.length)return null;var o=!1,r=function a(l,c){var u=Rge(c),d=u[0],h=u.slice(1);if(!d)return[l];var f=l.split(d);return o=o||f.length>1,f.reduce(function(g,p){return[].concat(_t(g),_t(a(p,h)))},[]).filter(Boolean)},s=r(e,t);return o?typeof n!="undefined"?s.slice(0,n):s:null},tq=x.exports.createContext(null),tHe=["id","prefixCls","className","showSearch","tagRender","direction","omitDomProps","displayValues","onDisplayValuesChange","emptyOptions","notFoundContent","onClear","mode","disabled","loading","getInputElement","getRawInputElement","open","defaultOpen","onDropdownVisibleChange","activeValue","onActiveValueChange","activeDescendantId","searchValue","autoClearSearchValue","onSearch","onSearchSplit","tokenSeparators","allowClear","suffixIcon","clearIcon","OptionList","animation","transitionName","dropdownStyle","dropdownClassName","dropdownMatchSelectWidth","dropdownRender","dropdownAlign","placement","builtinPlacements","getPopupContainer","showAction","onFocus","onBlur","onKeyUp","onKeyDown","onMouseDown"],nHe=["value","onChange","removeIcon","placeholder","autoFocus","maxTagCount","maxTagTextLength","maxTagPlaceholder","choiceTransitionName","onInputKeyDown","onPopupScroll","tabIndex"],TW=function(e){return e==="tags"||e==="multiple"},iHe=x.exports.forwardRef(function(i,e){var t,n,o=i.id,r=i.prefixCls,s=i.className,a=i.showSearch,l=i.tagRender,c=i.direction,u=i.omitDomProps,d=i.displayValues,h=i.onDisplayValuesChange,f=i.emptyOptions,g=i.notFoundContent,p=g===void 0?"Not Found":g,v=i.onClear,m=i.mode,_=i.disabled,w=i.loading,y=i.getInputElement,L=i.getRawInputElement,D=i.open,E=i.defaultOpen,I=i.onDropdownVisibleChange,k=i.activeValue,R=i.onActiveValueChange,A=i.activeDescendantId,P=i.searchValue,N=i.autoClearSearchValue,M=i.onSearch,H=i.onSearchSplit,W=i.tokenSeparators,F=i.allowClear,$=i.suffixIcon,z=i.clearIcon,K=i.OptionList,j=i.animation,G=i.transitionName,X=i.dropdownStyle,de=i.dropdownClassName,he=i.dropdownMatchSelectWidth,pe=i.dropdownRender,be=i.dropdownAlign,Se=i.placement,Fe=i.builtinPlacements,De=i.getPopupContainer,ce=i.showAction,Pe=ce===void 0?[]:ce,Oe=i.onFocus,xe=i.onBlur,Ee=i.onKeyUp,tt=i.onKeyDown,nt=i.onMouseDown,Qe=Hn(i,tHe),Ge=TW(m),re=(a!==void 0?a:Ge)||m==="combobox",ie=Ce({},Qe);nHe.forEach(function(Kt){delete ie[Kt]}),u==null||u.forEach(function(Kt){delete ie[Kt]});var se=x.exports.useState(!1),U=Ne(se,2),Y=U[0],oe=U[1];x.exports.useEffect(function(){oe(eq())},[]);var te=x.exports.useRef(null),we=x.exports.useRef(null),Le=x.exports.useRef(null),Te=x.exports.useRef(null),We=x.exports.useRef(null),je=x.exports.useRef(!1),mt=dVe(),Et=Ne(mt,3),At=Et[0],Je=Et[1],xt=Et[2];x.exports.useImperativeHandle(e,function(){var Kt,on;return{focus:(Kt=Te.current)===null||Kt===void 0?void 0:Kt.focus,blur:(on=Te.current)===null||on===void 0?void 0:on.blur,scrollTo:function(Uo){var Qi;return(Qi=We.current)===null||Qi===void 0?void 0:Qi.scrollTo(Uo)}}});var Ot=x.exports.useMemo(function(){var Kt;if(m!=="combobox")return P;var on=(Kt=d[0])===null||Kt===void 0?void 0:Kt.value;return typeof on=="string"||typeof on=="number"?String(on):""},[P,m,d]),Vn=m==="combobox"&&typeof y=="function"&&y()||null,Lt=typeof L=="function"&&L(),tn=Rb(we,Lt==null||(t=Lt.props)===null||t===void 0?void 0:t.ref),ui=x.exports.useState(!1),cn=Ne(ui,2),qn=cn[0],bn=cn[1];go(function(){bn(!0)},[]);var Pt=jl(!1,{defaultValue:E,value:D}),qt=Ne(Pt,2),Nt=qt[0],jt=qt[1],Gt=qn?Nt:!1,kt=!p&&f;(_||kt&&Gt&&m==="combobox")&&(Gt=!1);var Ft=kt?!1:Gt,bt=x.exports.useCallback(function(Kt){var on=Kt!==void 0?Kt:!Gt;_||(jt(on),Gt!==on&&(I==null||I(on)))},[_,Gt,jt,I]),Zt=x.exports.useMemo(function(){return(W||[]).some(function(Kt){return[` + ${e}-confirm-body-wrapper`]:{display:"flex",flexDirection:"column",flex:"auto"},[`${e}-confirm-body`]:{marginBottom:"auto"}}}]},QWe=i=>{const{componentCls:e}=i;return{[`${e}-root`]:{[`${e}-wrap-rtl`]:{direction:"rtl",[`${e}-confirm-body`]:{direction:"rtl"}}}}},mme=i=>{const e=i.padding,t=i.fontSizeHeading5,n=i.lineHeightHeading5;return lr(i,{modalHeaderHeight:i.calc(i.calc(n).mul(t).equal()).add(i.calc(e).mul(2).equal()).equal(),modalFooterBorderColorSplit:i.colorSplit,modalFooterBorderStyle:i.lineType,modalFooterBorderWidth:i.lineWidth,modalIconHoverColor:i.colorIconHover,modalCloseIconColor:i.colorIcon,modalCloseBtnSize:i.fontHeight,modalConfirmIconSize:i.fontHeight,modalTitleHeight:i.calc(i.titleFontSize).mul(i.titleLineHeight).equal()})},vme=i=>({footerBg:"transparent",headerBg:i.colorBgElevated,titleLineHeight:i.lineHeightHeading5,titleFontSize:i.fontSizeHeading5,contentBg:i.colorBgElevated,titleColor:i.colorTextHeading,closeBtnHoverBg:i.wireframe?"transparent":i.colorFillContent,closeBtnActiveBg:i.wireframe?"transparent":i.colorFillContentHover,contentPadding:i.wireframe?0:`${rt(i.paddingMD)} ${rt(i.paddingContentHorizontalLG)}`,headerPadding:i.wireframe?`${rt(i.padding)} ${rt(i.paddingLG)}`:0,headerBorderBottom:i.wireframe?`${rt(i.lineWidth)} ${i.lineType} ${i.colorSplit}`:"none",headerMarginBottom:i.wireframe?0:i.marginXS,bodyPadding:i.wireframe?i.paddingLG:0,footerPadding:i.wireframe?`${rt(i.paddingXS)} ${rt(i.padding)}`:0,footerBorderTop:i.wireframe?`${rt(i.lineWidth)} ${i.lineType} ${i.colorSplit}`:"none",footerBorderRadius:i.wireframe?`0 0 ${rt(i.borderRadiusLG)} ${rt(i.borderRadiusLG)}`:0,footerMarginTop:i.wireframe?0:i.marginSM,confirmBodyPadding:i.wireframe?`${rt(i.padding*2)} ${rt(i.padding*2)} ${rt(i.paddingLG)}`:0,confirmIconMarginInlineEnd:i.wireframe?i.margin:i.marginSM,confirmBtnsMarginTop:i.wireframe?i.marginLG:i.marginSM});var _me=jc("Modal",i=>{const e=mme(i);return[ZWe(e),QWe(e),YWe(e),gme(e,"zoom")]},vme,{unitless:{titleLineHeight:!0}}),JWe=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(i);o{TW={x:i.pageX,y:i.pageY},setTimeout(()=>{TW=null},100)};SBe()&&document.documentElement.addEventListener("click",eVe,!0);const tVe=i=>{var e;const{getPopupContainer:t,getPrefixCls:n,direction:o,modal:r}=x.exports.useContext(Hi),s=G=>{const{onCancel:X}=i;X==null||X(G)},a=G=>{const{onOk:X}=i;X==null||X(G)},{prefixCls:l,className:c,rootClassName:u,open:d,wrapClassName:h,centered:f,getContainer:g,closeIcon:p,closable:v,focusTriggerAfterClose:m=!0,style:_,visible:y,width:w=520,footer:L,classNames:D,styles:E}=i,I=JWe(i,["prefixCls","className","rootClassName","open","wrapClassName","centered","getContainer","closeIcon","closable","focusTriggerAfterClose","style","visible","width","footer","classNames","styles"]),k=n("modal",l),R=n(),A=nh(k),[P,N,M]=_me(k,A),H=Ue(h,{[`${k}-centered`]:!!f,[`${k}-wrap-rtl`]:o==="rtl"}),B=L!==null&&x.exports.createElement(cme,Object.assign({},i,{onOk:a,onCancel:s})),[F,$]=wBe(v,p,G=>lme(k,G),x.exports.createElement(uS,{className:`${k}-close-icon`}),!0),z=vWe(`.${k}-content`),[K,j]=jK("Modal",I.zIndex);return P(x.exports.createElement(xA,null,x.exports.createElement(IW,{status:!0,override:!0},x.exports.createElement(zK.Provider,{value:j},x.exports.createElement(Zpe,Object.assign({width:w},I,{zIndex:K,getContainer:g===void 0?t:g,prefixCls:k,rootClassName:Ue(N,u,M,A),footer:B,visible:d!=null?d:y,mousePosition:(e=I.mousePosition)!==null&&e!==void 0?e:TW,onClose:s,closable:F,closeIcon:$,focusTriggerAfterClose:m,transitionName:j0(R,"zoom",i.transitionName),maskTransitionName:j0(R,"fade",i.maskTransitionName),className:Ue(N,c,r==null?void 0:r.className),style:Object.assign(Object.assign({},r==null?void 0:r.style),_),classNames:Object.assign(Object.assign({wrapper:H},r==null?void 0:r.classNames),D),styles:Object.assign(Object.assign({},r==null?void 0:r.styles),E),panelRef:z}))))))};var bme=tVe;const nVe=i=>{const{componentCls:e,titleFontSize:t,titleLineHeight:n,modalConfirmIconSize:o,fontSize:r,lineHeight:s,modalTitleHeight:a,fontHeight:l,confirmBodyPadding:c}=i,u=`${e}-confirm`;return{[u]:{"&-rtl":{direction:"rtl"},[`${i.antCls}-modal-header`]:{display:"none"},[`${u}-body-wrapper`]:Object.assign({},tpe()),[`&${e} ${e}-body`]:{padding:c},[`${u}-body`]:{display:"flex",flexWrap:"nowrap",alignItems:"start",[`> ${i.iconCls}`]:{flex:"none",fontSize:o,marginInlineEnd:i.confirmIconMarginInlineEnd,marginTop:i.calc(i.calc(l).sub(o).equal()).div(2).equal()},[`&-has-title > ${i.iconCls}`]:{marginTop:i.calc(i.calc(a).sub(o).equal()).div(2).equal()}},[`${u}-paragraph`]:{display:"flex",flexDirection:"column",flex:"auto",rowGap:i.marginXS,maxWidth:`calc(100% - ${rt(i.calc(i.modalConfirmIconSize).add(i.marginSM).equal())})`},[`${u}-title`]:{color:i.colorTextHeading,fontWeight:i.fontWeightStrong,fontSize:t,lineHeight:n},[`${u}-content`]:{color:i.colorText,fontSize:r,lineHeight:s},[`${u}-btns`]:{textAlign:"end",marginTop:i.confirmBtnsMarginTop,[`${i.antCls}-btn + ${i.antCls}-btn`]:{marginBottom:0,marginInlineStart:i.marginXS}}},[`${u}-error ${u}-body > ${i.iconCls}`]:{color:i.colorError},[`${u}-warning ${u}-body > ${i.iconCls}, + ${u}-confirm ${u}-body > ${i.iconCls}`]:{color:i.colorWarning},[`${u}-info ${u}-body > ${i.iconCls}`]:{color:i.colorInfo},[`${u}-success ${u}-body > ${i.iconCls}`]:{color:i.colorSuccess}}};var iVe=FK(["Modal","confirm"],i=>{const e=mme(i);return[nVe(e)]},vme,{order:-1e3}),oVe=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(i);o_,_t(Object.values(_))),w=x.exports.createElement(x.exports.Fragment,null,x.exports.createElement(mne,null),x.exports.createElement(vne,null)),L=i.title!==void 0&&i.title!==null,D=`${r}-body`;return x.exports.createElement("div",{className:`${r}-body-wrapper`},x.exports.createElement("div",{className:Ue(D,{[`${D}-has-title`]:L})},d,x.exports.createElement("div",{className:`${r}-paragraph`},L&&x.exports.createElement("span",{className:`${r}-title`},i.title),x.exports.createElement("div",{className:`${r}-content`},i.content))),l===void 0||typeof l=="function"?x.exports.createElement(jpe,{value:y},x.exports.createElement("div",{className:`${r}-btns`},typeof l=="function"?l(w,{OkBtn:vne,CancelBtn:mne}):w)):l,x.exports.createElement(iVe,{prefixCls:e}))}const rVe=i=>{const{close:e,zIndex:t,afterClose:n,open:o,keyboard:r,centered:s,getContainer:a,maskStyle:l,direction:c,prefixCls:u,wrapClassName:d,rootPrefixCls:h,bodyStyle:f,closable:g=!1,closeIcon:p,modalRender:v,focusTriggerAfterClose:m,onConfirm:_,styles:y}=i,w=`${u}-confirm`,L=i.width||416,D=i.style||{},E=i.mask===void 0?!0:i.mask,I=i.maskClosable===void 0?!1:i.maskClosable,k=Ue(w,`${w}-${i.type}`,{[`${w}-rtl`]:c==="rtl"},i.className),[,R]=Ba(),A=x.exports.useMemo(()=>t!==void 0?t:R.zIndexPopupBase+UK,[t,R]);return x.exports.createElement(bme,{prefixCls:u,className:k,wrapClassName:Ue({[`${w}-centered`]:!!i.centered},d),onCancel:()=>{e==null||e({triggerCancel:!0}),_==null||_(!1)},open:o,title:"",footer:null,transitionName:j0(h||"","zoom",i.transitionName),maskTransitionName:j0(h||"","fade",i.maskTransitionName),mask:E,maskClosable:I,style:D,styles:Object.assign({body:f,mask:l},y),width:L,zIndex:A,afterClose:n,keyboard:r,centered:s,getContainer:a,closable:g,closeIcon:p,modalRender:v,focusTriggerAfterClose:m},x.exports.createElement(Cme,Object.assign({},i,{confirmPrefixCls:w})))},yme=i=>{const{rootPrefixCls:e,iconPrefixCls:t,direction:n,theme:o}=i;return x.exports.createElement(fp,{prefixCls:e,iconPrefixCls:t,direction:n,theme:o},x.exports.createElement(rVe,Object.assign({},i)))},sVe=[];var r0=sVe;let wme="";function Sme(){return wme}const aVe=i=>{var e,t;const{prefixCls:n,getContainer:o,direction:r}=i,s=zge(),a=x.exports.useContext(Hi),l=Sme()||a.getPrefixCls(),c=n||`${l}-modal`;let u=o;return u===!1&&(u=void 0),he(yme,{...Object.assign({},i,{rootPrefixCls:l,prefixCls:c,iconPrefixCls:a.iconPrefixCls,theme:a.theme,direction:r!=null?r:a.direction,locale:(t=(e=a.locale)===null||e===void 0?void 0:e.Modal)!==null&&t!==void 0?t:s,getContainer:u})})};function TI(i){const e=WK(),t=document.createDocumentFragment();let n=Object.assign(Object.assign({},i),{close:a,open:!0}),o;function r(){for(var c=arguments.length,u=new Array(c),d=0;df&&f.triggerCancel);i.onCancel&&h&&i.onCancel.apply(i,[()=>{}].concat(_t(u.slice(1))));for(let f=0;f{const u=e.getPrefixCls(void 0,Sme()),d=e.getIconPrefixCls(),h=e.getTheme(),f=he(aVe,{...Object.assign({},c)});qK(he(fp,{prefixCls:u,iconPrefixCls:d,theme:h,children:e.holderRender?e.holderRender(f):f}),t)})}function a(){for(var c=arguments.length,u=new Array(c),d=0;d{typeof i.afterClose=="function"&&i.afterClose(),r.apply(this,u)}}),n.visible&&delete n.visible,s(n)}function l(c){typeof c=="function"?n=c(n):n=Object.assign(Object.assign({},n),c),s(n)}return s(n),r0.push(a),{destroy:a,update:l}}function xme(i){return Object.assign(Object.assign({},i),{type:"warning"})}function Lme(i){return Object.assign(Object.assign({},i),{type:"info"})}function Eme(i){return Object.assign(Object.assign({},i),{type:"success"})}function Dme(i){return Object.assign(Object.assign({},i),{type:"error"})}function kme(i){return Object.assign(Object.assign({},i),{type:"confirm"})}function lVe(i){let{rootPrefixCls:e}=i;wme=e}var cVe=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(i);o{var t,{afterClose:n,config:o}=i,r=cVe(i,["afterClose","config"]);const[s,a]=x.exports.useState(!0),[l,c]=x.exports.useState(o),{direction:u,getPrefixCls:d}=x.exports.useContext(Hi),h=d("modal"),f=d(),g=()=>{var _;n(),(_=l.afterClose)===null||_===void 0||_.call(l)},p=function(){a(!1);for(var _=arguments.length,y=new Array(_),w=0;w<_;w++)y[w]=arguments[w];const L=y.some(D=>D&&D.triggerCancel);l.onCancel&&L&&l.onCancel.apply(l,[()=>{}].concat(_t(y.slice(1))))};x.exports.useImperativeHandle(e,()=>({destroy:p,update:_=>{c(y=>Object.assign(Object.assign({},y),_))}}));const v=(t=l.okCancel)!==null&&t!==void 0?t:l.type==="confirm",[m]=xI("Modal",pv.Modal);return x.exports.createElement(yme,Object.assign({prefixCls:h,rootPrefixCls:f},l,{close:p,open:s,afterClose:g,okText:l.okText||(v?m==null?void 0:m.okText:m==null?void 0:m.justOkText),direction:l.direction||u,cancelText:l.cancelText||(m==null?void 0:m.cancelText)},r))};var dVe=x.exports.forwardRef(uVe);let Kne=0;const hVe=x.exports.memo(x.exports.forwardRef((i,e)=>{const[t,n]=o7e();return x.exports.useImperativeHandle(e,()=>({patchElement:n}),[]),x.exports.createElement(x.exports.Fragment,null,t)}));function fVe(){const i=x.exports.useRef(null),[e,t]=x.exports.useState([]);x.exports.useEffect(()=>{e.length&&(_t(e).forEach(s=>{s()}),t([]))},[e]);const n=x.exports.useCallback(r=>function(a){var l;Kne+=1;const c=x.exports.createRef();let u;const d=new Promise(v=>{u=v});let h=!1,f;const g=x.exports.createElement(dVe,{key:`modal-${Kne}`,config:r(a),ref:c,afterClose:()=>{f==null||f()},isSilent:()=>h,onConfirm:v=>{u(v)}});return f=(l=i.current)===null||l===void 0?void 0:l.patchElement(g),f&&r0.push(f),{destroy:()=>{function v(){var m;(m=c.current)===null||m===void 0||m.destroy()}c.current?v():t(m=>[].concat(_t(m),[v]))},update:v=>{function m(){var _;(_=c.current)===null||_===void 0||_.update(v)}c.current?m():t(_=>[].concat(_t(_),[m]))},then:v=>(h=!0,d.then(v))}},[]);return[x.exports.useMemo(()=>({info:n(Lme),success:n(Eme),error:n(Dme),warning:n(xme),confirm:n(kme)}),[]),x.exports.createElement(hVe,{key:"modal-holder",ref:i})]}const gVe=Bt.createContext({});function Ime(i){return e=>x.exports.createElement(fp,{theme:{token:{motion:!1,zIndexPopupBase:0}}},x.exports.createElement(i,Object.assign({},e)))}const pVe=(i,e,t,n)=>Ime(r=>{const{prefixCls:s,style:a}=r,l=x.exports.useRef(null),[c,u]=x.exports.useState(0),[d,h]=x.exports.useState(0),[f,g]=Kl(!1,{value:r.open}),{getPrefixCls:p}=x.exports.useContext(Hi),v=p(e||"select",s);x.exports.useEffect(()=>{if(g(!0),typeof ResizeObserver!="undefined"){const y=new ResizeObserver(L=>{const D=L[0].target;u(D.offsetHeight+8),h(D.offsetWidth)}),w=setInterval(()=>{var L;const D=t?`.${t(v)}`:`.${v}-dropdown`,E=(L=l.current)===null||L===void 0?void 0:L.querySelector(D);E&&(clearInterval(w),y.observe(E))},10);return()=>{clearInterval(w),y.disconnect()}}},[]);let m=Object.assign(Object.assign({},r),{style:Object.assign(Object.assign({},a),{margin:0}),open:f,visible:f,getPopupContainer:()=>l.current});n&&(m=n(m));const _={paddingBottom:c,position:"relative",minWidth:d};return x.exports.createElement("div",{ref:l,style:_},x.exports.createElement(i,Object.assign({},m)))});var mVe=pVe,oq=function(){if(typeof navigator=="undefined"||typeof window=="undefined")return!1;var i=navigator.userAgent||navigator.vendor||window.opera;return/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(i)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(i==null?void 0:i.substr(0,4))},N4=function(e){var t=e.className,n=e.customizeIcon,o=e.customizeIconProps,r=e.children,s=e.onMouseDown,a=e.onClick,l=typeof n=="function"?n(o):n;return x.exports.createElement("span",{className:t,onMouseDown:function(u){u.preventDefault(),s==null||s(u)},style:{userSelect:"none",WebkitUserSelect:"none"},unselectable:"on",onClick:a,"aria-hidden":!0},l!==void 0?l:x.exports.createElement("span",{className:Ue(t.split(/\s+/).map(function(c){return"".concat(c,"-icon")}))},r))},vVe=function(e,t,n,o,r){var s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!1,a=arguments.length>6?arguments[6]:void 0,l=arguments.length>7?arguments[7]:void 0,c=Bt.useMemo(function(){if(Kn(o)==="object")return o.clearIcon;if(r)return r},[o,r]),u=Bt.useMemo(function(){return!!(!s&&!!o&&(n.length||a)&&!(l==="combobox"&&a===""))},[o,s,n.length,a,l]);return{allowClear:u,clearIcon:Bt.createElement(N4,{className:"".concat(e,"-clear"),onMouseDown:t,customizeIcon:c},"\xD7")}},Tme=x.exports.createContext(null);function _Ve(){return x.exports.useContext(Tme)}function bVe(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:10,e=x.exports.useState(!1),t=Ne(e,2),n=t[0],o=t[1],r=x.exports.useRef(null),s=function(){window.clearTimeout(r.current)};x.exports.useEffect(function(){return s},[]);var a=function(c,u){s(),r.current=window.setTimeout(function(){o(c),u&&u()},i)};return[n,a,s]}function Nme(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:250,e=x.exports.useRef(null),t=x.exports.useRef(null);x.exports.useEffect(function(){return function(){window.clearTimeout(t.current)}},[]);function n(o){(o||e.current===null)&&(e.current=o),window.clearTimeout(t.current),t.current=window.setTimeout(function(){e.current=null},i)}return[function(){return e.current},n]}function CVe(i,e,t,n){var o=x.exports.useRef(null);o.current={open:e,triggerOpen:t,customizedTrigger:n},x.exports.useEffect(function(){function r(s){var a;if(!((a=o.current)!==null&&a!==void 0&&a.customizedTrigger)){var l=s.target;l.shadowRoot&&s.composed&&(l=s.composedPath()[0]||l),o.current.open&&i().filter(function(c){return c}).every(function(c){return!c.contains(l)&&c!==l})&&o.current.triggerOpen(!1)}}return window.addEventListener("mousedown",r),function(){return window.removeEventListener("mousedown",r)}},[])}var yVe=["prefixCls","invalidate","item","renderItem","responsive","responsiveDisabled","registerSize","itemKey","className","style","children","display","order","component"],k1=void 0;function wVe(i,e){var t=i.prefixCls,n=i.invalidate,o=i.item,r=i.renderItem,s=i.responsive,a=i.responsiveDisabled,l=i.registerSize,c=i.itemKey,u=i.className,d=i.style,h=i.children,f=i.display,g=i.order,p=i.component,v=p===void 0?"div":p,m=Hn(i,yVe),_=s&&!f;function y(I){l(c,I)}x.exports.useEffect(function(){return function(){y(null)}},[]);var w=r&&o!==k1?r(o):h,L;n||(L={opacity:_?0:1,height:_?0:k1,overflowY:_?"hidden":k1,order:s?g:k1,pointerEvents:_?"none":k1,position:_?"absolute":k1});var D={};_&&(D["aria-hidden"]=!0);var E=x.exports.createElement(v,yt({className:Ue(!n&&t,u),style:Ce(Ce({},L),d)},D,m,{ref:e}),w);return s&&(E=x.exports.createElement(Md,{onResize:function(k){var R=k.offsetWidth;y(R)},disabled:a},E)),E}var oE=x.exports.forwardRef(wVe);oE.displayName="Item";function SVe(i){if(typeof MessageChannel=="undefined")Xi(i);else{var e=new MessageChannel;e.port1.onmessage=function(){return i()},e.port2.postMessage(void 0)}}function xVe(){var i=x.exports.useRef(null),e=function(n){i.current||(i.current=[],SVe(function(){zd.exports.unstable_batchedUpdates(function(){i.current.forEach(function(o){o()}),i.current=null})})),i.current.push(n)};return e}function Sx(i,e){var t=x.exports.useState(e),n=Ne(t,2),o=n[0],r=n[1],s=tl(function(a){i(function(){r(a)})});return[o,s]}var DA=Bt.createContext(null),LVe=["component"],EVe=["className"],DVe=["className"],kVe=function(e,t){var n=x.exports.useContext(DA);if(!n){var o=e.component,r=o===void 0?"div":o,s=Hn(e,LVe);return x.exports.createElement(r,yt({},s,{ref:t}))}var a=n.className,l=Hn(n,EVe),c=e.className,u=Hn(e,DVe);return x.exports.createElement(DA.Provider,{value:null},x.exports.createElement(oE,yt({ref:t,className:Ue(a,c)},l,u)))},Rme=x.exports.forwardRef(kVe);Rme.displayName="RawItem";var IVe=["prefixCls","data","renderItem","renderRawItem","itemKey","itemWidth","ssr","style","className","maxCount","renderRest","renderRawRest","suffix","component","itemComponent","onVisibleChange"],Mme="responsive",Ame="invalidate";function TVe(i){return"+ ".concat(i.length," ...")}function NVe(i,e){var t=i.prefixCls,n=t===void 0?"rc-overflow":t,o=i.data,r=o===void 0?[]:o,s=i.renderItem,a=i.renderRawItem,l=i.itemKey,c=i.itemWidth,u=c===void 0?10:c,d=i.ssr,h=i.style,f=i.className,g=i.maxCount,p=i.renderRest,v=i.renderRawRest,m=i.suffix,_=i.component,y=_===void 0?"div":_,w=i.itemComponent,L=i.onVisibleChange,D=Hn(i,IVe),E=d==="full",I=xVe(),k=Sx(I,null),R=Ne(k,2),A=R[0],P=R[1],N=A||0,M=Sx(I,new Map),H=Ne(M,2),B=H[0],F=H[1],$=Sx(I,0),z=Ne($,2),K=z[0],j=z[1],G=Sx(I,0),X=Ne(G,2),de=X[0],fe=X[1],pe=Sx(I,0),be=Ne(pe,2),Se=be[0],Fe=be[1],De=x.exports.useState(null),ce=Ne(De,2),Pe=ce[0],Oe=ce[1],xe=x.exports.useState(null),Ee=Ne(xe,2),tt=Ee[0],nt=Ee[1],Qe=x.exports.useMemo(function(){return tt===null&&E?Number.MAX_SAFE_INTEGER:tt||0},[tt,A]),Ge=x.exports.useState(!1),re=Ne(Ge,2),ie=re[0],se=re[1],U="".concat(n,"-item"),Y=Math.max(K,de),oe=g===Mme,te=r.length&&oe,ye=g===Ame,Le=te||typeof g=="number"&&r.length>g,Te=x.exports.useMemo(function(){var Nt=r;return te?A===null&&E?Nt=r:Nt=r.slice(0,Math.min(r.length,N/u)):typeof g=="number"&&(Nt=r.slice(0,g)),Nt},[r,u,A,g,te]),We=x.exports.useMemo(function(){return te?r.slice(Qe+1):r.slice(Te.length)},[r,Te,te,Qe]),je=x.exports.useCallback(function(Nt,jt){var Gt;return typeof l=="function"?l(Nt):(Gt=l&&(Nt==null?void 0:Nt[l]))!==null&&Gt!==void 0?Gt:jt},[l]),mt=x.exports.useCallback(s||function(Nt){return Nt},[s]);function Dt(Nt,jt,Gt){tt===Nt&&(jt===void 0||jt===Pe)||(nt(Nt),Gt||(se(NtN){Dt(It-1,Nt-Ft-Se+de);break}}m&&Vn(0)+Se>N&&Oe(null)}},[N,B,de,Se,je,Te]);var Et=ie&&!!We.length,tn={};Pe!==null&&te&&(tn={position:"absolute",left:Pe,top:0});var ui={prefixCls:U,responsive:te,component:w,invalidate:ye},cn=a?function(Nt,jt){var Gt=je(Nt,jt);return x.exports.createElement(DA.Provider,{key:Gt,value:Ce(Ce({},ui),{},{order:jt,item:Nt,itemKey:Gt,registerSize:Je,display:jt<=Qe})},a(Nt,jt))}:function(Nt,jt){var Gt=je(Nt,jt);return x.exports.createElement(oE,yt({},ui,{order:jt,key:Gt,item:Nt,renderItem:mt,itemKey:Gt,registerSize:Je,display:jt<=Qe}))},qn,bn={order:Et?Qe:Number.MAX_SAFE_INTEGER,className:"".concat(U,"-rest"),registerSize:Lt,display:Et};if(v)v&&(qn=x.exports.createElement(DA.Provider,{value:Ce(Ce({},ui),bn)},v(We)));else{var Pt=p||TVe;qn=x.exports.createElement(oE,yt({},ui,bn),typeof Pt=="function"?Pt(We):Pt)}var qt=x.exports.createElement(y,yt({className:Ue(!ye&&n,f),style:h,ref:e},D),Te.map(cn),Le?qn:null,m&&x.exports.createElement(oE,yt({},ui,{responsive:oe,responsiveDisabled:!te,order:Qe,className:"".concat(U,"-suffix"),registerSize:Ot,display:!0,style:tn}),m));return oe&&(qt=x.exports.createElement(Md,{onResize:At,disabled:!te},qt)),qt}var sf=x.exports.forwardRef(NVe);sf.displayName="Overflow";sf.Item=Rme;sf.RESPONSIVE=Mme;sf.INVALIDATE=Ame;var RVe=function(e,t){var n,o=e.prefixCls,r=e.id,s=e.inputElement,a=e.disabled,l=e.tabIndex,c=e.autoFocus,u=e.autoComplete,d=e.editable,h=e.activeDescendantId,f=e.value,g=e.maxLength,p=e.onKeyDown,v=e.onMouseDown,m=e.onChange,_=e.onPaste,y=e.onCompositionStart,w=e.onCompositionEnd,L=e.open,D=e.attrs,E=s||x.exports.createElement("input",null),I=E,k=I.ref,R=I.props,A=R.onKeyDown,P=R.onChange,N=R.onMouseDown,M=R.onCompositionStart,H=R.onCompositionEnd,B=R.style;return"maxLength"in E.props,E=x.exports.cloneElement(E,Ce(Ce(Ce({type:"search"},R),{},{id:r,ref:eh(t,k),disabled:a,tabIndex:l,autoComplete:u||"off",autoFocus:c,className:Ue("".concat(o,"-selection-search-input"),(n=E)===null||n===void 0||(n=n.props)===null||n===void 0?void 0:n.className),role:"combobox","aria-expanded":L||!1,"aria-haspopup":"listbox","aria-owns":"".concat(r,"_list"),"aria-autocomplete":"list","aria-controls":"".concat(r,"_list"),"aria-activedescendant":L?h:void 0},D),{},{value:d?f:"",maxLength:g,readOnly:!d,unselectable:d?null:"on",style:Ce(Ce({},B),{},{opacity:d?null:0}),onKeyDown:function($){p($),A&&A($)},onMouseDown:function($){v($),N&&N($)},onChange:function($){m($),P&&P($)},onCompositionStart:function($){y($),M&&M($)},onCompositionEnd:function($){w($),H&&H($)},onPaste:_})),E},Pme=x.exports.forwardRef(RVe);function Ome(i){return Array.isArray(i)?i:i!==void 0?[i]:[]}var MVe=typeof window!="undefined"&&window.document&&window.document.documentElement,AVe=MVe;function PVe(i){return i!=null}function OVe(i){return!i&&i!==0}function qne(i){return["string","number"].includes(Kn(i))}function Fme(i){var e=void 0;return i&&(qne(i.title)?e=i.title.toString():qne(i.label)&&(e=i.label.toString())),e}function FVe(i,e){AVe?x.exports.useLayoutEffect(i,e):x.exports.useEffect(i,e)}function BVe(i){var e;return(e=i.key)!==null&&e!==void 0?e:i.value}var Gne=function(e){e.preventDefault(),e.stopPropagation()},WVe=function(e){var t=e.id,n=e.prefixCls,o=e.values,r=e.open,s=e.searchValue,a=e.autoClearSearchValue,l=e.inputRef,c=e.placeholder,u=e.disabled,d=e.mode,h=e.showSearch,f=e.autoFocus,g=e.autoComplete,p=e.activeDescendantId,v=e.tabIndex,m=e.removeIcon,_=e.maxTagCount,y=e.maxTagTextLength,w=e.maxTagPlaceholder,L=w===void 0?function(Oe){return"+ ".concat(Oe.length," ...")}:w,D=e.tagRender,E=e.onToggleOpen,I=e.onRemove,k=e.onInputChange,R=e.onInputPaste,A=e.onInputKeyDown,P=e.onInputMouseDown,N=e.onInputCompositionStart,M=e.onInputCompositionEnd,H=x.exports.useRef(null),B=x.exports.useState(0),F=Ne(B,2),$=F[0],z=F[1],K=x.exports.useState(!1),j=Ne(K,2),G=j[0],X=j[1],de="".concat(n,"-selection"),fe=r||d==="multiple"&&a===!1||d==="tags"?s:"",pe=d==="tags"||d==="multiple"&&a===!1||h&&(r||G);FVe(function(){z(H.current.scrollWidth)},[fe]);var be=function(xe,Ee,tt,nt,Qe){return x.exports.createElement("span",{title:Fme(xe),className:Ue("".concat(de,"-item"),me({},"".concat(de,"-item-disabled"),tt))},x.exports.createElement("span",{className:"".concat(de,"-item-content")},Ee),nt&&x.exports.createElement(N4,{className:"".concat(de,"-item-remove"),onMouseDown:Gne,onClick:Qe,customizeIcon:m},"\xD7"))},Se=function(xe,Ee,tt,nt,Qe){var Ge=function(ie){Gne(ie),E(!r)};return x.exports.createElement("span",{onMouseDown:Ge},D({label:Ee,value:xe,disabled:tt,closable:nt,onClose:Qe}))},Fe=function(xe){var Ee=xe.disabled,tt=xe.label,nt=xe.value,Qe=!u&&!Ee,Ge=tt;if(typeof y=="number"&&(typeof tt=="string"||typeof tt=="number")){var re=String(Ge);re.length>y&&(Ge="".concat(re.slice(0,y),"..."))}var ie=function(U){U&&U.stopPropagation(),I(xe)};return typeof D=="function"?Se(nt,Ge,Ee,Qe,ie):be(xe,Ge,Ee,Qe,ie)},De=function(xe){var Ee=typeof L=="function"?L(xe):L;return be({title:Ee},Ee,!1)},ce=x.exports.createElement("div",{className:"".concat(de,"-search"),style:{width:$},onFocus:function(){X(!0)},onBlur:function(){X(!1)}},x.exports.createElement(Pme,{ref:l,open:r,prefixCls:n,id:t,inputElement:null,disabled:u,autoFocus:f,autoComplete:g,editable:pe,activeDescendantId:p,value:fe,onKeyDown:A,onMouseDown:P,onChange:k,onPaste:R,onCompositionStart:N,onCompositionEnd:M,tabIndex:v,attrs:U0(e,!0)}),x.exports.createElement("span",{ref:H,className:"".concat(de,"-search-mirror"),"aria-hidden":!0},fe,"\xA0")),Pe=x.exports.createElement(sf,{prefixCls:"".concat(de,"-overflow"),data:o,renderItem:Fe,renderRest:De,suffix:ce,itemKey:BVe,maxCount:_});return x.exports.createElement(x.exports.Fragment,null,Pe,!o.length&&!fe&&x.exports.createElement("span",{className:"".concat(de,"-placeholder")},c))},VVe=function(e){var t=e.inputElement,n=e.prefixCls,o=e.id,r=e.inputRef,s=e.disabled,a=e.autoFocus,l=e.autoComplete,c=e.activeDescendantId,u=e.mode,d=e.open,h=e.values,f=e.placeholder,g=e.tabIndex,p=e.showSearch,v=e.searchValue,m=e.activeValue,_=e.maxLength,y=e.onInputKeyDown,w=e.onInputMouseDown,L=e.onInputChange,D=e.onInputPaste,E=e.onInputCompositionStart,I=e.onInputCompositionEnd,k=e.title,R=x.exports.useState(!1),A=Ne(R,2),P=A[0],N=A[1],M=u==="combobox",H=M||p,B=h[0],F=v||"";M&&m&&!P&&(F=m),x.exports.useEffect(function(){M&&N(!1)},[M,m]);var $=u!=="combobox"&&!d&&!p?!1:!!F,z=k===void 0?Fme(B):k,K=x.exports.useMemo(function(){return B?null:x.exports.createElement("span",{className:"".concat(n,"-selection-placeholder"),style:$?{visibility:"hidden"}:void 0},f)},[B,$,f,n]);return x.exports.createElement(x.exports.Fragment,null,x.exports.createElement("span",{className:"".concat(n,"-selection-search")},x.exports.createElement(Pme,{ref:r,prefixCls:n,id:o,open:d,inputElement:t,disabled:s,autoFocus:a,autoComplete:l,editable:H,activeDescendantId:c,value:F,onKeyDown:y,onMouseDown:w,onChange:function(G){N(!0),L(G)},onPaste:D,onCompositionStart:E,onCompositionEnd:I,tabIndex:g,attrs:U0(e,!0),maxLength:M?_:void 0})),!M&&B?x.exports.createElement("span",{className:"".concat(n,"-selection-item"),title:z,style:$?{visibility:"hidden"}:void 0},B.label):null,K)};function HVe(i){return![at.ESC,at.SHIFT,at.BACKSPACE,at.TAB,at.WIN_KEY,at.ALT,at.META,at.WIN_KEY_RIGHT,at.CTRL,at.SEMICOLON,at.EQUALS,at.CAPS_LOCK,at.CONTEXT_MENU,at.F1,at.F2,at.F3,at.F4,at.F5,at.F6,at.F7,at.F8,at.F9,at.F10,at.F11,at.F12].includes(i)}var $Ve=function(e,t){var n=x.exports.useRef(null),o=x.exports.useRef(!1),r=e.prefixCls,s=e.open,a=e.mode,l=e.showSearch,c=e.tokenWithEnter,u=e.autoClearSearchValue,d=e.onSearch,h=e.onSearchSubmit,f=e.onToggleOpen,g=e.onInputKeyDown,p=e.domRef;x.exports.useImperativeHandle(t,function(){return{focus:function(){n.current.focus()},blur:function(){n.current.blur()}}});var v=Nme(0),m=Ne(v,2),_=m[0],y=m[1],w=function(F){var $=F.which;($===at.UP||$===at.DOWN)&&F.preventDefault(),g&&g(F),$===at.ENTER&&a==="tags"&&!o.current&&!s&&(h==null||h(F.target.value)),HVe($)&&f(!0)},L=function(){y(!0)},D=x.exports.useRef(null),E=function(F){d(F,!0,o.current)!==!1&&f(!0)},I=function(){o.current=!0},k=function(F){o.current=!1,a!=="combobox"&&E(F.target.value)},R=function(F){var $=F.target.value;if(c&&D.current&&/[\r\n]/.test(D.current)){var z=D.current.replace(/[\r\n]+$/,"").replace(/\r\n/g," ").replace(/[\r\n]/g," ");$=$.replace(z,D.current)}D.current=null,E($)},A=function(F){var $=F.clipboardData,z=$==null?void 0:$.getData("text");D.current=z||""},P=function(F){var $=F.target;if($!==n.current){var z=document.body.style.msTouchAction!==void 0;z?setTimeout(function(){n.current.focus()}):n.current.focus()}},N=function(F){var $=_();F.target!==n.current&&!$&&a!=="combobox"&&F.preventDefault(),(a!=="combobox"&&(!l||!$)||!s)&&(s&&u!==!1&&d("",!0,!1),f())},M={inputRef:n,onInputKeyDown:w,onInputMouseDown:L,onInputChange:R,onInputPaste:A,onInputCompositionStart:I,onInputCompositionEnd:k},H=a==="multiple"||a==="tags"?x.exports.createElement(WVe,yt({},e,M)):x.exports.createElement(VVe,yt({},e,M));return x.exports.createElement("div",{ref:p,className:"".concat(r,"-selector"),onClick:P,onMouseDown:N},H)},zVe=x.exports.forwardRef($Ve);function UVe(i){var e=i.prefixCls,t=i.align,n=i.arrow,o=i.arrowPos,r=n||{},s=r.className,a=r.content,l=o.x,c=l===void 0?0:l,u=o.y,d=u===void 0?0:u,h=x.exports.useRef();if(!t||!t.points)return null;var f={position:"absolute"};if(t.autoArrow!==!1){var g=t.points[0],p=t.points[1],v=g[0],m=g[1],_=p[0],y=p[1];v===_||!["t","b"].includes(v)?f.top=d:v==="t"?f.top=0:f.bottom=0,m===y||!["l","r"].includes(m)?f.left=c:m==="l"?f.left=0:f.right=0}return x.exports.createElement("div",{ref:h,className:Ue("".concat(e,"-arrow"),s),style:f},a)}function jVe(i){var e=i.prefixCls,t=i.open,n=i.zIndex,o=i.mask,r=i.motion;return o?x.exports.createElement(th,yt({},r,{motionAppear:!0,visible:t,removeOnLeave:!0}),function(s){var a=s.className;return x.exports.createElement("div",{style:{zIndex:n},className:Ue("".concat(e,"-mask"),a)})}):null}var KVe=x.exports.memo(function(i){var e=i.children;return e},function(i,e){return e.cache}),qVe=x.exports.forwardRef(function(i,e){var t=i.popup,n=i.className,o=i.prefixCls,r=i.style,s=i.target,a=i.onVisibleChanged,l=i.open,c=i.keepDom,u=i.fresh,d=i.onClick,h=i.mask,f=i.arrow,g=i.arrowPos,p=i.align,v=i.motion,m=i.maskMotion,_=i.forceRender,y=i.getPopupContainer,w=i.autoDestroy,L=i.portal,D=i.zIndex,E=i.onMouseEnter,I=i.onMouseLeave,k=i.onPointerEnter,R=i.ready,A=i.offsetX,P=i.offsetY,N=i.offsetR,M=i.offsetB,H=i.onAlign,B=i.onPrepare,F=i.stretch,$=i.targetWidth,z=i.targetHeight,K=typeof t=="function"?t():t,j=l||c,G=(y==null?void 0:y.length)>0,X=x.exports.useState(!y||!G),de=Ne(X,2),fe=de[0],pe=de[1];if(go(function(){!fe&&G&&s&&pe(!0)},[fe,G,s]),!fe)return null;var be="auto",Se={left:"-1000vw",top:"-1000vh",right:be,bottom:be};if(R||!l){var Fe,De=p.points,ce=p.dynamicInset||((Fe=p._experimental)===null||Fe===void 0?void 0:Fe.dynamicInset),Pe=ce&&De[0][1]==="r",Oe=ce&&De[0][0]==="b";Pe?(Se.right=N,Se.left=be):(Se.left=A,Se.right=be),Oe?(Se.bottom=M,Se.top=be):(Se.top=P,Se.bottom=be)}var xe={};return F&&(F.includes("height")&&z?xe.height=z:F.includes("minHeight")&&z&&(xe.minHeight=z),F.includes("width")&&$?xe.width=$:F.includes("minWidth")&&$&&(xe.minWidth=$)),l||(xe.pointerEvents="none"),x.exports.createElement(L,{open:_||j,getContainer:y&&function(){return y(s)},autoDestroy:w},x.exports.createElement(jVe,{prefixCls:o,open:l,zIndex:D,mask:h,motion:m}),x.exports.createElement(Md,{onResize:H,disabled:!l},function(Ee){return x.exports.createElement(th,yt({motionAppear:!0,motionEnter:!0,motionLeave:!0,removeOnLeave:!1,forceRender:_,leavedClassName:"".concat(o,"-hidden")},v,{onAppearPrepare:B,onEnterPrepare:B,visible:l,onVisibleChanged:function(nt){var Qe;v==null||(Qe=v.onVisibleChanged)===null||Qe===void 0||Qe.call(v,nt),a(nt)}}),function(tt,nt){var Qe=tt.className,Ge=tt.style,re=Ue(o,Qe,n);return x.exports.createElement("div",{ref:eh(Ee,e,nt),className:re,style:Ce(Ce(Ce(Ce({"--arrow-x":"".concat(g.x||0,"px"),"--arrow-y":"".concat(g.y||0,"px")},Se),xe),Ge),{},{boxSizing:"border-box",zIndex:D},r),onMouseEnter:E,onMouseLeave:I,onPointerEnter:k,onClick:d},f&&x.exports.createElement(UVe,{prefixCls:o,arrow:f,arrowPos:g,align:p}),x.exports.createElement(KVe,{cache:!l&&!u},K))})}))}),GVe=x.exports.forwardRef(function(i,e){var t=i.children,n=i.getTriggerDOMNode,o=Kv(t),r=x.exports.useCallback(function(a){wK(e,n?n(a):a)},[n]),s=Mb(r,t.ref);return o?x.exports.cloneElement(t,{ref:s}):t}),Xne=x.exports.createContext(null);function Yne(i){return i?Array.isArray(i)?i:[i]:[]}function XVe(i,e,t,n){return x.exports.useMemo(function(){var o=Yne(t!=null?t:e),r=Yne(n!=null?n:e),s=new Set(o),a=new Set(r);return i&&(s.has("hover")&&(s.delete("hover"),s.add("click")),a.has("hover")&&(a.delete("hover"),a.add("click"))),[s,a]},[i,e,t,n])}function YVe(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],t=arguments.length>2?arguments[2]:void 0;return t?i[0]===e[0]:i[0]===e[0]&&i[1]===e[1]}function ZVe(i,e,t,n){for(var o=t.points,r=Object.keys(i),s=0;s1&&arguments[1]!==void 0?arguments[1]:1;return Number.isNaN(i)?e:i}function xx(i){return vD(parseFloat(i),0)}function Qne(i,e){var t=Ce({},i);return(e||[]).forEach(function(n){if(!(n instanceof HTMLBodyElement||n instanceof HTMLHtmlElement)){var o=NI(n).getComputedStyle(n),r=o.overflow,s=o.overflowClipMargin,a=o.borderTopWidth,l=o.borderBottomWidth,c=o.borderLeftWidth,u=o.borderRightWidth,d=n.getBoundingClientRect(),h=n.offsetHeight,f=n.clientHeight,g=n.offsetWidth,p=n.clientWidth,v=xx(a),m=xx(l),_=xx(c),y=xx(u),w=vD(Math.round(d.width/g*1e3)/1e3),L=vD(Math.round(d.height/h*1e3)/1e3),D=(g-p-_-y)*w,E=(h-f-v-m)*L,I=v*L,k=m*L,R=_*w,A=y*w,P=0,N=0;if(r==="clip"){var M=xx(s);P=M*w,N=M*L}var H=d.x+R-P,B=d.y+I-N,F=H+d.width+2*P-R-A-D,$=B+d.height+2*N-I-k-E;t.left=Math.max(t.left,H),t.top=Math.max(t.top,B),t.right=Math.min(t.right,F),t.bottom=Math.min(t.bottom,$)}}),t}function Jne(i){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,t="".concat(e),n=t.match(/^(.*)\%$/);return n?i*(parseFloat(n[1])/100):parseFloat(t)}function eie(i,e){var t=e||[],n=Ne(t,2),o=n[0],r=n[1];return[Jne(i.width,o),Jne(i.height,r)]}function tie(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return[i[0],i[1]]}function I1(i,e){var t=e[0],n=e[1],o,r;return t==="t"?r=i.y:t==="b"?r=i.y+i.height:r=i.y+i.height/2,n==="l"?o=i.x:n==="r"?o=i.x+i.width:o=i.x+i.width/2,{x:o,y:r}}function Pp(i,e){var t={t:"b",b:"t",l:"r",r:"l"};return i.map(function(n,o){return o===e?t[n]||"c":n}).join("")}function QVe(i,e,t,n,o,r,s){var a=x.exports.useState({ready:!1,offsetX:0,offsetY:0,offsetR:0,offsetB:0,arrowX:0,arrowY:0,scaleX:1,scaleY:1,align:o[n]||{}}),l=Ne(a,2),c=l[0],u=l[1],d=x.exports.useRef(0),h=x.exports.useMemo(function(){return e?NW(e):[]},[e]),f=x.exports.useRef({}),g=function(){f.current={}};i||g();var p=tl(function(){if(e&&t&&i){let er=function(Qc,Mf){var Af=arguments.length>2&&arguments[2]!==void 0?arguments[2]:re,Pf=K.x+Qc,Sp=K.y+Mf,xp=Pf+Fe,i1=Sp+Se,FS=Math.max(Pf,Af.left),BS=Math.max(Sp,Af.top),o1=Math.min(xp,Af.right),WS=Math.min(i1,Af.bottom);return Math.max(0,(o1-FS)*(WS-BS))},s_=function(){Zi=K.y+Pt,an=Zi+Se,Xt=K.x+bn,oi=Xt+Fe};var _,y,w=e,L=w.ownerDocument,D=NI(w),E=D.getComputedStyle(w),I=E.width,k=E.height,R=E.position,A=w.style.left,P=w.style.top,N=w.style.right,M=w.style.bottom,H=w.style.overflow,B=Ce(Ce({},o[n]),r),F=L.createElement("div");(_=w.parentElement)===null||_===void 0||_.appendChild(F),F.style.left="".concat(w.offsetLeft,"px"),F.style.top="".concat(w.offsetTop,"px"),F.style.position=R,F.style.height="".concat(w.offsetHeight,"px"),F.style.width="".concat(w.offsetWidth,"px"),w.style.left="0",w.style.top="0",w.style.right="auto",w.style.bottom="auto",w.style.overflow="hidden";var $;if(Array.isArray(t))$={x:t[0],y:t[1],width:0,height:0};else{var z=t.getBoundingClientRect();$={x:z.x,y:z.y,width:z.width,height:z.height}}var K=w.getBoundingClientRect(),j=L.documentElement,G=j.clientWidth,X=j.clientHeight,de=j.scrollWidth,fe=j.scrollHeight,pe=j.scrollTop,be=j.scrollLeft,Se=K.height,Fe=K.width,De=$.height,ce=$.width,Pe={left:0,top:0,right:G,bottom:X},Oe={left:-be,top:-pe,right:de-be,bottom:fe-pe},xe=B.htmlRegion,Ee="visible",tt="visibleFirst";xe!=="scroll"&&xe!==tt&&(xe=Ee);var nt=xe===tt,Qe=Qne(Oe,h),Ge=Qne(Pe,h),re=xe===Ee?Ge:Qe,ie=nt?Ge:re;w.style.left="auto",w.style.top="auto",w.style.right="0",w.style.bottom="0";var se=w.getBoundingClientRect();w.style.left=A,w.style.top=P,w.style.right=N,w.style.bottom=M,w.style.overflow=H,(y=w.parentElement)===null||y===void 0||y.removeChild(F);var U=vD(Math.round(Fe/parseFloat(I)*1e3)/1e3),Y=vD(Math.round(Se/parseFloat(k)*1e3)/1e3);if(U===0||Y===0||mA(t)&&!k4(t))return;var oe=B.offset,te=B.targetOffset,ye=eie(K,oe),Le=Ne(ye,2),Te=Le[0],We=Le[1],je=eie($,te),mt=Ne(je,2),Dt=mt[0],At=mt[1];$.x-=Dt,$.y-=At;var Je=B.points||[],Lt=Ne(Je,2),Ot=Lt[0],Vn=Lt[1],Et=tie(Vn),tn=tie(Ot),ui=I1($,Et),cn=I1(K,tn),qn=Ce({},B),bn=ui.x-cn.x+Te,Pt=ui.y-cn.y+We,qt=er(bn,Pt),Nt=er(bn,Pt,Ge),jt=I1($,["t","l"]),Gt=I1(K,["t","l"]),It=I1($,["b","r"]),Ft=I1(K,["b","r"]),bt=B.overflow||{},Zt=bt.adjustX,wn=bt.adjustY,Dn=bt.shiftX,Gn=bt.shiftY,Un=function(Mf){return typeof Mf=="boolean"?Mf:Mf>=0},Zi,an,Xt,oi;s_();var Ze=Un(wn),ue=tn[0]===Et[0];if(Ze&&tn[0]==="t"&&(an>ie.bottom||f.current.bt)){var Ve=Pt;ue?Ve-=Se-De:Ve=jt.y-Ft.y-We;var ot=er(bn,Ve),Sn=er(bn,Ve,Ge);ot>qt||ot===qt&&(!nt||Sn>=Nt)?(f.current.bt=!0,Pt=Ve,We=-We,qn.points=[Pp(tn,0),Pp(Et,0)]):f.current.bt=!1}if(Ze&&tn[0]==="b"&&(Ziqt||Ci===qt&&(!nt||An>=Nt)?(f.current.tb=!0,Pt=$n,We=-We,qn.points=[Pp(tn,0),Pp(Et,0)]):f.current.tb=!1}var lo=Un(Zt),Qo=tn[1]===Et[1];if(lo&&tn[1]==="l"&&(oi>ie.right||f.current.rl)){var zo=bn;Qo?zo-=Fe-ce:zo=jt.x-Ft.x-Te;var oc=er(zo,Pt),Yc=er(zo,Pt,Ge);oc>qt||oc===qt&&(!nt||Yc>=Nt)?(f.current.rl=!0,bn=zo,Te=-Te,qn.points=[Pp(tn,1),Pp(Et,1)]):f.current.rl=!1}if(lo&&tn[1]==="r"&&(Xtqt||Ua===qt&&(!nt||vl>=Nt)?(f.current.lr=!0,bn=Gr,Te=-Te,qn.points=[Pp(tn,1),Pp(Et,1)]):f.current.lr=!1}s_();var ba=Dn===!0?0:Dn;typeof ba=="number"&&(XtGe.right&&(bn-=oi-Ge.right-Te,$.x>Ge.right-ba&&(bn+=$.x-Ge.right+ba)));var _l=Gn===!0?0:Gn;typeof _l=="number"&&(ZiGe.bottom&&(Pt-=an-Ge.bottom-We,$.y>Ge.bottom-_l&&(Pt+=$.y-Ge.bottom+_l)));var rc=K.x+bn,Zc=rc+Fe,Ca=K.y+Pt,Yu=Ca+Se,bl=$.x,mi=bl+ce,gi=$.y,Kt=gi+De,on=Math.max(rc,bl),vi=Math.min(Zc,mi),Uo=(on+vi)/2,Qi=Uo-rc,Jo=Math.max(Ca,gi),_r=Math.min(Yu,Kt),zs=(Jo+_r)/2,Tr=zs-Ca;s==null||s(e,qn);var us=se.right-K.x-(bn+K.width),Ts=se.bottom-K.y-(Pt+K.height);u({ready:!0,offsetX:bn/U,offsetY:Pt/Y,offsetR:us/U,offsetB:Ts/Y,arrowX:Qi/U,arrowY:Tr/Y,scaleX:U,scaleY:Y,align:qn})}}),v=function(){d.current+=1;var y=d.current;Promise.resolve().then(function(){d.current===y&&p()})},m=function(){u(function(y){return Ce(Ce({},y),{},{ready:!1})})};return go(m,[n]),go(function(){i||m()},[i]),[c.ready,c.offsetX,c.offsetY,c.offsetR,c.offsetB,c.arrowX,c.arrowY,c.scaleX,c.scaleY,c.align,v]}function JVe(i,e,t,n,o){go(function(){if(i&&e&&t){let d=function(){n(),o()};var r=e,s=t,a=NW(r),l=NW(s),c=NI(s),u=new Set([c].concat(_t(a),_t(l)));return u.forEach(function(h){h.addEventListener("scroll",d,{passive:!0})}),c.addEventListener("resize",d,{passive:!0}),n(),function(){u.forEach(function(h){h.removeEventListener("scroll",d),c.removeEventListener("resize",d)})}}},[i,e,t])}function eHe(i,e,t,n,o,r,s,a){var l=x.exports.useRef(i),c=x.exports.useRef(!1);l.current!==i&&(c.current=!0,l.current=i),x.exports.useEffect(function(){var u=Xi(function(){c.current=!1});return function(){Xi.cancel(u)}},[i]),x.exports.useEffect(function(){if(e&&n&&(!o||r)){var u=function(){var D=!1,E=function(R){var A=R.target;D=s(A)},I=function(R){var A=R.target;!c.current&&l.current&&!D&&!s(A)&&a(!1)};return[E,I]},d=u(),h=Ne(d,2),f=h[0],g=h[1],p=u(),v=Ne(p,2),m=v[0],_=v[1],y=NI(n);y.addEventListener("mousedown",f,!0),y.addEventListener("click",g,!0),y.addEventListener("contextmenu",g,!0);var w=wA(t);return w&&(w.addEventListener("mousedown",m,!0),w.addEventListener("click",_,!0),w.addEventListener("contextmenu",_,!0)),function(){y.removeEventListener("mousedown",f,!0),y.removeEventListener("click",g,!0),y.removeEventListener("contextmenu",g,!0),w&&(w.removeEventListener("mousedown",m,!0),w.removeEventListener("click",_,!0),w.removeEventListener("contextmenu",_,!0))}}},[e,t,n,o,r])}var tHe=["prefixCls","children","action","showAction","hideAction","popupVisible","defaultPopupVisible","onPopupVisibleChange","afterPopupVisibleChange","mouseEnterDelay","mouseLeaveDelay","focusDelay","blurDelay","mask","maskClosable","getPopupContainer","forceRender","autoDestroy","destroyPopupOnHide","popup","popupClassName","popupStyle","popupPlacement","builtinPlacements","popupAlign","zIndex","stretch","getPopupClassNameFromAlign","fresh","alignPoint","onPopupClick","onPopupAlign","arrow","popupMotion","maskMotion","popupTransitionName","popupAnimation","maskTransitionName","maskAnimation","className","getTriggerDOMNode"];function nHe(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:QK,e=x.exports.forwardRef(function(t,n){var o=t.prefixCls,r=o===void 0?"rc-trigger-popup":o,s=t.children,a=t.action,l=a===void 0?"hover":a,c=t.showAction,u=t.hideAction,d=t.popupVisible,h=t.defaultPopupVisible,f=t.onPopupVisibleChange,g=t.afterPopupVisibleChange,p=t.mouseEnterDelay,v=t.mouseLeaveDelay,m=v===void 0?.1:v,_=t.focusDelay,y=t.blurDelay,w=t.mask,L=t.maskClosable,D=L===void 0?!0:L,E=t.getPopupContainer,I=t.forceRender,k=t.autoDestroy,R=t.destroyPopupOnHide,A=t.popup,P=t.popupClassName,N=t.popupStyle,M=t.popupPlacement,H=t.builtinPlacements,B=H===void 0?{}:H,F=t.popupAlign,$=t.zIndex,z=t.stretch,K=t.getPopupClassNameFromAlign,j=t.fresh,G=t.alignPoint,X=t.onPopupClick,de=t.onPopupAlign,fe=t.arrow,pe=t.popupMotion,be=t.maskMotion,Se=t.popupTransitionName,Fe=t.popupAnimation,De=t.maskTransitionName,ce=t.maskAnimation,Pe=t.className,Oe=t.getTriggerDOMNode,xe=Hn(t,tHe),Ee=k||R||!1,tt=x.exports.useState(!1),nt=Ne(tt,2),Qe=nt[0],Ge=nt[1];go(function(){Ge(oq())},[]);var re=x.exports.useRef({}),ie=x.exports.useContext(Xne),se=x.exports.useMemo(function(){return{registerSubPopup:function(Xn,tr){re.current[Xn]=tr,ie==null||ie.registerSubPopup(Xn,tr)}}},[ie]),U=Gpe(),Y=x.exports.useState(null),oe=Ne(Y,2),te=oe[0],ye=oe[1],Le=tl(function(rn){mA(rn)&&te!==rn&&ye(rn),ie==null||ie.registerSubPopup(U,rn)}),Te=x.exports.useState(null),We=Ne(Te,2),je=We[0],mt=We[1],Dt=x.exports.useRef(null),At=tl(function(rn){mA(rn)&&je!==rn&&(mt(rn),Dt.current=rn)}),Je=x.exports.Children.only(s),Lt=(Je==null?void 0:Je.props)||{},Ot={},Vn=tl(function(rn){var Xn,tr,ur=je;return(ur==null?void 0:ur.contains(rn))||((Xn=wA(ur))===null||Xn===void 0?void 0:Xn.host)===rn||rn===ur||(te==null?void 0:te.contains(rn))||((tr=wA(te))===null||tr===void 0?void 0:tr.host)===rn||rn===te||Object.values(re.current).some(function(nr){return(nr==null?void 0:nr.contains(rn))||rn===nr})}),Et=Zne(r,pe,Fe,Se),tn=Zne(r,be,ce,De),ui=x.exports.useState(h||!1),cn=Ne(ui,2),qn=cn[0],bn=cn[1],Pt=d!=null?d:qn,qt=tl(function(rn){d===void 0&&bn(rn)});go(function(){bn(d||!1)},[d]);var Nt=x.exports.useRef(Pt);Nt.current=Pt;var jt=x.exports.useRef([]);jt.current=[];var Gt=tl(function(rn){var Xn;qt(rn),((Xn=jt.current[jt.current.length-1])!==null&&Xn!==void 0?Xn:Pt)!==rn&&(jt.current.push(rn),f==null||f(rn))}),It=x.exports.useRef(),Ft=function(){clearTimeout(It.current)},bt=function(Xn){var tr=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;Ft(),tr===0?Gt(Xn):It.current=setTimeout(function(){Gt(Xn)},tr*1e3)};x.exports.useEffect(function(){return Ft},[]);var Zt=x.exports.useState(!1),wn=Ne(Zt,2),Dn=wn[0],Gn=wn[1];go(function(rn){(!rn||Pt)&&Gn(!0)},[Pt]);var Un=x.exports.useState(null),Zi=Ne(Un,2),an=Zi[0],Xt=Zi[1],oi=x.exports.useState([0,0]),Ze=Ne(oi,2),ue=Ze[0],Ve=Ze[1],ot=function(Xn){Ve([Xn.clientX,Xn.clientY])},Sn=QVe(Pt,te,G?ue:je,M,B,F,de),$n=Ne(Sn,11),Ci=$n[0],An=$n[1],lo=$n[2],Qo=$n[3],zo=$n[4],oc=$n[5],Yc=$n[6],Gr=$n[7],Ua=$n[8],vl=$n[9],ba=$n[10],_l=XVe(Qe,l,c,u),rc=Ne(_l,2),Zc=rc[0],Ca=rc[1],Yu=Zc.has("click"),bl=Ca.has("click")||Ca.has("contextMenu"),mi=tl(function(){Dn||ba()}),gi=function(){Nt.current&&G&&bl&&bt(!1)};JVe(Pt,je,te,mi,gi),go(function(){mi()},[ue,M]),go(function(){Pt&&!(B!=null&&B[M])&&mi()},[JSON.stringify(F)]);var Kt=x.exports.useMemo(function(){var rn=ZVe(B,r,vl,G);return Ue(rn,K==null?void 0:K(vl))},[vl,K,B,r,G]);x.exports.useImperativeHandle(n,function(){return{nativeElement:Dt.current,forceAlign:mi}});var on=x.exports.useState(0),vi=Ne(on,2),Uo=vi[0],Qi=vi[1],Jo=x.exports.useState(0),_r=Ne(Jo,2),zs=_r[0],Tr=_r[1],us=function(){if(z&&je){var Xn=je.getBoundingClientRect();Qi(Xn.width),Tr(Xn.height)}},Ts=function(){us(),mi()},er=function(Xn){Gn(!1),ba(),g==null||g(Xn)},s_=function(){return new Promise(function(Xn){us(),Xt(function(){return Xn})})};go(function(){an&&(ba(),an(),Xt(null))},[an]);function Qc(rn,Xn,tr,ur){Ot[rn]=function(nr){var r1;ur==null||ur(nr),bt(Xn,tr);for(var VS=arguments.length,TT=new Array(VS>1?VS-1:0),s1=1;s11?tr-1:0),nr=1;nr1?tr-1:0),nr=1;nr1&&arguments[1]!==void 0?arguments[1]:{},t=e.fieldNames,n=e.childrenAsData,o=[],r=Bme(t,!1),s=r.label,a=r.value,l=r.options,c=r.groupLabel;function u(d,h){!Array.isArray(d)||d.forEach(function(f){if(h||!(l in f)){var g=f[a];o.push({key:nie(f,o.length),groupOption:h,data:f,label:f[s],value:g})}else{var p=f[c];p===void 0&&n&&(p=f.label),o.push({key:nie(f,o.length),group:!0,data:f,label:p}),u(f[l],!0)}})}return u(i,!1),o}function RW(i){var e=Ce({},i);return"props"in e||Object.defineProperty(e,"props",{get:function(){return rr(!1,"Return type is option instead of Option instance. Please read value directly instead of reading from `props`."),e}}),e}var lHe=function(e,t,n){if(!t||!t.length)return null;var o=!1,r=function a(l,c){var u=Wge(c),d=u[0],h=u.slice(1);if(!d)return[l];var f=l.split(d);return o=o||f.length>1,f.reduce(function(g,p){return[].concat(_t(g),_t(a(p,h)))},[]).filter(Boolean)},s=r(e,t);return o?typeof n!="undefined"?s.slice(0,n):s:null},rq=x.exports.createContext(null),cHe=["id","prefixCls","className","showSearch","tagRender","direction","omitDomProps","displayValues","onDisplayValuesChange","emptyOptions","notFoundContent","onClear","mode","disabled","loading","getInputElement","getRawInputElement","open","defaultOpen","onDropdownVisibleChange","activeValue","onActiveValueChange","activeDescendantId","searchValue","autoClearSearchValue","onSearch","onSearchSplit","tokenSeparators","allowClear","suffixIcon","clearIcon","OptionList","animation","transitionName","dropdownStyle","dropdownClassName","dropdownMatchSelectWidth","dropdownRender","dropdownAlign","placement","builtinPlacements","getPopupContainer","showAction","onFocus","onBlur","onKeyUp","onKeyDown","onMouseDown"],uHe=["value","onChange","removeIcon","placeholder","autoFocus","maxTagCount","maxTagTextLength","maxTagPlaceholder","choiceTransitionName","onInputKeyDown","onPopupScroll","tabIndex"],MW=function(e){return e==="tags"||e==="multiple"},dHe=x.exports.forwardRef(function(i,e){var t,n,o=i.id,r=i.prefixCls,s=i.className,a=i.showSearch,l=i.tagRender,c=i.direction,u=i.omitDomProps,d=i.displayValues,h=i.onDisplayValuesChange,f=i.emptyOptions,g=i.notFoundContent,p=g===void 0?"Not Found":g,v=i.onClear,m=i.mode,_=i.disabled,y=i.loading,w=i.getInputElement,L=i.getRawInputElement,D=i.open,E=i.defaultOpen,I=i.onDropdownVisibleChange,k=i.activeValue,R=i.onActiveValueChange,A=i.activeDescendantId,P=i.searchValue,N=i.autoClearSearchValue,M=i.onSearch,H=i.onSearchSplit,B=i.tokenSeparators,F=i.allowClear,$=i.suffixIcon,z=i.clearIcon,K=i.OptionList,j=i.animation,G=i.transitionName,X=i.dropdownStyle,de=i.dropdownClassName,fe=i.dropdownMatchSelectWidth,pe=i.dropdownRender,be=i.dropdownAlign,Se=i.placement,Fe=i.builtinPlacements,De=i.getPopupContainer,ce=i.showAction,Pe=ce===void 0?[]:ce,Oe=i.onFocus,xe=i.onBlur,Ee=i.onKeyUp,tt=i.onKeyDown,nt=i.onMouseDown,Qe=Hn(i,cHe),Ge=MW(m),re=(a!==void 0?a:Ge)||m==="combobox",ie=Ce({},Qe);uHe.forEach(function(Kt){delete ie[Kt]}),u==null||u.forEach(function(Kt){delete ie[Kt]});var se=x.exports.useState(!1),U=Ne(se,2),Y=U[0],oe=U[1];x.exports.useEffect(function(){oe(oq())},[]);var te=x.exports.useRef(null),ye=x.exports.useRef(null),Le=x.exports.useRef(null),Te=x.exports.useRef(null),We=x.exports.useRef(null),je=x.exports.useRef(!1),mt=bVe(),Dt=Ne(mt,3),At=Dt[0],Je=Dt[1],Lt=Dt[2];x.exports.useImperativeHandle(e,function(){var Kt,on;return{focus:(Kt=Te.current)===null||Kt===void 0?void 0:Kt.focus,blur:(on=Te.current)===null||on===void 0?void 0:on.blur,scrollTo:function(Uo){var Qi;return(Qi=We.current)===null||Qi===void 0?void 0:Qi.scrollTo(Uo)}}});var Ot=x.exports.useMemo(function(){var Kt;if(m!=="combobox")return P;var on=(Kt=d[0])===null||Kt===void 0?void 0:Kt.value;return typeof on=="string"||typeof on=="number"?String(on):""},[P,m,d]),Vn=m==="combobox"&&typeof w=="function"&&w()||null,Et=typeof L=="function"&&L(),tn=Mb(ye,Et==null||(t=Et.props)===null||t===void 0?void 0:t.ref),ui=x.exports.useState(!1),cn=Ne(ui,2),qn=cn[0],bn=cn[1];go(function(){bn(!0)},[]);var Pt=Kl(!1,{defaultValue:E,value:D}),qt=Ne(Pt,2),Nt=qt[0],jt=qt[1],Gt=qn?Nt:!1,It=!p&&f;(_||It&&Gt&&m==="combobox")&&(Gt=!1);var Ft=It?!1:Gt,bt=x.exports.useCallback(function(Kt){var on=Kt!==void 0?Kt:!Gt;_||(jt(on),Gt!==on&&(I==null||I(on)))},[_,Gt,jt,I]),Zt=x.exports.useMemo(function(){return(B||[]).some(function(Kt){return[` `,`\r -`].includes(Kt)})},[W]),yn=x.exports.useContext(tq)||{},Dn=yn.maxCount,Gn=yn.rawValues,Un=function(on,vi,Uo){if(!((Gn==null?void 0:Gn.size)>=Dn)){var Qi=!0,Jo=on;R==null||R(null);var vr=eHe(on,W,Dn&&Dn-Gn.size),zs=Uo?null:vr;return m!=="combobox"&&zs&&(Jo="",H==null||H(zs),bt(!1),Qi=!1),M&&Ot!==Jo&&M(Jo,{source:vi?"typing":"effect"}),Qi}},Zi=function(on){!on||!on.trim()||M(on,{source:"submit"})};x.exports.useEffect(function(){!Gt&&!Ge&&m!=="combobox"&&Un("",!1,!1)},[Gt]),x.exports.useEffect(function(){Nt&&_&&jt(!1),_&&!je.current&&Je(!1)},[_]);var an=xme(),Xt=Ne(an,2),oi=Xt[0],Ze=Xt[1],ue=function(on){var vi=oi(),Uo=on.which;if(Uo===at.ENTER&&(m!=="combobox"&&on.preventDefault(),Gt||bt(!0)),Ze(!!Ot),Uo===at.BACKSPACE&&!vi&&Ge&&!Ot&&d.length){for(var Qi=_t(d),Jo=null,vr=Qi.length-1;vr>=0;vr-=1){var zs=Qi[vr];if(!zs.disabled){Qi.splice(vr,1),Jo=zs;break}}Jo&&h(Qi,{type:"remove",values:[Jo]})}for(var Tr=arguments.length,cs=new Array(Tr>1?Tr-1:0),Is=1;Is1?vi-1:0),Qi=1;Qi1?vr-1:0),Tr=1;Tr0,X=x.exports.useMemo(function(){if(r===0||K===0)return 0;var Pe=r/K;return Pe*j},[r,K,j]),de=function(Oe){Oe.stopPropagation(),Oe.preventDefault()},he=x.exports.useRef({top:X,dragging:m,pageY:L,startTop:k});he.current={top:X,dragging:m,pageY:L,startTop:k};var pe=function(Oe){_(!0),D(Xne(Oe,u)),R(he.current.top),a(),Oe.stopPropagation(),Oe.preventDefault()};x.exports.useEffect(function(){var Pe=function(tt){tt.preventDefault()},Oe=P.current,xe=N.current;return Oe.addEventListener("touchstart",Pe),xe.addEventListener("touchstart",pe),function(){Oe.removeEventListener("touchstart",Pe),xe.removeEventListener("touchstart",pe)}},[]);var be=x.exports.useRef();be.current=K;var Se=x.exports.useRef();Se.current=j,x.exports.useEffect(function(){if(m){var Pe,Oe=function(tt){var nt=he.current,Qe=nt.dragging,Ge=nt.pageY,re=nt.startTop;if(Xi.cancel(Pe),Qe){var ie=Xne(tt,u)-Ge,se=re;!A&&u?se-=ie:se+=ie;var U=be.current,Y=Se.current,oe=Y?se/Y:0,te=Math.ceil(oe*U);te=Math.max(te,0),te=Math.min(te,U),Pe=Xi(function(){c(te,u)})}},xe=function(){_(!1),l()};return window.addEventListener("mousemove",Oe),window.addEventListener("touchmove",Oe),window.addEventListener("mouseup",xe),window.addEventListener("touchend",xe),function(){window.removeEventListener("mousemove",Oe),window.removeEventListener("touchmove",Oe),window.removeEventListener("mouseup",xe),window.removeEventListener("touchend",xe),Xi.cancel(Pe)}}},[m]),x.exports.useEffect(function(){z()},[r]),x.exports.useImperativeHandle(e,function(){return{delayHidden:z}});var Fe="".concat(n,"-scrollbar"),De={position:"absolute",visibility:W&&G?null:"hidden"},ce={position:"absolute",background:"rgba(0, 0, 0, 0.5)",borderRadius:99,cursor:"pointer",userSelect:"none"};return u?(De.height=8,De.left=0,De.right=0,De.bottom=0,ce.height="100%",ce.width=d,A?ce.left=X:ce.right=X):(De.width=8,De.top=0,De.bottom=0,A?De.right=0:De.left=0,ce.width="100%",ce.height=d,ce.top=X),x.exports.createElement("div",{ref:P,className:Ue(Fe,(t={},me(t,"".concat(Fe,"-horizontal"),u),me(t,"".concat(Fe,"-vertical"),!u),me(t,"".concat(Fe,"-visible"),W),t)),style:Ce(Ce({},De),f),onMouseDown:de,onMouseMove:z},x.exports.createElement("div",{ref:N,className:Ue("".concat(Fe,"-thumb"),me({},"".concat(Fe,"-thumb-moving"),m)),style:Ce(Ce({},ce),g),onMouseDown:pe}))});function oHe(i){var e=i.children,t=i.setRef,n=x.exports.useCallback(function(o){t(o)},[]);return x.exports.cloneElement(e,{ref:n})}function rHe(i,e,t,n,o,r,s){var a=s.getKey;return i.slice(e,t+1).map(function(l,c){var u=e+c,d=r(l,u,{style:{width:n}}),h=a(l);return x.exports.createElement(oHe,{key:h,setRef:function(g){return o(l,g)}},d)})}var sHe=function(){function i(){fa(this,i),this.maps=void 0,this.id=0,this.maps=Object.create(null)}return ga(i,[{key:"set",value:function(t,n){this.maps[t]=n,this.id+=1}},{key:"get",value:function(t){return this.maps[t]}}]),i}();function aHe(i,e,t){var n=x.exports.useState(0),o=Ne(n,2),r=o[0],s=o[1],a=x.exports.useRef(new Map),l=x.exports.useRef(new sHe),c=x.exports.useRef();function u(){Xi.cancel(c.current)}function d(){var f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;u();var g=function(){a.current.forEach(function(v,m){if(v&&v.offsetParent){var _=QL(v),w=_.offsetHeight;l.current.get(m)!==w&&l.current.set(m,_.offsetHeight)}}),s(function(v){return v+1})};f?g():c.current=Xi(g)}function h(f,g){var p=i(f),v=a.current.get(p);g?(a.current.set(p,g),d()):a.current.delete(p),!v!=!g&&(g?e==null||e(f):t==null||t(f))}return x.exports.useEffect(function(){return u},[]),[h,d,l.current,r]}var lHe=10;function cHe(i,e,t,n,o,r,s,a){var l=x.exports.useRef(),c=x.exports.useState(null),u=Ne(c,2),d=u[0],h=u[1];return go(function(){if(d&&d.times=0;M-=1){var H=o(e[M]),W=t.get(H);if(W===void 0){_=!0;break}if(N-=W,N<=0)break}switch(L){case"top":y=E-v;break;case"bottom":y=I-m+v;break;default:{var F=i.current.scrollTop,$=F+m;E$&&(w="bottom")}}y!==null&&s(y),y!==d.lastTop&&(_=!0)}_&&h(Ce(Ce({},d),{},{times:d.times+1,targetAlign:w,lastTop:y}))}},[d,i.current]),function(f){if(f==null){a();return}if(Xi.cancel(l.current),typeof f=="number")s(f);else if(f&&Kn(f)==="object"){var g,p=f.align;"index"in f?g=f.index:g=e.findIndex(function(_){return o(_)===f.key});var v=f.offset,m=v===void 0?0:v;h({times:0,index:g,offset:m,originAlign:p})}}}function uHe(i,e,t){var n=i.length,o=e.length,r,s;if(n===0&&o===0)return null;n1&&arguments[1]!==void 0?arguments[1]:!1,l=s<0&&r.current.top||s>0&&r.current.bottom;return a&&l?(clearTimeout(n.current),t.current=!1):(!l||t.current)&&o(),!t.current&&l}};function hHe(i,e,t,n,o){var r=x.exports.useRef(0),s=x.exports.useRef(null),a=x.exports.useRef(null),l=x.exports.useRef(!1),c=Mme(e,t);function u(v,m){Xi.cancel(s.current),r.current+=m,a.current=m,!c(m)&&(Zne||v.preventDefault(),s.current=Xi(function(){var _=l.current?10:1;o(r.current*_),r.current=0}))}function d(v,m){o(m,!0),Zne||v.preventDefault()}var h=x.exports.useRef(null),f=x.exports.useRef(null);function g(v){if(!!i){Xi.cancel(f.current),f.current=Xi(function(){h.current=null},2);var m=v.deltaX,_=v.deltaY,w=v.shiftKey,y=m,L=_;(h.current==="sx"||!h.current&&(w||!1)&&_&&!m)&&(y=_,L=0,h.current="sx");var D=Math.abs(y),E=Math.abs(L);h.current===null&&(h.current=n&&D>E?"x":"y"),h.current==="y"?u(v,L):d(v,y)}}function p(v){!i||(l.current=v.detail===a.current)}return[g,p]}var fHe=14/15;function gHe(i,e,t){var n=x.exports.useRef(!1),o=x.exports.useRef(0),r=x.exports.useRef(null),s=x.exports.useRef(null),a,l=function(h){if(n.current){var f=Math.ceil(h.touches[0].pageY),g=o.current-f;o.current=f,t(g)&&h.preventDefault(),clearInterval(s.current),s.current=setInterval(function(){g*=fHe,(!t(g,!0)||Math.abs(g)<=.1)&&clearInterval(s.current)},16)}},c=function(){n.current=!1,a()},u=function(h){a(),h.touches.length===1&&!n.current&&(n.current=!0,o.current=Math.ceil(h.touches[0].pageY),r.current=h.target,r.current.addEventListener("touchmove",l),r.current.addEventListener("touchend",c))};a=function(){r.current&&(r.current.removeEventListener("touchmove",l),r.current.removeEventListener("touchend",c))},go(function(){return i&&e.current.addEventListener("touchstart",u),function(){var d;(d=e.current)===null||d===void 0||d.removeEventListener("touchstart",u),a(),clearInterval(s.current)}},[i])}var pHe=20;function Qne(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,t=i/e*100;return isNaN(t)&&(t=0),t=Math.max(t,pHe),t=Math.min(t,i/2),Math.floor(t)}function mHe(i,e,t,n){var o=x.exports.useMemo(function(){return[new Map,[]]},[i,t.id,n]),r=Ne(o,2),s=r[0],a=r[1],l=function(u){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:u,h=s.get(u),f=s.get(d);if(h===void 0||f===void 0)for(var g=i.length,p=a.length;pr||!!p),A=g==="rtl",P=Ue(n,me({},"".concat(n,"-rtl"),A),o),N=u||_He,M=x.exports.useRef(),H=x.exports.useRef(),W=x.exports.useState(0),F=Ne(W,2),$=F[0],z=F[1],K=x.exports.useState(0),j=Ne(K,2),G=j[0],X=j[1],de=x.exports.useState(!1),he=Ne(de,2),pe=he[0],be=he[1],Se=function(){be(!0)},Fe=function(){be(!1)},De=x.exports.useCallback(function(Ze){return typeof h=="function"?h(Ze):Ze==null?void 0:Ze[h]},[h]),ce={getKey:De};function Pe(Ze){z(function(ue){var Ve;typeof Ze=="function"?Ve=Ze(ue):Ve=Ze;var ot=tn(Ve);return M.current.scrollTop=ot,ot})}var Oe=x.exports.useRef({start:0,end:N.length}),xe=x.exports.useRef(),Ee=dHe(N,De),tt=Ne(Ee,1),nt=tt[0];xe.current=nt;var Qe=aHe(De,null,null),Ge=Ne(Qe,4),re=Ge[0],ie=Ge[1],se=Ge[2],U=Ge[3],Y=x.exports.useMemo(function(){if(!k)return{scrollHeight:void 0,start:0,end:N.length-1,offset:void 0};if(!R){var Ze;return{scrollHeight:((Ze=H.current)===null||Ze===void 0?void 0:Ze.offsetHeight)||0,start:0,end:N.length-1,offset:void 0}}for(var ue=0,Ve,ot,Sn,$n=N.length,Ci=0;Ci<$n;Ci+=1){var An=N[Ci],lo=De(An),Qo=se.get(lo),zo=ue+(Qo===void 0?s:Qo);zo>=$&&Ve===void 0&&(Ve=Ci,ot=ue),zo>$+r&&Sn===void 0&&(Sn=Ci),ue=zo}return Ve===void 0&&(Ve=0,ot=0,Sn=Math.ceil(r/s)),Sn===void 0&&(Sn=N.length-1),Sn=Math.min(Sn+1,N.length-1),{scrollHeight:ue,start:Ve,end:Sn,offset:ot}},[R,k,$,N,U,r]),oe=Y.scrollHeight,te=Y.start,we=Y.end,Le=Y.offset;Oe.current.start=te,Oe.current.end=we;var Te=x.exports.useState({width:0,height:r}),We=Ne(Te,2),je=We[0],mt=We[1],Et=function(ue){mt({width:ue.width||ue.offsetWidth,height:ue.height||ue.offsetHeight})},At=x.exports.useRef(),Je=x.exports.useRef(),xt=x.exports.useMemo(function(){return Qne(je.width,p)},[je.width,p]),Ot=x.exports.useMemo(function(){return Qne(je.height,oe)},[je.height,oe]),Vn=oe-r,Lt=x.exports.useRef(Vn);Lt.current=Vn;function tn(Ze){var ue=Ze;return Number.isNaN(Lt.current)||(ue=Math.min(ue,Lt.current)),ue=Math.max(ue,0),ue}var ui=$<=0,cn=$>=Vn,qn=Mme(ui,cn),bn=function(){return{x:A?-G:G,y:$}},Pt=x.exports.useRef(bn()),qt=el(function(){if(w){var Ze=bn();(Pt.current.x!==Ze.x||Pt.current.y!==Ze.y)&&(w(Ze),Pt.current=Ze)}});function Nt(Ze,ue){var Ve=Ze;ue?(uf.exports.flushSync(function(){X(Ve)}),qt()):Pe(Ve)}function jt(Ze){var ue=Ze.currentTarget.scrollTop;ue!==$&&Pe(ue),_==null||_(Ze),qt()}var Gt=function(ue){var Ve=ue,ot=p-je.width;return Ve=Math.max(Ve,0),Ve=Math.min(Ve,ot),Ve},kt=el(function(Ze,ue){ue?(uf.exports.flushSync(function(){X(function(Ve){var ot=Ve+(A?-Ze:Ze);return Gt(ot)})}),qt()):Pe(function(Ve){var ot=Ve+Ze;return ot})}),Ft=hHe(k,ui,cn,!!p,kt),bt=Ne(Ft,2),Zt=bt[0],yn=bt[1];gHe(k,M,function(Ze,ue){return qn(Ze,ue)?!1:(Zt({preventDefault:function(){},deltaY:Ze}),!0)}),go(function(){function Ze(Ve){k&&Ve.preventDefault()}var ue=M.current;return ue.addEventListener("wheel",Zt),ue.addEventListener("DOMMouseScroll",yn),ue.addEventListener("MozMousePixelScroll",Ze),function(){ue.removeEventListener("wheel",Zt),ue.removeEventListener("DOMMouseScroll",yn),ue.removeEventListener("MozMousePixelScroll",Ze)}},[k]),go(function(){p&&X(function(Ze){return Gt(Ze)})},[je.width,p]);var Dn=function(){var ue,Ve;(ue=At.current)===null||ue===void 0||ue.delayHidden(),(Ve=Je.current)===null||Ve===void 0||Ve.delayHidden()},Gn=cHe(M,N,se,s,De,function(){return ie(!0)},Pe,Dn);x.exports.useImperativeHandle(e,function(){return{getScrollInfo:bn,scrollTo:function(ue){function Ve(ot){return ot&&Kn(ot)==="object"&&("left"in ot||"top"in ot)}Ve(ue)?(ue.left!==void 0&&X(Gt(ue.left)),Gn(ue.top)):Gn(ue)}}}),go(function(){if(y){var Ze=N.slice(te,we+1);y(Ze,N)}},[te,we,N]);var Un=mHe(N,De,se,s),Zi=D==null?void 0:D({start:te,end:we,virtual:R,offsetX:G,offsetY:Le,rtl:A,getSize:Un}),an=rHe(N,te,we,p,re,d,ce),Xt=null;r&&(Xt=Ce(me({},l?"height":"maxHeight",r),bHe),k&&(Xt.overflowY="hidden",p&&(Xt.overflowX="hidden"),pe&&(Xt.pointerEvents="none")));var oi={};return A&&(oi.dir="rtl"),x.exports.createElement("div",Ct({style:Ce(Ce({},c),{},{position:"relative"}),className:P},oi,I),x.exports.createElement(Md,{onResize:Et},x.exports.createElement(m,{className:"".concat(n,"-holder"),style:Xt,ref:M,onScroll:jt,onMouseEnter:Dn},x.exports.createElement(Rme,{prefixCls:n,height:oe,offsetX:G,offsetY:Le,scrollWidth:p,onInnerResize:ie,ref:H,innerProps:L,rtl:A,extra:Zi},an))),R&&oe>r&&x.exports.createElement(Yne,{ref:At,prefixCls:n,scrollOffset:$,scrollRange:oe,rtl:A,onScroll:Nt,onStartMove:Se,onStopMove:Fe,spinSize:Ot,containerSize:je.height,style:E==null?void 0:E.verticalScrollBar,thumbStyle:E==null?void 0:E.verticalScrollBarThumb}),R&&p&&x.exports.createElement(Yne,{ref:Je,prefixCls:n,scrollOffset:G,scrollRange:p,rtl:A,onScroll:Nt,onStartMove:Se,onStopMove:Fe,spinSize:xt,containerSize:je.width,horizontal:!0,style:E==null?void 0:E.horizontalScrollBar,thumbStyle:E==null?void 0:E.horizontalScrollBarThumb}))}var oq=x.exports.forwardRef(CHe);oq.displayName="List";function wHe(){return/(mac\sos|macintosh)/i.test(navigator.appVersion)}var yHe=["disabled","title","children","style","className"];function Jne(i){return typeof i=="string"||typeof i=="number"}var SHe=function(e,t){var n=uVe(),o=n.prefixCls,r=n.id,s=n.open,a=n.multiple,l=n.mode,c=n.searchValue,u=n.toggleOpen,d=n.notFoundContent,h=n.onPopupScroll,f=x.exports.useContext(tq),g=f.maxCount,p=f.flattenOptions,v=f.onActiveValue,m=f.defaultActiveFirstOption,_=f.onSelect,w=f.menuItemSelectedIcon,y=f.rawValues,L=f.fieldNames,D=f.virtual,E=f.direction,I=f.listHeight,k=f.listItemHeight,R=f.optionRender,A="".concat(o,"-item"),P=wI(function(){return p},[s,p],function(De,ce){return ce[0]&&De[1]!==ce[1]}),N=x.exports.useRef(null),M=x.exports.useMemo(function(){return a&&typeof g!="undefined"&&(y==null?void 0:y.size)>=g},[a,g,y==null?void 0:y.size]),H=function(ce){ce.preventDefault()},W=function(ce){var Pe;(Pe=N.current)===null||Pe===void 0||Pe.scrollTo(typeof ce=="number"?{index:ce}:ce)},F=function(ce){for(var Pe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,Oe=P.length,xe=0;xe1&&arguments[1]!==void 0?arguments[1]:!1;j(ce);var Oe={source:Pe?"keyboard":"mouse"},xe=P[ce];if(!xe){v(null,-1,Oe);return}v(xe.value,ce,Oe)};x.exports.useEffect(function(){G(m!==!1?F(0):-1)},[P.length,c]);var X=x.exports.useCallback(function(De){return y.has(De)&&l!=="combobox"},[l,_t(y).toString(),y.size]);x.exports.useEffect(function(){var De=setTimeout(function(){if(!a&&s&&y.size===1){var Pe=Array.from(y)[0],Oe=P.findIndex(function(xe){var Ee=xe.data;return Ee.value===Pe});Oe!==-1&&(G(Oe),W(Oe))}});if(s){var ce;(ce=N.current)===null||ce===void 0||ce.scrollTo(void 0)}return function(){return clearTimeout(De)}},[s,c]);var de=function(ce){ce!==void 0&&_(ce,{selected:!y.has(ce)}),a||u(!1)};if(x.exports.useImperativeHandle(t,function(){return{onKeyDown:function(ce){var Pe=ce.which,Oe=ce.ctrlKey;switch(Pe){case at.N:case at.P:case at.UP:case at.DOWN:{var xe=0;if(Pe===at.UP?xe=-1:Pe===at.DOWN?xe=1:wHe()&&Oe&&(Pe===at.N?xe=1:Pe===at.P&&(xe=-1)),xe!==0){var Ee=F(K+xe,xe);W(Ee),G(Ee,!0)}break}case at.ENTER:{var tt,nt=P[K];nt&&!(nt!=null&&(tt=nt.data)!==null&&tt!==void 0&&tt.disabled)&&!M?de(nt.value):de(void 0),s&&ce.preventDefault();break}case at.ESC:u(!1),s&&ce.stopPropagation()}},onKeyUp:function(){},scrollTo:function(ce){W(ce)}}}),P.length===0)return x.exports.createElement("div",{role:"listbox",id:"".concat(r,"_list"),className:"".concat(A,"-empty"),onMouseDown:H},d);var he=Object.keys(L).map(function(De){return L[De]}),pe=function(ce){return ce.label};function be(De,ce){var Pe=De.group;return{role:Pe?"presentation":"option",id:"".concat(r,"_list_").concat(ce)}}var Se=function(ce){var Pe=P[ce];if(!Pe)return null;var Oe=Pe.data||{},xe=Oe.value,Ee=Pe.group,tt=z0(Oe,!0),nt=pe(Pe);return Pe?x.exports.createElement("div",Ct({"aria-label":typeof nt=="string"&&!Ee?nt:null},tt,{key:ce},be(Pe,ce),{"aria-selected":X(xe)}),xe):null},Fe={role:"listbox",id:"".concat(r,"_list")};return x.exports.createElement(x.exports.Fragment,null,D&&x.exports.createElement("div",Ct({},Fe,{style:{height:0,width:0,overflow:"hidden"}}),Se(K-1),Se(K),Se(K+1)),x.exports.createElement(oq,{itemKey:"key",ref:N,data:P,height:I,itemHeight:k,fullHeight:!1,onMouseDown:H,onScroll:h,virtual:D,direction:E,innerProps:D?null:Fe},function(De,ce){var Pe,Oe=De.group,xe=De.groupOption,Ee=De.data,tt=De.label,nt=De.value,Qe=Ee.key;if(Oe){var Ge,re=(Ge=Ee.title)!==null&&Ge!==void 0?Ge:Jne(tt)?tt.toString():void 0;return x.exports.createElement("div",{className:Ue(A,"".concat(A,"-group")),title:re},tt!==void 0?tt:Qe)}var ie=Ee.disabled,se=Ee.title;Ee.children;var U=Ee.style,Y=Ee.className,oe=Hn(Ee,yHe),te=Df(oe,he),we=X(nt),Le=ie||!we&&M,Te="".concat(A,"-option"),We=Ue(A,Te,Y,(Pe={},me(Pe,"".concat(Te,"-grouped"),xe),me(Pe,"".concat(Te,"-active"),K===ce&&!Le),me(Pe,"".concat(Te,"-disabled"),Le),me(Pe,"".concat(Te,"-selected"),we),Pe)),je=pe(De),mt=!w||typeof w=="function"||we,Et=typeof je=="number"?je:je||nt,At=Jne(Et)?Et.toString():void 0;return se!==void 0&&(At=se),x.exports.createElement("div",Ct({},z0(te),D?{}:be(De,ce),{"aria-selected":we,className:We,title:At,onMouseMove:function(){K===ce||Le||G(ce)},onClick:function(){Le||de(nt)},style:U}),x.exports.createElement("div",{className:"".concat(Te,"-content")},typeof R=="function"?R(De,{index:ce}):Et),x.exports.isValidElement(w)||we,mt&&x.exports.createElement(T4,{className:"".concat(A,"-option-state"),customizeIcon:w,customizeIconProps:{value:nt,disabled:Le,isSelected:we}},we?"\u2713":null))}))},xHe=x.exports.forwardRef(SHe),LHe=function(i,e){var t=x.exports.useRef({values:new Map,options:new Map}),n=x.exports.useMemo(function(){var r=t.current,s=r.values,a=r.options,l=i.map(function(d){if(d.label===void 0){var h;return Ce(Ce({},d),{},{label:(h=s.get(d.value))===null||h===void 0?void 0:h.label})}return d}),c=new Map,u=new Map;return l.forEach(function(d){c.set(d.value,d),u.set(d.value,e.get(d.value)||a.get(d.value))}),t.current.values=c,t.current.options=u,l},[i,e]),o=x.exports.useCallback(function(r){return e.get(r)||t.current.options.get(r)},[e]);return[n,o]};function g6(i,e){return Ime(i).join("").toUpperCase().includes(e)}var EHe=function(i,e,t,n,o){return x.exports.useMemo(function(){if(!t||n===!1)return i;var r=e.options,s=e.label,a=e.value,l=[],c=typeof n=="function",u=t.toUpperCase(),d=c?n:function(f,g){return o?g6(g[o],u):g[r]?g6(g[s!=="children"?s:"label"],u):g6(g[a],u)},h=c?function(f){return IW(f)}:function(f){return f};return i.forEach(function(f){if(f[r]){var g=d(t,h(f));if(g)l.push(f);else{var p=f[r].filter(function(v){return d(t,h(v))});p.length&&l.push(Ce(Ce({},f),{},me({},r,p)))}return}d(t,h(f))&&l.push(f)}),l},[i,n,o,t,e])},eie=0,DHe=Oa();function kHe(){var i;return DHe?(i=eie,eie+=1):i="TEST_OR_SSR",i}function IHe(i){var e=x.exports.useState(),t=Ne(e,2),n=t[0],o=t[1];return x.exports.useEffect(function(){o("rc_select_".concat(kHe()))},[]),i||n}var THe=["children","value"],NHe=["children"];function RHe(i){var e=i,t=e.key,n=e.props,o=n.children,r=n.value,s=Hn(n,THe);return Ce({key:t,value:r!==void 0?r:t,children:o},s)}function Ame(i){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return np(i).map(function(t,n){if(!x.exports.isValidElement(t)||!t.type)return null;var o=t,r=o.type.isSelectOptGroup,s=o.key,a=o.props,l=a.children,c=Hn(a,NHe);return e||!r?RHe(t):Ce(Ce({key:"__RC_SELECT_GRP__".concat(s===null?n:s,"__"),label:s},c),{},{options:Ame(l)})}).filter(function(t){return t})}var MHe=function(e,t,n,o,r){return x.exports.useMemo(function(){var s=e,a=!e;a&&(s=Ame(t));var l=new Map,c=new Map,u=function(f,g,p){p&&typeof p=="string"&&f.set(g[p],g)},d=function h(f){for(var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,p=0;p2&&arguments[2]!==void 0?arguments[2]:{},Zt=bt.source,yn=Zt===void 0?"keyboard":Zt;ui(Ft),s&&n==="combobox"&&kt!==null&&yn==="keyboard"&&Ot(String(kt))},[s,n]),bn=function(Ft,bt,Zt){var yn=function(){var Ve,ot=Y(Ft);return[$?{label:ot==null?void 0:ot[pe.label],value:Ft,key:(Ve=ot==null?void 0:ot.key)!==null&&Ve!==void 0?Ve:Ft}:Ft,IW(ot)]};if(bt&&f){var Dn=yn(),Gn=Ne(Dn,2),Un=Gn[0],Zi=Gn[1];f(Un,Zi)}else if(!bt&&g&&Zt!=="clear"){var an=yn(),Xt=Ne(an,2),oi=Xt[0],Ze=Xt[1];g(oi,Ze)}},Pt=tie(function(kt,Ft){var bt,Zt=X?Ft.selected:!0;Zt?bt=X?[].concat(_t(U),[kt]):[kt]:bt=U.filter(function(yn){return yn.value!==kt}),Et(bt),bn(kt,Zt),n==="combobox"?Ot(""):(!TW||h)&&(De(""),Ot(""))}),qt=function(Ft,bt){Et(Ft);var Zt=bt.type,yn=bt.values;(Zt==="remove"||Zt==="clear")&&yn.forEach(function(Dn){bn(Dn.value,!1,Zt)})},Nt=function(Ft,bt){if(De(Ft),Ot(null),bt.source==="submit"){var Zt=(Ft||"").trim();if(Zt){var yn=Array.from(new Set([].concat(_t(te),[Zt])));Et(yn),bn(Zt,!0),De("")}return}bt.source!=="blur"&&(n==="combobox"&&Et(Ft),u==null||u(Ft))},jt=function(Ft){var bt=Ft;n!=="tags"&&(bt=Ft.map(function(yn){var Dn=Oe.get(yn);return Dn==null?void 0:Dn.value}).filter(function(yn){return yn!==void 0}));var Zt=Array.from(new Set([].concat(_t(te),_t(bt))));Et(Zt),Zt.forEach(function(yn){bn(yn,!0)})},Gt=x.exports.useMemo(function(){var kt=R!==!1&&v!==!1;return Ce(Ce({},ce),{},{flattenOptions:mt,onActiveValue:qn,defaultActiveFirstOption:cn,onSelect:Pt,menuItemSelectedIcon:k,rawValues:te,fieldNames:pe,virtual:kt,direction:A,listHeight:N,listItemHeight:H,childrenAsData:de,maxCount:K,optionRender:D})},[K,ce,mt,qn,cn,Pt,k,te,pe,R,v,A,N,H,de,D]);return x.exports.createElement(tq.Provider,{value:Gt},x.exports.createElement(iHe,Ct({},j,{id:G,prefixCls:r,ref:e,omitDomProps:PHe,mode:n,displayValues:oe,onDisplayValuesChange:qt,direction:A,searchValue:Fe,onSearch:Nt,autoClearSearchValue:h,onSearchSplit:jt,dropdownMatchSelectWidth:v,OptionList:xHe,emptyOptions:!mt.length,activeValue:xt,activeDescendantId:"".concat(G,"_list_").concat(tn)})))}),rq=FHe;rq.Option=iq;rq.OptGroup=nq;function LA(i,e,t){return Ue({[`${i}-status-success`]:e==="success",[`${i}-status-warning`]:e==="warning",[`${i}-status-error`]:e==="error",[`${i}-status-validating`]:e==="validating",[`${i}-has-feedback`]:t})}const sq=(i,e)=>e||i,BHe=()=>{const[,i]=Fa(),t=new ta(i.colorBgBase).toHsl().l<.5?{opacity:.65}:{};return x.exports.createElement("svg",{style:t,width:"184",height:"152",viewBox:"0 0 184 152",xmlns:"http://www.w3.org/2000/svg"},x.exports.createElement("g",{fill:"none",fillRule:"evenodd"},x.exports.createElement("g",{transform:"translate(24 31.67)"},x.exports.createElement("ellipse",{fillOpacity:".8",fill:"#F5F5F7",cx:"67.797",cy:"106.89",rx:"67.797",ry:"12.668"}),x.exports.createElement("path",{d:"M122.034 69.674L98.109 40.229c-1.148-1.386-2.826-2.225-4.593-2.225h-51.44c-1.766 0-3.444.839-4.592 2.225L13.56 69.674v15.383h108.475V69.674z",fill:"#AEB8C2"}),x.exports.createElement("path",{d:"M101.537 86.214L80.63 61.102c-1.001-1.207-2.507-1.867-4.048-1.867H31.724c-1.54 0-3.047.66-4.048 1.867L6.769 86.214v13.792h94.768V86.214z",fill:"url(#linearGradient-1)",transform:"translate(13.56)"}),x.exports.createElement("path",{d:"M33.83 0h67.933a4 4 0 0 1 4 4v93.344a4 4 0 0 1-4 4H33.83a4 4 0 0 1-4-4V4a4 4 0 0 1 4-4z",fill:"#F5F5F7"}),x.exports.createElement("path",{d:"M42.678 9.953h50.237a2 2 0 0 1 2 2V36.91a2 2 0 0 1-2 2H42.678a2 2 0 0 1-2-2V11.953a2 2 0 0 1 2-2zM42.94 49.767h49.713a2.262 2.262 0 1 1 0 4.524H42.94a2.262 2.262 0 0 1 0-4.524zM42.94 61.53h49.713a2.262 2.262 0 1 1 0 4.525H42.94a2.262 2.262 0 0 1 0-4.525zM121.813 105.032c-.775 3.071-3.497 5.36-6.735 5.36H20.515c-3.238 0-5.96-2.29-6.734-5.36a7.309 7.309 0 0 1-.222-1.79V69.675h26.318c2.907 0 5.25 2.448 5.25 5.42v.04c0 2.971 2.37 5.37 5.277 5.37h34.785c2.907 0 5.277-2.421 5.277-5.393V75.1c0-2.972 2.343-5.426 5.25-5.426h26.318v33.569c0 .617-.077 1.216-.221 1.789z",fill:"#DCE0E6"})),x.exports.createElement("path",{d:"M149.121 33.292l-6.83 2.65a1 1 0 0 1-1.317-1.23l1.937-6.207c-2.589-2.944-4.109-6.534-4.109-10.408C138.802 8.102 148.92 0 161.402 0 173.881 0 184 8.102 184 18.097c0 9.995-10.118 18.097-22.599 18.097-4.528 0-8.744-1.066-12.28-2.902z",fill:"#DCE0E6"}),x.exports.createElement("g",{transform:"translate(149.65 15.383)",fill:"#FFF"},x.exports.createElement("ellipse",{cx:"20.654",cy:"3.167",rx:"2.849",ry:"2.815"}),x.exports.createElement("path",{d:"M5.698 5.63H0L2.898.704zM9.259.704h4.985V5.63H9.259z"}))))};var WHe=BHe;const VHe=()=>{const[,i]=Fa(),{colorFill:e,colorFillTertiary:t,colorFillQuaternary:n,colorBgContainer:o}=i,{borderColor:r,shadowColor:s,contentColor:a}=x.exports.useMemo(()=>({borderColor:new ta(e).onBackground(o).toHexShortString(),shadowColor:new ta(t).onBackground(o).toHexShortString(),contentColor:new ta(n).onBackground(o).toHexShortString()}),[e,t,n,o]);return x.exports.createElement("svg",{width:"64",height:"41",viewBox:"0 0 64 41",xmlns:"http://www.w3.org/2000/svg"},x.exports.createElement("g",{transform:"translate(0 1)",fill:"none",fillRule:"evenodd"},x.exports.createElement("ellipse",{fill:s,cx:"32",cy:"33",rx:"32",ry:"7"}),x.exports.createElement("g",{fillRule:"nonzero",stroke:r},x.exports.createElement("path",{d:"M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z"}),x.exports.createElement("path",{d:"M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z",fill:a}))))};var HHe=VHe;const $He=i=>{const{componentCls:e,margin:t,marginXS:n,marginXL:o,fontSize:r,lineHeight:s}=i;return{[e]:{marginInline:n,fontSize:r,lineHeight:s,textAlign:"center",[`${e}-image`]:{height:i.emptyImgHeight,marginBottom:n,opacity:i.opacityImage,img:{height:"100%"},svg:{maxWidth:"100%",height:"100%",margin:"auto"}},[`${e}-description`]:{color:i.colorText},[`${e}-footer`]:{marginTop:t},"&-normal":{marginBlock:o,color:i.colorTextDisabled,[`${e}-description`]:{color:i.colorTextDisabled},[`${e}-image`]:{height:i.emptyImgHeightMD}},"&-small":{marginBlock:n,color:i.colorTextDisabled,[`${e}-image`]:{height:i.emptyImgHeightSM}}}}};var zHe=Uc("Empty",i=>{const{componentCls:e,controlHeightLG:t,calc:n}=i,o=lr(i,{emptyImgCls:`${e}-img`,emptyImgHeight:n(t).mul(2.5).equal(),emptyImgHeightMD:t,emptyImgHeightSM:n(t).mul(.875).equal()});return[$He(o)]}),UHe=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(i);o{var{className:e,rootClassName:t,prefixCls:n,image:o=Pme,description:r,children:s,imageStyle:a,style:l}=i,c=UHe(i,["className","rootClassName","prefixCls","image","description","children","imageStyle","style"]);const{getPrefixCls:u,direction:d,empty:h}=x.exports.useContext(Hi),f=u("empty",n),[g,p,v]=zHe(f),[m]=yI("Empty"),_=typeof r!="undefined"?r:m==null?void 0:m.description,w=typeof _=="string"?_:"empty";let y=null;return typeof o=="string"?y=x.exports.createElement("img",{alt:w,src:o}):y=o,g(x.exports.createElement("div",Object.assign({className:Ue(p,v,f,h==null?void 0:h.className,{[`${f}-normal`]:o===Ome,[`${f}-rtl`]:d==="rtl"},e,t),style:Object.assign(Object.assign({},h==null?void 0:h.style),l)},c),x.exports.createElement("div",{className:`${f}-image`,style:a},y),_&&x.exports.createElement("div",{className:`${f}-description`},_),s&&x.exports.createElement("div",{className:`${f}-footer`},s)))};aq.PRESENTED_IMAGE_DEFAULT=Pme;aq.PRESENTED_IMAGE_SIMPLE=Ome;var xx=aq;const jHe=i=>{const{componentName:e}=i,{getPrefixCls:t}=x.exports.useContext(Hi),n=t("empty");switch(e){case"Table":case"List":return fe(xx,{image:xx.PRESENTED_IMAGE_SIMPLE});case"Select":case"TreeSelect":case"Cascader":case"Transfer":case"Mentions":return fe(xx,{image:xx.PRESENTED_IMAGE_SIMPLE,className:`${n}-small`});default:return fe(xx,{})}};var KHe=jHe;const qHe=["outlined","borderless","filled"],GHe=function(i){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0;const t=x.exports.useContext(eme);let n;typeof i!="undefined"?n=i:e===!1?n="borderless":n=t!=null?t:"outlined";const o=qHe.includes(n);return[n,o]};var lq=GHe;const XHe=i=>{const t={overflow:{adjustX:!0,adjustY:!0,shiftY:!0},htmlRegion:i==="scroll"?"scroll":"visible",dynamicInset:!0};return{bottomLeft:Object.assign(Object.assign({},t),{points:["tl","bl"],offset:[0,4]}),bottomRight:Object.assign(Object.assign({},t),{points:["tr","br"],offset:[0,4]}),topLeft:Object.assign(Object.assign({},t),{points:["bl","tl"],offset:[0,-4]}),topRight:Object.assign(Object.assign({},t),{points:["br","tr"],offset:[0,-4]})}};function YHe(i,e){return i||XHe(e)}const ZHe=i=>{const{optionHeight:e,optionFontSize:t,optionLineHeight:n,optionPadding:o}=i;return{position:"relative",display:"block",minHeight:e,padding:o,color:i.colorText,fontWeight:"normal",fontSize:t,lineHeight:n,boxSizing:"border-box"}},QHe=i=>{const{antCls:e,componentCls:t}=i,n=`${t}-item`,o=`&${e}-slide-up-enter${e}-slide-up-enter-active`,r=`&${e}-slide-up-appear${e}-slide-up-appear-active`,s=`&${e}-slide-up-leave${e}-slide-up-leave-active`,a=`${t}-dropdown-placement-`;return[{[`${t}-dropdown`]:Object.assign(Object.assign({},Aa(i)),{position:"absolute",top:-9999,zIndex:i.zIndexPopup,boxSizing:"border-box",padding:i.paddingXXS,overflow:"hidden",fontSize:i.fontSize,fontVariant:"initial",backgroundColor:i.colorBgElevated,borderRadius:i.borderRadiusLG,outline:"none",boxShadow:i.boxShadowSecondary,[` +`].includes(Kt)})},[B]),wn=x.exports.useContext(rq)||{},Dn=wn.maxCount,Gn=wn.rawValues,Un=function(on,vi,Uo){if(!((Gn==null?void 0:Gn.size)>=Dn)){var Qi=!0,Jo=on;R==null||R(null);var _r=lHe(on,B,Dn&&Dn-Gn.size),zs=Uo?null:_r;return m!=="combobox"&&zs&&(Jo="",H==null||H(zs),bt(!1),Qi=!1),M&&Ot!==Jo&&M(Jo,{source:vi?"typing":"effect"}),Qi}},Zi=function(on){!on||!on.trim()||M(on,{source:"submit"})};x.exports.useEffect(function(){!Gt&&!Ge&&m!=="combobox"&&Un("",!1,!1)},[Gt]),x.exports.useEffect(function(){Nt&&_&&jt(!1),_&&!je.current&&Je(!1)},[_]);var an=Nme(),Xt=Ne(an,2),oi=Xt[0],Ze=Xt[1],ue=function(on){var vi=oi(),Uo=on.which;if(Uo===at.ENTER&&(m!=="combobox"&&on.preventDefault(),Gt||bt(!0)),Ze(!!Ot),Uo===at.BACKSPACE&&!vi&&Ge&&!Ot&&d.length){for(var Qi=_t(d),Jo=null,_r=Qi.length-1;_r>=0;_r-=1){var zs=Qi[_r];if(!zs.disabled){Qi.splice(_r,1),Jo=zs;break}}Jo&&h(Qi,{type:"remove",values:[Jo]})}for(var Tr=arguments.length,us=new Array(Tr>1?Tr-1:0),Ts=1;Ts1?vi-1:0),Qi=1;Qi1?_r-1:0),Tr=1;Tr<_r;Tr++)zs[Tr-1]=arguments[Tr];nt==null||nt.apply(void 0,[on].concat(zs))},Qo=x.exports.useState({}),zo=Ne(Qo,2),oc=zo[1];function Yc(){oc({})}var Gr;Et&&(Gr=function(on){bt(on)}),CVe(function(){var Kt;return[te.current,(Kt=Le.current)===null||Kt===void 0?void 0:Kt.getPopupElement()]},Ft,bt,!!Et);var Ua=x.exports.useMemo(function(){return Ce(Ce({},i),{},{notFoundContent:p,open:Gt,triggerOpen:Ft,id:o,showSearch:re,multiple:Ge,toggleOpen:bt})},[i,p,Ft,Gt,o,re,Ge,bt]),vl=!!$||y,ba;vl&&(ba=x.exports.createElement(N4,{className:Ue("".concat(r,"-arrow"),me({},"".concat(r,"-arrow-loading"),y)),customizeIcon:$,customizeIconProps:{loading:y,searchValue:Ot,open:Gt,focused:At,showSearch:re}}));var _l=function(){var on;v==null||v(),(on=Te.current)===null||on===void 0||on.focus(),h([],{type:"clear",values:d}),Un("",!1,!1)},rc=vVe(r,_l,d,F,z,_,Ot,m),Zc=rc.allowClear,Ca=rc.clearIcon,Yu=x.exports.createElement(K,{ref:We}),bl=Ue(r,s,(n={},me(n,"".concat(r,"-focused"),At),me(n,"".concat(r,"-multiple"),Ge),me(n,"".concat(r,"-single"),!Ge),me(n,"".concat(r,"-allow-clear"),F),me(n,"".concat(r,"-show-arrow"),vl),me(n,"".concat(r,"-disabled"),_),me(n,"".concat(r,"-loading"),y),me(n,"".concat(r,"-open"),Gt),me(n,"".concat(r,"-customize-input"),Vn),me(n,"".concat(r,"-show-search"),re),n)),mi=x.exports.createElement(sHe,{ref:Le,disabled:_,prefixCls:r,visible:Ft,popupElement:Yu,animation:j,transitionName:G,dropdownStyle:X,dropdownClassName:de,direction:c,dropdownMatchSelectWidth:fe,dropdownRender:pe,dropdownAlign:be,placement:Se,builtinPlacements:Fe,getPopupContainer:De,empty:f,getTriggerDOMNode:function(){return ye.current},onPopupVisibleChange:Gr,onPopupMouseEnter:Yc},Et?x.exports.cloneElement(Et,{ref:tn}):x.exports.createElement(zVe,yt({},i,{domRef:ye,prefixCls:r,inputElement:Vn,ref:Te,id:o,showSearch:re,autoClearSearchValue:N,mode:m,activeDescendantId:A,tagRender:l,values:d,open:Gt,onToggleOpen:bt,activeValue:k,searchValue:Ot,onSearch:Un,onSearchSubmit:Zi,onRemove:ot,tokenWithEnter:Zt}))),gi;return Et?gi=mi:gi=x.exports.createElement("div",yt({className:bl},ie,{ref:te,onMouseDown:lo,onKeyDown:ue,onKeyUp:Ve,onFocus:$n,onBlur:Ci}),At&&!Gt&&x.exports.createElement("span",{"aria-live":"polite",style:{width:0,height:0,position:"absolute",overflow:"hidden",opacity:0}},"".concat(d.map(function(Kt){var on=Kt.label,vi=Kt.value;return["number","string"].includes(Kn(on))?on:vi}).join(", "))),mi,ba,Zc&&Ca),x.exports.createElement(Tme.Provider,{value:Ua},gi)}),sq=function(){return null};sq.isSelectOptGroup=!0;var aq=function(){return null};aq.isSelectOption=!0;var Wme=x.exports.forwardRef(function(i,e){var t=i.height,n=i.offsetY,o=i.offsetX,r=i.children,s=i.prefixCls,a=i.onInnerResize,l=i.innerProps,c=i.rtl,u=i.extra,d={},h={display:"flex",flexDirection:"column"};if(n!==void 0){var f;d={height:t,position:"relative",overflow:"hidden"},h=Ce(Ce({},h),{},(f={transform:"translateY(".concat(n,"px)")},me(f,c?"marginRight":"marginLeft",-o),me(f,"position","absolute"),me(f,"left",0),me(f,"right",0),me(f,"top",0),f))}return x.exports.createElement("div",{style:d},x.exports.createElement(Md,{onResize:function(p){var v=p.offsetHeight;v&&a&&a()}},x.exports.createElement("div",yt({style:h,className:Ue(me({},"".concat(s,"-holder-inner"),s)),ref:e},l),r,u)))});Wme.displayName="Filler";function iie(i,e){var t="touches"in i?i.touches[0]:i;return t[e?"pageX":"pageY"]}var oie=x.exports.forwardRef(function(i,e){var t,n=i.prefixCls,o=i.rtl,r=i.scrollOffset,s=i.scrollRange,a=i.onStartMove,l=i.onStopMove,c=i.onScroll,u=i.horizontal,d=i.spinSize,h=i.containerSize,f=i.style,g=i.thumbStyle,p=x.exports.useState(!1),v=Ne(p,2),m=v[0],_=v[1],y=x.exports.useState(null),w=Ne(y,2),L=w[0],D=w[1],E=x.exports.useState(null),I=Ne(E,2),k=I[0],R=I[1],A=!o,P=x.exports.useRef(),N=x.exports.useRef(),M=x.exports.useState(!1),H=Ne(M,2),B=H[0],F=H[1],$=x.exports.useRef(),z=function(){clearTimeout($.current),F(!0),$.current=setTimeout(function(){F(!1)},3e3)},K=s-h||0,j=h-d||0,G=K>0,X=x.exports.useMemo(function(){if(r===0||K===0)return 0;var Pe=r/K;return Pe*j},[r,K,j]),de=function(Oe){Oe.stopPropagation(),Oe.preventDefault()},fe=x.exports.useRef({top:X,dragging:m,pageY:L,startTop:k});fe.current={top:X,dragging:m,pageY:L,startTop:k};var pe=function(Oe){_(!0),D(iie(Oe,u)),R(fe.current.top),a(),Oe.stopPropagation(),Oe.preventDefault()};x.exports.useEffect(function(){var Pe=function(tt){tt.preventDefault()},Oe=P.current,xe=N.current;return Oe.addEventListener("touchstart",Pe),xe.addEventListener("touchstart",pe),function(){Oe.removeEventListener("touchstart",Pe),xe.removeEventListener("touchstart",pe)}},[]);var be=x.exports.useRef();be.current=K;var Se=x.exports.useRef();Se.current=j,x.exports.useEffect(function(){if(m){var Pe,Oe=function(tt){var nt=fe.current,Qe=nt.dragging,Ge=nt.pageY,re=nt.startTop;if(Xi.cancel(Pe),Qe){var ie=iie(tt,u)-Ge,se=re;!A&&u?se-=ie:se+=ie;var U=be.current,Y=Se.current,oe=Y?se/Y:0,te=Math.ceil(oe*U);te=Math.max(te,0),te=Math.min(te,U),Pe=Xi(function(){c(te,u)})}},xe=function(){_(!1),l()};return window.addEventListener("mousemove",Oe),window.addEventListener("touchmove",Oe),window.addEventListener("mouseup",xe),window.addEventListener("touchend",xe),function(){window.removeEventListener("mousemove",Oe),window.removeEventListener("touchmove",Oe),window.removeEventListener("mouseup",xe),window.removeEventListener("touchend",xe),Xi.cancel(Pe)}}},[m]),x.exports.useEffect(function(){z()},[r]),x.exports.useImperativeHandle(e,function(){return{delayHidden:z}});var Fe="".concat(n,"-scrollbar"),De={position:"absolute",visibility:B&&G?null:"hidden"},ce={position:"absolute",background:"rgba(0, 0, 0, 0.5)",borderRadius:99,cursor:"pointer",userSelect:"none"};return u?(De.height=8,De.left=0,De.right=0,De.bottom=0,ce.height="100%",ce.width=d,A?ce.left=X:ce.right=X):(De.width=8,De.top=0,De.bottom=0,A?De.right=0:De.left=0,ce.width="100%",ce.height=d,ce.top=X),x.exports.createElement("div",{ref:P,className:Ue(Fe,(t={},me(t,"".concat(Fe,"-horizontal"),u),me(t,"".concat(Fe,"-vertical"),!u),me(t,"".concat(Fe,"-visible"),B),t)),style:Ce(Ce({},De),f),onMouseDown:de,onMouseMove:z},x.exports.createElement("div",{ref:N,className:Ue("".concat(Fe,"-thumb"),me({},"".concat(Fe,"-thumb-moving"),m)),style:Ce(Ce({},ce),g),onMouseDown:pe}))});function hHe(i){var e=i.children,t=i.setRef,n=x.exports.useCallback(function(o){t(o)},[]);return x.exports.cloneElement(e,{ref:n})}function fHe(i,e,t,n,o,r,s){var a=s.getKey;return i.slice(e,t+1).map(function(l,c){var u=e+c,d=r(l,u,{style:{width:n}}),h=a(l);return x.exports.createElement(hHe,{key:h,setRef:function(g){return o(l,g)}},d)})}var gHe=function(){function i(){ga(this,i),this.maps=void 0,this.id=0,this.maps=Object.create(null)}return pa(i,[{key:"set",value:function(t,n){this.maps[t]=n,this.id+=1}},{key:"get",value:function(t){return this.maps[t]}}]),i}();function pHe(i,e,t){var n=x.exports.useState(0),o=Ne(n,2),r=o[0],s=o[1],a=x.exports.useRef(new Map),l=x.exports.useRef(new gHe),c=x.exports.useRef();function u(){Xi.cancel(c.current)}function d(){var f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;u();var g=function(){a.current.forEach(function(v,m){if(v&&v.offsetParent){var _=JL(v),y=_.offsetHeight;l.current.get(m)!==y&&l.current.set(m,_.offsetHeight)}}),s(function(v){return v+1})};f?g():c.current=Xi(g)}function h(f,g){var p=i(f),v=a.current.get(p);g?(a.current.set(p,g),d()):a.current.delete(p),!v!=!g&&(g?e==null||e(f):t==null||t(f))}return x.exports.useEffect(function(){return u},[]),[h,d,l.current,r]}var mHe=10;function vHe(i,e,t,n,o,r,s,a){var l=x.exports.useRef(),c=x.exports.useState(null),u=Ne(c,2),d=u[0],h=u[1];return go(function(){if(d&&d.times=0;M-=1){var H=o(e[M]),B=t.get(H);if(B===void 0){_=!0;break}if(N-=B,N<=0)break}switch(L){case"top":w=E-v;break;case"bottom":w=I-m+v;break;default:{var F=i.current.scrollTop,$=F+m;E$&&(y="bottom")}}w!==null&&s(w),w!==d.lastTop&&(_=!0)}_&&h(Ce(Ce({},d),{},{times:d.times+1,targetAlign:y,lastTop:w}))}},[d,i.current]),function(f){if(f==null){a();return}if(Xi.cancel(l.current),typeof f=="number")s(f);else if(f&&Kn(f)==="object"){var g,p=f.align;"index"in f?g=f.index:g=e.findIndex(function(_){return o(_)===f.key});var v=f.offset,m=v===void 0?0:v;h({times:0,index:g,offset:m,originAlign:p})}}}function _He(i,e,t){var n=i.length,o=e.length,r,s;if(n===0&&o===0)return null;n1&&arguments[1]!==void 0?arguments[1]:!1,l=s<0&&r.current.top||s>0&&r.current.bottom;return a&&l?(clearTimeout(n.current),t.current=!1):(!l||t.current)&&o(),!t.current&&l}};function CHe(i,e,t,n,o){var r=x.exports.useRef(0),s=x.exports.useRef(null),a=x.exports.useRef(null),l=x.exports.useRef(!1),c=Vme(e,t);function u(v,m){Xi.cancel(s.current),r.current+=m,a.current=m,!c(m)&&(rie||v.preventDefault(),s.current=Xi(function(){var _=l.current?10:1;o(r.current*_),r.current=0}))}function d(v,m){o(m,!0),rie||v.preventDefault()}var h=x.exports.useRef(null),f=x.exports.useRef(null);function g(v){if(!!i){Xi.cancel(f.current),f.current=Xi(function(){h.current=null},2);var m=v.deltaX,_=v.deltaY,y=v.shiftKey,w=m,L=_;(h.current==="sx"||!h.current&&(y||!1)&&_&&!m)&&(w=_,L=0,h.current="sx");var D=Math.abs(w),E=Math.abs(L);h.current===null&&(h.current=n&&D>E?"x":"y"),h.current==="y"?u(v,L):d(v,w)}}function p(v){!i||(l.current=v.detail===a.current)}return[g,p]}var yHe=14/15;function wHe(i,e,t){var n=x.exports.useRef(!1),o=x.exports.useRef(0),r=x.exports.useRef(null),s=x.exports.useRef(null),a,l=function(h){if(n.current){var f=Math.ceil(h.touches[0].pageY),g=o.current-f;o.current=f,t(g)&&h.preventDefault(),clearInterval(s.current),s.current=setInterval(function(){g*=yHe,(!t(g,!0)||Math.abs(g)<=.1)&&clearInterval(s.current)},16)}},c=function(){n.current=!1,a()},u=function(h){a(),h.touches.length===1&&!n.current&&(n.current=!0,o.current=Math.ceil(h.touches[0].pageY),r.current=h.target,r.current.addEventListener("touchmove",l),r.current.addEventListener("touchend",c))};a=function(){r.current&&(r.current.removeEventListener("touchmove",l),r.current.removeEventListener("touchend",c))},go(function(){return i&&e.current.addEventListener("touchstart",u),function(){var d;(d=e.current)===null||d===void 0||d.removeEventListener("touchstart",u),a(),clearInterval(s.current)}},[i])}var SHe=20;function sie(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,t=i/e*100;return isNaN(t)&&(t=0),t=Math.max(t,SHe),t=Math.min(t,i/2),Math.floor(t)}function xHe(i,e,t,n){var o=x.exports.useMemo(function(){return[new Map,[]]},[i,t.id,n]),r=Ne(o,2),s=r[0],a=r[1],l=function(u){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:u,h=s.get(u),f=s.get(d);if(h===void 0||f===void 0)for(var g=i.length,p=a.length;pr||!!p),A=g==="rtl",P=Ue(n,me({},"".concat(n,"-rtl"),A),o),N=u||EHe,M=x.exports.useRef(),H=x.exports.useRef(),B=x.exports.useState(0),F=Ne(B,2),$=F[0],z=F[1],K=x.exports.useState(0),j=Ne(K,2),G=j[0],X=j[1],de=x.exports.useState(!1),fe=Ne(de,2),pe=fe[0],be=fe[1],Se=function(){be(!0)},Fe=function(){be(!1)},De=x.exports.useCallback(function(Ze){return typeof h=="function"?h(Ze):Ze==null?void 0:Ze[h]},[h]),ce={getKey:De};function Pe(Ze){z(function(ue){var Ve;typeof Ze=="function"?Ve=Ze(ue):Ve=Ze;var ot=tn(Ve);return M.current.scrollTop=ot,ot})}var Oe=x.exports.useRef({start:0,end:N.length}),xe=x.exports.useRef(),Ee=bHe(N,De),tt=Ne(Ee,1),nt=tt[0];xe.current=nt;var Qe=pHe(De,null,null),Ge=Ne(Qe,4),re=Ge[0],ie=Ge[1],se=Ge[2],U=Ge[3],Y=x.exports.useMemo(function(){if(!k)return{scrollHeight:void 0,start:0,end:N.length-1,offset:void 0};if(!R){var Ze;return{scrollHeight:((Ze=H.current)===null||Ze===void 0?void 0:Ze.offsetHeight)||0,start:0,end:N.length-1,offset:void 0}}for(var ue=0,Ve,ot,Sn,$n=N.length,Ci=0;Ci<$n;Ci+=1){var An=N[Ci],lo=De(An),Qo=se.get(lo),zo=ue+(Qo===void 0?s:Qo);zo>=$&&Ve===void 0&&(Ve=Ci,ot=ue),zo>$+r&&Sn===void 0&&(Sn=Ci),ue=zo}return Ve===void 0&&(Ve=0,ot=0,Sn=Math.ceil(r/s)),Sn===void 0&&(Sn=N.length-1),Sn=Math.min(Sn+1,N.length-1),{scrollHeight:ue,start:Ve,end:Sn,offset:ot}},[R,k,$,N,U,r]),oe=Y.scrollHeight,te=Y.start,ye=Y.end,Le=Y.offset;Oe.current.start=te,Oe.current.end=ye;var Te=x.exports.useState({width:0,height:r}),We=Ne(Te,2),je=We[0],mt=We[1],Dt=function(ue){mt({width:ue.width||ue.offsetWidth,height:ue.height||ue.offsetHeight})},At=x.exports.useRef(),Je=x.exports.useRef(),Lt=x.exports.useMemo(function(){return sie(je.width,p)},[je.width,p]),Ot=x.exports.useMemo(function(){return sie(je.height,oe)},[je.height,oe]),Vn=oe-r,Et=x.exports.useRef(Vn);Et.current=Vn;function tn(Ze){var ue=Ze;return Number.isNaN(Et.current)||(ue=Math.min(ue,Et.current)),ue=Math.max(ue,0),ue}var ui=$<=0,cn=$>=Vn,qn=Vme(ui,cn),bn=function(){return{x:A?-G:G,y:$}},Pt=x.exports.useRef(bn()),qt=tl(function(){if(y){var Ze=bn();(Pt.current.x!==Ze.x||Pt.current.y!==Ze.y)&&(y(Ze),Pt.current=Ze)}});function Nt(Ze,ue){var Ve=Ze;ue?(zd.exports.flushSync(function(){X(Ve)}),qt()):Pe(Ve)}function jt(Ze){var ue=Ze.currentTarget.scrollTop;ue!==$&&Pe(ue),_==null||_(Ze),qt()}var Gt=function(ue){var Ve=ue,ot=p-je.width;return Ve=Math.max(Ve,0),Ve=Math.min(Ve,ot),Ve},It=tl(function(Ze,ue){ue?(zd.exports.flushSync(function(){X(function(Ve){var ot=Ve+(A?-Ze:Ze);return Gt(ot)})}),qt()):Pe(function(Ve){var ot=Ve+Ze;return ot})}),Ft=CHe(k,ui,cn,!!p,It),bt=Ne(Ft,2),Zt=bt[0],wn=bt[1];wHe(k,M,function(Ze,ue){return qn(Ze,ue)?!1:(Zt({preventDefault:function(){},deltaY:Ze}),!0)}),go(function(){function Ze(Ve){k&&Ve.preventDefault()}var ue=M.current;return ue.addEventListener("wheel",Zt),ue.addEventListener("DOMMouseScroll",wn),ue.addEventListener("MozMousePixelScroll",Ze),function(){ue.removeEventListener("wheel",Zt),ue.removeEventListener("DOMMouseScroll",wn),ue.removeEventListener("MozMousePixelScroll",Ze)}},[k]),go(function(){p&&X(function(Ze){return Gt(Ze)})},[je.width,p]);var Dn=function(){var ue,Ve;(ue=At.current)===null||ue===void 0||ue.delayHidden(),(Ve=Je.current)===null||Ve===void 0||Ve.delayHidden()},Gn=vHe(M,N,se,s,De,function(){return ie(!0)},Pe,Dn);x.exports.useImperativeHandle(e,function(){return{getScrollInfo:bn,scrollTo:function(ue){function Ve(ot){return ot&&Kn(ot)==="object"&&("left"in ot||"top"in ot)}Ve(ue)?(ue.left!==void 0&&X(Gt(ue.left)),Gn(ue.top)):Gn(ue)}}}),go(function(){if(w){var Ze=N.slice(te,ye+1);w(Ze,N)}},[te,ye,N]);var Un=xHe(N,De,se,s),Zi=D==null?void 0:D({start:te,end:ye,virtual:R,offsetX:G,offsetY:Le,rtl:A,getSize:Un}),an=fHe(N,te,ye,p,re,d,ce),Xt=null;r&&(Xt=Ce(me({},l?"height":"maxHeight",r),DHe),k&&(Xt.overflowY="hidden",p&&(Xt.overflowX="hidden"),pe&&(Xt.pointerEvents="none")));var oi={};return A&&(oi.dir="rtl"),x.exports.createElement("div",yt({style:Ce(Ce({},c),{},{position:"relative"}),className:P},oi,I),x.exports.createElement(Md,{onResize:Dt},x.exports.createElement(m,{className:"".concat(n,"-holder"),style:Xt,ref:M,onScroll:jt,onMouseEnter:Dn},x.exports.createElement(Wme,{prefixCls:n,height:oe,offsetX:G,offsetY:Le,scrollWidth:p,onInnerResize:ie,ref:H,innerProps:L,rtl:A,extra:Zi},an))),R&&oe>r&&x.exports.createElement(oie,{ref:At,prefixCls:n,scrollOffset:$,scrollRange:oe,rtl:A,onScroll:Nt,onStartMove:Se,onStopMove:Fe,spinSize:Ot,containerSize:je.height,style:E==null?void 0:E.verticalScrollBar,thumbStyle:E==null?void 0:E.verticalScrollBarThumb}),R&&p&&x.exports.createElement(oie,{ref:Je,prefixCls:n,scrollOffset:G,scrollRange:p,rtl:A,onScroll:Nt,onStartMove:Se,onStopMove:Fe,spinSize:Lt,containerSize:je.width,horizontal:!0,style:E==null?void 0:E.horizontalScrollBar,thumbStyle:E==null?void 0:E.horizontalScrollBarThumb}))}var lq=x.exports.forwardRef(kHe);lq.displayName="List";function IHe(){return/(mac\sos|macintosh)/i.test(navigator.appVersion)}var THe=["disabled","title","children","style","className"];function aie(i){return typeof i=="string"||typeof i=="number"}var NHe=function(e,t){var n=_Ve(),o=n.prefixCls,r=n.id,s=n.open,a=n.multiple,l=n.mode,c=n.searchValue,u=n.toggleOpen,d=n.notFoundContent,h=n.onPopupScroll,f=x.exports.useContext(rq),g=f.maxCount,p=f.flattenOptions,v=f.onActiveValue,m=f.defaultActiveFirstOption,_=f.onSelect,y=f.menuItemSelectedIcon,w=f.rawValues,L=f.fieldNames,D=f.virtual,E=f.direction,I=f.listHeight,k=f.listItemHeight,R=f.optionRender,A="".concat(o,"-item"),P=SI(function(){return p},[s,p],function(De,ce){return ce[0]&&De[1]!==ce[1]}),N=x.exports.useRef(null),M=x.exports.useMemo(function(){return a&&typeof g!="undefined"&&(w==null?void 0:w.size)>=g},[a,g,w==null?void 0:w.size]),H=function(ce){ce.preventDefault()},B=function(ce){var Pe;(Pe=N.current)===null||Pe===void 0||Pe.scrollTo(typeof ce=="number"?{index:ce}:ce)},F=function(ce){for(var Pe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,Oe=P.length,xe=0;xe1&&arguments[1]!==void 0?arguments[1]:!1;j(ce);var Oe={source:Pe?"keyboard":"mouse"},xe=P[ce];if(!xe){v(null,-1,Oe);return}v(xe.value,ce,Oe)};x.exports.useEffect(function(){G(m!==!1?F(0):-1)},[P.length,c]);var X=x.exports.useCallback(function(De){return w.has(De)&&l!=="combobox"},[l,_t(w).toString(),w.size]);x.exports.useEffect(function(){var De=setTimeout(function(){if(!a&&s&&w.size===1){var Pe=Array.from(w)[0],Oe=P.findIndex(function(xe){var Ee=xe.data;return Ee.value===Pe});Oe!==-1&&(G(Oe),B(Oe))}});if(s){var ce;(ce=N.current)===null||ce===void 0||ce.scrollTo(void 0)}return function(){return clearTimeout(De)}},[s,c]);var de=function(ce){ce!==void 0&&_(ce,{selected:!w.has(ce)}),a||u(!1)};if(x.exports.useImperativeHandle(t,function(){return{onKeyDown:function(ce){var Pe=ce.which,Oe=ce.ctrlKey;switch(Pe){case at.N:case at.P:case at.UP:case at.DOWN:{var xe=0;if(Pe===at.UP?xe=-1:Pe===at.DOWN?xe=1:IHe()&&Oe&&(Pe===at.N?xe=1:Pe===at.P&&(xe=-1)),xe!==0){var Ee=F(K+xe,xe);B(Ee),G(Ee,!0)}break}case at.ENTER:{var tt,nt=P[K];nt&&!(nt!=null&&(tt=nt.data)!==null&&tt!==void 0&&tt.disabled)&&!M?de(nt.value):de(void 0),s&&ce.preventDefault();break}case at.ESC:u(!1),s&&ce.stopPropagation()}},onKeyUp:function(){},scrollTo:function(ce){B(ce)}}}),P.length===0)return x.exports.createElement("div",{role:"listbox",id:"".concat(r,"_list"),className:"".concat(A,"-empty"),onMouseDown:H},d);var fe=Object.keys(L).map(function(De){return L[De]}),pe=function(ce){return ce.label};function be(De,ce){var Pe=De.group;return{role:Pe?"presentation":"option",id:"".concat(r,"_list_").concat(ce)}}var Se=function(ce){var Pe=P[ce];if(!Pe)return null;var Oe=Pe.data||{},xe=Oe.value,Ee=Pe.group,tt=U0(Oe,!0),nt=pe(Pe);return Pe?x.exports.createElement("div",yt({"aria-label":typeof nt=="string"&&!Ee?nt:null},tt,{key:ce},be(Pe,ce),{"aria-selected":X(xe)}),xe):null},Fe={role:"listbox",id:"".concat(r,"_list")};return x.exports.createElement(x.exports.Fragment,null,D&&x.exports.createElement("div",yt({},Fe,{style:{height:0,width:0,overflow:"hidden"}}),Se(K-1),Se(K),Se(K+1)),x.exports.createElement(lq,{itemKey:"key",ref:N,data:P,height:I,itemHeight:k,fullHeight:!1,onMouseDown:H,onScroll:h,virtual:D,direction:E,innerProps:D?null:Fe},function(De,ce){var Pe,Oe=De.group,xe=De.groupOption,Ee=De.data,tt=De.label,nt=De.value,Qe=Ee.key;if(Oe){var Ge,re=(Ge=Ee.title)!==null&&Ge!==void 0?Ge:aie(tt)?tt.toString():void 0;return x.exports.createElement("div",{className:Ue(A,"".concat(A,"-group")),title:re},tt!==void 0?tt:Qe)}var ie=Ee.disabled,se=Ee.title;Ee.children;var U=Ee.style,Y=Ee.className,oe=Hn(Ee,THe),te=kf(oe,fe),ye=X(nt),Le=ie||!ye&&M,Te="".concat(A,"-option"),We=Ue(A,Te,Y,(Pe={},me(Pe,"".concat(Te,"-grouped"),xe),me(Pe,"".concat(Te,"-active"),K===ce&&!Le),me(Pe,"".concat(Te,"-disabled"),Le),me(Pe,"".concat(Te,"-selected"),ye),Pe)),je=pe(De),mt=!y||typeof y=="function"||ye,Dt=typeof je=="number"?je:je||nt,At=aie(Dt)?Dt.toString():void 0;return se!==void 0&&(At=se),x.exports.createElement("div",yt({},U0(te),D?{}:be(De,ce),{"aria-selected":ye,className:We,title:At,onMouseMove:function(){K===ce||Le||G(ce)},onClick:function(){Le||de(nt)},style:U}),x.exports.createElement("div",{className:"".concat(Te,"-content")},typeof R=="function"?R(De,{index:ce}):Dt),x.exports.isValidElement(y)||ye,mt&&x.exports.createElement(N4,{className:"".concat(A,"-option-state"),customizeIcon:y,customizeIconProps:{value:nt,disabled:Le,isSelected:ye}},ye?"\u2713":null))}))},RHe=x.exports.forwardRef(NHe),MHe=function(i,e){var t=x.exports.useRef({values:new Map,options:new Map}),n=x.exports.useMemo(function(){var r=t.current,s=r.values,a=r.options,l=i.map(function(d){if(d.label===void 0){var h;return Ce(Ce({},d),{},{label:(h=s.get(d.value))===null||h===void 0?void 0:h.label})}return d}),c=new Map,u=new Map;return l.forEach(function(d){c.set(d.value,d),u.set(d.value,e.get(d.value)||a.get(d.value))}),t.current.values=c,t.current.options=u,l},[i,e]),o=x.exports.useCallback(function(r){return e.get(r)||t.current.options.get(r)},[e]);return[n,o]};function g6(i,e){return Ome(i).join("").toUpperCase().includes(e)}var AHe=function(i,e,t,n,o){return x.exports.useMemo(function(){if(!t||n===!1)return i;var r=e.options,s=e.label,a=e.value,l=[],c=typeof n=="function",u=t.toUpperCase(),d=c?n:function(f,g){return o?g6(g[o],u):g[r]?g6(g[s!=="children"?s:"label"],u):g6(g[a],u)},h=c?function(f){return RW(f)}:function(f){return f};return i.forEach(function(f){if(f[r]){var g=d(t,h(f));if(g)l.push(f);else{var p=f[r].filter(function(v){return d(t,h(v))});p.length&&l.push(Ce(Ce({},f),{},me({},r,p)))}return}d(t,h(f))&&l.push(f)}),l},[i,n,o,t,e])},lie=0,PHe=Fa();function OHe(){var i;return PHe?(i=lie,lie+=1):i="TEST_OR_SSR",i}function FHe(i){var e=x.exports.useState(),t=Ne(e,2),n=t[0],o=t[1];return x.exports.useEffect(function(){o("rc_select_".concat(OHe()))},[]),i||n}var BHe=["children","value"],WHe=["children"];function VHe(i){var e=i,t=e.key,n=e.props,o=n.children,r=n.value,s=Hn(n,BHe);return Ce({key:t,value:r!==void 0?r:t,children:o},s)}function Hme(i){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return ip(i).map(function(t,n){if(!x.exports.isValidElement(t)||!t.type)return null;var o=t,r=o.type.isSelectOptGroup,s=o.key,a=o.props,l=a.children,c=Hn(a,WHe);return e||!r?VHe(t):Ce(Ce({key:"__RC_SELECT_GRP__".concat(s===null?n:s,"__"),label:s},c),{},{options:Hme(l)})}).filter(function(t){return t})}var HHe=function(e,t,n,o,r){return x.exports.useMemo(function(){var s=e,a=!e;a&&(s=Hme(t));var l=new Map,c=new Map,u=function(f,g,p){p&&typeof p=="string"&&f.set(g[p],g)},d=function h(f){for(var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,p=0;p2&&arguments[2]!==void 0?arguments[2]:{},Zt=bt.source,wn=Zt===void 0?"keyboard":Zt;ui(Ft),s&&n==="combobox"&&It!==null&&wn==="keyboard"&&Ot(String(It))},[s,n]),bn=function(Ft,bt,Zt){var wn=function(){var Ve,ot=Y(Ft);return[$?{label:ot==null?void 0:ot[pe.label],value:Ft,key:(Ve=ot==null?void 0:ot.key)!==null&&Ve!==void 0?Ve:Ft}:Ft,RW(ot)]};if(bt&&f){var Dn=wn(),Gn=Ne(Dn,2),Un=Gn[0],Zi=Gn[1];f(Un,Zi)}else if(!bt&&g&&Zt!=="clear"){var an=wn(),Xt=Ne(an,2),oi=Xt[0],Ze=Xt[1];g(oi,Ze)}},Pt=cie(function(It,Ft){var bt,Zt=X?Ft.selected:!0;Zt?bt=X?[].concat(_t(U),[It]):[It]:bt=U.filter(function(wn){return wn.value!==It}),Dt(bt),bn(It,Zt),n==="combobox"?Ot(""):(!MW||h)&&(De(""),Ot(""))}),qt=function(Ft,bt){Dt(Ft);var Zt=bt.type,wn=bt.values;(Zt==="remove"||Zt==="clear")&&wn.forEach(function(Dn){bn(Dn.value,!1,Zt)})},Nt=function(Ft,bt){if(De(Ft),Ot(null),bt.source==="submit"){var Zt=(Ft||"").trim();if(Zt){var wn=Array.from(new Set([].concat(_t(te),[Zt])));Dt(wn),bn(Zt,!0),De("")}return}bt.source!=="blur"&&(n==="combobox"&&Dt(Ft),u==null||u(Ft))},jt=function(Ft){var bt=Ft;n!=="tags"&&(bt=Ft.map(function(wn){var Dn=Oe.get(wn);return Dn==null?void 0:Dn.value}).filter(function(wn){return wn!==void 0}));var Zt=Array.from(new Set([].concat(_t(te),_t(bt))));Dt(Zt),Zt.forEach(function(wn){bn(wn,!0)})},Gt=x.exports.useMemo(function(){var It=R!==!1&&v!==!1;return Ce(Ce({},ce),{},{flattenOptions:mt,onActiveValue:qn,defaultActiveFirstOption:cn,onSelect:Pt,menuItemSelectedIcon:k,rawValues:te,fieldNames:pe,virtual:It,direction:A,listHeight:N,listItemHeight:H,childrenAsData:de,maxCount:K,optionRender:D})},[K,ce,mt,qn,cn,Pt,k,te,pe,R,v,A,N,H,de,D]);return x.exports.createElement(rq.Provider,{value:Gt},x.exports.createElement(dHe,yt({},j,{id:G,prefixCls:r,ref:e,omitDomProps:zHe,mode:n,displayValues:oe,onDisplayValuesChange:qt,direction:A,searchValue:Fe,onSearch:Nt,autoClearSearchValue:h,onSearchSplit:jt,dropdownMatchSelectWidth:v,OptionList:RHe,emptyOptions:!mt.length,activeValue:Lt,activeDescendantId:"".concat(G,"_list_").concat(tn)})))}),cq=jHe;cq.Option=aq;cq.OptGroup=sq;function kA(i,e,t){return Ue({[`${i}-status-success`]:e==="success",[`${i}-status-warning`]:e==="warning",[`${i}-status-error`]:e==="error",[`${i}-status-validating`]:e==="validating",[`${i}-has-feedback`]:t})}const uq=(i,e)=>e||i,KHe=()=>{const[,i]=Ba(),t=new na(i.colorBgBase).toHsl().l<.5?{opacity:.65}:{};return x.exports.createElement("svg",{style:t,width:"184",height:"152",viewBox:"0 0 184 152",xmlns:"http://www.w3.org/2000/svg"},x.exports.createElement("g",{fill:"none",fillRule:"evenodd"},x.exports.createElement("g",{transform:"translate(24 31.67)"},x.exports.createElement("ellipse",{fillOpacity:".8",fill:"#F5F5F7",cx:"67.797",cy:"106.89",rx:"67.797",ry:"12.668"}),x.exports.createElement("path",{d:"M122.034 69.674L98.109 40.229c-1.148-1.386-2.826-2.225-4.593-2.225h-51.44c-1.766 0-3.444.839-4.592 2.225L13.56 69.674v15.383h108.475V69.674z",fill:"#AEB8C2"}),x.exports.createElement("path",{d:"M101.537 86.214L80.63 61.102c-1.001-1.207-2.507-1.867-4.048-1.867H31.724c-1.54 0-3.047.66-4.048 1.867L6.769 86.214v13.792h94.768V86.214z",fill:"url(#linearGradient-1)",transform:"translate(13.56)"}),x.exports.createElement("path",{d:"M33.83 0h67.933a4 4 0 0 1 4 4v93.344a4 4 0 0 1-4 4H33.83a4 4 0 0 1-4-4V4a4 4 0 0 1 4-4z",fill:"#F5F5F7"}),x.exports.createElement("path",{d:"M42.678 9.953h50.237a2 2 0 0 1 2 2V36.91a2 2 0 0 1-2 2H42.678a2 2 0 0 1-2-2V11.953a2 2 0 0 1 2-2zM42.94 49.767h49.713a2.262 2.262 0 1 1 0 4.524H42.94a2.262 2.262 0 0 1 0-4.524zM42.94 61.53h49.713a2.262 2.262 0 1 1 0 4.525H42.94a2.262 2.262 0 0 1 0-4.525zM121.813 105.032c-.775 3.071-3.497 5.36-6.735 5.36H20.515c-3.238 0-5.96-2.29-6.734-5.36a7.309 7.309 0 0 1-.222-1.79V69.675h26.318c2.907 0 5.25 2.448 5.25 5.42v.04c0 2.971 2.37 5.37 5.277 5.37h34.785c2.907 0 5.277-2.421 5.277-5.393V75.1c0-2.972 2.343-5.426 5.25-5.426h26.318v33.569c0 .617-.077 1.216-.221 1.789z",fill:"#DCE0E6"})),x.exports.createElement("path",{d:"M149.121 33.292l-6.83 2.65a1 1 0 0 1-1.317-1.23l1.937-6.207c-2.589-2.944-4.109-6.534-4.109-10.408C138.802 8.102 148.92 0 161.402 0 173.881 0 184 8.102 184 18.097c0 9.995-10.118 18.097-22.599 18.097-4.528 0-8.744-1.066-12.28-2.902z",fill:"#DCE0E6"}),x.exports.createElement("g",{transform:"translate(149.65 15.383)",fill:"#FFF"},x.exports.createElement("ellipse",{cx:"20.654",cy:"3.167",rx:"2.849",ry:"2.815"}),x.exports.createElement("path",{d:"M5.698 5.63H0L2.898.704zM9.259.704h4.985V5.63H9.259z"}))))};var qHe=KHe;const GHe=()=>{const[,i]=Ba(),{colorFill:e,colorFillTertiary:t,colorFillQuaternary:n,colorBgContainer:o}=i,{borderColor:r,shadowColor:s,contentColor:a}=x.exports.useMemo(()=>({borderColor:new na(e).onBackground(o).toHexShortString(),shadowColor:new na(t).onBackground(o).toHexShortString(),contentColor:new na(n).onBackground(o).toHexShortString()}),[e,t,n,o]);return x.exports.createElement("svg",{width:"64",height:"41",viewBox:"0 0 64 41",xmlns:"http://www.w3.org/2000/svg"},x.exports.createElement("g",{transform:"translate(0 1)",fill:"none",fillRule:"evenodd"},x.exports.createElement("ellipse",{fill:s,cx:"32",cy:"33",rx:"32",ry:"7"}),x.exports.createElement("g",{fillRule:"nonzero",stroke:r},x.exports.createElement("path",{d:"M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z"}),x.exports.createElement("path",{d:"M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z",fill:a}))))};var XHe=GHe;const YHe=i=>{const{componentCls:e,margin:t,marginXS:n,marginXL:o,fontSize:r,lineHeight:s}=i;return{[e]:{marginInline:n,fontSize:r,lineHeight:s,textAlign:"center",[`${e}-image`]:{height:i.emptyImgHeight,marginBottom:n,opacity:i.opacityImage,img:{height:"100%"},svg:{maxWidth:"100%",height:"100%",margin:"auto"}},[`${e}-description`]:{color:i.colorText},[`${e}-footer`]:{marginTop:t},"&-normal":{marginBlock:o,color:i.colorTextDisabled,[`${e}-description`]:{color:i.colorTextDisabled},[`${e}-image`]:{height:i.emptyImgHeightMD}},"&-small":{marginBlock:n,color:i.colorTextDisabled,[`${e}-image`]:{height:i.emptyImgHeightSM}}}}};var ZHe=jc("Empty",i=>{const{componentCls:e,controlHeightLG:t,calc:n}=i,o=lr(i,{emptyImgCls:`${e}-img`,emptyImgHeight:n(t).mul(2.5).equal(),emptyImgHeightMD:t,emptyImgHeightSM:n(t).mul(.875).equal()});return[YHe(o)]}),QHe=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(i);o{var{className:e,rootClassName:t,prefixCls:n,image:o=$me,description:r,children:s,imageStyle:a,style:l}=i,c=QHe(i,["className","rootClassName","prefixCls","image","description","children","imageStyle","style"]);const{getPrefixCls:u,direction:d,empty:h}=x.exports.useContext(Hi),f=u("empty",n),[g,p,v]=ZHe(f),[m]=xI("Empty"),_=typeof r!="undefined"?r:m==null?void 0:m.description,y=typeof _=="string"?_:"empty";let w=null;return typeof o=="string"?w=x.exports.createElement("img",{alt:y,src:o}):w=o,g(x.exports.createElement("div",Object.assign({className:Ue(p,v,f,h==null?void 0:h.className,{[`${f}-normal`]:o===zme,[`${f}-rtl`]:d==="rtl"},e,t),style:Object.assign(Object.assign({},h==null?void 0:h.style),l)},c),x.exports.createElement("div",{className:`${f}-image`,style:a},w),_&&x.exports.createElement("div",{className:`${f}-description`},_),s&&x.exports.createElement("div",{className:`${f}-footer`},s)))};dq.PRESENTED_IMAGE_DEFAULT=$me;dq.PRESENTED_IMAGE_SIMPLE=zme;var Lx=dq;const JHe=i=>{const{componentName:e}=i,{getPrefixCls:t}=x.exports.useContext(Hi),n=t("empty");switch(e){case"Table":case"List":return he(Lx,{image:Lx.PRESENTED_IMAGE_SIMPLE});case"Select":case"TreeSelect":case"Cascader":case"Transfer":case"Mentions":return he(Lx,{image:Lx.PRESENTED_IMAGE_SIMPLE,className:`${n}-small`});default:return he(Lx,{})}};var e$e=JHe;const t$e=["outlined","borderless","filled"],n$e=function(i){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0;const t=x.exports.useContext(ame);let n;typeof i!="undefined"?n=i:e===!1?n="borderless":n=t!=null?t:"outlined";const o=t$e.includes(n);return[n,o]};var hq=n$e;const i$e=i=>{const t={overflow:{adjustX:!0,adjustY:!0,shiftY:!0},htmlRegion:i==="scroll"?"scroll":"visible",dynamicInset:!0};return{bottomLeft:Object.assign(Object.assign({},t),{points:["tl","bl"],offset:[0,4]}),bottomRight:Object.assign(Object.assign({},t),{points:["tr","br"],offset:[0,4]}),topLeft:Object.assign(Object.assign({},t),{points:["bl","tl"],offset:[0,-4]}),topRight:Object.assign(Object.assign({},t),{points:["br","tr"],offset:[0,-4]})}};function o$e(i,e){return i||i$e(e)}const r$e=i=>{const{optionHeight:e,optionFontSize:t,optionLineHeight:n,optionPadding:o}=i;return{position:"relative",display:"block",minHeight:e,padding:o,color:i.colorText,fontWeight:"normal",fontSize:t,lineHeight:n,boxSizing:"border-box"}},s$e=i=>{const{antCls:e,componentCls:t}=i,n=`${t}-item`,o=`&${e}-slide-up-enter${e}-slide-up-enter-active`,r=`&${e}-slide-up-appear${e}-slide-up-appear-active`,s=`&${e}-slide-up-leave${e}-slide-up-leave-active`,a=`${t}-dropdown-placement-`;return[{[`${t}-dropdown`]:Object.assign(Object.assign({},Pa(i)),{position:"absolute",top:-9999,zIndex:i.zIndexPopup,boxSizing:"border-box",padding:i.paddingXXS,overflow:"hidden",fontSize:i.fontSize,fontVariant:"initial",backgroundColor:i.colorBgElevated,borderRadius:i.borderRadiusLG,outline:"none",boxShadow:i.boxShadowSecondary,[` ${o}${a}bottomLeft, ${r}${a}bottomLeft - `]:{animationName:ime},[` + `]:{animationName:ume},[` ${o}${a}topLeft, ${r}${a}topLeft, ${o}${a}topRight, ${r}${a}topRight - `]:{animationName:rme},[`${s}${a}bottomLeft`]:{animationName:ome},[` + `]:{animationName:hme},[`${s}${a}bottomLeft`]:{animationName:dme},[` ${s}${a}topLeft, ${s}${a}topRight - `]:{animationName:sme},"&-hidden":{display:"none"},[`${n}`]:Object.assign(Object.assign({},ZHe(i)),{cursor:"pointer",transition:`background ${i.motionDurationSlow} ease`,borderRadius:i.borderRadiusSM,"&-group":{color:i.colorTextDescription,fontSize:i.fontSizeSM,cursor:"default"},"&-option":{display:"flex","&-content":Object.assign({flex:"auto"},vA),"&-state":{flex:"none",display:"flex",alignItems:"center"},[`&-active:not(${n}-option-disabled)`]:{backgroundColor:i.optionActiveBg},[`&-selected:not(${n}-option-disabled)`]:{color:i.optionSelectedColor,fontWeight:i.optionSelectedFontWeight,backgroundColor:i.optionSelectedBg,[`${n}-option-state`]:{color:i.colorPrimary},[`&:has(+ ${n}-option-selected:not(${n}-option-disabled))`]:{borderEndStartRadius:0,borderEndEndRadius:0,[`& + ${n}-option-selected:not(${n}-option-disabled)`]:{borderStartStartRadius:0,borderStartEndRadius:0}}},"&-disabled":{[`&${n}-option-selected`]:{backgroundColor:i.colorBgContainerDisabled},color:i.colorTextDisabled,cursor:"not-allowed"},"&-grouped":{paddingInlineStart:i.calc(i.controlPaddingHorizontal).mul(2).equal()}}}),"&-rtl":{direction:"rtl"}})},SA(i,"slide-up"),SA(i,"slide-down"),Ane(i,"move-up"),Ane(i,"move-down")]};var JHe=QHe;const T1=2,e$e=i=>{const{multipleSelectItemHeight:e,selectHeight:t,lineWidth:n}=i;return i.calc(t).sub(e).div(2).sub(n).equal()};function p6(i,e){const{componentCls:t,iconCls:n}=i,o=`${t}-selection-overflow`,r=i.multipleSelectItemHeight,s=e$e(i),a=e?`${t}-${e}`:"";return{[`${t}-multiple${a}`]:{fontSize:i.fontSize,[o]:{position:"relative",display:"flex",flex:"auto",flexWrap:"wrap",maxWidth:"100%","&-item":{flex:"none",alignSelf:"center",maxWidth:"100%",display:"inline-flex"}},[`${t}-selector`]:{display:"flex",flexWrap:"wrap",alignItems:"center",height:"100%",paddingInline:i.calc(T1).mul(2).equal(),paddingBlock:i.calc(s).sub(T1).equal(),borderRadius:i.borderRadius,[`${t}-show-search&`]:{cursor:"text"},[`${t}-disabled&`]:{background:i.multipleSelectorBgDisabled,cursor:"not-allowed"},"&:after":{display:"inline-block",width:0,margin:`${rt(T1)} 0`,lineHeight:rt(r),visibility:"hidden",content:'"\\a0"'}},[` + `]:{animationName:fme},"&-hidden":{display:"none"},[`${n}`]:Object.assign(Object.assign({},r$e(i)),{cursor:"pointer",transition:`background ${i.motionDurationSlow} ease`,borderRadius:i.borderRadiusSM,"&-group":{color:i.colorTextDescription,fontSize:i.fontSizeSM,cursor:"default"},"&-option":{display:"flex","&-content":Object.assign({flex:"auto"},CA),"&-state":{flex:"none",display:"flex",alignItems:"center"},[`&-active:not(${n}-option-disabled)`]:{backgroundColor:i.optionActiveBg},[`&-selected:not(${n}-option-disabled)`]:{color:i.optionSelectedColor,fontWeight:i.optionSelectedFontWeight,backgroundColor:i.optionSelectedBg,[`${n}-option-state`]:{color:i.colorPrimary},[`&:has(+ ${n}-option-selected:not(${n}-option-disabled))`]:{borderEndStartRadius:0,borderEndEndRadius:0,[`& + ${n}-option-selected:not(${n}-option-disabled)`]:{borderStartStartRadius:0,borderStartEndRadius:0}}},"&-disabled":{[`&${n}-option-selected`]:{backgroundColor:i.colorBgContainerDisabled},color:i.colorTextDisabled,cursor:"not-allowed"},"&-grouped":{paddingInlineStart:i.calc(i.controlPaddingHorizontal).mul(2).equal()}}}),"&-rtl":{direction:"rtl"}})},EA(i,"slide-up"),EA(i,"slide-down"),$ne(i,"move-up"),$ne(i,"move-down")]};var a$e=s$e;const T1=2,l$e=i=>{const{multipleSelectItemHeight:e,selectHeight:t,lineWidth:n}=i;return i.calc(t).sub(e).div(2).sub(n).equal()};function p6(i,e){const{componentCls:t,iconCls:n}=i,o=`${t}-selection-overflow`,r=i.multipleSelectItemHeight,s=l$e(i),a=e?`${t}-${e}`:"";return{[`${t}-multiple${a}`]:{fontSize:i.fontSize,[o]:{position:"relative",display:"flex",flex:"auto",flexWrap:"wrap",maxWidth:"100%","&-item":{flex:"none",alignSelf:"center",maxWidth:"100%",display:"inline-flex"}},[`${t}-selector`]:{display:"flex",flexWrap:"wrap",alignItems:"center",height:"100%",paddingInline:i.calc(T1).mul(2).equal(),paddingBlock:i.calc(s).sub(T1).equal(),borderRadius:i.borderRadius,[`${t}-show-search&`]:{cursor:"text"},[`${t}-disabled&`]:{background:i.multipleSelectorBgDisabled,cursor:"not-allowed"},"&:after":{display:"inline-block",width:0,margin:`${rt(T1)} 0`,lineHeight:rt(r),visibility:"hidden",content:'"\\a0"'}},[` &${t}-show-arrow ${t}-selector, &${t}-allow-clear ${t}-selector - `]:{paddingInlineEnd:i.calc(i.fontSizeIcon).add(i.controlPaddingHorizontal).equal()},[`${t}-selection-item`]:{display:"flex",alignSelf:"center",flex:"none",boxSizing:"border-box",maxWidth:"100%",height:r,marginTop:T1,marginBottom:T1,lineHeight:rt(i.calc(r).sub(i.calc(i.lineWidth).mul(2)).equal()),borderRadius:i.borderRadiusSM,cursor:"default",transition:`font-size ${i.motionDurationSlow}, line-height ${i.motionDurationSlow}, height ${i.motionDurationSlow}`,marginInlineEnd:i.calc(T1).mul(2).equal(),paddingInlineStart:i.paddingXS,paddingInlineEnd:i.calc(i.paddingXS).div(2).equal(),[`${t}-disabled&`]:{color:i.multipleItemColorDisabled,borderColor:i.multipleItemBorderColorDisabled,cursor:"not-allowed"},"&-content":{display:"inline-block",marginInlineEnd:i.calc(i.paddingXS).div(2).equal(),overflow:"hidden",whiteSpace:"pre",textOverflow:"ellipsis"},"&-remove":Object.assign(Object.assign({},TK()),{display:"inline-flex",alignItems:"center",color:i.colorIcon,fontWeight:"bold",fontSize:10,lineHeight:"inherit",cursor:"pointer",[`> ${n}`]:{verticalAlign:"-0.2em"},"&:hover":{color:i.colorIconHover}})},[`${o}-item + ${o}-item`]:{[`${t}-selection-search`]:{marginInlineStart:0}},[`${o}-item-suffix`]:{height:"100%"},[`${t}-selection-search`]:{display:"inline-flex",position:"relative",maxWidth:"100%",marginInlineStart:i.calc(i.inputPaddingHorizontalBase).sub(s).equal(),[` + `]:{paddingInlineEnd:i.calc(i.fontSizeIcon).add(i.controlPaddingHorizontal).equal()},[`${t}-selection-item`]:{display:"flex",alignSelf:"center",flex:"none",boxSizing:"border-box",maxWidth:"100%",height:r,marginTop:T1,marginBottom:T1,lineHeight:rt(i.calc(r).sub(i.calc(i.lineWidth).mul(2)).equal()),borderRadius:i.borderRadiusSM,cursor:"default",transition:`font-size ${i.motionDurationSlow}, line-height ${i.motionDurationSlow}, height ${i.motionDurationSlow}`,marginInlineEnd:i.calc(T1).mul(2).equal(),paddingInlineStart:i.paddingXS,paddingInlineEnd:i.calc(i.paddingXS).div(2).equal(),[`${t}-disabled&`]:{color:i.multipleItemColorDisabled,borderColor:i.multipleItemBorderColorDisabled,cursor:"not-allowed"},"&-content":{display:"inline-block",marginInlineEnd:i.calc(i.paddingXS).div(2).equal(),overflow:"hidden",whiteSpace:"pre",textOverflow:"ellipsis"},"&-remove":Object.assign(Object.assign({},AK()),{display:"inline-flex",alignItems:"center",color:i.colorIcon,fontWeight:"bold",fontSize:10,lineHeight:"inherit",cursor:"pointer",[`> ${n}`]:{verticalAlign:"-0.2em"},"&:hover":{color:i.colorIconHover}})},[`${o}-item + ${o}-item`]:{[`${t}-selection-search`]:{marginInlineStart:0}},[`${o}-item-suffix`]:{height:"100%"},[`${t}-selection-search`]:{display:"inline-flex",position:"relative",maxWidth:"100%",marginInlineStart:i.calc(i.inputPaddingHorizontalBase).sub(s).equal(),[` &-input, &-mirror - `]:{height:r,fontFamily:i.fontFamily,lineHeight:rt(r),transition:`all ${i.motionDurationSlow}`},"&-input":{width:"100%",minWidth:4.1},"&-mirror":{position:"absolute",top:0,insetInlineStart:0,insetInlineEnd:"auto",zIndex:999,whiteSpace:"pre",visibility:"hidden"}},[`${t}-selection-placeholder`]:{position:"absolute",top:"50%",insetInlineStart:i.inputPaddingHorizontalBase,insetInlineEnd:i.inputPaddingHorizontalBase,transform:"translateY(-50%)",transition:`all ${i.motionDurationSlow}`}}}}const t$e=i=>{const{componentCls:e}=i,t=lr(i,{selectHeight:i.controlHeightSM,multipleSelectItemHeight:i.controlHeightXS,borderRadius:i.borderRadiusSM,borderRadiusSM:i.borderRadiusXS}),n=lr(i,{fontSize:i.fontSizeLG,selectHeight:i.controlHeightLG,multipleSelectItemHeight:i.multipleItemHeightLG,borderRadius:i.borderRadiusLG,borderRadiusSM:i.borderRadius});return[p6(i),p6(t,"sm"),{[`${e}-multiple${e}-sm`]:{[`${e}-selection-placeholder`]:{insetInline:i.calc(i.controlPaddingHorizontalSM).sub(i.lineWidth).equal()},[`${e}-selection-search`]:{marginInlineStart:2}}},p6(n,"lg")]};var n$e=t$e;function m6(i,e){const{componentCls:t,inputPaddingHorizontalBase:n,borderRadius:o}=i,r=i.calc(i.controlHeight).sub(i.calc(i.lineWidth).mul(2)).equal(),s=e?`${t}-${e}`:"";return{[`${t}-single${s}`]:{fontSize:i.fontSize,height:i.controlHeight,[`${t}-selector`]:Object.assign(Object.assign({},Aa(i,!0)),{display:"flex",borderRadius:o,[`${t}-selection-search`]:{position:"absolute",top:0,insetInlineStart:n,insetInlineEnd:n,bottom:0,"&-input":{width:"100%",WebkitAppearance:"textfield"}},[` + `]:{height:r,fontFamily:i.fontFamily,lineHeight:rt(r),transition:`all ${i.motionDurationSlow}`},"&-input":{width:"100%",minWidth:4.1},"&-mirror":{position:"absolute",top:0,insetInlineStart:0,insetInlineEnd:"auto",zIndex:999,whiteSpace:"pre",visibility:"hidden"}},[`${t}-selection-placeholder`]:{position:"absolute",top:"50%",insetInlineStart:i.inputPaddingHorizontalBase,insetInlineEnd:i.inputPaddingHorizontalBase,transform:"translateY(-50%)",transition:`all ${i.motionDurationSlow}`}}}}const c$e=i=>{const{componentCls:e}=i,t=lr(i,{selectHeight:i.controlHeightSM,multipleSelectItemHeight:i.controlHeightXS,borderRadius:i.borderRadiusSM,borderRadiusSM:i.borderRadiusXS}),n=lr(i,{fontSize:i.fontSizeLG,selectHeight:i.controlHeightLG,multipleSelectItemHeight:i.multipleItemHeightLG,borderRadius:i.borderRadiusLG,borderRadiusSM:i.borderRadius});return[p6(i),p6(t,"sm"),{[`${e}-multiple${e}-sm`]:{[`${e}-selection-placeholder`]:{insetInline:i.calc(i.controlPaddingHorizontalSM).sub(i.lineWidth).equal()},[`${e}-selection-search`]:{marginInlineStart:2}}},p6(n,"lg")]};var u$e=c$e;function m6(i,e){const{componentCls:t,inputPaddingHorizontalBase:n,borderRadius:o}=i,r=i.calc(i.controlHeight).sub(i.calc(i.lineWidth).mul(2)).equal(),s=e?`${t}-${e}`:"";return{[`${t}-single${s}`]:{fontSize:i.fontSize,height:i.controlHeight,[`${t}-selector`]:Object.assign(Object.assign({},Pa(i,!0)),{display:"flex",borderRadius:o,[`${t}-selection-search`]:{position:"absolute",top:0,insetInlineStart:n,insetInlineEnd:n,bottom:0,"&-input":{width:"100%",WebkitAppearance:"textfield"}},[` ${t}-selection-item, ${t}-selection-placeholder `]:{padding:0,lineHeight:rt(r),transition:`all ${i.motionDurationSlow}, visibility 0s`,alignSelf:"center"},[`${t}-selection-placeholder`]:{transition:"none",pointerEvents:"none"},[["&:after",`${t}-selection-item:empty:after`,`${t}-selection-placeholder:empty:after`].join(",")]:{display:"inline-block",width:0,visibility:"hidden",content:'"\\a0"'}}),[` &${t}-show-arrow ${t}-selection-item, &${t}-show-arrow ${t}-selection-placeholder - `]:{paddingInlineEnd:i.showArrowPaddingInlineEnd},[`&${t}-open ${t}-selection-item`]:{color:i.colorTextPlaceholder},[`&:not(${t}-customize-input)`]:{[`${t}-selector`]:{width:"100%",height:"100%",padding:`0 ${rt(n)}`,[`${t}-selection-search-input`]:{height:r},"&:after":{lineHeight:rt(r)}}},[`&${t}-customize-input`]:{[`${t}-selector`]:{"&:after":{display:"none"},[`${t}-selection-search`]:{position:"static",width:"100%"},[`${t}-selection-placeholder`]:{position:"absolute",insetInlineStart:0,insetInlineEnd:0,padding:`0 ${rt(n)}`,"&:after":{display:"none"}}}}}}}function i$e(i){const{componentCls:e}=i,t=i.calc(i.controlPaddingHorizontalSM).sub(i.lineWidth).equal();return[m6(i),m6(lr(i,{controlHeight:i.controlHeightSM,borderRadius:i.borderRadiusSM}),"sm"),{[`${e}-single${e}-sm`]:{[`&:not(${e}-customize-input)`]:{[`${e}-selection-search`]:{insetInlineStart:t,insetInlineEnd:t},[`${e}-selector`]:{padding:`0 ${rt(t)}`},[`&${e}-show-arrow ${e}-selection-search`]:{insetInlineEnd:i.calc(t).add(i.calc(i.fontSize).mul(1.5)).equal()},[` + `]:{paddingInlineEnd:i.showArrowPaddingInlineEnd},[`&${t}-open ${t}-selection-item`]:{color:i.colorTextPlaceholder},[`&:not(${t}-customize-input)`]:{[`${t}-selector`]:{width:"100%",height:"100%",padding:`0 ${rt(n)}`,[`${t}-selection-search-input`]:{height:r},"&:after":{lineHeight:rt(r)}}},[`&${t}-customize-input`]:{[`${t}-selector`]:{"&:after":{display:"none"},[`${t}-selection-search`]:{position:"static",width:"100%"},[`${t}-selection-placeholder`]:{position:"absolute",insetInlineStart:0,insetInlineEnd:0,padding:`0 ${rt(n)}`,"&:after":{display:"none"}}}}}}}function d$e(i){const{componentCls:e}=i,t=i.calc(i.controlPaddingHorizontalSM).sub(i.lineWidth).equal();return[m6(i),m6(lr(i,{controlHeight:i.controlHeightSM,borderRadius:i.borderRadiusSM}),"sm"),{[`${e}-single${e}-sm`]:{[`&:not(${e}-customize-input)`]:{[`${e}-selection-search`]:{insetInlineStart:t,insetInlineEnd:t},[`${e}-selector`]:{padding:`0 ${rt(t)}`},[`&${e}-show-arrow ${e}-selection-search`]:{insetInlineEnd:i.calc(t).add(i.calc(i.fontSize).mul(1.5)).equal()},[` &${e}-show-arrow ${e}-selection-item, &${e}-show-arrow ${e}-selection-placeholder - `]:{paddingInlineEnd:i.calc(i.fontSize).mul(1.5).equal()}}}},m6(lr(i,{controlHeight:i.singleItemHeightLG,fontSize:i.fontSizeLG,borderRadius:i.borderRadiusLG}),"lg")]}const o$e=i=>{const{fontSize:e,lineHeight:t,controlHeight:n,controlPaddingHorizontal:o,zIndexPopupBase:r,colorText:s,fontWeightStrong:a,controlItemBgActive:l,controlItemBgHover:c,colorBgContainer:u,colorFillSecondary:d,controlHeightLG:h,controlHeightSM:f,colorBgContainerDisabled:g,colorTextDisabled:p}=i;return{zIndexPopup:r+50,optionSelectedColor:s,optionSelectedFontWeight:a,optionSelectedBg:l,optionActiveBg:c,optionPadding:`${(n-e*t)/2}px ${o}px`,optionFontSize:e,optionLineHeight:t,optionHeight:n,selectorBg:u,clearBg:u,singleItemHeightLG:h,multipleItemBg:d,multipleItemBorderColor:"transparent",multipleItemHeight:f,multipleItemHeightLG:n,multipleSelectorBgDisabled:g,multipleItemColorDisabled:p,multipleItemBorderColorDisabled:"transparent",showArrowPaddingInlineEnd:Math.ceil(i.fontSize*1.25)}},Fme=(i,e)=>{const{componentCls:t,antCls:n,controlOutlineWidth:o}=i;return{[`&:not(${t}-customize-input) ${t}-selector`]:{border:`${rt(i.lineWidth)} ${i.lineType} ${e.borderColor}`,background:i.selectorBg},[`&:not(${t}-disabled):not(${t}-customize-input):not(${n}-pagination-size-changer)`]:{[`&:hover ${t}-selector`]:{borderColor:e.hoverBorderHover},[`${t}-focused& ${t}-selector`]:{borderColor:e.activeBorderColor,boxShadow:`0 0 0 ${rt(o)} ${e.activeShadowColor}`,outline:0}}}},nie=(i,e)=>({[`&${i.componentCls}-status-${e.status}`]:Object.assign({},Fme(i,e))}),r$e=i=>({"&-outlined":Object.assign(Object.assign(Object.assign(Object.assign({},Fme(i,{borderColor:i.colorBorder,hoverBorderHover:i.colorPrimaryHover,activeBorderColor:i.colorPrimary,activeShadowColor:i.controlOutline})),nie(i,{status:"error",borderColor:i.colorError,hoverBorderHover:i.colorErrorHover,activeBorderColor:i.colorError,activeShadowColor:i.colorErrorOutline})),nie(i,{status:"warning",borderColor:i.colorWarning,hoverBorderHover:i.colorWarningHover,activeBorderColor:i.colorWarning,activeShadowColor:i.colorWarningOutline})),{[`&${i.componentCls}-disabled`]:{[`&:not(${i.componentCls}-customize-input) ${i.componentCls}-selector`]:{background:i.colorBgContainerDisabled,color:i.colorTextDisabled}},[`&${i.componentCls}-multiple ${i.componentCls}-selection-item`]:{background:i.multipleItemBg,border:`${rt(i.lineWidth)} ${i.lineType} ${i.multipleItemBorderColor}`}})}),Bme=(i,e)=>{const{componentCls:t,antCls:n}=i;return{[`&:not(${t}-customize-input) ${t}-selector`]:{background:e.bg,border:`${rt(i.lineWidth)} ${i.lineType} transparent`,color:e.color},[`&:not(${t}-disabled):not(${t}-customize-input):not(${n}-pagination-size-changer)`]:{[`&:hover ${t}-selector`]:{background:e.hoverBg},[`${t}-focused& ${t}-selector`]:{background:i.selectorBg,borderColor:e.activeBorderColor,outline:0}}}},iie=(i,e)=>({[`&${i.componentCls}-status-${e.status}`]:Object.assign({},Bme(i,e))}),s$e=i=>({"&-filled":Object.assign(Object.assign(Object.assign(Object.assign({},Bme(i,{bg:i.colorFillTertiary,hoverBg:i.colorFillSecondary,activeBorderColor:i.colorPrimary,color:i.colorText})),iie(i,{status:"error",bg:i.colorErrorBg,hoverBg:i.colorErrorBgHover,activeBorderColor:i.colorError,color:i.colorError})),iie(i,{status:"warning",bg:i.colorWarningBg,hoverBg:i.colorWarningBgHover,activeBorderColor:i.colorWarning,color:i.colorWarning})),{[`&${i.componentCls}-disabled`]:{[`&:not(${i.componentCls}-customize-input) ${i.componentCls}-selector`]:{borderColor:i.colorBorder,background:i.colorBgContainerDisabled,color:i.colorTextDisabled}},[`&${i.componentCls}-multiple ${i.componentCls}-selection-item`]:{background:i.colorBgContainer,border:`${rt(i.lineWidth)} ${i.lineType} ${i.colorSplit}`}})}),a$e=i=>({"&-borderless":{[`${i.componentCls}-selector`]:{background:"transparent",borderColor:"transparent"},[`&${i.componentCls}-disabled`]:{[`&:not(${i.componentCls}-customize-input) ${i.componentCls}-selector`]:{color:i.colorTextDisabled}},[`&${i.componentCls}-multiple ${i.componentCls}-selection-item`]:{background:i.multipleItemBg,border:`${rt(i.lineWidth)} ${i.lineType} ${i.multipleItemBorderColor}`}}}),l$e=i=>({[i.componentCls]:Object.assign(Object.assign(Object.assign({},r$e(i)),s$e(i)),a$e(i))});var c$e=l$e;const u$e=i=>{const{componentCls:e}=i;return{position:"relative",transition:`all ${i.motionDurationMid} ${i.motionEaseInOut}`,input:{cursor:"pointer"},[`${e}-show-search&`]:{cursor:"text",input:{cursor:"auto",color:"inherit",height:"100%"}},[`${e}-disabled&`]:{cursor:"not-allowed",input:{cursor:"not-allowed"}}}},d$e=i=>{const{componentCls:e}=i;return{[`${e}-selection-search-input`]:{margin:0,padding:0,background:"transparent",border:"none",outline:"none",appearance:"none",fontFamily:"inherit","&::-webkit-search-cancel-button":{display:"none","-webkit-appearance":"none"}}}},h$e=i=>{const{antCls:e,componentCls:t,inputPaddingHorizontalBase:n,iconCls:o}=i;return{[t]:Object.assign(Object.assign({},Aa(i)),{position:"relative",display:"inline-block",cursor:"pointer",[`&:not(${t}-customize-input) ${t}-selector`]:Object.assign(Object.assign({},u$e(i)),d$e(i)),[`${t}-selection-item`]:Object.assign(Object.assign({flex:1,fontWeight:"normal",position:"relative",userSelect:"none"},vA),{[`> ${e}-typography`]:{display:"inline"}}),[`${t}-selection-placeholder`]:Object.assign(Object.assign({},vA),{flex:1,color:i.colorTextPlaceholder,pointerEvents:"none"}),[`${t}-arrow`]:Object.assign(Object.assign({},TK()),{position:"absolute",top:"50%",insetInlineStart:"auto",insetInlineEnd:n,height:i.fontSizeIcon,marginTop:i.calc(i.fontSizeIcon).mul(-1).div(2).equal(),color:i.colorTextQuaternary,fontSize:i.fontSizeIcon,lineHeight:1,textAlign:"center",pointerEvents:"none",display:"flex",alignItems:"center",transition:`opacity ${i.motionDurationSlow} ease`,[o]:{verticalAlign:"top",transition:`transform ${i.motionDurationSlow}`,"> svg":{verticalAlign:"top"},[`&:not(${t}-suffix)`]:{pointerEvents:"auto"}},[`${t}-disabled &`]:{cursor:"not-allowed"},"> *:not(:last-child)":{marginInlineEnd:8}}),[`${t}-clear`]:{position:"absolute",top:"50%",insetInlineStart:"auto",insetInlineEnd:n,zIndex:1,display:"inline-block",width:i.fontSizeIcon,height:i.fontSizeIcon,marginTop:i.calc(i.fontSizeIcon).mul(-1).div(2).equal(),color:i.colorTextQuaternary,fontSize:i.fontSizeIcon,fontStyle:"normal",lineHeight:1,textAlign:"center",textTransform:"none",cursor:"pointer",opacity:0,transition:`color ${i.motionDurationMid} ease, opacity ${i.motionDurationSlow} ease`,textRendering:"auto","&:before":{display:"block"},"&:hover":{color:i.colorTextTertiary}},"&:hover":{[`${t}-clear`]:{opacity:1},[`${t}-arrow:not(:last-child)`]:{opacity:0}}}),[`${t}-has-feedback`]:{[`${t}-clear`]:{insetInlineEnd:i.calc(n).add(i.fontSize).add(i.paddingXS).equal()}}}},f$e=i=>{const{componentCls:e}=i;return[{[e]:{[`&${e}-in-form-item`]:{width:"100%"}}},h$e(i),i$e(i),n$e(i),JHe(i),{[`${e}-rtl`]:{direction:"rtl"}},KK(i,{borderElCls:`${e}-selector`,focusElCls:`${e}-focused`})]};var g$e=Uc("Select",(i,e)=>{let{rootPrefixCls:t}=e;const n=lr(i,{rootPrefixCls:t,inputPaddingHorizontalBase:i.calc(i.paddingSM).sub(1).equal(),multipleSelectItemHeight:i.multipleItemHeight,selectHeight:i.controlHeight});return[f$e(n),c$e(n)]},o$e,{unitless:{optionLineHeight:!0,optionSelectedFontWeight:!0}}),p$e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M912 190h-69.9c-9.8 0-19.1 4.5-25.1 12.2L404.7 724.5 207 474a32 32 0 00-25.1-12.2H112c-6.7 0-10.4 7.7-6.3 12.9l273.9 347c12.8 16.2 37.4 16.2 50.3 0l488.4-618.9c4.1-5.1.4-12.8-6.3-12.8z"}}]},name:"check",theme:"outlined"},m$e=p$e,v$e=function(e,t){return x.exports.createElement(cr,Ct({},e,{ref:t,icon:m$e}))},_$e=x.exports.forwardRef(v$e),b$e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z"}}]},name:"down",theme:"outlined"},C$e=b$e,w$e=function(e,t){return x.exports.createElement(cr,Ct({},e,{ref:t,icon:C$e}))},y$e=x.exports.forwardRef(w$e),S$e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M909.6 854.5L649.9 594.8C690.2 542.7 712 479 712 412c0-80.2-31.3-155.4-87.9-212.1-56.6-56.7-132-87.9-212.1-87.9s-155.5 31.3-212.1 87.9C143.2 256.5 112 331.8 112 412c0 80.1 31.3 155.5 87.9 212.1C256.5 680.8 331.8 712 412 712c67 0 130.6-21.8 182.7-62l259.7 259.6a8.2 8.2 0 0011.6 0l43.6-43.5a8.2 8.2 0 000-11.6zM570.4 570.4C528 612.7 471.8 636 412 636s-116-23.3-158.4-65.6C211.3 528 188 471.8 188 412s23.3-116.1 65.6-158.4C296 211.3 352.2 188 412 188s116.1 23.2 158.4 65.6S636 352.2 636 412s-23.3 116.1-65.6 158.4z"}}]},name:"search",theme:"outlined"},x$e=S$e,L$e=function(e,t){return x.exports.createElement(cr,Ct({},e,{ref:t,icon:x$e}))},Wme=x.exports.forwardRef(L$e);function E$e(i){let{suffixIcon:e,clearIcon:t,menuItemSelectedIcon:n,removeIcon:o,loading:r,multiple:s,hasFeedback:a,prefixCls:l,showSuffixIcon:c,feedbackIcon:u,showArrow:d,componentName:h}=i;const f=t!=null?t:x.exports.createElement(lS,null),g=_=>e===null&&!a&&!d?null:x.exports.createElement(x.exports.Fragment,null,c!==!1&&_,a&&u);let p=null;if(e!==void 0)p=g(e);else if(r)p=g(x.exports.createElement(xI,{spin:!0}));else{const _=`${l}-suffix`;p=w=>{let{open:y,showSearch:L}=w;return g(y&&L?x.exports.createElement(Wme,{className:_}):x.exports.createElement(y$e,{className:_}))}}let v=null;n!==void 0?v=n:s?v=x.exports.createElement(_$e,null):v=null;let m=null;return o!==void 0?m=o:m=x.exports.createElement(cS,null),{clearIcon:f,suffixIcon:p,itemIcon:v,removeIcon:m}}function D$e(i,e){return e!==void 0?e:i!==null}var k$e=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(i);o{var t;const{prefixCls:n,bordered:o,className:r,rootClassName:s,getPopupContainer:a,popupClassName:l,dropdownClassName:c,listHeight:u=256,placement:d,listItemHeight:h,size:f,disabled:g,notFoundContent:p,status:v,builtinPlacements:m,dropdownMatchSelectWidth:_,popupMatchSelectWidth:w,direction:y,style:L,allowClear:D,variant:E,dropdownStyle:I,transitionName:k,tagRender:R,maxCount:A}=i,P=k$e(i,["prefixCls","bordered","className","rootClassName","getPopupContainer","popupClassName","dropdownClassName","listHeight","placement","listItemHeight","size","disabled","notFoundContent","status","builtinPlacements","dropdownMatchSelectWidth","popupMatchSelectWidth","direction","style","allowClear","variant","dropdownStyle","transitionName","tagRender","maxCount"]),{getPopupContainer:N,getPrefixCls:M,renderEmpty:H,direction:W,virtual:F,popupMatchSelectWidth:$,popupOverflow:z,select:K}=x.exports.useContext(Hi),[,j]=Fa(),G=h!=null?h:j==null?void 0:j.controlHeight,X=M("select",n),de=M(),he=y!=null?y:W,{compactSize:pe,compactItemClassnames:be}=k4(X,he),[Se,Fe]=lq(E,o),De=th(X),[ce,Pe,Oe]=g$e(X,De),xe=x.exports.useMemo(()=>{const{mode:Ot}=i;if(Ot!=="combobox")return Ot===Vme?"combobox":Ot},[i.mode]),Ee=xe==="multiple"||xe==="tags",tt=D$e(i.suffixIcon,i.showArrow),nt=(t=w!=null?w:_)!==null&&t!==void 0?t:$,{status:Qe,hasFeedback:Ge,isFormItemInput:re,feedbackIcon:ie}=x.exports.useContext(zd),se=sq(Qe,v);let U;p!==void 0?U=p:xe==="combobox"?U=null:U=(H==null?void 0:H("Select"))||x.exports.createElement(KHe,{componentName:"Select"});const{suffixIcon:Y,itemIcon:oe,removeIcon:te,clearIcon:we}=E$e(Object.assign(Object.assign({},P),{multiple:Ee,hasFeedback:Ge,feedbackIcon:ie,showSuffixIcon:tt,prefixCls:X,componentName:"Select"})),Le=D===!0?{clearIcon:we}:D,Te=Df(P,["suffixIcon","itemIcon"]),We=Ue(l||c,{[`${X}-dropdown-${he}`]:he==="rtl"},s,Oe,De,Pe),je=Pb(Ot=>{var Vn;return(Vn=f!=null?f:pe)!==null&&Vn!==void 0?Vn:Ot}),mt=x.exports.useContext(aS),Et=g!=null?g:mt,At=Ue({[`${X}-lg`]:je==="large",[`${X}-sm`]:je==="small",[`${X}-rtl`]:he==="rtl",[`${X}-${Se}`]:Fe,[`${X}-in-form-item`]:re},LA(X,se,Ge),be,K==null?void 0:K.className,r,s,Oe,De,Pe),Je=x.exports.useMemo(()=>d!==void 0?d:he==="rtl"?"bottomRight":"bottomLeft",[d,he]),[xt]=HK("SelectLike",I==null?void 0:I.zIndex);return ce(x.exports.createElement(rq,Object.assign({ref:e,virtual:F,showSearch:K==null?void 0:K.showSearch},Te,{style:Object.assign(Object.assign({},K==null?void 0:K.style),L),dropdownMatchSelectWidth:nt,transitionName:U0(de,"slide-up",k),builtinPlacements:YHe(m,z),listHeight:u,listItemHeight:G,mode:xe,prefixCls:X,placement:Je,direction:he,suffixIcon:Y,menuItemSelectedIcon:oe,removeIcon:te,allowClear:Le,notFoundContent:U,className:At,getPopupContainer:a||N,dropdownClassName:We,disabled:Et,dropdownStyle:Object.assign(Object.assign({},I),{zIndex:xt}),maxCount:Ee?A:void 0,tagRender:Ee?R:void 0})))},dS=x.exports.forwardRef(I$e),T$e=lVe(dS);dS.SECRET_COMBOBOX_MODE_DO_NOT_USE=Vme;dS.Option=iq;dS.OptGroup=nq;dS._InternalPanelDoNotUseOrYouWillBeFired=T$e;var N$e=dS;const vD=["xxl","xl","lg","md","sm","xs"],R$e=i=>({xs:`(max-width: ${i.screenXSMax}px)`,sm:`(min-width: ${i.screenSM}px)`,md:`(min-width: ${i.screenMD}px)`,lg:`(min-width: ${i.screenLG}px)`,xl:`(min-width: ${i.screenXL}px)`,xxl:`(min-width: ${i.screenXXL}px)`}),M$e=i=>{const e=i,t=[].concat(vD).reverse();return t.forEach((n,o)=>{const r=n.toUpperCase(),s=`screen${r}Min`,a=`screen${r}`;if(!(e[s]<=e[a]))throw new Error(`${s}<=${a} fails : !(${e[s]}<=${e[a]})`);if(o{const t=new Map;let n=-1,o={};return{matchHandlers:{},dispatch(r){return o=r,t.forEach(s=>s(o)),t.size>=1},subscribe(r){return t.size||this.register(),n+=1,t.set(n,r),r(o),n},unsubscribe(r){t.delete(r),t.size||this.unregister()},unregister(){Object.keys(e).forEach(r=>{const s=e[r],a=this.matchHandlers[s];a==null||a.mql.removeListener(a==null?void 0:a.listener)}),t.clear()},register(){Object.keys(e).forEach(r=>{const s=e[r],a=c=>{let{matches:u}=c;this.dispatch(Object.assign(Object.assign({},o),{[r]:u}))},l=window.matchMedia(s);l.addListener(a),this.matchHandlers[s]={mql:l,listener:a},a(l)})},responsiveMap:e}},[i])}function Hme(i){var e=i.children,t=i.prefixCls,n=i.id,o=i.overlayInnerStyle,r=i.className,s=i.style;return x.exports.createElement("div",{className:Ue("".concat(t,"-content"),r),style:s},x.exports.createElement("div",{className:"".concat(t,"-inner"),id:n,role:"tooltip",style:o},typeof e=="function"?e():e))}var N1={shiftX:64,adjustY:1},R1={adjustX:1,shiftY:!0},lu=[0,0],P$e={left:{points:["cr","cl"],overflow:R1,offset:[-4,0],targetOffset:lu},right:{points:["cl","cr"],overflow:R1,offset:[4,0],targetOffset:lu},top:{points:["bc","tc"],overflow:N1,offset:[0,-4],targetOffset:lu},bottom:{points:["tc","bc"],overflow:N1,offset:[0,4],targetOffset:lu},topLeft:{points:["bl","tl"],overflow:N1,offset:[0,-4],targetOffset:lu},leftTop:{points:["tr","tl"],overflow:R1,offset:[-4,0],targetOffset:lu},topRight:{points:["br","tr"],overflow:N1,offset:[0,-4],targetOffset:lu},rightTop:{points:["tl","tr"],overflow:R1,offset:[4,0],targetOffset:lu},bottomRight:{points:["tr","br"],overflow:N1,offset:[0,4],targetOffset:lu},rightBottom:{points:["bl","br"],overflow:R1,offset:[4,0],targetOffset:lu},bottomLeft:{points:["tl","bl"],overflow:N1,offset:[0,4],targetOffset:lu},leftBottom:{points:["br","bl"],overflow:R1,offset:[-4,0],targetOffset:lu}},O$e=["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","motion","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle","arrowContent","overlay","id","showArrow"],F$e=function(e,t){var n=e.overlayClassName,o=e.trigger,r=o===void 0?["hover"]:o,s=e.mouseEnterDelay,a=s===void 0?0:s,l=e.mouseLeaveDelay,c=l===void 0?.1:l,u=e.overlayStyle,d=e.prefixCls,h=d===void 0?"rc-tooltip":d,f=e.children,g=e.onVisibleChange,p=e.afterVisibleChange,v=e.transitionName,m=e.animation,_=e.motion,w=e.placement,y=w===void 0?"right":w,L=e.align,D=L===void 0?{}:L,E=e.destroyTooltipOnHide,I=E===void 0?!1:E,k=e.defaultVisible,R=e.getTooltipContainer,A=e.overlayInnerStyle;e.arrowContent;var P=e.overlay,N=e.id,M=e.showArrow,H=M===void 0?!0:M,W=Hn(e,O$e),F=x.exports.useRef(null);x.exports.useImperativeHandle(t,function(){return F.current});var $=Ce({},W);"visible"in e&&($.popupVisible=e.visible);var z=function(){return x.exports.createElement(Hme,{key:"content",prefixCls:h,id:N,overlayInnerStyle:A},P)};return x.exports.createElement(N4,Ct({popupClassName:n,prefixCls:h,popup:z,action:r,builtinPlacements:P$e,popupPlacement:y,ref:F,popupAlign:D,getPopupContainer:R,onPopupVisibleChange:g,afterPopupVisibleChange:p,popupTransitionName:v,popupAnimation:m,popupMotion:_,defaultPopupVisible:k,autoDestroy:I,mouseLeaveDelay:c,popupStyle:u,mouseEnterDelay:a,arrow:H},$),f)},B$e=x.exports.forwardRef(F$e);function W$e(i){const{sizePopupArrow:e,borderRadiusXS:t,borderRadiusOuter:n}=i,o=e/2,r=0,s=o,a=n*1/Math.sqrt(2),l=o-n*(1-1/Math.sqrt(2)),c=o-t*(1/Math.sqrt(2)),u=n*(Math.sqrt(2)-1)+t*(1/Math.sqrt(2)),d=2*o-c,h=u,f=2*o-a,g=l,p=2*o-r,v=s,m=o*Math.sqrt(2)+n*(Math.sqrt(2)-2),_=n*(Math.sqrt(2)-1),w=`polygon(${_}px 100%, 50% ${_}px, ${2*o-_}px 100%, ${_}px 100%)`,y=`path('M ${r} ${s} A ${n} ${n} 0 0 0 ${a} ${l} L ${c} ${u} A ${t} ${t} 0 0 1 ${d} ${h} L ${f} ${g} A ${n} ${n} 0 0 0 ${p} ${v} Z')`;return{arrowShadowWidth:m,arrowPath:y,arrowPolygon:w}}const V$e=(i,e,t)=>{const{sizePopupArrow:n,arrowPolygon:o,arrowPath:r,arrowShadowWidth:s,borderRadiusXS:a,calc:l}=i;return{pointerEvents:"none",width:n,height:n,overflow:"hidden","&::before":{position:"absolute",bottom:0,insetInlineStart:0,width:n,height:l(n).div(2).equal(),background:e,clipPath:{_multi_value_:!0,value:[o,r]},content:'""'},"&::after":{content:'""',position:"absolute",width:s,height:s,bottom:0,insetInline:0,margin:"auto",borderRadius:{_skip_check_:!0,value:`0 0 ${rt(a)} 0`},transform:"translateY(50%) rotate(-135deg)",boxShadow:t,zIndex:0,background:"transparent"}}},$me=8;function zme(i){const{contentRadius:e,limitVerticalRadius:t}=i,n=e>12?e+2:12;return{arrowOffsetHorizontal:n,arrowOffsetVertical:t?$me:n}}function qN(i,e){return i?e:{}}function H$e(i,e,t){const{componentCls:n,boxShadowPopoverArrow:o,arrowOffsetVertical:r,arrowOffsetHorizontal:s}=i,{arrowDistance:a=0,arrowPlacement:l={left:!0,right:!0,top:!0,bottom:!0}}=t||{};return{[n]:Object.assign(Object.assign(Object.assign(Object.assign({[`${n}-arrow`]:[Object.assign(Object.assign({position:"absolute",zIndex:1,display:"block"},V$e(i,e,o)),{"&:before":{background:e}})]},qN(!!l.top,{[[`&-placement-top > ${n}-arrow`,`&-placement-topLeft > ${n}-arrow`,`&-placement-topRight > ${n}-arrow`].join(",")]:{bottom:a,transform:"translateY(100%) rotate(180deg)"},[`&-placement-top > ${n}-arrow`]:{left:{_skip_check_:!0,value:"50%"},transform:"translateX(-50%) translateY(100%) rotate(180deg)"},[`&-placement-topLeft > ${n}-arrow`]:{left:{_skip_check_:!0,value:s}},[`&-placement-topRight > ${n}-arrow`]:{right:{_skip_check_:!0,value:s}}})),qN(!!l.bottom,{[[`&-placement-bottom > ${n}-arrow`,`&-placement-bottomLeft > ${n}-arrow`,`&-placement-bottomRight > ${n}-arrow`].join(",")]:{top:a,transform:"translateY(-100%)"},[`&-placement-bottom > ${n}-arrow`]:{left:{_skip_check_:!0,value:"50%"},transform:"translateX(-50%) translateY(-100%)"},[`&-placement-bottomLeft > ${n}-arrow`]:{left:{_skip_check_:!0,value:s}},[`&-placement-bottomRight > ${n}-arrow`]:{right:{_skip_check_:!0,value:s}}})),qN(!!l.left,{[[`&-placement-left > ${n}-arrow`,`&-placement-leftTop > ${n}-arrow`,`&-placement-leftBottom > ${n}-arrow`].join(",")]:{right:{_skip_check_:!0,value:a},transform:"translateX(100%) rotate(90deg)"},[`&-placement-left > ${n}-arrow`]:{top:{_skip_check_:!0,value:"50%"},transform:"translateY(-50%) translateX(100%) rotate(90deg)"},[`&-placement-leftTop > ${n}-arrow`]:{top:r},[`&-placement-leftBottom > ${n}-arrow`]:{bottom:r}})),qN(!!l.right,{[[`&-placement-right > ${n}-arrow`,`&-placement-rightTop > ${n}-arrow`,`&-placement-rightBottom > ${n}-arrow`].join(",")]:{left:{_skip_check_:!0,value:a},transform:"translateX(-100%) rotate(-90deg)"},[`&-placement-right > ${n}-arrow`]:{top:{_skip_check_:!0,value:"50%"},transform:"translateY(-50%) translateX(-100%) rotate(-90deg)"},[`&-placement-rightTop > ${n}-arrow`]:{top:r},[`&-placement-rightBottom > ${n}-arrow`]:{bottom:r}}))}}function $$e(i,e,t,n){if(n===!1)return{adjustX:!1,adjustY:!1};const o=n&&typeof n=="object"?n:{},r={};switch(i){case"top":case"bottom":r.shiftX=e.arrowOffsetHorizontal*2+t,r.shiftY=!0,r.adjustY=!0;break;case"left":case"right":r.shiftY=e.arrowOffsetVertical*2+t,r.shiftX=!0,r.adjustX=!0;break}const s=Object.assign(Object.assign({},r),o);return s.shiftX||(s.adjustX=!0),s.shiftY||(s.adjustY=!0),s}const oie={left:{points:["cr","cl"]},right:{points:["cl","cr"]},top:{points:["bc","tc"]},bottom:{points:["tc","bc"]},topLeft:{points:["bl","tl"]},leftTop:{points:["tr","tl"]},topRight:{points:["br","tr"]},rightTop:{points:["tl","tr"]},bottomRight:{points:["tr","br"]},rightBottom:{points:["bl","br"]},bottomLeft:{points:["tl","bl"]},leftBottom:{points:["br","bl"]}},z$e={topLeft:{points:["bl","tc"]},leftTop:{points:["tr","cl"]},topRight:{points:["br","tc"]},rightTop:{points:["tl","cr"]},bottomRight:{points:["tr","bc"]},rightBottom:{points:["bl","cr"]},bottomLeft:{points:["tl","bc"]},leftBottom:{points:["br","cl"]}},U$e=new Set(["topLeft","topRight","bottomLeft","bottomRight","leftTop","leftBottom","rightTop","rightBottom"]);function j$e(i){const{arrowWidth:e,autoAdjustOverflow:t,arrowPointAtCenter:n,offset:o,borderRadius:r,visibleFirst:s}=i,a=e/2,l={};return Object.keys(oie).forEach(c=>{const u=n&&z$e[c]||oie[c],d=Object.assign(Object.assign({},u),{offset:[0,0],dynamicInset:!0});switch(l[c]=d,U$e.has(c)&&(d.autoArrow=!1),c){case"top":case"topLeft":case"topRight":d.offset[1]=-a-o;break;case"bottom":case"bottomLeft":case"bottomRight":d.offset[1]=a+o;break;case"left":case"leftTop":case"leftBottom":d.offset[0]=-a-o;break;case"right":case"rightTop":case"rightBottom":d.offset[0]=a+o;break}const h=zme({contentRadius:r,limitVerticalRadius:!0});if(n)switch(c){case"topLeft":case"bottomLeft":d.offset[0]=-h.arrowOffsetHorizontal-a;break;case"topRight":case"bottomRight":d.offset[0]=h.arrowOffsetHorizontal+a;break;case"leftTop":case"rightTop":d.offset[1]=-h.arrowOffsetHorizontal-a;break;case"leftBottom":case"rightBottom":d.offset[1]=h.arrowOffsetHorizontal+a;break}d.overflow=$$e(c,h,e,t),s&&(d.htmlRegion="visibleFirst")}),l}const K$e=i=>{const{componentCls:e,tooltipMaxWidth:t,tooltipColor:n,tooltipBg:o,tooltipBorderRadius:r,zIndexPopup:s,controlHeight:a,boxShadowSecondary:l,paddingSM:c,paddingXS:u}=i;return[{[e]:Object.assign(Object.assign(Object.assign(Object.assign({},Aa(i)),{position:"absolute",zIndex:s,display:"block",width:"max-content",maxWidth:t,visibility:"visible",transformOrigin:"var(--arrow-x, 50%) var(--arrow-y, 50%)","&-hidden":{display:"none"},"--antd-arrow-background-color":o,[`${e}-inner`]:{minWidth:a,minHeight:a,padding:`${rt(i.calc(c).div(2).equal())} ${rt(u)}`,color:n,textAlign:"start",textDecoration:"none",wordWrap:"break-word",backgroundColor:o,borderRadius:r,boxShadow:l,boxSizing:"border-box"},[["&-placement-left","&-placement-leftTop","&-placement-leftBottom","&-placement-right","&-placement-rightTop","&-placement-rightBottom"].join(",")]:{[`${e}-inner`]:{borderRadius:i.min(r,$me)}},[`${e}-content`]:{position:"relative"}}),o6e(i,(d,h)=>{let{darkColor:f}=h;return{[`&${e}-${d}`]:{[`${e}-inner`]:{backgroundColor:f},[`${e}-arrow`]:{"--antd-arrow-background-color":f}}}})),{"&-rtl":{direction:"rtl"}})},H$e(i,"var(--antd-arrow-background-color)"),{[`${e}-pure`]:{position:"relative",maxWidth:"none",margin:i.sizePopupArrow}}]},q$e=i=>Object.assign(Object.assign({zIndexPopup:i.zIndexPopupBase+70},zme({contentRadius:i.borderRadius,limitVerticalRadius:!0})),W$e(lr(i,{borderRadiusOuter:Math.min(i.borderRadiusOuter,4)})));var Ume=function(i){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return Uc("Tooltip",n=>{const{borderRadius:o,colorTextLightSolid:r,colorBgSpotlight:s}=n,a=lr(n,{tooltipMaxWidth:250,tooltipColor:r,tooltipBorderRadius:o,tooltipBg:s});return[K$e(a),ame(n,"zoom-big-fast")]},q$e,{resetStyle:!1,injectStyle:e})(i)};const G$e=mA.map(i=>`${i}-inverse`);function X$e(i){return(arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0)?[].concat(_t(G$e),_t(mA)).includes(i):mA.includes(i)}function jme(i,e){const t=X$e(e),n=Ue({[`${i}-${e}`]:e&&t}),o={},r={};return e&&!t&&(o.background=e,r["--antd-arrow-background-color"]=e),{className:n,overlayStyle:o,arrowStyle:r}}const Y$e=i=>{const{prefixCls:e,className:t,placement:n="top",title:o,color:r,overlayInnerStyle:s}=i,{getPrefixCls:a}=x.exports.useContext(Hi),l=a("tooltip",e),[c,u,d]=Ume(l),h=jme(l,r),f=h.arrowStyle,g=Object.assign(Object.assign({},s),h.overlayStyle),p=Ue(u,d,l,`${l}-pure`,`${l}-placement-${n}`,t,h.className);return c(x.exports.createElement("div",{className:p,style:f},x.exports.createElement("div",{className:`${l}-arrow`}),x.exports.createElement(Hme,Object.assign({},i,{className:u,prefixCls:l,overlayInnerStyle:g}),o)))};var Z$e=Y$e,Q$e=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(i);o{var t,n;const{prefixCls:o,openClassName:r,getTooltipContainer:s,overlayClassName:a,color:l,overlayInnerStyle:c,children:u,afterOpenChange:d,afterVisibleChange:h,destroyTooltipOnHide:f,arrow:g=!0,title:p,overlay:v,builtinPlacements:m,arrowPointAtCenter:_=!1,autoAdjustOverflow:w=!0}=i,y=!!g,[,L]=Fa(),{getPopupContainer:D,getPrefixCls:E,direction:I}=x.exports.useContext(Hi),k=y4(),R=x.exports.useRef(null),A=()=>{var U;(U=R.current)===null||U===void 0||U.forceAlign()};x.exports.useImperativeHandle(e,()=>({forceAlign:A,forcePopupAlign:()=>{k.deprecated(!1,"forcePopupAlign","forceAlign"),A()}}));const[P,N]=jl(!1,{value:(t=i.open)!==null&&t!==void 0?t:i.visible,defaultValue:(n=i.defaultOpen)!==null&&n!==void 0?n:i.defaultVisible}),M=!p&&!v&&p!==0,H=U=>{var Y,oe;N(M?!1:U),M||((Y=i.onOpenChange)===null||Y===void 0||Y.call(i,U),(oe=i.onVisibleChange)===null||oe===void 0||oe.call(i,U))},W=x.exports.useMemo(()=>{var U,Y;let oe=_;return typeof g=="object"&&(oe=(Y=(U=g.pointAtCenter)!==null&&U!==void 0?U:g.arrowPointAtCenter)!==null&&Y!==void 0?Y:_),m||j$e({arrowPointAtCenter:oe,autoAdjustOverflow:w,arrowWidth:y?L.sizePopupArrow:0,borderRadius:L.borderRadius,offset:L.marginXXS,visibleFirst:!0})},[_,g,m,L]),F=x.exports.useMemo(()=>p===0?p:v||p||"",[v,p]),$=x.exports.createElement(wA,null,typeof F=="function"?F():F),{getPopupContainer:z,placement:K="top",mouseEnterDelay:j=.1,mouseLeaveDelay:G=.1,overlayStyle:X,rootClassName:de}=i,he=Q$e(i,["getPopupContainer","placement","mouseEnterDelay","mouseLeaveDelay","overlayStyle","rootClassName"]),pe=E("tooltip",o),be=E(),Se=i["data-popover-inject"];let Fe=P;!("open"in i)&&!("visible"in i)&&M&&(Fe=!1);const De=sy(u)&&!Cpe(u)?u:x.exports.createElement("span",null,u),ce=De.props,Pe=!ce.className||typeof ce.className=="string"?Ue(ce.className,r||`${pe}-open`):ce.className,[Oe,xe,Ee]=Ume(pe,!Se),tt=jme(pe,l),nt=tt.arrowStyle,Qe=Object.assign(Object.assign({},c),tt.overlayStyle),Ge=Ue(a,{[`${pe}-rtl`]:I==="rtl"},tt.className,de,xe,Ee),[re,ie]=HK("Tooltip",he.zIndex),se=x.exports.createElement(B$e,Object.assign({},he,{zIndex:re,showArrow:y,placement:K,mouseEnterDelay:j,mouseLeaveDelay:G,prefixCls:pe,overlayClassName:Ge,overlayStyle:Object.assign(Object.assign({},nt),X),getTooltipContainer:z||s||D,ref:R,builtinPlacements:W,overlay:$,visible:Fe,onVisibleChange:H,afterVisibleChange:d!=null?d:h,overlayInnerStyle:Qe,arrowContent:x.exports.createElement("span",{className:`${pe}-arrow-content`}),motion:{motionName:U0(be,"zoom-big-fast",i.transitionName),motionDeadline:1e3},destroyTooltipOnHide:!!f}),Fe?pv(De,{className:Pe}):De);return Oe(x.exports.createElement(WK.Provider,{value:ie},se))});Kme._InternalPanelDoNotUseOrYouWillBeFired=Z$e;var J$e=Kme,eze=at.ESC,tze=at.TAB;function nze(i){var e=i.visible,t=i.triggerRef,n=i.onVisibleChange,o=i.autoFocus,r=i.overlayRef,s=x.exports.useRef(!1),a=function(){if(e){var d,h;(d=t.current)===null||d===void 0||(h=d.focus)===null||h===void 0||h.call(d),n==null||n(!1)}},l=function(){var d;return(d=r.current)!==null&&d!==void 0&&d.focus?(r.current.focus(),s.current=!0,!0):!1},c=function(d){switch(d.keyCode){case eze:a();break;case tze:{var h=!1;s.current||(h=l()),h?d.preventDefault():a();break}}};x.exports.useEffect(function(){return e?(window.addEventListener("keydown",c),o&&Xi(l,3),function(){window.removeEventListener("keydown",c),s.current=!1}):function(){s.current=!1}},[e])}var ize=x.exports.forwardRef(function(i,e){var t=i.overlay,n=i.arrow,o=i.prefixCls,r=x.exports.useMemo(function(){var a;return typeof t=="function"?a=t():a=t,a},[t]),s=Jd(e,r==null?void 0:r.ref);return vn(Ds,{children:[n&&fe("div",{className:"".concat(o,"-arrow")}),Bt.cloneElement(r,{ref:jv(r)?s:void 0})]})}),M1={adjustX:1,adjustY:1},A1=[0,0],oze={topLeft:{points:["bl","tl"],overflow:M1,offset:[0,-4],targetOffset:A1},top:{points:["bc","tc"],overflow:M1,offset:[0,-4],targetOffset:A1},topRight:{points:["br","tr"],overflow:M1,offset:[0,-4],targetOffset:A1},bottomLeft:{points:["tl","bl"],overflow:M1,offset:[0,4],targetOffset:A1},bottom:{points:["tc","bc"],overflow:M1,offset:[0,4],targetOffset:A1},bottomRight:{points:["tr","br"],overflow:M1,offset:[0,4],targetOffset:A1}},rze=["arrow","prefixCls","transitionName","animation","align","placement","placements","getPopupContainer","showAction","hideAction","overlayClassName","overlayStyle","visible","trigger","autoFocus","overlay","children","onVisibleChange"];function sze(i,e){var t,n=i.arrow,o=n===void 0?!1:n,r=i.prefixCls,s=r===void 0?"rc-dropdown":r,a=i.transitionName,l=i.animation,c=i.align,u=i.placement,d=u===void 0?"bottomLeft":u,h=i.placements,f=h===void 0?oze:h,g=i.getPopupContainer,p=i.showAction,v=i.hideAction,m=i.overlayClassName,_=i.overlayStyle,w=i.visible,y=i.trigger,L=y===void 0?["hover"]:y,D=i.autoFocus,E=i.overlay,I=i.children,k=i.onVisibleChange,R=Hn(i,rze),A=Bt.useState(),P=Ne(A,2),N=P[0],M=P[1],H="visible"in i?w:N,W=Bt.useRef(null),F=Bt.useRef(null),$=Bt.useRef(null);Bt.useImperativeHandle(e,function(){return W.current});var z=function(Se){M(Se),k==null||k(Se)};nze({visible:H,triggerRef:$,onVisibleChange:z,autoFocus:D,overlayRef:F});var K=function(Se){var Fe=i.onOverlayClick;M(!1),Fe&&Fe(Se)},j=function(){return Bt.createElement(ize,{ref:F,overlay:E,prefixCls:s,arrow:o})},G=function(){return typeof E=="function"?j:j()},X=function(){var Se=i.minOverlayWidthMatchTrigger,Fe=i.alignPoint;return"minOverlayWidthMatchTrigger"in i?Se:!Fe},de=function(){var Se=i.openClassName;return Se!==void 0?Se:"".concat(s,"-open")},he=Bt.cloneElement(I,{className:Ue((t=I.props)===null||t===void 0?void 0:t.className,H&&de()),ref:jv(I)?Jd($,I.ref):void 0}),pe=v;return!pe&&L.indexOf("contextMenu")!==-1&&(pe=["click"]),Bt.createElement(N4,Ct({builtinPlacements:f},R,{prefixCls:s,ref:W,popupClassName:Ue(m,me({},"".concat(s,"-show-arrow"),o)),popupStyle:_,action:L,showAction:p,hideAction:pe,popupPlacement:d,popupAlign:c,popupTransitionName:a,popupAnimation:l,popupVisible:H,stretch:X()?"minWidth":"",popup:G(),onPopupVisibleChange:z,onPopupClick:K,getPopupContainer:g}),he)}var aze=Bt.forwardRef(sze),qme=x.exports.createContext(null);function Gme(i,e){return i===void 0?null:"".concat(i,"-").concat(e)}function Xme(i){var e=x.exports.useContext(qme);return Gme(e,i)}var lze=["children","locked"],Ud=x.exports.createContext(null);function cze(i,e){var t=Ce({},i);return Object.keys(e).forEach(function(n){var o=e[n];o!==void 0&&(t[n]=o)}),t}function _D(i){var e=i.children,t=i.locked,n=Hn(i,lze),o=x.exports.useContext(Ud),r=wI(function(){return cze(o,n)},[o,n],function(s,a){return!t&&(s[0]!==a[0]||!_4(s[1],a[1],!0))});return x.exports.createElement(Ud.Provider,{value:r},e)}var uze=[],Yme=x.exports.createContext(null);function R4(){return x.exports.useContext(Yme)}var Zme=x.exports.createContext(uze);function TI(i){var e=x.exports.useContext(Zme);return x.exports.useMemo(function(){return i!==void 0?[].concat(_t(e),[i]):e},[e,i])}var Qme=x.exports.createContext(null),cq=x.exports.createContext({});function rie(i){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(D4(i)){var t=i.nodeName.toLowerCase(),n=["input","select","textarea","button"].includes(t)||i.isContentEditable||t==="a"&&!!i.getAttribute("href"),o=i.getAttribute("tabindex"),r=Number(o),s=null;return o&&!Number.isNaN(r)?s=r:n&&s===null&&(s=0),n&&i.disabled&&(s=null),s!==null&&(s>=0||e&&s<0)}return!1}function dze(i){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,t=_t(i.querySelectorAll("*")).filter(function(n){return rie(n,e)});return rie(i,e)&&t.unshift(i),t}var NW=at.LEFT,RW=at.RIGHT,MW=at.UP,zR=at.DOWN,UR=at.ENTER,Jme=at.ESC,Lx=at.HOME,Ex=at.END,sie=[MW,zR,NW,RW];function hze(i,e,t,n){var o,r,s,a,l="prev",c="next",u="children",d="parent";if(i==="inline"&&n===UR)return{inlineTrigger:!0};var h=(o={},me(o,MW,l),me(o,zR,c),o),f=(r={},me(r,NW,t?c:l),me(r,RW,t?l:c),me(r,zR,u),me(r,UR,u),r),g=(s={},me(s,MW,l),me(s,zR,c),me(s,UR,u),me(s,Jme,d),me(s,NW,t?u:d),me(s,RW,t?d:u),s),p={inline:h,horizontal:f,vertical:g,inlineSub:h,horizontalSub:g,verticalSub:g},v=(a=p["".concat(i).concat(e?"":"Sub")])===null||a===void 0?void 0:a[n];switch(v){case l:return{offset:-1,sibling:!0};case c:return{offset:1,sibling:!0};case d:return{offset:-1,sibling:!1};case u:return{offset:1,sibling:!1};default:return null}}function fze(i){for(var e=i;e;){if(e.getAttribute("data-menu-list"))return e;e=e.parentElement}return null}function gze(i,e){for(var t=i||document.activeElement;t;){if(e.has(t))return t;t=t.parentElement}return null}function uq(i,e){var t=dze(i,!0);return t.filter(function(n){return e.has(n)})}function aie(i,e,t){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1;if(!i)return null;var o=uq(i,e),r=o.length,s=o.findIndex(function(a){return t===a});return n<0?s===-1?s=r-1:s-=1:n>0&&(s+=1),s=(s+r)%r,o[s]}var AW=function(e,t){var n=new Set,o=new Map,r=new Map;return e.forEach(function(s){var a=document.querySelector("[data-menu-id='".concat(Gme(t,s),"']"));a&&(n.add(a),r.set(a,s),o.set(s,a))}),{elements:n,key2element:o,element2key:r}};function pze(i,e,t,n,o,r,s,a,l,c){var u=x.exports.useRef(),d=x.exports.useRef();d.current=e;var h=function(){Xi.cancel(u.current)};return x.exports.useEffect(function(){return function(){h()}},[]),function(f){var g=f.which;if([].concat(sie,[UR,Jme,Lx,Ex]).includes(g)){var p=r(),v=AW(p,n),m=v,_=m.elements,w=m.key2element,y=m.element2key,L=w.get(e),D=gze(L,_),E=y.get(D),I=hze(i,s(E,!0).length===1,t,g);if(!I&&g!==Lx&&g!==Ex)return;(sie.includes(g)||[Lx,Ex].includes(g))&&f.preventDefault();var k=function(F){if(F){var $=F,z=F.querySelector("a");z!=null&&z.getAttribute("href")&&($=z);var K=y.get(F);a(K),h(),u.current=Xi(function(){d.current===K&&$.focus()})}};if([Lx,Ex].includes(g)||I.sibling||!D){var R;!D||i==="inline"?R=o.current:R=fze(D);var A,P=uq(R,_);g===Lx?A=P[0]:g===Ex?A=P[P.length-1]:A=aie(R,_,D,I.offset),k(A)}else if(I.inlineTrigger)l(E);else if(I.offset>0)l(E,!0),h(),u.current=Xi(function(){v=AW(p,n);var W=D.getAttribute("aria-controls"),F=document.getElementById(W),$=aie(F,v.elements);k($)},5);else if(I.offset<0){var N=s(E,!0),M=N[N.length-2],H=w.get(M);l(M,!1),k(H)}}c==null||c(f)}}function mze(i){Promise.resolve().then(i)}var dq="__RC_UTIL_PATH_SPLIT__",lie=function(e){return e.join(dq)},vze=function(e){return e.split(dq)},PW="rc-menu-more";function _ze(){var i=x.exports.useState({}),e=Ne(i,2),t=e[1],n=x.exports.useRef(new Map),o=x.exports.useRef(new Map),r=x.exports.useState([]),s=Ne(r,2),a=s[0],l=s[1],c=x.exports.useRef(0),u=x.exports.useRef(!1),d=function(){u.current||t({})},h=x.exports.useCallback(function(w,y){var L=lie(y);o.current.set(L,w),n.current.set(w,L),c.current+=1;var D=c.current;mze(function(){D===c.current&&d()})},[]),f=x.exports.useCallback(function(w,y){var L=lie(y);o.current.delete(L),n.current.delete(w)},[]),g=x.exports.useCallback(function(w){l(w)},[]),p=x.exports.useCallback(function(w,y){var L=n.current.get(w)||"",D=vze(L);return y&&a.includes(D[0])&&D.unshift(PW),D},[a]),v=x.exports.useCallback(function(w,y){return w.some(function(L){var D=p(L,!0);return D.includes(y)})},[p]),m=function(){var y=_t(n.current.keys());return a.length&&y.push(PW),y},_=x.exports.useCallback(function(w){var y="".concat(n.current.get(w)).concat(dq),L=new Set;return _t(o.current.keys()).forEach(function(D){D.startsWith(y)&&L.add(o.current.get(D))}),L},[]);return x.exports.useEffect(function(){return function(){u.current=!0}},[]),{registerPath:h,unregisterPath:f,refreshOverflowKeys:g,isSubPathKey:v,getKeyPath:p,getKeys:m,getSubPathKeys:_}}function pL(i){var e=x.exports.useRef(i);e.current=i;var t=x.exports.useCallback(function(){for(var n,o=arguments.length,r=new Array(o),s=0;s1&&(_.motionAppear=!1);var w=_.onVisibleChanged;return _.onVisibleChanged=function(y){return!h.current&&!y&&v(!0),w==null?void 0:w(y)},p?null:x.exports.createElement(_D,{mode:r,locked:!h.current},x.exports.createElement(eh,Ct({visible:m},_,{forceRender:l,removeOnLeave:!1,leavedClassName:"".concat(a,"-hidden")}),function(y){var L=y.className,D=y.style;return x.exports.createElement(hq,{id:e,className:L,style:D},o)}))}var Pze=["style","className","title","eventKey","warnKey","disabled","internalPopupClose","children","itemIcon","expandIcon","popupClassName","popupOffset","popupStyle","onClick","onMouseEnter","onMouseLeave","onTitleClick","onTitleMouseEnter","onTitleMouseLeave"],Oze=["active"],Fze=function(e){var t,n=e.style,o=e.className,r=e.title,s=e.eventKey;e.warnKey;var a=e.disabled,l=e.internalPopupClose,c=e.children,u=e.itemIcon,d=e.expandIcon,h=e.popupClassName,f=e.popupOffset,g=e.popupStyle,p=e.onClick,v=e.onMouseEnter,m=e.onMouseLeave,_=e.onTitleClick,w=e.onTitleMouseEnter,y=e.onTitleMouseLeave,L=Hn(e,Pze),D=Xme(s),E=x.exports.useContext(Ud),I=E.prefixCls,k=E.mode,R=E.openKeys,A=E.disabled,P=E.overflowDisabled,N=E.activeKey,M=E.selectedKeys,H=E.itemIcon,W=E.expandIcon,F=E.onItemClick,$=E.onOpenChange,z=E.onActive,K=x.exports.useContext(cq),j=K._internalRenderSubMenuItem,G=x.exports.useContext(Qme),X=G.isSubPathKey,de=TI(),he="".concat(I,"-submenu"),pe=A||a,be=x.exports.useRef(),Se=x.exports.useRef(),Fe=u!=null?u:H,De=d!=null?d:W,ce=R.includes(s),Pe=!P&&ce,Oe=X(M,s),xe=eve(s,pe,w,y),Ee=xe.active,tt=Hn(xe,Oze),nt=x.exports.useState(!1),Qe=Ne(nt,2),Ge=Qe[0],re=Qe[1],ie=function(xt){pe||re(xt)},se=function(xt){ie(!0),v==null||v({key:s,domEvent:xt})},U=function(xt){ie(!1),m==null||m({key:s,domEvent:xt})},Y=x.exports.useMemo(function(){return Ee||(k!=="inline"?Ge||X([N],s):!1)},[k,Ee,N,Ge,s,X]),oe=tve(de.length),te=function(xt){pe||(_==null||_({key:s,domEvent:xt}),k==="inline"&&$(s,!ce))},we=pL(function(Je){p==null||p(EA(Je)),F(Je)}),Le=function(xt){k!=="inline"&&$(s,xt)},Te=function(){z(s)},We=D&&"".concat(D,"-popup"),je=x.exports.createElement("div",Ct({role:"menuitem",style:oe,className:"".concat(he,"-title"),tabIndex:pe?null:-1,ref:be,title:typeof r=="string"?r:null,"data-menu-id":P&&D?null:D,"aria-expanded":Pe,"aria-haspopup":!0,"aria-controls":We,"aria-disabled":pe,onClick:te,onFocus:Te},tt),r,x.exports.createElement(nve,{icon:k!=="horizontal"?De:void 0,props:Ce(Ce({},e),{},{isOpen:Pe,isSubMenu:!0})},x.exports.createElement("i",{className:"".concat(he,"-arrow")}))),mt=x.exports.useRef(k);if(k!=="inline"&&de.length>1?mt.current="vertical":mt.current=k,!P){var Et=mt.current;je=x.exports.createElement(Mze,{mode:Et,prefixCls:he,visible:!l&&Pe&&k!=="inline",popupClassName:h,popupOffset:f,popupStyle:g,popup:x.exports.createElement(_D,{mode:Et==="horizontal"?"vertical":Et},x.exports.createElement(hq,{id:We,ref:Se},c)),disabled:pe,onVisibleChange:Le},je)}var At=x.exports.createElement(of.Item,Ct({role:"none"},L,{component:"li",style:n,className:Ue(he,"".concat(he,"-").concat(k),o,(t={},me(t,"".concat(he,"-open"),Pe),me(t,"".concat(he,"-active"),Y),me(t,"".concat(he,"-selected"),Oe),me(t,"".concat(he,"-disabled"),pe),t)),onMouseEnter:se,onMouseLeave:U}),je,!P&&x.exports.createElement(Aze,{id:We,open:Pe,keyPath:de},c));return j&&(At=j(At,e,{selected:Oe,active:Y,open:Pe,disabled:pe})),x.exports.createElement(_D,{onItemClick:we,mode:k==="horizontal"?"vertical":k,itemIcon:Fe,expandIcon:De},At)};function gq(i){var e=i.eventKey,t=i.children,n=TI(e),o=fq(t,n),r=R4();x.exports.useEffect(function(){if(r)return r.registerPath(e,n),function(){r.unregisterPath(e,n)}},[n]);var s;return r?s=o:s=x.exports.createElement(Fze,i,o),x.exports.createElement(Zme.Provider,{value:n},s)}var Bze=["className","title","eventKey","children"],Wze=["children"],Vze=function(e){var t=e.className,n=e.title;e.eventKey;var o=e.children,r=Hn(e,Bze),s=x.exports.useContext(Ud),a=s.prefixCls,l="".concat(a,"-item-group");return x.exports.createElement("li",Ct({role:"presentation"},r,{onClick:function(u){return u.stopPropagation()},className:Ue(l,t)}),x.exports.createElement("div",{role:"presentation",className:"".concat(l,"-title"),title:typeof n=="string"?n:void 0},n),x.exports.createElement("ul",{role:"group",className:"".concat(l,"-list")},o))};function ove(i){var e=i.children,t=Hn(i,Wze),n=TI(t.eventKey),o=fq(e,n),r=R4();return r?o:x.exports.createElement(Vze,Df(t,["warnKey"]),o)}function rve(i){var e=i.className,t=i.style,n=x.exports.useContext(Ud),o=n.prefixCls,r=R4();return r?null:x.exports.createElement("li",{role:"separator",className:Ue("".concat(o,"-item-divider"),e),style:t})}var Hze=["label","children","key","type"];function OW(i){return(i||[]).map(function(e,t){if(e&&Kn(e)==="object"){var n=e,o=n.label,r=n.children,s=n.key,a=n.type,l=Hn(n,Hze),c=s!=null?s:"tmp-".concat(t);return r||a==="group"?a==="group"?x.exports.createElement(ove,Ct({key:c},l,{title:o}),OW(r)):x.exports.createElement(gq,Ct({key:c},l,{title:o}),OW(r)):a==="divider"?x.exports.createElement(rve,Ct({key:c},l)):x.exports.createElement(M4,Ct({key:c},l),o)}return null}).filter(function(e){return e})}function $ze(i,e,t){var n=i;return e&&(n=OW(e)),fq(n,t)}var zze=["prefixCls","rootClassName","style","className","tabIndex","items","children","direction","id","mode","inlineCollapsed","disabled","disabledOverflow","subMenuOpenDelay","subMenuCloseDelay","forceSubMenuRender","defaultOpenKeys","openKeys","activeKey","defaultActiveFirst","selectable","multiple","defaultSelectedKeys","selectedKeys","onSelect","onDeselect","inlineIndent","motion","defaultMotions","triggerSubMenuAction","builtinPlacements","itemIcon","expandIcon","overflowedIndicator","overflowedIndicatorPopupClassName","getPopupContainer","onClick","onOpenChange","onKeyDown","openAnimation","openTransitionName","_internalRenderMenuItem","_internalRenderSubMenuItem"],P1=[],Uze=x.exports.forwardRef(function(i,e){var t,n,o=i,r=o.prefixCls,s=r===void 0?"rc-menu":r,a=o.rootClassName,l=o.style,c=o.className,u=o.tabIndex,d=u===void 0?0:u,h=o.items,f=o.children,g=o.direction,p=o.id,v=o.mode,m=v===void 0?"vertical":v,_=o.inlineCollapsed,w=o.disabled,y=o.disabledOverflow,L=o.subMenuOpenDelay,D=L===void 0?.1:L,E=o.subMenuCloseDelay,I=E===void 0?.1:E,k=o.forceSubMenuRender,R=o.defaultOpenKeys,A=o.openKeys,P=o.activeKey,N=o.defaultActiveFirst,M=o.selectable,H=M===void 0?!0:M,W=o.multiple,F=W===void 0?!1:W,$=o.defaultSelectedKeys,z=o.selectedKeys,K=o.onSelect,j=o.onDeselect,G=o.inlineIndent,X=G===void 0?24:G,de=o.motion,he=o.defaultMotions,pe=o.triggerSubMenuAction,be=pe===void 0?"hover":pe,Se=o.builtinPlacements,Fe=o.itemIcon,De=o.expandIcon,ce=o.overflowedIndicator,Pe=ce===void 0?"...":ce,Oe=o.overflowedIndicatorPopupClassName,xe=o.getPopupContainer,Ee=o.onClick,tt=o.onOpenChange,nt=o.onKeyDown;o.openAnimation,o.openTransitionName;var Qe=o._internalRenderMenuItem,Ge=o._internalRenderSubMenuItem,re=Hn(o,zze),ie=x.exports.useMemo(function(){return $ze(f,h,P1)},[f,h]),se=x.exports.useState(!1),U=Ne(se,2),Y=U[0],oe=U[1],te=x.exports.useRef(),we=Cze(p),Le=g==="rtl",Te=jl(R,{value:A,postState:function(gi){return gi||P1}}),We=Ne(Te,2),je=We[0],mt=We[1],Et=function(gi){var Kt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;function on(){mt(gi),tt==null||tt(gi)}Kt?uf.exports.flushSync(on):on()},At=x.exports.useState(je),Je=Ne(At,2),xt=Je[0],Ot=Je[1],Vn=x.exports.useRef(!1),Lt=x.exports.useMemo(function(){return(m==="inline"||m==="vertical")&&_?["vertical",_]:[m,!1]},[m,_]),tn=Ne(Lt,2),ui=tn[0],cn=tn[1],qn=ui==="inline",bn=x.exports.useState(ui),Pt=Ne(bn,2),qt=Pt[0],Nt=Pt[1],jt=x.exports.useState(cn),Gt=Ne(jt,2),kt=Gt[0],Ft=Gt[1];x.exports.useEffect(function(){Nt(ui),Ft(cn),Vn.current&&(qn?mt(xt):Et(P1))},[ui,cn]);var bt=x.exports.useState(0),Zt=Ne(bt,2),yn=Zt[0],Dn=Zt[1],Gn=yn>=ie.length-1||qt!=="horizontal"||y;x.exports.useEffect(function(){qn&&Ot(je)},[je]),x.exports.useEffect(function(){return Vn.current=!0,function(){Vn.current=!1}},[]);var Un=_ze(),Zi=Un.registerPath,an=Un.unregisterPath,Xt=Un.refreshOverflowKeys,oi=Un.isSubPathKey,Ze=Un.getKeyPath,ue=Un.getKeys,Ve=Un.getSubPathKeys,ot=x.exports.useMemo(function(){return{registerPath:Zi,unregisterPath:an}},[Zi,an]),Sn=x.exports.useMemo(function(){return{isSubPathKey:oi}},[oi]);x.exports.useEffect(function(){Xt(Gn?P1:ie.slice(yn+1).map(function(mi){return mi.key}))},[yn,Gn]);var $n=jl(P||N&&((t=ie[0])===null||t===void 0?void 0:t.key),{value:P}),Ci=Ne($n,2),An=Ci[0],lo=Ci[1],Qo=pL(function(mi){lo(mi)}),zo=pL(function(){lo(void 0)});x.exports.useImperativeHandle(e,function(){return{list:te.current,focus:function(gi){var Kt,on=ue(),vi=AW(on,we),Uo=vi.elements,Qi=vi.key2element,Jo=vi.element2key,vr=uq(te.current,Uo),zs=An!=null?An:vr[0]?Jo.get(vr[0]):(Kt=ie.find(function(Is){return!Is.props.disabled}))===null||Kt===void 0?void 0:Kt.key,Tr=Qi.get(zs);if(zs&&Tr){var cs;Tr==null||(cs=Tr.focus)===null||cs===void 0||cs.call(Tr,gi)}}}});var ic=jl($||[],{value:z,postState:function(gi){return Array.isArray(gi)?gi:gi==null?P1:[gi]}}),Xc=Ne(ic,2),Gr=Xc[0],za=Xc[1],ml=function(gi){if(H){var Kt=gi.key,on=Gr.includes(Kt),vi;F?on?vi=Gr.filter(function(Qi){return Qi!==Kt}):vi=[].concat(_t(Gr),[Kt]):vi=[Kt],za(vi);var Uo=Ce(Ce({},gi),{},{selectedKeys:vi});on?j==null||j(Uo):K==null||K(Uo)}!F&&je.length&&qt!=="inline"&&Et(P1)},_a=pL(function(mi){Ee==null||Ee(EA(mi)),ml(mi)}),vl=pL(function(mi,gi){var Kt=je.filter(function(vi){return vi!==mi});if(gi)Kt.push(mi);else if(qt!=="inline"){var on=Ve(mi);Kt=Kt.filter(function(vi){return!on.has(vi)})}_4(je,Kt,!0)||Et(Kt,!0)}),oc=function(gi,Kt){var on=Kt!=null?Kt:!je.includes(gi);vl(gi,on)},Yc=pze(qt,An,Le,we,te,ue,Ze,lo,oc,nt);x.exports.useEffect(function(){oe(!0)},[]);var ba=x.exports.useMemo(function(){return{_internalRenderMenuItem:Qe,_internalRenderSubMenuItem:Ge}},[Qe,Ge]),Xu=qt!=="horizontal"||y?ie:ie.map(function(mi,gi){return x.exports.createElement(_D,{key:mi.key,overflowDisabled:gi>yn},mi)}),_l=x.exports.createElement(of,Ct({id:p,ref:te,prefixCls:"".concat(s,"-overflow"),component:"ul",itemComponent:M4,className:Ue(s,"".concat(s,"-root"),"".concat(s,"-").concat(qt),c,(n={},me(n,"".concat(s,"-inline-collapsed"),kt),me(n,"".concat(s,"-rtl"),Le),n),a),dir:g,style:l,role:"menu",tabIndex:d,data:Xu,renderRawItem:function(gi){return gi},renderRawRest:function(gi){var Kt=gi.length,on=Kt?ie.slice(-Kt):null;return x.exports.createElement(gq,{eventKey:PW,title:Pe,disabled:Gn,internalPopupClose:Kt===0,popupClassName:Oe},on)},maxCount:qt!=="horizontal"||y?of.INVALIDATE:of.RESPONSIVE,ssr:"full","data-menu-list":!0,onVisibleChange:function(gi){Dn(gi)},onKeyDown:Yc},re));return x.exports.createElement(cq.Provider,{value:ba},x.exports.createElement(qme.Provider,{value:we},x.exports.createElement(_D,{prefixCls:s,rootClassName:a,mode:qt,openKeys:je,rtl:Le,disabled:w,motion:Y?de:null,defaultMotions:Y?he:null,activeKey:An,onActive:Qo,onInactive:zo,selectedKeys:Gr,inlineIndent:X,subMenuOpenDelay:D,subMenuCloseDelay:I,forceSubMenuRender:k,builtinPlacements:Se,triggerSubMenuAction:be,getPopupContainer:xe,itemIcon:Fe,expandIcon:De,onItemClick:_a,onOpenChange:vl},x.exports.createElement(Qme.Provider,{value:Sn},_l),x.exports.createElement("div",{style:{display:"none"},"aria-hidden":!0},x.exports.createElement(Yme.Provider,{value:ot},ie)))))}),NI=Uze;NI.Item=M4;NI.SubMenu=gq;NI.ItemGroup=ove;NI.Divider=rve;var jze={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M176 511a56 56 0 10112 0 56 56 0 10-112 0zm280 0a56 56 0 10112 0 56 56 0 10-112 0zm280 0a56 56 0 10112 0 56 56 0 10-112 0z"}}]},name:"ellipsis",theme:"outlined"},Kze=jze,qze=function(e,t){return x.exports.createElement(cr,Ct({},e,{ref:t,icon:Kze}))},Gze=x.exports.forwardRef(qze);function Xze(i){return lr(i,{inputAffixPadding:i.paddingXXS})}const Yze=i=>{const{controlHeight:e,fontSize:t,lineHeight:n,lineWidth:o,controlHeightSM:r,controlHeightLG:s,fontSizeLG:a,lineHeightLG:l,paddingSM:c,controlPaddingHorizontalSM:u,controlPaddingHorizontal:d,colorFillAlter:h,colorPrimaryHover:f,colorPrimary:g,controlOutlineWidth:p,controlOutline:v,colorErrorOutline:m,colorWarningOutline:_,colorBgContainer:w}=i;return{paddingBlock:Math.max(Math.round((e-t*n)/2*10)/10-o,0),paddingBlockSM:Math.max(Math.round((r-t*n)/2*10)/10-o,0),paddingBlockLG:Math.ceil((s-a*l)/2*10)/10-o,paddingInline:c-o,paddingInlineSM:u-o,paddingInlineLG:d-o,addonBg:h,activeBorderColor:g,hoverBorderColor:f,activeShadow:`0 0 0 ${p}px ${v}`,errorActiveShadow:`0 0 0 ${p}px ${m}`,warningActiveShadow:`0 0 0 ${p}px ${_}`,hoverBg:w,activeBg:w,inputFontSize:t,inputFontSizeLG:a,inputFontSizeSM:t}},Zze=i=>({borderColor:i.hoverBorderColor,backgroundColor:i.hoverBg}),pq=i=>({color:i.colorTextDisabled,backgroundColor:i.colorBgContainerDisabled,borderColor:i.colorBorder,boxShadow:"none",cursor:"not-allowed",opacity:1,"&:hover:not([disabled])":Object.assign({},Zze(lr(i,{hoverBorderColor:i.colorBorder,hoverBg:i.colorBgContainerDisabled})))}),sve=(i,e)=>({background:i.colorBgContainer,borderWidth:i.lineWidth,borderStyle:i.lineType,borderColor:e.borderColor,"&:hover":{borderColor:e.hoverBorderColor,backgroundColor:i.hoverBg},"&:focus, &:focus-within":{borderColor:e.activeBorderColor,boxShadow:e.activeShadow,outline:0,backgroundColor:i.activeBg}}),uie=(i,e)=>({[`&${i.componentCls}-status-${e.status}:not(${i.componentCls}-disabled)`]:Object.assign(Object.assign({},sve(i,e)),{[`${i.componentCls}-prefix, ${i.componentCls}-suffix`]:{color:e.affixColor}})}),Qze=(i,e)=>({"&-outlined":Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},sve(i,{borderColor:i.colorBorder,hoverBorderColor:i.colorPrimaryHover,activeBorderColor:i.colorPrimary,activeShadow:i.activeShadow})),{[`&${i.componentCls}-disabled, &[disabled]`]:Object.assign({},pq(i))}),uie(i,{status:"error",borderColor:i.colorError,hoverBorderColor:i.colorErrorBorderHover,activeBorderColor:i.colorError,activeShadow:i.errorActiveShadow,affixColor:i.colorError})),uie(i,{status:"warning",borderColor:i.colorWarning,hoverBorderColor:i.colorWarningBorderHover,activeBorderColor:i.colorWarning,activeShadow:i.warningActiveShadow,affixColor:i.colorWarning})),e)}),die=(i,e)=>({[`&${i.componentCls}-group-wrapper-status-${e.status}`]:{[`${i.componentCls}-group-addon`]:{borderColor:e.addonBorderColor,color:e.addonColor}}}),Jze=i=>({"&-outlined":Object.assign(Object.assign(Object.assign({[`${i.componentCls}-group`]:{"&-addon":{background:i.addonBg,border:`${rt(i.lineWidth)} ${i.lineType} ${i.colorBorder}`},"&-addon:first-child":{borderInlineEnd:0},"&-addon:last-child":{borderInlineStart:0}}},die(i,{status:"error",addonBorderColor:i.colorError,addonColor:i.colorErrorText})),die(i,{status:"warning",addonBorderColor:i.colorWarning,addonColor:i.colorWarningText})),{[`&${i.componentCls}-group-wrapper-disabled`]:{[`${i.componentCls}-group-addon`]:Object.assign({},pq(i))}})}),eUe=(i,e)=>({"&-borderless":Object.assign({background:"transparent",border:"none","&:focus, &:focus-within":{outline:"none"},[`&${i.componentCls}-disabled, &[disabled]`]:{color:i.colorTextDisabled}},e)}),ave=(i,e)=>({background:e.bg,borderWidth:i.lineWidth,borderStyle:i.lineType,borderColor:"transparent",["input&, & input, textarea&, & textarea"]:{color:e==null?void 0:e.inputColor},"&:hover":{background:e.hoverBg},"&:focus, &:focus-within":{outline:0,borderColor:e.activeBorderColor,backgroundColor:i.activeBg}}),hie=(i,e)=>({[`&${i.componentCls}-status-${e.status}:not(${i.componentCls}-disabled)`]:Object.assign(Object.assign({},ave(i,e)),{[`${i.componentCls}-prefix, ${i.componentCls}-suffix`]:{color:e.affixColor}})}),tUe=(i,e)=>({"&-filled":Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},ave(i,{bg:i.colorFillTertiary,hoverBg:i.colorFillSecondary,activeBorderColor:i.colorPrimary})),{[`&${i.componentCls}-disabled, &[disabled]`]:Object.assign({},pq(i))}),hie(i,{status:"error",bg:i.colorErrorBg,hoverBg:i.colorErrorBgHover,activeBorderColor:i.colorError,inputColor:i.colorErrorText,affixColor:i.colorError})),hie(i,{status:"warning",bg:i.colorWarningBg,hoverBg:i.colorWarningBgHover,activeBorderColor:i.colorWarning,inputColor:i.colorWarningText,affixColor:i.colorWarning})),e)}),fie=(i,e)=>({[`&${i.componentCls}-group-wrapper-status-${e.status}`]:{[`${i.componentCls}-group-addon`]:{background:e.addonBg,color:e.addonColor}}}),nUe=i=>({"&-filled":Object.assign(Object.assign(Object.assign({[`${i.componentCls}-group`]:{"&-addon":{background:i.colorFillTertiary},[`${i.componentCls}-filled:not(:focus):not(:focus-within)`]:{"&:not(:first-child)":{borderInlineStart:`${rt(i.lineWidth)} ${i.lineType} ${i.colorSplit}`},"&:not(:last-child)":{borderInlineEnd:`${rt(i.lineWidth)} ${i.lineType} ${i.colorSplit}`}}}},fie(i,{status:"error",addonBg:i.colorErrorBg,addonColor:i.colorErrorText})),fie(i,{status:"warning",addonBg:i.colorWarningBg,addonColor:i.colorWarningText})),{[`&${i.componentCls}-group-wrapper-disabled`]:{[`${i.componentCls}-group`]:{"&-addon":{background:i.colorFillTertiary,color:i.colorTextDisabled},"&-addon:first-child":{borderInlineStart:`${rt(i.lineWidth)} ${i.lineType} ${i.colorBorder}`,borderTop:`${rt(i.lineWidth)} ${i.lineType} ${i.colorBorder}`,borderBottom:`${rt(i.lineWidth)} ${i.lineType} ${i.colorBorder}`},"&-addon:last-child":{borderInlineEnd:`${rt(i.lineWidth)} ${i.lineType} ${i.colorBorder}`,borderTop:`${rt(i.lineWidth)} ${i.lineType} ${i.colorBorder}`,borderBottom:`${rt(i.lineWidth)} ${i.lineType} ${i.colorBorder}`}}}})}),iUe=i=>({"&::-moz-placeholder":{opacity:1},"&::placeholder":{color:i,userSelect:"none"},"&:placeholder-shown":{textOverflow:"ellipsis"}}),lve=i=>{const{paddingBlockLG:e,lineHeightLG:t,borderRadiusLG:n,paddingInlineLG:o}=i;return{padding:`${rt(e)} ${rt(o)}`,fontSize:i.inputFontSizeLG,lineHeight:t,borderRadius:n}},cve=i=>({padding:`${rt(i.paddingBlockSM)} ${rt(i.paddingInlineSM)}`,fontSize:i.inputFontSizeSM,borderRadius:i.borderRadiusSM}),uve=i=>Object.assign(Object.assign({position:"relative",display:"inline-block",width:"100%",minWidth:0,padding:`${rt(i.paddingBlock)} ${rt(i.paddingInline)}`,color:i.colorText,fontSize:i.inputFontSize,lineHeight:i.lineHeight,borderRadius:i.borderRadius,transition:`all ${i.motionDurationMid}`},iUe(i.colorTextPlaceholder)),{"textarea&":{maxWidth:"100%",height:"auto",minHeight:i.controlHeight,lineHeight:i.lineHeight,verticalAlign:"bottom",transition:`all ${i.motionDurationSlow}, height 0s`,resize:"vertical"},"&-lg":Object.assign({},lve(i)),"&-sm":Object.assign({},cve(i)),"&-rtl":{direction:"rtl"},"&-textarea-rtl":{direction:"rtl"}}),oUe=i=>{const{componentCls:e,antCls:t}=i;return{position:"relative",display:"table",width:"100%",borderCollapse:"separate",borderSpacing:0,["&[class*='col-']"]:{paddingInlineEnd:i.paddingXS,"&:last-child":{paddingInlineEnd:0}},[`&-lg ${e}, &-lg > ${e}-group-addon`]:Object.assign({},lve(i)),[`&-sm ${e}, &-sm > ${e}-group-addon`]:Object.assign({},cve(i)),[`&-lg ${t}-select-single ${t}-select-selector`]:{height:i.controlHeightLG},[`&-sm ${t}-select-single ${t}-select-selector`]:{height:i.controlHeightSM},[`> ${e}`]:{display:"table-cell","&:not(:first-child):not(:last-child)":{borderRadius:0}},[`${e}-group`]:{["&-addon, &-wrap"]:{display:"table-cell",width:1,whiteSpace:"nowrap",verticalAlign:"middle","&:not(:first-child):not(:last-child)":{borderRadius:0}},"&-wrap > *":{display:"block !important"},"&-addon":{position:"relative",padding:`0 ${rt(i.paddingInline)}`,color:i.colorText,fontWeight:"normal",fontSize:i.inputFontSize,textAlign:"center",borderRadius:i.borderRadius,transition:`all ${i.motionDurationSlow}`,lineHeight:1,[`${t}-select`]:{margin:`${rt(i.calc(i.paddingBlock).add(1).mul(-1).equal())} ${rt(i.calc(i.paddingInline).mul(-1).equal())}`,[`&${t}-select-single:not(${t}-select-customize-input):not(${t}-pagination-size-changer)`]:{[`${t}-select-selector`]:{backgroundColor:"inherit",border:`${rt(i.lineWidth)} ${i.lineType} transparent`,boxShadow:"none"}},"&-open, &-focused":{[`${t}-select-selector`]:{color:i.colorPrimary}}},[`${t}-cascader-picker`]:{margin:`-9px ${rt(i.calc(i.paddingInline).mul(-1).equal())}`,backgroundColor:"transparent",[`${t}-cascader-input`]:{textAlign:"start",border:0,boxShadow:"none"}}}},[`${e}`]:{width:"100%",marginBottom:0,textAlign:"inherit","&:focus":{zIndex:1,borderInlineEndWidth:1},"&:hover":{zIndex:1,borderInlineEndWidth:1,[`${e}-search-with-button &`]:{zIndex:0}}},[`> ${e}:first-child, ${e}-group-addon:first-child`]:{borderStartEndRadius:0,borderEndEndRadius:0,[`${t}-select ${t}-select-selector`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`> ${e}-affix-wrapper`]:{[`&:not(:first-child) ${e}`]:{borderStartStartRadius:0,borderEndStartRadius:0},[`&:not(:last-child) ${e}`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`> ${e}:last-child, ${e}-group-addon:last-child`]:{borderStartStartRadius:0,borderEndStartRadius:0,[`${t}-select ${t}-select-selector`]:{borderStartStartRadius:0,borderEndStartRadius:0}},[`${e}-affix-wrapper`]:{"&:not(:last-child)":{borderStartEndRadius:0,borderEndEndRadius:0,[`${e}-search &`]:{borderStartStartRadius:i.borderRadius,borderEndStartRadius:i.borderRadius}},[`&:not(:first-child), ${e}-search &:not(:first-child)`]:{borderStartStartRadius:0,borderEndStartRadius:0}},[`&${e}-group-compact`]:Object.assign(Object.assign({display:"block"},Gge()),{[`${e}-group-addon, ${e}-group-wrap, > ${e}`]:{"&:not(:first-child):not(:last-child)":{borderInlineEndWidth:i.lineWidth,"&:hover":{zIndex:1},"&:focus":{zIndex:1}}},"& > *":{display:"inline-block",float:"none",verticalAlign:"top",borderRadius:0},[` + `]:{paddingInlineEnd:i.calc(i.fontSize).mul(1.5).equal()}}}},m6(lr(i,{controlHeight:i.singleItemHeightLG,fontSize:i.fontSizeLG,borderRadius:i.borderRadiusLG}),"lg")]}const h$e=i=>{const{fontSize:e,lineHeight:t,controlHeight:n,controlPaddingHorizontal:o,zIndexPopupBase:r,colorText:s,fontWeightStrong:a,controlItemBgActive:l,controlItemBgHover:c,colorBgContainer:u,colorFillSecondary:d,controlHeightLG:h,controlHeightSM:f,colorBgContainerDisabled:g,colorTextDisabled:p}=i;return{zIndexPopup:r+50,optionSelectedColor:s,optionSelectedFontWeight:a,optionSelectedBg:l,optionActiveBg:c,optionPadding:`${(n-e*t)/2}px ${o}px`,optionFontSize:e,optionLineHeight:t,optionHeight:n,selectorBg:u,clearBg:u,singleItemHeightLG:h,multipleItemBg:d,multipleItemBorderColor:"transparent",multipleItemHeight:f,multipleItemHeightLG:n,multipleSelectorBgDisabled:g,multipleItemColorDisabled:p,multipleItemBorderColorDisabled:"transparent",showArrowPaddingInlineEnd:Math.ceil(i.fontSize*1.25)}},Ume=(i,e)=>{const{componentCls:t,antCls:n,controlOutlineWidth:o}=i;return{[`&:not(${t}-customize-input) ${t}-selector`]:{border:`${rt(i.lineWidth)} ${i.lineType} ${e.borderColor}`,background:i.selectorBg},[`&:not(${t}-disabled):not(${t}-customize-input):not(${n}-pagination-size-changer)`]:{[`&:hover ${t}-selector`]:{borderColor:e.hoverBorderHover},[`${t}-focused& ${t}-selector`]:{borderColor:e.activeBorderColor,boxShadow:`0 0 0 ${rt(o)} ${e.activeShadowColor}`,outline:0}}}},uie=(i,e)=>({[`&${i.componentCls}-status-${e.status}`]:Object.assign({},Ume(i,e))}),f$e=i=>({"&-outlined":Object.assign(Object.assign(Object.assign(Object.assign({},Ume(i,{borderColor:i.colorBorder,hoverBorderHover:i.colorPrimaryHover,activeBorderColor:i.colorPrimary,activeShadowColor:i.controlOutline})),uie(i,{status:"error",borderColor:i.colorError,hoverBorderHover:i.colorErrorHover,activeBorderColor:i.colorError,activeShadowColor:i.colorErrorOutline})),uie(i,{status:"warning",borderColor:i.colorWarning,hoverBorderHover:i.colorWarningHover,activeBorderColor:i.colorWarning,activeShadowColor:i.colorWarningOutline})),{[`&${i.componentCls}-disabled`]:{[`&:not(${i.componentCls}-customize-input) ${i.componentCls}-selector`]:{background:i.colorBgContainerDisabled,color:i.colorTextDisabled}},[`&${i.componentCls}-multiple ${i.componentCls}-selection-item`]:{background:i.multipleItemBg,border:`${rt(i.lineWidth)} ${i.lineType} ${i.multipleItemBorderColor}`}})}),jme=(i,e)=>{const{componentCls:t,antCls:n}=i;return{[`&:not(${t}-customize-input) ${t}-selector`]:{background:e.bg,border:`${rt(i.lineWidth)} ${i.lineType} transparent`,color:e.color},[`&:not(${t}-disabled):not(${t}-customize-input):not(${n}-pagination-size-changer)`]:{[`&:hover ${t}-selector`]:{background:e.hoverBg},[`${t}-focused& ${t}-selector`]:{background:i.selectorBg,borderColor:e.activeBorderColor,outline:0}}}},die=(i,e)=>({[`&${i.componentCls}-status-${e.status}`]:Object.assign({},jme(i,e))}),g$e=i=>({"&-filled":Object.assign(Object.assign(Object.assign(Object.assign({},jme(i,{bg:i.colorFillTertiary,hoverBg:i.colorFillSecondary,activeBorderColor:i.colorPrimary,color:i.colorText})),die(i,{status:"error",bg:i.colorErrorBg,hoverBg:i.colorErrorBgHover,activeBorderColor:i.colorError,color:i.colorError})),die(i,{status:"warning",bg:i.colorWarningBg,hoverBg:i.colorWarningBgHover,activeBorderColor:i.colorWarning,color:i.colorWarning})),{[`&${i.componentCls}-disabled`]:{[`&:not(${i.componentCls}-customize-input) ${i.componentCls}-selector`]:{borderColor:i.colorBorder,background:i.colorBgContainerDisabled,color:i.colorTextDisabled}},[`&${i.componentCls}-multiple ${i.componentCls}-selection-item`]:{background:i.colorBgContainer,border:`${rt(i.lineWidth)} ${i.lineType} ${i.colorSplit}`}})}),p$e=i=>({"&-borderless":{[`${i.componentCls}-selector`]:{background:"transparent",borderColor:"transparent"},[`&${i.componentCls}-disabled`]:{[`&:not(${i.componentCls}-customize-input) ${i.componentCls}-selector`]:{color:i.colorTextDisabled}},[`&${i.componentCls}-multiple ${i.componentCls}-selection-item`]:{background:i.multipleItemBg,border:`${rt(i.lineWidth)} ${i.lineType} ${i.multipleItemBorderColor}`}}}),m$e=i=>({[i.componentCls]:Object.assign(Object.assign(Object.assign({},f$e(i)),g$e(i)),p$e(i))});var v$e=m$e;const _$e=i=>{const{componentCls:e}=i;return{position:"relative",transition:`all ${i.motionDurationMid} ${i.motionEaseInOut}`,input:{cursor:"pointer"},[`${e}-show-search&`]:{cursor:"text",input:{cursor:"auto",color:"inherit",height:"100%"}},[`${e}-disabled&`]:{cursor:"not-allowed",input:{cursor:"not-allowed"}}}},b$e=i=>{const{componentCls:e}=i;return{[`${e}-selection-search-input`]:{margin:0,padding:0,background:"transparent",border:"none",outline:"none",appearance:"none",fontFamily:"inherit","&::-webkit-search-cancel-button":{display:"none","-webkit-appearance":"none"}}}},C$e=i=>{const{antCls:e,componentCls:t,inputPaddingHorizontalBase:n,iconCls:o}=i;return{[t]:Object.assign(Object.assign({},Pa(i)),{position:"relative",display:"inline-block",cursor:"pointer",[`&:not(${t}-customize-input) ${t}-selector`]:Object.assign(Object.assign({},_$e(i)),b$e(i)),[`${t}-selection-item`]:Object.assign(Object.assign({flex:1,fontWeight:"normal",position:"relative",userSelect:"none"},CA),{[`> ${e}-typography`]:{display:"inline"}}),[`${t}-selection-placeholder`]:Object.assign(Object.assign({},CA),{flex:1,color:i.colorTextPlaceholder,pointerEvents:"none"}),[`${t}-arrow`]:Object.assign(Object.assign({},AK()),{position:"absolute",top:"50%",insetInlineStart:"auto",insetInlineEnd:n,height:i.fontSizeIcon,marginTop:i.calc(i.fontSizeIcon).mul(-1).div(2).equal(),color:i.colorTextQuaternary,fontSize:i.fontSizeIcon,lineHeight:1,textAlign:"center",pointerEvents:"none",display:"flex",alignItems:"center",transition:`opacity ${i.motionDurationSlow} ease`,[o]:{verticalAlign:"top",transition:`transform ${i.motionDurationSlow}`,"> svg":{verticalAlign:"top"},[`&:not(${t}-suffix)`]:{pointerEvents:"auto"}},[`${t}-disabled &`]:{cursor:"not-allowed"},"> *:not(:last-child)":{marginInlineEnd:8}}),[`${t}-clear`]:{position:"absolute",top:"50%",insetInlineStart:"auto",insetInlineEnd:n,zIndex:1,display:"inline-block",width:i.fontSizeIcon,height:i.fontSizeIcon,marginTop:i.calc(i.fontSizeIcon).mul(-1).div(2).equal(),color:i.colorTextQuaternary,fontSize:i.fontSizeIcon,fontStyle:"normal",lineHeight:1,textAlign:"center",textTransform:"none",cursor:"pointer",opacity:0,transition:`color ${i.motionDurationMid} ease, opacity ${i.motionDurationSlow} ease`,textRendering:"auto","&:before":{display:"block"},"&:hover":{color:i.colorTextTertiary}},"&:hover":{[`${t}-clear`]:{opacity:1},[`${t}-arrow:not(:last-child)`]:{opacity:0}}}),[`${t}-has-feedback`]:{[`${t}-clear`]:{insetInlineEnd:i.calc(n).add(i.fontSize).add(i.paddingXS).equal()}}}},y$e=i=>{const{componentCls:e}=i;return[{[e]:{[`&${e}-in-form-item`]:{width:"100%"}}},C$e(i),d$e(i),u$e(i),a$e(i),{[`${e}-rtl`]:{direction:"rtl"}},YK(i,{borderElCls:`${e}-selector`,focusElCls:`${e}-focused`})]};var w$e=jc("Select",(i,e)=>{let{rootPrefixCls:t}=e;const n=lr(i,{rootPrefixCls:t,inputPaddingHorizontalBase:i.calc(i.paddingSM).sub(1).equal(),multipleSelectItemHeight:i.multipleItemHeight,selectHeight:i.controlHeight});return[y$e(n),v$e(n)]},h$e,{unitless:{optionLineHeight:!0,optionSelectedFontWeight:!0}}),S$e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M912 190h-69.9c-9.8 0-19.1 4.5-25.1 12.2L404.7 724.5 207 474a32 32 0 00-25.1-12.2H112c-6.7 0-10.4 7.7-6.3 12.9l273.9 347c12.8 16.2 37.4 16.2 50.3 0l488.4-618.9c4.1-5.1.4-12.8-6.3-12.8z"}}]},name:"check",theme:"outlined"},x$e=S$e,L$e=function(e,t){return x.exports.createElement(cr,yt({},e,{ref:t,icon:x$e}))},E$e=x.exports.forwardRef(L$e),D$e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z"}}]},name:"down",theme:"outlined"},k$e=D$e,I$e=function(e,t){return x.exports.createElement(cr,yt({},e,{ref:t,icon:k$e}))},T$e=x.exports.forwardRef(I$e),N$e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M909.6 854.5L649.9 594.8C690.2 542.7 712 479 712 412c0-80.2-31.3-155.4-87.9-212.1-56.6-56.7-132-87.9-212.1-87.9s-155.5 31.3-212.1 87.9C143.2 256.5 112 331.8 112 412c0 80.1 31.3 155.5 87.9 212.1C256.5 680.8 331.8 712 412 712c67 0 130.6-21.8 182.7-62l259.7 259.6a8.2 8.2 0 0011.6 0l43.6-43.5a8.2 8.2 0 000-11.6zM570.4 570.4C528 612.7 471.8 636 412 636s-116-23.3-158.4-65.6C211.3 528 188 471.8 188 412s23.3-116.1 65.6-158.4C296 211.3 352.2 188 412 188s116.1 23.2 158.4 65.6S636 352.2 636 412s-23.3 116.1-65.6 158.4z"}}]},name:"search",theme:"outlined"},R$e=N$e,M$e=function(e,t){return x.exports.createElement(cr,yt({},e,{ref:t,icon:R$e}))},Kme=x.exports.forwardRef(M$e);function A$e(i){let{suffixIcon:e,clearIcon:t,menuItemSelectedIcon:n,removeIcon:o,loading:r,multiple:s,hasFeedback:a,prefixCls:l,showSuffixIcon:c,feedbackIcon:u,showArrow:d,componentName:h}=i;const f=t!=null?t:x.exports.createElement(cS,null),g=_=>e===null&&!a&&!d?null:x.exports.createElement(x.exports.Fragment,null,c!==!1&&_,a&&u);let p=null;if(e!==void 0)p=g(e);else if(r)p=g(x.exports.createElement(EI,{spin:!0}));else{const _=`${l}-suffix`;p=y=>{let{open:w,showSearch:L}=y;return g(w&&L?x.exports.createElement(Kme,{className:_}):x.exports.createElement(T$e,{className:_}))}}let v=null;n!==void 0?v=n:s?v=x.exports.createElement(E$e,null):v=null;let m=null;return o!==void 0?m=o:m=x.exports.createElement(uS,null),{clearIcon:f,suffixIcon:p,itemIcon:v,removeIcon:m}}function P$e(i,e){return e!==void 0?e:i!==null}var O$e=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(i);o{var t;const{prefixCls:n,bordered:o,className:r,rootClassName:s,getPopupContainer:a,popupClassName:l,dropdownClassName:c,listHeight:u=256,placement:d,listItemHeight:h,size:f,disabled:g,notFoundContent:p,status:v,builtinPlacements:m,dropdownMatchSelectWidth:_,popupMatchSelectWidth:y,direction:w,style:L,allowClear:D,variant:E,dropdownStyle:I,transitionName:k,tagRender:R,maxCount:A}=i,P=O$e(i,["prefixCls","bordered","className","rootClassName","getPopupContainer","popupClassName","dropdownClassName","listHeight","placement","listItemHeight","size","disabled","notFoundContent","status","builtinPlacements","dropdownMatchSelectWidth","popupMatchSelectWidth","direction","style","allowClear","variant","dropdownStyle","transitionName","tagRender","maxCount"]),{getPopupContainer:N,getPrefixCls:M,renderEmpty:H,direction:B,virtual:F,popupMatchSelectWidth:$,popupOverflow:z,select:K}=x.exports.useContext(Hi),[,j]=Ba(),G=h!=null?h:j==null?void 0:j.controlHeight,X=M("select",n),de=M(),fe=w!=null?w:B,{compactSize:pe,compactItemClassnames:be}=I4(X,fe),[Se,Fe]=hq(E,o),De=nh(X),[ce,Pe,Oe]=w$e(X,De),xe=x.exports.useMemo(()=>{const{mode:Ot}=i;if(Ot!=="combobox")return Ot===qme?"combobox":Ot},[i.mode]),Ee=xe==="multiple"||xe==="tags",tt=P$e(i.suffixIcon,i.showArrow),nt=(t=y!=null?y:_)!==null&&t!==void 0?t:$,{status:Qe,hasFeedback:Ge,isFormItemInput:re,feedbackIcon:ie}=x.exports.useContext(Ud),se=uq(Qe,v);let U;p!==void 0?U=p:xe==="combobox"?U=null:U=(H==null?void 0:H("Select"))||x.exports.createElement(e$e,{componentName:"Select"});const{suffixIcon:Y,itemIcon:oe,removeIcon:te,clearIcon:ye}=A$e(Object.assign(Object.assign({},P),{multiple:Ee,hasFeedback:Ge,feedbackIcon:ie,showSuffixIcon:tt,prefixCls:X,componentName:"Select"})),Le=D===!0?{clearIcon:ye}:D,Te=kf(P,["suffixIcon","itemIcon"]),We=Ue(l||c,{[`${X}-dropdown-${fe}`]:fe==="rtl"},s,Oe,De,Pe),je=Ob(Ot=>{var Vn;return(Vn=f!=null?f:pe)!==null&&Vn!==void 0?Vn:Ot}),mt=x.exports.useContext(lS),Dt=g!=null?g:mt,At=Ue({[`${X}-lg`]:je==="large",[`${X}-sm`]:je==="small",[`${X}-rtl`]:fe==="rtl",[`${X}-${Se}`]:Fe,[`${X}-in-form-item`]:re},kA(X,se,Ge),be,K==null?void 0:K.className,r,s,Oe,De,Pe),Je=x.exports.useMemo(()=>d!==void 0?d:fe==="rtl"?"bottomRight":"bottomLeft",[d,fe]),[Lt]=jK("SelectLike",I==null?void 0:I.zIndex);return ce(x.exports.createElement(cq,Object.assign({ref:e,virtual:F,showSearch:K==null?void 0:K.showSearch},Te,{style:Object.assign(Object.assign({},K==null?void 0:K.style),L),dropdownMatchSelectWidth:nt,transitionName:j0(de,"slide-up",k),builtinPlacements:o$e(m,z),listHeight:u,listItemHeight:G,mode:xe,prefixCls:X,placement:Je,direction:fe,suffixIcon:Y,menuItemSelectedIcon:oe,removeIcon:te,allowClear:Le,notFoundContent:U,className:At,getPopupContainer:a||N,dropdownClassName:We,disabled:Dt,dropdownStyle:Object.assign(Object.assign({},I),{zIndex:Lt}),maxCount:Ee?A:void 0,tagRender:Ee?R:void 0})))},hS=x.exports.forwardRef(F$e),B$e=mVe(hS);hS.SECRET_COMBOBOX_MODE_DO_NOT_USE=qme;hS.Option=aq;hS.OptGroup=sq;hS._InternalPanelDoNotUseOrYouWillBeFired=B$e;var W$e=hS;const _D=["xxl","xl","lg","md","sm","xs"],V$e=i=>({xs:`(max-width: ${i.screenXSMax}px)`,sm:`(min-width: ${i.screenSM}px)`,md:`(min-width: ${i.screenMD}px)`,lg:`(min-width: ${i.screenLG}px)`,xl:`(min-width: ${i.screenXL}px)`,xxl:`(min-width: ${i.screenXXL}px)`}),H$e=i=>{const e=i,t=[].concat(_D).reverse();return t.forEach((n,o)=>{const r=n.toUpperCase(),s=`screen${r}Min`,a=`screen${r}`;if(!(e[s]<=e[a]))throw new Error(`${s}<=${a} fails : !(${e[s]}<=${e[a]})`);if(o{const t=new Map;let n=-1,o={};return{matchHandlers:{},dispatch(r){return o=r,t.forEach(s=>s(o)),t.size>=1},subscribe(r){return t.size||this.register(),n+=1,t.set(n,r),r(o),n},unsubscribe(r){t.delete(r),t.size||this.unregister()},unregister(){Object.keys(e).forEach(r=>{const s=e[r],a=this.matchHandlers[s];a==null||a.mql.removeListener(a==null?void 0:a.listener)}),t.clear()},register(){Object.keys(e).forEach(r=>{const s=e[r],a=c=>{let{matches:u}=c;this.dispatch(Object.assign(Object.assign({},o),{[r]:u}))},l=window.matchMedia(s);l.addListener(a),this.matchHandlers[s]={mql:l,listener:a},a(l)})},responsiveMap:e}},[i])}function Gme(i){var e=i.children,t=i.prefixCls,n=i.id,o=i.overlayInnerStyle,r=i.className,s=i.style;return x.exports.createElement("div",{className:Ue("".concat(t,"-content"),r),style:s},x.exports.createElement("div",{className:"".concat(t,"-inner"),id:n,role:"tooltip",style:o},typeof e=="function"?e():e))}var N1={shiftX:64,adjustY:1},R1={adjustX:1,shiftY:!0},cu=[0,0],z$e={left:{points:["cr","cl"],overflow:R1,offset:[-4,0],targetOffset:cu},right:{points:["cl","cr"],overflow:R1,offset:[4,0],targetOffset:cu},top:{points:["bc","tc"],overflow:N1,offset:[0,-4],targetOffset:cu},bottom:{points:["tc","bc"],overflow:N1,offset:[0,4],targetOffset:cu},topLeft:{points:["bl","tl"],overflow:N1,offset:[0,-4],targetOffset:cu},leftTop:{points:["tr","tl"],overflow:R1,offset:[-4,0],targetOffset:cu},topRight:{points:["br","tr"],overflow:N1,offset:[0,-4],targetOffset:cu},rightTop:{points:["tl","tr"],overflow:R1,offset:[4,0],targetOffset:cu},bottomRight:{points:["tr","br"],overflow:N1,offset:[0,4],targetOffset:cu},rightBottom:{points:["bl","br"],overflow:R1,offset:[4,0],targetOffset:cu},bottomLeft:{points:["tl","bl"],overflow:N1,offset:[0,4],targetOffset:cu},leftBottom:{points:["br","bl"],overflow:R1,offset:[-4,0],targetOffset:cu}},U$e=["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","motion","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle","arrowContent","overlay","id","showArrow"],j$e=function(e,t){var n=e.overlayClassName,o=e.trigger,r=o===void 0?["hover"]:o,s=e.mouseEnterDelay,a=s===void 0?0:s,l=e.mouseLeaveDelay,c=l===void 0?.1:l,u=e.overlayStyle,d=e.prefixCls,h=d===void 0?"rc-tooltip":d,f=e.children,g=e.onVisibleChange,p=e.afterVisibleChange,v=e.transitionName,m=e.animation,_=e.motion,y=e.placement,w=y===void 0?"right":y,L=e.align,D=L===void 0?{}:L,E=e.destroyTooltipOnHide,I=E===void 0?!1:E,k=e.defaultVisible,R=e.getTooltipContainer,A=e.overlayInnerStyle;e.arrowContent;var P=e.overlay,N=e.id,M=e.showArrow,H=M===void 0?!0:M,B=Hn(e,U$e),F=x.exports.useRef(null);x.exports.useImperativeHandle(t,function(){return F.current});var $=Ce({},B);"visible"in e&&($.popupVisible=e.visible);var z=function(){return x.exports.createElement(Gme,{key:"content",prefixCls:h,id:N,overlayInnerStyle:A},P)};return x.exports.createElement(R4,yt({popupClassName:n,prefixCls:h,popup:z,action:r,builtinPlacements:z$e,popupPlacement:w,ref:F,popupAlign:D,getPopupContainer:R,onPopupVisibleChange:g,afterPopupVisibleChange:p,popupTransitionName:v,popupAnimation:m,popupMotion:_,defaultPopupVisible:k,autoDestroy:I,mouseLeaveDelay:c,popupStyle:u,mouseEnterDelay:a,arrow:H},$),f)},K$e=x.exports.forwardRef(j$e);function q$e(i){const{sizePopupArrow:e,borderRadiusXS:t,borderRadiusOuter:n}=i,o=e/2,r=0,s=o,a=n*1/Math.sqrt(2),l=o-n*(1-1/Math.sqrt(2)),c=o-t*(1/Math.sqrt(2)),u=n*(Math.sqrt(2)-1)+t*(1/Math.sqrt(2)),d=2*o-c,h=u,f=2*o-a,g=l,p=2*o-r,v=s,m=o*Math.sqrt(2)+n*(Math.sqrt(2)-2),_=n*(Math.sqrt(2)-1),y=`polygon(${_}px 100%, 50% ${_}px, ${2*o-_}px 100%, ${_}px 100%)`,w=`path('M ${r} ${s} A ${n} ${n} 0 0 0 ${a} ${l} L ${c} ${u} A ${t} ${t} 0 0 1 ${d} ${h} L ${f} ${g} A ${n} ${n} 0 0 0 ${p} ${v} Z')`;return{arrowShadowWidth:m,arrowPath:w,arrowPolygon:y}}const G$e=(i,e,t)=>{const{sizePopupArrow:n,arrowPolygon:o,arrowPath:r,arrowShadowWidth:s,borderRadiusXS:a,calc:l}=i;return{pointerEvents:"none",width:n,height:n,overflow:"hidden","&::before":{position:"absolute",bottom:0,insetInlineStart:0,width:n,height:l(n).div(2).equal(),background:e,clipPath:{_multi_value_:!0,value:[o,r]},content:'""'},"&::after":{content:'""',position:"absolute",width:s,height:s,bottom:0,insetInline:0,margin:"auto",borderRadius:{_skip_check_:!0,value:`0 0 ${rt(a)} 0`},transform:"translateY(50%) rotate(-135deg)",boxShadow:t,zIndex:0,background:"transparent"}}},Xme=8;function Yme(i){const{contentRadius:e,limitVerticalRadius:t}=i,n=e>12?e+2:12;return{arrowOffsetHorizontal:n,arrowOffsetVertical:t?Xme:n}}function YN(i,e){return i?e:{}}function X$e(i,e,t){const{componentCls:n,boxShadowPopoverArrow:o,arrowOffsetVertical:r,arrowOffsetHorizontal:s}=i,{arrowDistance:a=0,arrowPlacement:l={left:!0,right:!0,top:!0,bottom:!0}}=t||{};return{[n]:Object.assign(Object.assign(Object.assign(Object.assign({[`${n}-arrow`]:[Object.assign(Object.assign({position:"absolute",zIndex:1,display:"block"},G$e(i,e,o)),{"&:before":{background:e}})]},YN(!!l.top,{[[`&-placement-top > ${n}-arrow`,`&-placement-topLeft > ${n}-arrow`,`&-placement-topRight > ${n}-arrow`].join(",")]:{bottom:a,transform:"translateY(100%) rotate(180deg)"},[`&-placement-top > ${n}-arrow`]:{left:{_skip_check_:!0,value:"50%"},transform:"translateX(-50%) translateY(100%) rotate(180deg)"},[`&-placement-topLeft > ${n}-arrow`]:{left:{_skip_check_:!0,value:s}},[`&-placement-topRight > ${n}-arrow`]:{right:{_skip_check_:!0,value:s}}})),YN(!!l.bottom,{[[`&-placement-bottom > ${n}-arrow`,`&-placement-bottomLeft > ${n}-arrow`,`&-placement-bottomRight > ${n}-arrow`].join(",")]:{top:a,transform:"translateY(-100%)"},[`&-placement-bottom > ${n}-arrow`]:{left:{_skip_check_:!0,value:"50%"},transform:"translateX(-50%) translateY(-100%)"},[`&-placement-bottomLeft > ${n}-arrow`]:{left:{_skip_check_:!0,value:s}},[`&-placement-bottomRight > ${n}-arrow`]:{right:{_skip_check_:!0,value:s}}})),YN(!!l.left,{[[`&-placement-left > ${n}-arrow`,`&-placement-leftTop > ${n}-arrow`,`&-placement-leftBottom > ${n}-arrow`].join(",")]:{right:{_skip_check_:!0,value:a},transform:"translateX(100%) rotate(90deg)"},[`&-placement-left > ${n}-arrow`]:{top:{_skip_check_:!0,value:"50%"},transform:"translateY(-50%) translateX(100%) rotate(90deg)"},[`&-placement-leftTop > ${n}-arrow`]:{top:r},[`&-placement-leftBottom > ${n}-arrow`]:{bottom:r}})),YN(!!l.right,{[[`&-placement-right > ${n}-arrow`,`&-placement-rightTop > ${n}-arrow`,`&-placement-rightBottom > ${n}-arrow`].join(",")]:{left:{_skip_check_:!0,value:a},transform:"translateX(-100%) rotate(-90deg)"},[`&-placement-right > ${n}-arrow`]:{top:{_skip_check_:!0,value:"50%"},transform:"translateY(-50%) translateX(-100%) rotate(-90deg)"},[`&-placement-rightTop > ${n}-arrow`]:{top:r},[`&-placement-rightBottom > ${n}-arrow`]:{bottom:r}}))}}function Y$e(i,e,t,n){if(n===!1)return{adjustX:!1,adjustY:!1};const o=n&&typeof n=="object"?n:{},r={};switch(i){case"top":case"bottom":r.shiftX=e.arrowOffsetHorizontal*2+t,r.shiftY=!0,r.adjustY=!0;break;case"left":case"right":r.shiftY=e.arrowOffsetVertical*2+t,r.shiftX=!0,r.adjustX=!0;break}const s=Object.assign(Object.assign({},r),o);return s.shiftX||(s.adjustX=!0),s.shiftY||(s.adjustY=!0),s}const hie={left:{points:["cr","cl"]},right:{points:["cl","cr"]},top:{points:["bc","tc"]},bottom:{points:["tc","bc"]},topLeft:{points:["bl","tl"]},leftTop:{points:["tr","tl"]},topRight:{points:["br","tr"]},rightTop:{points:["tl","tr"]},bottomRight:{points:["tr","br"]},rightBottom:{points:["bl","br"]},bottomLeft:{points:["tl","bl"]},leftBottom:{points:["br","bl"]}},Z$e={topLeft:{points:["bl","tc"]},leftTop:{points:["tr","cl"]},topRight:{points:["br","tc"]},rightTop:{points:["tl","cr"]},bottomRight:{points:["tr","bc"]},rightBottom:{points:["bl","cr"]},bottomLeft:{points:["tl","bc"]},leftBottom:{points:["br","cl"]}},Q$e=new Set(["topLeft","topRight","bottomLeft","bottomRight","leftTop","leftBottom","rightTop","rightBottom"]);function J$e(i){const{arrowWidth:e,autoAdjustOverflow:t,arrowPointAtCenter:n,offset:o,borderRadius:r,visibleFirst:s}=i,a=e/2,l={};return Object.keys(hie).forEach(c=>{const u=n&&Z$e[c]||hie[c],d=Object.assign(Object.assign({},u),{offset:[0,0],dynamicInset:!0});switch(l[c]=d,Q$e.has(c)&&(d.autoArrow=!1),c){case"top":case"topLeft":case"topRight":d.offset[1]=-a-o;break;case"bottom":case"bottomLeft":case"bottomRight":d.offset[1]=a+o;break;case"left":case"leftTop":case"leftBottom":d.offset[0]=-a-o;break;case"right":case"rightTop":case"rightBottom":d.offset[0]=a+o;break}const h=Yme({contentRadius:r,limitVerticalRadius:!0});if(n)switch(c){case"topLeft":case"bottomLeft":d.offset[0]=-h.arrowOffsetHorizontal-a;break;case"topRight":case"bottomRight":d.offset[0]=h.arrowOffsetHorizontal+a;break;case"leftTop":case"rightTop":d.offset[1]=-h.arrowOffsetHorizontal-a;break;case"leftBottom":case"rightBottom":d.offset[1]=h.arrowOffsetHorizontal+a;break}d.overflow=Y$e(c,h,e,t),s&&(d.htmlRegion="visibleFirst")}),l}const eze=i=>{const{componentCls:e,tooltipMaxWidth:t,tooltipColor:n,tooltipBg:o,tooltipBorderRadius:r,zIndexPopup:s,controlHeight:a,boxShadowSecondary:l,paddingSM:c,paddingXS:u}=i;return[{[e]:Object.assign(Object.assign(Object.assign(Object.assign({},Pa(i)),{position:"absolute",zIndex:s,display:"block",width:"max-content",maxWidth:t,visibility:"visible",transformOrigin:"var(--arrow-x, 50%) var(--arrow-y, 50%)","&-hidden":{display:"none"},"--antd-arrow-background-color":o,[`${e}-inner`]:{minWidth:a,minHeight:a,padding:`${rt(i.calc(c).div(2).equal())} ${rt(u)}`,color:n,textAlign:"start",textDecoration:"none",wordWrap:"break-word",backgroundColor:o,borderRadius:r,boxShadow:l,boxSizing:"border-box"},[["&-placement-left","&-placement-leftTop","&-placement-leftBottom","&-placement-right","&-placement-rightTop","&-placement-rightBottom"].join(",")]:{[`${e}-inner`]:{borderRadius:i.min(r,Xme)}},[`${e}-content`]:{position:"relative"}}),h6e(i,(d,h)=>{let{darkColor:f}=h;return{[`&${e}-${d}`]:{[`${e}-inner`]:{backgroundColor:f},[`${e}-arrow`]:{"--antd-arrow-background-color":f}}}})),{"&-rtl":{direction:"rtl"}})},X$e(i,"var(--antd-arrow-background-color)"),{[`${e}-pure`]:{position:"relative",maxWidth:"none",margin:i.sizePopupArrow}}]},tze=i=>Object.assign(Object.assign({zIndexPopup:i.zIndexPopupBase+70},Yme({contentRadius:i.borderRadius,limitVerticalRadius:!0})),q$e(lr(i,{borderRadiusOuter:Math.min(i.borderRadiusOuter,4)})));var Zme=function(i){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return jc("Tooltip",n=>{const{borderRadius:o,colorTextLightSolid:r,colorBgSpotlight:s}=n,a=lr(n,{tooltipMaxWidth:250,tooltipColor:r,tooltipBorderRadius:o,tooltipBg:s});return[eze(a),gme(n,"zoom-big-fast")]},tze,{resetStyle:!1,injectStyle:e})(i)};const nze=bA.map(i=>`${i}-inverse`);function ize(i){return(arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0)?[].concat(_t(nze),_t(bA)).includes(i):bA.includes(i)}function Qme(i,e){const t=ize(e),n=Ue({[`${i}-${e}`]:e&&t}),o={},r={};return e&&!t&&(o.background=e,r["--antd-arrow-background-color"]=e),{className:n,overlayStyle:o,arrowStyle:r}}const oze=i=>{const{prefixCls:e,className:t,placement:n="top",title:o,color:r,overlayInnerStyle:s}=i,{getPrefixCls:a}=x.exports.useContext(Hi),l=a("tooltip",e),[c,u,d]=Zme(l),h=Qme(l,r),f=h.arrowStyle,g=Object.assign(Object.assign({},s),h.overlayStyle),p=Ue(u,d,l,`${l}-pure`,`${l}-placement-${n}`,t,h.className);return c(x.exports.createElement("div",{className:p,style:f},x.exports.createElement("div",{className:`${l}-arrow`}),x.exports.createElement(Gme,Object.assign({},i,{className:u,prefixCls:l,overlayInnerStyle:g}),o)))};var rze=oze,sze=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(i);o{var t,n;const{prefixCls:o,openClassName:r,getTooltipContainer:s,overlayClassName:a,color:l,overlayInnerStyle:c,children:u,afterOpenChange:d,afterVisibleChange:h,destroyTooltipOnHide:f,arrow:g=!0,title:p,overlay:v,builtinPlacements:m,arrowPointAtCenter:_=!1,autoAdjustOverflow:y=!0}=i,w=!!g,[,L]=Ba(),{getPopupContainer:D,getPrefixCls:E,direction:I}=x.exports.useContext(Hi),k=S4(),R=x.exports.useRef(null),A=()=>{var U;(U=R.current)===null||U===void 0||U.forceAlign()};x.exports.useImperativeHandle(e,()=>({forceAlign:A,forcePopupAlign:()=>{k.deprecated(!1,"forcePopupAlign","forceAlign"),A()}}));const[P,N]=Kl(!1,{value:(t=i.open)!==null&&t!==void 0?t:i.visible,defaultValue:(n=i.defaultOpen)!==null&&n!==void 0?n:i.defaultVisible}),M=!p&&!v&&p!==0,H=U=>{var Y,oe;N(M?!1:U),M||((Y=i.onOpenChange)===null||Y===void 0||Y.call(i,U),(oe=i.onVisibleChange)===null||oe===void 0||oe.call(i,U))},B=x.exports.useMemo(()=>{var U,Y;let oe=_;return typeof g=="object"&&(oe=(Y=(U=g.pointAtCenter)!==null&&U!==void 0?U:g.arrowPointAtCenter)!==null&&Y!==void 0?Y:_),m||J$e({arrowPointAtCenter:oe,autoAdjustOverflow:y,arrowWidth:w?L.sizePopupArrow:0,borderRadius:L.borderRadius,offset:L.marginXXS,visibleFirst:!0})},[_,g,m,L]),F=x.exports.useMemo(()=>p===0?p:v||p||"",[v,p]),$=x.exports.createElement(xA,null,typeof F=="function"?F():F),{getPopupContainer:z,placement:K="top",mouseEnterDelay:j=.1,mouseLeaveDelay:G=.1,overlayStyle:X,rootClassName:de}=i,fe=sze(i,["getPopupContainer","placement","mouseEnterDelay","mouseLeaveDelay","overlayStyle","rootClassName"]),pe=E("tooltip",o),be=E(),Se=i["data-popover-inject"];let Fe=P;!("open"in i)&&!("visible"in i)&&M&&(Fe=!1);const De=sw(u)&&!Dpe(u)?u:x.exports.createElement("span",null,u),ce=De.props,Pe=!ce.className||typeof ce.className=="string"?Ue(ce.className,r||`${pe}-open`):ce.className,[Oe,xe,Ee]=Zme(pe,!Se),tt=Qme(pe,l),nt=tt.arrowStyle,Qe=Object.assign(Object.assign({},c),tt.overlayStyle),Ge=Ue(a,{[`${pe}-rtl`]:I==="rtl"},tt.className,de,xe,Ee),[re,ie]=jK("Tooltip",fe.zIndex),se=x.exports.createElement(K$e,Object.assign({},fe,{zIndex:re,showArrow:w,placement:K,mouseEnterDelay:j,mouseLeaveDelay:G,prefixCls:pe,overlayClassName:Ge,overlayStyle:Object.assign(Object.assign({},nt),X),getTooltipContainer:z||s||D,ref:R,builtinPlacements:B,overlay:$,visible:Fe,onVisibleChange:H,afterVisibleChange:d!=null?d:h,overlayInnerStyle:Qe,arrowContent:x.exports.createElement("span",{className:`${pe}-arrow-content`}),motion:{motionName:j0(be,"zoom-big-fast",i.transitionName),motionDeadline:1e3},destroyTooltipOnHide:!!f}),Fe?mv(De,{className:Pe}):De);return Oe(x.exports.createElement(zK.Provider,{value:ie},se))});Jme._InternalPanelDoNotUseOrYouWillBeFired=rze;var aze=Jme,lze=at.ESC,cze=at.TAB;function uze(i){var e=i.visible,t=i.triggerRef,n=i.onVisibleChange,o=i.autoFocus,r=i.overlayRef,s=x.exports.useRef(!1),a=function(){if(e){var d,h;(d=t.current)===null||d===void 0||(h=d.focus)===null||h===void 0||h.call(d),n==null||n(!1)}},l=function(){var d;return(d=r.current)!==null&&d!==void 0&&d.focus?(r.current.focus(),s.current=!0,!0):!1},c=function(d){switch(d.keyCode){case lze:a();break;case cze:{var h=!1;s.current||(h=l()),h?d.preventDefault():a();break}}};x.exports.useEffect(function(){return e?(window.addEventListener("keydown",c),o&&Xi(l,3),function(){window.removeEventListener("keydown",c),s.current=!1}):function(){s.current=!1}},[e])}var dze=x.exports.forwardRef(function(i,e){var t=i.overlay,n=i.arrow,o=i.prefixCls,r=x.exports.useMemo(function(){var a;return typeof t=="function"?a=t():a=t,a},[t]),s=eh(e,r==null?void 0:r.ref);return fn(ks,{children:[n&&he("div",{className:"".concat(o,"-arrow")}),Bt.cloneElement(r,{ref:Kv(r)?s:void 0})]})}),M1={adjustX:1,adjustY:1},A1=[0,0],hze={topLeft:{points:["bl","tl"],overflow:M1,offset:[0,-4],targetOffset:A1},top:{points:["bc","tc"],overflow:M1,offset:[0,-4],targetOffset:A1},topRight:{points:["br","tr"],overflow:M1,offset:[0,-4],targetOffset:A1},bottomLeft:{points:["tl","bl"],overflow:M1,offset:[0,4],targetOffset:A1},bottom:{points:["tc","bc"],overflow:M1,offset:[0,4],targetOffset:A1},bottomRight:{points:["tr","br"],overflow:M1,offset:[0,4],targetOffset:A1}},fze=["arrow","prefixCls","transitionName","animation","align","placement","placements","getPopupContainer","showAction","hideAction","overlayClassName","overlayStyle","visible","trigger","autoFocus","overlay","children","onVisibleChange"];function gze(i,e){var t,n=i.arrow,o=n===void 0?!1:n,r=i.prefixCls,s=r===void 0?"rc-dropdown":r,a=i.transitionName,l=i.animation,c=i.align,u=i.placement,d=u===void 0?"bottomLeft":u,h=i.placements,f=h===void 0?hze:h,g=i.getPopupContainer,p=i.showAction,v=i.hideAction,m=i.overlayClassName,_=i.overlayStyle,y=i.visible,w=i.trigger,L=w===void 0?["hover"]:w,D=i.autoFocus,E=i.overlay,I=i.children,k=i.onVisibleChange,R=Hn(i,fze),A=Bt.useState(),P=Ne(A,2),N=P[0],M=P[1],H="visible"in i?y:N,B=Bt.useRef(null),F=Bt.useRef(null),$=Bt.useRef(null);Bt.useImperativeHandle(e,function(){return B.current});var z=function(Se){M(Se),k==null||k(Se)};uze({visible:H,triggerRef:$,onVisibleChange:z,autoFocus:D,overlayRef:F});var K=function(Se){var Fe=i.onOverlayClick;M(!1),Fe&&Fe(Se)},j=function(){return Bt.createElement(dze,{ref:F,overlay:E,prefixCls:s,arrow:o})},G=function(){return typeof E=="function"?j:j()},X=function(){var Se=i.minOverlayWidthMatchTrigger,Fe=i.alignPoint;return"minOverlayWidthMatchTrigger"in i?Se:!Fe},de=function(){var Se=i.openClassName;return Se!==void 0?Se:"".concat(s,"-open")},fe=Bt.cloneElement(I,{className:Ue((t=I.props)===null||t===void 0?void 0:t.className,H&&de()),ref:Kv(I)?eh($,I.ref):void 0}),pe=v;return!pe&&L.indexOf("contextMenu")!==-1&&(pe=["click"]),Bt.createElement(R4,yt({builtinPlacements:f},R,{prefixCls:s,ref:B,popupClassName:Ue(m,me({},"".concat(s,"-show-arrow"),o)),popupStyle:_,action:L,showAction:p,hideAction:pe,popupPlacement:d,popupAlign:c,popupTransitionName:a,popupAnimation:l,popupVisible:H,stretch:X()?"minWidth":"",popup:G(),onPopupVisibleChange:z,onPopupClick:K,getPopupContainer:g}),fe)}var pze=Bt.forwardRef(gze),eve=x.exports.createContext(null);function tve(i,e){return i===void 0?null:"".concat(i,"-").concat(e)}function nve(i){var e=x.exports.useContext(eve);return tve(e,i)}var mze=["children","locked"],jd=x.exports.createContext(null);function vze(i,e){var t=Ce({},i);return Object.keys(e).forEach(function(n){var o=e[n];o!==void 0&&(t[n]=o)}),t}function bD(i){var e=i.children,t=i.locked,n=Hn(i,mze),o=x.exports.useContext(jd),r=SI(function(){return vze(o,n)},[o,n],function(s,a){return!t&&(s[0]!==a[0]||!b4(s[1],a[1],!0))});return x.exports.createElement(jd.Provider,{value:r},e)}var _ze=[],ive=x.exports.createContext(null);function M4(){return x.exports.useContext(ive)}var ove=x.exports.createContext(_ze);function RI(i){var e=x.exports.useContext(ove);return x.exports.useMemo(function(){return i!==void 0?[].concat(_t(e),[i]):e},[e,i])}var rve=x.exports.createContext(null),fq=x.exports.createContext({});function fie(i){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(k4(i)){var t=i.nodeName.toLowerCase(),n=["input","select","textarea","button"].includes(t)||i.isContentEditable||t==="a"&&!!i.getAttribute("href"),o=i.getAttribute("tabindex"),r=Number(o),s=null;return o&&!Number.isNaN(r)?s=r:n&&s===null&&(s=0),n&&i.disabled&&(s=null),s!==null&&(s>=0||e&&s<0)}return!1}function bze(i){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,t=_t(i.querySelectorAll("*")).filter(function(n){return fie(n,e)});return fie(i,e)&&t.unshift(i),t}var AW=at.LEFT,PW=at.RIGHT,OW=at.UP,KR=at.DOWN,qR=at.ENTER,sve=at.ESC,Ex=at.HOME,Dx=at.END,gie=[OW,KR,AW,PW];function Cze(i,e,t,n){var o,r,s,a,l="prev",c="next",u="children",d="parent";if(i==="inline"&&n===qR)return{inlineTrigger:!0};var h=(o={},me(o,OW,l),me(o,KR,c),o),f=(r={},me(r,AW,t?c:l),me(r,PW,t?l:c),me(r,KR,u),me(r,qR,u),r),g=(s={},me(s,OW,l),me(s,KR,c),me(s,qR,u),me(s,sve,d),me(s,AW,t?u:d),me(s,PW,t?d:u),s),p={inline:h,horizontal:f,vertical:g,inlineSub:h,horizontalSub:g,verticalSub:g},v=(a=p["".concat(i).concat(e?"":"Sub")])===null||a===void 0?void 0:a[n];switch(v){case l:return{offset:-1,sibling:!0};case c:return{offset:1,sibling:!0};case d:return{offset:-1,sibling:!1};case u:return{offset:1,sibling:!1};default:return null}}function yze(i){for(var e=i;e;){if(e.getAttribute("data-menu-list"))return e;e=e.parentElement}return null}function wze(i,e){for(var t=i||document.activeElement;t;){if(e.has(t))return t;t=t.parentElement}return null}function gq(i,e){var t=bze(i,!0);return t.filter(function(n){return e.has(n)})}function pie(i,e,t){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1;if(!i)return null;var o=gq(i,e),r=o.length,s=o.findIndex(function(a){return t===a});return n<0?s===-1?s=r-1:s-=1:n>0&&(s+=1),s=(s+r)%r,o[s]}var FW=function(e,t){var n=new Set,o=new Map,r=new Map;return e.forEach(function(s){var a=document.querySelector("[data-menu-id='".concat(tve(t,s),"']"));a&&(n.add(a),r.set(a,s),o.set(s,a))}),{elements:n,key2element:o,element2key:r}};function Sze(i,e,t,n,o,r,s,a,l,c){var u=x.exports.useRef(),d=x.exports.useRef();d.current=e;var h=function(){Xi.cancel(u.current)};return x.exports.useEffect(function(){return function(){h()}},[]),function(f){var g=f.which;if([].concat(gie,[qR,sve,Ex,Dx]).includes(g)){var p=r(),v=FW(p,n),m=v,_=m.elements,y=m.key2element,w=m.element2key,L=y.get(e),D=wze(L,_),E=w.get(D),I=Cze(i,s(E,!0).length===1,t,g);if(!I&&g!==Ex&&g!==Dx)return;(gie.includes(g)||[Ex,Dx].includes(g))&&f.preventDefault();var k=function(F){if(F){var $=F,z=F.querySelector("a");z!=null&&z.getAttribute("href")&&($=z);var K=w.get(F);a(K),h(),u.current=Xi(function(){d.current===K&&$.focus()})}};if([Ex,Dx].includes(g)||I.sibling||!D){var R;!D||i==="inline"?R=o.current:R=yze(D);var A,P=gq(R,_);g===Ex?A=P[0]:g===Dx?A=P[P.length-1]:A=pie(R,_,D,I.offset),k(A)}else if(I.inlineTrigger)l(E);else if(I.offset>0)l(E,!0),h(),u.current=Xi(function(){v=FW(p,n);var B=D.getAttribute("aria-controls"),F=document.getElementById(B),$=pie(F,v.elements);k($)},5);else if(I.offset<0){var N=s(E,!0),M=N[N.length-2],H=y.get(M);l(M,!1),k(H)}}c==null||c(f)}}function xze(i){Promise.resolve().then(i)}var pq="__RC_UTIL_PATH_SPLIT__",mie=function(e){return e.join(pq)},Lze=function(e){return e.split(pq)},BW="rc-menu-more";function Eze(){var i=x.exports.useState({}),e=Ne(i,2),t=e[1],n=x.exports.useRef(new Map),o=x.exports.useRef(new Map),r=x.exports.useState([]),s=Ne(r,2),a=s[0],l=s[1],c=x.exports.useRef(0),u=x.exports.useRef(!1),d=function(){u.current||t({})},h=x.exports.useCallback(function(y,w){var L=mie(w);o.current.set(L,y),n.current.set(y,L),c.current+=1;var D=c.current;xze(function(){D===c.current&&d()})},[]),f=x.exports.useCallback(function(y,w){var L=mie(w);o.current.delete(L),n.current.delete(y)},[]),g=x.exports.useCallback(function(y){l(y)},[]),p=x.exports.useCallback(function(y,w){var L=n.current.get(y)||"",D=Lze(L);return w&&a.includes(D[0])&&D.unshift(BW),D},[a]),v=x.exports.useCallback(function(y,w){return y.some(function(L){var D=p(L,!0);return D.includes(w)})},[p]),m=function(){var w=_t(n.current.keys());return a.length&&w.push(BW),w},_=x.exports.useCallback(function(y){var w="".concat(n.current.get(y)).concat(pq),L=new Set;return _t(o.current.keys()).forEach(function(D){D.startsWith(w)&&L.add(o.current.get(D))}),L},[]);return x.exports.useEffect(function(){return function(){u.current=!0}},[]),{registerPath:h,unregisterPath:f,refreshOverflowKeys:g,isSubPathKey:v,getKeyPath:p,getKeys:m,getSubPathKeys:_}}function mL(i){var e=x.exports.useRef(i);e.current=i;var t=x.exports.useCallback(function(){for(var n,o=arguments.length,r=new Array(o),s=0;s1&&(_.motionAppear=!1);var y=_.onVisibleChanged;return _.onVisibleChanged=function(w){return!h.current&&!w&&v(!0),y==null?void 0:y(w)},p?null:x.exports.createElement(bD,{mode:r,locked:!h.current},x.exports.createElement(th,yt({visible:m},_,{forceRender:l,removeOnLeave:!1,leavedClassName:"".concat(a,"-hidden")}),function(w){var L=w.className,D=w.style;return x.exports.createElement(mq,{id:e,className:L,style:D},o)}))}var zze=["style","className","title","eventKey","warnKey","disabled","internalPopupClose","children","itemIcon","expandIcon","popupClassName","popupOffset","popupStyle","onClick","onMouseEnter","onMouseLeave","onTitleClick","onTitleMouseEnter","onTitleMouseLeave"],Uze=["active"],jze=function(e){var t,n=e.style,o=e.className,r=e.title,s=e.eventKey;e.warnKey;var a=e.disabled,l=e.internalPopupClose,c=e.children,u=e.itemIcon,d=e.expandIcon,h=e.popupClassName,f=e.popupOffset,g=e.popupStyle,p=e.onClick,v=e.onMouseEnter,m=e.onMouseLeave,_=e.onTitleClick,y=e.onTitleMouseEnter,w=e.onTitleMouseLeave,L=Hn(e,zze),D=nve(s),E=x.exports.useContext(jd),I=E.prefixCls,k=E.mode,R=E.openKeys,A=E.disabled,P=E.overflowDisabled,N=E.activeKey,M=E.selectedKeys,H=E.itemIcon,B=E.expandIcon,F=E.onItemClick,$=E.onOpenChange,z=E.onActive,K=x.exports.useContext(fq),j=K._internalRenderSubMenuItem,G=x.exports.useContext(rve),X=G.isSubPathKey,de=RI(),fe="".concat(I,"-submenu"),pe=A||a,be=x.exports.useRef(),Se=x.exports.useRef(),Fe=u!=null?u:H,De=d!=null?d:B,ce=R.includes(s),Pe=!P&&ce,Oe=X(M,s),xe=ave(s,pe,y,w),Ee=xe.active,tt=Hn(xe,Uze),nt=x.exports.useState(!1),Qe=Ne(nt,2),Ge=Qe[0],re=Qe[1],ie=function(Lt){pe||re(Lt)},se=function(Lt){ie(!0),v==null||v({key:s,domEvent:Lt})},U=function(Lt){ie(!1),m==null||m({key:s,domEvent:Lt})},Y=x.exports.useMemo(function(){return Ee||(k!=="inline"?Ge||X([N],s):!1)},[k,Ee,N,Ge,s,X]),oe=lve(de.length),te=function(Lt){pe||(_==null||_({key:s,domEvent:Lt}),k==="inline"&&$(s,!ce))},ye=mL(function(Je){p==null||p(IA(Je)),F(Je)}),Le=function(Lt){k!=="inline"&&$(s,Lt)},Te=function(){z(s)},We=D&&"".concat(D,"-popup"),je=x.exports.createElement("div",yt({role:"menuitem",style:oe,className:"".concat(fe,"-title"),tabIndex:pe?null:-1,ref:be,title:typeof r=="string"?r:null,"data-menu-id":P&&D?null:D,"aria-expanded":Pe,"aria-haspopup":!0,"aria-controls":We,"aria-disabled":pe,onClick:te,onFocus:Te},tt),r,x.exports.createElement(cve,{icon:k!=="horizontal"?De:void 0,props:Ce(Ce({},e),{},{isOpen:Pe,isSubMenu:!0})},x.exports.createElement("i",{className:"".concat(fe,"-arrow")}))),mt=x.exports.useRef(k);if(k!=="inline"&&de.length>1?mt.current="vertical":mt.current=k,!P){var Dt=mt.current;je=x.exports.createElement(Hze,{mode:Dt,prefixCls:fe,visible:!l&&Pe&&k!=="inline",popupClassName:h,popupOffset:f,popupStyle:g,popup:x.exports.createElement(bD,{mode:Dt==="horizontal"?"vertical":Dt},x.exports.createElement(mq,{id:We,ref:Se},c)),disabled:pe,onVisibleChange:Le},je)}var At=x.exports.createElement(sf.Item,yt({role:"none"},L,{component:"li",style:n,className:Ue(fe,"".concat(fe,"-").concat(k),o,(t={},me(t,"".concat(fe,"-open"),Pe),me(t,"".concat(fe,"-active"),Y),me(t,"".concat(fe,"-selected"),Oe),me(t,"".concat(fe,"-disabled"),pe),t)),onMouseEnter:se,onMouseLeave:U}),je,!P&&x.exports.createElement($ze,{id:We,open:Pe,keyPath:de},c));return j&&(At=j(At,e,{selected:Oe,active:Y,open:Pe,disabled:pe})),x.exports.createElement(bD,{onItemClick:ye,mode:k==="horizontal"?"vertical":k,itemIcon:Fe,expandIcon:De},At)};function _q(i){var e=i.eventKey,t=i.children,n=RI(e),o=vq(t,n),r=M4();x.exports.useEffect(function(){if(r)return r.registerPath(e,n),function(){r.unregisterPath(e,n)}},[n]);var s;return r?s=o:s=x.exports.createElement(jze,i,o),x.exports.createElement(ove.Provider,{value:n},s)}var Kze=["className","title","eventKey","children"],qze=["children"],Gze=function(e){var t=e.className,n=e.title;e.eventKey;var o=e.children,r=Hn(e,Kze),s=x.exports.useContext(jd),a=s.prefixCls,l="".concat(a,"-item-group");return x.exports.createElement("li",yt({role:"presentation"},r,{onClick:function(u){return u.stopPropagation()},className:Ue(l,t)}),x.exports.createElement("div",{role:"presentation",className:"".concat(l,"-title"),title:typeof n=="string"?n:void 0},n),x.exports.createElement("ul",{role:"group",className:"".concat(l,"-list")},o))};function dve(i){var e=i.children,t=Hn(i,qze),n=RI(t.eventKey),o=vq(e,n),r=M4();return r?o:x.exports.createElement(Gze,kf(t,["warnKey"]),o)}function hve(i){var e=i.className,t=i.style,n=x.exports.useContext(jd),o=n.prefixCls,r=M4();return r?null:x.exports.createElement("li",{role:"separator",className:Ue("".concat(o,"-item-divider"),e),style:t})}var Xze=["label","children","key","type"];function WW(i){return(i||[]).map(function(e,t){if(e&&Kn(e)==="object"){var n=e,o=n.label,r=n.children,s=n.key,a=n.type,l=Hn(n,Xze),c=s!=null?s:"tmp-".concat(t);return r||a==="group"?a==="group"?x.exports.createElement(dve,yt({key:c},l,{title:o}),WW(r)):x.exports.createElement(_q,yt({key:c},l,{title:o}),WW(r)):a==="divider"?x.exports.createElement(hve,yt({key:c},l)):x.exports.createElement(A4,yt({key:c},l),o)}return null}).filter(function(e){return e})}function Yze(i,e,t){var n=i;return e&&(n=WW(e)),vq(n,t)}var Zze=["prefixCls","rootClassName","style","className","tabIndex","items","children","direction","id","mode","inlineCollapsed","disabled","disabledOverflow","subMenuOpenDelay","subMenuCloseDelay","forceSubMenuRender","defaultOpenKeys","openKeys","activeKey","defaultActiveFirst","selectable","multiple","defaultSelectedKeys","selectedKeys","onSelect","onDeselect","inlineIndent","motion","defaultMotions","triggerSubMenuAction","builtinPlacements","itemIcon","expandIcon","overflowedIndicator","overflowedIndicatorPopupClassName","getPopupContainer","onClick","onOpenChange","onKeyDown","openAnimation","openTransitionName","_internalRenderMenuItem","_internalRenderSubMenuItem"],P1=[],Qze=x.exports.forwardRef(function(i,e){var t,n,o=i,r=o.prefixCls,s=r===void 0?"rc-menu":r,a=o.rootClassName,l=o.style,c=o.className,u=o.tabIndex,d=u===void 0?0:u,h=o.items,f=o.children,g=o.direction,p=o.id,v=o.mode,m=v===void 0?"vertical":v,_=o.inlineCollapsed,y=o.disabled,w=o.disabledOverflow,L=o.subMenuOpenDelay,D=L===void 0?.1:L,E=o.subMenuCloseDelay,I=E===void 0?.1:E,k=o.forceSubMenuRender,R=o.defaultOpenKeys,A=o.openKeys,P=o.activeKey,N=o.defaultActiveFirst,M=o.selectable,H=M===void 0?!0:M,B=o.multiple,F=B===void 0?!1:B,$=o.defaultSelectedKeys,z=o.selectedKeys,K=o.onSelect,j=o.onDeselect,G=o.inlineIndent,X=G===void 0?24:G,de=o.motion,fe=o.defaultMotions,pe=o.triggerSubMenuAction,be=pe===void 0?"hover":pe,Se=o.builtinPlacements,Fe=o.itemIcon,De=o.expandIcon,ce=o.overflowedIndicator,Pe=ce===void 0?"...":ce,Oe=o.overflowedIndicatorPopupClassName,xe=o.getPopupContainer,Ee=o.onClick,tt=o.onOpenChange,nt=o.onKeyDown;o.openAnimation,o.openTransitionName;var Qe=o._internalRenderMenuItem,Ge=o._internalRenderSubMenuItem,re=Hn(o,Zze),ie=x.exports.useMemo(function(){return Yze(f,h,P1)},[f,h]),se=x.exports.useState(!1),U=Ne(se,2),Y=U[0],oe=U[1],te=x.exports.useRef(),ye=kze(p),Le=g==="rtl",Te=Kl(R,{value:A,postState:function(gi){return gi||P1}}),We=Ne(Te,2),je=We[0],mt=We[1],Dt=function(gi){var Kt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;function on(){mt(gi),tt==null||tt(gi)}Kt?zd.exports.flushSync(on):on()},At=x.exports.useState(je),Je=Ne(At,2),Lt=Je[0],Ot=Je[1],Vn=x.exports.useRef(!1),Et=x.exports.useMemo(function(){return(m==="inline"||m==="vertical")&&_?["vertical",_]:[m,!1]},[m,_]),tn=Ne(Et,2),ui=tn[0],cn=tn[1],qn=ui==="inline",bn=x.exports.useState(ui),Pt=Ne(bn,2),qt=Pt[0],Nt=Pt[1],jt=x.exports.useState(cn),Gt=Ne(jt,2),It=Gt[0],Ft=Gt[1];x.exports.useEffect(function(){Nt(ui),Ft(cn),Vn.current&&(qn?mt(Lt):Dt(P1))},[ui,cn]);var bt=x.exports.useState(0),Zt=Ne(bt,2),wn=Zt[0],Dn=Zt[1],Gn=wn>=ie.length-1||qt!=="horizontal"||w;x.exports.useEffect(function(){qn&&Ot(je)},[je]),x.exports.useEffect(function(){return Vn.current=!0,function(){Vn.current=!1}},[]);var Un=Eze(),Zi=Un.registerPath,an=Un.unregisterPath,Xt=Un.refreshOverflowKeys,oi=Un.isSubPathKey,Ze=Un.getKeyPath,ue=Un.getKeys,Ve=Un.getSubPathKeys,ot=x.exports.useMemo(function(){return{registerPath:Zi,unregisterPath:an}},[Zi,an]),Sn=x.exports.useMemo(function(){return{isSubPathKey:oi}},[oi]);x.exports.useEffect(function(){Xt(Gn?P1:ie.slice(wn+1).map(function(mi){return mi.key}))},[wn,Gn]);var $n=Kl(P||N&&((t=ie[0])===null||t===void 0?void 0:t.key),{value:P}),Ci=Ne($n,2),An=Ci[0],lo=Ci[1],Qo=mL(function(mi){lo(mi)}),zo=mL(function(){lo(void 0)});x.exports.useImperativeHandle(e,function(){return{list:te.current,focus:function(gi){var Kt,on=ue(),vi=FW(on,ye),Uo=vi.elements,Qi=vi.key2element,Jo=vi.element2key,_r=gq(te.current,Uo),zs=An!=null?An:_r[0]?Jo.get(_r[0]):(Kt=ie.find(function(Ts){return!Ts.props.disabled}))===null||Kt===void 0?void 0:Kt.key,Tr=Qi.get(zs);if(zs&&Tr){var us;Tr==null||(us=Tr.focus)===null||us===void 0||us.call(Tr,gi)}}}});var oc=Kl($||[],{value:z,postState:function(gi){return Array.isArray(gi)?gi:gi==null?P1:[gi]}}),Yc=Ne(oc,2),Gr=Yc[0],Ua=Yc[1],vl=function(gi){if(H){var Kt=gi.key,on=Gr.includes(Kt),vi;F?on?vi=Gr.filter(function(Qi){return Qi!==Kt}):vi=[].concat(_t(Gr),[Kt]):vi=[Kt],Ua(vi);var Uo=Ce(Ce({},gi),{},{selectedKeys:vi});on?j==null||j(Uo):K==null||K(Uo)}!F&&je.length&&qt!=="inline"&&Dt(P1)},ba=mL(function(mi){Ee==null||Ee(IA(mi)),vl(mi)}),_l=mL(function(mi,gi){var Kt=je.filter(function(vi){return vi!==mi});if(gi)Kt.push(mi);else if(qt!=="inline"){var on=Ve(mi);Kt=Kt.filter(function(vi){return!on.has(vi)})}b4(je,Kt,!0)||Dt(Kt,!0)}),rc=function(gi,Kt){var on=Kt!=null?Kt:!je.includes(gi);_l(gi,on)},Zc=Sze(qt,An,Le,ye,te,ue,Ze,lo,rc,nt);x.exports.useEffect(function(){oe(!0)},[]);var Ca=x.exports.useMemo(function(){return{_internalRenderMenuItem:Qe,_internalRenderSubMenuItem:Ge}},[Qe,Ge]),Yu=qt!=="horizontal"||w?ie:ie.map(function(mi,gi){return x.exports.createElement(bD,{key:mi.key,overflowDisabled:gi>wn},mi)}),bl=x.exports.createElement(sf,yt({id:p,ref:te,prefixCls:"".concat(s,"-overflow"),component:"ul",itemComponent:A4,className:Ue(s,"".concat(s,"-root"),"".concat(s,"-").concat(qt),c,(n={},me(n,"".concat(s,"-inline-collapsed"),It),me(n,"".concat(s,"-rtl"),Le),n),a),dir:g,style:l,role:"menu",tabIndex:d,data:Yu,renderRawItem:function(gi){return gi},renderRawRest:function(gi){var Kt=gi.length,on=Kt?ie.slice(-Kt):null;return x.exports.createElement(_q,{eventKey:BW,title:Pe,disabled:Gn,internalPopupClose:Kt===0,popupClassName:Oe},on)},maxCount:qt!=="horizontal"||w?sf.INVALIDATE:sf.RESPONSIVE,ssr:"full","data-menu-list":!0,onVisibleChange:function(gi){Dn(gi)},onKeyDown:Zc},re));return x.exports.createElement(fq.Provider,{value:Ca},x.exports.createElement(eve.Provider,{value:ye},x.exports.createElement(bD,{prefixCls:s,rootClassName:a,mode:qt,openKeys:je,rtl:Le,disabled:y,motion:Y?de:null,defaultMotions:Y?fe:null,activeKey:An,onActive:Qo,onInactive:zo,selectedKeys:Gr,inlineIndent:X,subMenuOpenDelay:D,subMenuCloseDelay:I,forceSubMenuRender:k,builtinPlacements:Se,triggerSubMenuAction:be,getPopupContainer:xe,itemIcon:Fe,expandIcon:De,onItemClick:ba,onOpenChange:_l},x.exports.createElement(rve.Provider,{value:Sn},bl),x.exports.createElement("div",{style:{display:"none"},"aria-hidden":!0},x.exports.createElement(ive.Provider,{value:ot},ie)))))}),MI=Qze;MI.Item=A4;MI.SubMenu=_q;MI.ItemGroup=dve;MI.Divider=hve;var Jze={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M176 511a56 56 0 10112 0 56 56 0 10-112 0zm280 0a56 56 0 10112 0 56 56 0 10-112 0zm280 0a56 56 0 10112 0 56 56 0 10-112 0z"}}]},name:"ellipsis",theme:"outlined"},eUe=Jze,tUe=function(e,t){return x.exports.createElement(cr,yt({},e,{ref:t,icon:eUe}))},nUe=x.exports.forwardRef(tUe);function iUe(i){return lr(i,{inputAffixPadding:i.paddingXXS})}const oUe=i=>{const{controlHeight:e,fontSize:t,lineHeight:n,lineWidth:o,controlHeightSM:r,controlHeightLG:s,fontSizeLG:a,lineHeightLG:l,paddingSM:c,controlPaddingHorizontalSM:u,controlPaddingHorizontal:d,colorFillAlter:h,colorPrimaryHover:f,colorPrimary:g,controlOutlineWidth:p,controlOutline:v,colorErrorOutline:m,colorWarningOutline:_,colorBgContainer:y}=i;return{paddingBlock:Math.max(Math.round((e-t*n)/2*10)/10-o,0),paddingBlockSM:Math.max(Math.round((r-t*n)/2*10)/10-o,0),paddingBlockLG:Math.ceil((s-a*l)/2*10)/10-o,paddingInline:c-o,paddingInlineSM:u-o,paddingInlineLG:d-o,addonBg:h,activeBorderColor:g,hoverBorderColor:f,activeShadow:`0 0 0 ${p}px ${v}`,errorActiveShadow:`0 0 0 ${p}px ${m}`,warningActiveShadow:`0 0 0 ${p}px ${_}`,hoverBg:y,activeBg:y,inputFontSize:t,inputFontSizeLG:a,inputFontSizeSM:t}},rUe=i=>({borderColor:i.hoverBorderColor,backgroundColor:i.hoverBg}),bq=i=>({color:i.colorTextDisabled,backgroundColor:i.colorBgContainerDisabled,borderColor:i.colorBorder,boxShadow:"none",cursor:"not-allowed",opacity:1,"&:hover:not([disabled])":Object.assign({},rUe(lr(i,{hoverBorderColor:i.colorBorder,hoverBg:i.colorBgContainerDisabled})))}),fve=(i,e)=>({background:i.colorBgContainer,borderWidth:i.lineWidth,borderStyle:i.lineType,borderColor:e.borderColor,"&:hover":{borderColor:e.hoverBorderColor,backgroundColor:i.hoverBg},"&:focus, &:focus-within":{borderColor:e.activeBorderColor,boxShadow:e.activeShadow,outline:0,backgroundColor:i.activeBg}}),_ie=(i,e)=>({[`&${i.componentCls}-status-${e.status}:not(${i.componentCls}-disabled)`]:Object.assign(Object.assign({},fve(i,e)),{[`${i.componentCls}-prefix, ${i.componentCls}-suffix`]:{color:e.affixColor}})}),sUe=(i,e)=>({"&-outlined":Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},fve(i,{borderColor:i.colorBorder,hoverBorderColor:i.colorPrimaryHover,activeBorderColor:i.colorPrimary,activeShadow:i.activeShadow})),{[`&${i.componentCls}-disabled, &[disabled]`]:Object.assign({},bq(i))}),_ie(i,{status:"error",borderColor:i.colorError,hoverBorderColor:i.colorErrorBorderHover,activeBorderColor:i.colorError,activeShadow:i.errorActiveShadow,affixColor:i.colorError})),_ie(i,{status:"warning",borderColor:i.colorWarning,hoverBorderColor:i.colorWarningBorderHover,activeBorderColor:i.colorWarning,activeShadow:i.warningActiveShadow,affixColor:i.colorWarning})),e)}),bie=(i,e)=>({[`&${i.componentCls}-group-wrapper-status-${e.status}`]:{[`${i.componentCls}-group-addon`]:{borderColor:e.addonBorderColor,color:e.addonColor}}}),aUe=i=>({"&-outlined":Object.assign(Object.assign(Object.assign({[`${i.componentCls}-group`]:{"&-addon":{background:i.addonBg,border:`${rt(i.lineWidth)} ${i.lineType} ${i.colorBorder}`},"&-addon:first-child":{borderInlineEnd:0},"&-addon:last-child":{borderInlineStart:0}}},bie(i,{status:"error",addonBorderColor:i.colorError,addonColor:i.colorErrorText})),bie(i,{status:"warning",addonBorderColor:i.colorWarning,addonColor:i.colorWarningText})),{[`&${i.componentCls}-group-wrapper-disabled`]:{[`${i.componentCls}-group-addon`]:Object.assign({},bq(i))}})}),lUe=(i,e)=>({"&-borderless":Object.assign({background:"transparent",border:"none","&:focus, &:focus-within":{outline:"none"},[`&${i.componentCls}-disabled, &[disabled]`]:{color:i.colorTextDisabled}},e)}),gve=(i,e)=>({background:e.bg,borderWidth:i.lineWidth,borderStyle:i.lineType,borderColor:"transparent",["input&, & input, textarea&, & textarea"]:{color:e==null?void 0:e.inputColor},"&:hover":{background:e.hoverBg},"&:focus, &:focus-within":{outline:0,borderColor:e.activeBorderColor,backgroundColor:i.activeBg}}),Cie=(i,e)=>({[`&${i.componentCls}-status-${e.status}:not(${i.componentCls}-disabled)`]:Object.assign(Object.assign({},gve(i,e)),{[`${i.componentCls}-prefix, ${i.componentCls}-suffix`]:{color:e.affixColor}})}),cUe=(i,e)=>({"&-filled":Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},gve(i,{bg:i.colorFillTertiary,hoverBg:i.colorFillSecondary,activeBorderColor:i.colorPrimary})),{[`&${i.componentCls}-disabled, &[disabled]`]:Object.assign({},bq(i))}),Cie(i,{status:"error",bg:i.colorErrorBg,hoverBg:i.colorErrorBgHover,activeBorderColor:i.colorError,inputColor:i.colorErrorText,affixColor:i.colorError})),Cie(i,{status:"warning",bg:i.colorWarningBg,hoverBg:i.colorWarningBgHover,activeBorderColor:i.colorWarning,inputColor:i.colorWarningText,affixColor:i.colorWarning})),e)}),yie=(i,e)=>({[`&${i.componentCls}-group-wrapper-status-${e.status}`]:{[`${i.componentCls}-group-addon`]:{background:e.addonBg,color:e.addonColor}}}),uUe=i=>({"&-filled":Object.assign(Object.assign(Object.assign({[`${i.componentCls}-group`]:{"&-addon":{background:i.colorFillTertiary},[`${i.componentCls}-filled:not(:focus):not(:focus-within)`]:{"&:not(:first-child)":{borderInlineStart:`${rt(i.lineWidth)} ${i.lineType} ${i.colorSplit}`},"&:not(:last-child)":{borderInlineEnd:`${rt(i.lineWidth)} ${i.lineType} ${i.colorSplit}`}}}},yie(i,{status:"error",addonBg:i.colorErrorBg,addonColor:i.colorErrorText})),yie(i,{status:"warning",addonBg:i.colorWarningBg,addonColor:i.colorWarningText})),{[`&${i.componentCls}-group-wrapper-disabled`]:{[`${i.componentCls}-group`]:{"&-addon":{background:i.colorFillTertiary,color:i.colorTextDisabled},"&-addon:first-child":{borderInlineStart:`${rt(i.lineWidth)} ${i.lineType} ${i.colorBorder}`,borderTop:`${rt(i.lineWidth)} ${i.lineType} ${i.colorBorder}`,borderBottom:`${rt(i.lineWidth)} ${i.lineType} ${i.colorBorder}`},"&-addon:last-child":{borderInlineEnd:`${rt(i.lineWidth)} ${i.lineType} ${i.colorBorder}`,borderTop:`${rt(i.lineWidth)} ${i.lineType} ${i.colorBorder}`,borderBottom:`${rt(i.lineWidth)} ${i.lineType} ${i.colorBorder}`}}}})}),dUe=i=>({"&::-moz-placeholder":{opacity:1},"&::placeholder":{color:i,userSelect:"none"},"&:placeholder-shown":{textOverflow:"ellipsis"}}),pve=i=>{const{paddingBlockLG:e,lineHeightLG:t,borderRadiusLG:n,paddingInlineLG:o}=i;return{padding:`${rt(e)} ${rt(o)}`,fontSize:i.inputFontSizeLG,lineHeight:t,borderRadius:n}},mve=i=>({padding:`${rt(i.paddingBlockSM)} ${rt(i.paddingInlineSM)}`,fontSize:i.inputFontSizeSM,borderRadius:i.borderRadiusSM}),vve=i=>Object.assign(Object.assign({position:"relative",display:"inline-block",width:"100%",minWidth:0,padding:`${rt(i.paddingBlock)} ${rt(i.paddingInline)}`,color:i.colorText,fontSize:i.inputFontSize,lineHeight:i.lineHeight,borderRadius:i.borderRadius,transition:`all ${i.motionDurationMid}`},dUe(i.colorTextPlaceholder)),{"textarea&":{maxWidth:"100%",height:"auto",minHeight:i.controlHeight,lineHeight:i.lineHeight,verticalAlign:"bottom",transition:`all ${i.motionDurationSlow}, height 0s`,resize:"vertical"},"&-lg":Object.assign({},pve(i)),"&-sm":Object.assign({},mve(i)),"&-rtl":{direction:"rtl"},"&-textarea-rtl":{direction:"rtl"}}),hUe=i=>{const{componentCls:e,antCls:t}=i;return{position:"relative",display:"table",width:"100%",borderCollapse:"separate",borderSpacing:0,["&[class*='col-']"]:{paddingInlineEnd:i.paddingXS,"&:last-child":{paddingInlineEnd:0}},[`&-lg ${e}, &-lg > ${e}-group-addon`]:Object.assign({},pve(i)),[`&-sm ${e}, &-sm > ${e}-group-addon`]:Object.assign({},mve(i)),[`&-lg ${t}-select-single ${t}-select-selector`]:{height:i.controlHeightLG},[`&-sm ${t}-select-single ${t}-select-selector`]:{height:i.controlHeightSM},[`> ${e}`]:{display:"table-cell","&:not(:first-child):not(:last-child)":{borderRadius:0}},[`${e}-group`]:{["&-addon, &-wrap"]:{display:"table-cell",width:1,whiteSpace:"nowrap",verticalAlign:"middle","&:not(:first-child):not(:last-child)":{borderRadius:0}},"&-wrap > *":{display:"block !important"},"&-addon":{position:"relative",padding:`0 ${rt(i.paddingInline)}`,color:i.colorText,fontWeight:"normal",fontSize:i.inputFontSize,textAlign:"center",borderRadius:i.borderRadius,transition:`all ${i.motionDurationSlow}`,lineHeight:1,[`${t}-select`]:{margin:`${rt(i.calc(i.paddingBlock).add(1).mul(-1).equal())} ${rt(i.calc(i.paddingInline).mul(-1).equal())}`,[`&${t}-select-single:not(${t}-select-customize-input):not(${t}-pagination-size-changer)`]:{[`${t}-select-selector`]:{backgroundColor:"inherit",border:`${rt(i.lineWidth)} ${i.lineType} transparent`,boxShadow:"none"}},"&-open, &-focused":{[`${t}-select-selector`]:{color:i.colorPrimary}}},[`${t}-cascader-picker`]:{margin:`-9px ${rt(i.calc(i.paddingInline).mul(-1).equal())}`,backgroundColor:"transparent",[`${t}-cascader-input`]:{textAlign:"start",border:0,boxShadow:"none"}}}},[`${e}`]:{width:"100%",marginBottom:0,textAlign:"inherit","&:focus":{zIndex:1,borderInlineEndWidth:1},"&:hover":{zIndex:1,borderInlineEndWidth:1,[`${e}-search-with-button &`]:{zIndex:0}}},[`> ${e}:first-child, ${e}-group-addon:first-child`]:{borderStartEndRadius:0,borderEndEndRadius:0,[`${t}-select ${t}-select-selector`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`> ${e}-affix-wrapper`]:{[`&:not(:first-child) ${e}`]:{borderStartStartRadius:0,borderEndStartRadius:0},[`&:not(:last-child) ${e}`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`> ${e}:last-child, ${e}-group-addon:last-child`]:{borderStartStartRadius:0,borderEndStartRadius:0,[`${t}-select ${t}-select-selector`]:{borderStartStartRadius:0,borderEndStartRadius:0}},[`${e}-affix-wrapper`]:{"&:not(:last-child)":{borderStartEndRadius:0,borderEndEndRadius:0,[`${e}-search &`]:{borderStartStartRadius:i.borderRadius,borderEndStartRadius:i.borderRadius}},[`&:not(:first-child), ${e}-search &:not(:first-child)`]:{borderStartStartRadius:0,borderEndStartRadius:0}},[`&${e}-group-compact`]:Object.assign(Object.assign({display:"block"},tpe()),{[`${e}-group-addon, ${e}-group-wrap, > ${e}`]:{"&:not(:first-child):not(:last-child)":{borderInlineEndWidth:i.lineWidth,"&:hover":{zIndex:1},"&:focus":{zIndex:1}}},"& > *":{display:"inline-block",float:"none",verticalAlign:"top",borderRadius:0},[` & > ${e}-affix-wrapper, & > ${e}-number-affix-wrapper, & > ${t}-picker-range @@ -269,17 +269,17 @@ html body { & > ${t}-cascader-picker:first-child ${e}`]:{borderStartStartRadius:i.borderRadius,borderEndStartRadius:i.borderRadius},[`& > *:last-child, & > ${t}-select:last-child > ${t}-select-selector, & > ${t}-cascader-picker:last-child ${e}, - & > ${t}-cascader-picker-focused:last-child ${e}`]:{borderInlineEndWidth:i.lineWidth,borderStartEndRadius:i.borderRadius,borderEndEndRadius:i.borderRadius},[`& > ${t}-select-auto-complete ${e}`]:{verticalAlign:"top"},[`${e}-group-wrapper + ${e}-group-wrapper`]:{marginInlineStart:i.calc(i.lineWidth).mul(-1).equal(),[`${e}-affix-wrapper`]:{borderRadius:0}},[`${e}-group-wrapper:not(:last-child)`]:{[`&${e}-search > ${e}-group`]:{[`& > ${e}-group-addon > ${e}-search-button`]:{borderRadius:0},[`& > ${e}`]:{borderStartStartRadius:i.borderRadius,borderStartEndRadius:0,borderEndEndRadius:0,borderEndStartRadius:i.borderRadius}}}})}},rUe=i=>{const{componentCls:e,controlHeightSM:t,lineWidth:n,calc:o}=i,r=16,s=o(t).sub(o(n).mul(2)).sub(r).div(2).equal();return{[e]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},Aa(i)),uve(i)),Qze(i)),tUe(i)),eUe(i)),{'&[type="color"]':{height:i.controlHeight,[`&${e}-lg`]:{height:i.controlHeightLG},[`&${e}-sm`]:{height:t,paddingTop:s,paddingBottom:s}},'&[type="search"]::-webkit-search-cancel-button, &[type="search"]::-webkit-search-decoration':{"-webkit-appearance":"none"}})}},sUe=i=>{const{componentCls:e}=i;return{[`${e}-clear-icon`]:{margin:0,color:i.colorTextQuaternary,fontSize:i.fontSizeIcon,verticalAlign:-1,cursor:"pointer",transition:`color ${i.motionDurationSlow}`,"&:hover":{color:i.colorTextTertiary},"&:active":{color:i.colorText},"&-hidden":{visibility:"hidden"},"&-has-suffix":{margin:`0 ${rt(i.inputAffixPadding)}`}}}},aUe=i=>{const{componentCls:e,inputAffixPadding:t,colorTextDescription:n,motionDurationSlow:o,colorIcon:r,colorIconHover:s,iconCls:a}=i;return{[`${e}-affix-wrapper`]:Object.assign(Object.assign(Object.assign(Object.assign({},uve(i)),{display:"inline-flex",[`&:not(${e}-disabled):hover`]:{zIndex:1,[`${e}-search-with-button &`]:{zIndex:0}},"&-focused, &:focus":{zIndex:1},[`> input${e}`]:{padding:0,fontSize:"inherit",border:"none",borderRadius:0,outline:"none",background:"transparent",color:"inherit","&::-ms-reveal":{display:"none"},"&:focus":{boxShadow:"none !important"}},"&::before":{display:"inline-block",width:0,visibility:"hidden",content:'"\\a0"'},[`${e}`]:{"&-prefix, &-suffix":{display:"flex",flex:"none",alignItems:"center","> *:not(:last-child)":{marginInlineEnd:i.paddingXS}},"&-show-count-suffix":{color:n},"&-show-count-has-suffix":{marginInlineEnd:i.paddingXXS},"&-prefix":{marginInlineEnd:t},"&-suffix":{marginInlineStart:t}}}),sUe(i)),{[`${a}${e}-password-icon`]:{color:r,cursor:"pointer",transition:`all ${o}`,"&:hover":{color:s}}})}},lUe=i=>{const{componentCls:e,borderRadiusLG:t,borderRadiusSM:n}=i;return{[`${e}-group`]:Object.assign(Object.assign(Object.assign({},Aa(i)),oUe(i)),{"&-rtl":{direction:"rtl"},"&-wrapper":Object.assign(Object.assign(Object.assign({display:"inline-block",width:"100%",textAlign:"start",verticalAlign:"top","&-rtl":{direction:"rtl"},"&-lg":{[`${e}-group-addon`]:{borderRadius:t,fontSize:i.inputFontSizeLG}},"&-sm":{[`${e}-group-addon`]:{borderRadius:n}}},Jze(i)),nUe(i)),{[`&:not(${e}-compact-first-item):not(${e}-compact-last-item)${e}-compact-item`]:{[`${e}, ${e}-group-addon`]:{borderRadius:0}},[`&:not(${e}-compact-last-item)${e}-compact-first-item`]:{[`${e}, ${e}-group-addon`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`&:not(${e}-compact-first-item)${e}-compact-last-item`]:{[`${e}, ${e}-group-addon`]:{borderStartStartRadius:0,borderEndStartRadius:0}}})})}},cUe=i=>{const{componentCls:e,antCls:t}=i,n=`${e}-search`;return{[n]:{[`${e}`]:{"&:hover, &:focus":{borderColor:i.colorPrimaryHover,[`+ ${e}-group-addon ${n}-button:not(${t}-btn-primary)`]:{borderInlineStartColor:i.colorPrimaryHover}}},[`${e}-affix-wrapper`]:{borderRadius:0},[`${e}-lg`]:{lineHeight:i.calc(i.lineHeightLG).sub(2e-4).equal({unit:!1})},[`> ${e}-group`]:{[`> ${e}-group-addon:last-child`]:{insetInlineStart:-1,padding:0,border:0,[`${n}-button`]:{paddingTop:0,paddingBottom:0,borderStartStartRadius:0,borderStartEndRadius:i.borderRadius,borderEndEndRadius:i.borderRadius,borderEndStartRadius:0,boxShadow:"none"},[`${n}-button:not(${t}-btn-primary)`]:{color:i.colorTextDescription,"&:hover":{color:i.colorPrimaryHover},"&:active":{color:i.colorPrimaryActive},[`&${t}-btn-loading::before`]:{insetInlineStart:0,insetInlineEnd:0,insetBlockStart:0,insetBlockEnd:0}}}},[`${n}-button`]:{height:i.controlHeight,"&:hover, &:focus":{zIndex:1}},[`&-large ${n}-button`]:{height:i.controlHeightLG},[`&-small ${n}-button`]:{height:i.controlHeightSM},"&-rtl":{direction:"rtl"},[`&${e}-compact-item`]:{[`&:not(${e}-compact-last-item)`]:{[`${e}-group-addon`]:{[`${e}-search-button`]:{marginInlineEnd:i.calc(i.lineWidth).mul(-1).equal(),borderRadius:0}}},[`&:not(${e}-compact-first-item)`]:{[`${e},${e}-affix-wrapper`]:{borderRadius:0}},[`> ${e}-group-addon ${e}-search-button, + & > ${t}-cascader-picker-focused:last-child ${e}`]:{borderInlineEndWidth:i.lineWidth,borderStartEndRadius:i.borderRadius,borderEndEndRadius:i.borderRadius},[`& > ${t}-select-auto-complete ${e}`]:{verticalAlign:"top"},[`${e}-group-wrapper + ${e}-group-wrapper`]:{marginInlineStart:i.calc(i.lineWidth).mul(-1).equal(),[`${e}-affix-wrapper`]:{borderRadius:0}},[`${e}-group-wrapper:not(:last-child)`]:{[`&${e}-search > ${e}-group`]:{[`& > ${e}-group-addon > ${e}-search-button`]:{borderRadius:0},[`& > ${e}`]:{borderStartStartRadius:i.borderRadius,borderStartEndRadius:0,borderEndEndRadius:0,borderEndStartRadius:i.borderRadius}}}})}},fUe=i=>{const{componentCls:e,controlHeightSM:t,lineWidth:n,calc:o}=i,r=16,s=o(t).sub(o(n).mul(2)).sub(r).div(2).equal();return{[e]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},Pa(i)),vve(i)),sUe(i)),cUe(i)),lUe(i)),{'&[type="color"]':{height:i.controlHeight,[`&${e}-lg`]:{height:i.controlHeightLG},[`&${e}-sm`]:{height:t,paddingTop:s,paddingBottom:s}},'&[type="search"]::-webkit-search-cancel-button, &[type="search"]::-webkit-search-decoration':{"-webkit-appearance":"none"}})}},gUe=i=>{const{componentCls:e}=i;return{[`${e}-clear-icon`]:{margin:0,color:i.colorTextQuaternary,fontSize:i.fontSizeIcon,verticalAlign:-1,cursor:"pointer",transition:`color ${i.motionDurationSlow}`,"&:hover":{color:i.colorTextTertiary},"&:active":{color:i.colorText},"&-hidden":{visibility:"hidden"},"&-has-suffix":{margin:`0 ${rt(i.inputAffixPadding)}`}}}},pUe=i=>{const{componentCls:e,inputAffixPadding:t,colorTextDescription:n,motionDurationSlow:o,colorIcon:r,colorIconHover:s,iconCls:a}=i;return{[`${e}-affix-wrapper`]:Object.assign(Object.assign(Object.assign(Object.assign({},vve(i)),{display:"inline-flex",[`&:not(${e}-disabled):hover`]:{zIndex:1,[`${e}-search-with-button &`]:{zIndex:0}},"&-focused, &:focus":{zIndex:1},[`> input${e}`]:{padding:0,fontSize:"inherit",border:"none",borderRadius:0,outline:"none",background:"transparent",color:"inherit","&::-ms-reveal":{display:"none"},"&:focus":{boxShadow:"none !important"}},"&::before":{display:"inline-block",width:0,visibility:"hidden",content:'"\\a0"'},[`${e}`]:{"&-prefix, &-suffix":{display:"flex",flex:"none",alignItems:"center","> *:not(:last-child)":{marginInlineEnd:i.paddingXS}},"&-show-count-suffix":{color:n},"&-show-count-has-suffix":{marginInlineEnd:i.paddingXXS},"&-prefix":{marginInlineEnd:t},"&-suffix":{marginInlineStart:t}}}),gUe(i)),{[`${a}${e}-password-icon`]:{color:r,cursor:"pointer",transition:`all ${o}`,"&:hover":{color:s}}})}},mUe=i=>{const{componentCls:e,borderRadiusLG:t,borderRadiusSM:n}=i;return{[`${e}-group`]:Object.assign(Object.assign(Object.assign({},Pa(i)),hUe(i)),{"&-rtl":{direction:"rtl"},"&-wrapper":Object.assign(Object.assign(Object.assign({display:"inline-block",width:"100%",textAlign:"start",verticalAlign:"top","&-rtl":{direction:"rtl"},"&-lg":{[`${e}-group-addon`]:{borderRadius:t,fontSize:i.inputFontSizeLG}},"&-sm":{[`${e}-group-addon`]:{borderRadius:n}}},aUe(i)),uUe(i)),{[`&:not(${e}-compact-first-item):not(${e}-compact-last-item)${e}-compact-item`]:{[`${e}, ${e}-group-addon`]:{borderRadius:0}},[`&:not(${e}-compact-last-item)${e}-compact-first-item`]:{[`${e}, ${e}-group-addon`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`&:not(${e}-compact-first-item)${e}-compact-last-item`]:{[`${e}, ${e}-group-addon`]:{borderStartStartRadius:0,borderEndStartRadius:0}}})})}},vUe=i=>{const{componentCls:e,antCls:t}=i,n=`${e}-search`;return{[n]:{[`${e}`]:{"&:hover, &:focus":{borderColor:i.colorPrimaryHover,[`+ ${e}-group-addon ${n}-button:not(${t}-btn-primary)`]:{borderInlineStartColor:i.colorPrimaryHover}}},[`${e}-affix-wrapper`]:{borderRadius:0},[`${e}-lg`]:{lineHeight:i.calc(i.lineHeightLG).sub(2e-4).equal({unit:!1})},[`> ${e}-group`]:{[`> ${e}-group-addon:last-child`]:{insetInlineStart:-1,padding:0,border:0,[`${n}-button`]:{paddingTop:0,paddingBottom:0,borderStartStartRadius:0,borderStartEndRadius:i.borderRadius,borderEndEndRadius:i.borderRadius,borderEndStartRadius:0,boxShadow:"none"},[`${n}-button:not(${t}-btn-primary)`]:{color:i.colorTextDescription,"&:hover":{color:i.colorPrimaryHover},"&:active":{color:i.colorPrimaryActive},[`&${t}-btn-loading::before`]:{insetInlineStart:0,insetInlineEnd:0,insetBlockStart:0,insetBlockEnd:0}}}},[`${n}-button`]:{height:i.controlHeight,"&:hover, &:focus":{zIndex:1}},[`&-large ${n}-button`]:{height:i.controlHeightLG},[`&-small ${n}-button`]:{height:i.controlHeightSM},"&-rtl":{direction:"rtl"},[`&${e}-compact-item`]:{[`&:not(${e}-compact-last-item)`]:{[`${e}-group-addon`]:{[`${e}-search-button`]:{marginInlineEnd:i.calc(i.lineWidth).mul(-1).equal(),borderRadius:0}}},[`&:not(${e}-compact-first-item)`]:{[`${e},${e}-affix-wrapper`]:{borderRadius:0}},[`> ${e}-group-addon ${e}-search-button, > ${e}, - ${e}-affix-wrapper`]:{"&:hover,&:focus,&:active":{zIndex:2}},[`> ${e}-affix-wrapper-focused`]:{zIndex:2}}}}},uUe=i=>{const{componentCls:e,paddingLG:t}=i,n=`${e}-textarea`;return{[n]:{position:"relative","&-show-count":{[`> ${e}`]:{height:"100%"},[`${e}-data-count`]:{position:"absolute",bottom:i.calc(i.fontSize).mul(i.lineHeight).mul(-1).equal(),insetInlineEnd:0,color:i.colorTextDescription,whiteSpace:"nowrap",pointerEvents:"none"}},"&-allow-clear":{[`> ${e}`]:{paddingInlineEnd:t}},[`&-affix-wrapper${n}-has-feedback`]:{[`${e}`]:{paddingInlineEnd:t}},[`&-affix-wrapper${e}-affix-wrapper`]:{padding:0,[`> textarea${e}`]:{fontSize:"inherit",border:"none",outline:"none",background:"transparent","&:focus":{boxShadow:"none !important"}},[`${e}-suffix`]:{margin:0,"> *:not(:last-child)":{marginInline:0},[`${e}-clear-icon`]:{position:"absolute",insetInlineEnd:i.paddingXS,insetBlockStart:i.paddingXS},[`${n}-suffix`]:{position:"absolute",top:0,insetInlineEnd:i.paddingInline,bottom:0,zIndex:1,display:"inline-flex",alignItems:"center",margin:"auto",pointerEvents:"none"}}}}}},dUe=i=>{const{componentCls:e}=i;return{[`${e}-out-of-range`]:{[`&, & input, & textarea, ${e}-show-count-suffix, ${e}-data-count`]:{color:i.colorError}}}};var mq=Uc("Input",i=>{const e=lr(i,Xze(i));return[rUe(e),uUe(e),aUe(e),lUe(e),cUe(e),dUe(e),KK(e)]},Yze),hUe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M482 152h60q8 0 8 8v704q0 8-8 8h-60q-8 0-8-8V160q0-8 8-8z"}},{tag:"path",attrs:{d:"M192 474h672q8 0 8 8v60q0 8-8 8H160q-8 0-8-8v-60q0-8 8-8z"}}]},name:"plus",theme:"outlined"},fUe=hUe,gUe=function(e,t){return x.exports.createElement(cr,Ct({},e,{ref:t,icon:fUe}))},pUe=x.exports.forwardRef(gUe),A4=x.exports.createContext(null),mUe=function(e){var t=e.activeTabOffset,n=e.horizontal,o=e.rtl,r=e.indicator,s=r===void 0?{}:r,a=s.size,l=s.align,c=l===void 0?"center":l,u=x.exports.useState(),d=Ne(u,2),h=d[0],f=d[1],g=x.exports.useRef(),p=Bt.useCallback(function(m){return typeof a=="function"?a(m):typeof a=="number"?a:m},[a]);function v(){Xi.cancel(g.current)}return x.exports.useEffect(function(){var m={};if(t)if(n){m.width=p(t.width);var _=o?"right":"left";c==="start"&&(m[_]=t[_]),c==="center"&&(m[_]=t[_]+t.width/2,m.transform=o?"translateX(50%)":"translateX(-50%)"),c==="end"&&(m[_]=t[_]+t.width,m.transform="translateX(-100%)")}else m.height=p(t.height),c==="start"&&(m.top=t.top),c==="center"&&(m.top=t.top+t.height/2,m.transform="translateY(-50%)"),c==="end"&&(m.top=t.top+t.height,m.transform="translateY(-100%)");return v(),g.current=Xi(function(){f(m)}),v},[t,n,o,c,p]),{style:h}},gie={width:0,height:0,left:0,top:0};function vUe(i,e,t){return x.exports.useMemo(function(){for(var n,o=new Map,r=e.get((n=i[0])===null||n===void 0?void 0:n.key)||gie,s=r.left+r.width,a=0;aM?(P=R,D.current="x"):(P=A,D.current="y"),e(-P,-P)&&k.preventDefault()}var I=x.exports.useRef(null);I.current={onTouchStart:w,onTouchMove:y,onTouchEnd:L,onWheel:E},x.exports.useEffect(function(){function k(N){I.current.onTouchStart(N)}function R(N){I.current.onTouchMove(N)}function A(N){I.current.onTouchEnd(N)}function P(N){I.current.onWheel(N)}return document.addEventListener("touchmove",R,{passive:!1}),document.addEventListener("touchend",A,{passive:!1}),i.current.addEventListener("touchstart",k,{passive:!1}),i.current.addEventListener("wheel",P),function(){document.removeEventListener("touchmove",R),document.removeEventListener("touchend",A)}},[])}function dve(i){var e=x.exports.useState(0),t=Ne(e,2),n=t[0],o=t[1],r=x.exports.useRef(0),s=x.exports.useRef();return s.current=i,GB(function(){var a;(a=s.current)===null||a===void 0||a.call(s)},[n]),function(){r.current===n&&(r.current+=1,o(r.current))}}function CUe(i){var e=x.exports.useRef([]),t=x.exports.useState({}),n=Ne(t,2),o=n[1],r=x.exports.useRef(typeof i=="function"?i():i),s=dve(function(){var l=r.current;e.current.forEach(function(c){l=c(l)}),e.current=[],r.current=l,o({})});function a(l){e.current.push(l),s()}return[r.current,a]}var _ie={width:0,height:0,left:0,top:0,right:0};function wUe(i,e,t,n,o,r,s){var a=s.tabs,l=s.tabPosition,c=s.rtl,u,d,h;return["top","bottom"].includes(l)?(u="width",d=c?"right":"left",h=Math.abs(t)):(u="height",d="top",h=-t),x.exports.useMemo(function(){if(!a.length)return[0,0];for(var f=a.length,g=f,p=0;ph+e){g=p-1;break}}for(var m=0,_=f-1;_>=0;_-=1){var w=i.get(a[_].key)||_ie;if(w[d]=g?[0,0]:[m,g]},[i,e,n,o,r,h,l,a.map(function(f){return f.key}).join("_"),c])}function bie(i){var e;return i instanceof Map?(e={},i.forEach(function(t,n){e[n]=t})):e=i,JSON.stringify(e)}var yUe="TABS_DQ";function hve(i){return String(i).replace(/"/g,yUe)}function fve(i,e,t,n){return!(!t||n||i===!1||i===void 0&&(e===!1||e===null))}var gve=x.exports.forwardRef(function(i,e){var t=i.prefixCls,n=i.editable,o=i.locale,r=i.style;return!n||n.showAdd===!1?null:x.exports.createElement("button",{ref:e,type:"button",className:"".concat(t,"-nav-add"),style:r,"aria-label":(o==null?void 0:o.addAriaLabel)||"Add tab",onClick:function(a){n.onEdit("add",{event:a})}},n.addIcon||"+")}),Cie=x.exports.forwardRef(function(i,e){var t=i.position,n=i.prefixCls,o=i.extra;if(!o)return null;var r,s={};return Kn(o)==="object"&&!x.exports.isValidElement(o)?s=o:s.right=o,t==="right"&&(r=s.right),t==="left"&&(r=s.left),r?x.exports.createElement("div",{className:"".concat(n,"-extra-content"),ref:e},r):null}),SUe=x.exports.forwardRef(function(i,e){var t=i.prefixCls,n=i.id,o=i.tabs,r=i.locale,s=i.mobile,a=i.moreIcon,l=a===void 0?"More":a,c=i.moreTransitionName,u=i.style,d=i.className,h=i.editable,f=i.tabBarGutter,g=i.rtl,p=i.removeAriaLabel,v=i.onTabClick,m=i.getPopupContainer,_=i.popupClassName,w=x.exports.useState(!1),y=Ne(w,2),L=y[0],D=y[1],E=x.exports.useState(null),I=Ne(E,2),k=I[0],R=I[1],A="".concat(n,"-more-popup"),P="".concat(t,"-dropdown"),N=k!==null?"".concat(A,"-").concat(k):null,M=r==null?void 0:r.dropdownAriaLabel;function H(G,X){G.preventDefault(),G.stopPropagation(),h.onEdit("remove",{key:X,event:G})}var W=x.exports.createElement(NI,{onClick:function(X){var de=X.key,he=X.domEvent;v(de,he),D(!1)},prefixCls:"".concat(P,"-menu"),id:A,tabIndex:-1,role:"listbox","aria-activedescendant":N,selectedKeys:[k],"aria-label":M!==void 0?M:"expanded dropdown"},o.map(function(G){var X=G.closable,de=G.disabled,he=G.closeIcon,pe=G.key,be=G.label,Se=fve(X,he,h,de);return x.exports.createElement(M4,{key:pe,id:"".concat(A,"-").concat(pe),role:"option","aria-controls":n&&"".concat(n,"-panel-").concat(pe),disabled:de},x.exports.createElement("span",null,be),Se&&x.exports.createElement("button",{type:"button","aria-label":p||"remove",tabIndex:0,className:"".concat(P,"-menu-item-remove"),onClick:function(De){De.stopPropagation(),H(De,pe)}},he||h.removeIcon||"\xD7"))}));function F(G){for(var X=o.filter(function(Se){return!Se.disabled}),de=X.findIndex(function(Se){return Se.key===k})||0,he=X.length,pe=0;peXt?"left":"right"})}),N=Ne(P,2),M=N[0],H=N[1],W=pie(0,function(an,Xt){!A&&p&&p({direction:an>Xt?"top":"bottom"})}),F=Ne(W,2),$=F[0],z=F[1],K=x.exports.useState([0,0]),j=Ne(K,2),G=j[0],X=j[1],de=x.exports.useState([0,0]),he=Ne(de,2),pe=he[0],be=he[1],Se=x.exports.useState([0,0]),Fe=Ne(Se,2),De=Fe[0],ce=Fe[1],Pe=x.exports.useState([0,0]),Oe=Ne(Pe,2),xe=Oe[0],Ee=Oe[1],tt=CUe(new Map),nt=Ne(tt,2),Qe=nt[0],Ge=nt[1],re=vUe(w,Qe,pe[0]),ie=GN(G,A),se=GN(pe,A),U=GN(De,A),Y=GN(xe,A),oe=ieTe?Te:an}var je=x.exports.useRef(null),mt=x.exports.useState(),Et=Ne(mt,2),At=Et[0],Je=Et[1];function xt(){Je(Date.now())}function Ot(){je.current&&clearTimeout(je.current)}bUe(E,function(an,Xt){function oi(Ze,ue){Ze(function(Ve){var ot=We(Ve+ue);return ot})}return oe?(A?oi(H,an):oi(z,Xt),Ot(),xt(),!0):!1}),x.exports.useEffect(function(){return Ot(),At&&(je.current=setTimeout(function(){Je(0)},100)),Ot},[At]);var Vn=wUe(re,te,A?M:$,se,U,Y,Ce(Ce({},i),{},{tabs:w})),Lt=Ne(Vn,2),tn=Lt[0],ui=Lt[1],cn=el(function(){var an=arguments.length>0&&arguments[0]!==void 0?arguments[0]:s,Xt=re.get(an)||{width:0,height:0,left:0,right:0,top:0};if(A){var oi=M;a?Xt.rightM+te&&(oi=Xt.right+Xt.width-te):Xt.left<-M?oi=-Xt.left:Xt.left+Xt.width>-M+te&&(oi=-(Xt.left+Xt.width-te)),z(0),H(We(oi))}else{var Ze=$;Xt.top<-$?Ze=-Xt.top:Xt.top+Xt.height>-$+te&&(Ze=-(Xt.top+Xt.height-te)),H(0),z(We(Ze))}}),qn={};d==="top"||d==="bottom"?qn[a?"marginRight":"marginLeft"]=h:qn.marginTop=h;var bn=w.map(function(an,Xt){var oi=an.key;return x.exports.createElement(LUe,{id:o,prefixCls:_,key:oi,tab:an,style:Xt===0?void 0:qn,closable:an.closable,editable:c,active:oi===s,renderWrapper:f,removeAriaLabel:u==null?void 0:u.removeAriaLabel,onClick:function(ue){g(oi,ue)},onFocus:function(){cn(oi),xt(),E.current&&(a||(E.current.scrollLeft=0),E.current.scrollTop=0)}})}),Pt=function(){return Ge(function(){var Xt,oi=new Map,Ze=(Xt=I.current)===null||Xt===void 0?void 0:Xt.getBoundingClientRect();return w.forEach(function(ue){var Ve,ot=ue.key,Sn=(Ve=I.current)===null||Ve===void 0?void 0:Ve.querySelector('[data-node-key="'.concat(hve(ot),'"]'));if(Sn){var $n=EUe(Sn,Ze),Ci=Ne($n,4),An=Ci[0],lo=Ci[1],Qo=Ci[2],zo=Ci[3];oi.set(ot,{width:An,height:lo,left:Qo,top:zo})}}),oi})};x.exports.useEffect(function(){Pt()},[w.map(function(an){return an.key}).join("_")]);var qt=dve(function(){var an=O1(y),Xt=O1(L),oi=O1(D);X([an[0]-Xt[0]-oi[0],an[1]-Xt[1]-oi[1]]);var Ze=O1(R);ce(Ze);var ue=O1(k);Ee(ue);var Ve=O1(I);be([Ve[0]-Ze[0],Ve[1]-Ze[1]]),Pt()}),Nt=w.slice(0,tn),jt=w.slice(ui+1),Gt=[].concat(_t(Nt),_t(jt)),kt=re.get(s),Ft=mUe({activeTabOffset:kt,horizontal:A,indicator:v,rtl:a}),bt=Ft.style;x.exports.useEffect(function(){cn()},[s,Le,Te,bie(kt),bie(re),A]),x.exports.useEffect(function(){qt()},[a]);var Zt=!!Gt.length,yn="".concat(_,"-nav-wrap"),Dn,Gn,Un,Zi;return A?a?(Gn=M>0,Dn=M!==Te):(Dn=M<0,Gn=M!==Le):(Un=$<0,Zi=$!==Le),x.exports.createElement(Md,{onResize:qt},x.exports.createElement("div",{ref:Rb(e,y),role:"tablist",className:Ue("".concat(_,"-nav"),t),style:n,onKeyDown:function(){xt()}},x.exports.createElement(Cie,{ref:L,position:"left",extra:l,prefixCls:_}),x.exports.createElement(Md,{onResize:qt},x.exports.createElement("div",{className:Ue(yn,me(me(me(me({},"".concat(yn,"-ping-left"),Dn),"".concat(yn,"-ping-right"),Gn),"".concat(yn,"-ping-top"),Un),"".concat(yn,"-ping-bottom"),Zi)),ref:E},x.exports.createElement(Md,{onResize:qt},x.exports.createElement("div",{ref:I,className:"".concat(_,"-nav-list"),style:{transform:"translate(".concat(M,"px, ").concat($,"px)"),transition:At?"none":void 0}},bn,x.exports.createElement(gve,{ref:R,prefixCls:_,locale:u,editable:c,style:Ce(Ce({},bn.length===0?void 0:qn),{},{visibility:Zt?"hidden":null})}),x.exports.createElement("div",{className:Ue("".concat(_,"-ink-bar"),me({},"".concat(_,"-ink-bar-animated"),r.inkBar)),style:bt}))))),x.exports.createElement(xUe,Ct({},i,{removeAriaLabel:u==null?void 0:u.removeAriaLabel,ref:k,prefixCls:_,tabs:Gt,className:!Zt&&we,tabMoving:!!At})),x.exports.createElement(Cie,{ref:D,position:"right",extra:l,prefixCls:_})))}),pve=x.exports.forwardRef(function(i,e){var t=i.prefixCls,n=i.className,o=i.style,r=i.id,s=i.active,a=i.tabKey,l=i.children;return x.exports.createElement("div",{id:r&&"".concat(r,"-panel-").concat(a),role:"tabpanel",tabIndex:s?0:-1,"aria-labelledby":r&&"".concat(r,"-tab-").concat(a),"aria-hidden":!s,style:o,className:Ue(t,s&&"".concat(t,"-active"),n),ref:e},l)}),DUe=["renderTabBar"],kUe=["label","key"],IUe=function(e){var t=e.renderTabBar,n=Hn(e,DUe),o=x.exports.useContext(A4),r=o.tabs;if(t){var s=Ce(Ce({},n),{},{panes:r.map(function(a){var l=a.label,c=a.key,u=Hn(a,kUe);return x.exports.createElement(pve,Ct({tab:l,key:c,tabKey:c},u))})});return t(s,wie)}return x.exports.createElement(wie,n)},TUe=["key","forceRender","style","className","destroyInactiveTabPane"],NUe=function(e){var t=e.id,n=e.activeKey,o=e.animated,r=e.tabPosition,s=e.destroyInactiveTabPane,a=x.exports.useContext(A4),l=a.prefixCls,c=a.tabs,u=o.tabPane,d="".concat(l,"-tabpane");return x.exports.createElement("div",{className:Ue("".concat(l,"-content-holder"))},x.exports.createElement("div",{className:Ue("".concat(l,"-content"),"".concat(l,"-content-").concat(r),me({},"".concat(l,"-content-animated"),u))},c.map(function(h){var f=h.key,g=h.forceRender,p=h.style,v=h.className,m=h.destroyInactiveTabPane,_=Hn(h,TUe),w=f===n;return x.exports.createElement(eh,Ct({key:f,visible:w,forceRender:g,removeOnLeave:!!(s||m),leavedClassName:"".concat(d,"-hidden")},o.tabPaneMotion),function(y,L){var D=y.style,E=y.className;return x.exports.createElement(pve,Ct({},_,{prefixCls:d,id:t,tabKey:f,animated:u,active:w,style:Ce(Ce({},p),D),className:Ue(v,E),ref:L}))})})))};function RUe(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{inkBar:!0,tabPane:!1},e;return i===!1?e={inkBar:!1,tabPane:!1}:i===!0?e={inkBar:!0,tabPane:!1}:e=Ce({inkBar:!0},Kn(i)==="object"?i:{}),e.tabPaneMotion&&e.tabPane===void 0&&(e.tabPane=!0),!e.tabPaneMotion&&e.tabPane&&(e.tabPane=!1),e}var MUe=["id","prefixCls","className","items","direction","activeKey","defaultActiveKey","editable","animated","tabPosition","tabBarGutter","tabBarStyle","tabBarExtraContent","locale","moreIcon","moreTransitionName","destroyInactiveTabPane","renderTabBar","onChange","onTabClick","onTabScroll","getPopupContainer","popupClassName","indicator"],yie=0,AUe=x.exports.forwardRef(function(i,e){var t=i.id,n=i.prefixCls,o=n===void 0?"rc-tabs":n,r=i.className,s=i.items,a=i.direction,l=i.activeKey,c=i.defaultActiveKey,u=i.editable,d=i.animated,h=i.tabPosition,f=h===void 0?"top":h,g=i.tabBarGutter,p=i.tabBarStyle,v=i.tabBarExtraContent,m=i.locale,_=i.moreIcon,w=i.moreTransitionName,y=i.destroyInactiveTabPane,L=i.renderTabBar,D=i.onChange,E=i.onTabClick,I=i.onTabScroll,k=i.getPopupContainer,R=i.popupClassName,A=i.indicator,P=Hn(i,MUe),N=x.exports.useMemo(function(){return(s||[]).filter(function(Ee){return Ee&&Kn(Ee)==="object"&&"key"in Ee})},[s]),M=a==="rtl",H=RUe(d),W=x.exports.useState(!1),F=Ne(W,2),$=F[0],z=F[1];x.exports.useEffect(function(){z(eq())},[]);var K=jl(function(){var Ee;return(Ee=N[0])===null||Ee===void 0?void 0:Ee.key},{value:l,defaultValue:c}),j=Ne(K,2),G=j[0],X=j[1],de=x.exports.useState(function(){return N.findIndex(function(Ee){return Ee.key===G})}),he=Ne(de,2),pe=he[0],be=he[1];x.exports.useEffect(function(){var Ee=N.findIndex(function(nt){return nt.key===G});if(Ee===-1){var tt;Ee=Math.max(0,Math.min(pe,N.length-1)),X((tt=N[Ee])===null||tt===void 0?void 0:tt.key)}be(Ee)},[N.map(function(Ee){return Ee.key}).join("_"),G,pe]);var Se=jl(null,{value:t}),Fe=Ne(Se,2),De=Fe[0],ce=Fe[1];x.exports.useEffect(function(){t||(ce("rc-tabs-".concat(yie)),yie+=1)},[]);function Pe(Ee,tt){E==null||E(Ee,tt);var nt=Ee!==G;X(Ee),nt&&(D==null||D(Ee))}var Oe={id:De,activeKey:G,animated:H,tabPosition:f,rtl:M,mobile:$},xe=Ce(Ce({},Oe),{},{editable:u,locale:m,moreIcon:_,moreTransitionName:w,tabBarGutter:g,onTabClick:Pe,onTabScroll:I,extra:v,style:p,panes:null,getPopupContainer:k,popupClassName:R,indicator:A});return x.exports.createElement(A4.Provider,{value:{tabs:N,prefixCls:o}},x.exports.createElement("div",Ct({ref:e,id:t,className:Ue(o,"".concat(o,"-").concat(f),me(me(me({},"".concat(o,"-mobile"),$),"".concat(o,"-editable"),u),"".concat(o,"-rtl"),M),r)},P),x.exports.createElement(IUe,Ct({},xe,{renderTabBar:L})),x.exports.createElement(NUe,Ct({destroyInactiveTabPane:y},Oe,{animated:H}))))});const PUe={motionAppear:!1,motionEnter:!0,motionLeave:!0};function OUe(i){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{inkBar:!0,tabPane:!1},t;return e===!1?t={inkBar:!1,tabPane:!1}:e===!0?t={inkBar:!0,tabPane:!0}:t=Object.assign({inkBar:!0},typeof e=="object"?e:{}),t.tabPane&&(t.tabPaneMotion=Object.assign(Object.assign({},PUe),{motionName:U0(i,"switch")})),t}var FUe=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(i);oe)}function WUe(i,e){if(i)return i;const t=np(e).map(n=>{if(x.exports.isValidElement(n)){const{key:o,props:r}=n,s=r||{},{tab:a}=s,l=FUe(s,["tab"]);return Object.assign(Object.assign({key:String(o)},l),{label:a})}return null});return BUe(t)}const VUe=i=>{const{componentCls:e,motionDurationSlow:t}=i;return[{[e]:{[`${e}-switch`]:{"&-appear, &-enter":{transition:"none","&-start":{opacity:0},"&-active":{opacity:1,transition:`opacity ${t}`}},"&-leave":{position:"absolute",transition:"none",inset:0,"&-start":{opacity:1},"&-active":{opacity:0,transition:`opacity ${t}`}}}}},[SA(i,"slide-up"),SA(i,"slide-down")]]};var HUe=VUe;const $Ue=i=>{const{componentCls:e,tabsCardPadding:t,cardBg:n,cardGutter:o,colorBorderSecondary:r,itemSelectedColor:s}=i;return{[`${e}-card`]:{[`> ${e}-nav, > div > ${e}-nav`]:{[`${e}-tab`]:{margin:0,padding:t,background:n,border:`${rt(i.lineWidth)} ${i.lineType} ${r}`,transition:`all ${i.motionDurationSlow} ${i.motionEaseInOut}`},[`${e}-tab-active`]:{color:s,background:i.colorBgContainer},[`${e}-ink-bar`]:{visibility:"hidden"}},[`&${e}-top, &${e}-bottom`]:{[`> ${e}-nav, > div > ${e}-nav`]:{[`${e}-tab + ${e}-tab`]:{marginLeft:{_skip_check_:!0,value:rt(o)}}}},[`&${e}-top`]:{[`> ${e}-nav, > div > ${e}-nav`]:{[`${e}-tab`]:{borderRadius:`${rt(i.borderRadiusLG)} ${rt(i.borderRadiusLG)} 0 0`},[`${e}-tab-active`]:{borderBottomColor:i.colorBgContainer}}},[`&${e}-bottom`]:{[`> ${e}-nav, > div > ${e}-nav`]:{[`${e}-tab`]:{borderRadius:`0 0 ${rt(i.borderRadiusLG)} ${rt(i.borderRadiusLG)}`},[`${e}-tab-active`]:{borderTopColor:i.colorBgContainer}}},[`&${e}-left, &${e}-right`]:{[`> ${e}-nav, > div > ${e}-nav`]:{[`${e}-tab + ${e}-tab`]:{marginTop:rt(o)}}},[`&${e}-left`]:{[`> ${e}-nav, > div > ${e}-nav`]:{[`${e}-tab`]:{borderRadius:{_skip_check_:!0,value:`${rt(i.borderRadiusLG)} 0 0 ${rt(i.borderRadiusLG)}`}},[`${e}-tab-active`]:{borderRightColor:{_skip_check_:!0,value:i.colorBgContainer}}}},[`&${e}-right`]:{[`> ${e}-nav, > div > ${e}-nav`]:{[`${e}-tab`]:{borderRadius:{_skip_check_:!0,value:`0 ${rt(i.borderRadiusLG)} ${rt(i.borderRadiusLG)} 0`}},[`${e}-tab-active`]:{borderLeftColor:{_skip_check_:!0,value:i.colorBgContainer}}}}}}},zUe=i=>{const{componentCls:e,itemHoverColor:t,dropdownEdgeChildVerticalPadding:n}=i;return{[`${e}-dropdown`]:Object.assign(Object.assign({},Aa(i)),{position:"absolute",top:-9999,left:{_skip_check_:!0,value:-9999},zIndex:i.zIndexPopup,display:"block","&-hidden":{display:"none"},[`${e}-dropdown-menu`]:{maxHeight:i.tabsDropdownHeight,margin:0,padding:`${rt(n)} 0`,overflowX:"hidden",overflowY:"auto",textAlign:{_skip_check_:!0,value:"left"},listStyleType:"none",backgroundColor:i.colorBgContainer,backgroundClip:"padding-box",borderRadius:i.borderRadiusLG,outline:"none",boxShadow:i.boxShadowSecondary,"&-item":Object.assign(Object.assign({},vA),{display:"flex",alignItems:"center",minWidth:i.tabsDropdownWidth,margin:0,padding:`${rt(i.paddingXXS)} ${rt(i.paddingSM)}`,color:i.colorText,fontWeight:"normal",fontSize:i.fontSize,lineHeight:i.lineHeight,cursor:"pointer",transition:`all ${i.motionDurationSlow}`,"> span":{flex:1,whiteSpace:"nowrap"},"&-remove":{flex:"none",marginLeft:{_skip_check_:!0,value:i.marginSM},color:i.colorTextDescription,fontSize:i.fontSizeSM,background:"transparent",border:0,cursor:"pointer","&:hover":{color:t}},"&:hover":{background:i.controlItemBgHover},"&-disabled":{"&, &:hover":{color:i.colorTextDisabled,background:"transparent",cursor:"not-allowed"}}})}})}},UUe=i=>{const{componentCls:e,margin:t,colorBorderSecondary:n,horizontalMargin:o,verticalItemPadding:r,verticalItemMargin:s,calc:a}=i;return{[`${e}-top, ${e}-bottom`]:{flexDirection:"column",[`> ${e}-nav, > div > ${e}-nav`]:{margin:o,"&::before":{position:"absolute",right:{_skip_check_:!0,value:0},left:{_skip_check_:!0,value:0},borderBottom:`${rt(i.lineWidth)} ${i.lineType} ${n}`,content:"''"},[`${e}-ink-bar`]:{height:i.lineWidthBold,"&-animated":{transition:`width ${i.motionDurationSlow}, left ${i.motionDurationSlow}, + ${e}-affix-wrapper`]:{"&:hover,&:focus,&:active":{zIndex:2}},[`> ${e}-affix-wrapper-focused`]:{zIndex:2}}}}},_Ue=i=>{const{componentCls:e,paddingLG:t}=i,n=`${e}-textarea`;return{[n]:{position:"relative","&-show-count":{[`> ${e}`]:{height:"100%"},[`${e}-data-count`]:{position:"absolute",bottom:i.calc(i.fontSize).mul(i.lineHeight).mul(-1).equal(),insetInlineEnd:0,color:i.colorTextDescription,whiteSpace:"nowrap",pointerEvents:"none"}},"&-allow-clear":{[`> ${e}`]:{paddingInlineEnd:t}},[`&-affix-wrapper${n}-has-feedback`]:{[`${e}`]:{paddingInlineEnd:t}},[`&-affix-wrapper${e}-affix-wrapper`]:{padding:0,[`> textarea${e}`]:{fontSize:"inherit",border:"none",outline:"none",background:"transparent","&:focus":{boxShadow:"none !important"}},[`${e}-suffix`]:{margin:0,"> *:not(:last-child)":{marginInline:0},[`${e}-clear-icon`]:{position:"absolute",insetInlineEnd:i.paddingXS,insetBlockStart:i.paddingXS},[`${n}-suffix`]:{position:"absolute",top:0,insetInlineEnd:i.paddingInline,bottom:0,zIndex:1,display:"inline-flex",alignItems:"center",margin:"auto",pointerEvents:"none"}}}}}},bUe=i=>{const{componentCls:e}=i;return{[`${e}-out-of-range`]:{[`&, & input, & textarea, ${e}-show-count-suffix, ${e}-data-count`]:{color:i.colorError}}}};var Cq=jc("Input",i=>{const e=lr(i,iUe(i));return[fUe(e),_Ue(e),pUe(e),mUe(e),vUe(e),bUe(e),YK(e)]},oUe),CUe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M482 152h60q8 0 8 8v704q0 8-8 8h-60q-8 0-8-8V160q0-8 8-8z"}},{tag:"path",attrs:{d:"M192 474h672q8 0 8 8v60q0 8-8 8H160q-8 0-8-8v-60q0-8 8-8z"}}]},name:"plus",theme:"outlined"},yUe=CUe,wUe=function(e,t){return x.exports.createElement(cr,yt({},e,{ref:t,icon:yUe}))},SUe=x.exports.forwardRef(wUe),P4=x.exports.createContext(null),xUe=function(e){var t=e.activeTabOffset,n=e.horizontal,o=e.rtl,r=e.indicator,s=r===void 0?{}:r,a=s.size,l=s.align,c=l===void 0?"center":l,u=x.exports.useState(),d=Ne(u,2),h=d[0],f=d[1],g=x.exports.useRef(),p=Bt.useCallback(function(m){return typeof a=="function"?a(m):typeof a=="number"?a:m},[a]);function v(){Xi.cancel(g.current)}return x.exports.useEffect(function(){var m={};if(t)if(n){m.width=p(t.width);var _=o?"right":"left";c==="start"&&(m[_]=t[_]),c==="center"&&(m[_]=t[_]+t.width/2,m.transform=o?"translateX(50%)":"translateX(-50%)"),c==="end"&&(m[_]=t[_]+t.width,m.transform="translateX(-100%)")}else m.height=p(t.height),c==="start"&&(m.top=t.top),c==="center"&&(m.top=t.top+t.height/2,m.transform="translateY(-50%)"),c==="end"&&(m.top=t.top+t.height,m.transform="translateY(-100%)");return v(),g.current=Xi(function(){f(m)}),v},[t,n,o,c,p]),{style:h}},wie={width:0,height:0,left:0,top:0};function LUe(i,e,t){return x.exports.useMemo(function(){for(var n,o=new Map,r=e.get((n=i[0])===null||n===void 0?void 0:n.key)||wie,s=r.left+r.width,a=0;aM?(P=R,D.current="x"):(P=A,D.current="y"),e(-P,-P)&&k.preventDefault()}var I=x.exports.useRef(null);I.current={onTouchStart:y,onTouchMove:w,onTouchEnd:L,onWheel:E},x.exports.useEffect(function(){function k(N){I.current.onTouchStart(N)}function R(N){I.current.onTouchMove(N)}function A(N){I.current.onTouchEnd(N)}function P(N){I.current.onWheel(N)}return document.addEventListener("touchmove",R,{passive:!1}),document.addEventListener("touchend",A,{passive:!1}),i.current.addEventListener("touchstart",k,{passive:!1}),i.current.addEventListener("wheel",P),function(){document.removeEventListener("touchmove",R),document.removeEventListener("touchend",A)}},[])}function _ve(i){var e=x.exports.useState(0),t=Ne(e,2),n=t[0],o=t[1],r=x.exports.useRef(0),s=x.exports.useRef();return s.current=i,ZB(function(){var a;(a=s.current)===null||a===void 0||a.call(s)},[n]),function(){r.current===n&&(r.current+=1,o(r.current))}}function kUe(i){var e=x.exports.useRef([]),t=x.exports.useState({}),n=Ne(t,2),o=n[1],r=x.exports.useRef(typeof i=="function"?i():i),s=_ve(function(){var l=r.current;e.current.forEach(function(c){l=c(l)}),e.current=[],r.current=l,o({})});function a(l){e.current.push(l),s()}return[r.current,a]}var Eie={width:0,height:0,left:0,top:0,right:0};function IUe(i,e,t,n,o,r,s){var a=s.tabs,l=s.tabPosition,c=s.rtl,u,d,h;return["top","bottom"].includes(l)?(u="width",d=c?"right":"left",h=Math.abs(t)):(u="height",d="top",h=-t),x.exports.useMemo(function(){if(!a.length)return[0,0];for(var f=a.length,g=f,p=0;ph+e){g=p-1;break}}for(var m=0,_=f-1;_>=0;_-=1){var y=i.get(a[_].key)||Eie;if(y[d]=g?[0,0]:[m,g]},[i,e,n,o,r,h,l,a.map(function(f){return f.key}).join("_"),c])}function Die(i){var e;return i instanceof Map?(e={},i.forEach(function(t,n){e[n]=t})):e=i,JSON.stringify(e)}var TUe="TABS_DQ";function bve(i){return String(i).replace(/"/g,TUe)}function Cve(i,e,t,n){return!(!t||n||i===!1||i===void 0&&(e===!1||e===null))}var yve=x.exports.forwardRef(function(i,e){var t=i.prefixCls,n=i.editable,o=i.locale,r=i.style;return!n||n.showAdd===!1?null:x.exports.createElement("button",{ref:e,type:"button",className:"".concat(t,"-nav-add"),style:r,"aria-label":(o==null?void 0:o.addAriaLabel)||"Add tab",onClick:function(a){n.onEdit("add",{event:a})}},n.addIcon||"+")}),kie=x.exports.forwardRef(function(i,e){var t=i.position,n=i.prefixCls,o=i.extra;if(!o)return null;var r,s={};return Kn(o)==="object"&&!x.exports.isValidElement(o)?s=o:s.right=o,t==="right"&&(r=s.right),t==="left"&&(r=s.left),r?x.exports.createElement("div",{className:"".concat(n,"-extra-content"),ref:e},r):null}),NUe=x.exports.forwardRef(function(i,e){var t=i.prefixCls,n=i.id,o=i.tabs,r=i.locale,s=i.mobile,a=i.moreIcon,l=a===void 0?"More":a,c=i.moreTransitionName,u=i.style,d=i.className,h=i.editable,f=i.tabBarGutter,g=i.rtl,p=i.removeAriaLabel,v=i.onTabClick,m=i.getPopupContainer,_=i.popupClassName,y=x.exports.useState(!1),w=Ne(y,2),L=w[0],D=w[1],E=x.exports.useState(null),I=Ne(E,2),k=I[0],R=I[1],A="".concat(n,"-more-popup"),P="".concat(t,"-dropdown"),N=k!==null?"".concat(A,"-").concat(k):null,M=r==null?void 0:r.dropdownAriaLabel;function H(G,X){G.preventDefault(),G.stopPropagation(),h.onEdit("remove",{key:X,event:G})}var B=x.exports.createElement(MI,{onClick:function(X){var de=X.key,fe=X.domEvent;v(de,fe),D(!1)},prefixCls:"".concat(P,"-menu"),id:A,tabIndex:-1,role:"listbox","aria-activedescendant":N,selectedKeys:[k],"aria-label":M!==void 0?M:"expanded dropdown"},o.map(function(G){var X=G.closable,de=G.disabled,fe=G.closeIcon,pe=G.key,be=G.label,Se=Cve(X,fe,h,de);return x.exports.createElement(A4,{key:pe,id:"".concat(A,"-").concat(pe),role:"option","aria-controls":n&&"".concat(n,"-panel-").concat(pe),disabled:de},x.exports.createElement("span",null,be),Se&&x.exports.createElement("button",{type:"button","aria-label":p||"remove",tabIndex:0,className:"".concat(P,"-menu-item-remove"),onClick:function(De){De.stopPropagation(),H(De,pe)}},fe||h.removeIcon||"\xD7"))}));function F(G){for(var X=o.filter(function(Se){return!Se.disabled}),de=X.findIndex(function(Se){return Se.key===k})||0,fe=X.length,pe=0;peXt?"left":"right"})}),N=Ne(P,2),M=N[0],H=N[1],B=Sie(0,function(an,Xt){!A&&p&&p({direction:an>Xt?"top":"bottom"})}),F=Ne(B,2),$=F[0],z=F[1],K=x.exports.useState([0,0]),j=Ne(K,2),G=j[0],X=j[1],de=x.exports.useState([0,0]),fe=Ne(de,2),pe=fe[0],be=fe[1],Se=x.exports.useState([0,0]),Fe=Ne(Se,2),De=Fe[0],ce=Fe[1],Pe=x.exports.useState([0,0]),Oe=Ne(Pe,2),xe=Oe[0],Ee=Oe[1],tt=kUe(new Map),nt=Ne(tt,2),Qe=nt[0],Ge=nt[1],re=LUe(y,Qe,pe[0]),ie=ZN(G,A),se=ZN(pe,A),U=ZN(De,A),Y=ZN(xe,A),oe=ieTe?Te:an}var je=x.exports.useRef(null),mt=x.exports.useState(),Dt=Ne(mt,2),At=Dt[0],Je=Dt[1];function Lt(){Je(Date.now())}function Ot(){je.current&&clearTimeout(je.current)}DUe(E,function(an,Xt){function oi(Ze,ue){Ze(function(Ve){var ot=We(Ve+ue);return ot})}return oe?(A?oi(H,an):oi(z,Xt),Ot(),Lt(),!0):!1}),x.exports.useEffect(function(){return Ot(),At&&(je.current=setTimeout(function(){Je(0)},100)),Ot},[At]);var Vn=IUe(re,te,A?M:$,se,U,Y,Ce(Ce({},i),{},{tabs:y})),Et=Ne(Vn,2),tn=Et[0],ui=Et[1],cn=tl(function(){var an=arguments.length>0&&arguments[0]!==void 0?arguments[0]:s,Xt=re.get(an)||{width:0,height:0,left:0,right:0,top:0};if(A){var oi=M;a?Xt.rightM+te&&(oi=Xt.right+Xt.width-te):Xt.left<-M?oi=-Xt.left:Xt.left+Xt.width>-M+te&&(oi=-(Xt.left+Xt.width-te)),z(0),H(We(oi))}else{var Ze=$;Xt.top<-$?Ze=-Xt.top:Xt.top+Xt.height>-$+te&&(Ze=-(Xt.top+Xt.height-te)),H(0),z(We(Ze))}}),qn={};d==="top"||d==="bottom"?qn[a?"marginRight":"marginLeft"]=h:qn.marginTop=h;var bn=y.map(function(an,Xt){var oi=an.key;return x.exports.createElement(MUe,{id:o,prefixCls:_,key:oi,tab:an,style:Xt===0?void 0:qn,closable:an.closable,editable:c,active:oi===s,renderWrapper:f,removeAriaLabel:u==null?void 0:u.removeAriaLabel,onClick:function(ue){g(oi,ue)},onFocus:function(){cn(oi),Lt(),E.current&&(a||(E.current.scrollLeft=0),E.current.scrollTop=0)}})}),Pt=function(){return Ge(function(){var Xt,oi=new Map,Ze=(Xt=I.current)===null||Xt===void 0?void 0:Xt.getBoundingClientRect();return y.forEach(function(ue){var Ve,ot=ue.key,Sn=(Ve=I.current)===null||Ve===void 0?void 0:Ve.querySelector('[data-node-key="'.concat(bve(ot),'"]'));if(Sn){var $n=AUe(Sn,Ze),Ci=Ne($n,4),An=Ci[0],lo=Ci[1],Qo=Ci[2],zo=Ci[3];oi.set(ot,{width:An,height:lo,left:Qo,top:zo})}}),oi})};x.exports.useEffect(function(){Pt()},[y.map(function(an){return an.key}).join("_")]);var qt=_ve(function(){var an=O1(w),Xt=O1(L),oi=O1(D);X([an[0]-Xt[0]-oi[0],an[1]-Xt[1]-oi[1]]);var Ze=O1(R);ce(Ze);var ue=O1(k);Ee(ue);var Ve=O1(I);be([Ve[0]-Ze[0],Ve[1]-Ze[1]]),Pt()}),Nt=y.slice(0,tn),jt=y.slice(ui+1),Gt=[].concat(_t(Nt),_t(jt)),It=re.get(s),Ft=xUe({activeTabOffset:It,horizontal:A,indicator:v,rtl:a}),bt=Ft.style;x.exports.useEffect(function(){cn()},[s,Le,Te,Die(It),Die(re),A]),x.exports.useEffect(function(){qt()},[a]);var Zt=!!Gt.length,wn="".concat(_,"-nav-wrap"),Dn,Gn,Un,Zi;return A?a?(Gn=M>0,Dn=M!==Te):(Dn=M<0,Gn=M!==Le):(Un=$<0,Zi=$!==Le),x.exports.createElement(Md,{onResize:qt},x.exports.createElement("div",{ref:Mb(e,w),role:"tablist",className:Ue("".concat(_,"-nav"),t),style:n,onKeyDown:function(){Lt()}},x.exports.createElement(kie,{ref:L,position:"left",extra:l,prefixCls:_}),x.exports.createElement(Md,{onResize:qt},x.exports.createElement("div",{className:Ue(wn,me(me(me(me({},"".concat(wn,"-ping-left"),Dn),"".concat(wn,"-ping-right"),Gn),"".concat(wn,"-ping-top"),Un),"".concat(wn,"-ping-bottom"),Zi)),ref:E},x.exports.createElement(Md,{onResize:qt},x.exports.createElement("div",{ref:I,className:"".concat(_,"-nav-list"),style:{transform:"translate(".concat(M,"px, ").concat($,"px)"),transition:At?"none":void 0}},bn,x.exports.createElement(yve,{ref:R,prefixCls:_,locale:u,editable:c,style:Ce(Ce({},bn.length===0?void 0:qn),{},{visibility:Zt?"hidden":null})}),x.exports.createElement("div",{className:Ue("".concat(_,"-ink-bar"),me({},"".concat(_,"-ink-bar-animated"),r.inkBar)),style:bt}))))),x.exports.createElement(RUe,yt({},i,{removeAriaLabel:u==null?void 0:u.removeAriaLabel,ref:k,prefixCls:_,tabs:Gt,className:!Zt&&ye,tabMoving:!!At})),x.exports.createElement(kie,{ref:D,position:"right",extra:l,prefixCls:_})))}),wve=x.exports.forwardRef(function(i,e){var t=i.prefixCls,n=i.className,o=i.style,r=i.id,s=i.active,a=i.tabKey,l=i.children;return x.exports.createElement("div",{id:r&&"".concat(r,"-panel-").concat(a),role:"tabpanel",tabIndex:s?0:-1,"aria-labelledby":r&&"".concat(r,"-tab-").concat(a),"aria-hidden":!s,style:o,className:Ue(t,s&&"".concat(t,"-active"),n),ref:e},l)}),PUe=["renderTabBar"],OUe=["label","key"],FUe=function(e){var t=e.renderTabBar,n=Hn(e,PUe),o=x.exports.useContext(P4),r=o.tabs;if(t){var s=Ce(Ce({},n),{},{panes:r.map(function(a){var l=a.label,c=a.key,u=Hn(a,OUe);return x.exports.createElement(wve,yt({tab:l,key:c,tabKey:c},u))})});return t(s,Iie)}return x.exports.createElement(Iie,n)},BUe=["key","forceRender","style","className","destroyInactiveTabPane"],WUe=function(e){var t=e.id,n=e.activeKey,o=e.animated,r=e.tabPosition,s=e.destroyInactiveTabPane,a=x.exports.useContext(P4),l=a.prefixCls,c=a.tabs,u=o.tabPane,d="".concat(l,"-tabpane");return x.exports.createElement("div",{className:Ue("".concat(l,"-content-holder"))},x.exports.createElement("div",{className:Ue("".concat(l,"-content"),"".concat(l,"-content-").concat(r),me({},"".concat(l,"-content-animated"),u))},c.map(function(h){var f=h.key,g=h.forceRender,p=h.style,v=h.className,m=h.destroyInactiveTabPane,_=Hn(h,BUe),y=f===n;return x.exports.createElement(th,yt({key:f,visible:y,forceRender:g,removeOnLeave:!!(s||m),leavedClassName:"".concat(d,"-hidden")},o.tabPaneMotion),function(w,L){var D=w.style,E=w.className;return x.exports.createElement(wve,yt({},_,{prefixCls:d,id:t,tabKey:f,animated:u,active:y,style:Ce(Ce({},p),D),className:Ue(v,E),ref:L}))})})))};function VUe(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{inkBar:!0,tabPane:!1},e;return i===!1?e={inkBar:!1,tabPane:!1}:i===!0?e={inkBar:!0,tabPane:!1}:e=Ce({inkBar:!0},Kn(i)==="object"?i:{}),e.tabPaneMotion&&e.tabPane===void 0&&(e.tabPane=!0),!e.tabPaneMotion&&e.tabPane&&(e.tabPane=!1),e}var HUe=["id","prefixCls","className","items","direction","activeKey","defaultActiveKey","editable","animated","tabPosition","tabBarGutter","tabBarStyle","tabBarExtraContent","locale","moreIcon","moreTransitionName","destroyInactiveTabPane","renderTabBar","onChange","onTabClick","onTabScroll","getPopupContainer","popupClassName","indicator"],Tie=0,$Ue=x.exports.forwardRef(function(i,e){var t=i.id,n=i.prefixCls,o=n===void 0?"rc-tabs":n,r=i.className,s=i.items,a=i.direction,l=i.activeKey,c=i.defaultActiveKey,u=i.editable,d=i.animated,h=i.tabPosition,f=h===void 0?"top":h,g=i.tabBarGutter,p=i.tabBarStyle,v=i.tabBarExtraContent,m=i.locale,_=i.moreIcon,y=i.moreTransitionName,w=i.destroyInactiveTabPane,L=i.renderTabBar,D=i.onChange,E=i.onTabClick,I=i.onTabScroll,k=i.getPopupContainer,R=i.popupClassName,A=i.indicator,P=Hn(i,HUe),N=x.exports.useMemo(function(){return(s||[]).filter(function(Ee){return Ee&&Kn(Ee)==="object"&&"key"in Ee})},[s]),M=a==="rtl",H=VUe(d),B=x.exports.useState(!1),F=Ne(B,2),$=F[0],z=F[1];x.exports.useEffect(function(){z(oq())},[]);var K=Kl(function(){var Ee;return(Ee=N[0])===null||Ee===void 0?void 0:Ee.key},{value:l,defaultValue:c}),j=Ne(K,2),G=j[0],X=j[1],de=x.exports.useState(function(){return N.findIndex(function(Ee){return Ee.key===G})}),fe=Ne(de,2),pe=fe[0],be=fe[1];x.exports.useEffect(function(){var Ee=N.findIndex(function(nt){return nt.key===G});if(Ee===-1){var tt;Ee=Math.max(0,Math.min(pe,N.length-1)),X((tt=N[Ee])===null||tt===void 0?void 0:tt.key)}be(Ee)},[N.map(function(Ee){return Ee.key}).join("_"),G,pe]);var Se=Kl(null,{value:t}),Fe=Ne(Se,2),De=Fe[0],ce=Fe[1];x.exports.useEffect(function(){t||(ce("rc-tabs-".concat(Tie)),Tie+=1)},[]);function Pe(Ee,tt){E==null||E(Ee,tt);var nt=Ee!==G;X(Ee),nt&&(D==null||D(Ee))}var Oe={id:De,activeKey:G,animated:H,tabPosition:f,rtl:M,mobile:$},xe=Ce(Ce({},Oe),{},{editable:u,locale:m,moreIcon:_,moreTransitionName:y,tabBarGutter:g,onTabClick:Pe,onTabScroll:I,extra:v,style:p,panes:null,getPopupContainer:k,popupClassName:R,indicator:A});return x.exports.createElement(P4.Provider,{value:{tabs:N,prefixCls:o}},x.exports.createElement("div",yt({ref:e,id:t,className:Ue(o,"".concat(o,"-").concat(f),me(me(me({},"".concat(o,"-mobile"),$),"".concat(o,"-editable"),u),"".concat(o,"-rtl"),M),r)},P),x.exports.createElement(FUe,yt({},xe,{renderTabBar:L})),x.exports.createElement(WUe,yt({destroyInactiveTabPane:w},Oe,{animated:H}))))});const zUe={motionAppear:!1,motionEnter:!0,motionLeave:!0};function UUe(i){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{inkBar:!0,tabPane:!1},t;return e===!1?t={inkBar:!1,tabPane:!1}:e===!0?t={inkBar:!0,tabPane:!0}:t=Object.assign({inkBar:!0},typeof e=="object"?e:{}),t.tabPane&&(t.tabPaneMotion=Object.assign(Object.assign({},zUe),{motionName:j0(i,"switch")})),t}var jUe=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(i);oe)}function qUe(i,e){if(i)return i;const t=ip(e).map(n=>{if(x.exports.isValidElement(n)){const{key:o,props:r}=n,s=r||{},{tab:a}=s,l=jUe(s,["tab"]);return Object.assign(Object.assign({key:String(o)},l),{label:a})}return null});return KUe(t)}const GUe=i=>{const{componentCls:e,motionDurationSlow:t}=i;return[{[e]:{[`${e}-switch`]:{"&-appear, &-enter":{transition:"none","&-start":{opacity:0},"&-active":{opacity:1,transition:`opacity ${t}`}},"&-leave":{position:"absolute",transition:"none",inset:0,"&-start":{opacity:1},"&-active":{opacity:0,transition:`opacity ${t}`}}}}},[EA(i,"slide-up"),EA(i,"slide-down")]]};var XUe=GUe;const YUe=i=>{const{componentCls:e,tabsCardPadding:t,cardBg:n,cardGutter:o,colorBorderSecondary:r,itemSelectedColor:s}=i;return{[`${e}-card`]:{[`> ${e}-nav, > div > ${e}-nav`]:{[`${e}-tab`]:{margin:0,padding:t,background:n,border:`${rt(i.lineWidth)} ${i.lineType} ${r}`,transition:`all ${i.motionDurationSlow} ${i.motionEaseInOut}`},[`${e}-tab-active`]:{color:s,background:i.colorBgContainer},[`${e}-ink-bar`]:{visibility:"hidden"}},[`&${e}-top, &${e}-bottom`]:{[`> ${e}-nav, > div > ${e}-nav`]:{[`${e}-tab + ${e}-tab`]:{marginLeft:{_skip_check_:!0,value:rt(o)}}}},[`&${e}-top`]:{[`> ${e}-nav, > div > ${e}-nav`]:{[`${e}-tab`]:{borderRadius:`${rt(i.borderRadiusLG)} ${rt(i.borderRadiusLG)} 0 0`},[`${e}-tab-active`]:{borderBottomColor:i.colorBgContainer}}},[`&${e}-bottom`]:{[`> ${e}-nav, > div > ${e}-nav`]:{[`${e}-tab`]:{borderRadius:`0 0 ${rt(i.borderRadiusLG)} ${rt(i.borderRadiusLG)}`},[`${e}-tab-active`]:{borderTopColor:i.colorBgContainer}}},[`&${e}-left, &${e}-right`]:{[`> ${e}-nav, > div > ${e}-nav`]:{[`${e}-tab + ${e}-tab`]:{marginTop:rt(o)}}},[`&${e}-left`]:{[`> ${e}-nav, > div > ${e}-nav`]:{[`${e}-tab`]:{borderRadius:{_skip_check_:!0,value:`${rt(i.borderRadiusLG)} 0 0 ${rt(i.borderRadiusLG)}`}},[`${e}-tab-active`]:{borderRightColor:{_skip_check_:!0,value:i.colorBgContainer}}}},[`&${e}-right`]:{[`> ${e}-nav, > div > ${e}-nav`]:{[`${e}-tab`]:{borderRadius:{_skip_check_:!0,value:`0 ${rt(i.borderRadiusLG)} ${rt(i.borderRadiusLG)} 0`}},[`${e}-tab-active`]:{borderLeftColor:{_skip_check_:!0,value:i.colorBgContainer}}}}}}},ZUe=i=>{const{componentCls:e,itemHoverColor:t,dropdownEdgeChildVerticalPadding:n}=i;return{[`${e}-dropdown`]:Object.assign(Object.assign({},Pa(i)),{position:"absolute",top:-9999,left:{_skip_check_:!0,value:-9999},zIndex:i.zIndexPopup,display:"block","&-hidden":{display:"none"},[`${e}-dropdown-menu`]:{maxHeight:i.tabsDropdownHeight,margin:0,padding:`${rt(n)} 0`,overflowX:"hidden",overflowY:"auto",textAlign:{_skip_check_:!0,value:"left"},listStyleType:"none",backgroundColor:i.colorBgContainer,backgroundClip:"padding-box",borderRadius:i.borderRadiusLG,outline:"none",boxShadow:i.boxShadowSecondary,"&-item":Object.assign(Object.assign({},CA),{display:"flex",alignItems:"center",minWidth:i.tabsDropdownWidth,margin:0,padding:`${rt(i.paddingXXS)} ${rt(i.paddingSM)}`,color:i.colorText,fontWeight:"normal",fontSize:i.fontSize,lineHeight:i.lineHeight,cursor:"pointer",transition:`all ${i.motionDurationSlow}`,"> span":{flex:1,whiteSpace:"nowrap"},"&-remove":{flex:"none",marginLeft:{_skip_check_:!0,value:i.marginSM},color:i.colorTextDescription,fontSize:i.fontSizeSM,background:"transparent",border:0,cursor:"pointer","&:hover":{color:t}},"&:hover":{background:i.controlItemBgHover},"&-disabled":{"&, &:hover":{color:i.colorTextDisabled,background:"transparent",cursor:"not-allowed"}}})}})}},QUe=i=>{const{componentCls:e,margin:t,colorBorderSecondary:n,horizontalMargin:o,verticalItemPadding:r,verticalItemMargin:s,calc:a}=i;return{[`${e}-top, ${e}-bottom`]:{flexDirection:"column",[`> ${e}-nav, > div > ${e}-nav`]:{margin:o,"&::before":{position:"absolute",right:{_skip_check_:!0,value:0},left:{_skip_check_:!0,value:0},borderBottom:`${rt(i.lineWidth)} ${i.lineType} ${n}`,content:"''"},[`${e}-ink-bar`]:{height:i.lineWidthBold,"&-animated":{transition:`width ${i.motionDurationSlow}, left ${i.motionDurationSlow}, right ${i.motionDurationSlow}`}},[`${e}-nav-wrap`]:{"&::before, &::after":{top:0,bottom:0,width:i.controlHeight},"&::before":{left:{_skip_check_:!0,value:0},boxShadow:i.boxShadowTabsOverflowLeft},"&::after":{right:{_skip_check_:!0,value:0},boxShadow:i.boxShadowTabsOverflowRight},[`&${e}-nav-wrap-ping-left::before`]:{opacity:1},[`&${e}-nav-wrap-ping-right::after`]:{opacity:1}}}},[`${e}-top`]:{[`> ${e}-nav, - > div > ${e}-nav`]:{"&::before":{bottom:0},[`${e}-ink-bar`]:{bottom:0}}},[`${e}-bottom`]:{[`> ${e}-nav, > div > ${e}-nav`]:{order:1,marginTop:t,marginBottom:0,"&::before":{top:0},[`${e}-ink-bar`]:{top:0}},[`> ${e}-content-holder, > div > ${e}-content-holder`]:{order:0}},[`${e}-left, ${e}-right`]:{[`> ${e}-nav, > div > ${e}-nav`]:{flexDirection:"column",minWidth:a(i.controlHeight).mul(1.25).equal(),[`${e}-tab`]:{padding:r,textAlign:"center"},[`${e}-tab + ${e}-tab`]:{margin:s},[`${e}-nav-wrap`]:{flexDirection:"column","&::before, &::after":{right:{_skip_check_:!0,value:0},left:{_skip_check_:!0,value:0},height:i.controlHeight},"&::before":{top:0,boxShadow:i.boxShadowTabsOverflowTop},"&::after":{bottom:0,boxShadow:i.boxShadowTabsOverflowBottom},[`&${e}-nav-wrap-ping-top::before`]:{opacity:1},[`&${e}-nav-wrap-ping-bottom::after`]:{opacity:1}},[`${e}-ink-bar`]:{width:i.lineWidthBold,"&-animated":{transition:`height ${i.motionDurationSlow}, top ${i.motionDurationSlow}`}},[`${e}-nav-list, ${e}-nav-operations`]:{flex:"1 0 auto",flexDirection:"column"}}},[`${e}-left`]:{[`> ${e}-nav, > div > ${e}-nav`]:{[`${e}-ink-bar`]:{right:{_skip_check_:!0,value:0}}},[`> ${e}-content-holder, > div > ${e}-content-holder`]:{marginLeft:{_skip_check_:!0,value:rt(a(i.lineWidth).mul(-1).equal())},borderLeft:{_skip_check_:!0,value:`${rt(i.lineWidth)} ${i.lineType} ${i.colorBorder}`},[`> ${e}-content > ${e}-tabpane`]:{paddingLeft:{_skip_check_:!0,value:i.paddingLG}}}},[`${e}-right`]:{[`> ${e}-nav, > div > ${e}-nav`]:{order:1,[`${e}-ink-bar`]:{left:{_skip_check_:!0,value:0}}},[`> ${e}-content-holder, > div > ${e}-content-holder`]:{order:0,marginRight:{_skip_check_:!0,value:a(i.lineWidth).mul(-1).equal()},borderRight:{_skip_check_:!0,value:`${rt(i.lineWidth)} ${i.lineType} ${i.colorBorder}`},[`> ${e}-content > ${e}-tabpane`]:{paddingRight:{_skip_check_:!0,value:i.paddingLG}}}}}},jUe=i=>{const{componentCls:e,cardPaddingSM:t,cardPaddingLG:n,horizontalItemPaddingSM:o,horizontalItemPaddingLG:r}=i;return{[e]:{"&-small":{[`> ${e}-nav`]:{[`${e}-tab`]:{padding:o,fontSize:i.titleFontSizeSM}}},"&-large":{[`> ${e}-nav`]:{[`${e}-tab`]:{padding:r,fontSize:i.titleFontSizeLG}}}},[`${e}-card`]:{[`&${e}-small`]:{[`> ${e}-nav`]:{[`${e}-tab`]:{padding:t}},[`&${e}-bottom`]:{[`> ${e}-nav ${e}-tab`]:{borderRadius:`0 0 ${rt(i.borderRadius)} ${rt(i.borderRadius)}`}},[`&${e}-top`]:{[`> ${e}-nav ${e}-tab`]:{borderRadius:`${rt(i.borderRadius)} ${rt(i.borderRadius)} 0 0`}},[`&${e}-right`]:{[`> ${e}-nav ${e}-tab`]:{borderRadius:{_skip_check_:!0,value:`0 ${rt(i.borderRadius)} ${rt(i.borderRadius)} 0`}}},[`&${e}-left`]:{[`> ${e}-nav ${e}-tab`]:{borderRadius:{_skip_check_:!0,value:`${rt(i.borderRadius)} 0 0 ${rt(i.borderRadius)}`}}}},[`&${e}-large`]:{[`> ${e}-nav`]:{[`${e}-tab`]:{padding:n}}}}}},KUe=i=>{const{componentCls:e,itemActiveColor:t,itemHoverColor:n,iconCls:o,tabsHorizontalItemMargin:r,horizontalItemPadding:s,itemSelectedColor:a,itemColor:l}=i,c=`${e}-tab`;return{[c]:{position:"relative",WebkitTouchCallout:"none",WebkitTapHighlightColor:"transparent",display:"inline-flex",alignItems:"center",padding:s,fontSize:i.titleFontSize,background:"transparent",border:0,outline:"none",cursor:"pointer",color:l,"&-btn, &-remove":Object.assign({"&:focus:not(:focus-visible), &:active":{color:t}},S4(i)),"&-btn":{outline:"none",transition:"all 0.3s",[`${c}-icon:not(:last-child)`]:{marginInlineEnd:i.marginSM}},"&-remove":{flex:"none",marginRight:{_skip_check_:!0,value:i.calc(i.marginXXS).mul(-1).equal()},marginLeft:{_skip_check_:!0,value:i.marginXS},color:i.colorTextDescription,fontSize:i.fontSizeSM,background:"transparent",border:"none",outline:"none",cursor:"pointer",transition:`all ${i.motionDurationSlow}`,"&:hover":{color:i.colorTextHeading}},"&:hover":{color:n},[`&${c}-active ${c}-btn`]:{color:a,textShadow:i.tabsActiveTextShadow},[`&${c}-disabled`]:{color:i.colorTextDisabled,cursor:"not-allowed"},[`&${c}-disabled ${c}-btn, &${c}-disabled ${e}-remove`]:{"&:focus, &:active":{color:i.colorTextDisabled}},[`& ${c}-remove ${o}`]:{margin:0},[`${o}:not(:last-child)`]:{marginRight:{_skip_check_:!0,value:i.marginSM}}},[`${c} + ${c}`]:{margin:{_skip_check_:!0,value:r}}}},qUe=i=>{const{componentCls:e,tabsHorizontalItemMarginRTL:t,iconCls:n,cardGutter:o,calc:r}=i;return{[`${e}-rtl`]:{direction:"rtl",[`${e}-nav`]:{[`${e}-tab`]:{margin:{_skip_check_:!0,value:t},[`${e}-tab:last-of-type`]:{marginLeft:{_skip_check_:!0,value:0}},[n]:{marginRight:{_skip_check_:!0,value:0},marginLeft:{_skip_check_:!0,value:rt(i.marginSM)}},[`${e}-tab-remove`]:{marginRight:{_skip_check_:!0,value:rt(i.marginXS)},marginLeft:{_skip_check_:!0,value:rt(r(i.marginXXS).mul(-1).equal())},[n]:{margin:0}}}},[`&${e}-left`]:{[`> ${e}-nav`]:{order:1},[`> ${e}-content-holder`]:{order:0}},[`&${e}-right`]:{[`> ${e}-nav`]:{order:0},[`> ${e}-content-holder`]:{order:1}},[`&${e}-card${e}-top, &${e}-card${e}-bottom`]:{[`> ${e}-nav, > div > ${e}-nav`]:{[`${e}-tab + ${e}-tab`]:{marginRight:{_skip_check_:!0,value:o},marginLeft:{_skip_check_:!0,value:0}}}}},[`${e}-dropdown-rtl`]:{direction:"rtl"},[`${e}-menu-item`]:{[`${e}-dropdown-rtl`]:{textAlign:{_skip_check_:!0,value:"right"}}}}},GUe=i=>{const{componentCls:e,tabsCardPadding:t,cardHeight:n,cardGutter:o,itemHoverColor:r,itemActiveColor:s,colorBorderSecondary:a}=i;return{[e]:Object.assign(Object.assign(Object.assign(Object.assign({},Aa(i)),{display:"flex",[`> ${e}-nav, > div > ${e}-nav`]:{position:"relative",display:"flex",flex:"none",alignItems:"center",[`${e}-nav-wrap`]:{position:"relative",display:"flex",flex:"auto",alignSelf:"stretch",overflow:"hidden",whiteSpace:"nowrap",transform:"translate(0)","&::before, &::after":{position:"absolute",zIndex:1,opacity:0,transition:`opacity ${i.motionDurationSlow}`,content:"''",pointerEvents:"none"}},[`${e}-nav-list`]:{position:"relative",display:"flex",transition:`opacity ${i.motionDurationSlow}`},[`${e}-nav-operations`]:{display:"flex",alignSelf:"stretch"},[`${e}-nav-operations-hidden`]:{position:"absolute",visibility:"hidden",pointerEvents:"none"},[`${e}-nav-more`]:{position:"relative",padding:t,background:"transparent",border:0,color:i.colorText,"&::after":{position:"absolute",right:{_skip_check_:!0,value:0},bottom:0,left:{_skip_check_:!0,value:0},height:i.calc(i.controlHeightLG).div(8).equal(),transform:"translateY(100%)",content:"''"}},[`${e}-nav-add`]:Object.assign({minWidth:n,minHeight:n,marginLeft:{_skip_check_:!0,value:o},padding:`0 ${rt(i.paddingXS)}`,background:"transparent",border:`${rt(i.lineWidth)} ${i.lineType} ${a}`,borderRadius:`${rt(i.borderRadiusLG)} ${rt(i.borderRadiusLG)} 0 0`,outline:"none",cursor:"pointer",color:i.colorText,transition:`all ${i.motionDurationSlow} ${i.motionEaseInOut}`,"&:hover":{color:r},"&:active, &:focus:not(:focus-visible)":{color:s}},S4(i))},[`${e}-extra-content`]:{flex:"none"},[`${e}-ink-bar`]:{position:"absolute",background:i.inkBarColor,pointerEvents:"none"}}),KUe(i)),{[`${e}-content`]:{position:"relative",width:"100%"},[`${e}-content-holder`]:{flex:"auto",minWidth:0,minHeight:0},[`${e}-tabpane`]:{outline:"none","&-hidden":{display:"none"}}}),[`${e}-centered`]:{[`> ${e}-nav, > div > ${e}-nav`]:{[`${e}-nav-wrap`]:{[`&:not([class*='${e}-nav-wrap-ping'])`]:{justifyContent:"center"}}}}}},XUe=i=>{const e=i.controlHeightLG;return{zIndexPopup:i.zIndexPopupBase+50,cardBg:i.colorFillAlter,cardHeight:e,cardPadding:`${(e-Math.round(i.fontSize*i.lineHeight))/2-i.lineWidth}px ${i.padding}px`,cardPaddingSM:`${i.paddingXXS*1.5}px ${i.padding}px`,cardPaddingLG:`${i.paddingXS}px ${i.padding}px ${i.paddingXXS*1.5}px`,titleFontSize:i.fontSize,titleFontSizeLG:i.fontSizeLG,titleFontSizeSM:i.fontSize,inkBarColor:i.colorPrimary,horizontalMargin:`0 0 ${i.margin}px 0`,horizontalItemGutter:32,horizontalItemMargin:"",horizontalItemMarginRTL:"",horizontalItemPadding:`${i.paddingSM}px 0`,horizontalItemPaddingSM:`${i.paddingXS}px 0`,horizontalItemPaddingLG:`${i.padding}px 0`,verticalItemPadding:`${i.paddingXS}px ${i.paddingLG}px`,verticalItemMargin:`${i.margin}px 0 0 0`,itemColor:i.colorText,itemSelectedColor:i.colorPrimary,itemHoverColor:i.colorPrimaryHover,itemActiveColor:i.colorPrimaryActive,cardGutter:i.marginXXS/2}};var YUe=Uc("Tabs",i=>{const e=lr(i,{tabsCardPadding:i.cardPadding,dropdownEdgeChildVerticalPadding:i.paddingXXS,tabsActiveTextShadow:"0 0 0.25px currentcolor",tabsDropdownHeight:200,tabsDropdownWidth:120,tabsHorizontalItemMargin:`0 0 0 ${rt(i.horizontalItemGutter)}`,tabsHorizontalItemMarginRTL:`0 0 0 ${rt(i.horizontalItemGutter)}`});return[jUe(e),qUe(e),UUe(e),zUe(e),$Ue(e),GUe(e),HUe(e)]},XUe);const ZUe=()=>null;var QUe=ZUe,JUe=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(i);o{var e,t,n,o,r,s;const{type:a,className:l,rootClassName:c,size:u,onEdit:d,hideAdd:h,centered:f,addIcon:g,popupClassName:p,children:v,items:m,animated:_,style:w,indicatorSize:y,indicator:L}=i,D=JUe(i,["type","className","rootClassName","size","onEdit","hideAdd","centered","addIcon","popupClassName","children","items","animated","style","indicatorSize","indicator"]),{prefixCls:E,moreIcon:I=x.exports.createElement(Gze,null)}=D,{direction:k,tabs:R,getPrefixCls:A,getPopupContainer:P}=x.exports.useContext(Hi),N=A("tabs",E),M=th(N),[H,W,F]=YUe(N,M);let $;a==="editable-card"&&($={onEdit:(he,pe)=>{let{key:be,event:Se}=pe;d==null||d(he==="add"?Se:be,he)},removeIcon:x.exports.createElement(cS,null),addIcon:g||x.exports.createElement(pUe,null),showAdd:h!==!0});const z=A(),K=Pb(u),j=WUe(m,v),G=OUe(N,_),X=Object.assign(Object.assign({},R==null?void 0:R.style),w),de={align:(e=L==null?void 0:L.align)!==null&&e!==void 0?e:(t=R==null?void 0:R.indicator)===null||t===void 0?void 0:t.align,size:(s=(o=(n=L==null?void 0:L.size)!==null&&n!==void 0?n:y)!==null&&o!==void 0?o:(r=R==null?void 0:R.indicator)===null||r===void 0?void 0:r.size)!==null&&s!==void 0?s:R==null?void 0:R.indicatorSize};return H(x.exports.createElement(AUe,Object.assign({direction:k,getPopupContainer:P,moreTransitionName:`${z}-slide-up`},D,{items:j,className:Ue({[`${N}-${K}`]:K,[`${N}-card`]:["card","editable-card"].includes(a),[`${N}-editable-card`]:a==="editable-card",[`${N}-centered`]:f},R==null?void 0:R.className,l,c,W,F,M),popupClassName:Ue(p,W,F,M),style:X,editable:$,moreIcon:I,prefixCls:N,animated:G,indicator:de})))};mve.TabPane=QUe;var eje=mve;function yc(i,e){return i[e]}var tje=["children"];function vve(i,e){return"".concat(i,"-").concat(e)}function nje(i){return i&&i.type&&i.type.isTreeNode}function RI(i,e){return i!=null?i:e}function ay(i){var e=i||{},t=e.title,n=e._title,o=e.key,r=e.children,s=t||"title";return{title:s,_title:n||[s],key:o||"key",children:r||"children"}}function _ve(i){function e(t){var n=np(t);return n.map(function(o){if(!nje(o))return rr(!o,"Tree/TreeNode can only accept TreeNode as children."),null;var r=o.key,s=o.props,a=s.children,l=Hn(s,tje),c=Ce({key:r},l),u=e(a);return u.length&&(c.children=u),c}).filter(function(o){return o})}return e(i)}function v6(i,e,t){var n=ay(t),o=n._title,r=n.key,s=n.children,a=new Set(e===!0?[]:e),l=[];function c(u){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return u.map(function(h,f){for(var g=vve(d?d.pos:"0",f),p=RI(h[r],g),v,m=0;m1&&arguments[1]!==void 0?arguments[1]:{},t=e.initWrapper,n=e.processEntity,o=e.onProcessFinished,r=e.externalGetKey,s=e.childrenPropName,a=e.fieldNames,l=arguments.length>2?arguments[2]:void 0,c=r||l,u={},d={},h={posEntities:u,keyEntities:d};return t&&(h=t(h)||h),ije(i,function(f){var g=f.node,p=f.index,v=f.pos,m=f.key,_=f.parentPos,w=f.level,y=f.nodes,L={node:g,nodes:y,index:p,key:m,pos:v,level:w},D=RI(m,v);u[v]=L,d[D]=L,L.parent=u[_],L.parent&&(L.parent.children=L.parent.children||[],L.parent.children.push(L)),n&&n(L,h)},{externalGetKey:c,childrenPropName:s,fieldNames:a}),o&&o(h),h}function oE(i,e){var t=e.expandedKeys,n=e.selectedKeys,o=e.loadedKeys,r=e.loadingKeys,s=e.checkedKeys,a=e.halfCheckedKeys,l=e.dragOverNodeKey,c=e.dropPosition,u=e.keyEntities,d=yc(u,i),h={eventKey:i,expanded:t.indexOf(i)!==-1,selected:n.indexOf(i)!==-1,loaded:o.indexOf(i)!==-1,loading:r.indexOf(i)!==-1,checked:s.indexOf(i)!==-1,halfChecked:a.indexOf(i)!==-1,pos:String(d?d.pos:""),dragOver:l===i&&c===0,dragOverGapTop:l===i&&c===-1,dragOverGapBottom:l===i&&c===1};return h}function Zr(i){var e=i.data,t=i.expanded,n=i.selected,o=i.checked,r=i.loaded,s=i.loading,a=i.halfChecked,l=i.dragOver,c=i.dragOverGapTop,u=i.dragOverGapBottom,d=i.pos,h=i.active,f=i.eventKey,g=Ce(Ce({},e),{},{expanded:t,selected:n,checked:o,loaded:r,loading:s,halfChecked:a,dragOver:l,dragOverGapTop:c,dragOverGapBottom:u,pos:d,active:h,key:f});return"props"in g||Object.defineProperty(g,"props",{get:function(){return rr(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),i}}),g}function Cve(i,e){var t=new Set;return i.forEach(function(n){e.has(n)||t.add(n)}),t}function oje(i){var e=i||{},t=e.disabled,n=e.disableCheckbox,o=e.checkable;return!!(t||n)||o===!1}function rje(i,e,t,n){for(var o=new Set(i),r=new Set,s=0;s<=t;s+=1){var a=e.get(s)||new Set;a.forEach(function(d){var h=d.key,f=d.node,g=d.children,p=g===void 0?[]:g;o.has(h)&&!n(f)&&p.filter(function(v){return!n(v.node)}).forEach(function(v){o.add(v.key)})})}for(var l=new Set,c=t;c>=0;c-=1){var u=e.get(c)||new Set;u.forEach(function(d){var h=d.parent,f=d.node;if(!(n(f)||!d.parent||l.has(d.parent.key))){if(n(d.parent.node)){l.add(h.key);return}var g=!0,p=!1;(h.children||[]).filter(function(v){return!n(v.node)}).forEach(function(v){var m=v.key,_=o.has(m);g&&!_&&(g=!1),!p&&(_||r.has(m))&&(p=!0)}),g&&o.add(h.key),p&&r.add(h.key),l.add(h.key)}})}return{checkedKeys:Array.from(o),halfCheckedKeys:Array.from(Cve(r,o))}}function sje(i,e,t,n,o){for(var r=new Set(i),s=new Set(e),a=0;a<=n;a+=1){var l=t.get(a)||new Set;l.forEach(function(h){var f=h.key,g=h.node,p=h.children,v=p===void 0?[]:p;!r.has(f)&&!s.has(f)&&!o(g)&&v.filter(function(m){return!o(m.node)}).forEach(function(m){r.delete(m.key)})})}s=new Set;for(var c=new Set,u=n;u>=0;u-=1){var d=t.get(u)||new Set;d.forEach(function(h){var f=h.parent,g=h.node;if(!(o(g)||!h.parent||c.has(h.parent.key))){if(o(h.parent.node)){c.add(f.key);return}var p=!0,v=!1;(f.children||[]).filter(function(m){return!o(m.node)}).forEach(function(m){var _=m.key,w=r.has(_);p&&!w&&(p=!1),!v&&(w||s.has(_))&&(v=!0)}),p||r.delete(f.key),v&&s.add(f.key),c.add(f.key)}})}return{checkedKeys:Array.from(r),halfCheckedKeys:Array.from(Cve(s,r))}}function _6(i,e,t,n){var o=[],r;n?r=n:r=oje;var s=new Set(i.filter(function(u){var d=!!yc(t,u);return d||o.push(u),d})),a=new Map,l=0;Object.keys(t).forEach(function(u){var d=t[u],h=d.level,f=a.get(h);f||(f=new Set,a.set(h,f)),f.add(d),l=Math.max(l,h)}),rr(!o.length,"Tree missing follow keys: ".concat(o.slice(0,100).map(function(u){return"'".concat(u,"'")}).join(", ")));var c;return e===!0?c=rje(s,a,l,r):c=sje(s,e.halfCheckedKeys,a,l,r),c}const aje=i=>{const{checkboxCls:e}=i,t=`${e}-wrapper`;return[{[`${e}-group`]:Object.assign(Object.assign({},Aa(i)),{display:"inline-flex",flexWrap:"wrap",columnGap:i.marginXS,[`> ${i.antCls}-row`]:{flex:1}}),[t]:Object.assign(Object.assign({},Aa(i)),{display:"inline-flex",alignItems:"baseline",cursor:"pointer","&:after":{display:"inline-block",width:0,overflow:"hidden",content:"'\\a0'"},[`& + ${t}`]:{marginInlineStart:0},[`&${t}-in-form-item`]:{'input[type="checkbox"]':{width:14,height:14}}}),[e]:Object.assign(Object.assign({},Aa(i)),{position:"relative",whiteSpace:"nowrap",lineHeight:1,cursor:"pointer",borderRadius:i.borderRadiusSM,alignSelf:"center",[`${e}-input`]:{position:"absolute",inset:0,zIndex:1,cursor:"pointer",opacity:0,margin:0,[`&:focus-visible + ${e}-inner`]:Object.assign({},NK(i))},[`${e}-inner`]:{boxSizing:"border-box",display:"block",width:i.checkboxSize,height:i.checkboxSize,direction:"ltr",backgroundColor:i.colorBgContainer,border:`${rt(i.lineWidth)} ${i.lineType} ${i.colorBorder}`,borderRadius:i.borderRadiusSM,borderCollapse:"separate",transition:`all ${i.motionDurationSlow}`,"&:after":{boxSizing:"border-box",position:"absolute",top:"50%",insetInlineStart:"25%",display:"table",width:i.calc(i.checkboxSize).div(14).mul(5).equal(),height:i.calc(i.checkboxSize).div(14).mul(8).equal(),border:`${rt(i.lineWidthBold)} solid ${i.colorWhite}`,borderTop:0,borderInlineStart:0,transform:"rotate(45deg) scale(0) translate(-50%,-50%)",opacity:0,content:'""',transition:`all ${i.motionDurationFast} ${i.motionEaseInBack}, opacity ${i.motionDurationFast}`}},"& + span":{paddingInlineStart:i.paddingXS,paddingInlineEnd:i.paddingXS}})},{[` + > div > ${e}-nav`]:{"&::before":{bottom:0},[`${e}-ink-bar`]:{bottom:0}}},[`${e}-bottom`]:{[`> ${e}-nav, > div > ${e}-nav`]:{order:1,marginTop:t,marginBottom:0,"&::before":{top:0},[`${e}-ink-bar`]:{top:0}},[`> ${e}-content-holder, > div > ${e}-content-holder`]:{order:0}},[`${e}-left, ${e}-right`]:{[`> ${e}-nav, > div > ${e}-nav`]:{flexDirection:"column",minWidth:a(i.controlHeight).mul(1.25).equal(),[`${e}-tab`]:{padding:r,textAlign:"center"},[`${e}-tab + ${e}-tab`]:{margin:s},[`${e}-nav-wrap`]:{flexDirection:"column","&::before, &::after":{right:{_skip_check_:!0,value:0},left:{_skip_check_:!0,value:0},height:i.controlHeight},"&::before":{top:0,boxShadow:i.boxShadowTabsOverflowTop},"&::after":{bottom:0,boxShadow:i.boxShadowTabsOverflowBottom},[`&${e}-nav-wrap-ping-top::before`]:{opacity:1},[`&${e}-nav-wrap-ping-bottom::after`]:{opacity:1}},[`${e}-ink-bar`]:{width:i.lineWidthBold,"&-animated":{transition:`height ${i.motionDurationSlow}, top ${i.motionDurationSlow}`}},[`${e}-nav-list, ${e}-nav-operations`]:{flex:"1 0 auto",flexDirection:"column"}}},[`${e}-left`]:{[`> ${e}-nav, > div > ${e}-nav`]:{[`${e}-ink-bar`]:{right:{_skip_check_:!0,value:0}}},[`> ${e}-content-holder, > div > ${e}-content-holder`]:{marginLeft:{_skip_check_:!0,value:rt(a(i.lineWidth).mul(-1).equal())},borderLeft:{_skip_check_:!0,value:`${rt(i.lineWidth)} ${i.lineType} ${i.colorBorder}`},[`> ${e}-content > ${e}-tabpane`]:{paddingLeft:{_skip_check_:!0,value:i.paddingLG}}}},[`${e}-right`]:{[`> ${e}-nav, > div > ${e}-nav`]:{order:1,[`${e}-ink-bar`]:{left:{_skip_check_:!0,value:0}}},[`> ${e}-content-holder, > div > ${e}-content-holder`]:{order:0,marginRight:{_skip_check_:!0,value:a(i.lineWidth).mul(-1).equal()},borderRight:{_skip_check_:!0,value:`${rt(i.lineWidth)} ${i.lineType} ${i.colorBorder}`},[`> ${e}-content > ${e}-tabpane`]:{paddingRight:{_skip_check_:!0,value:i.paddingLG}}}}}},JUe=i=>{const{componentCls:e,cardPaddingSM:t,cardPaddingLG:n,horizontalItemPaddingSM:o,horizontalItemPaddingLG:r}=i;return{[e]:{"&-small":{[`> ${e}-nav`]:{[`${e}-tab`]:{padding:o,fontSize:i.titleFontSizeSM}}},"&-large":{[`> ${e}-nav`]:{[`${e}-tab`]:{padding:r,fontSize:i.titleFontSizeLG}}}},[`${e}-card`]:{[`&${e}-small`]:{[`> ${e}-nav`]:{[`${e}-tab`]:{padding:t}},[`&${e}-bottom`]:{[`> ${e}-nav ${e}-tab`]:{borderRadius:`0 0 ${rt(i.borderRadius)} ${rt(i.borderRadius)}`}},[`&${e}-top`]:{[`> ${e}-nav ${e}-tab`]:{borderRadius:`${rt(i.borderRadius)} ${rt(i.borderRadius)} 0 0`}},[`&${e}-right`]:{[`> ${e}-nav ${e}-tab`]:{borderRadius:{_skip_check_:!0,value:`0 ${rt(i.borderRadius)} ${rt(i.borderRadius)} 0`}}},[`&${e}-left`]:{[`> ${e}-nav ${e}-tab`]:{borderRadius:{_skip_check_:!0,value:`${rt(i.borderRadius)} 0 0 ${rt(i.borderRadius)}`}}}},[`&${e}-large`]:{[`> ${e}-nav`]:{[`${e}-tab`]:{padding:n}}}}}},eje=i=>{const{componentCls:e,itemActiveColor:t,itemHoverColor:n,iconCls:o,tabsHorizontalItemMargin:r,horizontalItemPadding:s,itemSelectedColor:a,itemColor:l}=i,c=`${e}-tab`;return{[c]:{position:"relative",WebkitTouchCallout:"none",WebkitTapHighlightColor:"transparent",display:"inline-flex",alignItems:"center",padding:s,fontSize:i.titleFontSize,background:"transparent",border:0,outline:"none",cursor:"pointer",color:l,"&-btn, &-remove":Object.assign({"&:focus:not(:focus-visible), &:active":{color:t}},x4(i)),"&-btn":{outline:"none",transition:"all 0.3s",[`${c}-icon:not(:last-child)`]:{marginInlineEnd:i.marginSM}},"&-remove":{flex:"none",marginRight:{_skip_check_:!0,value:i.calc(i.marginXXS).mul(-1).equal()},marginLeft:{_skip_check_:!0,value:i.marginXS},color:i.colorTextDescription,fontSize:i.fontSizeSM,background:"transparent",border:"none",outline:"none",cursor:"pointer",transition:`all ${i.motionDurationSlow}`,"&:hover":{color:i.colorTextHeading}},"&:hover":{color:n},[`&${c}-active ${c}-btn`]:{color:a,textShadow:i.tabsActiveTextShadow},[`&${c}-disabled`]:{color:i.colorTextDisabled,cursor:"not-allowed"},[`&${c}-disabled ${c}-btn, &${c}-disabled ${e}-remove`]:{"&:focus, &:active":{color:i.colorTextDisabled}},[`& ${c}-remove ${o}`]:{margin:0},[`${o}:not(:last-child)`]:{marginRight:{_skip_check_:!0,value:i.marginSM}}},[`${c} + ${c}`]:{margin:{_skip_check_:!0,value:r}}}},tje=i=>{const{componentCls:e,tabsHorizontalItemMarginRTL:t,iconCls:n,cardGutter:o,calc:r}=i;return{[`${e}-rtl`]:{direction:"rtl",[`${e}-nav`]:{[`${e}-tab`]:{margin:{_skip_check_:!0,value:t},[`${e}-tab:last-of-type`]:{marginLeft:{_skip_check_:!0,value:0}},[n]:{marginRight:{_skip_check_:!0,value:0},marginLeft:{_skip_check_:!0,value:rt(i.marginSM)}},[`${e}-tab-remove`]:{marginRight:{_skip_check_:!0,value:rt(i.marginXS)},marginLeft:{_skip_check_:!0,value:rt(r(i.marginXXS).mul(-1).equal())},[n]:{margin:0}}}},[`&${e}-left`]:{[`> ${e}-nav`]:{order:1},[`> ${e}-content-holder`]:{order:0}},[`&${e}-right`]:{[`> ${e}-nav`]:{order:0},[`> ${e}-content-holder`]:{order:1}},[`&${e}-card${e}-top, &${e}-card${e}-bottom`]:{[`> ${e}-nav, > div > ${e}-nav`]:{[`${e}-tab + ${e}-tab`]:{marginRight:{_skip_check_:!0,value:o},marginLeft:{_skip_check_:!0,value:0}}}}},[`${e}-dropdown-rtl`]:{direction:"rtl"},[`${e}-menu-item`]:{[`${e}-dropdown-rtl`]:{textAlign:{_skip_check_:!0,value:"right"}}}}},nje=i=>{const{componentCls:e,tabsCardPadding:t,cardHeight:n,cardGutter:o,itemHoverColor:r,itemActiveColor:s,colorBorderSecondary:a}=i;return{[e]:Object.assign(Object.assign(Object.assign(Object.assign({},Pa(i)),{display:"flex",[`> ${e}-nav, > div > ${e}-nav`]:{position:"relative",display:"flex",flex:"none",alignItems:"center",[`${e}-nav-wrap`]:{position:"relative",display:"flex",flex:"auto",alignSelf:"stretch",overflow:"hidden",whiteSpace:"nowrap",transform:"translate(0)","&::before, &::after":{position:"absolute",zIndex:1,opacity:0,transition:`opacity ${i.motionDurationSlow}`,content:"''",pointerEvents:"none"}},[`${e}-nav-list`]:{position:"relative",display:"flex",transition:`opacity ${i.motionDurationSlow}`},[`${e}-nav-operations`]:{display:"flex",alignSelf:"stretch"},[`${e}-nav-operations-hidden`]:{position:"absolute",visibility:"hidden",pointerEvents:"none"},[`${e}-nav-more`]:{position:"relative",padding:t,background:"transparent",border:0,color:i.colorText,"&::after":{position:"absolute",right:{_skip_check_:!0,value:0},bottom:0,left:{_skip_check_:!0,value:0},height:i.calc(i.controlHeightLG).div(8).equal(),transform:"translateY(100%)",content:"''"}},[`${e}-nav-add`]:Object.assign({minWidth:n,minHeight:n,marginLeft:{_skip_check_:!0,value:o},padding:`0 ${rt(i.paddingXS)}`,background:"transparent",border:`${rt(i.lineWidth)} ${i.lineType} ${a}`,borderRadius:`${rt(i.borderRadiusLG)} ${rt(i.borderRadiusLG)} 0 0`,outline:"none",cursor:"pointer",color:i.colorText,transition:`all ${i.motionDurationSlow} ${i.motionEaseInOut}`,"&:hover":{color:r},"&:active, &:focus:not(:focus-visible)":{color:s}},x4(i))},[`${e}-extra-content`]:{flex:"none"},[`${e}-ink-bar`]:{position:"absolute",background:i.inkBarColor,pointerEvents:"none"}}),eje(i)),{[`${e}-content`]:{position:"relative",width:"100%"},[`${e}-content-holder`]:{flex:"auto",minWidth:0,minHeight:0},[`${e}-tabpane`]:{outline:"none","&-hidden":{display:"none"}}}),[`${e}-centered`]:{[`> ${e}-nav, > div > ${e}-nav`]:{[`${e}-nav-wrap`]:{[`&:not([class*='${e}-nav-wrap-ping'])`]:{justifyContent:"center"}}}}}},ije=i=>{const e=i.controlHeightLG;return{zIndexPopup:i.zIndexPopupBase+50,cardBg:i.colorFillAlter,cardHeight:e,cardPadding:`${(e-Math.round(i.fontSize*i.lineHeight))/2-i.lineWidth}px ${i.padding}px`,cardPaddingSM:`${i.paddingXXS*1.5}px ${i.padding}px`,cardPaddingLG:`${i.paddingXS}px ${i.padding}px ${i.paddingXXS*1.5}px`,titleFontSize:i.fontSize,titleFontSizeLG:i.fontSizeLG,titleFontSizeSM:i.fontSize,inkBarColor:i.colorPrimary,horizontalMargin:`0 0 ${i.margin}px 0`,horizontalItemGutter:32,horizontalItemMargin:"",horizontalItemMarginRTL:"",horizontalItemPadding:`${i.paddingSM}px 0`,horizontalItemPaddingSM:`${i.paddingXS}px 0`,horizontalItemPaddingLG:`${i.padding}px 0`,verticalItemPadding:`${i.paddingXS}px ${i.paddingLG}px`,verticalItemMargin:`${i.margin}px 0 0 0`,itemColor:i.colorText,itemSelectedColor:i.colorPrimary,itemHoverColor:i.colorPrimaryHover,itemActiveColor:i.colorPrimaryActive,cardGutter:i.marginXXS/2}};var oje=jc("Tabs",i=>{const e=lr(i,{tabsCardPadding:i.cardPadding,dropdownEdgeChildVerticalPadding:i.paddingXXS,tabsActiveTextShadow:"0 0 0.25px currentcolor",tabsDropdownHeight:200,tabsDropdownWidth:120,tabsHorizontalItemMargin:`0 0 0 ${rt(i.horizontalItemGutter)}`,tabsHorizontalItemMarginRTL:`0 0 0 ${rt(i.horizontalItemGutter)}`});return[JUe(e),tje(e),QUe(e),ZUe(e),YUe(e),nje(e),XUe(e)]},ije);const rje=()=>null;var sje=rje,aje=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(i);o{var e,t,n,o,r,s;const{type:a,className:l,rootClassName:c,size:u,onEdit:d,hideAdd:h,centered:f,addIcon:g,popupClassName:p,children:v,items:m,animated:_,style:y,indicatorSize:w,indicator:L}=i,D=aje(i,["type","className","rootClassName","size","onEdit","hideAdd","centered","addIcon","popupClassName","children","items","animated","style","indicatorSize","indicator"]),{prefixCls:E,moreIcon:I=x.exports.createElement(nUe,null)}=D,{direction:k,tabs:R,getPrefixCls:A,getPopupContainer:P}=x.exports.useContext(Hi),N=A("tabs",E),M=nh(N),[H,B,F]=oje(N,M);let $;a==="editable-card"&&($={onEdit:(fe,pe)=>{let{key:be,event:Se}=pe;d==null||d(fe==="add"?Se:be,fe)},removeIcon:x.exports.createElement(uS,null),addIcon:g||x.exports.createElement(SUe,null),showAdd:h!==!0});const z=A(),K=Ob(u),j=qUe(m,v),G=UUe(N,_),X=Object.assign(Object.assign({},R==null?void 0:R.style),y),de={align:(e=L==null?void 0:L.align)!==null&&e!==void 0?e:(t=R==null?void 0:R.indicator)===null||t===void 0?void 0:t.align,size:(s=(o=(n=L==null?void 0:L.size)!==null&&n!==void 0?n:w)!==null&&o!==void 0?o:(r=R==null?void 0:R.indicator)===null||r===void 0?void 0:r.size)!==null&&s!==void 0?s:R==null?void 0:R.indicatorSize};return H(x.exports.createElement($Ue,Object.assign({direction:k,getPopupContainer:P,moreTransitionName:`${z}-slide-up`},D,{items:j,className:Ue({[`${N}-${K}`]:K,[`${N}-card`]:["card","editable-card"].includes(a),[`${N}-editable-card`]:a==="editable-card",[`${N}-centered`]:f},R==null?void 0:R.className,l,c,B,F,M),popupClassName:Ue(p,B,F,M),style:X,editable:$,moreIcon:I,prefixCls:N,animated:G,indicator:de})))};Sve.TabPane=sje;var lje=Sve;function Sc(i,e){return i[e]}var cje=["children"];function xve(i,e){return"".concat(i,"-").concat(e)}function uje(i){return i&&i.type&&i.type.isTreeNode}function AI(i,e){return i!=null?i:e}function aw(i){var e=i||{},t=e.title,n=e._title,o=e.key,r=e.children,s=t||"title";return{title:s,_title:n||[s],key:o||"key",children:r||"children"}}function Lve(i){function e(t){var n=ip(t);return n.map(function(o){if(!uje(o))return rr(!o,"Tree/TreeNode can only accept TreeNode as children."),null;var r=o.key,s=o.props,a=s.children,l=Hn(s,cje),c=Ce({key:r},l),u=e(a);return u.length&&(c.children=u),c}).filter(function(o){return o})}return e(i)}function v6(i,e,t){var n=aw(t),o=n._title,r=n.key,s=n.children,a=new Set(e===!0?[]:e),l=[];function c(u){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return u.map(function(h,f){for(var g=xve(d?d.pos:"0",f),p=AI(h[r],g),v,m=0;m1&&arguments[1]!==void 0?arguments[1]:{},t=e.initWrapper,n=e.processEntity,o=e.onProcessFinished,r=e.externalGetKey,s=e.childrenPropName,a=e.fieldNames,l=arguments.length>2?arguments[2]:void 0,c=r||l,u={},d={},h={posEntities:u,keyEntities:d};return t&&(h=t(h)||h),dje(i,function(f){var g=f.node,p=f.index,v=f.pos,m=f.key,_=f.parentPos,y=f.level,w=f.nodes,L={node:g,nodes:w,index:p,key:m,pos:v,level:y},D=AI(m,v);u[v]=L,d[D]=L,L.parent=u[_],L.parent&&(L.parent.children=L.parent.children||[],L.parent.children.push(L)),n&&n(L,h)},{externalGetKey:c,childrenPropName:s,fieldNames:a}),o&&o(h),h}function rE(i,e){var t=e.expandedKeys,n=e.selectedKeys,o=e.loadedKeys,r=e.loadingKeys,s=e.checkedKeys,a=e.halfCheckedKeys,l=e.dragOverNodeKey,c=e.dropPosition,u=e.keyEntities,d=Sc(u,i),h={eventKey:i,expanded:t.indexOf(i)!==-1,selected:n.indexOf(i)!==-1,loaded:o.indexOf(i)!==-1,loading:r.indexOf(i)!==-1,checked:s.indexOf(i)!==-1,halfChecked:a.indexOf(i)!==-1,pos:String(d?d.pos:""),dragOver:l===i&&c===0,dragOverGapTop:l===i&&c===-1,dragOverGapBottom:l===i&&c===1};return h}function Zr(i){var e=i.data,t=i.expanded,n=i.selected,o=i.checked,r=i.loaded,s=i.loading,a=i.halfChecked,l=i.dragOver,c=i.dragOverGapTop,u=i.dragOverGapBottom,d=i.pos,h=i.active,f=i.eventKey,g=Ce(Ce({},e),{},{expanded:t,selected:n,checked:o,loaded:r,loading:s,halfChecked:a,dragOver:l,dragOverGapTop:c,dragOverGapBottom:u,pos:d,active:h,key:f});return"props"in g||Object.defineProperty(g,"props",{get:function(){return rr(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),i}}),g}function Dve(i,e){var t=new Set;return i.forEach(function(n){e.has(n)||t.add(n)}),t}function hje(i){var e=i||{},t=e.disabled,n=e.disableCheckbox,o=e.checkable;return!!(t||n)||o===!1}function fje(i,e,t,n){for(var o=new Set(i),r=new Set,s=0;s<=t;s+=1){var a=e.get(s)||new Set;a.forEach(function(d){var h=d.key,f=d.node,g=d.children,p=g===void 0?[]:g;o.has(h)&&!n(f)&&p.filter(function(v){return!n(v.node)}).forEach(function(v){o.add(v.key)})})}for(var l=new Set,c=t;c>=0;c-=1){var u=e.get(c)||new Set;u.forEach(function(d){var h=d.parent,f=d.node;if(!(n(f)||!d.parent||l.has(d.parent.key))){if(n(d.parent.node)){l.add(h.key);return}var g=!0,p=!1;(h.children||[]).filter(function(v){return!n(v.node)}).forEach(function(v){var m=v.key,_=o.has(m);g&&!_&&(g=!1),!p&&(_||r.has(m))&&(p=!0)}),g&&o.add(h.key),p&&r.add(h.key),l.add(h.key)}})}return{checkedKeys:Array.from(o),halfCheckedKeys:Array.from(Dve(r,o))}}function gje(i,e,t,n,o){for(var r=new Set(i),s=new Set(e),a=0;a<=n;a+=1){var l=t.get(a)||new Set;l.forEach(function(h){var f=h.key,g=h.node,p=h.children,v=p===void 0?[]:p;!r.has(f)&&!s.has(f)&&!o(g)&&v.filter(function(m){return!o(m.node)}).forEach(function(m){r.delete(m.key)})})}s=new Set;for(var c=new Set,u=n;u>=0;u-=1){var d=t.get(u)||new Set;d.forEach(function(h){var f=h.parent,g=h.node;if(!(o(g)||!h.parent||c.has(h.parent.key))){if(o(h.parent.node)){c.add(f.key);return}var p=!0,v=!1;(f.children||[]).filter(function(m){return!o(m.node)}).forEach(function(m){var _=m.key,y=r.has(_);p&&!y&&(p=!1),!v&&(y||s.has(_))&&(v=!0)}),p||r.delete(f.key),v&&s.add(f.key),c.add(f.key)}})}return{checkedKeys:Array.from(r),halfCheckedKeys:Array.from(Dve(s,r))}}function _6(i,e,t,n){var o=[],r;n?r=n:r=hje;var s=new Set(i.filter(function(u){var d=!!Sc(t,u);return d||o.push(u),d})),a=new Map,l=0;Object.keys(t).forEach(function(u){var d=t[u],h=d.level,f=a.get(h);f||(f=new Set,a.set(h,f)),f.add(d),l=Math.max(l,h)}),rr(!o.length,"Tree missing follow keys: ".concat(o.slice(0,100).map(function(u){return"'".concat(u,"'")}).join(", ")));var c;return e===!0?c=fje(s,a,l,r):c=gje(s,e.halfCheckedKeys,a,l,r),c}const pje=i=>{const{checkboxCls:e}=i,t=`${e}-wrapper`;return[{[`${e}-group`]:Object.assign(Object.assign({},Pa(i)),{display:"inline-flex",flexWrap:"wrap",columnGap:i.marginXS,[`> ${i.antCls}-row`]:{flex:1}}),[t]:Object.assign(Object.assign({},Pa(i)),{display:"inline-flex",alignItems:"baseline",cursor:"pointer","&:after":{display:"inline-block",width:0,overflow:"hidden",content:"'\\a0'"},[`& + ${t}`]:{marginInlineStart:0},[`&${t}-in-form-item`]:{'input[type="checkbox"]':{width:14,height:14}}}),[e]:Object.assign(Object.assign({},Pa(i)),{position:"relative",whiteSpace:"nowrap",lineHeight:1,cursor:"pointer",borderRadius:i.borderRadiusSM,alignSelf:"center",[`${e}-input`]:{position:"absolute",inset:0,zIndex:1,cursor:"pointer",opacity:0,margin:0,[`&:focus-visible + ${e}-inner`]:Object.assign({},PK(i))},[`${e}-inner`]:{boxSizing:"border-box",display:"block",width:i.checkboxSize,height:i.checkboxSize,direction:"ltr",backgroundColor:i.colorBgContainer,border:`${rt(i.lineWidth)} ${i.lineType} ${i.colorBorder}`,borderRadius:i.borderRadiusSM,borderCollapse:"separate",transition:`all ${i.motionDurationSlow}`,"&:after":{boxSizing:"border-box",position:"absolute",top:"50%",insetInlineStart:"25%",display:"table",width:i.calc(i.checkboxSize).div(14).mul(5).equal(),height:i.calc(i.checkboxSize).div(14).mul(8).equal(),border:`${rt(i.lineWidthBold)} solid ${i.colorWhite}`,borderTop:0,borderInlineStart:0,transform:"rotate(45deg) scale(0) translate(-50%,-50%)",opacity:0,content:'""',transition:`all ${i.motionDurationFast} ${i.motionEaseInBack}, opacity ${i.motionDurationFast}`}},"& + span":{paddingInlineStart:i.paddingXS,paddingInlineEnd:i.paddingXS}})},{[` ${t}:not(${t}-disabled), ${e}:not(${e}-disabled) `]:{[`&:hover ${e}-inner`]:{borderColor:i.colorPrimary}},[`${t}:not(${t}-disabled)`]:{[`&:hover ${e}-checked:not(${e}-disabled) ${e}-inner`]:{backgroundColor:i.colorPrimaryHover,borderColor:"transparent"},[`&:hover ${e}-checked:not(${e}-disabled):after`]:{borderColor:i.colorPrimaryHover}}},{[`${e}-checked`]:{[`${e}-inner`]:{backgroundColor:i.colorPrimary,borderColor:i.colorPrimary,"&:after":{opacity:1,transform:"rotate(45deg) scale(1) translate(-50%,-50%)",transition:`all ${i.motionDurationMid} ${i.motionEaseOutBack} ${i.motionDurationFast}`}}},[` ${t}-checked:not(${t}-disabled), ${e}-checked:not(${e}-disabled) - `]:{[`&:hover ${e}-inner`]:{backgroundColor:i.colorPrimaryHover,borderColor:"transparent"}}},{[e]:{"&-indeterminate":{[`${e}-inner`]:{backgroundColor:i.colorBgContainer,borderColor:i.colorBorder,"&:after":{top:"50%",insetInlineStart:"50%",width:i.calc(i.fontSizeLG).div(2).equal(),height:i.calc(i.fontSizeLG).div(2).equal(),backgroundColor:i.colorPrimary,border:0,transform:"translate(-50%, -50%) scale(1)",opacity:1,content:'""'}}}}},{[`${t}-disabled`]:{cursor:"not-allowed"},[`${e}-disabled`]:{[`&, ${e}-input`]:{cursor:"not-allowed",pointerEvents:"none"},[`${e}-inner`]:{background:i.colorBgContainerDisabled,borderColor:i.colorBorder,"&:after":{borderColor:i.colorTextDisabled}},"&:after":{display:"none"},"& + span":{color:i.colorTextDisabled},[`&${e}-indeterminate ${e}-inner::after`]:{background:i.colorTextDisabled}}}]};function wve(i,e){const t=lr(e,{checkboxCls:`.${i}`,checkboxSize:e.controlInteractiveSize});return[aje(t)]}Uc("Checkbox",(i,e)=>{let{prefixCls:t}=e;return[wve(t,i)]});const lje=x.exports.createContext({});var yve=lje;const cje=i=>{const{componentCls:e}=i;return{[e]:{display:"flex",flexFlow:"row wrap",minWidth:0,"&::before, &::after":{display:"flex"},"&-no-wrap":{flexWrap:"nowrap"},"&-start":{justifyContent:"flex-start"},"&-center":{justifyContent:"center"},"&-end":{justifyContent:"flex-end"},"&-space-between":{justifyContent:"space-between"},"&-space-around":{justifyContent:"space-around"},"&-space-evenly":{justifyContent:"space-evenly"},"&-top":{alignItems:"flex-start"},"&-middle":{alignItems:"center"},"&-bottom":{alignItems:"flex-end"}}}},uje=i=>{const{componentCls:e}=i;return{[e]:{position:"relative",maxWidth:"100%",minHeight:1}}},dje=(i,e)=>{const{componentCls:t,gridColumns:n}=i,o={};for(let r=n;r>=0;r--)r===0?(o[`${t}${e}-${r}`]={display:"none"},o[`${t}-push-${r}`]={insetInlineStart:"auto"},o[`${t}-pull-${r}`]={insetInlineEnd:"auto"},o[`${t}${e}-push-${r}`]={insetInlineStart:"auto"},o[`${t}${e}-pull-${r}`]={insetInlineEnd:"auto"},o[`${t}${e}-offset-${r}`]={marginInlineStart:0},o[`${t}${e}-order-${r}`]={order:0}):(o[`${t}${e}-${r}`]=[{["--ant-display"]:"block",display:"block"},{display:"var(--ant-display)",flex:`0 0 ${r/n*100}%`,maxWidth:`${r/n*100}%`}],o[`${t}${e}-push-${r}`]={insetInlineStart:`${r/n*100}%`},o[`${t}${e}-pull-${r}`]={insetInlineEnd:`${r/n*100}%`},o[`${t}${e}-offset-${r}`]={marginInlineStart:`${r/n*100}%`},o[`${t}${e}-order-${r}`]={order:r});return o},FW=(i,e)=>dje(i,e),hje=(i,e,t)=>({[`@media (min-width: ${rt(e)})`]:Object.assign({},FW(i,t))}),fje=()=>({}),gje=()=>({}),pje=Uc("Grid",cje,fje),mje=Uc("Grid",i=>{const e=lr(i,{gridColumns:24}),t={"-sm":e.screenSMMin,"-md":e.screenMDMin,"-lg":e.screenLGMin,"-xl":e.screenXLMin,"-xxl":e.screenXXLMin};return[uje(e),FW(e,""),FW(e,"-xs"),Object.keys(t).map(n=>hje(e,t[n],n)).reduce((n,o)=>Object.assign(Object.assign({},n),o),{})]},gje);var vje=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(i);o{const{getPrefixCls:t,direction:n}=x.exports.useContext(Hi),{gutter:o,wrap:r}=x.exports.useContext(yve),{prefixCls:s,span:a,order:l,offset:c,push:u,pull:d,className:h,children:f,flex:g,style:p}=i,v=vje(i,["prefixCls","span","order","offset","push","pull","className","children","flex","style"]),m=t("col",s),[_,w,y]=mje(m);let L={};bje.forEach(I=>{let k={};const R=i[I];typeof R=="number"?k.span=R:typeof R=="object"&&(k=R||{}),delete v[I],L=Object.assign(Object.assign({},L),{[`${m}-${I}-${k.span}`]:k.span!==void 0,[`${m}-${I}-order-${k.order}`]:k.order||k.order===0,[`${m}-${I}-offset-${k.offset}`]:k.offset||k.offset===0,[`${m}-${I}-push-${k.push}`]:k.push||k.push===0,[`${m}-${I}-pull-${k.pull}`]:k.pull||k.pull===0,[`${m}-${I}-flex-${k.flex}`]:k.flex||k.flex==="auto",[`${m}-rtl`]:n==="rtl"})});const D=Ue(m,{[`${m}-${a}`]:a!==void 0,[`${m}-order-${l}`]:l,[`${m}-offset-${c}`]:c,[`${m}-push-${u}`]:u,[`${m}-pull-${d}`]:d},h,L,w,y),E={};if(o&&o[0]>0){const I=o[0]/2;E.paddingLeft=I,E.paddingRight=I}return g&&(E.flex=_je(g),r===!1&&!E.minWidth&&(E.minWidth=0)),_(x.exports.createElement("div",Object.assign({},v,{style:Object.assign(Object.assign({},E),p),className:D,ref:e}),f))});var Sve=Cje,wje=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(i);o{if(typeof i=="string"&&n(i),typeof i=="object")for(let r=0;r{o()},[JSON.stringify(i),e]),t}const yje=x.exports.forwardRef((i,e)=>{const{prefixCls:t,justify:n,align:o,className:r,style:s,children:a,gutter:l=0,wrap:c}=i,u=wje(i,["prefixCls","justify","align","className","style","children","gutter","wrap"]),{getPrefixCls:d,direction:h}=x.exports.useContext(Hi),[f,g]=x.exports.useState({xs:!0,sm:!0,md:!0,lg:!0,xl:!0,xxl:!0}),[p,v]=x.exports.useState({xs:!1,sm:!1,md:!1,lg:!1,xl:!1,xxl:!1}),m=Sie(o,p),_=Sie(n,p),w=x.exports.useRef(l),y=A$e();x.exports.useEffect(()=>{const F=y.subscribe($=>{v($);const z=w.current||0;(!Array.isArray(z)&&typeof z=="object"||Array.isArray(z)&&(typeof z[0]=="object"||typeof z[1]=="object"))&&g($)});return()=>y.unsubscribe(F)},[]);const L=()=>{const F=[void 0,void 0];return(Array.isArray(l)?l:[l,void 0]).forEach((z,K)=>{if(typeof z=="object")for(let j=0;j0?R[0]/-2:void 0;N&&(P.marginLeft=N,P.marginRight=N),[,P.rowGap]=R;const[M,H]=R,W=x.exports.useMemo(()=>({gutter:[M,H],wrap:c}),[M,H,c]);return E(x.exports.createElement(yve.Provider,{value:W},x.exports.createElement("div",Object.assign({},u,{className:A,style:Object.assign(Object.assign({},P),s),ref:e}),a)))});var Sje=yje;function xje(i){return!!(i.addonBefore||i.addonAfter)}function Lje(i){return!!(i.prefix||i.suffix||i.allowClear)}function DA(i,e,t,n){if(!!t){var o=e;if(e.type==="click"){var r=i.cloneNode(!0);o=Object.create(e,{target:{value:r},currentTarget:{value:r}}),r.value="",t(o);return}if(i.type!=="file"&&n!==void 0){var s=i.cloneNode(!0);o=Object.create(e,{target:{value:s},currentTarget:{value:s}}),s.value=n,t(o);return}t(o)}}function Eje(i,e){if(!!i){i.focus(e);var t=e||{},n=t.cursor;if(n){var o=i.value.length;switch(n){case"start":i.setSelectionRange(0,0);break;case"end":i.setSelectionRange(o,o);break;default:i.setSelectionRange(0,o)}}}}var xve=function(e){var t,n,o=e.inputElement,r=e.children,s=e.prefixCls,a=e.prefix,l=e.suffix,c=e.addonBefore,u=e.addonAfter,d=e.className,h=e.style,f=e.disabled,g=e.readOnly,p=e.focused,v=e.triggerFocus,m=e.allowClear,_=e.value,w=e.handleReset,y=e.hidden,L=e.classes,D=e.classNames,E=e.dataAttrs,I=e.styles,k=e.components,R=r!=null?r:o,A=(k==null?void 0:k.affixWrapper)||"span",P=(k==null?void 0:k.groupWrapper)||"span",N=(k==null?void 0:k.wrapper)||"span",M=(k==null?void 0:k.groupAddon)||"span",H=x.exports.useRef(null),W=function(xe){var Ee;(Ee=H.current)!==null&&Ee!==void 0&&Ee.contains(xe.target)&&(v==null||v())},F=Lje(e),$=x.exports.cloneElement(R,{value:_,className:Ue(R.props.className,!F&&(D==null?void 0:D.variant))||null});if(F){var z,K=null;if(m){var j,G=!f&&!g&&_,X="".concat(s,"-clear-icon"),de=Kn(m)==="object"&&m!==null&&m!==void 0&&m.clearIcon?m.clearIcon:"\u2716";K=fe("span",{onClick:w,onMouseDown:function(xe){return xe.preventDefault()},className:Ue(X,(j={},me(j,"".concat(X,"-hidden"),!G),me(j,"".concat(X,"-has-suffix"),!!l),j)),role:"button",tabIndex:-1,children:de})}var he="".concat(s,"-affix-wrapper"),pe=Ue(he,(z={},me(z,"".concat(s,"-disabled"),f),me(z,"".concat(he,"-disabled"),f),me(z,"".concat(he,"-focused"),p),me(z,"".concat(he,"-readonly"),g),me(z,"".concat(he,"-input-with-clear-btn"),l&&m&&_),z),L==null?void 0:L.affixWrapper,D==null?void 0:D.affixWrapper,D==null?void 0:D.variant),be=(l||m)&&vn("span",{className:Ue("".concat(s,"-suffix"),D==null?void 0:D.suffix),style:I==null?void 0:I.suffix,children:[K,l]});$=vn(A,{className:pe,style:I==null?void 0:I.affixWrapper,onClick:W,...E==null?void 0:E.affixWrapper,ref:H,children:[a&&fe("span",{className:Ue("".concat(s,"-prefix"),D==null?void 0:D.prefix),style:I==null?void 0:I.prefix,children:a}),$,be]})}if(xje(e)){var Se="".concat(s,"-group"),Fe="".concat(Se,"-addon"),De="".concat(Se,"-wrapper"),ce=Ue("".concat(s,"-wrapper"),Se,L==null?void 0:L.wrapper,D==null?void 0:D.wrapper),Pe=Ue(De,me({},"".concat(De,"-disabled"),f),L==null?void 0:L.group,D==null?void 0:D.groupWrapper);$=fe(P,{className:Pe,children:vn(N,{className:ce,children:[c&&fe(M,{className:Fe,children:c}),$,u&&fe(M,{className:Fe,children:u})]})})}return Bt.cloneElement($,{className:Ue((t=$.props)===null||t===void 0?void 0:t.className,d)||null,style:Ce(Ce({},(n=$.props)===null||n===void 0?void 0:n.style),h),hidden:y})},Dje=["show"];function Lve(i,e){return x.exports.useMemo(function(){var t={};e&&(t.show=Kn(e)==="object"&&e.formatter?e.formatter:!!e),t=Ce(Ce({},t),i);var n=t,o=n.show,r=Hn(n,Dje);return Ce(Ce({},r),{},{show:!!o,showFormatter:typeof o=="function"?o:void 0,strategy:r.strategy||function(s){return s.length}})},[i,e])}var kje=["autoComplete","onChange","onFocus","onBlur","onPressEnter","onKeyDown","prefixCls","disabled","htmlSize","className","maxLength","suffix","showCount","count","type","classes","classNames","styles","onCompositionStart","onCompositionEnd"],Ije=x.exports.forwardRef(function(i,e){var t=i.autoComplete,n=i.onChange,o=i.onFocus,r=i.onBlur,s=i.onPressEnter,a=i.onKeyDown,l=i.prefixCls,c=l===void 0?"rc-input":l,u=i.disabled,d=i.htmlSize,h=i.className,f=i.maxLength,g=i.suffix,p=i.showCount,v=i.count,m=i.type,_=m===void 0?"text":m,w=i.classes,y=i.classNames,L=i.styles,D=i.onCompositionStart,E=i.onCompositionEnd,I=Hn(i,kje),k=x.exports.useState(!1),R=Ne(k,2),A=R[0],P=R[1],N=x.exports.useRef(!1),M=x.exports.useRef(null),H=function(re){M.current&&Eje(M.current,re)},W=jl(i.defaultValue,{value:i.value}),F=Ne(W,2),$=F[0],z=F[1],K=$==null?"":String($),j=x.exports.useState(null),G=Ne(j,2),X=G[0],de=G[1],he=Lve(v,p),pe=he.max||f,be=he.strategy(K),Se=!!pe&&be>pe;x.exports.useImperativeHandle(e,function(){return{focus:H,blur:function(){var re;(re=M.current)===null||re===void 0||re.blur()},setSelectionRange:function(re,ie,se){var U;(U=M.current)===null||U===void 0||U.setSelectionRange(re,ie,se)},select:function(){var re;(re=M.current)===null||re===void 0||re.select()},input:M.current}}),x.exports.useEffect(function(){P(function(Ge){return Ge&&u?!1:Ge})},[u]);var Fe=function(re,ie,se){var U=ie;if(!N.current&&he.exceedFormatter&&he.max&&he.strategy(ie)>he.max){if(U=he.exceedFormatter(ie,{max:he.max}),ie!==U){var Y,oe;de([((Y=M.current)===null||Y===void 0?void 0:Y.selectionStart)||0,((oe=M.current)===null||oe===void 0?void 0:oe.selectionEnd)||0])}}else if(se.source==="compositionEnd")return;z(U),M.current&&DA(M.current,re,n,U)};x.exports.useEffect(function(){if(X){var Ge;(Ge=M.current)===null||Ge===void 0||Ge.setSelectionRange.apply(Ge,_t(X))}},[X]);var De=function(re){Fe(re,re.target.value,{source:"change"})},ce=function(re){N.current=!1,Fe(re,re.currentTarget.value,{source:"compositionEnd"}),E==null||E(re)},Pe=function(re){s&&re.key==="Enter"&&s(re),a==null||a(re)},Oe=function(re){P(!0),o==null||o(re)},xe=function(re){P(!1),r==null||r(re)},Ee=function(re){z(""),H(),M.current&&DA(M.current,re,n)},tt=Se&&"".concat(c,"-out-of-range"),nt=function(){var re=Df(i,["prefixCls","onPressEnter","addonBefore","addonAfter","prefix","suffix","allowClear","defaultValue","showCount","count","classes","htmlSize","styles","classNames"]);return fe("input",{autoComplete:t,...re,onChange:De,onFocus:Oe,onBlur:xe,onKeyDown:Pe,className:Ue(c,me({},"".concat(c,"-disabled"),u),y==null?void 0:y.input),style:L==null?void 0:L.input,ref:M,size:d,type:_,onCompositionStart:function(se){N.current=!0,D==null||D(se)},onCompositionEnd:ce})},Qe=function(){var re=Number(pe)>0;if(g||he.show){var ie=he.showFormatter?he.showFormatter({value:K,count:be,maxLength:pe}):"".concat(be).concat(re?" / ".concat(pe):"");return vn(Ds,{children:[he.show&&fe("span",{className:Ue("".concat(c,"-show-count-suffix"),me({},"".concat(c,"-show-count-has-suffix"),!!g),y==null?void 0:y.count),style:Ce({},L==null?void 0:L.count),children:ie}),g]})}return null};return fe(xve,{...I,prefixCls:c,className:Ue(h,tt),handleReset:Ee,value:K,focused:A,triggerFocus:H,suffix:Qe(),disabled:u,classes:w,classNames:y,styles:L,children:nt()})});const Tje=i=>{const{getPrefixCls:e,direction:t}=x.exports.useContext(Hi),{prefixCls:n,className:o}=i,r=e("input-group",n),s=e("input"),[a,l]=mq(s),c=Ue(r,{[`${r}-lg`]:i.size==="large",[`${r}-sm`]:i.size==="small",[`${r}-compact`]:i.compact,[`${r}-rtl`]:t==="rtl"},l,o),u=x.exports.useContext(zd),d=x.exports.useMemo(()=>Object.assign(Object.assign({},u),{isFormItemInput:!1}),[u]);return a(x.exports.createElement("span",{className:c,style:i.style,onMouseEnter:i.onMouseEnter,onMouseLeave:i.onMouseLeave,onFocus:i.onFocus,onBlur:i.onBlur},x.exports.createElement(zd.Provider,{value:d},i.children)))};var Nje=Tje;function Eve(i,e){const t=x.exports.useRef([]),n=()=>{t.current.push(setTimeout(()=>{var o,r,s,a;((o=i.current)===null||o===void 0?void 0:o.input)&&((r=i.current)===null||r===void 0?void 0:r.input.getAttribute("type"))==="password"&&((s=i.current)===null||s===void 0?void 0:s.input.hasAttribute("value"))&&((a=i.current)===null||a===void 0||a.input.removeAttribute("value"))}))};return x.exports.useEffect(()=>(e&&n(),()=>t.current.forEach(o=>{o&&clearTimeout(o)})),[]),n}function Rje(i){return!!(i.prefix||i.suffix||i.allowClear||i.showCount)}const Mje=i=>{let e;return typeof i=="object"&&(i==null?void 0:i.clearIcon)?e=i:i&&(e={clearIcon:Bt.createElement(lS,null)}),e};var Aje=Mje,Pje=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(i);o{var t;const{prefixCls:n,bordered:o=!0,status:r,size:s,disabled:a,onBlur:l,onFocus:c,suffix:u,allowClear:d,addonAfter:h,addonBefore:f,className:g,style:p,styles:v,rootClassName:m,onChange:_,classNames:w,variant:y}=i,L=Pje(i,["prefixCls","bordered","status","size","disabled","onBlur","onFocus","suffix","allowClear","addonAfter","addonBefore","className","style","styles","rootClassName","onChange","classNames","variant"]),{getPrefixCls:D,direction:E,input:I}=Bt.useContext(Hi),k=D("input",n),R=x.exports.useRef(null),A=th(k),[P,N,M]=mq(k,A),{compactSize:H,compactItemClassnames:W}=k4(k,E),F=Pb(Oe=>{var xe;return(xe=s!=null?s:H)!==null&&xe!==void 0?xe:Oe}),$=Bt.useContext(aS),z=a!=null?a:$,{status:K,hasFeedback:j,feedbackIcon:G}=x.exports.useContext(zd),X=sq(K,r),de=Rje(i)||!!j;x.exports.useRef(de);const he=Eve(R,!0),pe=Oe=>{he(),l==null||l(Oe)},be=Oe=>{he(),c==null||c(Oe)},Se=Oe=>{he(),_==null||_(Oe)},Fe=(j||u)&&vn(Ds,{children:[u,j&&G]}),De=Aje(d),[ce,Pe]=lq(y,o);return P(fe(Ije,{...Object.assign({ref:Jd(e,R),prefixCls:k,autoComplete:I==null?void 0:I.autoComplete},L,{disabled:z,onBlur:pe,onFocus:be,style:Object.assign(Object.assign({},I==null?void 0:I.style),p),styles:Object.assign(Object.assign({},I==null?void 0:I.styles),v),suffix:Fe,allowClear:De,className:Ue(g,m,M,A,W,I==null?void 0:I.className),onChange:Se,addonAfter:h&&fe(wA,{children:fe(EW,{override:!0,status:!0,children:h})}),addonBefore:f&&fe(wA,{children:fe(EW,{override:!0,status:!0,children:f})}),classNames:Object.assign(Object.assign(Object.assign({},w),I==null?void 0:I.classNames),{input:Ue({[`${k}-sm`]:F==="small",[`${k}-lg`]:F==="large",[`${k}-rtl`]:E==="rtl"},w==null?void 0:w.input,(t=I==null?void 0:I.classNames)===null||t===void 0?void 0:t.input,N),variant:Ue({[`${k}-${ce}`]:Pe},LA(k,X)),affixWrapper:Ue({[`${k}-affix-wrapper-sm`]:F==="small",[`${k}-affix-wrapper-lg`]:F==="large",[`${k}-affix-wrapper-rtl`]:E==="rtl"},N),wrapper:Ue({[`${k}-group-rtl`]:E==="rtl"},N),groupWrapper:Ue({[`${k}-group-wrapper-sm`]:F==="small",[`${k}-group-wrapper-lg`]:F==="large",[`${k}-group-wrapper-rtl`]:E==="rtl",[`${k}-group-wrapper-${ce}`]:Pe},LA(`${k}-group-wrapper`,X,j),N)})})}))});var vq=Fje,Bje={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M942.2 486.2Q889.47 375.11 816.7 305l-50.88 50.88C807.31 395.53 843.45 447.4 874.7 512 791.5 684.2 673.4 766 512 766q-72.67 0-133.87-22.38L323 798.75Q408 838 512 838q288.3 0 430.2-300.3a60.29 60.29 0 000-51.5zm-63.57-320.64L836 122.88a8 8 0 00-11.32 0L715.31 232.2Q624.86 186 512 186q-288.3 0-430.2 300.3a60.3 60.3 0 000 51.5q56.69 119.4 136.5 191.41L112.48 835a8 8 0 000 11.31L155.17 889a8 8 0 0011.31 0l712.15-712.12a8 8 0 000-11.32zM149.3 512C232.6 339.8 350.7 258 512 258c54.54 0 104.13 9.36 149.12 28.39l-70.3 70.3a176 176 0 00-238.13 238.13l-83.42 83.42C223.1 637.49 183.3 582.28 149.3 512zm246.7 0a112.11 112.11 0 01146.2-106.69L401.31 546.2A112 112 0 01396 512z"}},{tag:"path",attrs:{d:"M508 624c-3.46 0-6.87-.16-10.25-.47l-52.82 52.82a176.09 176.09 0 00227.42-227.42l-52.82 52.82c.31 3.38.47 6.79.47 10.25a111.94 111.94 0 01-112 112z"}}]},name:"eye-invisible",theme:"outlined"},Wje=Bje,Vje=function(e,t){return x.exports.createElement(cr,Ct({},e,{ref:t,icon:Wje}))},Hje=x.exports.forwardRef(Vje),$je={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M942.2 486.2C847.4 286.5 704.1 186 512 186c-192.2 0-335.4 100.5-430.2 300.3a60.3 60.3 0 000 51.5C176.6 737.5 319.9 838 512 838c192.2 0 335.4-100.5 430.2-300.3 7.7-16.2 7.7-35 0-51.5zM512 766c-161.3 0-279.4-81.8-362.7-254C232.6 339.8 350.7 258 512 258c161.3 0 279.4 81.8 362.7 254C791.5 684.2 673.4 766 512 766zm-4-430c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm0 288c-61.9 0-112-50.1-112-112s50.1-112 112-112 112 50.1 112 112-50.1 112-112 112z"}}]},name:"eye",theme:"outlined"},zje=$je,Uje=function(e,t){return x.exports.createElement(cr,Ct({},e,{ref:t,icon:zje}))},jje=x.exports.forwardRef(Uje),Kje=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(i);oi?x.exports.createElement(jje,null):x.exports.createElement(Hje,null),Gje={click:"onClick",hover:"onMouseOver"},Xje=x.exports.forwardRef((i,e)=>{const{visibilityToggle:t=!0}=i,n=typeof t=="object"&&t.visible!==void 0,[o,r]=x.exports.useState(()=>n?t.visible:!1),s=x.exports.useRef(null);x.exports.useEffect(()=>{n&&r(t.visible)},[n,t]);const a=Eve(s),l=()=>{const{disabled:L}=i;L||(o&&a(),r(D=>{var E;const I=!D;return typeof t=="object"&&((E=t.onVisibleChange)===null||E===void 0||E.call(t,I)),I}))},c=L=>{const{action:D="click",iconRender:E=qje}=i,I=Gje[D]||"",k=E(o),R={[I]:l,className:`${L}-icon`,key:"passwordIcon",onMouseDown:A=>{A.preventDefault()},onMouseUp:A=>{A.preventDefault()}};return x.exports.cloneElement(x.exports.isValidElement(k)?k:x.exports.createElement("span",null,k),R)},{className:u,prefixCls:d,inputPrefixCls:h,size:f}=i,g=Kje(i,["className","prefixCls","inputPrefixCls","size"]),{getPrefixCls:p}=x.exports.useContext(Hi),v=p("input",h),m=p("input-password",d),_=t&&c(m),w=Ue(m,u,{[`${m}-${f}`]:!!f}),y=Object.assign(Object.assign({},Df(g,["suffix","iconRender","visibilityToggle"])),{type:o?"text":"password",className:w,prefixCls:v,suffix:_});return f&&(y.size=f),x.exports.createElement(vq,Object.assign({ref:Jd(e,s)},y))});var Yje=Xje,Zje=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(i);o{const{prefixCls:t,inputPrefixCls:n,className:o,size:r,suffix:s,enterButton:a=!1,addonAfter:l,loading:c,disabled:u,onSearch:d,onChange:h,onCompositionStart:f,onCompositionEnd:g}=i,p=Zje(i,["prefixCls","inputPrefixCls","className","size","suffix","enterButton","addonAfter","loading","disabled","onSearch","onChange","onCompositionStart","onCompositionEnd"]),{getPrefixCls:v,direction:m}=x.exports.useContext(Hi),_=x.exports.useRef(!1),w=v("input-search",t),y=v("input",n),{compactSize:L}=k4(w,m),D=Pb(K=>{var j;return(j=r!=null?r:L)!==null&&j!==void 0?j:K}),E=x.exports.useRef(null),I=K=>{K&&K.target&&K.type==="click"&&d&&d(K.target.value,K,{source:"clear"}),h&&h(K)},k=K=>{var j;document.activeElement===((j=E.current)===null||j===void 0?void 0:j.input)&&K.preventDefault()},R=K=>{var j,G;d&&d((G=(j=E.current)===null||j===void 0?void 0:j.input)===null||G===void 0?void 0:G.value,K,{source:"input"})},A=K=>{_.current||c||R(K)},P=typeof a=="boolean"?x.exports.createElement(Wme,null):null,N=`${w}-button`;let M;const H=a||{},W=H.type&&H.type.__ANT_BUTTON===!0;W||H.type==="button"?M=pv(H,Object.assign({onMouseDown:k,onClick:K=>{var j,G;(G=(j=H==null?void 0:H.props)===null||j===void 0?void 0:j.onClick)===null||G===void 0||G.call(j,K),R(K)},key:"enterButton"},W?{className:N,size:D}:{})):M=x.exports.createElement(Bs,{className:N,type:a?"primary":void 0,size:D,disabled:u,key:"enterButton",onMouseDown:k,onClick:R,loading:c,icon:P},a),l&&(M=[M,pv(l,{key:"addonAfter"})]);const F=Ue(w,{[`${w}-rtl`]:m==="rtl",[`${w}-${D}`]:!!D,[`${w}-with-button`]:!!a},o),$=K=>{_.current=!0,f==null||f(K)},z=K=>{_.current=!1,g==null||g(K)};return x.exports.createElement(vq,Object.assign({ref:Jd(E,e),onPressEnter:A},p,{size:D,onCompositionStart:$,onCompositionEnd:z,prefixCls:y,addonAfter:M,suffix:s,onChange:I,className:F,disabled:u}))});var Jje=Qje,eKe=` + `]:{[`&:hover ${e}-inner`]:{backgroundColor:i.colorPrimaryHover,borderColor:"transparent"}}},{[e]:{"&-indeterminate":{[`${e}-inner`]:{backgroundColor:i.colorBgContainer,borderColor:i.colorBorder,"&:after":{top:"50%",insetInlineStart:"50%",width:i.calc(i.fontSizeLG).div(2).equal(),height:i.calc(i.fontSizeLG).div(2).equal(),backgroundColor:i.colorPrimary,border:0,transform:"translate(-50%, -50%) scale(1)",opacity:1,content:'""'}}}}},{[`${t}-disabled`]:{cursor:"not-allowed"},[`${e}-disabled`]:{[`&, ${e}-input`]:{cursor:"not-allowed",pointerEvents:"none"},[`${e}-inner`]:{background:i.colorBgContainerDisabled,borderColor:i.colorBorder,"&:after":{borderColor:i.colorTextDisabled}},"&:after":{display:"none"},"& + span":{color:i.colorTextDisabled},[`&${e}-indeterminate ${e}-inner::after`]:{background:i.colorTextDisabled}}}]};function kve(i,e){const t=lr(e,{checkboxCls:`.${i}`,checkboxSize:e.controlInteractiveSize});return[pje(t)]}jc("Checkbox",(i,e)=>{let{prefixCls:t}=e;return[kve(t,i)]});const mje=x.exports.createContext({});var Ive=mje;const vje=i=>{const{componentCls:e}=i;return{[e]:{display:"flex",flexFlow:"row wrap",minWidth:0,"&::before, &::after":{display:"flex"},"&-no-wrap":{flexWrap:"nowrap"},"&-start":{justifyContent:"flex-start"},"&-center":{justifyContent:"center"},"&-end":{justifyContent:"flex-end"},"&-space-between":{justifyContent:"space-between"},"&-space-around":{justifyContent:"space-around"},"&-space-evenly":{justifyContent:"space-evenly"},"&-top":{alignItems:"flex-start"},"&-middle":{alignItems:"center"},"&-bottom":{alignItems:"flex-end"}}}},_je=i=>{const{componentCls:e}=i;return{[e]:{position:"relative",maxWidth:"100%",minHeight:1}}},bje=(i,e)=>{const{componentCls:t,gridColumns:n}=i,o={};for(let r=n;r>=0;r--)r===0?(o[`${t}${e}-${r}`]={display:"none"},o[`${t}-push-${r}`]={insetInlineStart:"auto"},o[`${t}-pull-${r}`]={insetInlineEnd:"auto"},o[`${t}${e}-push-${r}`]={insetInlineStart:"auto"},o[`${t}${e}-pull-${r}`]={insetInlineEnd:"auto"},o[`${t}${e}-offset-${r}`]={marginInlineStart:0},o[`${t}${e}-order-${r}`]={order:0}):(o[`${t}${e}-${r}`]=[{["--ant-display"]:"block",display:"block"},{display:"var(--ant-display)",flex:`0 0 ${r/n*100}%`,maxWidth:`${r/n*100}%`}],o[`${t}${e}-push-${r}`]={insetInlineStart:`${r/n*100}%`},o[`${t}${e}-pull-${r}`]={insetInlineEnd:`${r/n*100}%`},o[`${t}${e}-offset-${r}`]={marginInlineStart:`${r/n*100}%`},o[`${t}${e}-order-${r}`]={order:r});return o},VW=(i,e)=>bje(i,e),Cje=(i,e,t)=>({[`@media (min-width: ${rt(e)})`]:Object.assign({},VW(i,t))}),yje=()=>({}),wje=()=>({}),Sje=jc("Grid",vje,yje),xje=jc("Grid",i=>{const e=lr(i,{gridColumns:24}),t={"-sm":e.screenSMMin,"-md":e.screenMDMin,"-lg":e.screenLGMin,"-xl":e.screenXLMin,"-xxl":e.screenXXLMin};return[_je(e),VW(e,""),VW(e,"-xs"),Object.keys(t).map(n=>Cje(e,t[n],n)).reduce((n,o)=>Object.assign(Object.assign({},n),o),{})]},wje);var Lje=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(i);o{const{getPrefixCls:t,direction:n}=x.exports.useContext(Hi),{gutter:o,wrap:r}=x.exports.useContext(Ive),{prefixCls:s,span:a,order:l,offset:c,push:u,pull:d,className:h,children:f,flex:g,style:p}=i,v=Lje(i,["prefixCls","span","order","offset","push","pull","className","children","flex","style"]),m=t("col",s),[_,y,w]=xje(m);let L={};Dje.forEach(I=>{let k={};const R=i[I];typeof R=="number"?k.span=R:typeof R=="object"&&(k=R||{}),delete v[I],L=Object.assign(Object.assign({},L),{[`${m}-${I}-${k.span}`]:k.span!==void 0,[`${m}-${I}-order-${k.order}`]:k.order||k.order===0,[`${m}-${I}-offset-${k.offset}`]:k.offset||k.offset===0,[`${m}-${I}-push-${k.push}`]:k.push||k.push===0,[`${m}-${I}-pull-${k.pull}`]:k.pull||k.pull===0,[`${m}-${I}-flex-${k.flex}`]:k.flex||k.flex==="auto",[`${m}-rtl`]:n==="rtl"})});const D=Ue(m,{[`${m}-${a}`]:a!==void 0,[`${m}-order-${l}`]:l,[`${m}-offset-${c}`]:c,[`${m}-push-${u}`]:u,[`${m}-pull-${d}`]:d},h,L,y,w),E={};if(o&&o[0]>0){const I=o[0]/2;E.paddingLeft=I,E.paddingRight=I}return g&&(E.flex=Eje(g),r===!1&&!E.minWidth&&(E.minWidth=0)),_(x.exports.createElement("div",Object.assign({},v,{style:Object.assign(Object.assign({},E),p),className:D,ref:e}),f))});var Tve=kje,Ije=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(i);o{if(typeof i=="string"&&n(i),typeof i=="object")for(let r=0;r<_D.length;r++){const s=_D[r];if(!e[s])continue;const a=i[s];if(a!==void 0){n(a);return}}};return x.exports.useEffect(()=>{o()},[JSON.stringify(i),e]),t}const Tje=x.exports.forwardRef((i,e)=>{const{prefixCls:t,justify:n,align:o,className:r,style:s,children:a,gutter:l=0,wrap:c}=i,u=Ije(i,["prefixCls","justify","align","className","style","children","gutter","wrap"]),{getPrefixCls:d,direction:h}=x.exports.useContext(Hi),[f,g]=x.exports.useState({xs:!0,sm:!0,md:!0,lg:!0,xl:!0,xxl:!0}),[p,v]=x.exports.useState({xs:!1,sm:!1,md:!1,lg:!1,xl:!1,xxl:!1}),m=Nie(o,p),_=Nie(n,p),y=x.exports.useRef(l),w=$$e();x.exports.useEffect(()=>{const F=w.subscribe($=>{v($);const z=y.current||0;(!Array.isArray(z)&&typeof z=="object"||Array.isArray(z)&&(typeof z[0]=="object"||typeof z[1]=="object"))&&g($)});return()=>w.unsubscribe(F)},[]);const L=()=>{const F=[void 0,void 0];return(Array.isArray(l)?l:[l,void 0]).forEach((z,K)=>{if(typeof z=="object")for(let j=0;j<_D.length;j++){const G=_D[j];if(f[G]&&z[G]!==void 0){F[K]=z[G];break}}else F[K]=z}),F},D=d("row",t),[E,I,k]=Sje(D),R=L(),A=Ue(D,{[`${D}-no-wrap`]:c===!1,[`${D}-${_}`]:_,[`${D}-${m}`]:m,[`${D}-rtl`]:h==="rtl"},r,I,k),P={},N=R[0]!=null&&R[0]>0?R[0]/-2:void 0;N&&(P.marginLeft=N,P.marginRight=N),[,P.rowGap]=R;const[M,H]=R,B=x.exports.useMemo(()=>({gutter:[M,H],wrap:c}),[M,H,c]);return E(x.exports.createElement(Ive.Provider,{value:B},x.exports.createElement("div",Object.assign({},u,{className:A,style:Object.assign(Object.assign({},P),s),ref:e}),a)))});var Nje=Tje;function Rje(i){return!!(i.addonBefore||i.addonAfter)}function Mje(i){return!!(i.prefix||i.suffix||i.allowClear)}function TA(i,e,t,n){if(!!t){var o=e;if(e.type==="click"){var r=i.cloneNode(!0);o=Object.create(e,{target:{value:r},currentTarget:{value:r}}),r.value="",t(o);return}if(i.type!=="file"&&n!==void 0){var s=i.cloneNode(!0);o=Object.create(e,{target:{value:s},currentTarget:{value:s}}),s.value=n,t(o);return}t(o)}}function Aje(i,e){if(!!i){i.focus(e);var t=e||{},n=t.cursor;if(n){var o=i.value.length;switch(n){case"start":i.setSelectionRange(0,0);break;case"end":i.setSelectionRange(o,o);break;default:i.setSelectionRange(0,o)}}}}var Nve=function(e){var t,n,o=e.inputElement,r=e.children,s=e.prefixCls,a=e.prefix,l=e.suffix,c=e.addonBefore,u=e.addonAfter,d=e.className,h=e.style,f=e.disabled,g=e.readOnly,p=e.focused,v=e.triggerFocus,m=e.allowClear,_=e.value,y=e.handleReset,w=e.hidden,L=e.classes,D=e.classNames,E=e.dataAttrs,I=e.styles,k=e.components,R=r!=null?r:o,A=(k==null?void 0:k.affixWrapper)||"span",P=(k==null?void 0:k.groupWrapper)||"span",N=(k==null?void 0:k.wrapper)||"span",M=(k==null?void 0:k.groupAddon)||"span",H=x.exports.useRef(null),B=function(xe){var Ee;(Ee=H.current)!==null&&Ee!==void 0&&Ee.contains(xe.target)&&(v==null||v())},F=Mje(e),$=x.exports.cloneElement(R,{value:_,className:Ue(R.props.className,!F&&(D==null?void 0:D.variant))||null});if(F){var z,K=null;if(m){var j,G=!f&&!g&&_,X="".concat(s,"-clear-icon"),de=Kn(m)==="object"&&m!==null&&m!==void 0&&m.clearIcon?m.clearIcon:"\u2716";K=he("span",{onClick:y,onMouseDown:function(xe){return xe.preventDefault()},className:Ue(X,(j={},me(j,"".concat(X,"-hidden"),!G),me(j,"".concat(X,"-has-suffix"),!!l),j)),role:"button",tabIndex:-1,children:de})}var fe="".concat(s,"-affix-wrapper"),pe=Ue(fe,(z={},me(z,"".concat(s,"-disabled"),f),me(z,"".concat(fe,"-disabled"),f),me(z,"".concat(fe,"-focused"),p),me(z,"".concat(fe,"-readonly"),g),me(z,"".concat(fe,"-input-with-clear-btn"),l&&m&&_),z),L==null?void 0:L.affixWrapper,D==null?void 0:D.affixWrapper,D==null?void 0:D.variant),be=(l||m)&&fn("span",{className:Ue("".concat(s,"-suffix"),D==null?void 0:D.suffix),style:I==null?void 0:I.suffix,children:[K,l]});$=fn(A,{className:pe,style:I==null?void 0:I.affixWrapper,onClick:B,...E==null?void 0:E.affixWrapper,ref:H,children:[a&&he("span",{className:Ue("".concat(s,"-prefix"),D==null?void 0:D.prefix),style:I==null?void 0:I.prefix,children:a}),$,be]})}if(Rje(e)){var Se="".concat(s,"-group"),Fe="".concat(Se,"-addon"),De="".concat(Se,"-wrapper"),ce=Ue("".concat(s,"-wrapper"),Se,L==null?void 0:L.wrapper,D==null?void 0:D.wrapper),Pe=Ue(De,me({},"".concat(De,"-disabled"),f),L==null?void 0:L.group,D==null?void 0:D.groupWrapper);$=he(P,{className:Pe,children:fn(N,{className:ce,children:[c&&he(M,{className:Fe,children:c}),$,u&&he(M,{className:Fe,children:u})]})})}return Bt.cloneElement($,{className:Ue((t=$.props)===null||t===void 0?void 0:t.className,d)||null,style:Ce(Ce({},(n=$.props)===null||n===void 0?void 0:n.style),h),hidden:w})},Pje=["show"];function Rve(i,e){return x.exports.useMemo(function(){var t={};e&&(t.show=Kn(e)==="object"&&e.formatter?e.formatter:!!e),t=Ce(Ce({},t),i);var n=t,o=n.show,r=Hn(n,Pje);return Ce(Ce({},r),{},{show:!!o,showFormatter:typeof o=="function"?o:void 0,strategy:r.strategy||function(s){return s.length}})},[i,e])}var Oje=["autoComplete","onChange","onFocus","onBlur","onPressEnter","onKeyDown","prefixCls","disabled","htmlSize","className","maxLength","suffix","showCount","count","type","classes","classNames","styles","onCompositionStart","onCompositionEnd"],Fje=x.exports.forwardRef(function(i,e){var t=i.autoComplete,n=i.onChange,o=i.onFocus,r=i.onBlur,s=i.onPressEnter,a=i.onKeyDown,l=i.prefixCls,c=l===void 0?"rc-input":l,u=i.disabled,d=i.htmlSize,h=i.className,f=i.maxLength,g=i.suffix,p=i.showCount,v=i.count,m=i.type,_=m===void 0?"text":m,y=i.classes,w=i.classNames,L=i.styles,D=i.onCompositionStart,E=i.onCompositionEnd,I=Hn(i,Oje),k=x.exports.useState(!1),R=Ne(k,2),A=R[0],P=R[1],N=x.exports.useRef(!1),M=x.exports.useRef(null),H=function(re){M.current&&Aje(M.current,re)},B=Kl(i.defaultValue,{value:i.value}),F=Ne(B,2),$=F[0],z=F[1],K=$==null?"":String($),j=x.exports.useState(null),G=Ne(j,2),X=G[0],de=G[1],fe=Rve(v,p),pe=fe.max||f,be=fe.strategy(K),Se=!!pe&&be>pe;x.exports.useImperativeHandle(e,function(){return{focus:H,blur:function(){var re;(re=M.current)===null||re===void 0||re.blur()},setSelectionRange:function(re,ie,se){var U;(U=M.current)===null||U===void 0||U.setSelectionRange(re,ie,se)},select:function(){var re;(re=M.current)===null||re===void 0||re.select()},input:M.current}}),x.exports.useEffect(function(){P(function(Ge){return Ge&&u?!1:Ge})},[u]);var Fe=function(re,ie,se){var U=ie;if(!N.current&&fe.exceedFormatter&&fe.max&&fe.strategy(ie)>fe.max){if(U=fe.exceedFormatter(ie,{max:fe.max}),ie!==U){var Y,oe;de([((Y=M.current)===null||Y===void 0?void 0:Y.selectionStart)||0,((oe=M.current)===null||oe===void 0?void 0:oe.selectionEnd)||0])}}else if(se.source==="compositionEnd")return;z(U),M.current&&TA(M.current,re,n,U)};x.exports.useEffect(function(){if(X){var Ge;(Ge=M.current)===null||Ge===void 0||Ge.setSelectionRange.apply(Ge,_t(X))}},[X]);var De=function(re){Fe(re,re.target.value,{source:"change"})},ce=function(re){N.current=!1,Fe(re,re.currentTarget.value,{source:"compositionEnd"}),E==null||E(re)},Pe=function(re){s&&re.key==="Enter"&&s(re),a==null||a(re)},Oe=function(re){P(!0),o==null||o(re)},xe=function(re){P(!1),r==null||r(re)},Ee=function(re){z(""),H(),M.current&&TA(M.current,re,n)},tt=Se&&"".concat(c,"-out-of-range"),nt=function(){var re=kf(i,["prefixCls","onPressEnter","addonBefore","addonAfter","prefix","suffix","allowClear","defaultValue","showCount","count","classes","htmlSize","styles","classNames"]);return he("input",{autoComplete:t,...re,onChange:De,onFocus:Oe,onBlur:xe,onKeyDown:Pe,className:Ue(c,me({},"".concat(c,"-disabled"),u),w==null?void 0:w.input),style:L==null?void 0:L.input,ref:M,size:d,type:_,onCompositionStart:function(se){N.current=!0,D==null||D(se)},onCompositionEnd:ce})},Qe=function(){var re=Number(pe)>0;if(g||fe.show){var ie=fe.showFormatter?fe.showFormatter({value:K,count:be,maxLength:pe}):"".concat(be).concat(re?" / ".concat(pe):"");return fn(ks,{children:[fe.show&&he("span",{className:Ue("".concat(c,"-show-count-suffix"),me({},"".concat(c,"-show-count-has-suffix"),!!g),w==null?void 0:w.count),style:Ce({},L==null?void 0:L.count),children:ie}),g]})}return null};return he(Nve,{...I,prefixCls:c,className:Ue(h,tt),handleReset:Ee,value:K,focused:A,triggerFocus:H,suffix:Qe(),disabled:u,classes:y,classNames:w,styles:L,children:nt()})});const Bje=i=>{const{getPrefixCls:e,direction:t}=x.exports.useContext(Hi),{prefixCls:n,className:o}=i,r=e("input-group",n),s=e("input"),[a,l]=Cq(s),c=Ue(r,{[`${r}-lg`]:i.size==="large",[`${r}-sm`]:i.size==="small",[`${r}-compact`]:i.compact,[`${r}-rtl`]:t==="rtl"},l,o),u=x.exports.useContext(Ud),d=x.exports.useMemo(()=>Object.assign(Object.assign({},u),{isFormItemInput:!1}),[u]);return a(x.exports.createElement("span",{className:c,style:i.style,onMouseEnter:i.onMouseEnter,onMouseLeave:i.onMouseLeave,onFocus:i.onFocus,onBlur:i.onBlur},x.exports.createElement(Ud.Provider,{value:d},i.children)))};var Wje=Bje;function Mve(i,e){const t=x.exports.useRef([]),n=()=>{t.current.push(setTimeout(()=>{var o,r,s,a;((o=i.current)===null||o===void 0?void 0:o.input)&&((r=i.current)===null||r===void 0?void 0:r.input.getAttribute("type"))==="password"&&((s=i.current)===null||s===void 0?void 0:s.input.hasAttribute("value"))&&((a=i.current)===null||a===void 0||a.input.removeAttribute("value"))}))};return x.exports.useEffect(()=>(e&&n(),()=>t.current.forEach(o=>{o&&clearTimeout(o)})),[]),n}function Vje(i){return!!(i.prefix||i.suffix||i.allowClear||i.showCount)}const Hje=i=>{let e;return typeof i=="object"&&(i==null?void 0:i.clearIcon)?e=i:i&&(e={clearIcon:Bt.createElement(cS,null)}),e};var $je=Hje,zje=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(i);o{var t;const{prefixCls:n,bordered:o=!0,status:r,size:s,disabled:a,onBlur:l,onFocus:c,suffix:u,allowClear:d,addonAfter:h,addonBefore:f,className:g,style:p,styles:v,rootClassName:m,onChange:_,classNames:y,variant:w}=i,L=zje(i,["prefixCls","bordered","status","size","disabled","onBlur","onFocus","suffix","allowClear","addonAfter","addonBefore","className","style","styles","rootClassName","onChange","classNames","variant"]),{getPrefixCls:D,direction:E,input:I}=Bt.useContext(Hi),k=D("input",n),R=x.exports.useRef(null),A=nh(k),[P,N,M]=Cq(k,A),{compactSize:H,compactItemClassnames:B}=I4(k,E),F=Ob(Oe=>{var xe;return(xe=s!=null?s:H)!==null&&xe!==void 0?xe:Oe}),$=Bt.useContext(lS),z=a!=null?a:$,{status:K,hasFeedback:j,feedbackIcon:G}=x.exports.useContext(Ud),X=uq(K,r),de=Vje(i)||!!j;x.exports.useRef(de);const fe=Mve(R,!0),pe=Oe=>{fe(),l==null||l(Oe)},be=Oe=>{fe(),c==null||c(Oe)},Se=Oe=>{fe(),_==null||_(Oe)},Fe=(j||u)&&fn(ks,{children:[u,j&&G]}),De=$je(d),[ce,Pe]=hq(w,o);return P(he(Fje,{...Object.assign({ref:eh(e,R),prefixCls:k,autoComplete:I==null?void 0:I.autoComplete},L,{disabled:z,onBlur:pe,onFocus:be,style:Object.assign(Object.assign({},I==null?void 0:I.style),p),styles:Object.assign(Object.assign({},I==null?void 0:I.styles),v),suffix:Fe,allowClear:De,className:Ue(g,m,M,A,B,I==null?void 0:I.className),onChange:Se,addonAfter:h&&he(xA,{children:he(IW,{override:!0,status:!0,children:h})}),addonBefore:f&&he(xA,{children:he(IW,{override:!0,status:!0,children:f})}),classNames:Object.assign(Object.assign(Object.assign({},y),I==null?void 0:I.classNames),{input:Ue({[`${k}-sm`]:F==="small",[`${k}-lg`]:F==="large",[`${k}-rtl`]:E==="rtl"},y==null?void 0:y.input,(t=I==null?void 0:I.classNames)===null||t===void 0?void 0:t.input,N),variant:Ue({[`${k}-${ce}`]:Pe},kA(k,X)),affixWrapper:Ue({[`${k}-affix-wrapper-sm`]:F==="small",[`${k}-affix-wrapper-lg`]:F==="large",[`${k}-affix-wrapper-rtl`]:E==="rtl"},N),wrapper:Ue({[`${k}-group-rtl`]:E==="rtl"},N),groupWrapper:Ue({[`${k}-group-wrapper-sm`]:F==="small",[`${k}-group-wrapper-lg`]:F==="large",[`${k}-group-wrapper-rtl`]:E==="rtl",[`${k}-group-wrapper-${ce}`]:Pe},kA(`${k}-group-wrapper`,X,j),N)})})}))});var yq=jje,Kje={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M942.2 486.2Q889.47 375.11 816.7 305l-50.88 50.88C807.31 395.53 843.45 447.4 874.7 512 791.5 684.2 673.4 766 512 766q-72.67 0-133.87-22.38L323 798.75Q408 838 512 838q288.3 0 430.2-300.3a60.29 60.29 0 000-51.5zm-63.57-320.64L836 122.88a8 8 0 00-11.32 0L715.31 232.2Q624.86 186 512 186q-288.3 0-430.2 300.3a60.3 60.3 0 000 51.5q56.69 119.4 136.5 191.41L112.48 835a8 8 0 000 11.31L155.17 889a8 8 0 0011.31 0l712.15-712.12a8 8 0 000-11.32zM149.3 512C232.6 339.8 350.7 258 512 258c54.54 0 104.13 9.36 149.12 28.39l-70.3 70.3a176 176 0 00-238.13 238.13l-83.42 83.42C223.1 637.49 183.3 582.28 149.3 512zm246.7 0a112.11 112.11 0 01146.2-106.69L401.31 546.2A112 112 0 01396 512z"}},{tag:"path",attrs:{d:"M508 624c-3.46 0-6.87-.16-10.25-.47l-52.82 52.82a176.09 176.09 0 00227.42-227.42l-52.82 52.82c.31 3.38.47 6.79.47 10.25a111.94 111.94 0 01-112 112z"}}]},name:"eye-invisible",theme:"outlined"},qje=Kje,Gje=function(e,t){return x.exports.createElement(cr,yt({},e,{ref:t,icon:qje}))},Xje=x.exports.forwardRef(Gje),Yje={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M942.2 486.2C847.4 286.5 704.1 186 512 186c-192.2 0-335.4 100.5-430.2 300.3a60.3 60.3 0 000 51.5C176.6 737.5 319.9 838 512 838c192.2 0 335.4-100.5 430.2-300.3 7.7-16.2 7.7-35 0-51.5zM512 766c-161.3 0-279.4-81.8-362.7-254C232.6 339.8 350.7 258 512 258c161.3 0 279.4 81.8 362.7 254C791.5 684.2 673.4 766 512 766zm-4-430c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm0 288c-61.9 0-112-50.1-112-112s50.1-112 112-112 112 50.1 112 112-50.1 112-112 112z"}}]},name:"eye",theme:"outlined"},Zje=Yje,Qje=function(e,t){return x.exports.createElement(cr,yt({},e,{ref:t,icon:Zje}))},Jje=x.exports.forwardRef(Qje),eKe=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(i);oi?x.exports.createElement(Jje,null):x.exports.createElement(Xje,null),nKe={click:"onClick",hover:"onMouseOver"},iKe=x.exports.forwardRef((i,e)=>{const{visibilityToggle:t=!0}=i,n=typeof t=="object"&&t.visible!==void 0,[o,r]=x.exports.useState(()=>n?t.visible:!1),s=x.exports.useRef(null);x.exports.useEffect(()=>{n&&r(t.visible)},[n,t]);const a=Mve(s),l=()=>{const{disabled:L}=i;L||(o&&a(),r(D=>{var E;const I=!D;return typeof t=="object"&&((E=t.onVisibleChange)===null||E===void 0||E.call(t,I)),I}))},c=L=>{const{action:D="click",iconRender:E=tKe}=i,I=nKe[D]||"",k=E(o),R={[I]:l,className:`${L}-icon`,key:"passwordIcon",onMouseDown:A=>{A.preventDefault()},onMouseUp:A=>{A.preventDefault()}};return x.exports.cloneElement(x.exports.isValidElement(k)?k:x.exports.createElement("span",null,k),R)},{className:u,prefixCls:d,inputPrefixCls:h,size:f}=i,g=eKe(i,["className","prefixCls","inputPrefixCls","size"]),{getPrefixCls:p}=x.exports.useContext(Hi),v=p("input",h),m=p("input-password",d),_=t&&c(m),y=Ue(m,u,{[`${m}-${f}`]:!!f}),w=Object.assign(Object.assign({},kf(g,["suffix","iconRender","visibilityToggle"])),{type:o?"text":"password",className:y,prefixCls:v,suffix:_});return f&&(w.size=f),x.exports.createElement(yq,Object.assign({ref:eh(e,s)},w))});var oKe=iKe,rKe=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(i);o{const{prefixCls:t,inputPrefixCls:n,className:o,size:r,suffix:s,enterButton:a=!1,addonAfter:l,loading:c,disabled:u,onSearch:d,onChange:h,onCompositionStart:f,onCompositionEnd:g}=i,p=rKe(i,["prefixCls","inputPrefixCls","className","size","suffix","enterButton","addonAfter","loading","disabled","onSearch","onChange","onCompositionStart","onCompositionEnd"]),{getPrefixCls:v,direction:m}=x.exports.useContext(Hi),_=x.exports.useRef(!1),y=v("input-search",t),w=v("input",n),{compactSize:L}=I4(y,m),D=Ob(K=>{var j;return(j=r!=null?r:L)!==null&&j!==void 0?j:K}),E=x.exports.useRef(null),I=K=>{K&&K.target&&K.type==="click"&&d&&d(K.target.value,K,{source:"clear"}),h&&h(K)},k=K=>{var j;document.activeElement===((j=E.current)===null||j===void 0?void 0:j.input)&&K.preventDefault()},R=K=>{var j,G;d&&d((G=(j=E.current)===null||j===void 0?void 0:j.input)===null||G===void 0?void 0:G.value,K,{source:"input"})},A=K=>{_.current||c||R(K)},P=typeof a=="boolean"?x.exports.createElement(Kme,null):null,N=`${y}-button`;let M;const H=a||{},B=H.type&&H.type.__ANT_BUTTON===!0;B||H.type==="button"?M=mv(H,Object.assign({onMouseDown:k,onClick:K=>{var j,G;(G=(j=H==null?void 0:H.props)===null||j===void 0?void 0:j.onClick)===null||G===void 0||G.call(j,K),R(K)},key:"enterButton"},B?{className:N,size:D}:{})):M=x.exports.createElement(ts,{className:N,type:a?"primary":void 0,size:D,disabled:u,key:"enterButton",onMouseDown:k,onClick:R,loading:c,icon:P},a),l&&(M=[M,mv(l,{key:"addonAfter"})]);const F=Ue(y,{[`${y}-rtl`]:m==="rtl",[`${y}-${D}`]:!!D,[`${y}-with-button`]:!!a},o),$=K=>{_.current=!0,f==null||f(K)},z=K=>{_.current=!1,g==null||g(K)};return x.exports.createElement(yq,Object.assign({ref:eh(E,e),onPressEnter:A},p,{size:D,onCompositionStart:$,onCompositionEnd:z,prefixCls:w,addonAfter:M,suffix:s,onChange:I,className:F,disabled:u}))});var aKe=sKe,lKe=` min-height:0 !important; max-height:none !important; height:0 !important; @@ -290,49 +290,49 @@ html body { top:0 !important; right:0 !important; pointer-events: none !important; -`,tKe=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","font-variant","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break","white-space"],b6={},cu;function nKe(i){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,t=i.getAttribute("id")||i.getAttribute("data-reactid")||i.getAttribute("name");if(e&&b6[t])return b6[t];var n=window.getComputedStyle(i),o=n.getPropertyValue("box-sizing")||n.getPropertyValue("-moz-box-sizing")||n.getPropertyValue("-webkit-box-sizing"),r=parseFloat(n.getPropertyValue("padding-bottom"))+parseFloat(n.getPropertyValue("padding-top")),s=parseFloat(n.getPropertyValue("border-bottom-width"))+parseFloat(n.getPropertyValue("border-top-width")),a=tKe.map(function(c){return"".concat(c,":").concat(n.getPropertyValue(c))}).join(";"),l={sizingStyle:a,paddingSize:r,borderSize:s,boxSizing:o};return e&&t&&(b6[t]=l),l}function iKe(i){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;cu||(cu=document.createElement("textarea"),cu.setAttribute("tab-index","-1"),cu.setAttribute("aria-hidden","true"),document.body.appendChild(cu)),i.getAttribute("wrap")?cu.setAttribute("wrap",i.getAttribute("wrap")):cu.removeAttribute("wrap");var o=nKe(i,e),r=o.paddingSize,s=o.borderSize,a=o.boxSizing,l=o.sizingStyle;cu.setAttribute("style","".concat(l,";").concat(eKe)),cu.value=i.value||i.placeholder||"";var c=void 0,u=void 0,d,h=cu.scrollHeight;if(a==="border-box"?h+=s:a==="content-box"&&(h-=r),t!==null||n!==null){cu.value=" ";var f=cu.scrollHeight-r;t!==null&&(c=f*t,a==="border-box"&&(c=c+r+s),h=Math.max(c,h)),n!==null&&(u=f*n,a==="border-box"&&(u=u+r+s),d=h>u?"":"hidden",h=Math.min(u,h))}var g={height:h,overflowY:d,resize:"none"};return c&&(g.minHeight=c),u&&(g.maxHeight=u),g}var oKe=["prefixCls","onPressEnter","defaultValue","value","autoSize","onResize","className","style","disabled","onChange","onInternalAutoSize"],C6=0,w6=1,y6=2,rKe=x.exports.forwardRef(function(i,e){var t=i,n=t.prefixCls;t.onPressEnter;var o=t.defaultValue,r=t.value,s=t.autoSize,a=t.onResize,l=t.className,c=t.style,u=t.disabled,d=t.onChange;t.onInternalAutoSize;var h=Hn(t,oKe),f=jl(o,{value:r,postState:function(de){return de!=null?de:""}}),g=Ne(f,2),p=g[0],v=g[1],m=function(de){v(de.target.value),d==null||d(de)},_=x.exports.useRef();x.exports.useImperativeHandle(e,function(){return{textArea:_.current}});var w=x.exports.useMemo(function(){return s&&Kn(s)==="object"?[s.minRows,s.maxRows]:[]},[s]),y=Ne(w,2),L=y[0],D=y[1],E=!!s,I=function(){try{if(document.activeElement===_.current){var de=_.current,he=de.selectionStart,pe=de.selectionEnd,be=de.scrollTop;_.current.setSelectionRange(he,pe),_.current.scrollTop=be}}catch{}},k=x.exports.useState(y6),R=Ne(k,2),A=R[0],P=R[1],N=x.exports.useState(),M=Ne(N,2),H=M[0],W=M[1],F=function(){P(C6)};go(function(){E&&F()},[r,L,D,E]),go(function(){if(A===C6)P(w6);else if(A===w6){var X=iKe(_.current,!1,L,D);P(y6),W(X)}else I()},[A]);var $=x.exports.useRef(),z=function(){Xi.cancel($.current)},K=function(de){A===y6&&(a==null||a(de),s&&(z(),$.current=Xi(function(){F()})))};x.exports.useEffect(function(){return z},[]);var j=E?H:null,G=Ce(Ce({},c),j);return(A===C6||A===w6)&&(G.overflowY="hidden",G.overflowX="hidden"),x.exports.createElement(Md,{onResize:K,disabled:!(s||a)},x.exports.createElement("textarea",Ct({},h,{ref:_,style:G,className:Ue(n,l,me({},"".concat(n,"-disabled"),u)),disabled:u,value:p,onChange:m})))}),sKe=["defaultValue","value","onFocus","onBlur","onChange","allowClear","maxLength","onCompositionStart","onCompositionEnd","suffix","prefixCls","showCount","count","className","style","disabled","hidden","classNames","styles","onResize"],aKe=Bt.forwardRef(function(i,e){var t,n,o=i.defaultValue,r=i.value,s=i.onFocus,a=i.onBlur,l=i.onChange,c=i.allowClear,u=i.maxLength,d=i.onCompositionStart,h=i.onCompositionEnd,f=i.suffix,g=i.prefixCls,p=g===void 0?"rc-textarea":g,v=i.showCount,m=i.count,_=i.className,w=i.style,y=i.disabled,L=i.hidden,D=i.classNames,E=i.styles,I=i.onResize,k=Hn(i,sKe),R=jl(o,{value:r,defaultValue:o}),A=Ne(R,2),P=A[0],N=A[1],M=P==null?"":String(P),H=Bt.useState(!1),W=Ne(H,2),F=W[0],$=W[1],z=Bt.useRef(!1),K=Bt.useState(null),j=Ne(K,2),G=j[0],X=j[1],de=x.exports.useRef(null),he=function(){var Te;return(Te=de.current)===null||Te===void 0?void 0:Te.textArea},pe=function(){he().focus()};x.exports.useImperativeHandle(e,function(){return{resizableTextArea:de.current,focus:pe,blur:function(){he().blur()}}}),x.exports.useEffect(function(){$(function(Le){return!y&&Le})},[y]);var be=Bt.useState(null),Se=Ne(be,2),Fe=Se[0],De=Se[1];Bt.useEffect(function(){if(Fe){var Le;(Le=he()).setSelectionRange.apply(Le,_t(Fe))}},[Fe]);var ce=Lve(m,v),Pe=(t=ce.max)!==null&&t!==void 0?t:u,Oe=Number(Pe)>0,xe=ce.strategy(M),Ee=!!Pe&&xe>Pe,tt=function(Te,We){var je=We;!z.current&&ce.exceedFormatter&&ce.max&&ce.strategy(We)>ce.max&&(je=ce.exceedFormatter(We,{max:ce.max}),We!==je&&De([he().selectionStart||0,he().selectionEnd||0])),N(je),DA(Te.currentTarget,Te,l,je)},nt=function(Te){z.current=!0,d==null||d(Te)},Qe=function(Te){z.current=!1,tt(Te,Te.currentTarget.value),h==null||h(Te)},Ge=function(Te){tt(Te,Te.target.value)},re=function(Te){var We=k.onPressEnter,je=k.onKeyDown;Te.key==="Enter"&&We&&We(Te),je==null||je(Te)},ie=function(Te){$(!0),s==null||s(Te)},se=function(Te){$(!1),a==null||a(Te)},U=function(Te){N(""),pe(),DA(he(),Te,l)},Y=f,oe;ce.show&&(ce.showFormatter?oe=ce.showFormatter({value:M,count:xe,maxLength:Pe}):oe="".concat(xe).concat(Oe?" / ".concat(Pe):""),Y=vn(Ds,{children:[Y,fe("span",{className:Ue("".concat(p,"-data-count"),D==null?void 0:D.count),style:E==null?void 0:E.count,children:oe})]}));var te=function(Te){var We;I==null||I(Te),(We=he())!==null&&We!==void 0&&We.style.height&&X(!0)},we=!k.autoSize&&!v&&!c;return fe(xve,{value:M,allowClear:c,handleReset:U,suffix:Y,prefixCls:p,classNames:Ce(Ce({},D),{},{affixWrapper:Ue(D==null?void 0:D.affixWrapper,(n={},me(n,"".concat(p,"-show-count"),v),me(n,"".concat(p,"-textarea-allow-clear"),c),n))}),disabled:y,focused:F,className:Ue(_,Ee&&"".concat(p,"-out-of-range")),style:Ce(Ce({},w),G&&!we?{height:"auto"}:{}),dataAttrs:{affixWrapper:{"data-count":typeof oe=="string"?oe:void 0}},hidden:L,children:fe(rKe,{...k,maxLength:u,onKeyDown:re,onChange:Ge,onFocus:ie,onBlur:se,onCompositionStart:nt,onCompositionEnd:Qe,className:Ue(D==null?void 0:D.textarea),style:Ce(Ce({},E==null?void 0:E.textarea),{},{resize:w==null?void 0:w.resize}),disabled:y,prefixCls:p,onResize:te,ref:de})})}),lKe=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(i);o{var t;const{prefixCls:n,bordered:o=!0,size:r,disabled:s,status:a,allowClear:l,classNames:c,rootClassName:u,className:d,variant:h}=i,f=lKe(i,["prefixCls","bordered","size","disabled","status","allowClear","classNames","rootClassName","className","variant"]),{getPrefixCls:g,direction:p}=x.exports.useContext(Hi),v=Pb(r),m=x.exports.useContext(aS),_=s!=null?s:m,{status:w,hasFeedback:y,feedbackIcon:L}=x.exports.useContext(zd),D=sq(w,a),E=x.exports.useRef(null);x.exports.useImperativeHandle(e,()=>{var W;return{resizableTextArea:(W=E.current)===null||W===void 0?void 0:W.resizableTextArea,focus:F=>{var $,z;Oje((z=($=E.current)===null||$===void 0?void 0:$.resizableTextArea)===null||z===void 0?void 0:z.textArea,F)},blur:()=>{var F;return(F=E.current)===null||F===void 0?void 0:F.blur()}}});const I=g("input",n);let k;typeof l=="object"&&(l==null?void 0:l.clearIcon)?k=l:l&&(k={clearIcon:x.exports.createElement(lS,null)});const R=th(I),[A,P,N]=mq(I,R),[M,H]=lq(h,o);return A(x.exports.createElement(aKe,Object.assign({},f,{disabled:_,allowClear:k,className:Ue(N,R,d,u),classNames:Object.assign(Object.assign({},c),{textarea:Ue({[`${I}-sm`]:v==="small",[`${I}-lg`]:v==="large"},P,c==null?void 0:c.textarea),variant:Ue({[`${I}-${M}`]:H},LA(I,D)),affixWrapper:Ue(`${I}-textarea-affix-wrapper`,{[`${I}-affix-wrapper-rtl`]:p==="rtl",[`${I}-affix-wrapper-sm`]:v==="small",[`${I}-affix-wrapper-lg`]:v==="large",[`${I}-textarea-show-count`]:i.showCount||((t=i.count)===null||t===void 0?void 0:t.show)},P)}),prefixCls:I,suffix:y&&x.exports.createElement("span",{className:`${I}-textarea-suffix`},L),ref:E})))});var uKe=cKe;const MI=vq;MI.Group=Nje;MI.Search=Jje;MI.TextArea=uKe;MI.Password=Yje;var bD=MI;function kA(i){const[e,t]=x.exports.useState(i);return x.exports.useEffect(()=>{const n=setTimeout(()=>{t(i)},i.length?0:10);return()=>{clearTimeout(n)}},[i]),e}const dKe=i=>{const{componentCls:e}=i,t=`${e}-show-help`,n=`${e}-show-help-item`;return{[t]:{transition:`opacity ${i.motionDurationSlow} ${i.motionEaseInOut}`,"&-appear, &-enter":{opacity:0,"&-active":{opacity:1}},"&-leave":{opacity:1,"&-active":{opacity:0}},[n]:{overflow:"hidden",transition:`height ${i.motionDurationSlow} ${i.motionEaseInOut}, +`,cKe=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","font-variant","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break","white-space"],b6={},uu;function uKe(i){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,t=i.getAttribute("id")||i.getAttribute("data-reactid")||i.getAttribute("name");if(e&&b6[t])return b6[t];var n=window.getComputedStyle(i),o=n.getPropertyValue("box-sizing")||n.getPropertyValue("-moz-box-sizing")||n.getPropertyValue("-webkit-box-sizing"),r=parseFloat(n.getPropertyValue("padding-bottom"))+parseFloat(n.getPropertyValue("padding-top")),s=parseFloat(n.getPropertyValue("border-bottom-width"))+parseFloat(n.getPropertyValue("border-top-width")),a=cKe.map(function(c){return"".concat(c,":").concat(n.getPropertyValue(c))}).join(";"),l={sizingStyle:a,paddingSize:r,borderSize:s,boxSizing:o};return e&&t&&(b6[t]=l),l}function dKe(i){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;uu||(uu=document.createElement("textarea"),uu.setAttribute("tab-index","-1"),uu.setAttribute("aria-hidden","true"),document.body.appendChild(uu)),i.getAttribute("wrap")?uu.setAttribute("wrap",i.getAttribute("wrap")):uu.removeAttribute("wrap");var o=uKe(i,e),r=o.paddingSize,s=o.borderSize,a=o.boxSizing,l=o.sizingStyle;uu.setAttribute("style","".concat(l,";").concat(lKe)),uu.value=i.value||i.placeholder||"";var c=void 0,u=void 0,d,h=uu.scrollHeight;if(a==="border-box"?h+=s:a==="content-box"&&(h-=r),t!==null||n!==null){uu.value=" ";var f=uu.scrollHeight-r;t!==null&&(c=f*t,a==="border-box"&&(c=c+r+s),h=Math.max(c,h)),n!==null&&(u=f*n,a==="border-box"&&(u=u+r+s),d=h>u?"":"hidden",h=Math.min(u,h))}var g={height:h,overflowY:d,resize:"none"};return c&&(g.minHeight=c),u&&(g.maxHeight=u),g}var hKe=["prefixCls","onPressEnter","defaultValue","value","autoSize","onResize","className","style","disabled","onChange","onInternalAutoSize"],C6=0,y6=1,w6=2,fKe=x.exports.forwardRef(function(i,e){var t=i,n=t.prefixCls;t.onPressEnter;var o=t.defaultValue,r=t.value,s=t.autoSize,a=t.onResize,l=t.className,c=t.style,u=t.disabled,d=t.onChange;t.onInternalAutoSize;var h=Hn(t,hKe),f=Kl(o,{value:r,postState:function(de){return de!=null?de:""}}),g=Ne(f,2),p=g[0],v=g[1],m=function(de){v(de.target.value),d==null||d(de)},_=x.exports.useRef();x.exports.useImperativeHandle(e,function(){return{textArea:_.current}});var y=x.exports.useMemo(function(){return s&&Kn(s)==="object"?[s.minRows,s.maxRows]:[]},[s]),w=Ne(y,2),L=w[0],D=w[1],E=!!s,I=function(){try{if(document.activeElement===_.current){var de=_.current,fe=de.selectionStart,pe=de.selectionEnd,be=de.scrollTop;_.current.setSelectionRange(fe,pe),_.current.scrollTop=be}}catch{}},k=x.exports.useState(w6),R=Ne(k,2),A=R[0],P=R[1],N=x.exports.useState(),M=Ne(N,2),H=M[0],B=M[1],F=function(){P(C6)};go(function(){E&&F()},[r,L,D,E]),go(function(){if(A===C6)P(y6);else if(A===y6){var X=dKe(_.current,!1,L,D);P(w6),B(X)}else I()},[A]);var $=x.exports.useRef(),z=function(){Xi.cancel($.current)},K=function(de){A===w6&&(a==null||a(de),s&&(z(),$.current=Xi(function(){F()})))};x.exports.useEffect(function(){return z},[]);var j=E?H:null,G=Ce(Ce({},c),j);return(A===C6||A===y6)&&(G.overflowY="hidden",G.overflowX="hidden"),x.exports.createElement(Md,{onResize:K,disabled:!(s||a)},x.exports.createElement("textarea",yt({},h,{ref:_,style:G,className:Ue(n,l,me({},"".concat(n,"-disabled"),u)),disabled:u,value:p,onChange:m})))}),gKe=["defaultValue","value","onFocus","onBlur","onChange","allowClear","maxLength","onCompositionStart","onCompositionEnd","suffix","prefixCls","showCount","count","className","style","disabled","hidden","classNames","styles","onResize"],pKe=Bt.forwardRef(function(i,e){var t,n,o=i.defaultValue,r=i.value,s=i.onFocus,a=i.onBlur,l=i.onChange,c=i.allowClear,u=i.maxLength,d=i.onCompositionStart,h=i.onCompositionEnd,f=i.suffix,g=i.prefixCls,p=g===void 0?"rc-textarea":g,v=i.showCount,m=i.count,_=i.className,y=i.style,w=i.disabled,L=i.hidden,D=i.classNames,E=i.styles,I=i.onResize,k=Hn(i,gKe),R=Kl(o,{value:r,defaultValue:o}),A=Ne(R,2),P=A[0],N=A[1],M=P==null?"":String(P),H=Bt.useState(!1),B=Ne(H,2),F=B[0],$=B[1],z=Bt.useRef(!1),K=Bt.useState(null),j=Ne(K,2),G=j[0],X=j[1],de=x.exports.useRef(null),fe=function(){var Te;return(Te=de.current)===null||Te===void 0?void 0:Te.textArea},pe=function(){fe().focus()};x.exports.useImperativeHandle(e,function(){return{resizableTextArea:de.current,focus:pe,blur:function(){fe().blur()}}}),x.exports.useEffect(function(){$(function(Le){return!w&&Le})},[w]);var be=Bt.useState(null),Se=Ne(be,2),Fe=Se[0],De=Se[1];Bt.useEffect(function(){if(Fe){var Le;(Le=fe()).setSelectionRange.apply(Le,_t(Fe))}},[Fe]);var ce=Rve(m,v),Pe=(t=ce.max)!==null&&t!==void 0?t:u,Oe=Number(Pe)>0,xe=ce.strategy(M),Ee=!!Pe&&xe>Pe,tt=function(Te,We){var je=We;!z.current&&ce.exceedFormatter&&ce.max&&ce.strategy(We)>ce.max&&(je=ce.exceedFormatter(We,{max:ce.max}),We!==je&&De([fe().selectionStart||0,fe().selectionEnd||0])),N(je),TA(Te.currentTarget,Te,l,je)},nt=function(Te){z.current=!0,d==null||d(Te)},Qe=function(Te){z.current=!1,tt(Te,Te.currentTarget.value),h==null||h(Te)},Ge=function(Te){tt(Te,Te.target.value)},re=function(Te){var We=k.onPressEnter,je=k.onKeyDown;Te.key==="Enter"&&We&&We(Te),je==null||je(Te)},ie=function(Te){$(!0),s==null||s(Te)},se=function(Te){$(!1),a==null||a(Te)},U=function(Te){N(""),pe(),TA(fe(),Te,l)},Y=f,oe;ce.show&&(ce.showFormatter?oe=ce.showFormatter({value:M,count:xe,maxLength:Pe}):oe="".concat(xe).concat(Oe?" / ".concat(Pe):""),Y=fn(ks,{children:[Y,he("span",{className:Ue("".concat(p,"-data-count"),D==null?void 0:D.count),style:E==null?void 0:E.count,children:oe})]}));var te=function(Te){var We;I==null||I(Te),(We=fe())!==null&&We!==void 0&&We.style.height&&X(!0)},ye=!k.autoSize&&!v&&!c;return he(Nve,{value:M,allowClear:c,handleReset:U,suffix:Y,prefixCls:p,classNames:Ce(Ce({},D),{},{affixWrapper:Ue(D==null?void 0:D.affixWrapper,(n={},me(n,"".concat(p,"-show-count"),v),me(n,"".concat(p,"-textarea-allow-clear"),c),n))}),disabled:w,focused:F,className:Ue(_,Ee&&"".concat(p,"-out-of-range")),style:Ce(Ce({},y),G&&!ye?{height:"auto"}:{}),dataAttrs:{affixWrapper:{"data-count":typeof oe=="string"?oe:void 0}},hidden:L,children:he(fKe,{...k,maxLength:u,onKeyDown:re,onChange:Ge,onFocus:ie,onBlur:se,onCompositionStart:nt,onCompositionEnd:Qe,className:Ue(D==null?void 0:D.textarea),style:Ce(Ce({},E==null?void 0:E.textarea),{},{resize:y==null?void 0:y.resize}),disabled:w,prefixCls:p,onResize:te,ref:de})})}),mKe=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(i);o{var t;const{prefixCls:n,bordered:o=!0,size:r,disabled:s,status:a,allowClear:l,classNames:c,rootClassName:u,className:d,variant:h}=i,f=mKe(i,["prefixCls","bordered","size","disabled","status","allowClear","classNames","rootClassName","className","variant"]),{getPrefixCls:g,direction:p}=x.exports.useContext(Hi),v=Ob(r),m=x.exports.useContext(lS),_=s!=null?s:m,{status:y,hasFeedback:w,feedbackIcon:L}=x.exports.useContext(Ud),D=uq(y,a),E=x.exports.useRef(null);x.exports.useImperativeHandle(e,()=>{var B;return{resizableTextArea:(B=E.current)===null||B===void 0?void 0:B.resizableTextArea,focus:F=>{var $,z;Uje((z=($=E.current)===null||$===void 0?void 0:$.resizableTextArea)===null||z===void 0?void 0:z.textArea,F)},blur:()=>{var F;return(F=E.current)===null||F===void 0?void 0:F.blur()}}});const I=g("input",n);let k;typeof l=="object"&&(l==null?void 0:l.clearIcon)?k=l:l&&(k={clearIcon:x.exports.createElement(cS,null)});const R=nh(I),[A,P,N]=Cq(I,R),[M,H]=hq(h,o);return A(x.exports.createElement(pKe,Object.assign({},f,{disabled:_,allowClear:k,className:Ue(N,R,d,u),classNames:Object.assign(Object.assign({},c),{textarea:Ue({[`${I}-sm`]:v==="small",[`${I}-lg`]:v==="large"},P,c==null?void 0:c.textarea),variant:Ue({[`${I}-${M}`]:H},kA(I,D)),affixWrapper:Ue(`${I}-textarea-affix-wrapper`,{[`${I}-affix-wrapper-rtl`]:p==="rtl",[`${I}-affix-wrapper-sm`]:v==="small",[`${I}-affix-wrapper-lg`]:v==="large",[`${I}-textarea-show-count`]:i.showCount||((t=i.count)===null||t===void 0?void 0:t.show)},P)}),prefixCls:I,suffix:w&&x.exports.createElement("span",{className:`${I}-textarea-suffix`},L),ref:E})))});var _Ke=vKe;const PI=yq;PI.Group=Wje;PI.Search=aKe;PI.TextArea=_Ke;PI.Password=oKe;var lw=PI;function NA(i){const[e,t]=x.exports.useState(i);return x.exports.useEffect(()=>{const n=setTimeout(()=>{t(i)},i.length?0:10);return()=>{clearTimeout(n)}},[i]),e}const bKe=i=>{const{componentCls:e}=i,t=`${e}-show-help`,n=`${e}-show-help-item`;return{[t]:{transition:`opacity ${i.motionDurationSlow} ${i.motionEaseInOut}`,"&-appear, &-enter":{opacity:0,"&-active":{opacity:1}},"&-leave":{opacity:1,"&-active":{opacity:0}},[n]:{overflow:"hidden",transition:`height ${i.motionDurationSlow} ${i.motionEaseInOut}, opacity ${i.motionDurationSlow} ${i.motionEaseInOut}, - transform ${i.motionDurationSlow} ${i.motionEaseInOut} !important`,[`&${n}-appear, &${n}-enter`]:{transform:"translateY(-5px)",opacity:0,["&-active"]:{transform:"translateY(0)",opacity:1}},[`&${n}-leave-active`]:{transform:"translateY(-5px)"}}}}};var hKe=dKe;const fKe=i=>({legend:{display:"block",width:"100%",marginBottom:i.marginLG,padding:0,color:i.colorTextDescription,fontSize:i.fontSizeLG,lineHeight:"inherit",border:0,borderBottom:`${rt(i.lineWidth)} ${i.lineType} ${i.colorBorder}`},'input[type="search"]':{boxSizing:"border-box"},'input[type="radio"], input[type="checkbox"]':{lineHeight:"normal"},'input[type="file"]':{display:"block"},'input[type="range"]':{display:"block",width:"100%"},"select[multiple], select[size]":{height:"auto"},[`input[type='file']:focus, + transform ${i.motionDurationSlow} ${i.motionEaseInOut} !important`,[`&${n}-appear, &${n}-enter`]:{transform:"translateY(-5px)",opacity:0,["&-active"]:{transform:"translateY(0)",opacity:1}},[`&${n}-leave-active`]:{transform:"translateY(-5px)"}}}}};var CKe=bKe;const yKe=i=>({legend:{display:"block",width:"100%",marginBottom:i.marginLG,padding:0,color:i.colorTextDescription,fontSize:i.fontSizeLG,lineHeight:"inherit",border:0,borderBottom:`${rt(i.lineWidth)} ${i.lineType} ${i.colorBorder}`},'input[type="search"]':{boxSizing:"border-box"},'input[type="radio"], input[type="checkbox"]':{lineHeight:"normal"},'input[type="file"]':{display:"block"},'input[type="range"]':{display:"block",width:"100%"},"select[multiple], select[size]":{height:"auto"},[`input[type='file']:focus, input[type='radio']:focus, - input[type='checkbox']:focus`]:{outline:0,boxShadow:`0 0 0 ${rt(i.controlOutlineWidth)} ${i.controlOutline}`},output:{display:"block",paddingTop:15,color:i.colorText,fontSize:i.fontSize,lineHeight:i.lineHeight}}),xie=(i,e)=>{const{formItemCls:t}=i;return{[t]:{[`${t}-label > label`]:{height:e},[`${t}-control-input`]:{minHeight:e}}}},gKe=i=>{const{componentCls:e}=i;return{[i.componentCls]:Object.assign(Object.assign(Object.assign({},Aa(i)),fKe(i)),{[`${e}-text`]:{display:"inline-block",paddingInlineEnd:i.paddingSM},"&-small":Object.assign({},xie(i,i.controlHeightSM)),"&-large":Object.assign({},xie(i,i.controlHeightLG))})}},pKe=i=>{const{formItemCls:e,iconCls:t,componentCls:n,rootPrefixCls:o,labelRequiredMarkColor:r,labelColor:s,labelFontSize:a,labelHeight:l,labelColonMarginInlineStart:c,labelColonMarginInlineEnd:u,itemMarginBottom:d}=i;return{[e]:Object.assign(Object.assign({},Aa(i)),{marginBottom:d,verticalAlign:"top","&-with-help":{transition:"none"},[`&-hidden, - &-hidden.${o}-row`]:{display:"none"},"&-has-warning":{[`${e}-split`]:{color:i.colorError}},"&-has-error":{[`${e}-split`]:{color:i.colorWarning}},[`${e}-label`]:{flexGrow:0,overflow:"hidden",whiteSpace:"nowrap",textAlign:"end",verticalAlign:"middle","&-left":{textAlign:"start"},"&-wrap":{overflow:"unset",lineHeight:i.lineHeight,whiteSpace:"unset"},"> label":{position:"relative",display:"inline-flex",alignItems:"center",maxWidth:"100%",height:l,color:s,fontSize:a,[`> ${t}`]:{fontSize:i.fontSize,verticalAlign:"top"},[`&${e}-required:not(${e}-required-mark-optional)::before`]:{display:"inline-block",marginInlineEnd:i.marginXXS,color:r,fontSize:i.fontSize,fontFamily:"SimSun, sans-serif",lineHeight:1,content:'"*"',[`${n}-hide-required-mark &`]:{display:"none"}},[`${e}-optional`]:{display:"inline-block",marginInlineStart:i.marginXXS,color:i.colorTextDescription,[`${n}-hide-required-mark &`]:{display:"none"}},[`${e}-tooltip`]:{color:i.colorTextDescription,cursor:"help",writingMode:"horizontal-tb",marginInlineStart:i.marginXXS},"&::after":{content:'":"',position:"relative",marginBlock:0,marginInlineStart:c,marginInlineEnd:u},[`&${e}-no-colon::after`]:{content:'"\\a0"'}}},[`${e}-control`]:{["--ant-display"]:"flex",flexDirection:"column",flexGrow:1,[`&:first-child:not([class^="'${o}-col-'"]):not([class*="' ${o}-col-'"])`]:{width:"100%"},"&-input":{position:"relative",display:"flex",alignItems:"center",minHeight:i.controlHeight,"&-content":{flex:"auto",maxWidth:"100%"}}},[e]:{"&-explain, &-extra":{clear:"both",color:i.colorTextDescription,fontSize:i.fontSize,lineHeight:i.lineHeight},"&-explain-connected":{width:"100%"},"&-extra":{minHeight:i.controlHeightSM,transition:`color ${i.motionDurationMid} ${i.motionEaseOut}`},"&-explain":{"&-error":{color:i.colorError},"&-warning":{color:i.colorWarning}}},[`&-with-help ${e}-explain`]:{height:"auto",opacity:1},[`${e}-feedback-icon`]:{fontSize:i.fontSize,textAlign:"center",visibility:"visible",animationName:JK,animationDuration:i.motionDurationMid,animationTimingFunction:i.motionEaseOutBack,pointerEvents:"none","&-success":{color:i.colorSuccess},"&-error":{color:i.colorError},"&-warning":{color:i.colorWarning},"&-validating":{color:i.colorPrimary}}})}},mKe=i=>{const{componentCls:e,formItemCls:t}=i;return{[`${e}-horizontal`]:{[`${t}-label`]:{flexGrow:0},[`${t}-control`]:{flex:"1 1 0",minWidth:0},[`${t}-label[class$='-24'], ${t}-label[class*='-24 ']`]:{[`& + ${t}-control`]:{minWidth:"unset"}}}}},vKe=i=>{const{componentCls:e,formItemCls:t}=i;return{[`${e}-inline`]:{display:"flex",flexWrap:"wrap",[t]:{flex:"none",marginInlineEnd:i.margin,marginBottom:0,"&-row":{flexWrap:"nowrap"},[`> ${t}-label, - > ${t}-control`]:{display:"inline-block",verticalAlign:"top"},[`> ${t}-label`]:{flex:"none"},[`${e}-text`]:{display:"inline-block"},[`${t}-has-feedback`]:{display:"inline-block"}}}}},lC=i=>({padding:i.verticalLabelPadding,margin:i.verticalLabelMargin,whiteSpace:"initial",textAlign:"start","> label":{margin:0,"&::after":{visibility:"hidden"}}}),_Ke=i=>{const{componentCls:e,formItemCls:t,rootPrefixCls:n}=i;return{[`${t} ${t}-label`]:lC(i),[`${e}:not(${e}-inline)`]:{[t]:{flexWrap:"wrap",[`${t}-label, ${t}-control`]:{[`&:not([class*=" ${n}-col-xs"])`]:{flex:"0 0 100%",maxWidth:"100%"}}}}}},bKe=i=>{const{componentCls:e,formItemCls:t,rootPrefixCls:n}=i;return{[`${e}-vertical`]:{[t]:{"&-row":{flexDirection:"column"},"&-label > label":{height:"auto"},[`${e}-item-control`]:{width:"100%"}}},[`${e}-vertical ${t}-label, + input[type='checkbox']:focus`]:{outline:0,boxShadow:`0 0 0 ${rt(i.controlOutlineWidth)} ${i.controlOutline}`},output:{display:"block",paddingTop:15,color:i.colorText,fontSize:i.fontSize,lineHeight:i.lineHeight}}),Rie=(i,e)=>{const{formItemCls:t}=i;return{[t]:{[`${t}-label > label`]:{height:e},[`${t}-control-input`]:{minHeight:e}}}},wKe=i=>{const{componentCls:e}=i;return{[i.componentCls]:Object.assign(Object.assign(Object.assign({},Pa(i)),yKe(i)),{[`${e}-text`]:{display:"inline-block",paddingInlineEnd:i.paddingSM},"&-small":Object.assign({},Rie(i,i.controlHeightSM)),"&-large":Object.assign({},Rie(i,i.controlHeightLG))})}},SKe=i=>{const{formItemCls:e,iconCls:t,componentCls:n,rootPrefixCls:o,labelRequiredMarkColor:r,labelColor:s,labelFontSize:a,labelHeight:l,labelColonMarginInlineStart:c,labelColonMarginInlineEnd:u,itemMarginBottom:d}=i;return{[e]:Object.assign(Object.assign({},Pa(i)),{marginBottom:d,verticalAlign:"top","&-with-help":{transition:"none"},[`&-hidden, + &-hidden.${o}-row`]:{display:"none"},"&-has-warning":{[`${e}-split`]:{color:i.colorError}},"&-has-error":{[`${e}-split`]:{color:i.colorWarning}},[`${e}-label`]:{flexGrow:0,overflow:"hidden",whiteSpace:"nowrap",textAlign:"end",verticalAlign:"middle","&-left":{textAlign:"start"},"&-wrap":{overflow:"unset",lineHeight:i.lineHeight,whiteSpace:"unset"},"> label":{position:"relative",display:"inline-flex",alignItems:"center",maxWidth:"100%",height:l,color:s,fontSize:a,[`> ${t}`]:{fontSize:i.fontSize,verticalAlign:"top"},[`&${e}-required:not(${e}-required-mark-optional)::before`]:{display:"inline-block",marginInlineEnd:i.marginXXS,color:r,fontSize:i.fontSize,fontFamily:"SimSun, sans-serif",lineHeight:1,content:'"*"',[`${n}-hide-required-mark &`]:{display:"none"}},[`${e}-optional`]:{display:"inline-block",marginInlineStart:i.marginXXS,color:i.colorTextDescription,[`${n}-hide-required-mark &`]:{display:"none"}},[`${e}-tooltip`]:{color:i.colorTextDescription,cursor:"help",writingMode:"horizontal-tb",marginInlineStart:i.marginXXS},"&::after":{content:'":"',position:"relative",marginBlock:0,marginInlineStart:c,marginInlineEnd:u},[`&${e}-no-colon::after`]:{content:'"\\a0"'}}},[`${e}-control`]:{["--ant-display"]:"flex",flexDirection:"column",flexGrow:1,[`&:first-child:not([class^="'${o}-col-'"]):not([class*="' ${o}-col-'"])`]:{width:"100%"},"&-input":{position:"relative",display:"flex",alignItems:"center",minHeight:i.controlHeight,"&-content":{flex:"auto",maxWidth:"100%"}}},[e]:{"&-explain, &-extra":{clear:"both",color:i.colorTextDescription,fontSize:i.fontSize,lineHeight:i.lineHeight},"&-explain-connected":{width:"100%"},"&-extra":{minHeight:i.controlHeightSM,transition:`color ${i.motionDurationMid} ${i.motionEaseOut}`},"&-explain":{"&-error":{color:i.colorError},"&-warning":{color:i.colorWarning}}},[`&-with-help ${e}-explain`]:{height:"auto",opacity:1},[`${e}-feedback-icon`]:{fontSize:i.fontSize,textAlign:"center",visibility:"visible",animationName:iq,animationDuration:i.motionDurationMid,animationTimingFunction:i.motionEaseOutBack,pointerEvents:"none","&-success":{color:i.colorSuccess},"&-error":{color:i.colorError},"&-warning":{color:i.colorWarning},"&-validating":{color:i.colorPrimary}}})}},xKe=i=>{const{componentCls:e,formItemCls:t}=i;return{[`${e}-horizontal`]:{[`${t}-label`]:{flexGrow:0},[`${t}-control`]:{flex:"1 1 0",minWidth:0},[`${t}-label[class$='-24'], ${t}-label[class*='-24 ']`]:{[`& + ${t}-control`]:{minWidth:"unset"}}}}},LKe=i=>{const{componentCls:e,formItemCls:t}=i;return{[`${e}-inline`]:{display:"flex",flexWrap:"wrap",[t]:{flex:"none",marginInlineEnd:i.margin,marginBottom:0,"&-row":{flexWrap:"nowrap"},[`> ${t}-label, + > ${t}-control`]:{display:"inline-block",verticalAlign:"top"},[`> ${t}-label`]:{flex:"none"},[`${e}-text`]:{display:"inline-block"},[`${t}-has-feedback`]:{display:"inline-block"}}}}},lC=i=>({padding:i.verticalLabelPadding,margin:i.verticalLabelMargin,whiteSpace:"initial",textAlign:"start","> label":{margin:0,"&::after":{visibility:"hidden"}}}),EKe=i=>{const{componentCls:e,formItemCls:t,rootPrefixCls:n}=i;return{[`${t} ${t}-label`]:lC(i),[`${e}:not(${e}-inline)`]:{[t]:{flexWrap:"wrap",[`${t}-label, ${t}-control`]:{[`&:not([class*=" ${n}-col-xs"])`]:{flex:"0 0 100%",maxWidth:"100%"}}}}}},DKe=i=>{const{componentCls:e,formItemCls:t,rootPrefixCls:n}=i;return{[`${e}-vertical`]:{[t]:{"&-row":{flexDirection:"column"},"&-label > label":{height:"auto"},[`${e}-item-control`]:{width:"100%"}}},[`${e}-vertical ${t}-label, .${n}-col-24${t}-label, - .${n}-col-xl-24${t}-label`]:lC(i),[`@media (max-width: ${rt(i.screenXSMax)})`]:[_Ke(i),{[e]:{[`.${n}-col-xs-24${t}-label`]:lC(i)}}],[`@media (max-width: ${rt(i.screenSMMax)})`]:{[e]:{[`.${n}-col-sm-24${t}-label`]:lC(i)}},[`@media (max-width: ${rt(i.screenMDMax)})`]:{[e]:{[`.${n}-col-md-24${t}-label`]:lC(i)}},[`@media (max-width: ${rt(i.screenLGMax)})`]:{[e]:{[`.${n}-col-lg-24${t}-label`]:lC(i)}}}},CKe=i=>({labelRequiredMarkColor:i.colorError,labelColor:i.colorTextHeading,labelFontSize:i.fontSize,labelHeight:i.controlHeight,labelColonMarginInlineStart:i.marginXXS/2,labelColonMarginInlineEnd:i.marginXS,itemMarginBottom:i.marginLG,verticalLabelPadding:`0 0 ${i.paddingXS}px`,verticalLabelMargin:0}),Dve=(i,e)=>lr(i,{formItemCls:`${i.componentCls}-item`,rootPrefixCls:e});var _q=Uc("Form",(i,e)=>{let{rootPrefixCls:t}=e;const n=Dve(i,t);return[gKe(n),pKe(n),hKe(n),mKe(n),vKe(n),bKe(n),lme(n),JK]},CKe,{order:-1e3});const Lie=[];function S6(i,e,t){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0;return{key:typeof i=="string"?i:`${e}-${n}`,error:i,errorStatus:t}}const wKe=i=>{let{help:e,helpStatus:t,errors:n=Lie,warnings:o=Lie,className:r,fieldId:s,onVisibleChanged:a}=i;const{prefixCls:l}=x.exports.useContext(QK),c=`${l}-item-explain`,u=th(l),[d,h,f]=_q(l,u),g=x.exports.useMemo(()=>fW(l),[l]),p=kA(n),v=kA(o),m=x.exports.useMemo(()=>e!=null?[S6(e,"help",t)]:[].concat(_t(p.map((w,y)=>S6(w,"error","error",y))),_t(v.map((w,y)=>S6(w,"warning","warning",y)))),[e,t,p,v]),_={};return s&&(_.id=`${s}_help`),d(x.exports.createElement(eh,{motionDeadline:g.motionDeadline,motionName:`${l}-show-help`,visible:!!m.length,onVisibleChanged:a},w=>{const{className:y,style:L}=w;return x.exports.createElement("div",Object.assign({},_,{className:Ue(c,y,f,u,r,h),style:L,role:"alert"}),x.exports.createElement(dpe,Object.assign({keys:m},fW(l),{motionName:`${l}-show-help-item`,component:!1}),D=>{const{key:E,error:I,errorStatus:k,className:R,style:A}=D;return x.exports.createElement("div",{key:E,className:Ue(R,{[`${c}-${k}`]:k}),style:A},I)}))}))};var kve=wKe;const yKe=["parentNode"],SKe="form_item";function rE(i){return i===void 0||i===!1?[]:Array.isArray(i)?i:[i]}function Ive(i,e){if(!i.length)return;const t=i.join("_");return e?`${e}_${t}`:yKe.includes(t)?`${SKe}_${t}`:t}function Tve(i,e,t,n,o,r){let s=n;return r!==void 0?s=r:t.validating?s="validating":i.length?s="error":e.length?s="warning":(t.touched||o&&t.validated)&&(s="success"),s}function Eie(i){return rE(i).join("_")}function Nve(i){const[e]=ZK(),t=x.exports.useRef({}),n=x.exports.useMemo(()=>i!=null?i:Object.assign(Object.assign({},e),{__INTERNAL__:{itemRef:o=>r=>{const s=Eie(o);r?t.current[s]=r:delete t.current[s]}},scrollToField:function(o){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const s=rE(o),a=Ive(s,n.__INTERNAL__.name),l=a?document.getElementById(a):null;l&&_9e(l,Object.assign({scrollMode:"if-needed",block:"nearest"},r))},getFieldInstance:o=>{const r=Eie(o);return t.current[r]}}),[i,e]);return[n]}var xKe=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(i);o{const t=x.exports.useContext(aS),{getPrefixCls:n,direction:o,form:r}=x.exports.useContext(Hi),{prefixCls:s,className:a,rootClassName:l,size:c,disabled:u=t,form:d,colon:h,labelAlign:f,labelWrap:g,labelCol:p,wrapperCol:v,hideRequiredMark:m,layout:_="horizontal",scrollToFirstError:w,requiredMark:y,onFinishFailed:L,name:D,style:E,feedbackIcons:I,variant:k}=i,R=xKe(i,["prefixCls","className","rootClassName","size","disabled","form","colon","labelAlign","labelWrap","labelCol","wrapperCol","hideRequiredMark","layout","scrollToFirstError","requiredMark","onFinishFailed","name","style","feedbackIcons","variant"]),A=Pb(c),P=x.exports.useContext(Age),N=x.exports.useMemo(()=>y!==void 0?y:m?!1:r&&r.requiredMark!==void 0?r.requiredMark:!0,[m,y,r]),M=h!=null?h:r==null?void 0:r.colon,H=n("form",s),W=th(H),[F,$,z]=_q(H,W),K=Ue(H,`${H}-${_}`,{[`${H}-hide-required-mark`]:N===!1,[`${H}-rtl`]:o==="rtl",[`${H}-${A}`]:A},z,W,$,r==null?void 0:r.className,a,l),[j]=Nve(d),{__INTERNAL__:G}=j;G.name=D;const X=x.exports.useMemo(()=>({name:D,labelAlign:f,labelCol:p,labelWrap:g,wrapperCol:v,vertical:_==="vertical",colon:M,requiredMark:N,itemRef:G.itemRef,form:j,feedbackIcons:I}),[D,f,p,v,_,M,N,j,I]);x.exports.useImperativeHandle(e,()=>j);const de=(pe,be)=>{if(pe){let Se={block:"nearest"};typeof pe=="object"&&(Se=pe),j.scrollToField(be,Se)}},he=pe=>{if(L==null||L(pe),pe.errorFields.length){const be=pe.errorFields[0].name;if(w!==void 0){de(w,be);return}r&&r.scrollToFirstError!==void 0&&de(r.scrollToFirstError,be)}};return F(x.exports.createElement(eme.Provider,{value:k},x.exports.createElement(IK,{disabled:u},x.exports.createElement(SI.Provider,{value:A},x.exports.createElement(Jpe,{validateMessages:P},x.exports.createElement(op.Provider,{value:X},x.exports.createElement(uS,Object.assign({id:D},R,{name:D,onFinishFailed:he,form:j,style:Object.assign(Object.assign({},r==null?void 0:r.style),E),className:K}))))))))},EKe=x.exports.forwardRef(LKe);var DKe=EKe;function kKe(i){if(typeof i=="function")return i;const e=np(i);return e.length<=1?e[0]:e}const Rve=()=>{const{status:i,errors:e=[],warnings:t=[]}=x.exports.useContext(zd);return{status:i,errors:e,warnings:t}};Rve.Context=zd;var IKe=Rve;function TKe(i){const[e,t]=x.exports.useState(i),n=x.exports.useRef(null),o=x.exports.useRef([]),r=x.exports.useRef(!1);x.exports.useEffect(()=>(r.current=!1,()=>{r.current=!0,Xi.cancel(n.current),n.current=null}),[]);function s(a){r.current||(n.current===null&&(o.current=[],n.current=Xi(()=>{n.current=null,t(l=>{let c=l;return o.current.forEach(u=>{c=u(c)}),c})})),o.current.push(a))}return[e,s]}function NKe(){const{itemRef:i}=x.exports.useContext(op),e=x.exports.useRef({});function t(n,o){const r=o&&typeof o=="object"&&o.ref,s=n.join("_");return(e.current.name!==s||e.current.originRef!==r)&&(e.current.name=s,e.current.originRef=r,e.current.ref=Jd(i(n),r)),e.current.ref}return t}const RKe=i=>{const{formItemCls:e}=i;return{"@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none)":{[`${e}-control`]:{display:"flex"}}}};var MKe=MK(["Form","item-item"],(i,e)=>{let{rootPrefixCls:t}=e;const n=Dve(i,t);return[RKe(n)]});const AKe=i=>{const{prefixCls:e,status:t,wrapperCol:n,children:o,errors:r,warnings:s,_internalItemRender:a,extra:l,help:c,fieldId:u,marginBottom:d,onErrorVisibleChanged:h}=i,f=`${e}-item`,g=x.exports.useContext(op),p=n||g.wrapperCol||{},v=Ue(`${f}-control`,p.className),m=x.exports.useMemo(()=>Object.assign({},g),[g]);delete m.labelCol,delete m.wrapperCol;const _=x.exports.createElement("div",{className:`${f}-control-input`},x.exports.createElement("div",{className:`${f}-control-input-content`},o)),w=x.exports.useMemo(()=>({prefixCls:e,status:t}),[e,t]),y=d!==null||r.length||s.length?x.exports.createElement("div",{style:{display:"flex",flexWrap:"nowrap"}},x.exports.createElement(QK.Provider,{value:w},x.exports.createElement(kve,{fieldId:u,errors:r,warnings:s,help:c,helpStatus:t,className:`${f}-explain-connected`,onVisibleChanged:h})),!!d&&x.exports.createElement("div",{style:{width:0,height:d}})):null,L={};u&&(L.id=`${u}_extra`);const D=l?x.exports.createElement("div",Object.assign({},L,{className:`${f}-extra`}),l):null,E=a&&a.mark==="pro_table_render"&&a.render?a.render(i,{input:_,errorList:y,extra:D}):x.exports.createElement(x.exports.Fragment,null,_,y,D);return x.exports.createElement(op.Provider,{value:m},x.exports.createElement(Sve,Object.assign({},p,{className:v}),E),x.exports.createElement(MKe,{prefixCls:e}))};var PKe=AKe,OKe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}},{tag:"path",attrs:{d:"M623.6 316.7C593.6 290.4 554 276 512 276s-81.6 14.5-111.6 40.7C369.2 344 352 380.7 352 420v7.6c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V420c0-44.1 43.1-80 96-80s96 35.9 96 80c0 31.1-22 59.6-56.1 72.7-21.2 8.1-39.2 22.3-52.1 40.9-13.1 19-19.9 41.8-19.9 64.9V620c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8v-22.7a48.3 48.3 0 0130.9-44.8c59-22.7 97.1-74.7 97.1-132.5.1-39.3-17.1-76-48.3-103.3zM472 732a40 40 0 1080 0 40 40 0 10-80 0z"}}]},name:"question-circle",theme:"outlined"},FKe=OKe,BKe=function(e,t){return x.exports.createElement(cr,Ct({},e,{ref:t,icon:FKe}))},WKe=x.exports.forwardRef(BKe),VKe=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(i);o{let{prefixCls:e,label:t,htmlFor:n,labelCol:o,labelAlign:r,colon:s,required:a,requiredMark:l,tooltip:c}=i;var u;const[d]=yI("Form"),{vertical:h,labelAlign:f,labelCol:g,labelWrap:p,colon:v}=x.exports.useContext(op);if(!t)return null;const m=o||g||{},_=r||f,w=`${e}-item-label`,y=Ue(w,_==="left"&&`${w}-left`,m.className,{[`${w}-wrap`]:!!p});let L=t;const D=s===!0||v!==!1&&s!==!1;D&&!h&&typeof t=="string"&&t.trim()!==""&&(L=t.replace(/[:|:]\s*$/,""));const I=HKe(c);if(I){const{icon:P=x.exports.createElement(WKe,null)}=I,N=VKe(I,["icon"]),M=x.exports.createElement(J$e,Object.assign({},N),x.exports.cloneElement(P,{className:`${e}-item-tooltip`,title:"",onClick:H=>{H.preventDefault()},tabIndex:null}));L=x.exports.createElement(x.exports.Fragment,null,L,M)}const k=l==="optional",R=typeof l=="function";R?L=l(L,{required:!!a}):k&&!a&&(L=x.exports.createElement(x.exports.Fragment,null,L,x.exports.createElement("span",{className:`${e}-item-optional`,title:""},(d==null?void 0:d.optional)||((u=gv.Form)===null||u===void 0?void 0:u.optional))));const A=Ue({[`${e}-item-required`]:a,[`${e}-item-required-mark-optional`]:k||R,[`${e}-item-no-colon`]:!D});return x.exports.createElement(Sve,Object.assign({},m,{className:y}),x.exports.createElement("label",{htmlFor:n,className:A,title:typeof t=="string"?t:""},L))};var zKe=$Ke;const UKe={success:FK,warning:BK,error:lS,validating:xI};function Mve(i){let{children:e,errors:t,warnings:n,hasFeedback:o,validateStatus:r,prefixCls:s,meta:a,noStyle:l}=i;const c=`${s}-item`,{feedbackIcons:u}=x.exports.useContext(op),d=Tve(t,n,a,null,!!o,r),{isFormItemInput:h,status:f,hasFeedback:g,feedbackIcon:p}=x.exports.useContext(zd),v=x.exports.useMemo(()=>{var m;let _;if(o){const y=o!==!0&&o.icons||u,L=d&&((m=y==null?void 0:y({status:d,errors:t,warnings:n}))===null||m===void 0?void 0:m[d]),D=d&&UKe[d];_=L!==!1&&D?x.exports.createElement("span",{className:Ue(`${c}-feedback-icon`,`${c}-feedback-icon-${d}`)},L||x.exports.createElement(D,null)):null}const w={status:d||"",errors:t,warnings:n,hasFeedback:!!o,feedbackIcon:_,isFormItemInput:!0};return l&&(w.status=(d!=null?d:f)||"",w.isFormItemInput=h,w.hasFeedback=!!(o!=null?o:g),w.feedbackIcon=o!==void 0?w.feedbackIcon:p),w},[d,o,l,h,f]);return x.exports.createElement(zd.Provider,{value:v},e)}var jKe=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(i);o{if(I&&y.current){const W=getComputedStyle(y.current);A(parseInt(W.marginBottom,10))}},[I,k]);const P=W=>{W||A(null)},M=function(){let W=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;const F=W?L:c.errors,$=W?D:c.warnings;return Tve(F,$,c,"",!!u,l)}(),H=Ue(_,t,n,{[`${_}-with-help`]:E||L.length||D.length,[`${_}-has-feedback`]:M&&u,[`${_}-has-success`]:M==="success",[`${_}-has-warning`]:M==="warning",[`${_}-has-error`]:M==="error",[`${_}-is-validating`]:M==="validating",[`${_}-hidden`]:d});return x.exports.createElement("div",{className:H,style:o,ref:y},x.exports.createElement(Sje,Object.assign({className:`${_}-row`},Df(m,["_internalItemRender","colon","dependencies","extra","fieldKey","getValueFromEvent","getValueProps","htmlFor","id","initialValue","isListField","label","labelAlign","labelCol","labelWrap","messageVariables","name","normalize","noStyle","preserve","requiredMark","rules","shouldUpdate","trigger","tooltip","validateFirst","validateTrigger","valuePropName","wrapperCol","validateDebounce"])),x.exports.createElement(zKe,Object.assign({htmlFor:f},i,{requiredMark:w,required:g!=null?g:p,prefixCls:e})),x.exports.createElement(PKe,Object.assign({},i,c,{errors:L,warnings:D,prefixCls:e,status:M,help:r,marginBottom:R,onErrorVisibleChanged:P}),x.exports.createElement(Qpe.Provider,{value:v},x.exports.createElement(Mve,{prefixCls:e,meta:c,errors:c.errors,warnings:c.warnings,hasFeedback:u,validateStatus:M},h)))),!!R&&x.exports.createElement("div",{className:`${_}-margin-offset`,style:{marginBottom:-R}}))}const qKe="__SPLIT__";function GKe(i,e){const t=Object.keys(i),n=Object.keys(e);return t.length===n.length&&t.every(o=>{const r=i[o],s=e[o];return r===s||typeof r=="function"||typeof s=="function"})}const XKe=x.exports.memo(i=>{let{children:e}=i;return e},(i,e)=>GKe(i.control,e.control)&&i.update===e.update&&i.childProps.length===e.childProps.length&&i.childProps.every((t,n)=>t===e.childProps[n]));function Die(){return{errors:[],warnings:[],touched:!1,validating:!1,name:[],validated:!1}}function YKe(i){const{name:e,noStyle:t,className:n,dependencies:o,prefixCls:r,shouldUpdate:s,rules:a,children:l,required:c,label:u,messageVariables:d,trigger:h="onChange",validateTrigger:f,hidden:g,help:p}=i,{getPrefixCls:v}=x.exports.useContext(Hi),{name:m}=x.exports.useContext(op),_=kKe(l),w=typeof _=="function",y=x.exports.useContext(Qpe),{validateTrigger:L}=x.exports.useContext(j0),D=f!==void 0?f:L,E=e!=null,I=v("form",r),k=th(I),[R,A,P]=_q(I,k);y4();const N=x.exports.useContext(gD),M=x.exports.useRef(),[H,W]=TKe({}),[F,$]=$m(()=>Die()),z=pe=>{const be=N==null?void 0:N.getKey(pe.name);if($(pe.destroy?Die():pe,!0),t&&p!==!1&&y){let Se=pe.name;if(pe.destroy)Se=M.current||Se;else if(be!==void 0){const[Fe,De]=be;Se=[Fe].concat(_t(De)),M.current=Se}y(pe,Se)}},K=(pe,be)=>{W(Se=>{const Fe=Object.assign({},Se),ce=[].concat(_t(pe.name.slice(0,-1)),_t(be)).join(qKe);return pe.destroy?delete Fe[ce]:Fe[ce]=pe,Fe})},[j,G]=x.exports.useMemo(()=>{const pe=_t(F.errors),be=_t(F.warnings);return Object.values(H).forEach(Se=>{pe.push.apply(pe,_t(Se.errors||[])),be.push.apply(be,_t(Se.warnings||[]))}),[pe,be]},[H,F.errors,F.warnings]),X=NKe();function de(pe,be,Se){return t&&!g?x.exports.createElement(Mve,{prefixCls:I,hasFeedback:i.hasFeedback,validateStatus:i.validateStatus,meta:F,errors:j,warnings:G,noStyle:!0},pe):x.exports.createElement(KKe,Object.assign({key:"row"},i,{className:Ue(n,P,k,A),prefixCls:I,fieldId:be,isRequired:Se,errors:j,warnings:G,meta:F,onSubItemMetaChange:K}),pe)}if(!E&&!w&&!o)return R(de(_));let he={};return typeof u=="string"?he.label=u:e&&(he.label=String(e)),d&&(he=Object.assign(Object.assign({},he),d)),R(x.exports.createElement(YK,Object.assign({},i,{messageVariables:he,trigger:h,validateTrigger:D,onMetaChange:z}),(pe,be,Se)=>{const Fe=rE(e).length&&be?be.name:[],De=Ive(Fe,m),ce=c!==void 0?c:!!(a&&a.some(xe=>{if(xe&&typeof xe=="object"&&xe.required&&!xe.warningOnly)return!0;if(typeof xe=="function"){const Ee=xe(Se);return Ee&&Ee.required&&!Ee.warningOnly}return!1})),Pe=Object.assign({},pe);let Oe=null;if(Array.isArray(_)&&E)Oe=_;else if(!(w&&(!(s||o)||E))){if(!(o&&!w&&!E))if(sy(_)){const xe=Object.assign(Object.assign({},_.props),Pe);if(xe.id||(xe.id=De),p||j.length>0||G.length>0||i.extra){const nt=[];(p||j.length>0)&&nt.push(`${De}_help`),i.extra&&nt.push(`${De}_extra`),xe["aria-describedby"]=nt.join(" ")}j.length>0&&(xe["aria-invalid"]="true"),ce&&(xe["aria-required"]="true"),jv(_)&&(xe.ref=X(Fe,_)),new Set([].concat(_t(rE(h)),_t(rE(D)))).forEach(nt=>{xe[nt]=function(){for(var Qe,Ge,re,ie,se,U=arguments.length,Y=new Array(U),oe=0;oe{var{prefixCls:e,children:t}=i,n=QKe(i,["prefixCls","children"]);const{getPrefixCls:o}=x.exports.useContext(Hi),r=o("form",e),s=x.exports.useMemo(()=>({prefixCls:r,status:"error"}),[r]);return x.exports.createElement(Gpe,Object.assign({},n),(a,l,c)=>x.exports.createElement(QK.Provider,{value:s},t(a.map(u=>Object.assign(Object.assign({},u),{fieldKey:u.key})),l,{errors:c.errors,warnings:c.warnings})))};var eqe=JKe;function tqe(){const{form:i}=x.exports.useContext(op);return i}const fp=DKe;fp.Item=ZKe;fp.List=eqe;fp.ErrorList=kve;fp.useForm=Nve;fp.useFormInstance=tqe;fp.useWatch=Zpe;fp.Provider=Jpe;fp.create=()=>{};var CD=fp;let gu=null,r0=i=>i(),wD=[],yD={};function kie(){const{getContainer:i,duration:e,rtl:t,maxCount:n,top:o}=yD,r=(i==null?void 0:i())||document.body;return{getContainer:()=>r,duration:e,rtl:t,maxCount:n,top:o}}const nqe=Bt.forwardRef((i,e)=>{const{messageConfig:t,sync:n}=i,{getPrefixCls:o}=x.exports.useContext(Hi),r=yD.prefixCls||o("message"),s=x.exports.useContext(sVe),[a,l]=Epe(Object.assign(Object.assign(Object.assign({},t),{prefixCls:r}),s.message));return Bt.useImperativeHandle(e,()=>{const c=Object.assign({},a);return Object.keys(c).forEach(u=>{c[u]=function(){return n(),a[u].apply(a,arguments)}}),{instance:c,sync:n}}),l}),iqe=Bt.forwardRef((i,e)=>{const[t,n]=Bt.useState(kie),o=()=>{n(kie)};Bt.useEffect(o,[]);const r=PK(),s=r.getRootPrefixCls(),a=r.getIconPrefixCls(),l=r.getTheme(),c=fe(nqe,{ref:e,sync:o,messageConfig:t});return fe(hp,{prefixCls:s,iconPrefixCls:a,theme:l,children:r.holderRender?r.holderRender(c):c})});function P4(){if(!gu){const i=document.createDocumentFragment(),e={fragment:i};gu=e,r0(()=>{zK(fe(iqe,{ref:t=>{const{instance:n,sync:o}=t||{};Promise.resolve().then(()=>{!e.instance&&n&&(e.instance=n,e.sync=o,P4())})}}),i)});return}!gu.instance||(wD.forEach(i=>{const{type:e,skipped:t}=i;if(!t)switch(e){case"open":{r0(()=>{const n=gu.instance.open(Object.assign(Object.assign({},yD),i.config));n==null||n.then(i.resolve),i.setCloseFn(n)});break}case"destroy":r0(()=>{gu==null||gu.instance.destroy(i.key)});break;default:r0(()=>{var n;const o=(n=gu.instance)[e].apply(n,_t(i.args));o==null||o.then(i.resolve),i.setCloseFn(o)})}}),wD=[])}function oqe(i){yD=Object.assign(Object.assign({},yD),i),r0(()=>{var e;(e=gu==null?void 0:gu.sync)===null||e===void 0||e.call(gu)})}function rqe(i){const e=$K(t=>{let n;const o={type:"open",config:i,resolve:t,setCloseFn:r=>{n=r}};return wD.push(o),()=>{n?r0(()=>{n()}):o.skipped=!0}});return P4(),e}function sqe(i,e){PK();const t=$K(n=>{let o;const r={type:i,args:e,resolve:n,setCloseFn:s=>{o=s}};return wD.push(r),()=>{o?r0(()=>{o()}):r.skipped=!0}});return P4(),t}function aqe(i){wD.push({type:"destroy",key:i}),P4()}const lqe=["success","info","warning","error","loading"],cqe={open:rqe,destroy:aqe,config:oqe,useMessage:X9e,_InternalPanelDoNotUseOrYouWillBeFired:H9e},Pve=cqe;lqe.forEach(i=>{Pve[i]=function(){for(var e=arguments.length,t=new Array(e),n=0;n{const{prefixCls:e,className:t,closeIcon:n,closable:o,type:r,title:s,children:a,footer:l}=i,c=uqe(i,["prefixCls","className","closeIcon","closable","type","title","children","footer"]),{getPrefixCls:u}=x.exports.useContext(Hi),d=u(),h=e||u("modal"),f=th(d),[g,p,v]=dme(h,f),m=`${h}-confirm`;let _={};return r?_={closable:o!=null?o:!1,title:"",footer:"",children:x.exports.createElement(fme,Object.assign({},i,{prefixCls:h,confirmPrefixCls:m,rootPrefixCls:d,content:a}))}:_={closable:o!=null?o:!0,title:s,footer:l!==null&&x.exports.createElement(nme,Object.assign({},i)),children:a},g(x.exports.createElement($pe,Object.assign({prefixCls:h,className:Ue(p,`${h}-pure-panel`,r&&m,r&&`${m}-${r}`,t,v,f)},c,{closeIcon:tme(h,n),closable:o},_)))};var hqe=yme(dqe);function Ove(i){return kI(vme(i))}const nh=hme;nh.useModal=rVe;nh.info=function(e){return kI(_me(e))};nh.success=function(e){return kI(bme(e))};nh.error=function(e){return kI(Cme(e))};nh.warning=Ove;nh.warn=Ove;nh.confirm=function(e){return kI(wme(e))};nh.destroyAll=function(){for(;o0.length;){const e=o0.pop();e&&e()}};nh.config=eVe;nh._InternalPanelDoNotUseOrYouWillBeFired=hqe;var Fve=nh,bq=x.exports.createContext(null),fqe=function(e){for(var t=e.prefixCls,n=e.level,o=e.isStart,r=e.isEnd,s="".concat(t,"-indent-unit"),a=[],l=0;l=0&&t.splice(n,1),t}function Ap(i,e){var t=(i||[]).slice();return t.indexOf(e)===-1&&t.push(e),t}function Cq(i){return i.split("-")}function _qe(i,e){var t=[],n=yc(e,i);function o(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];r.forEach(function(s){var a=s.key,l=s.children;t.push(a),o(l)})}return o(n.children),t}function bqe(i){if(i.parent){var e=Cq(i.pos);return Number(e[e.length-1])===i.parent.children.length-1}return!1}function Cqe(i){var e=Cq(i.pos);return Number(e[e.length-1])===0}function Nie(i,e,t,n,o,r,s,a,l,c){var u,d=i.clientX,h=i.clientY,f=i.target.getBoundingClientRect(),g=f.top,p=f.height,v=(c==="rtl"?-1:1)*(((o==null?void 0:o.x)||0)-d),m=(v-12)/n,_=yc(a,t.props.eventKey);if(h-1.5?r({dragNode:P,dropNode:N,dropPosition:1})?k=1:M=!1:r({dragNode:P,dropNode:N,dropPosition:0})?k=0:r({dragNode:P,dropNode:N,dropPosition:1})?k=1:M=!1:r({dragNode:P,dropNode:N,dropPosition:1})?k=1:M=!1,{dropPosition:k,dropLevelOffset:R,dropTargetKey:_.key,dropTargetPos:_.pos,dragOverNodeKey:I,dropContainerKey:k===0?null:((u=_.parent)===null||u===void 0?void 0:u.key)||null,dropAllowed:M}}function Rie(i,e){if(!!i){var t=e.multiple;return t?i.slice():i.length?[i[0]]:i}}function x6(i){if(!i)return null;var e;if(Array.isArray(i))e={checkedKeys:i,halfCheckedKeys:void 0};else if(Kn(i)==="object")e={checkedKeys:i.checked||void 0,halfCheckedKeys:i.halfChecked||void 0};else return rr(!1,"`checkedKeys` is not an array or an object"),null;return e}function BW(i,e){var t=new Set;function n(o){if(!t.has(o)){var r=yc(e,o);if(!!r){t.add(o);var s=r.parent,a=r.node;a.disabled||s&&n(s.key)}}}return(i||[]).forEach(function(o){n(o)}),_t(t)}function wqe(i){var e=i.dropPosition,t=i.dropLevelOffset,n=i.indent,o={pointerEvents:"none",position:"absolute",right:0,backgroundColor:"red",height:2};switch(e){case-1:o.top=0,o.left=-t*n;break;case 1:o.bottom=0,o.left=-t*n;break;case 0:o.bottom=0,o.left=n;break}return x.exports.createElement("div",{style:o})}function Bve(i){if(i==null)throw new TypeError("Cannot destructure "+i)}function yqe(i,e){var t=x.exports.useState(!1),n=Ne(t,2),o=n[0],r=n[1];go(function(){if(o)return i(),function(){e()}},[o]),go(function(){return r(!0),function(){r(!1)}},[])}var Sqe=["className","style","motion","motionNodes","motionType","onMotionStart","onMotionEnd","active","treeNodeRequiredProps"],Wve=function(e,t){var n=e.className,o=e.style,r=e.motion,s=e.motionNodes,a=e.motionType,l=e.onMotionStart,c=e.onMotionEnd,u=e.active,d=e.treeNodeRequiredProps,h=Hn(e,Sqe),f=x.exports.useState(!0),g=Ne(f,2),p=g[0],v=g[1],m=x.exports.useContext(bq),_=m.prefixCls,w=s&&a!=="hide";go(function(){s&&w!==p&&v(w)},[s]);var y=function(){s&&l()},L=x.exports.useRef(!1),D=function(){s&&!L.current&&(L.current=!0,c())};yqe(y,D);var E=function(k){w===k&&D()};return s?x.exports.createElement(eh,Ct({ref:t,visible:p},r,{motionAppear:a==="show",onVisibleChanged:E}),function(I,k){var R=I.className,A=I.style;return x.exports.createElement("div",{ref:k,className:Ue("".concat(_,"-treenode-motion"),R),style:A},s.map(function(P){var N=Ct({},(Bve(P.data),P.data)),M=P.title,H=P.key,W=P.isStart,F=P.isEnd;delete N.children;var $=oE(H,d);return x.exports.createElement(ly,Ct({},N,$,{title:M,active:u,data:P.data,key:H,isStart:W,isEnd:F}))}))}):x.exports.createElement(ly,Ct({domRef:t,className:n,style:o},h,{active:u}))};Wve.displayName="MotionTreeNode";var xqe=x.exports.forwardRef(Wve);function Lqe(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],t=i.length,n=e.length;if(Math.abs(t-n)!==1)return{add:!1,key:null};function o(r,s){var a=new Map;r.forEach(function(c){a.set(c,!0)});var l=s.filter(function(c){return!a.has(c)});return l.length===1?l[0]:null}return t ").concat(e);return e}var Hve=x.exports.forwardRef(function(i,e){var t=i.prefixCls,n=i.data;i.selectable,i.checkable;var o=i.expandedKeys,r=i.selectedKeys,s=i.checkedKeys,a=i.loadedKeys,l=i.loadingKeys,c=i.halfCheckedKeys,u=i.keyEntities,d=i.disabled,h=i.dragging,f=i.dragOverNodeKey,g=i.dropPosition,p=i.motion,v=i.height,m=i.itemHeight,_=i.virtual,w=i.focusable,y=i.activeItem,L=i.focused,D=i.tabIndex,E=i.onKeyDown,I=i.onFocus,k=i.onBlur,R=i.onActiveChange,A=i.onListChangeStart,P=i.onListChangeEnd,N=Hn(i,Eqe),M=x.exports.useRef(null),H=x.exports.useRef(null);x.exports.useImperativeHandle(e,function(){return{scrollTo:function(ie){M.current.scrollTo(ie)},getIndentWidth:function(){return H.current.offsetWidth}}});var W=x.exports.useState(o),F=Ne(W,2),$=F[0],z=F[1],K=x.exports.useState(n),j=Ne(K,2),G=j[0],X=j[1],de=x.exports.useState(n),he=Ne(de,2),pe=he[0],be=he[1],Se=x.exports.useState([]),Fe=Ne(Se,2),De=Fe[0],ce=Fe[1],Pe=x.exports.useState(null),Oe=Ne(Pe,2),xe=Oe[0],Ee=Oe[1],tt=x.exports.useRef(n);tt.current=n;function nt(){var re=tt.current;X(re),be(re),ce([]),Ee(null),P()}go(function(){z(o);var re=Lqe($,o);if(re.key!==null)if(re.add){var ie=G.findIndex(function(we){var Le=we.key;return Le===re.key}),se=Oie(Mie(G,n,re.key),_,v,m),U=G.slice();U.splice(ie+1,0,Pie),be(U),ce(se),Ee("show")}else{var Y=n.findIndex(function(we){var Le=we.key;return Le===re.key}),oe=Oie(Mie(n,G,re.key),_,v,m),te=n.slice();te.splice(Y+1,0,Pie),be(te),ce(oe),Ee("hide")}else G!==n&&(X(n),be(n))},[o,n]),x.exports.useEffect(function(){h||nt()},[h]);var Qe=p?pe:n,Ge={expandedKeys:o,selectedKeys:r,loadedKeys:a,loadingKeys:l,checkedKeys:s,halfCheckedKeys:c,dragOverNodeKey:f,dropPosition:g,keyEntities:u};return x.exports.createElement(x.exports.Fragment,null,L&&y&&x.exports.createElement("span",{style:Aie,"aria-live":"assertive"},kqe(y)),x.exports.createElement("div",null,x.exports.createElement("input",{style:Aie,disabled:w===!1||d,tabIndex:w!==!1?D:null,onKeyDown:E,onFocus:I,onBlur:k,value:"",onChange:Dqe,"aria-label":"for screen reader"})),x.exports.createElement("div",{className:"".concat(t,"-treenode"),"aria-hidden":!0,style:{position:"absolute",pointerEvents:"none",visibility:"hidden",height:0,overflow:"hidden",border:0,padding:0}},x.exports.createElement("div",{className:"".concat(t,"-indent")},x.exports.createElement("div",{ref:H,className:"".concat(t,"-indent-unit")}))),x.exports.createElement(oq,Ct({},N,{data:Qe,itemKey:Fie,height:v,fullHeight:!1,virtual:_,itemHeight:m,prefixCls:"".concat(t,"-list"),ref:M,onVisibleChange:function(ie,se){var U=new Set(ie),Y=se.filter(function(oe){return!U.has(oe)});Y.some(function(oe){return Fie(oe)===K0})&&nt()}}),function(re){var ie=re.pos,se=Ct({},(Bve(re.data),re.data)),U=re.title,Y=re.key,oe=re.isStart,te=re.isEnd,we=RI(Y,ie);delete se.key,delete se.children;var Le=oE(we,Ge);return x.exports.createElement(xqe,Ct({},se,Le,{title:U,active:!!y&&Y===y.key,pos:ie,data:re.data,isStart:oe,isEnd:te,motion:p,motionNodes:Y===K0?De:null,motionType:xe,onMotionStart:A,onMotionEnd:nt,treeNodeRequiredProps:Ge,onMouseMove:function(){R(null)}}))}))});Hve.displayName="NodeList";var Iqe=10,wq=function(i){dp(t,i);var e=Mb(t);function t(){var n;fa(this,t);for(var o=arguments.length,r=new Array(o),s=0;s2&&arguments[2]!==void 0?arguments[2]:!1,d=n.state,h=d.dragChildrenKeys,f=d.dropPosition,g=d.dropTargetKey,p=d.dropTargetPos,v=d.dropAllowed;if(!!v){var m=n.props.onDrop;if(n.setState({dragOverNodeKey:null}),n.cleanDragState(),g!==null){var _=Ce(Ce({},oE(g,n.getTreeNodeRequiredProps())),{},{active:((c=n.getActiveItem())===null||c===void 0?void 0:c.key)===g,data:yc(n.state.keyEntities,g).node}),w=h.indexOf(g)!==-1;rr(!w,"Can not drop to dragNode's children node. This is a bug of rc-tree. Please report an issue.");var y=Cq(p),L={event:a,node:Zr(_),dragNode:n.dragNode?Zr(n.dragNode.props):null,dragNodesKeys:[n.dragNode.props.eventKey].concat(h),dropToGap:f!==0,dropPosition:f+Number(y[y.length-1])};u||m==null||m(L),n.dragNode=null}}},n.cleanDragState=function(){var a=n.state.draggingNodeKey;a!==null&&n.setState({draggingNodeKey:null,dropPosition:null,dropContainerKey:null,dropTargetKey:null,dropLevelOffset:null,dropAllowed:!0,dragOverNodeKey:null}),n.dragStartMousePosition=null,n.currentMouseOverDroppableNodeKey=null},n.triggerExpandActionExpand=function(a,l){var c=n.state,u=c.expandedKeys,d=c.flattenNodes,h=l.expanded,f=l.key,g=l.isLeaf;if(!(g||a.shiftKey||a.metaKey||a.ctrlKey)){var p=d.filter(function(m){return m.key===f})[0],v=Zr(Ce(Ce({},oE(f,n.getTreeNodeRequiredProps())),{},{data:p.data}));n.setExpandedKeys(h?Gf(u,f):Ap(u,f)),n.onNodeExpand(a,v)}},n.onNodeClick=function(a,l){var c=n.props,u=c.onClick,d=c.expandAction;d==="click"&&n.triggerExpandActionExpand(a,l),u==null||u(a,l)},n.onNodeDoubleClick=function(a,l){var c=n.props,u=c.onDoubleClick,d=c.expandAction;d==="doubleClick"&&n.triggerExpandActionExpand(a,l),u==null||u(a,l)},n.onNodeSelect=function(a,l){var c=n.state.selectedKeys,u=n.state,d=u.keyEntities,h=u.fieldNames,f=n.props,g=f.onSelect,p=f.multiple,v=l.selected,m=l[h.key],_=!v;_?p?c=Ap(c,m):c=[m]:c=Gf(c,m);var w=c.map(function(y){var L=yc(d,y);return L?L.node:null}).filter(function(y){return y});n.setUncontrolledState({selectedKeys:c}),g==null||g(c,{event:"select",selected:_,node:l,selectedNodes:w,nativeEvent:a.nativeEvent})},n.onNodeCheck=function(a,l,c){var u=n.state,d=u.keyEntities,h=u.checkedKeys,f=u.halfCheckedKeys,g=n.props,p=g.checkStrictly,v=g.onCheck,m=l.key,_,w={event:"check",node:l,checked:c,nativeEvent:a.nativeEvent};if(p){var y=c?Ap(h,m):Gf(h,m),L=Gf(f,m);_={checked:y,halfChecked:L},w.checkedNodes=y.map(function(A){return yc(d,A)}).filter(function(A){return A}).map(function(A){return A.node}),n.setUncontrolledState({checkedKeys:y})}else{var D=_6([].concat(_t(h),[m]),!0,d),E=D.checkedKeys,I=D.halfCheckedKeys;if(!c){var k=new Set(E);k.delete(m);var R=_6(Array.from(k),{checked:!1,halfCheckedKeys:I},d);E=R.checkedKeys,I=R.halfCheckedKeys}_=E,w.checkedNodes=[],w.checkedNodesPositions=[],w.halfCheckedKeys=I,E.forEach(function(A){var P=yc(d,A);if(!!P){var N=P.node,M=P.pos;w.checkedNodes.push(N),w.checkedNodesPositions.push({node:N,pos:M})}}),n.setUncontrolledState({checkedKeys:E},!1,{halfCheckedKeys:I})}v==null||v(_,w)},n.onNodeLoad=function(a){var l=a.key,c=new Promise(function(u,d){n.setState(function(h){var f=h.loadedKeys,g=f===void 0?[]:f,p=h.loadingKeys,v=p===void 0?[]:p,m=n.props,_=m.loadData,w=m.onLoad;if(!_||g.indexOf(l)!==-1||v.indexOf(l)!==-1)return null;var y=_(a);return y.then(function(){var L=n.state.loadedKeys,D=Ap(L,l);w==null||w(D,{event:"load",node:a}),n.setUncontrolledState({loadedKeys:D}),n.setState(function(E){return{loadingKeys:Gf(E.loadingKeys,l)}}),u()}).catch(function(L){if(n.setState(function(E){return{loadingKeys:Gf(E.loadingKeys,l)}}),n.loadingRetryTimes[l]=(n.loadingRetryTimes[l]||0)+1,n.loadingRetryTimes[l]>=Iqe){var D=n.state.loadedKeys;rr(!1,"Retry for `loadData` many times but still failed. No more retry."),n.setUncontrolledState({loadedKeys:Ap(D,l)}),u()}d(L)}),{loadingKeys:Ap(v,l)}})});return c.catch(function(){}),c},n.onNodeMouseEnter=function(a,l){var c=n.props.onMouseEnter;c==null||c({event:a,node:l})},n.onNodeMouseLeave=function(a,l){var c=n.props.onMouseLeave;c==null||c({event:a,node:l})},n.onNodeContextMenu=function(a,l){var c=n.props.onRightClick;c&&(a.preventDefault(),c({event:a,node:l}))},n.onFocus=function(){var a=n.props.onFocus;n.setState({focused:!0});for(var l=arguments.length,c=new Array(l),u=0;u1&&arguments[1]!==void 0?arguments[1]:!1,c=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;if(!n.destroyed){var u=!1,d=!0,h={};Object.keys(a).forEach(function(f){if(f in n.props){d=!1;return}u=!0,h[f]=a[f]}),u&&(!l||d)&&n.setState(Ce(Ce({},h),c))}},n.scrollTo=function(a){n.listRef.current.scrollTo(a)},n}return ga(t,[{key:"componentDidMount",value:function(){this.destroyed=!1,this.onUpdated()}},{key:"componentDidUpdate",value:function(){this.onUpdated()}},{key:"onUpdated",value:function(){var o=this.props,r=o.activeKey,s=o.itemScrollOffset,a=s===void 0?0:s;r!==void 0&&r!==this.state.activeKey&&(this.setState({activeKey:r}),r!==null&&this.scrollTo({key:r,offset:a}))}},{key:"componentWillUnmount",value:function(){window.removeEventListener("dragend",this.onWindowDragEnd),this.destroyed=!0}},{key:"resetDragState",value:function(){this.setState({dragOverNodeKey:null,dropPosition:null,dropLevelOffset:null,dropTargetKey:null,dropContainerKey:null,dropTargetPos:null,dropAllowed:!1})}},{key:"render",value:function(){var o,r=this.state,s=r.focused,a=r.flattenNodes,l=r.keyEntities,c=r.draggingNodeKey,u=r.activeKey,d=r.dropLevelOffset,h=r.dropContainerKey,f=r.dropTargetKey,g=r.dropPosition,p=r.dragOverNodeKey,v=r.indent,m=this.props,_=m.prefixCls,w=m.className,y=m.style,L=m.showLine,D=m.focusable,E=m.tabIndex,I=E===void 0?0:E,k=m.selectable,R=m.showIcon,A=m.icon,P=m.switcherIcon,N=m.draggable,M=m.checkable,H=m.checkStrictly,W=m.disabled,F=m.motion,$=m.loadData,z=m.filterTreeNode,K=m.height,j=m.itemHeight,G=m.virtual,X=m.titleRender,de=m.dropIndicatorRender,he=m.onContextMenu,pe=m.onScroll,be=m.direction,Se=m.rootClassName,Fe=m.rootStyle,De=z0(this.props,{aria:!0,data:!0}),ce;return N&&(Kn(N)==="object"?ce=N:typeof N=="function"?ce={nodeDraggable:N}:ce={}),x.exports.createElement(bq.Provider,{value:{prefixCls:_,selectable:k,showIcon:R,icon:A,switcherIcon:P,draggable:ce,draggingNodeKey:c,checkable:M,checkStrictly:H,disabled:W,keyEntities:l,dropLevelOffset:d,dropContainerKey:h,dropTargetKey:f,dropPosition:g,dragOverNodeKey:p,indent:v,direction:be,dropIndicatorRender:de,loadData:$,filterTreeNode:z,titleRender:X,onNodeClick:this.onNodeClick,onNodeDoubleClick:this.onNodeDoubleClick,onNodeExpand:this.onNodeExpand,onNodeSelect:this.onNodeSelect,onNodeCheck:this.onNodeCheck,onNodeLoad:this.onNodeLoad,onNodeMouseEnter:this.onNodeMouseEnter,onNodeMouseLeave:this.onNodeMouseLeave,onNodeContextMenu:this.onNodeContextMenu,onNodeDragStart:this.onNodeDragStart,onNodeDragEnter:this.onNodeDragEnter,onNodeDragOver:this.onNodeDragOver,onNodeDragLeave:this.onNodeDragLeave,onNodeDragEnd:this.onNodeDragEnd,onNodeDrop:this.onNodeDrop}},x.exports.createElement("div",{role:"tree",className:Ue(_,w,Se,(o={},me(o,"".concat(_,"-show-line"),L),me(o,"".concat(_,"-focused"),s),me(o,"".concat(_,"-active-focused"),u!==null),o)),style:Fe},x.exports.createElement(Hve,Ct({ref:this.listRef,prefixCls:_,style:y,data:a,disabled:W,selectable:k,checkable:!!M,motion:F,dragging:c!==null,height:K,itemHeight:j,virtual:G,focusable:D,focused:s,tabIndex:I,activeItem:this.getActiveItem(),onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:this.onKeyDown,onActiveChange:this.onActiveChange,onListChangeStart:this.onListChangeStart,onListChangeEnd:this.onListChangeEnd,onContextMenu:he,onScroll:pe},this.getTreeNodeRequiredProps(),De))))}}],[{key:"getDerivedStateFromProps",value:function(o,r){var s=r.prevProps,a={prevProps:o};function l(D){return!s&&D in o||s&&s[D]!==o[D]}var c,u=r.fieldNames;if(l("fieldNames")&&(u=ay(o.fieldNames),a.fieldNames=u),l("treeData")?c=o.treeData:l("children")&&(rr(!1,"`children` of Tree is deprecated. Please use `treeData` instead."),c=_ve(o.children)),c){a.treeData=c;var d=bve(c,{fieldNames:u});a.keyEntities=Ce(me({},K0,Vve),d.keyEntities)}var h=a.keyEntities||r.keyEntities;if(l("expandedKeys")||s&&l("autoExpandParent"))a.expandedKeys=o.autoExpandParent||!s&&o.defaultExpandParent?BW(o.expandedKeys,h):o.expandedKeys;else if(!s&&o.defaultExpandAll){var f=Ce({},h);delete f[K0],a.expandedKeys=Object.keys(f).map(function(D){return f[D].key})}else!s&&o.defaultExpandedKeys&&(a.expandedKeys=o.autoExpandParent||o.defaultExpandParent?BW(o.defaultExpandedKeys,h):o.defaultExpandedKeys);if(a.expandedKeys||delete a.expandedKeys,c||a.expandedKeys){var g=v6(c||r.treeData,a.expandedKeys||r.expandedKeys,u);a.flattenNodes=g}if(o.selectable&&(l("selectedKeys")?a.selectedKeys=Rie(o.selectedKeys,o):!s&&o.defaultSelectedKeys&&(a.selectedKeys=Rie(o.defaultSelectedKeys,o))),o.checkable){var p;if(l("checkedKeys")?p=x6(o.checkedKeys)||{}:!s&&o.defaultCheckedKeys?p=x6(o.defaultCheckedKeys)||{}:c&&(p=x6(o.checkedKeys)||{checkedKeys:r.checkedKeys,halfCheckedKeys:r.halfCheckedKeys}),p){var v=p,m=v.checkedKeys,_=m===void 0?[]:m,w=v.halfCheckedKeys,y=w===void 0?[]:w;if(!o.checkStrictly){var L=_6(_,!0,h);_=L.checkedKeys,y=L.halfCheckedKeys}a.checkedKeys=_,a.halfCheckedKeys=y}}return l("loadedKeys")&&(a.loadedKeys=o.loadedKeys),a}}]),t}(x.exports.Component);wq.defaultProps={prefixCls:"rc-tree",showLine:!1,showIcon:!0,selectable:!0,multiple:!1,checkable:!1,disabled:!1,checkStrictly:!1,draggable:!1,defaultExpandParent:!0,autoExpandParent:!1,defaultExpandAll:!1,defaultExpandedKeys:[],defaultCheckedKeys:[],defaultSelectedKeys:[],dropIndicatorRender:wqe,allowDrop:function(){return!0},expandAction:!1};wq.TreeNode=ly;var Tqe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0042 42h216v494z"}}]},name:"file",theme:"outlined"},Nqe=Tqe,Rqe=function(e,t){return x.exports.createElement(cr,Ct({},e,{ref:t,icon:Nqe}))},$ve=x.exports.forwardRef(Rqe),Mqe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M928 444H820V330.4c0-17.7-14.3-32-32-32H473L355.7 186.2a8.15 8.15 0 00-5.5-2.2H96c-17.7 0-32 14.3-32 32v592c0 17.7 14.3 32 32 32h698c13 0 24.8-7.9 29.7-20l134-332c1.5-3.8 2.3-7.9 2.3-12 0-17.7-14.3-32-32-32zM136 256h188.5l119.6 114.4H748V444H238c-13 0-24.8 7.9-29.7 20L136 643.2V256zm635.3 512H159l103.3-256h612.4L771.3 768z"}}]},name:"folder-open",theme:"outlined"},Aqe=Mqe,Pqe=function(e,t){return x.exports.createElement(cr,Ct({},e,{ref:t,icon:Aqe}))},Oqe=x.exports.forwardRef(Pqe),Fqe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880 298.4H521L403.7 186.2a8.15 8.15 0 00-5.5-2.2H144c-17.7 0-32 14.3-32 32v592c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V330.4c0-17.7-14.3-32-32-32zM840 768H184V256h188.5l119.6 114.4H840V768z"}}]},name:"folder",theme:"outlined"},Bqe=Fqe,Wqe=function(e,t){return x.exports.createElement(cr,Ct({},e,{ref:t,icon:Bqe}))},Vqe=x.exports.forwardRef(Wqe),Hqe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M300 276.5a56 56 0 1056-97 56 56 0 00-56 97zm0 284a56 56 0 1056-97 56 56 0 00-56 97zM640 228a56 56 0 10112 0 56 56 0 00-112 0zm0 284a56 56 0 10112 0 56 56 0 00-112 0zM300 844.5a56 56 0 1056-97 56 56 0 00-56 97zM640 796a56 56 0 10112 0 56 56 0 00-112 0z"}}]},name:"holder",theme:"outlined"},$qe=Hqe,zqe=function(e,t){return x.exports.createElement(cr,Ct({},e,{ref:t,icon:$qe}))},Uqe=x.exports.forwardRef(zqe);const jqe=new ji("ant-tree-node-fx-do-not-use",{"0%":{opacity:0},"100%":{opacity:1}}),Kqe=(i,e)=>({[`.${i}-switcher-icon`]:{display:"inline-block",fontSize:10,verticalAlign:"baseline",svg:{transition:`transform ${e.motionDurationSlow}`}}}),qqe=(i,e)=>({[`.${i}-drop-indicator`]:{position:"absolute",zIndex:1,height:2,backgroundColor:e.colorPrimary,borderRadius:1,pointerEvents:"none","&:after":{position:"absolute",top:-3,insetInlineStart:-6,width:8,height:8,backgroundColor:"transparent",border:`${rt(e.lineWidthBold)} solid ${e.colorPrimary}`,borderRadius:"50%",content:'""'}}}),Gqe=(i,e)=>{const{treeCls:t,treeNodeCls:n,treeNodePadding:o,titleHeight:r,nodeSelectedBg:s,nodeHoverBg:a}=e,l=e.paddingXS;return{[t]:Object.assign(Object.assign({},Aa(e)),{background:e.colorBgContainer,borderRadius:e.borderRadius,transition:`background-color ${e.motionDurationSlow}`,[`&${t}-rtl`]:{[`${t}-switcher`]:{"&_close":{[`${t}-switcher-icon`]:{svg:{transform:"rotate(90deg)"}}}}},[`&-focused:not(:hover):not(${t}-active-focused)`]:Object.assign({},NK(e)),[`${t}-list-holder-inner`]:{alignItems:"flex-start"},[`&${t}-block-node`]:{[`${t}-list-holder-inner`]:{alignItems:"stretch",[`${t}-node-content-wrapper`]:{flex:"auto"},[`${n}.dragging`]:{position:"relative","&:after":{position:"absolute",top:0,insetInlineEnd:0,bottom:o,insetInlineStart:0,border:`1px solid ${e.colorPrimary}`,opacity:0,animationName:jqe,animationDuration:e.motionDurationSlow,animationPlayState:"running",animationFillMode:"forwards",content:'""',pointerEvents:"none"}}}},[`${n}`]:{display:"flex",alignItems:"flex-start",padding:`0 0 ${rt(o)} 0`,outline:"none","&-rtl":{direction:"rtl"},"&-disabled":{[`${t}-node-content-wrapper`]:{color:e.colorTextDisabled,cursor:"not-allowed","&:hover":{background:"transparent"}}},[`&-active ${t}-node-content-wrapper`]:{background:e.controlItemBgHover},[`&:not(${n}-disabled).filter-node ${t}-title`]:{color:"inherit",fontWeight:500},"&-draggable":{cursor:"grab",[`${t}-draggable-icon`]:{flexShrink:0,width:r,lineHeight:`${rt(r)}`,textAlign:"center",visibility:"visible",opacity:.2,transition:`opacity ${e.motionDurationSlow}`,[`${n}:hover &`]:{opacity:.45}},[`&${n}-disabled`]:{[`${t}-draggable-icon`]:{visibility:"hidden"}}}},[`${t}-indent`]:{alignSelf:"stretch",whiteSpace:"nowrap",userSelect:"none","&-unit":{display:"inline-block",width:r}},[`${t}-draggable-icon`]:{visibility:"hidden"},[`${t}-switcher`]:Object.assign(Object.assign({},Kqe(i,e)),{position:"relative",flex:"none",alignSelf:"stretch",width:r,margin:0,lineHeight:`${rt(r)}`,textAlign:"center",cursor:"pointer",userSelect:"none",transition:`all ${e.motionDurationSlow}`,borderRadius:e.borderRadius,"&-noop":{cursor:"unset"},[`&:not(${t}-switcher-noop):hover`]:{backgroundColor:e.colorBgTextHover},"&_close":{[`${t}-switcher-icon`]:{svg:{transform:"rotate(-90deg)"}}},"&-loading-icon":{color:e.colorPrimary},"&-leaf-line":{position:"relative",zIndex:1,display:"inline-block",width:"100%",height:"100%","&:before":{position:"absolute",top:0,insetInlineEnd:e.calc(r).div(2).equal(),bottom:e.calc(o).mul(-1).equal(),marginInlineStart:-1,borderInlineEnd:`1px solid ${e.colorBorder}`,content:'""'},"&:after":{position:"absolute",width:e.calc(e.calc(r).div(2).equal()).mul(.8).equal(),height:e.calc(r).div(2).equal(),borderBottom:`1px solid ${e.colorBorder}`,content:'""'}}}),[`${t}-checkbox`]:{top:"initial",marginInlineEnd:l,alignSelf:"flex-start",marginTop:e.marginXXS},[`${t}-node-content-wrapper, ${t}-checkbox + span`]:{position:"relative",zIndex:"auto",minHeight:r,margin:0,padding:`0 ${rt(e.calc(e.paddingXS).div(2).equal())}`,color:"inherit",lineHeight:`${rt(r)}`,background:"transparent",borderRadius:e.borderRadius,cursor:"pointer",transition:`all ${e.motionDurationMid}, border 0s, line-height 0s, box-shadow 0s`,"&:hover":{backgroundColor:a},[`&${t}-node-selected`]:{backgroundColor:s},[`${t}-iconEle`]:{display:"inline-block",width:r,height:r,lineHeight:`${rt(r)}`,textAlign:"center",verticalAlign:"top","&:empty":{display:"none"}}},[`${t}-unselectable ${t}-node-content-wrapper:hover`]:{backgroundColor:"transparent"},[`${t}-node-content-wrapper`]:Object.assign({lineHeight:`${rt(r)}`,userSelect:"none"},qqe(i,e)),[`${n}.drop-container`]:{"> [draggable]":{boxShadow:`0 0 0 2px ${e.colorPrimary}`}},"&-show-line":{[`${t}-indent`]:{"&-unit":{position:"relative",height:"100%","&:before":{position:"absolute",top:0,insetInlineEnd:e.calc(r).div(2).equal(),bottom:e.calc(o).mul(-1).equal(),borderInlineEnd:`1px solid ${e.colorBorder}`,content:'""'},"&-end":{"&:before":{display:"none"}}}},[`${t}-switcher`]:{background:"transparent","&-line-icon":{verticalAlign:"-0.15em"}}},[`${n}-leaf-last`]:{[`${t}-switcher`]:{"&-leaf-line":{"&:before":{top:"auto !important",bottom:"auto !important",height:`${rt(e.calc(r).div(2).equal())} !important`}}}}})}},Xqe=i=>{const{treeCls:e,treeNodeCls:t,treeNodePadding:n,directoryNodeSelectedBg:o,directoryNodeSelectedColor:r}=i;return{[`${e}${e}-directory`]:{[t]:{position:"relative","&:before":{position:"absolute",top:0,insetInlineEnd:0,bottom:n,insetInlineStart:0,transition:`background-color ${i.motionDurationMid}`,content:'""',pointerEvents:"none"},"&:hover":{"&:before":{background:i.controlItemBgHover}},"> *":{zIndex:1},[`${e}-switcher`]:{transition:`color ${i.motionDurationMid}`},[`${e}-node-content-wrapper`]:{borderRadius:0,userSelect:"none","&:hover":{background:"transparent"},[`&${e}-node-selected`]:{color:r,background:"transparent"}},"&-selected":{[` + .${n}-col-xl-24${t}-label`]:lC(i),[`@media (max-width: ${rt(i.screenXSMax)})`]:[EKe(i),{[e]:{[`.${n}-col-xs-24${t}-label`]:lC(i)}}],[`@media (max-width: ${rt(i.screenSMMax)})`]:{[e]:{[`.${n}-col-sm-24${t}-label`]:lC(i)}},[`@media (max-width: ${rt(i.screenMDMax)})`]:{[e]:{[`.${n}-col-md-24${t}-label`]:lC(i)}},[`@media (max-width: ${rt(i.screenLGMax)})`]:{[e]:{[`.${n}-col-lg-24${t}-label`]:lC(i)}}}},kKe=i=>({labelRequiredMarkColor:i.colorError,labelColor:i.colorTextHeading,labelFontSize:i.fontSize,labelHeight:i.controlHeight,labelColonMarginInlineStart:i.marginXXS/2,labelColonMarginInlineEnd:i.marginXS,itemMarginBottom:i.marginLG,verticalLabelPadding:`0 0 ${i.paddingXS}px`,verticalLabelMargin:0}),Ave=(i,e)=>lr(i,{formItemCls:`${i.componentCls}-item`,rootPrefixCls:e});var wq=jc("Form",(i,e)=>{let{rootPrefixCls:t}=e;const n=Ave(i,t);return[wKe(n),SKe(n),CKe(n),xKe(n),LKe(n),DKe(n),pme(n),iq]},kKe,{order:-1e3});const Mie=[];function S6(i,e,t){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0;return{key:typeof i=="string"?i:`${e}-${n}`,error:i,errorStatus:t}}const IKe=i=>{let{help:e,helpStatus:t,errors:n=Mie,warnings:o=Mie,className:r,fieldId:s,onVisibleChanged:a}=i;const{prefixCls:l}=x.exports.useContext(nq),c=`${l}-item-explain`,u=nh(l),[d,h,f]=wq(l,u),g=x.exports.useMemo(()=>mW(l),[l]),p=NA(n),v=NA(o),m=x.exports.useMemo(()=>e!=null?[S6(e,"help",t)]:[].concat(_t(p.map((y,w)=>S6(y,"error","error",w))),_t(v.map((y,w)=>S6(y,"warning","warning",w)))),[e,t,p,v]),_={};return s&&(_.id=`${s}_help`),d(x.exports.createElement(th,{motionDeadline:g.motionDeadline,motionName:`${l}-show-help`,visible:!!m.length,onVisibleChanged:a},y=>{const{className:w,style:L}=y;return x.exports.createElement("div",Object.assign({},_,{className:Ue(c,w,f,u,r,h),style:L,role:"alert"}),x.exports.createElement(_pe,Object.assign({keys:m},mW(l),{motionName:`${l}-show-help-item`,component:!1}),D=>{const{key:E,error:I,errorStatus:k,className:R,style:A}=D;return x.exports.createElement("div",{key:E,className:Ue(R,{[`${c}-${k}`]:k}),style:A},I)}))}))};var Pve=IKe;const TKe=["parentNode"],NKe="form_item";function sE(i){return i===void 0||i===!1?[]:Array.isArray(i)?i:[i]}function Ove(i,e){if(!i.length)return;const t=i.join("_");return e?`${e}_${t}`:TKe.includes(t)?`${NKe}_${t}`:t}function Fve(i,e,t,n,o,r){let s=n;return r!==void 0?s=r:t.validating?s="validating":i.length?s="error":e.length?s="warning":(t.touched||o&&t.validated)&&(s="success"),s}function Aie(i){return sE(i).join("_")}function Bve(i){const[e]=tq(),t=x.exports.useRef({}),n=x.exports.useMemo(()=>i!=null?i:Object.assign(Object.assign({},e),{__INTERNAL__:{itemRef:o=>r=>{const s=Aie(o);r?t.current[s]=r:delete t.current[s]}},scrollToField:function(o){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const s=sE(o),a=Ove(s,n.__INTERNAL__.name),l=a?document.getElementById(a):null;l&&E9e(l,Object.assign({scrollMode:"if-needed",block:"nearest"},r))},getFieldInstance:o=>{const r=Aie(o);return t.current[r]}}),[i,e]);return[n]}var RKe=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(i);o{const t=x.exports.useContext(lS),{getPrefixCls:n,direction:o,form:r}=x.exports.useContext(Hi),{prefixCls:s,className:a,rootClassName:l,size:c,disabled:u=t,form:d,colon:h,labelAlign:f,labelWrap:g,labelCol:p,wrapperCol:v,hideRequiredMark:m,layout:_="horizontal",scrollToFirstError:y,requiredMark:w,onFinishFailed:L,name:D,style:E,feedbackIcons:I,variant:k}=i,R=RKe(i,["prefixCls","className","rootClassName","size","disabled","form","colon","labelAlign","labelWrap","labelCol","wrapperCol","hideRequiredMark","layout","scrollToFirstError","requiredMark","onFinishFailed","name","style","feedbackIcons","variant"]),A=Ob(c),P=x.exports.useContext(Hge),N=x.exports.useMemo(()=>w!==void 0?w:m?!1:r&&r.requiredMark!==void 0?r.requiredMark:!0,[m,w,r]),M=h!=null?h:r==null?void 0:r.colon,H=n("form",s),B=nh(H),[F,$,z]=wq(H,B),K=Ue(H,`${H}-${_}`,{[`${H}-hide-required-mark`]:N===!1,[`${H}-rtl`]:o==="rtl",[`${H}-${A}`]:A},z,B,$,r==null?void 0:r.className,a,l),[j]=Bve(d),{__INTERNAL__:G}=j;G.name=D;const X=x.exports.useMemo(()=>({name:D,labelAlign:f,labelCol:p,labelWrap:g,wrapperCol:v,vertical:_==="vertical",colon:M,requiredMark:N,itemRef:G.itemRef,form:j,feedbackIcons:I}),[D,f,p,v,_,M,N,j,I]);x.exports.useImperativeHandle(e,()=>j);const de=(pe,be)=>{if(pe){let Se={block:"nearest"};typeof pe=="object"&&(Se=pe),j.scrollToField(be,Se)}},fe=pe=>{if(L==null||L(pe),pe.errorFields.length){const be=pe.errorFields[0].name;if(y!==void 0){de(y,be);return}r&&r.scrollToFirstError!==void 0&&de(r.scrollToFirstError,be)}};return F(x.exports.createElement(ame.Provider,{value:k},x.exports.createElement(MK,{disabled:u},x.exports.createElement(LI.Provider,{value:A},x.exports.createElement(sme,{validateMessages:P},x.exports.createElement(rp.Provider,{value:X},x.exports.createElement(dS,Object.assign({id:D},R,{name:D,onFinishFailed:fe,form:j,style:Object.assign(Object.assign({},r==null?void 0:r.style),E),className:K}))))))))},AKe=x.exports.forwardRef(MKe);var PKe=AKe;function OKe(i){if(typeof i=="function")return i;const e=ip(i);return e.length<=1?e[0]:e}const Wve=()=>{const{status:i,errors:e=[],warnings:t=[]}=x.exports.useContext(Ud);return{status:i,errors:e,warnings:t}};Wve.Context=Ud;var FKe=Wve;function BKe(i){const[e,t]=x.exports.useState(i),n=x.exports.useRef(null),o=x.exports.useRef([]),r=x.exports.useRef(!1);x.exports.useEffect(()=>(r.current=!1,()=>{r.current=!0,Xi.cancel(n.current),n.current=null}),[]);function s(a){r.current||(n.current===null&&(o.current=[],n.current=Xi(()=>{n.current=null,t(l=>{let c=l;return o.current.forEach(u=>{c=u(c)}),c})})),o.current.push(a))}return[e,s]}function WKe(){const{itemRef:i}=x.exports.useContext(rp),e=x.exports.useRef({});function t(n,o){const r=o&&typeof o=="object"&&o.ref,s=n.join("_");return(e.current.name!==s||e.current.originRef!==r)&&(e.current.name=s,e.current.originRef=r,e.current.ref=eh(i(n),r)),e.current.ref}return t}const VKe=i=>{const{formItemCls:e}=i;return{"@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none)":{[`${e}-control`]:{display:"flex"}}}};var HKe=FK(["Form","item-item"],(i,e)=>{let{rootPrefixCls:t}=e;const n=Ave(i,t);return[VKe(n)]});const $Ke=i=>{const{prefixCls:e,status:t,wrapperCol:n,children:o,errors:r,warnings:s,_internalItemRender:a,extra:l,help:c,fieldId:u,marginBottom:d,onErrorVisibleChanged:h}=i,f=`${e}-item`,g=x.exports.useContext(rp),p=n||g.wrapperCol||{},v=Ue(`${f}-control`,p.className),m=x.exports.useMemo(()=>Object.assign({},g),[g]);delete m.labelCol,delete m.wrapperCol;const _=x.exports.createElement("div",{className:`${f}-control-input`},x.exports.createElement("div",{className:`${f}-control-input-content`},o)),y=x.exports.useMemo(()=>({prefixCls:e,status:t}),[e,t]),w=d!==null||r.length||s.length?x.exports.createElement("div",{style:{display:"flex",flexWrap:"nowrap"}},x.exports.createElement(nq.Provider,{value:y},x.exports.createElement(Pve,{fieldId:u,errors:r,warnings:s,help:c,helpStatus:t,className:`${f}-explain-connected`,onVisibleChanged:h})),!!d&&x.exports.createElement("div",{style:{width:0,height:d}})):null,L={};u&&(L.id=`${u}_extra`);const D=l?x.exports.createElement("div",Object.assign({},L,{className:`${f}-extra`}),l):null,E=a&&a.mark==="pro_table_render"&&a.render?a.render(i,{input:_,errorList:w,extra:D}):x.exports.createElement(x.exports.Fragment,null,_,w,D);return x.exports.createElement(rp.Provider,{value:m},x.exports.createElement(Tve,Object.assign({},p,{className:v}),E),x.exports.createElement(HKe,{prefixCls:e}))};var zKe=$Ke,UKe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}},{tag:"path",attrs:{d:"M623.6 316.7C593.6 290.4 554 276 512 276s-81.6 14.5-111.6 40.7C369.2 344 352 380.7 352 420v7.6c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V420c0-44.1 43.1-80 96-80s96 35.9 96 80c0 31.1-22 59.6-56.1 72.7-21.2 8.1-39.2 22.3-52.1 40.9-13.1 19-19.9 41.8-19.9 64.9V620c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8v-22.7a48.3 48.3 0 0130.9-44.8c59-22.7 97.1-74.7 97.1-132.5.1-39.3-17.1-76-48.3-103.3zM472 732a40 40 0 1080 0 40 40 0 10-80 0z"}}]},name:"question-circle",theme:"outlined"},jKe=UKe,KKe=function(e,t){return x.exports.createElement(cr,yt({},e,{ref:t,icon:jKe}))},qKe=x.exports.forwardRef(KKe),GKe=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(i);o{let{prefixCls:e,label:t,htmlFor:n,labelCol:o,labelAlign:r,colon:s,required:a,requiredMark:l,tooltip:c}=i;var u;const[d]=xI("Form"),{vertical:h,labelAlign:f,labelCol:g,labelWrap:p,colon:v}=x.exports.useContext(rp);if(!t)return null;const m=o||g||{},_=r||f,y=`${e}-item-label`,w=Ue(y,_==="left"&&`${y}-left`,m.className,{[`${y}-wrap`]:!!p});let L=t;const D=s===!0||v!==!1&&s!==!1;D&&!h&&typeof t=="string"&&t.trim()!==""&&(L=t.replace(/[:|:]\s*$/,""));const I=XKe(c);if(I){const{icon:P=x.exports.createElement(qKe,null)}=I,N=GKe(I,["icon"]),M=x.exports.createElement(aze,Object.assign({},N),x.exports.cloneElement(P,{className:`${e}-item-tooltip`,title:"",onClick:H=>{H.preventDefault()},tabIndex:null}));L=x.exports.createElement(x.exports.Fragment,null,L,M)}const k=l==="optional",R=typeof l=="function";R?L=l(L,{required:!!a}):k&&!a&&(L=x.exports.createElement(x.exports.Fragment,null,L,x.exports.createElement("span",{className:`${e}-item-optional`,title:""},(d==null?void 0:d.optional)||((u=pv.Form)===null||u===void 0?void 0:u.optional))));const A=Ue({[`${e}-item-required`]:a,[`${e}-item-required-mark-optional`]:k||R,[`${e}-item-no-colon`]:!D});return x.exports.createElement(Tve,Object.assign({},m,{className:w}),x.exports.createElement("label",{htmlFor:n,className:A,title:typeof t=="string"?t:""},L))};var ZKe=YKe;const QKe={success:HK,warning:$K,error:cS,validating:EI};function Vve(i){let{children:e,errors:t,warnings:n,hasFeedback:o,validateStatus:r,prefixCls:s,meta:a,noStyle:l}=i;const c=`${s}-item`,{feedbackIcons:u}=x.exports.useContext(rp),d=Fve(t,n,a,null,!!o,r),{isFormItemInput:h,status:f,hasFeedback:g,feedbackIcon:p}=x.exports.useContext(Ud),v=x.exports.useMemo(()=>{var m;let _;if(o){const w=o!==!0&&o.icons||u,L=d&&((m=w==null?void 0:w({status:d,errors:t,warnings:n}))===null||m===void 0?void 0:m[d]),D=d&&QKe[d];_=L!==!1&&D?x.exports.createElement("span",{className:Ue(`${c}-feedback-icon`,`${c}-feedback-icon-${d}`)},L||x.exports.createElement(D,null)):null}const y={status:d||"",errors:t,warnings:n,hasFeedback:!!o,feedbackIcon:_,isFormItemInput:!0};return l&&(y.status=(d!=null?d:f)||"",y.isFormItemInput=h,y.hasFeedback=!!(o!=null?o:g),y.feedbackIcon=o!==void 0?y.feedbackIcon:p),y},[d,o,l,h,f]);return x.exports.createElement(Ud.Provider,{value:v},e)}var JKe=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(i);o{if(I&&w.current){const B=getComputedStyle(w.current);A(parseInt(B.marginBottom,10))}},[I,k]);const P=B=>{B||A(null)},M=function(){let B=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;const F=B?L:c.errors,$=B?D:c.warnings;return Fve(F,$,c,"",!!u,l)}(),H=Ue(_,t,n,{[`${_}-with-help`]:E||L.length||D.length,[`${_}-has-feedback`]:M&&u,[`${_}-has-success`]:M==="success",[`${_}-has-warning`]:M==="warning",[`${_}-has-error`]:M==="error",[`${_}-is-validating`]:M==="validating",[`${_}-hidden`]:d});return x.exports.createElement("div",{className:H,style:o,ref:w},x.exports.createElement(Nje,Object.assign({className:`${_}-row`},kf(m,["_internalItemRender","colon","dependencies","extra","fieldKey","getValueFromEvent","getValueProps","htmlFor","id","initialValue","isListField","label","labelAlign","labelCol","labelWrap","messageVariables","name","normalize","noStyle","preserve","requiredMark","rules","shouldUpdate","trigger","tooltip","validateFirst","validateTrigger","valuePropName","wrapperCol","validateDebounce"])),x.exports.createElement(ZKe,Object.assign({htmlFor:f},i,{requiredMark:y,required:g!=null?g:p,prefixCls:e})),x.exports.createElement(zKe,Object.assign({},i,c,{errors:L,warnings:D,prefixCls:e,status:M,help:r,marginBottom:R,onErrorVisibleChanged:P}),x.exports.createElement(rme.Provider,{value:v},x.exports.createElement(Vve,{prefixCls:e,meta:c,errors:c.errors,warnings:c.warnings,hasFeedback:u,validateStatus:M},h)))),!!R&&x.exports.createElement("div",{className:`${_}-margin-offset`,style:{marginBottom:-R}}))}const tqe="__SPLIT__";function nqe(i,e){const t=Object.keys(i),n=Object.keys(e);return t.length===n.length&&t.every(o=>{const r=i[o],s=e[o];return r===s||typeof r=="function"||typeof s=="function"})}const iqe=x.exports.memo(i=>{let{children:e}=i;return e},(i,e)=>nqe(i.control,e.control)&&i.update===e.update&&i.childProps.length===e.childProps.length&&i.childProps.every((t,n)=>t===e.childProps[n]));function Pie(){return{errors:[],warnings:[],touched:!1,validating:!1,name:[],validated:!1}}function oqe(i){const{name:e,noStyle:t,className:n,dependencies:o,prefixCls:r,shouldUpdate:s,rules:a,children:l,required:c,label:u,messageVariables:d,trigger:h="onChange",validateTrigger:f,hidden:g,help:p}=i,{getPrefixCls:v}=x.exports.useContext(Hi),{name:m}=x.exports.useContext(rp),_=OKe(l),y=typeof _=="function",w=x.exports.useContext(rme),{validateTrigger:L}=x.exports.useContext(K0),D=f!==void 0?f:L,E=e!=null,I=v("form",r),k=nh(I),[R,A,P]=wq(I,k);S4();const N=x.exports.useContext(pD),M=x.exports.useRef(),[H,B]=BKe({}),[F,$]=zm(()=>Pie()),z=pe=>{const be=N==null?void 0:N.getKey(pe.name);if($(pe.destroy?Pie():pe,!0),t&&p!==!1&&w){let Se=pe.name;if(pe.destroy)Se=M.current||Se;else if(be!==void 0){const[Fe,De]=be;Se=[Fe].concat(_t(De)),M.current=Se}w(pe,Se)}},K=(pe,be)=>{B(Se=>{const Fe=Object.assign({},Se),ce=[].concat(_t(pe.name.slice(0,-1)),_t(be)).join(tqe);return pe.destroy?delete Fe[ce]:Fe[ce]=pe,Fe})},[j,G]=x.exports.useMemo(()=>{const pe=_t(F.errors),be=_t(F.warnings);return Object.values(H).forEach(Se=>{pe.push.apply(pe,_t(Se.errors||[])),be.push.apply(be,_t(Se.warnings||[]))}),[pe,be]},[H,F.errors,F.warnings]),X=WKe();function de(pe,be,Se){return t&&!g?x.exports.createElement(Vve,{prefixCls:I,hasFeedback:i.hasFeedback,validateStatus:i.validateStatus,meta:F,errors:j,warnings:G,noStyle:!0},pe):x.exports.createElement(eqe,Object.assign({key:"row"},i,{className:Ue(n,P,k,A),prefixCls:I,fieldId:be,isRequired:Se,errors:j,warnings:G,meta:F,onSubItemMetaChange:K}),pe)}if(!E&&!y&&!o)return R(de(_));let fe={};return typeof u=="string"?fe.label=u:e&&(fe.label=String(e)),d&&(fe=Object.assign(Object.assign({},fe),d)),R(x.exports.createElement(eq,Object.assign({},i,{messageVariables:fe,trigger:h,validateTrigger:D,onMetaChange:z}),(pe,be,Se)=>{const Fe=sE(e).length&&be?be.name:[],De=Ove(Fe,m),ce=c!==void 0?c:!!(a&&a.some(xe=>{if(xe&&typeof xe=="object"&&xe.required&&!xe.warningOnly)return!0;if(typeof xe=="function"){const Ee=xe(Se);return Ee&&Ee.required&&!Ee.warningOnly}return!1})),Pe=Object.assign({},pe);let Oe=null;if(Array.isArray(_)&&E)Oe=_;else if(!(y&&(!(s||o)||E))){if(!(o&&!y&&!E))if(sw(_)){const xe=Object.assign(Object.assign({},_.props),Pe);if(xe.id||(xe.id=De),p||j.length>0||G.length>0||i.extra){const nt=[];(p||j.length>0)&&nt.push(`${De}_help`),i.extra&&nt.push(`${De}_extra`),xe["aria-describedby"]=nt.join(" ")}j.length>0&&(xe["aria-invalid"]="true"),ce&&(xe["aria-required"]="true"),Kv(_)&&(xe.ref=X(Fe,_)),new Set([].concat(_t(sE(h)),_t(sE(D)))).forEach(nt=>{xe[nt]=function(){for(var Qe,Ge,re,ie,se,U=arguments.length,Y=new Array(U),oe=0;oe{var{prefixCls:e,children:t}=i,n=sqe(i,["prefixCls","children"]);const{getPrefixCls:o}=x.exports.useContext(Hi),r=o("form",e),s=x.exports.useMemo(()=>({prefixCls:r,status:"error"}),[r]);return x.exports.createElement(tme,Object.assign({},n),(a,l,c)=>x.exports.createElement(nq.Provider,{value:s},t(a.map(u=>Object.assign(Object.assign({},u),{fieldKey:u.key})),l,{errors:c.errors,warnings:c.warnings})))};var lqe=aqe;function cqe(){const{form:i}=x.exports.useContext(rp);return i}const gp=PKe;gp.Item=rqe;gp.List=lqe;gp.ErrorList=Pve;gp.useForm=Bve;gp.useFormInstance=cqe;gp.useWatch=ome;gp.Provider=sme;gp.create=()=>{};var CD=gp;let pu=null,s0=i=>i(),yD=[],wD={};function Oie(){const{getContainer:i,duration:e,rtl:t,maxCount:n,top:o}=wD,r=(i==null?void 0:i())||document.body;return{getContainer:()=>r,duration:e,rtl:t,maxCount:n,top:o}}const uqe=Bt.forwardRef((i,e)=>{const{messageConfig:t,sync:n}=i,{getPrefixCls:o}=x.exports.useContext(Hi),r=wD.prefixCls||o("message"),s=x.exports.useContext(gVe),[a,l]=Mpe(Object.assign(Object.assign(Object.assign({},t),{prefixCls:r}),s.message));return Bt.useImperativeHandle(e,()=>{const c=Object.assign({},a);return Object.keys(c).forEach(u=>{c[u]=function(){return n(),a[u].apply(a,arguments)}}),{instance:c,sync:n}}),l}),dqe=Bt.forwardRef((i,e)=>{const[t,n]=Bt.useState(Oie),o=()=>{n(Oie)};Bt.useEffect(o,[]);const r=WK(),s=r.getRootPrefixCls(),a=r.getIconPrefixCls(),l=r.getTheme(),c=he(uqe,{ref:e,sync:o,messageConfig:t});return he(fp,{prefixCls:s,iconPrefixCls:a,theme:l,children:r.holderRender?r.holderRender(c):c})});function O4(){if(!pu){const i=document.createDocumentFragment(),e={fragment:i};pu=e,s0(()=>{qK(he(dqe,{ref:t=>{const{instance:n,sync:o}=t||{};Promise.resolve().then(()=>{!e.instance&&n&&(e.instance=n,e.sync=o,O4())})}}),i)});return}!pu.instance||(yD.forEach(i=>{const{type:e,skipped:t}=i;if(!t)switch(e){case"open":{s0(()=>{const n=pu.instance.open(Object.assign(Object.assign({},wD),i.config));n==null||n.then(i.resolve),i.setCloseFn(n)});break}case"destroy":s0(()=>{pu==null||pu.instance.destroy(i.key)});break;default:s0(()=>{var n;const o=(n=pu.instance)[e].apply(n,_t(i.args));o==null||o.then(i.resolve),i.setCloseFn(o)})}}),yD=[])}function hqe(i){wD=Object.assign(Object.assign({},wD),i),s0(()=>{var e;(e=pu==null?void 0:pu.sync)===null||e===void 0||e.call(pu)})}function fqe(i){const e=KK(t=>{let n;const o={type:"open",config:i,resolve:t,setCloseFn:r=>{n=r}};return yD.push(o),()=>{n?s0(()=>{n()}):o.skipped=!0}});return O4(),e}function gqe(i,e){WK();const t=KK(n=>{let o;const r={type:i,args:e,resolve:n,setCloseFn:s=>{o=s}};return yD.push(r),()=>{o?s0(()=>{o()}):r.skipped=!0}});return O4(),t}function pqe(i){yD.push({type:"destroy",key:i}),O4()}const mqe=["success","info","warning","error","loading"],vqe={open:fqe,destroy:pqe,config:hqe,useMessage:i7e,_InternalPanelDoNotUseOrYouWillBeFired:X9e},$ve=vqe;mqe.forEach(i=>{$ve[i]=function(){for(var e=arguments.length,t=new Array(e),n=0;n{const{prefixCls:e,className:t,closeIcon:n,closable:o,type:r,title:s,children:a,footer:l}=i,c=_qe(i,["prefixCls","className","closeIcon","closable","type","title","children","footer"]),{getPrefixCls:u}=x.exports.useContext(Hi),d=u(),h=e||u("modal"),f=nh(d),[g,p,v]=_me(h,f),m=`${h}-confirm`;let _={};return r?_={closable:o!=null?o:!1,title:"",footer:"",children:x.exports.createElement(Cme,Object.assign({},i,{prefixCls:h,confirmPrefixCls:m,rootPrefixCls:d,content:a}))}:_={closable:o!=null?o:!0,title:s,footer:l!==null&&x.exports.createElement(cme,Object.assign({},i)),children:a},g(x.exports.createElement(Xpe,Object.assign({prefixCls:h,className:Ue(p,`${h}-pure-panel`,r&&m,r&&`${m}-${r}`,t,v,f)},c,{closeIcon:lme(h,n),closable:o},_)))};var Cqe=Ime(bqe);function zve(i){return TI(xme(i))}const ih=bme;ih.useModal=fVe;ih.info=function(e){return TI(Lme(e))};ih.success=function(e){return TI(Eme(e))};ih.error=function(e){return TI(Dme(e))};ih.warning=zve;ih.warn=zve;ih.confirm=function(e){return TI(kme(e))};ih.destroyAll=function(){for(;r0.length;){const e=r0.pop();e&&e()}};ih.config=lVe;ih._InternalPanelDoNotUseOrYouWillBeFired=Cqe;var Sq=ih,xq=x.exports.createContext(null),yqe=function(e){for(var t=e.prefixCls,n=e.level,o=e.isStart,r=e.isEnd,s="".concat(t,"-indent-unit"),a=[],l=0;l=0&&t.splice(n,1),t}function Op(i,e){var t=(i||[]).slice();return t.indexOf(e)===-1&&t.push(e),t}function Lq(i){return i.split("-")}function Eqe(i,e){var t=[],n=Sc(e,i);function o(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];r.forEach(function(s){var a=s.key,l=s.children;t.push(a),o(l)})}return o(n.children),t}function Dqe(i){if(i.parent){var e=Lq(i.pos);return Number(e[e.length-1])===i.parent.children.length-1}return!1}function kqe(i){var e=Lq(i.pos);return Number(e[e.length-1])===0}function Wie(i,e,t,n,o,r,s,a,l,c){var u,d=i.clientX,h=i.clientY,f=i.target.getBoundingClientRect(),g=f.top,p=f.height,v=(c==="rtl"?-1:1)*(((o==null?void 0:o.x)||0)-d),m=(v-12)/n,_=Sc(a,t.props.eventKey);if(h-1.5?r({dragNode:P,dropNode:N,dropPosition:1})?k=1:M=!1:r({dragNode:P,dropNode:N,dropPosition:0})?k=0:r({dragNode:P,dropNode:N,dropPosition:1})?k=1:M=!1:r({dragNode:P,dropNode:N,dropPosition:1})?k=1:M=!1,{dropPosition:k,dropLevelOffset:R,dropTargetKey:_.key,dropTargetPos:_.pos,dragOverNodeKey:I,dropContainerKey:k===0?null:((u=_.parent)===null||u===void 0?void 0:u.key)||null,dropAllowed:M}}function Vie(i,e){if(!!i){var t=e.multiple;return t?i.slice():i.length?[i[0]]:i}}function x6(i){if(!i)return null;var e;if(Array.isArray(i))e={checkedKeys:i,halfCheckedKeys:void 0};else if(Kn(i)==="object")e={checkedKeys:i.checked||void 0,halfCheckedKeys:i.halfChecked||void 0};else return rr(!1,"`checkedKeys` is not an array or an object"),null;return e}function HW(i,e){var t=new Set;function n(o){if(!t.has(o)){var r=Sc(e,o);if(!!r){t.add(o);var s=r.parent,a=r.node;a.disabled||s&&n(s.key)}}}return(i||[]).forEach(function(o){n(o)}),_t(t)}function Iqe(i){var e=i.dropPosition,t=i.dropLevelOffset,n=i.indent,o={pointerEvents:"none",position:"absolute",right:0,backgroundColor:"red",height:2};switch(e){case-1:o.top=0,o.left=-t*n;break;case 1:o.bottom=0,o.left=-t*n;break;case 0:o.bottom=0,o.left=n;break}return x.exports.createElement("div",{style:o})}function Uve(i){if(i==null)throw new TypeError("Cannot destructure "+i)}function Tqe(i,e){var t=x.exports.useState(!1),n=Ne(t,2),o=n[0],r=n[1];go(function(){if(o)return i(),function(){e()}},[o]),go(function(){return r(!0),function(){r(!1)}},[])}var Nqe=["className","style","motion","motionNodes","motionType","onMotionStart","onMotionEnd","active","treeNodeRequiredProps"],jve=function(e,t){var n=e.className,o=e.style,r=e.motion,s=e.motionNodes,a=e.motionType,l=e.onMotionStart,c=e.onMotionEnd,u=e.active,d=e.treeNodeRequiredProps,h=Hn(e,Nqe),f=x.exports.useState(!0),g=Ne(f,2),p=g[0],v=g[1],m=x.exports.useContext(xq),_=m.prefixCls,y=s&&a!=="hide";go(function(){s&&y!==p&&v(y)},[s]);var w=function(){s&&l()},L=x.exports.useRef(!1),D=function(){s&&!L.current&&(L.current=!0,c())};Tqe(w,D);var E=function(k){y===k&&D()};return s?x.exports.createElement(th,yt({ref:t,visible:p},r,{motionAppear:a==="show",onVisibleChanged:E}),function(I,k){var R=I.className,A=I.style;return x.exports.createElement("div",{ref:k,className:Ue("".concat(_,"-treenode-motion"),R),style:A},s.map(function(P){var N=yt({},(Uve(P.data),P.data)),M=P.title,H=P.key,B=P.isStart,F=P.isEnd;delete N.children;var $=rE(H,d);return x.exports.createElement(cw,yt({},N,$,{title:M,active:u,data:P.data,key:H,isStart:B,isEnd:F}))}))}):x.exports.createElement(cw,yt({domRef:t,className:n,style:o},h,{active:u}))};jve.displayName="MotionTreeNode";var Rqe=x.exports.forwardRef(jve);function Mqe(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],t=i.length,n=e.length;if(Math.abs(t-n)!==1)return{add:!1,key:null};function o(r,s){var a=new Map;r.forEach(function(c){a.set(c,!0)});var l=s.filter(function(c){return!a.has(c)});return l.length===1?l[0]:null}return t ").concat(e);return e}var qve=x.exports.forwardRef(function(i,e){var t=i.prefixCls,n=i.data;i.selectable,i.checkable;var o=i.expandedKeys,r=i.selectedKeys,s=i.checkedKeys,a=i.loadedKeys,l=i.loadingKeys,c=i.halfCheckedKeys,u=i.keyEntities,d=i.disabled,h=i.dragging,f=i.dragOverNodeKey,g=i.dropPosition,p=i.motion,v=i.height,m=i.itemHeight,_=i.virtual,y=i.focusable,w=i.activeItem,L=i.focused,D=i.tabIndex,E=i.onKeyDown,I=i.onFocus,k=i.onBlur,R=i.onActiveChange,A=i.onListChangeStart,P=i.onListChangeEnd,N=Hn(i,Aqe),M=x.exports.useRef(null),H=x.exports.useRef(null);x.exports.useImperativeHandle(e,function(){return{scrollTo:function(ie){M.current.scrollTo(ie)},getIndentWidth:function(){return H.current.offsetWidth}}});var B=x.exports.useState(o),F=Ne(B,2),$=F[0],z=F[1],K=x.exports.useState(n),j=Ne(K,2),G=j[0],X=j[1],de=x.exports.useState(n),fe=Ne(de,2),pe=fe[0],be=fe[1],Se=x.exports.useState([]),Fe=Ne(Se,2),De=Fe[0],ce=Fe[1],Pe=x.exports.useState(null),Oe=Ne(Pe,2),xe=Oe[0],Ee=Oe[1],tt=x.exports.useRef(n);tt.current=n;function nt(){var re=tt.current;X(re),be(re),ce([]),Ee(null),P()}go(function(){z(o);var re=Mqe($,o);if(re.key!==null)if(re.add){var ie=G.findIndex(function(ye){var Le=ye.key;return Le===re.key}),se=Uie(Hie(G,n,re.key),_,v,m),U=G.slice();U.splice(ie+1,0,zie),be(U),ce(se),Ee("show")}else{var Y=n.findIndex(function(ye){var Le=ye.key;return Le===re.key}),oe=Uie(Hie(n,G,re.key),_,v,m),te=n.slice();te.splice(Y+1,0,zie),be(te),ce(oe),Ee("hide")}else G!==n&&(X(n),be(n))},[o,n]),x.exports.useEffect(function(){h||nt()},[h]);var Qe=p?pe:n,Ge={expandedKeys:o,selectedKeys:r,loadedKeys:a,loadingKeys:l,checkedKeys:s,halfCheckedKeys:c,dragOverNodeKey:f,dropPosition:g,keyEntities:u};return x.exports.createElement(x.exports.Fragment,null,L&&w&&x.exports.createElement("span",{style:$ie,"aria-live":"assertive"},Oqe(w)),x.exports.createElement("div",null,x.exports.createElement("input",{style:$ie,disabled:y===!1||d,tabIndex:y!==!1?D:null,onKeyDown:E,onFocus:I,onBlur:k,value:"",onChange:Pqe,"aria-label":"for screen reader"})),x.exports.createElement("div",{className:"".concat(t,"-treenode"),"aria-hidden":!0,style:{position:"absolute",pointerEvents:"none",visibility:"hidden",height:0,overflow:"hidden",border:0,padding:0}},x.exports.createElement("div",{className:"".concat(t,"-indent")},x.exports.createElement("div",{ref:H,className:"".concat(t,"-indent-unit")}))),x.exports.createElement(lq,yt({},N,{data:Qe,itemKey:jie,height:v,fullHeight:!1,virtual:_,itemHeight:m,prefixCls:"".concat(t,"-list"),ref:M,onVisibleChange:function(ie,se){var U=new Set(ie),Y=se.filter(function(oe){return!U.has(oe)});Y.some(function(oe){return jie(oe)===q0})&&nt()}}),function(re){var ie=re.pos,se=yt({},(Uve(re.data),re.data)),U=re.title,Y=re.key,oe=re.isStart,te=re.isEnd,ye=AI(Y,ie);delete se.key,delete se.children;var Le=rE(ye,Ge);return x.exports.createElement(Rqe,yt({},se,Le,{title:U,active:!!w&&Y===w.key,pos:ie,data:re.data,isStart:oe,isEnd:te,motion:p,motionNodes:Y===q0?De:null,motionType:xe,onMotionStart:A,onMotionEnd:nt,treeNodeRequiredProps:Ge,onMouseMove:function(){R(null)}}))}))});qve.displayName="NodeList";var Fqe=10,Eq=function(i){hp(t,i);var e=Ab(t);function t(){var n;ga(this,t);for(var o=arguments.length,r=new Array(o),s=0;s2&&arguments[2]!==void 0?arguments[2]:!1,d=n.state,h=d.dragChildrenKeys,f=d.dropPosition,g=d.dropTargetKey,p=d.dropTargetPos,v=d.dropAllowed;if(!!v){var m=n.props.onDrop;if(n.setState({dragOverNodeKey:null}),n.cleanDragState(),g!==null){var _=Ce(Ce({},rE(g,n.getTreeNodeRequiredProps())),{},{active:((c=n.getActiveItem())===null||c===void 0?void 0:c.key)===g,data:Sc(n.state.keyEntities,g).node}),y=h.indexOf(g)!==-1;rr(!y,"Can not drop to dragNode's children node. This is a bug of rc-tree. Please report an issue.");var w=Lq(p),L={event:a,node:Zr(_),dragNode:n.dragNode?Zr(n.dragNode.props):null,dragNodesKeys:[n.dragNode.props.eventKey].concat(h),dropToGap:f!==0,dropPosition:f+Number(w[w.length-1])};u||m==null||m(L),n.dragNode=null}}},n.cleanDragState=function(){var a=n.state.draggingNodeKey;a!==null&&n.setState({draggingNodeKey:null,dropPosition:null,dropContainerKey:null,dropTargetKey:null,dropLevelOffset:null,dropAllowed:!0,dragOverNodeKey:null}),n.dragStartMousePosition=null,n.currentMouseOverDroppableNodeKey=null},n.triggerExpandActionExpand=function(a,l){var c=n.state,u=c.expandedKeys,d=c.flattenNodes,h=l.expanded,f=l.key,g=l.isLeaf;if(!(g||a.shiftKey||a.metaKey||a.ctrlKey)){var p=d.filter(function(m){return m.key===f})[0],v=Zr(Ce(Ce({},rE(f,n.getTreeNodeRequiredProps())),{},{data:p.data}));n.setExpandedKeys(h?Gf(u,f):Op(u,f)),n.onNodeExpand(a,v)}},n.onNodeClick=function(a,l){var c=n.props,u=c.onClick,d=c.expandAction;d==="click"&&n.triggerExpandActionExpand(a,l),u==null||u(a,l)},n.onNodeDoubleClick=function(a,l){var c=n.props,u=c.onDoubleClick,d=c.expandAction;d==="doubleClick"&&n.triggerExpandActionExpand(a,l),u==null||u(a,l)},n.onNodeSelect=function(a,l){var c=n.state.selectedKeys,u=n.state,d=u.keyEntities,h=u.fieldNames,f=n.props,g=f.onSelect,p=f.multiple,v=l.selected,m=l[h.key],_=!v;_?p?c=Op(c,m):c=[m]:c=Gf(c,m);var y=c.map(function(w){var L=Sc(d,w);return L?L.node:null}).filter(function(w){return w});n.setUncontrolledState({selectedKeys:c}),g==null||g(c,{event:"select",selected:_,node:l,selectedNodes:y,nativeEvent:a.nativeEvent})},n.onNodeCheck=function(a,l,c){var u=n.state,d=u.keyEntities,h=u.checkedKeys,f=u.halfCheckedKeys,g=n.props,p=g.checkStrictly,v=g.onCheck,m=l.key,_,y={event:"check",node:l,checked:c,nativeEvent:a.nativeEvent};if(p){var w=c?Op(h,m):Gf(h,m),L=Gf(f,m);_={checked:w,halfChecked:L},y.checkedNodes=w.map(function(A){return Sc(d,A)}).filter(function(A){return A}).map(function(A){return A.node}),n.setUncontrolledState({checkedKeys:w})}else{var D=_6([].concat(_t(h),[m]),!0,d),E=D.checkedKeys,I=D.halfCheckedKeys;if(!c){var k=new Set(E);k.delete(m);var R=_6(Array.from(k),{checked:!1,halfCheckedKeys:I},d);E=R.checkedKeys,I=R.halfCheckedKeys}_=E,y.checkedNodes=[],y.checkedNodesPositions=[],y.halfCheckedKeys=I,E.forEach(function(A){var P=Sc(d,A);if(!!P){var N=P.node,M=P.pos;y.checkedNodes.push(N),y.checkedNodesPositions.push({node:N,pos:M})}}),n.setUncontrolledState({checkedKeys:E},!1,{halfCheckedKeys:I})}v==null||v(_,y)},n.onNodeLoad=function(a){var l=a.key,c=new Promise(function(u,d){n.setState(function(h){var f=h.loadedKeys,g=f===void 0?[]:f,p=h.loadingKeys,v=p===void 0?[]:p,m=n.props,_=m.loadData,y=m.onLoad;if(!_||g.indexOf(l)!==-1||v.indexOf(l)!==-1)return null;var w=_(a);return w.then(function(){var L=n.state.loadedKeys,D=Op(L,l);y==null||y(D,{event:"load",node:a}),n.setUncontrolledState({loadedKeys:D}),n.setState(function(E){return{loadingKeys:Gf(E.loadingKeys,l)}}),u()}).catch(function(L){if(n.setState(function(E){return{loadingKeys:Gf(E.loadingKeys,l)}}),n.loadingRetryTimes[l]=(n.loadingRetryTimes[l]||0)+1,n.loadingRetryTimes[l]>=Fqe){var D=n.state.loadedKeys;rr(!1,"Retry for `loadData` many times but still failed. No more retry."),n.setUncontrolledState({loadedKeys:Op(D,l)}),u()}d(L)}),{loadingKeys:Op(v,l)}})});return c.catch(function(){}),c},n.onNodeMouseEnter=function(a,l){var c=n.props.onMouseEnter;c==null||c({event:a,node:l})},n.onNodeMouseLeave=function(a,l){var c=n.props.onMouseLeave;c==null||c({event:a,node:l})},n.onNodeContextMenu=function(a,l){var c=n.props.onRightClick;c&&(a.preventDefault(),c({event:a,node:l}))},n.onFocus=function(){var a=n.props.onFocus;n.setState({focused:!0});for(var l=arguments.length,c=new Array(l),u=0;u1&&arguments[1]!==void 0?arguments[1]:!1,c=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;if(!n.destroyed){var u=!1,d=!0,h={};Object.keys(a).forEach(function(f){if(f in n.props){d=!1;return}u=!0,h[f]=a[f]}),u&&(!l||d)&&n.setState(Ce(Ce({},h),c))}},n.scrollTo=function(a){n.listRef.current.scrollTo(a)},n}return pa(t,[{key:"componentDidMount",value:function(){this.destroyed=!1,this.onUpdated()}},{key:"componentDidUpdate",value:function(){this.onUpdated()}},{key:"onUpdated",value:function(){var o=this.props,r=o.activeKey,s=o.itemScrollOffset,a=s===void 0?0:s;r!==void 0&&r!==this.state.activeKey&&(this.setState({activeKey:r}),r!==null&&this.scrollTo({key:r,offset:a}))}},{key:"componentWillUnmount",value:function(){window.removeEventListener("dragend",this.onWindowDragEnd),this.destroyed=!0}},{key:"resetDragState",value:function(){this.setState({dragOverNodeKey:null,dropPosition:null,dropLevelOffset:null,dropTargetKey:null,dropContainerKey:null,dropTargetPos:null,dropAllowed:!1})}},{key:"render",value:function(){var o,r=this.state,s=r.focused,a=r.flattenNodes,l=r.keyEntities,c=r.draggingNodeKey,u=r.activeKey,d=r.dropLevelOffset,h=r.dropContainerKey,f=r.dropTargetKey,g=r.dropPosition,p=r.dragOverNodeKey,v=r.indent,m=this.props,_=m.prefixCls,y=m.className,w=m.style,L=m.showLine,D=m.focusable,E=m.tabIndex,I=E===void 0?0:E,k=m.selectable,R=m.showIcon,A=m.icon,P=m.switcherIcon,N=m.draggable,M=m.checkable,H=m.checkStrictly,B=m.disabled,F=m.motion,$=m.loadData,z=m.filterTreeNode,K=m.height,j=m.itemHeight,G=m.virtual,X=m.titleRender,de=m.dropIndicatorRender,fe=m.onContextMenu,pe=m.onScroll,be=m.direction,Se=m.rootClassName,Fe=m.rootStyle,De=U0(this.props,{aria:!0,data:!0}),ce;return N&&(Kn(N)==="object"?ce=N:typeof N=="function"?ce={nodeDraggable:N}:ce={}),x.exports.createElement(xq.Provider,{value:{prefixCls:_,selectable:k,showIcon:R,icon:A,switcherIcon:P,draggable:ce,draggingNodeKey:c,checkable:M,checkStrictly:H,disabled:B,keyEntities:l,dropLevelOffset:d,dropContainerKey:h,dropTargetKey:f,dropPosition:g,dragOverNodeKey:p,indent:v,direction:be,dropIndicatorRender:de,loadData:$,filterTreeNode:z,titleRender:X,onNodeClick:this.onNodeClick,onNodeDoubleClick:this.onNodeDoubleClick,onNodeExpand:this.onNodeExpand,onNodeSelect:this.onNodeSelect,onNodeCheck:this.onNodeCheck,onNodeLoad:this.onNodeLoad,onNodeMouseEnter:this.onNodeMouseEnter,onNodeMouseLeave:this.onNodeMouseLeave,onNodeContextMenu:this.onNodeContextMenu,onNodeDragStart:this.onNodeDragStart,onNodeDragEnter:this.onNodeDragEnter,onNodeDragOver:this.onNodeDragOver,onNodeDragLeave:this.onNodeDragLeave,onNodeDragEnd:this.onNodeDragEnd,onNodeDrop:this.onNodeDrop}},x.exports.createElement("div",{role:"tree",className:Ue(_,y,Se,(o={},me(o,"".concat(_,"-show-line"),L),me(o,"".concat(_,"-focused"),s),me(o,"".concat(_,"-active-focused"),u!==null),o)),style:Fe},x.exports.createElement(qve,yt({ref:this.listRef,prefixCls:_,style:w,data:a,disabled:B,selectable:k,checkable:!!M,motion:F,dragging:c!==null,height:K,itemHeight:j,virtual:G,focusable:D,focused:s,tabIndex:I,activeItem:this.getActiveItem(),onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:this.onKeyDown,onActiveChange:this.onActiveChange,onListChangeStart:this.onListChangeStart,onListChangeEnd:this.onListChangeEnd,onContextMenu:fe,onScroll:pe},this.getTreeNodeRequiredProps(),De))))}}],[{key:"getDerivedStateFromProps",value:function(o,r){var s=r.prevProps,a={prevProps:o};function l(D){return!s&&D in o||s&&s[D]!==o[D]}var c,u=r.fieldNames;if(l("fieldNames")&&(u=aw(o.fieldNames),a.fieldNames=u),l("treeData")?c=o.treeData:l("children")&&(rr(!1,"`children` of Tree is deprecated. Please use `treeData` instead."),c=Lve(o.children)),c){a.treeData=c;var d=Eve(c,{fieldNames:u});a.keyEntities=Ce(me({},q0,Kve),d.keyEntities)}var h=a.keyEntities||r.keyEntities;if(l("expandedKeys")||s&&l("autoExpandParent"))a.expandedKeys=o.autoExpandParent||!s&&o.defaultExpandParent?HW(o.expandedKeys,h):o.expandedKeys;else if(!s&&o.defaultExpandAll){var f=Ce({},h);delete f[q0],a.expandedKeys=Object.keys(f).map(function(D){return f[D].key})}else!s&&o.defaultExpandedKeys&&(a.expandedKeys=o.autoExpandParent||o.defaultExpandParent?HW(o.defaultExpandedKeys,h):o.defaultExpandedKeys);if(a.expandedKeys||delete a.expandedKeys,c||a.expandedKeys){var g=v6(c||r.treeData,a.expandedKeys||r.expandedKeys,u);a.flattenNodes=g}if(o.selectable&&(l("selectedKeys")?a.selectedKeys=Vie(o.selectedKeys,o):!s&&o.defaultSelectedKeys&&(a.selectedKeys=Vie(o.defaultSelectedKeys,o))),o.checkable){var p;if(l("checkedKeys")?p=x6(o.checkedKeys)||{}:!s&&o.defaultCheckedKeys?p=x6(o.defaultCheckedKeys)||{}:c&&(p=x6(o.checkedKeys)||{checkedKeys:r.checkedKeys,halfCheckedKeys:r.halfCheckedKeys}),p){var v=p,m=v.checkedKeys,_=m===void 0?[]:m,y=v.halfCheckedKeys,w=y===void 0?[]:y;if(!o.checkStrictly){var L=_6(_,!0,h);_=L.checkedKeys,w=L.halfCheckedKeys}a.checkedKeys=_,a.halfCheckedKeys=w}}return l("loadedKeys")&&(a.loadedKeys=o.loadedKeys),a}}]),t}(x.exports.Component);Eq.defaultProps={prefixCls:"rc-tree",showLine:!1,showIcon:!0,selectable:!0,multiple:!1,checkable:!1,disabled:!1,checkStrictly:!1,draggable:!1,defaultExpandParent:!0,autoExpandParent:!1,defaultExpandAll:!1,defaultExpandedKeys:[],defaultCheckedKeys:[],defaultSelectedKeys:[],dropIndicatorRender:Iqe,allowDrop:function(){return!0},expandAction:!1};Eq.TreeNode=cw;var Bqe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0042 42h216v494z"}}]},name:"file",theme:"outlined"},Wqe=Bqe,Vqe=function(e,t){return x.exports.createElement(cr,yt({},e,{ref:t,icon:Wqe}))},Gve=x.exports.forwardRef(Vqe),Hqe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M928 444H820V330.4c0-17.7-14.3-32-32-32H473L355.7 186.2a8.15 8.15 0 00-5.5-2.2H96c-17.7 0-32 14.3-32 32v592c0 17.7 14.3 32 32 32h698c13 0 24.8-7.9 29.7-20l134-332c1.5-3.8 2.3-7.9 2.3-12 0-17.7-14.3-32-32-32zM136 256h188.5l119.6 114.4H748V444H238c-13 0-24.8 7.9-29.7 20L136 643.2V256zm635.3 512H159l103.3-256h612.4L771.3 768z"}}]},name:"folder-open",theme:"outlined"},$qe=Hqe,zqe=function(e,t){return x.exports.createElement(cr,yt({},e,{ref:t,icon:$qe}))},Uqe=x.exports.forwardRef(zqe),jqe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880 298.4H521L403.7 186.2a8.15 8.15 0 00-5.5-2.2H144c-17.7 0-32 14.3-32 32v592c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V330.4c0-17.7-14.3-32-32-32zM840 768H184V256h188.5l119.6 114.4H840V768z"}}]},name:"folder",theme:"outlined"},Kqe=jqe,qqe=function(e,t){return x.exports.createElement(cr,yt({},e,{ref:t,icon:Kqe}))},Gqe=x.exports.forwardRef(qqe),Xqe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M300 276.5a56 56 0 1056-97 56 56 0 00-56 97zm0 284a56 56 0 1056-97 56 56 0 00-56 97zM640 228a56 56 0 10112 0 56 56 0 00-112 0zm0 284a56 56 0 10112 0 56 56 0 00-112 0zM300 844.5a56 56 0 1056-97 56 56 0 00-56 97zM640 796a56 56 0 10112 0 56 56 0 00-112 0z"}}]},name:"holder",theme:"outlined"},Yqe=Xqe,Zqe=function(e,t){return x.exports.createElement(cr,yt({},e,{ref:t,icon:Yqe}))},Qqe=x.exports.forwardRef(Zqe);const Jqe=new ji("ant-tree-node-fx-do-not-use",{"0%":{opacity:0},"100%":{opacity:1}}),eGe=(i,e)=>({[`.${i}-switcher-icon`]:{display:"inline-block",fontSize:10,verticalAlign:"baseline",svg:{transition:`transform ${e.motionDurationSlow}`}}}),tGe=(i,e)=>({[`.${i}-drop-indicator`]:{position:"absolute",zIndex:1,height:2,backgroundColor:e.colorPrimary,borderRadius:1,pointerEvents:"none","&:after":{position:"absolute",top:-3,insetInlineStart:-6,width:8,height:8,backgroundColor:"transparent",border:`${rt(e.lineWidthBold)} solid ${e.colorPrimary}`,borderRadius:"50%",content:'""'}}}),nGe=(i,e)=>{const{treeCls:t,treeNodeCls:n,treeNodePadding:o,titleHeight:r,nodeSelectedBg:s,nodeHoverBg:a}=e,l=e.paddingXS;return{[t]:Object.assign(Object.assign({},Pa(e)),{background:e.colorBgContainer,borderRadius:e.borderRadius,transition:`background-color ${e.motionDurationSlow}`,[`&${t}-rtl`]:{[`${t}-switcher`]:{"&_close":{[`${t}-switcher-icon`]:{svg:{transform:"rotate(90deg)"}}}}},[`&-focused:not(:hover):not(${t}-active-focused)`]:Object.assign({},PK(e)),[`${t}-list-holder-inner`]:{alignItems:"flex-start"},[`&${t}-block-node`]:{[`${t}-list-holder-inner`]:{alignItems:"stretch",[`${t}-node-content-wrapper`]:{flex:"auto"},[`${n}.dragging`]:{position:"relative","&:after":{position:"absolute",top:0,insetInlineEnd:0,bottom:o,insetInlineStart:0,border:`1px solid ${e.colorPrimary}`,opacity:0,animationName:Jqe,animationDuration:e.motionDurationSlow,animationPlayState:"running",animationFillMode:"forwards",content:'""',pointerEvents:"none"}}}},[`${n}`]:{display:"flex",alignItems:"flex-start",padding:`0 0 ${rt(o)} 0`,outline:"none","&-rtl":{direction:"rtl"},"&-disabled":{[`${t}-node-content-wrapper`]:{color:e.colorTextDisabled,cursor:"not-allowed","&:hover":{background:"transparent"}}},[`&-active ${t}-node-content-wrapper`]:{background:e.controlItemBgHover},[`&:not(${n}-disabled).filter-node ${t}-title`]:{color:"inherit",fontWeight:500},"&-draggable":{cursor:"grab",[`${t}-draggable-icon`]:{flexShrink:0,width:r,lineHeight:`${rt(r)}`,textAlign:"center",visibility:"visible",opacity:.2,transition:`opacity ${e.motionDurationSlow}`,[`${n}:hover &`]:{opacity:.45}},[`&${n}-disabled`]:{[`${t}-draggable-icon`]:{visibility:"hidden"}}}},[`${t}-indent`]:{alignSelf:"stretch",whiteSpace:"nowrap",userSelect:"none","&-unit":{display:"inline-block",width:r}},[`${t}-draggable-icon`]:{visibility:"hidden"},[`${t}-switcher`]:Object.assign(Object.assign({},eGe(i,e)),{position:"relative",flex:"none",alignSelf:"stretch",width:r,margin:0,lineHeight:`${rt(r)}`,textAlign:"center",cursor:"pointer",userSelect:"none",transition:`all ${e.motionDurationSlow}`,borderRadius:e.borderRadius,"&-noop":{cursor:"unset"},[`&:not(${t}-switcher-noop):hover`]:{backgroundColor:e.colorBgTextHover},"&_close":{[`${t}-switcher-icon`]:{svg:{transform:"rotate(-90deg)"}}},"&-loading-icon":{color:e.colorPrimary},"&-leaf-line":{position:"relative",zIndex:1,display:"inline-block",width:"100%",height:"100%","&:before":{position:"absolute",top:0,insetInlineEnd:e.calc(r).div(2).equal(),bottom:e.calc(o).mul(-1).equal(),marginInlineStart:-1,borderInlineEnd:`1px solid ${e.colorBorder}`,content:'""'},"&:after":{position:"absolute",width:e.calc(e.calc(r).div(2).equal()).mul(.8).equal(),height:e.calc(r).div(2).equal(),borderBottom:`1px solid ${e.colorBorder}`,content:'""'}}}),[`${t}-checkbox`]:{top:"initial",marginInlineEnd:l,alignSelf:"flex-start",marginTop:e.marginXXS},[`${t}-node-content-wrapper, ${t}-checkbox + span`]:{position:"relative",zIndex:"auto",minHeight:r,margin:0,padding:`0 ${rt(e.calc(e.paddingXS).div(2).equal())}`,color:"inherit",lineHeight:`${rt(r)}`,background:"transparent",borderRadius:e.borderRadius,cursor:"pointer",transition:`all ${e.motionDurationMid}, border 0s, line-height 0s, box-shadow 0s`,"&:hover":{backgroundColor:a},[`&${t}-node-selected`]:{backgroundColor:s},[`${t}-iconEle`]:{display:"inline-block",width:r,height:r,lineHeight:`${rt(r)}`,textAlign:"center",verticalAlign:"top","&:empty":{display:"none"}}},[`${t}-unselectable ${t}-node-content-wrapper:hover`]:{backgroundColor:"transparent"},[`${t}-node-content-wrapper`]:Object.assign({lineHeight:`${rt(r)}`,userSelect:"none"},tGe(i,e)),[`${n}.drop-container`]:{"> [draggable]":{boxShadow:`0 0 0 2px ${e.colorPrimary}`}},"&-show-line":{[`${t}-indent`]:{"&-unit":{position:"relative",height:"100%","&:before":{position:"absolute",top:0,insetInlineEnd:e.calc(r).div(2).equal(),bottom:e.calc(o).mul(-1).equal(),borderInlineEnd:`1px solid ${e.colorBorder}`,content:'""'},"&-end":{"&:before":{display:"none"}}}},[`${t}-switcher`]:{background:"transparent","&-line-icon":{verticalAlign:"-0.15em"}}},[`${n}-leaf-last`]:{[`${t}-switcher`]:{"&-leaf-line":{"&:before":{top:"auto !important",bottom:"auto !important",height:`${rt(e.calc(r).div(2).equal())} !important`}}}}})}},iGe=i=>{const{treeCls:e,treeNodeCls:t,treeNodePadding:n,directoryNodeSelectedBg:o,directoryNodeSelectedColor:r}=i;return{[`${e}${e}-directory`]:{[t]:{position:"relative","&:before":{position:"absolute",top:0,insetInlineEnd:0,bottom:n,insetInlineStart:0,transition:`background-color ${i.motionDurationMid}`,content:'""',pointerEvents:"none"},"&:hover":{"&:before":{background:i.controlItemBgHover}},"> *":{zIndex:1},[`${e}-switcher`]:{transition:`color ${i.motionDurationMid}`},[`${e}-node-content-wrapper`]:{borderRadius:0,userSelect:"none","&:hover":{background:"transparent"},[`&${e}-node-selected`]:{color:r,background:"transparent"}},"&-selected":{[` &:hover::before, &::before - `]:{background:o},[`${e}-switcher`]:{color:r},[`${e}-node-content-wrapper`]:{color:r,background:"transparent"}}}}}},Yqe=(i,e)=>{const t=`.${i}`,n=`${t}-treenode`,o=e.calc(e.paddingXS).div(2).equal(),r=lr(e,{treeCls:t,treeNodeCls:n,treeNodePadding:o});return[Gqe(i,r),Xqe(r)]},Zqe=i=>{const{controlHeightSM:e}=i;return{titleHeight:e,nodeHoverBg:i.controlItemBgHover,nodeSelectedBg:i.controlItemBgActive}},Qqe=i=>{const{colorTextLightSolid:e,colorPrimary:t}=i;return Object.assign(Object.assign({},Zqe(i)),{directoryNodeSelectedColor:e,directoryNodeSelectedBg:t})};var Jqe=Uc("Tree",(i,e)=>{let{prefixCls:t}=e;return[{[i.componentCls]:wve(`${t}-checkbox`,i)},Yqe(t,i),lme(i)]},Qqe);const Bie=4;function eGe(i){const{dropPosition:e,dropLevelOffset:t,prefixCls:n,indent:o,direction:r="ltr"}=i,s=r==="ltr"?"left":"right",a=r==="ltr"?"right":"left",l={[s]:-t*o+Bie,[a]:0};switch(e){case-1:l.top=-3;break;case 1:l.bottom=-3;break;default:l.bottom=-3,l[s]=o+Bie;break}return Bt.createElement("div",{style:l,className:`${n}-drop-indicator`})}var tGe={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M840.4 300H183.6c-19.7 0-30.7 20.8-18.5 35l328.4 380.8c9.4 10.9 27.5 10.9 37 0L858.9 335c12.2-14.2 1.2-35-18.5-35z"}}]},name:"caret-down",theme:"filled"},nGe=tGe,iGe=function(e,t){return x.exports.createElement(cr,Ct({},e,{ref:t,icon:nGe}))},oGe=x.exports.forwardRef(iGe),rGe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M328 544h368c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8z"}},{tag:"path",attrs:{d:"M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z"}}]},name:"minus-square",theme:"outlined"},sGe=rGe,aGe=function(e,t){return x.exports.createElement(cr,Ct({},e,{ref:t,icon:sGe}))},lGe=x.exports.forwardRef(aGe),cGe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M328 544h152v152c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V544h152c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H544V328c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v152H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8z"}},{tag:"path",attrs:{d:"M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z"}}]},name:"plus-square",theme:"outlined"},uGe=cGe,dGe=function(e,t){return x.exports.createElement(cr,Ct({},e,{ref:t,icon:uGe}))},hGe=x.exports.forwardRef(dGe);const fGe=i=>{const{prefixCls:e,switcherIcon:t,treeNodeProps:n,showLine:o}=i,{isLeaf:r,expanded:s,loading:a}=n;if(a)return x.exports.createElement(xI,{className:`${e}-switcher-loading-icon`});let l;if(o&&typeof o=="object"&&(l=o.showLeafIcon),r){if(!o)return null;if(typeof l!="boolean"&&!!l){const d=typeof l=="function"?l(n):l,h=`${e}-switcher-line-custom-icon`;return sy(d)?pv(d,{className:Ue(d.props.className||"",h)}):d}return l?x.exports.createElement($ve,{className:`${e}-switcher-line-icon`}):x.exports.createElement("span",{className:`${e}-switcher-leaf-line`})}const c=`${e}-switcher-icon`,u=typeof t=="function"?t(n):t;return sy(u)?pv(u,{className:Ue(u.props.className||"",c)}):u!==void 0?u:o?s?x.exports.createElement(lGe,{className:`${e}-switcher-line-icon`}):x.exports.createElement(hGe,{className:`${e}-switcher-line-icon`}):x.exports.createElement(oGe,{className:c})};var gGe=fGe;const pGe=Bt.forwardRef((i,e)=>{var t;const{getPrefixCls:n,direction:o,virtual:r,tree:s}=Bt.useContext(Hi),{prefixCls:a,className:l,showIcon:c=!1,showLine:u,switcherIcon:d,blockNode:h=!1,children:f,checkable:g=!1,selectable:p=!0,draggable:v,motion:m,style:_}=i,w=n("tree",a),y=n(),L=m!=null?m:Object.assign(Object.assign({},fW(y)),{motionAppear:!1}),D=Object.assign(Object.assign({},i),{checkable:g,selectable:p,showIcon:c,motion:L,blockNode:h,showLine:Boolean(u),dropIndicatorRender:eGe}),[E,I,k]=Jqe(w),[,R]=Fa(),A=R.paddingXS/2+(((t=R.Tree)===null||t===void 0?void 0:t.titleHeight)||R.controlHeightSM),P=Bt.useMemo(()=>{if(!v)return!1;let M={};switch(typeof v){case"function":M.nodeDraggable=v;break;case"object":M=Object.assign({},v);break}return M.icon!==!1&&(M.icon=M.icon||Bt.createElement(Uqe,null)),M},[v]),N=M=>Bt.createElement(gGe,{prefixCls:w,switcherIcon:d,treeNodeProps:M,showLine:u});return E(Bt.createElement(wq,Object.assign({itemHeight:A,ref:e,virtual:r},D,{style:Object.assign(Object.assign({},s==null?void 0:s.style),_),prefixCls:w,className:Ue({[`${w}-icon-hide`]:!c,[`${w}-block-node`]:h,[`${w}-unselectable`]:!p,[`${w}-rtl`]:o==="rtl"},s==null?void 0:s.className,l,I,k),direction:o,checkable:g&&Bt.createElement("span",{className:`${w}-checkbox-inner`}),selectable:p,switcherIcon:N,draggable:P}),f))});var zve=pGe,rg;(function(i){i[i.None=0]="None",i[i.Start=1]="Start",i[i.End=2]="End"})(rg||(rg={}));function yq(i,e,t){const{key:n,children:o}=t;function r(s){const a=s[n],l=s[o];e(a,s)!==!1&&yq(l||[],e,t)}i.forEach(r)}function mGe(i){let{treeData:e,expandedKeys:t,startKey:n,endKey:o,fieldNames:r}=i;const s=[];let a=rg.None;if(n&&n===o)return[n];if(!n||!o)return[];function l(c){return c===n||c===o}return yq(e,c=>{if(a===rg.End)return!1;if(l(c)){if(s.push(c),a===rg.None)a=rg.Start;else if(a===rg.Start)return a=rg.End,!1}else a===rg.Start&&s.push(c);return t.includes(c)},ay(r)),s}function L6(i,e,t){const n=_t(e),o=[];return yq(i,(r,s)=>{const a=n.indexOf(r);return a!==-1&&(o.push(s),n.splice(a,1)),!!n.length},ay(t)),o}var Wie=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(i);o{var{defaultExpandAll:t,defaultExpandParent:n,defaultExpandedKeys:o}=i,r=Wie(i,["defaultExpandAll","defaultExpandParent","defaultExpandedKeys"]);const s=x.exports.useRef(),a=x.exports.useRef(),l=()=>{const{keyEntities:I}=bve(Vie(r));let k;return t?k=Object.keys(I):n?k=BW(r.expandedKeys||o||[],I):k=r.expandedKeys||o,k},[c,u]=x.exports.useState(r.selectedKeys||r.defaultSelectedKeys||[]),[d,h]=x.exports.useState(()=>l());x.exports.useEffect(()=>{"selectedKeys"in r&&u(r.selectedKeys)},[r.selectedKeys]),x.exports.useEffect(()=>{"expandedKeys"in r&&h(r.expandedKeys)},[r.expandedKeys]);const f=(I,k)=>{var R;return"expandedKeys"in r||h(I),(R=r.onExpand)===null||R===void 0?void 0:R.call(r,I,k)},g=(I,k)=>{var R;const{multiple:A,fieldNames:P}=r,{node:N,nativeEvent:M}=k,{key:H=""}=N,W=Vie(r),F=Object.assign(Object.assign({},k),{selected:!0}),$=(M==null?void 0:M.ctrlKey)||(M==null?void 0:M.metaKey),z=M==null?void 0:M.shiftKey;let K;A&&$?(K=I,s.current=H,a.current=K,F.selectedNodes=L6(W,K,P)):A&&z?(K=Array.from(new Set([].concat(_t(a.current||[]),_t(mGe({treeData:W,expandedKeys:d,startKey:H,endKey:s.current,fieldNames:P}))))),F.selectedNodes=L6(W,K,P)):(K=[H],s.current=H,a.current=K,F.selectedNodes=L6(W,K,P)),(R=r.onSelect)===null||R===void 0||R.call(r,K,F),"selectedKeys"in r||u(K)},{getPrefixCls:p,direction:v}=x.exports.useContext(Hi),{prefixCls:m,className:_,showIcon:w=!0,expandAction:y="click"}=r,L=Wie(r,["prefixCls","className","showIcon","expandAction"]),D=p("tree",m),E=Ue(`${D}-directory`,{[`${D}-directory-rtl`]:v==="rtl"},_);return x.exports.createElement(zve,Object.assign({icon:vGe,ref:e,blockNode:!0},L,{showIcon:w,expandAction:y,prefixCls:D,className:E,expandedKeys:d,selectedKeys:c,onSelect:g,onExpand:f}))},bGe=x.exports.forwardRef(_Ge);var CGe=bGe;const Sq=zve;Sq.DirectoryTree=CGe;Sq.TreeNode=ly;var wGe=Sq,bc={exports:{}};/** + `]:{background:o},[`${e}-switcher`]:{color:r},[`${e}-node-content-wrapper`]:{color:r,background:"transparent"}}}}}},oGe=(i,e)=>{const t=`.${i}`,n=`${t}-treenode`,o=e.calc(e.paddingXS).div(2).equal(),r=lr(e,{treeCls:t,treeNodeCls:n,treeNodePadding:o});return[nGe(i,r),iGe(r)]},rGe=i=>{const{controlHeightSM:e}=i;return{titleHeight:e,nodeHoverBg:i.controlItemBgHover,nodeSelectedBg:i.controlItemBgActive}},sGe=i=>{const{colorTextLightSolid:e,colorPrimary:t}=i;return Object.assign(Object.assign({},rGe(i)),{directoryNodeSelectedColor:e,directoryNodeSelectedBg:t})};var aGe=jc("Tree",(i,e)=>{let{prefixCls:t}=e;return[{[i.componentCls]:kve(`${t}-checkbox`,i)},oGe(t,i),pme(i)]},sGe);const Kie=4;function lGe(i){const{dropPosition:e,dropLevelOffset:t,prefixCls:n,indent:o,direction:r="ltr"}=i,s=r==="ltr"?"left":"right",a=r==="ltr"?"right":"left",l={[s]:-t*o+Kie,[a]:0};switch(e){case-1:l.top=-3;break;case 1:l.bottom=-3;break;default:l.bottom=-3,l[s]=o+Kie;break}return Bt.createElement("div",{style:l,className:`${n}-drop-indicator`})}var cGe={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M840.4 300H183.6c-19.7 0-30.7 20.8-18.5 35l328.4 380.8c9.4 10.9 27.5 10.9 37 0L858.9 335c12.2-14.2 1.2-35-18.5-35z"}}]},name:"caret-down",theme:"filled"},uGe=cGe,dGe=function(e,t){return x.exports.createElement(cr,yt({},e,{ref:t,icon:uGe}))},hGe=x.exports.forwardRef(dGe),fGe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M328 544h368c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8z"}},{tag:"path",attrs:{d:"M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z"}}]},name:"minus-square",theme:"outlined"},gGe=fGe,pGe=function(e,t){return x.exports.createElement(cr,yt({},e,{ref:t,icon:gGe}))},mGe=x.exports.forwardRef(pGe),vGe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M328 544h152v152c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V544h152c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H544V328c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v152H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8z"}},{tag:"path",attrs:{d:"M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z"}}]},name:"plus-square",theme:"outlined"},_Ge=vGe,bGe=function(e,t){return x.exports.createElement(cr,yt({},e,{ref:t,icon:_Ge}))},CGe=x.exports.forwardRef(bGe);const yGe=i=>{const{prefixCls:e,switcherIcon:t,treeNodeProps:n,showLine:o}=i,{isLeaf:r,expanded:s,loading:a}=n;if(a)return x.exports.createElement(EI,{className:`${e}-switcher-loading-icon`});let l;if(o&&typeof o=="object"&&(l=o.showLeafIcon),r){if(!o)return null;if(typeof l!="boolean"&&!!l){const d=typeof l=="function"?l(n):l,h=`${e}-switcher-line-custom-icon`;return sw(d)?mv(d,{className:Ue(d.props.className||"",h)}):d}return l?x.exports.createElement(Gve,{className:`${e}-switcher-line-icon`}):x.exports.createElement("span",{className:`${e}-switcher-leaf-line`})}const c=`${e}-switcher-icon`,u=typeof t=="function"?t(n):t;return sw(u)?mv(u,{className:Ue(u.props.className||"",c)}):u!==void 0?u:o?s?x.exports.createElement(mGe,{className:`${e}-switcher-line-icon`}):x.exports.createElement(CGe,{className:`${e}-switcher-line-icon`}):x.exports.createElement(hGe,{className:c})};var wGe=yGe;const SGe=Bt.forwardRef((i,e)=>{var t;const{getPrefixCls:n,direction:o,virtual:r,tree:s}=Bt.useContext(Hi),{prefixCls:a,className:l,showIcon:c=!1,showLine:u,switcherIcon:d,blockNode:h=!1,children:f,checkable:g=!1,selectable:p=!0,draggable:v,motion:m,style:_}=i,y=n("tree",a),w=n(),L=m!=null?m:Object.assign(Object.assign({},mW(w)),{motionAppear:!1}),D=Object.assign(Object.assign({},i),{checkable:g,selectable:p,showIcon:c,motion:L,blockNode:h,showLine:Boolean(u),dropIndicatorRender:lGe}),[E,I,k]=aGe(y),[,R]=Ba(),A=R.paddingXS/2+(((t=R.Tree)===null||t===void 0?void 0:t.titleHeight)||R.controlHeightSM),P=Bt.useMemo(()=>{if(!v)return!1;let M={};switch(typeof v){case"function":M.nodeDraggable=v;break;case"object":M=Object.assign({},v);break}return M.icon!==!1&&(M.icon=M.icon||Bt.createElement(Qqe,null)),M},[v]),N=M=>Bt.createElement(wGe,{prefixCls:y,switcherIcon:d,treeNodeProps:M,showLine:u});return E(Bt.createElement(Eq,Object.assign({itemHeight:A,ref:e,virtual:r},D,{style:Object.assign(Object.assign({},s==null?void 0:s.style),_),prefixCls:y,className:Ue({[`${y}-icon-hide`]:!c,[`${y}-block-node`]:h,[`${y}-unselectable`]:!p,[`${y}-rtl`]:o==="rtl"},s==null?void 0:s.className,l,I,k),direction:o,checkable:g&&Bt.createElement("span",{className:`${y}-checkbox-inner`}),selectable:p,switcherIcon:N,draggable:P}),f))});var Xve=SGe,sg;(function(i){i[i.None=0]="None",i[i.Start=1]="Start",i[i.End=2]="End"})(sg||(sg={}));function Dq(i,e,t){const{key:n,children:o}=t;function r(s){const a=s[n],l=s[o];e(a,s)!==!1&&Dq(l||[],e,t)}i.forEach(r)}function xGe(i){let{treeData:e,expandedKeys:t,startKey:n,endKey:o,fieldNames:r}=i;const s=[];let a=sg.None;if(n&&n===o)return[n];if(!n||!o)return[];function l(c){return c===n||c===o}return Dq(e,c=>{if(a===sg.End)return!1;if(l(c)){if(s.push(c),a===sg.None)a=sg.Start;else if(a===sg.Start)return a=sg.End,!1}else a===sg.Start&&s.push(c);return t.includes(c)},aw(r)),s}function L6(i,e,t){const n=_t(e),o=[];return Dq(i,(r,s)=>{const a=n.indexOf(r);return a!==-1&&(o.push(s),n.splice(a,1)),!!n.length},aw(t)),o}var qie=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(i);o{var{defaultExpandAll:t,defaultExpandParent:n,defaultExpandedKeys:o}=i,r=qie(i,["defaultExpandAll","defaultExpandParent","defaultExpandedKeys"]);const s=x.exports.useRef(),a=x.exports.useRef(),l=()=>{const{keyEntities:I}=Eve(Gie(r));let k;return t?k=Object.keys(I):n?k=HW(r.expandedKeys||o||[],I):k=r.expandedKeys||o,k},[c,u]=x.exports.useState(r.selectedKeys||r.defaultSelectedKeys||[]),[d,h]=x.exports.useState(()=>l());x.exports.useEffect(()=>{"selectedKeys"in r&&u(r.selectedKeys)},[r.selectedKeys]),x.exports.useEffect(()=>{"expandedKeys"in r&&h(r.expandedKeys)},[r.expandedKeys]);const f=(I,k)=>{var R;return"expandedKeys"in r||h(I),(R=r.onExpand)===null||R===void 0?void 0:R.call(r,I,k)},g=(I,k)=>{var R;const{multiple:A,fieldNames:P}=r,{node:N,nativeEvent:M}=k,{key:H=""}=N,B=Gie(r),F=Object.assign(Object.assign({},k),{selected:!0}),$=(M==null?void 0:M.ctrlKey)||(M==null?void 0:M.metaKey),z=M==null?void 0:M.shiftKey;let K;A&&$?(K=I,s.current=H,a.current=K,F.selectedNodes=L6(B,K,P)):A&&z?(K=Array.from(new Set([].concat(_t(a.current||[]),_t(xGe({treeData:B,expandedKeys:d,startKey:H,endKey:s.current,fieldNames:P}))))),F.selectedNodes=L6(B,K,P)):(K=[H],s.current=H,a.current=K,F.selectedNodes=L6(B,K,P)),(R=r.onSelect)===null||R===void 0||R.call(r,K,F),"selectedKeys"in r||u(K)},{getPrefixCls:p,direction:v}=x.exports.useContext(Hi),{prefixCls:m,className:_,showIcon:y=!0,expandAction:w="click"}=r,L=qie(r,["prefixCls","className","showIcon","expandAction"]),D=p("tree",m),E=Ue(`${D}-directory`,{[`${D}-directory-rtl`]:v==="rtl"},_);return x.exports.createElement(Xve,Object.assign({icon:LGe,ref:e,blockNode:!0},L,{showIcon:y,expandAction:w,prefixCls:D,className:E,expandedKeys:d,selectedKeys:c,onSelect:g,onExpand:f}))},DGe=x.exports.forwardRef(EGe);var kGe=DGe;const kq=Xve;kq.DirectoryTree=kGe;kq.TreeNode=cw;var IGe=kq,Cc={exports:{}};/** * @license * Lodash * Copyright OpenJS Foundation and other contributors * Released under MIT license * Based on Underscore.js 1.8.3 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */(function(i,e){(function(){var t,n="4.17.21",o=200,r="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",s="Expected a function",a="Invalid `variable` option passed into `_.template`",l="__lodash_hash_undefined__",c=500,u="__lodash_placeholder__",d=1,h=2,f=4,g=1,p=2,v=1,m=2,_=4,w=8,y=16,L=32,D=64,E=128,I=256,k=512,R=30,A="...",P=800,N=16,M=1,H=2,W=3,F=1/0,$=9007199254740991,z=17976931348623157e292,K=0/0,j=4294967295,G=j-1,X=j>>>1,de=[["ary",E],["bind",v],["bindKey",m],["curry",w],["curryRight",y],["flip",k],["partial",L],["partialRight",D],["rearg",I]],he="[object Arguments]",pe="[object Array]",be="[object AsyncFunction]",Se="[object Boolean]",Fe="[object Date]",De="[object DOMException]",ce="[object Error]",Pe="[object Function]",Oe="[object GeneratorFunction]",xe="[object Map]",Ee="[object Number]",tt="[object Null]",nt="[object Object]",Qe="[object Promise]",Ge="[object Proxy]",re="[object RegExp]",ie="[object Set]",se="[object String]",U="[object Symbol]",Y="[object Undefined]",oe="[object WeakMap]",te="[object WeakSet]",we="[object ArrayBuffer]",Le="[object DataView]",Te="[object Float32Array]",We="[object Float64Array]",je="[object Int8Array]",mt="[object Int16Array]",Et="[object Int32Array]",At="[object Uint8Array]",Je="[object Uint8ClampedArray]",xt="[object Uint16Array]",Ot="[object Uint32Array]",Vn=/\b__p \+= '';/g,Lt=/\b(__p \+=) '' \+/g,tn=/(__e\(.*?\)|\b__t\)) \+\n'';/g,ui=/&(?:amp|lt|gt|quot|#39);/g,cn=/[&<>"']/g,qn=RegExp(ui.source),bn=RegExp(cn.source),Pt=/<%-([\s\S]+?)%>/g,qt=/<%([\s\S]+?)%>/g,Nt=/<%=([\s\S]+?)%>/g,jt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Gt=/^\w*$/,kt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ft=/[\\^$.*+?()[\]{}|]/g,bt=RegExp(Ft.source),Zt=/^\s+/,yn=/\s/,Dn=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Gn=/\{\n\/\* \[wrapped with (.+)\] \*/,Un=/,? & /,Zi=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,an=/[()=,{}\[\]\/\s]/,Xt=/\\(\\)?/g,oi=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Ze=/\w*$/,ue=/^[-+]0x[0-9a-f]+$/i,Ve=/^0b[01]+$/i,ot=/^\[object .+?Constructor\]$/,Sn=/^0o[0-7]+$/i,$n=/^(?:0|[1-9]\d*)$/,Ci=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,An=/($^)/,lo=/['\n\r\u2028\u2029\\]/g,Qo="\\ud800-\\udfff",zo="\\u0300-\\u036f",ic="\\ufe20-\\ufe2f",Xc="\\u20d0-\\u20ff",Gr=zo+ic+Xc,za="\\u2700-\\u27bf",ml="a-z\\xdf-\\xf6\\xf8-\\xff",_a="\\xac\\xb1\\xd7\\xf7",vl="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",oc="\\u2000-\\u206f",Yc=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",ba="A-Z\\xc0-\\xd6\\xd8-\\xde",Xu="\\ufe0e\\ufe0f",_l=_a+vl+oc+Yc,mi="['\u2019]",gi="["+Qo+"]",Kt="["+_l+"]",on="["+Gr+"]",vi="\\d+",Uo="["+za+"]",Qi="["+ml+"]",Jo="[^"+Qo+_l+vi+za+ml+ba+"]",vr="\\ud83c[\\udffb-\\udfff]",zs="(?:"+on+"|"+vr+")",Tr="[^"+Qo+"]",cs="(?:\\ud83c[\\udde6-\\uddff]){2}",Is="[\\ud800-\\udbff][\\udc00-\\udfff]",er="["+ba+"]",s_="\\u200d",Zc="(?:"+Qi+"|"+Jo+")",Mf="(?:"+er+"|"+Jo+")",Af="(?:"+mi+"(?:d|ll|m|re|s|t|ve))?",Pf="(?:"+mi+"(?:D|LL|M|RE|S|T|VE))?",wp=zs+"?",yp="["+Xu+"]?",n1="(?:"+s_+"(?:"+[Tr,cs,Is].join("|")+")"+yp+wp+")*",OS="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",FS="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",i1=yp+wp+n1,BS="(?:"+[Uo,cs,Is].join("|")+")"+i1,rn="(?:"+[Tr+on+"?",on,cs,Is,gi].join("|")+")",Xn=RegExp(mi,"g"),tr=RegExp(on,"g"),ur=RegExp(vr+"(?="+vr+")|"+rn+i1,"g"),nr=RegExp([er+"?"+Qi+"+"+Af+"(?="+[Kt,er,"$"].join("|")+")",Mf+"+"+Pf+"(?="+[Kt,er+Zc,"$"].join("|")+")",er+"?"+Zc+"+"+Af,er+"+"+Pf,FS,OS,vi,BS].join("|"),"g"),o1=RegExp("["+s_+Qo+Gr+Xu+"]"),WS=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,DT=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],r1=-1,jo={};jo[Te]=jo[We]=jo[je]=jo[mt]=jo[Et]=jo[At]=jo[Je]=jo[xt]=jo[Ot]=!0,jo[he]=jo[pe]=jo[we]=jo[Se]=jo[Le]=jo[Fe]=jo[ce]=jo[Pe]=jo[xe]=jo[Ee]=jo[nt]=jo[re]=jo[ie]=jo[se]=jo[oe]=!1;var Po={};Po[he]=Po[pe]=Po[we]=Po[Le]=Po[Se]=Po[Fe]=Po[Te]=Po[We]=Po[je]=Po[mt]=Po[Et]=Po[xe]=Po[Ee]=Po[nt]=Po[re]=Po[ie]=Po[se]=Po[U]=Po[At]=Po[Je]=Po[xt]=Po[Ot]=!0,Po[ce]=Po[Pe]=Po[oe]=!1;var kxe={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"s"},Ixe={"&":"&","<":"<",">":">",'"':""","'":"'"},Txe={"&":"&","<":"<",">":">",""":'"',"'":"'"},Nxe={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Rxe=parseFloat,Mxe=parseInt,XY=typeof nx=="object"&&nx&&nx.Object===Object&&nx,Axe=typeof self=="object"&&self&&self.Object===Object&&self,Us=XY||Axe||Function("return this")(),i3=e&&!e.nodeType&&e,a_=i3&&!0&&i&&!i.nodeType&&i,YY=a_&&a_.exports===i3,o3=YY&&XY.process,Qc=function(){try{var Ie=a_&&a_.require&&a_.require("util").types;return Ie||o3&&o3.binding&&o3.binding("util")}catch{}}(),ZY=Qc&&Qc.isArrayBuffer,QY=Qc&&Qc.isDate,JY=Qc&&Qc.isMap,eZ=Qc&&Qc.isRegExp,tZ=Qc&&Qc.isSet,nZ=Qc&&Qc.isTypedArray;function rc(Ie,it,qe){switch(qe.length){case 0:return Ie.call(it);case 1:return Ie.call(it,qe[0]);case 2:return Ie.call(it,qe[0],qe[1]);case 3:return Ie.call(it,qe[0],qe[1],qe[2])}return Ie.apply(it,qe)}function Pxe(Ie,it,qe,Yt){for(var ei=-1,Ji=Ie==null?0:Ie.length;++ei-1}function r3(Ie,it,qe){for(var Yt=-1,ei=Ie==null?0:Ie.length;++Yt-1;);return qe}function uZ(Ie,it){for(var qe=Ie.length;qe--&&s1(it,Ie[qe],0)>-1;);return qe}function Uxe(Ie,it){for(var qe=Ie.length,Yt=0;qe--;)Ie[qe]===it&&++Yt;return Yt}var jxe=c3(kxe),Kxe=c3(Ixe);function qxe(Ie){return"\\"+Nxe[Ie]}function Gxe(Ie,it){return Ie==null?t:Ie[it]}function a1(Ie){return o1.test(Ie)}function Xxe(Ie){return WS.test(Ie)}function Yxe(Ie){for(var it,qe=[];!(it=Ie.next()).done;)qe.push(it.value);return qe}function f3(Ie){var it=-1,qe=Array(Ie.size);return Ie.forEach(function(Yt,ei){qe[++it]=[ei,Yt]}),qe}function dZ(Ie,it){return function(qe){return Ie(it(qe))}}function Lp(Ie,it){for(var qe=-1,Yt=Ie.length,ei=0,Ji=[];++qe-1}function FLe(b,S){var T=this.__data__,O=jT(T,b);return O<0?(++this.size,T.push([b,S])):T[O][1]=S,this}Of.prototype.clear=MLe,Of.prototype.delete=ALe,Of.prototype.get=PLe,Of.prototype.has=OLe,Of.prototype.set=FLe;function Ff(b){var S=-1,T=b==null?0:b.length;for(this.clear();++S=S?b:S)),b}function nu(b,S,T,O,q,ne){var ge,ye=S&d,Re=S&h,ut=S&f;if(T&&(ge=q?T(b,O,q,ne):T(b)),ge!==t)return ge;if(!dr(b))return b;var dt=ni(b);if(dt){if(ge=HEe(b),!ye)return bl(b,ge)}else{var vt=wa(b),Ht=vt==Pe||vt==Oe;if(Np(b))return qZ(b,ye);if(vt==nt||vt==he||Ht&&!q){if(ge=Re||Ht?{}:hQ(b),!ye)return Re?TEe(b,JLe(ge,b)):IEe(b,SZ(ge,b))}else{if(!Po[vt])return q?b:{};ge=$Ee(b,vt,ye)}}ne||(ne=new Zu);var un=ne.get(b);if(un)return un;ne.set(b,ge),HQ(b)?b.forEach(function(Bn){ge.add(nu(Bn,S,T,Bn,b,ne))}):WQ(b)&&b.forEach(function(Bn,wi){ge.set(wi,nu(Bn,S,T,wi,b,ne))});var Fn=ut?Re?W3:B3:Re?wl:Ts,di=dt?t:Fn(b);return Jc(di||b,function(Bn,wi){di&&(wi=Bn,Bn=b[wi]),KS(ge,wi,nu(Bn,S,T,wi,b,ne))}),ge}function eEe(b){var S=Ts(b);return function(T){return xZ(T,b,S)}}function xZ(b,S,T){var O=T.length;if(b==null)return!O;for(b=Do(b);O--;){var q=T[O],ne=S[q],ge=b[q];if(ge===t&&!(q in b)||!ne(ge))return!1}return!0}function LZ(b,S,T){if(typeof b!="function")throw new eu(s);return JS(function(){b.apply(t,T)},S)}function qS(b,S,T,O){var q=-1,ne=kT,ge=!0,ye=b.length,Re=[],ut=S.length;if(!ye)return Re;T&&(S=ir(S,sc(T))),O?(ne=r3,ge=!1):S.length>=o&&(ne=VS,ge=!1,S=new u_(S));e:for(;++qq?0:q+T),O=O===t||O>q?q:ai(O),O<0&&(O+=q),O=T>O?0:zQ(O);T0&&T(ye)?S>1?js(ye,S-1,T,O,q):xp(q,ye):O||(q[q.length]=ye)}return q}var C3=JZ(),kZ=JZ(!0);function dh(b,S){return b&&C3(b,S,Ts)}function w3(b,S){return b&&kZ(b,S,Ts)}function qT(b,S){return Sp(S,function(T){return $f(b[T])})}function h_(b,S){S=Ip(S,b);for(var T=0,O=S.length;b!=null&&TS}function iEe(b,S){return b!=null&&co.call(b,S)}function oEe(b,S){return b!=null&&S in Do(b)}function rEe(b,S,T){return b>=Ca(S,T)&&b=120&&dt.length>=120)?new u_(ge&&dt):t}dt=b[0];var vt=-1,Ht=ye[0];e:for(;++vt-1;)ye!==b&&BT.call(ye,Re,1),BT.call(b,Re,1);return b}function WZ(b,S){for(var T=b?S.length:0,O=T-1;T--;){var q=S[T];if(T==O||q!==ne){var ne=q;Hf(q)?BT.call(b,q,1):N3(b,q)}}return b}function k3(b,S){return b+HT(bZ()*(S-b+1))}function _Ee(b,S,T,O){for(var q=-1,ne=ds(VT((S-b)/(T||1)),0),ge=qe(ne);ne--;)ge[O?ne:++q]=b,b+=T;return ge}function I3(b,S){var T="";if(!b||S<1||S>$)return T;do S%2&&(T+=b),S=HT(S/2),S&&(b+=b);while(S);return T}function pi(b,S){return K3(pQ(b,S,yl),b+"")}function bEe(b){return yZ(_1(b))}function CEe(b,S){var T=_1(b);return oN(T,d_(S,0,T.length))}function YS(b,S,T,O){if(!dr(b))return b;S=Ip(S,b);for(var q=-1,ne=S.length,ge=ne-1,ye=b;ye!=null&&++qq?0:q+S),T=T>q?q:T,T<0&&(T+=q),q=S>T?0:T-S>>>0,S>>>=0;for(var ne=qe(q);++O>>1,ge=b[ne];ge!==null&&!lc(ge)&&(T?ge<=S:ge=o){var ut=S?null:AEe(b);if(ut)return TT(ut);ge=!1,q=VS,Re=new u_}else Re=S?[]:ye;e:for(;++O=O?b:iu(b,S,T)}var KZ=dLe||function(b){return Us.clearTimeout(b)};function qZ(b,S){if(S)return b.slice();var T=b.length,O=gZ?gZ(T):new b.constructor(T);return b.copy(O),O}function P3(b){var S=new b.constructor(b.byteLength);return new OT(S).set(new OT(b)),S}function LEe(b,S){var T=S?P3(b.buffer):b.buffer;return new b.constructor(T,b.byteOffset,b.byteLength)}function EEe(b){var S=new b.constructor(b.source,Ze.exec(b));return S.lastIndex=b.lastIndex,S}function DEe(b){return jS?Do(jS.call(b)):{}}function GZ(b,S){var T=S?P3(b.buffer):b.buffer;return new b.constructor(T,b.byteOffset,b.length)}function XZ(b,S){if(b!==S){var T=b!==t,O=b===null,q=b===b,ne=lc(b),ge=S!==t,ye=S===null,Re=S===S,ut=lc(S);if(!ye&&!ut&&!ne&&b>S||ne&&ge&&Re&&!ye&&!ut||O&&ge&&Re||!T&&Re||!q)return 1;if(!O&&!ne&&!ut&&b=ye)return Re;var ut=T[O];return Re*(ut=="desc"?-1:1)}}return b.index-S.index}function YZ(b,S,T,O){for(var q=-1,ne=b.length,ge=T.length,ye=-1,Re=S.length,ut=ds(ne-ge,0),dt=qe(Re+ut),vt=!O;++ye1?T[q-1]:t,ge=q>2?T[2]:t;for(ne=b.length>3&&typeof ne=="function"?(q--,ne):t,ge&&ja(T[0],T[1],ge)&&(ne=q<3?t:ne,q=1),S=Do(S);++O-1?q[ne?S[ge]:ge]:t}}function nQ(b){return Vf(function(S){var T=S.length,O=T,q=tu.prototype.thru;for(b&&S.reverse();O--;){var ne=S[O];if(typeof ne!="function")throw new eu(s);if(q&&!ge&&nN(ne)=="wrapper")var ge=new tu([],!0)}for(O=ge?O:T;++O1&&Ni.reverse(),dt&&Reye))return!1;var ut=ne.get(b),dt=ne.get(S);if(ut&&dt)return ut==S&&dt==b;var vt=-1,Ht=!0,un=T&p?new u_:t;for(ne.set(b,S),ne.set(S,b);++vt1?"& ":"")+S[O],S=S.join(T>2?", ":" "),b.replace(Dn,`{ + */(function(i,e){(function(){var t,n="4.17.21",o=200,r="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",s="Expected a function",a="Invalid `variable` option passed into `_.template`",l="__lodash_hash_undefined__",c=500,u="__lodash_placeholder__",d=1,h=2,f=4,g=1,p=2,v=1,m=2,_=4,y=8,w=16,L=32,D=64,E=128,I=256,k=512,R=30,A="...",P=800,N=16,M=1,H=2,B=3,F=1/0,$=9007199254740991,z=17976931348623157e292,K=0/0,j=4294967295,G=j-1,X=j>>>1,de=[["ary",E],["bind",v],["bindKey",m],["curry",y],["curryRight",w],["flip",k],["partial",L],["partialRight",D],["rearg",I]],fe="[object Arguments]",pe="[object Array]",be="[object AsyncFunction]",Se="[object Boolean]",Fe="[object Date]",De="[object DOMException]",ce="[object Error]",Pe="[object Function]",Oe="[object GeneratorFunction]",xe="[object Map]",Ee="[object Number]",tt="[object Null]",nt="[object Object]",Qe="[object Promise]",Ge="[object Proxy]",re="[object RegExp]",ie="[object Set]",se="[object String]",U="[object Symbol]",Y="[object Undefined]",oe="[object WeakMap]",te="[object WeakSet]",ye="[object ArrayBuffer]",Le="[object DataView]",Te="[object Float32Array]",We="[object Float64Array]",je="[object Int8Array]",mt="[object Int16Array]",Dt="[object Int32Array]",At="[object Uint8Array]",Je="[object Uint8ClampedArray]",Lt="[object Uint16Array]",Ot="[object Uint32Array]",Vn=/\b__p \+= '';/g,Et=/\b(__p \+=) '' \+/g,tn=/(__e\(.*?\)|\b__t\)) \+\n'';/g,ui=/&(?:amp|lt|gt|quot|#39);/g,cn=/[&<>"']/g,qn=RegExp(ui.source),bn=RegExp(cn.source),Pt=/<%-([\s\S]+?)%>/g,qt=/<%([\s\S]+?)%>/g,Nt=/<%=([\s\S]+?)%>/g,jt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Gt=/^\w*$/,It=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ft=/[\\^$.*+?()[\]{}|]/g,bt=RegExp(Ft.source),Zt=/^\s+/,wn=/\s/,Dn=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Gn=/\{\n\/\* \[wrapped with (.+)\] \*/,Un=/,? & /,Zi=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,an=/[()=,{}\[\]\/\s]/,Xt=/\\(\\)?/g,oi=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Ze=/\w*$/,ue=/^[-+]0x[0-9a-f]+$/i,Ve=/^0b[01]+$/i,ot=/^\[object .+?Constructor\]$/,Sn=/^0o[0-7]+$/i,$n=/^(?:0|[1-9]\d*)$/,Ci=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,An=/($^)/,lo=/['\n\r\u2028\u2029\\]/g,Qo="\\ud800-\\udfff",zo="\\u0300-\\u036f",oc="\\ufe20-\\ufe2f",Yc="\\u20d0-\\u20ff",Gr=zo+oc+Yc,Ua="\\u2700-\\u27bf",vl="a-z\\xdf-\\xf6\\xf8-\\xff",ba="\\xac\\xb1\\xd7\\xf7",_l="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",rc="\\u2000-\\u206f",Zc=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Ca="A-Z\\xc0-\\xd6\\xd8-\\xde",Yu="\\ufe0e\\ufe0f",bl=ba+_l+rc+Zc,mi="['\u2019]",gi="["+Qo+"]",Kt="["+bl+"]",on="["+Gr+"]",vi="\\d+",Uo="["+Ua+"]",Qi="["+vl+"]",Jo="[^"+Qo+bl+vi+Ua+vl+Ca+"]",_r="\\ud83c[\\udffb-\\udfff]",zs="(?:"+on+"|"+_r+")",Tr="[^"+Qo+"]",us="(?:\\ud83c[\\udde6-\\uddff]){2}",Ts="[\\ud800-\\udbff][\\udc00-\\udfff]",er="["+Ca+"]",s_="\\u200d",Qc="(?:"+Qi+"|"+Jo+")",Mf="(?:"+er+"|"+Jo+")",Af="(?:"+mi+"(?:d|ll|m|re|s|t|ve))?",Pf="(?:"+mi+"(?:D|LL|M|RE|S|T|VE))?",Sp=zs+"?",xp="["+Yu+"]?",i1="(?:"+s_+"(?:"+[Tr,us,Ts].join("|")+")"+xp+Sp+")*",FS="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",BS="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",o1=xp+Sp+i1,WS="(?:"+[Uo,us,Ts].join("|")+")"+o1,rn="(?:"+[Tr+on+"?",on,us,Ts,gi].join("|")+")",Xn=RegExp(mi,"g"),tr=RegExp(on,"g"),ur=RegExp(_r+"(?="+_r+")|"+rn+o1,"g"),nr=RegExp([er+"?"+Qi+"+"+Af+"(?="+[Kt,er,"$"].join("|")+")",Mf+"+"+Pf+"(?="+[Kt,er+Qc,"$"].join("|")+")",er+"?"+Qc+"+"+Af,er+"+"+Pf,BS,FS,vi,WS].join("|"),"g"),r1=RegExp("["+s_+Qo+Gr+Yu+"]"),VS=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,TT=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],s1=-1,jo={};jo[Te]=jo[We]=jo[je]=jo[mt]=jo[Dt]=jo[At]=jo[Je]=jo[Lt]=jo[Ot]=!0,jo[fe]=jo[pe]=jo[ye]=jo[Se]=jo[Le]=jo[Fe]=jo[ce]=jo[Pe]=jo[xe]=jo[Ee]=jo[nt]=jo[re]=jo[ie]=jo[se]=jo[oe]=!1;var Po={};Po[fe]=Po[pe]=Po[ye]=Po[Le]=Po[Se]=Po[Fe]=Po[Te]=Po[We]=Po[je]=Po[mt]=Po[Dt]=Po[xe]=Po[Ee]=Po[nt]=Po[re]=Po[ie]=Po[se]=Po[U]=Po[At]=Po[Je]=Po[Lt]=Po[Ot]=!0,Po[ce]=Po[Pe]=Po[oe]=!1;var Wxe={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"s"},Vxe={"&":"&","<":"<",">":">",'"':""","'":"'"},Hxe={"&":"&","<":"<",">":">",""":'"',"'":"'"},$xe={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},zxe=parseFloat,Uxe=parseInt,iZ=typeof ix=="object"&&ix&&ix.Object===Object&&ix,jxe=typeof self=="object"&&self&&self.Object===Object&&self,Us=iZ||jxe||Function("return this")(),i3=e&&!e.nodeType&&e,a_=i3&&!0&&i&&!i.nodeType&&i,oZ=a_&&a_.exports===i3,o3=oZ&&iZ.process,Jc=function(){try{var Ie=a_&&a_.require&&a_.require("util").types;return Ie||o3&&o3.binding&&o3.binding("util")}catch{}}(),rZ=Jc&&Jc.isArrayBuffer,sZ=Jc&&Jc.isDate,aZ=Jc&&Jc.isMap,lZ=Jc&&Jc.isRegExp,cZ=Jc&&Jc.isSet,uZ=Jc&&Jc.isTypedArray;function sc(Ie,it,qe){switch(qe.length){case 0:return Ie.call(it);case 1:return Ie.call(it,qe[0]);case 2:return Ie.call(it,qe[0],qe[1]);case 3:return Ie.call(it,qe[0],qe[1],qe[2])}return Ie.apply(it,qe)}function Kxe(Ie,it,qe,Yt){for(var ei=-1,Ji=Ie==null?0:Ie.length;++ei-1}function r3(Ie,it,qe){for(var Yt=-1,ei=Ie==null?0:Ie.length;++Yt-1;);return qe}function _Z(Ie,it){for(var qe=Ie.length;qe--&&a1(it,Ie[qe],0)>-1;);return qe}function tLe(Ie,it){for(var qe=Ie.length,Yt=0;qe--;)Ie[qe]===it&&++Yt;return Yt}var nLe=c3(Wxe),iLe=c3(Vxe);function oLe(Ie){return"\\"+$xe[Ie]}function rLe(Ie,it){return Ie==null?t:Ie[it]}function l1(Ie){return r1.test(Ie)}function sLe(Ie){return VS.test(Ie)}function aLe(Ie){for(var it,qe=[];!(it=Ie.next()).done;)qe.push(it.value);return qe}function f3(Ie){var it=-1,qe=Array(Ie.size);return Ie.forEach(function(Yt,ei){qe[++it]=[ei,Yt]}),qe}function bZ(Ie,it){return function(qe){return Ie(it(qe))}}function Dp(Ie,it){for(var qe=-1,Yt=Ie.length,ei=0,Ji=[];++qe-1}function GLe(b,S){var T=this.__data__,O=GT(T,b);return O<0?(++this.size,T.push([b,S])):T[O][1]=S,this}Of.prototype.clear=ULe,Of.prototype.delete=jLe,Of.prototype.get=KLe,Of.prototype.has=qLe,Of.prototype.set=GLe;function Ff(b){var S=-1,T=b==null?0:b.length;for(this.clear();++S=S?b:S)),b}function iu(b,S,T,O,q,ne){var ge,we=S&d,Re=S&h,ut=S&f;if(T&&(ge=q?T(b,O,q,ne):T(b)),ge!==t)return ge;if(!dr(b))return b;var dt=ni(b);if(dt){if(ge=QEe(b),!we)return Cl(b,ge)}else{var vt=wa(b),Ht=vt==Pe||vt==Oe;if(Mp(b))return tQ(b,we);if(vt==nt||vt==fe||Ht&&!q){if(ge=Re||Ht?{}:CQ(b),!we)return Re?HEe(b,uEe(ge,b)):VEe(b,NZ(ge,b))}else{if(!Po[vt])return q?b:{};ge=JEe(b,vt,we)}}ne||(ne=new Qu);var un=ne.get(b);if(un)return un;ne.set(b,ge),XQ(b)?b.forEach(function(Bn){ge.add(iu(Bn,S,T,Bn,b,ne))}):qQ(b)&&b.forEach(function(Bn,yi){ge.set(yi,iu(Bn,S,T,yi,b,ne))});var Fn=ut?Re?W3:B3:Re?wl:Ns,di=dt?t:Fn(b);return eu(di||b,function(Bn,yi){di&&(yi=Bn,Bn=b[yi]),qS(ge,yi,iu(Bn,S,T,yi,b,ne))}),ge}function dEe(b){var S=Ns(b);return function(T){return RZ(T,b,S)}}function RZ(b,S,T){var O=T.length;if(b==null)return!O;for(b=Do(b);O--;){var q=T[O],ne=S[q],ge=b[q];if(ge===t&&!(q in b)||!ne(ge))return!1}return!0}function MZ(b,S,T){if(typeof b!="function")throw new tu(s);return ex(function(){b.apply(t,T)},S)}function GS(b,S,T,O){var q=-1,ne=NT,ge=!0,we=b.length,Re=[],ut=S.length;if(!we)return Re;T&&(S=ir(S,ac(T))),O?(ne=r3,ge=!1):S.length>=o&&(ne=HS,ge=!1,S=new u_(S));e:for(;++qq?0:q+T),O=O===t||O>q?q:ai(O),O<0&&(O+=q),O=T>O?0:ZQ(O);T0&&T(we)?S>1?js(we,S-1,T,O,q):Ep(q,we):O||(q[q.length]=we)}return q}var C3=aQ(),OZ=aQ(!0);function fh(b,S){return b&&C3(b,S,Ns)}function y3(b,S){return b&&OZ(b,S,Ns)}function YT(b,S){return Lp(S,function(T){return $f(b[T])})}function h_(b,S){S=Np(S,b);for(var T=0,O=S.length;b!=null&&TS}function gEe(b,S){return b!=null&&co.call(b,S)}function pEe(b,S){return b!=null&&S in Do(b)}function mEe(b,S,T){return b>=ya(S,T)&&b=120&&dt.length>=120)?new u_(ge&&dt):t}dt=b[0];var vt=-1,Ht=we[0];e:for(;++vt-1;)we!==b&&HT.call(we,Re,1),HT.call(b,Re,1);return b}function qZ(b,S){for(var T=b?S.length:0,O=T-1;T--;){var q=S[T];if(T==O||q!==ne){var ne=q;Hf(q)?HT.call(b,q,1):N3(b,q)}}return b}function k3(b,S){return b+UT(DZ()*(S-b+1))}function IEe(b,S,T,O){for(var q=-1,ne=hs(zT((S-b)/(T||1)),0),ge=qe(ne);ne--;)ge[O?ne:++q]=b,b+=T;return ge}function I3(b,S){var T="";if(!b||S<1||S>$)return T;do S%2&&(T+=b),S=UT(S/2),S&&(b+=b);while(S);return T}function pi(b,S){return K3(SQ(b,S,Sl),b+"")}function TEe(b){return TZ(b1(b))}function NEe(b,S){var T=b1(b);return aN(T,d_(S,0,T.length))}function ZS(b,S,T,O){if(!dr(b))return b;S=Np(S,b);for(var q=-1,ne=S.length,ge=ne-1,we=b;we!=null&&++qq?0:q+S),T=T>q?q:T,T<0&&(T+=q),q=S>T?0:T-S>>>0,S>>>=0;for(var ne=qe(q);++O>>1,ge=b[ne];ge!==null&&!cc(ge)&&(T?ge<=S:ge=o){var ut=S?null:jEe(b);if(ut)return MT(ut);ge=!1,q=HS,Re=new u_}else Re=S?[]:we;e:for(;++O=O?b:ou(b,S,T)}var eQ=wLe||function(b){return Us.clearTimeout(b)};function tQ(b,S){if(S)return b.slice();var T=b.length,O=wZ?wZ(T):new b.constructor(T);return b.copy(O),O}function P3(b){var S=new b.constructor(b.byteLength);return new WT(S).set(new WT(b)),S}function OEe(b,S){var T=S?P3(b.buffer):b.buffer;return new b.constructor(T,b.byteOffset,b.byteLength)}function FEe(b){var S=new b.constructor(b.source,Ze.exec(b));return S.lastIndex=b.lastIndex,S}function BEe(b){return KS?Do(KS.call(b)):{}}function nQ(b,S){var T=S?P3(b.buffer):b.buffer;return new b.constructor(T,b.byteOffset,b.length)}function iQ(b,S){if(b!==S){var T=b!==t,O=b===null,q=b===b,ne=cc(b),ge=S!==t,we=S===null,Re=S===S,ut=cc(S);if(!we&&!ut&&!ne&&b>S||ne&&ge&&Re&&!we&&!ut||O&&ge&&Re||!T&&Re||!q)return 1;if(!O&&!ne&&!ut&&b=we)return Re;var ut=T[O];return Re*(ut=="desc"?-1:1)}}return b.index-S.index}function oQ(b,S,T,O){for(var q=-1,ne=b.length,ge=T.length,we=-1,Re=S.length,ut=hs(ne-ge,0),dt=qe(Re+ut),vt=!O;++we1?T[q-1]:t,ge=q>2?T[2]:t;for(ne=b.length>3&&typeof ne=="function"?(q--,ne):t,ge&&Ka(T[0],T[1],ge)&&(ne=q<3?t:ne,q=1),S=Do(S);++O-1?q[ne?S[ge]:ge]:t}}function uQ(b){return Vf(function(S){var T=S.length,O=T,q=nu.prototype.thru;for(b&&S.reverse();O--;){var ne=S[O];if(typeof ne!="function")throw new tu(s);if(q&&!ge&&rN(ne)=="wrapper")var ge=new nu([],!0)}for(O=ge?O:T;++O1&&Ni.reverse(),dt&&Rewe))return!1;var ut=ne.get(b),dt=ne.get(S);if(ut&&dt)return ut==S&&dt==b;var vt=-1,Ht=!0,un=T&p?new u_:t;for(ne.set(b,S),ne.set(S,b);++vt1?"& ":"")+S[O],S=S.join(T>2?", ":" "),b.replace(Dn,`{ /* [wrapped with `+S+`] */ -`)}function UEe(b){return ni(b)||p_(b)||!!(vZ&&b&&b[vZ])}function Hf(b,S){var T=typeof b;return S=S==null?$:S,!!S&&(T=="number"||T!="symbol"&&$n.test(b))&&b>-1&&b%1==0&&b0){if(++S>=P)return arguments[0]}else S=0;return b.apply(t,arguments)}}function oN(b,S){var T=-1,O=b.length,q=O-1;for(S=S===t?O:S;++T1?b[S-1]:t;return T=typeof T=="function"?(b.pop(),T):t,DQ(b,T)});function kQ(b){var S=ee(b);return S.__chain__=!0,S}function tke(b,S){return S(b),b}function rN(b,S){return S(b)}var nke=Vf(function(b){var S=b.length,T=S?b[0]:0,O=this.__wrapped__,q=function(ne){return b3(ne,b)};return S>1||this.__actions__.length||!(O instanceof Li)||!Hf(T)?this.thru(q):(O=O.slice(T,+T+(S?1:0)),O.__actions__.push({func:rN,args:[q],thisArg:t}),new tu(O,this.__chain__).thru(function(ne){return S&&!ne.length&&ne.push(t),ne}))});function ike(){return kQ(this)}function oke(){return new tu(this.value(),this.__chain__)}function rke(){this.__values__===t&&(this.__values__=$Q(this.value()));var b=this.__index__>=this.__values__.length,S=b?t:this.__values__[this.__index__++];return{done:b,value:S}}function ske(){return this}function ake(b){for(var S,T=this;T instanceof UT;){var O=wQ(T);O.__index__=0,O.__values__=t,S?q.__wrapped__=O:S=O;var q=O;T=T.__wrapped__}return q.__wrapped__=b,S}function lke(){var b=this.__wrapped__;if(b instanceof Li){var S=b;return this.__actions__.length&&(S=new Li(this)),S=S.reverse(),S.__actions__.push({func:rN,args:[q3],thisArg:t}),new tu(S,this.__chain__)}return this.thru(q3)}function cke(){return UZ(this.__wrapped__,this.__actions__)}var uke=ZT(function(b,S,T){co.call(b,T)?++b[T]:Bf(b,T,1)});function dke(b,S,T){var O=ni(b)?iZ:tEe;return T&&ja(b,S,T)&&(S=t),O(b,Pn(S,3))}function hke(b,S){var T=ni(b)?Sp:DZ;return T(b,Pn(S,3))}var fke=tQ(yQ),gke=tQ(SQ);function pke(b,S){return js(sN(b,S),1)}function mke(b,S){return js(sN(b,S),F)}function vke(b,S,T){return T=T===t?1:ai(T),js(sN(b,S),T)}function IQ(b,S){var T=ni(b)?Jc:Dp;return T(b,Pn(S,3))}function TQ(b,S){var T=ni(b)?Oxe:EZ;return T(b,Pn(S,3))}var _ke=ZT(function(b,S,T){co.call(b,T)?b[T].push(S):Bf(b,T,[S])});function bke(b,S,T,O){b=Cl(b)?b:_1(b),T=T&&!O?ai(T):0;var q=b.length;return T<0&&(T=ds(q+T,0)),dN(b)?T<=q&&b.indexOf(S,T)>-1:!!q&&s1(b,S,T)>-1}var Cke=pi(function(b,S,T){var O=-1,q=typeof S=="function",ne=Cl(b)?qe(b.length):[];return Dp(b,function(ge){ne[++O]=q?rc(S,ge,T):GS(ge,S,T)}),ne}),wke=ZT(function(b,S,T){Bf(b,T,S)});function sN(b,S){var T=ni(b)?ir:MZ;return T(b,Pn(S,3))}function yke(b,S,T,O){return b==null?[]:(ni(S)||(S=S==null?[]:[S]),T=O?t:T,ni(T)||(T=T==null?[]:[T]),FZ(b,S,T))}var Ske=ZT(function(b,S,T){b[T?0:1].push(S)},function(){return[[],[]]});function xke(b,S,T){var O=ni(b)?s3:aZ,q=arguments.length<3;return O(b,Pn(S,4),T,q,Dp)}function Lke(b,S,T){var O=ni(b)?Fxe:aZ,q=arguments.length<3;return O(b,Pn(S,4),T,q,EZ)}function Eke(b,S){var T=ni(b)?Sp:DZ;return T(b,cN(Pn(S,3)))}function Dke(b){var S=ni(b)?yZ:bEe;return S(b)}function kke(b,S,T){(T?ja(b,S,T):S===t)?S=1:S=ai(S);var O=ni(b)?YLe:CEe;return O(b,S)}function Ike(b){var S=ni(b)?ZLe:yEe;return S(b)}function Tke(b){if(b==null)return 0;if(Cl(b))return dN(b)?l1(b):b.length;var S=wa(b);return S==xe||S==ie?b.size:L3(b).length}function Nke(b,S,T){var O=ni(b)?a3:SEe;return T&&ja(b,S,T)&&(S=t),O(b,Pn(S,3))}var Rke=pi(function(b,S){if(b==null)return[];var T=S.length;return T>1&&ja(b,S[0],S[1])?S=[]:T>2&&ja(S[0],S[1],S[2])&&(S=[S[0]]),FZ(b,js(S,1),[])}),aN=hLe||function(){return Us.Date.now()};function Mke(b,S){if(typeof S!="function")throw new eu(s);return b=ai(b),function(){if(--b<1)return S.apply(this,arguments)}}function NQ(b,S,T){return S=T?t:S,S=b&&S==null?b.length:S,Wf(b,E,t,t,t,t,S)}function RQ(b,S){var T;if(typeof S!="function")throw new eu(s);return b=ai(b),function(){return--b>0&&(T=S.apply(this,arguments)),b<=1&&(S=t),T}}var X3=pi(function(b,S,T){var O=v;if(T.length){var q=Lp(T,m1(X3));O|=L}return Wf(b,O,S,T,q)}),MQ=pi(function(b,S,T){var O=v|m;if(T.length){var q=Lp(T,m1(MQ));O|=L}return Wf(S,O,b,T,q)});function AQ(b,S,T){S=T?t:S;var O=Wf(b,w,t,t,t,t,t,S);return O.placeholder=AQ.placeholder,O}function PQ(b,S,T){S=T?t:S;var O=Wf(b,y,t,t,t,t,t,S);return O.placeholder=PQ.placeholder,O}function OQ(b,S,T){var O,q,ne,ge,ye,Re,ut=0,dt=!1,vt=!1,Ht=!0;if(typeof b!="function")throw new eu(s);S=ru(S)||0,dr(T)&&(dt=!!T.leading,vt="maxWait"in T,ne=vt?ds(ru(T.maxWait)||0,S):ne,Ht="trailing"in T?!!T.trailing:Ht);function un(Rr){var Ju=O,Uf=q;return O=q=t,ut=Rr,ge=b.apply(Uf,Ju),ge}function Fn(Rr){return ut=Rr,ye=JS(wi,S),dt?un(Rr):ge}function di(Rr){var Ju=Rr-Re,Uf=Rr-ut,tJ=S-Ju;return vt?Ca(tJ,ne-Uf):tJ}function Bn(Rr){var Ju=Rr-Re,Uf=Rr-ut;return Re===t||Ju>=S||Ju<0||vt&&Uf>=ne}function wi(){var Rr=aN();if(Bn(Rr))return Ni(Rr);ye=JS(wi,di(Rr))}function Ni(Rr){return ye=t,Ht&&O?un(Rr):(O=q=t,ge)}function cc(){ye!==t&&KZ(ye),ut=0,O=Re=q=ye=t}function Ka(){return ye===t?ge:Ni(aN())}function uc(){var Rr=aN(),Ju=Bn(Rr);if(O=arguments,q=this,Re=Rr,Ju){if(ye===t)return Fn(Re);if(vt)return KZ(ye),ye=JS(wi,S),un(Re)}return ye===t&&(ye=JS(wi,S)),ge}return uc.cancel=cc,uc.flush=Ka,uc}var Ake=pi(function(b,S){return LZ(b,1,S)}),Pke=pi(function(b,S,T){return LZ(b,ru(S)||0,T)});function Oke(b){return Wf(b,k)}function lN(b,S){if(typeof b!="function"||S!=null&&typeof S!="function")throw new eu(s);var T=function(){var O=arguments,q=S?S.apply(this,O):O[0],ne=T.cache;if(ne.has(q))return ne.get(q);var ge=b.apply(this,O);return T.cache=ne.set(q,ge)||ne,ge};return T.cache=new(lN.Cache||Ff),T}lN.Cache=Ff;function cN(b){if(typeof b!="function")throw new eu(s);return function(){var S=arguments;switch(S.length){case 0:return!b.call(this);case 1:return!b.call(this,S[0]);case 2:return!b.call(this,S[0],S[1]);case 3:return!b.call(this,S[0],S[1],S[2])}return!b.apply(this,S)}}function Fke(b){return RQ(2,b)}var Bke=xEe(function(b,S){S=S.length==1&&ni(S[0])?ir(S[0],sc(Pn())):ir(js(S,1),sc(Pn()));var T=S.length;return pi(function(O){for(var q=-1,ne=Ca(O.length,T);++q=S}),p_=TZ(function(){return arguments}())?TZ:function(b){return _r(b)&&co.call(b,"callee")&&!mZ.call(b,"callee")},ni=qe.isArray,Jke=ZY?sc(ZY):aEe;function Cl(b){return b!=null&&uN(b.length)&&!$f(b)}function Nr(b){return _r(b)&&Cl(b)}function eIe(b){return b===!0||b===!1||_r(b)&&Ua(b)==Se}var Np=gLe||a8,tIe=QY?sc(QY):lEe;function nIe(b){return _r(b)&&b.nodeType===1&&!ex(b)}function iIe(b){if(b==null)return!0;if(Cl(b)&&(ni(b)||typeof b=="string"||typeof b.splice=="function"||Np(b)||v1(b)||p_(b)))return!b.length;var S=wa(b);if(S==xe||S==ie)return!b.size;if(QS(b))return!L3(b).length;for(var T in b)if(co.call(b,T))return!1;return!0}function oIe(b,S){return XS(b,S)}function rIe(b,S,T){T=typeof T=="function"?T:t;var O=T?T(b,S):t;return O===t?XS(b,S,t,T):!!O}function Z3(b){if(!_r(b))return!1;var S=Ua(b);return S==ce||S==De||typeof b.message=="string"&&typeof b.name=="string"&&!ex(b)}function sIe(b){return typeof b=="number"&&_Z(b)}function $f(b){if(!dr(b))return!1;var S=Ua(b);return S==Pe||S==Oe||S==be||S==Ge}function BQ(b){return typeof b=="number"&&b==ai(b)}function uN(b){return typeof b=="number"&&b>-1&&b%1==0&&b<=$}function dr(b){var S=typeof b;return b!=null&&(S=="object"||S=="function")}function _r(b){return b!=null&&typeof b=="object"}var WQ=JY?sc(JY):uEe;function aIe(b,S){return b===S||x3(b,S,H3(S))}function lIe(b,S,T){return T=typeof T=="function"?T:t,x3(b,S,H3(S),T)}function cIe(b){return VQ(b)&&b!=+b}function uIe(b){if(qEe(b))throw new ei(r);return NZ(b)}function dIe(b){return b===null}function hIe(b){return b==null}function VQ(b){return typeof b=="number"||_r(b)&&Ua(b)==Ee}function ex(b){if(!_r(b)||Ua(b)!=nt)return!1;var S=FT(b);if(S===null)return!0;var T=co.call(S,"constructor")&&S.constructor;return typeof T=="function"&&T instanceof T&&MT.call(T)==lLe}var Q3=eZ?sc(eZ):dEe;function fIe(b){return BQ(b)&&b>=-$&&b<=$}var HQ=tZ?sc(tZ):hEe;function dN(b){return typeof b=="string"||!ni(b)&&_r(b)&&Ua(b)==se}function lc(b){return typeof b=="symbol"||_r(b)&&Ua(b)==U}var v1=nZ?sc(nZ):fEe;function gIe(b){return b===t}function pIe(b){return _r(b)&&wa(b)==oe}function mIe(b){return _r(b)&&Ua(b)==te}var vIe=tN(E3),_Ie=tN(function(b,S){return b<=S});function $Q(b){if(!b)return[];if(Cl(b))return dN(b)?Yu(b):bl(b);if(HS&&b[HS])return Yxe(b[HS]());var S=wa(b),T=S==xe?f3:S==ie?TT:_1;return T(b)}function zf(b){if(!b)return b===0?b:0;if(b=ru(b),b===F||b===-F){var S=b<0?-1:1;return S*z}return b===b?b:0}function ai(b){var S=zf(b),T=S%1;return S===S?T?S-T:S:0}function zQ(b){return b?d_(ai(b),0,j):0}function ru(b){if(typeof b=="number")return b;if(lc(b))return K;if(dr(b)){var S=typeof b.valueOf=="function"?b.valueOf():b;b=dr(S)?S+"":S}if(typeof b!="string")return b===0?b:+b;b=lZ(b);var T=Ve.test(b);return T||Sn.test(b)?Mxe(b.slice(2),T?2:8):ue.test(b)?K:+b}function UQ(b){return hh(b,wl(b))}function bIe(b){return b?d_(ai(b),-$,$):b===0?b:0}function io(b){return b==null?"":ac(b)}var CIe=g1(function(b,S){if(QS(S)||Cl(S)){hh(S,Ts(S),b);return}for(var T in S)co.call(S,T)&&KS(b,T,S[T])}),jQ=g1(function(b,S){hh(S,wl(S),b)}),hN=g1(function(b,S,T,O){hh(S,wl(S),b,O)}),wIe=g1(function(b,S,T,O){hh(S,Ts(S),b,O)}),yIe=Vf(b3);function SIe(b,S){var T=f1(b);return S==null?T:SZ(T,S)}var xIe=pi(function(b,S){b=Do(b);var T=-1,O=S.length,q=O>2?S[2]:t;for(q&&ja(S[0],S[1],q)&&(O=1);++T1),ne}),hh(b,W3(b),T),O&&(T=nu(T,d|h|f,PEe));for(var q=S.length;q--;)N3(T,S[q]);return T});function $Ie(b,S){return qQ(b,cN(Pn(S)))}var zIe=Vf(function(b,S){return b==null?{}:mEe(b,S)});function qQ(b,S){if(b==null)return{};var T=ir(W3(b),function(O){return[O]});return S=Pn(S),BZ(b,T,function(O,q){return S(O,q[0])})}function UIe(b,S,T){S=Ip(S,b);var O=-1,q=S.length;for(q||(q=1,b=t);++OS){var O=b;b=S,S=O}if(T||b%1||S%1){var q=bZ();return Ca(b+q*(S-b+Rxe("1e-"+((q+"").length-1))),S)}return k3(b,S)}var tTe=p1(function(b,S,T){return S=S.toLowerCase(),b+(T?YQ(S):S)});function YQ(b){return t8(io(b).toLowerCase())}function ZQ(b){return b=io(b),b&&b.replace(Ci,jxe).replace(tr,"")}function nTe(b,S,T){b=io(b),S=ac(S);var O=b.length;T=T===t?O:d_(ai(T),0,O);var q=T;return T-=S.length,T>=0&&b.slice(T,q)==S}function iTe(b){return b=io(b),b&&bn.test(b)?b.replace(cn,Kxe):b}function oTe(b){return b=io(b),b&&bt.test(b)?b.replace(Ft,"\\$&"):b}var rTe=p1(function(b,S,T){return b+(T?"-":"")+S.toLowerCase()}),sTe=p1(function(b,S,T){return b+(T?" ":"")+S.toLowerCase()}),aTe=eQ("toLowerCase");function lTe(b,S,T){b=io(b),S=ai(S);var O=S?l1(b):0;if(!S||O>=S)return b;var q=(S-O)/2;return eN(HT(q),T)+b+eN(VT(q),T)}function cTe(b,S,T){b=io(b),S=ai(S);var O=S?l1(b):0;return S&&O>>0,T?(b=io(b),b&&(typeof S=="string"||S!=null&&!Q3(S))&&(S=ac(S),!S&&a1(b))?Tp(Yu(b),0,T):b.split(S,T)):[]}var mTe=p1(function(b,S,T){return b+(T?" ":"")+t8(S)});function vTe(b,S,T){return b=io(b),T=T==null?0:d_(ai(T),0,b.length),S=ac(S),b.slice(T,T+S.length)==S}function _Te(b,S,T){var O=ee.templateSettings;T&&ja(b,S,T)&&(S=t),b=io(b),S=hN({},S,O,aQ);var q=hN({},S.imports,O.imports,aQ),ne=Ts(q),ge=h3(q,ne),ye,Re,ut=0,dt=S.interpolate||An,vt="__p += '",Ht=g3((S.escape||An).source+"|"+dt.source+"|"+(dt===Nt?oi:An).source+"|"+(S.evaluate||An).source+"|$","g"),un="//# sourceURL="+(co.call(S,"sourceURL")?(S.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++r1+"]")+` -`;b.replace(Ht,function(Bn,wi,Ni,cc,Ka,uc){return Ni||(Ni=cc),vt+=b.slice(ut,uc).replace(lo,qxe),wi&&(ye=!0,vt+=`' + -__e(`+wi+`) + -'`),Ka&&(Re=!0,vt+=`'; -`+Ka+`; +`)}function tDe(b){return ni(b)||p_(b)||!!(LZ&&b&&b[LZ])}function Hf(b,S){var T=typeof b;return S=S==null?$:S,!!S&&(T=="number"||T!="symbol"&&$n.test(b))&&b>-1&&b%1==0&&b0){if(++S>=P)return arguments[0]}else S=0;return b.apply(t,arguments)}}function aN(b,S){var T=-1,O=b.length,q=O-1;for(S=S===t?O:S;++T1?b[S-1]:t;return T=typeof T=="function"?(b.pop(),T):t,PQ(b,T)});function OQ(b){var S=ee(b);return S.__chain__=!0,S}function hke(b,S){return S(b),b}function lN(b,S){return S(b)}var fke=Vf(function(b){var S=b.length,T=S?b[0]:0,O=this.__wrapped__,q=function(ne){return b3(ne,b)};return S>1||this.__actions__.length||!(O instanceof Li)||!Hf(T)?this.thru(q):(O=O.slice(T,+T+(S?1:0)),O.__actions__.push({func:lN,args:[q],thisArg:t}),new nu(O,this.__chain__).thru(function(ne){return S&&!ne.length&&ne.push(t),ne}))});function gke(){return OQ(this)}function pke(){return new nu(this.value(),this.__chain__)}function mke(){this.__values__===t&&(this.__values__=YQ(this.value()));var b=this.__index__>=this.__values__.length,S=b?t:this.__values__[this.__index__++];return{done:b,value:S}}function vke(){return this}function _ke(b){for(var S,T=this;T instanceof qT;){var O=IQ(T);O.__index__=0,O.__values__=t,S?q.__wrapped__=O:S=O;var q=O;T=T.__wrapped__}return q.__wrapped__=b,S}function bke(){var b=this.__wrapped__;if(b instanceof Li){var S=b;return this.__actions__.length&&(S=new Li(this)),S=S.reverse(),S.__actions__.push({func:lN,args:[q3],thisArg:t}),new nu(S,this.__chain__)}return this.thru(q3)}function Cke(){return QZ(this.__wrapped__,this.__actions__)}var yke=eN(function(b,S,T){co.call(b,T)?++b[T]:Bf(b,T,1)});function wke(b,S,T){var O=ni(b)?dZ:hEe;return T&&Ka(b,S,T)&&(S=t),O(b,Pn(S,3))}function Ske(b,S){var T=ni(b)?Lp:PZ;return T(b,Pn(S,3))}var xke=cQ(TQ),Lke=cQ(NQ);function Eke(b,S){return js(cN(b,S),1)}function Dke(b,S){return js(cN(b,S),F)}function kke(b,S,T){return T=T===t?1:ai(T),js(cN(b,S),T)}function FQ(b,S){var T=ni(b)?eu:Ip;return T(b,Pn(S,3))}function BQ(b,S){var T=ni(b)?qxe:AZ;return T(b,Pn(S,3))}var Ike=eN(function(b,S,T){co.call(b,T)?b[T].push(S):Bf(b,T,[S])});function Tke(b,S,T,O){b=yl(b)?b:b1(b),T=T&&!O?ai(T):0;var q=b.length;return T<0&&(T=hs(q+T,0)),gN(b)?T<=q&&b.indexOf(S,T)>-1:!!q&&a1(b,S,T)>-1}var Nke=pi(function(b,S,T){var O=-1,q=typeof S=="function",ne=yl(b)?qe(b.length):[];return Ip(b,function(ge){ne[++O]=q?sc(S,ge,T):XS(ge,S,T)}),ne}),Rke=eN(function(b,S,T){Bf(b,T,S)});function cN(b,S){var T=ni(b)?ir:HZ;return T(b,Pn(S,3))}function Mke(b,S,T,O){return b==null?[]:(ni(S)||(S=S==null?[]:[S]),T=O?t:T,ni(T)||(T=T==null?[]:[T]),jZ(b,S,T))}var Ake=eN(function(b,S,T){b[T?0:1].push(S)},function(){return[[],[]]});function Pke(b,S,T){var O=ni(b)?s3:pZ,q=arguments.length<3;return O(b,Pn(S,4),T,q,Ip)}function Oke(b,S,T){var O=ni(b)?Gxe:pZ,q=arguments.length<3;return O(b,Pn(S,4),T,q,AZ)}function Fke(b,S){var T=ni(b)?Lp:PZ;return T(b,hN(Pn(S,3)))}function Bke(b){var S=ni(b)?TZ:TEe;return S(b)}function Wke(b,S,T){(T?Ka(b,S,T):S===t)?S=1:S=ai(S);var O=ni(b)?aEe:NEe;return O(b,S)}function Vke(b){var S=ni(b)?lEe:MEe;return S(b)}function Hke(b){if(b==null)return 0;if(yl(b))return gN(b)?c1(b):b.length;var S=wa(b);return S==xe||S==ie?b.size:L3(b).length}function $ke(b,S,T){var O=ni(b)?a3:AEe;return T&&Ka(b,S,T)&&(S=t),O(b,Pn(S,3))}var zke=pi(function(b,S){if(b==null)return[];var T=S.length;return T>1&&Ka(b,S[0],S[1])?S=[]:T>2&&Ka(S[0],S[1],S[2])&&(S=[S[0]]),jZ(b,js(S,1),[])}),uN=SLe||function(){return Us.Date.now()};function Uke(b,S){if(typeof S!="function")throw new tu(s);return b=ai(b),function(){if(--b<1)return S.apply(this,arguments)}}function WQ(b,S,T){return S=T?t:S,S=b&&S==null?b.length:S,Wf(b,E,t,t,t,t,S)}function VQ(b,S){var T;if(typeof S!="function")throw new tu(s);return b=ai(b),function(){return--b>0&&(T=S.apply(this,arguments)),b<=1&&(S=t),T}}var X3=pi(function(b,S,T){var O=v;if(T.length){var q=Dp(T,v1(X3));O|=L}return Wf(b,O,S,T,q)}),HQ=pi(function(b,S,T){var O=v|m;if(T.length){var q=Dp(T,v1(HQ));O|=L}return Wf(S,O,b,T,q)});function $Q(b,S,T){S=T?t:S;var O=Wf(b,y,t,t,t,t,t,S);return O.placeholder=$Q.placeholder,O}function zQ(b,S,T){S=T?t:S;var O=Wf(b,w,t,t,t,t,t,S);return O.placeholder=zQ.placeholder,O}function UQ(b,S,T){var O,q,ne,ge,we,Re,ut=0,dt=!1,vt=!1,Ht=!0;if(typeof b!="function")throw new tu(s);S=su(S)||0,dr(T)&&(dt=!!T.leading,vt="maxWait"in T,ne=vt?hs(su(T.maxWait)||0,S):ne,Ht="trailing"in T?!!T.trailing:Ht);function un(Rr){var ed=O,Uf=q;return O=q=t,ut=Rr,ge=b.apply(Uf,ed),ge}function Fn(Rr){return ut=Rr,we=ex(yi,S),dt?un(Rr):ge}function di(Rr){var ed=Rr-Re,Uf=Rr-ut,cJ=S-ed;return vt?ya(cJ,ne-Uf):cJ}function Bn(Rr){var ed=Rr-Re,Uf=Rr-ut;return Re===t||ed>=S||ed<0||vt&&Uf>=ne}function yi(){var Rr=uN();if(Bn(Rr))return Ni(Rr);we=ex(yi,di(Rr))}function Ni(Rr){return we=t,Ht&&O?un(Rr):(O=q=t,ge)}function uc(){we!==t&&eQ(we),ut=0,O=Re=q=we=t}function qa(){return we===t?ge:Ni(uN())}function dc(){var Rr=uN(),ed=Bn(Rr);if(O=arguments,q=this,Re=Rr,ed){if(we===t)return Fn(Re);if(vt)return eQ(we),we=ex(yi,S),un(Re)}return we===t&&(we=ex(yi,S)),ge}return dc.cancel=uc,dc.flush=qa,dc}var jke=pi(function(b,S){return MZ(b,1,S)}),Kke=pi(function(b,S,T){return MZ(b,su(S)||0,T)});function qke(b){return Wf(b,k)}function dN(b,S){if(typeof b!="function"||S!=null&&typeof S!="function")throw new tu(s);var T=function(){var O=arguments,q=S?S.apply(this,O):O[0],ne=T.cache;if(ne.has(q))return ne.get(q);var ge=b.apply(this,O);return T.cache=ne.set(q,ge)||ne,ge};return T.cache=new(dN.Cache||Ff),T}dN.Cache=Ff;function hN(b){if(typeof b!="function")throw new tu(s);return function(){var S=arguments;switch(S.length){case 0:return!b.call(this);case 1:return!b.call(this,S[0]);case 2:return!b.call(this,S[0],S[1]);case 3:return!b.call(this,S[0],S[1],S[2])}return!b.apply(this,S)}}function Gke(b){return VQ(2,b)}var Xke=PEe(function(b,S){S=S.length==1&&ni(S[0])?ir(S[0],ac(Pn())):ir(js(S,1),ac(Pn()));var T=S.length;return pi(function(O){for(var q=-1,ne=ya(O.length,T);++q=S}),p_=BZ(function(){return arguments}())?BZ:function(b){return br(b)&&co.call(b,"callee")&&!xZ.call(b,"callee")},ni=qe.isArray,uIe=rZ?ac(rZ):_Ee;function yl(b){return b!=null&&fN(b.length)&&!$f(b)}function Nr(b){return br(b)&&yl(b)}function dIe(b){return b===!0||b===!1||br(b)&&ja(b)==Se}var Mp=LLe||a8,hIe=sZ?ac(sZ):bEe;function fIe(b){return br(b)&&b.nodeType===1&&!tx(b)}function gIe(b){if(b==null)return!0;if(yl(b)&&(ni(b)||typeof b=="string"||typeof b.splice=="function"||Mp(b)||_1(b)||p_(b)))return!b.length;var S=wa(b);if(S==xe||S==ie)return!b.size;if(JS(b))return!L3(b).length;for(var T in b)if(co.call(b,T))return!1;return!0}function pIe(b,S){return YS(b,S)}function mIe(b,S,T){T=typeof T=="function"?T:t;var O=T?T(b,S):t;return O===t?YS(b,S,t,T):!!O}function Z3(b){if(!br(b))return!1;var S=ja(b);return S==ce||S==De||typeof b.message=="string"&&typeof b.name=="string"&&!tx(b)}function vIe(b){return typeof b=="number"&&EZ(b)}function $f(b){if(!dr(b))return!1;var S=ja(b);return S==Pe||S==Oe||S==be||S==Ge}function KQ(b){return typeof b=="number"&&b==ai(b)}function fN(b){return typeof b=="number"&&b>-1&&b%1==0&&b<=$}function dr(b){var S=typeof b;return b!=null&&(S=="object"||S=="function")}function br(b){return b!=null&&typeof b=="object"}var qQ=aZ?ac(aZ):yEe;function _Ie(b,S){return b===S||x3(b,S,H3(S))}function bIe(b,S,T){return T=typeof T=="function"?T:t,x3(b,S,H3(S),T)}function CIe(b){return GQ(b)&&b!=+b}function yIe(b){if(oDe(b))throw new ei(r);return WZ(b)}function wIe(b){return b===null}function SIe(b){return b==null}function GQ(b){return typeof b=="number"||br(b)&&ja(b)==Ee}function tx(b){if(!br(b)||ja(b)!=nt)return!1;var S=VT(b);if(S===null)return!0;var T=co.call(S,"constructor")&&S.constructor;return typeof T=="function"&&T instanceof T&&OT.call(T)==bLe}var Q3=lZ?ac(lZ):wEe;function xIe(b){return KQ(b)&&b>=-$&&b<=$}var XQ=cZ?ac(cZ):SEe;function gN(b){return typeof b=="string"||!ni(b)&&br(b)&&ja(b)==se}function cc(b){return typeof b=="symbol"||br(b)&&ja(b)==U}var _1=uZ?ac(uZ):xEe;function LIe(b){return b===t}function EIe(b){return br(b)&&wa(b)==oe}function DIe(b){return br(b)&&ja(b)==te}var kIe=oN(E3),IIe=oN(function(b,S){return b<=S});function YQ(b){if(!b)return[];if(yl(b))return gN(b)?Zu(b):Cl(b);if($S&&b[$S])return aLe(b[$S]());var S=wa(b),T=S==xe?f3:S==ie?MT:b1;return T(b)}function zf(b){if(!b)return b===0?b:0;if(b=su(b),b===F||b===-F){var S=b<0?-1:1;return S*z}return b===b?b:0}function ai(b){var S=zf(b),T=S%1;return S===S?T?S-T:S:0}function ZQ(b){return b?d_(ai(b),0,j):0}function su(b){if(typeof b=="number")return b;if(cc(b))return K;if(dr(b)){var S=typeof b.valueOf=="function"?b.valueOf():b;b=dr(S)?S+"":S}if(typeof b!="string")return b===0?b:+b;b=mZ(b);var T=Ve.test(b);return T||Sn.test(b)?Uxe(b.slice(2),T?2:8):ue.test(b)?K:+b}function QQ(b){return gh(b,wl(b))}function TIe(b){return b?d_(ai(b),-$,$):b===0?b:0}function io(b){return b==null?"":lc(b)}var NIe=p1(function(b,S){if(JS(S)||yl(S)){gh(S,Ns(S),b);return}for(var T in S)co.call(S,T)&&qS(b,T,S[T])}),JQ=p1(function(b,S){gh(S,wl(S),b)}),pN=p1(function(b,S,T,O){gh(S,wl(S),b,O)}),RIe=p1(function(b,S,T,O){gh(S,Ns(S),b,O)}),MIe=Vf(b3);function AIe(b,S){var T=g1(b);return S==null?T:NZ(T,S)}var PIe=pi(function(b,S){b=Do(b);var T=-1,O=S.length,q=O>2?S[2]:t;for(q&&Ka(S[0],S[1],q)&&(O=1);++T1),ne}),gh(b,W3(b),T),O&&(T=iu(T,d|h|f,KEe));for(var q=S.length;q--;)N3(T,S[q]);return T});function JIe(b,S){return tJ(b,hN(Pn(S)))}var eTe=Vf(function(b,S){return b==null?{}:DEe(b,S)});function tJ(b,S){if(b==null)return{};var T=ir(W3(b),function(O){return[O]});return S=Pn(S),KZ(b,T,function(O,q){return S(O,q[0])})}function tTe(b,S,T){S=Np(S,b);var O=-1,q=S.length;for(q||(q=1,b=t);++OS){var O=b;b=S,S=O}if(T||b%1||S%1){var q=DZ();return ya(b+q*(S-b+zxe("1e-"+((q+"").length-1))),S)}return k3(b,S)}var hTe=m1(function(b,S,T){return S=S.toLowerCase(),b+(T?oJ(S):S)});function oJ(b){return t8(io(b).toLowerCase())}function rJ(b){return b=io(b),b&&b.replace(Ci,nLe).replace(tr,"")}function fTe(b,S,T){b=io(b),S=lc(S);var O=b.length;T=T===t?O:d_(ai(T),0,O);var q=T;return T-=S.length,T>=0&&b.slice(T,q)==S}function gTe(b){return b=io(b),b&&bn.test(b)?b.replace(cn,iLe):b}function pTe(b){return b=io(b),b&&bt.test(b)?b.replace(Ft,"\\$&"):b}var mTe=m1(function(b,S,T){return b+(T?"-":"")+S.toLowerCase()}),vTe=m1(function(b,S,T){return b+(T?" ":"")+S.toLowerCase()}),_Te=lQ("toLowerCase");function bTe(b,S,T){b=io(b),S=ai(S);var O=S?c1(b):0;if(!S||O>=S)return b;var q=(S-O)/2;return iN(UT(q),T)+b+iN(zT(q),T)}function CTe(b,S,T){b=io(b),S=ai(S);var O=S?c1(b):0;return S&&O>>0,T?(b=io(b),b&&(typeof S=="string"||S!=null&&!Q3(S))&&(S=lc(S),!S&&l1(b))?Rp(Zu(b),0,T):b.split(S,T)):[]}var DTe=m1(function(b,S,T){return b+(T?" ":"")+t8(S)});function kTe(b,S,T){return b=io(b),T=T==null?0:d_(ai(T),0,b.length),S=lc(S),b.slice(T,T+S.length)==S}function ITe(b,S,T){var O=ee.templateSettings;T&&Ka(b,S,T)&&(S=t),b=io(b),S=pN({},S,O,pQ);var q=pN({},S.imports,O.imports,pQ),ne=Ns(q),ge=h3(q,ne),we,Re,ut=0,dt=S.interpolate||An,vt="__p += '",Ht=g3((S.escape||An).source+"|"+dt.source+"|"+(dt===Nt?oi:An).source+"|"+(S.evaluate||An).source+"|$","g"),un="//# sourceURL="+(co.call(S,"sourceURL")?(S.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++s1+"]")+` +`;b.replace(Ht,function(Bn,yi,Ni,uc,qa,dc){return Ni||(Ni=uc),vt+=b.slice(ut,dc).replace(lo,oLe),yi&&(we=!0,vt+=`' + +__e(`+yi+`) + +'`),qa&&(Re=!0,vt+=`'; +`+qa+`; __p += '`),Ni&&(vt+=`' + ((__t = (`+Ni+`)) == null ? '' : __t) + -'`),ut=uc+Bn.length,Bn}),vt+=`'; +'`),ut=dc+Bn.length,Bn}),vt+=`'; `;var Fn=co.call(S,"variable")&&S.variable;if(!Fn)vt=`with (obj) { `+vt+` } -`;else if(an.test(Fn))throw new ei(a);vt=(Re?vt.replace(Vn,""):vt).replace(Lt,"$1").replace(tn,"$1;"),vt="function("+(Fn||"obj")+`) { +`;else if(an.test(Fn))throw new ei(a);vt=(Re?vt.replace(Vn,""):vt).replace(Et,"$1").replace(tn,"$1;"),vt="function("+(Fn||"obj")+`) { `+(Fn?"":`obj || (obj = {}); -`)+"var __t, __p = ''"+(ye?", __e = _.escape":"")+(Re?`, __j = Array.prototype.join; +`)+"var __t, __p = ''"+(we?", __e = _.escape":"")+(Re?`, __j = Array.prototype.join; function print() { __p += __j.call(arguments, '') } `:`; `)+vt+`return __p -}`;var di=JQ(function(){return Ji(ne,un+"return "+vt).apply(t,ge)});if(di.source=vt,Z3(di))throw di;return di}function bTe(b){return io(b).toLowerCase()}function CTe(b){return io(b).toUpperCase()}function wTe(b,S,T){if(b=io(b),b&&(T||S===t))return lZ(b);if(!b||!(S=ac(S)))return b;var O=Yu(b),q=Yu(S),ne=cZ(O,q),ge=uZ(O,q)+1;return Tp(O,ne,ge).join("")}function yTe(b,S,T){if(b=io(b),b&&(T||S===t))return b.slice(0,hZ(b)+1);if(!b||!(S=ac(S)))return b;var O=Yu(b),q=uZ(O,Yu(S))+1;return Tp(O,0,q).join("")}function STe(b,S,T){if(b=io(b),b&&(T||S===t))return b.replace(Zt,"");if(!b||!(S=ac(S)))return b;var O=Yu(b),q=cZ(O,Yu(S));return Tp(O,q).join("")}function xTe(b,S){var T=R,O=A;if(dr(S)){var q="separator"in S?S.separator:q;T="length"in S?ai(S.length):T,O="omission"in S?ac(S.omission):O}b=io(b);var ne=b.length;if(a1(b)){var ge=Yu(b);ne=ge.length}if(T>=ne)return b;var ye=T-l1(O);if(ye<1)return O;var Re=ge?Tp(ge,0,ye).join(""):b.slice(0,ye);if(q===t)return Re+O;if(ge&&(ye+=Re.length-ye),Q3(q)){if(b.slice(ye).search(q)){var ut,dt=Re;for(q.global||(q=g3(q.source,io(Ze.exec(q))+"g")),q.lastIndex=0;ut=q.exec(dt);)var vt=ut.index;Re=Re.slice(0,vt===t?ye:vt)}}else if(b.indexOf(ac(q),ye)!=ye){var Ht=Re.lastIndexOf(q);Ht>-1&&(Re=Re.slice(0,Ht))}return Re+O}function LTe(b){return b=io(b),b&&qn.test(b)?b.replace(ui,eLe):b}var ETe=p1(function(b,S,T){return b+(T?" ":"")+S.toUpperCase()}),t8=eQ("toUpperCase");function QQ(b,S,T){return b=io(b),S=T?t:S,S===t?Xxe(b)?iLe(b):Vxe(b):b.match(S)||[]}var JQ=pi(function(b,S){try{return rc(b,t,S)}catch(T){return Z3(T)?T:new ei(T)}}),DTe=Vf(function(b,S){return Jc(S,function(T){T=fh(T),Bf(b,T,X3(b[T],b))}),b});function kTe(b){var S=b==null?0:b.length,T=Pn();return b=S?ir(b,function(O){if(typeof O[1]!="function")throw new eu(s);return[T(O[0]),O[1]]}):[],pi(function(O){for(var q=-1;++q$)return[];var T=j,O=Ca(b,j);S=Pn(S),b-=j;for(var q=d3(O,S);++T0||S<0)?new Li(T):(b<0?T=T.takeRight(-b):b&&(T=T.drop(b)),S!==t&&(S=ai(S),T=S<0?T.dropRight(-S):T.take(S-b)),T)},Li.prototype.takeRightWhile=function(b){return this.reverse().takeWhile(b).reverse()},Li.prototype.toArray=function(){return this.take(j)},dh(Li.prototype,function(b,S){var T=/^(?:filter|find|map|reject)|While$/.test(S),O=/^(?:head|last)$/.test(S),q=ee[O?"take"+(S=="last"?"Right":""):S],ne=O||/^find/.test(S);!q||(ee.prototype[S]=function(){var ge=this.__wrapped__,ye=O?[1]:arguments,Re=ge instanceof Li,ut=ye[0],dt=Re||ni(ge),vt=function(wi){var Ni=q.apply(ee,xp([wi],ye));return O&&Ht?Ni[0]:Ni};dt&&T&&typeof ut=="function"&&ut.length!=1&&(Re=dt=!1);var Ht=this.__chain__,un=!!this.__actions__.length,Fn=ne&&!Ht,di=Re&&!un;if(!ne&&dt){ge=di?ge:new Li(this);var Bn=b.apply(ge,ye);return Bn.__actions__.push({func:rN,args:[vt],thisArg:t}),new tu(Bn,Ht)}return Fn&&di?b.apply(this,ye):(Bn=this.thru(vt),Fn?O?Bn.value()[0]:Bn.value():Bn)})}),Jc(["pop","push","shift","sort","splice","unshift"],function(b){var S=NT[b],T=/^(?:push|sort|unshift)$/.test(b)?"tap":"thru",O=/^(?:pop|shift)$/.test(b);ee.prototype[b]=function(){var q=arguments;if(O&&!this.__chain__){var ne=this.value();return S.apply(ni(ne)?ne:[],q)}return this[T](function(ge){return S.apply(ni(ge)?ge:[],q)})}}),dh(Li.prototype,function(b,S){var T=ee[S];if(T){var O=T.name+"";co.call(h1,O)||(h1[O]=[]),h1[O].push({name:S,func:T})}}),h1[QT(t,m).name]=[{name:"wrapper",func:t}],Li.prototype.clone=LLe,Li.prototype.reverse=ELe,Li.prototype.value=DLe,ee.prototype.at=nke,ee.prototype.chain=ike,ee.prototype.commit=oke,ee.prototype.next=rke,ee.prototype.plant=ake,ee.prototype.reverse=lke,ee.prototype.toJSON=ee.prototype.valueOf=ee.prototype.value=cke,ee.prototype.first=ee.prototype.head,HS&&(ee.prototype[HS]=ske),ee},c1=oLe();a_?((a_.exports=c1)._=c1,i3._=c1):Us._=c1}).call(nx)})(bc,bc.exports);class Kv{constructor(e){Tt(this,"defaultOperatorData");Tt(this,"isUnique");Tt(this,"nodeColor");Tt(this,"description");Tt(this,"isCustom");this.defaultOperatorData=e}get operatorType(){var e;return(e=this.defaultOperatorData)==null?void 0:e.operatorType}get operatorName(){var e;return((e=this.defaultOperatorData)==null?void 0:e.operatorName)||this.operatorType}create(e,t){return{position:{x:0,y:0},...t,id:(t==null?void 0:t.id)||dFe(),type:this.defaultOperatorData.nodeType,data:{...this.defaultOperatorData,...t==null?void 0:t.data,...e,operatorName:this.defaultOperatorData.operatorName,operatorType:this.defaultOperatorData.operatorType,nodeType:this.defaultOperatorData.nodeType,nodeOptions:this.defaultOperatorData.nodeOptions}}}updateNodeMeta(e,t){return{...e,...t,...bc.exports.pick(e,"id","data")}}updateData(e,t){const n=["nodeOptions","nodeType","operatorName","operatorType"];return{...e,data:{...e.data,...t,...bc.exports.pick(e.data,...n)}}}updateNodeOptions(e,t){var n;return{...e,data:{...e==null?void 0:e.data,nodeOptions:{...(n=e==null?void 0:e.data)==null?void 0:n.nodeOptions,...t}}}}getIgnoreDegreeIds(e){return[]}onAfterCreate(e){}onNodeFocus(e){}onNodeDoubleClick(e){}generateAttributeControl(e){const{node:t,actions:n}=e;function o(r){t.data.nodeLabel=r,n.updateNode(t.id,t)}return fe(Ds,{children:fe(bD,{placeholder:"input label",style:{width:"100%",maxWidth:"none"},value:t.data.nodeLabel,onChange:r=>{o(r.target.value)}})})}getNodeProps(e){return{}}renderCustomLabel(e){return null}}var kf=(i=>(i.Node="Node",i))(kf||{});class ri{constructor(e){Tt(this,"id");Tt(this,"type");Tt(this,"variableName");Tt(this,"label");Tt(this,"hint");Tt(this,"isConnectable");Tt(this,"children");Tt(this,"allowRemove");Tt(this,"allowAddAndRemoveChildren");Tt(this,"variableType");Tt(this,"defaultChildData");Tt(this,"ignoreDegree");Object.assign(this,e),this.id||(this.id=i4()),this.variableName||(this.variableName=ri.generateVariableName(this.hint)),this.type||(this.type="unknown")}static generateVariableName(e){return`${e||"var"}_${Math.random().toString(36).slice(2,7)}`}static createFromGroup(e){return new ri({hint:e.hint,...e==null?void 0:e.defaultChildData})}}var qs=(i=>(i.String="string",i.Number="number",i.Boolean="boolean",i.Object="object",i))(qs||{});class Uve{constructor(){Tt(this,"listenerMap",new Map)}on(e,t){const n=this.listenerMap.get(e);n?n.add(t):this.listenerMap.set(e,new Set([t]))}off(e,t){const n=this.listenerMap.get(e);n!=null&&n.has(t)&&n.delete(t)}emit(e,t){const n=this.listenerMap.get(e);if(n)for(const o of n==null?void 0:n.values())o(t)}}class yGe{constructor(e){Tt(this,"node");this.node=e}getLastChild(){let e=this.node.next;for(;e!=null&&e.nextSibling;)e=e.nextSibling;return e}addNextChildren(...e){const[t]=e;let n=t;t.return=this.node;for(let r=1;r<(e==null?void 0:e.length);r++){const s=e[r];n.nextSibling=s,n=s,s.return=this.node}const o=this.getLastChild();o?o.nextSibling=t:this.node.next=t}removeChild(e){const t=this.node.next;if(t===e)return this.node.next=t.nextSibling,!0;for(;t!=null&&t.nextSibling;)if(t.nextSibling===e)return t.nextSibling=t.nextSibling.nextSibling,!0;return!1}*children(){let e=this.node.next;for(;e;)yield e,e=e.nextSibling}preAction(e,t){let n=e;e:for(;n&&n!==e.return;)if(t(n),n.next)n=n.next;else if(n.nextSibling&&n!==e)n=n.nextSibling;else{for(n=n.return;n&&n!==e;){if(n.nextSibling){n=n.nextSibling;continue e}n=n==null?void 0:n.return}break}}postAction(e,t){let n=e;for(;n.next;)n=n==null?void 0:n.next;for(;n&&n!==e.return;){if(t(n),n.nextSibling&&n!==e){for(n=n.nextSibling;n.next;)n=n==null?void 0:n.next;continue}n=n.return}}action(e,t,n){e==="pre"?this.preAction(t,n):e==="post"?this.postAction(t,n):console.log("unknow type",e)}}class xq{constructor(e){Tt(this,"uid");this.uid=e||i4()}}class SGe extends xq{constructor(t){super();Tt(this,"template");Tt(this,"output");Tt(this,"input");const{template:n,input:o}=t;this.template=n,this.input=o||{}}get name(){var t,n;return((t=this.template.meta)==null?void 0:t.name)||((n=this.template)==null?void 0:n.name)}log(t){console.log(`[ModelBlock ${this.name} - ${this.uid}]: ${t}`)}}class SD extends SGe{constructor(t){super(t);Tt(this,"next",null);Tt(this,"nextSibling",null);Tt(this,"return",null);Tt(this,"eventEmitter",new Uve);Tt(this,"status",0);Tt(this,"pendingChildren",[]);Tt(this,"relationHelper");this.relationHelper=new yGe(this)}setNext(t){this.next=t}setNextSibling(t){this.nextSibling=t}setReturn(t){this.return=t!=null?t:null}_getInnerHandler(){return{getContext:this.getContext.bind(this)}}getContext(){return{id:this.uid,onLifecycle:this.onLifecycle.bind(this),mount:this.mountTemplate.bind(this),unmount:this.unmountChild.bind(this)}}onLifecycle(t,n){return this.eventEmitter.on(t,n),{unsubscribe:()=>{this.eventEmitter.off(t,n)}}}childrenAction(t,n,o){this.relationHelper.action(t,o,r=>{var s;(s=r[n])==null||s.call(r)})}mountChildOnly(t){this.relationHelper.addNextChildren(t),this.childrenAction("pre","preInitSelf",t),this.childrenAction("post","postInitSelf",t),this.childrenAction("pre","preMountSelf",t),this.childrenAction("post","postMountSelf",t),this.childrenAction("pre","beforeMountSelf",t),this.childrenAction("post","mountSelf",t)}mountTemplate(t,n){if(t===this.template)throw new Error("can not mount yourself");let o=this.return;for(;o;){if(t===o.template)throw new Error("loop mount!");o=o.return}const r=new SD({template:t,input:n});return this.mountChild(r),r}mountChild(t){console.log("mount::status",this.status),this.status===2?this.mountChildOnly(t):this.status===1?this.pendingChildren.push(t):this.status===0&&(t.preInitSelf(),this.relationHelper.addNextChildren(t))}unmountChild(t){t instanceof SD&&(this.relationHelper.removeChild(t),t.unmount())}triggerLifecycle(t){this.eventEmitter.emit(t,void 0)}preInitSelf(){this.log("preInitSelf"),this.status===0&&(this.output=this.template(this.input,this.getContext())),this.status=1}postInitSelf(){this.log("postInitSelf"),this.triggerLifecycle("postInit")}preMountSelf(){this.log("preMountSelf"),this.triggerLifecycle("preMount")}postMountSelf(){var t;this.log("postMountSelf"),this.triggerLifecycle("postMount"),this.status=2,(t=this.pendingChildren)!=null&&t.length&&(this.log("pendingChildren"),this.pendingChildren.forEach(n=>{this.mountChildOnly(n)}),this.pendingChildren=[])}beforeMountSelf(){this.log("beforeMountSelf"),this.triggerLifecycle("beforeMount")}mountSelf(){this.log("mountSelf"),this.triggerLifecycle("mount")}preUnmountSelf(){this.log("preUnmountSelf"),this.triggerLifecycle("preUnmount")}postUnmountSelf(){this.log("postUnmountSelf"),this.triggerLifecycle("postUnmount")}beforeUnmountSelf(){this.log("beforeUnmountSelf"),this.triggerLifecycle("beforeUnmount")}unmountSelf(){this.log("unmountSelf"),this.triggerLifecycle("unmount")}preAction(t){this.relationHelper.preAction(this,n=>{var o;(o=n[t])==null||o.call(n)})}postAction(t){this.relationHelper.postAction(this,n=>{var o;(o=n[t])==null||o.call(n)})}mount(){this.preAction("preInitSelf"),this.postAction("postInitSelf"),this.preAction("preMountSelf"),this.postAction("postMountSelf"),this.preAction("beforeMountSelf"),this.postAction("mountSelf")}unmount(){this.preAction("beforeUnmountSelf"),this.postAction("unmountSelf"),this.preAction("preUnmountSelf"),this.postAction("postUnmountSelf")}}function xGe(i,e){const t=new SD({template:i,input:e});return t.mount(),t}var $w;class LGe{constructor(){Oo(this,$w,new Set)}add(e){ht(this,$w).add(e)}unsubscribe(){for(const e of ht(this,$w).values())e();ht(this,$w).clear()}}$w=new WeakMap;var zw;class jve extends xq{constructor(){super();Oo(this,zw,new Set);this.subscribe=this.subscribe.bind(this),this.next=this.next.bind(this)}get current(){throw new Error("need override")}next(...t){for(const n of ht(this,zw).values())try{n(...t)}catch(o){setTimeout(()=>{throw o})}}subscribe(t){ht(this,zw).add(t);const n=new LGe;return n.add(()=>{ht(this,zw).delete(t)}),n}pipe(t){return t(this)}}zw=new WeakMap;class EGe extends Uve{track(e){this.emit("track",e)}onTrack(e){this.on("track",e)}}const Kve=new EGe;function qve(i,e){return typeof e=="function"?e(i):e}class DGe extends jve{constructor(t){super();Tt(this,"_current");this._current=t,this.update=this.update.bind(this)}get current(){return this._current}update(t,n){const o=qve(this._current,t);this._current=o,Kve.track({target:this.uid,extraInfo:n}),this.next(o,n)}}class Od extends DGe{update(e,t){super.update(e,t)}}class O4 extends xq{constructor(t){super(typeof t=="object"?t==null?void 0:t.uid:void 0);Tt(this,"hint",[]);typeof t=="string"?this.hint=[t]:Object.assign(this,t!=null?t:{})}concat(t){return this.hint.push(t),this}}class kGe extends jve{next(e,t){super.next(e,t||new O4("[ModelEvent] fallback"))}}var IGe=Object.freeze(Object.defineProperty({__proto__:null,ModelBlock:SD,start:xGe,ModelState:Od,ModelEvent:kGe,tracker:Kve,ExtraInfo:O4},Symbol.toStringTag,{value:"Module"}));function TGe(i){return new Od(i)}function NGe(i,e){const t=bc.exports.get(i.current,e);class n extends Od{get current(){return bc.exports.get(i.current,e)}update(r,s){i.update(a=>{const l=bc.exports.get(a,e),c=bc.exports.clone(a),u=qve(l,r);return bc.exports.set(c,e,u),c},s)}subscribe(r){return i.subscribe((s,a)=>r(bc.exports.get(s,e),a))}}return new n(t)}function RGe(...i){const e=new Od(0);function t(n){e.update(i.map(o=>o.current).reduce((o,r)=>o+r,0),n)}return t(new O4("[sum]: init")),i.forEach(n=>{n.subscribe((o,r)=>{t(r.concat("sum"))})}),e}function MGe(i,e){const t=new Od([]);return i.forEach(n=>{n.subscribe((o,r)=>{const s=[...i,...e].map(a=>a.current);t.update(s,r.concat("combine"))})}),t}function AGe(i,e){return i.pipe(t=>{const n=new Od(void 0);return t.subscribe(async(o,r)=>{const s=e(o);let a=s;s instanceof Promise&&(a=await s),n.update(a,r.concat("transform"))}),n})}function PGe(i){const e=new Od([]);return i.forEach(t=>{t.subscribe((n,o)=>{e.update(n,o.concat("combine"))})}),e}function OGe(...i){return i.reduce((e,t)=>e+t,0)}function FGe(i,e,t){const{data:n,key:o}=i,{mount:r,unmount:s}=e,a=new Od(n.current.map((l,c)=>{const u=new Od(c),d=bc.exports.get(l,o);return{key:d,index:u,instance:r(t,{index:u,data:n,key:d})}})||[]);return n.subscribe((l,c)=>{const u=n.current.map((p,v)=>({key:bc.exports.get(p,o),index:v})),d=a.current,h=new Map(u.map(p=>[p.key,p])),f=new Map(d.map(p=>[p.key,p])),g=[];for(const p of u){const v=f.get(p.key);if(v)g.push(v),v.index.current!==p.index&&v.index.update(p.index,c);else{const m=new Od(p.index),_={index:m,key:p.key,instance:r(t,{index:m,data:n,key:p.key})};g.push(_),console.log("mount ==> ",_.key)}}d.filter(p=>!h.get(p.key)).forEach(p=>{console.log("unmount ==> ",p.key),s(p.instance)}),a.update(g,c)}),{data:n,instanceList:a}}var BGe=Object.freeze(Object.defineProperty({__proto__:null,constValue:TGe,sum:RGe,proxyData:NGe,combine:MGe,transform:AGe,merge:PGe,sumValue:OGe,mountList:FGe},Symbol.toStringTag,{value:"Module"}));const zm="EosCore",hS="EosOperators",Gve=Bt.createContext({store:void 0,nodes:[],edges:[]});function WGe(){return x.exports.useContext(Gve)}function VGe(i){const e={exports:void 0};return new Function("module",zm,hS,i)(e,IGe,BGe),e}const HGe=i=>{const{value:e,children:t,nodes:n,edges:o}=i,[r,s]=x.exports.useState(),a=x.exports.useMemo(()=>({store:r,nodes:n,edges:o}),[r,n,o]);return x.exports.useEffect(()=>{if(!e)return;const l=VGe(e);console.log({result:l,value:e}),l&&s(()=>l.exports)},[e]),fe(Gve.Provider,{value:a,children:t})};function $Ge(i){switch(i){case qs.Boolean:return!1;case qs.Number:return 0;case qs.String:return"";case qs.Object:return"{}";default:return}}class Xve extends Kv{constructor(){super({operatorName:"State",operatorType:"StateOperator",nodeType:kf.Node});Tt(this,"nodeColor","#0079FF")}create(){return super.create({endPointOptions:{endPointList:[new ri({type:"source",label:"data",hint:"data"}),new ri({type:"target",label:"update",hint:"update"})]},value:0,valueType:qs.Number})}getStateSymbol(t){var r,s,a;const{node:n,formatVariableName:o}=t;return o(((a=(s=(r=n.data.endPointOptions)==null?void 0:r.endPointList)==null?void 0:s.find(l=>l.type==="source"&&l.hint==="data"))==null?void 0:a.id)||"")}generateBlockDeclarations(t){const{node:n}=t;return[`const ${this.getStateSymbol(t)} = new ${zm}.ModelState(${JSON.stringify(n.data.value)})`]}generateBlockOutput(t){return[]}generateBlockRelation(t){const{node:n,formatVariableName:o,nodeGraph:r}=t,s=r.findSourceNodes(n.id)||[];return[...s==null?void 0:s.map(a=>` +}`;var di=aJ(function(){return Ji(ne,un+"return "+vt).apply(t,ge)});if(di.source=vt,Z3(di))throw di;return di}function TTe(b){return io(b).toLowerCase()}function NTe(b){return io(b).toUpperCase()}function RTe(b,S,T){if(b=io(b),b&&(T||S===t))return mZ(b);if(!b||!(S=lc(S)))return b;var O=Zu(b),q=Zu(S),ne=vZ(O,q),ge=_Z(O,q)+1;return Rp(O,ne,ge).join("")}function MTe(b,S,T){if(b=io(b),b&&(T||S===t))return b.slice(0,CZ(b)+1);if(!b||!(S=lc(S)))return b;var O=Zu(b),q=_Z(O,Zu(S))+1;return Rp(O,0,q).join("")}function ATe(b,S,T){if(b=io(b),b&&(T||S===t))return b.replace(Zt,"");if(!b||!(S=lc(S)))return b;var O=Zu(b),q=vZ(O,Zu(S));return Rp(O,q).join("")}function PTe(b,S){var T=R,O=A;if(dr(S)){var q="separator"in S?S.separator:q;T="length"in S?ai(S.length):T,O="omission"in S?lc(S.omission):O}b=io(b);var ne=b.length;if(l1(b)){var ge=Zu(b);ne=ge.length}if(T>=ne)return b;var we=T-c1(O);if(we<1)return O;var Re=ge?Rp(ge,0,we).join(""):b.slice(0,we);if(q===t)return Re+O;if(ge&&(we+=Re.length-we),Q3(q)){if(b.slice(we).search(q)){var ut,dt=Re;for(q.global||(q=g3(q.source,io(Ze.exec(q))+"g")),q.lastIndex=0;ut=q.exec(dt);)var vt=ut.index;Re=Re.slice(0,vt===t?we:vt)}}else if(b.indexOf(lc(q),we)!=we){var Ht=Re.lastIndexOf(q);Ht>-1&&(Re=Re.slice(0,Ht))}return Re+O}function OTe(b){return b=io(b),b&&qn.test(b)?b.replace(ui,dLe):b}var FTe=m1(function(b,S,T){return b+(T?" ":"")+S.toUpperCase()}),t8=lQ("toUpperCase");function sJ(b,S,T){return b=io(b),S=T?t:S,S===t?sLe(b)?gLe(b):Zxe(b):b.match(S)||[]}var aJ=pi(function(b,S){try{return sc(b,t,S)}catch(T){return Z3(T)?T:new ei(T)}}),BTe=Vf(function(b,S){return eu(S,function(T){T=ph(T),Bf(b,T,X3(b[T],b))}),b});function WTe(b){var S=b==null?0:b.length,T=Pn();return b=S?ir(b,function(O){if(typeof O[1]!="function")throw new tu(s);return[T(O[0]),O[1]]}):[],pi(function(O){for(var q=-1;++q$)return[];var T=j,O=ya(b,j);S=Pn(S),b-=j;for(var q=d3(O,S);++T0||S<0)?new Li(T):(b<0?T=T.takeRight(-b):b&&(T=T.drop(b)),S!==t&&(S=ai(S),T=S<0?T.dropRight(-S):T.take(S-b)),T)},Li.prototype.takeRightWhile=function(b){return this.reverse().takeWhile(b).reverse()},Li.prototype.toArray=function(){return this.take(j)},fh(Li.prototype,function(b,S){var T=/^(?:filter|find|map|reject)|While$/.test(S),O=/^(?:head|last)$/.test(S),q=ee[O?"take"+(S=="last"?"Right":""):S],ne=O||/^find/.test(S);!q||(ee.prototype[S]=function(){var ge=this.__wrapped__,we=O?[1]:arguments,Re=ge instanceof Li,ut=we[0],dt=Re||ni(ge),vt=function(yi){var Ni=q.apply(ee,Ep([yi],we));return O&&Ht?Ni[0]:Ni};dt&&T&&typeof ut=="function"&&ut.length!=1&&(Re=dt=!1);var Ht=this.__chain__,un=!!this.__actions__.length,Fn=ne&&!Ht,di=Re&&!un;if(!ne&&dt){ge=di?ge:new Li(this);var Bn=b.apply(ge,we);return Bn.__actions__.push({func:lN,args:[vt],thisArg:t}),new nu(Bn,Ht)}return Fn&&di?b.apply(this,we):(Bn=this.thru(vt),Fn?O?Bn.value()[0]:Bn.value():Bn)})}),eu(["pop","push","shift","sort","splice","unshift"],function(b){var S=AT[b],T=/^(?:push|sort|unshift)$/.test(b)?"tap":"thru",O=/^(?:pop|shift)$/.test(b);ee.prototype[b]=function(){var q=arguments;if(O&&!this.__chain__){var ne=this.value();return S.apply(ni(ne)?ne:[],q)}return this[T](function(ge){return S.apply(ni(ge)?ge:[],q)})}}),fh(Li.prototype,function(b,S){var T=ee[S];if(T){var O=T.name+"";co.call(f1,O)||(f1[O]=[]),f1[O].push({name:S,func:T})}}),f1[tN(t,m).name]=[{name:"wrapper",func:t}],Li.prototype.clone=OLe,Li.prototype.reverse=FLe,Li.prototype.value=BLe,ee.prototype.at=fke,ee.prototype.chain=gke,ee.prototype.commit=pke,ee.prototype.next=mke,ee.prototype.plant=_ke,ee.prototype.reverse=bke,ee.prototype.toJSON=ee.prototype.valueOf=ee.prototype.value=Cke,ee.prototype.first=ee.prototype.head,$S&&(ee.prototype[$S]=vke),ee},u1=pLe();a_?((a_.exports=u1)._=u1,i3._=u1):Us._=u1}).call(ix)})(Cc,Cc.exports);class pp{constructor(e){Ct(this,"defaultOperatorData");Ct(this,"isUnique");Ct(this,"nodeColor");Ct(this,"description");Ct(this,"isCustom");this.defaultOperatorData=e}get operatorType(){var e;return(e=this.defaultOperatorData)==null?void 0:e.operatorType}get operatorName(){var e;return((e=this.defaultOperatorData)==null?void 0:e.operatorName)||this.operatorType}create(e,t){return{position:{x:0,y:0},...t,id:(t==null?void 0:t.id)||sge(),type:this.defaultOperatorData.nodeType,data:{...this.defaultOperatorData,...t==null?void 0:t.data,...e,operatorName:this.defaultOperatorData.operatorName,operatorType:this.defaultOperatorData.operatorType,nodeType:this.defaultOperatorData.nodeType,nodeOptions:this.defaultOperatorData.nodeOptions}}}updateNodeMeta(e,t){return{...e,...t,...Cc.exports.pick(e,"id","data")}}updateData(e,t){const n=["nodeOptions","nodeType","operatorName","operatorType"];return{...e,data:{...e.data,...t,...Cc.exports.pick(e.data,...n)}}}updateNodeOptions(e,t){var n;return{...e,data:{...e==null?void 0:e.data,nodeOptions:{...(n=e==null?void 0:e.data)==null?void 0:n.nodeOptions,...t}}}}getExtraAppContainers(e){return[]}getIgnoreDegreeIds(e){return[]}onAfterCreate(e){}onNodeFocus(e){}onNodeDoubleClick(e){}onLayerChange(e){}generateAttributeControl(e){const{node:t,actions:n}=e;function o(r){t.data.nodeLabel=r,n.updateNode(t.id,t)}return he(ks,{children:he(lw,{placeholder:"input label",style:{width:"100%",maxWidth:"none"},value:t.data.nodeLabel,onChange:r=>{o(r.target.value)}})})}getNodeProps(e){return{}}renderCustomLabel(e){return null}}var oh=(i=>(i.Node="Node",i))(oh||{});class ri{constructor(e){Ct(this,"id");Ct(this,"type");Ct(this,"variableName");Ct(this,"label");Ct(this,"hint");Ct(this,"isConnectable");Ct(this,"children");Ct(this,"allowRemove");Ct(this,"allowAddAndRemoveChildren");Ct(this,"variableType");Ct(this,"defaultChildData");Ct(this,"ignoreDegree");Object.assign(this,e),this.id||(this.id=yI()),this.variableName||(this.variableName=ri.generateVariableName(this.hint)),this.type||(this.type="unknown")}static generateVariableName(e){return`${e||"var"}_${Math.random().toString(36).slice(2,7)}`}static createFromGroup(e){return new ri({hint:e.hint,...e==null?void 0:e.defaultChildData})}}var qs=(i=>(i.String="string",i.Number="number",i.Boolean="boolean",i.Object="object",i))(qs||{});class Yve{constructor(){Ct(this,"listenerMap",new Map)}on(e,t){const n=this.listenerMap.get(e);n?n.add(t):this.listenerMap.set(e,new Set([t]))}off(e,t){const n=this.listenerMap.get(e);n!=null&&n.has(t)&&n.delete(t)}emit(e,t){const n=this.listenerMap.get(e);if(n)for(const o of n==null?void 0:n.values())o(t)}}class TGe{constructor(e){Ct(this,"node");this.node=e}getLastChild(){let e=this.node.next;for(;e!=null&&e.nextSibling;)e=e.nextSibling;return e}addNextChildren(...e){const[t]=e;let n=t;t.return=this.node;for(let r=1;r<(e==null?void 0:e.length);r++){const s=e[r];n.nextSibling=s,n=s,s.return=this.node}const o=this.getLastChild();o?o.nextSibling=t:this.node.next=t}removeChild(e){const t=this.node.next;if(t===e)return this.node.next=t.nextSibling,!0;for(;t!=null&&t.nextSibling;)if(t.nextSibling===e)return t.nextSibling=t.nextSibling.nextSibling,!0;return!1}*children(){let e=this.node.next;for(;e;)yield e,e=e.nextSibling}preAction(e,t){let n=e;e:for(;n&&n!==e.return;)if(t(n),n.next)n=n.next;else if(n.nextSibling&&n!==e)n=n.nextSibling;else{for(n=n.return;n&&n!==e;){if(n.nextSibling){n=n.nextSibling;continue e}n=n==null?void 0:n.return}break}}postAction(e,t){let n=e;for(;n.next;)n=n==null?void 0:n.next;for(;n&&n!==e.return;){if(t(n),n.nextSibling&&n!==e){for(n=n.nextSibling;n.next;)n=n==null?void 0:n.next;continue}n=n.return}}action(e,t,n){e==="pre"?this.preAction(t,n):e==="post"?this.postAction(t,n):console.log("unknow type",e)}}class Iq{constructor(e){Ct(this,"uid");this.uid=e||yI()}}class NGe extends Iq{constructor(t){super();Ct(this,"template");Ct(this,"output");Ct(this,"input");const{template:n,input:o}=t;this.template=n,this.input=o||{}}get name(){var t,n;return((t=this.template.meta)==null?void 0:t.name)||((n=this.template)==null?void 0:n.name)}log(t){console.log(`[ModelBlock ${this.name} - ${this.uid}]: ${t}`)}}class SD extends NGe{constructor(t){super(t);Ct(this,"next",null);Ct(this,"nextSibling",null);Ct(this,"return",null);Ct(this,"eventEmitter",new Yve);Ct(this,"status",0);Ct(this,"pendingChildren",[]);Ct(this,"relationHelper");this.relationHelper=new TGe(this)}setNext(t){this.next=t}setNextSibling(t){this.nextSibling=t}setReturn(t){this.return=t!=null?t:null}_getInnerHandler(){return{getContext:this.getContext.bind(this)}}getContext(){return{id:this.uid,onLifecycle:this.onLifecycle.bind(this),mount:this.mountTemplate.bind(this),unmount:this.unmountChild.bind(this)}}onLifecycle(t,n){return this.eventEmitter.on(t,n),{unsubscribe:()=>{this.eventEmitter.off(t,n)}}}childrenAction(t,n,o){this.relationHelper.action(t,o,r=>{var s;(s=r[n])==null||s.call(r)})}mountChildOnly(t){this.relationHelper.addNextChildren(t),this.childrenAction("pre","preInitSelf",t),this.childrenAction("post","postInitSelf",t),this.childrenAction("pre","preMountSelf",t),this.childrenAction("post","postMountSelf",t),this.childrenAction("pre","beforeMountSelf",t),this.childrenAction("post","mountSelf",t)}mountTemplate(t,n){if(t===this.template)throw new Error("can not mount yourself");let o=this.return;for(;o;){if(t===o.template)throw new Error("loop mount!");o=o.return}const r=new SD({template:t,input:n});return this.mountChild(r),r}mountChild(t){console.log("mount::status",this.status),this.status===2?this.mountChildOnly(t):this.status===1?this.pendingChildren.push(t):this.status===0&&(t.preInitSelf(),this.relationHelper.addNextChildren(t))}unmountChild(t){t instanceof SD&&(this.relationHelper.removeChild(t),t.unmount())}triggerLifecycle(t){this.eventEmitter.emit(t,void 0)}preInitSelf(){this.log("preInitSelf"),this.status===0&&(this.output=this.template(this.input,this.getContext())),this.status=1}postInitSelf(){this.log("postInitSelf"),this.triggerLifecycle("postInit")}preMountSelf(){this.log("preMountSelf"),this.triggerLifecycle("preMount")}postMountSelf(){var t;this.log("postMountSelf"),this.triggerLifecycle("postMount"),this.status=2,(t=this.pendingChildren)!=null&&t.length&&(this.log("pendingChildren"),this.pendingChildren.forEach(n=>{this.mountChildOnly(n)}),this.pendingChildren=[])}beforeMountSelf(){this.log("beforeMountSelf"),this.triggerLifecycle("beforeMount")}mountSelf(){this.log("mountSelf"),this.triggerLifecycle("mount")}preUnmountSelf(){this.log("preUnmountSelf"),this.triggerLifecycle("preUnmount")}postUnmountSelf(){this.log("postUnmountSelf"),this.triggerLifecycle("postUnmount")}beforeUnmountSelf(){this.log("beforeUnmountSelf"),this.triggerLifecycle("beforeUnmount")}unmountSelf(){this.log("unmountSelf"),this.triggerLifecycle("unmount")}preAction(t){this.relationHelper.preAction(this,n=>{var o;(o=n[t])==null||o.call(n)})}postAction(t){this.relationHelper.postAction(this,n=>{var o;(o=n[t])==null||o.call(n)})}mount(){this.preAction("preInitSelf"),this.postAction("postInitSelf"),this.preAction("preMountSelf"),this.postAction("postMountSelf"),this.preAction("beforeMountSelf"),this.postAction("mountSelf")}unmount(){this.preAction("beforeUnmountSelf"),this.postAction("unmountSelf"),this.preAction("preUnmountSelf"),this.postAction("postUnmountSelf")}}function RGe(i,e){const t=new SD({template:i,input:e});return t.mount(),t}var $y;class MGe{constructor(){Oo(this,$y,new Set)}add(e){ht(this,$y).add(e)}unsubscribe(){for(const e of ht(this,$y).values())e();ht(this,$y).clear()}}$y=new WeakMap;var zy;class Zve extends Iq{constructor(){super();Oo(this,zy,new Set);this.subscribe=this.subscribe.bind(this),this.next=this.next.bind(this)}get current(){throw new Error("need override")}next(...t){for(const n of ht(this,zy).values())try{n(...t)}catch(o){setTimeout(()=>{throw o})}}subscribe(t){ht(this,zy).add(t);const n=new MGe;return n.add(()=>{ht(this,zy).delete(t)}),n}pipe(t){return t(this)}}zy=new WeakMap;class AGe extends Yve{track(e){this.emit("track",e)}onTrack(e){this.on("track",e)}}const Qve=new AGe;function Jve(i,e){return typeof e=="function"?e(i):e}class PGe extends Zve{constructor(t){super();Ct(this,"_current");this._current=t,this.update=this.update.bind(this)}get current(){return this._current}update(t,n){const o=Jve(this._current,t);this._current=o,Qve.track({target:this.uid,extraInfo:n}),this.next(o,n)}}class Od extends PGe{update(e,t){super.update(e,t)}}class F4 extends Iq{constructor(t){super(typeof t=="object"?t==null?void 0:t.uid:void 0);Ct(this,"hint",[]);typeof t=="string"?this.hint=[t]:Object.assign(this,t!=null?t:{})}concat(t){return this.hint.push(t),this}}class OGe extends Zve{next(e,t){super.next(e,t||new F4("[ModelEvent] fallback"))}}var FGe=Object.freeze(Object.defineProperty({__proto__:null,ModelBlock:SD,start:RGe,ModelState:Od,ModelEvent:OGe,tracker:Qve,ExtraInfo:F4},Symbol.toStringTag,{value:"Module"}));function BGe(i){return new Od(i)}function WGe(i,e){const t=Cc.exports.get(i.current,e);class n extends Od{get current(){return Cc.exports.get(i.current,e)}update(r,s){i.update(a=>{const l=Cc.exports.get(a,e),c=Cc.exports.clone(a),u=Jve(l,r);return Cc.exports.set(c,e,u),c},s)}subscribe(r){return i.subscribe((s,a)=>r(Cc.exports.get(s,e),a))}}return new n(t)}function VGe(...i){const e=new Od(0);function t(n){e.update(i.map(o=>o.current).reduce((o,r)=>o+r,0),n)}return t(new F4("[sum]: init")),i.forEach(n=>{n.subscribe((o,r)=>{t(r.concat("sum"))})}),e}function HGe(i,e){const t=new Od([]);return i.forEach(n=>{n.subscribe((o,r)=>{const s=[...i,...e].map(a=>a.current);t.update(s,r.concat("combine"))})}),t}function $Ge(i,e){return i.pipe(t=>{const n=new Od(void 0);return t.subscribe(async(o,r)=>{const s=e(o);let a=s;s instanceof Promise&&(a=await s),n.update(a,r.concat("transform"))}),n})}function zGe(i){const e=new Od([]);return i.forEach(t=>{t.subscribe((n,o)=>{e.update(n,o.concat("combine"))})}),e}function UGe(...i){return i.reduce((e,t)=>e+t,0)}function jGe(i,e,t){const{data:n,key:o}=i,{mount:r,unmount:s}=e,a=new Od(n.current.map((l,c)=>{const u=new Od(c),d=Cc.exports.get(l,o);return{key:d,index:u,instance:r(t,{index:u,data:n,key:d})}})||[]);return n.subscribe((l,c)=>{const u=n.current.map((p,v)=>({key:Cc.exports.get(p,o),index:v})),d=a.current,h=new Map(u.map(p=>[p.key,p])),f=new Map(d.map(p=>[p.key,p])),g=[];for(const p of u){const v=f.get(p.key);if(v)g.push(v),v.index.current!==p.index&&v.index.update(p.index,c);else{const m=new Od(p.index),_={index:m,key:p.key,instance:r(t,{index:m,data:n,key:p.key})};g.push(_),console.log("mount ==> ",_.key)}}d.filter(p=>!h.get(p.key)).forEach(p=>{console.log("unmount ==> ",p.key),s(p.instance)}),a.update(g,c)}),{data:n,instanceList:a}}var KGe=Object.freeze(Object.defineProperty({__proto__:null,constValue:BGe,sum:VGe,proxyData:WGe,combine:HGe,transform:$Ge,merge:zGe,sumValue:UGe,mountList:jGe},Symbol.toStringTag,{value:"Module"}));const Um="EosCore",fS="EosOperators",e_e=Bt.createContext({store:void 0,nodes:[],edges:[]});function qGe(){return x.exports.useContext(e_e)}function GGe(i){const e={exports:void 0};return new Function("module",Um,fS,i)(e,FGe,KGe),e}const XGe=i=>{const{value:e,children:t,nodes:n,edges:o}=i,[r,s]=x.exports.useState(),a=x.exports.useMemo(()=>({store:r,nodes:n,edges:o}),[r,n,o]);return x.exports.useEffect(()=>{if(!e)return;const l=GGe(e);console.log({result:l,value:e}),l&&s(()=>l.exports)},[e]),he(e_e.Provider,{value:a,children:t})};function YGe(i){switch(i){case qs.Boolean:return!1;case qs.Number:return 0;case qs.String:return"";case qs.Object:return"{}";default:return}}class t_e extends pp{constructor(){super({operatorName:"State",operatorType:"StateOperator",nodeType:oh.Node});Ct(this,"nodeColor","#0079FF")}create(){return super.create({endPointOptions:{endPointList:[new ri({type:"source",label:"data",hint:"data"}),new ri({type:"target",label:"update",hint:"update"})]},value:0,valueType:qs.Number})}getStateSymbol(t){var r,s,a;const{node:n,formatVariableName:o}=t;return o(((a=(s=(r=n.data.endPointOptions)==null?void 0:r.endPointList)==null?void 0:s.find(l=>l.type==="source"&&l.hint==="data"))==null?void 0:a.id)||"")}generateBlockDeclarations(t){const{node:n}=t;return[`const ${this.getStateSymbol(t)} = new ${Um}.ModelState(${JSON.stringify(n.data.value)})`]}generateBlockOutput(t){return[]}generateBlockRelation(t){const{node:n,formatVariableName:o,nodeGraph:r}=t,s=r.findSourceNodes(n.id)||[];return[...s==null?void 0:s.map(a=>` ${o(a.relatedHandleId)}.subscribe((val, extraInfo) => { ${this.getStateSymbol(t)}.update(val, extraInfo.concat('${a.nodeId}')); - });`)]}generateAttributeControl(t){const{node:n,actions:o}=t;return vn("div",{children:[fe(CD.Item,{label:"valueType",colon:!1,children:fe(N$e,{size:"small",value:n.data.valueType,options:[{value:qs.Number,label:"Number"},{value:qs.String,label:"String"},{value:qs.Boolean,label:"Boolean"},{value:qs.Object,label:"Object"}],onChange:r=>{o.updateNode(n.id,s=>this.updateData(s,{valueType:r,value:$Ge(r)}))}})}),fe(CD.Item,{label:"value",colon:!1,children:fe(bD.TextArea,{value:[qs.String,qs.Object].includes(n.data.valueType)?n.data.value:JSON.stringify(n.data.value),onChange:r=>{let s=n.data.value;const a=r.target.value;if(n.data.valueType===qs.Object)try{JSON.parse(a),s=a}catch{Xa.error("JSON parse error, please check again")}else n.data.valueType===qs.Boolean?s=!!a:n.data.valueType===qs.Number?s=Number(a):s=a;o.updateNode(n.id,l=>this.updateData(l,{value:s}))}})})]})}getNodeProps(t){const{data:n}=t;return{showValue:!0,getBriefValue(){return{value:n.valueType===qs.Object?"Object(click to view)":JSON.stringify(n.value),hasDetail:n.valueType===qs.Object}},getDetailValue(){return JSON.stringify(n.value,void 0,2)}}}}class zGe extends Xve{constructor(){super(),this.defaultOperatorData.operatorName="ConstState",this.defaultOperatorData.operatorType="ConstStateOperator"}create(){const e=super.create();return this.updateData(e,{endPointOptions:{endPointList:[new ri({type:"source",label:"data",hint:"data"})]}})}generateBlockDeclarations(e){const{node:t}=e;return[`const ${super.getStateSymbol(e)} = new ${hS}.constValue(${JSON.stringify(t.data.value)})`]}generateBlockRelation(e){return[]}}class Lq{constructor(e,t){Tt(this,"edges");Tt(this,"nodes");Tt(this,"nodeMap");Tt(this,"connections");this.edges=t||[],this.nodes=e||[],this.nodeMap=new Map(e.map(n=>[n.id,n])),this.connections=this.initialRelation()}initialRelation(){const e=new Map;for(const t of this.edges){if(!t.target||!t.source||!(t!=null&&t.targetHandle)||!(t!=null&&t.sourceHandle)){console.warn("found useless target/source edge: ",t);continue}let n=e.get(t.source);n||(n={incoming:[],outcoming:[]}),n.outcoming.push({nodeId:t.target,handleId:t.sourceHandle,relatedHandleId:t.targetHandle}),e.set(t.source,n);let o=e.get(t.target);o||(o={incoming:[],outcoming:[]}),o.incoming.push({nodeId:t.source,handleId:t.targetHandle,relatedHandleId:t.sourceHandle}),e.set(t.target,o)}return e}findSourceNodes(e){var t;return(t=this.connections.get(e))==null?void 0:t.incoming}findTargetNodes(e){var t;return(t=this.connections.get(e))==null?void 0:t.outcoming}getSortedNodes(){var o,r,s;const e=[],t=new Map;for(const a of this.edges)if(a.source&&a.target){const l=t.get(a.target)||0,c=this.nodeMap.get(a.target);(c?((r=(o=xr(c))==null?void 0:o.getIgnoreDegreeIds)==null?void 0:r.call(o,c))||[]:[]).includes(a.targetHandle||"")||t.set(a.target,l+1)}const n=this.nodes.filter(a=>!t.get(a.id));for(;n!=null&&n.length;){const a=n.pop();if(!a)continue;e.push(a),(((s=this.connections.get(a==null?void 0:a.id))==null?void 0:s.outcoming)||[]).forEach(c=>{const u=t.get(c.nodeId);u&&(t.set(c.nodeId,u-1),u-1===0&&n.push(this.nodeMap.get(c.nodeId)))})}return e.length!==this.nodes.length&&(console.log("====== Circle ======",{result:e,nodes:this.nodes}),Xa.info("\u5B58\u5728\u5FAA\u73AF")),e}}function Ld(i){return`var_${i.replaceAll("-","_").replaceAll("$","__")}`}function Pp(i){return`block_${Ld(i)}`}function Hie(i){return`// =================== ${i} ================ // -`}function $ie(i,e){var t,n;return i!=null&&i.length?[Hie(`START: ${[(t=e.operator)==null?void 0:t.operatorName,(n=e.node)==null?void 0:n.data.nodeLabel,e.extra].filter(Boolean).join(",")}`),...i,Hie("END")]:i}class zie{generateBlock(e,t){const{nodes:n,edges:o}=t,r=new Lq(n,o),s=r.getSortedNodes(),a=s.map(d=>{var f;const h=xr(d);return $ie((f=h==null?void 0:h.generateBlockDeclarations)==null?void 0:f.call(h,{node:d,nodeGraph:r,formatVariableName:Ld,formatBlockVarName:Pp}),{operator:h,node:d,extra:"declarations"})}).flat().filter(d=>Boolean(d)),l=s.map(d=>{var f;const h=xr(d);return $ie((f=h==null?void 0:h.generateBlockRelation)==null?void 0:f.call(h,{node:d,nodeGraph:r,formatVariableName:Ld,formatBlockVarName:Pp}),{operator:h,node:d,extra:"relations"})}).flat().filter(d=>Boolean(d)),c=s.map(d=>{var f;const h=xr(d);return(f=h==null?void 0:h.generateBlockOutput)==null?void 0:f.call(h,{node:d,nodeGraph:r,formatVariableName:Ld,formatBlockVarName:Pp})}).flat().filter(d=>Boolean(d));return` - function ${Pp(e)}(input, context) { + });`)]}generateAttributeControl(t){const{node:n,actions:o}=t;return fn("div",{children:[he(CD.Item,{label:"valueType",colon:!1,children:he(W$e,{size:"small",value:n.data.valueType,options:[{value:qs.Number,label:"Number"},{value:qs.String,label:"String"},{value:qs.Boolean,label:"Boolean"},{value:qs.Object,label:"Object"}],onChange:r=>{o.updateNode(n.id,s=>this.updateData(s,{valueType:r,value:YGe(r)}))}})}),he(CD.Item,{label:"value",colon:!1,children:he(lw.TextArea,{value:[qs.String,qs.Object].includes(n.data.valueType)?n.data.value:JSON.stringify(n.data.value),onChange:r=>{let s=n.data.value;const a=r.target.value;if(n.data.valueType===qs.Object)try{JSON.parse(a),s=a}catch{Xs.error("JSON parse error, please check again")}else n.data.valueType===qs.Boolean?s=!!a:n.data.valueType===qs.Number?s=Number(a):s=a;o.updateNode(n.id,l=>this.updateData(l,{value:s}))}})})]})}getNodeProps(t){const{data:n}=t;return{showValue:!0,getBriefValue(){return{value:n.valueType===qs.Object?"Object(click to view)":JSON.stringify(n.value),hasDetail:n.valueType===qs.Object}},getDetailValue(){return JSON.stringify(n.value,void 0,2)}}}}class ZGe extends t_e{constructor(){super(),this.defaultOperatorData.operatorName="ConstState",this.defaultOperatorData.operatorType="ConstStateOperator"}create(){const e=super.create();return this.updateData(e,{endPointOptions:{endPointList:[new ri({type:"source",label:"data",hint:"data"})]}})}generateBlockDeclarations(e){const{node:t}=e;return[`const ${super.getStateSymbol(e)} = new ${fS}.constValue(${JSON.stringify(t.data.value)})`]}generateBlockRelation(e){return[]}}class Tq{constructor(e,t){Ct(this,"edges");Ct(this,"nodes");Ct(this,"nodeMap");Ct(this,"connections");this.edges=t||[],this.nodes=e||[],this.nodeMap=new Map(e.map(n=>[n.id,n])),this.connections=this.initialRelation()}initialRelation(){const e=new Map;for(const t of this.edges){if(!t.target||!t.source||!(t!=null&&t.targetHandle)||!(t!=null&&t.sourceHandle)){console.warn("found useless target/source edge: ",t);continue}let n=e.get(t.source);n||(n={incoming:[],outcoming:[]}),n.outcoming.push({nodeId:t.target,handleId:t.sourceHandle,relatedHandleId:t.targetHandle}),e.set(t.source,n);let o=e.get(t.target);o||(o={incoming:[],outcoming:[]}),o.incoming.push({nodeId:t.source,handleId:t.targetHandle,relatedHandleId:t.sourceHandle}),e.set(t.target,o)}return e}findSourceNodes(e){var t;return(t=this.connections.get(e))==null?void 0:t.incoming}findTargetNodes(e){var t;return(t=this.connections.get(e))==null?void 0:t.outcoming}getSortedNodes(){var o,r,s;const e=[],t=new Map;for(const a of this.edges)if(a.source&&a.target){const l=t.get(a.target)||0,c=this.nodeMap.get(a.target);(c?((r=(o=fr(c))==null?void 0:o.getIgnoreDegreeIds)==null?void 0:r.call(o,c))||[]:[]).includes(a.targetHandle||"")||t.set(a.target,l+1)}const n=this.nodes.filter(a=>!t.get(a.id));for(;n!=null&&n.length;){const a=n.pop();if(!a)continue;e.push(a),(((s=this.connections.get(a==null?void 0:a.id))==null?void 0:s.outcoming)||[]).forEach(c=>{const u=t.get(c.nodeId);u&&(t.set(c.nodeId,u-1),u-1===0&&n.push(this.nodeMap.get(c.nodeId)))})}return e.length!==this.nodes.length&&(console.log("====== Circle ======",{result:e,nodes:this.nodes}),Xs.info("\u5B58\u5728\u5FAA\u73AF")),e}}function Cu(i){return`var_${i.replaceAll("-","_").replaceAll("$","__")}`}function Xf(i){return`block_${Cu(i)}`}function Xie(i){return`// =================== ${i} ================ // +`}function Yie(i,e){var t,n;return i!=null&&i.length?[Xie(`START: ${[(t=e.operator)==null?void 0:t.operatorName,(n=e.node)==null?void 0:n.data.nodeLabel,e.extra].filter(Boolean).join(",")}`),...i,Xie("END")]:i}class Zie{constructor(){Ct(this,"extraAppContainer",[]);Ct(this,"handledAppContainerIdSet",new Set)}getUniqueExtraAppContainerList(){const e=new Set;return this.extraAppContainer.filter(t=>this.handledAppContainerIdSet.has(t.appContainerId)||e.has(t.appContainerId)?!1:(e.add(t.appContainerId),!0))}reset(){this.extraAppContainer=[],this.handledAppContainerIdSet=new Set}generateBlock(e,t){const{nodes:n,edges:o}=t,r=new Tq(n,o),s=r.getSortedNodes(),a=s.map(h=>{var g;const f=fr(h);return Yie((g=f==null?void 0:f.generateBlockDeclarations)==null?void 0:g.call(f,{node:h,nodeGraph:r,formatVariableName:Cu,formatBlockVarName:Xf}),{operator:f,node:h,extra:"declarations"})}).flat().filter(h=>Boolean(h)),l=s.map(h=>{var g;const f=fr(h);return Yie((g=f==null?void 0:f.generateBlockRelation)==null?void 0:g.call(f,{node:h,nodeGraph:r,formatVariableName:Cu,formatBlockVarName:Xf}),{operator:f,node:h,extra:"relations"})}).flat().filter(h=>Boolean(h)),c=s.map(h=>{var g;const f=fr(h);return(g=f==null?void 0:f.generateBlockOutput)==null?void 0:g.call(f,{node:h,nodeGraph:r,formatVariableName:Cu,formatBlockVarName:Xf})}).flat().filter(h=>Boolean(h)),u=s.map(h=>{var g;const f=fr(h);return(g=f==null?void 0:f.getExtraAppContainers)==null?void 0:g.call(f,{node:h,nodeGraph:r,formatVariableName:Cu,formatBlockVarName:Xf})}).flat().filter(h=>Boolean(h));return this.extraAppContainer=this.extraAppContainer.concat(u),` + function ${Xf(e)}(input, context) { ${a.join(`; `)} ${l.join(`; @@ -343,72 +343,73 @@ function print() { __p += __j.call(arguments, '') } } } `}generateContainer(e,t){const{layer:n}=t;return` - ${H5e(t.layer).map(a=>this.generateBlock(a.id,{nodes:a.nodes,edges:a.edges})).join(`; + ${Y5e(t.layer).map(a=>this.generateBlock(a.id,{nodes:a.nodes,edges:a.edges})).join(`; `)} - const ${Pp(e)} = ${Pp(n.id)}`}complie(e){const t="App",n=this.generateContainer(t,e),o=` + const ${Xf(e)} = ${Xf(n.id)}`}complie(e){this.reset();const t="App";let n=[this.generateContainer(t,e)],o=this.getUniqueExtraAppContainerList(),r=500;for(;(o==null?void 0:o.length)&&r>=0;)r-=1,n=[...o.map(l=>(this.handledAppContainerIdSet.add(l.appContainerId),this.generateContainer(l.appContainerId,l.data))),...n],o=this.getUniqueExtraAppContainerList();r<0&&Xs.warning("reach maxloop");const s=` const { start, tracker - } = ${zm} - ${n} + } = ${Um} + ${n.join(` +`)} function main(input) { window.logs = []; tracker.onTrack(record => { window.logs.push(record); }); - const instance = start(${Pp(t)}, input) - console.log(\`${Pp(t)}\`, instance) + const instance = start(${Xf(t)}, input) + console.log(\`${Xf(t)}\`, instance) return instance } module.exports = main; - `;return console.log(o),o}}class UGe extends Kv{constructor(){super({operatorName:"Input",operatorType:"InputOperator",nodeType:kf.Node});Tt(this,"isUnique",!0);Tt(this,"nodeColor","#5D9C59")}create(){return super.create({endPointOptions:{endPointList:[new ri({type:"group",label:"State",hint:"state",allowAddAndRemoveChildren:!0,defaultChildData:{type:"source",hint:"state"},children:[]}),new ri({type:"group",label:"Event",hint:"event",allowAddAndRemoveChildren:!0,defaultChildData:{type:"source",hint:"event"},children:[]}),new ri({type:"group",label:"Lifecycle",hint:"lifecycle",allowAddAndRemoveChildren:!1,children:[new ri({type:"source",variableName:"beforeMount"}),new ri({type:"source",variableName:"mount"}),new ri({type:"source",variableName:"beforeUnmount"}),new ri({type:"source",variableName:"unmount"})]})]}})}getEventPorts(t){var o,r,s,a;return((a=(s=(r=(o=t.data)==null?void 0:o.endPointOptions)==null?void 0:r.endPointList)==null?void 0:s.find(l=>l.type==="group"&&l.hint==="event"))==null?void 0:a.children)||[]}getStatePort(t){var o,r,s,a;return((a=(s=(r=(o=t.data)==null?void 0:o.endPointOptions)==null?void 0:r.endPointList)==null?void 0:s.find(l=>l.type==="group"&&l.hint==="state"))==null?void 0:a.children)||[]}getLifecyclePorts(t){var o,r,s,a;return((a=(s=(r=(o=t.data)==null?void 0:o.endPointOptions)==null?void 0:r.endPointList)==null?void 0:s.find(l=>l.type==="group"&&l.hint==="lifecycle"))==null?void 0:a.children)||[]}generateBlockDeclarations(t){const{node:n}=t,o=this.getEventPorts(n),r=this.getStatePort(n),s=this.getLifecyclePorts(n);return[...o.map(a=>`const ${Ld(a.id)} = input['${a.variableName}'] || new ${zm}.ModelEvent()`),...r.map(a=>`const ${Ld(a.id)} = input['${a.variableName}'] || new ${zm}.ModelState(undefined)`),...s.map(a=>`const ${Ld(a.id)} = new ${zm}.ModelEvent()`)]}generateBlockRelation(t){const{node:n}=t;return[...this.getLifecyclePorts(n).map(r=>` + `;return console.log(s),s}}class QGe extends pp{constructor(){super({operatorName:"Input",operatorType:"InputOperator",nodeType:oh.Node});Ct(this,"isUnique",!0);Ct(this,"nodeColor","#5D9C59")}create(){return super.create({endPointOptions:{endPointList:[new ri({type:"group",label:"State",hint:"state",allowAddAndRemoveChildren:!0,defaultChildData:{type:"source",hint:"state"},children:[]}),new ri({type:"group",label:"Event",hint:"event",allowAddAndRemoveChildren:!0,defaultChildData:{type:"source",hint:"event"},children:[]}),new ri({type:"group",label:"Lifecycle",hint:"lifecycle",allowAddAndRemoveChildren:!1,children:[new ri({type:"source",variableName:"beforeMount"}),new ri({type:"source",variableName:"mount"}),new ri({type:"source",variableName:"beforeUnmount"}),new ri({type:"source",variableName:"unmount"})]})]}})}getEventPorts(t){var o,r,s,a;return((a=(s=(r=(o=t.data)==null?void 0:o.endPointOptions)==null?void 0:r.endPointList)==null?void 0:s.find(l=>l.type==="group"&&l.hint==="event"))==null?void 0:a.children)||[]}getStatePort(t){var o,r,s,a;return((a=(s=(r=(o=t.data)==null?void 0:o.endPointOptions)==null?void 0:r.endPointList)==null?void 0:s.find(l=>l.type==="group"&&l.hint==="state"))==null?void 0:a.children)||[]}getLifecyclePorts(t){var o,r,s,a;return((a=(s=(r=(o=t.data)==null?void 0:o.endPointOptions)==null?void 0:r.endPointList)==null?void 0:s.find(l=>l.type==="group"&&l.hint==="lifecycle"))==null?void 0:a.children)||[]}generateBlockDeclarations(t){const{node:n}=t,o=this.getEventPorts(n),r=this.getStatePort(n),s=this.getLifecyclePorts(n);return[...o.map(a=>`const ${Cu(a.id)} = input['${a.variableName}'] || new ${Um}.ModelEvent()`),...r.map(a=>`const ${Cu(a.id)} = input['${a.variableName}'] || new ${Um}.ModelState(undefined)`),...s.map(a=>`const ${Cu(a.id)} = new ${Um}.ModelEvent()`)]}generateBlockRelation(t){const{node:n}=t;return[...this.getLifecyclePorts(n).map(r=>` context.onLifecycle('${r.variableName}', () => { - ${Ld(r.id||"")}.next(); + ${Cu(r.id||"")}.next(); }) - `)]}generateBlockOutput(t){const{node:n}=t;return this.getEventPorts(n).map(r=>`['${r.variableName||""}']: ${Ld(r.id)}`)}}class jGe extends Kv{constructor(){super({operatorName:"Output",operatorType:"OutputOperator",nodeType:kf.Node});Tt(this,"isUnique",!0);Tt(this,"nodeColor","#5D9C59")}create(){return super.create({endPointOptions:{endPointList:[new ri({type:"group",label:"State",hint:"state",allowAddAndRemoveChildren:!0,defaultChildData:{type:"target",hint:"state"},children:[new ri({type:"target",hint:"state"})]}),new ri({type:"group",label:"Event",hint:"event",allowAddAndRemoveChildren:!0,defaultChildData:{type:"target",hint:"event"},children:[]})]}})}getEventPorts(t){var o,r,s,a;return((a=(s=(r=(o=t.data)==null?void 0:o.endPointOptions)==null?void 0:r.endPointList)==null?void 0:s.find(l=>l.type==="group"&&l.hint==="event"))==null?void 0:a.children)||[]}getStatePort(t){var o,r,s,a;return((a=(s=(r=(o=t.data)==null?void 0:o.endPointOptions)==null?void 0:r.endPointList)==null?void 0:s.find(l=>l.type==="group"&&l.hint==="state"))==null?void 0:a.children)||[]}generateBlockDeclarations(t){const{node:n,formatVariableName:o}=t;return[...this.getEventPorts(n).map(s=>`const ${o(s.id)} = new ${zm}.ModelEvent()`)]}generateBlockRelation(t){const{node:n,formatVariableName:o,nodeGraph:r}=t;return[...this.getEventPorts(n).map(a=>{var u,d;const l=(d=(u=r.findSourceNodes(n.id))==null?void 0:u.find(h=>h.handleId===a.id))==null?void 0:d.relatedHandleId,c=a.id;return!l||!c?"":`${o(l)}.subscribe((value, extraInfo) => { + `)]}generateBlockOutput(t){const{node:n}=t;return this.getEventPorts(n).map(r=>`['${r.variableName||""}']: ${Cu(r.id)}`)}}class JGe extends pp{constructor(){super({operatorName:"Output",operatorType:"OutputOperator",nodeType:oh.Node});Ct(this,"isUnique",!0);Ct(this,"nodeColor","#5D9C59")}create(){return super.create({endPointOptions:{endPointList:[new ri({type:"group",label:"State",hint:"state",allowAddAndRemoveChildren:!0,defaultChildData:{type:"target",hint:"state"},children:[new ri({type:"target",hint:"state"})]}),new ri({type:"group",label:"Event",hint:"event",allowAddAndRemoveChildren:!0,defaultChildData:{type:"target",hint:"event"},children:[]})]}})}getEventPorts(t){var o,r,s,a;return((a=(s=(r=(o=t.data)==null?void 0:o.endPointOptions)==null?void 0:r.endPointList)==null?void 0:s.find(l=>l.type==="group"&&l.hint==="event"))==null?void 0:a.children)||[]}getStatePort(t){var o,r,s,a;return((a=(s=(r=(o=t.data)==null?void 0:o.endPointOptions)==null?void 0:r.endPointList)==null?void 0:s.find(l=>l.type==="group"&&l.hint==="state"))==null?void 0:a.children)||[]}generateBlockDeclarations(t){const{node:n,formatVariableName:o}=t;return[...this.getEventPorts(n).map(s=>`const ${o(s.id)} = new ${Um}.ModelEvent()`)]}generateBlockRelation(t){const{node:n,formatVariableName:o,nodeGraph:r}=t;return[...this.getEventPorts(n).map(a=>{var u,d;const l=(d=(u=r.findSourceNodes(n.id))==null?void 0:u.find(h=>h.handleId===a.id))==null?void 0:d.relatedHandleId,c=a.id;return!l||!c?"":`${o(l)}.subscribe((value, extraInfo) => { ${o(c)}.next(value, extraInfo.concat('${n.id}')) - })`})]}generateBlockOutput(t){const{node:n,formatVariableName:o,nodeGraph:r}=t,s=this.getEventPorts(n),a=this.getStatePort(n);return[...s.map(l=>`['${l.variableName}']: ${o(l.id)}`),...a.map(l=>{var u,d;const c=(d=(u=r.findSourceNodes(n.id))==null?void 0:u.find(h=>h.handleId===l.id))==null?void 0:d.relatedHandleId;return c?`['${l.variableName}']: ${o(c)}`:""})]}}class KGe extends Kv{constructor(){super({operatorName:"Sum",operatorType:"SumOperator",nodeType:kf.Node});Tt(this,"nodeColor","#FF0060")}create(){return super.create({endPointOptions:{endPointList:[new ri({type:"source",label:"output",hint:"output"}),new ri({type:"group",allowAddAndRemoveChildren:!0,hint:"input",defaultChildData:{type:"target",label:"input",hint:"input"},children:[new ri({type:"target",label:"input",hint:"input"}),new ri({type:"target",label:"input",hint:"input"})]})]}})}generateBlockDeclarations(t){var l,c,u,d;const{node:n,formatVariableName:o,nodeGraph:r}=t,s=((u=(c=(l=n.data.endPointOptions)==null?void 0:l.endPointList)==null?void 0:c.find(h=>h.hint==="output"))==null?void 0:u.id)||"",a=((d=r.findSourceNodes(n.id))==null?void 0:d.map(h=>h.relatedHandleId))||[];return[`const ${o(s)} = ${hS}.sum(${a.map(h=>o(h)).join(",")})`]}generateBlockRelation(t){return[]}generateBlockOutput(t){return[]}}const IA=new Map;function qGe(i){const e=IA.get(i.operatorType);e&&(e===i?console.warn(`duplicated register: ${i.operatorType}:${i.operatorName}`):console.error(`register with same type: ${i.operatorType}, current: ${e.operatorName}, next: ${i.operatorName}`,{current:e,operator:i})),IA.set(i.operatorType,i)}function GGe(i){Object.values(i).forEach(e=>{qGe(e)})}function Yve(i){return IA.get(i)}function xr(i){var e;return Yve(((e=i==null?void 0:i.data)==null?void 0:e.operatorType)||"")}function XGe(){return[...IA.values()]}function YGe(i){var a;const{node:e}=i,{updateNode:t,setLayer:n}=ET(),{currentStateRef:o,actionsRef:r}=e3(),s=xr(e);return vn("div",{children:[fe(CD.Item,{label:"name",children:fe(bD,{size:"small",placeholder:"name",defaultValue:(a=e.data)==null?void 0:a.nodeLabel,onBlur:l=>{if(s){const c=l.target.value;t(e.id,u=>s==null?void 0:s.updateData(u,{nodeLabel:c})),setTimeout(()=>{n(u=>{const d=wc(u,e.data.layerId);return d&&(d.name=c),{...u}})})}}})}),fe(CD.Item,{label:"\u624B\u52A8\u5237\u65B0",children:fe(Bs,{size:"small",onClick:()=>{s==null||s.refreshNode({currentState:o.current,actions:r.current,node:e})},children:"\u5237\u65B0"})})]})}function Uie(i){return[new ri({type:"group",label:"State",children:(i==null?void 0:i.outputStateList)||[],allowAddAndRemoveChildren:!1,hint:"outputState"}),new ri({type:"group",label:"Event",children:(i==null?void 0:i.outputEventList)||[],allowAddAndRemoveChildren:!1,hint:"outputEvent"}),new ri({type:"group",label:"State",children:(i==null?void 0:i.inputStateList)||[],allowAddAndRemoveChildren:!1,hint:"inputState"}),new ri({type:"group",label:"Event",children:(i==null?void 0:i.inputEventList)||[],allowAddAndRemoveChildren:!1,hint:"inputEvent"})]}class ZGe extends Kv{constructor(){super({operatorName:"Custom",operatorType:"CustomOperator",nodeType:kf.Node,endPointOptions:{endPointList:Uie()}});Tt(this,"description","\u53CC\u51FB\u7F16\u8F91");Tt(this,"isUnique",!1);Tt(this,"nodeColor","#FBCB0A")}getOutputPorts(t){var o,r,s,a;return((a=(s=(r=(o=t.data)==null?void 0:o.endPointOptions)==null?void 0:r.endPointList)==null?void 0:s.filter(l=>l.type==="group"&&["outputState","outputEvent"].includes(l.hint||"")).map(l=>l==null?void 0:l.children))==null?void 0:a.flat().filter(l=>!!l))||[]}getInputPorts(t){var o,r,s;return((s=(r=(o=t.data)==null?void 0:o.endPointOptions)==null?void 0:r.endPointList)==null?void 0:s.filter(a=>a.type==="group"&&["inputState","inputEvent"].includes(a.hint||"")).map(a=>a==null?void 0:a.children).flat().filter(a=>!!a))||[]}onAfterCreate(t){const{node:n,actions:o,currentState:r}=t,{setLayer:s}=o,{activeLayerId:a,layer:l}=r,c=wc(l,a),u=new o4(n.data.operatorName);u.relativeNodeId=n.id,u.parentLayerId=c==null?void 0:c.id,n.data.layerId=u.id,s(d=>{const h=wc(d,a);return h&&(h.nodes.find(f=>f.id===n.id)||(h.nodes=h.nodes.concat(n)),h.children.push(u)),{...d}})}generateAttributeControl(t){const{node:n}=t;return fe("div",{children:fe(YGe,{node:n})})}generateBlockDeclarations(t){var a;const{node:n,nodeGraph:o,formatVariableName:r,formatBlockVarName:s}=t;return[`const temp_${r(n.id)} = context.mount(${s(n.data.layerId)}, { - ${this.getInputPorts(n).map(l=>{var u,d;const c=(d=(u=o.findSourceNodes(n.id))==null?void 0:u.find(h=>h.handleId===l.id))==null?void 0:d.relatedHandleId;return c?`['${l.variableName}']: ${r(c||"")}`:""}).filter(Boolean).join(`, + })`})]}generateBlockOutput(t){const{node:n,formatVariableName:o,nodeGraph:r}=t,s=this.getEventPorts(n),a=this.getStatePort(n);return[...s.map(l=>`['${l.variableName}']: ${o(l.id)}`),...a.map(l=>{var u,d;const c=(d=(u=r.findSourceNodes(n.id))==null?void 0:u.find(h=>h.handleId===l.id))==null?void 0:d.relatedHandleId;return c?`['${l.variableName}']: ${o(c)}`:""})]}}class eXe extends pp{constructor(){super({operatorName:"Sum",operatorType:"SumOperator",nodeType:oh.Node});Ct(this,"nodeColor","#FF0060")}create(){return super.create({endPointOptions:{endPointList:[new ri({type:"source",label:"output",hint:"output"}),new ri({type:"group",allowAddAndRemoveChildren:!0,hint:"input",defaultChildData:{type:"target",label:"input",hint:"input"},children:[new ri({type:"target",label:"input",hint:"input"}),new ri({type:"target",label:"input",hint:"input"})]})]}})}generateBlockDeclarations(t){var l,c,u,d;const{node:n,formatVariableName:o,nodeGraph:r}=t,s=((u=(c=(l=n.data.endPointOptions)==null?void 0:l.endPointList)==null?void 0:c.find(h=>h.hint==="output"))==null?void 0:u.id)||"",a=((d=r.findSourceNodes(n.id))==null?void 0:d.map(h=>h.relatedHandleId))||[];return[`const ${o(s)} = ${fS}.sum(${a.map(h=>o(h)).join(",")})`]}generateBlockRelation(t){return[]}generateBlockOutput(t){return[]}}const RA=new Map;function tXe(i){const e=RA.get(i.operatorType);e&&(e===i?console.warn(`duplicated register: ${i.operatorType}:${i.operatorName}`):console.error(`register with same type: ${i.operatorType}, current: ${e.operatorName}, next: ${i.operatorName}`,{current:e,operator:i})),RA.set(i.operatorType,i)}function Nq(i){Object.values(i).forEach(e=>{tXe(e)})}function Rq(i){return RA.get(i)}function fr(i){var e;return Rq(((e=i==null?void 0:i.data)==null?void 0:e.operatorType)||"")}function Qie(){return[...RA.values()]}function nXe(i){var a;const{node:e}=i,{updateNode:t,setLayer:n}=kT(),{currentStateRef:o,actionsRef:r}=IT(),s=fr(e);return fn("div",{children:[he(CD.Item,{label:"name",children:he(lw,{size:"small",placeholder:"name",defaultValue:(a=e.data)==null?void 0:a.nodeLabel,onBlur:l=>{if(s){const c=l.target.value;t(e.id,u=>s==null?void 0:s.updateData(u,{nodeLabel:c})),setTimeout(()=>{n(u=>{const d=wc(u,e.data.layerId);return d&&(d.name=c),{...u}})})}}})}),he(CD.Item,{label:"\u624B\u52A8\u5237\u65B0",children:he(ts,{size:"small",onClick:()=>{s==null||s.refreshNode({currentState:o.current,actions:r.current,node:e})},children:"\u5237\u65B0"})})]})}function n_e(i){return[new ri({type:"group",label:"State",children:(i==null?void 0:i.outputStateList)||[],allowAddAndRemoveChildren:!1,hint:"outputState"}),new ri({type:"group",label:"Event",children:(i==null?void 0:i.outputEventList)||[],allowAddAndRemoveChildren:!1,hint:"outputEvent"}),new ri({type:"group",label:"State",children:(i==null?void 0:i.inputStateList)||[],allowAddAndRemoveChildren:!1,hint:"inputState"}),new ri({type:"group",label:"Event",children:(i==null?void 0:i.inputEventList)||[],allowAddAndRemoveChildren:!1,hint:"inputEvent"})]}function zW(i,e){var d,h,f,g;const t=i.nodes.find(p=>{var v;return((v=fr(p))==null?void 0:v.operatorType)==="InputOperator"}),n=i.nodes.find(p=>{var v;return((v=fr(p))==null?void 0:v.operatorType)==="OutputOperator"}),o=fr(t),r=fr(n);function s(p){return`${p}__${e.slice(-5)}`}const a=t?(d=o==null?void 0:o.getStatePort(t))==null?void 0:d.map(p=>new ri({...p,id:s(p.id),type:"target"})):[],l=t?(h=o==null?void 0:o.getEventPorts(t))==null?void 0:h.map(p=>new ri({...p,id:s(p.id),type:"target"})):[],c=n?(f=r==null?void 0:r.getStatePort(n))==null?void 0:f.map(p=>new ri({...p,id:s(p.id),type:"source"})):[],u=n?(g=r==null?void 0:r.getEventPorts(n))==null?void 0:g.map(p=>new ri({...p,id:s(p.id),type:"source"})):[];return{endPointList:n_e({inputEventList:l||[],inputStateList:a||[],outputEventList:u||[],outputStateList:c||[]})}}function i_e(i){var t,n,o,r;return((r=(o=(n=(t=i.data)==null?void 0:t.endPointOptions)==null?void 0:n.endPointList)==null?void 0:o.filter(s=>s.type==="group"&&["outputState","outputEvent"].includes(s.hint||"")).map(s=>s==null?void 0:s.children))==null?void 0:r.flat().filter(s=>!!s))||[]}function o_e(i){var t,n,o;return((o=(n=(t=i.data)==null?void 0:t.endPointOptions)==null?void 0:n.endPointList)==null?void 0:o.filter(r=>r.type==="group"&&["inputState","inputEvent"].includes(r.hint||"")).map(r=>r==null?void 0:r.children).flat().filter(r=>!!r))||[]}class iXe extends pp{constructor(){super({operatorName:"Group",operatorType:"GroupOperator",nodeType:oh.Node,endPointOptions:{endPointList:n_e()}});Ct(this,"description","\u53CC\u51FB\u7F16\u8F91");Ct(this,"isUnique",!1);Ct(this,"nodeColor","#FBCB0A")}onAfterCreate(t){const{node:n,actions:o,currentState:r}=t,{setLayer:s}=o,{activeLayerId:a,layer:l}=r,c=wc(l,a),u=new wI(n.data.operatorName);u.relativeNodeId=n.id,u.parentLayerId=c==null?void 0:c.id,n.data.layerId=u.id,s(d=>{const h=wc(d,a);return h&&(h.nodes.find(f=>f.id===n.id)||(h.nodes=h.nodes.concat(n)),h.children.push(u)),{...d}})}generateAttributeControl(t){const{node:n}=t;return he("div",{children:he(nXe,{node:n})})}generateBlockDeclarations(t){var a;const{node:n,nodeGraph:o,formatVariableName:r,formatBlockVarName:s}=t;return[`const temp_${r(n.id)} = context.mount(${s(n.data.layerId)}, { + ${o_e(n).map(l=>{var u,d;const c=(d=(u=o.findSourceNodes(n.id))==null?void 0:u.find(h=>h.handleId===l.id))==null?void 0:d.relatedHandleId;return c?`['${l.variableName}']: ${r(c||"")}`:""}).filter(Boolean).join(`, `)} - })`,...(a=this.getOutputPorts(n)||[])==null?void 0:a.map(l=>`const ${r(l.id)} = temp_${r(n.id)}.output['${l.variableName}']`)]}generateBlockOutput(t){return[]}generateBlockRelation(t){return[]}getFreshNodeData(t){var a,l,c,u;const{node:n,currentState:o}=t,{layer:r}=o,s=wc(r,n.data.layerId);if(s){let d=function(y){return`${y}__${n.id.slice(-5)}`};const h=s.nodes.find(y=>{var L;return((L=xr(y))==null?void 0:L.operatorType)==="InputOperator"}),f=s.nodes.find(y=>{var L;return((L=xr(y))==null?void 0:L.operatorType)==="OutputOperator"}),g=xr(h),p=xr(f),v=h?(a=g==null?void 0:g.getStatePort(h))==null?void 0:a.map(y=>new ri({...y,id:d(y.id),type:"target"})):[],m=h?(l=g==null?void 0:g.getEventPorts(h))==null?void 0:l.map(y=>new ri({...y,id:d(y.id),type:"target"})):[],_=f?(c=p==null?void 0:p.getStatePort(f))==null?void 0:c.map(y=>new ri({...y,id:d(y.id),type:"source"})):[],w=f?(u=p==null?void 0:p.getEventPorts(f))==null?void 0:u.map(y=>new ri({...y,id:d(y.id),type:"source"})):[];return{targetLayer:s,updatedNodeData:{endPointOptions:{endPointList:Uie({inputEventList:m||[],inputStateList:v||[],outputEventList:w||[],outputStateList:_||[]})}}}}}refreshNode(t){var r;const{node:n}=t,o=this.getFreshNodeData(t);o!=null&&o.updatedNodeData&&t.actions.updateNode(n.id,s=>this.updateData(s,o.updatedNodeData),{updateInternal:!0,layerId:(r=o.targetLayer)==null?void 0:r.parentLayerId})}onNodeDoubleClick(t){var r;const{node:n,actions:o}=t;o==null||o.setActiveLayerId((r=n==null?void 0:n.data)==null?void 0:r.layerId)}onNodeFocus(t){this==null||this.refreshNode(t)}}class QGe extends Kv{constructor(){super({operatorName:"Combine",operatorType:"CombineOperator",nodeType:kf.Node});Tt(this,"nodeColor","#C21292")}create(){return super.create({endPointOptions:{endPointList:[new ri({type:"group",hint:"output",children:[new ri({label:"output",hint:"output",variableType:"array",type:"source"})]}),new ri({type:"group",hint:"mainInput",label:"Main Stream",defaultChildData:{hint:"mainSource",type:"target"},allowAddAndRemoveChildren:!0,children:[new ri({hint:"mainSource",type:"target"})]}),new ri({type:"group",hint:"appendInput",label:"Append Stream",defaultChildData:{hint:"appendSource",type:"target"},allowAddAndRemoveChildren:!0,children:[new ri({hint:"appendSource",type:"target"})]})]}})}getHintPorts(t,n){var o,r,s;return(s=(r=(o=t.data.endPointOptions)==null?void 0:o.endPointList)==null?void 0:r.find(a=>a.hint===n))==null?void 0:s.children}getMainInputPorts(t){return this.getHintPorts(t,"mainInput")}getAppendInputPorts(t){return this.getHintPorts(t,"appendInput")}generateBlockDeclarations(t){var f,g,p,v;const{node:n,formatVariableName:o,nodeGraph:r}=t,s=((g=(f=this.getHintPorts(n,"output"))==null?void 0:f.find(m=>m.hint==="output"))==null?void 0:g.id)||"",a=((p=this.getMainInputPorts(n))==null?void 0:p.map(m=>m.id))||[],l=((v=this.getAppendInputPorts(n))==null?void 0:v.map(m=>m.id))||[],c=r.findSourceNodes(n.id)||[],u=new Map(c.map(m=>[m.handleId,m])),d=a.map(m=>u.get(m)).map(m=>m==null?void 0:m.relatedHandleId),h=l.map(m=>u.get(m)).map(m=>m==null?void 0:m.relatedHandleId);return[`const ${o(s)} = ${hS}.combine( + })`,...(a=i_e(n)||[])==null?void 0:a.map(l=>`const ${r(l.id)} = temp_${r(n.id)}.output['${l.variableName}']`)]}generateBlockOutput(t){return[]}generateBlockRelation(t){return[]}getFreshNodeData(t){const{node:n,currentState:o}=t,{layer:r}=o,s=wc(r,n.data.layerId);if(s){const{endPointList:a}=zW(s,n.id);return{targetLayer:s,updatedNodeData:{endPointOptions:{endPointList:a}}}}}refreshNode(t){var r;const{node:n}=t,o=this.getFreshNodeData(t);o!=null&&o.updatedNodeData&&t.actions.updateNode(n.id,s=>this.updateData(s,o.updatedNodeData),{updateInternal:!0,layerId:(r=o.targetLayer)==null?void 0:r.parentLayerId})}onNodeDoubleClick(t){var r;const{node:n,actions:o}=t;o==null||o.setActiveLayerId((r=n==null?void 0:n.data)==null?void 0:r.layerId)}onNodeFocus(t){this==null||this.refreshNode(t)}}class oXe extends pp{constructor(){super({operatorName:"Combine",operatorType:"CombineOperator",nodeType:oh.Node});Ct(this,"nodeColor","#C21292")}create(){return super.create({endPointOptions:{endPointList:[new ri({type:"group",hint:"output",children:[new ri({label:"output",hint:"output",variableType:"array",type:"source"})]}),new ri({type:"group",hint:"mainInput",label:"Main Stream",defaultChildData:{hint:"mainSource",type:"target"},allowAddAndRemoveChildren:!0,children:[new ri({hint:"mainSource",type:"target"})]}),new ri({type:"group",hint:"appendInput",label:"Append Stream",defaultChildData:{hint:"appendSource",type:"target"},allowAddAndRemoveChildren:!0,children:[new ri({hint:"appendSource",type:"target"})]})]}})}getHintPorts(t,n){var o,r,s;return(s=(r=(o=t.data.endPointOptions)==null?void 0:o.endPointList)==null?void 0:r.find(a=>a.hint===n))==null?void 0:s.children}getMainInputPorts(t){return this.getHintPorts(t,"mainInput")}getAppendInputPorts(t){return this.getHintPorts(t,"appendInput")}generateBlockDeclarations(t){var f,g,p,v;const{node:n,formatVariableName:o,nodeGraph:r}=t,s=((g=(f=this.getHintPorts(n,"output"))==null?void 0:f.find(m=>m.hint==="output"))==null?void 0:g.id)||"",a=((p=this.getMainInputPorts(n))==null?void 0:p.map(m=>m.id))||[],l=((v=this.getAppendInputPorts(n))==null?void 0:v.map(m=>m.id))||[],c=r.findSourceNodes(n.id)||[],u=new Map(c.map(m=>[m.handleId,m])),d=a.map(m=>u.get(m)).map(m=>m==null?void 0:m.relatedHandleId),h=l.map(m=>u.get(m)).map(m=>m==null?void 0:m.relatedHandleId);return[`const ${o(s)} = ${fS}.combine( [${d.map(m=>m?o(m):"undefined").join(",")}], [${h.map(m=>m?o(m):"undefined").join(",")}] - )`]}generateBlockOutput(t){return[]}generateBlockRelation(t){return[]}}const JGe="_editor_94u6i_1",eXe="_container_94u6i_4";var jie={editor:JGe,container:eXe};function fc(i,e=0){return i[i.length-(1+e)]}function tXe(i){if(i.length===0)throw new Error("Invalid tail call");return[i.slice(0,i.length-1),i[i.length-1]]}function Lo(i,e,t=(n,o)=>n===o){if(i===e)return!0;if(!i||!e||i.length!==e.length)return!1;for(let n=0,o=i.length;nt(i[n],e))}function iXe(i,e){let t=0,n=i-1;for(;t<=n;){const o=(t+n)/2|0,r=e(o);if(r<0)t=o+1;else if(r>0)n=o-1;else return o}return-(t+1)}function VW(i,e,t){if(i=i|0,i>=e.length)throw new TypeError("invalid index");const n=e[Math.floor(e.length*Math.random())],o=[],r=[],s=[];for(const a of e){const l=t(a,n);l<0?o.push(a):l>0?r.push(a):s.push(a)}return i!!e)}function qie(i){let e=0;for(let t=0;t0}function mv(i,e=t=>t){const t=new Set;return i.filter(n=>{const o=e(n);return t.has(o)?!1:(t.add(o),!0)})}function e_e(i,e){return i.length>0?i[0]:e}function Gs(i,e){let t=typeof e=="number"?i:0;typeof e=="number"?t=i:(t=0,e=i);const n=[];if(t<=e)for(let o=t;oe;o--)n.push(o);return n}function F4(i,e,t){const n=i.slice(0,e),o=i.slice(e);return n.concat(t,o)}function E6(i,e){const t=i.indexOf(e);t>-1&&(i.splice(t,1),i.unshift(e))}function XN(i,e){const t=i.indexOf(e);t>-1&&(i.splice(t,1),i.push(e))}function HW(i,e){for(const t of e)i.push(t)}function Eq(i){return Array.isArray(i)?i:[i]}function rXe(i,e,t){const n=t_e(i,e),o=i.length,r=t.length;i.length=o+r;for(let s=o-1;s>=n;s--)i[s+r]=i[s];for(let s=0;s0}i.isGreaterThan=n;function o(r){return r===0}i.isNeitherLessOrGreaterThan=o,i.greaterThan=1,i.lessThan=-1,i.neitherLessOrGreaterThan=0})(LD||(LD={}));function Nc(i,e){return(t,n)=>e(i(t),i(n))}function sXe(...i){return(e,t)=>{for(const n of i){const o=n(e,t);if(!LD.isNeitherLessOrGreaterThan(o))return o}return LD.neitherLessOrGreaterThan}}const zg=(i,e)=>i-e,aXe=(i,e)=>zg(i?1:0,e?1:0);function n_e(i){return(e,t)=>-i(e,t)}class rp{constructor(e){this.items=e,this.firstIdx=0,this.lastIdx=this.items.length-1}get length(){return this.lastIdx-this.firstIdx+1}takeWhile(e){let t=this.firstIdx;for(;t=0&&e(this.items[t]);)t--;const n=t===this.lastIdx?null:this.items.slice(t+1,this.lastIdx+1);return this.lastIdx=t,n}peek(){if(this.length!==0)return this.items[this.firstIdx]}dequeue(){const e=this.items[this.firstIdx];return this.firstIdx++,e}takeCount(e){const t=this.items.slice(this.firstIdx,this.firstIdx+e);return this.firstIdx+=e,t}}class rf{constructor(e){this.iterate=e}toArray(){const e=[];return this.iterate(t=>(e.push(t),!0)),e}filter(e){return new rf(t=>this.iterate(n=>e(n)?t(n):!0))}map(e){return new rf(t=>this.iterate(n=>t(e(n))))}findLast(e){let t;return this.iterate(n=>(e(n)&&(t=n),!0)),t}findLastMaxBy(e){let t,n=!0;return this.iterate(o=>((n||LD.isGreaterThan(e(o,t)))&&(n=!1,t=o),!0)),t}}rf.empty=new rf(i=>{});function aa(i){return typeof i=="string"}function na(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)&&!(i instanceof RegExp)&&!(i instanceof Date)}function lXe(i){const e=Object.getPrototypeOf(Uint8Array);return typeof i=="object"&&i instanceof e}function vv(i){return typeof i=="number"&&!isNaN(i)}function Xie(i){return!!i&&typeof i[Symbol.iterator]=="function"}function i_e(i){return i===!0||i===!1}function nl(i){return typeof i=="undefined"}function ED(i){return!Ml(i)}function Ml(i){return nl(i)||i===null}function fi(i,e){if(!i)throw new Error(e?`Unexpected type, expected '${e}'`:"Unexpected type")}function s0(i){if(Ml(i))throw new Error("Assertion Failed: argument is undefined or null");return i}function DD(i){return typeof i=="function"}function cXe(i,e){const t=Math.min(i.length,e.length);for(let n=0;n{e[t]=n&&typeof n=="object"?hg(n):n}),e}function dXe(i){if(!i||typeof i!="object")return i;const e=[i];for(;e.length>0;){const t=e.shift();Object.freeze(t);for(const n in t)if(o_e.call(t,n)){const o=t[n];typeof o=="object"&&!Object.isFrozen(o)&&!lXe(o)&&e.push(o)}}return i}const o_e=Object.prototype.hasOwnProperty;function r_e(i,e){return $W(i,e,new Set)}function $W(i,e,t){if(Ml(i))return i;const n=e(i);if(typeof n!="undefined")return n;if(Array.isArray(i)){const o=[];for(const r of i)o.push($W(r,e,t));return o}if(na(i)){if(t.has(i))throw new Error("Cannot clone recursive data-structure");t.add(i);const o={};for(const r in i)o_e.call(i,r)&&(o[r]=$W(i[r],e,t));return t.delete(i),o}return i}function B4(i,e,t=!0){return na(i)?(na(e)&&Object.keys(e).forEach(n=>{n in i?t&&(na(i[n])&&na(e[n])?B4(i[n],e[n],t):i[n]=e[n]):i[n]=e[n]}),i):e}function Kl(i,e){if(i===e)return!0;if(i==null||e===null||e===void 0||typeof i!=typeof e||typeof i!="object"||Array.isArray(i)!==Array.isArray(e))return!1;let t,n;if(Array.isArray(i)){if(i.length!==e.length)return!1;for(t=0;tfunction(){const r=Array.prototype.slice.call(arguments,0);return e(o,r)},n={};for(const o of i)n[o]=t(o);return n}globalThis&&globalThis.__awaiter;let gXe=typeof document!="undefined"&&document.location&&document.location.hash.indexOf("pseudo=true")>=0;function pXe(i,e){let t;return e.length===0?t=i:t=i.replace(/\{(\d+)\}/g,(n,o)=>{const r=o[0],s=e[r];let a=n;return typeof s=="string"?a=s:(typeof s=="number"||typeof s=="boolean"||s===void 0||s===null)&&(a=String(s)),a}),gXe&&(t="\uFF3B"+t.replace(/[aouei]/g,"$&$&")+"\uFF3D"),t}function C(i,e,...t){return pXe(e,t)}var D6;const EC="en";let TA=!1,NA=!1,KR=!1,s_e=!1,kq=!1,Iq=!1,a_e=!1,YN,qR=EC,Yie=EC,mXe,od;const ku=typeof self=="object"?self:typeof global=="object"?global:{};let Xs;typeof ku.vscode!="undefined"&&typeof ku.vscode.process!="undefined"?Xs=ku.vscode.process:typeof process!="undefined"&&(Xs=process);const vXe=typeof((D6=Xs==null?void 0:Xs.versions)===null||D6===void 0?void 0:D6.electron)=="string",_Xe=vXe&&(Xs==null?void 0:Xs.type)==="renderer";if(typeof navigator=="object"&&!_Xe)od=navigator.userAgent,TA=od.indexOf("Windows")>=0,NA=od.indexOf("Macintosh")>=0,Iq=(od.indexOf("Macintosh")>=0||od.indexOf("iPad")>=0||od.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,KR=od.indexOf("Linux")>=0,a_e=(od==null?void 0:od.indexOf("Mobi"))>=0,kq=!0,C({key:"ensureLoaderPluginIsLoaded",comment:["{Locked}"]},"_"),YN=EC,qR=YN,Yie=navigator.language;else if(typeof Xs=="object"){TA=Xs.platform==="win32",NA=Xs.platform==="darwin",KR=Xs.platform==="linux",KR&&!!Xs.env.SNAP&&Xs.env.SNAP_REVISION,Xs.env.CI||Xs.env.BUILD_ARTIFACTSTAGINGDIRECTORY,YN=EC,qR=EC;const i=Xs.env.VSCODE_NLS_CONFIG;if(i)try{const e=JSON.parse(i),t=e.availableLanguages["*"];YN=e.locale,Yie=e.osLocale,qR=t||EC,mXe=e._translationsConfigFile}catch{}s_e=!0}else console.error("Unable to resolve platform.");const as=TA,Nn=NA,Ss=KR,Fd=s_e,qv=kq,bXe=kq&&typeof ku.importScripts=="function",jd=Iq,CXe=a_e,hf=od,wXe=qR,yXe=typeof ku.postMessage=="function"&&!ku.importScripts,l_e=(()=>{if(yXe){const i=[];ku.addEventListener("message",t=>{if(t.data&&t.data.vscodeScheduleAsyncWork)for(let n=0,o=i.length;n{const n=++e;i.push({id:n,callback:t}),ku.postMessage({vscodeScheduleAsyncWork:n},"*")}}return i=>setTimeout(i)})(),Wl=NA||Iq?2:TA?1:3;let Zie=!0,Qie=!1;function c_e(){if(!Qie){Qie=!0;const i=new Uint8Array(2);i[0]=1,i[1]=2,Zie=new Uint16Array(i.buffer)[0]===(2<<8)+1}return Zie}const u_e=!!(hf&&hf.indexOf("Chrome")>=0),SXe=!!(hf&&hf.indexOf("Firefox")>=0),xXe=!!(!u_e&&hf&&hf.indexOf("Safari")>=0),LXe=!!(hf&&hf.indexOf("Edg/")>=0);hf&&hf.indexOf("Android")>=0;const ms={tabSize:4,indentSize:4,insertSpaces:!0,detectIndentation:!0,trimAutoWhitespace:!0,largeFileOptimizations:!0,bracketPairColorizationOptions:{enabled:!0,independentColorPoolPerBracketType:!1}};var mn;(function(i){function e(_){return _&&typeof _=="object"&&typeof _[Symbol.iterator]=="function"}i.is=e;const t=Object.freeze([]);function n(){return t}i.empty=n;function*o(_){yield _}i.single=o;function r(_){return e(_)?_:o(_)}i.wrap=r;function s(_){return _||t}i.from=s;function*a(_){for(let w=_.length-1;w>=0;w--)yield _[w]}i.reverse=a;function l(_){return!_||_[Symbol.iterator]().next().done===!0}i.isEmpty=l;function c(_){return _[Symbol.iterator]().next().value}i.first=c;function u(_,w){for(const y of _)if(w(y))return!0;return!1}i.some=u;function d(_,w){for(const y of _)if(w(y))return y}i.find=d;function*h(_,w){for(const y of _)w(y)&&(yield y)}i.filter=h;function*f(_,w){let y=0;for(const L of _)yield w(L,y++)}i.map=f;function*g(..._){for(const w of _)for(const y of w)yield y}i.concat=g;function p(_,w,y){let L=y;for(const D of _)L=w(L,D);return L}i.reduce=p;function*v(_,w,y=_.length){for(w<0&&(w+=_.length),y<0?y+=_.length:y>_.length&&(y=_.length);w{o||(o=!0,this._remove(n))}}shift(){if(this._first!==Co.Undefined){const e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==Co.Undefined){const e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==Co.Undefined&&e.next!==Co.Undefined){const t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===Co.Undefined&&e.next===Co.Undefined?(this._first=Co.Undefined,this._last=Co.Undefined):e.next===Co.Undefined?(this._last=this._last.prev,this._last.next=Co.Undefined):e.prev===Co.Undefined&&(this._first=this._first.next,this._first.prev=Co.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==Co.Undefined;)yield e.element,e=e.next}}const d_e="`~!@#$%^&*()-=+[{]}\\|;:'\",.<>/?";function EXe(i=""){let e="(-?\\d*\\.\\d\\w*)|([^";for(const t of d_e)i.indexOf(t)>=0||(e+="\\"+t);return e+="\\s]+)",new RegExp(e,"g")}const Tq=EXe();function h_e(i){let e=Tq;if(i&&i instanceof RegExp)if(i.global)e=i;else{let t="g";i.ignoreCase&&(t+="i"),i.multiline&&(t+="m"),i.unicode&&(t+="u"),e=new RegExp(i.source,t)}return e.lastIndex=0,e}const f_e=new ia;f_e.unshift({maxLen:1e3,windowSize:15,timeBudget:150});function kD(i,e,t,n,o){if(o||(o=mn.first(f_e)),t.length>o.maxLen){let c=i-o.maxLen/2;return c<0?c=0:n+=c,t=t.substring(c,i+o.maxLen/2),kD(i,e,t,n,o)}const r=Date.now(),s=i-1-n;let a=-1,l=null;for(let c=1;!(Date.now()-r>=o.timeBudget);c++){const u=s-o.windowSize*c;e.lastIndex=Math.max(0,u);const d=DXe(e,t,s,a);if(!d&&l||(l=d,u<=0))break;a=u}if(l){const c={word:l[0],startColumn:n+1+l.index,endColumn:n+1+l.index+l[0].length};return e.lastIndex=0,c}return null}function DXe(i,e,t,n){let o;for(;o=i.exec(e);){const r=o.index||0;if(r<=t&&i.lastIndex>=t)return o;if(n>0&&r>n)return null}return null}const Up=8;class g_e{constructor(e){this._values=e}hasChanged(e){return this._values[e]}}class p_e{constructor(){this.stableMinimapLayoutInput=null,this.stableFitMaxMinimapScale=0,this.stableFitRemainingWidth=0}}class to{constructor(e,t,n,o){this.id=e,this.name=t,this.defaultValue=n,this.schema=o}applyUpdate(e,t){return W4(e,t)}compute(e,t,n){return n}}class sE{constructor(e,t){this.newValue=e,this.didChange=t}}function W4(i,e){if(typeof i!="object"||typeof e!="object"||!i||!e)return new sE(e,i!==e);if(Array.isArray(i)||Array.isArray(e)){const n=Array.isArray(i)&&Array.isArray(e)&&Lo(i,e);return new sE(e,!n)}let t=!1;for(const n in e)if(e.hasOwnProperty(n)){const o=W4(i[n],e[n]);o.didChange&&(i[n]=o.newValue,t=!0)}return new sE(i,t)}class AI{constructor(e){this.schema=void 0,this.id=e,this.name="_never_",this.defaultValue=void 0}applyUpdate(e,t){return W4(e,t)}validate(e){return this.defaultValue}}class fS{constructor(e,t,n,o){this.id=e,this.name=t,this.defaultValue=n,this.schema=o}applyUpdate(e,t){return W4(e,t)}validate(e){return typeof e=="undefined"?this.defaultValue:e}compute(e,t,n){return n}}function St(i,e){return typeof i=="undefined"?e:i==="false"?!1:Boolean(i)}class On extends fS{constructor(e,t,n,o=void 0){typeof o!="undefined"&&(o.type="boolean",o.default=n),super(e,t,n,o)}validate(e){return St(e,this.defaultValue)}}function T_(i,e,t,n){if(typeof i=="undefined")return e;let o=parseInt(i,10);return isNaN(o)?e:(o=Math.max(t,o),o=Math.min(n,o),o|0)}class yi extends fS{static clampedInt(e,t,n,o){return T_(e,t,n,o)}constructor(e,t,n,o,r,s=void 0){typeof s!="undefined"&&(s.type="integer",s.default=n,s.minimum=o,s.maximum=r),super(e,t,n,s),this.minimum=o,this.maximum=r}validate(e){return yi.clampedInt(e,this.defaultValue,this.minimum,this.maximum)}}function kXe(i,e,t,n){if(typeof i=="undefined")return e;const o=wu.float(i,e);return wu.clamp(o,t,n)}class wu extends fS{static clamp(e,t,n){return en?n:e}static float(e,t){if(typeof e=="number")return e;if(typeof e=="undefined")return t;const n=parseFloat(e);return isNaN(n)?t:n}constructor(e,t,n,o,r){typeof r!="undefined"&&(r.type="number",r.default=n),super(e,t,n,r),this.validationFn=o}validate(e){return this.validationFn(wu.float(e,this.defaultValue))}}class Qa extends fS{static string(e,t){return typeof e!="string"?t:e}constructor(e,t,n,o=void 0){typeof o!="undefined"&&(o.type="string",o.default=n),super(e,t,n,o)}validate(e){return Qa.string(e,this.defaultValue)}}function To(i,e,t,n){return typeof i!="string"?e:n&&i in n?n[i]:t.indexOf(i)===-1?e:i}class uo extends fS{constructor(e,t,n,o,r=void 0){typeof r!="undefined"&&(r.type="string",r.enum=o,r.default=n),super(e,t,n,r),this._allowedValues=o}validate(e){return To(e,this.defaultValue,this._allowedValues)}}class ZN extends to{constructor(e,t,n,o,r,s,a=void 0){typeof a!="undefined"&&(a.type="string",a.enum=r,a.default=o),super(e,t,n,a),this._allowedValues=r,this._convert=s}validate(e){return typeof e!="string"?this.defaultValue:this._allowedValues.indexOf(e)===-1?this.defaultValue:this._convert(e)}}function IXe(i){switch(i){case"none":return 0;case"keep":return 1;case"brackets":return 2;case"advanced":return 3;case"full":return 4}}class TXe extends to{constructor(){super(2,"accessibilitySupport",0,{type:"string",enum:["auto","on","off"],enumDescriptions:[C("accessibilitySupport.auto","Use platform APIs to detect when a Screen Reader is attached"),C("accessibilitySupport.on","Optimize for usage with a Screen Reader"),C("accessibilitySupport.off","Assume a screen reader is not attached")],default:"auto",tags:["accessibility"],description:C("accessibilitySupport","Controls if the UI should run in a mode where it is optimized for screen readers.")})}validate(e){switch(e){case"auto":return 0;case"off":return 1;case"on":return 2}return this.defaultValue}compute(e,t,n){return n===0?e.accessibilitySupport:n}}class NXe extends to{constructor(){const e={insertSpace:!0,ignoreEmptyLines:!0};super(23,"comments",e,{"editor.comments.insertSpace":{type:"boolean",default:e.insertSpace,description:C("comments.insertSpace","Controls whether a space character is inserted when commenting.")},"editor.comments.ignoreEmptyLines":{type:"boolean",default:e.ignoreEmptyLines,description:C("comments.ignoreEmptyLines","Controls if empty lines should be ignored with toggle, add or remove actions for line comments.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{insertSpace:St(t.insertSpace,this.defaultValue.insertSpace),ignoreEmptyLines:St(t.ignoreEmptyLines,this.defaultValue.ignoreEmptyLines)}}}function RXe(i){switch(i){case"blink":return 1;case"smooth":return 2;case"phase":return 3;case"expand":return 4;case"solid":return 5}}var Wr;(function(i){i[i.Line=1]="Line",i[i.Block=2]="Block",i[i.Underline=3]="Underline",i[i.LineThin=4]="LineThin",i[i.BlockOutline=5]="BlockOutline",i[i.UnderlineThin=6]="UnderlineThin"})(Wr||(Wr={}));function MXe(i){switch(i){case"line":return Wr.Line;case"block":return Wr.Block;case"underline":return Wr.Underline;case"line-thin":return Wr.LineThin;case"block-outline":return Wr.BlockOutline;case"underline-thin":return Wr.UnderlineThin}}class AXe extends AI{constructor(){super(140)}compute(e,t,n){const o=["monaco-editor"];return t.get(39)&&o.push(t.get(39)),e.extraEditorClassName&&o.push(e.extraEditorClassName),t.get(73)==="default"?o.push("mouse-default"):t.get(73)==="copy"&&o.push("mouse-copy"),t.get(110)&&o.push("showUnused"),t.get(138)&&o.push("showDeprecated"),o.join(" ")}}class PXe extends On{constructor(){super(37,"emptySelectionClipboard",!0,{description:C("emptySelectionClipboard","Controls whether copying without a selection copies the current line.")})}compute(e,t,n){return n&&e.emptySelectionClipboard}}class OXe extends to{constructor(){const e={cursorMoveOnType:!0,seedSearchStringFromSelection:"always",autoFindInSelection:"never",globalFindClipboard:!1,addExtraSpaceOnTop:!0,loop:!0};super(41,"find",e,{"editor.find.cursorMoveOnType":{type:"boolean",default:e.cursorMoveOnType,description:C("find.cursorMoveOnType","Controls whether the cursor should jump to find matches while typing.")},"editor.find.seedSearchStringFromSelection":{type:"string",enum:["never","always","selection"],default:e.seedSearchStringFromSelection,enumDescriptions:[C("editor.find.seedSearchStringFromSelection.never","Never seed search string from the editor selection."),C("editor.find.seedSearchStringFromSelection.always","Always seed search string from the editor selection, including word at cursor position."),C("editor.find.seedSearchStringFromSelection.selection","Only seed search string from the editor selection.")],description:C("find.seedSearchStringFromSelection","Controls whether the search string in the Find Widget is seeded from the editor selection.")},"editor.find.autoFindInSelection":{type:"string",enum:["never","always","multiline"],default:e.autoFindInSelection,enumDescriptions:[C("editor.find.autoFindInSelection.never","Never turn on Find in Selection automatically (default)."),C("editor.find.autoFindInSelection.always","Always turn on Find in Selection automatically."),C("editor.find.autoFindInSelection.multiline","Turn on Find in Selection automatically when multiple lines of content are selected.")],description:C("find.autoFindInSelection","Controls the condition for turning on Find in Selection automatically.")},"editor.find.globalFindClipboard":{type:"boolean",default:e.globalFindClipboard,description:C("find.globalFindClipboard","Controls whether the Find Widget should read or modify the shared find clipboard on macOS."),included:Nn},"editor.find.addExtraSpaceOnTop":{type:"boolean",default:e.addExtraSpaceOnTop,description:C("find.addExtraSpaceOnTop","Controls whether the Find Widget should add extra lines on top of the editor. When true, you can scroll beyond the first line when the Find Widget is visible.")},"editor.find.loop":{type:"boolean",default:e.loop,description:C("find.loop","Controls whether the search automatically restarts from the beginning (or the end) when no further matches can be found.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{cursorMoveOnType:St(t.cursorMoveOnType,this.defaultValue.cursorMoveOnType),seedSearchStringFromSelection:typeof e.seedSearchStringFromSelection=="boolean"?e.seedSearchStringFromSelection?"always":"never":To(t.seedSearchStringFromSelection,this.defaultValue.seedSearchStringFromSelection,["never","always","selection"]),autoFindInSelection:typeof e.autoFindInSelection=="boolean"?e.autoFindInSelection?"always":"never":To(t.autoFindInSelection,this.defaultValue.autoFindInSelection,["never","always","multiline"]),globalFindClipboard:St(t.globalFindClipboard,this.defaultValue.globalFindClipboard),addExtraSpaceOnTop:St(t.addExtraSpaceOnTop,this.defaultValue.addExtraSpaceOnTop),loop:St(t.loop,this.defaultValue.loop)}}}class Al extends to{constructor(){super(51,"fontLigatures",Al.OFF,{anyOf:[{type:"boolean",description:C("fontLigatures","Enables/Disables font ligatures ('calt' and 'liga' font features). Change this to a string for fine-grained control of the 'font-feature-settings' CSS property.")},{type:"string",description:C("fontFeatureSettings","Explicit 'font-feature-settings' CSS property. A boolean can be passed instead if one only needs to turn on/off ligatures.")}],description:C("fontLigaturesGeneral","Configures font ligatures or font features. Can be either a boolean to enable/disable ligatures or a string for the value of the CSS 'font-feature-settings' property."),default:!1})}validate(e){return typeof e=="undefined"?this.defaultValue:typeof e=="string"?e==="false"?Al.OFF:e==="true"?Al.ON:e:Boolean(e)?Al.ON:Al.OFF}}Al.OFF='"liga" off, "calt" off';Al.ON='"liga" on, "calt" on';class Ed extends to{constructor(){super(54,"fontVariations",Ed.OFF,{anyOf:[{type:"boolean",description:C("fontVariations","Enables/Disables the translation from font-weight to font-variation-settings. Change this to a string for fine-grained control of the 'font-variation-settings' CSS property.")},{type:"string",description:C("fontVariationSettings","Explicit 'font-variation-settings' CSS property. A boolean can be passed instead if one only needs to translate font-weight to font-variation-settings.")}],description:C("fontVariationsGeneral","Configures font variations. Can be either a boolean to enable/disable the translation from font-weight to font-variation-settings or a string for the value of the CSS 'font-variation-settings' property."),default:!1})}validate(e){return typeof e=="undefined"?this.defaultValue:typeof e=="string"?e==="false"?Ed.OFF:e==="true"?Ed.TRANSLATE:e:Boolean(e)?Ed.TRANSLATE:Ed.OFF}compute(e,t,n){return e.fontInfo.fontVariationSettings}}Ed.OFF="normal";Ed.TRANSLATE="translate";class FXe extends AI{constructor(){super(50)}compute(e,t,n){return e.fontInfo}}class BXe extends fS{constructor(){super(52,"fontSize",sl.fontSize,{type:"number",minimum:6,maximum:100,default:sl.fontSize,description:C("fontSize","Controls the font size in pixels.")})}validate(e){const t=wu.float(e,this.defaultValue);return t===0?sl.fontSize:wu.clamp(t,6,100)}compute(e,t,n){return e.fontInfo.fontSize}}class Th extends to{constructor(){super(53,"fontWeight",sl.fontWeight,{anyOf:[{type:"number",minimum:Th.MINIMUM_VALUE,maximum:Th.MAXIMUM_VALUE,errorMessage:C("fontWeightErrorMessage",'Only "normal" and "bold" keywords or numbers between 1 and 1000 are allowed.')},{type:"string",pattern:"^(normal|bold|1000|[1-9][0-9]{0,2})$"},{enum:Th.SUGGESTION_VALUES}],default:sl.fontWeight,description:C("fontWeight",'Controls the font weight. Accepts "normal" and "bold" keywords or numbers between 1 and 1000.')})}validate(e){return e==="normal"||e==="bold"?e:String(yi.clampedInt(e,sl.fontWeight,Th.MINIMUM_VALUE,Th.MAXIMUM_VALUE))}}Th.SUGGESTION_VALUES=["normal","bold","100","200","300","400","500","600","700","800","900"];Th.MINIMUM_VALUE=1;Th.MAXIMUM_VALUE=1e3;class WXe extends to{constructor(){const e={multiple:"peek",multipleDefinitions:"peek",multipleTypeDefinitions:"peek",multipleDeclarations:"peek",multipleImplementations:"peek",multipleReferences:"peek",alternativeDefinitionCommand:"editor.action.goToReferences",alternativeTypeDefinitionCommand:"editor.action.goToReferences",alternativeDeclarationCommand:"editor.action.goToReferences",alternativeImplementationCommand:"",alternativeReferenceCommand:""},t={type:"string",enum:["peek","gotoAndPeek","goto"],default:e.multiple,enumDescriptions:[C("editor.gotoLocation.multiple.peek","Show Peek view of the results (default)"),C("editor.gotoLocation.multiple.gotoAndPeek","Go to the primary result and show a Peek view"),C("editor.gotoLocation.multiple.goto","Go to the primary result and enable Peek-less navigation to others")]},n=["","editor.action.referenceSearch.trigger","editor.action.goToReferences","editor.action.peekImplementation","editor.action.goToImplementation","editor.action.peekTypeDefinition","editor.action.goToTypeDefinition","editor.action.peekDeclaration","editor.action.revealDeclaration","editor.action.peekDefinition","editor.action.revealDefinitionAside","editor.action.revealDefinition"];super(58,"gotoLocation",e,{"editor.gotoLocation.multiple":{deprecationMessage:C("editor.gotoLocation.multiple.deprecated","This setting is deprecated, please use separate settings like 'editor.editor.gotoLocation.multipleDefinitions' or 'editor.editor.gotoLocation.multipleImplementations' instead.")},"editor.gotoLocation.multipleDefinitions":Object.assign({description:C("editor.editor.gotoLocation.multipleDefinitions","Controls the behavior the 'Go to Definition'-command when multiple target locations exist.")},t),"editor.gotoLocation.multipleTypeDefinitions":Object.assign({description:C("editor.editor.gotoLocation.multipleTypeDefinitions","Controls the behavior the 'Go to Type Definition'-command when multiple target locations exist.")},t),"editor.gotoLocation.multipleDeclarations":Object.assign({description:C("editor.editor.gotoLocation.multipleDeclarations","Controls the behavior the 'Go to Declaration'-command when multiple target locations exist.")},t),"editor.gotoLocation.multipleImplementations":Object.assign({description:C("editor.editor.gotoLocation.multipleImplemenattions","Controls the behavior the 'Go to Implementations'-command when multiple target locations exist.")},t),"editor.gotoLocation.multipleReferences":Object.assign({description:C("editor.editor.gotoLocation.multipleReferences","Controls the behavior the 'Go to References'-command when multiple target locations exist.")},t),"editor.gotoLocation.alternativeDefinitionCommand":{type:"string",default:e.alternativeDefinitionCommand,enum:n,description:C("alternativeDefinitionCommand","Alternative command id that is being executed when the result of 'Go to Definition' is the current location.")},"editor.gotoLocation.alternativeTypeDefinitionCommand":{type:"string",default:e.alternativeTypeDefinitionCommand,enum:n,description:C("alternativeTypeDefinitionCommand","Alternative command id that is being executed when the result of 'Go to Type Definition' is the current location.")},"editor.gotoLocation.alternativeDeclarationCommand":{type:"string",default:e.alternativeDeclarationCommand,enum:n,description:C("alternativeDeclarationCommand","Alternative command id that is being executed when the result of 'Go to Declaration' is the current location.")},"editor.gotoLocation.alternativeImplementationCommand":{type:"string",default:e.alternativeImplementationCommand,enum:n,description:C("alternativeImplementationCommand","Alternative command id that is being executed when the result of 'Go to Implementation' is the current location.")},"editor.gotoLocation.alternativeReferenceCommand":{type:"string",default:e.alternativeReferenceCommand,enum:n,description:C("alternativeReferenceCommand","Alternative command id that is being executed when the result of 'Go to Reference' is the current location.")}})}validate(e){var t,n,o,r,s;if(!e||typeof e!="object")return this.defaultValue;const a=e;return{multiple:To(a.multiple,this.defaultValue.multiple,["peek","gotoAndPeek","goto"]),multipleDefinitions:(t=a.multipleDefinitions)!==null&&t!==void 0?t:To(a.multipleDefinitions,"peek",["peek","gotoAndPeek","goto"]),multipleTypeDefinitions:(n=a.multipleTypeDefinitions)!==null&&n!==void 0?n:To(a.multipleTypeDefinitions,"peek",["peek","gotoAndPeek","goto"]),multipleDeclarations:(o=a.multipleDeclarations)!==null&&o!==void 0?o:To(a.multipleDeclarations,"peek",["peek","gotoAndPeek","goto"]),multipleImplementations:(r=a.multipleImplementations)!==null&&r!==void 0?r:To(a.multipleImplementations,"peek",["peek","gotoAndPeek","goto"]),multipleReferences:(s=a.multipleReferences)!==null&&s!==void 0?s:To(a.multipleReferences,"peek",["peek","gotoAndPeek","goto"]),alternativeDefinitionCommand:Qa.string(a.alternativeDefinitionCommand,this.defaultValue.alternativeDefinitionCommand),alternativeTypeDefinitionCommand:Qa.string(a.alternativeTypeDefinitionCommand,this.defaultValue.alternativeTypeDefinitionCommand),alternativeDeclarationCommand:Qa.string(a.alternativeDeclarationCommand,this.defaultValue.alternativeDeclarationCommand),alternativeImplementationCommand:Qa.string(a.alternativeImplementationCommand,this.defaultValue.alternativeImplementationCommand),alternativeReferenceCommand:Qa.string(a.alternativeReferenceCommand,this.defaultValue.alternativeReferenceCommand)}}}class VXe extends to{constructor(){const e={enabled:!0,delay:300,hidingDelay:300,sticky:!0,above:!0};super(60,"hover",e,{"editor.hover.enabled":{type:"boolean",default:e.enabled,description:C("hover.enabled","Controls whether the hover is shown.")},"editor.hover.delay":{type:"number",default:e.delay,minimum:0,maximum:1e4,description:C("hover.delay","Controls the delay in milliseconds after which the hover is shown.")},"editor.hover.sticky":{type:"boolean",default:e.sticky,description:C("hover.sticky","Controls whether the hover should remain visible when mouse is moved over it.")},"editor.hover.hidingDelay":{type:"integer",minimum:0,default:e.hidingDelay,description:C("hover.hidingDelay","Controls the delay in milliseconds after thich the hover is hidden. Requires `editor.hover.sticky` to be enabled.")},"editor.hover.above":{type:"boolean",default:e.above,description:C("hover.above","Prefer showing hovers above the line, if there's space.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:St(t.enabled,this.defaultValue.enabled),delay:yi.clampedInt(t.delay,this.defaultValue.delay,0,1e4),sticky:St(t.sticky,this.defaultValue.sticky),hidingDelay:yi.clampedInt(t.hidingDelay,this.defaultValue.hidingDelay,0,6e5),above:St(t.above,this.defaultValue.above)}}}class fw extends AI{constructor(){super(143)}compute(e,t,n){return fw.computeLayout(t,{memory:e.memory,outerWidth:e.outerWidth,outerHeight:e.outerHeight,isDominatedByLongLines:e.isDominatedByLongLines,lineHeight:e.fontInfo.lineHeight,viewLineCount:e.viewLineCount,lineNumbersDigitCount:e.lineNumbersDigitCount,typicalHalfwidthCharacterWidth:e.fontInfo.typicalHalfwidthCharacterWidth,maxDigitWidth:e.fontInfo.maxDigitWidth,pixelRatio:e.pixelRatio,glyphMarginDecorationLaneCount:e.glyphMarginDecorationLaneCount})}static computeContainedMinimapLineCount(e){const t=e.height/e.lineHeight,n=Math.floor(e.paddingTop/e.lineHeight);let o=Math.floor(e.paddingBottom/e.lineHeight);e.scrollBeyondLastLine&&(o=Math.max(o,t-1));const r=(n+e.viewLineCount+o)/(e.pixelRatio*e.height),s=Math.floor(e.viewLineCount/r);return{typicalViewportLineCount:t,extraLinesBeforeFirstLine:n,extraLinesBeyondLastLine:o,desiredRatio:r,minimapLineCount:s}}static _computeMinimapLayout(e,t){const n=e.outerWidth,o=e.outerHeight,r=e.pixelRatio;if(!e.minimap.enabled)return{renderMinimap:0,minimapLeft:0,minimapWidth:0,minimapHeightIsEditorHeight:!1,minimapIsSampling:!1,minimapScale:1,minimapLineHeight:1,minimapCanvasInnerWidth:0,minimapCanvasInnerHeight:Math.floor(r*o),minimapCanvasOuterWidth:0,minimapCanvasOuterHeight:o};const s=t.stableMinimapLayoutInput,a=s&&e.outerHeight===s.outerHeight&&e.lineHeight===s.lineHeight&&e.typicalHalfwidthCharacterWidth===s.typicalHalfwidthCharacterWidth&&e.pixelRatio===s.pixelRatio&&e.scrollBeyondLastLine===s.scrollBeyondLastLine&&e.paddingTop===s.paddingTop&&e.paddingBottom===s.paddingBottom&&e.minimap.enabled===s.minimap.enabled&&e.minimap.side===s.minimap.side&&e.minimap.size===s.minimap.size&&e.minimap.showSlider===s.minimap.showSlider&&e.minimap.renderCharacters===s.minimap.renderCharacters&&e.minimap.maxColumn===s.minimap.maxColumn&&e.minimap.scale===s.minimap.scale&&e.verticalScrollbarWidth===s.verticalScrollbarWidth&&e.isViewportWrapping===s.isViewportWrapping,l=e.lineHeight,c=e.typicalHalfwidthCharacterWidth,u=e.scrollBeyondLastLine,d=e.minimap.renderCharacters;let h=r>=2?Math.round(e.minimap.scale*2):e.minimap.scale;const f=e.minimap.maxColumn,g=e.minimap.size,p=e.minimap.side,v=e.verticalScrollbarWidth,m=e.viewLineCount,_=e.remainingWidth,w=e.isViewportWrapping,y=d?2:3;let L=Math.floor(r*o);const D=L/r;let E=!1,I=!1,k=y*h,R=h/r,A=1;if(g==="fill"||g==="fit"){const{typicalViewportLineCount:$,extraLinesBeforeFirstLine:z,extraLinesBeyondLastLine:K,desiredRatio:j,minimapLineCount:G}=fw.computeContainedMinimapLineCount({viewLineCount:m,scrollBeyondLastLine:u,paddingTop:e.paddingTop,paddingBottom:e.paddingBottom,height:o,lineHeight:l,pixelRatio:r});if(m/G>1)E=!0,I=!0,h=1,k=1,R=h/r;else{let de=!1,he=h+1;if(g==="fit"){const pe=Math.ceil((z+m+K)*k);w&&a&&_<=t.stableFitRemainingWidth?(de=!0,he=t.stableFitMaxMinimapScale):de=pe>L}if(g==="fill"||de){E=!0;const pe=h;k=Math.min(l*r,Math.max(1,Math.floor(1/j))),w&&a&&_<=t.stableFitRemainingWidth&&(he=t.stableFitMaxMinimapScale),h=Math.min(he,Math.max(1,Math.floor(k/y))),h>pe&&(A=Math.min(2,h/pe)),R=h/r/A,L=Math.ceil(Math.max($,z+m+K)*k),w?(t.stableMinimapLayoutInput=e,t.stableFitRemainingWidth=_,t.stableFitMaxMinimapScale=h):(t.stableMinimapLayoutInput=null,t.stableFitRemainingWidth=0)}}}const P=Math.floor(f*R),N=Math.min(P,Math.max(0,Math.floor((_-v-2)*R/(c+R)))+Up);let M=Math.floor(r*N);const H=M/r;M=Math.floor(M*A);const W=d?1:2,F=p==="left"?0:n-N-v;return{renderMinimap:W,minimapLeft:F,minimapWidth:N,minimapHeightIsEditorHeight:E,minimapIsSampling:I,minimapScale:h,minimapLineHeight:k,minimapCanvasInnerWidth:M,minimapCanvasInnerHeight:L,minimapCanvasOuterWidth:H,minimapCanvasOuterHeight:D}}static computeLayout(e,t){const n=t.outerWidth|0,o=t.outerHeight|0,r=t.lineHeight|0,s=t.lineNumbersDigitCount|0,a=t.typicalHalfwidthCharacterWidth,l=t.maxDigitWidth,c=t.pixelRatio,u=t.viewLineCount,d=e.get(135),h=d==="inherit"?e.get(134):d,f=h==="inherit"?e.get(130):h,g=e.get(133),p=t.isDominatedByLongLines,v=e.get(57),m=e.get(67).renderType!==0,_=e.get(68),w=e.get(104),y=e.get(83),L=e.get(72),D=e.get(102),E=D.verticalScrollbarSize,I=D.verticalHasArrows,k=D.arrowSize,R=D.horizontalScrollbarSize,A=e.get(43),P=e.get(109)!=="never";let N=e.get(65);A&&P&&(N+=16);let M=0;if(m){const Se=Math.max(s,_);M=Math.round(Se*l)}let H=0;v&&(H=r*t.glyphMarginDecorationLaneCount);let W=0,F=W+H,$=F+M,z=$+N;const K=n-H-M-N;let j=!1,G=!1,X=-1;h==="inherit"&&p?(j=!0,G=!0):f==="on"||f==="bounded"?G=!0:f==="wordWrapColumn"&&(X=g);const de=fw._computeMinimapLayout({outerWidth:n,outerHeight:o,lineHeight:r,typicalHalfwidthCharacterWidth:a,pixelRatio:c,scrollBeyondLastLine:w,paddingTop:y.top,paddingBottom:y.bottom,minimap:L,verticalScrollbarWidth:E,viewLineCount:u,remainingWidth:K,isViewportWrapping:G},t.memory||new p_e);de.renderMinimap!==0&&de.minimapLeft===0&&(W+=de.minimapWidth,F+=de.minimapWidth,$+=de.minimapWidth,z+=de.minimapWidth);const he=K-de.minimapWidth,pe=Math.max(1,Math.floor((he-E-2)/a)),be=I?k:0;return G&&(X=Math.max(1,pe),f==="bounded"&&(X=Math.min(X,g))),{width:n,height:o,glyphMarginLeft:W,glyphMarginWidth:H,glyphMarginDecorationLaneCount:t.glyphMarginDecorationLaneCount,lineNumbersLeft:F,lineNumbersWidth:M,decorationsLeft:$,decorationsWidth:N,contentLeft:z,contentWidth:he,minimap:de,viewportColumn:pe,isWordWrapMinified:j,isViewportWrapping:G,wrappingColumn:X,verticalScrollbarWidth:E,horizontalScrollbarHeight:R,overviewRuler:{top:be,width:E,height:o-2*be,right:0}}}}class HXe extends to{constructor(){super(137,"wrappingStrategy","simple",{"editor.wrappingStrategy":{enumDescriptions:[C("wrappingStrategy.simple","Assumes that all characters are of the same width. This is a fast algorithm that works correctly for monospace fonts and certain scripts (like Latin characters) where glyphs are of equal width."),C("wrappingStrategy.advanced","Delegates wrapping points computation to the browser. This is a slow algorithm, that might cause freezes for large files, but it works correctly in all cases.")],type:"string",enum:["simple","advanced"],default:"simple",description:C("wrappingStrategy","Controls the algorithm that computes wrapping points. Note that when in accessibility mode, advanced will be used for the best experience.")}})}validate(e){return To(e,"simple",["simple","advanced"])}compute(e,t,n){return t.get(2)===2?"advanced":n}}class $Xe extends to{constructor(){const e={enabled:!0};super(64,"lightbulb",e,{"editor.lightbulb.enabled":{type:"boolean",default:e.enabled,description:C("codeActions","Enables the Code Action lightbulb in the editor.")}})}validate(e){return!e||typeof e!="object"?this.defaultValue:{enabled:St(e.enabled,this.defaultValue.enabled)}}}class zXe extends to{constructor(){const e={enabled:!1,maxLineCount:5,defaultModel:"outlineModel",scrollWithEditor:!0};super(114,"stickyScroll",e,{"editor.stickyScroll.enabled":{type:"boolean",default:e.enabled,description:C("editor.stickyScroll.enabled","Shows the nested current scopes during the scroll at the top of the editor.")},"editor.stickyScroll.maxLineCount":{type:"number",default:e.maxLineCount,minimum:1,maximum:10,description:C("editor.stickyScroll.maxLineCount","Defines the maximum number of sticky lines to show.")},"editor.stickyScroll.defaultModel":{type:"string",enum:["outlineModel","foldingProviderModel","indentationModel"],default:e.defaultModel,description:C("editor.stickyScroll.defaultModel","Defines the model to use for determining which lines to stick. If the outline model does not exist, it will fall back on the folding provider model which falls back on the indentation model. This order is respected in all three cases.")},"editor.stickyScroll.scrollWithEditor":{type:"boolean",default:e.scrollWithEditor,description:C("editor.stickyScroll.scrollWithEditor","Enable scrolling of the sticky scroll widget with the editor's horizontal scrollbar.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:St(t.enabled,this.defaultValue.enabled),maxLineCount:yi.clampedInt(t.maxLineCount,this.defaultValue.maxLineCount,1,10),defaultModel:To(t.defaultModel,this.defaultValue.defaultModel,["outlineModel","foldingProviderModel","indentationModel"]),scrollWithEditor:St(t.scrollWithEditor,this.defaultValue.scrollWithEditor)}}}class UXe extends to{constructor(){const e={enabled:"on",fontSize:0,fontFamily:"",padding:!1};super(139,"inlayHints",e,{"editor.inlayHints.enabled":{type:"string",default:e.enabled,description:C("inlayHints.enable","Enables the inlay hints in the editor."),enum:["on","onUnlessPressed","offUnlessPressed","off"],markdownEnumDescriptions:[C("editor.inlayHints.on","Inlay hints are enabled"),C("editor.inlayHints.onUnlessPressed","Inlay hints are showing by default and hide when holding {0}",Nn?"Ctrl+Option":"Ctrl+Alt"),C("editor.inlayHints.offUnlessPressed","Inlay hints are hidden by default and show when holding {0}",Nn?"Ctrl+Option":"Ctrl+Alt"),C("editor.inlayHints.off","Inlay hints are disabled")]},"editor.inlayHints.fontSize":{type:"number",default:e.fontSize,markdownDescription:C("inlayHints.fontSize","Controls font size of inlay hints in the editor. As default the {0} is used when the configured value is less than {1} or greater than the editor font size.","`#editor.fontSize#`","`5`")},"editor.inlayHints.fontFamily":{type:"string",default:e.fontFamily,markdownDescription:C("inlayHints.fontFamily","Controls font family of inlay hints in the editor. When set to empty, the {0} is used.","`#editor.fontFamily#`")},"editor.inlayHints.padding":{type:"boolean",default:e.padding,description:C("inlayHints.padding","Enables the padding around the inlay hints in the editor.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return typeof t.enabled=="boolean"&&(t.enabled=t.enabled?"on":"off"),{enabled:To(t.enabled,this.defaultValue.enabled,["on","off","offUnlessPressed","onUnlessPressed"]),fontSize:yi.clampedInt(t.fontSize,this.defaultValue.fontSize,0,100),fontFamily:Qa.string(t.fontFamily,this.defaultValue.fontFamily),padding:St(t.padding,this.defaultValue.padding)}}}class jXe extends to{constructor(){super(65,"lineDecorationsWidth",10)}validate(e){return typeof e=="string"&&/^\d+(\.\d+)?ch$/.test(e)?-parseFloat(e.substring(0,e.length-2)):yi.clampedInt(e,this.defaultValue,0,1e3)}compute(e,t,n){return n<0?yi.clampedInt(-n*e.fontInfo.typicalHalfwidthCharacterWidth,this.defaultValue,0,1e3):n}}class KXe extends wu{constructor(){super(66,"lineHeight",sl.lineHeight,e=>wu.clamp(e,0,150),{markdownDescription:C("lineHeight",`Controls the line height. + )`]}generateBlockOutput(t){return[]}generateBlockRelation(t){return[]}}const rXe="_editor_94u6i_1",sXe="_container_94u6i_4";var Jie={editor:rXe,container:sXe};function gc(i,e=0){return i[i.length-(1+e)]}function aXe(i){if(i.length===0)throw new Error("Invalid tail call");return[i.slice(0,i.length-1),i[i.length-1]]}function Lo(i,e,t=(n,o)=>n===o){if(i===e)return!0;if(!i||!e||i.length!==e.length)return!1;for(let n=0,o=i.length;nt(i[n],e))}function cXe(i,e){let t=0,n=i-1;for(;t<=n;){const o=(t+n)/2|0,r=e(o);if(r<0)t=o+1;else if(r>0)n=o-1;else return o}return-(t+1)}function UW(i,e,t){if(i=i|0,i>=e.length)throw new TypeError("invalid index");const n=e[Math.floor(e.length*Math.random())],o=[],r=[],s=[];for(const a of e){const l=t(a,n);l<0?o.push(a):l>0?r.push(a):s.push(a)}return i!!e)}function toe(i){let e=0;for(let t=0;t0}function vv(i,e=t=>t){const t=new Set;return i.filter(n=>{const o=e(n);return t.has(o)?!1:(t.add(o),!0)})}function l_e(i,e){return i.length>0?i[0]:e}function Gs(i,e){let t=typeof e=="number"?i:0;typeof e=="number"?t=i:(t=0,e=i);const n=[];if(t<=e)for(let o=t;oe;o--)n.push(o);return n}function B4(i,e,t){const n=i.slice(0,e),o=i.slice(e);return n.concat(t,o)}function E6(i,e){const t=i.indexOf(e);t>-1&&(i.splice(t,1),i.unshift(e))}function QN(i,e){const t=i.indexOf(e);t>-1&&(i.splice(t,1),i.push(e))}function jW(i,e){for(const t of e)i.push(t)}function Mq(i){return Array.isArray(i)?i:[i]}function dXe(i,e,t){const n=c_e(i,e),o=i.length,r=t.length;i.length=o+r;for(let s=o-1;s>=n;s--)i[s+r]=i[s];for(let s=0;s0}i.isGreaterThan=n;function o(r){return r===0}i.isNeitherLessOrGreaterThan=o,i.greaterThan=1,i.lessThan=-1,i.neitherLessOrGreaterThan=0})(LD||(LD={}));function Rc(i,e){return(t,n)=>e(i(t),i(n))}function hXe(...i){return(e,t)=>{for(const n of i){const o=n(e,t);if(!LD.isNeitherLessOrGreaterThan(o))return o}return LD.neitherLessOrGreaterThan}}const Ug=(i,e)=>i-e,fXe=(i,e)=>Ug(i?1:0,e?1:0);function u_e(i){return(e,t)=>-i(e,t)}class sp{constructor(e){this.items=e,this.firstIdx=0,this.lastIdx=this.items.length-1}get length(){return this.lastIdx-this.firstIdx+1}takeWhile(e){let t=this.firstIdx;for(;t=0&&e(this.items[t]);)t--;const n=t===this.lastIdx?null:this.items.slice(t+1,this.lastIdx+1);return this.lastIdx=t,n}peek(){if(this.length!==0)return this.items[this.firstIdx]}dequeue(){const e=this.items[this.firstIdx];return this.firstIdx++,e}takeCount(e){const t=this.items.slice(this.firstIdx,this.firstIdx+e);return this.firstIdx+=e,t}}class af{constructor(e){this.iterate=e}toArray(){const e=[];return this.iterate(t=>(e.push(t),!0)),e}filter(e){return new af(t=>this.iterate(n=>e(n)?t(n):!0))}map(e){return new af(t=>this.iterate(n=>t(e(n))))}findLast(e){let t;return this.iterate(n=>(e(n)&&(t=n),!0)),t}findLastMaxBy(e){let t,n=!0;return this.iterate(o=>((n||LD.isGreaterThan(e(o,t)))&&(n=!1,t=o),!0)),t}}af.empty=new af(i=>{});function la(i){return typeof i=="string"}function ia(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)&&!(i instanceof RegExp)&&!(i instanceof Date)}function gXe(i){const e=Object.getPrototypeOf(Uint8Array);return typeof i=="object"&&i instanceof e}function _v(i){return typeof i=="number"&&!isNaN(i)}function ioe(i){return!!i&&typeof i[Symbol.iterator]=="function"}function d_e(i){return i===!0||i===!1}function il(i){return typeof i=="undefined"}function ED(i){return!Al(i)}function Al(i){return il(i)||i===null}function fi(i,e){if(!i)throw new Error(e?`Unexpected type, expected '${e}'`:"Unexpected type")}function a0(i){if(Al(i))throw new Error("Assertion Failed: argument is undefined or null");return i}function DD(i){return typeof i=="function"}function pXe(i,e){const t=Math.min(i.length,e.length);for(let n=0;n{e[t]=n&&typeof n=="object"?fg(n):n}),e}function vXe(i){if(!i||typeof i!="object")return i;const e=[i];for(;e.length>0;){const t=e.shift();Object.freeze(t);for(const n in t)if(h_e.call(t,n)){const o=t[n];typeof o=="object"&&!Object.isFrozen(o)&&!gXe(o)&&e.push(o)}}return i}const h_e=Object.prototype.hasOwnProperty;function f_e(i,e){return KW(i,e,new Set)}function KW(i,e,t){if(Al(i))return i;const n=e(i);if(typeof n!="undefined")return n;if(Array.isArray(i)){const o=[];for(const r of i)o.push(KW(r,e,t));return o}if(ia(i)){if(t.has(i))throw new Error("Cannot clone recursive data-structure");t.add(i);const o={};for(const r in i)h_e.call(i,r)&&(o[r]=KW(i[r],e,t));return t.delete(i),o}return i}function W4(i,e,t=!0){return ia(i)?(ia(e)&&Object.keys(e).forEach(n=>{n in i?t&&(ia(i[n])&&ia(e[n])?W4(i[n],e[n],t):i[n]=e[n]):i[n]=e[n]}),i):e}function ql(i,e){if(i===e)return!0;if(i==null||e===null||e===void 0||typeof i!=typeof e||typeof i!="object"||Array.isArray(i)!==Array.isArray(e))return!1;let t,n;if(Array.isArray(i)){if(i.length!==e.length)return!1;for(t=0;tfunction(){const r=Array.prototype.slice.call(arguments,0);return e(o,r)},n={};for(const o of i)n[o]=t(o);return n}globalThis&&globalThis.__awaiter;let CXe=typeof document!="undefined"&&document.location&&document.location.hash.indexOf("pseudo=true")>=0;function yXe(i,e){let t;return e.length===0?t=i:t=i.replace(/\{(\d+)\}/g,(n,o)=>{const r=o[0],s=e[r];let a=n;return typeof s=="string"?a=s:(typeof s=="number"||typeof s=="boolean"||s===void 0||s===null)&&(a=String(s)),a}),CXe&&(t="\uFF3B"+t.replace(/[aouei]/g,"$&$&")+"\uFF3D"),t}function C(i,e,...t){return yXe(e,t)}var D6;const EC="en";let MA=!1,AA=!1,XR=!1,g_e=!1,Pq=!1,Oq=!1,p_e=!1,JN,YR=EC,ooe=EC,wXe,rd;const Iu=typeof self=="object"?self:typeof global=="object"?global:{};let Ys;typeof Iu.vscode!="undefined"&&typeof Iu.vscode.process!="undefined"?Ys=Iu.vscode.process:typeof process!="undefined"&&(Ys=process);const SXe=typeof((D6=Ys==null?void 0:Ys.versions)===null||D6===void 0?void 0:D6.electron)=="string",xXe=SXe&&(Ys==null?void 0:Ys.type)==="renderer";if(typeof navigator=="object"&&!xXe)rd=navigator.userAgent,MA=rd.indexOf("Windows")>=0,AA=rd.indexOf("Macintosh")>=0,Oq=(rd.indexOf("Macintosh")>=0||rd.indexOf("iPad")>=0||rd.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,XR=rd.indexOf("Linux")>=0,p_e=(rd==null?void 0:rd.indexOf("Mobi"))>=0,Pq=!0,C({key:"ensureLoaderPluginIsLoaded",comment:["{Locked}"]},"_"),JN=EC,YR=JN,ooe=navigator.language;else if(typeof Ys=="object"){MA=Ys.platform==="win32",AA=Ys.platform==="darwin",XR=Ys.platform==="linux",XR&&!!Ys.env.SNAP&&Ys.env.SNAP_REVISION,Ys.env.CI||Ys.env.BUILD_ARTIFACTSTAGINGDIRECTORY,JN=EC,YR=EC;const i=Ys.env.VSCODE_NLS_CONFIG;if(i)try{const e=JSON.parse(i),t=e.availableLanguages["*"];JN=e.locale,ooe=e.osLocale,YR=t||EC,wXe=e._translationsConfigFile}catch{}g_e=!0}else console.error("Unable to resolve platform.");const ls=MA,Nn=AA,xs=XR,Fd=g_e,qv=Pq,LXe=Pq&&typeof Iu.importScripts=="function",Kd=Oq,EXe=p_e,ff=rd,DXe=YR,kXe=typeof Iu.postMessage=="function"&&!Iu.importScripts,m_e=(()=>{if(kXe){const i=[];Iu.addEventListener("message",t=>{if(t.data&&t.data.vscodeScheduleAsyncWork)for(let n=0,o=i.length;n{const n=++e;i.push({id:n,callback:t}),Iu.postMessage({vscodeScheduleAsyncWork:n},"*")}}return i=>setTimeout(i)})(),Vl=AA||Oq?2:MA?1:3;let roe=!0,soe=!1;function v_e(){if(!soe){soe=!0;const i=new Uint8Array(2);i[0]=1,i[1]=2,roe=new Uint16Array(i.buffer)[0]===(2<<8)+1}return roe}const __e=!!(ff&&ff.indexOf("Chrome")>=0),IXe=!!(ff&&ff.indexOf("Firefox")>=0),TXe=!!(!__e&&ff&&ff.indexOf("Safari")>=0),NXe=!!(ff&&ff.indexOf("Edg/")>=0);ff&&ff.indexOf("Android")>=0;const vs={tabSize:4,indentSize:4,insertSpaces:!0,detectIndentation:!0,trimAutoWhitespace:!0,largeFileOptimizations:!0,bracketPairColorizationOptions:{enabled:!0,independentColorPoolPerBracketType:!1}};var vn;(function(i){function e(_){return _&&typeof _=="object"&&typeof _[Symbol.iterator]=="function"}i.is=e;const t=Object.freeze([]);function n(){return t}i.empty=n;function*o(_){yield _}i.single=o;function r(_){return e(_)?_:o(_)}i.wrap=r;function s(_){return _||t}i.from=s;function*a(_){for(let y=_.length-1;y>=0;y--)yield _[y]}i.reverse=a;function l(_){return!_||_[Symbol.iterator]().next().done===!0}i.isEmpty=l;function c(_){return _[Symbol.iterator]().next().value}i.first=c;function u(_,y){for(const w of _)if(y(w))return!0;return!1}i.some=u;function d(_,y){for(const w of _)if(y(w))return w}i.find=d;function*h(_,y){for(const w of _)y(w)&&(yield w)}i.filter=h;function*f(_,y){let w=0;for(const L of _)yield y(L,w++)}i.map=f;function*g(..._){for(const y of _)for(const w of y)yield w}i.concat=g;function p(_,y,w){let L=w;for(const D of _)L=y(L,D);return L}i.reduce=p;function*v(_,y,w=_.length){for(y<0&&(y+=_.length),w<0?w+=_.length:w>_.length&&(w=_.length);y{o||(o=!0,this._remove(n))}}shift(){if(this._first!==Co.Undefined){const e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==Co.Undefined){const e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==Co.Undefined&&e.next!==Co.Undefined){const t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===Co.Undefined&&e.next===Co.Undefined?(this._first=Co.Undefined,this._last=Co.Undefined):e.next===Co.Undefined?(this._last=this._last.prev,this._last.next=Co.Undefined):e.prev===Co.Undefined&&(this._first=this._first.next,this._first.prev=Co.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==Co.Undefined;)yield e.element,e=e.next}}const b_e="`~!@#$%^&*()-=+[{]}\\|;:'\",.<>/?";function RXe(i=""){let e="(-?\\d*\\.\\d\\w*)|([^";for(const t of b_e)i.indexOf(t)>=0||(e+="\\"+t);return e+="\\s]+)",new RegExp(e,"g")}const Fq=RXe();function C_e(i){let e=Fq;if(i&&i instanceof RegExp)if(i.global)e=i;else{let t="g";i.ignoreCase&&(t+="i"),i.multiline&&(t+="m"),i.unicode&&(t+="u"),e=new RegExp(i.source,t)}return e.lastIndex=0,e}const y_e=new oa;y_e.unshift({maxLen:1e3,windowSize:15,timeBudget:150});function kD(i,e,t,n,o){if(o||(o=vn.first(y_e)),t.length>o.maxLen){let c=i-o.maxLen/2;return c<0?c=0:n+=c,t=t.substring(c,i+o.maxLen/2),kD(i,e,t,n,o)}const r=Date.now(),s=i-1-n;let a=-1,l=null;for(let c=1;!(Date.now()-r>=o.timeBudget);c++){const u=s-o.windowSize*c;e.lastIndex=Math.max(0,u);const d=MXe(e,t,s,a);if(!d&&l||(l=d,u<=0))break;a=u}if(l){const c={word:l[0],startColumn:n+1+l.index,endColumn:n+1+l.index+l[0].length};return e.lastIndex=0,c}return null}function MXe(i,e,t,n){let o;for(;o=i.exec(e);){const r=o.index||0;if(r<=t&&i.lastIndex>=t)return o;if(n>0&&r>n)return null}return null}const jp=8;class w_e{constructor(e){this._values=e}hasChanged(e){return this._values[e]}}class S_e{constructor(){this.stableMinimapLayoutInput=null,this.stableFitMaxMinimapScale=0,this.stableFitRemainingWidth=0}}class to{constructor(e,t,n,o){this.id=e,this.name=t,this.defaultValue=n,this.schema=o}applyUpdate(e,t){return V4(e,t)}compute(e,t,n){return n}}class aE{constructor(e,t){this.newValue=e,this.didChange=t}}function V4(i,e){if(typeof i!="object"||typeof e!="object"||!i||!e)return new aE(e,i!==e);if(Array.isArray(i)||Array.isArray(e)){const n=Array.isArray(i)&&Array.isArray(e)&&Lo(i,e);return new aE(e,!n)}let t=!1;for(const n in e)if(e.hasOwnProperty(n)){const o=V4(i[n],e[n]);o.didChange&&(i[n]=o.newValue,t=!0)}return new aE(i,t)}class OI{constructor(e){this.schema=void 0,this.id=e,this.name="_never_",this.defaultValue=void 0}applyUpdate(e,t){return V4(e,t)}validate(e){return this.defaultValue}}class gS{constructor(e,t,n,o){this.id=e,this.name=t,this.defaultValue=n,this.schema=o}applyUpdate(e,t){return V4(e,t)}validate(e){return typeof e=="undefined"?this.defaultValue:e}compute(e,t,n){return n}}function xt(i,e){return typeof i=="undefined"?e:i==="false"?!1:Boolean(i)}class On extends gS{constructor(e,t,n,o=void 0){typeof o!="undefined"&&(o.type="boolean",o.default=n),super(e,t,n,o)}validate(e){return xt(e,this.defaultValue)}}function N_(i,e,t,n){if(typeof i=="undefined")return e;let o=parseInt(i,10);return isNaN(o)?e:(o=Math.max(t,o),o=Math.min(n,o),o|0)}class wi extends gS{static clampedInt(e,t,n,o){return N_(e,t,n,o)}constructor(e,t,n,o,r,s=void 0){typeof s!="undefined"&&(s.type="integer",s.default=n,s.minimum=o,s.maximum=r),super(e,t,n,s),this.minimum=o,this.maximum=r}validate(e){return wi.clampedInt(e,this.defaultValue,this.minimum,this.maximum)}}function AXe(i,e,t,n){if(typeof i=="undefined")return e;const o=wu.float(i,e);return wu.clamp(o,t,n)}class wu extends gS{static clamp(e,t,n){return en?n:e}static float(e,t){if(typeof e=="number")return e;if(typeof e=="undefined")return t;const n=parseFloat(e);return isNaN(n)?t:n}constructor(e,t,n,o,r){typeof r!="undefined"&&(r.type="number",r.default=n),super(e,t,n,r),this.validationFn=o}validate(e){return this.validationFn(wu.float(e,this.defaultValue))}}class Qa extends gS{static string(e,t){return typeof e!="string"?t:e}constructor(e,t,n,o=void 0){typeof o!="undefined"&&(o.type="string",o.default=n),super(e,t,n,o)}validate(e){return Qa.string(e,this.defaultValue)}}function To(i,e,t,n){return typeof i!="string"?e:n&&i in n?n[i]:t.indexOf(i)===-1?e:i}class uo extends gS{constructor(e,t,n,o,r=void 0){typeof r!="undefined"&&(r.type="string",r.enum=o,r.default=n),super(e,t,n,r),this._allowedValues=o}validate(e){return To(e,this.defaultValue,this._allowedValues)}}class e2 extends to{constructor(e,t,n,o,r,s,a=void 0){typeof a!="undefined"&&(a.type="string",a.enum=r,a.default=o),super(e,t,n,a),this._allowedValues=r,this._convert=s}validate(e){return typeof e!="string"?this.defaultValue:this._allowedValues.indexOf(e)===-1?this.defaultValue:this._convert(e)}}function PXe(i){switch(i){case"none":return 0;case"keep":return 1;case"brackets":return 2;case"advanced":return 3;case"full":return 4}}class OXe extends to{constructor(){super(2,"accessibilitySupport",0,{type:"string",enum:["auto","on","off"],enumDescriptions:[C("accessibilitySupport.auto","Use platform APIs to detect when a Screen Reader is attached"),C("accessibilitySupport.on","Optimize for usage with a Screen Reader"),C("accessibilitySupport.off","Assume a screen reader is not attached")],default:"auto",tags:["accessibility"],description:C("accessibilitySupport","Controls if the UI should run in a mode where it is optimized for screen readers.")})}validate(e){switch(e){case"auto":return 0;case"off":return 1;case"on":return 2}return this.defaultValue}compute(e,t,n){return n===0?e.accessibilitySupport:n}}class FXe extends to{constructor(){const e={insertSpace:!0,ignoreEmptyLines:!0};super(23,"comments",e,{"editor.comments.insertSpace":{type:"boolean",default:e.insertSpace,description:C("comments.insertSpace","Controls whether a space character is inserted when commenting.")},"editor.comments.ignoreEmptyLines":{type:"boolean",default:e.ignoreEmptyLines,description:C("comments.ignoreEmptyLines","Controls if empty lines should be ignored with toggle, add or remove actions for line comments.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{insertSpace:xt(t.insertSpace,this.defaultValue.insertSpace),ignoreEmptyLines:xt(t.ignoreEmptyLines,this.defaultValue.ignoreEmptyLines)}}}function BXe(i){switch(i){case"blink":return 1;case"smooth":return 2;case"phase":return 3;case"expand":return 4;case"solid":return 5}}var Wr;(function(i){i[i.Line=1]="Line",i[i.Block=2]="Block",i[i.Underline=3]="Underline",i[i.LineThin=4]="LineThin",i[i.BlockOutline=5]="BlockOutline",i[i.UnderlineThin=6]="UnderlineThin"})(Wr||(Wr={}));function WXe(i){switch(i){case"line":return Wr.Line;case"block":return Wr.Block;case"underline":return Wr.Underline;case"line-thin":return Wr.LineThin;case"block-outline":return Wr.BlockOutline;case"underline-thin":return Wr.UnderlineThin}}class VXe extends OI{constructor(){super(140)}compute(e,t,n){const o=["monaco-editor"];return t.get(39)&&o.push(t.get(39)),e.extraEditorClassName&&o.push(e.extraEditorClassName),t.get(73)==="default"?o.push("mouse-default"):t.get(73)==="copy"&&o.push("mouse-copy"),t.get(110)&&o.push("showUnused"),t.get(138)&&o.push("showDeprecated"),o.join(" ")}}class HXe extends On{constructor(){super(37,"emptySelectionClipboard",!0,{description:C("emptySelectionClipboard","Controls whether copying without a selection copies the current line.")})}compute(e,t,n){return n&&e.emptySelectionClipboard}}class $Xe extends to{constructor(){const e={cursorMoveOnType:!0,seedSearchStringFromSelection:"always",autoFindInSelection:"never",globalFindClipboard:!1,addExtraSpaceOnTop:!0,loop:!0};super(41,"find",e,{"editor.find.cursorMoveOnType":{type:"boolean",default:e.cursorMoveOnType,description:C("find.cursorMoveOnType","Controls whether the cursor should jump to find matches while typing.")},"editor.find.seedSearchStringFromSelection":{type:"string",enum:["never","always","selection"],default:e.seedSearchStringFromSelection,enumDescriptions:[C("editor.find.seedSearchStringFromSelection.never","Never seed search string from the editor selection."),C("editor.find.seedSearchStringFromSelection.always","Always seed search string from the editor selection, including word at cursor position."),C("editor.find.seedSearchStringFromSelection.selection","Only seed search string from the editor selection.")],description:C("find.seedSearchStringFromSelection","Controls whether the search string in the Find Widget is seeded from the editor selection.")},"editor.find.autoFindInSelection":{type:"string",enum:["never","always","multiline"],default:e.autoFindInSelection,enumDescriptions:[C("editor.find.autoFindInSelection.never","Never turn on Find in Selection automatically (default)."),C("editor.find.autoFindInSelection.always","Always turn on Find in Selection automatically."),C("editor.find.autoFindInSelection.multiline","Turn on Find in Selection automatically when multiple lines of content are selected.")],description:C("find.autoFindInSelection","Controls the condition for turning on Find in Selection automatically.")},"editor.find.globalFindClipboard":{type:"boolean",default:e.globalFindClipboard,description:C("find.globalFindClipboard","Controls whether the Find Widget should read or modify the shared find clipboard on macOS."),included:Nn},"editor.find.addExtraSpaceOnTop":{type:"boolean",default:e.addExtraSpaceOnTop,description:C("find.addExtraSpaceOnTop","Controls whether the Find Widget should add extra lines on top of the editor. When true, you can scroll beyond the first line when the Find Widget is visible.")},"editor.find.loop":{type:"boolean",default:e.loop,description:C("find.loop","Controls whether the search automatically restarts from the beginning (or the end) when no further matches can be found.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{cursorMoveOnType:xt(t.cursorMoveOnType,this.defaultValue.cursorMoveOnType),seedSearchStringFromSelection:typeof e.seedSearchStringFromSelection=="boolean"?e.seedSearchStringFromSelection?"always":"never":To(t.seedSearchStringFromSelection,this.defaultValue.seedSearchStringFromSelection,["never","always","selection"]),autoFindInSelection:typeof e.autoFindInSelection=="boolean"?e.autoFindInSelection?"always":"never":To(t.autoFindInSelection,this.defaultValue.autoFindInSelection,["never","always","multiline"]),globalFindClipboard:xt(t.globalFindClipboard,this.defaultValue.globalFindClipboard),addExtraSpaceOnTop:xt(t.addExtraSpaceOnTop,this.defaultValue.addExtraSpaceOnTop),loop:xt(t.loop,this.defaultValue.loop)}}}class Pl extends to{constructor(){super(51,"fontLigatures",Pl.OFF,{anyOf:[{type:"boolean",description:C("fontLigatures","Enables/Disables font ligatures ('calt' and 'liga' font features). Change this to a string for fine-grained control of the 'font-feature-settings' CSS property.")},{type:"string",description:C("fontFeatureSettings","Explicit 'font-feature-settings' CSS property. A boolean can be passed instead if one only needs to turn on/off ligatures.")}],description:C("fontLigaturesGeneral","Configures font ligatures or font features. Can be either a boolean to enable/disable ligatures or a string for the value of the CSS 'font-feature-settings' property."),default:!1})}validate(e){return typeof e=="undefined"?this.defaultValue:typeof e=="string"?e==="false"?Pl.OFF:e==="true"?Pl.ON:e:Boolean(e)?Pl.ON:Pl.OFF}}Pl.OFF='"liga" off, "calt" off';Pl.ON='"liga" on, "calt" on';class Ed extends to{constructor(){super(54,"fontVariations",Ed.OFF,{anyOf:[{type:"boolean",description:C("fontVariations","Enables/Disables the translation from font-weight to font-variation-settings. Change this to a string for fine-grained control of the 'font-variation-settings' CSS property.")},{type:"string",description:C("fontVariationSettings","Explicit 'font-variation-settings' CSS property. A boolean can be passed instead if one only needs to translate font-weight to font-variation-settings.")}],description:C("fontVariationsGeneral","Configures font variations. Can be either a boolean to enable/disable the translation from font-weight to font-variation-settings or a string for the value of the CSS 'font-variation-settings' property."),default:!1})}validate(e){return typeof e=="undefined"?this.defaultValue:typeof e=="string"?e==="false"?Ed.OFF:e==="true"?Ed.TRANSLATE:e:Boolean(e)?Ed.TRANSLATE:Ed.OFF}compute(e,t,n){return e.fontInfo.fontVariationSettings}}Ed.OFF="normal";Ed.TRANSLATE="translate";class zXe extends OI{constructor(){super(50)}compute(e,t,n){return e.fontInfo}}class UXe extends gS{constructor(){super(52,"fontSize",al.fontSize,{type:"number",minimum:6,maximum:100,default:al.fontSize,description:C("fontSize","Controls the font size in pixels.")})}validate(e){const t=wu.float(e,this.defaultValue);return t===0?al.fontSize:wu.clamp(t,6,100)}compute(e,t,n){return e.fontInfo.fontSize}}class Rh extends to{constructor(){super(53,"fontWeight",al.fontWeight,{anyOf:[{type:"number",minimum:Rh.MINIMUM_VALUE,maximum:Rh.MAXIMUM_VALUE,errorMessage:C("fontWeightErrorMessage",'Only "normal" and "bold" keywords or numbers between 1 and 1000 are allowed.')},{type:"string",pattern:"^(normal|bold|1000|[1-9][0-9]{0,2})$"},{enum:Rh.SUGGESTION_VALUES}],default:al.fontWeight,description:C("fontWeight",'Controls the font weight. Accepts "normal" and "bold" keywords or numbers between 1 and 1000.')})}validate(e){return e==="normal"||e==="bold"?e:String(wi.clampedInt(e,al.fontWeight,Rh.MINIMUM_VALUE,Rh.MAXIMUM_VALUE))}}Rh.SUGGESTION_VALUES=["normal","bold","100","200","300","400","500","600","700","800","900"];Rh.MINIMUM_VALUE=1;Rh.MAXIMUM_VALUE=1e3;class jXe extends to{constructor(){const e={multiple:"peek",multipleDefinitions:"peek",multipleTypeDefinitions:"peek",multipleDeclarations:"peek",multipleImplementations:"peek",multipleReferences:"peek",alternativeDefinitionCommand:"editor.action.goToReferences",alternativeTypeDefinitionCommand:"editor.action.goToReferences",alternativeDeclarationCommand:"editor.action.goToReferences",alternativeImplementationCommand:"",alternativeReferenceCommand:""},t={type:"string",enum:["peek","gotoAndPeek","goto"],default:e.multiple,enumDescriptions:[C("editor.gotoLocation.multiple.peek","Show Peek view of the results (default)"),C("editor.gotoLocation.multiple.gotoAndPeek","Go to the primary result and show a Peek view"),C("editor.gotoLocation.multiple.goto","Go to the primary result and enable Peek-less navigation to others")]},n=["","editor.action.referenceSearch.trigger","editor.action.goToReferences","editor.action.peekImplementation","editor.action.goToImplementation","editor.action.peekTypeDefinition","editor.action.goToTypeDefinition","editor.action.peekDeclaration","editor.action.revealDeclaration","editor.action.peekDefinition","editor.action.revealDefinitionAside","editor.action.revealDefinition"];super(58,"gotoLocation",e,{"editor.gotoLocation.multiple":{deprecationMessage:C("editor.gotoLocation.multiple.deprecated","This setting is deprecated, please use separate settings like 'editor.editor.gotoLocation.multipleDefinitions' or 'editor.editor.gotoLocation.multipleImplementations' instead.")},"editor.gotoLocation.multipleDefinitions":Object.assign({description:C("editor.editor.gotoLocation.multipleDefinitions","Controls the behavior the 'Go to Definition'-command when multiple target locations exist.")},t),"editor.gotoLocation.multipleTypeDefinitions":Object.assign({description:C("editor.editor.gotoLocation.multipleTypeDefinitions","Controls the behavior the 'Go to Type Definition'-command when multiple target locations exist.")},t),"editor.gotoLocation.multipleDeclarations":Object.assign({description:C("editor.editor.gotoLocation.multipleDeclarations","Controls the behavior the 'Go to Declaration'-command when multiple target locations exist.")},t),"editor.gotoLocation.multipleImplementations":Object.assign({description:C("editor.editor.gotoLocation.multipleImplemenattions","Controls the behavior the 'Go to Implementations'-command when multiple target locations exist.")},t),"editor.gotoLocation.multipleReferences":Object.assign({description:C("editor.editor.gotoLocation.multipleReferences","Controls the behavior the 'Go to References'-command when multiple target locations exist.")},t),"editor.gotoLocation.alternativeDefinitionCommand":{type:"string",default:e.alternativeDefinitionCommand,enum:n,description:C("alternativeDefinitionCommand","Alternative command id that is being executed when the result of 'Go to Definition' is the current location.")},"editor.gotoLocation.alternativeTypeDefinitionCommand":{type:"string",default:e.alternativeTypeDefinitionCommand,enum:n,description:C("alternativeTypeDefinitionCommand","Alternative command id that is being executed when the result of 'Go to Type Definition' is the current location.")},"editor.gotoLocation.alternativeDeclarationCommand":{type:"string",default:e.alternativeDeclarationCommand,enum:n,description:C("alternativeDeclarationCommand","Alternative command id that is being executed when the result of 'Go to Declaration' is the current location.")},"editor.gotoLocation.alternativeImplementationCommand":{type:"string",default:e.alternativeImplementationCommand,enum:n,description:C("alternativeImplementationCommand","Alternative command id that is being executed when the result of 'Go to Implementation' is the current location.")},"editor.gotoLocation.alternativeReferenceCommand":{type:"string",default:e.alternativeReferenceCommand,enum:n,description:C("alternativeReferenceCommand","Alternative command id that is being executed when the result of 'Go to Reference' is the current location.")}})}validate(e){var t,n,o,r,s;if(!e||typeof e!="object")return this.defaultValue;const a=e;return{multiple:To(a.multiple,this.defaultValue.multiple,["peek","gotoAndPeek","goto"]),multipleDefinitions:(t=a.multipleDefinitions)!==null&&t!==void 0?t:To(a.multipleDefinitions,"peek",["peek","gotoAndPeek","goto"]),multipleTypeDefinitions:(n=a.multipleTypeDefinitions)!==null&&n!==void 0?n:To(a.multipleTypeDefinitions,"peek",["peek","gotoAndPeek","goto"]),multipleDeclarations:(o=a.multipleDeclarations)!==null&&o!==void 0?o:To(a.multipleDeclarations,"peek",["peek","gotoAndPeek","goto"]),multipleImplementations:(r=a.multipleImplementations)!==null&&r!==void 0?r:To(a.multipleImplementations,"peek",["peek","gotoAndPeek","goto"]),multipleReferences:(s=a.multipleReferences)!==null&&s!==void 0?s:To(a.multipleReferences,"peek",["peek","gotoAndPeek","goto"]),alternativeDefinitionCommand:Qa.string(a.alternativeDefinitionCommand,this.defaultValue.alternativeDefinitionCommand),alternativeTypeDefinitionCommand:Qa.string(a.alternativeTypeDefinitionCommand,this.defaultValue.alternativeTypeDefinitionCommand),alternativeDeclarationCommand:Qa.string(a.alternativeDeclarationCommand,this.defaultValue.alternativeDeclarationCommand),alternativeImplementationCommand:Qa.string(a.alternativeImplementationCommand,this.defaultValue.alternativeImplementationCommand),alternativeReferenceCommand:Qa.string(a.alternativeReferenceCommand,this.defaultValue.alternativeReferenceCommand)}}}class KXe extends to{constructor(){const e={enabled:!0,delay:300,hidingDelay:300,sticky:!0,above:!0};super(60,"hover",e,{"editor.hover.enabled":{type:"boolean",default:e.enabled,description:C("hover.enabled","Controls whether the hover is shown.")},"editor.hover.delay":{type:"number",default:e.delay,minimum:0,maximum:1e4,description:C("hover.delay","Controls the delay in milliseconds after which the hover is shown.")},"editor.hover.sticky":{type:"boolean",default:e.sticky,description:C("hover.sticky","Controls whether the hover should remain visible when mouse is moved over it.")},"editor.hover.hidingDelay":{type:"integer",minimum:0,default:e.hidingDelay,description:C("hover.hidingDelay","Controls the delay in milliseconds after thich the hover is hidden. Requires `editor.hover.sticky` to be enabled.")},"editor.hover.above":{type:"boolean",default:e.above,description:C("hover.above","Prefer showing hovers above the line, if there's space.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:xt(t.enabled,this.defaultValue.enabled),delay:wi.clampedInt(t.delay,this.defaultValue.delay,0,1e4),sticky:xt(t.sticky,this.defaultValue.sticky),hidingDelay:wi.clampedInt(t.hidingDelay,this.defaultValue.hidingDelay,0,6e5),above:xt(t.above,this.defaultValue.above)}}}class fy extends OI{constructor(){super(143)}compute(e,t,n){return fy.computeLayout(t,{memory:e.memory,outerWidth:e.outerWidth,outerHeight:e.outerHeight,isDominatedByLongLines:e.isDominatedByLongLines,lineHeight:e.fontInfo.lineHeight,viewLineCount:e.viewLineCount,lineNumbersDigitCount:e.lineNumbersDigitCount,typicalHalfwidthCharacterWidth:e.fontInfo.typicalHalfwidthCharacterWidth,maxDigitWidth:e.fontInfo.maxDigitWidth,pixelRatio:e.pixelRatio,glyphMarginDecorationLaneCount:e.glyphMarginDecorationLaneCount})}static computeContainedMinimapLineCount(e){const t=e.height/e.lineHeight,n=Math.floor(e.paddingTop/e.lineHeight);let o=Math.floor(e.paddingBottom/e.lineHeight);e.scrollBeyondLastLine&&(o=Math.max(o,t-1));const r=(n+e.viewLineCount+o)/(e.pixelRatio*e.height),s=Math.floor(e.viewLineCount/r);return{typicalViewportLineCount:t,extraLinesBeforeFirstLine:n,extraLinesBeyondLastLine:o,desiredRatio:r,minimapLineCount:s}}static _computeMinimapLayout(e,t){const n=e.outerWidth,o=e.outerHeight,r=e.pixelRatio;if(!e.minimap.enabled)return{renderMinimap:0,minimapLeft:0,minimapWidth:0,minimapHeightIsEditorHeight:!1,minimapIsSampling:!1,minimapScale:1,minimapLineHeight:1,minimapCanvasInnerWidth:0,minimapCanvasInnerHeight:Math.floor(r*o),minimapCanvasOuterWidth:0,minimapCanvasOuterHeight:o};const s=t.stableMinimapLayoutInput,a=s&&e.outerHeight===s.outerHeight&&e.lineHeight===s.lineHeight&&e.typicalHalfwidthCharacterWidth===s.typicalHalfwidthCharacterWidth&&e.pixelRatio===s.pixelRatio&&e.scrollBeyondLastLine===s.scrollBeyondLastLine&&e.paddingTop===s.paddingTop&&e.paddingBottom===s.paddingBottom&&e.minimap.enabled===s.minimap.enabled&&e.minimap.side===s.minimap.side&&e.minimap.size===s.minimap.size&&e.minimap.showSlider===s.minimap.showSlider&&e.minimap.renderCharacters===s.minimap.renderCharacters&&e.minimap.maxColumn===s.minimap.maxColumn&&e.minimap.scale===s.minimap.scale&&e.verticalScrollbarWidth===s.verticalScrollbarWidth&&e.isViewportWrapping===s.isViewportWrapping,l=e.lineHeight,c=e.typicalHalfwidthCharacterWidth,u=e.scrollBeyondLastLine,d=e.minimap.renderCharacters;let h=r>=2?Math.round(e.minimap.scale*2):e.minimap.scale;const f=e.minimap.maxColumn,g=e.minimap.size,p=e.minimap.side,v=e.verticalScrollbarWidth,m=e.viewLineCount,_=e.remainingWidth,y=e.isViewportWrapping,w=d?2:3;let L=Math.floor(r*o);const D=L/r;let E=!1,I=!1,k=w*h,R=h/r,A=1;if(g==="fill"||g==="fit"){const{typicalViewportLineCount:$,extraLinesBeforeFirstLine:z,extraLinesBeyondLastLine:K,desiredRatio:j,minimapLineCount:G}=fy.computeContainedMinimapLineCount({viewLineCount:m,scrollBeyondLastLine:u,paddingTop:e.paddingTop,paddingBottom:e.paddingBottom,height:o,lineHeight:l,pixelRatio:r});if(m/G>1)E=!0,I=!0,h=1,k=1,R=h/r;else{let de=!1,fe=h+1;if(g==="fit"){const pe=Math.ceil((z+m+K)*k);y&&a&&_<=t.stableFitRemainingWidth?(de=!0,fe=t.stableFitMaxMinimapScale):de=pe>L}if(g==="fill"||de){E=!0;const pe=h;k=Math.min(l*r,Math.max(1,Math.floor(1/j))),y&&a&&_<=t.stableFitRemainingWidth&&(fe=t.stableFitMaxMinimapScale),h=Math.min(fe,Math.max(1,Math.floor(k/w))),h>pe&&(A=Math.min(2,h/pe)),R=h/r/A,L=Math.ceil(Math.max($,z+m+K)*k),y?(t.stableMinimapLayoutInput=e,t.stableFitRemainingWidth=_,t.stableFitMaxMinimapScale=h):(t.stableMinimapLayoutInput=null,t.stableFitRemainingWidth=0)}}}const P=Math.floor(f*R),N=Math.min(P,Math.max(0,Math.floor((_-v-2)*R/(c+R)))+jp);let M=Math.floor(r*N);const H=M/r;M=Math.floor(M*A);const B=d?1:2,F=p==="left"?0:n-N-v;return{renderMinimap:B,minimapLeft:F,minimapWidth:N,minimapHeightIsEditorHeight:E,minimapIsSampling:I,minimapScale:h,minimapLineHeight:k,minimapCanvasInnerWidth:M,minimapCanvasInnerHeight:L,minimapCanvasOuterWidth:H,minimapCanvasOuterHeight:D}}static computeLayout(e,t){const n=t.outerWidth|0,o=t.outerHeight|0,r=t.lineHeight|0,s=t.lineNumbersDigitCount|0,a=t.typicalHalfwidthCharacterWidth,l=t.maxDigitWidth,c=t.pixelRatio,u=t.viewLineCount,d=e.get(135),h=d==="inherit"?e.get(134):d,f=h==="inherit"?e.get(130):h,g=e.get(133),p=t.isDominatedByLongLines,v=e.get(57),m=e.get(67).renderType!==0,_=e.get(68),y=e.get(104),w=e.get(83),L=e.get(72),D=e.get(102),E=D.verticalScrollbarSize,I=D.verticalHasArrows,k=D.arrowSize,R=D.horizontalScrollbarSize,A=e.get(43),P=e.get(109)!=="never";let N=e.get(65);A&&P&&(N+=16);let M=0;if(m){const Se=Math.max(s,_);M=Math.round(Se*l)}let H=0;v&&(H=r*t.glyphMarginDecorationLaneCount);let B=0,F=B+H,$=F+M,z=$+N;const K=n-H-M-N;let j=!1,G=!1,X=-1;h==="inherit"&&p?(j=!0,G=!0):f==="on"||f==="bounded"?G=!0:f==="wordWrapColumn"&&(X=g);const de=fy._computeMinimapLayout({outerWidth:n,outerHeight:o,lineHeight:r,typicalHalfwidthCharacterWidth:a,pixelRatio:c,scrollBeyondLastLine:y,paddingTop:w.top,paddingBottom:w.bottom,minimap:L,verticalScrollbarWidth:E,viewLineCount:u,remainingWidth:K,isViewportWrapping:G},t.memory||new S_e);de.renderMinimap!==0&&de.minimapLeft===0&&(B+=de.minimapWidth,F+=de.minimapWidth,$+=de.minimapWidth,z+=de.minimapWidth);const fe=K-de.minimapWidth,pe=Math.max(1,Math.floor((fe-E-2)/a)),be=I?k:0;return G&&(X=Math.max(1,pe),f==="bounded"&&(X=Math.min(X,g))),{width:n,height:o,glyphMarginLeft:B,glyphMarginWidth:H,glyphMarginDecorationLaneCount:t.glyphMarginDecorationLaneCount,lineNumbersLeft:F,lineNumbersWidth:M,decorationsLeft:$,decorationsWidth:N,contentLeft:z,contentWidth:fe,minimap:de,viewportColumn:pe,isWordWrapMinified:j,isViewportWrapping:G,wrappingColumn:X,verticalScrollbarWidth:E,horizontalScrollbarHeight:R,overviewRuler:{top:be,width:E,height:o-2*be,right:0}}}}class qXe extends to{constructor(){super(137,"wrappingStrategy","simple",{"editor.wrappingStrategy":{enumDescriptions:[C("wrappingStrategy.simple","Assumes that all characters are of the same width. This is a fast algorithm that works correctly for monospace fonts and certain scripts (like Latin characters) where glyphs are of equal width."),C("wrappingStrategy.advanced","Delegates wrapping points computation to the browser. This is a slow algorithm, that might cause freezes for large files, but it works correctly in all cases.")],type:"string",enum:["simple","advanced"],default:"simple",description:C("wrappingStrategy","Controls the algorithm that computes wrapping points. Note that when in accessibility mode, advanced will be used for the best experience.")}})}validate(e){return To(e,"simple",["simple","advanced"])}compute(e,t,n){return t.get(2)===2?"advanced":n}}class GXe extends to{constructor(){const e={enabled:!0};super(64,"lightbulb",e,{"editor.lightbulb.enabled":{type:"boolean",default:e.enabled,description:C("codeActions","Enables the Code Action lightbulb in the editor.")}})}validate(e){return!e||typeof e!="object"?this.defaultValue:{enabled:xt(e.enabled,this.defaultValue.enabled)}}}class XXe extends to{constructor(){const e={enabled:!1,maxLineCount:5,defaultModel:"outlineModel",scrollWithEditor:!0};super(114,"stickyScroll",e,{"editor.stickyScroll.enabled":{type:"boolean",default:e.enabled,description:C("editor.stickyScroll.enabled","Shows the nested current scopes during the scroll at the top of the editor.")},"editor.stickyScroll.maxLineCount":{type:"number",default:e.maxLineCount,minimum:1,maximum:10,description:C("editor.stickyScroll.maxLineCount","Defines the maximum number of sticky lines to show.")},"editor.stickyScroll.defaultModel":{type:"string",enum:["outlineModel","foldingProviderModel","indentationModel"],default:e.defaultModel,description:C("editor.stickyScroll.defaultModel","Defines the model to use for determining which lines to stick. If the outline model does not exist, it will fall back on the folding provider model which falls back on the indentation model. This order is respected in all three cases.")},"editor.stickyScroll.scrollWithEditor":{type:"boolean",default:e.scrollWithEditor,description:C("editor.stickyScroll.scrollWithEditor","Enable scrolling of the sticky scroll widget with the editor's horizontal scrollbar.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:xt(t.enabled,this.defaultValue.enabled),maxLineCount:wi.clampedInt(t.maxLineCount,this.defaultValue.maxLineCount,1,10),defaultModel:To(t.defaultModel,this.defaultValue.defaultModel,["outlineModel","foldingProviderModel","indentationModel"]),scrollWithEditor:xt(t.scrollWithEditor,this.defaultValue.scrollWithEditor)}}}class YXe extends to{constructor(){const e={enabled:"on",fontSize:0,fontFamily:"",padding:!1};super(139,"inlayHints",e,{"editor.inlayHints.enabled":{type:"string",default:e.enabled,description:C("inlayHints.enable","Enables the inlay hints in the editor."),enum:["on","onUnlessPressed","offUnlessPressed","off"],markdownEnumDescriptions:[C("editor.inlayHints.on","Inlay hints are enabled"),C("editor.inlayHints.onUnlessPressed","Inlay hints are showing by default and hide when holding {0}",Nn?"Ctrl+Option":"Ctrl+Alt"),C("editor.inlayHints.offUnlessPressed","Inlay hints are hidden by default and show when holding {0}",Nn?"Ctrl+Option":"Ctrl+Alt"),C("editor.inlayHints.off","Inlay hints are disabled")]},"editor.inlayHints.fontSize":{type:"number",default:e.fontSize,markdownDescription:C("inlayHints.fontSize","Controls font size of inlay hints in the editor. As default the {0} is used when the configured value is less than {1} or greater than the editor font size.","`#editor.fontSize#`","`5`")},"editor.inlayHints.fontFamily":{type:"string",default:e.fontFamily,markdownDescription:C("inlayHints.fontFamily","Controls font family of inlay hints in the editor. When set to empty, the {0} is used.","`#editor.fontFamily#`")},"editor.inlayHints.padding":{type:"boolean",default:e.padding,description:C("inlayHints.padding","Enables the padding around the inlay hints in the editor.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return typeof t.enabled=="boolean"&&(t.enabled=t.enabled?"on":"off"),{enabled:To(t.enabled,this.defaultValue.enabled,["on","off","offUnlessPressed","onUnlessPressed"]),fontSize:wi.clampedInt(t.fontSize,this.defaultValue.fontSize,0,100),fontFamily:Qa.string(t.fontFamily,this.defaultValue.fontFamily),padding:xt(t.padding,this.defaultValue.padding)}}}class ZXe extends to{constructor(){super(65,"lineDecorationsWidth",10)}validate(e){return typeof e=="string"&&/^\d+(\.\d+)?ch$/.test(e)?-parseFloat(e.substring(0,e.length-2)):wi.clampedInt(e,this.defaultValue,0,1e3)}compute(e,t,n){return n<0?wi.clampedInt(-n*e.fontInfo.typicalHalfwidthCharacterWidth,this.defaultValue,0,1e3):n}}class QXe extends wu{constructor(){super(66,"lineHeight",al.lineHeight,e=>wu.clamp(e,0,150),{markdownDescription:C("lineHeight",`Controls the line height. - Use 0 to automatically compute the line height from the font size. - Values between 0 and 8 will be used as a multiplier with the font size. - - Values greater than or equal to 8 will be used as effective values.`)})}compute(e,t,n){return e.fontInfo.lineHeight}}class qXe extends to{constructor(){const e={enabled:!0,size:"proportional",side:"right",showSlider:"mouseover",autohide:!1,renderCharacters:!0,maxColumn:120,scale:1};super(72,"minimap",e,{"editor.minimap.enabled":{type:"boolean",default:e.enabled,description:C("minimap.enabled","Controls whether the minimap is shown.")},"editor.minimap.autohide":{type:"boolean",default:e.autohide,description:C("minimap.autohide","Controls whether the minimap is hidden automatically.")},"editor.minimap.size":{type:"string",enum:["proportional","fill","fit"],enumDescriptions:[C("minimap.size.proportional","The minimap has the same size as the editor contents (and might scroll)."),C("minimap.size.fill","The minimap will stretch or shrink as necessary to fill the height of the editor (no scrolling)."),C("minimap.size.fit","The minimap will shrink as necessary to never be larger than the editor (no scrolling).")],default:e.size,description:C("minimap.size","Controls the size of the minimap.")},"editor.minimap.side":{type:"string",enum:["left","right"],default:e.side,description:C("minimap.side","Controls the side where to render the minimap.")},"editor.minimap.showSlider":{type:"string",enum:["always","mouseover"],default:e.showSlider,description:C("minimap.showSlider","Controls when the minimap slider is shown.")},"editor.minimap.scale":{type:"number",default:e.scale,minimum:1,maximum:3,enum:[1,2,3],description:C("minimap.scale","Scale of content drawn in the minimap: 1, 2 or 3.")},"editor.minimap.renderCharacters":{type:"boolean",default:e.renderCharacters,description:C("minimap.renderCharacters","Render the actual characters on a line as opposed to color blocks.")},"editor.minimap.maxColumn":{type:"number",default:e.maxColumn,description:C("minimap.maxColumn","Limit the width of the minimap to render at most a certain number of columns.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:St(t.enabled,this.defaultValue.enabled),autohide:St(t.autohide,this.defaultValue.autohide),size:To(t.size,this.defaultValue.size,["proportional","fill","fit"]),side:To(t.side,this.defaultValue.side,["right","left"]),showSlider:To(t.showSlider,this.defaultValue.showSlider,["always","mouseover"]),renderCharacters:St(t.renderCharacters,this.defaultValue.renderCharacters),scale:yi.clampedInt(t.scale,1,1,3),maxColumn:yi.clampedInt(t.maxColumn,this.defaultValue.maxColumn,1,1e4)}}}function GXe(i){return i==="ctrlCmd"?Nn?"metaKey":"ctrlKey":"altKey"}class XXe extends to{constructor(){super(83,"padding",{top:0,bottom:0},{"editor.padding.top":{type:"number",default:0,minimum:0,maximum:1e3,description:C("padding.top","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:C("padding.bottom","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:yi.clampedInt(t.top,0,0,1e3),bottom:yi.clampedInt(t.bottom,0,0,1e3)}}}class YXe extends to{constructor(){const e={enabled:!0,cycle:!0};super(85,"parameterHints",e,{"editor.parameterHints.enabled":{type:"boolean",default:e.enabled,description:C("parameterHints.enabled","Enables a pop-up that shows parameter documentation and type information as you type.")},"editor.parameterHints.cycle":{type:"boolean",default:e.cycle,description:C("parameterHints.cycle","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:St(t.enabled,this.defaultValue.enabled),cycle:St(t.cycle,this.defaultValue.cycle)}}}class ZXe extends AI{constructor(){super(141)}compute(e,t,n){return e.pixelRatio}}class QXe extends to{constructor(){const e={other:"on",comments:"off",strings:"off"},t=[{type:"boolean"},{type:"string",enum:["on","inline","off"],enumDescriptions:[C("on","Quick suggestions show inside the suggest widget"),C("inline","Quick suggestions show as ghost text"),C("off","Quick suggestions are disabled")]}];super(88,"quickSuggestions",e,{type:"object",additionalProperties:!1,properties:{strings:{anyOf:t,default:e.strings,description:C("quickSuggestions.strings","Enable quick suggestions inside strings.")},comments:{anyOf:t,default:e.comments,description:C("quickSuggestions.comments","Enable quick suggestions inside comments.")},other:{anyOf:t,default:e.other,description:C("quickSuggestions.other","Enable quick suggestions outside of strings and comments.")}},default:e,markdownDescription:C("quickSuggestions","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 c=e?"on":"off";return{comments:c,strings:c,other:c}}if(!e||typeof e!="object")return this.defaultValue;const{other:t,comments:n,strings:o}=e,r=["on","inline","off"];let s,a,l;return typeof t=="boolean"?s=t?"on":"off":s=To(t,this.defaultValue.other,r),typeof n=="boolean"?a=n?"on":"off":a=To(n,this.defaultValue.comments,r),typeof o=="boolean"?l=o?"on":"off":l=To(o,this.defaultValue.strings,r),{other:s,comments:a,strings:l}}}class JXe extends to{constructor(){super(67,"lineNumbers",{renderType:1,renderFn:null},{type:"string",enum:["off","on","relative","interval"],enumDescriptions:[C("lineNumbers.off","Line numbers are not rendered."),C("lineNumbers.on","Line numbers are rendered as absolute number."),C("lineNumbers.relative","Line numbers are rendered as distance in lines to cursor position."),C("lineNumbers.interval","Line numbers are rendered every 10 lines.")],default:"on",description:C("lineNumbers","Controls the display of line numbers.")})}validate(e){let t=this.defaultValue.renderType,n=this.defaultValue.renderFn;return typeof e!="undefined"&&(typeof e=="function"?(t=4,n=e):e==="interval"?t=3:e==="relative"?t=2:e==="on"?t=1:t=0),{renderType:t,renderFn:n}}}function RA(i){const e=i.get(97);return e==="editable"?i.get(90):e!=="on"}class eYe extends to{constructor(){const e=[],t={type:"number",description:C("rulers.size","Number of monospace characters at which this editor ruler will render.")};super(101,"rulers",e,{type:"array",items:{anyOf:[t,{type:["object"],properties:{column:t,color:{type:"string",description:C("rulers.color","Color of this editor ruler."),format:"color-hex"}}}]},default:e,description:C("rulers","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 n of e)if(typeof n=="number")t.push({column:yi.clampedInt(n,0,0,1e4),color:null});else if(n&&typeof n=="object"){const o=n;t.push({column:yi.clampedInt(o.column,0,0,1e4),color:o.color})}return t.sort((n,o)=>n.column-o.column),t}return this.defaultValue}}class tYe extends to{constructor(){super(91,"readOnlyMessage",void 0)}validate(e){return!e||typeof e!="object"?this.defaultValue:e}}function Jie(i,e){if(typeof i!="string")return e;switch(i){case"hidden":return 2;case"visible":return 3;default:return 1}}class nYe extends to{constructor(){const e={vertical:1,horizontal:1,arrowSize:11,useShadows:!0,verticalHasArrows:!1,horizontalHasArrows:!1,horizontalScrollbarSize:12,horizontalSliderSize:12,verticalScrollbarSize:14,verticalSliderSize:14,handleMouseWheel:!0,alwaysConsumeMouseWheel:!0,scrollByPage:!1};super(102,"scrollbar",e,{"editor.scrollbar.vertical":{type:"string",enum:["auto","visible","hidden"],enumDescriptions:[C("scrollbar.vertical.auto","The vertical scrollbar will be visible only when necessary."),C("scrollbar.vertical.visible","The vertical scrollbar will always be visible."),C("scrollbar.vertical.fit","The vertical scrollbar will always be hidden.")],default:"auto",description:C("scrollbar.vertical","Controls the visibility of the vertical scrollbar.")},"editor.scrollbar.horizontal":{type:"string",enum:["auto","visible","hidden"],enumDescriptions:[C("scrollbar.horizontal.auto","The horizontal scrollbar will be visible only when necessary."),C("scrollbar.horizontal.visible","The horizontal scrollbar will always be visible."),C("scrollbar.horizontal.fit","The horizontal scrollbar will always be hidden.")],default:"auto",description:C("scrollbar.horizontal","Controls the visibility of the horizontal scrollbar.")},"editor.scrollbar.verticalScrollbarSize":{type:"number",default:e.verticalScrollbarSize,description:C("scrollbar.verticalScrollbarSize","The width of the vertical scrollbar.")},"editor.scrollbar.horizontalScrollbarSize":{type:"number",default:e.horizontalScrollbarSize,description:C("scrollbar.horizontalScrollbarSize","The height of the horizontal scrollbar.")},"editor.scrollbar.scrollByPage":{type:"boolean",default:e.scrollByPage,description:C("scrollbar.scrollByPage","Controls whether clicks scroll by page or jump to click position.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e,n=yi.clampedInt(t.horizontalScrollbarSize,this.defaultValue.horizontalScrollbarSize,0,1e3),o=yi.clampedInt(t.verticalScrollbarSize,this.defaultValue.verticalScrollbarSize,0,1e3);return{arrowSize:yi.clampedInt(t.arrowSize,this.defaultValue.arrowSize,0,1e3),vertical:Jie(t.vertical,this.defaultValue.vertical),horizontal:Jie(t.horizontal,this.defaultValue.horizontal),useShadows:St(t.useShadows,this.defaultValue.useShadows),verticalHasArrows:St(t.verticalHasArrows,this.defaultValue.verticalHasArrows),horizontalHasArrows:St(t.horizontalHasArrows,this.defaultValue.horizontalHasArrows),handleMouseWheel:St(t.handleMouseWheel,this.defaultValue.handleMouseWheel),alwaysConsumeMouseWheel:St(t.alwaysConsumeMouseWheel,this.defaultValue.alwaysConsumeMouseWheel),horizontalScrollbarSize:n,horizontalSliderSize:yi.clampedInt(t.horizontalSliderSize,n,0,1e3),verticalScrollbarSize:o,verticalSliderSize:yi.clampedInt(t.verticalSliderSize,o,0,1e3),scrollByPage:St(t.scrollByPage,this.defaultValue.scrollByPage)}}}const Dl="inUntrustedWorkspace",Ia={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 iYe extends to{constructor(){const e={nonBasicASCII:Dl,invisibleCharacters:!0,ambiguousCharacters:!0,includeComments:Dl,includeStrings:!0,allowedCharacters:{},allowedLocales:{_os:!0,_vscode:!0}};super(124,"unicodeHighlight",e,{[Ia.nonBasicASCII]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,Dl],default:e.nonBasicASCII,description:C("unicodeHighlight.nonBasicASCII","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.")},[Ia.invisibleCharacters]:{restricted:!0,type:"boolean",default:e.invisibleCharacters,description:C("unicodeHighlight.invisibleCharacters","Controls whether characters that just reserve space or have no width at all are highlighted.")},[Ia.ambiguousCharacters]:{restricted:!0,type:"boolean",default:e.ambiguousCharacters,description:C("unicodeHighlight.ambiguousCharacters","Controls whether characters are highlighted that can be confused with basic ASCII characters, except those that are common in the current user locale.")},[Ia.includeComments]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,Dl],default:e.includeComments,description:C("unicodeHighlight.includeComments","Controls whether characters in comments should also be subject to Unicode highlighting.")},[Ia.includeStrings]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,Dl],default:e.includeStrings,description:C("unicodeHighlight.includeStrings","Controls whether characters in strings should also be subject to Unicode highlighting.")},[Ia.allowedCharacters]:{restricted:!0,type:"object",default:e.allowedCharacters,description:C("unicodeHighlight.allowedCharacters","Defines allowed characters that are not being highlighted."),additionalProperties:{type:"boolean"}},[Ia.allowedLocales]:{restricted:!0,type:"object",additionalProperties:{type:"boolean"},default:e.allowedLocales,description:C("unicodeHighlight.allowedLocales","Unicode characters that are common in allowed locales are not being highlighted.")}})}applyUpdate(e,t){let n=!1;t.allowedCharacters&&e&&(Kl(e.allowedCharacters,t.allowedCharacters)||(e=Object.assign(Object.assign({},e),{allowedCharacters:t.allowedCharacters}),n=!0)),t.allowedLocales&&e&&(Kl(e.allowedLocales,t.allowedLocales)||(e=Object.assign(Object.assign({},e),{allowedLocales:t.allowedLocales}),n=!0));const o=super.applyUpdate(e,t);return n?new sE(o.newValue,!0):o}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{nonBasicASCII:gw(t.nonBasicASCII,Dl,[!0,!1,Dl]),invisibleCharacters:St(t.invisibleCharacters,this.defaultValue.invisibleCharacters),ambiguousCharacters:St(t.ambiguousCharacters,this.defaultValue.ambiguousCharacters),includeComments:gw(t.includeComments,Dl,[!0,!1,Dl]),includeStrings:gw(t.includeStrings,Dl,[!0,!1,Dl]),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 n={};for(const[o,r]of Object.entries(e))r===!0&&(n[o]=!0);return n}}class oYe extends to{constructor(){const e={enabled:!0,mode:"subwordSmart",showToolbar:"onHover",suppressSuggestions:!1,keepOnBlur:!1};super(62,"inlineSuggest",e,{"editor.inlineSuggest.enabled":{type:"boolean",default:e.enabled,description:C("inlineSuggest.enabled","Controls whether to automatically show inline suggestions in the editor.")},"editor.inlineSuggest.showToolbar":{type:"string",default:e.showToolbar,enum:["always","onHover"],enumDescriptions:[C("inlineSuggest.showToolbar.always","Show the inline suggestion toolbar whenever an inline suggestion is shown."),C("inlineSuggest.showToolbar.onHover","Show the inline suggestion toolbar when hovering over an inline suggestion.")],description:C("inlineSuggest.showToolbar","Controls when to show the inline suggestion toolbar.")},"editor.inlineSuggest.suppressSuggestions":{type:"boolean",default:e.suppressSuggestions,description:C("inlineSuggest.suppressSuggestions","Controls how inline suggestions interact with the suggest widget. If enabled, the suggest widget is not shown automatically when inline suggestions are available.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:St(t.enabled,this.defaultValue.enabled),mode:To(t.mode,this.defaultValue.mode,["prefix","subword","subwordSmart"]),showToolbar:To(t.showToolbar,this.defaultValue.showToolbar,["always","onHover"]),suppressSuggestions:St(t.suppressSuggestions,this.defaultValue.suppressSuggestions),keepOnBlur:St(t.keepOnBlur,this.defaultValue.keepOnBlur)}}}class rYe extends to{constructor(){const e={enabled:ms.bracketPairColorizationOptions.enabled,independentColorPoolPerBracketType:ms.bracketPairColorizationOptions.independentColorPoolPerBracketType};super(15,"bracketPairColorization",e,{"editor.bracketPairColorization.enabled":{type:"boolean",default:e.enabled,markdownDescription:C("bracketPairColorization.enabled","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:C("bracketPairColorization.independentColorPoolPerBracketType","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:St(t.enabled,this.defaultValue.enabled),independentColorPoolPerBracketType:St(t.independentColorPoolPerBracketType,this.defaultValue.independentColorPoolPerBracketType)}}}class sYe extends to{constructor(){const e={bracketPairs:!1,bracketPairsHorizontal:"active",highlightActiveBracketPair:!0,indentation:!0,highlightActiveIndentation:!0};super(16,"guides",e,{"editor.guides.bracketPairs":{type:["boolean","string"],enum:[!0,"active",!1],enumDescriptions:[C("editor.guides.bracketPairs.true","Enables bracket pair guides."),C("editor.guides.bracketPairs.active","Enables bracket pair guides only for the active bracket pair."),C("editor.guides.bracketPairs.false","Disables bracket pair guides.")],default:e.bracketPairs,description:C("editor.guides.bracketPairs","Controls whether bracket pair guides are enabled or not.")},"editor.guides.bracketPairsHorizontal":{type:["boolean","string"],enum:[!0,"active",!1],enumDescriptions:[C("editor.guides.bracketPairsHorizontal.true","Enables horizontal guides as addition to vertical bracket pair guides."),C("editor.guides.bracketPairsHorizontal.active","Enables horizontal guides only for the active bracket pair."),C("editor.guides.bracketPairsHorizontal.false","Disables horizontal bracket pair guides.")],default:e.bracketPairsHorizontal,description:C("editor.guides.bracketPairsHorizontal","Controls whether horizontal bracket pair guides are enabled or not.")},"editor.guides.highlightActiveBracketPair":{type:"boolean",default:e.highlightActiveBracketPair,description:C("editor.guides.highlightActiveBracketPair","Controls whether the editor should highlight the active bracket pair.")},"editor.guides.indentation":{type:"boolean",default:e.indentation,description:C("editor.guides.indentation","Controls whether the editor should render indent guides.")},"editor.guides.highlightActiveIndentation":{type:["boolean","string"],enum:[!0,"always",!1],enumDescriptions:[C("editor.guides.highlightActiveIndentation.true","Highlights the active indent guide."),C("editor.guides.highlightActiveIndentation.always","Highlights the active indent guide even if bracket guides are highlighted."),C("editor.guides.highlightActiveIndentation.false","Do not highlight the active indent guide.")],default:e.highlightActiveIndentation,description:C("editor.guides.highlightActiveIndentation","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:gw(t.bracketPairs,this.defaultValue.bracketPairs,[!0,!1,"active"]),bracketPairsHorizontal:gw(t.bracketPairsHorizontal,this.defaultValue.bracketPairsHorizontal,[!0,!1,"active"]),highlightActiveBracketPair:St(t.highlightActiveBracketPair,this.defaultValue.highlightActiveBracketPair),indentation:St(t.indentation,this.defaultValue.indentation),highlightActiveIndentation:gw(t.highlightActiveIndentation,this.defaultValue.highlightActiveIndentation,[!0,!1,"always"])}}}function gw(i,e,t){const n=t.indexOf(i);return n===-1?e:t[n]}class aYe extends to{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(117,"suggest",e,{"editor.suggest.insertMode":{type:"string",enum:["insert","replace"],enumDescriptions:[C("suggest.insertMode.insert","Insert suggestion without overwriting text right of the cursor."),C("suggest.insertMode.replace","Insert suggestion and overwrite text right of the cursor.")],default:e.insertMode,description:C("suggest.insertMode","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:C("suggest.filterGraceful","Controls whether filtering and sorting suggestions accounts for small typos.")},"editor.suggest.localityBonus":{type:"boolean",default:e.localityBonus,description:C("suggest.localityBonus","Controls whether sorting favors words that appear close to the cursor.")},"editor.suggest.shareSuggestSelections":{type:"boolean",default:e.shareSuggestSelections,markdownDescription:C("suggest.shareSuggestSelections","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:[C("suggest.insertMode.always","Always select a suggestion when automatically triggering IntelliSense."),C("suggest.insertMode.never","Never select a suggestion when automatically triggering IntelliSense."),C("suggest.insertMode.whenTriggerCharacter","Select a suggestion only when triggering IntelliSense from a trigger character."),C("suggest.insertMode.whenQuickSuggestion","Select a suggestion only when triggering IntelliSense as you type.")],default:e.selectionMode,markdownDescription:C("suggest.selectionMode","Controls whether a suggestion is selected when the widget shows. Note that this only applies to automatically triggered suggestions (`#editor.quickSuggestions#` and `#editor.suggestOnTriggerCharacters#`) and that a suggestion is always selected when explicitly invoked, e.g via `Ctrl+Space`.")},"editor.suggest.snippetsPreventQuickSuggestions":{type:"boolean",default:e.snippetsPreventQuickSuggestions,description:C("suggest.snippetsPreventQuickSuggestions","Controls whether an active snippet prevents quick suggestions.")},"editor.suggest.showIcons":{type:"boolean",default:e.showIcons,description:C("suggest.showIcons","Controls whether to show or hide icons in suggestions.")},"editor.suggest.showStatusBar":{type:"boolean",default:e.showStatusBar,description:C("suggest.showStatusBar","Controls the visibility of the status bar at the bottom of the suggest widget.")},"editor.suggest.preview":{type:"boolean",default:e.preview,description:C("suggest.preview","Controls whether to preview the suggestion outcome in the editor.")},"editor.suggest.showInlineDetails":{type:"boolean",default:e.showInlineDetails,description:C("suggest.showInlineDetails","Controls whether suggest details show inline with the label or only in the details widget.")},"editor.suggest.maxVisibleSuggestions":{type:"number",deprecationMessage:C("suggest.maxVisibleSuggestions.dep","This setting is deprecated. The suggest widget can now be resized.")},"editor.suggest.filteredTypes":{type:"object",deprecationMessage:C("deprecated","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:C("editor.suggest.showMethods","When enabled IntelliSense shows `method`-suggestions.")},"editor.suggest.showFunctions":{type:"boolean",default:!0,markdownDescription:C("editor.suggest.showFunctions","When enabled IntelliSense shows `function`-suggestions.")},"editor.suggest.showConstructors":{type:"boolean",default:!0,markdownDescription:C("editor.suggest.showConstructors","When enabled IntelliSense shows `constructor`-suggestions.")},"editor.suggest.showDeprecated":{type:"boolean",default:!0,markdownDescription:C("editor.suggest.showDeprecated","When enabled IntelliSense shows `deprecated`-suggestions.")},"editor.suggest.matchOnWordStartOnly":{type:"boolean",default:!0,markdownDescription:C("editor.suggest.matchOnWordStartOnly","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:C("editor.suggest.showFields","When enabled IntelliSense shows `field`-suggestions.")},"editor.suggest.showVariables":{type:"boolean",default:!0,markdownDescription:C("editor.suggest.showVariables","When enabled IntelliSense shows `variable`-suggestions.")},"editor.suggest.showClasses":{type:"boolean",default:!0,markdownDescription:C("editor.suggest.showClasss","When enabled IntelliSense shows `class`-suggestions.")},"editor.suggest.showStructs":{type:"boolean",default:!0,markdownDescription:C("editor.suggest.showStructs","When enabled IntelliSense shows `struct`-suggestions.")},"editor.suggest.showInterfaces":{type:"boolean",default:!0,markdownDescription:C("editor.suggest.showInterfaces","When enabled IntelliSense shows `interface`-suggestions.")},"editor.suggest.showModules":{type:"boolean",default:!0,markdownDescription:C("editor.suggest.showModules","When enabled IntelliSense shows `module`-suggestions.")},"editor.suggest.showProperties":{type:"boolean",default:!0,markdownDescription:C("editor.suggest.showPropertys","When enabled IntelliSense shows `property`-suggestions.")},"editor.suggest.showEvents":{type:"boolean",default:!0,markdownDescription:C("editor.suggest.showEvents","When enabled IntelliSense shows `event`-suggestions.")},"editor.suggest.showOperators":{type:"boolean",default:!0,markdownDescription:C("editor.suggest.showOperators","When enabled IntelliSense shows `operator`-suggestions.")},"editor.suggest.showUnits":{type:"boolean",default:!0,markdownDescription:C("editor.suggest.showUnits","When enabled IntelliSense shows `unit`-suggestions.")},"editor.suggest.showValues":{type:"boolean",default:!0,markdownDescription:C("editor.suggest.showValues","When enabled IntelliSense shows `value`-suggestions.")},"editor.suggest.showConstants":{type:"boolean",default:!0,markdownDescription:C("editor.suggest.showConstants","When enabled IntelliSense shows `constant`-suggestions.")},"editor.suggest.showEnums":{type:"boolean",default:!0,markdownDescription:C("editor.suggest.showEnums","When enabled IntelliSense shows `enum`-suggestions.")},"editor.suggest.showEnumMembers":{type:"boolean",default:!0,markdownDescription:C("editor.suggest.showEnumMembers","When enabled IntelliSense shows `enumMember`-suggestions.")},"editor.suggest.showKeywords":{type:"boolean",default:!0,markdownDescription:C("editor.suggest.showKeywords","When enabled IntelliSense shows `keyword`-suggestions.")},"editor.suggest.showWords":{type:"boolean",default:!0,markdownDescription:C("editor.suggest.showTexts","When enabled IntelliSense shows `text`-suggestions.")},"editor.suggest.showColors":{type:"boolean",default:!0,markdownDescription:C("editor.suggest.showColors","When enabled IntelliSense shows `color`-suggestions.")},"editor.suggest.showFiles":{type:"boolean",default:!0,markdownDescription:C("editor.suggest.showFiles","When enabled IntelliSense shows `file`-suggestions.")},"editor.suggest.showReferences":{type:"boolean",default:!0,markdownDescription:C("editor.suggest.showReferences","When enabled IntelliSense shows `reference`-suggestions.")},"editor.suggest.showCustomcolors":{type:"boolean",default:!0,markdownDescription:C("editor.suggest.showCustomcolors","When enabled IntelliSense shows `customcolor`-suggestions.")},"editor.suggest.showFolders":{type:"boolean",default:!0,markdownDescription:C("editor.suggest.showFolders","When enabled IntelliSense shows `folder`-suggestions.")},"editor.suggest.showTypeParameters":{type:"boolean",default:!0,markdownDescription:C("editor.suggest.showTypeParameters","When enabled IntelliSense shows `typeParameter`-suggestions.")},"editor.suggest.showSnippets":{type:"boolean",default:!0,markdownDescription:C("editor.suggest.showSnippets","When enabled IntelliSense shows `snippet`-suggestions.")},"editor.suggest.showUsers":{type:"boolean",default:!0,markdownDescription:C("editor.suggest.showUsers","When enabled IntelliSense shows `user`-suggestions.")},"editor.suggest.showIssues":{type:"boolean",default:!0,markdownDescription:C("editor.suggest.showIssues","When enabled IntelliSense shows `issues`-suggestions.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{insertMode:To(t.insertMode,this.defaultValue.insertMode,["insert","replace"]),filterGraceful:St(t.filterGraceful,this.defaultValue.filterGraceful),snippetsPreventQuickSuggestions:St(t.snippetsPreventQuickSuggestions,this.defaultValue.filterGraceful),localityBonus:St(t.localityBonus,this.defaultValue.localityBonus),shareSuggestSelections:St(t.shareSuggestSelections,this.defaultValue.shareSuggestSelections),selectionMode:To(t.selectionMode,this.defaultValue.selectionMode,["always","never","whenQuickSuggestion","whenTriggerCharacter"]),showIcons:St(t.showIcons,this.defaultValue.showIcons),showStatusBar:St(t.showStatusBar,this.defaultValue.showStatusBar),preview:St(t.preview,this.defaultValue.preview),previewMode:To(t.previewMode,this.defaultValue.previewMode,["prefix","subword","subwordSmart"]),showInlineDetails:St(t.showInlineDetails,this.defaultValue.showInlineDetails),showMethods:St(t.showMethods,this.defaultValue.showMethods),showFunctions:St(t.showFunctions,this.defaultValue.showFunctions),showConstructors:St(t.showConstructors,this.defaultValue.showConstructors),showDeprecated:St(t.showDeprecated,this.defaultValue.showDeprecated),matchOnWordStartOnly:St(t.matchOnWordStartOnly,this.defaultValue.matchOnWordStartOnly),showFields:St(t.showFields,this.defaultValue.showFields),showVariables:St(t.showVariables,this.defaultValue.showVariables),showClasses:St(t.showClasses,this.defaultValue.showClasses),showStructs:St(t.showStructs,this.defaultValue.showStructs),showInterfaces:St(t.showInterfaces,this.defaultValue.showInterfaces),showModules:St(t.showModules,this.defaultValue.showModules),showProperties:St(t.showProperties,this.defaultValue.showProperties),showEvents:St(t.showEvents,this.defaultValue.showEvents),showOperators:St(t.showOperators,this.defaultValue.showOperators),showUnits:St(t.showUnits,this.defaultValue.showUnits),showValues:St(t.showValues,this.defaultValue.showValues),showConstants:St(t.showConstants,this.defaultValue.showConstants),showEnums:St(t.showEnums,this.defaultValue.showEnums),showEnumMembers:St(t.showEnumMembers,this.defaultValue.showEnumMembers),showKeywords:St(t.showKeywords,this.defaultValue.showKeywords),showWords:St(t.showWords,this.defaultValue.showWords),showColors:St(t.showColors,this.defaultValue.showColors),showFiles:St(t.showFiles,this.defaultValue.showFiles),showReferences:St(t.showReferences,this.defaultValue.showReferences),showFolders:St(t.showFolders,this.defaultValue.showFolders),showTypeParameters:St(t.showTypeParameters,this.defaultValue.showTypeParameters),showSnippets:St(t.showSnippets,this.defaultValue.showSnippets),showUsers:St(t.showUsers,this.defaultValue.showUsers),showIssues:St(t.showIssues,this.defaultValue.showIssues)}}}class lYe extends to{constructor(){super(112,"smartSelect",{selectLeadingAndTrailingWhitespace:!0,selectSubwords:!0},{"editor.smartSelect.selectLeadingAndTrailingWhitespace":{description:C("selectLeadingAndTrailingWhitespace","Whether leading and trailing whitespace should always be selected."),default:!0,type:"boolean"},"editor.smartSelect.selectSubwords":{description:C("selectSubwords","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:St(e.selectLeadingAndTrailingWhitespace,this.defaultValue.selectLeadingAndTrailingWhitespace),selectSubwords:St(e.selectSubwords,this.defaultValue.selectSubwords)}}}class cYe extends to{constructor(){super(136,"wrappingIndent",1,{"editor.wrappingIndent":{type:"string",enum:["none","same","indent","deepIndent"],enumDescriptions:[C("wrappingIndent.none","No indentation. Wrapped lines begin at column 1."),C("wrappingIndent.same","Wrapped lines get the same indentation as the parent."),C("wrappingIndent.indent","Wrapped lines get +1 indentation toward the parent."),C("wrappingIndent.deepIndent","Wrapped lines get +2 indentation toward the parent.")],description:C("wrappingIndent","Controls the indentation of wrapped lines."),default:"same"}})}validate(e){switch(e){case"none":return 0;case"same":return 1;case"indent":return 2;case"deepIndent":return 3}return 1}compute(e,t,n){return t.get(2)===2?0:n}}class uYe extends AI{constructor(){super(144)}compute(e,t,n){const o=t.get(143);return{isDominatedByLongLines:e.isDominatedByLongLines,isWordWrapMinified:o.isWordWrapMinified,isViewportWrapping:o.isViewportWrapping,wrappingColumn:o.wrappingColumn}}}class dYe extends to{constructor(){const e={enabled:!0,showDropSelector:"afterDrop"};super(36,"dropIntoEditor",e,{"editor.dropIntoEditor.enabled":{type:"boolean",default:e.enabled,markdownDescription:C("dropIntoEditor.enabled","Controls whether you can drag and drop a file into a text editor by holding down `shift` (instead of opening the file in an editor).")},"editor.dropIntoEditor.showDropSelector":{type:"string",markdownDescription:C("dropIntoEditor.showDropSelector","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:[C("dropIntoEditor.showDropSelector.afterDrop","Show the drop selector widget after a file is dropped into the editor."),C("dropIntoEditor.showDropSelector.never","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:St(t.enabled,this.defaultValue.enabled),showDropSelector:To(t.showDropSelector,this.defaultValue.showDropSelector,["afterDrop","never"])}}}class hYe extends to{constructor(){const e={enabled:!0,showPasteSelector:"afterPaste"};super(84,"pasteAs",e,{"editor.pasteAs.enabled":{type:"boolean",default:e.enabled,markdownDescription:C("pasteAs.enabled","Controls whether you can paste content in different ways.")},"editor.pasteAs.showPasteSelector":{type:"string",markdownDescription:C("pasteAs.showPasteSelector","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:[C("pasteAs.showPasteSelector.afterPaste","Show the paste selector widget after content is pasted into the editor."),C("pasteAs.showPasteSelector.never","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:St(t.enabled,this.defaultValue.enabled),showPasteSelector:To(t.showPasteSelector,this.defaultValue.showPasteSelector,["afterPaste","never"])}}}const fYe="Consolas, 'Courier New', monospace",gYe="Menlo, Monaco, 'Courier New', monospace",pYe="'Droid Sans Mono', 'monospace', monospace",sl={fontFamily:Nn?gYe:Ss?pYe:fYe,fontWeight:"normal",fontSize:Nn?12:14,lineHeight:0,letterSpacing:0},DC=[];function $e(i){return DC[i.id]=i,i}const ih={acceptSuggestionOnCommitCharacter:$e(new On(0,"acceptSuggestionOnCommitCharacter",!0,{markdownDescription:C("acceptSuggestionOnCommitCharacter","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:$e(new uo(1,"acceptSuggestionOnEnter","on",["on","smart","off"],{markdownEnumDescriptions:["",C("acceptSuggestionOnEnterSmart","Only accept a suggestion with `Enter` when it makes a textual change."),""],markdownDescription:C("acceptSuggestionOnEnter","Controls whether suggestions should be accepted on `Enter`, in addition to `Tab`. Helps to avoid ambiguity between inserting new lines or accepting suggestions.")})),accessibilitySupport:$e(new TXe),accessibilityPageSize:$e(new yi(3,"accessibilityPageSize",10,1,1073741824,{description:C("accessibilityPageSize","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:$e(new Qa(4,"ariaLabel",C("editorViewAccessibleLabel","Editor content"))),ariaRequired:$e(new On(5,"ariaRequired",!1,void 0)),screenReaderAnnounceInlineSuggestion:$e(new On(8,"screenReaderAnnounceInlineSuggestion",!0,{description:C("screenReaderAnnounceInlineSuggestion","Control whether inline suggestions are announced by a screen reader."),tags:["accessibility"]})),autoClosingBrackets:$e(new uo(6,"autoClosingBrackets","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",C("editor.autoClosingBrackets.languageDefined","Use language configurations to determine when to autoclose brackets."),C("editor.autoClosingBrackets.beforeWhitespace","Autoclose brackets only when the cursor is to the left of whitespace."),""],description:C("autoClosingBrackets","Controls whether the editor should automatically close brackets after the user adds an opening bracket.")})),autoClosingComments:$e(new uo(7,"autoClosingComments","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",C("editor.autoClosingComments.languageDefined","Use language configurations to determine when to autoclose comments."),C("editor.autoClosingComments.beforeWhitespace","Autoclose comments only when the cursor is to the left of whitespace."),""],description:C("autoClosingComments","Controls whether the editor should automatically close comments after the user adds an opening comment.")})),autoClosingDelete:$e(new uo(9,"autoClosingDelete","auto",["always","auto","never"],{enumDescriptions:["",C("editor.autoClosingDelete.auto","Remove adjacent closing quotes or brackets only if they were automatically inserted."),""],description:C("autoClosingDelete","Controls whether the editor should remove adjacent closing quotes or brackets when deleting.")})),autoClosingOvertype:$e(new uo(10,"autoClosingOvertype","auto",["always","auto","never"],{enumDescriptions:["",C("editor.autoClosingOvertype.auto","Type over closing quotes or brackets only if they were automatically inserted."),""],description:C("autoClosingOvertype","Controls whether the editor should type over closing quotes or brackets.")})),autoClosingQuotes:$e(new uo(11,"autoClosingQuotes","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",C("editor.autoClosingQuotes.languageDefined","Use language configurations to determine when to autoclose quotes."),C("editor.autoClosingQuotes.beforeWhitespace","Autoclose quotes only when the cursor is to the left of whitespace."),""],description:C("autoClosingQuotes","Controls whether the editor should automatically close quotes after the user adds an opening quote.")})),autoIndent:$e(new ZN(12,"autoIndent",4,"full",["none","keep","brackets","advanced","full"],IXe,{enumDescriptions:[C("editor.autoIndent.none","The editor will not insert indentation automatically."),C("editor.autoIndent.keep","The editor will keep the current line's indentation."),C("editor.autoIndent.brackets","The editor will keep the current line's indentation and honor language defined brackets."),C("editor.autoIndent.advanced","The editor will keep the current line's indentation, honor language defined brackets and invoke special onEnterRules defined by languages."),C("editor.autoIndent.full","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:C("autoIndent","Controls whether the editor should automatically adjust the indentation when users type, paste, move or indent lines.")})),automaticLayout:$e(new On(13,"automaticLayout",!1)),autoSurround:$e(new uo(14,"autoSurround","languageDefined",["languageDefined","quotes","brackets","never"],{enumDescriptions:[C("editor.autoSurround.languageDefined","Use language configurations to determine when to automatically surround selections."),C("editor.autoSurround.quotes","Surround with quotes but not brackets."),C("editor.autoSurround.brackets","Surround with brackets but not quotes."),""],description:C("autoSurround","Controls whether the editor should automatically surround selections when typing quotes or brackets.")})),bracketPairColorization:$e(new rYe),bracketPairGuides:$e(new sYe),stickyTabStops:$e(new On(115,"stickyTabStops",!1,{description:C("stickyTabStops","Emulate selection behavior of tab characters when using spaces for indentation. Selection will stick to tab stops.")})),codeLens:$e(new On(17,"codeLens",!0,{description:C("codeLens","Controls whether the editor shows CodeLens.")})),codeLensFontFamily:$e(new Qa(18,"codeLensFontFamily","",{description:C("codeLensFontFamily","Controls the font family for CodeLens.")})),codeLensFontSize:$e(new yi(19,"codeLensFontSize",0,0,100,{type:"number",default:0,minimum:0,maximum:100,markdownDescription:C("codeLensFontSize","Controls the font size in pixels for CodeLens. When set to 0, 90% of `#editor.fontSize#` is used.")})),colorDecorators:$e(new On(20,"colorDecorators",!0,{description:C("colorDecorators","Controls whether the editor should render the inline color decorators and color picker.")})),colorDecoratorActivatedOn:$e(new uo(146,"colorDecoratorsActivatedOn","clickAndHover",["clickAndHover","hover","click"],{enumDescriptions:[C("editor.colorDecoratorActivatedOn.clickAndHover","Make the color picker appear both on click and hover of the color decorator"),C("editor.colorDecoratorActivatedOn.hover","Make the color picker appear on hover of the color decorator"),C("editor.colorDecoratorActivatedOn.click","Make the color picker appear on click of the color decorator")],description:C("colorDecoratorActivatedOn","Controls the condition to make a color picker appear from a color decorator")})),colorDecoratorsLimit:$e(new yi(21,"colorDecoratorsLimit",500,1,1e6,{markdownDescription:C("colorDecoratorsLimit","Controls the max number of color decorators that can be rendered in an editor at once.")})),columnSelection:$e(new On(22,"columnSelection",!1,{description:C("columnSelection","Enable that the selection with the mouse and keys is doing column selection.")})),comments:$e(new NXe),contextmenu:$e(new On(24,"contextmenu",!0)),copyWithSyntaxHighlighting:$e(new On(25,"copyWithSyntaxHighlighting",!0,{description:C("copyWithSyntaxHighlighting","Controls whether syntax highlighting should be copied into the clipboard.")})),cursorBlinking:$e(new ZN(26,"cursorBlinking",1,"blink",["blink","smooth","phase","expand","solid"],RXe,{description:C("cursorBlinking","Control the cursor animation style.")})),cursorSmoothCaretAnimation:$e(new uo(27,"cursorSmoothCaretAnimation","off",["off","explicit","on"],{enumDescriptions:[C("cursorSmoothCaretAnimation.off","Smooth caret animation is disabled."),C("cursorSmoothCaretAnimation.explicit","Smooth caret animation is enabled only when the user moves the cursor with an explicit gesture."),C("cursorSmoothCaretAnimation.on","Smooth caret animation is always enabled.")],description:C("cursorSmoothCaretAnimation","Controls whether the smooth caret animation should be enabled.")})),cursorStyle:$e(new ZN(28,"cursorStyle",Wr.Line,"line",["line","block","underline","line-thin","block-outline","underline-thin"],MXe,{description:C("cursorStyle","Controls the cursor style.")})),cursorSurroundingLines:$e(new yi(29,"cursorSurroundingLines",0,0,1073741824,{description:C("cursorSurroundingLines","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:$e(new uo(30,"cursorSurroundingLinesStyle","default",["default","all"],{enumDescriptions:[C("cursorSurroundingLinesStyle.default","`cursorSurroundingLines` is enforced only when triggered via the keyboard or API."),C("cursorSurroundingLinesStyle.all","`cursorSurroundingLines` is enforced always.")],markdownDescription:C("cursorSurroundingLinesStyle","Controls when `#cursorSurroundingLines#` should be enforced.")})),cursorWidth:$e(new yi(31,"cursorWidth",0,0,1073741824,{markdownDescription:C("cursorWidth","Controls the width of the cursor when `#editor.cursorStyle#` is set to `line`.")})),disableLayerHinting:$e(new On(32,"disableLayerHinting",!1)),disableMonospaceOptimizations:$e(new On(33,"disableMonospaceOptimizations",!1)),domReadOnly:$e(new On(34,"domReadOnly",!1)),dragAndDrop:$e(new On(35,"dragAndDrop",!0,{description:C("dragAndDrop","Controls whether the editor should allow moving selections via drag and drop.")})),emptySelectionClipboard:$e(new PXe),dropIntoEditor:$e(new dYe),stickyScroll:$e(new zXe),experimentalWhitespaceRendering:$e(new uo(38,"experimentalWhitespaceRendering","svg",["svg","font","off"],{enumDescriptions:[C("experimentalWhitespaceRendering.svg","Use a new rendering method with svgs."),C("experimentalWhitespaceRendering.font","Use a new rendering method with font characters."),C("experimentalWhitespaceRendering.off","Use the stable rendering method.")],description:C("experimentalWhitespaceRendering","Controls whether whitespace is rendered with a new, experimental method.")})),extraEditorClassName:$e(new Qa(39,"extraEditorClassName","")),fastScrollSensitivity:$e(new wu(40,"fastScrollSensitivity",5,i=>i<=0?5:i,{markdownDescription:C("fastScrollSensitivity","Scrolling speed multiplier when pressing `Alt`.")})),find:$e(new OXe),fixedOverflowWidgets:$e(new On(42,"fixedOverflowWidgets",!1)),folding:$e(new On(43,"folding",!0,{description:C("folding","Controls whether the editor has code folding enabled.")})),foldingStrategy:$e(new uo(44,"foldingStrategy","auto",["auto","indentation"],{enumDescriptions:[C("foldingStrategy.auto","Use a language-specific folding strategy if available, else the indentation-based one."),C("foldingStrategy.indentation","Use the indentation-based folding strategy.")],description:C("foldingStrategy","Controls the strategy for computing folding ranges.")})),foldingHighlight:$e(new On(45,"foldingHighlight",!0,{description:C("foldingHighlight","Controls whether the editor should highlight folded ranges.")})),foldingImportsByDefault:$e(new On(46,"foldingImportsByDefault",!1,{description:C("foldingImportsByDefault","Controls whether the editor automatically collapses import ranges.")})),foldingMaximumRegions:$e(new yi(47,"foldingMaximumRegions",5e3,10,65e3,{description:C("foldingMaximumRegions","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:$e(new On(48,"unfoldOnClickAfterEndOfLine",!1,{description:C("unfoldOnClickAfterEndOfLine","Controls whether clicking on the empty content after a folded line will unfold the line.")})),fontFamily:$e(new Qa(49,"fontFamily",sl.fontFamily,{description:C("fontFamily","Controls the font family.")})),fontInfo:$e(new FXe),fontLigatures2:$e(new Al),fontSize:$e(new BXe),fontWeight:$e(new Th),fontVariations:$e(new Ed),formatOnPaste:$e(new On(55,"formatOnPaste",!1,{description:C("formatOnPaste","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:$e(new On(56,"formatOnType",!1,{description:C("formatOnType","Controls whether the editor should automatically format the line after typing.")})),glyphMargin:$e(new On(57,"glyphMargin",!0,{description:C("glyphMargin","Controls whether the editor should render the vertical glyph margin. Glyph margin is mostly used for debugging.")})),gotoLocation:$e(new WXe),hideCursorInOverviewRuler:$e(new On(59,"hideCursorInOverviewRuler",!1,{description:C("hideCursorInOverviewRuler","Controls whether the cursor should be hidden in the overview ruler.")})),hover:$e(new VXe),inDiffEditor:$e(new On(61,"inDiffEditor",!1)),letterSpacing:$e(new wu(63,"letterSpacing",sl.letterSpacing,i=>wu.clamp(i,-5,20),{description:C("letterSpacing","Controls the letter spacing in pixels.")})),lightbulb:$e(new $Xe),lineDecorationsWidth:$e(new jXe),lineHeight:$e(new KXe),lineNumbers:$e(new JXe),lineNumbersMinChars:$e(new yi(68,"lineNumbersMinChars",5,1,300)),linkedEditing:$e(new On(69,"linkedEditing",!1,{description:C("linkedEditing","Controls whether the editor has linked editing enabled. Depending on the language, related symbols such as HTML tags, are updated while editing.")})),links:$e(new On(70,"links",!0,{description:C("links","Controls whether the editor should detect links and make them clickable.")})),matchBrackets:$e(new uo(71,"matchBrackets","always",["always","near","never"],{description:C("matchBrackets","Highlight matching brackets.")})),minimap:$e(new qXe),mouseStyle:$e(new uo(73,"mouseStyle","text",["text","default","copy"])),mouseWheelScrollSensitivity:$e(new wu(74,"mouseWheelScrollSensitivity",1,i=>i===0?1:i,{markdownDescription:C("mouseWheelScrollSensitivity","A multiplier to be used on the `deltaX` and `deltaY` of mouse wheel scroll events.")})),mouseWheelZoom:$e(new On(75,"mouseWheelZoom",!1,{markdownDescription:C("mouseWheelZoom","Zoom the font of the editor when using mouse wheel and holding `Ctrl`.")})),multiCursorMergeOverlapping:$e(new On(76,"multiCursorMergeOverlapping",!0,{description:C("multiCursorMergeOverlapping","Merge multiple cursors when they are overlapping.")})),multiCursorModifier:$e(new ZN(77,"multiCursorModifier","altKey","alt",["ctrlCmd","alt"],GXe,{markdownEnumDescriptions:[C("multiCursorModifier.ctrlCmd","Maps to `Control` on Windows and Linux and to `Command` on macOS."),C("multiCursorModifier.alt","Maps to `Alt` on Windows and Linux and to `Option` on macOS.")],markdownDescription:C({key:"multiCursorModifier",comment:["- `ctrlCmd` refers to a value the setting can take and should not be localized.","- `Control` and `Command` refer to the modifier keys Ctrl or Cmd on the keyboard and can be localized."]},"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:$e(new uo(78,"multiCursorPaste","spread",["spread","full"],{markdownEnumDescriptions:[C("multiCursorPaste.spread","Each cursor pastes a single line of the text."),C("multiCursorPaste.full","Each cursor pastes the full text.")],markdownDescription:C("multiCursorPaste","Controls pasting when the line count of the pasted text matches the cursor count.")})),multiCursorLimit:$e(new yi(79,"multiCursorLimit",1e4,1,1e5,{markdownDescription:C("multiCursorLimit","Controls the max number of cursors that can be in an active editor at once.")})),occurrencesHighlight:$e(new On(80,"occurrencesHighlight",!0,{description:C("occurrencesHighlight","Controls whether the editor should highlight semantic symbol occurrences.")})),overviewRulerBorder:$e(new On(81,"overviewRulerBorder",!0,{description:C("overviewRulerBorder","Controls whether a border should be drawn around the overview ruler.")})),overviewRulerLanes:$e(new yi(82,"overviewRulerLanes",3,0,3)),padding:$e(new XXe),pasteAs:$e(new hYe),parameterHints:$e(new YXe),peekWidgetDefaultFocus:$e(new uo(86,"peekWidgetDefaultFocus","tree",["tree","editor"],{enumDescriptions:[C("peekWidgetDefaultFocus.tree","Focus the tree when opening peek"),C("peekWidgetDefaultFocus.editor","Focus the editor when opening peek")],description:C("peekWidgetDefaultFocus","Controls whether to focus the inline editor or the tree in the peek widget.")})),definitionLinkOpensInPeek:$e(new On(87,"definitionLinkOpensInPeek",!1,{description:C("definitionLinkOpensInPeek","Controls whether the Go to Definition mouse gesture always opens the peek widget.")})),quickSuggestions:$e(new QXe),quickSuggestionsDelay:$e(new yi(89,"quickSuggestionsDelay",10,0,1073741824,{description:C("quickSuggestionsDelay","Controls the delay in milliseconds after which quick suggestions will show up.")})),readOnly:$e(new On(90,"readOnly",!1)),readOnlyMessage:$e(new tYe),renameOnType:$e(new On(92,"renameOnType",!1,{description:C("renameOnType","Controls whether the editor auto renames on type."),markdownDeprecationMessage:C("renameOnTypeDeprecate","Deprecated, use `editor.linkedEditing` instead.")})),renderControlCharacters:$e(new On(93,"renderControlCharacters",!0,{description:C("renderControlCharacters","Controls whether the editor should render control characters."),restricted:!0})),renderFinalNewline:$e(new uo(94,"renderFinalNewline",Ss?"dimmed":"on",["off","on","dimmed"],{description:C("renderFinalNewline","Render last line number when the file ends with a newline.")})),renderLineHighlight:$e(new uo(95,"renderLineHighlight","line",["none","gutter","line","all"],{enumDescriptions:["","","",C("renderLineHighlight.all","Highlights both the gutter and the current line.")],description:C("renderLineHighlight","Controls how the editor should render the current line highlight.")})),renderLineHighlightOnlyWhenFocus:$e(new On(96,"renderLineHighlightOnlyWhenFocus",!1,{description:C("renderLineHighlightOnlyWhenFocus","Controls if the editor should render the current line highlight only when the editor is focused.")})),renderValidationDecorations:$e(new uo(97,"renderValidationDecorations","editable",["editable","on","off"])),renderWhitespace:$e(new uo(98,"renderWhitespace","selection",["none","boundary","selection","trailing","all"],{enumDescriptions:["",C("renderWhitespace.boundary","Render whitespace characters except for single spaces between words."),C("renderWhitespace.selection","Render whitespace characters only on selected text."),C("renderWhitespace.trailing","Render only trailing whitespace characters."),""],description:C("renderWhitespace","Controls how the editor should render whitespace characters.")})),revealHorizontalRightPadding:$e(new yi(99,"revealHorizontalRightPadding",15,0,1e3)),roundedSelection:$e(new On(100,"roundedSelection",!0,{description:C("roundedSelection","Controls whether selections should have rounded corners.")})),rulers:$e(new eYe),scrollbar:$e(new nYe),scrollBeyondLastColumn:$e(new yi(103,"scrollBeyondLastColumn",4,0,1073741824,{description:C("scrollBeyondLastColumn","Controls the number of extra characters beyond which the editor will scroll horizontally.")})),scrollBeyondLastLine:$e(new On(104,"scrollBeyondLastLine",!0,{description:C("scrollBeyondLastLine","Controls whether the editor will scroll beyond the last line.")})),scrollPredominantAxis:$e(new On(105,"scrollPredominantAxis",!0,{description:C("scrollPredominantAxis","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:$e(new On(106,"selectionClipboard",!0,{description:C("selectionClipboard","Controls whether the Linux primary clipboard should be supported."),included:Ss})),selectionHighlight:$e(new On(107,"selectionHighlight",!0,{description:C("selectionHighlight","Controls whether the editor should highlight matches similar to the selection.")})),selectOnLineNumbers:$e(new On(108,"selectOnLineNumbers",!0)),showFoldingControls:$e(new uo(109,"showFoldingControls","mouseover",["always","never","mouseover"],{enumDescriptions:[C("showFoldingControls.always","Always show the folding controls."),C("showFoldingControls.never","Never show the folding controls and reduce the gutter size."),C("showFoldingControls.mouseover","Only show the folding controls when the mouse is over the gutter.")],description:C("showFoldingControls","Controls when the folding controls on the gutter are shown.")})),showUnused:$e(new On(110,"showUnused",!0,{description:C("showUnused","Controls fading out of unused code.")})),showDeprecated:$e(new On(138,"showDeprecated",!0,{description:C("showDeprecated","Controls strikethrough deprecated variables.")})),inlayHints:$e(new UXe),snippetSuggestions:$e(new uo(111,"snippetSuggestions","inline",["top","bottom","inline","none"],{enumDescriptions:[C("snippetSuggestions.top","Show snippet suggestions on top of other suggestions."),C("snippetSuggestions.bottom","Show snippet suggestions below other suggestions."),C("snippetSuggestions.inline","Show snippets suggestions with other suggestions."),C("snippetSuggestions.none","Do not show snippet suggestions.")],description:C("snippetSuggestions","Controls whether snippets are shown with other suggestions and how they are sorted.")})),smartSelect:$e(new lYe),smoothScrolling:$e(new On(113,"smoothScrolling",!1,{description:C("smoothScrolling","Controls whether the editor will scroll using an animation.")})),stopRenderingLineAfter:$e(new yi(116,"stopRenderingLineAfter",1e4,-1,1073741824)),suggest:$e(new aYe),inlineSuggest:$e(new oYe),inlineCompletionsAccessibilityVerbose:$e(new On(147,"inlineCompletionsAccessibilityVerbose",!1,{description:C("inlineCompletionsAccessibilityVerbose","Controls whether the accessibility hint should be provided to screen reader users when an inline completion is shown.")})),suggestFontSize:$e(new yi(118,"suggestFontSize",0,0,1e3,{markdownDescription:C("suggestFontSize","Font size for the suggest widget. When set to {0}, the value of {1} is used.","`0`","`#editor.fontSize#`")})),suggestLineHeight:$e(new yi(119,"suggestLineHeight",0,0,1e3,{markdownDescription:C("suggestLineHeight","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:$e(new On(120,"suggestOnTriggerCharacters",!0,{description:C("suggestOnTriggerCharacters","Controls whether suggestions should automatically show up when typing trigger characters.")})),suggestSelection:$e(new uo(121,"suggestSelection","first",["first","recentlyUsed","recentlyUsedByPrefix"],{markdownEnumDescriptions:[C("suggestSelection.first","Always select the first suggestion."),C("suggestSelection.recentlyUsed","Select recent suggestions unless further typing selects one, e.g. `console.| -> console.log` because `log` has been completed recently."),C("suggestSelection.recentlyUsedByPrefix","Select suggestions based on previous prefixes that have completed those suggestions, e.g. `co -> console` and `con -> const`.")],description:C("suggestSelection","Controls how suggestions are pre-selected when showing the suggest list.")})),tabCompletion:$e(new uo(122,"tabCompletion","off",["on","off","onlySnippets"],{enumDescriptions:[C("tabCompletion.on","Tab complete will insert the best matching suggestion when pressing tab."),C("tabCompletion.off","Disable tab completions."),C("tabCompletion.onlySnippets","Tab complete snippets when their prefix match. Works best when 'quickSuggestions' aren't enabled.")],description:C("tabCompletion","Enables tab completions.")})),tabIndex:$e(new yi(123,"tabIndex",0,-1,1073741824)),unicodeHighlight:$e(new iYe),unusualLineTerminators:$e(new uo(125,"unusualLineTerminators","prompt",["auto","off","prompt"],{enumDescriptions:[C("unusualLineTerminators.auto","Unusual line terminators are automatically removed."),C("unusualLineTerminators.off","Unusual line terminators are ignored."),C("unusualLineTerminators.prompt","Unusual line terminators prompt to be removed.")],description:C("unusualLineTerminators","Remove unusual line terminators that might cause problems.")})),useShadowDOM:$e(new On(126,"useShadowDOM",!0)),useTabStops:$e(new On(127,"useTabStops",!0,{description:C("useTabStops","Inserting and deleting whitespace follows tab stops.")})),wordBreak:$e(new uo(128,"wordBreak","normal",["normal","keepAll"],{markdownEnumDescriptions:[C("wordBreak.normal","Use the default line break rule."),C("wordBreak.keepAll","Word breaks should not be used for Chinese/Japanese/Korean (CJK) text. Non-CJK text behavior is the same as for normal.")],description:C("wordBreak","Controls the word break rules used for Chinese/Japanese/Korean (CJK) text.")})),wordSeparators:$e(new Qa(129,"wordSeparators",d_e,{description:C("wordSeparators","Characters that will be used as word separators when doing word related navigations or operations.")})),wordWrap:$e(new uo(130,"wordWrap","off",["off","on","wordWrapColumn","bounded"],{markdownEnumDescriptions:[C("wordWrap.off","Lines will never wrap."),C("wordWrap.on","Lines will wrap at the viewport width."),C({key:"wordWrap.wordWrapColumn",comment:["- `editor.wordWrapColumn` refers to a different setting and should not be localized."]},"Lines will wrap at `#editor.wordWrapColumn#`."),C({key:"wordWrap.bounded",comment:["- viewport means the edge of the visible window size.","- `editor.wordWrapColumn` refers to a different setting and should not be localized."]},"Lines will wrap at the minimum of viewport and `#editor.wordWrapColumn#`.")],description:C({key:"wordWrap",comment:["- 'off', 'on', 'wordWrapColumn' and 'bounded' refer to values the setting can take and should not be localized.","- `editor.wordWrapColumn` refers to a different setting and should not be localized."]},"Controls how lines should wrap.")})),wordWrapBreakAfterCharacters:$e(new Qa(131,"wordWrapBreakAfterCharacters"," })]?|/&.,;\xA2\xB0\u2032\u2033\u2030\u2103\u3001\u3002\uFF61\uFF64\uFFE0\uFF0C\uFF0E\uFF1A\uFF1B\uFF1F\uFF01\uFF05\u30FB\uFF65\u309D\u309E\u30FD\u30FE\u30FC\u30A1\u30A3\u30A5\u30A7\u30A9\u30C3\u30E3\u30E5\u30E7\u30EE\u30F5\u30F6\u3041\u3043\u3045\u3047\u3049\u3063\u3083\u3085\u3087\u308E\u3095\u3096\u31F0\u31F1\u31F2\u31F3\u31F4\u31F5\u31F6\u31F7\u31F8\u31F9\u31FA\u31FB\u31FC\u31FD\u31FE\u31FF\u3005\u303B\uFF67\uFF68\uFF69\uFF6A\uFF6B\uFF6C\uFF6D\uFF6E\uFF6F\uFF70\u201D\u3009\u300B\u300D\u300F\u3011\u3015\uFF09\uFF3D\uFF5D\uFF63")),wordWrapBreakBeforeCharacters:$e(new Qa(132,"wordWrapBreakBeforeCharacters","([{\u2018\u201C\u3008\u300A\u300C\u300E\u3010\u3014\uFF08\uFF3B\uFF5B\uFF62\xA3\xA5\uFF04\uFFE1\uFFE5+\uFF0B")),wordWrapColumn:$e(new yi(133,"wordWrapColumn",80,1,1073741824,{markdownDescription:C({key:"wordWrapColumn",comment:["- `editor.wordWrap` refers to a different setting and should not be localized.","- 'wordWrapColumn' and 'bounded' refer to values the different setting can take and should not be localized."]},"Controls the wrapping column of the editor when `#editor.wordWrap#` is `wordWrapColumn` or `bounded`.")})),wordWrapOverride1:$e(new uo(134,"wordWrapOverride1","inherit",["off","on","inherit"])),wordWrapOverride2:$e(new uo(135,"wordWrapOverride2","inherit",["off","on","inherit"])),editorClassName:$e(new AXe),defaultColorDecorators:$e(new On(145,"defaultColorDecorators",!1,{markdownDescription:C("defaultColorDecorators","Controls whether inline color decorations should be shown using the default document color provider")})),pixelRatio:$e(new ZXe),tabFocusMode:$e(new On(142,"tabFocusMode",!1,{markdownDescription:C("tabFocusMode","Controls whether the editor receives tabs or defers them to the workbench for navigation.")})),layoutInfo:$e(new fw),wrappingInfo:$e(new uYe),wrappingIndent:$e(new cYe),wrappingStrategy:$e(new HXe)};class mYe{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?cy.isErrorNoTelemetry(e)?new cy(e.message+` + - Values greater than or equal to 8 will be used as effective values.`)})}compute(e,t,n){return e.fontInfo.lineHeight}}class JXe extends to{constructor(){const e={enabled:!0,size:"proportional",side:"right",showSlider:"mouseover",autohide:!1,renderCharacters:!0,maxColumn:120,scale:1};super(72,"minimap",e,{"editor.minimap.enabled":{type:"boolean",default:e.enabled,description:C("minimap.enabled","Controls whether the minimap is shown.")},"editor.minimap.autohide":{type:"boolean",default:e.autohide,description:C("minimap.autohide","Controls whether the minimap is hidden automatically.")},"editor.minimap.size":{type:"string",enum:["proportional","fill","fit"],enumDescriptions:[C("minimap.size.proportional","The minimap has the same size as the editor contents (and might scroll)."),C("minimap.size.fill","The minimap will stretch or shrink as necessary to fill the height of the editor (no scrolling)."),C("minimap.size.fit","The minimap will shrink as necessary to never be larger than the editor (no scrolling).")],default:e.size,description:C("minimap.size","Controls the size of the minimap.")},"editor.minimap.side":{type:"string",enum:["left","right"],default:e.side,description:C("minimap.side","Controls the side where to render the minimap.")},"editor.minimap.showSlider":{type:"string",enum:["always","mouseover"],default:e.showSlider,description:C("minimap.showSlider","Controls when the minimap slider is shown.")},"editor.minimap.scale":{type:"number",default:e.scale,minimum:1,maximum:3,enum:[1,2,3],description:C("minimap.scale","Scale of content drawn in the minimap: 1, 2 or 3.")},"editor.minimap.renderCharacters":{type:"boolean",default:e.renderCharacters,description:C("minimap.renderCharacters","Render the actual characters on a line as opposed to color blocks.")},"editor.minimap.maxColumn":{type:"number",default:e.maxColumn,description:C("minimap.maxColumn","Limit the width of the minimap to render at most a certain number of columns.")}})}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:To(t.size,this.defaultValue.size,["proportional","fill","fit"]),side:To(t.side,this.defaultValue.side,["right","left"]),showSlider:To(t.showSlider,this.defaultValue.showSlider,["always","mouseover"]),renderCharacters:xt(t.renderCharacters,this.defaultValue.renderCharacters),scale:wi.clampedInt(t.scale,1,1,3),maxColumn:wi.clampedInt(t.maxColumn,this.defaultValue.maxColumn,1,1e4)}}}function eYe(i){return i==="ctrlCmd"?Nn?"metaKey":"ctrlKey":"altKey"}class tYe extends to{constructor(){super(83,"padding",{top:0,bottom:0},{"editor.padding.top":{type:"number",default:0,minimum:0,maximum:1e3,description:C("padding.top","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:C("padding.bottom","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:wi.clampedInt(t.top,0,0,1e3),bottom:wi.clampedInt(t.bottom,0,0,1e3)}}}class nYe extends to{constructor(){const e={enabled:!0,cycle:!0};super(85,"parameterHints",e,{"editor.parameterHints.enabled":{type:"boolean",default:e.enabled,description:C("parameterHints.enabled","Enables a pop-up that shows parameter documentation and type information as you type.")},"editor.parameterHints.cycle":{type:"boolean",default:e.cycle,description:C("parameterHints.cycle","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 iYe extends OI{constructor(){super(141)}compute(e,t,n){return e.pixelRatio}}class oYe extends to{constructor(){const e={other:"on",comments:"off",strings:"off"},t=[{type:"boolean"},{type:"string",enum:["on","inline","off"],enumDescriptions:[C("on","Quick suggestions show inside the suggest widget"),C("inline","Quick suggestions show as ghost text"),C("off","Quick suggestions are disabled")]}];super(88,"quickSuggestions",e,{type:"object",additionalProperties:!1,properties:{strings:{anyOf:t,default:e.strings,description:C("quickSuggestions.strings","Enable quick suggestions inside strings.")},comments:{anyOf:t,default:e.comments,description:C("quickSuggestions.comments","Enable quick suggestions inside comments.")},other:{anyOf:t,default:e.other,description:C("quickSuggestions.other","Enable quick suggestions outside of strings and comments.")}},default:e,markdownDescription:C("quickSuggestions","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 c=e?"on":"off";return{comments:c,strings:c,other:c}}if(!e||typeof e!="object")return this.defaultValue;const{other:t,comments:n,strings:o}=e,r=["on","inline","off"];let s,a,l;return typeof t=="boolean"?s=t?"on":"off":s=To(t,this.defaultValue.other,r),typeof n=="boolean"?a=n?"on":"off":a=To(n,this.defaultValue.comments,r),typeof o=="boolean"?l=o?"on":"off":l=To(o,this.defaultValue.strings,r),{other:s,comments:a,strings:l}}}class rYe extends to{constructor(){super(67,"lineNumbers",{renderType:1,renderFn:null},{type:"string",enum:["off","on","relative","interval"],enumDescriptions:[C("lineNumbers.off","Line numbers are not rendered."),C("lineNumbers.on","Line numbers are rendered as absolute number."),C("lineNumbers.relative","Line numbers are rendered as distance in lines to cursor position."),C("lineNumbers.interval","Line numbers are rendered every 10 lines.")],default:"on",description:C("lineNumbers","Controls the display of line numbers.")})}validate(e){let t=this.defaultValue.renderType,n=this.defaultValue.renderFn;return typeof e!="undefined"&&(typeof e=="function"?(t=4,n=e):e==="interval"?t=3:e==="relative"?t=2:e==="on"?t=1:t=0),{renderType:t,renderFn:n}}}function PA(i){const e=i.get(97);return e==="editable"?i.get(90):e!=="on"}class sYe extends to{constructor(){const e=[],t={type:"number",description:C("rulers.size","Number of monospace characters at which this editor ruler will render.")};super(101,"rulers",e,{type:"array",items:{anyOf:[t,{type:["object"],properties:{column:t,color:{type:"string",description:C("rulers.color","Color of this editor ruler."),format:"color-hex"}}}]},default:e,description:C("rulers","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 n of e)if(typeof n=="number")t.push({column:wi.clampedInt(n,0,0,1e4),color:null});else if(n&&typeof n=="object"){const o=n;t.push({column:wi.clampedInt(o.column,0,0,1e4),color:o.color})}return t.sort((n,o)=>n.column-o.column),t}return this.defaultValue}}class aYe extends to{constructor(){super(91,"readOnlyMessage",void 0)}validate(e){return!e||typeof e!="object"?this.defaultValue:e}}function aoe(i,e){if(typeof i!="string")return e;switch(i){case"hidden":return 2;case"visible":return 3;default:return 1}}class lYe extends to{constructor(){const e={vertical:1,horizontal:1,arrowSize:11,useShadows:!0,verticalHasArrows:!1,horizontalHasArrows:!1,horizontalScrollbarSize:12,horizontalSliderSize:12,verticalScrollbarSize:14,verticalSliderSize:14,handleMouseWheel:!0,alwaysConsumeMouseWheel:!0,scrollByPage:!1};super(102,"scrollbar",e,{"editor.scrollbar.vertical":{type:"string",enum:["auto","visible","hidden"],enumDescriptions:[C("scrollbar.vertical.auto","The vertical scrollbar will be visible only when necessary."),C("scrollbar.vertical.visible","The vertical scrollbar will always be visible."),C("scrollbar.vertical.fit","The vertical scrollbar will always be hidden.")],default:"auto",description:C("scrollbar.vertical","Controls the visibility of the vertical scrollbar.")},"editor.scrollbar.horizontal":{type:"string",enum:["auto","visible","hidden"],enumDescriptions:[C("scrollbar.horizontal.auto","The horizontal scrollbar will be visible only when necessary."),C("scrollbar.horizontal.visible","The horizontal scrollbar will always be visible."),C("scrollbar.horizontal.fit","The horizontal scrollbar will always be hidden.")],default:"auto",description:C("scrollbar.horizontal","Controls the visibility of the horizontal scrollbar.")},"editor.scrollbar.verticalScrollbarSize":{type:"number",default:e.verticalScrollbarSize,description:C("scrollbar.verticalScrollbarSize","The width of the vertical scrollbar.")},"editor.scrollbar.horizontalScrollbarSize":{type:"number",default:e.horizontalScrollbarSize,description:C("scrollbar.horizontalScrollbarSize","The height of the horizontal scrollbar.")},"editor.scrollbar.scrollByPage":{type:"boolean",default:e.scrollByPage,description:C("scrollbar.scrollByPage","Controls whether clicks scroll by page or jump to click position.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e,n=wi.clampedInt(t.horizontalScrollbarSize,this.defaultValue.horizontalScrollbarSize,0,1e3),o=wi.clampedInt(t.verticalScrollbarSize,this.defaultValue.verticalScrollbarSize,0,1e3);return{arrowSize:wi.clampedInt(t.arrowSize,this.defaultValue.arrowSize,0,1e3),vertical:aoe(t.vertical,this.defaultValue.vertical),horizontal:aoe(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:n,horizontalSliderSize:wi.clampedInt(t.horizontalSliderSize,n,0,1e3),verticalScrollbarSize:o,verticalSliderSize:wi.clampedInt(t.verticalSliderSize,o,0,1e3),scrollByPage:xt(t.scrollByPage,this.defaultValue.scrollByPage)}}}const kl="inUntrustedWorkspace",Ta={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 cYe extends to{constructor(){const e={nonBasicASCII:kl,invisibleCharacters:!0,ambiguousCharacters:!0,includeComments:kl,includeStrings:!0,allowedCharacters:{},allowedLocales:{_os:!0,_vscode:!0}};super(124,"unicodeHighlight",e,{[Ta.nonBasicASCII]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,kl],default:e.nonBasicASCII,description:C("unicodeHighlight.nonBasicASCII","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.")},[Ta.invisibleCharacters]:{restricted:!0,type:"boolean",default:e.invisibleCharacters,description:C("unicodeHighlight.invisibleCharacters","Controls whether characters that just reserve space or have no width at all are highlighted.")},[Ta.ambiguousCharacters]:{restricted:!0,type:"boolean",default:e.ambiguousCharacters,description:C("unicodeHighlight.ambiguousCharacters","Controls whether characters are highlighted that can be confused with basic ASCII characters, except those that are common in the current user locale.")},[Ta.includeComments]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,kl],default:e.includeComments,description:C("unicodeHighlight.includeComments","Controls whether characters in comments should also be subject to Unicode highlighting.")},[Ta.includeStrings]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,kl],default:e.includeStrings,description:C("unicodeHighlight.includeStrings","Controls whether characters in strings should also be subject to Unicode highlighting.")},[Ta.allowedCharacters]:{restricted:!0,type:"object",default:e.allowedCharacters,description:C("unicodeHighlight.allowedCharacters","Defines allowed characters that are not being highlighted."),additionalProperties:{type:"boolean"}},[Ta.allowedLocales]:{restricted:!0,type:"object",additionalProperties:{type:"boolean"},default:e.allowedLocales,description:C("unicodeHighlight.allowedLocales","Unicode characters that are common in allowed locales are not being highlighted.")}})}applyUpdate(e,t){let n=!1;t.allowedCharacters&&e&&(ql(e.allowedCharacters,t.allowedCharacters)||(e=Object.assign(Object.assign({},e),{allowedCharacters:t.allowedCharacters}),n=!0)),t.allowedLocales&&e&&(ql(e.allowedLocales,t.allowedLocales)||(e=Object.assign(Object.assign({},e),{allowedLocales:t.allowedLocales}),n=!0));const o=super.applyUpdate(e,t);return n?new aE(o.newValue,!0):o}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{nonBasicASCII:gy(t.nonBasicASCII,kl,[!0,!1,kl]),invisibleCharacters:xt(t.invisibleCharacters,this.defaultValue.invisibleCharacters),ambiguousCharacters:xt(t.ambiguousCharacters,this.defaultValue.ambiguousCharacters),includeComments:gy(t.includeComments,kl,[!0,!1,kl]),includeStrings:gy(t.includeStrings,kl,[!0,!1,kl]),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 n={};for(const[o,r]of Object.entries(e))r===!0&&(n[o]=!0);return n}}class uYe extends to{constructor(){const e={enabled:!0,mode:"subwordSmart",showToolbar:"onHover",suppressSuggestions:!1,keepOnBlur:!1};super(62,"inlineSuggest",e,{"editor.inlineSuggest.enabled":{type:"boolean",default:e.enabled,description:C("inlineSuggest.enabled","Controls whether to automatically show inline suggestions in the editor.")},"editor.inlineSuggest.showToolbar":{type:"string",default:e.showToolbar,enum:["always","onHover"],enumDescriptions:[C("inlineSuggest.showToolbar.always","Show the inline suggestion toolbar whenever an inline suggestion is shown."),C("inlineSuggest.showToolbar.onHover","Show the inline suggestion toolbar when hovering over an inline suggestion.")],description:C("inlineSuggest.showToolbar","Controls when to show the inline suggestion toolbar.")},"editor.inlineSuggest.suppressSuggestions":{type:"boolean",default:e.suppressSuggestions,description:C("inlineSuggest.suppressSuggestions","Controls how inline suggestions interact with the suggest widget. If enabled, the suggest widget is not shown automatically when inline suggestions are available.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:xt(t.enabled,this.defaultValue.enabled),mode:To(t.mode,this.defaultValue.mode,["prefix","subword","subwordSmart"]),showToolbar:To(t.showToolbar,this.defaultValue.showToolbar,["always","onHover"]),suppressSuggestions:xt(t.suppressSuggestions,this.defaultValue.suppressSuggestions),keepOnBlur:xt(t.keepOnBlur,this.defaultValue.keepOnBlur)}}}class dYe extends to{constructor(){const e={enabled:vs.bracketPairColorizationOptions.enabled,independentColorPoolPerBracketType:vs.bracketPairColorizationOptions.independentColorPoolPerBracketType};super(15,"bracketPairColorization",e,{"editor.bracketPairColorization.enabled":{type:"boolean",default:e.enabled,markdownDescription:C("bracketPairColorization.enabled","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:C("bracketPairColorization.independentColorPoolPerBracketType","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 hYe extends to{constructor(){const e={bracketPairs:!1,bracketPairsHorizontal:"active",highlightActiveBracketPair:!0,indentation:!0,highlightActiveIndentation:!0};super(16,"guides",e,{"editor.guides.bracketPairs":{type:["boolean","string"],enum:[!0,"active",!1],enumDescriptions:[C("editor.guides.bracketPairs.true","Enables bracket pair guides."),C("editor.guides.bracketPairs.active","Enables bracket pair guides only for the active bracket pair."),C("editor.guides.bracketPairs.false","Disables bracket pair guides.")],default:e.bracketPairs,description:C("editor.guides.bracketPairs","Controls whether bracket pair guides are enabled or not.")},"editor.guides.bracketPairsHorizontal":{type:["boolean","string"],enum:[!0,"active",!1],enumDescriptions:[C("editor.guides.bracketPairsHorizontal.true","Enables horizontal guides as addition to vertical bracket pair guides."),C("editor.guides.bracketPairsHorizontal.active","Enables horizontal guides only for the active bracket pair."),C("editor.guides.bracketPairsHorizontal.false","Disables horizontal bracket pair guides.")],default:e.bracketPairsHorizontal,description:C("editor.guides.bracketPairsHorizontal","Controls whether horizontal bracket pair guides are enabled or not.")},"editor.guides.highlightActiveBracketPair":{type:"boolean",default:e.highlightActiveBracketPair,description:C("editor.guides.highlightActiveBracketPair","Controls whether the editor should highlight the active bracket pair.")},"editor.guides.indentation":{type:"boolean",default:e.indentation,description:C("editor.guides.indentation","Controls whether the editor should render indent guides.")},"editor.guides.highlightActiveIndentation":{type:["boolean","string"],enum:[!0,"always",!1],enumDescriptions:[C("editor.guides.highlightActiveIndentation.true","Highlights the active indent guide."),C("editor.guides.highlightActiveIndentation.always","Highlights the active indent guide even if bracket guides are highlighted."),C("editor.guides.highlightActiveIndentation.false","Do not highlight the active indent guide.")],default:e.highlightActiveIndentation,description:C("editor.guides.highlightActiveIndentation","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:gy(t.bracketPairs,this.defaultValue.bracketPairs,[!0,!1,"active"]),bracketPairsHorizontal:gy(t.bracketPairsHorizontal,this.defaultValue.bracketPairsHorizontal,[!0,!1,"active"]),highlightActiveBracketPair:xt(t.highlightActiveBracketPair,this.defaultValue.highlightActiveBracketPair),indentation:xt(t.indentation,this.defaultValue.indentation),highlightActiveIndentation:gy(t.highlightActiveIndentation,this.defaultValue.highlightActiveIndentation,[!0,!1,"always"])}}}function gy(i,e,t){const n=t.indexOf(i);return n===-1?e:t[n]}class fYe extends to{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(117,"suggest",e,{"editor.suggest.insertMode":{type:"string",enum:["insert","replace"],enumDescriptions:[C("suggest.insertMode.insert","Insert suggestion without overwriting text right of the cursor."),C("suggest.insertMode.replace","Insert suggestion and overwrite text right of the cursor.")],default:e.insertMode,description:C("suggest.insertMode","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:C("suggest.filterGraceful","Controls whether filtering and sorting suggestions accounts for small typos.")},"editor.suggest.localityBonus":{type:"boolean",default:e.localityBonus,description:C("suggest.localityBonus","Controls whether sorting favors words that appear close to the cursor.")},"editor.suggest.shareSuggestSelections":{type:"boolean",default:e.shareSuggestSelections,markdownDescription:C("suggest.shareSuggestSelections","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:[C("suggest.insertMode.always","Always select a suggestion when automatically triggering IntelliSense."),C("suggest.insertMode.never","Never select a suggestion when automatically triggering IntelliSense."),C("suggest.insertMode.whenTriggerCharacter","Select a suggestion only when triggering IntelliSense from a trigger character."),C("suggest.insertMode.whenQuickSuggestion","Select a suggestion only when triggering IntelliSense as you type.")],default:e.selectionMode,markdownDescription:C("suggest.selectionMode","Controls whether a suggestion is selected when the widget shows. Note that this only applies to automatically triggered suggestions (`#editor.quickSuggestions#` and `#editor.suggestOnTriggerCharacters#`) and that a suggestion is always selected when explicitly invoked, e.g via `Ctrl+Space`.")},"editor.suggest.snippetsPreventQuickSuggestions":{type:"boolean",default:e.snippetsPreventQuickSuggestions,description:C("suggest.snippetsPreventQuickSuggestions","Controls whether an active snippet prevents quick suggestions.")},"editor.suggest.showIcons":{type:"boolean",default:e.showIcons,description:C("suggest.showIcons","Controls whether to show or hide icons in suggestions.")},"editor.suggest.showStatusBar":{type:"boolean",default:e.showStatusBar,description:C("suggest.showStatusBar","Controls the visibility of the status bar at the bottom of the suggest widget.")},"editor.suggest.preview":{type:"boolean",default:e.preview,description:C("suggest.preview","Controls whether to preview the suggestion outcome in the editor.")},"editor.suggest.showInlineDetails":{type:"boolean",default:e.showInlineDetails,description:C("suggest.showInlineDetails","Controls whether suggest details show inline with the label or only in the details widget.")},"editor.suggest.maxVisibleSuggestions":{type:"number",deprecationMessage:C("suggest.maxVisibleSuggestions.dep","This setting is deprecated. The suggest widget can now be resized.")},"editor.suggest.filteredTypes":{type:"object",deprecationMessage:C("deprecated","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:C("editor.suggest.showMethods","When enabled IntelliSense shows `method`-suggestions.")},"editor.suggest.showFunctions":{type:"boolean",default:!0,markdownDescription:C("editor.suggest.showFunctions","When enabled IntelliSense shows `function`-suggestions.")},"editor.suggest.showConstructors":{type:"boolean",default:!0,markdownDescription:C("editor.suggest.showConstructors","When enabled IntelliSense shows `constructor`-suggestions.")},"editor.suggest.showDeprecated":{type:"boolean",default:!0,markdownDescription:C("editor.suggest.showDeprecated","When enabled IntelliSense shows `deprecated`-suggestions.")},"editor.suggest.matchOnWordStartOnly":{type:"boolean",default:!0,markdownDescription:C("editor.suggest.matchOnWordStartOnly","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:C("editor.suggest.showFields","When enabled IntelliSense shows `field`-suggestions.")},"editor.suggest.showVariables":{type:"boolean",default:!0,markdownDescription:C("editor.suggest.showVariables","When enabled IntelliSense shows `variable`-suggestions.")},"editor.suggest.showClasses":{type:"boolean",default:!0,markdownDescription:C("editor.suggest.showClasss","When enabled IntelliSense shows `class`-suggestions.")},"editor.suggest.showStructs":{type:"boolean",default:!0,markdownDescription:C("editor.suggest.showStructs","When enabled IntelliSense shows `struct`-suggestions.")},"editor.suggest.showInterfaces":{type:"boolean",default:!0,markdownDescription:C("editor.suggest.showInterfaces","When enabled IntelliSense shows `interface`-suggestions.")},"editor.suggest.showModules":{type:"boolean",default:!0,markdownDescription:C("editor.suggest.showModules","When enabled IntelliSense shows `module`-suggestions.")},"editor.suggest.showProperties":{type:"boolean",default:!0,markdownDescription:C("editor.suggest.showPropertys","When enabled IntelliSense shows `property`-suggestions.")},"editor.suggest.showEvents":{type:"boolean",default:!0,markdownDescription:C("editor.suggest.showEvents","When enabled IntelliSense shows `event`-suggestions.")},"editor.suggest.showOperators":{type:"boolean",default:!0,markdownDescription:C("editor.suggest.showOperators","When enabled IntelliSense shows `operator`-suggestions.")},"editor.suggest.showUnits":{type:"boolean",default:!0,markdownDescription:C("editor.suggest.showUnits","When enabled IntelliSense shows `unit`-suggestions.")},"editor.suggest.showValues":{type:"boolean",default:!0,markdownDescription:C("editor.suggest.showValues","When enabled IntelliSense shows `value`-suggestions.")},"editor.suggest.showConstants":{type:"boolean",default:!0,markdownDescription:C("editor.suggest.showConstants","When enabled IntelliSense shows `constant`-suggestions.")},"editor.suggest.showEnums":{type:"boolean",default:!0,markdownDescription:C("editor.suggest.showEnums","When enabled IntelliSense shows `enum`-suggestions.")},"editor.suggest.showEnumMembers":{type:"boolean",default:!0,markdownDescription:C("editor.suggest.showEnumMembers","When enabled IntelliSense shows `enumMember`-suggestions.")},"editor.suggest.showKeywords":{type:"boolean",default:!0,markdownDescription:C("editor.suggest.showKeywords","When enabled IntelliSense shows `keyword`-suggestions.")},"editor.suggest.showWords":{type:"boolean",default:!0,markdownDescription:C("editor.suggest.showTexts","When enabled IntelliSense shows `text`-suggestions.")},"editor.suggest.showColors":{type:"boolean",default:!0,markdownDescription:C("editor.suggest.showColors","When enabled IntelliSense shows `color`-suggestions.")},"editor.suggest.showFiles":{type:"boolean",default:!0,markdownDescription:C("editor.suggest.showFiles","When enabled IntelliSense shows `file`-suggestions.")},"editor.suggest.showReferences":{type:"boolean",default:!0,markdownDescription:C("editor.suggest.showReferences","When enabled IntelliSense shows `reference`-suggestions.")},"editor.suggest.showCustomcolors":{type:"boolean",default:!0,markdownDescription:C("editor.suggest.showCustomcolors","When enabled IntelliSense shows `customcolor`-suggestions.")},"editor.suggest.showFolders":{type:"boolean",default:!0,markdownDescription:C("editor.suggest.showFolders","When enabled IntelliSense shows `folder`-suggestions.")},"editor.suggest.showTypeParameters":{type:"boolean",default:!0,markdownDescription:C("editor.suggest.showTypeParameters","When enabled IntelliSense shows `typeParameter`-suggestions.")},"editor.suggest.showSnippets":{type:"boolean",default:!0,markdownDescription:C("editor.suggest.showSnippets","When enabled IntelliSense shows `snippet`-suggestions.")},"editor.suggest.showUsers":{type:"boolean",default:!0,markdownDescription:C("editor.suggest.showUsers","When enabled IntelliSense shows `user`-suggestions.")},"editor.suggest.showIssues":{type:"boolean",default:!0,markdownDescription:C("editor.suggest.showIssues","When enabled IntelliSense shows `issues`-suggestions.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{insertMode:To(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:To(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:To(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 gYe extends to{constructor(){super(112,"smartSelect",{selectLeadingAndTrailingWhitespace:!0,selectSubwords:!0},{"editor.smartSelect.selectLeadingAndTrailingWhitespace":{description:C("selectLeadingAndTrailingWhitespace","Whether leading and trailing whitespace should always be selected."),default:!0,type:"boolean"},"editor.smartSelect.selectSubwords":{description:C("selectSubwords","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 pYe extends to{constructor(){super(136,"wrappingIndent",1,{"editor.wrappingIndent":{type:"string",enum:["none","same","indent","deepIndent"],enumDescriptions:[C("wrappingIndent.none","No indentation. Wrapped lines begin at column 1."),C("wrappingIndent.same","Wrapped lines get the same indentation as the parent."),C("wrappingIndent.indent","Wrapped lines get +1 indentation toward the parent."),C("wrappingIndent.deepIndent","Wrapped lines get +2 indentation toward the parent.")],description:C("wrappingIndent","Controls the indentation of wrapped lines."),default:"same"}})}validate(e){switch(e){case"none":return 0;case"same":return 1;case"indent":return 2;case"deepIndent":return 3}return 1}compute(e,t,n){return t.get(2)===2?0:n}}class mYe extends OI{constructor(){super(144)}compute(e,t,n){const o=t.get(143);return{isDominatedByLongLines:e.isDominatedByLongLines,isWordWrapMinified:o.isWordWrapMinified,isViewportWrapping:o.isViewportWrapping,wrappingColumn:o.wrappingColumn}}}class vYe extends to{constructor(){const e={enabled:!0,showDropSelector:"afterDrop"};super(36,"dropIntoEditor",e,{"editor.dropIntoEditor.enabled":{type:"boolean",default:e.enabled,markdownDescription:C("dropIntoEditor.enabled","Controls whether you can drag and drop a file into a text editor by holding down `shift` (instead of opening the file in an editor).")},"editor.dropIntoEditor.showDropSelector":{type:"string",markdownDescription:C("dropIntoEditor.showDropSelector","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:[C("dropIntoEditor.showDropSelector.afterDrop","Show the drop selector widget after a file is dropped into the editor."),C("dropIntoEditor.showDropSelector.never","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:To(t.showDropSelector,this.defaultValue.showDropSelector,["afterDrop","never"])}}}class _Ye extends to{constructor(){const e={enabled:!0,showPasteSelector:"afterPaste"};super(84,"pasteAs",e,{"editor.pasteAs.enabled":{type:"boolean",default:e.enabled,markdownDescription:C("pasteAs.enabled","Controls whether you can paste content in different ways.")},"editor.pasteAs.showPasteSelector":{type:"string",markdownDescription:C("pasteAs.showPasteSelector","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:[C("pasteAs.showPasteSelector.afterPaste","Show the paste selector widget after content is pasted into the editor."),C("pasteAs.showPasteSelector.never","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:To(t.showPasteSelector,this.defaultValue.showPasteSelector,["afterPaste","never"])}}}const bYe="Consolas, 'Courier New', monospace",CYe="Menlo, Monaco, 'Courier New', monospace",yYe="'Droid Sans Mono', 'monospace', monospace",al={fontFamily:Nn?CYe:xs?yYe:bYe,fontWeight:"normal",fontSize:Nn?12:14,lineHeight:0,letterSpacing:0},DC=[];function $e(i){return DC[i.id]=i,i}const rh={acceptSuggestionOnCommitCharacter:$e(new On(0,"acceptSuggestionOnCommitCharacter",!0,{markdownDescription:C("acceptSuggestionOnCommitCharacter","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:$e(new uo(1,"acceptSuggestionOnEnter","on",["on","smart","off"],{markdownEnumDescriptions:["",C("acceptSuggestionOnEnterSmart","Only accept a suggestion with `Enter` when it makes a textual change."),""],markdownDescription:C("acceptSuggestionOnEnter","Controls whether suggestions should be accepted on `Enter`, in addition to `Tab`. Helps to avoid ambiguity between inserting new lines or accepting suggestions.")})),accessibilitySupport:$e(new OXe),accessibilityPageSize:$e(new wi(3,"accessibilityPageSize",10,1,1073741824,{description:C("accessibilityPageSize","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:$e(new Qa(4,"ariaLabel",C("editorViewAccessibleLabel","Editor content"))),ariaRequired:$e(new On(5,"ariaRequired",!1,void 0)),screenReaderAnnounceInlineSuggestion:$e(new On(8,"screenReaderAnnounceInlineSuggestion",!0,{description:C("screenReaderAnnounceInlineSuggestion","Control whether inline suggestions are announced by a screen reader."),tags:["accessibility"]})),autoClosingBrackets:$e(new uo(6,"autoClosingBrackets","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",C("editor.autoClosingBrackets.languageDefined","Use language configurations to determine when to autoclose brackets."),C("editor.autoClosingBrackets.beforeWhitespace","Autoclose brackets only when the cursor is to the left of whitespace."),""],description:C("autoClosingBrackets","Controls whether the editor should automatically close brackets after the user adds an opening bracket.")})),autoClosingComments:$e(new uo(7,"autoClosingComments","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",C("editor.autoClosingComments.languageDefined","Use language configurations to determine when to autoclose comments."),C("editor.autoClosingComments.beforeWhitespace","Autoclose comments only when the cursor is to the left of whitespace."),""],description:C("autoClosingComments","Controls whether the editor should automatically close comments after the user adds an opening comment.")})),autoClosingDelete:$e(new uo(9,"autoClosingDelete","auto",["always","auto","never"],{enumDescriptions:["",C("editor.autoClosingDelete.auto","Remove adjacent closing quotes or brackets only if they were automatically inserted."),""],description:C("autoClosingDelete","Controls whether the editor should remove adjacent closing quotes or brackets when deleting.")})),autoClosingOvertype:$e(new uo(10,"autoClosingOvertype","auto",["always","auto","never"],{enumDescriptions:["",C("editor.autoClosingOvertype.auto","Type over closing quotes or brackets only if they were automatically inserted."),""],description:C("autoClosingOvertype","Controls whether the editor should type over closing quotes or brackets.")})),autoClosingQuotes:$e(new uo(11,"autoClosingQuotes","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",C("editor.autoClosingQuotes.languageDefined","Use language configurations to determine when to autoclose quotes."),C("editor.autoClosingQuotes.beforeWhitespace","Autoclose quotes only when the cursor is to the left of whitespace."),""],description:C("autoClosingQuotes","Controls whether the editor should automatically close quotes after the user adds an opening quote.")})),autoIndent:$e(new e2(12,"autoIndent",4,"full",["none","keep","brackets","advanced","full"],PXe,{enumDescriptions:[C("editor.autoIndent.none","The editor will not insert indentation automatically."),C("editor.autoIndent.keep","The editor will keep the current line's indentation."),C("editor.autoIndent.brackets","The editor will keep the current line's indentation and honor language defined brackets."),C("editor.autoIndent.advanced","The editor will keep the current line's indentation, honor language defined brackets and invoke special onEnterRules defined by languages."),C("editor.autoIndent.full","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:C("autoIndent","Controls whether the editor should automatically adjust the indentation when users type, paste, move or indent lines.")})),automaticLayout:$e(new On(13,"automaticLayout",!1)),autoSurround:$e(new uo(14,"autoSurround","languageDefined",["languageDefined","quotes","brackets","never"],{enumDescriptions:[C("editor.autoSurround.languageDefined","Use language configurations to determine when to automatically surround selections."),C("editor.autoSurround.quotes","Surround with quotes but not brackets."),C("editor.autoSurround.brackets","Surround with brackets but not quotes."),""],description:C("autoSurround","Controls whether the editor should automatically surround selections when typing quotes or brackets.")})),bracketPairColorization:$e(new dYe),bracketPairGuides:$e(new hYe),stickyTabStops:$e(new On(115,"stickyTabStops",!1,{description:C("stickyTabStops","Emulate selection behavior of tab characters when using spaces for indentation. Selection will stick to tab stops.")})),codeLens:$e(new On(17,"codeLens",!0,{description:C("codeLens","Controls whether the editor shows CodeLens.")})),codeLensFontFamily:$e(new Qa(18,"codeLensFontFamily","",{description:C("codeLensFontFamily","Controls the font family for CodeLens.")})),codeLensFontSize:$e(new wi(19,"codeLensFontSize",0,0,100,{type:"number",default:0,minimum:0,maximum:100,markdownDescription:C("codeLensFontSize","Controls the font size in pixels for CodeLens. When set to 0, 90% of `#editor.fontSize#` is used.")})),colorDecorators:$e(new On(20,"colorDecorators",!0,{description:C("colorDecorators","Controls whether the editor should render the inline color decorators and color picker.")})),colorDecoratorActivatedOn:$e(new uo(146,"colorDecoratorsActivatedOn","clickAndHover",["clickAndHover","hover","click"],{enumDescriptions:[C("editor.colorDecoratorActivatedOn.clickAndHover","Make the color picker appear both on click and hover of the color decorator"),C("editor.colorDecoratorActivatedOn.hover","Make the color picker appear on hover of the color decorator"),C("editor.colorDecoratorActivatedOn.click","Make the color picker appear on click of the color decorator")],description:C("colorDecoratorActivatedOn","Controls the condition to make a color picker appear from a color decorator")})),colorDecoratorsLimit:$e(new wi(21,"colorDecoratorsLimit",500,1,1e6,{markdownDescription:C("colorDecoratorsLimit","Controls the max number of color decorators that can be rendered in an editor at once.")})),columnSelection:$e(new On(22,"columnSelection",!1,{description:C("columnSelection","Enable that the selection with the mouse and keys is doing column selection.")})),comments:$e(new FXe),contextmenu:$e(new On(24,"contextmenu",!0)),copyWithSyntaxHighlighting:$e(new On(25,"copyWithSyntaxHighlighting",!0,{description:C("copyWithSyntaxHighlighting","Controls whether syntax highlighting should be copied into the clipboard.")})),cursorBlinking:$e(new e2(26,"cursorBlinking",1,"blink",["blink","smooth","phase","expand","solid"],BXe,{description:C("cursorBlinking","Control the cursor animation style.")})),cursorSmoothCaretAnimation:$e(new uo(27,"cursorSmoothCaretAnimation","off",["off","explicit","on"],{enumDescriptions:[C("cursorSmoothCaretAnimation.off","Smooth caret animation is disabled."),C("cursorSmoothCaretAnimation.explicit","Smooth caret animation is enabled only when the user moves the cursor with an explicit gesture."),C("cursorSmoothCaretAnimation.on","Smooth caret animation is always enabled.")],description:C("cursorSmoothCaretAnimation","Controls whether the smooth caret animation should be enabled.")})),cursorStyle:$e(new e2(28,"cursorStyle",Wr.Line,"line",["line","block","underline","line-thin","block-outline","underline-thin"],WXe,{description:C("cursorStyle","Controls the cursor style.")})),cursorSurroundingLines:$e(new wi(29,"cursorSurroundingLines",0,0,1073741824,{description:C("cursorSurroundingLines","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:$e(new uo(30,"cursorSurroundingLinesStyle","default",["default","all"],{enumDescriptions:[C("cursorSurroundingLinesStyle.default","`cursorSurroundingLines` is enforced only when triggered via the keyboard or API."),C("cursorSurroundingLinesStyle.all","`cursorSurroundingLines` is enforced always.")],markdownDescription:C("cursorSurroundingLinesStyle","Controls when `#cursorSurroundingLines#` should be enforced.")})),cursorWidth:$e(new wi(31,"cursorWidth",0,0,1073741824,{markdownDescription:C("cursorWidth","Controls the width of the cursor when `#editor.cursorStyle#` is set to `line`.")})),disableLayerHinting:$e(new On(32,"disableLayerHinting",!1)),disableMonospaceOptimizations:$e(new On(33,"disableMonospaceOptimizations",!1)),domReadOnly:$e(new On(34,"domReadOnly",!1)),dragAndDrop:$e(new On(35,"dragAndDrop",!0,{description:C("dragAndDrop","Controls whether the editor should allow moving selections via drag and drop.")})),emptySelectionClipboard:$e(new HXe),dropIntoEditor:$e(new vYe),stickyScroll:$e(new XXe),experimentalWhitespaceRendering:$e(new uo(38,"experimentalWhitespaceRendering","svg",["svg","font","off"],{enumDescriptions:[C("experimentalWhitespaceRendering.svg","Use a new rendering method with svgs."),C("experimentalWhitespaceRendering.font","Use a new rendering method with font characters."),C("experimentalWhitespaceRendering.off","Use the stable rendering method.")],description:C("experimentalWhitespaceRendering","Controls whether whitespace is rendered with a new, experimental method.")})),extraEditorClassName:$e(new Qa(39,"extraEditorClassName","")),fastScrollSensitivity:$e(new wu(40,"fastScrollSensitivity",5,i=>i<=0?5:i,{markdownDescription:C("fastScrollSensitivity","Scrolling speed multiplier when pressing `Alt`.")})),find:$e(new $Xe),fixedOverflowWidgets:$e(new On(42,"fixedOverflowWidgets",!1)),folding:$e(new On(43,"folding",!0,{description:C("folding","Controls whether the editor has code folding enabled.")})),foldingStrategy:$e(new uo(44,"foldingStrategy","auto",["auto","indentation"],{enumDescriptions:[C("foldingStrategy.auto","Use a language-specific folding strategy if available, else the indentation-based one."),C("foldingStrategy.indentation","Use the indentation-based folding strategy.")],description:C("foldingStrategy","Controls the strategy for computing folding ranges.")})),foldingHighlight:$e(new On(45,"foldingHighlight",!0,{description:C("foldingHighlight","Controls whether the editor should highlight folded ranges.")})),foldingImportsByDefault:$e(new On(46,"foldingImportsByDefault",!1,{description:C("foldingImportsByDefault","Controls whether the editor automatically collapses import ranges.")})),foldingMaximumRegions:$e(new wi(47,"foldingMaximumRegions",5e3,10,65e3,{description:C("foldingMaximumRegions","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:$e(new On(48,"unfoldOnClickAfterEndOfLine",!1,{description:C("unfoldOnClickAfterEndOfLine","Controls whether clicking on the empty content after a folded line will unfold the line.")})),fontFamily:$e(new Qa(49,"fontFamily",al.fontFamily,{description:C("fontFamily","Controls the font family.")})),fontInfo:$e(new zXe),fontLigatures2:$e(new Pl),fontSize:$e(new UXe),fontWeight:$e(new Rh),fontVariations:$e(new Ed),formatOnPaste:$e(new On(55,"formatOnPaste",!1,{description:C("formatOnPaste","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:$e(new On(56,"formatOnType",!1,{description:C("formatOnType","Controls whether the editor should automatically format the line after typing.")})),glyphMargin:$e(new On(57,"glyphMargin",!0,{description:C("glyphMargin","Controls whether the editor should render the vertical glyph margin. Glyph margin is mostly used for debugging.")})),gotoLocation:$e(new jXe),hideCursorInOverviewRuler:$e(new On(59,"hideCursorInOverviewRuler",!1,{description:C("hideCursorInOverviewRuler","Controls whether the cursor should be hidden in the overview ruler.")})),hover:$e(new KXe),inDiffEditor:$e(new On(61,"inDiffEditor",!1)),letterSpacing:$e(new wu(63,"letterSpacing",al.letterSpacing,i=>wu.clamp(i,-5,20),{description:C("letterSpacing","Controls the letter spacing in pixels.")})),lightbulb:$e(new GXe),lineDecorationsWidth:$e(new ZXe),lineHeight:$e(new QXe),lineNumbers:$e(new rYe),lineNumbersMinChars:$e(new wi(68,"lineNumbersMinChars",5,1,300)),linkedEditing:$e(new On(69,"linkedEditing",!1,{description:C("linkedEditing","Controls whether the editor has linked editing enabled. Depending on the language, related symbols such as HTML tags, are updated while editing.")})),links:$e(new On(70,"links",!0,{description:C("links","Controls whether the editor should detect links and make them clickable.")})),matchBrackets:$e(new uo(71,"matchBrackets","always",["always","near","never"],{description:C("matchBrackets","Highlight matching brackets.")})),minimap:$e(new JXe),mouseStyle:$e(new uo(73,"mouseStyle","text",["text","default","copy"])),mouseWheelScrollSensitivity:$e(new wu(74,"mouseWheelScrollSensitivity",1,i=>i===0?1:i,{markdownDescription:C("mouseWheelScrollSensitivity","A multiplier to be used on the `deltaX` and `deltaY` of mouse wheel scroll events.")})),mouseWheelZoom:$e(new On(75,"mouseWheelZoom",!1,{markdownDescription:C("mouseWheelZoom","Zoom the font of the editor when using mouse wheel and holding `Ctrl`.")})),multiCursorMergeOverlapping:$e(new On(76,"multiCursorMergeOverlapping",!0,{description:C("multiCursorMergeOverlapping","Merge multiple cursors when they are overlapping.")})),multiCursorModifier:$e(new e2(77,"multiCursorModifier","altKey","alt",["ctrlCmd","alt"],eYe,{markdownEnumDescriptions:[C("multiCursorModifier.ctrlCmd","Maps to `Control` on Windows and Linux and to `Command` on macOS."),C("multiCursorModifier.alt","Maps to `Alt` on Windows and Linux and to `Option` on macOS.")],markdownDescription:C({key:"multiCursorModifier",comment:["- `ctrlCmd` refers to a value the setting can take and should not be localized.","- `Control` and `Command` refer to the modifier keys Ctrl or Cmd on the keyboard and can be localized."]},"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:$e(new uo(78,"multiCursorPaste","spread",["spread","full"],{markdownEnumDescriptions:[C("multiCursorPaste.spread","Each cursor pastes a single line of the text."),C("multiCursorPaste.full","Each cursor pastes the full text.")],markdownDescription:C("multiCursorPaste","Controls pasting when the line count of the pasted text matches the cursor count.")})),multiCursorLimit:$e(new wi(79,"multiCursorLimit",1e4,1,1e5,{markdownDescription:C("multiCursorLimit","Controls the max number of cursors that can be in an active editor at once.")})),occurrencesHighlight:$e(new On(80,"occurrencesHighlight",!0,{description:C("occurrencesHighlight","Controls whether the editor should highlight semantic symbol occurrences.")})),overviewRulerBorder:$e(new On(81,"overviewRulerBorder",!0,{description:C("overviewRulerBorder","Controls whether a border should be drawn around the overview ruler.")})),overviewRulerLanes:$e(new wi(82,"overviewRulerLanes",3,0,3)),padding:$e(new tYe),pasteAs:$e(new _Ye),parameterHints:$e(new nYe),peekWidgetDefaultFocus:$e(new uo(86,"peekWidgetDefaultFocus","tree",["tree","editor"],{enumDescriptions:[C("peekWidgetDefaultFocus.tree","Focus the tree when opening peek"),C("peekWidgetDefaultFocus.editor","Focus the editor when opening peek")],description:C("peekWidgetDefaultFocus","Controls whether to focus the inline editor or the tree in the peek widget.")})),definitionLinkOpensInPeek:$e(new On(87,"definitionLinkOpensInPeek",!1,{description:C("definitionLinkOpensInPeek","Controls whether the Go to Definition mouse gesture always opens the peek widget.")})),quickSuggestions:$e(new oYe),quickSuggestionsDelay:$e(new wi(89,"quickSuggestionsDelay",10,0,1073741824,{description:C("quickSuggestionsDelay","Controls the delay in milliseconds after which quick suggestions will show up.")})),readOnly:$e(new On(90,"readOnly",!1)),readOnlyMessage:$e(new aYe),renameOnType:$e(new On(92,"renameOnType",!1,{description:C("renameOnType","Controls whether the editor auto renames on type."),markdownDeprecationMessage:C("renameOnTypeDeprecate","Deprecated, use `editor.linkedEditing` instead.")})),renderControlCharacters:$e(new On(93,"renderControlCharacters",!0,{description:C("renderControlCharacters","Controls whether the editor should render control characters."),restricted:!0})),renderFinalNewline:$e(new uo(94,"renderFinalNewline",xs?"dimmed":"on",["off","on","dimmed"],{description:C("renderFinalNewline","Render last line number when the file ends with a newline.")})),renderLineHighlight:$e(new uo(95,"renderLineHighlight","line",["none","gutter","line","all"],{enumDescriptions:["","","",C("renderLineHighlight.all","Highlights both the gutter and the current line.")],description:C("renderLineHighlight","Controls how the editor should render the current line highlight.")})),renderLineHighlightOnlyWhenFocus:$e(new On(96,"renderLineHighlightOnlyWhenFocus",!1,{description:C("renderLineHighlightOnlyWhenFocus","Controls if the editor should render the current line highlight only when the editor is focused.")})),renderValidationDecorations:$e(new uo(97,"renderValidationDecorations","editable",["editable","on","off"])),renderWhitespace:$e(new uo(98,"renderWhitespace","selection",["none","boundary","selection","trailing","all"],{enumDescriptions:["",C("renderWhitespace.boundary","Render whitespace characters except for single spaces between words."),C("renderWhitespace.selection","Render whitespace characters only on selected text."),C("renderWhitespace.trailing","Render only trailing whitespace characters."),""],description:C("renderWhitespace","Controls how the editor should render whitespace characters.")})),revealHorizontalRightPadding:$e(new wi(99,"revealHorizontalRightPadding",15,0,1e3)),roundedSelection:$e(new On(100,"roundedSelection",!0,{description:C("roundedSelection","Controls whether selections should have rounded corners.")})),rulers:$e(new sYe),scrollbar:$e(new lYe),scrollBeyondLastColumn:$e(new wi(103,"scrollBeyondLastColumn",4,0,1073741824,{description:C("scrollBeyondLastColumn","Controls the number of extra characters beyond which the editor will scroll horizontally.")})),scrollBeyondLastLine:$e(new On(104,"scrollBeyondLastLine",!0,{description:C("scrollBeyondLastLine","Controls whether the editor will scroll beyond the last line.")})),scrollPredominantAxis:$e(new On(105,"scrollPredominantAxis",!0,{description:C("scrollPredominantAxis","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:$e(new On(106,"selectionClipboard",!0,{description:C("selectionClipboard","Controls whether the Linux primary clipboard should be supported."),included:xs})),selectionHighlight:$e(new On(107,"selectionHighlight",!0,{description:C("selectionHighlight","Controls whether the editor should highlight matches similar to the selection.")})),selectOnLineNumbers:$e(new On(108,"selectOnLineNumbers",!0)),showFoldingControls:$e(new uo(109,"showFoldingControls","mouseover",["always","never","mouseover"],{enumDescriptions:[C("showFoldingControls.always","Always show the folding controls."),C("showFoldingControls.never","Never show the folding controls and reduce the gutter size."),C("showFoldingControls.mouseover","Only show the folding controls when the mouse is over the gutter.")],description:C("showFoldingControls","Controls when the folding controls on the gutter are shown.")})),showUnused:$e(new On(110,"showUnused",!0,{description:C("showUnused","Controls fading out of unused code.")})),showDeprecated:$e(new On(138,"showDeprecated",!0,{description:C("showDeprecated","Controls strikethrough deprecated variables.")})),inlayHints:$e(new YXe),snippetSuggestions:$e(new uo(111,"snippetSuggestions","inline",["top","bottom","inline","none"],{enumDescriptions:[C("snippetSuggestions.top","Show snippet suggestions on top of other suggestions."),C("snippetSuggestions.bottom","Show snippet suggestions below other suggestions."),C("snippetSuggestions.inline","Show snippets suggestions with other suggestions."),C("snippetSuggestions.none","Do not show snippet suggestions.")],description:C("snippetSuggestions","Controls whether snippets are shown with other suggestions and how they are sorted.")})),smartSelect:$e(new gYe),smoothScrolling:$e(new On(113,"smoothScrolling",!1,{description:C("smoothScrolling","Controls whether the editor will scroll using an animation.")})),stopRenderingLineAfter:$e(new wi(116,"stopRenderingLineAfter",1e4,-1,1073741824)),suggest:$e(new fYe),inlineSuggest:$e(new uYe),inlineCompletionsAccessibilityVerbose:$e(new On(147,"inlineCompletionsAccessibilityVerbose",!1,{description:C("inlineCompletionsAccessibilityVerbose","Controls whether the accessibility hint should be provided to screen reader users when an inline completion is shown.")})),suggestFontSize:$e(new wi(118,"suggestFontSize",0,0,1e3,{markdownDescription:C("suggestFontSize","Font size for the suggest widget. When set to {0}, the value of {1} is used.","`0`","`#editor.fontSize#`")})),suggestLineHeight:$e(new wi(119,"suggestLineHeight",0,0,1e3,{markdownDescription:C("suggestLineHeight","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:$e(new On(120,"suggestOnTriggerCharacters",!0,{description:C("suggestOnTriggerCharacters","Controls whether suggestions should automatically show up when typing trigger characters.")})),suggestSelection:$e(new uo(121,"suggestSelection","first",["first","recentlyUsed","recentlyUsedByPrefix"],{markdownEnumDescriptions:[C("suggestSelection.first","Always select the first suggestion."),C("suggestSelection.recentlyUsed","Select recent suggestions unless further typing selects one, e.g. `console.| -> console.log` because `log` has been completed recently."),C("suggestSelection.recentlyUsedByPrefix","Select suggestions based on previous prefixes that have completed those suggestions, e.g. `co -> console` and `con -> const`.")],description:C("suggestSelection","Controls how suggestions are pre-selected when showing the suggest list.")})),tabCompletion:$e(new uo(122,"tabCompletion","off",["on","off","onlySnippets"],{enumDescriptions:[C("tabCompletion.on","Tab complete will insert the best matching suggestion when pressing tab."),C("tabCompletion.off","Disable tab completions."),C("tabCompletion.onlySnippets","Tab complete snippets when their prefix match. Works best when 'quickSuggestions' aren't enabled.")],description:C("tabCompletion","Enables tab completions.")})),tabIndex:$e(new wi(123,"tabIndex",0,-1,1073741824)),unicodeHighlight:$e(new cYe),unusualLineTerminators:$e(new uo(125,"unusualLineTerminators","prompt",["auto","off","prompt"],{enumDescriptions:[C("unusualLineTerminators.auto","Unusual line terminators are automatically removed."),C("unusualLineTerminators.off","Unusual line terminators are ignored."),C("unusualLineTerminators.prompt","Unusual line terminators prompt to be removed.")],description:C("unusualLineTerminators","Remove unusual line terminators that might cause problems.")})),useShadowDOM:$e(new On(126,"useShadowDOM",!0)),useTabStops:$e(new On(127,"useTabStops",!0,{description:C("useTabStops","Inserting and deleting whitespace follows tab stops.")})),wordBreak:$e(new uo(128,"wordBreak","normal",["normal","keepAll"],{markdownEnumDescriptions:[C("wordBreak.normal","Use the default line break rule."),C("wordBreak.keepAll","Word breaks should not be used for Chinese/Japanese/Korean (CJK) text. Non-CJK text behavior is the same as for normal.")],description:C("wordBreak","Controls the word break rules used for Chinese/Japanese/Korean (CJK) text.")})),wordSeparators:$e(new Qa(129,"wordSeparators",b_e,{description:C("wordSeparators","Characters that will be used as word separators when doing word related navigations or operations.")})),wordWrap:$e(new uo(130,"wordWrap","off",["off","on","wordWrapColumn","bounded"],{markdownEnumDescriptions:[C("wordWrap.off","Lines will never wrap."),C("wordWrap.on","Lines will wrap at the viewport width."),C({key:"wordWrap.wordWrapColumn",comment:["- `editor.wordWrapColumn` refers to a different setting and should not be localized."]},"Lines will wrap at `#editor.wordWrapColumn#`."),C({key:"wordWrap.bounded",comment:["- viewport means the edge of the visible window size.","- `editor.wordWrapColumn` refers to a different setting and should not be localized."]},"Lines will wrap at the minimum of viewport and `#editor.wordWrapColumn#`.")],description:C({key:"wordWrap",comment:["- 'off', 'on', 'wordWrapColumn' and 'bounded' refer to values the setting can take and should not be localized.","- `editor.wordWrapColumn` refers to a different setting and should not be localized."]},"Controls how lines should wrap.")})),wordWrapBreakAfterCharacters:$e(new Qa(131,"wordWrapBreakAfterCharacters"," })]?|/&.,;\xA2\xB0\u2032\u2033\u2030\u2103\u3001\u3002\uFF61\uFF64\uFFE0\uFF0C\uFF0E\uFF1A\uFF1B\uFF1F\uFF01\uFF05\u30FB\uFF65\u309D\u309E\u30FD\u30FE\u30FC\u30A1\u30A3\u30A5\u30A7\u30A9\u30C3\u30E3\u30E5\u30E7\u30EE\u30F5\u30F6\u3041\u3043\u3045\u3047\u3049\u3063\u3083\u3085\u3087\u308E\u3095\u3096\u31F0\u31F1\u31F2\u31F3\u31F4\u31F5\u31F6\u31F7\u31F8\u31F9\u31FA\u31FB\u31FC\u31FD\u31FE\u31FF\u3005\u303B\uFF67\uFF68\uFF69\uFF6A\uFF6B\uFF6C\uFF6D\uFF6E\uFF6F\uFF70\u201D\u3009\u300B\u300D\u300F\u3011\u3015\uFF09\uFF3D\uFF5D\uFF63")),wordWrapBreakBeforeCharacters:$e(new Qa(132,"wordWrapBreakBeforeCharacters","([{\u2018\u201C\u3008\u300A\u300C\u300E\u3010\u3014\uFF08\uFF3B\uFF5B\uFF62\xA3\xA5\uFF04\uFFE1\uFFE5+\uFF0B")),wordWrapColumn:$e(new wi(133,"wordWrapColumn",80,1,1073741824,{markdownDescription:C({key:"wordWrapColumn",comment:["- `editor.wordWrap` refers to a different setting and should not be localized.","- 'wordWrapColumn' and 'bounded' refer to values the different setting can take and should not be localized."]},"Controls the wrapping column of the editor when `#editor.wordWrap#` is `wordWrapColumn` or `bounded`.")})),wordWrapOverride1:$e(new uo(134,"wordWrapOverride1","inherit",["off","on","inherit"])),wordWrapOverride2:$e(new uo(135,"wordWrapOverride2","inherit",["off","on","inherit"])),editorClassName:$e(new VXe),defaultColorDecorators:$e(new On(145,"defaultColorDecorators",!1,{markdownDescription:C("defaultColorDecorators","Controls whether inline color decorations should be shown using the default document color provider")})),pixelRatio:$e(new iYe),tabFocusMode:$e(new On(142,"tabFocusMode",!1,{markdownDescription:C("tabFocusMode","Controls whether the editor receives tabs or defers them to the workbench for navigation.")})),layoutInfo:$e(new fy),wrappingInfo:$e(new mYe),wrappingIndent:$e(new pYe),wrappingStrategy:$e(new qXe)};class wYe{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?uw.isErrorNoTelemetry(e)?new uw(e.message+` `+e.stack):new Error(e.message+` -`+e.stack):e},0)}}emit(e){this.listeners.forEach(t=>{t(e)})}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}}const m_e=new mYe;function en(i){oh(i)||m_e.onUnexpectedError(i)}function $o(i){oh(i)||m_e.onUnexpectedExternalError(i)}function eoe(i){if(i instanceof Error){const{name:e,message:t}=i,n=i.stacktrace||i.stack;return{$isError:!0,name:e,message:t,stack:n,noTelemetry:cy.isErrorNoTelemetry(i)}}return i}const MA="Canceled";function oh(i){return i instanceof Gv?!0:i instanceof Error&&i.name===MA&&i.message===MA}class Gv extends Error{constructor(){super(MA),this.name=this.message}}function vYe(){const i=new Error(MA);return i.name=i.message,i}function Rc(i){return i?new Error(`Illegal argument: ${i}`):new Error("Illegal argument")}function Nq(i){return i?new Error(`Illegal state: ${i}`):new Error("Illegal state")}class _Ye extends Error{constructor(e){super("NotSupported"),e&&(this.message=e)}}class cy extends Error{constructor(e){super(e),this.name="CodeExpectedError"}static fromError(e){if(e instanceof cy)return e;const t=new cy;return t.message=e.message,t.stack=e.stack,t}static isErrorNoTelemetry(e){return e.name==="CodeExpectedError"}}class Vo extends Error{constructor(e){super(e||"An unexpected bug occurred."),Object.setPrototypeOf(this,Vo.prototype)}}function _v(i){const e=this;let t=!1,n;return function(){return t||(t=!0,n=i.apply(e,arguments)),n}}function Rq(i){return typeof i.dispose=="function"&&i.dispose.length===0}function si(i){if(mn.is(i)){const e=[];for(const t of i)if(t)try{t.dispose()}catch(n){e.push(n)}if(e.length===1)throw e[0];if(e.length>1)throw new AggregateError(e,"Encountered errors while disposing of store");return Array.isArray(i)?[]:i}else if(i)return i.dispose(),i}function Iu(...i){return zt(()=>si(i))}function zt(i){return{dispose:_v(()=>{i()})}}class Be{constructor(){this._toDispose=new Set,this._isDisposed=!1}dispose(){this._isDisposed||(this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{si(this._toDispose)}finally{this._toDispose.clear()}}add(e){if(!e)return e;if(e===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?Be.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(e),e}deleteAndLeak(e){!e||this._toDispose.has(e)&&this._toDispose.delete(e)}}Be.DISABLE_DISPOSED_WARNING=!1;class _e{constructor(){this._store=new Be,this._store}dispose(){this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}}_e.None=Object.freeze({dispose(){}});class Kr{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(e){var t;this._isDisposed||e===this._value||((t=this._value)===null||t===void 0||t.dispose(),this._value=e)}clear(){this.value=void 0}dispose(){var e;this._isDisposed=!0,(e=this._value)===null||e===void 0||e.dispose(),this._value=void 0}}class bYe{constructor(e){this._disposable=e,this._counter=1}acquire(){return this._counter++,this}release(){return--this._counter===0&&this._disposable.dispose(),this}}class CYe{constructor(e){this.object=e}dispose(){}}class Mq{constructor(){this._store=new Map,this._isDisposed=!1}dispose(){this._isDisposed=!0,this.clearAndDisposeAll()}clearAndDisposeAll(){if(!!this._store.size)try{si(this._store.values())}finally{this._store.clear()}}get(e){return this._store.get(e)}set(e,t,n=!1){var o;this._isDisposed&&console.warn(new Error("Trying to add a disposable to a DisposableMap that has already been disposed of. The added object will be leaked!").stack),n||(o=this._store.get(e))===null||o===void 0||o.dispose(),this._store.set(e,t)}deleteAndDispose(e){var t;(t=this._store.get(e))===null||t===void 0||t.dispose(),this._store.delete(e)}[Symbol.iterator](){return this._store[Symbol.iterator]()}}const wYe=globalThis.performance&&typeof globalThis.performance.now=="function";class xs{static create(e){return new xs(e)}constructor(e){this._now=wYe&&e===!1?Date.now:globalThis.performance.now.bind(globalThis.performance),this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}}var st;(function(i){i.None=()=>_e.None;function e(P,N){return d(P,()=>{},0,void 0,!0,void 0,N)}i.defer=e;function t(P){return(N,M=null,H)=>{let W=!1,F;return F=P($=>{if(!W)return F?F.dispose():W=!0,N.call(M,$)},null,H),W&&F.dispose(),F}}i.once=t;function n(P,N,M){return c((H,W=null,F)=>P($=>H.call(W,N($)),null,F),M)}i.map=n;function o(P,N,M){return c((H,W=null,F)=>P($=>{N($),H.call(W,$)},null,F),M)}i.forEach=o;function r(P,N,M){return c((H,W=null,F)=>P($=>N($)&&H.call(W,$),null,F),M)}i.filter=r;function s(P){return P}i.signal=s;function a(...P){return(N,M=null,H)=>{const W=Iu(...P.map(F=>F($=>N.call(M,$))));return u(W,H)}}i.any=a;function l(P,N,M,H){let W=M;return n(P,F=>(W=N(W,F),W),H)}i.reduce=l;function c(P,N){let M;const H={onWillAddFirstListener(){M=P(W.fire,W)},onDidRemoveLastListener(){M==null||M.dispose()}},W=new le(H);return N==null||N.add(W),W.event}function u(P,N){return N instanceof Array?N.push(P):N&&N.add(P),P}function d(P,N,M=100,H=!1,W=!1,F,$){let z,K,j,G=0,X;const de={leakWarningThreshold:F,onWillAddFirstListener(){z=P(pe=>{G++,K=N(K,pe),H&&!j&&(he.fire(K),K=void 0),X=()=>{const be=K;K=void 0,j=void 0,(!H||G>1)&&he.fire(be),G=0},typeof M=="number"?(clearTimeout(j),j=setTimeout(X,M)):j===void 0&&(j=0,queueMicrotask(X))})},onWillRemoveListener(){W&&G>0&&(X==null||X())},onDidRemoveLastListener(){X=void 0,z.dispose()}},he=new le(de);return $==null||$.add(he),he.event}i.debounce=d;function h(P,N=0,M){return i.debounce(P,(H,W)=>H?(H.push(W),H):[W],N,void 0,!0,void 0,M)}i.accumulate=h;function f(P,N=(H,W)=>H===W,M){let H=!0,W;return r(P,F=>{const $=H||!N(F,W);return H=!1,W=F,$},M)}i.latch=f;function g(P,N,M){return[i.filter(P,N,M),i.filter(P,H=>!N(H),M)]}i.split=g;function p(P,N=!1,M=[],H){let W=M.slice(),F=P(K=>{W?W.push(K):z.fire(K)});H&&H.add(F);const $=()=>{W==null||W.forEach(K=>z.fire(K)),W=null},z=new le({onWillAddFirstListener(){F||(F=P(K=>z.fire(K)),H&&H.add(F))},onDidAddFirstListener(){W&&(N?setTimeout($):$())},onDidRemoveLastListener(){F&&F.dispose(),F=null}});return H&&H.add(z),z.event}i.buffer=p;function v(P,N){return(H,W,F)=>{const $=N(new _);return P(function(z){const K=$.evaluate(z);K!==m&&H.call(W,K)},void 0,F)}}i.chain=v;const m=Symbol("HaltChainable");class _{constructor(){this.steps=[]}map(N){return this.steps.push(N),this}forEach(N){return this.steps.push(M=>(N(M),M)),this}filter(N){return this.steps.push(M=>N(M)?M:m),this}reduce(N,M){let H=M;return this.steps.push(W=>(H=N(H,W),H)),this}latch(N=(M,H)=>M===H){let M=!0,H;return this.steps.push(W=>{const F=M||!N(W,H);return M=!1,H=W,F?W:m}),this}evaluate(N){for(const M of this.steps)if(N=M(N),N===m)break;return N}}function w(P,N,M=H=>H){const H=(...z)=>$.fire(M(...z)),W=()=>P.on(N,H),F=()=>P.removeListener(N,H),$=new le({onWillAddFirstListener:W,onDidRemoveLastListener:F});return $.event}i.fromNodeEventEmitter=w;function y(P,N,M=H=>H){const H=(...z)=>$.fire(M(...z)),W=()=>P.addEventListener(N,H),F=()=>P.removeEventListener(N,H),$=new le({onWillAddFirstListener:W,onDidRemoveLastListener:F});return $.event}i.fromDOMEventEmitter=y;function L(P){return new Promise(N=>t(P)(N))}i.toPromise=L;function D(P){const N=new le;return P.then(M=>{N.fire(M)},()=>{N.fire(void 0)}).finally(()=>{N.dispose()}),N.event}i.fromPromise=D;function E(P,N){return N(void 0),P(M=>N(M))}i.runAndSubscribe=E;function I(P,N){let M=null;function H(F){M==null||M.dispose(),M=new Be,N(F,M)}H(void 0);const W=P(F=>H(F));return zt(()=>{W.dispose(),M==null||M.dispose()})}i.runAndSubscribeWithStore=I;class k{constructor(N,M){this._observable=N,this._counter=0,this._hasChanged=!1;const H={onWillAddFirstListener:()=>{N.addObserver(this)},onDidRemoveLastListener:()=>{N.removeObserver(this)}};this.emitter=new le(H),M&&M.add(this.emitter)}beginUpdate(N){this._counter++}handlePossibleChange(N){}handleChange(N,M){this._hasChanged=!0}endUpdate(N){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function R(P,N){return new k(P,N).emitter.event}i.fromObservable=R;function A(P){return N=>{let M=0,H=!1;const W={beginUpdate(){M++},endUpdate(){M--,M===0&&(P.reportChanges(),H&&(H=!1,N()))},handlePossibleChange(){},handleChange(){H=!0}};return P.addObserver(W),P.reportChanges(),{dispose(){P.removeObserver(W)}}}}i.fromObservableLight=A})(st||(st={}));class uy{constructor(e){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${e}_${uy._idPool++}`,uy.all.add(this)}start(e){this._stopWatch=new xs,this.listenerCount=e}stop(){if(this._stopWatch){const e=this._stopWatch.elapsed();this.durations.push(e),this.elapsedOverall+=e,this.invocationCount+=1,this._stopWatch=void 0}}}uy.all=new Set;uy._idPool=0;let yYe=-1;class SYe{constructor(e,t=Math.random().toString(18).slice(2,5)){this.threshold=e,this.name=t,this._warnCountdown=0}dispose(){var e;(e=this._stacks)===null||e===void 0||e.clear()}check(e,t){const n=this.threshold;if(n<=0||t{const r=this._stacks.get(e.value)||0;this._stacks.set(e.value,r-1)}}}class Aq{static create(){var e;return new Aq((e=new Error().stack)!==null&&e!==void 0?e:"")}constructor(e){this.value=e}print(){console.warn(this.value.split(` +`+e.stack):e},0)}}emit(e){this.listeners.forEach(t=>{t(e)})}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}}const x_e=new wYe;function en(i){sh(i)||x_e.onUnexpectedError(i)}function $o(i){sh(i)||x_e.onUnexpectedExternalError(i)}function loe(i){if(i instanceof Error){const{name:e,message:t}=i,n=i.stacktrace||i.stack;return{$isError:!0,name:e,message:t,stack:n,noTelemetry:uw.isErrorNoTelemetry(i)}}return i}const OA="Canceled";function sh(i){return i instanceof Gv?!0:i instanceof Error&&i.name===OA&&i.message===OA}class Gv extends Error{constructor(){super(OA),this.name=this.message}}function SYe(){const i=new Error(OA);return i.name=i.message,i}function Mc(i){return i?new Error(`Illegal argument: ${i}`):new Error("Illegal argument")}function Bq(i){return i?new Error(`Illegal state: ${i}`):new Error("Illegal state")}class xYe extends Error{constructor(e){super("NotSupported"),e&&(this.message=e)}}class uw extends Error{constructor(e){super(e),this.name="CodeExpectedError"}static fromError(e){if(e instanceof uw)return e;const t=new uw;return t.message=e.message,t.stack=e.stack,t}static isErrorNoTelemetry(e){return e.name==="CodeExpectedError"}}class Vo extends Error{constructor(e){super(e||"An unexpected bug occurred."),Object.setPrototypeOf(this,Vo.prototype)}}function bv(i){const e=this;let t=!1,n;return function(){return t||(t=!0,n=i.apply(e,arguments)),n}}function Wq(i){return typeof i.dispose=="function"&&i.dispose.length===0}function si(i){if(vn.is(i)){const e=[];for(const t of i)if(t)try{t.dispose()}catch(n){e.push(n)}if(e.length===1)throw e[0];if(e.length>1)throw new AggregateError(e,"Encountered errors while disposing of store");return Array.isArray(i)?[]:i}else if(i)return i.dispose(),i}function Tu(...i){return zt(()=>si(i))}function zt(i){return{dispose:bv(()=>{i()})}}class Be{constructor(){this._toDispose=new Set,this._isDisposed=!1}dispose(){this._isDisposed||(this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{si(this._toDispose)}finally{this._toDispose.clear()}}add(e){if(!e)return e;if(e===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?Be.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(e),e}deleteAndLeak(e){!e||this._toDispose.has(e)&&this._toDispose.delete(e)}}Be.DISABLE_DISPOSED_WARNING=!1;class _e{constructor(){this._store=new Be,this._store}dispose(){this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}}_e.None=Object.freeze({dispose(){}});class Kr{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(e){var t;this._isDisposed||e===this._value||((t=this._value)===null||t===void 0||t.dispose(),this._value=e)}clear(){this.value=void 0}dispose(){var e;this._isDisposed=!0,(e=this._value)===null||e===void 0||e.dispose(),this._value=void 0}}class LYe{constructor(e){this._disposable=e,this._counter=1}acquire(){return this._counter++,this}release(){return--this._counter===0&&this._disposable.dispose(),this}}class EYe{constructor(e){this.object=e}dispose(){}}class Vq{constructor(){this._store=new Map,this._isDisposed=!1}dispose(){this._isDisposed=!0,this.clearAndDisposeAll()}clearAndDisposeAll(){if(!!this._store.size)try{si(this._store.values())}finally{this._store.clear()}}get(e){return this._store.get(e)}set(e,t,n=!1){var o;this._isDisposed&&console.warn(new Error("Trying to add a disposable to a DisposableMap that has already been disposed of. The added object will be leaked!").stack),n||(o=this._store.get(e))===null||o===void 0||o.dispose(),this._store.set(e,t)}deleteAndDispose(e){var t;(t=this._store.get(e))===null||t===void 0||t.dispose(),this._store.delete(e)}[Symbol.iterator](){return this._store[Symbol.iterator]()}}const DYe=globalThis.performance&&typeof globalThis.performance.now=="function";class Ls{static create(e){return new Ls(e)}constructor(e){this._now=DYe&&e===!1?Date.now:globalThis.performance.now.bind(globalThis.performance),this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}}var st;(function(i){i.None=()=>_e.None;function e(P,N){return d(P,()=>{},0,void 0,!0,void 0,N)}i.defer=e;function t(P){return(N,M=null,H)=>{let B=!1,F;return F=P($=>{if(!B)return F?F.dispose():B=!0,N.call(M,$)},null,H),B&&F.dispose(),F}}i.once=t;function n(P,N,M){return c((H,B=null,F)=>P($=>H.call(B,N($)),null,F),M)}i.map=n;function o(P,N,M){return c((H,B=null,F)=>P($=>{N($),H.call(B,$)},null,F),M)}i.forEach=o;function r(P,N,M){return c((H,B=null,F)=>P($=>N($)&&H.call(B,$),null,F),M)}i.filter=r;function s(P){return P}i.signal=s;function a(...P){return(N,M=null,H)=>{const B=Tu(...P.map(F=>F($=>N.call(M,$))));return u(B,H)}}i.any=a;function l(P,N,M,H){let B=M;return n(P,F=>(B=N(B,F),B),H)}i.reduce=l;function c(P,N){let M;const H={onWillAddFirstListener(){M=P(B.fire,B)},onDidRemoveLastListener(){M==null||M.dispose()}},B=new le(H);return N==null||N.add(B),B.event}function u(P,N){return N instanceof Array?N.push(P):N&&N.add(P),P}function d(P,N,M=100,H=!1,B=!1,F,$){let z,K,j,G=0,X;const de={leakWarningThreshold:F,onWillAddFirstListener(){z=P(pe=>{G++,K=N(K,pe),H&&!j&&(fe.fire(K),K=void 0),X=()=>{const be=K;K=void 0,j=void 0,(!H||G>1)&&fe.fire(be),G=0},typeof M=="number"?(clearTimeout(j),j=setTimeout(X,M)):j===void 0&&(j=0,queueMicrotask(X))})},onWillRemoveListener(){B&&G>0&&(X==null||X())},onDidRemoveLastListener(){X=void 0,z.dispose()}},fe=new le(de);return $==null||$.add(fe),fe.event}i.debounce=d;function h(P,N=0,M){return i.debounce(P,(H,B)=>H?(H.push(B),H):[B],N,void 0,!0,void 0,M)}i.accumulate=h;function f(P,N=(H,B)=>H===B,M){let H=!0,B;return r(P,F=>{const $=H||!N(F,B);return H=!1,B=F,$},M)}i.latch=f;function g(P,N,M){return[i.filter(P,N,M),i.filter(P,H=>!N(H),M)]}i.split=g;function p(P,N=!1,M=[],H){let B=M.slice(),F=P(K=>{B?B.push(K):z.fire(K)});H&&H.add(F);const $=()=>{B==null||B.forEach(K=>z.fire(K)),B=null},z=new le({onWillAddFirstListener(){F||(F=P(K=>z.fire(K)),H&&H.add(F))},onDidAddFirstListener(){B&&(N?setTimeout($):$())},onDidRemoveLastListener(){F&&F.dispose(),F=null}});return H&&H.add(z),z.event}i.buffer=p;function v(P,N){return(H,B,F)=>{const $=N(new _);return P(function(z){const K=$.evaluate(z);K!==m&&H.call(B,K)},void 0,F)}}i.chain=v;const m=Symbol("HaltChainable");class _{constructor(){this.steps=[]}map(N){return this.steps.push(N),this}forEach(N){return this.steps.push(M=>(N(M),M)),this}filter(N){return this.steps.push(M=>N(M)?M:m),this}reduce(N,M){let H=M;return this.steps.push(B=>(H=N(H,B),H)),this}latch(N=(M,H)=>M===H){let M=!0,H;return this.steps.push(B=>{const F=M||!N(B,H);return M=!1,H=B,F?B:m}),this}evaluate(N){for(const M of this.steps)if(N=M(N),N===m)break;return N}}function y(P,N,M=H=>H){const H=(...z)=>$.fire(M(...z)),B=()=>P.on(N,H),F=()=>P.removeListener(N,H),$=new le({onWillAddFirstListener:B,onDidRemoveLastListener:F});return $.event}i.fromNodeEventEmitter=y;function w(P,N,M=H=>H){const H=(...z)=>$.fire(M(...z)),B=()=>P.addEventListener(N,H),F=()=>P.removeEventListener(N,H),$=new le({onWillAddFirstListener:B,onDidRemoveLastListener:F});return $.event}i.fromDOMEventEmitter=w;function L(P){return new Promise(N=>t(P)(N))}i.toPromise=L;function D(P){const N=new le;return P.then(M=>{N.fire(M)},()=>{N.fire(void 0)}).finally(()=>{N.dispose()}),N.event}i.fromPromise=D;function E(P,N){return N(void 0),P(M=>N(M))}i.runAndSubscribe=E;function I(P,N){let M=null;function H(F){M==null||M.dispose(),M=new Be,N(F,M)}H(void 0);const B=P(F=>H(F));return zt(()=>{B.dispose(),M==null||M.dispose()})}i.runAndSubscribeWithStore=I;class k{constructor(N,M){this._observable=N,this._counter=0,this._hasChanged=!1;const H={onWillAddFirstListener:()=>{N.addObserver(this)},onDidRemoveLastListener:()=>{N.removeObserver(this)}};this.emitter=new le(H),M&&M.add(this.emitter)}beginUpdate(N){this._counter++}handlePossibleChange(N){}handleChange(N,M){this._hasChanged=!0}endUpdate(N){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function R(P,N){return new k(P,N).emitter.event}i.fromObservable=R;function A(P){return N=>{let M=0,H=!1;const B={beginUpdate(){M++},endUpdate(){M--,M===0&&(P.reportChanges(),H&&(H=!1,N()))},handlePossibleChange(){},handleChange(){H=!0}};return P.addObserver(B),P.reportChanges(),{dispose(){P.removeObserver(B)}}}}i.fromObservableLight=A})(st||(st={}));class dw{constructor(e){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${e}_${dw._idPool++}`,dw.all.add(this)}start(e){this._stopWatch=new Ls,this.listenerCount=e}stop(){if(this._stopWatch){const e=this._stopWatch.elapsed();this.durations.push(e),this.elapsedOverall+=e,this.invocationCount+=1,this._stopWatch=void 0}}}dw.all=new Set;dw._idPool=0;let kYe=-1;class IYe{constructor(e,t=Math.random().toString(18).slice(2,5)){this.threshold=e,this.name=t,this._warnCountdown=0}dispose(){var e;(e=this._stacks)===null||e===void 0||e.clear()}check(e,t){const n=this.threshold;if(n<=0||t{const r=this._stacks.get(e.value)||0;this._stacks.set(e.value,r-1)}}}class Hq{static create(){var e;return new Hq((e=new Error().stack)!==null&&e!==void 0?e:"")}constructor(e){this.value=e}print(){console.warn(this.value.split(` `).slice(2).join(` -`))}}class k6{constructor(e){this.value=e}}const xYe=2;class le{constructor(e){var t,n,o,r,s;this._size=0,this._options=e,this._leakageMon=!((t=this._options)===null||t===void 0)&&t.leakWarningThreshold?new SYe((o=(n=this._options)===null||n===void 0?void 0:n.leakWarningThreshold)!==null&&o!==void 0?o:yYe):void 0,this._perfMon=!((r=this._options)===null||r===void 0)&&r._profName?new uy(this._options._profName):void 0,this._deliveryQueue=(s=this._options)===null||s===void 0?void 0:s.deliveryQueue}dispose(){var e,t,n,o;this._disposed||(this._disposed=!0,((e=this._deliveryQueue)===null||e===void 0?void 0:e.current)===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),(n=(t=this._options)===null||t===void 0?void 0:t.onDidRemoveLastListener)===null||n===void 0||n.call(t),(o=this._leakageMon)===null||o===void 0||o.dispose())}get event(){var e;return(e=this._event)!==null&&e!==void 0||(this._event=(t,n,o)=>{var r,s,a,l,c;if(this._leakageMon&&this._size>this._leakageMon.threshold*3)return console.warn(`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far`),_e.None;if(this._disposed)return _e.None;n&&(t=t.bind(n));const u=new k6(t);let d;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(u.stack=Aq.create(),d=this._leakageMon.check(u.stack,this._size+1)),this._listeners?this._listeners instanceof k6?((c=this._deliveryQueue)!==null&&c!==void 0||(this._deliveryQueue=new v_e),this._listeners=[this._listeners,u]):this._listeners.push(u):((s=(r=this._options)===null||r===void 0?void 0:r.onWillAddFirstListener)===null||s===void 0||s.call(r,this),this._listeners=u,(l=(a=this._options)===null||a===void 0?void 0:a.onDidAddFirstListener)===null||l===void 0||l.call(a,this)),this._size++;const h=zt(()=>{d==null||d(),this._removeListener(u)});return o instanceof Be?o.add(h):Array.isArray(o)&&o.push(h),h}),this._event}_removeListener(e){var t,n,o,r;if((n=(t=this._options)===null||t===void 0?void 0:t.onWillRemoveListener)===null||n===void 0||n.call(t,this),!this._listeners)return;if(this._size===1){this._listeners=void 0,(r=(o=this._options)===null||o===void 0?void 0:o.onDidRemoveLastListener)===null||r===void 0||r.call(o,this),this._size=0;return}const s=this._listeners,a=s.indexOf(e);if(a===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,s[a]=void 0;const l=this._deliveryQueue.current===this;if(this._size*xYe<=s.length){let c=0;for(let u=0;u0}}const LYe=()=>new v_e;class v_e{constructor(){this.i=-1,this.end=0}enqueue(e,t,n){this.i=0,this.end=n,this.current=e,this.value=t}reset(){this.i=this.end,this.current=void 0,this.value=void 0}}class q0 extends le{constructor(e){super(e),this._isPaused=0,this._eventQueue=new ia,this._mergeFn=e==null?void 0:e.merge}pause(){this._isPaused++}resume(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){if(this._eventQueue.size>0){const e=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(e))}}else for(;!this._isPaused&&this._eventQueue.size!==0;)super.fire(this._eventQueue.shift())}fire(e){this._size&&(this._isPaused!==0?this._eventQueue.push(e):super.fire(e))}}class __e extends q0{constructor(e){var t;super(e),this._delay=(t=e.delay)!==null&&t!==void 0?t:100}fire(e){this._handle||(this.pause(),this._handle=setTimeout(()=>{this._handle=void 0,this.resume()},this._delay)),super.fire(e)}}class EYe extends le{constructor(e){super(e),this._queuedEvents=[],this._mergeFn=e==null?void 0:e.merge}fire(e){!this.hasListeners()||(this._queuedEvents.push(e),this._queuedEvents.length===1&&queueMicrotask(()=>{this._mergeFn?super.fire(this._mergeFn(this._queuedEvents)):this._queuedEvents.forEach(t=>super.fire(t)),this._queuedEvents=[]}))}}class DYe{constructor(){this.hasListeners=!1,this.events=[],this.emitter=new le({onWillAddFirstListener:()=>this.onFirstListenerAdd(),onDidRemoveLastListener:()=>this.onLastListenerRemove()})}get event(){return this.emitter.event}add(e){const t={event:e,listener:null};return this.events.push(t),this.hasListeners&&this.hook(t),zt(_v(()=>{this.hasListeners&&this.unhook(t);const o=this.events.indexOf(t);this.events.splice(o,1)}))}onFirstListenerAdd(){this.hasListeners=!0,this.events.forEach(e=>this.hook(e))}onLastListenerRemove(){this.hasListeners=!1,this.events.forEach(e=>this.unhook(e))}hook(e){e.listener=e.event(t=>this.emitter.fire(t))}unhook(e){e.listener&&e.listener.dispose(),e.listener=null}dispose(){this.emitter.dispose()}}class Pq{constructor(){this.buffers=[]}wrapEvent(e){return(t,n,o)=>e(r=>{const s=this.buffers[this.buffers.length-1];s?s.push(()=>t.call(n,r)):t.call(n,r)},void 0,o)}bufferEvents(e){const t=[];this.buffers.push(t);const n=e();return this.buffers.pop(),t.forEach(o=>o()),n}}class toe{constructor(){this.listening=!1,this.inputEvent=st.None,this.inputEventListener=_e.None,this.emitter=new le({onDidAddFirstListener:()=>{this.listening=!0,this.inputEventListener=this.inputEvent(this.emitter.fire,this.emitter)},onDidRemoveLastListener:()=>{this.listening=!1,this.inputEventListener.dispose()}}),this.event=this.emitter.event}set input(e){this.inputEvent=e,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=e(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(),this.emitter.dispose()}}const b_e=Object.freeze(function(i,e){const t=setTimeout(i.bind(e),0);return{dispose(){clearTimeout(t)}}});var _n;(function(i){function e(t){return t===i.None||t===i.Cancelled||t instanceof GR?!0:!t||typeof t!="object"?!1:typeof t.isCancellationRequested=="boolean"&&typeof t.onCancellationRequested=="function"}i.isCancellationToken=e,i.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:st.None}),i.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:b_e})})(_n||(_n={}));class GR{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?b_e:(this._emitter||(this._emitter=new le),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}}class Ro{constructor(e){this._token=void 0,this._parentListener=void 0,this._parentListener=e&&e.onCancellationRequested(this.cancel,this)}get token(){return this._token||(this._token=new GR),this._token}cancel(){this._token?this._token instanceof GR&&this._token.cancel():this._token=_n.Cancelled}dispose(e=!1){var t;e&&this.cancel(),(t=this._parentListener)===null||t===void 0||t.dispose(),this._token?this._token instanceof GR&&this._token.dispose():this._token=_n.None}}class Oq{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()]||0}}const XR=new Oq,zW=new Oq,UW=new Oq,C_e=new Array(230),kYe=Object.create(null),IYe=Object.create(null),Fq=[];for(let i=0;i<=193;i++)Fq[i]=-1;(function(){const i="",e=[[1,0,"None",0,"unknown",0,"VK_UNKNOWN",i,i],[1,1,"Hyper",0,i,0,i,i,i],[1,2,"Super",0,i,0,i,i,i],[1,3,"Fn",0,i,0,i,i,i],[1,4,"FnLock",0,i,0,i,i,i],[1,5,"Suspend",0,i,0,i,i,i],[1,6,"Resume",0,i,0,i,i,i],[1,7,"Turbo",0,i,0,i,i,i],[1,8,"Sleep",0,i,0,"VK_SLEEP",i,i],[1,9,"WakeUp",0,i,0,i,i,i],[0,10,"KeyA",31,"A",65,"VK_A",i,i],[0,11,"KeyB",32,"B",66,"VK_B",i,i],[0,12,"KeyC",33,"C",67,"VK_C",i,i],[0,13,"KeyD",34,"D",68,"VK_D",i,i],[0,14,"KeyE",35,"E",69,"VK_E",i,i],[0,15,"KeyF",36,"F",70,"VK_F",i,i],[0,16,"KeyG",37,"G",71,"VK_G",i,i],[0,17,"KeyH",38,"H",72,"VK_H",i,i],[0,18,"KeyI",39,"I",73,"VK_I",i,i],[0,19,"KeyJ",40,"J",74,"VK_J",i,i],[0,20,"KeyK",41,"K",75,"VK_K",i,i],[0,21,"KeyL",42,"L",76,"VK_L",i,i],[0,22,"KeyM",43,"M",77,"VK_M",i,i],[0,23,"KeyN",44,"N",78,"VK_N",i,i],[0,24,"KeyO",45,"O",79,"VK_O",i,i],[0,25,"KeyP",46,"P",80,"VK_P",i,i],[0,26,"KeyQ",47,"Q",81,"VK_Q",i,i],[0,27,"KeyR",48,"R",82,"VK_R",i,i],[0,28,"KeyS",49,"S",83,"VK_S",i,i],[0,29,"KeyT",50,"T",84,"VK_T",i,i],[0,30,"KeyU",51,"U",85,"VK_U",i,i],[0,31,"KeyV",52,"V",86,"VK_V",i,i],[0,32,"KeyW",53,"W",87,"VK_W",i,i],[0,33,"KeyX",54,"X",88,"VK_X",i,i],[0,34,"KeyY",55,"Y",89,"VK_Y",i,i],[0,35,"KeyZ",56,"Z",90,"VK_Z",i,i],[0,36,"Digit1",22,"1",49,"VK_1",i,i],[0,37,"Digit2",23,"2",50,"VK_2",i,i],[0,38,"Digit3",24,"3",51,"VK_3",i,i],[0,39,"Digit4",25,"4",52,"VK_4",i,i],[0,40,"Digit5",26,"5",53,"VK_5",i,i],[0,41,"Digit6",27,"6",54,"VK_6",i,i],[0,42,"Digit7",28,"7",55,"VK_7",i,i],[0,43,"Digit8",29,"8",56,"VK_8",i,i],[0,44,"Digit9",30,"9",57,"VK_9",i,i],[0,45,"Digit0",21,"0",48,"VK_0",i,i],[1,46,"Enter",3,"Enter",13,"VK_RETURN",i,i],[1,47,"Escape",9,"Escape",27,"VK_ESCAPE",i,i],[1,48,"Backspace",1,"Backspace",8,"VK_BACK",i,i],[1,49,"Tab",2,"Tab",9,"VK_TAB",i,i],[1,50,"Space",10,"Space",32,"VK_SPACE",i,i],[0,51,"Minus",88,"-",189,"VK_OEM_MINUS","-","OEM_MINUS"],[0,52,"Equal",86,"=",187,"VK_OEM_PLUS","=","OEM_PLUS"],[0,53,"BracketLeft",92,"[",219,"VK_OEM_4","[","OEM_4"],[0,54,"BracketRight",94,"]",221,"VK_OEM_6","]","OEM_6"],[0,55,"Backslash",93,"\\",220,"VK_OEM_5","\\","OEM_5"],[0,56,"IntlHash",0,i,0,i,i,i],[0,57,"Semicolon",85,";",186,"VK_OEM_1",";","OEM_1"],[0,58,"Quote",95,"'",222,"VK_OEM_7","'","OEM_7"],[0,59,"Backquote",91,"`",192,"VK_OEM_3","`","OEM_3"],[0,60,"Comma",87,",",188,"VK_OEM_COMMA",",","OEM_COMMA"],[0,61,"Period",89,".",190,"VK_OEM_PERIOD",".","OEM_PERIOD"],[0,62,"Slash",90,"/",191,"VK_OEM_2","/","OEM_2"],[1,63,"CapsLock",8,"CapsLock",20,"VK_CAPITAL",i,i],[1,64,"F1",59,"F1",112,"VK_F1",i,i],[1,65,"F2",60,"F2",113,"VK_F2",i,i],[1,66,"F3",61,"F3",114,"VK_F3",i,i],[1,67,"F4",62,"F4",115,"VK_F4",i,i],[1,68,"F5",63,"F5",116,"VK_F5",i,i],[1,69,"F6",64,"F6",117,"VK_F6",i,i],[1,70,"F7",65,"F7",118,"VK_F7",i,i],[1,71,"F8",66,"F8",119,"VK_F8",i,i],[1,72,"F9",67,"F9",120,"VK_F9",i,i],[1,73,"F10",68,"F10",121,"VK_F10",i,i],[1,74,"F11",69,"F11",122,"VK_F11",i,i],[1,75,"F12",70,"F12",123,"VK_F12",i,i],[1,76,"PrintScreen",0,i,0,i,i,i],[1,77,"ScrollLock",84,"ScrollLock",145,"VK_SCROLL",i,i],[1,78,"Pause",7,"PauseBreak",19,"VK_PAUSE",i,i],[1,79,"Insert",19,"Insert",45,"VK_INSERT",i,i],[1,80,"Home",14,"Home",36,"VK_HOME",i,i],[1,81,"PageUp",11,"PageUp",33,"VK_PRIOR",i,i],[1,82,"Delete",20,"Delete",46,"VK_DELETE",i,i],[1,83,"End",13,"End",35,"VK_END",i,i],[1,84,"PageDown",12,"PageDown",34,"VK_NEXT",i,i],[1,85,"ArrowRight",17,"RightArrow",39,"VK_RIGHT","Right",i],[1,86,"ArrowLeft",15,"LeftArrow",37,"VK_LEFT","Left",i],[1,87,"ArrowDown",18,"DownArrow",40,"VK_DOWN","Down",i],[1,88,"ArrowUp",16,"UpArrow",38,"VK_UP","Up",i],[1,89,"NumLock",83,"NumLock",144,"VK_NUMLOCK",i,i],[1,90,"NumpadDivide",113,"NumPad_Divide",111,"VK_DIVIDE",i,i],[1,91,"NumpadMultiply",108,"NumPad_Multiply",106,"VK_MULTIPLY",i,i],[1,92,"NumpadSubtract",111,"NumPad_Subtract",109,"VK_SUBTRACT",i,i],[1,93,"NumpadAdd",109,"NumPad_Add",107,"VK_ADD",i,i],[1,94,"NumpadEnter",3,i,0,i,i,i],[1,95,"Numpad1",99,"NumPad1",97,"VK_NUMPAD1",i,i],[1,96,"Numpad2",100,"NumPad2",98,"VK_NUMPAD2",i,i],[1,97,"Numpad3",101,"NumPad3",99,"VK_NUMPAD3",i,i],[1,98,"Numpad4",102,"NumPad4",100,"VK_NUMPAD4",i,i],[1,99,"Numpad5",103,"NumPad5",101,"VK_NUMPAD5",i,i],[1,100,"Numpad6",104,"NumPad6",102,"VK_NUMPAD6",i,i],[1,101,"Numpad7",105,"NumPad7",103,"VK_NUMPAD7",i,i],[1,102,"Numpad8",106,"NumPad8",104,"VK_NUMPAD8",i,i],[1,103,"Numpad9",107,"NumPad9",105,"VK_NUMPAD9",i,i],[1,104,"Numpad0",98,"NumPad0",96,"VK_NUMPAD0",i,i],[1,105,"NumpadDecimal",112,"NumPad_Decimal",110,"VK_DECIMAL",i,i],[0,106,"IntlBackslash",97,"OEM_102",226,"VK_OEM_102",i,i],[1,107,"ContextMenu",58,"ContextMenu",93,i,i,i],[1,108,"Power",0,i,0,i,i,i],[1,109,"NumpadEqual",0,i,0,i,i,i],[1,110,"F13",71,"F13",124,"VK_F13",i,i],[1,111,"F14",72,"F14",125,"VK_F14",i,i],[1,112,"F15",73,"F15",126,"VK_F15",i,i],[1,113,"F16",74,"F16",127,"VK_F16",i,i],[1,114,"F17",75,"F17",128,"VK_F17",i,i],[1,115,"F18",76,"F18",129,"VK_F18",i,i],[1,116,"F19",77,"F19",130,"VK_F19",i,i],[1,117,"F20",78,"F20",131,"VK_F20",i,i],[1,118,"F21",79,"F21",132,"VK_F21",i,i],[1,119,"F22",80,"F22",133,"VK_F22",i,i],[1,120,"F23",81,"F23",134,"VK_F23",i,i],[1,121,"F24",82,"F24",135,"VK_F24",i,i],[1,122,"Open",0,i,0,i,i,i],[1,123,"Help",0,i,0,i,i,i],[1,124,"Select",0,i,0,i,i,i],[1,125,"Again",0,i,0,i,i,i],[1,126,"Undo",0,i,0,i,i,i],[1,127,"Cut",0,i,0,i,i,i],[1,128,"Copy",0,i,0,i,i,i],[1,129,"Paste",0,i,0,i,i,i],[1,130,"Find",0,i,0,i,i,i],[1,131,"AudioVolumeMute",117,"AudioVolumeMute",173,"VK_VOLUME_MUTE",i,i],[1,132,"AudioVolumeUp",118,"AudioVolumeUp",175,"VK_VOLUME_UP",i,i],[1,133,"AudioVolumeDown",119,"AudioVolumeDown",174,"VK_VOLUME_DOWN",i,i],[1,134,"NumpadComma",110,"NumPad_Separator",108,"VK_SEPARATOR",i,i],[0,135,"IntlRo",115,"ABNT_C1",193,"VK_ABNT_C1",i,i],[1,136,"KanaMode",0,i,0,i,i,i],[0,137,"IntlYen",0,i,0,i,i,i],[1,138,"Convert",0,i,0,i,i,i],[1,139,"NonConvert",0,i,0,i,i,i],[1,140,"Lang1",0,i,0,i,i,i],[1,141,"Lang2",0,i,0,i,i,i],[1,142,"Lang3",0,i,0,i,i,i],[1,143,"Lang4",0,i,0,i,i,i],[1,144,"Lang5",0,i,0,i,i,i],[1,145,"Abort",0,i,0,i,i,i],[1,146,"Props",0,i,0,i,i,i],[1,147,"NumpadParenLeft",0,i,0,i,i,i],[1,148,"NumpadParenRight",0,i,0,i,i,i],[1,149,"NumpadBackspace",0,i,0,i,i,i],[1,150,"NumpadMemoryStore",0,i,0,i,i,i],[1,151,"NumpadMemoryRecall",0,i,0,i,i,i],[1,152,"NumpadMemoryClear",0,i,0,i,i,i],[1,153,"NumpadMemoryAdd",0,i,0,i,i,i],[1,154,"NumpadMemorySubtract",0,i,0,i,i,i],[1,155,"NumpadClear",131,"Clear",12,"VK_CLEAR",i,i],[1,156,"NumpadClearEntry",0,i,0,i,i,i],[1,0,i,5,"Ctrl",17,"VK_CONTROL",i,i],[1,0,i,4,"Shift",16,"VK_SHIFT",i,i],[1,0,i,6,"Alt",18,"VK_MENU",i,i],[1,0,i,57,"Meta",91,"VK_COMMAND",i,i],[1,157,"ControlLeft",5,i,0,"VK_LCONTROL",i,i],[1,158,"ShiftLeft",4,i,0,"VK_LSHIFT",i,i],[1,159,"AltLeft",6,i,0,"VK_LMENU",i,i],[1,160,"MetaLeft",57,i,0,"VK_LWIN",i,i],[1,161,"ControlRight",5,i,0,"VK_RCONTROL",i,i],[1,162,"ShiftRight",4,i,0,"VK_RSHIFT",i,i],[1,163,"AltRight",6,i,0,"VK_RMENU",i,i],[1,164,"MetaRight",57,i,0,"VK_RWIN",i,i],[1,165,"BrightnessUp",0,i,0,i,i,i],[1,166,"BrightnessDown",0,i,0,i,i,i],[1,167,"MediaPlay",0,i,0,i,i,i],[1,168,"MediaRecord",0,i,0,i,i,i],[1,169,"MediaFastForward",0,i,0,i,i,i],[1,170,"MediaRewind",0,i,0,i,i,i],[1,171,"MediaTrackNext",124,"MediaTrackNext",176,"VK_MEDIA_NEXT_TRACK",i,i],[1,172,"MediaTrackPrevious",125,"MediaTrackPrevious",177,"VK_MEDIA_PREV_TRACK",i,i],[1,173,"MediaStop",126,"MediaStop",178,"VK_MEDIA_STOP",i,i],[1,174,"Eject",0,i,0,i,i,i],[1,175,"MediaPlayPause",127,"MediaPlayPause",179,"VK_MEDIA_PLAY_PAUSE",i,i],[1,176,"MediaSelect",128,"LaunchMediaPlayer",181,"VK_MEDIA_LAUNCH_MEDIA_SELECT",i,i],[1,177,"LaunchMail",129,"LaunchMail",180,"VK_MEDIA_LAUNCH_MAIL",i,i],[1,178,"LaunchApp2",130,"LaunchApp2",183,"VK_MEDIA_LAUNCH_APP2",i,i],[1,179,"LaunchApp1",0,i,0,"VK_MEDIA_LAUNCH_APP1",i,i],[1,180,"SelectTask",0,i,0,i,i,i],[1,181,"LaunchScreenSaver",0,i,0,i,i,i],[1,182,"BrowserSearch",120,"BrowserSearch",170,"VK_BROWSER_SEARCH",i,i],[1,183,"BrowserHome",121,"BrowserHome",172,"VK_BROWSER_HOME",i,i],[1,184,"BrowserBack",122,"BrowserBack",166,"VK_BROWSER_BACK",i,i],[1,185,"BrowserForward",123,"BrowserForward",167,"VK_BROWSER_FORWARD",i,i],[1,186,"BrowserStop",0,i,0,"VK_BROWSER_STOP",i,i],[1,187,"BrowserRefresh",0,i,0,"VK_BROWSER_REFRESH",i,i],[1,188,"BrowserFavorites",0,i,0,"VK_BROWSER_FAVORITES",i,i],[1,189,"ZoomToggle",0,i,0,i,i,i],[1,190,"MailReply",0,i,0,i,i,i],[1,191,"MailForward",0,i,0,i,i,i],[1,192,"MailSend",0,i,0,i,i,i],[1,0,i,114,"KeyInComposition",229,i,i,i],[1,0,i,116,"ABNT_C2",194,"VK_ABNT_C2",i,i],[1,0,i,96,"OEM_8",223,"VK_OEM_8",i,i],[1,0,i,0,i,0,"VK_KANA",i,i],[1,0,i,0,i,0,"VK_HANGUL",i,i],[1,0,i,0,i,0,"VK_JUNJA",i,i],[1,0,i,0,i,0,"VK_FINAL",i,i],[1,0,i,0,i,0,"VK_HANJA",i,i],[1,0,i,0,i,0,"VK_KANJI",i,i],[1,0,i,0,i,0,"VK_CONVERT",i,i],[1,0,i,0,i,0,"VK_NONCONVERT",i,i],[1,0,i,0,i,0,"VK_ACCEPT",i,i],[1,0,i,0,i,0,"VK_MODECHANGE",i,i],[1,0,i,0,i,0,"VK_SELECT",i,i],[1,0,i,0,i,0,"VK_PRINT",i,i],[1,0,i,0,i,0,"VK_EXECUTE",i,i],[1,0,i,0,i,0,"VK_SNAPSHOT",i,i],[1,0,i,0,i,0,"VK_HELP",i,i],[1,0,i,0,i,0,"VK_APPS",i,i],[1,0,i,0,i,0,"VK_PROCESSKEY",i,i],[1,0,i,0,i,0,"VK_PACKET",i,i],[1,0,i,0,i,0,"VK_DBE_SBCSCHAR",i,i],[1,0,i,0,i,0,"VK_DBE_DBCSCHAR",i,i],[1,0,i,0,i,0,"VK_ATTN",i,i],[1,0,i,0,i,0,"VK_CRSEL",i,i],[1,0,i,0,i,0,"VK_EXSEL",i,i],[1,0,i,0,i,0,"VK_EREOF",i,i],[1,0,i,0,i,0,"VK_PLAY",i,i],[1,0,i,0,i,0,"VK_ZOOM",i,i],[1,0,i,0,i,0,"VK_NONAME",i,i],[1,0,i,0,i,0,"VK_PA1",i,i],[1,0,i,0,i,0,"VK_OEM_CLEAR",i,i]],t=[],n=[];for(const o of e){const[r,s,a,l,c,u,d,h,f]=o;if(n[s]||(n[s]=!0,kYe[a]=s,IYe[a.toLowerCase()]=s,r&&(Fq[s]=l)),!t[l]){if(t[l]=!0,!c)throw new Error(`String representation missing for key code ${l} around scan code ${a}`);XR.define(l,c),zW.define(l,h||c),UW.define(l,f||h||c)}u&&(C_e[u]=l)}})();var yg;(function(i){function e(a){return XR.keyCodeToStr(a)}i.toString=e;function t(a){return XR.strToKeyCode(a)}i.fromString=t;function n(a){return zW.keyCodeToStr(a)}i.toUserSettingsUS=n;function o(a){return UW.keyCodeToStr(a)}i.toUserSettingsGeneral=o;function r(a){return zW.strToKeyCode(a)||UW.strToKeyCode(a)}i.fromUserSettings=r;function s(a){if(a>=98&&a<=113)return null;switch(a){case 16:return"Up";case 18:return"Down";case 15:return"Left";case 17:return"Right"}return XR.keyCodeToStr(a)}i.toElectronAccelerator=s})(yg||(yg={}));function Zo(i,e){const t=(e&65535)<<16>>>0;return(i|t)>>>0}let pw;if(typeof ku.vscode!="undefined"&&typeof ku.vscode.process!="undefined"){const i=ku.vscode.process;pw={get platform(){return i.platform},get arch(){return i.arch},get env(){return i.env},cwd(){return i.cwd()}}}else typeof process!="undefined"?pw={get platform(){return process.platform},get arch(){return process.arch},get env(){return process.env},cwd(){return process.env.VSCODE_CWD||process.cwd()}}:pw={get platform(){return as?"win32":Nn?"darwin":"linux"},get arch(){},get env(){return{}},cwd(){return"/"}};const AA=pw.cwd,w_e=pw.env,TYe=pw.platform,NYe=65,RYe=97,MYe=90,AYe=122,Um=46,As=47,El=92,Op=58,PYe=63;class y_e extends Error{constructor(e,t,n){let o;typeof t=="string"&&t.indexOf("not ")===0?(o="must not be",t=t.replace(/^not /,"")):o="must be";const r=e.indexOf(".")!==-1?"property":"argument";let s=`The "${e}" ${r} ${o} of type ${t}`;s+=`. Received type ${typeof n}`,super(s),this.code="ERR_INVALID_ARG_TYPE"}}function OYe(i,e){if(i===null||typeof i!="object")throw new y_e(e,"Object",i)}function wr(i,e){if(typeof i!="string")throw new y_e(e,"string",i)}const Xv=TYe==="win32";function li(i){return i===As||i===El}function jW(i){return i===As}function Fp(i){return i>=NYe&&i<=MYe||i>=RYe&&i<=AYe}function PA(i,e,t,n){let o="",r=0,s=-1,a=0,l=0;for(let c=0;c<=i.length;++c){if(c2){const u=o.lastIndexOf(t);u===-1?(o="",r=0):(o=o.slice(0,u),r=o.length-1-o.lastIndexOf(t)),s=c,a=0;continue}else if(o.length!==0){o="",r=0,s=c,a=0;continue}}e&&(o+=o.length>0?`${t}..`:"..",r=2)}else o.length>0?o+=`${t}${i.slice(s+1,c)}`:o=i.slice(s+1,c),r=c-s-1;s=c,a=0}else l===Um&&a!==-1?++a:a=-1}return o}function S_e(i,e){OYe(e,"pathObject");const t=e.dir||e.root,n=e.base||`${e.name||""}${e.ext||""}`;return t?t===e.root?`${t}${n}`:`${t}${i}${n}`:n}const il={resolve(...i){let e="",t="",n=!1;for(let o=i.length-1;o>=-1;o--){let r;if(o>=0){if(r=i[o],wr(r,"path"),r.length===0)continue}else e.length===0?r=AA():(r=w_e[`=${e}`]||AA(),(r===void 0||r.slice(0,2).toLowerCase()!==e.toLowerCase()&&r.charCodeAt(2)===El)&&(r=`${e}\\`));const s=r.length;let a=0,l="",c=!1;const u=r.charCodeAt(0);if(s===1)li(u)&&(a=1,c=!0);else if(li(u))if(c=!0,li(r.charCodeAt(1))){let d=2,h=d;for(;d2&&li(r.charCodeAt(2))&&(c=!0,a=3));if(l.length>0)if(e.length>0){if(l.toLowerCase()!==e.toLowerCase())continue}else e=l;if(n){if(e.length>0)break}else if(t=`${r.slice(a)}\\${t}`,n=c,c&&e.length>0)break}return t=PA(t,!n,"\\",li),n?`${e}\\${t}`:`${e}${t}`||"."},normalize(i){wr(i,"path");const e=i.length;if(e===0)return".";let t=0,n,o=!1;const r=i.charCodeAt(0);if(e===1)return jW(r)?"\\":i;if(li(r))if(o=!0,li(i.charCodeAt(1))){let a=2,l=a;for(;a2&&li(i.charCodeAt(2))&&(o=!0,t=3));let s=t0&&li(i.charCodeAt(e-1))&&(s+="\\"),n===void 0?o?`\\${s}`:s:o?`${n}\\${s}`:`${n}${s}`},isAbsolute(i){wr(i,"path");const e=i.length;if(e===0)return!1;const t=i.charCodeAt(0);return li(t)||e>2&&Fp(t)&&i.charCodeAt(1)===Op&&li(i.charCodeAt(2))},join(...i){if(i.length===0)return".";let e,t;for(let r=0;r0&&(e===void 0?e=t=s:e+=`\\${s}`)}if(e===void 0)return".";let n=!0,o=0;if(typeof t=="string"&&li(t.charCodeAt(0))){++o;const r=t.length;r>1&&li(t.charCodeAt(1))&&(++o,r>2&&(li(t.charCodeAt(2))?++o:n=!1))}if(n){for(;o=2&&(e=`\\${e.slice(o)}`)}return il.normalize(e)},relative(i,e){if(wr(i,"from"),wr(e,"to"),i===e)return"";const t=il.resolve(i),n=il.resolve(e);if(t===n||(i=t.toLowerCase(),e=n.toLowerCase(),i===e))return"";let o=0;for(;oo&&i.charCodeAt(r-1)===El;)r--;const s=r-o;let a=0;for(;aa&&e.charCodeAt(l-1)===El;)l--;const c=l-a,u=su){if(e.charCodeAt(a+h)===El)return n.slice(a+h+1);if(h===2)return n.slice(a+h)}s>u&&(i.charCodeAt(o+h)===El?d=h:h===2&&(d=3)),d===-1&&(d=0)}let f="";for(h=o+d+1;h<=r;++h)(h===r||i.charCodeAt(h)===El)&&(f+=f.length===0?"..":"\\..");return a+=d,f.length>0?`${f}${n.slice(a,l)}`:(n.charCodeAt(a)===El&&++a,n.slice(a,l))},toNamespacedPath(i){if(typeof i!="string"||i.length===0)return i;const e=il.resolve(i);if(e.length<=2)return i;if(e.charCodeAt(0)===El){if(e.charCodeAt(1)===El){const t=e.charCodeAt(2);if(t!==PYe&&t!==Um)return`\\\\?\\UNC\\${e.slice(2)}`}}else if(Fp(e.charCodeAt(0))&&e.charCodeAt(1)===Op&&e.charCodeAt(2)===El)return`\\\\?\\${e}`;return i},dirname(i){wr(i,"path");const e=i.length;if(e===0)return".";let t=-1,n=0;const o=i.charCodeAt(0);if(e===1)return li(o)?i:".";if(li(o)){if(t=n=1,li(i.charCodeAt(1))){let a=2,l=a;for(;a2&&li(i.charCodeAt(2))?3:2,n=t);let r=-1,s=!0;for(let a=e-1;a>=n;--a)if(li(i.charCodeAt(a))){if(!s){r=a;break}}else s=!1;if(r===-1){if(t===-1)return".";r=t}return i.slice(0,r)},basename(i,e){e!==void 0&&wr(e,"ext"),wr(i,"path");let t=0,n=-1,o=!0,r;if(i.length>=2&&Fp(i.charCodeAt(0))&&i.charCodeAt(1)===Op&&(t=2),e!==void 0&&e.length>0&&e.length<=i.length){if(e===i)return"";let s=e.length-1,a=-1;for(r=i.length-1;r>=t;--r){const l=i.charCodeAt(r);if(li(l)){if(!o){t=r+1;break}}else a===-1&&(o=!1,a=r+1),s>=0&&(l===e.charCodeAt(s)?--s===-1&&(n=r):(s=-1,n=a))}return t===n?n=a:n===-1&&(n=i.length),i.slice(t,n)}for(r=i.length-1;r>=t;--r)if(li(i.charCodeAt(r))){if(!o){t=r+1;break}}else n===-1&&(o=!1,n=r+1);return n===-1?"":i.slice(t,n)},extname(i){wr(i,"path");let e=0,t=-1,n=0,o=-1,r=!0,s=0;i.length>=2&&i.charCodeAt(1)===Op&&Fp(i.charCodeAt(0))&&(e=n=2);for(let a=i.length-1;a>=e;--a){const l=i.charCodeAt(a);if(li(l)){if(!r){n=a+1;break}continue}o===-1&&(r=!1,o=a+1),l===Um?t===-1?t=a:s!==1&&(s=1):t!==-1&&(s=-1)}return t===-1||o===-1||s===0||s===1&&t===o-1&&t===n+1?"":i.slice(t,o)},format:S_e.bind(null,"\\"),parse(i){wr(i,"path");const e={root:"",dir:"",base:"",ext:"",name:""};if(i.length===0)return e;const t=i.length;let n=0,o=i.charCodeAt(0);if(t===1)return li(o)?(e.root=e.dir=i,e):(e.base=e.name=i,e);if(li(o)){if(n=1,li(i.charCodeAt(1))){let d=2,h=d;for(;d0&&(e.root=i.slice(0,n));let r=-1,s=n,a=-1,l=!0,c=i.length-1,u=0;for(;c>=n;--c){if(o=i.charCodeAt(c),li(o)){if(!l){s=c+1;break}continue}a===-1&&(l=!1,a=c+1),o===Um?r===-1?r=c:u!==1&&(u=1):r!==-1&&(u=-1)}return a!==-1&&(r===-1||u===0||u===1&&r===a-1&&r===s+1?e.base=e.name=i.slice(s,a):(e.name=i.slice(s,r),e.base=i.slice(s,a),e.ext=i.slice(r,a))),s>0&&s!==n?e.dir=i.slice(0,s-1):e.dir=e.root,e},sep:"\\",delimiter:";",win32:null,posix:null},FYe=(()=>{if(Xv){const i=/\\/g;return()=>{const e=AA().replace(i,"/");return e.slice(e.indexOf("/"))}}return()=>AA()})(),Go={resolve(...i){let e="",t=!1;for(let n=i.length-1;n>=-1&&!t;n--){const o=n>=0?i[n]:FYe();wr(o,"path"),o.length!==0&&(e=`${o}/${e}`,t=o.charCodeAt(0)===As)}return e=PA(e,!t,"/",jW),t?`/${e}`:e.length>0?e:"."},normalize(i){if(wr(i,"path"),i.length===0)return".";const e=i.charCodeAt(0)===As,t=i.charCodeAt(i.length-1)===As;return i=PA(i,!e,"/",jW),i.length===0?e?"/":t?"./":".":(t&&(i+="/"),e?`/${i}`:i)},isAbsolute(i){return wr(i,"path"),i.length>0&&i.charCodeAt(0)===As},join(...i){if(i.length===0)return".";let e;for(let t=0;t0&&(e===void 0?e=n:e+=`/${n}`)}return e===void 0?".":Go.normalize(e)},relative(i,e){if(wr(i,"from"),wr(e,"to"),i===e||(i=Go.resolve(i),e=Go.resolve(e),i===e))return"";const t=1,n=i.length,o=n-t,r=1,s=e.length-r,a=oa){if(e.charCodeAt(r+c)===As)return e.slice(r+c+1);if(c===0)return e.slice(r+c)}else o>a&&(i.charCodeAt(t+c)===As?l=c:c===0&&(l=0));let u="";for(c=t+l+1;c<=n;++c)(c===n||i.charCodeAt(c)===As)&&(u+=u.length===0?"..":"/..");return`${u}${e.slice(r+l)}`},toNamespacedPath(i){return i},dirname(i){if(wr(i,"path"),i.length===0)return".";const e=i.charCodeAt(0)===As;let t=-1,n=!0;for(let o=i.length-1;o>=1;--o)if(i.charCodeAt(o)===As){if(!n){t=o;break}}else n=!1;return t===-1?e?"/":".":e&&t===1?"//":i.slice(0,t)},basename(i,e){e!==void 0&&wr(e,"ext"),wr(i,"path");let t=0,n=-1,o=!0,r;if(e!==void 0&&e.length>0&&e.length<=i.length){if(e===i)return"";let s=e.length-1,a=-1;for(r=i.length-1;r>=0;--r){const l=i.charCodeAt(r);if(l===As){if(!o){t=r+1;break}}else a===-1&&(o=!1,a=r+1),s>=0&&(l===e.charCodeAt(s)?--s===-1&&(n=r):(s=-1,n=a))}return t===n?n=a:n===-1&&(n=i.length),i.slice(t,n)}for(r=i.length-1;r>=0;--r)if(i.charCodeAt(r)===As){if(!o){t=r+1;break}}else n===-1&&(o=!1,n=r+1);return n===-1?"":i.slice(t,n)},extname(i){wr(i,"path");let e=-1,t=0,n=-1,o=!0,r=0;for(let s=i.length-1;s>=0;--s){const a=i.charCodeAt(s);if(a===As){if(!o){t=s+1;break}continue}n===-1&&(o=!1,n=s+1),a===Um?e===-1?e=s:r!==1&&(r=1):e!==-1&&(r=-1)}return e===-1||n===-1||r===0||r===1&&e===n-1&&e===t+1?"":i.slice(e,n)},format:S_e.bind(null,"/"),parse(i){wr(i,"path");const e={root:"",dir:"",base:"",ext:"",name:""};if(i.length===0)return e;const t=i.charCodeAt(0)===As;let n;t?(e.root="/",n=1):n=0;let o=-1,r=0,s=-1,a=!0,l=i.length-1,c=0;for(;l>=n;--l){const u=i.charCodeAt(l);if(u===As){if(!a){r=l+1;break}continue}s===-1&&(a=!1,s=l+1),u===Um?o===-1?o=l:c!==1&&(c=1):o!==-1&&(c=-1)}if(s!==-1){const u=r===0&&t?1:r;o===-1||c===0||c===1&&o===s-1&&o===r+1?e.base=e.name=i.slice(u,s):(e.name=i.slice(u,o),e.base=i.slice(u,s),e.ext=i.slice(o,s))}return r>0?e.dir=i.slice(0,r-1):t&&(e.dir="/"),e},sep:"/",delimiter:":",win32:null,posix:null};Go.win32=il.win32=il;Go.posix=il.posix=Go;const x_e=Xv?il.normalize:Go.normalize,BYe=Xv?il.resolve:Go.resolve,WYe=Xv?il.relative:Go.relative,L_e=Xv?il.dirname:Go.dirname,jm=Xv?il.basename:Go.basename,VYe=Xv?il.extname:Go.extname,Bd=Xv?il.sep:Go.sep,HYe=/^\w[\w\d+.-]*$/,$Ye=/^\//,zYe=/^\/\//;function UYe(i,e){if(!i.scheme&&e)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${i.authority}", path: "${i.path}", query: "${i.query}", fragment: "${i.fragment}"}`);if(i.scheme&&!HYe.test(i.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(i.path){if(i.authority){if(!$Ye.test(i.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(zYe.test(i.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}function jYe(i,e){return!i&&!e?"file":i}function KYe(i,e){switch(i){case"https":case"http":case"file":e?e[0]!==Cd&&(e=Cd+e):e=Cd;break}return e}const ko="",Cd="/",qYe=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class Rt{static isUri(e){return e instanceof Rt?!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,n,o,r,s=!1){typeof e=="object"?(this.scheme=e.scheme||ko,this.authority=e.authority||ko,this.path=e.path||ko,this.query=e.query||ko,this.fragment=e.fragment||ko):(this.scheme=jYe(e,s),this.authority=t||ko,this.path=KYe(this.scheme,n||ko),this.query=o||ko,this.fragment=r||ko,UYe(this,s))}get fsPath(){return OA(this,!1)}with(e){if(!e)return this;let{scheme:t,authority:n,path:o,query:r,fragment:s}=e;return t===void 0?t=this.scheme:t===null&&(t=ko),n===void 0?n=this.authority:n===null&&(n=ko),o===void 0?o=this.path:o===null&&(o=ko),r===void 0?r=this.query:r===null&&(r=ko),s===void 0?s=this.fragment:s===null&&(s=ko),t===this.scheme&&n===this.authority&&o===this.path&&r===this.query&&s===this.fragment?this:new F1(t,n,o,r,s)}static parse(e,t=!1){const n=qYe.exec(e);return n?new F1(n[2]||ko,QN(n[4]||ko),QN(n[5]||ko),QN(n[7]||ko),QN(n[9]||ko),t):new F1(ko,ko,ko,ko,ko)}static file(e){let t=ko;if(as&&(e=e.replace(/\\/g,Cd)),e[0]===Cd&&e[1]===Cd){const n=e.indexOf(Cd,2);n===-1?(t=e.substring(2),e=Cd):(t=e.substring(2,n),e=e.substring(n)||Cd)}return new F1("file",t,e,ko,ko)}static from(e,t){return new F1(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 n;return as&&e.scheme==="file"?n=Rt.file(il.join(OA(e,!0),...t)).path:n=Go.join(e.path,...t),e.with({path:n})}toString(e=!1){return KW(this,e)}toJSON(){return this}static revive(e){var t,n;if(e){if(e instanceof Rt)return e;{const o=new F1(e);return o._formatted=(t=e.external)!==null&&t!==void 0?t:null,o._fsPath=e._sep===E_e&&(n=e.fsPath)!==null&&n!==void 0?n:null,o}}else return e}}const E_e=as?1:void 0;class F1 extends Rt{constructor(){super(...arguments),this._formatted=null,this._fsPath=null}get fsPath(){return this._fsPath||(this._fsPath=OA(this,!1)),this._fsPath}toString(e=!1){return e?KW(this,!0):(this._formatted||(this._formatted=KW(this,!1)),this._formatted)}toJSON(){const e={$mid:1};return this._fsPath&&(e.fsPath=this._fsPath,e._sep=E_e),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 D_e={[58]:"%3A",[47]:"%2F",[63]:"%3F",[35]:"%23",[91]:"%5B",[93]:"%5D",[64]:"%40",[33]:"%21",[36]:"%24",[38]:"%26",[39]:"%27",[40]:"%28",[41]:"%29",[42]:"%2A",[43]:"%2B",[44]:"%2C",[59]:"%3B",[61]:"%3D",[32]:"%20"};function noe(i,e,t){let n,o=-1;for(let r=0;r=97&&s<=122||s>=65&&s<=90||s>=48&&s<=57||s===45||s===46||s===95||s===126||e&&s===47||t&&s===91||t&&s===93||t&&s===58)o!==-1&&(n+=encodeURIComponent(i.substring(o,r)),o=-1),n!==void 0&&(n+=i.charAt(r));else{n===void 0&&(n=i.substr(0,r));const a=D_e[s];a!==void 0?(o!==-1&&(n+=encodeURIComponent(i.substring(o,r)),o=-1),n+=a):o===-1&&(o=r)}}return o!==-1&&(n+=encodeURIComponent(i.substring(o))),n!==void 0?n:i}function GYe(i){let e;for(let t=0;t1&&i.scheme==="file"?t=`//${i.authority}${i.path}`:i.path.charCodeAt(0)===47&&(i.path.charCodeAt(1)>=65&&i.path.charCodeAt(1)<=90||i.path.charCodeAt(1)>=97&&i.path.charCodeAt(1)<=122)&&i.path.charCodeAt(2)===58?e?t=i.path.substr(1):t=i.path[1].toLowerCase()+i.path.substr(2):t=i.path,as&&(t=t.replace(/\//g,"\\")),t}function KW(i,e){const t=e?GYe:noe;let n="",{scheme:o,authority:r,path:s,query:a,fragment:l}=i;if(o&&(n+=o,n+=":"),(r||o==="file")&&(n+=Cd,n+=Cd),r){let c=r.indexOf("@");if(c!==-1){const u=r.substr(0,c);r=r.substr(c+1),c=u.lastIndexOf(":"),c===-1?n+=t(u,!1,!1):(n+=t(u.substr(0,c),!1,!1),n+=":",n+=t(u.substr(c+1),!1,!0)),n+="@"}r=r.toLowerCase(),c=r.lastIndexOf(":"),c===-1?n+=t(r,!1,!0):(n+=t(r.substr(0,c),!1,!0),n+=r.substr(c))}if(s){if(s.length>=3&&s.charCodeAt(0)===47&&s.charCodeAt(2)===58){const c=s.charCodeAt(1);c>=65&&c<=90&&(s=`/${String.fromCharCode(c+32)}:${s.substr(3)}`)}else if(s.length>=2&&s.charCodeAt(1)===58){const c=s.charCodeAt(0);c>=65&&c<=90&&(s=`${String.fromCharCode(c+32)}:${s.substr(2)}`)}n+=t(s,!0,!1)}return a&&(n+="?",n+=t(a,!1,!1)),l&&(n+="#",n+=e?l:noe(l,!1,!1)),n}function k_e(i){try{return decodeURIComponent(i)}catch{return i.length>3?i.substr(0,3)+k_e(i.substr(3)):i}}const ioe=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function QN(i){return i.match(ioe)?i.replace(ioe,e=>k_e(e)):i}class ae{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 ae(e,t)}delta(e=0,t=0){return this.with(this.lineNumber+e,this.column+t)}equals(e){return ae.equals(this,e)}static equals(e,t){return!e&&!t?!0:!!e&&!!t&&e.lineNumber===t.lineNumber&&e.column===t.column}isBefore(e){return ae.isBefore(this,e)}static isBefore(e,t){return e.lineNumbern||e===n&&t>o?(this.startLineNumber=n,this.startColumn=o,this.endLineNumber=e,this.endColumn=t):(this.startLineNumber=e,this.startColumn=t,this.endLineNumber=n,this.endColumn=o)}isEmpty(){return V.isEmpty(this)}static isEmpty(e){return e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn}containsPosition(e){return V.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 V.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 V.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 V.plusRange(this,e)}static plusRange(e,t){let n,o,r,s;return t.startLineNumbere.endLineNumber?(r=t.endLineNumber,s=t.endColumn):t.endLineNumber===e.endLineNumber?(r=t.endLineNumber,s=Math.max(t.endColumn,e.endColumn)):(r=e.endLineNumber,s=e.endColumn),new V(n,o,r,s)}intersectRanges(e){return V.intersectRanges(this,e)}static intersectRanges(e,t){let n=e.startLineNumber,o=e.startColumn,r=e.endLineNumber,s=e.endColumn;const a=t.startLineNumber,l=t.startColumn,c=t.endLineNumber,u=t.endColumn;return nc?(r=c,s=u):r===c&&(s=Math.min(s,u)),n>r||n===r&&o>s?null:new V(n,o,r,s)}equalsRange(e){return V.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 V.getEndPosition(this)}static getEndPosition(e){return new ae(e.endLineNumber,e.endColumn)}getStartPosition(){return V.getStartPosition(this)}static getStartPosition(e){return new ae(e.startLineNumber,e.startColumn)}toString(){return"["+this.startLineNumber+","+this.startColumn+" -> "+this.endLineNumber+","+this.endColumn+"]"}setEndPosition(e,t){return new V(this.startLineNumber,this.startColumn,e,t)}setStartPosition(e,t){return new V(e,t,this.endLineNumber,this.endColumn)}collapseToStart(){return V.collapseToStart(this)}static collapseToStart(e){return new V(e.startLineNumber,e.startColumn,e.startLineNumber,e.startColumn)}collapseToEnd(){return V.collapseToEnd(this)}static collapseToEnd(e){return new V(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn)}delta(e){return new V(this.startLineNumber+e,this.startColumn,this.endLineNumber+e,this.endColumn)}static fromPositions(e,t=e){return new V(e.lineNumber,e.column,t.lineNumber,t.column)}static lift(e){return e?new V(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}}class gt extends V{constructor(e,t,n,o){super(e,t,n,o),this.selectionStartLineNumber=e,this.selectionStartColumn=t,this.positionLineNumber=n,this.positionColumn=o}toString(){return"["+this.selectionStartLineNumber+","+this.selectionStartColumn+" -> "+this.positionLineNumber+","+this.positionColumn+"]"}equalsSelection(e){return gt.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?0:1}setEndPosition(e,t){return this.getDirection()===0?new gt(this.startLineNumber,this.startColumn,e,t):new gt(e,t,this.startLineNumber,this.startColumn)}getPosition(){return new ae(this.positionLineNumber,this.positionColumn)}getSelectionStart(){return new ae(this.selectionStartLineNumber,this.selectionStartColumn)}setStartPosition(e,t){return this.getDirection()===0?new gt(e,t,this.endLineNumber,this.endColumn):new gt(this.endLineNumber,this.endColumn,e,t)}static fromPositions(e,t=e){return new gt(e.lineNumber,e.column,t.lineNumber,t.column)}static fromRange(e,t){return t===0?new gt(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn):new gt(e.endLineNumber,e.endColumn,e.startLineNumber,e.startColumn)}static liftSelection(e){return new gt(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 n=0,o=e.length;n{this._tokenizationSupports.get(e)===t&&(this._tokenizationSupports.delete(e),this.handleChange([e]))})}get(e){return this._tokenizationSupports.get(e)||null}registerFactory(e,t){var n;(n=this._factories.get(e))===null||n===void 0||n.dispose();const o=new YYe(this,e,t);return this._factories.set(e,o),zt(()=>{const r=this._factories.get(e);!r||r!==o||(this._factories.delete(e),r.dispose())})}getOrCreate(e){return GW(this,void 0,void 0,function*(){const t=this.get(e);if(t)return t;const n=this._factories.get(e);return!n||n.isResolved?null:(yield n.resolve(),this.get(e))})}isResolved(e){if(this.get(e))return!0;const n=this._factories.get(e);return!!(!n||n.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>2?this._colorMap[2]:null}}class YYe extends _e{get isResolved(){return this._isResolved}constructor(e,t,n){super(),this._registry=e,this._languageId=t,this._factory=n,this._isDisposed=!1,this._resolvePromise=null,this._isResolved=!1}dispose(){this._isDisposed=!0,super.dispose()}resolve(){return GW(this,void 0,void 0,function*(){return this._resolvePromise||(this._resolvePromise=this._create()),this._resolvePromise})}_create(){return GW(this,void 0,void 0,function*(){const e=yield this._factory.tokenizationSupport;this._isResolved=!0,e&&!this._isDisposed&&this._register(this._registry.register(this._languageId,e))})}}class ID{constructor(e,t,n){this.offset=e,this.type=t,this.language=n,this._tokenBrand=void 0}toString(){return"("+this.offset+", "+this.type+")"}}class Bq{constructor(e,t){this.tokens=e,this.endState=t,this._tokenizationResultBrand=void 0}}class V4{constructor(e,t){this.tokens=e,this.endState=t,this._encodedTokenizationResultBrand=void 0}}var TD;(function(i){const e=new Map;e.set(0,Xe.symbolMethod),e.set(1,Xe.symbolFunction),e.set(2,Xe.symbolConstructor),e.set(3,Xe.symbolField),e.set(4,Xe.symbolVariable),e.set(5,Xe.symbolClass),e.set(6,Xe.symbolStruct),e.set(7,Xe.symbolInterface),e.set(8,Xe.symbolModule),e.set(9,Xe.symbolProperty),e.set(10,Xe.symbolEvent),e.set(11,Xe.symbolOperator),e.set(12,Xe.symbolUnit),e.set(13,Xe.symbolValue),e.set(15,Xe.symbolEnum),e.set(14,Xe.symbolConstant),e.set(15,Xe.symbolEnum),e.set(16,Xe.symbolEnumMember),e.set(17,Xe.symbolKeyword),e.set(27,Xe.symbolSnippet),e.set(18,Xe.symbolText),e.set(19,Xe.symbolColor),e.set(20,Xe.symbolFile),e.set(21,Xe.symbolReference),e.set(22,Xe.symbolCustomColor),e.set(23,Xe.symbolFolder),e.set(24,Xe.symbolTypeParameter),e.set(25,Xe.account),e.set(26,Xe.issues);function t(r){let s=e.get(r);return s||(console.info("No codicon found for CompletionItemKind "+r),s=Xe.symbolProperty),s}i.toIcon=t;const n=new Map;n.set("method",0),n.set("function",1),n.set("constructor",2),n.set("field",3),n.set("variable",4),n.set("class",5),n.set("struct",6),n.set("interface",7),n.set("module",8),n.set("property",9),n.set("event",10),n.set("operator",11),n.set("unit",12),n.set("value",13),n.set("constant",14),n.set("enum",15),n.set("enum-member",16),n.set("enumMember",16),n.set("keyword",17),n.set("snippet",27),n.set("text",18),n.set("color",19),n.set("file",20),n.set("reference",21),n.set("customcolor",22),n.set("folder",23),n.set("type-parameter",24),n.set("typeParameter",24),n.set("account",25),n.set("issue",26);function o(r,s){let a=n.get(r);return typeof a=="undefined"&&!s&&(a=9),a}i.fromString=o})(TD||(TD={}));var Ug;(function(i){i[i.Automatic=0]="Automatic",i[i.Explicit=1]="Explicit"})(Ug||(Ug={}));class T_e{constructor(e,t,n,o){this.range=e,this.text=t,this.completionKind=n,this.isSnippetText=o}equals(e){return V.lift(this.range).equalsRange(e.range)&&this.text===e.text&&this.completionKind===e.completionKind&&this.isSnippetText===e.isSnippetText}}var sf;(function(i){i[i.Invoke=1]="Invoke",i[i.TriggerCharacter=2]="TriggerCharacter",i[i.ContentChange=3]="ContentChange"})(sf||(sf={}));var ND;(function(i){i[i.Text=0]="Text",i[i.Read=1]="Read",i[i.Write=2]="Write"})(ND||(ND={}));function ZYe(i){return i&&Rt.isUri(i.uri)&&V.isIRange(i.range)&&(V.isIRange(i.originSelectionRange)||V.isIRange(i.targetSelectionRange))}const QYe={[17]:C("Array","array"),[16]:C("Boolean","boolean"),[4]:C("Class","class"),[13]:C("Constant","constant"),[8]:C("Constructor","constructor"),[9]:C("Enum","enumeration"),[21]:C("EnumMember","enumeration member"),[23]:C("Event","event"),[7]:C("Field","field"),[0]:C("File","file"),[11]:C("Function","function"),[10]:C("Interface","interface"),[19]:C("Key","key"),[5]:C("Method","method"),[1]:C("Module","module"),[2]:C("Namespace","namespace"),[20]:C("Null","null"),[15]:C("Number","number"),[18]:C("Object","object"),[24]:C("Operator","operator"),[3]:C("Package","package"),[6]:C("Property","property"),[14]:C("String","string"),[22]:C("Struct","struct"),[25]:C("TypeParameter","type parameter"),[12]:C("Variable","variable")};function JYe(i,e){return C("symbolAriaLabel","{0} ({1})",i,QYe[e])}var FA;(function(i){const e=new Map;e.set(0,Xe.symbolFile),e.set(1,Xe.symbolModule),e.set(2,Xe.symbolNamespace),e.set(3,Xe.symbolPackage),e.set(4,Xe.symbolClass),e.set(5,Xe.symbolMethod),e.set(6,Xe.symbolProperty),e.set(7,Xe.symbolField),e.set(8,Xe.symbolConstructor),e.set(9,Xe.symbolEnum),e.set(10,Xe.symbolInterface),e.set(11,Xe.symbolFunction),e.set(12,Xe.symbolVariable),e.set(13,Xe.symbolConstant),e.set(14,Xe.symbolString),e.set(15,Xe.symbolNumber),e.set(16,Xe.symbolBoolean),e.set(17,Xe.symbolArray),e.set(18,Xe.symbolObject),e.set(19,Xe.symbolKey),e.set(20,Xe.symbolNull),e.set(21,Xe.symbolEnumMember),e.set(22,Xe.symbolStruct),e.set(23,Xe.symbolEvent),e.set(24,Xe.symbolOperator),e.set(25,Xe.symbolTypeParameter);function t(n){let o=e.get(n);return o||(console.info("No codicon found for SymbolKind "+n),o=Xe.symbolProperty),o}i.toIcon=t})(FA||(FA={}));class oa{static fromValue(e){switch(e){case"comment":return oa.Comment;case"imports":return oa.Imports;case"region":return oa.Region}return new oa(e)}constructor(e){this.value=e}}oa.Comment=new oa("comment");oa.Imports=new oa("imports");oa.Region=new oa("region");var XW;(function(i){function e(t){return!t||typeof t!="object"?!1:typeof t.id=="string"&&typeof t.title=="string"}i.is=e})(XW||(XW={}));var BA;(function(i){i[i.Type=1]="Type",i[i.Parameter=2]="Parameter"})(BA||(BA={}));class eZe{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 oo=new XYe;var YW;(function(i){i[i.Unknown=0]="Unknown",i[i.Disabled=1]="Disabled",i[i.Enabled=2]="Enabled"})(YW||(YW={}));var ZW;(function(i){i[i.Invoke=1]="Invoke",i[i.Auto=2]="Auto"})(ZW||(ZW={}));var QW;(function(i){i[i.None=0]="None",i[i.KeepWhitespace=1]="KeepWhitespace",i[i.InsertAsSnippet=4]="InsertAsSnippet"})(QW||(QW={}));var JW;(function(i){i[i.Method=0]="Method",i[i.Function=1]="Function",i[i.Constructor=2]="Constructor",i[i.Field=3]="Field",i[i.Variable=4]="Variable",i[i.Class=5]="Class",i[i.Struct=6]="Struct",i[i.Interface=7]="Interface",i[i.Module=8]="Module",i[i.Property=9]="Property",i[i.Event=10]="Event",i[i.Operator=11]="Operator",i[i.Unit=12]="Unit",i[i.Value=13]="Value",i[i.Constant=14]="Constant",i[i.Enum=15]="Enum",i[i.EnumMember=16]="EnumMember",i[i.Keyword=17]="Keyword",i[i.Text=18]="Text",i[i.Color=19]="Color",i[i.File=20]="File",i[i.Reference=21]="Reference",i[i.Customcolor=22]="Customcolor",i[i.Folder=23]="Folder",i[i.TypeParameter=24]="TypeParameter",i[i.User=25]="User",i[i.Issue=26]="Issue",i[i.Snippet=27]="Snippet"})(JW||(JW={}));var eV;(function(i){i[i.Deprecated=1]="Deprecated"})(eV||(eV={}));var tV;(function(i){i[i.Invoke=0]="Invoke",i[i.TriggerCharacter=1]="TriggerCharacter",i[i.TriggerForIncompleteCompletions=2]="TriggerForIncompleteCompletions"})(tV||(tV={}));var nV;(function(i){i[i.EXACT=0]="EXACT",i[i.ABOVE=1]="ABOVE",i[i.BELOW=2]="BELOW"})(nV||(nV={}));var iV;(function(i){i[i.NotSet=0]="NotSet",i[i.ContentFlush=1]="ContentFlush",i[i.RecoverFromMarkers=2]="RecoverFromMarkers",i[i.Explicit=3]="Explicit",i[i.Paste=4]="Paste",i[i.Undo=5]="Undo",i[i.Redo=6]="Redo"})(iV||(iV={}));var oV;(function(i){i[i.LF=1]="LF",i[i.CRLF=2]="CRLF"})(oV||(oV={}));var rV;(function(i){i[i.Text=0]="Text",i[i.Read=1]="Read",i[i.Write=2]="Write"})(rV||(rV={}));var sV;(function(i){i[i.None=0]="None",i[i.Keep=1]="Keep",i[i.Brackets=2]="Brackets",i[i.Advanced=3]="Advanced",i[i.Full=4]="Full"})(sV||(sV={}));var aV;(function(i){i[i.acceptSuggestionOnCommitCharacter=0]="acceptSuggestionOnCommitCharacter",i[i.acceptSuggestionOnEnter=1]="acceptSuggestionOnEnter",i[i.accessibilitySupport=2]="accessibilitySupport",i[i.accessibilityPageSize=3]="accessibilityPageSize",i[i.ariaLabel=4]="ariaLabel",i[i.ariaRequired=5]="ariaRequired",i[i.autoClosingBrackets=6]="autoClosingBrackets",i[i.autoClosingComments=7]="autoClosingComments",i[i.screenReaderAnnounceInlineSuggestion=8]="screenReaderAnnounceInlineSuggestion",i[i.autoClosingDelete=9]="autoClosingDelete",i[i.autoClosingOvertype=10]="autoClosingOvertype",i[i.autoClosingQuotes=11]="autoClosingQuotes",i[i.autoIndent=12]="autoIndent",i[i.automaticLayout=13]="automaticLayout",i[i.autoSurround=14]="autoSurround",i[i.bracketPairColorization=15]="bracketPairColorization",i[i.guides=16]="guides",i[i.codeLens=17]="codeLens",i[i.codeLensFontFamily=18]="codeLensFontFamily",i[i.codeLensFontSize=19]="codeLensFontSize",i[i.colorDecorators=20]="colorDecorators",i[i.colorDecoratorsLimit=21]="colorDecoratorsLimit",i[i.columnSelection=22]="columnSelection",i[i.comments=23]="comments",i[i.contextmenu=24]="contextmenu",i[i.copyWithSyntaxHighlighting=25]="copyWithSyntaxHighlighting",i[i.cursorBlinking=26]="cursorBlinking",i[i.cursorSmoothCaretAnimation=27]="cursorSmoothCaretAnimation",i[i.cursorStyle=28]="cursorStyle",i[i.cursorSurroundingLines=29]="cursorSurroundingLines",i[i.cursorSurroundingLinesStyle=30]="cursorSurroundingLinesStyle",i[i.cursorWidth=31]="cursorWidth",i[i.disableLayerHinting=32]="disableLayerHinting",i[i.disableMonospaceOptimizations=33]="disableMonospaceOptimizations",i[i.domReadOnly=34]="domReadOnly",i[i.dragAndDrop=35]="dragAndDrop",i[i.dropIntoEditor=36]="dropIntoEditor",i[i.emptySelectionClipboard=37]="emptySelectionClipboard",i[i.experimentalWhitespaceRendering=38]="experimentalWhitespaceRendering",i[i.extraEditorClassName=39]="extraEditorClassName",i[i.fastScrollSensitivity=40]="fastScrollSensitivity",i[i.find=41]="find",i[i.fixedOverflowWidgets=42]="fixedOverflowWidgets",i[i.folding=43]="folding",i[i.foldingStrategy=44]="foldingStrategy",i[i.foldingHighlight=45]="foldingHighlight",i[i.foldingImportsByDefault=46]="foldingImportsByDefault",i[i.foldingMaximumRegions=47]="foldingMaximumRegions",i[i.unfoldOnClickAfterEndOfLine=48]="unfoldOnClickAfterEndOfLine",i[i.fontFamily=49]="fontFamily",i[i.fontInfo=50]="fontInfo",i[i.fontLigatures=51]="fontLigatures",i[i.fontSize=52]="fontSize",i[i.fontWeight=53]="fontWeight",i[i.fontVariations=54]="fontVariations",i[i.formatOnPaste=55]="formatOnPaste",i[i.formatOnType=56]="formatOnType",i[i.glyphMargin=57]="glyphMargin",i[i.gotoLocation=58]="gotoLocation",i[i.hideCursorInOverviewRuler=59]="hideCursorInOverviewRuler",i[i.hover=60]="hover",i[i.inDiffEditor=61]="inDiffEditor",i[i.inlineSuggest=62]="inlineSuggest",i[i.letterSpacing=63]="letterSpacing",i[i.lightbulb=64]="lightbulb",i[i.lineDecorationsWidth=65]="lineDecorationsWidth",i[i.lineHeight=66]="lineHeight",i[i.lineNumbers=67]="lineNumbers",i[i.lineNumbersMinChars=68]="lineNumbersMinChars",i[i.linkedEditing=69]="linkedEditing",i[i.links=70]="links",i[i.matchBrackets=71]="matchBrackets",i[i.minimap=72]="minimap",i[i.mouseStyle=73]="mouseStyle",i[i.mouseWheelScrollSensitivity=74]="mouseWheelScrollSensitivity",i[i.mouseWheelZoom=75]="mouseWheelZoom",i[i.multiCursorMergeOverlapping=76]="multiCursorMergeOverlapping",i[i.multiCursorModifier=77]="multiCursorModifier",i[i.multiCursorPaste=78]="multiCursorPaste",i[i.multiCursorLimit=79]="multiCursorLimit",i[i.occurrencesHighlight=80]="occurrencesHighlight",i[i.overviewRulerBorder=81]="overviewRulerBorder",i[i.overviewRulerLanes=82]="overviewRulerLanes",i[i.padding=83]="padding",i[i.pasteAs=84]="pasteAs",i[i.parameterHints=85]="parameterHints",i[i.peekWidgetDefaultFocus=86]="peekWidgetDefaultFocus",i[i.definitionLinkOpensInPeek=87]="definitionLinkOpensInPeek",i[i.quickSuggestions=88]="quickSuggestions",i[i.quickSuggestionsDelay=89]="quickSuggestionsDelay",i[i.readOnly=90]="readOnly",i[i.readOnlyMessage=91]="readOnlyMessage",i[i.renameOnType=92]="renameOnType",i[i.renderControlCharacters=93]="renderControlCharacters",i[i.renderFinalNewline=94]="renderFinalNewline",i[i.renderLineHighlight=95]="renderLineHighlight",i[i.renderLineHighlightOnlyWhenFocus=96]="renderLineHighlightOnlyWhenFocus",i[i.renderValidationDecorations=97]="renderValidationDecorations",i[i.renderWhitespace=98]="renderWhitespace",i[i.revealHorizontalRightPadding=99]="revealHorizontalRightPadding",i[i.roundedSelection=100]="roundedSelection",i[i.rulers=101]="rulers",i[i.scrollbar=102]="scrollbar",i[i.scrollBeyondLastColumn=103]="scrollBeyondLastColumn",i[i.scrollBeyondLastLine=104]="scrollBeyondLastLine",i[i.scrollPredominantAxis=105]="scrollPredominantAxis",i[i.selectionClipboard=106]="selectionClipboard",i[i.selectionHighlight=107]="selectionHighlight",i[i.selectOnLineNumbers=108]="selectOnLineNumbers",i[i.showFoldingControls=109]="showFoldingControls",i[i.showUnused=110]="showUnused",i[i.snippetSuggestions=111]="snippetSuggestions",i[i.smartSelect=112]="smartSelect",i[i.smoothScrolling=113]="smoothScrolling",i[i.stickyScroll=114]="stickyScroll",i[i.stickyTabStops=115]="stickyTabStops",i[i.stopRenderingLineAfter=116]="stopRenderingLineAfter",i[i.suggest=117]="suggest",i[i.suggestFontSize=118]="suggestFontSize",i[i.suggestLineHeight=119]="suggestLineHeight",i[i.suggestOnTriggerCharacters=120]="suggestOnTriggerCharacters",i[i.suggestSelection=121]="suggestSelection",i[i.tabCompletion=122]="tabCompletion",i[i.tabIndex=123]="tabIndex",i[i.unicodeHighlighting=124]="unicodeHighlighting",i[i.unusualLineTerminators=125]="unusualLineTerminators",i[i.useShadowDOM=126]="useShadowDOM",i[i.useTabStops=127]="useTabStops",i[i.wordBreak=128]="wordBreak",i[i.wordSeparators=129]="wordSeparators",i[i.wordWrap=130]="wordWrap",i[i.wordWrapBreakAfterCharacters=131]="wordWrapBreakAfterCharacters",i[i.wordWrapBreakBeforeCharacters=132]="wordWrapBreakBeforeCharacters",i[i.wordWrapColumn=133]="wordWrapColumn",i[i.wordWrapOverride1=134]="wordWrapOverride1",i[i.wordWrapOverride2=135]="wordWrapOverride2",i[i.wrappingIndent=136]="wrappingIndent",i[i.wrappingStrategy=137]="wrappingStrategy",i[i.showDeprecated=138]="showDeprecated",i[i.inlayHints=139]="inlayHints",i[i.editorClassName=140]="editorClassName",i[i.pixelRatio=141]="pixelRatio",i[i.tabFocusMode=142]="tabFocusMode",i[i.layoutInfo=143]="layoutInfo",i[i.wrappingInfo=144]="wrappingInfo",i[i.defaultColorDecorators=145]="defaultColorDecorators",i[i.colorDecoratorsActivatedOn=146]="colorDecoratorsActivatedOn",i[i.inlineCompletionsAccessibilityVerbose=147]="inlineCompletionsAccessibilityVerbose"})(aV||(aV={}));var lV;(function(i){i[i.TextDefined=0]="TextDefined",i[i.LF=1]="LF",i[i.CRLF=2]="CRLF"})(lV||(lV={}));var cV;(function(i){i[i.LF=0]="LF",i[i.CRLF=1]="CRLF"})(cV||(cV={}));var uV;(function(i){i[i.Left=1]="Left",i[i.Right=2]="Right"})(uV||(uV={}));var dV;(function(i){i[i.None=0]="None",i[i.Indent=1]="Indent",i[i.IndentOutdent=2]="IndentOutdent",i[i.Outdent=3]="Outdent"})(dV||(dV={}));var hV;(function(i){i[i.Both=0]="Both",i[i.Right=1]="Right",i[i.Left=2]="Left",i[i.None=3]="None"})(hV||(hV={}));var fV;(function(i){i[i.Type=1]="Type",i[i.Parameter=2]="Parameter"})(fV||(fV={}));var gV;(function(i){i[i.Automatic=0]="Automatic",i[i.Explicit=1]="Explicit"})(gV||(gV={}));var pV;(function(i){i[i.DependsOnKbLayout=-1]="DependsOnKbLayout",i[i.Unknown=0]="Unknown",i[i.Backspace=1]="Backspace",i[i.Tab=2]="Tab",i[i.Enter=3]="Enter",i[i.Shift=4]="Shift",i[i.Ctrl=5]="Ctrl",i[i.Alt=6]="Alt",i[i.PauseBreak=7]="PauseBreak",i[i.CapsLock=8]="CapsLock",i[i.Escape=9]="Escape",i[i.Space=10]="Space",i[i.PageUp=11]="PageUp",i[i.PageDown=12]="PageDown",i[i.End=13]="End",i[i.Home=14]="Home",i[i.LeftArrow=15]="LeftArrow",i[i.UpArrow=16]="UpArrow",i[i.RightArrow=17]="RightArrow",i[i.DownArrow=18]="DownArrow",i[i.Insert=19]="Insert",i[i.Delete=20]="Delete",i[i.Digit0=21]="Digit0",i[i.Digit1=22]="Digit1",i[i.Digit2=23]="Digit2",i[i.Digit3=24]="Digit3",i[i.Digit4=25]="Digit4",i[i.Digit5=26]="Digit5",i[i.Digit6=27]="Digit6",i[i.Digit7=28]="Digit7",i[i.Digit8=29]="Digit8",i[i.Digit9=30]="Digit9",i[i.KeyA=31]="KeyA",i[i.KeyB=32]="KeyB",i[i.KeyC=33]="KeyC",i[i.KeyD=34]="KeyD",i[i.KeyE=35]="KeyE",i[i.KeyF=36]="KeyF",i[i.KeyG=37]="KeyG",i[i.KeyH=38]="KeyH",i[i.KeyI=39]="KeyI",i[i.KeyJ=40]="KeyJ",i[i.KeyK=41]="KeyK",i[i.KeyL=42]="KeyL",i[i.KeyM=43]="KeyM",i[i.KeyN=44]="KeyN",i[i.KeyO=45]="KeyO",i[i.KeyP=46]="KeyP",i[i.KeyQ=47]="KeyQ",i[i.KeyR=48]="KeyR",i[i.KeyS=49]="KeyS",i[i.KeyT=50]="KeyT",i[i.KeyU=51]="KeyU",i[i.KeyV=52]="KeyV",i[i.KeyW=53]="KeyW",i[i.KeyX=54]="KeyX",i[i.KeyY=55]="KeyY",i[i.KeyZ=56]="KeyZ",i[i.Meta=57]="Meta",i[i.ContextMenu=58]="ContextMenu",i[i.F1=59]="F1",i[i.F2=60]="F2",i[i.F3=61]="F3",i[i.F4=62]="F4",i[i.F5=63]="F5",i[i.F6=64]="F6",i[i.F7=65]="F7",i[i.F8=66]="F8",i[i.F9=67]="F9",i[i.F10=68]="F10",i[i.F11=69]="F11",i[i.F12=70]="F12",i[i.F13=71]="F13",i[i.F14=72]="F14",i[i.F15=73]="F15",i[i.F16=74]="F16",i[i.F17=75]="F17",i[i.F18=76]="F18",i[i.F19=77]="F19",i[i.F20=78]="F20",i[i.F21=79]="F21",i[i.F22=80]="F22",i[i.F23=81]="F23",i[i.F24=82]="F24",i[i.NumLock=83]="NumLock",i[i.ScrollLock=84]="ScrollLock",i[i.Semicolon=85]="Semicolon",i[i.Equal=86]="Equal",i[i.Comma=87]="Comma",i[i.Minus=88]="Minus",i[i.Period=89]="Period",i[i.Slash=90]="Slash",i[i.Backquote=91]="Backquote",i[i.BracketLeft=92]="BracketLeft",i[i.Backslash=93]="Backslash",i[i.BracketRight=94]="BracketRight",i[i.Quote=95]="Quote",i[i.OEM_8=96]="OEM_8",i[i.IntlBackslash=97]="IntlBackslash",i[i.Numpad0=98]="Numpad0",i[i.Numpad1=99]="Numpad1",i[i.Numpad2=100]="Numpad2",i[i.Numpad3=101]="Numpad3",i[i.Numpad4=102]="Numpad4",i[i.Numpad5=103]="Numpad5",i[i.Numpad6=104]="Numpad6",i[i.Numpad7=105]="Numpad7",i[i.Numpad8=106]="Numpad8",i[i.Numpad9=107]="Numpad9",i[i.NumpadMultiply=108]="NumpadMultiply",i[i.NumpadAdd=109]="NumpadAdd",i[i.NUMPAD_SEPARATOR=110]="NUMPAD_SEPARATOR",i[i.NumpadSubtract=111]="NumpadSubtract",i[i.NumpadDecimal=112]="NumpadDecimal",i[i.NumpadDivide=113]="NumpadDivide",i[i.KEY_IN_COMPOSITION=114]="KEY_IN_COMPOSITION",i[i.ABNT_C1=115]="ABNT_C1",i[i.ABNT_C2=116]="ABNT_C2",i[i.AudioVolumeMute=117]="AudioVolumeMute",i[i.AudioVolumeUp=118]="AudioVolumeUp",i[i.AudioVolumeDown=119]="AudioVolumeDown",i[i.BrowserSearch=120]="BrowserSearch",i[i.BrowserHome=121]="BrowserHome",i[i.BrowserBack=122]="BrowserBack",i[i.BrowserForward=123]="BrowserForward",i[i.MediaTrackNext=124]="MediaTrackNext",i[i.MediaTrackPrevious=125]="MediaTrackPrevious",i[i.MediaStop=126]="MediaStop",i[i.MediaPlayPause=127]="MediaPlayPause",i[i.LaunchMediaPlayer=128]="LaunchMediaPlayer",i[i.LaunchMail=129]="LaunchMail",i[i.LaunchApp2=130]="LaunchApp2",i[i.Clear=131]="Clear",i[i.MAX_VALUE=132]="MAX_VALUE"})(pV||(pV={}));var mV;(function(i){i[i.Hint=1]="Hint",i[i.Info=2]="Info",i[i.Warning=4]="Warning",i[i.Error=8]="Error"})(mV||(mV={}));var vV;(function(i){i[i.Unnecessary=1]="Unnecessary",i[i.Deprecated=2]="Deprecated"})(vV||(vV={}));var _V;(function(i){i[i.Inline=1]="Inline",i[i.Gutter=2]="Gutter"})(_V||(_V={}));var bV;(function(i){i[i.UNKNOWN=0]="UNKNOWN",i[i.TEXTAREA=1]="TEXTAREA",i[i.GUTTER_GLYPH_MARGIN=2]="GUTTER_GLYPH_MARGIN",i[i.GUTTER_LINE_NUMBERS=3]="GUTTER_LINE_NUMBERS",i[i.GUTTER_LINE_DECORATIONS=4]="GUTTER_LINE_DECORATIONS",i[i.GUTTER_VIEW_ZONE=5]="GUTTER_VIEW_ZONE",i[i.CONTENT_TEXT=6]="CONTENT_TEXT",i[i.CONTENT_EMPTY=7]="CONTENT_EMPTY",i[i.CONTENT_VIEW_ZONE=8]="CONTENT_VIEW_ZONE",i[i.CONTENT_WIDGET=9]="CONTENT_WIDGET",i[i.OVERVIEW_RULER=10]="OVERVIEW_RULER",i[i.SCROLLBAR=11]="SCROLLBAR",i[i.OVERLAY_WIDGET=12]="OVERLAY_WIDGET",i[i.OUTSIDE_EDITOR=13]="OUTSIDE_EDITOR"})(bV||(bV={}));var CV;(function(i){i[i.TOP_RIGHT_CORNER=0]="TOP_RIGHT_CORNER",i[i.BOTTOM_RIGHT_CORNER=1]="BOTTOM_RIGHT_CORNER",i[i.TOP_CENTER=2]="TOP_CENTER"})(CV||(CV={}));var wV;(function(i){i[i.Left=1]="Left",i[i.Center=2]="Center",i[i.Right=4]="Right",i[i.Full=7]="Full"})(wV||(wV={}));var yV;(function(i){i[i.Left=0]="Left",i[i.Right=1]="Right",i[i.None=2]="None",i[i.LeftOfInjectedText=3]="LeftOfInjectedText",i[i.RightOfInjectedText=4]="RightOfInjectedText"})(yV||(yV={}));var SV;(function(i){i[i.Off=0]="Off",i[i.On=1]="On",i[i.Relative=2]="Relative",i[i.Interval=3]="Interval",i[i.Custom=4]="Custom"})(SV||(SV={}));var xV;(function(i){i[i.None=0]="None",i[i.Text=1]="Text",i[i.Blocks=2]="Blocks"})(xV||(xV={}));var LV;(function(i){i[i.Smooth=0]="Smooth",i[i.Immediate=1]="Immediate"})(LV||(LV={}));var EV;(function(i){i[i.Auto=1]="Auto",i[i.Hidden=2]="Hidden",i[i.Visible=3]="Visible"})(EV||(EV={}));var DV;(function(i){i[i.LTR=0]="LTR",i[i.RTL=1]="RTL"})(DV||(DV={}));var kV;(function(i){i[i.Invoke=1]="Invoke",i[i.TriggerCharacter=2]="TriggerCharacter",i[i.ContentChange=3]="ContentChange"})(kV||(kV={}));var IV;(function(i){i[i.File=0]="File",i[i.Module=1]="Module",i[i.Namespace=2]="Namespace",i[i.Package=3]="Package",i[i.Class=4]="Class",i[i.Method=5]="Method",i[i.Property=6]="Property",i[i.Field=7]="Field",i[i.Constructor=8]="Constructor",i[i.Enum=9]="Enum",i[i.Interface=10]="Interface",i[i.Function=11]="Function",i[i.Variable=12]="Variable",i[i.Constant=13]="Constant",i[i.String=14]="String",i[i.Number=15]="Number",i[i.Boolean=16]="Boolean",i[i.Array=17]="Array",i[i.Object=18]="Object",i[i.Key=19]="Key",i[i.Null=20]="Null",i[i.EnumMember=21]="EnumMember",i[i.Struct=22]="Struct",i[i.Event=23]="Event",i[i.Operator=24]="Operator",i[i.TypeParameter=25]="TypeParameter"})(IV||(IV={}));var TV;(function(i){i[i.Deprecated=1]="Deprecated"})(TV||(TV={}));var NV;(function(i){i[i.Hidden=0]="Hidden",i[i.Blink=1]="Blink",i[i.Smooth=2]="Smooth",i[i.Phase=3]="Phase",i[i.Expand=4]="Expand",i[i.Solid=5]="Solid"})(NV||(NV={}));var RV;(function(i){i[i.Line=1]="Line",i[i.Block=2]="Block",i[i.Underline=3]="Underline",i[i.LineThin=4]="LineThin",i[i.BlockOutline=5]="BlockOutline",i[i.UnderlineThin=6]="UnderlineThin"})(RV||(RV={}));var MV;(function(i){i[i.AlwaysGrowsWhenTypingAtEdges=0]="AlwaysGrowsWhenTypingAtEdges",i[i.NeverGrowsWhenTypingAtEdges=1]="NeverGrowsWhenTypingAtEdges",i[i.GrowsOnlyWhenTypingBefore=2]="GrowsOnlyWhenTypingBefore",i[i.GrowsOnlyWhenTypingAfter=3]="GrowsOnlyWhenTypingAfter"})(MV||(MV={}));var AV;(function(i){i[i.None=0]="None",i[i.Same=1]="Same",i[i.Indent=2]="Indent",i[i.DeepIndent=3]="DeepIndent"})(AV||(AV={}));class PI{static chord(e,t){return Zo(e,t)}}PI.CtrlCmd=2048;PI.Shift=1024;PI.Alt=512;PI.WinCtrl=256;function N_e(){return{editor:void 0,languages:void 0,CancellationTokenSource:Ro,Emitter:le,KeyCode:pV,KeyMod:PI,Position:ae,Range:V,Selection:gt,SelectionDirection:DV,MarkerSeverity:mV,MarkerTag:vV,Uri:Rt,Token:ID}}class tZe{constructor(e){this.fn=e,this.lastCache=void 0,this.lastArgKey=void 0}get(e){const t=JSON.stringify(e);return this.lastArgKey!==t&&(this.lastArgKey=t,this.lastCache=this.fn(e)),this.lastCache}}class ooe{get cachedValues(){return this._map}constructor(e){this.fn=e,this._map=new Map}get(e){if(this._map.has(e))return this._map.get(e);const t=this.fn(e);return this._map.set(e,t),t}}class rh{constructor(e){this.executor=e,this._didRun=!1}get value(){if(!this._didRun)try{this._value=this.executor()}catch(e){this._error=e}finally{this._didRun=!0}if(this._error)throw this._error;return this._value}get rawValue(){return this._value}}var dy;function R_e(i){return!i||typeof i!="string"?!0:i.trim().length===0}const nZe=/{(\d+)}/g;function G0(i,...e){return e.length===0?i:i.replace(nZe,function(t,n){const o=parseInt(n,10);return isNaN(o)||o<0||o>=e.length?t:e[o]})}function WA(i){return i.replace(/[<>&]/g,function(e){switch(e){case"<":return"<";case">":return">";case"&":return"&";default:return e}})}function Gl(i){return i.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function iZe(i,e=" "){const t=OI(i,e);return M_e(t,e)}function OI(i,e){if(!i||!e)return i;const t=e.length;if(t===0||i.length===0)return i;let n=0;for(;i.indexOf(e,n)===n;)n=n+t;return i.substring(n)}function M_e(i,e){if(!i||!e)return i;const t=e.length,n=i.length;if(t===0||n===0)return i;let o=n,r=-1;for(;r=i.lastIndexOf(e,o-1),!(r===-1||r+t!==o);){if(r===0)return"";o=r}return i.substring(0,o)}function oZe(i){return i.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function rZe(i){return i.replace(/\*/g,"")}function A_e(i,e,t={}){if(!i)throw new Error("Cannot create regex from empty string");e||(i=Gl(i)),t.wholeWord&&(/\B/.test(i.charAt(0))||(i="\\b"+i),/\B/.test(i.charAt(i.length-1))||(i=i+"\\b"));let n="";return t.global&&(n+="g"),t.matchCase||(n+="i"),t.multiline&&(n+="m"),t.unicode&&(n+="u"),new RegExp(i,n)}function sZe(i){return i.source==="^"||i.source==="^$"||i.source==="$"||i.source==="^\\s*$"?!1:!!(i.exec("")&&i.lastIndex===0)}function ff(i){return i.split(/\r\n|\r|\n/)}function Ws(i){for(let e=0,t=i.length;e=0;t--){const n=i.charCodeAt(t);if(n!==32&&n!==9)return t}return-1}function RD(i,e){return ie?1:0}function Wq(i,e,t=0,n=i.length,o=0,r=e.length){for(;tc)return 1}const s=n-t,a=r-o;return sa?1:0}function PV(i,e){return FI(i,e,0,i.length,0,e.length)}function FI(i,e,t=0,n=i.length,o=0,r=e.length){for(;t=128||c>=128)return Wq(i.toLowerCase(),e.toLowerCase(),t,n,o,r);bm(l)&&(l-=32),bm(c)&&(c-=32);const u=l-c;if(u!==0)return u}const s=n-t,a=r-o;return sa?1:0}function JN(i){return i>=48&&i<=57}function bm(i){return i>=97&&i<=122}function Eh(i){return i>=65&&i<=90}function kC(i,e){return i.length===e.length&&FI(i,e)===0}function Vq(i,e){const t=e.length;return e.length>i.length?!1:FI(i,e,0,t)===0}function X0(i,e){const t=Math.min(i.length,e.length);let n;for(n=0;n1){const n=i.charCodeAt(e-2);if(fr(n))return Hq(n,t)}return t}class $q{get offset(){return this._offset}constructor(e,t=0){this._str=e,this._len=e.length,this._offset=t}setOffset(e){this._offset=e}prevCodePoint(){const e=aZe(this._str,this._offset);return this._offset-=e>=65536?2:1,e}nextCodePoint(){const e=HA(this._str,this._len,this._offset);return this._offset+=e>=65536?2:1,e}eol(){return this._offset>=this._len}}class $A{get offset(){return this._iterator.offset}constructor(e,t=0){this._iterator=new $q(e,t)}nextGraphemeLength(){const e=Cm.getInstance(),t=this._iterator,n=t.offset;let o=e.getGraphemeBreakType(t.nextCodePoint());for(;!t.eol();){const r=t.offset,s=e.getGraphemeBreakType(t.nextCodePoint());if(roe(o,s)){t.setOffset(r);break}o=s}return t.offset-n}prevGraphemeLength(){const e=Cm.getInstance(),t=this._iterator,n=t.offset;let o=e.getGraphemeBreakType(t.prevCodePoint());for(;t.offset>0;){const r=t.offset,s=e.getGraphemeBreakType(t.prevCodePoint());if(roe(s,o)){t.setOffset(r);break}o=s}return n-t.offset}eol(){return this._iterator.eol()}}function zq(i,e){return new $A(i,e).nextGraphemeLength()}function P_e(i,e){return new $A(i,e).prevGraphemeLength()}function lZe(i,e){e>0&&Y0(i.charCodeAt(e))&&e--;const t=e+zq(i,e);return[t-P_e(i,t),t]}let I6;function cZe(){return/(?:[\u05BE\u05C0\u05C3\u05C6\u05D0-\u05F4\u0608\u060B\u060D\u061B-\u064A\u066D-\u066F\u0671-\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u0710\u0712-\u072F\u074D-\u07A5\u07B1-\u07EA\u07F4\u07F5\u07FA\u07FE-\u0815\u081A\u0824\u0828\u0830-\u0858\u085E-\u088E\u08A0-\u08C9\u200F\uFB1D\uFB1F-\uFB28\uFB2A-\uFD3D\uFD50-\uFDC7\uFDF0-\uFDFC\uFE70-\uFEFC]|\uD802[\uDC00-\uDD1B\uDD20-\uDE00\uDE10-\uDE35\uDE40-\uDEE4\uDEEB-\uDF35\uDF40-\uDFFF]|\uD803[\uDC00-\uDD23\uDE80-\uDEA9\uDEAD-\uDF45\uDF51-\uDF81\uDF86-\uDFF6]|\uD83A[\uDC00-\uDCCF\uDD00-\uDD43\uDD4B-\uDFFF]|\uD83B[\uDC00-\uDEBB])/}function hy(i){return I6||(I6=cZe()),I6.test(i)}const uZe=/^[\t\n\r\x20-\x7E]*$/;function BI(i){return uZe.test(i)}const O_e=/[\u2028\u2029]/;function F_e(i){return O_e.test(i)}function bv(i){return i>=11904&&i<=55215||i>=63744&&i<=64255||i>=65281&&i<=65374}function Uq(i){return i>=127462&&i<=127487||i===8986||i===8987||i===9200||i===9203||i>=9728&&i<=10175||i===11088||i===11093||i>=127744&&i<=128591||i>=128640&&i<=128764||i>=128992&&i<=129008||i>=129280&&i<=129535||i>=129648&&i<=129782}const dZe=String.fromCharCode(65279);function jq(i){return!!(i&&i.length>0&&i.charCodeAt(0)===65279)}function hZe(i,e=!1){return i?(e&&(i=i.replace(/\\./g,"")),i.toLowerCase()!==i):!1}function B_e(i){return i=i%(2*26),i<26?String.fromCharCode(97+i):String.fromCharCode(65+i-26)}function roe(i,e){return i===0?e!==5&&e!==7:i===2&&e===3?!1:i===4||i===2||i===3||e===4||e===2||e===3?!0:!(i===8&&(e===8||e===9||e===11||e===12)||(i===11||i===9)&&(e===9||e===10)||(i===12||i===10)&&e===10||e===5||e===13||e===7||i===1||i===13&&e===14||i===6&&e===6)}class Cm{static getInstance(){return Cm._INSTANCE||(Cm._INSTANCE=new Cm),Cm._INSTANCE}constructor(){this._data=fZe()}getGraphemeBreakType(e){if(e<32)return e===10?3:e===13?2:4;if(e<127)return 0;const t=this._data,n=t.length/3;let o=1;for(;o<=n;)if(et[3*o+1])o=2*o+1;else return t[3*o+2];return 0}}Cm._INSTANCE=null;function fZe(){return JSON.parse("[0,0,0,51229,51255,12,44061,44087,12,127462,127487,6,7083,7085,5,47645,47671,12,54813,54839,12,128678,128678,14,3270,3270,5,9919,9923,14,45853,45879,12,49437,49463,12,53021,53047,12,71216,71218,7,128398,128399,14,129360,129374,14,2519,2519,5,4448,4519,9,9742,9742,14,12336,12336,14,44957,44983,12,46749,46775,12,48541,48567,12,50333,50359,12,52125,52151,12,53917,53943,12,69888,69890,5,73018,73018,5,127990,127990,14,128558,128559,14,128759,128760,14,129653,129655,14,2027,2035,5,2891,2892,7,3761,3761,5,6683,6683,5,8293,8293,4,9825,9826,14,9999,9999,14,43452,43453,5,44509,44535,12,45405,45431,12,46301,46327,12,47197,47223,12,48093,48119,12,48989,49015,12,49885,49911,12,50781,50807,12,51677,51703,12,52573,52599,12,53469,53495,12,54365,54391,12,65279,65279,4,70471,70472,7,72145,72147,7,119173,119179,5,127799,127818,14,128240,128244,14,128512,128512,14,128652,128652,14,128721,128722,14,129292,129292,14,129445,129450,14,129734,129743,14,1476,1477,5,2366,2368,7,2750,2752,7,3076,3076,5,3415,3415,5,4141,4144,5,6109,6109,5,6964,6964,5,7394,7400,5,9197,9198,14,9770,9770,14,9877,9877,14,9968,9969,14,10084,10084,14,43052,43052,5,43713,43713,5,44285,44311,12,44733,44759,12,45181,45207,12,45629,45655,12,46077,46103,12,46525,46551,12,46973,46999,12,47421,47447,12,47869,47895,12,48317,48343,12,48765,48791,12,49213,49239,12,49661,49687,12,50109,50135,12,50557,50583,12,51005,51031,12,51453,51479,12,51901,51927,12,52349,52375,12,52797,52823,12,53245,53271,12,53693,53719,12,54141,54167,12,54589,54615,12,55037,55063,12,69506,69509,5,70191,70193,5,70841,70841,7,71463,71467,5,72330,72342,5,94031,94031,5,123628,123631,5,127763,127765,14,127941,127941,14,128043,128062,14,128302,128317,14,128465,128467,14,128539,128539,14,128640,128640,14,128662,128662,14,128703,128703,14,128745,128745,14,129004,129007,14,129329,129330,14,129402,129402,14,129483,129483,14,129686,129704,14,130048,131069,14,173,173,4,1757,1757,1,2200,2207,5,2434,2435,7,2631,2632,5,2817,2817,5,3008,3008,5,3201,3201,5,3387,3388,5,3542,3542,5,3902,3903,7,4190,4192,5,6002,6003,5,6439,6440,5,6765,6770,7,7019,7027,5,7154,7155,7,8205,8205,13,8505,8505,14,9654,9654,14,9757,9757,14,9792,9792,14,9852,9853,14,9890,9894,14,9937,9937,14,9981,9981,14,10035,10036,14,11035,11036,14,42654,42655,5,43346,43347,7,43587,43587,5,44006,44007,7,44173,44199,12,44397,44423,12,44621,44647,12,44845,44871,12,45069,45095,12,45293,45319,12,45517,45543,12,45741,45767,12,45965,45991,12,46189,46215,12,46413,46439,12,46637,46663,12,46861,46887,12,47085,47111,12,47309,47335,12,47533,47559,12,47757,47783,12,47981,48007,12,48205,48231,12,48429,48455,12,48653,48679,12,48877,48903,12,49101,49127,12,49325,49351,12,49549,49575,12,49773,49799,12,49997,50023,12,50221,50247,12,50445,50471,12,50669,50695,12,50893,50919,12,51117,51143,12,51341,51367,12,51565,51591,12,51789,51815,12,52013,52039,12,52237,52263,12,52461,52487,12,52685,52711,12,52909,52935,12,53133,53159,12,53357,53383,12,53581,53607,12,53805,53831,12,54029,54055,12,54253,54279,12,54477,54503,12,54701,54727,12,54925,54951,12,55149,55175,12,68101,68102,5,69762,69762,7,70067,70069,7,70371,70378,5,70720,70721,7,71087,71087,5,71341,71341,5,71995,71996,5,72249,72249,7,72850,72871,5,73109,73109,5,118576,118598,5,121505,121519,5,127245,127247,14,127568,127569,14,127777,127777,14,127872,127891,14,127956,127967,14,128015,128016,14,128110,128172,14,128259,128259,14,128367,128368,14,128424,128424,14,128488,128488,14,128530,128532,14,128550,128551,14,128566,128566,14,128647,128647,14,128656,128656,14,128667,128673,14,128691,128693,14,128715,128715,14,128728,128732,14,128752,128752,14,128765,128767,14,129096,129103,14,129311,129311,14,129344,129349,14,129394,129394,14,129413,129425,14,129466,129471,14,129511,129535,14,129664,129666,14,129719,129722,14,129760,129767,14,917536,917631,5,13,13,2,1160,1161,5,1564,1564,4,1807,1807,1,2085,2087,5,2307,2307,7,2382,2383,7,2497,2500,5,2563,2563,7,2677,2677,5,2763,2764,7,2879,2879,5,2914,2915,5,3021,3021,5,3142,3144,5,3263,3263,5,3285,3286,5,3398,3400,7,3530,3530,5,3633,3633,5,3864,3865,5,3974,3975,5,4155,4156,7,4229,4230,5,5909,5909,7,6078,6085,7,6277,6278,5,6451,6456,7,6744,6750,5,6846,6846,5,6972,6972,5,7074,7077,5,7146,7148,7,7222,7223,5,7416,7417,5,8234,8238,4,8417,8417,5,9000,9000,14,9203,9203,14,9730,9731,14,9748,9749,14,9762,9763,14,9776,9783,14,9800,9811,14,9831,9831,14,9872,9873,14,9882,9882,14,9900,9903,14,9929,9933,14,9941,9960,14,9974,9974,14,9989,9989,14,10006,10006,14,10062,10062,14,10160,10160,14,11647,11647,5,12953,12953,14,43019,43019,5,43232,43249,5,43443,43443,5,43567,43568,7,43696,43696,5,43765,43765,7,44013,44013,5,44117,44143,12,44229,44255,12,44341,44367,12,44453,44479,12,44565,44591,12,44677,44703,12,44789,44815,12,44901,44927,12,45013,45039,12,45125,45151,12,45237,45263,12,45349,45375,12,45461,45487,12,45573,45599,12,45685,45711,12,45797,45823,12,45909,45935,12,46021,46047,12,46133,46159,12,46245,46271,12,46357,46383,12,46469,46495,12,46581,46607,12,46693,46719,12,46805,46831,12,46917,46943,12,47029,47055,12,47141,47167,12,47253,47279,12,47365,47391,12,47477,47503,12,47589,47615,12,47701,47727,12,47813,47839,12,47925,47951,12,48037,48063,12,48149,48175,12,48261,48287,12,48373,48399,12,48485,48511,12,48597,48623,12,48709,48735,12,48821,48847,12,48933,48959,12,49045,49071,12,49157,49183,12,49269,49295,12,49381,49407,12,49493,49519,12,49605,49631,12,49717,49743,12,49829,49855,12,49941,49967,12,50053,50079,12,50165,50191,12,50277,50303,12,50389,50415,12,50501,50527,12,50613,50639,12,50725,50751,12,50837,50863,12,50949,50975,12,51061,51087,12,51173,51199,12,51285,51311,12,51397,51423,12,51509,51535,12,51621,51647,12,51733,51759,12,51845,51871,12,51957,51983,12,52069,52095,12,52181,52207,12,52293,52319,12,52405,52431,12,52517,52543,12,52629,52655,12,52741,52767,12,52853,52879,12,52965,52991,12,53077,53103,12,53189,53215,12,53301,53327,12,53413,53439,12,53525,53551,12,53637,53663,12,53749,53775,12,53861,53887,12,53973,53999,12,54085,54111,12,54197,54223,12,54309,54335,12,54421,54447,12,54533,54559,12,54645,54671,12,54757,54783,12,54869,54895,12,54981,55007,12,55093,55119,12,55243,55291,10,66045,66045,5,68325,68326,5,69688,69702,5,69817,69818,5,69957,69958,7,70089,70092,5,70198,70199,5,70462,70462,5,70502,70508,5,70750,70750,5,70846,70846,7,71100,71101,5,71230,71230,7,71351,71351,5,71737,71738,5,72000,72000,7,72160,72160,5,72273,72278,5,72752,72758,5,72882,72883,5,73031,73031,5,73461,73462,7,94192,94193,7,119149,119149,7,121403,121452,5,122915,122916,5,126980,126980,14,127358,127359,14,127535,127535,14,127759,127759,14,127771,127771,14,127792,127793,14,127825,127867,14,127897,127899,14,127945,127945,14,127985,127986,14,128000,128007,14,128021,128021,14,128066,128100,14,128184,128235,14,128249,128252,14,128266,128276,14,128335,128335,14,128379,128390,14,128407,128419,14,128444,128444,14,128481,128481,14,128499,128499,14,128526,128526,14,128536,128536,14,128543,128543,14,128556,128556,14,128564,128564,14,128577,128580,14,128643,128645,14,128649,128649,14,128654,128654,14,128660,128660,14,128664,128664,14,128675,128675,14,128686,128689,14,128695,128696,14,128705,128709,14,128717,128719,14,128725,128725,14,128736,128741,14,128747,128748,14,128755,128755,14,128762,128762,14,128981,128991,14,129009,129023,14,129160,129167,14,129296,129304,14,129320,129327,14,129340,129342,14,129356,129356,14,129388,129392,14,129399,129400,14,129404,129407,14,129432,129442,14,129454,129455,14,129473,129474,14,129485,129487,14,129648,129651,14,129659,129660,14,129671,129679,14,129709,129711,14,129728,129730,14,129751,129753,14,129776,129782,14,917505,917505,4,917760,917999,5,10,10,3,127,159,4,768,879,5,1471,1471,5,1536,1541,1,1648,1648,5,1767,1768,5,1840,1866,5,2070,2073,5,2137,2139,5,2274,2274,1,2363,2363,7,2377,2380,7,2402,2403,5,2494,2494,5,2507,2508,7,2558,2558,5,2622,2624,7,2641,2641,5,2691,2691,7,2759,2760,5,2786,2787,5,2876,2876,5,2881,2884,5,2901,2902,5,3006,3006,5,3014,3016,7,3072,3072,5,3134,3136,5,3157,3158,5,3260,3260,5,3266,3266,5,3274,3275,7,3328,3329,5,3391,3392,7,3405,3405,5,3457,3457,5,3536,3537,7,3551,3551,5,3636,3642,5,3764,3772,5,3895,3895,5,3967,3967,7,3993,4028,5,4146,4151,5,4182,4183,7,4226,4226,5,4253,4253,5,4957,4959,5,5940,5940,7,6070,6070,7,6087,6088,7,6158,6158,4,6432,6434,5,6448,6449,7,6679,6680,5,6742,6742,5,6754,6754,5,6783,6783,5,6912,6915,5,6966,6970,5,6978,6978,5,7042,7042,7,7080,7081,5,7143,7143,7,7150,7150,7,7212,7219,5,7380,7392,5,7412,7412,5,8203,8203,4,8232,8232,4,8265,8265,14,8400,8412,5,8421,8432,5,8617,8618,14,9167,9167,14,9200,9200,14,9410,9410,14,9723,9726,14,9733,9733,14,9745,9745,14,9752,9752,14,9760,9760,14,9766,9766,14,9774,9774,14,9786,9786,14,9794,9794,14,9823,9823,14,9828,9828,14,9833,9850,14,9855,9855,14,9875,9875,14,9880,9880,14,9885,9887,14,9896,9897,14,9906,9916,14,9926,9927,14,9935,9935,14,9939,9939,14,9962,9962,14,9972,9972,14,9978,9978,14,9986,9986,14,9997,9997,14,10002,10002,14,10017,10017,14,10055,10055,14,10071,10071,14,10133,10135,14,10548,10549,14,11093,11093,14,12330,12333,5,12441,12442,5,42608,42610,5,43010,43010,5,43045,43046,5,43188,43203,7,43302,43309,5,43392,43394,5,43446,43449,5,43493,43493,5,43571,43572,7,43597,43597,7,43703,43704,5,43756,43757,5,44003,44004,7,44009,44010,7,44033,44059,12,44089,44115,12,44145,44171,12,44201,44227,12,44257,44283,12,44313,44339,12,44369,44395,12,44425,44451,12,44481,44507,12,44537,44563,12,44593,44619,12,44649,44675,12,44705,44731,12,44761,44787,12,44817,44843,12,44873,44899,12,44929,44955,12,44985,45011,12,45041,45067,12,45097,45123,12,45153,45179,12,45209,45235,12,45265,45291,12,45321,45347,12,45377,45403,12,45433,45459,12,45489,45515,12,45545,45571,12,45601,45627,12,45657,45683,12,45713,45739,12,45769,45795,12,45825,45851,12,45881,45907,12,45937,45963,12,45993,46019,12,46049,46075,12,46105,46131,12,46161,46187,12,46217,46243,12,46273,46299,12,46329,46355,12,46385,46411,12,46441,46467,12,46497,46523,12,46553,46579,12,46609,46635,12,46665,46691,12,46721,46747,12,46777,46803,12,46833,46859,12,46889,46915,12,46945,46971,12,47001,47027,12,47057,47083,12,47113,47139,12,47169,47195,12,47225,47251,12,47281,47307,12,47337,47363,12,47393,47419,12,47449,47475,12,47505,47531,12,47561,47587,12,47617,47643,12,47673,47699,12,47729,47755,12,47785,47811,12,47841,47867,12,47897,47923,12,47953,47979,12,48009,48035,12,48065,48091,12,48121,48147,12,48177,48203,12,48233,48259,12,48289,48315,12,48345,48371,12,48401,48427,12,48457,48483,12,48513,48539,12,48569,48595,12,48625,48651,12,48681,48707,12,48737,48763,12,48793,48819,12,48849,48875,12,48905,48931,12,48961,48987,12,49017,49043,12,49073,49099,12,49129,49155,12,49185,49211,12,49241,49267,12,49297,49323,12,49353,49379,12,49409,49435,12,49465,49491,12,49521,49547,12,49577,49603,12,49633,49659,12,49689,49715,12,49745,49771,12,49801,49827,12,49857,49883,12,49913,49939,12,49969,49995,12,50025,50051,12,50081,50107,12,50137,50163,12,50193,50219,12,50249,50275,12,50305,50331,12,50361,50387,12,50417,50443,12,50473,50499,12,50529,50555,12,50585,50611,12,50641,50667,12,50697,50723,12,50753,50779,12,50809,50835,12,50865,50891,12,50921,50947,12,50977,51003,12,51033,51059,12,51089,51115,12,51145,51171,12,51201,51227,12,51257,51283,12,51313,51339,12,51369,51395,12,51425,51451,12,51481,51507,12,51537,51563,12,51593,51619,12,51649,51675,12,51705,51731,12,51761,51787,12,51817,51843,12,51873,51899,12,51929,51955,12,51985,52011,12,52041,52067,12,52097,52123,12,52153,52179,12,52209,52235,12,52265,52291,12,52321,52347,12,52377,52403,12,52433,52459,12,52489,52515,12,52545,52571,12,52601,52627,12,52657,52683,12,52713,52739,12,52769,52795,12,52825,52851,12,52881,52907,12,52937,52963,12,52993,53019,12,53049,53075,12,53105,53131,12,53161,53187,12,53217,53243,12,53273,53299,12,53329,53355,12,53385,53411,12,53441,53467,12,53497,53523,12,53553,53579,12,53609,53635,12,53665,53691,12,53721,53747,12,53777,53803,12,53833,53859,12,53889,53915,12,53945,53971,12,54001,54027,12,54057,54083,12,54113,54139,12,54169,54195,12,54225,54251,12,54281,54307,12,54337,54363,12,54393,54419,12,54449,54475,12,54505,54531,12,54561,54587,12,54617,54643,12,54673,54699,12,54729,54755,12,54785,54811,12,54841,54867,12,54897,54923,12,54953,54979,12,55009,55035,12,55065,55091,12,55121,55147,12,55177,55203,12,65024,65039,5,65520,65528,4,66422,66426,5,68152,68154,5,69291,69292,5,69633,69633,5,69747,69748,5,69811,69814,5,69826,69826,5,69932,69932,7,70016,70017,5,70079,70080,7,70095,70095,5,70196,70196,5,70367,70367,5,70402,70403,7,70464,70464,5,70487,70487,5,70709,70711,7,70725,70725,7,70833,70834,7,70843,70844,7,70849,70849,7,71090,71093,5,71103,71104,5,71227,71228,7,71339,71339,5,71344,71349,5,71458,71461,5,71727,71735,5,71985,71989,7,71998,71998,5,72002,72002,7,72154,72155,5,72193,72202,5,72251,72254,5,72281,72283,5,72344,72345,5,72766,72766,7,72874,72880,5,72885,72886,5,73023,73029,5,73104,73105,5,73111,73111,5,92912,92916,5,94095,94098,5,113824,113827,4,119142,119142,7,119155,119162,4,119362,119364,5,121476,121476,5,122888,122904,5,123184,123190,5,125252,125258,5,127183,127183,14,127340,127343,14,127377,127386,14,127491,127503,14,127548,127551,14,127744,127756,14,127761,127761,14,127769,127769,14,127773,127774,14,127780,127788,14,127796,127797,14,127820,127823,14,127869,127869,14,127894,127895,14,127902,127903,14,127943,127943,14,127947,127950,14,127972,127972,14,127988,127988,14,127992,127994,14,128009,128011,14,128019,128019,14,128023,128041,14,128064,128064,14,128102,128107,14,128174,128181,14,128238,128238,14,128246,128247,14,128254,128254,14,128264,128264,14,128278,128299,14,128329,128330,14,128348,128359,14,128371,128377,14,128392,128393,14,128401,128404,14,128421,128421,14,128433,128434,14,128450,128452,14,128476,128478,14,128483,128483,14,128495,128495,14,128506,128506,14,128519,128520,14,128528,128528,14,128534,128534,14,128538,128538,14,128540,128542,14,128544,128549,14,128552,128555,14,128557,128557,14,128560,128563,14,128565,128565,14,128567,128576,14,128581,128591,14,128641,128642,14,128646,128646,14,128648,128648,14,128650,128651,14,128653,128653,14,128655,128655,14,128657,128659,14,128661,128661,14,128663,128663,14,128665,128666,14,128674,128674,14,128676,128677,14,128679,128685,14,128690,128690,14,128694,128694,14,128697,128702,14,128704,128704,14,128710,128714,14,128716,128716,14,128720,128720,14,128723,128724,14,128726,128727,14,128733,128735,14,128742,128744,14,128746,128746,14,128749,128751,14,128753,128754,14,128756,128758,14,128761,128761,14,128763,128764,14,128884,128895,14,128992,129003,14,129008,129008,14,129036,129039,14,129114,129119,14,129198,129279,14,129293,129295,14,129305,129310,14,129312,129319,14,129328,129328,14,129331,129338,14,129343,129343,14,129351,129355,14,129357,129359,14,129375,129387,14,129393,129393,14,129395,129398,14,129401,129401,14,129403,129403,14,129408,129412,14,129426,129431,14,129443,129444,14,129451,129453,14,129456,129465,14,129472,129472,14,129475,129482,14,129484,129484,14,129488,129510,14,129536,129647,14,129652,129652,14,129656,129658,14,129661,129663,14,129667,129670,14,129680,129685,14,129705,129708,14,129712,129718,14,129723,129727,14,129731,129733,14,129744,129750,14,129754,129759,14,129768,129775,14,129783,129791,14,917504,917504,4,917506,917535,4,917632,917759,4,918000,921599,4,0,9,4,11,12,4,14,31,4,169,169,14,174,174,14,1155,1159,5,1425,1469,5,1473,1474,5,1479,1479,5,1552,1562,5,1611,1631,5,1750,1756,5,1759,1764,5,1770,1773,5,1809,1809,5,1958,1968,5,2045,2045,5,2075,2083,5,2089,2093,5,2192,2193,1,2250,2273,5,2275,2306,5,2362,2362,5,2364,2364,5,2369,2376,5,2381,2381,5,2385,2391,5,2433,2433,5,2492,2492,5,2495,2496,7,2503,2504,7,2509,2509,5,2530,2531,5,2561,2562,5,2620,2620,5,2625,2626,5,2635,2637,5,2672,2673,5,2689,2690,5,2748,2748,5,2753,2757,5,2761,2761,7,2765,2765,5,2810,2815,5,2818,2819,7,2878,2878,5,2880,2880,7,2887,2888,7,2893,2893,5,2903,2903,5,2946,2946,5,3007,3007,7,3009,3010,7,3018,3020,7,3031,3031,5,3073,3075,7,3132,3132,5,3137,3140,7,3146,3149,5,3170,3171,5,3202,3203,7,3262,3262,7,3264,3265,7,3267,3268,7,3271,3272,7,3276,3277,5,3298,3299,5,3330,3331,7,3390,3390,5,3393,3396,5,3402,3404,7,3406,3406,1,3426,3427,5,3458,3459,7,3535,3535,5,3538,3540,5,3544,3550,7,3570,3571,7,3635,3635,7,3655,3662,5,3763,3763,7,3784,3789,5,3893,3893,5,3897,3897,5,3953,3966,5,3968,3972,5,3981,3991,5,4038,4038,5,4145,4145,7,4153,4154,5,4157,4158,5,4184,4185,5,4209,4212,5,4228,4228,7,4237,4237,5,4352,4447,8,4520,4607,10,5906,5908,5,5938,5939,5,5970,5971,5,6068,6069,5,6071,6077,5,6086,6086,5,6089,6099,5,6155,6157,5,6159,6159,5,6313,6313,5,6435,6438,7,6441,6443,7,6450,6450,5,6457,6459,5,6681,6682,7,6741,6741,7,6743,6743,7,6752,6752,5,6757,6764,5,6771,6780,5,6832,6845,5,6847,6862,5,6916,6916,7,6965,6965,5,6971,6971,7,6973,6977,7,6979,6980,7,7040,7041,5,7073,7073,7,7078,7079,7,7082,7082,7,7142,7142,5,7144,7145,5,7149,7149,5,7151,7153,5,7204,7211,7,7220,7221,7,7376,7378,5,7393,7393,7,7405,7405,5,7415,7415,7,7616,7679,5,8204,8204,5,8206,8207,4,8233,8233,4,8252,8252,14,8288,8292,4,8294,8303,4,8413,8416,5,8418,8420,5,8482,8482,14,8596,8601,14,8986,8987,14,9096,9096,14,9193,9196,14,9199,9199,14,9201,9202,14,9208,9210,14,9642,9643,14,9664,9664,14,9728,9729,14,9732,9732,14,9735,9741,14,9743,9744,14,9746,9746,14,9750,9751,14,9753,9756,14,9758,9759,14,9761,9761,14,9764,9765,14,9767,9769,14,9771,9773,14,9775,9775,14,9784,9785,14,9787,9791,14,9793,9793,14,9795,9799,14,9812,9822,14,9824,9824,14,9827,9827,14,9829,9830,14,9832,9832,14,9851,9851,14,9854,9854,14,9856,9861,14,9874,9874,14,9876,9876,14,9878,9879,14,9881,9881,14,9883,9884,14,9888,9889,14,9895,9895,14,9898,9899,14,9904,9905,14,9917,9918,14,9924,9925,14,9928,9928,14,9934,9934,14,9936,9936,14,9938,9938,14,9940,9940,14,9961,9961,14,9963,9967,14,9970,9971,14,9973,9973,14,9975,9977,14,9979,9980,14,9982,9985,14,9987,9988,14,9992,9996,14,9998,9998,14,10000,10001,14,10004,10004,14,10013,10013,14,10024,10024,14,10052,10052,14,10060,10060,14,10067,10069,14,10083,10083,14,10085,10087,14,10145,10145,14,10175,10175,14,11013,11015,14,11088,11088,14,11503,11505,5,11744,11775,5,12334,12335,5,12349,12349,14,12951,12951,14,42607,42607,5,42612,42621,5,42736,42737,5,43014,43014,5,43043,43044,7,43047,43047,7,43136,43137,7,43204,43205,5,43263,43263,5,43335,43345,5,43360,43388,8,43395,43395,7,43444,43445,7,43450,43451,7,43454,43456,7,43561,43566,5,43569,43570,5,43573,43574,5,43596,43596,5,43644,43644,5,43698,43700,5,43710,43711,5,43755,43755,7,43758,43759,7,43766,43766,5,44005,44005,5,44008,44008,5,44012,44012,7,44032,44032,11,44060,44060,11,44088,44088,11,44116,44116,11,44144,44144,11,44172,44172,11,44200,44200,11,44228,44228,11,44256,44256,11,44284,44284,11,44312,44312,11,44340,44340,11,44368,44368,11,44396,44396,11,44424,44424,11,44452,44452,11,44480,44480,11,44508,44508,11,44536,44536,11,44564,44564,11,44592,44592,11,44620,44620,11,44648,44648,11,44676,44676,11,44704,44704,11,44732,44732,11,44760,44760,11,44788,44788,11,44816,44816,11,44844,44844,11,44872,44872,11,44900,44900,11,44928,44928,11,44956,44956,11,44984,44984,11,45012,45012,11,45040,45040,11,45068,45068,11,45096,45096,11,45124,45124,11,45152,45152,11,45180,45180,11,45208,45208,11,45236,45236,11,45264,45264,11,45292,45292,11,45320,45320,11,45348,45348,11,45376,45376,11,45404,45404,11,45432,45432,11,45460,45460,11,45488,45488,11,45516,45516,11,45544,45544,11,45572,45572,11,45600,45600,11,45628,45628,11,45656,45656,11,45684,45684,11,45712,45712,11,45740,45740,11,45768,45768,11,45796,45796,11,45824,45824,11,45852,45852,11,45880,45880,11,45908,45908,11,45936,45936,11,45964,45964,11,45992,45992,11,46020,46020,11,46048,46048,11,46076,46076,11,46104,46104,11,46132,46132,11,46160,46160,11,46188,46188,11,46216,46216,11,46244,46244,11,46272,46272,11,46300,46300,11,46328,46328,11,46356,46356,11,46384,46384,11,46412,46412,11,46440,46440,11,46468,46468,11,46496,46496,11,46524,46524,11,46552,46552,11,46580,46580,11,46608,46608,11,46636,46636,11,46664,46664,11,46692,46692,11,46720,46720,11,46748,46748,11,46776,46776,11,46804,46804,11,46832,46832,11,46860,46860,11,46888,46888,11,46916,46916,11,46944,46944,11,46972,46972,11,47000,47000,11,47028,47028,11,47056,47056,11,47084,47084,11,47112,47112,11,47140,47140,11,47168,47168,11,47196,47196,11,47224,47224,11,47252,47252,11,47280,47280,11,47308,47308,11,47336,47336,11,47364,47364,11,47392,47392,11,47420,47420,11,47448,47448,11,47476,47476,11,47504,47504,11,47532,47532,11,47560,47560,11,47588,47588,11,47616,47616,11,47644,47644,11,47672,47672,11,47700,47700,11,47728,47728,11,47756,47756,11,47784,47784,11,47812,47812,11,47840,47840,11,47868,47868,11,47896,47896,11,47924,47924,11,47952,47952,11,47980,47980,11,48008,48008,11,48036,48036,11,48064,48064,11,48092,48092,11,48120,48120,11,48148,48148,11,48176,48176,11,48204,48204,11,48232,48232,11,48260,48260,11,48288,48288,11,48316,48316,11,48344,48344,11,48372,48372,11,48400,48400,11,48428,48428,11,48456,48456,11,48484,48484,11,48512,48512,11,48540,48540,11,48568,48568,11,48596,48596,11,48624,48624,11,48652,48652,11,48680,48680,11,48708,48708,11,48736,48736,11,48764,48764,11,48792,48792,11,48820,48820,11,48848,48848,11,48876,48876,11,48904,48904,11,48932,48932,11,48960,48960,11,48988,48988,11,49016,49016,11,49044,49044,11,49072,49072,11,49100,49100,11,49128,49128,11,49156,49156,11,49184,49184,11,49212,49212,11,49240,49240,11,49268,49268,11,49296,49296,11,49324,49324,11,49352,49352,11,49380,49380,11,49408,49408,11,49436,49436,11,49464,49464,11,49492,49492,11,49520,49520,11,49548,49548,11,49576,49576,11,49604,49604,11,49632,49632,11,49660,49660,11,49688,49688,11,49716,49716,11,49744,49744,11,49772,49772,11,49800,49800,11,49828,49828,11,49856,49856,11,49884,49884,11,49912,49912,11,49940,49940,11,49968,49968,11,49996,49996,11,50024,50024,11,50052,50052,11,50080,50080,11,50108,50108,11,50136,50136,11,50164,50164,11,50192,50192,11,50220,50220,11,50248,50248,11,50276,50276,11,50304,50304,11,50332,50332,11,50360,50360,11,50388,50388,11,50416,50416,11,50444,50444,11,50472,50472,11,50500,50500,11,50528,50528,11,50556,50556,11,50584,50584,11,50612,50612,11,50640,50640,11,50668,50668,11,50696,50696,11,50724,50724,11,50752,50752,11,50780,50780,11,50808,50808,11,50836,50836,11,50864,50864,11,50892,50892,11,50920,50920,11,50948,50948,11,50976,50976,11,51004,51004,11,51032,51032,11,51060,51060,11,51088,51088,11,51116,51116,11,51144,51144,11,51172,51172,11,51200,51200,11,51228,51228,11,51256,51256,11,51284,51284,11,51312,51312,11,51340,51340,11,51368,51368,11,51396,51396,11,51424,51424,11,51452,51452,11,51480,51480,11,51508,51508,11,51536,51536,11,51564,51564,11,51592,51592,11,51620,51620,11,51648,51648,11,51676,51676,11,51704,51704,11,51732,51732,11,51760,51760,11,51788,51788,11,51816,51816,11,51844,51844,11,51872,51872,11,51900,51900,11,51928,51928,11,51956,51956,11,51984,51984,11,52012,52012,11,52040,52040,11,52068,52068,11,52096,52096,11,52124,52124,11,52152,52152,11,52180,52180,11,52208,52208,11,52236,52236,11,52264,52264,11,52292,52292,11,52320,52320,11,52348,52348,11,52376,52376,11,52404,52404,11,52432,52432,11,52460,52460,11,52488,52488,11,52516,52516,11,52544,52544,11,52572,52572,11,52600,52600,11,52628,52628,11,52656,52656,11,52684,52684,11,52712,52712,11,52740,52740,11,52768,52768,11,52796,52796,11,52824,52824,11,52852,52852,11,52880,52880,11,52908,52908,11,52936,52936,11,52964,52964,11,52992,52992,11,53020,53020,11,53048,53048,11,53076,53076,11,53104,53104,11,53132,53132,11,53160,53160,11,53188,53188,11,53216,53216,11,53244,53244,11,53272,53272,11,53300,53300,11,53328,53328,11,53356,53356,11,53384,53384,11,53412,53412,11,53440,53440,11,53468,53468,11,53496,53496,11,53524,53524,11,53552,53552,11,53580,53580,11,53608,53608,11,53636,53636,11,53664,53664,11,53692,53692,11,53720,53720,11,53748,53748,11,53776,53776,11,53804,53804,11,53832,53832,11,53860,53860,11,53888,53888,11,53916,53916,11,53944,53944,11,53972,53972,11,54000,54000,11,54028,54028,11,54056,54056,11,54084,54084,11,54112,54112,11,54140,54140,11,54168,54168,11,54196,54196,11,54224,54224,11,54252,54252,11,54280,54280,11,54308,54308,11,54336,54336,11,54364,54364,11,54392,54392,11,54420,54420,11,54448,54448,11,54476,54476,11,54504,54504,11,54532,54532,11,54560,54560,11,54588,54588,11,54616,54616,11,54644,54644,11,54672,54672,11,54700,54700,11,54728,54728,11,54756,54756,11,54784,54784,11,54812,54812,11,54840,54840,11,54868,54868,11,54896,54896,11,54924,54924,11,54952,54952,11,54980,54980,11,55008,55008,11,55036,55036,11,55064,55064,11,55092,55092,11,55120,55120,11,55148,55148,11,55176,55176,11,55216,55238,9,64286,64286,5,65056,65071,5,65438,65439,5,65529,65531,4,66272,66272,5,68097,68099,5,68108,68111,5,68159,68159,5,68900,68903,5,69446,69456,5,69632,69632,7,69634,69634,7,69744,69744,5,69759,69761,5,69808,69810,7,69815,69816,7,69821,69821,1,69837,69837,1,69927,69931,5,69933,69940,5,70003,70003,5,70018,70018,7,70070,70078,5,70082,70083,1,70094,70094,7,70188,70190,7,70194,70195,7,70197,70197,7,70206,70206,5,70368,70370,7,70400,70401,5,70459,70460,5,70463,70463,7,70465,70468,7,70475,70477,7,70498,70499,7,70512,70516,5,70712,70719,5,70722,70724,5,70726,70726,5,70832,70832,5,70835,70840,5,70842,70842,5,70845,70845,5,70847,70848,5,70850,70851,5,71088,71089,7,71096,71099,7,71102,71102,7,71132,71133,5,71219,71226,5,71229,71229,5,71231,71232,5,71340,71340,7,71342,71343,7,71350,71350,7,71453,71455,5,71462,71462,7,71724,71726,7,71736,71736,7,71984,71984,5,71991,71992,7,71997,71997,7,71999,71999,1,72001,72001,1,72003,72003,5,72148,72151,5,72156,72159,7,72164,72164,7,72243,72248,5,72250,72250,1,72263,72263,5,72279,72280,7,72324,72329,1,72343,72343,7,72751,72751,7,72760,72765,5,72767,72767,5,72873,72873,7,72881,72881,7,72884,72884,7,73009,73014,5,73020,73021,5,73030,73030,1,73098,73102,7,73107,73108,7,73110,73110,7,73459,73460,5,78896,78904,4,92976,92982,5,94033,94087,7,94180,94180,5,113821,113822,5,118528,118573,5,119141,119141,5,119143,119145,5,119150,119154,5,119163,119170,5,119210,119213,5,121344,121398,5,121461,121461,5,121499,121503,5,122880,122886,5,122907,122913,5,122918,122922,5,123566,123566,5,125136,125142,5,126976,126979,14,126981,127182,14,127184,127231,14,127279,127279,14,127344,127345,14,127374,127374,14,127405,127461,14,127489,127490,14,127514,127514,14,127538,127546,14,127561,127567,14,127570,127743,14,127757,127758,14,127760,127760,14,127762,127762,14,127766,127768,14,127770,127770,14,127772,127772,14,127775,127776,14,127778,127779,14,127789,127791,14,127794,127795,14,127798,127798,14,127819,127819,14,127824,127824,14,127868,127868,14,127870,127871,14,127892,127893,14,127896,127896,14,127900,127901,14,127904,127940,14,127942,127942,14,127944,127944,14,127946,127946,14,127951,127955,14,127968,127971,14,127973,127984,14,127987,127987,14,127989,127989,14,127991,127991,14,127995,127999,5,128008,128008,14,128012,128014,14,128017,128018,14,128020,128020,14,128022,128022,14,128042,128042,14,128063,128063,14,128065,128065,14,128101,128101,14,128108,128109,14,128173,128173,14,128182,128183,14,128236,128237,14,128239,128239,14,128245,128245,14,128248,128248,14,128253,128253,14,128255,128258,14,128260,128263,14,128265,128265,14,128277,128277,14,128300,128301,14,128326,128328,14,128331,128334,14,128336,128347,14,128360,128366,14,128369,128370,14,128378,128378,14,128391,128391,14,128394,128397,14,128400,128400,14,128405,128406,14,128420,128420,14,128422,128423,14,128425,128432,14,128435,128443,14,128445,128449,14,128453,128464,14,128468,128475,14,128479,128480,14,128482,128482,14,128484,128487,14,128489,128494,14,128496,128498,14,128500,128505,14,128507,128511,14,128513,128518,14,128521,128525,14,128527,128527,14,128529,128529,14,128533,128533,14,128535,128535,14,128537,128537,14]")}function gZe(i,e){if(i===0)return 0;const t=pZe(i,e);if(t!==void 0)return t;const n=new $q(e,i);return n.prevCodePoint(),n.offset}function pZe(i,e){const t=new $q(e,i);let n=t.prevCodePoint();for(;mZe(n)||n===65039||n===8419;){if(t.offset===0)return;n=t.prevCodePoint()}if(!Uq(n))return;let o=t.offset;return o>0&&t.prevCodePoint()===8205&&(o=t.offset),o}function mZe(i){return 127995<=i&&i<=127999}const W_e="\xA0";class Z0{static getInstance(e){return dy.cache.get(Array.from(e))}static getLocales(){return dy._locales.value}constructor(e){this.confusableDictionary=e}isAmbiguous(e){return this.confusableDictionary.has(e)}getPrimaryConfusable(e){return this.confusableDictionary.get(e)}getConfusableCodePoints(){return new Set(this.confusableDictionary.keys())}}dy=Z0;Z0.ambiguousCharacterData=new rh(()=>JSON.parse('{"_common":[8232,32,8233,32,5760,32,8192,32,8193,32,8194,32,8195,32,8196,32,8197,32,8198,32,8200,32,8201,32,8202,32,8287,32,8199,32,8239,32,2042,95,65101,95,65102,95,65103,95,8208,45,8209,45,8210,45,65112,45,1748,45,8259,45,727,45,8722,45,10134,45,11450,45,1549,44,1643,44,8218,44,184,44,42233,44,894,59,2307,58,2691,58,1417,58,1795,58,1796,58,5868,58,65072,58,6147,58,6153,58,8282,58,1475,58,760,58,42889,58,8758,58,720,58,42237,58,451,33,11601,33,660,63,577,63,2429,63,5038,63,42731,63,119149,46,8228,46,1793,46,1794,46,42510,46,68176,46,1632,46,1776,46,42232,46,1373,96,65287,96,8219,96,8242,96,1370,96,1523,96,8175,96,65344,96,900,96,8189,96,8125,96,8127,96,8190,96,697,96,884,96,712,96,714,96,715,96,756,96,699,96,701,96,700,96,702,96,42892,96,1497,96,2036,96,2037,96,5194,96,5836,96,94033,96,94034,96,65339,91,10088,40,10098,40,12308,40,64830,40,65341,93,10089,41,10099,41,12309,41,64831,41,10100,123,119060,123,10101,125,65342,94,8270,42,1645,42,8727,42,66335,42,5941,47,8257,47,8725,47,8260,47,9585,47,10187,47,10744,47,119354,47,12755,47,12339,47,11462,47,20031,47,12035,47,65340,92,65128,92,8726,92,10189,92,10741,92,10745,92,119311,92,119355,92,12756,92,20022,92,12034,92,42872,38,708,94,710,94,5869,43,10133,43,66203,43,8249,60,10094,60,706,60,119350,60,5176,60,5810,60,5120,61,11840,61,12448,61,42239,61,8250,62,10095,62,707,62,119351,62,5171,62,94015,62,8275,126,732,126,8128,126,8764,126,65372,124,65293,45,120784,50,120794,50,120804,50,120814,50,120824,50,130034,50,42842,50,423,50,1000,50,42564,50,5311,50,42735,50,119302,51,120785,51,120795,51,120805,51,120815,51,120825,51,130035,51,42923,51,540,51,439,51,42858,51,11468,51,1248,51,94011,51,71882,51,120786,52,120796,52,120806,52,120816,52,120826,52,130036,52,5070,52,71855,52,120787,53,120797,53,120807,53,120817,53,120827,53,130037,53,444,53,71867,53,120788,54,120798,54,120808,54,120818,54,120828,54,130038,54,11474,54,5102,54,71893,54,119314,55,120789,55,120799,55,120809,55,120819,55,120829,55,130039,55,66770,55,71878,55,2819,56,2538,56,2666,56,125131,56,120790,56,120800,56,120810,56,120820,56,120830,56,130040,56,547,56,546,56,66330,56,2663,57,2920,57,2541,57,3437,57,120791,57,120801,57,120811,57,120821,57,120831,57,130041,57,42862,57,11466,57,71884,57,71852,57,71894,57,9082,97,65345,97,119834,97,119886,97,119938,97,119990,97,120042,97,120094,97,120146,97,120198,97,120250,97,120302,97,120354,97,120406,97,120458,97,593,97,945,97,120514,97,120572,97,120630,97,120688,97,120746,97,65313,65,119808,65,119860,65,119912,65,119964,65,120016,65,120068,65,120120,65,120172,65,120224,65,120276,65,120328,65,120380,65,120432,65,913,65,120488,65,120546,65,120604,65,120662,65,120720,65,5034,65,5573,65,42222,65,94016,65,66208,65,119835,98,119887,98,119939,98,119991,98,120043,98,120095,98,120147,98,120199,98,120251,98,120303,98,120355,98,120407,98,120459,98,388,98,5071,98,5234,98,5551,98,65314,66,8492,66,119809,66,119861,66,119913,66,120017,66,120069,66,120121,66,120173,66,120225,66,120277,66,120329,66,120381,66,120433,66,42932,66,914,66,120489,66,120547,66,120605,66,120663,66,120721,66,5108,66,5623,66,42192,66,66178,66,66209,66,66305,66,65347,99,8573,99,119836,99,119888,99,119940,99,119992,99,120044,99,120096,99,120148,99,120200,99,120252,99,120304,99,120356,99,120408,99,120460,99,7428,99,1010,99,11429,99,43951,99,66621,99,128844,67,71922,67,71913,67,65315,67,8557,67,8450,67,8493,67,119810,67,119862,67,119914,67,119966,67,120018,67,120174,67,120226,67,120278,67,120330,67,120382,67,120434,67,1017,67,11428,67,5087,67,42202,67,66210,67,66306,67,66581,67,66844,67,8574,100,8518,100,119837,100,119889,100,119941,100,119993,100,120045,100,120097,100,120149,100,120201,100,120253,100,120305,100,120357,100,120409,100,120461,100,1281,100,5095,100,5231,100,42194,100,8558,68,8517,68,119811,68,119863,68,119915,68,119967,68,120019,68,120071,68,120123,68,120175,68,120227,68,120279,68,120331,68,120383,68,120435,68,5024,68,5598,68,5610,68,42195,68,8494,101,65349,101,8495,101,8519,101,119838,101,119890,101,119942,101,120046,101,120098,101,120150,101,120202,101,120254,101,120306,101,120358,101,120410,101,120462,101,43826,101,1213,101,8959,69,65317,69,8496,69,119812,69,119864,69,119916,69,120020,69,120072,69,120124,69,120176,69,120228,69,120280,69,120332,69,120384,69,120436,69,917,69,120492,69,120550,69,120608,69,120666,69,120724,69,11577,69,5036,69,42224,69,71846,69,71854,69,66182,69,119839,102,119891,102,119943,102,119995,102,120047,102,120099,102,120151,102,120203,102,120255,102,120307,102,120359,102,120411,102,120463,102,43829,102,42905,102,383,102,7837,102,1412,102,119315,70,8497,70,119813,70,119865,70,119917,70,120021,70,120073,70,120125,70,120177,70,120229,70,120281,70,120333,70,120385,70,120437,70,42904,70,988,70,120778,70,5556,70,42205,70,71874,70,71842,70,66183,70,66213,70,66853,70,65351,103,8458,103,119840,103,119892,103,119944,103,120048,103,120100,103,120152,103,120204,103,120256,103,120308,103,120360,103,120412,103,120464,103,609,103,7555,103,397,103,1409,103,119814,71,119866,71,119918,71,119970,71,120022,71,120074,71,120126,71,120178,71,120230,71,120282,71,120334,71,120386,71,120438,71,1292,71,5056,71,5107,71,42198,71,65352,104,8462,104,119841,104,119945,104,119997,104,120049,104,120101,104,120153,104,120205,104,120257,104,120309,104,120361,104,120413,104,120465,104,1211,104,1392,104,5058,104,65320,72,8459,72,8460,72,8461,72,119815,72,119867,72,119919,72,120023,72,120179,72,120231,72,120283,72,120335,72,120387,72,120439,72,919,72,120494,72,120552,72,120610,72,120668,72,120726,72,11406,72,5051,72,5500,72,42215,72,66255,72,731,105,9075,105,65353,105,8560,105,8505,105,8520,105,119842,105,119894,105,119946,105,119998,105,120050,105,120102,105,120154,105,120206,105,120258,105,120310,105,120362,105,120414,105,120466,105,120484,105,618,105,617,105,953,105,8126,105,890,105,120522,105,120580,105,120638,105,120696,105,120754,105,1110,105,42567,105,1231,105,43893,105,5029,105,71875,105,65354,106,8521,106,119843,106,119895,106,119947,106,119999,106,120051,106,120103,106,120155,106,120207,106,120259,106,120311,106,120363,106,120415,106,120467,106,1011,106,1112,106,65322,74,119817,74,119869,74,119921,74,119973,74,120025,74,120077,74,120129,74,120181,74,120233,74,120285,74,120337,74,120389,74,120441,74,42930,74,895,74,1032,74,5035,74,5261,74,42201,74,119844,107,119896,107,119948,107,120000,107,120052,107,120104,107,120156,107,120208,107,120260,107,120312,107,120364,107,120416,107,120468,107,8490,75,65323,75,119818,75,119870,75,119922,75,119974,75,120026,75,120078,75,120130,75,120182,75,120234,75,120286,75,120338,75,120390,75,120442,75,922,75,120497,75,120555,75,120613,75,120671,75,120729,75,11412,75,5094,75,5845,75,42199,75,66840,75,1472,108,8739,73,9213,73,65512,73,1633,108,1777,73,66336,108,125127,108,120783,73,120793,73,120803,73,120813,73,120823,73,130033,73,65321,73,8544,73,8464,73,8465,73,119816,73,119868,73,119920,73,120024,73,120128,73,120180,73,120232,73,120284,73,120336,73,120388,73,120440,73,65356,108,8572,73,8467,108,119845,108,119897,108,119949,108,120001,108,120053,108,120105,73,120157,73,120209,73,120261,73,120313,73,120365,73,120417,73,120469,73,448,73,120496,73,120554,73,120612,73,120670,73,120728,73,11410,73,1030,73,1216,73,1493,108,1503,108,1575,108,126464,108,126592,108,65166,108,65165,108,1994,108,11599,73,5825,73,42226,73,93992,73,66186,124,66313,124,119338,76,8556,76,8466,76,119819,76,119871,76,119923,76,120027,76,120079,76,120131,76,120183,76,120235,76,120287,76,120339,76,120391,76,120443,76,11472,76,5086,76,5290,76,42209,76,93974,76,71843,76,71858,76,66587,76,66854,76,65325,77,8559,77,8499,77,119820,77,119872,77,119924,77,120028,77,120080,77,120132,77,120184,77,120236,77,120288,77,120340,77,120392,77,120444,77,924,77,120499,77,120557,77,120615,77,120673,77,120731,77,1018,77,11416,77,5047,77,5616,77,5846,77,42207,77,66224,77,66321,77,119847,110,119899,110,119951,110,120003,110,120055,110,120107,110,120159,110,120211,110,120263,110,120315,110,120367,110,120419,110,120471,110,1400,110,1404,110,65326,78,8469,78,119821,78,119873,78,119925,78,119977,78,120029,78,120081,78,120185,78,120237,78,120289,78,120341,78,120393,78,120445,78,925,78,120500,78,120558,78,120616,78,120674,78,120732,78,11418,78,42208,78,66835,78,3074,111,3202,111,3330,111,3458,111,2406,111,2662,111,2790,111,3046,111,3174,111,3302,111,3430,111,3664,111,3792,111,4160,111,1637,111,1781,111,65359,111,8500,111,119848,111,119900,111,119952,111,120056,111,120108,111,120160,111,120212,111,120264,111,120316,111,120368,111,120420,111,120472,111,7439,111,7441,111,43837,111,959,111,120528,111,120586,111,120644,111,120702,111,120760,111,963,111,120532,111,120590,111,120648,111,120706,111,120764,111,11423,111,4351,111,1413,111,1505,111,1607,111,126500,111,126564,111,126596,111,65259,111,65260,111,65258,111,65257,111,1726,111,64428,111,64429,111,64427,111,64426,111,1729,111,64424,111,64425,111,64423,111,64422,111,1749,111,3360,111,4125,111,66794,111,71880,111,71895,111,66604,111,1984,79,2534,79,2918,79,12295,79,70864,79,71904,79,120782,79,120792,79,120802,79,120812,79,120822,79,130032,79,65327,79,119822,79,119874,79,119926,79,119978,79,120030,79,120082,79,120134,79,120186,79,120238,79,120290,79,120342,79,120394,79,120446,79,927,79,120502,79,120560,79,120618,79,120676,79,120734,79,11422,79,1365,79,11604,79,4816,79,2848,79,66754,79,42227,79,71861,79,66194,79,66219,79,66564,79,66838,79,9076,112,65360,112,119849,112,119901,112,119953,112,120005,112,120057,112,120109,112,120161,112,120213,112,120265,112,120317,112,120369,112,120421,112,120473,112,961,112,120530,112,120544,112,120588,112,120602,112,120646,112,120660,112,120704,112,120718,112,120762,112,120776,112,11427,112,65328,80,8473,80,119823,80,119875,80,119927,80,119979,80,120031,80,120083,80,120187,80,120239,80,120291,80,120343,80,120395,80,120447,80,929,80,120504,80,120562,80,120620,80,120678,80,120736,80,11426,80,5090,80,5229,80,42193,80,66197,80,119850,113,119902,113,119954,113,120006,113,120058,113,120110,113,120162,113,120214,113,120266,113,120318,113,120370,113,120422,113,120474,113,1307,113,1379,113,1382,113,8474,81,119824,81,119876,81,119928,81,119980,81,120032,81,120084,81,120188,81,120240,81,120292,81,120344,81,120396,81,120448,81,11605,81,119851,114,119903,114,119955,114,120007,114,120059,114,120111,114,120163,114,120215,114,120267,114,120319,114,120371,114,120423,114,120475,114,43847,114,43848,114,7462,114,11397,114,43905,114,119318,82,8475,82,8476,82,8477,82,119825,82,119877,82,119929,82,120033,82,120189,82,120241,82,120293,82,120345,82,120397,82,120449,82,422,82,5025,82,5074,82,66740,82,5511,82,42211,82,94005,82,65363,115,119852,115,119904,115,119956,115,120008,115,120060,115,120112,115,120164,115,120216,115,120268,115,120320,115,120372,115,120424,115,120476,115,42801,115,445,115,1109,115,43946,115,71873,115,66632,115,65331,83,119826,83,119878,83,119930,83,119982,83,120034,83,120086,83,120138,83,120190,83,120242,83,120294,83,120346,83,120398,83,120450,83,1029,83,1359,83,5077,83,5082,83,42210,83,94010,83,66198,83,66592,83,119853,116,119905,116,119957,116,120009,116,120061,116,120113,116,120165,116,120217,116,120269,116,120321,116,120373,116,120425,116,120477,116,8868,84,10201,84,128872,84,65332,84,119827,84,119879,84,119931,84,119983,84,120035,84,120087,84,120139,84,120191,84,120243,84,120295,84,120347,84,120399,84,120451,84,932,84,120507,84,120565,84,120623,84,120681,84,120739,84,11430,84,5026,84,42196,84,93962,84,71868,84,66199,84,66225,84,66325,84,119854,117,119906,117,119958,117,120010,117,120062,117,120114,117,120166,117,120218,117,120270,117,120322,117,120374,117,120426,117,120478,117,42911,117,7452,117,43854,117,43858,117,651,117,965,117,120534,117,120592,117,120650,117,120708,117,120766,117,1405,117,66806,117,71896,117,8746,85,8899,85,119828,85,119880,85,119932,85,119984,85,120036,85,120088,85,120140,85,120192,85,120244,85,120296,85,120348,85,120400,85,120452,85,1357,85,4608,85,66766,85,5196,85,42228,85,94018,85,71864,85,8744,118,8897,118,65366,118,8564,118,119855,118,119907,118,119959,118,120011,118,120063,118,120115,118,120167,118,120219,118,120271,118,120323,118,120375,118,120427,118,120479,118,7456,118,957,118,120526,118,120584,118,120642,118,120700,118,120758,118,1141,118,1496,118,71430,118,43945,118,71872,118,119309,86,1639,86,1783,86,8548,86,119829,86,119881,86,119933,86,119985,86,120037,86,120089,86,120141,86,120193,86,120245,86,120297,86,120349,86,120401,86,120453,86,1140,86,11576,86,5081,86,5167,86,42719,86,42214,86,93960,86,71840,86,66845,86,623,119,119856,119,119908,119,119960,119,120012,119,120064,119,120116,119,120168,119,120220,119,120272,119,120324,119,120376,119,120428,119,120480,119,7457,119,1121,119,1309,119,1377,119,71434,119,71438,119,71439,119,43907,119,71919,87,71910,87,119830,87,119882,87,119934,87,119986,87,120038,87,120090,87,120142,87,120194,87,120246,87,120298,87,120350,87,120402,87,120454,87,1308,87,5043,87,5076,87,42218,87,5742,120,10539,120,10540,120,10799,120,65368,120,8569,120,119857,120,119909,120,119961,120,120013,120,120065,120,120117,120,120169,120,120221,120,120273,120,120325,120,120377,120,120429,120,120481,120,5441,120,5501,120,5741,88,9587,88,66338,88,71916,88,65336,88,8553,88,119831,88,119883,88,119935,88,119987,88,120039,88,120091,88,120143,88,120195,88,120247,88,120299,88,120351,88,120403,88,120455,88,42931,88,935,88,120510,88,120568,88,120626,88,120684,88,120742,88,11436,88,11613,88,5815,88,42219,88,66192,88,66228,88,66327,88,66855,88,611,121,7564,121,65369,121,119858,121,119910,121,119962,121,120014,121,120066,121,120118,121,120170,121,120222,121,120274,121,120326,121,120378,121,120430,121,120482,121,655,121,7935,121,43866,121,947,121,8509,121,120516,121,120574,121,120632,121,120690,121,120748,121,1199,121,4327,121,71900,121,65337,89,119832,89,119884,89,119936,89,119988,89,120040,89,120092,89,120144,89,120196,89,120248,89,120300,89,120352,89,120404,89,120456,89,933,89,978,89,120508,89,120566,89,120624,89,120682,89,120740,89,11432,89,1198,89,5033,89,5053,89,42220,89,94019,89,71844,89,66226,89,119859,122,119911,122,119963,122,120015,122,120067,122,120119,122,120171,122,120223,122,120275,122,120327,122,120379,122,120431,122,120483,122,7458,122,43923,122,71876,122,66293,90,71909,90,65338,90,8484,90,8488,90,119833,90,119885,90,119937,90,119989,90,120041,90,120197,90,120249,90,120301,90,120353,90,120405,90,120457,90,918,90,120493,90,120551,90,120609,90,120667,90,120725,90,5059,90,42204,90,71849,90,65282,34,65284,36,65285,37,65286,38,65290,42,65291,43,65294,46,65295,47,65296,48,65297,49,65298,50,65299,51,65300,52,65301,53,65302,54,65303,55,65304,56,65305,57,65308,60,65309,61,65310,62,65312,64,65316,68,65318,70,65319,71,65324,76,65329,81,65330,82,65333,85,65334,86,65335,87,65343,95,65346,98,65348,100,65350,102,65355,107,65357,109,65358,110,65361,113,65362,114,65364,116,65365,117,65367,119,65370,122,65371,123,65373,125,119846,109],"_default":[160,32,8211,45,65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"cs":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"de":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"es":[8211,45,65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"fr":[65374,126,65306,58,65281,33,8216,96,8245,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"it":[160,32,8211,45,65374,126,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"ja":[8211,45,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65292,44,65307,59],"ko":[8211,45,65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"pl":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"pt-BR":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"qps-ploc":[160,32,8211,45,65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"ru":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,305,105,921,73,1009,112,215,120,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"tr":[160,32,8211,45,65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"zh-hans":[65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41],"zh-hant":[8211,45,65374,126,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65307,59]}'));Z0.cache=new tZe(i=>{function e(c){const u=new Map;for(let d=0;d!c.startsWith("_")&&c in o);r.length===0&&(r=["_default"]);let s;for(const c of r){const u=e(o[c]);s=n(s,u)}const a=e(o._common),l=t(a,s);return new dy(l)});Z0._locales=new rh(()=>Object.keys(dy.ambiguousCharacterData.value).filter(i=>!i.startsWith("_")));class af{static getRawData(){return JSON.parse("[9,10,11,12,13,32,127,160,173,847,1564,4447,4448,6068,6069,6155,6156,6157,6158,7355,7356,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8203,8204,8205,8206,8207,8234,8235,8236,8237,8238,8239,8287,8288,8289,8290,8291,8292,8293,8294,8295,8296,8297,8298,8299,8300,8301,8302,8303,10240,12288,12644,65024,65025,65026,65027,65028,65029,65030,65031,65032,65033,65034,65035,65036,65037,65038,65039,65279,65440,65520,65521,65522,65523,65524,65525,65526,65527,65528,65532,78844,119155,119156,119157,119158,119159,119160,119161,119162,917504,917505,917506,917507,917508,917509,917510,917511,917512,917513,917514,917515,917516,917517,917518,917519,917520,917521,917522,917523,917524,917525,917526,917527,917528,917529,917530,917531,917532,917533,917534,917535,917536,917537,917538,917539,917540,917541,917542,917543,917544,917545,917546,917547,917548,917549,917550,917551,917552,917553,917554,917555,917556,917557,917558,917559,917560,917561,917562,917563,917564,917565,917566,917567,917568,917569,917570,917571,917572,917573,917574,917575,917576,917577,917578,917579,917580,917581,917582,917583,917584,917585,917586,917587,917588,917589,917590,917591,917592,917593,917594,917595,917596,917597,917598,917599,917600,917601,917602,917603,917604,917605,917606,917607,917608,917609,917610,917611,917612,917613,917614,917615,917616,917617,917618,917619,917620,917621,917622,917623,917624,917625,917626,917627,917628,917629,917630,917631,917760,917761,917762,917763,917764,917765,917766,917767,917768,917769,917770,917771,917772,917773,917774,917775,917776,917777,917778,917779,917780,917781,917782,917783,917784,917785,917786,917787,917788,917789,917790,917791,917792,917793,917794,917795,917796,917797,917798,917799,917800,917801,917802,917803,917804,917805,917806,917807,917808,917809,917810,917811,917812,917813,917814,917815,917816,917817,917818,917819,917820,917821,917822,917823,917824,917825,917826,917827,917828,917829,917830,917831,917832,917833,917834,917835,917836,917837,917838,917839,917840,917841,917842,917843,917844,917845,917846,917847,917848,917849,917850,917851,917852,917853,917854,917855,917856,917857,917858,917859,917860,917861,917862,917863,917864,917865,917866,917867,917868,917869,917870,917871,917872,917873,917874,917875,917876,917877,917878,917879,917880,917881,917882,917883,917884,917885,917886,917887,917888,917889,917890,917891,917892,917893,917894,917895,917896,917897,917898,917899,917900,917901,917902,917903,917904,917905,917906,917907,917908,917909,917910,917911,917912,917913,917914,917915,917916,917917,917918,917919,917920,917921,917922,917923,917924,917925,917926,917927,917928,917929,917930,917931,917932,917933,917934,917935,917936,917937,917938,917939,917940,917941,917942,917943,917944,917945,917946,917947,917948,917949,917950,917951,917952,917953,917954,917955,917956,917957,917958,917959,917960,917961,917962,917963,917964,917965,917966,917967,917968,917969,917970,917971,917972,917973,917974,917975,917976,917977,917978,917979,917980,917981,917982,917983,917984,917985,917986,917987,917988,917989,917990,917991,917992,917993,917994,917995,917996,917997,917998,917999]")}static getData(){return this._data||(this._data=new Set(af.getRawData())),this._data}static isInvisibleCharacter(e){return af.getData().has(e)}static get codePoints(){return af.getData()}}af._data=void 0;class OV{constructor(){this._zoomFactor=1}getZoomFactor(){return this._zoomFactor}}OV.INSTANCE=new OV;class vZe extends _e{constructor(){super(),this._onDidChange=this._register(new le),this.onDidChange=this._onDidChange.event,this._listener=()=>this._handleChange(!0),this._mediaQueryList=null,this._handleChange(!1)}_handleChange(e){var t;(t=this._mediaQueryList)===null||t===void 0||t.removeEventListener("change",this._listener),this._mediaQueryList=window.matchMedia(`(resolution: ${window.devicePixelRatio}dppx)`),this._mediaQueryList.addEventListener("change",this._listener),e&&this._onDidChange.fire()}}class _Ze extends _e{get value(){return this._value}constructor(){super(),this._onDidChange=this._register(new le),this.onDidChange=this._onDidChange.event,this._value=this._getPixelRatio();const e=this._register(new vZe);this._register(e.onDidChange(()=>{this._value=this._getPixelRatio(),this._onDidChange.fire(this._value)}))}_getPixelRatio(){const e=document.createElement("canvas").getContext("2d"),t=window.devicePixelRatio||1,n=e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1;return t/n}}class bZe{constructor(){this._pixelRatioMonitor=null}_getOrCreatePixelRatioMonitor(){return this._pixelRatioMonitor||(this._pixelRatioMonitor=new _Ze),this._pixelRatioMonitor}get value(){return this._getOrCreatePixelRatioMonitor().value}get onDidChange(){return this._getOrCreatePixelRatioMonitor().onDidChange}}function V_e(i,e){typeof i=="string"&&(i=window.matchMedia(i)),i.addEventListener("change",e)}const MD=new bZe;function CZe(){return OV.INSTANCE.getZoomFactor()}const gS=navigator.userAgent,Oc=gS.indexOf("Firefox")>=0,x0=gS.indexOf("AppleWebKit")>=0,Kq=gS.indexOf("Chrome")>=0,sp=!Kq&&gS.indexOf("Safari")>=0,H_e=!Kq&&!sp&&x0;gS.indexOf("Electron/")>=0;const soe=gS.indexOf("Android")>=0;let YR=!1;if(window.matchMedia){const i=window.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),e=window.matchMedia("(display-mode: fullscreen)");YR=i.matches,V_e(i,({matches:t})=>{YR&&e.matches||(YR=t)})}function wZe(){return YR}class $_e{constructor(e){this.domNode=e,this._maxWidth="",this._width="",this._height="",this._top="",this._left="",this._bottom="",this._right="",this._paddingLeft="",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=td(e);this._maxWidth!==t&&(this._maxWidth=t,this.domNode.style.maxWidth=this._maxWidth)}setWidth(e){const t=td(e);this._width!==t&&(this._width=t,this.domNode.style.width=this._width)}setHeight(e){const t=td(e);this._height!==t&&(this._height=t,this.domNode.style.height=this._height)}setTop(e){const t=td(e);this._top!==t&&(this._top=t,this.domNode.style.top=this._top)}setLeft(e){const t=td(e);this._left!==t&&(this._left=t,this.domNode.style.left=this._left)}setBottom(e){const t=td(e);this._bottom!==t&&(this._bottom=t,this.domNode.style.bottom=this._bottom)}setRight(e){const t=td(e);this._right!==t&&(this._right=t,this.domNode.style.right=this._right)}setPaddingLeft(e){const t=td(e);this._paddingLeft!==t&&(this._paddingLeft=t,this.domNode.style.paddingLeft=this._paddingLeft)}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=td(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=td(e);this._lineHeight!==t&&(this._lineHeight=t,this.domNode.style.lineHeight=this._lineHeight)}setLetterSpacing(e){const t=td(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 td(i){return typeof i=="number"?`${i}px`:i}function ti(i){return new $_e(i)}function rs(i,e){i instanceof $_e?(i.setFontFamily(e.getMassagedFontFamily()),i.setFontWeight(e.fontWeight),i.setFontSize(e.fontSize),i.setFontFeatureSettings(e.fontFeatureSettings),i.setFontVariationSettings(e.fontVariationSettings),i.setLineHeight(e.lineHeight),i.setLetterSpacing(e.letterSpacing)):(i.style.fontFamily=e.getMassagedFontFamily(),i.style.fontWeight=e.fontWeight,i.style.fontSize=e.fontSize+"px",i.style.fontFeatureSettings=e.fontFeatureSettings,i.style.fontVariationSettings=e.fontVariationSettings,i.style.lineHeight=e.lineHeight+"px",i.style.letterSpacing=e.letterSpacing+"px")}class yZe{constructor(e,t){this.chr=e,this.type=t,this.width=0}fulfill(e){this.width=e}}class qq{constructor(e,t){this._bareFontInfo=e,this._requests=t,this._container=null,this._testElements=null}read(){this._createDomElements(),document.body.appendChild(this._container),this._readFromDomElements(),document.body.removeChild(this._container),this._container=null,this._testElements=null}_createDomElements(){const e=document.createElement("div");e.style.position="absolute",e.style.top="-50000px",e.style.width="50000px";const t=document.createElement("div");rs(t,this._bareFontInfo),e.appendChild(t);const n=document.createElement("div");rs(n,this._bareFontInfo),n.style.fontWeight="bold",e.appendChild(n);const o=document.createElement("div");rs(o,this._bareFontInfo),o.style.fontStyle="italic",e.appendChild(o);const r=[];for(const s of this._requests){let a;s.type===0&&(a=t),s.type===2&&(a=n),s.type===1&&(a=o),a.appendChild(document.createElement("br"));const l=document.createElement("span");qq._render(l,s),a.appendChild(l),r.push(l)}this._container=e,this._testElements=r}static _render(e,t){if(t.chr===" "){let n="\xA0";for(let o=0;o<8;o++)n+=n;e.innerText=n}else{let n=t.chr;for(let o=0;o<8;o++)n+=n;e.textContent=n}}_readFromDomElements(){for(let e=0,t=this._requests.length;e{this._evictUntrustedReadingsTimeout=-1,this._evictUntrustedReadings()},5e3))}_evictUntrustedReadings(){const e=this._cache.getValues();let t=!1;for(const n of e)n.isTrusted||(t=!0,this._cache.remove(n));t&&this._onDidChange.fire()}readFontInfo(e){if(!this._cache.has(e)){let t=this._actualReadFontInfo(e);(t.typicalHalfwidthCharacterWidth<=2||t.typicalFullwidthCharacterWidth<=2||t.spaceWidth<=2||t.maxDigitWidth<=2)&&(t=new FV({pixelRatio:MD.value,fontFamily:t.fontFamily,fontWeight:t.fontWeight,fontSize:t.fontSize,fontFeatureSettings:t.fontFeatureSettings,fontVariationSettings:t.fontVariationSettings,lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,isMonospace:t.isMonospace,typicalHalfwidthCharacterWidth:Math.max(t.typicalHalfwidthCharacterWidth,5),typicalFullwidthCharacterWidth:Math.max(t.typicalFullwidthCharacterWidth,5),canUseHalfwidthRightwardsArrow:t.canUseHalfwidthRightwardsArrow,spaceWidth:Math.max(t.spaceWidth,5),middotWidth:Math.max(t.middotWidth,5),wsmiddotWidth:Math.max(t.wsmiddotWidth,5),maxDigitWidth:Math.max(t.maxDigitWidth,5)},!1)),this._writeToCache(e,t)}return this._cache.get(e)}_createRequest(e,t,n,o){const r=new yZe(e,t);return n.push(r),o==null||o.push(r),r}_actualReadFontInfo(e){const t=[],n=[],o=this._createRequest("n",0,t,n),r=this._createRequest("\uFF4D",0,t,null),s=this._createRequest(" ",0,t,n),a=this._createRequest("0",0,t,n),l=this._createRequest("1",0,t,n),c=this._createRequest("2",0,t,n),u=this._createRequest("3",0,t,n),d=this._createRequest("4",0,t,n),h=this._createRequest("5",0,t,n),f=this._createRequest("6",0,t,n),g=this._createRequest("7",0,t,n),p=this._createRequest("8",0,t,n),v=this._createRequest("9",0,t,n),m=this._createRequest("\u2192",0,t,n),_=this._createRequest("\uFFEB",0,t,null),w=this._createRequest("\xB7",0,t,n),y=this._createRequest(String.fromCharCode(11825),0,t,null),L="|/-_ilm%";for(let R=0,A=L.length;R.001){E=!1;break}}let k=!0;return E&&_.width!==I&&(k=!1),_.width>m.width&&(k=!1),new FV({pixelRatio:MD.value,fontFamily:e.fontFamily,fontWeight:e.fontWeight,fontSize:e.fontSize,fontFeatureSettings:e.fontFeatureSettings,fontVariationSettings:e.fontVariationSettings,lineHeight:e.lineHeight,letterSpacing:e.letterSpacing,isMonospace:E,typicalHalfwidthCharacterWidth:o.width,typicalFullwidthCharacterWidth:r.width,canUseHalfwidthRightwardsArrow:k,spaceWidth:s.width,middotWidth:w.width,wsmiddotWidth:y.width,maxDigitWidth:D},!0)}}class aoe{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 n=e.getId();this._keys[n]=e,this._values[n]=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 BV=new EZe;var Td;(function(i){i.serviceIds=new Map,i.DI_TARGET="$di$target",i.DI_DEPENDENCIES="$di$dependencies";function e(t){return t[i.DI_DEPENDENCIES]||[]}i.getServiceDependencies=e})(Td||(Td={}));const $t=wn("instantiationService");function DZe(i,e,t){e[Td.DI_TARGET]===e?e[Td.DI_DEPENDENCIES].push({id:i,index:t}):(e[Td.DI_DEPENDENCIES]=[{id:i,index:t}],e[Td.DI_TARGET]=e)}function wn(i){if(Td.serviceIds.has(i))return Td.serviceIds.get(i);const e=function(t,n,o){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");DZe(e,t,o)};return e.toString=()=>i,Td.serviceIds.set(i,e),e}const Jn=wn("codeEditorService"),Yi=wn("modelService"),$a=wn("textModelService");var fy=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};class la extends _e{constructor(e,t="",n="",o=!0,r){super(),this._onDidChange=this._register(new le),this.onDidChange=this._onDidChange.event,this._enabled=!0,this._id=e,this._label=t,this._cssClass=n,this._enabled=o,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}))}run(e,t){return fy(this,void 0,void 0,function*(){this._actionCallback&&(yield this._actionCallback(e))})}}class gy extends _e{constructor(){super(...arguments),this._onWillRun=this._register(new le),this.onWillRun=this._onWillRun.event,this._onDidRun=this._register(new le),this.onDidRun=this._onDidRun.event}run(e,t){return fy(this,void 0,void 0,function*(){if(!e.enabled)return;this._onWillRun.fire({action:e});let n;try{yield this.runAction(e,t)}catch(o){n=o}this._onDidRun.fire({action:e,error:n})})}runAction(e,t){return fy(this,void 0,void 0,function*(){yield e.run(t)})}}class kr{constructor(){this.id=kr.ID,this.label="",this.tooltip="",this.class="separator",this.enabled=!1,this.checked=!1}static join(...e){let t=[];for(const n of e)n.length&&(t.length?t=[...t,new kr,...n]:t=n);return t}run(){return fy(this,void 0,void 0,function*(){})}}kr.ID="vs.actions.separator";class py{get actions(){return this._actions}constructor(e,t,n,o){this.tooltip="",this.enabled=!0,this.checked=void 0,this.id=e,this.label=t,this.class=o,this._actions=n}run(){return fy(this,void 0,void 0,function*(){})}}class H4 extends la{constructor(){super(H4.ID,C("submenu.empty","(empty)"),void 0,!1)}}H4.ID="vs.actions.empty";function mw(i){var e,t;return{id:i.id,label:i.label,class:void 0,enabled:(e=i.enabled)!==null&&e!==void 0?e:!0,checked:(t=i.checked)!==null&&t!==void 0?t:!1,run:(...n)=>fy(this,void 0,void 0,function*(){return i.run(...n)}),tooltip:i.label}}var WV;(function(i){function e(t){return t&&typeof t=="object"&&typeof t.id=="string"}i.isThemeColor=e})(WV||(WV={}));var Mt;(function(i){i.iconNameSegment="[A-Za-z0-9]+",i.iconNameExpression="[A-Za-z0-9-]+",i.iconModifierExpression="~[A-Za-z]+",i.iconNameCharacter="[A-Za-z0-9~-]";const e=new RegExp(`^(${i.iconNameExpression})(${i.iconModifierExpression})?$`);function t(h){const f=e.exec(h.id);if(!f)return t(Xe.error);const[,g,p]=f,v=["codicon","codicon-"+g];return p&&v.push("codicon-modifier-"+p.substring(1)),v}i.asClassNameArray=t;function n(h){return t(h).join(" ")}i.asClassName=n;function o(h){return"."+t(h).join(".")}i.asCSSSelector=o;function r(h){return h&&typeof h=="object"&&typeof h.id=="string"&&(typeof h.color=="undefined"||WV.isThemeColor(h.color))}i.isThemeIcon=r;const s=new RegExp(`^\\$\\((${i.iconNameExpression}(?:${i.iconModifierExpression})?)\\)$`);function a(h){const f=s.exec(h);if(!f)return;const[,g]=f;return{id:g}}i.fromString=a;function l(h){return{id:h}}i.fromId=l;function c(h,f){let g=h.id;const p=g.lastIndexOf("~");return p!==-1&&(g=g.substring(0,p)),f&&(g=`${g}~${f}`),{id:g}}i.modify=c;function u(h){const f=h.id.lastIndexOf("~");if(f!==-1)return h.id.substring(f+1)}i.getModifier=u;function d(h,f){var g,p;return h.id===f.id&&((g=h.color)===null||g===void 0?void 0:g.id)===((p=f.color)===null||p===void 0?void 0:p.id)}i.isEqual=d})(Mt||(Mt={}));const _o=wn("commandService"),Rn=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new le,this.onDidRegisterCommand=this._onDidRegisterCommand.event}registerCommand(i,e){if(!i)throw new Error("invalid command");if(typeof i=="string"){if(!e)throw new Error("invalid command");return this.registerCommand({id:i,handler:e})}if(i.description){const s=[];for(const l of i.description.args)s.push(l.constraint);const a=i.handler;i.handler=function(l,...c){return cXe(c,s),a(l,...c)}}const{id:t}=i;let n=this._commands.get(t);n||(n=new ia,this._commands.set(t,n));const o=n.unshift(i),r=zt(()=>{o();const s=this._commands.get(t);s!=null&&s.isEmpty()&&this._commands.delete(t)});return this._onDidRegisterCommand.fire(t),r}registerCommandAlias(i,e){return Rn.registerCommand(i,(t,...n)=>t.get(_o).executeCommand(e,...n))}getCommand(i){const e=this._commands.get(i);if(!(!e||e.isEmpty()))return mn.first(e)}getCommands(){const i=new Map;for(const e of this._commands.keys()){const t=this.getCommand(e);t&&i.set(e,t)}return i}};Rn.registerCommand("noop",()=>{});function N6(...i){switch(i.length){case 1:return C("contextkey.scanner.hint.didYouMean1","Did you mean {0}?",i[0]);case 2:return C("contextkey.scanner.hint.didYouMean2","Did you mean {0} or {1}?",i[0],i[1]);case 3:return C("contextkey.scanner.hint.didYouMean3","Did you mean {0}, {1} or {2}?",i[0],i[1],i[2]);default:return}}const kZe=C("contextkey.scanner.hint.didYouForgetToOpenOrCloseQuote","Did you forget to open or close the quote?"),IZe=C("contextkey.scanner.hint.didYouForgetToEscapeSlash","Did you forget to escape the '/' (slash) character? Put two backslashes before it to escape, e.g., '\\\\/'.");class Nh{constructor(){this._input="",this._start=0,this._current=0,this._tokens=[],this._errors=[],this.stringRe=/[a-zA-Z0-9_<>\-\./\\:\*\?\+\[\]\^,#@;"%\$\p{L}-]+/uy}static getLexeme(e){switch(e.type){case 0:return"(";case 1:return")";case 2:return"!";case 3:return e.isTripleEq?"===":"==";case 4:return e.isTripleEq?"!==":"!=";case 5:return"<";case 6:return"<=";case 7:return">=";case 8:return">=";case 9:return"=~";case 10:return e.lexeme;case 11:return"true";case 12:return"false";case 13:return"in";case 14:return"not";case 15:return"&&";case 16:return"||";case 17:return e.lexeme;case 18:return e.lexeme;case 19:return e.lexeme;case 20:return"EOF";default:throw Nq(`unhandled token type: ${JSON.stringify(e)}; have you forgotten to add a case?`)}}reset(e){return this._input=e,this._start=0,this._current=0,this._tokens=[],this._errors=[],this}scan(){for(;!this._isAtEnd();)switch(this._start=this._current,this._advance()){case 40:this._addToken(0);break;case 41:this._addToken(1);break;case 33:if(this._match(61)){const t=this._match(61);this._tokens.push({type:4,offset:this._start,isTripleEq:t})}else this._addToken(2);break;case 39:this._quotedString();break;case 47:this._regex();break;case 61:if(this._match(61)){const t=this._match(61);this._tokens.push({type:3,offset:this._start,isTripleEq:t})}else this._match(126)?this._addToken(9):this._error(N6("==","=~"));break;case 60:this._addToken(this._match(61)?6:5);break;case 62:this._addToken(this._match(61)?8:7);break;case 38:this._match(38)?this._addToken(15):this._error(N6("&&"));break;case 124:this._match(124)?this._addToken(16):this._error(N6("||"));break;case 32:case 13:case 9:case 10:case 160:break;default:this._string()}return this._start=this._current,this._addToken(20),Array.from(this._tokens)}_match(e){return this._isAtEnd()||this._input.charCodeAt(this._current)!==e?!1:(this._current++,!0)}_advance(){return this._input.charCodeAt(this._current++)}_peek(){return this._isAtEnd()?0:this._input.charCodeAt(this._current)}_addToken(e){this._tokens.push({type:e,offset:this._start})}_error(e){const t=this._start,n=this._input.substring(this._start,this._current),o={type:19,offset:this._start,lexeme:n};this._errors.push({offset:t,lexeme:n,additionalInfo:e}),this._tokens.push(o)}_string(){this.stringRe.lastIndex=this._start;const e=this.stringRe.exec(this._input);if(e){this._current=this._start+e[0].length;const t=this._input.substring(this._start,this._current),n=Nh._keywords.get(t);n?this._addToken(n):this._tokens.push({type:17,lexeme:t,offset:this._start})}}_quotedString(){for(;this._peek()!==39&&!this._isAtEnd();)this._advance();if(this._isAtEnd()){this._error(kZe);return}this._advance(),this._tokens.push({type:18,lexeme:this._input.substring(this._start+1,this._current-1),offset:this._start+1})}_regex(){let e=this._current,t=!1,n=!1;for(;;){if(e>=this._input.length){this._current=e,this._error(IZe);return}const r=this._input.charCodeAt(e);if(t)t=!1;else if(r===47&&!n){e++;break}else r===91?n=!0:r===92?t=!0:r===93&&(n=!1);e++}for(;e=this._input.length}}Nh._regexFlags=new Set(["i","g","s","m","y","u"].map(i=>i.charCodeAt(0)));Nh._keywords=new Map([["not",14],["in",13],["false",12],["true",11]]);const Ls=new Map;Ls.set("false",!1);Ls.set("true",!0);Ls.set("isMac",Nn);Ls.set("isLinux",Ss);Ls.set("isWindows",as);Ls.set("isWeb",qv);Ls.set("isMacNative",Nn&&!qv);Ls.set("isEdge",LXe);Ls.set("isFirefox",SXe);Ls.set("isChrome",u_e);Ls.set("isSafari",xXe);const TZe=Object.prototype.hasOwnProperty,NZe={regexParsingWithErrorRecovery:!0},RZe=C("contextkey.parser.error.emptyString","Empty context key expression"),MZe=C("contextkey.parser.error.emptyString.hint","Did you forget to write an expression? You can also put 'false' or 'true' to always evaluate to false or true, respectively."),AZe=C("contextkey.parser.error.noInAfterNot","'in' after 'not'."),loe=C("contextkey.parser.error.closingParenthesis","closing parenthesis ')'"),PZe=C("contextkey.parser.error.unexpectedToken","Unexpected token"),OZe=C("contextkey.parser.error.unexpectedToken.hint","Did you forget to put && or || before the token?"),FZe=C("contextkey.parser.error.unexpectedEOF","Unexpected end of expression"),BZe=C("contextkey.parser.error.unexpectedEOF.hint","Did you forget to put a context key?");class a0{constructor(e=NZe){this._config=e,this._scanner=new Nh,this._tokens=[],this._current=0,this._parsingErrors=[],this._flagsGYRe=/g|y/g}parse(e){if(e===""){this._parsingErrors.push({message:RZe,offset:0,lexeme:"",additionalInfo:MZe});return}this._tokens=this._scanner.reset(e).scan(),this._current=0,this._parsingErrors=[];try{const t=this._expr();if(!this._isAtEnd()){const n=this._peek(),o=n.type===17?OZe:void 0;throw this._parsingErrors.push({message:PZe,offset:n.offset,lexeme:Nh.getLexeme(n),additionalInfo:o}),a0._parseError}return t}catch(t){if(t!==a0._parseError)throw t;return}}_expr(){return this._or()}_or(){const e=[this._and()];for(;this._matchOne(16);){const t=this._and();e.push(t)}return e.length===1?e[0]:Me.or(...e)}_and(){const e=[this._term()];for(;this._matchOne(15);){const t=this._term();e.push(t)}return e.length===1?e[0]:Me.and(...e)}_term(){if(this._matchOne(2)){const e=this._peek();switch(e.type){case 11:return this._advance(),ua.INSTANCE;case 12:return this._advance(),Ba.INSTANCE;case 0:{this._advance();const t=this._expr();return this._consume(1,loe),t==null?void 0:t.negate()}case 17:return this._advance(),Fb.create(e.lexeme);default:throw this._errExpectedButGot("KEY | true | false | '(' expression ')'",e)}}return this._primary()}_primary(){const e=this._peek();switch(e.type){case 11:return this._advance(),Me.true();case 12:return this._advance(),Me.false();case 0:{this._advance();const t=this._expr();return this._consume(1,loe),t}case 17:{const t=e.lexeme;if(this._advance(),this._matchOne(9)){const o=this._peek();if(!this._config.regexParsingWithErrorRecovery){if(this._advance(),o.type!==10)throw this._errExpectedButGot("REGEX",o);const r=o.lexeme,s=r.lastIndexOf("/"),a=s===r.length-1?void 0:this._removeFlagsGY(r.substring(s+1));let l;try{l=new RegExp(r.substring(1,s),a)}catch{throw this._errExpectedButGot("REGEX",o)}return AD.create(t,l)}switch(o.type){case 10:case 19:{const r=[o.lexeme];this._advance();let s=this._peek(),a=0;for(let h=0;h=0){const c=r.slice(a+1,l),u=r[l+1]==="i"?"i":"";try{s=new RegExp(c,u)}catch{throw this._errExpectedButGot("REGEX",o)}}}if(s===null)throw this._errExpectedButGot("REGEX",o);return AD.create(t,s)}default:throw this._errExpectedButGot("REGEX",this._peek())}}if(this._matchOne(14)){this._consume(13,AZe);const o=this._value();return Me.notIn(t,o)}switch(this._peek().type){case 3:{this._advance();const o=this._value();if(this._previous().type===18)return Me.equals(t,o);switch(o){case"true":return Me.has(t);case"false":return Me.not(t);default:return Me.equals(t,o)}}case 4:{this._advance();const o=this._value();if(this._previous().type===18)return Me.notEquals(t,o);switch(o){case"true":return Me.not(t);case"false":return Me.has(t);default:return Me.notEquals(t,o)}}case 5:return this._advance(),G4.create(t,this._value());case 6:return this._advance(),X4.create(t,this._value());case 7:return this._advance(),K4.create(t,this._value());case 8:return this._advance(),q4.create(t,this._value());case 13:return this._advance(),Me.in(t,this._value());default:return Me.has(t)}}case 20:throw this._parsingErrors.push({message:FZe,offset:e.offset,lexeme:"",additionalInfo:BZe}),a0._parseError;default:throw this._errExpectedButGot(`true | false | KEY +`))}}class k6{constructor(e){this.value=e}}const TYe=2;class le{constructor(e){var t,n,o,r,s;this._size=0,this._options=e,this._leakageMon=!((t=this._options)===null||t===void 0)&&t.leakWarningThreshold?new IYe((o=(n=this._options)===null||n===void 0?void 0:n.leakWarningThreshold)!==null&&o!==void 0?o:kYe):void 0,this._perfMon=!((r=this._options)===null||r===void 0)&&r._profName?new dw(this._options._profName):void 0,this._deliveryQueue=(s=this._options)===null||s===void 0?void 0:s.deliveryQueue}dispose(){var e,t,n,o;this._disposed||(this._disposed=!0,((e=this._deliveryQueue)===null||e===void 0?void 0:e.current)===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),(n=(t=this._options)===null||t===void 0?void 0:t.onDidRemoveLastListener)===null||n===void 0||n.call(t),(o=this._leakageMon)===null||o===void 0||o.dispose())}get event(){var e;return(e=this._event)!==null&&e!==void 0||(this._event=(t,n,o)=>{var r,s,a,l,c;if(this._leakageMon&&this._size>this._leakageMon.threshold*3)return console.warn(`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far`),_e.None;if(this._disposed)return _e.None;n&&(t=t.bind(n));const u=new k6(t);let d;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(u.stack=Hq.create(),d=this._leakageMon.check(u.stack,this._size+1)),this._listeners?this._listeners instanceof k6?((c=this._deliveryQueue)!==null&&c!==void 0||(this._deliveryQueue=new L_e),this._listeners=[this._listeners,u]):this._listeners.push(u):((s=(r=this._options)===null||r===void 0?void 0:r.onWillAddFirstListener)===null||s===void 0||s.call(r,this),this._listeners=u,(l=(a=this._options)===null||a===void 0?void 0:a.onDidAddFirstListener)===null||l===void 0||l.call(a,this)),this._size++;const h=zt(()=>{d==null||d(),this._removeListener(u)});return o instanceof Be?o.add(h):Array.isArray(o)&&o.push(h),h}),this._event}_removeListener(e){var t,n,o,r;if((n=(t=this._options)===null||t===void 0?void 0:t.onWillRemoveListener)===null||n===void 0||n.call(t,this),!this._listeners)return;if(this._size===1){this._listeners=void 0,(r=(o=this._options)===null||o===void 0?void 0:o.onDidRemoveLastListener)===null||r===void 0||r.call(o,this),this._size=0;return}const s=this._listeners,a=s.indexOf(e);if(a===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,s[a]=void 0;const l=this._deliveryQueue.current===this;if(this._size*TYe<=s.length){let c=0;for(let u=0;u0}}const NYe=()=>new L_e;class L_e{constructor(){this.i=-1,this.end=0}enqueue(e,t,n){this.i=0,this.end=n,this.current=e,this.value=t}reset(){this.i=this.end,this.current=void 0,this.value=void 0}}class G0 extends le{constructor(e){super(e),this._isPaused=0,this._eventQueue=new oa,this._mergeFn=e==null?void 0:e.merge}pause(){this._isPaused++}resume(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){if(this._eventQueue.size>0){const e=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(e))}}else for(;!this._isPaused&&this._eventQueue.size!==0;)super.fire(this._eventQueue.shift())}fire(e){this._size&&(this._isPaused!==0?this._eventQueue.push(e):super.fire(e))}}class E_e extends G0{constructor(e){var t;super(e),this._delay=(t=e.delay)!==null&&t!==void 0?t:100}fire(e){this._handle||(this.pause(),this._handle=setTimeout(()=>{this._handle=void 0,this.resume()},this._delay)),super.fire(e)}}class RYe extends le{constructor(e){super(e),this._queuedEvents=[],this._mergeFn=e==null?void 0:e.merge}fire(e){!this.hasListeners()||(this._queuedEvents.push(e),this._queuedEvents.length===1&&queueMicrotask(()=>{this._mergeFn?super.fire(this._mergeFn(this._queuedEvents)):this._queuedEvents.forEach(t=>super.fire(t)),this._queuedEvents=[]}))}}class MYe{constructor(){this.hasListeners=!1,this.events=[],this.emitter=new le({onWillAddFirstListener:()=>this.onFirstListenerAdd(),onDidRemoveLastListener:()=>this.onLastListenerRemove()})}get event(){return this.emitter.event}add(e){const t={event:e,listener:null};return this.events.push(t),this.hasListeners&&this.hook(t),zt(bv(()=>{this.hasListeners&&this.unhook(t);const o=this.events.indexOf(t);this.events.splice(o,1)}))}onFirstListenerAdd(){this.hasListeners=!0,this.events.forEach(e=>this.hook(e))}onLastListenerRemove(){this.hasListeners=!1,this.events.forEach(e=>this.unhook(e))}hook(e){e.listener=e.event(t=>this.emitter.fire(t))}unhook(e){e.listener&&e.listener.dispose(),e.listener=null}dispose(){this.emitter.dispose()}}class $q{constructor(){this.buffers=[]}wrapEvent(e){return(t,n,o)=>e(r=>{const s=this.buffers[this.buffers.length-1];s?s.push(()=>t.call(n,r)):t.call(n,r)},void 0,o)}bufferEvents(e){const t=[];this.buffers.push(t);const n=e();return this.buffers.pop(),t.forEach(o=>o()),n}}class coe{constructor(){this.listening=!1,this.inputEvent=st.None,this.inputEventListener=_e.None,this.emitter=new le({onDidAddFirstListener:()=>{this.listening=!0,this.inputEventListener=this.inputEvent(this.emitter.fire,this.emitter)},onDidRemoveLastListener:()=>{this.listening=!1,this.inputEventListener.dispose()}}),this.event=this.emitter.event}set input(e){this.inputEvent=e,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=e(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(),this.emitter.dispose()}}const D_e=Object.freeze(function(i,e){const t=setTimeout(i.bind(e),0);return{dispose(){clearTimeout(t)}}});var _n;(function(i){function e(t){return t===i.None||t===i.Cancelled||t instanceof ZR?!0:!t||typeof t!="object"?!1:typeof t.isCancellationRequested=="boolean"&&typeof t.onCancellationRequested=="function"}i.isCancellationToken=e,i.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:st.None}),i.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:D_e})})(_n||(_n={}));class ZR{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?D_e:(this._emitter||(this._emitter=new le),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}}class Ro{constructor(e){this._token=void 0,this._parentListener=void 0,this._parentListener=e&&e.onCancellationRequested(this.cancel,this)}get token(){return this._token||(this._token=new ZR),this._token}cancel(){this._token?this._token instanceof ZR&&this._token.cancel():this._token=_n.Cancelled}dispose(e=!1){var t;e&&this.cancel(),(t=this._parentListener)===null||t===void 0||t.dispose(),this._token?this._token instanceof ZR&&this._token.dispose():this._token=_n.None}}class zq{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()]||0}}const QR=new zq,qW=new zq,GW=new zq,k_e=new Array(230),AYe=Object.create(null),PYe=Object.create(null),Uq=[];for(let i=0;i<=193;i++)Uq[i]=-1;(function(){const i="",e=[[1,0,"None",0,"unknown",0,"VK_UNKNOWN",i,i],[1,1,"Hyper",0,i,0,i,i,i],[1,2,"Super",0,i,0,i,i,i],[1,3,"Fn",0,i,0,i,i,i],[1,4,"FnLock",0,i,0,i,i,i],[1,5,"Suspend",0,i,0,i,i,i],[1,6,"Resume",0,i,0,i,i,i],[1,7,"Turbo",0,i,0,i,i,i],[1,8,"Sleep",0,i,0,"VK_SLEEP",i,i],[1,9,"WakeUp",0,i,0,i,i,i],[0,10,"KeyA",31,"A",65,"VK_A",i,i],[0,11,"KeyB",32,"B",66,"VK_B",i,i],[0,12,"KeyC",33,"C",67,"VK_C",i,i],[0,13,"KeyD",34,"D",68,"VK_D",i,i],[0,14,"KeyE",35,"E",69,"VK_E",i,i],[0,15,"KeyF",36,"F",70,"VK_F",i,i],[0,16,"KeyG",37,"G",71,"VK_G",i,i],[0,17,"KeyH",38,"H",72,"VK_H",i,i],[0,18,"KeyI",39,"I",73,"VK_I",i,i],[0,19,"KeyJ",40,"J",74,"VK_J",i,i],[0,20,"KeyK",41,"K",75,"VK_K",i,i],[0,21,"KeyL",42,"L",76,"VK_L",i,i],[0,22,"KeyM",43,"M",77,"VK_M",i,i],[0,23,"KeyN",44,"N",78,"VK_N",i,i],[0,24,"KeyO",45,"O",79,"VK_O",i,i],[0,25,"KeyP",46,"P",80,"VK_P",i,i],[0,26,"KeyQ",47,"Q",81,"VK_Q",i,i],[0,27,"KeyR",48,"R",82,"VK_R",i,i],[0,28,"KeyS",49,"S",83,"VK_S",i,i],[0,29,"KeyT",50,"T",84,"VK_T",i,i],[0,30,"KeyU",51,"U",85,"VK_U",i,i],[0,31,"KeyV",52,"V",86,"VK_V",i,i],[0,32,"KeyW",53,"W",87,"VK_W",i,i],[0,33,"KeyX",54,"X",88,"VK_X",i,i],[0,34,"KeyY",55,"Y",89,"VK_Y",i,i],[0,35,"KeyZ",56,"Z",90,"VK_Z",i,i],[0,36,"Digit1",22,"1",49,"VK_1",i,i],[0,37,"Digit2",23,"2",50,"VK_2",i,i],[0,38,"Digit3",24,"3",51,"VK_3",i,i],[0,39,"Digit4",25,"4",52,"VK_4",i,i],[0,40,"Digit5",26,"5",53,"VK_5",i,i],[0,41,"Digit6",27,"6",54,"VK_6",i,i],[0,42,"Digit7",28,"7",55,"VK_7",i,i],[0,43,"Digit8",29,"8",56,"VK_8",i,i],[0,44,"Digit9",30,"9",57,"VK_9",i,i],[0,45,"Digit0",21,"0",48,"VK_0",i,i],[1,46,"Enter",3,"Enter",13,"VK_RETURN",i,i],[1,47,"Escape",9,"Escape",27,"VK_ESCAPE",i,i],[1,48,"Backspace",1,"Backspace",8,"VK_BACK",i,i],[1,49,"Tab",2,"Tab",9,"VK_TAB",i,i],[1,50,"Space",10,"Space",32,"VK_SPACE",i,i],[0,51,"Minus",88,"-",189,"VK_OEM_MINUS","-","OEM_MINUS"],[0,52,"Equal",86,"=",187,"VK_OEM_PLUS","=","OEM_PLUS"],[0,53,"BracketLeft",92,"[",219,"VK_OEM_4","[","OEM_4"],[0,54,"BracketRight",94,"]",221,"VK_OEM_6","]","OEM_6"],[0,55,"Backslash",93,"\\",220,"VK_OEM_5","\\","OEM_5"],[0,56,"IntlHash",0,i,0,i,i,i],[0,57,"Semicolon",85,";",186,"VK_OEM_1",";","OEM_1"],[0,58,"Quote",95,"'",222,"VK_OEM_7","'","OEM_7"],[0,59,"Backquote",91,"`",192,"VK_OEM_3","`","OEM_3"],[0,60,"Comma",87,",",188,"VK_OEM_COMMA",",","OEM_COMMA"],[0,61,"Period",89,".",190,"VK_OEM_PERIOD",".","OEM_PERIOD"],[0,62,"Slash",90,"/",191,"VK_OEM_2","/","OEM_2"],[1,63,"CapsLock",8,"CapsLock",20,"VK_CAPITAL",i,i],[1,64,"F1",59,"F1",112,"VK_F1",i,i],[1,65,"F2",60,"F2",113,"VK_F2",i,i],[1,66,"F3",61,"F3",114,"VK_F3",i,i],[1,67,"F4",62,"F4",115,"VK_F4",i,i],[1,68,"F5",63,"F5",116,"VK_F5",i,i],[1,69,"F6",64,"F6",117,"VK_F6",i,i],[1,70,"F7",65,"F7",118,"VK_F7",i,i],[1,71,"F8",66,"F8",119,"VK_F8",i,i],[1,72,"F9",67,"F9",120,"VK_F9",i,i],[1,73,"F10",68,"F10",121,"VK_F10",i,i],[1,74,"F11",69,"F11",122,"VK_F11",i,i],[1,75,"F12",70,"F12",123,"VK_F12",i,i],[1,76,"PrintScreen",0,i,0,i,i,i],[1,77,"ScrollLock",84,"ScrollLock",145,"VK_SCROLL",i,i],[1,78,"Pause",7,"PauseBreak",19,"VK_PAUSE",i,i],[1,79,"Insert",19,"Insert",45,"VK_INSERT",i,i],[1,80,"Home",14,"Home",36,"VK_HOME",i,i],[1,81,"PageUp",11,"PageUp",33,"VK_PRIOR",i,i],[1,82,"Delete",20,"Delete",46,"VK_DELETE",i,i],[1,83,"End",13,"End",35,"VK_END",i,i],[1,84,"PageDown",12,"PageDown",34,"VK_NEXT",i,i],[1,85,"ArrowRight",17,"RightArrow",39,"VK_RIGHT","Right",i],[1,86,"ArrowLeft",15,"LeftArrow",37,"VK_LEFT","Left",i],[1,87,"ArrowDown",18,"DownArrow",40,"VK_DOWN","Down",i],[1,88,"ArrowUp",16,"UpArrow",38,"VK_UP","Up",i],[1,89,"NumLock",83,"NumLock",144,"VK_NUMLOCK",i,i],[1,90,"NumpadDivide",113,"NumPad_Divide",111,"VK_DIVIDE",i,i],[1,91,"NumpadMultiply",108,"NumPad_Multiply",106,"VK_MULTIPLY",i,i],[1,92,"NumpadSubtract",111,"NumPad_Subtract",109,"VK_SUBTRACT",i,i],[1,93,"NumpadAdd",109,"NumPad_Add",107,"VK_ADD",i,i],[1,94,"NumpadEnter",3,i,0,i,i,i],[1,95,"Numpad1",99,"NumPad1",97,"VK_NUMPAD1",i,i],[1,96,"Numpad2",100,"NumPad2",98,"VK_NUMPAD2",i,i],[1,97,"Numpad3",101,"NumPad3",99,"VK_NUMPAD3",i,i],[1,98,"Numpad4",102,"NumPad4",100,"VK_NUMPAD4",i,i],[1,99,"Numpad5",103,"NumPad5",101,"VK_NUMPAD5",i,i],[1,100,"Numpad6",104,"NumPad6",102,"VK_NUMPAD6",i,i],[1,101,"Numpad7",105,"NumPad7",103,"VK_NUMPAD7",i,i],[1,102,"Numpad8",106,"NumPad8",104,"VK_NUMPAD8",i,i],[1,103,"Numpad9",107,"NumPad9",105,"VK_NUMPAD9",i,i],[1,104,"Numpad0",98,"NumPad0",96,"VK_NUMPAD0",i,i],[1,105,"NumpadDecimal",112,"NumPad_Decimal",110,"VK_DECIMAL",i,i],[0,106,"IntlBackslash",97,"OEM_102",226,"VK_OEM_102",i,i],[1,107,"ContextMenu",58,"ContextMenu",93,i,i,i],[1,108,"Power",0,i,0,i,i,i],[1,109,"NumpadEqual",0,i,0,i,i,i],[1,110,"F13",71,"F13",124,"VK_F13",i,i],[1,111,"F14",72,"F14",125,"VK_F14",i,i],[1,112,"F15",73,"F15",126,"VK_F15",i,i],[1,113,"F16",74,"F16",127,"VK_F16",i,i],[1,114,"F17",75,"F17",128,"VK_F17",i,i],[1,115,"F18",76,"F18",129,"VK_F18",i,i],[1,116,"F19",77,"F19",130,"VK_F19",i,i],[1,117,"F20",78,"F20",131,"VK_F20",i,i],[1,118,"F21",79,"F21",132,"VK_F21",i,i],[1,119,"F22",80,"F22",133,"VK_F22",i,i],[1,120,"F23",81,"F23",134,"VK_F23",i,i],[1,121,"F24",82,"F24",135,"VK_F24",i,i],[1,122,"Open",0,i,0,i,i,i],[1,123,"Help",0,i,0,i,i,i],[1,124,"Select",0,i,0,i,i,i],[1,125,"Again",0,i,0,i,i,i],[1,126,"Undo",0,i,0,i,i,i],[1,127,"Cut",0,i,0,i,i,i],[1,128,"Copy",0,i,0,i,i,i],[1,129,"Paste",0,i,0,i,i,i],[1,130,"Find",0,i,0,i,i,i],[1,131,"AudioVolumeMute",117,"AudioVolumeMute",173,"VK_VOLUME_MUTE",i,i],[1,132,"AudioVolumeUp",118,"AudioVolumeUp",175,"VK_VOLUME_UP",i,i],[1,133,"AudioVolumeDown",119,"AudioVolumeDown",174,"VK_VOLUME_DOWN",i,i],[1,134,"NumpadComma",110,"NumPad_Separator",108,"VK_SEPARATOR",i,i],[0,135,"IntlRo",115,"ABNT_C1",193,"VK_ABNT_C1",i,i],[1,136,"KanaMode",0,i,0,i,i,i],[0,137,"IntlYen",0,i,0,i,i,i],[1,138,"Convert",0,i,0,i,i,i],[1,139,"NonConvert",0,i,0,i,i,i],[1,140,"Lang1",0,i,0,i,i,i],[1,141,"Lang2",0,i,0,i,i,i],[1,142,"Lang3",0,i,0,i,i,i],[1,143,"Lang4",0,i,0,i,i,i],[1,144,"Lang5",0,i,0,i,i,i],[1,145,"Abort",0,i,0,i,i,i],[1,146,"Props",0,i,0,i,i,i],[1,147,"NumpadParenLeft",0,i,0,i,i,i],[1,148,"NumpadParenRight",0,i,0,i,i,i],[1,149,"NumpadBackspace",0,i,0,i,i,i],[1,150,"NumpadMemoryStore",0,i,0,i,i,i],[1,151,"NumpadMemoryRecall",0,i,0,i,i,i],[1,152,"NumpadMemoryClear",0,i,0,i,i,i],[1,153,"NumpadMemoryAdd",0,i,0,i,i,i],[1,154,"NumpadMemorySubtract",0,i,0,i,i,i],[1,155,"NumpadClear",131,"Clear",12,"VK_CLEAR",i,i],[1,156,"NumpadClearEntry",0,i,0,i,i,i],[1,0,i,5,"Ctrl",17,"VK_CONTROL",i,i],[1,0,i,4,"Shift",16,"VK_SHIFT",i,i],[1,0,i,6,"Alt",18,"VK_MENU",i,i],[1,0,i,57,"Meta",91,"VK_COMMAND",i,i],[1,157,"ControlLeft",5,i,0,"VK_LCONTROL",i,i],[1,158,"ShiftLeft",4,i,0,"VK_LSHIFT",i,i],[1,159,"AltLeft",6,i,0,"VK_LMENU",i,i],[1,160,"MetaLeft",57,i,0,"VK_LWIN",i,i],[1,161,"ControlRight",5,i,0,"VK_RCONTROL",i,i],[1,162,"ShiftRight",4,i,0,"VK_RSHIFT",i,i],[1,163,"AltRight",6,i,0,"VK_RMENU",i,i],[1,164,"MetaRight",57,i,0,"VK_RWIN",i,i],[1,165,"BrightnessUp",0,i,0,i,i,i],[1,166,"BrightnessDown",0,i,0,i,i,i],[1,167,"MediaPlay",0,i,0,i,i,i],[1,168,"MediaRecord",0,i,0,i,i,i],[1,169,"MediaFastForward",0,i,0,i,i,i],[1,170,"MediaRewind",0,i,0,i,i,i],[1,171,"MediaTrackNext",124,"MediaTrackNext",176,"VK_MEDIA_NEXT_TRACK",i,i],[1,172,"MediaTrackPrevious",125,"MediaTrackPrevious",177,"VK_MEDIA_PREV_TRACK",i,i],[1,173,"MediaStop",126,"MediaStop",178,"VK_MEDIA_STOP",i,i],[1,174,"Eject",0,i,0,i,i,i],[1,175,"MediaPlayPause",127,"MediaPlayPause",179,"VK_MEDIA_PLAY_PAUSE",i,i],[1,176,"MediaSelect",128,"LaunchMediaPlayer",181,"VK_MEDIA_LAUNCH_MEDIA_SELECT",i,i],[1,177,"LaunchMail",129,"LaunchMail",180,"VK_MEDIA_LAUNCH_MAIL",i,i],[1,178,"LaunchApp2",130,"LaunchApp2",183,"VK_MEDIA_LAUNCH_APP2",i,i],[1,179,"LaunchApp1",0,i,0,"VK_MEDIA_LAUNCH_APP1",i,i],[1,180,"SelectTask",0,i,0,i,i,i],[1,181,"LaunchScreenSaver",0,i,0,i,i,i],[1,182,"BrowserSearch",120,"BrowserSearch",170,"VK_BROWSER_SEARCH",i,i],[1,183,"BrowserHome",121,"BrowserHome",172,"VK_BROWSER_HOME",i,i],[1,184,"BrowserBack",122,"BrowserBack",166,"VK_BROWSER_BACK",i,i],[1,185,"BrowserForward",123,"BrowserForward",167,"VK_BROWSER_FORWARD",i,i],[1,186,"BrowserStop",0,i,0,"VK_BROWSER_STOP",i,i],[1,187,"BrowserRefresh",0,i,0,"VK_BROWSER_REFRESH",i,i],[1,188,"BrowserFavorites",0,i,0,"VK_BROWSER_FAVORITES",i,i],[1,189,"ZoomToggle",0,i,0,i,i,i],[1,190,"MailReply",0,i,0,i,i,i],[1,191,"MailForward",0,i,0,i,i,i],[1,192,"MailSend",0,i,0,i,i,i],[1,0,i,114,"KeyInComposition",229,i,i,i],[1,0,i,116,"ABNT_C2",194,"VK_ABNT_C2",i,i],[1,0,i,96,"OEM_8",223,"VK_OEM_8",i,i],[1,0,i,0,i,0,"VK_KANA",i,i],[1,0,i,0,i,0,"VK_HANGUL",i,i],[1,0,i,0,i,0,"VK_JUNJA",i,i],[1,0,i,0,i,0,"VK_FINAL",i,i],[1,0,i,0,i,0,"VK_HANJA",i,i],[1,0,i,0,i,0,"VK_KANJI",i,i],[1,0,i,0,i,0,"VK_CONVERT",i,i],[1,0,i,0,i,0,"VK_NONCONVERT",i,i],[1,0,i,0,i,0,"VK_ACCEPT",i,i],[1,0,i,0,i,0,"VK_MODECHANGE",i,i],[1,0,i,0,i,0,"VK_SELECT",i,i],[1,0,i,0,i,0,"VK_PRINT",i,i],[1,0,i,0,i,0,"VK_EXECUTE",i,i],[1,0,i,0,i,0,"VK_SNAPSHOT",i,i],[1,0,i,0,i,0,"VK_HELP",i,i],[1,0,i,0,i,0,"VK_APPS",i,i],[1,0,i,0,i,0,"VK_PROCESSKEY",i,i],[1,0,i,0,i,0,"VK_PACKET",i,i],[1,0,i,0,i,0,"VK_DBE_SBCSCHAR",i,i],[1,0,i,0,i,0,"VK_DBE_DBCSCHAR",i,i],[1,0,i,0,i,0,"VK_ATTN",i,i],[1,0,i,0,i,0,"VK_CRSEL",i,i],[1,0,i,0,i,0,"VK_EXSEL",i,i],[1,0,i,0,i,0,"VK_EREOF",i,i],[1,0,i,0,i,0,"VK_PLAY",i,i],[1,0,i,0,i,0,"VK_ZOOM",i,i],[1,0,i,0,i,0,"VK_NONAME",i,i],[1,0,i,0,i,0,"VK_PA1",i,i],[1,0,i,0,i,0,"VK_OEM_CLEAR",i,i]],t=[],n=[];for(const o of e){const[r,s,a,l,c,u,d,h,f]=o;if(n[s]||(n[s]=!0,AYe[a]=s,PYe[a.toLowerCase()]=s,r&&(Uq[s]=l)),!t[l]){if(t[l]=!0,!c)throw new Error(`String representation missing for key code ${l} around scan code ${a}`);QR.define(l,c),qW.define(l,h||c),GW.define(l,f||h||c)}u&&(k_e[u]=l)}})();var Sg;(function(i){function e(a){return QR.keyCodeToStr(a)}i.toString=e;function t(a){return QR.strToKeyCode(a)}i.fromString=t;function n(a){return qW.keyCodeToStr(a)}i.toUserSettingsUS=n;function o(a){return GW.keyCodeToStr(a)}i.toUserSettingsGeneral=o;function r(a){return qW.strToKeyCode(a)||GW.strToKeyCode(a)}i.fromUserSettings=r;function s(a){if(a>=98&&a<=113)return null;switch(a){case 16:return"Up";case 18:return"Down";case 15:return"Left";case 17:return"Right"}return QR.keyCodeToStr(a)}i.toElectronAccelerator=s})(Sg||(Sg={}));function Zo(i,e){const t=(e&65535)<<16>>>0;return(i|t)>>>0}let py;if(typeof Iu.vscode!="undefined"&&typeof Iu.vscode.process!="undefined"){const i=Iu.vscode.process;py={get platform(){return i.platform},get arch(){return i.arch},get env(){return i.env},cwd(){return i.cwd()}}}else typeof process!="undefined"?py={get platform(){return process.platform},get arch(){return process.arch},get env(){return process.env},cwd(){return process.env.VSCODE_CWD||process.cwd()}}:py={get platform(){return ls?"win32":Nn?"darwin":"linux"},get arch(){},get env(){return{}},cwd(){return"/"}};const FA=py.cwd,I_e=py.env,OYe=py.platform,FYe=65,BYe=97,WYe=90,VYe=122,jm=46,Ps=47,Dl=92,Fp=58,HYe=63;class T_e extends Error{constructor(e,t,n){let o;typeof t=="string"&&t.indexOf("not ")===0?(o="must not be",t=t.replace(/^not /,"")):o="must be";const r=e.indexOf(".")!==-1?"property":"argument";let s=`The "${e}" ${r} ${o} of type ${t}`;s+=`. Received type ${typeof n}`,super(s),this.code="ERR_INVALID_ARG_TYPE"}}function $Ye(i,e){if(i===null||typeof i!="object")throw new T_e(e,"Object",i)}function wr(i,e){if(typeof i!="string")throw new T_e(e,"string",i)}const Xv=OYe==="win32";function li(i){return i===Ps||i===Dl}function XW(i){return i===Ps}function Bp(i){return i>=FYe&&i<=WYe||i>=BYe&&i<=VYe}function BA(i,e,t,n){let o="",r=0,s=-1,a=0,l=0;for(let c=0;c<=i.length;++c){if(c2){const u=o.lastIndexOf(t);u===-1?(o="",r=0):(o=o.slice(0,u),r=o.length-1-o.lastIndexOf(t)),s=c,a=0;continue}else if(o.length!==0){o="",r=0,s=c,a=0;continue}}e&&(o+=o.length>0?`${t}..`:"..",r=2)}else o.length>0?o+=`${t}${i.slice(s+1,c)}`:o=i.slice(s+1,c),r=c-s-1;s=c,a=0}else l===jm&&a!==-1?++a:a=-1}return o}function N_e(i,e){$Ye(e,"pathObject");const t=e.dir||e.root,n=e.base||`${e.name||""}${e.ext||""}`;return t?t===e.root?`${t}${n}`:`${t}${i}${n}`:n}const ol={resolve(...i){let e="",t="",n=!1;for(let o=i.length-1;o>=-1;o--){let r;if(o>=0){if(r=i[o],wr(r,"path"),r.length===0)continue}else e.length===0?r=FA():(r=I_e[`=${e}`]||FA(),(r===void 0||r.slice(0,2).toLowerCase()!==e.toLowerCase()&&r.charCodeAt(2)===Dl)&&(r=`${e}\\`));const s=r.length;let a=0,l="",c=!1;const u=r.charCodeAt(0);if(s===1)li(u)&&(a=1,c=!0);else if(li(u))if(c=!0,li(r.charCodeAt(1))){let d=2,h=d;for(;d2&&li(r.charCodeAt(2))&&(c=!0,a=3));if(l.length>0)if(e.length>0){if(l.toLowerCase()!==e.toLowerCase())continue}else e=l;if(n){if(e.length>0)break}else if(t=`${r.slice(a)}\\${t}`,n=c,c&&e.length>0)break}return t=BA(t,!n,"\\",li),n?`${e}\\${t}`:`${e}${t}`||"."},normalize(i){wr(i,"path");const e=i.length;if(e===0)return".";let t=0,n,o=!1;const r=i.charCodeAt(0);if(e===1)return XW(r)?"\\":i;if(li(r))if(o=!0,li(i.charCodeAt(1))){let a=2,l=a;for(;a2&&li(i.charCodeAt(2))&&(o=!0,t=3));let s=t0&&li(i.charCodeAt(e-1))&&(s+="\\"),n===void 0?o?`\\${s}`:s:o?`${n}\\${s}`:`${n}${s}`},isAbsolute(i){wr(i,"path");const e=i.length;if(e===0)return!1;const t=i.charCodeAt(0);return li(t)||e>2&&Bp(t)&&i.charCodeAt(1)===Fp&&li(i.charCodeAt(2))},join(...i){if(i.length===0)return".";let e,t;for(let r=0;r0&&(e===void 0?e=t=s:e+=`\\${s}`)}if(e===void 0)return".";let n=!0,o=0;if(typeof t=="string"&&li(t.charCodeAt(0))){++o;const r=t.length;r>1&&li(t.charCodeAt(1))&&(++o,r>2&&(li(t.charCodeAt(2))?++o:n=!1))}if(n){for(;o=2&&(e=`\\${e.slice(o)}`)}return ol.normalize(e)},relative(i,e){if(wr(i,"from"),wr(e,"to"),i===e)return"";const t=ol.resolve(i),n=ol.resolve(e);if(t===n||(i=t.toLowerCase(),e=n.toLowerCase(),i===e))return"";let o=0;for(;oo&&i.charCodeAt(r-1)===Dl;)r--;const s=r-o;let a=0;for(;aa&&e.charCodeAt(l-1)===Dl;)l--;const c=l-a,u=su){if(e.charCodeAt(a+h)===Dl)return n.slice(a+h+1);if(h===2)return n.slice(a+h)}s>u&&(i.charCodeAt(o+h)===Dl?d=h:h===2&&(d=3)),d===-1&&(d=0)}let f="";for(h=o+d+1;h<=r;++h)(h===r||i.charCodeAt(h)===Dl)&&(f+=f.length===0?"..":"\\..");return a+=d,f.length>0?`${f}${n.slice(a,l)}`:(n.charCodeAt(a)===Dl&&++a,n.slice(a,l))},toNamespacedPath(i){if(typeof i!="string"||i.length===0)return i;const e=ol.resolve(i);if(e.length<=2)return i;if(e.charCodeAt(0)===Dl){if(e.charCodeAt(1)===Dl){const t=e.charCodeAt(2);if(t!==HYe&&t!==jm)return`\\\\?\\UNC\\${e.slice(2)}`}}else if(Bp(e.charCodeAt(0))&&e.charCodeAt(1)===Fp&&e.charCodeAt(2)===Dl)return`\\\\?\\${e}`;return i},dirname(i){wr(i,"path");const e=i.length;if(e===0)return".";let t=-1,n=0;const o=i.charCodeAt(0);if(e===1)return li(o)?i:".";if(li(o)){if(t=n=1,li(i.charCodeAt(1))){let a=2,l=a;for(;a2&&li(i.charCodeAt(2))?3:2,n=t);let r=-1,s=!0;for(let a=e-1;a>=n;--a)if(li(i.charCodeAt(a))){if(!s){r=a;break}}else s=!1;if(r===-1){if(t===-1)return".";r=t}return i.slice(0,r)},basename(i,e){e!==void 0&&wr(e,"ext"),wr(i,"path");let t=0,n=-1,o=!0,r;if(i.length>=2&&Bp(i.charCodeAt(0))&&i.charCodeAt(1)===Fp&&(t=2),e!==void 0&&e.length>0&&e.length<=i.length){if(e===i)return"";let s=e.length-1,a=-1;for(r=i.length-1;r>=t;--r){const l=i.charCodeAt(r);if(li(l)){if(!o){t=r+1;break}}else a===-1&&(o=!1,a=r+1),s>=0&&(l===e.charCodeAt(s)?--s===-1&&(n=r):(s=-1,n=a))}return t===n?n=a:n===-1&&(n=i.length),i.slice(t,n)}for(r=i.length-1;r>=t;--r)if(li(i.charCodeAt(r))){if(!o){t=r+1;break}}else n===-1&&(o=!1,n=r+1);return n===-1?"":i.slice(t,n)},extname(i){wr(i,"path");let e=0,t=-1,n=0,o=-1,r=!0,s=0;i.length>=2&&i.charCodeAt(1)===Fp&&Bp(i.charCodeAt(0))&&(e=n=2);for(let a=i.length-1;a>=e;--a){const l=i.charCodeAt(a);if(li(l)){if(!r){n=a+1;break}continue}o===-1&&(r=!1,o=a+1),l===jm?t===-1?t=a:s!==1&&(s=1):t!==-1&&(s=-1)}return t===-1||o===-1||s===0||s===1&&t===o-1&&t===n+1?"":i.slice(t,o)},format:N_e.bind(null,"\\"),parse(i){wr(i,"path");const e={root:"",dir:"",base:"",ext:"",name:""};if(i.length===0)return e;const t=i.length;let n=0,o=i.charCodeAt(0);if(t===1)return li(o)?(e.root=e.dir=i,e):(e.base=e.name=i,e);if(li(o)){if(n=1,li(i.charCodeAt(1))){let d=2,h=d;for(;d0&&(e.root=i.slice(0,n));let r=-1,s=n,a=-1,l=!0,c=i.length-1,u=0;for(;c>=n;--c){if(o=i.charCodeAt(c),li(o)){if(!l){s=c+1;break}continue}a===-1&&(l=!1,a=c+1),o===jm?r===-1?r=c:u!==1&&(u=1):r!==-1&&(u=-1)}return a!==-1&&(r===-1||u===0||u===1&&r===a-1&&r===s+1?e.base=e.name=i.slice(s,a):(e.name=i.slice(s,r),e.base=i.slice(s,a),e.ext=i.slice(r,a))),s>0&&s!==n?e.dir=i.slice(0,s-1):e.dir=e.root,e},sep:"\\",delimiter:";",win32:null,posix:null},zYe=(()=>{if(Xv){const i=/\\/g;return()=>{const e=FA().replace(i,"/");return e.slice(e.indexOf("/"))}}return()=>FA()})(),Go={resolve(...i){let e="",t=!1;for(let n=i.length-1;n>=-1&&!t;n--){const o=n>=0?i[n]:zYe();wr(o,"path"),o.length!==0&&(e=`${o}/${e}`,t=o.charCodeAt(0)===Ps)}return e=BA(e,!t,"/",XW),t?`/${e}`:e.length>0?e:"."},normalize(i){if(wr(i,"path"),i.length===0)return".";const e=i.charCodeAt(0)===Ps,t=i.charCodeAt(i.length-1)===Ps;return i=BA(i,!e,"/",XW),i.length===0?e?"/":t?"./":".":(t&&(i+="/"),e?`/${i}`:i)},isAbsolute(i){return wr(i,"path"),i.length>0&&i.charCodeAt(0)===Ps},join(...i){if(i.length===0)return".";let e;for(let t=0;t0&&(e===void 0?e=n:e+=`/${n}`)}return e===void 0?".":Go.normalize(e)},relative(i,e){if(wr(i,"from"),wr(e,"to"),i===e||(i=Go.resolve(i),e=Go.resolve(e),i===e))return"";const t=1,n=i.length,o=n-t,r=1,s=e.length-r,a=oa){if(e.charCodeAt(r+c)===Ps)return e.slice(r+c+1);if(c===0)return e.slice(r+c)}else o>a&&(i.charCodeAt(t+c)===Ps?l=c:c===0&&(l=0));let u="";for(c=t+l+1;c<=n;++c)(c===n||i.charCodeAt(c)===Ps)&&(u+=u.length===0?"..":"/..");return`${u}${e.slice(r+l)}`},toNamespacedPath(i){return i},dirname(i){if(wr(i,"path"),i.length===0)return".";const e=i.charCodeAt(0)===Ps;let t=-1,n=!0;for(let o=i.length-1;o>=1;--o)if(i.charCodeAt(o)===Ps){if(!n){t=o;break}}else n=!1;return t===-1?e?"/":".":e&&t===1?"//":i.slice(0,t)},basename(i,e){e!==void 0&&wr(e,"ext"),wr(i,"path");let t=0,n=-1,o=!0,r;if(e!==void 0&&e.length>0&&e.length<=i.length){if(e===i)return"";let s=e.length-1,a=-1;for(r=i.length-1;r>=0;--r){const l=i.charCodeAt(r);if(l===Ps){if(!o){t=r+1;break}}else a===-1&&(o=!1,a=r+1),s>=0&&(l===e.charCodeAt(s)?--s===-1&&(n=r):(s=-1,n=a))}return t===n?n=a:n===-1&&(n=i.length),i.slice(t,n)}for(r=i.length-1;r>=0;--r)if(i.charCodeAt(r)===Ps){if(!o){t=r+1;break}}else n===-1&&(o=!1,n=r+1);return n===-1?"":i.slice(t,n)},extname(i){wr(i,"path");let e=-1,t=0,n=-1,o=!0,r=0;for(let s=i.length-1;s>=0;--s){const a=i.charCodeAt(s);if(a===Ps){if(!o){t=s+1;break}continue}n===-1&&(o=!1,n=s+1),a===jm?e===-1?e=s:r!==1&&(r=1):e!==-1&&(r=-1)}return e===-1||n===-1||r===0||r===1&&e===n-1&&e===t+1?"":i.slice(e,n)},format:N_e.bind(null,"/"),parse(i){wr(i,"path");const e={root:"",dir:"",base:"",ext:"",name:""};if(i.length===0)return e;const t=i.charCodeAt(0)===Ps;let n;t?(e.root="/",n=1):n=0;let o=-1,r=0,s=-1,a=!0,l=i.length-1,c=0;for(;l>=n;--l){const u=i.charCodeAt(l);if(u===Ps){if(!a){r=l+1;break}continue}s===-1&&(a=!1,s=l+1),u===jm?o===-1?o=l:c!==1&&(c=1):o!==-1&&(c=-1)}if(s!==-1){const u=r===0&&t?1:r;o===-1||c===0||c===1&&o===s-1&&o===r+1?e.base=e.name=i.slice(u,s):(e.name=i.slice(u,o),e.base=i.slice(u,s),e.ext=i.slice(o,s))}return r>0?e.dir=i.slice(0,r-1):t&&(e.dir="/"),e},sep:"/",delimiter:":",win32:null,posix:null};Go.win32=ol.win32=ol;Go.posix=ol.posix=Go;const R_e=Xv?ol.normalize:Go.normalize,UYe=Xv?ol.resolve:Go.resolve,jYe=Xv?ol.relative:Go.relative,M_e=Xv?ol.dirname:Go.dirname,Km=Xv?ol.basename:Go.basename,KYe=Xv?ol.extname:Go.extname,Bd=Xv?ol.sep:Go.sep,qYe=/^\w[\w\d+.-]*$/,GYe=/^\//,XYe=/^\/\//;function YYe(i,e){if(!i.scheme&&e)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${i.authority}", path: "${i.path}", query: "${i.query}", fragment: "${i.fragment}"}`);if(i.scheme&&!qYe.test(i.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(i.path){if(i.authority){if(!GYe.test(i.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(XYe.test(i.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}function ZYe(i,e){return!i&&!e?"file":i}function QYe(i,e){switch(i){case"https":case"http":case"file":e?e[0]!==yd&&(e=yd+e):e=yd;break}return e}const ko="",yd="/",JYe=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class Rt{static isUri(e){return e instanceof Rt?!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,n,o,r,s=!1){typeof e=="object"?(this.scheme=e.scheme||ko,this.authority=e.authority||ko,this.path=e.path||ko,this.query=e.query||ko,this.fragment=e.fragment||ko):(this.scheme=ZYe(e,s),this.authority=t||ko,this.path=QYe(this.scheme,n||ko),this.query=o||ko,this.fragment=r||ko,YYe(this,s))}get fsPath(){return WA(this,!1)}with(e){if(!e)return this;let{scheme:t,authority:n,path:o,query:r,fragment:s}=e;return t===void 0?t=this.scheme:t===null&&(t=ko),n===void 0?n=this.authority:n===null&&(n=ko),o===void 0?o=this.path:o===null&&(o=ko),r===void 0?r=this.query:r===null&&(r=ko),s===void 0?s=this.fragment:s===null&&(s=ko),t===this.scheme&&n===this.authority&&o===this.path&&r===this.query&&s===this.fragment?this:new F1(t,n,o,r,s)}static parse(e,t=!1){const n=JYe.exec(e);return n?new F1(n[2]||ko,t2(n[4]||ko),t2(n[5]||ko),t2(n[7]||ko),t2(n[9]||ko),t):new F1(ko,ko,ko,ko,ko)}static file(e){let t=ko;if(ls&&(e=e.replace(/\\/g,yd)),e[0]===yd&&e[1]===yd){const n=e.indexOf(yd,2);n===-1?(t=e.substring(2),e=yd):(t=e.substring(2,n),e=e.substring(n)||yd)}return new F1("file",t,e,ko,ko)}static from(e,t){return new F1(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 n;return ls&&e.scheme==="file"?n=Rt.file(ol.join(WA(e,!0),...t)).path:n=Go.join(e.path,...t),e.with({path:n})}toString(e=!1){return YW(this,e)}toJSON(){return this}static revive(e){var t,n;if(e){if(e instanceof Rt)return e;{const o=new F1(e);return o._formatted=(t=e.external)!==null&&t!==void 0?t:null,o._fsPath=e._sep===A_e&&(n=e.fsPath)!==null&&n!==void 0?n:null,o}}else return e}}const A_e=ls?1:void 0;class F1 extends Rt{constructor(){super(...arguments),this._formatted=null,this._fsPath=null}get fsPath(){return this._fsPath||(this._fsPath=WA(this,!1)),this._fsPath}toString(e=!1){return e?YW(this,!0):(this._formatted||(this._formatted=YW(this,!1)),this._formatted)}toJSON(){const e={$mid:1};return this._fsPath&&(e.fsPath=this._fsPath,e._sep=A_e),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 P_e={[58]:"%3A",[47]:"%2F",[63]:"%3F",[35]:"%23",[91]:"%5B",[93]:"%5D",[64]:"%40",[33]:"%21",[36]:"%24",[38]:"%26",[39]:"%27",[40]:"%28",[41]:"%29",[42]:"%2A",[43]:"%2B",[44]:"%2C",[59]:"%3B",[61]:"%3D",[32]:"%20"};function uoe(i,e,t){let n,o=-1;for(let r=0;r=97&&s<=122||s>=65&&s<=90||s>=48&&s<=57||s===45||s===46||s===95||s===126||e&&s===47||t&&s===91||t&&s===93||t&&s===58)o!==-1&&(n+=encodeURIComponent(i.substring(o,r)),o=-1),n!==void 0&&(n+=i.charAt(r));else{n===void 0&&(n=i.substr(0,r));const a=P_e[s];a!==void 0?(o!==-1&&(n+=encodeURIComponent(i.substring(o,r)),o=-1),n+=a):o===-1&&(o=r)}}return o!==-1&&(n+=encodeURIComponent(i.substring(o))),n!==void 0?n:i}function eZe(i){let e;for(let t=0;t1&&i.scheme==="file"?t=`//${i.authority}${i.path}`:i.path.charCodeAt(0)===47&&(i.path.charCodeAt(1)>=65&&i.path.charCodeAt(1)<=90||i.path.charCodeAt(1)>=97&&i.path.charCodeAt(1)<=122)&&i.path.charCodeAt(2)===58?e?t=i.path.substr(1):t=i.path[1].toLowerCase()+i.path.substr(2):t=i.path,ls&&(t=t.replace(/\//g,"\\")),t}function YW(i,e){const t=e?eZe:uoe;let n="",{scheme:o,authority:r,path:s,query:a,fragment:l}=i;if(o&&(n+=o,n+=":"),(r||o==="file")&&(n+=yd,n+=yd),r){let c=r.indexOf("@");if(c!==-1){const u=r.substr(0,c);r=r.substr(c+1),c=u.lastIndexOf(":"),c===-1?n+=t(u,!1,!1):(n+=t(u.substr(0,c),!1,!1),n+=":",n+=t(u.substr(c+1),!1,!0)),n+="@"}r=r.toLowerCase(),c=r.lastIndexOf(":"),c===-1?n+=t(r,!1,!0):(n+=t(r.substr(0,c),!1,!0),n+=r.substr(c))}if(s){if(s.length>=3&&s.charCodeAt(0)===47&&s.charCodeAt(2)===58){const c=s.charCodeAt(1);c>=65&&c<=90&&(s=`/${String.fromCharCode(c+32)}:${s.substr(3)}`)}else if(s.length>=2&&s.charCodeAt(1)===58){const c=s.charCodeAt(0);c>=65&&c<=90&&(s=`${String.fromCharCode(c+32)}:${s.substr(2)}`)}n+=t(s,!0,!1)}return a&&(n+="?",n+=t(a,!1,!1)),l&&(n+="#",n+=e?l:uoe(l,!1,!1)),n}function O_e(i){try{return decodeURIComponent(i)}catch{return i.length>3?i.substr(0,3)+O_e(i.substr(3)):i}}const doe=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function t2(i){return i.match(doe)?i.replace(doe,e=>O_e(e)):i}class ae{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 ae(e,t)}delta(e=0,t=0){return this.with(this.lineNumber+e,this.column+t)}equals(e){return ae.equals(this,e)}static equals(e,t){return!e&&!t?!0:!!e&&!!t&&e.lineNumber===t.lineNumber&&e.column===t.column}isBefore(e){return ae.isBefore(this,e)}static isBefore(e,t){return e.lineNumbern||e===n&&t>o?(this.startLineNumber=n,this.startColumn=o,this.endLineNumber=e,this.endColumn=t):(this.startLineNumber=e,this.startColumn=t,this.endLineNumber=n,this.endColumn=o)}isEmpty(){return V.isEmpty(this)}static isEmpty(e){return e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn}containsPosition(e){return V.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 V.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 V.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 V.plusRange(this,e)}static plusRange(e,t){let n,o,r,s;return t.startLineNumbere.endLineNumber?(r=t.endLineNumber,s=t.endColumn):t.endLineNumber===e.endLineNumber?(r=t.endLineNumber,s=Math.max(t.endColumn,e.endColumn)):(r=e.endLineNumber,s=e.endColumn),new V(n,o,r,s)}intersectRanges(e){return V.intersectRanges(this,e)}static intersectRanges(e,t){let n=e.startLineNumber,o=e.startColumn,r=e.endLineNumber,s=e.endColumn;const a=t.startLineNumber,l=t.startColumn,c=t.endLineNumber,u=t.endColumn;return nc?(r=c,s=u):r===c&&(s=Math.min(s,u)),n>r||n===r&&o>s?null:new V(n,o,r,s)}equalsRange(e){return V.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 V.getEndPosition(this)}static getEndPosition(e){return new ae(e.endLineNumber,e.endColumn)}getStartPosition(){return V.getStartPosition(this)}static getStartPosition(e){return new ae(e.startLineNumber,e.startColumn)}toString(){return"["+this.startLineNumber+","+this.startColumn+" -> "+this.endLineNumber+","+this.endColumn+"]"}setEndPosition(e,t){return new V(this.startLineNumber,this.startColumn,e,t)}setStartPosition(e,t){return new V(e,t,this.endLineNumber,this.endColumn)}collapseToStart(){return V.collapseToStart(this)}static collapseToStart(e){return new V(e.startLineNumber,e.startColumn,e.startLineNumber,e.startColumn)}collapseToEnd(){return V.collapseToEnd(this)}static collapseToEnd(e){return new V(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn)}delta(e){return new V(this.startLineNumber+e,this.startColumn,this.endLineNumber+e,this.endColumn)}static fromPositions(e,t=e){return new V(e.lineNumber,e.column,t.lineNumber,t.column)}static lift(e){return e?new V(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}}class gt extends V{constructor(e,t,n,o){super(e,t,n,o),this.selectionStartLineNumber=e,this.selectionStartColumn=t,this.positionLineNumber=n,this.positionColumn=o}toString(){return"["+this.selectionStartLineNumber+","+this.selectionStartColumn+" -> "+this.positionLineNumber+","+this.positionColumn+"]"}equalsSelection(e){return gt.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?0:1}setEndPosition(e,t){return this.getDirection()===0?new gt(this.startLineNumber,this.startColumn,e,t):new gt(e,t,this.startLineNumber,this.startColumn)}getPosition(){return new ae(this.positionLineNumber,this.positionColumn)}getSelectionStart(){return new ae(this.selectionStartLineNumber,this.selectionStartColumn)}setStartPosition(e,t){return this.getDirection()===0?new gt(e,t,this.endLineNumber,this.endColumn):new gt(this.endLineNumber,this.endColumn,e,t)}static fromPositions(e,t=e){return new gt(e.lineNumber,e.column,t.lineNumber,t.column)}static fromRange(e,t){return t===0?new gt(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn):new gt(e.endLineNumber,e.endColumn,e.startLineNumber,e.startColumn)}static liftSelection(e){return new gt(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 n=0,o=e.length;n{this._tokenizationSupports.get(e)===t&&(this._tokenizationSupports.delete(e),this.handleChange([e]))})}get(e){return this._tokenizationSupports.get(e)||null}registerFactory(e,t){var n;(n=this._factories.get(e))===null||n===void 0||n.dispose();const o=new nZe(this,e,t);return this._factories.set(e,o),zt(()=>{const r=this._factories.get(e);!r||r!==o||(this._factories.delete(e),r.dispose())})}getOrCreate(e){return QW(this,void 0,void 0,function*(){const t=this.get(e);if(t)return t;const n=this._factories.get(e);return!n||n.isResolved?null:(yield n.resolve(),this.get(e))})}isResolved(e){if(this.get(e))return!0;const n=this._factories.get(e);return!!(!n||n.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>2?this._colorMap[2]:null}}class nZe extends _e{get isResolved(){return this._isResolved}constructor(e,t,n){super(),this._registry=e,this._languageId=t,this._factory=n,this._isDisposed=!1,this._resolvePromise=null,this._isResolved=!1}dispose(){this._isDisposed=!0,super.dispose()}resolve(){return QW(this,void 0,void 0,function*(){return this._resolvePromise||(this._resolvePromise=this._create()),this._resolvePromise})}_create(){return QW(this,void 0,void 0,function*(){const e=yield this._factory.tokenizationSupport;this._isResolved=!0,e&&!this._isDisposed&&this._register(this._registry.register(this._languageId,e))})}}class ID{constructor(e,t,n){this.offset=e,this.type=t,this.language=n,this._tokenBrand=void 0}toString(){return"("+this.offset+", "+this.type+")"}}class jq{constructor(e,t){this.tokens=e,this.endState=t,this._tokenizationResultBrand=void 0}}class H4{constructor(e,t){this.tokens=e,this.endState=t,this._encodedTokenizationResultBrand=void 0}}var TD;(function(i){const e=new Map;e.set(0,Xe.symbolMethod),e.set(1,Xe.symbolFunction),e.set(2,Xe.symbolConstructor),e.set(3,Xe.symbolField),e.set(4,Xe.symbolVariable),e.set(5,Xe.symbolClass),e.set(6,Xe.symbolStruct),e.set(7,Xe.symbolInterface),e.set(8,Xe.symbolModule),e.set(9,Xe.symbolProperty),e.set(10,Xe.symbolEvent),e.set(11,Xe.symbolOperator),e.set(12,Xe.symbolUnit),e.set(13,Xe.symbolValue),e.set(15,Xe.symbolEnum),e.set(14,Xe.symbolConstant),e.set(15,Xe.symbolEnum),e.set(16,Xe.symbolEnumMember),e.set(17,Xe.symbolKeyword),e.set(27,Xe.symbolSnippet),e.set(18,Xe.symbolText),e.set(19,Xe.symbolColor),e.set(20,Xe.symbolFile),e.set(21,Xe.symbolReference),e.set(22,Xe.symbolCustomColor),e.set(23,Xe.symbolFolder),e.set(24,Xe.symbolTypeParameter),e.set(25,Xe.account),e.set(26,Xe.issues);function t(r){let s=e.get(r);return s||(console.info("No codicon found for CompletionItemKind "+r),s=Xe.symbolProperty),s}i.toIcon=t;const n=new Map;n.set("method",0),n.set("function",1),n.set("constructor",2),n.set("field",3),n.set("variable",4),n.set("class",5),n.set("struct",6),n.set("interface",7),n.set("module",8),n.set("property",9),n.set("event",10),n.set("operator",11),n.set("unit",12),n.set("value",13),n.set("constant",14),n.set("enum",15),n.set("enum-member",16),n.set("enumMember",16),n.set("keyword",17),n.set("snippet",27),n.set("text",18),n.set("color",19),n.set("file",20),n.set("reference",21),n.set("customcolor",22),n.set("folder",23),n.set("type-parameter",24),n.set("typeParameter",24),n.set("account",25),n.set("issue",26);function o(r,s){let a=n.get(r);return typeof a=="undefined"&&!s&&(a=9),a}i.fromString=o})(TD||(TD={}));var jg;(function(i){i[i.Automatic=0]="Automatic",i[i.Explicit=1]="Explicit"})(jg||(jg={}));class B_e{constructor(e,t,n,o){this.range=e,this.text=t,this.completionKind=n,this.isSnippetText=o}equals(e){return V.lift(this.range).equalsRange(e.range)&&this.text===e.text&&this.completionKind===e.completionKind&&this.isSnippetText===e.isSnippetText}}var lf;(function(i){i[i.Invoke=1]="Invoke",i[i.TriggerCharacter=2]="TriggerCharacter",i[i.ContentChange=3]="ContentChange"})(lf||(lf={}));var ND;(function(i){i[i.Text=0]="Text",i[i.Read=1]="Read",i[i.Write=2]="Write"})(ND||(ND={}));function iZe(i){return i&&Rt.isUri(i.uri)&&V.isIRange(i.range)&&(V.isIRange(i.originSelectionRange)||V.isIRange(i.targetSelectionRange))}const oZe={[17]:C("Array","array"),[16]:C("Boolean","boolean"),[4]:C("Class","class"),[13]:C("Constant","constant"),[8]:C("Constructor","constructor"),[9]:C("Enum","enumeration"),[21]:C("EnumMember","enumeration member"),[23]:C("Event","event"),[7]:C("Field","field"),[0]:C("File","file"),[11]:C("Function","function"),[10]:C("Interface","interface"),[19]:C("Key","key"),[5]:C("Method","method"),[1]:C("Module","module"),[2]:C("Namespace","namespace"),[20]:C("Null","null"),[15]:C("Number","number"),[18]:C("Object","object"),[24]:C("Operator","operator"),[3]:C("Package","package"),[6]:C("Property","property"),[14]:C("String","string"),[22]:C("Struct","struct"),[25]:C("TypeParameter","type parameter"),[12]:C("Variable","variable")};function rZe(i,e){return C("symbolAriaLabel","{0} ({1})",i,oZe[e])}var VA;(function(i){const e=new Map;e.set(0,Xe.symbolFile),e.set(1,Xe.symbolModule),e.set(2,Xe.symbolNamespace),e.set(3,Xe.symbolPackage),e.set(4,Xe.symbolClass),e.set(5,Xe.symbolMethod),e.set(6,Xe.symbolProperty),e.set(7,Xe.symbolField),e.set(8,Xe.symbolConstructor),e.set(9,Xe.symbolEnum),e.set(10,Xe.symbolInterface),e.set(11,Xe.symbolFunction),e.set(12,Xe.symbolVariable),e.set(13,Xe.symbolConstant),e.set(14,Xe.symbolString),e.set(15,Xe.symbolNumber),e.set(16,Xe.symbolBoolean),e.set(17,Xe.symbolArray),e.set(18,Xe.symbolObject),e.set(19,Xe.symbolKey),e.set(20,Xe.symbolNull),e.set(21,Xe.symbolEnumMember),e.set(22,Xe.symbolStruct),e.set(23,Xe.symbolEvent),e.set(24,Xe.symbolOperator),e.set(25,Xe.symbolTypeParameter);function t(n){let o=e.get(n);return o||(console.info("No codicon found for SymbolKind "+n),o=Xe.symbolProperty),o}i.toIcon=t})(VA||(VA={}));class ra{static fromValue(e){switch(e){case"comment":return ra.Comment;case"imports":return ra.Imports;case"region":return ra.Region}return new ra(e)}constructor(e){this.value=e}}ra.Comment=new ra("comment");ra.Imports=new ra("imports");ra.Region=new ra("region");var JW;(function(i){function e(t){return!t||typeof t!="object"?!1:typeof t.id=="string"&&typeof t.title=="string"}i.is=e})(JW||(JW={}));var HA;(function(i){i[i.Type=1]="Type",i[i.Parameter=2]="Parameter"})(HA||(HA={}));class sZe{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 oo=new tZe;var eV;(function(i){i[i.Unknown=0]="Unknown",i[i.Disabled=1]="Disabled",i[i.Enabled=2]="Enabled"})(eV||(eV={}));var tV;(function(i){i[i.Invoke=1]="Invoke",i[i.Auto=2]="Auto"})(tV||(tV={}));var nV;(function(i){i[i.None=0]="None",i[i.KeepWhitespace=1]="KeepWhitespace",i[i.InsertAsSnippet=4]="InsertAsSnippet"})(nV||(nV={}));var iV;(function(i){i[i.Method=0]="Method",i[i.Function=1]="Function",i[i.Constructor=2]="Constructor",i[i.Field=3]="Field",i[i.Variable=4]="Variable",i[i.Class=5]="Class",i[i.Struct=6]="Struct",i[i.Interface=7]="Interface",i[i.Module=8]="Module",i[i.Property=9]="Property",i[i.Event=10]="Event",i[i.Operator=11]="Operator",i[i.Unit=12]="Unit",i[i.Value=13]="Value",i[i.Constant=14]="Constant",i[i.Enum=15]="Enum",i[i.EnumMember=16]="EnumMember",i[i.Keyword=17]="Keyword",i[i.Text=18]="Text",i[i.Color=19]="Color",i[i.File=20]="File",i[i.Reference=21]="Reference",i[i.Customcolor=22]="Customcolor",i[i.Folder=23]="Folder",i[i.TypeParameter=24]="TypeParameter",i[i.User=25]="User",i[i.Issue=26]="Issue",i[i.Snippet=27]="Snippet"})(iV||(iV={}));var oV;(function(i){i[i.Deprecated=1]="Deprecated"})(oV||(oV={}));var rV;(function(i){i[i.Invoke=0]="Invoke",i[i.TriggerCharacter=1]="TriggerCharacter",i[i.TriggerForIncompleteCompletions=2]="TriggerForIncompleteCompletions"})(rV||(rV={}));var sV;(function(i){i[i.EXACT=0]="EXACT",i[i.ABOVE=1]="ABOVE",i[i.BELOW=2]="BELOW"})(sV||(sV={}));var aV;(function(i){i[i.NotSet=0]="NotSet",i[i.ContentFlush=1]="ContentFlush",i[i.RecoverFromMarkers=2]="RecoverFromMarkers",i[i.Explicit=3]="Explicit",i[i.Paste=4]="Paste",i[i.Undo=5]="Undo",i[i.Redo=6]="Redo"})(aV||(aV={}));var lV;(function(i){i[i.LF=1]="LF",i[i.CRLF=2]="CRLF"})(lV||(lV={}));var cV;(function(i){i[i.Text=0]="Text",i[i.Read=1]="Read",i[i.Write=2]="Write"})(cV||(cV={}));var uV;(function(i){i[i.None=0]="None",i[i.Keep=1]="Keep",i[i.Brackets=2]="Brackets",i[i.Advanced=3]="Advanced",i[i.Full=4]="Full"})(uV||(uV={}));var dV;(function(i){i[i.acceptSuggestionOnCommitCharacter=0]="acceptSuggestionOnCommitCharacter",i[i.acceptSuggestionOnEnter=1]="acceptSuggestionOnEnter",i[i.accessibilitySupport=2]="accessibilitySupport",i[i.accessibilityPageSize=3]="accessibilityPageSize",i[i.ariaLabel=4]="ariaLabel",i[i.ariaRequired=5]="ariaRequired",i[i.autoClosingBrackets=6]="autoClosingBrackets",i[i.autoClosingComments=7]="autoClosingComments",i[i.screenReaderAnnounceInlineSuggestion=8]="screenReaderAnnounceInlineSuggestion",i[i.autoClosingDelete=9]="autoClosingDelete",i[i.autoClosingOvertype=10]="autoClosingOvertype",i[i.autoClosingQuotes=11]="autoClosingQuotes",i[i.autoIndent=12]="autoIndent",i[i.automaticLayout=13]="automaticLayout",i[i.autoSurround=14]="autoSurround",i[i.bracketPairColorization=15]="bracketPairColorization",i[i.guides=16]="guides",i[i.codeLens=17]="codeLens",i[i.codeLensFontFamily=18]="codeLensFontFamily",i[i.codeLensFontSize=19]="codeLensFontSize",i[i.colorDecorators=20]="colorDecorators",i[i.colorDecoratorsLimit=21]="colorDecoratorsLimit",i[i.columnSelection=22]="columnSelection",i[i.comments=23]="comments",i[i.contextmenu=24]="contextmenu",i[i.copyWithSyntaxHighlighting=25]="copyWithSyntaxHighlighting",i[i.cursorBlinking=26]="cursorBlinking",i[i.cursorSmoothCaretAnimation=27]="cursorSmoothCaretAnimation",i[i.cursorStyle=28]="cursorStyle",i[i.cursorSurroundingLines=29]="cursorSurroundingLines",i[i.cursorSurroundingLinesStyle=30]="cursorSurroundingLinesStyle",i[i.cursorWidth=31]="cursorWidth",i[i.disableLayerHinting=32]="disableLayerHinting",i[i.disableMonospaceOptimizations=33]="disableMonospaceOptimizations",i[i.domReadOnly=34]="domReadOnly",i[i.dragAndDrop=35]="dragAndDrop",i[i.dropIntoEditor=36]="dropIntoEditor",i[i.emptySelectionClipboard=37]="emptySelectionClipboard",i[i.experimentalWhitespaceRendering=38]="experimentalWhitespaceRendering",i[i.extraEditorClassName=39]="extraEditorClassName",i[i.fastScrollSensitivity=40]="fastScrollSensitivity",i[i.find=41]="find",i[i.fixedOverflowWidgets=42]="fixedOverflowWidgets",i[i.folding=43]="folding",i[i.foldingStrategy=44]="foldingStrategy",i[i.foldingHighlight=45]="foldingHighlight",i[i.foldingImportsByDefault=46]="foldingImportsByDefault",i[i.foldingMaximumRegions=47]="foldingMaximumRegions",i[i.unfoldOnClickAfterEndOfLine=48]="unfoldOnClickAfterEndOfLine",i[i.fontFamily=49]="fontFamily",i[i.fontInfo=50]="fontInfo",i[i.fontLigatures=51]="fontLigatures",i[i.fontSize=52]="fontSize",i[i.fontWeight=53]="fontWeight",i[i.fontVariations=54]="fontVariations",i[i.formatOnPaste=55]="formatOnPaste",i[i.formatOnType=56]="formatOnType",i[i.glyphMargin=57]="glyphMargin",i[i.gotoLocation=58]="gotoLocation",i[i.hideCursorInOverviewRuler=59]="hideCursorInOverviewRuler",i[i.hover=60]="hover",i[i.inDiffEditor=61]="inDiffEditor",i[i.inlineSuggest=62]="inlineSuggest",i[i.letterSpacing=63]="letterSpacing",i[i.lightbulb=64]="lightbulb",i[i.lineDecorationsWidth=65]="lineDecorationsWidth",i[i.lineHeight=66]="lineHeight",i[i.lineNumbers=67]="lineNumbers",i[i.lineNumbersMinChars=68]="lineNumbersMinChars",i[i.linkedEditing=69]="linkedEditing",i[i.links=70]="links",i[i.matchBrackets=71]="matchBrackets",i[i.minimap=72]="minimap",i[i.mouseStyle=73]="mouseStyle",i[i.mouseWheelScrollSensitivity=74]="mouseWheelScrollSensitivity",i[i.mouseWheelZoom=75]="mouseWheelZoom",i[i.multiCursorMergeOverlapping=76]="multiCursorMergeOverlapping",i[i.multiCursorModifier=77]="multiCursorModifier",i[i.multiCursorPaste=78]="multiCursorPaste",i[i.multiCursorLimit=79]="multiCursorLimit",i[i.occurrencesHighlight=80]="occurrencesHighlight",i[i.overviewRulerBorder=81]="overviewRulerBorder",i[i.overviewRulerLanes=82]="overviewRulerLanes",i[i.padding=83]="padding",i[i.pasteAs=84]="pasteAs",i[i.parameterHints=85]="parameterHints",i[i.peekWidgetDefaultFocus=86]="peekWidgetDefaultFocus",i[i.definitionLinkOpensInPeek=87]="definitionLinkOpensInPeek",i[i.quickSuggestions=88]="quickSuggestions",i[i.quickSuggestionsDelay=89]="quickSuggestionsDelay",i[i.readOnly=90]="readOnly",i[i.readOnlyMessage=91]="readOnlyMessage",i[i.renameOnType=92]="renameOnType",i[i.renderControlCharacters=93]="renderControlCharacters",i[i.renderFinalNewline=94]="renderFinalNewline",i[i.renderLineHighlight=95]="renderLineHighlight",i[i.renderLineHighlightOnlyWhenFocus=96]="renderLineHighlightOnlyWhenFocus",i[i.renderValidationDecorations=97]="renderValidationDecorations",i[i.renderWhitespace=98]="renderWhitespace",i[i.revealHorizontalRightPadding=99]="revealHorizontalRightPadding",i[i.roundedSelection=100]="roundedSelection",i[i.rulers=101]="rulers",i[i.scrollbar=102]="scrollbar",i[i.scrollBeyondLastColumn=103]="scrollBeyondLastColumn",i[i.scrollBeyondLastLine=104]="scrollBeyondLastLine",i[i.scrollPredominantAxis=105]="scrollPredominantAxis",i[i.selectionClipboard=106]="selectionClipboard",i[i.selectionHighlight=107]="selectionHighlight",i[i.selectOnLineNumbers=108]="selectOnLineNumbers",i[i.showFoldingControls=109]="showFoldingControls",i[i.showUnused=110]="showUnused",i[i.snippetSuggestions=111]="snippetSuggestions",i[i.smartSelect=112]="smartSelect",i[i.smoothScrolling=113]="smoothScrolling",i[i.stickyScroll=114]="stickyScroll",i[i.stickyTabStops=115]="stickyTabStops",i[i.stopRenderingLineAfter=116]="stopRenderingLineAfter",i[i.suggest=117]="suggest",i[i.suggestFontSize=118]="suggestFontSize",i[i.suggestLineHeight=119]="suggestLineHeight",i[i.suggestOnTriggerCharacters=120]="suggestOnTriggerCharacters",i[i.suggestSelection=121]="suggestSelection",i[i.tabCompletion=122]="tabCompletion",i[i.tabIndex=123]="tabIndex",i[i.unicodeHighlighting=124]="unicodeHighlighting",i[i.unusualLineTerminators=125]="unusualLineTerminators",i[i.useShadowDOM=126]="useShadowDOM",i[i.useTabStops=127]="useTabStops",i[i.wordBreak=128]="wordBreak",i[i.wordSeparators=129]="wordSeparators",i[i.wordWrap=130]="wordWrap",i[i.wordWrapBreakAfterCharacters=131]="wordWrapBreakAfterCharacters",i[i.wordWrapBreakBeforeCharacters=132]="wordWrapBreakBeforeCharacters",i[i.wordWrapColumn=133]="wordWrapColumn",i[i.wordWrapOverride1=134]="wordWrapOverride1",i[i.wordWrapOverride2=135]="wordWrapOverride2",i[i.wrappingIndent=136]="wrappingIndent",i[i.wrappingStrategy=137]="wrappingStrategy",i[i.showDeprecated=138]="showDeprecated",i[i.inlayHints=139]="inlayHints",i[i.editorClassName=140]="editorClassName",i[i.pixelRatio=141]="pixelRatio",i[i.tabFocusMode=142]="tabFocusMode",i[i.layoutInfo=143]="layoutInfo",i[i.wrappingInfo=144]="wrappingInfo",i[i.defaultColorDecorators=145]="defaultColorDecorators",i[i.colorDecoratorsActivatedOn=146]="colorDecoratorsActivatedOn",i[i.inlineCompletionsAccessibilityVerbose=147]="inlineCompletionsAccessibilityVerbose"})(dV||(dV={}));var hV;(function(i){i[i.TextDefined=0]="TextDefined",i[i.LF=1]="LF",i[i.CRLF=2]="CRLF"})(hV||(hV={}));var fV;(function(i){i[i.LF=0]="LF",i[i.CRLF=1]="CRLF"})(fV||(fV={}));var gV;(function(i){i[i.Left=1]="Left",i[i.Right=2]="Right"})(gV||(gV={}));var pV;(function(i){i[i.None=0]="None",i[i.Indent=1]="Indent",i[i.IndentOutdent=2]="IndentOutdent",i[i.Outdent=3]="Outdent"})(pV||(pV={}));var mV;(function(i){i[i.Both=0]="Both",i[i.Right=1]="Right",i[i.Left=2]="Left",i[i.None=3]="None"})(mV||(mV={}));var vV;(function(i){i[i.Type=1]="Type",i[i.Parameter=2]="Parameter"})(vV||(vV={}));var _V;(function(i){i[i.Automatic=0]="Automatic",i[i.Explicit=1]="Explicit"})(_V||(_V={}));var bV;(function(i){i[i.DependsOnKbLayout=-1]="DependsOnKbLayout",i[i.Unknown=0]="Unknown",i[i.Backspace=1]="Backspace",i[i.Tab=2]="Tab",i[i.Enter=3]="Enter",i[i.Shift=4]="Shift",i[i.Ctrl=5]="Ctrl",i[i.Alt=6]="Alt",i[i.PauseBreak=7]="PauseBreak",i[i.CapsLock=8]="CapsLock",i[i.Escape=9]="Escape",i[i.Space=10]="Space",i[i.PageUp=11]="PageUp",i[i.PageDown=12]="PageDown",i[i.End=13]="End",i[i.Home=14]="Home",i[i.LeftArrow=15]="LeftArrow",i[i.UpArrow=16]="UpArrow",i[i.RightArrow=17]="RightArrow",i[i.DownArrow=18]="DownArrow",i[i.Insert=19]="Insert",i[i.Delete=20]="Delete",i[i.Digit0=21]="Digit0",i[i.Digit1=22]="Digit1",i[i.Digit2=23]="Digit2",i[i.Digit3=24]="Digit3",i[i.Digit4=25]="Digit4",i[i.Digit5=26]="Digit5",i[i.Digit6=27]="Digit6",i[i.Digit7=28]="Digit7",i[i.Digit8=29]="Digit8",i[i.Digit9=30]="Digit9",i[i.KeyA=31]="KeyA",i[i.KeyB=32]="KeyB",i[i.KeyC=33]="KeyC",i[i.KeyD=34]="KeyD",i[i.KeyE=35]="KeyE",i[i.KeyF=36]="KeyF",i[i.KeyG=37]="KeyG",i[i.KeyH=38]="KeyH",i[i.KeyI=39]="KeyI",i[i.KeyJ=40]="KeyJ",i[i.KeyK=41]="KeyK",i[i.KeyL=42]="KeyL",i[i.KeyM=43]="KeyM",i[i.KeyN=44]="KeyN",i[i.KeyO=45]="KeyO",i[i.KeyP=46]="KeyP",i[i.KeyQ=47]="KeyQ",i[i.KeyR=48]="KeyR",i[i.KeyS=49]="KeyS",i[i.KeyT=50]="KeyT",i[i.KeyU=51]="KeyU",i[i.KeyV=52]="KeyV",i[i.KeyW=53]="KeyW",i[i.KeyX=54]="KeyX",i[i.KeyY=55]="KeyY",i[i.KeyZ=56]="KeyZ",i[i.Meta=57]="Meta",i[i.ContextMenu=58]="ContextMenu",i[i.F1=59]="F1",i[i.F2=60]="F2",i[i.F3=61]="F3",i[i.F4=62]="F4",i[i.F5=63]="F5",i[i.F6=64]="F6",i[i.F7=65]="F7",i[i.F8=66]="F8",i[i.F9=67]="F9",i[i.F10=68]="F10",i[i.F11=69]="F11",i[i.F12=70]="F12",i[i.F13=71]="F13",i[i.F14=72]="F14",i[i.F15=73]="F15",i[i.F16=74]="F16",i[i.F17=75]="F17",i[i.F18=76]="F18",i[i.F19=77]="F19",i[i.F20=78]="F20",i[i.F21=79]="F21",i[i.F22=80]="F22",i[i.F23=81]="F23",i[i.F24=82]="F24",i[i.NumLock=83]="NumLock",i[i.ScrollLock=84]="ScrollLock",i[i.Semicolon=85]="Semicolon",i[i.Equal=86]="Equal",i[i.Comma=87]="Comma",i[i.Minus=88]="Minus",i[i.Period=89]="Period",i[i.Slash=90]="Slash",i[i.Backquote=91]="Backquote",i[i.BracketLeft=92]="BracketLeft",i[i.Backslash=93]="Backslash",i[i.BracketRight=94]="BracketRight",i[i.Quote=95]="Quote",i[i.OEM_8=96]="OEM_8",i[i.IntlBackslash=97]="IntlBackslash",i[i.Numpad0=98]="Numpad0",i[i.Numpad1=99]="Numpad1",i[i.Numpad2=100]="Numpad2",i[i.Numpad3=101]="Numpad3",i[i.Numpad4=102]="Numpad4",i[i.Numpad5=103]="Numpad5",i[i.Numpad6=104]="Numpad6",i[i.Numpad7=105]="Numpad7",i[i.Numpad8=106]="Numpad8",i[i.Numpad9=107]="Numpad9",i[i.NumpadMultiply=108]="NumpadMultiply",i[i.NumpadAdd=109]="NumpadAdd",i[i.NUMPAD_SEPARATOR=110]="NUMPAD_SEPARATOR",i[i.NumpadSubtract=111]="NumpadSubtract",i[i.NumpadDecimal=112]="NumpadDecimal",i[i.NumpadDivide=113]="NumpadDivide",i[i.KEY_IN_COMPOSITION=114]="KEY_IN_COMPOSITION",i[i.ABNT_C1=115]="ABNT_C1",i[i.ABNT_C2=116]="ABNT_C2",i[i.AudioVolumeMute=117]="AudioVolumeMute",i[i.AudioVolumeUp=118]="AudioVolumeUp",i[i.AudioVolumeDown=119]="AudioVolumeDown",i[i.BrowserSearch=120]="BrowserSearch",i[i.BrowserHome=121]="BrowserHome",i[i.BrowserBack=122]="BrowserBack",i[i.BrowserForward=123]="BrowserForward",i[i.MediaTrackNext=124]="MediaTrackNext",i[i.MediaTrackPrevious=125]="MediaTrackPrevious",i[i.MediaStop=126]="MediaStop",i[i.MediaPlayPause=127]="MediaPlayPause",i[i.LaunchMediaPlayer=128]="LaunchMediaPlayer",i[i.LaunchMail=129]="LaunchMail",i[i.LaunchApp2=130]="LaunchApp2",i[i.Clear=131]="Clear",i[i.MAX_VALUE=132]="MAX_VALUE"})(bV||(bV={}));var CV;(function(i){i[i.Hint=1]="Hint",i[i.Info=2]="Info",i[i.Warning=4]="Warning",i[i.Error=8]="Error"})(CV||(CV={}));var yV;(function(i){i[i.Unnecessary=1]="Unnecessary",i[i.Deprecated=2]="Deprecated"})(yV||(yV={}));var wV;(function(i){i[i.Inline=1]="Inline",i[i.Gutter=2]="Gutter"})(wV||(wV={}));var SV;(function(i){i[i.UNKNOWN=0]="UNKNOWN",i[i.TEXTAREA=1]="TEXTAREA",i[i.GUTTER_GLYPH_MARGIN=2]="GUTTER_GLYPH_MARGIN",i[i.GUTTER_LINE_NUMBERS=3]="GUTTER_LINE_NUMBERS",i[i.GUTTER_LINE_DECORATIONS=4]="GUTTER_LINE_DECORATIONS",i[i.GUTTER_VIEW_ZONE=5]="GUTTER_VIEW_ZONE",i[i.CONTENT_TEXT=6]="CONTENT_TEXT",i[i.CONTENT_EMPTY=7]="CONTENT_EMPTY",i[i.CONTENT_VIEW_ZONE=8]="CONTENT_VIEW_ZONE",i[i.CONTENT_WIDGET=9]="CONTENT_WIDGET",i[i.OVERVIEW_RULER=10]="OVERVIEW_RULER",i[i.SCROLLBAR=11]="SCROLLBAR",i[i.OVERLAY_WIDGET=12]="OVERLAY_WIDGET",i[i.OUTSIDE_EDITOR=13]="OUTSIDE_EDITOR"})(SV||(SV={}));var xV;(function(i){i[i.TOP_RIGHT_CORNER=0]="TOP_RIGHT_CORNER",i[i.BOTTOM_RIGHT_CORNER=1]="BOTTOM_RIGHT_CORNER",i[i.TOP_CENTER=2]="TOP_CENTER"})(xV||(xV={}));var LV;(function(i){i[i.Left=1]="Left",i[i.Center=2]="Center",i[i.Right=4]="Right",i[i.Full=7]="Full"})(LV||(LV={}));var EV;(function(i){i[i.Left=0]="Left",i[i.Right=1]="Right",i[i.None=2]="None",i[i.LeftOfInjectedText=3]="LeftOfInjectedText",i[i.RightOfInjectedText=4]="RightOfInjectedText"})(EV||(EV={}));var DV;(function(i){i[i.Off=0]="Off",i[i.On=1]="On",i[i.Relative=2]="Relative",i[i.Interval=3]="Interval",i[i.Custom=4]="Custom"})(DV||(DV={}));var kV;(function(i){i[i.None=0]="None",i[i.Text=1]="Text",i[i.Blocks=2]="Blocks"})(kV||(kV={}));var IV;(function(i){i[i.Smooth=0]="Smooth",i[i.Immediate=1]="Immediate"})(IV||(IV={}));var TV;(function(i){i[i.Auto=1]="Auto",i[i.Hidden=2]="Hidden",i[i.Visible=3]="Visible"})(TV||(TV={}));var NV;(function(i){i[i.LTR=0]="LTR",i[i.RTL=1]="RTL"})(NV||(NV={}));var RV;(function(i){i[i.Invoke=1]="Invoke",i[i.TriggerCharacter=2]="TriggerCharacter",i[i.ContentChange=3]="ContentChange"})(RV||(RV={}));var MV;(function(i){i[i.File=0]="File",i[i.Module=1]="Module",i[i.Namespace=2]="Namespace",i[i.Package=3]="Package",i[i.Class=4]="Class",i[i.Method=5]="Method",i[i.Property=6]="Property",i[i.Field=7]="Field",i[i.Constructor=8]="Constructor",i[i.Enum=9]="Enum",i[i.Interface=10]="Interface",i[i.Function=11]="Function",i[i.Variable=12]="Variable",i[i.Constant=13]="Constant",i[i.String=14]="String",i[i.Number=15]="Number",i[i.Boolean=16]="Boolean",i[i.Array=17]="Array",i[i.Object=18]="Object",i[i.Key=19]="Key",i[i.Null=20]="Null",i[i.EnumMember=21]="EnumMember",i[i.Struct=22]="Struct",i[i.Event=23]="Event",i[i.Operator=24]="Operator",i[i.TypeParameter=25]="TypeParameter"})(MV||(MV={}));var AV;(function(i){i[i.Deprecated=1]="Deprecated"})(AV||(AV={}));var PV;(function(i){i[i.Hidden=0]="Hidden",i[i.Blink=1]="Blink",i[i.Smooth=2]="Smooth",i[i.Phase=3]="Phase",i[i.Expand=4]="Expand",i[i.Solid=5]="Solid"})(PV||(PV={}));var OV;(function(i){i[i.Line=1]="Line",i[i.Block=2]="Block",i[i.Underline=3]="Underline",i[i.LineThin=4]="LineThin",i[i.BlockOutline=5]="BlockOutline",i[i.UnderlineThin=6]="UnderlineThin"})(OV||(OV={}));var FV;(function(i){i[i.AlwaysGrowsWhenTypingAtEdges=0]="AlwaysGrowsWhenTypingAtEdges",i[i.NeverGrowsWhenTypingAtEdges=1]="NeverGrowsWhenTypingAtEdges",i[i.GrowsOnlyWhenTypingBefore=2]="GrowsOnlyWhenTypingBefore",i[i.GrowsOnlyWhenTypingAfter=3]="GrowsOnlyWhenTypingAfter"})(FV||(FV={}));var BV;(function(i){i[i.None=0]="None",i[i.Same=1]="Same",i[i.Indent=2]="Indent",i[i.DeepIndent=3]="DeepIndent"})(BV||(BV={}));class FI{static chord(e,t){return Zo(e,t)}}FI.CtrlCmd=2048;FI.Shift=1024;FI.Alt=512;FI.WinCtrl=256;function W_e(){return{editor:void 0,languages:void 0,CancellationTokenSource:Ro,Emitter:le,KeyCode:bV,KeyMod:FI,Position:ae,Range:V,Selection:gt,SelectionDirection:NV,MarkerSeverity:CV,MarkerTag:yV,Uri:Rt,Token:ID}}class aZe{constructor(e){this.fn=e,this.lastCache=void 0,this.lastArgKey=void 0}get(e){const t=JSON.stringify(e);return this.lastArgKey!==t&&(this.lastArgKey=t,this.lastCache=this.fn(e)),this.lastCache}}class hoe{get cachedValues(){return this._map}constructor(e){this.fn=e,this._map=new Map}get(e){if(this._map.has(e))return this._map.get(e);const t=this.fn(e);return this._map.set(e,t),t}}class ah{constructor(e){this.executor=e,this._didRun=!1}get value(){if(!this._didRun)try{this._value=this.executor()}catch(e){this._error=e}finally{this._didRun=!0}if(this._error)throw this._error;return this._value}get rawValue(){return this._value}}var hw;function V_e(i){return!i||typeof i!="string"?!0:i.trim().length===0}const lZe=/{(\d+)}/g;function X0(i,...e){return e.length===0?i:i.replace(lZe,function(t,n){const o=parseInt(n,10);return isNaN(o)||o<0||o>=e.length?t:e[o]})}function $A(i){return i.replace(/[<>&]/g,function(e){switch(e){case"<":return"<";case">":return">";case"&":return"&";default:return e}})}function Xl(i){return i.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function cZe(i,e=" "){const t=BI(i,e);return H_e(t,e)}function BI(i,e){if(!i||!e)return i;const t=e.length;if(t===0||i.length===0)return i;let n=0;for(;i.indexOf(e,n)===n;)n=n+t;return i.substring(n)}function H_e(i,e){if(!i||!e)return i;const t=e.length,n=i.length;if(t===0||n===0)return i;let o=n,r=-1;for(;r=i.lastIndexOf(e,o-1),!(r===-1||r+t!==o);){if(r===0)return"";o=r}return i.substring(0,o)}function uZe(i){return i.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function dZe(i){return i.replace(/\*/g,"")}function $_e(i,e,t={}){if(!i)throw new Error("Cannot create regex from empty string");e||(i=Xl(i)),t.wholeWord&&(/\B/.test(i.charAt(0))||(i="\\b"+i),/\B/.test(i.charAt(i.length-1))||(i=i+"\\b"));let n="";return t.global&&(n+="g"),t.matchCase||(n+="i"),t.multiline&&(n+="m"),t.unicode&&(n+="u"),new RegExp(i,n)}function hZe(i){return i.source==="^"||i.source==="^$"||i.source==="$"||i.source==="^\\s*$"?!1:!!(i.exec("")&&i.lastIndex===0)}function gf(i){return i.split(/\r\n|\r|\n/)}function Ws(i){for(let e=0,t=i.length;e=0;t--){const n=i.charCodeAt(t);if(n!==32&&n!==9)return t}return-1}function RD(i,e){return ie?1:0}function Kq(i,e,t=0,n=i.length,o=0,r=e.length){for(;tc)return 1}const s=n-t,a=r-o;return sa?1:0}function WV(i,e){return WI(i,e,0,i.length,0,e.length)}function WI(i,e,t=0,n=i.length,o=0,r=e.length){for(;t=128||c>=128)return Kq(i.toLowerCase(),e.toLowerCase(),t,n,o,r);Cm(l)&&(l-=32),Cm(c)&&(c-=32);const u=l-c;if(u!==0)return u}const s=n-t,a=r-o;return sa?1:0}function n2(i){return i>=48&&i<=57}function Cm(i){return i>=97&&i<=122}function kh(i){return i>=65&&i<=90}function kC(i,e){return i.length===e.length&&WI(i,e)===0}function qq(i,e){const t=e.length;return e.length>i.length?!1:WI(i,e,0,t)===0}function Y0(i,e){const t=Math.min(i.length,e.length);let n;for(n=0;n1){const n=i.charCodeAt(e-2);if(gr(n))return Gq(n,t)}return t}class Xq{get offset(){return this._offset}constructor(e,t=0){this._str=e,this._len=e.length,this._offset=t}setOffset(e){this._offset=e}prevCodePoint(){const e=fZe(this._str,this._offset);return this._offset-=e>=65536?2:1,e}nextCodePoint(){const e=UA(this._str,this._len,this._offset);return this._offset+=e>=65536?2:1,e}eol(){return this._offset>=this._len}}class jA{get offset(){return this._iterator.offset}constructor(e,t=0){this._iterator=new Xq(e,t)}nextGraphemeLength(){const e=ym.getInstance(),t=this._iterator,n=t.offset;let o=e.getGraphemeBreakType(t.nextCodePoint());for(;!t.eol();){const r=t.offset,s=e.getGraphemeBreakType(t.nextCodePoint());if(foe(o,s)){t.setOffset(r);break}o=s}return t.offset-n}prevGraphemeLength(){const e=ym.getInstance(),t=this._iterator,n=t.offset;let o=e.getGraphemeBreakType(t.prevCodePoint());for(;t.offset>0;){const r=t.offset,s=e.getGraphemeBreakType(t.prevCodePoint());if(foe(s,o)){t.setOffset(r);break}o=s}return n-t.offset}eol(){return this._iterator.eol()}}function Yq(i,e){return new jA(i,e).nextGraphemeLength()}function z_e(i,e){return new jA(i,e).prevGraphemeLength()}function gZe(i,e){e>0&&Z0(i.charCodeAt(e))&&e--;const t=e+Yq(i,e);return[t-z_e(i,t),t]}let I6;function pZe(){return/(?:[\u05BE\u05C0\u05C3\u05C6\u05D0-\u05F4\u0608\u060B\u060D\u061B-\u064A\u066D-\u066F\u0671-\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u0710\u0712-\u072F\u074D-\u07A5\u07B1-\u07EA\u07F4\u07F5\u07FA\u07FE-\u0815\u081A\u0824\u0828\u0830-\u0858\u085E-\u088E\u08A0-\u08C9\u200F\uFB1D\uFB1F-\uFB28\uFB2A-\uFD3D\uFD50-\uFDC7\uFDF0-\uFDFC\uFE70-\uFEFC]|\uD802[\uDC00-\uDD1B\uDD20-\uDE00\uDE10-\uDE35\uDE40-\uDEE4\uDEEB-\uDF35\uDF40-\uDFFF]|\uD803[\uDC00-\uDD23\uDE80-\uDEA9\uDEAD-\uDF45\uDF51-\uDF81\uDF86-\uDFF6]|\uD83A[\uDC00-\uDCCF\uDD00-\uDD43\uDD4B-\uDFFF]|\uD83B[\uDC00-\uDEBB])/}function fw(i){return I6||(I6=pZe()),I6.test(i)}const mZe=/^[\t\n\r\x20-\x7E]*$/;function VI(i){return mZe.test(i)}const U_e=/[\u2028\u2029]/;function j_e(i){return U_e.test(i)}function Cv(i){return i>=11904&&i<=55215||i>=63744&&i<=64255||i>=65281&&i<=65374}function Zq(i){return i>=127462&&i<=127487||i===8986||i===8987||i===9200||i===9203||i>=9728&&i<=10175||i===11088||i===11093||i>=127744&&i<=128591||i>=128640&&i<=128764||i>=128992&&i<=129008||i>=129280&&i<=129535||i>=129648&&i<=129782}const vZe=String.fromCharCode(65279);function Qq(i){return!!(i&&i.length>0&&i.charCodeAt(0)===65279)}function _Ze(i,e=!1){return i?(e&&(i=i.replace(/\\./g,"")),i.toLowerCase()!==i):!1}function K_e(i){return i=i%(2*26),i<26?String.fromCharCode(97+i):String.fromCharCode(65+i-26)}function foe(i,e){return i===0?e!==5&&e!==7:i===2&&e===3?!1:i===4||i===2||i===3||e===4||e===2||e===3?!0:!(i===8&&(e===8||e===9||e===11||e===12)||(i===11||i===9)&&(e===9||e===10)||(i===12||i===10)&&e===10||e===5||e===13||e===7||i===1||i===13&&e===14||i===6&&e===6)}class ym{static getInstance(){return ym._INSTANCE||(ym._INSTANCE=new ym),ym._INSTANCE}constructor(){this._data=bZe()}getGraphemeBreakType(e){if(e<32)return e===10?3:e===13?2:4;if(e<127)return 0;const t=this._data,n=t.length/3;let o=1;for(;o<=n;)if(et[3*o+1])o=2*o+1;else return t[3*o+2];return 0}}ym._INSTANCE=null;function bZe(){return JSON.parse("[0,0,0,51229,51255,12,44061,44087,12,127462,127487,6,7083,7085,5,47645,47671,12,54813,54839,12,128678,128678,14,3270,3270,5,9919,9923,14,45853,45879,12,49437,49463,12,53021,53047,12,71216,71218,7,128398,128399,14,129360,129374,14,2519,2519,5,4448,4519,9,9742,9742,14,12336,12336,14,44957,44983,12,46749,46775,12,48541,48567,12,50333,50359,12,52125,52151,12,53917,53943,12,69888,69890,5,73018,73018,5,127990,127990,14,128558,128559,14,128759,128760,14,129653,129655,14,2027,2035,5,2891,2892,7,3761,3761,5,6683,6683,5,8293,8293,4,9825,9826,14,9999,9999,14,43452,43453,5,44509,44535,12,45405,45431,12,46301,46327,12,47197,47223,12,48093,48119,12,48989,49015,12,49885,49911,12,50781,50807,12,51677,51703,12,52573,52599,12,53469,53495,12,54365,54391,12,65279,65279,4,70471,70472,7,72145,72147,7,119173,119179,5,127799,127818,14,128240,128244,14,128512,128512,14,128652,128652,14,128721,128722,14,129292,129292,14,129445,129450,14,129734,129743,14,1476,1477,5,2366,2368,7,2750,2752,7,3076,3076,5,3415,3415,5,4141,4144,5,6109,6109,5,6964,6964,5,7394,7400,5,9197,9198,14,9770,9770,14,9877,9877,14,9968,9969,14,10084,10084,14,43052,43052,5,43713,43713,5,44285,44311,12,44733,44759,12,45181,45207,12,45629,45655,12,46077,46103,12,46525,46551,12,46973,46999,12,47421,47447,12,47869,47895,12,48317,48343,12,48765,48791,12,49213,49239,12,49661,49687,12,50109,50135,12,50557,50583,12,51005,51031,12,51453,51479,12,51901,51927,12,52349,52375,12,52797,52823,12,53245,53271,12,53693,53719,12,54141,54167,12,54589,54615,12,55037,55063,12,69506,69509,5,70191,70193,5,70841,70841,7,71463,71467,5,72330,72342,5,94031,94031,5,123628,123631,5,127763,127765,14,127941,127941,14,128043,128062,14,128302,128317,14,128465,128467,14,128539,128539,14,128640,128640,14,128662,128662,14,128703,128703,14,128745,128745,14,129004,129007,14,129329,129330,14,129402,129402,14,129483,129483,14,129686,129704,14,130048,131069,14,173,173,4,1757,1757,1,2200,2207,5,2434,2435,7,2631,2632,5,2817,2817,5,3008,3008,5,3201,3201,5,3387,3388,5,3542,3542,5,3902,3903,7,4190,4192,5,6002,6003,5,6439,6440,5,6765,6770,7,7019,7027,5,7154,7155,7,8205,8205,13,8505,8505,14,9654,9654,14,9757,9757,14,9792,9792,14,9852,9853,14,9890,9894,14,9937,9937,14,9981,9981,14,10035,10036,14,11035,11036,14,42654,42655,5,43346,43347,7,43587,43587,5,44006,44007,7,44173,44199,12,44397,44423,12,44621,44647,12,44845,44871,12,45069,45095,12,45293,45319,12,45517,45543,12,45741,45767,12,45965,45991,12,46189,46215,12,46413,46439,12,46637,46663,12,46861,46887,12,47085,47111,12,47309,47335,12,47533,47559,12,47757,47783,12,47981,48007,12,48205,48231,12,48429,48455,12,48653,48679,12,48877,48903,12,49101,49127,12,49325,49351,12,49549,49575,12,49773,49799,12,49997,50023,12,50221,50247,12,50445,50471,12,50669,50695,12,50893,50919,12,51117,51143,12,51341,51367,12,51565,51591,12,51789,51815,12,52013,52039,12,52237,52263,12,52461,52487,12,52685,52711,12,52909,52935,12,53133,53159,12,53357,53383,12,53581,53607,12,53805,53831,12,54029,54055,12,54253,54279,12,54477,54503,12,54701,54727,12,54925,54951,12,55149,55175,12,68101,68102,5,69762,69762,7,70067,70069,7,70371,70378,5,70720,70721,7,71087,71087,5,71341,71341,5,71995,71996,5,72249,72249,7,72850,72871,5,73109,73109,5,118576,118598,5,121505,121519,5,127245,127247,14,127568,127569,14,127777,127777,14,127872,127891,14,127956,127967,14,128015,128016,14,128110,128172,14,128259,128259,14,128367,128368,14,128424,128424,14,128488,128488,14,128530,128532,14,128550,128551,14,128566,128566,14,128647,128647,14,128656,128656,14,128667,128673,14,128691,128693,14,128715,128715,14,128728,128732,14,128752,128752,14,128765,128767,14,129096,129103,14,129311,129311,14,129344,129349,14,129394,129394,14,129413,129425,14,129466,129471,14,129511,129535,14,129664,129666,14,129719,129722,14,129760,129767,14,917536,917631,5,13,13,2,1160,1161,5,1564,1564,4,1807,1807,1,2085,2087,5,2307,2307,7,2382,2383,7,2497,2500,5,2563,2563,7,2677,2677,5,2763,2764,7,2879,2879,5,2914,2915,5,3021,3021,5,3142,3144,5,3263,3263,5,3285,3286,5,3398,3400,7,3530,3530,5,3633,3633,5,3864,3865,5,3974,3975,5,4155,4156,7,4229,4230,5,5909,5909,7,6078,6085,7,6277,6278,5,6451,6456,7,6744,6750,5,6846,6846,5,6972,6972,5,7074,7077,5,7146,7148,7,7222,7223,5,7416,7417,5,8234,8238,4,8417,8417,5,9000,9000,14,9203,9203,14,9730,9731,14,9748,9749,14,9762,9763,14,9776,9783,14,9800,9811,14,9831,9831,14,9872,9873,14,9882,9882,14,9900,9903,14,9929,9933,14,9941,9960,14,9974,9974,14,9989,9989,14,10006,10006,14,10062,10062,14,10160,10160,14,11647,11647,5,12953,12953,14,43019,43019,5,43232,43249,5,43443,43443,5,43567,43568,7,43696,43696,5,43765,43765,7,44013,44013,5,44117,44143,12,44229,44255,12,44341,44367,12,44453,44479,12,44565,44591,12,44677,44703,12,44789,44815,12,44901,44927,12,45013,45039,12,45125,45151,12,45237,45263,12,45349,45375,12,45461,45487,12,45573,45599,12,45685,45711,12,45797,45823,12,45909,45935,12,46021,46047,12,46133,46159,12,46245,46271,12,46357,46383,12,46469,46495,12,46581,46607,12,46693,46719,12,46805,46831,12,46917,46943,12,47029,47055,12,47141,47167,12,47253,47279,12,47365,47391,12,47477,47503,12,47589,47615,12,47701,47727,12,47813,47839,12,47925,47951,12,48037,48063,12,48149,48175,12,48261,48287,12,48373,48399,12,48485,48511,12,48597,48623,12,48709,48735,12,48821,48847,12,48933,48959,12,49045,49071,12,49157,49183,12,49269,49295,12,49381,49407,12,49493,49519,12,49605,49631,12,49717,49743,12,49829,49855,12,49941,49967,12,50053,50079,12,50165,50191,12,50277,50303,12,50389,50415,12,50501,50527,12,50613,50639,12,50725,50751,12,50837,50863,12,50949,50975,12,51061,51087,12,51173,51199,12,51285,51311,12,51397,51423,12,51509,51535,12,51621,51647,12,51733,51759,12,51845,51871,12,51957,51983,12,52069,52095,12,52181,52207,12,52293,52319,12,52405,52431,12,52517,52543,12,52629,52655,12,52741,52767,12,52853,52879,12,52965,52991,12,53077,53103,12,53189,53215,12,53301,53327,12,53413,53439,12,53525,53551,12,53637,53663,12,53749,53775,12,53861,53887,12,53973,53999,12,54085,54111,12,54197,54223,12,54309,54335,12,54421,54447,12,54533,54559,12,54645,54671,12,54757,54783,12,54869,54895,12,54981,55007,12,55093,55119,12,55243,55291,10,66045,66045,5,68325,68326,5,69688,69702,5,69817,69818,5,69957,69958,7,70089,70092,5,70198,70199,5,70462,70462,5,70502,70508,5,70750,70750,5,70846,70846,7,71100,71101,5,71230,71230,7,71351,71351,5,71737,71738,5,72000,72000,7,72160,72160,5,72273,72278,5,72752,72758,5,72882,72883,5,73031,73031,5,73461,73462,7,94192,94193,7,119149,119149,7,121403,121452,5,122915,122916,5,126980,126980,14,127358,127359,14,127535,127535,14,127759,127759,14,127771,127771,14,127792,127793,14,127825,127867,14,127897,127899,14,127945,127945,14,127985,127986,14,128000,128007,14,128021,128021,14,128066,128100,14,128184,128235,14,128249,128252,14,128266,128276,14,128335,128335,14,128379,128390,14,128407,128419,14,128444,128444,14,128481,128481,14,128499,128499,14,128526,128526,14,128536,128536,14,128543,128543,14,128556,128556,14,128564,128564,14,128577,128580,14,128643,128645,14,128649,128649,14,128654,128654,14,128660,128660,14,128664,128664,14,128675,128675,14,128686,128689,14,128695,128696,14,128705,128709,14,128717,128719,14,128725,128725,14,128736,128741,14,128747,128748,14,128755,128755,14,128762,128762,14,128981,128991,14,129009,129023,14,129160,129167,14,129296,129304,14,129320,129327,14,129340,129342,14,129356,129356,14,129388,129392,14,129399,129400,14,129404,129407,14,129432,129442,14,129454,129455,14,129473,129474,14,129485,129487,14,129648,129651,14,129659,129660,14,129671,129679,14,129709,129711,14,129728,129730,14,129751,129753,14,129776,129782,14,917505,917505,4,917760,917999,5,10,10,3,127,159,4,768,879,5,1471,1471,5,1536,1541,1,1648,1648,5,1767,1768,5,1840,1866,5,2070,2073,5,2137,2139,5,2274,2274,1,2363,2363,7,2377,2380,7,2402,2403,5,2494,2494,5,2507,2508,7,2558,2558,5,2622,2624,7,2641,2641,5,2691,2691,7,2759,2760,5,2786,2787,5,2876,2876,5,2881,2884,5,2901,2902,5,3006,3006,5,3014,3016,7,3072,3072,5,3134,3136,5,3157,3158,5,3260,3260,5,3266,3266,5,3274,3275,7,3328,3329,5,3391,3392,7,3405,3405,5,3457,3457,5,3536,3537,7,3551,3551,5,3636,3642,5,3764,3772,5,3895,3895,5,3967,3967,7,3993,4028,5,4146,4151,5,4182,4183,7,4226,4226,5,4253,4253,5,4957,4959,5,5940,5940,7,6070,6070,7,6087,6088,7,6158,6158,4,6432,6434,5,6448,6449,7,6679,6680,5,6742,6742,5,6754,6754,5,6783,6783,5,6912,6915,5,6966,6970,5,6978,6978,5,7042,7042,7,7080,7081,5,7143,7143,7,7150,7150,7,7212,7219,5,7380,7392,5,7412,7412,5,8203,8203,4,8232,8232,4,8265,8265,14,8400,8412,5,8421,8432,5,8617,8618,14,9167,9167,14,9200,9200,14,9410,9410,14,9723,9726,14,9733,9733,14,9745,9745,14,9752,9752,14,9760,9760,14,9766,9766,14,9774,9774,14,9786,9786,14,9794,9794,14,9823,9823,14,9828,9828,14,9833,9850,14,9855,9855,14,9875,9875,14,9880,9880,14,9885,9887,14,9896,9897,14,9906,9916,14,9926,9927,14,9935,9935,14,9939,9939,14,9962,9962,14,9972,9972,14,9978,9978,14,9986,9986,14,9997,9997,14,10002,10002,14,10017,10017,14,10055,10055,14,10071,10071,14,10133,10135,14,10548,10549,14,11093,11093,14,12330,12333,5,12441,12442,5,42608,42610,5,43010,43010,5,43045,43046,5,43188,43203,7,43302,43309,5,43392,43394,5,43446,43449,5,43493,43493,5,43571,43572,7,43597,43597,7,43703,43704,5,43756,43757,5,44003,44004,7,44009,44010,7,44033,44059,12,44089,44115,12,44145,44171,12,44201,44227,12,44257,44283,12,44313,44339,12,44369,44395,12,44425,44451,12,44481,44507,12,44537,44563,12,44593,44619,12,44649,44675,12,44705,44731,12,44761,44787,12,44817,44843,12,44873,44899,12,44929,44955,12,44985,45011,12,45041,45067,12,45097,45123,12,45153,45179,12,45209,45235,12,45265,45291,12,45321,45347,12,45377,45403,12,45433,45459,12,45489,45515,12,45545,45571,12,45601,45627,12,45657,45683,12,45713,45739,12,45769,45795,12,45825,45851,12,45881,45907,12,45937,45963,12,45993,46019,12,46049,46075,12,46105,46131,12,46161,46187,12,46217,46243,12,46273,46299,12,46329,46355,12,46385,46411,12,46441,46467,12,46497,46523,12,46553,46579,12,46609,46635,12,46665,46691,12,46721,46747,12,46777,46803,12,46833,46859,12,46889,46915,12,46945,46971,12,47001,47027,12,47057,47083,12,47113,47139,12,47169,47195,12,47225,47251,12,47281,47307,12,47337,47363,12,47393,47419,12,47449,47475,12,47505,47531,12,47561,47587,12,47617,47643,12,47673,47699,12,47729,47755,12,47785,47811,12,47841,47867,12,47897,47923,12,47953,47979,12,48009,48035,12,48065,48091,12,48121,48147,12,48177,48203,12,48233,48259,12,48289,48315,12,48345,48371,12,48401,48427,12,48457,48483,12,48513,48539,12,48569,48595,12,48625,48651,12,48681,48707,12,48737,48763,12,48793,48819,12,48849,48875,12,48905,48931,12,48961,48987,12,49017,49043,12,49073,49099,12,49129,49155,12,49185,49211,12,49241,49267,12,49297,49323,12,49353,49379,12,49409,49435,12,49465,49491,12,49521,49547,12,49577,49603,12,49633,49659,12,49689,49715,12,49745,49771,12,49801,49827,12,49857,49883,12,49913,49939,12,49969,49995,12,50025,50051,12,50081,50107,12,50137,50163,12,50193,50219,12,50249,50275,12,50305,50331,12,50361,50387,12,50417,50443,12,50473,50499,12,50529,50555,12,50585,50611,12,50641,50667,12,50697,50723,12,50753,50779,12,50809,50835,12,50865,50891,12,50921,50947,12,50977,51003,12,51033,51059,12,51089,51115,12,51145,51171,12,51201,51227,12,51257,51283,12,51313,51339,12,51369,51395,12,51425,51451,12,51481,51507,12,51537,51563,12,51593,51619,12,51649,51675,12,51705,51731,12,51761,51787,12,51817,51843,12,51873,51899,12,51929,51955,12,51985,52011,12,52041,52067,12,52097,52123,12,52153,52179,12,52209,52235,12,52265,52291,12,52321,52347,12,52377,52403,12,52433,52459,12,52489,52515,12,52545,52571,12,52601,52627,12,52657,52683,12,52713,52739,12,52769,52795,12,52825,52851,12,52881,52907,12,52937,52963,12,52993,53019,12,53049,53075,12,53105,53131,12,53161,53187,12,53217,53243,12,53273,53299,12,53329,53355,12,53385,53411,12,53441,53467,12,53497,53523,12,53553,53579,12,53609,53635,12,53665,53691,12,53721,53747,12,53777,53803,12,53833,53859,12,53889,53915,12,53945,53971,12,54001,54027,12,54057,54083,12,54113,54139,12,54169,54195,12,54225,54251,12,54281,54307,12,54337,54363,12,54393,54419,12,54449,54475,12,54505,54531,12,54561,54587,12,54617,54643,12,54673,54699,12,54729,54755,12,54785,54811,12,54841,54867,12,54897,54923,12,54953,54979,12,55009,55035,12,55065,55091,12,55121,55147,12,55177,55203,12,65024,65039,5,65520,65528,4,66422,66426,5,68152,68154,5,69291,69292,5,69633,69633,5,69747,69748,5,69811,69814,5,69826,69826,5,69932,69932,7,70016,70017,5,70079,70080,7,70095,70095,5,70196,70196,5,70367,70367,5,70402,70403,7,70464,70464,5,70487,70487,5,70709,70711,7,70725,70725,7,70833,70834,7,70843,70844,7,70849,70849,7,71090,71093,5,71103,71104,5,71227,71228,7,71339,71339,5,71344,71349,5,71458,71461,5,71727,71735,5,71985,71989,7,71998,71998,5,72002,72002,7,72154,72155,5,72193,72202,5,72251,72254,5,72281,72283,5,72344,72345,5,72766,72766,7,72874,72880,5,72885,72886,5,73023,73029,5,73104,73105,5,73111,73111,5,92912,92916,5,94095,94098,5,113824,113827,4,119142,119142,7,119155,119162,4,119362,119364,5,121476,121476,5,122888,122904,5,123184,123190,5,125252,125258,5,127183,127183,14,127340,127343,14,127377,127386,14,127491,127503,14,127548,127551,14,127744,127756,14,127761,127761,14,127769,127769,14,127773,127774,14,127780,127788,14,127796,127797,14,127820,127823,14,127869,127869,14,127894,127895,14,127902,127903,14,127943,127943,14,127947,127950,14,127972,127972,14,127988,127988,14,127992,127994,14,128009,128011,14,128019,128019,14,128023,128041,14,128064,128064,14,128102,128107,14,128174,128181,14,128238,128238,14,128246,128247,14,128254,128254,14,128264,128264,14,128278,128299,14,128329,128330,14,128348,128359,14,128371,128377,14,128392,128393,14,128401,128404,14,128421,128421,14,128433,128434,14,128450,128452,14,128476,128478,14,128483,128483,14,128495,128495,14,128506,128506,14,128519,128520,14,128528,128528,14,128534,128534,14,128538,128538,14,128540,128542,14,128544,128549,14,128552,128555,14,128557,128557,14,128560,128563,14,128565,128565,14,128567,128576,14,128581,128591,14,128641,128642,14,128646,128646,14,128648,128648,14,128650,128651,14,128653,128653,14,128655,128655,14,128657,128659,14,128661,128661,14,128663,128663,14,128665,128666,14,128674,128674,14,128676,128677,14,128679,128685,14,128690,128690,14,128694,128694,14,128697,128702,14,128704,128704,14,128710,128714,14,128716,128716,14,128720,128720,14,128723,128724,14,128726,128727,14,128733,128735,14,128742,128744,14,128746,128746,14,128749,128751,14,128753,128754,14,128756,128758,14,128761,128761,14,128763,128764,14,128884,128895,14,128992,129003,14,129008,129008,14,129036,129039,14,129114,129119,14,129198,129279,14,129293,129295,14,129305,129310,14,129312,129319,14,129328,129328,14,129331,129338,14,129343,129343,14,129351,129355,14,129357,129359,14,129375,129387,14,129393,129393,14,129395,129398,14,129401,129401,14,129403,129403,14,129408,129412,14,129426,129431,14,129443,129444,14,129451,129453,14,129456,129465,14,129472,129472,14,129475,129482,14,129484,129484,14,129488,129510,14,129536,129647,14,129652,129652,14,129656,129658,14,129661,129663,14,129667,129670,14,129680,129685,14,129705,129708,14,129712,129718,14,129723,129727,14,129731,129733,14,129744,129750,14,129754,129759,14,129768,129775,14,129783,129791,14,917504,917504,4,917506,917535,4,917632,917759,4,918000,921599,4,0,9,4,11,12,4,14,31,4,169,169,14,174,174,14,1155,1159,5,1425,1469,5,1473,1474,5,1479,1479,5,1552,1562,5,1611,1631,5,1750,1756,5,1759,1764,5,1770,1773,5,1809,1809,5,1958,1968,5,2045,2045,5,2075,2083,5,2089,2093,5,2192,2193,1,2250,2273,5,2275,2306,5,2362,2362,5,2364,2364,5,2369,2376,5,2381,2381,5,2385,2391,5,2433,2433,5,2492,2492,5,2495,2496,7,2503,2504,7,2509,2509,5,2530,2531,5,2561,2562,5,2620,2620,5,2625,2626,5,2635,2637,5,2672,2673,5,2689,2690,5,2748,2748,5,2753,2757,5,2761,2761,7,2765,2765,5,2810,2815,5,2818,2819,7,2878,2878,5,2880,2880,7,2887,2888,7,2893,2893,5,2903,2903,5,2946,2946,5,3007,3007,7,3009,3010,7,3018,3020,7,3031,3031,5,3073,3075,7,3132,3132,5,3137,3140,7,3146,3149,5,3170,3171,5,3202,3203,7,3262,3262,7,3264,3265,7,3267,3268,7,3271,3272,7,3276,3277,5,3298,3299,5,3330,3331,7,3390,3390,5,3393,3396,5,3402,3404,7,3406,3406,1,3426,3427,5,3458,3459,7,3535,3535,5,3538,3540,5,3544,3550,7,3570,3571,7,3635,3635,7,3655,3662,5,3763,3763,7,3784,3789,5,3893,3893,5,3897,3897,5,3953,3966,5,3968,3972,5,3981,3991,5,4038,4038,5,4145,4145,7,4153,4154,5,4157,4158,5,4184,4185,5,4209,4212,5,4228,4228,7,4237,4237,5,4352,4447,8,4520,4607,10,5906,5908,5,5938,5939,5,5970,5971,5,6068,6069,5,6071,6077,5,6086,6086,5,6089,6099,5,6155,6157,5,6159,6159,5,6313,6313,5,6435,6438,7,6441,6443,7,6450,6450,5,6457,6459,5,6681,6682,7,6741,6741,7,6743,6743,7,6752,6752,5,6757,6764,5,6771,6780,5,6832,6845,5,6847,6862,5,6916,6916,7,6965,6965,5,6971,6971,7,6973,6977,7,6979,6980,7,7040,7041,5,7073,7073,7,7078,7079,7,7082,7082,7,7142,7142,5,7144,7145,5,7149,7149,5,7151,7153,5,7204,7211,7,7220,7221,7,7376,7378,5,7393,7393,7,7405,7405,5,7415,7415,7,7616,7679,5,8204,8204,5,8206,8207,4,8233,8233,4,8252,8252,14,8288,8292,4,8294,8303,4,8413,8416,5,8418,8420,5,8482,8482,14,8596,8601,14,8986,8987,14,9096,9096,14,9193,9196,14,9199,9199,14,9201,9202,14,9208,9210,14,9642,9643,14,9664,9664,14,9728,9729,14,9732,9732,14,9735,9741,14,9743,9744,14,9746,9746,14,9750,9751,14,9753,9756,14,9758,9759,14,9761,9761,14,9764,9765,14,9767,9769,14,9771,9773,14,9775,9775,14,9784,9785,14,9787,9791,14,9793,9793,14,9795,9799,14,9812,9822,14,9824,9824,14,9827,9827,14,9829,9830,14,9832,9832,14,9851,9851,14,9854,9854,14,9856,9861,14,9874,9874,14,9876,9876,14,9878,9879,14,9881,9881,14,9883,9884,14,9888,9889,14,9895,9895,14,9898,9899,14,9904,9905,14,9917,9918,14,9924,9925,14,9928,9928,14,9934,9934,14,9936,9936,14,9938,9938,14,9940,9940,14,9961,9961,14,9963,9967,14,9970,9971,14,9973,9973,14,9975,9977,14,9979,9980,14,9982,9985,14,9987,9988,14,9992,9996,14,9998,9998,14,10000,10001,14,10004,10004,14,10013,10013,14,10024,10024,14,10052,10052,14,10060,10060,14,10067,10069,14,10083,10083,14,10085,10087,14,10145,10145,14,10175,10175,14,11013,11015,14,11088,11088,14,11503,11505,5,11744,11775,5,12334,12335,5,12349,12349,14,12951,12951,14,42607,42607,5,42612,42621,5,42736,42737,5,43014,43014,5,43043,43044,7,43047,43047,7,43136,43137,7,43204,43205,5,43263,43263,5,43335,43345,5,43360,43388,8,43395,43395,7,43444,43445,7,43450,43451,7,43454,43456,7,43561,43566,5,43569,43570,5,43573,43574,5,43596,43596,5,43644,43644,5,43698,43700,5,43710,43711,5,43755,43755,7,43758,43759,7,43766,43766,5,44005,44005,5,44008,44008,5,44012,44012,7,44032,44032,11,44060,44060,11,44088,44088,11,44116,44116,11,44144,44144,11,44172,44172,11,44200,44200,11,44228,44228,11,44256,44256,11,44284,44284,11,44312,44312,11,44340,44340,11,44368,44368,11,44396,44396,11,44424,44424,11,44452,44452,11,44480,44480,11,44508,44508,11,44536,44536,11,44564,44564,11,44592,44592,11,44620,44620,11,44648,44648,11,44676,44676,11,44704,44704,11,44732,44732,11,44760,44760,11,44788,44788,11,44816,44816,11,44844,44844,11,44872,44872,11,44900,44900,11,44928,44928,11,44956,44956,11,44984,44984,11,45012,45012,11,45040,45040,11,45068,45068,11,45096,45096,11,45124,45124,11,45152,45152,11,45180,45180,11,45208,45208,11,45236,45236,11,45264,45264,11,45292,45292,11,45320,45320,11,45348,45348,11,45376,45376,11,45404,45404,11,45432,45432,11,45460,45460,11,45488,45488,11,45516,45516,11,45544,45544,11,45572,45572,11,45600,45600,11,45628,45628,11,45656,45656,11,45684,45684,11,45712,45712,11,45740,45740,11,45768,45768,11,45796,45796,11,45824,45824,11,45852,45852,11,45880,45880,11,45908,45908,11,45936,45936,11,45964,45964,11,45992,45992,11,46020,46020,11,46048,46048,11,46076,46076,11,46104,46104,11,46132,46132,11,46160,46160,11,46188,46188,11,46216,46216,11,46244,46244,11,46272,46272,11,46300,46300,11,46328,46328,11,46356,46356,11,46384,46384,11,46412,46412,11,46440,46440,11,46468,46468,11,46496,46496,11,46524,46524,11,46552,46552,11,46580,46580,11,46608,46608,11,46636,46636,11,46664,46664,11,46692,46692,11,46720,46720,11,46748,46748,11,46776,46776,11,46804,46804,11,46832,46832,11,46860,46860,11,46888,46888,11,46916,46916,11,46944,46944,11,46972,46972,11,47000,47000,11,47028,47028,11,47056,47056,11,47084,47084,11,47112,47112,11,47140,47140,11,47168,47168,11,47196,47196,11,47224,47224,11,47252,47252,11,47280,47280,11,47308,47308,11,47336,47336,11,47364,47364,11,47392,47392,11,47420,47420,11,47448,47448,11,47476,47476,11,47504,47504,11,47532,47532,11,47560,47560,11,47588,47588,11,47616,47616,11,47644,47644,11,47672,47672,11,47700,47700,11,47728,47728,11,47756,47756,11,47784,47784,11,47812,47812,11,47840,47840,11,47868,47868,11,47896,47896,11,47924,47924,11,47952,47952,11,47980,47980,11,48008,48008,11,48036,48036,11,48064,48064,11,48092,48092,11,48120,48120,11,48148,48148,11,48176,48176,11,48204,48204,11,48232,48232,11,48260,48260,11,48288,48288,11,48316,48316,11,48344,48344,11,48372,48372,11,48400,48400,11,48428,48428,11,48456,48456,11,48484,48484,11,48512,48512,11,48540,48540,11,48568,48568,11,48596,48596,11,48624,48624,11,48652,48652,11,48680,48680,11,48708,48708,11,48736,48736,11,48764,48764,11,48792,48792,11,48820,48820,11,48848,48848,11,48876,48876,11,48904,48904,11,48932,48932,11,48960,48960,11,48988,48988,11,49016,49016,11,49044,49044,11,49072,49072,11,49100,49100,11,49128,49128,11,49156,49156,11,49184,49184,11,49212,49212,11,49240,49240,11,49268,49268,11,49296,49296,11,49324,49324,11,49352,49352,11,49380,49380,11,49408,49408,11,49436,49436,11,49464,49464,11,49492,49492,11,49520,49520,11,49548,49548,11,49576,49576,11,49604,49604,11,49632,49632,11,49660,49660,11,49688,49688,11,49716,49716,11,49744,49744,11,49772,49772,11,49800,49800,11,49828,49828,11,49856,49856,11,49884,49884,11,49912,49912,11,49940,49940,11,49968,49968,11,49996,49996,11,50024,50024,11,50052,50052,11,50080,50080,11,50108,50108,11,50136,50136,11,50164,50164,11,50192,50192,11,50220,50220,11,50248,50248,11,50276,50276,11,50304,50304,11,50332,50332,11,50360,50360,11,50388,50388,11,50416,50416,11,50444,50444,11,50472,50472,11,50500,50500,11,50528,50528,11,50556,50556,11,50584,50584,11,50612,50612,11,50640,50640,11,50668,50668,11,50696,50696,11,50724,50724,11,50752,50752,11,50780,50780,11,50808,50808,11,50836,50836,11,50864,50864,11,50892,50892,11,50920,50920,11,50948,50948,11,50976,50976,11,51004,51004,11,51032,51032,11,51060,51060,11,51088,51088,11,51116,51116,11,51144,51144,11,51172,51172,11,51200,51200,11,51228,51228,11,51256,51256,11,51284,51284,11,51312,51312,11,51340,51340,11,51368,51368,11,51396,51396,11,51424,51424,11,51452,51452,11,51480,51480,11,51508,51508,11,51536,51536,11,51564,51564,11,51592,51592,11,51620,51620,11,51648,51648,11,51676,51676,11,51704,51704,11,51732,51732,11,51760,51760,11,51788,51788,11,51816,51816,11,51844,51844,11,51872,51872,11,51900,51900,11,51928,51928,11,51956,51956,11,51984,51984,11,52012,52012,11,52040,52040,11,52068,52068,11,52096,52096,11,52124,52124,11,52152,52152,11,52180,52180,11,52208,52208,11,52236,52236,11,52264,52264,11,52292,52292,11,52320,52320,11,52348,52348,11,52376,52376,11,52404,52404,11,52432,52432,11,52460,52460,11,52488,52488,11,52516,52516,11,52544,52544,11,52572,52572,11,52600,52600,11,52628,52628,11,52656,52656,11,52684,52684,11,52712,52712,11,52740,52740,11,52768,52768,11,52796,52796,11,52824,52824,11,52852,52852,11,52880,52880,11,52908,52908,11,52936,52936,11,52964,52964,11,52992,52992,11,53020,53020,11,53048,53048,11,53076,53076,11,53104,53104,11,53132,53132,11,53160,53160,11,53188,53188,11,53216,53216,11,53244,53244,11,53272,53272,11,53300,53300,11,53328,53328,11,53356,53356,11,53384,53384,11,53412,53412,11,53440,53440,11,53468,53468,11,53496,53496,11,53524,53524,11,53552,53552,11,53580,53580,11,53608,53608,11,53636,53636,11,53664,53664,11,53692,53692,11,53720,53720,11,53748,53748,11,53776,53776,11,53804,53804,11,53832,53832,11,53860,53860,11,53888,53888,11,53916,53916,11,53944,53944,11,53972,53972,11,54000,54000,11,54028,54028,11,54056,54056,11,54084,54084,11,54112,54112,11,54140,54140,11,54168,54168,11,54196,54196,11,54224,54224,11,54252,54252,11,54280,54280,11,54308,54308,11,54336,54336,11,54364,54364,11,54392,54392,11,54420,54420,11,54448,54448,11,54476,54476,11,54504,54504,11,54532,54532,11,54560,54560,11,54588,54588,11,54616,54616,11,54644,54644,11,54672,54672,11,54700,54700,11,54728,54728,11,54756,54756,11,54784,54784,11,54812,54812,11,54840,54840,11,54868,54868,11,54896,54896,11,54924,54924,11,54952,54952,11,54980,54980,11,55008,55008,11,55036,55036,11,55064,55064,11,55092,55092,11,55120,55120,11,55148,55148,11,55176,55176,11,55216,55238,9,64286,64286,5,65056,65071,5,65438,65439,5,65529,65531,4,66272,66272,5,68097,68099,5,68108,68111,5,68159,68159,5,68900,68903,5,69446,69456,5,69632,69632,7,69634,69634,7,69744,69744,5,69759,69761,5,69808,69810,7,69815,69816,7,69821,69821,1,69837,69837,1,69927,69931,5,69933,69940,5,70003,70003,5,70018,70018,7,70070,70078,5,70082,70083,1,70094,70094,7,70188,70190,7,70194,70195,7,70197,70197,7,70206,70206,5,70368,70370,7,70400,70401,5,70459,70460,5,70463,70463,7,70465,70468,7,70475,70477,7,70498,70499,7,70512,70516,5,70712,70719,5,70722,70724,5,70726,70726,5,70832,70832,5,70835,70840,5,70842,70842,5,70845,70845,5,70847,70848,5,70850,70851,5,71088,71089,7,71096,71099,7,71102,71102,7,71132,71133,5,71219,71226,5,71229,71229,5,71231,71232,5,71340,71340,7,71342,71343,7,71350,71350,7,71453,71455,5,71462,71462,7,71724,71726,7,71736,71736,7,71984,71984,5,71991,71992,7,71997,71997,7,71999,71999,1,72001,72001,1,72003,72003,5,72148,72151,5,72156,72159,7,72164,72164,7,72243,72248,5,72250,72250,1,72263,72263,5,72279,72280,7,72324,72329,1,72343,72343,7,72751,72751,7,72760,72765,5,72767,72767,5,72873,72873,7,72881,72881,7,72884,72884,7,73009,73014,5,73020,73021,5,73030,73030,1,73098,73102,7,73107,73108,7,73110,73110,7,73459,73460,5,78896,78904,4,92976,92982,5,94033,94087,7,94180,94180,5,113821,113822,5,118528,118573,5,119141,119141,5,119143,119145,5,119150,119154,5,119163,119170,5,119210,119213,5,121344,121398,5,121461,121461,5,121499,121503,5,122880,122886,5,122907,122913,5,122918,122922,5,123566,123566,5,125136,125142,5,126976,126979,14,126981,127182,14,127184,127231,14,127279,127279,14,127344,127345,14,127374,127374,14,127405,127461,14,127489,127490,14,127514,127514,14,127538,127546,14,127561,127567,14,127570,127743,14,127757,127758,14,127760,127760,14,127762,127762,14,127766,127768,14,127770,127770,14,127772,127772,14,127775,127776,14,127778,127779,14,127789,127791,14,127794,127795,14,127798,127798,14,127819,127819,14,127824,127824,14,127868,127868,14,127870,127871,14,127892,127893,14,127896,127896,14,127900,127901,14,127904,127940,14,127942,127942,14,127944,127944,14,127946,127946,14,127951,127955,14,127968,127971,14,127973,127984,14,127987,127987,14,127989,127989,14,127991,127991,14,127995,127999,5,128008,128008,14,128012,128014,14,128017,128018,14,128020,128020,14,128022,128022,14,128042,128042,14,128063,128063,14,128065,128065,14,128101,128101,14,128108,128109,14,128173,128173,14,128182,128183,14,128236,128237,14,128239,128239,14,128245,128245,14,128248,128248,14,128253,128253,14,128255,128258,14,128260,128263,14,128265,128265,14,128277,128277,14,128300,128301,14,128326,128328,14,128331,128334,14,128336,128347,14,128360,128366,14,128369,128370,14,128378,128378,14,128391,128391,14,128394,128397,14,128400,128400,14,128405,128406,14,128420,128420,14,128422,128423,14,128425,128432,14,128435,128443,14,128445,128449,14,128453,128464,14,128468,128475,14,128479,128480,14,128482,128482,14,128484,128487,14,128489,128494,14,128496,128498,14,128500,128505,14,128507,128511,14,128513,128518,14,128521,128525,14,128527,128527,14,128529,128529,14,128533,128533,14,128535,128535,14,128537,128537,14]")}function CZe(i,e){if(i===0)return 0;const t=yZe(i,e);if(t!==void 0)return t;const n=new Xq(e,i);return n.prevCodePoint(),n.offset}function yZe(i,e){const t=new Xq(e,i);let n=t.prevCodePoint();for(;wZe(n)||n===65039||n===8419;){if(t.offset===0)return;n=t.prevCodePoint()}if(!Zq(n))return;let o=t.offset;return o>0&&t.prevCodePoint()===8205&&(o=t.offset),o}function wZe(i){return 127995<=i&&i<=127999}const q_e="\xA0";class Q0{static getInstance(e){return hw.cache.get(Array.from(e))}static getLocales(){return hw._locales.value}constructor(e){this.confusableDictionary=e}isAmbiguous(e){return this.confusableDictionary.has(e)}getPrimaryConfusable(e){return this.confusableDictionary.get(e)}getConfusableCodePoints(){return new Set(this.confusableDictionary.keys())}}hw=Q0;Q0.ambiguousCharacterData=new ah(()=>JSON.parse('{"_common":[8232,32,8233,32,5760,32,8192,32,8193,32,8194,32,8195,32,8196,32,8197,32,8198,32,8200,32,8201,32,8202,32,8287,32,8199,32,8239,32,2042,95,65101,95,65102,95,65103,95,8208,45,8209,45,8210,45,65112,45,1748,45,8259,45,727,45,8722,45,10134,45,11450,45,1549,44,1643,44,8218,44,184,44,42233,44,894,59,2307,58,2691,58,1417,58,1795,58,1796,58,5868,58,65072,58,6147,58,6153,58,8282,58,1475,58,760,58,42889,58,8758,58,720,58,42237,58,451,33,11601,33,660,63,577,63,2429,63,5038,63,42731,63,119149,46,8228,46,1793,46,1794,46,42510,46,68176,46,1632,46,1776,46,42232,46,1373,96,65287,96,8219,96,8242,96,1370,96,1523,96,8175,96,65344,96,900,96,8189,96,8125,96,8127,96,8190,96,697,96,884,96,712,96,714,96,715,96,756,96,699,96,701,96,700,96,702,96,42892,96,1497,96,2036,96,2037,96,5194,96,5836,96,94033,96,94034,96,65339,91,10088,40,10098,40,12308,40,64830,40,65341,93,10089,41,10099,41,12309,41,64831,41,10100,123,119060,123,10101,125,65342,94,8270,42,1645,42,8727,42,66335,42,5941,47,8257,47,8725,47,8260,47,9585,47,10187,47,10744,47,119354,47,12755,47,12339,47,11462,47,20031,47,12035,47,65340,92,65128,92,8726,92,10189,92,10741,92,10745,92,119311,92,119355,92,12756,92,20022,92,12034,92,42872,38,708,94,710,94,5869,43,10133,43,66203,43,8249,60,10094,60,706,60,119350,60,5176,60,5810,60,5120,61,11840,61,12448,61,42239,61,8250,62,10095,62,707,62,119351,62,5171,62,94015,62,8275,126,732,126,8128,126,8764,126,65372,124,65293,45,120784,50,120794,50,120804,50,120814,50,120824,50,130034,50,42842,50,423,50,1000,50,42564,50,5311,50,42735,50,119302,51,120785,51,120795,51,120805,51,120815,51,120825,51,130035,51,42923,51,540,51,439,51,42858,51,11468,51,1248,51,94011,51,71882,51,120786,52,120796,52,120806,52,120816,52,120826,52,130036,52,5070,52,71855,52,120787,53,120797,53,120807,53,120817,53,120827,53,130037,53,444,53,71867,53,120788,54,120798,54,120808,54,120818,54,120828,54,130038,54,11474,54,5102,54,71893,54,119314,55,120789,55,120799,55,120809,55,120819,55,120829,55,130039,55,66770,55,71878,55,2819,56,2538,56,2666,56,125131,56,120790,56,120800,56,120810,56,120820,56,120830,56,130040,56,547,56,546,56,66330,56,2663,57,2920,57,2541,57,3437,57,120791,57,120801,57,120811,57,120821,57,120831,57,130041,57,42862,57,11466,57,71884,57,71852,57,71894,57,9082,97,65345,97,119834,97,119886,97,119938,97,119990,97,120042,97,120094,97,120146,97,120198,97,120250,97,120302,97,120354,97,120406,97,120458,97,593,97,945,97,120514,97,120572,97,120630,97,120688,97,120746,97,65313,65,119808,65,119860,65,119912,65,119964,65,120016,65,120068,65,120120,65,120172,65,120224,65,120276,65,120328,65,120380,65,120432,65,913,65,120488,65,120546,65,120604,65,120662,65,120720,65,5034,65,5573,65,42222,65,94016,65,66208,65,119835,98,119887,98,119939,98,119991,98,120043,98,120095,98,120147,98,120199,98,120251,98,120303,98,120355,98,120407,98,120459,98,388,98,5071,98,5234,98,5551,98,65314,66,8492,66,119809,66,119861,66,119913,66,120017,66,120069,66,120121,66,120173,66,120225,66,120277,66,120329,66,120381,66,120433,66,42932,66,914,66,120489,66,120547,66,120605,66,120663,66,120721,66,5108,66,5623,66,42192,66,66178,66,66209,66,66305,66,65347,99,8573,99,119836,99,119888,99,119940,99,119992,99,120044,99,120096,99,120148,99,120200,99,120252,99,120304,99,120356,99,120408,99,120460,99,7428,99,1010,99,11429,99,43951,99,66621,99,128844,67,71922,67,71913,67,65315,67,8557,67,8450,67,8493,67,119810,67,119862,67,119914,67,119966,67,120018,67,120174,67,120226,67,120278,67,120330,67,120382,67,120434,67,1017,67,11428,67,5087,67,42202,67,66210,67,66306,67,66581,67,66844,67,8574,100,8518,100,119837,100,119889,100,119941,100,119993,100,120045,100,120097,100,120149,100,120201,100,120253,100,120305,100,120357,100,120409,100,120461,100,1281,100,5095,100,5231,100,42194,100,8558,68,8517,68,119811,68,119863,68,119915,68,119967,68,120019,68,120071,68,120123,68,120175,68,120227,68,120279,68,120331,68,120383,68,120435,68,5024,68,5598,68,5610,68,42195,68,8494,101,65349,101,8495,101,8519,101,119838,101,119890,101,119942,101,120046,101,120098,101,120150,101,120202,101,120254,101,120306,101,120358,101,120410,101,120462,101,43826,101,1213,101,8959,69,65317,69,8496,69,119812,69,119864,69,119916,69,120020,69,120072,69,120124,69,120176,69,120228,69,120280,69,120332,69,120384,69,120436,69,917,69,120492,69,120550,69,120608,69,120666,69,120724,69,11577,69,5036,69,42224,69,71846,69,71854,69,66182,69,119839,102,119891,102,119943,102,119995,102,120047,102,120099,102,120151,102,120203,102,120255,102,120307,102,120359,102,120411,102,120463,102,43829,102,42905,102,383,102,7837,102,1412,102,119315,70,8497,70,119813,70,119865,70,119917,70,120021,70,120073,70,120125,70,120177,70,120229,70,120281,70,120333,70,120385,70,120437,70,42904,70,988,70,120778,70,5556,70,42205,70,71874,70,71842,70,66183,70,66213,70,66853,70,65351,103,8458,103,119840,103,119892,103,119944,103,120048,103,120100,103,120152,103,120204,103,120256,103,120308,103,120360,103,120412,103,120464,103,609,103,7555,103,397,103,1409,103,119814,71,119866,71,119918,71,119970,71,120022,71,120074,71,120126,71,120178,71,120230,71,120282,71,120334,71,120386,71,120438,71,1292,71,5056,71,5107,71,42198,71,65352,104,8462,104,119841,104,119945,104,119997,104,120049,104,120101,104,120153,104,120205,104,120257,104,120309,104,120361,104,120413,104,120465,104,1211,104,1392,104,5058,104,65320,72,8459,72,8460,72,8461,72,119815,72,119867,72,119919,72,120023,72,120179,72,120231,72,120283,72,120335,72,120387,72,120439,72,919,72,120494,72,120552,72,120610,72,120668,72,120726,72,11406,72,5051,72,5500,72,42215,72,66255,72,731,105,9075,105,65353,105,8560,105,8505,105,8520,105,119842,105,119894,105,119946,105,119998,105,120050,105,120102,105,120154,105,120206,105,120258,105,120310,105,120362,105,120414,105,120466,105,120484,105,618,105,617,105,953,105,8126,105,890,105,120522,105,120580,105,120638,105,120696,105,120754,105,1110,105,42567,105,1231,105,43893,105,5029,105,71875,105,65354,106,8521,106,119843,106,119895,106,119947,106,119999,106,120051,106,120103,106,120155,106,120207,106,120259,106,120311,106,120363,106,120415,106,120467,106,1011,106,1112,106,65322,74,119817,74,119869,74,119921,74,119973,74,120025,74,120077,74,120129,74,120181,74,120233,74,120285,74,120337,74,120389,74,120441,74,42930,74,895,74,1032,74,5035,74,5261,74,42201,74,119844,107,119896,107,119948,107,120000,107,120052,107,120104,107,120156,107,120208,107,120260,107,120312,107,120364,107,120416,107,120468,107,8490,75,65323,75,119818,75,119870,75,119922,75,119974,75,120026,75,120078,75,120130,75,120182,75,120234,75,120286,75,120338,75,120390,75,120442,75,922,75,120497,75,120555,75,120613,75,120671,75,120729,75,11412,75,5094,75,5845,75,42199,75,66840,75,1472,108,8739,73,9213,73,65512,73,1633,108,1777,73,66336,108,125127,108,120783,73,120793,73,120803,73,120813,73,120823,73,130033,73,65321,73,8544,73,8464,73,8465,73,119816,73,119868,73,119920,73,120024,73,120128,73,120180,73,120232,73,120284,73,120336,73,120388,73,120440,73,65356,108,8572,73,8467,108,119845,108,119897,108,119949,108,120001,108,120053,108,120105,73,120157,73,120209,73,120261,73,120313,73,120365,73,120417,73,120469,73,448,73,120496,73,120554,73,120612,73,120670,73,120728,73,11410,73,1030,73,1216,73,1493,108,1503,108,1575,108,126464,108,126592,108,65166,108,65165,108,1994,108,11599,73,5825,73,42226,73,93992,73,66186,124,66313,124,119338,76,8556,76,8466,76,119819,76,119871,76,119923,76,120027,76,120079,76,120131,76,120183,76,120235,76,120287,76,120339,76,120391,76,120443,76,11472,76,5086,76,5290,76,42209,76,93974,76,71843,76,71858,76,66587,76,66854,76,65325,77,8559,77,8499,77,119820,77,119872,77,119924,77,120028,77,120080,77,120132,77,120184,77,120236,77,120288,77,120340,77,120392,77,120444,77,924,77,120499,77,120557,77,120615,77,120673,77,120731,77,1018,77,11416,77,5047,77,5616,77,5846,77,42207,77,66224,77,66321,77,119847,110,119899,110,119951,110,120003,110,120055,110,120107,110,120159,110,120211,110,120263,110,120315,110,120367,110,120419,110,120471,110,1400,110,1404,110,65326,78,8469,78,119821,78,119873,78,119925,78,119977,78,120029,78,120081,78,120185,78,120237,78,120289,78,120341,78,120393,78,120445,78,925,78,120500,78,120558,78,120616,78,120674,78,120732,78,11418,78,42208,78,66835,78,3074,111,3202,111,3330,111,3458,111,2406,111,2662,111,2790,111,3046,111,3174,111,3302,111,3430,111,3664,111,3792,111,4160,111,1637,111,1781,111,65359,111,8500,111,119848,111,119900,111,119952,111,120056,111,120108,111,120160,111,120212,111,120264,111,120316,111,120368,111,120420,111,120472,111,7439,111,7441,111,43837,111,959,111,120528,111,120586,111,120644,111,120702,111,120760,111,963,111,120532,111,120590,111,120648,111,120706,111,120764,111,11423,111,4351,111,1413,111,1505,111,1607,111,126500,111,126564,111,126596,111,65259,111,65260,111,65258,111,65257,111,1726,111,64428,111,64429,111,64427,111,64426,111,1729,111,64424,111,64425,111,64423,111,64422,111,1749,111,3360,111,4125,111,66794,111,71880,111,71895,111,66604,111,1984,79,2534,79,2918,79,12295,79,70864,79,71904,79,120782,79,120792,79,120802,79,120812,79,120822,79,130032,79,65327,79,119822,79,119874,79,119926,79,119978,79,120030,79,120082,79,120134,79,120186,79,120238,79,120290,79,120342,79,120394,79,120446,79,927,79,120502,79,120560,79,120618,79,120676,79,120734,79,11422,79,1365,79,11604,79,4816,79,2848,79,66754,79,42227,79,71861,79,66194,79,66219,79,66564,79,66838,79,9076,112,65360,112,119849,112,119901,112,119953,112,120005,112,120057,112,120109,112,120161,112,120213,112,120265,112,120317,112,120369,112,120421,112,120473,112,961,112,120530,112,120544,112,120588,112,120602,112,120646,112,120660,112,120704,112,120718,112,120762,112,120776,112,11427,112,65328,80,8473,80,119823,80,119875,80,119927,80,119979,80,120031,80,120083,80,120187,80,120239,80,120291,80,120343,80,120395,80,120447,80,929,80,120504,80,120562,80,120620,80,120678,80,120736,80,11426,80,5090,80,5229,80,42193,80,66197,80,119850,113,119902,113,119954,113,120006,113,120058,113,120110,113,120162,113,120214,113,120266,113,120318,113,120370,113,120422,113,120474,113,1307,113,1379,113,1382,113,8474,81,119824,81,119876,81,119928,81,119980,81,120032,81,120084,81,120188,81,120240,81,120292,81,120344,81,120396,81,120448,81,11605,81,119851,114,119903,114,119955,114,120007,114,120059,114,120111,114,120163,114,120215,114,120267,114,120319,114,120371,114,120423,114,120475,114,43847,114,43848,114,7462,114,11397,114,43905,114,119318,82,8475,82,8476,82,8477,82,119825,82,119877,82,119929,82,120033,82,120189,82,120241,82,120293,82,120345,82,120397,82,120449,82,422,82,5025,82,5074,82,66740,82,5511,82,42211,82,94005,82,65363,115,119852,115,119904,115,119956,115,120008,115,120060,115,120112,115,120164,115,120216,115,120268,115,120320,115,120372,115,120424,115,120476,115,42801,115,445,115,1109,115,43946,115,71873,115,66632,115,65331,83,119826,83,119878,83,119930,83,119982,83,120034,83,120086,83,120138,83,120190,83,120242,83,120294,83,120346,83,120398,83,120450,83,1029,83,1359,83,5077,83,5082,83,42210,83,94010,83,66198,83,66592,83,119853,116,119905,116,119957,116,120009,116,120061,116,120113,116,120165,116,120217,116,120269,116,120321,116,120373,116,120425,116,120477,116,8868,84,10201,84,128872,84,65332,84,119827,84,119879,84,119931,84,119983,84,120035,84,120087,84,120139,84,120191,84,120243,84,120295,84,120347,84,120399,84,120451,84,932,84,120507,84,120565,84,120623,84,120681,84,120739,84,11430,84,5026,84,42196,84,93962,84,71868,84,66199,84,66225,84,66325,84,119854,117,119906,117,119958,117,120010,117,120062,117,120114,117,120166,117,120218,117,120270,117,120322,117,120374,117,120426,117,120478,117,42911,117,7452,117,43854,117,43858,117,651,117,965,117,120534,117,120592,117,120650,117,120708,117,120766,117,1405,117,66806,117,71896,117,8746,85,8899,85,119828,85,119880,85,119932,85,119984,85,120036,85,120088,85,120140,85,120192,85,120244,85,120296,85,120348,85,120400,85,120452,85,1357,85,4608,85,66766,85,5196,85,42228,85,94018,85,71864,85,8744,118,8897,118,65366,118,8564,118,119855,118,119907,118,119959,118,120011,118,120063,118,120115,118,120167,118,120219,118,120271,118,120323,118,120375,118,120427,118,120479,118,7456,118,957,118,120526,118,120584,118,120642,118,120700,118,120758,118,1141,118,1496,118,71430,118,43945,118,71872,118,119309,86,1639,86,1783,86,8548,86,119829,86,119881,86,119933,86,119985,86,120037,86,120089,86,120141,86,120193,86,120245,86,120297,86,120349,86,120401,86,120453,86,1140,86,11576,86,5081,86,5167,86,42719,86,42214,86,93960,86,71840,86,66845,86,623,119,119856,119,119908,119,119960,119,120012,119,120064,119,120116,119,120168,119,120220,119,120272,119,120324,119,120376,119,120428,119,120480,119,7457,119,1121,119,1309,119,1377,119,71434,119,71438,119,71439,119,43907,119,71919,87,71910,87,119830,87,119882,87,119934,87,119986,87,120038,87,120090,87,120142,87,120194,87,120246,87,120298,87,120350,87,120402,87,120454,87,1308,87,5043,87,5076,87,42218,87,5742,120,10539,120,10540,120,10799,120,65368,120,8569,120,119857,120,119909,120,119961,120,120013,120,120065,120,120117,120,120169,120,120221,120,120273,120,120325,120,120377,120,120429,120,120481,120,5441,120,5501,120,5741,88,9587,88,66338,88,71916,88,65336,88,8553,88,119831,88,119883,88,119935,88,119987,88,120039,88,120091,88,120143,88,120195,88,120247,88,120299,88,120351,88,120403,88,120455,88,42931,88,935,88,120510,88,120568,88,120626,88,120684,88,120742,88,11436,88,11613,88,5815,88,42219,88,66192,88,66228,88,66327,88,66855,88,611,121,7564,121,65369,121,119858,121,119910,121,119962,121,120014,121,120066,121,120118,121,120170,121,120222,121,120274,121,120326,121,120378,121,120430,121,120482,121,655,121,7935,121,43866,121,947,121,8509,121,120516,121,120574,121,120632,121,120690,121,120748,121,1199,121,4327,121,71900,121,65337,89,119832,89,119884,89,119936,89,119988,89,120040,89,120092,89,120144,89,120196,89,120248,89,120300,89,120352,89,120404,89,120456,89,933,89,978,89,120508,89,120566,89,120624,89,120682,89,120740,89,11432,89,1198,89,5033,89,5053,89,42220,89,94019,89,71844,89,66226,89,119859,122,119911,122,119963,122,120015,122,120067,122,120119,122,120171,122,120223,122,120275,122,120327,122,120379,122,120431,122,120483,122,7458,122,43923,122,71876,122,66293,90,71909,90,65338,90,8484,90,8488,90,119833,90,119885,90,119937,90,119989,90,120041,90,120197,90,120249,90,120301,90,120353,90,120405,90,120457,90,918,90,120493,90,120551,90,120609,90,120667,90,120725,90,5059,90,42204,90,71849,90,65282,34,65284,36,65285,37,65286,38,65290,42,65291,43,65294,46,65295,47,65296,48,65297,49,65298,50,65299,51,65300,52,65301,53,65302,54,65303,55,65304,56,65305,57,65308,60,65309,61,65310,62,65312,64,65316,68,65318,70,65319,71,65324,76,65329,81,65330,82,65333,85,65334,86,65335,87,65343,95,65346,98,65348,100,65350,102,65355,107,65357,109,65358,110,65361,113,65362,114,65364,116,65365,117,65367,119,65370,122,65371,123,65373,125,119846,109],"_default":[160,32,8211,45,65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"cs":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"de":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"es":[8211,45,65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"fr":[65374,126,65306,58,65281,33,8216,96,8245,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"it":[160,32,8211,45,65374,126,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"ja":[8211,45,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65292,44,65307,59],"ko":[8211,45,65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"pl":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"pt-BR":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"qps-ploc":[160,32,8211,45,65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"ru":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,305,105,921,73,1009,112,215,120,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"tr":[160,32,8211,45,65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"zh-hans":[65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41],"zh-hant":[8211,45,65374,126,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65307,59]}'));Q0.cache=new aZe(i=>{function e(c){const u=new Map;for(let d=0;d!c.startsWith("_")&&c in o);r.length===0&&(r=["_default"]);let s;for(const c of r){const u=e(o[c]);s=n(s,u)}const a=e(o._common),l=t(a,s);return new hw(l)});Q0._locales=new ah(()=>Object.keys(hw.ambiguousCharacterData.value).filter(i=>!i.startsWith("_")));class cf{static getRawData(){return JSON.parse("[9,10,11,12,13,32,127,160,173,847,1564,4447,4448,6068,6069,6155,6156,6157,6158,7355,7356,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8203,8204,8205,8206,8207,8234,8235,8236,8237,8238,8239,8287,8288,8289,8290,8291,8292,8293,8294,8295,8296,8297,8298,8299,8300,8301,8302,8303,10240,12288,12644,65024,65025,65026,65027,65028,65029,65030,65031,65032,65033,65034,65035,65036,65037,65038,65039,65279,65440,65520,65521,65522,65523,65524,65525,65526,65527,65528,65532,78844,119155,119156,119157,119158,119159,119160,119161,119162,917504,917505,917506,917507,917508,917509,917510,917511,917512,917513,917514,917515,917516,917517,917518,917519,917520,917521,917522,917523,917524,917525,917526,917527,917528,917529,917530,917531,917532,917533,917534,917535,917536,917537,917538,917539,917540,917541,917542,917543,917544,917545,917546,917547,917548,917549,917550,917551,917552,917553,917554,917555,917556,917557,917558,917559,917560,917561,917562,917563,917564,917565,917566,917567,917568,917569,917570,917571,917572,917573,917574,917575,917576,917577,917578,917579,917580,917581,917582,917583,917584,917585,917586,917587,917588,917589,917590,917591,917592,917593,917594,917595,917596,917597,917598,917599,917600,917601,917602,917603,917604,917605,917606,917607,917608,917609,917610,917611,917612,917613,917614,917615,917616,917617,917618,917619,917620,917621,917622,917623,917624,917625,917626,917627,917628,917629,917630,917631,917760,917761,917762,917763,917764,917765,917766,917767,917768,917769,917770,917771,917772,917773,917774,917775,917776,917777,917778,917779,917780,917781,917782,917783,917784,917785,917786,917787,917788,917789,917790,917791,917792,917793,917794,917795,917796,917797,917798,917799,917800,917801,917802,917803,917804,917805,917806,917807,917808,917809,917810,917811,917812,917813,917814,917815,917816,917817,917818,917819,917820,917821,917822,917823,917824,917825,917826,917827,917828,917829,917830,917831,917832,917833,917834,917835,917836,917837,917838,917839,917840,917841,917842,917843,917844,917845,917846,917847,917848,917849,917850,917851,917852,917853,917854,917855,917856,917857,917858,917859,917860,917861,917862,917863,917864,917865,917866,917867,917868,917869,917870,917871,917872,917873,917874,917875,917876,917877,917878,917879,917880,917881,917882,917883,917884,917885,917886,917887,917888,917889,917890,917891,917892,917893,917894,917895,917896,917897,917898,917899,917900,917901,917902,917903,917904,917905,917906,917907,917908,917909,917910,917911,917912,917913,917914,917915,917916,917917,917918,917919,917920,917921,917922,917923,917924,917925,917926,917927,917928,917929,917930,917931,917932,917933,917934,917935,917936,917937,917938,917939,917940,917941,917942,917943,917944,917945,917946,917947,917948,917949,917950,917951,917952,917953,917954,917955,917956,917957,917958,917959,917960,917961,917962,917963,917964,917965,917966,917967,917968,917969,917970,917971,917972,917973,917974,917975,917976,917977,917978,917979,917980,917981,917982,917983,917984,917985,917986,917987,917988,917989,917990,917991,917992,917993,917994,917995,917996,917997,917998,917999]")}static getData(){return this._data||(this._data=new Set(cf.getRawData())),this._data}static isInvisibleCharacter(e){return cf.getData().has(e)}static get codePoints(){return cf.getData()}}cf._data=void 0;class VV{constructor(){this._zoomFactor=1}getZoomFactor(){return this._zoomFactor}}VV.INSTANCE=new VV;class SZe extends _e{constructor(){super(),this._onDidChange=this._register(new le),this.onDidChange=this._onDidChange.event,this._listener=()=>this._handleChange(!0),this._mediaQueryList=null,this._handleChange(!1)}_handleChange(e){var t;(t=this._mediaQueryList)===null||t===void 0||t.removeEventListener("change",this._listener),this._mediaQueryList=window.matchMedia(`(resolution: ${window.devicePixelRatio}dppx)`),this._mediaQueryList.addEventListener("change",this._listener),e&&this._onDidChange.fire()}}class xZe extends _e{get value(){return this._value}constructor(){super(),this._onDidChange=this._register(new le),this.onDidChange=this._onDidChange.event,this._value=this._getPixelRatio();const e=this._register(new SZe);this._register(e.onDidChange(()=>{this._value=this._getPixelRatio(),this._onDidChange.fire(this._value)}))}_getPixelRatio(){const e=document.createElement("canvas").getContext("2d"),t=window.devicePixelRatio||1,n=e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1;return t/n}}class LZe{constructor(){this._pixelRatioMonitor=null}_getOrCreatePixelRatioMonitor(){return this._pixelRatioMonitor||(this._pixelRatioMonitor=new xZe),this._pixelRatioMonitor}get value(){return this._getOrCreatePixelRatioMonitor().value}get onDidChange(){return this._getOrCreatePixelRatioMonitor().onDidChange}}function G_e(i,e){typeof i=="string"&&(i=window.matchMedia(i)),i.addEventListener("change",e)}const MD=new LZe;function EZe(){return VV.INSTANCE.getZoomFactor()}const pS=navigator.userAgent,Fc=pS.indexOf("Firefox")>=0,L0=pS.indexOf("AppleWebKit")>=0,Jq=pS.indexOf("Chrome")>=0,ap=!Jq&&pS.indexOf("Safari")>=0,X_e=!Jq&&!ap&&L0;pS.indexOf("Electron/")>=0;const goe=pS.indexOf("Android")>=0;let JR=!1;if(window.matchMedia){const i=window.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),e=window.matchMedia("(display-mode: fullscreen)");JR=i.matches,G_e(i,({matches:t})=>{JR&&e.matches||(JR=t)})}function DZe(){return JR}class Y_e{constructor(e){this.domNode=e,this._maxWidth="",this._width="",this._height="",this._top="",this._left="",this._bottom="",this._right="",this._paddingLeft="",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=nd(e);this._maxWidth!==t&&(this._maxWidth=t,this.domNode.style.maxWidth=this._maxWidth)}setWidth(e){const t=nd(e);this._width!==t&&(this._width=t,this.domNode.style.width=this._width)}setHeight(e){const t=nd(e);this._height!==t&&(this._height=t,this.domNode.style.height=this._height)}setTop(e){const t=nd(e);this._top!==t&&(this._top=t,this.domNode.style.top=this._top)}setLeft(e){const t=nd(e);this._left!==t&&(this._left=t,this.domNode.style.left=this._left)}setBottom(e){const t=nd(e);this._bottom!==t&&(this._bottom=t,this.domNode.style.bottom=this._bottom)}setRight(e){const t=nd(e);this._right!==t&&(this._right=t,this.domNode.style.right=this._right)}setPaddingLeft(e){const t=nd(e);this._paddingLeft!==t&&(this._paddingLeft=t,this.domNode.style.paddingLeft=this._paddingLeft)}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=nd(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=nd(e);this._lineHeight!==t&&(this._lineHeight=t,this.domNode.style.lineHeight=this._lineHeight)}setLetterSpacing(e){const t=nd(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 nd(i){return typeof i=="number"?`${i}px`:i}function ti(i){return new Y_e(i)}function ss(i,e){i instanceof Y_e?(i.setFontFamily(e.getMassagedFontFamily()),i.setFontWeight(e.fontWeight),i.setFontSize(e.fontSize),i.setFontFeatureSettings(e.fontFeatureSettings),i.setFontVariationSettings(e.fontVariationSettings),i.setLineHeight(e.lineHeight),i.setLetterSpacing(e.letterSpacing)):(i.style.fontFamily=e.getMassagedFontFamily(),i.style.fontWeight=e.fontWeight,i.style.fontSize=e.fontSize+"px",i.style.fontFeatureSettings=e.fontFeatureSettings,i.style.fontVariationSettings=e.fontVariationSettings,i.style.lineHeight=e.lineHeight+"px",i.style.letterSpacing=e.letterSpacing+"px")}class kZe{constructor(e,t){this.chr=e,this.type=t,this.width=0}fulfill(e){this.width=e}}class eG{constructor(e,t){this._bareFontInfo=e,this._requests=t,this._container=null,this._testElements=null}read(){this._createDomElements(),document.body.appendChild(this._container),this._readFromDomElements(),document.body.removeChild(this._container),this._container=null,this._testElements=null}_createDomElements(){const e=document.createElement("div");e.style.position="absolute",e.style.top="-50000px",e.style.width="50000px";const t=document.createElement("div");ss(t,this._bareFontInfo),e.appendChild(t);const n=document.createElement("div");ss(n,this._bareFontInfo),n.style.fontWeight="bold",e.appendChild(n);const o=document.createElement("div");ss(o,this._bareFontInfo),o.style.fontStyle="italic",e.appendChild(o);const r=[];for(const s of this._requests){let a;s.type===0&&(a=t),s.type===2&&(a=n),s.type===1&&(a=o),a.appendChild(document.createElement("br"));const l=document.createElement("span");eG._render(l,s),a.appendChild(l),r.push(l)}this._container=e,this._testElements=r}static _render(e,t){if(t.chr===" "){let n="\xA0";for(let o=0;o<8;o++)n+=n;e.innerText=n}else{let n=t.chr;for(let o=0;o<8;o++)n+=n;e.textContent=n}}_readFromDomElements(){for(let e=0,t=this._requests.length;e{this._evictUntrustedReadingsTimeout=-1,this._evictUntrustedReadings()},5e3))}_evictUntrustedReadings(){const e=this._cache.getValues();let t=!1;for(const n of e)n.isTrusted||(t=!0,this._cache.remove(n));t&&this._onDidChange.fire()}readFontInfo(e){if(!this._cache.has(e)){let t=this._actualReadFontInfo(e);(t.typicalHalfwidthCharacterWidth<=2||t.typicalFullwidthCharacterWidth<=2||t.spaceWidth<=2||t.maxDigitWidth<=2)&&(t=new HV({pixelRatio:MD.value,fontFamily:t.fontFamily,fontWeight:t.fontWeight,fontSize:t.fontSize,fontFeatureSettings:t.fontFeatureSettings,fontVariationSettings:t.fontVariationSettings,lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,isMonospace:t.isMonospace,typicalHalfwidthCharacterWidth:Math.max(t.typicalHalfwidthCharacterWidth,5),typicalFullwidthCharacterWidth:Math.max(t.typicalFullwidthCharacterWidth,5),canUseHalfwidthRightwardsArrow:t.canUseHalfwidthRightwardsArrow,spaceWidth:Math.max(t.spaceWidth,5),middotWidth:Math.max(t.middotWidth,5),wsmiddotWidth:Math.max(t.wsmiddotWidth,5),maxDigitWidth:Math.max(t.maxDigitWidth,5)},!1)),this._writeToCache(e,t)}return this._cache.get(e)}_createRequest(e,t,n,o){const r=new kZe(e,t);return n.push(r),o==null||o.push(r),r}_actualReadFontInfo(e){const t=[],n=[],o=this._createRequest("n",0,t,n),r=this._createRequest("\uFF4D",0,t,null),s=this._createRequest(" ",0,t,n),a=this._createRequest("0",0,t,n),l=this._createRequest("1",0,t,n),c=this._createRequest("2",0,t,n),u=this._createRequest("3",0,t,n),d=this._createRequest("4",0,t,n),h=this._createRequest("5",0,t,n),f=this._createRequest("6",0,t,n),g=this._createRequest("7",0,t,n),p=this._createRequest("8",0,t,n),v=this._createRequest("9",0,t,n),m=this._createRequest("\u2192",0,t,n),_=this._createRequest("\uFFEB",0,t,null),y=this._createRequest("\xB7",0,t,n),w=this._createRequest(String.fromCharCode(11825),0,t,null),L="|/-_ilm%";for(let R=0,A=L.length;R.001){E=!1;break}}let k=!0;return E&&_.width!==I&&(k=!1),_.width>m.width&&(k=!1),new HV({pixelRatio:MD.value,fontFamily:e.fontFamily,fontWeight:e.fontWeight,fontSize:e.fontSize,fontFeatureSettings:e.fontFeatureSettings,fontVariationSettings:e.fontVariationSettings,lineHeight:e.lineHeight,letterSpacing:e.letterSpacing,isMonospace:E,typicalHalfwidthCharacterWidth:o.width,typicalFullwidthCharacterWidth:r.width,canUseHalfwidthRightwardsArrow:k,spaceWidth:s.width,middotWidth:y.width,wsmiddotWidth:w.width,maxDigitWidth:D},!0)}}class poe{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 n=e.getId();this._keys[n]=e,this._values[n]=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 $V=new RZe;var Td;(function(i){i.serviceIds=new Map,i.DI_TARGET="$di$target",i.DI_DEPENDENCIES="$di$dependencies";function e(t){return t[i.DI_DEPENDENCIES]||[]}i.getServiceDependencies=e})(Td||(Td={}));const $t=yn("instantiationService");function MZe(i,e,t){e[Td.DI_TARGET]===e?e[Td.DI_DEPENDENCIES].push({id:i,index:t}):(e[Td.DI_DEPENDENCIES]=[{id:i,index:t}],e[Td.DI_TARGET]=e)}function yn(i){if(Td.serviceIds.has(i))return Td.serviceIds.get(i);const e=function(t,n,o){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");MZe(e,t,o)};return e.toString=()=>i,Td.serviceIds.set(i,e),e}const Jn=yn("codeEditorService"),Yi=yn("modelService"),za=yn("textModelService");var gw=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};class ca extends _e{constructor(e,t="",n="",o=!0,r){super(),this._onDidChange=this._register(new le),this.onDidChange=this._onDidChange.event,this._enabled=!0,this._id=e,this._label=t,this._cssClass=n,this._enabled=o,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}))}run(e,t){return gw(this,void 0,void 0,function*(){this._actionCallback&&(yield this._actionCallback(e))})}}class pw extends _e{constructor(){super(...arguments),this._onWillRun=this._register(new le),this.onWillRun=this._onWillRun.event,this._onDidRun=this._register(new le),this.onDidRun=this._onDidRun.event}run(e,t){return gw(this,void 0,void 0,function*(){if(!e.enabled)return;this._onWillRun.fire({action:e});let n;try{yield this.runAction(e,t)}catch(o){n=o}this._onDidRun.fire({action:e,error:n})})}runAction(e,t){return gw(this,void 0,void 0,function*(){yield e.run(t)})}}class kr{constructor(){this.id=kr.ID,this.label="",this.tooltip="",this.class="separator",this.enabled=!1,this.checked=!1}static join(...e){let t=[];for(const n of e)n.length&&(t.length?t=[...t,new kr,...n]:t=n);return t}run(){return gw(this,void 0,void 0,function*(){})}}kr.ID="vs.actions.separator";class mw{get actions(){return this._actions}constructor(e,t,n,o){this.tooltip="",this.enabled=!0,this.checked=void 0,this.id=e,this.label=t,this.class=o,this._actions=n}run(){return gw(this,void 0,void 0,function*(){})}}class $4 extends ca{constructor(){super($4.ID,C("submenu.empty","(empty)"),void 0,!1)}}$4.ID="vs.actions.empty";function my(i){var e,t;return{id:i.id,label:i.label,class:void 0,enabled:(e=i.enabled)!==null&&e!==void 0?e:!0,checked:(t=i.checked)!==null&&t!==void 0?t:!1,run:(...n)=>gw(this,void 0,void 0,function*(){return i.run(...n)}),tooltip:i.label}}var zV;(function(i){function e(t){return t&&typeof t=="object"&&typeof t.id=="string"}i.isThemeColor=e})(zV||(zV={}));var Mt;(function(i){i.iconNameSegment="[A-Za-z0-9]+",i.iconNameExpression="[A-Za-z0-9-]+",i.iconModifierExpression="~[A-Za-z]+",i.iconNameCharacter="[A-Za-z0-9~-]";const e=new RegExp(`^(${i.iconNameExpression})(${i.iconModifierExpression})?$`);function t(h){const f=e.exec(h.id);if(!f)return t(Xe.error);const[,g,p]=f,v=["codicon","codicon-"+g];return p&&v.push("codicon-modifier-"+p.substring(1)),v}i.asClassNameArray=t;function n(h){return t(h).join(" ")}i.asClassName=n;function o(h){return"."+t(h).join(".")}i.asCSSSelector=o;function r(h){return h&&typeof h=="object"&&typeof h.id=="string"&&(typeof h.color=="undefined"||zV.isThemeColor(h.color))}i.isThemeIcon=r;const s=new RegExp(`^\\$\\((${i.iconNameExpression}(?:${i.iconModifierExpression})?)\\)$`);function a(h){const f=s.exec(h);if(!f)return;const[,g]=f;return{id:g}}i.fromString=a;function l(h){return{id:h}}i.fromId=l;function c(h,f){let g=h.id;const p=g.lastIndexOf("~");return p!==-1&&(g=g.substring(0,p)),f&&(g=`${g}~${f}`),{id:g}}i.modify=c;function u(h){const f=h.id.lastIndexOf("~");if(f!==-1)return h.id.substring(f+1)}i.getModifier=u;function d(h,f){var g,p;return h.id===f.id&&((g=h.color)===null||g===void 0?void 0:g.id)===((p=f.color)===null||p===void 0?void 0:p.id)}i.isEqual=d})(Mt||(Mt={}));const _o=yn("commandService"),Rn=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new le,this.onDidRegisterCommand=this._onDidRegisterCommand.event}registerCommand(i,e){if(!i)throw new Error("invalid command");if(typeof i=="string"){if(!e)throw new Error("invalid command");return this.registerCommand({id:i,handler:e})}if(i.description){const s=[];for(const l of i.description.args)s.push(l.constraint);const a=i.handler;i.handler=function(l,...c){return pXe(c,s),a(l,...c)}}const{id:t}=i;let n=this._commands.get(t);n||(n=new oa,this._commands.set(t,n));const o=n.unshift(i),r=zt(()=>{o();const s=this._commands.get(t);s!=null&&s.isEmpty()&&this._commands.delete(t)});return this._onDidRegisterCommand.fire(t),r}registerCommandAlias(i,e){return Rn.registerCommand(i,(t,...n)=>t.get(_o).executeCommand(e,...n))}getCommand(i){const e=this._commands.get(i);if(!(!e||e.isEmpty()))return vn.first(e)}getCommands(){const i=new Map;for(const e of this._commands.keys()){const t=this.getCommand(e);t&&i.set(e,t)}return i}};Rn.registerCommand("noop",()=>{});function N6(...i){switch(i.length){case 1:return C("contextkey.scanner.hint.didYouMean1","Did you mean {0}?",i[0]);case 2:return C("contextkey.scanner.hint.didYouMean2","Did you mean {0} or {1}?",i[0],i[1]);case 3:return C("contextkey.scanner.hint.didYouMean3","Did you mean {0}, {1} or {2}?",i[0],i[1],i[2]);default:return}}const AZe=C("contextkey.scanner.hint.didYouForgetToOpenOrCloseQuote","Did you forget to open or close the quote?"),PZe=C("contextkey.scanner.hint.didYouForgetToEscapeSlash","Did you forget to escape the '/' (slash) character? Put two backslashes before it to escape, e.g., '\\\\/'.");class Mh{constructor(){this._input="",this._start=0,this._current=0,this._tokens=[],this._errors=[],this.stringRe=/[a-zA-Z0-9_<>\-\./\\:\*\?\+\[\]\^,#@;"%\$\p{L}-]+/uy}static getLexeme(e){switch(e.type){case 0:return"(";case 1:return")";case 2:return"!";case 3:return e.isTripleEq?"===":"==";case 4:return e.isTripleEq?"!==":"!=";case 5:return"<";case 6:return"<=";case 7:return">=";case 8:return">=";case 9:return"=~";case 10:return e.lexeme;case 11:return"true";case 12:return"false";case 13:return"in";case 14:return"not";case 15:return"&&";case 16:return"||";case 17:return e.lexeme;case 18:return e.lexeme;case 19:return e.lexeme;case 20:return"EOF";default:throw Bq(`unhandled token type: ${JSON.stringify(e)}; have you forgotten to add a case?`)}}reset(e){return this._input=e,this._start=0,this._current=0,this._tokens=[],this._errors=[],this}scan(){for(;!this._isAtEnd();)switch(this._start=this._current,this._advance()){case 40:this._addToken(0);break;case 41:this._addToken(1);break;case 33:if(this._match(61)){const t=this._match(61);this._tokens.push({type:4,offset:this._start,isTripleEq:t})}else this._addToken(2);break;case 39:this._quotedString();break;case 47:this._regex();break;case 61:if(this._match(61)){const t=this._match(61);this._tokens.push({type:3,offset:this._start,isTripleEq:t})}else this._match(126)?this._addToken(9):this._error(N6("==","=~"));break;case 60:this._addToken(this._match(61)?6:5);break;case 62:this._addToken(this._match(61)?8:7);break;case 38:this._match(38)?this._addToken(15):this._error(N6("&&"));break;case 124:this._match(124)?this._addToken(16):this._error(N6("||"));break;case 32:case 13:case 9:case 10:case 160:break;default:this._string()}return this._start=this._current,this._addToken(20),Array.from(this._tokens)}_match(e){return this._isAtEnd()||this._input.charCodeAt(this._current)!==e?!1:(this._current++,!0)}_advance(){return this._input.charCodeAt(this._current++)}_peek(){return this._isAtEnd()?0:this._input.charCodeAt(this._current)}_addToken(e){this._tokens.push({type:e,offset:this._start})}_error(e){const t=this._start,n=this._input.substring(this._start,this._current),o={type:19,offset:this._start,lexeme:n};this._errors.push({offset:t,lexeme:n,additionalInfo:e}),this._tokens.push(o)}_string(){this.stringRe.lastIndex=this._start;const e=this.stringRe.exec(this._input);if(e){this._current=this._start+e[0].length;const t=this._input.substring(this._start,this._current),n=Mh._keywords.get(t);n?this._addToken(n):this._tokens.push({type:17,lexeme:t,offset:this._start})}}_quotedString(){for(;this._peek()!==39&&!this._isAtEnd();)this._advance();if(this._isAtEnd()){this._error(AZe);return}this._advance(),this._tokens.push({type:18,lexeme:this._input.substring(this._start+1,this._current-1),offset:this._start+1})}_regex(){let e=this._current,t=!1,n=!1;for(;;){if(e>=this._input.length){this._current=e,this._error(PZe);return}const r=this._input.charCodeAt(e);if(t)t=!1;else if(r===47&&!n){e++;break}else r===91?n=!0:r===92?t=!0:r===93&&(n=!1);e++}for(;e=this._input.length}}Mh._regexFlags=new Set(["i","g","s","m","y","u"].map(i=>i.charCodeAt(0)));Mh._keywords=new Map([["not",14],["in",13],["false",12],["true",11]]);const Es=new Map;Es.set("false",!1);Es.set("true",!0);Es.set("isMac",Nn);Es.set("isLinux",xs);Es.set("isWindows",ls);Es.set("isWeb",qv);Es.set("isMacNative",Nn&&!qv);Es.set("isEdge",NXe);Es.set("isFirefox",IXe);Es.set("isChrome",__e);Es.set("isSafari",TXe);const OZe=Object.prototype.hasOwnProperty,FZe={regexParsingWithErrorRecovery:!0},BZe=C("contextkey.parser.error.emptyString","Empty context key expression"),WZe=C("contextkey.parser.error.emptyString.hint","Did you forget to write an expression? You can also put 'false' or 'true' to always evaluate to false or true, respectively."),VZe=C("contextkey.parser.error.noInAfterNot","'in' after 'not'."),moe=C("contextkey.parser.error.closingParenthesis","closing parenthesis ')'"),HZe=C("contextkey.parser.error.unexpectedToken","Unexpected token"),$Ze=C("contextkey.parser.error.unexpectedToken.hint","Did you forget to put && or || before the token?"),zZe=C("contextkey.parser.error.unexpectedEOF","Unexpected end of expression"),UZe=C("contextkey.parser.error.unexpectedEOF.hint","Did you forget to put a context key?");class l0{constructor(e=FZe){this._config=e,this._scanner=new Mh,this._tokens=[],this._current=0,this._parsingErrors=[],this._flagsGYRe=/g|y/g}parse(e){if(e===""){this._parsingErrors.push({message:BZe,offset:0,lexeme:"",additionalInfo:WZe});return}this._tokens=this._scanner.reset(e).scan(),this._current=0,this._parsingErrors=[];try{const t=this._expr();if(!this._isAtEnd()){const n=this._peek(),o=n.type===17?$Ze:void 0;throw this._parsingErrors.push({message:HZe,offset:n.offset,lexeme:Mh.getLexeme(n),additionalInfo:o}),l0._parseError}return t}catch(t){if(t!==l0._parseError)throw t;return}}_expr(){return this._or()}_or(){const e=[this._and()];for(;this._matchOne(16);){const t=this._and();e.push(t)}return e.length===1?e[0]:Me.or(...e)}_and(){const e=[this._term()];for(;this._matchOne(15);){const t=this._term();e.push(t)}return e.length===1?e[0]:Me.and(...e)}_term(){if(this._matchOne(2)){const e=this._peek();switch(e.type){case 11:return this._advance(),da.INSTANCE;case 12:return this._advance(),Wa.INSTANCE;case 0:{this._advance();const t=this._expr();return this._consume(1,moe),t==null?void 0:t.negate()}case 17:return this._advance(),Bb.create(e.lexeme);default:throw this._errExpectedButGot("KEY | true | false | '(' expression ')'",e)}}return this._primary()}_primary(){const e=this._peek();switch(e.type){case 11:return this._advance(),Me.true();case 12:return this._advance(),Me.false();case 0:{this._advance();const t=this._expr();return this._consume(1,moe),t}case 17:{const t=e.lexeme;if(this._advance(),this._matchOne(9)){const o=this._peek();if(!this._config.regexParsingWithErrorRecovery){if(this._advance(),o.type!==10)throw this._errExpectedButGot("REGEX",o);const r=o.lexeme,s=r.lastIndexOf("/"),a=s===r.length-1?void 0:this._removeFlagsGY(r.substring(s+1));let l;try{l=new RegExp(r.substring(1,s),a)}catch{throw this._errExpectedButGot("REGEX",o)}return AD.create(t,l)}switch(o.type){case 10:case 19:{const r=[o.lexeme];this._advance();let s=this._peek(),a=0;for(let h=0;h=0){const c=r.slice(a+1,l),u=r[l+1]==="i"?"i":"";try{s=new RegExp(c,u)}catch{throw this._errExpectedButGot("REGEX",o)}}}if(s===null)throw this._errExpectedButGot("REGEX",o);return AD.create(t,s)}default:throw this._errExpectedButGot("REGEX",this._peek())}}if(this._matchOne(14)){this._consume(13,VZe);const o=this._value();return Me.notIn(t,o)}switch(this._peek().type){case 3:{this._advance();const o=this._value();if(this._previous().type===18)return Me.equals(t,o);switch(o){case"true":return Me.has(t);case"false":return Me.not(t);default:return Me.equals(t,o)}}case 4:{this._advance();const o=this._value();if(this._previous().type===18)return Me.notEquals(t,o);switch(o){case"true":return Me.not(t);case"false":return Me.has(t);default:return Me.notEquals(t,o)}}case 5:return this._advance(),X4.create(t,this._value());case 6:return this._advance(),Y4.create(t,this._value());case 7:return this._advance(),q4.create(t,this._value());case 8:return this._advance(),G4.create(t,this._value());case 13:return this._advance(),Me.in(t,this._value());default:return Me.has(t)}}case 20:throw this._parsingErrors.push({message:zZe,offset:e.offset,lexeme:"",additionalInfo:UZe}),l0._parseError;default:throw this._errExpectedButGot(`true | false | KEY | KEY '=~' REGEX | KEY ('==' | '!=' | '<' | '<=' | '>' | '>=' | 'in' | 'not' 'in') value`,this._peek())}}_value(){const e=this._peek();switch(e.type){case 17:case 18:return this._advance(),e.lexeme;case 11:return this._advance(),"true";case 12:return this._advance(),"false";case 13:return this._advance(),"in";default:return""}}_removeFlagsGY(e){return e.replaceAll(this._flagsGYRe,"")}_previous(){return this._tokens[this._current-1]}_matchOne(e){return this._check(e)?(this._advance(),!0):!1}_advance(){return this._isAtEnd()||this._current++,this._previous()}_consume(e,t){if(this._check(e))return this._advance();throw this._errExpectedButGot(t,this._peek())}_errExpectedButGot(e,t,n){const o=C("contextkey.parser.error.expectedButGot",`Expected: {0} -Received: '{1}'.`,e,Nh.getLexeme(t)),r=t.offset,s=Nh.getLexeme(t);return this._parsingErrors.push({message:o,offset:r,lexeme:s,additionalInfo:n}),a0._parseError}_check(e){return this._peek().type===e}_peek(){return this._tokens[this._current]}_isAtEnd(){return this._peek().type===20}}a0._parseError=new Error;class Me{static false(){return ua.INSTANCE}static true(){return Ba.INSTANCE}static has(e){return Ob.create(e)}static equals(e,t){return pS.create(e,t)}static notEquals(e,t){return U4.create(e,t)}static regex(e,t){return AD.create(e,t)}static in(e,t){return $4.create(e,t)}static notIn(e,t){return z4.create(e,t)}static not(e){return Fb.create(e)}static and(...e){return l0.create(e,null,!0)}static or(...e){return Sg.create(e,null,!0)}static deserialize(e){return e==null?void 0:this._parser.parse(e)}}Me._parser=new a0({regexParsingWithErrorRecovery:!1});function WZe(i,e){const t=i?i.substituteConstants():void 0,n=e?e.substituteConstants():void 0;return!t&&!n?!0:!t||!n?!1:t.equals(n)}function aE(i,e){return i.cmp(e)}class ua{constructor(){this.type=0}cmp(e){return this.type-e.type}equals(e){return e.type===this.type}substituteConstants(){return this}evaluate(e){return!1}serialize(){return"false"}keys(){return[]}negate(){return Ba.INSTANCE}}ua.INSTANCE=new ua;class Ba{constructor(){this.type=1}cmp(e){return this.type-e.type}equals(e){return e.type===this.type}substituteConstants(){return this}evaluate(e){return!0}serialize(){return"true"}keys(){return[]}negate(){return ua.INSTANCE}}Ba.INSTANCE=new Ba;class Ob{static create(e,t=null){const n=Ls.get(e);return typeof n=="boolean"?n?Ba.INSTANCE:ua.INSTANCE:new Ob(e,t)}constructor(e,t){this.key=e,this.negated=t,this.type=2}cmp(e){return e.type!==this.type?this.type-e.type:U_e(this.key,e.key)}equals(e){return e.type===this.type?this.key===e.key:!1}substituteConstants(){const e=Ls.get(this.key);return typeof e=="boolean"?e?Ba.INSTANCE:ua.INSTANCE:this}evaluate(e){return!!e.getValue(this.key)}serialize(){return this.key}keys(){return[this.key]}negate(){return this.negated||(this.negated=Fb.create(this.key,this)),this.negated}}class pS{static create(e,t,n=null){if(typeof t=="boolean")return t?Ob.create(e,n):Fb.create(e,n);const o=Ls.get(e);return typeof o=="boolean"?t===(o?"true":"false")?Ba.INSTANCE:ua.INSTANCE:new pS(e,t,n)}constructor(e,t,n){this.key=e,this.value=t,this.negated=n,this.type=4}cmp(e){return e.type!==this.type?this.type-e.type:Bb(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){const e=Ls.get(this.key);if(typeof e=="boolean"){const t=e?"true":"false";return this.value===t?Ba.INSTANCE:ua.INSTANCE}return this}evaluate(e){return e.getValue(this.key)==this.value}serialize(){return`${this.key} == '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=U4.create(this.key,this.value,this)),this.negated}}class $4{static create(e,t){return new $4(e,t)}constructor(e,t){this.key=e,this.valueKey=t,this.type=10,this.negated=null}cmp(e){return e.type!==this.type?this.type-e.type:Bb(this.key,this.valueKey,e.key,e.valueKey)}equals(e){return e.type===this.type?this.key===e.key&&this.valueKey===e.valueKey:!1}substituteConstants(){return this}evaluate(e){const t=e.getValue(this.valueKey),n=e.getValue(this.key);return Array.isArray(t)?t.includes(n):typeof n=="string"&&typeof t=="object"&&t!==null?TZe.call(t,n):!1}serialize(){return`${this.key} in '${this.valueKey}'`}keys(){return[this.key,this.valueKey]}negate(){return this.negated||(this.negated=z4.create(this.key,this.valueKey)),this.negated}}class z4{static create(e,t){return new z4(e,t)}constructor(e,t){this.key=e,this.valueKey=t,this.type=11,this._negated=$4.create(e,t)}cmp(e){return e.type!==this.type?this.type-e.type:this._negated.cmp(e._negated)}equals(e){return e.type===this.type?this._negated.equals(e._negated):!1}substituteConstants(){return this}evaluate(e){return!this._negated.evaluate(e)}serialize(){return`${this.key} not in '${this.valueKey}'`}keys(){return this._negated.keys()}negate(){return this._negated}}class U4{static create(e,t,n=null){if(typeof t=="boolean")return t?Fb.create(e,n):Ob.create(e,n);const o=Ls.get(e);return typeof o=="boolean"?t===(o?"true":"false")?ua.INSTANCE:Ba.INSTANCE:new U4(e,t,n)}constructor(e,t,n){this.key=e,this.value=t,this.negated=n,this.type=5}cmp(e){return e.type!==this.type?this.type-e.type:Bb(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){const e=Ls.get(this.key);if(typeof e=="boolean"){const t=e?"true":"false";return this.value===t?ua.INSTANCE:Ba.INSTANCE}return this}evaluate(e){return e.getValue(this.key)!=this.value}serialize(){return`${this.key} != '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=pS.create(this.key,this.value,this)),this.negated}}class Fb{static create(e,t=null){const n=Ls.get(e);return typeof n=="boolean"?n?ua.INSTANCE:Ba.INSTANCE:new Fb(e,t)}constructor(e,t){this.key=e,this.negated=t,this.type=3}cmp(e){return e.type!==this.type?this.type-e.type:U_e(this.key,e.key)}equals(e){return e.type===this.type?this.key===e.key:!1}substituteConstants(){const e=Ls.get(this.key);return typeof e=="boolean"?e?ua.INSTANCE:Ba.INSTANCE:this}evaluate(e){return!e.getValue(this.key)}serialize(){return`!${this.key}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=Ob.create(this.key,this)),this.negated}}function j4(i,e){if(typeof i=="string"){const t=parseFloat(i);isNaN(t)||(i=t)}return typeof i=="string"||typeof i=="number"?e(i):ua.INSTANCE}class K4{static create(e,t,n=null){return j4(t,o=>new K4(e,o,n))}constructor(e,t,n){this.key=e,this.value=t,this.negated=n,this.type=12}cmp(e){return e.type!==this.type?this.type-e.type:Bb(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){return this}evaluate(e){return typeof this.value=="string"?!1:parseFloat(e.getValue(this.key))>this.value}serialize(){return`${this.key} > ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=X4.create(this.key,this.value,this)),this.negated}}class q4{static create(e,t,n=null){return j4(t,o=>new q4(e,o,n))}constructor(e,t,n){this.key=e,this.value=t,this.negated=n,this.type=13}cmp(e){return e.type!==this.type?this.type-e.type:Bb(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){return this}evaluate(e){return typeof this.value=="string"?!1:parseFloat(e.getValue(this.key))>=this.value}serialize(){return`${this.key} >= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=G4.create(this.key,this.value,this)),this.negated}}class G4{static create(e,t,n=null){return j4(t,o=>new G4(e,o,n))}constructor(e,t,n){this.key=e,this.value=t,this.negated=n,this.type=14}cmp(e){return e.type!==this.type?this.type-e.type:Bb(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){return this}evaluate(e){return typeof this.value=="string"?!1:parseFloat(e.getValue(this.key))new X4(e,o,n))}constructor(e,t,n){this.key=e,this.value=t,this.negated=n,this.type=15}cmp(e){return e.type!==this.type?this.type-e.type:Bb(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){return this}evaluate(e){return typeof this.value=="string"?!1:parseFloat(e.getValue(this.key))<=this.value}serialize(){return`${this.key} <= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=K4.create(this.key,this.value,this)),this.negated}}class AD{static create(e,t){return new AD(e,t)}constructor(e,t){this.key=e,this.regexp=t,this.type=7,this.negated=null}cmp(e){if(e.type!==this.type)return this.type-e.type;if(this.keye.key)return 1;const t=this.regexp?this.regexp.source:"",n=e.regexp?e.regexp.source:"";return tn?1:0}equals(e){if(e.type===this.type){const t=this.regexp?this.regexp.source:"",n=e.regexp?e.regexp.source:"";return this.key===e.key&&t===n}return!1}substituteConstants(){return this}evaluate(e){const t=e.getValue(this.key);return this.regexp?this.regexp.test(t):!1}serialize(){const e=this.regexp?`/${this.regexp.source}/${this.regexp.flags}`:"/invalid/";return`${this.key} =~ ${e}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=Gq.create(this)),this.negated}}class Gq{static create(e){return new Gq(e)}constructor(e){this._actual=e,this.type=8}cmp(e){return e.type!==this.type?this.type-e.type:this._actual.cmp(e._actual)}equals(e){return e.type===this.type?this._actual.equals(e._actual):!1}substituteConstants(){return this}evaluate(e){return!this._actual.evaluate(e)}serialize(){return`!(${this._actual.serialize()})`}keys(){return this._actual.keys()}negate(){return this._actual}}function z_e(i){let e=null;for(let t=0,n=i.length;te.expr.length)return 1;for(let t=0,n=this.expr.length;t1;){const s=o[o.length-1];if(s.type!==9)break;o.pop();const a=o.pop(),l=o.length===0,c=Sg.create(s.expr.map(u=>l0.create([u,a],null,n)),null,l);c&&(o.push(c),o.sort(aE))}if(o.length===1)return o[0];if(n){for(let s=0;se.serialize()).join(" && ")}keys(){const e=[];for(const t of this.expr)e.push(...t.keys());return e}negate(){if(!this.negated){const e=[];for(const t of this.expr)e.push(t.negate());this.negated=Sg.create(e,this,!0)}return this.negated}}class Sg{static create(e,t,n){return Sg._normalizeArr(e,t,n)}constructor(e,t){this.expr=e,this.negated=t,this.type=9}cmp(e){if(e.type!==this.type)return this.type-e.type;if(this.expr.lengthe.expr.length)return 1;for(let t=0,n=this.expr.length;te.serialize()).join(" || ")}keys(){const e=[];for(const t of this.expr)e.push(...t.keys());return e}negate(){if(!this.negated){const e=[];for(const t of this.expr)e.push(t.negate());for(;e.length>1;){const t=e.shift(),n=e.shift(),o=[];for(const r of uoe(t))for(const s of uoe(n))o.push(l0.create([r,s],null,!1));e.unshift(Sg.create(o,null,!1))}this.negated=Sg.create(e,this,!0)}return this.negated}}class lt extends Ob{static all(){return lt._info.values()}constructor(e,t,n){super(e,null),this._defaultValue=t,typeof n=="object"?lt._info.push(Object.assign(Object.assign({},n),{key:e})):n!==!0&<._info.push({key:e,description:n,type:t!=null?typeof t:void 0})}bindTo(e){return e.createKey(this.key,this._defaultValue)}getValue(e){return e.getContextKeyValue(this.key)}toNegated(){return this.negate()}isEqualTo(e){return pS.create(this.key,e)}}lt._info=[];const Ut=wn("contextKeyService");function U_e(i,e){return ie?1:0}function Bb(i,e,t,n){return it?1:en?1:0}function VV(i,e){if(i.type===0||e.type===1)return!0;if(i.type===9)return e.type===9?coe(i.expr,e.expr):!1;if(e.type===9){for(const t of e.expr)if(VV(i,t))return!0;return!1}if(i.type===6){if(e.type===6)return coe(e.expr,i.expr);for(const t of i.expr)if(VV(t,e))return!0;return!1}return i.equals(e)}function coe(i,e){let t=0,n=0;for(;t>>0,n=(i&4294901760)>>>16;return n!==0?new R6([e2(t,e),e2(n,e)]):new R6([e2(t,e)])}else{const t=[];for(let n=0;n{a(),this._cachedMergedKeybindings=null})}getDefaultKeybindings(){return this._cachedMergedKeybindings||(this._cachedMergedKeybindings=Array.from(this._coreKeybindings).concat(this._extensionKeybindings),this._cachedMergedKeybindings.sort(UZe)),this._cachedMergedKeybindings.slice(0)}}const Wa=new Xq,zZe={EditorModes:"platform.keybindingsRegistry"};no.add(zZe.EditorModes,Wa);function UZe(i,e){if(i.weight1!==e.weight1)return i.weight1-e.weight1;if(i.command&&e.command){if(i.commande.command)return 1}return i.weight2-e.weight2}var jZe=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},doe=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},KZe=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(i);ot===e}}xg._all=new Map;const Hr=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new EYe({merge:xg.merge}),this.onDidChangeMenu=this._onDidChangeMenu.event}addCommand(i){return this._commands.set(i.id,i),this._onDidChangeMenu.fire(xg.for(Z.CommandPalette)),zt(()=>{this._commands.delete(i.id)&&this._onDidChangeMenu.fire(xg.for(Z.CommandPalette))})}getCommand(i){return this._commands.get(i)}getCommands(){const i=new Map;return this._commands.forEach((e,t)=>i.set(t,e)),i}appendMenuItem(i,e){let t=this._menuItems.get(i);t||(t=new ia,this._menuItems.set(i,t));const n=t.push(e);return this._onDidChangeMenu.fire(xg.for(i)),zt(()=>{n(),this._onDidChangeMenu.fire(xg.for(i))})}appendMenuItems(i){const e=new Be;for(const{id:t,item:n}of i)e.add(this.appendMenuItem(t,n));return e}getMenuItems(i){let e;return this._menuItems.has(i)?e=[...this._menuItems.get(i)]:e=[],i===Z.CommandPalette&&this._appendImplicitItems(e),e}_appendImplicitItems(i){const e=new Set;for(const t of i)IC(t)&&(e.add(t.command.id),t.alt&&e.add(t.alt.id));this._commands.forEach((t,n)=>{e.has(n)||i.push({command:t})})}};class OD extends py{constructor(e,t,n){super(`submenuitem.${e.submenu.id}`,typeof e.title=="string"?e.title:e.title.value,n,"submenu"),this.item=e,this.hideActions=t}}let Ou=ZR=class{static label(e,t){return(t==null?void 0: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,n,o,r,s){var a,l;this.hideActions=o,this._commandService=s,this.id=e.id,this.label=ZR.label(e,n),this.tooltip=(l=typeof e.tooltip=="string"?e.tooltip:(a=e.tooltip)===null||a===void 0?void 0:a.value)!==null&&l!==void 0?l:"",this.enabled=!e.precondition||r.contextMatchesRules(e.precondition),this.checked=void 0;let c;if(e.toggled){const u=e.toggled.condition?e.toggled:{condition:e.toggled};this.checked=r.contextMatchesRules(u.condition),this.checked&&u.tooltip&&(this.tooltip=typeof u.tooltip=="string"?u.tooltip:u.tooltip.value),this.checked&&Mt.isThemeIcon(u.icon)&&(c=u.icon),this.checked&&u.title&&(this.label=typeof u.title=="string"?u.title:u.title.value)}c||(c=Mt.isThemeIcon(e.icon)?e.icon:void 0),this.item=e,this.alt=t?new ZR(t,void 0,n,o,r,s):void 0,this._options=n,this.class=c&&Mt.asClassName(c)}run(...e){var t,n;let o=[];return!((t=this._options)===null||t===void 0)&&t.arg&&(o=[...o,this._options.arg]),!((n=this._options)===null||n===void 0)&&n.shouldForwardArgs&&(o=[...o,...e]),this._commandService.executeCommand(this.id,...o)}};Ou=ZR=jZe([doe(4,Ut),doe(5,_o)],Ou);class Jl{constructor(e){this.desc=e}}function $i(i){const e=new Be,t=new i,n=t.desc,{f1:o,menu:r,keybinding:s,description:a}=n,l=KZe(n,["f1","menu","keybinding","description"]);if(e.add(Rn.registerCommand({id:l.id,handler:(c,...u)=>t.run(c,...u),description:a})),Array.isArray(r))for(const c of r)e.add(Hr.appendMenuItem(c.id,Object.assign({command:Object.assign(Object.assign({},l),{precondition:c.precondition===null?void 0:l.precondition})},c)));else r&&e.add(Hr.appendMenuItem(r.id,Object.assign({command:Object.assign(Object.assign({},l),{precondition:r.precondition===null?void 0:l.precondition})},r)));if(o&&(e.add(Hr.appendMenuItem(Z.CommandPalette,{command:l,when:l.precondition})),e.add(Hr.addCommand(l))),Array.isArray(s))for(const c of s)e.add(Wa.registerKeybindingRule(Object.assign(Object.assign({},c),{id:l.id,when:l.precondition?Me.and(l.precondition,c.when):c.when})));else s&&e.add(Wa.registerKeybindingRule(Object.assign(Object.assign({},s),{id:l.id,when:l.precondition?Me.and(l.precondition,s.when):s.when})));return e}const ec=wn("telemetryService"),tc=wn("logService");var ts;(function(i){i[i.Off=0]="Off",i[i.Trace=1]="Trace",i[i.Debug=2]="Debug",i[i.Info=3]="Info",i[i.Warning=4]="Warning",i[i.Error=5]="Error"})(ts||(ts={}));const K_e=ts.Info;class q_e extends _e{constructor(){super(...arguments),this.level=K_e,this._onDidChangeLogLevel=this._register(new le),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!==ts.Off&&this.level<=e}}class GZe extends q_e{constructor(e=K_e,t=!0){super(),this.useColors=t,this.setLevel(e)}trace(e,...t){this.checkLogLevel(ts.Trace)&&(this.useColors?console.log("%cTRACE","color: #888",e,...t):console.log(e,...t))}debug(e,...t){this.checkLogLevel(ts.Debug)&&(this.useColors?console.log("%cDEBUG","background: #eee; color: #888",e,...t):console.log(e,...t))}info(e,...t){this.checkLogLevel(ts.Info)&&(this.useColors?console.log("%c INFO","color: #33f",e,...t):console.log(e,...t))}warn(e,...t){this.checkLogLevel(ts.Warning)&&(this.useColors?console.log("%c WARN","color: #993",e,...t):console.log(e,...t))}error(e,...t){this.checkLogLevel(ts.Error)&&(this.useColors?console.log("%c ERR","color: #f33",e,...t):console.error(e,...t))}dispose(){}}class XZe extends q_e{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 n of this.loggers)n.trace(e,...t)}debug(e,...t){for(const n of this.loggers)n.debug(e,...t)}info(e,...t){for(const n of this.loggers)n.info(e,...t)}warn(e,...t){for(const n of this.loggers)n.warn(e,...t)}error(e,...t){for(const n of this.loggers)n.error(e,...t)}dispose(){for(const e of this.loggers)e.dispose()}}function YZe(i){switch(i){case ts.Trace:return"trace";case ts.Debug:return"debug";case ts.Info:return"info";case ts.Warning:return"warn";case ts.Error:return"error";case ts.Off:return"off"}}new lt("logLevel",YZe(ts.Info));const Yq={clipboard:{writeText:Fd||document.queryCommandSupported&&document.queryCommandSupported("copy")||!!(navigator&&navigator.clipboard&&navigator.clipboard.writeText),readText:Fd||!!(navigator&&navigator.clipboard&&navigator.clipboard.readText)},keyboard:(()=>Fd||wZe()?0:navigator.keyboard||sp?1:2)(),touch:"ontouchstart"in window||navigator.maxTouchPoints>0,pointerEvents:window.PointerEvent&&("ontouchstart"in window||window.navigator.maxTouchPoints>0||navigator.maxTouchPoints>0)};function ZZe(i){if(i.charCode){const t=String.fromCharCode(i.charCode).toUpperCase();return yg.fromString(t)}const e=i.keyCode;if(e===3)return 7;if(Oc)switch(e){case 59:return 85;case 60:if(Ss)return 97;break;case 61:return 86;case 107:return 109;case 109:return 111;case 173:return 88;case 224:if(Nn)return 57;break}else if(x0){if(Nn&&e===93)return 57;if(!Nn&&e===92)return 57}return C_e[e]||0}const QZe=Nn?256:2048,JZe=512,eQe=1024,tQe=Nn?2048:256;class Pi{constructor(e){this._standardKeyboardEventBrand=!0;const t=e;this.browserEvent=t,this.target=t.target,this.ctrlKey=t.ctrlKey,this.shiftKey=t.shiftKey,this.altKey=t.altKey,this.metaKey=t.metaKey,this.altGraphKey=t.getModifierState("AltGraph"),this.keyCode=ZZe(t),this.code=t.code,this.ctrlKey=this.ctrlKey||this.keyCode===5,this.altKey=this.altKey||this.keyCode===6,this.shiftKey=this.shiftKey||this.keyCode===4,this.metaKey=this.metaKey||this.keyCode===57,this._asKeybinding=this._computeKeybinding(),this._asKeyCodeChord=this._computeKeyCodeChord()}preventDefault(){this.browserEvent&&this.browserEvent.preventDefault&&this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent&&this.browserEvent.stopPropagation&&this.browserEvent.stopPropagation()}toKeyCodeChord(){return this._asKeyCodeChord}equals(e){return this._asKeybinding===e}_computeKeybinding(){let e=0;this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(e=this.keyCode);let t=0;return this.ctrlKey&&(t|=QZe),this.altKey&&(t|=JZe),this.shiftKey&&(t|=eQe),this.metaKey&&(t|=tQe),t|=e,t}_computeKeyCodeChord(){let e=0;return this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(e=this.keyCode),new ap(this.ctrlKey,this.shiftKey,this.altKey,this.metaKey,e)}}let hoe=!1,Dx=null;function nQe(i){if(!i.parent||i.parent===i)return null;try{const e=i.location,t=i.parent.location;if(e.origin!=="null"&&t.origin!=="null"&&e.origin!==t.origin)return hoe=!0,null}catch{return hoe=!0,null}return i.parent}class iQe{static getSameOriginWindowChain(){if(!Dx){Dx=[];let e=window,t;do t=nQe(e),t?Dx.push({window:e,iframeElement:e.frameElement||null}):Dx.push({window:e,iframeElement:null}),e=t;while(e)}return Dx.slice(0)}static getPositionOfChildWindowRelativeToAncestorWindow(e,t){if(!t||e===t)return{top:0,left:0};let n=0,o=0;const r=this.getSameOriginWindowChain();for(const s of r){if(n+=s.window.scrollY,o+=s.window.scrollX,s.window===t||!s.iframeElement)break;const a=s.iframeElement.getBoundingClientRect();n+=a.top,o+=a.left}return{top:n,left:o}}}class Dc{constructor(e){this.timestamp=Date.now(),this.browserEvent=e,this.leftButton=e.button===0,this.middleButton=e.button===1,this.rightButton=e.button===2,this.buttons=e.buttons,this.target=e.target,this.detail=e.detail||1,e.type==="dblclick"&&(this.detail=2),this.ctrlKey=e.ctrlKey,this.shiftKey=e.shiftKey,this.altKey=e.altKey,this.metaKey=e.metaKey,typeof e.pageX=="number"?(this.posx=e.pageX,this.posy=e.pageY):(this.posx=e.clientX+this.target.ownerDocument.body.scrollLeft+this.target.ownerDocument.documentElement.scrollLeft,this.posy=e.clientY+this.target.ownerDocument.body.scrollTop+this.target.ownerDocument.documentElement.scrollTop);const t=iQe.getPositionOfChildWindowRelativeToAncestorWindow(window,e.view);this.posx-=t.left,this.posy-=t.top}preventDefault(){this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent.stopPropagation()}}class Q0{constructor(e,t=0,n=0){if(this.browserEvent=e||null,this.target=e?e.target||e.targetNode||e.srcElement:null,this.deltaY=n,this.deltaX=t,e){const o=e,r=e;if(typeof o.wheelDeltaY!="undefined")this.deltaY=o.wheelDeltaY/120;else if(typeof r.VERTICAL_AXIS!="undefined"&&r.axis===r.VERTICAL_AXIS)this.deltaY=-r.detail/3;else if(e.type==="wheel"){const s=e;s.deltaMode===s.DOM_DELTA_LINE?Oc&&!Nn?this.deltaY=-e.deltaY/3:this.deltaY=-e.deltaY:this.deltaY=-e.deltaY/40}if(typeof o.wheelDeltaX!="undefined")sp&&as?this.deltaX=-(o.wheelDeltaX/120):this.deltaX=o.wheelDeltaX/120;else if(typeof r.HORIZONTAL_AXIS!="undefined"&&r.axis===r.HORIZONTAL_AXIS)this.deltaX=-e.detail/3;else if(e.type==="wheel"){const s=e;s.deltaMode===s.DOM_DELTA_LINE?Oc&&!Nn?this.deltaX=-e.deltaX/3:this.deltaX=-e.deltaX:this.deltaX=-e.deltaX/40}this.deltaY===0&&this.deltaX===0&&e.wheelDelta&&(this.deltaY=e.wheelDelta/120)}}preventDefault(){var e;(e=this.browserEvent)===null||e===void 0||e.preventDefault()}stopPropagation(){var e;(e=this.browserEvent)===null||e===void 0||e.stopPropagation()}}/*! @license DOMPurify 3.0.5 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.0.5/LICENSE */const{entries:G_e,setPrototypeOf:foe,isFrozen:oQe,getPrototypeOf:rQe,getOwnPropertyDescriptor:sQe}=Object;let{freeze:dl,seal:Kd,create:aQe}=Object,{apply:$V,construct:zV}=typeof Reflect!="undefined"&&Reflect;$V||($V=function(e,t,n){return e.apply(t,n)});dl||(dl=function(e){return e});Kd||(Kd=function(e){return e});zV||(zV=function(e,t){return new e(...t)});const lQe=Fu(Array.prototype.forEach),goe=Fu(Array.prototype.pop),kx=Fu(Array.prototype.push),QR=Fu(String.prototype.toLowerCase),A6=Fu(String.prototype.toString),cQe=Fu(String.prototype.match),nd=Fu(String.prototype.replace),uQe=Fu(String.prototype.indexOf),dQe=Fu(String.prototype.trim),gc=Fu(RegExp.prototype.test),Ix=hQe(TypeError);function Fu(i){return function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),o=1;o/gm),vQe=Kd(/\${[\w\W]*}/gm),_Qe=Kd(/^data-[\-\w.\u00B7-\uFFFF]/),bQe=Kd(/^aria-[\-\w]+$/),X_e=Kd(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),CQe=Kd(/^(?:\w+script|data):/i),wQe=Kd(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Y_e=Kd(/^html$/i);var boe=Object.freeze({__proto__:null,MUSTACHE_EXPR:pQe,ERB_EXPR:mQe,TMPLIT_EXPR:vQe,DATA_ATTR:_Qe,ARIA_ATTR:bQe,IS_ALLOWED_URI:X_e,IS_SCRIPT_OR_DATA:CQe,ATTR_WHITESPACE:wQe,DOCTYPE_NAME:Y_e});const yQe=()=>typeof window=="undefined"?null:window,SQe=function(e,t){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let n=null;const o="data-tt-policy-suffix";t&&t.hasAttribute(o)&&(n=t.getAttribute(o));const r="dompurify"+(n?"#"+n:"");try{return e.createPolicy(r,{createHTML(s){return s},createScriptURL(s){return s}})}catch{return console.warn("TrustedTypes policy "+r+" could not be created."),null}};function Z_e(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:yQe();const e=Ze=>Z_e(Ze);if(e.version="3.0.5",e.removed=[],!i||!i.document||i.document.nodeType!==9)return e.isSupported=!1,e;const t=i.document,n=t.currentScript;let{document:o}=i;const{DocumentFragment:r,HTMLTemplateElement:s,Node:a,Element:l,NodeFilter:c,NamedNodeMap:u=i.NamedNodeMap||i.MozNamedAttrMap,HTMLFormElement:d,DOMParser:h,trustedTypes:f}=i,g=l.prototype,p=t2(g,"cloneNode"),v=t2(g,"nextSibling"),m=t2(g,"childNodes"),_=t2(g,"parentNode");if(typeof s=="function"){const Ze=o.createElement("template");Ze.content&&Ze.content.ownerDocument&&(o=Ze.content.ownerDocument)}let w,y="";const{implementation:L,createNodeIterator:D,createDocumentFragment:E,getElementsByTagName:I}=o,{importNode:k}=t;let R={};e.isSupported=typeof G_e=="function"&&typeof _=="function"&&L&&L.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:A,ERB_EXPR:P,TMPLIT_EXPR:N,DATA_ATTR:M,ARIA_ATTR:H,IS_SCRIPT_OR_DATA:W,ATTR_WHITESPACE:F}=boe;let{IS_ALLOWED_URI:$}=boe,z=null;const K=hi({},[...poe,...P6,...O6,...F6,...moe]);let j=null;const G=hi({},[...voe,...B6,..._oe,...n2]);let X=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}})),de=null,he=null,pe=!0,be=!0,Se=!1,Fe=!0,De=!1,ce=!1,Pe=!1,Oe=!1,xe=!1,Ee=!1,tt=!1,nt=!0,Qe=!1;const Ge="user-content-";let re=!0,ie=!1,se={},U=null;const Y=hi({},["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 oe=null;const te=hi({},["audio","video","img","source","image","track"]);let we=null;const Le=hi({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Te="http://www.w3.org/1998/Math/MathML",We="http://www.w3.org/2000/svg",je="http://www.w3.org/1999/xhtml";let mt=je,Et=!1,At=null;const Je=hi({},[Te,We,je],A6);let xt;const Ot=["application/xhtml+xml","text/html"],Vn="text/html";let Lt,tn=null;const ui=o.createElement("form"),cn=function(ue){return ue instanceof RegExp||ue instanceof Function},qn=function(ue){if(!(tn&&tn===ue)){if((!ue||typeof ue!="object")&&(ue={}),ue=B1(ue),xt=Ot.indexOf(ue.PARSER_MEDIA_TYPE)===-1?xt=Vn:xt=ue.PARSER_MEDIA_TYPE,Lt=xt==="application/xhtml+xml"?A6:QR,z="ALLOWED_TAGS"in ue?hi({},ue.ALLOWED_TAGS,Lt):K,j="ALLOWED_ATTR"in ue?hi({},ue.ALLOWED_ATTR,Lt):G,At="ALLOWED_NAMESPACES"in ue?hi({},ue.ALLOWED_NAMESPACES,A6):Je,we="ADD_URI_SAFE_ATTR"in ue?hi(B1(Le),ue.ADD_URI_SAFE_ATTR,Lt):Le,oe="ADD_DATA_URI_TAGS"in ue?hi(B1(te),ue.ADD_DATA_URI_TAGS,Lt):te,U="FORBID_CONTENTS"in ue?hi({},ue.FORBID_CONTENTS,Lt):Y,de="FORBID_TAGS"in ue?hi({},ue.FORBID_TAGS,Lt):{},he="FORBID_ATTR"in ue?hi({},ue.FORBID_ATTR,Lt):{},se="USE_PROFILES"in ue?ue.USE_PROFILES:!1,pe=ue.ALLOW_ARIA_ATTR!==!1,be=ue.ALLOW_DATA_ATTR!==!1,Se=ue.ALLOW_UNKNOWN_PROTOCOLS||!1,Fe=ue.ALLOW_SELF_CLOSE_IN_ATTR!==!1,De=ue.SAFE_FOR_TEMPLATES||!1,ce=ue.WHOLE_DOCUMENT||!1,xe=ue.RETURN_DOM||!1,Ee=ue.RETURN_DOM_FRAGMENT||!1,tt=ue.RETURN_TRUSTED_TYPE||!1,Oe=ue.FORCE_BODY||!1,nt=ue.SANITIZE_DOM!==!1,Qe=ue.SANITIZE_NAMED_PROPS||!1,re=ue.KEEP_CONTENT!==!1,ie=ue.IN_PLACE||!1,$=ue.ALLOWED_URI_REGEXP||X_e,mt=ue.NAMESPACE||je,X=ue.CUSTOM_ELEMENT_HANDLING||{},ue.CUSTOM_ELEMENT_HANDLING&&cn(ue.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(X.tagNameCheck=ue.CUSTOM_ELEMENT_HANDLING.tagNameCheck),ue.CUSTOM_ELEMENT_HANDLING&&cn(ue.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(X.attributeNameCheck=ue.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),ue.CUSTOM_ELEMENT_HANDLING&&typeof ue.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(X.allowCustomizedBuiltInElements=ue.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),De&&(be=!1),Ee&&(xe=!0),se&&(z=hi({},[...moe]),j=[],se.html===!0&&(hi(z,poe),hi(j,voe)),se.svg===!0&&(hi(z,P6),hi(j,B6),hi(j,n2)),se.svgFilters===!0&&(hi(z,O6),hi(j,B6),hi(j,n2)),se.mathMl===!0&&(hi(z,F6),hi(j,_oe),hi(j,n2))),ue.ADD_TAGS&&(z===K&&(z=B1(z)),hi(z,ue.ADD_TAGS,Lt)),ue.ADD_ATTR&&(j===G&&(j=B1(j)),hi(j,ue.ADD_ATTR,Lt)),ue.ADD_URI_SAFE_ATTR&&hi(we,ue.ADD_URI_SAFE_ATTR,Lt),ue.FORBID_CONTENTS&&(U===Y&&(U=B1(U)),hi(U,ue.FORBID_CONTENTS,Lt)),re&&(z["#text"]=!0),ce&&hi(z,["html","head","body"]),z.table&&(hi(z,["tbody"]),delete de.tbody),ue.TRUSTED_TYPES_POLICY){if(typeof ue.TRUSTED_TYPES_POLICY.createHTML!="function")throw Ix('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof ue.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Ix('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');w=ue.TRUSTED_TYPES_POLICY,y=w.createHTML("")}else w===void 0&&(w=SQe(f,n)),w!==null&&typeof y=="string"&&(y=w.createHTML(""));dl&&dl(ue),tn=ue}},bn=hi({},["mi","mo","mn","ms","mtext"]),Pt=hi({},["foreignobject","desc","title","annotation-xml"]),qt=hi({},["title","style","font","a","script"]),Nt=hi({},P6);hi(Nt,O6),hi(Nt,fQe);const jt=hi({},F6);hi(jt,gQe);const Gt=function(ue){let Ve=_(ue);(!Ve||!Ve.tagName)&&(Ve={namespaceURI:mt,tagName:"template"});const ot=QR(ue.tagName),Sn=QR(Ve.tagName);return At[ue.namespaceURI]?ue.namespaceURI===We?Ve.namespaceURI===je?ot==="svg":Ve.namespaceURI===Te?ot==="svg"&&(Sn==="annotation-xml"||bn[Sn]):Boolean(Nt[ot]):ue.namespaceURI===Te?Ve.namespaceURI===je?ot==="math":Ve.namespaceURI===We?ot==="math"&&Pt[Sn]:Boolean(jt[ot]):ue.namespaceURI===je?Ve.namespaceURI===We&&!Pt[Sn]||Ve.namespaceURI===Te&&!bn[Sn]?!1:!jt[ot]&&(qt[ot]||!Nt[ot]):!!(xt==="application/xhtml+xml"&&At[ue.namespaceURI]):!1},kt=function(ue){kx(e.removed,{element:ue});try{ue.parentNode.removeChild(ue)}catch{ue.remove()}},Ft=function(ue,Ve){try{kx(e.removed,{attribute:Ve.getAttributeNode(ue),from:Ve})}catch{kx(e.removed,{attribute:null,from:Ve})}if(Ve.removeAttribute(ue),ue==="is"&&!j[ue])if(xe||Ee)try{kt(Ve)}catch{}else try{Ve.setAttribute(ue,"")}catch{}},bt=function(ue){let Ve,ot;if(Oe)ue=""+ue;else{const Ci=cQe(ue,/^[\r\n\t ]+/);ot=Ci&&Ci[0]}xt==="application/xhtml+xml"&&mt===je&&(ue=''+ue+"");const Sn=w?w.createHTML(ue):ue;if(mt===je)try{Ve=new h().parseFromString(Sn,xt)}catch{}if(!Ve||!Ve.documentElement){Ve=L.createDocument(mt,"template",null);try{Ve.documentElement.innerHTML=Et?y:Sn}catch{}}const $n=Ve.body||Ve.documentElement;return ue&&ot&&$n.insertBefore(o.createTextNode(ot),$n.childNodes[0]||null),mt===je?I.call(Ve,ce?"html":"body")[0]:ce?Ve.documentElement:$n},Zt=function(ue){return D.call(ue.ownerDocument||ue,ue,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT,null,!1)},yn=function(ue){return ue instanceof d&&(typeof ue.nodeName!="string"||typeof ue.textContent!="string"||typeof ue.removeChild!="function"||!(ue.attributes instanceof u)||typeof ue.removeAttribute!="function"||typeof ue.setAttribute!="function"||typeof ue.namespaceURI!="string"||typeof ue.insertBefore!="function"||typeof ue.hasChildNodes!="function")},Dn=function(ue){return typeof a=="object"?ue instanceof a:ue&&typeof ue=="object"&&typeof ue.nodeType=="number"&&typeof ue.nodeName=="string"},Gn=function(ue,Ve,ot){!R[ue]||lQe(R[ue],Sn=>{Sn.call(e,Ve,ot,tn)})},Un=function(ue){let Ve;if(Gn("beforeSanitizeElements",ue,null),yn(ue))return kt(ue),!0;const ot=Lt(ue.nodeName);if(Gn("uponSanitizeElement",ue,{tagName:ot,allowedTags:z}),ue.hasChildNodes()&&!Dn(ue.firstElementChild)&&(!Dn(ue.content)||!Dn(ue.content.firstElementChild))&&gc(/<[/\w]/g,ue.innerHTML)&&gc(/<[/\w]/g,ue.textContent))return kt(ue),!0;if(!z[ot]||de[ot]){if(!de[ot]&&an(ot)&&(X.tagNameCheck instanceof RegExp&&gc(X.tagNameCheck,ot)||X.tagNameCheck instanceof Function&&X.tagNameCheck(ot)))return!1;if(re&&!U[ot]){const Sn=_(ue)||ue.parentNode,$n=m(ue)||ue.childNodes;if($n&&Sn){const Ci=$n.length;for(let An=Ci-1;An>=0;--An)Sn.insertBefore(p($n[An],!0),v(ue))}}return kt(ue),!0}return ue instanceof l&&!Gt(ue)||(ot==="noscript"||ot==="noembed"||ot==="noframes")&&gc(/<\/no(script|embed|frames)/i,ue.innerHTML)?(kt(ue),!0):(De&&ue.nodeType===3&&(Ve=ue.textContent,Ve=nd(Ve,A," "),Ve=nd(Ve,P," "),Ve=nd(Ve,N," "),ue.textContent!==Ve&&(kx(e.removed,{element:ue.cloneNode()}),ue.textContent=Ve)),Gn("afterSanitizeElements",ue,null),!1)},Zi=function(ue,Ve,ot){if(nt&&(Ve==="id"||Ve==="name")&&(ot in o||ot in ui))return!1;if(!(be&&!he[Ve]&&gc(M,Ve))){if(!(pe&&gc(H,Ve))){if(!j[Ve]||he[Ve]){if(!(an(ue)&&(X.tagNameCheck instanceof RegExp&&gc(X.tagNameCheck,ue)||X.tagNameCheck instanceof Function&&X.tagNameCheck(ue))&&(X.attributeNameCheck instanceof RegExp&&gc(X.attributeNameCheck,Ve)||X.attributeNameCheck instanceof Function&&X.attributeNameCheck(Ve))||Ve==="is"&&X.allowCustomizedBuiltInElements&&(X.tagNameCheck instanceof RegExp&&gc(X.tagNameCheck,ot)||X.tagNameCheck instanceof Function&&X.tagNameCheck(ot))))return!1}else if(!we[Ve]){if(!gc($,nd(ot,F,""))){if(!((Ve==="src"||Ve==="xlink:href"||Ve==="href")&&ue!=="script"&&uQe(ot,"data:")===0&&oe[ue])){if(!(Se&&!gc(W,nd(ot,F,"")))){if(ot)return!1}}}}}}return!0},an=function(ue){return ue.indexOf("-")>0},Xt=function(ue){let Ve,ot,Sn,$n;Gn("beforeSanitizeAttributes",ue,null);const{attributes:Ci}=ue;if(!Ci)return;const An={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:j};for($n=Ci.length;$n--;){Ve=Ci[$n];const{name:lo,namespaceURI:Qo}=Ve;if(ot=lo==="value"?Ve.value:dQe(Ve.value),Sn=Lt(lo),An.attrName=Sn,An.attrValue=ot,An.keepAttr=!0,An.forceKeepAttr=void 0,Gn("uponSanitizeAttribute",ue,An),ot=An.attrValue,An.forceKeepAttr||(Ft(lo,ue),!An.keepAttr))continue;if(!Fe&&gc(/\/>/i,ot)){Ft(lo,ue);continue}De&&(ot=nd(ot,A," "),ot=nd(ot,P," "),ot=nd(ot,N," "));const zo=Lt(ue.nodeName);if(!!Zi(zo,Sn,ot)){if(Qe&&(Sn==="id"||Sn==="name")&&(Ft(lo,ue),ot=Ge+ot),w&&typeof f=="object"&&typeof f.getAttributeType=="function"&&!Qo)switch(f.getAttributeType(zo,Sn)){case"TrustedHTML":{ot=w.createHTML(ot);break}case"TrustedScriptURL":{ot=w.createScriptURL(ot);break}}try{Qo?ue.setAttributeNS(Qo,lo,ot):ue.setAttribute(lo,ot),goe(e.removed)}catch{}}}Gn("afterSanitizeAttributes",ue,null)},oi=function Ze(ue){let Ve;const ot=Zt(ue);for(Gn("beforeSanitizeShadowDOM",ue,null);Ve=ot.nextNode();)Gn("uponSanitizeShadowNode",Ve,null),!Un(Ve)&&(Ve.content instanceof r&&Ze(Ve.content),Xt(Ve));Gn("afterSanitizeShadowDOM",ue,null)};return e.sanitize=function(Ze){let ue=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Ve,ot,Sn,$n;if(Et=!Ze,Et&&(Ze=""),typeof Ze!="string"&&!Dn(Ze))if(typeof Ze.toString=="function"){if(Ze=Ze.toString(),typeof Ze!="string")throw Ix("dirty is not a string, aborting")}else throw Ix("toString is not a function");if(!e.isSupported)return Ze;if(Pe||qn(ue),e.removed=[],typeof Ze=="string"&&(ie=!1),ie){if(Ze.nodeName){const lo=Lt(Ze.nodeName);if(!z[lo]||de[lo])throw Ix("root node is forbidden and cannot be sanitized in-place")}}else if(Ze instanceof a)Ve=bt(""),ot=Ve.ownerDocument.importNode(Ze,!0),ot.nodeType===1&&ot.nodeName==="BODY"||ot.nodeName==="HTML"?Ve=ot:Ve.appendChild(ot);else{if(!xe&&!De&&!ce&&Ze.indexOf("<")===-1)return w&&tt?w.createHTML(Ze):Ze;if(Ve=bt(Ze),!Ve)return xe?null:tt?y:""}Ve&&Oe&&kt(Ve.firstChild);const Ci=Zt(ie?Ze:Ve);for(;Sn=Ci.nextNode();)Un(Sn)||(Sn.content instanceof r&&oi(Sn.content),Xt(Sn));if(ie)return Ze;if(xe){if(Ee)for($n=E.call(Ve.ownerDocument);Ve.firstChild;)$n.appendChild(Ve.firstChild);else $n=Ve;return(j.shadowroot||j.shadowrootmode)&&($n=k.call(t,$n,!0)),$n}let An=ce?Ve.outerHTML:Ve.innerHTML;return ce&&z["!doctype"]&&Ve.ownerDocument&&Ve.ownerDocument.doctype&&Ve.ownerDocument.doctype.name&&gc(Y_e,Ve.ownerDocument.doctype.name)&&(An=" -`+An),De&&(An=nd(An,A," "),An=nd(An,P," "),An=nd(An,N," ")),w&&tt?w.createHTML(An):An},e.setConfig=function(Ze){qn(Ze),Pe=!0},e.clearConfig=function(){tn=null,Pe=!1},e.isValidAttribute=function(Ze,ue,Ve){tn||qn({});const ot=Lt(Ze),Sn=Lt(ue);return Zi(ot,Sn,Ve)},e.addHook=function(Ze,ue){typeof ue=="function"&&(R[Ze]=R[Ze]||[],kx(R[Ze],ue))},e.removeHook=function(Ze){if(R[Ze])return goe(R[Ze])},e.removeHooks=function(Ze){R[Ze]&&(R[Ze]=[])},e.removeAllHooks=function(){R={}},e}var Tf=Z_e();Tf.version;Tf.isSupported;const Q_e=Tf.sanitize;Tf.setConfig;Tf.clearConfig;Tf.isValidAttribute;const J_e=Tf.addHook,e0e=Tf.removeHook;Tf.removeHooks;Tf.removeAllHooks;var hn;(function(i){i.inMemory="inmemory",i.vscode="vscode",i.internal="private",i.walkThrough="walkThrough",i.walkThroughSnippet="walkThroughSnippet",i.http="http",i.https="https",i.file="file",i.mailto="mailto",i.untitled="untitled",i.data="data",i.command="command",i.vscodeRemote="vscode-remote",i.vscodeRemoteResource="vscode-remote-resource",i.vscodeManagedRemoteResource="vscode-managed-remote-resource",i.vscodeUserData="vscode-userdata",i.vscodeCustomEditor="vscode-custom-editor",i.vscodeNotebookCell="vscode-notebook-cell",i.vscodeNotebookCellMetadata="vscode-notebook-cell-metadata",i.vscodeNotebookCellOutput="vscode-notebook-cell-output",i.vscodeInteractiveInput="vscode-interactive-input",i.vscodeSettings="vscode-settings",i.vscodeWorkspaceTrust="vscode-workspace-trust",i.vscodeTerminal="vscode-terminal",i.vscodeChatSesssion="vscode-chat-editor",i.webviewPanel="webview-panel",i.vscodeWebview="vscode-webview",i.extension="extension",i.vscodeFileResource="vscode-file",i.tmp="tmp",i.vsls="vsls",i.vscodeSourceControl="vscode-scm"})(hn||(hn={}));const xQe="tkn";class LQe{constructor(){this._hosts=Object.create(null),this._ports=Object.create(null),this._connectionTokens=Object.create(null),this._preferredWebSchema="http",this._delegate=null,this._remoteResourcesPath=`/${hn.vscodeRemoteResource}`}setPreferredWebSchema(e){this._preferredWebSchema=e}rewrite(e){if(this._delegate)try{return this._delegate(e)}catch(a){return en(a),e}const t=e.authority;let n=this._hosts[t];n&&n.indexOf(":")!==-1&&n.indexOf("[")===-1&&(n=`[${n}]`);const o=this._ports[t],r=this._connectionTokens[t];let s=`path=${encodeURIComponent(e.path)}`;return typeof r=="string"&&(s+=`&${xQe}=${encodeURIComponent(r)}`),Rt.from({scheme:qv?this._preferredWebSchema:hn.vscodeRemoteResource,authority:`${n}:${o}`,path:this._remoteResourcesPath,query:s})}}const t0e=new LQe;class FD{uriToBrowserUri(e){return e.scheme===hn.vscodeRemote?t0e.rewrite(e):e.scheme===hn.file&&(Fd||bXe&&ku.origin===`${hn.vscodeFileResource}://${FD.FALLBACK_AUTHORITY}`)?e.with({scheme:hn.vscodeFileResource,authority:e.authority||FD.FALLBACK_AUTHORITY,query:null,fragment:null}):e}}FD.FALLBACK_AUTHORITY="vscode-app";const n0e=new FD;var Coe;(function(i){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"}]]);i.CoopAndCoep=Object.freeze(e.get("3"));const t="vscode-coi";function n(r){let s;typeof r=="string"?s=new URL(r).searchParams:r instanceof URL?s=r.searchParams:Rt.isUri(r)&&(s=new URL(r.toString(!0)).searchParams);const a=s==null?void 0:s.get(t);if(!!a)return e.get(a)}i.getHeadersFromQuery=n;function o(r,s,a){if(!globalThis.crossOriginIsolated)return;const l=s&&a?"3":a?"2":"1";r instanceof URLSearchParams?r.set(t,l):r[t]=l}i.addSearchParam=o})(Coe||(Coe={}));const{registerWindow:bNt,getWindows:EQe,onDidCreateWindow:CNt}=function(){const i=[],e=new le;return{onDidCreateWindow:e.event,registerWindow(t){i.push(t);const n=new Be;return n.add(zt(()=>{const o=i.indexOf(t);o!==-1&&i.splice(o,1)})),e.fire({window:t,disposableStore:n}),n},getWindows(){return i}}}();function Ur(i){for(;i.firstChild;)i.firstChild.remove()}function Zq(i){var e;return(e=i==null?void 0:i.isConnected)!==null&&e!==void 0?e:!1}class DQe{constructor(e,t,n,o){this._node=e,this._type=t,this._handler=n,this._options=o||!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 ke(i,e,t,n){return new DQe(i,e,t,n)}function i0e(i){return function(e){return i(new Dc(e))}}function kQe(i){return function(e){return i(new Pi(e))}}const No=function(e,t,n,o){let r=n;return t==="click"||t==="mousedown"?r=i0e(n):(t==="keydown"||t==="keypress"||t==="keyup")&&(r=kQe(n)),ke(e,t,r,o)},IQe=function(e,t,n){const o=i0e(t);return TQe(e,o,n)};function TQe(i,e,t){return ke(i,jd&&Yq.pointerEvents?et.POINTER_DOWN:et.MOUSE_DOWN,e,t)}let zA,Fc;class W6{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){en(e)}}static sort(e,t){return t.priority-e.priority}}(function(){let i=[],e=null,t=!1,n=!1;const o=()=>{for(t=!1,e=i,i=[],n=!0;e.length>0;)e.sort(W6.sort),e.shift().execute();n=!1};Fc=(r,s=0)=>{const a=new W6(r,s);return i.push(a),t||(t=!0,requestAnimationFrame(o)),a},zA=(r,s)=>{if(n){const a=new W6(r,s);return e.push(a),a}else return Fc(r,s)}})();function Z4(i){return i.ownerDocument.defaultView.getComputedStyle(i,null)}function mS(i){var e;const t=i.ownerDocument,n=(e=t.defaultView)===null||e===void 0?void 0:e.window;if(i!==t.body)return new jn(i.clientWidth,i.clientHeight);if(jd&&(n==null?void 0:n.visualViewport))return new jn(n.visualViewport.width,n.visualViewport.height);if((n==null?void 0:n.innerWidth)&&n.innerHeight)return new jn(n.innerWidth,n.innerHeight);if(t.body&&t.body.clientWidth&&t.body.clientHeight)return new jn(t.body.clientWidth,t.body.clientHeight);if(t.documentElement&&t.documentElement.clientWidth&&t.documentElement.clientHeight)return new jn(t.documentElement.clientWidth,t.documentElement.clientHeight);throw new Error("Unable to figure out browser width and height")}class yo{static convertToPixels(e,t){return parseFloat(t)||0}static getDimension(e,t,n){const o=Z4(e),r=o?o.getPropertyValue(t):"0";return yo.convertToPixels(e,r)}static getBorderLeftWidth(e){return yo.getDimension(e,"border-left-width","borderLeftWidth")}static getBorderRightWidth(e){return yo.getDimension(e,"border-right-width","borderRightWidth")}static getBorderTopWidth(e){return yo.getDimension(e,"border-top-width","borderTopWidth")}static getBorderBottomWidth(e){return yo.getDimension(e,"border-bottom-width","borderBottomWidth")}static getPaddingLeft(e){return yo.getDimension(e,"padding-left","paddingLeft")}static getPaddingRight(e){return yo.getDimension(e,"padding-right","paddingRight")}static getPaddingTop(e){return yo.getDimension(e,"padding-top","paddingTop")}static getPaddingBottom(e){return yo.getDimension(e,"padding-bottom","paddingBottom")}static getMarginLeft(e){return yo.getDimension(e,"margin-left","marginLeft")}static getMarginTop(e){return yo.getDimension(e,"margin-top","marginTop")}static getMarginRight(e){return yo.getDimension(e,"margin-right","marginRight")}static getMarginBottom(e){return yo.getDimension(e,"margin-bottom","marginBottom")}}class jn{constructor(e,t){this.width=e,this.height=t}with(e=this.width,t=this.height){return e!==this.width||t!==this.height?new jn(e,t):this}static is(e){return typeof e=="object"&&typeof e.height=="number"&&typeof e.width=="number"}static lift(e){return e instanceof jn?e:new jn(e.width,e.height)}static equals(e,t){return e===t?!0:!e||!t?!1:e.width===t.width&&e.height===t.height}}jn.None=new jn(0,0);function o0e(i){let e=i.offsetParent,t=i.offsetTop,n=i.offsetLeft;for(;(i=i.parentNode)!==null&&i!==i.ownerDocument.body&&i!==i.ownerDocument.documentElement;){t-=i.scrollTop;const o=r0e(i)?null:Z4(i);o&&(n-=o.direction!=="rtl"?i.scrollLeft:-i.scrollLeft),i===e&&(n+=yo.getBorderLeftWidth(i),t+=yo.getBorderTopWidth(i),t+=i.offsetTop,n+=i.offsetLeft,e=i.offsetParent)}return{left:n,top:t}}function NQe(i,e,t){typeof e=="number"&&(i.style.width=`${e}px`),typeof t=="number"&&(i.style.height=`${t}px`)}function Yo(i){var e,t,n,o;const r=i.getBoundingClientRect();return{left:r.left+((t=(e=i.ownerDocument.defaultView)===null||e===void 0?void 0:e.scrollX)!==null&&t!==void 0?t:0),top:r.top+((o=(n=i.ownerDocument.defaultView)===null||n===void 0?void 0:n.scrollY)!==null&&o!==void 0?o:0),width:r.width,height:r.height}}function RQe(i){let e=i,t=1;do{const n=Z4(e).zoom;n!=null&&n!=="1"&&(t*=n),e=e.parentElement}while(e!==null&&e!==e.ownerDocument.documentElement);return t}function La(i){const e=yo.getMarginLeft(i)+yo.getMarginRight(i);return i.offsetWidth+e}function V6(i){const e=yo.getBorderLeftWidth(i)+yo.getBorderRightWidth(i),t=yo.getPaddingLeft(i)+yo.getPaddingRight(i);return i.offsetWidth-e-t}function MQe(i){const e=yo.getBorderTopWidth(i)+yo.getBorderBottomWidth(i),t=yo.getPaddingTop(i)+yo.getPaddingBottom(i);return i.offsetHeight-e-t}function c0(i){const e=yo.getMarginTop(i)+yo.getMarginBottom(i);return i.offsetHeight+e}function os(i,e){for(;i;){if(i===e)return!0;i=i.parentNode}return!1}function AQe(i,e,t){for(;i&&i.nodeType===i.ELEMENT_NODE;){if(i.classList.contains(e))return i;if(t){if(typeof t=="string"){if(i.classList.contains(t))return null}else if(i===t)return null}i=i.parentNode}return null}function H6(i,e,t){return!!AQe(i,e,t)}function r0e(i){return i&&!!i.host&&!!i.mode}function UA(i){return!!J0(i)}function J0(i){for(var e;i.parentNode;){if(i===((e=i.ownerDocument)===null||e===void 0?void 0:e.body))return null;i=i.parentNode}return r0e(i)?i:null}function Tu(){let i=Q4().activeElement;for(;i!=null&&i.shadowRoot;)i=i.shadowRoot.activeElement;return i}function Q4(){var i;return(i=[document,...EQe().map(t=>t.document)].find(t=>t.hasFocus()))!==null&&i!==void 0?i:document}function Bc(i=document.getElementsByTagName("head")[0],e){const t=document.createElement("style");return t.type="text/css",t.media="screen",e==null||e(t),i.appendChild(t),t}let $6=null;function s0e(){return $6||($6=Bc()),$6}function PQe(i){var e,t;return!((e=i==null?void 0:i.sheet)===null||e===void 0)&&e.rules?i.sheet.rules:!((t=i==null?void 0:i.sheet)===null||t===void 0)&&t.cssRules?i.sheet.cssRules:[]}function UV(i,e,t=s0e()){!t||!e||t.sheet.insertRule(i+"{"+e+"}",0)}function woe(i,e=s0e()){if(!e)return;const t=PQe(e),n=[];for(let o=0;o=0;o--)e.sheet.deleteRule(n[o])}function Qq(i){return typeof HTMLElement=="object"?i instanceof HTMLElement:i&&typeof i=="object"&&i.nodeType===1&&typeof i.nodeName=="string"}const et={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",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:x0?"webkitAnimationStart":"animationstart",ANIMATION_END:x0?"webkitAnimationEnd":"animationend",ANIMATION_ITERATION:x0?"webkitAnimationIteration":"animationiteration"};function OQe(i){const e=i;return!!(e&&typeof e.preventDefault=="function"&&typeof e.stopPropagation=="function")}const dn={stop:(i,e)=>(i.preventDefault(),e&&i.stopPropagation(),i)};function FQe(i){const e=[];for(let t=0;i&&i.nodeType===i.ELEMENT_NODE;t++)e[t]=i.scrollTop,i=i.parentNode;return e}function BQe(i,e){for(let t=0;i&&i.nodeType===i.ELEMENT_NODE;t++)i.scrollTop!==e[t]&&(i.scrollTop=e[t]),i=i.parentNode}class jA extends _e{static hasFocusWithin(e){if(Qq(e)){const t=J0(e),n=t?t.activeElement:e.ownerDocument.activeElement;return os(n,e)}else return os(window.document.activeElement,window.document)}constructor(e){super(),this._onDidFocus=this._register(new le),this.onDidFocus=this._onDidFocus.event,this._onDidBlur=this._register(new le),this.onDidBlur=this._onDidBlur.event;let t=jA.hasFocusWithin(e),n=!1;const o=()=>{n=!1,t||(t=!0,this._onDidFocus.fire())},r=()=>{t&&(n=!0,window.setTimeout(()=>{n&&(n=!1,t=!1,this._onDidBlur.fire())},0))};this._refreshStateHandler=()=>{jA.hasFocusWithin(e)!==t&&(t?r():o())},this._register(ke(e,et.FOCUS,o,!0)),this._register(ke(e,et.BLUR,r,!0)),e instanceof HTMLElement&&(this._register(ke(e,et.FOCUS_IN,()=>this._refreshStateHandler())),this._register(ke(e,et.FOCUS_OUT,()=>this._refreshStateHandler())))}}function gf(i){return new jA(i)}function Ae(i,...e){if(i.append(...e),e.length===1&&typeof e[0]!="string")return e[0]}function a0e(i,e){return i.insertBefore(e,i.firstChild),e}function jr(i,...e){i.innerText="",Ae(i,...e)}const WQe=/([\w\-]+)?(#([\w\-]+))?((\.([\w\-]+))*)/;var BD;(function(i){i.HTML="http://www.w3.org/1999/xhtml",i.SVG="http://www.w3.org/2000/svg"})(BD||(BD={}));function l0e(i,e,t,...n){const o=WQe.exec(e);if(!o)throw new Error("Bad use of emmet");const r=o[1]||"div";let s;return i!==BD.HTML?s=document.createElementNS(i,r):s=document.createElement(r),o[3]&&(s.id=o[3]),o[4]&&(s.className=o[4].replace(/\./g," ").trim()),t&&Object.entries(t).forEach(([a,l])=>{typeof l!="undefined"&&(/^on\w+$/.test(a)?s[a]=l:a==="selected"?l&&s.setAttribute(a,"true"):s.setAttribute(a,l))}),s.append(...n),s}function He(i,e,...t){return l0e(BD.HTML,i,e,...t)}He.SVG=function(i,e,...t){return l0e(BD.SVG,i,e,...t)};function VQe(i,...e){i?tl(...e):Qs(...e)}function tl(...i){for(const e of i)e.style.display="",e.removeAttribute("aria-hidden")}function Qs(...i){for(const e of i)e.style.display="none",e.setAttribute("aria-hidden","true")}function yoe(i){const e=window.devicePixelRatio*i;return Math.max(1,Math.floor(e))/window.devicePixelRatio}function c0e(i){window.open(i,"_blank","noopener")}function HQe(i){const e=()=>{i(),t=Fc(e)};let t=Fc(e);return zt(()=>t.dispose())}t0e.setPreferredWebSchema(/^https:/.test(window.location.href)?"https":"http");function Cv(i){return i?`url('${n0e.uriToBrowserUri(i).toString(!0).replace(/'/g,"%27")}')`:"url('')"}function Soe(i){return`'${i.replace(/'/g,"%27")}'`}function E0(i,e){if(i!==void 0){const t=i.match(/^\s*var\((.+)\)$/);if(t){const n=t[1].split(",",2);return n.length===2&&(e=E0(n[1].trim(),e)),`var(${n[0]}, ${e})`}return i}return e}function $Qe(i,e=!1){const t=document.createElement("a");return J_e("afterSanitizeAttributes",n=>{for(const o of["href","src"])if(n.hasAttribute(o)){const r=n.getAttribute(o);if(o==="href"&&r.startsWith("#"))continue;if(t.href=r,!i.includes(t.protocol.replace(/:$/,""))){if(e&&o==="src"&&t.href.startsWith("data:"))continue;n.removeAttribute(o)}}}),zt(()=>{e0e("afterSanitizeAttributes")})}const zQe=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","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"]);Object.freeze({ALLOWED_TAGS:["a","button","blockquote","code","div","h1","h2","h3","h4","h5","h6","hr","input","label","li","p","pre","select","small","span","strong","textarea","ul","ol"],ALLOWED_ATTR:["href","data-href","data-command","target","title","name","src","alt","class","id","role","tabindex","style","data-code","width","height","align","x-dispatch","required","checked","placeholder","type","start"],RETURN_DOM:!1,RETURN_DOM_FRAGMENT:!1,RETURN_TRUSTED_TYPE:!0});class Ng extends le{constructor(){super(),this._subscriptions=new Be,this._keyStatus={altKey:!1,shiftKey:!1,ctrlKey:!1,metaKey:!1},this._subscriptions.add(ke(window,"keydown",e=>{if(e.defaultPrevented)return;const t=new Pi(e);if(!(t.keyCode===6&&e.repeat)){if(e.altKey&&!this._keyStatus.altKey)this._keyStatus.lastKeyPressed="alt";else if(e.ctrlKey&&!this._keyStatus.ctrlKey)this._keyStatus.lastKeyPressed="ctrl";else if(e.metaKey&&!this._keyStatus.metaKey)this._keyStatus.lastKeyPressed="meta";else if(e.shiftKey&&!this._keyStatus.shiftKey)this._keyStatus.lastKeyPressed="shift";else if(t.keyCode!==6)this._keyStatus.lastKeyPressed=void 0;else return;this._keyStatus.altKey=e.altKey,this._keyStatus.ctrlKey=e.ctrlKey,this._keyStatus.metaKey=e.metaKey,this._keyStatus.shiftKey=e.shiftKey,this._keyStatus.lastKeyPressed&&(this._keyStatus.event=e,this.fire(this._keyStatus))}},!0)),this._subscriptions.add(ke(window,"keyup",e=>{e.defaultPrevented||(!e.altKey&&this._keyStatus.altKey?this._keyStatus.lastKeyReleased="alt":!e.ctrlKey&&this._keyStatus.ctrlKey?this._keyStatus.lastKeyReleased="ctrl":!e.metaKey&&this._keyStatus.metaKey?this._keyStatus.lastKeyReleased="meta":!e.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=e.altKey,this._keyStatus.ctrlKey=e.ctrlKey,this._keyStatus.metaKey=e.metaKey,this._keyStatus.shiftKey=e.shiftKey,this._keyStatus.lastKeyReleased&&(this._keyStatus.event=e,this.fire(this._keyStatus)))},!0)),this._subscriptions.add(ke(document.body,"mousedown",()=>{this._keyStatus.lastKeyPressed=void 0},!0)),this._subscriptions.add(ke(document.body,"mouseup",()=>{this._keyStatus.lastKeyPressed=void 0},!0)),this._subscriptions.add(ke(document.body,"mousemove",e=>{e.buttons&&(this._keyStatus.lastKeyPressed=void 0)},!0)),this._subscriptions.add(ke(window,"blur",()=>{this.resetKeyStatus()}))}get keyStatus(){return this._keyStatus}resetKeyStatus(){this.doResetKeyStatus(),this.fire(this._keyStatus)}doResetKeyStatus(){this._keyStatus={altKey:!1,shiftKey:!1,ctrlKey:!1,metaKey:!1}}static getInstance(){return Ng.instance||(Ng.instance=new Ng),Ng.instance}dispose(){super.dispose(),this._subscriptions.dispose()}}class UQe extends _e{constructor(e,t){super(),this.element=e,this.callbacks=t,this.counter=0,this.dragStartTime=0,this.registerListeners()}registerListeners(){this._register(ke(this.element,et.DRAG_ENTER,e=>{this.counter++,this.dragStartTime=e.timeStamp,this.callbacks.onDragEnter(e)})),this._register(ke(this.element,et.DRAG_OVER,e=>{var t,n;e.preventDefault(),(n=(t=this.callbacks).onDragOver)===null||n===void 0||n.call(t,e,e.timeStamp-this.dragStartTime)})),this._register(ke(this.element,et.DRAG_LEAVE,e=>{this.counter--,this.counter===0&&(this.dragStartTime=0,this.callbacks.onDragLeave(e))})),this._register(ke(this.element,et.DRAG_END,e=>{this.counter=0,this.dragStartTime=0,this.callbacks.onDragEnd(e)})),this._register(ke(this.element,et.DROP,e=>{this.counter=0,this.dragStartTime=0,this.callbacks.onDrop(e)}))}}const jQe=/(?[\w\-]+)?(?:#(?[\w\-]+))?(?(?:\.(?:[\w\-]+))*)(?:@(?(?:[\w\_])+))?/;function Or(i,...e){let t,n;Array.isArray(e[0])?(t={},n=e[0]):(t=e[0]||{},n=e[1]);const o=jQe.exec(i);if(!o||!o.groups)throw new Error("Bad use of h");const r=o.groups.tag||"div",s=document.createElement(r);o.groups.id&&(s.id=o.groups.id);const a=[];if(o.groups.class)for(const c of o.groups.class.split("."))c!==""&&a.push(c);if(t.className!==void 0)for(const c of t.className.split("."))c!==""&&a.push(c);a.length>0&&(s.className=a.join(" "));const l={};if(o.groups.name&&(l[o.groups.name]=s),n)for(const c of n)c instanceof HTMLElement?s.appendChild(c):typeof c=="string"?s.append(c):"root"in c&&(Object.assign(l,c),s.appendChild(c.root));for(const[c,u]of Object.entries(t))if(c!=="className")if(c==="style")for(const[d,h]of Object.entries(u))s.style.setProperty(xoe(d),typeof h=="number"?h+"px":""+h);else c==="tabIndex"?s.tabIndex=u:s.setAttribute(xoe(c),u.toString());return l.root=s,l}function xoe(i){return i.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}class J4{constructor(e){this.id=e.id,this.precondition=e.precondition,this._kbOpts=e.kbOpts,this._menuOpts=e.menuOpts,this._description=e.description}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 n=t.kbExpr;this.precondition&&(n?n=Me.and(n,this.precondition):n=this.precondition);const o={id:this.id,weight:t.weight,args:t.args,when:n,primary:t.primary,secondary:t.secondary,win:t.win,linux:t.linux,mac:t.mac};Wa.registerKeybindingRule(o)}}Rn.registerCommand({id:this.id,handler:(e,t)=>this.runCommand(e,t),description:this._description})}_registerMenuItem(e){Hr.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 vS extends J4{constructor(){super(...arguments),this._implementations=[]}addImplementation(e,t,n,o){return this._implementations.push({priority:e,name:t,implementation:n,when:o}),this._implementations.sort((r,s)=>s.priority-r.priority),{dispose:()=>{for(let r=0;r{if(!!a.get(Ut).contextMatchesRules(n!=null?n:void 0))return o(a,s,t)})}runCommand(e,t){return Ir.runEditorCommand(e,t,this.precondition,(n,o,r)=>this.runEditorCommand(n,o,r))}}class ft extends Ir{static convertOptions(e){let t;Array.isArray(e.menuOpts)?t=e.menuOpts:e.menuOpts?t=[e.menuOpts]:t=[];function n(o){return o.menuId||(o.menuId=Z.EditorContext),o.title||(o.title=e.label),o.when=Me.and(e.precondition,o.when),o}return Array.isArray(e.contextMenuOpts)?t.push(...e.contextMenuOpts.map(n)):e.contextMenuOpts&&t.push(n(e.contextMenuOpts)),e.menuOpts=t,e}constructor(e){super(ft.convertOptions(e)),this.label=e.label,this.alias=e.alias}runEditorCommand(e,t,n){return this.reportTelemetry(e,t),this.run(e,t,n||{})}reportTelemetry(e,t){e.get(ec).publicLog2("editorActionInvoked",{name:this.label,id:this.id})}}class d0e extends ft{constructor(){super(...arguments),this._implementations=[]}addImplementation(e,t){return this._implementations.push([e,t]),this._implementations.sort((n,o)=>o[0]-n[0]),{dispose:()=>{for(let n=0;n{var s,a;const l=r.get(Ut),c=r.get(tc);if(!l.contextMatchesRules((s=this.desc.precondition)!==null&&s!==void 0?s:void 0)){c.debug("[EditorAction2] NOT running command because its precondition is FALSE",this.desc.id,(a=this.desc.precondition)===null||a===void 0?void 0:a.serialize());return}return this.runEditorCommand(r,o,...t)})}}function Nf(i,e){Rn.registerCommand(i,function(t,...n){const o=t.get($t),[r,s]=n;fi(Rt.isUri(r)),fi(ae.isIPosition(s));const a=t.get(Yi).getModel(r);if(a){const l=ae.lift(s);return o.invokeFunction(e,a,l,...n.slice(2))}return t.get($a).createModelReference(r).then(l=>new Promise((c,u)=>{try{const d=o.invokeFunction(e,l.object.textEditorModel,ae.lift(s),n.slice(2));c(d)}catch(d){u(d)}}).finally(()=>{l.dispose()}))})}function Ye(i){return xc.INSTANCE.registerEditorCommand(i),i}function ze(i){const e=new i;return xc.INSTANCE.registerEditorAction(e),e}function h0e(i){return xc.INSTANCE.registerEditorAction(i),i}function KQe(i){xc.INSTANCE.registerEditorAction(i)}function zn(i,e,t){xc.INSTANCE.registerEditorContribution(i,e,t)}var vw;(function(i){function e(s){return xc.INSTANCE.getEditorCommand(s)}i.getEditorCommand=e;function t(){return xc.INSTANCE.getEditorActions()}i.getEditorActions=t;function n(){return xc.INSTANCE.getEditorContributions()}i.getEditorContributions=n;function o(s){return xc.INSTANCE.getEditorContributions().filter(a=>s.indexOf(a.id)>=0)}i.getSomeEditorContributions=o;function r(){return xc.INSTANCE.getDiffEditorContributions()}i.getDiffEditorContributions=r})(vw||(vw={}));const qQe={EditorCommonContributions:"editor.contributions"};class xc{constructor(){this.editorContributions=[],this.diffEditorContributions=[],this.editorActions=[],this.editorCommands=Object.create(null)}registerEditorContribution(e,t,n){this.editorContributions.push({id:e,ctor:t,instantiation:n})}getEditorContributions(){return this.editorContributions.slice(0)}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}}xc.INSTANCE=new xc;no.add(qQe.EditorCommonContributions,xc.INSTANCE);function WI(i){return i.register(),i}const f0e=WI(new vS({id:"undo",precondition:void 0,kbOpts:{weight:0,primary:2104},menuOpts:[{menuId:Z.MenubarEditMenu,group:"1_do",title:C({key:"miUndo",comment:["&& denotes a mnemonic"]},"&&Undo"),order:1},{menuId:Z.CommandPalette,group:"",title:C("undo","Undo"),order:1}]}));WI(new u0e(f0e,{id:"default:undo",precondition:void 0}));const g0e=WI(new vS({id:"redo",precondition:void 0,kbOpts:{weight:0,primary:2103,secondary:[3128],mac:{primary:3128}},menuOpts:[{menuId:Z.MenubarEditMenu,group:"1_do",title:C({key:"miRedo",comment:["&& denotes a mnemonic"]},"&&Redo"),order:2},{menuId:Z.CommandPalette,group:"",title:C("redo","Redo"),order:1}]}));WI(new u0e(g0e,{id:"default:redo",precondition:void 0}));const GQe=WI(new vS({id:"editor.action.selectAll",precondition:void 0,kbOpts:{weight:0,kbExpr:null,primary:2079},menuOpts:[{menuId:Z.MenubarSelectionMenu,group:"1_basic",title:C({key:"miSelectAll",comment:["&& denotes a mnemonic"]},"&&Select All"),order:1},{menuId:Z.CommandPalette,group:"",title:C("selectAll","Select All"),order:1}]})),p0e=Symbol("MicrotaskDelay");var mc=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},mL=globalThis&&globalThis.__asyncValues||function(i){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=i[Symbol.asyncIterator],t;return e?e.call(i):(i=typeof __values=="function"?__values(i):i[Symbol.iterator](),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(r){t[r]=i[r]&&function(s){return new Promise(function(a,l){s=i[r](s),o(a,l,s.done,s.value)})}}function o(r,s,a,l){Promise.resolve(l).then(function(c){r({value:c,done:a})},s)}};function jV(i){return!!i&&typeof i.then=="function"}function sr(i){const e=new Ro,t=i(e.token),n=new Promise((o,r)=>{const s=e.token.onCancellationRequested(()=>{s.dispose(),e.dispose(),r(new Gv)});Promise.resolve(t).then(a=>{s.dispose(),e.dispose(),o(a)},a=>{s.dispose(),e.dispose(),r(a)})});return new class{cancel(){e.cancel()}then(o,r){return n.then(o,r)}catch(o){return this.then(void 0,o)}finally(o){return n.finally(o)}}}function e5(i,e,t){return new Promise((n,o)=>{const r=e.onCancellationRequested(()=>{r.dispose(),n(t)});i.then(n,o).finally(()=>r.dispose())})}class XQe{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 n=this.queue(this.queuedPromiseFactory);return this.queuedPromiseFactory=null,n};this.queuedPromise=new Promise(n=>{this.activePromise.then(t,t).then(n)})}return new Promise((t,n)=>{this.queuedPromise.then(t,n)})}return this.activePromise=e(),new Promise((t,n)=>{this.activePromise.then(o=>{this.activePromise=null,t(o)},o=>{this.activePromise=null,n(o)})})}dispose(){this.isDisposed=!0}}const YQe=(i,e)=>{let t=!0;const n=setTimeout(()=>{t=!1,e()},i);return{isTriggered:()=>t,dispose:()=>{clearTimeout(n),t=!1}}},ZQe=i=>{let e=!0;return queueMicrotask(()=>{e&&(e=!1,i())}),{isTriggered:()=>e,dispose:()=>{e=!1}}};class Bu{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((o,r)=>{this.doResolve=o,this.doReject=r}).then(()=>{if(this.completionPromise=null,this.doResolve=null,this.task){const o=this.task;return this.task=null,o()}}));const n=()=>{var o;this.deferred=null,(o=this.doResolve)===null||o===void 0||o.call(this,null)};return this.deferred=t===p0e?ZQe(n):YQe(t,n),this.completionPromise}isTriggered(){var e;return!!(!((e=this.deferred)===null||e===void 0)&&e.isTriggered())}cancel(){var e;this.cancelTimeout(),this.completionPromise&&((e=this.doReject)===null||e===void 0||e.call(this,new Gv),this.completionPromise=null)}cancelTimeout(){var e;(e=this.deferred)===null||e===void 0||e.dispose(),this.deferred=null}dispose(){this.cancel()}}class m0e{constructor(e){this.delayer=new Bu(e),this.throttler=new XQe}trigger(e,t){return this.delayer.trigger(()=>this.throttler.queue(e),t)}cancel(){this.delayer.cancel()}dispose(){this.delayer.dispose(),this.throttler.dispose()}}function wv(i,e){return e?new Promise((t,n)=>{const o=setTimeout(()=>{r.dispose(),t()},i),r=e.onCancellationRequested(()=>{clearTimeout(o),r.dispose(),n(new Gv)})}):sr(t=>wv(i,t))}function yv(i,e=0,t){const n=setTimeout(()=>{i(),t&&o.dispose()},e),o=zt(()=>{clearTimeout(n),t==null||t.deleteAndLeak(o)});return t==null||t.add(o),o}function v0e(i,e=n=>!!n,t=null){let n=0;const o=i.length,r=()=>{if(n>=o)return Promise.resolve(t);const s=i[n++];return Promise.resolve(s()).then(l=>e(l)?Promise.resolve(l):r())};return r()}class $u{constructor(e,t){this._token=-1,typeof e=="function"&&typeof t=="number"&&this.setIfNotSet(e,t)}dispose(){this.cancel()}cancel(){this._token!==-1&&(clearTimeout(this._token),this._token=-1)}cancelAndSet(e,t){this.cancel(),this._token=setTimeout(()=>{this._token=-1,e()},t)}setIfNotSet(e,t){this._token===-1&&(this._token=setTimeout(()=>{this._token=-1,e()},t))}}class VI{constructor(){this._token=-1}dispose(){this.cancel()}cancel(){this._token!==-1&&(clearInterval(this._token),this._token=-1)}cancelAndSet(e,t){this.cancel(),this._token=setInterval(()=>{e()},t)}}class bi{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}onTimeout(){this.timeoutToken=-1,this.runner&&this.doRun()}doRun(){var e;(e=this.runner)===null||e===void 0||e.call(this)}}let Rg;(function(){typeof requestIdleCallback!="function"||typeof cancelIdleCallback!="function"?Rg=i=>{l_e(()=>{if(e)return;const t=Date.now()+15;i(Object.freeze({didTimeout:!0,timeRemaining(){return Math.max(0,t-Date.now())}}))});let e=!1;return{dispose(){e||(e=!0)}}}:Rg=(i,e)=>{const t=requestIdleCallback(i,typeof e=="number"?{timeout:e}:void 0);let n=!1;return{dispose(){n||(n=!0,cancelIdleCallback(t))}}}})();class JR{constructor(e){this._didRun=!1,this._executor=()=>{try{this._value=e()}catch(t){this._error=t}finally{this._didRun=!0}},this._handle=Rg(()=>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 t5{get isRejected(){var e;return((e=this.outcome)===null||e===void 0?void 0:e.outcome)===1}get isSettled(){return!!this.outcome}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:0,value:e},t()})}error(e){return new Promise(t=>{this.errorCallback(e),this.outcome={outcome:1,value:e},t()})}cancel(){return this.error(new Gv)}}var KV;(function(i){function e(n){return mc(this,void 0,void 0,function*(){let o;const r=yield Promise.all(n.map(s=>s.then(a=>a,a=>{o||(o=a)})));if(typeof o!="undefined")throw o;return r})}i.settled=e;function t(n){return new Promise((o,r)=>mc(this,void 0,void 0,function*(){try{yield n(o,r)}catch(s){r(s)}}))}i.withAsyncBody=t})(KV||(KV={}));class Wo{static fromArray(e){return new Wo(t=>{t.emitMany(e)})}static fromPromise(e){return new Wo(t=>mc(this,void 0,void 0,function*(){t.emitMany(yield e)}))}static fromPromises(e){return new Wo(t=>mc(this,void 0,void 0,function*(){yield Promise.all(e.map(n=>mc(this,void 0,void 0,function*(){return t.emitOne(yield n)})))}))}static merge(e){return new Wo(t=>mc(this,void 0,void 0,function*(){yield Promise.all(e.map(n=>{var o,r,s;return mc(this,void 0,void 0,function*(){var a,l,c,u;try{for(o=!0,r=mL(n);s=yield r.next(),a=s.done,!a;o=!0){u=s.value,o=!1;const d=u;t.emitOne(d)}}catch(d){l={error:d}}finally{try{!o&&!a&&(c=r.return)&&(yield c.call(r))}finally{if(l)throw l.error}}})}))}))}constructor(e){this._state=0,this._results=[],this._error=null,this._onStateChanged=new le,queueMicrotask(()=>mc(this,void 0,void 0,function*(){const t={emitOne:n=>this.emitOne(n),emitMany:n=>this.emitMany(n),reject:n=>this.reject(n)};try{yield Promise.resolve(e(t)),this.resolve()}catch(n){this.reject(n)}finally{t.emitOne=void 0,t.emitMany=void 0,t.reject=void 0}}))}[Symbol.asyncIterator](){let e=0;return{next:()=>mc(this,void 0,void 0,function*(){do{if(this._state===2)throw this._error;if(emc(this,void 0,void 0,function*(){var o,r,s,a;try{for(var l=!0,c=mL(e),u;u=yield c.next(),o=u.done,!o;l=!0){a=u.value,l=!1;const d=a;n.emitOne(t(d))}}catch(d){r={error:d}}finally{try{!l&&!o&&(s=c.return)&&(yield s.call(c))}finally{if(r)throw r.error}}}))}map(e){return Wo.map(this,e)}static filter(e,t){return new Wo(n=>mc(this,void 0,void 0,function*(){var o,r,s,a;try{for(var l=!0,c=mL(e),u;u=yield c.next(),o=u.done,!o;l=!0){a=u.value,l=!1;const d=a;t(d)&&n.emitOne(d)}}catch(d){r={error:d}}finally{try{!l&&!o&&(s=c.return)&&(yield s.call(c))}finally{if(r)throw r.error}}}))}filter(e){return Wo.filter(this,e)}static coalesce(e){return Wo.filter(e,t=>!!t)}coalesce(){return Wo.coalesce(this)}static toPromise(e){var t,n,o,r,s,a,l;return mc(this,void 0,void 0,function*(){const c=[];try{for(t=!0,n=mL(e);o=yield n.next(),r=o.done,!r;t=!0){l=o.value,t=!1;const u=l;c.push(u)}}catch(u){s={error:u}}finally{try{!t&&!r&&(a=n.return)&&(yield a.call(n))}finally{if(s)throw s.error}}return c})}toPromise(){return Wo.toPromise(this)}emitOne(e){this._state===0&&(this._results.push(e),this._onStateChanged.fire())}emitMany(e){this._state===0&&(this._results=this._results.concat(e),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(e){this._state===0&&(this._state=2,this._error=e,this._onStateChanged.fire())}}Wo.EMPTY=Wo.fromArray([]);class QQe extends Wo{constructor(e,t){super(t),this._source=e}cancel(){this._source.cancel()}}function JQe(i){const e=new Ro,t=i(e.token);return new QQe(e,n=>mc(this,void 0,void 0,function*(){var o,r,s,a;const l=e.token.onCancellationRequested(()=>{l.dispose(),e.dispose(),n.reject(new Gv)});try{try{for(var c=!0,u=mL(t),d;d=yield u.next(),o=d.done,!o;c=!0){a=d.value,c=!1;const h=a;if(e.token.isCancellationRequested)return;n.emitOne(h)}}catch(h){r={error:h}}finally{try{!c&&!o&&(s=u.return)&&(yield s.call(u))}finally{if(r)throw r.error}}l.dispose(),e.dispose()}catch(h){l.dispose(),e.dispose(),n.reject(h)}}))}const eJe="$initialize";let Loe=!1;function qV(i){!qv||(Loe||(Loe=!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(i.message))}class tJe{constructor(e,t,n,o){this.vsWorker=e,this.req=t,this.method=n,this.args=o,this.type=0}}class Eoe{constructor(e,t,n,o){this.vsWorker=e,this.seq=t,this.res=n,this.err=o,this.type=1}}class nJe{constructor(e,t,n,o){this.vsWorker=e,this.req=t,this.eventName=n,this.arg=o,this.type=2}}class iJe{constructor(e,t,n){this.vsWorker=e,this.req=t,this.event=n,this.type=3}}class oJe{constructor(e,t){this.vsWorker=e,this.req=t,this.type=4}}class rJe{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 n=String(++this._lastSentReq);return new Promise((o,r)=>{this._pendingReplies[n]={resolve:o,reject:r},this._send(new tJe(this._workerId,n,e,t))})}listen(e,t){let n=null;const o=new le({onWillAddFirstListener:()=>{n=String(++this._lastSentReq),this._pendingEmitters.set(n,o),this._send(new nJe(this._workerId,n,e,t))},onDidRemoveLastListener:()=>{this._pendingEmitters.delete(n),this._send(new oJe(this._workerId,n)),n=null}});return o.event}handleMessage(e){!e||!e.vsWorker||this._workerId!==-1&&e.vsWorker!==this._workerId||this._handleMessage(e)}_handleMessage(e){switch(e.type){case 1:return this._handleReplyMessage(e);case 0:return this._handleRequestMessage(e);case 2:return this._handleSubscribeEventMessage(e);case 3:return this._handleEventMessage(e);case 4: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 n=e.err;e.err.$isError&&(n=new Error,n.name=e.err.name,n.message=e.err.message,n.stack=e.err.stack),t.reject(n);return}t.resolve(e.res)}_handleRequestMessage(e){const t=e.req;this._handler.handleMessage(e.method,e.args).then(o=>{this._send(new Eoe(this._workerId,t,o,void 0))},o=>{o.detail instanceof Error&&(o.detail=eoe(o.detail)),this._send(new Eoe(this._workerId,t,void 0,eoe(o)))})}_handleSubscribeEventMessage(e){const t=e.req,n=this._handler.handleEvent(e.eventName,e.arg)(o=>{this._send(new iJe(this._workerId,t,o))});this._pendingEvents.set(t,n)}_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===0)for(let n=0;n{this._protocol.handleMessage(u)},u=>{o==null||o(u)})),this._protocol=new rJe({sendMessage:(u,d)=>{this._worker.postMessage(u,d)},handleMessage:(u,d)=>{if(typeof n[u]!="function")return Promise.reject(new Error("Missing method "+u+" on main thread host."));try{return Promise.resolve(n[u].apply(n,d))}catch(h){return Promise.reject(h)}},handleEvent:(u,d)=>{if(b0e(u)){const h=n[u].call(n,d);if(typeof h!="function")throw new Error(`Missing dynamic event ${u} on main thread host.`);return h}if(_0e(u)){const h=n[u];if(typeof h!="function")throw new Error(`Missing event ${u} on main thread host.`);return h}throw new Error(`Malformed event name ${u}`)}}),this._protocol.setWorkerId(this._worker.getId());let r=null;const s=globalThis.require;typeof s!="undefined"&&typeof s.getConfig=="function"?r=s.getConfig():typeof globalThis.requirejs!="undefined"&&(r=globalThis.requirejs.s.contexts._.config);const a=Dq(n);this._onModuleLoaded=this._protocol.sendMessage(eJe,[this._worker.getId(),JSON.parse(JSON.stringify(r)),t,a]);const l=(u,d)=>this._request(u,d),c=(u,d)=>this._protocol.listen(u,d);this._lazyProxy=new Promise((u,d)=>{o=d,this._onModuleLoaded.then(h=>{u(aJe(h,l,c))},h=>{d(h),this._onError("Worker failed to load "+t,h)})})}getProxyObject(){return this._lazyProxy}_request(e,t){return new Promise((n,o)=>{this._onModuleLoaded.then(()=>{this._protocol.sendMessage(e,t).then(n,o)},o)})}_onError(e,t){console.error(e),console.info(t)}}function _0e(i){return i[0]==="o"&&i[1]==="n"&&Eh(i.charCodeAt(2))}function b0e(i){return/^onDynamic/.test(i)&&Eh(i.charCodeAt(9))}function aJe(i,e,t){const n=s=>function(){const a=Array.prototype.slice.call(arguments,0);return e(s,a)},o=s=>function(a){return t(s,a)},r={};for(const s of i){if(b0e(s)){r[s]=o(s);continue}if(_0e(s)){r[s]=t(s,void 0);continue}r[s]=n(s)}return r}function gp(i,e){var t;const n=globalThis.MonacoEnvironment;if(n!=null&&n.createTrustedTypesPolicy)try{return n.createTrustedTypesPolicy(i,e)}catch(o){en(o);return}try{return(t=window.trustedTypes)===null||t===void 0?void 0:t.createPolicy(i,e)}catch(o){en(o);return}}const Doe=gp("defaultWorkerFactory",{createScriptURL:i=>i});function lJe(i){const e=globalThis.MonacoEnvironment;if(e){if(typeof e.getWorker=="function")return e.getWorker("workerMain.js",i);if(typeof e.getWorkerUrl=="function"){const t=e.getWorkerUrl("workerMain.js",i);return new Worker(Doe?Doe.createScriptURL(t):t,{name:i})}}throw new Error("You must define a function MonacoEnvironment.getWorkerUrl or MonacoEnvironment.getWorker")}function cJe(i){return typeof i.then=="function"}class uJe{constructor(e,t,n,o,r){this.id=t,this.label=n;const s=lJe(n);cJe(s)?this.worker=s:this.worker=Promise.resolve(s),this.postMessage(e,[]),this.worker.then(a=>{a.onmessage=function(l){o(l.data)},a.onmessageerror=r,typeof a.addEventListener=="function"&&a.addEventListener("error",r)})}getId(){return this.id}postMessage(e,t){var n;(n=this.worker)===null||n===void 0||n.then(o=>{try{o.postMessage(e,t)}catch(r){en(r),en(new Error(`FAILED to post message to '${this.label}'-worker`,{cause:r}))}})}dispose(){var e;(e=this.worker)===null||e===void 0||e.then(t=>t.terminate()),this.worker=null}}class n5{constructor(e){this._label=e,this._webWorkerFailedBeforeError=!1}create(e,t,n){const o=++n5.LAST_WORKER_ID;if(this._webWorkerFailedBeforeError)throw this._webWorkerFailedBeforeError;return new uJe(e,o,this._label||"anonymous"+o,t,r=>{qV(r),this._webWorkerFailedBeforeError=r,n(r)})}}n5.LAST_WORKER_ID=0;var Ho;(function(i){i[i.None=0]="None",i[i.Indent=1]="Indent",i[i.IndentOutdent=2]="IndentOutdent",i[i.Outdent=3]="Outdent"})(Ho||(Ho={}));class z6{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,n=e.notIn.length;t0&&i.getLanguageId(s-1)===o;)s--;return new hJe(i,o,s,r+1,i.getStartOffset(s),i.getEndOffset(r))}class hJe{constructor(e,t,n,o,r,s){this._scopedLineTokensBrand=void 0,this._actual=e,this.languageId=t,this._firstTokenIndex=n,this._lastTokenIndex=o,this.firstCharOffset=r,this._lastCharOffset=s}getLineContent(){return this._actual.getLineContent().substring(this.firstCharOffset,this._lastCharOffset)}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)}}function _h(i){return(i&3)!==0}class my{constructor(e){if(e.autoClosingPairs?this._autoClosingPairs=e.autoClosingPairs.map(t=>new z6(t)):e.brackets?this._autoClosingPairs=e.brackets.map(t=>new z6({open:t[0],close:t[1]})):this._autoClosingPairs=[],e.__electricCharacterSupport&&e.__electricCharacterSupport.docComment){const t=e.__electricCharacterSupport.docComment;this._autoClosingPairs.push(new z6({open:t.open,close:t.close||""}))}this._autoCloseBeforeForQuotes=typeof e.autoCloseBefore=="string"?e.autoCloseBefore:my.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_QUOTES,this._autoCloseBeforeForBrackets=typeof e.autoCloseBefore=="string"?e.autoCloseBefore:my.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}}my.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_QUOTES=`;:.,=}])> - `;my.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_BRACKETS=`'"\`;:.,=}])> - `;const koe=typeof Buffer!="undefined";new rh(()=>new Uint8Array(256));let U6;class o5{static wrap(e){return koe&&!Buffer.isBuffer(e)&&(e=Buffer.from(e.buffer,e.byteOffset,e.byteLength)),new o5(e)}constructor(e){this.buffer=e,this.byteLength=this.buffer.byteLength}toString(){return koe?this.buffer.toString():(U6||(U6=new TextDecoder),U6.decode(this.buffer))}}function fJe(i,e){return i[e+0]<<0>>>0|i[e+1]<<8>>>0}function gJe(i,e,t){i[t+0]=e&255,e=e>>>8,i[t+1]=e&255}function ud(i,e){return i[e]*Math.pow(2,24)+i[e+1]*Math.pow(2,16)+i[e+2]*Math.pow(2,8)+i[e+3]}function dd(i,e,t){i[t+3]=e,e=e>>>8,i[t+2]=e,e=e>>>8,i[t+1]=e,e=e>>>8,i[t]=e}function Ioe(i,e){return i[e]}function Toe(i,e,t){i[t]=e}let j6;function C0e(){return j6||(j6=new TextDecoder("UTF-16LE")),j6}let K6;function pJe(){return K6||(K6=new TextDecoder("UTF-16BE")),K6}let q6;function w0e(){return q6||(q6=c_e()?C0e():pJe()),q6}function mJe(i,e,t){const n=new Uint16Array(i.buffer,e,t);return t>0&&(n[0]===65279||n[0]===65534)?vJe(i,e,t):C0e().decode(n)}function vJe(i,e,t){const n=[];let o=0;for(let r=0;r=this._capacity){this._flushBuffer(),this._completedStrings[this._completedStrings.length]=e;return}for(let n=0;n[s[0].toLowerCase(),s[1].toLowerCase()]);const t=[];for(let s=0;s{const[l,c]=s,[u,d]=a;return l===u||l===d||c===u||c===d},o=(s,a)=>{const l=Math.min(s,a),c=Math.max(s,a);for(let u=0;u0&&r.push({open:a,close:l})}return r}class bJe{constructor(e,t){this._richEditBracketsBrand=void 0;const n=_Je(t);this.brackets=n.map((o,r)=>new KA(e,r,o.open,o.close,CJe(o.open,o.close,n,r),wJe(o.open,o.close,n,r))),this.forwardRegex=yJe(this.brackets),this.reversedRegex=SJe(this.brackets),this.textIsBracket={},this.textIsOpenBracket={},this.maxBracketLength=0;for(const o of this.brackets){for(const r of o.open)this.textIsBracket[r]=o,this.textIsOpenBracket[r]=!0,this.maxBracketLength=Math.max(this.maxBracketLength,r.length);for(const r of o.close)this.textIsBracket[r]=o,this.textIsOpenBracket[r]=!1,this.maxBracketLength=Math.max(this.maxBracketLength,r.length)}}}function y0e(i,e,t,n){for(let o=0,r=e.length;o=0&&n.push(a);for(const a of s.close)a.indexOf(i)>=0&&n.push(a)}}function S0e(i,e){return i.length-e.length}function r5(i){if(i.length<=1)return i;const e=[],t=new Set;for(const n of i)t.has(n)||(e.push(n),t.add(n));return e}function CJe(i,e,t,n){let o=[];o=o.concat(i),o=o.concat(e);for(let r=0,s=o.length;r=0;s--)o[r++]=n.charCodeAt(s);return w0e().decode(o)}let e=null,t=null;return function(o){return e!==o&&(e=o,t=i(e)),t}}();class du{static _findPrevBracketInText(e,t,n,o){const r=n.match(e);if(!r)return null;const s=n.length-(r.index||0),a=r[0].length,l=o+s;return new V(t,l-a+1,t,l+1)}static findPrevBracketInRange(e,t,n,o,r){const a=Jq(n).substring(n.length-r,n.length-o);return this._findPrevBracketInText(e,t,a,o)}static findNextBracketInText(e,t,n,o){const r=n.match(e);if(!r)return null;const s=r.index||0,a=r[0].length;if(a===0)return null;const l=o+s;return new V(t,l+1,t,l+1+a)}static findNextBracketInRange(e,t,n,o,r){const s=n.substring(o,r);return this.findNextBracketInText(e,t,s,o)}}class LJe{constructor(e){this._richEditBrackets=e}getElectricCharacters(){const e=[];if(this._richEditBrackets)for(const t of this._richEditBrackets.brackets)for(const n of t.close){const o=n.charAt(n.length-1);e.push(o)}return mv(e)}onElectricCharacter(e,t,n){if(!this._richEditBrackets||this._richEditBrackets.brackets.length===0)return null;const o=t.findTokenIndexAtOffset(n-1);if(_h(t.getStandardTokenType(o)))return null;const r=this._richEditBrackets.reversedRegex,s=t.getLineContent().substring(0,n-1)+e,a=du.findPrevBracketInRange(r,1,s,0,s.length);if(!a)return null;const l=s.substring(a.startColumn-1,a.endColumn-1).toLowerCase();if(this._richEditBrackets.textIsOpenBracket[l])return null;const u=t.getActualLineContentBefore(a.startColumn-1);return/^\s*$/.test(u)?{matchOpenBracket:l}:null}}function i2(i){return i.global&&(i.lastIndex=0),!0}class EJe{constructor(e){this._indentationRules=e}shouldIncrease(e){return!!(this._indentationRules&&this._indentationRules.increaseIndentPattern&&i2(this._indentationRules.increaseIndentPattern)&&this._indentationRules.increaseIndentPattern.test(e))}shouldDecrease(e){return!!(this._indentationRules&&this._indentationRules.decreaseIndentPattern&&i2(this._indentationRules.decreaseIndentPattern)&&this._indentationRules.decreaseIndentPattern.test(e))}shouldIndentNextLine(e){return!!(this._indentationRules&&this._indentationRules.indentNextLinePattern&&i2(this._indentationRules.indentNextLinePattern)&&this._indentationRules.indentNextLinePattern.test(e))}shouldIgnore(e){return!!(this._indentationRules&&this._indentationRules.unIndentedLinePattern&&i2(this._indentationRules.unIndentedLinePattern)&&this._indentationRules.unIndentedLinePattern.test(e))}getIndentMetadata(e){let t=0;return this.shouldIncrease(e)&&(t+=1),this.shouldDecrease(e)&&(t+=2),this.shouldIndentNextLine(e)&&(t+=4),this.shouldIgnore(e)&&(t+=8),t}}class TC{constructor(e){e=e||{},e.brackets=e.brackets||[["(",")"],["{","}"],["[","]"]],this._brackets=[],e.brackets.forEach(t=>{const n=TC._createOpenBracketRegExp(t[0]),o=TC._createCloseBracketRegExp(t[1]);n&&o&&this._brackets.push({open:t[0],openRegExp:n,close:t[1],closeRegExp:o})}),this._regExpRules=e.onEnterRules||[]}onEnter(e,t,n,o){if(e>=3)for(let r=0,s=this._regExpRules.length;rc.reg?(c.reg.lastIndex=0,c.reg.test(c.text)):!0))return a.action}if(e>=2&&n.length>0&&o.length>0)for(let r=0,s=this._brackets.length;r=2&&n.length>0){for(let r=0,s=this._brackets.length;r0&&i.charAt(i.length-1)==="#"?i.substring(0,i.length-1):i}class TJe{constructor(){this._onDidChangeSchema=new le,this.schemasById={}}registerSchema(e,t){this.schemasById[IJe(e)]=t,this._onDidChangeSchema.fire(e)}notifySchemaChanged(e){this._onDidChangeSchema.fire(e)}}const NJe=new TJe;no.add(a5.JSONContribution,NJe);const ah={Configuration:"base.contributions.configuration"},Nx="vscode://schemas/settings/resourceLanguage",Moe=no.as(a5.JSONContribution);class RJe{constructor(){this.overrideIdentifiers=new Set,this._onDidSchemaChange=new le,this._onDidUpdateConfiguration=new le,this.configurationDefaultsOverrides=new Map,this.defaultLanguageConfigurationOverridesNode={id:"defaultOverrides",title:C("defaultLanguageConfigurationOverrides.title","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={},Moe.registerSchema(Nx,this.resourceLanguageSettingsSchema),this.registerOverridePropertyPatternKey()}registerConfiguration(e,t=!0){this.registerConfigurations([e],t)}registerConfigurations(e,t=!0){const n=new Set;this.doRegisterConfigurations(e,t,n),Moe.registerSchema(Nx,this.resourceLanguageSettingsSchema),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:n})}registerDefaultConfigurations(e){const t=new Set;this.doRegisterDefaultConfigurations(e,t),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:t,defaultsOverrides:!0})}doRegisterDefaultConfigurations(e,t){var n;const o=[];for(const{overrides:r,source:s}of e)for(const a in r)if(t.add(a),Sv.test(a)){const l=this.configurationDefaultsOverrides.get(a),c=(n=l==null?void 0:l.valuesSources)!==null&&n!==void 0?n:new Map;if(s)for(const f of Object.keys(r[a]))c.set(f,s);const u=Object.assign(Object.assign({},(l==null?void 0:l.value)||{}),r[a]);this.configurationDefaultsOverrides.set(a,{source:s,value:u,valuesSources:c});const d=kJe(a),h={type:"object",default:u,description:C("defaultLanguageConfiguration.description","Configure settings to be overridden for the {0} language.",d),$ref:Nx,defaultDefaultValue:u,source:aa(s)?void 0:s,defaultValueSource:s};o.push(...qA(a)),this.configurationProperties[a]=h,this.defaultLanguageConfigurationOverridesNode.properties[a]=h}else{this.configurationDefaultsOverrides.set(a,{value:r[a],source:s});const l=this.configurationProperties[a];l&&(this.updatePropertyDefaultValue(a,l),this.updateSchema(a,l))}this.doRegisterOverrideIdentifiers(o)}registerOverrideIdentifiers(e){this.doRegisterOverrideIdentifiers(e),this._onDidSchemaChange.fire()}doRegisterOverrideIdentifiers(e){for(const t of e)this.overrideIdentifiers.add(t);this.updateOverridePropertyPatternKey()}doRegisterConfigurations(e,t,n){e.forEach(o=>{this.validateAndRegisterProperties(o,t,o.extensionInfo,o.restrictedProperties,void 0,n),this.configurationContributors.push(o),this.registerJSONConfiguration(o)})}validateAndRegisterProperties(e,t=!0,n,o,r=3,s){var a;r=Ml(e.scope)?r:e.scope;const l=e.properties;if(l)for(const u in l){const d=l[u];if(t&&PJe(u,d)){delete l[u];continue}if(d.source=n,d.defaultDefaultValue=l[u].default,this.updatePropertyDefaultValue(u,d),Sv.test(u)?d.scope=void 0:(d.scope=Ml(d.scope)?r:d.scope,d.restricted=Ml(d.restricted)?!!(o!=null&&o.includes(u)):d.restricted),l[u].hasOwnProperty("included")&&!l[u].included){this.excludedConfigurationProperties[u]=l[u],delete l[u];continue}else this.configurationProperties[u]=l[u],!((a=l[u].policy)===null||a===void 0)&&a.name&&this.policyConfigurations.set(l[u].policy.name,u);!l[u].deprecationMessage&&l[u].markdownDeprecationMessage&&(l[u].deprecationMessage=l[u].markdownDeprecationMessage),s.add(u)}const c=e.allOf;if(c)for(const u of c)this.validateAndRegisterProperties(u,t,n,o,r,s)}getConfigurationProperties(){return this.configurationProperties}getPolicyConfigurations(){return this.policyConfigurations}registerJSONConfiguration(e){const t=n=>{const o=n.properties;if(o)for(const s in o)this.updateSchema(s,o[s]);const r=n.allOf;r==null||r.forEach(t)};t(e)}updateSchema(e,t){switch(t.scope){case 1:break;case 2:break;case 6:break;case 3:break;case 4:break;case 5:this.resourceLanguageSettingsSchema.properties[e]=t;break}}updateOverridePropertyPatternKey(){for(const e of this.overrideIdentifiers.values()){const t=`[${e}]`,n={type:"object",description:C("overrideSettings.defaultDescription","Configure editor settings to be overridden for a language."),errorMessage:C("overrideSettings.errorMessage","This setting does not support per-language configuration."),$ref:Nx};this.updatePropertyDefaultValue(t,n)}}registerOverridePropertyPatternKey(){C("overrideSettings.defaultDescription","Configure editor settings to be overridden for a language."),C("overrideSettings.errorMessage","This setting does not support per-language configuration."),this._onDidSchemaChange.fire()}updatePropertyDefaultValue(e,t){const n=this.configurationDefaultsOverrides.get(e);let o=n==null?void 0:n.value,r=n==null?void 0:n.source;nl(o)&&(o=t.defaultDefaultValue,r=void 0),nl(o)&&(o=AJe(t.type)),t.default=o,t.defaultValueSource=r}}const D0e="\\[([^\\]]+)\\]",Aoe=new RegExp(D0e,"g"),MJe=`^(${D0e})+$`,Sv=new RegExp(MJe);function qA(i){const e=[];if(Sv.test(i)){let t=Aoe.exec(i);for(;t!=null&&t.length;){const n=t[1].trim();n&&e.push(n),t=Aoe.exec(i)}}return mv(e)}function AJe(i){switch(Array.isArray(i)?i[0]:i){case"boolean":return!1;case"integer":case"number":return 0;case"string":return"";case"array":return[];case"object":return{};default:return null}}const eM=new RJe;no.add(ah.Configuration,eM);function PJe(i,e){var t,n,o,r;return i.trim()?Sv.test(i)?C("config.property.languageDefault","Cannot register '{0}'. This matches property pattern '\\\\[.*\\\\]$' for describing language specific editor settings. Use 'configurationDefaults' contribution.",i):eM.getConfigurationProperties()[i]!==void 0?C("config.property.duplicate","Cannot register '{0}'. This property is already registered.",i):((t=e.policy)===null||t===void 0?void 0:t.name)&&eM.getPolicyConfigurations().get((n=e.policy)===null||n===void 0?void 0:n.name)!==void 0?C("config.policy.duplicate","Cannot register '{0}'. The associated policy {1} is already registered with {2}.",i,(o=e.policy)===null||o===void 0?void 0:o.name,eM.getPolicyConfigurations().get((r=e.policy)===null||r===void 0?void 0:r.name)):null:C("config.property.empty","Cannot register an empty property")}const OJe={ModesRegistry:"editor.modesRegistry"};class FJe{constructor(){this._onDidChangeLanguages=new le,this.onDidChangeLanguages=this._onDidChangeLanguages.event,this._languages=[]}registerLanguage(e){return this._languages.push(e),this._onDidChangeLanguages.fire(void 0),{dispose:()=>{for(let t=0,n=this._languages.length;t{const l=new Set;return{info:new VJe(this,a,l),closing:l}}),r=new ooe(a=>{const l=new Set,c=new Set;return{info:new HJe(this,a,l,c),opening:l,openingColorized:c}});for(const[a,l]of n){const c=o.get(a),u=r.get(l);c.closing.add(u.info),u.opening.add(c.info)}const s=t.colorizedBracketPairs?Poe(t.colorizedBracketPairs):n.filter(a=>!(a[0]==="<"&&a[1]===">"));for(const[a,l]of s){const c=o.get(a),u=r.get(l);c.closing.add(u.info),u.openingColorized.add(c.info),u.opening.add(c.info)}this._openingBrackets=new Map([...o.cachedValues].map(([a,l])=>[a,l.info])),this._closingBrackets=new Map([...r.cachedValues].map(([a,l])=>[a,l.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)}}function Poe(i){return i.filter(([e,t])=>e!==""&&t!=="")}class k0e{constructor(e,t){this.config=e,this.bracketText=t}get languageId(){return this.config.languageId}}class VJe extends k0e{constructor(e,t,n){super(e,t),this.openedBrackets=n,this.isOpeningBracket=!0}}class HJe extends k0e{constructor(e,t,n,o){super(e,t),this.openingBrackets=n,this.openingColorizedBrackets=o,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]}}var $Je=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Ooe=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};class G6{constructor(e){this.languageId=e}affects(e){return this.languageId?this.languageId===e:!0}}const Ti=wn("languageConfigurationService");let XV=class extends _e{constructor(e,t){super(),this.configurationService=e,this.languageService=t,this._registry=this._register(new KJe),this.onDidChangeEmitter=this._register(new le),this.onDidChange=this.onDidChangeEmitter.event,this.configurations=new Map;const n=new Set(Object.values(YV));this._register(this.configurationService.onDidChangeConfiguration(o=>{const r=o.change.keys.some(a=>n.has(a)),s=o.change.overrides.filter(([a,l])=>l.some(c=>n.has(c))).map(([a])=>a);if(r)this.configurations.clear(),this.onDidChangeEmitter.fire(new G6(void 0));else for(const a of s)this.languageService.isRegisteredLanguageId(a)&&(this.configurations.delete(a),this.onDidChangeEmitter.fire(new G6(a)))})),this._register(this._registry.onDidChange(o=>{this.configurations.delete(o.languageId),this.onDidChangeEmitter.fire(new G6(o.languageId))}))}register(e,t,n){return this._registry.register(e,t,n)}getLanguageConfiguration(e){let t=this.configurations.get(e);return t||(t=zJe(e,this._registry,this.configurationService,this.languageService),this.configurations.set(e,t)),t}};XV=$Je([Ooe(0,En),Ooe(1,Ki)],XV);function zJe(i,e,t,n){let o=e.getLanguageConfiguration(i);if(!o){if(!n.isRegisteredLanguageId(i))return new bw(i,{});o=new bw(i,{})}const r=UJe(o.languageId,t),s=T0e([o.underlyingConfig,r]);return new bw(o.languageId,s)}const YV={brackets:"editor.language.brackets",colorizedBracketPairs:"editor.language.colorizedBracketPairs"};function UJe(i,e){const t=e.getValue(YV.brackets,{overrideIdentifier:i}),n=e.getValue(YV.colorizedBracketPairs,{overrideIdentifier:i});return{brackets:Foe(t),colorizedBracketPairs:Foe(n)}}function Foe(i){if(!!Array.isArray(i))return i.map(e=>{if(!(!Array.isArray(e)||e.length!==2))return[e[0],e[1]]}).filter(e=>!!e)}function I0e(i,e,t){const n=i.getLineContent(e);let o=Si(n);return o.length>t-1&&(o=o.substring(0,t-1)),o}function _w(i,e,t){i.tokenization.forceTokenization(e);const n=i.tokenization.getLineTokens(e),o=typeof t=="undefined"?i.getLineMaxColumn(e)-1:t-1;return i5(n,o)}class jJe{constructor(e){this.languageId=e,this._resolved=null,this._entries=[],this._order=0,this._resolved=null}register(e,t){const n=new Boe(e,t,++this._order);return this._entries.push(n),this._resolved=null,zt(()=>{for(let o=0;oe.configuration)))}}function T0e(i){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 i)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 Boe{constructor(e,t,n){this.configuration=e,this.priority=t,this.order=n}static cmp(e,t){return e.priority===t.priority?e.order-t.order:e.priority-t.priority}}class Woe{constructor(e){this.languageId=e}}class KJe extends _e{constructor(){super(),this._entries=new Map,this._onDidChange=this._register(new le),this.onDidChange=this._onDidChange.event,this._register(this.register(ql,{brackets:[["(",")"],["[","]"],["{","}"]],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"<",close:">"},{open:'"',close:'"'},{open:"'",close:"'"},{open:"`",close:"`"}],colorizedBracketPairs:[],folding:{offSide:!0}},0))}register(e,t,n=0){let o=this._entries.get(e);o||(o=new jJe(e),this._entries.set(e,o));const r=o.register(t,n);return this._onDidChange.fire(new Woe(e)),zt(()=>{r.dispose(),this._onDidChange.fire(new Woe(e))})}getLanguageConfiguration(e){const t=this._entries.get(e);return(t==null?void 0:t.getResolvedConfiguration())||null}}class bw{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 TC(this.underlyingConfig):null,this.comments=bw._handleComments(this.underlyingConfig),this.characterPair=new my(this.underlyingConfig),this.wordDefinition=this.underlyingConfig.wordPattern||Tq,this.indentationRules=this.underlyingConfig.indentationRules,this.underlyingConfig.indentationRules?this.indentRulesSupport=new EJe(this.underlyingConfig.indentationRules):this.indentRulesSupport=null,this.foldingRules=this.underlyingConfig.folding||{},this.bracketsNew=new WJe(e,this.underlyingConfig)}getWordDefinition(){return h_e(this.wordDefinition)}get brackets(){return!this._brackets&&this.underlyingConfig.brackets&&(this._brackets=new bJe(this.languageId,this.underlyingConfig.brackets)),this._brackets}get electricCharacter(){return this._electricCharacter||(this._electricCharacter=new LJe(this.brackets)),this._electricCharacter}onEnter(e,t,n,o){return this._onEnterSupport?this._onEnterSupport.onEnter(e,t,n,o):null}getAutoClosingPairs(){return new dJe(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 n={};if(t.lineComment&&(n.lineCommentToken=t.lineComment),t.blockComment){const[o,r]=t.blockComment;n.blockCommentStartToken=o,n.blockCommentEndToken=r}return n}}Mn(Ti,XV,1);class jp{constructor(e,t,n,o){this.originalStart=e,this.originalLength=t,this.modifiedStart=n,this.modifiedLength=o}getOriginalEnd(){return this.originalStart+this.originalLength}getModifiedEnd(){return this.modifiedStart+this.modifiedLength}}function N0e(i){return l5(i,0)}function l5(i,e){switch(typeof i){case"object":return i===null?Mg(349,e):Array.isArray(i)?GJe(i,e):XJe(i,e);case"string":return eG(i,e);case"boolean":return qJe(i,e);case"number":return Mg(i,e);case"undefined":return Mg(937,e);default:return Mg(617,e)}}function Mg(i,e){return(e<<5)-e+i|0}function qJe(i,e){return Mg(i?433:863,e)}function eG(i,e){e=Mg(149417,e);for(let t=0,n=i.length;tl5(n,t),e)}function XJe(i,e){return e=Mg(181387,e),Object.keys(i).sort().reduce((t,n)=>(t=eG(n,t),l5(i[n],t)),e)}function X6(i,e,t=32){const n=t-e,o=~((1<>>n)>>>0}function Voe(i,e=0,t=i.byteLength,n=0){for(let o=0;ot.toString(16).padStart(2,"0")).join(""):YJe((i>>>0).toString(16),e/4)}class c5{constructor(){this._h0=1732584193,this._h1=4023233417,this._h2=2562383102,this._h3=271733878,this._h4=3285377520,this._buff=new Uint8Array(64+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 n=this._buff;let o=this._buffLen,r=this._leftoverHighSurrogate,s,a;for(r!==0?(s=r,a=-1,r=0):(s=e.charCodeAt(0),a=0);;){let l=s;if(fr(s))if(a+1>>6,e[t++]=128|(n&63)>>>0):n<65536?(e[t++]=224|(n&61440)>>>12,e[t++]=128|(n&4032)>>>6,e[t++]=128|(n&63)>>>0):(e[t++]=240|(n&1835008)>>>18,e[t++]=128|(n&258048)>>>12,e[t++]=128|(n&4032)>>>6,e[t++]=128|(n&63)>>>0),t>=64&&(this._step(),t-=64,this._totalLen+=64,e[0]=e[64+0],e[1]=e[64+1],e[2]=e[64+2]),t}digest(){return this._finished||(this._finished=!0,this._leftoverHighSurrogate&&(this._leftoverHighSurrogate=0,this._buffLen=this._push(this._buff,this._buffLen,65533)),this._totalLen+=this._buffLen,this._wrapUp()),Rx(this._h0)+Rx(this._h1)+Rx(this._h2)+Rx(this._h3)+Rx(this._h4)}_wrapUp(){this._buff[this._buffLen++]=128,Voe(this._buff,this._buffLen),this._buffLen>56&&(this._step(),Voe(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=c5._bigBlock32,t=this._buffDV;for(let d=0;d<64;d+=4)e.setUint32(d,t.getUint32(d,!1),!1);for(let d=64;d<320;d+=4)e.setUint32(d,X6(e.getUint32(d-12,!1)^e.getUint32(d-32,!1)^e.getUint32(d-56,!1)^e.getUint32(d-64,!1),1),!1);let n=this._h0,o=this._h1,r=this._h2,s=this._h3,a=this._h4,l,c,u;for(let d=0;d<80;d++)d<20?(l=o&r|~o&s,c=1518500249):d<40?(l=o^r^s,c=1859775393):d<60?(l=o&r|o&s|r&s,c=2400959708):(l=o^r^s,c=3395469782),u=X6(n,5)+l+a+c+e.getUint32(d*4,!1)&4294967295,a=s,s=r,r=X6(o,30),o=n,n=u;this._h0=this._h0+n&4294967295,this._h1=this._h1+o&4294967295,this._h2=this._h2+r&4294967295,this._h3=this._h3+s&4294967295,this._h4=this._h4+a&4294967295}}c5._bigBlock32=new DataView(new ArrayBuffer(320));class Hoe{constructor(e){this.source=e}getElements(){const e=this.source,t=new Int32Array(e.length);for(let n=0,o=e.length;n0||this.m_modifiedCount>0)&&this.m_changes.push(new jp(this.m_originalStart,this.m_originalCount,this.m_modifiedStart,this.m_modifiedCount)),this.m_originalCount=0,this.m_modifiedCount=0,this.m_originalStart=1073741824,this.m_modifiedStart=1073741824}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 Rh{constructor(e,t,n=null){this.ContinueProcessingPredicate=n,this._originalSequence=e,this._modifiedSequence=t;const[o,r,s]=Rh._getElements(e),[a,l,c]=Rh._getElements(t);this._hasStrings=s&&c,this._originalStringElements=o,this._originalElementsOrHash=r,this._modifiedStringElements=a,this._modifiedElementsOrHash=l,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(Rh._isStringArray(t)){const n=new Int32Array(t.length);for(let o=0,r=t.length;o=e&&o>=n&&this.ElementsAreEqual(t,o);)t--,o--;if(e>t||n>o){let d;return n<=o?(W1.Assert(e===t+1,"originalStart should only be one more than originalEnd"),d=[new jp(e,0,n,o-n+1)]):e<=t?(W1.Assert(n===o+1,"modifiedStart should only be one more than modifiedEnd"),d=[new jp(e,t-e+1,n,0)]):(W1.Assert(e===t+1,"originalStart should only be one more than originalEnd"),W1.Assert(n===o+1,"modifiedStart should only be one more than modifiedEnd"),d=[]),d}const s=[0],a=[0],l=this.ComputeRecursionPoint(e,t,n,o,s,a,r),c=s[0],u=a[0];if(l!==null)return l;if(!r[0]){const d=this.ComputeDiffRecursive(e,c,n,u,r);let h=[];return r[0]?h=[new jp(c+1,t-(c+1)+1,u+1,o-(u+1)+1)]:h=this.ComputeDiffRecursive(c+1,t,u+1,o,r),this.ConcatenateChanges(d,h)}return[new jp(e,t-e+1,n,o-n+1)]}WALKTRACE(e,t,n,o,r,s,a,l,c,u,d,h,f,g,p,v,m,_){let w=null,y=null,L=new $oe,D=t,E=n,I=f[0]-v[0]-o,k=-1073741824,R=this.m_forwardHistory.length-1;do{const A=I+e;A===D||A=0&&(c=this.m_forwardHistory[R],e=c[0],D=1,E=c.length-1)}while(--R>=-1);if(w=L.getReverseChanges(),_[0]){let A=f[0]+1,P=v[0]+1;if(w!==null&&w.length>0){const N=w[w.length-1];A=Math.max(A,N.getOriginalEnd()),P=Math.max(P,N.getModifiedEnd())}y=[new jp(A,h-A+1,P,p-P+1)]}else{L=new $oe,D=s,E=a,I=f[0]-v[0]-l,k=1073741824,R=m?this.m_reverseHistory.length-1:this.m_reverseHistory.length-2;do{const A=I+r;A===D||A=u[A+1]?(d=u[A+1]-1,g=d-I-l,d>k&&L.MarkNextChange(),k=d+1,L.AddOriginalElement(d+1,g+1),I=A+1-r):(d=u[A-1],g=d-I-l,d>k&&L.MarkNextChange(),k=d,L.AddModifiedElement(d+1,g+1),I=A-1-r),R>=0&&(u=this.m_reverseHistory[R],r=u[0],D=1,E=u.length-1)}while(--R>=-1);y=L.getChanges()}return this.ConcatenateChanges(w,y)}ComputeRecursionPoint(e,t,n,o,r,s,a){let l=0,c=0,u=0,d=0,h=0,f=0;e--,n--,r[0]=0,s[0]=0,this.m_forwardHistory=[],this.m_reverseHistory=[];const g=t-e+(o-n),p=g+1,v=new Int32Array(p),m=new Int32Array(p),_=o-n,w=t-e,y=e-n,L=t-o,E=(w-_)%2===0;v[_]=e,m[w]=t,a[0]=!1;for(let I=1;I<=g/2+1;I++){let k=0,R=0;u=this.ClipDiagonalBound(_-I,I,_,p),d=this.ClipDiagonalBound(_+I,I,_,p);for(let P=u;P<=d;P+=2){P===u||Pk+R&&(k=l,R=c),!E&&Math.abs(P-w)<=I-1&&l>=m[P])return r[0]=l,s[0]=c,N<=m[P]&&1447>0&&I<=1447+1?this.WALKTRACE(_,u,d,y,w,h,f,L,v,m,l,t,r,c,o,s,E,a):null}const A=(k-e+(R-n)-I)/2;if(this.ContinueProcessingPredicate!==null&&!this.ContinueProcessingPredicate(k,A))return a[0]=!0,r[0]=k,s[0]=R,A>0&&1447>0&&I<=1447+1?this.WALKTRACE(_,u,d,y,w,h,f,L,v,m,l,t,r,c,o,s,E,a):(e++,n++,[new jp(e,t-e+1,n,o-n+1)]);h=this.ClipDiagonalBound(w-I,I,w,p),f=this.ClipDiagonalBound(w+I,I,w,p);for(let P=h;P<=f;P+=2){P===h||P=m[P+1]?l=m[P+1]-1:l=m[P-1],c=l-(P-w)-L;const N=l;for(;l>e&&c>n&&this.ElementsAreEqual(l,c);)l--,c--;if(m[P]=l,E&&Math.abs(P-_)<=I&&l<=v[P])return r[0]=l,s[0]=c,N>=v[P]&&1447>0&&I<=1447+1?this.WALKTRACE(_,u,d,y,w,h,f,L,v,m,l,t,r,c,o,s,E,a):null}if(I<=1447){let P=new Int32Array(d-u+2);P[0]=_-u+1,V1.Copy2(v,u,P,1,d-u+1),this.m_forwardHistory.push(P),P=new Int32Array(f-h+2),P[0]=w-h+1,V1.Copy2(m,h,P,1,f-h+1),this.m_reverseHistory.push(P)}}return this.WALKTRACE(_,u,d,y,w,h,f,L,v,m,l,t,r,c,o,s,E,a)}PrettifyChanges(e){for(let t=0;t0,a=n.modifiedLength>0;for(;n.originalStart+n.originalLength=0;t--){const n=e[t];let o=0,r=0;if(t>0){const d=e[t-1];o=d.originalStart+d.originalLength,r=d.modifiedStart+d.modifiedLength}const s=n.originalLength>0,a=n.modifiedLength>0;let l=0,c=this._boundaryScore(n.originalStart,n.originalLength,n.modifiedStart,n.modifiedLength);for(let d=1;;d++){const h=n.originalStart-d,f=n.modifiedStart-d;if(hc&&(c=p,l=d)}n.originalStart-=l,n.modifiedStart-=l;const u=[null];if(t>0&&this.ChangesOverlap(e[t-1],e[t],u)){e[t-1]=u[0],e.splice(t,1),t++;continue}}if(this._hasStrings)for(let t=1,n=e.length;t0&&f>l&&(l=f,c=d,u=h)}return l>0?[c,u]:null}_contiguousSequenceScore(e,t,n){let o=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 n=e+t;if(this._OriginalIsBoundary(n-1)||this._OriginalIsBoundary(n))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 n=e+t;if(this._ModifiedIsBoundary(n-1)||this._ModifiedIsBoundary(n))return!0}return!1}_boundaryScore(e,t,n,o){const r=this._OriginalRegionIsBoundary(e,t)?1:0,s=this._ModifiedRegionIsBoundary(n,o)?1:0;return r+s}ConcatenateChanges(e,t){const n=[];if(e.length===0||t.length===0)return t.length>0?t:e;if(this.ChangesOverlap(e[e.length-1],t[0],n)){const o=new Array(e.length+t.length-1);return V1.Copy(e,0,o,0,e.length-1),o[e.length-1]=n[0],V1.Copy(t,1,o,e.length,t.length-1),o}else{const o=new Array(e.length+t.length);return V1.Copy(e,0,o,0,e.length),V1.Copy(t,0,o,e.length,t.length),o}}ChangesOverlap(e,t,n){if(W1.Assert(e.originalStart<=t.originalStart,"Left change is not less than or equal to right change"),W1.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 o=e.originalStart;let r=e.originalLength;const s=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),n[0]=new jp(o,r,s,a),!0}else return n[0]=null,!1}ClipDiagonalBound(e,t,n,o){if(e>=0&&e255?255:i|0}function H1(i){return i<0?0:i>4294967295?4294967295:i|0}class QJe{constructor(e){this.values=e,this.prefixSum=new Uint32Array(e.length),this.prefixSumValidIndex=new Int32Array(1),this.prefixSumValidIndex[0]=-1}insertValues(e,t){e=H1(e);const n=this.values,o=this.prefixSum,r=t.length;return r===0?!1:(this.values=new Uint32Array(n.length+r),this.values.set(n.subarray(0,e),0),this.values.set(n.subarray(e),e+r),this.values.set(t,e),e-1=0&&this.prefixSum.set(o.subarray(0,this.prefixSumValidIndex[0]+1)),!0)}setValue(e,t){return e=H1(e),t=H1(t),this.values[e]===t?!1:(this.values[e]=t,e-1=n.length)return!1;const r=n.length-e;return t>=r&&(t=r),t===0?!1:(this.values=new Uint32Array(n.length-t),this.values.set(n.subarray(0,e),0),this.values.set(n.subarray(e+t),e),this.prefixSum=new Uint32Array(this.values.length),e-1=0&&this.prefixSum.set(o.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=H1(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 n=t;n<=e;n++)this.prefixSum[n]=this.prefixSum[n-1]+this.values[n];return this.prefixSumValidIndex[0]=Math.max(this.prefixSumValidIndex[0],e),this.prefixSum[e]}getIndexOf(e){e=Math.floor(e),this.getTotalSum();let t=0,n=this.values.length-1,o=0,r=0,s=0;for(;t<=n;)if(o=t+(n-t)/2|0,r=this.prefixSum[o],s=r-this.values[o],e=r)t=o+1;else break;return new R0e(o,e-s)}}class JJe{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],n=t>0?this._prefixSum[t-1]:0;return new R0e(t,e-n)}removeValues(e,t){this._values.splice(e,t),this._invalidate(e)}insertValues(e,t){this._values=F4(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]=o+n;for(let r=0;r=0&&e<256?this._asciiMap[e]=n:this._map.set(e,n)}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()}}class XA{constructor(){this._actual=new bS(0)}add(e){this._actual.set(e,1)}has(e){return this._actual.get(e)===1}clear(){return this._actual.clear()}}class tet{constructor(e,t,n){const o=new Uint8Array(e*t);for(let r=0,s=e*t;rt&&(t=l),a>n&&(n=a),c>n&&(n=c)}t++,n++;const o=new tet(n,t,0);for(let r=0,s=e.length;r=this._maxCharCode?0:this._states.get(e,t)}}let Y6=null;function iet(){return Y6===null&&(Y6=new net([[1,104,2],[1,72,2],[1,102,6],[1,70,6],[2,116,3],[2,84,3],[3,116,4],[3,84,4],[4,112,5],[4,80,5],[5,115,9],[5,83,9],[5,58,10],[6,105,7],[6,73,7],[7,108,8],[7,76,8],[8,101,9],[8,69,9],[9,58,10],[10,47,11],[11,47,12]])),Y6}let Mx=null;function oet(){if(Mx===null){Mx=new bS(0);const i=` <>'"\u3001\u3002\uFF61\uFF64\uFF0C\uFF0E\uFF1A\uFF1B\u2018\u3008\u300C\u300E\u3014\uFF08\uFF3B\uFF5B\uFF62\uFF63\uFF5D\uFF3D\uFF09\u3015\u300F\u300D\u3009\u2019\uFF40\uFF5E\u2026`;for(let t=0;to);if(o>0){const a=t.charCodeAt(o-1),l=t.charCodeAt(s);(a===40&&l===41||a===91&&l===93||a===123&&l===125)&&s--}return{range:{startLineNumber:n,startColumn:o+1,endLineNumber:n,endColumn:s+2},url:t.substring(o,s+1)}}static computeLinks(e,t=iet()){const n=oet(),o=[];for(let r=1,s=e.getLineCount();r<=s;r++){const a=e.getLineContent(r),l=a.length;let c=0,u=0,d=0,h=1,f=!1,g=!1,p=!1,v=!1;for(;c=0?(o+=n?1:-1,o<0?o=e.length-1:o%=e.length,e[o]):null}}ZV.INSTANCE=new ZV;class set extends bS{constructor(e){super(0);for(let t=0,n=e.length;t(e.hasOwnProperty(t)||(e[t]=i(t)),e[t])}const Wc=aet(i=>new set(i));var Xl;(function(i){i[i.Left=1]="Left",i[i.Center=2]="Center",i[i.Right=4]="Right",i[i.Full=7]="Full"})(Xl||(Xl={}));var Cw;(function(i){i[i.Left=1]="Left",i[i.Right=2]="Right"})(Cw||(Cw={}));var al;(function(i){i[i.Inline=1]="Inline",i[i.Gutter=2]="Gutter"})(al||(al={}));var Nd;(function(i){i[i.Both=0]="Both",i[i.Right=1]="Right",i[i.Left=2]="Left",i[i.None=3]="None"})(Nd||(Nd={}));class tM{get originalIndentSize(){return this._indentSizeIsTabSize?"tabSize":this.indentSize}constructor(e){this._textModelResolvedOptionsBrand=void 0,this.tabSize=Math.max(1,e.tabSize|0),e.indentSize==="tabSize"?(this.indentSize=this.tabSize,this._indentSizeIsTabSize=!0):(this.indentSize=Math.max(1,e.indentSize|0),this._indentSizeIsTabSize=!1),this.insertSpaces=Boolean(e.insertSpaces),this.defaultEOL=e.defaultEOL|0,this.trimAutoWhitespace=Boolean(e.trimAutoWhitespace),this.bracketPairColorizationOptions=e.bracketPairColorizationOptions}equals(e){return this.tabSize===e.tabSize&&this._indentSizeIsTabSize===e._indentSizeIsTabSize&&this.indentSize===e.indentSize&&this.insertSpaces===e.insertSpaces&&this.defaultEOL===e.defaultEOL&&this.trimAutoWhitespace===e.trimAutoWhitespace&&Kl(this.bracketPairColorizationOptions,e.bracketPairColorizationOptions)}createChangeEvent(e){return{tabSize:this.tabSize!==e.tabSize,indentSize:this.indentSize!==e.indentSize,insertSpaces:this.insertSpaces!==e.insertSpaces,trimAutoWhitespace:this.trimAutoWhitespace!==e.trimAutoWhitespace}}}class WD{constructor(e,t){this._findMatchBrand=void 0,this.range=e,this.matches=t}}function cet(i){return i&&typeof i.read=="function"}class Z6{constructor(e,t,n,o,r,s){this.identifier=e,this.range=t,this.text=n,this.forceMoveMarkers=o,this.isAutoWhitespaceEdit=r,this._isTracked=s}}class uet{constructor(e,t,n){this.regex=e,this.wordSeparators=t,this.simpleSearch=n}}class det{constructor(e,t,n){this.reverseEdits=e,this.changes=t,this.trimAutoWhitespaceLineNumbers=n}}function het(i){return!i.isTooLargeForSyncing()&&!i.isForSimpleWidget}const fet=999;class N_{constructor(e,t,n,o){this.searchString=e,this.isRegex=t,this.matchCase=n,this.wordSeparators=o}parseSearchRequest(){if(this.searchString==="")return null;let e;this.isRegex?e=get(this.searchString):e=this.searchString.indexOf(` -`)>=0;let t=null;try{t=A_e(this.searchString,this.isRegex,{matchCase:this.matchCase,wholeWord:!1,multiline:e,global:!0,unicode:!0})}catch{return null}if(!t)return null;let n=!this.isRegex&&!e;return n&&this.searchString.toLowerCase()!==this.searchString.toUpperCase()&&(n=this.matchCase),new uet(t,this.wordSeparators?Wc(this.wordSeparators):null,n?this.searchString:null)}}function get(i){if(!i||i.length===0)return!1;for(let e=0,t=i.length;e=t)break;const o=i.charCodeAt(e);if(o===110||o===114||o===87)return!0}}return!1}function B_(i,e,t){if(!t)return new WD(i,null);const n=[];for(let o=0,r=e.length;o>0);t[r]>=e?o=r-1:t[r+1]>=e?(n=r,o=r):n=r+1}return n+1}}class o2{static findMatches(e,t,n,o,r){const s=t.parseSearchRequest();return s?s.regex.multiline?this._doFindMatchesMultiline(e,n,new NC(s.wordSeparators,s.regex),o,r):this._doFindMatchesLineByLine(e,n,s,o,r):[]}static _getMultilineMatchRange(e,t,n,o,r,s){let a,l=0;o?(l=o.findLineFeedCountBeforeOffset(r),a=t+r+l):a=t+r;let c;if(o){const f=o.findLineFeedCountBeforeOffset(r+s.length)-l;c=a+s.length+f}else c=a+s.length;const u=e.getPositionAt(a),d=e.getPositionAt(c);return new V(u.lineNumber,u.column,d.lineNumber,d.column)}static _doFindMatchesMultiline(e,t,n,o,r){const s=e.getOffsetAt(t.getStartPosition()),a=e.getValueInRange(t,1),l=e.getEOL()===`\r -`?new zoe(a):null,c=[];let u=0,d;for(n.reset(0);d=n.next(a);)if(c[u++]=B_(this._getMultilineMatchRange(e,s,a,l,d.index,d[0]),d,o),u>=r)return c;return c}static _doFindMatchesLineByLine(e,t,n,o,r){const s=[];let a=0;if(t.startLineNumber===t.endLineNumber){const c=e.getLineContent(t.startLineNumber).substring(t.startColumn-1,t.endColumn-1);return a=this._findMatchesInLine(n,c,t.startLineNumber,t.startColumn-1,a,s,o,r),s}const l=e.getLineContent(t.startLineNumber).substring(t.startColumn-1);a=this._findMatchesInLine(n,l,t.startLineNumber,t.startColumn-1,a,s,o,r);for(let c=t.startLineNumber+1;c=l))return r;return r}const u=new NC(e.wordSeparators,e.regex);let d;u.reset(0);do if(d=u.next(t),d&&(s[r++]=B_(new V(n,d.index+1+o,n,d.index+1+d[0].length+o),d,a),r>=l))return r;while(d);return r}static findNextMatch(e,t,n,o){const r=t.parseSearchRequest();if(!r)return null;const s=new NC(r.wordSeparators,r.regex);return r.regex.multiline?this._doFindNextMatchMultiline(e,n,s,o):this._doFindNextMatchLineByLine(e,n,s,o)}static _doFindNextMatchMultiline(e,t,n,o){const r=new ae(t.lineNumber,1),s=e.getOffsetAt(r),a=e.getLineCount(),l=e.getValueInRange(new V(r.lineNumber,r.column,a,e.getLineMaxColumn(a)),1),c=e.getEOL()===`\r -`?new zoe(l):null;n.reset(t.column-1);const u=n.next(l);return u?B_(this._getMultilineMatchRange(e,s,l,c,u.index,u[0]),u,o):t.lineNumber!==1||t.column!==1?this._doFindNextMatchMultiline(e,new ae(1,1),n,o):null}static _doFindNextMatchLineByLine(e,t,n,o){const r=e.getLineCount(),s=t.lineNumber,a=e.getLineContent(s),l=this._findFirstMatchInLine(n,a,s,t.column,o);if(l)return l;for(let c=1;c<=r;c++){const u=(s+c-1)%r,d=e.getLineContent(u+1),h=this._findFirstMatchInLine(n,d,u+1,1,o);if(h)return h}return null}static _findFirstMatchInLine(e,t,n,o,r){e.reset(o-1);const s=e.next(t);return s?B_(new V(n,s.index+1,n,s.index+1+s[0].length),s,r):null}static findPreviousMatch(e,t,n,o){const r=t.parseSearchRequest();if(!r)return null;const s=new NC(r.wordSeparators,r.regex);return r.regex.multiline?this._doFindPreviousMatchMultiline(e,n,s,o):this._doFindPreviousMatchLineByLine(e,n,s,o)}static _doFindPreviousMatchMultiline(e,t,n,o){const r=this._doFindMatchesMultiline(e,new V(1,1,t.lineNumber,t.column),n,o,10*fet);if(r.length>0)return r[r.length-1];const s=e.getLineCount();return t.lineNumber!==s||t.column!==e.getLineMaxColumn(s)?this._doFindPreviousMatchMultiline(e,new ae(s,e.getLineMaxColumn(s)),n,o):null}static _doFindPreviousMatchLineByLine(e,t,n,o){const r=e.getLineCount(),s=t.lineNumber,a=e.getLineContent(s).substring(0,t.column-1),l=this._findLastMatchInLine(n,a,s,o);if(l)return l;for(let c=1;c<=r;c++){const u=(r+s-c-1)%r,d=e.getLineContent(u+1),h=this._findLastMatchInLine(n,d,u+1,o);if(h)return h}return null}static _findLastMatchInLine(e,t,n,o){let r=null,s;for(e.reset(0);s=e.next(t);)r=B_(new V(n,s.index+1,n,s.index+1+s[0].length),s,o);return r}}function pet(i,e,t,n,o){if(n===0)return!0;const r=e.charCodeAt(n-1);if(i.get(r)!==0||r===13||r===10)return!0;if(o>0){const s=e.charCodeAt(n);if(i.get(s)!==0)return!0}return!1}function met(i,e,t,n,o){if(n+o===t)return!0;const r=e.charCodeAt(n+o);if(i.get(r)!==0||r===13||r===10)return!0;if(o>0){const s=e.charCodeAt(n+o-1);if(i.get(s)!==0)return!0}return!1}function tG(i,e,t,n,o){return pet(i,e,t,n,o)&&met(i,e,t,n,o)}class NC{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 n;do{if(this._prevMatchStartIndex+this._prevMatchLength===t||(n=this._searchRegex.exec(e),!n))return null;const o=n.index,r=n[0].length;if(o===this._prevMatchStartIndex&&r===this._prevMatchLength){if(r===0){HA(e,t,this._searchRegex.lastIndex)>65535?this._searchRegex.lastIndex+=2:this._searchRegex.lastIndex+=1;continue}return null}if(this._prevMatchStartIndex=o,this._prevMatchLength=r,!this._wordSeparators||tG(this._wordSeparators,e,t,o,r))return n}while(n);return null}}class nG{static computeUnicodeHighlights(e,t,n){const o=n?n.startLineNumber:1,r=n?n.endLineNumber:e.getLineCount(),s=new Uoe(t),a=s.getCandidateCodePoints();let l;a==="allNonBasicAscii"?l=new RegExp("[^\\t\\n\\r\\x20-\\x7E]","g"):l=new RegExp(`${vet(Array.from(a))}`,"g");const c=new NC(null,l),u=[];let d=!1,h,f=0,g=0,p=0;e:for(let v=o,m=r;v<=m;v++){const _=e.getLineContent(v),w=_.length;c.reset(0);do if(h=c.next(_),h){let y=h.index,L=h.index+h[0].length;if(y>0){const k=_.charCodeAt(y-1);fr(k)&&y--}if(L+1=k){d=!0;break e}u.push(new V(v,y+1,v,L+1))}}while(h)}return{ranges:u,hasMore:d,ambiguousCharacterCount:f,invisibleCharacterCount:g,nonBasicAsciiCharacterCount:p}}static computeUnicodeHighlightReason(e,t){const n=new Uoe(t);switch(n.shouldHighlightNonBasicASCII(e,null)){case 0:return null;case 2:return{kind:1};case 3:{const r=e.codePointAt(0),s=n.ambiguousCharacters.getPrimaryConfusable(r),a=Z0.getLocales().filter(l=>!Z0.getInstance(new Set([...t.allowedLocales,l])).isAmbiguous(r));return{kind:0,confusableWith:String.fromCodePoint(s),notAmbiguousInLocales:a}}case 1:return{kind:2}}}}function vet(i,e){return`[${Gl(i.map(n=>String.fromCodePoint(n)).join(""))}]`}class Uoe{constructor(e){this.options=e,this.allowedCodePoints=new Set(e.allowedCodePoints),this.ambiguousCharacters=Z0.getInstance(new Set(e.allowedLocales))}getCandidateCodePoints(){if(this.options.nonBasicASCII)return"allNonBasicAscii";const e=new Set;if(this.options.invisibleCharacters)for(const t of af.codePoints)joe(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 n=e.codePointAt(0);if(this.allowedCodePoints.has(n))return 0;if(this.options.nonBasicASCII)return 1;let o=!1,r=!1;if(t)for(const s of t){const a=s.codePointAt(0),l=BI(s);o=o||l,!l&&!this.ambiguousCharacters.isAmbiguous(a)&&!af.isInvisibleCharacter(a)&&(r=!0)}return!o&&r?0:this.options.invisibleCharacters&&!joe(e)&&af.isInvisibleCharacter(n)?2:this.options.ambiguousCharacters&&this.ambiguousCharacters.isAmbiguous(n)?3:0}}function joe(i){return i===" "||i===` -`||i===" "}class nM{constructor(e,t,n){this.changes=e,this.moves=t,this.hitTimeout=n}}class M0e{constructor(e,t){this.lineRangeMapping=e,this.changes=t}}class Cn{static addRange(e,t){let n=0;for(;nt))return new Cn(e,t)}static ofLength(e){return new Cn(0,e)}constructor(e,t){if(this.start=e,this.endExclusive=t,e>t)throw new Vo(`Invalid range: ${this.toString()}`)}get isEmpty(){return this.start===this.endExclusive}delta(e){return new Cn(this.start+e,this.endExclusive+e)}deltaStart(e){return new Cn(this.start+e,this.endExclusive)}deltaEnd(e){return new Cn(this.start,this.endExclusive+e)}get length(){return this.endExclusive-this.start}toString(){return`[${this.start}, ${this.endExclusive})`}equals(e){return this.start===e.start&&this.endExclusive===e.endExclusive}containsRange(e){return this.start<=e.start&&e.endExclusive<=this.endExclusive}contains(e){return this.start<=e&&e=this.endExclusive?this.start+(e-this.start)%this.length:e}forEach(e){for(let t=this.start;te.toString()).join(", ")}intersectsStrict(e){let t=0;for(;te+t.length,0)}}function ZA(i,e,t){const n=_et(i,e);if(n!==-1)return i[n]}function _et(i,e,t=i.length-1){for(let n=t;n>=0;n--){const o=i[n];if(e(o))return n}return-1}function VD(i,e){const t=HD(i,e);return t===-1?void 0:i[t]}function HD(i,e,t=0,n=i.length){let o=t,r=n;for(;o0&&(t=o)}return t}function Cet(i,e){if(i.length===0)return;let t=i[0];for(let n=1;n=0&&(t=o)}return t}function wet(i,e){return A0e(i,(t,n)=>-e(t,n))}function yet(i,e){if(i.length===0)return-1;let t=0;for(let n=1;n0&&(t=n)}return t}function xet(i,e){for(const t of i){const n=e(t);if(n!==void 0)return n}}class ln{static fromRange(e){return new ln(e.startLineNumber,e.endLineNumber)}static joinMany(e){if(e.length===0)return[];let t=new Mh(e[0].slice());for(let n=1;nt)throw new Vo(`startLineNumber ${e} cannot be after endLineNumberExclusive ${t}`);this.startLineNumber=e,this.endLineNumberExclusive=t}contains(e){return this.startLineNumber<=e&&eo.endLineNumberExclusive>=e.startLineNumber),n=HD(this._normalizedRanges,o=>o.startLineNumber<=e.endLineNumberExclusive)+1;if(t===n)this._normalizedRanges.splice(t,0,e);else if(t===n-1){const o=this._normalizedRanges[t];this._normalizedRanges[t]=o.join(e)}else{const o=this._normalizedRanges[t].join(this._normalizedRanges[n-1]).join(e);this._normalizedRanges.splice(t,n-t,o)}}contains(e){const t=VD(this._normalizedRanges,n=>n.startLineNumber<=e);return!!t&&t.endLineNumberExclusive>e}getUnion(e){if(this._normalizedRanges.length===0)return e;if(e._normalizedRanges.length===0)return this;const t=[];let n=0,o=0,r=null;for(;n=s.startLineNumber?r=new ln(r.startLineNumber,Math.max(r.endLineNumberExclusive,s.endLineNumberExclusive)):(t.push(r),r=s)}return r!==null&&t.push(r),new Mh(t)}subtractFrom(e){const t=$D(this._normalizedRanges,s=>s.endLineNumberExclusive>=e.startLineNumber),n=HD(this._normalizedRanges,s=>s.startLineNumber<=e.endLineNumberExclusive)+1;if(t===n)return new Mh([e]);const o=[];let r=e.startLineNumber;for(let s=t;sr&&o.push(new ln(r,a.startLineNumber)),r=a.endLineNumberExclusive}return re.toString()).join(", ")}getIntersection(e){const t=[];let n=0,o=0;for(;nt.delta(e)))}}class pf{static inverse(e,t,n){const o=[];let r=1,s=1;for(const l of e){const c=new Vc(new ln(r,l.original.startLineNumber),new ln(s,l.modified.startLineNumber),void 0);c.modified.isEmpty||o.push(c),r=l.original.endLineNumberExclusive,s=l.modified.endLineNumberExclusive}const a=new Vc(new ln(r,t+1),new ln(s,n+1),void 0);return a.modified.isEmpty||o.push(a),o}constructor(e,t){this.original=e,this.modified=t}toString(){return`{${this.original.toString()}->${this.modified.toString()}}`}flip(){return new pf(this.modified,this.original)}join(e){return new pf(this.original.join(e.original),this.modified.join(e.modified))}}class Vc extends pf{constructor(e,t,n){super(e,t),this.innerChanges=n}flip(){var e;return new Vc(this.modified,this.original,(e=this.innerChanges)===null||e===void 0?void 0:e.map(t=>t.flip()))}}class xv{constructor(e,t){this.originalRange=e,this.modifiedRange=t}toString(){return`{${this.originalRange.toString()}->${this.modifiedRange.toString()}}`}flip(){return new xv(this.modifiedRange,this.originalRange)}}const Let=3;class Eet{computeDiff(e,t,n){var o;const s=new Iet(e,t,{maxComputationTime:n.maxComputationTimeMs,shouldIgnoreTrimWhitespace:n.ignoreTrimWhitespace,shouldComputeCharChanges:!0,shouldMakePrettyDiff:!0,shouldPostProcessCharChanges:!0}).computeDiff(),a=[];let l=null;for(const c of s.changes){let u;c.originalEndLineNumber===0?u=new ln(c.originalStartLineNumber+1,c.originalStartLineNumber+1):u=new ln(c.originalStartLineNumber,c.originalEndLineNumber+1);let d;c.modifiedEndLineNumber===0?d=new ln(c.modifiedStartLineNumber+1,c.modifiedStartLineNumber+1):d=new ln(c.modifiedStartLineNumber,c.modifiedEndLineNumber+1);let h=new Vc(u,d,(o=c.charChanges)===null||o===void 0?void 0:o.map(f=>new xv(new V(f.originalStartLineNumber,f.originalStartColumn,f.originalEndLineNumber,f.originalEndColumn),new V(f.modifiedStartLineNumber,f.modifiedStartColumn,f.modifiedEndLineNumber,f.modifiedEndColumn))));l&&(l.modified.endLineNumberExclusive===h.modified.startLineNumber||l.original.endLineNumberExclusive===h.original.startLineNumber)&&(h=new Vc(l.original.join(h.original),l.modified.join(h.modified),l.innerChanges&&h.innerChanges?l.innerChanges.concat(h.innerChanges):void 0),a.pop()),a.push(h),l=h}return PD(()=>j_e(a,(c,u)=>u.original.startLineNumber-c.original.endLineNumberExclusive===u.modified.startLineNumber-c.modified.endLineNumberExclusive&&c.original.endLineNumberExclusive(e===10?"\\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]===10?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]===10?1:this._columns[e]+1)}}class ww{constructor(e,t,n,o,r,s,a,l){this.originalStartLineNumber=e,this.originalStartColumn=t,this.originalEndLineNumber=n,this.originalEndColumn=o,this.modifiedStartLineNumber=r,this.modifiedStartColumn=s,this.modifiedEndLineNumber=a,this.modifiedEndColumn=l}static createFromDiffChange(e,t,n){const o=t.getStartLineNumber(e.originalStart),r=t.getStartColumn(e.originalStart),s=t.getEndLineNumber(e.originalStart+e.originalLength-1),a=t.getEndColumn(e.originalStart+e.originalLength-1),l=n.getStartLineNumber(e.modifiedStart),c=n.getStartColumn(e.modifiedStart),u=n.getEndLineNumber(e.modifiedStart+e.modifiedLength-1),d=n.getEndColumn(e.modifiedStart+e.modifiedLength-1);return new ww(o,r,s,a,l,c,u,d)}}function ket(i){if(i.length<=1)return i;const e=[i[0]];let t=e[0];for(let n=1,o=i.length;n0&&t.originalLength<20&&t.modifiedLength>0&&t.modifiedLength<20&&r()){const f=n.createCharSequence(e,t.originalStart,t.originalStart+t.originalLength-1),g=o.createCharSequence(e,t.modifiedStart,t.modifiedStart+t.modifiedLength-1);if(f.getElements().length>0&&g.getElements().length>0){let p=P0e(f,g,r,!0).changes;a&&(p=ket(p)),h=[];for(let v=0,m=p.length;v1&&p>1;){const v=h.charCodeAt(g-2),m=f.charCodeAt(p-2);if(v!==m)break;g--,p--}(g>1||p>1)&&this._pushTrimWhitespaceCharChange(o,r+1,1,g,s+1,1,p)}{let g=JV(h,1),p=JV(f,1);const v=h.length+1,m=f.length+1;for(;g!0;const e=Date.now();return()=>Date.now()-e{n.push(Fr.fromOffsetPairs(o?o.getEndExclusives():Uh.zero,r?r.getStarts():new Uh(t,(o?o.seq2Range.endExclusive-o.seq1Range.endExclusive:0)+t)))}),n}static fromOffsetPairs(e,t){return new Fr(new Cn(e.offset1,t.offset1),new Cn(e.offset2,t.offset2))}constructor(e,t){this.seq1Range=e,this.seq2Range=t}swap(){return new Fr(this.seq2Range,this.seq1Range)}toString(){return`${this.seq1Range} <-> ${this.seq2Range}`}join(e){return new Fr(this.seq1Range.join(e.seq1Range),this.seq2Range.join(e.seq2Range))}delta(e){return e===0?this:new Fr(this.seq1Range.delta(e),this.seq2Range.delta(e))}deltaStart(e){return e===0?this:new Fr(this.seq1Range.deltaStart(e),this.seq2Range.deltaStart(e))}deltaEnd(e){return e===0?this:new Fr(this.seq1Range.deltaEnd(e),this.seq2Range.deltaEnd(e))}intersect(e){const t=this.seq1Range.intersect(e.seq1Range),n=this.seq2Range.intersect(e.seq2Range);if(!(!t||!n))return new Fr(t,n)}getStarts(){return new Uh(this.seq1Range.start,this.seq2Range.start)}getEndExclusives(){return new Uh(this.seq1Range.endExclusive,this.seq2Range.endExclusive)}}class Uh{constructor(e,t){this.offset1=e,this.offset2=t}toString(){return`${this.offset1} <-> ${this.offset2}`}}Uh.zero=new Uh(0,0);Uh.max=new Uh(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER);class zD{isValid(){return!0}}zD.instance=new zD;class Tet{constructor(e){if(this.timeout=e,this.startTime=Date.now(),this.valid=!0,e<=0)throw new Vo("timeout must be positive")}isValid(){if(!(Date.now()-this.startTime0&&p>0&&s.get(g-1,p-1)===3&&(_+=a.get(g-1,p-1)),_+=o?o(g,p):1):_=-1;const w=Math.max(v,m,_);if(w===_){const y=g>0&&p>0?a.get(g-1,p-1):0;a.set(g,p,y+1),s.set(g,p,3)}else w===v?(a.set(g,p,0),s.set(g,p,1)):w===m&&(a.set(g,p,0),s.set(g,p,2));r.set(g,p,w)}const l=[];let c=e.length,u=t.length;function d(g,p){(g+1!==c||p+1!==u)&&l.push(new Fr(new Cn(g+1,c),new Cn(p+1,u))),c=g,u=p}let h=e.length-1,f=t.length-1;for(;h>=0&&f>=0;)s.get(h,f)===3?(d(h,f),h--,f--):s.get(h,f)===1?h--:f--;return d(-1,-1),l.reverse(),new jg(l,!1)}}class O0e{compute(e,t,n=zD.instance){if(e.length===0||t.length===0)return jg.trivial(e,t);const o=e,r=t;function s(p,v){for(;po.length||y>r.length)continue;const L=s(w,y);l.set(u,L);const D=w===m?c.get(u+1):c.get(u-1);if(c.set(u,L!==w?new Goe(D,w,y,L-w):D),l.get(u)===o.length&&l.get(u)-u===r.length)break e}}let d=c.get(u);const h=[];let f=o.length,g=r.length;for(;;){const p=d?d.x+d.length:0,v=d?d.y+d.length:0;if((p!==f||v!==g)&&h.push(new Fr(new Cn(p,f),new Cn(v,g))),!d)break;f=d.x,g=d.y,d=d.prev}return h.reverse(),new jg(h,!1)}}class Goe{constructor(e,t,n,o){this.prev=e,this.x=t,this.y=n,this.length=o}}class Ret{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 n=this.negativeArr;this.negativeArr=new Int32Array(n.length*2),this.negativeArr.set(n)}this.negativeArr[e]=t}else{if(e>=this.positiveArr.length){const n=this.positiveArr;this.positiveArr=new Int32Array(n.length*2),this.positiveArr.set(n)}this.positiveArr[e]=t}}}class Met{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}}var Xoe,Yoe;class Aet{constructor(e,t){this.uri=e,this.value=t}}function Pet(i){return Array.isArray(i)}class vs{constructor(e,t){if(this[Xoe]="ResourceMap",e instanceof vs)this.map=new Map(e.map),this.toKey=t!=null?t:vs.defaultToKey;else if(Pet(e)){this.map=new Map,this.toKey=t!=null?t:vs.defaultToKey;for(const[n,o]of e)this.set(n,o)}else this.map=new Map,this.toKey=e!=null?e:vs.defaultToKey}set(e,t){return this.map.set(this.toKey(e),new Aet(e,t)),this}get(e){var t;return(t=this.map.get(this.toKey(e)))===null||t===void 0?void 0:t.value}has(e){return this.map.has(this.toKey(e))}get size(){return this.map.size}clear(){this.map.clear()}delete(e){return this.map.delete(this.toKey(e))}forEach(e,t){typeof t!="undefined"&&(e=e.bind(t));for(const[n,o]of this.map)e(o.value,o.uri,this)}*values(){for(const e of this.map.values())yield e.value}*keys(){for(const e of this.map.values())yield e.uri}*entries(){for(const e of this.map.values())yield[e.uri,e.value]}*[(Xoe=Symbol.toStringTag,Symbol.iterator)](){for(const[,e]of this.map)yield[e.uri,e.value]}}vs.defaultToKey=i=>i.toString();class Oet{constructor(){this[Yoe]="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(){var e;return(e=this._head)===null||e===void 0?void 0:e.value}get last(){var e;return(e=this._tail)===null||e===void 0?void 0:e.value}has(e){return this._map.has(e)}get(e,t=0){const n=this._map.get(e);if(!!n)return t!==0&&this.touch(n,t),n.value}set(e,t,n=0){let o=this._map.get(e);if(o)o.value=t,n!==0&&this.touch(o,n);else{switch(o={key:e,value:t,next:void 0,previous:void 0},n){case 0:this.addItemLast(o);break;case 1:this.addItemFirst(o);break;case 2:this.addItemLast(o);break;default:this.addItemLast(o);break}this._map.set(e,o),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 n=this._state;let o=this._head;for(;o;){if(t?e.bind(t)(o.value,o.key,this):e(o.value,o.key,this),this._state!==n)throw new Error("LinkedMap got modified during iteration.");o=o.next}}keys(){const e=this,t=this._state;let n=this._head;const o={[Symbol.iterator](){return o},next(){if(e._state!==t)throw new Error("LinkedMap got modified during iteration.");if(n){const r={value:n.key,done:!1};return n=n.next,r}else return{value:void 0,done:!0}}};return o}values(){const e=this,t=this._state;let n=this._head;const o={[Symbol.iterator](){return o},next(){if(e._state!==t)throw new Error("LinkedMap got modified during iteration.");if(n){const r={value:n.value,done:!1};return n=n.next,r}else return{value:void 0,done:!0}}};return o}entries(){const e=this,t=this._state;let n=this._head;const o={[Symbol.iterator](){return o},next(){if(e._state!==t)throw new Error("LinkedMap got modified during iteration.");if(n){const r={value:[n.key,n.value],done:!1};return n=n.next,r}else return{value:void 0,done:!0}}};return o}[(Yoe=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e>=this.size)return;if(e===0){this.clear();return}let t=this._head,n=this.size;for(;t&&n>e;)this._map.delete(t.key),t=t.next,n--;this._head=t,this._size=n,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,n=e.previous;if(!t||!n)throw new Error("Invalid list");t.previous=n,n.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!==1&&t!==2)){if(t===1){if(e===this._head)return;const n=e.next,o=e.previous;e===this._tail?(o.next=void 0,this._tail=o):(n.previous=o,o.next=n),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(t===2){if(e===this._tail)return;const n=e.next,o=e.previous;e===this._head?(n.previous=void 0,this._head=n):(n.previous=o,o.next=n),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}}toJSON(){const e=[];return this.forEach((t,n)=>{e.push([n,t])}),e}fromJSON(e){this.clear();for(const[t,n]of e)this.set(t,n)}}class Yv extends Oet{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(e,t=2){return super.get(e,t)}peek(e){return super.get(e,0)}set(e,t){return super.set(e,t,2),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}}class Fet{constructor(e){if(this._m1=new Map,this._m2=new Map,e)for(const[t,n]of e)this.set(t,n)}clear(){this._m1.clear(),this._m2.clear()}set(e,t){this._m1.set(e,t),this._m2.set(t,e)}get(e){return this._m1.get(e)}getKey(e){return this._m2.get(e)}delete(e){const t=this._m1.get(e);return t===void 0?!1:(this._m1.delete(e),this._m2.delete(t),!0)}keys(){return this._m1.keys()}values(){return this._m1.values()}}class oG{constructor(){this.map=new Map}add(e,t){let n=this.map.get(e);n||(n=new Set,this.map.set(e,n)),n.add(t)}delete(e,t){const n=this.map.get(e);!n||(n.delete(t),n.size===0&&this.map.delete(e))}forEach(e,t){const n=this.map.get(e);!n||n.forEach(t)}get(e){const t=this.map.get(e);return t||new Set}}class QA{constructor(e,t,n){this.lines=e,this.considerWhitespaceChanges=n,this.elements=[],this.firstCharOffsetByLine=[],this.additionalOffsetByLine=[];let o=!1;t.start>0&&t.endExclusive>=e.length&&(t=new Cn(t.start-1,t.endExclusive),o=!0),this.lineRange=t,this.firstCharOffsetByLine[0]=0;for(let r=this.lineRange.start;rString.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),n=Qoe(en<=e);return new ae(this.lineRange.start+t+1,e-this.firstCharOffsetByLine[t]+this.additionalOffsetByLine[t]+1)}translateRange(e){return V.fromPositions(this.translateOffset(e.start),this.translateOffset(e.endExclusive))}findWordContaining(e){if(e<0||e>=this.elements.length||!J6(this.elements[e]))return;let t=e;for(;t>0&&J6(this.elements[t-1]);)t--;let n=e;for(;ns<=e.start))!==null&&t!==void 0?t:0,r=(n=bet(this.firstCharOffsetByLine,s=>e.endExclusive<=s))!==null&&n!==void 0?n:this.elements.length;return new Cn(o,r)}}function J6(i){return i>=97&&i<=122||i>=65&&i<=90||i>=48&&i<=57}const Bet={[0]:0,[1]:0,[2]:0,[3]:10,[4]:2,[5]:3,[6]:10,[7]:10};function Zoe(i){return Bet[i]}function Qoe(i){return i===10?7:i===13?6:eH(i)?5:i>=97&&i<=122?0:i>=65&&i<=90?1:i>=48&&i<=57?2:i===-1?3:4}function Wet(i,e,t,n,o,r){let{moves:s,excludedChanges:a}=Vet(i,e,t,r);if(!r.isValid())return[];const l=i.filter(u=>!a.has(u)),c=Het(l,n,o,e,t,r);return HW(s,c),s=$et(s),s=s.filter(u=>u.original.toOffsetRange().slice(e).map(h=>h.trim()).join(` -`).length>=10),s=zet(i,s),s}function Vet(i,e,t,n){const o=[],r=i.filter(l=>l.modified.isEmpty&&l.original.length>=3).map(l=>new _y(l.original,e,l)),s=new Set(i.filter(l=>l.original.isEmpty&&l.modified.length>=3).map(l=>new _y(l.modified,t,l))),a=new Set;for(const l of r){let c=-1,u;for(const d of s){const h=l.computeSimilarity(d);h>c&&(c=h,u=d)}if(c>.9&&u&&(s.delete(u),o.push(new pf(l.range,u.range)),a.add(l.source),a.add(u.source)),!n.isValid())return{moves:o,excludedChanges:a}}return{moves:o,excludedChanges:a}}function Het(i,e,t,n,o,r){const s=[],a=new oG;for(const h of i)for(let f=h.original.startLineNumber;fh.modified.startLineNumber,zg));for(const h of i){let f=[];for(let g=h.modified.startLineNumber;g{for(const y of f)if(y.originalLineRange.endLineNumberExclusive+1===_.endLineNumberExclusive&&y.modifiedLineRange.endLineNumberExclusive+1===v.endLineNumberExclusive){y.originalLineRange=new ln(y.originalLineRange.startLineNumber,_.endLineNumberExclusive),y.modifiedLineRange=new ln(y.modifiedLineRange.startLineNumber,v.endLineNumberExclusive),m.push(y);return}const w={modifiedLineRange:v,originalLineRange:_};l.push(w),m.push(w)}),f=m}if(!r.isValid())return[]}l.sort(n_e(Nc(h=>h.modifiedLineRange.length,zg)));const c=new Mh,u=new Mh;for(const h of l){const f=h.modifiedLineRange.startLineNumber-h.originalLineRange.startLineNumber,g=c.subtractFrom(h.modifiedLineRange),p=u.subtractFrom(h.originalLineRange).getWithDelta(f),v=g.getIntersection(p);for(const m of v.ranges){if(m.length<3)continue;const _=m,w=m.delta(-f);s.push(new pf(w,_)),c.addRange(_),u.addRange(w)}}s.sort(Nc(h=>h.original.startLineNumber,zg));const d=new HI(i);for(let h=0;hD.original.startLineNumber<=f.original.startLineNumber),p=VD(i,D=>D.modified.startLineNumber<=f.modified.startLineNumber),v=Math.max(f.original.startLineNumber-g.original.startLineNumber,f.modified.startLineNumber-p.modified.startLineNumber),m=d.findLastMonotonous(D=>D.original.startLineNumberD.modified.startLineNumbern.length||E>o.length||c.contains(E)||u.contains(D)||!Joe(n[D-1],o[E-1],r))break}y>0&&(u.addRange(new ln(f.original.startLineNumber-y,f.original.startLineNumber)),c.addRange(new ln(f.modified.startLineNumber-y,f.modified.startLineNumber)));let L;for(L=0;Ln.length||E>o.length||c.contains(E)||u.contains(D)||!Joe(n[D-1],o[E-1],r))break}L>0&&(u.addRange(new ln(f.original.endLineNumberExclusive,f.original.endLineNumberExclusive+L)),c.addRange(new ln(f.modified.endLineNumberExclusive,f.modified.endLineNumberExclusive+L))),(y>0||L>0)&&(s[h]=new pf(new ln(f.original.startLineNumber-y,f.original.endLineNumberExclusive+L),new ln(f.modified.startLineNumber-y,f.modified.endLineNumberExclusive+L)))}return s}function Joe(i,e,t){if(i.trim()===e.trim())return!0;if(i.length>300&&e.length>300)return!1;const o=new O0e().compute(new QA([i],new Cn(0,1),!1),new QA([e],new Cn(0,1),!1),t);let r=0;const s=Fr.invert(o.diffs,i.length);for(const u of s)u.seq1Range.forEach(d=>{eH(i.charCodeAt(d))||r++});function a(u){let d=0;for(let h=0;he.length?i:e);return r/l>.6&&l>10}function $et(i){if(i.length===0)return i;i.sort(Nc(t=>t.original.startLineNumber,zg));const e=[i[0]];for(let t=1;t=0&&s>=0&&r+s<=2){e[e.length-1]=n.join(o);continue}e.push(o)}return e}function zet(i,e){const t=new HI(i);return e=e.filter(n=>{const o=t.findLastMonotonous(a=>a.original.endLineNumberExclusivea.modified.endLineNumberExclusive0&&(a=a.delta(c))}o.push(a)}return n.length>0&&o.push(n[n.length-1]),o}function jet(i,e,t){if(!i.getBoundaryScore||!e.getBoundaryScore)return t;for(let n=0;n0?t[n-1]:void 0,r=t[n],s=n+1=n.start&&i.seq2Range.start-s>=o.start&&t.isStronglyEqual(i.seq2Range.start-s,i.seq2Range.endExclusive-s)&&s<100;)s++;s--;let a=0;for(;i.seq1Range.start+ac&&(c=g,l=u)}return i.delta(l)}function Ket(i,e,t){const n=[];for(const o of t){const r=n[n.length-1];if(!r){n.push(o);continue}o.seq1Range.start-r.seq1Range.endExclusive<=2||o.seq2Range.start-r.seq2Range.endExclusive<=2?n[n.length-1]=new Fr(r.seq1Range.join(o.seq1Range),r.seq2Range.join(o.seq2Range)):n.push(o)}return n}function qet(i,e,t){const n=[];let o;function r(){if(!o)return;const a=o.s1Range.length-o.deleted;o.s2Range.length-o.added,Math.max(o.deleted,o.added)+(o.count-1)>a&&n.push(new Fr(o.s1Range,o.s2Range)),o=void 0}for(const a of t){let l=function(f,g){var p,v,m,_;if(!o||!o.s1Range.containsRange(f)||!o.s2Range.containsRange(g))if(o&&!(o.s1Range.endExclusive0||e.length>0;){const n=i[0],o=e[0];let r;n&&(!o||n.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 Xet(i,e,t){let n=t;if(n.length===0)return n;let o=0,r;do{r=!1;const s=[n[0]];for(let a=1;a5||f.seq1Range.length+f.seq2Range.length>5)};const l=n[a],c=s[s.length-1];u(c,l)?(r=!0,s[s.length-1]=s[s.length-1].join(l)):s.push(l)}n=s}while(o++<10&&r);return n}function Yet(i,e,t){let n=t;if(n.length===0)return n;let o=0,r;do{r=!1;const a=[n[0]];for(let l=1;l5||p.length>500)return!1;const m=i.getText(p).trim();if(m.length>20||m.split(/\r\n|\r|\n/).length>1)return!1;const _=i.countLinesIn(f.seq1Range),w=f.seq1Range.length,y=e.countLinesIn(f.seq2Range),L=f.seq2Range.length,D=i.countLinesIn(g.seq1Range),E=g.seq1Range.length,I=e.countLinesIn(g.seq2Range),k=g.seq2Range.length,R=2*40+50;function A(P){return Math.min(P,R)}return Math.pow(Math.pow(A(_*40+w),1.5)+Math.pow(A(y*40+L),1.5),1.5)+Math.pow(Math.pow(A(D*40+E),1.5)+Math.pow(A(I*40+k),1.5),1.5)>Math.pow(Math.pow(R,1.5),1.5)*1.3};const c=n[l],u=a[a.length-1];d(u,c)?(r=!0,a[a.length-1]=a[a.length-1].join(c)):a.push(c)}n=a}while(o++<10&&r);const s=[];return oXe(n,(a,l,c)=>{let u=l;function d(m){return m.length>0&&m.trim().length<=3&&l.seq1Range.length+l.seq2Range.length>100}const h=i.extendToFullLines(l.seq1Range),f=i.getText(new Cn(h.start,l.seq1Range.start));d(f)&&(u=u.deltaStart(-f.length));const g=i.getText(new Cn(l.seq1Range.endExclusive,h.endExclusive));d(g)&&(u=u.deltaEnd(g.length));const p=Fr.fromOffsetPairs(a?a.getEndExclusives():Uh.zero,c?c.getStarts():Uh.max),v=u.intersect(p);s.push(v)}),s}class tre{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:nre(this.lines[e-1]),n=e===this.lines.length?0:nre(this.lines[e]);return 1e3-(t+n)}getText(e){return this.lines.slice(e.start,e.endExclusive).join(` -`)}isStronglyEqual(e,t){return this.lines[e]===this.lines[t]}}function nre(i){let e=0;for(;eL===D))return new nM([],[],!1);if(e.length===1&&e[0].length===0||t.length===1&&t[0].length===0)return new nM([new Vc(new ln(1,e.length+1),new ln(1,t.length+1),[new xv(new V(1,1,e.length,e[0].length+1),new V(1,1,t.length,t[0].length+1))])],[],!1);const o=n.maxComputationTimeMs===0?zD.instance:new Tet(n.maxComputationTimeMs),r=!n.ignoreTrimWhitespace,s=new Map;function a(L){let D=s.get(L);return D===void 0&&(D=s.size,s.set(L,D)),D}const l=e.map(L=>a(L.trim())),c=t.map(L=>a(L.trim())),u=new tre(l,e),d=new tre(c,t),h=(()=>u.length+d.length<1700?this.dynamicProgrammingDiffing.compute(u,d,o,(L,D)=>e[L]===t[D]?t[D].length===0?.1:1+Math.log(1+t[D].length):.99):this.myersDiffingAlgorithm.compute(u,d))();let f=h.diffs,g=h.hitTimeout;f=tH(u,d,f),f=Xet(u,d,f);const p=[],v=L=>{if(!!r)for(let D=0;DL.seq1Range.start-m===L.seq2Range.start-_);const D=L.seq1Range.start-m;v(D),m=L.seq1Range.endExclusive,_=L.seq2Range.endExclusive;const E=this.refineDiff(e,t,L,o,r);E.hitTimeout&&(g=!0);for(const I of E.mappings)p.push(I)}v(e.length-m);const w=ire(p,e,t);let y=[];return n.computeMoves&&(y=this.computeMoves(w,e,t,l,c,o,r)),PD(()=>{function L(E,I){if(E.lineNumber<1||E.lineNumber>I.length)return!1;const k=I[E.lineNumber-1];return!(E.column<1||E.column>k.length+1)}function D(E,I){return!(E.startLineNumber<1||E.startLineNumber>I.length+1||E.endLineNumberExclusive<1||E.endLineNumberExclusive>I.length+1)}for(const E of w){if(!E.innerChanges)return!1;for(const I of E.innerChanges)if(!(L(I.modifiedRange.getStartPosition(),t)&&L(I.modifiedRange.getEndPosition(),t)&&L(I.originalRange.getStartPosition(),e)&&L(I.originalRange.getEndPosition(),e)))return!1;if(!D(E.modified,t)||!D(E.original,e))return!1}return!0}),new nM(w,y,g)}computeMoves(e,t,n,o,r,s,a){return Wet(e,t,n,o,r,s).map(u=>{const d=this.refineDiff(t,n,new Fr(u.original.toOffsetRange(),u.modified.toOffsetRange()),s,a),h=ire(d.mappings,t,n,!0);return new M0e(u,h)})}refineDiff(e,t,n,o,r){const s=new QA(e,n.seq1Range,r),a=new QA(t,n.seq2Range,r),l=s.length+a.length<500?this.dynamicProgrammingDiffing.compute(s,a,o):this.myersDiffingAlgorithm.compute(s,a,o);let c=l.diffs;return c=tH(s,a,c),c=qet(s,a,c),c=Ket(s,a,c),c=Yet(s,a,c),{mappings:c.map(d=>new xv(s.translateRange(d.seq1Range),a.translateRange(d.seq2Range))),hitTimeout:l.hitTimeout}}}function ire(i,e,t,n=!1){const o=[];for(const r of Zve(i.map(s=>Zet(s,e,t)),(s,a)=>s.original.overlapOrTouch(a.original)||s.modified.overlapOrTouch(a.modified))){const s=r[0],a=r[r.length-1];o.push(new Vc(s.original.join(a.original),s.modified.join(a.modified),r.map(l=>l.innerChanges[0])))}return PD(()=>!n&&o.length>0&&o[0].original.startLineNumber!==o[0].modified.startLineNumber?!1:j_e(o,(r,s)=>s.original.startLineNumber-r.original.endLineNumberExclusive===s.modified.startLineNumber-r.modified.endLineNumberExclusive&&r.original.endLineNumberExclusive=t[i.modifiedRange.startLineNumber-1].length&&i.originalRange.startColumn-1>=e[i.originalRange.startLineNumber-1].length&&i.originalRange.startLineNumber<=i.originalRange.endLineNumber+o&&i.modifiedRange.startLineNumber<=i.modifiedRange.endLineNumber+o&&(n=1);const r=new ln(i.originalRange.startLineNumber+n,i.originalRange.endLineNumber+1+o),s=new ln(i.modifiedRange.startLineNumber+n,i.modifiedRange.endLineNumber+1+o);return new Vc(r,s,[i])}const ore={getLegacy:()=>new Eet,getDefault:()=>new F0e};function Km(i,e){const t=Math.pow(10,e);return Math.round(i*t)/t}class Tn{constructor(e,t,n,o=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,n))|0,this.a=Km(Math.max(Math.min(1,o),0),3)}static equals(e,t){return e.r===t.r&&e.g===t.g&&e.b===t.b&&e.a===t.a}}class pu{constructor(e,t,n,o){this._hslaBrand=void 0,this.h=Math.max(Math.min(360,e),0)|0,this.s=Km(Math.max(Math.min(1,t),0),3),this.l=Km(Math.max(Math.min(1,n),0),3),this.a=Km(Math.max(Math.min(1,o),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,n=e.g/255,o=e.b/255,r=e.a,s=Math.max(t,n,o),a=Math.min(t,n,o);let l=0,c=0;const u=(a+s)/2,d=s-a;if(d>0){switch(c=Math.min(u<=.5?d/(2*u):d/(2-2*u),1),s){case t:l=(n-o)/d+(n1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}static toRGBA(e){const t=e.h/360,{s:n,l:o,a:r}=e;let s,a,l;if(n===0)s=a=l=o;else{const c=o<.5?o*(1+n):o+n-o*n,u=2*o-c;s=pu._hue2rgb(u,c,t+1/3),a=pu._hue2rgb(u,c,t),l=pu._hue2rgb(u,c,t-1/3)}return new Tn(Math.round(s*255),Math.round(a*255),Math.round(l*255),r)}}class jh{constructor(e,t,n,o){this._hsvaBrand=void 0,this.h=Math.max(Math.min(360,e),0)|0,this.s=Km(Math.max(Math.min(1,t),0),3),this.v=Km(Math.max(Math.min(1,n),0),3),this.a=Km(Math.max(Math.min(1,o),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,n=e.g/255,o=e.b/255,r=Math.max(t,n,o),s=Math.min(t,n,o),a=r-s,l=r===0?0:a/r;let c;return a===0?c=0:r===t?c=((n-o)/a%6+6)%6:r===n?c=(o-t)/a+2:c=(t-n)/a+4,new jh(Math.round(c*60),l,r,e.a)}static toRGBA(e){const{h:t,s:n,v:o,a:r}=e,s=o*n,a=s*(1-Math.abs(t/60%2-1)),l=o-s;let[c,u,d]=[0,0,0];return t<60?(c=s,u=a):t<120?(c=a,u=s):t<180?(u=s,d=a):t<240?(u=a,d=s):t<300?(c=a,d=s):t<=360&&(c=s,d=a),c=Math.round((c+l)*255),u=Math.round((u+l)*255),d=Math.round((d+l)*255),new Tn(c,u,d,r)}}class ve{static fromHex(e){return ve.Format.CSS.parseHex(e)||ve.red}static equals(e,t){return!e&&!t?!0:!e||!t?!1:e.equals(t)}get hsla(){return this._hsla?this._hsla:pu.fromRGBA(this.rgba)}get hsva(){return this._hsva?this._hsva:jh.fromRGBA(this.rgba)}constructor(e){if(e)if(e instanceof Tn)this.rgba=e;else if(e instanceof pu)this._hsla=e,this.rgba=pu.toRGBA(e);else if(e instanceof jh)this._hsva=e,this.rgba=jh.toRGBA(e);else throw new Error("Invalid color ctor argument");else throw new Error("Color needs a value")}equals(e){return!!e&&Tn.equals(this.rgba,e.rgba)&&pu.equals(this.hsla,e.hsla)&&jh.equals(this.hsva,e.hsva)}getRelativeLuminance(){const e=ve._relativeLuminanceForComponent(this.rgba.r),t=ve._relativeLuminanceForComponent(this.rgba.g),n=ve._relativeLuminanceForComponent(this.rgba.b),o=.2126*e+.7152*t+.0722*n;return Km(o,4)}static _relativeLuminanceForComponent(e){const t=e/255;return t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)}isLighter(){return(this.rgba.r*299+this.rgba.g*587+this.rgba.b*114)/1e3>=128}isLighterThan(e){const t=this.getRelativeLuminance(),n=e.getRelativeLuminance();return t>n}isDarkerThan(e){const t=this.getRelativeLuminance(),n=e.getRelativeLuminance();return t0)for(const o of n){const r=o.filter(c=>c!==void 0),s=r[1],a=r[2];if(!a)continue;let l;if(s==="rgb"){const c=/^\(\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*\)$/gm;l=rre(Ax(i,o),Px(a,c),!1)}else if(s==="rgba"){const c=/^\(\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(0[.][0-9]+|[.][0-9]+|[01][.]|[01])\s*\)$/gm;l=rre(Ax(i,o),Px(a,c),!0)}else if(s==="hsl"){const c=/^\(\s*(36[0]|3[0-5][0-9]|[12][0-9][0-9]|[1-9]?[0-9])\s*,\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*,\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*\)$/gm;l=sre(Ax(i,o),Px(a,c),!1)}else if(s==="hsla"){const c=/^\(\s*(36[0]|3[0-5][0-9]|[12][0-9][0-9]|[1-9]?[0-9])\s*,\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*,\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*,\s*(0[.][0-9]+|[.][0-9]+|[01][.]|[01])\s*\)$/gm;l=sre(Ax(i,o),Px(a,c),!0)}else s==="#"&&(l=Qet(Ax(i,o),s+a));l&&e.push(l)}return e}function ett(i){return!i||typeof i.getValue!="function"||typeof i.positionAt!="function"?[]:Jet(i)}var Bp=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};class ttt extends eet{get uri(){return this._uri}get eol(){return this._eol}getValue(){return this.getText()}findMatches(e){const t=[];for(let n=0;nthis._lines.length)t=this._lines.length,n=this._lines[t-1].length+1,o=!0;else{const r=this._lines[t-1].length+1;n<1?(n=1,o=!0):n>r&&(n=r,o=!0)}return o?{lineNumber:t,column:n}:e}}class qm{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 ttt(Rt.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]}computeUnicodeHighlights(e,t,n){return Bp(this,void 0,void 0,function*(){const o=this._getModel(e);return o?nG.computeUnicodeHighlights(o,t,n):{ranges:[],hasMore:!1,ambiguousCharacterCount:0,invisibleCharacterCount:0,nonBasicAsciiCharacterCount:0}})}computeDiff(e,t,n,o){return Bp(this,void 0,void 0,function*(){const r=this._getModel(e),s=this._getModel(t);return!r||!s?null:qm.computeDiff(r,s,n,o)})}static computeDiff(e,t,n,o){const r=o==="advanced"?ore.getDefault():ore.getLegacy(),s=e.getLinesContent(),a=t.getLinesContent(),l=r.computeDiff(s,a,n),c=l.changes.length>0?!1:this._modelsAreIdentical(e,t);function u(d){return d.map(h=>{var f;return[h.original.startLineNumber,h.original.endLineNumberExclusive,h.modified.startLineNumber,h.modified.endLineNumberExclusive,(f=h.innerChanges)===null||f===void 0?void 0:f.map(g=>[g.originalRange.startLineNumber,g.originalRange.startColumn,g.originalRange.endLineNumber,g.originalRange.endColumn,g.modifiedRange.startLineNumber,g.modifiedRange.startColumn,g.modifiedRange.endLineNumber,g.modifiedRange.endColumn])]})}return{identical:c,quitEarly:l.hitTimeout,changes:u(l.changes),moves:l.moves.map(d=>[d.lineRangeMapping.original.startLineNumber,d.lineRangeMapping.original.endLineNumberExclusive,d.lineRangeMapping.modified.startLineNumber,d.lineRangeMapping.modified.endLineNumberExclusive,u(d.changes)])}}static _modelsAreIdentical(e,t){const n=e.getLineCount(),o=t.getLineCount();if(n!==o)return!1;for(let r=1;r<=n;r++){const s=e.getLineContent(r),a=t.getLineContent(r);if(s!==a)return!1}return!0}computeMoreMinimalEdits(e,t,n){return Bp(this,void 0,void 0,function*(){const o=this._getModel(e);if(!o)return t;const r=[];let s;t=t.slice(0).sort((l,c)=>{if(l.range&&c.range)return V.compareRangesUsingStarts(l.range,c.range);const u=l.range?0:1,d=c.range?0:1;return u-d});let a=0;for(let l=1;lqm._diffLimit){r.push({range:l,text:c});continue}const h=ZJe(d,c,n),f=o.offsetAt(V.lift(l).getStartPosition());for(const g of h){const p=o.positionAt(f+g.originalStart),v=o.positionAt(f+g.originalStart+g.originalLength),m={text:c.substr(g.modifiedStart,g.modifiedLength),range:{startLineNumber:p.lineNumber,startColumn:p.column,endLineNumber:v.lineNumber,endColumn:v.column}};o.getValueInRange(m.range)!==m.text&&r.push(m)}}return typeof s=="number"&&r.push({eol:s,text:"",range:{startLineNumber:0,startColumn:0,endLineNumber:0,endColumn:0}}),r})}computeLinks(e){return Bp(this,void 0,void 0,function*(){const t=this._getModel(e);return t?ret(t):null})}computeDefaultDocumentColors(e){return Bp(this,void 0,void 0,function*(){const t=this._getModel(e);return t?ett(t):null})}textualSuggest(e,t,n,o){return Bp(this,void 0,void 0,function*(){const r=new xs,s=new RegExp(n,o),a=new Set;e:for(const l of e){const c=this._getModel(l);if(!!c){for(const u of c.words(s))if(!(u===t||!isNaN(Number(u)))&&(a.add(u),a.size>qm._suggestionsLimit))break e}}return{words:Array.from(a),duration:r.elapsed()}})}computeWordRanges(e,t,n,o){return Bp(this,void 0,void 0,function*(){const r=this._getModel(e);if(!r)return Object.create(null);const s=new RegExp(n,o),a=Object.create(null);for(let l=t.startLineNumber;lthis._host.fhr(a,l)),getMirrorModels:()=>this._getModels()};return this._foreignModuleFactory?(this._foreignModule=this._foreignModuleFactory(s,t),Promise.resolve(Dq(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(n){return Promise.reject(n)}}}qm._diffLimit=1e5;qm._suggestionsLimit=1e4;typeof importScripts=="function"&&(globalThis.monaco=N_e());const sG=wn("textResourceConfigurationService"),W0e=wn("textResourcePropertiesService"),pt=wn("ILanguageFeaturesService");var ntt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Ox=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},JA=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};const are=60*1e3,lre=5*60*1e3;function W_(i,e){const t=i.getModel(e);return!(!t||t.isTooLargeForSyncing())}let nH=class extends _e{constructor(e,t,n,o,r){super(),this._modelService=e,this._workerManager=this._register(new ott(this._modelService,o)),this._logService=n,this._register(r.linkProvider.register({language:"*",hasAccessToAllModels:!0},{provideLinks:(s,a)=>W_(this._modelService,s.uri)?this._workerManager.withWorker().then(l=>l.computeLinks(s.uri)).then(l=>l&&{links:l}):Promise.resolve({links:[]})})),this._register(r.completionProvider.register("*",new itt(this._workerManager,t,this._modelService,o)))}dispose(){super.dispose()}canComputeUnicodeHighlights(e){return W_(this._modelService,e)}computedUnicodeHighlights(e,t,n){return this._workerManager.withWorker().then(o=>o.computedUnicodeHighlights(e,t,n))}computeDiff(e,t,n,o){return JA(this,void 0,void 0,function*(){const r=yield this._workerManager.withWorker().then(l=>l.computeDiff(e,t,n,o));if(!r)return null;return{identical:r.identical,quitEarly:r.quitEarly,changes:a(r.changes),moves:r.moves.map(l=>new M0e(new pf(new ln(l[0],l[1]),new ln(l[2],l[3])),a(l[4])))};function a(l){return l.map(c=>{var u;return new Vc(new ln(c[0],c[1]),new ln(c[2],c[3]),(u=c[4])===null||u===void 0?void 0:u.map(d=>new xv(new V(d[0],d[1],d[2],d[3]),new V(d[4],d[5],d[6],d[7]))))})}})}computeMoreMinimalEdits(e,t,n=!1){if(ws(t)){if(!W_(this._modelService,e))return Promise.resolve(t);const o=xs.create(),r=this._workerManager.withWorker().then(s=>s.computeMoreMinimalEdits(e,t,n));return r.finally(()=>this._logService.trace("FORMAT#computeMoreMinimalEdits",e.toString(!0),o.elapsed())),Promise.race([r,wv(1e3).then(()=>t)])}else return Promise.resolve(void 0)}canNavigateValueSet(e){return W_(this._modelService,e)}navigateValueSet(e,t,n){return this._workerManager.withWorker().then(o=>o.navigateValueSet(e,t,n))}canComputeWordRanges(e){return W_(this._modelService,e)}computeWordRanges(e,t){return this._workerManager.withWorker().then(n=>n.computeWordRanges(e,t))}};nH=ntt([Ox(0,Yi),Ox(1,sG),Ox(2,tc),Ox(3,Ti),Ox(4,pt)],nH);class itt{constructor(e,t,n,o){this.languageConfigurationService=o,this._debugDisplayName="wordbasedCompletions",this._workerManager=e,this._configurationService=t,this._modelService=n}provideCompletionItems(e,t){return JA(this,void 0,void 0,function*(){const n=this._configurationService.getValue(e.uri,t,"editor");if(!n.wordBasedSuggestions)return;const o=[];if(n.wordBasedSuggestionsMode==="currentDocument")W_(this._modelService,e.uri)&&o.push(e.uri);else for(const d of this._modelService.getModels())!W_(this._modelService,d.uri)||(d===e?o.unshift(d.uri):(n.wordBasedSuggestionsMode==="allDocuments"||d.getLanguageId()===e.getLanguageId())&&o.push(d.uri));if(o.length===0)return;const r=this.languageConfigurationService.getLanguageConfiguration(e.getLanguageId()).getWordDefinition(),s=e.getWordAtPosition(t),a=s?new V(t.lineNumber,s.startColumn,t.lineNumber,s.endColumn):V.fromPositions(t),l=a.setEndPosition(t.lineNumber,t.column),u=yield(yield this._workerManager.withWorker()).textualSuggest(o,s==null?void 0:s.word,r);if(!!u)return{duration:u.duration,suggestions:u.words.map(d=>({kind:18,label:d,insertText:d,range:{insert:l,replace:a}}))}})}}class ott extends _e{constructor(e,t){super(),this.languageConfigurationService=t,this._modelService=e,this._editorWorkerClient=null,this._lastWorkerUsedTime=new Date().getTime(),this._register(new VI).cancelAndSet(()=>this._checkStopIdleWorker(),Math.round(lre/2)),this._register(this._modelService.onModelRemoved(o=>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>lre&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null)}withWorker(){return this._lastWorkerUsedTime=new Date().getTime(),this._editorWorkerClient||(this._editorWorkerClient=new aG(this._modelService,!1,"editorWorkerService",this.languageConfigurationService)),Promise.resolve(this._editorWorkerClient)}}class rtt extends _e{constructor(e,t,n){if(super(),this._syncedModels=Object.create(null),this._syncedModelsLastUsedTime=Object.create(null),this._proxy=e,this._modelService=t,!n){const o=new VI;o.cancelAndSet(()=>this._checkStopModelSync(),Math.round(are/2)),this._register(o)}}dispose(){for(const e in this._syncedModels)si(this._syncedModels[e]);this._syncedModels=Object.create(null),this._syncedModelsLastUsedTime=Object.create(null),super.dispose()}ensureSyncedResources(e,t){for(const n of e){const o=n.toString();this._syncedModels[o]||this._beginModelSync(n,t),this._syncedModels[o]&&(this._syncedModelsLastUsedTime[o]=new Date().getTime())}}_checkStopModelSync(){const e=new Date().getTime(),t=[];for(const n in this._syncedModelsLastUsedTime)e-this._syncedModelsLastUsedTime[n]>are&&t.push(n);for(const n of t)this._stopModelSync(n)}_beginModelSync(e,t){const n=this._modelService.getModel(e);if(!n||!t&&n.isTooLargeForSyncing())return;const o=e.toString();this._proxy.acceptNewModel({url:n.uri.toString(),lines:n.getLinesContent(),EOL:n.getEOL(),versionId:n.getVersionId()});const r=new Be;r.add(n.onDidChangeContent(s=>{this._proxy.acceptModelChanged(o.toString(),s)})),r.add(n.onWillDispose(()=>{this._stopModelSync(o)})),r.add(zt(()=>{this._proxy.acceptRemovedModel(o)})),this._syncedModels[o]=r}_stopModelSync(e){const t=this._syncedModels[e];delete this._syncedModels[e],delete this._syncedModelsLastUsedTime[e],si(t)}}class cre{constructor(e){this._instance=e,this._proxyObj=Promise.resolve(this._instance)}dispose(){this._instance.dispose()}getProxyObject(){return this._proxyObj}}class e9{constructor(e){this._workerClient=e}fhr(e,t){return this._workerClient.fhr(e,t)}}class aG extends _e{constructor(e,t,n,o){super(),this.languageConfigurationService=o,this._disposed=!1,this._modelService=e,this._keepIdleModels=t,this._workerFactory=new n5(n),this._worker=null,this._modelManager=null}fhr(e,t){throw new Error("Not implemented!")}_getOrCreateWorker(){if(!this._worker)try{this._worker=this._register(new sJe(this._workerFactory,"vs/editor/common/services/editorSimpleWorker",new e9(this)))}catch(e){qV(e),this._worker=new cre(new qm(new e9(this),null))}return this._worker}_getProxy(){return this._getOrCreateWorker().getProxyObject().then(void 0,e=>(qV(e),this._worker=new cre(new qm(new e9(this),null)),this._getOrCreateWorker().getProxyObject()))}_getOrCreateModelManager(e){return this._modelManager||(this._modelManager=this._register(new rtt(e,this._modelService,this._keepIdleModels))),this._modelManager}_withSyncedResources(e,t=!1){return JA(this,void 0,void 0,function*(){return this._disposed?Promise.reject(vYe()):this._getProxy().then(n=>(this._getOrCreateModelManager(n).ensureSyncedResources(e,t),n))})}computedUnicodeHighlights(e,t,n){return this._withSyncedResources([e]).then(o=>o.computeUnicodeHighlights(e.toString(),t,n))}computeDiff(e,t,n,o){return this._withSyncedResources([e,t],!0).then(r=>r.computeDiff(e.toString(),t.toString(),n,o))}computeMoreMinimalEdits(e,t,n){return this._withSyncedResources([e]).then(o=>o.computeMoreMinimalEdits(e.toString(),t,n))}computeLinks(e){return this._withSyncedResources([e]).then(t=>t.computeLinks(e.toString()))}computeDefaultDocumentColors(e){return this._withSyncedResources([e]).then(t=>t.computeDefaultDocumentColors(e.toString()))}textualSuggest(e,t,n){return JA(this,void 0,void 0,function*(){const o=yield this._withSyncedResources(e),r=n.source,s=n.flags;return o.textualSuggest(e.map(a=>a.toString()),t,r,s)})}computeWordRanges(e,t){return this._withSyncedResources([e]).then(n=>{const o=this._modelService.getModel(e);if(!o)return Promise.resolve(null);const r=this.languageConfigurationService.getLanguageConfiguration(o.getLanguageId()).getWordDefinition(),s=r.source,a=r.flags;return n.computeWordRanges(e.toString(),t,s,a)})}navigateValueSet(e,t,n){return this._withSyncedResources([e]).then(o=>{const r=this._modelService.getModel(e);if(!r)return null;const s=this.languageConfigurationService.getLanguageConfiguration(r.getLanguageId()).getWordDefinition(),a=s.source,l=s.flags;return o.navigateValueSet(e.toString(),t,n,a,l)})}dispose(){super.dispose(),this._disposed=!0}}function stt(i,e,t){return new att(i,e,t)}class att extends aG{constructor(e,t,n){super(e,n.keepIdleModels||!1,n.label,t),this._foreignModuleId=n.moduleId,this._foreignModuleCreateData=n.createData||null,this._foreignModuleHost=n.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(n){return Promise.reject(n)}}_getForeignProxy(){return this._foreignProxy||(this._foreignProxy=this._getProxy().then(e=>{const t=this._foreignModuleHost?Dq(this._foreignModuleHost):[];return e.loadForeignModule(this._foreignModuleId,this._foreignModuleCreateData,t).then(n=>{this._foreignModuleCreateData=null;const o=(a,l)=>e.fmr(a,l),r=(a,l)=>function(){const c=Array.prototype.slice.call(arguments,0);return l(a,c)},s={};for(const a of n)s[a]=r(a,o);return s})})),this._foreignProxy}getProxy(){return this._getForeignProxy()}withSyncedResources(e){return this._withSyncedResources(e).then(t=>this.getProxy())}}const $I={ICodeEditor:"vs.editor.ICodeEditor",IDiffEditor:"vs.editor.IDiffEditor"},by=new class{clone(){return this}equals(i){return this===i}};function lG(i,e){return new Bq([new ID(0,"",i)],e)}function u5(i,e){const t=new Uint32Array(2);return t[0]=0,t[1]=(i<<0|0<<8|0<<11|1<<15|2<<24)>>>0,new V4(t,e===null?by:e)}class ns{static getLanguageId(e){return(e&255)>>>0}static getTokenType(e){return(e&768)>>>8}static containsBalancedBrackets(e){return(e&1024)!==0}static getFontStyle(e){return(e&30720)>>>11}static getForeground(e){return(e&16744448)>>>15}static getBackground(e){return(e&4278190080)>>>24}static getClassNameFromMetadata(e){const t=this.getForeground(e);let n="mtk"+t;const o=this.getFontStyle(e);return o&1&&(n+=" mtki"),o&2&&(n+=" mtkb"),o&4&&(n+=" mtku"),o&8&&(n+=" mtks"),n}static getInlineStyleFromMetadata(e,t){const n=this.getForeground(e),o=this.getFontStyle(e);let r=`color: ${t[n]};`;o&1&&(r+="font-style: italic;"),o&2&&(r+="font-weight: bold;");let s="";return o&4&&(s+=" underline"),o&8&&(s+=" line-through"),s&&(r+=`text-decoration:${s};`),r}static getPresentationFromMetadata(e){const t=this.getForeground(e),n=this.getFontStyle(e);return{foreground:t,italic:Boolean(n&1),bold:Boolean(n&2),underline:Boolean(n&4),strikethrough:Boolean(n&8)}}}class gr{static createEmpty(e,t){const n=gr.defaultTokenMetadata,o=new Uint32Array(2);return o[0]=e.length,o[1]=n,new gr(o,e,t)}constructor(e,t,n){this._lineTokensBrand=void 0,this._tokens=e,this._tokensCount=this._tokens.length>>>1,this._text=t,this._languageIdCodec=n}equals(e){return e instanceof gr?this.slicedEquals(e,0,this._tokensCount):!1}slicedEquals(e,t,n){if(this._text!==e._text||this._tokensCount!==e._tokensCount)return!1;const o=t<<1,r=o+(n<<1);for(let s=o;s0?this._tokens[e-1<<1]:0}getMetadata(e){return this._tokens[(e<<1)+1]}getLanguageId(e){const t=this._tokens[(e<<1)+1],n=ns.getLanguageId(t);return this._languageIdCodec.decodeLanguageId(n)}getStandardTokenType(e){const t=this._tokens[(e<<1)+1];return ns.getTokenType(t)}getForeground(e){const t=this._tokens[(e<<1)+1];return ns.getForeground(t)}getClassName(e){const t=this._tokens[(e<<1)+1];return ns.getClassNameFromMetadata(t)}getInlineStyle(e,t){const n=this._tokens[(e<<1)+1];return ns.getInlineStyleFromMetadata(n,t)}getPresentation(e){const t=this._tokens[(e<<1)+1];return ns.getPresentationFromMetadata(t)}getEndOffset(e){return this._tokens[e<<1]}findTokenIndexAtOffset(e){return gr.findIndexInTokensArray(this._tokens,e)}inflate(){return this}sliceAndInflate(e,t,n){return new cG(this,e,t,n)}static convertToEndOffset(e,t){const o=(e.length>>>1)-1;for(let r=0;r>>1)-1;for(;nt&&(o=r)}return n}withInserted(e){if(e.length===0)return this;let t=0,n=0,o="";const r=new Array;let s=0;for(;;){const a=ts){o+=this._text.substring(s,l.offset);const c=this._tokens[(t<<1)+1];r.push(o.length,c),s=l.offset}o+=l.text,r.push(o.length,l.tokenMetadata),n++}else break}return new gr(new Uint32Array(r),o,this._languageIdCodec)}}gr.defaultTokenMetadata=(0<<11|1<<15|2<<24)>>>0;class cG{constructor(e,t,n,o){this._source=e,this._startOffset=t,this._endOffset=n,this._deltaOffset=o,this._firstTokenIndex=e.findTokenIndexAtOffset(t),this._tokensCount=0;for(let r=this._firstTokenIndex,s=e.getCount();r=n);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 cG?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}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}}class ol{constructor(e,t,n,o){this.startColumn=e,this.endColumn=t,this.className=n,this.type=o,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 n=e.length,o=t.length;if(n!==o)return!1;for(let r=0;r=r||(a[l++]=new ol(Math.max(1,c.startColumn-o+1),Math.min(s+1,c.endColumn-o+1),c.className,c.type));return a}static filter(e,t,n,o){if(e.length===0)return[];const r=[];let s=0;for(let a=0,l=e.length;at||u.isEmpty()&&(c.type===0||c.type===3))continue;const d=u.startLineNumber===t?u.startColumn:n,h=u.endLineNumber===t?u.endColumn:o;r[s++]=new ol(d,h,c.inlineClassName,c.type)}return r}static _typeCompare(e,t){const n=[2,0,1,3];return n[e]-n[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 n=ol._typeCompare(e.type,t.type);return n!==0?n:e.className!==t.className?e.className0&&this.stopOffsets[0]0&&t=e){this.stopOffsets.splice(o,0,e),this.classNames.splice(o,0,t),this.metadata.splice(o,0,n);break}this.count++}}class ltt{static normalize(e,t){if(t.length===0)return[];const n=[],o=new eP;let r=0;for(let s=0,a=t.length;s1){const p=e.charCodeAt(c-2);fr(p)&&c--}if(u>1){const p=e.charCodeAt(u-2);fr(p)&&u--}const f=c-1,g=u-2;r=o.consumeLowerThan(f,r,n),o.count===0&&(r=f),o.insert(g,d,h)}return o.consumeLowerThan(1073741824,r,n),n}}class Lr{constructor(e,t,n,o){this.endIndex=e,this.type=t,this.metadata=n,this.containsRTL=o,this._linePartBrand=void 0}isWhitespace(){return!!(this.metadata&1)}isPseudoAfter(){return!!(this.metadata&4)}}class V0e{constructor(e,t){this.startOffset=e,this.endOffset=t}equals(e){return this.startOffset===e.startOffset&&this.endOffset===e.endOffset}}class Zv{constructor(e,t,n,o,r,s,a,l,c,u,d,h,f,g,p,v,m,_,w){this.useMonospaceOptimizations=e,this.canUseHalfwidthRightwardsArrow=t,this.lineContent=n,this.continuesWithWrappedLine=o,this.isBasicASCII=r,this.containsRTL=s,this.fauxIndentLength=a,this.lineTokens=l,this.lineDecorations=c.sort(ol.compare),this.tabSize=u,this.startVisibleColumn=d,this.spaceWidth=h,this.stopRenderingLineAfter=p,this.renderWhitespace=v==="all"?4:v==="boundary"?1:v==="selection"?2:v==="trailing"?3:0,this.renderControlCharacters=m,this.fontLigatures=_,this.selectionsOnLine=w&&w.sort((D,E)=>D.startOffset>>16}static getCharIndex(e){return(e&65535)>>>0}constructor(e,t){this.length=e,this._data=new Uint32Array(this.length),this._horizontalOffset=new Uint32Array(this.length)}setColumnInfo(e,t,n,o){const r=(t<<16|n<<0)>>>0;this._data[e-1]=r,this._horizontalOffset[e-1]=o}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),n=kh.getPartIndex(t),o=kh.getCharIndex(t);return new H0e(n,o)}getColumn(e,t){return this.partDataToCharOffset(e.partIndex,t,e.charIndex)+1}partDataToCharOffset(e,t,n){if(this.length===0)return 0;const o=(e<<16|n<<0)>>>0;let r=0,s=this.length-1;for(;r+1>>1,v=this._data[p];if(v===o)return p;v>o?s=p:r=p}if(r===s)return r;const a=this._data[r],l=this._data[s];if(a===o)return r;if(l===o)return s;const c=kh.getPartIndex(a),u=kh.getCharIndex(a),d=kh.getPartIndex(l);let h;c!==d?h=t:h=kh.getCharIndex(l);const f=n-u,g=h-n;return f<=g?r:s}}class iH{constructor(e,t,n){this._renderLineOutputBrand=void 0,this.characterMapping=e,this.containsRTL=t,this.containsForeignElements=n}}function zI(i,e){if(i.lineContent.length===0){if(i.lineDecorations.length>0){e.appendString("");let t=0,n=0,o=0;for(const s of i.lineDecorations)(s.type===1||s.type===2)&&(e.appendString(''),s.type===1&&(o|=1,t++),s.type===2&&(o|=2,n++));e.appendString("");const r=new kh(1,t+n);return r.setColumnInfo(1,t,0,0),new iH(r,!1,o)}return e.appendString(""),new iH(new kh(0,0),!1,0)}return vtt(dtt(i),e)}class ctt{constructor(e,t,n,o){this.characterMapping=e,this.html=t,this.containsRTL=n,this.containsForeignElements=o}}function d5(i){const e=new _S(1e4),t=zI(i,e);return new ctt(t.characterMapping,e.build(),t.containsRTL,t.containsForeignElements)}class utt{constructor(e,t,n,o,r,s,a,l,c,u,d,h,f,g,p,v){this.fontIsMonospace=e,this.canUseHalfwidthRightwardsArrow=t,this.lineContent=n,this.len=o,this.isOverflowing=r,this.overflowingCharCount=s,this.parts=a,this.containsForeignElements=l,this.fauxIndentLength=c,this.tabSize=u,this.startVisibleColumn=d,this.containsRTL=h,this.spaceWidth=f,this.renderSpaceCharCode=g,this.renderWhitespace=p,this.renderControlCharacters=v}}function dtt(i){const e=i.lineContent;let t,n,o;i.stopRenderingLineAfter!==-1&&i.stopRenderingLineAfter0){for(let a=0,l=i.lineDecorations.length;a0&&(r[s++]=new Lr(n,"",0,!1));let a=n;for(let l=0,c=t.getCount();l=o){const f=e?hy(i.substring(a,o)):!1;r[s++]=new Lr(o,d,0,f);break}const h=e?hy(i.substring(a,u)):!1;r[s++]=new Lr(u,d,0,h),a=u}return r}function ftt(i,e,t){let n=0;const o=[];let r=0;if(t)for(let s=0,a=e.length;s=50&&(o[r++]=new Lr(f+1,u,d,h),g=f+1,f=-1);g!==c&&(o[r++]=new Lr(c,u,d,h))}else o[r++]=l;n=c}else for(let s=0,a=e.length;s50){const d=l.type,h=l.metadata,f=l.containsRTL,g=Math.ceil(u/50);for(let p=1;p=8234&&i<=8238||i>=8294&&i<=8297||i>=8206&&i<=8207||i===1564}function gtt(i,e){const t=[];let n=new Lr(0,"",0,!1),o=0;for(const r of e){const s=r.endIndex;for(;on.endIndex&&(n=new Lr(o,r.type,r.metadata,r.containsRTL),t.push(n)),n=new Lr(o+1,"mtkcontrol",r.metadata,!1),t.push(n))}o>n.endIndex&&(n=new Lr(s,r.type,r.metadata,r.containsRTL),t.push(n))}return t}function ptt(i,e,t,n){const o=i.continuesWithWrappedLine,r=i.fauxIndentLength,s=i.tabSize,a=i.startVisibleColumn,l=i.useMonospaceOptimizations,c=i.selectionsOnLine,u=i.renderWhitespace===1,d=i.renderWhitespace===3,h=i.renderSpaceWidth!==i.spaceWidth,f=[];let g=0,p=0,v=n[p].type,m=n[p].containsRTL,_=n[p].endIndex;const w=n.length;let y=!1,L=Ws(e),D;L===-1?(y=!0,L=t,D=t):D=Wd(e);let E=!1,I=0,k=c&&c[I],R=a%s;for(let P=r;P=k.endOffset&&(I++,k=c&&c[I]);let M;if(PD)M=!0;else if(N===9)M=!0;else if(N===32)if(u)if(E)M=!0;else{const H=P+1P),M&&d&&(M=y||P>D),M&&m&&P>=L&&P<=D&&(M=!1),E){if(!M||!l&&R>=s){if(h){const H=g>0?f[g-1].endIndex:r;for(let W=H+1;W<=P;W++)f[g++]=new Lr(W,"mtkw",1,!1)}else f[g++]=new Lr(P,"mtkw",1,!1);R=R%s}}else(P===_||M&&P>r)&&(f[g++]=new Lr(P,v,0,m),R=R%s);for(N===9?R=s:bv(N)?R+=2:R++,E=M;P===_&&(p++,p0?e.charCodeAt(t-1):0,N=t>1?e.charCodeAt(t-2):0;P===32&&N!==32&&N!==9||(A=!0)}else A=!0;if(A)if(h){const P=g>0?f[g-1].endIndex:r;for(let N=P+1;N<=t;N++)f[g++]=new Lr(N,"mtkw",1,!1)}else f[g++]=new Lr(t,"mtkw",1,!1);else f[g++]=new Lr(t,v,0,m);return f}function mtt(i,e,t,n){n.sort(ol.compare);const o=ltt.normalize(i,n),r=o.length;let s=0;const a=[];let l=0,c=0;for(let d=0,h=t.length;dc&&(c=_.startOffset,a[l++]=new Lr(c,p,v,m)),_.endOffset+1<=g)c=_.endOffset+1,a[l++]=new Lr(c,p+" "+_.className,v|_.metadata,m),s++;else{c=g,a[l++]=new Lr(c,p+" "+_.className,v|_.metadata,m);break}}g>c&&(c=g,a[l++]=new Lr(c,p,v,m))}const u=t[t.length-1].endIndex;if(s'):e.appendString("");for(let k=0,R=c.length;k=u&&(K+=G)}}for(W&&(e.appendString(' style="width:'),e.appendString(String(g*$)),e.appendString('px"')),e.appendASCIICharCode(62);y1?e.appendCharCode(8594):e.appendCharCode(65515);for(let G=2;G<=j;G++)e.appendCharCode(160)}else K=2,j=1,e.appendCharCode(p),e.appendCharCode(8204);D+=K,E+=j,y>=u&&(L+=j)}}else for(e.appendASCIICharCode(62);y=u&&(L+=K)}F?I++:I=0,y>=s&&!w&&A.isPseudoAfter()&&(w=!0,_.setColumnInfo(y+1,k,D,E)),e.appendString("")}return w||_.setColumnInfo(s+1,c.length-1,D,E),a&&(e.appendString(''),e.appendString(C("showMore","Show more ({0})",btt(l))),e.appendString("")),e.appendString(""),new iH(_,f,o)}function _tt(i){return i.toString(16).toUpperCase().padStart(4,"0")}function btt(i){return i<1024?C("overflow.chars","{0} chars",i):i<1024*1024?`${(i/1024).toFixed(1)} KB`:`${(i/1024/1024).toFixed(1)} MB`}class dre{constructor(e,t,n,o){this._viewportBrand=void 0,this.top=e|0,this.left=t|0,this.width=n|0,this.height=o|0}}class Ctt{constructor(e,t){this.tabSize=e,this.data=t}}class uG{constructor(e,t,n,o,r,s,a){this._viewLineDataBrand=void 0,this.content=e,this.continuesWithWrappedLine=t,this.minColumn=n,this.maxColumn=o,this.startVisibleColumn=r,this.tokens=s,this.inlineDecorations=a}}class Yl{constructor(e,t,n,o,r,s,a,l,c,u){this.minColumn=e,this.maxColumn=t,this.content=n,this.continuesWithWrappedLine=o,this.isBasicASCII=Yl.isBasicASCII(n,s),this.containsRTL=Yl.containsRTL(n,this.isBasicASCII,r),this.tokens=a,this.inlineDecorations=l,this.tabSize=c,this.startVisibleColumn=u}static isBasicASCII(e,t){return t?BI(e):!0}static containsRTL(e,t,n){return!t&&n?hy(e):!1}}class cE{constructor(e,t,n){this.range=e,this.inlineClassName=t,this.type=n}}class wtt{constructor(e,t,n,o){this.startOffset=e,this.endOffset=t,this.inlineClassName=n,this.inlineClassNameAffectsLetterSpacing=o}toInlineDecoration(e){return new cE(new V(e,this.startOffset+1,e,this.endOffset+1),this.inlineClassName,this.inlineClassNameAffectsLetterSpacing?3:0)}}class z0e{constructor(e,t){this._viewModelDecorationBrand=void 0,this.range=e,this.options=t}}class UD{constructor(e,t,n){this.color=e,this.zIndex=t,this.data=n}static compareByRenderingProps(e,t){return e.zIndex===t.zIndex?e.colort.color?1:0:e.zIndex-t.zIndex}static equals(e,t){return e.color===t.color&&e.zIndex===t.zIndex&&Lo(e.data,t.data)}static equalsArr(e,t){return Lo(e,t,UD.equals)}}function ytt(i){return Array.isArray(i)}function Stt(i){return!ytt(i)}function U0e(i){return typeof i=="string"}function hre(i){return!U0e(i)}function cC(i){return!i}function Gm(i,e){return i.ignoreCase&&e?e.toLowerCase():e}function fre(i){return i.replace(/[&<>'"_]/g,"-")}function xtt(i,e){console.log(`${i.languageId}: ${e}`)}function Bi(i,e){return new Error(`${i.languageId}: ${e}`)}function sm(i,e,t,n,o){const r=/\$((\$)|(#)|(\d\d?)|[sS](\d\d?)|@(\w+))/g;let s=null;return e.replace(r,function(a,l,c,u,d,h,f,g,p){return cC(c)?cC(u)?!cC(d)&&d0;){const n=i.tokenizer[t];if(n)return n;const o=t.lastIndexOf(".");o<0?t=null:t=t.substr(0,o)}return null}function Ltt(i,e){let t=e;for(;t&&t.length>0;){if(i.stateNames[t])return!0;const o=t.lastIndexOf(".");o<0?t=null:t=t.substr(0,o)}return!1}var Ett=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Dtt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},oH;const j0e=5;class jD{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 yw(e,t);let n=yw.getStackElementId(e);n.length>0&&(n+="|"),n+=t;let o=this._entries[n];return o||(o=new yw(e,t),this._entries[n]=o,o)}}jD._INSTANCE=new jD(j0e);class yw{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 yw._equals(this,e)}push(e){return jD.create(this,e)}pop(){return this.parent}popall(){let e=this;for(;e.parent;)e=e.parent;return e}switchTo(e){return jD.create(this.parent,e)}}class RC{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 RC(this.languageId,this.state)}}class am{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 uE(e,t);if(e!==null&&e.depth>=this._maxCacheDepth)return new uE(e,t);const n=yw.getStackElementId(e);let o=this._entries[n];return o||(o=new uE(e,null),this._entries[n]=o,o)}}am._INSTANCE=new am(j0e);class uE{constructor(e,t){this.stack=e,this.embeddedLanguageData=t}clone(){return(this.embeddedLanguageData?this.embeddedLanguageData.clone():null)===this.embeddedLanguageData?this:am.create(this.stack,this.embeddedLanguageData)}equals(e){return!(e instanceof uE)||!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 ktt{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 ID(e,t,this._languageId)))}nestedLanguageTokenize(e,t,n,o){const r=n.languageId,s=n.state,a=oo.get(r);if(!a)return this.enterLanguage(r),this.emit(o,""),s;const l=a.tokenize(e,t,s);if(o!==0)for(const c of l.tokens)this._tokens.push(new ID(c.offset+o,c.type,c.language));else this._tokens=this._tokens.concat(l.tokens);return this._lastTokenType=null,this._lastTokenLanguage=null,this._languageId=null,l.endState}finalize(e){return new Bq(this._tokens,e)}}class tP{constructor(e,t){this._languageService=e,this._theme=t,this._prependTokens=null,this._tokens=[],this._currentLanguageId=0,this._lastTokenMetadata=0}enterLanguage(e){this._currentLanguageId=this._languageService.languageIdCodec.encodeLanguageId(e)}emit(e,t){const n=this._theme.match(this._currentLanguageId,t)|1024;this._lastTokenMetadata!==n&&(this._lastTokenMetadata=n,this._tokens.push(e),this._tokens.push(n))}static _merge(e,t,n){const o=e!==null?e.length:0,r=t.length,s=n!==null?n.length:0;if(o===0&&r===0&&s===0)return new Uint32Array(0);if(o===0&&r===0)return n;if(r===0&&s===0)return e;const a=new Uint32Array(o+r+s);e!==null&&a.set(e);for(let l=0;l{if(s)return;let l=!1;for(let c=0,u=a.changedLanguages.length;c{a.affectsConfiguration("editor.maxTokenizationLineLength")&&(this._maxTokenizationLineLength=this._configurationService.getValue("editor.maxTokenizationLineLength",{overrideIdentifier:this._languageId}))}))}getLoadStatus(){const e=[];for(const t in this._embeddedLanguages){const n=oo.get(t);if(n){if(n instanceof oH){const o=n.getLoadStatus();o.loaded===!1&&e.push(o.promise)}continue}oo.isResolved(t)||e.push(oo.getOrCreate(t))}return e.length===0?{loaded:!0}:{loaded:!1,promise:Promise.all(e).then(t=>{})}}getInitialState(){const e=jD.create(null,this._lexer.start);return am.create(e,null)}tokenize(e,t,n){if(e.length>=this._maxTokenizationLineLength)return lG(this._languageId,n);const o=new ktt,r=this._tokenize(e,t,n,o);return o.finalize(r)}tokenizeEncoded(e,t,n){if(e.length>=this._maxTokenizationLineLength)return u5(this._languageService.languageIdCodec.encodeLanguageId(this._languageId),n);const o=new tP(this._languageService,this._standaloneThemeService.getColorTheme().tokenTheme),r=this._tokenize(e,t,n,o);return o.finalize(r)}_tokenize(e,t,n,o){return n.embeddedLanguageData?this._nestedTokenize(e,t,n,0,o):this._myTokenize(e,t,n,0,o)}_findLeavingNestedLanguageOffset(e,t){let n=this._lexer.tokenizer[t.stack.state];if(!n&&(n=r2(this._lexer,t.stack.state),!n))throw Bi(this._lexer,"tokenizer state is not defined: "+t.stack.state);let o=-1,r=!1;for(const s of n){if(!hre(s.action)||s.action.nextEmbedded!=="@pop")continue;r=!0;let a=s.regex;const l=s.regex.source;if(l.substr(0,4)==="^(?:"&&l.substr(l.length-1,1)===")"){const u=(a.ignoreCase?"i":"")+(a.unicode?"u":"");a=new RegExp(l.substr(4,l.length-5),u)}const c=e.search(a);c===-1||c!==0&&s.matchOnlyAtLineStart||(o===-1||c0&&r.nestedLanguageTokenize(a,!1,n.embeddedLanguageData,o);const l=e.substring(s);return this._myTokenize(l,t,n,o+s,r)}_safeRuleName(e){return e?e.name:"(unknown)"}_myTokenize(e,t,n,o,r){r.enterLanguage(this._languageId);const s=e.length,a=t&&this._lexer.includeLF?e+` -`:e,l=a.length;let c=n.embeddedLanguageData,u=n.stack,d=0,h=null,f=!0;for(;f||d=l)break;f=!1;let k=this._lexer.tokenizer[m];if(!k&&(k=r2(this._lexer,m),!k))throw Bi(this._lexer,"tokenizer state is not defined: "+m);const R=a.substr(d);for(const A of k)if((d===0||!A.matchOnlyAtLineStart)&&(_=R.match(A.regex),_)){w=_[0],y=A.action;break}}if(_||(_=[""],w=""),y||(d=this._lexer.maxStack)throw Bi(this._lexer,"maximum tokenizer stack size reached: ["+u.state+","+u.parent.state+",...]");u=u.push(m)}else if(y.next==="@pop"){if(u.depth<=1)throw Bi(this._lexer,"trying to pop an empty stack in rule: "+this._safeRuleName(L));u=u.pop()}else if(y.next==="@popall")u=u.popall();else{let k=sm(this._lexer,y.next,w,_,m);if(k[0]==="@"&&(k=k.substr(1)),r2(this._lexer,k))u=u.push(k);else throw Bi(this._lexer,"trying to set a next state '"+k+"' that is undefined in rule: "+this._safeRuleName(L))}}y.log&&typeof y.log=="string"&&xtt(this._lexer,this._lexer.languageId+": "+sm(this._lexer,y.log,w,_,m))}if(E===null)throw Bi(this._lexer,"lexer rule has no well-defined action in rule: "+this._safeRuleName(L));const I=k=>{const R=this._languageService.getLanguageIdByLanguageName(k)||this._languageService.getLanguageIdByMimeType(k)||k,A=this._getNestedEmbeddedLanguageData(R);if(d0)throw Bi(this._lexer,"groups cannot be nested: "+this._safeRuleName(L));if(_.length!==E.length+1)throw Bi(this._lexer,"matched number of groups does not match the number of actions in rule: "+this._safeRuleName(L));let k=0;for(let R=1;R<_.length;R++)k+=_[R].length;if(k!==w.length)throw Bi(this._lexer,"with groups, all characters should be matched in consecutive groups in rule: "+this._safeRuleName(L));h={rule:L,matches:_,groups:[]};for(let R=0;Ri});class dG{static colorizeElement(e,t,n,o){o=o||{};const r=o.theme||"vs",s=o.mimeType||n.getAttribute("lang")||n.getAttribute("data-lang");if(!s)return console.error("Mode not detected"),Promise.resolve();const a=t.getLanguageIdByMimeType(s)||s;e.setTheme(r);const l=n.firstChild?n.firstChild.nodeValue:"";n.className+=" "+r;const c=u=>{var d;const h=(d=t9==null?void 0:t9.createHTML(u))!==null&&d!==void 0?d:u;n.innerHTML=h};return this.colorize(t,l||"",a,o).then(c,u=>console.error(u))}static colorize(e,t,n,o){return Ttt(this,void 0,void 0,function*(){const r=e.languageIdCodec;let s=4;o&&typeof o.tabSize=="number"&&(s=o.tabSize),jq(t)&&(t=t.substr(1));const a=ff(t);if(!e.isRegisteredLanguageId(n))return gre(a,s,r);const l=yield oo.getOrCreate(n);return l?Ntt(a,s,l,r):gre(a,s,r)})}static colorizeLine(e,t,n,o,r=4){const s=Yl.isBasicASCII(e,t),a=Yl.containsRTL(e,s,n);return d5(new Zv(!1,!0,e,!1,s,a,0,o,[],r,0,0,0,0,-1,"none",!1,!1,null)).html}static colorizeModelLine(e,t,n=4){const o=e.getLineContent(t);e.tokenization.forceTokenization(t);const s=e.tokenization.getLineTokens(t).inflate();return this.colorizeLine(o,e.mightContainNonBasicASCII(),e.mightContainRTL(),s,n)}}function Ntt(i,e,t,n){return new Promise((o,r)=>{const s=()=>{const a=Rtt(i,e,t,n);if(t instanceof KD){const l=t.getLoadStatus();if(l.loaded===!1){l.promise.then(s,r);return}}o(a)};s()})}function gre(i,e,t){let n=[];const r=new Uint32Array(2);r[0]=0,r[1]=33587200;for(let s=0,a=i.length;s")}return n.join("")}function Rtt(i,e,t,n){let o=[],r=t.getInitialState();for(let s=0,a=i.length;s"),r=c.endState}return o.join("")}const pre=2e4;let V_,iM,rH,oM,sH;function Mtt(i){V_=document.createElement("div"),V_.className="monaco-aria-container";const e=()=>{const n=document.createElement("div");return n.className="monaco-alert",n.setAttribute("role","alert"),n.setAttribute("aria-atomic","true"),V_.appendChild(n),n};iM=e(),rH=e();const t=()=>{const n=document.createElement("div");return n.className="monaco-status",n.setAttribute("aria-live","polite"),n.setAttribute("aria-atomic","true"),V_.appendChild(n),n};oM=t(),sH=t(),i.appendChild(V_)}function bs(i){!V_||(iM.textContent!==i?(Ur(rH),nP(iM,i)):(Ur(iM),nP(rH,i)))}function Lv(i){!V_||(oM.textContent!==i?(Ur(sH),nP(oM,i)):(Ur(oM),nP(sH,i)))}function nP(i,e){Ur(i),e.length>pre&&(e=e.substr(0,pre)),i.textContent=e,i.style.visibility="hidden",i.style.visibility="visible"}const hG=wn("markerDecorationsService");var Att=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Ptt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let qD=class{constructor(e,t){}dispose(){}};qD.ID="editor.contrib.markerDecorations";qD=Att([Ptt(1,hG)],qD);zn(qD.ID,qD,0);class K0e extends _e{constructor(e,t){super(),this._onDidChange=this._register(new le),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 n=!1,o=!1;const r=()=>{if(n&&!o)try{n=!1,o=!0,t()}finally{requestAnimationFrame(()=>{o=!1,r()})}};this._resizeObserver=new ResizeObserver(s=>{e=s&&s[0]&&s[0].contentRect?s[0].contentRect:null,n=!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 n=0,o=0;t?(n=t.width,o=t.height):this._referenceDomElement&&(n=this._referenceDomElement.clientWidth,o=this._referenceDomElement.clientHeight),n=Math.max(5,n),o=Math.max(5,o),(this._width!==n||this._height!==o)&&(this._width=n,this._height=o,e&&this._onDidChange.fire())}}class Xm{constructor(e,t){this.key=e,this.migrate=t}apply(e){const t=Xm._read(e,this.key),n=r=>Xm._read(e,r),o=(r,s)=>Xm._write(e,r,s);this.migrate(t,n,o)}static _read(e,t){if(typeof e=="undefined")return;const n=t.indexOf(".");if(n>=0){const o=t.substring(0,n);return this._read(e[o],t.substring(n+1))}return e[t]}static _write(e,t,n){const o=t.indexOf(".");if(o>=0){const r=t.substring(0,o);e[r]=e[r]||{},this._write(e[r],t.substring(o+1),n);return}e[t]=n}}Xm.items=[];function Qv(i,e){Xm.items.push(new Xm(i,e))}function jc(i,e){Qv(i,(t,n,o)=>{if(typeof t!="undefined"){for(const[r,s]of e)if(t===r){o(i,s);return}}})}function Ott(i){Xm.items.forEach(e=>e.apply(i))}jc("wordWrap",[[!0,"on"],[!1,"off"]]);jc("lineNumbers",[[!0,"on"],[!1,"off"]]);jc("cursorBlinking",[["visible","solid"]]);jc("renderWhitespace",[[!0,"boundary"],[!1,"none"]]);jc("renderLineHighlight",[[!0,"line"],[!1,"none"]]);jc("acceptSuggestionOnEnter",[[!0,"on"],[!1,"off"]]);jc("tabCompletion",[[!1,"off"],[!0,"onlySnippets"]]);jc("hover",[[!0,{enabled:!0}],[!1,{enabled:!1}]]);jc("parameterHints",[[!0,{enabled:!0}],[!1,{enabled:!1}]]);jc("autoIndent",[[!1,"advanced"],[!0,"full"]]);jc("matchBrackets",[[!0,"always"],[!1,"never"]]);jc("renderFinalNewline",[[!0,"on"],[!1,"off"]]);jc("cursorSmoothCaretAnimation",[[!0,"on"],[!1,"off"]]);Qv("autoClosingBrackets",(i,e,t)=>{i===!1&&(t("autoClosingBrackets","never"),typeof e("autoClosingQuotes")=="undefined"&&t("autoClosingQuotes","never"),typeof e("autoSurround")=="undefined"&&t("autoSurround","never"))});Qv("renderIndentGuides",(i,e,t)=>{typeof i!="undefined"&&(t("renderIndentGuides",void 0),typeof e("guides.indentation")=="undefined"&&t("guides.indentation",!!i))});Qv("highlightActiveIndentGuide",(i,e,t)=>{typeof i!="undefined"&&(t("highlightActiveIndentGuide",void 0),typeof e("guides.highlightActiveIndentation")=="undefined"&&t("guides.highlightActiveIndentation",!!i))});const Ftt={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"};Qv("suggest.filteredTypes",(i,e,t)=>{if(i&&typeof i=="object"){for(const n of Object.entries(Ftt))i[n[0]]===!1&&typeof e(`suggest.${n[1]}`)=="undefined"&&t(`suggest.${n[1]}`,!1);t("suggest.filteredTypes",void 0)}});Qv("quickSuggestions",(i,e,t)=>{if(typeof i=="boolean"){const n=i?"on":"off";t("quickSuggestions",{comments:n,strings:n,other:n})}});Qv("experimental.stickyScroll.enabled",(i,e,t)=>{typeof i=="boolean"&&(t("experimental.stickyScroll.enabled",void 0),typeof e("stickyScroll.enabled")=="undefined"&&t("stickyScroll.enabled",i))});Qv("experimental.stickyScroll.maxLineCount",(i,e,t)=>{typeof i=="number"&&(t("experimental.stickyScroll.maxLineCount",void 0),typeof e("stickyScroll.maxLineCount")=="undefined"&&t("stickyScroll.maxLineCount",i))});class Btt{constructor(){this._tabFocus=!1,this._onDidChangeTabFocus=new le,this.onDidChangeTabFocus=this._onDidChangeTabFocus.event}getTabFocusMode(){return this._tabFocus}setTabFocusMode(e){this._tabFocus=e,this._onDidChangeTabFocus.fire(this._tabFocus)}}const Cy=new Btt,pp=wn("accessibilityService"),UI=new lt("accessibilityModeEnabled",!1);var Wtt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Vtt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let aH=class extends _e{constructor(e,t,n,o){super(),this._accessibilityService=o,this._onDidChange=this._register(new le),this.onDidChange=this._onDidChange.event,this._onDidChangeFast=this._register(new le),this.onDidChangeFast=this._onDidChangeFast.event,this._isDominatedByLongLines=!1,this._viewLineCount=1,this._lineNumbersDigitCount=1,this._reservedHeight=0,this._glyphMarginDecorationLaneCount=1,this._computeOptionsMemory=new p_e,this.isSimpleWidget=e,this._containerObserver=this._register(new K0e(n,t.dimension)),this._rawOptions=mre(t),this._validatedOptions=lm.validateOptions(this._rawOptions),this.options=this._computeOptions(),this.options.get(13)&&this._containerObserver.startObserving(),this._register(Sc.onDidChangeZoomLevel(()=>this._recomputeOptions())),this._register(Cy.onDidChangeTabFocus(()=>this._recomputeOptions())),this._register(this._containerObserver.onDidChange(()=>this._recomputeOptions())),this._register(BV.onDidChange(()=>this._recomputeOptions())),this._register(MD.onDidChange(()=>this._recomputeOptions())),this._register(this._accessibilityService.onDidChangeScreenReaderOptimized(()=>this._recomputeOptions()))}_recomputeOptions(){const e=this._computeOptions(),t=lm.checkEquals(this.options,e);t!==null&&(this.options=e,this._onDidChangeFast.fire(t),this._onDidChange.fire(t))}_computeOptions(){const e=this._readEnvConfiguration(),t=L0.createFromValidatedSettings(this._validatedOptions,e.pixelRatio,this.isSimpleWidget),n=this._readFontInfo(t),o={memory:this._computeOptionsMemory,outerWidth:e.outerWidth,outerHeight:e.outerHeight-this._reservedHeight,fontInfo:n,extraEditorClassName:e.extraEditorClassName,isDominatedByLongLines:this._isDominatedByLongLines,viewLineCount:this._viewLineCount,lineNumbersDigitCount:this._lineNumbersDigitCount,emptySelectionClipboard:e.emptySelectionClipboard,pixelRatio:e.pixelRatio,tabFocusMode:Cy.getTabFocusMode(),accessibilitySupport:e.accessibilitySupport,glyphMarginDecorationLaneCount:this._glyphMarginDecorationLaneCount};return lm.computeOptions(this._validatedOptions,o)}_readEnvConfiguration(){return{extraEditorClassName:$tt(),outerWidth:this._containerObserver.getWidth(),outerHeight:this._containerObserver.getHeight(),emptySelectionClipboard:x0||Oc,pixelRatio:MD.value,accessibilitySupport:this._accessibilityService.isScreenReaderOptimized()?2:this._accessibilityService.getAccessibilitySupport()}}_readFontInfo(e){return BV.readFontInfo(e)}getRawOptions(){return this._rawOptions}updateOptions(e){const t=mre(e);!lm.applyUpdate(this._rawOptions,t)||(this._validatedOptions=lm.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=Htt(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())}};aH=Wtt([Vtt(3,pp)],aH);function Htt(i){let e=0;for(;i;)i=Math.floor(i/10),e++;return e||1}function $tt(){let i="";return!sp&&!H_e&&(i+="no-user-select "),sp&&(i+="no-minimap-shadow ",i+="enable-user-select "),Nn&&(i+="mac "),i}class ztt{constructor(){this._values=[]}_read(e){return this._values[e]}get(e){return this._values[e]}_write(e,t){this._values[e]=t}}class Utt{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 lm{static validateOptions(e){const t=new ztt;for(const n of DC){const o=n.name==="_never_"?void 0:e[n.name];t._write(n.id,n.validate(o))}return t}static computeOptions(e,t){const n=new Utt;for(const o of DC)n._write(o.id,o.compute(t,n,e._read(o.id)));return n}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)?Lo(e,t):!1;if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(!lm._deepEquals(e[n],t[n]))return!1;return!0}static checkEquals(e,t){const n=[];let o=!1;for(const r of DC){const s=!lm._deepEquals(e._read(r.id),t._read(r.id));n[r.id]=s,s&&(o=!0)}return o?new g_e(n):null}static applyUpdate(e,t){let n=!1;for(const o of DC)if(t.hasOwnProperty(o.name)){const r=o.applyUpdate(e[o.name],t[o.name]);e[o.name]=r.newValue,n=n||r.didChange}return n}}function mre(i){const e=hg(i);return Ott(e),e}function Mo(i,e,t){let n=null,o=null;if(typeof t.value=="function"?(n="value",o=t.value,o.length!==0&&console.warn("Memoize should only be used in functions with zero parameters")):typeof t.get=="function"&&(n="get",o=t.get),!o)throw new Error("not supported");const r=`$memoize$${e}`;t[n]=function(...s){return this.hasOwnProperty(r)||Object.defineProperty(this,r,{configurable:!1,enumerable:!1,writable:!1,value:o.apply(this,s)}),this[r]}}var jtt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Di;(function(i){i.Tap="-monaco-gesturetap",i.Change="-monaco-gesturechange",i.Start="-monaco-gesturestart",i.End="-monaco-gesturesend",i.Contextmenu="-monaco-gesturecontextmenu"})(Di||(Di={}));class Ei extends _e{constructor(){super(),this.dispatched=!1,this.targets=new ia,this.ignoreTargets=new ia,this.activeTouches={},this.handle=null,this._lastSetTapCountTime=0,this._register(ke(document,"touchstart",e=>this.onTouchStart(e),{passive:!1})),this._register(ke(document,"touchend",e=>this.onTouchEnd(e))),this._register(ke(document,"touchmove",e=>this.onTouchMove(e),{passive:!1}))}static addTarget(e){if(!Ei.isTouchDevice())return _e.None;Ei.INSTANCE||(Ei.INSTANCE=new Ei);const t=Ei.INSTANCE.targets.push(e);return zt(t)}static ignoreTarget(e){if(!Ei.isTouchDevice())return _e.None;Ei.INSTANCE||(Ei.INSTANCE=new Ei);const t=Ei.INSTANCE.ignoreTargets.push(e);return zt(t)}static isTouchDevice(){return"ontouchstart"in window||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 n=0,o=e.targetTouches.length;n=Ei.HOLD_DELAY&&Math.abs(a.initialPageX-fc(a.rollingPageX))<30&&Math.abs(a.initialPageY-fc(a.rollingPageY))<30){const c=this.newGestureEvent(Di.Contextmenu,a.initialTarget);c.pageX=fc(a.rollingPageX),c.pageY=fc(a.rollingPageY),this.dispatchEvent(c)}else if(n===1){const c=fc(a.rollingPageX),u=fc(a.rollingPageY),d=fc(a.rollingTimestamps)-a.rollingTimestamps[0],h=c-a.rollingPageX[0],f=u-a.rollingPageY[0],g=[...this.targets].filter(p=>a.initialTarget instanceof Node&&p.contains(a.initialTarget));this.inertia(g,t,Math.abs(h)/d,h>0?1:-1,c,Math.abs(f)/d,f>0?1:-1,u)}this.dispatchEvent(this.newGestureEvent(Di.End,a.initialTarget)),delete this.activeTouches[s.identifier]}this.dispatched&&(e.preventDefault(),e.stopPropagation(),this.dispatched=!1)}newGestureEvent(e,t){const n=document.createEvent("CustomEvent");return n.initEvent(e,!1,!0),n.initialTarget=t,n.tapCount=0,n}dispatchEvent(e){if(e.type===Di.Tap){const t=new Date().getTime();let n=0;t-this._lastSetTapCountTime>Ei.CLEAR_TAP_COUNT_TIME?n=1:n=2,this._lastSetTapCountTime=t,e.tapCount=n}else(e.type===Di.Change||e.type===Di.Contextmenu)&&(this._lastSetTapCountTime=0);if(e.initialTarget instanceof Node){for(const t of this.ignoreTargets)if(t.contains(e.initialTarget))return;for(const t of this.targets)t.contains(e.initialTarget)&&(t.dispatchEvent(e),this.dispatched=!0)}}inertia(e,t,n,o,r,s,a,l){this.handle=Fc(()=>{const c=Date.now(),u=c-t;let d=0,h=0,f=!0;n+=Ei.SCROLL_FRICTION*u,s+=Ei.SCROLL_FRICTION*u,n>0&&(f=!1,d=o*n*u),s>0&&(f=!1,h=a*s*u);const g=this.newGestureEvent(Di.Change);g.translationX=d,g.translationY=h,e.forEach(p=>p.dispatchEvent(g)),f||this.inertia(e,c,n,o,r+d,s,a,l+h)})}onTouchMove(e){const t=Date.now();for(let n=0,o=e.changedTouches.length;n3&&(s.rollingPageX.shift(),s.rollingPageY.shift(),s.rollingTimestamps.shift()),s.rollingPageX.push(r.pageX),s.rollingPageY.push(r.pageY),s.rollingTimestamps.push(t)}this.dispatched&&(e.preventDefault(),e.stopPropagation(),this.dispatched=!1)}}Ei.SCROLL_FRICTION=-.005;Ei.HOLD_DELAY=700;Ei.CLEAR_TAP_COUNT_TIME=400;jtt([Mo],Ei,"isTouchDevice",null);class CS{constructor(){this._hooks=new Be,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 n=this._onStopCallback;this._onStopCallback=null,e&&n&&n(t)}isMonitoring(){return!!this._pointerMoveCallback}startMonitoring(e,t,n,o,r){this.isMonitoring()&&this.stopMonitoring(!1),this._pointerMoveCallback=o,this._onStopCallback=r;let s=e;try{e.setPointerCapture(t),this._hooks.add(zt(()=>{try{e.releasePointerCapture(t)}catch{}}))}catch{s=window}this._hooks.add(ke(s,et.POINTER_MOVE,a=>{if(a.buttons!==n){this.stopMonitoring(!0);return}a.preventDefault(),this._pointerMoveCallback(a)})),this._hooks.add(ke(s,et.POINTER_UP,a=>this.stopMonitoring(!0)))}}function fG(i){return`--vscode-${i.replace(/\./g,"-")}`}function ct(i){return`var(${fG(i)})`}function Ktt(i,e){return`var(${fG(i)}, ${e})`}const q0e={ColorContribution:"base.contributions.colors"};class qtt{constructor(){this._onDidChangeSchema=new le,this.onDidChangeSchema=this._onDidChangeSchema.event,this.colorSchema={type:"object",properties:{}},this.colorReferenceSchema={type:"string",enum:[],enumDescriptions:[]},this.colorsById={}}registerColor(e,t,n,o=!1,r){const s={id:e,description:n,defaults:t,needsTransparency:o,deprecationMessage:r};this.colorsById[e]=s;const a={type:"string",description:n,format:"color-hex",defaultSnippets:[{body:"${1:#ff0000}"}]};return r&&(a.deprecationMessage=r),this.colorSchema.properties[e]=a,this.colorReferenceSchema.enum.push(e),this.colorReferenceSchema.enumDescriptions.push(n),this._onDidChangeSchema.fire(),e}getColors(){return Object.keys(this.colorsById).map(e=>this.colorsById[e])}resolveDefaultColor(e,t){const n=this.colorsById[e];if(n&&n.defaults){const o=n.defaults[t.type];return rd(o,t)}}getColorSchema(){return this.colorSchema}toString(){const e=(t,n)=>{const o=t.indexOf(".")===-1?0:1,r=n.indexOf(".")===-1?0:1;return o!==r?o-r:t.localeCompare(n)};return Object.keys(this.colorsById).sort(e).map(t=>`- \`${t}\`: ${this.colorsById[t].description}`).join(` -`)}}const h5=new qtt;no.add(q0e.ColorContribution,h5);function J(i,e,t,n,o){return h5.registerColor(i,e,t,n,o)}const Ke=J("foreground",{dark:"#CCCCCC",light:"#616161",hcDark:"#FFFFFF",hcLight:"#292929"},C("foreground","Overall foreground color. This color is only used if not overridden by a component."));J("disabledForeground",{dark:"#CCCCCC80",light:"#61616180",hcDark:"#A5A5A5",hcLight:"#7F7F7F"},C("disabledForeground","Overall foreground for disabled elements. This color is only used if not overridden by a component."));const Gtt=J("errorForeground",{dark:"#F48771",light:"#A1260D",hcDark:"#F48771",hcLight:"#B5200D"},C("errorForeground","Overall foreground color for error messages. This color is only used if not overridden by a component."));J("descriptionForeground",{light:"#717171",dark:yt(Ke,.7),hcDark:yt(Ke,.7),hcLight:yt(Ke,.7)},C("descriptionForeground","Foreground color for description text providing additional information, for example for a label."));const wm=J("icon.foreground",{dark:"#C5C5C5",light:"#424242",hcDark:"#FFFFFF",hcLight:"#292929"},C("iconForeground","The default color for icons in the workbench.")),Vl=J("focusBorder",{dark:"#007FD4",light:"#0090F1",hcDark:"#F38518",hcLight:"#006BBD"},C("focusBorder","Overall border color for focused elements. This color is only used if not overridden by a component.")),Ln=J("contrastBorder",{light:null,dark:null,hcDark:"#6FC3DF",hcLight:"#0F4A85"},C("contrastBorder","An extra border around elements to separate them from others for greater contrast.")),Wi=J("contrastActiveBorder",{light:null,dark:null,hcDark:Vl,hcLight:Vl},C("activeContrastBorder","An extra border around active elements to separate them from others for greater contrast."));J("selection.background",{light:null,dark:null,hcDark:null,hcLight:null},C("selectionBackground","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."));J("textSeparator.foreground",{light:"#0000002e",dark:"#ffffff2e",hcDark:ve.black,hcLight:"#292929"},C("textSeparatorForeground","Color for text separators."));const Xtt=J("textLink.foreground",{light:"#006AB1",dark:"#3794FF",hcDark:"#3794FF",hcLight:"#0F4A85"},C("textLinkForeground","Foreground color for links in text."));J("textLink.activeForeground",{light:"#006AB1",dark:"#3794FF",hcDark:"#3794FF",hcLight:"#0F4A85"},C("textLinkActiveForeground","Foreground color for links in text when clicked on and on mouse hover."));J("textPreformat.foreground",{light:"#A31515",dark:"#D7BA7D",hcDark:"#D7BA7D",hcLight:"#292929"},C("textPreformatForeground","Foreground color for preformatted text segments."));J("textBlockQuote.background",{light:"#7f7f7f1a",dark:"#7f7f7f1a",hcDark:null,hcLight:"#F2F2F2"},C("textBlockQuoteBackground","Background color for block quotes in text."));J("textBlockQuote.border",{light:"#007acc80",dark:"#007acc80",hcDark:ve.white,hcLight:"#292929"},C("textBlockQuoteBorder","Border color for block quotes in text."));J("textCodeBlock.background",{light:"#dcdcdc66",dark:"#0a0a0a66",hcDark:ve.black,hcLight:"#F2F2F2"},C("textCodeBlockBackground","Background color for code blocks in text."));const Kh=J("widget.shadow",{dark:yt(ve.black,.36),light:yt(ve.black,.16),hcDark:null,hcLight:null},C("widgetShadow","Shadow color of widgets such as find/replace inside the editor.")),gG=J("widget.border",{dark:null,light:null,hcDark:Ln,hcLight:Ln},C("widgetBorder","Border color of widgets such as find/replace inside the editor.")),G0e=J("input.background",{dark:"#3C3C3C",light:ve.white,hcDark:ve.black,hcLight:ve.white},C("inputBoxBackground","Input box background.")),X0e=J("input.foreground",{dark:Ke,light:Ke,hcDark:Ke,hcLight:Ke},C("inputBoxForeground","Input box foreground.")),Y0e=J("input.border",{dark:null,light:null,hcDark:Ln,hcLight:Ln},C("inputBoxBorder","Input box border.")),pG=J("inputOption.activeBorder",{dark:"#007ACC",light:"#007ACC",hcDark:Ln,hcLight:Ln},C("inputBoxActiveOptionBorder","Border color of activated options in input fields."));J("inputOption.hoverBackground",{dark:"#5a5d5e80",light:"#b8b8b850",hcDark:null,hcLight:null},C("inputOption.hoverBackground","Background color of activated options in input fields."));const u0=J("inputOption.activeBackground",{dark:yt(Vl,.4),light:yt(Vl,.2),hcDark:ve.transparent,hcLight:ve.transparent},C("inputOption.activeBackground","Background hover color of options in input fields.")),mG=J("inputOption.activeForeground",{dark:ve.white,light:ve.black,hcDark:Ke,hcLight:Ke},C("inputOption.activeForeground","Foreground color of activated options in input fields."));J("input.placeholderForeground",{light:yt(Ke,.5),dark:yt(Ke,.5),hcDark:yt(Ke,.7),hcLight:yt(Ke,.7)},C("inputPlaceholderForeground","Input box foreground color for placeholder text."));const Ytt=J("inputValidation.infoBackground",{dark:"#063B49",light:"#D6ECF2",hcDark:ve.black,hcLight:ve.white},C("inputValidationInfoBackground","Input validation background color for information severity.")),Ztt=J("inputValidation.infoForeground",{dark:null,light:null,hcDark:null,hcLight:Ke},C("inputValidationInfoForeground","Input validation foreground color for information severity.")),Qtt=J("inputValidation.infoBorder",{dark:"#007acc",light:"#007acc",hcDark:Ln,hcLight:Ln},C("inputValidationInfoBorder","Input validation border color for information severity.")),Jtt=J("inputValidation.warningBackground",{dark:"#352A05",light:"#F6F5D2",hcDark:ve.black,hcLight:ve.white},C("inputValidationWarningBackground","Input validation background color for warning severity.")),ent=J("inputValidation.warningForeground",{dark:null,light:null,hcDark:null,hcLight:Ke},C("inputValidationWarningForeground","Input validation foreground color for warning severity.")),tnt=J("inputValidation.warningBorder",{dark:"#B89500",light:"#B89500",hcDark:Ln,hcLight:Ln},C("inputValidationWarningBorder","Input validation border color for warning severity.")),nnt=J("inputValidation.errorBackground",{dark:"#5A1D1D",light:"#F2DEDE",hcDark:ve.black,hcLight:ve.white},C("inputValidationErrorBackground","Input validation background color for error severity.")),int=J("inputValidation.errorForeground",{dark:null,light:null,hcDark:null,hcLight:Ke},C("inputValidationErrorForeground","Input validation foreground color for error severity.")),ont=J("inputValidation.errorBorder",{dark:"#BE1100",light:"#BE1100",hcDark:Ln,hcLight:Ln},C("inputValidationErrorBorder","Input validation border color for error severity.")),qh=J("dropdown.background",{dark:"#3C3C3C",light:ve.white,hcDark:ve.black,hcLight:ve.white},C("dropdownBackground","Dropdown background.")),rnt=J("dropdown.listBackground",{dark:null,light:null,hcDark:ve.black,hcLight:ve.white},C("dropdownListBackground","Dropdown list background.")),Ag=J("dropdown.foreground",{dark:"#F0F0F0",light:Ke,hcDark:ve.white,hcLight:Ke},C("dropdownForeground","Dropdown foreground.")),MC=J("dropdown.border",{dark:qh,light:"#CECECE",hcDark:Ln,hcLight:Ln},C("dropdownBorder","Dropdown border.")),vL=J("button.foreground",{dark:ve.white,light:ve.white,hcDark:ve.white,hcLight:ve.white},C("buttonForeground","Button foreground color.")),snt=J("button.separator",{dark:yt(vL,.4),light:yt(vL,.4),hcDark:yt(vL,.4),hcLight:yt(vL,.4)},C("buttonSeparator","Button separator color.")),_L=J("button.background",{dark:"#0E639C",light:"#007ACC",hcDark:null,hcLight:"#0F4A85"},C("buttonBackground","Button background color.")),ant=J("button.hoverBackground",{dark:Vd(_L,.2),light:Wb(_L,.2),hcDark:_L,hcLight:_L},C("buttonHoverBackground","Button background color when hovering.")),lnt=J("button.border",{dark:Ln,light:Ln,hcDark:Ln,hcLight:Ln},C("buttonBorder","Button border color.")),cnt=J("button.secondaryForeground",{dark:ve.white,light:ve.white,hcDark:ve.white,hcLight:Ke},C("buttonSecondaryForeground","Secondary button foreground color.")),lH=J("button.secondaryBackground",{dark:"#3A3D41",light:"#5F6A79",hcDark:null,hcLight:ve.white},C("buttonSecondaryBackground","Secondary button background color.")),unt=J("button.secondaryHoverBackground",{dark:Vd(lH,.2),light:Wb(lH,.2),hcDark:null,hcLight:null},C("buttonSecondaryHoverBackground","Secondary button background color when hovering.")),rM=J("badge.background",{dark:"#4D4D4D",light:"#C4C4C4",hcDark:ve.black,hcLight:"#0F4A85"},C("badgeBackground","Badge background color. Badges are small information labels, e.g. for search results count.")),dnt=J("badge.foreground",{dark:ve.white,light:"#333",hcDark:ve.white,hcLight:ve.white},C("badgeForeground","Badge foreground color. Badges are small information labels, e.g. for search results count.")),hnt=J("scrollbar.shadow",{dark:"#000000",light:"#DDDDDD",hcDark:null,hcLight:null},C("scrollbarShadow","Scrollbar shadow to indicate that the view is scrolled.")),bL=J("scrollbarSlider.background",{dark:ve.fromHex("#797979").transparent(.4),light:ve.fromHex("#646464").transparent(.4),hcDark:yt(Ln,.6),hcLight:yt(Ln,.4)},C("scrollbarSliderBackground","Scrollbar slider background color.")),CL=J("scrollbarSlider.hoverBackground",{dark:ve.fromHex("#646464").transparent(.7),light:ve.fromHex("#646464").transparent(.7),hcDark:yt(Ln,.8),hcLight:yt(Ln,.8)},C("scrollbarSliderHoverBackground","Scrollbar slider background color when hovering.")),wL=J("scrollbarSlider.activeBackground",{dark:ve.fromHex("#BFBFBF").transparent(.4),light:ve.fromHex("#000000").transparent(.6),hcDark:Ln,hcLight:Ln},C("scrollbarSliderActiveBackground","Scrollbar slider background color when clicked on.")),fnt=J("progressBar.background",{dark:ve.fromHex("#0E70C0"),light:ve.fromHex("#0E70C0"),hcDark:Ln,hcLight:Ln},C("progressBarBackground","Background color of the progress bar that can show for long running operations."));J("editorError.background",{dark:null,light:null,hcDark:null,hcLight:null},C("editorError.background","Background color of error text in the editor. The color must not be opaque so as not to hide underlying decorations."),!0);const Gh=J("editorError.foreground",{dark:"#F14C4C",light:"#E51400",hcDark:"#F48771",hcLight:"#B5200D"},C("editorError.foreground","Foreground color of error squigglies in the editor.")),gnt=J("editorError.border",{dark:null,light:null,hcDark:ve.fromHex("#E47777").transparent(.8),hcLight:"#B5200D"},C("errorBorder","If set, color of double underlines for errors in the editor."));J("editorWarning.background",{dark:null,light:null,hcDark:null,hcLight:null},C("editorWarning.background","Background color of warning text in the editor. The color must not be opaque so as not to hide underlying decorations."),!0);const Hl=J("editorWarning.foreground",{dark:"#CCA700",light:"#BF8803",hcDark:"#FFD370",hcLight:"#895503"},C("editorWarning.foreground","Foreground color of warning squigglies in the editor.")),GD=J("editorWarning.border",{dark:null,light:null,hcDark:ve.fromHex("#FFCC00").transparent(.8),hcLight:ve.fromHex("#FFCC00").transparent(.8)},C("warningBorder","If set, color of double underlines for warnings in the editor."));J("editorInfo.background",{dark:null,light:null,hcDark:null,hcLight:null},C("editorInfo.background","Background color of info text in the editor. The color must not be opaque so as not to hide underlying decorations."),!0);const Ra=J("editorInfo.foreground",{dark:"#3794FF",light:"#1a85ff",hcDark:"#3794FF",hcLight:"#1a85ff"},C("editorInfo.foreground","Foreground color of info squigglies in the editor.")),XD=J("editorInfo.border",{dark:null,light:null,hcDark:ve.fromHex("#3794FF").transparent(.8),hcLight:"#292929"},C("infoBorder","If set, color of double underlines for infos in the editor.")),pnt=J("editorHint.foreground",{dark:ve.fromHex("#eeeeee").transparent(.7),light:"#6c6c6c",hcDark:null,hcLight:null},C("editorHint.foreground","Foreground color of hint squigglies in the editor."));J("editorHint.border",{dark:null,light:null,hcDark:ve.fromHex("#eeeeee").transparent(.8),hcLight:"#292929"},C("hintBorder","If set, color of double underlines for hints in the editor."));J("sash.hoverBorder",{dark:Vl,light:Vl,hcDark:Vl,hcLight:Vl},C("sashActiveBorder","Border color of active sashes."));const pr=J("editor.background",{light:"#ffffff",dark:"#1E1E1E",hcDark:ve.black,hcLight:ve.white},C("editorBackground","Editor background color.")),yu=J("editor.foreground",{light:"#333333",dark:"#BBBBBB",hcDark:ve.white,hcLight:Ke},C("editorForeground","Editor default foreground color."));J("editorStickyScroll.background",{light:pr,dark:pr,hcDark:pr,hcLight:pr},C("editorStickyScrollBackground","Sticky scroll background color for the editor"));J("editorStickyScrollHover.background",{dark:"#2A2D2E",light:"#F0F0F0",hcDark:null,hcLight:ve.fromHex("#0F4A85").transparent(.1)},C("editorStickyScrollHoverBackground","Sticky scroll on hover background color for the editor"));const po=J("editorWidget.background",{dark:"#252526",light:"#F3F3F3",hcDark:"#0C141F",hcLight:ve.white},C("editorWidgetBackground","Background color of editor widgets, such as find/replace.")),Xh=J("editorWidget.foreground",{dark:Ke,light:Ke,hcDark:Ke,hcLight:Ke},C("editorWidgetForeground","Foreground color of editor widgets, such as find/replace.")),Yh=J("editorWidget.border",{dark:"#454545",light:"#C8C8C8",hcDark:Ln,hcLight:Ln},C("editorWidgetBorder","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.")),mnt=J("editorWidget.resizeBorder",{light:null,dark:null,hcDark:null,hcLight:null},C("editorWidgetResizeBorder","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.")),vre=J("quickInput.background",{dark:po,light:po,hcDark:po,hcLight:po},C("pickerBackground","Quick picker background color. The quick picker widget is the container for pickers like the command palette.")),vnt=J("quickInput.foreground",{dark:Xh,light:Xh,hcDark:Xh,hcLight:Xh},C("pickerForeground","Quick picker foreground color. The quick picker widget is the container for pickers like the command palette.")),_nt=J("quickInputTitle.background",{dark:new ve(new Tn(255,255,255,.105)),light:new ve(new Tn(0,0,0,.06)),hcDark:"#000000",hcLight:ve.white},C("pickerTitleBackground","Quick picker title background color. The quick picker widget is the container for pickers like the command palette.")),Z0e=J("pickerGroup.foreground",{dark:"#3794FF",light:"#0066BF",hcDark:ve.white,hcLight:"#0F4A85"},C("pickerGroupForeground","Quick picker color for grouping labels.")),bnt=J("pickerGroup.border",{dark:"#3F3F46",light:"#CCCEDB",hcDark:ve.white,hcLight:"#0F4A85"},C("pickerGroupBorder","Quick picker color for grouping borders.")),Cnt=J("keybindingLabel.background",{dark:new ve(new Tn(128,128,128,.17)),light:new ve(new Tn(221,221,221,.4)),hcDark:ve.transparent,hcLight:ve.transparent},C("keybindingLabelBackground","Keybinding label background color. The keybinding label is used to represent a keyboard shortcut.")),wnt=J("keybindingLabel.foreground",{dark:ve.fromHex("#CCCCCC"),light:ve.fromHex("#555555"),hcDark:ve.white,hcLight:Ke},C("keybindingLabelForeground","Keybinding label foreground color. The keybinding label is used to represent a keyboard shortcut.")),ynt=J("keybindingLabel.border",{dark:new ve(new Tn(51,51,51,.6)),light:new ve(new Tn(204,204,204,.4)),hcDark:new ve(new Tn(111,195,223)),hcLight:Ln},C("keybindingLabelBorder","Keybinding label border color. The keybinding label is used to represent a keyboard shortcut.")),Snt=J("keybindingLabel.bottomBorder",{dark:new ve(new Tn(68,68,68,.6)),light:new ve(new Tn(187,187,187,.4)),hcDark:new ve(new Tn(111,195,223)),hcLight:Ke},C("keybindingLabelBottomBorder","Keybinding label border bottom color. The keybinding label is used to represent a keyboard shortcut.")),ym=J("editor.selectionBackground",{light:"#ADD6FF",dark:"#264F78",hcDark:"#f3f518",hcLight:"#0F4A85"},C("editorSelectionBackground","Color of the editor selection.")),xnt=J("editor.selectionForeground",{light:null,dark:null,hcDark:"#000000",hcLight:ve.white},C("editorSelectionForeground","Color of the selected text for high contrast.")),Q0e=J("editor.inactiveSelectionBackground",{light:yt(ym,.5),dark:yt(ym,.5),hcDark:yt(ym,.7),hcLight:yt(ym,.5)},C("editorInactiveSelection","Color of the selection in an inactive editor. The color must not be opaque so as not to hide underlying decorations."),!0),vG=J("editor.selectionHighlightBackground",{light:xre(ym,pr,.3,.6),dark:xre(ym,pr,.3,.6),hcDark:null,hcLight:null},C("editorSelectionHighlight","Color for regions with the same content as the selection. The color must not be opaque so as not to hide underlying decorations."),!0);J("editor.selectionHighlightBorder",{light:null,dark:null,hcDark:Wi,hcLight:Wi},C("editorSelectionHighlightBorder","Border color for regions with the same content as the selection."));const Lnt=J("editor.findMatchBackground",{light:"#A8AC94",dark:"#515C6A",hcDark:null,hcLight:null},C("editorFindMatch","Color of the current search match.")),Zh=J("editor.findMatchHighlightBackground",{light:"#EA5C0055",dark:"#EA5C0055",hcDark:null,hcLight:null},C("findMatchHighlight","Color of the other search matches. The color must not be opaque so as not to hide underlying decorations."),!0),Ent=J("editor.findRangeHighlightBackground",{dark:"#3a3d4166",light:"#b4b4b44d",hcDark:null,hcLight:null},C("findRangeHighlight","Color of the range limiting the search. The color must not be opaque so as not to hide underlying decorations."),!0),Dnt=J("editor.findMatchBorder",{light:null,dark:null,hcDark:Wi,hcLight:Wi},C("editorFindMatchBorder","Border color of the current search match.")),Sm=J("editor.findMatchHighlightBorder",{light:null,dark:null,hcDark:Wi,hcLight:Wi},C("findMatchHighlightBorder","Border color of the other search matches.")),knt=J("editor.findRangeHighlightBorder",{dark:null,light:null,hcDark:yt(Wi,.4),hcLight:yt(Wi,.4)},C("findRangeHighlightBorder","Border color of the range limiting the search. The color must not be opaque so as not to hide underlying decorations."),!0);J("searchEditor.findMatchBackground",{light:yt(Zh,.66),dark:yt(Zh,.66),hcDark:Zh,hcLight:Zh},C("searchEditor.queryMatch","Color of the Search Editor query matches."));J("searchEditor.findMatchBorder",{light:yt(Sm,.66),dark:yt(Sm,.66),hcDark:Sm,hcLight:Sm},C("searchEditor.editorFindMatchBorder","Border color of the Search Editor query matches."));J("search.resultsInfoForeground",{light:Ke,dark:yt(Ke,.65),hcDark:Ke,hcLight:Ke},C("search.resultsInfoForeground","Color of the text in the search viewlet's completion message."));J("editor.hoverHighlightBackground",{light:"#ADD6FF26",dark:"#264f7840",hcDark:"#ADD6FF26",hcLight:null},C("hoverHighlight","Highlight below the word for which a hover is shown. The color must not be opaque so as not to hide underlying decorations."),!0);const iP=J("editorHoverWidget.background",{light:po,dark:po,hcDark:po,hcLight:po},C("hoverBackground","Background color of the editor hover."));J("editorHoverWidget.foreground",{light:Xh,dark:Xh,hcDark:Xh,hcLight:Xh},C("hoverForeground","Foreground color of the editor hover."));const Int=J("editorHoverWidget.border",{light:Yh,dark:Yh,hcDark:Yh,hcLight:Yh},C("hoverBorder","Border color of the editor hover."));J("editorHoverWidget.statusBarBackground",{dark:Vd(iP,.2),light:Wb(iP,.05),hcDark:po,hcLight:po},C("statusBarBackground","Background color of the editor hover status bar."));const Tnt=J("editorLink.activeForeground",{dark:"#4E94CE",light:ve.blue,hcDark:ve.cyan,hcLight:"#292929"},C("activeLinkForeground","Color of active links.")),Pg=J("editorInlayHint.foreground",{dark:"#969696",light:"#969696",hcDark:ve.white,hcLight:ve.black},C("editorInlayHintForeground","Foreground color of inline hints")),Og=J("editorInlayHint.background",{dark:yt(rM,.1),light:yt(rM,.1),hcDark:yt(ve.white,.1),hcLight:yt(rM,.1)},C("editorInlayHintBackground","Background color of inline hints")),Nnt=J("editorInlayHint.typeForeground",{dark:Pg,light:Pg,hcDark:Pg,hcLight:Pg},C("editorInlayHintForegroundTypes","Foreground color of inline hints for types")),Rnt=J("editorInlayHint.typeBackground",{dark:Og,light:Og,hcDark:Og,hcLight:Og},C("editorInlayHintBackgroundTypes","Background color of inline hints for types")),Mnt=J("editorInlayHint.parameterForeground",{dark:Pg,light:Pg,hcDark:Pg,hcLight:Pg},C("editorInlayHintForegroundParameter","Foreground color of inline hints for parameters")),Ant=J("editorInlayHint.parameterBackground",{dark:Og,light:Og,hcDark:Og,hcLight:Og},C("editorInlayHintBackgroundParameter","Background color of inline hints for parameters"));J("editorLightBulb.foreground",{dark:"#FFCC00",light:"#DDB100",hcDark:"#FFCC00",hcLight:"#007ACC"},C("editorLightBulbForeground","The color used for the lightbulb actions icon."));J("editorLightBulbAutoFix.foreground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},C("editorLightBulbAutoFixForeground","The color used for the lightbulb auto fix actions icon."));const cH=new ve(new Tn(155,185,85,.2)),uH=new ve(new Tn(255,0,0,.2)),Pnt=J("diffEditor.insertedTextBackground",{dark:"#9ccc2c33",light:"#9ccc2c40",hcDark:null,hcLight:null},C("diffEditorInserted","Background color for text that got inserted. The color must not be opaque so as not to hide underlying decorations."),!0),Ont=J("diffEditor.removedTextBackground",{dark:"#ff000033",light:"#ff000033",hcDark:null,hcLight:null},C("diffEditorRemoved","Background color for text that got removed. The color must not be opaque so as not to hide underlying decorations."),!0);J("diffEditor.insertedLineBackground",{dark:cH,light:cH,hcDark:null,hcLight:null},C("diffEditorInsertedLines","Background color for lines that got inserted. The color must not be opaque so as not to hide underlying decorations."),!0);J("diffEditor.removedLineBackground",{dark:uH,light:uH,hcDark:null,hcLight:null},C("diffEditorRemovedLines","Background color for lines that got removed. The color must not be opaque so as not to hide underlying decorations."),!0);J("diffEditorGutter.insertedLineBackground",{dark:null,light:null,hcDark:null,hcLight:null},C("diffEditorInsertedLineGutter","Background color for the margin where lines got inserted."));J("diffEditorGutter.removedLineBackground",{dark:null,light:null,hcDark:null,hcLight:null},C("diffEditorRemovedLineGutter","Background color for the margin where lines got removed."));const Fnt=J("diffEditorOverview.insertedForeground",{dark:null,light:null,hcDark:null,hcLight:null},C("diffEditorOverviewInserted","Diff overview ruler foreground for inserted content.")),Bnt=J("diffEditorOverview.removedForeground",{dark:null,light:null,hcDark:null,hcLight:null},C("diffEditorOverviewRemoved","Diff overview ruler foreground for removed content."));J("diffEditor.insertedTextBorder",{dark:null,light:null,hcDark:"#33ff2eff",hcLight:"#374E06"},C("diffEditorInsertedOutline","Outline color for the text that got inserted."));J("diffEditor.removedTextBorder",{dark:null,light:null,hcDark:"#FF008F",hcLight:"#AD0707"},C("diffEditorRemovedOutline","Outline color for text that got removed."));J("diffEditor.border",{dark:null,light:null,hcDark:Ln,hcLight:Ln},C("diffEditorBorder","Border color between the two text editors."));J("diffEditor.diagonalFill",{dark:"#cccccc33",light:"#22222233",hcDark:null,hcLight:null},C("diffDiagonalFill","Color of the diff editor's diagonal fill. The diagonal fill is used in side-by-side diff views."));J("diffEditor.unchangedRegionBackground",{dark:"#3e3e3e",light:"#e4e4e4",hcDark:null,hcLight:null},C("diffEditor.unchangedRegionBackground","The background color of unchanged blocks in the diff editor."));J("diffEditor.unchangedRegionForeground",{dark:"#a3a2a2",light:"#4d4c4c",hcDark:null,hcLight:null},C("diffEditor.unchangedRegionForeground","The foreground color of unchanged blocks in the diff editor."));J("diffEditor.unchangedCodeBackground",{dark:"#74747429",light:"#b8b8b829",hcDark:null,hcLight:null},C("diffEditor.unchangedCodeBackground","The background color of unchanged code in the diff editor."));const Wnt=J("list.focusBackground",{dark:null,light:null,hcDark:null,hcLight:null},C("listFocusBackground","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.")),Vnt=J("list.focusForeground",{dark:null,light:null,hcDark:null,hcLight:null},C("listFocusForeground","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.")),Hnt=J("list.focusOutline",{dark:Vl,light:Vl,hcDark:Wi,hcLight:Wi},C("listFocusOutline","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.")),$nt=J("list.focusAndSelectionOutline",{dark:null,light:null,hcDark:null,hcLight:null},C("listFocusAndSelectionOutline","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.")),Fg=J("list.activeSelectionBackground",{dark:"#04395E",light:"#0060C0",hcDark:null,hcLight:ve.fromHex("#0F4A85").transparent(.1)},C("listActiveSelectionBackground","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.")),Qh=J("list.activeSelectionForeground",{dark:ve.white,light:ve.white,hcDark:null,hcLight:null},C("listActiveSelectionForeground","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.")),yL=J("list.activeSelectionIconForeground",{dark:null,light:null,hcDark:null,hcLight:null},C("listActiveSelectionIconForeground","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.")),znt=J("list.inactiveSelectionBackground",{dark:"#37373D",light:"#E4E6F1",hcDark:null,hcLight:ve.fromHex("#0F4A85").transparent(.1)},C("listInactiveSelectionBackground","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.")),Unt=J("list.inactiveSelectionForeground",{dark:null,light:null,hcDark:null,hcLight:null},C("listInactiveSelectionForeground","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.")),jnt=J("list.inactiveSelectionIconForeground",{dark:null,light:null,hcDark:null,hcLight:null},C("listInactiveSelectionIconForeground","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.")),Knt=J("list.inactiveFocusBackground",{dark:null,light:null,hcDark:null,hcLight:null},C("listInactiveFocusBackground","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.")),qnt=J("list.inactiveFocusOutline",{dark:null,light:null,hcDark:null,hcLight:null},C("listInactiveFocusOutline","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.")),J0e=J("list.hoverBackground",{dark:"#2A2D2E",light:"#F0F0F0",hcDark:ve.white.transparent(.1),hcLight:ve.fromHex("#0F4A85").transparent(.1)},C("listHoverBackground","List/Tree background when hovering over items using the mouse.")),ebe=J("list.hoverForeground",{dark:null,light:null,hcDark:null,hcLight:null},C("listHoverForeground","List/Tree foreground when hovering over items using the mouse.")),Gnt=J("list.dropBackground",{dark:"#062F4A",light:"#D6EBFF",hcDark:null,hcLight:null},C("listDropBackground","List/Tree drag and drop background when moving items around using the mouse.")),Su=J("list.highlightForeground",{dark:"#2AAAFF",light:"#0066BF",hcDark:Vl,hcLight:Vl},C("highlight","List/Tree foreground color of the match highlights when searching inside the list/tree.")),s2=J("list.focusHighlightForeground",{dark:Su,light:xit(Fg,Su,"#BBE7FF"),hcDark:Su,hcLight:Su},C("listFocusHighlightForeground","List/Tree foreground color of the match highlights on actively focused items when searching inside the list/tree."));J("list.invalidItemForeground",{dark:"#B89500",light:"#B89500",hcDark:"#B89500",hcLight:"#B5200D"},C("invalidItemForeground","List/Tree foreground color for invalid items, for example an unresolved root in explorer."));J("list.errorForeground",{dark:"#F88070",light:"#B01011",hcDark:null,hcLight:null},C("listErrorForeground","Foreground color of list items containing errors."));J("list.warningForeground",{dark:"#CCA700",light:"#855F00",hcDark:null,hcLight:null},C("listWarningForeground","Foreground color of list items containing warnings."));const Xnt=J("listFilterWidget.background",{light:Wb(po,0),dark:Vd(po,0),hcDark:po,hcLight:po},C("listFilterWidgetBackground","Background color of the type filter widget in lists and trees.")),Ynt=J("listFilterWidget.outline",{dark:ve.transparent,light:ve.transparent,hcDark:"#f38518",hcLight:"#007ACC"},C("listFilterWidgetOutline","Outline color of the type filter widget in lists and trees.")),Znt=J("listFilterWidget.noMatchesOutline",{dark:"#BE1100",light:"#BE1100",hcDark:Ln,hcLight:Ln},C("listFilterWidgetNoMatchesOutline","Outline color of the type filter widget in lists and trees, when there are no matches.")),Qnt=J("listFilterWidget.shadow",{dark:Kh,light:Kh,hcDark:Kh,hcLight:Kh},C("listFilterWidgetShadow","Shadow color of the type filter widget in lists and trees."));J("list.filterMatchBackground",{dark:Zh,light:Zh,hcDark:null,hcLight:null},C("listFilterMatchHighlight","Background color of the filtered match."));J("list.filterMatchBorder",{dark:Sm,light:Sm,hcDark:Ln,hcLight:Wi},C("listFilterMatchHighlightBorder","Border color of the filtered match."));const SL=J("tree.indentGuidesStroke",{dark:"#585858",light:"#a9a9a9",hcDark:"#a9a9a9",hcLight:"#a5a5a5"},C("treeIndentGuidesStroke","Tree stroke color for the indentation guides.")),Jnt=J("tree.inactiveIndentGuidesStroke",{dark:yt(SL,.4),light:yt(SL,.4),hcDark:yt(SL,.4),hcLight:yt(SL,.4)},C("treeInactiveIndentGuidesStroke","Tree stroke color for the indentation guides that are not active.")),eit=J("tree.tableColumnsBorder",{dark:"#CCCCCC20",light:"#61616120",hcDark:null,hcLight:null},C("tableColumnsBorder","Table border color between columns.")),tit=J("tree.tableOddRowsBackground",{dark:yt(Ke,.04),light:yt(Ke,.04),hcDark:null,hcLight:null},C("tableOddRowsBackgroundColor","Background color for odd table rows."));J("list.deemphasizedForeground",{dark:"#8C8C8C",light:"#8E8E90",hcDark:"#A7A8A9",hcLight:"#666666"},C("listDeemphasizedForeground","List/Tree foreground color for items that are deemphasized. "));const nit=J("checkbox.background",{dark:qh,light:qh,hcDark:qh,hcLight:qh},C("checkbox.background","Background color of checkbox widget."));J("checkbox.selectBackground",{dark:po,light:po,hcDark:po,hcLight:po},C("checkbox.select.background","Background color of checkbox widget when the element it's in is selected."));const iit=J("checkbox.foreground",{dark:Ag,light:Ag,hcDark:Ag,hcLight:Ag},C("checkbox.foreground","Foreground color of checkbox widget.")),oit=J("checkbox.border",{dark:MC,light:MC,hcDark:MC,hcLight:MC},C("checkbox.border","Border color of checkbox widget."));J("checkbox.selectBorder",{dark:wm,light:wm,hcDark:wm,hcLight:wm},C("checkbox.select.border","Border color of checkbox widget when the element it's in is selected."));const _re=J("quickInput.list.focusBackground",{dark:null,light:null,hcDark:null,hcLight:null},"",void 0,C("quickInput.list.focusBackground deprecation","Please use quickInputList.focusBackground instead")),d0=J("quickInputList.focusForeground",{dark:Qh,light:Qh,hcDark:Qh,hcLight:Qh},C("quickInput.listFocusForeground","Quick picker foreground color for the focused item.")),AC=J("quickInputList.focusIconForeground",{dark:yL,light:yL,hcDark:yL,hcLight:yL},C("quickInput.listFocusIconForeground","Quick picker icon foreground color for the focused item.")),h0=J("quickInputList.focusBackground",{dark:YD(_re,Fg),light:YD(_re,Fg),hcDark:null,hcLight:null},C("quickInput.listFocusBackground","Quick picker background color for the focused item.")),rit=J("menu.border",{dark:null,light:null,hcDark:Ln,hcLight:Ln},C("menuBorder","Border color of menus.")),sit=J("menu.foreground",{dark:Ag,light:Ag,hcDark:Ag,hcLight:Ag},C("menuForeground","Foreground color of menu items.")),ait=J("menu.background",{dark:qh,light:qh,hcDark:qh,hcLight:qh},C("menuBackground","Background color of menu items.")),lit=J("menu.selectionForeground",{dark:Qh,light:Qh,hcDark:Qh,hcLight:Qh},C("menuSelectionForeground","Foreground color of the selected menu item in menus.")),cit=J("menu.selectionBackground",{dark:Fg,light:Fg,hcDark:Fg,hcLight:Fg},C("menuSelectionBackground","Background color of the selected menu item in menus.")),uit=J("menu.selectionBorder",{dark:null,light:null,hcDark:Wi,hcLight:Wi},C("menuSelectionBorder","Border color of the selected menu item in menus.")),dit=J("menu.separatorBackground",{dark:"#606060",light:"#D4D4D4",hcDark:Ln,hcLight:Ln},C("menuSeparatorBackground","Color of a separator menu item in menus.")),dH=J("toolbar.hoverBackground",{dark:"#5a5d5e50",light:"#b8b8b850",hcDark:null,hcLight:null},C("toolbarHoverBackground","Toolbar background when hovering over actions using the mouse"));J("toolbar.hoverOutline",{dark:null,light:null,hcDark:Wi,hcLight:Wi},C("toolbarHoverOutline","Toolbar outline when hovering over actions using the mouse"));J("toolbar.activeBackground",{dark:Vd(dH,.1),light:Wb(dH,.1),hcDark:null,hcLight:null},C("toolbarActiveBackground","Toolbar background when holding the mouse over actions"));J("editor.snippetTabstopHighlightBackground",{dark:new ve(new Tn(124,124,124,.3)),light:new ve(new Tn(10,50,100,.2)),hcDark:new ve(new Tn(124,124,124,.3)),hcLight:new ve(new Tn(10,50,100,.2))},C("snippetTabstopHighlightBackground","Highlight background color of a snippet tabstop."));J("editor.snippetTabstopHighlightBorder",{dark:null,light:null,hcDark:null,hcLight:null},C("snippetTabstopHighlightBorder","Highlight border color of a snippet tabstop."));J("editor.snippetFinalTabstopHighlightBackground",{dark:null,light:null,hcDark:null,hcLight:null},C("snippetFinalTabstopHighlightBackground","Highlight background color of the final tabstop of a snippet."));J("editor.snippetFinalTabstopHighlightBorder",{dark:"#525252",light:new ve(new Tn(10,50,100,.5)),hcDark:"#525252",hcLight:"#292929"},C("snippetFinalTabstopHighlightBorder","Highlight border color of the final tabstop of a snippet."));const hit=J("breadcrumb.foreground",{light:yt(Ke,.8),dark:yt(Ke,.8),hcDark:yt(Ke,.8),hcLight:yt(Ke,.8)},C("breadcrumbsFocusForeground","Color of focused breadcrumb items.")),fit=J("breadcrumb.background",{light:pr,dark:pr,hcDark:pr,hcLight:pr},C("breadcrumbsBackground","Background color of breadcrumb items.")),bre=J("breadcrumb.focusForeground",{light:Wb(Ke,.2),dark:Vd(Ke,.1),hcDark:Vd(Ke,.1),hcLight:Vd(Ke,.1)},C("breadcrumbsFocusForeground","Color of focused breadcrumb items.")),git=J("breadcrumb.activeSelectionForeground",{light:Wb(Ke,.2),dark:Vd(Ke,.1),hcDark:Vd(Ke,.1),hcLight:Vd(Ke,.1)},C("breadcrumbsSelectedForeground","Color of selected breadcrumb items."));J("breadcrumbPicker.background",{light:po,dark:po,hcDark:po,hcLight:po},C("breadcrumbsSelectedBackground","Background color of breadcrumb item picker."));const tbe=.5,Cre=ve.fromHex("#40C8AE").transparent(tbe),wre=ve.fromHex("#40A6FF").transparent(tbe),yre=ve.fromHex("#606060").transparent(.4),xu=.4,wy=1,PC=J("merge.currentHeaderBackground",{dark:Cre,light:Cre,hcDark:null,hcLight:null},C("mergeCurrentHeaderBackground","Current header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);J("merge.currentContentBackground",{dark:yt(PC,xu),light:yt(PC,xu),hcDark:yt(PC,xu),hcLight:yt(PC,xu)},C("mergeCurrentContentBackground","Current content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);const OC=J("merge.incomingHeaderBackground",{dark:wre,light:wre,hcDark:null,hcLight:null},C("mergeIncomingHeaderBackground","Incoming header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);J("merge.incomingContentBackground",{dark:yt(OC,xu),light:yt(OC,xu),hcDark:yt(OC,xu),hcLight:yt(OC,xu)},C("mergeIncomingContentBackground","Incoming content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);const FC=J("merge.commonHeaderBackground",{dark:yre,light:yre,hcDark:null,hcLight:null},C("mergeCommonHeaderBackground","Common ancestor header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);J("merge.commonContentBackground",{dark:yt(FC,xu),light:yt(FC,xu),hcDark:yt(FC,xu),hcLight:yt(FC,xu)},C("mergeCommonContentBackground","Common ancestor content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);const yy=J("merge.border",{dark:null,light:null,hcDark:"#C3DF6F",hcLight:"#007ACC"},C("mergeBorder","Border color on headers and the splitter in inline merge-conflicts."));J("editorOverviewRuler.currentContentForeground",{dark:yt(PC,wy),light:yt(PC,wy),hcDark:yy,hcLight:yy},C("overviewRulerCurrentContentForeground","Current overview ruler foreground for inline merge-conflicts."));J("editorOverviewRuler.incomingContentForeground",{dark:yt(OC,wy),light:yt(OC,wy),hcDark:yy,hcLight:yy},C("overviewRulerIncomingContentForeground","Incoming overview ruler foreground for inline merge-conflicts."));J("editorOverviewRuler.commonContentForeground",{dark:yt(FC,wy),light:yt(FC,wy),hcDark:yy,hcLight:yy},C("overviewRulerCommonContentForeground","Common ancestor overview ruler foreground for inline merge-conflicts."));const _G=J("editorOverviewRuler.findMatchForeground",{dark:"#d186167e",light:"#d186167e",hcDark:"#AB5A00",hcLight:""},C("overviewRulerFindMatchForeground","Overview ruler marker color for find matches. The color must not be opaque so as not to hide underlying decorations."),!0),xL=J("editorOverviewRuler.selectionHighlightForeground",{dark:"#A0A0A0CC",light:"#A0A0A0CC",hcDark:"#A0A0A0CC",hcLight:"#A0A0A0CC"},C("overviewRulerSelectionHighlightForeground","Overview ruler marker color for selection highlights. The color must not be opaque so as not to hide underlying decorations."),!0),BC=J("minimap.findMatchHighlight",{light:"#d18616",dark:"#d18616",hcDark:"#AB5A00",hcLight:"#0F4A85"},C("minimapFindMatchHighlight","Minimap marker color for find matches."),!0),f5=J("minimap.selectionOccurrenceHighlight",{light:"#c9c9c9",dark:"#676767",hcDark:"#ffffff",hcLight:"#0F4A85"},C("minimapSelectionOccurrenceHighlight","Minimap marker color for repeating editor selections."),!0),Sre=J("minimap.selectionHighlight",{light:"#ADD6FF",dark:"#264F78",hcDark:"#ffffff",hcLight:"#0F4A85"},C("minimapSelectionHighlight","Minimap marker color for the editor selection."),!0),pit=J("minimap.infoHighlight",{dark:Ra,light:Ra,hcDark:XD,hcLight:XD},C("minimapInfo","Minimap marker color for infos.")),mit=J("minimap.warningHighlight",{dark:Hl,light:Hl,hcDark:GD,hcLight:GD},C("overviewRuleWarning","Minimap marker color for warnings.")),vit=J("minimap.errorHighlight",{dark:new ve(new Tn(255,18,18,.7)),light:new ve(new Tn(255,18,18,.7)),hcDark:new ve(new Tn(255,50,50,1)),hcLight:"#B5200D"},C("minimapError","Minimap marker color for errors.")),_it=J("minimap.background",{dark:null,light:null,hcDark:null,hcLight:null},C("minimapBackground","Minimap background color.")),bit=J("minimap.foregroundOpacity",{dark:ve.fromHex("#000f"),light:ve.fromHex("#000f"),hcDark:ve.fromHex("#000f"),hcLight:ve.fromHex("#000f")},C("minimapForegroundOpacity",'Opacity of foreground elements rendered in the minimap. For example, "#000000c0" will render the elements with 75% opacity.'));J("minimapSlider.background",{light:yt(bL,.5),dark:yt(bL,.5),hcDark:yt(bL,.5),hcLight:yt(bL,.5)},C("minimapSliderBackground","Minimap slider background color."));J("minimapSlider.hoverBackground",{light:yt(CL,.5),dark:yt(CL,.5),hcDark:yt(CL,.5),hcLight:yt(CL,.5)},C("minimapSliderHoverBackground","Minimap slider background color when hovering."));J("minimapSlider.activeBackground",{light:yt(wL,.5),dark:yt(wL,.5),hcDark:yt(wL,.5),hcLight:yt(wL,.5)},C("minimapSliderActiveBackground","Minimap slider background color when clicked on."));const Cit=J("problemsErrorIcon.foreground",{dark:Gh,light:Gh,hcDark:Gh,hcLight:Gh},C("problemsErrorIconForeground","The color used for the problems error icon.")),wit=J("problemsWarningIcon.foreground",{dark:Hl,light:Hl,hcDark:Hl,hcLight:Hl},C("problemsWarningIconForeground","The color used for the problems warning icon.")),yit=J("problemsInfoIcon.foreground",{dark:Ra,light:Ra,hcDark:Ra,hcLight:Ra},C("problemsInfoIconForeground","The color used for the problems info icon."));J("charts.foreground",{dark:Ke,light:Ke,hcDark:Ke,hcLight:Ke},C("chartsForeground","The foreground color used in charts."));J("charts.lines",{dark:yt(Ke,.5),light:yt(Ke,.5),hcDark:yt(Ke,.5),hcLight:yt(Ke,.5)},C("chartsLines","The color used for horizontal lines in charts."));J("charts.red",{dark:Gh,light:Gh,hcDark:Gh,hcLight:Gh},C("chartsRed","The red color used in chart visualizations."));J("charts.blue",{dark:Ra,light:Ra,hcDark:Ra,hcLight:Ra},C("chartsBlue","The blue color used in chart visualizations."));J("charts.yellow",{dark:Hl,light:Hl,hcDark:Hl,hcLight:Hl},C("chartsYellow","The yellow color used in chart visualizations."));J("charts.orange",{dark:BC,light:BC,hcDark:BC,hcLight:BC},C("chartsOrange","The orange color used in chart visualizations."));J("charts.green",{dark:"#89D185",light:"#388A34",hcDark:"#89D185",hcLight:"#374e06"},C("chartsGreen","The green color used in chart visualizations."));J("charts.purple",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},C("chartsPurple","The purple color used in chart visualizations."));function Sit(i,e){var t,n,o,r;switch(i.op){case 0:return(t=rd(i.value,e))===null||t===void 0?void 0:t.darken(i.factor);case 1:return(n=rd(i.value,e))===null||n===void 0?void 0:n.lighten(i.factor);case 2:return(o=rd(i.value,e))===null||o===void 0?void 0:o.transparent(i.factor);case 3:{const s=rd(i.background,e);return s?(r=rd(i.value,e))===null||r===void 0?void 0:r.makeOpaque(s):rd(i.value,e)}case 4:for(const s of i.values){const a=rd(s,e);if(a)return a}return;case 6:return rd(e.defines(i.if)?i.then:i.else,e);case 5:{const s=rd(i.value,e);if(!s)return;const a=rd(i.background,e);return a?s.isDarkerThan(a)?ve.getLighterColor(s,a,i.factor).transparent(i.transparency):ve.getDarkerColor(s,a,i.factor).transparent(i.transparency):s.transparent(i.factor*i.transparency)}default:throw Y4()}}function Wb(i,e){return{op:0,value:i,factor:e}}function Vd(i,e){return{op:1,value:i,factor:e}}function yt(i,e){return{op:2,value:i,factor:e}}function YD(...i){return{op:4,values:i}}function xit(i,e,t){return{op:6,if:i,then:e,else:t}}function xre(i,e,t,n){return{op:5,value:i,background:e,factor:t,transparency:n}}function rd(i,e){if(i!==null){if(typeof i=="string")return i[0]==="#"?ve.fromHex(i):e.getColor(i);if(i instanceof ve)return i;if(typeof i=="object")return Sit(i,e)}}const nbe="vscode://schemas/workbench-colors",ibe=no.as(a5.JSONContribution);ibe.registerSchema(nbe,h5.getColorSchema());const Lre=new bi(()=>ibe.notifySchemaChanged(nbe),200);h5.onDidChangeSchema(()=>{Lre.isScheduled()||Lre.schedule()});class g5{constructor(e,t){this.x=e,this.y=t,this._pageCoordinatesBrand=void 0}toClientCoordinates(){return new obe(this.x-window.scrollX,this.y-window.scrollY)}}class obe{constructor(e,t){this.clientX=e,this.clientY=t,this._clientCoordinatesBrand=void 0}toPageCoordinates(){return new g5(this.clientX+window.scrollX,this.clientY+window.scrollY)}}class Lit{constructor(e,t,n,o){this.x=e,this.y=t,this.width=n,this.height=o,this._editorPagePositionBrand=void 0}}class Eit{constructor(e,t){this.x=e,this.y=t,this._positionRelativeToEditorBrand=void 0}}function bG(i){const e=Yo(i);return new Lit(e.left,e.top,e.width,e.height)}function CG(i,e,t){const n=e.width/i.offsetWidth,o=e.height/i.offsetHeight,r=(t.x-e.x)/n,s=(t.y-e.y)/o;return new Eit(r,s)}class Ev extends Dc{constructor(e,t,n){super(e),this._editorMouseEventBrand=void 0,this.isFromPointerCapture=t,this.pos=new g5(this.posx,this.posy),this.editorPos=bG(n),this.relativePos=CG(n,this.editorPos,this.pos)}}class Dit{constructor(e){this._editorViewDomNode=e}_create(e){return new Ev(e,!1,this._editorViewDomNode)}onContextMenu(e,t){return ke(e,"contextmenu",n=>{t(this._create(n))})}onMouseUp(e,t){return ke(e,"mouseup",n=>{t(this._create(n))})}onMouseDown(e,t){return ke(e,et.MOUSE_DOWN,n=>{t(this._create(n))})}onPointerDown(e,t){return ke(e,et.POINTER_DOWN,n=>{t(this._create(n),n.pointerId)})}onMouseLeave(e,t){return ke(e,et.MOUSE_LEAVE,n=>{t(this._create(n))})}onMouseMove(e,t){return ke(e,"mousemove",n=>t(this._create(n)))}}class kit{constructor(e){this._editorViewDomNode=e}_create(e){return new Ev(e,!1,this._editorViewDomNode)}onPointerUp(e,t){return ke(e,"pointerup",n=>{t(this._create(n))})}onPointerDown(e,t){return ke(e,et.POINTER_DOWN,n=>{t(this._create(n),n.pointerId)})}onPointerLeave(e,t){return ke(e,et.POINTER_LEAVE,n=>{t(this._create(n))})}onPointerMove(e,t){return ke(e,"pointermove",n=>t(this._create(n)))}}class Iit extends _e{constructor(e){super(),this._editorViewDomNode=e,this._globalPointerMoveMonitor=this._register(new CS),this._keydownListener=null}startMonitoring(e,t,n,o,r){this._keydownListener=No(e.ownerDocument,"keydown",s=>{s.toKeyCodeChord().isModifierKey()||this._globalPointerMoveMonitor.stopMonitoring(!0,s.browserEvent)},!0),this._globalPointerMoveMonitor.startMonitoring(e,t,n,s=>{o(new Ev(s,!0,this._editorViewDomNode))},s=>{this._keydownListener.dispose(),r(s)})}stopMonitoring(){this._globalPointerMoveMonitor.stopMonitoring(!0)}}class jI{constructor(e){this._editor=e,this._instanceId=++jI._idPool,this._counter=0,this._rules=new Map,this._garbageCollectionScheduler=new bi(()=>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 n=this._rules.get(t);if(!n){const o=this._counter++;n=new Tit(t,`dyn-rule-${this._instanceId}-${o}`,UA(this._editor.getContainerDomNode())?this._editor.getContainerDomNode():void 0,e),this._rules.set(t,n)}return n}computeUniqueKey(e){return JSON.stringify(e)}garbageCollect(){for(const e of this._rules.values())e.hasReferences()||(this._rules.delete(e.key),e.dispose())}}jI._idPool=0;class Tit{constructor(e,t,n,o){this.key=e,this.className=t,this.properties=o,this._referenceCount=0,this._styleElement=Bc(n),this._styleElement.textContent=this.getCssText(this.className,this.properties)}getCssText(e,t){let n=`.${e} {`;for(const o in t){const r=t[o];let s;typeof r=="object"?s=ct(r.id):s=r,n+=` - ${Nit(o)}: ${s};`}return n+=` -}`,n}dispose(){this._styleElement.remove()}increaseRefCount(){this._referenceCount++}decreaseRefCount(){this._referenceCount--}hasReferences(){return this._referenceCount>0}}function Nit(i){return i.replace(/(^[A-Z])/,([e])=>e.toLowerCase()).replace(/([A-Z])/g,([e])=>`-${e.toLowerCase()}`)}class KI extends _e{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 n=0,o=e.length;n=a.left?o.width=Math.max(o.width,a.left+a.width-o.left):(t[n++]=o,o=a)}return t[n++]=o,t}static _createHorizontalRangesFromClientRects(e,t,n){if(!e||e.length===0)return null;const o=[];for(let r=0,s=e.length;rl)return null;if(t=Math.min(l,Math.max(0,t)),o=Math.min(l,Math.max(0,o)),t===o&&n===r&&n===0&&!e.children[t].firstChild){const h=e.children[t].getClientRects();return s.markDidDomLayout(),this._createHorizontalRangesFromClientRects(h,s.clientRectDeltaLeft,s.clientRectScale)}t!==o&&o>0&&r===0&&(o--,r=1073741824);let c=e.children[t].firstChild,u=e.children[o].firstChild;if((!c||!u)&&(!c&&n===0&&t>0&&(c=e.children[t-1].firstChild,n=1073741824),!u&&r===0&&o>0&&(u=e.children[o-1].firstChild,r=1073741824)),!c||!u)return null;n=Math.min(c.textContent.length,Math.max(0,n)),r=Math.min(u.textContent.length,Math.max(0,r));const d=this._readClientRects(c,n,u,r,s.endNode);return s.markDidDomLayout(),this._createHorizontalRangesFromClientRects(d,s.clientRectDeltaLeft,s.clientRectScale)}}var kc;(function(i){i.DARK="dark",i.LIGHT="light",i.HIGH_CONTRAST_DARK="hcDark",i.HIGH_CONTRAST_LIGHT="hcLight"})(kc||(kc={}));function Hd(i){return i===kc.HIGH_CONTRAST_DARK||i===kc.HIGH_CONTRAST_LIGHT}function Sy(i){return i===kc.DARK||i===kc.HIGH_CONTRAST_DARK}const Oit=function(){return Fd?!0:!(Ss||Oc||sp)}();let Sw=!0;class Dre{constructor(e,t){this.themeType=t;const n=e.options,o=n.get(50);n.get(38)==="off"?this.renderWhitespace=n.get(98):this.renderWhitespace="none",this.renderControlCharacters=n.get(93),this.spaceWidth=o.spaceWidth,this.middotWidth=o.middotWidth,this.wsmiddotWidth=o.wsmiddotWidth,this.useMonospaceOptimizations=o.isMonospace&&!n.get(33),this.canUseHalfwidthRightwardsArrow=o.canUseHalfwidthRightwardsArrow,this.lineHeight=n.get(66),this.stopRenderingLineAfter=n.get(116),this.fontLigatures=n.get(51)}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}}class Ah{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=ti(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 Hd(this._options.themeType)||this._options.renderWhitespace==="selection"?(this._isMaybeInvalid=!0,!0):!1}renderLine(e,t,n,o){if(this._isMaybeInvalid===!1)return!1;this._isMaybeInvalid=!1;const r=n.getViewLineRenderingData(e),s=this._options,a=ol.filter(r.inlineDecorations,e,r.minColumn,r.maxColumn);let l=null;if(Hd(s.themeType)||this._options.renderWhitespace==="selection"){const h=n.selections;for(const f of h){if(f.endLineNumbere)continue;const g=f.startLineNumber===e?f.startColumn:r.minColumn,p=f.endLineNumber===e?f.endColumn:r.maxColumn;g');const u=zI(c,o);o.appendString("");let d=null;return Sw&&Oit&&r.isBasicASCII&&s.useMonospaceOptimizations&&u.containsForeignElements===0&&(d=new a2(this._renderedViewLine?this._renderedViewLine.domNode:null,c,u.characterMapping)),d||(d=sbe(this._renderedViewLine?this._renderedViewLine.domNode:null,c,u.characterMapping,u.containsRTL,u.containsForeignElements)),this._renderedViewLine=d,!0}layoutLine(e,t){this._renderedViewLine&&this._renderedViewLine.domNode&&(this._renderedViewLine.domNode.setTop(t),this._renderedViewLine.domNode.setHeight(this._options.lineHeight))}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 a2:!1}monospaceAssumptionsAreValid(){return this._renderedViewLine&&this._renderedViewLine instanceof a2?this._renderedViewLine.monospaceAssumptionsAreValid():Sw}onMonospaceAssumptionsInvalidated(){this._renderedViewLine&&this._renderedViewLine instanceof a2&&(this._renderedViewLine=this._renderedViewLine.toSlowRenderedLine())}getVisibleRangesForRange(e,t,n,o){if(!this._renderedViewLine)return null;t=Math.min(this._renderedViewLine.input.lineContent.length+1,Math.max(1,t)),n=Math.min(this._renderedViewLine.input.lineContent.length+1,Math.max(1,n));const r=this._renderedViewLine.input.stopRenderingLineAfter;if(r!==-1&&t>r+1&&n>r+1)return new Ere(!0,[new D0(this.getWidth(o),0)]);r!==-1&&t>r+1&&(t=r+1),r!==-1&&n>r+1&&(n=r+1);const s=this._renderedViewLine.getVisibleRangesForRange(e,t,n,o);return s&&s.length>0?new Ere(!1,s):null}getColumnOfNodeOffset(e,t){return this._renderedViewLine?this._renderedViewLine.getColumnOfNodeOffset(e,t):1}}Ah.CLASS_NAME="view-line";class a2{constructor(e,t,n){this._cachedWidth=-1,this.domNode=e,this.input=t;const o=Math.floor(t.lineContent.length/300);if(o>0){this._keyColumnPixelOffsetCache=new Float32Array(o);for(let r=0;r=2&&(console.warn("monospace assumptions have been violated, therefore disabling monospace optimizations!"),Sw=!1)}return Sw}toSlowRenderedLine(){return sbe(this.domNode,this.input,this._characterMapping,!1,0)}getVisibleRangesForRange(e,t,n,o){const r=this._getColumnPixelOffset(e,t,o),s=this._getColumnPixelOffset(e,n,o);return[new D0(r,s-r)]}_getColumnPixelOffset(e,t,n){if(t<=300){const c=this._characterMapping.getHorizontalOffset(t);return this._charWidth*c}const o=Math.floor((t-1)/300)-1,r=(o+1)*300+1;let s=-1;if(this._keyColumnPixelOffsetCache&&(s=this._keyColumnPixelOffsetCache[o],s===-1&&(s=this._actualReadPixelOffset(e,r,n),this._keyColumnPixelOffsetCache[o]=s)),s===-1){const c=this._characterMapping.getHorizontalOffset(t);return this._charWidth*c}const a=this._characterMapping.getHorizontalOffset(r),l=this._characterMapping.getHorizontalOffset(t);return s+this._charWidth*(l-a)}_getReadingTarget(e){return e.domNode.firstChild}_actualReadPixelOffset(e,t,n){if(!this.domNode)return-1;const o=this._characterMapping.getDomPosition(t),r=sM.readHorizontalRanges(this._getReadingTarget(this.domNode),o.partIndex,o.charIndex,o.partIndex,o.charIndex,n);return!r||r.length===0?-1:r[0].left}getColumnOfNodeOffset(e,t){return wG(this._characterMapping,e,t)}}class rbe{constructor(e,t,n,o,r){if(this.domNode=e,this.input=t,this._characterMapping=n,this._isWhitespaceOnly=/^\s*$/.test(t.lineContent),this._containsForeignElements=r,this._cachedWidth=-1,this._pixelOffsetCache=null,!o||this._characterMapping.length===0){this._pixelOffsetCache=new Float32Array(Math.max(2,this._characterMapping.length+1));for(let s=0,a=this._characterMapping.length;s<=a;s++)this._pixelOffsetCache[s]=-1}}_getReadingTarget(e){return e.domNode.firstChild}getWidth(e){return this.domNode?(this._cachedWidth===-1&&(this._cachedWidth=this._getReadingTarget(this.domNode).offsetWidth,e==null||e.markDidDomLayout()),this._cachedWidth):0}getWidthIsFast(){return this._cachedWidth!==-1}getVisibleRangesForRange(e,t,n,o){if(!this.domNode)return null;if(this._pixelOffsetCache!==null){const r=this._readPixelOffset(this.domNode,e,t,o);if(r===-1)return null;const s=this._readPixelOffset(this.domNode,e,n,o);return s===-1?null:[new D0(r,s-r)]}return this._readVisibleRangesForRange(this.domNode,e,t,n,o)}_readVisibleRangesForRange(e,t,n,o,r){if(n===o){const s=this._readPixelOffset(e,t,n,r);return s===-1?null:[new D0(s,0)]}else return this._readRawVisibleRangesForRange(e,n,o,r)}_readPixelOffset(e,t,n,o){if(this._characterMapping.length===0){if(this._containsForeignElements===0||this._containsForeignElements===2)return 0;if(this._containsForeignElements===1)return this.getWidth(o);const r=this._getReadingTarget(e);return r.firstChild?(o.markDidDomLayout(),r.firstChild.offsetWidth):0}if(this._pixelOffsetCache!==null){const r=this._pixelOffsetCache[n];if(r!==-1)return r;const s=this._actualReadPixelOffset(e,t,n,o);return this._pixelOffsetCache[n]=s,s}return this._actualReadPixelOffset(e,t,n,o)}_actualReadPixelOffset(e,t,n,o){if(this._characterMapping.length===0){const l=sM.readHorizontalRanges(this._getReadingTarget(e),0,0,0,0,o);return!l||l.length===0?-1:l[0].left}if(n===this._characterMapping.length&&this._isWhitespaceOnly&&this._containsForeignElements===0)return this.getWidth(o);const r=this._characterMapping.getDomPosition(n),s=sM.readHorizontalRanges(this._getReadingTarget(e),r.partIndex,r.charIndex,r.partIndex,r.charIndex,o);if(!s||s.length===0)return-1;const a=s[0].left;if(this.input.isBasicASCII){const l=this._characterMapping.getHorizontalOffset(n),c=Math.round(this.input.spaceWidth*l);if(Math.abs(c-a)<=1)return c}return a}_readRawVisibleRangesForRange(e,t,n,o){if(t===1&&n===this._characterMapping.length)return[new D0(0,this.getWidth(o))];const r=this._characterMapping.getDomPosition(t),s=this._characterMapping.getDomPosition(n);return sM.readHorizontalRanges(this._getReadingTarget(e),r.partIndex,r.charIndex,s.partIndex,s.charIndex,o)}getColumnOfNodeOffset(e,t){return wG(this._characterMapping,e,t)}}class Fit extends rbe{_readVisibleRangesForRange(e,t,n,o,r){const s=super._readVisibleRangesForRange(e,t,n,o,r);if(!s||s.length===0||n===o||n===1&&o===this._characterMapping.length)return s;if(!this.input.containsRTL){const a=this._readPixelOffset(e,t,o,r);if(a!==-1){const l=s[s.length-1];l.left=t){const d=t-s;return c-t=4&&e[0]===3&&e[3]===7}static isStrictChildOfViewLines(e){return e.length>4&&e[0]===3&&e[3]===7}static isChildOfScrollableElement(e){return e.length>=2&&e[0]===3&&e[1]===5}static isChildOfMinimap(e){return e.length>=2&&e[0]===3&&e[1]===8}static isChildOfContentWidgets(e){return e.length>=4&&e[0]===3&&e[3]===1}static isChildOfOverflowGuard(e){return e.length>=1&&e[0]===3}static isChildOfOverflowingContentWidgets(e){return e.length>=1&&e[0]===2}static isChildOfOverlayWidgets(e){return e.length>=2&&e[0]===3&&e[1]===4}}class xy{constructor(e,t,n){this.viewModel=e.viewModel;const o=e.configuration.options;this.layoutInfo=o.get(143),this.viewDomNode=t.viewDomNode,this.lineHeight=o.get(66),this.stickyTabStops=o.get(115),this.typicalHalfwidthCharacterWidth=o.get(50).typicalHalfwidthCharacterWidth,this.lastRenderData=n,this._context=e,this._viewHelper=t}getZoneAtCoord(e){return xy.getZoneAtCoord(this._context,e)}static getZoneAtCoord(e,t){const n=e.viewLayout.getWhitespaceAtVerticalOffset(t);if(n){const o=n.verticalOffset+n.height/2,r=e.viewModel.getLineCount();let s=null,a,l=null;return n.afterLineNumber!==r&&(l=new ae(n.afterLineNumber+1,1)),n.afterLineNumber>0&&(s=new ae(n.afterLineNumber,e.viewModel.getLineMaxColumn(n.afterLineNumber))),l===null?a=s:s===null?a=l:t=e.layoutInfo.glyphMarginLeft,this.isInContentArea=!this.isInMarginArea,this.mouseColumn=Math.max(0,Yr._getMouseColumn(this.mouseContentHorizontalOffset,e.typicalHalfwidthCharacterWidth))}}class yG extends Hit{constructor(e,t,n,o,r){super(e,t,n,o),this._ctx=e,r?(this.target=r,this.targetPath=mf.collect(r,e.viewDomNode)):(this.target=null,this.targetPath=new Uint8Array(0))}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}`}_getMouseColumn(e=null){return e&&e.columns.contentLeft+s.width)continue;const a=e.getVerticalOffsetForLineNumber(s.position.lineNumber);if(a<=r&&r<=a+s.height)return t.fulfillContentText(s.position,null,{mightBeForeignElement:!1,injectedText:null})}}return null}static _hitTestViewZone(e,t){const n=e.getZoneAtCoord(t.mouseVerticalOffset);if(n){const o=t.isInContentArea?8:5;return t.fulfillViewZone(o,n.position,n)}return null}static _hitTestTextArea(e,t){return xl.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 n=e.getFullLineRangeAtCoord(t.mouseVerticalOffset),o=n.range.getStartPosition();let r=Math.abs(t.relativePos.x);const s={isAfterLines:n.isAfterLines,glyphMarginLeft:e.layoutInfo.glyphMarginLeft,glyphMarginWidth:e.layoutInfo.glyphMarginWidth,lineNumbersWidth:e.layoutInfo.lineNumbersWidth,offsetX:r};return r-=e.layoutInfo.glyphMarginLeft,r<=e.layoutInfo.glyphMarginWidth?t.fulfillMargin(2,o,n.range,s):(r-=e.layoutInfo.glyphMarginWidth,r<=e.layoutInfo.lineNumbersWidth?t.fulfillMargin(3,o,n.range,s):(r-=e.layoutInfo.lineNumbersWidth,t.fulfillMargin(4,o,n.range,s)))}return null}static _hitTestViewLines(e,t,n){if(!xl.isChildOfViewLines(t.targetPath))return null;if(e.isInTopPadding(t.mouseVerticalOffset))return t.fulfillContentEmpty(new ae(1,1),kre);if(e.isAfterLines(t.mouseVerticalOffset)||e.isInBottomPadding(t.mouseVerticalOffset)){const r=e.viewModel.getLineCount(),s=e.viewModel.getLineMaxColumn(r);return t.fulfillContentEmpty(new ae(r,s),kre)}if(n){if(xl.isStrictChildOfViewLines(t.targetPath)){const r=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset);if(e.viewModel.getLineLength(r)===0){const a=e.getLineWidth(r),l=n9(t.mouseContentHorizontalOffset-a);return t.fulfillContentEmpty(new ae(r,1),l)}const s=e.getLineWidth(r);if(t.mouseContentHorizontalOffset>=s){const a=n9(t.mouseContentHorizontalOffset-s),l=new ae(r,e.viewModel.getLineMaxColumn(r));return t.fulfillContentEmpty(l,a)}}return t.fulfillUnknown()}const o=Yr._doHitTest(e,t);return o.type===1?Yr.createMouseTargetFromHitTestPosition(e,t,o.spanNode,o.position,o.injectedText):this._createMouseTarget(e,t.withTarget(o.hitTarget),!0)}static _hitTestMinimap(e,t){if(xl.isChildOfMinimap(t.targetPath)){const n=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),o=e.viewModel.getLineMaxColumn(n);return t.fulfillScrollbar(new ae(n,o))}return null}static _hitTestScrollbarSlider(e,t){if(xl.isChildOfScrollableElement(t.targetPath)&&t.target&&t.target.nodeType===1){const n=t.target.className;if(n&&/\b(slider|scrollbar)\b/.test(n)){const o=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),r=e.viewModel.getLineMaxColumn(o);return t.fulfillScrollbar(new ae(o,r))}}return null}static _hitTestScrollbar(e,t){if(xl.isChildOfScrollableElement(t.targetPath)){const n=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),o=e.viewModel.getLineMaxColumn(n);return t.fulfillScrollbar(new ae(n,o))}return null}getMouseColumn(e){const t=this._context.configuration.options,n=t.get(143),o=this._context.viewLayout.getCurrentScrollLeft()+e.x-n.contentLeft;return Yr._getMouseColumn(o,t.get(50).typicalHalfwidthCharacterWidth)}static _getMouseColumn(e,t){return e<0?1:Math.round(e/t)+1}static createMouseTargetFromHitTestPosition(e,t,n,o,r){const s=o.lineNumber,a=o.column,l=e.getLineWidth(s);if(t.mouseContentHorizontalOffset>l){const m=n9(t.mouseContentHorizontalOffset-l);return t.fulfillContentEmpty(o,m)}const c=e.visibleRangeForPosition(s,a);if(!c)return t.fulfillUnknown(o);const u=c.left;if(Math.abs(t.mouseContentHorizontalOffset-u)<1)return t.fulfillContentText(o,null,{mightBeForeignElement:!!r,injectedText:r});const d=[];if(d.push({offset:c.left,column:a}),a>1){const m=e.visibleRangeForPosition(s,a-1);m&&d.push({offset:m.left,column:a-1})}const h=e.viewModel.getLineMaxColumn(s);if(am.offset-_.offset);const f=t.pos.toClientCoordinates(),g=n.getBoundingClientRect(),p=g.left<=f.clientX&&f.clientX<=g.right;let v=null;for(let m=1;mr)){const a=Math.floor((o+r)/2);let l=t.pos.y+(a-t.mouseVerticalOffset);l<=t.editorPos.y&&(l=t.editorPos.y+1),l>=t.editorPos.y+t.editorPos.height&&(l=t.editorPos.y+t.editorPos.height-1);const c=new g5(t.pos.x,l),u=this._actualDoHitTestWithCaretRangeFromPoint(e,c.toClientCoordinates());if(u.type===1)return u}return this._actualDoHitTestWithCaretRangeFromPoint(e,t.pos.toClientCoordinates())}static _actualDoHitTestWithCaretRangeFromPoint(e,t){const n=J0(e.viewDomNode);let o;if(n?typeof n.caretRangeFromPoint=="undefined"?o=$it(n,t.clientX,t.clientY):o=n.caretRangeFromPoint(t.clientX,t.clientY):o=e.viewDomNode.ownerDocument.caretRangeFromPoint(t.clientX,t.clientY),!o||!o.startContainer)return new Kp;const r=o.startContainer;if(r.nodeType===r.TEXT_NODE){const s=r.parentNode,a=s?s.parentNode:null,l=a?a.parentNode:null;return(l&&l.nodeType===l.ELEMENT_NODE?l.className:null)===Ah.CLASS_NAME?H_.createFromDOMInfo(e,s,o.startOffset):new Kp(r.parentNode)}else if(r.nodeType===r.ELEMENT_NODE){const s=r.parentNode,a=s?s.parentNode:null;return(a&&a.nodeType===a.ELEMENT_NODE?a.className:null)===Ah.CLASS_NAME?H_.createFromDOMInfo(e,r,r.textContent.length):new Kp(r)}return new Kp}static _doHitTestWithCaretPositionFromPoint(e,t){const n=e.viewDomNode.ownerDocument.caretPositionFromPoint(t.clientX,t.clientY);if(n.offsetNode.nodeType===n.offsetNode.TEXT_NODE){const o=n.offsetNode.parentNode,r=o?o.parentNode:null,s=r?r.parentNode:null;return(s&&s.nodeType===s.ELEMENT_NODE?s.className:null)===Ah.CLASS_NAME?H_.createFromDOMInfo(e,n.offsetNode.parentNode,n.offset):new Kp(n.offsetNode.parentNode)}if(n.offsetNode.nodeType===n.offsetNode.ELEMENT_NODE){const o=n.offsetNode.parentNode,r=o&&o.nodeType===o.ELEMENT_NODE?o.className:null,s=o?o.parentNode:null,a=s&&s.nodeType===s.ELEMENT_NODE?s.className:null;if(r===Ah.CLASS_NAME){const l=n.offsetNode.childNodes[Math.min(n.offset,n.offsetNode.childNodes.length-1)];if(l)return H_.createFromDOMInfo(e,l,0)}else if(a===Ah.CLASS_NAME)return H_.createFromDOMInfo(e,n.offsetNode,0)}return new Kp(n.offsetNode)}static _snapToSoftTabBoundary(e,t){const n=t.getLineContent(e.lineNumber),{tabSize:o}=t.model.getOptions(),r=ZD.atomicPosition(n,e.column-1,o,2);return r!==-1?new ae(e.lineNumber,r+1):e}static _doHitTest(e,t){let n=new Kp;if(typeof e.viewDomNode.ownerDocument.caretRangeFromPoint=="function"?n=this._doHitTestWithCaretRangeFromPoint(e,t):e.viewDomNode.ownerDocument.caretPositionFromPoint&&(n=this._doHitTestWithCaretPositionFromPoint(e,t.pos.toClientCoordinates())),n.type===1){const o=e.viewModel.getInjectedTextAt(n.position),r=e.viewModel.normalizePosition(n.position,2);(o||!r.equals(n.position))&&(n=new abe(r,n.spanNode,o))}return n}}function $it(i,e,t){const n=document.createRange();let o=i.elementFromPoint(e,t);if(o!==null){for(;o&&o.firstChild&&o.firstChild.nodeType!==o.firstChild.TEXT_NODE&&o.lastChild&&o.lastChild.firstChild;)o=o.lastChild;const r=o.getBoundingClientRect(),s=window.getComputedStyle(o,null).getPropertyValue("font-style"),a=window.getComputedStyle(o,null).getPropertyValue("font-variant"),l=window.getComputedStyle(o,null).getPropertyValue("font-weight"),c=window.getComputedStyle(o,null).getPropertyValue("font-size"),u=window.getComputedStyle(o,null).getPropertyValue("line-height"),d=window.getComputedStyle(o,null).getPropertyValue("font-family"),h=`${s} ${a} ${l} ${c}/${u} ${d}`,f=o.innerText;let g=r.left,p=0,v;if(e>r.left+r.width)p=f.length;else{const m=f0.getInstance();for(let _=0;_t(new Dc(n))))}onmousedown(e,t){this._register(ke(e,et.MOUSE_DOWN,n=>t(new Dc(n))))}onmouseover(e,t){this._register(ke(e,et.MOUSE_OVER,n=>t(new Dc(n))))}onmouseleave(e,t){this._register(ke(e,et.MOUSE_LEAVE,n=>t(new Dc(n))))}onkeydown(e,t){this._register(ke(e,et.KEY_DOWN,n=>t(new Pi(n))))}onkeyup(e,t){this._register(ke(e,et.KEY_UP,n=>t(new Pi(n))))}oninput(e,t){this._register(ke(e,et.INPUT,t))}onblur(e,t){this._register(ke(e,et.BLUR,t))}onfocus(e,t){this._register(ke(e,et.FOCUS,t))}ignoreGesture(e){return Ei.ignoreTarget(e)}}const Ly=11;class zit extends zu{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!="undefined"&&(this.bgDomNode.style.top="0px"),typeof e.left!="undefined"&&(this.bgDomNode.style.left="0px"),typeof e.bottom!="undefined"&&(this.bgDomNode.style.bottom="0px"),typeof e.right!="undefined"&&(this.bgDomNode.style.right="0px"),this.domNode=document.createElement("div"),this.domNode.className=e.className,this.domNode.classList.add(...Mt.asClassNameArray(e.icon)),this.domNode.style.position="absolute",this.domNode.style.width=Ly+"px",this.domNode.style.height=Ly+"px",typeof e.top!="undefined"&&(this.domNode.style.top=e.top+"px"),typeof e.left!="undefined"&&(this.domNode.style.left=e.left+"px"),typeof e.bottom!="undefined"&&(this.domNode.style.bottom=e.bottom+"px"),typeof e.right!="undefined"&&(this.domNode.style.right=e.right+"px"),this._pointerMoveMonitor=this._register(new CS),this._register(No(this.bgDomNode,et.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._register(No(this.domNode,et.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._pointerdownRepeatTimer=this._register(new VI),this._pointerdownScheduleRepeatTimer=this._register(new $u)}_arrowPointerDown(e){if(!e.target||!(e.target instanceof Element))return;const t=()=>{this._pointerdownRepeatTimer.cancelAndSet(()=>this._onActivate(),1e3/24)};this._onActivate(),this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancelAndSet(t,200),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,n=>{},()=>{this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancel()}),e.preventDefault()}}class Uit extends _e{constructor(e,t,n){super(),this._visibility=e,this._visibleClassName=t,this._invisibleClassName=n,this._domNode=null,this._isVisible=!1,this._isNeeded=!1,this._rawShouldBeVisible=!1,this._shouldBeVisible=!1,this._revealTimer=this._register(new $u)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this._updateShouldBeVisible())}setShouldBeVisible(e){this._rawShouldBeVisible=e,this._updateShouldBeVisible()}_applyVisibilitySetting(){return this._visibility===2?!1:this._visibility===3?!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(()=>{var e;(e=this._domNode)===null||e===void 0||e.setClassName(this._visibleClassName)},0))}_hide(e){var t;this._revealTimer.cancel(),this._isVisible&&(this._isVisible=!1,(t=this._domNode)===null||t===void 0||t.setClassName(this._invisibleClassName+(e?" fade":"")))}}const jit=140;class lbe extends zu{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 Uit(e.visibility,"visible scrollbar "+e.extraScrollbarClassName,"invisible scrollbar "+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._pointerMoveMonitor=this._register(new CS),this._shouldRender=!0,this.domNode=ti(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(ke(this.domNode.domNode,et.POINTER_DOWN,t=>this._domNodePointerDown(t)))}_createArrow(e){const t=this._register(new zit(e));this.domNode.domNode.appendChild(t.bgDomNode),this.domNode.domNode.appendChild(t.domNode)}_createSlider(e,t,n,o){this.slider=ti(document.createElement("div")),this.slider.setClassName("slider"),this.slider.setPosition("absolute"),this.slider.setTop(e),this.slider.setLeft(t),typeof n=="number"&&this.slider.setWidth(n),typeof o=="number"&&this.slider.setHeight(o),this.slider.setLayerHinting(!0),this.slider.setContain("strict"),this.domNode.domNode.appendChild(this.slider.domNode),this._register(ke(this.slider.domNode,et.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,n=t+this._scrollbarState.getSliderPosition(),o=t+this._scrollbarState.getSliderPosition()+this._scrollbarState.getSliderSize(),r=this._sliderPointerPosition(e);n<=r&&r<=o?e.button===0&&(e.preventDefault(),this._sliderPointerDown(e)):this._onPointerDown(e)}_onPointerDown(e){let t,n;if(e.target===this.domNode.domNode&&typeof e.offsetX=="number"&&typeof e.offsetY=="number")t=e.offsetX,n=e.offsetY;else{const r=Yo(this.domNode.domNode);t=e.pageX-r.left,n=e.pageY-r.top}const o=this._pointerDownRelativePosition(t,n);this._setDesiredScrollPositionNow(this._scrollByPage?this._scrollbarState.getDesiredScrollPositionFromOffsetPaged(o):this._scrollbarState.getDesiredScrollPositionFromOffset(o)),e.button===0&&(e.preventDefault(),this._sliderPointerDown(e))}_sliderPointerDown(e){if(!e.target||!(e.target instanceof Element))return;const t=this._sliderPointerPosition(e),n=this._sliderOrthogonalPointerPosition(e),o=this._scrollbarState.clone();this.slider.toggleClassName("active",!0),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,r=>{const s=this._sliderOrthogonalPointerPosition(r),a=Math.abs(s-n);if(as&&a>jit){this._setDesiredScrollPositionNow(o.getScrollPosition());return}const c=this._sliderPointerPosition(r)-t;this._setDesiredScrollPositionNow(o.getDesiredScrollPositionFromDelta(c))},()=>{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 Kit=20;class Ey{constructor(e,t,n,o,r,s){this._scrollbarSize=Math.round(t),this._oppositeScrollbarSize=Math.round(n),this._arrowSize=Math.round(e),this._visibleSize=o,this._scrollSize=r,this._scrollPosition=s,this._computedAvailableSize=0,this._computedIsNeeded=!1,this._computedSliderSize=0,this._computedSliderRatio=0,this._computedSliderPosition=0,this._refreshComputedValues()}clone(){return new Ey(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,n,o,r){const s=Math.max(0,n-e),a=Math.max(0,s-2*t),l=o>0&&o>n;if(!l)return{computedAvailableSize:Math.round(s),computedIsNeeded:l,computedSliderSize:Math.round(a),computedSliderRatio:0,computedSliderPosition:0};const c=Math.round(Math.max(Kit,Math.floor(n*a/o))),u=(a-c)/(o-n),d=r*u;return{computedAvailableSize:Math.round(s),computedIsNeeded:l,computedSliderSize:Math.round(c),computedSliderRatio:u,computedSliderPosition:Math.round(d)}}_refreshComputedValues(){const e=Ey._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 n=this._scrollPosition;return tthis._host.onMouseWheel(new Q0(null,1,0))}),this._createArrow({className:"scra",icon:Xe.scrollbarButtonRight,top:a,left:void 0,bottom:void 0,right:s,bgWidth:t.arrowSize,bgHeight:t.horizontalScrollbarSize,onActivate:()=>this._host.onMouseWheel(new Q0(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===2?0:e.horizontalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(e.vertical===2?0:e.verticalScrollbarSize),this._visibilityController.setVisibility(e.horizontal),this._scrollByPage=e.scrollByPage}}class Git extends lbe{constructor(e,t,n){const o=e.getScrollDimensions(),r=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:n,scrollbarState:new Ey(t.verticalHasArrows?t.arrowSize:0,t.vertical===2?0:t.verticalScrollbarSize,0,o.height,o.scrollHeight,r.scrollTop),visibility:t.vertical,extraScrollbarClassName:"vertical",scrollable:e,scrollByPage:t.scrollByPage}),t.verticalHasArrows){const s=(t.arrowSize-Ly)/2,a=(t.verticalScrollbarSize-Ly)/2;this._createArrow({className:"scra",icon:Xe.scrollbarButtonUp,top:s,left:a,bottom:void 0,right:void 0,bgWidth:t.verticalScrollbarSize,bgHeight:t.arrowSize,onActivate:()=>this._host.onMouseWheel(new Q0(null,0,1))}),this._createArrow({className:"scra",icon:Xe.scrollbarButtonDown,top:void 0,left:a,bottom:s,right:void 0,bgWidth:t.verticalScrollbarSize,bgHeight:t.arrowSize,onActivate:()=>this._host.onMouseWheel(new Q0(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===2?0:e.verticalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(0),this._visibilityController.setVisibility(e.vertical),this._scrollByPage=e.scrollByPage}}class oP{constructor(e,t,n,o,r,s,a){this._forceIntegerValues=e,this._scrollStateBrand=void 0,this._forceIntegerValues&&(t=t|0,n=n|0,o=o|0,r=r|0,s=s|0,a=a|0),this.rawScrollLeft=o,this.rawScrollTop=a,t<0&&(t=0),o+t>n&&(o=n-t),o<0&&(o=0),r<0&&(r=0),a+r>s&&(a=s-r),a<0&&(a=0),this.width=t,this.scrollWidth=n,this.scrollLeft=o,this.height=r,this.scrollHeight=s,this.scrollTop=a}equals(e){return this.rawScrollLeft===e.rawScrollLeft&&this.rawScrollTop===e.rawScrollTop&&this.width===e.width&&this.scrollWidth===e.scrollWidth&&this.scrollLeft===e.scrollLeft&&this.height===e.height&&this.scrollHeight===e.scrollHeight&&this.scrollTop===e.scrollTop}withScrollDimensions(e,t){return new oP(this._forceIntegerValues,typeof e.width!="undefined"?e.width:this.width,typeof e.scrollWidth!="undefined"?e.scrollWidth:this.scrollWidth,t?this.rawScrollLeft:this.scrollLeft,typeof e.height!="undefined"?e.height:this.height,typeof e.scrollHeight!="undefined"?e.scrollHeight:this.scrollHeight,t?this.rawScrollTop:this.scrollTop)}withScrollPosition(e){return new oP(this._forceIntegerValues,this.width,this.scrollWidth,typeof e.scrollLeft!="undefined"?e.scrollLeft:this.rawScrollLeft,this.height,this.scrollHeight,typeof e.scrollTop!="undefined"?e.scrollTop:this.rawScrollTop)}createScrollEvent(e,t){const n=this.width!==e.width,o=this.scrollWidth!==e.scrollWidth,r=this.scrollLeft!==e.scrollLeft,s=this.height!==e.height,a=this.scrollHeight!==e.scrollHeight,l=this.scrollTop!==e.scrollTop;return{inSmoothScrolling:t,oldWidth:e.width,oldScrollWidth:e.scrollWidth,oldScrollLeft:e.scrollLeft,width:this.width,scrollWidth:this.scrollWidth,scrollLeft:this.scrollLeft,oldHeight:e.height,oldScrollHeight:e.scrollHeight,oldScrollTop:e.scrollTop,height:this.height,scrollHeight:this.scrollHeight,scrollTop:this.scrollTop,widthChanged:n,scrollWidthChanged:o,scrollLeftChanged:r,heightChanged:s,scrollHeightChanged:a,scrollTopChanged:l}}}class qI extends _e{constructor(e){super(),this._scrollableBrand=void 0,this._onScroll=this._register(new le),this.onScroll=this._onScroll.event,this._smoothScrollDuration=e.smoothScrollDuration,this._scheduleAtNextAnimationFrame=e.scheduleAtNextAnimationFrame,this._state=new oP(e.forceIntegerValues,0,0,0,0,0,0),this._smoothScrolling=null}dispose(){this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),super.dispose()}setSmoothScrollDuration(e){this._smoothScrollDuration=e}validateScrollPosition(e){return this._state.withScrollPosition(e)}getScrollDimensions(){return this._state}setScrollDimensions(e,t){var n;const o=this._state.withScrollDimensions(e,t);this._setState(o,Boolean(this._smoothScrolling)),(n=this._smoothScrolling)===null||n===void 0||n.acceptScrollDimensions(this._state)}getFutureScrollPosition(){return this._smoothScrolling?this._smoothScrolling.to:this._state}getCurrentScrollPosition(){return this._state}setScrollPositionNow(e){const t=this._state.withScrollPosition(e);this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),this._setState(t,!1)}setScrollPositionSmooth(e,t){if(this._smoothScrollDuration===0)return this.setScrollPositionNow(e);if(this._smoothScrolling){e={scrollLeft:typeof e.scrollLeft=="undefined"?this._smoothScrolling.to.scrollLeft:e.scrollLeft,scrollTop:typeof e.scrollTop=="undefined"?this._smoothScrolling.to.scrollTop:e.scrollTop};const n=this._state.withScrollPosition(e);if(this._smoothScrolling.to.scrollLeft===n.scrollLeft&&this._smoothScrolling.to.scrollTop===n.scrollTop)return;let o;t?o=new QD(this._smoothScrolling.from,n,this._smoothScrolling.startTime,this._smoothScrolling.duration):o=this._smoothScrolling.combine(this._state,n,this._smoothScrollDuration),this._smoothScrolling.dispose(),this._smoothScrolling=o}else{const n=this._state.withScrollPosition(e);this._smoothScrolling=QD.start(this._state,n,this._smoothScrollDuration)}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{!this._smoothScrolling||(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}hasPendingScrollAnimation(){return Boolean(this._smoothScrolling)}_performSmoothScrolling(){if(!this._smoothScrolling)return;const e=this._smoothScrolling.tick(),t=this._state.withScrollPosition(e);if(this._setState(t,!0),!!this._smoothScrolling){if(e.isDone){this._smoothScrolling.dispose(),this._smoothScrolling=null;return}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{!this._smoothScrolling||(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}}_setState(e,t){const n=this._state;n.equals(e)||(this._state=e,this._onScroll.fire(this._state.createScrollEvent(n,t)))}}class Ire{constructor(e,t,n){this.scrollLeft=e,this.scrollTop=t,this.isDone=n}}function i9(i,e){const t=e-i;return function(n){return i+t*Zit(n)}}function Xit(i,e,t){return function(n){return n2.5*n){let r,s;return e0&&Math.abs(e.deltaY)>0)return 1;let t=.5;return this._front===-1&&this._rear===-1||this._memory[this._rear],(!this._isAlmostInt(e.deltaX)||!this._isAlmostInt(e.deltaY))&&(t+=.25),Math.min(Math.max(t,0),1)}_isAlmostInt(e){return Math.abs(Math.round(e)-e)<.01}}rP.INSTANCE=new rP;class SG extends zu{get options(){return this._options}constructor(e,t,n){super(),this._onScroll=this._register(new le),this.onScroll=this._onScroll.event,this._onWillScroll=this._register(new le),e.style.overflow="hidden",this._options=eot(t),this._scrollable=n,this._register(this._scrollable.onScroll(r=>{this._onWillScroll.fire(r),this._onDidScroll(r),this._onScroll.fire(r)}));const o={onMouseWheel:r=>this._onMouseWheel(r),onDragStart:()=>this._onDragStart(),onDragEnd:()=>this._onDragEnd()};this._verticalScrollbar=this._register(new Git(this._scrollable,this._options,o)),this._horizontalScrollbar=this._register(new qit(this._scrollable,this._options,o)),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=ti(document.createElement("div")),this._leftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=ti(document.createElement("div")),this._topShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=ti(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 $u),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}dispose(){this._mouseWheelToDispose=si(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,Nn&&(this._options.className+=" mac"),this._domNode.className="monaco-scrollable-element "+this._options.className}updateOptions(e){typeof e.handleMouseWheel!="undefined"&&(this._options.handleMouseWheel=e.handleMouseWheel,this._setListeningToMouseWheel(this._options.handleMouseWheel)),typeof e.mouseWheelScrollSensitivity!="undefined"&&(this._options.mouseWheelScrollSensitivity=e.mouseWheelScrollSensitivity),typeof e.fastScrollSensitivity!="undefined"&&(this._options.fastScrollSensitivity=e.fastScrollSensitivity),typeof e.scrollPredominantAxis!="undefined"&&(this._options.scrollPredominantAxis=e.scrollPredominantAxis),typeof e.horizontal!="undefined"&&(this._options.horizontal=e.horizontal),typeof e.vertical!="undefined"&&(this._options.vertical=e.vertical),typeof e.horizontalScrollbarSize!="undefined"&&(this._options.horizontalScrollbarSize=e.horizontalScrollbarSize),typeof e.verticalScrollbarSize!="undefined"&&(this._options.verticalScrollbarSize=e.verticalScrollbarSize),typeof e.scrollByPage!="undefined"&&(this._options.scrollByPage=e.scrollByPage),this._horizontalScrollbar.updateOptions(this._options),this._verticalScrollbar.updateOptions(this._options),this._options.lazyRender||this._render()}delegateScrollFromMouseWheelEvent(e){this._onMouseWheel(new Q0(e))}_setListeningToMouseWheel(e){if(this._mouseWheelToDispose.length>0!==e&&(this._mouseWheelToDispose=si(this._mouseWheelToDispose),e)){const n=o=>{this._onMouseWheel(new Q0(o))};this._mouseWheelToDispose.push(ke(this._listenOnDomNode,et.MOUSE_WHEEL,n,{passive:!1}))}}_onMouseWheel(e){var t;if(!((t=e.browserEvent)===null||t===void 0)&&t.defaultPrevented)return;const n=rP.INSTANCE;n.acceptStandardWheelEvent(e);let o=!1;if(e.deltaY||e.deltaX){let s=e.deltaY*this._options.mouseWheelScrollSensitivity,a=e.deltaX*this._options.mouseWheelScrollSensitivity;this._options.scrollPredominantAxis&&(this._options.scrollYToX&&a+s===0?a=s=0:Math.abs(s)>=Math.abs(a)?a=0:s=0),this._options.flipAxes&&([s,a]=[a,s]);const l=!Nn&&e.browserEvent&&e.browserEvent.shiftKey;(this._options.scrollYToX||l)&&!a&&(a=s,s=0),e.browserEvent&&e.browserEvent.altKey&&(a=a*this._options.fastScrollSensitivity,s=s*this._options.fastScrollSensitivity);const c=this._scrollable.getFutureScrollPosition();let u={};if(s){const d=Tre*s,h=c.scrollTop-(d<0?Math.floor(d):Math.ceil(d));this._verticalScrollbar.writeScrollPosition(u,h)}if(a){const d=Tre*a,h=c.scrollLeft-(d<0?Math.floor(d):Math.ceil(d));this._horizontalScrollbar.writeScrollPosition(u,h)}u=this._scrollable.validateScrollPosition(u),(c.scrollLeft!==u.scrollLeft||c.scrollTop!==u.scrollTop)&&(this._options.mouseWheelSmoothScroll&&n.isPhysicalMouseWheel()?this._scrollable.setScrollPositionSmooth(u):this._scrollable.setScrollPositionNow(u),o=!0)}let r=o;!r&&this._options.alwaysConsumeMouseWheel&&(r=!0),!r&&this._options.consumeMouseWheelIfScrollbarIsNeeded&&(this._verticalScrollbar.isNeeded()||this._horizontalScrollbar.isNeeded())&&(r=!0),r&&(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,n=e.scrollLeft>0,o=n?" left":"",r=t?" top":"",s=n||t?" top-left-corner":"";this._leftShadowDomNode.setClassName(`shadow${o}`),this._topShadowDomNode.setClassName(`shadow${r}`),this._topLeftShadowDomNode.setClassName(`shadow${s}${r}${o}`)}}_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(),Qit)}}class cbe extends SG{constructor(e,t){t=t||{},t.mouseWheelSmoothScroll=!1;const n=new qI({forceIntegerValues:!0,smoothScrollDuration:0,scheduleAtNextAnimationFrame:o=>Fc(o)});super(e,t,n),this._register(n)}setScrollPosition(e){this._scrollable.setScrollPositionNow(e)}}class xG extends SG{constructor(e,t,n){super(e,t,n)}setScrollPosition(e){e.reuseAnimation?this._scrollable.setScrollPositionSmooth(e,e.reuseAnimation):this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}}class GI extends SG{constructor(e,t){t=t||{},t.mouseWheelSmoothScroll=!1;const n=new qI({forceIntegerValues:!1,smoothScrollDuration:0,scheduleAtNextAnimationFrame:o=>Fc(o)});super(e,t,n),this._register(n),this._element=e,this._register(this.onScroll(o=>{o.scrollTopChanged&&(this._element.scrollTop=o.scrollTop),o.scrollLeftChanged&&(this._element.scrollLeft=o.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 eot(i){const e={lazyRender:typeof i.lazyRender!="undefined"?i.lazyRender:!1,className:typeof i.className!="undefined"?i.className:"",useShadows:typeof i.useShadows!="undefined"?i.useShadows:!0,handleMouseWheel:typeof i.handleMouseWheel!="undefined"?i.handleMouseWheel:!0,flipAxes:typeof i.flipAxes!="undefined"?i.flipAxes:!1,consumeMouseWheelIfScrollbarIsNeeded:typeof i.consumeMouseWheelIfScrollbarIsNeeded!="undefined"?i.consumeMouseWheelIfScrollbarIsNeeded:!1,alwaysConsumeMouseWheel:typeof i.alwaysConsumeMouseWheel!="undefined"?i.alwaysConsumeMouseWheel:!1,scrollYToX:typeof i.scrollYToX!="undefined"?i.scrollYToX:!1,mouseWheelScrollSensitivity:typeof i.mouseWheelScrollSensitivity!="undefined"?i.mouseWheelScrollSensitivity:1,fastScrollSensitivity:typeof i.fastScrollSensitivity!="undefined"?i.fastScrollSensitivity:5,scrollPredominantAxis:typeof i.scrollPredominantAxis!="undefined"?i.scrollPredominantAxis:!0,mouseWheelSmoothScroll:typeof i.mouseWheelSmoothScroll!="undefined"?i.mouseWheelSmoothScroll:!0,arrowSize:typeof i.arrowSize!="undefined"?i.arrowSize:11,listenOnDomNode:typeof i.listenOnDomNode!="undefined"?i.listenOnDomNode:null,horizontal:typeof i.horizontal!="undefined"?i.horizontal:1,horizontalScrollbarSize:typeof i.horizontalScrollbarSize!="undefined"?i.horizontalScrollbarSize:10,horizontalSliderSize:typeof i.horizontalSliderSize!="undefined"?i.horizontalSliderSize:0,horizontalHasArrows:typeof i.horizontalHasArrows!="undefined"?i.horizontalHasArrows:!1,vertical:typeof i.vertical!="undefined"?i.vertical:1,verticalScrollbarSize:typeof i.verticalScrollbarSize!="undefined"?i.verticalScrollbarSize:10,verticalHasArrows:typeof i.verticalHasArrows!="undefined"?i.verticalHasArrows:!1,verticalSliderSize:typeof i.verticalSliderSize!="undefined"?i.verticalSliderSize:0,scrollByPage:typeof i.scrollByPage!="undefined"?i.scrollByPage:!1};return e.horizontalSliderSize=typeof i.horizontalSliderSize!="undefined"?i.horizontalSliderSize:e.horizontalScrollbarSize,e.verticalSliderSize=typeof i.verticalSliderSize!="undefined"?i.verticalSliderSize:e.verticalScrollbarSize,Nn&&(e.className+=" mac"),e}class LG extends KI{constructor(e,t,n){super(),this._mouseLeaveMonitor=null,this._context=e,this.viewController=t,this.viewHelper=n,this.mouseTargetFactory=new Yr(this._context,n),this._mouseDownOperation=this._register(new tot(this._context,this.viewController,this.viewHelper,this.mouseTargetFactory,(s,a)=>this._createMouseTarget(s,a),s=>this._getMouseColumn(s))),this.lastMouseLeaveTime=-1,this._height=this._context.configuration.options.get(143).height;const o=new Dit(this.viewHelper.viewDomNode);this._register(o.onContextMenu(this.viewHelper.viewDomNode,s=>this._onContextMenu(s,!0))),this._register(o.onMouseMove(this.viewHelper.viewDomNode,s=>{this._onMouseMove(s),this._mouseLeaveMonitor||(this._mouseLeaveMonitor=ke(this.viewHelper.viewDomNode.ownerDocument,"mousemove",a=>{this.viewHelper.viewDomNode.contains(a.target)||this._onMouseLeave(new Ev(a,!1,this.viewHelper.viewDomNode))}))})),this._register(o.onMouseUp(this.viewHelper.viewDomNode,s=>this._onMouseUp(s))),this._register(o.onMouseLeave(this.viewHelper.viewDomNode,s=>this._onMouseLeave(s)));let r=0;this._register(o.onPointerDown(this.viewHelper.viewDomNode,(s,a)=>{r=a})),this._register(ke(this.viewHelper.viewDomNode,et.POINTER_UP,s=>{this._mouseDownOperation.onPointerUp()})),this._register(o.onMouseDown(this.viewHelper.viewDomNode,s=>this._onMouseDown(s,r))),this._setupMouseWheelZoomListener(),this._context.addEventHandler(this)}_setupMouseWheelZoomListener(){const e=rP.INSTANCE;let t=0,n=Sc.getZoomLevel(),o=!1,r=0;const s=l=>{if(this.viewController.emitMouseWheel(l),!this._context.configuration.options.get(75))return;const c=new Q0(l);if(e.acceptStandardWheelEvent(c),e.isPhysicalMouseWheel()){if(a(l)){const u=Sc.getZoomLevel(),d=c.deltaY>0?1:-1;Sc.setZoomLevel(u+d),c.preventDefault(),c.stopPropagation()}}else Date.now()-t>50&&(n=Sc.getZoomLevel(),o=a(l),r=0),t=Date.now(),r+=c.deltaY,o&&(Sc.setZoomLevel(n+r/5),c.preventDefault(),c.stopPropagation())};this._register(ke(this.viewHelper.viewDomNode,et.MOUSE_WHEEL,s,{capture:!0,passive:!1}));function a(l){return Nn?(l.metaKey||l.ctrlKey)&&!l.shiftKey&&!l.altKey:l.ctrlKey&&!l.metaKey&&!l.shiftKey&&!l.altKey}}dispose(){this._context.removeEventHandler(this),this._mouseLeaveMonitor&&(this._mouseLeaveMonitor.dispose(),this._mouseLeaveMonitor=null),super.dispose()}onConfigurationChanged(e){if(e.hasChanged(143)){const t=this._context.configuration.options.get(143).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 o=new obe(e,t).toPageCoordinates(),r=bG(this.viewHelper.viewDomNode);if(o.yr.y+r.height||o.xr.x+r.width)return null;const s=CG(this.viewHelper.viewDomNode,r,o);return this.mouseTargetFactory.createMouseTarget(this.viewHelper.getLastRenderData(),r,o,s,null)}_createMouseTarget(e,t){let n=e.target;if(!this.viewHelper.viewDomNode.contains(n)){const o=J0(this.viewHelper.viewDomNode);o&&(n=o.elementsFromPoint(e.posx,e.posy).find(r=>this.viewHelper.viewDomNode.contains(r)))}return this.mouseTargetFactory.createMouseTarget(this.viewHelper.getLastRenderData(),e.editorPos,e.pos,e.relativePos,t?n:null)}_getMouseColumn(e){return this.mouseTargetFactory.getMouseColumn(e.relativePos)}_onContextMenu(e,t){this.viewController.emitContextMenu({event:e,target:this._createMouseTarget(e,t)})}_onMouseMove(e){this.mouseTargetFactory.mouseTargetIsWidget(e)||e.preventDefault(),!(this._mouseDownOperation.isActive()||e.timestamp{e.preventDefault(),this.viewHelper.focusTextArea()};if(u&&(o||s&&a))d(),this._mouseDownOperation.start(n.type,e,t);else if(r)e.preventDefault();else if(l){const h=n.detail;u&&this.viewHelper.shouldSuppressMouseDownOnViewZone(h.viewZoneId)&&(d(),this._mouseDownOperation.start(n.type,e,t),e.preventDefault())}else c&&this.viewHelper.shouldSuppressMouseDownOnWidget(n.detail)&&(d(),e.preventDefault());this.viewController.emitMouseDown({event:e,target:n})}}class tot extends _e{constructor(e,t,n,o,r,s){super(),this._context=e,this._viewController=t,this._viewHelper=n,this._mouseTargetFactory=o,this._createMouseTarget=r,this._getMouseColumn=s,this._mouseMoveMonitor=this._register(new Iit(this._viewHelper.viewDomNode)),this._topBottomDragScrolling=this._register(new not(this._context,this._viewHelper,this._mouseTargetFactory,(a,l,c)=>this._dispatchMouse(a,l,c))),this._mouseState=new m5,this._currentSelection=new gt(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===13&&(t.outsidePosition==="above"||t.outsidePosition==="below")?this._topBottomDragScrolling.start(t,e):(this._topBottomDragScrolling.stop(),this._dispatchMouse(t,!0,1)))}start(e,t,n){this._lastMouseEvent=t,this._mouseState.setStartedOnLineNumbers(e===3),this._mouseState.setStartButtons(t),this._mouseState.setModifiers(t);const o=this._findMousePosition(t,!0);if(!o||!o.position)return;this._mouseState.trySetCount(t.detail,o.position),t.detail=this._mouseState.count;const r=this._context.configuration.options;if(!r.get(90)&&r.get(35)&&!r.get(22)&&!this._mouseState.altKey&&t.detail<2&&!this._isActive&&!this._currentSelection.isEmpty()&&o.type===6&&o.position&&this._currentSelection.containsPosition(o.position)){this._mouseState.isDragAndDrop=!0,this._isActive=!0,this._mouseMoveMonitor.startMonitoring(this._viewHelper.viewLinesDomNode,n,t.buttons,s=>this._onMouseDownThenMove(s),s=>{const a=this._findMousePosition(this._lastMouseEvent,!1);s&&s instanceof KeyboardEvent?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(o,t.shiftKey,1),this._isActive||(this._isActive=!0,this._mouseMoveMonitor.startMonitoring(this._viewHelper.viewLinesDomNode,n,t.buttons,s=>this._onMouseDownThenMove(s),()=>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,n=this._context.viewModel,o=this._context.viewLayout,r=this._getMouseColumn(e);if(e.posyt.y+t.height){const a=e.posy-t.y-t.height,l=o.getCurrentScrollTop()+e.relativePos.y,c=xy.getZoneAtCoord(this._context,l);if(c){const d=this._helpPositionJumpOverViewZone(c);if(d)return Os.createOutsideEditor(r,d,"below",a)}const u=o.getLineNumberAtVerticalOffset(l);return Os.createOutsideEditor(r,new ae(u,n.getLineMaxColumn(u)),"below",a)}const s=o.getLineNumberAtVerticalOffset(o.getCurrentScrollTop()+e.relativePos.y);if(e.posxt.x+t.width){const a=e.posx-t.x-t.width;return Os.createOutsideEditor(r,new ae(s,n.getLineMaxColumn(s)),"right",a)}return null}_findMousePosition(e,t){const n=this._getPositionOutsideEditor(e);if(n)return n;const o=this._createMouseTarget(e,t);if(!o.position)return null;if(o.type===8||o.type===5){const s=this._helpPositionJumpOverViewZone(o.detail);if(s)return Os.createViewZone(o.type,o.element,o.mouseColumn,s,o.detail)}return o}_helpPositionJumpOverViewZone(e){const t=new ae(this._currentSelection.selectionStartLineNumber,this._currentSelection.selectionStartColumn),n=e.positionBefore,o=e.positionAfter;return n&&o?n.isBefore(t)?n:o:null}_dispatchMouse(e,t,n){!e.position||this._viewController.dispatchMouse({position:e.position,mouseColumn:e.mouseColumn,startedOnLineNumbers:this._mouseState.startedOnLineNumbers,revealType:n,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===6&&e.detail.injectedText!==null})}}class not extends _e{constructor(e,t,n,o){super(),this._context=e,this._viewHelper=t,this._mouseTargetFactory=n,this._dispatchMouse=o,this._operation=null}dispose(){super.dispose(),this.stop()}start(e,t){this._operation?this._operation.setPosition(e,t):this._operation=new iot(this._context,this._viewHelper,this._mouseTargetFactory,this._dispatchMouse,e,t)}stop(){this._operation&&(this._operation.dispose(),this._operation=null)}}class iot extends _e{constructor(e,t,n,o,r,s){super(),this._context=e,this._viewHelper=t,this._mouseTargetFactory=n,this._dispatchMouse=o,this._position=r,this._mouseEvent=s,this._lastTime=Date.now(),this._animationFrameDisposable=Fc(()=>this._execute())}dispose(){this._animationFrameDisposable.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(66),t=this._context.configuration.options.get(143).height/e,n=this._position.outsideDistance/e;return n<=1.5?Math.max(30,t*(1+n)):n<=3?Math.max(60,t*(2+n)):Math.max(200,t*(7+n))}_execute(){const e=this._context.configuration.options.get(66),t=this._getScrollSpeed(),n=this._tick(),o=t*(n/1e3)*e,r=this._position.outsidePosition==="above"?-o:o;this._context.viewModel.viewLayout.deltaScrollNow(0,r),this._viewHelper.renderNow();const s=this._context.viewLayout.getLinesViewportData(),a=this._position.outsidePosition==="above"?s.startLineNumber:s.endLineNumber;let l;{const c=bG(this._viewHelper.viewDomNode),u=this._context.configuration.options.get(143).horizontalScrollbarHeight,d=new g5(this._mouseEvent.pos.x,c.y+c.height-u-.1),h=CG(this._viewHelper.viewDomNode,c,d);l=this._mouseTargetFactory.createMouseTarget(this._viewHelper.getLastRenderData(),c,d,h,null)}(!l.position||l.position.lineNumber!==a)&&(this._position.outsidePosition==="above"?l=Os.createOutsideEditor(this._position.mouseColumn,new ae(a,1),"above",this._position.outsideDistance):l=Os.createOutsideEditor(this._position.mouseColumn,new ae(a,this._context.viewModel.getLineMaxColumn(a)),"below",this._position.outsideDistance)),this._dispatchMouse(l,!0,2),this._animationFrameDisposable=Fc(()=>this._execute())}}class m5{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 n=new Date().getTime();n-this._lastSetMouseDownCountTime>m5.CLEAR_MOUSE_DOWN_COUNT_TIME&&(e=1),this._lastSetMouseDownCountTime=n,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)}}m5.CLEAR_MOUSE_DOWN_COUNT_TIME=400;class xn{get event(){return this.emitter.event}constructor(e,t,n){const o=r=>this.emitter.fire(r);this.emitter=new le({onWillAddFirstListener:()=>e.addEventListener(t,o,n),onDidRemoveLastListener:()=>e.removeEventListener(t,o,n)})}dispose(){this.emitter.dispose()}}var xm;(function(i){const e={total:0,min:Number.MAX_VALUE,max:0},t=Object.assign({},e),n=Object.assign({},e),o=Object.assign({},e);let r=0;const s={keydown:0,input:0,render:0};function a(){m(),performance.mark("inputlatency/start"),performance.mark("keydown/start"),s.keydown=1,queueMicrotask(l)}i.onKeyDown=a;function l(){s.keydown===1&&(performance.mark("keydown/end"),s.keydown=2)}function c(){performance.mark("input/start"),s.input=1,v()}i.onBeforeInput=c;function u(){s.input===0&&c(),queueMicrotask(d)}i.onInput=u;function d(){s.input===1&&(performance.mark("input/end"),s.input=2)}function h(){m()}i.onKeyUp=h;function f(){m()}i.onSelectionChange=f;function g(){s.keydown===2&&s.input===2&&s.render===0&&(performance.mark("render/start"),s.render=1,queueMicrotask(p),v())}i.onRenderStart=g;function p(){s.render===1&&(performance.mark("render/end"),s.render=2)}function v(){setTimeout(m)}function m(){s.keydown===2&&s.input===2&&s.render===2&&(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"),_("keydown",e),_("input",t),_("render",n),_("inputlatency",o),r++,w())}function _(E,I){const k=performance.getEntriesByName(E)[0].duration;I.total+=k,I.min=Math.min(I.min,k),I.max=Math.max(I.max,k)}function w(){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"),s.keydown=0,s.input=0,s.render=0}function y(){if(r===0)return;const E={keydown:L(e),input:L(t),render:L(n),total:L(o),sampleCount:r};return D(e),D(t),D(n),D(o),r=0,E}i.getAndClearMeasurements=y;function L(E){return{average:E.total/r,max:E.max,min:E.min}}function D(E){E.total=0,E.min=Number.MAX_VALUE,E.max=0}})(xm||(xm={}));class Pr{constructor(e,t,n,o,r){this.value=e,this.selectionStart=t,this.selectionEnd=n,this.selection=o,this.newlineCountBeforeSelection=r}toString(){return`[ <${this.value}>, selectionStart: ${this.selectionStart}, selectionEnd: ${this.selectionEnd}]`}static readFromTextArea(e,t){const n=e.getValue(),o=e.getSelectionStart(),r=e.getSelectionEnd();let s;if(t){const a=n.substring(0,o),l=t.value.substring(0,t.selectionStart);a===l&&(s=t.newlineCountBeforeSelection)}return new Pr(n,o,r,null,s)}collapseSelection(){return this.selectionStart===this.value.length?this:new Pr(this.value,this.value.length,this.value.length,null,void 0)}writeToTextArea(e,t,n){t.setValue(e,this.value),n&&t.setSelectionRange(e,this.selectionStart,this.selectionEnd)}deduceEditorPosition(e){var t,n,o,r,s,a,l,c;if(e<=this.selectionStart){const h=this.value.substring(e,this.selectionStart);return this._finishDeduceEditorPosition((n=(t=this.selection)===null||t===void 0?void 0:t.getStartPosition())!==null&&n!==void 0?n:null,h,-1)}if(e>=this.selectionEnd){const h=this.value.substring(this.selectionEnd,e);return this._finishDeduceEditorPosition((r=(o=this.selection)===null||o===void 0?void 0:o.getEndPosition())!==null&&r!==void 0?r:null,h,1)}const u=this.value.substring(this.selectionStart,e);if(u.indexOf(String.fromCharCode(8230))===-1)return this._finishDeduceEditorPosition((a=(s=this.selection)===null||s===void 0?void 0:s.getStartPosition())!==null&&a!==void 0?a:null,u,1);const d=this.value.substring(e,this.selectionEnd);return this._finishDeduceEditorPosition((c=(l=this.selection)===null||l===void 0?void 0:l.getEndPosition())!==null&&c!==void 0?c:null,d,-1)}_finishDeduceEditorPosition(e,t,n){let o=0,r=-1;for(;(r=t.indexOf(` -`,r+1))!==-1;)o++;return[e,n*t.length,o]}static deduceInput(e,t,n){if(!e)return{text:"",replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:0};const o=Math.min(X0(e.value,t.value),e.selectionStart,t.selectionStart),r=Math.min(VA(e.value,t.value),e.value.length-e.selectionEnd,t.value.length-t.selectionEnd);e.value.substring(o,e.value.length-r);const s=t.value.substring(o,t.value.length-r),a=e.selectionStart-o,l=e.selectionEnd-o,c=t.selectionStart-o,u=t.selectionEnd-o;if(c===u){const h=e.selectionStart-o;return{text:s,replacePrevCharCnt:h,replaceNextCharCnt:0,positionDelta:0}}const d=l-a;return{text:s,replacePrevCharCnt:d,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 n=Math.min(X0(e.value,t.value),e.selectionEnd),o=Math.min(VA(e.value,t.value),e.value.length-e.selectionEnd),r=e.value.substring(n,e.value.length-o),s=t.value.substring(n,t.value.length-o);e.selectionStart-n;const a=e.selectionEnd-n;t.selectionStart-n;const l=t.selectionEnd-n;return{text:s,replacePrevCharCnt:a,replaceNextCharCnt:r.length-a,positionDelta:l-s.length}}}Pr.EMPTY=new Pr("",0,0,null,void 0);class WC{static _getPageOfLine(e,t){return Math.floor((e-1)/t)}static _getRangeForPage(e,t){const n=e*t,o=n+1,r=n+t;return new V(o,1,r+1,1)}static fromEditorSelection(e,t,n,o){const s=WC._getPageOfLine(t.startLineNumber,n),a=WC._getRangeForPage(s,n),l=WC._getPageOfLine(t.endLineNumber,n),c=WC._getRangeForPage(l,n);let u=a.intersectRanges(new V(1,1,t.startLineNumber,t.startColumn));if(o&&e.getValueLengthInRange(u,1)>500){const m=e.modifyPosition(u.getEndPosition(),-500);u=V.fromPositions(m,u.getEndPosition())}const d=e.getValueInRange(u,1),h=e.getLineCount(),f=e.getLineMaxColumn(h);let g=c.intersectRanges(new V(t.endLineNumber,t.endColumn,h,f));if(o&&e.getValueLengthInRange(g,1)>500){const m=e.modifyPosition(g.getStartPosition(),500);g=V.fromPositions(g.getStartPosition(),m)}const p=e.getValueInRange(g,1);let v;if(s===l||s+1===l)v=e.getValueInRange(t,1);else{const m=a.intersectRanges(t),_=c.intersectRanges(t);v=e.getValueInRange(m,1)+String.fromCharCode(8230)+e.getValueInRange(_,1)}return o&&v.length>2*500&&(v=v.substring(0,500)+String.fromCharCode(8230)+v.substring(v.length-500,v.length)),new Pr(d+v+p,d.length,d.length+v.length,t,u.endLineNumber-u.startLineNumber)}}var sP;(function(i){i.Tap="-monaco-textarea-synthetic-tap"})(sP||(sP={}));const hH={forceCopyWithSyntaxHighlighting:!1};class JD{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)}}JD.INSTANCE=new JD;class oot{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}}class rot extends _e{get textAreaState(){return this._textAreaState}constructor(e,t,n,o){super(),this._host=e,this._textArea=t,this._OS=n,this._browser=o,this._onFocus=this._register(new le),this.onFocus=this._onFocus.event,this._onBlur=this._register(new le),this.onBlur=this._onBlur.event,this._onKeyDown=this._register(new le),this.onKeyDown=this._onKeyDown.event,this._onKeyUp=this._register(new le),this.onKeyUp=this._onKeyUp.event,this._onCut=this._register(new le),this.onCut=this._onCut.event,this._onPaste=this._register(new le),this.onPaste=this._onPaste.event,this._onType=this._register(new le),this.onType=this._onType.event,this._onCompositionStart=this._register(new le),this.onCompositionStart=this._onCompositionStart.event,this._onCompositionUpdate=this._register(new le),this.onCompositionUpdate=this._onCompositionUpdate.event,this._onCompositionEnd=this._register(new le),this.onCompositionEnd=this._onCompositionEnd.event,this._onSelectionChangeRequest=this._register(new le),this.onSelectionChangeRequest=this._onSelectionChangeRequest.event,this._asyncTriggerCut=this._register(new bi(()=>this._onCut.fire(),0)),this._asyncFocusGainWriteScreenReaderContent=this._register(new bi(()=>this.writeScreenReaderContent("asyncFocusGain"),0)),this._textAreaState=Pr.EMPTY,this._selectionChangeListener=null,this.writeScreenReaderContent("ctor"),this._hasFocus=!1,this._currentComposition=null;let r=null;this._register(this._textArea.onKeyDown(s=>{const a=new Pi(s);(a.keyCode===114||this._currentComposition&&a.keyCode===1)&&a.stopPropagation(),a.equals(9)&&a.preventDefault(),r=a,this._onKeyDown.fire(a)})),this._register(this._textArea.onKeyUp(s=>{const a=new Pi(s);this._onKeyUp.fire(a)})),this._register(this._textArea.onCompositionStart(s=>{const a=new oot;if(this._currentComposition){this._currentComposition=a;return}if(this._currentComposition=a,this._OS===2&&r&&r.equals(114)&&this._textAreaState.selectionStart===this._textAreaState.selectionEnd&&this._textAreaState.selectionStart>0&&this._textAreaState.value.substr(this._textAreaState.selectionStart-1,1)===s.data&&(r.code==="ArrowRight"||r.code==="ArrowLeft")){a.handleCompositionUpdate("x"),this._onCompositionStart.fire({data:s.data});return}if(this._browser.isAndroid){this._onCompositionStart.fire({data:s.data});return}this._onCompositionStart.fire({data:s.data})})),this._register(this._textArea.onCompositionUpdate(s=>{const a=this._currentComposition;if(!a)return;if(this._browser.isAndroid){const c=Pr.readFromTextArea(this._textArea,this._textAreaState),u=Pr.deduceAndroidCompositionInput(this._textAreaState,c);this._textAreaState=c,this._onType.fire(u),this._onCompositionUpdate.fire(s);return}const l=a.handleCompositionUpdate(s.data);this._textAreaState=Pr.readFromTextArea(this._textArea,this._textAreaState),this._onType.fire(l),this._onCompositionUpdate.fire(s)})),this._register(this._textArea.onCompositionEnd(s=>{const a=this._currentComposition;if(!a)return;if(this._currentComposition=null,this._browser.isAndroid){const c=Pr.readFromTextArea(this._textArea,this._textAreaState),u=Pr.deduceAndroidCompositionInput(this._textAreaState,c);this._textAreaState=c,this._onType.fire(u),this._onCompositionEnd.fire();return}const l=a.handleCompositionUpdate(s.data);this._textAreaState=Pr.readFromTextArea(this._textArea,this._textAreaState),this._onType.fire(l),this._onCompositionEnd.fire()})),this._register(this._textArea.onInput(s=>{if(this._textArea.setIgnoreSelectionChangeTime("received input event"),this._currentComposition)return;const a=Pr.readFromTextArea(this._textArea,this._textAreaState),l=Pr.deduceInput(this._textAreaState,a,this._OS===2);l.replacePrevCharCnt===0&&l.text.length===1&&(fr(l.text.charCodeAt(0))||l.text.charCodeAt(0)===127)||(this._textAreaState=a,(l.text!==""||l.replacePrevCharCnt!==0||l.replaceNextCharCnt!==0||l.positionDelta!==0)&&this._onType.fire(l))})),this._register(this._textArea.onCut(s=>{this._textArea.setIgnoreSelectionChangeTime("received cut event"),this._ensureClipboardGetsEditorSelection(s),this._asyncTriggerCut.schedule()})),this._register(this._textArea.onCopy(s=>{this._ensureClipboardGetsEditorSelection(s)})),this._register(this._textArea.onPaste(s=>{if(this._textArea.setIgnoreSelectionChangeTime("received paste event"),s.preventDefault(),!s.clipboardData)return;let[a,l]=fH.getTextData(s.clipboardData);!a||(l=l||JD.INSTANCE.get(a),this._onPaste.fire({text:a,metadata:l}))})),this._register(this._textArea.onFocus(()=>{const s=this._hasFocus;this._setHasFocus(!0),this._browser.isSafari&&!s&&this._hasFocus&&this._asyncFocusGainWriteScreenReaderContent.schedule()})),this._register(this._textArea.onBlur(()=>{this._currentComposition&&(this._currentComposition=null,this.writeScreenReaderContent("blurWithoutCompositionEnd"),this._onCompositionEnd.fire()),this._setHasFocus(!1)})),this._register(this._textArea.onSyntheticTap(()=>{this._browser.isAndroid&&this._currentComposition&&(this._currentComposition=null,this.writeScreenReaderContent("tapWithoutCompositionEnd"),this._onCompositionEnd.fire())}))}_installSelectionChangeListener(){let e=0;return ke(this._textArea.ownerDocument,"selectionchange",t=>{if(xm.onSelectionChange(),!this._hasFocus||this._currentComposition||!this._browser.isChrome)return;const n=Date.now(),o=n-e;if(e=n,o<5)return;const r=n-this._textArea.getIgnoreSelectionChangeTime();if(this._textArea.resetSelectionChangeTime(),r<100||!this._textAreaState.selection)return;const s=this._textArea.getValue();if(this._textAreaState.value!==s)return;const a=this._textArea.getSelectionStart(),l=this._textArea.getSelectionEnd();if(this._textAreaState.selectionStart===a&&this._textAreaState.selectionEnd===l)return;const c=this._textAreaState.deduceEditorPosition(a),u=this._host.deduceModelPosition(c[0],c[1],c[2]),d=this._textAreaState.deduceEditorPosition(l),h=this._host.deduceModelPosition(d[0],d[1],d[2]),f=new gt(u.lineNumber,u.column,h.lineNumber,h.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.writeScreenReaderContent("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}writeScreenReaderContent(e){this._currentComposition||this._setAndWriteTextAreaState(e,this._host.getScreenReaderContent())}_ensureClipboardGetsEditorSelection(e){const t=this._host.getDataToCopy(),n={version:1,isFromEmptySelection:t.isFromEmptySelection,multicursorText:t.multicursorText,mode:t.mode};JD.INSTANCE.set(this._browser.isFirefox?t.text.replace(/\r\n/g,` -`):t.text,n),e.preventDefault(),e.clipboardData&&fH.setTextData(e.clipboardData,t.text,t.html,n)}}const fH={getTextData(i){const e=i.getData(xo.text);let t=null;const n=i.getData("vscode-editor-data");if(typeof n=="string")try{t=JSON.parse(n),t.version!==1&&(t=null)}catch{}return e.length===0&&t===null&&i.files.length>0?[Array.prototype.slice.call(i.files,0).map(r=>r.name).join(` -`),null]:[e,t]},setTextData(i,e,t,n){i.setData(xo.text,e),typeof t=="string"&&i.setData("text/html",t),i.setData("vscode-editor-data",JSON.stringify(n))}};class sot extends _e{get ownerDocument(){return this._actual.ownerDocument}constructor(e){super(),this._actual=e,this.onKeyDown=this._register(new xn(this._actual,"keydown")).event,this.onKeyUp=this._register(new xn(this._actual,"keyup")).event,this.onCompositionStart=this._register(new xn(this._actual,"compositionstart")).event,this.onCompositionUpdate=this._register(new xn(this._actual,"compositionupdate")).event,this.onCompositionEnd=this._register(new xn(this._actual,"compositionend")).event,this.onBeforeInput=this._register(new xn(this._actual,"beforeinput")).event,this.onInput=this._register(new xn(this._actual,"input")).event,this.onCut=this._register(new xn(this._actual,"cut")).event,this.onCopy=this._register(new xn(this._actual,"copy")).event,this.onPaste=this._register(new xn(this._actual,"paste")).event,this.onFocus=this._register(new xn(this._actual,"focus")).event,this.onBlur=this._register(new xn(this._actual,"blur")).event,this._onSyntheticTap=this._register(new le),this.onSyntheticTap=this._onSyntheticTap.event,this._ignoreSelectionChangeTime=0,this._register(this.onKeyDown(()=>xm.onKeyDown())),this._register(this.onBeforeInput(()=>xm.onBeforeInput())),this._register(this.onInput(()=>xm.onInput())),this._register(this.onKeyUp(()=>xm.onKeyUp())),this._register(ke(this._actual,sP.Tap,()=>this._onSyntheticTap.fire()))}hasFocus(){const e=J0(this._actual);return e?e.activeElement===this._actual:Zq(this._actual)?this._actual.ownerDocument.activeElement===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 n=this._actual;n.value!==t&&(this.setIgnoreSelectionChangeTime("setValue"),n.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,n){const o=this._actual;let r=null;const s=J0(o);s?r=s.activeElement:r=o.ownerDocument.activeElement;const a=r===o,l=o.selectionStart,c=o.selectionEnd;if(a&&l===t&&c===n){Oc&&window.parent!==window&&o.focus();return}if(a){this.setIgnoreSelectionChangeTime("setSelectionRange"),o.setSelectionRange(t,n),Oc&&window.parent!==window&&o.focus();return}try{const u=FQe(o);this.setIgnoreSelectionChangeTime("setSelectionRange"),o.focus(),o.setSelectionRange(t,n),BQe(o,u)}catch{}}}class aot extends LG{constructor(e,t,n){super(e,t,n),this._register(Ei.addTarget(this.viewHelper.linesContentDomNode)),this._register(ke(this.viewHelper.linesContentDomNode,Di.Tap,r=>this.onTap(r))),this._register(ke(this.viewHelper.linesContentDomNode,Di.Change,r=>this.onChange(r))),this._register(ke(this.viewHelper.linesContentDomNode,Di.Contextmenu,r=>this._onContextMenu(new Ev(r,!1,this.viewHelper.viewDomNode),!1))),this._lastPointerType="mouse",this._register(ke(this.viewHelper.linesContentDomNode,"pointerdown",r=>{const s=r.pointerType;if(s==="mouse"){this._lastPointerType="mouse";return}else s==="touch"?this._lastPointerType="touch":this._lastPointerType="pen"}));const o=new kit(this.viewHelper.viewDomNode);this._register(o.onPointerMove(this.viewHelper.viewDomNode,r=>this._onMouseMove(r))),this._register(o.onPointerUp(this.viewHelper.viewDomNode,r=>this._onMouseUp(r))),this._register(o.onPointerLeave(this.viewHelper.viewDomNode,r=>this._onMouseLeave(r))),this._register(o.onPointerDown(this.viewHelper.viewDomNode,(r,s)=>this._onMouseDown(r,s)))}onTap(e){if(!e.initialTarget||!this.viewHelper.linesContentDomNode.contains(e.initialTarget))return;e.preventDefault(),this.viewHelper.focusTextArea();const t=this._createMouseTarget(new Ev(e,!1,this.viewHelper.viewDomNode),!1);t.position&&this.viewController.dispatchMouse({position:t.position,mouseColumn:t.position.column,startedOnLineNumbers:!1,revealType:1,mouseDownCount:e.tapCount,inSelectionMode:!1,altKey:!1,ctrlKey:!1,metaKey:!1,shiftKey:!1,leftButton:!1,middleButton:!1,onInjectedText:t.type===6&&t.detail.injectedText!==null})}onChange(e){this._lastPointerType==="touch"&&this._context.viewModel.viewLayout.deltaScrollNow(-e.translationX,-e.translationY)}_onMouseDown(e,t){e.browserEvent.pointerType!=="touch"&&super._onMouseDown(e,t)}}class lot extends LG{constructor(e,t,n){super(e,t,n),this._register(Ei.addTarget(this.viewHelper.linesContentDomNode)),this._register(ke(this.viewHelper.linesContentDomNode,Di.Tap,o=>this.onTap(o))),this._register(ke(this.viewHelper.linesContentDomNode,Di.Change,o=>this.onChange(o))),this._register(ke(this.viewHelper.linesContentDomNode,Di.Contextmenu,o=>this._onContextMenu(new Ev(o,!1,this.viewHelper.viewDomNode),!1)))}onTap(e){e.preventDefault(),this.viewHelper.focusTextArea();const t=this._createMouseTarget(new Ev(e,!1,this.viewHelper.viewDomNode),!1);if(t.position){const n=document.createEvent("CustomEvent");n.initEvent(sP.Tap,!1,!0),this.viewHelper.dispatchTextAreaEvent(n),this.viewController.moveTo(t.position,1)}}onChange(e){this._context.viewModel.viewLayout.deltaScrollNow(-e.translationX,-e.translationY)}}class cot extends _e{constructor(e,t,n){super(),jd&&Yq.pointerEvents?this.handler=this._register(new aot(e,t,n)):window.TouchEvent?this.handler=this._register(new lot(e,t,n)):this.handler=this._register(new LG(e,t,n))}getTargetAtClientPoint(e,t){return this.handler.getTargetAtClientPoint(e,t)}}class Vb extends KI{}const mr=wn("themeService");function ro(i){return{id:i}}function gH(i){switch(i){case kc.DARK:return"vs-dark";case kc.HIGH_CONTRAST_DARK:return"hc-black";case kc.HIGH_CONTRAST_LIGHT:return"hc-light";default:return"vs"}}const ube={ThemingContribution:"base.contributions.theming"};class uot{constructor(){this.themingParticipants=[],this.themingParticipants=[],this.onThemingParticipantAddedEmitter=new le}onColorThemeChange(e){return this.themingParticipants.push(e),this.onThemingParticipantAddedEmitter.fire(e),zt(()=>{const t=this.themingParticipants.indexOf(e);this.themingParticipants.splice(t,1)})}getThemingParticipants(){return this.themingParticipants}}const dbe=new uot;no.add(ube.ThemingContribution,dbe);function Uu(i){return dbe.onColorThemeChange(i)}class dot extends _e{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(){}}const hbe=J("editor.lineHighlightBackground",{dark:null,light:null,hcDark:null,hcLight:null},C("lineHighlight","Background color for the highlight of line at the cursor position.")),Nre=J("editor.lineHighlightBorder",{dark:"#282828",light:"#eeeeee",hcDark:"#f38518",hcLight:Ln},C("lineHighlightBorderBox","Background color for the border around the line at the cursor position."));J("editor.rangeHighlightBackground",{dark:"#ffffff0b",light:"#fdff0033",hcDark:null,hcLight:null},C("rangeHighlight","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);J("editor.rangeHighlightBorder",{dark:null,light:null,hcDark:Wi,hcLight:Wi},C("rangeHighlightBorder","Background color of the border around highlighted ranges."),!0);J("editor.symbolHighlightBackground",{dark:Zh,light:Zh,hcDark:null,hcLight:null},C("symbolHighlight","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);J("editor.symbolHighlightBorder",{dark:null,light:null,hcDark:Wi,hcLight:Wi},C("symbolHighlightBorder","Background color of the border around highlighted symbols."),!0);const fbe=J("editorCursor.foreground",{dark:"#AEAFAD",light:ve.black,hcDark:ve.white,hcLight:"#0F4A85"},C("caret","Color of the editor cursor.")),hot=J("editorCursor.background",null,C("editorCursorBackground","The background color of the editor cursor. Allows customizing the color of a character overlapped by a block cursor.")),Bg=J("editorWhitespace.foreground",{dark:"#e3e4e229",light:"#33333333",hcDark:"#e3e4e229",hcLight:"#CCCCCC"},C("editorWhitespaces","Color of whitespace characters in the editor.")),fot=J("editorLineNumber.foreground",{dark:"#858585",light:"#237893",hcDark:ve.white,hcLight:"#292929"},C("editorLineNumbers","Color of editor line numbers.")),l2=J("editorIndentGuide.background",{dark:Bg,light:Bg,hcDark:Bg,hcLight:Bg},C("editorIndentGuides","Color of the editor indentation guides."),!1,C("deprecatedEditorIndentGuides","'editorIndentGuide.background' is deprecated. Use 'editorIndentGuide.background1' instead.")),c2=J("editorIndentGuide.activeBackground",{dark:Bg,light:Bg,hcDark:Bg,hcLight:Bg},C("editorActiveIndentGuide","Color of the active editor indentation guides."),!1,C("deprecatedEditorActiveIndentGuide","'editorIndentGuide.activeBackground' is deprecated. Use 'editorIndentGuide.activeBackground1' instead.")),XI=J("editorIndentGuide.background1",{dark:l2,light:l2,hcDark:l2,hcLight:l2},C("editorIndentGuides1","Color of the editor indentation guides (1).")),got=J("editorIndentGuide.background2",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},C("editorIndentGuides2","Color of the editor indentation guides (2).")),pot=J("editorIndentGuide.background3",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},C("editorIndentGuides3","Color of the editor indentation guides (3).")),mot=J("editorIndentGuide.background4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},C("editorIndentGuides4","Color of the editor indentation guides (4).")),vot=J("editorIndentGuide.background5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},C("editorIndentGuides5","Color of the editor indentation guides (5).")),_ot=J("editorIndentGuide.background6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},C("editorIndentGuides6","Color of the editor indentation guides (6).")),YI=J("editorIndentGuide.activeBackground1",{dark:c2,light:c2,hcDark:c2,hcLight:c2},C("editorActiveIndentGuide1","Color of the active editor indentation guides (1).")),bot=J("editorIndentGuide.activeBackground2",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},C("editorActiveIndentGuide2","Color of the active editor indentation guides (2).")),Cot=J("editorIndentGuide.activeBackground3",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},C("editorActiveIndentGuide3","Color of the active editor indentation guides (3).")),wot=J("editorIndentGuide.activeBackground4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},C("editorActiveIndentGuide4","Color of the active editor indentation guides (4).")),yot=J("editorIndentGuide.activeBackground5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},C("editorActiveIndentGuide5","Color of the active editor indentation guides (5).")),Sot=J("editorIndentGuide.activeBackground6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},C("editorActiveIndentGuide6","Color of the active editor indentation guides (6).")),u2=J("editorActiveLineNumber.foreground",{dark:"#c6c6c6",light:"#0B216F",hcDark:Wi,hcLight:Wi},C("editorActiveLineNumber","Color of editor active line number"),!1,C("deprecatedEditorActiveLineNumber","Id is deprecated. Use 'editorLineNumber.activeForeground' instead."));J("editorLineNumber.activeForeground",{dark:u2,light:u2,hcDark:u2,hcLight:u2},C("editorActiveLineNumber","Color of editor active line number"));const xot=J("editorLineNumber.dimmedForeground",{dark:null,light:null,hcDark:null,hcLight:null},C("editorDimmedLineNumber","Color of the final editor line when editor.renderFinalNewline is set to dimmed."));J("editorRuler.foreground",{dark:"#5A5A5A",light:ve.lightgrey,hcDark:ve.white,hcLight:"#292929"},C("editorRuler","Color of the editor rulers."));J("editorCodeLens.foreground",{dark:"#999999",light:"#919191",hcDark:"#999999",hcLight:"#292929"},C("editorCodeLensForeground","Foreground color of editor CodeLens"));J("editorBracketMatch.background",{dark:"#0064001a",light:"#0064001a",hcDark:"#0064001a",hcLight:"#0000"},C("editorBracketMatchBackground","Background color behind matching brackets"));J("editorBracketMatch.border",{dark:"#888",light:"#B9B9B9",hcDark:Ln,hcLight:Ln},C("editorBracketMatchBorder","Color for matching brackets boxes"));const Lot=J("editorOverviewRuler.border",{dark:"#7f7f7f4d",light:"#7f7f7f4d",hcDark:"#7f7f7f4d",hcLight:"#666666"},C("editorOverviewRulerBorder","Color of the overview ruler border.")),Eot=J("editorOverviewRuler.background",null,C("editorOverviewRulerBackground","Background color of the editor overview ruler."));J("editorGutter.background",{dark:pr,light:pr,hcDark:pr,hcLight:pr},C("editorGutter","Background color of the editor gutter. The gutter contains the glyph margins and the line numbers."));J("editorUnnecessaryCode.border",{dark:null,light:null,hcDark:ve.fromHex("#fff").transparent(.8),hcLight:Ln},C("unnecessaryCodeBorder","Border color of unnecessary (unused) source code in the editor."));const Dot=J("editorUnnecessaryCode.opacity",{dark:ve.fromHex("#000a"),light:ve.fromHex("#0007"),hcDark:null,hcLight:null},C("unnecessaryCodeOpacity",`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.`));J("editorGhostText.border",{dark:null,light:null,hcDark:ve.fromHex("#fff").transparent(.8),hcLight:ve.fromHex("#292929").transparent(.8)},C("editorGhostTextBorder","Border color of ghost text in the editor."));J("editorGhostText.foreground",{dark:ve.fromHex("#ffffff56"),light:ve.fromHex("#0007"),hcDark:null,hcLight:null},C("editorGhostTextForeground","Foreground color of the ghost text in the editor."));J("editorGhostText.background",{dark:null,light:null,hcDark:null,hcLight:null},C("editorGhostTextBackground","Background color of the ghost text in the editor."));const d2=new ve(new Tn(0,122,204,.6)),gbe=J("editorOverviewRuler.rangeHighlightForeground",{dark:d2,light:d2,hcDark:d2,hcLight:d2},C("overviewRulerRangeHighlight","Overview ruler marker color for range highlights. The color must not be opaque so as not to hide underlying decorations."),!0),kot=J("editorOverviewRuler.errorForeground",{dark:new ve(new Tn(255,18,18,.7)),light:new ve(new Tn(255,18,18,.7)),hcDark:new ve(new Tn(255,50,50,1)),hcLight:"#B5200D"},C("overviewRuleError","Overview ruler marker color for errors.")),Iot=J("editorOverviewRuler.warningForeground",{dark:Hl,light:Hl,hcDark:GD,hcLight:GD},C("overviewRuleWarning","Overview ruler marker color for warnings.")),Tot=J("editorOverviewRuler.infoForeground",{dark:Ra,light:Ra,hcDark:XD,hcLight:XD},C("overviewRuleInfo","Overview ruler marker color for infos.")),pbe=J("editorBracketHighlight.foreground1",{dark:"#FFD700",light:"#0431FAFF",hcDark:"#FFD700",hcLight:"#0431FAFF"},C("editorBracketHighlightForeground1","Foreground color of brackets (1). Requires enabling bracket pair colorization.")),mbe=J("editorBracketHighlight.foreground2",{dark:"#DA70D6",light:"#319331FF",hcDark:"#DA70D6",hcLight:"#319331FF"},C("editorBracketHighlightForeground2","Foreground color of brackets (2). Requires enabling bracket pair colorization.")),vbe=J("editorBracketHighlight.foreground3",{dark:"#179FFF",light:"#7B3814FF",hcDark:"#87CEFA",hcLight:"#7B3814FF"},C("editorBracketHighlightForeground3","Foreground color of brackets (3). Requires enabling bracket pair colorization.")),_be=J("editorBracketHighlight.foreground4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},C("editorBracketHighlightForeground4","Foreground color of brackets (4). Requires enabling bracket pair colorization.")),bbe=J("editorBracketHighlight.foreground5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},C("editorBracketHighlightForeground5","Foreground color of brackets (5). Requires enabling bracket pair colorization.")),Cbe=J("editorBracketHighlight.foreground6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},C("editorBracketHighlightForeground6","Foreground color of brackets (6). Requires enabling bracket pair colorization.")),Not=J("editorBracketHighlight.unexpectedBracket.foreground",{dark:new ve(new Tn(255,18,18,.8)),light:new ve(new Tn(255,18,18,.8)),hcDark:new ve(new Tn(255,50,50,1)),hcLight:""},C("editorBracketHighlightUnexpectedBracketForeground","Foreground color of unexpected brackets.")),Rot=J("editorBracketPairGuide.background1",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},C("editorBracketPairGuide.background1","Background color of inactive bracket pair guides (1). Requires enabling bracket pair guides.")),Mot=J("editorBracketPairGuide.background2",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},C("editorBracketPairGuide.background2","Background color of inactive bracket pair guides (2). Requires enabling bracket pair guides.")),Aot=J("editorBracketPairGuide.background3",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},C("editorBracketPairGuide.background3","Background color of inactive bracket pair guides (3). Requires enabling bracket pair guides.")),Pot=J("editorBracketPairGuide.background4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},C("editorBracketPairGuide.background4","Background color of inactive bracket pair guides (4). Requires enabling bracket pair guides.")),Oot=J("editorBracketPairGuide.background5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},C("editorBracketPairGuide.background5","Background color of inactive bracket pair guides (5). Requires enabling bracket pair guides.")),Fot=J("editorBracketPairGuide.background6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},C("editorBracketPairGuide.background6","Background color of inactive bracket pair guides (6). Requires enabling bracket pair guides.")),Bot=J("editorBracketPairGuide.activeBackground1",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},C("editorBracketPairGuide.activeBackground1","Background color of active bracket pair guides (1). Requires enabling bracket pair guides.")),Wot=J("editorBracketPairGuide.activeBackground2",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},C("editorBracketPairGuide.activeBackground2","Background color of active bracket pair guides (2). Requires enabling bracket pair guides.")),Vot=J("editorBracketPairGuide.activeBackground3",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},C("editorBracketPairGuide.activeBackground3","Background color of active bracket pair guides (3). Requires enabling bracket pair guides.")),Hot=J("editorBracketPairGuide.activeBackground4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},C("editorBracketPairGuide.activeBackground4","Background color of active bracket pair guides (4). Requires enabling bracket pair guides.")),$ot=J("editorBracketPairGuide.activeBackground5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},C("editorBracketPairGuide.activeBackground5","Background color of active bracket pair guides (5). Requires enabling bracket pair guides.")),zot=J("editorBracketPairGuide.activeBackground6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},C("editorBracketPairGuide.activeBackground6","Background color of active bracket pair guides (6). Requires enabling bracket pair guides."));J("editorUnicodeHighlight.border",{dark:"#BD9B03",light:"#CEA33D",hcDark:"#ff0000",hcLight:"#CEA33D"},C("editorUnicodeHighlight.border","Border color used to highlight unicode characters."));J("editorUnicodeHighlight.background",{dark:"#bd9b0326",light:"#cea33d14",hcDark:"#00000000",hcLight:"#cea33d14"},C("editorUnicodeHighlight.background","Background color used to highlight unicode characters."));Uu((i,e)=>{const t=i.getColor(pr),n=i.getColor(hbe),o=n&&!n.isTransparent()?n:t;o&&e.addRule(`.monaco-editor .inputarea.ime-input { background-color: ${o}; }`)});class ZI extends Vb{constructor(e){super(),this._context=e,this._readConfig(),this._lastCursorModelPosition=new ae(1,1),this._renderResult=null,this._activeLineNumber=1,this._context.addEventHandler(this)}_readConfig(){const e=this._context.configuration.options;this._lineHeight=e.get(66);const t=e.get(67);this._renderLineNumbers=t.renderType,this._renderCustomLineNumbers=t.renderFn,this._renderFinalNewline=e.get(94);const n=e.get(143);this._lineNumbersLeft=n.lineNumbersLeft,this._lineNumbersWidth=n.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 n=!1;return this._activeLineNumber!==t.lineNumber&&(this._activeLineNumber=t.lineNumber,n=!0),(this._renderLineNumbers===2||this._renderLineNumbers===3)&&(n=!0),n}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}_getLineRenderLineNumber(e){const t=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new ae(e,1));if(t.column!==1)return"";const n=t.lineNumber;if(this._renderCustomLineNumbers)return this._renderCustomLineNumbers(n);if(this._renderLineNumbers===2){const o=Math.abs(this._lastCursorModelPosition.lineNumber-n);return o===0?''+n+"":String(o)}return this._renderLineNumbers===3?this._lastCursorModelPosition.lineNumber===n||n%10===0?String(n):"":String(n)}prepareRender(e){if(this._renderLineNumbers===0){this._renderResult=null;return}const t=Ss?this._lineHeight%2===0?" lh-even":" lh-odd":"",n=e.visibleRange.startLineNumber,o=e.visibleRange.endLineNumber,r=this._context.viewModel.getLineCount(),s=[];for(let a=n;a<=o;a++){const l=a-n,c=this._getLineRenderLineNumber(a);if(!c){s[l]="";continue}let u="";if(a===r&&this._context.viewModel.getLineLength(a)===0){if(this._renderFinalNewline==="off"){s[l]="";continue}this._renderFinalNewline==="dimmed"&&(u=" dimmed-line-number")}a===this._activeLineNumber&&(u=" active-line-number"),s[l]=`
${c}
`}this._renderResult=s}render(e,t){if(!this._renderResult)return"";const n=t-e;return n<0||n>=this._renderResult.length?"":this._renderResult[n]}}ZI.CLASS_NAME="line-numbers";Uu((i,e)=>{const t=i.getColor(fot),n=i.getColor(xot);n?e.addRule(`.monaco-editor .line-numbers.dimmed-line-number { color: ${n}; }`):t&&e.addRule(`.monaco-editor .line-numbers.dimmed-line-number { color: ${t.transparent(.4)}; }`)});class eb extends gl{constructor(e){super(e);const t=this._context.configuration.options,n=t.get(143);this._canUseLayerHinting=!t.get(32),this._contentLeft=n.contentLeft,this._glyphMarginLeft=n.glyphMarginLeft,this._glyphMarginWidth=n.glyphMarginWidth,this._domNode=ti(document.createElement("div")),this._domNode.setClassName(eb.OUTER_CLASS_NAME),this._domNode.setPosition("absolute"),this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true"),this._glyphMarginBackgroundDomNode=ti(document.createElement("div")),this._glyphMarginBackgroundDomNode.setClassName(eb.CLASS_NAME),this._domNode.appendChild(this._glyphMarginBackgroundDomNode)}dispose(){super.dispose()}getDomNode(){return this._domNode}onConfigurationChanged(e){const t=this._context.configuration.options,n=t.get(143);return this._canUseLayerHinting=!t.get(32),this._contentLeft=n.contentLeft,this._glyphMarginLeft=n.glyphMarginLeft,this._glyphMarginWidth=n.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 n=Math.min(e.scrollHeight,1e6);this._domNode.setHeight(n),this._domNode.setWidth(this._contentLeft),this._glyphMarginBackgroundDomNode.setLeft(this._glyphMarginLeft),this._glyphMarginBackgroundDomNode.setWidth(this._glyphMarginWidth),this._glyphMarginBackgroundDomNode.setHeight(n)}}eb.CLASS_NAME="glyph-margin";eb.OUTER_CLASS_NAME="margin";const xw="monaco-mouse-cursor-text";class Uot{constructor(){this._onDidChange=new le,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 dE=new Uot,xi=wn("keybindingService");var jot=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Kot=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};class qot{constructor(e,t,n,o,r){this._context=e,this.modelLineNumber=t,this.distanceToModelLineStart=n,this.widthOfHiddenLineTextBefore=o,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 ae(this.modelLineNumber,this.distanceToModelLineStart+1),n=new ae(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(n),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:1,italic:!1,bold:!1,underline:!1,strikethrough:!1}),this._previousPresentation}}const o9=Oc;let pH=class extends gl{constructor(e,t,n,o){super(e),this._keybindingService=o,this._primaryCursorPosition=new ae(1,1),this._primaryCursorVisibleRange=null,this._viewController=t,this._visibleRangeProvider=n,this._scrollLeft=0,this._scrollTop=0;const r=this._context.configuration.options,s=r.get(143);this._setAccessibilityOptions(r),this._contentLeft=s.contentLeft,this._contentWidth=s.contentWidth,this._contentHeight=s.height,this._fontInfo=r.get(50),this._lineHeight=r.get(66),this._emptySelectionClipboard=r.get(37),this._copyWithSyntaxHighlighting=r.get(25),this._visibleTextArea=null,this._selections=[new gt(1,1,1,1)],this._modelSelections=[new gt(1,1,1,1)],this._lastRenderPosition=null,this.textArea=ti(document.createElement("textarea")),mf.write(this.textArea,6),this.textArea.setClassName(`inputarea ${xw}`),this.textArea.setAttribute("wrap",this._textAreaWrapping&&!this._visibleTextArea?"on":"off");const{tabSize:a}=this._context.viewModel.model.getOptions();this.textArea.domNode.style.tabSize=`${a*this._fontInfo.spaceWidth}px`,this.textArea.setAttribute("autocorrect","off"),this.textArea.setAttribute("autocapitalize","off"),this.textArea.setAttribute("autocomplete","off"),this.textArea.setAttribute("spellcheck","false"),this.textArea.setAttribute("aria-label",this._getAriaLabel(r)),this.textArea.setAttribute("aria-required",r.get(5)?"true":"false"),this.textArea.setAttribute("tabindex",String(r.get(123))),this.textArea.setAttribute("role","textbox"),this.textArea.setAttribute("aria-roledescription",C("editor","editor")),this.textArea.setAttribute("aria-multiline","true"),this.textArea.setAttribute("aria-autocomplete",r.get(90)?"none":"both"),this._ensureReadOnlyAttribute(),this.textAreaCover=ti(document.createElement("div")),this.textAreaCover.setPosition("absolute");const l={getLineCount:()=>this._context.viewModel.getLineCount(),getLineMaxColumn:d=>this._context.viewModel.getLineMaxColumn(d),getValueInRange:(d,h)=>this._context.viewModel.getValueInRange(d,h),getValueLengthInRange:(d,h)=>this._context.viewModel.getValueLengthInRange(d,h),modifyPosition:(d,h)=>this._context.viewModel.modifyPosition(d,h)},c={getDataToCopy:()=>{const d=this._context.viewModel.getPlainTextToCopy(this._modelSelections,this._emptySelectionClipboard,as),h=this._context.viewModel.model.getEOL(),f=this._emptySelectionClipboard&&this._modelSelections.length===1&&this._modelSelections[0].isEmpty(),g=Array.isArray(d)?d:null,p=Array.isArray(d)?d.join(h):d;let v,m=null;if(hH.forceCopyWithSyntaxHighlighting||this._copyWithSyntaxHighlighting&&p.length<65536){const _=this._context.viewModel.getRichTextToCopy(this._modelSelections,this._emptySelectionClipboard);_&&(v=_.html,m=_.mode)}return{isFromEmptySelection:f,multicursorText:g,text:p,html:v,mode:m}},getScreenReaderContent:()=>{if(this._accessibilitySupport===1){const d=this._selections[0];if(Nn&&d.isEmpty()){const f=d.getStartPosition();let g=this._getWordBeforePosition(f);if(g.length===0&&(g=this._getCharacterBeforePosition(f)),g.length>0)return new Pr(g,g.length,g.length,V.fromPositions(f),0)}const h=500;if(Nn&&!d.isEmpty()&&l.getValueLengthInRange(d,0)0)return new Pr(f,g,g,V.fromPositions(h),0)}return Pr.EMPTY}return WC.fromEditorSelection(l,this._selections[0],this._accessibilityPageSize,this._accessibilitySupport===0)},deduceModelPosition:(d,h,f)=>this._context.viewModel.deduceModelPositionRelativeToViewPosition(d,h,f)},u=this._register(new sot(this.textArea.domNode));this._textAreaInput=this._register(new rot(c,u,Wl,{isAndroid:soe,isChrome:Kq,isFirefox:Oc,isSafari:sp})),this._register(this._textAreaInput.onKeyDown(d=>{this._viewController.emitKeyDown(d)})),this._register(this._textAreaInput.onKeyUp(d=>{this._viewController.emitKeyUp(d)})),this._register(this._textAreaInput.onPaste(d=>{let h=!1,f=null,g=null;d.metadata&&(h=this._emptySelectionClipboard&&!!d.metadata.isFromEmptySelection,f=typeof d.metadata.multicursorText!="undefined"?d.metadata.multicursorText:null,g=d.metadata.mode),this._viewController.paste(d.text,h,f,g)})),this._register(this._textAreaInput.onCut(()=>{this._viewController.cut()})),this._register(this._textAreaInput.onType(d=>{d.replacePrevCharCnt||d.replaceNextCharCnt||d.positionDelta?this._viewController.compositionType(d.text,d.replacePrevCharCnt,d.replaceNextCharCnt,d.positionDelta):this._viewController.type(d.text)})),this._register(this._textAreaInput.onSelectionChangeRequest(d=>{this._viewController.setSelection(d)})),this._register(this._textAreaInput.onCompositionStart(d=>{const h=this.textArea.domNode,f=this._modelSelections[0],{distanceToModelLineStart:g,widthOfHiddenTextBefore:p}=(()=>{const m=h.value.substring(0,Math.min(h.selectionStart,h.selectionEnd)),_=m.lastIndexOf(` -`),w=m.substring(_+1),y=w.lastIndexOf(" "),L=w.length-y-1,D=f.getStartPosition(),E=Math.min(D.column-1,L),I=D.column-1-E,k=w.substring(0,w.length-E),{tabSize:R}=this._context.viewModel.model.getOptions(),A=Got(this.textArea.domNode.ownerDocument,k,this._fontInfo,R);return{distanceToModelLineStart:I,widthOfHiddenTextBefore:A}})(),{distanceToModelLineEnd:v}=(()=>{const m=h.value.substring(Math.max(h.selectionStart,h.selectionEnd)),_=m.indexOf(` -`),w=_===-1?m:m.substring(0,_),y=w.indexOf(" "),L=y===-1?w.length:w.length-y-1,D=f.getEndPosition(),E=Math.min(this._context.viewModel.model.getLineMaxColumn(D.lineNumber)-D.column,L);return{distanceToModelLineEnd:this._context.viewModel.model.getLineMaxColumn(D.lineNumber)-D.column-E}})();this._context.viewModel.revealRange("keyboard",!0,V.fromPositions(this._selections[0].getStartPosition()),0,1),this._visibleTextArea=new qot(this._context,f.startLineNumber,g,p,v),this.textArea.setAttribute("wrap",this._textAreaWrapping&&!this._visibleTextArea?"on":"off"),this._visibleTextArea.prepareRender(this._visibleRangeProvider),this._render(),this.textArea.setClassName(`inputarea ${xw} ime-input`),this._viewController.compositionStart(),this._context.viewModel.onCompositionStart()})),this._register(this._textAreaInput.onCompositionUpdate(d=>{!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 ${xw}`),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(dE.onDidChange(()=>{this._ensureReadOnlyAttribute()}))}writeScreenReaderContent(e){this._textAreaInput.writeScreenReaderContent(e)}dispose(){super.dispose()}_getAndroidWordAtPosition(e){const t='`~!@#$%^&*()-=+[{]}\\|;:",.<>/?',n=this._context.viewModel.getLineContent(e.lineNumber),o=Wc(t);let r=!0,s=e.column,a=!0,l=e.column,c=0;for(;c<50&&(r||a);){if(r&&s<=1&&(r=!1),r){const u=n.charCodeAt(s-2);o.get(u)!==0?r=!1:s--}if(a&&l>n.length&&(a=!1),a){const u=n.charCodeAt(l-1);o.get(u)!==0?a=!1:l++}c++}return[n.substring(s-1,l-1),e.column-s]}_getWordBeforePosition(e){const t=this._context.viewModel.getLineContent(e.lineNumber),n=Wc(this._context.configuration.options.get(129));let o=e.column,r=0;for(;o>1;){const s=t.charCodeAt(o-2);if(n.get(s)!==0||r>50)return t.substring(o-1,e.column-1);r++,o--}return t.substring(0,e.column-1)}_getCharacterBeforePosition(e){if(e.column>1){const n=this._context.viewModel.getLineContent(e.lineNumber).charAt(e.column-2);if(!fr(n.charCodeAt(0)))return n}return""}_getAriaLabel(e){var t,n,o;if(e.get(2)===1){const s=(t=this._keybindingService.lookupKeybinding("editor.action.toggleScreenReaderAccessibilityMode"))===null||t===void 0?void 0:t.getAriaLabel(),a=(n=this._keybindingService.lookupKeybinding("workbench.action.showCommands"))===null||n===void 0?void 0:n.getAriaLabel(),l=(o=this._keybindingService.lookupKeybinding("workbench.action.openGlobalKeybindings"))===null||o===void 0?void 0:o.getAriaLabel(),c=C("accessibilityModeOff","The editor is not accessible at this time.");return s?C("accessibilityOffAriaLabel","{0} To enable screen reader optimized mode, use {1}",c,s):a?C("accessibilityOffAriaLabelNoKb","{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.",c,a):l?C("accessibilityOffAriaLabelNoKbs","{0} Please assign a keybinding for the command Toggle Screen Reader Accessibility Mode by accessing the keybindings editor with {1} and run it.",c,l):c}return e.get(4)}_setAccessibilityOptions(e){this._accessibilitySupport=e.get(2);const t=e.get(3);this._accessibilitySupport===2&&t===ih.accessibilityPageSize.defaultValue?this._accessibilityPageSize=500:this._accessibilityPageSize=t;const o=e.get(143).wrappingColumn;if(o!==-1&&this._accessibilitySupport!==1){const r=e.get(50);this._textAreaWrapping=!0,this._textAreaWidth=Math.round(o*r.typicalHalfwidthCharacterWidth)}else this._textAreaWrapping=!1,this._textAreaWidth=o9?0:1}onConfigurationChanged(e){const t=this._context.configuration.options,n=t.get(143);this._setAccessibilityOptions(t),this._contentLeft=n.contentLeft,this._contentWidth=n.contentWidth,this._contentHeight=n.height,this._fontInfo=t.get(50),this._lineHeight=t.get(66),this._emptySelectionClipboard=t.get(37),this._copyWithSyntaxHighlighting=t.get(25),this.textArea.setAttribute("wrap",this._textAreaWrapping&&!this._visibleTextArea?"on":"off");const{tabSize:o}=this._context.viewModel.model.getOptions();return this.textArea.domNode.style.tabSize=`${o*this._fontInfo.spaceWidth}px`,this.textArea.setAttribute("aria-label",this._getAriaLabel(t)),this.textArea.setAttribute("aria-required",t.get(5)?"true":"false"),this.textArea.setAttribute("tabindex",String(t.get(123))),(e.hasChanged(34)||e.hasChanged(90))&&this._ensureReadOnlyAttribute(),e.hasChanged(2)&&this._textAreaInput.writeScreenReaderContent("strategy changed"),!0}onCursorStateChanged(e){return this._selections=e.selections.slice(0),this._modelSelections=e.modelSelections.slice(0),this._textAreaInput.writeScreenReaderContent("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()}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;!dE.enabled||e.get(34)&&e.get(90)?this.textArea.setAttribute("readonly","true"):this.textArea.removeAttribute("readonly")}prepareRender(e){var t;this._primaryCursorPosition=new ae(this._selections[0].positionLineNumber,this._selections[0].positionColumn),this._primaryCursorVisibleRange=e.visibleRangeForPosition(this._primaryCursorPosition),(t=this._visibleTextArea)===null||t===void 0||t.prepareRender(e)}render(e){this._textAreaInput.writeScreenReaderContent("render"),this._render()}_render(){var e;if(this._visibleTextArea){const o=this._visibleTextArea.visibleTextareaStart,r=this._visibleTextArea.visibleTextareaEnd,s=this._visibleTextArea.startPosition,a=this._visibleTextArea.endPosition;if(s&&a&&o&&r&&r.left>=this._scrollLeft&&o.left<=this._scrollLeft+this._contentWidth){const l=this._context.viewLayout.getVerticalOffsetForLineNumber(this._primaryCursorPosition.lineNumber)-this._scrollTop,c=this._newlinecount(this.textArea.domNode.value.substr(0,this.textArea.domNode.selectionStart));let u=this._visibleTextArea.widthOfHiddenLineTextBefore,d=this._contentLeft+o.left-this._scrollLeft,h=r.left-o.left+1;if(dthis._contentWidth&&(h=this._contentWidth);const f=this._context.viewModel.getViewLineData(s.lineNumber),g=f.tokens.findTokenIndexAtOffset(s.column-1),p=f.tokens.findTokenIndexAtOffset(a.column-1),v=g===p,m=this._visibleTextArea.definePresentation(v?f.tokens.getPresentation(g):null);this.textArea.domNode.scrollTop=c*this._lineHeight,this.textArea.domNode.scrollLeft=u,this._doRender({lastRenderPosition:null,top:l,left:d,width:h,height:this._lineHeight,useCover:!1,color:(oo.getColorMap()||[])[m.foreground],italic:m.italic,bold:m.bold,underline:m.underline,strikethrough:m.strikethrough})}return}if(!this._primaryCursorVisibleRange){this._renderAtTopLeft();return}const t=this._contentLeft+this._primaryCursorVisibleRange.left-this._scrollLeft;if(tthis._contentLeft+this._contentWidth){this._renderAtTopLeft();return}const n=this._context.viewLayout.getVerticalOffsetForLineNumber(this._selections[0].positionLineNumber)-this._scrollTop;if(n<0||n>this._contentHeight){this._renderAtTopLeft();return}if(Nn){this._doRender({lastRenderPosition:this._primaryCursorPosition,top:n,left:this._textAreaWrapping?this._contentLeft:t,width:this._textAreaWidth,height:this._lineHeight,useCover:!1}),this.textArea.domNode.scrollLeft=this._primaryCursorVisibleRange.left;const o=(e=this._textAreaInput.textAreaState.newlineCountBeforeSelection)!==null&&e!==void 0?e:this._newlinecount(this.textArea.domNode.value.substr(0,this.textArea.domNode.selectionStart));this.textArea.domNode.scrollTop=o*this._lineHeight;return}this._doRender({lastRenderPosition:this._primaryCursorPosition,top:n,left:this._textAreaWrapping?this._contentLeft:t,width:this._textAreaWidth,height:o9?0:1,useCover:!1})}_newlinecount(e){let t=0,n=-1;do{if(n=e.indexOf(` -`,n+1),n===-1)break;t++}while(!0);return t}_renderAtTopLeft(){this._doRender({lastRenderPosition:null,top:0,left:0,width:this._textAreaWidth,height:o9?0:1,useCover:!0})}_doRender(e){this._lastRenderPosition=e.lastRenderPosition;const t=this.textArea,n=this.textAreaCover;rs(t,this._fontInfo),t.setTop(e.top),t.setLeft(e.left),t.setWidth(e.width),t.setHeight(e.height),t.setColor(e.color?ve.Format.CSS.formatHex(e.color):""),t.setFontStyle(e.italic?"italic":""),e.bold&&t.setFontWeight("bold"),t.setTextDecoration(`${e.underline?" underline":""}${e.strikethrough?" line-through":""}`),n.setTop(e.useCover?e.top:0),n.setLeft(e.useCover?e.left:0),n.setWidth(e.useCover?e.width:0),n.setHeight(e.useCover?e.height:0);const o=this._context.configuration.options;o.get(57)?n.setClassName("monaco-editor-background textAreaCover "+eb.OUTER_CLASS_NAME):o.get(67).renderType!==0?n.setClassName("monaco-editor-background textAreaCover "+ZI.CLASS_NAME):n.setClassName("monaco-editor-background textAreaCover")}};pH=jot([Kot(3,xi)],pH);function Got(i,e,t,n){if(e.length===0)return 0;const o=i.createElement("div");o.style.position="absolute",o.style.top="-50000px",o.style.width="50000px";const r=i.createElement("span");rs(r,t),r.style.whiteSpace="pre",r.style.tabSize=`${n*t.spaceWidth}px`,r.append(e),o.appendChild(r),i.body.appendChild(o);const s=r.offsetWidth;return i.body.removeChild(o),s}function Xot(i,e,t){let n=0;for(let r=0;r!0,Zot=()=>!1,Qot=i=>i===" "||i===" ";class $1{static shouldRecreate(e){return e.hasChanged(143)||e.hasChanged(129)||e.hasChanged(37)||e.hasChanged(76)||e.hasChanged(78)||e.hasChanged(79)||e.hasChanged(6)||e.hasChanged(7)||e.hasChanged(11)||e.hasChanged(9)||e.hasChanged(10)||e.hasChanged(14)||e.hasChanged(127)||e.hasChanged(50)||e.hasChanged(90)}constructor(e,t,n,o){var r;this.languageConfigurationService=o,this._cursorMoveConfigurationBrand=void 0,this._languageId=e;const s=n.options,a=s.get(143),l=s.get(50);this.readOnly=s.get(90),this.tabSize=t.tabSize,this.indentSize=t.indentSize,this.insertSpaces=t.insertSpaces,this.stickyTabStops=s.get(115),this.lineHeight=l.lineHeight,this.typicalHalfwidthCharacterWidth=l.typicalHalfwidthCharacterWidth,this.pageSize=Math.max(1,Math.floor(a.height/this.lineHeight)-2),this.useTabStops=s.get(127),this.wordSeparators=s.get(129),this.emptySelectionClipboard=s.get(37),this.copyWithSyntaxHighlighting=s.get(25),this.multiCursorMergeOverlapping=s.get(76),this.multiCursorPaste=s.get(78),this.multiCursorLimit=s.get(79),this.autoClosingBrackets=s.get(6),this.autoClosingComments=s.get(7),this.autoClosingQuotes=s.get(11),this.autoClosingDelete=s.get(9),this.autoClosingOvertype=s.get(10),this.autoSurround=s.get(14),this.autoIndent=s.get(12),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 u=this.languageConfigurationService.getLanguageConfiguration(e).comments;this.blockCommentStartToken=(r=u==null?void 0:u.blockCommentStartToken)!==null&&r!==void 0?r:null}get electricChars(){var e;if(!this._electricChars){this._electricChars={};const t=(e=this.languageConfigurationService.getLanguageConfiguration(this._languageId).electricCharacter)===null||e===void 0?void 0:e.getElectricCharacters();if(t)for(const n of t)this._electricChars[n]=!0}return this._electricChars}onElectricCharacter(e,t,n){const o=i5(t,n-1),r=this.languageConfigurationService.getLanguageConfiguration(o.languageId).electricCharacter;return r?r.onElectricCharacter(e,o,n-o.firstCharOffset):null}normalizeIndentation(e){return aP(e,this.indentSize,this.insertSpaces)}_getShouldAutoClose(e,t,n){switch(t){case"beforeWhitespace":return Qot;case"languageDefined":return this._getLanguageDefinedShouldAutoClose(e,n);case"always":return Yot;case"never":return Zot}}_getLanguageDefinedShouldAutoClose(e,t){const n=this.languageConfigurationService.getLanguageConfiguration(e).getAutoCloseBeforeSet(t);return o=>n.indexOf(o)!==-1}visibleColumnFromColumn(e,t){return or.visibleColumnFromColumn(e.getLineContent(t.lineNumber),t.column,this.tabSize)}columnFromVisibleColumn(e,t,n){const o=or.columnFromVisibleColumn(e.getLineContent(t),n,this.tabSize),r=e.getLineMinColumn(t);if(os?s:o}}class kn{static fromModelState(e){return new Jot(e)}static fromViewState(e){return new ert(e)}static fromModelSelection(e){const t=gt.liftSelection(e),n=new Br(V.fromPositions(t.getSelectionStart()),0,0,t.getPosition(),0);return kn.fromModelState(n)}static fromModelSelections(e){const t=[];for(let n=0,o=e.length;nr,c=o>s,u=os||mo||v0&&o--,$_.columnSelect(e,t,n.fromViewLineNumber,n.fromViewVisualColumn,n.toViewLineNumber,o)}static columnSelectRight(e,t,n){let o=0;const r=Math.min(n.fromViewLineNumber,n.toViewLineNumber),s=Math.max(n.fromViewLineNumber,n.toViewLineNumber);for(let l=r;l<=s;l++){const c=t.getLineMaxColumn(l),u=e.visibleColumnFromColumn(t,new ae(l,c));o=Math.max(o,u)}let a=n.toViewVisualColumn;return ae.getLineMinColumn(t.lineNumber))return t.delta(void 0,-P_e(e.getLineContent(t.lineNumber),t.column-1));if(t.lineNumber>1){const n=t.lineNumber-1;return new ae(n,e.getLineMaxColumn(n))}else return t}static leftPositionAtomicSoftTabs(e,t,n){if(t.column<=e.getLineIndentColumn(t.lineNumber)){const o=e.getLineMinColumn(t.lineNumber),r=e.getLineContent(t.lineNumber),s=ZD.atomicPosition(r,t.column-1,n,0);if(s!==-1&&s+1>=o)return new ae(t.lineNumber,s+1)}return this.leftPosition(e,t)}static left(e,t,n){const o=e.stickyTabStops?ii.leftPositionAtomicSoftTabs(t,n,e.tabSize):ii.leftPosition(t,n);return new r9(o.lineNumber,o.column,0)}static moveLeft(e,t,n,o,r){let s,a;if(n.hasSelection()&&!o)s=n.selection.startLineNumber,a=n.selection.startColumn;else{const l=n.position.delta(void 0,-(r-1)),c=t.normalizePosition(ii.clipPositionColumn(l,t),0),u=ii.left(e,t,c);s=u.lineNumber,a=u.column}return n.move(o,s,a,0)}static clipPositionColumn(e,t){return new ae(e.lineNumber,ii.clipRange(e.column,t.getLineMinColumn(e.lineNumber),t.getLineMaxColumn(e.lineNumber)))}static clipRange(e,t,n){return en?n:e}static rightPosition(e,t,n){return nu?(n=u,a?o=t.getLineMaxColumn(n):o=Math.min(t.getLineMaxColumn(n),o)):o=e.columnFromVisibleColumn(t,n,c),f?r=0:r=c-or.visibleColumnFromColumn(t.getLineContent(n),o,e.tabSize),l!==void 0){const g=new ae(n,o),p=t.normalizePosition(g,l);r=r+(o-p.column),n=p.lineNumber,o=p.column}return new r9(n,o,r)}static down(e,t,n,o,r,s,a){return this.vertical(e,t,n,o,r,n+s,a,4)}static moveDown(e,t,n,o,r){let s,a;n.hasSelection()&&!o?(s=n.selection.endLineNumber,a=n.selection.endColumn):(s=n.position.lineNumber,a=n.position.column);let l=0,c;do if(c=ii.down(e,t,s+l,a,n.leftoverVisibleColumns,r,!0),t.normalizePosition(new ae(c.lineNumber,c.column),2).lineNumber>s)break;while(l++<10&&s+l1&&this._isBlankLine(t,r);)r--;for(;r>1&&!this._isBlankLine(t,r);)r--;return n.move(o,r,t.getLineMinColumn(r),0)}static moveToNextBlankLine(e,t,n,o){const r=t.getLineCount();let s=n.position.lineNumber;for(;s=h.length+1)return!1;const f=h.charAt(d.column-2),g=o.get(f);if(!g)return!1;if(qp(f)){if(n==="never")return!1}else if(t==="never")return!1;const p=h.charAt(d.column-1);let v=!1;for(const m of g)m.open===f&&m.close===p&&(v=!0);if(!v)return!1;if(e==="auto"){let m=!1;for(let _=0,w=a.length;_1){const r=t.getLineContent(o.lineNumber),s=Ws(r),a=s===-1?r.length+1:s+1;if(o.column<=a){const l=n.visibleColumnFromColumn(t,o),c=or.prevIndentTabStop(l,n.indentSize),u=n.columnFromVisibleColumn(t,o.lineNumber,c);return new V(o.lineNumber,u,o.lineNumber,o.column)}}return V.fromPositions(tb.getPositionAfterDeleteLeft(o,t),o)}static getPositionAfterDeleteLeft(e,t){if(e.column>1){const n=gZe(e.column-1,t.getLineContent(e.lineNumber));return e.with(void 0,n+1)}else if(e.lineNumber>1){const n=e.lineNumber-1;return new ae(n,t.getLineMaxColumn(n))}else return e}static cut(e,t,n){const o=[];let r=null;n.sort((s,a)=>ae.compare(s.getStartPosition(),a.getEndPosition()));for(let s=0,a=n.length;s1&&(r==null?void 0:r.endLineNumber)!==c.lineNumber?(u=c.lineNumber-1,d=t.getLineMaxColumn(c.lineNumber-1),h=c.lineNumber,f=t.getLineMaxColumn(c.lineNumber)):(u=c.lineNumber,d=1,h=c.lineNumber,f=t.getLineMaxColumn(c.lineNumber));const g=new V(u,d,h,f);r=g,g.isEmpty()?o[s]=null:o[s]=new Qr(g,"")}else o[s]=null;else o[s]=new Qr(l,"")}return new ya(0,o,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!0})}}class Qn{static _createWord(e,t,n,o,r){return{start:o,end:r,wordType:t,nextCharClass:n}}static _findPreviousWordOnLine(e,t,n){const o=t.getLineContent(n.lineNumber);return this._doFindPreviousWordOnLine(o,e,n)}static _doFindPreviousWordOnLine(e,t,n){let o=0;for(let r=n.column-2;r>=0;r--){const s=e.charCodeAt(r),a=t.get(s);if(a===0){if(o===2)return this._createWord(e,o,a,r+1,this._findEndOfWord(e,t,o,r+1));o=1}else if(a===2){if(o===1)return this._createWord(e,o,a,r+1,this._findEndOfWord(e,t,o,r+1));o=2}else if(a===1&&o!==0)return this._createWord(e,o,a,r+1,this._findEndOfWord(e,t,o,r+1))}return o!==0?this._createWord(e,o,1,0,this._findEndOfWord(e,t,o,0)):null}static _findEndOfWord(e,t,n,o){const r=e.length;for(let s=o;s=0;r--){const s=e.charCodeAt(r),a=t.get(s);if(a===1||n===1&&a===2||n===2&&a===0)return r+1}return 0}static moveWordLeft(e,t,n,o){let r=n.lineNumber,s=n.column;s===1&&r>1&&(r=r-1,s=t.getLineMaxColumn(r));let a=Qn._findPreviousWordOnLine(e,t,new ae(r,s));if(o===0)return new ae(r,a?a.start+1:1);if(o===1)return a&&a.wordType===2&&a.end-a.start===1&&a.nextCharClass===0&&(a=Qn._findPreviousWordOnLine(e,t,new ae(r,a.start+1))),new ae(r,a?a.start+1:1);if(o===3){for(;a&&a.wordType===2;)a=Qn._findPreviousWordOnLine(e,t,new ae(r,a.start+1));return new ae(r,a?a.start+1:1)}return a&&s<=a.end+1&&(a=Qn._findPreviousWordOnLine(e,t,new ae(r,a.start+1))),new ae(r,a?a.end+1:1)}static _moveWordPartLeft(e,t){const n=t.lineNumber,o=e.getLineMaxColumn(n);if(t.column===1)return n>1?new ae(n-1,e.getLineMaxColumn(n-1)):t;const r=e.getLineContent(n);for(let s=t.column-1;s>1;s--){const a=r.charCodeAt(s-2),l=r.charCodeAt(s-1);if(a===95&&l!==95)return new ae(n,s);if(a===45&&l!==45)return new ae(n,s);if((bm(a)||JN(a))&&Eh(l))return new ae(n,s);if(Eh(a)&&Eh(l)&&s+1=l.start+1&&(l=Qn._findNextWordOnLine(e,t,new ae(r,l.end+1))),l?s=l.start+1:s=t.getLineMaxColumn(r);return new ae(r,s)}static _moveWordPartRight(e,t){const n=t.lineNumber,o=e.getLineMaxColumn(n);if(t.column===o)return n1?c=1:(l--,c=o.getLineMaxColumn(l)):(u&&c<=u.end+1&&(u=Qn._findPreviousWordOnLine(n,o,new ae(l,u.start+1))),u?c=u.end+1:c>1?c=1:(l--,c=o.getLineMaxColumn(l))),new V(l,c,a.lineNumber,a.column)}static deleteInsideWord(e,t,n){if(!n.isEmpty())return n;const o=new ae(n.positionLineNumber,n.positionColumn),r=this._deleteInsideWordWhitespace(t,o);return r||this._deleteInsideWordDetermineDeleteRange(e,t,o)}static _charAtIsWhitespace(e,t){const n=e.charCodeAt(t);return n===32||n===9}static _deleteInsideWordWhitespace(e,t){const n=e.getLineContent(t.lineNumber),o=n.length;if(o===0)return null;let r=Math.max(t.column-2,0);if(!this._charAtIsWhitespace(n,r))return null;let s=Math.min(t.column-1,o-1);if(!this._charAtIsWhitespace(n,s))return null;for(;r>0&&this._charAtIsWhitespace(n,r-1);)r--;for(;s+11?new V(n.lineNumber-1,t.getLineMaxColumn(n.lineNumber-1),n.lineNumber,1):n.lineNumberd.start+1<=n.column&&n.column<=d.end+1,a=(d,h)=>(d=Math.min(d,n.column),h=Math.max(h,n.column),new V(n.lineNumber,d,n.lineNumber,h)),l=d=>{let h=d.start+1,f=d.end+1,g=!1;for(;f-11&&this._charAtIsWhitespace(o,h-2);)h--;return a(h,f)},c=Qn._findPreviousWordOnLine(e,t,n);if(c&&s(c))return l(c);const u=Qn._findNextWordOnLine(e,t,n);return u&&s(u)?l(u):c&&u?a(c.end+1,u.start+1):c?a(c.start+1,c.end+1):u?a(u.start+1,u.end+1):a(1,r+1)}static _deleteWordPartLeft(e,t){if(!t.isEmpty())return t;const n=t.getPosition(),o=Qn._moveWordPartLeft(e,n);return new V(n.lineNumber,n.column,o.lineNumber,o.column)}static _findFirstNonWhitespaceChar(e,t){const n=e.length;for(let o=t;o=h.start+1&&(h=Qn._findNextWordOnLine(n,o,new ae(l,h.end+1))),h?c=h.start+1:cBoolean(e))}class Mr{static addCursorDown(e,t,n){const o=[];let r=0;for(let s=0,a=t.length;sc&&(u=c,d=e.model.getLineMaxColumn(u)),kn.fromModelState(new Br(new V(s.lineNumber,1,u,d),2,0,new ae(u,d),0))}const l=t.modelState.selectionStart.getStartPosition().lineNumber;if(s.lineNumberl){const c=e.getLineCount();let u=a.lineNumber+1,d=1;return u>c&&(u=c,d=e.getLineMaxColumn(u)),kn.fromViewState(t.viewState.move(!0,u,d,0))}else{const c=t.modelState.selectionStart.getEndPosition();return kn.fromModelState(t.modelState.move(!0,c.lineNumber,c.column,0))}}static word(e,t,n,o){const r=e.model.validatePosition(o);return kn.fromModelState(Qn.word(e.cursorConfig,e.model,t.modelState,n,r))}static cancelSelection(e,t){if(!t.modelState.hasSelection())return new kn(t.modelState,t.viewState);const n=t.viewState.position.lineNumber,o=t.viewState.position.column;return kn.fromViewState(new Br(new V(n,o,n,o),0,0,new ae(n,o),0))}static moveTo(e,t,n,o,r){if(n){if(t.modelState.selectionStartKind===1)return this.word(e,t,n,o);if(t.modelState.selectionStartKind===2)return this.line(e,t,n,o,r)}const s=e.model.validatePosition(o),a=r?e.coordinatesConverter.validateViewPosition(new ae(r.lineNumber,r.column),s):e.coordinatesConverter.convertModelPositionToViewPosition(s);return kn.fromViewState(t.viewState.move(n,a.lineNumber,a.column,0))}static simpleMove(e,t,n,o,r,s){switch(n){case 0:return s===4?this._moveHalfLineLeft(e,t,o):this._moveLeft(e,t,o,r);case 1:return s===4?this._moveHalfLineRight(e,t,o):this._moveRight(e,t,o,r);case 2:return s===2?this._moveUpByViewLines(e,t,o,r):this._moveUpByModelLines(e,t,o,r);case 3:return s===2?this._moveDownByViewLines(e,t,o,r):this._moveDownByModelLines(e,t,o,r);case 4:return s===2?t.map(a=>kn.fromViewState(ii.moveToPrevBlankLine(e.cursorConfig,e,a.viewState,o))):t.map(a=>kn.fromModelState(ii.moveToPrevBlankLine(e.cursorConfig,e.model,a.modelState,o)));case 5:return s===2?t.map(a=>kn.fromViewState(ii.moveToNextBlankLine(e.cursorConfig,e,a.viewState,o))):t.map(a=>kn.fromModelState(ii.moveToNextBlankLine(e.cursorConfig,e.model,a.modelState,o)));case 6:return this._moveToViewMinColumn(e,t,o);case 7:return this._moveToViewFirstNonWhitespaceColumn(e,t,o);case 8:return this._moveToViewCenterColumn(e,t,o);case 9:return this._moveToViewMaxColumn(e,t,o);case 10:return this._moveToViewLastNonWhitespaceColumn(e,t,o);default:return null}}static viewportMove(e,t,n,o,r){const s=e.getCompletelyVisibleViewRange(),a=e.coordinatesConverter.convertViewRangeToModelRange(s);switch(n){case 11:{const l=this._firstLineNumberInRange(e.model,a,r),c=e.model.getLineFirstNonWhitespaceColumn(l);return[this._moveToModelPosition(e,t[0],o,l,c)]}case 13:{const l=this._lastLineNumberInRange(e.model,a,r),c=e.model.getLineFirstNonWhitespaceColumn(l);return[this._moveToModelPosition(e,t[0],o,l,c)]}case 12:{const l=Math.round((a.startLineNumber+a.endLineNumber)/2),c=e.model.getLineFirstNonWhitespaceColumn(l);return[this._moveToModelPosition(e,t[0],o,l,c)]}case 14:{const l=[];for(let c=0,u=t.length;cn.endLineNumber-1?s=n.endLineNumber-1:rkn.fromViewState(ii.moveLeft(e.cursorConfig,e,r.viewState,n,o)))}static _moveHalfLineLeft(e,t,n){const o=[];for(let r=0,s=t.length;rkn.fromViewState(ii.moveRight(e.cursorConfig,e,r.viewState,n,o)))}static _moveHalfLineRight(e,t,n){const o=[];for(let r=0,s=t.length;rnew q4(e,o,n))}constructor(e,t,n){this.key=e,this.value=t,this.negated=n,this.type=12}cmp(e){return e.type!==this.type?this.type-e.type:Wb(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){return this}evaluate(e){return typeof this.value=="string"?!1:parseFloat(e.getValue(this.key))>this.value}serialize(){return`${this.key} > ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=Y4.create(this.key,this.value,this)),this.negated}}class G4{static create(e,t,n=null){return K4(t,o=>new G4(e,o,n))}constructor(e,t,n){this.key=e,this.value=t,this.negated=n,this.type=13}cmp(e){return e.type!==this.type?this.type-e.type:Wb(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){return this}evaluate(e){return typeof this.value=="string"?!1:parseFloat(e.getValue(this.key))>=this.value}serialize(){return`${this.key} >= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=X4.create(this.key,this.value,this)),this.negated}}class X4{static create(e,t,n=null){return K4(t,o=>new X4(e,o,n))}constructor(e,t,n){this.key=e,this.value=t,this.negated=n,this.type=14}cmp(e){return e.type!==this.type?this.type-e.type:Wb(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){return this}evaluate(e){return typeof this.value=="string"?!1:parseFloat(e.getValue(this.key))new Y4(e,o,n))}constructor(e,t,n){this.key=e,this.value=t,this.negated=n,this.type=15}cmp(e){return e.type!==this.type?this.type-e.type:Wb(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){return this}evaluate(e){return typeof this.value=="string"?!1:parseFloat(e.getValue(this.key))<=this.value}serialize(){return`${this.key} <= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=q4.create(this.key,this.value,this)),this.negated}}class AD{static create(e,t){return new AD(e,t)}constructor(e,t){this.key=e,this.regexp=t,this.type=7,this.negated=null}cmp(e){if(e.type!==this.type)return this.type-e.type;if(this.keye.key)return 1;const t=this.regexp?this.regexp.source:"",n=e.regexp?e.regexp.source:"";return tn?1:0}equals(e){if(e.type===this.type){const t=this.regexp?this.regexp.source:"",n=e.regexp?e.regexp.source:"";return this.key===e.key&&t===n}return!1}substituteConstants(){return this}evaluate(e){const t=e.getValue(this.key);return this.regexp?this.regexp.test(t):!1}serialize(){const e=this.regexp?`/${this.regexp.source}/${this.regexp.flags}`:"/invalid/";return`${this.key} =~ ${e}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=tG.create(this)),this.negated}}class tG{static create(e){return new tG(e)}constructor(e){this._actual=e,this.type=8}cmp(e){return e.type!==this.type?this.type-e.type:this._actual.cmp(e._actual)}equals(e){return e.type===this.type?this._actual.equals(e._actual):!1}substituteConstants(){return this}evaluate(e){return!this._actual.evaluate(e)}serialize(){return`!(${this._actual.serialize()})`}keys(){return this._actual.keys()}negate(){return this._actual}}function Z_e(i){let e=null;for(let t=0,n=i.length;te.expr.length)return 1;for(let t=0,n=this.expr.length;t1;){const s=o[o.length-1];if(s.type!==9)break;o.pop();const a=o.pop(),l=o.length===0,c=xg.create(s.expr.map(u=>c0.create([u,a],null,n)),null,l);c&&(o.push(c),o.sort(lE))}if(o.length===1)return o[0];if(n){for(let s=0;se.serialize()).join(" && ")}keys(){const e=[];for(const t of this.expr)e.push(...t.keys());return e}negate(){if(!this.negated){const e=[];for(const t of this.expr)e.push(t.negate());this.negated=xg.create(e,this,!0)}return this.negated}}class xg{static create(e,t,n){return xg._normalizeArr(e,t,n)}constructor(e,t){this.expr=e,this.negated=t,this.type=9}cmp(e){if(e.type!==this.type)return this.type-e.type;if(this.expr.lengthe.expr.length)return 1;for(let t=0,n=this.expr.length;te.serialize()).join(" || ")}keys(){const e=[];for(const t of this.expr)e.push(...t.keys());return e}negate(){if(!this.negated){const e=[];for(const t of this.expr)e.push(t.negate());for(;e.length>1;){const t=e.shift(),n=e.shift(),o=[];for(const r of _oe(t))for(const s of _oe(n))o.push(c0.create([r,s],null,!1));e.unshift(xg.create(o,null,!1))}this.negated=xg.create(e,this,!0)}return this.negated}}class lt extends Fb{static all(){return lt._info.values()}constructor(e,t,n){super(e,null),this._defaultValue=t,typeof n=="object"?lt._info.push(Object.assign(Object.assign({},n),{key:e})):n!==!0&<._info.push({key:e,description:n,type:t!=null?typeof t:void 0})}bindTo(e){return e.createKey(this.key,this._defaultValue)}getValue(e){return e.getContextKeyValue(this.key)}toNegated(){return this.negate()}isEqualTo(e){return mS.create(this.key,e)}}lt._info=[];const Ut=yn("contextKeyService");function Q_e(i,e){return ie?1:0}function Wb(i,e,t,n){return it?1:en?1:0}function UV(i,e){if(i.type===0||e.type===1)return!0;if(i.type===9)return e.type===9?voe(i.expr,e.expr):!1;if(e.type===9){for(const t of e.expr)if(UV(i,t))return!0;return!1}if(i.type===6){if(e.type===6)return voe(e.expr,i.expr);for(const t of i.expr)if(UV(t,e))return!0;return!1}return i.equals(e)}function voe(i,e){let t=0,n=0;for(;t>>0,n=(i&4294901760)>>>16;return n!==0?new R6([i2(t,e),i2(n,e)]):new R6([i2(t,e)])}else{const t=[];for(let n=0;n{a(),this._cachedMergedKeybindings=null})}getDefaultKeybindings(){return this._cachedMergedKeybindings||(this._cachedMergedKeybindings=Array.from(this._coreKeybindings).concat(this._extensionKeybindings),this._cachedMergedKeybindings.sort(YZe)),this._cachedMergedKeybindings.slice(0)}}const Va=new nG,XZe={EditorModes:"platform.keybindingsRegistry"};no.add(XZe.EditorModes,Va);function YZe(i,e){if(i.weight1!==e.weight1)return i.weight1-e.weight1;if(i.command&&e.command){if(i.commande.command)return 1}return i.weight2-e.weight2}var ZZe=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},boe=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},QZe=globalThis&&globalThis.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(i);ot===e}}Lg._all=new Map;const Hr=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new RYe({merge:Lg.merge}),this.onDidChangeMenu=this._onDidChangeMenu.event}addCommand(i){return this._commands.set(i.id,i),this._onDidChangeMenu.fire(Lg.for(Z.CommandPalette)),zt(()=>{this._commands.delete(i.id)&&this._onDidChangeMenu.fire(Lg.for(Z.CommandPalette))})}getCommand(i){return this._commands.get(i)}getCommands(){const i=new Map;return this._commands.forEach((e,t)=>i.set(t,e)),i}appendMenuItem(i,e){let t=this._menuItems.get(i);t||(t=new oa,this._menuItems.set(i,t));const n=t.push(e);return this._onDidChangeMenu.fire(Lg.for(i)),zt(()=>{n(),this._onDidChangeMenu.fire(Lg.for(i))})}appendMenuItems(i){const e=new Be;for(const{id:t,item:n}of i)e.add(this.appendMenuItem(t,n));return e}getMenuItems(i){let e;return this._menuItems.has(i)?e=[...this._menuItems.get(i)]:e=[],i===Z.CommandPalette&&this._appendImplicitItems(e),e}_appendImplicitItems(i){const e=new Set;for(const t of i)IC(t)&&(e.add(t.command.id),t.alt&&e.add(t.alt.id));this._commands.forEach((t,n)=>{e.has(n)||i.push({command:t})})}};class OD extends mw{constructor(e,t,n){super(`submenuitem.${e.submenu.id}`,typeof e.title=="string"?e.title:e.title.value,n,"submenu"),this.item=e,this.hideActions=t}}let Fu=eM=class{static label(e,t){return(t==null?void 0: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,n,o,r,s){var a,l;this.hideActions=o,this._commandService=s,this.id=e.id,this.label=eM.label(e,n),this.tooltip=(l=typeof e.tooltip=="string"?e.tooltip:(a=e.tooltip)===null||a===void 0?void 0:a.value)!==null&&l!==void 0?l:"",this.enabled=!e.precondition||r.contextMatchesRules(e.precondition),this.checked=void 0;let c;if(e.toggled){const u=e.toggled.condition?e.toggled:{condition:e.toggled};this.checked=r.contextMatchesRules(u.condition),this.checked&&u.tooltip&&(this.tooltip=typeof u.tooltip=="string"?u.tooltip:u.tooltip.value),this.checked&&Mt.isThemeIcon(u.icon)&&(c=u.icon),this.checked&&u.title&&(this.label=typeof u.title=="string"?u.title:u.title.value)}c||(c=Mt.isThemeIcon(e.icon)?e.icon:void 0),this.item=e,this.alt=t?new eM(t,void 0,n,o,r,s):void 0,this._options=n,this.class=c&&Mt.asClassName(c)}run(...e){var t,n;let o=[];return!((t=this._options)===null||t===void 0)&&t.arg&&(o=[...o,this._options.arg]),!((n=this._options)===null||n===void 0)&&n.shouldForwardArgs&&(o=[...o,...e]),this._commandService.executeCommand(this.id,...o)}};Fu=eM=ZZe([boe(4,Ut),boe(5,_o)],Fu);class ec{constructor(e){this.desc=e}}function $i(i){const e=new Be,t=new i,n=t.desc,{f1:o,menu:r,keybinding:s,description:a}=n,l=QZe(n,["f1","menu","keybinding","description"]);if(e.add(Rn.registerCommand({id:l.id,handler:(c,...u)=>t.run(c,...u),description:a})),Array.isArray(r))for(const c of r)e.add(Hr.appendMenuItem(c.id,Object.assign({command:Object.assign(Object.assign({},l),{precondition:c.precondition===null?void 0:l.precondition})},c)));else r&&e.add(Hr.appendMenuItem(r.id,Object.assign({command:Object.assign(Object.assign({},l),{precondition:r.precondition===null?void 0:l.precondition})},r)));if(o&&(e.add(Hr.appendMenuItem(Z.CommandPalette,{command:l,when:l.precondition})),e.add(Hr.addCommand(l))),Array.isArray(s))for(const c of s)e.add(Va.registerKeybindingRule(Object.assign(Object.assign({},c),{id:l.id,when:l.precondition?Me.and(l.precondition,c.when):c.when})));else s&&e.add(Va.registerKeybindingRule(Object.assign(Object.assign({},s),{id:l.id,when:l.precondition?Me.and(l.precondition,s.when):s.when})));return e}const tc=yn("telemetryService"),nc=yn("logService");var ns;(function(i){i[i.Off=0]="Off",i[i.Trace=1]="Trace",i[i.Debug=2]="Debug",i[i.Info=3]="Info",i[i.Warning=4]="Warning",i[i.Error=5]="Error"})(ns||(ns={}));const e0e=ns.Info;class t0e extends _e{constructor(){super(...arguments),this.level=e0e,this._onDidChangeLogLevel=this._register(new le),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!==ns.Off&&this.level<=e}}class eQe extends t0e{constructor(e=e0e,t=!0){super(),this.useColors=t,this.setLevel(e)}trace(e,...t){this.checkLogLevel(ns.Trace)&&(this.useColors?console.log("%cTRACE","color: #888",e,...t):console.log(e,...t))}debug(e,...t){this.checkLogLevel(ns.Debug)&&(this.useColors?console.log("%cDEBUG","background: #eee; color: #888",e,...t):console.log(e,...t))}info(e,...t){this.checkLogLevel(ns.Info)&&(this.useColors?console.log("%c INFO","color: #33f",e,...t):console.log(e,...t))}warn(e,...t){this.checkLogLevel(ns.Warning)&&(this.useColors?console.log("%c WARN","color: #993",e,...t):console.log(e,...t))}error(e,...t){this.checkLogLevel(ns.Error)&&(this.useColors?console.log("%c ERR","color: #f33",e,...t):console.error(e,...t))}dispose(){}}class tQe extends t0e{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 n of this.loggers)n.trace(e,...t)}debug(e,...t){for(const n of this.loggers)n.debug(e,...t)}info(e,...t){for(const n of this.loggers)n.info(e,...t)}warn(e,...t){for(const n of this.loggers)n.warn(e,...t)}error(e,...t){for(const n of this.loggers)n.error(e,...t)}dispose(){for(const e of this.loggers)e.dispose()}}function nQe(i){switch(i){case ns.Trace:return"trace";case ns.Debug:return"debug";case ns.Info:return"info";case ns.Warning:return"warn";case ns.Error:return"error";case ns.Off:return"off"}}new lt("logLevel",nQe(ns.Info));const iG={clipboard:{writeText:Fd||document.queryCommandSupported&&document.queryCommandSupported("copy")||!!(navigator&&navigator.clipboard&&navigator.clipboard.writeText),readText:Fd||!!(navigator&&navigator.clipboard&&navigator.clipboard.readText)},keyboard:(()=>Fd||DZe()?0:navigator.keyboard||ap?1:2)(),touch:"ontouchstart"in window||navigator.maxTouchPoints>0,pointerEvents:window.PointerEvent&&("ontouchstart"in window||window.navigator.maxTouchPoints>0||navigator.maxTouchPoints>0)};function iQe(i){if(i.charCode){const t=String.fromCharCode(i.charCode).toUpperCase();return Sg.fromString(t)}const e=i.keyCode;if(e===3)return 7;if(Fc)switch(e){case 59:return 85;case 60:if(xs)return 97;break;case 61:return 86;case 107:return 109;case 109:return 111;case 173:return 88;case 224:if(Nn)return 57;break}else if(L0){if(Nn&&e===93)return 57;if(!Nn&&e===92)return 57}return k_e[e]||0}const oQe=Nn?256:2048,rQe=512,sQe=1024,aQe=Nn?2048:256;class Pi{constructor(e){this._standardKeyboardEventBrand=!0;const t=e;this.browserEvent=t,this.target=t.target,this.ctrlKey=t.ctrlKey,this.shiftKey=t.shiftKey,this.altKey=t.altKey,this.metaKey=t.metaKey,this.altGraphKey=t.getModifierState("AltGraph"),this.keyCode=iQe(t),this.code=t.code,this.ctrlKey=this.ctrlKey||this.keyCode===5,this.altKey=this.altKey||this.keyCode===6,this.shiftKey=this.shiftKey||this.keyCode===4,this.metaKey=this.metaKey||this.keyCode===57,this._asKeybinding=this._computeKeybinding(),this._asKeyCodeChord=this._computeKeyCodeChord()}preventDefault(){this.browserEvent&&this.browserEvent.preventDefault&&this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent&&this.browserEvent.stopPropagation&&this.browserEvent.stopPropagation()}toKeyCodeChord(){return this._asKeyCodeChord}equals(e){return this._asKeybinding===e}_computeKeybinding(){let e=0;this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(e=this.keyCode);let t=0;return this.ctrlKey&&(t|=oQe),this.altKey&&(t|=rQe),this.shiftKey&&(t|=sQe),this.metaKey&&(t|=aQe),t|=e,t}_computeKeyCodeChord(){let e=0;return this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(e=this.keyCode),new lp(this.ctrlKey,this.shiftKey,this.altKey,this.metaKey,e)}}let Coe=!1,kx=null;function lQe(i){if(!i.parent||i.parent===i)return null;try{const e=i.location,t=i.parent.location;if(e.origin!=="null"&&t.origin!=="null"&&e.origin!==t.origin)return Coe=!0,null}catch{return Coe=!0,null}return i.parent}class cQe{static getSameOriginWindowChain(){if(!kx){kx=[];let e=window,t;do t=lQe(e),t?kx.push({window:e,iframeElement:e.frameElement||null}):kx.push({window:e,iframeElement:null}),e=t;while(e)}return kx.slice(0)}static getPositionOfChildWindowRelativeToAncestorWindow(e,t){if(!t||e===t)return{top:0,left:0};let n=0,o=0;const r=this.getSameOriginWindowChain();for(const s of r){if(n+=s.window.scrollY,o+=s.window.scrollX,s.window===t||!s.iframeElement)break;const a=s.iframeElement.getBoundingClientRect();n+=a.top,o+=a.left}return{top:n,left:o}}}class kc{constructor(e){this.timestamp=Date.now(),this.browserEvent=e,this.leftButton=e.button===0,this.middleButton=e.button===1,this.rightButton=e.button===2,this.buttons=e.buttons,this.target=e.target,this.detail=e.detail||1,e.type==="dblclick"&&(this.detail=2),this.ctrlKey=e.ctrlKey,this.shiftKey=e.shiftKey,this.altKey=e.altKey,this.metaKey=e.metaKey,typeof e.pageX=="number"?(this.posx=e.pageX,this.posy=e.pageY):(this.posx=e.clientX+this.target.ownerDocument.body.scrollLeft+this.target.ownerDocument.documentElement.scrollLeft,this.posy=e.clientY+this.target.ownerDocument.body.scrollTop+this.target.ownerDocument.documentElement.scrollTop);const t=cQe.getPositionOfChildWindowRelativeToAncestorWindow(window,e.view);this.posx-=t.left,this.posy-=t.top}preventDefault(){this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent.stopPropagation()}}class J0{constructor(e,t=0,n=0){if(this.browserEvent=e||null,this.target=e?e.target||e.targetNode||e.srcElement:null,this.deltaY=n,this.deltaX=t,e){const o=e,r=e;if(typeof o.wheelDeltaY!="undefined")this.deltaY=o.wheelDeltaY/120;else if(typeof r.VERTICAL_AXIS!="undefined"&&r.axis===r.VERTICAL_AXIS)this.deltaY=-r.detail/3;else if(e.type==="wheel"){const s=e;s.deltaMode===s.DOM_DELTA_LINE?Fc&&!Nn?this.deltaY=-e.deltaY/3:this.deltaY=-e.deltaY:this.deltaY=-e.deltaY/40}if(typeof o.wheelDeltaX!="undefined")ap&&ls?this.deltaX=-(o.wheelDeltaX/120):this.deltaX=o.wheelDeltaX/120;else if(typeof r.HORIZONTAL_AXIS!="undefined"&&r.axis===r.HORIZONTAL_AXIS)this.deltaX=-e.detail/3;else if(e.type==="wheel"){const s=e;s.deltaMode===s.DOM_DELTA_LINE?Fc&&!Nn?this.deltaX=-e.deltaX/3:this.deltaX=-e.deltaX:this.deltaX=-e.deltaX/40}this.deltaY===0&&this.deltaX===0&&e.wheelDelta&&(this.deltaY=e.wheelDelta/120)}}preventDefault(){var e;(e=this.browserEvent)===null||e===void 0||e.preventDefault()}stopPropagation(){var e;(e=this.browserEvent)===null||e===void 0||e.stopPropagation()}}/*! @license DOMPurify 3.0.5 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.0.5/LICENSE */const{entries:n0e,setPrototypeOf:yoe,isFrozen:uQe,getPrototypeOf:dQe,getOwnPropertyDescriptor:hQe}=Object;let{freeze:hl,seal:qd,create:fQe}=Object,{apply:KV,construct:qV}=typeof Reflect!="undefined"&&Reflect;KV||(KV=function(e,t,n){return e.apply(t,n)});hl||(hl=function(e){return e});qd||(qd=function(e){return e});qV||(qV=function(e,t){return new e(...t)});const gQe=Bu(Array.prototype.forEach),woe=Bu(Array.prototype.pop),Ix=Bu(Array.prototype.push),tM=Bu(String.prototype.toLowerCase),A6=Bu(String.prototype.toString),pQe=Bu(String.prototype.match),id=Bu(String.prototype.replace),mQe=Bu(String.prototype.indexOf),vQe=Bu(String.prototype.trim),pc=Bu(RegExp.prototype.test),Tx=_Qe(TypeError);function Bu(i){return function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),o=1;o/gm),SQe=qd(/\${[\w\W]*}/gm),xQe=qd(/^data-[\-\w.\u00B7-\uFFFF]/),LQe=qd(/^aria-[\-\w]+$/),i0e=qd(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),EQe=qd(/^(?:\w+script|data):/i),DQe=qd(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),o0e=qd(/^html$/i);var Doe=Object.freeze({__proto__:null,MUSTACHE_EXPR:yQe,ERB_EXPR:wQe,TMPLIT_EXPR:SQe,DATA_ATTR:xQe,ARIA_ATTR:LQe,IS_ALLOWED_URI:i0e,IS_SCRIPT_OR_DATA:EQe,ATTR_WHITESPACE:DQe,DOCTYPE_NAME:o0e});const kQe=()=>typeof window=="undefined"?null:window,IQe=function(e,t){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let n=null;const o="data-tt-policy-suffix";t&&t.hasAttribute(o)&&(n=t.getAttribute(o));const r="dompurify"+(n?"#"+n:"");try{return e.createPolicy(r,{createHTML(s){return s},createScriptURL(s){return s}})}catch{return console.warn("TrustedTypes policy "+r+" could not be created."),null}};function r0e(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:kQe();const e=Ze=>r0e(Ze);if(e.version="3.0.5",e.removed=[],!i||!i.document||i.document.nodeType!==9)return e.isSupported=!1,e;const t=i.document,n=t.currentScript;let{document:o}=i;const{DocumentFragment:r,HTMLTemplateElement:s,Node:a,Element:l,NodeFilter:c,NamedNodeMap:u=i.NamedNodeMap||i.MozNamedAttrMap,HTMLFormElement:d,DOMParser:h,trustedTypes:f}=i,g=l.prototype,p=o2(g,"cloneNode"),v=o2(g,"nextSibling"),m=o2(g,"childNodes"),_=o2(g,"parentNode");if(typeof s=="function"){const Ze=o.createElement("template");Ze.content&&Ze.content.ownerDocument&&(o=Ze.content.ownerDocument)}let y,w="";const{implementation:L,createNodeIterator:D,createDocumentFragment:E,getElementsByTagName:I}=o,{importNode:k}=t;let R={};e.isSupported=typeof n0e=="function"&&typeof _=="function"&&L&&L.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:A,ERB_EXPR:P,TMPLIT_EXPR:N,DATA_ATTR:M,ARIA_ATTR:H,IS_SCRIPT_OR_DATA:B,ATTR_WHITESPACE:F}=Doe;let{IS_ALLOWED_URI:$}=Doe,z=null;const K=hi({},[...Soe,...P6,...O6,...F6,...xoe]);let j=null;const G=hi({},[...Loe,...B6,...Eoe,...r2]);let X=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}})),de=null,fe=null,pe=!0,be=!0,Se=!1,Fe=!0,De=!1,ce=!1,Pe=!1,Oe=!1,xe=!1,Ee=!1,tt=!1,nt=!0,Qe=!1;const Ge="user-content-";let re=!0,ie=!1,se={},U=null;const Y=hi({},["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 oe=null;const te=hi({},["audio","video","img","source","image","track"]);let ye=null;const Le=hi({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Te="http://www.w3.org/1998/Math/MathML",We="http://www.w3.org/2000/svg",je="http://www.w3.org/1999/xhtml";let mt=je,Dt=!1,At=null;const Je=hi({},[Te,We,je],A6);let Lt;const Ot=["application/xhtml+xml","text/html"],Vn="text/html";let Et,tn=null;const ui=o.createElement("form"),cn=function(ue){return ue instanceof RegExp||ue instanceof Function},qn=function(ue){if(!(tn&&tn===ue)){if((!ue||typeof ue!="object")&&(ue={}),ue=B1(ue),Lt=Ot.indexOf(ue.PARSER_MEDIA_TYPE)===-1?Lt=Vn:Lt=ue.PARSER_MEDIA_TYPE,Et=Lt==="application/xhtml+xml"?A6:tM,z="ALLOWED_TAGS"in ue?hi({},ue.ALLOWED_TAGS,Et):K,j="ALLOWED_ATTR"in ue?hi({},ue.ALLOWED_ATTR,Et):G,At="ALLOWED_NAMESPACES"in ue?hi({},ue.ALLOWED_NAMESPACES,A6):Je,ye="ADD_URI_SAFE_ATTR"in ue?hi(B1(Le),ue.ADD_URI_SAFE_ATTR,Et):Le,oe="ADD_DATA_URI_TAGS"in ue?hi(B1(te),ue.ADD_DATA_URI_TAGS,Et):te,U="FORBID_CONTENTS"in ue?hi({},ue.FORBID_CONTENTS,Et):Y,de="FORBID_TAGS"in ue?hi({},ue.FORBID_TAGS,Et):{},fe="FORBID_ATTR"in ue?hi({},ue.FORBID_ATTR,Et):{},se="USE_PROFILES"in ue?ue.USE_PROFILES:!1,pe=ue.ALLOW_ARIA_ATTR!==!1,be=ue.ALLOW_DATA_ATTR!==!1,Se=ue.ALLOW_UNKNOWN_PROTOCOLS||!1,Fe=ue.ALLOW_SELF_CLOSE_IN_ATTR!==!1,De=ue.SAFE_FOR_TEMPLATES||!1,ce=ue.WHOLE_DOCUMENT||!1,xe=ue.RETURN_DOM||!1,Ee=ue.RETURN_DOM_FRAGMENT||!1,tt=ue.RETURN_TRUSTED_TYPE||!1,Oe=ue.FORCE_BODY||!1,nt=ue.SANITIZE_DOM!==!1,Qe=ue.SANITIZE_NAMED_PROPS||!1,re=ue.KEEP_CONTENT!==!1,ie=ue.IN_PLACE||!1,$=ue.ALLOWED_URI_REGEXP||i0e,mt=ue.NAMESPACE||je,X=ue.CUSTOM_ELEMENT_HANDLING||{},ue.CUSTOM_ELEMENT_HANDLING&&cn(ue.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(X.tagNameCheck=ue.CUSTOM_ELEMENT_HANDLING.tagNameCheck),ue.CUSTOM_ELEMENT_HANDLING&&cn(ue.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(X.attributeNameCheck=ue.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),ue.CUSTOM_ELEMENT_HANDLING&&typeof ue.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(X.allowCustomizedBuiltInElements=ue.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),De&&(be=!1),Ee&&(xe=!0),se&&(z=hi({},[...xoe]),j=[],se.html===!0&&(hi(z,Soe),hi(j,Loe)),se.svg===!0&&(hi(z,P6),hi(j,B6),hi(j,r2)),se.svgFilters===!0&&(hi(z,O6),hi(j,B6),hi(j,r2)),se.mathMl===!0&&(hi(z,F6),hi(j,Eoe),hi(j,r2))),ue.ADD_TAGS&&(z===K&&(z=B1(z)),hi(z,ue.ADD_TAGS,Et)),ue.ADD_ATTR&&(j===G&&(j=B1(j)),hi(j,ue.ADD_ATTR,Et)),ue.ADD_URI_SAFE_ATTR&&hi(ye,ue.ADD_URI_SAFE_ATTR,Et),ue.FORBID_CONTENTS&&(U===Y&&(U=B1(U)),hi(U,ue.FORBID_CONTENTS,Et)),re&&(z["#text"]=!0),ce&&hi(z,["html","head","body"]),z.table&&(hi(z,["tbody"]),delete de.tbody),ue.TRUSTED_TYPES_POLICY){if(typeof ue.TRUSTED_TYPES_POLICY.createHTML!="function")throw Tx('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof ue.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Tx('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');y=ue.TRUSTED_TYPES_POLICY,w=y.createHTML("")}else y===void 0&&(y=IQe(f,n)),y!==null&&typeof w=="string"&&(w=y.createHTML(""));hl&&hl(ue),tn=ue}},bn=hi({},["mi","mo","mn","ms","mtext"]),Pt=hi({},["foreignobject","desc","title","annotation-xml"]),qt=hi({},["title","style","font","a","script"]),Nt=hi({},P6);hi(Nt,O6),hi(Nt,bQe);const jt=hi({},F6);hi(jt,CQe);const Gt=function(ue){let Ve=_(ue);(!Ve||!Ve.tagName)&&(Ve={namespaceURI:mt,tagName:"template"});const ot=tM(ue.tagName),Sn=tM(Ve.tagName);return At[ue.namespaceURI]?ue.namespaceURI===We?Ve.namespaceURI===je?ot==="svg":Ve.namespaceURI===Te?ot==="svg"&&(Sn==="annotation-xml"||bn[Sn]):Boolean(Nt[ot]):ue.namespaceURI===Te?Ve.namespaceURI===je?ot==="math":Ve.namespaceURI===We?ot==="math"&&Pt[Sn]:Boolean(jt[ot]):ue.namespaceURI===je?Ve.namespaceURI===We&&!Pt[Sn]||Ve.namespaceURI===Te&&!bn[Sn]?!1:!jt[ot]&&(qt[ot]||!Nt[ot]):!!(Lt==="application/xhtml+xml"&&At[ue.namespaceURI]):!1},It=function(ue){Ix(e.removed,{element:ue});try{ue.parentNode.removeChild(ue)}catch{ue.remove()}},Ft=function(ue,Ve){try{Ix(e.removed,{attribute:Ve.getAttributeNode(ue),from:Ve})}catch{Ix(e.removed,{attribute:null,from:Ve})}if(Ve.removeAttribute(ue),ue==="is"&&!j[ue])if(xe||Ee)try{It(Ve)}catch{}else try{Ve.setAttribute(ue,"")}catch{}},bt=function(ue){let Ve,ot;if(Oe)ue=""+ue;else{const Ci=pQe(ue,/^[\r\n\t ]+/);ot=Ci&&Ci[0]}Lt==="application/xhtml+xml"&&mt===je&&(ue=''+ue+"");const Sn=y?y.createHTML(ue):ue;if(mt===je)try{Ve=new h().parseFromString(Sn,Lt)}catch{}if(!Ve||!Ve.documentElement){Ve=L.createDocument(mt,"template",null);try{Ve.documentElement.innerHTML=Dt?w:Sn}catch{}}const $n=Ve.body||Ve.documentElement;return ue&&ot&&$n.insertBefore(o.createTextNode(ot),$n.childNodes[0]||null),mt===je?I.call(Ve,ce?"html":"body")[0]:ce?Ve.documentElement:$n},Zt=function(ue){return D.call(ue.ownerDocument||ue,ue,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT,null,!1)},wn=function(ue){return ue instanceof d&&(typeof ue.nodeName!="string"||typeof ue.textContent!="string"||typeof ue.removeChild!="function"||!(ue.attributes instanceof u)||typeof ue.removeAttribute!="function"||typeof ue.setAttribute!="function"||typeof ue.namespaceURI!="string"||typeof ue.insertBefore!="function"||typeof ue.hasChildNodes!="function")},Dn=function(ue){return typeof a=="object"?ue instanceof a:ue&&typeof ue=="object"&&typeof ue.nodeType=="number"&&typeof ue.nodeName=="string"},Gn=function(ue,Ve,ot){!R[ue]||gQe(R[ue],Sn=>{Sn.call(e,Ve,ot,tn)})},Un=function(ue){let Ve;if(Gn("beforeSanitizeElements",ue,null),wn(ue))return It(ue),!0;const ot=Et(ue.nodeName);if(Gn("uponSanitizeElement",ue,{tagName:ot,allowedTags:z}),ue.hasChildNodes()&&!Dn(ue.firstElementChild)&&(!Dn(ue.content)||!Dn(ue.content.firstElementChild))&&pc(/<[/\w]/g,ue.innerHTML)&&pc(/<[/\w]/g,ue.textContent))return It(ue),!0;if(!z[ot]||de[ot]){if(!de[ot]&&an(ot)&&(X.tagNameCheck instanceof RegExp&&pc(X.tagNameCheck,ot)||X.tagNameCheck instanceof Function&&X.tagNameCheck(ot)))return!1;if(re&&!U[ot]){const Sn=_(ue)||ue.parentNode,$n=m(ue)||ue.childNodes;if($n&&Sn){const Ci=$n.length;for(let An=Ci-1;An>=0;--An)Sn.insertBefore(p($n[An],!0),v(ue))}}return It(ue),!0}return ue instanceof l&&!Gt(ue)||(ot==="noscript"||ot==="noembed"||ot==="noframes")&&pc(/<\/no(script|embed|frames)/i,ue.innerHTML)?(It(ue),!0):(De&&ue.nodeType===3&&(Ve=ue.textContent,Ve=id(Ve,A," "),Ve=id(Ve,P," "),Ve=id(Ve,N," "),ue.textContent!==Ve&&(Ix(e.removed,{element:ue.cloneNode()}),ue.textContent=Ve)),Gn("afterSanitizeElements",ue,null),!1)},Zi=function(ue,Ve,ot){if(nt&&(Ve==="id"||Ve==="name")&&(ot in o||ot in ui))return!1;if(!(be&&!fe[Ve]&&pc(M,Ve))){if(!(pe&&pc(H,Ve))){if(!j[Ve]||fe[Ve]){if(!(an(ue)&&(X.tagNameCheck instanceof RegExp&&pc(X.tagNameCheck,ue)||X.tagNameCheck instanceof Function&&X.tagNameCheck(ue))&&(X.attributeNameCheck instanceof RegExp&&pc(X.attributeNameCheck,Ve)||X.attributeNameCheck instanceof Function&&X.attributeNameCheck(Ve))||Ve==="is"&&X.allowCustomizedBuiltInElements&&(X.tagNameCheck instanceof RegExp&&pc(X.tagNameCheck,ot)||X.tagNameCheck instanceof Function&&X.tagNameCheck(ot))))return!1}else if(!ye[Ve]){if(!pc($,id(ot,F,""))){if(!((Ve==="src"||Ve==="xlink:href"||Ve==="href")&&ue!=="script"&&mQe(ot,"data:")===0&&oe[ue])){if(!(Se&&!pc(B,id(ot,F,"")))){if(ot)return!1}}}}}}return!0},an=function(ue){return ue.indexOf("-")>0},Xt=function(ue){let Ve,ot,Sn,$n;Gn("beforeSanitizeAttributes",ue,null);const{attributes:Ci}=ue;if(!Ci)return;const An={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:j};for($n=Ci.length;$n--;){Ve=Ci[$n];const{name:lo,namespaceURI:Qo}=Ve;if(ot=lo==="value"?Ve.value:vQe(Ve.value),Sn=Et(lo),An.attrName=Sn,An.attrValue=ot,An.keepAttr=!0,An.forceKeepAttr=void 0,Gn("uponSanitizeAttribute",ue,An),ot=An.attrValue,An.forceKeepAttr||(Ft(lo,ue),!An.keepAttr))continue;if(!Fe&&pc(/\/>/i,ot)){Ft(lo,ue);continue}De&&(ot=id(ot,A," "),ot=id(ot,P," "),ot=id(ot,N," "));const zo=Et(ue.nodeName);if(!!Zi(zo,Sn,ot)){if(Qe&&(Sn==="id"||Sn==="name")&&(Ft(lo,ue),ot=Ge+ot),y&&typeof f=="object"&&typeof f.getAttributeType=="function"&&!Qo)switch(f.getAttributeType(zo,Sn)){case"TrustedHTML":{ot=y.createHTML(ot);break}case"TrustedScriptURL":{ot=y.createScriptURL(ot);break}}try{Qo?ue.setAttributeNS(Qo,lo,ot):ue.setAttribute(lo,ot),woe(e.removed)}catch{}}}Gn("afterSanitizeAttributes",ue,null)},oi=function Ze(ue){let Ve;const ot=Zt(ue);for(Gn("beforeSanitizeShadowDOM",ue,null);Ve=ot.nextNode();)Gn("uponSanitizeShadowNode",Ve,null),!Un(Ve)&&(Ve.content instanceof r&&Ze(Ve.content),Xt(Ve));Gn("afterSanitizeShadowDOM",ue,null)};return e.sanitize=function(Ze){let ue=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Ve,ot,Sn,$n;if(Dt=!Ze,Dt&&(Ze=""),typeof Ze!="string"&&!Dn(Ze))if(typeof Ze.toString=="function"){if(Ze=Ze.toString(),typeof Ze!="string")throw Tx("dirty is not a string, aborting")}else throw Tx("toString is not a function");if(!e.isSupported)return Ze;if(Pe||qn(ue),e.removed=[],typeof Ze=="string"&&(ie=!1),ie){if(Ze.nodeName){const lo=Et(Ze.nodeName);if(!z[lo]||de[lo])throw Tx("root node is forbidden and cannot be sanitized in-place")}}else if(Ze instanceof a)Ve=bt(""),ot=Ve.ownerDocument.importNode(Ze,!0),ot.nodeType===1&&ot.nodeName==="BODY"||ot.nodeName==="HTML"?Ve=ot:Ve.appendChild(ot);else{if(!xe&&!De&&!ce&&Ze.indexOf("<")===-1)return y&&tt?y.createHTML(Ze):Ze;if(Ve=bt(Ze),!Ve)return xe?null:tt?w:""}Ve&&Oe&&It(Ve.firstChild);const Ci=Zt(ie?Ze:Ve);for(;Sn=Ci.nextNode();)Un(Sn)||(Sn.content instanceof r&&oi(Sn.content),Xt(Sn));if(ie)return Ze;if(xe){if(Ee)for($n=E.call(Ve.ownerDocument);Ve.firstChild;)$n.appendChild(Ve.firstChild);else $n=Ve;return(j.shadowroot||j.shadowrootmode)&&($n=k.call(t,$n,!0)),$n}let An=ce?Ve.outerHTML:Ve.innerHTML;return ce&&z["!doctype"]&&Ve.ownerDocument&&Ve.ownerDocument.doctype&&Ve.ownerDocument.doctype.name&&pc(o0e,Ve.ownerDocument.doctype.name)&&(An=" +`+An),De&&(An=id(An,A," "),An=id(An,P," "),An=id(An,N," ")),y&&tt?y.createHTML(An):An},e.setConfig=function(Ze){qn(Ze),Pe=!0},e.clearConfig=function(){tn=null,Pe=!1},e.isValidAttribute=function(Ze,ue,Ve){tn||qn({});const ot=Et(Ze),Sn=Et(ue);return Zi(ot,Sn,Ve)},e.addHook=function(Ze,ue){typeof ue=="function"&&(R[Ze]=R[Ze]||[],Ix(R[Ze],ue))},e.removeHook=function(Ze){if(R[Ze])return woe(R[Ze])},e.removeHooks=function(Ze){R[Ze]&&(R[Ze]=[])},e.removeAllHooks=function(){R={}},e}var Tf=r0e();Tf.version;Tf.isSupported;const s0e=Tf.sanitize;Tf.setConfig;Tf.clearConfig;Tf.isValidAttribute;const a0e=Tf.addHook,l0e=Tf.removeHook;Tf.removeHooks;Tf.removeAllHooks;var hn;(function(i){i.inMemory="inmemory",i.vscode="vscode",i.internal="private",i.walkThrough="walkThrough",i.walkThroughSnippet="walkThroughSnippet",i.http="http",i.https="https",i.file="file",i.mailto="mailto",i.untitled="untitled",i.data="data",i.command="command",i.vscodeRemote="vscode-remote",i.vscodeRemoteResource="vscode-remote-resource",i.vscodeManagedRemoteResource="vscode-managed-remote-resource",i.vscodeUserData="vscode-userdata",i.vscodeCustomEditor="vscode-custom-editor",i.vscodeNotebookCell="vscode-notebook-cell",i.vscodeNotebookCellMetadata="vscode-notebook-cell-metadata",i.vscodeNotebookCellOutput="vscode-notebook-cell-output",i.vscodeInteractiveInput="vscode-interactive-input",i.vscodeSettings="vscode-settings",i.vscodeWorkspaceTrust="vscode-workspace-trust",i.vscodeTerminal="vscode-terminal",i.vscodeChatSesssion="vscode-chat-editor",i.webviewPanel="webview-panel",i.vscodeWebview="vscode-webview",i.extension="extension",i.vscodeFileResource="vscode-file",i.tmp="tmp",i.vsls="vsls",i.vscodeSourceControl="vscode-scm"})(hn||(hn={}));const TQe="tkn";class NQe{constructor(){this._hosts=Object.create(null),this._ports=Object.create(null),this._connectionTokens=Object.create(null),this._preferredWebSchema="http",this._delegate=null,this._remoteResourcesPath=`/${hn.vscodeRemoteResource}`}setPreferredWebSchema(e){this._preferredWebSchema=e}rewrite(e){if(this._delegate)try{return this._delegate(e)}catch(a){return en(a),e}const t=e.authority;let n=this._hosts[t];n&&n.indexOf(":")!==-1&&n.indexOf("[")===-1&&(n=`[${n}]`);const o=this._ports[t],r=this._connectionTokens[t];let s=`path=${encodeURIComponent(e.path)}`;return typeof r=="string"&&(s+=`&${TQe}=${encodeURIComponent(r)}`),Rt.from({scheme:qv?this._preferredWebSchema:hn.vscodeRemoteResource,authority:`${n}:${o}`,path:this._remoteResourcesPath,query:s})}}const c0e=new NQe;class FD{uriToBrowserUri(e){return e.scheme===hn.vscodeRemote?c0e.rewrite(e):e.scheme===hn.file&&(Fd||LXe&&Iu.origin===`${hn.vscodeFileResource}://${FD.FALLBACK_AUTHORITY}`)?e.with({scheme:hn.vscodeFileResource,authority:e.authority||FD.FALLBACK_AUTHORITY,query:null,fragment:null}):e}}FD.FALLBACK_AUTHORITY="vscode-app";const u0e=new FD;var koe;(function(i){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"}]]);i.CoopAndCoep=Object.freeze(e.get("3"));const t="vscode-coi";function n(r){let s;typeof r=="string"?s=new URL(r).searchParams:r instanceof URL?s=r.searchParams:Rt.isUri(r)&&(s=new URL(r.toString(!0)).searchParams);const a=s==null?void 0:s.get(t);if(!!a)return e.get(a)}i.getHeadersFromQuery=n;function o(r,s,a){if(!globalThis.crossOriginIsolated)return;const l=s&&a?"3":a?"2":"1";r instanceof URLSearchParams?r.set(t,l):r[t]=l}i.addSearchParam=o})(koe||(koe={}));const{registerWindow:kNt,getWindows:RQe,onDidCreateWindow:INt}=function(){const i=[],e=new le;return{onDidCreateWindow:e.event,registerWindow(t){i.push(t);const n=new Be;return n.add(zt(()=>{const o=i.indexOf(t);o!==-1&&i.splice(o,1)})),e.fire({window:t,disposableStore:n}),n},getWindows(){return i}}}();function Ur(i){for(;i.firstChild;)i.firstChild.remove()}function oG(i){var e;return(e=i==null?void 0:i.isConnected)!==null&&e!==void 0?e:!1}class MQe{constructor(e,t,n,o){this._node=e,this._type=t,this._handler=n,this._options=o||!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 ke(i,e,t,n){return new MQe(i,e,t,n)}function d0e(i){return function(e){return i(new kc(e))}}function AQe(i){return function(e){return i(new Pi(e))}}const No=function(e,t,n,o){let r=n;return t==="click"||t==="mousedown"?r=d0e(n):(t==="keydown"||t==="keypress"||t==="keyup")&&(r=AQe(n)),ke(e,t,r,o)},PQe=function(e,t,n){const o=d0e(t);return OQe(e,o,n)};function OQe(i,e,t){return ke(i,Kd&&iG.pointerEvents?et.POINTER_DOWN:et.MOUSE_DOWN,e,t)}let KA,Bc;class W6{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){en(e)}}static sort(e,t){return t.priority-e.priority}}(function(){let i=[],e=null,t=!1,n=!1;const o=()=>{for(t=!1,e=i,i=[],n=!0;e.length>0;)e.sort(W6.sort),e.shift().execute();n=!1};Bc=(r,s=0)=>{const a=new W6(r,s);return i.push(a),t||(t=!0,requestAnimationFrame(o)),a},KA=(r,s)=>{if(n){const a=new W6(r,s);return e.push(a),a}else return Bc(r,s)}})();function Q4(i){return i.ownerDocument.defaultView.getComputedStyle(i,null)}function vS(i){var e;const t=i.ownerDocument,n=(e=t.defaultView)===null||e===void 0?void 0:e.window;if(i!==t.body)return new jn(i.clientWidth,i.clientHeight);if(Kd&&(n==null?void 0:n.visualViewport))return new jn(n.visualViewport.width,n.visualViewport.height);if((n==null?void 0:n.innerWidth)&&n.innerHeight)return new jn(n.innerWidth,n.innerHeight);if(t.body&&t.body.clientWidth&&t.body.clientHeight)return new jn(t.body.clientWidth,t.body.clientHeight);if(t.documentElement&&t.documentElement.clientWidth&&t.documentElement.clientHeight)return new jn(t.documentElement.clientWidth,t.documentElement.clientHeight);throw new Error("Unable to figure out browser width and height")}class wo{static convertToPixels(e,t){return parseFloat(t)||0}static getDimension(e,t,n){const o=Q4(e),r=o?o.getPropertyValue(t):"0";return wo.convertToPixels(e,r)}static getBorderLeftWidth(e){return wo.getDimension(e,"border-left-width","borderLeftWidth")}static getBorderRightWidth(e){return wo.getDimension(e,"border-right-width","borderRightWidth")}static getBorderTopWidth(e){return wo.getDimension(e,"border-top-width","borderTopWidth")}static getBorderBottomWidth(e){return wo.getDimension(e,"border-bottom-width","borderBottomWidth")}static getPaddingLeft(e){return wo.getDimension(e,"padding-left","paddingLeft")}static getPaddingRight(e){return wo.getDimension(e,"padding-right","paddingRight")}static getPaddingTop(e){return wo.getDimension(e,"padding-top","paddingTop")}static getPaddingBottom(e){return wo.getDimension(e,"padding-bottom","paddingBottom")}static getMarginLeft(e){return wo.getDimension(e,"margin-left","marginLeft")}static getMarginTop(e){return wo.getDimension(e,"margin-top","marginTop")}static getMarginRight(e){return wo.getDimension(e,"margin-right","marginRight")}static getMarginBottom(e){return wo.getDimension(e,"margin-bottom","marginBottom")}}class jn{constructor(e,t){this.width=e,this.height=t}with(e=this.width,t=this.height){return e!==this.width||t!==this.height?new jn(e,t):this}static is(e){return typeof e=="object"&&typeof e.height=="number"&&typeof e.width=="number"}static lift(e){return e instanceof jn?e:new jn(e.width,e.height)}static equals(e,t){return e===t?!0:!e||!t?!1:e.width===t.width&&e.height===t.height}}jn.None=new jn(0,0);function h0e(i){let e=i.offsetParent,t=i.offsetTop,n=i.offsetLeft;for(;(i=i.parentNode)!==null&&i!==i.ownerDocument.body&&i!==i.ownerDocument.documentElement;){t-=i.scrollTop;const o=f0e(i)?null:Q4(i);o&&(n-=o.direction!=="rtl"?i.scrollLeft:-i.scrollLeft),i===e&&(n+=wo.getBorderLeftWidth(i),t+=wo.getBorderTopWidth(i),t+=i.offsetTop,n+=i.offsetLeft,e=i.offsetParent)}return{left:n,top:t}}function FQe(i,e,t){typeof e=="number"&&(i.style.width=`${e}px`),typeof t=="number"&&(i.style.height=`${t}px`)}function Yo(i){var e,t,n,o;const r=i.getBoundingClientRect();return{left:r.left+((t=(e=i.ownerDocument.defaultView)===null||e===void 0?void 0:e.scrollX)!==null&&t!==void 0?t:0),top:r.top+((o=(n=i.ownerDocument.defaultView)===null||n===void 0?void 0:n.scrollY)!==null&&o!==void 0?o:0),width:r.width,height:r.height}}function BQe(i){let e=i,t=1;do{const n=Q4(e).zoom;n!=null&&n!=="1"&&(t*=n),e=e.parentElement}while(e!==null&&e!==e.ownerDocument.documentElement);return t}function Ea(i){const e=wo.getMarginLeft(i)+wo.getMarginRight(i);return i.offsetWidth+e}function V6(i){const e=wo.getBorderLeftWidth(i)+wo.getBorderRightWidth(i),t=wo.getPaddingLeft(i)+wo.getPaddingRight(i);return i.offsetWidth-e-t}function WQe(i){const e=wo.getBorderTopWidth(i)+wo.getBorderBottomWidth(i),t=wo.getPaddingTop(i)+wo.getPaddingBottom(i);return i.offsetHeight-e-t}function u0(i){const e=wo.getMarginTop(i)+wo.getMarginBottom(i);return i.offsetHeight+e}function rs(i,e){for(;i;){if(i===e)return!0;i=i.parentNode}return!1}function VQe(i,e,t){for(;i&&i.nodeType===i.ELEMENT_NODE;){if(i.classList.contains(e))return i;if(t){if(typeof t=="string"){if(i.classList.contains(t))return null}else if(i===t)return null}i=i.parentNode}return null}function H6(i,e,t){return!!VQe(i,e,t)}function f0e(i){return i&&!!i.host&&!!i.mode}function qA(i){return!!eb(i)}function eb(i){for(var e;i.parentNode;){if(i===((e=i.ownerDocument)===null||e===void 0?void 0:e.body))return null;i=i.parentNode}return f0e(i)?i:null}function Nu(){let i=J4().activeElement;for(;i!=null&&i.shadowRoot;)i=i.shadowRoot.activeElement;return i}function J4(){var i;return(i=[document,...RQe().map(t=>t.document)].find(t=>t.hasFocus()))!==null&&i!==void 0?i:document}function Wc(i=document.getElementsByTagName("head")[0],e){const t=document.createElement("style");return t.type="text/css",t.media="screen",e==null||e(t),i.appendChild(t),t}let $6=null;function g0e(){return $6||($6=Wc()),$6}function HQe(i){var e,t;return!((e=i==null?void 0:i.sheet)===null||e===void 0)&&e.rules?i.sheet.rules:!((t=i==null?void 0:i.sheet)===null||t===void 0)&&t.cssRules?i.sheet.cssRules:[]}function GV(i,e,t=g0e()){!t||!e||t.sheet.insertRule(i+"{"+e+"}",0)}function Ioe(i,e=g0e()){if(!e)return;const t=HQe(e),n=[];for(let o=0;o=0;o--)e.sheet.deleteRule(n[o])}function rG(i){return typeof HTMLElement=="object"?i instanceof HTMLElement:i&&typeof i=="object"&&i.nodeType===1&&typeof i.nodeName=="string"}const et={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",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:L0?"webkitAnimationStart":"animationstart",ANIMATION_END:L0?"webkitAnimationEnd":"animationend",ANIMATION_ITERATION:L0?"webkitAnimationIteration":"animationiteration"};function $Qe(i){const e=i;return!!(e&&typeof e.preventDefault=="function"&&typeof e.stopPropagation=="function")}const dn={stop:(i,e)=>(i.preventDefault(),e&&i.stopPropagation(),i)};function zQe(i){const e=[];for(let t=0;i&&i.nodeType===i.ELEMENT_NODE;t++)e[t]=i.scrollTop,i=i.parentNode;return e}function UQe(i,e){for(let t=0;i&&i.nodeType===i.ELEMENT_NODE;t++)i.scrollTop!==e[t]&&(i.scrollTop=e[t]),i=i.parentNode}class GA extends _e{static hasFocusWithin(e){if(rG(e)){const t=eb(e),n=t?t.activeElement:e.ownerDocument.activeElement;return rs(n,e)}else return rs(window.document.activeElement,window.document)}constructor(e){super(),this._onDidFocus=this._register(new le),this.onDidFocus=this._onDidFocus.event,this._onDidBlur=this._register(new le),this.onDidBlur=this._onDidBlur.event;let t=GA.hasFocusWithin(e),n=!1;const o=()=>{n=!1,t||(t=!0,this._onDidFocus.fire())},r=()=>{t&&(n=!0,window.setTimeout(()=>{n&&(n=!1,t=!1,this._onDidBlur.fire())},0))};this._refreshStateHandler=()=>{GA.hasFocusWithin(e)!==t&&(t?r():o())},this._register(ke(e,et.FOCUS,o,!0)),this._register(ke(e,et.BLUR,r,!0)),e instanceof HTMLElement&&(this._register(ke(e,et.FOCUS_IN,()=>this._refreshStateHandler())),this._register(ke(e,et.FOCUS_OUT,()=>this._refreshStateHandler())))}}function pf(i){return new GA(i)}function Ae(i,...e){if(i.append(...e),e.length===1&&typeof e[0]!="string")return e[0]}function p0e(i,e){return i.insertBefore(e,i.firstChild),e}function jr(i,...e){i.innerText="",Ae(i,...e)}const jQe=/([\w\-]+)?(#([\w\-]+))?((\.([\w\-]+))*)/;var BD;(function(i){i.HTML="http://www.w3.org/1999/xhtml",i.SVG="http://www.w3.org/2000/svg"})(BD||(BD={}));function m0e(i,e,t,...n){const o=jQe.exec(e);if(!o)throw new Error("Bad use of emmet");const r=o[1]||"div";let s;return i!==BD.HTML?s=document.createElementNS(i,r):s=document.createElement(r),o[3]&&(s.id=o[3]),o[4]&&(s.className=o[4].replace(/\./g," ").trim()),t&&Object.entries(t).forEach(([a,l])=>{typeof l!="undefined"&&(/^on\w+$/.test(a)?s[a]=l:a==="selected"?l&&s.setAttribute(a,"true"):s.setAttribute(a,l))}),s.append(...n),s}function He(i,e,...t){return m0e(BD.HTML,i,e,...t)}He.SVG=function(i,e,...t){return m0e(BD.SVG,i,e,...t)};function KQe(i,...e){i?nl(...e):Js(...e)}function nl(...i){for(const e of i)e.style.display="",e.removeAttribute("aria-hidden")}function Js(...i){for(const e of i)e.style.display="none",e.setAttribute("aria-hidden","true")}function Toe(i){const e=window.devicePixelRatio*i;return Math.max(1,Math.floor(e))/window.devicePixelRatio}function v0e(i){window.open(i,"_blank","noopener")}function qQe(i){const e=()=>{i(),t=Bc(e)};let t=Bc(e);return zt(()=>t.dispose())}c0e.setPreferredWebSchema(/^https:/.test(window.location.href)?"https":"http");function yv(i){return i?`url('${u0e.uriToBrowserUri(i).toString(!0).replace(/'/g,"%27")}')`:"url('')"}function Noe(i){return`'${i.replace(/'/g,"%27")}'`}function D0(i,e){if(i!==void 0){const t=i.match(/^\s*var\((.+)\)$/);if(t){const n=t[1].split(",",2);return n.length===2&&(e=D0(n[1].trim(),e)),`var(${n[0]}, ${e})`}return i}return e}function GQe(i,e=!1){const t=document.createElement("a");return a0e("afterSanitizeAttributes",n=>{for(const o of["href","src"])if(n.hasAttribute(o)){const r=n.getAttribute(o);if(o==="href"&&r.startsWith("#"))continue;if(t.href=r,!i.includes(t.protocol.replace(/:$/,""))){if(e&&o==="src"&&t.href.startsWith("data:"))continue;n.removeAttribute(o)}}}),zt(()=>{l0e("afterSanitizeAttributes")})}const XQe=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","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"]);Object.freeze({ALLOWED_TAGS:["a","button","blockquote","code","div","h1","h2","h3","h4","h5","h6","hr","input","label","li","p","pre","select","small","span","strong","textarea","ul","ol"],ALLOWED_ATTR:["href","data-href","data-command","target","title","name","src","alt","class","id","role","tabindex","style","data-code","width","height","align","x-dispatch","required","checked","placeholder","type","start"],RETURN_DOM:!1,RETURN_DOM_FRAGMENT:!1,RETURN_TRUSTED_TYPE:!0});class Rg extends le{constructor(){super(),this._subscriptions=new Be,this._keyStatus={altKey:!1,shiftKey:!1,ctrlKey:!1,metaKey:!1},this._subscriptions.add(ke(window,"keydown",e=>{if(e.defaultPrevented)return;const t=new Pi(e);if(!(t.keyCode===6&&e.repeat)){if(e.altKey&&!this._keyStatus.altKey)this._keyStatus.lastKeyPressed="alt";else if(e.ctrlKey&&!this._keyStatus.ctrlKey)this._keyStatus.lastKeyPressed="ctrl";else if(e.metaKey&&!this._keyStatus.metaKey)this._keyStatus.lastKeyPressed="meta";else if(e.shiftKey&&!this._keyStatus.shiftKey)this._keyStatus.lastKeyPressed="shift";else if(t.keyCode!==6)this._keyStatus.lastKeyPressed=void 0;else return;this._keyStatus.altKey=e.altKey,this._keyStatus.ctrlKey=e.ctrlKey,this._keyStatus.metaKey=e.metaKey,this._keyStatus.shiftKey=e.shiftKey,this._keyStatus.lastKeyPressed&&(this._keyStatus.event=e,this.fire(this._keyStatus))}},!0)),this._subscriptions.add(ke(window,"keyup",e=>{e.defaultPrevented||(!e.altKey&&this._keyStatus.altKey?this._keyStatus.lastKeyReleased="alt":!e.ctrlKey&&this._keyStatus.ctrlKey?this._keyStatus.lastKeyReleased="ctrl":!e.metaKey&&this._keyStatus.metaKey?this._keyStatus.lastKeyReleased="meta":!e.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=e.altKey,this._keyStatus.ctrlKey=e.ctrlKey,this._keyStatus.metaKey=e.metaKey,this._keyStatus.shiftKey=e.shiftKey,this._keyStatus.lastKeyReleased&&(this._keyStatus.event=e,this.fire(this._keyStatus)))},!0)),this._subscriptions.add(ke(document.body,"mousedown",()=>{this._keyStatus.lastKeyPressed=void 0},!0)),this._subscriptions.add(ke(document.body,"mouseup",()=>{this._keyStatus.lastKeyPressed=void 0},!0)),this._subscriptions.add(ke(document.body,"mousemove",e=>{e.buttons&&(this._keyStatus.lastKeyPressed=void 0)},!0)),this._subscriptions.add(ke(window,"blur",()=>{this.resetKeyStatus()}))}get keyStatus(){return this._keyStatus}resetKeyStatus(){this.doResetKeyStatus(),this.fire(this._keyStatus)}doResetKeyStatus(){this._keyStatus={altKey:!1,shiftKey:!1,ctrlKey:!1,metaKey:!1}}static getInstance(){return Rg.instance||(Rg.instance=new Rg),Rg.instance}dispose(){super.dispose(),this._subscriptions.dispose()}}class YQe extends _e{constructor(e,t){super(),this.element=e,this.callbacks=t,this.counter=0,this.dragStartTime=0,this.registerListeners()}registerListeners(){this._register(ke(this.element,et.DRAG_ENTER,e=>{this.counter++,this.dragStartTime=e.timeStamp,this.callbacks.onDragEnter(e)})),this._register(ke(this.element,et.DRAG_OVER,e=>{var t,n;e.preventDefault(),(n=(t=this.callbacks).onDragOver)===null||n===void 0||n.call(t,e,e.timeStamp-this.dragStartTime)})),this._register(ke(this.element,et.DRAG_LEAVE,e=>{this.counter--,this.counter===0&&(this.dragStartTime=0,this.callbacks.onDragLeave(e))})),this._register(ke(this.element,et.DRAG_END,e=>{this.counter=0,this.dragStartTime=0,this.callbacks.onDragEnd(e)})),this._register(ke(this.element,et.DROP,e=>{this.counter=0,this.dragStartTime=0,this.callbacks.onDrop(e)}))}}const ZQe=/(?[\w\-]+)?(?:#(?[\w\-]+))?(?(?:\.(?:[\w\-]+))*)(?:@(?(?:[\w\_])+))?/;function Or(i,...e){let t,n;Array.isArray(e[0])?(t={},n=e[0]):(t=e[0]||{},n=e[1]);const o=ZQe.exec(i);if(!o||!o.groups)throw new Error("Bad use of h");const r=o.groups.tag||"div",s=document.createElement(r);o.groups.id&&(s.id=o.groups.id);const a=[];if(o.groups.class)for(const c of o.groups.class.split("."))c!==""&&a.push(c);if(t.className!==void 0)for(const c of t.className.split("."))c!==""&&a.push(c);a.length>0&&(s.className=a.join(" "));const l={};if(o.groups.name&&(l[o.groups.name]=s),n)for(const c of n)c instanceof HTMLElement?s.appendChild(c):typeof c=="string"?s.append(c):"root"in c&&(Object.assign(l,c),s.appendChild(c.root));for(const[c,u]of Object.entries(t))if(c!=="className")if(c==="style")for(const[d,h]of Object.entries(u))s.style.setProperty(Roe(d),typeof h=="number"?h+"px":""+h);else c==="tabIndex"?s.tabIndex=u:s.setAttribute(Roe(c),u.toString());return l.root=s,l}function Roe(i){return i.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}class e5{constructor(e){this.id=e.id,this.precondition=e.precondition,this._kbOpts=e.kbOpts,this._menuOpts=e.menuOpts,this._description=e.description}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 n=t.kbExpr;this.precondition&&(n?n=Me.and(n,this.precondition):n=this.precondition);const o={id:this.id,weight:t.weight,args:t.args,when:n,primary:t.primary,secondary:t.secondary,win:t.win,linux:t.linux,mac:t.mac};Va.registerKeybindingRule(o)}}Rn.registerCommand({id:this.id,handler:(e,t)=>this.runCommand(e,t),description:this._description})}_registerMenuItem(e){Hr.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 _S extends e5{constructor(){super(...arguments),this._implementations=[]}addImplementation(e,t,n,o){return this._implementations.push({priority:e,name:t,implementation:n,when:o}),this._implementations.sort((r,s)=>s.priority-r.priority),{dispose:()=>{for(let r=0;r{if(!!a.get(Ut).contextMatchesRules(n!=null?n:void 0))return o(a,s,t)})}runCommand(e,t){return Ir.runEditorCommand(e,t,this.precondition,(n,o,r)=>this.runEditorCommand(n,o,r))}}class ft extends Ir{static convertOptions(e){let t;Array.isArray(e.menuOpts)?t=e.menuOpts:e.menuOpts?t=[e.menuOpts]:t=[];function n(o){return o.menuId||(o.menuId=Z.EditorContext),o.title||(o.title=e.label),o.when=Me.and(e.precondition,o.when),o}return Array.isArray(e.contextMenuOpts)?t.push(...e.contextMenuOpts.map(n)):e.contextMenuOpts&&t.push(n(e.contextMenuOpts)),e.menuOpts=t,e}constructor(e){super(ft.convertOptions(e)),this.label=e.label,this.alias=e.alias}runEditorCommand(e,t,n){return this.reportTelemetry(e,t),this.run(e,t,n||{})}reportTelemetry(e,t){e.get(tc).publicLog2("editorActionInvoked",{name:this.label,id:this.id})}}class b0e extends ft{constructor(){super(...arguments),this._implementations=[]}addImplementation(e,t){return this._implementations.push([e,t]),this._implementations.sort((n,o)=>o[0]-n[0]),{dispose:()=>{for(let n=0;n{var s,a;const l=r.get(Ut),c=r.get(nc);if(!l.contextMatchesRules((s=this.desc.precondition)!==null&&s!==void 0?s:void 0)){c.debug("[EditorAction2] NOT running command because its precondition is FALSE",this.desc.id,(a=this.desc.precondition)===null||a===void 0?void 0:a.serialize());return}return this.runEditorCommand(r,o,...t)})}}function Nf(i,e){Rn.registerCommand(i,function(t,...n){const o=t.get($t),[r,s]=n;fi(Rt.isUri(r)),fi(ae.isIPosition(s));const a=t.get(Yi).getModel(r);if(a){const l=ae.lift(s);return o.invokeFunction(e,a,l,...n.slice(2))}return t.get(za).createModelReference(r).then(l=>new Promise((c,u)=>{try{const d=o.invokeFunction(e,l.object.textEditorModel,ae.lift(s),n.slice(2));c(d)}catch(d){u(d)}}).finally(()=>{l.dispose()}))})}function Ye(i){return Lc.INSTANCE.registerEditorCommand(i),i}function ze(i){const e=new i;return Lc.INSTANCE.registerEditorAction(e),e}function C0e(i){return Lc.INSTANCE.registerEditorAction(i),i}function QQe(i){Lc.INSTANCE.registerEditorAction(i)}function zn(i,e,t){Lc.INSTANCE.registerEditorContribution(i,e,t)}var vy;(function(i){function e(s){return Lc.INSTANCE.getEditorCommand(s)}i.getEditorCommand=e;function t(){return Lc.INSTANCE.getEditorActions()}i.getEditorActions=t;function n(){return Lc.INSTANCE.getEditorContributions()}i.getEditorContributions=n;function o(s){return Lc.INSTANCE.getEditorContributions().filter(a=>s.indexOf(a.id)>=0)}i.getSomeEditorContributions=o;function r(){return Lc.INSTANCE.getDiffEditorContributions()}i.getDiffEditorContributions=r})(vy||(vy={}));const JQe={EditorCommonContributions:"editor.contributions"};class Lc{constructor(){this.editorContributions=[],this.diffEditorContributions=[],this.editorActions=[],this.editorCommands=Object.create(null)}registerEditorContribution(e,t,n){this.editorContributions.push({id:e,ctor:t,instantiation:n})}getEditorContributions(){return this.editorContributions.slice(0)}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}}Lc.INSTANCE=new Lc;no.add(JQe.EditorCommonContributions,Lc.INSTANCE);function HI(i){return i.register(),i}const y0e=HI(new _S({id:"undo",precondition:void 0,kbOpts:{weight:0,primary:2104},menuOpts:[{menuId:Z.MenubarEditMenu,group:"1_do",title:C({key:"miUndo",comment:["&& denotes a mnemonic"]},"&&Undo"),order:1},{menuId:Z.CommandPalette,group:"",title:C("undo","Undo"),order:1}]}));HI(new _0e(y0e,{id:"default:undo",precondition:void 0}));const w0e=HI(new _S({id:"redo",precondition:void 0,kbOpts:{weight:0,primary:2103,secondary:[3128],mac:{primary:3128}},menuOpts:[{menuId:Z.MenubarEditMenu,group:"1_do",title:C({key:"miRedo",comment:["&& denotes a mnemonic"]},"&&Redo"),order:2},{menuId:Z.CommandPalette,group:"",title:C("redo","Redo"),order:1}]}));HI(new _0e(w0e,{id:"default:redo",precondition:void 0}));const eJe=HI(new _S({id:"editor.action.selectAll",precondition:void 0,kbOpts:{weight:0,kbExpr:null,primary:2079},menuOpts:[{menuId:Z.MenubarSelectionMenu,group:"1_basic",title:C({key:"miSelectAll",comment:["&& denotes a mnemonic"]},"&&Select All"),order:1},{menuId:Z.CommandPalette,group:"",title:C("selectAll","Select All"),order:1}]})),S0e=Symbol("MicrotaskDelay");var vc=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},vL=globalThis&&globalThis.__asyncValues||function(i){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=i[Symbol.asyncIterator],t;return e?e.call(i):(i=typeof __values=="function"?__values(i):i[Symbol.iterator](),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(r){t[r]=i[r]&&function(s){return new Promise(function(a,l){s=i[r](s),o(a,l,s.done,s.value)})}}function o(r,s,a,l){Promise.resolve(l).then(function(c){r({value:c,done:a})},s)}};function XV(i){return!!i&&typeof i.then=="function"}function sr(i){const e=new Ro,t=i(e.token),n=new Promise((o,r)=>{const s=e.token.onCancellationRequested(()=>{s.dispose(),e.dispose(),r(new Gv)});Promise.resolve(t).then(a=>{s.dispose(),e.dispose(),o(a)},a=>{s.dispose(),e.dispose(),r(a)})});return new class{cancel(){e.cancel()}then(o,r){return n.then(o,r)}catch(o){return this.then(void 0,o)}finally(o){return n.finally(o)}}}function t5(i,e,t){return new Promise((n,o)=>{const r=e.onCancellationRequested(()=>{r.dispose(),n(t)});i.then(n,o).finally(()=>r.dispose())})}class tJe{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 n=this.queue(this.queuedPromiseFactory);return this.queuedPromiseFactory=null,n};this.queuedPromise=new Promise(n=>{this.activePromise.then(t,t).then(n)})}return new Promise((t,n)=>{this.queuedPromise.then(t,n)})}return this.activePromise=e(),new Promise((t,n)=>{this.activePromise.then(o=>{this.activePromise=null,t(o)},o=>{this.activePromise=null,n(o)})})}dispose(){this.isDisposed=!0}}const nJe=(i,e)=>{let t=!0;const n=setTimeout(()=>{t=!1,e()},i);return{isTriggered:()=>t,dispose:()=>{clearTimeout(n),t=!1}}},iJe=i=>{let e=!0;return queueMicrotask(()=>{e&&(e=!1,i())}),{isTriggered:()=>e,dispose:()=>{e=!1}}};class Wu{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((o,r)=>{this.doResolve=o,this.doReject=r}).then(()=>{if(this.completionPromise=null,this.doResolve=null,this.task){const o=this.task;return this.task=null,o()}}));const n=()=>{var o;this.deferred=null,(o=this.doResolve)===null||o===void 0||o.call(this,null)};return this.deferred=t===S0e?iJe(n):nJe(t,n),this.completionPromise}isTriggered(){var e;return!!(!((e=this.deferred)===null||e===void 0)&&e.isTriggered())}cancel(){var e;this.cancelTimeout(),this.completionPromise&&((e=this.doReject)===null||e===void 0||e.call(this,new Gv),this.completionPromise=null)}cancelTimeout(){var e;(e=this.deferred)===null||e===void 0||e.dispose(),this.deferred=null}dispose(){this.cancel()}}class x0e{constructor(e){this.delayer=new Wu(e),this.throttler=new tJe}trigger(e,t){return this.delayer.trigger(()=>this.throttler.queue(e),t)}cancel(){this.delayer.cancel()}dispose(){this.delayer.dispose(),this.throttler.dispose()}}function wv(i,e){return e?new Promise((t,n)=>{const o=setTimeout(()=>{r.dispose(),t()},i),r=e.onCancellationRequested(()=>{clearTimeout(o),r.dispose(),n(new Gv)})}):sr(t=>wv(i,t))}function Sv(i,e=0,t){const n=setTimeout(()=>{i(),t&&o.dispose()},e),o=zt(()=>{clearTimeout(n),t==null||t.deleteAndLeak(o)});return t==null||t.add(o),o}function L0e(i,e=n=>!!n,t=null){let n=0;const o=i.length,r=()=>{if(n>=o)return Promise.resolve(t);const s=i[n++];return Promise.resolve(s()).then(l=>e(l)?Promise.resolve(l):r())};return r()}class zu{constructor(e,t){this._token=-1,typeof e=="function"&&typeof t=="number"&&this.setIfNotSet(e,t)}dispose(){this.cancel()}cancel(){this._token!==-1&&(clearTimeout(this._token),this._token=-1)}cancelAndSet(e,t){this.cancel(),this._token=setTimeout(()=>{this._token=-1,e()},t)}setIfNotSet(e,t){this._token===-1&&(this._token=setTimeout(()=>{this._token=-1,e()},t))}}class $I{constructor(){this._token=-1}dispose(){this.cancel()}cancel(){this._token!==-1&&(clearInterval(this._token),this._token=-1)}cancelAndSet(e,t){this.cancel(),this._token=setInterval(()=>{e()},t)}}class bi{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}onTimeout(){this.timeoutToken=-1,this.runner&&this.doRun()}doRun(){var e;(e=this.runner)===null||e===void 0||e.call(this)}}let Mg;(function(){typeof requestIdleCallback!="function"||typeof cancelIdleCallback!="function"?Mg=i=>{m_e(()=>{if(e)return;const t=Date.now()+15;i(Object.freeze({didTimeout:!0,timeRemaining(){return Math.max(0,t-Date.now())}}))});let e=!1;return{dispose(){e||(e=!0)}}}:Mg=(i,e)=>{const t=requestIdleCallback(i,typeof e=="number"?{timeout:e}:void 0);let n=!1;return{dispose(){n||(n=!0,cancelIdleCallback(t))}}}})();class nM{constructor(e){this._didRun=!1,this._executor=()=>{try{this._value=e()}catch(t){this._error=t}finally{this._didRun=!0}},this._handle=Mg(()=>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 n5{get isRejected(){var e;return((e=this.outcome)===null||e===void 0?void 0:e.outcome)===1}get isSettled(){return!!this.outcome}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:0,value:e},t()})}error(e){return new Promise(t=>{this.errorCallback(e),this.outcome={outcome:1,value:e},t()})}cancel(){return this.error(new Gv)}}var YV;(function(i){function e(n){return vc(this,void 0,void 0,function*(){let o;const r=yield Promise.all(n.map(s=>s.then(a=>a,a=>{o||(o=a)})));if(typeof o!="undefined")throw o;return r})}i.settled=e;function t(n){return new Promise((o,r)=>vc(this,void 0,void 0,function*(){try{yield n(o,r)}catch(s){r(s)}}))}i.withAsyncBody=t})(YV||(YV={}));class Wo{static fromArray(e){return new Wo(t=>{t.emitMany(e)})}static fromPromise(e){return new Wo(t=>vc(this,void 0,void 0,function*(){t.emitMany(yield e)}))}static fromPromises(e){return new Wo(t=>vc(this,void 0,void 0,function*(){yield Promise.all(e.map(n=>vc(this,void 0,void 0,function*(){return t.emitOne(yield n)})))}))}static merge(e){return new Wo(t=>vc(this,void 0,void 0,function*(){yield Promise.all(e.map(n=>{var o,r,s;return vc(this,void 0,void 0,function*(){var a,l,c,u;try{for(o=!0,r=vL(n);s=yield r.next(),a=s.done,!a;o=!0){u=s.value,o=!1;const d=u;t.emitOne(d)}}catch(d){l={error:d}}finally{try{!o&&!a&&(c=r.return)&&(yield c.call(r))}finally{if(l)throw l.error}}})}))}))}constructor(e){this._state=0,this._results=[],this._error=null,this._onStateChanged=new le,queueMicrotask(()=>vc(this,void 0,void 0,function*(){const t={emitOne:n=>this.emitOne(n),emitMany:n=>this.emitMany(n),reject:n=>this.reject(n)};try{yield Promise.resolve(e(t)),this.resolve()}catch(n){this.reject(n)}finally{t.emitOne=void 0,t.emitMany=void 0,t.reject=void 0}}))}[Symbol.asyncIterator](){let e=0;return{next:()=>vc(this,void 0,void 0,function*(){do{if(this._state===2)throw this._error;if(evc(this,void 0,void 0,function*(){var o,r,s,a;try{for(var l=!0,c=vL(e),u;u=yield c.next(),o=u.done,!o;l=!0){a=u.value,l=!1;const d=a;n.emitOne(t(d))}}catch(d){r={error:d}}finally{try{!l&&!o&&(s=c.return)&&(yield s.call(c))}finally{if(r)throw r.error}}}))}map(e){return Wo.map(this,e)}static filter(e,t){return new Wo(n=>vc(this,void 0,void 0,function*(){var o,r,s,a;try{for(var l=!0,c=vL(e),u;u=yield c.next(),o=u.done,!o;l=!0){a=u.value,l=!1;const d=a;t(d)&&n.emitOne(d)}}catch(d){r={error:d}}finally{try{!l&&!o&&(s=c.return)&&(yield s.call(c))}finally{if(r)throw r.error}}}))}filter(e){return Wo.filter(this,e)}static coalesce(e){return Wo.filter(e,t=>!!t)}coalesce(){return Wo.coalesce(this)}static toPromise(e){var t,n,o,r,s,a,l;return vc(this,void 0,void 0,function*(){const c=[];try{for(t=!0,n=vL(e);o=yield n.next(),r=o.done,!r;t=!0){l=o.value,t=!1;const u=l;c.push(u)}}catch(u){s={error:u}}finally{try{!t&&!r&&(a=n.return)&&(yield a.call(n))}finally{if(s)throw s.error}}return c})}toPromise(){return Wo.toPromise(this)}emitOne(e){this._state===0&&(this._results.push(e),this._onStateChanged.fire())}emitMany(e){this._state===0&&(this._results=this._results.concat(e),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(e){this._state===0&&(this._state=2,this._error=e,this._onStateChanged.fire())}}Wo.EMPTY=Wo.fromArray([]);class oJe extends Wo{constructor(e,t){super(t),this._source=e}cancel(){this._source.cancel()}}function rJe(i){const e=new Ro,t=i(e.token);return new oJe(e,n=>vc(this,void 0,void 0,function*(){var o,r,s,a;const l=e.token.onCancellationRequested(()=>{l.dispose(),e.dispose(),n.reject(new Gv)});try{try{for(var c=!0,u=vL(t),d;d=yield u.next(),o=d.done,!o;c=!0){a=d.value,c=!1;const h=a;if(e.token.isCancellationRequested)return;n.emitOne(h)}}catch(h){r={error:h}}finally{try{!c&&!o&&(s=u.return)&&(yield s.call(u))}finally{if(r)throw r.error}}l.dispose(),e.dispose()}catch(h){l.dispose(),e.dispose(),n.reject(h)}}))}const sJe="$initialize";let Moe=!1;function ZV(i){!qv||(Moe||(Moe=!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(i.message))}class aJe{constructor(e,t,n,o){this.vsWorker=e,this.req=t,this.method=n,this.args=o,this.type=0}}class Aoe{constructor(e,t,n,o){this.vsWorker=e,this.seq=t,this.res=n,this.err=o,this.type=1}}class lJe{constructor(e,t,n,o){this.vsWorker=e,this.req=t,this.eventName=n,this.arg=o,this.type=2}}class cJe{constructor(e,t,n){this.vsWorker=e,this.req=t,this.event=n,this.type=3}}class uJe{constructor(e,t){this.vsWorker=e,this.req=t,this.type=4}}class dJe{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 n=String(++this._lastSentReq);return new Promise((o,r)=>{this._pendingReplies[n]={resolve:o,reject:r},this._send(new aJe(this._workerId,n,e,t))})}listen(e,t){let n=null;const o=new le({onWillAddFirstListener:()=>{n=String(++this._lastSentReq),this._pendingEmitters.set(n,o),this._send(new lJe(this._workerId,n,e,t))},onDidRemoveLastListener:()=>{this._pendingEmitters.delete(n),this._send(new uJe(this._workerId,n)),n=null}});return o.event}handleMessage(e){!e||!e.vsWorker||this._workerId!==-1&&e.vsWorker!==this._workerId||this._handleMessage(e)}_handleMessage(e){switch(e.type){case 1:return this._handleReplyMessage(e);case 0:return this._handleRequestMessage(e);case 2:return this._handleSubscribeEventMessage(e);case 3:return this._handleEventMessage(e);case 4: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 n=e.err;e.err.$isError&&(n=new Error,n.name=e.err.name,n.message=e.err.message,n.stack=e.err.stack),t.reject(n);return}t.resolve(e.res)}_handleRequestMessage(e){const t=e.req;this._handler.handleMessage(e.method,e.args).then(o=>{this._send(new Aoe(this._workerId,t,o,void 0))},o=>{o.detail instanceof Error&&(o.detail=loe(o.detail)),this._send(new Aoe(this._workerId,t,void 0,loe(o)))})}_handleSubscribeEventMessage(e){const t=e.req,n=this._handler.handleEvent(e.eventName,e.arg)(o=>{this._send(new cJe(this._workerId,t,o))});this._pendingEvents.set(t,n)}_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===0)for(let n=0;n{this._protocol.handleMessage(u)},u=>{o==null||o(u)})),this._protocol=new dJe({sendMessage:(u,d)=>{this._worker.postMessage(u,d)},handleMessage:(u,d)=>{if(typeof n[u]!="function")return Promise.reject(new Error("Missing method "+u+" on main thread host."));try{return Promise.resolve(n[u].apply(n,d))}catch(h){return Promise.reject(h)}},handleEvent:(u,d)=>{if(D0e(u)){const h=n[u].call(n,d);if(typeof h!="function")throw new Error(`Missing dynamic event ${u} on main thread host.`);return h}if(E0e(u)){const h=n[u];if(typeof h!="function")throw new Error(`Missing event ${u} on main thread host.`);return h}throw new Error(`Malformed event name ${u}`)}}),this._protocol.setWorkerId(this._worker.getId());let r=null;const s=globalThis.require;typeof s!="undefined"&&typeof s.getConfig=="function"?r=s.getConfig():typeof globalThis.requirejs!="undefined"&&(r=globalThis.requirejs.s.contexts._.config);const a=Aq(n);this._onModuleLoaded=this._protocol.sendMessage(sJe,[this._worker.getId(),JSON.parse(JSON.stringify(r)),t,a]);const l=(u,d)=>this._request(u,d),c=(u,d)=>this._protocol.listen(u,d);this._lazyProxy=new Promise((u,d)=>{o=d,this._onModuleLoaded.then(h=>{u(fJe(h,l,c))},h=>{d(h),this._onError("Worker failed to load "+t,h)})})}getProxyObject(){return this._lazyProxy}_request(e,t){return new Promise((n,o)=>{this._onModuleLoaded.then(()=>{this._protocol.sendMessage(e,t).then(n,o)},o)})}_onError(e,t){console.error(e),console.info(t)}}function E0e(i){return i[0]==="o"&&i[1]==="n"&&kh(i.charCodeAt(2))}function D0e(i){return/^onDynamic/.test(i)&&kh(i.charCodeAt(9))}function fJe(i,e,t){const n=s=>function(){const a=Array.prototype.slice.call(arguments,0);return e(s,a)},o=s=>function(a){return t(s,a)},r={};for(const s of i){if(D0e(s)){r[s]=o(s);continue}if(E0e(s)){r[s]=t(s,void 0);continue}r[s]=n(s)}return r}function mp(i,e){var t;const n=globalThis.MonacoEnvironment;if(n!=null&&n.createTrustedTypesPolicy)try{return n.createTrustedTypesPolicy(i,e)}catch(o){en(o);return}try{return(t=window.trustedTypes)===null||t===void 0?void 0:t.createPolicy(i,e)}catch(o){en(o);return}}const Poe=mp("defaultWorkerFactory",{createScriptURL:i=>i});function gJe(i){const e=globalThis.MonacoEnvironment;if(e){if(typeof e.getWorker=="function")return e.getWorker("workerMain.js",i);if(typeof e.getWorkerUrl=="function"){const t=e.getWorkerUrl("workerMain.js",i);return new Worker(Poe?Poe.createScriptURL(t):t,{name:i})}}throw new Error("You must define a function MonacoEnvironment.getWorkerUrl or MonacoEnvironment.getWorker")}function pJe(i){return typeof i.then=="function"}class mJe{constructor(e,t,n,o,r){this.id=t,this.label=n;const s=gJe(n);pJe(s)?this.worker=s:this.worker=Promise.resolve(s),this.postMessage(e,[]),this.worker.then(a=>{a.onmessage=function(l){o(l.data)},a.onmessageerror=r,typeof a.addEventListener=="function"&&a.addEventListener("error",r)})}getId(){return this.id}postMessage(e,t){var n;(n=this.worker)===null||n===void 0||n.then(o=>{try{o.postMessage(e,t)}catch(r){en(r),en(new Error(`FAILED to post message to '${this.label}'-worker`,{cause:r}))}})}dispose(){var e;(e=this.worker)===null||e===void 0||e.then(t=>t.terminate()),this.worker=null}}class i5{constructor(e){this._label=e,this._webWorkerFailedBeforeError=!1}create(e,t,n){const o=++i5.LAST_WORKER_ID;if(this._webWorkerFailedBeforeError)throw this._webWorkerFailedBeforeError;return new mJe(e,o,this._label||"anonymous"+o,t,r=>{ZV(r),this._webWorkerFailedBeforeError=r,n(r)})}}i5.LAST_WORKER_ID=0;var Ho;(function(i){i[i.None=0]="None",i[i.Indent=1]="Indent",i[i.IndentOutdent=2]="IndentOutdent",i[i.Outdent=3]="Outdent"})(Ho||(Ho={}));class z6{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,n=e.notIn.length;t0&&i.getLanguageId(s-1)===o;)s--;return new _Je(i,o,s,r+1,i.getStartOffset(s),i.getEndOffset(r))}class _Je{constructor(e,t,n,o,r,s){this._scopedLineTokensBrand=void 0,this._actual=e,this.languageId=t,this._firstTokenIndex=n,this._lastTokenIndex=o,this.firstCharOffset=r,this._lastCharOffset=s}getLineContent(){return this._actual.getLineContent().substring(this.firstCharOffset,this._lastCharOffset)}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)}}function Ch(i){return(i&3)!==0}class vw{constructor(e){if(e.autoClosingPairs?this._autoClosingPairs=e.autoClosingPairs.map(t=>new z6(t)):e.brackets?this._autoClosingPairs=e.brackets.map(t=>new z6({open:t[0],close:t[1]})):this._autoClosingPairs=[],e.__electricCharacterSupport&&e.__electricCharacterSupport.docComment){const t=e.__electricCharacterSupport.docComment;this._autoClosingPairs.push(new z6({open:t.open,close:t.close||""}))}this._autoCloseBeforeForQuotes=typeof e.autoCloseBefore=="string"?e.autoCloseBefore:vw.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_QUOTES,this._autoCloseBeforeForBrackets=typeof e.autoCloseBefore=="string"?e.autoCloseBefore:vw.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}}vw.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_QUOTES=`;:.,=}])> + `;vw.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_BRACKETS=`'"\`;:.,=}])> + `;const Ooe=typeof Buffer!="undefined";new ah(()=>new Uint8Array(256));let U6;class r5{static wrap(e){return Ooe&&!Buffer.isBuffer(e)&&(e=Buffer.from(e.buffer,e.byteOffset,e.byteLength)),new r5(e)}constructor(e){this.buffer=e,this.byteLength=this.buffer.byteLength}toString(){return Ooe?this.buffer.toString():(U6||(U6=new TextDecoder),U6.decode(this.buffer))}}function bJe(i,e){return i[e+0]<<0>>>0|i[e+1]<<8>>>0}function CJe(i,e,t){i[t+0]=e&255,e=e>>>8,i[t+1]=e&255}function dd(i,e){return i[e]*Math.pow(2,24)+i[e+1]*Math.pow(2,16)+i[e+2]*Math.pow(2,8)+i[e+3]}function hd(i,e,t){i[t+3]=e,e=e>>>8,i[t+2]=e,e=e>>>8,i[t+1]=e,e=e>>>8,i[t]=e}function Foe(i,e){return i[e]}function Boe(i,e,t){i[t]=e}let j6;function k0e(){return j6||(j6=new TextDecoder("UTF-16LE")),j6}let K6;function yJe(){return K6||(K6=new TextDecoder("UTF-16BE")),K6}let q6;function I0e(){return q6||(q6=v_e()?k0e():yJe()),q6}function wJe(i,e,t){const n=new Uint16Array(i.buffer,e,t);return t>0&&(n[0]===65279||n[0]===65534)?SJe(i,e,t):k0e().decode(n)}function SJe(i,e,t){const n=[];let o=0;for(let r=0;r=this._capacity){this._flushBuffer(),this._completedStrings[this._completedStrings.length]=e;return}for(let n=0;n[s[0].toLowerCase(),s[1].toLowerCase()]);const t=[];for(let s=0;s{const[l,c]=s,[u,d]=a;return l===u||l===d||c===u||c===d},o=(s,a)=>{const l=Math.min(s,a),c=Math.max(s,a);for(let u=0;u0&&r.push({open:a,close:l})}return r}class LJe{constructor(e,t){this._richEditBracketsBrand=void 0;const n=xJe(t);this.brackets=n.map((o,r)=>new XA(e,r,o.open,o.close,EJe(o.open,o.close,n,r),DJe(o.open,o.close,n,r))),this.forwardRegex=kJe(this.brackets),this.reversedRegex=IJe(this.brackets),this.textIsBracket={},this.textIsOpenBracket={},this.maxBracketLength=0;for(const o of this.brackets){for(const r of o.open)this.textIsBracket[r]=o,this.textIsOpenBracket[r]=!0,this.maxBracketLength=Math.max(this.maxBracketLength,r.length);for(const r of o.close)this.textIsBracket[r]=o,this.textIsOpenBracket[r]=!1,this.maxBracketLength=Math.max(this.maxBracketLength,r.length)}}}function T0e(i,e,t,n){for(let o=0,r=e.length;o=0&&n.push(a);for(const a of s.close)a.indexOf(i)>=0&&n.push(a)}}function N0e(i,e){return i.length-e.length}function s5(i){if(i.length<=1)return i;const e=[],t=new Set;for(const n of i)t.has(n)||(e.push(n),t.add(n));return e}function EJe(i,e,t,n){let o=[];o=o.concat(i),o=o.concat(e);for(let r=0,s=o.length;r=0;s--)o[r++]=n.charCodeAt(s);return I0e().decode(o)}let e=null,t=null;return function(o){return e!==o&&(e=o,t=i(e)),t}}();class hu{static _findPrevBracketInText(e,t,n,o){const r=n.match(e);if(!r)return null;const s=n.length-(r.index||0),a=r[0].length,l=o+s;return new V(t,l-a+1,t,l+1)}static findPrevBracketInRange(e,t,n,o,r){const a=sG(n).substring(n.length-r,n.length-o);return this._findPrevBracketInText(e,t,a,o)}static findNextBracketInText(e,t,n,o){const r=n.match(e);if(!r)return null;const s=r.index||0,a=r[0].length;if(a===0)return null;const l=o+s;return new V(t,l+1,t,l+1+a)}static findNextBracketInRange(e,t,n,o,r){const s=n.substring(o,r);return this.findNextBracketInText(e,t,s,o)}}class NJe{constructor(e){this._richEditBrackets=e}getElectricCharacters(){const e=[];if(this._richEditBrackets)for(const t of this._richEditBrackets.brackets)for(const n of t.close){const o=n.charAt(n.length-1);e.push(o)}return vv(e)}onElectricCharacter(e,t,n){if(!this._richEditBrackets||this._richEditBrackets.brackets.length===0)return null;const o=t.findTokenIndexAtOffset(n-1);if(Ch(t.getStandardTokenType(o)))return null;const r=this._richEditBrackets.reversedRegex,s=t.getLineContent().substring(0,n-1)+e,a=hu.findPrevBracketInRange(r,1,s,0,s.length);if(!a)return null;const l=s.substring(a.startColumn-1,a.endColumn-1).toLowerCase();if(this._richEditBrackets.textIsOpenBracket[l])return null;const u=t.getActualLineContentBefore(a.startColumn-1);return/^\s*$/.test(u)?{matchOpenBracket:l}:null}}function s2(i){return i.global&&(i.lastIndex=0),!0}class RJe{constructor(e){this._indentationRules=e}shouldIncrease(e){return!!(this._indentationRules&&this._indentationRules.increaseIndentPattern&&s2(this._indentationRules.increaseIndentPattern)&&this._indentationRules.increaseIndentPattern.test(e))}shouldDecrease(e){return!!(this._indentationRules&&this._indentationRules.decreaseIndentPattern&&s2(this._indentationRules.decreaseIndentPattern)&&this._indentationRules.decreaseIndentPattern.test(e))}shouldIndentNextLine(e){return!!(this._indentationRules&&this._indentationRules.indentNextLinePattern&&s2(this._indentationRules.indentNextLinePattern)&&this._indentationRules.indentNextLinePattern.test(e))}shouldIgnore(e){return!!(this._indentationRules&&this._indentationRules.unIndentedLinePattern&&s2(this._indentationRules.unIndentedLinePattern)&&this._indentationRules.unIndentedLinePattern.test(e))}getIndentMetadata(e){let t=0;return this.shouldIncrease(e)&&(t+=1),this.shouldDecrease(e)&&(t+=2),this.shouldIndentNextLine(e)&&(t+=4),this.shouldIgnore(e)&&(t+=8),t}}class TC{constructor(e){e=e||{},e.brackets=e.brackets||[["(",")"],["{","}"],["[","]"]],this._brackets=[],e.brackets.forEach(t=>{const n=TC._createOpenBracketRegExp(t[0]),o=TC._createCloseBracketRegExp(t[1]);n&&o&&this._brackets.push({open:t[0],openRegExp:n,close:t[1],closeRegExp:o})}),this._regExpRules=e.onEnterRules||[]}onEnter(e,t,n,o){if(e>=3)for(let r=0,s=this._regExpRules.length;rc.reg?(c.reg.lastIndex=0,c.reg.test(c.text)):!0))return a.action}if(e>=2&&n.length>0&&o.length>0)for(let r=0,s=this._brackets.length;r=2&&n.length>0){for(let r=0,s=this._brackets.length;r0&&i.charAt(i.length-1)==="#"?i.substring(0,i.length-1):i}class OJe{constructor(){this._onDidChangeSchema=new le,this.schemasById={}}registerSchema(e,t){this.schemasById[PJe(e)]=t,this._onDidChangeSchema.fire(e)}notifySchemaChanged(e){this._onDidChangeSchema.fire(e)}}const FJe=new OJe;no.add(l5.JSONContribution,FJe);const ch={Configuration:"base.contributions.configuration"},Rx="vscode://schemas/settings/resourceLanguage",Hoe=no.as(l5.JSONContribution);class BJe{constructor(){this.overrideIdentifiers=new Set,this._onDidSchemaChange=new le,this._onDidUpdateConfiguration=new le,this.configurationDefaultsOverrides=new Map,this.defaultLanguageConfigurationOverridesNode={id:"defaultOverrides",title:C("defaultLanguageConfigurationOverrides.title","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={},Hoe.registerSchema(Rx,this.resourceLanguageSettingsSchema),this.registerOverridePropertyPatternKey()}registerConfiguration(e,t=!0){this.registerConfigurations([e],t)}registerConfigurations(e,t=!0){const n=new Set;this.doRegisterConfigurations(e,t,n),Hoe.registerSchema(Rx,this.resourceLanguageSettingsSchema),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:n})}registerDefaultConfigurations(e){const t=new Set;this.doRegisterDefaultConfigurations(e,t),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:t,defaultsOverrides:!0})}doRegisterDefaultConfigurations(e,t){var n;const o=[];for(const{overrides:r,source:s}of e)for(const a in r)if(t.add(a),xv.test(a)){const l=this.configurationDefaultsOverrides.get(a),c=(n=l==null?void 0:l.valuesSources)!==null&&n!==void 0?n:new Map;if(s)for(const f of Object.keys(r[a]))c.set(f,s);const u=Object.assign(Object.assign({},(l==null?void 0:l.value)||{}),r[a]);this.configurationDefaultsOverrides.set(a,{source:s,value:u,valuesSources:c});const d=AJe(a),h={type:"object",default:u,description:C("defaultLanguageConfiguration.description","Configure settings to be overridden for the {0} language.",d),$ref:Rx,defaultDefaultValue:u,source:la(s)?void 0:s,defaultValueSource:s};o.push(...YA(a)),this.configurationProperties[a]=h,this.defaultLanguageConfigurationOverridesNode.properties[a]=h}else{this.configurationDefaultsOverrides.set(a,{value:r[a],source:s});const l=this.configurationProperties[a];l&&(this.updatePropertyDefaultValue(a,l),this.updateSchema(a,l))}this.doRegisterOverrideIdentifiers(o)}registerOverrideIdentifiers(e){this.doRegisterOverrideIdentifiers(e),this._onDidSchemaChange.fire()}doRegisterOverrideIdentifiers(e){for(const t of e)this.overrideIdentifiers.add(t);this.updateOverridePropertyPatternKey()}doRegisterConfigurations(e,t,n){e.forEach(o=>{this.validateAndRegisterProperties(o,t,o.extensionInfo,o.restrictedProperties,void 0,n),this.configurationContributors.push(o),this.registerJSONConfiguration(o)})}validateAndRegisterProperties(e,t=!0,n,o,r=3,s){var a;r=Al(e.scope)?r:e.scope;const l=e.properties;if(l)for(const u in l){const d=l[u];if(t&&HJe(u,d)){delete l[u];continue}if(d.source=n,d.defaultDefaultValue=l[u].default,this.updatePropertyDefaultValue(u,d),xv.test(u)?d.scope=void 0:(d.scope=Al(d.scope)?r:d.scope,d.restricted=Al(d.restricted)?!!(o!=null&&o.includes(u)):d.restricted),l[u].hasOwnProperty("included")&&!l[u].included){this.excludedConfigurationProperties[u]=l[u],delete l[u];continue}else this.configurationProperties[u]=l[u],!((a=l[u].policy)===null||a===void 0)&&a.name&&this.policyConfigurations.set(l[u].policy.name,u);!l[u].deprecationMessage&&l[u].markdownDeprecationMessage&&(l[u].deprecationMessage=l[u].markdownDeprecationMessage),s.add(u)}const c=e.allOf;if(c)for(const u of c)this.validateAndRegisterProperties(u,t,n,o,r,s)}getConfigurationProperties(){return this.configurationProperties}getPolicyConfigurations(){return this.policyConfigurations}registerJSONConfiguration(e){const t=n=>{const o=n.properties;if(o)for(const s in o)this.updateSchema(s,o[s]);const r=n.allOf;r==null||r.forEach(t)};t(e)}updateSchema(e,t){switch(t.scope){case 1:break;case 2:break;case 6:break;case 3:break;case 4:break;case 5:this.resourceLanguageSettingsSchema.properties[e]=t;break}}updateOverridePropertyPatternKey(){for(const e of this.overrideIdentifiers.values()){const t=`[${e}]`,n={type:"object",description:C("overrideSettings.defaultDescription","Configure editor settings to be overridden for a language."),errorMessage:C("overrideSettings.errorMessage","This setting does not support per-language configuration."),$ref:Rx};this.updatePropertyDefaultValue(t,n)}}registerOverridePropertyPatternKey(){C("overrideSettings.defaultDescription","Configure editor settings to be overridden for a language."),C("overrideSettings.errorMessage","This setting does not support per-language configuration."),this._onDidSchemaChange.fire()}updatePropertyDefaultValue(e,t){const n=this.configurationDefaultsOverrides.get(e);let o=n==null?void 0:n.value,r=n==null?void 0:n.source;il(o)&&(o=t.defaultDefaultValue,r=void 0),il(o)&&(o=VJe(t.type)),t.default=o,t.defaultValueSource=r}}const P0e="\\[([^\\]]+)\\]",$oe=new RegExp(P0e,"g"),WJe=`^(${P0e})+$`,xv=new RegExp(WJe);function YA(i){const e=[];if(xv.test(i)){let t=$oe.exec(i);for(;t!=null&&t.length;){const n=t[1].trim();n&&e.push(n),t=$oe.exec(i)}}return vv(e)}function VJe(i){switch(Array.isArray(i)?i[0]:i){case"boolean":return!1;case"integer":case"number":return 0;case"string":return"";case"array":return[];case"object":return{};default:return null}}const iM=new BJe;no.add(ch.Configuration,iM);function HJe(i,e){var t,n,o,r;return i.trim()?xv.test(i)?C("config.property.languageDefault","Cannot register '{0}'. This matches property pattern '\\\\[.*\\\\]$' for describing language specific editor settings. Use 'configurationDefaults' contribution.",i):iM.getConfigurationProperties()[i]!==void 0?C("config.property.duplicate","Cannot register '{0}'. This property is already registered.",i):((t=e.policy)===null||t===void 0?void 0:t.name)&&iM.getPolicyConfigurations().get((n=e.policy)===null||n===void 0?void 0:n.name)!==void 0?C("config.policy.duplicate","Cannot register '{0}'. The associated policy {1} is already registered with {2}.",i,(o=e.policy)===null||o===void 0?void 0:o.name,iM.getPolicyConfigurations().get((r=e.policy)===null||r===void 0?void 0:r.name)):null:C("config.property.empty","Cannot register an empty property")}const $Je={ModesRegistry:"editor.modesRegistry"};class zJe{constructor(){this._onDidChangeLanguages=new le,this.onDidChangeLanguages=this._onDidChangeLanguages.event,this._languages=[]}registerLanguage(e){return this._languages.push(e),this._onDidChangeLanguages.fire(void 0),{dispose:()=>{for(let t=0,n=this._languages.length;t{const l=new Set;return{info:new KJe(this,a,l),closing:l}}),r=new hoe(a=>{const l=new Set,c=new Set;return{info:new qJe(this,a,l,c),opening:l,openingColorized:c}});for(const[a,l]of n){const c=o.get(a),u=r.get(l);c.closing.add(u.info),u.opening.add(c.info)}const s=t.colorizedBracketPairs?zoe(t.colorizedBracketPairs):n.filter(a=>!(a[0]==="<"&&a[1]===">"));for(const[a,l]of s){const c=o.get(a),u=r.get(l);c.closing.add(u.info),u.openingColorized.add(c.info),u.opening.add(c.info)}this._openingBrackets=new Map([...o.cachedValues].map(([a,l])=>[a,l.info])),this._closingBrackets=new Map([...r.cachedValues].map(([a,l])=>[a,l.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)}}function zoe(i){return i.filter(([e,t])=>e!==""&&t!=="")}class O0e{constructor(e,t){this.config=e,this.bracketText=t}get languageId(){return this.config.languageId}}class KJe extends O0e{constructor(e,t,n){super(e,t),this.openedBrackets=n,this.isOpeningBracket=!0}}class qJe extends O0e{constructor(e,t,n,o){super(e,t),this.openingBrackets=n,this.openingColorizedBrackets=o,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]}}var GJe=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Uoe=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};class G6{constructor(e){this.languageId=e}affects(e){return this.languageId?this.languageId===e:!0}}const Ti=yn("languageConfigurationService");let JV=class extends _e{constructor(e,t){super(),this.configurationService=e,this.languageService=t,this._registry=this._register(new QJe),this.onDidChangeEmitter=this._register(new le),this.onDidChange=this.onDidChangeEmitter.event,this.configurations=new Map;const n=new Set(Object.values(eH));this._register(this.configurationService.onDidChangeConfiguration(o=>{const r=o.change.keys.some(a=>n.has(a)),s=o.change.overrides.filter(([a,l])=>l.some(c=>n.has(c))).map(([a])=>a);if(r)this.configurations.clear(),this.onDidChangeEmitter.fire(new G6(void 0));else for(const a of s)this.languageService.isRegisteredLanguageId(a)&&(this.configurations.delete(a),this.onDidChangeEmitter.fire(new G6(a)))})),this._register(this._registry.onDidChange(o=>{this.configurations.delete(o.languageId),this.onDidChangeEmitter.fire(new G6(o.languageId))}))}register(e,t,n){return this._registry.register(e,t,n)}getLanguageConfiguration(e){let t=this.configurations.get(e);return t||(t=XJe(e,this._registry,this.configurationService,this.languageService),this.configurations.set(e,t)),t}};JV=GJe([Uoe(0,En),Uoe(1,Ki)],JV);function XJe(i,e,t,n){let o=e.getLanguageConfiguration(i);if(!o){if(!n.isRegisteredLanguageId(i))return new by(i,{});o=new by(i,{})}const r=YJe(o.languageId,t),s=B0e([o.underlyingConfig,r]);return new by(o.languageId,s)}const eH={brackets:"editor.language.brackets",colorizedBracketPairs:"editor.language.colorizedBracketPairs"};function YJe(i,e){const t=e.getValue(eH.brackets,{overrideIdentifier:i}),n=e.getValue(eH.colorizedBracketPairs,{overrideIdentifier:i});return{brackets:joe(t),colorizedBracketPairs:joe(n)}}function joe(i){if(!!Array.isArray(i))return i.map(e=>{if(!(!Array.isArray(e)||e.length!==2))return[e[0],e[1]]}).filter(e=>!!e)}function F0e(i,e,t){const n=i.getLineContent(e);let o=Si(n);return o.length>t-1&&(o=o.substring(0,t-1)),o}function _y(i,e,t){i.tokenization.forceTokenization(e);const n=i.tokenization.getLineTokens(e),o=typeof t=="undefined"?i.getLineMaxColumn(e)-1:t-1;return o5(n,o)}class ZJe{constructor(e){this.languageId=e,this._resolved=null,this._entries=[],this._order=0,this._resolved=null}register(e,t){const n=new Koe(e,t,++this._order);return this._entries.push(n),this._resolved=null,zt(()=>{for(let o=0;oe.configuration)))}}function B0e(i){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 i)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 Koe{constructor(e,t,n){this.configuration=e,this.priority=t,this.order=n}static cmp(e,t){return e.priority===t.priority?e.order-t.order:e.priority-t.priority}}class qoe{constructor(e){this.languageId=e}}class QJe extends _e{constructor(){super(),this._entries=new Map,this._onDidChange=this._register(new le),this.onDidChange=this._onDidChange.event,this._register(this.register(Gl,{brackets:[["(",")"],["[","]"],["{","}"]],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"<",close:">"},{open:'"',close:'"'},{open:"'",close:"'"},{open:"`",close:"`"}],colorizedBracketPairs:[],folding:{offSide:!0}},0))}register(e,t,n=0){let o=this._entries.get(e);o||(o=new ZJe(e),this._entries.set(e,o));const r=o.register(t,n);return this._onDidChange.fire(new qoe(e)),zt(()=>{r.dispose(),this._onDidChange.fire(new qoe(e))})}getLanguageConfiguration(e){const t=this._entries.get(e);return(t==null?void 0:t.getResolvedConfiguration())||null}}class by{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 TC(this.underlyingConfig):null,this.comments=by._handleComments(this.underlyingConfig),this.characterPair=new vw(this.underlyingConfig),this.wordDefinition=this.underlyingConfig.wordPattern||Fq,this.indentationRules=this.underlyingConfig.indentationRules,this.underlyingConfig.indentationRules?this.indentRulesSupport=new RJe(this.underlyingConfig.indentationRules):this.indentRulesSupport=null,this.foldingRules=this.underlyingConfig.folding||{},this.bracketsNew=new jJe(e,this.underlyingConfig)}getWordDefinition(){return C_e(this.wordDefinition)}get brackets(){return!this._brackets&&this.underlyingConfig.brackets&&(this._brackets=new LJe(this.languageId,this.underlyingConfig.brackets)),this._brackets}get electricCharacter(){return this._electricCharacter||(this._electricCharacter=new NJe(this.brackets)),this._electricCharacter}onEnter(e,t,n,o){return this._onEnterSupport?this._onEnterSupport.onEnter(e,t,n,o):null}getAutoClosingPairs(){return new vJe(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 n={};if(t.lineComment&&(n.lineCommentToken=t.lineComment),t.blockComment){const[o,r]=t.blockComment;n.blockCommentStartToken=o,n.blockCommentEndToken=r}return n}}Mn(Ti,JV,1);class Kp{constructor(e,t,n,o){this.originalStart=e,this.originalLength=t,this.modifiedStart=n,this.modifiedLength=o}getOriginalEnd(){return this.originalStart+this.originalLength}getModifiedEnd(){return this.modifiedStart+this.modifiedLength}}function W0e(i){return c5(i,0)}function c5(i,e){switch(typeof i){case"object":return i===null?Ag(349,e):Array.isArray(i)?eet(i,e):tet(i,e);case"string":return aG(i,e);case"boolean":return JJe(i,e);case"number":return Ag(i,e);case"undefined":return Ag(937,e);default:return Ag(617,e)}}function Ag(i,e){return(e<<5)-e+i|0}function JJe(i,e){return Ag(i?433:863,e)}function aG(i,e){e=Ag(149417,e);for(let t=0,n=i.length;tc5(n,t),e)}function tet(i,e){return e=Ag(181387,e),Object.keys(i).sort().reduce((t,n)=>(t=aG(n,t),c5(i[n],t)),e)}function X6(i,e,t=32){const n=t-e,o=~((1<>>n)>>>0}function Goe(i,e=0,t=i.byteLength,n=0){for(let o=0;ot.toString(16).padStart(2,"0")).join(""):net((i>>>0).toString(16),e/4)}class u5{constructor(){this._h0=1732584193,this._h1=4023233417,this._h2=2562383102,this._h3=271733878,this._h4=3285377520,this._buff=new Uint8Array(64+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 n=this._buff;let o=this._buffLen,r=this._leftoverHighSurrogate,s,a;for(r!==0?(s=r,a=-1,r=0):(s=e.charCodeAt(0),a=0);;){let l=s;if(gr(s))if(a+1>>6,e[t++]=128|(n&63)>>>0):n<65536?(e[t++]=224|(n&61440)>>>12,e[t++]=128|(n&4032)>>>6,e[t++]=128|(n&63)>>>0):(e[t++]=240|(n&1835008)>>>18,e[t++]=128|(n&258048)>>>12,e[t++]=128|(n&4032)>>>6,e[t++]=128|(n&63)>>>0),t>=64&&(this._step(),t-=64,this._totalLen+=64,e[0]=e[64+0],e[1]=e[64+1],e[2]=e[64+2]),t}digest(){return this._finished||(this._finished=!0,this._leftoverHighSurrogate&&(this._leftoverHighSurrogate=0,this._buffLen=this._push(this._buff,this._buffLen,65533)),this._totalLen+=this._buffLen,this._wrapUp()),Mx(this._h0)+Mx(this._h1)+Mx(this._h2)+Mx(this._h3)+Mx(this._h4)}_wrapUp(){this._buff[this._buffLen++]=128,Goe(this._buff,this._buffLen),this._buffLen>56&&(this._step(),Goe(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=u5._bigBlock32,t=this._buffDV;for(let d=0;d<64;d+=4)e.setUint32(d,t.getUint32(d,!1),!1);for(let d=64;d<320;d+=4)e.setUint32(d,X6(e.getUint32(d-12,!1)^e.getUint32(d-32,!1)^e.getUint32(d-56,!1)^e.getUint32(d-64,!1),1),!1);let n=this._h0,o=this._h1,r=this._h2,s=this._h3,a=this._h4,l,c,u;for(let d=0;d<80;d++)d<20?(l=o&r|~o&s,c=1518500249):d<40?(l=o^r^s,c=1859775393):d<60?(l=o&r|o&s|r&s,c=2400959708):(l=o^r^s,c=3395469782),u=X6(n,5)+l+a+c+e.getUint32(d*4,!1)&4294967295,a=s,s=r,r=X6(o,30),o=n,n=u;this._h0=this._h0+n&4294967295,this._h1=this._h1+o&4294967295,this._h2=this._h2+r&4294967295,this._h3=this._h3+s&4294967295,this._h4=this._h4+a&4294967295}}u5._bigBlock32=new DataView(new ArrayBuffer(320));class Xoe{constructor(e){this.source=e}getElements(){const e=this.source,t=new Int32Array(e.length);for(let n=0,o=e.length;n0||this.m_modifiedCount>0)&&this.m_changes.push(new Kp(this.m_originalStart,this.m_originalCount,this.m_modifiedStart,this.m_modifiedCount)),this.m_originalCount=0,this.m_modifiedCount=0,this.m_originalStart=1073741824,this.m_modifiedStart=1073741824}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 Ah{constructor(e,t,n=null){this.ContinueProcessingPredicate=n,this._originalSequence=e,this._modifiedSequence=t;const[o,r,s]=Ah._getElements(e),[a,l,c]=Ah._getElements(t);this._hasStrings=s&&c,this._originalStringElements=o,this._originalElementsOrHash=r,this._modifiedStringElements=a,this._modifiedElementsOrHash=l,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(Ah._isStringArray(t)){const n=new Int32Array(t.length);for(let o=0,r=t.length;o=e&&o>=n&&this.ElementsAreEqual(t,o);)t--,o--;if(e>t||n>o){let d;return n<=o?(W1.Assert(e===t+1,"originalStart should only be one more than originalEnd"),d=[new Kp(e,0,n,o-n+1)]):e<=t?(W1.Assert(n===o+1,"modifiedStart should only be one more than modifiedEnd"),d=[new Kp(e,t-e+1,n,0)]):(W1.Assert(e===t+1,"originalStart should only be one more than originalEnd"),W1.Assert(n===o+1,"modifiedStart should only be one more than modifiedEnd"),d=[]),d}const s=[0],a=[0],l=this.ComputeRecursionPoint(e,t,n,o,s,a,r),c=s[0],u=a[0];if(l!==null)return l;if(!r[0]){const d=this.ComputeDiffRecursive(e,c,n,u,r);let h=[];return r[0]?h=[new Kp(c+1,t-(c+1)+1,u+1,o-(u+1)+1)]:h=this.ComputeDiffRecursive(c+1,t,u+1,o,r),this.ConcatenateChanges(d,h)}return[new Kp(e,t-e+1,n,o-n+1)]}WALKTRACE(e,t,n,o,r,s,a,l,c,u,d,h,f,g,p,v,m,_){let y=null,w=null,L=new Yoe,D=t,E=n,I=f[0]-v[0]-o,k=-1073741824,R=this.m_forwardHistory.length-1;do{const A=I+e;A===D||A=0&&(c=this.m_forwardHistory[R],e=c[0],D=1,E=c.length-1)}while(--R>=-1);if(y=L.getReverseChanges(),_[0]){let A=f[0]+1,P=v[0]+1;if(y!==null&&y.length>0){const N=y[y.length-1];A=Math.max(A,N.getOriginalEnd()),P=Math.max(P,N.getModifiedEnd())}w=[new Kp(A,h-A+1,P,p-P+1)]}else{L=new Yoe,D=s,E=a,I=f[0]-v[0]-l,k=1073741824,R=m?this.m_reverseHistory.length-1:this.m_reverseHistory.length-2;do{const A=I+r;A===D||A=u[A+1]?(d=u[A+1]-1,g=d-I-l,d>k&&L.MarkNextChange(),k=d+1,L.AddOriginalElement(d+1,g+1),I=A+1-r):(d=u[A-1],g=d-I-l,d>k&&L.MarkNextChange(),k=d,L.AddModifiedElement(d+1,g+1),I=A-1-r),R>=0&&(u=this.m_reverseHistory[R],r=u[0],D=1,E=u.length-1)}while(--R>=-1);w=L.getChanges()}return this.ConcatenateChanges(y,w)}ComputeRecursionPoint(e,t,n,o,r,s,a){let l=0,c=0,u=0,d=0,h=0,f=0;e--,n--,r[0]=0,s[0]=0,this.m_forwardHistory=[],this.m_reverseHistory=[];const g=t-e+(o-n),p=g+1,v=new Int32Array(p),m=new Int32Array(p),_=o-n,y=t-e,w=e-n,L=t-o,E=(y-_)%2===0;v[_]=e,m[y]=t,a[0]=!1;for(let I=1;I<=g/2+1;I++){let k=0,R=0;u=this.ClipDiagonalBound(_-I,I,_,p),d=this.ClipDiagonalBound(_+I,I,_,p);for(let P=u;P<=d;P+=2){P===u||Pk+R&&(k=l,R=c),!E&&Math.abs(P-y)<=I-1&&l>=m[P])return r[0]=l,s[0]=c,N<=m[P]&&1447>0&&I<=1447+1?this.WALKTRACE(_,u,d,w,y,h,f,L,v,m,l,t,r,c,o,s,E,a):null}const A=(k-e+(R-n)-I)/2;if(this.ContinueProcessingPredicate!==null&&!this.ContinueProcessingPredicate(k,A))return a[0]=!0,r[0]=k,s[0]=R,A>0&&1447>0&&I<=1447+1?this.WALKTRACE(_,u,d,w,y,h,f,L,v,m,l,t,r,c,o,s,E,a):(e++,n++,[new Kp(e,t-e+1,n,o-n+1)]);h=this.ClipDiagonalBound(y-I,I,y,p),f=this.ClipDiagonalBound(y+I,I,y,p);for(let P=h;P<=f;P+=2){P===h||P=m[P+1]?l=m[P+1]-1:l=m[P-1],c=l-(P-y)-L;const N=l;for(;l>e&&c>n&&this.ElementsAreEqual(l,c);)l--,c--;if(m[P]=l,E&&Math.abs(P-_)<=I&&l<=v[P])return r[0]=l,s[0]=c,N>=v[P]&&1447>0&&I<=1447+1?this.WALKTRACE(_,u,d,w,y,h,f,L,v,m,l,t,r,c,o,s,E,a):null}if(I<=1447){let P=new Int32Array(d-u+2);P[0]=_-u+1,V1.Copy2(v,u,P,1,d-u+1),this.m_forwardHistory.push(P),P=new Int32Array(f-h+2),P[0]=y-h+1,V1.Copy2(m,h,P,1,f-h+1),this.m_reverseHistory.push(P)}}return this.WALKTRACE(_,u,d,w,y,h,f,L,v,m,l,t,r,c,o,s,E,a)}PrettifyChanges(e){for(let t=0;t0,a=n.modifiedLength>0;for(;n.originalStart+n.originalLength=0;t--){const n=e[t];let o=0,r=0;if(t>0){const d=e[t-1];o=d.originalStart+d.originalLength,r=d.modifiedStart+d.modifiedLength}const s=n.originalLength>0,a=n.modifiedLength>0;let l=0,c=this._boundaryScore(n.originalStart,n.originalLength,n.modifiedStart,n.modifiedLength);for(let d=1;;d++){const h=n.originalStart-d,f=n.modifiedStart-d;if(hc&&(c=p,l=d)}n.originalStart-=l,n.modifiedStart-=l;const u=[null];if(t>0&&this.ChangesOverlap(e[t-1],e[t],u)){e[t-1]=u[0],e.splice(t,1),t++;continue}}if(this._hasStrings)for(let t=1,n=e.length;t0&&f>l&&(l=f,c=d,u=h)}return l>0?[c,u]:null}_contiguousSequenceScore(e,t,n){let o=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 n=e+t;if(this._OriginalIsBoundary(n-1)||this._OriginalIsBoundary(n))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 n=e+t;if(this._ModifiedIsBoundary(n-1)||this._ModifiedIsBoundary(n))return!0}return!1}_boundaryScore(e,t,n,o){const r=this._OriginalRegionIsBoundary(e,t)?1:0,s=this._ModifiedRegionIsBoundary(n,o)?1:0;return r+s}ConcatenateChanges(e,t){const n=[];if(e.length===0||t.length===0)return t.length>0?t:e;if(this.ChangesOverlap(e[e.length-1],t[0],n)){const o=new Array(e.length+t.length-1);return V1.Copy(e,0,o,0,e.length-1),o[e.length-1]=n[0],V1.Copy(t,1,o,e.length,t.length-1),o}else{const o=new Array(e.length+t.length);return V1.Copy(e,0,o,0,e.length),V1.Copy(t,0,o,e.length,t.length),o}}ChangesOverlap(e,t,n){if(W1.Assert(e.originalStart<=t.originalStart,"Left change is not less than or equal to right change"),W1.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 o=e.originalStart;let r=e.originalLength;const s=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),n[0]=new Kp(o,r,s,a),!0}else return n[0]=null,!1}ClipDiagonalBound(e,t,n,o){if(e>=0&&e255?255:i|0}function H1(i){return i<0?0:i>4294967295?4294967295:i|0}class oet{constructor(e){this.values=e,this.prefixSum=new Uint32Array(e.length),this.prefixSumValidIndex=new Int32Array(1),this.prefixSumValidIndex[0]=-1}insertValues(e,t){e=H1(e);const n=this.values,o=this.prefixSum,r=t.length;return r===0?!1:(this.values=new Uint32Array(n.length+r),this.values.set(n.subarray(0,e),0),this.values.set(n.subarray(e),e+r),this.values.set(t,e),e-1=0&&this.prefixSum.set(o.subarray(0,this.prefixSumValidIndex[0]+1)),!0)}setValue(e,t){return e=H1(e),t=H1(t),this.values[e]===t?!1:(this.values[e]=t,e-1=n.length)return!1;const r=n.length-e;return t>=r&&(t=r),t===0?!1:(this.values=new Uint32Array(n.length-t),this.values.set(n.subarray(0,e),0),this.values.set(n.subarray(e+t),e),this.prefixSum=new Uint32Array(this.values.length),e-1=0&&this.prefixSum.set(o.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=H1(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 n=t;n<=e;n++)this.prefixSum[n]=this.prefixSum[n-1]+this.values[n];return this.prefixSumValidIndex[0]=Math.max(this.prefixSumValidIndex[0],e),this.prefixSum[e]}getIndexOf(e){e=Math.floor(e),this.getTotalSum();let t=0,n=this.values.length-1,o=0,r=0,s=0;for(;t<=n;)if(o=t+(n-t)/2|0,r=this.prefixSum[o],s=r-this.values[o],e=r)t=o+1;else break;return new V0e(o,e-s)}}class ret{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],n=t>0?this._prefixSum[t-1]:0;return new V0e(t,e-n)}removeValues(e,t){this._values.splice(e,t),this._invalidate(e)}insertValues(e,t){this._values=B4(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]=o+n;for(let r=0;r=0&&e<256?this._asciiMap[e]=n:this._map.set(e,n)}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()}}class QA{constructor(){this._actual=new CS(0)}add(e){this._actual.set(e,1)}has(e){return this._actual.get(e)===1}clear(){return this._actual.clear()}}class aet{constructor(e,t,n){const o=new Uint8Array(e*t);for(let r=0,s=e*t;rt&&(t=l),a>n&&(n=a),c>n&&(n=c)}t++,n++;const o=new aet(n,t,0);for(let r=0,s=e.length;r=this._maxCharCode?0:this._states.get(e,t)}}let Y6=null;function uet(){return Y6===null&&(Y6=new cet([[1,104,2],[1,72,2],[1,102,6],[1,70,6],[2,116,3],[2,84,3],[3,116,4],[3,84,4],[4,112,5],[4,80,5],[5,115,9],[5,83,9],[5,58,10],[6,105,7],[6,73,7],[7,108,8],[7,76,8],[8,101,9],[8,69,9],[9,58,10],[10,47,11],[11,47,12]])),Y6}let Ax=null;function det(){if(Ax===null){Ax=new CS(0);const i=` <>'"\u3001\u3002\uFF61\uFF64\uFF0C\uFF0E\uFF1A\uFF1B\u2018\u3008\u300C\u300E\u3014\uFF08\uFF3B\uFF5B\uFF62\uFF63\uFF5D\uFF3D\uFF09\u3015\u300F\u300D\u3009\u2019\uFF40\uFF5E\u2026`;for(let t=0;to);if(o>0){const a=t.charCodeAt(o-1),l=t.charCodeAt(s);(a===40&&l===41||a===91&&l===93||a===123&&l===125)&&s--}return{range:{startLineNumber:n,startColumn:o+1,endLineNumber:n,endColumn:s+2},url:t.substring(o,s+1)}}static computeLinks(e,t=uet()){const n=det(),o=[];for(let r=1,s=e.getLineCount();r<=s;r++){const a=e.getLineContent(r),l=a.length;let c=0,u=0,d=0,h=1,f=!1,g=!1,p=!1,v=!1;for(;c=0?(o+=n?1:-1,o<0?o=e.length-1:o%=e.length,e[o]):null}}tH.INSTANCE=new tH;class fet extends CS{constructor(e){super(0);for(let t=0,n=e.length;t(e.hasOwnProperty(t)||(e[t]=i(t)),e[t])}const Vc=get(i=>new fet(i));var Yl;(function(i){i[i.Left=1]="Left",i[i.Center=2]="Center",i[i.Right=4]="Right",i[i.Full=7]="Full"})(Yl||(Yl={}));var Cy;(function(i){i[i.Left=1]="Left",i[i.Right=2]="Right"})(Cy||(Cy={}));var ll;(function(i){i[i.Inline=1]="Inline",i[i.Gutter=2]="Gutter"})(ll||(ll={}));var Nd;(function(i){i[i.Both=0]="Both",i[i.Right=1]="Right",i[i.Left=2]="Left",i[i.None=3]="None"})(Nd||(Nd={}));class oM{get originalIndentSize(){return this._indentSizeIsTabSize?"tabSize":this.indentSize}constructor(e){this._textModelResolvedOptionsBrand=void 0,this.tabSize=Math.max(1,e.tabSize|0),e.indentSize==="tabSize"?(this.indentSize=this.tabSize,this._indentSizeIsTabSize=!0):(this.indentSize=Math.max(1,e.indentSize|0),this._indentSizeIsTabSize=!1),this.insertSpaces=Boolean(e.insertSpaces),this.defaultEOL=e.defaultEOL|0,this.trimAutoWhitespace=Boolean(e.trimAutoWhitespace),this.bracketPairColorizationOptions=e.bracketPairColorizationOptions}equals(e){return this.tabSize===e.tabSize&&this._indentSizeIsTabSize===e._indentSizeIsTabSize&&this.indentSize===e.indentSize&&this.insertSpaces===e.insertSpaces&&this.defaultEOL===e.defaultEOL&&this.trimAutoWhitespace===e.trimAutoWhitespace&&ql(this.bracketPairColorizationOptions,e.bracketPairColorizationOptions)}createChangeEvent(e){return{tabSize:this.tabSize!==e.tabSize,indentSize:this.indentSize!==e.indentSize,insertSpaces:this.insertSpaces!==e.insertSpaces,trimAutoWhitespace:this.trimAutoWhitespace!==e.trimAutoWhitespace}}}class WD{constructor(e,t){this._findMatchBrand=void 0,this.range=e,this.matches=t}}function pet(i){return i&&typeof i.read=="function"}class Z6{constructor(e,t,n,o,r,s){this.identifier=e,this.range=t,this.text=n,this.forceMoveMarkers=o,this.isAutoWhitespaceEdit=r,this._isTracked=s}}class met{constructor(e,t,n){this.regex=e,this.wordSeparators=t,this.simpleSearch=n}}class vet{constructor(e,t,n){this.reverseEdits=e,this.changes=t,this.trimAutoWhitespaceLineNumbers=n}}function _et(i){return!i.isTooLargeForSyncing()&&!i.isForSimpleWidget}const bet=999;class R_{constructor(e,t,n,o){this.searchString=e,this.isRegex=t,this.matchCase=n,this.wordSeparators=o}parseSearchRequest(){if(this.searchString==="")return null;let e;this.isRegex?e=Cet(this.searchString):e=this.searchString.indexOf(` +`)>=0;let t=null;try{t=$_e(this.searchString,this.isRegex,{matchCase:this.matchCase,wholeWord:!1,multiline:e,global:!0,unicode:!0})}catch{return null}if(!t)return null;let n=!this.isRegex&&!e;return n&&this.searchString.toLowerCase()!==this.searchString.toUpperCase()&&(n=this.matchCase),new met(t,this.wordSeparators?Vc(this.wordSeparators):null,n?this.searchString:null)}}function Cet(i){if(!i||i.length===0)return!1;for(let e=0,t=i.length;e=t)break;const o=i.charCodeAt(e);if(o===110||o===114||o===87)return!0}}return!1}function W_(i,e,t){if(!t)return new WD(i,null);const n=[];for(let o=0,r=e.length;o>0);t[r]>=e?o=r-1:t[r+1]>=e?(n=r,o=r):n=r+1}return n+1}}class a2{static findMatches(e,t,n,o,r){const s=t.parseSearchRequest();return s?s.regex.multiline?this._doFindMatchesMultiline(e,n,new NC(s.wordSeparators,s.regex),o,r):this._doFindMatchesLineByLine(e,n,s,o,r):[]}static _getMultilineMatchRange(e,t,n,o,r,s){let a,l=0;o?(l=o.findLineFeedCountBeforeOffset(r),a=t+r+l):a=t+r;let c;if(o){const f=o.findLineFeedCountBeforeOffset(r+s.length)-l;c=a+s.length+f}else c=a+s.length;const u=e.getPositionAt(a),d=e.getPositionAt(c);return new V(u.lineNumber,u.column,d.lineNumber,d.column)}static _doFindMatchesMultiline(e,t,n,o,r){const s=e.getOffsetAt(t.getStartPosition()),a=e.getValueInRange(t,1),l=e.getEOL()===`\r +`?new Zoe(a):null,c=[];let u=0,d;for(n.reset(0);d=n.next(a);)if(c[u++]=W_(this._getMultilineMatchRange(e,s,a,l,d.index,d[0]),d,o),u>=r)return c;return c}static _doFindMatchesLineByLine(e,t,n,o,r){const s=[];let a=0;if(t.startLineNumber===t.endLineNumber){const c=e.getLineContent(t.startLineNumber).substring(t.startColumn-1,t.endColumn-1);return a=this._findMatchesInLine(n,c,t.startLineNumber,t.startColumn-1,a,s,o,r),s}const l=e.getLineContent(t.startLineNumber).substring(t.startColumn-1);a=this._findMatchesInLine(n,l,t.startLineNumber,t.startColumn-1,a,s,o,r);for(let c=t.startLineNumber+1;c=l))return r;return r}const u=new NC(e.wordSeparators,e.regex);let d;u.reset(0);do if(d=u.next(t),d&&(s[r++]=W_(new V(n,d.index+1+o,n,d.index+1+d[0].length+o),d,a),r>=l))return r;while(d);return r}static findNextMatch(e,t,n,o){const r=t.parseSearchRequest();if(!r)return null;const s=new NC(r.wordSeparators,r.regex);return r.regex.multiline?this._doFindNextMatchMultiline(e,n,s,o):this._doFindNextMatchLineByLine(e,n,s,o)}static _doFindNextMatchMultiline(e,t,n,o){const r=new ae(t.lineNumber,1),s=e.getOffsetAt(r),a=e.getLineCount(),l=e.getValueInRange(new V(r.lineNumber,r.column,a,e.getLineMaxColumn(a)),1),c=e.getEOL()===`\r +`?new Zoe(l):null;n.reset(t.column-1);const u=n.next(l);return u?W_(this._getMultilineMatchRange(e,s,l,c,u.index,u[0]),u,o):t.lineNumber!==1||t.column!==1?this._doFindNextMatchMultiline(e,new ae(1,1),n,o):null}static _doFindNextMatchLineByLine(e,t,n,o){const r=e.getLineCount(),s=t.lineNumber,a=e.getLineContent(s),l=this._findFirstMatchInLine(n,a,s,t.column,o);if(l)return l;for(let c=1;c<=r;c++){const u=(s+c-1)%r,d=e.getLineContent(u+1),h=this._findFirstMatchInLine(n,d,u+1,1,o);if(h)return h}return null}static _findFirstMatchInLine(e,t,n,o,r){e.reset(o-1);const s=e.next(t);return s?W_(new V(n,s.index+1,n,s.index+1+s[0].length),s,r):null}static findPreviousMatch(e,t,n,o){const r=t.parseSearchRequest();if(!r)return null;const s=new NC(r.wordSeparators,r.regex);return r.regex.multiline?this._doFindPreviousMatchMultiline(e,n,s,o):this._doFindPreviousMatchLineByLine(e,n,s,o)}static _doFindPreviousMatchMultiline(e,t,n,o){const r=this._doFindMatchesMultiline(e,new V(1,1,t.lineNumber,t.column),n,o,10*bet);if(r.length>0)return r[r.length-1];const s=e.getLineCount();return t.lineNumber!==s||t.column!==e.getLineMaxColumn(s)?this._doFindPreviousMatchMultiline(e,new ae(s,e.getLineMaxColumn(s)),n,o):null}static _doFindPreviousMatchLineByLine(e,t,n,o){const r=e.getLineCount(),s=t.lineNumber,a=e.getLineContent(s).substring(0,t.column-1),l=this._findLastMatchInLine(n,a,s,o);if(l)return l;for(let c=1;c<=r;c++){const u=(r+s-c-1)%r,d=e.getLineContent(u+1),h=this._findLastMatchInLine(n,d,u+1,o);if(h)return h}return null}static _findLastMatchInLine(e,t,n,o){let r=null,s;for(e.reset(0);s=e.next(t);)r=W_(new V(n,s.index+1,n,s.index+1+s[0].length),s,o);return r}}function yet(i,e,t,n,o){if(n===0)return!0;const r=e.charCodeAt(n-1);if(i.get(r)!==0||r===13||r===10)return!0;if(o>0){const s=e.charCodeAt(n);if(i.get(s)!==0)return!0}return!1}function wet(i,e,t,n,o){if(n+o===t)return!0;const r=e.charCodeAt(n+o);if(i.get(r)!==0||r===13||r===10)return!0;if(o>0){const s=e.charCodeAt(n+o-1);if(i.get(s)!==0)return!0}return!1}function lG(i,e,t,n,o){return yet(i,e,t,n,o)&&wet(i,e,t,n,o)}class NC{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 n;do{if(this._prevMatchStartIndex+this._prevMatchLength===t||(n=this._searchRegex.exec(e),!n))return null;const o=n.index,r=n[0].length;if(o===this._prevMatchStartIndex&&r===this._prevMatchLength){if(r===0){UA(e,t,this._searchRegex.lastIndex)>65535?this._searchRegex.lastIndex+=2:this._searchRegex.lastIndex+=1;continue}return null}if(this._prevMatchStartIndex=o,this._prevMatchLength=r,!this._wordSeparators||lG(this._wordSeparators,e,t,o,r))return n}while(n);return null}}class cG{static computeUnicodeHighlights(e,t,n){const o=n?n.startLineNumber:1,r=n?n.endLineNumber:e.getLineCount(),s=new Qoe(t),a=s.getCandidateCodePoints();let l;a==="allNonBasicAscii"?l=new RegExp("[^\\t\\n\\r\\x20-\\x7E]","g"):l=new RegExp(`${xet(Array.from(a))}`,"g");const c=new NC(null,l),u=[];let d=!1,h,f=0,g=0,p=0;e:for(let v=o,m=r;v<=m;v++){const _=e.getLineContent(v),y=_.length;c.reset(0);do if(h=c.next(_),h){let w=h.index,L=h.index+h[0].length;if(w>0){const k=_.charCodeAt(w-1);gr(k)&&w--}if(L+1=k){d=!0;break e}u.push(new V(v,w+1,v,L+1))}}while(h)}return{ranges:u,hasMore:d,ambiguousCharacterCount:f,invisibleCharacterCount:g,nonBasicAsciiCharacterCount:p}}static computeUnicodeHighlightReason(e,t){const n=new Qoe(t);switch(n.shouldHighlightNonBasicASCII(e,null)){case 0:return null;case 2:return{kind:1};case 3:{const r=e.codePointAt(0),s=n.ambiguousCharacters.getPrimaryConfusable(r),a=Q0.getLocales().filter(l=>!Q0.getInstance(new Set([...t.allowedLocales,l])).isAmbiguous(r));return{kind:0,confusableWith:String.fromCodePoint(s),notAmbiguousInLocales:a}}case 1:return{kind:2}}}}function xet(i,e){return`[${Xl(i.map(n=>String.fromCodePoint(n)).join(""))}]`}class Qoe{constructor(e){this.options=e,this.allowedCodePoints=new Set(e.allowedCodePoints),this.ambiguousCharacters=Q0.getInstance(new Set(e.allowedLocales))}getCandidateCodePoints(){if(this.options.nonBasicASCII)return"allNonBasicAscii";const e=new Set;if(this.options.invisibleCharacters)for(const t of cf.codePoints)Joe(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 n=e.codePointAt(0);if(this.allowedCodePoints.has(n))return 0;if(this.options.nonBasicASCII)return 1;let o=!1,r=!1;if(t)for(const s of t){const a=s.codePointAt(0),l=VI(s);o=o||l,!l&&!this.ambiguousCharacters.isAmbiguous(a)&&!cf.isInvisibleCharacter(a)&&(r=!0)}return!o&&r?0:this.options.invisibleCharacters&&!Joe(e)&&cf.isInvisibleCharacter(n)?2:this.options.ambiguousCharacters&&this.ambiguousCharacters.isAmbiguous(n)?3:0}}function Joe(i){return i===" "||i===` +`||i===" "}class rM{constructor(e,t,n){this.changes=e,this.moves=t,this.hitTimeout=n}}class H0e{constructor(e,t){this.lineRangeMapping=e,this.changes=t}}class Cn{static addRange(e,t){let n=0;for(;nt))return new Cn(e,t)}static ofLength(e){return new Cn(0,e)}constructor(e,t){if(this.start=e,this.endExclusive=t,e>t)throw new Vo(`Invalid range: ${this.toString()}`)}get isEmpty(){return this.start===this.endExclusive}delta(e){return new Cn(this.start+e,this.endExclusive+e)}deltaStart(e){return new Cn(this.start+e,this.endExclusive)}deltaEnd(e){return new Cn(this.start,this.endExclusive+e)}get length(){return this.endExclusive-this.start}toString(){return`[${this.start}, ${this.endExclusive})`}equals(e){return this.start===e.start&&this.endExclusive===e.endExclusive}containsRange(e){return this.start<=e.start&&e.endExclusive<=this.endExclusive}contains(e){return this.start<=e&&e=this.endExclusive?this.start+(e-this.start)%this.length:e}forEach(e){for(let t=this.start;te.toString()).join(", ")}intersectsStrict(e){let t=0;for(;te+t.length,0)}}function eP(i,e,t){const n=Let(i,e);if(n!==-1)return i[n]}function Let(i,e,t=i.length-1){for(let n=t;n>=0;n--){const o=i[n];if(e(o))return n}return-1}function VD(i,e){const t=HD(i,e);return t===-1?void 0:i[t]}function HD(i,e,t=0,n=i.length){let o=t,r=n;for(;o0&&(t=o)}return t}function Det(i,e){if(i.length===0)return;let t=i[0];for(let n=1;n=0&&(t=o)}return t}function ket(i,e){return $0e(i,(t,n)=>-e(t,n))}function Iet(i,e){if(i.length===0)return-1;let t=0;for(let n=1;n0&&(t=n)}return t}function Tet(i,e){for(const t of i){const n=e(t);if(n!==void 0)return n}}class ln{static fromRange(e){return new ln(e.startLineNumber,e.endLineNumber)}static joinMany(e){if(e.length===0)return[];let t=new Ph(e[0].slice());for(let n=1;nt)throw new Vo(`startLineNumber ${e} cannot be after endLineNumberExclusive ${t}`);this.startLineNumber=e,this.endLineNumberExclusive=t}contains(e){return this.startLineNumber<=e&&eo.endLineNumberExclusive>=e.startLineNumber),n=HD(this._normalizedRanges,o=>o.startLineNumber<=e.endLineNumberExclusive)+1;if(t===n)this._normalizedRanges.splice(t,0,e);else if(t===n-1){const o=this._normalizedRanges[t];this._normalizedRanges[t]=o.join(e)}else{const o=this._normalizedRanges[t].join(this._normalizedRanges[n-1]).join(e);this._normalizedRanges.splice(t,n-t,o)}}contains(e){const t=VD(this._normalizedRanges,n=>n.startLineNumber<=e);return!!t&&t.endLineNumberExclusive>e}getUnion(e){if(this._normalizedRanges.length===0)return e;if(e._normalizedRanges.length===0)return this;const t=[];let n=0,o=0,r=null;for(;n=s.startLineNumber?r=new ln(r.startLineNumber,Math.max(r.endLineNumberExclusive,s.endLineNumberExclusive)):(t.push(r),r=s)}return r!==null&&t.push(r),new Ph(t)}subtractFrom(e){const t=$D(this._normalizedRanges,s=>s.endLineNumberExclusive>=e.startLineNumber),n=HD(this._normalizedRanges,s=>s.startLineNumber<=e.endLineNumberExclusive)+1;if(t===n)return new Ph([e]);const o=[];let r=e.startLineNumber;for(let s=t;sr&&o.push(new ln(r,a.startLineNumber)),r=a.endLineNumberExclusive}return re.toString()).join(", ")}getIntersection(e){const t=[];let n=0,o=0;for(;nt.delta(e)))}}class mf{static inverse(e,t,n){const o=[];let r=1,s=1;for(const l of e){const c=new Hc(new ln(r,l.original.startLineNumber),new ln(s,l.modified.startLineNumber),void 0);c.modified.isEmpty||o.push(c),r=l.original.endLineNumberExclusive,s=l.modified.endLineNumberExclusive}const a=new Hc(new ln(r,t+1),new ln(s,n+1),void 0);return a.modified.isEmpty||o.push(a),o}constructor(e,t){this.original=e,this.modified=t}toString(){return`{${this.original.toString()}->${this.modified.toString()}}`}flip(){return new mf(this.modified,this.original)}join(e){return new mf(this.original.join(e.original),this.modified.join(e.modified))}}class Hc extends mf{constructor(e,t,n){super(e,t),this.innerChanges=n}flip(){var e;return new Hc(this.modified,this.original,(e=this.innerChanges)===null||e===void 0?void 0:e.map(t=>t.flip()))}}class Lv{constructor(e,t){this.originalRange=e,this.modifiedRange=t}toString(){return`{${this.originalRange.toString()}->${this.modifiedRange.toString()}}`}flip(){return new Lv(this.modifiedRange,this.originalRange)}}const Net=3;class Ret{computeDiff(e,t,n){var o;const s=new Pet(e,t,{maxComputationTime:n.maxComputationTimeMs,shouldIgnoreTrimWhitespace:n.ignoreTrimWhitespace,shouldComputeCharChanges:!0,shouldMakePrettyDiff:!0,shouldPostProcessCharChanges:!0}).computeDiff(),a=[];let l=null;for(const c of s.changes){let u;c.originalEndLineNumber===0?u=new ln(c.originalStartLineNumber+1,c.originalStartLineNumber+1):u=new ln(c.originalStartLineNumber,c.originalEndLineNumber+1);let d;c.modifiedEndLineNumber===0?d=new ln(c.modifiedStartLineNumber+1,c.modifiedStartLineNumber+1):d=new ln(c.modifiedStartLineNumber,c.modifiedEndLineNumber+1);let h=new Hc(u,d,(o=c.charChanges)===null||o===void 0?void 0:o.map(f=>new Lv(new V(f.originalStartLineNumber,f.originalStartColumn,f.originalEndLineNumber,f.originalEndColumn),new V(f.modifiedStartLineNumber,f.modifiedStartColumn,f.modifiedEndLineNumber,f.modifiedEndColumn))));l&&(l.modified.endLineNumberExclusive===h.modified.startLineNumber||l.original.endLineNumberExclusive===h.original.startLineNumber)&&(h=new Hc(l.original.join(h.original),l.modified.join(h.modified),l.innerChanges&&h.innerChanges?l.innerChanges.concat(h.innerChanges):void 0),a.pop()),a.push(h),l=h}return PD(()=>J_e(a,(c,u)=>u.original.startLineNumber-c.original.endLineNumberExclusive===u.modified.startLineNumber-c.modified.endLineNumberExclusive&&c.original.endLineNumberExclusive(e===10?"\\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]===10?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]===10?1:this._columns[e]+1)}}class yy{constructor(e,t,n,o,r,s,a,l){this.originalStartLineNumber=e,this.originalStartColumn=t,this.originalEndLineNumber=n,this.originalEndColumn=o,this.modifiedStartLineNumber=r,this.modifiedStartColumn=s,this.modifiedEndLineNumber=a,this.modifiedEndColumn=l}static createFromDiffChange(e,t,n){const o=t.getStartLineNumber(e.originalStart),r=t.getStartColumn(e.originalStart),s=t.getEndLineNumber(e.originalStart+e.originalLength-1),a=t.getEndColumn(e.originalStart+e.originalLength-1),l=n.getStartLineNumber(e.modifiedStart),c=n.getStartColumn(e.modifiedStart),u=n.getEndLineNumber(e.modifiedStart+e.modifiedLength-1),d=n.getEndColumn(e.modifiedStart+e.modifiedLength-1);return new yy(o,r,s,a,l,c,u,d)}}function Aet(i){if(i.length<=1)return i;const e=[i[0]];let t=e[0];for(let n=1,o=i.length;n0&&t.originalLength<20&&t.modifiedLength>0&&t.modifiedLength<20&&r()){const f=n.createCharSequence(e,t.originalStart,t.originalStart+t.originalLength-1),g=o.createCharSequence(e,t.modifiedStart,t.modifiedStart+t.modifiedLength-1);if(f.getElements().length>0&&g.getElements().length>0){let p=z0e(f,g,r,!0).changes;a&&(p=Aet(p)),h=[];for(let v=0,m=p.length;v1&&p>1;){const v=h.charCodeAt(g-2),m=f.charCodeAt(p-2);if(v!==m)break;g--,p--}(g>1||p>1)&&this._pushTrimWhitespaceCharChange(o,r+1,1,g,s+1,1,p)}{let g=iH(h,1),p=iH(f,1);const v=h.length+1,m=f.length+1;for(;g!0;const e=Date.now();return()=>Date.now()-e{n.push(Fr.fromOffsetPairs(o?o.getEndExclusives():Kh.zero,r?r.getStarts():new Kh(t,(o?o.seq2Range.endExclusive-o.seq1Range.endExclusive:0)+t)))}),n}static fromOffsetPairs(e,t){return new Fr(new Cn(e.offset1,t.offset1),new Cn(e.offset2,t.offset2))}constructor(e,t){this.seq1Range=e,this.seq2Range=t}swap(){return new Fr(this.seq2Range,this.seq1Range)}toString(){return`${this.seq1Range} <-> ${this.seq2Range}`}join(e){return new Fr(this.seq1Range.join(e.seq1Range),this.seq2Range.join(e.seq2Range))}delta(e){return e===0?this:new Fr(this.seq1Range.delta(e),this.seq2Range.delta(e))}deltaStart(e){return e===0?this:new Fr(this.seq1Range.deltaStart(e),this.seq2Range.deltaStart(e))}deltaEnd(e){return e===0?this:new Fr(this.seq1Range.deltaEnd(e),this.seq2Range.deltaEnd(e))}intersect(e){const t=this.seq1Range.intersect(e.seq1Range),n=this.seq2Range.intersect(e.seq2Range);if(!(!t||!n))return new Fr(t,n)}getStarts(){return new Kh(this.seq1Range.start,this.seq2Range.start)}getEndExclusives(){return new Kh(this.seq1Range.endExclusive,this.seq2Range.endExclusive)}}class Kh{constructor(e,t){this.offset1=e,this.offset2=t}toString(){return`${this.offset1} <-> ${this.offset2}`}}Kh.zero=new Kh(0,0);Kh.max=new Kh(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER);class zD{isValid(){return!0}}zD.instance=new zD;class Oet{constructor(e){if(this.timeout=e,this.startTime=Date.now(),this.valid=!0,e<=0)throw new Vo("timeout must be positive")}isValid(){if(!(Date.now()-this.startTime0&&p>0&&s.get(g-1,p-1)===3&&(_+=a.get(g-1,p-1)),_+=o?o(g,p):1):_=-1;const y=Math.max(v,m,_);if(y===_){const w=g>0&&p>0?a.get(g-1,p-1):0;a.set(g,p,w+1),s.set(g,p,3)}else y===v?(a.set(g,p,0),s.set(g,p,1)):y===m&&(a.set(g,p,0),s.set(g,p,2));r.set(g,p,y)}const l=[];let c=e.length,u=t.length;function d(g,p){(g+1!==c||p+1!==u)&&l.push(new Fr(new Cn(g+1,c),new Cn(p+1,u))),c=g,u=p}let h=e.length-1,f=t.length-1;for(;h>=0&&f>=0;)s.get(h,f)===3?(d(h,f),h--,f--):s.get(h,f)===1?h--:f--;return d(-1,-1),l.reverse(),new Kg(l,!1)}}class U0e{compute(e,t,n=zD.instance){if(e.length===0||t.length===0)return Kg.trivial(e,t);const o=e,r=t;function s(p,v){for(;po.length||w>r.length)continue;const L=s(y,w);l.set(u,L);const D=y===m?c.get(u+1):c.get(u-1);if(c.set(u,L!==y?new nre(D,y,w,L-y):D),l.get(u)===o.length&&l.get(u)-u===r.length)break e}}let d=c.get(u);const h=[];let f=o.length,g=r.length;for(;;){const p=d?d.x+d.length:0,v=d?d.y+d.length:0;if((p!==f||v!==g)&&h.push(new Fr(new Cn(p,f),new Cn(v,g))),!d)break;f=d.x,g=d.y,d=d.prev}return h.reverse(),new Kg(h,!1)}}class nre{constructor(e,t,n,o){this.prev=e,this.x=t,this.y=n,this.length=o}}class Bet{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 n=this.negativeArr;this.negativeArr=new Int32Array(n.length*2),this.negativeArr.set(n)}this.negativeArr[e]=t}else{if(e>=this.positiveArr.length){const n=this.positiveArr;this.positiveArr=new Int32Array(n.length*2),this.positiveArr.set(n)}this.positiveArr[e]=t}}}class Wet{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}}var ire,ore;class Vet{constructor(e,t){this.uri=e,this.value=t}}function Het(i){return Array.isArray(i)}class _s{constructor(e,t){if(this[ire]="ResourceMap",e instanceof _s)this.map=new Map(e.map),this.toKey=t!=null?t:_s.defaultToKey;else if(Het(e)){this.map=new Map,this.toKey=t!=null?t:_s.defaultToKey;for(const[n,o]of e)this.set(n,o)}else this.map=new Map,this.toKey=e!=null?e:_s.defaultToKey}set(e,t){return this.map.set(this.toKey(e),new Vet(e,t)),this}get(e){var t;return(t=this.map.get(this.toKey(e)))===null||t===void 0?void 0:t.value}has(e){return this.map.has(this.toKey(e))}get size(){return this.map.size}clear(){this.map.clear()}delete(e){return this.map.delete(this.toKey(e))}forEach(e,t){typeof t!="undefined"&&(e=e.bind(t));for(const[n,o]of this.map)e(o.value,o.uri,this)}*values(){for(const e of this.map.values())yield e.value}*keys(){for(const e of this.map.values())yield e.uri}*entries(){for(const e of this.map.values())yield[e.uri,e.value]}*[(ire=Symbol.toStringTag,Symbol.iterator)](){for(const[,e]of this.map)yield[e.uri,e.value]}}_s.defaultToKey=i=>i.toString();class $et{constructor(){this[ore]="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(){var e;return(e=this._head)===null||e===void 0?void 0:e.value}get last(){var e;return(e=this._tail)===null||e===void 0?void 0:e.value}has(e){return this._map.has(e)}get(e,t=0){const n=this._map.get(e);if(!!n)return t!==0&&this.touch(n,t),n.value}set(e,t,n=0){let o=this._map.get(e);if(o)o.value=t,n!==0&&this.touch(o,n);else{switch(o={key:e,value:t,next:void 0,previous:void 0},n){case 0:this.addItemLast(o);break;case 1:this.addItemFirst(o);break;case 2:this.addItemLast(o);break;default:this.addItemLast(o);break}this._map.set(e,o),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 n=this._state;let o=this._head;for(;o;){if(t?e.bind(t)(o.value,o.key,this):e(o.value,o.key,this),this._state!==n)throw new Error("LinkedMap got modified during iteration.");o=o.next}}keys(){const e=this,t=this._state;let n=this._head;const o={[Symbol.iterator](){return o},next(){if(e._state!==t)throw new Error("LinkedMap got modified during iteration.");if(n){const r={value:n.key,done:!1};return n=n.next,r}else return{value:void 0,done:!0}}};return o}values(){const e=this,t=this._state;let n=this._head;const o={[Symbol.iterator](){return o},next(){if(e._state!==t)throw new Error("LinkedMap got modified during iteration.");if(n){const r={value:n.value,done:!1};return n=n.next,r}else return{value:void 0,done:!0}}};return o}entries(){const e=this,t=this._state;let n=this._head;const o={[Symbol.iterator](){return o},next(){if(e._state!==t)throw new Error("LinkedMap got modified during iteration.");if(n){const r={value:[n.key,n.value],done:!1};return n=n.next,r}else return{value:void 0,done:!0}}};return o}[(ore=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e>=this.size)return;if(e===0){this.clear();return}let t=this._head,n=this.size;for(;t&&n>e;)this._map.delete(t.key),t=t.next,n--;this._head=t,this._size=n,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,n=e.previous;if(!t||!n)throw new Error("Invalid list");t.previous=n,n.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!==1&&t!==2)){if(t===1){if(e===this._head)return;const n=e.next,o=e.previous;e===this._tail?(o.next=void 0,this._tail=o):(n.previous=o,o.next=n),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(t===2){if(e===this._tail)return;const n=e.next,o=e.previous;e===this._head?(n.previous=void 0,this._head=n):(n.previous=o,o.next=n),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}}toJSON(){const e=[];return this.forEach((t,n)=>{e.push([n,t])}),e}fromJSON(e){this.clear();for(const[t,n]of e)this.set(t,n)}}class Yv extends $et{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(e,t=2){return super.get(e,t)}peek(e){return super.get(e,0)}set(e,t){return super.set(e,t,2),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}}class zet{constructor(e){if(this._m1=new Map,this._m2=new Map,e)for(const[t,n]of e)this.set(t,n)}clear(){this._m1.clear(),this._m2.clear()}set(e,t){this._m1.set(e,t),this._m2.set(t,e)}get(e){return this._m1.get(e)}getKey(e){return this._m2.get(e)}delete(e){const t=this._m1.get(e);return t===void 0?!1:(this._m1.delete(e),this._m2.delete(t),!0)}keys(){return this._m1.keys()}values(){return this._m1.values()}}class dG{constructor(){this.map=new Map}add(e,t){let n=this.map.get(e);n||(n=new Set,this.map.set(e,n)),n.add(t)}delete(e,t){const n=this.map.get(e);!n||(n.delete(t),n.size===0&&this.map.delete(e))}forEach(e,t){const n=this.map.get(e);!n||n.forEach(t)}get(e){const t=this.map.get(e);return t||new Set}}class tP{constructor(e,t,n){this.lines=e,this.considerWhitespaceChanges=n,this.elements=[],this.firstCharOffsetByLine=[],this.additionalOffsetByLine=[];let o=!1;t.start>0&&t.endExclusive>=e.length&&(t=new Cn(t.start-1,t.endExclusive),o=!0),this.lineRange=t,this.firstCharOffsetByLine[0]=0;for(let r=this.lineRange.start;rString.fromCharCode(t)).join("")}getElement(e){return this.elements[e]}get length(){return this.elements.length}getBoundaryScore(e){const t=sre(e>0?this.elements[e-1]:-1),n=sre(en<=e);return new ae(this.lineRange.start+t+1,e-this.firstCharOffsetByLine[t]+this.additionalOffsetByLine[t]+1)}translateRange(e){return V.fromPositions(this.translateOffset(e.start),this.translateOffset(e.endExclusive))}findWordContaining(e){if(e<0||e>=this.elements.length||!J6(this.elements[e]))return;let t=e;for(;t>0&&J6(this.elements[t-1]);)t--;let n=e;for(;ns<=e.start))!==null&&t!==void 0?t:0,r=(n=Eet(this.firstCharOffsetByLine,s=>e.endExclusive<=s))!==null&&n!==void 0?n:this.elements.length;return new Cn(o,r)}}function J6(i){return i>=97&&i<=122||i>=65&&i<=90||i>=48&&i<=57}const Uet={[0]:0,[1]:0,[2]:0,[3]:10,[4]:2,[5]:3,[6]:10,[7]:10};function rre(i){return Uet[i]}function sre(i){return i===10?7:i===13?6:oH(i)?5:i>=97&&i<=122?0:i>=65&&i<=90?1:i>=48&&i<=57?2:i===-1?3:4}function jet(i,e,t,n,o,r){let{moves:s,excludedChanges:a}=Ket(i,e,t,r);if(!r.isValid())return[];const l=i.filter(u=>!a.has(u)),c=qet(l,n,o,e,t,r);return jW(s,c),s=Get(s),s=s.filter(u=>u.original.toOffsetRange().slice(e).map(h=>h.trim()).join(` +`).length>=10),s=Xet(i,s),s}function Ket(i,e,t,n){const o=[],r=i.filter(l=>l.modified.isEmpty&&l.original.length>=3).map(l=>new bw(l.original,e,l)),s=new Set(i.filter(l=>l.original.isEmpty&&l.modified.length>=3).map(l=>new bw(l.modified,t,l))),a=new Set;for(const l of r){let c=-1,u;for(const d of s){const h=l.computeSimilarity(d);h>c&&(c=h,u=d)}if(c>.9&&u&&(s.delete(u),o.push(new mf(l.range,u.range)),a.add(l.source),a.add(u.source)),!n.isValid())return{moves:o,excludedChanges:a}}return{moves:o,excludedChanges:a}}function qet(i,e,t,n,o,r){const s=[],a=new dG;for(const h of i)for(let f=h.original.startLineNumber;fh.modified.startLineNumber,Ug));for(const h of i){let f=[];for(let g=h.modified.startLineNumber;g{for(const w of f)if(w.originalLineRange.endLineNumberExclusive+1===_.endLineNumberExclusive&&w.modifiedLineRange.endLineNumberExclusive+1===v.endLineNumberExclusive){w.originalLineRange=new ln(w.originalLineRange.startLineNumber,_.endLineNumberExclusive),w.modifiedLineRange=new ln(w.modifiedLineRange.startLineNumber,v.endLineNumberExclusive),m.push(w);return}const y={modifiedLineRange:v,originalLineRange:_};l.push(y),m.push(y)}),f=m}if(!r.isValid())return[]}l.sort(u_e(Rc(h=>h.modifiedLineRange.length,Ug)));const c=new Ph,u=new Ph;for(const h of l){const f=h.modifiedLineRange.startLineNumber-h.originalLineRange.startLineNumber,g=c.subtractFrom(h.modifiedLineRange),p=u.subtractFrom(h.originalLineRange).getWithDelta(f),v=g.getIntersection(p);for(const m of v.ranges){if(m.length<3)continue;const _=m,y=m.delta(-f);s.push(new mf(y,_)),c.addRange(_),u.addRange(y)}}s.sort(Rc(h=>h.original.startLineNumber,Ug));const d=new zI(i);for(let h=0;hD.original.startLineNumber<=f.original.startLineNumber),p=VD(i,D=>D.modified.startLineNumber<=f.modified.startLineNumber),v=Math.max(f.original.startLineNumber-g.original.startLineNumber,f.modified.startLineNumber-p.modified.startLineNumber),m=d.findLastMonotonous(D=>D.original.startLineNumberD.modified.startLineNumbern.length||E>o.length||c.contains(E)||u.contains(D)||!are(n[D-1],o[E-1],r))break}w>0&&(u.addRange(new ln(f.original.startLineNumber-w,f.original.startLineNumber)),c.addRange(new ln(f.modified.startLineNumber-w,f.modified.startLineNumber)));let L;for(L=0;Ln.length||E>o.length||c.contains(E)||u.contains(D)||!are(n[D-1],o[E-1],r))break}L>0&&(u.addRange(new ln(f.original.endLineNumberExclusive,f.original.endLineNumberExclusive+L)),c.addRange(new ln(f.modified.endLineNumberExclusive,f.modified.endLineNumberExclusive+L))),(w>0||L>0)&&(s[h]=new mf(new ln(f.original.startLineNumber-w,f.original.endLineNumberExclusive+L),new ln(f.modified.startLineNumber-w,f.modified.endLineNumberExclusive+L)))}return s}function are(i,e,t){if(i.trim()===e.trim())return!0;if(i.length>300&&e.length>300)return!1;const o=new U0e().compute(new tP([i],new Cn(0,1),!1),new tP([e],new Cn(0,1),!1),t);let r=0;const s=Fr.invert(o.diffs,i.length);for(const u of s)u.seq1Range.forEach(d=>{oH(i.charCodeAt(d))||r++});function a(u){let d=0;for(let h=0;he.length?i:e);return r/l>.6&&l>10}function Get(i){if(i.length===0)return i;i.sort(Rc(t=>t.original.startLineNumber,Ug));const e=[i[0]];for(let t=1;t=0&&s>=0&&r+s<=2){e[e.length-1]=n.join(o);continue}e.push(o)}return e}function Xet(i,e){const t=new zI(i);return e=e.filter(n=>{const o=t.findLastMonotonous(a=>a.original.endLineNumberExclusivea.modified.endLineNumberExclusive0&&(a=a.delta(c))}o.push(a)}return n.length>0&&o.push(n[n.length-1]),o}function Zet(i,e,t){if(!i.getBoundaryScore||!e.getBoundaryScore)return t;for(let n=0;n0?t[n-1]:void 0,r=t[n],s=n+1=n.start&&i.seq2Range.start-s>=o.start&&t.isStronglyEqual(i.seq2Range.start-s,i.seq2Range.endExclusive-s)&&s<100;)s++;s--;let a=0;for(;i.seq1Range.start+ac&&(c=g,l=u)}return i.delta(l)}function Qet(i,e,t){const n=[];for(const o of t){const r=n[n.length-1];if(!r){n.push(o);continue}o.seq1Range.start-r.seq1Range.endExclusive<=2||o.seq2Range.start-r.seq2Range.endExclusive<=2?n[n.length-1]=new Fr(r.seq1Range.join(o.seq1Range),r.seq2Range.join(o.seq2Range)):n.push(o)}return n}function Jet(i,e,t){const n=[];let o;function r(){if(!o)return;const a=o.s1Range.length-o.deleted;o.s2Range.length-o.added,Math.max(o.deleted,o.added)+(o.count-1)>a&&n.push(new Fr(o.s1Range,o.s2Range)),o=void 0}for(const a of t){let l=function(f,g){var p,v,m,_;if(!o||!o.s1Range.containsRange(f)||!o.s2Range.containsRange(g))if(o&&!(o.s1Range.endExclusive0||e.length>0;){const n=i[0],o=e[0];let r;n&&(!o||n.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 ttt(i,e,t){let n=t;if(n.length===0)return n;let o=0,r;do{r=!1;const s=[n[0]];for(let a=1;a5||f.seq1Range.length+f.seq2Range.length>5)};const l=n[a],c=s[s.length-1];u(c,l)?(r=!0,s[s.length-1]=s[s.length-1].join(l)):s.push(l)}n=s}while(o++<10&&r);return n}function ntt(i,e,t){let n=t;if(n.length===0)return n;let o=0,r;do{r=!1;const a=[n[0]];for(let l=1;l5||p.length>500)return!1;const m=i.getText(p).trim();if(m.length>20||m.split(/\r\n|\r|\n/).length>1)return!1;const _=i.countLinesIn(f.seq1Range),y=f.seq1Range.length,w=e.countLinesIn(f.seq2Range),L=f.seq2Range.length,D=i.countLinesIn(g.seq1Range),E=g.seq1Range.length,I=e.countLinesIn(g.seq2Range),k=g.seq2Range.length,R=2*40+50;function A(P){return Math.min(P,R)}return Math.pow(Math.pow(A(_*40+y),1.5)+Math.pow(A(w*40+L),1.5),1.5)+Math.pow(Math.pow(A(D*40+E),1.5)+Math.pow(A(I*40+k),1.5),1.5)>Math.pow(Math.pow(R,1.5),1.5)*1.3};const c=n[l],u=a[a.length-1];d(u,c)?(r=!0,a[a.length-1]=a[a.length-1].join(c)):a.push(c)}n=a}while(o++<10&&r);const s=[];return uXe(n,(a,l,c)=>{let u=l;function d(m){return m.length>0&&m.trim().length<=3&&l.seq1Range.length+l.seq2Range.length>100}const h=i.extendToFullLines(l.seq1Range),f=i.getText(new Cn(h.start,l.seq1Range.start));d(f)&&(u=u.deltaStart(-f.length));const g=i.getText(new Cn(l.seq1Range.endExclusive,h.endExclusive));d(g)&&(u=u.deltaEnd(g.length));const p=Fr.fromOffsetPairs(a?a.getEndExclusives():Kh.zero,c?c.getStarts():Kh.max),v=u.intersect(p);s.push(v)}),s}class cre{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:ure(this.lines[e-1]),n=e===this.lines.length?0:ure(this.lines[e]);return 1e3-(t+n)}getText(e){return this.lines.slice(e.start,e.endExclusive).join(` +`)}isStronglyEqual(e,t){return this.lines[e]===this.lines[t]}}function ure(i){let e=0;for(;eL===D))return new rM([],[],!1);if(e.length===1&&e[0].length===0||t.length===1&&t[0].length===0)return new rM([new Hc(new ln(1,e.length+1),new ln(1,t.length+1),[new Lv(new V(1,1,e.length,e[0].length+1),new V(1,1,t.length,t[0].length+1))])],[],!1);const o=n.maxComputationTimeMs===0?zD.instance:new Oet(n.maxComputationTimeMs),r=!n.ignoreTrimWhitespace,s=new Map;function a(L){let D=s.get(L);return D===void 0&&(D=s.size,s.set(L,D)),D}const l=e.map(L=>a(L.trim())),c=t.map(L=>a(L.trim())),u=new cre(l,e),d=new cre(c,t),h=(()=>u.length+d.length<1700?this.dynamicProgrammingDiffing.compute(u,d,o,(L,D)=>e[L]===t[D]?t[D].length===0?.1:1+Math.log(1+t[D].length):.99):this.myersDiffingAlgorithm.compute(u,d))();let f=h.diffs,g=h.hitTimeout;f=rH(u,d,f),f=ttt(u,d,f);const p=[],v=L=>{if(!!r)for(let D=0;DL.seq1Range.start-m===L.seq2Range.start-_);const D=L.seq1Range.start-m;v(D),m=L.seq1Range.endExclusive,_=L.seq2Range.endExclusive;const E=this.refineDiff(e,t,L,o,r);E.hitTimeout&&(g=!0);for(const I of E.mappings)p.push(I)}v(e.length-m);const y=dre(p,e,t);let w=[];return n.computeMoves&&(w=this.computeMoves(y,e,t,l,c,o,r)),PD(()=>{function L(E,I){if(E.lineNumber<1||E.lineNumber>I.length)return!1;const k=I[E.lineNumber-1];return!(E.column<1||E.column>k.length+1)}function D(E,I){return!(E.startLineNumber<1||E.startLineNumber>I.length+1||E.endLineNumberExclusive<1||E.endLineNumberExclusive>I.length+1)}for(const E of y){if(!E.innerChanges)return!1;for(const I of E.innerChanges)if(!(L(I.modifiedRange.getStartPosition(),t)&&L(I.modifiedRange.getEndPosition(),t)&&L(I.originalRange.getStartPosition(),e)&&L(I.originalRange.getEndPosition(),e)))return!1;if(!D(E.modified,t)||!D(E.original,e))return!1}return!0}),new rM(y,w,g)}computeMoves(e,t,n,o,r,s,a){return jet(e,t,n,o,r,s).map(u=>{const d=this.refineDiff(t,n,new Fr(u.original.toOffsetRange(),u.modified.toOffsetRange()),s,a),h=dre(d.mappings,t,n,!0);return new H0e(u,h)})}refineDiff(e,t,n,o,r){const s=new tP(e,n.seq1Range,r),a=new tP(t,n.seq2Range,r),l=s.length+a.length<500?this.dynamicProgrammingDiffing.compute(s,a,o):this.myersDiffingAlgorithm.compute(s,a,o);let c=l.diffs;return c=rH(s,a,c),c=Jet(s,a,c),c=Qet(s,a,c),c=ntt(s,a,c),{mappings:c.map(d=>new Lv(s.translateRange(d.seq1Range),a.translateRange(d.seq2Range))),hitTimeout:l.hitTimeout}}}function dre(i,e,t,n=!1){const o=[];for(const r of r_e(i.map(s=>itt(s,e,t)),(s,a)=>s.original.overlapOrTouch(a.original)||s.modified.overlapOrTouch(a.modified))){const s=r[0],a=r[r.length-1];o.push(new Hc(s.original.join(a.original),s.modified.join(a.modified),r.map(l=>l.innerChanges[0])))}return PD(()=>!n&&o.length>0&&o[0].original.startLineNumber!==o[0].modified.startLineNumber?!1:J_e(o,(r,s)=>s.original.startLineNumber-r.original.endLineNumberExclusive===s.modified.startLineNumber-r.modified.endLineNumberExclusive&&r.original.endLineNumberExclusive=t[i.modifiedRange.startLineNumber-1].length&&i.originalRange.startColumn-1>=e[i.originalRange.startLineNumber-1].length&&i.originalRange.startLineNumber<=i.originalRange.endLineNumber+o&&i.modifiedRange.startLineNumber<=i.modifiedRange.endLineNumber+o&&(n=1);const r=new ln(i.originalRange.startLineNumber+n,i.originalRange.endLineNumber+1+o),s=new ln(i.modifiedRange.startLineNumber+n,i.modifiedRange.endLineNumber+1+o);return new Hc(r,s,[i])}const hre={getLegacy:()=>new Ret,getDefault:()=>new j0e};function qm(i,e){const t=Math.pow(10,e);return Math.round(i*t)/t}class Tn{constructor(e,t,n,o=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,n))|0,this.a=qm(Math.max(Math.min(1,o),0),3)}static equals(e,t){return e.r===t.r&&e.g===t.g&&e.b===t.b&&e.a===t.a}}class mu{constructor(e,t,n,o){this._hslaBrand=void 0,this.h=Math.max(Math.min(360,e),0)|0,this.s=qm(Math.max(Math.min(1,t),0),3),this.l=qm(Math.max(Math.min(1,n),0),3),this.a=qm(Math.max(Math.min(1,o),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,n=e.g/255,o=e.b/255,r=e.a,s=Math.max(t,n,o),a=Math.min(t,n,o);let l=0,c=0;const u=(a+s)/2,d=s-a;if(d>0){switch(c=Math.min(u<=.5?d/(2*u):d/(2-2*u),1),s){case t:l=(n-o)/d+(n1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}static toRGBA(e){const t=e.h/360,{s:n,l:o,a:r}=e;let s,a,l;if(n===0)s=a=l=o;else{const c=o<.5?o*(1+n):o+n-o*n,u=2*o-c;s=mu._hue2rgb(u,c,t+1/3),a=mu._hue2rgb(u,c,t),l=mu._hue2rgb(u,c,t-1/3)}return new Tn(Math.round(s*255),Math.round(a*255),Math.round(l*255),r)}}class qh{constructor(e,t,n,o){this._hsvaBrand=void 0,this.h=Math.max(Math.min(360,e),0)|0,this.s=qm(Math.max(Math.min(1,t),0),3),this.v=qm(Math.max(Math.min(1,n),0),3),this.a=qm(Math.max(Math.min(1,o),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,n=e.g/255,o=e.b/255,r=Math.max(t,n,o),s=Math.min(t,n,o),a=r-s,l=r===0?0:a/r;let c;return a===0?c=0:r===t?c=((n-o)/a%6+6)%6:r===n?c=(o-t)/a+2:c=(t-n)/a+4,new qh(Math.round(c*60),l,r,e.a)}static toRGBA(e){const{h:t,s:n,v:o,a:r}=e,s=o*n,a=s*(1-Math.abs(t/60%2-1)),l=o-s;let[c,u,d]=[0,0,0];return t<60?(c=s,u=a):t<120?(c=a,u=s):t<180?(u=s,d=a):t<240?(u=a,d=s):t<300?(c=a,d=s):t<=360&&(c=s,d=a),c=Math.round((c+l)*255),u=Math.round((u+l)*255),d=Math.round((d+l)*255),new Tn(c,u,d,r)}}class ve{static fromHex(e){return ve.Format.CSS.parseHex(e)||ve.red}static equals(e,t){return!e&&!t?!0:!e||!t?!1:e.equals(t)}get hsla(){return this._hsla?this._hsla:mu.fromRGBA(this.rgba)}get hsva(){return this._hsva?this._hsva:qh.fromRGBA(this.rgba)}constructor(e){if(e)if(e instanceof Tn)this.rgba=e;else if(e instanceof mu)this._hsla=e,this.rgba=mu.toRGBA(e);else if(e instanceof qh)this._hsva=e,this.rgba=qh.toRGBA(e);else throw new Error("Invalid color ctor argument");else throw new Error("Color needs a value")}equals(e){return!!e&&Tn.equals(this.rgba,e.rgba)&&mu.equals(this.hsla,e.hsla)&&qh.equals(this.hsva,e.hsva)}getRelativeLuminance(){const e=ve._relativeLuminanceForComponent(this.rgba.r),t=ve._relativeLuminanceForComponent(this.rgba.g),n=ve._relativeLuminanceForComponent(this.rgba.b),o=.2126*e+.7152*t+.0722*n;return qm(o,4)}static _relativeLuminanceForComponent(e){const t=e/255;return t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)}isLighter(){return(this.rgba.r*299+this.rgba.g*587+this.rgba.b*114)/1e3>=128}isLighterThan(e){const t=this.getRelativeLuminance(),n=e.getRelativeLuminance();return t>n}isDarkerThan(e){const t=this.getRelativeLuminance(),n=e.getRelativeLuminance();return t0)for(const o of n){const r=o.filter(c=>c!==void 0),s=r[1],a=r[2];if(!a)continue;let l;if(s==="rgb"){const c=/^\(\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*\)$/gm;l=fre(Px(i,o),Ox(a,c),!1)}else if(s==="rgba"){const c=/^\(\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(0[.][0-9]+|[.][0-9]+|[01][.]|[01])\s*\)$/gm;l=fre(Px(i,o),Ox(a,c),!0)}else if(s==="hsl"){const c=/^\(\s*(36[0]|3[0-5][0-9]|[12][0-9][0-9]|[1-9]?[0-9])\s*,\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*,\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*\)$/gm;l=gre(Px(i,o),Ox(a,c),!1)}else if(s==="hsla"){const c=/^\(\s*(36[0]|3[0-5][0-9]|[12][0-9][0-9]|[1-9]?[0-9])\s*,\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*,\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*,\s*(0[.][0-9]+|[.][0-9]+|[01][.]|[01])\s*\)$/gm;l=gre(Px(i,o),Ox(a,c),!0)}else s==="#"&&(l=ott(Px(i,o),s+a));l&&e.push(l)}return e}function stt(i){return!i||typeof i.getValue!="function"||typeof i.positionAt!="function"?[]:rtt(i)}var Wp=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};class att extends set{get uri(){return this._uri}get eol(){return this._eol}getValue(){return this.getText()}findMatches(e){const t=[];for(let n=0;nthis._lines.length)t=this._lines.length,n=this._lines[t-1].length+1,o=!0;else{const r=this._lines[t-1].length+1;n<1?(n=1,o=!0):n>r&&(n=r,o=!0)}return o?{lineNumber:t,column:n}:e}}class Gm{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 att(Rt.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]}computeUnicodeHighlights(e,t,n){return Wp(this,void 0,void 0,function*(){const o=this._getModel(e);return o?cG.computeUnicodeHighlights(o,t,n):{ranges:[],hasMore:!1,ambiguousCharacterCount:0,invisibleCharacterCount:0,nonBasicAsciiCharacterCount:0}})}computeDiff(e,t,n,o){return Wp(this,void 0,void 0,function*(){const r=this._getModel(e),s=this._getModel(t);return!r||!s?null:Gm.computeDiff(r,s,n,o)})}static computeDiff(e,t,n,o){const r=o==="advanced"?hre.getDefault():hre.getLegacy(),s=e.getLinesContent(),a=t.getLinesContent(),l=r.computeDiff(s,a,n),c=l.changes.length>0?!1:this._modelsAreIdentical(e,t);function u(d){return d.map(h=>{var f;return[h.original.startLineNumber,h.original.endLineNumberExclusive,h.modified.startLineNumber,h.modified.endLineNumberExclusive,(f=h.innerChanges)===null||f===void 0?void 0:f.map(g=>[g.originalRange.startLineNumber,g.originalRange.startColumn,g.originalRange.endLineNumber,g.originalRange.endColumn,g.modifiedRange.startLineNumber,g.modifiedRange.startColumn,g.modifiedRange.endLineNumber,g.modifiedRange.endColumn])]})}return{identical:c,quitEarly:l.hitTimeout,changes:u(l.changes),moves:l.moves.map(d=>[d.lineRangeMapping.original.startLineNumber,d.lineRangeMapping.original.endLineNumberExclusive,d.lineRangeMapping.modified.startLineNumber,d.lineRangeMapping.modified.endLineNumberExclusive,u(d.changes)])}}static _modelsAreIdentical(e,t){const n=e.getLineCount(),o=t.getLineCount();if(n!==o)return!1;for(let r=1;r<=n;r++){const s=e.getLineContent(r),a=t.getLineContent(r);if(s!==a)return!1}return!0}computeMoreMinimalEdits(e,t,n){return Wp(this,void 0,void 0,function*(){const o=this._getModel(e);if(!o)return t;const r=[];let s;t=t.slice(0).sort((l,c)=>{if(l.range&&c.range)return V.compareRangesUsingStarts(l.range,c.range);const u=l.range?0:1,d=c.range?0:1;return u-d});let a=0;for(let l=1;lGm._diffLimit){r.push({range:l,text:c});continue}const h=iet(d,c,n),f=o.offsetAt(V.lift(l).getStartPosition());for(const g of h){const p=o.positionAt(f+g.originalStart),v=o.positionAt(f+g.originalStart+g.originalLength),m={text:c.substr(g.modifiedStart,g.modifiedLength),range:{startLineNumber:p.lineNumber,startColumn:p.column,endLineNumber:v.lineNumber,endColumn:v.column}};o.getValueInRange(m.range)!==m.text&&r.push(m)}}return typeof s=="number"&&r.push({eol:s,text:"",range:{startLineNumber:0,startColumn:0,endLineNumber:0,endColumn:0}}),r})}computeLinks(e){return Wp(this,void 0,void 0,function*(){const t=this._getModel(e);return t?het(t):null})}computeDefaultDocumentColors(e){return Wp(this,void 0,void 0,function*(){const t=this._getModel(e);return t?stt(t):null})}textualSuggest(e,t,n,o){return Wp(this,void 0,void 0,function*(){const r=new Ls,s=new RegExp(n,o),a=new Set;e:for(const l of e){const c=this._getModel(l);if(!!c){for(const u of c.words(s))if(!(u===t||!isNaN(Number(u)))&&(a.add(u),a.size>Gm._suggestionsLimit))break e}}return{words:Array.from(a),duration:r.elapsed()}})}computeWordRanges(e,t,n,o){return Wp(this,void 0,void 0,function*(){const r=this._getModel(e);if(!r)return Object.create(null);const s=new RegExp(n,o),a=Object.create(null);for(let l=t.startLineNumber;lthis._host.fhr(a,l)),getMirrorModels:()=>this._getModels()};return this._foreignModuleFactory?(this._foreignModule=this._foreignModuleFactory(s,t),Promise.resolve(Aq(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(n){return Promise.reject(n)}}}Gm._diffLimit=1e5;Gm._suggestionsLimit=1e4;typeof importScripts=="function"&&(globalThis.monaco=W_e());const fG=yn("textResourceConfigurationService"),q0e=yn("textResourcePropertiesService"),pt=yn("ILanguageFeaturesService");var ltt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Fx=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},nP=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};const pre=60*1e3,mre=5*60*1e3;function V_(i,e){const t=i.getModel(e);return!(!t||t.isTooLargeForSyncing())}let sH=class extends _e{constructor(e,t,n,o,r){super(),this._modelService=e,this._workerManager=this._register(new utt(this._modelService,o)),this._logService=n,this._register(r.linkProvider.register({language:"*",hasAccessToAllModels:!0},{provideLinks:(s,a)=>V_(this._modelService,s.uri)?this._workerManager.withWorker().then(l=>l.computeLinks(s.uri)).then(l=>l&&{links:l}):Promise.resolve({links:[]})})),this._register(r.completionProvider.register("*",new ctt(this._workerManager,t,this._modelService,o)))}dispose(){super.dispose()}canComputeUnicodeHighlights(e){return V_(this._modelService,e)}computedUnicodeHighlights(e,t,n){return this._workerManager.withWorker().then(o=>o.computedUnicodeHighlights(e,t,n))}computeDiff(e,t,n,o){return nP(this,void 0,void 0,function*(){const r=yield this._workerManager.withWorker().then(l=>l.computeDiff(e,t,n,o));if(!r)return null;return{identical:r.identical,quitEarly:r.quitEarly,changes:a(r.changes),moves:r.moves.map(l=>new H0e(new mf(new ln(l[0],l[1]),new ln(l[2],l[3])),a(l[4])))};function a(l){return l.map(c=>{var u;return new Hc(new ln(c[0],c[1]),new ln(c[2],c[3]),(u=c[4])===null||u===void 0?void 0:u.map(d=>new Lv(new V(d[0],d[1],d[2],d[3]),new V(d[4],d[5],d[6],d[7]))))})}})}computeMoreMinimalEdits(e,t,n=!1){if(ws(t)){if(!V_(this._modelService,e))return Promise.resolve(t);const o=Ls.create(),r=this._workerManager.withWorker().then(s=>s.computeMoreMinimalEdits(e,t,n));return r.finally(()=>this._logService.trace("FORMAT#computeMoreMinimalEdits",e.toString(!0),o.elapsed())),Promise.race([r,wv(1e3).then(()=>t)])}else return Promise.resolve(void 0)}canNavigateValueSet(e){return V_(this._modelService,e)}navigateValueSet(e,t,n){return this._workerManager.withWorker().then(o=>o.navigateValueSet(e,t,n))}canComputeWordRanges(e){return V_(this._modelService,e)}computeWordRanges(e,t){return this._workerManager.withWorker().then(n=>n.computeWordRanges(e,t))}};sH=ltt([Fx(0,Yi),Fx(1,fG),Fx(2,nc),Fx(3,Ti),Fx(4,pt)],sH);class ctt{constructor(e,t,n,o){this.languageConfigurationService=o,this._debugDisplayName="wordbasedCompletions",this._workerManager=e,this._configurationService=t,this._modelService=n}provideCompletionItems(e,t){return nP(this,void 0,void 0,function*(){const n=this._configurationService.getValue(e.uri,t,"editor");if(!n.wordBasedSuggestions)return;const o=[];if(n.wordBasedSuggestionsMode==="currentDocument")V_(this._modelService,e.uri)&&o.push(e.uri);else for(const d of this._modelService.getModels())!V_(this._modelService,d.uri)||(d===e?o.unshift(d.uri):(n.wordBasedSuggestionsMode==="allDocuments"||d.getLanguageId()===e.getLanguageId())&&o.push(d.uri));if(o.length===0)return;const r=this.languageConfigurationService.getLanguageConfiguration(e.getLanguageId()).getWordDefinition(),s=e.getWordAtPosition(t),a=s?new V(t.lineNumber,s.startColumn,t.lineNumber,s.endColumn):V.fromPositions(t),l=a.setEndPosition(t.lineNumber,t.column),u=yield(yield this._workerManager.withWorker()).textualSuggest(o,s==null?void 0:s.word,r);if(!!u)return{duration:u.duration,suggestions:u.words.map(d=>({kind:18,label:d,insertText:d,range:{insert:l,replace:a}}))}})}}class utt extends _e{constructor(e,t){super(),this.languageConfigurationService=t,this._modelService=e,this._editorWorkerClient=null,this._lastWorkerUsedTime=new Date().getTime(),this._register(new $I).cancelAndSet(()=>this._checkStopIdleWorker(),Math.round(mre/2)),this._register(this._modelService.onModelRemoved(o=>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>mre&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null)}withWorker(){return this._lastWorkerUsedTime=new Date().getTime(),this._editorWorkerClient||(this._editorWorkerClient=new gG(this._modelService,!1,"editorWorkerService",this.languageConfigurationService)),Promise.resolve(this._editorWorkerClient)}}class dtt extends _e{constructor(e,t,n){if(super(),this._syncedModels=Object.create(null),this._syncedModelsLastUsedTime=Object.create(null),this._proxy=e,this._modelService=t,!n){const o=new $I;o.cancelAndSet(()=>this._checkStopModelSync(),Math.round(pre/2)),this._register(o)}}dispose(){for(const e in this._syncedModels)si(this._syncedModels[e]);this._syncedModels=Object.create(null),this._syncedModelsLastUsedTime=Object.create(null),super.dispose()}ensureSyncedResources(e,t){for(const n of e){const o=n.toString();this._syncedModels[o]||this._beginModelSync(n,t),this._syncedModels[o]&&(this._syncedModelsLastUsedTime[o]=new Date().getTime())}}_checkStopModelSync(){const e=new Date().getTime(),t=[];for(const n in this._syncedModelsLastUsedTime)e-this._syncedModelsLastUsedTime[n]>pre&&t.push(n);for(const n of t)this._stopModelSync(n)}_beginModelSync(e,t){const n=this._modelService.getModel(e);if(!n||!t&&n.isTooLargeForSyncing())return;const o=e.toString();this._proxy.acceptNewModel({url:n.uri.toString(),lines:n.getLinesContent(),EOL:n.getEOL(),versionId:n.getVersionId()});const r=new Be;r.add(n.onDidChangeContent(s=>{this._proxy.acceptModelChanged(o.toString(),s)})),r.add(n.onWillDispose(()=>{this._stopModelSync(o)})),r.add(zt(()=>{this._proxy.acceptRemovedModel(o)})),this._syncedModels[o]=r}_stopModelSync(e){const t=this._syncedModels[e];delete this._syncedModels[e],delete this._syncedModelsLastUsedTime[e],si(t)}}class vre{constructor(e){this._instance=e,this._proxyObj=Promise.resolve(this._instance)}dispose(){this._instance.dispose()}getProxyObject(){return this._proxyObj}}class e9{constructor(e){this._workerClient=e}fhr(e,t){return this._workerClient.fhr(e,t)}}class gG extends _e{constructor(e,t,n,o){super(),this.languageConfigurationService=o,this._disposed=!1,this._modelService=e,this._keepIdleModels=t,this._workerFactory=new i5(n),this._worker=null,this._modelManager=null}fhr(e,t){throw new Error("Not implemented!")}_getOrCreateWorker(){if(!this._worker)try{this._worker=this._register(new hJe(this._workerFactory,"vs/editor/common/services/editorSimpleWorker",new e9(this)))}catch(e){ZV(e),this._worker=new vre(new Gm(new e9(this),null))}return this._worker}_getProxy(){return this._getOrCreateWorker().getProxyObject().then(void 0,e=>(ZV(e),this._worker=new vre(new Gm(new e9(this),null)),this._getOrCreateWorker().getProxyObject()))}_getOrCreateModelManager(e){return this._modelManager||(this._modelManager=this._register(new dtt(e,this._modelService,this._keepIdleModels))),this._modelManager}_withSyncedResources(e,t=!1){return nP(this,void 0,void 0,function*(){return this._disposed?Promise.reject(SYe()):this._getProxy().then(n=>(this._getOrCreateModelManager(n).ensureSyncedResources(e,t),n))})}computedUnicodeHighlights(e,t,n){return this._withSyncedResources([e]).then(o=>o.computeUnicodeHighlights(e.toString(),t,n))}computeDiff(e,t,n,o){return this._withSyncedResources([e,t],!0).then(r=>r.computeDiff(e.toString(),t.toString(),n,o))}computeMoreMinimalEdits(e,t,n){return this._withSyncedResources([e]).then(o=>o.computeMoreMinimalEdits(e.toString(),t,n))}computeLinks(e){return this._withSyncedResources([e]).then(t=>t.computeLinks(e.toString()))}computeDefaultDocumentColors(e){return this._withSyncedResources([e]).then(t=>t.computeDefaultDocumentColors(e.toString()))}textualSuggest(e,t,n){return nP(this,void 0,void 0,function*(){const o=yield this._withSyncedResources(e),r=n.source,s=n.flags;return o.textualSuggest(e.map(a=>a.toString()),t,r,s)})}computeWordRanges(e,t){return this._withSyncedResources([e]).then(n=>{const o=this._modelService.getModel(e);if(!o)return Promise.resolve(null);const r=this.languageConfigurationService.getLanguageConfiguration(o.getLanguageId()).getWordDefinition(),s=r.source,a=r.flags;return n.computeWordRanges(e.toString(),t,s,a)})}navigateValueSet(e,t,n){return this._withSyncedResources([e]).then(o=>{const r=this._modelService.getModel(e);if(!r)return null;const s=this.languageConfigurationService.getLanguageConfiguration(r.getLanguageId()).getWordDefinition(),a=s.source,l=s.flags;return o.navigateValueSet(e.toString(),t,n,a,l)})}dispose(){super.dispose(),this._disposed=!0}}function htt(i,e,t){return new ftt(i,e,t)}class ftt extends gG{constructor(e,t,n){super(e,n.keepIdleModels||!1,n.label,t),this._foreignModuleId=n.moduleId,this._foreignModuleCreateData=n.createData||null,this._foreignModuleHost=n.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(n){return Promise.reject(n)}}_getForeignProxy(){return this._foreignProxy||(this._foreignProxy=this._getProxy().then(e=>{const t=this._foreignModuleHost?Aq(this._foreignModuleHost):[];return e.loadForeignModule(this._foreignModuleId,this._foreignModuleCreateData,t).then(n=>{this._foreignModuleCreateData=null;const o=(a,l)=>e.fmr(a,l),r=(a,l)=>function(){const c=Array.prototype.slice.call(arguments,0);return l(a,c)},s={};for(const a of n)s[a]=r(a,o);return s})})),this._foreignProxy}getProxy(){return this._getForeignProxy()}withSyncedResources(e){return this._withSyncedResources(e).then(t=>this.getProxy())}}const UI={ICodeEditor:"vs.editor.ICodeEditor",IDiffEditor:"vs.editor.IDiffEditor"},Cw=new class{clone(){return this}equals(i){return this===i}};function pG(i,e){return new jq([new ID(0,"",i)],e)}function d5(i,e){const t=new Uint32Array(2);return t[0]=0,t[1]=(i<<0|0<<8|0<<11|1<<15|2<<24)>>>0,new H4(t,e===null?Cw:e)}class is{static getLanguageId(e){return(e&255)>>>0}static getTokenType(e){return(e&768)>>>8}static containsBalancedBrackets(e){return(e&1024)!==0}static getFontStyle(e){return(e&30720)>>>11}static getForeground(e){return(e&16744448)>>>15}static getBackground(e){return(e&4278190080)>>>24}static getClassNameFromMetadata(e){const t=this.getForeground(e);let n="mtk"+t;const o=this.getFontStyle(e);return o&1&&(n+=" mtki"),o&2&&(n+=" mtkb"),o&4&&(n+=" mtku"),o&8&&(n+=" mtks"),n}static getInlineStyleFromMetadata(e,t){const n=this.getForeground(e),o=this.getFontStyle(e);let r=`color: ${t[n]};`;o&1&&(r+="font-style: italic;"),o&2&&(r+="font-weight: bold;");let s="";return o&4&&(s+=" underline"),o&8&&(s+=" line-through"),s&&(r+=`text-decoration:${s};`),r}static getPresentationFromMetadata(e){const t=this.getForeground(e),n=this.getFontStyle(e);return{foreground:t,italic:Boolean(n&1),bold:Boolean(n&2),underline:Boolean(n&4),strikethrough:Boolean(n&8)}}}class pr{static createEmpty(e,t){const n=pr.defaultTokenMetadata,o=new Uint32Array(2);return o[0]=e.length,o[1]=n,new pr(o,e,t)}constructor(e,t,n){this._lineTokensBrand=void 0,this._tokens=e,this._tokensCount=this._tokens.length>>>1,this._text=t,this._languageIdCodec=n}equals(e){return e instanceof pr?this.slicedEquals(e,0,this._tokensCount):!1}slicedEquals(e,t,n){if(this._text!==e._text||this._tokensCount!==e._tokensCount)return!1;const o=t<<1,r=o+(n<<1);for(let s=o;s0?this._tokens[e-1<<1]:0}getMetadata(e){return this._tokens[(e<<1)+1]}getLanguageId(e){const t=this._tokens[(e<<1)+1],n=is.getLanguageId(t);return this._languageIdCodec.decodeLanguageId(n)}getStandardTokenType(e){const t=this._tokens[(e<<1)+1];return is.getTokenType(t)}getForeground(e){const t=this._tokens[(e<<1)+1];return is.getForeground(t)}getClassName(e){const t=this._tokens[(e<<1)+1];return is.getClassNameFromMetadata(t)}getInlineStyle(e,t){const n=this._tokens[(e<<1)+1];return is.getInlineStyleFromMetadata(n,t)}getPresentation(e){const t=this._tokens[(e<<1)+1];return is.getPresentationFromMetadata(t)}getEndOffset(e){return this._tokens[e<<1]}findTokenIndexAtOffset(e){return pr.findIndexInTokensArray(this._tokens,e)}inflate(){return this}sliceAndInflate(e,t,n){return new mG(this,e,t,n)}static convertToEndOffset(e,t){const o=(e.length>>>1)-1;for(let r=0;r>>1)-1;for(;nt&&(o=r)}return n}withInserted(e){if(e.length===0)return this;let t=0,n=0,o="";const r=new Array;let s=0;for(;;){const a=ts){o+=this._text.substring(s,l.offset);const c=this._tokens[(t<<1)+1];r.push(o.length,c),s=l.offset}o+=l.text,r.push(o.length,l.tokenMetadata),n++}else break}return new pr(new Uint32Array(r),o,this._languageIdCodec)}}pr.defaultTokenMetadata=(0<<11|1<<15|2<<24)>>>0;class mG{constructor(e,t,n,o){this._source=e,this._startOffset=t,this._endOffset=n,this._deltaOffset=o,this._firstTokenIndex=e.findTokenIndexAtOffset(t),this._tokensCount=0;for(let r=this._firstTokenIndex,s=e.getCount();r=n);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 mG?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}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}}class rl{constructor(e,t,n,o){this.startColumn=e,this.endColumn=t,this.className=n,this.type=o,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 n=e.length,o=t.length;if(n!==o)return!1;for(let r=0;r=r||(a[l++]=new rl(Math.max(1,c.startColumn-o+1),Math.min(s+1,c.endColumn-o+1),c.className,c.type));return a}static filter(e,t,n,o){if(e.length===0)return[];const r=[];let s=0;for(let a=0,l=e.length;at||u.isEmpty()&&(c.type===0||c.type===3))continue;const d=u.startLineNumber===t?u.startColumn:n,h=u.endLineNumber===t?u.endColumn:o;r[s++]=new rl(d,h,c.inlineClassName,c.type)}return r}static _typeCompare(e,t){const n=[2,0,1,3];return n[e]-n[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 n=rl._typeCompare(e.type,t.type);return n!==0?n:e.className!==t.className?e.className0&&this.stopOffsets[0]0&&t=e){this.stopOffsets.splice(o,0,e),this.classNames.splice(o,0,t),this.metadata.splice(o,0,n);break}this.count++}}class gtt{static normalize(e,t){if(t.length===0)return[];const n=[],o=new iP;let r=0;for(let s=0,a=t.length;s1){const p=e.charCodeAt(c-2);gr(p)&&c--}if(u>1){const p=e.charCodeAt(u-2);gr(p)&&u--}const f=c-1,g=u-2;r=o.consumeLowerThan(f,r,n),o.count===0&&(r=f),o.insert(g,d,h)}return o.consumeLowerThan(1073741824,r,n),n}}class Lr{constructor(e,t,n,o){this.endIndex=e,this.type=t,this.metadata=n,this.containsRTL=o,this._linePartBrand=void 0}isWhitespace(){return!!(this.metadata&1)}isPseudoAfter(){return!!(this.metadata&4)}}class G0e{constructor(e,t){this.startOffset=e,this.endOffset=t}equals(e){return this.startOffset===e.startOffset&&this.endOffset===e.endOffset}}class Zv{constructor(e,t,n,o,r,s,a,l,c,u,d,h,f,g,p,v,m,_,y){this.useMonospaceOptimizations=e,this.canUseHalfwidthRightwardsArrow=t,this.lineContent=n,this.continuesWithWrappedLine=o,this.isBasicASCII=r,this.containsRTL=s,this.fauxIndentLength=a,this.lineTokens=l,this.lineDecorations=c.sort(rl.compare),this.tabSize=u,this.startVisibleColumn=d,this.spaceWidth=h,this.stopRenderingLineAfter=p,this.renderWhitespace=v==="all"?4:v==="boundary"?1:v==="selection"?2:v==="trailing"?3:0,this.renderControlCharacters=m,this.fontLigatures=_,this.selectionsOnLine=y&&y.sort((D,E)=>D.startOffset>>16}static getCharIndex(e){return(e&65535)>>>0}constructor(e,t){this.length=e,this._data=new Uint32Array(this.length),this._horizontalOffset=new Uint32Array(this.length)}setColumnInfo(e,t,n,o){const r=(t<<16|n<<0)>>>0;this._data[e-1]=r,this._horizontalOffset[e-1]=o}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),n=Th.getPartIndex(t),o=Th.getCharIndex(t);return new X0e(n,o)}getColumn(e,t){return this.partDataToCharOffset(e.partIndex,t,e.charIndex)+1}partDataToCharOffset(e,t,n){if(this.length===0)return 0;const o=(e<<16|n<<0)>>>0;let r=0,s=this.length-1;for(;r+1>>1,v=this._data[p];if(v===o)return p;v>o?s=p:r=p}if(r===s)return r;const a=this._data[r],l=this._data[s];if(a===o)return r;if(l===o)return s;const c=Th.getPartIndex(a),u=Th.getCharIndex(a),d=Th.getPartIndex(l);let h;c!==d?h=t:h=Th.getCharIndex(l);const f=n-u,g=h-n;return f<=g?r:s}}class aH{constructor(e,t,n){this._renderLineOutputBrand=void 0,this.characterMapping=e,this.containsRTL=t,this.containsForeignElements=n}}function jI(i,e){if(i.lineContent.length===0){if(i.lineDecorations.length>0){e.appendString("");let t=0,n=0,o=0;for(const s of i.lineDecorations)(s.type===1||s.type===2)&&(e.appendString(''),s.type===1&&(o|=1,t++),s.type===2&&(o|=2,n++));e.appendString("");const r=new Th(1,t+n);return r.setColumnInfo(1,t,0,0),new aH(r,!1,o)}return e.appendString(""),new aH(new Th(0,0),!1,0)}return Stt(vtt(i),e)}class ptt{constructor(e,t,n,o){this.characterMapping=e,this.html=t,this.containsRTL=n,this.containsForeignElements=o}}function h5(i){const e=new bS(1e4),t=jI(i,e);return new ptt(t.characterMapping,e.build(),t.containsRTL,t.containsForeignElements)}class mtt{constructor(e,t,n,o,r,s,a,l,c,u,d,h,f,g,p,v){this.fontIsMonospace=e,this.canUseHalfwidthRightwardsArrow=t,this.lineContent=n,this.len=o,this.isOverflowing=r,this.overflowingCharCount=s,this.parts=a,this.containsForeignElements=l,this.fauxIndentLength=c,this.tabSize=u,this.startVisibleColumn=d,this.containsRTL=h,this.spaceWidth=f,this.renderSpaceCharCode=g,this.renderWhitespace=p,this.renderControlCharacters=v}}function vtt(i){const e=i.lineContent;let t,n,o;i.stopRenderingLineAfter!==-1&&i.stopRenderingLineAfter0){for(let a=0,l=i.lineDecorations.length;a0&&(r[s++]=new Lr(n,"",0,!1));let a=n;for(let l=0,c=t.getCount();l=o){const f=e?fw(i.substring(a,o)):!1;r[s++]=new Lr(o,d,0,f);break}const h=e?fw(i.substring(a,u)):!1;r[s++]=new Lr(u,d,0,h),a=u}return r}function btt(i,e,t){let n=0;const o=[];let r=0;if(t)for(let s=0,a=e.length;s=50&&(o[r++]=new Lr(f+1,u,d,h),g=f+1,f=-1);g!==c&&(o[r++]=new Lr(c,u,d,h))}else o[r++]=l;n=c}else for(let s=0,a=e.length;s50){const d=l.type,h=l.metadata,f=l.containsRTL,g=Math.ceil(u/50);for(let p=1;p=8234&&i<=8238||i>=8294&&i<=8297||i>=8206&&i<=8207||i===1564}function Ctt(i,e){const t=[];let n=new Lr(0,"",0,!1),o=0;for(const r of e){const s=r.endIndex;for(;on.endIndex&&(n=new Lr(o,r.type,r.metadata,r.containsRTL),t.push(n)),n=new Lr(o+1,"mtkcontrol",r.metadata,!1),t.push(n))}o>n.endIndex&&(n=new Lr(s,r.type,r.metadata,r.containsRTL),t.push(n))}return t}function ytt(i,e,t,n){const o=i.continuesWithWrappedLine,r=i.fauxIndentLength,s=i.tabSize,a=i.startVisibleColumn,l=i.useMonospaceOptimizations,c=i.selectionsOnLine,u=i.renderWhitespace===1,d=i.renderWhitespace===3,h=i.renderSpaceWidth!==i.spaceWidth,f=[];let g=0,p=0,v=n[p].type,m=n[p].containsRTL,_=n[p].endIndex;const y=n.length;let w=!1,L=Ws(e),D;L===-1?(w=!0,L=t,D=t):D=Wd(e);let E=!1,I=0,k=c&&c[I],R=a%s;for(let P=r;P=k.endOffset&&(I++,k=c&&c[I]);let M;if(PD)M=!0;else if(N===9)M=!0;else if(N===32)if(u)if(E)M=!0;else{const H=P+1P),M&&d&&(M=w||P>D),M&&m&&P>=L&&P<=D&&(M=!1),E){if(!M||!l&&R>=s){if(h){const H=g>0?f[g-1].endIndex:r;for(let B=H+1;B<=P;B++)f[g++]=new Lr(B,"mtkw",1,!1)}else f[g++]=new Lr(P,"mtkw",1,!1);R=R%s}}else(P===_||M&&P>r)&&(f[g++]=new Lr(P,v,0,m),R=R%s);for(N===9?R=s:Cv(N)?R+=2:R++,E=M;P===_&&(p++,p0?e.charCodeAt(t-1):0,N=t>1?e.charCodeAt(t-2):0;P===32&&N!==32&&N!==9||(A=!0)}else A=!0;if(A)if(h){const P=g>0?f[g-1].endIndex:r;for(let N=P+1;N<=t;N++)f[g++]=new Lr(N,"mtkw",1,!1)}else f[g++]=new Lr(t,"mtkw",1,!1);else f[g++]=new Lr(t,v,0,m);return f}function wtt(i,e,t,n){n.sort(rl.compare);const o=gtt.normalize(i,n),r=o.length;let s=0;const a=[];let l=0,c=0;for(let d=0,h=t.length;dc&&(c=_.startOffset,a[l++]=new Lr(c,p,v,m)),_.endOffset+1<=g)c=_.endOffset+1,a[l++]=new Lr(c,p+" "+_.className,v|_.metadata,m),s++;else{c=g,a[l++]=new Lr(c,p+" "+_.className,v|_.metadata,m);break}}g>c&&(c=g,a[l++]=new Lr(c,p,v,m))}const u=t[t.length-1].endIndex;if(s'):e.appendString("");for(let k=0,R=c.length;k=u&&(K+=G)}}for(B&&(e.appendString(' style="width:'),e.appendString(String(g*$)),e.appendString('px"')),e.appendASCIICharCode(62);w1?e.appendCharCode(8594):e.appendCharCode(65515);for(let G=2;G<=j;G++)e.appendCharCode(160)}else K=2,j=1,e.appendCharCode(p),e.appendCharCode(8204);D+=K,E+=j,w>=u&&(L+=j)}}else for(e.appendASCIICharCode(62);w=u&&(L+=K)}F?I++:I=0,w>=s&&!y&&A.isPseudoAfter()&&(y=!0,_.setColumnInfo(w+1,k,D,E)),e.appendString("")}return y||_.setColumnInfo(s+1,c.length-1,D,E),a&&(e.appendString(''),e.appendString(C("showMore","Show more ({0})",Ltt(l))),e.appendString("")),e.appendString(""),new aH(_,f,o)}function xtt(i){return i.toString(16).toUpperCase().padStart(4,"0")}function Ltt(i){return i<1024?C("overflow.chars","{0} chars",i):i<1024*1024?`${(i/1024).toFixed(1)} KB`:`${(i/1024/1024).toFixed(1)} MB`}class bre{constructor(e,t,n,o){this._viewportBrand=void 0,this.top=e|0,this.left=t|0,this.width=n|0,this.height=o|0}}class Ett{constructor(e,t){this.tabSize=e,this.data=t}}class vG{constructor(e,t,n,o,r,s,a){this._viewLineDataBrand=void 0,this.content=e,this.continuesWithWrappedLine=t,this.minColumn=n,this.maxColumn=o,this.startVisibleColumn=r,this.tokens=s,this.inlineDecorations=a}}class Zl{constructor(e,t,n,o,r,s,a,l,c,u){this.minColumn=e,this.maxColumn=t,this.content=n,this.continuesWithWrappedLine=o,this.isBasicASCII=Zl.isBasicASCII(n,s),this.containsRTL=Zl.containsRTL(n,this.isBasicASCII,r),this.tokens=a,this.inlineDecorations=l,this.tabSize=c,this.startVisibleColumn=u}static isBasicASCII(e,t){return t?VI(e):!0}static containsRTL(e,t,n){return!t&&n?fw(e):!1}}class uE{constructor(e,t,n){this.range=e,this.inlineClassName=t,this.type=n}}class Dtt{constructor(e,t,n,o){this.startOffset=e,this.endOffset=t,this.inlineClassName=n,this.inlineClassNameAffectsLetterSpacing=o}toInlineDecoration(e){return new uE(new V(e,this.startOffset+1,e,this.endOffset+1),this.inlineClassName,this.inlineClassNameAffectsLetterSpacing?3:0)}}class Z0e{constructor(e,t){this._viewModelDecorationBrand=void 0,this.range=e,this.options=t}}class UD{constructor(e,t,n){this.color=e,this.zIndex=t,this.data=n}static compareByRenderingProps(e,t){return e.zIndex===t.zIndex?e.colort.color?1:0:e.zIndex-t.zIndex}static equals(e,t){return e.color===t.color&&e.zIndex===t.zIndex&&Lo(e.data,t.data)}static equalsArr(e,t){return Lo(e,t,UD.equals)}}function ktt(i){return Array.isArray(i)}function Itt(i){return!ktt(i)}function Q0e(i){return typeof i=="string"}function Cre(i){return!Q0e(i)}function cC(i){return!i}function Xm(i,e){return i.ignoreCase&&e?e.toLowerCase():e}function yre(i){return i.replace(/[&<>'"_]/g,"-")}function Ttt(i,e){console.log(`${i.languageId}: ${e}`)}function Bi(i,e){return new Error(`${i.languageId}: ${e}`)}function am(i,e,t,n,o){const r=/\$((\$)|(#)|(\d\d?)|[sS](\d\d?)|@(\w+))/g;let s=null;return e.replace(r,function(a,l,c,u,d,h,f,g,p){return cC(c)?cC(u)?!cC(d)&&d0;){const n=i.tokenizer[t];if(n)return n;const o=t.lastIndexOf(".");o<0?t=null:t=t.substr(0,o)}return null}function Ntt(i,e){let t=e;for(;t&&t.length>0;){if(i.stateNames[t])return!0;const o=t.lastIndexOf(".");o<0?t=null:t=t.substr(0,o)}return!1}var Rtt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Mtt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},lH;const J0e=5;class jD{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 wy(e,t);let n=wy.getStackElementId(e);n.length>0&&(n+="|"),n+=t;let o=this._entries[n];return o||(o=new wy(e,t),this._entries[n]=o,o)}}jD._INSTANCE=new jD(J0e);class wy{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 wy._equals(this,e)}push(e){return jD.create(this,e)}pop(){return this.parent}popall(){let e=this;for(;e.parent;)e=e.parent;return e}switchTo(e){return jD.create(this.parent,e)}}class RC{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 RC(this.languageId,this.state)}}class lm{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 dE(e,t);if(e!==null&&e.depth>=this._maxCacheDepth)return new dE(e,t);const n=wy.getStackElementId(e);let o=this._entries[n];return o||(o=new dE(e,null),this._entries[n]=o,o)}}lm._INSTANCE=new lm(J0e);class dE{constructor(e,t){this.stack=e,this.embeddedLanguageData=t}clone(){return(this.embeddedLanguageData?this.embeddedLanguageData.clone():null)===this.embeddedLanguageData?this:lm.create(this.stack,this.embeddedLanguageData)}equals(e){return!(e instanceof dE)||!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 Att{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 ID(e,t,this._languageId)))}nestedLanguageTokenize(e,t,n,o){const r=n.languageId,s=n.state,a=oo.get(r);if(!a)return this.enterLanguage(r),this.emit(o,""),s;const l=a.tokenize(e,t,s);if(o!==0)for(const c of l.tokens)this._tokens.push(new ID(c.offset+o,c.type,c.language));else this._tokens=this._tokens.concat(l.tokens);return this._lastTokenType=null,this._lastTokenLanguage=null,this._languageId=null,l.endState}finalize(e){return new jq(this._tokens,e)}}class oP{constructor(e,t){this._languageService=e,this._theme=t,this._prependTokens=null,this._tokens=[],this._currentLanguageId=0,this._lastTokenMetadata=0}enterLanguage(e){this._currentLanguageId=this._languageService.languageIdCodec.encodeLanguageId(e)}emit(e,t){const n=this._theme.match(this._currentLanguageId,t)|1024;this._lastTokenMetadata!==n&&(this._lastTokenMetadata=n,this._tokens.push(e),this._tokens.push(n))}static _merge(e,t,n){const o=e!==null?e.length:0,r=t.length,s=n!==null?n.length:0;if(o===0&&r===0&&s===0)return new Uint32Array(0);if(o===0&&r===0)return n;if(r===0&&s===0)return e;const a=new Uint32Array(o+r+s);e!==null&&a.set(e);for(let l=0;l{if(s)return;let l=!1;for(let c=0,u=a.changedLanguages.length;c{a.affectsConfiguration("editor.maxTokenizationLineLength")&&(this._maxTokenizationLineLength=this._configurationService.getValue("editor.maxTokenizationLineLength",{overrideIdentifier:this._languageId}))}))}getLoadStatus(){const e=[];for(const t in this._embeddedLanguages){const n=oo.get(t);if(n){if(n instanceof lH){const o=n.getLoadStatus();o.loaded===!1&&e.push(o.promise)}continue}oo.isResolved(t)||e.push(oo.getOrCreate(t))}return e.length===0?{loaded:!0}:{loaded:!1,promise:Promise.all(e).then(t=>{})}}getInitialState(){const e=jD.create(null,this._lexer.start);return lm.create(e,null)}tokenize(e,t,n){if(e.length>=this._maxTokenizationLineLength)return pG(this._languageId,n);const o=new Att,r=this._tokenize(e,t,n,o);return o.finalize(r)}tokenizeEncoded(e,t,n){if(e.length>=this._maxTokenizationLineLength)return d5(this._languageService.languageIdCodec.encodeLanguageId(this._languageId),n);const o=new oP(this._languageService,this._standaloneThemeService.getColorTheme().tokenTheme),r=this._tokenize(e,t,n,o);return o.finalize(r)}_tokenize(e,t,n,o){return n.embeddedLanguageData?this._nestedTokenize(e,t,n,0,o):this._myTokenize(e,t,n,0,o)}_findLeavingNestedLanguageOffset(e,t){let n=this._lexer.tokenizer[t.stack.state];if(!n&&(n=l2(this._lexer,t.stack.state),!n))throw Bi(this._lexer,"tokenizer state is not defined: "+t.stack.state);let o=-1,r=!1;for(const s of n){if(!Cre(s.action)||s.action.nextEmbedded!=="@pop")continue;r=!0;let a=s.regex;const l=s.regex.source;if(l.substr(0,4)==="^(?:"&&l.substr(l.length-1,1)===")"){const u=(a.ignoreCase?"i":"")+(a.unicode?"u":"");a=new RegExp(l.substr(4,l.length-5),u)}const c=e.search(a);c===-1||c!==0&&s.matchOnlyAtLineStart||(o===-1||c0&&r.nestedLanguageTokenize(a,!1,n.embeddedLanguageData,o);const l=e.substring(s);return this._myTokenize(l,t,n,o+s,r)}_safeRuleName(e){return e?e.name:"(unknown)"}_myTokenize(e,t,n,o,r){r.enterLanguage(this._languageId);const s=e.length,a=t&&this._lexer.includeLF?e+` +`:e,l=a.length;let c=n.embeddedLanguageData,u=n.stack,d=0,h=null,f=!0;for(;f||d=l)break;f=!1;let k=this._lexer.tokenizer[m];if(!k&&(k=l2(this._lexer,m),!k))throw Bi(this._lexer,"tokenizer state is not defined: "+m);const R=a.substr(d);for(const A of k)if((d===0||!A.matchOnlyAtLineStart)&&(_=R.match(A.regex),_)){y=_[0],w=A.action;break}}if(_||(_=[""],y=""),w||(d=this._lexer.maxStack)throw Bi(this._lexer,"maximum tokenizer stack size reached: ["+u.state+","+u.parent.state+",...]");u=u.push(m)}else if(w.next==="@pop"){if(u.depth<=1)throw Bi(this._lexer,"trying to pop an empty stack in rule: "+this._safeRuleName(L));u=u.pop()}else if(w.next==="@popall")u=u.popall();else{let k=am(this._lexer,w.next,y,_,m);if(k[0]==="@"&&(k=k.substr(1)),l2(this._lexer,k))u=u.push(k);else throw Bi(this._lexer,"trying to set a next state '"+k+"' that is undefined in rule: "+this._safeRuleName(L))}}w.log&&typeof w.log=="string"&&Ttt(this._lexer,this._lexer.languageId+": "+am(this._lexer,w.log,y,_,m))}if(E===null)throw Bi(this._lexer,"lexer rule has no well-defined action in rule: "+this._safeRuleName(L));const I=k=>{const R=this._languageService.getLanguageIdByLanguageName(k)||this._languageService.getLanguageIdByMimeType(k)||k,A=this._getNestedEmbeddedLanguageData(R);if(d0)throw Bi(this._lexer,"groups cannot be nested: "+this._safeRuleName(L));if(_.length!==E.length+1)throw Bi(this._lexer,"matched number of groups does not match the number of actions in rule: "+this._safeRuleName(L));let k=0;for(let R=1;R<_.length;R++)k+=_[R].length;if(k!==y.length)throw Bi(this._lexer,"with groups, all characters should be matched in consecutive groups in rule: "+this._safeRuleName(L));h={rule:L,matches:_,groups:[]};for(let R=0;Ri});class _G{static colorizeElement(e,t,n,o){o=o||{};const r=o.theme||"vs",s=o.mimeType||n.getAttribute("lang")||n.getAttribute("data-lang");if(!s)return console.error("Mode not detected"),Promise.resolve();const a=t.getLanguageIdByMimeType(s)||s;e.setTheme(r);const l=n.firstChild?n.firstChild.nodeValue:"";n.className+=" "+r;const c=u=>{var d;const h=(d=t9==null?void 0:t9.createHTML(u))!==null&&d!==void 0?d:u;n.innerHTML=h};return this.colorize(t,l||"",a,o).then(c,u=>console.error(u))}static colorize(e,t,n,o){return Ott(this,void 0,void 0,function*(){const r=e.languageIdCodec;let s=4;o&&typeof o.tabSize=="number"&&(s=o.tabSize),Qq(t)&&(t=t.substr(1));const a=gf(t);if(!e.isRegisteredLanguageId(n))return wre(a,s,r);const l=yield oo.getOrCreate(n);return l?Ftt(a,s,l,r):wre(a,s,r)})}static colorizeLine(e,t,n,o,r=4){const s=Zl.isBasicASCII(e,t),a=Zl.containsRTL(e,s,n);return h5(new Zv(!1,!0,e,!1,s,a,0,o,[],r,0,0,0,0,-1,"none",!1,!1,null)).html}static colorizeModelLine(e,t,n=4){const o=e.getLineContent(t);e.tokenization.forceTokenization(t);const s=e.tokenization.getLineTokens(t).inflate();return this.colorizeLine(o,e.mightContainNonBasicASCII(),e.mightContainRTL(),s,n)}}function Ftt(i,e,t,n){return new Promise((o,r)=>{const s=()=>{const a=Btt(i,e,t,n);if(t instanceof KD){const l=t.getLoadStatus();if(l.loaded===!1){l.promise.then(s,r);return}}o(a)};s()})}function wre(i,e,t){let n=[];const r=new Uint32Array(2);r[0]=0,r[1]=33587200;for(let s=0,a=i.length;s")}return n.join("")}function Btt(i,e,t,n){let o=[],r=t.getInitialState();for(let s=0,a=i.length;s"),r=c.endState}return o.join("")}const Sre=2e4;let H_,sM,cH,aM,uH;function Wtt(i){H_=document.createElement("div"),H_.className="monaco-aria-container";const e=()=>{const n=document.createElement("div");return n.className="monaco-alert",n.setAttribute("role","alert"),n.setAttribute("aria-atomic","true"),H_.appendChild(n),n};sM=e(),cH=e();const t=()=>{const n=document.createElement("div");return n.className="monaco-status",n.setAttribute("aria-live","polite"),n.setAttribute("aria-atomic","true"),H_.appendChild(n),n};aM=t(),uH=t(),i.appendChild(H_)}function Cs(i){!H_||(sM.textContent!==i?(Ur(cH),rP(sM,i)):(Ur(sM),rP(cH,i)))}function Ev(i){!H_||(aM.textContent!==i?(Ur(uH),rP(aM,i)):(Ur(aM),rP(uH,i)))}function rP(i,e){Ur(i),e.length>Sre&&(e=e.substr(0,Sre)),i.textContent=e,i.style.visibility="hidden",i.style.visibility="visible"}const bG=yn("markerDecorationsService");var Vtt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Htt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let qD=class{constructor(e,t){}dispose(){}};qD.ID="editor.contrib.markerDecorations";qD=Vtt([Htt(1,bG)],qD);zn(qD.ID,qD,0);class ebe extends _e{constructor(e,t){super(),this._onDidChange=this._register(new le),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 n=!1,o=!1;const r=()=>{if(n&&!o)try{n=!1,o=!0,t()}finally{requestAnimationFrame(()=>{o=!1,r()})}};this._resizeObserver=new ResizeObserver(s=>{e=s&&s[0]&&s[0].contentRect?s[0].contentRect:null,n=!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 n=0,o=0;t?(n=t.width,o=t.height):this._referenceDomElement&&(n=this._referenceDomElement.clientWidth,o=this._referenceDomElement.clientHeight),n=Math.max(5,n),o=Math.max(5,o),(this._width!==n||this._height!==o)&&(this._width=n,this._height=o,e&&this._onDidChange.fire())}}class Ym{constructor(e,t){this.key=e,this.migrate=t}apply(e){const t=Ym._read(e,this.key),n=r=>Ym._read(e,r),o=(r,s)=>Ym._write(e,r,s);this.migrate(t,n,o)}static _read(e,t){if(typeof e=="undefined")return;const n=t.indexOf(".");if(n>=0){const o=t.substring(0,n);return this._read(e[o],t.substring(n+1))}return e[t]}static _write(e,t,n){const o=t.indexOf(".");if(o>=0){const r=t.substring(0,o);e[r]=e[r]||{},this._write(e[r],t.substring(o+1),n);return}e[t]=n}}Ym.items=[];function Qv(i,e){Ym.items.push(new Ym(i,e))}function Kc(i,e){Qv(i,(t,n,o)=>{if(typeof t!="undefined"){for(const[r,s]of e)if(t===r){o(i,s);return}}})}function $tt(i){Ym.items.forEach(e=>e.apply(i))}Kc("wordWrap",[[!0,"on"],[!1,"off"]]);Kc("lineNumbers",[[!0,"on"],[!1,"off"]]);Kc("cursorBlinking",[["visible","solid"]]);Kc("renderWhitespace",[[!0,"boundary"],[!1,"none"]]);Kc("renderLineHighlight",[[!0,"line"],[!1,"none"]]);Kc("acceptSuggestionOnEnter",[[!0,"on"],[!1,"off"]]);Kc("tabCompletion",[[!1,"off"],[!0,"onlySnippets"]]);Kc("hover",[[!0,{enabled:!0}],[!1,{enabled:!1}]]);Kc("parameterHints",[[!0,{enabled:!0}],[!1,{enabled:!1}]]);Kc("autoIndent",[[!1,"advanced"],[!0,"full"]]);Kc("matchBrackets",[[!0,"always"],[!1,"never"]]);Kc("renderFinalNewline",[[!0,"on"],[!1,"off"]]);Kc("cursorSmoothCaretAnimation",[[!0,"on"],[!1,"off"]]);Qv("autoClosingBrackets",(i,e,t)=>{i===!1&&(t("autoClosingBrackets","never"),typeof e("autoClosingQuotes")=="undefined"&&t("autoClosingQuotes","never"),typeof e("autoSurround")=="undefined"&&t("autoSurround","never"))});Qv("renderIndentGuides",(i,e,t)=>{typeof i!="undefined"&&(t("renderIndentGuides",void 0),typeof e("guides.indentation")=="undefined"&&t("guides.indentation",!!i))});Qv("highlightActiveIndentGuide",(i,e,t)=>{typeof i!="undefined"&&(t("highlightActiveIndentGuide",void 0),typeof e("guides.highlightActiveIndentation")=="undefined"&&t("guides.highlightActiveIndentation",!!i))});const ztt={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"};Qv("suggest.filteredTypes",(i,e,t)=>{if(i&&typeof i=="object"){for(const n of Object.entries(ztt))i[n[0]]===!1&&typeof e(`suggest.${n[1]}`)=="undefined"&&t(`suggest.${n[1]}`,!1);t("suggest.filteredTypes",void 0)}});Qv("quickSuggestions",(i,e,t)=>{if(typeof i=="boolean"){const n=i?"on":"off";t("quickSuggestions",{comments:n,strings:n,other:n})}});Qv("experimental.stickyScroll.enabled",(i,e,t)=>{typeof i=="boolean"&&(t("experimental.stickyScroll.enabled",void 0),typeof e("stickyScroll.enabled")=="undefined"&&t("stickyScroll.enabled",i))});Qv("experimental.stickyScroll.maxLineCount",(i,e,t)=>{typeof i=="number"&&(t("experimental.stickyScroll.maxLineCount",void 0),typeof e("stickyScroll.maxLineCount")=="undefined"&&t("stickyScroll.maxLineCount",i))});class Utt{constructor(){this._tabFocus=!1,this._onDidChangeTabFocus=new le,this.onDidChangeTabFocus=this._onDidChangeTabFocus.event}getTabFocusMode(){return this._tabFocus}setTabFocusMode(e){this._tabFocus=e,this._onDidChangeTabFocus.fire(this._tabFocus)}}const yw=new Utt,vp=yn("accessibilityService"),KI=new lt("accessibilityModeEnabled",!1);var jtt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Ktt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let dH=class extends _e{constructor(e,t,n,o){super(),this._accessibilityService=o,this._onDidChange=this._register(new le),this.onDidChange=this._onDidChange.event,this._onDidChangeFast=this._register(new le),this.onDidChangeFast=this._onDidChangeFast.event,this._isDominatedByLongLines=!1,this._viewLineCount=1,this._lineNumbersDigitCount=1,this._reservedHeight=0,this._glyphMarginDecorationLaneCount=1,this._computeOptionsMemory=new S_e,this.isSimpleWidget=e,this._containerObserver=this._register(new ebe(n,t.dimension)),this._rawOptions=xre(t),this._validatedOptions=cm.validateOptions(this._rawOptions),this.options=this._computeOptions(),this.options.get(13)&&this._containerObserver.startObserving(),this._register(xc.onDidChangeZoomLevel(()=>this._recomputeOptions())),this._register(yw.onDidChangeTabFocus(()=>this._recomputeOptions())),this._register(this._containerObserver.onDidChange(()=>this._recomputeOptions())),this._register($V.onDidChange(()=>this._recomputeOptions())),this._register(MD.onDidChange(()=>this._recomputeOptions())),this._register(this._accessibilityService.onDidChangeScreenReaderOptimized(()=>this._recomputeOptions()))}_recomputeOptions(){const e=this._computeOptions(),t=cm.checkEquals(this.options,e);t!==null&&(this.options=e,this._onDidChangeFast.fire(t),this._onDidChange.fire(t))}_computeOptions(){const e=this._readEnvConfiguration(),t=E0.createFromValidatedSettings(this._validatedOptions,e.pixelRatio,this.isSimpleWidget),n=this._readFontInfo(t),o={memory:this._computeOptionsMemory,outerWidth:e.outerWidth,outerHeight:e.outerHeight-this._reservedHeight,fontInfo:n,extraEditorClassName:e.extraEditorClassName,isDominatedByLongLines:this._isDominatedByLongLines,viewLineCount:this._viewLineCount,lineNumbersDigitCount:this._lineNumbersDigitCount,emptySelectionClipboard:e.emptySelectionClipboard,pixelRatio:e.pixelRatio,tabFocusMode:yw.getTabFocusMode(),accessibilitySupport:e.accessibilitySupport,glyphMarginDecorationLaneCount:this._glyphMarginDecorationLaneCount};return cm.computeOptions(this._validatedOptions,o)}_readEnvConfiguration(){return{extraEditorClassName:Gtt(),outerWidth:this._containerObserver.getWidth(),outerHeight:this._containerObserver.getHeight(),emptySelectionClipboard:L0||Fc,pixelRatio:MD.value,accessibilitySupport:this._accessibilityService.isScreenReaderOptimized()?2:this._accessibilityService.getAccessibilitySupport()}}_readFontInfo(e){return $V.readFontInfo(e)}getRawOptions(){return this._rawOptions}updateOptions(e){const t=xre(e);!cm.applyUpdate(this._rawOptions,t)||(this._validatedOptions=cm.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=qtt(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())}};dH=jtt([Ktt(3,vp)],dH);function qtt(i){let e=0;for(;i;)i=Math.floor(i/10),e++;return e||1}function Gtt(){let i="";return!ap&&!X_e&&(i+="no-user-select "),ap&&(i+="no-minimap-shadow ",i+="enable-user-select "),Nn&&(i+="mac "),i}class Xtt{constructor(){this._values=[]}_read(e){return this._values[e]}get(e){return this._values[e]}_write(e,t){this._values[e]=t}}class Ytt{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 cm{static validateOptions(e){const t=new Xtt;for(const n of DC){const o=n.name==="_never_"?void 0:e[n.name];t._write(n.id,n.validate(o))}return t}static computeOptions(e,t){const n=new Ytt;for(const o of DC)n._write(o.id,o.compute(t,n,e._read(o.id)));return n}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)?Lo(e,t):!1;if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(!cm._deepEquals(e[n],t[n]))return!1;return!0}static checkEquals(e,t){const n=[];let o=!1;for(const r of DC){const s=!cm._deepEquals(e._read(r.id),t._read(r.id));n[r.id]=s,s&&(o=!0)}return o?new w_e(n):null}static applyUpdate(e,t){let n=!1;for(const o of DC)if(t.hasOwnProperty(o.name)){const r=o.applyUpdate(e[o.name],t[o.name]);e[o.name]=r.newValue,n=n||r.didChange}return n}}function xre(i){const e=fg(i);return $tt(e),e}function Mo(i,e,t){let n=null,o=null;if(typeof t.value=="function"?(n="value",o=t.value,o.length!==0&&console.warn("Memoize should only be used in functions with zero parameters")):typeof t.get=="function"&&(n="get",o=t.get),!o)throw new Error("not supported");const r=`$memoize$${e}`;t[n]=function(...s){return this.hasOwnProperty(r)||Object.defineProperty(this,r,{configurable:!1,enumerable:!1,writable:!1,value:o.apply(this,s)}),this[r]}}var Ztt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Di;(function(i){i.Tap="-monaco-gesturetap",i.Change="-monaco-gesturechange",i.Start="-monaco-gesturestart",i.End="-monaco-gesturesend",i.Contextmenu="-monaco-gesturecontextmenu"})(Di||(Di={}));class Ei extends _e{constructor(){super(),this.dispatched=!1,this.targets=new oa,this.ignoreTargets=new oa,this.activeTouches={},this.handle=null,this._lastSetTapCountTime=0,this._register(ke(document,"touchstart",e=>this.onTouchStart(e),{passive:!1})),this._register(ke(document,"touchend",e=>this.onTouchEnd(e))),this._register(ke(document,"touchmove",e=>this.onTouchMove(e),{passive:!1}))}static addTarget(e){if(!Ei.isTouchDevice())return _e.None;Ei.INSTANCE||(Ei.INSTANCE=new Ei);const t=Ei.INSTANCE.targets.push(e);return zt(t)}static ignoreTarget(e){if(!Ei.isTouchDevice())return _e.None;Ei.INSTANCE||(Ei.INSTANCE=new Ei);const t=Ei.INSTANCE.ignoreTargets.push(e);return zt(t)}static isTouchDevice(){return"ontouchstart"in window||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 n=0,o=e.targetTouches.length;n=Ei.HOLD_DELAY&&Math.abs(a.initialPageX-gc(a.rollingPageX))<30&&Math.abs(a.initialPageY-gc(a.rollingPageY))<30){const c=this.newGestureEvent(Di.Contextmenu,a.initialTarget);c.pageX=gc(a.rollingPageX),c.pageY=gc(a.rollingPageY),this.dispatchEvent(c)}else if(n===1){const c=gc(a.rollingPageX),u=gc(a.rollingPageY),d=gc(a.rollingTimestamps)-a.rollingTimestamps[0],h=c-a.rollingPageX[0],f=u-a.rollingPageY[0],g=[...this.targets].filter(p=>a.initialTarget instanceof Node&&p.contains(a.initialTarget));this.inertia(g,t,Math.abs(h)/d,h>0?1:-1,c,Math.abs(f)/d,f>0?1:-1,u)}this.dispatchEvent(this.newGestureEvent(Di.End,a.initialTarget)),delete this.activeTouches[s.identifier]}this.dispatched&&(e.preventDefault(),e.stopPropagation(),this.dispatched=!1)}newGestureEvent(e,t){const n=document.createEvent("CustomEvent");return n.initEvent(e,!1,!0),n.initialTarget=t,n.tapCount=0,n}dispatchEvent(e){if(e.type===Di.Tap){const t=new Date().getTime();let n=0;t-this._lastSetTapCountTime>Ei.CLEAR_TAP_COUNT_TIME?n=1:n=2,this._lastSetTapCountTime=t,e.tapCount=n}else(e.type===Di.Change||e.type===Di.Contextmenu)&&(this._lastSetTapCountTime=0);if(e.initialTarget instanceof Node){for(const t of this.ignoreTargets)if(t.contains(e.initialTarget))return;for(const t of this.targets)t.contains(e.initialTarget)&&(t.dispatchEvent(e),this.dispatched=!0)}}inertia(e,t,n,o,r,s,a,l){this.handle=Bc(()=>{const c=Date.now(),u=c-t;let d=0,h=0,f=!0;n+=Ei.SCROLL_FRICTION*u,s+=Ei.SCROLL_FRICTION*u,n>0&&(f=!1,d=o*n*u),s>0&&(f=!1,h=a*s*u);const g=this.newGestureEvent(Di.Change);g.translationX=d,g.translationY=h,e.forEach(p=>p.dispatchEvent(g)),f||this.inertia(e,c,n,o,r+d,s,a,l+h)})}onTouchMove(e){const t=Date.now();for(let n=0,o=e.changedTouches.length;n3&&(s.rollingPageX.shift(),s.rollingPageY.shift(),s.rollingTimestamps.shift()),s.rollingPageX.push(r.pageX),s.rollingPageY.push(r.pageY),s.rollingTimestamps.push(t)}this.dispatched&&(e.preventDefault(),e.stopPropagation(),this.dispatched=!1)}}Ei.SCROLL_FRICTION=-.005;Ei.HOLD_DELAY=700;Ei.CLEAR_TAP_COUNT_TIME=400;Ztt([Mo],Ei,"isTouchDevice",null);class yS{constructor(){this._hooks=new Be,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 n=this._onStopCallback;this._onStopCallback=null,e&&n&&n(t)}isMonitoring(){return!!this._pointerMoveCallback}startMonitoring(e,t,n,o,r){this.isMonitoring()&&this.stopMonitoring(!1),this._pointerMoveCallback=o,this._onStopCallback=r;let s=e;try{e.setPointerCapture(t),this._hooks.add(zt(()=>{try{e.releasePointerCapture(t)}catch{}}))}catch{s=window}this._hooks.add(ke(s,et.POINTER_MOVE,a=>{if(a.buttons!==n){this.stopMonitoring(!0);return}a.preventDefault(),this._pointerMoveCallback(a)})),this._hooks.add(ke(s,et.POINTER_UP,a=>this.stopMonitoring(!0)))}}function CG(i){return`--vscode-${i.replace(/\./g,"-")}`}function ct(i){return`var(${CG(i)})`}function Qtt(i,e){return`var(${CG(i)}, ${e})`}const tbe={ColorContribution:"base.contributions.colors"};class Jtt{constructor(){this._onDidChangeSchema=new le,this.onDidChangeSchema=this._onDidChangeSchema.event,this.colorSchema={type:"object",properties:{}},this.colorReferenceSchema={type:"string",enum:[],enumDescriptions:[]},this.colorsById={}}registerColor(e,t,n,o=!1,r){const s={id:e,description:n,defaults:t,needsTransparency:o,deprecationMessage:r};this.colorsById[e]=s;const a={type:"string",description:n,format:"color-hex",defaultSnippets:[{body:"${1:#ff0000}"}]};return r&&(a.deprecationMessage=r),this.colorSchema.properties[e]=a,this.colorReferenceSchema.enum.push(e),this.colorReferenceSchema.enumDescriptions.push(n),this._onDidChangeSchema.fire(),e}getColors(){return Object.keys(this.colorsById).map(e=>this.colorsById[e])}resolveDefaultColor(e,t){const n=this.colorsById[e];if(n&&n.defaults){const o=n.defaults[t.type];return sd(o,t)}}getColorSchema(){return this.colorSchema}toString(){const e=(t,n)=>{const o=t.indexOf(".")===-1?0:1,r=n.indexOf(".")===-1?0:1;return o!==r?o-r:t.localeCompare(n)};return Object.keys(this.colorsById).sort(e).map(t=>`- \`${t}\`: ${this.colorsById[t].description}`).join(` +`)}}const f5=new Jtt;no.add(tbe.ColorContribution,f5);function J(i,e,t,n,o){return f5.registerColor(i,e,t,n,o)}const Ke=J("foreground",{dark:"#CCCCCC",light:"#616161",hcDark:"#FFFFFF",hcLight:"#292929"},C("foreground","Overall foreground color. This color is only used if not overridden by a component."));J("disabledForeground",{dark:"#CCCCCC80",light:"#61616180",hcDark:"#A5A5A5",hcLight:"#7F7F7F"},C("disabledForeground","Overall foreground for disabled elements. This color is only used if not overridden by a component."));const ent=J("errorForeground",{dark:"#F48771",light:"#A1260D",hcDark:"#F48771",hcLight:"#B5200D"},C("errorForeground","Overall foreground color for error messages. This color is only used if not overridden by a component."));J("descriptionForeground",{light:"#717171",dark:St(Ke,.7),hcDark:St(Ke,.7),hcLight:St(Ke,.7)},C("descriptionForeground","Foreground color for description text providing additional information, for example for a label."));const wm=J("icon.foreground",{dark:"#C5C5C5",light:"#424242",hcDark:"#FFFFFF",hcLight:"#292929"},C("iconForeground","The default color for icons in the workbench.")),Hl=J("focusBorder",{dark:"#007FD4",light:"#0090F1",hcDark:"#F38518",hcLight:"#006BBD"},C("focusBorder","Overall border color for focused elements. This color is only used if not overridden by a component.")),Ln=J("contrastBorder",{light:null,dark:null,hcDark:"#6FC3DF",hcLight:"#0F4A85"},C("contrastBorder","An extra border around elements to separate them from others for greater contrast.")),Wi=J("contrastActiveBorder",{light:null,dark:null,hcDark:Hl,hcLight:Hl},C("activeContrastBorder","An extra border around active elements to separate them from others for greater contrast."));J("selection.background",{light:null,dark:null,hcDark:null,hcLight:null},C("selectionBackground","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."));J("textSeparator.foreground",{light:"#0000002e",dark:"#ffffff2e",hcDark:ve.black,hcLight:"#292929"},C("textSeparatorForeground","Color for text separators."));const tnt=J("textLink.foreground",{light:"#006AB1",dark:"#3794FF",hcDark:"#3794FF",hcLight:"#0F4A85"},C("textLinkForeground","Foreground color for links in text."));J("textLink.activeForeground",{light:"#006AB1",dark:"#3794FF",hcDark:"#3794FF",hcLight:"#0F4A85"},C("textLinkActiveForeground","Foreground color for links in text when clicked on and on mouse hover."));J("textPreformat.foreground",{light:"#A31515",dark:"#D7BA7D",hcDark:"#D7BA7D",hcLight:"#292929"},C("textPreformatForeground","Foreground color for preformatted text segments."));J("textBlockQuote.background",{light:"#7f7f7f1a",dark:"#7f7f7f1a",hcDark:null,hcLight:"#F2F2F2"},C("textBlockQuoteBackground","Background color for block quotes in text."));J("textBlockQuote.border",{light:"#007acc80",dark:"#007acc80",hcDark:ve.white,hcLight:"#292929"},C("textBlockQuoteBorder","Border color for block quotes in text."));J("textCodeBlock.background",{light:"#dcdcdc66",dark:"#0a0a0a66",hcDark:ve.black,hcLight:"#F2F2F2"},C("textCodeBlockBackground","Background color for code blocks in text."));const Gh=J("widget.shadow",{dark:St(ve.black,.36),light:St(ve.black,.16),hcDark:null,hcLight:null},C("widgetShadow","Shadow color of widgets such as find/replace inside the editor.")),yG=J("widget.border",{dark:null,light:null,hcDark:Ln,hcLight:Ln},C("widgetBorder","Border color of widgets such as find/replace inside the editor.")),nbe=J("input.background",{dark:"#3C3C3C",light:ve.white,hcDark:ve.black,hcLight:ve.white},C("inputBoxBackground","Input box background.")),ibe=J("input.foreground",{dark:Ke,light:Ke,hcDark:Ke,hcLight:Ke},C("inputBoxForeground","Input box foreground.")),obe=J("input.border",{dark:null,light:null,hcDark:Ln,hcLight:Ln},C("inputBoxBorder","Input box border.")),wG=J("inputOption.activeBorder",{dark:"#007ACC",light:"#007ACC",hcDark:Ln,hcLight:Ln},C("inputBoxActiveOptionBorder","Border color of activated options in input fields."));J("inputOption.hoverBackground",{dark:"#5a5d5e80",light:"#b8b8b850",hcDark:null,hcLight:null},C("inputOption.hoverBackground","Background color of activated options in input fields."));const d0=J("inputOption.activeBackground",{dark:St(Hl,.4),light:St(Hl,.2),hcDark:ve.transparent,hcLight:ve.transparent},C("inputOption.activeBackground","Background hover color of options in input fields.")),SG=J("inputOption.activeForeground",{dark:ve.white,light:ve.black,hcDark:Ke,hcLight:Ke},C("inputOption.activeForeground","Foreground color of activated options in input fields."));J("input.placeholderForeground",{light:St(Ke,.5),dark:St(Ke,.5),hcDark:St(Ke,.7),hcLight:St(Ke,.7)},C("inputPlaceholderForeground","Input box foreground color for placeholder text."));const nnt=J("inputValidation.infoBackground",{dark:"#063B49",light:"#D6ECF2",hcDark:ve.black,hcLight:ve.white},C("inputValidationInfoBackground","Input validation background color for information severity.")),int=J("inputValidation.infoForeground",{dark:null,light:null,hcDark:null,hcLight:Ke},C("inputValidationInfoForeground","Input validation foreground color for information severity.")),ont=J("inputValidation.infoBorder",{dark:"#007acc",light:"#007acc",hcDark:Ln,hcLight:Ln},C("inputValidationInfoBorder","Input validation border color for information severity.")),rnt=J("inputValidation.warningBackground",{dark:"#352A05",light:"#F6F5D2",hcDark:ve.black,hcLight:ve.white},C("inputValidationWarningBackground","Input validation background color for warning severity.")),snt=J("inputValidation.warningForeground",{dark:null,light:null,hcDark:null,hcLight:Ke},C("inputValidationWarningForeground","Input validation foreground color for warning severity.")),ant=J("inputValidation.warningBorder",{dark:"#B89500",light:"#B89500",hcDark:Ln,hcLight:Ln},C("inputValidationWarningBorder","Input validation border color for warning severity.")),lnt=J("inputValidation.errorBackground",{dark:"#5A1D1D",light:"#F2DEDE",hcDark:ve.black,hcLight:ve.white},C("inputValidationErrorBackground","Input validation background color for error severity.")),cnt=J("inputValidation.errorForeground",{dark:null,light:null,hcDark:null,hcLight:Ke},C("inputValidationErrorForeground","Input validation foreground color for error severity.")),unt=J("inputValidation.errorBorder",{dark:"#BE1100",light:"#BE1100",hcDark:Ln,hcLight:Ln},C("inputValidationErrorBorder","Input validation border color for error severity.")),Xh=J("dropdown.background",{dark:"#3C3C3C",light:ve.white,hcDark:ve.black,hcLight:ve.white},C("dropdownBackground","Dropdown background.")),dnt=J("dropdown.listBackground",{dark:null,light:null,hcDark:ve.black,hcLight:ve.white},C("dropdownListBackground","Dropdown list background.")),Pg=J("dropdown.foreground",{dark:"#F0F0F0",light:Ke,hcDark:ve.white,hcLight:Ke},C("dropdownForeground","Dropdown foreground.")),MC=J("dropdown.border",{dark:Xh,light:"#CECECE",hcDark:Ln,hcLight:Ln},C("dropdownBorder","Dropdown border.")),_L=J("button.foreground",{dark:ve.white,light:ve.white,hcDark:ve.white,hcLight:ve.white},C("buttonForeground","Button foreground color.")),hnt=J("button.separator",{dark:St(_L,.4),light:St(_L,.4),hcDark:St(_L,.4),hcLight:St(_L,.4)},C("buttonSeparator","Button separator color.")),bL=J("button.background",{dark:"#0E639C",light:"#007ACC",hcDark:null,hcLight:"#0F4A85"},C("buttonBackground","Button background color.")),fnt=J("button.hoverBackground",{dark:Vd(bL,.2),light:Vb(bL,.2),hcDark:bL,hcLight:bL},C("buttonHoverBackground","Button background color when hovering.")),gnt=J("button.border",{dark:Ln,light:Ln,hcDark:Ln,hcLight:Ln},C("buttonBorder","Button border color.")),pnt=J("button.secondaryForeground",{dark:ve.white,light:ve.white,hcDark:ve.white,hcLight:Ke},C("buttonSecondaryForeground","Secondary button foreground color.")),hH=J("button.secondaryBackground",{dark:"#3A3D41",light:"#5F6A79",hcDark:null,hcLight:ve.white},C("buttonSecondaryBackground","Secondary button background color.")),mnt=J("button.secondaryHoverBackground",{dark:Vd(hH,.2),light:Vb(hH,.2),hcDark:null,hcLight:null},C("buttonSecondaryHoverBackground","Secondary button background color when hovering.")),lM=J("badge.background",{dark:"#4D4D4D",light:"#C4C4C4",hcDark:ve.black,hcLight:"#0F4A85"},C("badgeBackground","Badge background color. Badges are small information labels, e.g. for search results count.")),vnt=J("badge.foreground",{dark:ve.white,light:"#333",hcDark:ve.white,hcLight:ve.white},C("badgeForeground","Badge foreground color. Badges are small information labels, e.g. for search results count.")),_nt=J("scrollbar.shadow",{dark:"#000000",light:"#DDDDDD",hcDark:null,hcLight:null},C("scrollbarShadow","Scrollbar shadow to indicate that the view is scrolled.")),CL=J("scrollbarSlider.background",{dark:ve.fromHex("#797979").transparent(.4),light:ve.fromHex("#646464").transparent(.4),hcDark:St(Ln,.6),hcLight:St(Ln,.4)},C("scrollbarSliderBackground","Scrollbar slider background color.")),yL=J("scrollbarSlider.hoverBackground",{dark:ve.fromHex("#646464").transparent(.7),light:ve.fromHex("#646464").transparent(.7),hcDark:St(Ln,.8),hcLight:St(Ln,.8)},C("scrollbarSliderHoverBackground","Scrollbar slider background color when hovering.")),wL=J("scrollbarSlider.activeBackground",{dark:ve.fromHex("#BFBFBF").transparent(.4),light:ve.fromHex("#000000").transparent(.6),hcDark:Ln,hcLight:Ln},C("scrollbarSliderActiveBackground","Scrollbar slider background color when clicked on.")),bnt=J("progressBar.background",{dark:ve.fromHex("#0E70C0"),light:ve.fromHex("#0E70C0"),hcDark:Ln,hcLight:Ln},C("progressBarBackground","Background color of the progress bar that can show for long running operations."));J("editorError.background",{dark:null,light:null,hcDark:null,hcLight:null},C("editorError.background","Background color of error text in the editor. The color must not be opaque so as not to hide underlying decorations."),!0);const Yh=J("editorError.foreground",{dark:"#F14C4C",light:"#E51400",hcDark:"#F48771",hcLight:"#B5200D"},C("editorError.foreground","Foreground color of error squigglies in the editor.")),Cnt=J("editorError.border",{dark:null,light:null,hcDark:ve.fromHex("#E47777").transparent(.8),hcLight:"#B5200D"},C("errorBorder","If set, color of double underlines for errors in the editor."));J("editorWarning.background",{dark:null,light:null,hcDark:null,hcLight:null},C("editorWarning.background","Background color of warning text in the editor. The color must not be opaque so as not to hide underlying decorations."),!0);const $l=J("editorWarning.foreground",{dark:"#CCA700",light:"#BF8803",hcDark:"#FFD370",hcLight:"#895503"},C("editorWarning.foreground","Foreground color of warning squigglies in the editor.")),GD=J("editorWarning.border",{dark:null,light:null,hcDark:ve.fromHex("#FFCC00").transparent(.8),hcLight:ve.fromHex("#FFCC00").transparent(.8)},C("warningBorder","If set, color of double underlines for warnings in the editor."));J("editorInfo.background",{dark:null,light:null,hcDark:null,hcLight:null},C("editorInfo.background","Background color of info text in the editor. The color must not be opaque so as not to hide underlying decorations."),!0);const Ma=J("editorInfo.foreground",{dark:"#3794FF",light:"#1a85ff",hcDark:"#3794FF",hcLight:"#1a85ff"},C("editorInfo.foreground","Foreground color of info squigglies in the editor.")),XD=J("editorInfo.border",{dark:null,light:null,hcDark:ve.fromHex("#3794FF").transparent(.8),hcLight:"#292929"},C("infoBorder","If set, color of double underlines for infos in the editor.")),ynt=J("editorHint.foreground",{dark:ve.fromHex("#eeeeee").transparent(.7),light:"#6c6c6c",hcDark:null,hcLight:null},C("editorHint.foreground","Foreground color of hint squigglies in the editor."));J("editorHint.border",{dark:null,light:null,hcDark:ve.fromHex("#eeeeee").transparent(.8),hcLight:"#292929"},C("hintBorder","If set, color of double underlines for hints in the editor."));J("sash.hoverBorder",{dark:Hl,light:Hl,hcDark:Hl,hcLight:Hl},C("sashActiveBorder","Border color of active sashes."));const mr=J("editor.background",{light:"#ffffff",dark:"#1E1E1E",hcDark:ve.black,hcLight:ve.white},C("editorBackground","Editor background color.")),Su=J("editor.foreground",{light:"#333333",dark:"#BBBBBB",hcDark:ve.white,hcLight:Ke},C("editorForeground","Editor default foreground color."));J("editorStickyScroll.background",{light:mr,dark:mr,hcDark:mr,hcLight:mr},C("editorStickyScrollBackground","Sticky scroll background color for the editor"));J("editorStickyScrollHover.background",{dark:"#2A2D2E",light:"#F0F0F0",hcDark:null,hcLight:ve.fromHex("#0F4A85").transparent(.1)},C("editorStickyScrollHoverBackground","Sticky scroll on hover background color for the editor"));const po=J("editorWidget.background",{dark:"#252526",light:"#F3F3F3",hcDark:"#0C141F",hcLight:ve.white},C("editorWidgetBackground","Background color of editor widgets, such as find/replace.")),Zh=J("editorWidget.foreground",{dark:Ke,light:Ke,hcDark:Ke,hcLight:Ke},C("editorWidgetForeground","Foreground color of editor widgets, such as find/replace.")),Qh=J("editorWidget.border",{dark:"#454545",light:"#C8C8C8",hcDark:Ln,hcLight:Ln},C("editorWidgetBorder","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.")),wnt=J("editorWidget.resizeBorder",{light:null,dark:null,hcDark:null,hcLight:null},C("editorWidgetResizeBorder","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.")),Lre=J("quickInput.background",{dark:po,light:po,hcDark:po,hcLight:po},C("pickerBackground","Quick picker background color. The quick picker widget is the container for pickers like the command palette.")),Snt=J("quickInput.foreground",{dark:Zh,light:Zh,hcDark:Zh,hcLight:Zh},C("pickerForeground","Quick picker foreground color. The quick picker widget is the container for pickers like the command palette.")),xnt=J("quickInputTitle.background",{dark:new ve(new Tn(255,255,255,.105)),light:new ve(new Tn(0,0,0,.06)),hcDark:"#000000",hcLight:ve.white},C("pickerTitleBackground","Quick picker title background color. The quick picker widget is the container for pickers like the command palette.")),rbe=J("pickerGroup.foreground",{dark:"#3794FF",light:"#0066BF",hcDark:ve.white,hcLight:"#0F4A85"},C("pickerGroupForeground","Quick picker color for grouping labels.")),Lnt=J("pickerGroup.border",{dark:"#3F3F46",light:"#CCCEDB",hcDark:ve.white,hcLight:"#0F4A85"},C("pickerGroupBorder","Quick picker color for grouping borders.")),Ent=J("keybindingLabel.background",{dark:new ve(new Tn(128,128,128,.17)),light:new ve(new Tn(221,221,221,.4)),hcDark:ve.transparent,hcLight:ve.transparent},C("keybindingLabelBackground","Keybinding label background color. The keybinding label is used to represent a keyboard shortcut.")),Dnt=J("keybindingLabel.foreground",{dark:ve.fromHex("#CCCCCC"),light:ve.fromHex("#555555"),hcDark:ve.white,hcLight:Ke},C("keybindingLabelForeground","Keybinding label foreground color. The keybinding label is used to represent a keyboard shortcut.")),knt=J("keybindingLabel.border",{dark:new ve(new Tn(51,51,51,.6)),light:new ve(new Tn(204,204,204,.4)),hcDark:new ve(new Tn(111,195,223)),hcLight:Ln},C("keybindingLabelBorder","Keybinding label border color. The keybinding label is used to represent a keyboard shortcut.")),Int=J("keybindingLabel.bottomBorder",{dark:new ve(new Tn(68,68,68,.6)),light:new ve(new Tn(187,187,187,.4)),hcDark:new ve(new Tn(111,195,223)),hcLight:Ke},C("keybindingLabelBottomBorder","Keybinding label border bottom color. The keybinding label is used to represent a keyboard shortcut.")),Sm=J("editor.selectionBackground",{light:"#ADD6FF",dark:"#264F78",hcDark:"#f3f518",hcLight:"#0F4A85"},C("editorSelectionBackground","Color of the editor selection.")),Tnt=J("editor.selectionForeground",{light:null,dark:null,hcDark:"#000000",hcLight:ve.white},C("editorSelectionForeground","Color of the selected text for high contrast.")),sbe=J("editor.inactiveSelectionBackground",{light:St(Sm,.5),dark:St(Sm,.5),hcDark:St(Sm,.7),hcLight:St(Sm,.5)},C("editorInactiveSelection","Color of the selection in an inactive editor. The color must not be opaque so as not to hide underlying decorations."),!0),xG=J("editor.selectionHighlightBackground",{light:Rre(Sm,mr,.3,.6),dark:Rre(Sm,mr,.3,.6),hcDark:null,hcLight:null},C("editorSelectionHighlight","Color for regions with the same content as the selection. The color must not be opaque so as not to hide underlying decorations."),!0);J("editor.selectionHighlightBorder",{light:null,dark:null,hcDark:Wi,hcLight:Wi},C("editorSelectionHighlightBorder","Border color for regions with the same content as the selection."));const Nnt=J("editor.findMatchBackground",{light:"#A8AC94",dark:"#515C6A",hcDark:null,hcLight:null},C("editorFindMatch","Color of the current search match.")),Jh=J("editor.findMatchHighlightBackground",{light:"#EA5C0055",dark:"#EA5C0055",hcDark:null,hcLight:null},C("findMatchHighlight","Color of the other search matches. The color must not be opaque so as not to hide underlying decorations."),!0),Rnt=J("editor.findRangeHighlightBackground",{dark:"#3a3d4166",light:"#b4b4b44d",hcDark:null,hcLight:null},C("findRangeHighlight","Color of the range limiting the search. The color must not be opaque so as not to hide underlying decorations."),!0),Mnt=J("editor.findMatchBorder",{light:null,dark:null,hcDark:Wi,hcLight:Wi},C("editorFindMatchBorder","Border color of the current search match.")),xm=J("editor.findMatchHighlightBorder",{light:null,dark:null,hcDark:Wi,hcLight:Wi},C("findMatchHighlightBorder","Border color of the other search matches.")),Ant=J("editor.findRangeHighlightBorder",{dark:null,light:null,hcDark:St(Wi,.4),hcLight:St(Wi,.4)},C("findRangeHighlightBorder","Border color of the range limiting the search. The color must not be opaque so as not to hide underlying decorations."),!0);J("searchEditor.findMatchBackground",{light:St(Jh,.66),dark:St(Jh,.66),hcDark:Jh,hcLight:Jh},C("searchEditor.queryMatch","Color of the Search Editor query matches."));J("searchEditor.findMatchBorder",{light:St(xm,.66),dark:St(xm,.66),hcDark:xm,hcLight:xm},C("searchEditor.editorFindMatchBorder","Border color of the Search Editor query matches."));J("search.resultsInfoForeground",{light:Ke,dark:St(Ke,.65),hcDark:Ke,hcLight:Ke},C("search.resultsInfoForeground","Color of the text in the search viewlet's completion message."));J("editor.hoverHighlightBackground",{light:"#ADD6FF26",dark:"#264f7840",hcDark:"#ADD6FF26",hcLight:null},C("hoverHighlight","Highlight below the word for which a hover is shown. The color must not be opaque so as not to hide underlying decorations."),!0);const sP=J("editorHoverWidget.background",{light:po,dark:po,hcDark:po,hcLight:po},C("hoverBackground","Background color of the editor hover."));J("editorHoverWidget.foreground",{light:Zh,dark:Zh,hcDark:Zh,hcLight:Zh},C("hoverForeground","Foreground color of the editor hover."));const Pnt=J("editorHoverWidget.border",{light:Qh,dark:Qh,hcDark:Qh,hcLight:Qh},C("hoverBorder","Border color of the editor hover."));J("editorHoverWidget.statusBarBackground",{dark:Vd(sP,.2),light:Vb(sP,.05),hcDark:po,hcLight:po},C("statusBarBackground","Background color of the editor hover status bar."));const Ont=J("editorLink.activeForeground",{dark:"#4E94CE",light:ve.blue,hcDark:ve.cyan,hcLight:"#292929"},C("activeLinkForeground","Color of active links.")),Og=J("editorInlayHint.foreground",{dark:"#969696",light:"#969696",hcDark:ve.white,hcLight:ve.black},C("editorInlayHintForeground","Foreground color of inline hints")),Fg=J("editorInlayHint.background",{dark:St(lM,.1),light:St(lM,.1),hcDark:St(ve.white,.1),hcLight:St(lM,.1)},C("editorInlayHintBackground","Background color of inline hints")),Fnt=J("editorInlayHint.typeForeground",{dark:Og,light:Og,hcDark:Og,hcLight:Og},C("editorInlayHintForegroundTypes","Foreground color of inline hints for types")),Bnt=J("editorInlayHint.typeBackground",{dark:Fg,light:Fg,hcDark:Fg,hcLight:Fg},C("editorInlayHintBackgroundTypes","Background color of inline hints for types")),Wnt=J("editorInlayHint.parameterForeground",{dark:Og,light:Og,hcDark:Og,hcLight:Og},C("editorInlayHintForegroundParameter","Foreground color of inline hints for parameters")),Vnt=J("editorInlayHint.parameterBackground",{dark:Fg,light:Fg,hcDark:Fg,hcLight:Fg},C("editorInlayHintBackgroundParameter","Background color of inline hints for parameters"));J("editorLightBulb.foreground",{dark:"#FFCC00",light:"#DDB100",hcDark:"#FFCC00",hcLight:"#007ACC"},C("editorLightBulbForeground","The color used for the lightbulb actions icon."));J("editorLightBulbAutoFix.foreground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},C("editorLightBulbAutoFixForeground","The color used for the lightbulb auto fix actions icon."));const fH=new ve(new Tn(155,185,85,.2)),gH=new ve(new Tn(255,0,0,.2)),Hnt=J("diffEditor.insertedTextBackground",{dark:"#9ccc2c33",light:"#9ccc2c40",hcDark:null,hcLight:null},C("diffEditorInserted","Background color for text that got inserted. The color must not be opaque so as not to hide underlying decorations."),!0),$nt=J("diffEditor.removedTextBackground",{dark:"#ff000033",light:"#ff000033",hcDark:null,hcLight:null},C("diffEditorRemoved","Background color for text that got removed. The color must not be opaque so as not to hide underlying decorations."),!0);J("diffEditor.insertedLineBackground",{dark:fH,light:fH,hcDark:null,hcLight:null},C("diffEditorInsertedLines","Background color for lines that got inserted. The color must not be opaque so as not to hide underlying decorations."),!0);J("diffEditor.removedLineBackground",{dark:gH,light:gH,hcDark:null,hcLight:null},C("diffEditorRemovedLines","Background color for lines that got removed. The color must not be opaque so as not to hide underlying decorations."),!0);J("diffEditorGutter.insertedLineBackground",{dark:null,light:null,hcDark:null,hcLight:null},C("diffEditorInsertedLineGutter","Background color for the margin where lines got inserted."));J("diffEditorGutter.removedLineBackground",{dark:null,light:null,hcDark:null,hcLight:null},C("diffEditorRemovedLineGutter","Background color for the margin where lines got removed."));const znt=J("diffEditorOverview.insertedForeground",{dark:null,light:null,hcDark:null,hcLight:null},C("diffEditorOverviewInserted","Diff overview ruler foreground for inserted content.")),Unt=J("diffEditorOverview.removedForeground",{dark:null,light:null,hcDark:null,hcLight:null},C("diffEditorOverviewRemoved","Diff overview ruler foreground for removed content."));J("diffEditor.insertedTextBorder",{dark:null,light:null,hcDark:"#33ff2eff",hcLight:"#374E06"},C("diffEditorInsertedOutline","Outline color for the text that got inserted."));J("diffEditor.removedTextBorder",{dark:null,light:null,hcDark:"#FF008F",hcLight:"#AD0707"},C("diffEditorRemovedOutline","Outline color for text that got removed."));J("diffEditor.border",{dark:null,light:null,hcDark:Ln,hcLight:Ln},C("diffEditorBorder","Border color between the two text editors."));J("diffEditor.diagonalFill",{dark:"#cccccc33",light:"#22222233",hcDark:null,hcLight:null},C("diffDiagonalFill","Color of the diff editor's diagonal fill. The diagonal fill is used in side-by-side diff views."));J("diffEditor.unchangedRegionBackground",{dark:"#3e3e3e",light:"#e4e4e4",hcDark:null,hcLight:null},C("diffEditor.unchangedRegionBackground","The background color of unchanged blocks in the diff editor."));J("diffEditor.unchangedRegionForeground",{dark:"#a3a2a2",light:"#4d4c4c",hcDark:null,hcLight:null},C("diffEditor.unchangedRegionForeground","The foreground color of unchanged blocks in the diff editor."));J("diffEditor.unchangedCodeBackground",{dark:"#74747429",light:"#b8b8b829",hcDark:null,hcLight:null},C("diffEditor.unchangedCodeBackground","The background color of unchanged code in the diff editor."));const jnt=J("list.focusBackground",{dark:null,light:null,hcDark:null,hcLight:null},C("listFocusBackground","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.")),Knt=J("list.focusForeground",{dark:null,light:null,hcDark:null,hcLight:null},C("listFocusForeground","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.")),qnt=J("list.focusOutline",{dark:Hl,light:Hl,hcDark:Wi,hcLight:Wi},C("listFocusOutline","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.")),Gnt=J("list.focusAndSelectionOutline",{dark:null,light:null,hcDark:null,hcLight:null},C("listFocusAndSelectionOutline","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.")),Bg=J("list.activeSelectionBackground",{dark:"#04395E",light:"#0060C0",hcDark:null,hcLight:ve.fromHex("#0F4A85").transparent(.1)},C("listActiveSelectionBackground","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.")),ef=J("list.activeSelectionForeground",{dark:ve.white,light:ve.white,hcDark:null,hcLight:null},C("listActiveSelectionForeground","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.")),SL=J("list.activeSelectionIconForeground",{dark:null,light:null,hcDark:null,hcLight:null},C("listActiveSelectionIconForeground","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.")),Xnt=J("list.inactiveSelectionBackground",{dark:"#37373D",light:"#E4E6F1",hcDark:null,hcLight:ve.fromHex("#0F4A85").transparent(.1)},C("listInactiveSelectionBackground","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.")),Ynt=J("list.inactiveSelectionForeground",{dark:null,light:null,hcDark:null,hcLight:null},C("listInactiveSelectionForeground","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.")),Znt=J("list.inactiveSelectionIconForeground",{dark:null,light:null,hcDark:null,hcLight:null},C("listInactiveSelectionIconForeground","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.")),Qnt=J("list.inactiveFocusBackground",{dark:null,light:null,hcDark:null,hcLight:null},C("listInactiveFocusBackground","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.")),Jnt=J("list.inactiveFocusOutline",{dark:null,light:null,hcDark:null,hcLight:null},C("listInactiveFocusOutline","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.")),abe=J("list.hoverBackground",{dark:"#2A2D2E",light:"#F0F0F0",hcDark:ve.white.transparent(.1),hcLight:ve.fromHex("#0F4A85").transparent(.1)},C("listHoverBackground","List/Tree background when hovering over items using the mouse.")),lbe=J("list.hoverForeground",{dark:null,light:null,hcDark:null,hcLight:null},C("listHoverForeground","List/Tree foreground when hovering over items using the mouse.")),eit=J("list.dropBackground",{dark:"#062F4A",light:"#D6EBFF",hcDark:null,hcLight:null},C("listDropBackground","List/Tree drag and drop background when moving items around using the mouse.")),xu=J("list.highlightForeground",{dark:"#2AAAFF",light:"#0066BF",hcDark:Hl,hcLight:Hl},C("highlight","List/Tree foreground color of the match highlights when searching inside the list/tree.")),c2=J("list.focusHighlightForeground",{dark:xu,light:Tit(Bg,xu,"#BBE7FF"),hcDark:xu,hcLight:xu},C("listFocusHighlightForeground","List/Tree foreground color of the match highlights on actively focused items when searching inside the list/tree."));J("list.invalidItemForeground",{dark:"#B89500",light:"#B89500",hcDark:"#B89500",hcLight:"#B5200D"},C("invalidItemForeground","List/Tree foreground color for invalid items, for example an unresolved root in explorer."));J("list.errorForeground",{dark:"#F88070",light:"#B01011",hcDark:null,hcLight:null},C("listErrorForeground","Foreground color of list items containing errors."));J("list.warningForeground",{dark:"#CCA700",light:"#855F00",hcDark:null,hcLight:null},C("listWarningForeground","Foreground color of list items containing warnings."));const tit=J("listFilterWidget.background",{light:Vb(po,0),dark:Vd(po,0),hcDark:po,hcLight:po},C("listFilterWidgetBackground","Background color of the type filter widget in lists and trees.")),nit=J("listFilterWidget.outline",{dark:ve.transparent,light:ve.transparent,hcDark:"#f38518",hcLight:"#007ACC"},C("listFilterWidgetOutline","Outline color of the type filter widget in lists and trees.")),iit=J("listFilterWidget.noMatchesOutline",{dark:"#BE1100",light:"#BE1100",hcDark:Ln,hcLight:Ln},C("listFilterWidgetNoMatchesOutline","Outline color of the type filter widget in lists and trees, when there are no matches.")),oit=J("listFilterWidget.shadow",{dark:Gh,light:Gh,hcDark:Gh,hcLight:Gh},C("listFilterWidgetShadow","Shadow color of the type filter widget in lists and trees."));J("list.filterMatchBackground",{dark:Jh,light:Jh,hcDark:null,hcLight:null},C("listFilterMatchHighlight","Background color of the filtered match."));J("list.filterMatchBorder",{dark:xm,light:xm,hcDark:Ln,hcLight:Wi},C("listFilterMatchHighlightBorder","Border color of the filtered match."));const xL=J("tree.indentGuidesStroke",{dark:"#585858",light:"#a9a9a9",hcDark:"#a9a9a9",hcLight:"#a5a5a5"},C("treeIndentGuidesStroke","Tree stroke color for the indentation guides.")),rit=J("tree.inactiveIndentGuidesStroke",{dark:St(xL,.4),light:St(xL,.4),hcDark:St(xL,.4),hcLight:St(xL,.4)},C("treeInactiveIndentGuidesStroke","Tree stroke color for the indentation guides that are not active.")),sit=J("tree.tableColumnsBorder",{dark:"#CCCCCC20",light:"#61616120",hcDark:null,hcLight:null},C("tableColumnsBorder","Table border color between columns.")),ait=J("tree.tableOddRowsBackground",{dark:St(Ke,.04),light:St(Ke,.04),hcDark:null,hcLight:null},C("tableOddRowsBackgroundColor","Background color for odd table rows."));J("list.deemphasizedForeground",{dark:"#8C8C8C",light:"#8E8E90",hcDark:"#A7A8A9",hcLight:"#666666"},C("listDeemphasizedForeground","List/Tree foreground color for items that are deemphasized. "));const lit=J("checkbox.background",{dark:Xh,light:Xh,hcDark:Xh,hcLight:Xh},C("checkbox.background","Background color of checkbox widget."));J("checkbox.selectBackground",{dark:po,light:po,hcDark:po,hcLight:po},C("checkbox.select.background","Background color of checkbox widget when the element it's in is selected."));const cit=J("checkbox.foreground",{dark:Pg,light:Pg,hcDark:Pg,hcLight:Pg},C("checkbox.foreground","Foreground color of checkbox widget.")),uit=J("checkbox.border",{dark:MC,light:MC,hcDark:MC,hcLight:MC},C("checkbox.border","Border color of checkbox widget."));J("checkbox.selectBorder",{dark:wm,light:wm,hcDark:wm,hcLight:wm},C("checkbox.select.border","Border color of checkbox widget when the element it's in is selected."));const Ere=J("quickInput.list.focusBackground",{dark:null,light:null,hcDark:null,hcLight:null},"",void 0,C("quickInput.list.focusBackground deprecation","Please use quickInputList.focusBackground instead")),h0=J("quickInputList.focusForeground",{dark:ef,light:ef,hcDark:ef,hcLight:ef},C("quickInput.listFocusForeground","Quick picker foreground color for the focused item.")),AC=J("quickInputList.focusIconForeground",{dark:SL,light:SL,hcDark:SL,hcLight:SL},C("quickInput.listFocusIconForeground","Quick picker icon foreground color for the focused item.")),f0=J("quickInputList.focusBackground",{dark:YD(Ere,Bg),light:YD(Ere,Bg),hcDark:null,hcLight:null},C("quickInput.listFocusBackground","Quick picker background color for the focused item.")),dit=J("menu.border",{dark:null,light:null,hcDark:Ln,hcLight:Ln},C("menuBorder","Border color of menus.")),hit=J("menu.foreground",{dark:Pg,light:Pg,hcDark:Pg,hcLight:Pg},C("menuForeground","Foreground color of menu items.")),fit=J("menu.background",{dark:Xh,light:Xh,hcDark:Xh,hcLight:Xh},C("menuBackground","Background color of menu items.")),git=J("menu.selectionForeground",{dark:ef,light:ef,hcDark:ef,hcLight:ef},C("menuSelectionForeground","Foreground color of the selected menu item in menus.")),pit=J("menu.selectionBackground",{dark:Bg,light:Bg,hcDark:Bg,hcLight:Bg},C("menuSelectionBackground","Background color of the selected menu item in menus.")),mit=J("menu.selectionBorder",{dark:null,light:null,hcDark:Wi,hcLight:Wi},C("menuSelectionBorder","Border color of the selected menu item in menus.")),vit=J("menu.separatorBackground",{dark:"#606060",light:"#D4D4D4",hcDark:Ln,hcLight:Ln},C("menuSeparatorBackground","Color of a separator menu item in menus.")),pH=J("toolbar.hoverBackground",{dark:"#5a5d5e50",light:"#b8b8b850",hcDark:null,hcLight:null},C("toolbarHoverBackground","Toolbar background when hovering over actions using the mouse"));J("toolbar.hoverOutline",{dark:null,light:null,hcDark:Wi,hcLight:Wi},C("toolbarHoverOutline","Toolbar outline when hovering over actions using the mouse"));J("toolbar.activeBackground",{dark:Vd(pH,.1),light:Vb(pH,.1),hcDark:null,hcLight:null},C("toolbarActiveBackground","Toolbar background when holding the mouse over actions"));J("editor.snippetTabstopHighlightBackground",{dark:new ve(new Tn(124,124,124,.3)),light:new ve(new Tn(10,50,100,.2)),hcDark:new ve(new Tn(124,124,124,.3)),hcLight:new ve(new Tn(10,50,100,.2))},C("snippetTabstopHighlightBackground","Highlight background color of a snippet tabstop."));J("editor.snippetTabstopHighlightBorder",{dark:null,light:null,hcDark:null,hcLight:null},C("snippetTabstopHighlightBorder","Highlight border color of a snippet tabstop."));J("editor.snippetFinalTabstopHighlightBackground",{dark:null,light:null,hcDark:null,hcLight:null},C("snippetFinalTabstopHighlightBackground","Highlight background color of the final tabstop of a snippet."));J("editor.snippetFinalTabstopHighlightBorder",{dark:"#525252",light:new ve(new Tn(10,50,100,.5)),hcDark:"#525252",hcLight:"#292929"},C("snippetFinalTabstopHighlightBorder","Highlight border color of the final tabstop of a snippet."));const _it=J("breadcrumb.foreground",{light:St(Ke,.8),dark:St(Ke,.8),hcDark:St(Ke,.8),hcLight:St(Ke,.8)},C("breadcrumbsFocusForeground","Color of focused breadcrumb items.")),bit=J("breadcrumb.background",{light:mr,dark:mr,hcDark:mr,hcLight:mr},C("breadcrumbsBackground","Background color of breadcrumb items.")),Dre=J("breadcrumb.focusForeground",{light:Vb(Ke,.2),dark:Vd(Ke,.1),hcDark:Vd(Ke,.1),hcLight:Vd(Ke,.1)},C("breadcrumbsFocusForeground","Color of focused breadcrumb items.")),Cit=J("breadcrumb.activeSelectionForeground",{light:Vb(Ke,.2),dark:Vd(Ke,.1),hcDark:Vd(Ke,.1),hcLight:Vd(Ke,.1)},C("breadcrumbsSelectedForeground","Color of selected breadcrumb items."));J("breadcrumbPicker.background",{light:po,dark:po,hcDark:po,hcLight:po},C("breadcrumbsSelectedBackground","Background color of breadcrumb item picker."));const cbe=.5,kre=ve.fromHex("#40C8AE").transparent(cbe),Ire=ve.fromHex("#40A6FF").transparent(cbe),Tre=ve.fromHex("#606060").transparent(.4),Lu=.4,ww=1,PC=J("merge.currentHeaderBackground",{dark:kre,light:kre,hcDark:null,hcLight:null},C("mergeCurrentHeaderBackground","Current header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);J("merge.currentContentBackground",{dark:St(PC,Lu),light:St(PC,Lu),hcDark:St(PC,Lu),hcLight:St(PC,Lu)},C("mergeCurrentContentBackground","Current content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);const OC=J("merge.incomingHeaderBackground",{dark:Ire,light:Ire,hcDark:null,hcLight:null},C("mergeIncomingHeaderBackground","Incoming header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);J("merge.incomingContentBackground",{dark:St(OC,Lu),light:St(OC,Lu),hcDark:St(OC,Lu),hcLight:St(OC,Lu)},C("mergeIncomingContentBackground","Incoming content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);const FC=J("merge.commonHeaderBackground",{dark:Tre,light:Tre,hcDark:null,hcLight:null},C("mergeCommonHeaderBackground","Common ancestor header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);J("merge.commonContentBackground",{dark:St(FC,Lu),light:St(FC,Lu),hcDark:St(FC,Lu),hcLight:St(FC,Lu)},C("mergeCommonContentBackground","Common ancestor content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);const Sw=J("merge.border",{dark:null,light:null,hcDark:"#C3DF6F",hcLight:"#007ACC"},C("mergeBorder","Border color on headers and the splitter in inline merge-conflicts."));J("editorOverviewRuler.currentContentForeground",{dark:St(PC,ww),light:St(PC,ww),hcDark:Sw,hcLight:Sw},C("overviewRulerCurrentContentForeground","Current overview ruler foreground for inline merge-conflicts."));J("editorOverviewRuler.incomingContentForeground",{dark:St(OC,ww),light:St(OC,ww),hcDark:Sw,hcLight:Sw},C("overviewRulerIncomingContentForeground","Incoming overview ruler foreground for inline merge-conflicts."));J("editorOverviewRuler.commonContentForeground",{dark:St(FC,ww),light:St(FC,ww),hcDark:Sw,hcLight:Sw},C("overviewRulerCommonContentForeground","Common ancestor overview ruler foreground for inline merge-conflicts."));const LG=J("editorOverviewRuler.findMatchForeground",{dark:"#d186167e",light:"#d186167e",hcDark:"#AB5A00",hcLight:""},C("overviewRulerFindMatchForeground","Overview ruler marker color for find matches. The color must not be opaque so as not to hide underlying decorations."),!0),LL=J("editorOverviewRuler.selectionHighlightForeground",{dark:"#A0A0A0CC",light:"#A0A0A0CC",hcDark:"#A0A0A0CC",hcLight:"#A0A0A0CC"},C("overviewRulerSelectionHighlightForeground","Overview ruler marker color for selection highlights. The color must not be opaque so as not to hide underlying decorations."),!0),BC=J("minimap.findMatchHighlight",{light:"#d18616",dark:"#d18616",hcDark:"#AB5A00",hcLight:"#0F4A85"},C("minimapFindMatchHighlight","Minimap marker color for find matches."),!0),g5=J("minimap.selectionOccurrenceHighlight",{light:"#c9c9c9",dark:"#676767",hcDark:"#ffffff",hcLight:"#0F4A85"},C("minimapSelectionOccurrenceHighlight","Minimap marker color for repeating editor selections."),!0),Nre=J("minimap.selectionHighlight",{light:"#ADD6FF",dark:"#264F78",hcDark:"#ffffff",hcLight:"#0F4A85"},C("minimapSelectionHighlight","Minimap marker color for the editor selection."),!0),yit=J("minimap.infoHighlight",{dark:Ma,light:Ma,hcDark:XD,hcLight:XD},C("minimapInfo","Minimap marker color for infos.")),wit=J("minimap.warningHighlight",{dark:$l,light:$l,hcDark:GD,hcLight:GD},C("overviewRuleWarning","Minimap marker color for warnings.")),Sit=J("minimap.errorHighlight",{dark:new ve(new Tn(255,18,18,.7)),light:new ve(new Tn(255,18,18,.7)),hcDark:new ve(new Tn(255,50,50,1)),hcLight:"#B5200D"},C("minimapError","Minimap marker color for errors.")),xit=J("minimap.background",{dark:null,light:null,hcDark:null,hcLight:null},C("minimapBackground","Minimap background color.")),Lit=J("minimap.foregroundOpacity",{dark:ve.fromHex("#000f"),light:ve.fromHex("#000f"),hcDark:ve.fromHex("#000f"),hcLight:ve.fromHex("#000f")},C("minimapForegroundOpacity",'Opacity of foreground elements rendered in the minimap. For example, "#000000c0" will render the elements with 75% opacity.'));J("minimapSlider.background",{light:St(CL,.5),dark:St(CL,.5),hcDark:St(CL,.5),hcLight:St(CL,.5)},C("minimapSliderBackground","Minimap slider background color."));J("minimapSlider.hoverBackground",{light:St(yL,.5),dark:St(yL,.5),hcDark:St(yL,.5),hcLight:St(yL,.5)},C("minimapSliderHoverBackground","Minimap slider background color when hovering."));J("minimapSlider.activeBackground",{light:St(wL,.5),dark:St(wL,.5),hcDark:St(wL,.5),hcLight:St(wL,.5)},C("minimapSliderActiveBackground","Minimap slider background color when clicked on."));const Eit=J("problemsErrorIcon.foreground",{dark:Yh,light:Yh,hcDark:Yh,hcLight:Yh},C("problemsErrorIconForeground","The color used for the problems error icon.")),Dit=J("problemsWarningIcon.foreground",{dark:$l,light:$l,hcDark:$l,hcLight:$l},C("problemsWarningIconForeground","The color used for the problems warning icon.")),kit=J("problemsInfoIcon.foreground",{dark:Ma,light:Ma,hcDark:Ma,hcLight:Ma},C("problemsInfoIconForeground","The color used for the problems info icon."));J("charts.foreground",{dark:Ke,light:Ke,hcDark:Ke,hcLight:Ke},C("chartsForeground","The foreground color used in charts."));J("charts.lines",{dark:St(Ke,.5),light:St(Ke,.5),hcDark:St(Ke,.5),hcLight:St(Ke,.5)},C("chartsLines","The color used for horizontal lines in charts."));J("charts.red",{dark:Yh,light:Yh,hcDark:Yh,hcLight:Yh},C("chartsRed","The red color used in chart visualizations."));J("charts.blue",{dark:Ma,light:Ma,hcDark:Ma,hcLight:Ma},C("chartsBlue","The blue color used in chart visualizations."));J("charts.yellow",{dark:$l,light:$l,hcDark:$l,hcLight:$l},C("chartsYellow","The yellow color used in chart visualizations."));J("charts.orange",{dark:BC,light:BC,hcDark:BC,hcLight:BC},C("chartsOrange","The orange color used in chart visualizations."));J("charts.green",{dark:"#89D185",light:"#388A34",hcDark:"#89D185",hcLight:"#374e06"},C("chartsGreen","The green color used in chart visualizations."));J("charts.purple",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},C("chartsPurple","The purple color used in chart visualizations."));function Iit(i,e){var t,n,o,r;switch(i.op){case 0:return(t=sd(i.value,e))===null||t===void 0?void 0:t.darken(i.factor);case 1:return(n=sd(i.value,e))===null||n===void 0?void 0:n.lighten(i.factor);case 2:return(o=sd(i.value,e))===null||o===void 0?void 0:o.transparent(i.factor);case 3:{const s=sd(i.background,e);return s?(r=sd(i.value,e))===null||r===void 0?void 0:r.makeOpaque(s):sd(i.value,e)}case 4:for(const s of i.values){const a=sd(s,e);if(a)return a}return;case 6:return sd(e.defines(i.if)?i.then:i.else,e);case 5:{const s=sd(i.value,e);if(!s)return;const a=sd(i.background,e);return a?s.isDarkerThan(a)?ve.getLighterColor(s,a,i.factor).transparent(i.transparency):ve.getDarkerColor(s,a,i.factor).transparent(i.transparency):s.transparent(i.factor*i.transparency)}default:throw Z4()}}function Vb(i,e){return{op:0,value:i,factor:e}}function Vd(i,e){return{op:1,value:i,factor:e}}function St(i,e){return{op:2,value:i,factor:e}}function YD(...i){return{op:4,values:i}}function Tit(i,e,t){return{op:6,if:i,then:e,else:t}}function Rre(i,e,t,n){return{op:5,value:i,background:e,factor:t,transparency:n}}function sd(i,e){if(i!==null){if(typeof i=="string")return i[0]==="#"?ve.fromHex(i):e.getColor(i);if(i instanceof ve)return i;if(typeof i=="object")return Iit(i,e)}}const ube="vscode://schemas/workbench-colors",dbe=no.as(l5.JSONContribution);dbe.registerSchema(ube,f5.getColorSchema());const Mre=new bi(()=>dbe.notifySchemaChanged(ube),200);f5.onDidChangeSchema(()=>{Mre.isScheduled()||Mre.schedule()});class p5{constructor(e,t){this.x=e,this.y=t,this._pageCoordinatesBrand=void 0}toClientCoordinates(){return new hbe(this.x-window.scrollX,this.y-window.scrollY)}}class hbe{constructor(e,t){this.clientX=e,this.clientY=t,this._clientCoordinatesBrand=void 0}toPageCoordinates(){return new p5(this.clientX+window.scrollX,this.clientY+window.scrollY)}}class Nit{constructor(e,t,n,o){this.x=e,this.y=t,this.width=n,this.height=o,this._editorPagePositionBrand=void 0}}class Rit{constructor(e,t){this.x=e,this.y=t,this._positionRelativeToEditorBrand=void 0}}function EG(i){const e=Yo(i);return new Nit(e.left,e.top,e.width,e.height)}function DG(i,e,t){const n=e.width/i.offsetWidth,o=e.height/i.offsetHeight,r=(t.x-e.x)/n,s=(t.y-e.y)/o;return new Rit(r,s)}class Dv extends kc{constructor(e,t,n){super(e),this._editorMouseEventBrand=void 0,this.isFromPointerCapture=t,this.pos=new p5(this.posx,this.posy),this.editorPos=EG(n),this.relativePos=DG(n,this.editorPos,this.pos)}}class Mit{constructor(e){this._editorViewDomNode=e}_create(e){return new Dv(e,!1,this._editorViewDomNode)}onContextMenu(e,t){return ke(e,"contextmenu",n=>{t(this._create(n))})}onMouseUp(e,t){return ke(e,"mouseup",n=>{t(this._create(n))})}onMouseDown(e,t){return ke(e,et.MOUSE_DOWN,n=>{t(this._create(n))})}onPointerDown(e,t){return ke(e,et.POINTER_DOWN,n=>{t(this._create(n),n.pointerId)})}onMouseLeave(e,t){return ke(e,et.MOUSE_LEAVE,n=>{t(this._create(n))})}onMouseMove(e,t){return ke(e,"mousemove",n=>t(this._create(n)))}}class Ait{constructor(e){this._editorViewDomNode=e}_create(e){return new Dv(e,!1,this._editorViewDomNode)}onPointerUp(e,t){return ke(e,"pointerup",n=>{t(this._create(n))})}onPointerDown(e,t){return ke(e,et.POINTER_DOWN,n=>{t(this._create(n),n.pointerId)})}onPointerLeave(e,t){return ke(e,et.POINTER_LEAVE,n=>{t(this._create(n))})}onPointerMove(e,t){return ke(e,"pointermove",n=>t(this._create(n)))}}class Pit extends _e{constructor(e){super(),this._editorViewDomNode=e,this._globalPointerMoveMonitor=this._register(new yS),this._keydownListener=null}startMonitoring(e,t,n,o,r){this._keydownListener=No(e.ownerDocument,"keydown",s=>{s.toKeyCodeChord().isModifierKey()||this._globalPointerMoveMonitor.stopMonitoring(!0,s.browserEvent)},!0),this._globalPointerMoveMonitor.startMonitoring(e,t,n,s=>{o(new Dv(s,!0,this._editorViewDomNode))},s=>{this._keydownListener.dispose(),r(s)})}stopMonitoring(){this._globalPointerMoveMonitor.stopMonitoring(!0)}}class qI{constructor(e){this._editor=e,this._instanceId=++qI._idPool,this._counter=0,this._rules=new Map,this._garbageCollectionScheduler=new bi(()=>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 n=this._rules.get(t);if(!n){const o=this._counter++;n=new Oit(t,`dyn-rule-${this._instanceId}-${o}`,qA(this._editor.getContainerDomNode())?this._editor.getContainerDomNode():void 0,e),this._rules.set(t,n)}return n}computeUniqueKey(e){return JSON.stringify(e)}garbageCollect(){for(const e of this._rules.values())e.hasReferences()||(this._rules.delete(e.key),e.dispose())}}qI._idPool=0;class Oit{constructor(e,t,n,o){this.key=e,this.className=t,this.properties=o,this._referenceCount=0,this._styleElement=Wc(n),this._styleElement.textContent=this.getCssText(this.className,this.properties)}getCssText(e,t){let n=`.${e} {`;for(const o in t){const r=t[o];let s;typeof r=="object"?s=ct(r.id):s=r,n+=` + ${Fit(o)}: ${s};`}return n+=` +}`,n}dispose(){this._styleElement.remove()}increaseRefCount(){this._referenceCount++}decreaseRefCount(){this._referenceCount--}hasReferences(){return this._referenceCount>0}}function Fit(i){return i.replace(/(^[A-Z])/,([e])=>e.toLowerCase()).replace(/([A-Z])/g,([e])=>`-${e.toLowerCase()}`)}class GI extends _e{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 n=0,o=e.length;n=a.left?o.width=Math.max(o.width,a.left+a.width-o.left):(t[n++]=o,o=a)}return t[n++]=o,t}static _createHorizontalRangesFromClientRects(e,t,n){if(!e||e.length===0)return null;const o=[];for(let r=0,s=e.length;rl)return null;if(t=Math.min(l,Math.max(0,t)),o=Math.min(l,Math.max(0,o)),t===o&&n===r&&n===0&&!e.children[t].firstChild){const h=e.children[t].getClientRects();return s.markDidDomLayout(),this._createHorizontalRangesFromClientRects(h,s.clientRectDeltaLeft,s.clientRectScale)}t!==o&&o>0&&r===0&&(o--,r=1073741824);let c=e.children[t].firstChild,u=e.children[o].firstChild;if((!c||!u)&&(!c&&n===0&&t>0&&(c=e.children[t-1].firstChild,n=1073741824),!u&&r===0&&o>0&&(u=e.children[o-1].firstChild,r=1073741824)),!c||!u)return null;n=Math.min(c.textContent.length,Math.max(0,n)),r=Math.min(u.textContent.length,Math.max(0,r));const d=this._readClientRects(c,n,u,r,s.endNode);return s.markDidDomLayout(),this._createHorizontalRangesFromClientRects(d,s.clientRectDeltaLeft,s.clientRectScale)}}var Ic;(function(i){i.DARK="dark",i.LIGHT="light",i.HIGH_CONTRAST_DARK="hcDark",i.HIGH_CONTRAST_LIGHT="hcLight"})(Ic||(Ic={}));function Hd(i){return i===Ic.HIGH_CONTRAST_DARK||i===Ic.HIGH_CONTRAST_LIGHT}function xw(i){return i===Ic.DARK||i===Ic.HIGH_CONTRAST_DARK}const $it=function(){return Fd?!0:!(xs||Fc||ap)}();let Sy=!0;class Pre{constructor(e,t){this.themeType=t;const n=e.options,o=n.get(50);n.get(38)==="off"?this.renderWhitespace=n.get(98):this.renderWhitespace="none",this.renderControlCharacters=n.get(93),this.spaceWidth=o.spaceWidth,this.middotWidth=o.middotWidth,this.wsmiddotWidth=o.wsmiddotWidth,this.useMonospaceOptimizations=o.isMonospace&&!n.get(33),this.canUseHalfwidthRightwardsArrow=o.canUseHalfwidthRightwardsArrow,this.lineHeight=n.get(66),this.stopRenderingLineAfter=n.get(116),this.fontLigatures=n.get(51)}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}}class Oh{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=ti(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 Hd(this._options.themeType)||this._options.renderWhitespace==="selection"?(this._isMaybeInvalid=!0,!0):!1}renderLine(e,t,n,o){if(this._isMaybeInvalid===!1)return!1;this._isMaybeInvalid=!1;const r=n.getViewLineRenderingData(e),s=this._options,a=rl.filter(r.inlineDecorations,e,r.minColumn,r.maxColumn);let l=null;if(Hd(s.themeType)||this._options.renderWhitespace==="selection"){const h=n.selections;for(const f of h){if(f.endLineNumbere)continue;const g=f.startLineNumber===e?f.startColumn:r.minColumn,p=f.endLineNumber===e?f.endColumn:r.maxColumn;g');const u=jI(c,o);o.appendString("");let d=null;return Sy&&$it&&r.isBasicASCII&&s.useMonospaceOptimizations&&u.containsForeignElements===0&&(d=new u2(this._renderedViewLine?this._renderedViewLine.domNode:null,c,u.characterMapping)),d||(d=gbe(this._renderedViewLine?this._renderedViewLine.domNode:null,c,u.characterMapping,u.containsRTL,u.containsForeignElements)),this._renderedViewLine=d,!0}layoutLine(e,t){this._renderedViewLine&&this._renderedViewLine.domNode&&(this._renderedViewLine.domNode.setTop(t),this._renderedViewLine.domNode.setHeight(this._options.lineHeight))}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 u2:!1}monospaceAssumptionsAreValid(){return this._renderedViewLine&&this._renderedViewLine instanceof u2?this._renderedViewLine.monospaceAssumptionsAreValid():Sy}onMonospaceAssumptionsInvalidated(){this._renderedViewLine&&this._renderedViewLine instanceof u2&&(this._renderedViewLine=this._renderedViewLine.toSlowRenderedLine())}getVisibleRangesForRange(e,t,n,o){if(!this._renderedViewLine)return null;t=Math.min(this._renderedViewLine.input.lineContent.length+1,Math.max(1,t)),n=Math.min(this._renderedViewLine.input.lineContent.length+1,Math.max(1,n));const r=this._renderedViewLine.input.stopRenderingLineAfter;if(r!==-1&&t>r+1&&n>r+1)return new Are(!0,[new k0(this.getWidth(o),0)]);r!==-1&&t>r+1&&(t=r+1),r!==-1&&n>r+1&&(n=r+1);const s=this._renderedViewLine.getVisibleRangesForRange(e,t,n,o);return s&&s.length>0?new Are(!1,s):null}getColumnOfNodeOffset(e,t){return this._renderedViewLine?this._renderedViewLine.getColumnOfNodeOffset(e,t):1}}Oh.CLASS_NAME="view-line";class u2{constructor(e,t,n){this._cachedWidth=-1,this.domNode=e,this.input=t;const o=Math.floor(t.lineContent.length/300);if(o>0){this._keyColumnPixelOffsetCache=new Float32Array(o);for(let r=0;r=2&&(console.warn("monospace assumptions have been violated, therefore disabling monospace optimizations!"),Sy=!1)}return Sy}toSlowRenderedLine(){return gbe(this.domNode,this.input,this._characterMapping,!1,0)}getVisibleRangesForRange(e,t,n,o){const r=this._getColumnPixelOffset(e,t,o),s=this._getColumnPixelOffset(e,n,o);return[new k0(r,s-r)]}_getColumnPixelOffset(e,t,n){if(t<=300){const c=this._characterMapping.getHorizontalOffset(t);return this._charWidth*c}const o=Math.floor((t-1)/300)-1,r=(o+1)*300+1;let s=-1;if(this._keyColumnPixelOffsetCache&&(s=this._keyColumnPixelOffsetCache[o],s===-1&&(s=this._actualReadPixelOffset(e,r,n),this._keyColumnPixelOffsetCache[o]=s)),s===-1){const c=this._characterMapping.getHorizontalOffset(t);return this._charWidth*c}const a=this._characterMapping.getHorizontalOffset(r),l=this._characterMapping.getHorizontalOffset(t);return s+this._charWidth*(l-a)}_getReadingTarget(e){return e.domNode.firstChild}_actualReadPixelOffset(e,t,n){if(!this.domNode)return-1;const o=this._characterMapping.getDomPosition(t),r=cM.readHorizontalRanges(this._getReadingTarget(this.domNode),o.partIndex,o.charIndex,o.partIndex,o.charIndex,n);return!r||r.length===0?-1:r[0].left}getColumnOfNodeOffset(e,t){return kG(this._characterMapping,e,t)}}class fbe{constructor(e,t,n,o,r){if(this.domNode=e,this.input=t,this._characterMapping=n,this._isWhitespaceOnly=/^\s*$/.test(t.lineContent),this._containsForeignElements=r,this._cachedWidth=-1,this._pixelOffsetCache=null,!o||this._characterMapping.length===0){this._pixelOffsetCache=new Float32Array(Math.max(2,this._characterMapping.length+1));for(let s=0,a=this._characterMapping.length;s<=a;s++)this._pixelOffsetCache[s]=-1}}_getReadingTarget(e){return e.domNode.firstChild}getWidth(e){return this.domNode?(this._cachedWidth===-1&&(this._cachedWidth=this._getReadingTarget(this.domNode).offsetWidth,e==null||e.markDidDomLayout()),this._cachedWidth):0}getWidthIsFast(){return this._cachedWidth!==-1}getVisibleRangesForRange(e,t,n,o){if(!this.domNode)return null;if(this._pixelOffsetCache!==null){const r=this._readPixelOffset(this.domNode,e,t,o);if(r===-1)return null;const s=this._readPixelOffset(this.domNode,e,n,o);return s===-1?null:[new k0(r,s-r)]}return this._readVisibleRangesForRange(this.domNode,e,t,n,o)}_readVisibleRangesForRange(e,t,n,o,r){if(n===o){const s=this._readPixelOffset(e,t,n,r);return s===-1?null:[new k0(s,0)]}else return this._readRawVisibleRangesForRange(e,n,o,r)}_readPixelOffset(e,t,n,o){if(this._characterMapping.length===0){if(this._containsForeignElements===0||this._containsForeignElements===2)return 0;if(this._containsForeignElements===1)return this.getWidth(o);const r=this._getReadingTarget(e);return r.firstChild?(o.markDidDomLayout(),r.firstChild.offsetWidth):0}if(this._pixelOffsetCache!==null){const r=this._pixelOffsetCache[n];if(r!==-1)return r;const s=this._actualReadPixelOffset(e,t,n,o);return this._pixelOffsetCache[n]=s,s}return this._actualReadPixelOffset(e,t,n,o)}_actualReadPixelOffset(e,t,n,o){if(this._characterMapping.length===0){const l=cM.readHorizontalRanges(this._getReadingTarget(e),0,0,0,0,o);return!l||l.length===0?-1:l[0].left}if(n===this._characterMapping.length&&this._isWhitespaceOnly&&this._containsForeignElements===0)return this.getWidth(o);const r=this._characterMapping.getDomPosition(n),s=cM.readHorizontalRanges(this._getReadingTarget(e),r.partIndex,r.charIndex,r.partIndex,r.charIndex,o);if(!s||s.length===0)return-1;const a=s[0].left;if(this.input.isBasicASCII){const l=this._characterMapping.getHorizontalOffset(n),c=Math.round(this.input.spaceWidth*l);if(Math.abs(c-a)<=1)return c}return a}_readRawVisibleRangesForRange(e,t,n,o){if(t===1&&n===this._characterMapping.length)return[new k0(0,this.getWidth(o))];const r=this._characterMapping.getDomPosition(t),s=this._characterMapping.getDomPosition(n);return cM.readHorizontalRanges(this._getReadingTarget(e),r.partIndex,r.charIndex,s.partIndex,s.charIndex,o)}getColumnOfNodeOffset(e,t){return kG(this._characterMapping,e,t)}}class zit extends fbe{_readVisibleRangesForRange(e,t,n,o,r){const s=super._readVisibleRangesForRange(e,t,n,o,r);if(!s||s.length===0||n===o||n===1&&o===this._characterMapping.length)return s;if(!this.input.containsRTL){const a=this._readPixelOffset(e,t,o,r);if(a!==-1){const l=s[s.length-1];l.left=t){const d=t-s;return c-t=4&&e[0]===3&&e[3]===7}static isStrictChildOfViewLines(e){return e.length>4&&e[0]===3&&e[3]===7}static isChildOfScrollableElement(e){return e.length>=2&&e[0]===3&&e[1]===5}static isChildOfMinimap(e){return e.length>=2&&e[0]===3&&e[1]===8}static isChildOfContentWidgets(e){return e.length>=4&&e[0]===3&&e[3]===1}static isChildOfOverflowGuard(e){return e.length>=1&&e[0]===3}static isChildOfOverflowingContentWidgets(e){return e.length>=1&&e[0]===2}static isChildOfOverlayWidgets(e){return e.length>=2&&e[0]===3&&e[1]===4}}class Lw{constructor(e,t,n){this.viewModel=e.viewModel;const o=e.configuration.options;this.layoutInfo=o.get(143),this.viewDomNode=t.viewDomNode,this.lineHeight=o.get(66),this.stickyTabStops=o.get(115),this.typicalHalfwidthCharacterWidth=o.get(50).typicalHalfwidthCharacterWidth,this.lastRenderData=n,this._context=e,this._viewHelper=t}getZoneAtCoord(e){return Lw.getZoneAtCoord(this._context,e)}static getZoneAtCoord(e,t){const n=e.viewLayout.getWhitespaceAtVerticalOffset(t);if(n){const o=n.verticalOffset+n.height/2,r=e.viewModel.getLineCount();let s=null,a,l=null;return n.afterLineNumber!==r&&(l=new ae(n.afterLineNumber+1,1)),n.afterLineNumber>0&&(s=new ae(n.afterLineNumber,e.viewModel.getLineMaxColumn(n.afterLineNumber))),l===null?a=s:s===null?a=l:t=e.layoutInfo.glyphMarginLeft,this.isInContentArea=!this.isInMarginArea,this.mouseColumn=Math.max(0,Yr._getMouseColumn(this.mouseContentHorizontalOffset,e.typicalHalfwidthCharacterWidth))}}class IG extends qit{constructor(e,t,n,o,r){super(e,t,n,o),this._ctx=e,r?(this.target=r,this.targetPath=vf.collect(r,e.viewDomNode)):(this.target=null,this.targetPath=new Uint8Array(0))}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}`}_getMouseColumn(e=null){return e&&e.columns.contentLeft+s.width)continue;const a=e.getVerticalOffsetForLineNumber(s.position.lineNumber);if(a<=r&&r<=a+s.height)return t.fulfillContentText(s.position,null,{mightBeForeignElement:!1,injectedText:null})}}return null}static _hitTestViewZone(e,t){const n=e.getZoneAtCoord(t.mouseVerticalOffset);if(n){const o=t.isInContentArea?8:5;return t.fulfillViewZone(o,n.position,n)}return null}static _hitTestTextArea(e,t){return Ll.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 n=e.getFullLineRangeAtCoord(t.mouseVerticalOffset),o=n.range.getStartPosition();let r=Math.abs(t.relativePos.x);const s={isAfterLines:n.isAfterLines,glyphMarginLeft:e.layoutInfo.glyphMarginLeft,glyphMarginWidth:e.layoutInfo.glyphMarginWidth,lineNumbersWidth:e.layoutInfo.lineNumbersWidth,offsetX:r};return r-=e.layoutInfo.glyphMarginLeft,r<=e.layoutInfo.glyphMarginWidth?t.fulfillMargin(2,o,n.range,s):(r-=e.layoutInfo.glyphMarginWidth,r<=e.layoutInfo.lineNumbersWidth?t.fulfillMargin(3,o,n.range,s):(r-=e.layoutInfo.lineNumbersWidth,t.fulfillMargin(4,o,n.range,s)))}return null}static _hitTestViewLines(e,t,n){if(!Ll.isChildOfViewLines(t.targetPath))return null;if(e.isInTopPadding(t.mouseVerticalOffset))return t.fulfillContentEmpty(new ae(1,1),Ore);if(e.isAfterLines(t.mouseVerticalOffset)||e.isInBottomPadding(t.mouseVerticalOffset)){const r=e.viewModel.getLineCount(),s=e.viewModel.getLineMaxColumn(r);return t.fulfillContentEmpty(new ae(r,s),Ore)}if(n){if(Ll.isStrictChildOfViewLines(t.targetPath)){const r=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset);if(e.viewModel.getLineLength(r)===0){const a=e.getLineWidth(r),l=n9(t.mouseContentHorizontalOffset-a);return t.fulfillContentEmpty(new ae(r,1),l)}const s=e.getLineWidth(r);if(t.mouseContentHorizontalOffset>=s){const a=n9(t.mouseContentHorizontalOffset-s),l=new ae(r,e.viewModel.getLineMaxColumn(r));return t.fulfillContentEmpty(l,a)}}return t.fulfillUnknown()}const o=Yr._doHitTest(e,t);return o.type===1?Yr.createMouseTargetFromHitTestPosition(e,t,o.spanNode,o.position,o.injectedText):this._createMouseTarget(e,t.withTarget(o.hitTarget),!0)}static _hitTestMinimap(e,t){if(Ll.isChildOfMinimap(t.targetPath)){const n=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),o=e.viewModel.getLineMaxColumn(n);return t.fulfillScrollbar(new ae(n,o))}return null}static _hitTestScrollbarSlider(e,t){if(Ll.isChildOfScrollableElement(t.targetPath)&&t.target&&t.target.nodeType===1){const n=t.target.className;if(n&&/\b(slider|scrollbar)\b/.test(n)){const o=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),r=e.viewModel.getLineMaxColumn(o);return t.fulfillScrollbar(new ae(o,r))}}return null}static _hitTestScrollbar(e,t){if(Ll.isChildOfScrollableElement(t.targetPath)){const n=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),o=e.viewModel.getLineMaxColumn(n);return t.fulfillScrollbar(new ae(n,o))}return null}getMouseColumn(e){const t=this._context.configuration.options,n=t.get(143),o=this._context.viewLayout.getCurrentScrollLeft()+e.x-n.contentLeft;return Yr._getMouseColumn(o,t.get(50).typicalHalfwidthCharacterWidth)}static _getMouseColumn(e,t){return e<0?1:Math.round(e/t)+1}static createMouseTargetFromHitTestPosition(e,t,n,o,r){const s=o.lineNumber,a=o.column,l=e.getLineWidth(s);if(t.mouseContentHorizontalOffset>l){const m=n9(t.mouseContentHorizontalOffset-l);return t.fulfillContentEmpty(o,m)}const c=e.visibleRangeForPosition(s,a);if(!c)return t.fulfillUnknown(o);const u=c.left;if(Math.abs(t.mouseContentHorizontalOffset-u)<1)return t.fulfillContentText(o,null,{mightBeForeignElement:!!r,injectedText:r});const d=[];if(d.push({offset:c.left,column:a}),a>1){const m=e.visibleRangeForPosition(s,a-1);m&&d.push({offset:m.left,column:a-1})}const h=e.viewModel.getLineMaxColumn(s);if(am.offset-_.offset);const f=t.pos.toClientCoordinates(),g=n.getBoundingClientRect(),p=g.left<=f.clientX&&f.clientX<=g.right;let v=null;for(let m=1;mr)){const a=Math.floor((o+r)/2);let l=t.pos.y+(a-t.mouseVerticalOffset);l<=t.editorPos.y&&(l=t.editorPos.y+1),l>=t.editorPos.y+t.editorPos.height&&(l=t.editorPos.y+t.editorPos.height-1);const c=new p5(t.pos.x,l),u=this._actualDoHitTestWithCaretRangeFromPoint(e,c.toClientCoordinates());if(u.type===1)return u}return this._actualDoHitTestWithCaretRangeFromPoint(e,t.pos.toClientCoordinates())}static _actualDoHitTestWithCaretRangeFromPoint(e,t){const n=eb(e.viewDomNode);let o;if(n?typeof n.caretRangeFromPoint=="undefined"?o=Git(n,t.clientX,t.clientY):o=n.caretRangeFromPoint(t.clientX,t.clientY):o=e.viewDomNode.ownerDocument.caretRangeFromPoint(t.clientX,t.clientY),!o||!o.startContainer)return new qp;const r=o.startContainer;if(r.nodeType===r.TEXT_NODE){const s=r.parentNode,a=s?s.parentNode:null,l=a?a.parentNode:null;return(l&&l.nodeType===l.ELEMENT_NODE?l.className:null)===Oh.CLASS_NAME?$_.createFromDOMInfo(e,s,o.startOffset):new qp(r.parentNode)}else if(r.nodeType===r.ELEMENT_NODE){const s=r.parentNode,a=s?s.parentNode:null;return(a&&a.nodeType===a.ELEMENT_NODE?a.className:null)===Oh.CLASS_NAME?$_.createFromDOMInfo(e,r,r.textContent.length):new qp(r)}return new qp}static _doHitTestWithCaretPositionFromPoint(e,t){const n=e.viewDomNode.ownerDocument.caretPositionFromPoint(t.clientX,t.clientY);if(n.offsetNode.nodeType===n.offsetNode.TEXT_NODE){const o=n.offsetNode.parentNode,r=o?o.parentNode:null,s=r?r.parentNode:null;return(s&&s.nodeType===s.ELEMENT_NODE?s.className:null)===Oh.CLASS_NAME?$_.createFromDOMInfo(e,n.offsetNode.parentNode,n.offset):new qp(n.offsetNode.parentNode)}if(n.offsetNode.nodeType===n.offsetNode.ELEMENT_NODE){const o=n.offsetNode.parentNode,r=o&&o.nodeType===o.ELEMENT_NODE?o.className:null,s=o?o.parentNode:null,a=s&&s.nodeType===s.ELEMENT_NODE?s.className:null;if(r===Oh.CLASS_NAME){const l=n.offsetNode.childNodes[Math.min(n.offset,n.offsetNode.childNodes.length-1)];if(l)return $_.createFromDOMInfo(e,l,0)}else if(a===Oh.CLASS_NAME)return $_.createFromDOMInfo(e,n.offsetNode,0)}return new qp(n.offsetNode)}static _snapToSoftTabBoundary(e,t){const n=t.getLineContent(e.lineNumber),{tabSize:o}=t.model.getOptions(),r=ZD.atomicPosition(n,e.column-1,o,2);return r!==-1?new ae(e.lineNumber,r+1):e}static _doHitTest(e,t){let n=new qp;if(typeof e.viewDomNode.ownerDocument.caretRangeFromPoint=="function"?n=this._doHitTestWithCaretRangeFromPoint(e,t):e.viewDomNode.ownerDocument.caretPositionFromPoint&&(n=this._doHitTestWithCaretPositionFromPoint(e,t.pos.toClientCoordinates())),n.type===1){const o=e.viewModel.getInjectedTextAt(n.position),r=e.viewModel.normalizePosition(n.position,2);(o||!r.equals(n.position))&&(n=new pbe(r,n.spanNode,o))}return n}}function Git(i,e,t){const n=document.createRange();let o=i.elementFromPoint(e,t);if(o!==null){for(;o&&o.firstChild&&o.firstChild.nodeType!==o.firstChild.TEXT_NODE&&o.lastChild&&o.lastChild.firstChild;)o=o.lastChild;const r=o.getBoundingClientRect(),s=window.getComputedStyle(o,null).getPropertyValue("font-style"),a=window.getComputedStyle(o,null).getPropertyValue("font-variant"),l=window.getComputedStyle(o,null).getPropertyValue("font-weight"),c=window.getComputedStyle(o,null).getPropertyValue("font-size"),u=window.getComputedStyle(o,null).getPropertyValue("line-height"),d=window.getComputedStyle(o,null).getPropertyValue("font-family"),h=`${s} ${a} ${l} ${c}/${u} ${d}`,f=o.innerText;let g=r.left,p=0,v;if(e>r.left+r.width)p=f.length;else{const m=g0.getInstance();for(let _=0;_t(new kc(n))))}onmousedown(e,t){this._register(ke(e,et.MOUSE_DOWN,n=>t(new kc(n))))}onmouseover(e,t){this._register(ke(e,et.MOUSE_OVER,n=>t(new kc(n))))}onmouseleave(e,t){this._register(ke(e,et.MOUSE_LEAVE,n=>t(new kc(n))))}onkeydown(e,t){this._register(ke(e,et.KEY_DOWN,n=>t(new Pi(n))))}onkeyup(e,t){this._register(ke(e,et.KEY_UP,n=>t(new Pi(n))))}oninput(e,t){this._register(ke(e,et.INPUT,t))}onblur(e,t){this._register(ke(e,et.BLUR,t))}onfocus(e,t){this._register(ke(e,et.FOCUS,t))}ignoreGesture(e){return Ei.ignoreTarget(e)}}const Ew=11;class Xit extends Uu{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!="undefined"&&(this.bgDomNode.style.top="0px"),typeof e.left!="undefined"&&(this.bgDomNode.style.left="0px"),typeof e.bottom!="undefined"&&(this.bgDomNode.style.bottom="0px"),typeof e.right!="undefined"&&(this.bgDomNode.style.right="0px"),this.domNode=document.createElement("div"),this.domNode.className=e.className,this.domNode.classList.add(...Mt.asClassNameArray(e.icon)),this.domNode.style.position="absolute",this.domNode.style.width=Ew+"px",this.domNode.style.height=Ew+"px",typeof e.top!="undefined"&&(this.domNode.style.top=e.top+"px"),typeof e.left!="undefined"&&(this.domNode.style.left=e.left+"px"),typeof e.bottom!="undefined"&&(this.domNode.style.bottom=e.bottom+"px"),typeof e.right!="undefined"&&(this.domNode.style.right=e.right+"px"),this._pointerMoveMonitor=this._register(new yS),this._register(No(this.bgDomNode,et.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._register(No(this.domNode,et.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._pointerdownRepeatTimer=this._register(new $I),this._pointerdownScheduleRepeatTimer=this._register(new zu)}_arrowPointerDown(e){if(!e.target||!(e.target instanceof Element))return;const t=()=>{this._pointerdownRepeatTimer.cancelAndSet(()=>this._onActivate(),1e3/24)};this._onActivate(),this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancelAndSet(t,200),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,n=>{},()=>{this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancel()}),e.preventDefault()}}class Yit extends _e{constructor(e,t,n){super(),this._visibility=e,this._visibleClassName=t,this._invisibleClassName=n,this._domNode=null,this._isVisible=!1,this._isNeeded=!1,this._rawShouldBeVisible=!1,this._shouldBeVisible=!1,this._revealTimer=this._register(new zu)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this._updateShouldBeVisible())}setShouldBeVisible(e){this._rawShouldBeVisible=e,this._updateShouldBeVisible()}_applyVisibilitySetting(){return this._visibility===2?!1:this._visibility===3?!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(()=>{var e;(e=this._domNode)===null||e===void 0||e.setClassName(this._visibleClassName)},0))}_hide(e){var t;this._revealTimer.cancel(),this._isVisible&&(this._isVisible=!1,(t=this._domNode)===null||t===void 0||t.setClassName(this._invisibleClassName+(e?" fade":"")))}}const Zit=140;class mbe extends Uu{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 Yit(e.visibility,"visible scrollbar "+e.extraScrollbarClassName,"invisible scrollbar "+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._pointerMoveMonitor=this._register(new yS),this._shouldRender=!0,this.domNode=ti(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(ke(this.domNode.domNode,et.POINTER_DOWN,t=>this._domNodePointerDown(t)))}_createArrow(e){const t=this._register(new Xit(e));this.domNode.domNode.appendChild(t.bgDomNode),this.domNode.domNode.appendChild(t.domNode)}_createSlider(e,t,n,o){this.slider=ti(document.createElement("div")),this.slider.setClassName("slider"),this.slider.setPosition("absolute"),this.slider.setTop(e),this.slider.setLeft(t),typeof n=="number"&&this.slider.setWidth(n),typeof o=="number"&&this.slider.setHeight(o),this.slider.setLayerHinting(!0),this.slider.setContain("strict"),this.domNode.domNode.appendChild(this.slider.domNode),this._register(ke(this.slider.domNode,et.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,n=t+this._scrollbarState.getSliderPosition(),o=t+this._scrollbarState.getSliderPosition()+this._scrollbarState.getSliderSize(),r=this._sliderPointerPosition(e);n<=r&&r<=o?e.button===0&&(e.preventDefault(),this._sliderPointerDown(e)):this._onPointerDown(e)}_onPointerDown(e){let t,n;if(e.target===this.domNode.domNode&&typeof e.offsetX=="number"&&typeof e.offsetY=="number")t=e.offsetX,n=e.offsetY;else{const r=Yo(this.domNode.domNode);t=e.pageX-r.left,n=e.pageY-r.top}const o=this._pointerDownRelativePosition(t,n);this._setDesiredScrollPositionNow(this._scrollByPage?this._scrollbarState.getDesiredScrollPositionFromOffsetPaged(o):this._scrollbarState.getDesiredScrollPositionFromOffset(o)),e.button===0&&(e.preventDefault(),this._sliderPointerDown(e))}_sliderPointerDown(e){if(!e.target||!(e.target instanceof Element))return;const t=this._sliderPointerPosition(e),n=this._sliderOrthogonalPointerPosition(e),o=this._scrollbarState.clone();this.slider.toggleClassName("active",!0),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,r=>{const s=this._sliderOrthogonalPointerPosition(r),a=Math.abs(s-n);if(ls&&a>Zit){this._setDesiredScrollPositionNow(o.getScrollPosition());return}const c=this._sliderPointerPosition(r)-t;this._setDesiredScrollPositionNow(o.getDesiredScrollPositionFromDelta(c))},()=>{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 Qit=20;class Dw{constructor(e,t,n,o,r,s){this._scrollbarSize=Math.round(t),this._oppositeScrollbarSize=Math.round(n),this._arrowSize=Math.round(e),this._visibleSize=o,this._scrollSize=r,this._scrollPosition=s,this._computedAvailableSize=0,this._computedIsNeeded=!1,this._computedSliderSize=0,this._computedSliderRatio=0,this._computedSliderPosition=0,this._refreshComputedValues()}clone(){return new Dw(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,n,o,r){const s=Math.max(0,n-e),a=Math.max(0,s-2*t),l=o>0&&o>n;if(!l)return{computedAvailableSize:Math.round(s),computedIsNeeded:l,computedSliderSize:Math.round(a),computedSliderRatio:0,computedSliderPosition:0};const c=Math.round(Math.max(Qit,Math.floor(n*a/o))),u=(a-c)/(o-n),d=r*u;return{computedAvailableSize:Math.round(s),computedIsNeeded:l,computedSliderSize:Math.round(c),computedSliderRatio:u,computedSliderPosition:Math.round(d)}}_refreshComputedValues(){const e=Dw._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 n=this._scrollPosition;return tthis._host.onMouseWheel(new J0(null,1,0))}),this._createArrow({className:"scra",icon:Xe.scrollbarButtonRight,top:a,left:void 0,bottom:void 0,right:s,bgWidth:t.arrowSize,bgHeight:t.horizontalScrollbarSize,onActivate:()=>this._host.onMouseWheel(new J0(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===2?0:e.horizontalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(e.vertical===2?0:e.verticalScrollbarSize),this._visibilityController.setVisibility(e.horizontal),this._scrollByPage=e.scrollByPage}}class eot extends mbe{constructor(e,t,n){const o=e.getScrollDimensions(),r=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:n,scrollbarState:new Dw(t.verticalHasArrows?t.arrowSize:0,t.vertical===2?0:t.verticalScrollbarSize,0,o.height,o.scrollHeight,r.scrollTop),visibility:t.vertical,extraScrollbarClassName:"vertical",scrollable:e,scrollByPage:t.scrollByPage}),t.verticalHasArrows){const s=(t.arrowSize-Ew)/2,a=(t.verticalScrollbarSize-Ew)/2;this._createArrow({className:"scra",icon:Xe.scrollbarButtonUp,top:s,left:a,bottom:void 0,right:void 0,bgWidth:t.verticalScrollbarSize,bgHeight:t.arrowSize,onActivate:()=>this._host.onMouseWheel(new J0(null,0,1))}),this._createArrow({className:"scra",icon:Xe.scrollbarButtonDown,top:void 0,left:a,bottom:s,right:void 0,bgWidth:t.verticalScrollbarSize,bgHeight:t.arrowSize,onActivate:()=>this._host.onMouseWheel(new J0(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===2?0:e.verticalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(0),this._visibilityController.setVisibility(e.vertical),this._scrollByPage=e.scrollByPage}}class aP{constructor(e,t,n,o,r,s,a){this._forceIntegerValues=e,this._scrollStateBrand=void 0,this._forceIntegerValues&&(t=t|0,n=n|0,o=o|0,r=r|0,s=s|0,a=a|0),this.rawScrollLeft=o,this.rawScrollTop=a,t<0&&(t=0),o+t>n&&(o=n-t),o<0&&(o=0),r<0&&(r=0),a+r>s&&(a=s-r),a<0&&(a=0),this.width=t,this.scrollWidth=n,this.scrollLeft=o,this.height=r,this.scrollHeight=s,this.scrollTop=a}equals(e){return this.rawScrollLeft===e.rawScrollLeft&&this.rawScrollTop===e.rawScrollTop&&this.width===e.width&&this.scrollWidth===e.scrollWidth&&this.scrollLeft===e.scrollLeft&&this.height===e.height&&this.scrollHeight===e.scrollHeight&&this.scrollTop===e.scrollTop}withScrollDimensions(e,t){return new aP(this._forceIntegerValues,typeof e.width!="undefined"?e.width:this.width,typeof e.scrollWidth!="undefined"?e.scrollWidth:this.scrollWidth,t?this.rawScrollLeft:this.scrollLeft,typeof e.height!="undefined"?e.height:this.height,typeof e.scrollHeight!="undefined"?e.scrollHeight:this.scrollHeight,t?this.rawScrollTop:this.scrollTop)}withScrollPosition(e){return new aP(this._forceIntegerValues,this.width,this.scrollWidth,typeof e.scrollLeft!="undefined"?e.scrollLeft:this.rawScrollLeft,this.height,this.scrollHeight,typeof e.scrollTop!="undefined"?e.scrollTop:this.rawScrollTop)}createScrollEvent(e,t){const n=this.width!==e.width,o=this.scrollWidth!==e.scrollWidth,r=this.scrollLeft!==e.scrollLeft,s=this.height!==e.height,a=this.scrollHeight!==e.scrollHeight,l=this.scrollTop!==e.scrollTop;return{inSmoothScrolling:t,oldWidth:e.width,oldScrollWidth:e.scrollWidth,oldScrollLeft:e.scrollLeft,width:this.width,scrollWidth:this.scrollWidth,scrollLeft:this.scrollLeft,oldHeight:e.height,oldScrollHeight:e.scrollHeight,oldScrollTop:e.scrollTop,height:this.height,scrollHeight:this.scrollHeight,scrollTop:this.scrollTop,widthChanged:n,scrollWidthChanged:o,scrollLeftChanged:r,heightChanged:s,scrollHeightChanged:a,scrollTopChanged:l}}}class XI extends _e{constructor(e){super(),this._scrollableBrand=void 0,this._onScroll=this._register(new le),this.onScroll=this._onScroll.event,this._smoothScrollDuration=e.smoothScrollDuration,this._scheduleAtNextAnimationFrame=e.scheduleAtNextAnimationFrame,this._state=new aP(e.forceIntegerValues,0,0,0,0,0,0),this._smoothScrolling=null}dispose(){this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),super.dispose()}setSmoothScrollDuration(e){this._smoothScrollDuration=e}validateScrollPosition(e){return this._state.withScrollPosition(e)}getScrollDimensions(){return this._state}setScrollDimensions(e,t){var n;const o=this._state.withScrollDimensions(e,t);this._setState(o,Boolean(this._smoothScrolling)),(n=this._smoothScrolling)===null||n===void 0||n.acceptScrollDimensions(this._state)}getFutureScrollPosition(){return this._smoothScrolling?this._smoothScrolling.to:this._state}getCurrentScrollPosition(){return this._state}setScrollPositionNow(e){const t=this._state.withScrollPosition(e);this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),this._setState(t,!1)}setScrollPositionSmooth(e,t){if(this._smoothScrollDuration===0)return this.setScrollPositionNow(e);if(this._smoothScrolling){e={scrollLeft:typeof e.scrollLeft=="undefined"?this._smoothScrolling.to.scrollLeft:e.scrollLeft,scrollTop:typeof e.scrollTop=="undefined"?this._smoothScrolling.to.scrollTop:e.scrollTop};const n=this._state.withScrollPosition(e);if(this._smoothScrolling.to.scrollLeft===n.scrollLeft&&this._smoothScrolling.to.scrollTop===n.scrollTop)return;let o;t?o=new QD(this._smoothScrolling.from,n,this._smoothScrolling.startTime,this._smoothScrolling.duration):o=this._smoothScrolling.combine(this._state,n,this._smoothScrollDuration),this._smoothScrolling.dispose(),this._smoothScrolling=o}else{const n=this._state.withScrollPosition(e);this._smoothScrolling=QD.start(this._state,n,this._smoothScrollDuration)}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{!this._smoothScrolling||(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}hasPendingScrollAnimation(){return Boolean(this._smoothScrolling)}_performSmoothScrolling(){if(!this._smoothScrolling)return;const e=this._smoothScrolling.tick(),t=this._state.withScrollPosition(e);if(this._setState(t,!0),!!this._smoothScrolling){if(e.isDone){this._smoothScrolling.dispose(),this._smoothScrolling=null;return}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{!this._smoothScrolling||(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}}_setState(e,t){const n=this._state;n.equals(e)||(this._state=e,this._onScroll.fire(this._state.createScrollEvent(n,t)))}}class Fre{constructor(e,t,n){this.scrollLeft=e,this.scrollTop=t,this.isDone=n}}function i9(i,e){const t=e-i;return function(n){return i+t*iot(n)}}function tot(i,e,t){return function(n){return n2.5*n){let r,s;return e0&&Math.abs(e.deltaY)>0)return 1;let t=.5;return this._front===-1&&this._rear===-1||this._memory[this._rear],(!this._isAlmostInt(e.deltaX)||!this._isAlmostInt(e.deltaY))&&(t+=.25),Math.min(Math.max(t,0),1)}_isAlmostInt(e){return Math.abs(Math.round(e)-e)<.01}}lP.INSTANCE=new lP;class TG extends Uu{get options(){return this._options}constructor(e,t,n){super(),this._onScroll=this._register(new le),this.onScroll=this._onScroll.event,this._onWillScroll=this._register(new le),e.style.overflow="hidden",this._options=sot(t),this._scrollable=n,this._register(this._scrollable.onScroll(r=>{this._onWillScroll.fire(r),this._onDidScroll(r),this._onScroll.fire(r)}));const o={onMouseWheel:r=>this._onMouseWheel(r),onDragStart:()=>this._onDragStart(),onDragEnd:()=>this._onDragEnd()};this._verticalScrollbar=this._register(new eot(this._scrollable,this._options,o)),this._horizontalScrollbar=this._register(new Jit(this._scrollable,this._options,o)),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=ti(document.createElement("div")),this._leftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=ti(document.createElement("div")),this._topShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=ti(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 zu),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}dispose(){this._mouseWheelToDispose=si(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,Nn&&(this._options.className+=" mac"),this._domNode.className="monaco-scrollable-element "+this._options.className}updateOptions(e){typeof e.handleMouseWheel!="undefined"&&(this._options.handleMouseWheel=e.handleMouseWheel,this._setListeningToMouseWheel(this._options.handleMouseWheel)),typeof e.mouseWheelScrollSensitivity!="undefined"&&(this._options.mouseWheelScrollSensitivity=e.mouseWheelScrollSensitivity),typeof e.fastScrollSensitivity!="undefined"&&(this._options.fastScrollSensitivity=e.fastScrollSensitivity),typeof e.scrollPredominantAxis!="undefined"&&(this._options.scrollPredominantAxis=e.scrollPredominantAxis),typeof e.horizontal!="undefined"&&(this._options.horizontal=e.horizontal),typeof e.vertical!="undefined"&&(this._options.vertical=e.vertical),typeof e.horizontalScrollbarSize!="undefined"&&(this._options.horizontalScrollbarSize=e.horizontalScrollbarSize),typeof e.verticalScrollbarSize!="undefined"&&(this._options.verticalScrollbarSize=e.verticalScrollbarSize),typeof e.scrollByPage!="undefined"&&(this._options.scrollByPage=e.scrollByPage),this._horizontalScrollbar.updateOptions(this._options),this._verticalScrollbar.updateOptions(this._options),this._options.lazyRender||this._render()}delegateScrollFromMouseWheelEvent(e){this._onMouseWheel(new J0(e))}_setListeningToMouseWheel(e){if(this._mouseWheelToDispose.length>0!==e&&(this._mouseWheelToDispose=si(this._mouseWheelToDispose),e)){const n=o=>{this._onMouseWheel(new J0(o))};this._mouseWheelToDispose.push(ke(this._listenOnDomNode,et.MOUSE_WHEEL,n,{passive:!1}))}}_onMouseWheel(e){var t;if(!((t=e.browserEvent)===null||t===void 0)&&t.defaultPrevented)return;const n=lP.INSTANCE;n.acceptStandardWheelEvent(e);let o=!1;if(e.deltaY||e.deltaX){let s=e.deltaY*this._options.mouseWheelScrollSensitivity,a=e.deltaX*this._options.mouseWheelScrollSensitivity;this._options.scrollPredominantAxis&&(this._options.scrollYToX&&a+s===0?a=s=0:Math.abs(s)>=Math.abs(a)?a=0:s=0),this._options.flipAxes&&([s,a]=[a,s]);const l=!Nn&&e.browserEvent&&e.browserEvent.shiftKey;(this._options.scrollYToX||l)&&!a&&(a=s,s=0),e.browserEvent&&e.browserEvent.altKey&&(a=a*this._options.fastScrollSensitivity,s=s*this._options.fastScrollSensitivity);const c=this._scrollable.getFutureScrollPosition();let u={};if(s){const d=Bre*s,h=c.scrollTop-(d<0?Math.floor(d):Math.ceil(d));this._verticalScrollbar.writeScrollPosition(u,h)}if(a){const d=Bre*a,h=c.scrollLeft-(d<0?Math.floor(d):Math.ceil(d));this._horizontalScrollbar.writeScrollPosition(u,h)}u=this._scrollable.validateScrollPosition(u),(c.scrollLeft!==u.scrollLeft||c.scrollTop!==u.scrollTop)&&(this._options.mouseWheelSmoothScroll&&n.isPhysicalMouseWheel()?this._scrollable.setScrollPositionSmooth(u):this._scrollable.setScrollPositionNow(u),o=!0)}let r=o;!r&&this._options.alwaysConsumeMouseWheel&&(r=!0),!r&&this._options.consumeMouseWheelIfScrollbarIsNeeded&&(this._verticalScrollbar.isNeeded()||this._horizontalScrollbar.isNeeded())&&(r=!0),r&&(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,n=e.scrollLeft>0,o=n?" left":"",r=t?" top":"",s=n||t?" top-left-corner":"";this._leftShadowDomNode.setClassName(`shadow${o}`),this._topShadowDomNode.setClassName(`shadow${r}`),this._topLeftShadowDomNode.setClassName(`shadow${s}${r}${o}`)}}_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(),oot)}}class vbe extends TG{constructor(e,t){t=t||{},t.mouseWheelSmoothScroll=!1;const n=new XI({forceIntegerValues:!0,smoothScrollDuration:0,scheduleAtNextAnimationFrame:o=>Bc(o)});super(e,t,n),this._register(n)}setScrollPosition(e){this._scrollable.setScrollPositionNow(e)}}class NG extends TG{constructor(e,t,n){super(e,t,n)}setScrollPosition(e){e.reuseAnimation?this._scrollable.setScrollPositionSmooth(e,e.reuseAnimation):this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}}class YI extends TG{constructor(e,t){t=t||{},t.mouseWheelSmoothScroll=!1;const n=new XI({forceIntegerValues:!1,smoothScrollDuration:0,scheduleAtNextAnimationFrame:o=>Bc(o)});super(e,t,n),this._register(n),this._element=e,this._register(this.onScroll(o=>{o.scrollTopChanged&&(this._element.scrollTop=o.scrollTop),o.scrollLeftChanged&&(this._element.scrollLeft=o.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 sot(i){const e={lazyRender:typeof i.lazyRender!="undefined"?i.lazyRender:!1,className:typeof i.className!="undefined"?i.className:"",useShadows:typeof i.useShadows!="undefined"?i.useShadows:!0,handleMouseWheel:typeof i.handleMouseWheel!="undefined"?i.handleMouseWheel:!0,flipAxes:typeof i.flipAxes!="undefined"?i.flipAxes:!1,consumeMouseWheelIfScrollbarIsNeeded:typeof i.consumeMouseWheelIfScrollbarIsNeeded!="undefined"?i.consumeMouseWheelIfScrollbarIsNeeded:!1,alwaysConsumeMouseWheel:typeof i.alwaysConsumeMouseWheel!="undefined"?i.alwaysConsumeMouseWheel:!1,scrollYToX:typeof i.scrollYToX!="undefined"?i.scrollYToX:!1,mouseWheelScrollSensitivity:typeof i.mouseWheelScrollSensitivity!="undefined"?i.mouseWheelScrollSensitivity:1,fastScrollSensitivity:typeof i.fastScrollSensitivity!="undefined"?i.fastScrollSensitivity:5,scrollPredominantAxis:typeof i.scrollPredominantAxis!="undefined"?i.scrollPredominantAxis:!0,mouseWheelSmoothScroll:typeof i.mouseWheelSmoothScroll!="undefined"?i.mouseWheelSmoothScroll:!0,arrowSize:typeof i.arrowSize!="undefined"?i.arrowSize:11,listenOnDomNode:typeof i.listenOnDomNode!="undefined"?i.listenOnDomNode:null,horizontal:typeof i.horizontal!="undefined"?i.horizontal:1,horizontalScrollbarSize:typeof i.horizontalScrollbarSize!="undefined"?i.horizontalScrollbarSize:10,horizontalSliderSize:typeof i.horizontalSliderSize!="undefined"?i.horizontalSliderSize:0,horizontalHasArrows:typeof i.horizontalHasArrows!="undefined"?i.horizontalHasArrows:!1,vertical:typeof i.vertical!="undefined"?i.vertical:1,verticalScrollbarSize:typeof i.verticalScrollbarSize!="undefined"?i.verticalScrollbarSize:10,verticalHasArrows:typeof i.verticalHasArrows!="undefined"?i.verticalHasArrows:!1,verticalSliderSize:typeof i.verticalSliderSize!="undefined"?i.verticalSliderSize:0,scrollByPage:typeof i.scrollByPage!="undefined"?i.scrollByPage:!1};return e.horizontalSliderSize=typeof i.horizontalSliderSize!="undefined"?i.horizontalSliderSize:e.horizontalScrollbarSize,e.verticalSliderSize=typeof i.verticalSliderSize!="undefined"?i.verticalSliderSize:e.verticalScrollbarSize,Nn&&(e.className+=" mac"),e}class RG extends GI{constructor(e,t,n){super(),this._mouseLeaveMonitor=null,this._context=e,this.viewController=t,this.viewHelper=n,this.mouseTargetFactory=new Yr(this._context,n),this._mouseDownOperation=this._register(new aot(this._context,this.viewController,this.viewHelper,this.mouseTargetFactory,(s,a)=>this._createMouseTarget(s,a),s=>this._getMouseColumn(s))),this.lastMouseLeaveTime=-1,this._height=this._context.configuration.options.get(143).height;const o=new Mit(this.viewHelper.viewDomNode);this._register(o.onContextMenu(this.viewHelper.viewDomNode,s=>this._onContextMenu(s,!0))),this._register(o.onMouseMove(this.viewHelper.viewDomNode,s=>{this._onMouseMove(s),this._mouseLeaveMonitor||(this._mouseLeaveMonitor=ke(this.viewHelper.viewDomNode.ownerDocument,"mousemove",a=>{this.viewHelper.viewDomNode.contains(a.target)||this._onMouseLeave(new Dv(a,!1,this.viewHelper.viewDomNode))}))})),this._register(o.onMouseUp(this.viewHelper.viewDomNode,s=>this._onMouseUp(s))),this._register(o.onMouseLeave(this.viewHelper.viewDomNode,s=>this._onMouseLeave(s)));let r=0;this._register(o.onPointerDown(this.viewHelper.viewDomNode,(s,a)=>{r=a})),this._register(ke(this.viewHelper.viewDomNode,et.POINTER_UP,s=>{this._mouseDownOperation.onPointerUp()})),this._register(o.onMouseDown(this.viewHelper.viewDomNode,s=>this._onMouseDown(s,r))),this._setupMouseWheelZoomListener(),this._context.addEventHandler(this)}_setupMouseWheelZoomListener(){const e=lP.INSTANCE;let t=0,n=xc.getZoomLevel(),o=!1,r=0;const s=l=>{if(this.viewController.emitMouseWheel(l),!this._context.configuration.options.get(75))return;const c=new J0(l);if(e.acceptStandardWheelEvent(c),e.isPhysicalMouseWheel()){if(a(l)){const u=xc.getZoomLevel(),d=c.deltaY>0?1:-1;xc.setZoomLevel(u+d),c.preventDefault(),c.stopPropagation()}}else Date.now()-t>50&&(n=xc.getZoomLevel(),o=a(l),r=0),t=Date.now(),r+=c.deltaY,o&&(xc.setZoomLevel(n+r/5),c.preventDefault(),c.stopPropagation())};this._register(ke(this.viewHelper.viewDomNode,et.MOUSE_WHEEL,s,{capture:!0,passive:!1}));function a(l){return Nn?(l.metaKey||l.ctrlKey)&&!l.shiftKey&&!l.altKey:l.ctrlKey&&!l.metaKey&&!l.shiftKey&&!l.altKey}}dispose(){this._context.removeEventHandler(this),this._mouseLeaveMonitor&&(this._mouseLeaveMonitor.dispose(),this._mouseLeaveMonitor=null),super.dispose()}onConfigurationChanged(e){if(e.hasChanged(143)){const t=this._context.configuration.options.get(143).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 o=new hbe(e,t).toPageCoordinates(),r=EG(this.viewHelper.viewDomNode);if(o.yr.y+r.height||o.xr.x+r.width)return null;const s=DG(this.viewHelper.viewDomNode,r,o);return this.mouseTargetFactory.createMouseTarget(this.viewHelper.getLastRenderData(),r,o,s,null)}_createMouseTarget(e,t){let n=e.target;if(!this.viewHelper.viewDomNode.contains(n)){const o=eb(this.viewHelper.viewDomNode);o&&(n=o.elementsFromPoint(e.posx,e.posy).find(r=>this.viewHelper.viewDomNode.contains(r)))}return this.mouseTargetFactory.createMouseTarget(this.viewHelper.getLastRenderData(),e.editorPos,e.pos,e.relativePos,t?n:null)}_getMouseColumn(e){return this.mouseTargetFactory.getMouseColumn(e.relativePos)}_onContextMenu(e,t){this.viewController.emitContextMenu({event:e,target:this._createMouseTarget(e,t)})}_onMouseMove(e){this.mouseTargetFactory.mouseTargetIsWidget(e)||e.preventDefault(),!(this._mouseDownOperation.isActive()||e.timestamp{e.preventDefault(),this.viewHelper.focusTextArea()};if(u&&(o||s&&a))d(),this._mouseDownOperation.start(n.type,e,t);else if(r)e.preventDefault();else if(l){const h=n.detail;u&&this.viewHelper.shouldSuppressMouseDownOnViewZone(h.viewZoneId)&&(d(),this._mouseDownOperation.start(n.type,e,t),e.preventDefault())}else c&&this.viewHelper.shouldSuppressMouseDownOnWidget(n.detail)&&(d(),e.preventDefault());this.viewController.emitMouseDown({event:e,target:n})}}class aot extends _e{constructor(e,t,n,o,r,s){super(),this._context=e,this._viewController=t,this._viewHelper=n,this._mouseTargetFactory=o,this._createMouseTarget=r,this._getMouseColumn=s,this._mouseMoveMonitor=this._register(new Pit(this._viewHelper.viewDomNode)),this._topBottomDragScrolling=this._register(new lot(this._context,this._viewHelper,this._mouseTargetFactory,(a,l,c)=>this._dispatchMouse(a,l,c))),this._mouseState=new v5,this._currentSelection=new gt(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===13&&(t.outsidePosition==="above"||t.outsidePosition==="below")?this._topBottomDragScrolling.start(t,e):(this._topBottomDragScrolling.stop(),this._dispatchMouse(t,!0,1)))}start(e,t,n){this._lastMouseEvent=t,this._mouseState.setStartedOnLineNumbers(e===3),this._mouseState.setStartButtons(t),this._mouseState.setModifiers(t);const o=this._findMousePosition(t,!0);if(!o||!o.position)return;this._mouseState.trySetCount(t.detail,o.position),t.detail=this._mouseState.count;const r=this._context.configuration.options;if(!r.get(90)&&r.get(35)&&!r.get(22)&&!this._mouseState.altKey&&t.detail<2&&!this._isActive&&!this._currentSelection.isEmpty()&&o.type===6&&o.position&&this._currentSelection.containsPosition(o.position)){this._mouseState.isDragAndDrop=!0,this._isActive=!0,this._mouseMoveMonitor.startMonitoring(this._viewHelper.viewLinesDomNode,n,t.buttons,s=>this._onMouseDownThenMove(s),s=>{const a=this._findMousePosition(this._lastMouseEvent,!1);s&&s instanceof KeyboardEvent?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(o,t.shiftKey,1),this._isActive||(this._isActive=!0,this._mouseMoveMonitor.startMonitoring(this._viewHelper.viewLinesDomNode,n,t.buttons,s=>this._onMouseDownThenMove(s),()=>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,n=this._context.viewModel,o=this._context.viewLayout,r=this._getMouseColumn(e);if(e.posyt.y+t.height){const a=e.posy-t.y-t.height,l=o.getCurrentScrollTop()+e.relativePos.y,c=Lw.getZoneAtCoord(this._context,l);if(c){const d=this._helpPositionJumpOverViewZone(c);if(d)return Fs.createOutsideEditor(r,d,"below",a)}const u=o.getLineNumberAtVerticalOffset(l);return Fs.createOutsideEditor(r,new ae(u,n.getLineMaxColumn(u)),"below",a)}const s=o.getLineNumberAtVerticalOffset(o.getCurrentScrollTop()+e.relativePos.y);if(e.posxt.x+t.width){const a=e.posx-t.x-t.width;return Fs.createOutsideEditor(r,new ae(s,n.getLineMaxColumn(s)),"right",a)}return null}_findMousePosition(e,t){const n=this._getPositionOutsideEditor(e);if(n)return n;const o=this._createMouseTarget(e,t);if(!o.position)return null;if(o.type===8||o.type===5){const s=this._helpPositionJumpOverViewZone(o.detail);if(s)return Fs.createViewZone(o.type,o.element,o.mouseColumn,s,o.detail)}return o}_helpPositionJumpOverViewZone(e){const t=new ae(this._currentSelection.selectionStartLineNumber,this._currentSelection.selectionStartColumn),n=e.positionBefore,o=e.positionAfter;return n&&o?n.isBefore(t)?n:o:null}_dispatchMouse(e,t,n){!e.position||this._viewController.dispatchMouse({position:e.position,mouseColumn:e.mouseColumn,startedOnLineNumbers:this._mouseState.startedOnLineNumbers,revealType:n,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===6&&e.detail.injectedText!==null})}}class lot extends _e{constructor(e,t,n,o){super(),this._context=e,this._viewHelper=t,this._mouseTargetFactory=n,this._dispatchMouse=o,this._operation=null}dispose(){super.dispose(),this.stop()}start(e,t){this._operation?this._operation.setPosition(e,t):this._operation=new cot(this._context,this._viewHelper,this._mouseTargetFactory,this._dispatchMouse,e,t)}stop(){this._operation&&(this._operation.dispose(),this._operation=null)}}class cot extends _e{constructor(e,t,n,o,r,s){super(),this._context=e,this._viewHelper=t,this._mouseTargetFactory=n,this._dispatchMouse=o,this._position=r,this._mouseEvent=s,this._lastTime=Date.now(),this._animationFrameDisposable=Bc(()=>this._execute())}dispose(){this._animationFrameDisposable.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(66),t=this._context.configuration.options.get(143).height/e,n=this._position.outsideDistance/e;return n<=1.5?Math.max(30,t*(1+n)):n<=3?Math.max(60,t*(2+n)):Math.max(200,t*(7+n))}_execute(){const e=this._context.configuration.options.get(66),t=this._getScrollSpeed(),n=this._tick(),o=t*(n/1e3)*e,r=this._position.outsidePosition==="above"?-o:o;this._context.viewModel.viewLayout.deltaScrollNow(0,r),this._viewHelper.renderNow();const s=this._context.viewLayout.getLinesViewportData(),a=this._position.outsidePosition==="above"?s.startLineNumber:s.endLineNumber;let l;{const c=EG(this._viewHelper.viewDomNode),u=this._context.configuration.options.get(143).horizontalScrollbarHeight,d=new p5(this._mouseEvent.pos.x,c.y+c.height-u-.1),h=DG(this._viewHelper.viewDomNode,c,d);l=this._mouseTargetFactory.createMouseTarget(this._viewHelper.getLastRenderData(),c,d,h,null)}(!l.position||l.position.lineNumber!==a)&&(this._position.outsidePosition==="above"?l=Fs.createOutsideEditor(this._position.mouseColumn,new ae(a,1),"above",this._position.outsideDistance):l=Fs.createOutsideEditor(this._position.mouseColumn,new ae(a,this._context.viewModel.getLineMaxColumn(a)),"below",this._position.outsideDistance)),this._dispatchMouse(l,!0,2),this._animationFrameDisposable=Bc(()=>this._execute())}}class v5{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 n=new Date().getTime();n-this._lastSetMouseDownCountTime>v5.CLEAR_MOUSE_DOWN_COUNT_TIME&&(e=1),this._lastSetMouseDownCountTime=n,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)}}v5.CLEAR_MOUSE_DOWN_COUNT_TIME=400;class xn{get event(){return this.emitter.event}constructor(e,t,n){const o=r=>this.emitter.fire(r);this.emitter=new le({onWillAddFirstListener:()=>e.addEventListener(t,o,n),onDidRemoveLastListener:()=>e.removeEventListener(t,o,n)})}dispose(){this.emitter.dispose()}}var Lm;(function(i){const e={total:0,min:Number.MAX_VALUE,max:0},t=Object.assign({},e),n=Object.assign({},e),o=Object.assign({},e);let r=0;const s={keydown:0,input:0,render:0};function a(){m(),performance.mark("inputlatency/start"),performance.mark("keydown/start"),s.keydown=1,queueMicrotask(l)}i.onKeyDown=a;function l(){s.keydown===1&&(performance.mark("keydown/end"),s.keydown=2)}function c(){performance.mark("input/start"),s.input=1,v()}i.onBeforeInput=c;function u(){s.input===0&&c(),queueMicrotask(d)}i.onInput=u;function d(){s.input===1&&(performance.mark("input/end"),s.input=2)}function h(){m()}i.onKeyUp=h;function f(){m()}i.onSelectionChange=f;function g(){s.keydown===2&&s.input===2&&s.render===0&&(performance.mark("render/start"),s.render=1,queueMicrotask(p),v())}i.onRenderStart=g;function p(){s.render===1&&(performance.mark("render/end"),s.render=2)}function v(){setTimeout(m)}function m(){s.keydown===2&&s.input===2&&s.render===2&&(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"),_("keydown",e),_("input",t),_("render",n),_("inputlatency",o),r++,y())}function _(E,I){const k=performance.getEntriesByName(E)[0].duration;I.total+=k,I.min=Math.min(I.min,k),I.max=Math.max(I.max,k)}function y(){performance.clearMarks("keydown/start"),performance.clearMarks("keydown/end"),performance.clearMarks("input/start"),performance.clearMarks("input/end"),performance.clearMarks("render/start"),performance.clearMarks("render/end"),performance.clearMarks("inputlatency/start"),performance.clearMarks("inputlatency/end"),performance.clearMeasures("keydown"),performance.clearMeasures("input"),performance.clearMeasures("render"),performance.clearMeasures("inputlatency"),s.keydown=0,s.input=0,s.render=0}function w(){if(r===0)return;const E={keydown:L(e),input:L(t),render:L(n),total:L(o),sampleCount:r};return D(e),D(t),D(n),D(o),r=0,E}i.getAndClearMeasurements=w;function L(E){return{average:E.total/r,max:E.max,min:E.min}}function D(E){E.total=0,E.min=Number.MAX_VALUE,E.max=0}})(Lm||(Lm={}));class Pr{constructor(e,t,n,o,r){this.value=e,this.selectionStart=t,this.selectionEnd=n,this.selection=o,this.newlineCountBeforeSelection=r}toString(){return`[ <${this.value}>, selectionStart: ${this.selectionStart}, selectionEnd: ${this.selectionEnd}]`}static readFromTextArea(e,t){const n=e.getValue(),o=e.getSelectionStart(),r=e.getSelectionEnd();let s;if(t){const a=n.substring(0,o),l=t.value.substring(0,t.selectionStart);a===l&&(s=t.newlineCountBeforeSelection)}return new Pr(n,o,r,null,s)}collapseSelection(){return this.selectionStart===this.value.length?this:new Pr(this.value,this.value.length,this.value.length,null,void 0)}writeToTextArea(e,t,n){t.setValue(e,this.value),n&&t.setSelectionRange(e,this.selectionStart,this.selectionEnd)}deduceEditorPosition(e){var t,n,o,r,s,a,l,c;if(e<=this.selectionStart){const h=this.value.substring(e,this.selectionStart);return this._finishDeduceEditorPosition((n=(t=this.selection)===null||t===void 0?void 0:t.getStartPosition())!==null&&n!==void 0?n:null,h,-1)}if(e>=this.selectionEnd){const h=this.value.substring(this.selectionEnd,e);return this._finishDeduceEditorPosition((r=(o=this.selection)===null||o===void 0?void 0:o.getEndPosition())!==null&&r!==void 0?r:null,h,1)}const u=this.value.substring(this.selectionStart,e);if(u.indexOf(String.fromCharCode(8230))===-1)return this._finishDeduceEditorPosition((a=(s=this.selection)===null||s===void 0?void 0:s.getStartPosition())!==null&&a!==void 0?a:null,u,1);const d=this.value.substring(e,this.selectionEnd);return this._finishDeduceEditorPosition((c=(l=this.selection)===null||l===void 0?void 0:l.getEndPosition())!==null&&c!==void 0?c:null,d,-1)}_finishDeduceEditorPosition(e,t,n){let o=0,r=-1;for(;(r=t.indexOf(` +`,r+1))!==-1;)o++;return[e,n*t.length,o]}static deduceInput(e,t,n){if(!e)return{text:"",replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:0};const o=Math.min(Y0(e.value,t.value),e.selectionStart,t.selectionStart),r=Math.min(zA(e.value,t.value),e.value.length-e.selectionEnd,t.value.length-t.selectionEnd);e.value.substring(o,e.value.length-r);const s=t.value.substring(o,t.value.length-r),a=e.selectionStart-o,l=e.selectionEnd-o,c=t.selectionStart-o,u=t.selectionEnd-o;if(c===u){const h=e.selectionStart-o;return{text:s,replacePrevCharCnt:h,replaceNextCharCnt:0,positionDelta:0}}const d=l-a;return{text:s,replacePrevCharCnt:d,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 n=Math.min(Y0(e.value,t.value),e.selectionEnd),o=Math.min(zA(e.value,t.value),e.value.length-e.selectionEnd),r=e.value.substring(n,e.value.length-o),s=t.value.substring(n,t.value.length-o);e.selectionStart-n;const a=e.selectionEnd-n;t.selectionStart-n;const l=t.selectionEnd-n;return{text:s,replacePrevCharCnt:a,replaceNextCharCnt:r.length-a,positionDelta:l-s.length}}}Pr.EMPTY=new Pr("",0,0,null,void 0);class WC{static _getPageOfLine(e,t){return Math.floor((e-1)/t)}static _getRangeForPage(e,t){const n=e*t,o=n+1,r=n+t;return new V(o,1,r+1,1)}static fromEditorSelection(e,t,n,o){const s=WC._getPageOfLine(t.startLineNumber,n),a=WC._getRangeForPage(s,n),l=WC._getPageOfLine(t.endLineNumber,n),c=WC._getRangeForPage(l,n);let u=a.intersectRanges(new V(1,1,t.startLineNumber,t.startColumn));if(o&&e.getValueLengthInRange(u,1)>500){const m=e.modifyPosition(u.getEndPosition(),-500);u=V.fromPositions(m,u.getEndPosition())}const d=e.getValueInRange(u,1),h=e.getLineCount(),f=e.getLineMaxColumn(h);let g=c.intersectRanges(new V(t.endLineNumber,t.endColumn,h,f));if(o&&e.getValueLengthInRange(g,1)>500){const m=e.modifyPosition(g.getStartPosition(),500);g=V.fromPositions(g.getStartPosition(),m)}const p=e.getValueInRange(g,1);let v;if(s===l||s+1===l)v=e.getValueInRange(t,1);else{const m=a.intersectRanges(t),_=c.intersectRanges(t);v=e.getValueInRange(m,1)+String.fromCharCode(8230)+e.getValueInRange(_,1)}return o&&v.length>2*500&&(v=v.substring(0,500)+String.fromCharCode(8230)+v.substring(v.length-500,v.length)),new Pr(d+v+p,d.length,d.length+v.length,t,u.endLineNumber-u.startLineNumber)}}var cP;(function(i){i.Tap="-monaco-textarea-synthetic-tap"})(cP||(cP={}));const mH={forceCopyWithSyntaxHighlighting:!1};class JD{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)}}JD.INSTANCE=new JD;class uot{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}}class dot extends _e{get textAreaState(){return this._textAreaState}constructor(e,t,n,o){super(),this._host=e,this._textArea=t,this._OS=n,this._browser=o,this._onFocus=this._register(new le),this.onFocus=this._onFocus.event,this._onBlur=this._register(new le),this.onBlur=this._onBlur.event,this._onKeyDown=this._register(new le),this.onKeyDown=this._onKeyDown.event,this._onKeyUp=this._register(new le),this.onKeyUp=this._onKeyUp.event,this._onCut=this._register(new le),this.onCut=this._onCut.event,this._onPaste=this._register(new le),this.onPaste=this._onPaste.event,this._onType=this._register(new le),this.onType=this._onType.event,this._onCompositionStart=this._register(new le),this.onCompositionStart=this._onCompositionStart.event,this._onCompositionUpdate=this._register(new le),this.onCompositionUpdate=this._onCompositionUpdate.event,this._onCompositionEnd=this._register(new le),this.onCompositionEnd=this._onCompositionEnd.event,this._onSelectionChangeRequest=this._register(new le),this.onSelectionChangeRequest=this._onSelectionChangeRequest.event,this._asyncTriggerCut=this._register(new bi(()=>this._onCut.fire(),0)),this._asyncFocusGainWriteScreenReaderContent=this._register(new bi(()=>this.writeScreenReaderContent("asyncFocusGain"),0)),this._textAreaState=Pr.EMPTY,this._selectionChangeListener=null,this.writeScreenReaderContent("ctor"),this._hasFocus=!1,this._currentComposition=null;let r=null;this._register(this._textArea.onKeyDown(s=>{const a=new Pi(s);(a.keyCode===114||this._currentComposition&&a.keyCode===1)&&a.stopPropagation(),a.equals(9)&&a.preventDefault(),r=a,this._onKeyDown.fire(a)})),this._register(this._textArea.onKeyUp(s=>{const a=new Pi(s);this._onKeyUp.fire(a)})),this._register(this._textArea.onCompositionStart(s=>{const a=new uot;if(this._currentComposition){this._currentComposition=a;return}if(this._currentComposition=a,this._OS===2&&r&&r.equals(114)&&this._textAreaState.selectionStart===this._textAreaState.selectionEnd&&this._textAreaState.selectionStart>0&&this._textAreaState.value.substr(this._textAreaState.selectionStart-1,1)===s.data&&(r.code==="ArrowRight"||r.code==="ArrowLeft")){a.handleCompositionUpdate("x"),this._onCompositionStart.fire({data:s.data});return}if(this._browser.isAndroid){this._onCompositionStart.fire({data:s.data});return}this._onCompositionStart.fire({data:s.data})})),this._register(this._textArea.onCompositionUpdate(s=>{const a=this._currentComposition;if(!a)return;if(this._browser.isAndroid){const c=Pr.readFromTextArea(this._textArea,this._textAreaState),u=Pr.deduceAndroidCompositionInput(this._textAreaState,c);this._textAreaState=c,this._onType.fire(u),this._onCompositionUpdate.fire(s);return}const l=a.handleCompositionUpdate(s.data);this._textAreaState=Pr.readFromTextArea(this._textArea,this._textAreaState),this._onType.fire(l),this._onCompositionUpdate.fire(s)})),this._register(this._textArea.onCompositionEnd(s=>{const a=this._currentComposition;if(!a)return;if(this._currentComposition=null,this._browser.isAndroid){const c=Pr.readFromTextArea(this._textArea,this._textAreaState),u=Pr.deduceAndroidCompositionInput(this._textAreaState,c);this._textAreaState=c,this._onType.fire(u),this._onCompositionEnd.fire();return}const l=a.handleCompositionUpdate(s.data);this._textAreaState=Pr.readFromTextArea(this._textArea,this._textAreaState),this._onType.fire(l),this._onCompositionEnd.fire()})),this._register(this._textArea.onInput(s=>{if(this._textArea.setIgnoreSelectionChangeTime("received input event"),this._currentComposition)return;const a=Pr.readFromTextArea(this._textArea,this._textAreaState),l=Pr.deduceInput(this._textAreaState,a,this._OS===2);l.replacePrevCharCnt===0&&l.text.length===1&&(gr(l.text.charCodeAt(0))||l.text.charCodeAt(0)===127)||(this._textAreaState=a,(l.text!==""||l.replacePrevCharCnt!==0||l.replaceNextCharCnt!==0||l.positionDelta!==0)&&this._onType.fire(l))})),this._register(this._textArea.onCut(s=>{this._textArea.setIgnoreSelectionChangeTime("received cut event"),this._ensureClipboardGetsEditorSelection(s),this._asyncTriggerCut.schedule()})),this._register(this._textArea.onCopy(s=>{this._ensureClipboardGetsEditorSelection(s)})),this._register(this._textArea.onPaste(s=>{if(this._textArea.setIgnoreSelectionChangeTime("received paste event"),s.preventDefault(),!s.clipboardData)return;let[a,l]=vH.getTextData(s.clipboardData);!a||(l=l||JD.INSTANCE.get(a),this._onPaste.fire({text:a,metadata:l}))})),this._register(this._textArea.onFocus(()=>{const s=this._hasFocus;this._setHasFocus(!0),this._browser.isSafari&&!s&&this._hasFocus&&this._asyncFocusGainWriteScreenReaderContent.schedule()})),this._register(this._textArea.onBlur(()=>{this._currentComposition&&(this._currentComposition=null,this.writeScreenReaderContent("blurWithoutCompositionEnd"),this._onCompositionEnd.fire()),this._setHasFocus(!1)})),this._register(this._textArea.onSyntheticTap(()=>{this._browser.isAndroid&&this._currentComposition&&(this._currentComposition=null,this.writeScreenReaderContent("tapWithoutCompositionEnd"),this._onCompositionEnd.fire())}))}_installSelectionChangeListener(){let e=0;return ke(this._textArea.ownerDocument,"selectionchange",t=>{if(Lm.onSelectionChange(),!this._hasFocus||this._currentComposition||!this._browser.isChrome)return;const n=Date.now(),o=n-e;if(e=n,o<5)return;const r=n-this._textArea.getIgnoreSelectionChangeTime();if(this._textArea.resetSelectionChangeTime(),r<100||!this._textAreaState.selection)return;const s=this._textArea.getValue();if(this._textAreaState.value!==s)return;const a=this._textArea.getSelectionStart(),l=this._textArea.getSelectionEnd();if(this._textAreaState.selectionStart===a&&this._textAreaState.selectionEnd===l)return;const c=this._textAreaState.deduceEditorPosition(a),u=this._host.deduceModelPosition(c[0],c[1],c[2]),d=this._textAreaState.deduceEditorPosition(l),h=this._host.deduceModelPosition(d[0],d[1],d[2]),f=new gt(u.lineNumber,u.column,h.lineNumber,h.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.writeScreenReaderContent("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}writeScreenReaderContent(e){this._currentComposition||this._setAndWriteTextAreaState(e,this._host.getScreenReaderContent())}_ensureClipboardGetsEditorSelection(e){const t=this._host.getDataToCopy(),n={version:1,isFromEmptySelection:t.isFromEmptySelection,multicursorText:t.multicursorText,mode:t.mode};JD.INSTANCE.set(this._browser.isFirefox?t.text.replace(/\r\n/g,` +`):t.text,n),e.preventDefault(),e.clipboardData&&vH.setTextData(e.clipboardData,t.text,t.html,n)}}const vH={getTextData(i){const e=i.getData(xo.text);let t=null;const n=i.getData("vscode-editor-data");if(typeof n=="string")try{t=JSON.parse(n),t.version!==1&&(t=null)}catch{}return e.length===0&&t===null&&i.files.length>0?[Array.prototype.slice.call(i.files,0).map(r=>r.name).join(` +`),null]:[e,t]},setTextData(i,e,t,n){i.setData(xo.text,e),typeof t=="string"&&i.setData("text/html",t),i.setData("vscode-editor-data",JSON.stringify(n))}};class hot extends _e{get ownerDocument(){return this._actual.ownerDocument}constructor(e){super(),this._actual=e,this.onKeyDown=this._register(new xn(this._actual,"keydown")).event,this.onKeyUp=this._register(new xn(this._actual,"keyup")).event,this.onCompositionStart=this._register(new xn(this._actual,"compositionstart")).event,this.onCompositionUpdate=this._register(new xn(this._actual,"compositionupdate")).event,this.onCompositionEnd=this._register(new xn(this._actual,"compositionend")).event,this.onBeforeInput=this._register(new xn(this._actual,"beforeinput")).event,this.onInput=this._register(new xn(this._actual,"input")).event,this.onCut=this._register(new xn(this._actual,"cut")).event,this.onCopy=this._register(new xn(this._actual,"copy")).event,this.onPaste=this._register(new xn(this._actual,"paste")).event,this.onFocus=this._register(new xn(this._actual,"focus")).event,this.onBlur=this._register(new xn(this._actual,"blur")).event,this._onSyntheticTap=this._register(new le),this.onSyntheticTap=this._onSyntheticTap.event,this._ignoreSelectionChangeTime=0,this._register(this.onKeyDown(()=>Lm.onKeyDown())),this._register(this.onBeforeInput(()=>Lm.onBeforeInput())),this._register(this.onInput(()=>Lm.onInput())),this._register(this.onKeyUp(()=>Lm.onKeyUp())),this._register(ke(this._actual,cP.Tap,()=>this._onSyntheticTap.fire()))}hasFocus(){const e=eb(this._actual);return e?e.activeElement===this._actual:oG(this._actual)?this._actual.ownerDocument.activeElement===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 n=this._actual;n.value!==t&&(this.setIgnoreSelectionChangeTime("setValue"),n.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,n){const o=this._actual;let r=null;const s=eb(o);s?r=s.activeElement:r=o.ownerDocument.activeElement;const a=r===o,l=o.selectionStart,c=o.selectionEnd;if(a&&l===t&&c===n){Fc&&window.parent!==window&&o.focus();return}if(a){this.setIgnoreSelectionChangeTime("setSelectionRange"),o.setSelectionRange(t,n),Fc&&window.parent!==window&&o.focus();return}try{const u=zQe(o);this.setIgnoreSelectionChangeTime("setSelectionRange"),o.focus(),o.setSelectionRange(t,n),UQe(o,u)}catch{}}}class fot extends RG{constructor(e,t,n){super(e,t,n),this._register(Ei.addTarget(this.viewHelper.linesContentDomNode)),this._register(ke(this.viewHelper.linesContentDomNode,Di.Tap,r=>this.onTap(r))),this._register(ke(this.viewHelper.linesContentDomNode,Di.Change,r=>this.onChange(r))),this._register(ke(this.viewHelper.linesContentDomNode,Di.Contextmenu,r=>this._onContextMenu(new Dv(r,!1,this.viewHelper.viewDomNode),!1))),this._lastPointerType="mouse",this._register(ke(this.viewHelper.linesContentDomNode,"pointerdown",r=>{const s=r.pointerType;if(s==="mouse"){this._lastPointerType="mouse";return}else s==="touch"?this._lastPointerType="touch":this._lastPointerType="pen"}));const o=new Ait(this.viewHelper.viewDomNode);this._register(o.onPointerMove(this.viewHelper.viewDomNode,r=>this._onMouseMove(r))),this._register(o.onPointerUp(this.viewHelper.viewDomNode,r=>this._onMouseUp(r))),this._register(o.onPointerLeave(this.viewHelper.viewDomNode,r=>this._onMouseLeave(r))),this._register(o.onPointerDown(this.viewHelper.viewDomNode,(r,s)=>this._onMouseDown(r,s)))}onTap(e){if(!e.initialTarget||!this.viewHelper.linesContentDomNode.contains(e.initialTarget))return;e.preventDefault(),this.viewHelper.focusTextArea();const t=this._createMouseTarget(new Dv(e,!1,this.viewHelper.viewDomNode),!1);t.position&&this.viewController.dispatchMouse({position:t.position,mouseColumn:t.position.column,startedOnLineNumbers:!1,revealType:1,mouseDownCount:e.tapCount,inSelectionMode:!1,altKey:!1,ctrlKey:!1,metaKey:!1,shiftKey:!1,leftButton:!1,middleButton:!1,onInjectedText:t.type===6&&t.detail.injectedText!==null})}onChange(e){this._lastPointerType==="touch"&&this._context.viewModel.viewLayout.deltaScrollNow(-e.translationX,-e.translationY)}_onMouseDown(e,t){e.browserEvent.pointerType!=="touch"&&super._onMouseDown(e,t)}}class got extends RG{constructor(e,t,n){super(e,t,n),this._register(Ei.addTarget(this.viewHelper.linesContentDomNode)),this._register(ke(this.viewHelper.linesContentDomNode,Di.Tap,o=>this.onTap(o))),this._register(ke(this.viewHelper.linesContentDomNode,Di.Change,o=>this.onChange(o))),this._register(ke(this.viewHelper.linesContentDomNode,Di.Contextmenu,o=>this._onContextMenu(new Dv(o,!1,this.viewHelper.viewDomNode),!1)))}onTap(e){e.preventDefault(),this.viewHelper.focusTextArea();const t=this._createMouseTarget(new Dv(e,!1,this.viewHelper.viewDomNode),!1);if(t.position){const n=document.createEvent("CustomEvent");n.initEvent(cP.Tap,!1,!0),this.viewHelper.dispatchTextAreaEvent(n),this.viewController.moveTo(t.position,1)}}onChange(e){this._context.viewModel.viewLayout.deltaScrollNow(-e.translationX,-e.translationY)}}class pot extends _e{constructor(e,t,n){super(),Kd&&iG.pointerEvents?this.handler=this._register(new fot(e,t,n)):window.TouchEvent?this.handler=this._register(new got(e,t,n)):this.handler=this._register(new RG(e,t,n))}getTargetAtClientPoint(e,t){return this.handler.getTargetAtClientPoint(e,t)}}class Hb extends GI{}const vr=yn("themeService");function ro(i){return{id:i}}function _H(i){switch(i){case Ic.DARK:return"vs-dark";case Ic.HIGH_CONTRAST_DARK:return"hc-black";case Ic.HIGH_CONTRAST_LIGHT:return"hc-light";default:return"vs"}}const _be={ThemingContribution:"base.contributions.theming"};class mot{constructor(){this.themingParticipants=[],this.themingParticipants=[],this.onThemingParticipantAddedEmitter=new le}onColorThemeChange(e){return this.themingParticipants.push(e),this.onThemingParticipantAddedEmitter.fire(e),zt(()=>{const t=this.themingParticipants.indexOf(e);this.themingParticipants.splice(t,1)})}getThemingParticipants(){return this.themingParticipants}}const bbe=new mot;no.add(_be.ThemingContribution,bbe);function ju(i){return bbe.onColorThemeChange(i)}class vot extends _e{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(){}}const Cbe=J("editor.lineHighlightBackground",{dark:null,light:null,hcDark:null,hcLight:null},C("lineHighlight","Background color for the highlight of line at the cursor position.")),Wre=J("editor.lineHighlightBorder",{dark:"#282828",light:"#eeeeee",hcDark:"#f38518",hcLight:Ln},C("lineHighlightBorderBox","Background color for the border around the line at the cursor position."));J("editor.rangeHighlightBackground",{dark:"#ffffff0b",light:"#fdff0033",hcDark:null,hcLight:null},C("rangeHighlight","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);J("editor.rangeHighlightBorder",{dark:null,light:null,hcDark:Wi,hcLight:Wi},C("rangeHighlightBorder","Background color of the border around highlighted ranges."),!0);J("editor.symbolHighlightBackground",{dark:Jh,light:Jh,hcDark:null,hcLight:null},C("symbolHighlight","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);J("editor.symbolHighlightBorder",{dark:null,light:null,hcDark:Wi,hcLight:Wi},C("symbolHighlightBorder","Background color of the border around highlighted symbols."),!0);const ybe=J("editorCursor.foreground",{dark:"#AEAFAD",light:ve.black,hcDark:ve.white,hcLight:"#0F4A85"},C("caret","Color of the editor cursor.")),_ot=J("editorCursor.background",null,C("editorCursorBackground","The background color of the editor cursor. Allows customizing the color of a character overlapped by a block cursor.")),Wg=J("editorWhitespace.foreground",{dark:"#e3e4e229",light:"#33333333",hcDark:"#e3e4e229",hcLight:"#CCCCCC"},C("editorWhitespaces","Color of whitespace characters in the editor.")),bot=J("editorLineNumber.foreground",{dark:"#858585",light:"#237893",hcDark:ve.white,hcLight:"#292929"},C("editorLineNumbers","Color of editor line numbers.")),d2=J("editorIndentGuide.background",{dark:Wg,light:Wg,hcDark:Wg,hcLight:Wg},C("editorIndentGuides","Color of the editor indentation guides."),!1,C("deprecatedEditorIndentGuides","'editorIndentGuide.background' is deprecated. Use 'editorIndentGuide.background1' instead.")),h2=J("editorIndentGuide.activeBackground",{dark:Wg,light:Wg,hcDark:Wg,hcLight:Wg},C("editorActiveIndentGuide","Color of the active editor indentation guides."),!1,C("deprecatedEditorActiveIndentGuide","'editorIndentGuide.activeBackground' is deprecated. Use 'editorIndentGuide.activeBackground1' instead.")),ZI=J("editorIndentGuide.background1",{dark:d2,light:d2,hcDark:d2,hcLight:d2},C("editorIndentGuides1","Color of the editor indentation guides (1).")),Cot=J("editorIndentGuide.background2",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},C("editorIndentGuides2","Color of the editor indentation guides (2).")),yot=J("editorIndentGuide.background3",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},C("editorIndentGuides3","Color of the editor indentation guides (3).")),wot=J("editorIndentGuide.background4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},C("editorIndentGuides4","Color of the editor indentation guides (4).")),Sot=J("editorIndentGuide.background5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},C("editorIndentGuides5","Color of the editor indentation guides (5).")),xot=J("editorIndentGuide.background6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},C("editorIndentGuides6","Color of the editor indentation guides (6).")),QI=J("editorIndentGuide.activeBackground1",{dark:h2,light:h2,hcDark:h2,hcLight:h2},C("editorActiveIndentGuide1","Color of the active editor indentation guides (1).")),Lot=J("editorIndentGuide.activeBackground2",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},C("editorActiveIndentGuide2","Color of the active editor indentation guides (2).")),Eot=J("editorIndentGuide.activeBackground3",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},C("editorActiveIndentGuide3","Color of the active editor indentation guides (3).")),Dot=J("editorIndentGuide.activeBackground4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},C("editorActiveIndentGuide4","Color of the active editor indentation guides (4).")),kot=J("editorIndentGuide.activeBackground5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},C("editorActiveIndentGuide5","Color of the active editor indentation guides (5).")),Iot=J("editorIndentGuide.activeBackground6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},C("editorActiveIndentGuide6","Color of the active editor indentation guides (6).")),f2=J("editorActiveLineNumber.foreground",{dark:"#c6c6c6",light:"#0B216F",hcDark:Wi,hcLight:Wi},C("editorActiveLineNumber","Color of editor active line number"),!1,C("deprecatedEditorActiveLineNumber","Id is deprecated. Use 'editorLineNumber.activeForeground' instead."));J("editorLineNumber.activeForeground",{dark:f2,light:f2,hcDark:f2,hcLight:f2},C("editorActiveLineNumber","Color of editor active line number"));const Tot=J("editorLineNumber.dimmedForeground",{dark:null,light:null,hcDark:null,hcLight:null},C("editorDimmedLineNumber","Color of the final editor line when editor.renderFinalNewline is set to dimmed."));J("editorRuler.foreground",{dark:"#5A5A5A",light:ve.lightgrey,hcDark:ve.white,hcLight:"#292929"},C("editorRuler","Color of the editor rulers."));J("editorCodeLens.foreground",{dark:"#999999",light:"#919191",hcDark:"#999999",hcLight:"#292929"},C("editorCodeLensForeground","Foreground color of editor CodeLens"));J("editorBracketMatch.background",{dark:"#0064001a",light:"#0064001a",hcDark:"#0064001a",hcLight:"#0000"},C("editorBracketMatchBackground","Background color behind matching brackets"));J("editorBracketMatch.border",{dark:"#888",light:"#B9B9B9",hcDark:Ln,hcLight:Ln},C("editorBracketMatchBorder","Color for matching brackets boxes"));const Not=J("editorOverviewRuler.border",{dark:"#7f7f7f4d",light:"#7f7f7f4d",hcDark:"#7f7f7f4d",hcLight:"#666666"},C("editorOverviewRulerBorder","Color of the overview ruler border.")),Rot=J("editorOverviewRuler.background",null,C("editorOverviewRulerBackground","Background color of the editor overview ruler."));J("editorGutter.background",{dark:mr,light:mr,hcDark:mr,hcLight:mr},C("editorGutter","Background color of the editor gutter. The gutter contains the glyph margins and the line numbers."));J("editorUnnecessaryCode.border",{dark:null,light:null,hcDark:ve.fromHex("#fff").transparent(.8),hcLight:Ln},C("unnecessaryCodeBorder","Border color of unnecessary (unused) source code in the editor."));const Mot=J("editorUnnecessaryCode.opacity",{dark:ve.fromHex("#000a"),light:ve.fromHex("#0007"),hcDark:null,hcLight:null},C("unnecessaryCodeOpacity",`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.`));J("editorGhostText.border",{dark:null,light:null,hcDark:ve.fromHex("#fff").transparent(.8),hcLight:ve.fromHex("#292929").transparent(.8)},C("editorGhostTextBorder","Border color of ghost text in the editor."));J("editorGhostText.foreground",{dark:ve.fromHex("#ffffff56"),light:ve.fromHex("#0007"),hcDark:null,hcLight:null},C("editorGhostTextForeground","Foreground color of the ghost text in the editor."));J("editorGhostText.background",{dark:null,light:null,hcDark:null,hcLight:null},C("editorGhostTextBackground","Background color of the ghost text in the editor."));const g2=new ve(new Tn(0,122,204,.6)),wbe=J("editorOverviewRuler.rangeHighlightForeground",{dark:g2,light:g2,hcDark:g2,hcLight:g2},C("overviewRulerRangeHighlight","Overview ruler marker color for range highlights. The color must not be opaque so as not to hide underlying decorations."),!0),Aot=J("editorOverviewRuler.errorForeground",{dark:new ve(new Tn(255,18,18,.7)),light:new ve(new Tn(255,18,18,.7)),hcDark:new ve(new Tn(255,50,50,1)),hcLight:"#B5200D"},C("overviewRuleError","Overview ruler marker color for errors.")),Pot=J("editorOverviewRuler.warningForeground",{dark:$l,light:$l,hcDark:GD,hcLight:GD},C("overviewRuleWarning","Overview ruler marker color for warnings.")),Oot=J("editorOverviewRuler.infoForeground",{dark:Ma,light:Ma,hcDark:XD,hcLight:XD},C("overviewRuleInfo","Overview ruler marker color for infos.")),Sbe=J("editorBracketHighlight.foreground1",{dark:"#FFD700",light:"#0431FAFF",hcDark:"#FFD700",hcLight:"#0431FAFF"},C("editorBracketHighlightForeground1","Foreground color of brackets (1). Requires enabling bracket pair colorization.")),xbe=J("editorBracketHighlight.foreground2",{dark:"#DA70D6",light:"#319331FF",hcDark:"#DA70D6",hcLight:"#319331FF"},C("editorBracketHighlightForeground2","Foreground color of brackets (2). Requires enabling bracket pair colorization.")),Lbe=J("editorBracketHighlight.foreground3",{dark:"#179FFF",light:"#7B3814FF",hcDark:"#87CEFA",hcLight:"#7B3814FF"},C("editorBracketHighlightForeground3","Foreground color of brackets (3). Requires enabling bracket pair colorization.")),Ebe=J("editorBracketHighlight.foreground4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},C("editorBracketHighlightForeground4","Foreground color of brackets (4). Requires enabling bracket pair colorization.")),Dbe=J("editorBracketHighlight.foreground5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},C("editorBracketHighlightForeground5","Foreground color of brackets (5). Requires enabling bracket pair colorization.")),kbe=J("editorBracketHighlight.foreground6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},C("editorBracketHighlightForeground6","Foreground color of brackets (6). Requires enabling bracket pair colorization.")),Fot=J("editorBracketHighlight.unexpectedBracket.foreground",{dark:new ve(new Tn(255,18,18,.8)),light:new ve(new Tn(255,18,18,.8)),hcDark:new ve(new Tn(255,50,50,1)),hcLight:""},C("editorBracketHighlightUnexpectedBracketForeground","Foreground color of unexpected brackets.")),Bot=J("editorBracketPairGuide.background1",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},C("editorBracketPairGuide.background1","Background color of inactive bracket pair guides (1). Requires enabling bracket pair guides.")),Wot=J("editorBracketPairGuide.background2",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},C("editorBracketPairGuide.background2","Background color of inactive bracket pair guides (2). Requires enabling bracket pair guides.")),Vot=J("editorBracketPairGuide.background3",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},C("editorBracketPairGuide.background3","Background color of inactive bracket pair guides (3). Requires enabling bracket pair guides.")),Hot=J("editorBracketPairGuide.background4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},C("editorBracketPairGuide.background4","Background color of inactive bracket pair guides (4). Requires enabling bracket pair guides.")),$ot=J("editorBracketPairGuide.background5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},C("editorBracketPairGuide.background5","Background color of inactive bracket pair guides (5). Requires enabling bracket pair guides.")),zot=J("editorBracketPairGuide.background6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},C("editorBracketPairGuide.background6","Background color of inactive bracket pair guides (6). Requires enabling bracket pair guides.")),Uot=J("editorBracketPairGuide.activeBackground1",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},C("editorBracketPairGuide.activeBackground1","Background color of active bracket pair guides (1). Requires enabling bracket pair guides.")),jot=J("editorBracketPairGuide.activeBackground2",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},C("editorBracketPairGuide.activeBackground2","Background color of active bracket pair guides (2). Requires enabling bracket pair guides.")),Kot=J("editorBracketPairGuide.activeBackground3",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},C("editorBracketPairGuide.activeBackground3","Background color of active bracket pair guides (3). Requires enabling bracket pair guides.")),qot=J("editorBracketPairGuide.activeBackground4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},C("editorBracketPairGuide.activeBackground4","Background color of active bracket pair guides (4). Requires enabling bracket pair guides.")),Got=J("editorBracketPairGuide.activeBackground5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},C("editorBracketPairGuide.activeBackground5","Background color of active bracket pair guides (5). Requires enabling bracket pair guides.")),Xot=J("editorBracketPairGuide.activeBackground6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},C("editorBracketPairGuide.activeBackground6","Background color of active bracket pair guides (6). Requires enabling bracket pair guides."));J("editorUnicodeHighlight.border",{dark:"#BD9B03",light:"#CEA33D",hcDark:"#ff0000",hcLight:"#CEA33D"},C("editorUnicodeHighlight.border","Border color used to highlight unicode characters."));J("editorUnicodeHighlight.background",{dark:"#bd9b0326",light:"#cea33d14",hcDark:"#00000000",hcLight:"#cea33d14"},C("editorUnicodeHighlight.background","Background color used to highlight unicode characters."));ju((i,e)=>{const t=i.getColor(mr),n=i.getColor(Cbe),o=n&&!n.isTransparent()?n:t;o&&e.addRule(`.monaco-editor .inputarea.ime-input { background-color: ${o}; }`)});class JI extends Hb{constructor(e){super(),this._context=e,this._readConfig(),this._lastCursorModelPosition=new ae(1,1),this._renderResult=null,this._activeLineNumber=1,this._context.addEventHandler(this)}_readConfig(){const e=this._context.configuration.options;this._lineHeight=e.get(66);const t=e.get(67);this._renderLineNumbers=t.renderType,this._renderCustomLineNumbers=t.renderFn,this._renderFinalNewline=e.get(94);const n=e.get(143);this._lineNumbersLeft=n.lineNumbersLeft,this._lineNumbersWidth=n.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 n=!1;return this._activeLineNumber!==t.lineNumber&&(this._activeLineNumber=t.lineNumber,n=!0),(this._renderLineNumbers===2||this._renderLineNumbers===3)&&(n=!0),n}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}_getLineRenderLineNumber(e){const t=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new ae(e,1));if(t.column!==1)return"";const n=t.lineNumber;if(this._renderCustomLineNumbers)return this._renderCustomLineNumbers(n);if(this._renderLineNumbers===2){const o=Math.abs(this._lastCursorModelPosition.lineNumber-n);return o===0?''+n+"":String(o)}return this._renderLineNumbers===3?this._lastCursorModelPosition.lineNumber===n||n%10===0?String(n):"":String(n)}prepareRender(e){if(this._renderLineNumbers===0){this._renderResult=null;return}const t=xs?this._lineHeight%2===0?" lh-even":" lh-odd":"",n=e.visibleRange.startLineNumber,o=e.visibleRange.endLineNumber,r=this._context.viewModel.getLineCount(),s=[];for(let a=n;a<=o;a++){const l=a-n,c=this._getLineRenderLineNumber(a);if(!c){s[l]="";continue}let u="";if(a===r&&this._context.viewModel.getLineLength(a)===0){if(this._renderFinalNewline==="off"){s[l]="";continue}this._renderFinalNewline==="dimmed"&&(u=" dimmed-line-number")}a===this._activeLineNumber&&(u=" active-line-number"),s[l]=`
${c}
`}this._renderResult=s}render(e,t){if(!this._renderResult)return"";const n=t-e;return n<0||n>=this._renderResult.length?"":this._renderResult[n]}}JI.CLASS_NAME="line-numbers";ju((i,e)=>{const t=i.getColor(bot),n=i.getColor(Tot);n?e.addRule(`.monaco-editor .line-numbers.dimmed-line-number { color: ${n}; }`):t&&e.addRule(`.monaco-editor .line-numbers.dimmed-line-number { color: ${t.transparent(.4)}; }`)});class tb extends pl{constructor(e){super(e);const t=this._context.configuration.options,n=t.get(143);this._canUseLayerHinting=!t.get(32),this._contentLeft=n.contentLeft,this._glyphMarginLeft=n.glyphMarginLeft,this._glyphMarginWidth=n.glyphMarginWidth,this._domNode=ti(document.createElement("div")),this._domNode.setClassName(tb.OUTER_CLASS_NAME),this._domNode.setPosition("absolute"),this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true"),this._glyphMarginBackgroundDomNode=ti(document.createElement("div")),this._glyphMarginBackgroundDomNode.setClassName(tb.CLASS_NAME),this._domNode.appendChild(this._glyphMarginBackgroundDomNode)}dispose(){super.dispose()}getDomNode(){return this._domNode}onConfigurationChanged(e){const t=this._context.configuration.options,n=t.get(143);return this._canUseLayerHinting=!t.get(32),this._contentLeft=n.contentLeft,this._glyphMarginLeft=n.glyphMarginLeft,this._glyphMarginWidth=n.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 n=Math.min(e.scrollHeight,1e6);this._domNode.setHeight(n),this._domNode.setWidth(this._contentLeft),this._glyphMarginBackgroundDomNode.setLeft(this._glyphMarginLeft),this._glyphMarginBackgroundDomNode.setWidth(this._glyphMarginWidth),this._glyphMarginBackgroundDomNode.setHeight(n)}}tb.CLASS_NAME="glyph-margin";tb.OUTER_CLASS_NAME="margin";const xy="monaco-mouse-cursor-text";class Yot{constructor(){this._onDidChange=new le,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 hE=new Yot,xi=yn("keybindingService");var Zot=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Qot=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};class Jot{constructor(e,t,n,o,r){this._context=e,this.modelLineNumber=t,this.distanceToModelLineStart=n,this.widthOfHiddenLineTextBefore=o,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 ae(this.modelLineNumber,this.distanceToModelLineStart+1),n=new ae(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(n),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:1,italic:!1,bold:!1,underline:!1,strikethrough:!1}),this._previousPresentation}}const o9=Fc;let bH=class extends pl{constructor(e,t,n,o){super(e),this._keybindingService=o,this._primaryCursorPosition=new ae(1,1),this._primaryCursorVisibleRange=null,this._viewController=t,this._visibleRangeProvider=n,this._scrollLeft=0,this._scrollTop=0;const r=this._context.configuration.options,s=r.get(143);this._setAccessibilityOptions(r),this._contentLeft=s.contentLeft,this._contentWidth=s.contentWidth,this._contentHeight=s.height,this._fontInfo=r.get(50),this._lineHeight=r.get(66),this._emptySelectionClipboard=r.get(37),this._copyWithSyntaxHighlighting=r.get(25),this._visibleTextArea=null,this._selections=[new gt(1,1,1,1)],this._modelSelections=[new gt(1,1,1,1)],this._lastRenderPosition=null,this.textArea=ti(document.createElement("textarea")),vf.write(this.textArea,6),this.textArea.setClassName(`inputarea ${xy}`),this.textArea.setAttribute("wrap",this._textAreaWrapping&&!this._visibleTextArea?"on":"off");const{tabSize:a}=this._context.viewModel.model.getOptions();this.textArea.domNode.style.tabSize=`${a*this._fontInfo.spaceWidth}px`,this.textArea.setAttribute("autocorrect","off"),this.textArea.setAttribute("autocapitalize","off"),this.textArea.setAttribute("autocomplete","off"),this.textArea.setAttribute("spellcheck","false"),this.textArea.setAttribute("aria-label",this._getAriaLabel(r)),this.textArea.setAttribute("aria-required",r.get(5)?"true":"false"),this.textArea.setAttribute("tabindex",String(r.get(123))),this.textArea.setAttribute("role","textbox"),this.textArea.setAttribute("aria-roledescription",C("editor","editor")),this.textArea.setAttribute("aria-multiline","true"),this.textArea.setAttribute("aria-autocomplete",r.get(90)?"none":"both"),this._ensureReadOnlyAttribute(),this.textAreaCover=ti(document.createElement("div")),this.textAreaCover.setPosition("absolute");const l={getLineCount:()=>this._context.viewModel.getLineCount(),getLineMaxColumn:d=>this._context.viewModel.getLineMaxColumn(d),getValueInRange:(d,h)=>this._context.viewModel.getValueInRange(d,h),getValueLengthInRange:(d,h)=>this._context.viewModel.getValueLengthInRange(d,h),modifyPosition:(d,h)=>this._context.viewModel.modifyPosition(d,h)},c={getDataToCopy:()=>{const d=this._context.viewModel.getPlainTextToCopy(this._modelSelections,this._emptySelectionClipboard,ls),h=this._context.viewModel.model.getEOL(),f=this._emptySelectionClipboard&&this._modelSelections.length===1&&this._modelSelections[0].isEmpty(),g=Array.isArray(d)?d:null,p=Array.isArray(d)?d.join(h):d;let v,m=null;if(mH.forceCopyWithSyntaxHighlighting||this._copyWithSyntaxHighlighting&&p.length<65536){const _=this._context.viewModel.getRichTextToCopy(this._modelSelections,this._emptySelectionClipboard);_&&(v=_.html,m=_.mode)}return{isFromEmptySelection:f,multicursorText:g,text:p,html:v,mode:m}},getScreenReaderContent:()=>{if(this._accessibilitySupport===1){const d=this._selections[0];if(Nn&&d.isEmpty()){const f=d.getStartPosition();let g=this._getWordBeforePosition(f);if(g.length===0&&(g=this._getCharacterBeforePosition(f)),g.length>0)return new Pr(g,g.length,g.length,V.fromPositions(f),0)}const h=500;if(Nn&&!d.isEmpty()&&l.getValueLengthInRange(d,0)0)return new Pr(f,g,g,V.fromPositions(h),0)}return Pr.EMPTY}return WC.fromEditorSelection(l,this._selections[0],this._accessibilityPageSize,this._accessibilitySupport===0)},deduceModelPosition:(d,h,f)=>this._context.viewModel.deduceModelPositionRelativeToViewPosition(d,h,f)},u=this._register(new hot(this.textArea.domNode));this._textAreaInput=this._register(new dot(c,u,Vl,{isAndroid:goe,isChrome:Jq,isFirefox:Fc,isSafari:ap})),this._register(this._textAreaInput.onKeyDown(d=>{this._viewController.emitKeyDown(d)})),this._register(this._textAreaInput.onKeyUp(d=>{this._viewController.emitKeyUp(d)})),this._register(this._textAreaInput.onPaste(d=>{let h=!1,f=null,g=null;d.metadata&&(h=this._emptySelectionClipboard&&!!d.metadata.isFromEmptySelection,f=typeof d.metadata.multicursorText!="undefined"?d.metadata.multicursorText:null,g=d.metadata.mode),this._viewController.paste(d.text,h,f,g)})),this._register(this._textAreaInput.onCut(()=>{this._viewController.cut()})),this._register(this._textAreaInput.onType(d=>{d.replacePrevCharCnt||d.replaceNextCharCnt||d.positionDelta?this._viewController.compositionType(d.text,d.replacePrevCharCnt,d.replaceNextCharCnt,d.positionDelta):this._viewController.type(d.text)})),this._register(this._textAreaInput.onSelectionChangeRequest(d=>{this._viewController.setSelection(d)})),this._register(this._textAreaInput.onCompositionStart(d=>{const h=this.textArea.domNode,f=this._modelSelections[0],{distanceToModelLineStart:g,widthOfHiddenTextBefore:p}=(()=>{const m=h.value.substring(0,Math.min(h.selectionStart,h.selectionEnd)),_=m.lastIndexOf(` +`),y=m.substring(_+1),w=y.lastIndexOf(" "),L=y.length-w-1,D=f.getStartPosition(),E=Math.min(D.column-1,L),I=D.column-1-E,k=y.substring(0,y.length-E),{tabSize:R}=this._context.viewModel.model.getOptions(),A=ert(this.textArea.domNode.ownerDocument,k,this._fontInfo,R);return{distanceToModelLineStart:I,widthOfHiddenTextBefore:A}})(),{distanceToModelLineEnd:v}=(()=>{const m=h.value.substring(Math.max(h.selectionStart,h.selectionEnd)),_=m.indexOf(` +`),y=_===-1?m:m.substring(0,_),w=y.indexOf(" "),L=w===-1?y.length:y.length-w-1,D=f.getEndPosition(),E=Math.min(this._context.viewModel.model.getLineMaxColumn(D.lineNumber)-D.column,L);return{distanceToModelLineEnd:this._context.viewModel.model.getLineMaxColumn(D.lineNumber)-D.column-E}})();this._context.viewModel.revealRange("keyboard",!0,V.fromPositions(this._selections[0].getStartPosition()),0,1),this._visibleTextArea=new Jot(this._context,f.startLineNumber,g,p,v),this.textArea.setAttribute("wrap",this._textAreaWrapping&&!this._visibleTextArea?"on":"off"),this._visibleTextArea.prepareRender(this._visibleRangeProvider),this._render(),this.textArea.setClassName(`inputarea ${xy} ime-input`),this._viewController.compositionStart(),this._context.viewModel.onCompositionStart()})),this._register(this._textAreaInput.onCompositionUpdate(d=>{!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 ${xy}`),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(hE.onDidChange(()=>{this._ensureReadOnlyAttribute()}))}writeScreenReaderContent(e){this._textAreaInput.writeScreenReaderContent(e)}dispose(){super.dispose()}_getAndroidWordAtPosition(e){const t='`~!@#$%^&*()-=+[{]}\\|;:",.<>/?',n=this._context.viewModel.getLineContent(e.lineNumber),o=Vc(t);let r=!0,s=e.column,a=!0,l=e.column,c=0;for(;c<50&&(r||a);){if(r&&s<=1&&(r=!1),r){const u=n.charCodeAt(s-2);o.get(u)!==0?r=!1:s--}if(a&&l>n.length&&(a=!1),a){const u=n.charCodeAt(l-1);o.get(u)!==0?a=!1:l++}c++}return[n.substring(s-1,l-1),e.column-s]}_getWordBeforePosition(e){const t=this._context.viewModel.getLineContent(e.lineNumber),n=Vc(this._context.configuration.options.get(129));let o=e.column,r=0;for(;o>1;){const s=t.charCodeAt(o-2);if(n.get(s)!==0||r>50)return t.substring(o-1,e.column-1);r++,o--}return t.substring(0,e.column-1)}_getCharacterBeforePosition(e){if(e.column>1){const n=this._context.viewModel.getLineContent(e.lineNumber).charAt(e.column-2);if(!gr(n.charCodeAt(0)))return n}return""}_getAriaLabel(e){var t,n,o;if(e.get(2)===1){const s=(t=this._keybindingService.lookupKeybinding("editor.action.toggleScreenReaderAccessibilityMode"))===null||t===void 0?void 0:t.getAriaLabel(),a=(n=this._keybindingService.lookupKeybinding("workbench.action.showCommands"))===null||n===void 0?void 0:n.getAriaLabel(),l=(o=this._keybindingService.lookupKeybinding("workbench.action.openGlobalKeybindings"))===null||o===void 0?void 0:o.getAriaLabel(),c=C("accessibilityModeOff","The editor is not accessible at this time.");return s?C("accessibilityOffAriaLabel","{0} To enable screen reader optimized mode, use {1}",c,s):a?C("accessibilityOffAriaLabelNoKb","{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.",c,a):l?C("accessibilityOffAriaLabelNoKbs","{0} Please assign a keybinding for the command Toggle Screen Reader Accessibility Mode by accessing the keybindings editor with {1} and run it.",c,l):c}return e.get(4)}_setAccessibilityOptions(e){this._accessibilitySupport=e.get(2);const t=e.get(3);this._accessibilitySupport===2&&t===rh.accessibilityPageSize.defaultValue?this._accessibilityPageSize=500:this._accessibilityPageSize=t;const o=e.get(143).wrappingColumn;if(o!==-1&&this._accessibilitySupport!==1){const r=e.get(50);this._textAreaWrapping=!0,this._textAreaWidth=Math.round(o*r.typicalHalfwidthCharacterWidth)}else this._textAreaWrapping=!1,this._textAreaWidth=o9?0:1}onConfigurationChanged(e){const t=this._context.configuration.options,n=t.get(143);this._setAccessibilityOptions(t),this._contentLeft=n.contentLeft,this._contentWidth=n.contentWidth,this._contentHeight=n.height,this._fontInfo=t.get(50),this._lineHeight=t.get(66),this._emptySelectionClipboard=t.get(37),this._copyWithSyntaxHighlighting=t.get(25),this.textArea.setAttribute("wrap",this._textAreaWrapping&&!this._visibleTextArea?"on":"off");const{tabSize:o}=this._context.viewModel.model.getOptions();return this.textArea.domNode.style.tabSize=`${o*this._fontInfo.spaceWidth}px`,this.textArea.setAttribute("aria-label",this._getAriaLabel(t)),this.textArea.setAttribute("aria-required",t.get(5)?"true":"false"),this.textArea.setAttribute("tabindex",String(t.get(123))),(e.hasChanged(34)||e.hasChanged(90))&&this._ensureReadOnlyAttribute(),e.hasChanged(2)&&this._textAreaInput.writeScreenReaderContent("strategy changed"),!0}onCursorStateChanged(e){return this._selections=e.selections.slice(0),this._modelSelections=e.modelSelections.slice(0),this._textAreaInput.writeScreenReaderContent("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()}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;!hE.enabled||e.get(34)&&e.get(90)?this.textArea.setAttribute("readonly","true"):this.textArea.removeAttribute("readonly")}prepareRender(e){var t;this._primaryCursorPosition=new ae(this._selections[0].positionLineNumber,this._selections[0].positionColumn),this._primaryCursorVisibleRange=e.visibleRangeForPosition(this._primaryCursorPosition),(t=this._visibleTextArea)===null||t===void 0||t.prepareRender(e)}render(e){this._textAreaInput.writeScreenReaderContent("render"),this._render()}_render(){var e;if(this._visibleTextArea){const o=this._visibleTextArea.visibleTextareaStart,r=this._visibleTextArea.visibleTextareaEnd,s=this._visibleTextArea.startPosition,a=this._visibleTextArea.endPosition;if(s&&a&&o&&r&&r.left>=this._scrollLeft&&o.left<=this._scrollLeft+this._contentWidth){const l=this._context.viewLayout.getVerticalOffsetForLineNumber(this._primaryCursorPosition.lineNumber)-this._scrollTop,c=this._newlinecount(this.textArea.domNode.value.substr(0,this.textArea.domNode.selectionStart));let u=this._visibleTextArea.widthOfHiddenLineTextBefore,d=this._contentLeft+o.left-this._scrollLeft,h=r.left-o.left+1;if(dthis._contentWidth&&(h=this._contentWidth);const f=this._context.viewModel.getViewLineData(s.lineNumber),g=f.tokens.findTokenIndexAtOffset(s.column-1),p=f.tokens.findTokenIndexAtOffset(a.column-1),v=g===p,m=this._visibleTextArea.definePresentation(v?f.tokens.getPresentation(g):null);this.textArea.domNode.scrollTop=c*this._lineHeight,this.textArea.domNode.scrollLeft=u,this._doRender({lastRenderPosition:null,top:l,left:d,width:h,height:this._lineHeight,useCover:!1,color:(oo.getColorMap()||[])[m.foreground],italic:m.italic,bold:m.bold,underline:m.underline,strikethrough:m.strikethrough})}return}if(!this._primaryCursorVisibleRange){this._renderAtTopLeft();return}const t=this._contentLeft+this._primaryCursorVisibleRange.left-this._scrollLeft;if(tthis._contentLeft+this._contentWidth){this._renderAtTopLeft();return}const n=this._context.viewLayout.getVerticalOffsetForLineNumber(this._selections[0].positionLineNumber)-this._scrollTop;if(n<0||n>this._contentHeight){this._renderAtTopLeft();return}if(Nn){this._doRender({lastRenderPosition:this._primaryCursorPosition,top:n,left:this._textAreaWrapping?this._contentLeft:t,width:this._textAreaWidth,height:this._lineHeight,useCover:!1}),this.textArea.domNode.scrollLeft=this._primaryCursorVisibleRange.left;const o=(e=this._textAreaInput.textAreaState.newlineCountBeforeSelection)!==null&&e!==void 0?e:this._newlinecount(this.textArea.domNode.value.substr(0,this.textArea.domNode.selectionStart));this.textArea.domNode.scrollTop=o*this._lineHeight;return}this._doRender({lastRenderPosition:this._primaryCursorPosition,top:n,left:this._textAreaWrapping?this._contentLeft:t,width:this._textAreaWidth,height:o9?0:1,useCover:!1})}_newlinecount(e){let t=0,n=-1;do{if(n=e.indexOf(` +`,n+1),n===-1)break;t++}while(!0);return t}_renderAtTopLeft(){this._doRender({lastRenderPosition:null,top:0,left:0,width:this._textAreaWidth,height:o9?0:1,useCover:!0})}_doRender(e){this._lastRenderPosition=e.lastRenderPosition;const t=this.textArea,n=this.textAreaCover;ss(t,this._fontInfo),t.setTop(e.top),t.setLeft(e.left),t.setWidth(e.width),t.setHeight(e.height),t.setColor(e.color?ve.Format.CSS.formatHex(e.color):""),t.setFontStyle(e.italic?"italic":""),e.bold&&t.setFontWeight("bold"),t.setTextDecoration(`${e.underline?" underline":""}${e.strikethrough?" line-through":""}`),n.setTop(e.useCover?e.top:0),n.setLeft(e.useCover?e.left:0),n.setWidth(e.useCover?e.width:0),n.setHeight(e.useCover?e.height:0);const o=this._context.configuration.options;o.get(57)?n.setClassName("monaco-editor-background textAreaCover "+tb.OUTER_CLASS_NAME):o.get(67).renderType!==0?n.setClassName("monaco-editor-background textAreaCover "+JI.CLASS_NAME):n.setClassName("monaco-editor-background textAreaCover")}};bH=Zot([Qot(3,xi)],bH);function ert(i,e,t,n){if(e.length===0)return 0;const o=i.createElement("div");o.style.position="absolute",o.style.top="-50000px",o.style.width="50000px";const r=i.createElement("span");ss(r,t),r.style.whiteSpace="pre",r.style.tabSize=`${n*t.spaceWidth}px`,r.append(e),o.appendChild(r),i.body.appendChild(o);const s=r.offsetWidth;return i.body.removeChild(o),s}function trt(i,e,t){let n=0;for(let r=0;r!0,irt=()=>!1,ort=i=>i===" "||i===" ";class $1{static shouldRecreate(e){return e.hasChanged(143)||e.hasChanged(129)||e.hasChanged(37)||e.hasChanged(76)||e.hasChanged(78)||e.hasChanged(79)||e.hasChanged(6)||e.hasChanged(7)||e.hasChanged(11)||e.hasChanged(9)||e.hasChanged(10)||e.hasChanged(14)||e.hasChanged(127)||e.hasChanged(50)||e.hasChanged(90)}constructor(e,t,n,o){var r;this.languageConfigurationService=o,this._cursorMoveConfigurationBrand=void 0,this._languageId=e;const s=n.options,a=s.get(143),l=s.get(50);this.readOnly=s.get(90),this.tabSize=t.tabSize,this.indentSize=t.indentSize,this.insertSpaces=t.insertSpaces,this.stickyTabStops=s.get(115),this.lineHeight=l.lineHeight,this.typicalHalfwidthCharacterWidth=l.typicalHalfwidthCharacterWidth,this.pageSize=Math.max(1,Math.floor(a.height/this.lineHeight)-2),this.useTabStops=s.get(127),this.wordSeparators=s.get(129),this.emptySelectionClipboard=s.get(37),this.copyWithSyntaxHighlighting=s.get(25),this.multiCursorMergeOverlapping=s.get(76),this.multiCursorPaste=s.get(78),this.multiCursorLimit=s.get(79),this.autoClosingBrackets=s.get(6),this.autoClosingComments=s.get(7),this.autoClosingQuotes=s.get(11),this.autoClosingDelete=s.get(9),this.autoClosingOvertype=s.get(10),this.autoSurround=s.get(14),this.autoIndent=s.get(12),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 u=this.languageConfigurationService.getLanguageConfiguration(e).comments;this.blockCommentStartToken=(r=u==null?void 0:u.blockCommentStartToken)!==null&&r!==void 0?r:null}get electricChars(){var e;if(!this._electricChars){this._electricChars={};const t=(e=this.languageConfigurationService.getLanguageConfiguration(this._languageId).electricCharacter)===null||e===void 0?void 0:e.getElectricCharacters();if(t)for(const n of t)this._electricChars[n]=!0}return this._electricChars}onElectricCharacter(e,t,n){const o=o5(t,n-1),r=this.languageConfigurationService.getLanguageConfiguration(o.languageId).electricCharacter;return r?r.onElectricCharacter(e,o,n-o.firstCharOffset):null}normalizeIndentation(e){return uP(e,this.indentSize,this.insertSpaces)}_getShouldAutoClose(e,t,n){switch(t){case"beforeWhitespace":return ort;case"languageDefined":return this._getLanguageDefinedShouldAutoClose(e,n);case"always":return nrt;case"never":return irt}}_getLanguageDefinedShouldAutoClose(e,t){const n=this.languageConfigurationService.getLanguageConfiguration(e).getAutoCloseBeforeSet(t);return o=>n.indexOf(o)!==-1}visibleColumnFromColumn(e,t){return or.visibleColumnFromColumn(e.getLineContent(t.lineNumber),t.column,this.tabSize)}columnFromVisibleColumn(e,t,n){const o=or.columnFromVisibleColumn(e.getLineContent(t),n,this.tabSize),r=e.getLineMinColumn(t);if(os?s:o}}class kn{static fromModelState(e){return new rrt(e)}static fromViewState(e){return new srt(e)}static fromModelSelection(e){const t=gt.liftSelection(e),n=new Br(V.fromPositions(t.getSelectionStart()),0,0,t.getPosition(),0);return kn.fromModelState(n)}static fromModelSelections(e){const t=[];for(let n=0,o=e.length;nr,c=o>s,u=os||mo||v0&&o--,z_.columnSelect(e,t,n.fromViewLineNumber,n.fromViewVisualColumn,n.toViewLineNumber,o)}static columnSelectRight(e,t,n){let o=0;const r=Math.min(n.fromViewLineNumber,n.toViewLineNumber),s=Math.max(n.fromViewLineNumber,n.toViewLineNumber);for(let l=r;l<=s;l++){const c=t.getLineMaxColumn(l),u=e.visibleColumnFromColumn(t,new ae(l,c));o=Math.max(o,u)}let a=n.toViewVisualColumn;return ae.getLineMinColumn(t.lineNumber))return t.delta(void 0,-z_e(e.getLineContent(t.lineNumber),t.column-1));if(t.lineNumber>1){const n=t.lineNumber-1;return new ae(n,e.getLineMaxColumn(n))}else return t}static leftPositionAtomicSoftTabs(e,t,n){if(t.column<=e.getLineIndentColumn(t.lineNumber)){const o=e.getLineMinColumn(t.lineNumber),r=e.getLineContent(t.lineNumber),s=ZD.atomicPosition(r,t.column-1,n,0);if(s!==-1&&s+1>=o)return new ae(t.lineNumber,s+1)}return this.leftPosition(e,t)}static left(e,t,n){const o=e.stickyTabStops?ii.leftPositionAtomicSoftTabs(t,n,e.tabSize):ii.leftPosition(t,n);return new r9(o.lineNumber,o.column,0)}static moveLeft(e,t,n,o,r){let s,a;if(n.hasSelection()&&!o)s=n.selection.startLineNumber,a=n.selection.startColumn;else{const l=n.position.delta(void 0,-(r-1)),c=t.normalizePosition(ii.clipPositionColumn(l,t),0),u=ii.left(e,t,c);s=u.lineNumber,a=u.column}return n.move(o,s,a,0)}static clipPositionColumn(e,t){return new ae(e.lineNumber,ii.clipRange(e.column,t.getLineMinColumn(e.lineNumber),t.getLineMaxColumn(e.lineNumber)))}static clipRange(e,t,n){return en?n:e}static rightPosition(e,t,n){return nu?(n=u,a?o=t.getLineMaxColumn(n):o=Math.min(t.getLineMaxColumn(n),o)):o=e.columnFromVisibleColumn(t,n,c),f?r=0:r=c-or.visibleColumnFromColumn(t.getLineContent(n),o,e.tabSize),l!==void 0){const g=new ae(n,o),p=t.normalizePosition(g,l);r=r+(o-p.column),n=p.lineNumber,o=p.column}return new r9(n,o,r)}static down(e,t,n,o,r,s,a){return this.vertical(e,t,n,o,r,n+s,a,4)}static moveDown(e,t,n,o,r){let s,a;n.hasSelection()&&!o?(s=n.selection.endLineNumber,a=n.selection.endColumn):(s=n.position.lineNumber,a=n.position.column);let l=0,c;do if(c=ii.down(e,t,s+l,a,n.leftoverVisibleColumns,r,!0),t.normalizePosition(new ae(c.lineNumber,c.column),2).lineNumber>s)break;while(l++<10&&s+l1&&this._isBlankLine(t,r);)r--;for(;r>1&&!this._isBlankLine(t,r);)r--;return n.move(o,r,t.getLineMinColumn(r),0)}static moveToNextBlankLine(e,t,n,o){const r=t.getLineCount();let s=n.position.lineNumber;for(;s=h.length+1)return!1;const f=h.charAt(d.column-2),g=o.get(f);if(!g)return!1;if(Gp(f)){if(n==="never")return!1}else if(t==="never")return!1;const p=h.charAt(d.column-1);let v=!1;for(const m of g)m.open===f&&m.close===p&&(v=!0);if(!v)return!1;if(e==="auto"){let m=!1;for(let _=0,y=a.length;_1){const r=t.getLineContent(o.lineNumber),s=Ws(r),a=s===-1?r.length+1:s+1;if(o.column<=a){const l=n.visibleColumnFromColumn(t,o),c=or.prevIndentTabStop(l,n.indentSize),u=n.columnFromVisibleColumn(t,o.lineNumber,c);return new V(o.lineNumber,u,o.lineNumber,o.column)}}return V.fromPositions(nb.getPositionAfterDeleteLeft(o,t),o)}static getPositionAfterDeleteLeft(e,t){if(e.column>1){const n=CZe(e.column-1,t.getLineContent(e.lineNumber));return e.with(void 0,n+1)}else if(e.lineNumber>1){const n=e.lineNumber-1;return new ae(n,t.getLineMaxColumn(n))}else return e}static cut(e,t,n){const o=[];let r=null;n.sort((s,a)=>ae.compare(s.getStartPosition(),a.getEndPosition()));for(let s=0,a=n.length;s1&&(r==null?void 0:r.endLineNumber)!==c.lineNumber?(u=c.lineNumber-1,d=t.getLineMaxColumn(c.lineNumber-1),h=c.lineNumber,f=t.getLineMaxColumn(c.lineNumber)):(u=c.lineNumber,d=1,h=c.lineNumber,f=t.getLineMaxColumn(c.lineNumber));const g=new V(u,d,h,f);r=g,g.isEmpty()?o[s]=null:o[s]=new Qr(g,"")}else o[s]=null;else o[s]=new Qr(l,"")}return new Sa(0,o,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!0})}}class Qn{static _createWord(e,t,n,o,r){return{start:o,end:r,wordType:t,nextCharClass:n}}static _findPreviousWordOnLine(e,t,n){const o=t.getLineContent(n.lineNumber);return this._doFindPreviousWordOnLine(o,e,n)}static _doFindPreviousWordOnLine(e,t,n){let o=0;for(let r=n.column-2;r>=0;r--){const s=e.charCodeAt(r),a=t.get(s);if(a===0){if(o===2)return this._createWord(e,o,a,r+1,this._findEndOfWord(e,t,o,r+1));o=1}else if(a===2){if(o===1)return this._createWord(e,o,a,r+1,this._findEndOfWord(e,t,o,r+1));o=2}else if(a===1&&o!==0)return this._createWord(e,o,a,r+1,this._findEndOfWord(e,t,o,r+1))}return o!==0?this._createWord(e,o,1,0,this._findEndOfWord(e,t,o,0)):null}static _findEndOfWord(e,t,n,o){const r=e.length;for(let s=o;s=0;r--){const s=e.charCodeAt(r),a=t.get(s);if(a===1||n===1&&a===2||n===2&&a===0)return r+1}return 0}static moveWordLeft(e,t,n,o){let r=n.lineNumber,s=n.column;s===1&&r>1&&(r=r-1,s=t.getLineMaxColumn(r));let a=Qn._findPreviousWordOnLine(e,t,new ae(r,s));if(o===0)return new ae(r,a?a.start+1:1);if(o===1)return a&&a.wordType===2&&a.end-a.start===1&&a.nextCharClass===0&&(a=Qn._findPreviousWordOnLine(e,t,new ae(r,a.start+1))),new ae(r,a?a.start+1:1);if(o===3){for(;a&&a.wordType===2;)a=Qn._findPreviousWordOnLine(e,t,new ae(r,a.start+1));return new ae(r,a?a.start+1:1)}return a&&s<=a.end+1&&(a=Qn._findPreviousWordOnLine(e,t,new ae(r,a.start+1))),new ae(r,a?a.end+1:1)}static _moveWordPartLeft(e,t){const n=t.lineNumber,o=e.getLineMaxColumn(n);if(t.column===1)return n>1?new ae(n-1,e.getLineMaxColumn(n-1)):t;const r=e.getLineContent(n);for(let s=t.column-1;s>1;s--){const a=r.charCodeAt(s-2),l=r.charCodeAt(s-1);if(a===95&&l!==95)return new ae(n,s);if(a===45&&l!==45)return new ae(n,s);if((Cm(a)||n2(a))&&kh(l))return new ae(n,s);if(kh(a)&&kh(l)&&s+1=l.start+1&&(l=Qn._findNextWordOnLine(e,t,new ae(r,l.end+1))),l?s=l.start+1:s=t.getLineMaxColumn(r);return new ae(r,s)}static _moveWordPartRight(e,t){const n=t.lineNumber,o=e.getLineMaxColumn(n);if(t.column===o)return n1?c=1:(l--,c=o.getLineMaxColumn(l)):(u&&c<=u.end+1&&(u=Qn._findPreviousWordOnLine(n,o,new ae(l,u.start+1))),u?c=u.end+1:c>1?c=1:(l--,c=o.getLineMaxColumn(l))),new V(l,c,a.lineNumber,a.column)}static deleteInsideWord(e,t,n){if(!n.isEmpty())return n;const o=new ae(n.positionLineNumber,n.positionColumn),r=this._deleteInsideWordWhitespace(t,o);return r||this._deleteInsideWordDetermineDeleteRange(e,t,o)}static _charAtIsWhitespace(e,t){const n=e.charCodeAt(t);return n===32||n===9}static _deleteInsideWordWhitespace(e,t){const n=e.getLineContent(t.lineNumber),o=n.length;if(o===0)return null;let r=Math.max(t.column-2,0);if(!this._charAtIsWhitespace(n,r))return null;let s=Math.min(t.column-1,o-1);if(!this._charAtIsWhitespace(n,s))return null;for(;r>0&&this._charAtIsWhitespace(n,r-1);)r--;for(;s+11?new V(n.lineNumber-1,t.getLineMaxColumn(n.lineNumber-1),n.lineNumber,1):n.lineNumberd.start+1<=n.column&&n.column<=d.end+1,a=(d,h)=>(d=Math.min(d,n.column),h=Math.max(h,n.column),new V(n.lineNumber,d,n.lineNumber,h)),l=d=>{let h=d.start+1,f=d.end+1,g=!1;for(;f-11&&this._charAtIsWhitespace(o,h-2);)h--;return a(h,f)},c=Qn._findPreviousWordOnLine(e,t,n);if(c&&s(c))return l(c);const u=Qn._findNextWordOnLine(e,t,n);return u&&s(u)?l(u):c&&u?a(c.end+1,u.start+1):c?a(c.start+1,c.end+1):u?a(u.start+1,u.end+1):a(1,r+1)}static _deleteWordPartLeft(e,t){if(!t.isEmpty())return t;const n=t.getPosition(),o=Qn._moveWordPartLeft(e,n);return new V(n.lineNumber,n.column,o.lineNumber,o.column)}static _findFirstNonWhitespaceChar(e,t){const n=e.length;for(let o=t;o=h.start+1&&(h=Qn._findNextWordOnLine(n,o,new ae(l,h.end+1))),h?c=h.start+1:cBoolean(e))}class Mr{static addCursorDown(e,t,n){const o=[];let r=0;for(let s=0,a=t.length;sc&&(u=c,d=e.model.getLineMaxColumn(u)),kn.fromModelState(new Br(new V(s.lineNumber,1,u,d),2,0,new ae(u,d),0))}const l=t.modelState.selectionStart.getStartPosition().lineNumber;if(s.lineNumberl){const c=e.getLineCount();let u=a.lineNumber+1,d=1;return u>c&&(u=c,d=e.getLineMaxColumn(u)),kn.fromViewState(t.viewState.move(!0,u,d,0))}else{const c=t.modelState.selectionStart.getEndPosition();return kn.fromModelState(t.modelState.move(!0,c.lineNumber,c.column,0))}}static word(e,t,n,o){const r=e.model.validatePosition(o);return kn.fromModelState(Qn.word(e.cursorConfig,e.model,t.modelState,n,r))}static cancelSelection(e,t){if(!t.modelState.hasSelection())return new kn(t.modelState,t.viewState);const n=t.viewState.position.lineNumber,o=t.viewState.position.column;return kn.fromViewState(new Br(new V(n,o,n,o),0,0,new ae(n,o),0))}static moveTo(e,t,n,o,r){if(n){if(t.modelState.selectionStartKind===1)return this.word(e,t,n,o);if(t.modelState.selectionStartKind===2)return this.line(e,t,n,o,r)}const s=e.model.validatePosition(o),a=r?e.coordinatesConverter.validateViewPosition(new ae(r.lineNumber,r.column),s):e.coordinatesConverter.convertModelPositionToViewPosition(s);return kn.fromViewState(t.viewState.move(n,a.lineNumber,a.column,0))}static simpleMove(e,t,n,o,r,s){switch(n){case 0:return s===4?this._moveHalfLineLeft(e,t,o):this._moveLeft(e,t,o,r);case 1:return s===4?this._moveHalfLineRight(e,t,o):this._moveRight(e,t,o,r);case 2:return s===2?this._moveUpByViewLines(e,t,o,r):this._moveUpByModelLines(e,t,o,r);case 3:return s===2?this._moveDownByViewLines(e,t,o,r):this._moveDownByModelLines(e,t,o,r);case 4:return s===2?t.map(a=>kn.fromViewState(ii.moveToPrevBlankLine(e.cursorConfig,e,a.viewState,o))):t.map(a=>kn.fromModelState(ii.moveToPrevBlankLine(e.cursorConfig,e.model,a.modelState,o)));case 5:return s===2?t.map(a=>kn.fromViewState(ii.moveToNextBlankLine(e.cursorConfig,e,a.viewState,o))):t.map(a=>kn.fromModelState(ii.moveToNextBlankLine(e.cursorConfig,e.model,a.modelState,o)));case 6:return this._moveToViewMinColumn(e,t,o);case 7:return this._moveToViewFirstNonWhitespaceColumn(e,t,o);case 8:return this._moveToViewCenterColumn(e,t,o);case 9:return this._moveToViewMaxColumn(e,t,o);case 10:return this._moveToViewLastNonWhitespaceColumn(e,t,o);default:return null}}static viewportMove(e,t,n,o,r){const s=e.getCompletelyVisibleViewRange(),a=e.coordinatesConverter.convertViewRangeToModelRange(s);switch(n){case 11:{const l=this._firstLineNumberInRange(e.model,a,r),c=e.model.getLineFirstNonWhitespaceColumn(l);return[this._moveToModelPosition(e,t[0],o,l,c)]}case 13:{const l=this._lastLineNumberInRange(e.model,a,r),c=e.model.getLineFirstNonWhitespaceColumn(l);return[this._moveToModelPosition(e,t[0],o,l,c)]}case 12:{const l=Math.round((a.startLineNumber+a.endLineNumber)/2),c=e.model.getLineFirstNonWhitespaceColumn(l);return[this._moveToModelPosition(e,t[0],o,l,c)]}case 14:{const l=[];for(let c=0,u=t.length;cn.endLineNumber-1?s=n.endLineNumber-1:rkn.fromViewState(ii.moveLeft(e.cursorConfig,e,r.viewState,n,o)))}static _moveHalfLineLeft(e,t,n){const o=[];for(let r=0,s=t.length;rkn.fromViewState(ii.moveRight(e.cursorConfig,e,r.viewState,n,o)))}static _moveHalfLineRight(e,t,n){const o=[];for(let r=0,s=t.length;r1&&o.firstCharOffset===0){const p=_w(e,t.startLineNumber-1);p.languageId===o.languageId&&(c=p.getLineContent())}const u=r.onEnter(i,c,a,l);if(!u)return null;const d=u.indentAction;let h=u.appendText;const f=u.removeText||0;h?d===Ho.Indent&&(h=" "+h):d===Ho.Indent||d===Ho.IndentOutdent?h=" ":h="";let g=I0e(e,t.startLineNumber,t.startColumn);return f&&(g=g.substring(0,g.length-f)),{indentAction:d,appendText:h,removeText:f,indentation:g}}var nrt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},irt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},lM;const s9=Object.create(null);function m_(i,e){if(e<=0)return"";s9[i]||(s9[i]=["",i]);const t=s9[i];for(let n=t.length;n<=e;n++)t[n]=t[n-1]+i;return t[e]}let Lc=lM=class{static unshiftIndent(e,t,n,o,r){const s=or.visibleColumnFromColumn(e,t,n);if(r){const a=m_(" ",o),c=or.prevIndentTabStop(s,o)/o;return m_(a,c)}else{const a=" ",c=or.prevRenderTabStop(s,n)/n;return m_(a,c)}}static shiftIndent(e,t,n,o,r){const s=or.visibleColumnFromColumn(e,t,n);if(r){const a=m_(" ",o),c=or.nextIndentTabStop(s,o)/o;return m_(a,c)}else{const a=" ",c=or.nextRenderTabStop(s,n)/n;return m_(a,c)}}constructor(e,t,n){this._languageConfigurationService=n,this._opts=t,this._selection=e,this._selectionId=null,this._useLastEditRangeForCursorEndPosition=!1,this._selectionStartColumnStaysPut=!1}_addEditOperation(e,t,n){this._useLastEditRangeForCursorEndPosition?e.addTrackedEditOperation(t,n):e.addEditOperation(t,n)}getEditOperations(e,t){const n=this._selection.startLineNumber;let o=this._selection.endLineNumber;this._selection.endColumn===1&&n!==o&&(o=o-1);const{tabSize:r,indentSize:s,insertSpaces:a}=this._opts,l=n===o;if(this._opts.useTabStops){this._selection.isEmpty()&&/^\s*$/.test(e.getLineContent(n))&&(this._useLastEditRangeForCursorEndPosition=!0);let c=0,u=0;for(let d=n;d<=o;d++,c=u){u=0;const h=e.getLineContent(d);let f=Ws(h);if(this._opts.isUnshift&&(h.length===0||f===0)||!l&&!this._opts.isUnshift&&h.length===0)continue;if(f===-1&&(f=h.length),d>1&&or.visibleColumnFromColumn(h,f+1,r)%s!==0&&e.tokenization.isCheapToTokenize(d-1)){const v=Lw(this._opts.autoIndent,e,new V(d-1,e.getLineMaxColumn(d-1),d-1,e.getLineMaxColumn(d-1)),this._languageConfigurationService);if(v){if(u=c,v.appendText)for(let m=0,_=v.appendText.length;m<_&&u1){let o,r=-1;for(o=e-1;o>=1;o--){if(i.tokenization.getLanguageIdAtPosition(o,0)!==n)return r;const s=i.getLineContent(o);if(t.shouldIgnore(s)||/^\s+$/.test(s)||s===""){r=o;continue}return o}}return-1}function _5(i,e,t,n=!0,o){if(i<4)return null;const r=o.getLanguageConfiguration(e.tokenization.getLanguageId()).indentRulesSupport;if(!r)return null;if(t<=1)return{indentation:"",action:null};for(let l=t-1;l>0&&e.getLineContent(l)==="";l--)if(l===1)return{indentation:"",action:null};const s=srt(e,t,r);if(s<0)return null;if(s<1)return{indentation:"",action:null};const a=e.getLineContent(s);if(r.shouldIncrease(a)||r.shouldIndentNextLine(a))return{indentation:Si(a),action:Ho.Indent,line:s};if(r.shouldDecrease(a))return{indentation:Si(a),action:null,line:s};{if(s===1)return{indentation:Si(e.getLineContent(s)),action:null,line:s};const l=s-1,c=r.getIndentMetadata(e.getLineContent(l));if(!(c&3)&&c&4){let u=0;for(let d=l-1;d>0;d--)if(!r.shouldIndentNextLine(e.getLineContent(d))){u=d;break}return{indentation:Si(e.getLineContent(u+1)),action:null,line:u+1}}if(n)return{indentation:Si(e.getLineContent(s)),action:null,line:s};for(let u=s;u>0;u--){const d=e.getLineContent(u);if(r.shouldIncrease(d))return{indentation:Si(d),action:Ho.Indent,line:u};if(r.shouldIndentNextLine(d)){let h=0;for(let f=u-1;f>0;f--)if(!r.shouldIndentNextLine(e.getLineContent(u))){h=f;break}return{indentation:Si(e.getLineContent(h+1)),action:null,line:h+1}}else if(r.shouldDecrease(d))return{indentation:Si(d),action:null,line:u}}return{indentation:Si(e.getLineContent(1)),action:null,line:1}}}function hE(i,e,t,n,o,r){if(i<4)return null;const s=r.getLanguageConfiguration(t);if(!s)return null;const a=r.getLanguageConfiguration(t).indentRulesSupport;if(!a)return null;const l=_5(i,e,n,void 0,r),c=e.getLineContent(n);if(l){const u=l.line;if(u!==void 0){let d=!0;for(let h=u;h0&&r.getLanguageId(0)!==s.languageId?(l=!0,c=a.substr(0,t.startColumn-1-s.firstCharOffset)):c=r.getLineContent().substring(0,t.startColumn-1);let u;t.isEmpty()?u=a.substr(t.startColumn-1-s.firstCharOffset):u=_w(e,t.endLineNumber,t.endColumn).getLineContent().substr(t.endColumn-1-s.firstCharOffset);const d=o.getLanguageConfiguration(s.languageId).indentRulesSupport;if(!d)return null;const h=c,f=Si(c),g={tokenization:{getLineTokens:_=>e.tokenization.getLineTokens(_),getLanguageId:()=>e.getLanguageId(),getLanguageIdAtPosition:(_,w)=>e.getLanguageIdAtPosition(_,w)},getLineContent:_=>_===t.startLineNumber?h:e.getLineContent(_)},p=Si(r.getLineContent()),v=_5(i,g,t.startLineNumber+1,void 0,o);if(!v){const _=l?p:f;return{beforeEnter:_,afterEnter:_}}let m=l?p:v.indentation;return v.action===Ho.Indent&&(m=n.shiftIndent(m)),d.shouldDecrease(u)&&(m=n.unshiftIndent(m)),{beforeEnter:l?p:f,afterEnter:m}}function lrt(i,e,t,n,o,r){if(i<4)return null;const s=_w(e,t.startLineNumber,t.startColumn);if(s.firstCharOffset)return null;const a=r.getLanguageConfiguration(s.languageId).indentRulesSupport;if(!a)return null;const l=s.getLineContent(),c=l.substr(0,t.startColumn-1-s.firstCharOffset);let u;if(t.isEmpty()?u=l.substr(t.startColumn-1-s.firstCharOffset):u=_w(e,t.endLineNumber,t.endColumn).getLineContent().substr(t.endColumn-1-s.firstCharOffset),!a.shouldDecrease(c+u)&&a.shouldDecrease(c+n+u)){const d=_5(i,e,t.startLineNumber,!1,r);if(!d)return null;let h=d.indentation;return d.action!==Ho.Indent&&(h=o.unshiftIndent(h)),h}return null}function wbe(i,e,t){const n=t.getLanguageConfiguration(i.getLanguageId()).indentRulesSupport;return!n||e<1||e>i.getLineCount()?null:n.getIndentMetadata(i.getLineContent(e))}class eo{static indent(e,t,n){if(t===null||n===null)return[];const o=[];for(let r=0,s=n.length;r1){let a;for(a=n-1;a>=1;a--){const u=t.getLineContent(a);if(Wd(u)>=0)break}if(a<1)return null;const l=t.getLineMaxColumn(a),c=Lw(e.autoIndent,t,new V(a,l,a,l),e.languageConfigurationService);c&&(r=c.indentation+c.appendText)}return o&&(o===Ho.Indent&&(r=eo.shiftIndent(e,r)),o===Ho.Outdent&&(r=eo.unshiftIndent(e,r)),r=e.normalizeIndentation(r)),r||null}static _replaceJumpToNextIndent(e,t,n,o){let r="";const s=n.getStartPosition();if(e.insertSpaces){const a=e.visibleColumnFromColumn(t,s),l=e.indentSize,c=l-a%l;for(let u=0;uthis._compositionType(n,u,r,s,a,l));return new ya(4,c,{shouldPushStackElementBefore:g2(e,4),shouldPushStackElementAfter:!1})}static _compositionType(e,t,n,o,r,s){if(!t.isEmpty())return null;const a=t.getPosition(),l=Math.max(1,a.column-o),c=Math.min(e.getLineMaxColumn(a.lineNumber),a.column+r),u=new V(a.lineNumber,l,a.lineNumber,c);return e.getValueInRange(u)===n&&s===0?null:new aM(u,n,0,s)}static _typeCommand(e,t,n){return n?new h2(e,t,!0):new Qr(e,t,!0)}static _enter(e,t,n,o){if(e.autoIndent===0)return eo._typeCommand(o,` + `,constraint:e,schema:{type:"object",required:["to"],properties:{to:{type:"string",enum:["left","right","up","down","prevBlankLine","nextBlankLine","wrappedLineStart","wrappedLineEnd","wrappedLineColumnCenter","wrappedLineFirstNonWhitespaceCharacter","wrappedLineLastNonWhitespaceCharacter","viewPortTop","viewPortCenter","viewPortBottom","viewPortIfOutside"]},by:{type:"string",enum:["line","wrappedLine","character","halfLine"]},value:{type:"number",default:1},select:{type:"boolean",default:!1}}}}]},i.RawDirection={Left:"left",Right:"right",Up:"up",Down:"down",PrevBlankLine:"prevBlankLine",NextBlankLine:"nextBlankLine",WrappedLineStart:"wrappedLineStart",WrappedLineFirstNonWhitespaceCharacter:"wrappedLineFirstNonWhitespaceCharacter",WrappedLineColumnCenter:"wrappedLineColumnCenter",WrappedLineEnd:"wrappedLineEnd",WrappedLineLastNonWhitespaceCharacter:"wrappedLineLastNonWhitespaceCharacter",ViewPortTop:"viewPortTop",ViewPortCenter:"viewPortCenter",ViewPortBottom:"viewPortBottom",ViewPortIfOutside:"viewPortIfOutside"},i.RawUnit={Line:"line",WrappedLine:"wrappedLine",Character:"character",HalfLine:"halfLine"};function t(n){if(!n.to)return null;let o;switch(n.to){case i.RawDirection.Left:o=0;break;case i.RawDirection.Right:o=1;break;case i.RawDirection.Up:o=2;break;case i.RawDirection.Down:o=3;break;case i.RawDirection.PrevBlankLine:o=4;break;case i.RawDirection.NextBlankLine:o=5;break;case i.RawDirection.WrappedLineStart:o=6;break;case i.RawDirection.WrappedLineFirstNonWhitespaceCharacter:o=7;break;case i.RawDirection.WrappedLineColumnCenter:o=8;break;case i.RawDirection.WrappedLineEnd:o=9;break;case i.RawDirection.WrappedLineLastNonWhitespaceCharacter:o=10;break;case i.RawDirection.ViewPortTop:o=11;break;case i.RawDirection.ViewPortBottom:o=13;break;case i.RawDirection.ViewPortCenter:o=12;break;case i.RawDirection.ViewPortIfOutside:o=14;break;default:return null}let r=0;switch(n.by){case i.RawUnit.Line:r=1;break;case i.RawUnit.WrappedLine:r=2;break;case i.RawUnit.Character:r=3;break;case i.RawUnit.HalfLine:r=4;break}return{direction:o,unit:r,select:!!n.select,value:n.value||1}}i.parse=t})(dP||(dP={}));function Ly(i,e,t,n){const o=_y(e,t.startLineNumber,t.startColumn),r=n.getLanguageConfiguration(o.languageId);if(!r)return null;const s=o.getLineContent(),a=s.substr(0,t.startColumn-1-o.firstCharOffset);let l;t.isEmpty()?l=s.substr(t.startColumn-1-o.firstCharOffset):l=_y(e,t.endLineNumber,t.endColumn).getLineContent().substr(t.endColumn-1-o.firstCharOffset);let c="";if(t.startLineNumber>1&&o.firstCharOffset===0){const p=_y(e,t.startLineNumber-1);p.languageId===o.languageId&&(c=p.getLineContent())}const u=r.onEnter(i,c,a,l);if(!u)return null;const d=u.indentAction;let h=u.appendText;const f=u.removeText||0;h?d===Ho.Indent&&(h=" "+h):d===Ho.Indent||d===Ho.IndentOutdent?h=" ":h="";let g=F0e(e,t.startLineNumber,t.startColumn);return f&&(g=g.substring(0,g.length-f)),{indentAction:d,appendText:h,removeText:f,indentation:g}}var lrt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},crt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},dM;const s9=Object.create(null);function m_(i,e){if(e<=0)return"";s9[i]||(s9[i]=["",i]);const t=s9[i];for(let n=t.length;n<=e;n++)t[n]=t[n-1]+i;return t[e]}let Ec=dM=class{static unshiftIndent(e,t,n,o,r){const s=or.visibleColumnFromColumn(e,t,n);if(r){const a=m_(" ",o),c=or.prevIndentTabStop(s,o)/o;return m_(a,c)}else{const a=" ",c=or.prevRenderTabStop(s,n)/n;return m_(a,c)}}static shiftIndent(e,t,n,o,r){const s=or.visibleColumnFromColumn(e,t,n);if(r){const a=m_(" ",o),c=or.nextIndentTabStop(s,o)/o;return m_(a,c)}else{const a=" ",c=or.nextRenderTabStop(s,n)/n;return m_(a,c)}}constructor(e,t,n){this._languageConfigurationService=n,this._opts=t,this._selection=e,this._selectionId=null,this._useLastEditRangeForCursorEndPosition=!1,this._selectionStartColumnStaysPut=!1}_addEditOperation(e,t,n){this._useLastEditRangeForCursorEndPosition?e.addTrackedEditOperation(t,n):e.addEditOperation(t,n)}getEditOperations(e,t){const n=this._selection.startLineNumber;let o=this._selection.endLineNumber;this._selection.endColumn===1&&n!==o&&(o=o-1);const{tabSize:r,indentSize:s,insertSpaces:a}=this._opts,l=n===o;if(this._opts.useTabStops){this._selection.isEmpty()&&/^\s*$/.test(e.getLineContent(n))&&(this._useLastEditRangeForCursorEndPosition=!0);let c=0,u=0;for(let d=n;d<=o;d++,c=u){u=0;const h=e.getLineContent(d);let f=Ws(h);if(this._opts.isUnshift&&(h.length===0||f===0)||!l&&!this._opts.isUnshift&&h.length===0)continue;if(f===-1&&(f=h.length),d>1&&or.visibleColumnFromColumn(h,f+1,r)%s!==0&&e.tokenization.isCheapToTokenize(d-1)){const v=Ly(this._opts.autoIndent,e,new V(d-1,e.getLineMaxColumn(d-1),d-1,e.getLineMaxColumn(d-1)),this._languageConfigurationService);if(v){if(u=c,v.appendText)for(let m=0,_=v.appendText.length;m<_&&u1){let o,r=-1;for(o=e-1;o>=1;o--){if(i.tokenization.getLanguageIdAtPosition(o,0)!==n)return r;const s=i.getLineContent(o);if(t.shouldIgnore(s)||/^\s+$/.test(s)||s===""){r=o;continue}return o}}return-1}function b5(i,e,t,n=!0,o){if(i<4)return null;const r=o.getLanguageConfiguration(e.tokenization.getLanguageId()).indentRulesSupport;if(!r)return null;if(t<=1)return{indentation:"",action:null};for(let l=t-1;l>0&&e.getLineContent(l)==="";l--)if(l===1)return{indentation:"",action:null};const s=hrt(e,t,r);if(s<0)return null;if(s<1)return{indentation:"",action:null};const a=e.getLineContent(s);if(r.shouldIncrease(a)||r.shouldIndentNextLine(a))return{indentation:Si(a),action:Ho.Indent,line:s};if(r.shouldDecrease(a))return{indentation:Si(a),action:null,line:s};{if(s===1)return{indentation:Si(e.getLineContent(s)),action:null,line:s};const l=s-1,c=r.getIndentMetadata(e.getLineContent(l));if(!(c&3)&&c&4){let u=0;for(let d=l-1;d>0;d--)if(!r.shouldIndentNextLine(e.getLineContent(d))){u=d;break}return{indentation:Si(e.getLineContent(u+1)),action:null,line:u+1}}if(n)return{indentation:Si(e.getLineContent(s)),action:null,line:s};for(let u=s;u>0;u--){const d=e.getLineContent(u);if(r.shouldIncrease(d))return{indentation:Si(d),action:Ho.Indent,line:u};if(r.shouldIndentNextLine(d)){let h=0;for(let f=u-1;f>0;f--)if(!r.shouldIndentNextLine(e.getLineContent(u))){h=f;break}return{indentation:Si(e.getLineContent(h+1)),action:null,line:h+1}}else if(r.shouldDecrease(d))return{indentation:Si(d),action:null,line:u}}return{indentation:Si(e.getLineContent(1)),action:null,line:1}}}function fE(i,e,t,n,o,r){if(i<4)return null;const s=r.getLanguageConfiguration(t);if(!s)return null;const a=r.getLanguageConfiguration(t).indentRulesSupport;if(!a)return null;const l=b5(i,e,n,void 0,r),c=e.getLineContent(n);if(l){const u=l.line;if(u!==void 0){let d=!0;for(let h=u;h0&&r.getLanguageId(0)!==s.languageId?(l=!0,c=a.substr(0,t.startColumn-1-s.firstCharOffset)):c=r.getLineContent().substring(0,t.startColumn-1);let u;t.isEmpty()?u=a.substr(t.startColumn-1-s.firstCharOffset):u=_y(e,t.endLineNumber,t.endColumn).getLineContent().substr(t.endColumn-1-s.firstCharOffset);const d=o.getLanguageConfiguration(s.languageId).indentRulesSupport;if(!d)return null;const h=c,f=Si(c),g={tokenization:{getLineTokens:_=>e.tokenization.getLineTokens(_),getLanguageId:()=>e.getLanguageId(),getLanguageIdAtPosition:(_,y)=>e.getLanguageIdAtPosition(_,y)},getLineContent:_=>_===t.startLineNumber?h:e.getLineContent(_)},p=Si(r.getLineContent()),v=b5(i,g,t.startLineNumber+1,void 0,o);if(!v){const _=l?p:f;return{beforeEnter:_,afterEnter:_}}let m=l?p:v.indentation;return v.action===Ho.Indent&&(m=n.shiftIndent(m)),d.shouldDecrease(u)&&(m=n.unshiftIndent(m)),{beforeEnter:l?p:f,afterEnter:m}}function grt(i,e,t,n,o,r){if(i<4)return null;const s=_y(e,t.startLineNumber,t.startColumn);if(s.firstCharOffset)return null;const a=r.getLanguageConfiguration(s.languageId).indentRulesSupport;if(!a)return null;const l=s.getLineContent(),c=l.substr(0,t.startColumn-1-s.firstCharOffset);let u;if(t.isEmpty()?u=l.substr(t.startColumn-1-s.firstCharOffset):u=_y(e,t.endLineNumber,t.endColumn).getLineContent().substr(t.endColumn-1-s.firstCharOffset),!a.shouldDecrease(c+u)&&a.shouldDecrease(c+n+u)){const d=b5(i,e,t.startLineNumber,!1,r);if(!d)return null;let h=d.indentation;return d.action!==Ho.Indent&&(h=o.unshiftIndent(h)),h}return null}function Ibe(i,e,t){const n=t.getLanguageConfiguration(i.getLanguageId()).indentRulesSupport;return!n||e<1||e>i.getLineCount()?null:n.getIndentMetadata(i.getLineContent(e))}class eo{static indent(e,t,n){if(t===null||n===null)return[];const o=[];for(let r=0,s=n.length;r1){let a;for(a=n-1;a>=1;a--){const u=t.getLineContent(a);if(Wd(u)>=0)break}if(a<1)return null;const l=t.getLineMaxColumn(a),c=Ly(e.autoIndent,t,new V(a,l,a,l),e.languageConfigurationService);c&&(r=c.indentation+c.appendText)}return o&&(o===Ho.Indent&&(r=eo.shiftIndent(e,r)),o===Ho.Outdent&&(r=eo.unshiftIndent(e,r)),r=e.normalizeIndentation(r)),r||null}static _replaceJumpToNextIndent(e,t,n,o){let r="";const s=n.getStartPosition();if(e.insertSpaces){const a=e.visibleColumnFromColumn(t,s),l=e.indentSize,c=l-a%l;for(let u=0;uthis._compositionType(n,u,r,s,a,l));return new Sa(4,c,{shouldPushStackElementBefore:v2(e,4),shouldPushStackElementAfter:!1})}static _compositionType(e,t,n,o,r,s){if(!t.isEmpty())return null;const a=t.getPosition(),l=Math.max(1,a.column-o),c=Math.min(e.getLineMaxColumn(a.lineNumber),a.column+r),u=new V(a.lineNumber,l,a.lineNumber,c);return e.getValueInRange(u)===n&&s===0?null:new uM(u,n,0,s)}static _typeCommand(e,t,n){return n?new p2(e,t,!0):new Qr(e,t,!0)}static _enter(e,t,n,o){if(e.autoIndent===0)return eo._typeCommand(o,` `,n);if(!t.tokenization.isCheapToTokenize(o.getStartPosition().lineNumber)||e.autoIndent===1){const l=t.getLineContent(o.startLineNumber),c=Si(l).substring(0,o.startColumn-1);return eo._typeCommand(o,` -`+e.normalizeIndentation(c),n)}const r=Lw(e.autoIndent,t,o,e.languageConfigurationService);if(r){if(r.indentAction===Ho.None)return eo._typeCommand(o,` +`+e.normalizeIndentation(c),n)}const r=Ly(e.autoIndent,t,o,e.languageConfigurationService);if(r){if(r.indentAction===Ho.None)return eo._typeCommand(o,` `+e.normalizeIndentation(r.indentation+r.appendText),n);if(r.indentAction===Ho.Indent)return eo._typeCommand(o,` `+e.normalizeIndentation(r.indentation+r.appendText),n);if(r.indentAction===Ho.IndentOutdent){const l=e.normalizeIndentation(r.indentation),c=e.normalizeIndentation(r.indentation+r.appendText),u=` `+c+` -`+l;return n?new h2(o,u,!0):new aM(o,u,-1,c.length-l.length,!0)}else if(r.indentAction===Ho.Outdent){const l=eo.unshiftIndent(e,r.indentation);return eo._typeCommand(o,` -`+e.normalizeIndentation(l+r.appendText),n)}}const s=t.getLineContent(o.startLineNumber),a=Si(s).substring(0,o.startColumn-1);if(e.autoIndent>=4){const l=art(e.autoIndent,t,o,{unshiftIndent:c=>eo.unshiftIndent(e,c),shiftIndent:c=>eo.shiftIndent(e,c),normalizeIndentation:c=>e.normalizeIndentation(c)},e.languageConfigurationService);if(l){let c=e.visibleColumnFromColumn(t,o.getEndPosition());const u=o.endColumn,d=t.getLineContent(o.endLineNumber),h=Ws(d);if(h>=0?o=o.setEndPosition(o.endLineNumber,Math.max(o.endColumn,h+1)):o=o.setEndPosition(o.endLineNumber,t.getLineMaxColumn(o.endLineNumber)),n)return new h2(o,` -`+e.normalizeIndentation(l.afterEnter),!0);{let f=0;return u<=h+1&&(e.insertSpaces||(c=Math.ceil(c/e.indentSize)),f=Math.min(c+1-e.normalizeIndentation(l.afterEnter).length-1,0)),new aM(o,` +`+l;return n?new p2(o,u,!0):new uM(o,u,-1,c.length-l.length,!0)}else if(r.indentAction===Ho.Outdent){const l=eo.unshiftIndent(e,r.indentation);return eo._typeCommand(o,` +`+e.normalizeIndentation(l+r.appendText),n)}}const s=t.getLineContent(o.startLineNumber),a=Si(s).substring(0,o.startColumn-1);if(e.autoIndent>=4){const l=frt(e.autoIndent,t,o,{unshiftIndent:c=>eo.unshiftIndent(e,c),shiftIndent:c=>eo.shiftIndent(e,c),normalizeIndentation:c=>e.normalizeIndentation(c)},e.languageConfigurationService);if(l){let c=e.visibleColumnFromColumn(t,o.getEndPosition());const u=o.endColumn,d=t.getLineContent(o.endLineNumber),h=Ws(d);if(h>=0?o=o.setEndPosition(o.endLineNumber,Math.max(o.endColumn,h+1)):o=o.setEndPosition(o.endLineNumber,t.getLineMaxColumn(o.endLineNumber)),n)return new p2(o,` +`+e.normalizeIndentation(l.afterEnter),!0);{let f=0;return u<=h+1&&(e.insertSpaces||(c=Math.ceil(c/e.indentSize)),f=Math.min(c+1-e.normalizeIndentation(l.afterEnter).length-1,0)),new uM(o,` `+e.normalizeIndentation(l.afterEnter),0,f,!0)}}}return eo._typeCommand(o,` -`+e.normalizeIndentation(a),n)}static _isAutoIndentType(e,t,n){if(e.autoIndent<4)return!1;for(let o=0,r=n.length;oeo.shiftIndent(e,a),unshiftIndent:a=>eo.unshiftIndent(e,a)},e.languageConfigurationService);if(s===null)return null;if(s!==e.normalizeIndentation(r)){const a=t.getLineFirstNonWhitespaceColumn(n.startLineNumber);return a===0?eo._typeCommand(new V(n.startLineNumber,1,n.endLineNumber,n.endColumn),e.normalizeIndentation(s)+o,!1):eo._typeCommand(new V(n.startLineNumber,1,n.endLineNumber,n.endColumn),e.normalizeIndentation(s)+t.getLineContent(n.startLineNumber).substring(a-1,n.startColumn-1)+o,!1)}return null}static _isAutoClosingOvertype(e,t,n,o,r){if(e.autoClosingOvertype==="never"||!e.autoClosingPairs.autoClosingPairsCloseSingleChar.has(r))return!1;for(let s=0,a=n.length;s2?u.charCodeAt(c.column-2):0)===92&&h)return!1;if(e.autoClosingOvertype==="auto"){let g=!1;for(let p=0,v=o.length;pt.startsWith(l.open)),a=r.some(l=>t.startsWith(l.close));return!s&&a}static _findAutoClosingPairOpen(e,t,n,o){const r=e.autoClosingPairs.autoClosingPairsOpenByEnd.get(o);if(!r)return null;let s=null;for(const a of r)if(s===null||a.open.length>s.open.length){let l=!0;for(const c of n)if(t.getValueInRange(new V(c.lineNumber,c.column-a.open.length+1,c.lineNumber,c.column))+o!==a.open){l=!1;break}l&&(s=a)}return s}static _findContainedAutoClosingPair(e,t){if(t.open.length<=1)return null;const n=t.close.charAt(t.close.length-1),o=e.autoClosingPairs.autoClosingPairsCloseByEnd.get(n)||[];let r=null;for(const s of o)s.open!==t.open&&t.open.includes(s.open)&&t.close.endsWith(s.close)&&(!r||s.open.length>r.open.length)&&(r=s);return r}static _getAutoClosingPairClose(e,t,n,o,r){for(const g of n)if(!g.isEmpty())return null;const s=n.map(g=>{const p=g.getPosition();return r?{lineNumber:p.lineNumber,beforeColumn:p.column-o.length,afterColumn:p.column}:{lineNumber:p.lineNumber,beforeColumn:p.column,afterColumn:p.column}}),a=this._findAutoClosingPairOpen(e,t,s.map(g=>new ae(g.lineNumber,g.beforeColumn)),o);if(!a)return null;let l,c;if(qp(o)?(l=e.autoClosingQuotes,c=e.shouldAutoCloseBefore.quote):(e.blockCommentStartToken?a.open.includes(e.blockCommentStartToken):!1)?(l=e.autoClosingComments,c=e.shouldAutoCloseBefore.comment):(l=e.autoClosingBrackets,c=e.shouldAutoCloseBefore.bracket),l==="never")return null;const d=this._findContainedAutoClosingPair(e,a),h=d?d.close:"";let f=!0;for(const g of s){const{lineNumber:p,beforeColumn:v,afterColumn:m}=g,_=t.getLineContent(p),w=_.substring(0,v-1),y=_.substring(m-1);if(y.startsWith(h)||(f=!1),y.length>0){const I=y.charAt(0);if(!eo._isBeforeClosingBrace(e,y)&&!c(I))return null}if(a.open.length===1&&(o==="'"||o==='"')&&l!=="always"){const I=Wc(e.wordSeparators);if(w.length>0){const k=w.charCodeAt(w.length-1);if(I.get(k)===0)return null}}if(!t.tokenization.isCheapToTokenize(p))return null;t.tokenization.forceTokenization(p);const L=t.tokenization.getLineTokens(p),D=i5(L,v-1);if(!a.shouldAutoClose(D,v-D.firstCharOffset))return null;const E=a.findNeutralCharacter();if(E){const I=t.tokenization.getTokenTypeIfInsertingCharacter(p,v,E);if(!a.isOK(I))return null}}return f?a.close.substring(0,a.close.length-h.length):a.close}static _runAutoClosingOpenCharType(e,t,n,o,r,s,a){const l=[];for(let c=0,u=o.length;cnew Qr(new V(h.positionLineNumber,h.positionColumn,h.positionLineNumber,h.positionColumn+1),"",!1));return new ya(4,d,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}const u=this._getAutoClosingPairClose(t,n,r,l,!0);return u!==null?this._runAutoClosingOpenCharType(e,t,n,r,l,!0,u):null}static typeWithInterceptors(e,t,n,o,r,s,a){if(!e&&a===` -`){const u=[];for(let d=0,h=r.length;d{const o=t.get(Jn).getFocusedCodeEditor();return o&&o.hasTextFocus()?this._runEditorCommand(t,o,n):!1}),e.addImplementation(1e3,"generic-dom-input-textarea",(t,n)=>{const o=Tu();return o&&["input","textarea"].indexOf(o.tagName.toLowerCase())>=0?(this.runDOMCommand(o),!0):!1}),e.addImplementation(0,"generic-dom",(t,n)=>{const o=t.get(Jn).getActiveCodeEditor();return o?(o.focus(),this._runEditorCommand(t,o,n)):!1})}_runEditorCommand(e,t,n){const o=this.runEditorCommand(e,t,n);return o||!0}}var br;(function(i){class e extends ho{constructor(_){super(_),this._inSelectionMode=_.inSelectionMode}runCoreEditorCommand(_,w){if(!w.position)return;_.model.pushStackElement(),_.setCursorStates(w.source,3,[Mr.moveTo(_,_.getPrimaryCursorState(),this._inSelectionMode,w.position,w.viewPosition)])&&w.revealType!==2&&_.revealPrimaryCursor(w.source,!0,!0)}}i.MoveTo=Ye(new e({id:"_moveTo",inSelectionMode:!1,precondition:void 0})),i.MoveToSelect=Ye(new e({id:"_moveToSelect",inSelectionMode:!0,precondition:void 0}));class t extends ho{runCoreEditorCommand(_,w){_.model.pushStackElement();const y=this._getColumnSelectResult(_,_.getPrimaryCursorState(),_.getCursorColumnSelectData(),w);y!==null&&(_.setCursorStates(w.source,3,y.viewStates.map(L=>kn.fromViewState(L))),_.setCursorColumnSelectData({isReal:!0,fromViewLineNumber:y.fromLineNumber,fromViewVisualColumn:y.fromVisualColumn,toViewLineNumber:y.toLineNumber,toViewVisualColumn:y.toVisualColumn}),y.reversed?_.revealTopMostCursor(w.source):_.revealBottomMostCursor(w.source))}}i.ColumnSelect=Ye(new class extends t{constructor(){super({id:"columnSelect",precondition:void 0})}_getColumnSelectResult(m,_,w,y){if(typeof y.position=="undefined"||typeof y.viewPosition=="undefined"||typeof y.mouseColumn=="undefined")return null;const L=m.model.validatePosition(y.position),D=m.coordinatesConverter.validateViewPosition(new ae(y.viewPosition.lineNumber,y.viewPosition.column),L),E=y.doColumnSelect?w.fromViewLineNumber:D.lineNumber,I=y.doColumnSelect?w.fromViewVisualColumn:y.mouseColumn-1;return $_.columnSelect(m.cursorConfig,m,E,I,D.lineNumber,y.mouseColumn-1)}}),i.CursorColumnSelectLeft=Ye(new class extends t{constructor(){super({id:"cursorColumnSelectLeft",precondition:void 0,kbOpts:{weight:Yn,kbExpr:Q.textInputFocus,primary:3599,linux:{primary:0}}})}_getColumnSelectResult(m,_,w,y){return $_.columnSelectLeft(m.cursorConfig,m,w)}}),i.CursorColumnSelectRight=Ye(new class extends t{constructor(){super({id:"cursorColumnSelectRight",precondition:void 0,kbOpts:{weight:Yn,kbExpr:Q.textInputFocus,primary:3601,linux:{primary:0}}})}_getColumnSelectResult(m,_,w,y){return $_.columnSelectRight(m.cursorConfig,m,w)}});class n extends t{constructor(_){super(_),this._isPaged=_.isPaged}_getColumnSelectResult(_,w,y,L){return $_.columnSelectUp(_.cursorConfig,_,y,this._isPaged)}}i.CursorColumnSelectUp=Ye(new n({isPaged:!1,id:"cursorColumnSelectUp",precondition:void 0,kbOpts:{weight:Yn,kbExpr:Q.textInputFocus,primary:3600,linux:{primary:0}}})),i.CursorColumnSelectPageUp=Ye(new n({isPaged:!0,id:"cursorColumnSelectPageUp",precondition:void 0,kbOpts:{weight:Yn,kbExpr:Q.textInputFocus,primary:3595,linux:{primary:0}}}));class o extends t{constructor(_){super(_),this._isPaged=_.isPaged}_getColumnSelectResult(_,w,y,L){return $_.columnSelectDown(_.cursorConfig,_,y,this._isPaged)}}i.CursorColumnSelectDown=Ye(new o({isPaged:!1,id:"cursorColumnSelectDown",precondition:void 0,kbOpts:{weight:Yn,kbExpr:Q.textInputFocus,primary:3602,linux:{primary:0}}})),i.CursorColumnSelectPageDown=Ye(new o({isPaged:!0,id:"cursorColumnSelectPageDown",precondition:void 0,kbOpts:{weight:Yn,kbExpr:Q.textInputFocus,primary:3596,linux:{primary:0}}}));class r extends ho{constructor(){super({id:"cursorMove",precondition:void 0,description:lP.description})}runCoreEditorCommand(_,w){const y=lP.parse(w);!y||this._runCursorMove(_,w.source,y)}_runCursorMove(_,w,y){_.model.pushStackElement(),_.setCursorStates(w,3,r._move(_,_.getCursorStates(),y)),_.revealPrimaryCursor(w,!0)}static _move(_,w,y){const L=y.select,D=y.value;switch(y.direction){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:return Mr.simpleMove(_,w,y.direction,L,D,y.unit);case 11:case 13:case 12:case 14:return Mr.viewportMove(_,w,y.direction,L,D);default:return null}}}i.CursorMoveImpl=r,i.CursorMove=Ye(new r);class s extends ho{constructor(_){super(_),this._staticArgs=_.args}runCoreEditorCommand(_,w){let y=this._staticArgs;this._staticArgs.value===-1&&(y={direction:this._staticArgs.direction,unit:this._staticArgs.unit,select:this._staticArgs.select,value:w.pageSize||_.cursorConfig.pageSize}),_.model.pushStackElement(),_.setCursorStates(w.source,3,Mr.simpleMove(_,_.getCursorStates(),y.direction,y.select,y.value,y.unit)),_.revealPrimaryCursor(w.source,!0)}}i.CursorLeft=Ye(new s({args:{direction:0,unit:0,select:!1,value:1},id:"cursorLeft",precondition:void 0,kbOpts:{weight:Yn,kbExpr:Q.textInputFocus,primary:15,mac:{primary:15,secondary:[288]}}})),i.CursorLeftSelect=Ye(new s({args:{direction:0,unit:0,select:!0,value:1},id:"cursorLeftSelect",precondition:void 0,kbOpts:{weight:Yn,kbExpr:Q.textInputFocus,primary:1039}})),i.CursorRight=Ye(new s({args:{direction:1,unit:0,select:!1,value:1},id:"cursorRight",precondition:void 0,kbOpts:{weight:Yn,kbExpr:Q.textInputFocus,primary:17,mac:{primary:17,secondary:[292]}}})),i.CursorRightSelect=Ye(new s({args:{direction:1,unit:0,select:!0,value:1},id:"cursorRightSelect",precondition:void 0,kbOpts:{weight:Yn,kbExpr:Q.textInputFocus,primary:1041}})),i.CursorUp=Ye(new s({args:{direction:2,unit:2,select:!1,value:1},id:"cursorUp",precondition:void 0,kbOpts:{weight:Yn,kbExpr:Q.textInputFocus,primary:16,mac:{primary:16,secondary:[302]}}})),i.CursorUpSelect=Ye(new s({args:{direction:2,unit:2,select:!0,value:1},id:"cursorUpSelect",precondition:void 0,kbOpts:{weight:Yn,kbExpr:Q.textInputFocus,primary:1040,secondary:[3088],mac:{primary:1040},linux:{primary:1040}}})),i.CursorPageUp=Ye(new s({args:{direction:2,unit:2,select:!1,value:-1},id:"cursorPageUp",precondition:void 0,kbOpts:{weight:Yn,kbExpr:Q.textInputFocus,primary:11}})),i.CursorPageUpSelect=Ye(new s({args:{direction:2,unit:2,select:!0,value:-1},id:"cursorPageUpSelect",precondition:void 0,kbOpts:{weight:Yn,kbExpr:Q.textInputFocus,primary:1035}})),i.CursorDown=Ye(new s({args:{direction:3,unit:2,select:!1,value:1},id:"cursorDown",precondition:void 0,kbOpts:{weight:Yn,kbExpr:Q.textInputFocus,primary:18,mac:{primary:18,secondary:[300]}}})),i.CursorDownSelect=Ye(new s({args:{direction:3,unit:2,select:!0,value:1},id:"cursorDownSelect",precondition:void 0,kbOpts:{weight:Yn,kbExpr:Q.textInputFocus,primary:1042,secondary:[3090],mac:{primary:1042},linux:{primary:1042}}})),i.CursorPageDown=Ye(new s({args:{direction:3,unit:2,select:!1,value:-1},id:"cursorPageDown",precondition:void 0,kbOpts:{weight:Yn,kbExpr:Q.textInputFocus,primary:12}})),i.CursorPageDownSelect=Ye(new s({args:{direction:3,unit:2,select:!0,value:-1},id:"cursorPageDownSelect",precondition:void 0,kbOpts:{weight:Yn,kbExpr:Q.textInputFocus,primary:1036}})),i.CreateCursor=Ye(new class extends ho{constructor(){super({id:"createCursor",precondition:void 0})}runCoreEditorCommand(m,_){if(!_.position)return;let w;_.wholeLine?w=Mr.line(m,m.getPrimaryCursorState(),!1,_.position,_.viewPosition):w=Mr.moveTo(m,m.getPrimaryCursorState(),!1,_.position,_.viewPosition);const y=m.getCursorStates();if(y.length>1){const L=w.modelState?w.modelState.position:null,D=w.viewState?w.viewState.position:null;for(let E=0,I=y.length;ED&&(L=D);const E=new V(L,1,L,m.model.getLineMaxColumn(L));let I=0;if(w.at)switch(w.at){case VC.RawAtArgument.Top:I=3;break;case VC.RawAtArgument.Center:I=1;break;case VC.RawAtArgument.Bottom:I=4;break}const k=m.coordinatesConverter.convertModelRangeToViewRange(E);m.revealRange(_.source,!1,k,I,0)}}),i.SelectAll=new class extends mH{constructor(){super(GQe)}runDOMCommand(m){Oc&&(m.focus(),m.select()),m.ownerDocument.execCommand("selectAll")}runEditorCommand(m,_,w){const y=_._getViewModel();!y||this.runCoreEditorCommand(y,w)}runCoreEditorCommand(m,_){m.model.pushStackElement(),m.setCursorStates("keyboard",3,[Mr.selectAll(m,m.getPrimaryCursorState())])}},i.SetSelection=Ye(new class extends ho{constructor(){super({id:"setSelection",precondition:void 0})}runCoreEditorCommand(m,_){!_.selection||(m.model.pushStackElement(),m.setCursorStates(_.source,3,[kn.fromModelSelection(_.selection)]))}})})(br||(br={}));const urt=Me.and(Q.textInputFocus,Q.columnSelection);function wS(i,e){Wa.registerKeybindingRule({id:i,primary:e,when:urt,weight:Yn+1})}wS(br.CursorColumnSelectLeft.id,1039);wS(br.CursorColumnSelectRight.id,1041);wS(br.CursorColumnSelectUp.id,1040);wS(br.CursorColumnSelectPageUp.id,1035);wS(br.CursorColumnSelectDown.id,1042);wS(br.CursorColumnSelectPageDown.id,1036);function Are(i){return i.register(),i}var Ew;(function(i){class e extends Ir{runEditorCommand(n,o,r){const s=o._getViewModel();!s||this.runCoreEditingCommand(o,s,r||{})}}i.CoreEditingCommand=e,i.LineBreakInsert=Ye(new class extends e{constructor(){super({id:"lineBreakInsert",precondition:Q.writable,kbOpts:{weight:Yn,kbExpr:Q.textInputFocus,primary:0,mac:{primary:301}}})}runCoreEditingCommand(t,n,o){t.pushUndoStop(),t.executeCommands(this.id,eo.lineBreakInsert(n.cursorConfig,n.model,n.getCursorStates().map(r=>r.modelState.selection)))}}),i.Outdent=Ye(new class extends e{constructor(){super({id:"outdent",precondition:Q.writable,kbOpts:{weight:Yn,kbExpr:Me.and(Q.editorTextFocus,Q.tabDoesNotMoveFocus),primary:1026}})}runCoreEditingCommand(t,n,o){t.pushUndoStop(),t.executeCommands(this.id,eo.outdent(n.cursorConfig,n.model,n.getCursorStates().map(r=>r.modelState.selection))),t.pushUndoStop()}}),i.Tab=Ye(new class extends e{constructor(){super({id:"tab",precondition:Q.writable,kbOpts:{weight:Yn,kbExpr:Me.and(Q.editorTextFocus,Q.tabDoesNotMoveFocus),primary:2}})}runCoreEditingCommand(t,n,o){t.pushUndoStop(),t.executeCommands(this.id,eo.tab(n.cursorConfig,n.model,n.getCursorStates().map(r=>r.modelState.selection))),t.pushUndoStop()}}),i.DeleteLeft=Ye(new class extends e{constructor(){super({id:"deleteLeft",precondition:void 0,kbOpts:{weight:Yn,kbExpr:Q.textInputFocus,primary:1,secondary:[1025],mac:{primary:1,secondary:[1025,294,257]}}})}runCoreEditingCommand(t,n,o){const[r,s]=tb.deleteLeft(n.getPrevEditOperationType(),n.cursorConfig,n.model,n.getCursorStates().map(a=>a.modelState.selection),n.getCursorAutoClosedCharacters());r&&t.pushUndoStop(),t.executeCommands(this.id,s),n.setPrevEditOperationType(2)}}),i.DeleteRight=Ye(new class extends e{constructor(){super({id:"deleteRight",precondition:void 0,kbOpts:{weight:Yn,kbExpr:Q.textInputFocus,primary:20,mac:{primary:20,secondary:[290,276]}}})}runCoreEditingCommand(t,n,o){const[r,s]=tb.deleteRight(n.getPrevEditOperationType(),n.cursorConfig,n.model,n.getCursorStates().map(a=>a.modelState.selection));r&&t.pushUndoStop(),t.executeCommands(this.id,s),n.setPrevEditOperationType(3)}}),i.Undo=new class extends mH{constructor(){super(f0e)}runDOMCommand(t){t.ownerDocument.execCommand("undo")}runEditorCommand(t,n,o){if(!(!n.hasModel()||n.getOption(90)===!0))return n.getModel().undo()}},i.Redo=new class extends mH{constructor(){super(g0e)}runDOMCommand(t){t.ownerDocument.execCommand("redo")}runEditorCommand(t,n,o){if(!(!n.hasModel()||n.getOption(90)===!0))return n.getModel().redo()}}})(Ew||(Ew={}));class Pre extends J4{constructor(e,t,n){super({id:e,precondition:void 0,description:n}),this._handlerId=t}runCommand(e,t){const n=e.get(Jn).getFocusedCodeEditor();!n||n.trigger("keyboard",this._handlerId,t)}}function Hb(i,e){Are(new Pre("default:"+i,i)),Are(new Pre(i,i,e))}Hb("type",{description:"Type",args:[{name:"args",schema:{type:"object",required:["text"],properties:{text:{type:"string"}}}}]});Hb("replacePreviousChar");Hb("compositionType");Hb("compositionStart");Hb("compositionEnd");Hb("paste");Hb("cut");class drt{constructor(e,t,n,o){this.configuration=e,this.viewModel=t,this.userInputEvents=n,this.commandDelegate=o}paste(e,t,n,o){this.commandDelegate.paste(e,t,n,o)}type(e){this.commandDelegate.type(e)}compositionType(e,t,n,o){this.commandDelegate.compositionType(e,t,n,o)}compositionStart(){this.commandDelegate.startComposition()}compositionEnd(){this.commandDelegate.endComposition()}cut(){this.commandDelegate.cut()}setSelection(e){br.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):o?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){br.MoveTo.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_moveToSelect(e,t){br.MoveToSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_columnSelect(e,t,n){e=this._validateViewColumn(e),br.ColumnSelect.runCoreEditorCommand(this.viewModel,{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,mouseColumn:t,doColumnSelect:n})}_createCursor(e,t){e=this._validateViewColumn(e),br.CreateCursor.runCoreEditorCommand(this.viewModel,{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,wholeLine:t})}_lastCursorMoveToSelect(e,t){br.LastCursorMoveToSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_wordSelect(e,t){br.WordSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_wordSelectDrag(e,t){br.WordSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lastCursorWordSelect(e,t){br.LastCursorWordSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lineSelect(e,t){br.LineSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lineSelectDrag(e,t){br.LineSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lastCursorLineSelect(e,t){br.LastCursorLineSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lastCursorLineSelectDrag(e,t){br.LastCursorLineSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_selectAll(){br.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 b5{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){var t;(t=this.onKeyDown)===null||t===void 0||t.call(this,e)}emitKeyUp(e){var t;(t=this.onKeyUp)===null||t===void 0||t.call(this,e)}emitContextMenu(e){var t;(t=this.onContextMenu)===null||t===void 0||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseMove(e){var t;(t=this.onMouseMove)===null||t===void 0||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseLeave(e){var t;(t=this.onMouseLeave)===null||t===void 0||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseDown(e){var t;(t=this.onMouseDown)===null||t===void 0||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseUp(e){var t;(t=this.onMouseUp)===null||t===void 0||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseDrag(e){var t;(t=this.onMouseDrag)===null||t===void 0||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseDrop(e){var t;(t=this.onMouseDrop)===null||t===void 0||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseDropCanceled(){var e;(e=this.onMouseDropCanceled)===null||e===void 0||e.call(this)}emitMouseWheel(e){var t;(t=this.onMouseWheel)===null||t===void 0||t.call(this,e)}_convertViewToModelMouseEvent(e){return e.target?{event:e.event,target:this._convertViewToModelMouseTarget(e.target)}:e}_convertViewToModelMouseTarget(e){return b5.convertViewToModelMouseTarget(e,this._coordinatesConverter)}static convertViewToModelMouseTarget(e,t){const n=Object.assign({},e);return n.position&&(n.position=t.convertViewPositionToModelPosition(n.position)),n.range&&(n.range=t.convertViewRangeToModelRange(n.range)),(n.type===5||n.type===8)&&(n.detail=this.convertViewToModelViewZoneData(n.detail,t)),n}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 ae(e.afterLineNumber,1)).lineNumber}}}class Sbe{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 Vo("Illegal value for lineNumber");return this._lines[t]}onLinesDeleted(e,t){if(this.getCount()===0)return null;const n=this.getStartLineNumber(),o=this.getEndLineNumber();if(to)return null;let r=0,s=0;for(let l=n;l<=o;l++){const c=l-this._rendLineNumberStart;e<=l&&l<=t&&(s===0?(r=c,s=1):s++)}if(e=o&&a<=r&&(this._lines[a-this._rendLineNumberStart].onContentChanged(),s=!0);return s}onLinesInserted(e,t){if(this.getCount()===0)return null;const n=t-e+1,o=this.getStartLineNumber(),r=this.getEndLineNumber();if(e<=o)return this._rendLineNumberStart+=n,null;if(e>r)return null;if(n+e>r)return this._lines.splice(e-this._rendLineNumberStart,r-e+1);const s=[];for(let d=0;dn)continue;const l=Math.max(t,a.fromLineNumber),c=Math.min(n,a.toLineNumber);for(let u=l;u<=c;u++){const d=u-this._rendLineNumberStart;this._lines[d].onTokensChanged(),o=!0}}return o}}class xbe{constructor(e){this._host=e,this.domNode=this._createDomNode(),this._linesCollection=new Sbe(()=>this._host.createVisibleLine())}_createDomNode(){const e=ti(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(143)}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 n=0,o=t.length;nt){const s=t,a=Math.min(n,r.rendLineNumberStart-1);s<=a&&(this._insertLinesBefore(r,s,a,o,t),r.linesLength+=a-s+1)}else if(r.rendLineNumberStart0&&(this._removeLinesBefore(r,s),r.linesLength-=s)}if(r.rendLineNumberStart=t,r.rendLineNumberStart+r.linesLength-1n){const s=Math.max(0,n-r.rendLineNumberStart+1),l=r.linesLength-1-s+1;l>0&&(this._removeLinesAfter(r,l),r.linesLength-=l)}return this._finishRendering(r,!1,o),r}_renderUntouchedLines(e,t,n,o,r){const s=e.rendLineNumberStart,a=e.lines;for(let l=t;l<=n;l++){const c=s+l;a[l].layoutLine(c,o[c-r])}}_insertLinesBefore(e,t,n,o,r){const s=[];let a=0;for(let l=t;l<=n;l++)s[a++]=this.host.createVisibleLine();e.lines=s.concat(e.lines)}_removeLinesBefore(e,t){for(let n=0;n=0;a--){const l=e.lines[a];o[a]&&(l.setDomNode(s),s=s.previousSibling)}}_finishRenderingInvalidLines(e,t,n){const o=document.createElement("div");Lg._ttPolicy&&(t=Lg._ttPolicy.createHTML(t)),o.innerHTML=t;for(let r=0;ri});Lg._sb=new _S(1e5);class Lbe extends gl{constructor(e){super(e),this._visibleLines=new xbe(this),this.domNode=this._visibleLines.domNode;const n=this._context.configuration.options.get(50);rs(this.domNode,n),this._dynamicOverlays=[],this._isFocused=!1,this.domNode.setClassName("view-overlays")}shouldRender(){if(super.shouldRender())return!0;for(let e=0,t=this._dynamicOverlays.length;en.shouldRender());for(let n=0,o=t.length;n'),o.appendString(r),o.appendString(""),!0)}layoutLine(e,t){this._domNode&&(this._domNode.setTop(t),this._domNode.setHeight(this._lineHeight))}}class frt extends Lbe{constructor(e){super(e);const n=this._context.configuration.options.get(143);this._contentWidth=n.contentWidth,this.domNode.setHeight(0)}onConfigurationChanged(e){const n=this._context.configuration.options.get(143);return this._contentWidth=n.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 grt extends Lbe{constructor(e){super(e);const t=this._context.configuration.options,n=t.get(143);this._contentLeft=n.contentLeft,this.domNode.setClassName("margin-view-overlays"),this.domNode.setWidth(1),rs(this.domNode,t.get(50))}onConfigurationChanged(e){const t=this._context.configuration.options;rs(this.domNode,t.get(50));const n=t.get(143);return this._contentLeft=n.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 prt extends gl{constructor(e,t){super(e),this._viewDomNode=t,this._widgets={},this.domNode=ti(document.createElement("div")),mf.write(this.domNode,1),this.domNode.setClassName("contentWidgets"),this.domNode.setPosition("absolute"),this.domNode.setTop(0),this.overflowingContentWidgetsDomNode=ti(document.createElement("div")),mf.write(this.overflowingContentWidgetsDomNode,2),this.overflowingContentWidgetsDomNode.setClassName("overflowingContentWidgets")}dispose(){super.dispose(),this._widgets={}}onConfigurationChanged(e){const t=Object.keys(this._widgets);for(const n of t)this._widgets[n].onConfigurationChanged(e);return!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLineMappingChanged(e){return this._updateAnchorsViewPositions(),!0}onLinesChanged(e){return this._updateAnchorsViewPositions(),!0}onLinesDeleted(e){return this._updateAnchorsViewPositions(),!0}onLinesInserted(e){return this._updateAnchorsViewPositions(),!0}onScrollChanged(e){return!0}onZonesChanged(e){return!0}_updateAnchorsViewPositions(){const e=Object.keys(this._widgets);for(const t of e)this._widgets[t].updateAnchorViewPosition()}addWidget(e){const t=new mrt(this._context,this._viewDomNode,e);this._widgets[t.id]=t,t.allowEditorOverflow?this.overflowingContentWidgetsDomNode.appendChild(t.domNode):this.domNode.appendChild(t.domNode),this.setShouldRender()}setWidgetPosition(e,t,n,o,r){this._widgets[e.getId()].setPosition(t,n,o,r),this.setShouldRender()}removeWidget(e){const t=e.getId();if(this._widgets.hasOwnProperty(t)){const n=this._widgets[t];delete this._widgets[t];const o=n.domNode.domNode;o.parentNode.removeChild(o),o.removeAttribute("monaco-visible-content-widget"),this.setShouldRender()}}shouldSuppressMouseDownOnWidget(e){return this._widgets.hasOwnProperty(e)?this._widgets[e].suppressMouseDown:!1}onBeforeRender(e){const t=Object.keys(this._widgets);for(const n of t)this._widgets[n].onBeforeRender(e)}prepareRender(e){const t=Object.keys(this._widgets);for(const n of t)this._widgets[n].prepareRender(e)}render(e){const t=Object.keys(this._widgets);for(const n of t)this._widgets[n].render(e)}}class mrt{constructor(e,t,n){this._primaryAnchor=new Fx(null,null),this._secondaryAnchor=new Fx(null,null),this._context=e,this._viewDomNode=t,this._actual=n,this.domNode=ti(this._actual.getDomNode()),this.id=this._actual.getId(),this.allowEditorOverflow=this._actual.allowEditorOverflow||!1,this.suppressMouseDown=this._actual.suppressMouseDown||!1;const o=this._context.configuration.options,r=o.get(143);this._fixedOverflowWidgets=o.get(42),this._contentWidth=r.contentWidth,this._contentLeft=r.contentLeft,this._lineHeight=o.get(66),this._affinity=null,this._preference=[],this._cachedDomNodeOffsetWidth=-1,this._cachedDomNodeOffsetHeight=-1,this._maxWidth=this._getMaxWidth(),this._isVisible=!1,this._renderData=null,this.domNode.setPosition(this._fixedOverflowWidgets&&this.allowEditorOverflow?"fixed":"absolute"),this.domNode.setDisplay("none"),this.domNode.setVisibility("hidden"),this.domNode.setAttribute("widgetId",this.id),this.domNode.setMaxWidth(this._maxWidth)}onConfigurationChanged(e){const t=this._context.configuration.options;if(this._lineHeight=t.get(66),e.hasChanged(143)){const n=t.get(143);this._contentLeft=n.contentLeft,this._contentWidth=n.contentWidth,this._maxWidth=this._getMaxWidth()}}updateAnchorViewPosition(){this._setPosition(this._affinity,this._primaryAnchor.modelPosition,this._secondaryAnchor.modelPosition)}_setPosition(e,t,n){this._affinity=e,this._primaryAnchor=o(t,this._context.viewModel,this._affinity),this._secondaryAnchor=o(n,this._context.viewModel,this._affinity);function o(r,s,a){if(!r)return new Fx(null,null);const l=s.model.validatePosition(r);if(s.coordinatesConverter.modelPositionIsVisible(l)){const c=s.coordinatesConverter.convertModelPositionToViewPosition(l,a!=null?a:void 0);return new Fx(r,c)}return new Fx(r,null)}}_getMaxWidth(){const e=this.domNode.domNode.ownerDocument,t=e.defaultView;return this.allowEditorOverflow?(t==null?void 0:t.innerWidth)||e.documentElement.offsetWidth||e.body.offsetWidth:this._contentWidth}setPosition(e,t,n,o){this._setPosition(o,e,t),this._preference=n,this._primaryAnchor.viewPosition&&this._preference&&this._preference.length>0?this.domNode.setDisplay("block"):this.domNode.setDisplay("none"),this._cachedDomNodeOffsetWidth=-1,this._cachedDomNodeOffsetHeight=-1}_layoutBoxInViewport(e,t,n,o){const r=e.top,s=r,a=e.top+e.height,l=o.viewportHeight-a,c=r-n,u=s>=n,d=a,h=l>=n;let f=e.left;return f+t>o.scrollLeft+o.viewportWidth&&(f=o.scrollLeft+o.viewportWidth-t),fc){const f=h-(c-o);h-=f,n-=f}if(h=m,y=f+n<=g.height-_;return this._fixedOverflowWidgets?{fitsAbove:w,aboveTop:Math.max(h,m),fitsBelow:y,belowTop:f,left:v}:{fitsAbove:w,aboveTop:a,fitsBelow:y,belowTop:l,left:p}}_prepareRenderWidgetAtExactPositionOverflowing(e){return new Bx(e.top,e.left+this._contentLeft)}_getAnchorsCoordinates(e){var t,n;const o=a(this._primaryAnchor.viewPosition,this._affinity,this._lineHeight),r=((t=this._secondaryAnchor.viewPosition)===null||t===void 0?void 0:t.lineNumber)===((n=this._primaryAnchor.viewPosition)===null||n===void 0?void 0:n.lineNumber)?this._secondaryAnchor.viewPosition:null,s=a(r,this._affinity,this._lineHeight);return{primary:o,secondary:s};function a(l,c,u){if(!l)return null;const d=e.visibleRangeForPosition(l);if(!d)return null;const h=l.column===1&&c===3?0:d.left,f=e.getVerticalOffsetForLineNumber(l.lineNumber)-e.scrollTop;return new Ore(f,h,u)}}_reduceAnchorCoordinates(e,t,n){if(!t)return e;const o=this._context.configuration.options.get(50);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._isVisible&&(this.domNode.removeAttribute("monaco-visible-content-widget"),this._isVisible=!1,this.domNode.setVisibility("hidden")),typeof this._actual.afterRender=="function"&&l9(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"&&l9(this._actual.afterRender,this._actual,this._renderData.position)}}class Fx{constructor(e,t){this.modelPosition=e,this.viewPosition=t}}class Bx{constructor(e,t){this.top=e,this.left=t,this._coordinateBrand=void 0}}class Ore{constructor(e,t,n){this.top=e,this.left=t,this.height=n,this._anchorCoordinateBrand=void 0}}function l9(i,e,...t){try{return i.call(e,...t)}catch{return null}}class Ebe extends Vb{constructor(e){super(),this._context=e;const t=this._context.configuration.options,n=t.get(143);this._lineHeight=t.get(66),this._renderLineHighlight=t.get(95),this._renderLineHighlightOnlyWhenFocus=t.get(96),this._contentLeft=n.contentLeft,this._contentWidth=n.contentWidth,this._selectionIsEmpty=!0,this._focused=!1,this._cursorLineNumbers=[1],this._selections=[new gt(1,1,1,1)],this._renderData=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),super.dispose()}_readFromSelections(){let e=!1;const t=this._selections.map(o=>o.positionLineNumber);t.sort((o,r)=>o-r),Lo(this._cursorLineNumbers,t)||(this._cursorLineNumbers=t,e=!0);const n=this._selections.every(o=>o.isEmpty());return this._selectionIsEmpty!==n&&(this._selectionIsEmpty=n,e=!0),e}onThemeChanged(e){return this._readFromSelections()}onConfigurationChanged(e){const t=this._context.configuration.options,n=t.get(143);return this._lineHeight=t.get(66),this._renderLineHighlight=t.get(95),this._renderLineHighlightOnlyWhenFocus=t.get(96),this._contentLeft=n.contentLeft,this._contentWidth=n.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=this._renderOne(e),n=e.visibleRange.startLineNumber,o=e.visibleRange.endLineNumber,r=this._cursorLineNumbers.length;let s=0;const a=[];for(let l=n;l<=o;l++){const c=l-n;for(;s=this._renderData.length?"":this._renderData[n]}_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 vrt extends Ebe{_renderOne(e){return`
`}_shouldRenderThis(){return this._shouldRenderInContent()}_shouldRenderOther(){return this._shouldRenderInMargin()}}class _rt extends Ebe{_renderOne(e){return`
`}_shouldRenderThis(){return!0}_shouldRenderOther(){return this._shouldRenderInContent()}}Uu((i,e)=>{const t=i.getColor(hbe);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()||i.defines(Nre)){const n=i.getColor(Nre);n&&(e.addRule(`.monaco-editor .view-overlays .current-line { border: 2px solid ${n}; }`),e.addRule(`.monaco-editor .margin-view-overlays .current-line-margin { border: 2px solid ${n}; }`),Hd(i.type)&&(e.addRule(".monaco-editor .view-overlays .current-line { border-width: 1px; }"),e.addRule(".monaco-editor .margin-view-overlays .current-line-margin { border-width: 1px; }")))}});class brt extends Vb{constructor(e){super(),this._context=e;const t=this._context.configuration.options;this._lineHeight=t.get(66),this._typicalHalfwidthCharacterWidth=t.get(50).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._lineHeight=t.get(66),this._typicalHalfwidthCharacterWidth=t.get(50).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 n=[],o=0;for(let l=0,c=t.length;l{if(l.options.zIndexc.options.zIndex)return 1;const u=l.options.className,d=c.options.className;return ud?1:V.compareRangesUsingStarts(l.range,c.range)});const r=e.visibleRange.startLineNumber,s=e.visibleRange.endLineNumber,a=[];for(let l=r;l<=s;l++){const c=l-r;a[c]=""}this._renderWholeLineDecorations(e,n,a),this._renderNormalDecorations(e,n,a),this._renderResult=a}_renderWholeLineDecorations(e,t,n){const o=String(this._lineHeight),r=e.visibleRange.startLineNumber,s=e.visibleRange.endLineNumber;for(let a=0,l=t.length;a',d=Math.max(c.range.startLineNumber,r),h=Math.min(c.range.endLineNumber,s);for(let f=d;f<=h;f++){const g=f-r;n[g]+=u}}}_renderNormalDecorations(e,t,n){var o;const r=String(this._lineHeight),s=e.visibleRange.startLineNumber;let a=null,l=!1,c=null,u=!1;for(let d=0,h=t.length;d';l[f]+=_}}}render(e,t){if(!this._renderResult)return"";const n=t-e;return n<0||n>=this._renderResult.length?"":this._renderResult[n]}}class Crt extends gl{constructor(e,t,n,o){super(e);const r=this._context.configuration.options,s=r.get(102),a=r.get(74),l=r.get(40),c=r.get(105),u={listenOnDomNode:n.domNode,className:"editor-scrollable "+gH(e.theme.type),useShadows:!1,lazyRender:!0,vertical:s.vertical,horizontal:s.horizontal,verticalHasArrows:s.verticalHasArrows,horizontalHasArrows:s.horizontalHasArrows,verticalScrollbarSize:s.verticalScrollbarSize,verticalSliderSize:s.verticalSliderSize,horizontalScrollbarSize:s.horizontalScrollbarSize,horizontalSliderSize:s.horizontalSliderSize,handleMouseWheel:s.handleMouseWheel,alwaysConsumeMouseWheel:s.alwaysConsumeMouseWheel,arrowSize:s.arrowSize,mouseWheelScrollSensitivity:a,fastScrollSensitivity:l,scrollPredominantAxis:c,scrollByPage:s.scrollByPage};this.scrollbar=this._register(new xG(t.domNode,u,this._context.viewLayout.getScrollable())),mf.write(this.scrollbar.getDomNode(),5),this.scrollbarDomNode=ti(this.scrollbar.getDomNode()),this.scrollbarDomNode.setPosition("absolute"),this._setLayout();const d=(h,f,g)=>{const p={};if(f){const v=h.scrollTop;v&&(p.scrollTop=this._context.viewLayout.getCurrentScrollTop()+v,h.scrollTop=0)}if(g){const v=h.scrollLeft;v&&(p.scrollLeft=this._context.viewLayout.getCurrentScrollLeft()+v,h.scrollLeft=0)}this._context.viewModel.viewLayout.setScrollPosition(p,1)};this._register(ke(n.domNode,"scroll",h=>d(n.domNode,!0,!0))),this._register(ke(t.domNode,"scroll",h=>d(t.domNode,!0,!1))),this._register(ke(o.domNode,"scroll",h=>d(o.domNode,!0,!1))),this._register(ke(this.scrollbarDomNode.domNode,"scroll",h=>d(this.scrollbarDomNode.domNode,!0,!1)))}dispose(){super.dispose()}_setLayout(){const e=this._context.configuration.options,t=e.get(143);this.scrollbarDomNode.setLeft(t.contentLeft),e.get(72).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(102)||e.hasChanged(74)||e.hasChanged(40)){const t=this._context.configuration.options,n=t.get(102),o=t.get(74),r=t.get(40),s=t.get(105),a={vertical:n.vertical,horizontal:n.horizontal,verticalScrollbarSize:n.verticalScrollbarSize,horizontalScrollbarSize:n.horizontalScrollbarSize,scrollByPage:n.scrollByPage,handleMouseWheel:n.handleMouseWheel,mouseWheelScrollSensitivity:o,fastScrollSensitivity:r,scrollPredominantAxis:s};this.scrollbar.updateOptions(a)}return e.hasChanged(143)&&this._setLayout(),!0}onScrollChanged(e){return!0}onThemeChanged(e){return this.scrollbar.updateClassName("editor-scrollable "+gH(this._context.theme.type)),!0}prepareRender(e){}render(e){this.scrollbar.renderNow()}}class Dbe extends _e{constructor(){super(...arguments),this._isDisposed=!1}dispose(){super.dispose(),this._isDisposed=!0}assertNotDisposed(){if(this._isDisposed)throw new Error("TextModelPart is disposed!")}}function C5(i,e){let t=0,n=0;const o=i.length;for(;no)throw new Vo("Illegal value for lineNumber");const r=this.getLanguageConfiguration(this.textModel.getLanguageId()).foldingRules,s=Boolean(r&&r.offSide);let a=-2,l=-1,c=-2,u=-1;const d=E=>{if(a!==-1&&(a===-2||a>E-1)){a=-1,l=-1;for(let I=E-2;I>=0;I--){const k=this._computeIndentLevel(I);if(k>=0){a=I,l=k;break}}}if(c===-2){c=-1,u=-1;for(let I=E;I=0){c=I,u=k;break}}}};let h=-2,f=-1,g=-2,p=-1;const v=E=>{if(h===-2){h=-1,f=-1;for(let I=E-2;I>=0;I--){const k=this._computeIndentLevel(I);if(k>=0){h=I,f=k;break}}}if(g!==-1&&(g===-2||g=0){g=I,p=k;break}}}};let m=0,_=!0,w=0,y=!0,L=0,D=0;for(let E=0;_||y;E++){const I=e-E,k=e+E;E>1&&(I<1||I1&&(k>o||k>n)&&(y=!1),E>5e4&&(_=!1,y=!1);let R=-1;if(_&&I>=1){const P=this._computeIndentLevel(I-1);P>=0?(c=I-1,u=P,R=Math.ceil(P/this.textModel.getOptions().indentSize)):(d(I),R=this._getIndentLevelForWhitespaceLine(s,l,u))}let A=-1;if(y&&k<=o){const P=this._computeIndentLevel(k-1);P>=0?(h=k-1,f=P,A=Math.ceil(P/this.textModel.getOptions().indentSize)):(v(k),A=this._getIndentLevelForWhitespaceLine(s,f,p))}if(E===0){D=R;continue}if(E===1){if(k<=o&&A>=0&&D+1===A){_=!1,m=k,w=k,L=A;continue}if(I>=1&&R>=0&&R-1===D){y=!1,m=I,w=I,L=R;continue}if(m=e,w=e,L=D,L===0)return{startLineNumber:m,endLineNumber:w,indent:L}}_&&(R>=L?m=I:_=!1),y&&(A>=L?w=k:y=!1)}return{startLineNumber:m,endLineNumber:w,indent:L}}getLinesBracketGuides(e,t,n,o){var r;const s=[];for(let h=e;h<=t;h++)s.push([]);const a=!0,l=this.textModel.bracketPairs.getBracketPairsInRangeWithMinIndentation(new V(e,1,t,this.textModel.getLineMaxColumn(t))).toArray();let c;if(n&&l.length>0){const h=(e<=n.lineNumber&&n.lineNumber<=t?l:this.textModel.bracketPairs.getBracketPairsInRange(V.fromPositions(n)).toArray()).filter(f=>V.strictContainsPosition(f.range,n));c=(r=ZA(h,f=>a))===null||r===void 0?void 0:r.range}const u=this.textModel.getOptions().bracketPairColorizationOptions.independentColorPoolPerBracketType,d=new kbe;for(const h of l){if(!h.closingBracketRange)continue;const f=c&&h.range.equalsRange(c);if(!f&&!o.includeInactive)continue;const g=d.getInlineClassName(h.nestingLevel,h.nestingLevelOfEqualBracketType,u)+(o.highlightActive&&f?" "+d.activeClassName:""),p=h.openingBracketRange.getStartPosition(),v=h.closingBracketRange.getStartPosition(),m=o.horizontalGuides===k0.Enabled||o.horizontalGuides===k0.EnabledForActive&&f;if(h.range.startLineNumber===h.range.endLineNumber){m&&s[h.range.startLineNumber-e].push(new g0(-1,h.openingBracketRange.getEndPosition().column,g,new fE(!1,v.column),-1,-1));continue}const _=this.getVisibleColumnFromPosition(v),w=this.getVisibleColumnFromPosition(h.openingBracketRange.getStartPosition()),y=Math.min(w,_,h.minVisibleColumnIndentation+1);let L=!1;Ws(this.textModel.getLineContent(h.closingBracketRange.startLineNumber))=e&&w>y&&s[p.lineNumber-e].push(new g0(y,-1,g,new fE(!1,p.column),-1,-1)),v.lineNumber<=t&&_>y&&s[v.lineNumber-e].push(new g0(y,-1,g,new fE(!L,v.column),-1,-1)))}for(const h of s)h.sort((f,g)=>f.visibleColumn-g.visibleColumn);return s}getVisibleColumnFromPosition(e){return or.visibleColumnFromColumn(this.textModel.getLineContent(e.lineNumber),e.column,this.textModel.getOptions().tabSize)+1}getLinesIndentGuides(e,t){this.assertNotDisposed();const n=this.textModel.getLineCount();if(e<1||e>n)throw new Error("Illegal value for startLineNumber");if(t<1||t>n)throw new Error("Illegal value for endLineNumber");const o=this.textModel.getOptions(),r=this.getLanguageConfiguration(this.textModel.getLanguageId()).foldingRules,s=Boolean(r&&r.offSide),a=new Array(t-e+1);let l=-2,c=-1,u=-2,d=-1;for(let h=e;h<=t;h++){const f=h-e,g=this._computeIndentLevel(h-1);if(g>=0){l=h-1,c=g,a[f]=Math.ceil(g/o.indentSize);continue}if(l===-2){l=-1,c=-1;for(let p=h-2;p>=0;p--){const v=this._computeIndentLevel(p);if(v>=0){l=p,c=v;break}}}if(u!==-1&&(u===-2||u=0){u=p,d=v;break}}}a[f]=this._getIndentLevelForWhitespaceLine(s,c,d)}return a}_getIndentLevelForWhitespaceLine(e,t,n){const o=this.textModel.getOptions();return t===-1||n===-1?0:tl||this._maxIndentLeft>0&&w>this._maxIndentLeft)break;const y=_.horizontalLine?_.horizontalLine.top?"horizontal-top":"horizontal-bottom":"vertical",L=_.horizontalLine?((r=(o=e.visibleRangeForPosition(new ae(f,_.horizontalLine.endColumn)))===null||o===void 0?void 0:o.left)!==null&&r!==void 0?r:w+this._spaceWidth)-w:this._spaceWidth;v+=`
`}h[g]=v}this._renderResult=h}getGuidesByLine(e,t,n){const o=this._bracketPairGuideOptions.bracketPairs!==!1?this._context.viewModel.getBracketGuidesInRangeByLine(e,t,n,{highlightActive:this._bracketPairGuideOptions.highlightActiveBracketPair,horizontalGuides:this._bracketPairGuideOptions.bracketPairsHorizontal===!0?k0.Enabled:this._bracketPairGuideOptions.bracketPairsHorizontal==="active"?k0.EnabledForActive:k0.Disabled,includeInactive:this._bracketPairGuideOptions.bracketPairs===!0}):null,r=this._bracketPairGuideOptions.indentation?this._context.viewModel.getLinesIndentGuides(e,t):null;let s=0,a=0,l=0;if(this._bracketPairGuideOptions.highlightActiveIndentation!==!1&&n){const d=this._context.viewModel.getActiveIndentGuide(n.lineNumber,e,t);s=d.startLineNumber,a=d.endLineNumber,l=d.indent}const{indentSize:c}=this._context.viewModel.model.getOptions(),u=[];for(let d=e;d<=t;d++){const h=new Array;u.push(h);const f=o?o[d-e]:[],g=new rp(f),p=r?r[d-e]:0;for(let v=1;v<=p;v++){const m=(v-1)*c+1,_=(this._bracketPairGuideOptions.highlightActiveIndentation==="always"||f.length===0)&&s<=d&&d<=a&&v===l;h.push(...g.takeWhile(y=>y.visibleColumn!0)||[])}return u}render(e,t){if(!this._renderResult)return"";const n=t-e;return n<0||n>=this._renderResult.length?"":this._renderResult[n]}}function z1(i){if(!(i&&i.isTransparent()))return i}Uu((i,e)=>{const t=[{bracketColor:pbe,guideColor:Rot,guideColorActive:Bot},{bracketColor:mbe,guideColor:Mot,guideColorActive:Wot},{bracketColor:vbe,guideColor:Aot,guideColorActive:Vot},{bracketColor:_be,guideColor:Pot,guideColorActive:Hot},{bracketColor:bbe,guideColor:Oot,guideColorActive:$ot},{bracketColor:Cbe,guideColor:Fot,guideColorActive:zot}],n=new kbe,o=[{indentColor:XI,indentColorActive:YI},{indentColor:got,indentColorActive:bot},{indentColor:pot,indentColorActive:Cot},{indentColor:mot,indentColorActive:wot},{indentColor:vot,indentColorActive:yot},{indentColor:_ot,indentColorActive:Sot}],r=t.map(a=>{var l,c;const u=i.getColor(a.bracketColor),d=i.getColor(a.guideColor),h=i.getColor(a.guideColorActive),f=z1((l=z1(d))!==null&&l!==void 0?l:u==null?void 0:u.transparent(.3)),g=z1((c=z1(h))!==null&&c!==void 0?c:u);if(!(!f||!g))return{guideColor:f,guideColorActive:g}}).filter(ED),s=o.map(a=>{const l=i.getColor(a.indentColor),c=i.getColor(a.indentColorActive),u=z1(l),d=z1(c);if(!(!u||!d))return{indentColor:u,indentColorActive:d}}).filter(ED);if(r.length>0){for(let a=0;a<30;a++){const l=r[a%r.length];e.addRule(`.monaco-editor .${n.getInlineClassNameOfLevel(a).replace(/ /g,".")} { --guide-color: ${l.guideColor}; --guide-color-active: ${l.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.${n.activeClassName} { box-shadow: 1px 0 0 0 var(--guide-color-active) inset; }`),e.addRule(`.monaco-editor .horizontal-top.${n.activeClassName} { border-top: 1px solid var(--guide-color-active); }`),e.addRule(`.monaco-editor .horizontal-bottom.${n.activeClassName} { border-bottom: 1px solid var(--guide-color-active); }`)}if(s.length>0){for(let a=0;a<30;a++){const l=s[a%s.length];e.addRule(`.monaco-editor .lines-content .core-guide-indent.lvl-${a} { --indent-color: ${l.indentColor}; --indent-color-active: ${l.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; }")}});class c9{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 Srt{constructor(){this._currentVisibleRange=new V(1,1,1,1)}getCurrentVisibleRange(){return this._currentVisibleRange}setCurrentVisibleRange(e){this._currentVisibleRange=e}}class xrt{constructor(e,t,n,o,r,s,a){this.minimalReveal=e,this.lineNumber=t,this.startColumn=n,this.endColumn=o,this.startScrollTop=r,this.stopScrollTop=s,this.scrollType=a,this.type="range",this.minLineNumber=t,this.maxLineNumber=t}}class Lrt{constructor(e,t,n,o,r){this.minimalReveal=e,this.selections=t,this.startScrollTop=n,this.stopScrollTop=o,this.scrollType=r,this.type="selections";let s=t[0].startLineNumber,a=t[0].endLineNumber;for(let l=1,c=t.length;l{this._updateLineWidthsSlow()},200),this._asyncCheckMonospaceFontAssumptions=new bi(()=>{this._checkMonospaceFontAssumptions()},2e3),this._lastRenderedData=new Srt,this._horizontalRevealRequest=null,this._stickyScrollEnabled=o.get(114).enabled,this._maxNumberStickyLines=o.get(114).maxLineCount}dispose(){this._asyncUpdateLineWidths.dispose(),this._asyncCheckMonospaceFontAssumptions.dispose(),super.dispose()}getDomNode(){return this.domNode}createVisibleLine(){return new Ah(this._viewLineOptions)}onConfigurationChanged(e){this._visibleLines.onConfigurationChanged(e),e.hasChanged(144)&&(this._maxLineWidth=0);const t=this._context.configuration.options,n=t.get(50),o=t.get(144);return this._lineHeight=t.get(66),this._typicalHalfwidthCharacterWidth=n.typicalHalfwidthCharacterWidth,this._isViewportWrapping=o.isViewportWrapping,this._revealHorizontalRightPadding=t.get(99),this._cursorSurroundingLines=t.get(29),this._cursorSurroundingLinesStyle=t.get(30),this._canUseLayerHinting=!t.get(32),this._stickyScrollEnabled=t.get(114).enabled,this._maxNumberStickyLines=t.get(114).maxLineCount,rs(this.domNode,n),this._onOptionsMaybeChanged(),e.hasChanged(143)&&(this._maxLineWidth=0),!0}_onOptionsMaybeChanged(){const e=this._context.configuration,t=new Dre(e,this._context.theme.type);if(!this._viewLineOptions.equals(t)){this._viewLineOptions=t;const n=this._visibleLines.getStartLineNumber(),o=this._visibleLines.getEndLineNumber();for(let r=n;r<=o;r++)this._visibleLines.getVisibleLine(r).onOptionsChanged(this._viewLineOptions);return!0}return!1}onCursorStateChanged(e){const t=this._visibleLines.getStartLineNumber(),n=this._visibleLines.getEndLineNumber();let o=!1;for(let r=t;r<=n;r++)o=this._visibleLines.getVisibleLine(r).onSelectionChanged()||o;return o}onDecorationsChanged(e){{const t=this._visibleLines.getStartLineNumber(),n=this._visibleLines.getEndLineNumber();for(let o=t;o<=n;o++)this._visibleLines.getVisibleLine(o).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 n=this._context.viewLayout.validateScrollPosition({scrollTop:t});e.revealHorizontal?e.range&&e.range.startLineNumber!==e.range.endLineNumber?n={scrollTop:n.scrollTop,scrollLeft:0}:e.range?this._horizontalRevealRequest=new xrt(e.minimalReveal,e.range.startLineNumber,e.range.startColumn,e.range.endColumn,this._context.viewLayout.getCurrentScrollTop(),n.scrollTop,e.scrollType):e.selections&&e.selections.length>0&&(this._horizontalRevealRequest=new Lrt(e.minimalReveal,e.selections,this._context.viewLayout.getCurrentScrollTop(),n.scrollTop,e.scrollType)):this._horizontalRevealRequest=null;const r=Math.abs(this._context.viewLayout.getCurrentScrollTop()-n.scrollTop)<=this._lineHeight?1:e.scrollType;return this._context.viewModel.viewLayout.setScrollPosition(n,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),n=Math.max(this._horizontalRevealRequest.startScrollTop,this._horizontalRevealRequest.stopScrollTop);(e.scrollTopn)&&(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 n=this._getViewLineDomNode(e);if(n===null)return null;const o=this._getLineNumberFor(n);if(o===-1||o<1||o>this._context.viewModel.getLineCount())return null;if(this._context.viewModel.getLineMaxColumn(o)===1)return new ae(o,1);const r=this._visibleLines.getStartLineNumber(),s=this._visibleLines.getEndLineNumber();if(os)return null;let a=this._visibleLines.getVisibleLine(o).getColumnOfNodeOffset(e,t);const l=this._context.viewModel.getLineMinColumn(o);return an)return-1;const o=new c9(this.domNode.domNode,this._textRangeRestingSpot),r=this._visibleLines.getVisibleLine(e).getWidth(o);return this._updateLineWidthsSlowIfDomDidLayout(o),r}linesVisibleRangesForRange(e,t){if(this.shouldRender())return null;const n=e.endLineNumber,o=V.intersectRanges(e,this._lastRenderedData.getCurrentVisibleRange());if(!o)return null;const r=[];let s=0;const a=new c9(this.domNode.domNode,this._textRangeRestingSpot);let l=0;t&&(l=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new ae(o.startLineNumber,1)).lineNumber);const c=this._visibleLines.getStartLineNumber(),u=this._visibleLines.getEndLineNumber();for(let d=o.startLineNumber;d<=o.endLineNumber;d++){if(du)continue;const h=d===o.startLineNumber?o.startColumn:1,f=d!==o.endLineNumber,g=f?this._context.viewModel.getLineMaxColumn(d):o.endColumn,p=this._visibleLines.getVisibleLine(d).getVisibleRangesForRange(d,h,g,a);if(!!p){if(t&&dthis._visibleLines.getEndLineNumber())return null;const o=new c9(this.domNode.domNode,this._textRangeRestingSpot),r=this._visibleLines.getVisibleLine(e).getVisibleRangesForRange(e,t,n,o);return this._updateLineWidthsSlowIfDomDidLayout(o),r}visibleRangeForPosition(e){const t=this._visibleRangesForLineRange(e.lineNumber,e.column,e.column);return t?new Pit(t.outsideRenderedLine,t.ranges[0].left):null}_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(),n=this._visibleLines.getEndLineNumber();let o=1,r=!0;for(let s=t;s<=n;s++){const a=this._visibleLines.getVisibleLine(s);if(e&&!a.getWidthIsFast()){r=!1;continue}o=Math.max(o,a.getWidth(null))}return r&&t===1&&n===this._context.viewModel.getLineCount()&&(this._maxLineWidth=0),this._ensureMaxLineWidth(o),r}_checkMonospaceFontAssumptions(){let e=-1,t=-1;const n=this._visibleLines.getStartLineNumber(),o=this._visibleLines.getEndLineNumber();for(let r=n;r<=o;r++){const s=this._visibleLines.getVisibleLine(r);if(s.needsMonospaceFontCheck()){const a=s.getWidth(null);a>t&&(t=a,e=r)}}if(e!==-1&&!this._visibleLines.getVisibleLine(e).monospaceAssumptionsAreValid())for(let r=n;r<=o;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 n=this._horizontalRevealRequest;if(e.startLineNumber<=n.minLineNumber&&n.maxLineNumber<=e.endLineNumber){this._horizontalRevealRequest=null,this.onDidRender();const o=this._computeScrollLeftToReveal(n);o&&(this._isViewportWrapping||this._ensureMaxLineWidth(o.maxHorizontalOffset),this._context.viewModel.viewLayout.setScrollPosition({scrollLeft:o.scrollLeft},n.scrollType))}}if(this._updateLineWidthsFast()?this._asyncUpdateLineWidths.cancel():this._asyncUpdateLineWidths.schedule(),Ss&&!this._asyncCheckMonospaceFontAssumptions.isScheduled()){const n=this._visibleLines.getStartLineNumber(),o=this._visibleLines.getEndLineNumber();for(let r=n;r<=o;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 m=r[0].startLineNumber,_=r[0].endLineNumber;for(let w=1,y=r.length;wl){if(!u)return-1;v=d}else if(s===5||s===6)if(s===6&&a<=d&&h<=c)v=a;else{const m=Math.max(5*this._lineHeight,l*.2),_=d-m,w=h-l;v=Math.max(w,_)}else if(s===1||s===2)if(s===2&&a<=d&&h<=c)v=a;else{const m=(d+h)/2;v=Math.max(0,m-l/2)}else v=this._computeMinimumScrolling(a,c,d,h,s===3,s===4);return v}_computeScrollLeftToReveal(e){const t=this._context.viewLayout.getCurrentViewport(),n=this._context.configuration.options.get(143),o=t.left,r=o+t.width-n.verticalScrollbarWidth;let s=1073741824,a=0;if(e.type==="range"){const c=this._visibleRangesForLineRange(e.lineNumber,e.startColumn,e.endColumn);if(!c)return null;for(const u of c.ranges)s=Math.min(s,Math.round(u.left)),a=Math.max(a,Math.round(u.left+u.width))}else for(const c of e.selections){if(c.startLineNumber!==c.endLineNumber)return null;const u=this._visibleRangesForLineRange(c.startLineNumber,c.startColumn,c.endColumn);if(!u)return null;for(const d of u.ranges)s=Math.min(s,Math.round(d.left)),a=Math.max(a,Math.round(d.left+d.width))}return e.minimalReveal||(s=Math.max(0,s-w5.HORIZONTAL_EXTRA_PX),a+=this._revealHorizontalRightPadding),e.type==="selections"&&a-s>t.width?null:{scrollLeft:this._computeMinimumScrolling(o,r,s,a),maxHorizontalOffset:a}}_computeMinimumScrolling(e,t,n,o,r,s){e=e|0,t=t|0,n=n|0,o=o|0,r=!!r,s=!!s;const a=t-e;if(o-nt)return Math.max(0,o-a)}else return n;return e}}w5.HORIZONTAL_EXTRA_PX=30;class vH{constructor(e,t,n,o){this._decorationToRenderBrand=void 0,this.startLineNumber=+e,this.endLineNumber=+t,this.className=String(n),this.zIndex=o!=null?o:0}}class Ert{constructor(e,t){this.className=e,this.zIndex=t}}class Drt{constructor(){this.decorations=[]}add(e){this.decorations.push(e)}getDecorations(){return this.decorations}}class Ibe extends Vb{_render(e,t,n){const o=[];for(let a=e;a<=t;a++){const l=a-e;o[l]=new Drt}if(n.length===0)return o;n.sort((a,l)=>a.className===l.className?a.startLineNumber===l.startLineNumber?a.endLineNumber-l.endLineNumber:a.startLineNumber-l.startLineNumber:a.classNameo)continue;const a=Math.max(s.startLineNumber,n),l=Math.min(r.preference.lane,this._glyphMarginDecorationLaneCount);t.push(new Trt(a,l,r.preference.zIndex,r))}}_collectSortedGlyphRenderRequests(e){const t=[];return this._collectDecorationBasedGlyphRenderRequest(e,t),this._collectWidgetBasedGlyphRenderRequest(e,t),t.sort((n,o)=>n.lineNumber===o.lineNumber?n.lane===o.lane?n.zIndex===o.zIndex?o.type===n.type?n.type===0&&o.type===0?n.className0;){const o=t.peek();if(!o)break;const r=t.takeWhile(a=>a.lineNumber===o.lineNumber&&a.lane===o.lane);if(!r||r.length===0)break;const s=r[0];if(s.type===0){const a=[];for(const l of r){if(l.zIndex!==s.zIndex||l.type!==s.type)break;(a.length===0||a[a.length-1]!==l.className)&&a.push(l.className)}n.push(s.accept(a.join(" ")))}else s.widget.renderInfo={lineNumber:s.lineNumber,lane:s.lane}}this._decorationGlyphsToRender=n}render(e){if(!this._glyphMargin){for(const n of Object.values(this._widgets))n.domNode.setDisplay("none");for(;this._managedDomNodes.length>0;){const n=this._managedDomNodes.pop();n==null||n.domNode.remove()}return}const t=Math.round(this._glyphMarginWidth/this._glyphMarginDecorationLaneCount);for(const n of Object.values(this._widgets))if(!n.renderInfo)n.domNode.setDisplay("none");else{const o=e.viewportData.relativeVerticalOffset[n.renderInfo.lineNumber-e.viewportData.startLineNumber],r=this._glyphMarginLeft+(n.renderInfo.lane-1)*this._lineHeight;n.domNode.setDisplay("block"),n.domNode.setTop(o),n.domNode.setLeft(r),n.domNode.setWidth(t),n.domNode.setHeight(this._lineHeight)}for(let n=0;nthis._decorationGlyphsToRender.length;){const n=this._managedDomNodes.pop();n==null||n.domNode.remove()}}}class Irt{constructor(e,t,n,o){this.lineNumber=e,this.lane=t,this.zIndex=n,this.className=o,this.type=0}accept(e){return new Nrt(this.lineNumber,this.lane,e)}}class Trt{constructor(e,t,n,o){this.lineNumber=e,this.lane=t,this.zIndex=n,this.widget=o,this.type=1}}class Nrt{constructor(e,t,n){this.lineNumber=e,this.lane=t,this.combinedClassName=n}}class Rrt extends Ibe{constructor(e){super(),this._context=e;const n=this._context.configuration.options.get(143);this._decorationsLeft=n.decorationsLeft,this._decorationsWidth=n.decorationsWidth,this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){const n=this._context.configuration.options.get(143);return this._decorationsLeft=n.decorationsLeft,this._decorationsWidth=n.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(),n=[];let o=0;for(let r=0,s=t.length;r',l=[];for(let c=t;c<=n;c++){const u=c-t,d=o[u].getDecorations();let h="";for(const f of d)h+='
';r[a]=c}this._renderResult=r}render(e,t){return this._renderResult?this._renderResult[t-e]:""}}class Ic{constructor(e,t,n,o){this._rgba8Brand=void 0,this.r=Ic._clamp(e),this.g=Ic._clamp(t),this.b=Ic._clamp(n),this.a=Ic._clamp(o)}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}}Ic.Empty=new Ic(0,0,0,0);class QI extends _e{static getInstance(){return this._INSTANCE||(this._INSTANCE=new QI),this._INSTANCE}constructor(){super(),this._onDidChange=new le,this.onDidChange=this._onDidChange.event,this._updateColorMap(),this._register(oo.onDidChange(e=>{e.changedColorMap&&this._updateColorMap()}))}_updateColorMap(){const e=oo.getColorMap();if(!e){this._colors=[Ic.Empty],this._backgroundIsLight=!0;return}this._colors=[Ic.Empty];for(let n=1;n=.5,this._onDidChange.fire(void 0)}getColor(e){return(e<1||e>=this._colors.length)&&(e=2),this._colors[e]}backgroundIsLight(){return this._backgroundIsLight}}QI._INSTANCE=null;const Art=(()=>{const i=[];for(let e=32;e<=126;e++)i.push(e);return i.push(65533),i})(),Prt=(i,e)=>(i-=32,i<0||i>96?e<=2?(i+96)%96:96-1:i);class ek{constructor(e,t){this.scale=t,this._minimapCharRendererBrand=void 0,this.charDataNormal=ek.soften(e,12/15),this.charDataLight=ek.soften(e,50/60)}static soften(e,t){const n=new Uint8ClampedArray(e.length);for(let o=0,r=e.length;oe.width||n+g>e.height){console.warn("bad render request outside image data");return}const p=u?this.charDataLight:this.charDataNormal,v=Prt(o,c),m=e.width*4,_=a.r,w=a.g,y=a.b,L=r.r-_,D=r.g-w,E=r.b-y,I=Math.max(s,l),k=e.data;let R=v*h*f,A=n*m+t*4;for(let P=0;Pe.width||n+d>e.height){console.warn("bad render request outside image data");return}const h=e.width*4,f=.5*(r/255),g=s.r,p=s.g,v=s.b,m=o.r-g,_=o.g-p,w=o.b-v,y=g+m*f,L=p+_*f,D=v+w*f,E=Math.max(r,a),I=e.data;let k=n*h+t*4;for(let R=0;R{const e=new Uint8ClampedArray(i.length/2);for(let t=0;t>1]=Fre[i[t]]<<4|Fre[i[t+1]]&15;return e},Wre={1:_v(()=>Bre("0000511D6300CF609C709645A78432005642574171487021003C451900274D35D762755E8B629C5BA856AF57BA649530C167D1512A272A3F6038604460398526BCA2A968DB6F8957C768BE5FBE2FB467CF5D8D5B795DC7625B5DFF50DE64C466DB2FC47CD860A65E9A2EB96CB54CE06DA763AB2EA26860524D3763536601005116008177A8705E53AB738E6A982F88BAA35B5F5B626D9C636B449B737E5B7B678598869A662F6B5B8542706C704C80736A607578685B70594A49715A4522E792")),2:_v(()=>Bre("000000000000000055394F383D2800008B8B1F210002000081B1CBCBCC820000847AAF6B9AAF2119BE08B8881AD60000A44FD07DCCF107015338130C00000000385972265F390B406E2437634B4B48031B12B8A0847000001E15B29A402F0000000000004B33460B00007A752C2A0000000000004D3900000084394B82013400ABA5CFC7AD9C0302A45A3E5A98AB000089A43382D97900008BA54AA087A70A0248A6A7AE6DBE0000BF6F94987EA40A01A06DCFA7A7A9030496C32F77891D0000A99FB1A0AFA80603B29AB9CA75930D010C0948354D3900000C0948354F37460D0028BE673D8400000000AF9D7B6E00002B007AA8933400007AA642675C2700007984CFB9C3985B768772A8A6B7B20000CAAECAAFC4B700009F94A6009F840009D09F9BA4CA9C0000CC8FC76DC87F0000C991C472A2000000A894A48CA7B501079BA2C9C69BA20000B19A5D3FA89000005CA6009DA2960901B0A7F0669FB200009D009E00B7890000DAD0F5D092820000D294D4C48BD10000B5A7A4A3B1A50402CAB6CBA6A2000000B5A7A4A3B1A8044FCDADD19D9CB00000B7778F7B8AAE0803C9AB5D3F5D3F00009EA09EA0BAB006039EA0989A8C7900009B9EF4D6B7C00000A9A7816CACA80000ABAC84705D3F000096DA635CDC8C00006F486F266F263D4784006124097B00374F6D2D6D2D6D4A3A95872322000000030000000000008D8939130000000000002E22A5C9CBC70600AB25C0B5C9B400061A2DB04CA67001082AA6BEBEBFC606002321DACBC19E03087AA08B6768380000282FBAC0B8CA7A88AD25BBA5A29900004C396C5894A6000040485A6E356E9442A32CD17EADA70000B4237923628600003E2DE9C1D7B500002F25BBA5A2990000231DB6AFB4A804023025C0B5CAB588062B2CBDBEC0C706882435A75CA20000002326BD6A82A908048B4B9A5A668000002423A09CB4BB060025259C9D8A7900001C1FCAB2C7C700002A2A9387ABA200002626A4A47D6E9D14333163A0C87500004B6F9C2D643A257049364936493647358A34438355497F1A0000A24C1D590000D38DFFBDD4CD3126"))};class gE{static create(e,t){if(this.lastCreated&&e===this.lastCreated.scale&&t===this.lastFontFamily)return this.lastCreated;let n;return Wre[e]?n=new ek(Wre[e](),e):n=gE.createFromSampleData(gE.createSampleData(t).data,e),this.lastFontFamily=t,this.lastCreated=n,n}static createSampleData(e){const t=document.createElement("canvas"),n=t.getContext("2d");t.style.height=`${16}px`,t.height=16,t.width=96*10,t.style.width=96*10+"px",n.fillStyle="#ffffff",n.font=`bold ${16}px ${e}`,n.textBaseline="middle";let o=0;for(const r of Art)n.fillText(String.fromCharCode(r),o,16/2),o+=10;return n.getImageData(0,0,96*10,16)}static createFromSampleData(e,t){if(e.length!==61440)throw new Error("Unexpected source in MinimapCharRenderer");const o=gE._downsample(e,t);return new ek(o,t)}static _downsampleChar(e,t,n,o,r){const s=1*r,a=2*r;let l=o,c=0;for(let u=0;u0){const c=255/l;for(let u=0;ugE.create(this.fontScale,l.fontFamily)),this.defaultBackgroundColor=n.getColor(2),this.backgroundColor=tk._getMinimapBackground(t,this.defaultBackgroundColor),this.foregroundAlpha=tk._getMinimapForegroundOpacity(t)}static _getMinimapBackground(e,t){const n=e.getColor(_it);return n?new Ic(n.rgba.r,n.rgba.g,n.rgba.b,Math.round(255*n.rgba.a)):t}static _getMinimapForegroundOpacity(e){const t=e.getColor(bit);return t?Ic._clamp(Math.round(255*t.rgba.a)):255}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.defaultBackgroundColor&&this.defaultBackgroundColor.equals(e.defaultBackgroundColor)&&this.backgroundColor&&this.backgroundColor.equals(e.backgroundColor)&&this.foregroundAlpha===e.foregroundAlpha}}class pE{constructor(e,t,n,o,r,s,a,l,c){this.scrollTop=e,this.scrollHeight=t,this.sliderNeeded=n,this._computedSliderRatio=o,this.sliderTop=r,this.sliderHeight=s,this.topPaddingLineCount=a,this.startLineNumber=l,this.endLineNumber=c}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),n=Math.min(this.endLineNumber,e.endLineNumber);return t>n?null:[t,n]}getYForLineNumber(e,t){return+(e-this.startLineNumber+this.topPaddingLineCount)*t}static create(e,t,n,o,r,s,a,l,c,u,d){const h=e.pixelRatio,f=e.minimapLineHeight,g=Math.floor(e.canvasInnerHeight/f),p=e.lineHeight;if(e.minimapHeightIsEditorHeight){let D=l*e.lineHeight+e.paddingTop+e.paddingBottom;e.scrollBeyondLastLine&&(D+=Math.max(0,r-e.lineHeight-e.paddingBottom));const E=Math.max(1,Math.floor(r*r/D)),I=Math.max(0,e.minimapHeight-E),k=I/(u-r),R=c*k,A=I>0,P=Math.floor(e.canvasInnerHeight/e.minimapLineHeight),N=Math.floor(e.paddingTop/e.lineHeight);return new pE(c,u,A,k,R,E,N,1,Math.min(a,P))}let v;if(s&&n!==a){const D=n-t+1;v=Math.floor(D*f/h)}else{const D=r/p;v=Math.floor(D*f/h)}const m=Math.floor(e.paddingTop/p);let _=Math.floor(e.paddingBottom/p);if(e.scrollBeyondLastLine){const D=r/p;_=Math.max(_,D-1)}let w;if(_>0){const D=r/p;w=(m+a+_-D-1)*f/h}else w=Math.max(0,(m+a)*f/h-v);w=Math.min(e.minimapHeight-v,w);const y=w/(u-r),L=c*y;if(g>=m+a+_){const D=w>0;return new pE(c,u,D,y,L,v,m,1,a)}else{let D;t>1?D=t+m:D=Math.max(1,c/p);let E,I=Math.max(1,Math.floor(D-L*h/f));Ic&&(I=Math.min(I,d.startLineNumber),E=Math.max(E,d.topPaddingLineCount)),d.scrollTop=e.paddingTop?A=(t-I+E+R)*f/h:A=c/e.paddingTop*(E+R)*f/h,new pE(c,u,!0,y,A,v,E,I,k)}}}class cP{constructor(e){this.dy=e}onContentChanged(){this.dy=-1}onTokensChanged(){this.dy=-1}}cP.INVALID=new cP(-1);class Vre{constructor(e,t,n){this.renderedLayout=e,this._imageData=t,this._renderedLines=new Sbe(()=>cP.INVALID),this._renderedLines._set(e.startLineNumber,n)}linesEquals(e){if(!this.scrollEquals(e))return!1;const n=this._renderedLines._get().lines;for(let o=0,r=n.length;o1){for(let m=0,_=o-1;m<_;m++)v[m]=Math.round(m*r+s);v[o-1]=t}return[new nk(r,v),[]]}const a=n.minimapLines,l=a.length,c=[];let u=0,d=0,h=1;const f=10;let g=[],p=null;for(let v=0;v0&&this.minimapLines[n-1]>=e;)n--;let o=this.modelLineToMinimapLine(t)-1;for(;o+1t)return null}return[n+1,o+1]}decorationLineRangeToMinimapLineRange(e,t){let n=this.modelLineToMinimapLine(e),o=this.modelLineToMinimapLine(t);return e!==t&&o===n&&(o===this.minimapLines.length?n>1&&n--:o++),[n,o]}onLinesDeleted(e){const t=e.toLineNumber-e.fromLineNumber+1;let n=this.minimapLines.length,o=0;for(let r=this.minimapLines.length-1;r>=0&&!(this.minimapLines[r]=0&&!(this.minimapLines[n]0,scrollWidth:e.scrollWidth,scrollHeight:e.scrollHeight,viewportStartLineNumber:t,viewportEndLineNumber:n,viewportStartLineNumberVerticalOffset:e.getVerticalOffsetForLineNumber(t),scrollTop:e.scrollTop,scrollLeft:e.scrollLeft,viewportWidth:e.viewportWidth,viewportHeight:e.viewportHeight};this._actual.render(o)}_recreateLineSampling(){this._minimapSelections=null;const e=Boolean(this._samplingState),[t,n]=nk.compute(this.options,this._context.viewModel.getLineCount(),this._samplingState);if(this._samplingState=t,e&&this._samplingState)for(const o of n)switch(o.type){case"deleted":this._actual.onLinesDeleted(o.deleteFromLineNumber,o.deleteToLineNumber);break;case"inserted":this._actual.onLinesInserted(o.insertFromLineNumber,o.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,n){if(this._samplingState){const o=[];for(let r=0,s=t-e+1;r{if(n.preventDefault(),this._model.options.renderMinimap===0||!this._lastRenderData)return;if(this._model.options.size!=="proportional"){if(n.button===0&&this._lastRenderData){const c=Yo(this._slider.domNode),u=c.top+c.height/2;this._startSliderDragging(n,u,this._lastRenderData.renderedLayout)}return}const r=this._model.options.minimapLineHeight,s=this._model.options.canvasInnerHeight/this._model.options.canvasOuterHeight*n.offsetY;let l=Math.floor(s/r)+this._lastRenderData.renderedLayout.startLineNumber-this._lastRenderData.renderedLayout.topPaddingLineCount;l=Math.min(l,this._model.getLineCount()),this._model.revealLineNumber(l)}),this._sliderPointerMoveMonitor=new CS,this._sliderPointerDownListener=No(this._slider.domNode,et.POINTER_DOWN,n=>{n.preventDefault(),n.stopPropagation(),n.button===0&&this._lastRenderData&&this._startSliderDragging(n,n.pageY,this._lastRenderData.renderedLayout)}),this._gestureDisposable=Ei.addTarget(this._domNode.domNode),this._sliderTouchStartListener=ke(this._domNode.domNode,Di.Start,n=>{n.preventDefault(),n.stopPropagation(),this._lastRenderData&&(this._slider.toggleClassName("active",!0),this._gestureInProgress=!0,this.scrollDueToTouchEvent(n))},{passive:!1}),this._sliderTouchMoveListener=ke(this._domNode.domNode,Di.Change,n=>{n.preventDefault(),n.stopPropagation(),this._lastRenderData&&this._gestureInProgress&&this.scrollDueToTouchEvent(n)},{passive:!1}),this._sliderTouchEndListener=No(this._domNode.domNode,Di.End,n=>{n.preventDefault(),n.stopPropagation(),this._gestureInProgress=!1,this._slider.toggleClassName("active",!1)})}_startSliderDragging(e,t,n){if(!e.target||!(e.target instanceof Element))return;const o=e.pageX;this._slider.toggleClassName("active",!0);const r=(s,a)=>{const l=Yo(this._domNode.domNode),c=Math.min(Math.abs(a-o),Math.abs(a-l.left),Math.abs(a-l.left-l.width));if(as&&c>Ort){this._model.setScrollTop(n.scrollTop);return}const u=s-t;this._model.setScrollTop(n.getDesiredScrollTopFromDelta(u))};e.pageY!==t&&r(e.pageY,o),this._sliderPointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,s=>r(s.pageY,s.pageX),()=>{this._slider.toggleClassName("active",!1)})}scrollDueToTouchEvent(e){const t=this._domNode.domNode.getBoundingClientRect().top,n=this._lastRenderData.renderedLayout.getDesiredScrollTopFromTouchLocation(e.pageY-t);this._model.setScrollTop(n)}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 DG(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){var n;return(n=this._lastRenderData)===null||n===void 0||n.onLinesDeleted(e,t),!0}onLinesInserted(e,t){var n;return(n=this._lastRenderData)===null||n===void 0||n.onLinesInserted(e,t),!0}onScrollChanged(){return this._renderDecorations=!0,!0}onThemeChanged(){return this._selectionColor=this._theme.getColor(Sre),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===0){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 n=pE.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(n.sliderNeeded?"block":"none"),this._slider.setTop(n.sliderTop),this._slider.setHeight(n.sliderHeight),this._sliderHorizontal.setLeft(0),this._sliderHorizontal.setWidth(this._model.options.minimapWidth),this._sliderHorizontal.setTop(0),this._sliderHorizontal.setHeight(n.sliderHeight),this.renderDecorations(n),this._lastRenderData=this.renderLines(n)}renderDecorations(e){if(this._renderDecorations){this._renderDecorations=!1;const t=this._model.getSelections();t.sort(V.compareRangesUsingStarts);const n=this._model.getMinimapDecorationsInViewport(e.startLineNumber,e.endLineNumber);n.sort((h,f)=>(h.options.zIndex||0)-(f.options.zIndex||0));const{canvasInnerWidth:o,canvasInnerHeight:r}=this._model.options,s=this._model.options.minimapLineHeight,a=this._model.options.minimapCharWidth,l=this._model.getOptions().tabSize,c=this._decorationsCanvas.domNode.getContext("2d");c.clearRect(0,0,o,r);const u=new Hre(e.startLineNumber,e.endLineNumber,!1);this._renderSelectionLineHighlights(c,t,u,e,s),this._renderDecorationsLineHighlights(c,n,u,e,s);const d=new Hre(e.startLineNumber,e.endLineNumber,null);this._renderSelectionsHighlights(c,t,d,e,s,l,a,o),this._renderDecorationsHighlights(c,n,d,e,s,l,a,o)}}_renderSelectionLineHighlights(e,t,n,o,r){if(!this._selectionColor||this._selectionColor.isTransparent())return;e.fillStyle=this._selectionColor.transparent(.5).toString();let s=0,a=0;for(const l of t){const c=o.intersectWithViewport(l);if(!c)continue;const[u,d]=c;for(let g=u;g<=d;g++)n.set(g,!0);const h=o.getYForLineNumber(u,r),f=o.getYForLineNumber(d,r);a>=h||(a>s&&e.fillRect(Up,s,e.canvas.width,a-s),s=h),a=f}a>s&&e.fillRect(Up,s,e.canvas.width,a-s)}_renderDecorationsLineHighlights(e,t,n,o,r){const s=new Map;for(let a=t.length-1;a>=0;a--){const l=t[a],c=l.options.minimap;if(!c||c.position!==al.Inline)continue;const u=o.intersectWithViewport(l.range);if(!u)continue;const[d,h]=u,f=c.getColor(this._theme.value);if(!f||f.isTransparent())continue;let g=s.get(f.toString());g||(g=f.transparent(.5).toString(),s.set(f.toString(),g)),e.fillStyle=g;for(let p=d;p<=h;p++){if(n.has(p))continue;n.set(p,!0);const v=o.getYForLineNumber(d,r);e.fillRect(Up,v,e.canvas.width,r)}}}_renderSelectionsHighlights(e,t,n,o,r,s,a,l){if(!(!this._selectionColor||this._selectionColor.isTransparent()))for(const c of t){const u=o.intersectWithViewport(c);if(!u)continue;const[d,h]=u;for(let f=d;f<=h;f++)this.renderDecorationOnLine(e,n,c,this._selectionColor,o,f,r,r,s,a,l)}}_renderDecorationsHighlights(e,t,n,o,r,s,a,l){for(const c of t){const u=c.options.minimap;if(!u)continue;const d=o.intersectWithViewport(c.range);if(!d)continue;const[h,f]=d,g=u.getColor(this._theme.value);if(!(!g||g.isTransparent()))for(let p=h;p<=f;p++)switch(u.position){case al.Inline:this.renderDecorationOnLine(e,n,c.range,g,o,p,r,r,s,a,l);continue;case al.Gutter:{const v=o.getYForLineNumber(p,r),m=2;this.renderDecoration(e,g,m,v,Frt,r);continue}}}}renderDecorationOnLine(e,t,n,o,r,s,a,l,c,u,d){const h=r.getYForLineNumber(s,l);if(h+a<0||h>this._model.options.canvasInnerHeight)return;const{startLineNumber:f,endLineNumber:g}=n,p=f===s?n.startColumn:1,v=g===s?n.endColumn:this._model.getLineMaxColumn(s),m=this.getXOffsetForPosition(t,s,p,c,u,d),_=this.getXOffsetForPosition(t,s,v,c,u,d);this.renderDecoration(e,o,m,h,_-m,a)}getXOffsetForPosition(e,t,n,o,r,s){if(n===1)return Up;if((n-1)*r>=s)return s;let l=e.get(t);if(!l){const c=this._model.getLineContent(t);l=[Up];let u=Up;for(let d=1;d=s){l[d]=s;break}l[d]=g,u=g}e.set(t,l)}return n-1L?Math.floor((o-L)/2):0,E=h.a/255,I=new Ic(Math.round((h.r-d.r)*E+d.r),Math.round((h.g-d.g)*E+d.g),Math.round((h.b-d.b)*E+d.b),255);let k=e.topPaddingLineCount*o;const R=[];for(let H=0,W=n-t+1;H=0&&A_)return;const P=v.charCodeAt(L);if(P===9){const N=h-(L+D)%h;D+=N-1,y+=N*s}else if(P===32)y+=s;else{const N=bv(P)?2:1;for(let M=0;M_)return}}}}}class Hre{constructor(e,t,n){this._startLineNumber=e,this._endLineNumber=t,this._defaultValue=n,this._values=[];for(let o=0,r=this._endLineNumber-this._startLineNumber+1;othis._endLineNumber||(this._values[e-this._startLineNumber]=t)}get(e){return ethis._endLineNumber?this._defaultValue:this._values[e-this._startLineNumber]}}class Wrt extends gl{constructor(e){super(e);const n=this._context.configuration.options.get(143);this._widgets={},this._verticalScrollbarWidth=n.verticalScrollbarWidth,this._minimapWidth=n.minimap.minimapWidth,this._horizontalScrollbarHeight=n.horizontalScrollbarHeight,this._editorHeight=n.height,this._editorWidth=n.width,this._domNode=ti(document.createElement("div")),mf.write(this._domNode,4),this._domNode.setClassName("overlayWidgets")}dispose(){super.dispose(),this._widgets={}}getDomNode(){return this._domNode}onConfigurationChanged(e){const n=this._context.configuration.options.get(143);return this._verticalScrollbarWidth=n.verticalScrollbarWidth,this._minimapWidth=n.minimap.minimapWidth,this._horizontalScrollbarHeight=n.horizontalScrollbarHeight,this._editorHeight=n.height,this._editorWidth=n.width,!0}addWidget(e){const t=ti(e.getDomNode());this._widgets[e.getId()]={widget:e,preference:null,domNode:t},t.setPosition("absolute"),t.setAttribute("widgetId",e.getId()),this._domNode.appendChild(t),this.setShouldRender(),this._updateMaxMinWidth()}setWidgetPosition(e,t){const n=this._widgets[e.getId()];return n.preference===t?(this._updateMaxMinWidth(),!1):(n.preference=t,this.setShouldRender(),this._updateMaxMinWidth(),!0)}removeWidget(e){const t=e.getId();if(this._widgets.hasOwnProperty(t)){const o=this._widgets[t].domNode.domNode;delete this._widgets[t],o.parentNode.removeChild(o),this.setShouldRender(),this._updateMaxMinWidth()}}_updateMaxMinWidth(){var e,t;let n=0;const o=Object.keys(this._widgets);for(let r=0,s=o.length;r=3){const r=Math.floor(o/3),s=Math.floor(o/3),a=o-r-s,l=e,c=l+r,u=l+r+a;return[[0,l,c,l,u,l,c,l],[0,r,a,r+a,s,r+a+s,a+s,r+a+s]]}else if(n===2){const r=Math.floor(o/2),s=o-r,a=e,l=a+r;return[[0,a,a,a,l,a,a,a],[0,r,r,r,s,r+s,r+s,r+s]]}else{const r=e,s=o;return[[0,r,r,r,r,r,r,r],[0,s,s,s,s,s,s,s]]}}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.cursorColor===e.cursorColor&&this.themeType===e.themeType&&ve.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}}class Hrt extends gl{constructor(e){super(e),this._actualShouldRender=0,this._renderedDecorations=[],this._renderedCursorPositions=[],this._domNode=ti(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=oo.onDidChange(t=>{t.changedColorMap&&this._updateSettings(!0)}),this._cursorPositions=[]}dispose(){super.dispose(),this._tokensColorTrackerListener.dispose()}_updateSettings(e){const t=new Vrt(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=2,!0}_markRenderingIsMaybeNeeded(){return this._actualShouldRender=1,!0}onConfigurationChanged(e){return this._updateSettings(!1)?this._markRenderingIsNeeded():!1}onCursorStateChanged(e){this._cursorPositions=[];for(let t=0,n=e.selections.length;tg.lineNumber===p.lineNumber)&&(this._actualShouldRender=2),this._actualShouldRender===1)return;this._renderedDecorations=t,this._renderedCursorPositions=this._cursorPositions,this._domNode.setDisplay("block");const n=this._settings.canvasWidth,o=this._settings.canvasHeight,r=this._settings.lineHeight,s=this._context.viewLayout,a=this._context.viewLayout.getScrollHeight(),l=o/a,c=6*this._settings.pixelRatio|0,u=c/2|0,d=this._domNode.domNode.getContext("2d");e?e.isOpaque()?(d.fillStyle=ve.Format.CSS.formatHexA(e),d.fillRect(0,0,n,o)):(d.clearRect(0,0,n,o),d.fillStyle=ve.Format.CSS.formatHexA(e),d.fillRect(0,0,n,o)):d.clearRect(0,0,n,o);const h=this._settings.x,f=this._settings.w;for(const g of t){const p=g.color,v=g.data;d.fillStyle=p;let m=0,_=0,w=0;for(let y=0,L=v.length/3;yo&&(P=o-u),k=P-u,R=P+u}k>w+1||D!==m?(y!==0&&d.fillRect(h[m],_,f[m],w-_),m=D,_=k,w=R):R>w&&(w=R)}d.fillRect(h[m],_,f[m],w-_)}if(!this._settings.hideCursor&&this._settings.cursorColor){const g=2*this._settings.pixelRatio|0,p=g/2|0,v=this._settings.x[7],m=this._settings.w[7];d.fillStyle=this._settings.cursorColor;let _=-100,w=-100;for(let y=0,L=this._cursorPositions.length;yo&&(E=o-p);const I=E-p,k=I+g;I>w+1?(y!==0&&d.fillRect(v,_,m,w-_),_=I,w=k):k>w&&(w=k)}d.fillRect(v,_,m,w-_)}this._settings.renderBorder&&this._settings.borderColor&&this._settings.overviewRulerLanes>0&&(d.beginPath(),d.lineWidth=1,d.strokeStyle=this._settings.borderColor,d.moveTo(0,0),d.lineTo(0,o),d.stroke(),d.moveTo(0,0),d.lineTo(n,0),d.stroke())}}class $re{constructor(e,t,n){this._colorZoneBrand=void 0,this.from=e|0,this.to=t|0,this.colorId=n|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 Tbe{constructor(e,t,n,o){this._overviewRulerZoneBrand=void 0,this.startLineNumber=e,this.endLineNumber=t,this.heightInLines=n,this.color=o,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.colorn&&(p=n-v);const m=u.color;let _=this._color2Id[m];_||(_=++this._lastAssignedId,this._color2Id[m]=_,this._id2Color[_]=m);const w=new $re(p-v,p+v,_);u.setColorZone(w),a.push(w)}return this._colorZonesInvalid=!1,a.sort($re.compare),a}}class zrt extends KI{constructor(e,t){super(),this._context=e;const n=this._context.configuration.options;this._domNode=ti(document.createElement("canvas")),this._domNode.setClassName(t),this._domNode.setPosition("absolute"),this._domNode.setLayerHinting(!0),this._domNode.setContain("strict"),this._zoneManager=new $rt(o=>this._context.viewLayout.getVerticalOffsetForLineNumber(o)),this._zoneManager.setDOMWidth(0),this._zoneManager.setDOMHeight(0),this._zoneManager.setOuterHeight(this._context.viewLayout.getScrollHeight()),this._zoneManager.setLineHeight(n.get(66)),this._zoneManager.setPixelRatio(n.get(141)),this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return e.hasChanged(66)&&(this._zoneManager.setLineHeight(t.get(66)),this._render()),e.hasChanged(141)&&(this._zoneManager.setPixelRatio(t.get(141)),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(),n=this._zoneManager.resolveColorZones(),o=this._zoneManager.getId2Color(),r=this._domNode.domNode.getContext("2d");return r.clearRect(0,0,e,t),n.length>0&&this._renderOneLane(r,n,o,e),!0}_renderOneLane(e,t,n,o){let r=0,s=0,a=0;for(const l of t){const c=l.colorId,u=l.from,d=l.to;c!==r?(e.fillRect(0,s,o,a-s),r=c,e.fillStyle=n[r],s=u,a=d):a>=u?a=Math.max(a,d):(e.fillRect(0,s,o,a-s),s=u,a=d)}e.fillRect(0,s,o,a-s)}}class Urt extends gl{constructor(e){super(e),this.domNode=ti(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(101),this._typicalHalfwidthCharacterWidth=t.get(50).typicalHalfwidthCharacterWidth}dispose(){super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return this._rulers=t.get(101),this._typicalHalfwidthCharacterWidth=t.get(50).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=ti(document.createElement("div"));a.setClassName("view-ruler"),a.setWidth(r),this.domNode.appendChild(a),this._renderedRulers.push(a),s--}return}let n=e-t;for(;n>0;){const o=this._renderedRulers.pop();this.domNode.removeChild(o),n--}}render(e){this._ensureRulersCount();for(let t=0,n=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(143);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 n=this._context.configuration.options.get(102);return this._useShadows=n.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":"")}}class Krt{constructor(e){this.left=e.left,this.width=e.width,this.startStyle=null,this.endStyle=null}}class qrt{constructor(e,t){this.lineNumber=e,this.ranges=t}}function Grt(i){return new Krt(i)}function Xrt(i){return new qrt(i.lineNumber,i.ranges.map(Grt))}class wo extends Vb{constructor(e){super(),this._previousFrameVisibleRangesWithStyle=[],this._context=e;const t=this._context.configuration.options;this._lineHeight=t.get(66),this._roundedSelection=t.get(100),this._typicalHalfwidthCharacterWidth=t.get(50).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._lineHeight=t.get(66),this._roundedSelection=t.get(100),this._typicalHalfwidthCharacterWidth=t.get(50).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,n=e.length;t1)return!0;return!1}_enrichVisibleRangesWithStyle(e,t,n){const o=this._typicalHalfwidthCharacterWidth/4;let r=null,s=null;if(n&&n.length>0&&t.length>0){const a=t[0].lineNumber;if(a===e.startLineNumber)for(let c=0;!r&&c=0;c--)n[c].lineNumber===l&&(s=n[c].ranges[0]);r&&!r.startStyle&&(r=null),s&&!s.startStyle&&(s=null)}for(let a=0,l=t.length;a0){const g=t[a-1].ranges[0].left,p=t[a-1].ranges[0].left+t[a-1].ranges[0].width;p2(u-g)g&&(h.top=1),p2(d-p)'}_actualRenderOneSelection(e,t,n,o){if(o.length===0)return;const r=!!o[0].ranges[0].startStyle,s=this._lineHeight.toString(),a=(this._lineHeight-1).toString(),l=o[0].lineNumber,c=o[o.length-1].lineNumber;for(let u=0,d=o.length;u1,c)}this._previousFrameVisibleRangesWithStyle=r,this._renderResult=t.map(([s,a])=>s+a)}render(e,t){if(!this._renderResult)return"";const n=t-e;return n<0||n>=this._renderResult.length?"":this._renderResult[n]}}wo.SELECTION_CLASS_NAME="selected-text";wo.SELECTION_TOP_LEFT="top-left-radius";wo.SELECTION_BOTTOM_LEFT="bottom-left-radius";wo.SELECTION_TOP_RIGHT="top-right-radius";wo.SELECTION_BOTTOM_RIGHT="bottom-right-radius";wo.EDITOR_BACKGROUND_CLASS_NAME="monaco-editor-background";wo.ROUNDED_PIECE_WIDTH=10;Uu((i,e)=>{const t=i.getColor(xnt);t&&!t.isTransparent()&&e.addRule(`.monaco-editor .view-line span.inline-selected-text { color: ${t}; }`)});function p2(i){return i<0?-i:i}class zre{constructor(e,t,n,o,r,s,a){this.top=e,this.left=t,this.paddingLeft=n,this.width=o,this.height=r,this.textContent=s,this.textContentClassName=a}}class Ure{constructor(e){this._context=e;const t=this._context.configuration.options,n=t.get(50);this._cursorStyle=t.get(28),this._lineHeight=t.get(66),this._typicalHalfwidthCharacterWidth=n.typicalHalfwidthCharacterWidth,this._lineCursorWidth=Math.min(t.get(31),this._typicalHalfwidthCharacterWidth),this._isVisible=!0,this._domNode=ti(document.createElement("div")),this._domNode.setClassName(`cursor ${xw}`),this._domNode.setHeight(this._lineHeight),this._domNode.setTop(0),this._domNode.setLeft(0),rs(this._domNode,n),this._domNode.setDisplay("none"),this._position=new ae(1,1),this._lastRenderedContent="",this._renderData=null}getDomNode(){return this._domNode}getPosition(){return this._position}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,n=t.get(50);return this._cursorStyle=t.get(28),this._lineHeight=t.get(66),this._typicalHalfwidthCharacterWidth=n.typicalHalfwidthCharacterWidth,this._lineCursorWidth=Math.min(t.get(31),this._typicalHalfwidthCharacterWidth),rs(this._domNode,n),!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,n=this._context.viewModel.getLineContent(e),[o,r]=lZe(n,t-1);return[new ae(e,o+1),n.substring(o,r)]}_prepareRender(e){let t="",n="";const[o,r]=this._getGraphemeAwarePosition();if(this._cursorStyle===Wr.Line||this._cursorStyle===Wr.LineThin){const h=e.visibleRangeForPosition(o);if(!h||h.outsideRenderedLine)return null;let f;this._cursorStyle===Wr.Line?(f=yoe(this._lineCursorWidth>0?this._lineCursorWidth:2),f>2&&(t=r,n=this._getTokenClassName(o))):f=yoe(1);let g=h.left,p=0;f>=2&&g>=1&&(p=1,g-=p);const v=e.getVerticalOffsetForLineNumber(o.lineNumber)-e.bigNumbersDelta;return new zre(v,g,p,f,this._lineHeight,t,n)}const s=e.linesVisibleRangesForRange(new V(o.lineNumber,o.column,o.lineNumber,o.column+r.length),!1);if(!s||s.length===0)return null;const a=s[0];if(a.outsideRenderedLine||a.ranges.length===0)return null;const l=a.ranges[0],c=r===" "?this._typicalHalfwidthCharacterWidth:l.width<1?this._typicalHalfwidthCharacterWidth:l.width;this._cursorStyle===Wr.Block&&(t=r,n=this._getTokenClassName(o));let u=e.getVerticalOffsetForLineNumber(o.lineNumber)-e.bigNumbersDelta,d=this._lineHeight;return(this._cursorStyle===Wr.Underline||this._cursorStyle===Wr.UnderlineThin)&&(u+=this._lineHeight-2,d=2),new zre(u,l.left,0,c,d,t,n)}_getTokenClassName(e){const t=this._context.viewModel.getViewLineData(e.lineNumber),n=t.tokens.findTokenIndexAtOffset(e.column-1);return t.tokens.getClassName(n)}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 ${xw} ${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)}}class ik extends gl{constructor(e){super(e);const t=this._context.configuration.options;this._readOnly=t.get(90),this._cursorBlinking=t.get(26),this._cursorStyle=t.get(28),this._cursorSmoothCaretAnimation=t.get(27),this._selectionIsEmpty=!0,this._isComposingInput=!1,this._isVisible=!1,this._primaryCursor=new Ure(this._context),this._secondaryCursors=[],this._renderData=[],this._domNode=ti(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 $u,this._cursorFlatBlinkInterval=new VI,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(90),this._cursorBlinking=t.get(26),this._cursorStyle=t.get(28),this._cursorSmoothCaretAnimation=t.get(27),this._updateBlinking(),this._updateDomClassName(),this._primaryCursor.onConfigurationChanged(e);for(let n=0,o=this._secondaryCursors.length;nt.length){const r=this._secondaryCursors.length-t.length;for(let s=0;s{for(let o=0,r=e.ranges.length;o{this._isVisible?this._hide():this._show()},ik.BLINK_INTERVAL):this._startCursorBlinkAnimation.setIfNotSet(()=>{this._blinkingEnabled=!0,this._updateDomClassName()},ik.BLINK_INTERVAL))}_updateDomClassName(){this._domNode.setClassName(this._getClassName())}_getClassName(){let e="cursors-layer";switch(this._selectionIsEmpty||(e+=" has-selection"),this._cursorStyle){case Wr.Line:e+=" cursor-line-style";break;case Wr.Block:e+=" cursor-block-style";break;case Wr.Underline:e+=" cursor-underline-style";break;case Wr.LineThin:e+=" cursor-line-thin-style";break;case Wr.BlockOutline:e+=" cursor-block-outline-style";break;case Wr.UnderlineThin:e+=" cursor-underline-thin-style";break;default:e+=" cursor-line-style"}if(this._blinkingEnabled)switch(this._getCursorBlinking()){case 1:e+=" cursor-blink";break;case 2:e+=" cursor-smooth";break;case 3:e+=" cursor-phase";break;case 4:e+=" cursor-expand";break;case 5: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=i.getColor(fbe);if(t){let n=i.getColor(hot);n||(n=t.opposite()),e.addRule(`.monaco-editor .cursors-layer .cursor { background-color: ${t}; border-color: ${t}; color: ${n}; }`),Hd(i.type)&&e.addRule(`.monaco-editor .cursors-layer.has-selection .cursor { border-left: 1px solid ${n}; border-right: 1px solid ${n}; }`)}});const u9=()=>{throw new Error("Invalid change accessor")};class Yrt extends gl{constructor(e){super(e);const t=this._context.configuration.options,n=t.get(143);this._lineHeight=t.get(66),this._contentWidth=n.contentWidth,this._contentLeft=n.contentLeft,this.domNode=ti(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=ti(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 o of e)t.set(o.id,o);let n=!1;return this._context.viewModel.changeWhitespace(o=>{const r=Object.keys(this._zones);for(let s=0,a=r.length;s{const o={addZone:r=>(t=!0,this._addZone(n,r)),removeZone:r=>{!r||(t=this._removeZone(n,r)||t)},layoutZone:r=>{!r||(t=this._layoutZone(n,r)||t)}};Zrt(e,o),o.addZone=u9,o.removeZone=u9,o.layoutZone=u9}),t}_addZone(e,t){const n=this._computeWhitespaceProps(t),r={whitespaceId:e.insertWhitespace(n.afterViewLineNumber,this._getZoneOrdinal(t),n.heightInPx,n.minWidthInPx),delegate:t,isInHiddenArea:n.isInHiddenArea,isVisible:!1,domNode:ti(t.domNode),marginDomNode:t.marginDomNode?ti(t.marginDomNode):null};return this._safeCallOnComputedHeight(r.delegate,n.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 n=this._zones[t];return delete this._zones[t],e.removeWhitespace(n.whitespaceId),n.domNode.removeAttribute("monaco-visible-view-zone"),n.domNode.removeAttribute("monaco-view-zone"),n.domNode.domNode.parentNode.removeChild(n.domNode.domNode),n.marginDomNode&&(n.marginDomNode.removeAttribute("monaco-visible-view-zone"),n.marginDomNode.removeAttribute("monaco-view-zone"),n.marginDomNode.domNode.parentNode.removeChild(n.marginDomNode.domNode)),this.setShouldRender(),!0}return!1}_layoutZone(e,t){if(this._zones.hasOwnProperty(t)){const n=this._zones[t],o=this._computeWhitespaceProps(n.delegate);return n.isInHiddenArea=o.isInHiddenArea,e.changeOneWhitespace(n.whitespaceId,o.afterViewLineNumber,o.heightInPx),this._safeCallOnComputedHeight(n.delegate,o.heightInPx),this.setShouldRender(),!0}return!1}shouldSuppressMouseDownOnViewZone(e){if(this._zones.hasOwnProperty(e)){const t=this._zones[e];return Boolean(t.delegate.suppressMouseDown)}return!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(n){en(n)}}_safeCallOnDomNodeTop(e,t){if(typeof e.onDomNodeTop=="function")try{e.onDomNodeTop(t)}catch(n){en(n)}}prepareRender(e){}render(e){const t=e.viewportData.whitespaceViewportData,n={};let o=!1;for(const s of t)this._zones[s.id].isInHiddenArea||(n[s.id]=s,o=!0);const r=Object.keys(this._zones);for(let s=0,a=r.length;sa)continue;const f=h.startLineNumber===a?h.startColumn:c.minColumn,g=h.endLineNumber===a?h.endColumn:c.maxColumn;f=R.endOffset&&(k++,R=n&&n[k]),N!==9&&N!==32||h&&!D&&P<=I)continue;if(d&&P>=E&&P<=I&&N===32){const H=P-1>=0?a.charCodeAt(P-1):0,W=P+1=0?a.charCodeAt(P-1):0;if(N===32&&H!==32&&H!==9)continue}if(n&&(!R||R.startOffset>P||R.endOffset<=P))continue;const M=e.visibleRangeForPosition(new ae(t,P+1));!M||(s?(A=Math.max(A,M.left),N===9?L+=this._renderArrow(f,v,M.left):L+=``):N===9?L+=`
${y?String.fromCharCode(65515):String.fromCharCode(8594)}
`:L+=`
${String.fromCharCode(w)}
`)}return s?(A=Math.round(A+v),``+L+""):L}_renderArrow(e,t,n){const o=t/7,r=t,s=e/2,a=n,l={x:0,y:o/2},c={x:100/125*r,y:l.y},u={x:c.x-.2*c.x,y:c.y+.2*c.x},d={x:u.x+.1*c.x,y:u.y+.1*c.x},h={x:d.x+.35*c.x,y:d.y-.35*c.x},f={x:h.x,y:-h.y},g={x:d.x,y:-d.y},p={x:u.x,y:-u.y},v={x:c.x,y:-c.y},m={x:l.x,y:-l.y};return``}render(e,t){if(!this._renderResult)return"";const n=t-e;return n<0||n>=this._renderResult.length?"":this._renderResult[n]}}class jre{constructor(e){const t=e.options,n=t.get(50),o=t.get(38);o==="off"?(this.renderWhitespace="none",this.renderWithSVG=!1):o==="svg"?(this.renderWhitespace=t.get(98),this.renderWithSVG=!0):(this.renderWhitespace=t.get(98),this.renderWithSVG=!1),this.spaceWidth=n.spaceWidth,this.middotWidth=n.middotWidth,this.wsmiddotWidth=n.wsmiddotWidth,this.canUseHalfwidthRightwardsArrow=n.canUseHalfwidthRightwardsArrow,this.lineHeight=t.get(66),this.stopRenderingLineAfter=t.get(116)}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}}var ist=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},ost=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let _H=class extends KI{constructor(e,t,n,o,r,s,a){super(),this._instantiationService=a,this._shouldRecomputeGlyphMarginLanes=!1,this._selections=[new gt(1,1,1,1)],this._renderAnimationFrame=null;const l=new drt(t,o,r,e);this._context=new Jrt(t,n,o),this._context.addEventHandler(this),this._viewParts=[],this._textAreaHandler=this._instantiationService.createInstance(pH,this._context,l,this._createTextAreaHandlerHelper()),this._viewParts.push(this._textAreaHandler),this._linesContent=ti(document.createElement("div")),this._linesContent.setClassName("lines-content monaco-editor-background"),this._linesContent.setPosition("absolute"),this.domNode=ti(document.createElement("div")),this.domNode.setClassName(this._getEditorClassName()),this.domNode.setAttribute("role","code"),this._overflowGuardContainer=ti(document.createElement("div")),mf.write(this._overflowGuardContainer,3),this._overflowGuardContainer.setClassName("overflow-guard"),this._scrollbar=new Crt(this._context,this._linesContent,this.domNode,this._overflowGuardContainer),this._viewParts.push(this._scrollbar),this._viewLines=new w5(this._context,this._linesContent),this._viewZones=new Yrt(this._context),this._viewParts.push(this._viewZones);const c=new Hrt(this._context);this._viewParts.push(c);const u=new jrt(this._context);this._viewParts.push(u);const d=new frt(this._context);this._viewParts.push(d),d.addDynamicOverlay(new vrt(this._context)),d.addDynamicOverlay(new wo(this._context)),d.addDynamicOverlay(new yrt(this._context)),d.addDynamicOverlay(new brt(this._context)),d.addDynamicOverlay(new nst(this._context));const h=new grt(this._context);this._viewParts.push(h),h.addDynamicOverlay(new _rt(this._context)),h.addDynamicOverlay(new Mrt(this._context)),h.addDynamicOverlay(new Rrt(this._context)),h.addDynamicOverlay(new ZI(this._context)),this._glyphMarginWidgets=new krt(this._context),this._viewParts.push(this._glyphMarginWidgets);const f=new eb(this._context);f.getDomNode().appendChild(this._viewZones.marginDomNode),f.getDomNode().appendChild(h.getDomNode()),f.getDomNode().appendChild(this._glyphMarginWidgets.domNode),this._viewParts.push(f),this._contentWidgets=new prt(this._context,this.domNode),this._viewParts.push(this._contentWidgets),this._viewCursors=new ik(this._context),this._viewParts.push(this._viewCursors),this._overlayWidgets=new Wrt(this._context),this._viewParts.push(this._overlayWidgets);const g=new Urt(this._context);this._viewParts.push(g);const p=new tst(this._context);this._viewParts.push(p);const v=new Brt(this._context);if(this._viewParts.push(v),c){const m=this._scrollbar.getOverviewRulerLayoutInfo();m.parent.insertBefore(c.getDomNode(),m.insertBefore)}this._linesContent.appendChild(d.getDomNode()),this._linesContent.appendChild(g.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(u.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(p.domNode),this.domNode.appendChild(this._overflowGuardContainer),s?s.appendChild(this._contentWidgets.overflowingContentWidgetsDomNode.domNode):this.domNode.appendChild(this._contentWidgets.overflowingContentWidgetsDomNode),this._applyLayout(),this._pointerHandler=this._register(new cot(this._context,l,this._createPointerHandlerHelper()))}_flushAccumulatedAndRenderNow(){this._shouldRecomputeGlyphMarginLanes&&(this._shouldRecomputeGlyphMarginLanes=!1,this._context.configuration.setGlyphMarginDecorationLaneCount(this._computeGlyphMarginLaneCount())),xm.onRenderStart(),this._renderNow()}_computeGlyphMarginLaneCount(){const e=this._context.viewModel.model;let t=[];t=t.concat(e.getAllMarginDecorations().map(r=>{var s,a;const l=(a=(s=r.options.glyphMargin)===null||s===void 0?void 0:s.position)!==null&&a!==void 0?a:Cw.Left;return{range:r.range,lane:l}})),t=t.concat(this._glyphMarginWidgets.getWidgets().map(r=>({range:e.validateRange(r.preference.range),lane:r.preference.lane}))),t.sort((r,s)=>V.compareRangesUsingStarts(r.range,s.range));let n=null,o=null;for(const r of t)if(r.lane===Cw.Left&&(!n||V.compareRangesUsingEnds(n,r.range)<0)&&(n=r.range),r.lane===Cw.Right&&(!o||V.compareRangesUsingEnds(o,r.range)<0)&&(o=r.range),n&&o){if(n.endLineNumber{this.focus()},dispatchTextAreaEvent:e=>{this._textAreaHandler.textArea.domNode.dispatchEvent(e)},getLastRenderData:()=>{const e=this._viewCursors.getLastRenderData()||[],t=this._textAreaHandler.getLastRenderData();return new Vit(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 ae(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(143);this.domNode.setWidth(t.width),this.domNode.setHeight(t.height),this._overflowGuardContainer.setWidth(t.width),this._overflowGuardContainer.setHeight(t.height),this._linesContent.setWidth(1e6),this._linesContent.setHeight(1e6)}_getEditorClassName(){const e=this._textAreaHandler.isFocused()?" focused":"";return this._context.configuration.options.get(140)+" "+gH(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(){this._renderAnimationFrame===null&&(this._renderAnimationFrame=zA(this._onRenderScheduled.bind(this),100))}_onRenderScheduled(){this._renderAnimationFrame=null,this._flushAccumulatedAndRenderNow()}_renderNow(){rst(()=>this._actualRender())}_getViewPartsToRender(){const e=[];let t=0;for(const n of this._viewParts)n.shouldRender()&&(e[t++]=n);return e}_actualRender(){if(!Zq(this.domNode.domNode))return;let e=this._getViewPartsToRender();if(!this._viewLines.shouldRender()&&e.length===0)return;const t=this._context.viewLayout.getLinesViewportData();this._context.viewModel.setViewport(t.startLineNumber,t.endLineNumber,t.centeredLineNumber);const n=new est(this._selections,t,this._context.viewLayout.getWhitespaceViewportData(),this._context.viewModel);this._contentWidgets.shouldRender()&&this._contentWidgets.onBeforeRender(n),this._viewLines.shouldRender()&&(this._viewLines.renderText(n),this._viewLines.onDidRender(),e=this._getViewPartsToRender());const o=new Mit(this._context.viewLayout,n,this._viewLines);for(const r of e)r.prepareRender(o);for(const r of e)r.render(o),r.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},1),this._context.viewModel.visibleLinesStabilized()}getOffsetForColumn(e,t){const n=this._context.viewModel.model.validatePosition({lineNumber:e,column:t}),o=this._context.viewModel.coordinatesConverter.convertModelPositionToViewPosition(n);this._flushAccumulatedAndRenderNow();const r=this._viewLines.visibleRangeForPosition(new ae(o.lineNumber,o.column));return r?r.left:-1}getTargetAtClientPoint(e,t){const n=this._pointerHandler.getTargetAtClientPoint(e,t);return n?b5.convertViewToModelMouseTarget(n,this._context.viewModel.coordinatesConverter):null}createOverviewRuler(e){return new zrt(this._context,e)}change(e){this._viewZones.changeViewZones(e),this._scheduleRender()}render(e,t){if(t){this._viewLines.forceShouldRender();for(const n of this._viewParts)n.forceShouldRender()}e?this._flushAccumulatedAndRenderNow():this._scheduleRender()}writeScreenReaderContent(e){this._textAreaHandler.writeScreenReaderContent(e)}focus(){this._textAreaHandler.focusTextArea()}isFocused(){return this._textAreaHandler.isFocused()}setAriaOptions(e){this._textAreaHandler.setAriaOptions(e)}addContentWidget(e){this._contentWidgets.addWidget(e.widget),this.layoutContentWidget(e),this._scheduleRender()}layoutContentWidget(e){var t,n,o,r,s,a,l,c;this._contentWidgets.setWidgetPosition(e.widget,(n=(t=e.position)===null||t===void 0?void 0:t.position)!==null&&n!==void 0?n:null,(r=(o=e.position)===null||o===void 0?void 0:o.secondaryPosition)!==null&&r!==void 0?r:null,(a=(s=e.position)===null||s===void 0?void 0:s.preference)!==null&&a!==void 0?a:null,(c=(l=e.position)===null||l===void 0?void 0:l.positionAffinity)!==null&&c!==void 0?c: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){const t=e.position?e.position.preference:null;this._overlayWidgets.setWidgetPosition(e.widget,t)&&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()}};_H=ist([ost(6,$t)],_H);function rst(i){try{return i()}catch(e){en(e)}}class Nbe{constructor(e,t,n,o,r,s){this.id=e,this.label=t,this.alias=n,this._precondition=o,this._run=r,this._contextKeyService=s}isSupported(){return this._contextKeyService.contextMatchesRules(this._precondition)}run(e){return this.isSupported()?this._run(e):Promise.resolve(void 0)}}function Dv(i){let e=0,t=0,n=0,o=0;for(let r=0,s=i.length;r=$l&&(t=t-i%$l),t}function ust(i,e){return i.reduce((t,n)=>so(t,e(n)),ra)}function Rbe(i,e){return i===e}function rk(i,e){const t=i,n=e;if(n-t<=0)return ra;const r=Math.floor(t/$l),s=Math.floor(n/$l),a=n-s*$l;if(r===s){const l=t-r*$l;return Io(0,a-l)}else return Io(s-r,a)}function Dw(i,e){return i=e}function HC(i){return Io(i.lineNumber-1,i.column-1)}function I0(i,e){const t=i,n=Math.floor(t/$l),o=t-n*$l,r=e,s=Math.floor(r/$l),a=r-s*$l;return new V(n+1,o+1,s+1,a+1)}function dst(i){const e=ff(i);return Io(e.length-1,e[e.length-1].length)}class Wg{static fromModelContentChanges(e){return e.map(n=>{const o=V.lift(n.range);return new Wg(HC(o.getStartPosition()),HC(o.getEndPosition()),dst(n.text))}).reverse()}constructor(e,t,n){this.startOffset=e,this.endOffset=t,this.newLength=n}toString(){return`[${Mc(this.startOffset)}...${Mc(this.endOffset)}) -> ${Mc(this.newLength)}`}}class hst{constructor(e){this.nextEditIdx=0,this.deltaOldToNewLineCount=0,this.deltaOldToNewColumnCount=0,this.deltaLineIdxInOld=-1,this.edits=e.map(t=>kG.from(t))}getOffsetBeforeChange(e){return this.adjustNextEdit(e),this.translateCurToOld(e)}getDistanceToNextChange(e){this.adjustNextEdit(e);const t=this.edits[this.nextEditIdx],n=t?this.translateOldToCur(t.offsetObj):null;return n===null?null:rk(e,n)}translateOldToCur(e){return e.lineCount===this.deltaLineIdxInOld?Io(e.lineCount+this.deltaOldToNewLineCount,e.columnCount+this.deltaOldToNewColumnCount):Io(e.lineCount+this.deltaOldToNewLineCount,e.columnCount)}translateCurToOld(e){const t=Mc(e);return t.lineCount-this.deltaOldToNewLineCount===this.deltaLineIdxInOld?Io(t.lineCount-this.deltaOldToNewLineCount,t.columnCount-this.deltaOldToNewColumnCount):Io(t.lineCount-this.deltaOldToNewLineCount,t.columnCount)}adjustNextEdit(e){for(;this.nextEditIdx>5;if(o===0){const s=1<this.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 n=0;for(;;){const r=this.lineTokens,s=r.getCount();let a=null;if(this.lineTokenOffset1e3))break;if(n>1500)break}const o=lst(e,t,this.lineIdx,this.lineCharOffset);return new cm(o,0,-1,qo.getEmpty(),new z_(o))}}class _st{constructor(e,t){this.text=e,this._offset=ra,this.idx=0;const n=t.getRegExpStr(),o=n?new RegExp(n+`| -`,"gi"):null,r=[];let s,a=0,l=0,c=0,u=0;const d=[];for(let g=0;g<60;g++)d.push(new cm(Io(0,g),0,-1,qo.getEmpty(),new z_(Io(0,g))));const h=[];for(let g=0;g<60;g++)h.push(new cm(Io(1,g),0,-1,qo.getEmpty(),new z_(Io(1,g))));if(o)for(o.lastIndex=0;(s=o.exec(e))!==null;){const g=s.index,p=s[0];if(p===` -`)a++,l=g+1;else{if(c!==g){let v;if(u===a){const m=g-c;if(mbst(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,n]of this.map)if(n.kind===2&&n.bracketIds.intersects(e))return t}get isEmpty(){return this.map.size===0}}function bst(i){let e=Gl(i);return/^[\w ]+/.test(i)&&(e=`\\b${e}`),/[\w ]+$/.test(i)&&(e=`${e}\\b`),e}class Pbe{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=NG.createFromLanguage(this.getLanguageConfiguration(e),this.denseKeyProvider),this.languageIdToBracketTokens.set(e,t)),t}}function Cst(i){if(i.length===0)return null;if(i.length===1)return i[0];let e=0;function t(){if(e>=i.length)return null;const s=e,a=i[s].listHeight;for(e++;e=2?Obe(s===0&&e===i.length?i:i.slice(s,e),!1):i[s]}let n=t(),o=t();if(!o)return n;for(let s=t();s;s=t())Gre(n,o)<=Gre(o,s)?(n=d9(n,o),o=s):o=d9(o,s);return d9(n,o)}function Obe(i,e=!1){if(i.length===0)return null;if(i.length===1)return i[0];let t=i.length;for(;t>3;){const n=t>>1;for(let o=0;o=3?i[2]:null,e)}function Gre(i,e){return Math.abs(i.listHeight-e.listHeight)}function d9(i,e){return i.listHeight===e.listHeight?vf.create23(i,e,null,!1):i.listHeight>e.listHeight?wst(i,e):yst(e,i)}function wst(i,e){i=i.toMutable();let t=i;const n=[];let o;for(;;){if(e.listHeight===t.listHeight){o=e;break}if(t.kind!==4)throw new Error("unexpected");n.push(t),t=t.makeLastElementMutable()}for(let r=n.length-1;r>=0;r--){const s=n[r];o?s.childrenLength>=3?o=vf.create23(s.unappendChild(),o,null,!1):(s.appendChildOfSameHeight(o),o=void 0):s.handleChildrenChanged()}return o?vf.create23(i,o,null,!1):i}function yst(i,e){i=i.toMutable();let t=i;const n=[];for(;e.listHeight!==t.listHeight;){if(t.kind!==4)throw new Error("unexpected");n.push(t),t=t.makeFirstElementMutable()}let o=e;for(let r=n.length-1;r>=0;r--){const s=n[r];o?s.childrenLength>=3?o=vf.create23(o,s.unprependChild(),null,!1):(s.prependChildOfSameHeight(o),o=void 0):s.handleChildrenChanged()}return o?vf.create23(o,i,null,!1):i}class Sst{constructor(e){this.lastOffset=ra,this.nextNodes=[e],this.offsets=[ra],this.idxs=[]}readLongestNodeAt(e,t){if(Dw(e,this.lastOffset))throw new Error("Invalid offset");for(this.lastOffset=e;;){const n=Wx(this.nextNodes);if(!n)return;const o=Wx(this.offsets);if(Dw(e,o))return;if(Dw(o,e))if(so(o,n.length)<=e)this.nextNodeAfterCurrent();else{const r=h9(n);r!==-1?(this.nextNodes.push(n.getChild(r)),this.offsets.push(o),this.idxs.push(r)):this.nextNodeAfterCurrent()}else{if(t(n))return this.nextNodeAfterCurrent(),n;{const r=h9(n);if(r===-1){this.nextNodeAfterCurrent();return}else this.nextNodes.push(n.getChild(r)),this.offsets.push(o),this.idxs.push(r)}}}}nextNodeAfterCurrent(){for(;;){const e=Wx(this.offsets),t=Wx(this.nextNodes);if(this.nextNodes.pop(),this.offsets.pop(),this.idxs.length===0)break;const n=Wx(this.nextNodes),o=h9(n,this.idxs[this.idxs.length-1]);if(o!==-1){this.nextNodes.push(n.getChild(o)),this.offsets.push(so(e,t.length)),this.idxs[this.idxs.length-1]=o;break}else this.idxs.pop()}}}function h9(i,e=-1){for(;;){if(e++,e>=i.childrenLength)return-1;if(i.getChild(e))return e}}function Wx(i){return i.length>0?i[i.length-1]:void 0}function bH(i,e,t,n){return new xst(i,e,t,n).parseDocument()}class xst{constructor(e,t,n,o){if(this.tokenizer=e,this.createImmutableLists=o,this._itemsConstructed=0,this._itemsFromCache=0,n&&o)throw new Error("Not supported");this.oldNodeReader=n?new Sst(n):void 0,this.positionMapper=new hst(t)}parseDocument(){this._itemsConstructed=0,this._itemsFromCache=0;let e=this.parseList(qo.getEmpty(),0);return e||(e=vf.getEmpty()),e}parseList(e,t){const n=[];for(;;){let r=this.tryReadChildFromCache(e);if(!r){const s=this.tokenizer.peek();if(!s||s.kind===2&&s.bracketIds.intersects(e))break;r=this.parseChild(e,t+1)}r.kind===4&&r.childrenLength===0||n.push(r)}return this.oldNodeReader?Cst(n):Obe(n,this.createImmutableLists)}tryReadChildFromCache(e){if(this.oldNodeReader){const t=this.positionMapper.getDistanceToNextChange(this.tokenizer.offset);if(t===null||!dP(t)){const n=this.oldNodeReader.readLongestNodeAt(this.positionMapper.getOffsetBeforeChange(this.tokenizer.offset),o=>t!==null&&!Dw(o.length,t)?!1:o.canBeReused(e));if(n)return this._itemsFromCache++,this.tokenizer.skip(n.length),n}}}parseChild(e,t){this._itemsConstructed++;const n=this.tokenizer.read();switch(n.kind){case 2:return new mst(n.bracketIds,n.length);case 0:return n.astNode;case 1:{if(t>300)return new z_(n.length);const o=e.merge(n.bracketIds),r=this.parseList(o,t+1),s=this.tokenizer.peek();return s&&s.kind===2&&(s.bracketId===n.bracketId||s.bracketIds.intersects(n.bracketIds))?(this.tokenizer.read(),sk.create(n.astNode,r,s.astNode)):sk.create(n.astNode,r,null)}default:throw new Error("unexpected")}}}function gP(i,e){if(i.length===0)return e;if(e.length===0)return i;const t=new rp(Xre(i)),n=Xre(e);n.push({modified:!1,lengthBefore:void 0,lengthAfter:void 0});let o=t.dequeue();function r(c){if(c===void 0){const d=t.takeWhile(h=>!0)||[];return o&&d.unshift(o),d}const u=[];for(;o&&!dP(c);){const[d,h]=o.splitAt(c);u.push(d),c=rk(d.lengthAfter,c),o=h!=null?h:t.dequeue()}return dP(c)||u.push(new Lm(!1,c,c)),u}const s=[];function a(c,u,d){if(s.length>0&&Rbe(s[s.length-1].endOffset,c)){const h=s[s.length-1];s[s.length-1]=new Wg(h.startOffset,u,so(h.newLength,d))}else s.push({startOffset:c,endOffset:u,newLength:d})}let l=ra;for(const c of n){const u=r(c.lengthBefore);if(c.modified){const d=ust(u,f=>f.lengthBefore),h=so(l,d);a(l,h,c.lengthAfter),l=h}else for(const d of u){const h=l;l=so(l,d.lengthBefore),d.modified&&a(h,l,d.lengthAfter)}}return s}class Lm{constructor(e,t,n){this.modified=e,this.lengthBefore=t,this.lengthAfter=n}splitAt(e){const t=rk(e,this.lengthAfter);return Rbe(t,ra)?[this,void 0]:this.modified?[new Lm(this.modified,this.lengthBefore,e),new Lm(this.modified,ra,t)]:[new Lm(this.modified,e,e),new Lm(this.modified,t,t)]}toString(){return`${this.modified?"M":"U"}:${Mc(this.lengthBefore)} -> ${Mc(this.lengthAfter)}`}}function Xre(i){const e=[];let t=ra;for(const n of i){const o=rk(t,n.startOffset);dP(o)||e.push(new Lm(!1,o,o));const r=rk(n.startOffset,n.endOffset);e.push(new Lm(!0,r,n.newLength)),t=n.endOffset}return e}class Lst extends _e{didLanguageChange(e){return this.brackets.didLanguageChange(e)}constructor(e,t){if(super(),this.textModel=e,this.getLanguageConfiguration=t,this.didChangeEmitter=new le,this.denseKeyProvider=new Mbe,this.brackets=new Pbe(this.denseKeyProvider,this.getLanguageConfiguration),this.onDidChange=this.didChangeEmitter.event,this.queuedTextEditsForInitialAstWithoutTokens=[],this.queuedTextEdits=[],e.tokenization.hasTokens)e.tokenization.backgroundTokenizationState===2?(this.initialAstWithoutTokens=void 0,this.astWithTokens=this.parseDocumentFromTextBuffer([],void 0,!1)):(this.initialAstWithoutTokens=this.parseDocumentFromTextBuffer([],void 0,!0),this.astWithTokens=this.initialAstWithoutTokens);else{const n=this.brackets.getSingleLanguageBracketTokens(this.textModel.getLanguageId()),o=new _st(this.textModel.getValue(),n);this.initialAstWithoutTokens=bH(o,[],void 0,!0),this.astWithTokens=this.initialAstWithoutTokens}}handleDidChangeBackgroundTokenizationState(){if(this.textModel.tokenization.backgroundTokenizationState===2){const e=this.initialAstWithoutTokens===void 0;this.initialAstWithoutTokens=void 0,e||this.didChangeEmitter.fire()}}handleDidChangeTokens({ranges:e}){const t=e.map(n=>new Wg(Io(n.fromLineNumber-1,0),Io(n.toLineNumber,0),Io(n.toLineNumber-n.fromLineNumber+1,0)));this.handleEdits(t,!0),this.initialAstWithoutTokens||this.didChangeEmitter.fire()}handleContentChanged(e){const t=Wg.fromModelContentChanges(e.changes);this.handleEdits(t,!1)}handleEdits(e,t){const n=gP(this.queuedTextEdits,e);this.queuedTextEdits=n,this.initialAstWithoutTokens&&!t&&(this.queuedTextEditsForInitialAstWithoutTokens=gP(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,n){const o=t,r=new Abe(this.textModel,this.brackets);return bH(r,e,o,n)}getBracketsInRange(e,t){this.flushQueue();const n=Io(e.startLineNumber-1,e.startColumn-1),o=Io(e.endLineNumber-1,e.endColumn-1);return new rf(r=>{const s=this.initialAstWithoutTokens||this.astWithTokens;CH(s,ra,s.length,n,o,r,0,0,new Map,t)})}getBracketPairsInRange(e,t){this.flushQueue();const n=HC(e.getStartPosition()),o=HC(e.getEndPosition());return new rf(r=>{const s=this.initialAstWithoutTokens||this.astWithTokens,a=new Est(r,t,this.textModel);wH(s,ra,s.length,n,o,a,0,new Map)})}getFirstBracketAfter(e){this.flushQueue();const t=this.initialAstWithoutTokens||this.astWithTokens;return Bbe(t,ra,t.length,HC(e))}getFirstBracketBefore(e){this.flushQueue();const t=this.initialAstWithoutTokens||this.astWithTokens;return Fbe(t,ra,t.length,HC(e))}}function Fbe(i,e,t,n){if(i.kind===4||i.kind===2){const o=[];for(const r of i.children)t=so(e,r.length),o.push({nodeOffsetStart:e,nodeOffsetEnd:t}),e=t;for(let r=o.length-1;r>=0;r--){const{nodeOffsetStart:s,nodeOffsetEnd:a}=o[r];if(Dw(s,n)){const l=Fbe(i.children[r],s,a,n);if(l)return l}}return null}else{if(i.kind===3)return null;if(i.kind===1){const o=I0(e,t);return{bracketInfo:i.bracketInfo,range:o}}}return null}function Bbe(i,e,t,n){if(i.kind===4||i.kind===2){for(const o of i.children){if(t=so(e,o.length),Dw(n,t)){const r=Bbe(o,e,t,n);if(r)return r}e=t}return null}else{if(i.kind===3)return null;if(i.kind===1){const o=I0(e,t);return{bracketInfo:i.bracketInfo,range:o}}}return null}function CH(i,e,t,n,o,r,s,a,l,c,u=!1){if(s>200)return!0;e:for(;;)switch(i.kind){case 4:{const d=i.childrenLength;for(let h=0;h200)return!0;let c=!0;if(i.kind===2){let u=0;if(a){let f=a.get(i.openingBracket.text);f===void 0&&(f=0),u=f,f++,a.set(i.openingBracket.text,f)}const d=so(e,i.openingBracket.length);let h=-1;if(r.includeMinIndentation&&(h=i.computeMinIndentation(e,r.textModel)),c=r.push(new ast(I0(e,t),I0(e,d),i.closingBracket?I0(so(d,((l=i.child)===null||l===void 0?void 0:l.length)||ra),t):void 0,s,u,i,h)),e=d,c&&i.child){const f=i.child;if(t=so(e,f.length),kw(e,o)&&LL(t,n)&&(c=wH(f,e,t,n,o,r,s+1,a),!c))return!1}a==null||a.set(i.openingBracket.text,u)}else{let u=e;for(const d of i.children){const h=u;if(u=so(u,d.length),kw(h,o)&&kw(n,u)&&(c=wH(d,h,u,n,o,r,s,a),!c))return!1}}return c}class Dst extends _e{get canBuildAST(){return this.textModel.getValueLength()<=5e6}constructor(e,t){super(),this.textModel=e,this.languageConfigurationService=t,this.bracketPairsTree=this._register(new Kr),this.onDidChangeEmitter=new le,this.onDidChange=this.onDidChangeEmitter.event,this.bracketsRequested=!1,this._register(this.languageConfigurationService.onDidChange(n=>{var o;(!n.languageId||((o=this.bracketPairsTree.value)===null||o===void 0?void 0:o.object.didLanguageChange(n.languageId)))&&(this.bracketPairsTree.clear(),this.updateBracketPairsTree())}))}handleDidChangeOptions(e){this.bracketPairsTree.clear(),this.updateBracketPairsTree()}handleDidChangeLanguage(e){this.bracketPairsTree.clear(),this.updateBracketPairsTree()}handleDidChangeContent(e){var t;(t=this.bracketPairsTree.value)===null||t===void 0||t.object.handleContentChanged(e)}handleDidChangeBackgroundTokenizationState(){var e;(e=this.bracketPairsTree.value)===null||e===void 0||e.object.handleDidChangeBackgroundTokenizationState()}handleDidChangeTokens(e){var t;(t=this.bracketPairsTree.value)===null||t===void 0||t.object.handleDidChangeTokens(e)}updateBracketPairsTree(){if(this.bracketsRequested&&this.canBuildAST){if(!this.bracketPairsTree.value){const e=new Be;this.bracketPairsTree.value=kst(e.add(new Lst(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){var t;return this.bracketsRequested=!0,this.updateBracketPairsTree(),((t=this.bracketPairsTree.value)===null||t===void 0?void 0:t.object.getBracketPairsInRange(e,!1))||rf.empty}getBracketPairsInRangeWithMinIndentation(e){var t;return this.bracketsRequested=!0,this.updateBracketPairsTree(),((t=this.bracketPairsTree.value)===null||t===void 0?void 0:t.object.getBracketPairsInRange(e,!0))||rf.empty}getBracketsInRange(e,t=!1){var n;return this.bracketsRequested=!0,this.updateBracketPairsTree(),((n=this.bracketPairsTree.value)===null||n===void 0?void 0:n.object.getBracketsInRange(e,t))||rf.empty}findMatchingBracketUp(e,t,n){const o=this.textModel.validatePosition(t),r=this.textModel.getLanguageIdAtPosition(o.lineNumber,o.column);if(this.canBuildAST){const s=this.languageConfigurationService.getLanguageConfiguration(r).bracketsNew.getClosingBracketInfo(e);if(!s)return null;const a=this.getBracketPairsInRange(V.fromPositions(t,t)).findLast(l=>s.closes(l.openingBracketInfo));return a?a.openingBracketRange:null}else{const s=e.toLowerCase(),a=this.languageConfigurationService.getLanguageConfiguration(r).brackets;if(!a)return null;const l=a.textIsBracket[s];return l?m2(this._findMatchingBracketUp(l,o,f9(n))):null}}matchBracket(e,t){if(this.canBuildAST){const n=this.getBracketPairsInRange(V.fromPositions(e,e)).filter(o=>o.closingBracketRange!==void 0&&(o.openingBracketRange.containsPosition(e)||o.closingBracketRange.containsPosition(e))).findLastMaxBy(Nc(o=>o.openingBracketRange.containsPosition(e)?o.openingBracketRange:o.closingBracketRange,V.compareRangesUsingStarts));return n?[n.openingBracketRange,n.closingBracketRange]:null}else{const n=f9(t);return this._matchBracket(this.textModel.validatePosition(e),n)}}_establishBracketSearchOffsets(e,t,n,o){const r=t.getCount(),s=t.getLanguageId(o);let a=Math.max(0,e.column-1-n.maxBracketLength);for(let c=o-1;c>=0;c--){const u=t.getEndOffset(c);if(u<=a)break;if(_h(t.getStandardTokenType(c))||t.getLanguageId(c)!==s){a=u;break}}let l=Math.min(t.getLineContent().length,e.column-1+n.maxBracketLength);for(let c=o+1;c=l)break;if(_h(t.getStandardTokenType(c))||t.getLanguageId(c)!==s){l=u;break}}return{searchStartOffset:a,searchEndOffset:l}}_matchBracket(e,t){const n=e.lineNumber,o=this.textModel.tokenization.getLineTokens(n),r=this.textModel.getLineContent(n),s=o.findTokenIndexAtOffset(e.column-1);if(s<0)return null;const a=this.languageConfigurationService.getLanguageConfiguration(o.getLanguageId(s)).brackets;if(a&&!_h(o.getStandardTokenType(s))){let{searchStartOffset:l,searchEndOffset:c}=this._establishBracketSearchOffsets(e,o,a,s),u=null;for(;;){const d=du.findNextBracketInRange(a.forwardRegex,n,r,l,c);if(!d)break;if(d.startColumn<=e.column&&e.column<=d.endColumn){const h=r.substring(d.startColumn-1,d.endColumn-1).toLowerCase(),f=this._matchFoundBracket(d,a.textIsBracket[h],a.textIsOpenBracket[h],t);if(f){if(f instanceof fg)return null;u=f}}l=d.endColumn-1}if(u)return u}if(s>0&&o.getStartOffset(s)===e.column-1){const l=s-1,c=this.languageConfigurationService.getLanguageConfiguration(o.getLanguageId(l)).brackets;if(c&&!_h(o.getStandardTokenType(l))){const{searchStartOffset:u,searchEndOffset:d}=this._establishBracketSearchOffsets(e,o,c,l),h=du.findPrevBracketInRange(c.reversedRegex,n,r,u,d);if(h&&h.startColumn<=e.column&&e.column<=h.endColumn){const f=r.substring(h.startColumn-1,h.endColumn-1).toLowerCase(),g=this._matchFoundBracket(h,c.textIsBracket[f],c.textIsOpenBracket[f],t);if(g)return g instanceof fg?null:g}}}return null}_matchFoundBracket(e,t,n,o){if(!t)return null;const r=n?this._findMatchingBracketDown(t,e.getEndPosition(),o):this._findMatchingBracketUp(t,e.getStartPosition(),o);return r?r instanceof fg?r:[e,r]:null}_findMatchingBracketUp(e,t,n){const o=e.languageId,r=e.reversedRegex;let s=-1,a=0;const l=(c,u,d,h)=>{for(;;){if(n&&++a%100===0&&!n())return fg.INSTANCE;const f=du.findPrevBracketInRange(r,c,u,d,h);if(!f)break;const g=u.substring(f.startColumn-1,f.endColumn-1).toLowerCase();if(e.isOpen(g)?s++:e.isClose(g)&&s--,s===0)return f;h=f.startColumn-1}return null};for(let c=t.lineNumber;c>=1;c--){const u=this.textModel.tokenization.getLineTokens(c),d=u.getCount(),h=this.textModel.getLineContent(c);let f=d-1,g=h.length,p=h.length;c===t.lineNumber&&(f=u.findTokenIndexAtOffset(t.column-1),g=t.column-1,p=t.column-1);let v=!0;for(;f>=0;f--){const m=u.getLanguageId(f)===o&&!_h(u.getStandardTokenType(f));if(m)v?g=u.getStartOffset(f):(g=u.getStartOffset(f),p=u.getEndOffset(f));else if(v&&g!==p){const _=l(c,h,g,p);if(_)return _}v=m}if(v&&g!==p){const m=l(c,h,g,p);if(m)return m}}return null}_findMatchingBracketDown(e,t,n){const o=e.languageId,r=e.forwardRegex;let s=1,a=0;const l=(u,d,h,f)=>{for(;;){if(n&&++a%100===0&&!n())return fg.INSTANCE;const g=du.findNextBracketInRange(r,u,d,h,f);if(!g)break;const p=d.substring(g.startColumn-1,g.endColumn-1).toLowerCase();if(e.isOpen(p)?s++:e.isClose(p)&&s--,s===0)return g;h=g.endColumn-1}return null},c=this.textModel.getLineCount();for(let u=t.lineNumber;u<=c;u++){const d=this.textModel.tokenization.getLineTokens(u),h=d.getCount(),f=this.textModel.getLineContent(u);let g=0,p=0,v=0;u===t.lineNumber&&(g=d.findTokenIndexAtOffset(t.column-1),p=t.column-1,v=t.column-1);let m=!0;for(;g=1;a--){const l=this.textModel.tokenization.getLineTokens(a),c=l.getCount(),u=this.textModel.getLineContent(a);let d=c-1,h=u.length,f=u.length;if(a===n.lineNumber){d=l.findTokenIndexAtOffset(n.column-1),h=n.column-1,f=n.column-1;const p=l.getLanguageId(d);o!==p&&(o=p,r=this.languageConfigurationService.getLanguageConfiguration(o).brackets,s=this.languageConfigurationService.getLanguageConfiguration(o).bracketsNew)}let g=!0;for(;d>=0;d--){const p=l.getLanguageId(d);if(o!==p){if(r&&s&&g&&h!==f){const m=du.findPrevBracketInRange(r.reversedRegex,a,u,h,f);if(m)return this._toFoundBracket(s,m);g=!1}o=p,r=this.languageConfigurationService.getLanguageConfiguration(o).brackets,s=this.languageConfigurationService.getLanguageConfiguration(o).bracketsNew}const v=!!r&&!_h(l.getStandardTokenType(d));if(v)g?h=l.getStartOffset(d):(h=l.getStartOffset(d),f=l.getEndOffset(d));else if(s&&r&&g&&h!==f){const m=du.findPrevBracketInRange(r.reversedRegex,a,u,h,f);if(m)return this._toFoundBracket(s,m)}g=v}if(s&&r&&g&&h!==f){const p=du.findPrevBracketInRange(r.reversedRegex,a,u,h,f);if(p)return this._toFoundBracket(s,p)}}return null}findNextBracket(e){var t;const n=this.textModel.validatePosition(e);if(this.canBuildAST)return this.bracketsRequested=!0,this.updateBracketPairsTree(),((t=this.bracketPairsTree.value)===null||t===void 0?void 0:t.object.getFirstBracketAfter(n))||null;const o=this.textModel.getLineCount();let r=null,s=null,a=null;for(let l=n.lineNumber;l<=o;l++){const c=this.textModel.tokenization.getLineTokens(l),u=c.getCount(),d=this.textModel.getLineContent(l);let h=0,f=0,g=0;if(l===n.lineNumber){h=c.findTokenIndexAtOffset(n.column-1),f=n.column-1,g=n.column-1;const v=c.getLanguageId(h);r!==v&&(r=v,s=this.languageConfigurationService.getLanguageConfiguration(r).brackets,a=this.languageConfigurationService.getLanguageConfiguration(r).bracketsNew)}let p=!0;for(;hp.closingBracketRange!==void 0&&p.range.strictContainsRange(f));return g?[g.openingBracketRange,g.closingBracketRange]:null}const o=f9(t),r=this.textModel.getLineCount(),s=new Map;let a=[];const l=(f,g)=>{if(!s.has(f)){const p=[];for(let v=0,m=g?g.brackets.length:0;v{for(;;){if(o&&++c%100===0&&!o())return fg.INSTANCE;const _=du.findNextBracketInRange(f.forwardRegex,g,p,v,m);if(!_)break;const w=p.substring(_.startColumn-1,_.endColumn-1).toLowerCase(),y=f.textIsBracket[w];if(y&&(y.isOpen(w)?a[y.index]++:y.isClose(w)&&a[y.index]--,a[y.index]===-1))return this._matchFoundBracket(_,y,!1,o);v=_.endColumn-1}return null};let d=null,h=null;for(let f=n.lineNumber;f<=r;f++){const g=this.textModel.tokenization.getLineTokens(f),p=g.getCount(),v=this.textModel.getLineContent(f);let m=0,_=0,w=0;if(f===n.lineNumber){m=g.findTokenIndexAtOffset(n.column-1),_=n.column-1,w=n.column-1;const L=g.getLanguageId(m);d!==L&&(d=L,h=this.languageConfigurationService.getLanguageConfiguration(d).brackets,l(d,h))}let y=!0;for(;me==null?void 0:e.dispose()}}function f9(i){if(typeof i=="undefined")return()=>!0;{const e=Date.now();return()=>Date.now()-e<=i}}class fg{constructor(){this._searchCanceledBrand=void 0}}fg.INSTANCE=new fg;function m2(i){return i instanceof fg?null:i}class Ist extends _e{constructor(e){super(),this.textModel=e,this.colorProvider=new Wbe,this.onDidChangeEmitter=new le,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,n,o){return o?[]:t===void 0?[]:this.colorizationOptions.enabled?this.textModel.bracketPairs.getBracketsInRange(e,!0).map(s=>({id:`bracket${s.range.toString()}-${s.nestingLevel}`,options:{description:"BracketPairColorization",inlineClassName:this.colorProvider.getInlineClassName(s,this.colorizationOptions.independentColorPoolPerBracketType)},ownerId:0,range:s.range})).toArray():[]}getAllDecorations(e,t){return e===void 0?[]:this.colorizationOptions.enabled?this.getDecorationsInRange(new V(1,1,this.textModel.getLineCount(),1),e,t):[]}}class Wbe{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}`}}Uu((i,e)=>{const t=[pbe,mbe,vbe,_be,bbe,Cbe],n=new Wbe;e.addRule(`.monaco-editor .${n.unexpectedClosingBracketClassName} { color: ${i.getColor(Not)}; }`);const o=t.map(r=>i.getColor(r)).filter(r=>!!r).filter(r=>!r.isTransparent());for(let r=0;r<30;r++){const s=o[r%o.length];e.addRule(`.monaco-editor .${n.getInlineClassNameOfLevel(r)} { color: ${s}; }`)}});function v2(i){return i.replace(/\n/g,"\\n").replace(/\r/g,"\\r")}class Jr{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,n,o){this.oldPosition=e,this.oldText=t,this.newPosition=n,this.newText=o}toString(){return this.oldText.length===0?`(insert@${this.oldPosition} "${v2(this.newText)}")`:this.newText.length===0?`(delete@${this.oldPosition} "${v2(this.oldText)}")`:`(replace@${this.oldPosition} "${v2(this.oldText)}" with "${v2(this.newText)}")`}static _writeStringSize(e){return 4+2*e.length}static _writeString(e,t,n){const o=t.length;dd(e,o,n),n+=4;for(let r=0;ri.length)return!1;if(t){if(!Vq(i,e))return!1;if(e.length===i.length)return!0;let r=e.length;return e.charAt(e.length-1)===n&&r--,i.charAt(r)===n}return e.charAt(e.length-1)!==n&&(e+=n),i.indexOf(e)===0}function Hbe(i){return i>=65&&i<=90||i>=97&&i<=122}function Rst(i,e=as){return e?Hbe(i.charCodeAt(0))&&i.charCodeAt(1)===58:!1}function bh(i){return OA(i,!0)}class RG{constructor(e){this._ignorePathCasing=e}compare(e,t,n=!1){return e===t?0:RD(this.getComparisonKey(e,n),this.getComparisonKey(t,n))}isEqual(e,t,n=!1){return e===t?!0:!e||!t?!1:this.getComparisonKey(e,n)===this.getComparisonKey(t,n)}getComparisonKey(e,t=!1){return e.with({path:this._ignorePathCasing(e)?e.path.toLowerCase():void 0,fragment:t?null:void 0}).toString()}isEqualOrParent(e,t,n=!1){if(e.scheme===t.scheme){if(e.scheme===hn.file)return yH(bh(e),bh(t),this._ignorePathCasing(e))&&e.query===t.query&&(n||e.fragment===t.fragment);if(Qre(e.authority,t.authority))return yH(e.path,t.path,this._ignorePathCasing(e),"/")&&e.query===t.query&&(n||e.fragment===t.fragment)}return!1}joinPath(e,...t){return Rt.joinPath(e,...t)}basenameOrAuthority(e){return Hc(e)||e.authority}basename(e){return Go.basename(e.path)}extname(e){return Go.extname(e.path)}dirname(e){if(e.path.length===0)return e;let t;return e.scheme===hn.file?t=Rt.file(L_e(bh(e))).path:(t=Go.dirname(e.path),e.authority&&t.length&&t.charCodeAt(0)!==47&&(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===hn.file?t=Rt.file(x_e(bh(e))).path:t=Go.normalize(e.path),e.with({path:t})}relativePath(e,t){if(e.scheme!==t.scheme||!Qre(e.authority,t.authority))return;if(e.scheme===hn.file){const r=WYe(bh(e),bh(t));return as?Vbe(r):r}let n=e.path||"/";const o=t.path||"/";if(this._ignorePathCasing(e)){let r=0;for(const s=Math.min(n.length,o.length);rYre(n).length&&n[n.length-1]===t}else{const n=e.path;return n.length>1&&n.charCodeAt(n.length-1)===47&&!/^[a-zA-Z]:(\/$|\\$)/.test(e.fsPath)}}removeTrailingPathSeparator(e,t=Bd){return Jre(e,t)?e.with({path:e.path.substr(0,e.path.length-1)}):e}addTrailingPathSeparator(e,t=Bd){let n=!1;if(e.scheme===hn.file){const o=bh(e);n=o!==void 0&&o.length===Yre(o).length&&o[o.length-1]===t}else{t="/";const o=e.path;n=o.length===1&&o.charCodeAt(o.length-1)===47}return!n&&!Jre(e,t)?e.with({path:e.path+"/"}):e}}const Vi=new RG(()=>!1);new RG(i=>i.scheme===hn.file?!Ss:!0);new RG(i=>!0);const MG=Vi.isEqual.bind(Vi);Vi.isEqualOrParent.bind(Vi);Vi.getComparisonKey.bind(Vi);const Mst=Vi.basenameOrAuthority.bind(Vi),Hc=Vi.basename.bind(Vi),Ast=Vi.extname.bind(Vi),y5=Vi.dirname.bind(Vi),Pst=Vi.joinPath.bind(Vi),Ost=Vi.normalizePath.bind(Vi),Fst=Vi.relativePath.bind(Vi),Zre=Vi.resolvePath.bind(Vi);Vi.isAbsolutePath.bind(Vi);const Qre=Vi.isEqualAuthority.bind(Vi),Jre=Vi.hasTrailingPathSeparator.bind(Vi);Vi.removeTrailingPathSeparator.bind(Vi);Vi.addTrailingPathSeparator.bind(Vi);var kv;(function(i){i.META_DATA_LABEL="label",i.META_DATA_DESCRIPTION="description",i.META_DATA_SIZE="size",i.META_DATA_MIME="mime";function e(t){const n=new Map;t.path.substring(t.path.indexOf(";")+1,t.path.lastIndexOf(";")).split(";").forEach(s=>{const[a,l]=s.split(":");a&&l&&n.set(a,l)});const r=t.path.substring(0,t.path.indexOf(";"));return r&&n.set(i.META_DATA_MIME,r),n}i.parseMetaData=e})(kv||(kv={}));function U1(i){return i.toString()}class Cr{static create(e,t){const n=e.getAlternativeVersionId(),o=SH(e);return new Cr(n,n,o,o,t,t,[])}constructor(e,t,n,o,r,s,a){this.beforeVersionId=e,this.afterVersionId=t,this.beforeEOL=n,this.afterEOL=o,this.beforeCursorState=r,this.afterCursorState=s,this.changes=a}append(e,t,n,o,r){t.length>0&&(this.changes=Tst(this.changes,t)),this.afterEOL=n,this.afterVersionId=o,this.afterCursorState=r}static _writeSelectionsSize(e){return 4+4*4*(e?e.length:0)}static _writeSelections(e,t,n){if(dd(e,t?t.length:0,n),n+=4,t)for(const o of t)dd(e,o.selectionStartLineNumber,n),n+=4,dd(e,o.selectionStartColumn,n),n+=4,dd(e,o.positionLineNumber,n),n+=4,dd(e,o.positionColumn,n),n+=4;return n}static _readSelections(e,t,n){const o=ud(e,t);t+=4;for(let r=0;rt.toString()).join(", ")}matchesResource(e){return(Rt.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 Cr}append(e,t,n,o,r){this._data instanceof Cr&&this._data.append(e,t,n,o,r)}close(){this._data instanceof Cr&&(this._data=this._data.serialize())}open(){this._data instanceof Cr||(this._data=Cr.deserialize(this._data))}undo(){if(Rt.isUri(this.model))throw new Error("Invalid SingleModelEditStackElement");this._data instanceof Cr&&(this._data=this._data.serialize());const e=Cr.deserialize(this._data);this.model._applyUndo(e.changes,e.beforeEOL,e.beforeVersionId,e.beforeCursorState)}redo(){if(Rt.isUri(this.model))throw new Error("Invalid SingleModelEditStackElement");this._data instanceof Cr&&(this._data=this._data.serialize());const e=Cr.deserialize(this._data);this.model._applyRedo(e.changes,e.afterEOL,e.afterVersionId,e.afterCursorState)}heapSize(){return this._data instanceof Cr&&(this._data=this._data.serialize()),this._data.byteLength+168}}class Bst{get resources(){return this._editStackElementsArr.map(e=>e.resource)}constructor(e,t,n){this.label=e,this.code=t,this.type=1,this._isOpen=!0,this._editStackElementsArr=n.slice(0),this._editStackElementsMap=new Map;for(const o of this._editStackElementsArr){const r=U1(o.resource);this._editStackElementsMap.set(r,o)}this._delegate=null}prepareUndoRedo(){if(this._delegate)return this._delegate.prepareUndoRedo(this)}matchesResource(e){const t=U1(e);return this._editStackElementsMap.has(t)}setModel(e){const t=U1(Rt.isUri(e)?e:e.uri);this._editStackElementsMap.has(t)&&this._editStackElementsMap.get(t).setModel(e)}canAppend(e){if(!this._isOpen)return!1;const t=U1(e.uri);return this._editStackElementsMap.has(t)?this._editStackElementsMap.get(t).canAppend(e):!1}append(e,t,n,o,r){const s=U1(e.uri);this._editStackElementsMap.get(s).append(e,t,n,o,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=U1(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(`${Hc(t.resource)}: ${t}`);return`{${e.join(", ")}}`}}function SH(i){return i.getEOL()===` -`?0:1}function gg(i){return i?i instanceof $be||i instanceof Bst:!1}class AG{constructor(e,t){this._model=e,this._undoRedoService=t}pushStackElement(){const e=this._undoRedoService.getLastElement(this._model.uri);gg(e)&&e.close()}popStackElement(){const e=this._undoRedoService.getLastElement(this._model.uri);gg(e)&&e.open()}clear(){this._undoRedoService.removeElements(this._model.uri)}_getOrCreateEditStackElement(e,t){const n=this._undoRedoService.getLastElement(this._model.uri);if(gg(n)&&n.canAppend(this._model))return n;const o=new $be(C("edit","Typing"),"undoredo.textBufferEdit",this._model,e);return this._undoRedoService.pushElement(o,t),o}pushEOL(e){const t=this._getOrCreateEditStackElement(null,void 0);this._model.setEOL(e),t.append(this._model,[],SH(this._model),this._model.getAlternativeVersionId(),null)}pushEditOperation(e,t,n,o){const r=this._getOrCreateEditStackElement(e,o),s=this._model.applyEdits(t,!0),a=AG._computeCursorState(n,s),l=s.map((c,u)=>({index:u,textChange:c.textChange}));return l.sort((c,u)=>c.textChange.oldPosition===u.textChange.oldPosition?c.index-u.index:c.textChange.oldPosition-u.textChange.oldPosition),r.append(this._model,l.map(c=>c.textChange),SH(this._model),this._model.getAlternativeVersionId(),a),a}static _computeCursorState(e,t){try{return e?e(t):null}catch(n){return en(n),null}}}class Wst{constructor(){this.spacesDiff=0,this.looksLikeAlignment=!1}}function Vst(i,e,t,n,o){o.spacesDiff=0,o.looksLikeAlignment=!1;let r;for(r=0;r0&&a>0||l>0&&c>0)return;const u=Math.abs(a-c),d=Math.abs(s-l);if(u===0){o.spacesDiff=d,d>0&&0<=l-1&&l-10?o++:y>1&&r++,Vst(s,a,v,w,d),d.looksLikeAlignment&&!(t&&e===d.spacesDiff)))continue;const D=d.spacesDiff;D<=c&&u[D]++,s=v,a=w}let h=t;o!==r&&(h=o{const v=u[p];v>g&&(g=v,f=p)}),f===4&&u[4]>0&&u[2]>0&&u[2]>=u[4]/2&&(f=2)}return{insertSpaces:h,tabSize:f}}function Sa(i){return(i.metadata&1)>>>0}function Fi(i,e){i.metadata=i.metadata&254|e<<0}function ss(i){return(i.metadata&2)>>>1===1}function Mi(i,e){i.metadata=i.metadata&253|(e?1:0)<<1}function zbe(i){return(i.metadata&4)>>>2===1}function tse(i,e){i.metadata=i.metadata&251|(e?1:0)<<2}function Ube(i){return(i.metadata&64)>>>6===1}function nse(i,e){i.metadata=i.metadata&191|(e?1:0)<<6}function Hst(i){return(i.metadata&24)>>>3}function ise(i,e){i.metadata=i.metadata&231|e<<3}function $st(i){return(i.metadata&32)>>>5===1}function ose(i,e){i.metadata=i.metadata&223|(e?1:0)<<5}class jbe{constructor(e,t,n){this.metadata=0,this.parent=this,this.left=this,this.right=this,Fi(this,1),this.start=t,this.end=n,this.delta=0,this.maxEnd=n,this.id=e,this.ownerId=0,this.options=null,tse(this,!1),nse(this,!1),ise(this,1),ose(this,!1),this.cachedVersionId=0,this.cachedAbsoluteStart=t,this.cachedAbsoluteEnd=n,this.range=null,Mi(this,!1)}reset(e,t,n,o){this.start=t,this.end=n,this.maxEnd=n,this.cachedVersionId=e,this.cachedAbsoluteStart=t,this.cachedAbsoluteEnd=n,this.range=o}setOptions(e){this.options=e;const t=this.options.className;tse(this,t==="squiggly-error"||t==="squiggly-warning"||t==="squiggly-info"),nse(this,this.options.glyphMarginClassName!==null),ise(this,this.options.stickiness),ose(this,this.options.collapseOnReplaceEdit)}setCachedOffsets(e,t,n){this.cachedVersionId!==n&&(this.range=null),this.cachedVersionId=n,this.cachedAbsoluteStart=e,this.cachedAbsoluteEnd=t}detach(){this.parent=null,this.left=null,this.right=null}}const gn=new jbe(null,0,0);gn.parent=gn;gn.left=gn;gn.right=gn;Fi(gn,0);class g9{constructor(){this.root=gn,this.requestNormalizeDelta=!1}intervalSearch(e,t,n,o,r,s){return this.root===gn?[]:Yst(this,e,t,n,o,r,s)}search(e,t,n,o){return this.root===gn?[]:Xst(this,e,t,n,o)}collectNodesFromOwner(e){return qst(this,e)}collectNodesPostOrder(){return Gst(this)}insert(e){rse(this,e),this._normalizeDeltaIfNecessary()}delete(e){sse(this,e),this._normalizeDeltaIfNecessary()}resolveNode(e,t){const n=e;let o=0;for(;e!==this.root;)e===e.parent.right&&(o+=e.parent.delta),e=e.parent;const r=n.start+o,s=n.end+o;n.setCachedOffsets(r,s,t)}acceptReplace(e,t,n,o){const r=jst(this,e,e+t);for(let s=0,a=r.length;st||n===1?!1:n===2?!0:e}function Ust(i,e,t,n,o){const r=Hst(i),s=r===0||r===2,a=r===1||r===2,l=t-e,c=n,u=Math.min(l,c),d=i.start;let h=!1;const f=i.end;let g=!1;e<=d&&f<=t&&$st(i)&&(i.start=e,h=!0,i.end=e,g=!0);{const v=o?1:l>0?2:0;!h&&j1(d,s,e,v)&&(h=!0),!g&&j1(f,a,e,v)&&(g=!0)}if(u>0&&!o){const v=l>c?2:0;!h&&j1(d,s,e+u,v)&&(h=!0),!g&&j1(f,a,e+u,v)&&(g=!0)}{const v=o?1:0;!h&&j1(d,s,t,v)&&(i.start=e+c,h=!0),!g&&j1(f,a,t,v)&&(i.end=e+c,g=!0)}const p=c-l;h||(i.start=Math.max(0,d+p)),g||(i.end=Math.max(0,f+p)),i.start>i.end&&(i.end=i.start)}function jst(i,e,t){let n=i.root,o=0,r=0,s=0,a=0;const l=[];let c=0;for(;n!==gn;){if(ss(n)){Mi(n.left,!1),Mi(n.right,!1),n===n.parent.right&&(o-=n.parent.delta),n=n.parent;continue}if(!ss(n.left)){if(r=o+n.maxEnd,rt){Mi(n,!0);continue}if(a=o+n.end,a>=e&&(n.setCachedOffsets(s,a,0),l[c++]=n),Mi(n,!0),n.right!==gn&&!ss(n.right)){o+=n.delta,n=n.right;continue}}return Mi(i.root,!1),l}function Kst(i,e,t,n){let o=i.root,r=0,s=0,a=0;const l=n-(t-e);for(;o!==gn;){if(ss(o)){Mi(o.left,!1),Mi(o.right,!1),o===o.parent.right&&(r-=o.parent.delta),Iv(o),o=o.parent;continue}if(!ss(o.left)){if(s=r+o.maxEnd,st){o.start+=l,o.end+=l,o.delta+=l,(o.delta<-1073741824||o.delta>1073741824)&&(i.requestNormalizeDelta=!0),Mi(o,!0);continue}if(Mi(o,!0),o.right!==gn&&!ss(o.right)){r+=o.delta,o=o.right;continue}}Mi(i.root,!1)}function qst(i,e){let t=i.root;const n=[];let o=0;for(;t!==gn;){if(ss(t)){Mi(t.left,!1),Mi(t.right,!1),t=t.parent;continue}if(t.left!==gn&&!ss(t.left)){t=t.left;continue}if(t.ownerId===e&&(n[o++]=t),Mi(t,!0),t.right!==gn&&!ss(t.right)){t=t.right;continue}}return Mi(i.root,!1),n}function Gst(i){let e=i.root;const t=[];let n=0;for(;e!==gn;){if(ss(e)){Mi(e.left,!1),Mi(e.right,!1),e=e.parent;continue}if(e.left!==gn&&!ss(e.left)){e=e.left;continue}if(e.right!==gn&&!ss(e.right)){e=e.right;continue}t[n++]=e,Mi(e,!0)}return Mi(i.root,!1),t}function Xst(i,e,t,n,o){let r=i.root,s=0,a=0,l=0;const c=[];let u=0;for(;r!==gn;){if(ss(r)){Mi(r.left,!1),Mi(r.right,!1),r===r.parent.right&&(s-=r.parent.delta),r=r.parent;continue}if(r.left!==gn&&!ss(r.left)){r=r.left;continue}a=s+r.start,l=s+r.end,r.setCachedOffsets(a,l,n);let d=!0;if(e&&r.ownerId&&r.ownerId!==e&&(d=!1),t&&zbe(r)&&(d=!1),o&&!Ube(r)&&(d=!1),d&&(c[u++]=r),Mi(r,!0),r.right!==gn&&!ss(r.right)){s+=r.delta,r=r.right;continue}}return Mi(i.root,!1),c}function Yst(i,e,t,n,o,r,s){let a=i.root,l=0,c=0,u=0,d=0;const h=[];let f=0;for(;a!==gn;){if(ss(a)){Mi(a.left,!1),Mi(a.right,!1),a===a.parent.right&&(l-=a.parent.delta),a=a.parent;continue}if(!ss(a.left)){if(c=l+a.maxEnd,ct){Mi(a,!0);continue}if(d=l+a.end,d>=e){a.setCachedOffsets(u,d,r);let g=!0;n&&a.ownerId&&a.ownerId!==n&&(g=!1),o&&zbe(a)&&(g=!1),s&&!Ube(a)&&(g=!1),g&&(h[f++]=a)}if(Mi(a,!0),a.right!==gn&&!ss(a.right)){l+=a.delta,a=a.right;continue}}return Mi(i.root,!1),h}function rse(i,e){if(i.root===gn)return e.parent=gn,e.left=gn,e.right=gn,Fi(e,0),i.root=e,i.root;Zst(i,e),Gp(e.parent);let t=e;for(;t!==i.root&&Sa(t.parent)===1;)if(t.parent===t.parent.parent.left){const n=t.parent.parent.right;Sa(n)===1?(Fi(t.parent,0),Fi(n,0),Fi(t.parent.parent,1),t=t.parent.parent):(t===t.parent.right&&(t=t.parent,mE(i,t)),Fi(t.parent,0),Fi(t.parent.parent,1),vE(i,t.parent.parent))}else{const n=t.parent.parent.left;Sa(n)===1?(Fi(t.parent,0),Fi(n,0),Fi(t.parent.parent,1),t=t.parent.parent):(t===t.parent.left&&(t=t.parent,vE(i,t)),Fi(t.parent,0),Fi(t.parent.parent,1),mE(i,t.parent.parent))}return Fi(i.root,0),e}function Zst(i,e){let t=0,n=i.root;const o=e.start,r=e.end;for(;;)if(Jst(o,r,n.start+t,n.end+t)<0)if(n.left===gn){e.start-=t,e.end-=t,e.maxEnd-=t,n.left=e;break}else n=n.left;else if(n.right===gn){e.start-=t+n.delta,e.end-=t+n.delta,e.maxEnd-=t+n.delta,n.right=e;break}else t+=n.delta,n=n.right;e.parent=n,e.left=gn,e.right=gn,Fi(e,1)}function sse(i,e){let t,n;if(e.left===gn?(t=e.right,n=e,t.delta+=e.delta,(t.delta<-1073741824||t.delta>1073741824)&&(i.requestNormalizeDelta=!0),t.start+=e.delta,t.end+=e.delta):e.right===gn?(t=e.left,n=e):(n=Qst(e.right),t=n.right,t.start+=n.delta,t.end+=n.delta,t.delta+=n.delta,(t.delta<-1073741824||t.delta>1073741824)&&(i.requestNormalizeDelta=!0),n.start+=e.delta,n.end+=e.delta,n.delta=e.delta,(n.delta<-1073741824||n.delta>1073741824)&&(i.requestNormalizeDelta=!0)),n===i.root){i.root=t,Fi(t,0),e.detach(),p9(),Iv(t),i.root.parent=gn;return}const o=Sa(n)===1;if(n===n.parent.left?n.parent.left=t:n.parent.right=t,n===e?t.parent=n.parent:(n.parent===e?t.parent=n:t.parent=n.parent,n.left=e.left,n.right=e.right,n.parent=e.parent,Fi(n,Sa(e)),e===i.root?i.root=n:e===e.parent.left?e.parent.left=n:e.parent.right=n,n.left!==gn&&(n.left.parent=n),n.right!==gn&&(n.right.parent=n)),e.detach(),o){Gp(t.parent),n!==e&&(Gp(n),Gp(n.parent)),p9();return}Gp(t),Gp(t.parent),n!==e&&(Gp(n),Gp(n.parent));let r;for(;t!==i.root&&Sa(t)===0;)t===t.parent.left?(r=t.parent.right,Sa(r)===1&&(Fi(r,0),Fi(t.parent,1),mE(i,t.parent),r=t.parent.right),Sa(r.left)===0&&Sa(r.right)===0?(Fi(r,1),t=t.parent):(Sa(r.right)===0&&(Fi(r.left,0),Fi(r,1),vE(i,r),r=t.parent.right),Fi(r,Sa(t.parent)),Fi(t.parent,0),Fi(r.right,0),mE(i,t.parent),t=i.root)):(r=t.parent.left,Sa(r)===1&&(Fi(r,0),Fi(t.parent,1),vE(i,t.parent),r=t.parent.left),Sa(r.left)===0&&Sa(r.right)===0?(Fi(r,1),t=t.parent):(Sa(r.left)===0&&(Fi(r.right,0),Fi(r,1),mE(i,r),r=t.parent.left),Fi(r,Sa(t.parent)),Fi(t.parent,0),Fi(r.left,0),vE(i,t.parent),t=i.root));Fi(t,0),p9()}function Qst(i){for(;i.left!==gn;)i=i.left;return i}function p9(){gn.parent=gn,gn.delta=0,gn.start=0,gn.end=0}function mE(i,e){const t=e.right;t.delta+=e.delta,(t.delta<-1073741824||t.delta>1073741824)&&(i.requestNormalizeDelta=!0),t.start+=e.delta,t.end+=e.delta,e.right=t.left,t.left!==gn&&(t.left.parent=e),t.parent=e.parent,e.parent===gn?i.root=t:e===e.parent.left?e.parent.left=t:e.parent.right=t,t.left=e,e.parent=t,Iv(e),Iv(t)}function vE(i,e){const t=e.left;e.delta-=t.delta,(e.delta<-1073741824||e.delta>1073741824)&&(i.requestNormalizeDelta=!0),e.start-=t.delta,e.end-=t.delta,e.left=t.right,t.right!==gn&&(t.right.parent=e),t.parent=e.parent,e.parent===gn?i.root=t:e===e.parent.right?e.parent.right=t:e.parent.left=t,t.right=e,e.parent=t,Iv(e),Iv(t)}function Kbe(i){let e=i.end;if(i.left!==gn){const t=i.left.maxEnd;t>e&&(e=t)}if(i.right!==gn){const t=i.right.maxEnd+i.delta;t>e&&(e=t)}return e}function Iv(i){i.maxEnd=Kbe(i)}function Gp(i){for(;i!==gn;){const e=Kbe(i);if(i.maxEnd===e)return;i.maxEnd=e,i=i.parent}}function Jst(i,e,t,n){return i===t?e-n:i-t}class xH{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!==Qt)return PG(this.right);let e=this;for(;e.parent!==Qt&&e.parent.left!==e;)e=e.parent;return e.parent===Qt?Qt:e.parent}prev(){if(this.left!==Qt)return qbe(this.left);let e=this;for(;e.parent!==Qt&&e.parent.right!==e;)e=e.parent;return e.parent===Qt?Qt:e.parent}detach(){this.parent=null,this.left=null,this.right=null}}const Qt=new xH(null,0);Qt.parent=Qt;Qt.left=Qt;Qt.right=Qt;Qt.color=0;function PG(i){for(;i.left!==Qt;)i=i.left;return i}function qbe(i){for(;i.right!==Qt;)i=i.right;return i}function OG(i){return i===Qt?0:i.size_left+i.piece.length+OG(i.right)}function FG(i){return i===Qt?0:i.lf_left+i.piece.lineFeedCnt+FG(i.right)}function m9(){Qt.parent=Qt}function _E(i,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!==Qt&&(t.left.parent=e),t.parent=e.parent,e.parent===Qt?i.root=t:e.parent.left===e?e.parent.left=t:e.parent.right=t,t.left=e,e.parent=t}function bE(i,e){const t=e.left;e.left=t.right,t.right!==Qt&&(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===Qt?i.root=t:e===e.parent.right?e.parent.right=t:e.parent.left=t,t.right=e,e.parent=t}function _2(i,e){let t,n;if(e.left===Qt?(n=e,t=n.right):e.right===Qt?(n=e,t=n.left):(n=PG(e.right),t=n.right),n===i.root){i.root=t,t.color=0,e.detach(),m9(),i.root.parent=Qt;return}const o=n.color===1;if(n===n.parent.left?n.parent.left=t:n.parent.right=t,n===e?(t.parent=n.parent,EL(i,t)):(n.parent===e?t.parent=n:t.parent=n.parent,EL(i,t),n.left=e.left,n.right=e.right,n.parent=e.parent,n.color=e.color,e===i.root?i.root=n:e===e.parent.left?e.parent.left=n:e.parent.right=n,n.left!==Qt&&(n.left.parent=n),n.right!==Qt&&(n.right.parent=n),n.size_left=e.size_left,n.lf_left=e.lf_left,EL(i,n)),e.detach(),t.parent.left===t){const s=OG(t),a=FG(t);if(s!==t.parent.size_left||a!==t.parent.lf_left){const l=s-t.parent.size_left,c=a-t.parent.lf_left;t.parent.size_left=s,t.parent.lf_left=a,og(i,t.parent,l,c)}}if(EL(i,t.parent),o){m9();return}let r;for(;t!==i.root&&t.color===0;)t===t.parent.left?(r=t.parent.right,r.color===1&&(r.color=0,t.parent.color=1,_E(i,t.parent),r=t.parent.right),r.left.color===0&&r.right.color===0?(r.color=1,t=t.parent):(r.right.color===0&&(r.left.color=0,r.color=1,bE(i,r),r=t.parent.right),r.color=t.parent.color,t.parent.color=0,r.right.color=0,_E(i,t.parent),t=i.root)):(r=t.parent.left,r.color===1&&(r.color=0,t.parent.color=1,bE(i,t.parent),r=t.parent.left),r.left.color===0&&r.right.color===0?(r.color=1,t=t.parent):(r.left.color===0&&(r.right.color=0,r.color=1,_E(i,r),r=t.parent.left),r.color=t.parent.color,t.parent.color=0,r.left.color=0,bE(i,t.parent),t=i.root));t.color=0,m9()}function ase(i,e){for(EL(i,e);e!==i.root&&e.parent.color===1;)if(e.parent===e.parent.parent.left){const t=e.parent.parent.right;t.color===1?(e.parent.color=0,t.color=0,e.parent.parent.color=1,e=e.parent.parent):(e===e.parent.right&&(e=e.parent,_E(i,e)),e.parent.color=0,e.parent.parent.color=1,bE(i,e.parent.parent))}else{const t=e.parent.parent.left;t.color===1?(e.parent.color=0,t.color=0,e.parent.parent.color=1,e=e.parent.parent):(e===e.parent.left&&(e=e.parent,bE(i,e)),e.parent.color=0,e.parent.parent.color=1,_E(i,e.parent.parent))}i.root.color=0}function og(i,e,t,n){for(;e!==i.root&&e!==Qt;)e.parent.left===e&&(e.parent.size_left+=t,e.parent.lf_left+=n),e=e.parent}function EL(i,e){let t=0,n=0;if(e!==i.root){for(;e!==i.root&&e===e.parent.right;)e=e.parent;if(e!==i.root)for(e=e.parent,t=OG(e.left)-e.size_left,n=FG(e.left)-e.lf_left,e.size_left+=t,e.lf_left+=n;e!==i.root&&(t!==0||n!==0);)e.parent.left===e&&(e.parent.size_left+=t,e.parent.lf_left+=n),e=e.parent}}const Xf=65535;function Gbe(i){let e;return i[i.length-1]<65536?e=new Uint16Array(i.length):e=new Uint32Array(i.length),e.set(i,0),e}class eat{constructor(e,t,n,o,r){this.lineStarts=e,this.cr=t,this.lf=n,this.crlf=o,this.isBasicASCII=r}}function sg(i,e=!0){const t=[0];let n=1;for(let o=0,r=i.length;o126)&&(s=!1)}const a=new eat(Gbe(i),n,o,r,s);return i.length=0,a}class qa{constructor(e,t,n,o,r){this.bufferIndex=e,this.start=t,this.end=n,this.lineFeedCnt=o,this.length=r}}class U_{constructor(e,t){this.buffer=e,this.lineStarts=t}}class nat{constructor(e,t){this._pieces=[],this._tree=e,this._BOM=t,this._index=0,e.root!==Qt&&e.iterate(e.root,n=>(n!==Qt&&this._pieces.push(n.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 iat{constructor(e){this._limit=e,this._cache=[]}get(e){for(let t=this._cache.length-1;t>=0;t--){const n=this._cache[t];if(n.nodeStartOffset<=e&&n.nodeStartOffset+n.node.piece.length>=e)return n}return null}get2(e){for(let t=this._cache.length-1;t>=0;t--){const n=this._cache[t];if(n.nodeStartLineNumber&&n.nodeStartLineNumber=e)return n}return null}set(e){this._cache.length>=this._limit&&this._cache.shift(),this._cache.push(e)}validate(e){let t=!1;const n=this._cache;for(let o=0;o=e){n[o]=null,t=!0;continue}}if(t){const o=[];for(const r of n)r!==null&&o.push(r);this._cache=o}}}class oat{constructor(e,t,n){this.create(e,t,n)}create(e,t,n){this._buffers=[new U_("",[0])],this._lastChangeBufferPos={line:0,column:0},this.root=Qt,this._lineCnt=1,this._length=0,this._EOL=t,this._EOLLength=t.length,this._EOLNormalized=n;let o=null;for(let r=0,s=e.length;r0){e[r].lineStarts||(e[r].lineStarts=sg(e[r].buffer));const a=new qa(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]),o=this.rbInsertRight(o,a)}this._searchCache=new iat(1),this._lastVisitedLine={lineNumber:0,value:""},this.computeBufferMetadata()}normalizeEOL(e){const t=Xf,n=t-Math.floor(t/3),o=n*2;let r="",s=0;const a=[];if(this.iterate(this.root,l=>{const c=this.getNodeContent(l),u=c.length;if(s<=n||s+u0){const l=r.replace(/\r\n|\r|\n/g,e);a.push(new U_(l,sg(l)))}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 nat(this,e)}getOffsetAt(e,t){let n=0,o=this.root;for(;o!==Qt;)if(o.left!==Qt&&o.lf_left+1>=e)o=o.left;else{if(o.lf_left+o.piece.lineFeedCnt+1>=e)return n+=o.size_left,n+=this.getAccumulatedValue(o,e-o.lf_left-2)+t-1;e-=o.lf_left+o.piece.lineFeedCnt,n+=o.size_left+o.piece.length,o=o.right}return n}getPositionAt(e){e=Math.floor(e),e=Math.max(0,e);let t=this.root,n=0;const o=e;for(;t!==Qt;)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(n+=t.lf_left+r.index,r.index===0){const s=this.getOffsetAt(n+1,1),a=o-s;return new ae(n+1,a+1)}return new ae(n+1,r.remainder+1)}else if(e-=t.size_left+t.piece.length,n+=t.lf_left+t.piece.lineFeedCnt,t.right===Qt){const r=this.getOffsetAt(n+1,1),s=o-e-r;return new ae(n+1,s+1)}else t=t.right;return new ae(1,1)}getValueInRange(e,t){if(e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn)return"";const n=this.nodeAt2(e.startLineNumber,e.startColumn),o=this.nodeAt2(e.endLineNumber,e.endColumn),r=this.getValueInRange2(n,o);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,l=this._buffers[a.piece.bufferIndex].buffer,c=this.offsetInBuffer(a.piece.bufferIndex,a.piece.start);return l.substring(c+e.remainder,c+t.remainder)}let n=e.node;const o=this._buffers[n.piece.bufferIndex].buffer,r=this.offsetInBuffer(n.piece.bufferIndex,n.piece.start);let s=o.substring(r+e.remainder,r+n.piece.length);for(n=n.next();n!==Qt;){const a=this._buffers[n.piece.bufferIndex].buffer,l=this.offsetInBuffer(n.piece.bufferIndex,n.piece.start);if(n===t.node){s+=a.substring(l,l+t.remainder);break}else s+=a.substr(l,n.piece.length);n=n.next()}return s}getLinesContent(){const e=[];let t=0,n="",o=!1;return this.iterate(this.root,r=>{if(r===Qt)return!0;const s=r.piece;let a=s.length;if(a===0)return!0;const l=this._buffers[s.bufferIndex].buffer,c=this._buffers[s.bufferIndex].lineStarts,u=s.start.line,d=s.end.line;let h=c[u]+s.start.column;if(o&&(l.charCodeAt(h)===10&&(h++,a--),e[t++]=n,n="",o=!1,a===0))return!0;if(u===d)return!this._EOLNormalized&&l.charCodeAt(h+a-1)===13?(o=!0,n+=l.substr(h,a-1)):n+=l.substr(h,a),!0;n+=this._EOLNormalized?l.substring(h,Math.max(h,c[u+1]-this._EOLLength)):l.substring(h,c[u+1]).replace(/(\r\n|\r|\n)$/,""),e[t++]=n;for(let f=u+1;fy+g,t.reset(0)):(_=h.buffer,w=y=>y,t.reset(g));do if(v=t.next(_),v){if(w(v.index)>=p)return u;this.positionInBuffer(e,w(v.index)-f,m);const y=this.getLineFeedCnt(e.piece.bufferIndex,r,m),L=m.line===r.line?m.column-r.column+o:m.column+1,D=L+v[0].length;if(d[u++]=B_(new V(n+y,L,n+y,D),v,l),w(v.index)+v[0].length>=p||u>=c)return u}while(v);return u}findMatchesLineByLine(e,t,n,o){const r=[];let s=0;const a=new NC(t.wordSeparators,t.regex);let l=this.nodeAt2(e.startLineNumber,e.startColumn);if(l===null)return[];const c=this.nodeAt2(e.endLineNumber,e.endColumn);if(c===null)return[];let u=this.positionInBuffer(l.node,l.remainder);const d=this.positionInBuffer(c.node,c.remainder);if(l.node===c.node)return this.findMatchesInNode(l.node,a,e.startLineNumber,e.startColumn,u,d,t,n,o,s,r),r;let h=e.startLineNumber,f=l.node;for(;f!==c.node;){const p=this.getLineFeedCnt(f.piece.bufferIndex,u,f.piece.end);if(p>=1){const m=this._buffers[f.piece.bufferIndex].lineStarts,_=this.offsetInBuffer(f.piece.bufferIndex,f.piece.start),w=m[u.line+p],y=h===e.startLineNumber?e.startColumn:1;if(s=this.findMatchesInNode(f,a,h,y,u,this.positionInBuffer(f,w-_),t,n,o,s,r),s>=o)return r;h+=p}const v=h===e.startLineNumber?e.startColumn-1:0;if(h===e.endLineNumber){const m=this.getLineContent(h).substring(v,e.endColumn-1);return s=this._findMatchesInLine(t,a,m,e.endLineNumber,v,s,r,n,o),r}if(s=this._findMatchesInLine(t,a,this.getLineContent(h).substr(v),h,v,s,r,n,o),s>=o)return r;h++,l=this.nodeAt2(h,1),f=l.node,u=this.positionInBuffer(l.node,l.remainder)}if(h===e.endLineNumber){const p=h===e.startLineNumber?e.startColumn-1:0,v=this.getLineContent(h).substring(p,e.endColumn-1);return s=this._findMatchesInLine(t,a,v,e.endLineNumber,p,s,r,n,o),r}const g=h===e.startLineNumber?e.startColumn:1;return s=this.findMatchesInNode(c.node,a,h,g,u,d,t,n,o,s,r),r}_findMatchesInLine(e,t,n,o,r,s,a,l,c){const u=e.wordSeparators;if(!l&&e.simpleSearch){const h=e.simpleSearch,f=h.length,g=n.length;let p=-f;for(;(p=n.indexOf(h,p+f))!==-1;)if((!u||tG(u,n,g,p,f))&&(a[s++]=new WD(new V(o,p+1+r,o,p+1+f+r),null),s>=c))return s;return s}let d;t.reset(0);do if(d=t.next(n),d&&(a[s++]=B_(new V(o,d.index+1+r,o,d.index+1+d[0].length+r),d,l),s>=c))return s;while(d);return s}insert(e,t,n=!1){if(this._EOLNormalized=this._EOLNormalized&&n,this._lastVisitedLine.lineNumber=0,this._lastVisitedLine.value="",this.root!==Qt){const{node:o,remainder:r,nodeStartOffset:s}=this.nodeAt(e),a=o.piece,l=a.bufferIndex,c=this.positionInBuffer(o,r);if(o.piece.bufferIndex===0&&a.end.line===this._lastChangeBufferPos.line&&a.end.column===this._lastChangeBufferPos.column&&s+a.length===e&&t.lengthe){const u=[];let d=new qa(a.bufferIndex,c,a.end,this.getLineFeedCnt(a.bufferIndex,c,a.end),this.offsetInBuffer(l,a.end)-this.offsetInBuffer(l,c));if(this.shouldCheckCRLF()&&this.endWithCR(t)&&this.nodeCharCodeAt(o,r)===10){const p={line:d.start.line+1,column:0};d=new qa(d.bufferIndex,p,d.end,this.getLineFeedCnt(d.bufferIndex,p,d.end),d.length-1),t+=` -`}if(this.shouldCheckCRLF()&&this.startWithLF(t))if(this.nodeCharCodeAt(o,r-1)===13){const p=this.positionInBuffer(o,r-1);this.deleteNodeTail(o,p),t="\r"+t,o.piece.length===0&&u.push(o)}else this.deleteNodeTail(o,c);else this.deleteNodeTail(o,c);const h=this.createNewPieces(t);d.length>0&&this.rbInsertRight(o,d);let f=o;for(let g=0;g=0;s--)r=this.rbInsertLeft(r,o[s]);this.validateCRLFWithPrevNode(r),this.deleteNodes(n)}insertContentToNodeRight(e,t){this.adjustCarriageReturnFromNext(e,t)&&(e+=` -`);const n=this.createNewPieces(e),o=this.rbInsertRight(t,n[0]);let r=o;for(let s=1;s=h)c=d+1;else break;return n?(n.line=d,n.column=l-f,null):{line:d,column:l-f}}getLineFeedCnt(e,t,n){if(n.column===0)return n.line-t.line;const o=this._buffers[e].lineStarts;if(n.line===o.length-1)return n.line-t.line;const r=o[n.line+1],s=o[n.line]+n.column;if(r>s+1)return n.line-t.line;const a=s-1;return this._buffers[e].buffer.charCodeAt(a)===13?n.line-t.line+1:n.line-t.line}offsetInBuffer(e,t){return this._buffers[e].lineStarts[t.line]+t.column}deleteNodes(e){for(let t=0;tXf){const u=[];for(;e.length>Xf;){const h=e.charCodeAt(Xf-1);let f;h===13||h>=55296&&h<=56319?(f=e.substring(0,Xf-1),e=e.substring(Xf-1)):(f=e.substring(0,Xf),e=e.substring(Xf));const g=sg(f);u.push(new qa(this._buffers.length,{line:0,column:0},{line:g.length-1,column:f.length-g[g.length-1]},g.length-1,f.length)),this._buffers.push(new U_(f,g))}const d=sg(e);return u.push(new qa(this._buffers.length,{line:0,column:0},{line:d.length-1,column:e.length-d[d.length-1]},d.length-1,e.length)),this._buffers.push(new U_(e,d)),u}let t=this._buffers[0].buffer.length;const n=sg(e,!1);let o=this._lastChangeBufferPos;if(this._buffers[0].lineStarts[this._buffers[0].lineStarts.length-1]===t&&t!==0&&this.startWithLF(e)&&this.endWithCR(this._buffers[0].buffer)){this._lastChangeBufferPos={line:this._lastChangeBufferPos.line,column:this._lastChangeBufferPos.column+1},o=this._lastChangeBufferPos;for(let u=0;u=e-1)n=n.left;else if(n.lf_left+n.piece.lineFeedCnt>e-1){const l=this.getAccumulatedValue(n,e-n.lf_left-2),c=this.getAccumulatedValue(n,e-n.lf_left-1),u=this._buffers[n.piece.bufferIndex].buffer,d=this.offsetInBuffer(n.piece.bufferIndex,n.piece.start);return s+=n.size_left,this._searchCache.set({node:n,nodeStartOffset:s,nodeStartLineNumber:a-(e-1-n.lf_left)}),u.substring(d+l,d+c-t)}else if(n.lf_left+n.piece.lineFeedCnt===e-1){const l=this.getAccumulatedValue(n,e-n.lf_left-2),c=this._buffers[n.piece.bufferIndex].buffer,u=this.offsetInBuffer(n.piece.bufferIndex,n.piece.start);o=c.substring(u+l,u+n.piece.length);break}else e-=n.lf_left+n.piece.lineFeedCnt,s+=n.size_left+n.piece.length,n=n.right}for(n=n.next();n!==Qt;){const s=this._buffers[n.piece.bufferIndex].buffer;if(n.piece.lineFeedCnt>0){const a=this.getAccumulatedValue(n,0),l=this.offsetInBuffer(n.piece.bufferIndex,n.piece.start);return o+=s.substring(l,l+a-t),o}else{const a=this.offsetInBuffer(n.piece.bufferIndex,n.piece.start);o+=s.substr(a,n.piece.length)}n=n.next()}return o}computeBufferMetadata(){let e=this.root,t=1,n=0;for(;e!==Qt;)t+=e.lf_left+e.piece.lineFeedCnt,n+=e.size_left+e.piece.length,e=e.right;this._lineCnt=t,this._length=n,this._searchCache.validate(this._length)}getIndexOf(e,t){const n=e.piece,o=this.positionInBuffer(e,t),r=o.line-n.start.line;if(this.offsetInBuffer(n.bufferIndex,n.end)-this.offsetInBuffer(n.bufferIndex,n.start)===t){const s=this.getLineFeedCnt(e.piece.bufferIndex,n.start,o);if(s!==r)return{index:s,remainder:0}}return{index:r,remainder:o.column}}getAccumulatedValue(e,t){if(t<0)return 0;const n=e.piece,o=this._buffers[n.bufferIndex].lineStarts,r=n.start.line+t+1;return r>n.end.line?o[n.end.line]+n.end.column-o[n.start.line]-n.start.column:o[r]-o[n.start.line]-n.start.column}deleteNodeTail(e,t){const n=e.piece,o=n.lineFeedCnt,r=this.offsetInBuffer(n.bufferIndex,n.end),s=t,a=this.offsetInBuffer(n.bufferIndex,s),l=this.getLineFeedCnt(n.bufferIndex,n.start,s),c=l-o,u=a-r,d=n.length+u;e.piece=new qa(n.bufferIndex,n.start,s,l,d),og(this,e,u,c)}deleteNodeHead(e,t){const n=e.piece,o=n.lineFeedCnt,r=this.offsetInBuffer(n.bufferIndex,n.start),s=t,a=this.getLineFeedCnt(n.bufferIndex,s,n.end),l=this.offsetInBuffer(n.bufferIndex,s),c=a-o,u=r-l,d=n.length+u;e.piece=new qa(n.bufferIndex,s,n.end,a,d),og(this,e,u,c)}shrinkNode(e,t,n){const o=e.piece,r=o.start,s=o.end,a=o.length,l=o.lineFeedCnt,c=t,u=this.getLineFeedCnt(o.bufferIndex,o.start,c),d=this.offsetInBuffer(o.bufferIndex,t)-this.offsetInBuffer(o.bufferIndex,r);e.piece=new qa(o.bufferIndex,o.start,c,u,d),og(this,e,d-a,u-l);const h=new qa(o.bufferIndex,n,s,this.getLineFeedCnt(o.bufferIndex,n,s),this.offsetInBuffer(o.bufferIndex,s)-this.offsetInBuffer(o.bufferIndex,n)),f=this.rbInsertRight(e,h);this.validateCRLFWithPrevNode(f)}appendToNode(e,t){this.adjustCarriageReturnFromNext(t,e)&&(t+=` -`);const n=this.shouldCheckCRLF()&&this.startWithLF(t)&&this.endWithCR(e),o=this._buffers[0].buffer.length;this._buffers[0].buffer+=t;const r=sg(t,!1);for(let f=0;fe)t=t.left;else if(t.size_left+t.piece.length>=e){o+=t.size_left;const r={node:t,remainder:e-t.size_left,nodeStartOffset:o};return this._searchCache.set(r),r}else e-=t.size_left+t.piece.length,o+=t.size_left+t.piece.length,t=t.right;return null}nodeAt2(e,t){let n=this.root,o=0;for(;n!==Qt;)if(n.left!==Qt&&n.lf_left>=e-1)n=n.left;else if(n.lf_left+n.piece.lineFeedCnt>e-1){const r=this.getAccumulatedValue(n,e-n.lf_left-2),s=this.getAccumulatedValue(n,e-n.lf_left-1);return o+=n.size_left,{node:n,remainder:Math.min(r+t-1,s),nodeStartOffset:o}}else if(n.lf_left+n.piece.lineFeedCnt===e-1){const r=this.getAccumulatedValue(n,e-n.lf_left-2);if(r+t-1<=n.piece.length)return{node:n,remainder:r+t-1,nodeStartOffset:o};t-=n.piece.length-r;break}else e-=n.lf_left+n.piece.lineFeedCnt,o+=n.size_left+n.piece.length,n=n.right;for(n=n.next();n!==Qt;){if(n.piece.lineFeedCnt>0){const r=this.getAccumulatedValue(n,0),s=this.offsetOfNode(n);return{node:n,remainder:Math.min(t-1,r),nodeStartOffset:s}}else if(n.piece.length>=t-1){const r=this.offsetOfNode(n);return{node:n,remainder:t-1,nodeStartOffset:r}}else t-=n.piece.length;n=n.next()}return null}nodeCharCodeAt(e,t){if(e.piece.lineFeedCnt<1)return-1;const n=this._buffers[e.piece.bufferIndex],o=this.offsetInBuffer(e.piece.bufferIndex,e.piece.start)+t;return n.buffer.charCodeAt(o)}offsetOfNode(e){if(!e)return 0;let t=e.size_left;for(;e!==this.root;)e.parent.right===e&&(t+=e.parent.size_left+e.parent.piece.length),e=e.parent;return t}shouldCheckCRLF(){return!(this._EOLNormalized&&this._EOL===` -`)}startWithLF(e){if(typeof e=="string")return e.charCodeAt(0)===10;if(e===Qt||e.piece.lineFeedCnt===0)return!1;const t=e.piece,n=this._buffers[t.bufferIndex].lineStarts,o=t.start.line,r=n[o]+t.start.column;return o===n.length-1||n[o+1]>r+1?!1:this._buffers[t.bufferIndex].buffer.charCodeAt(r)===10}endWithCR(e){return typeof e=="string"?e.charCodeAt(e.length-1)===13:e===Qt||e.piece.lineFeedCnt===0?!1:this.nodeCharCodeAt(e,e.piece.length-1)===13}validateCRLFWithPrevNode(e){if(this.shouldCheckCRLF()&&this.startWithLF(e)){const t=e.prev();this.endWithCR(t)&&this.fixCRLF(t,e)}}validateCRLFWithNextNode(e){if(this.shouldCheckCRLF()&&this.endWithCR(e)){const t=e.next();this.startWithLF(t)&&this.fixCRLF(e,t)}}fixCRLF(e,t){const n=[],o=this._buffers[e.piece.bufferIndex].lineStarts;let r;e.piece.end.column===0?r={line:e.piece.end.line-1,column:o[e.piece.end.line]-o[e.piece.end.line-1]-1}:r={line:e.piece.end.line,column:e.piece.end.column-1};const s=e.piece.length-1,a=e.piece.lineFeedCnt-1;e.piece=new qa(e.piece.bufferIndex,e.piece.start,r,a,s),og(this,e,-1,-1),e.piece.length===0&&n.push(e);const l={line:t.piece.start.line+1,column:0},c=t.piece.length-1,u=this.getLineFeedCnt(t.piece.bufferIndex,l,t.piece.end);t.piece=new qa(t.piece.bufferIndex,l,t.piece.end,u,c),og(this,t,-1,-1),t.piece.length===0&&n.push(t);const d=this.createNewPieces(`\r -`);this.rbInsertRight(e,d[0]);for(let h=0;heo.shiftIndent(e,a),unshiftIndent:a=>eo.unshiftIndent(e,a)},e.languageConfigurationService);if(s===null)return null;if(s!==e.normalizeIndentation(r)){const a=t.getLineFirstNonWhitespaceColumn(n.startLineNumber);return a===0?eo._typeCommand(new V(n.startLineNumber,1,n.endLineNumber,n.endColumn),e.normalizeIndentation(s)+o,!1):eo._typeCommand(new V(n.startLineNumber,1,n.endLineNumber,n.endColumn),e.normalizeIndentation(s)+t.getLineContent(n.startLineNumber).substring(a-1,n.startColumn-1)+o,!1)}return null}static _isAutoClosingOvertype(e,t,n,o,r){if(e.autoClosingOvertype==="never"||!e.autoClosingPairs.autoClosingPairsCloseSingleChar.has(r))return!1;for(let s=0,a=n.length;s2?u.charCodeAt(c.column-2):0)===92&&h)return!1;if(e.autoClosingOvertype==="auto"){let g=!1;for(let p=0,v=o.length;pt.startsWith(l.open)),a=r.some(l=>t.startsWith(l.close));return!s&&a}static _findAutoClosingPairOpen(e,t,n,o){const r=e.autoClosingPairs.autoClosingPairsOpenByEnd.get(o);if(!r)return null;let s=null;for(const a of r)if(s===null||a.open.length>s.open.length){let l=!0;for(const c of n)if(t.getValueInRange(new V(c.lineNumber,c.column-a.open.length+1,c.lineNumber,c.column))+o!==a.open){l=!1;break}l&&(s=a)}return s}static _findContainedAutoClosingPair(e,t){if(t.open.length<=1)return null;const n=t.close.charAt(t.close.length-1),o=e.autoClosingPairs.autoClosingPairsCloseByEnd.get(n)||[];let r=null;for(const s of o)s.open!==t.open&&t.open.includes(s.open)&&t.close.endsWith(s.close)&&(!r||s.open.length>r.open.length)&&(r=s);return r}static _getAutoClosingPairClose(e,t,n,o,r){for(const g of n)if(!g.isEmpty())return null;const s=n.map(g=>{const p=g.getPosition();return r?{lineNumber:p.lineNumber,beforeColumn:p.column-o.length,afterColumn:p.column}:{lineNumber:p.lineNumber,beforeColumn:p.column,afterColumn:p.column}}),a=this._findAutoClosingPairOpen(e,t,s.map(g=>new ae(g.lineNumber,g.beforeColumn)),o);if(!a)return null;let l,c;if(Gp(o)?(l=e.autoClosingQuotes,c=e.shouldAutoCloseBefore.quote):(e.blockCommentStartToken?a.open.includes(e.blockCommentStartToken):!1)?(l=e.autoClosingComments,c=e.shouldAutoCloseBefore.comment):(l=e.autoClosingBrackets,c=e.shouldAutoCloseBefore.bracket),l==="never")return null;const d=this._findContainedAutoClosingPair(e,a),h=d?d.close:"";let f=!0;for(const g of s){const{lineNumber:p,beforeColumn:v,afterColumn:m}=g,_=t.getLineContent(p),y=_.substring(0,v-1),w=_.substring(m-1);if(w.startsWith(h)||(f=!1),w.length>0){const I=w.charAt(0);if(!eo._isBeforeClosingBrace(e,w)&&!c(I))return null}if(a.open.length===1&&(o==="'"||o==='"')&&l!=="always"){const I=Vc(e.wordSeparators);if(y.length>0){const k=y.charCodeAt(y.length-1);if(I.get(k)===0)return null}}if(!t.tokenization.isCheapToTokenize(p))return null;t.tokenization.forceTokenization(p);const L=t.tokenization.getLineTokens(p),D=o5(L,v-1);if(!a.shouldAutoClose(D,v-D.firstCharOffset))return null;const E=a.findNeutralCharacter();if(E){const I=t.tokenization.getTokenTypeIfInsertingCharacter(p,v,E);if(!a.isOK(I))return null}}return f?a.close.substring(0,a.close.length-h.length):a.close}static _runAutoClosingOpenCharType(e,t,n,o,r,s,a){const l=[];for(let c=0,u=o.length;cnew Qr(new V(h.positionLineNumber,h.positionColumn,h.positionLineNumber,h.positionColumn+1),"",!1));return new Sa(4,d,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}const u=this._getAutoClosingPairClose(t,n,r,l,!0);return u!==null?this._runAutoClosingOpenCharType(e,t,n,r,l,!0,u):null}static typeWithInterceptors(e,t,n,o,r,s,a){if(!e&&a===` +`){const u=[];for(let d=0,h=r.length;d{const o=t.get(Jn).getFocusedCodeEditor();return o&&o.hasTextFocus()?this._runEditorCommand(t,o,n):!1}),e.addImplementation(1e3,"generic-dom-input-textarea",(t,n)=>{const o=Nu();return o&&["input","textarea"].indexOf(o.tagName.toLowerCase())>=0?(this.runDOMCommand(o),!0):!1}),e.addImplementation(0,"generic-dom",(t,n)=>{const o=t.get(Jn).getActiveCodeEditor();return o?(o.focus(),this._runEditorCommand(t,o,n)):!1})}_runEditorCommand(e,t,n){const o=this.runEditorCommand(e,t,n);return o||!0}}var Cr;(function(i){class e extends ho{constructor(_){super(_),this._inSelectionMode=_.inSelectionMode}runCoreEditorCommand(_,y){if(!y.position)return;_.model.pushStackElement(),_.setCursorStates(y.source,3,[Mr.moveTo(_,_.getPrimaryCursorState(),this._inSelectionMode,y.position,y.viewPosition)])&&y.revealType!==2&&_.revealPrimaryCursor(y.source,!0,!0)}}i.MoveTo=Ye(new e({id:"_moveTo",inSelectionMode:!1,precondition:void 0})),i.MoveToSelect=Ye(new e({id:"_moveToSelect",inSelectionMode:!0,precondition:void 0}));class t extends ho{runCoreEditorCommand(_,y){_.model.pushStackElement();const w=this._getColumnSelectResult(_,_.getPrimaryCursorState(),_.getCursorColumnSelectData(),y);w!==null&&(_.setCursorStates(y.source,3,w.viewStates.map(L=>kn.fromViewState(L))),_.setCursorColumnSelectData({isReal:!0,fromViewLineNumber:w.fromLineNumber,fromViewVisualColumn:w.fromVisualColumn,toViewLineNumber:w.toLineNumber,toViewVisualColumn:w.toVisualColumn}),w.reversed?_.revealTopMostCursor(y.source):_.revealBottomMostCursor(y.source))}}i.ColumnSelect=Ye(new class extends t{constructor(){super({id:"columnSelect",precondition:void 0})}_getColumnSelectResult(m,_,y,w){if(typeof w.position=="undefined"||typeof w.viewPosition=="undefined"||typeof w.mouseColumn=="undefined")return null;const L=m.model.validatePosition(w.position),D=m.coordinatesConverter.validateViewPosition(new ae(w.viewPosition.lineNumber,w.viewPosition.column),L),E=w.doColumnSelect?y.fromViewLineNumber:D.lineNumber,I=w.doColumnSelect?y.fromViewVisualColumn:w.mouseColumn-1;return z_.columnSelect(m.cursorConfig,m,E,I,D.lineNumber,w.mouseColumn-1)}}),i.CursorColumnSelectLeft=Ye(new class extends t{constructor(){super({id:"cursorColumnSelectLeft",precondition:void 0,kbOpts:{weight:Yn,kbExpr:Q.textInputFocus,primary:3599,linux:{primary:0}}})}_getColumnSelectResult(m,_,y,w){return z_.columnSelectLeft(m.cursorConfig,m,y)}}),i.CursorColumnSelectRight=Ye(new class extends t{constructor(){super({id:"cursorColumnSelectRight",precondition:void 0,kbOpts:{weight:Yn,kbExpr:Q.textInputFocus,primary:3601,linux:{primary:0}}})}_getColumnSelectResult(m,_,y,w){return z_.columnSelectRight(m.cursorConfig,m,y)}});class n extends t{constructor(_){super(_),this._isPaged=_.isPaged}_getColumnSelectResult(_,y,w,L){return z_.columnSelectUp(_.cursorConfig,_,w,this._isPaged)}}i.CursorColumnSelectUp=Ye(new n({isPaged:!1,id:"cursorColumnSelectUp",precondition:void 0,kbOpts:{weight:Yn,kbExpr:Q.textInputFocus,primary:3600,linux:{primary:0}}})),i.CursorColumnSelectPageUp=Ye(new n({isPaged:!0,id:"cursorColumnSelectPageUp",precondition:void 0,kbOpts:{weight:Yn,kbExpr:Q.textInputFocus,primary:3595,linux:{primary:0}}}));class o extends t{constructor(_){super(_),this._isPaged=_.isPaged}_getColumnSelectResult(_,y,w,L){return z_.columnSelectDown(_.cursorConfig,_,w,this._isPaged)}}i.CursorColumnSelectDown=Ye(new o({isPaged:!1,id:"cursorColumnSelectDown",precondition:void 0,kbOpts:{weight:Yn,kbExpr:Q.textInputFocus,primary:3602,linux:{primary:0}}})),i.CursorColumnSelectPageDown=Ye(new o({isPaged:!0,id:"cursorColumnSelectPageDown",precondition:void 0,kbOpts:{weight:Yn,kbExpr:Q.textInputFocus,primary:3596,linux:{primary:0}}}));class r extends ho{constructor(){super({id:"cursorMove",precondition:void 0,description:dP.description})}runCoreEditorCommand(_,y){const w=dP.parse(y);!w||this._runCursorMove(_,y.source,w)}_runCursorMove(_,y,w){_.model.pushStackElement(),_.setCursorStates(y,3,r._move(_,_.getCursorStates(),w)),_.revealPrimaryCursor(y,!0)}static _move(_,y,w){const L=w.select,D=w.value;switch(w.direction){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:return Mr.simpleMove(_,y,w.direction,L,D,w.unit);case 11:case 13:case 12:case 14:return Mr.viewportMove(_,y,w.direction,L,D);default:return null}}}i.CursorMoveImpl=r,i.CursorMove=Ye(new r);class s extends ho{constructor(_){super(_),this._staticArgs=_.args}runCoreEditorCommand(_,y){let w=this._staticArgs;this._staticArgs.value===-1&&(w={direction:this._staticArgs.direction,unit:this._staticArgs.unit,select:this._staticArgs.select,value:y.pageSize||_.cursorConfig.pageSize}),_.model.pushStackElement(),_.setCursorStates(y.source,3,Mr.simpleMove(_,_.getCursorStates(),w.direction,w.select,w.value,w.unit)),_.revealPrimaryCursor(y.source,!0)}}i.CursorLeft=Ye(new s({args:{direction:0,unit:0,select:!1,value:1},id:"cursorLeft",precondition:void 0,kbOpts:{weight:Yn,kbExpr:Q.textInputFocus,primary:15,mac:{primary:15,secondary:[288]}}})),i.CursorLeftSelect=Ye(new s({args:{direction:0,unit:0,select:!0,value:1},id:"cursorLeftSelect",precondition:void 0,kbOpts:{weight:Yn,kbExpr:Q.textInputFocus,primary:1039}})),i.CursorRight=Ye(new s({args:{direction:1,unit:0,select:!1,value:1},id:"cursorRight",precondition:void 0,kbOpts:{weight:Yn,kbExpr:Q.textInputFocus,primary:17,mac:{primary:17,secondary:[292]}}})),i.CursorRightSelect=Ye(new s({args:{direction:1,unit:0,select:!0,value:1},id:"cursorRightSelect",precondition:void 0,kbOpts:{weight:Yn,kbExpr:Q.textInputFocus,primary:1041}})),i.CursorUp=Ye(new s({args:{direction:2,unit:2,select:!1,value:1},id:"cursorUp",precondition:void 0,kbOpts:{weight:Yn,kbExpr:Q.textInputFocus,primary:16,mac:{primary:16,secondary:[302]}}})),i.CursorUpSelect=Ye(new s({args:{direction:2,unit:2,select:!0,value:1},id:"cursorUpSelect",precondition:void 0,kbOpts:{weight:Yn,kbExpr:Q.textInputFocus,primary:1040,secondary:[3088],mac:{primary:1040},linux:{primary:1040}}})),i.CursorPageUp=Ye(new s({args:{direction:2,unit:2,select:!1,value:-1},id:"cursorPageUp",precondition:void 0,kbOpts:{weight:Yn,kbExpr:Q.textInputFocus,primary:11}})),i.CursorPageUpSelect=Ye(new s({args:{direction:2,unit:2,select:!0,value:-1},id:"cursorPageUpSelect",precondition:void 0,kbOpts:{weight:Yn,kbExpr:Q.textInputFocus,primary:1035}})),i.CursorDown=Ye(new s({args:{direction:3,unit:2,select:!1,value:1},id:"cursorDown",precondition:void 0,kbOpts:{weight:Yn,kbExpr:Q.textInputFocus,primary:18,mac:{primary:18,secondary:[300]}}})),i.CursorDownSelect=Ye(new s({args:{direction:3,unit:2,select:!0,value:1},id:"cursorDownSelect",precondition:void 0,kbOpts:{weight:Yn,kbExpr:Q.textInputFocus,primary:1042,secondary:[3090],mac:{primary:1042},linux:{primary:1042}}})),i.CursorPageDown=Ye(new s({args:{direction:3,unit:2,select:!1,value:-1},id:"cursorPageDown",precondition:void 0,kbOpts:{weight:Yn,kbExpr:Q.textInputFocus,primary:12}})),i.CursorPageDownSelect=Ye(new s({args:{direction:3,unit:2,select:!0,value:-1},id:"cursorPageDownSelect",precondition:void 0,kbOpts:{weight:Yn,kbExpr:Q.textInputFocus,primary:1036}})),i.CreateCursor=Ye(new class extends ho{constructor(){super({id:"createCursor",precondition:void 0})}runCoreEditorCommand(m,_){if(!_.position)return;let y;_.wholeLine?y=Mr.line(m,m.getPrimaryCursorState(),!1,_.position,_.viewPosition):y=Mr.moveTo(m,m.getPrimaryCursorState(),!1,_.position,_.viewPosition);const w=m.getCursorStates();if(w.length>1){const L=y.modelState?y.modelState.position:null,D=y.viewState?y.viewState.position:null;for(let E=0,I=w.length;ED&&(L=D);const E=new V(L,1,L,m.model.getLineMaxColumn(L));let I=0;if(y.at)switch(y.at){case VC.RawAtArgument.Top:I=3;break;case VC.RawAtArgument.Center:I=1;break;case VC.RawAtArgument.Bottom:I=4;break}const k=m.coordinatesConverter.convertModelRangeToViewRange(E);m.revealRange(_.source,!1,k,I,0)}}),i.SelectAll=new class extends CH{constructor(){super(eJe)}runDOMCommand(m){Fc&&(m.focus(),m.select()),m.ownerDocument.execCommand("selectAll")}runEditorCommand(m,_,y){const w=_._getViewModel();!w||this.runCoreEditorCommand(w,y)}runCoreEditorCommand(m,_){m.model.pushStackElement(),m.setCursorStates("keyboard",3,[Mr.selectAll(m,m.getPrimaryCursorState())])}},i.SetSelection=Ye(new class extends ho{constructor(){super({id:"setSelection",precondition:void 0})}runCoreEditorCommand(m,_){!_.selection||(m.model.pushStackElement(),m.setCursorStates(_.source,3,[kn.fromModelSelection(_.selection)]))}})})(Cr||(Cr={}));const mrt=Me.and(Q.textInputFocus,Q.columnSelection);function wS(i,e){Va.registerKeybindingRule({id:i,primary:e,when:mrt,weight:Yn+1})}wS(Cr.CursorColumnSelectLeft.id,1039);wS(Cr.CursorColumnSelectRight.id,1041);wS(Cr.CursorColumnSelectUp.id,1040);wS(Cr.CursorColumnSelectPageUp.id,1035);wS(Cr.CursorColumnSelectDown.id,1042);wS(Cr.CursorColumnSelectPageDown.id,1036);function $re(i){return i.register(),i}var Ey;(function(i){class e extends Ir{runEditorCommand(n,o,r){const s=o._getViewModel();!s||this.runCoreEditingCommand(o,s,r||{})}}i.CoreEditingCommand=e,i.LineBreakInsert=Ye(new class extends e{constructor(){super({id:"lineBreakInsert",precondition:Q.writable,kbOpts:{weight:Yn,kbExpr:Q.textInputFocus,primary:0,mac:{primary:301}}})}runCoreEditingCommand(t,n,o){t.pushUndoStop(),t.executeCommands(this.id,eo.lineBreakInsert(n.cursorConfig,n.model,n.getCursorStates().map(r=>r.modelState.selection)))}}),i.Outdent=Ye(new class extends e{constructor(){super({id:"outdent",precondition:Q.writable,kbOpts:{weight:Yn,kbExpr:Me.and(Q.editorTextFocus,Q.tabDoesNotMoveFocus),primary:1026}})}runCoreEditingCommand(t,n,o){t.pushUndoStop(),t.executeCommands(this.id,eo.outdent(n.cursorConfig,n.model,n.getCursorStates().map(r=>r.modelState.selection))),t.pushUndoStop()}}),i.Tab=Ye(new class extends e{constructor(){super({id:"tab",precondition:Q.writable,kbOpts:{weight:Yn,kbExpr:Me.and(Q.editorTextFocus,Q.tabDoesNotMoveFocus),primary:2}})}runCoreEditingCommand(t,n,o){t.pushUndoStop(),t.executeCommands(this.id,eo.tab(n.cursorConfig,n.model,n.getCursorStates().map(r=>r.modelState.selection))),t.pushUndoStop()}}),i.DeleteLeft=Ye(new class extends e{constructor(){super({id:"deleteLeft",precondition:void 0,kbOpts:{weight:Yn,kbExpr:Q.textInputFocus,primary:1,secondary:[1025],mac:{primary:1,secondary:[1025,294,257]}}})}runCoreEditingCommand(t,n,o){const[r,s]=nb.deleteLeft(n.getPrevEditOperationType(),n.cursorConfig,n.model,n.getCursorStates().map(a=>a.modelState.selection),n.getCursorAutoClosedCharacters());r&&t.pushUndoStop(),t.executeCommands(this.id,s),n.setPrevEditOperationType(2)}}),i.DeleteRight=Ye(new class extends e{constructor(){super({id:"deleteRight",precondition:void 0,kbOpts:{weight:Yn,kbExpr:Q.textInputFocus,primary:20,mac:{primary:20,secondary:[290,276]}}})}runCoreEditingCommand(t,n,o){const[r,s]=nb.deleteRight(n.getPrevEditOperationType(),n.cursorConfig,n.model,n.getCursorStates().map(a=>a.modelState.selection));r&&t.pushUndoStop(),t.executeCommands(this.id,s),n.setPrevEditOperationType(3)}}),i.Undo=new class extends CH{constructor(){super(y0e)}runDOMCommand(t){t.ownerDocument.execCommand("undo")}runEditorCommand(t,n,o){if(!(!n.hasModel()||n.getOption(90)===!0))return n.getModel().undo()}},i.Redo=new class extends CH{constructor(){super(w0e)}runDOMCommand(t){t.ownerDocument.execCommand("redo")}runEditorCommand(t,n,o){if(!(!n.hasModel()||n.getOption(90)===!0))return n.getModel().redo()}}})(Ey||(Ey={}));class zre extends e5{constructor(e,t,n){super({id:e,precondition:void 0,description:n}),this._handlerId=t}runCommand(e,t){const n=e.get(Jn).getFocusedCodeEditor();!n||n.trigger("keyboard",this._handlerId,t)}}function $b(i,e){$re(new zre("default:"+i,i)),$re(new zre(i,i,e))}$b("type",{description:"Type",args:[{name:"args",schema:{type:"object",required:["text"],properties:{text:{type:"string"}}}}]});$b("replacePreviousChar");$b("compositionType");$b("compositionStart");$b("compositionEnd");$b("paste");$b("cut");class vrt{constructor(e,t,n,o){this.configuration=e,this.viewModel=t,this.userInputEvents=n,this.commandDelegate=o}paste(e,t,n,o){this.commandDelegate.paste(e,t,n,o)}type(e){this.commandDelegate.type(e)}compositionType(e,t,n,o){this.commandDelegate.compositionType(e,t,n,o)}compositionStart(){this.commandDelegate.startComposition()}compositionEnd(){this.commandDelegate.endComposition()}cut(){this.commandDelegate.cut()}setSelection(e){Cr.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):o?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){Cr.MoveTo.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_moveToSelect(e,t){Cr.MoveToSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_columnSelect(e,t,n){e=this._validateViewColumn(e),Cr.ColumnSelect.runCoreEditorCommand(this.viewModel,{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,mouseColumn:t,doColumnSelect:n})}_createCursor(e,t){e=this._validateViewColumn(e),Cr.CreateCursor.runCoreEditorCommand(this.viewModel,{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,wholeLine:t})}_lastCursorMoveToSelect(e,t){Cr.LastCursorMoveToSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_wordSelect(e,t){Cr.WordSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_wordSelectDrag(e,t){Cr.WordSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lastCursorWordSelect(e,t){Cr.LastCursorWordSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lineSelect(e,t){Cr.LineSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lineSelectDrag(e,t){Cr.LineSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lastCursorLineSelect(e,t){Cr.LastCursorLineSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lastCursorLineSelectDrag(e,t){Cr.LastCursorLineSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_selectAll(){Cr.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 C5{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){var t;(t=this.onKeyDown)===null||t===void 0||t.call(this,e)}emitKeyUp(e){var t;(t=this.onKeyUp)===null||t===void 0||t.call(this,e)}emitContextMenu(e){var t;(t=this.onContextMenu)===null||t===void 0||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseMove(e){var t;(t=this.onMouseMove)===null||t===void 0||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseLeave(e){var t;(t=this.onMouseLeave)===null||t===void 0||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseDown(e){var t;(t=this.onMouseDown)===null||t===void 0||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseUp(e){var t;(t=this.onMouseUp)===null||t===void 0||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseDrag(e){var t;(t=this.onMouseDrag)===null||t===void 0||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseDrop(e){var t;(t=this.onMouseDrop)===null||t===void 0||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseDropCanceled(){var e;(e=this.onMouseDropCanceled)===null||e===void 0||e.call(this)}emitMouseWheel(e){var t;(t=this.onMouseWheel)===null||t===void 0||t.call(this,e)}_convertViewToModelMouseEvent(e){return e.target?{event:e.event,target:this._convertViewToModelMouseTarget(e.target)}:e}_convertViewToModelMouseTarget(e){return C5.convertViewToModelMouseTarget(e,this._coordinatesConverter)}static convertViewToModelMouseTarget(e,t){const n=Object.assign({},e);return n.position&&(n.position=t.convertViewPositionToModelPosition(n.position)),n.range&&(n.range=t.convertViewRangeToModelRange(n.range)),(n.type===5||n.type===8)&&(n.detail=this.convertViewToModelViewZoneData(n.detail,t)),n}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 ae(e.afterLineNumber,1)).lineNumber}}}class Nbe{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 Vo("Illegal value for lineNumber");return this._lines[t]}onLinesDeleted(e,t){if(this.getCount()===0)return null;const n=this.getStartLineNumber(),o=this.getEndLineNumber();if(to)return null;let r=0,s=0;for(let l=n;l<=o;l++){const c=l-this._rendLineNumberStart;e<=l&&l<=t&&(s===0?(r=c,s=1):s++)}if(e=o&&a<=r&&(this._lines[a-this._rendLineNumberStart].onContentChanged(),s=!0);return s}onLinesInserted(e,t){if(this.getCount()===0)return null;const n=t-e+1,o=this.getStartLineNumber(),r=this.getEndLineNumber();if(e<=o)return this._rendLineNumberStart+=n,null;if(e>r)return null;if(n+e>r)return this._lines.splice(e-this._rendLineNumberStart,r-e+1);const s=[];for(let d=0;dn)continue;const l=Math.max(t,a.fromLineNumber),c=Math.min(n,a.toLineNumber);for(let u=l;u<=c;u++){const d=u-this._rendLineNumberStart;this._lines[d].onTokensChanged(),o=!0}}return o}}class Rbe{constructor(e){this._host=e,this.domNode=this._createDomNode(),this._linesCollection=new Nbe(()=>this._host.createVisibleLine())}_createDomNode(){const e=ti(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(143)}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 n=0,o=t.length;nt){const s=t,a=Math.min(n,r.rendLineNumberStart-1);s<=a&&(this._insertLinesBefore(r,s,a,o,t),r.linesLength+=a-s+1)}else if(r.rendLineNumberStart0&&(this._removeLinesBefore(r,s),r.linesLength-=s)}if(r.rendLineNumberStart=t,r.rendLineNumberStart+r.linesLength-1n){const s=Math.max(0,n-r.rendLineNumberStart+1),l=r.linesLength-1-s+1;l>0&&(this._removeLinesAfter(r,l),r.linesLength-=l)}return this._finishRendering(r,!1,o),r}_renderUntouchedLines(e,t,n,o,r){const s=e.rendLineNumberStart,a=e.lines;for(let l=t;l<=n;l++){const c=s+l;a[l].layoutLine(c,o[c-r])}}_insertLinesBefore(e,t,n,o,r){const s=[];let a=0;for(let l=t;l<=n;l++)s[a++]=this.host.createVisibleLine();e.lines=s.concat(e.lines)}_removeLinesBefore(e,t){for(let n=0;n=0;a--){const l=e.lines[a];o[a]&&(l.setDomNode(s),s=s.previousSibling)}}_finishRenderingInvalidLines(e,t,n){const o=document.createElement("div");Eg._ttPolicy&&(t=Eg._ttPolicy.createHTML(t)),o.innerHTML=t;for(let r=0;ri});Eg._sb=new bS(1e5);class Mbe extends pl{constructor(e){super(e),this._visibleLines=new Rbe(this),this.domNode=this._visibleLines.domNode;const n=this._context.configuration.options.get(50);ss(this.domNode,n),this._dynamicOverlays=[],this._isFocused=!1,this.domNode.setClassName("view-overlays")}shouldRender(){if(super.shouldRender())return!0;for(let e=0,t=this._dynamicOverlays.length;en.shouldRender());for(let n=0,o=t.length;n'),o.appendString(r),o.appendString(""),!0)}layoutLine(e,t){this._domNode&&(this._domNode.setTop(t),this._domNode.setHeight(this._lineHeight))}}class brt extends Mbe{constructor(e){super(e);const n=this._context.configuration.options.get(143);this._contentWidth=n.contentWidth,this.domNode.setHeight(0)}onConfigurationChanged(e){const n=this._context.configuration.options.get(143);return this._contentWidth=n.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 Crt extends Mbe{constructor(e){super(e);const t=this._context.configuration.options,n=t.get(143);this._contentLeft=n.contentLeft,this.domNode.setClassName("margin-view-overlays"),this.domNode.setWidth(1),ss(this.domNode,t.get(50))}onConfigurationChanged(e){const t=this._context.configuration.options;ss(this.domNode,t.get(50));const n=t.get(143);return this._contentLeft=n.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 yrt extends pl{constructor(e,t){super(e),this._viewDomNode=t,this._widgets={},this.domNode=ti(document.createElement("div")),vf.write(this.domNode,1),this.domNode.setClassName("contentWidgets"),this.domNode.setPosition("absolute"),this.domNode.setTop(0),this.overflowingContentWidgetsDomNode=ti(document.createElement("div")),vf.write(this.overflowingContentWidgetsDomNode,2),this.overflowingContentWidgetsDomNode.setClassName("overflowingContentWidgets")}dispose(){super.dispose(),this._widgets={}}onConfigurationChanged(e){const t=Object.keys(this._widgets);for(const n of t)this._widgets[n].onConfigurationChanged(e);return!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLineMappingChanged(e){return this._updateAnchorsViewPositions(),!0}onLinesChanged(e){return this._updateAnchorsViewPositions(),!0}onLinesDeleted(e){return this._updateAnchorsViewPositions(),!0}onLinesInserted(e){return this._updateAnchorsViewPositions(),!0}onScrollChanged(e){return!0}onZonesChanged(e){return!0}_updateAnchorsViewPositions(){const e=Object.keys(this._widgets);for(const t of e)this._widgets[t].updateAnchorViewPosition()}addWidget(e){const t=new wrt(this._context,this._viewDomNode,e);this._widgets[t.id]=t,t.allowEditorOverflow?this.overflowingContentWidgetsDomNode.appendChild(t.domNode):this.domNode.appendChild(t.domNode),this.setShouldRender()}setWidgetPosition(e,t,n,o,r){this._widgets[e.getId()].setPosition(t,n,o,r),this.setShouldRender()}removeWidget(e){const t=e.getId();if(this._widgets.hasOwnProperty(t)){const n=this._widgets[t];delete this._widgets[t];const o=n.domNode.domNode;o.parentNode.removeChild(o),o.removeAttribute("monaco-visible-content-widget"),this.setShouldRender()}}shouldSuppressMouseDownOnWidget(e){return this._widgets.hasOwnProperty(e)?this._widgets[e].suppressMouseDown:!1}onBeforeRender(e){const t=Object.keys(this._widgets);for(const n of t)this._widgets[n].onBeforeRender(e)}prepareRender(e){const t=Object.keys(this._widgets);for(const n of t)this._widgets[n].prepareRender(e)}render(e){const t=Object.keys(this._widgets);for(const n of t)this._widgets[n].render(e)}}class wrt{constructor(e,t,n){this._primaryAnchor=new Bx(null,null),this._secondaryAnchor=new Bx(null,null),this._context=e,this._viewDomNode=t,this._actual=n,this.domNode=ti(this._actual.getDomNode()),this.id=this._actual.getId(),this.allowEditorOverflow=this._actual.allowEditorOverflow||!1,this.suppressMouseDown=this._actual.suppressMouseDown||!1;const o=this._context.configuration.options,r=o.get(143);this._fixedOverflowWidgets=o.get(42),this._contentWidth=r.contentWidth,this._contentLeft=r.contentLeft,this._lineHeight=o.get(66),this._affinity=null,this._preference=[],this._cachedDomNodeOffsetWidth=-1,this._cachedDomNodeOffsetHeight=-1,this._maxWidth=this._getMaxWidth(),this._isVisible=!1,this._renderData=null,this.domNode.setPosition(this._fixedOverflowWidgets&&this.allowEditorOverflow?"fixed":"absolute"),this.domNode.setDisplay("none"),this.domNode.setVisibility("hidden"),this.domNode.setAttribute("widgetId",this.id),this.domNode.setMaxWidth(this._maxWidth)}onConfigurationChanged(e){const t=this._context.configuration.options;if(this._lineHeight=t.get(66),e.hasChanged(143)){const n=t.get(143);this._contentLeft=n.contentLeft,this._contentWidth=n.contentWidth,this._maxWidth=this._getMaxWidth()}}updateAnchorViewPosition(){this._setPosition(this._affinity,this._primaryAnchor.modelPosition,this._secondaryAnchor.modelPosition)}_setPosition(e,t,n){this._affinity=e,this._primaryAnchor=o(t,this._context.viewModel,this._affinity),this._secondaryAnchor=o(n,this._context.viewModel,this._affinity);function o(r,s,a){if(!r)return new Bx(null,null);const l=s.model.validatePosition(r);if(s.coordinatesConverter.modelPositionIsVisible(l)){const c=s.coordinatesConverter.convertModelPositionToViewPosition(l,a!=null?a:void 0);return new Bx(r,c)}return new Bx(r,null)}}_getMaxWidth(){const e=this.domNode.domNode.ownerDocument,t=e.defaultView;return this.allowEditorOverflow?(t==null?void 0:t.innerWidth)||e.documentElement.offsetWidth||e.body.offsetWidth:this._contentWidth}setPosition(e,t,n,o){this._setPosition(o,e,t),this._preference=n,this._primaryAnchor.viewPosition&&this._preference&&this._preference.length>0?this.domNode.setDisplay("block"):this.domNode.setDisplay("none"),this._cachedDomNodeOffsetWidth=-1,this._cachedDomNodeOffsetHeight=-1}_layoutBoxInViewport(e,t,n,o){const r=e.top,s=r,a=e.top+e.height,l=o.viewportHeight-a,c=r-n,u=s>=n,d=a,h=l>=n;let f=e.left;return f+t>o.scrollLeft+o.viewportWidth&&(f=o.scrollLeft+o.viewportWidth-t),fc){const f=h-(c-o);h-=f,n-=f}if(h=m,w=f+n<=g.height-_;return this._fixedOverflowWidgets?{fitsAbove:y,aboveTop:Math.max(h,m),fitsBelow:w,belowTop:f,left:v}:{fitsAbove:y,aboveTop:a,fitsBelow:w,belowTop:l,left:p}}_prepareRenderWidgetAtExactPositionOverflowing(e){return new Wx(e.top,e.left+this._contentLeft)}_getAnchorsCoordinates(e){var t,n;const o=a(this._primaryAnchor.viewPosition,this._affinity,this._lineHeight),r=((t=this._secondaryAnchor.viewPosition)===null||t===void 0?void 0:t.lineNumber)===((n=this._primaryAnchor.viewPosition)===null||n===void 0?void 0:n.lineNumber)?this._secondaryAnchor.viewPosition:null,s=a(r,this._affinity,this._lineHeight);return{primary:o,secondary:s};function a(l,c,u){if(!l)return null;const d=e.visibleRangeForPosition(l);if(!d)return null;const h=l.column===1&&c===3?0:d.left,f=e.getVerticalOffsetForLineNumber(l.lineNumber)-e.scrollTop;return new Ure(f,h,u)}}_reduceAnchorCoordinates(e,t,n){if(!t)return e;const o=this._context.configuration.options.get(50);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._isVisible&&(this.domNode.removeAttribute("monaco-visible-content-widget"),this._isVisible=!1,this.domNode.setVisibility("hidden")),typeof this._actual.afterRender=="function"&&l9(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"&&l9(this._actual.afterRender,this._actual,this._renderData.position)}}class Bx{constructor(e,t){this.modelPosition=e,this.viewPosition=t}}class Wx{constructor(e,t){this.top=e,this.left=t,this._coordinateBrand=void 0}}class Ure{constructor(e,t,n){this.top=e,this.left=t,this.height=n,this._anchorCoordinateBrand=void 0}}function l9(i,e,...t){try{return i.call(e,...t)}catch{return null}}class Abe extends Hb{constructor(e){super(),this._context=e;const t=this._context.configuration.options,n=t.get(143);this._lineHeight=t.get(66),this._renderLineHighlight=t.get(95),this._renderLineHighlightOnlyWhenFocus=t.get(96),this._contentLeft=n.contentLeft,this._contentWidth=n.contentWidth,this._selectionIsEmpty=!0,this._focused=!1,this._cursorLineNumbers=[1],this._selections=[new gt(1,1,1,1)],this._renderData=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),super.dispose()}_readFromSelections(){let e=!1;const t=this._selections.map(o=>o.positionLineNumber);t.sort((o,r)=>o-r),Lo(this._cursorLineNumbers,t)||(this._cursorLineNumbers=t,e=!0);const n=this._selections.every(o=>o.isEmpty());return this._selectionIsEmpty!==n&&(this._selectionIsEmpty=n,e=!0),e}onThemeChanged(e){return this._readFromSelections()}onConfigurationChanged(e){const t=this._context.configuration.options,n=t.get(143);return this._lineHeight=t.get(66),this._renderLineHighlight=t.get(95),this._renderLineHighlightOnlyWhenFocus=t.get(96),this._contentLeft=n.contentLeft,this._contentWidth=n.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=this._renderOne(e),n=e.visibleRange.startLineNumber,o=e.visibleRange.endLineNumber,r=this._cursorLineNumbers.length;let s=0;const a=[];for(let l=n;l<=o;l++){const c=l-n;for(;s=this._renderData.length?"":this._renderData[n]}_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 Srt extends Abe{_renderOne(e){return`
`}_shouldRenderThis(){return this._shouldRenderInContent()}_shouldRenderOther(){return this._shouldRenderInMargin()}}class xrt extends Abe{_renderOne(e){return`
`}_shouldRenderThis(){return!0}_shouldRenderOther(){return this._shouldRenderInContent()}}ju((i,e)=>{const t=i.getColor(Cbe);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()||i.defines(Wre)){const n=i.getColor(Wre);n&&(e.addRule(`.monaco-editor .view-overlays .current-line { border: 2px solid ${n}; }`),e.addRule(`.monaco-editor .margin-view-overlays .current-line-margin { border: 2px solid ${n}; }`),Hd(i.type)&&(e.addRule(".monaco-editor .view-overlays .current-line { border-width: 1px; }"),e.addRule(".monaco-editor .margin-view-overlays .current-line-margin { border-width: 1px; }")))}});class Lrt extends Hb{constructor(e){super(),this._context=e;const t=this._context.configuration.options;this._lineHeight=t.get(66),this._typicalHalfwidthCharacterWidth=t.get(50).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._lineHeight=t.get(66),this._typicalHalfwidthCharacterWidth=t.get(50).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 n=[],o=0;for(let l=0,c=t.length;l{if(l.options.zIndexc.options.zIndex)return 1;const u=l.options.className,d=c.options.className;return ud?1:V.compareRangesUsingStarts(l.range,c.range)});const r=e.visibleRange.startLineNumber,s=e.visibleRange.endLineNumber,a=[];for(let l=r;l<=s;l++){const c=l-r;a[c]=""}this._renderWholeLineDecorations(e,n,a),this._renderNormalDecorations(e,n,a),this._renderResult=a}_renderWholeLineDecorations(e,t,n){const o=String(this._lineHeight),r=e.visibleRange.startLineNumber,s=e.visibleRange.endLineNumber;for(let a=0,l=t.length;a',d=Math.max(c.range.startLineNumber,r),h=Math.min(c.range.endLineNumber,s);for(let f=d;f<=h;f++){const g=f-r;n[g]+=u}}}_renderNormalDecorations(e,t,n){var o;const r=String(this._lineHeight),s=e.visibleRange.startLineNumber;let a=null,l=!1,c=null,u=!1;for(let d=0,h=t.length;d';l[f]+=_}}}render(e,t){if(!this._renderResult)return"";const n=t-e;return n<0||n>=this._renderResult.length?"":this._renderResult[n]}}class Ert extends pl{constructor(e,t,n,o){super(e);const r=this._context.configuration.options,s=r.get(102),a=r.get(74),l=r.get(40),c=r.get(105),u={listenOnDomNode:n.domNode,className:"editor-scrollable "+_H(e.theme.type),useShadows:!1,lazyRender:!0,vertical:s.vertical,horizontal:s.horizontal,verticalHasArrows:s.verticalHasArrows,horizontalHasArrows:s.horizontalHasArrows,verticalScrollbarSize:s.verticalScrollbarSize,verticalSliderSize:s.verticalSliderSize,horizontalScrollbarSize:s.horizontalScrollbarSize,horizontalSliderSize:s.horizontalSliderSize,handleMouseWheel:s.handleMouseWheel,alwaysConsumeMouseWheel:s.alwaysConsumeMouseWheel,arrowSize:s.arrowSize,mouseWheelScrollSensitivity:a,fastScrollSensitivity:l,scrollPredominantAxis:c,scrollByPage:s.scrollByPage};this.scrollbar=this._register(new NG(t.domNode,u,this._context.viewLayout.getScrollable())),vf.write(this.scrollbar.getDomNode(),5),this.scrollbarDomNode=ti(this.scrollbar.getDomNode()),this.scrollbarDomNode.setPosition("absolute"),this._setLayout();const d=(h,f,g)=>{const p={};if(f){const v=h.scrollTop;v&&(p.scrollTop=this._context.viewLayout.getCurrentScrollTop()+v,h.scrollTop=0)}if(g){const v=h.scrollLeft;v&&(p.scrollLeft=this._context.viewLayout.getCurrentScrollLeft()+v,h.scrollLeft=0)}this._context.viewModel.viewLayout.setScrollPosition(p,1)};this._register(ke(n.domNode,"scroll",h=>d(n.domNode,!0,!0))),this._register(ke(t.domNode,"scroll",h=>d(t.domNode,!0,!1))),this._register(ke(o.domNode,"scroll",h=>d(o.domNode,!0,!1))),this._register(ke(this.scrollbarDomNode.domNode,"scroll",h=>d(this.scrollbarDomNode.domNode,!0,!1)))}dispose(){super.dispose()}_setLayout(){const e=this._context.configuration.options,t=e.get(143);this.scrollbarDomNode.setLeft(t.contentLeft),e.get(72).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(102)||e.hasChanged(74)||e.hasChanged(40)){const t=this._context.configuration.options,n=t.get(102),o=t.get(74),r=t.get(40),s=t.get(105),a={vertical:n.vertical,horizontal:n.horizontal,verticalScrollbarSize:n.verticalScrollbarSize,horizontalScrollbarSize:n.horizontalScrollbarSize,scrollByPage:n.scrollByPage,handleMouseWheel:n.handleMouseWheel,mouseWheelScrollSensitivity:o,fastScrollSensitivity:r,scrollPredominantAxis:s};this.scrollbar.updateOptions(a)}return e.hasChanged(143)&&this._setLayout(),!0}onScrollChanged(e){return!0}onThemeChanged(e){return this.scrollbar.updateClassName("editor-scrollable "+_H(this._context.theme.type)),!0}prepareRender(e){}render(e){this.scrollbar.renderNow()}}class Pbe extends _e{constructor(){super(...arguments),this._isDisposed=!1}dispose(){super.dispose(),this._isDisposed=!0}assertNotDisposed(){if(this._isDisposed)throw new Error("TextModelPart is disposed!")}}function y5(i,e){let t=0,n=0;const o=i.length;for(;no)throw new Vo("Illegal value for lineNumber");const r=this.getLanguageConfiguration(this.textModel.getLanguageId()).foldingRules,s=Boolean(r&&r.offSide);let a=-2,l=-1,c=-2,u=-1;const d=E=>{if(a!==-1&&(a===-2||a>E-1)){a=-1,l=-1;for(let I=E-2;I>=0;I--){const k=this._computeIndentLevel(I);if(k>=0){a=I,l=k;break}}}if(c===-2){c=-1,u=-1;for(let I=E;I=0){c=I,u=k;break}}}};let h=-2,f=-1,g=-2,p=-1;const v=E=>{if(h===-2){h=-1,f=-1;for(let I=E-2;I>=0;I--){const k=this._computeIndentLevel(I);if(k>=0){h=I,f=k;break}}}if(g!==-1&&(g===-2||g=0){g=I,p=k;break}}}};let m=0,_=!0,y=0,w=!0,L=0,D=0;for(let E=0;_||w;E++){const I=e-E,k=e+E;E>1&&(I<1||I1&&(k>o||k>n)&&(w=!1),E>5e4&&(_=!1,w=!1);let R=-1;if(_&&I>=1){const P=this._computeIndentLevel(I-1);P>=0?(c=I-1,u=P,R=Math.ceil(P/this.textModel.getOptions().indentSize)):(d(I),R=this._getIndentLevelForWhitespaceLine(s,l,u))}let A=-1;if(w&&k<=o){const P=this._computeIndentLevel(k-1);P>=0?(h=k-1,f=P,A=Math.ceil(P/this.textModel.getOptions().indentSize)):(v(k),A=this._getIndentLevelForWhitespaceLine(s,f,p))}if(E===0){D=R;continue}if(E===1){if(k<=o&&A>=0&&D+1===A){_=!1,m=k,y=k,L=A;continue}if(I>=1&&R>=0&&R-1===D){w=!1,m=I,y=I,L=R;continue}if(m=e,y=e,L=D,L===0)return{startLineNumber:m,endLineNumber:y,indent:L}}_&&(R>=L?m=I:_=!1),w&&(A>=L?y=k:w=!1)}return{startLineNumber:m,endLineNumber:y,indent:L}}getLinesBracketGuides(e,t,n,o){var r;const s=[];for(let h=e;h<=t;h++)s.push([]);const a=!0,l=this.textModel.bracketPairs.getBracketPairsInRangeWithMinIndentation(new V(e,1,t,this.textModel.getLineMaxColumn(t))).toArray();let c;if(n&&l.length>0){const h=(e<=n.lineNumber&&n.lineNumber<=t?l:this.textModel.bracketPairs.getBracketPairsInRange(V.fromPositions(n)).toArray()).filter(f=>V.strictContainsPosition(f.range,n));c=(r=eP(h,f=>a))===null||r===void 0?void 0:r.range}const u=this.textModel.getOptions().bracketPairColorizationOptions.independentColorPoolPerBracketType,d=new Obe;for(const h of l){if(!h.closingBracketRange)continue;const f=c&&h.range.equalsRange(c);if(!f&&!o.includeInactive)continue;const g=d.getInlineClassName(h.nestingLevel,h.nestingLevelOfEqualBracketType,u)+(o.highlightActive&&f?" "+d.activeClassName:""),p=h.openingBracketRange.getStartPosition(),v=h.closingBracketRange.getStartPosition(),m=o.horizontalGuides===I0.Enabled||o.horizontalGuides===I0.EnabledForActive&&f;if(h.range.startLineNumber===h.range.endLineNumber){m&&s[h.range.startLineNumber-e].push(new p0(-1,h.openingBracketRange.getEndPosition().column,g,new gE(!1,v.column),-1,-1));continue}const _=this.getVisibleColumnFromPosition(v),y=this.getVisibleColumnFromPosition(h.openingBracketRange.getStartPosition()),w=Math.min(y,_,h.minVisibleColumnIndentation+1);let L=!1;Ws(this.textModel.getLineContent(h.closingBracketRange.startLineNumber))=e&&y>w&&s[p.lineNumber-e].push(new p0(w,-1,g,new gE(!1,p.column),-1,-1)),v.lineNumber<=t&&_>w&&s[v.lineNumber-e].push(new p0(w,-1,g,new gE(!L,v.column),-1,-1)))}for(const h of s)h.sort((f,g)=>f.visibleColumn-g.visibleColumn);return s}getVisibleColumnFromPosition(e){return or.visibleColumnFromColumn(this.textModel.getLineContent(e.lineNumber),e.column,this.textModel.getOptions().tabSize)+1}getLinesIndentGuides(e,t){this.assertNotDisposed();const n=this.textModel.getLineCount();if(e<1||e>n)throw new Error("Illegal value for startLineNumber");if(t<1||t>n)throw new Error("Illegal value for endLineNumber");const o=this.textModel.getOptions(),r=this.getLanguageConfiguration(this.textModel.getLanguageId()).foldingRules,s=Boolean(r&&r.offSide),a=new Array(t-e+1);let l=-2,c=-1,u=-2,d=-1;for(let h=e;h<=t;h++){const f=h-e,g=this._computeIndentLevel(h-1);if(g>=0){l=h-1,c=g,a[f]=Math.ceil(g/o.indentSize);continue}if(l===-2){l=-1,c=-1;for(let p=h-2;p>=0;p--){const v=this._computeIndentLevel(p);if(v>=0){l=p,c=v;break}}}if(u!==-1&&(u===-2||u=0){u=p,d=v;break}}}a[f]=this._getIndentLevelForWhitespaceLine(s,c,d)}return a}_getIndentLevelForWhitespaceLine(e,t,n){const o=this.textModel.getOptions();return t===-1||n===-1?0:tl||this._maxIndentLeft>0&&y>this._maxIndentLeft)break;const w=_.horizontalLine?_.horizontalLine.top?"horizontal-top":"horizontal-bottom":"vertical",L=_.horizontalLine?((r=(o=e.visibleRangeForPosition(new ae(f,_.horizontalLine.endColumn)))===null||o===void 0?void 0:o.left)!==null&&r!==void 0?r:y+this._spaceWidth)-y:this._spaceWidth;v+=`
`}h[g]=v}this._renderResult=h}getGuidesByLine(e,t,n){const o=this._bracketPairGuideOptions.bracketPairs!==!1?this._context.viewModel.getBracketGuidesInRangeByLine(e,t,n,{highlightActive:this._bracketPairGuideOptions.highlightActiveBracketPair,horizontalGuides:this._bracketPairGuideOptions.bracketPairsHorizontal===!0?I0.Enabled:this._bracketPairGuideOptions.bracketPairsHorizontal==="active"?I0.EnabledForActive:I0.Disabled,includeInactive:this._bracketPairGuideOptions.bracketPairs===!0}):null,r=this._bracketPairGuideOptions.indentation?this._context.viewModel.getLinesIndentGuides(e,t):null;let s=0,a=0,l=0;if(this._bracketPairGuideOptions.highlightActiveIndentation!==!1&&n){const d=this._context.viewModel.getActiveIndentGuide(n.lineNumber,e,t);s=d.startLineNumber,a=d.endLineNumber,l=d.indent}const{indentSize:c}=this._context.viewModel.model.getOptions(),u=[];for(let d=e;d<=t;d++){const h=new Array;u.push(h);const f=o?o[d-e]:[],g=new sp(f),p=r?r[d-e]:0;for(let v=1;v<=p;v++){const m=(v-1)*c+1,_=(this._bracketPairGuideOptions.highlightActiveIndentation==="always"||f.length===0)&&s<=d&&d<=a&&v===l;h.push(...g.takeWhile(w=>w.visibleColumn!0)||[])}return u}render(e,t){if(!this._renderResult)return"";const n=t-e;return n<0||n>=this._renderResult.length?"":this._renderResult[n]}}function z1(i){if(!(i&&i.isTransparent()))return i}ju((i,e)=>{const t=[{bracketColor:Sbe,guideColor:Bot,guideColorActive:Uot},{bracketColor:xbe,guideColor:Wot,guideColorActive:jot},{bracketColor:Lbe,guideColor:Vot,guideColorActive:Kot},{bracketColor:Ebe,guideColor:Hot,guideColorActive:qot},{bracketColor:Dbe,guideColor:$ot,guideColorActive:Got},{bracketColor:kbe,guideColor:zot,guideColorActive:Xot}],n=new Obe,o=[{indentColor:ZI,indentColorActive:QI},{indentColor:Cot,indentColorActive:Lot},{indentColor:yot,indentColorActive:Eot},{indentColor:wot,indentColorActive:Dot},{indentColor:Sot,indentColorActive:kot},{indentColor:xot,indentColorActive:Iot}],r=t.map(a=>{var l,c;const u=i.getColor(a.bracketColor),d=i.getColor(a.guideColor),h=i.getColor(a.guideColorActive),f=z1((l=z1(d))!==null&&l!==void 0?l:u==null?void 0:u.transparent(.3)),g=z1((c=z1(h))!==null&&c!==void 0?c:u);if(!(!f||!g))return{guideColor:f,guideColorActive:g}}).filter(ED),s=o.map(a=>{const l=i.getColor(a.indentColor),c=i.getColor(a.indentColorActive),u=z1(l),d=z1(c);if(!(!u||!d))return{indentColor:u,indentColorActive:d}}).filter(ED);if(r.length>0){for(let a=0;a<30;a++){const l=r[a%r.length];e.addRule(`.monaco-editor .${n.getInlineClassNameOfLevel(a).replace(/ /g,".")} { --guide-color: ${l.guideColor}; --guide-color-active: ${l.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.${n.activeClassName} { box-shadow: 1px 0 0 0 var(--guide-color-active) inset; }`),e.addRule(`.monaco-editor .horizontal-top.${n.activeClassName} { border-top: 1px solid var(--guide-color-active); }`),e.addRule(`.monaco-editor .horizontal-bottom.${n.activeClassName} { border-bottom: 1px solid var(--guide-color-active); }`)}if(s.length>0){for(let a=0;a<30;a++){const l=s[a%s.length];e.addRule(`.monaco-editor .lines-content .core-guide-indent.lvl-${a} { --indent-color: ${l.indentColor}; --indent-color-active: ${l.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; }")}});class c9{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 Irt{constructor(){this._currentVisibleRange=new V(1,1,1,1)}getCurrentVisibleRange(){return this._currentVisibleRange}setCurrentVisibleRange(e){this._currentVisibleRange=e}}class Trt{constructor(e,t,n,o,r,s,a){this.minimalReveal=e,this.lineNumber=t,this.startColumn=n,this.endColumn=o,this.startScrollTop=r,this.stopScrollTop=s,this.scrollType=a,this.type="range",this.minLineNumber=t,this.maxLineNumber=t}}class Nrt{constructor(e,t,n,o,r){this.minimalReveal=e,this.selections=t,this.startScrollTop=n,this.stopScrollTop=o,this.scrollType=r,this.type="selections";let s=t[0].startLineNumber,a=t[0].endLineNumber;for(let l=1,c=t.length;l{this._updateLineWidthsSlow()},200),this._asyncCheckMonospaceFontAssumptions=new bi(()=>{this._checkMonospaceFontAssumptions()},2e3),this._lastRenderedData=new Irt,this._horizontalRevealRequest=null,this._stickyScrollEnabled=o.get(114).enabled,this._maxNumberStickyLines=o.get(114).maxLineCount}dispose(){this._asyncUpdateLineWidths.dispose(),this._asyncCheckMonospaceFontAssumptions.dispose(),super.dispose()}getDomNode(){return this.domNode}createVisibleLine(){return new Oh(this._viewLineOptions)}onConfigurationChanged(e){this._visibleLines.onConfigurationChanged(e),e.hasChanged(144)&&(this._maxLineWidth=0);const t=this._context.configuration.options,n=t.get(50),o=t.get(144);return this._lineHeight=t.get(66),this._typicalHalfwidthCharacterWidth=n.typicalHalfwidthCharacterWidth,this._isViewportWrapping=o.isViewportWrapping,this._revealHorizontalRightPadding=t.get(99),this._cursorSurroundingLines=t.get(29),this._cursorSurroundingLinesStyle=t.get(30),this._canUseLayerHinting=!t.get(32),this._stickyScrollEnabled=t.get(114).enabled,this._maxNumberStickyLines=t.get(114).maxLineCount,ss(this.domNode,n),this._onOptionsMaybeChanged(),e.hasChanged(143)&&(this._maxLineWidth=0),!0}_onOptionsMaybeChanged(){const e=this._context.configuration,t=new Pre(e,this._context.theme.type);if(!this._viewLineOptions.equals(t)){this._viewLineOptions=t;const n=this._visibleLines.getStartLineNumber(),o=this._visibleLines.getEndLineNumber();for(let r=n;r<=o;r++)this._visibleLines.getVisibleLine(r).onOptionsChanged(this._viewLineOptions);return!0}return!1}onCursorStateChanged(e){const t=this._visibleLines.getStartLineNumber(),n=this._visibleLines.getEndLineNumber();let o=!1;for(let r=t;r<=n;r++)o=this._visibleLines.getVisibleLine(r).onSelectionChanged()||o;return o}onDecorationsChanged(e){{const t=this._visibleLines.getStartLineNumber(),n=this._visibleLines.getEndLineNumber();for(let o=t;o<=n;o++)this._visibleLines.getVisibleLine(o).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 n=this._context.viewLayout.validateScrollPosition({scrollTop:t});e.revealHorizontal?e.range&&e.range.startLineNumber!==e.range.endLineNumber?n={scrollTop:n.scrollTop,scrollLeft:0}:e.range?this._horizontalRevealRequest=new Trt(e.minimalReveal,e.range.startLineNumber,e.range.startColumn,e.range.endColumn,this._context.viewLayout.getCurrentScrollTop(),n.scrollTop,e.scrollType):e.selections&&e.selections.length>0&&(this._horizontalRevealRequest=new Nrt(e.minimalReveal,e.selections,this._context.viewLayout.getCurrentScrollTop(),n.scrollTop,e.scrollType)):this._horizontalRevealRequest=null;const r=Math.abs(this._context.viewLayout.getCurrentScrollTop()-n.scrollTop)<=this._lineHeight?1:e.scrollType;return this._context.viewModel.viewLayout.setScrollPosition(n,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),n=Math.max(this._horizontalRevealRequest.startScrollTop,this._horizontalRevealRequest.stopScrollTop);(e.scrollTopn)&&(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 n=this._getViewLineDomNode(e);if(n===null)return null;const o=this._getLineNumberFor(n);if(o===-1||o<1||o>this._context.viewModel.getLineCount())return null;if(this._context.viewModel.getLineMaxColumn(o)===1)return new ae(o,1);const r=this._visibleLines.getStartLineNumber(),s=this._visibleLines.getEndLineNumber();if(os)return null;let a=this._visibleLines.getVisibleLine(o).getColumnOfNodeOffset(e,t);const l=this._context.viewModel.getLineMinColumn(o);return an)return-1;const o=new c9(this.domNode.domNode,this._textRangeRestingSpot),r=this._visibleLines.getVisibleLine(e).getWidth(o);return this._updateLineWidthsSlowIfDomDidLayout(o),r}linesVisibleRangesForRange(e,t){if(this.shouldRender())return null;const n=e.endLineNumber,o=V.intersectRanges(e,this._lastRenderedData.getCurrentVisibleRange());if(!o)return null;const r=[];let s=0;const a=new c9(this.domNode.domNode,this._textRangeRestingSpot);let l=0;t&&(l=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new ae(o.startLineNumber,1)).lineNumber);const c=this._visibleLines.getStartLineNumber(),u=this._visibleLines.getEndLineNumber();for(let d=o.startLineNumber;d<=o.endLineNumber;d++){if(du)continue;const h=d===o.startLineNumber?o.startColumn:1,f=d!==o.endLineNumber,g=f?this._context.viewModel.getLineMaxColumn(d):o.endColumn,p=this._visibleLines.getVisibleLine(d).getVisibleRangesForRange(d,h,g,a);if(!!p){if(t&&dthis._visibleLines.getEndLineNumber())return null;const o=new c9(this.domNode.domNode,this._textRangeRestingSpot),r=this._visibleLines.getVisibleLine(e).getVisibleRangesForRange(e,t,n,o);return this._updateLineWidthsSlowIfDomDidLayout(o),r}visibleRangeForPosition(e){const t=this._visibleRangesForLineRange(e.lineNumber,e.column,e.column);return t?new Hit(t.outsideRenderedLine,t.ranges[0].left):null}_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(),n=this._visibleLines.getEndLineNumber();let o=1,r=!0;for(let s=t;s<=n;s++){const a=this._visibleLines.getVisibleLine(s);if(e&&!a.getWidthIsFast()){r=!1;continue}o=Math.max(o,a.getWidth(null))}return r&&t===1&&n===this._context.viewModel.getLineCount()&&(this._maxLineWidth=0),this._ensureMaxLineWidth(o),r}_checkMonospaceFontAssumptions(){let e=-1,t=-1;const n=this._visibleLines.getStartLineNumber(),o=this._visibleLines.getEndLineNumber();for(let r=n;r<=o;r++){const s=this._visibleLines.getVisibleLine(r);if(s.needsMonospaceFontCheck()){const a=s.getWidth(null);a>t&&(t=a,e=r)}}if(e!==-1&&!this._visibleLines.getVisibleLine(e).monospaceAssumptionsAreValid())for(let r=n;r<=o;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 n=this._horizontalRevealRequest;if(e.startLineNumber<=n.minLineNumber&&n.maxLineNumber<=e.endLineNumber){this._horizontalRevealRequest=null,this.onDidRender();const o=this._computeScrollLeftToReveal(n);o&&(this._isViewportWrapping||this._ensureMaxLineWidth(o.maxHorizontalOffset),this._context.viewModel.viewLayout.setScrollPosition({scrollLeft:o.scrollLeft},n.scrollType))}}if(this._updateLineWidthsFast()?this._asyncUpdateLineWidths.cancel():this._asyncUpdateLineWidths.schedule(),xs&&!this._asyncCheckMonospaceFontAssumptions.isScheduled()){const n=this._visibleLines.getStartLineNumber(),o=this._visibleLines.getEndLineNumber();for(let r=n;r<=o;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 m=r[0].startLineNumber,_=r[0].endLineNumber;for(let y=1,w=r.length;yl){if(!u)return-1;v=d}else if(s===5||s===6)if(s===6&&a<=d&&h<=c)v=a;else{const m=Math.max(5*this._lineHeight,l*.2),_=d-m,y=h-l;v=Math.max(y,_)}else if(s===1||s===2)if(s===2&&a<=d&&h<=c)v=a;else{const m=(d+h)/2;v=Math.max(0,m-l/2)}else v=this._computeMinimumScrolling(a,c,d,h,s===3,s===4);return v}_computeScrollLeftToReveal(e){const t=this._context.viewLayout.getCurrentViewport(),n=this._context.configuration.options.get(143),o=t.left,r=o+t.width-n.verticalScrollbarWidth;let s=1073741824,a=0;if(e.type==="range"){const c=this._visibleRangesForLineRange(e.lineNumber,e.startColumn,e.endColumn);if(!c)return null;for(const u of c.ranges)s=Math.min(s,Math.round(u.left)),a=Math.max(a,Math.round(u.left+u.width))}else for(const c of e.selections){if(c.startLineNumber!==c.endLineNumber)return null;const u=this._visibleRangesForLineRange(c.startLineNumber,c.startColumn,c.endColumn);if(!u)return null;for(const d of u.ranges)s=Math.min(s,Math.round(d.left)),a=Math.max(a,Math.round(d.left+d.width))}return e.minimalReveal||(s=Math.max(0,s-w5.HORIZONTAL_EXTRA_PX),a+=this._revealHorizontalRightPadding),e.type==="selections"&&a-s>t.width?null:{scrollLeft:this._computeMinimumScrolling(o,r,s,a),maxHorizontalOffset:a}}_computeMinimumScrolling(e,t,n,o,r,s){e=e|0,t=t|0,n=n|0,o=o|0,r=!!r,s=!!s;const a=t-e;if(o-nt)return Math.max(0,o-a)}else return n;return e}}w5.HORIZONTAL_EXTRA_PX=30;class yH{constructor(e,t,n,o){this._decorationToRenderBrand=void 0,this.startLineNumber=+e,this.endLineNumber=+t,this.className=String(n),this.zIndex=o!=null?o:0}}class Rrt{constructor(e,t){this.className=e,this.zIndex=t}}class Mrt{constructor(){this.decorations=[]}add(e){this.decorations.push(e)}getDecorations(){return this.decorations}}class Fbe extends Hb{_render(e,t,n){const o=[];for(let a=e;a<=t;a++){const l=a-e;o[l]=new Mrt}if(n.length===0)return o;n.sort((a,l)=>a.className===l.className?a.startLineNumber===l.startLineNumber?a.endLineNumber-l.endLineNumber:a.startLineNumber-l.startLineNumber:a.classNameo)continue;const a=Math.max(s.startLineNumber,n),l=Math.min(r.preference.lane,this._glyphMarginDecorationLaneCount);t.push(new Ort(a,l,r.preference.zIndex,r))}}_collectSortedGlyphRenderRequests(e){const t=[];return this._collectDecorationBasedGlyphRenderRequest(e,t),this._collectWidgetBasedGlyphRenderRequest(e,t),t.sort((n,o)=>n.lineNumber===o.lineNumber?n.lane===o.lane?n.zIndex===o.zIndex?o.type===n.type?n.type===0&&o.type===0?n.className0;){const o=t.peek();if(!o)break;const r=t.takeWhile(a=>a.lineNumber===o.lineNumber&&a.lane===o.lane);if(!r||r.length===0)break;const s=r[0];if(s.type===0){const a=[];for(const l of r){if(l.zIndex!==s.zIndex||l.type!==s.type)break;(a.length===0||a[a.length-1]!==l.className)&&a.push(l.className)}n.push(s.accept(a.join(" ")))}else s.widget.renderInfo={lineNumber:s.lineNumber,lane:s.lane}}this._decorationGlyphsToRender=n}render(e){if(!this._glyphMargin){for(const n of Object.values(this._widgets))n.domNode.setDisplay("none");for(;this._managedDomNodes.length>0;){const n=this._managedDomNodes.pop();n==null||n.domNode.remove()}return}const t=Math.round(this._glyphMarginWidth/this._glyphMarginDecorationLaneCount);for(const n of Object.values(this._widgets))if(!n.renderInfo)n.domNode.setDisplay("none");else{const o=e.viewportData.relativeVerticalOffset[n.renderInfo.lineNumber-e.viewportData.startLineNumber],r=this._glyphMarginLeft+(n.renderInfo.lane-1)*this._lineHeight;n.domNode.setDisplay("block"),n.domNode.setTop(o),n.domNode.setLeft(r),n.domNode.setWidth(t),n.domNode.setHeight(this._lineHeight)}for(let n=0;nthis._decorationGlyphsToRender.length;){const n=this._managedDomNodes.pop();n==null||n.domNode.remove()}}}class Prt{constructor(e,t,n,o){this.lineNumber=e,this.lane=t,this.zIndex=n,this.className=o,this.type=0}accept(e){return new Frt(this.lineNumber,this.lane,e)}}class Ort{constructor(e,t,n,o){this.lineNumber=e,this.lane=t,this.zIndex=n,this.widget=o,this.type=1}}class Frt{constructor(e,t,n){this.lineNumber=e,this.lane=t,this.combinedClassName=n}}class Brt extends Fbe{constructor(e){super(),this._context=e;const n=this._context.configuration.options.get(143);this._decorationsLeft=n.decorationsLeft,this._decorationsWidth=n.decorationsWidth,this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){const n=this._context.configuration.options.get(143);return this._decorationsLeft=n.decorationsLeft,this._decorationsWidth=n.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(),n=[];let o=0;for(let r=0,s=t.length;r',l=[];for(let c=t;c<=n;c++){const u=c-t,d=o[u].getDecorations();let h="";for(const f of d)h+='
';r[a]=c}this._renderResult=r}render(e,t){return this._renderResult?this._renderResult[t-e]:""}}class Tc{constructor(e,t,n,o){this._rgba8Brand=void 0,this.r=Tc._clamp(e),this.g=Tc._clamp(t),this.b=Tc._clamp(n),this.a=Tc._clamp(o)}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}}Tc.Empty=new Tc(0,0,0,0);class eT extends _e{static getInstance(){return this._INSTANCE||(this._INSTANCE=new eT),this._INSTANCE}constructor(){super(),this._onDidChange=new le,this.onDidChange=this._onDidChange.event,this._updateColorMap(),this._register(oo.onDidChange(e=>{e.changedColorMap&&this._updateColorMap()}))}_updateColorMap(){const e=oo.getColorMap();if(!e){this._colors=[Tc.Empty],this._backgroundIsLight=!0;return}this._colors=[Tc.Empty];for(let n=1;n=.5,this._onDidChange.fire(void 0)}getColor(e){return(e<1||e>=this._colors.length)&&(e=2),this._colors[e]}backgroundIsLight(){return this._backgroundIsLight}}eT._INSTANCE=null;const Vrt=(()=>{const i=[];for(let e=32;e<=126;e++)i.push(e);return i.push(65533),i})(),Hrt=(i,e)=>(i-=32,i<0||i>96?e<=2?(i+96)%96:96-1:i);class ek{constructor(e,t){this.scale=t,this._minimapCharRendererBrand=void 0,this.charDataNormal=ek.soften(e,12/15),this.charDataLight=ek.soften(e,50/60)}static soften(e,t){const n=new Uint8ClampedArray(e.length);for(let o=0,r=e.length;oe.width||n+g>e.height){console.warn("bad render request outside image data");return}const p=u?this.charDataLight:this.charDataNormal,v=Hrt(o,c),m=e.width*4,_=a.r,y=a.g,w=a.b,L=r.r-_,D=r.g-y,E=r.b-w,I=Math.max(s,l),k=e.data;let R=v*h*f,A=n*m+t*4;for(let P=0;Pe.width||n+d>e.height){console.warn("bad render request outside image data");return}const h=e.width*4,f=.5*(r/255),g=s.r,p=s.g,v=s.b,m=o.r-g,_=o.g-p,y=o.b-v,w=g+m*f,L=p+_*f,D=v+y*f,E=Math.max(r,a),I=e.data;let k=n*h+t*4;for(let R=0;R{const e=new Uint8ClampedArray(i.length/2);for(let t=0;t>1]=jre[i[t]]<<4|jre[i[t+1]]&15;return e},qre={1:bv(()=>Kre("0000511D6300CF609C709645A78432005642574171487021003C451900274D35D762755E8B629C5BA856AF57BA649530C167D1512A272A3F6038604460398526BCA2A968DB6F8957C768BE5FBE2FB467CF5D8D5B795DC7625B5DFF50DE64C466DB2FC47CD860A65E9A2EB96CB54CE06DA763AB2EA26860524D3763536601005116008177A8705E53AB738E6A982F88BAA35B5F5B626D9C636B449B737E5B7B678598869A662F6B5B8542706C704C80736A607578685B70594A49715A4522E792")),2:bv(()=>Kre("000000000000000055394F383D2800008B8B1F210002000081B1CBCBCC820000847AAF6B9AAF2119BE08B8881AD60000A44FD07DCCF107015338130C00000000385972265F390B406E2437634B4B48031B12B8A0847000001E15B29A402F0000000000004B33460B00007A752C2A0000000000004D3900000084394B82013400ABA5CFC7AD9C0302A45A3E5A98AB000089A43382D97900008BA54AA087A70A0248A6A7AE6DBE0000BF6F94987EA40A01A06DCFA7A7A9030496C32F77891D0000A99FB1A0AFA80603B29AB9CA75930D010C0948354D3900000C0948354F37460D0028BE673D8400000000AF9D7B6E00002B007AA8933400007AA642675C2700007984CFB9C3985B768772A8A6B7B20000CAAECAAFC4B700009F94A6009F840009D09F9BA4CA9C0000CC8FC76DC87F0000C991C472A2000000A894A48CA7B501079BA2C9C69BA20000B19A5D3FA89000005CA6009DA2960901B0A7F0669FB200009D009E00B7890000DAD0F5D092820000D294D4C48BD10000B5A7A4A3B1A50402CAB6CBA6A2000000B5A7A4A3B1A8044FCDADD19D9CB00000B7778F7B8AAE0803C9AB5D3F5D3F00009EA09EA0BAB006039EA0989A8C7900009B9EF4D6B7C00000A9A7816CACA80000ABAC84705D3F000096DA635CDC8C00006F486F266F263D4784006124097B00374F6D2D6D2D6D4A3A95872322000000030000000000008D8939130000000000002E22A5C9CBC70600AB25C0B5C9B400061A2DB04CA67001082AA6BEBEBFC606002321DACBC19E03087AA08B6768380000282FBAC0B8CA7A88AD25BBA5A29900004C396C5894A6000040485A6E356E9442A32CD17EADA70000B4237923628600003E2DE9C1D7B500002F25BBA5A2990000231DB6AFB4A804023025C0B5CAB588062B2CBDBEC0C706882435A75CA20000002326BD6A82A908048B4B9A5A668000002423A09CB4BB060025259C9D8A7900001C1FCAB2C7C700002A2A9387ABA200002626A4A47D6E9D14333163A0C87500004B6F9C2D643A257049364936493647358A34438355497F1A0000A24C1D590000D38DFFBDD4CD3126"))};class pE{static create(e,t){if(this.lastCreated&&e===this.lastCreated.scale&&t===this.lastFontFamily)return this.lastCreated;let n;return qre[e]?n=new ek(qre[e](),e):n=pE.createFromSampleData(pE.createSampleData(t).data,e),this.lastFontFamily=t,this.lastCreated=n,n}static createSampleData(e){const t=document.createElement("canvas"),n=t.getContext("2d");t.style.height=`${16}px`,t.height=16,t.width=96*10,t.style.width=96*10+"px",n.fillStyle="#ffffff",n.font=`bold ${16}px ${e}`,n.textBaseline="middle";let o=0;for(const r of Vrt)n.fillText(String.fromCharCode(r),o,16/2),o+=10;return n.getImageData(0,0,96*10,16)}static createFromSampleData(e,t){if(e.length!==61440)throw new Error("Unexpected source in MinimapCharRenderer");const o=pE._downsample(e,t);return new ek(o,t)}static _downsampleChar(e,t,n,o,r){const s=1*r,a=2*r;let l=o,c=0;for(let u=0;u0){const c=255/l;for(let u=0;upE.create(this.fontScale,l.fontFamily)),this.defaultBackgroundColor=n.getColor(2),this.backgroundColor=tk._getMinimapBackground(t,this.defaultBackgroundColor),this.foregroundAlpha=tk._getMinimapForegroundOpacity(t)}static _getMinimapBackground(e,t){const n=e.getColor(xit);return n?new Tc(n.rgba.r,n.rgba.g,n.rgba.b,Math.round(255*n.rgba.a)):t}static _getMinimapForegroundOpacity(e){const t=e.getColor(Lit);return t?Tc._clamp(Math.round(255*t.rgba.a)):255}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.defaultBackgroundColor&&this.defaultBackgroundColor.equals(e.defaultBackgroundColor)&&this.backgroundColor&&this.backgroundColor.equals(e.backgroundColor)&&this.foregroundAlpha===e.foregroundAlpha}}class mE{constructor(e,t,n,o,r,s,a,l,c){this.scrollTop=e,this.scrollHeight=t,this.sliderNeeded=n,this._computedSliderRatio=o,this.sliderTop=r,this.sliderHeight=s,this.topPaddingLineCount=a,this.startLineNumber=l,this.endLineNumber=c}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),n=Math.min(this.endLineNumber,e.endLineNumber);return t>n?null:[t,n]}getYForLineNumber(e,t){return+(e-this.startLineNumber+this.topPaddingLineCount)*t}static create(e,t,n,o,r,s,a,l,c,u,d){const h=e.pixelRatio,f=e.minimapLineHeight,g=Math.floor(e.canvasInnerHeight/f),p=e.lineHeight;if(e.minimapHeightIsEditorHeight){let D=l*e.lineHeight+e.paddingTop+e.paddingBottom;e.scrollBeyondLastLine&&(D+=Math.max(0,r-e.lineHeight-e.paddingBottom));const E=Math.max(1,Math.floor(r*r/D)),I=Math.max(0,e.minimapHeight-E),k=I/(u-r),R=c*k,A=I>0,P=Math.floor(e.canvasInnerHeight/e.minimapLineHeight),N=Math.floor(e.paddingTop/e.lineHeight);return new mE(c,u,A,k,R,E,N,1,Math.min(a,P))}let v;if(s&&n!==a){const D=n-t+1;v=Math.floor(D*f/h)}else{const D=r/p;v=Math.floor(D*f/h)}const m=Math.floor(e.paddingTop/p);let _=Math.floor(e.paddingBottom/p);if(e.scrollBeyondLastLine){const D=r/p;_=Math.max(_,D-1)}let y;if(_>0){const D=r/p;y=(m+a+_-D-1)*f/h}else y=Math.max(0,(m+a)*f/h-v);y=Math.min(e.minimapHeight-v,y);const w=y/(u-r),L=c*w;if(g>=m+a+_){const D=y>0;return new mE(c,u,D,w,L,v,m,1,a)}else{let D;t>1?D=t+m:D=Math.max(1,c/p);let E,I=Math.max(1,Math.floor(D-L*h/f));Ic&&(I=Math.min(I,d.startLineNumber),E=Math.max(E,d.topPaddingLineCount)),d.scrollTop=e.paddingTop?A=(t-I+E+R)*f/h:A=c/e.paddingTop*(E+R)*f/h,new mE(c,u,!0,w,A,v,E,I,k)}}}class hP{constructor(e){this.dy=e}onContentChanged(){this.dy=-1}onTokensChanged(){this.dy=-1}}hP.INVALID=new hP(-1);class Gre{constructor(e,t,n){this.renderedLayout=e,this._imageData=t,this._renderedLines=new Nbe(()=>hP.INVALID),this._renderedLines._set(e.startLineNumber,n)}linesEquals(e){if(!this.scrollEquals(e))return!1;const n=this._renderedLines._get().lines;for(let o=0,r=n.length;o1){for(let m=0,_=o-1;m<_;m++)v[m]=Math.round(m*r+s);v[o-1]=t}return[new nk(r,v),[]]}const a=n.minimapLines,l=a.length,c=[];let u=0,d=0,h=1;const f=10;let g=[],p=null;for(let v=0;v0&&this.minimapLines[n-1]>=e;)n--;let o=this.modelLineToMinimapLine(t)-1;for(;o+1t)return null}return[n+1,o+1]}decorationLineRangeToMinimapLineRange(e,t){let n=this.modelLineToMinimapLine(e),o=this.modelLineToMinimapLine(t);return e!==t&&o===n&&(o===this.minimapLines.length?n>1&&n--:o++),[n,o]}onLinesDeleted(e){const t=e.toLineNumber-e.fromLineNumber+1;let n=this.minimapLines.length,o=0;for(let r=this.minimapLines.length-1;r>=0&&!(this.minimapLines[r]=0&&!(this.minimapLines[n]0,scrollWidth:e.scrollWidth,scrollHeight:e.scrollHeight,viewportStartLineNumber:t,viewportEndLineNumber:n,viewportStartLineNumberVerticalOffset:e.getVerticalOffsetForLineNumber(t),scrollTop:e.scrollTop,scrollLeft:e.scrollLeft,viewportWidth:e.viewportWidth,viewportHeight:e.viewportHeight};this._actual.render(o)}_recreateLineSampling(){this._minimapSelections=null;const e=Boolean(this._samplingState),[t,n]=nk.compute(this.options,this._context.viewModel.getLineCount(),this._samplingState);if(this._samplingState=t,e&&this._samplingState)for(const o of n)switch(o.type){case"deleted":this._actual.onLinesDeleted(o.deleteFromLineNumber,o.deleteToLineNumber);break;case"inserted":this._actual.onLinesInserted(o.insertFromLineNumber,o.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,n){if(this._samplingState){const o=[];for(let r=0,s=t-e+1;r{if(n.preventDefault(),this._model.options.renderMinimap===0||!this._lastRenderData)return;if(this._model.options.size!=="proportional"){if(n.button===0&&this._lastRenderData){const c=Yo(this._slider.domNode),u=c.top+c.height/2;this._startSliderDragging(n,u,this._lastRenderData.renderedLayout)}return}const r=this._model.options.minimapLineHeight,s=this._model.options.canvasInnerHeight/this._model.options.canvasOuterHeight*n.offsetY;let l=Math.floor(s/r)+this._lastRenderData.renderedLayout.startLineNumber-this._lastRenderData.renderedLayout.topPaddingLineCount;l=Math.min(l,this._model.getLineCount()),this._model.revealLineNumber(l)}),this._sliderPointerMoveMonitor=new yS,this._sliderPointerDownListener=No(this._slider.domNode,et.POINTER_DOWN,n=>{n.preventDefault(),n.stopPropagation(),n.button===0&&this._lastRenderData&&this._startSliderDragging(n,n.pageY,this._lastRenderData.renderedLayout)}),this._gestureDisposable=Ei.addTarget(this._domNode.domNode),this._sliderTouchStartListener=ke(this._domNode.domNode,Di.Start,n=>{n.preventDefault(),n.stopPropagation(),this._lastRenderData&&(this._slider.toggleClassName("active",!0),this._gestureInProgress=!0,this.scrollDueToTouchEvent(n))},{passive:!1}),this._sliderTouchMoveListener=ke(this._domNode.domNode,Di.Change,n=>{n.preventDefault(),n.stopPropagation(),this._lastRenderData&&this._gestureInProgress&&this.scrollDueToTouchEvent(n)},{passive:!1}),this._sliderTouchEndListener=No(this._domNode.domNode,Di.End,n=>{n.preventDefault(),n.stopPropagation(),this._gestureInProgress=!1,this._slider.toggleClassName("active",!1)})}_startSliderDragging(e,t,n){if(!e.target||!(e.target instanceof Element))return;const o=e.pageX;this._slider.toggleClassName("active",!0);const r=(s,a)=>{const l=Yo(this._domNode.domNode),c=Math.min(Math.abs(a-o),Math.abs(a-l.left),Math.abs(a-l.left-l.width));if(ls&&c>$rt){this._model.setScrollTop(n.scrollTop);return}const u=s-t;this._model.setScrollTop(n.getDesiredScrollTopFromDelta(u))};e.pageY!==t&&r(e.pageY,o),this._sliderPointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,s=>r(s.pageY,s.pageX),()=>{this._slider.toggleClassName("active",!1)})}scrollDueToTouchEvent(e){const t=this._domNode.domNode.getBoundingClientRect().top,n=this._lastRenderData.renderedLayout.getDesiredScrollTopFromTouchLocation(e.pageY-t);this._model.setScrollTop(n)}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 AG(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){var n;return(n=this._lastRenderData)===null||n===void 0||n.onLinesDeleted(e,t),!0}onLinesInserted(e,t){var n;return(n=this._lastRenderData)===null||n===void 0||n.onLinesInserted(e,t),!0}onScrollChanged(){return this._renderDecorations=!0,!0}onThemeChanged(){return this._selectionColor=this._theme.getColor(Nre),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===0){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 n=mE.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(n.sliderNeeded?"block":"none"),this._slider.setTop(n.sliderTop),this._slider.setHeight(n.sliderHeight),this._sliderHorizontal.setLeft(0),this._sliderHorizontal.setWidth(this._model.options.minimapWidth),this._sliderHorizontal.setTop(0),this._sliderHorizontal.setHeight(n.sliderHeight),this.renderDecorations(n),this._lastRenderData=this.renderLines(n)}renderDecorations(e){if(this._renderDecorations){this._renderDecorations=!1;const t=this._model.getSelections();t.sort(V.compareRangesUsingStarts);const n=this._model.getMinimapDecorationsInViewport(e.startLineNumber,e.endLineNumber);n.sort((h,f)=>(h.options.zIndex||0)-(f.options.zIndex||0));const{canvasInnerWidth:o,canvasInnerHeight:r}=this._model.options,s=this._model.options.minimapLineHeight,a=this._model.options.minimapCharWidth,l=this._model.getOptions().tabSize,c=this._decorationsCanvas.domNode.getContext("2d");c.clearRect(0,0,o,r);const u=new Xre(e.startLineNumber,e.endLineNumber,!1);this._renderSelectionLineHighlights(c,t,u,e,s),this._renderDecorationsLineHighlights(c,n,u,e,s);const d=new Xre(e.startLineNumber,e.endLineNumber,null);this._renderSelectionsHighlights(c,t,d,e,s,l,a,o),this._renderDecorationsHighlights(c,n,d,e,s,l,a,o)}}_renderSelectionLineHighlights(e,t,n,o,r){if(!this._selectionColor||this._selectionColor.isTransparent())return;e.fillStyle=this._selectionColor.transparent(.5).toString();let s=0,a=0;for(const l of t){const c=o.intersectWithViewport(l);if(!c)continue;const[u,d]=c;for(let g=u;g<=d;g++)n.set(g,!0);const h=o.getYForLineNumber(u,r),f=o.getYForLineNumber(d,r);a>=h||(a>s&&e.fillRect(jp,s,e.canvas.width,a-s),s=h),a=f}a>s&&e.fillRect(jp,s,e.canvas.width,a-s)}_renderDecorationsLineHighlights(e,t,n,o,r){const s=new Map;for(let a=t.length-1;a>=0;a--){const l=t[a],c=l.options.minimap;if(!c||c.position!==ll.Inline)continue;const u=o.intersectWithViewport(l.range);if(!u)continue;const[d,h]=u,f=c.getColor(this._theme.value);if(!f||f.isTransparent())continue;let g=s.get(f.toString());g||(g=f.transparent(.5).toString(),s.set(f.toString(),g)),e.fillStyle=g;for(let p=d;p<=h;p++){if(n.has(p))continue;n.set(p,!0);const v=o.getYForLineNumber(d,r);e.fillRect(jp,v,e.canvas.width,r)}}}_renderSelectionsHighlights(e,t,n,o,r,s,a,l){if(!(!this._selectionColor||this._selectionColor.isTransparent()))for(const c of t){const u=o.intersectWithViewport(c);if(!u)continue;const[d,h]=u;for(let f=d;f<=h;f++)this.renderDecorationOnLine(e,n,c,this._selectionColor,o,f,r,r,s,a,l)}}_renderDecorationsHighlights(e,t,n,o,r,s,a,l){for(const c of t){const u=c.options.minimap;if(!u)continue;const d=o.intersectWithViewport(c.range);if(!d)continue;const[h,f]=d,g=u.getColor(this._theme.value);if(!(!g||g.isTransparent()))for(let p=h;p<=f;p++)switch(u.position){case ll.Inline:this.renderDecorationOnLine(e,n,c.range,g,o,p,r,r,s,a,l);continue;case ll.Gutter:{const v=o.getYForLineNumber(p,r),m=2;this.renderDecoration(e,g,m,v,zrt,r);continue}}}}renderDecorationOnLine(e,t,n,o,r,s,a,l,c,u,d){const h=r.getYForLineNumber(s,l);if(h+a<0||h>this._model.options.canvasInnerHeight)return;const{startLineNumber:f,endLineNumber:g}=n,p=f===s?n.startColumn:1,v=g===s?n.endColumn:this._model.getLineMaxColumn(s),m=this.getXOffsetForPosition(t,s,p,c,u,d),_=this.getXOffsetForPosition(t,s,v,c,u,d);this.renderDecoration(e,o,m,h,_-m,a)}getXOffsetForPosition(e,t,n,o,r,s){if(n===1)return jp;if((n-1)*r>=s)return s;let l=e.get(t);if(!l){const c=this._model.getLineContent(t);l=[jp];let u=jp;for(let d=1;d=s){l[d]=s;break}l[d]=g,u=g}e.set(t,l)}return n-1L?Math.floor((o-L)/2):0,E=h.a/255,I=new Tc(Math.round((h.r-d.r)*E+d.r),Math.round((h.g-d.g)*E+d.g),Math.round((h.b-d.b)*E+d.b),255);let k=e.topPaddingLineCount*o;const R=[];for(let H=0,B=n-t+1;H=0&&A_)return;const P=v.charCodeAt(L);if(P===9){const N=h-(L+D)%h;D+=N-1,w+=N*s}else if(P===32)w+=s;else{const N=Cv(P)?2:1;for(let M=0;M_)return}}}}}class Xre{constructor(e,t,n){this._startLineNumber=e,this._endLineNumber=t,this._defaultValue=n,this._values=[];for(let o=0,r=this._endLineNumber-this._startLineNumber+1;othis._endLineNumber||(this._values[e-this._startLineNumber]=t)}get(e){return ethis._endLineNumber?this._defaultValue:this._values[e-this._startLineNumber]}}class jrt extends pl{constructor(e){super(e);const n=this._context.configuration.options.get(143);this._widgets={},this._verticalScrollbarWidth=n.verticalScrollbarWidth,this._minimapWidth=n.minimap.minimapWidth,this._horizontalScrollbarHeight=n.horizontalScrollbarHeight,this._editorHeight=n.height,this._editorWidth=n.width,this._domNode=ti(document.createElement("div")),vf.write(this._domNode,4),this._domNode.setClassName("overlayWidgets")}dispose(){super.dispose(),this._widgets={}}getDomNode(){return this._domNode}onConfigurationChanged(e){const n=this._context.configuration.options.get(143);return this._verticalScrollbarWidth=n.verticalScrollbarWidth,this._minimapWidth=n.minimap.minimapWidth,this._horizontalScrollbarHeight=n.horizontalScrollbarHeight,this._editorHeight=n.height,this._editorWidth=n.width,!0}addWidget(e){const t=ti(e.getDomNode());this._widgets[e.getId()]={widget:e,preference:null,domNode:t},t.setPosition("absolute"),t.setAttribute("widgetId",e.getId()),this._domNode.appendChild(t),this.setShouldRender(),this._updateMaxMinWidth()}setWidgetPosition(e,t){const n=this._widgets[e.getId()];return n.preference===t?(this._updateMaxMinWidth(),!1):(n.preference=t,this.setShouldRender(),this._updateMaxMinWidth(),!0)}removeWidget(e){const t=e.getId();if(this._widgets.hasOwnProperty(t)){const o=this._widgets[t].domNode.domNode;delete this._widgets[t],o.parentNode.removeChild(o),this.setShouldRender(),this._updateMaxMinWidth()}}_updateMaxMinWidth(){var e,t;let n=0;const o=Object.keys(this._widgets);for(let r=0,s=o.length;r=3){const r=Math.floor(o/3),s=Math.floor(o/3),a=o-r-s,l=e,c=l+r,u=l+r+a;return[[0,l,c,l,u,l,c,l],[0,r,a,r+a,s,r+a+s,a+s,r+a+s]]}else if(n===2){const r=Math.floor(o/2),s=o-r,a=e,l=a+r;return[[0,a,a,a,l,a,a,a],[0,r,r,r,s,r+s,r+s,r+s]]}else{const r=e,s=o;return[[0,r,r,r,r,r,r,r],[0,s,s,s,s,s,s,s]]}}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.cursorColor===e.cursorColor&&this.themeType===e.themeType&&ve.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}}class qrt extends pl{constructor(e){super(e),this._actualShouldRender=0,this._renderedDecorations=[],this._renderedCursorPositions=[],this._domNode=ti(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=oo.onDidChange(t=>{t.changedColorMap&&this._updateSettings(!0)}),this._cursorPositions=[]}dispose(){super.dispose(),this._tokensColorTrackerListener.dispose()}_updateSettings(e){const t=new Krt(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=2,!0}_markRenderingIsMaybeNeeded(){return this._actualShouldRender=1,!0}onConfigurationChanged(e){return this._updateSettings(!1)?this._markRenderingIsNeeded():!1}onCursorStateChanged(e){this._cursorPositions=[];for(let t=0,n=e.selections.length;tg.lineNumber===p.lineNumber)&&(this._actualShouldRender=2),this._actualShouldRender===1)return;this._renderedDecorations=t,this._renderedCursorPositions=this._cursorPositions,this._domNode.setDisplay("block");const n=this._settings.canvasWidth,o=this._settings.canvasHeight,r=this._settings.lineHeight,s=this._context.viewLayout,a=this._context.viewLayout.getScrollHeight(),l=o/a,c=6*this._settings.pixelRatio|0,u=c/2|0,d=this._domNode.domNode.getContext("2d");e?e.isOpaque()?(d.fillStyle=ve.Format.CSS.formatHexA(e),d.fillRect(0,0,n,o)):(d.clearRect(0,0,n,o),d.fillStyle=ve.Format.CSS.formatHexA(e),d.fillRect(0,0,n,o)):d.clearRect(0,0,n,o);const h=this._settings.x,f=this._settings.w;for(const g of t){const p=g.color,v=g.data;d.fillStyle=p;let m=0,_=0,y=0;for(let w=0,L=v.length/3;wo&&(P=o-u),k=P-u,R=P+u}k>y+1||D!==m?(w!==0&&d.fillRect(h[m],_,f[m],y-_),m=D,_=k,y=R):R>y&&(y=R)}d.fillRect(h[m],_,f[m],y-_)}if(!this._settings.hideCursor&&this._settings.cursorColor){const g=2*this._settings.pixelRatio|0,p=g/2|0,v=this._settings.x[7],m=this._settings.w[7];d.fillStyle=this._settings.cursorColor;let _=-100,y=-100;for(let w=0,L=this._cursorPositions.length;wo&&(E=o-p);const I=E-p,k=I+g;I>y+1?(w!==0&&d.fillRect(v,_,m,y-_),_=I,y=k):k>y&&(y=k)}d.fillRect(v,_,m,y-_)}this._settings.renderBorder&&this._settings.borderColor&&this._settings.overviewRulerLanes>0&&(d.beginPath(),d.lineWidth=1,d.strokeStyle=this._settings.borderColor,d.moveTo(0,0),d.lineTo(0,o),d.stroke(),d.moveTo(0,0),d.lineTo(n,0),d.stroke())}}class Yre{constructor(e,t,n){this._colorZoneBrand=void 0,this.from=e|0,this.to=t|0,this.colorId=n|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 Bbe{constructor(e,t,n,o){this._overviewRulerZoneBrand=void 0,this.startLineNumber=e,this.endLineNumber=t,this.heightInLines=n,this.color=o,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.colorn&&(p=n-v);const m=u.color;let _=this._color2Id[m];_||(_=++this._lastAssignedId,this._color2Id[m]=_,this._id2Color[_]=m);const y=new Yre(p-v,p+v,_);u.setColorZone(y),a.push(y)}return this._colorZonesInvalid=!1,a.sort(Yre.compare),a}}class Xrt extends GI{constructor(e,t){super(),this._context=e;const n=this._context.configuration.options;this._domNode=ti(document.createElement("canvas")),this._domNode.setClassName(t),this._domNode.setPosition("absolute"),this._domNode.setLayerHinting(!0),this._domNode.setContain("strict"),this._zoneManager=new Grt(o=>this._context.viewLayout.getVerticalOffsetForLineNumber(o)),this._zoneManager.setDOMWidth(0),this._zoneManager.setDOMHeight(0),this._zoneManager.setOuterHeight(this._context.viewLayout.getScrollHeight()),this._zoneManager.setLineHeight(n.get(66)),this._zoneManager.setPixelRatio(n.get(141)),this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return e.hasChanged(66)&&(this._zoneManager.setLineHeight(t.get(66)),this._render()),e.hasChanged(141)&&(this._zoneManager.setPixelRatio(t.get(141)),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(),n=this._zoneManager.resolveColorZones(),o=this._zoneManager.getId2Color(),r=this._domNode.domNode.getContext("2d");return r.clearRect(0,0,e,t),n.length>0&&this._renderOneLane(r,n,o,e),!0}_renderOneLane(e,t,n,o){let r=0,s=0,a=0;for(const l of t){const c=l.colorId,u=l.from,d=l.to;c!==r?(e.fillRect(0,s,o,a-s),r=c,e.fillStyle=n[r],s=u,a=d):a>=u?a=Math.max(a,d):(e.fillRect(0,s,o,a-s),s=u,a=d)}e.fillRect(0,s,o,a-s)}}class Yrt extends pl{constructor(e){super(e),this.domNode=ti(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(101),this._typicalHalfwidthCharacterWidth=t.get(50).typicalHalfwidthCharacterWidth}dispose(){super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return this._rulers=t.get(101),this._typicalHalfwidthCharacterWidth=t.get(50).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=ti(document.createElement("div"));a.setClassName("view-ruler"),a.setWidth(r),this.domNode.appendChild(a),this._renderedRulers.push(a),s--}return}let n=e-t;for(;n>0;){const o=this._renderedRulers.pop();this.domNode.removeChild(o),n--}}render(e){this._ensureRulersCount();for(let t=0,n=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(143);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 n=this._context.configuration.options.get(102);return this._useShadows=n.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":"")}}class Qrt{constructor(e){this.left=e.left,this.width=e.width,this.startStyle=null,this.endStyle=null}}class Jrt{constructor(e,t){this.lineNumber=e,this.ranges=t}}function est(i){return new Qrt(i)}function tst(i){return new Jrt(i.lineNumber,i.ranges.map(est))}class yo extends Hb{constructor(e){super(),this._previousFrameVisibleRangesWithStyle=[],this._context=e;const t=this._context.configuration.options;this._lineHeight=t.get(66),this._roundedSelection=t.get(100),this._typicalHalfwidthCharacterWidth=t.get(50).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._lineHeight=t.get(66),this._roundedSelection=t.get(100),this._typicalHalfwidthCharacterWidth=t.get(50).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,n=e.length;t1)return!0;return!1}_enrichVisibleRangesWithStyle(e,t,n){const o=this._typicalHalfwidthCharacterWidth/4;let r=null,s=null;if(n&&n.length>0&&t.length>0){const a=t[0].lineNumber;if(a===e.startLineNumber)for(let c=0;!r&&c=0;c--)n[c].lineNumber===l&&(s=n[c].ranges[0]);r&&!r.startStyle&&(r=null),s&&!s.startStyle&&(s=null)}for(let a=0,l=t.length;a0){const g=t[a-1].ranges[0].left,p=t[a-1].ranges[0].left+t[a-1].ranges[0].width;_2(u-g)g&&(h.top=1),_2(d-p)'}_actualRenderOneSelection(e,t,n,o){if(o.length===0)return;const r=!!o[0].ranges[0].startStyle,s=this._lineHeight.toString(),a=(this._lineHeight-1).toString(),l=o[0].lineNumber,c=o[o.length-1].lineNumber;for(let u=0,d=o.length;u1,c)}this._previousFrameVisibleRangesWithStyle=r,this._renderResult=t.map(([s,a])=>s+a)}render(e,t){if(!this._renderResult)return"";const n=t-e;return n<0||n>=this._renderResult.length?"":this._renderResult[n]}}yo.SELECTION_CLASS_NAME="selected-text";yo.SELECTION_TOP_LEFT="top-left-radius";yo.SELECTION_BOTTOM_LEFT="bottom-left-radius";yo.SELECTION_TOP_RIGHT="top-right-radius";yo.SELECTION_BOTTOM_RIGHT="bottom-right-radius";yo.EDITOR_BACKGROUND_CLASS_NAME="monaco-editor-background";yo.ROUNDED_PIECE_WIDTH=10;ju((i,e)=>{const t=i.getColor(Tnt);t&&!t.isTransparent()&&e.addRule(`.monaco-editor .view-line span.inline-selected-text { color: ${t}; }`)});function _2(i){return i<0?-i:i}class Zre{constructor(e,t,n,o,r,s,a){this.top=e,this.left=t,this.paddingLeft=n,this.width=o,this.height=r,this.textContent=s,this.textContentClassName=a}}class Qre{constructor(e){this._context=e;const t=this._context.configuration.options,n=t.get(50);this._cursorStyle=t.get(28),this._lineHeight=t.get(66),this._typicalHalfwidthCharacterWidth=n.typicalHalfwidthCharacterWidth,this._lineCursorWidth=Math.min(t.get(31),this._typicalHalfwidthCharacterWidth),this._isVisible=!0,this._domNode=ti(document.createElement("div")),this._domNode.setClassName(`cursor ${xy}`),this._domNode.setHeight(this._lineHeight),this._domNode.setTop(0),this._domNode.setLeft(0),ss(this._domNode,n),this._domNode.setDisplay("none"),this._position=new ae(1,1),this._lastRenderedContent="",this._renderData=null}getDomNode(){return this._domNode}getPosition(){return this._position}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,n=t.get(50);return this._cursorStyle=t.get(28),this._lineHeight=t.get(66),this._typicalHalfwidthCharacterWidth=n.typicalHalfwidthCharacterWidth,this._lineCursorWidth=Math.min(t.get(31),this._typicalHalfwidthCharacterWidth),ss(this._domNode,n),!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,n=this._context.viewModel.getLineContent(e),[o,r]=gZe(n,t-1);return[new ae(e,o+1),n.substring(o,r)]}_prepareRender(e){let t="",n="";const[o,r]=this._getGraphemeAwarePosition();if(this._cursorStyle===Wr.Line||this._cursorStyle===Wr.LineThin){const h=e.visibleRangeForPosition(o);if(!h||h.outsideRenderedLine)return null;let f;this._cursorStyle===Wr.Line?(f=Toe(this._lineCursorWidth>0?this._lineCursorWidth:2),f>2&&(t=r,n=this._getTokenClassName(o))):f=Toe(1);let g=h.left,p=0;f>=2&&g>=1&&(p=1,g-=p);const v=e.getVerticalOffsetForLineNumber(o.lineNumber)-e.bigNumbersDelta;return new Zre(v,g,p,f,this._lineHeight,t,n)}const s=e.linesVisibleRangesForRange(new V(o.lineNumber,o.column,o.lineNumber,o.column+r.length),!1);if(!s||s.length===0)return null;const a=s[0];if(a.outsideRenderedLine||a.ranges.length===0)return null;const l=a.ranges[0],c=r===" "?this._typicalHalfwidthCharacterWidth:l.width<1?this._typicalHalfwidthCharacterWidth:l.width;this._cursorStyle===Wr.Block&&(t=r,n=this._getTokenClassName(o));let u=e.getVerticalOffsetForLineNumber(o.lineNumber)-e.bigNumbersDelta,d=this._lineHeight;return(this._cursorStyle===Wr.Underline||this._cursorStyle===Wr.UnderlineThin)&&(u+=this._lineHeight-2,d=2),new Zre(u,l.left,0,c,d,t,n)}_getTokenClassName(e){const t=this._context.viewModel.getViewLineData(e.lineNumber),n=t.tokens.findTokenIndexAtOffset(e.column-1);return t.tokens.getClassName(n)}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 ${xy} ${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)}}class ik extends pl{constructor(e){super(e);const t=this._context.configuration.options;this._readOnly=t.get(90),this._cursorBlinking=t.get(26),this._cursorStyle=t.get(28),this._cursorSmoothCaretAnimation=t.get(27),this._selectionIsEmpty=!0,this._isComposingInput=!1,this._isVisible=!1,this._primaryCursor=new Qre(this._context),this._secondaryCursors=[],this._renderData=[],this._domNode=ti(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 zu,this._cursorFlatBlinkInterval=new $I,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(90),this._cursorBlinking=t.get(26),this._cursorStyle=t.get(28),this._cursorSmoothCaretAnimation=t.get(27),this._updateBlinking(),this._updateDomClassName(),this._primaryCursor.onConfigurationChanged(e);for(let n=0,o=this._secondaryCursors.length;nt.length){const r=this._secondaryCursors.length-t.length;for(let s=0;s{for(let o=0,r=e.ranges.length;o{this._isVisible?this._hide():this._show()},ik.BLINK_INTERVAL):this._startCursorBlinkAnimation.setIfNotSet(()=>{this._blinkingEnabled=!0,this._updateDomClassName()},ik.BLINK_INTERVAL))}_updateDomClassName(){this._domNode.setClassName(this._getClassName())}_getClassName(){let e="cursors-layer";switch(this._selectionIsEmpty||(e+=" has-selection"),this._cursorStyle){case Wr.Line:e+=" cursor-line-style";break;case Wr.Block:e+=" cursor-block-style";break;case Wr.Underline:e+=" cursor-underline-style";break;case Wr.LineThin:e+=" cursor-line-thin-style";break;case Wr.BlockOutline:e+=" cursor-block-outline-style";break;case Wr.UnderlineThin:e+=" cursor-underline-thin-style";break;default:e+=" cursor-line-style"}if(this._blinkingEnabled)switch(this._getCursorBlinking()){case 1:e+=" cursor-blink";break;case 2:e+=" cursor-smooth";break;case 3:e+=" cursor-phase";break;case 4:e+=" cursor-expand";break;case 5: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=i.getColor(ybe);if(t){let n=i.getColor(_ot);n||(n=t.opposite()),e.addRule(`.monaco-editor .cursors-layer .cursor { background-color: ${t}; border-color: ${t}; color: ${n}; }`),Hd(i.type)&&e.addRule(`.monaco-editor .cursors-layer.has-selection .cursor { border-left: 1px solid ${n}; border-right: 1px solid ${n}; }`)}});const u9=()=>{throw new Error("Invalid change accessor")};class nst extends pl{constructor(e){super(e);const t=this._context.configuration.options,n=t.get(143);this._lineHeight=t.get(66),this._contentWidth=n.contentWidth,this._contentLeft=n.contentLeft,this.domNode=ti(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=ti(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 o of e)t.set(o.id,o);let n=!1;return this._context.viewModel.changeWhitespace(o=>{const r=Object.keys(this._zones);for(let s=0,a=r.length;s{const o={addZone:r=>(t=!0,this._addZone(n,r)),removeZone:r=>{!r||(t=this._removeZone(n,r)||t)},layoutZone:r=>{!r||(t=this._layoutZone(n,r)||t)}};ist(e,o),o.addZone=u9,o.removeZone=u9,o.layoutZone=u9}),t}_addZone(e,t){const n=this._computeWhitespaceProps(t),r={whitespaceId:e.insertWhitespace(n.afterViewLineNumber,this._getZoneOrdinal(t),n.heightInPx,n.minWidthInPx),delegate:t,isInHiddenArea:n.isInHiddenArea,isVisible:!1,domNode:ti(t.domNode),marginDomNode:t.marginDomNode?ti(t.marginDomNode):null};return this._safeCallOnComputedHeight(r.delegate,n.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 n=this._zones[t];return delete this._zones[t],e.removeWhitespace(n.whitespaceId),n.domNode.removeAttribute("monaco-visible-view-zone"),n.domNode.removeAttribute("monaco-view-zone"),n.domNode.domNode.parentNode.removeChild(n.domNode.domNode),n.marginDomNode&&(n.marginDomNode.removeAttribute("monaco-visible-view-zone"),n.marginDomNode.removeAttribute("monaco-view-zone"),n.marginDomNode.domNode.parentNode.removeChild(n.marginDomNode.domNode)),this.setShouldRender(),!0}return!1}_layoutZone(e,t){if(this._zones.hasOwnProperty(t)){const n=this._zones[t],o=this._computeWhitespaceProps(n.delegate);return n.isInHiddenArea=o.isInHiddenArea,e.changeOneWhitespace(n.whitespaceId,o.afterViewLineNumber,o.heightInPx),this._safeCallOnComputedHeight(n.delegate,o.heightInPx),this.setShouldRender(),!0}return!1}shouldSuppressMouseDownOnViewZone(e){if(this._zones.hasOwnProperty(e)){const t=this._zones[e];return Boolean(t.delegate.suppressMouseDown)}return!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(n){en(n)}}_safeCallOnDomNodeTop(e,t){if(typeof e.onDomNodeTop=="function")try{e.onDomNodeTop(t)}catch(n){en(n)}}prepareRender(e){}render(e){const t=e.viewportData.whitespaceViewportData,n={};let o=!1;for(const s of t)this._zones[s.id].isInHiddenArea||(n[s.id]=s,o=!0);const r=Object.keys(this._zones);for(let s=0,a=r.length;sa)continue;const f=h.startLineNumber===a?h.startColumn:c.minColumn,g=h.endLineNumber===a?h.endColumn:c.maxColumn;f=R.endOffset&&(k++,R=n&&n[k]),N!==9&&N!==32||h&&!D&&P<=I)continue;if(d&&P>=E&&P<=I&&N===32){const H=P-1>=0?a.charCodeAt(P-1):0,B=P+1=0?a.charCodeAt(P-1):0;if(N===32&&H!==32&&H!==9)continue}if(n&&(!R||R.startOffset>P||R.endOffset<=P))continue;const M=e.visibleRangeForPosition(new ae(t,P+1));!M||(s?(A=Math.max(A,M.left),N===9?L+=this._renderArrow(f,v,M.left):L+=``):N===9?L+=`
${w?String.fromCharCode(65515):String.fromCharCode(8594)}
`:L+=`
${String.fromCharCode(y)}
`)}return s?(A=Math.round(A+v),``+L+""):L}_renderArrow(e,t,n){const o=t/7,r=t,s=e/2,a=n,l={x:0,y:o/2},c={x:100/125*r,y:l.y},u={x:c.x-.2*c.x,y:c.y+.2*c.x},d={x:u.x+.1*c.x,y:u.y+.1*c.x},h={x:d.x+.35*c.x,y:d.y-.35*c.x},f={x:h.x,y:-h.y},g={x:d.x,y:-d.y},p={x:u.x,y:-u.y},v={x:c.x,y:-c.y},m={x:l.x,y:-l.y};return``}render(e,t){if(!this._renderResult)return"";const n=t-e;return n<0||n>=this._renderResult.length?"":this._renderResult[n]}}class Jre{constructor(e){const t=e.options,n=t.get(50),o=t.get(38);o==="off"?(this.renderWhitespace="none",this.renderWithSVG=!1):o==="svg"?(this.renderWhitespace=t.get(98),this.renderWithSVG=!0):(this.renderWhitespace=t.get(98),this.renderWithSVG=!1),this.spaceWidth=n.spaceWidth,this.middotWidth=n.middotWidth,this.wsmiddotWidth=n.wsmiddotWidth,this.canUseHalfwidthRightwardsArrow=n.canUseHalfwidthRightwardsArrow,this.lineHeight=t.get(66),this.stopRenderingLineAfter=t.get(116)}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}}var cst=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},ust=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let wH=class extends GI{constructor(e,t,n,o,r,s,a){super(),this._instantiationService=a,this._shouldRecomputeGlyphMarginLanes=!1,this._selections=[new gt(1,1,1,1)],this._renderAnimationFrame=null;const l=new vrt(t,o,r,e);this._context=new rst(t,n,o),this._context.addEventHandler(this),this._viewParts=[],this._textAreaHandler=this._instantiationService.createInstance(bH,this._context,l,this._createTextAreaHandlerHelper()),this._viewParts.push(this._textAreaHandler),this._linesContent=ti(document.createElement("div")),this._linesContent.setClassName("lines-content monaco-editor-background"),this._linesContent.setPosition("absolute"),this.domNode=ti(document.createElement("div")),this.domNode.setClassName(this._getEditorClassName()),this.domNode.setAttribute("role","code"),this._overflowGuardContainer=ti(document.createElement("div")),vf.write(this._overflowGuardContainer,3),this._overflowGuardContainer.setClassName("overflow-guard"),this._scrollbar=new Ert(this._context,this._linesContent,this.domNode,this._overflowGuardContainer),this._viewParts.push(this._scrollbar),this._viewLines=new w5(this._context,this._linesContent),this._viewZones=new nst(this._context),this._viewParts.push(this._viewZones);const c=new qrt(this._context);this._viewParts.push(c);const u=new Zrt(this._context);this._viewParts.push(u);const d=new brt(this._context);this._viewParts.push(d),d.addDynamicOverlay(new Srt(this._context)),d.addDynamicOverlay(new yo(this._context)),d.addDynamicOverlay(new krt(this._context)),d.addDynamicOverlay(new Lrt(this._context)),d.addDynamicOverlay(new lst(this._context));const h=new Crt(this._context);this._viewParts.push(h),h.addDynamicOverlay(new xrt(this._context)),h.addDynamicOverlay(new Wrt(this._context)),h.addDynamicOverlay(new Brt(this._context)),h.addDynamicOverlay(new JI(this._context)),this._glyphMarginWidgets=new Art(this._context),this._viewParts.push(this._glyphMarginWidgets);const f=new tb(this._context);f.getDomNode().appendChild(this._viewZones.marginDomNode),f.getDomNode().appendChild(h.getDomNode()),f.getDomNode().appendChild(this._glyphMarginWidgets.domNode),this._viewParts.push(f),this._contentWidgets=new yrt(this._context,this.domNode),this._viewParts.push(this._contentWidgets),this._viewCursors=new ik(this._context),this._viewParts.push(this._viewCursors),this._overlayWidgets=new jrt(this._context),this._viewParts.push(this._overlayWidgets);const g=new Yrt(this._context);this._viewParts.push(g);const p=new ast(this._context);this._viewParts.push(p);const v=new Urt(this._context);if(this._viewParts.push(v),c){const m=this._scrollbar.getOverviewRulerLayoutInfo();m.parent.insertBefore(c.getDomNode(),m.insertBefore)}this._linesContent.appendChild(d.getDomNode()),this._linesContent.appendChild(g.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(u.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(p.domNode),this.domNode.appendChild(this._overflowGuardContainer),s?s.appendChild(this._contentWidgets.overflowingContentWidgetsDomNode.domNode):this.domNode.appendChild(this._contentWidgets.overflowingContentWidgetsDomNode),this._applyLayout(),this._pointerHandler=this._register(new pot(this._context,l,this._createPointerHandlerHelper()))}_flushAccumulatedAndRenderNow(){this._shouldRecomputeGlyphMarginLanes&&(this._shouldRecomputeGlyphMarginLanes=!1,this._context.configuration.setGlyphMarginDecorationLaneCount(this._computeGlyphMarginLaneCount())),Lm.onRenderStart(),this._renderNow()}_computeGlyphMarginLaneCount(){const e=this._context.viewModel.model;let t=[];t=t.concat(e.getAllMarginDecorations().map(r=>{var s,a;const l=(a=(s=r.options.glyphMargin)===null||s===void 0?void 0:s.position)!==null&&a!==void 0?a:Cy.Left;return{range:r.range,lane:l}})),t=t.concat(this._glyphMarginWidgets.getWidgets().map(r=>({range:e.validateRange(r.preference.range),lane:r.preference.lane}))),t.sort((r,s)=>V.compareRangesUsingStarts(r.range,s.range));let n=null,o=null;for(const r of t)if(r.lane===Cy.Left&&(!n||V.compareRangesUsingEnds(n,r.range)<0)&&(n=r.range),r.lane===Cy.Right&&(!o||V.compareRangesUsingEnds(o,r.range)<0)&&(o=r.range),n&&o){if(n.endLineNumber{this.focus()},dispatchTextAreaEvent:e=>{this._textAreaHandler.textArea.domNode.dispatchEvent(e)},getLastRenderData:()=>{const e=this._viewCursors.getLastRenderData()||[],t=this._textAreaHandler.getLastRenderData();return new Kit(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 ae(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(143);this.domNode.setWidth(t.width),this.domNode.setHeight(t.height),this._overflowGuardContainer.setWidth(t.width),this._overflowGuardContainer.setHeight(t.height),this._linesContent.setWidth(1e6),this._linesContent.setHeight(1e6)}_getEditorClassName(){const e=this._textAreaHandler.isFocused()?" focused":"";return this._context.configuration.options.get(140)+" "+_H(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(){this._renderAnimationFrame===null&&(this._renderAnimationFrame=KA(this._onRenderScheduled.bind(this),100))}_onRenderScheduled(){this._renderAnimationFrame=null,this._flushAccumulatedAndRenderNow()}_renderNow(){dst(()=>this._actualRender())}_getViewPartsToRender(){const e=[];let t=0;for(const n of this._viewParts)n.shouldRender()&&(e[t++]=n);return e}_actualRender(){if(!oG(this.domNode.domNode))return;let e=this._getViewPartsToRender();if(!this._viewLines.shouldRender()&&e.length===0)return;const t=this._context.viewLayout.getLinesViewportData();this._context.viewModel.setViewport(t.startLineNumber,t.endLineNumber,t.centeredLineNumber);const n=new sst(this._selections,t,this._context.viewLayout.getWhitespaceViewportData(),this._context.viewModel);this._contentWidgets.shouldRender()&&this._contentWidgets.onBeforeRender(n),this._viewLines.shouldRender()&&(this._viewLines.renderText(n),this._viewLines.onDidRender(),e=this._getViewPartsToRender());const o=new Wit(this._context.viewLayout,n,this._viewLines);for(const r of e)r.prepareRender(o);for(const r of e)r.render(o),r.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},1),this._context.viewModel.visibleLinesStabilized()}getOffsetForColumn(e,t){const n=this._context.viewModel.model.validatePosition({lineNumber:e,column:t}),o=this._context.viewModel.coordinatesConverter.convertModelPositionToViewPosition(n);this._flushAccumulatedAndRenderNow();const r=this._viewLines.visibleRangeForPosition(new ae(o.lineNumber,o.column));return r?r.left:-1}getTargetAtClientPoint(e,t){const n=this._pointerHandler.getTargetAtClientPoint(e,t);return n?C5.convertViewToModelMouseTarget(n,this._context.viewModel.coordinatesConverter):null}createOverviewRuler(e){return new Xrt(this._context,e)}change(e){this._viewZones.changeViewZones(e),this._scheduleRender()}render(e,t){if(t){this._viewLines.forceShouldRender();for(const n of this._viewParts)n.forceShouldRender()}e?this._flushAccumulatedAndRenderNow():this._scheduleRender()}writeScreenReaderContent(e){this._textAreaHandler.writeScreenReaderContent(e)}focus(){this._textAreaHandler.focusTextArea()}isFocused(){return this._textAreaHandler.isFocused()}setAriaOptions(e){this._textAreaHandler.setAriaOptions(e)}addContentWidget(e){this._contentWidgets.addWidget(e.widget),this.layoutContentWidget(e),this._scheduleRender()}layoutContentWidget(e){var t,n,o,r,s,a,l,c;this._contentWidgets.setWidgetPosition(e.widget,(n=(t=e.position)===null||t===void 0?void 0:t.position)!==null&&n!==void 0?n:null,(r=(o=e.position)===null||o===void 0?void 0:o.secondaryPosition)!==null&&r!==void 0?r:null,(a=(s=e.position)===null||s===void 0?void 0:s.preference)!==null&&a!==void 0?a:null,(c=(l=e.position)===null||l===void 0?void 0:l.positionAffinity)!==null&&c!==void 0?c: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){const t=e.position?e.position.preference:null;this._overlayWidgets.setWidgetPosition(e.widget,t)&&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()}};wH=cst([ust(6,$t)],wH);function dst(i){try{return i()}catch(e){en(e)}}class Wbe{constructor(e,t,n,o,r,s){this.id=e,this.label=t,this.alias=n,this._precondition=o,this._run=r,this._contextKeyService=s}isSupported(){return this._contextKeyService.contextMatchesRules(this._precondition)}run(e){return this.isSupported()?this._run(e):Promise.resolve(void 0)}}function kv(i){let e=0,t=0,n=0,o=0;for(let r=0,s=i.length;r=zl&&(t=t-i%zl),t}function mst(i,e){return i.reduce((t,n)=>so(t,e(n)),sa)}function Vbe(i,e){return i===e}function rk(i,e){const t=i,n=e;if(n-t<=0)return sa;const r=Math.floor(t/zl),s=Math.floor(n/zl),a=n-s*zl;if(r===s){const l=t-r*zl;return Io(0,a-l)}else return Io(s-r,a)}function Dy(i,e){return i=e}function HC(i){return Io(i.lineNumber-1,i.column-1)}function T0(i,e){const t=i,n=Math.floor(t/zl),o=t-n*zl,r=e,s=Math.floor(r/zl),a=r-s*zl;return new V(n+1,o+1,s+1,a+1)}function vst(i){const e=gf(i);return Io(e.length-1,e[e.length-1].length)}class Vg{static fromModelContentChanges(e){return e.map(n=>{const o=V.lift(n.range);return new Vg(HC(o.getStartPosition()),HC(o.getEndPosition()),vst(n.text))}).reverse()}constructor(e,t,n){this.startOffset=e,this.endOffset=t,this.newLength=n}toString(){return`[${Ac(this.startOffset)}...${Ac(this.endOffset)}) -> ${Ac(this.newLength)}`}}class _st{constructor(e){this.nextEditIdx=0,this.deltaOldToNewLineCount=0,this.deltaOldToNewColumnCount=0,this.deltaLineIdxInOld=-1,this.edits=e.map(t=>PG.from(t))}getOffsetBeforeChange(e){return this.adjustNextEdit(e),this.translateCurToOld(e)}getDistanceToNextChange(e){this.adjustNextEdit(e);const t=this.edits[this.nextEditIdx],n=t?this.translateOldToCur(t.offsetObj):null;return n===null?null:rk(e,n)}translateOldToCur(e){return e.lineCount===this.deltaLineIdxInOld?Io(e.lineCount+this.deltaOldToNewLineCount,e.columnCount+this.deltaOldToNewColumnCount):Io(e.lineCount+this.deltaOldToNewLineCount,e.columnCount)}translateCurToOld(e){const t=Ac(e);return t.lineCount-this.deltaOldToNewLineCount===this.deltaLineIdxInOld?Io(t.lineCount-this.deltaOldToNewLineCount,t.columnCount-this.deltaOldToNewColumnCount):Io(t.lineCount-this.deltaOldToNewLineCount,t.columnCount)}adjustNextEdit(e){for(;this.nextEditIdx>5;if(o===0){const s=1<this.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 n=0;for(;;){const r=this.lineTokens,s=r.getCount();let a=null;if(this.lineTokenOffset1e3))break;if(n>1500)break}const o=gst(e,t,this.lineIdx,this.lineCharOffset);return new um(o,0,-1,qo.getEmpty(),new U_(o))}}class xst{constructor(e,t){this.text=e,this._offset=sa,this.idx=0;const n=t.getRegExpStr(),o=n?new RegExp(n+`| +`,"gi"):null,r=[];let s,a=0,l=0,c=0,u=0;const d=[];for(let g=0;g<60;g++)d.push(new um(Io(0,g),0,-1,qo.getEmpty(),new U_(Io(0,g))));const h=[];for(let g=0;g<60;g++)h.push(new um(Io(1,g),0,-1,qo.getEmpty(),new U_(Io(1,g))));if(o)for(o.lastIndex=0;(s=o.exec(e))!==null;){const g=s.index,p=s[0];if(p===` +`)a++,l=g+1;else{if(c!==g){let v;if(u===a){const m=g-c;if(mLst(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,n]of this.map)if(n.kind===2&&n.bracketIds.intersects(e))return t}get isEmpty(){return this.map.size===0}}function Lst(i){let e=Xl(i);return/^[\w ]+/.test(i)&&(e=`\\b${e}`),/[\w ]+$/.test(i)&&(e=`${e}\\b`),e}class zbe{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=BG.createFromLanguage(this.getLanguageConfiguration(e),this.denseKeyProvider),this.languageIdToBracketTokens.set(e,t)),t}}function Est(i){if(i.length===0)return null;if(i.length===1)return i[0];let e=0;function t(){if(e>=i.length)return null;const s=e,a=i[s].listHeight;for(e++;e=2?Ube(s===0&&e===i.length?i:i.slice(s,e),!1):i[s]}let n=t(),o=t();if(!o)return n;for(let s=t();s;s=t())nse(n,o)<=nse(o,s)?(n=d9(n,o),o=s):o=d9(o,s);return d9(n,o)}function Ube(i,e=!1){if(i.length===0)return null;if(i.length===1)return i[0];let t=i.length;for(;t>3;){const n=t>>1;for(let o=0;o=3?i[2]:null,e)}function nse(i,e){return Math.abs(i.listHeight-e.listHeight)}function d9(i,e){return i.listHeight===e.listHeight?_f.create23(i,e,null,!1):i.listHeight>e.listHeight?Dst(i,e):kst(e,i)}function Dst(i,e){i=i.toMutable();let t=i;const n=[];let o;for(;;){if(e.listHeight===t.listHeight){o=e;break}if(t.kind!==4)throw new Error("unexpected");n.push(t),t=t.makeLastElementMutable()}for(let r=n.length-1;r>=0;r--){const s=n[r];o?s.childrenLength>=3?o=_f.create23(s.unappendChild(),o,null,!1):(s.appendChildOfSameHeight(o),o=void 0):s.handleChildrenChanged()}return o?_f.create23(i,o,null,!1):i}function kst(i,e){i=i.toMutable();let t=i;const n=[];for(;e.listHeight!==t.listHeight;){if(t.kind!==4)throw new Error("unexpected");n.push(t),t=t.makeFirstElementMutable()}let o=e;for(let r=n.length-1;r>=0;r--){const s=n[r];o?s.childrenLength>=3?o=_f.create23(o,s.unprependChild(),null,!1):(s.prependChildOfSameHeight(o),o=void 0):s.handleChildrenChanged()}return o?_f.create23(o,i,null,!1):i}class Ist{constructor(e){this.lastOffset=sa,this.nextNodes=[e],this.offsets=[sa],this.idxs=[]}readLongestNodeAt(e,t){if(Dy(e,this.lastOffset))throw new Error("Invalid offset");for(this.lastOffset=e;;){const n=Vx(this.nextNodes);if(!n)return;const o=Vx(this.offsets);if(Dy(e,o))return;if(Dy(o,e))if(so(o,n.length)<=e)this.nextNodeAfterCurrent();else{const r=h9(n);r!==-1?(this.nextNodes.push(n.getChild(r)),this.offsets.push(o),this.idxs.push(r)):this.nextNodeAfterCurrent()}else{if(t(n))return this.nextNodeAfterCurrent(),n;{const r=h9(n);if(r===-1){this.nextNodeAfterCurrent();return}else this.nextNodes.push(n.getChild(r)),this.offsets.push(o),this.idxs.push(r)}}}}nextNodeAfterCurrent(){for(;;){const e=Vx(this.offsets),t=Vx(this.nextNodes);if(this.nextNodes.pop(),this.offsets.pop(),this.idxs.length===0)break;const n=Vx(this.nextNodes),o=h9(n,this.idxs[this.idxs.length-1]);if(o!==-1){this.nextNodes.push(n.getChild(o)),this.offsets.push(so(e,t.length)),this.idxs[this.idxs.length-1]=o;break}else this.idxs.pop()}}}function h9(i,e=-1){for(;;){if(e++,e>=i.childrenLength)return-1;if(i.getChild(e))return e}}function Vx(i){return i.length>0?i[i.length-1]:void 0}function SH(i,e,t,n){return new Tst(i,e,t,n).parseDocument()}class Tst{constructor(e,t,n,o){if(this.tokenizer=e,this.createImmutableLists=o,this._itemsConstructed=0,this._itemsFromCache=0,n&&o)throw new Error("Not supported");this.oldNodeReader=n?new Ist(n):void 0,this.positionMapper=new _st(t)}parseDocument(){this._itemsConstructed=0,this._itemsFromCache=0;let e=this.parseList(qo.getEmpty(),0);return e||(e=_f.getEmpty()),e}parseList(e,t){const n=[];for(;;){let r=this.tryReadChildFromCache(e);if(!r){const s=this.tokenizer.peek();if(!s||s.kind===2&&s.bracketIds.intersects(e))break;r=this.parseChild(e,t+1)}r.kind===4&&r.childrenLength===0||n.push(r)}return this.oldNodeReader?Est(n):Ube(n,this.createImmutableLists)}tryReadChildFromCache(e){if(this.oldNodeReader){const t=this.positionMapper.getDistanceToNextChange(this.tokenizer.offset);if(t===null||!gP(t)){const n=this.oldNodeReader.readLongestNodeAt(this.positionMapper.getOffsetBeforeChange(this.tokenizer.offset),o=>t!==null&&!Dy(o.length,t)?!1:o.canBeReused(e));if(n)return this._itemsFromCache++,this.tokenizer.skip(n.length),n}}}parseChild(e,t){this._itemsConstructed++;const n=this.tokenizer.read();switch(n.kind){case 2:return new wst(n.bracketIds,n.length);case 0:return n.astNode;case 1:{if(t>300)return new U_(n.length);const o=e.merge(n.bracketIds),r=this.parseList(o,t+1),s=this.tokenizer.peek();return s&&s.kind===2&&(s.bracketId===n.bracketId||s.bracketIds.intersects(n.bracketIds))?(this.tokenizer.read(),sk.create(n.astNode,r,s.astNode)):sk.create(n.astNode,r,null)}default:throw new Error("unexpected")}}}function vP(i,e){if(i.length===0)return e;if(e.length===0)return i;const t=new sp(ise(i)),n=ise(e);n.push({modified:!1,lengthBefore:void 0,lengthAfter:void 0});let o=t.dequeue();function r(c){if(c===void 0){const d=t.takeWhile(h=>!0)||[];return o&&d.unshift(o),d}const u=[];for(;o&&!gP(c);){const[d,h]=o.splitAt(c);u.push(d),c=rk(d.lengthAfter,c),o=h!=null?h:t.dequeue()}return gP(c)||u.push(new Em(!1,c,c)),u}const s=[];function a(c,u,d){if(s.length>0&&Vbe(s[s.length-1].endOffset,c)){const h=s[s.length-1];s[s.length-1]=new Vg(h.startOffset,u,so(h.newLength,d))}else s.push({startOffset:c,endOffset:u,newLength:d})}let l=sa;for(const c of n){const u=r(c.lengthBefore);if(c.modified){const d=mst(u,f=>f.lengthBefore),h=so(l,d);a(l,h,c.lengthAfter),l=h}else for(const d of u){const h=l;l=so(l,d.lengthBefore),d.modified&&a(h,l,d.lengthAfter)}}return s}class Em{constructor(e,t,n){this.modified=e,this.lengthBefore=t,this.lengthAfter=n}splitAt(e){const t=rk(e,this.lengthAfter);return Vbe(t,sa)?[this,void 0]:this.modified?[new Em(this.modified,this.lengthBefore,e),new Em(this.modified,sa,t)]:[new Em(this.modified,e,e),new Em(this.modified,t,t)]}toString(){return`${this.modified?"M":"U"}:${Ac(this.lengthBefore)} -> ${Ac(this.lengthAfter)}`}}function ise(i){const e=[];let t=sa;for(const n of i){const o=rk(t,n.startOffset);gP(o)||e.push(new Em(!1,o,o));const r=rk(n.startOffset,n.endOffset);e.push(new Em(!0,r,n.newLength)),t=n.endOffset}return e}class Nst extends _e{didLanguageChange(e){return this.brackets.didLanguageChange(e)}constructor(e,t){if(super(),this.textModel=e,this.getLanguageConfiguration=t,this.didChangeEmitter=new le,this.denseKeyProvider=new Hbe,this.brackets=new zbe(this.denseKeyProvider,this.getLanguageConfiguration),this.onDidChange=this.didChangeEmitter.event,this.queuedTextEditsForInitialAstWithoutTokens=[],this.queuedTextEdits=[],e.tokenization.hasTokens)e.tokenization.backgroundTokenizationState===2?(this.initialAstWithoutTokens=void 0,this.astWithTokens=this.parseDocumentFromTextBuffer([],void 0,!1)):(this.initialAstWithoutTokens=this.parseDocumentFromTextBuffer([],void 0,!0),this.astWithTokens=this.initialAstWithoutTokens);else{const n=this.brackets.getSingleLanguageBracketTokens(this.textModel.getLanguageId()),o=new xst(this.textModel.getValue(),n);this.initialAstWithoutTokens=SH(o,[],void 0,!0),this.astWithTokens=this.initialAstWithoutTokens}}handleDidChangeBackgroundTokenizationState(){if(this.textModel.tokenization.backgroundTokenizationState===2){const e=this.initialAstWithoutTokens===void 0;this.initialAstWithoutTokens=void 0,e||this.didChangeEmitter.fire()}}handleDidChangeTokens({ranges:e}){const t=e.map(n=>new Vg(Io(n.fromLineNumber-1,0),Io(n.toLineNumber,0),Io(n.toLineNumber-n.fromLineNumber+1,0)));this.handleEdits(t,!0),this.initialAstWithoutTokens||this.didChangeEmitter.fire()}handleContentChanged(e){const t=Vg.fromModelContentChanges(e.changes);this.handleEdits(t,!1)}handleEdits(e,t){const n=vP(this.queuedTextEdits,e);this.queuedTextEdits=n,this.initialAstWithoutTokens&&!t&&(this.queuedTextEditsForInitialAstWithoutTokens=vP(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,n){const o=t,r=new $be(this.textModel,this.brackets);return SH(r,e,o,n)}getBracketsInRange(e,t){this.flushQueue();const n=Io(e.startLineNumber-1,e.startColumn-1),o=Io(e.endLineNumber-1,e.endColumn-1);return new af(r=>{const s=this.initialAstWithoutTokens||this.astWithTokens;xH(s,sa,s.length,n,o,r,0,0,new Map,t)})}getBracketPairsInRange(e,t){this.flushQueue();const n=HC(e.getStartPosition()),o=HC(e.getEndPosition());return new af(r=>{const s=this.initialAstWithoutTokens||this.astWithTokens,a=new Rst(r,t,this.textModel);LH(s,sa,s.length,n,o,a,0,new Map)})}getFirstBracketAfter(e){this.flushQueue();const t=this.initialAstWithoutTokens||this.astWithTokens;return Kbe(t,sa,t.length,HC(e))}getFirstBracketBefore(e){this.flushQueue();const t=this.initialAstWithoutTokens||this.astWithTokens;return jbe(t,sa,t.length,HC(e))}}function jbe(i,e,t,n){if(i.kind===4||i.kind===2){const o=[];for(const r of i.children)t=so(e,r.length),o.push({nodeOffsetStart:e,nodeOffsetEnd:t}),e=t;for(let r=o.length-1;r>=0;r--){const{nodeOffsetStart:s,nodeOffsetEnd:a}=o[r];if(Dy(s,n)){const l=jbe(i.children[r],s,a,n);if(l)return l}}return null}else{if(i.kind===3)return null;if(i.kind===1){const o=T0(e,t);return{bracketInfo:i.bracketInfo,range:o}}}return null}function Kbe(i,e,t,n){if(i.kind===4||i.kind===2){for(const o of i.children){if(t=so(e,o.length),Dy(n,t)){const r=Kbe(o,e,t,n);if(r)return r}e=t}return null}else{if(i.kind===3)return null;if(i.kind===1){const o=T0(e,t);return{bracketInfo:i.bracketInfo,range:o}}}return null}function xH(i,e,t,n,o,r,s,a,l,c,u=!1){if(s>200)return!0;e:for(;;)switch(i.kind){case 4:{const d=i.childrenLength;for(let h=0;h200)return!0;let c=!0;if(i.kind===2){let u=0;if(a){let f=a.get(i.openingBracket.text);f===void 0&&(f=0),u=f,f++,a.set(i.openingBracket.text,f)}const d=so(e,i.openingBracket.length);let h=-1;if(r.includeMinIndentation&&(h=i.computeMinIndentation(e,r.textModel)),c=r.push(new fst(T0(e,t),T0(e,d),i.closingBracket?T0(so(d,((l=i.child)===null||l===void 0?void 0:l.length)||sa),t):void 0,s,u,i,h)),e=d,c&&i.child){const f=i.child;if(t=so(e,f.length),ky(e,o)&&EL(t,n)&&(c=LH(f,e,t,n,o,r,s+1,a),!c))return!1}a==null||a.set(i.openingBracket.text,u)}else{let u=e;for(const d of i.children){const h=u;if(u=so(u,d.length),ky(h,o)&&ky(n,u)&&(c=LH(d,h,u,n,o,r,s,a),!c))return!1}}return c}class Mst extends _e{get canBuildAST(){return this.textModel.getValueLength()<=5e6}constructor(e,t){super(),this.textModel=e,this.languageConfigurationService=t,this.bracketPairsTree=this._register(new Kr),this.onDidChangeEmitter=new le,this.onDidChange=this.onDidChangeEmitter.event,this.bracketsRequested=!1,this._register(this.languageConfigurationService.onDidChange(n=>{var o;(!n.languageId||((o=this.bracketPairsTree.value)===null||o===void 0?void 0:o.object.didLanguageChange(n.languageId)))&&(this.bracketPairsTree.clear(),this.updateBracketPairsTree())}))}handleDidChangeOptions(e){this.bracketPairsTree.clear(),this.updateBracketPairsTree()}handleDidChangeLanguage(e){this.bracketPairsTree.clear(),this.updateBracketPairsTree()}handleDidChangeContent(e){var t;(t=this.bracketPairsTree.value)===null||t===void 0||t.object.handleContentChanged(e)}handleDidChangeBackgroundTokenizationState(){var e;(e=this.bracketPairsTree.value)===null||e===void 0||e.object.handleDidChangeBackgroundTokenizationState()}handleDidChangeTokens(e){var t;(t=this.bracketPairsTree.value)===null||t===void 0||t.object.handleDidChangeTokens(e)}updateBracketPairsTree(){if(this.bracketsRequested&&this.canBuildAST){if(!this.bracketPairsTree.value){const e=new Be;this.bracketPairsTree.value=Ast(e.add(new Nst(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){var t;return this.bracketsRequested=!0,this.updateBracketPairsTree(),((t=this.bracketPairsTree.value)===null||t===void 0?void 0:t.object.getBracketPairsInRange(e,!1))||af.empty}getBracketPairsInRangeWithMinIndentation(e){var t;return this.bracketsRequested=!0,this.updateBracketPairsTree(),((t=this.bracketPairsTree.value)===null||t===void 0?void 0:t.object.getBracketPairsInRange(e,!0))||af.empty}getBracketsInRange(e,t=!1){var n;return this.bracketsRequested=!0,this.updateBracketPairsTree(),((n=this.bracketPairsTree.value)===null||n===void 0?void 0:n.object.getBracketsInRange(e,t))||af.empty}findMatchingBracketUp(e,t,n){const o=this.textModel.validatePosition(t),r=this.textModel.getLanguageIdAtPosition(o.lineNumber,o.column);if(this.canBuildAST){const s=this.languageConfigurationService.getLanguageConfiguration(r).bracketsNew.getClosingBracketInfo(e);if(!s)return null;const a=this.getBracketPairsInRange(V.fromPositions(t,t)).findLast(l=>s.closes(l.openingBracketInfo));return a?a.openingBracketRange:null}else{const s=e.toLowerCase(),a=this.languageConfigurationService.getLanguageConfiguration(r).brackets;if(!a)return null;const l=a.textIsBracket[s];return l?b2(this._findMatchingBracketUp(l,o,f9(n))):null}}matchBracket(e,t){if(this.canBuildAST){const n=this.getBracketPairsInRange(V.fromPositions(e,e)).filter(o=>o.closingBracketRange!==void 0&&(o.openingBracketRange.containsPosition(e)||o.closingBracketRange.containsPosition(e))).findLastMaxBy(Rc(o=>o.openingBracketRange.containsPosition(e)?o.openingBracketRange:o.closingBracketRange,V.compareRangesUsingStarts));return n?[n.openingBracketRange,n.closingBracketRange]:null}else{const n=f9(t);return this._matchBracket(this.textModel.validatePosition(e),n)}}_establishBracketSearchOffsets(e,t,n,o){const r=t.getCount(),s=t.getLanguageId(o);let a=Math.max(0,e.column-1-n.maxBracketLength);for(let c=o-1;c>=0;c--){const u=t.getEndOffset(c);if(u<=a)break;if(Ch(t.getStandardTokenType(c))||t.getLanguageId(c)!==s){a=u;break}}let l=Math.min(t.getLineContent().length,e.column-1+n.maxBracketLength);for(let c=o+1;c=l)break;if(Ch(t.getStandardTokenType(c))||t.getLanguageId(c)!==s){l=u;break}}return{searchStartOffset:a,searchEndOffset:l}}_matchBracket(e,t){const n=e.lineNumber,o=this.textModel.tokenization.getLineTokens(n),r=this.textModel.getLineContent(n),s=o.findTokenIndexAtOffset(e.column-1);if(s<0)return null;const a=this.languageConfigurationService.getLanguageConfiguration(o.getLanguageId(s)).brackets;if(a&&!Ch(o.getStandardTokenType(s))){let{searchStartOffset:l,searchEndOffset:c}=this._establishBracketSearchOffsets(e,o,a,s),u=null;for(;;){const d=hu.findNextBracketInRange(a.forwardRegex,n,r,l,c);if(!d)break;if(d.startColumn<=e.column&&e.column<=d.endColumn){const h=r.substring(d.startColumn-1,d.endColumn-1).toLowerCase(),f=this._matchFoundBracket(d,a.textIsBracket[h],a.textIsOpenBracket[h],t);if(f){if(f instanceof gg)return null;u=f}}l=d.endColumn-1}if(u)return u}if(s>0&&o.getStartOffset(s)===e.column-1){const l=s-1,c=this.languageConfigurationService.getLanguageConfiguration(o.getLanguageId(l)).brackets;if(c&&!Ch(o.getStandardTokenType(l))){const{searchStartOffset:u,searchEndOffset:d}=this._establishBracketSearchOffsets(e,o,c,l),h=hu.findPrevBracketInRange(c.reversedRegex,n,r,u,d);if(h&&h.startColumn<=e.column&&e.column<=h.endColumn){const f=r.substring(h.startColumn-1,h.endColumn-1).toLowerCase(),g=this._matchFoundBracket(h,c.textIsBracket[f],c.textIsOpenBracket[f],t);if(g)return g instanceof gg?null:g}}}return null}_matchFoundBracket(e,t,n,o){if(!t)return null;const r=n?this._findMatchingBracketDown(t,e.getEndPosition(),o):this._findMatchingBracketUp(t,e.getStartPosition(),o);return r?r instanceof gg?r:[e,r]:null}_findMatchingBracketUp(e,t,n){const o=e.languageId,r=e.reversedRegex;let s=-1,a=0;const l=(c,u,d,h)=>{for(;;){if(n&&++a%100===0&&!n())return gg.INSTANCE;const f=hu.findPrevBracketInRange(r,c,u,d,h);if(!f)break;const g=u.substring(f.startColumn-1,f.endColumn-1).toLowerCase();if(e.isOpen(g)?s++:e.isClose(g)&&s--,s===0)return f;h=f.startColumn-1}return null};for(let c=t.lineNumber;c>=1;c--){const u=this.textModel.tokenization.getLineTokens(c),d=u.getCount(),h=this.textModel.getLineContent(c);let f=d-1,g=h.length,p=h.length;c===t.lineNumber&&(f=u.findTokenIndexAtOffset(t.column-1),g=t.column-1,p=t.column-1);let v=!0;for(;f>=0;f--){const m=u.getLanguageId(f)===o&&!Ch(u.getStandardTokenType(f));if(m)v?g=u.getStartOffset(f):(g=u.getStartOffset(f),p=u.getEndOffset(f));else if(v&&g!==p){const _=l(c,h,g,p);if(_)return _}v=m}if(v&&g!==p){const m=l(c,h,g,p);if(m)return m}}return null}_findMatchingBracketDown(e,t,n){const o=e.languageId,r=e.forwardRegex;let s=1,a=0;const l=(u,d,h,f)=>{for(;;){if(n&&++a%100===0&&!n())return gg.INSTANCE;const g=hu.findNextBracketInRange(r,u,d,h,f);if(!g)break;const p=d.substring(g.startColumn-1,g.endColumn-1).toLowerCase();if(e.isOpen(p)?s++:e.isClose(p)&&s--,s===0)return g;h=g.endColumn-1}return null},c=this.textModel.getLineCount();for(let u=t.lineNumber;u<=c;u++){const d=this.textModel.tokenization.getLineTokens(u),h=d.getCount(),f=this.textModel.getLineContent(u);let g=0,p=0,v=0;u===t.lineNumber&&(g=d.findTokenIndexAtOffset(t.column-1),p=t.column-1,v=t.column-1);let m=!0;for(;g=1;a--){const l=this.textModel.tokenization.getLineTokens(a),c=l.getCount(),u=this.textModel.getLineContent(a);let d=c-1,h=u.length,f=u.length;if(a===n.lineNumber){d=l.findTokenIndexAtOffset(n.column-1),h=n.column-1,f=n.column-1;const p=l.getLanguageId(d);o!==p&&(o=p,r=this.languageConfigurationService.getLanguageConfiguration(o).brackets,s=this.languageConfigurationService.getLanguageConfiguration(o).bracketsNew)}let g=!0;for(;d>=0;d--){const p=l.getLanguageId(d);if(o!==p){if(r&&s&&g&&h!==f){const m=hu.findPrevBracketInRange(r.reversedRegex,a,u,h,f);if(m)return this._toFoundBracket(s,m);g=!1}o=p,r=this.languageConfigurationService.getLanguageConfiguration(o).brackets,s=this.languageConfigurationService.getLanguageConfiguration(o).bracketsNew}const v=!!r&&!Ch(l.getStandardTokenType(d));if(v)g?h=l.getStartOffset(d):(h=l.getStartOffset(d),f=l.getEndOffset(d));else if(s&&r&&g&&h!==f){const m=hu.findPrevBracketInRange(r.reversedRegex,a,u,h,f);if(m)return this._toFoundBracket(s,m)}g=v}if(s&&r&&g&&h!==f){const p=hu.findPrevBracketInRange(r.reversedRegex,a,u,h,f);if(p)return this._toFoundBracket(s,p)}}return null}findNextBracket(e){var t;const n=this.textModel.validatePosition(e);if(this.canBuildAST)return this.bracketsRequested=!0,this.updateBracketPairsTree(),((t=this.bracketPairsTree.value)===null||t===void 0?void 0:t.object.getFirstBracketAfter(n))||null;const o=this.textModel.getLineCount();let r=null,s=null,a=null;for(let l=n.lineNumber;l<=o;l++){const c=this.textModel.tokenization.getLineTokens(l),u=c.getCount(),d=this.textModel.getLineContent(l);let h=0,f=0,g=0;if(l===n.lineNumber){h=c.findTokenIndexAtOffset(n.column-1),f=n.column-1,g=n.column-1;const v=c.getLanguageId(h);r!==v&&(r=v,s=this.languageConfigurationService.getLanguageConfiguration(r).brackets,a=this.languageConfigurationService.getLanguageConfiguration(r).bracketsNew)}let p=!0;for(;hp.closingBracketRange!==void 0&&p.range.strictContainsRange(f));return g?[g.openingBracketRange,g.closingBracketRange]:null}const o=f9(t),r=this.textModel.getLineCount(),s=new Map;let a=[];const l=(f,g)=>{if(!s.has(f)){const p=[];for(let v=0,m=g?g.brackets.length:0;v{for(;;){if(o&&++c%100===0&&!o())return gg.INSTANCE;const _=hu.findNextBracketInRange(f.forwardRegex,g,p,v,m);if(!_)break;const y=p.substring(_.startColumn-1,_.endColumn-1).toLowerCase(),w=f.textIsBracket[y];if(w&&(w.isOpen(y)?a[w.index]++:w.isClose(y)&&a[w.index]--,a[w.index]===-1))return this._matchFoundBracket(_,w,!1,o);v=_.endColumn-1}return null};let d=null,h=null;for(let f=n.lineNumber;f<=r;f++){const g=this.textModel.tokenization.getLineTokens(f),p=g.getCount(),v=this.textModel.getLineContent(f);let m=0,_=0,y=0;if(f===n.lineNumber){m=g.findTokenIndexAtOffset(n.column-1),_=n.column-1,y=n.column-1;const L=g.getLanguageId(m);d!==L&&(d=L,h=this.languageConfigurationService.getLanguageConfiguration(d).brackets,l(d,h))}let w=!0;for(;me==null?void 0:e.dispose()}}function f9(i){if(typeof i=="undefined")return()=>!0;{const e=Date.now();return()=>Date.now()-e<=i}}class gg{constructor(){this._searchCanceledBrand=void 0}}gg.INSTANCE=new gg;function b2(i){return i instanceof gg?null:i}class Pst extends _e{constructor(e){super(),this.textModel=e,this.colorProvider=new qbe,this.onDidChangeEmitter=new le,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,n,o){return o?[]:t===void 0?[]:this.colorizationOptions.enabled?this.textModel.bracketPairs.getBracketsInRange(e,!0).map(s=>({id:`bracket${s.range.toString()}-${s.nestingLevel}`,options:{description:"BracketPairColorization",inlineClassName:this.colorProvider.getInlineClassName(s,this.colorizationOptions.independentColorPoolPerBracketType)},ownerId:0,range:s.range})).toArray():[]}getAllDecorations(e,t){return e===void 0?[]:this.colorizationOptions.enabled?this.getDecorationsInRange(new V(1,1,this.textModel.getLineCount(),1),e,t):[]}}class qbe{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}`}}ju((i,e)=>{const t=[Sbe,xbe,Lbe,Ebe,Dbe,kbe],n=new qbe;e.addRule(`.monaco-editor .${n.unexpectedClosingBracketClassName} { color: ${i.getColor(Fot)}; }`);const o=t.map(r=>i.getColor(r)).filter(r=>!!r).filter(r=>!r.isTransparent());for(let r=0;r<30;r++){const s=o[r%o.length];e.addRule(`.monaco-editor .${n.getInlineClassNameOfLevel(r)} { color: ${s}; }`)}});function C2(i){return i.replace(/\n/g,"\\n").replace(/\r/g,"\\r")}class Jr{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,n,o){this.oldPosition=e,this.oldText=t,this.newPosition=n,this.newText=o}toString(){return this.oldText.length===0?`(insert@${this.oldPosition} "${C2(this.newText)}")`:this.newText.length===0?`(delete@${this.oldPosition} "${C2(this.oldText)}")`:`(replace@${this.oldPosition} "${C2(this.oldText)}" with "${C2(this.newText)}")`}static _writeStringSize(e){return 4+2*e.length}static _writeString(e,t,n){const o=t.length;hd(e,o,n),n+=4;for(let r=0;ri.length)return!1;if(t){if(!qq(i,e))return!1;if(e.length===i.length)return!0;let r=e.length;return e.charAt(e.length-1)===n&&r--,i.charAt(r)===n}return e.charAt(e.length-1)!==n&&(e+=n),i.indexOf(e)===0}function Xbe(i){return i>=65&&i<=90||i>=97&&i<=122}function Bst(i,e=ls){return e?Xbe(i.charCodeAt(0))&&i.charCodeAt(1)===58:!1}function yh(i){return WA(i,!0)}class WG{constructor(e){this._ignorePathCasing=e}compare(e,t,n=!1){return e===t?0:RD(this.getComparisonKey(e,n),this.getComparisonKey(t,n))}isEqual(e,t,n=!1){return e===t?!0:!e||!t?!1:this.getComparisonKey(e,n)===this.getComparisonKey(t,n)}getComparisonKey(e,t=!1){return e.with({path:this._ignorePathCasing(e)?e.path.toLowerCase():void 0,fragment:t?null:void 0}).toString()}isEqualOrParent(e,t,n=!1){if(e.scheme===t.scheme){if(e.scheme===hn.file)return EH(yh(e),yh(t),this._ignorePathCasing(e))&&e.query===t.query&&(n||e.fragment===t.fragment);if(sse(e.authority,t.authority))return EH(e.path,t.path,this._ignorePathCasing(e),"/")&&e.query===t.query&&(n||e.fragment===t.fragment)}return!1}joinPath(e,...t){return Rt.joinPath(e,...t)}basenameOrAuthority(e){return $c(e)||e.authority}basename(e){return Go.basename(e.path)}extname(e){return Go.extname(e.path)}dirname(e){if(e.path.length===0)return e;let t;return e.scheme===hn.file?t=Rt.file(M_e(yh(e))).path:(t=Go.dirname(e.path),e.authority&&t.length&&t.charCodeAt(0)!==47&&(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===hn.file?t=Rt.file(R_e(yh(e))).path:t=Go.normalize(e.path),e.with({path:t})}relativePath(e,t){if(e.scheme!==t.scheme||!sse(e.authority,t.authority))return;if(e.scheme===hn.file){const r=jYe(yh(e),yh(t));return ls?Gbe(r):r}let n=e.path||"/";const o=t.path||"/";if(this._ignorePathCasing(e)){let r=0;for(const s=Math.min(n.length,o.length);rose(n).length&&n[n.length-1]===t}else{const n=e.path;return n.length>1&&n.charCodeAt(n.length-1)===47&&!/^[a-zA-Z]:(\/$|\\$)/.test(e.fsPath)}}removeTrailingPathSeparator(e,t=Bd){return ase(e,t)?e.with({path:e.path.substr(0,e.path.length-1)}):e}addTrailingPathSeparator(e,t=Bd){let n=!1;if(e.scheme===hn.file){const o=yh(e);n=o!==void 0&&o.length===ose(o).length&&o[o.length-1]===t}else{t="/";const o=e.path;n=o.length===1&&o.charCodeAt(o.length-1)===47}return!n&&!ase(e,t)?e.with({path:e.path+"/"}):e}}const Vi=new WG(()=>!1);new WG(i=>i.scheme===hn.file?!xs:!0);new WG(i=>!0);const VG=Vi.isEqual.bind(Vi);Vi.isEqualOrParent.bind(Vi);Vi.getComparisonKey.bind(Vi);const Wst=Vi.basenameOrAuthority.bind(Vi),$c=Vi.basename.bind(Vi),Vst=Vi.extname.bind(Vi),S5=Vi.dirname.bind(Vi),Hst=Vi.joinPath.bind(Vi),$st=Vi.normalizePath.bind(Vi),zst=Vi.relativePath.bind(Vi),rse=Vi.resolvePath.bind(Vi);Vi.isAbsolutePath.bind(Vi);const sse=Vi.isEqualAuthority.bind(Vi),ase=Vi.hasTrailingPathSeparator.bind(Vi);Vi.removeTrailingPathSeparator.bind(Vi);Vi.addTrailingPathSeparator.bind(Vi);var Iv;(function(i){i.META_DATA_LABEL="label",i.META_DATA_DESCRIPTION="description",i.META_DATA_SIZE="size",i.META_DATA_MIME="mime";function e(t){const n=new Map;t.path.substring(t.path.indexOf(";")+1,t.path.lastIndexOf(";")).split(";").forEach(s=>{const[a,l]=s.split(":");a&&l&&n.set(a,l)});const r=t.path.substring(0,t.path.indexOf(";"));return r&&n.set(i.META_DATA_MIME,r),n}i.parseMetaData=e})(Iv||(Iv={}));function U1(i){return i.toString()}class yr{static create(e,t){const n=e.getAlternativeVersionId(),o=DH(e);return new yr(n,n,o,o,t,t,[])}constructor(e,t,n,o,r,s,a){this.beforeVersionId=e,this.afterVersionId=t,this.beforeEOL=n,this.afterEOL=o,this.beforeCursorState=r,this.afterCursorState=s,this.changes=a}append(e,t,n,o,r){t.length>0&&(this.changes=Ost(this.changes,t)),this.afterEOL=n,this.afterVersionId=o,this.afterCursorState=r}static _writeSelectionsSize(e){return 4+4*4*(e?e.length:0)}static _writeSelections(e,t,n){if(hd(e,t?t.length:0,n),n+=4,t)for(const o of t)hd(e,o.selectionStartLineNumber,n),n+=4,hd(e,o.selectionStartColumn,n),n+=4,hd(e,o.positionLineNumber,n),n+=4,hd(e,o.positionColumn,n),n+=4;return n}static _readSelections(e,t,n){const o=dd(e,t);t+=4;for(let r=0;rt.toString()).join(", ")}matchesResource(e){return(Rt.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 yr}append(e,t,n,o,r){this._data instanceof yr&&this._data.append(e,t,n,o,r)}close(){this._data instanceof yr&&(this._data=this._data.serialize())}open(){this._data instanceof yr||(this._data=yr.deserialize(this._data))}undo(){if(Rt.isUri(this.model))throw new Error("Invalid SingleModelEditStackElement");this._data instanceof yr&&(this._data=this._data.serialize());const e=yr.deserialize(this._data);this.model._applyUndo(e.changes,e.beforeEOL,e.beforeVersionId,e.beforeCursorState)}redo(){if(Rt.isUri(this.model))throw new Error("Invalid SingleModelEditStackElement");this._data instanceof yr&&(this._data=this._data.serialize());const e=yr.deserialize(this._data);this.model._applyRedo(e.changes,e.afterEOL,e.afterVersionId,e.afterCursorState)}heapSize(){return this._data instanceof yr&&(this._data=this._data.serialize()),this._data.byteLength+168}}class Ust{get resources(){return this._editStackElementsArr.map(e=>e.resource)}constructor(e,t,n){this.label=e,this.code=t,this.type=1,this._isOpen=!0,this._editStackElementsArr=n.slice(0),this._editStackElementsMap=new Map;for(const o of this._editStackElementsArr){const r=U1(o.resource);this._editStackElementsMap.set(r,o)}this._delegate=null}prepareUndoRedo(){if(this._delegate)return this._delegate.prepareUndoRedo(this)}matchesResource(e){const t=U1(e);return this._editStackElementsMap.has(t)}setModel(e){const t=U1(Rt.isUri(e)?e:e.uri);this._editStackElementsMap.has(t)&&this._editStackElementsMap.get(t).setModel(e)}canAppend(e){if(!this._isOpen)return!1;const t=U1(e.uri);return this._editStackElementsMap.has(t)?this._editStackElementsMap.get(t).canAppend(e):!1}append(e,t,n,o,r){const s=U1(e.uri);this._editStackElementsMap.get(s).append(e,t,n,o,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=U1(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(`${$c(t.resource)}: ${t}`);return`{${e.join(", ")}}`}}function DH(i){return i.getEOL()===` +`?0:1}function pg(i){return i?i instanceof Ybe||i instanceof Ust:!1}class HG{constructor(e,t){this._model=e,this._undoRedoService=t}pushStackElement(){const e=this._undoRedoService.getLastElement(this._model.uri);pg(e)&&e.close()}popStackElement(){const e=this._undoRedoService.getLastElement(this._model.uri);pg(e)&&e.open()}clear(){this._undoRedoService.removeElements(this._model.uri)}_getOrCreateEditStackElement(e,t){const n=this._undoRedoService.getLastElement(this._model.uri);if(pg(n)&&n.canAppend(this._model))return n;const o=new Ybe(C("edit","Typing"),"undoredo.textBufferEdit",this._model,e);return this._undoRedoService.pushElement(o,t),o}pushEOL(e){const t=this._getOrCreateEditStackElement(null,void 0);this._model.setEOL(e),t.append(this._model,[],DH(this._model),this._model.getAlternativeVersionId(),null)}pushEditOperation(e,t,n,o){const r=this._getOrCreateEditStackElement(e,o),s=this._model.applyEdits(t,!0),a=HG._computeCursorState(n,s),l=s.map((c,u)=>({index:u,textChange:c.textChange}));return l.sort((c,u)=>c.textChange.oldPosition===u.textChange.oldPosition?c.index-u.index:c.textChange.oldPosition-u.textChange.oldPosition),r.append(this._model,l.map(c=>c.textChange),DH(this._model),this._model.getAlternativeVersionId(),a),a}static _computeCursorState(e,t){try{return e?e(t):null}catch(n){return en(n),null}}}class jst{constructor(){this.spacesDiff=0,this.looksLikeAlignment=!1}}function Kst(i,e,t,n,o){o.spacesDiff=0,o.looksLikeAlignment=!1;let r;for(r=0;r0&&a>0||l>0&&c>0)return;const u=Math.abs(a-c),d=Math.abs(s-l);if(u===0){o.spacesDiff=d,d>0&&0<=l-1&&l-10?o++:w>1&&r++,Kst(s,a,v,y,d),d.looksLikeAlignment&&!(t&&e===d.spacesDiff)))continue;const D=d.spacesDiff;D<=c&&u[D]++,s=v,a=y}let h=t;o!==r&&(h=o{const v=u[p];v>g&&(g=v,f=p)}),f===4&&u[4]>0&&u[2]>0&&u[2]>=u[4]/2&&(f=2)}return{insertSpaces:h,tabSize:f}}function xa(i){return(i.metadata&1)>>>0}function Fi(i,e){i.metadata=i.metadata&254|e<<0}function as(i){return(i.metadata&2)>>>1===1}function Mi(i,e){i.metadata=i.metadata&253|(e?1:0)<<1}function Zbe(i){return(i.metadata&4)>>>2===1}function cse(i,e){i.metadata=i.metadata&251|(e?1:0)<<2}function Qbe(i){return(i.metadata&64)>>>6===1}function use(i,e){i.metadata=i.metadata&191|(e?1:0)<<6}function qst(i){return(i.metadata&24)>>>3}function dse(i,e){i.metadata=i.metadata&231|e<<3}function Gst(i){return(i.metadata&32)>>>5===1}function hse(i,e){i.metadata=i.metadata&223|(e?1:0)<<5}class Jbe{constructor(e,t,n){this.metadata=0,this.parent=this,this.left=this,this.right=this,Fi(this,1),this.start=t,this.end=n,this.delta=0,this.maxEnd=n,this.id=e,this.ownerId=0,this.options=null,cse(this,!1),use(this,!1),dse(this,1),hse(this,!1),this.cachedVersionId=0,this.cachedAbsoluteStart=t,this.cachedAbsoluteEnd=n,this.range=null,Mi(this,!1)}reset(e,t,n,o){this.start=t,this.end=n,this.maxEnd=n,this.cachedVersionId=e,this.cachedAbsoluteStart=t,this.cachedAbsoluteEnd=n,this.range=o}setOptions(e){this.options=e;const t=this.options.className;cse(this,t==="squiggly-error"||t==="squiggly-warning"||t==="squiggly-info"),use(this,this.options.glyphMarginClassName!==null),dse(this,this.options.stickiness),hse(this,this.options.collapseOnReplaceEdit)}setCachedOffsets(e,t,n){this.cachedVersionId!==n&&(this.range=null),this.cachedVersionId=n,this.cachedAbsoluteStart=e,this.cachedAbsoluteEnd=t}detach(){this.parent=null,this.left=null,this.right=null}}const pn=new Jbe(null,0,0);pn.parent=pn;pn.left=pn;pn.right=pn;Fi(pn,0);class g9{constructor(){this.root=pn,this.requestNormalizeDelta=!1}intervalSearch(e,t,n,o,r,s){return this.root===pn?[]:nat(this,e,t,n,o,r,s)}search(e,t,n,o){return this.root===pn?[]:tat(this,e,t,n,o)}collectNodesFromOwner(e){return Jst(this,e)}collectNodesPostOrder(){return eat(this)}insert(e){fse(this,e),this._normalizeDeltaIfNecessary()}delete(e){gse(this,e),this._normalizeDeltaIfNecessary()}resolveNode(e,t){const n=e;let o=0;for(;e!==this.root;)e===e.parent.right&&(o+=e.parent.delta),e=e.parent;const r=n.start+o,s=n.end+o;n.setCachedOffsets(r,s,t)}acceptReplace(e,t,n,o){const r=Zst(this,e,e+t);for(let s=0,a=r.length;st||n===1?!1:n===2?!0:e}function Yst(i,e,t,n,o){const r=qst(i),s=r===0||r===2,a=r===1||r===2,l=t-e,c=n,u=Math.min(l,c),d=i.start;let h=!1;const f=i.end;let g=!1;e<=d&&f<=t&&Gst(i)&&(i.start=e,h=!0,i.end=e,g=!0);{const v=o?1:l>0?2:0;!h&&j1(d,s,e,v)&&(h=!0),!g&&j1(f,a,e,v)&&(g=!0)}if(u>0&&!o){const v=l>c?2:0;!h&&j1(d,s,e+u,v)&&(h=!0),!g&&j1(f,a,e+u,v)&&(g=!0)}{const v=o?1:0;!h&&j1(d,s,t,v)&&(i.start=e+c,h=!0),!g&&j1(f,a,t,v)&&(i.end=e+c,g=!0)}const p=c-l;h||(i.start=Math.max(0,d+p)),g||(i.end=Math.max(0,f+p)),i.start>i.end&&(i.end=i.start)}function Zst(i,e,t){let n=i.root,o=0,r=0,s=0,a=0;const l=[];let c=0;for(;n!==pn;){if(as(n)){Mi(n.left,!1),Mi(n.right,!1),n===n.parent.right&&(o-=n.parent.delta),n=n.parent;continue}if(!as(n.left)){if(r=o+n.maxEnd,rt){Mi(n,!0);continue}if(a=o+n.end,a>=e&&(n.setCachedOffsets(s,a,0),l[c++]=n),Mi(n,!0),n.right!==pn&&!as(n.right)){o+=n.delta,n=n.right;continue}}return Mi(i.root,!1),l}function Qst(i,e,t,n){let o=i.root,r=0,s=0,a=0;const l=n-(t-e);for(;o!==pn;){if(as(o)){Mi(o.left,!1),Mi(o.right,!1),o===o.parent.right&&(r-=o.parent.delta),Tv(o),o=o.parent;continue}if(!as(o.left)){if(s=r+o.maxEnd,st){o.start+=l,o.end+=l,o.delta+=l,(o.delta<-1073741824||o.delta>1073741824)&&(i.requestNormalizeDelta=!0),Mi(o,!0);continue}if(Mi(o,!0),o.right!==pn&&!as(o.right)){r+=o.delta,o=o.right;continue}}Mi(i.root,!1)}function Jst(i,e){let t=i.root;const n=[];let o=0;for(;t!==pn;){if(as(t)){Mi(t.left,!1),Mi(t.right,!1),t=t.parent;continue}if(t.left!==pn&&!as(t.left)){t=t.left;continue}if(t.ownerId===e&&(n[o++]=t),Mi(t,!0),t.right!==pn&&!as(t.right)){t=t.right;continue}}return Mi(i.root,!1),n}function eat(i){let e=i.root;const t=[];let n=0;for(;e!==pn;){if(as(e)){Mi(e.left,!1),Mi(e.right,!1),e=e.parent;continue}if(e.left!==pn&&!as(e.left)){e=e.left;continue}if(e.right!==pn&&!as(e.right)){e=e.right;continue}t[n++]=e,Mi(e,!0)}return Mi(i.root,!1),t}function tat(i,e,t,n,o){let r=i.root,s=0,a=0,l=0;const c=[];let u=0;for(;r!==pn;){if(as(r)){Mi(r.left,!1),Mi(r.right,!1),r===r.parent.right&&(s-=r.parent.delta),r=r.parent;continue}if(r.left!==pn&&!as(r.left)){r=r.left;continue}a=s+r.start,l=s+r.end,r.setCachedOffsets(a,l,n);let d=!0;if(e&&r.ownerId&&r.ownerId!==e&&(d=!1),t&&Zbe(r)&&(d=!1),o&&!Qbe(r)&&(d=!1),d&&(c[u++]=r),Mi(r,!0),r.right!==pn&&!as(r.right)){s+=r.delta,r=r.right;continue}}return Mi(i.root,!1),c}function nat(i,e,t,n,o,r,s){let a=i.root,l=0,c=0,u=0,d=0;const h=[];let f=0;for(;a!==pn;){if(as(a)){Mi(a.left,!1),Mi(a.right,!1),a===a.parent.right&&(l-=a.parent.delta),a=a.parent;continue}if(!as(a.left)){if(c=l+a.maxEnd,ct){Mi(a,!0);continue}if(d=l+a.end,d>=e){a.setCachedOffsets(u,d,r);let g=!0;n&&a.ownerId&&a.ownerId!==n&&(g=!1),o&&Zbe(a)&&(g=!1),s&&!Qbe(a)&&(g=!1),g&&(h[f++]=a)}if(Mi(a,!0),a.right!==pn&&!as(a.right)){l+=a.delta,a=a.right;continue}}return Mi(i.root,!1),h}function fse(i,e){if(i.root===pn)return e.parent=pn,e.left=pn,e.right=pn,Fi(e,0),i.root=e,i.root;iat(i,e),Xp(e.parent);let t=e;for(;t!==i.root&&xa(t.parent)===1;)if(t.parent===t.parent.parent.left){const n=t.parent.parent.right;xa(n)===1?(Fi(t.parent,0),Fi(n,0),Fi(t.parent.parent,1),t=t.parent.parent):(t===t.parent.right&&(t=t.parent,vE(i,t)),Fi(t.parent,0),Fi(t.parent.parent,1),_E(i,t.parent.parent))}else{const n=t.parent.parent.left;xa(n)===1?(Fi(t.parent,0),Fi(n,0),Fi(t.parent.parent,1),t=t.parent.parent):(t===t.parent.left&&(t=t.parent,_E(i,t)),Fi(t.parent,0),Fi(t.parent.parent,1),vE(i,t.parent.parent))}return Fi(i.root,0),e}function iat(i,e){let t=0,n=i.root;const o=e.start,r=e.end;for(;;)if(rat(o,r,n.start+t,n.end+t)<0)if(n.left===pn){e.start-=t,e.end-=t,e.maxEnd-=t,n.left=e;break}else n=n.left;else if(n.right===pn){e.start-=t+n.delta,e.end-=t+n.delta,e.maxEnd-=t+n.delta,n.right=e;break}else t+=n.delta,n=n.right;e.parent=n,e.left=pn,e.right=pn,Fi(e,1)}function gse(i,e){let t,n;if(e.left===pn?(t=e.right,n=e,t.delta+=e.delta,(t.delta<-1073741824||t.delta>1073741824)&&(i.requestNormalizeDelta=!0),t.start+=e.delta,t.end+=e.delta):e.right===pn?(t=e.left,n=e):(n=oat(e.right),t=n.right,t.start+=n.delta,t.end+=n.delta,t.delta+=n.delta,(t.delta<-1073741824||t.delta>1073741824)&&(i.requestNormalizeDelta=!0),n.start+=e.delta,n.end+=e.delta,n.delta=e.delta,(n.delta<-1073741824||n.delta>1073741824)&&(i.requestNormalizeDelta=!0)),n===i.root){i.root=t,Fi(t,0),e.detach(),p9(),Tv(t),i.root.parent=pn;return}const o=xa(n)===1;if(n===n.parent.left?n.parent.left=t:n.parent.right=t,n===e?t.parent=n.parent:(n.parent===e?t.parent=n:t.parent=n.parent,n.left=e.left,n.right=e.right,n.parent=e.parent,Fi(n,xa(e)),e===i.root?i.root=n:e===e.parent.left?e.parent.left=n:e.parent.right=n,n.left!==pn&&(n.left.parent=n),n.right!==pn&&(n.right.parent=n)),e.detach(),o){Xp(t.parent),n!==e&&(Xp(n),Xp(n.parent)),p9();return}Xp(t),Xp(t.parent),n!==e&&(Xp(n),Xp(n.parent));let r;for(;t!==i.root&&xa(t)===0;)t===t.parent.left?(r=t.parent.right,xa(r)===1&&(Fi(r,0),Fi(t.parent,1),vE(i,t.parent),r=t.parent.right),xa(r.left)===0&&xa(r.right)===0?(Fi(r,1),t=t.parent):(xa(r.right)===0&&(Fi(r.left,0),Fi(r,1),_E(i,r),r=t.parent.right),Fi(r,xa(t.parent)),Fi(t.parent,0),Fi(r.right,0),vE(i,t.parent),t=i.root)):(r=t.parent.left,xa(r)===1&&(Fi(r,0),Fi(t.parent,1),_E(i,t.parent),r=t.parent.left),xa(r.left)===0&&xa(r.right)===0?(Fi(r,1),t=t.parent):(xa(r.left)===0&&(Fi(r.right,0),Fi(r,1),vE(i,r),r=t.parent.left),Fi(r,xa(t.parent)),Fi(t.parent,0),Fi(r.left,0),_E(i,t.parent),t=i.root));Fi(t,0),p9()}function oat(i){for(;i.left!==pn;)i=i.left;return i}function p9(){pn.parent=pn,pn.delta=0,pn.start=0,pn.end=0}function vE(i,e){const t=e.right;t.delta+=e.delta,(t.delta<-1073741824||t.delta>1073741824)&&(i.requestNormalizeDelta=!0),t.start+=e.delta,t.end+=e.delta,e.right=t.left,t.left!==pn&&(t.left.parent=e),t.parent=e.parent,e.parent===pn?i.root=t:e===e.parent.left?e.parent.left=t:e.parent.right=t,t.left=e,e.parent=t,Tv(e),Tv(t)}function _E(i,e){const t=e.left;e.delta-=t.delta,(e.delta<-1073741824||e.delta>1073741824)&&(i.requestNormalizeDelta=!0),e.start-=t.delta,e.end-=t.delta,e.left=t.right,t.right!==pn&&(t.right.parent=e),t.parent=e.parent,e.parent===pn?i.root=t:e===e.parent.right?e.parent.right=t:e.parent.left=t,t.right=e,e.parent=t,Tv(e),Tv(t)}function e1e(i){let e=i.end;if(i.left!==pn){const t=i.left.maxEnd;t>e&&(e=t)}if(i.right!==pn){const t=i.right.maxEnd+i.delta;t>e&&(e=t)}return e}function Tv(i){i.maxEnd=e1e(i)}function Xp(i){for(;i!==pn;){const e=e1e(i);if(i.maxEnd===e)return;i.maxEnd=e,i=i.parent}}function rat(i,e,t,n){return i===t?e-n:i-t}class kH{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!==Qt)return $G(this.right);let e=this;for(;e.parent!==Qt&&e.parent.left!==e;)e=e.parent;return e.parent===Qt?Qt:e.parent}prev(){if(this.left!==Qt)return t1e(this.left);let e=this;for(;e.parent!==Qt&&e.parent.right!==e;)e=e.parent;return e.parent===Qt?Qt:e.parent}detach(){this.parent=null,this.left=null,this.right=null}}const Qt=new kH(null,0);Qt.parent=Qt;Qt.left=Qt;Qt.right=Qt;Qt.color=0;function $G(i){for(;i.left!==Qt;)i=i.left;return i}function t1e(i){for(;i.right!==Qt;)i=i.right;return i}function zG(i){return i===Qt?0:i.size_left+i.piece.length+zG(i.right)}function UG(i){return i===Qt?0:i.lf_left+i.piece.lineFeedCnt+UG(i.right)}function m9(){Qt.parent=Qt}function bE(i,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!==Qt&&(t.left.parent=e),t.parent=e.parent,e.parent===Qt?i.root=t:e.parent.left===e?e.parent.left=t:e.parent.right=t,t.left=e,e.parent=t}function CE(i,e){const t=e.left;e.left=t.right,t.right!==Qt&&(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===Qt?i.root=t:e===e.parent.right?e.parent.right=t:e.parent.left=t,t.right=e,e.parent=t}function y2(i,e){let t,n;if(e.left===Qt?(n=e,t=n.right):e.right===Qt?(n=e,t=n.left):(n=$G(e.right),t=n.right),n===i.root){i.root=t,t.color=0,e.detach(),m9(),i.root.parent=Qt;return}const o=n.color===1;if(n===n.parent.left?n.parent.left=t:n.parent.right=t,n===e?(t.parent=n.parent,DL(i,t)):(n.parent===e?t.parent=n:t.parent=n.parent,DL(i,t),n.left=e.left,n.right=e.right,n.parent=e.parent,n.color=e.color,e===i.root?i.root=n:e===e.parent.left?e.parent.left=n:e.parent.right=n,n.left!==Qt&&(n.left.parent=n),n.right!==Qt&&(n.right.parent=n),n.size_left=e.size_left,n.lf_left=e.lf_left,DL(i,n)),e.detach(),t.parent.left===t){const s=zG(t),a=UG(t);if(s!==t.parent.size_left||a!==t.parent.lf_left){const l=s-t.parent.size_left,c=a-t.parent.lf_left;t.parent.size_left=s,t.parent.lf_left=a,rg(i,t.parent,l,c)}}if(DL(i,t.parent),o){m9();return}let r;for(;t!==i.root&&t.color===0;)t===t.parent.left?(r=t.parent.right,r.color===1&&(r.color=0,t.parent.color=1,bE(i,t.parent),r=t.parent.right),r.left.color===0&&r.right.color===0?(r.color=1,t=t.parent):(r.right.color===0&&(r.left.color=0,r.color=1,CE(i,r),r=t.parent.right),r.color=t.parent.color,t.parent.color=0,r.right.color=0,bE(i,t.parent),t=i.root)):(r=t.parent.left,r.color===1&&(r.color=0,t.parent.color=1,CE(i,t.parent),r=t.parent.left),r.left.color===0&&r.right.color===0?(r.color=1,t=t.parent):(r.left.color===0&&(r.right.color=0,r.color=1,bE(i,r),r=t.parent.left),r.color=t.parent.color,t.parent.color=0,r.left.color=0,CE(i,t.parent),t=i.root));t.color=0,m9()}function pse(i,e){for(DL(i,e);e!==i.root&&e.parent.color===1;)if(e.parent===e.parent.parent.left){const t=e.parent.parent.right;t.color===1?(e.parent.color=0,t.color=0,e.parent.parent.color=1,e=e.parent.parent):(e===e.parent.right&&(e=e.parent,bE(i,e)),e.parent.color=0,e.parent.parent.color=1,CE(i,e.parent.parent))}else{const t=e.parent.parent.left;t.color===1?(e.parent.color=0,t.color=0,e.parent.parent.color=1,e=e.parent.parent):(e===e.parent.left&&(e=e.parent,CE(i,e)),e.parent.color=0,e.parent.parent.color=1,bE(i,e.parent.parent))}i.root.color=0}function rg(i,e,t,n){for(;e!==i.root&&e!==Qt;)e.parent.left===e&&(e.parent.size_left+=t,e.parent.lf_left+=n),e=e.parent}function DL(i,e){let t=0,n=0;if(e!==i.root){for(;e!==i.root&&e===e.parent.right;)e=e.parent;if(e!==i.root)for(e=e.parent,t=zG(e.left)-e.size_left,n=UG(e.left)-e.lf_left,e.size_left+=t,e.lf_left+=n;e!==i.root&&(t!==0||n!==0);)e.parent.left===e&&(e.parent.size_left+=t,e.parent.lf_left+=n),e=e.parent}}const Yf=65535;function n1e(i){let e;return i[i.length-1]<65536?e=new Uint16Array(i.length):e=new Uint32Array(i.length),e.set(i,0),e}class sat{constructor(e,t,n,o,r){this.lineStarts=e,this.cr=t,this.lf=n,this.crlf=o,this.isBasicASCII=r}}function ag(i,e=!0){const t=[0];let n=1;for(let o=0,r=i.length;o126)&&(s=!1)}const a=new sat(n1e(i),n,o,r,s);return i.length=0,a}class Ga{constructor(e,t,n,o,r){this.bufferIndex=e,this.start=t,this.end=n,this.lineFeedCnt=o,this.length=r}}class j_{constructor(e,t){this.buffer=e,this.lineStarts=t}}class lat{constructor(e,t){this._pieces=[],this._tree=e,this._BOM=t,this._index=0,e.root!==Qt&&e.iterate(e.root,n=>(n!==Qt&&this._pieces.push(n.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 cat{constructor(e){this._limit=e,this._cache=[]}get(e){for(let t=this._cache.length-1;t>=0;t--){const n=this._cache[t];if(n.nodeStartOffset<=e&&n.nodeStartOffset+n.node.piece.length>=e)return n}return null}get2(e){for(let t=this._cache.length-1;t>=0;t--){const n=this._cache[t];if(n.nodeStartLineNumber&&n.nodeStartLineNumber=e)return n}return null}set(e){this._cache.length>=this._limit&&this._cache.shift(),this._cache.push(e)}validate(e){let t=!1;const n=this._cache;for(let o=0;o=e){n[o]=null,t=!0;continue}}if(t){const o=[];for(const r of n)r!==null&&o.push(r);this._cache=o}}}class uat{constructor(e,t,n){this.create(e,t,n)}create(e,t,n){this._buffers=[new j_("",[0])],this._lastChangeBufferPos={line:0,column:0},this.root=Qt,this._lineCnt=1,this._length=0,this._EOL=t,this._EOLLength=t.length,this._EOLNormalized=n;let o=null;for(let r=0,s=e.length;r0){e[r].lineStarts||(e[r].lineStarts=ag(e[r].buffer));const a=new Ga(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]),o=this.rbInsertRight(o,a)}this._searchCache=new cat(1),this._lastVisitedLine={lineNumber:0,value:""},this.computeBufferMetadata()}normalizeEOL(e){const t=Yf,n=t-Math.floor(t/3),o=n*2;let r="",s=0;const a=[];if(this.iterate(this.root,l=>{const c=this.getNodeContent(l),u=c.length;if(s<=n||s+u0){const l=r.replace(/\r\n|\r|\n/g,e);a.push(new j_(l,ag(l)))}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 lat(this,e)}getOffsetAt(e,t){let n=0,o=this.root;for(;o!==Qt;)if(o.left!==Qt&&o.lf_left+1>=e)o=o.left;else{if(o.lf_left+o.piece.lineFeedCnt+1>=e)return n+=o.size_left,n+=this.getAccumulatedValue(o,e-o.lf_left-2)+t-1;e-=o.lf_left+o.piece.lineFeedCnt,n+=o.size_left+o.piece.length,o=o.right}return n}getPositionAt(e){e=Math.floor(e),e=Math.max(0,e);let t=this.root,n=0;const o=e;for(;t!==Qt;)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(n+=t.lf_left+r.index,r.index===0){const s=this.getOffsetAt(n+1,1),a=o-s;return new ae(n+1,a+1)}return new ae(n+1,r.remainder+1)}else if(e-=t.size_left+t.piece.length,n+=t.lf_left+t.piece.lineFeedCnt,t.right===Qt){const r=this.getOffsetAt(n+1,1),s=o-e-r;return new ae(n+1,s+1)}else t=t.right;return new ae(1,1)}getValueInRange(e,t){if(e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn)return"";const n=this.nodeAt2(e.startLineNumber,e.startColumn),o=this.nodeAt2(e.endLineNumber,e.endColumn),r=this.getValueInRange2(n,o);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,l=this._buffers[a.piece.bufferIndex].buffer,c=this.offsetInBuffer(a.piece.bufferIndex,a.piece.start);return l.substring(c+e.remainder,c+t.remainder)}let n=e.node;const o=this._buffers[n.piece.bufferIndex].buffer,r=this.offsetInBuffer(n.piece.bufferIndex,n.piece.start);let s=o.substring(r+e.remainder,r+n.piece.length);for(n=n.next();n!==Qt;){const a=this._buffers[n.piece.bufferIndex].buffer,l=this.offsetInBuffer(n.piece.bufferIndex,n.piece.start);if(n===t.node){s+=a.substring(l,l+t.remainder);break}else s+=a.substr(l,n.piece.length);n=n.next()}return s}getLinesContent(){const e=[];let t=0,n="",o=!1;return this.iterate(this.root,r=>{if(r===Qt)return!0;const s=r.piece;let a=s.length;if(a===0)return!0;const l=this._buffers[s.bufferIndex].buffer,c=this._buffers[s.bufferIndex].lineStarts,u=s.start.line,d=s.end.line;let h=c[u]+s.start.column;if(o&&(l.charCodeAt(h)===10&&(h++,a--),e[t++]=n,n="",o=!1,a===0))return!0;if(u===d)return!this._EOLNormalized&&l.charCodeAt(h+a-1)===13?(o=!0,n+=l.substr(h,a-1)):n+=l.substr(h,a),!0;n+=this._EOLNormalized?l.substring(h,Math.max(h,c[u+1]-this._EOLLength)):l.substring(h,c[u+1]).replace(/(\r\n|\r|\n)$/,""),e[t++]=n;for(let f=u+1;fw+g,t.reset(0)):(_=h.buffer,y=w=>w,t.reset(g));do if(v=t.next(_),v){if(y(v.index)>=p)return u;this.positionInBuffer(e,y(v.index)-f,m);const w=this.getLineFeedCnt(e.piece.bufferIndex,r,m),L=m.line===r.line?m.column-r.column+o:m.column+1,D=L+v[0].length;if(d[u++]=W_(new V(n+w,L,n+w,D),v,l),y(v.index)+v[0].length>=p||u>=c)return u}while(v);return u}findMatchesLineByLine(e,t,n,o){const r=[];let s=0;const a=new NC(t.wordSeparators,t.regex);let l=this.nodeAt2(e.startLineNumber,e.startColumn);if(l===null)return[];const c=this.nodeAt2(e.endLineNumber,e.endColumn);if(c===null)return[];let u=this.positionInBuffer(l.node,l.remainder);const d=this.positionInBuffer(c.node,c.remainder);if(l.node===c.node)return this.findMatchesInNode(l.node,a,e.startLineNumber,e.startColumn,u,d,t,n,o,s,r),r;let h=e.startLineNumber,f=l.node;for(;f!==c.node;){const p=this.getLineFeedCnt(f.piece.bufferIndex,u,f.piece.end);if(p>=1){const m=this._buffers[f.piece.bufferIndex].lineStarts,_=this.offsetInBuffer(f.piece.bufferIndex,f.piece.start),y=m[u.line+p],w=h===e.startLineNumber?e.startColumn:1;if(s=this.findMatchesInNode(f,a,h,w,u,this.positionInBuffer(f,y-_),t,n,o,s,r),s>=o)return r;h+=p}const v=h===e.startLineNumber?e.startColumn-1:0;if(h===e.endLineNumber){const m=this.getLineContent(h).substring(v,e.endColumn-1);return s=this._findMatchesInLine(t,a,m,e.endLineNumber,v,s,r,n,o),r}if(s=this._findMatchesInLine(t,a,this.getLineContent(h).substr(v),h,v,s,r,n,o),s>=o)return r;h++,l=this.nodeAt2(h,1),f=l.node,u=this.positionInBuffer(l.node,l.remainder)}if(h===e.endLineNumber){const p=h===e.startLineNumber?e.startColumn-1:0,v=this.getLineContent(h).substring(p,e.endColumn-1);return s=this._findMatchesInLine(t,a,v,e.endLineNumber,p,s,r,n,o),r}const g=h===e.startLineNumber?e.startColumn:1;return s=this.findMatchesInNode(c.node,a,h,g,u,d,t,n,o,s,r),r}_findMatchesInLine(e,t,n,o,r,s,a,l,c){const u=e.wordSeparators;if(!l&&e.simpleSearch){const h=e.simpleSearch,f=h.length,g=n.length;let p=-f;for(;(p=n.indexOf(h,p+f))!==-1;)if((!u||lG(u,n,g,p,f))&&(a[s++]=new WD(new V(o,p+1+r,o,p+1+f+r),null),s>=c))return s;return s}let d;t.reset(0);do if(d=t.next(n),d&&(a[s++]=W_(new V(o,d.index+1+r,o,d.index+1+d[0].length+r),d,l),s>=c))return s;while(d);return s}insert(e,t,n=!1){if(this._EOLNormalized=this._EOLNormalized&&n,this._lastVisitedLine.lineNumber=0,this._lastVisitedLine.value="",this.root!==Qt){const{node:o,remainder:r,nodeStartOffset:s}=this.nodeAt(e),a=o.piece,l=a.bufferIndex,c=this.positionInBuffer(o,r);if(o.piece.bufferIndex===0&&a.end.line===this._lastChangeBufferPos.line&&a.end.column===this._lastChangeBufferPos.column&&s+a.length===e&&t.lengthe){const u=[];let d=new Ga(a.bufferIndex,c,a.end,this.getLineFeedCnt(a.bufferIndex,c,a.end),this.offsetInBuffer(l,a.end)-this.offsetInBuffer(l,c));if(this.shouldCheckCRLF()&&this.endWithCR(t)&&this.nodeCharCodeAt(o,r)===10){const p={line:d.start.line+1,column:0};d=new Ga(d.bufferIndex,p,d.end,this.getLineFeedCnt(d.bufferIndex,p,d.end),d.length-1),t+=` +`}if(this.shouldCheckCRLF()&&this.startWithLF(t))if(this.nodeCharCodeAt(o,r-1)===13){const p=this.positionInBuffer(o,r-1);this.deleteNodeTail(o,p),t="\r"+t,o.piece.length===0&&u.push(o)}else this.deleteNodeTail(o,c);else this.deleteNodeTail(o,c);const h=this.createNewPieces(t);d.length>0&&this.rbInsertRight(o,d);let f=o;for(let g=0;g=0;s--)r=this.rbInsertLeft(r,o[s]);this.validateCRLFWithPrevNode(r),this.deleteNodes(n)}insertContentToNodeRight(e,t){this.adjustCarriageReturnFromNext(e,t)&&(e+=` +`);const n=this.createNewPieces(e),o=this.rbInsertRight(t,n[0]);let r=o;for(let s=1;s=h)c=d+1;else break;return n?(n.line=d,n.column=l-f,null):{line:d,column:l-f}}getLineFeedCnt(e,t,n){if(n.column===0)return n.line-t.line;const o=this._buffers[e].lineStarts;if(n.line===o.length-1)return n.line-t.line;const r=o[n.line+1],s=o[n.line]+n.column;if(r>s+1)return n.line-t.line;const a=s-1;return this._buffers[e].buffer.charCodeAt(a)===13?n.line-t.line+1:n.line-t.line}offsetInBuffer(e,t){return this._buffers[e].lineStarts[t.line]+t.column}deleteNodes(e){for(let t=0;tYf){const u=[];for(;e.length>Yf;){const h=e.charCodeAt(Yf-1);let f;h===13||h>=55296&&h<=56319?(f=e.substring(0,Yf-1),e=e.substring(Yf-1)):(f=e.substring(0,Yf),e=e.substring(Yf));const g=ag(f);u.push(new Ga(this._buffers.length,{line:0,column:0},{line:g.length-1,column:f.length-g[g.length-1]},g.length-1,f.length)),this._buffers.push(new j_(f,g))}const d=ag(e);return u.push(new Ga(this._buffers.length,{line:0,column:0},{line:d.length-1,column:e.length-d[d.length-1]},d.length-1,e.length)),this._buffers.push(new j_(e,d)),u}let t=this._buffers[0].buffer.length;const n=ag(e,!1);let o=this._lastChangeBufferPos;if(this._buffers[0].lineStarts[this._buffers[0].lineStarts.length-1]===t&&t!==0&&this.startWithLF(e)&&this.endWithCR(this._buffers[0].buffer)){this._lastChangeBufferPos={line:this._lastChangeBufferPos.line,column:this._lastChangeBufferPos.column+1},o=this._lastChangeBufferPos;for(let u=0;u=e-1)n=n.left;else if(n.lf_left+n.piece.lineFeedCnt>e-1){const l=this.getAccumulatedValue(n,e-n.lf_left-2),c=this.getAccumulatedValue(n,e-n.lf_left-1),u=this._buffers[n.piece.bufferIndex].buffer,d=this.offsetInBuffer(n.piece.bufferIndex,n.piece.start);return s+=n.size_left,this._searchCache.set({node:n,nodeStartOffset:s,nodeStartLineNumber:a-(e-1-n.lf_left)}),u.substring(d+l,d+c-t)}else if(n.lf_left+n.piece.lineFeedCnt===e-1){const l=this.getAccumulatedValue(n,e-n.lf_left-2),c=this._buffers[n.piece.bufferIndex].buffer,u=this.offsetInBuffer(n.piece.bufferIndex,n.piece.start);o=c.substring(u+l,u+n.piece.length);break}else e-=n.lf_left+n.piece.lineFeedCnt,s+=n.size_left+n.piece.length,n=n.right}for(n=n.next();n!==Qt;){const s=this._buffers[n.piece.bufferIndex].buffer;if(n.piece.lineFeedCnt>0){const a=this.getAccumulatedValue(n,0),l=this.offsetInBuffer(n.piece.bufferIndex,n.piece.start);return o+=s.substring(l,l+a-t),o}else{const a=this.offsetInBuffer(n.piece.bufferIndex,n.piece.start);o+=s.substr(a,n.piece.length)}n=n.next()}return o}computeBufferMetadata(){let e=this.root,t=1,n=0;for(;e!==Qt;)t+=e.lf_left+e.piece.lineFeedCnt,n+=e.size_left+e.piece.length,e=e.right;this._lineCnt=t,this._length=n,this._searchCache.validate(this._length)}getIndexOf(e,t){const n=e.piece,o=this.positionInBuffer(e,t),r=o.line-n.start.line;if(this.offsetInBuffer(n.bufferIndex,n.end)-this.offsetInBuffer(n.bufferIndex,n.start)===t){const s=this.getLineFeedCnt(e.piece.bufferIndex,n.start,o);if(s!==r)return{index:s,remainder:0}}return{index:r,remainder:o.column}}getAccumulatedValue(e,t){if(t<0)return 0;const n=e.piece,o=this._buffers[n.bufferIndex].lineStarts,r=n.start.line+t+1;return r>n.end.line?o[n.end.line]+n.end.column-o[n.start.line]-n.start.column:o[r]-o[n.start.line]-n.start.column}deleteNodeTail(e,t){const n=e.piece,o=n.lineFeedCnt,r=this.offsetInBuffer(n.bufferIndex,n.end),s=t,a=this.offsetInBuffer(n.bufferIndex,s),l=this.getLineFeedCnt(n.bufferIndex,n.start,s),c=l-o,u=a-r,d=n.length+u;e.piece=new Ga(n.bufferIndex,n.start,s,l,d),rg(this,e,u,c)}deleteNodeHead(e,t){const n=e.piece,o=n.lineFeedCnt,r=this.offsetInBuffer(n.bufferIndex,n.start),s=t,a=this.getLineFeedCnt(n.bufferIndex,s,n.end),l=this.offsetInBuffer(n.bufferIndex,s),c=a-o,u=r-l,d=n.length+u;e.piece=new Ga(n.bufferIndex,s,n.end,a,d),rg(this,e,u,c)}shrinkNode(e,t,n){const o=e.piece,r=o.start,s=o.end,a=o.length,l=o.lineFeedCnt,c=t,u=this.getLineFeedCnt(o.bufferIndex,o.start,c),d=this.offsetInBuffer(o.bufferIndex,t)-this.offsetInBuffer(o.bufferIndex,r);e.piece=new Ga(o.bufferIndex,o.start,c,u,d),rg(this,e,d-a,u-l);const h=new Ga(o.bufferIndex,n,s,this.getLineFeedCnt(o.bufferIndex,n,s),this.offsetInBuffer(o.bufferIndex,s)-this.offsetInBuffer(o.bufferIndex,n)),f=this.rbInsertRight(e,h);this.validateCRLFWithPrevNode(f)}appendToNode(e,t){this.adjustCarriageReturnFromNext(t,e)&&(t+=` +`);const n=this.shouldCheckCRLF()&&this.startWithLF(t)&&this.endWithCR(e),o=this._buffers[0].buffer.length;this._buffers[0].buffer+=t;const r=ag(t,!1);for(let f=0;fe)t=t.left;else if(t.size_left+t.piece.length>=e){o+=t.size_left;const r={node:t,remainder:e-t.size_left,nodeStartOffset:o};return this._searchCache.set(r),r}else e-=t.size_left+t.piece.length,o+=t.size_left+t.piece.length,t=t.right;return null}nodeAt2(e,t){let n=this.root,o=0;for(;n!==Qt;)if(n.left!==Qt&&n.lf_left>=e-1)n=n.left;else if(n.lf_left+n.piece.lineFeedCnt>e-1){const r=this.getAccumulatedValue(n,e-n.lf_left-2),s=this.getAccumulatedValue(n,e-n.lf_left-1);return o+=n.size_left,{node:n,remainder:Math.min(r+t-1,s),nodeStartOffset:o}}else if(n.lf_left+n.piece.lineFeedCnt===e-1){const r=this.getAccumulatedValue(n,e-n.lf_left-2);if(r+t-1<=n.piece.length)return{node:n,remainder:r+t-1,nodeStartOffset:o};t-=n.piece.length-r;break}else e-=n.lf_left+n.piece.lineFeedCnt,o+=n.size_left+n.piece.length,n=n.right;for(n=n.next();n!==Qt;){if(n.piece.lineFeedCnt>0){const r=this.getAccumulatedValue(n,0),s=this.offsetOfNode(n);return{node:n,remainder:Math.min(t-1,r),nodeStartOffset:s}}else if(n.piece.length>=t-1){const r=this.offsetOfNode(n);return{node:n,remainder:t-1,nodeStartOffset:r}}else t-=n.piece.length;n=n.next()}return null}nodeCharCodeAt(e,t){if(e.piece.lineFeedCnt<1)return-1;const n=this._buffers[e.piece.bufferIndex],o=this.offsetInBuffer(e.piece.bufferIndex,e.piece.start)+t;return n.buffer.charCodeAt(o)}offsetOfNode(e){if(!e)return 0;let t=e.size_left;for(;e!==this.root;)e.parent.right===e&&(t+=e.parent.size_left+e.parent.piece.length),e=e.parent;return t}shouldCheckCRLF(){return!(this._EOLNormalized&&this._EOL===` +`)}startWithLF(e){if(typeof e=="string")return e.charCodeAt(0)===10;if(e===Qt||e.piece.lineFeedCnt===0)return!1;const t=e.piece,n=this._buffers[t.bufferIndex].lineStarts,o=t.start.line,r=n[o]+t.start.column;return o===n.length-1||n[o+1]>r+1?!1:this._buffers[t.bufferIndex].buffer.charCodeAt(r)===10}endWithCR(e){return typeof e=="string"?e.charCodeAt(e.length-1)===13:e===Qt||e.piece.lineFeedCnt===0?!1:this.nodeCharCodeAt(e,e.piece.length-1)===13}validateCRLFWithPrevNode(e){if(this.shouldCheckCRLF()&&this.startWithLF(e)){const t=e.prev();this.endWithCR(t)&&this.fixCRLF(t,e)}}validateCRLFWithNextNode(e){if(this.shouldCheckCRLF()&&this.endWithCR(e)){const t=e.next();this.startWithLF(t)&&this.fixCRLF(e,t)}}fixCRLF(e,t){const n=[],o=this._buffers[e.piece.bufferIndex].lineStarts;let r;e.piece.end.column===0?r={line:e.piece.end.line-1,column:o[e.piece.end.line]-o[e.piece.end.line-1]-1}:r={line:e.piece.end.line,column:e.piece.end.column-1};const s=e.piece.length-1,a=e.piece.lineFeedCnt-1;e.piece=new Ga(e.piece.bufferIndex,e.piece.start,r,a,s),rg(this,e,-1,-1),e.piece.length===0&&n.push(e);const l={line:t.piece.start.line+1,column:0},c=t.piece.length-1,u=this.getLineFeedCnt(t.piece.bufferIndex,l,t.piece.end);t.piece=new Ga(t.piece.bufferIndex,l,t.piece.end,u,c),rg(this,t,-1,-1),t.piece.length===0&&n.push(t);const d=this.createNewPieces(`\r +`);this.rbInsertRight(e,d[0]);for(let h=0;hv.sortIndex-m.sortIndex)}this._mightContainRTL=o,this._mightContainUnusualLineTerminators=r,this._mightContainNonBasicASCII=s;const f=this._doApplyEdits(l);let g=null;if(t&&d.length>0){d.sort((p,v)=>v.lineNumber-p.lineNumber),g=[];for(let p=0,v=d.length;p0&&d[p-1].lineNumber===m)continue;const _=d[p].oldContent,w=this.getLineContent(m);w.length===0||w===_||Ws(w)!==-1||g.push(m)}}return this._onDidChangeContent.fire(),new det(h,f,g)}_reduceOperations(e){return e.length<1e3?e:[this._toSingleEditOperation(e)]}_toSingleEditOperation(e){let t=!1;const n=e[0].range,o=e[e.length-1].range,r=new V(n.startLineNumber,n.startColumn,o.endLineNumber,o.endColumn);let s=n.startLineNumber,a=n.startColumn;const l=[];for(let f=0,g=e.length;f0&&l.push(p.text),s=v.endLineNumber,a=v.endColumn}const c=l.join(""),[u,d,h]=Dv(c);return{sortIndex:0,identifier:e[0].identifier,range:r,rangeOffset:this.getOffsetAt(r.startLineNumber,r.startColumn),rangeLength:this.getValueLengthInRange(r,0),text:c,eolCount:u,firstLineLength:d,lastLineLength:h,forceMoveMarkers:t,isAutoWhitespaceEdit:!1}}_doApplyEdits(e){e.sort(Iw._sortOpsDescending);const t=[];for(let n=0;n0){const h=l.eolCount+1;h===1?d=new V(c,u,c,u+l.firstLineLength):d=new V(c,u,c+h-1,l.lastLineLength+1)}else d=new V(c,u,c,u);n=d.endLineNumber,o=d.endColumn,t.push(d),r=l}return t}static _sortOpsAscending(e,t){const n=V.compareRangesUsingEnds(e.range,t.range);return n===0?e.sortIndex-t.sortIndex:n}static _sortOpsDescending(e,t){const n=V.compareRangesUsingEnds(e.range,t.range);return n===0?t.sortIndex-e.sortIndex:-n}}class rat{constructor(e,t,n,o,r,s,a,l,c){this._chunks=e,this._bom=t,this._cr=n,this._lf=o,this._crlf=r,this._containsRTL=s,this._containsUnusualLineTerminators=a,this._isBasicASCII=l,this._normalizeEOL=c}_getEOL(e){const t=this._cr+this._lf+this._crlf,n=this._cr+this._crlf;return t===0?e===1?` +`;case 0:return this.getEOL();default:throw new Error("Unknown EOL preference")}}setEOL(e){this._pieceTree.setEOL(e)}applyEdits(e,t,n){let o=this._mightContainRTL,r=this._mightContainUnusualLineTerminators,s=this._mightContainNonBasicASCII,a=!0,l=[];for(let p=0;pv.sortIndex-m.sortIndex)}this._mightContainRTL=o,this._mightContainUnusualLineTerminators=r,this._mightContainNonBasicASCII=s;const f=this._doApplyEdits(l);let g=null;if(t&&d.length>0){d.sort((p,v)=>v.lineNumber-p.lineNumber),g=[];for(let p=0,v=d.length;p0&&d[p-1].lineNumber===m)continue;const _=d[p].oldContent,y=this.getLineContent(m);y.length===0||y===_||Ws(y)!==-1||g.push(m)}}return this._onDidChangeContent.fire(),new vet(h,f,g)}_reduceOperations(e){return e.length<1e3?e:[this._toSingleEditOperation(e)]}_toSingleEditOperation(e){let t=!1;const n=e[0].range,o=e[e.length-1].range,r=new V(n.startLineNumber,n.startColumn,o.endLineNumber,o.endColumn);let s=n.startLineNumber,a=n.startColumn;const l=[];for(let f=0,g=e.length;f0&&l.push(p.text),s=v.endLineNumber,a=v.endColumn}const c=l.join(""),[u,d,h]=kv(c);return{sortIndex:0,identifier:e[0].identifier,range:r,rangeOffset:this.getOffsetAt(r.startLineNumber,r.startColumn),rangeLength:this.getValueLengthInRange(r,0),text:c,eolCount:u,firstLineLength:d,lastLineLength:h,forceMoveMarkers:t,isAutoWhitespaceEdit:!1}}_doApplyEdits(e){e.sort(Iy._sortOpsDescending);const t=[];for(let n=0;n0){const h=l.eolCount+1;h===1?d=new V(c,u,c,u+l.firstLineLength):d=new V(c,u,c+h-1,l.lastLineLength+1)}else d=new V(c,u,c,u);n=d.endLineNumber,o=d.endColumn,t.push(d),r=l}return t}static _sortOpsAscending(e,t){const n=V.compareRangesUsingEnds(e.range,t.range);return n===0?e.sortIndex-t.sortIndex:n}static _sortOpsDescending(e,t){const n=V.compareRangesUsingEnds(e.range,t.range);return n===0?t.sortIndex-e.sortIndex:-n}}class dat{constructor(e,t,n,o,r,s,a,l,c){this._chunks=e,this._bom=t,this._cr=n,this._lf=o,this._crlf=r,this._containsRTL=s,this._containsUnusualLineTerminators=a,this._isBasicASCII=l,this._normalizeEOL=c}_getEOL(e){const t=this._cr+this._lf+this._crlf,n=this._cr+this._crlf;return t===0?e===1?` `:`\r `:n>t/2?`\r `:` `}create(e){const t=this._getEOL(e),n=this._chunks;if(this._normalizeEOL&&(t===`\r `&&(this._cr>0||this._lf>0)||t===` -`&&(this._cr>0||this._crlf>0)))for(let r=0,s=n.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=tat(this._tmpLineStarts,e);this.chunks.push(new U_(e,t.lineStarts)),this.cr+=t.cr,this.lf+=t.lf,this.crlf+=t.crlf,t.isBasicASCII||(this.isBasicASCII=!1,this.containsRTL||(this.containsRTL=hy(e)),this.containsUnusualLineTerminators||(this.containsUnusualLineTerminators=F_e(e)))}finish(e=!0){return this._finish(),new rat(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=sg(e.buffer);e.lineStarts=t,this._previousChar===13&&this.cr++}}}class sat{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,n){if(e>=this._store.length)return;if(t===0){this.insert(e,n);return}else if(n===0){this.delete(e,t);return}const o=this._store.slice(0,e),r=this._store.slice(e+t),s=aat(n,this._default);this._store=o.concat(s,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 n=[];for(let o=0;o0){const n=this._tokens[this._tokens.length-1];if(n.endLineNumber+1===e){n.appendLineTokens(t);return}}this._tokens.push(new lat(e,[t]))}finalize(){return this._tokens}}class cat{constructor(e,t){this.tokenizationSupport=t,this.initialState=this.tokenizationSupport.getInitialState(),this.store=new EH(e)}getStartState(e){return this.store.getStartState(e,this.initialState)}getFirstInvalidLine(){return this.store.getFirstInvalidLine(this.initialState)}}class uat extends cat{constructor(e,t,n,o){super(e,t),this._textModel=n,this._languageIdCodec=o}updateTokensUntilLine(e,t){const n=this._textModel.getLanguageId();for(;;){const o=this.getFirstInvalidLine();if(!o||o.lineNumber>t)break;const r=this._textModel.getLineContent(o.lineNumber),s=Vx(this._languageIdCodec,n,this.tokenizationSupport,r,!0,o.startState);e.add(o.lineNumber,s.tokens),this.store.setEndState(o.lineNumber,s.endState)}}getTokenTypeIfInsertingCharacter(e,t){const n=this.getStartState(e.lineNumber);if(!n)return 0;const o=this._textModel.getLanguageId(),r=this._textModel.getLineContent(e.lineNumber),s=r.substring(0,e.column-1)+t+r.substring(e.column-1),a=Vx(this._languageIdCodec,o,this.tokenizationSupport,s,!0,n),l=new gr(a.tokens,s,this._languageIdCodec);if(l.getCount()===0)return 0;const c=l.findTokenIndexAtOffset(e.column-1);return l.getStandardTokenType(c)}tokenizeLineWithEdit(e,t,n){const o=e.lineNumber,r=e.column,s=this.getStartState(o);if(!s)return null;const a=this._textModel.getLineContent(o),l=a.substring(0,r-1)+n+a.substring(r-1+t),c=this._textModel.getLanguageIdAtPosition(o,0),u=Vx(this._languageIdCodec,c,this.tokenizationSupport,l,!0,s);return new gr(u.tokens,l,this._languageIdCodec)}isCheapToTokenize(e){const t=this.store.getFirstInvalidEndStateLineNumberOrMax();return e1&&a>=1;a--){const l=this._textModel.getLineFirstNonWhitespaceColumn(a);if(l!==0&&l0&&n>0&&(n--,t--),this._lineEndStates.replace(e.startLineNumber,n,t)}}class hat{constructor(){this._ranges=[]}get min(){return this._ranges.length===0?null:this._ranges[0].start}delete(e){const t=this._ranges.findIndex(n=>n.contains(e));if(t!==-1){const n=this._ranges[t];n.start===e?n.endExclusive===e+1?this._ranges.splice(t,1):this._ranges[t]=new Cn(e+1,n.endExclusive):n.endExclusive===e+1?this._ranges[t]=new Cn(n.start,e):this._ranges.splice(t,1,new Cn(n.start,e),new Cn(e+1,n.endExclusive))}}addRange(e){Cn.addRange(e,this._ranges)}addRangeAndResize(e,t){let n=0;for(;!(n>=this._ranges.length||e.start<=this._ranges[n].endExclusive);)n++;let o=n;for(;!(o>=this._ranges.length||e.endExclusivee.toString()).join(" + ")}}function Vx(i,e,t,n,o,r){let s=null;if(t)try{s=t.tokenizeEncoded(n,o,r.clone())}catch(a){en(a)}return s||(s=u5(i.encodeLanguageId(e),r)),gr.convertToEndOffset(s.tokens,n.length),s}class fat{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,Rg(e=>{this._isScheduled=!1,this._backgroundTokenizeWithDeadline(e)}))}_backgroundTokenizeWithDeadline(e){const t=Date.now()+e.timeRemaining(),n=()=>{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){var t;const n=(t=this._tokenizerWithStateStore)===null||t===void 0?void 0:t.getFirstInvalidLine();return n?(this._tokenizerWithStateStore.updateTokensUntilLine(e,n.lineNumber),n.lineNumber):this._tokenizerWithStateStore._textModel.getLineCount()+1}checkFinished(){this._isDisposed||this._tokenizerWithStateStore.store.allStatesValid()&&this._backgroundTokenStore.backgroundTokenizationFinished()}requestTokens(e,t){this._tokenizerWithStateStore.store.invalidateEndStateRange(new ln(e,t))}}const ag=new Uint32Array(0).buffer;class Sh{static deleteBeginning(e,t){return e===null||e===ag?e:Sh.delete(e,0,t)}static deleteEnding(e,t){if(e===null||e===ag)return e;const n=Eg(e),o=n[n.length-2];return Sh.delete(e,t,o)}static delete(e,t,n){if(e===null||e===ag||t===n)return e;const o=Eg(e),r=o.length>>>1;if(t===0&&o[o.length-2]===n)return ag;const s=gr.findIndexInTokensArray(o,t),a=s>0?o[s-1<<1]:0,l=o[s<<1];if(nu&&(o[c++]=g,o[c++]=o[(f<<1)+1],u=g)}if(c===o.length)return e;const h=new Uint32Array(c);return h.set(o.subarray(0,c),0),h.buffer}static append(e,t){if(t===ag)return e;if(e===ag)return t;if(e===null)return e;if(t===null)return null;const n=Eg(e),o=Eg(t),r=o.length>>>1,s=new Uint32Array(n.length+o.length);s.set(n,0);let a=n.length;const l=n[n.length-2];for(let c=0;c>>1;let s=gr.findIndexInTokensArray(o,t);s>0&&o[s-1<<1]===t&&s--;for(let a=s;a0}getTokens(e,t,n){let o=null;if(t1&&(r=ns.getLanguageId(o[1])!==e),!r)return ag}if(!o||o.length===0){const r=new Uint32Array(2);return r[0]=t,r[1]=lse(e),r.buffer}return o[o.length-2]=t,o.byteOffset===0&&o.byteLength===o.buffer.byteLength?o.buffer:o}_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 n=[];for(let o=0;o=this._len)return;if(e.startLineNumber===e.endLineNumber){if(e.startColumn===e.endColumn)return;this._lineTokens[t]=Sh.delete(this._lineTokens[t],e.startColumn-1,e.endColumn-1);return}this._lineTokens[t]=Sh.deleteEnding(this._lineTokens[t],e.startColumn-1);const n=e.endLineNumber-1;let o=null;n=this._len)){if(t===0){this._lineTokens[o]=Sh.insert(this._lineTokens[o],e.column-1,n);return}this._lineTokens[o]=Sh.deleteEnding(this._lineTokens[o],e.column-1),this._lineTokens[o]=Sh.insert(this._lineTokens[o],e.column-1,n),this._insertLines(e.lineNumber,t)}}setMultilineTokens(e,t){if(e.length===0)return{changes:[]};const n=[];for(let o=0,r=e.length;o>>0}class BG{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 n=e;if(t.length>0){const r=t[0].getRange(),s=t[t.length-1].getRange();if(!r||!s)return e;n=e.plusRange(r).plusRange(s)}let o=null;for(let r=0,s=this._pieces.length;rn.endLineNumber){o=o||{index:r};break}if(a.removeTokens(n),a.isEmpty()){this._pieces.splice(r,1),r--,s--;continue}if(a.endLineNumbern.endLineNumber){o=o||{index:r};continue}const[l,c]=a.split(n);if(l.isEmpty()){o=o||{index:r};continue}c.isEmpty()||(this._pieces.splice(r,1,l,c),r++,s++,o=o||{index:r})}return o=o||{index:this._pieces.length},t.length>0&&(this._pieces=F4(this._pieces,o.index,t)),n}isComplete(){return this._isComplete}addSparseTokens(e,t){if(t.getLineContent().length===0)return t;const n=this._pieces;if(n.length===0)return t;const o=BG._findFirstPieceWithLine(n,e),r=n[o].getLineTokens(e);if(!r)return t;const s=t.getCount(),a=r.getCount();let l=0;const c=[];let u=0,d=0;const h=(f,g)=>{f!==d&&(d=f,c[u++]=f,c[u++]=g)};for(let f=0;f>>0,_=~m>>>0;for(;lt)o=r-1;else{for(;r>n&&e[r-1].startLineNumber<=t&&t<=e[r-1].endLineNumber;)r--;return r}}return n}acceptEdit(e,t,n,o,r){for(const s of this._pieces)s.acceptEdit(e,t,n,o,r)}}class pP extends Dbe{constructor(e,t,n,o,r,s){super(),this._languageService=e,this._languageConfigurationService=t,this._textModel=n,this._bracketPairsTextModelPart=o,this._languageId=r,this._attachedViews=s,this._semanticTokens=new BG(this._languageService.languageIdCodec),this._onDidChangeLanguage=this._register(new le),this.onDidChangeLanguage=this._onDidChangeLanguage.event,this._onDidChangeLanguageConfiguration=this._register(new le),this.onDidChangeLanguageConfiguration=this._onDidChangeLanguageConfiguration.event,this._onDidChangeTokens=this._register(new le),this.onDidChangeTokens=this._onDidChangeTokens.event,this.grammarTokens=this._register(new gat(this._languageService.languageIdCodec,this._textModel,()=>this._languageId,this._attachedViews)),this._register(this._languageConfigurationService.onDidChange(a=>{a.affects(this._languageId)&&this._onDidChangeLanguageConfiguration.fire({})})),this._register(this.grammarTokens.onDidChangeTokens(a=>{this._emitModelTokensChangedEvent(a)})),this._register(this.grammarTokens.onDidChangeBackgroundTokenizationState(a=>{this._bracketPairsTextModelPart.handleDidChangeBackgroundTokenizationState()}))}handleDidChangeContent(e){if(e.isFlush)this._semanticTokens.flush();else if(!e.isEolChange)for(const t of e.changes){const[n,o,r]=Dv(t.text);this._semanticTokens.acceptEdit(t.range,n,o,r,t.text.length>0?t.text.charCodeAt(0):0)}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 Vo("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)}isCheapToTokenize(e){return this.validateLineNumber(e),this.grammarTokens.isCheapToTokenize(e)}tokenizeIfCheap(e){this.validateLineNumber(e),this.grammarTokens.tokenizeIfCheap(e)}getTokenTypeIfInsertingCharacter(e,t,n){return this.grammarTokens.getTokenTypeIfInsertingCharacter(e,t,n)}tokenizeLineWithEdit(e,t,n){return this.grammarTokens.tokenizeLineWithEdit(e,t,n)}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 n=this._textModel.validateRange(this._semanticTokens.setPartial(e,t));this._emitModelTokensChangedEvent({semanticTokensApplied:!0,ranges:[{fromLineNumber:n.startLineNumber,toLineNumber:n.endLineNumber}]})}getWordAtPosition(e){this.assertNotDisposed();const t=this._textModel.validatePosition(e),n=this._textModel.getLineContent(t.lineNumber),o=this.getLineTokens(t.lineNumber),r=o.findTokenIndexAtOffset(t.column-1),[s,a]=pP._findLanguageBoundaries(o,r),l=kD(t.column,this.getLanguageConfiguration(o.getLanguageId(r)).getWordDefinition(),n.substring(s,a),s);if(l&&l.startColumn<=e.column&&e.column<=l.endColumn)return l;if(r>0&&s===t.column-1){const[c,u]=pP._findLanguageBoundaries(o,r-1),d=kD(t.column,this.getLanguageConfiguration(o.getLanguageId(r-1)).getWordDefinition(),n.substring(c,u),c);if(d&&d.startColumn<=e.column&&e.column<=d.endColumn)return d}return null}getLanguageConfiguration(e){return this._languageConfigurationService.getLanguageConfiguration(e)}static _findLanguageBoundaries(e,t){const n=e.getLanguageId(t);let o=0;for(let s=t;s>=0&&e.getLanguageId(s)===n;s--)o=e.getStartOffset(s);let r=e.getLineContent().length;for(let s=t,a=e.getCount();s{const s=this.getLanguageId();r.changedLanguages.indexOf(s)!==-1&&this.resetTokenization()})),this.resetTokenization(),this._register(o.onDidChangeVisibleRanges(({view:r,state:s})=>{if(s){let a=this._attachedViewStates.get(r);a||(a=new pat(()=>this.refreshRanges(a.lineRanges)),this._attachedViewStates.set(r,a)),a.handleStateChange(s)}else this._attachedViewStates.deleteAndDispose(r)}))}resetTokenization(e=!0){var t;this._tokens.flush(),(t=this._debugBackgroundTokens)===null||t===void 0||t.flush(),this._debugBackgroundStates&&(this._debugBackgroundStates=new EH(this._textModel.getLineCount())),e&&this._onDidChangeTokens.fire({semanticTokensApplied:!1,ranges:[{fromLineNumber:1,toLineNumber:this._textModel.getLineCount()}]});const n=()=>{if(this._textModel.isTooLargeForTokenization())return[null,null];const s=oo.get(this.getLanguageId());if(!s)return[null,null];let a;try{a=s.getInitialState()}catch(l){return en(l),[null,null]}return[s,a]},[o,r]=n();if(o&&r?this._tokenizer=new uat(this._textModel.getLineCount(),o,this._textModel,this._languageIdCodec):this._tokenizer=null,this._backgroundTokenizer.clear(),this._defaultBackgroundTokenizer=null,this._tokenizer){const s={setTokens:a=>{this.setTokens(a)},backgroundTokenizationFinished:()=>{if(this._backgroundTokenizationState===2)return;const a=2;this._backgroundTokenizationState=a,this._onDidChangeBackgroundTokenizationState.fire()},setEndState:(a,l)=>{var c;if(!this._tokenizer)return;const u=this._tokenizer.store.getFirstInvalidEndStateLineNumber();u!==null&&a>=u&&((c=this._tokenizer)===null||c===void 0||c.store.setEndState(a,l))}};o&&o.createBackgroundTokenizer&&!o.backgroundTokenizerShouldOnlyVerifyTokens&&(this._backgroundTokenizer.value=o.createBackgroundTokenizer(this._textModel,s)),this._backgroundTokenizer.value||(this._backgroundTokenizer.value=this._defaultBackgroundTokenizer=new fat(this._tokenizer,s),this._defaultBackgroundTokenizer.handleChanges()),(o==null?void 0:o.backgroundTokenizerShouldOnlyVerifyTokens)&&o.createBackgroundTokenizer?(this._debugBackgroundTokens=new lk(this._languageIdCodec),this._debugBackgroundStates=new EH(this._textModel.getLineCount()),this._debugBackgroundTokenizer.clear(),this._debugBackgroundTokenizer.value=o.createBackgroundTokenizer(this._textModel,{setTokens:a=>{var l;(l=this._debugBackgroundTokens)===null||l===void 0||l.setMultilineTokens(a,this._textModel)},backgroundTokenizationFinished(){},setEndState:(a,l)=>{var c;(c=this._debugBackgroundStates)===null||c===void 0||c.setEndState(a,l)}})):(this._debugBackgroundTokens=void 0,this._debugBackgroundStates=void 0,this._debugBackgroundTokenizer.value=void 0)}this.refreshAllVisibleLineTokens()}handleDidChangeAttached(){var e;(e=this._defaultBackgroundTokenizer)===null||e===void 0||e.handleChanges()}handleDidChangeContent(e){var t,n,o;if(e.isFlush)this.resetTokenization(!1);else if(!e.isEolChange){for(const r of e.changes){const[s,a]=Dv(r.text);this._tokens.acceptEdit(r.range,s,a),(t=this._debugBackgroundTokens)===null||t===void 0||t.acceptEdit(r.range,s,a)}(n=this._debugBackgroundStates)===null||n===void 0||n.acceptChanges(e.changes),this._tokenizer&&this._tokenizer.store.acceptChanges(e.changes),(o=this._defaultBackgroundTokenizer)===null||o===void 0||o.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=ln.joinMany([...this._attachedViewStates].map(([t,n])=>n.lineRanges));this.refreshRanges(e)}refreshRanges(e){for(const t of e)this.refreshRange(t.startLineNumber,t.endLineNumberExclusive-1)}refreshRange(e,t){var n,o;if(!this._tokenizer)return;e=Math.max(1,Math.min(this._textModel.getLineCount(),e)),t=Math.min(this._textModel.getLineCount(),t);const r=new LH,{heuristicTokens:s}=this._tokenizer.tokenizeHeuristically(r,e,t),a=this.setTokens(r.finalize());if(s)for(const l of a.changes)(n=this._backgroundTokenizer.value)===null||n===void 0||n.requestTokens(l.fromLineNumber,l.toLineNumber+1);(o=this._defaultBackgroundTokenizer)===null||o===void 0||o.checkFinished()}forceTokenization(e){var t,n;const o=new LH;(t=this._tokenizer)===null||t===void 0||t.updateTokensUntilLine(o,e),this.setTokens(o.finalize()),(n=this._defaultBackgroundTokenizer)===null||n===void 0||n.checkFinished()}isCheapToTokenize(e){return this._tokenizer?this._tokenizer.isCheapToTokenize(e):!0}tokenizeIfCheap(e){this.isCheapToTokenize(e)&&this.forceTokenization(e)}getLineTokens(e){var t;const n=this._textModel.getLineContent(e),o=this._tokens.getTokens(this._textModel.getLanguageId(),e-1,n);if(this._debugBackgroundTokens&&this._debugBackgroundStates&&this._tokenizer&&this._debugBackgroundStates.getFirstInvalidEndStateLineNumberOrMax()>e&&this._tokenizer.store.getFirstInvalidEndStateLineNumberOrMax()>e){const r=this._debugBackgroundTokens.getTokens(this._textModel.getLanguageId(),e-1,n);!o.equals(r)&&((t=this._debugBackgroundTokenizer.value)===null||t===void 0?void 0:t.reportMismatchingTokens)&&this._debugBackgroundTokenizer.value.reportMismatchingTokens(e)}return o}getTokenTypeIfInsertingCharacter(e,t,n){if(!this._tokenizer)return 0;const o=this._textModel.validatePosition(new ae(e,t));return this.forceTokenization(o.lineNumber),this._tokenizer.getTokenTypeIfInsertingCharacter(o,n)}tokenizeLineWithEdit(e,t,n){if(!this._tokenizer)return null;const o=this._textModel.validatePosition(e);return this.forceTokenization(o.lineNumber),this._tokenizer.tokenizeLineWithEdit(o,t,n)}get hasTokens(){return this._tokens.hasTokens}}class pat extends _e{get lineRanges(){return this._lineRanges}constructor(e){super(),this._refreshTokens=e,this.runner=this._register(new bi(()=>this.update(),50)),this._computedLineRanges=[],this._lineRanges=[]}update(){Lo(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()}}class mat{constructor(){this.changeType=1}}class qd{static applyInjectedText(e,t){if(!t||t.length===0)return e;let n="",o=0;for(const r of t)n+=e.substring(o,r.column-1),o=r.column-1,n+=r.options.content;return n+=e.substring(o),n}static fromDecorations(e){const t=[];for(const n of e)n.options.before&&n.options.before.content.length>0&&t.push(new qd(n.ownerId,n.range.startLineNumber,n.range.startColumn,n.options.before,0)),n.options.after&&n.options.after.content.length>0&&t.push(new qd(n.ownerId,n.range.endLineNumber,n.range.endColumn,n.options.after,1));return t.sort((n,o)=>n.lineNumber===o.lineNumber?n.column===o.column?n.order-o.order:n.column-o.column:n.lineNumber-o.lineNumber),t}constructor(e,t,n,o,r){this.ownerId=e,this.lineNumber=t,this.column=n,this.options=o,this.order=r}}class cse{constructor(e,t,n){this.changeType=2,this.lineNumber=e,this.detail=t,this.injectedText=n}}class vat{constructor(e,t){this.changeType=3,this.fromLineNumber=e,this.toLineNumber=t}}class _at{constructor(e,t,n,o){this.changeType=4,this.injectedTexts=o,this.fromLineNumber=e,this.toLineNumber=t,this.detail=n}}class bat{constructor(){this.changeType=5}}class Tw{constructor(e,t,n,o){this.changes=e,this.versionId=t,this.isUndoing=n,this.isRedoing=o,this.resultingSelection=null}containsEvent(e){for(let t=0,n=this.changes.length;t=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},v9=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},R_;function wat(i){const e=new Xbe;return e.acceptChunk(i),e.finish()}function yat(i){const e=new Xbe;let t;for(;typeof(t=i.read())=="string";)e.acceptChunk(t);return e.finish()}function use(i,e){let t;return typeof i=="string"?t=wat(i):cet(i)?t=yat(i):t=i,t.create(e)}let b2=0;const Sat=999,xat=1e4;class Lat{constructor(e){this._source=e,this._eos=!1}read(){if(this._eos)return null;const e=[];let t=0,n=0;do{const o=this._source.read();if(o===null)return this._eos=!0,t===0?null:e.join("");if(o.length>0&&(e[t++]=o,n+=o.length),n>=64*1024)return e.join("")}while(!0)}}const Hx=()=>{throw new Error("Invalid change accessor")};let _f=R_=class extends _e{static resolveOptions(e,t){if(t.detectIndentation){const n=ese(e,t.tabSize,t.insertSpaces);return new tM({tabSize:n.tabSize,indentSize:"tabSize",insertSpaces:n.insertSpaces,trimAutoWhitespace:t.trimAutoWhitespace,defaultEOL:t.defaultEOL,bracketPairColorizationOptions:t.bracketPairColorizationOptions})}return new tM(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 Iu(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,n,o=null,r,s,a){super(),this._undoRedoService=r,this._languageService=s,this._languageConfigurationService=a,this._onWillDispose=this._register(new le),this.onWillDispose=this._onWillDispose.event,this._onDidChangeDecorations=this._register(new Tat(f=>this.handleBeforeFireDecorationsChangedEvent(f))),this.onDidChangeDecorations=this._onDidChangeDecorations.event,this._onDidChangeOptions=this._register(new le),this.onDidChangeOptions=this._onDidChangeOptions.event,this._onDidChangeAttached=this._register(new le),this.onDidChangeAttached=this._onDidChangeAttached.event,this._onDidChangeInjectedText=this._register(new le),this._eventEmitter=this._register(new Nat),this._languageSelectionListener=this._register(new Kr),this._deltaDecorationCallCnt=0,this._attachedViews=new Rat,b2++,this.id="$model"+b2,this.isForSimpleWidget=n.isForSimpleWidget,typeof o=="undefined"||o===null?this._associatedResource=Rt.parse("inmemory://model/"+b2):this._associatedResource=o,this._attachedEditorCount=0;const{textBuffer:l,disposable:c}=use(e,n.defaultEOL);this._buffer=l,this._bufferDisposable=c,this._options=R_.resolveOptions(this._buffer,n);const u=typeof t=="string"?t:t.languageId;typeof t!="string"&&(this._languageSelectionListener.value=t.onDidChange(()=>this._setLanguage(t.languageId))),this._bracketPairs=this._register(new Dst(this,this._languageConfigurationService)),this._guidesTextModelPart=this._register(new wrt(this,this._languageConfigurationService)),this._decorationProvider=this._register(new Ist(this)),this._tokenizationTextModelPart=new pP(this._languageService,this._languageConfigurationService,this,this._bracketPairs,u,this._attachedViews);const d=this._buffer.getLineCount(),h=this._buffer.getValueLengthInRange(new V(1,1,d,this._buffer.getLineLength(d)+1),0);n.largeFileOptimizations?(this._isTooLargeForTokenization=h>R_.LARGE_FILE_SIZE_THRESHOLD||d>R_.LARGE_FILE_LINE_COUNT_THRESHOLD,this._isTooLargeForHeapOperation=h>R_.LARGE_FILE_HEAP_OPERATION_THRESHOLD):(this._isTooLargeForTokenization=!1,this._isTooLargeForHeapOperation=!1),this._isTooLargeForSyncing=h>R_._MODEL_SYNC_LIMIT,this._versionId=1,this._alternativeVersionId=1,this._initialUndoRedoSnapshot=null,this._isDisposed=!1,this.__isDisposing=!1,this._instanceId=B_e(b2),this._lastDecorationId=0,this._decorations=Object.create(null),this._decorationsTree=new dse,this._commandManager=new AG(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(u)}dispose(){this.__isDisposing=!0,this._onWillDispose.fire(),this._tokenizationTextModelPart.dispose(),this._isDisposed=!0,super.dispose(),this._bufferDisposable.dispose(),this.__isDisposing=!1;const e=new Iw([],"",` -`,!1,!1,!0,!0);e.dispose(),this._buffer=e,this._bufferDisposable=_e.None}_assertNotDisposed(){if(this._isDisposed)throw new Error("Model is disposed!")}_emitContentChangedEvent(e,t){this.__isDisposing||(this._tokenizationTextModelPart.handleDidChangeContent(t),this._bracketPairs.handleDidChangeContent(t),this._eventEmitter.fire(new T0(e,t)))}setValue(e){if(this._assertNotDisposed(),e==null)throw Rc();const{textBuffer:t,disposable:n}=use(e,this._options.defaultEOL);this._setValueFromTextBuffer(t,n)}_createContentChanged2(e,t,n,o,r,s,a,l){return{changes:[{range:e,rangeOffset:t,rangeLength:n,text:o}],eol:this._buffer.getEOL(),isEolChange:l,versionId:this.getVersionId(),isUndoing:r,isRedoing:s,isFlush:a}}_setValueFromTextBuffer(e,t){this._assertNotDisposed();const n=this.getFullModelRange(),o=this.getValueLengthInRange(n),r=this.getLineCount(),s=this.getLineMaxColumn(r);this._buffer=e,this._bufferDisposable.dispose(),this._bufferDisposable=t,this._increaseVersionId(),this._decorations=Object.create(null),this._decorationsTree=new dse,this._commandManager.clear(),this._trimAutoWhitespaceLines=null,this._emitContentChangedEvent(new Tw([new mat],this._versionId,!1,!1),this._createContentChanged2(new V(1,1,r,s),0,o,this.getValue(),!1,!1,!0,!1))}setEOL(e){this._assertNotDisposed();const t=e===1?`\r +`&&(this._cr>0||this._crlf>0)))for(let r=0,s=n.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=aat(this._tmpLineStarts,e);this.chunks.push(new j_(e,t.lineStarts)),this.cr+=t.cr,this.lf+=t.lf,this.crlf+=t.crlf,t.isBasicASCII||(this.isBasicASCII=!1,this.containsRTL||(this.containsRTL=fw(e)),this.containsUnusualLineTerminators||(this.containsUnusualLineTerminators=j_e(e)))}finish(e=!0){return this._finish(),new dat(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=ag(e.buffer);e.lineStarts=t,this._previousChar===13&&this.cr++}}}class hat{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,n){if(e>=this._store.length)return;if(t===0){this.insert(e,n);return}else if(n===0){this.delete(e,t);return}const o=this._store.slice(0,e),r=this._store.slice(e+t),s=fat(n,this._default);this._store=o.concat(s,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 n=[];for(let o=0;o0){const n=this._tokens[this._tokens.length-1];if(n.endLineNumber+1===e){n.appendLineTokens(t);return}}this._tokens.push(new gat(e,[t]))}finalize(){return this._tokens}}class pat{constructor(e,t){this.tokenizationSupport=t,this.initialState=this.tokenizationSupport.getInitialState(),this.store=new TH(e)}getStartState(e){return this.store.getStartState(e,this.initialState)}getFirstInvalidLine(){return this.store.getFirstInvalidLine(this.initialState)}}class mat extends pat{constructor(e,t,n,o){super(e,t),this._textModel=n,this._languageIdCodec=o}updateTokensUntilLine(e,t){const n=this._textModel.getLanguageId();for(;;){const o=this.getFirstInvalidLine();if(!o||o.lineNumber>t)break;const r=this._textModel.getLineContent(o.lineNumber),s=Hx(this._languageIdCodec,n,this.tokenizationSupport,r,!0,o.startState);e.add(o.lineNumber,s.tokens),this.store.setEndState(o.lineNumber,s.endState)}}getTokenTypeIfInsertingCharacter(e,t){const n=this.getStartState(e.lineNumber);if(!n)return 0;const o=this._textModel.getLanguageId(),r=this._textModel.getLineContent(e.lineNumber),s=r.substring(0,e.column-1)+t+r.substring(e.column-1),a=Hx(this._languageIdCodec,o,this.tokenizationSupport,s,!0,n),l=new pr(a.tokens,s,this._languageIdCodec);if(l.getCount()===0)return 0;const c=l.findTokenIndexAtOffset(e.column-1);return l.getStandardTokenType(c)}tokenizeLineWithEdit(e,t,n){const o=e.lineNumber,r=e.column,s=this.getStartState(o);if(!s)return null;const a=this._textModel.getLineContent(o),l=a.substring(0,r-1)+n+a.substring(r-1+t),c=this._textModel.getLanguageIdAtPosition(o,0),u=Hx(this._languageIdCodec,c,this.tokenizationSupport,l,!0,s);return new pr(u.tokens,l,this._languageIdCodec)}isCheapToTokenize(e){const t=this.store.getFirstInvalidEndStateLineNumberOrMax();return e1&&a>=1;a--){const l=this._textModel.getLineFirstNonWhitespaceColumn(a);if(l!==0&&l0&&n>0&&(n--,t--),this._lineEndStates.replace(e.startLineNumber,n,t)}}class _at{constructor(){this._ranges=[]}get min(){return this._ranges.length===0?null:this._ranges[0].start}delete(e){const t=this._ranges.findIndex(n=>n.contains(e));if(t!==-1){const n=this._ranges[t];n.start===e?n.endExclusive===e+1?this._ranges.splice(t,1):this._ranges[t]=new Cn(e+1,n.endExclusive):n.endExclusive===e+1?this._ranges[t]=new Cn(n.start,e):this._ranges.splice(t,1,new Cn(n.start,e),new Cn(e+1,n.endExclusive))}}addRange(e){Cn.addRange(e,this._ranges)}addRangeAndResize(e,t){let n=0;for(;!(n>=this._ranges.length||e.start<=this._ranges[n].endExclusive);)n++;let o=n;for(;!(o>=this._ranges.length||e.endExclusivee.toString()).join(" + ")}}function Hx(i,e,t,n,o,r){let s=null;if(t)try{s=t.tokenizeEncoded(n,o,r.clone())}catch(a){en(a)}return s||(s=d5(i.encodeLanguageId(e),r)),pr.convertToEndOffset(s.tokens,n.length),s}class bat{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,Mg(e=>{this._isScheduled=!1,this._backgroundTokenizeWithDeadline(e)}))}_backgroundTokenizeWithDeadline(e){const t=Date.now()+e.timeRemaining(),n=()=>{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){var t;const n=(t=this._tokenizerWithStateStore)===null||t===void 0?void 0:t.getFirstInvalidLine();return n?(this._tokenizerWithStateStore.updateTokensUntilLine(e,n.lineNumber),n.lineNumber):this._tokenizerWithStateStore._textModel.getLineCount()+1}checkFinished(){this._isDisposed||this._tokenizerWithStateStore.store.allStatesValid()&&this._backgroundTokenStore.backgroundTokenizationFinished()}requestTokens(e,t){this._tokenizerWithStateStore.store.invalidateEndStateRange(new ln(e,t))}}const lg=new Uint32Array(0).buffer;class Lh{static deleteBeginning(e,t){return e===null||e===lg?e:Lh.delete(e,0,t)}static deleteEnding(e,t){if(e===null||e===lg)return e;const n=Dg(e),o=n[n.length-2];return Lh.delete(e,t,o)}static delete(e,t,n){if(e===null||e===lg||t===n)return e;const o=Dg(e),r=o.length>>>1;if(t===0&&o[o.length-2]===n)return lg;const s=pr.findIndexInTokensArray(o,t),a=s>0?o[s-1<<1]:0,l=o[s<<1];if(nu&&(o[c++]=g,o[c++]=o[(f<<1)+1],u=g)}if(c===o.length)return e;const h=new Uint32Array(c);return h.set(o.subarray(0,c),0),h.buffer}static append(e,t){if(t===lg)return e;if(e===lg)return t;if(e===null)return e;if(t===null)return null;const n=Dg(e),o=Dg(t),r=o.length>>>1,s=new Uint32Array(n.length+o.length);s.set(n,0);let a=n.length;const l=n[n.length-2];for(let c=0;c>>1;let s=pr.findIndexInTokensArray(o,t);s>0&&o[s-1<<1]===t&&s--;for(let a=s;a0}getTokens(e,t,n){let o=null;if(t1&&(r=is.getLanguageId(o[1])!==e),!r)return lg}if(!o||o.length===0){const r=new Uint32Array(2);return r[0]=t,r[1]=mse(e),r.buffer}return o[o.length-2]=t,o.byteOffset===0&&o.byteLength===o.buffer.byteLength?o.buffer:o}_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 n=[];for(let o=0;o=this._len)return;if(e.startLineNumber===e.endLineNumber){if(e.startColumn===e.endColumn)return;this._lineTokens[t]=Lh.delete(this._lineTokens[t],e.startColumn-1,e.endColumn-1);return}this._lineTokens[t]=Lh.deleteEnding(this._lineTokens[t],e.startColumn-1);const n=e.endLineNumber-1;let o=null;n=this._len)){if(t===0){this._lineTokens[o]=Lh.insert(this._lineTokens[o],e.column-1,n);return}this._lineTokens[o]=Lh.deleteEnding(this._lineTokens[o],e.column-1),this._lineTokens[o]=Lh.insert(this._lineTokens[o],e.column-1,n),this._insertLines(e.lineNumber,t)}}setMultilineTokens(e,t){if(e.length===0)return{changes:[]};const n=[];for(let o=0,r=e.length;o>>0}class jG{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 n=e;if(t.length>0){const r=t[0].getRange(),s=t[t.length-1].getRange();if(!r||!s)return e;n=e.plusRange(r).plusRange(s)}let o=null;for(let r=0,s=this._pieces.length;rn.endLineNumber){o=o||{index:r};break}if(a.removeTokens(n),a.isEmpty()){this._pieces.splice(r,1),r--,s--;continue}if(a.endLineNumbern.endLineNumber){o=o||{index:r};continue}const[l,c]=a.split(n);if(l.isEmpty()){o=o||{index:r};continue}c.isEmpty()||(this._pieces.splice(r,1,l,c),r++,s++,o=o||{index:r})}return o=o||{index:this._pieces.length},t.length>0&&(this._pieces=B4(this._pieces,o.index,t)),n}isComplete(){return this._isComplete}addSparseTokens(e,t){if(t.getLineContent().length===0)return t;const n=this._pieces;if(n.length===0)return t;const o=jG._findFirstPieceWithLine(n,e),r=n[o].getLineTokens(e);if(!r)return t;const s=t.getCount(),a=r.getCount();let l=0;const c=[];let u=0,d=0;const h=(f,g)=>{f!==d&&(d=f,c[u++]=f,c[u++]=g)};for(let f=0;f>>0,_=~m>>>0;for(;lt)o=r-1;else{for(;r>n&&e[r-1].startLineNumber<=t&&t<=e[r-1].endLineNumber;)r--;return r}}return n}acceptEdit(e,t,n,o,r){for(const s of this._pieces)s.acceptEdit(e,t,n,o,r)}}class _P extends Pbe{constructor(e,t,n,o,r,s){super(),this._languageService=e,this._languageConfigurationService=t,this._textModel=n,this._bracketPairsTextModelPart=o,this._languageId=r,this._attachedViews=s,this._semanticTokens=new jG(this._languageService.languageIdCodec),this._onDidChangeLanguage=this._register(new le),this.onDidChangeLanguage=this._onDidChangeLanguage.event,this._onDidChangeLanguageConfiguration=this._register(new le),this.onDidChangeLanguageConfiguration=this._onDidChangeLanguageConfiguration.event,this._onDidChangeTokens=this._register(new le),this.onDidChangeTokens=this._onDidChangeTokens.event,this.grammarTokens=this._register(new Cat(this._languageService.languageIdCodec,this._textModel,()=>this._languageId,this._attachedViews)),this._register(this._languageConfigurationService.onDidChange(a=>{a.affects(this._languageId)&&this._onDidChangeLanguageConfiguration.fire({})})),this._register(this.grammarTokens.onDidChangeTokens(a=>{this._emitModelTokensChangedEvent(a)})),this._register(this.grammarTokens.onDidChangeBackgroundTokenizationState(a=>{this._bracketPairsTextModelPart.handleDidChangeBackgroundTokenizationState()}))}handleDidChangeContent(e){if(e.isFlush)this._semanticTokens.flush();else if(!e.isEolChange)for(const t of e.changes){const[n,o,r]=kv(t.text);this._semanticTokens.acceptEdit(t.range,n,o,r,t.text.length>0?t.text.charCodeAt(0):0)}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 Vo("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)}isCheapToTokenize(e){return this.validateLineNumber(e),this.grammarTokens.isCheapToTokenize(e)}tokenizeIfCheap(e){this.validateLineNumber(e),this.grammarTokens.tokenizeIfCheap(e)}getTokenTypeIfInsertingCharacter(e,t,n){return this.grammarTokens.getTokenTypeIfInsertingCharacter(e,t,n)}tokenizeLineWithEdit(e,t,n){return this.grammarTokens.tokenizeLineWithEdit(e,t,n)}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 n=this._textModel.validateRange(this._semanticTokens.setPartial(e,t));this._emitModelTokensChangedEvent({semanticTokensApplied:!0,ranges:[{fromLineNumber:n.startLineNumber,toLineNumber:n.endLineNumber}]})}getWordAtPosition(e){this.assertNotDisposed();const t=this._textModel.validatePosition(e),n=this._textModel.getLineContent(t.lineNumber),o=this.getLineTokens(t.lineNumber),r=o.findTokenIndexAtOffset(t.column-1),[s,a]=_P._findLanguageBoundaries(o,r),l=kD(t.column,this.getLanguageConfiguration(o.getLanguageId(r)).getWordDefinition(),n.substring(s,a),s);if(l&&l.startColumn<=e.column&&e.column<=l.endColumn)return l;if(r>0&&s===t.column-1){const[c,u]=_P._findLanguageBoundaries(o,r-1),d=kD(t.column,this.getLanguageConfiguration(o.getLanguageId(r-1)).getWordDefinition(),n.substring(c,u),c);if(d&&d.startColumn<=e.column&&e.column<=d.endColumn)return d}return null}getLanguageConfiguration(e){return this._languageConfigurationService.getLanguageConfiguration(e)}static _findLanguageBoundaries(e,t){const n=e.getLanguageId(t);let o=0;for(let s=t;s>=0&&e.getLanguageId(s)===n;s--)o=e.getStartOffset(s);let r=e.getLineContent().length;for(let s=t,a=e.getCount();s{const s=this.getLanguageId();r.changedLanguages.indexOf(s)!==-1&&this.resetTokenization()})),this.resetTokenization(),this._register(o.onDidChangeVisibleRanges(({view:r,state:s})=>{if(s){let a=this._attachedViewStates.get(r);a||(a=new yat(()=>this.refreshRanges(a.lineRanges)),this._attachedViewStates.set(r,a)),a.handleStateChange(s)}else this._attachedViewStates.deleteAndDispose(r)}))}resetTokenization(e=!0){var t;this._tokens.flush(),(t=this._debugBackgroundTokens)===null||t===void 0||t.flush(),this._debugBackgroundStates&&(this._debugBackgroundStates=new TH(this._textModel.getLineCount())),e&&this._onDidChangeTokens.fire({semanticTokensApplied:!1,ranges:[{fromLineNumber:1,toLineNumber:this._textModel.getLineCount()}]});const n=()=>{if(this._textModel.isTooLargeForTokenization())return[null,null];const s=oo.get(this.getLanguageId());if(!s)return[null,null];let a;try{a=s.getInitialState()}catch(l){return en(l),[null,null]}return[s,a]},[o,r]=n();if(o&&r?this._tokenizer=new mat(this._textModel.getLineCount(),o,this._textModel,this._languageIdCodec):this._tokenizer=null,this._backgroundTokenizer.clear(),this._defaultBackgroundTokenizer=null,this._tokenizer){const s={setTokens:a=>{this.setTokens(a)},backgroundTokenizationFinished:()=>{if(this._backgroundTokenizationState===2)return;const a=2;this._backgroundTokenizationState=a,this._onDidChangeBackgroundTokenizationState.fire()},setEndState:(a,l)=>{var c;if(!this._tokenizer)return;const u=this._tokenizer.store.getFirstInvalidEndStateLineNumber();u!==null&&a>=u&&((c=this._tokenizer)===null||c===void 0||c.store.setEndState(a,l))}};o&&o.createBackgroundTokenizer&&!o.backgroundTokenizerShouldOnlyVerifyTokens&&(this._backgroundTokenizer.value=o.createBackgroundTokenizer(this._textModel,s)),this._backgroundTokenizer.value||(this._backgroundTokenizer.value=this._defaultBackgroundTokenizer=new bat(this._tokenizer,s),this._defaultBackgroundTokenizer.handleChanges()),(o==null?void 0:o.backgroundTokenizerShouldOnlyVerifyTokens)&&o.createBackgroundTokenizer?(this._debugBackgroundTokens=new lk(this._languageIdCodec),this._debugBackgroundStates=new TH(this._textModel.getLineCount()),this._debugBackgroundTokenizer.clear(),this._debugBackgroundTokenizer.value=o.createBackgroundTokenizer(this._textModel,{setTokens:a=>{var l;(l=this._debugBackgroundTokens)===null||l===void 0||l.setMultilineTokens(a,this._textModel)},backgroundTokenizationFinished(){},setEndState:(a,l)=>{var c;(c=this._debugBackgroundStates)===null||c===void 0||c.setEndState(a,l)}})):(this._debugBackgroundTokens=void 0,this._debugBackgroundStates=void 0,this._debugBackgroundTokenizer.value=void 0)}this.refreshAllVisibleLineTokens()}handleDidChangeAttached(){var e;(e=this._defaultBackgroundTokenizer)===null||e===void 0||e.handleChanges()}handleDidChangeContent(e){var t,n,o;if(e.isFlush)this.resetTokenization(!1);else if(!e.isEolChange){for(const r of e.changes){const[s,a]=kv(r.text);this._tokens.acceptEdit(r.range,s,a),(t=this._debugBackgroundTokens)===null||t===void 0||t.acceptEdit(r.range,s,a)}(n=this._debugBackgroundStates)===null||n===void 0||n.acceptChanges(e.changes),this._tokenizer&&this._tokenizer.store.acceptChanges(e.changes),(o=this._defaultBackgroundTokenizer)===null||o===void 0||o.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=ln.joinMany([...this._attachedViewStates].map(([t,n])=>n.lineRanges));this.refreshRanges(e)}refreshRanges(e){for(const t of e)this.refreshRange(t.startLineNumber,t.endLineNumberExclusive-1)}refreshRange(e,t){var n,o;if(!this._tokenizer)return;e=Math.max(1,Math.min(this._textModel.getLineCount(),e)),t=Math.min(this._textModel.getLineCount(),t);const r=new IH,{heuristicTokens:s}=this._tokenizer.tokenizeHeuristically(r,e,t),a=this.setTokens(r.finalize());if(s)for(const l of a.changes)(n=this._backgroundTokenizer.value)===null||n===void 0||n.requestTokens(l.fromLineNumber,l.toLineNumber+1);(o=this._defaultBackgroundTokenizer)===null||o===void 0||o.checkFinished()}forceTokenization(e){var t,n;const o=new IH;(t=this._tokenizer)===null||t===void 0||t.updateTokensUntilLine(o,e),this.setTokens(o.finalize()),(n=this._defaultBackgroundTokenizer)===null||n===void 0||n.checkFinished()}isCheapToTokenize(e){return this._tokenizer?this._tokenizer.isCheapToTokenize(e):!0}tokenizeIfCheap(e){this.isCheapToTokenize(e)&&this.forceTokenization(e)}getLineTokens(e){var t;const n=this._textModel.getLineContent(e),o=this._tokens.getTokens(this._textModel.getLanguageId(),e-1,n);if(this._debugBackgroundTokens&&this._debugBackgroundStates&&this._tokenizer&&this._debugBackgroundStates.getFirstInvalidEndStateLineNumberOrMax()>e&&this._tokenizer.store.getFirstInvalidEndStateLineNumberOrMax()>e){const r=this._debugBackgroundTokens.getTokens(this._textModel.getLanguageId(),e-1,n);!o.equals(r)&&((t=this._debugBackgroundTokenizer.value)===null||t===void 0?void 0:t.reportMismatchingTokens)&&this._debugBackgroundTokenizer.value.reportMismatchingTokens(e)}return o}getTokenTypeIfInsertingCharacter(e,t,n){if(!this._tokenizer)return 0;const o=this._textModel.validatePosition(new ae(e,t));return this.forceTokenization(o.lineNumber),this._tokenizer.getTokenTypeIfInsertingCharacter(o,n)}tokenizeLineWithEdit(e,t,n){if(!this._tokenizer)return null;const o=this._textModel.validatePosition(e);return this.forceTokenization(o.lineNumber),this._tokenizer.tokenizeLineWithEdit(o,t,n)}get hasTokens(){return this._tokens.hasTokens}}class yat extends _e{get lineRanges(){return this._lineRanges}constructor(e){super(),this._refreshTokens=e,this.runner=this._register(new bi(()=>this.update(),50)),this._computedLineRanges=[],this._lineRanges=[]}update(){Lo(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()}}class wat{constructor(){this.changeType=1}}class Gd{static applyInjectedText(e,t){if(!t||t.length===0)return e;let n="",o=0;for(const r of t)n+=e.substring(o,r.column-1),o=r.column-1,n+=r.options.content;return n+=e.substring(o),n}static fromDecorations(e){const t=[];for(const n of e)n.options.before&&n.options.before.content.length>0&&t.push(new Gd(n.ownerId,n.range.startLineNumber,n.range.startColumn,n.options.before,0)),n.options.after&&n.options.after.content.length>0&&t.push(new Gd(n.ownerId,n.range.endLineNumber,n.range.endColumn,n.options.after,1));return t.sort((n,o)=>n.lineNumber===o.lineNumber?n.column===o.column?n.order-o.order:n.column-o.column:n.lineNumber-o.lineNumber),t}constructor(e,t,n,o,r){this.ownerId=e,this.lineNumber=t,this.column=n,this.options=o,this.order=r}}class vse{constructor(e,t,n){this.changeType=2,this.lineNumber=e,this.detail=t,this.injectedText=n}}class Sat{constructor(e,t){this.changeType=3,this.fromLineNumber=e,this.toLineNumber=t}}class xat{constructor(e,t,n,o){this.changeType=4,this.injectedTexts=o,this.fromLineNumber=e,this.toLineNumber=t,this.detail=n}}class Lat{constructor(){this.changeType=5}}class Ty{constructor(e,t,n,o){this.changes=e,this.versionId=t,this.isUndoing=n,this.isRedoing=o,this.resultingSelection=null}containsEvent(e){for(let t=0,n=this.changes.length;t=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},v9=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},M_;function Dat(i){const e=new i1e;return e.acceptChunk(i),e.finish()}function kat(i){const e=new i1e;let t;for(;typeof(t=i.read())=="string";)e.acceptChunk(t);return e.finish()}function _se(i,e){let t;return typeof i=="string"?t=Dat(i):pet(i)?t=kat(i):t=i,t.create(e)}let w2=0;const Iat=999,Tat=1e4;class Nat{constructor(e){this._source=e,this._eos=!1}read(){if(this._eos)return null;const e=[];let t=0,n=0;do{const o=this._source.read();if(o===null)return this._eos=!0,t===0?null:e.join("");if(o.length>0&&(e[t++]=o,n+=o.length),n>=64*1024)return e.join("")}while(!0)}}const $x=()=>{throw new Error("Invalid change accessor")};let bf=M_=class extends _e{static resolveOptions(e,t){if(t.detectIndentation){const n=lse(e,t.tabSize,t.insertSpaces);return new oM({tabSize:n.tabSize,indentSize:"tabSize",insertSpaces:n.insertSpaces,trimAutoWhitespace:t.trimAutoWhitespace,defaultEOL:t.defaultEOL,bracketPairColorizationOptions:t.bracketPairColorizationOptions})}return new oM(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 Tu(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,n,o=null,r,s,a){super(),this._undoRedoService=r,this._languageService=s,this._languageConfigurationService=a,this._onWillDispose=this._register(new le),this.onWillDispose=this._onWillDispose.event,this._onDidChangeDecorations=this._register(new Oat(f=>this.handleBeforeFireDecorationsChangedEvent(f))),this.onDidChangeDecorations=this._onDidChangeDecorations.event,this._onDidChangeOptions=this._register(new le),this.onDidChangeOptions=this._onDidChangeOptions.event,this._onDidChangeAttached=this._register(new le),this.onDidChangeAttached=this._onDidChangeAttached.event,this._onDidChangeInjectedText=this._register(new le),this._eventEmitter=this._register(new Fat),this._languageSelectionListener=this._register(new Kr),this._deltaDecorationCallCnt=0,this._attachedViews=new Bat,w2++,this.id="$model"+w2,this.isForSimpleWidget=n.isForSimpleWidget,typeof o=="undefined"||o===null?this._associatedResource=Rt.parse("inmemory://model/"+w2):this._associatedResource=o,this._attachedEditorCount=0;const{textBuffer:l,disposable:c}=_se(e,n.defaultEOL);this._buffer=l,this._bufferDisposable=c,this._options=M_.resolveOptions(this._buffer,n);const u=typeof t=="string"?t:t.languageId;typeof t!="string"&&(this._languageSelectionListener.value=t.onDidChange(()=>this._setLanguage(t.languageId))),this._bracketPairs=this._register(new Mst(this,this._languageConfigurationService)),this._guidesTextModelPart=this._register(new Drt(this,this._languageConfigurationService)),this._decorationProvider=this._register(new Pst(this)),this._tokenizationTextModelPart=new _P(this._languageService,this._languageConfigurationService,this,this._bracketPairs,u,this._attachedViews);const d=this._buffer.getLineCount(),h=this._buffer.getValueLengthInRange(new V(1,1,d,this._buffer.getLineLength(d)+1),0);n.largeFileOptimizations?(this._isTooLargeForTokenization=h>M_.LARGE_FILE_SIZE_THRESHOLD||d>M_.LARGE_FILE_LINE_COUNT_THRESHOLD,this._isTooLargeForHeapOperation=h>M_.LARGE_FILE_HEAP_OPERATION_THRESHOLD):(this._isTooLargeForTokenization=!1,this._isTooLargeForHeapOperation=!1),this._isTooLargeForSyncing=h>M_._MODEL_SYNC_LIMIT,this._versionId=1,this._alternativeVersionId=1,this._initialUndoRedoSnapshot=null,this._isDisposed=!1,this.__isDisposing=!1,this._instanceId=K_e(w2),this._lastDecorationId=0,this._decorations=Object.create(null),this._decorationsTree=new bse,this._commandManager=new HG(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(u)}dispose(){this.__isDisposing=!0,this._onWillDispose.fire(),this._tokenizationTextModelPart.dispose(),this._isDisposed=!0,super.dispose(),this._bufferDisposable.dispose(),this.__isDisposing=!1;const e=new Iy([],"",` +`,!1,!1,!0,!0);e.dispose(),this._buffer=e,this._bufferDisposable=_e.None}_assertNotDisposed(){if(this._isDisposed)throw new Error("Model is disposed!")}_emitContentChangedEvent(e,t){this.__isDisposing||(this._tokenizationTextModelPart.handleDidChangeContent(t),this._bracketPairs.handleDidChangeContent(t),this._eventEmitter.fire(new N0(e,t)))}setValue(e){if(this._assertNotDisposed(),e==null)throw Mc();const{textBuffer:t,disposable:n}=_se(e,this._options.defaultEOL);this._setValueFromTextBuffer(t,n)}_createContentChanged2(e,t,n,o,r,s,a,l){return{changes:[{range:e,rangeOffset:t,rangeLength:n,text:o}],eol:this._buffer.getEOL(),isEolChange:l,versionId:this.getVersionId(),isUndoing:r,isRedoing:s,isFlush:a}}_setValueFromTextBuffer(e,t){this._assertNotDisposed();const n=this.getFullModelRange(),o=this.getValueLengthInRange(n),r=this.getLineCount(),s=this.getLineMaxColumn(r);this._buffer=e,this._bufferDisposable.dispose(),this._bufferDisposable=t,this._increaseVersionId(),this._decorations=Object.create(null),this._decorationsTree=new bse,this._commandManager.clear(),this._trimAutoWhitespaceLines=null,this._emitContentChangedEvent(new Ty([new wat],this._versionId,!1,!1),this._createContentChanged2(new V(1,1,r,s),0,o,this.getValue(),!1,!1,!0,!1))}setEOL(e){this._assertNotDisposed();const t=e===1?`\r `:` -`;if(this._buffer.getEOL()===t)return;const n=this.getFullModelRange(),o=this.getValueLengthInRange(n),r=this.getLineCount(),s=this.getLineMaxColumn(r);this._onBeforeEOLChange(),this._buffer.setEOL(t),this._increaseVersionId(),this._onAfterEOLChange(),this._emitContentChangedEvent(new Tw([new bat],this._versionId,!1,!1),this._createContentChanged2(new V(1,1,r,s),0,o,this.getValue(),!1,!1,!1,!0))}_onBeforeEOLChange(){this._decorationsTree.ensureAllNodesHaveRanges(this)}_onAfterEOLChange(){const e=this.getVersionId(),t=this._decorationsTree.collectNodesPostOrder();for(let n=0,o=t.length;n0}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 n=this._buffer.getLineCount();for(let o=1;o<=n;o++){const r=this._buffer.getLineLength(o);r>=xat?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!="undefined"?e.tabSize:this._options.tabSize,n=typeof e.indentSize!="undefined"?e.indentSize:this._options.originalIndentSize,o=typeof e.insertSpaces!="undefined"?e.insertSpaces:this._options.insertSpaces,r=typeof e.trimAutoWhitespace!="undefined"?e.trimAutoWhitespace:this._options.trimAutoWhitespace,s=typeof e.bracketColorizationOptions!="undefined"?e.bracketColorizationOptions:this._options.bracketPairColorizationOptions,a=new tM({tabSize:t,indentSize:n,insertSpaces:o,defaultEOL:this._options.defaultEOL,trimAutoWhitespace:r,bracketPairColorizationOptions:s});if(this._options.equals(a))return;const l=this._options.createChangeEvent(a);this._options=a,this._bracketPairs.handleDidChangeOptions(l),this._decorationProvider.handleDidChangeOptions(l),this._onDidChangeOptions.fire(l)}detectIndentation(e,t){this._assertNotDisposed();const n=ese(this._buffer,t,e);this.updateOptions({insertSpaces:n.insertSpaces,tabSize:n.tabSize,indentSize:n.tabSize})}normalizeIndentation(e){return this._assertNotDisposed(),aP(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(O_e.source,!1,!0,!1,null,!1,1073741824);this._buffer.resetMightContainUnusualLineTerminators(),this.pushEditOperations(e,t.map(n=>({range:n.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,0);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 Vo("Operation would exceed heap memory limits");const n=this.getFullModelRange(),o=this.getValueInRange(n,e);return t?this._buffer.getBOM()+o:o}createSnapshot(e=!1){return new Lat(this._buffer.createSnapshot(e))}getValueLength(e,t=!1){this._assertNotDisposed();const n=this.getFullModelRange(),o=this.getValueLengthInRange(n,e);return t?this._buffer.getBOM().length+o:o}getValueInRange(e,t=0){return this._assertNotDisposed(),this._buffer.getValueInRange(this.validateRange(e),t)}getValueLengthInRange(e,t=0){return this._assertNotDisposed(),this._buffer.getValueLengthInRange(this.validateRange(e),t)}getCharacterCountInRange(e,t=0){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 Vo("Illegal value for lineNumber");return this._buffer.getLineContent(e)}getLineLength(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Vo("Illegal value for lineNumber");return this._buffer.getLineLength(e)}getLinesContent(){if(this._assertNotDisposed(),this.isTooLargeForHeapOperation())throw new Vo("Operation would exceed heap memory limits");return this._buffer.getLinesContent()}getEOL(){return this._assertNotDisposed(),this._buffer.getEOL()}getEndOfLineSequence(){return this._assertNotDisposed(),this._buffer.getEOL()===` -`?0:1}getLineMinColumn(e){return this._assertNotDisposed(),1}getLineMaxColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Vo("Illegal value for lineNumber");return this._buffer.getLineLength(e)+1}getLineFirstNonWhitespaceColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Vo("Illegal value for lineNumber");return this._buffer.getLineFirstNonWhitespaceColumn(e)}getLineLastNonWhitespaceColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Vo("Illegal value for lineNumber");return this._buffer.getLineLastNonWhitespaceColumn(e)}_validateRangeRelaxedNoAllocations(e){const t=this._buffer.getLineCount(),n=e.startLineNumber,o=e.startColumn;let r=Math.floor(typeof n=="number"&&!isNaN(n)?n:1),s=Math.floor(typeof o=="number"&&!isNaN(o)?o:1);if(r<1)r=1,s=1;else if(r>t)r=t,s=this.getLineMaxColumn(r);else if(s<=1)s=1;else{const d=this.getLineMaxColumn(r);s>=d&&(s=d)}const a=e.endLineNumber,l=e.endColumn;let c=Math.floor(typeof a=="number"&&!isNaN(a)?a:1),u=Math.floor(typeof l=="number"&&!isNaN(l)?l:1);if(c<1)c=1,u=1;else if(c>t)c=t,u=this.getLineMaxColumn(c);else if(u<=1)u=1;else{const d=this.getLineMaxColumn(c);u>=d&&(u=d)}return n===r&&o===s&&a===c&&l===u&&e instanceof V&&!(e instanceof gt)?e:new V(r,s,c,u)}_isValidPosition(e,t,n){if(typeof e!="number"||typeof t!="number"||isNaN(e)||isNaN(t)||e<1||t<1||(e|0)!==e||(t|0)!==t)return!1;const o=this._buffer.getLineCount();if(e>o)return!1;if(t===1)return!0;const r=this.getLineMaxColumn(e);if(t>r)return!1;if(n===1){const s=this._buffer.getLineCharCode(e,t-2);if(fr(s))return!1}return!0}_validatePosition(e,t,n){const o=Math.floor(typeof e=="number"&&!isNaN(e)?e:1),r=Math.floor(typeof t=="number"&&!isNaN(t)?t:1),s=this._buffer.getLineCount();if(o<1)return new ae(1,1);if(o>s)return new ae(s,this.getLineMaxColumn(s));if(r<=1)return new ae(o,1);const a=this.getLineMaxColumn(o);if(r>=a)return new ae(o,a);if(n===1){const l=this._buffer.getLineCharCode(o,r-2);if(fr(l))return new ae(o,r-1)}return new ae(o,r)}validatePosition(e){return this._assertNotDisposed(),e instanceof ae&&this._isValidPosition(e.lineNumber,e.column,1)?e:this._validatePosition(e.lineNumber,e.column,1)}_isValidRange(e,t){const n=e.startLineNumber,o=e.startColumn,r=e.endLineNumber,s=e.endColumn;if(!this._isValidPosition(n,o,0)||!this._isValidPosition(r,s,0))return!1;if(t===1){const a=o>1?this._buffer.getLineCharCode(n,o-2):0,l=s>1&&s<=this._buffer.getLineLength(r)?this._buffer.getLineCharCode(r,s-2):0,c=fr(a),u=fr(l);return!c&&!u}return!0}validateRange(e){if(this._assertNotDisposed(),e instanceof V&&!(e instanceof gt)&&this._isValidRange(e,1))return e;const n=this._validatePosition(e.startLineNumber,e.startColumn,0),o=this._validatePosition(e.endLineNumber,e.endColumn,0),r=n.lineNumber,s=n.column,a=o.lineNumber,l=o.column;{const c=s>1?this._buffer.getLineCharCode(r,s-2):0,u=l>1&&l<=this._buffer.getLineLength(a)?this._buffer.getLineCharCode(a,l-2):0,d=fr(c),h=fr(u);return!d&&!h?new V(r,s,a,l):r===a&&s===l?new V(r,s-1,a,l-1):d&&h?new V(r,s-1,a,l+1):d?new V(r,s-1,a,l):new V(r,s,a,l+1)}}modifyPosition(e,t){this._assertNotDisposed();const n=this.getOffsetAt(e)+t;return this.getPositionAt(Math.min(this._buffer.getLength(),Math.max(0,n)))}getFullModelRange(){this._assertNotDisposed();const e=this.getLineCount();return new V(1,1,e,this.getLineMaxColumn(e))}findMatchesLineByLine(e,t,n,o){return this._buffer.findMatchesLineByLine(e,t,n,o)}findMatches(e,t,n,o,r,s,a=Sat){this._assertNotDisposed();let l=null;t!==null&&(Array.isArray(t)||(t=[t]),t.every(d=>V.isIRange(d))&&(l=t.map(d=>this.validateRange(d)))),l===null&&(l=[this.getFullModelRange()]),l=l.sort((d,h)=>d.startLineNumber-h.startLineNumber||d.startColumn-h.startColumn);const c=[];c.push(l.reduce((d,h)=>V.areIntersecting(d,h)?d.plusRange(h):(c.push(d),h)));let u;if(!n&&e.indexOf(` -`)<0){const h=new N_(e,n,o,r).parseSearchRequest();if(!h)return[];u=f=>this.findMatchesLineByLine(f,h,s,a)}else u=d=>o2.findMatches(this,new N_(e,n,o,r),d,s,a);return c.map(u).reduce((d,h)=>d.concat(h),[])}findNextMatch(e,t,n,o,r,s){this._assertNotDisposed();const a=this.validatePosition(t);if(!n&&e.indexOf(` -`)<0){const c=new N_(e,n,o,r).parseSearchRequest();if(!c)return null;const u=this.getLineCount();let d=new V(a.lineNumber,a.column,u,this.getLineMaxColumn(u)),h=this.findMatchesLineByLine(d,c,s,1);return o2.findNextMatch(this,new N_(e,n,o,r),a,s),h.length>0||(d=new V(1,1,a.lineNumber,this.getLineMaxColumn(a.lineNumber)),h=this.findMatchesLineByLine(d,c,s,1),h.length>0)?h[0]:null}return o2.findNextMatch(this,new N_(e,n,o,r),a,s)}findPreviousMatch(e,t,n,o,r,s){this._assertNotDisposed();const a=this.validatePosition(t);return o2.findPreviousMatch(this,new N_(e,n,o,r),a,s)}pushStackElement(){this._commandManager.pushStackElement()}popStackElement(){this._commandManager.popStackElement()}pushEOL(e){if((this.getEOL()===` +`;if(this._buffer.getEOL()===t)return;const n=this.getFullModelRange(),o=this.getValueLengthInRange(n),r=this.getLineCount(),s=this.getLineMaxColumn(r);this._onBeforeEOLChange(),this._buffer.setEOL(t),this._increaseVersionId(),this._onAfterEOLChange(),this._emitContentChangedEvent(new Ty([new Lat],this._versionId,!1,!1),this._createContentChanged2(new V(1,1,r,s),0,o,this.getValue(),!1,!1,!1,!0))}_onBeforeEOLChange(){this._decorationsTree.ensureAllNodesHaveRanges(this)}_onAfterEOLChange(){const e=this.getVersionId(),t=this._decorationsTree.collectNodesPostOrder();for(let n=0,o=t.length;n0}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 n=this._buffer.getLineCount();for(let o=1;o<=n;o++){const r=this._buffer.getLineLength(o);r>=Tat?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!="undefined"?e.tabSize:this._options.tabSize,n=typeof e.indentSize!="undefined"?e.indentSize:this._options.originalIndentSize,o=typeof e.insertSpaces!="undefined"?e.insertSpaces:this._options.insertSpaces,r=typeof e.trimAutoWhitespace!="undefined"?e.trimAutoWhitespace:this._options.trimAutoWhitespace,s=typeof e.bracketColorizationOptions!="undefined"?e.bracketColorizationOptions:this._options.bracketPairColorizationOptions,a=new oM({tabSize:t,indentSize:n,insertSpaces:o,defaultEOL:this._options.defaultEOL,trimAutoWhitespace:r,bracketPairColorizationOptions:s});if(this._options.equals(a))return;const l=this._options.createChangeEvent(a);this._options=a,this._bracketPairs.handleDidChangeOptions(l),this._decorationProvider.handleDidChangeOptions(l),this._onDidChangeOptions.fire(l)}detectIndentation(e,t){this._assertNotDisposed();const n=lse(this._buffer,t,e);this.updateOptions({insertSpaces:n.insertSpaces,tabSize:n.tabSize,indentSize:n.tabSize})}normalizeIndentation(e){return this._assertNotDisposed(),uP(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(U_e.source,!1,!0,!1,null,!1,1073741824);this._buffer.resetMightContainUnusualLineTerminators(),this.pushEditOperations(e,t.map(n=>({range:n.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,0);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 Vo("Operation would exceed heap memory limits");const n=this.getFullModelRange(),o=this.getValueInRange(n,e);return t?this._buffer.getBOM()+o:o}createSnapshot(e=!1){return new Nat(this._buffer.createSnapshot(e))}getValueLength(e,t=!1){this._assertNotDisposed();const n=this.getFullModelRange(),o=this.getValueLengthInRange(n,e);return t?this._buffer.getBOM().length+o:o}getValueInRange(e,t=0){return this._assertNotDisposed(),this._buffer.getValueInRange(this.validateRange(e),t)}getValueLengthInRange(e,t=0){return this._assertNotDisposed(),this._buffer.getValueLengthInRange(this.validateRange(e),t)}getCharacterCountInRange(e,t=0){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 Vo("Illegal value for lineNumber");return this._buffer.getLineContent(e)}getLineLength(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Vo("Illegal value for lineNumber");return this._buffer.getLineLength(e)}getLinesContent(){if(this._assertNotDisposed(),this.isTooLargeForHeapOperation())throw new Vo("Operation would exceed heap memory limits");return this._buffer.getLinesContent()}getEOL(){return this._assertNotDisposed(),this._buffer.getEOL()}getEndOfLineSequence(){return this._assertNotDisposed(),this._buffer.getEOL()===` +`?0:1}getLineMinColumn(e){return this._assertNotDisposed(),1}getLineMaxColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Vo("Illegal value for lineNumber");return this._buffer.getLineLength(e)+1}getLineFirstNonWhitespaceColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Vo("Illegal value for lineNumber");return this._buffer.getLineFirstNonWhitespaceColumn(e)}getLineLastNonWhitespaceColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Vo("Illegal value for lineNumber");return this._buffer.getLineLastNonWhitespaceColumn(e)}_validateRangeRelaxedNoAllocations(e){const t=this._buffer.getLineCount(),n=e.startLineNumber,o=e.startColumn;let r=Math.floor(typeof n=="number"&&!isNaN(n)?n:1),s=Math.floor(typeof o=="number"&&!isNaN(o)?o:1);if(r<1)r=1,s=1;else if(r>t)r=t,s=this.getLineMaxColumn(r);else if(s<=1)s=1;else{const d=this.getLineMaxColumn(r);s>=d&&(s=d)}const a=e.endLineNumber,l=e.endColumn;let c=Math.floor(typeof a=="number"&&!isNaN(a)?a:1),u=Math.floor(typeof l=="number"&&!isNaN(l)?l:1);if(c<1)c=1,u=1;else if(c>t)c=t,u=this.getLineMaxColumn(c);else if(u<=1)u=1;else{const d=this.getLineMaxColumn(c);u>=d&&(u=d)}return n===r&&o===s&&a===c&&l===u&&e instanceof V&&!(e instanceof gt)?e:new V(r,s,c,u)}_isValidPosition(e,t,n){if(typeof e!="number"||typeof t!="number"||isNaN(e)||isNaN(t)||e<1||t<1||(e|0)!==e||(t|0)!==t)return!1;const o=this._buffer.getLineCount();if(e>o)return!1;if(t===1)return!0;const r=this.getLineMaxColumn(e);if(t>r)return!1;if(n===1){const s=this._buffer.getLineCharCode(e,t-2);if(gr(s))return!1}return!0}_validatePosition(e,t,n){const o=Math.floor(typeof e=="number"&&!isNaN(e)?e:1),r=Math.floor(typeof t=="number"&&!isNaN(t)?t:1),s=this._buffer.getLineCount();if(o<1)return new ae(1,1);if(o>s)return new ae(s,this.getLineMaxColumn(s));if(r<=1)return new ae(o,1);const a=this.getLineMaxColumn(o);if(r>=a)return new ae(o,a);if(n===1){const l=this._buffer.getLineCharCode(o,r-2);if(gr(l))return new ae(o,r-1)}return new ae(o,r)}validatePosition(e){return this._assertNotDisposed(),e instanceof ae&&this._isValidPosition(e.lineNumber,e.column,1)?e:this._validatePosition(e.lineNumber,e.column,1)}_isValidRange(e,t){const n=e.startLineNumber,o=e.startColumn,r=e.endLineNumber,s=e.endColumn;if(!this._isValidPosition(n,o,0)||!this._isValidPosition(r,s,0))return!1;if(t===1){const a=o>1?this._buffer.getLineCharCode(n,o-2):0,l=s>1&&s<=this._buffer.getLineLength(r)?this._buffer.getLineCharCode(r,s-2):0,c=gr(a),u=gr(l);return!c&&!u}return!0}validateRange(e){if(this._assertNotDisposed(),e instanceof V&&!(e instanceof gt)&&this._isValidRange(e,1))return e;const n=this._validatePosition(e.startLineNumber,e.startColumn,0),o=this._validatePosition(e.endLineNumber,e.endColumn,0),r=n.lineNumber,s=n.column,a=o.lineNumber,l=o.column;{const c=s>1?this._buffer.getLineCharCode(r,s-2):0,u=l>1&&l<=this._buffer.getLineLength(a)?this._buffer.getLineCharCode(a,l-2):0,d=gr(c),h=gr(u);return!d&&!h?new V(r,s,a,l):r===a&&s===l?new V(r,s-1,a,l-1):d&&h?new V(r,s-1,a,l+1):d?new V(r,s-1,a,l):new V(r,s,a,l+1)}}modifyPosition(e,t){this._assertNotDisposed();const n=this.getOffsetAt(e)+t;return this.getPositionAt(Math.min(this._buffer.getLength(),Math.max(0,n)))}getFullModelRange(){this._assertNotDisposed();const e=this.getLineCount();return new V(1,1,e,this.getLineMaxColumn(e))}findMatchesLineByLine(e,t,n,o){return this._buffer.findMatchesLineByLine(e,t,n,o)}findMatches(e,t,n,o,r,s,a=Iat){this._assertNotDisposed();let l=null;t!==null&&(Array.isArray(t)||(t=[t]),t.every(d=>V.isIRange(d))&&(l=t.map(d=>this.validateRange(d)))),l===null&&(l=[this.getFullModelRange()]),l=l.sort((d,h)=>d.startLineNumber-h.startLineNumber||d.startColumn-h.startColumn);const c=[];c.push(l.reduce((d,h)=>V.areIntersecting(d,h)?d.plusRange(h):(c.push(d),h)));let u;if(!n&&e.indexOf(` +`)<0){const h=new R_(e,n,o,r).parseSearchRequest();if(!h)return[];u=f=>this.findMatchesLineByLine(f,h,s,a)}else u=d=>a2.findMatches(this,new R_(e,n,o,r),d,s,a);return c.map(u).reduce((d,h)=>d.concat(h),[])}findNextMatch(e,t,n,o,r,s){this._assertNotDisposed();const a=this.validatePosition(t);if(!n&&e.indexOf(` +`)<0){const c=new R_(e,n,o,r).parseSearchRequest();if(!c)return null;const u=this.getLineCount();let d=new V(a.lineNumber,a.column,u,this.getLineMaxColumn(u)),h=this.findMatchesLineByLine(d,c,s,1);return a2.findNextMatch(this,new R_(e,n,o,r),a,s),h.length>0||(d=new V(1,1,a.lineNumber,this.getLineMaxColumn(a.lineNumber)),h=this.findMatchesLineByLine(d,c,s,1),h.length>0)?h[0]:null}return a2.findNextMatch(this,new R_(e,n,o,r),a,s)}findPreviousMatch(e,t,n,o,r,s){this._assertNotDisposed();const a=this.validatePosition(t);return a2.findPreviousMatch(this,new R_(e,n,o,r),a,s)}pushStackElement(){this._commandManager.pushStackElement()}popStackElement(){this._commandManager.popStackElement()}pushEOL(e){if((this.getEOL()===` `?0:1)!==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 Z6?e:new Z6(e.identifier||null,this.validateRange(e.range),e.text,e.forceMoveMarkers||!1,e.isAutoWhitespaceEdit||!1,e._isTracked||!1)}_validateEditOperations(e){const t=[];for(let n=0,o=e.length;n({range:this.validateRange(a.range),text:a.text}));let s=!0;if(e)for(let a=0,l=e.length;ac.endLineNumber,p=c.startLineNumber>f.endLineNumber;if(!g&&!p){u=!0;break}}if(!u){s=!1;break}}if(s)for(let a=0,l=this._trimAutoWhitespaceLines.length;ag.endLineNumber)&&!(c===g.startLineNumber&&g.startColumn===u&&g.isEmpty()&&p&&p.length>0&&p.charAt(0)===` `)&&!(c===g.startLineNumber&&g.startColumn===1&&g.isEmpty()&&p&&p.length>0&&p.charAt(p.length-1)===` -`)){d=!1;break}}if(d){const h=new V(c,1,c,u);t.push(new Z6(null,h,null,!1,!1,!1))}}this._trimAutoWhitespaceLines=null}return this._initialUndoRedoSnapshot===null&&(this._initialUndoRedoSnapshot=this._undoRedoService.createSnapshot(this.uri)),this._commandManager.pushEditOperation(e,t,n,o)}_applyUndo(e,t,n,o){const r=e.map(s=>{const a=this.getPositionAt(s.newPosition),l=this.getPositionAt(s.newEnd);return{range:new V(a.lineNumber,a.column,l.lineNumber,l.column),text:s.oldText}});this._applyUndoRedoEdits(r,t,!0,!1,n,o)}_applyRedo(e,t,n,o){const r=e.map(s=>{const a=this.getPositionAt(s.oldPosition),l=this.getPositionAt(s.oldEnd);return{range:new V(a.lineNumber,a.column,l.lineNumber,l.column),text:s.newText}});this._applyUndoRedoEdits(r,t,!1,!0,n,o)}_applyUndoRedoEdits(e,t,n,o,r,s){try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit(),this._isUndoing=n,this._isRedoing=o,this.applyEdits(e,!1),this.setEOL(t),this._overwriteAlternativeVersionId(r)}finally{this._isUndoing=!1,this._isRedoing=!1,this._eventEmitter.endDeferredEmit(s),this._onDidChangeDecorations.endDeferredEmit()}}applyEdits(e,t=!1){try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit();const n=this._validateEditOperations(e);return this._doApplyEdits(n,t)}finally{this._eventEmitter.endDeferredEmit(),this._onDidChangeDecorations.endDeferredEmit()}}_doApplyEdits(e,t){const n=this._buffer.getLineCount(),o=this._buffer.applyEdits(e,this._options.trimAutoWhitespace,t),r=this._buffer.getLineCount(),s=o.changes;if(this._trimAutoWhitespaceLines=o.trimAutoWhitespaceLineNumbers,s.length!==0){for(let c=0,u=s.length;c=0;k--){const R=f+k,A=w+k;I.takeFromEndWhile(N=>N.lineNumber>A);const P=I.takeFromEndWhile(N=>N.lineNumber===A);a.push(new cse(R,this.getLineContent(A),P))}if(mF.lineNumberF.lineNumber===W)}a.push(new _at(R+1,f+v,M,N))}l+=_}this._emitContentChangedEvent(new Tw(a,this.getVersionId(),this._isUndoing,this._isRedoing),{changes:s,eol:this._buffer.getEOL(),isEolChange:!1,versionId:this.getVersionId(),isUndoing:this._isUndoing,isRedoing:this._isRedoing,isFlush:!1})}return o.reverseEdits===null?void 0:o.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 n=Array.from(e).map(o=>new cse(o,this.getLineContent(o),this._getInjectedTextInLine(o)));this._onDidChangeInjectedText.fire(new Ybe(n))}changeDecorations(e,t=0){this._assertNotDisposed();try{return this._onDidChangeDecorations.beginDeferredEmit(),this._changeDecorations(t,e)}finally{this._onDidChangeDecorations.endDeferredEmit()}}_changeDecorations(e,t){const n={addDecoration:(r,s)=>this._deltaDecorationsImpl(e,[],[{range:r,options:s}])[0],changeDecoration:(r,s)=>{this._changeDecorationImpl(r,s)},changeDecorationOptions:(r,s)=>{this._changeDecorationOptionsImpl(r,fse(s))},removeDecoration:r=>{this._deltaDecorationsImpl(e,[r],[])},deltaDecorations:(r,s)=>r.length===0&&s.length===0?[]:this._deltaDecorationsImpl(e,r,s)};let o=null;try{o=t(n)}catch(r){en(r)}return n.addDecoration=Hx,n.changeDecoration=Hx,n.changeDecorationOptions=Hx,n.removeDecoration=Hx,n.deltaDecorations=Hx,o}deltaDecorations(e,t,n=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."),en(new Error("Invoking deltaDecorations recursively could lead to leaking decorations."))),this._onDidChangeDecorations.beginDeferredEmit(),this._deltaDecorationsImpl(n,e,t)}finally{this._onDidChangeDecorations.endDeferredEmit(),this._deltaDecorationCallCnt--}}_getTrackedRange(e){return this.getDecorationRange(e)}_setTrackedRange(e,t,n){const o=e?this._decorations[e]:null;if(!o)return t?this._deltaDecorationsImpl(0,[],[{range:t,options:hse[n]}],!0)[0]:null;if(!t)return this._decorationsTree.delete(o),delete this._decorations[o.id],null;const r=this._validateRangeRelaxedNoAllocations(t),s=this._buffer.getOffsetAt(r.startLineNumber,r.startColumn),a=this._buffer.getOffsetAt(r.endLineNumber,r.endColumn);return this._decorationsTree.delete(o),o.reset(this.getVersionId(),s,a,r),o.setOptions(hse[n]),this._decorationsTree.insert(o),o.id}removeAllDecorationsWithOwnerId(e){if(this._isDisposed)return;const t=this._decorationsTree.collectNodesFromOwner(e);for(let n=0,o=t.length;nthis.getLineCount()?[]:this.getLinesDecorations(e,e,t,n)}getLinesDecorations(e,t,n=0,o=!1,r=!1){const s=this.getLineCount(),a=Math.min(s,Math.max(1,e)),l=Math.min(s,Math.max(1,t)),c=this.getLineMaxColumn(l),u=new V(a,1,l,c),d=this._getDecorationsInRange(u,n,o,r);return HW(d,this._decorationProvider.getDecorationsInRange(u,n,o)),d}getDecorationsInRange(e,t=0,n=!1,o=!1,r=!1){const s=this.validateRange(e),a=this._getDecorationsInRange(s,t,n,r);return HW(a,this._decorationProvider.getDecorationsInRange(s,t,n,o)),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),n=t+this._buffer.getLineLength(e),o=this._decorationsTree.getInjectedTextInInterval(this,t,n,0);return qd.fromDecorations(o).filter(r=>r.lineNumber===e)}getAllDecorations(e=0,t=!1){let n=this._decorationsTree.getAll(this,e,t,!1,!1);return n=n.concat(this._decorationProvider.getAllDecorations(e,t)),n}getAllMarginDecorations(e=0){return this._decorationsTree.getAll(this,e,!1,!1,!0)}_getDecorationsInRange(e,t,n,o){const r=this._buffer.getOffsetAt(e.startLineNumber,e.startColumn),s=this._buffer.getOffsetAt(e.endLineNumber,e.endColumn);return this._decorationsTree.getAllInInterval(this,r,s,t,n,o)}getRangeAt(e,t){return this._buffer.getRangeAt(e,t-e)}_changeDecorationImpl(e,t){const n=this._decorations[e];if(!n)return;if(n.options.after){const a=this.getDecorationRange(e);this._onDidChangeDecorations.recordLineAffectedByInjectedText(a.endLineNumber)}if(n.options.before){const a=this.getDecorationRange(e);this._onDidChangeDecorations.recordLineAffectedByInjectedText(a.startLineNumber)}const o=this._validateRangeRelaxedNoAllocations(t),r=this._buffer.getOffsetAt(o.startLineNumber,o.startColumn),s=this._buffer.getOffsetAt(o.endLineNumber,o.endColumn);this._decorationsTree.delete(n),n.reset(this.getVersionId(),r,s,o),this._decorationsTree.insert(n),this._onDidChangeDecorations.checkAffectedAndFire(n.options),n.options.after&&this._onDidChangeDecorations.recordLineAffectedByInjectedText(o.endLineNumber),n.options.before&&this._onDidChangeDecorations.recordLineAffectedByInjectedText(o.startLineNumber)}_changeDecorationOptionsImpl(e,t){const n=this._decorations[e];if(!n)return;const o=!!(n.options.overviewRuler&&n.options.overviewRuler.color),r=!!(t.overviewRuler&&t.overviewRuler.color);if(this._onDidChangeDecorations.checkAffectedAndFire(n.options),this._onDidChangeDecorations.checkAffectedAndFire(t),n.options.after||t.after){const s=this._decorationsTree.getNodeRange(this,n);this._onDidChangeDecorations.recordLineAffectedByInjectedText(s.endLineNumber)}if(n.options.before||t.before){const s=this._decorationsTree.getNodeRange(this,n);this._onDidChangeDecorations.recordLineAffectedByInjectedText(s.startLineNumber)}o!==r?(this._decorationsTree.delete(n),n.setOptions(t),this._decorationsTree.insert(n)):n.setOptions(t)}_deltaDecorationsImpl(e,t,n,o=!1){const r=this.getVersionId(),s=t.length;let a=0;const l=n.length;let c=0;this._onDidChangeDecorations.beginDeferredEmit();try{const u=new Array(l);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 Eat(this.getLineContent(e))+1}};_f._MODEL_SYNC_LIMIT=50*1024*1024;_f.LARGE_FILE_SIZE_THRESHOLD=20*1024*1024;_f.LARGE_FILE_LINE_COUNT_THRESHOLD=300*1e3;_f.LARGE_FILE_HEAP_OPERATION_THRESHOLD=256*1024*1024;_f.DEFAULT_CREATION_OPTIONS={isForSimpleWidget:!1,tabSize:ms.tabSize,indentSize:ms.indentSize,insertSpaces:ms.insertSpaces,detectIndentation:!1,defaultEOL:1,trimAutoWhitespace:ms.trimAutoWhitespace,largeFileOptimizations:ms.largeFileOptimizations,bracketPairColorizationOptions:ms.bracketPairColorizationOptions};_f=R_=Cat([v9(4,S5),v9(5,Ki),v9(6,Ti)],_f);function Eat(i){let e=0;for(const t of i)if(t===" "||t===" ")e++;else break;return e}function _9(i){return!!(i.options.overviewRuler&&i.options.overviewRuler.color)}function b9(i){return!!i.options.after||!!i.options.before}class dse{constructor(){this._decorationsTree0=new g9,this._decorationsTree1=new g9,this._injectedTextDecorationsTree=new g9}ensureAllNodesHaveRanges(e){this.getAll(e,0,!1,!1,!1)}_ensureNodesHaveRanges(e,t){for(const n of t)n.range===null&&(n.range=e.getRangeAt(n.cachedAbsoluteStart,n.cachedAbsoluteEnd));return t}getAllInInterval(e,t,n,o,r,s){const a=e.getVersionId(),l=this._intervalSearch(t,n,o,r,a,s);return this._ensureNodesHaveRanges(e,l)}_intervalSearch(e,t,n,o,r,s){const a=this._decorationsTree0.intervalSearch(e,t,n,o,r,s),l=this._decorationsTree1.intervalSearch(e,t,n,o,r,s),c=this._injectedTextDecorationsTree.intervalSearch(e,t,n,o,r,s);return a.concat(l).concat(c)}getInjectedTextInInterval(e,t,n,o){const r=e.getVersionId(),s=this._injectedTextDecorationsTree.intervalSearch(t,n,o,!1,r,!1);return this._ensureNodesHaveRanges(e,s).filter(a=>a.options.showIfCollapsed||!a.range.isEmpty())}getAllInjectedText(e,t){const n=e.getVersionId(),o=this._injectedTextDecorationsTree.search(t,!1,n,!1);return this._ensureNodesHaveRanges(e,o).filter(r=>r.options.showIfCollapsed||!r.range.isEmpty())}getAll(e,t,n,o,r){const s=e.getVersionId(),a=this._search(t,n,o,s,r);return this._ensureNodesHaveRanges(e,a)}_search(e,t,n,o,r){if(n)return this._decorationsTree1.search(e,t,o,r);{const s=this._decorationsTree0.search(e,t,o,r),a=this._decorationsTree1.search(e,t,o,r),l=this._injectedTextDecorationsTree.search(e,t,o,r);return s.concat(a).concat(l)}}collectNodesFromOwner(e){const t=this._decorationsTree0.collectNodesFromOwner(e),n=this._decorationsTree1.collectNodesFromOwner(e),o=this._injectedTextDecorationsTree.collectNodesFromOwner(e);return t.concat(n).concat(o)}collectNodesPostOrder(){const e=this._decorationsTree0.collectNodesPostOrder(),t=this._decorationsTree1.collectNodesPostOrder(),n=this._injectedTextDecorationsTree.collectNodesPostOrder();return e.concat(t).concat(n)}insert(e){b9(e)?this._injectedTextDecorationsTree.insert(e):_9(e)?this._decorationsTree1.insert(e):this._decorationsTree0.insert(e)}delete(e){b9(e)?this._injectedTextDecorationsTree.delete(e):_9(e)?this._decorationsTree1.delete(e):this._decorationsTree0.delete(e)}getNodeRange(e,t){const n=e.getVersionId();return t.cachedVersionId!==n&&this._resolveNode(t,n),t.range===null&&(t.range=e.getRangeAt(t.cachedAbsoluteStart,t.cachedAbsoluteEnd)),t.range}_resolveNode(e,t){b9(e)?this._injectedTextDecorationsTree.resolveNode(e,t):_9(e)?this._decorationsTree1.resolveNode(e,t):this._decorationsTree0.resolveNode(e,t)}acceptReplace(e,t,n,o){this._decorationsTree0.acceptReplace(e,t,n,o),this._decorationsTree1.acceptReplace(e,t,n,o),this._injectedTextDecorationsTree.acceptReplace(e,t,n,o)}}function Yf(i){return i.replace(/[^a-z0-9\-_]/gi," ")}class Qbe{constructor(e){this.color=e.color||"",this.darkColor=e.darkColor||""}}class Dat extends Qbe{constructor(e){super(e),this._resolvedColor=null,this.position=typeof e.position=="number"?e.position:Xl.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 n=e?t.getColor(e.id):null;return n?n.toString():""}}class kat{constructor(e){var t;this.position=(t=e==null?void 0:e.position)!==null&&t!==void 0?t:Cw.Left}}class Iat extends Qbe{constructor(e){super(e),this.position=e.position}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"?ve.fromHex(e):t.getColor(e.id)}}class Tv{static from(e){return e instanceof Tv?e:new Tv(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 Jt{static register(e){return new Jt(e)}static createDynamic(e){return new Jt(e)}constructor(e){var t,n,o,r,s,a;this.description=e.description,this.blockClassName=e.blockClassName?Yf(e.blockClassName):null,this.blockDoesNotCollapse=(t=e.blockDoesNotCollapse)!==null&&t!==void 0?t:null,this.blockIsAfterEnd=(n=e.blockIsAfterEnd)!==null&&n!==void 0?n:null,this.blockPadding=(o=e.blockPadding)!==null&&o!==void 0?o:null,this.stickiness=e.stickiness||0,this.zIndex=e.zIndex||0,this.className=e.className?Yf(e.className):null,this.shouldFillLineOnLineBreak=(r=e.shouldFillLineOnLineBreak)!==null&&r!==void 0?r:null,this.hoverMessage=e.hoverMessage||null,this.glyphMarginHoverMessage=e.glyphMarginHoverMessage||null,this.isWholeLine=e.isWholeLine||!1,this.showIfCollapsed=e.showIfCollapsed||!1,this.collapseOnReplaceEdit=e.collapseOnReplaceEdit||!1,this.overviewRuler=e.overviewRuler?new Dat(e.overviewRuler):null,this.minimap=e.minimap?new Iat(e.minimap):null,this.glyphMargin=e.glyphMarginClassName?new kat(e.glyphMargin):null,this.glyphMarginClassName=e.glyphMarginClassName?Yf(e.glyphMarginClassName):null,this.linesDecorationsClassName=e.linesDecorationsClassName?Yf(e.linesDecorationsClassName):null,this.firstLineDecorationClassName=e.firstLineDecorationClassName?Yf(e.firstLineDecorationClassName):null,this.marginClassName=e.marginClassName?Yf(e.marginClassName):null,this.inlineClassName=e.inlineClassName?Yf(e.inlineClassName):null,this.inlineClassNameAffectsLetterSpacing=e.inlineClassNameAffectsLetterSpacing||!1,this.beforeContentClassName=e.beforeContentClassName?Yf(e.beforeContentClassName):null,this.afterContentClassName=e.afterContentClassName?Yf(e.afterContentClassName):null,this.after=e.after?Tv.from(e.after):null,this.before=e.before?Tv.from(e.before):null,this.hideInCommentTokens=(s=e.hideInCommentTokens)!==null&&s!==void 0?s:!1,this.hideInStringTokens=(a=e.hideInStringTokens)!==null&&a!==void 0?a:!1}}Jt.EMPTY=Jt.register({description:"empty"});const hse=[Jt.register({description:"tracked-range-always-grows-when-typing-at-edges",stickiness:0}),Jt.register({description:"tracked-range-never-grows-when-typing-at-edges",stickiness:1}),Jt.register({description:"tracked-range-grows-only-when-typing-before",stickiness:2}),Jt.register({description:"tracked-range-grows-only-when-typing-after",stickiness:3})];function fse(i){return i instanceof Jt?i:Jt.createDynamic(i)}class Tat extends _e{constructor(e){super(),this.handleBeforeFire=e,this._actual=this._register(new le),this.event=this._actual.event,this._affectedInjectedTextLines=null,this._deferredCnt=0,this._shouldFireDeferred=!1,this._affectsMinimap=!1,this._affectsOverviewRuler=!1,this._affectsGlyphMargin=!1}beginDeferredEmit(){this._deferredCnt++}endDeferredEmit(){var e;this._deferredCnt--,this._deferredCnt===0&&(this._shouldFireDeferred&&this.doFire(),(e=this._affectedInjectedTextLines)===null||e===void 0||e.clear(),this._affectedInjectedTextLines=null)}recordLineAffectedByInjectedText(e){this._affectedInjectedTextLines||(this._affectedInjectedTextLines=new Set),this._affectedInjectedTextLines.add(e)}checkAffectedAndFire(e){this._affectsMinimap||(this._affectsMinimap=!!(e.minimap&&e.minimap.position)),this._affectsOverviewRuler||(this._affectsOverviewRuler=!!(e.overviewRuler&&e.overviewRuler.color)),this._affectsGlyphMargin||(this._affectsGlyphMargin=!!e.glyphMarginClassName),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};this._shouldFireDeferred=!1,this._affectsMinimap=!1,this._affectsOverviewRuler=!1,this._affectsGlyphMargin=!1,this._actual.fire(e)}}class Nat extends _e{constructor(){super(),this._fastEmitter=this._register(new le),this.fastEvent=this._fastEmitter.event,this._slowEmitter=this._register(new le),this.slowEvent=this._slowEmitter.event,this._deferredCnt=0,this._deferredEvent=null}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 Rat{constructor(){this._onDidChangeVisibleRanges=new le,this.onDidChangeVisibleRanges=this._onDidChangeVisibleRanges.event,this._views=new Set}attachView(){const e=new Mat(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 Mat{constructor(e){this.handleStateChange=e}setVisibleLines(e,t){const n=e.map(o=>new ln(o.startLineNumber,o.endLineNumber+1));this.handleStateChange({visibleLineRanges:n,stabilized:t})}}class mP{constructor(e){this._selTrackedRange=null,this._trackSelection=!0,this._setState(e,new Br(new V(1,1,1,1),0,0,new ae(1,1),0),new Br(new V(1,1,1,1),0,0,new ae(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,0))}_removeTrackedRange(e){this._selTrackedRange=e.model._setTrackedRange(this._selTrackedRange,null,0)}asCursorState(){return new kn(this.modelState,this.viewState)}readSelectionFromMarkers(e){const t=e.model._getTrackedRange(this._selTrackedRange);return this.modelState.selection.isEmpty()&&!t.isEmpty()?gt.fromRange(t.collapseToEnd(),this.modelState.selection.getDirection()):gt.fromRange(t,this.modelState.selection.getDirection())}ensureValidState(e){this._setState(e,this.modelState,this.viewState)}setState(e,t,n){this._setState(e,t,n)}static _validatePositionWithCache(e,t,n,o){return t.equals(n)?o:e.normalizePosition(t,2)}static _validateViewState(e,t){const n=t.position,o=t.selectionStart.getStartPosition(),r=t.selectionStart.getEndPosition(),s=e.normalizePosition(n,2),a=this._validatePositionWithCache(e,o,n,s),l=this._validatePositionWithCache(e,r,o,a);return n.equals(s)&&o.equals(a)&&r.equals(l)?t:new Br(V.fromPositions(a,l),t.selectionStartKind,t.selectionStartLeftoverVisibleColumns+o.column-a.column,s,t.leftoverVisibleColumns+n.column-s.column)}_setState(e,t,n){if(n&&(n=mP._validateViewState(e.viewModel,n)),t){const o=e.model.validateRange(t.selectionStart),r=t.selectionStart.equalsRange(o)?t.selectionStartLeftoverVisibleColumns:0,s=e.model.validatePosition(t.position),a=t.position.equals(s)?t.leftoverVisibleColumns:0;t=new Br(o,t.selectionStartKind,r,s,a)}else{if(!n)return;const o=e.model.validateRange(e.coordinatesConverter.convertViewRangeToModelRange(n.selectionStart)),r=e.model.validatePosition(e.coordinatesConverter.convertViewPositionToModelPosition(n.position));t=new Br(o,n.selectionStartKind,n.selectionStartLeftoverVisibleColumns,r,n.leftoverVisibleColumns)}if(n){const o=e.coordinatesConverter.validateViewRange(n.selectionStart,t.selectionStart),r=e.coordinatesConverter.validateViewPosition(n.position,t.position);n=new Br(o,t.selectionStartKind,t.selectionStartLeftoverVisibleColumns,r,t.leftoverVisibleColumns)}else{const o=e.coordinatesConverter.convertModelPositionToViewPosition(new ae(t.selectionStart.startLineNumber,t.selectionStart.startColumn)),r=e.coordinatesConverter.convertModelPositionToViewPosition(new ae(t.selectionStart.endLineNumber,t.selectionStart.endColumn)),s=new V(o.lineNumber,o.column,r.lineNumber,r.column),a=e.coordinatesConverter.convertModelPositionToViewPosition(t.position);n=new Br(s,t.selectionStartKind,t.selectionStartLeftoverVisibleColumns,a,t.leftoverVisibleColumns)}this.modelState=t,this.viewState=n,this._updateTrackedRange(e)}}class gse{constructor(e){this.context=e,this.cursors=[new mP(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 wet(this.cursors,Nc(e=>e.viewState.position,ae.compare)).viewState.position}getBottomMostViewPosition(){return Cet(this.cursors,Nc(e=>e.viewState.position,ae.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(kn.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,n=e.length;if(tn){const o=t-n;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 n=0,o=e.length;nn.selection,V.compareRangesUsingStarts));for(let n=0;nd&&p.index--;e.splice(d,1),t.splice(u,1),this._removeSecondaryCursor(d-1),n--}}}}class pse{constructor(e,t,n,o){this._cursorContextBrand=void 0,this.model=e,this.viewModel=t,this.coordinatesConverter=n,this.cursorConfig=o}}class Aat{constructor(){this.type=0}}class Pat{constructor(){this.type=1}}class Oat{constructor(e){this.type=2,this._source=e}hasChanged(e){return this._source.hasChanged(e)}}class Fat{constructor(e,t,n){this.selections=e,this.modelSelections=t,this.reason=n,this.type=3}}class K1{constructor(e){this.type=4,e?(this.affectsMinimap=e.affectsMinimap,this.affectsOverviewRuler=e.affectsOverviewRuler,this.affectsGlyphMargin=e.affectsGlyphMargin):(this.affectsMinimap=!0,this.affectsOverviewRuler=!0,this.affectsGlyphMargin=!0)}}class C2{constructor(){this.type=5}}class Bat{constructor(e){this.type=6,this.isFocused=e}}class Wat{constructor(){this.type=7}}class w2{constructor(){this.type=8}}class Jbe{constructor(e,t){this.fromLineNumber=e,this.count=t,this.type=9}}class DH{constructor(e,t){this.type=10,this.fromLineNumber=e,this.toLineNumber=t}}class kH{constructor(e,t){this.type=11,this.fromLineNumber=e,this.toLineNumber=t}}class uM{constructor(e,t,n,o,r,s,a){this.source=e,this.minimalReveal=t,this.range=n,this.selections=o,this.verticalType=r,this.revealHorizontal=s,this.scrollType=a,this.type=12}}class Vat{constructor(e){this.type=13,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 Hat{constructor(e){this.theme=e,this.type=14}}class $at{constructor(e){this.type=15,this.ranges=e}}class zat{constructor(){this.type=16}}class Uat{constructor(){this.type=17}}class jat extends _e{constructor(){super(),this._onEvent=this._register(new le),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,n=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,n=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 n of t)n.handleEvents(e)}}}class Kat{constructor(){this.viewEvents=[],this.outgoingEvents=[]}emitViewEvent(e){this.viewEvents.push(e)}emitOutgoingEvent(e){this.outgoingEvents.push(e)}}class WG{constructor(e,t,n,o){this.kind=0,this._oldContentWidth=e,this._oldContentHeight=t,this.contentWidth=n,this.contentHeight=o,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 WG(this._oldContentWidth,this._oldContentHeight,e.contentWidth,e.contentHeight)}}class VG{constructor(e,t){this.kind=1,this.oldHasFocus=e,this.hasFocus=t}isNoOp(){return this.oldHasFocus===this.hasFocus}attemptToMerge(e){return e.kind!==this.kind?null:new VG(this.oldHasFocus,e.hasFocus)}}class HG{constructor(e,t,n,o,r,s,a,l){this.kind=2,this._oldScrollWidth=e,this._oldScrollLeft=t,this._oldScrollHeight=n,this._oldScrollTop=o,this.scrollWidth=r,this.scrollLeft=s,this.scrollHeight=a,this.scrollTop=l,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 HG(this._oldScrollWidth,this._oldScrollLeft,this._oldScrollHeight,this._oldScrollTop,e.scrollWidth,e.scrollLeft,e.scrollHeight,e.scrollTop)}}class qat{constructor(){this.kind=3}isNoOp(){return!1}attemptToMerge(e){return e.kind!==this.kind?null:this}}class Gat{constructor(){this.kind=4}isNoOp(){return!1}attemptToMerge(e){return e.kind!==this.kind?null:this}}class vP{constructor(e,t,n,o,r,s,a){this.kind=6,this.oldSelections=e,this.selections=t,this.oldModelVersionId=n,this.modelVersionId=o,this.source=r,this.reason=s,this.reachedMaxCursorCount=a}static _selectionsAreEqual(e,t){if(!e&&!t)return!0;if(!e||!t)return!1;const n=e.length,o=t.length;if(n!==o)return!1;for(let r=0;r0){const e=this._cursors.getSelections();for(let t=0;ts&&(o=o.slice(0,s),r=!0);const a=CE.from(this._model,this);return this._cursors.setStates(o),this._cursors.normalize(),this._columnSelectData=null,this._validateAutoClosedActions(),this._emitStateChangedIfNecessary(e,t,n,a,r)}setCursorColumnSelectData(e){this._columnSelectData=e}revealPrimary(e,t,n,o,r,s){const a=this._cursors.getViewPositions();let l=null,c=null;a.length>1?c=this._cursors.getViewSelections():l=V.fromPositions(a[0],a[0]),e.emitViewEvent(new uM(t,n,l,c,o,r,s))}saveState(){const e=[],t=this._cursors.getSelections();for(let n=0,o=t.length;n0){const r=kn.fromModelSelections(n.resultingSelection);this.setStates(e,"modelChange",n.isUndoing?5:n.isRedoing?6:2,r)&&this.revealPrimary(e,"modelChange",!1,0,!0,0)}else{const r=this._cursors.readSelectionFromMarkers();this.setStates(e,"modelChange",2,kn.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(),n=e.viewState.position;return{isReal:!1,fromViewLineNumber:t.lineNumber,fromViewVisualColumn:this.context.cursorConfig.visibleColumnFromColumn(this._viewModel,t),toViewLineNumber:n.lineNumber,toViewVisualColumn:this.context.cursorConfig.visibleColumnFromColumn(this._viewModel,n)}}getSelections(){return this._cursors.getSelections()}setSelections(e,t,n,o){this.setStates(e,t,o,kn.fromModelSelections(n))}getPrevEditOperationType(){return this._prevEditOperationType}setPrevEditOperationType(e){this._prevEditOperationType=e}_pushAutoClosedAction(e,t){const n=[],o=[];for(let a=0,l=e.length;a0&&this._pushAutoClosedAction(n,o),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,n,o,r){const s=CE.from(this._model,this);if(s.equals(o))return!1;const a=this._cursors.getSelections(),l=this._cursors.getViewSelections();if(e.emitViewEvent(new Fat(l,a,n)),!o||o.cursorState.length!==s.cursorState.length||s.cursorState.some((c,u)=>!c.modelState.equals(o.cursorState[u].modelState))){const c=o?o.cursorState.map(d=>d.modelState.selection):null,u=o?o.modelVersionId:0;e.emitOutgoingEvent(new vP(c,a,u,s.modelVersionId,t||"keyboard",n,r))}return!0}_findAutoClosingPairs(e){if(!e.length)return null;const t=[];for(let n=0,o=e.length;n=0)return null;const s=r.text.match(/([)\]}>'"`])([^)\]}>'"`]*)$/);if(!s)return null;const a=s[1],l=this.context.cursorConfig.autoClosingPairs.autoClosingPairsCloseSingleChar.get(a);if(!l||l.length!==1)return null;const c=l[0].open,u=r.text.length-s[2].length-1,d=r.text.lastIndexOf(c,u-1);if(d===-1)return null;t.push([d,u])}return t}executeEdits(e,t,n,o){let r=null;t==="snippet"&&(r=this._findAutoClosingPairs(n)),r&&(n[0]._isTracked=!0);const s=[],a=[],l=this._model.pushEditOperations(this.getSelections(),n,c=>{if(r)for(let d=0,h=r.length;d0&&this._pushAutoClosedAction(s,a)}_executeEdit(e,t,n,o=0){if(this.context.cursorConfig.readOnly)return;const r=CE.from(this._model,this);this._cursors.stopTrackingSelections(),this._isHandling=!0;try{this._cursors.ensureValidState(),e()}catch(s){en(s)}this._isHandling=!1,this._cursors.startTrackingSelections(),this._validateAutoClosedActions(),this._emitStateChangedIfNecessary(t,n,o,r,!1)&&this.revealPrimary(t,n,!1,0,!0,0)}getAutoClosedCharacters(){return mse.getAllAutoClosedCharacters(this._autoClosedActions)}startComposition(e){this._compositionState=new wE(this._model,this.getSelections())}endComposition(e,t){const n=this._compositionState?this._compositionState.deduceOutcome(this._model,this.getSelections()):null;this._compositionState=null,this._executeEdit(()=>{t==="keyboard"&&this._executeEditOperation(eo.compositionEndWithInterceptors(this._prevEditOperationType,this.context.cursorConfig,this._model,n,this.getSelections(),this.getAutoClosedCharacters()))},e,t)}type(e,t,n){this._executeEdit(()=>{if(n==="keyboard"){const o=t.length;let r=0;for(;r{const c=l.getPosition();return new gt(c.lineNumber,c.column+r,c.lineNumber,c.column+r)});this.setSelections(e,s,a,0)}return}this._executeEdit(()=>{this._executeEditOperation(eo.compositionType(this._prevEditOperationType,this.context.cursorConfig,this._model,this.getSelections(),t,n,o,r))},e,s)}paste(e,t,n,o,r){this._executeEdit(()=>{this._executeEditOperation(eo.paste(this.context.cursorConfig,this._model,this.getSelections(),t,n,o||[]))},e,r,4)}cut(e,t){this._executeEdit(()=>{this._executeEditOperation(tb.cut(this.context.cursorConfig,this._model,this.getSelections()))},e,t)}executeCommand(e,t,n){this._executeEdit(()=>{this._cursors.killSecondaryCursors(),this._executeEditOperation(new ya(0,[t],{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!1}))},e,n)}executeCommands(e,t,n){this._executeEdit(()=>{this._executeEditOperation(new ya(0,t,{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!1}))},e,n)}}class CE{static from(e,t){return new CE(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,n=this.cursorState.length;t=t.length||!t[n].strictContainsRange(e[n]))return!1;return!0}}class ilt{static executeCommands(e,t,n){const o={model:e,selectionsBefore:t,trackedRanges:[],trackedRangesDirection:[]},r=this._innerExecuteCommands(o,n);for(let s=0,a=o.trackedRanges.length;s0&&(s[0]._isTracked=!0);let a=e.model.pushEditOperations(e.selectionsBefore,s,c=>{const u=[];for(let f=0;ff.identifier.minor-g.identifier.minor,h=[];for(let f=0;f0?(u[f].sort(d),h[f]=t[f].computeCursorState(e.model,{getInverseEditOperations:()=>u[f],getTrackedSelection:g=>{const p=parseInt(g,10),v=e.model._getTrackedRange(e.trackedRanges[p]);return e.trackedRangesDirection[p]===0?new gt(v.startLineNumber,v.startColumn,v.endLineNumber,v.endColumn):new gt(v.endLineNumber,v.endColumn,v.startLineNumber,v.startColumn)}})):h[f]=e.selectionsBefore[f];return h});a||(a=e.selectionsBefore);const l=[];for(const c in r)r.hasOwnProperty(c)&&l.push(parseInt(c,10));l.sort((c,u)=>u-c);for(const c of l)a.splice(c,1);return a}static _arrayIsEmpty(e){for(let t=0,n=e.length;t{V.isEmpty(d)&&h===""||o.push({identifier:{major:t,minor:r++},range:d,text:h,forceMoveMarkers:f,isAutoWhitespaceEdit:n.insertsAutoWhitespace})};let a=!1;const u={addEditOperation:s,addTrackedEditOperation:(d,h,f)=>{a=!0,s(d,h,f)},trackSelection:(d,h)=>{const f=gt.liftSelection(d);let g;if(f.isEmpty())if(typeof h=="boolean")h?g=2:g=3;else{const m=e.model.getLineMaxColumn(f.startLineNumber);f.startColumn===m?g=2:g=3}else g=1;const p=e.trackedRanges.length,v=e.model._setTrackedRange(null,f,g);return e.trackedRanges[p]=v,e.trackedRangesDirection[p]=f.getDirection(),p.toString()}};try{n.getEditOperations(e.model,u)}catch(d){return en(d),{operations:[],hadTrackedEditOperation:!1}}return{operations:o,hadTrackedEditOperation:a}}static _getLoserCursorMap(e){e=e.slice(0),e.sort((n,o)=>-V.compareRangesUsingEnds(n.range,o.range));const t={};for(let n=1;nr.identifier.major?s=o.identifier.major:s=r.identifier.major,t[s.toString()]=!0;for(let a=0;a0&&n--}}return t}}class olt{constructor(e,t,n){this.text=e,this.startSelection=t,this.endSelection=n}}class wE{static _capture(e,t){const n=[];for(const o of t){if(o.startLineNumber!==o.endLineNumber)return null;n.push(new olt(e.getLineContent(o.startLineNumber),o.startColumn-1,o.endColumn-1))}return n}constructor(e,t){this._original=wE._capture(e,t)}deduceOutcome(e,t){if(!this._original)return null;const n=wE._capture(e,t);if(!n||this._original.length!==n.length)return null;const o=[];for(let r=0,s=this._original.length;rby,tokenizeEncoded:(i,e,t)=>u5(0,t)};function slt(i,e,t){return rlt(this,void 0,void 0,function*(){if(!t)return _se(e,i.languageIdCodec,vse);const n=yield oo.getOrCreate(t);return _se(e,i.languageIdCodec,n||vse)})}function alt(i,e,t,n,o,r,s){let a="
",l=n,c=0,u=!0;for(let d=0,h=e.getCount();d0;)s&&u?(g+=" ",u=!1):(g+=" ",u=!0),v--;break}case 60:g+="<",u=!1;break;case 62:g+=">",u=!1;break;case 38:g+="&",u=!1;break;case 0:g+="�",u=!1;break;case 65279:case 8232:case 8233:case 133:g+="\uFFFD",u=!1;break;case 13:g+="​",u=!1;break;case 32:s&&u?(g+=" ",u=!1):(g+=" ",u=!0);break;default:g+=String.fromCharCode(p),u=!1}}if(a+=`${g}`,f>o||l>=o)break}return a+="
",a}function _se(i,e,t){let n='
';const o=ff(i);let r=t.getInitialState();for(let s=0,a=o.length;s0&&(n+="
");const c=t.tokenizeEncoded(l,!0,r);gr.convertToEndOffset(c.tokens,l.length);const d=new gr(c.tokens,l,e).inflate();let h=0;for(let f=0,g=d.getCount();f${WA(l.substring(h,v))}`,h=v}r=c.endState}return n+="
",n}class llt{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,n=this._changes,o=this._removes;this._hasPending=!1,this._inserts=[],this._changes=[],this._removes=[],e._commitPendingChanges(t,n,o)}}class clt{constructor(e,t,n,o,r){this.id=e,this.afterLineNumber=t,this.ordinal=n,this.height=o,this.minWidth=r,this.prefixSum=0}}class ck{constructor(e,t,n,o){this._instanceId=B_e(++ck.INSTANCE_COUNT),this._pendingChanges=new llt,this._lastWhitespaceId=0,this._arr=[],this._prefixSumValidIndex=-1,this._minWidth=-1,this._lineCount=e,this._lineHeight=t,this._paddingTop=n,this._paddingBottom=o}static findInsertionIndex(e,t,n){let o=0,r=e.length;for(;o>>1;t===e[s].afterLineNumber?n{t=!0,o=o|0,r=r|0,s=s|0,a=a|0;const l=this._instanceId+ ++this._lastWhitespaceId;return this._pendingChanges.insert(new clt(l,o,r,s,a)),l},changeOneWhitespace:(o,r,s)=>{t=!0,r=r|0,s=s|0,this._pendingChanges.change({id:o,newAfterLineNumber:r,newHeight:s})},removeWhitespace:o=>{t=!0,this._pendingChanges.remove({id:o})}})}finally{this._pendingChanges.commit(this)}return t}_commitPendingChanges(e,t,n){if((e.length>0||n.length>0)&&(this._minWidth=-1),e.length+t.length+n.length<=1){for(const l of e)this._insertWhitespace(l);for(const l of t)this._changeOneWhitespace(l.id,l.newAfterLineNumber,l.newHeight);for(const l of n){const c=this._findWhitespaceIndex(l.id);c!==-1&&this._removeWhitespace(c)}return}const o=new Set;for(const l of n)o.add(l.id);const r=new Map;for(const l of t)r.set(l.id,l);const s=l=>{const c=[];for(const u of l)if(!o.has(u.id)){if(r.has(u.id)){const d=r.get(u.id);u.afterLineNumber=d.newAfterLineNumber,u.height=d.newHeight}c.push(u)}return c},a=s(this._arr).concat(s(e));a.sort((l,c)=>l.afterLineNumber===c.afterLineNumber?l.ordinal-c.ordinal:l.afterLineNumber-c.afterLineNumber),this._arr=a,this._prefixSumValidIndex=-1}_checkPendingChanges(){this._pendingChanges.mustCommit()&&this._pendingChanges.commit(this)}_insertWhitespace(e){const t=ck.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 n=0,o=t.length;nt&&(this._arr[n].afterLineNumber-=t-e+1)}}onLinesInserted(e,t){this._checkPendingChanges(),e=e|0,t=t|0,this._lineCount+=t-e+1;for(let n=0,o=this._arr.length;n=t.length||t[a+1].afterLineNumber>=e)return a;n=a+1|0}else o=a-1|0}return-1}_findFirstWhitespaceAfterLineNumber(e){e=e|0;const n=this._findLastWhitespaceBeforeLineNumber(e)+1;return n1?n=this._lineHeight*(e-1):n=0;const o=this.getWhitespaceAccumulatedHeightBeforeLineNumber(e-(t?1:0));return n+o+this._paddingTop}getVerticalOffsetAfterLineNumber(e,t=!1){this._checkPendingChanges(),e=e|0;const n=this._lineHeight*e,o=this.getWhitespaceAccumulatedHeightBeforeLineNumber(e+(t?1:0));return n+o+this._paddingTop}getWhitespaceMinWidth(){if(this._checkPendingChanges(),this._minWidth===-1){let e=0;for(let t=0,n=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,n=this._lineHeight;let o=1,r=t;for(;o=a+n)o=s+1;else{if(e>=a)return s;r=s}}return o>t?t:o}getLinesViewportData(e,t){this._checkPendingChanges(),e=e|0,t=t|0;const n=this._lineHeight,o=this.getLineNumberAtOrAfterVerticalOffset(e)|0,r=this.getVerticalOffsetForLineNumber(o)|0;let s=this._lineCount|0,a=this.getFirstWhitespaceIndexAfterLineNumber(o)|0;const l=this.getWhitespacesCount()|0;let c,u;a===-1?(a=l,u=s+1,c=0):(u=this.getAfterLineNumberForWhitespaceIndex(a)|0,c=this.getHeightForWhitespaceIndex(a)|0);let d=r,h=d;const f=5e5;let g=0;r>=f&&(g=Math.floor(r/f)*f,g=Math.floor(g/n)*n,h-=g);const p=[],v=e+(t-e)/2;let m=-1;for(let L=o;L<=s;L++){if(m===-1){const D=d,E=d+n;(D<=v&&vv)&&(m=L)}for(d+=n,p[L-o]=h,h+=n;u===L;)h+=c,d+=c,a++,a>=l?u=s+1:(u=this.getAfterLineNumberForWhitespaceIndex(a)|0,c=this.getHeightForWhitespaceIndex(a)|0);if(d>=t){s=L;break}}m===-1&&(m=s);const _=this.getVerticalOffsetForLineNumber(s)|0;let w=o,y=s;return wt&&y--,{bigNumbersDelta:g,startLineNumber:o,endLineNumber:s,relativeVerticalOffset:p,centeredLineNumber:m,completelyVisibleStartLineNumber:w,completelyVisibleEndLineNumber:y}}getVerticalOffsetForWhitespaceIndex(e){this._checkPendingChanges(),e=e|0;const t=this.getAfterLineNumberForWhitespaceIndex(e);let n;t>=1?n=this._lineHeight*t:n=0;let o;return e>0?o=this.getWhitespacesAccumulatedHeight(e-1):o=0,n+o+this._paddingTop}getWhitespaceIndexAtOrAfterVerticallOffset(e){this._checkPendingChanges(),e=e|0;let t=0,n=this.getWhitespacesCount()-1;if(n<0)return-1;const o=this.getVerticalOffsetForWhitespaceIndex(n),r=this.getHeightForWhitespaceIndex(n);if(e>=o+r)return-1;for(;t=a+l)t=s+1;else{if(e>=a)return s;n=s}}return t}getWhitespaceAtVerticalOffset(e){this._checkPendingChanges(),e=e|0;const t=this.getWhitespaceIndexAtOrAfterVerticallOffset(e);if(t<0||t>=this.getWhitespacesCount())return null;const n=this.getVerticalOffsetForWhitespaceIndex(t);if(n>e)return null;const o=this.getHeightForWhitespaceIndex(t),r=this.getIdForWhitespaceIndex(t),s=this.getAfterLineNumberForWhitespaceIndex(t);return{id:r,afterLineNumber:s,verticalOffset:n,height:o}}getWhitespaceViewportData(e,t){this._checkPendingChanges(),e=e|0,t=t|0;const n=this.getWhitespaceIndexAtOrAfterVerticallOffset(e),o=this.getWhitespacesCount()-1;if(n<0)return[];const r=[];for(let s=n;s<=o;s++){const a=this.getVerticalOffsetForWhitespaceIndex(s),l=this.getHeightForWhitespaceIndex(s);if(a>=t)break;r.push({id:this.getIdForWhitespaceIndex(s),afterLineNumber:this.getAfterLineNumberForWhitespaceIndex(s),verticalOffset:a,height:l})}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}}ck.INSTANCE_COUNT=0;const ult=125;class DL{constructor(e,t,n,o){e=e|0,t=t|0,n=n|0,o=o|0,e<0&&(e=0),t<0&&(t=0),n<0&&(n=0),o<0&&(o=0),this.width=e,this.contentWidth=t,this.scrollWidth=Math.max(e,t),this.height=n,this.contentHeight=o,this.scrollHeight=Math.max(n,o)}equals(e){return this.width===e.width&&this.contentWidth===e.contentWidth&&this.height===e.height&&this.contentHeight===e.contentHeight}}class dlt extends _e{constructor(e,t){super(),this._onDidContentSizeChange=this._register(new le),this.onDidContentSizeChange=this._onDidContentSizeChange.event,this._dimensions=new DL(0,0,0,0),this._scrollable=this._register(new qI({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 n=t.contentWidth!==e.contentWidth,o=t.contentHeight!==e.contentHeight;(n||o)&&this._onDidContentSizeChange.fire(new WG(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 hlt extends _e{constructor(e,t,n){super(),this._configuration=e;const o=this._configuration.options,r=o.get(143),s=o.get(83);this._linesLayout=new ck(t,o.get(66),s.top,s.bottom),this._maxLineWidth=0,this._overlayWidgetsMinWidth=0,this._scrollable=this._register(new dlt(0,n)),this._configureSmoothScrollDuration(),this._scrollable.setScrollDimensions(new DL(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(113)?ult:0)}onConfigurationChanged(e){const t=this._configuration.options;if(e.hasChanged(66)&&this._linesLayout.setLineHeight(t.get(66)),e.hasChanged(83)){const n=t.get(83);this._linesLayout.setPadding(n.top,n.bottom)}if(e.hasChanged(143)){const n=t.get(143),o=n.contentWidth,r=n.height,s=this._scrollable.getScrollDimensions(),a=s.contentWidth;this._scrollable.setScrollDimensions(new DL(o,s.contentWidth,r,this._getContentHeight(o,r,a)))}else this._updateHeight();e.hasChanged(113)&&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 o=this._configuration.options.get(102);return o.horizontal===2||e>=t?0:o.horizontalScrollbarSize}_getContentHeight(e,t,n){const o=this._configuration.options;let r=this._linesLayout.getLinesTotalHeight();return o.get(104)?r+=Math.max(0,t-o.get(66)-o.get(83).bottom):r+=this._getHorizontalScrollbarHeight(e,n),r}_updateHeight(){const e=this._scrollable.getScrollDimensions(),t=e.width,n=e.height,o=e.contentWidth;this._scrollable.setScrollDimensions(new DL(t,e.contentWidth,n,this._getContentHeight(t,n,o)))}getCurrentViewport(){const e=this._scrollable.getScrollDimensions(),t=this._scrollable.getCurrentScrollPosition();return new dre(t.scrollTop,t.scrollLeft,e.width,e.height)}getFutureViewport(){const e=this._scrollable.getScrollDimensions(),t=this._scrollable.getFutureScrollPosition();return new dre(t.scrollTop,t.scrollLeft,e.width,e.height)}_computeContentWidth(){const e=this._configuration.options,t=this._maxLineWidth,n=e.get(144),o=e.get(50),r=e.get(143);if(n.isViewportWrapping){const s=e.get(72);return t>r.contentWidth+o.typicalHalfwidthCharacterWidth&&s.enabled&&s.side==="right"?t+r.verticalScrollbarWidth:t}else{const s=e.get(103)*o.typicalHalfwidthCharacterWidth,a=this._linesLayout.getWhitespaceMinWidth();return Math.max(t+s+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 DL(e.width,this._computeContentWidth(),e.height,e.contentHeight)),this._updateHeight()}saveState(){const e=this._scrollable.getFutureScrollPosition(),t=e.scrollTop,n=this._linesLayout.getLineNumberAtOrAfterVerticalOffset(t),o=this._linesLayout.getWhitespaceAccumulatedHeightBeforeLineNumber(n);return{scrollTop:t,scrollTopWithoutViewZones:t-o,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===1?this._scrollable.setScrollPositionNow(e):this._scrollable.setScrollPositionSmooth(e)}hasPendingScrollAnimation(){return this._scrollable.hasPendingScrollAnimation()}deltaScrollNow(e,t){const n=this._scrollable.getCurrentScrollPosition();this._scrollable.setScrollPositionNow({scrollLeft:n.scrollLeft+e,scrollTop:n.scrollTop+t})}}class flt{constructor(e,t,n,o,r){this.editorId=e,this.model=t,this.configuration=n,this._linesCollection=o,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 n=this._decorationsCache[t];if(!n){const o=e.range,r=e.options;let s;if(r.isWholeLine){const a=this._coordinatesConverter.convertModelPositionToViewPosition(new ae(o.startLineNumber,1),0,!1,!0),l=this._coordinatesConverter.convertModelPositionToViewPosition(new ae(o.endLineNumber,this.model.getLineMaxColumn(o.endLineNumber)),1);s=new V(a.lineNumber,a.column,l.lineNumber,l.column)}else s=this._coordinatesConverter.convertModelRangeToViewRange(o,1);n=new z0e(s,r),this._decorationsCache[t]=n}return n}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,n=!1){const o=new V(e,this._linesCollection.getViewLineMinColumn(e),e,this._linesCollection.getViewLineMaxColumn(e));return this._getDecorationsInRange(o,t,n).inlineDecorations[0]}_getDecorationsInRange(e,t,n){const o=this._linesCollection.getDecorationsInRange(e,this.editorId,RA(this.configuration.options),t,n),r=e.startLineNumber,s=e.endLineNumber,a=[];let l=0;const c=[];for(let u=r;u<=s;u++)c[u-r]=[];for(let u=0,d=o.length;ut===1)}function UG(i,e){return e1e(i,e.range,t=>t===2)}function e1e(i,e,t){for(let n=e.startLineNumber;n<=e.endLineNumber;n++){const o=i.tokenization.getLineTokens(n),r=n===e.startLineNumber,s=n===e.endLineNumber;let a=r?o.findTokenIndexAtOffset(e.startColumn-1):0;for(;ae.endColumn-1);){if(!t(o.getStandardTokenType(a)))return!1;a++}}return!0}function C9(i,e){return i===null?e?_P.INSTANCE:bP.INSTANCE:new glt(i,e)}class glt{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,n){this._assertVisible();const o=n>0?this._projectionData.breakOffsets[n-1]:0,r=this._projectionData.breakOffsets[n];let s;if(this._projectionData.injectionOffsets!==null){const a=this._projectionData.injectionOffsets.map((c,u)=>new qd(0,0,c+1,this._projectionData.injectionOptions[u],0));s=qd.applyInjectedText(e.getLineContent(t),a).substring(o,r)}else s=e.getValueInRange({startLineNumber:t,startColumn:o+1,endLineNumber:t,endColumn:r+1});return n>0&&(s=bse(this._projectionData.wrappedTextIndentLength)+s),s}getViewLineLength(e,t,n){return this._assertVisible(),this._projectionData.getLineLength(n)}getViewLineMinColumn(e,t,n){return this._assertVisible(),this._projectionData.getMinOutputOffset(n)+1}getViewLineMaxColumn(e,t,n){return this._assertVisible(),this._projectionData.getMaxOutputOffset(n)+1}getViewLineData(e,t,n){const o=new Array;return this.getViewLinesData(e,t,n,1,0,[!0],o),o[0]}getViewLinesData(e,t,n,o,r,s,a){this._assertVisible();const l=this._projectionData,c=l.injectionOffsets,u=l.injectionOptions;let d=null;if(c){d=[];let f=0,g=0;for(let p=0;p0?l.breakOffsets[p-1]:0,_=l.breakOffsets[p];for(;g_)break;if(m0?l.wrappedTextIndentLength:0,I=E+Math.max(y-m,0),k=E+Math.min(L-m,_-m);I!==k&&v.push(new wtt(I,k,D.inlineClassName,D.inlineClassNameAffectsLetterSpacing))}}if(L<=_)f+=w,g++;else break}}}let h;c?h=e.tokenization.getLineTokens(t).withInserted(c.map((f,g)=>({offset:f,text:u[g].content,tokenMetadata:gr.defaultTokenMetadata}))):h=e.tokenization.getLineTokens(t);for(let f=n;f0?o.wrappedTextIndentLength:0,s=n>0?o.breakOffsets[n-1]:0,a=o.breakOffsets[n],l=e.sliceAndInflate(s,a,r);let c=l.getLineContent();n>0&&(c=bse(o.wrappedTextIndentLength)+c);const u=this._projectionData.getMinOutputOffset(n)+1,d=c.length+1,h=n+1=w9.length)for(let e=1;e<=i;e++)w9[e]=plt(e);return w9[i]}function plt(i){return new Array(i+1).join(" ")}class mlt{constructor(e,t,n,o,r,s,a,l,c,u){this._editorId=e,this.model=t,this._validModelVersionId=-1,this._domLineBreaksComputerFactory=n,this._monospaceLineBreaksComputerFactory=o,this.fontInfo=r,this.tabSize=s,this.wrappingStrategy=a,this.wrappingColumn=l,this.wrappingIndent=c,this.wordBreak=u,this._constructLines(!0,null)}dispose(){this.hiddenAreasDecorationIds=this.model.deltaDecorations(this.hiddenAreasDecorationIds,[])}createCoordinatesConverter(){return new _lt(this)}_constructLines(e,t){this.modelLineProjections=[],e&&(this.hiddenAreasDecorationIds=this.model.deltaDecorations(this.hiddenAreasDecorationIds,[]));const n=this.model.getLinesContent(),o=this.model.getInjectedTextDecorations(this._editorId),r=n.length,s=this.createLineBreaksComputer(),a=new rp(qd.fromDecorations(o));for(let p=0;pm.lineNumber===p+1);s.addRequest(n[p],v,t?t[p]:null)}const l=s.finalize(),c=[],u=this.hiddenAreasDecorationIds.map(p=>this.model.getDecorationRange(p)).sort(V.compareRangesUsingStarts);let d=1,h=0,f=-1,g=f+1=d&&v<=h,_=C9(l[p],!m);c[p]=_.getViewLineCount(),this.modelLineProjections[p]=_}this._validModelVersionId=this.model.getVersionId(),this.projectedModelLineLineCounts=new JJe(c)}getHiddenAreas(){return this.hiddenAreasDecorationIds.map(e=>this.model.getDecorationRange(e))}setHiddenAreas(e){const t=e.map(h=>this.model.validateRange(h)),n=vlt(t),o=this.hiddenAreasDecorationIds.map(h=>this.model.getDecorationRange(h)).sort(V.compareRangesUsingStarts);if(n.length===o.length){let h=!1;for(let f=0;f({range:h,options:Jt.EMPTY}));this.hiddenAreasDecorationIds=this.model.deltaDecorations(this.hiddenAreasDecorationIds,r);const s=n;let a=1,l=0,c=-1,u=c+1=a&&f<=l?this.modelLineProjections[h].isVisible()&&(this.modelLineProjections[h]=this.modelLineProjections[h].setVisible(!1),g=!0):(d=!0,this.modelLineProjections[h].isVisible()||(this.modelLineProjections[h]=this.modelLineProjections[h].setVisible(!0),g=!0)),g){const p=this.modelLineProjections[h].getViewLineCount();this.projectedModelLineLineCounts.setValue(h,p)}}return d||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,n,o,r){const s=this.fontInfo.equals(e),a=this.wrappingStrategy===t,l=this.wrappingColumn===n,c=this.wrappingIndent===o,u=this.wordBreak===r;if(s&&a&&l&&c&&u)return!1;const d=s&&a&&!l&&c&&u;this.fontInfo=e,this.wrappingStrategy=t,this.wrappingColumn=n,this.wrappingIndent=o,this.wordBreak=r;let h=null;if(d){h=[];for(let f=0,g=this.modelLineProjections.length;f2&&!this.modelLineProjections[t-2].isVisible(),s=t===1?1:this.projectedModelLineLineCounts.getPrefixSum(t-1)+1;let a=0;const l=[],c=[];for(let u=0,d=o.length;ul?(u=this.projectedModelLineLineCounts.getPrefixSum(t-1)+1,d=u+l-1,g=d+1,p=g+(r-l)-1,c=!0):rt?t:e|0}getActiveIndentGuide(e,t,n){e=this._toValidViewLineNumber(e),t=this._toValidViewLineNumber(t),n=this._toValidViewLineNumber(n);const o=this.convertViewPositionToModelPosition(e,this.getViewLineMinColumn(e)),r=this.convertViewPositionToModelPosition(t,this.getViewLineMinColumn(t)),s=this.convertViewPositionToModelPosition(n,this.getViewLineMinColumn(n)),a=this.model.guides.getActiveIndentGuide(o.lineNumber,r.lineNumber,s.lineNumber),l=this.convertModelPositionToViewPosition(a.startLineNumber,1),c=this.convertModelPositionToViewPosition(a.endLineNumber,this.model.getLineMaxColumn(a.endLineNumber));return{startLineNumber:l.lineNumber,endLineNumber:c.lineNumber,indent:a.indent}}getViewLineInfo(e){e=this._toValidViewLineNumber(e);const t=this.projectedModelLineLineCounts.getIndexOf(e-1),n=t.index,o=t.remainder;return new Cse(n+1,o)}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],n=t.getViewLineMinColumn(this.model,e.modelLineNumber,e.modelLineWrappedLineIdx),o=t.getModelColumnOfViewPosition(e.modelLineWrappedLineIdx,n);return new ae(e.modelLineNumber,o)}getModelEndPositionOfViewLine(e){const t=this.modelLineProjections[e.modelLineNumber-1],n=t.getViewLineMaxColumn(this.model,e.modelLineNumber,e.modelLineWrappedLineIdx),o=t.getModelColumnOfViewPosition(e.modelLineWrappedLineIdx,n);return new ae(e.modelLineNumber,o)}getViewLineInfosGroupedByModelRanges(e,t){const n=this.getViewLineInfo(e),o=this.getViewLineInfo(t),r=new Array;let s=this.getModelStartPositionOfViewLine(n),a=new Array;for(let l=n.modelLineNumber;l<=o.modelLineNumber;l++){const c=this.modelLineProjections[l-1];if(c.isVisible()){const u=l===n.modelLineNumber?n.modelLineWrappedLineIdx:0,d=l===o.modelLineNumber?o.modelLineWrappedLineIdx+1:c.getViewLineCount();for(let h=u;h{if(f.forWrappedLinesAfterColumn!==-1&&this.modelLineProjections[u.modelLineNumber-1].getViewPositionOfModelPosition(0,f.forWrappedLinesAfterColumn).lineNumber>=u.modelLineWrappedLineIdx||f.forWrappedLinesBeforeOrAtColumn!==-1&&this.modelLineProjections[u.modelLineNumber-1].getViewPositionOfModelPosition(0,f.forWrappedLinesBeforeOrAtColumn).lineNumberu.modelLineWrappedLineIdx)return}const p=this.convertModelPositionToViewPosition(u.modelLineNumber,f.horizontalLine.endColumn),v=this.modelLineProjections[u.modelLineNumber-1].getViewPositionOfModelPosition(0,f.horizontalLine.endColumn);return v.lineNumber===u.modelLineWrappedLineIdx?new g0(f.visibleColumn,g,f.className,new fE(f.horizontalLine.top,p.column),-1,-1):v.lineNumber!!f))}}return s}getViewLinesIndentGuides(e,t){e=this._toValidViewLineNumber(e),t=this._toValidViewLineNumber(t);const n=this.convertViewPositionToModelPosition(e,this.getViewLineMinColumn(e)),o=this.convertViewPositionToModelPosition(t,this.getViewLineMaxColumn(t));let r=[];const s=[],a=[],l=n.lineNumber-1,c=o.lineNumber-1;let u=null;for(let g=l;g<=c;g++){const p=this.modelLineProjections[g];if(p.isVisible()){const v=p.getViewLineNumberOfModelPosition(0,g===l?n.column:1),m=p.getViewLineNumberOfModelPosition(0,this.model.getLineMaxColumn(g+1)),_=m-v+1;let w=0;_>1&&p.getViewLineMinColumn(this.model,g+1,m)===1&&(w=v===0?1:2),s.push(_),a.push(w),u===null&&(u=new ae(g+1,0))}else u!==null&&(r=r.concat(this.model.guides.getLinesIndentGuides(u.lineNumber,g)),u=null)}u!==null&&(r=r.concat(this.model.guides.getLinesIndentGuides(u.lineNumber,o.lineNumber)),u=null);const d=t-e+1,h=new Array(d);let f=0;for(let g=0,p=r.length;gt&&(g=!0,f=t-r+1),d.getViewLinesData(this.model,c+1,h,f,r-e,n,l),r+=f,g)break}return l}validateViewPosition(e,t,n){e=this._toValidViewLineNumber(e);const o=this.projectedModelLineLineCounts.getIndexOf(e-1),r=o.index,s=o.remainder,a=this.modelLineProjections[r],l=a.getViewLineMinColumn(this.model,r+1,s),c=a.getViewLineMaxColumn(this.model,r+1,s);tc&&(t=c);const u=a.getModelColumnOfViewPosition(s,t);return this.model.validatePosition(new ae(r+1,u)).equals(n)?new ae(e,t):this.convertModelPositionToViewPosition(n.lineNumber,n.column)}validateViewRange(e,t){const n=this.validateViewPosition(e.startLineNumber,e.startColumn,t.getStartPosition()),o=this.validateViewPosition(e.endLineNumber,e.endColumn,t.getEndPosition());return new V(n.lineNumber,n.column,o.lineNumber,o.column)}convertViewPositionToModelPosition(e,t){const n=this.getViewLineInfo(e),o=this.modelLineProjections[n.modelLineNumber-1].getModelColumnOfViewPosition(n.modelLineWrappedLineIdx,t);return this.model.validatePosition(new ae(n.modelLineNumber,o))}convertViewRangeToModelRange(e){const t=this.convertViewPositionToModelPosition(e.startLineNumber,e.startColumn),n=this.convertViewPositionToModelPosition(e.endLineNumber,e.endColumn);return new V(t.lineNumber,t.column,n.lineNumber,n.column)}convertModelPositionToViewPosition(e,t,n=2,o=!1,r=!1){const s=this.model.validatePosition(new ae(e,t)),a=s.lineNumber,l=s.column;let c=a-1,u=!1;if(r)for(;c0&&!this.modelLineProjections[c].isVisible();)c--,u=!0;if(c===0&&!this.modelLineProjections[c].isVisible())return new ae(o?0:1,1);const d=1+this.projectedModelLineLineCounts.getPrefixSum(c);let h;return u?r?h=this.modelLineProjections[c].getViewPositionOfModelPosition(d,1,n):h=this.modelLineProjections[c].getViewPositionOfModelPosition(d,this.model.getLineMaxColumn(c+1),n):h=this.modelLineProjections[a-1].getViewPositionOfModelPosition(d,l,n),h}convertModelRangeToViewRange(e,t=0){if(e.isEmpty()){const n=this.convertModelPositionToViewPosition(e.startLineNumber,e.startColumn,t);return V.fromPositions(n)}else{const n=this.convertModelPositionToViewPosition(e.startLineNumber,e.startColumn,1),o=this.convertModelPositionToViewPosition(e.endLineNumber,e.endColumn,0);return new V(n.lineNumber,n.column,o.lineNumber,o.column)}}getViewLineNumberOfModelPosition(e,t){let n=e-1;if(this.modelLineProjections[n].isVisible()){const r=1+this.projectedModelLineLineCounts.getPrefixSum(n);return this.modelLineProjections[n].getViewLineNumberOfModelPosition(r,t)}for(;n>0&&!this.modelLineProjections[n].isVisible();)n--;if(n===0&&!this.modelLineProjections[n].isVisible())return 1;const o=1+this.projectedModelLineLineCounts.getPrefixSum(n);return this.modelLineProjections[n].getViewLineNumberOfModelPosition(o,this.model.getLineMaxColumn(n+1))}getDecorationsInRange(e,t,n,o,r){const s=this.convertViewPositionToModelPosition(e.startLineNumber,e.startColumn),a=this.convertViewPositionToModelPosition(e.endLineNumber,e.endColumn);if(a.lineNumber-s.lineNumber<=e.endLineNumber-e.startLineNumber)return this.model.getDecorationsInRange(new V(s.lineNumber,1,a.lineNumber,a.column),t,n,o,r);let l=[];const c=s.lineNumber-1,u=a.lineNumber-1;let d=null;for(let p=c;p<=u;p++)if(this.modelLineProjections[p].isVisible())d===null&&(d=new ae(p+1,p===c?s.column:1));else if(d!==null){const m=this.model.getLineMaxColumn(p);l=l.concat(this.model.getDecorationsInRange(new V(d.lineNumber,d.column,p,m),t,n,o)),d=null}d!==null&&(l=l.concat(this.model.getDecorationsInRange(new V(d.lineNumber,d.column,a.lineNumber,a.column),t,n,o)),d=null),l.sort((p,v)=>{const m=V.compareRangesUsingStarts(p.range,v.range);return m===0?p.idv.id?1:0:m});const h=[];let f=0,g=null;for(const p of l){const v=p.id;g!==v&&(g=v,h[f++]=p)}return h}getInjectedTextAt(e){const t=this.getViewLineInfo(e.lineNumber);return this.modelLineProjections[t.modelLineNumber-1].getInjectedTextAt(t.modelLineWrappedLineIdx,e.column)}normalizePosition(e,t){const n=this.getViewLineInfo(e.lineNumber);return this.modelLineProjections[n.modelLineNumber-1].normalizePosition(n.modelLineWrappedLineIdx,e,t)}getLineIndentColumn(e){const t=this.getViewLineInfo(e);return t.modelLineWrappedLineIdx===0?this.model.getLineIndentColumn(t.modelLineNumber):0}}function vlt(i){if(i.length===0)return[];const e=i.slice();e.sort(V.compareRangesUsingStarts);const t=[];let n=e[0].startLineNumber,o=e[0].endLineNumber;for(let r=1,s=e.length;ro+1?(t.push(new V(n,1,o,1)),n=a.startLineNumber,o=a.endLineNumber):a.endLineNumber>o&&(o=a.endLineNumber)}return t.push(new V(n,1,o,1)),t}class Cse{constructor(e,t){this.modelLineNumber=e,this.modelLineWrappedLineIdx=t}}class wse{constructor(e,t){this.modelRange=e,this.viewLines=t}}class _lt{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,n,o){return this._lines.convertModelPositionToViewPosition(e.lineNumber,e.column,t,n,o)}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)}}class blt{constructor(e){this.model=e}dispose(){}createCoordinatesConverter(){return new Clt(this)}getHiddenAreas(){return[]}setHiddenAreas(e){return!1}setTabSize(e){return!1}setWrappingSettings(e,t,n,o){return!1}createLineBreaksComputer(){const e=[];return{addRequest:(t,n,o)=>{e.push(null)},finalize:()=>e}}onModelFlushed(){}onModelLinesDeleted(e,t,n){return new DH(t,n)}onModelLinesInserted(e,t,n,o){return new kH(t,n)}onModelLineChanged(e,t,n){return[!1,new Jbe(t,1),null,null]}acceptVersionId(e){}getViewLineCount(){return this.model.getLineCount()}getActiveIndentGuide(e,t,n){return{startLineNumber:e,endLineNumber:e,indent:0}}getViewLinesBracketGuides(e,t,n){return new Array(t-e+1).fill([])}getViewLinesIndentGuides(e,t){const n=t-e+1,o=new Array(n);for(let r=0;rt)}getModelLineViewLineCount(e){return 1}getViewLineNumberOfModelPosition(e,t){return e}}class wlt extends _e{constructor(e,t,n,o,r,s,a,l,c){if(super(),this.languageConfigurationService=a,this._themeService=l,this._attachedView=c,this.hiddenAreasModel=new Slt,this.previousHiddenAreas=[],this._editorId=e,this._configuration=t,this.model=n,this._eventDispatcher=new jat,this.onEvent=this._eventDispatcher.onEvent,this.cursorConfig=new $1(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._updateConfigurationViewLineCount=this._register(new bi(()=>this._updateConfigurationViewLineCountNow(),0)),this._hasFocus=!1,this._viewportStart=jG.create(this.model),this.model.isTooLargeForTokenization())this._lines=new blt(this.model);else{const u=this._configuration.options,d=u.get(50),h=u.get(137),f=u.get(144),g=u.get(136),p=u.get(128);this._lines=new mlt(this._editorId,this.model,o,r,d,this.model.getOptions().tabSize,h,f.wrappingColumn,g,p)}this.coordinatesConverter=this._lines.createCoordinatesConverter(),this._cursor=this._register(new nlt(n,this,this.coordinatesConverter,this.cursorConfig)),this.viewLayout=this._register(new hlt(this._configuration,this.getLineCount(),s)),this._register(this.viewLayout.onDidScroll(u=>{u.scrollTopChanged&&this._handleVisibleLinesChanged(),u.scrollTopChanged&&this._viewportStart.invalidate(),this._eventDispatcher.emitSingleViewEvent(new Vat(u)),this._eventDispatcher.emitOutgoingEvent(new HG(u.oldScrollWidth,u.oldScrollLeft,u.oldScrollHeight,u.oldScrollTop,u.scrollWidth,u.scrollLeft,u.scrollHeight,u.scrollTop))})),this._register(this.viewLayout.onDidContentSizeChange(u=>{this._eventDispatcher.emitOutgoingEvent(u)})),this._decorations=new flt(this._editorId,this.model,this._configuration,this._lines,this.coordinatesConverter),this._registerModelEvents(),this._register(this._configuration.onDidChangeFast(u=>{try{const d=this._eventDispatcher.beginEmitViewEvents();this._onConfigurationChanged(d,u)}finally{this._eventDispatcher.endEmitViewEvents()}})),this._register(QI.getInstance().onDidChange(()=>{this._eventDispatcher.emitSingleViewEvent(new zat)})),this._register(this._themeService.onDidColorThemeChange(u=>{this._invalidateDecorationsColorCache(),this._eventDispatcher.emitSingleViewEvent(new Hat(u))})),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 V(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 Bat(e)),this._eventDispatcher.emitOutgoingEvent(new VG(!e,e))}onCompositionStart(){this._eventDispatcher.emitSingleViewEvent(new Aat)}onCompositionEnd(){this._eventDispatcher.emitSingleViewEvent(new Pat)}_captureStableViewport(){if(this._viewportStart.isValid&&this.viewLayout.getCurrentScrollTop()>0){const e=new ae(this._viewportStart.viewLineNumber,this.getLineMinColumn(this._viewportStart.viewLineNumber)),t=this.coordinatesConverter.convertViewPositionToModelPosition(e);return new Sse(t,this._viewportStart.startLineDelta)}return new Sse(null,0)}_onConfigurationChanged(e,t){const n=this._captureStableViewport(),o=this._configuration.options,r=o.get(50),s=o.get(137),a=o.get(144),l=o.get(136),c=o.get(128);this._lines.setWrappingSettings(r,s,a.wrappingColumn,l,c)&&(e.emitViewEvent(new C2),e.emitViewEvent(new w2),e.emitViewEvent(new K1(null)),this._cursor.onLineMappingChanged(e),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount()),this._updateConfigurationViewLineCount.schedule()),t.hasChanged(90)&&(this._decorations.reset(),e.emitViewEvent(new K1(null))),e.emitViewEvent(new Oat(t)),this.viewLayout.onConfigurationChanged(t),n.recoverViewportStart(this.coordinatesConverter,this.viewLayout),$1.shouldRecreate(t)&&(this.cursorConfig=new $1(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig))}_registerModelEvents(){this._register(this.model.onDidChangeContentOrInjectedText(e=>{try{const n=this._eventDispatcher.beginEmitViewEvents();let o=!1,r=!1;const s=e instanceof T0?e.rawContentChangedEvent.changes:e.changes,a=e instanceof T0?e.rawContentChangedEvent.versionId:null,l=this._lines.createLineBreaksComputer();for(const d of s)switch(d.changeType){case 4:{for(let h=0;h!p.ownerId||p.ownerId===this._editorId)),l.addRequest(f,g,null)}break}case 2:{let h=null;d.injectedText&&(h=d.injectedText.filter(f=>!f.ownerId||f.ownerId===this._editorId)),l.addRequest(d.detail,h,null);break}}const c=l.finalize(),u=new rp(c);for(const d of s)switch(d.changeType){case 1:{this._lines.onModelFlushed(),n.emitViewEvent(new C2),this._decorations.reset(),this.viewLayout.onFlushed(this.getLineCount()),o=!0;break}case 3:{const h=this._lines.onModelLinesDeleted(a,d.fromLineNumber,d.toLineNumber);h!==null&&(n.emitViewEvent(h),this.viewLayout.onLinesDeleted(h.fromLineNumber,h.toLineNumber)),o=!0;break}case 4:{const h=u.takeCount(d.detail.length),f=this._lines.onModelLinesInserted(a,d.fromLineNumber,d.toLineNumber,h);f!==null&&(n.emitViewEvent(f),this.viewLayout.onLinesInserted(f.fromLineNumber,f.toLineNumber)),o=!0;break}case 2:{const h=u.dequeue(),[f,g,p,v]=this._lines.onModelLineChanged(a,d.lineNumber,h);r=f,g&&n.emitViewEvent(g),p&&(n.emitViewEvent(p),this.viewLayout.onLinesInserted(p.fromLineNumber,p.toLineNumber)),v&&(n.emitViewEvent(v),this.viewLayout.onLinesDeleted(v.fromLineNumber,v.toLineNumber));break}case 5:break}a!==null&&this._lines.acceptVersionId(a),this.viewLayout.onHeightMaybeChanged(),!o&&r&&(n.emitViewEvent(new w2),n.emitViewEvent(new K1(null)),this._cursor.onLineMappingChanged(n),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 n=this.model._getTrackedRange(this._viewportStart.modelTrackedRange);if(n){const o=this.coordinatesConverter.convertModelPositionToViewPosition(n.getStartPosition()),r=this.viewLayout.getVerticalOffsetForLineNumber(o.lineNumber);this.viewLayout.setScrollPosition({scrollTop:r+this._viewportStart.startLineDelta},1)}}try{const n=this._eventDispatcher.beginEmitViewEvents();e instanceof T0&&n.emitOutgoingEvent(new Jat(e.contentChangedEvent)),this._cursor.onModelContentChanged(n,e)}finally{this._eventDispatcher.endEmitViewEvents()}this._handleVisibleLinesChanged()})),this._register(this.model.onDidChangeTokens(e=>{const t=[];for(let n=0,o=e.ranges.length;n{this._eventDispatcher.emitSingleViewEvent(new Wat),this.cursorConfig=new $1(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig),this._eventDispatcher.emitOutgoingEvent(new Qat(e))})),this._register(this.model.onDidChangeLanguage(e=>{this.cursorConfig=new $1(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig),this._eventDispatcher.emitOutgoingEvent(new Zat(e))})),this._register(this.model.onDidChangeOptions(e=>{if(this._lines.setTabSize(this.model.getOptions().tabSize)){try{const t=this._eventDispatcher.beginEmitViewEvents();t.emitViewEvent(new C2),t.emitViewEvent(new w2),t.emitViewEvent(new K1(null)),this._cursor.onLineMappingChanged(t),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount())}finally{this._eventDispatcher.endEmitViewEvents()}this._updateConfigurationViewLineCount.schedule()}this.cursorConfig=new $1(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig),this._eventDispatcher.emitOutgoingEvent(new elt(e))})),this._register(this.model.onDidChangeDecorations(e=>{this._decorations.onModelDecorationsChanged(),this._eventDispatcher.emitSingleViewEvent(new K1(e)),this._eventDispatcher.emitOutgoingEvent(new Yat(e))}))}setHiddenAreas(e,t){this.hiddenAreasModel.setHiddenAreas(t,e);const n=this.hiddenAreasModel.getMergedRanges();if(n===this.previousHiddenAreas)return;this.previousHiddenAreas=n;const o=this._captureStableViewport();let r=!1;try{const s=this._eventDispatcher.beginEmitViewEvents();r=this._lines.setHiddenAreas(n),r&&(s.emitViewEvent(new C2),s.emitViewEvent(new w2),s.emitViewEvent(new K1(null)),this._cursor.onLineMappingChanged(s),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount()),this.viewLayout.onHeightMaybeChanged()),o.recoverViewportStart(this.coordinatesConverter,this.viewLayout)}finally{this._eventDispatcher.endEmitViewEvents()}this._updateConfigurationViewLineCount.schedule(),r&&this._eventDispatcher.emitOutgoingEvent(new Gat)}getVisibleRangesPlusViewportAboveBelow(){const e=this._configuration.options.get(143),t=this._configuration.options.get(66),n=Math.max(20,Math.round(e.height/t)),o=this.viewLayout.getLinesViewportData(),r=Math.max(1,o.completelyVisibleStartLineNumber-n),s=Math.min(this.getLineCount(),o.completelyVisibleEndLineNumber+n);return this._toModelVisibleRanges(new V(r,this.getLineMinColumn(r),s,this.getLineMaxColumn(s)))}getVisibleRanges(){const e=this.getCompletelyVisibleViewRange();return this._toModelVisibleRanges(e)}getHiddenAreas(){return this._lines.getHiddenAreas()}_toModelVisibleRanges(e){const t=this.coordinatesConverter.convertViewRangeToModelRange(e),n=this._lines.getHiddenAreas();if(n.length===0)return[t];const o=[];let r=0,s=t.startLineNumber,a=t.startColumn;const l=t.endLineNumber,c=t.endColumn;for(let u=0,d=n.length;ul||(sa.toInlineDecoration(e))]),new Yl(s.minColumn,s.maxColumn,s.content,s.continuesWithWrappedLine,n,o,s.tokens,t,r,s.startVisibleColumn)}getViewLineData(e){return this._lines.getViewLineData(e)}getMinimapLinesRenderingData(e,t,n){const o=this._lines.getViewLinesData(e,t,n);return new Ctt(this.getTabSize(),o)}getAllOverviewRulerDecorations(e){const t=this.model.getOverviewRulerDecorations(this._editorId,RA(this._configuration.options)),n=new ylt;for(const o of t){const r=o.options,s=r.overviewRuler;if(!s)continue;const a=s.position;if(a===0)continue;const l=s.getColor(e.value),c=this.coordinatesConverter.getViewLineNumberOfModelPosition(o.range.startLineNumber,o.range.startColumn),u=this.coordinatesConverter.getViewLineNumberOfModelPosition(o.range.endLineNumber,o.range.endColumn);n.accept(l,r.zIndex,c,u,a)}return n.asArray}_invalidateDecorationsColorCache(){const e=this.model.getOverviewRulerDecorations();for(const t of e){const n=t.options.overviewRuler;n==null||n.invalidateCachedColor();const o=t.options.minimap;o==null||o.invalidateCachedColor()}}getValueInRange(e,t){const n=this.coordinatesConverter.convertViewRangeToModelRange(e);return this.model.getValueInRange(n,t)}getValueLengthInRange(e,t){const n=this.coordinatesConverter.convertViewRangeToModelRange(e);return this.model.getValueLengthInRange(n,t)}modifyPosition(e,t){const n=this.coordinatesConverter.convertViewPositionToModelPosition(e);return this.model.modifyPosition(n,t)}deduceModelPositionRelativeToViewPosition(e,t,n){const o=this.coordinatesConverter.convertViewPositionToModelPosition(e);this.model.getEOL().length===2&&(t<0?t-=n:t+=n);const s=this.model.getOffsetAt(o)+t;return this.model.getPositionAt(s)}getPlainTextToCopy(e,t,n){const o=n?`\r -`:this.model.getEOL();e=e.slice(0),e.sort(V.compareRangesUsingStarts);let r=!1,s=!1;for(const l of e)l.isEmpty()?r=!0:s=!0;if(!s){if(!t)return"";const l=e.map(u=>u.startLineNumber);let c="";for(let u=0;u0&&l[u-1]===l[u]||(c+=this.model.getLineContent(l[u])+o);return c}if(r&&t){const l=[];let c=0;for(const u of e){const d=u.startLineNumber;u.isEmpty()?d!==c&&l.push(this.model.getLineContent(d)):l.push(this.model.getValueInRange(u,n?2:0)),c=d}return l.length===1?l[0]:l}const a=[];for(const l of e)l.isEmpty()||a.push(this.model.getValueInRange(l,n?2:0));return a.length===1?a[0]:a}getRichTextToCopy(e,t){const n=this.model.getLanguageId();if(n===ql||e.length!==1)return null;let o=e[0];if(o.isEmpty()){if(!t)return null;const u=o.startLineNumber;o=new V(u,this.model.getLineMinColumn(u),u,this.model.getLineMaxColumn(u))}const r=this._configuration.options.get(50),s=this._getColorMap(),l=/[:;\\\/<>]/.test(r.fontFamily)||r.fontFamily===sl.fontFamily;let c;return l?c=sl.fontFamily:(c=r.fontFamily,c=c.replace(/"/g,"'"),/[,']/.test(c)||/[+ ]/.test(c)&&(c=`'${c}'`),c=`${c}, ${sl.fontFamily}`),{mode:n,html:`
`+this._getHTMLToCopy(o,s)+"
"}}_getHTMLToCopy(e,t){const n=e.startLineNumber,o=e.startColumn,r=e.endLineNumber,s=e.endColumn,a=this.getTabSize();let l="";for(let c=n;c<=r;c++){const u=this.model.tokenization.getLineTokens(c),d=u.getLineContent(),h=c===n?o-1:0,f=c===r?s-1:d.length;d===""?l+="
":l+=alt(d,u.inflate(),t,h,f,a,as)}return l}_getColorMap(){const e=oo.getColorMap(),t=["#000000"];if(e)for(let n=1,o=e.length;nthis._cursor.setStates(o,e,t,n))}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,n=0){this._withViewEventsCollector(o=>this._cursor.setSelections(o,e,t,n))}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 Xat);return}this._withViewEventsCollector(e)}executeEdits(e,t,n){this._executeCursorEdit(o=>this._cursor.executeEdits(o,e,t,n))}startComposition(){this._executeCursorEdit(e=>this._cursor.startComposition(e))}endComposition(e){this._executeCursorEdit(t=>this._cursor.endComposition(t,e))}type(e,t){this._executeCursorEdit(n=>this._cursor.type(n,e,t))}compositionType(e,t,n,o,r){this._executeCursorEdit(s=>this._cursor.compositionType(s,e,t,n,o,r))}paste(e,t,n,o){this._executeCursorEdit(r=>this._cursor.paste(r,e,t,n,o))}cut(e){this._executeCursorEdit(t=>this._cursor.cut(t,e))}executeCommand(e,t){this._executeCursorEdit(n=>this._cursor.executeCommand(n,e,t))}executeCommands(e,t){this._executeCursorEdit(n=>this._cursor.executeCommands(n,e,t))}revealPrimaryCursor(e,t,n=!1){this._withViewEventsCollector(o=>this._cursor.revealPrimary(o,e,n,0,t,0))}revealTopMostCursor(e){const t=this._cursor.getTopMostViewPosition(),n=new V(t.lineNumber,t.column,t.lineNumber,t.column);this._withViewEventsCollector(o=>o.emitViewEvent(new uM(e,!1,n,null,0,!0,0)))}revealBottomMostCursor(e){const t=this._cursor.getBottomMostViewPosition(),n=new V(t.lineNumber,t.column,t.lineNumber,t.column);this._withViewEventsCollector(o=>o.emitViewEvent(new uM(e,!1,n,null,0,!0,0)))}revealRange(e,t,n,o,r){this._withViewEventsCollector(s=>s.emitViewEvent(new uM(e,!1,n,null,o,t,r)))}changeWhitespace(e){this.viewLayout.changeWhitespace(e)&&(this._eventDispatcher.emitSingleViewEvent(new Uat),this._eventDispatcher.emitOutgoingEvent(new qat))}_withViewEventsCollector(e){try{const t=this._eventDispatcher.beginEmitViewEvents();return e(t)}finally{this._eventDispatcher.endEmitViewEvents()}}normalizePosition(e,t){return this._lines.normalizePosition(e,t)}getLineIndentColumn(e){return this._lines.getLineIndentColumn(e)}}class jG{static create(e){const t=e._setTrackedRange(null,new V(1,1,1,1),1);return new jG(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,n,o,r){this._model=e,this._viewLineNumber=t,this._isValid=n,this._modelTrackedRange=o,this._startLineDelta=r}dispose(){this._model._setTrackedRange(this._modelTrackedRange,null,1)}update(e,t){const n=e.coordinatesConverter.convertViewPositionToModelPosition(new ae(t,e.getLineMinColumn(t))),o=e.model._setTrackedRange(this._modelTrackedRange,new V(n.lineNumber,n.column,n.lineNumber,n.column),1),r=e.viewLayout.getVerticalOffsetForLineNumber(t),s=e.viewLayout.getCurrentScrollTop();this._viewLineNumber=t,this._isValid=!0,this._modelTrackedRange=o,this._startLineDelta=s-r}invalidate(){this._isValid=!1}}class ylt{constructor(){this._asMap=Object.create(null),this.asArray=[]}accept(e,t,n,o,r){const s=this._asMap[e];if(s){const a=s.data,l=a[a.length-3],c=a[a.length-1];if(l===r&&c+1>=n){o>c&&(a[a.length-1]=o);return}a.push(r,n,o)}else{const a=new UD(e,t,[r,n,o]);this._asMap[e]=a,this.asArray.push(a)}}}class Slt{constructor(){this.hiddenAreas=new Map,this.shouldRecompute=!1,this.ranges=[]}setHiddenAreas(e,t){const n=this.hiddenAreas.get(e);n&&yse(n,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,n)=>xlt(t,n),[]);return yse(this.ranges,e)?this.ranges:(this.ranges=e,this.ranges)}}function xlt(i,e){const t=[];let n=0,o=0;for(;n0?this.wrappedTextIndentLength:0}getLineLength(e){const t=e>0?this.breakOffsets[e-1]:0;let o=this.breakOffsets[e]-t;return e>0&&(o+=this.wrappedTextIndentLength),o}getMaxOutputOffset(e){return this.getLineLength(e)}translateToInputOffset(e,t){e>0&&(t=Math.max(0,t-this.wrappedTextIndentLength));let o=e===0?t:this.breakOffsets[e-1]+t;if(this.injectionOffsets!==null)for(let r=0;rthis.injectionOffsets[r];r++)o0?this.breakOffsets[r-1]:0,t===0)if(e<=s)o=r-1;else if(e>l)n=r+1;else break;else if(e=l)n=r+1;else break}let a=e-s;return r>0&&(a+=this.wrappedTextIndentLength),new y2(r,a)}normalizeOutputPosition(e,t,n){if(this.injectionOffsets!==null){const o=this.outputPositionToOffsetInInputWithInjections(e,t),r=this.normalizeOffsetInInputWithInjectionsAroundInjections(o,n);if(r!==o)return this.offsetInInputWithInjectionsToOutputPosition(r,n)}if(n===0){if(e>0&&t===this.getMinOutputOffset(e))return new y2(e-1,this.getMaxOutputOffset(e-1))}else if(n===1){const o=this.getOutputLineCount()-1;if(e0&&(t=Math.max(0,t-this.wrappedTextIndentLength)),(e>0?this.breakOffsets[e-1]:0)+t}normalizeOffsetInInputWithInjectionsAroundInjections(e,t){const n=this.getInjectedTextAtOffset(e);if(!n)return e;if(t===2){if(e===n.offsetInInputWithInjections+n.length&&xse(this.injectionOptions[n.injectedTextIndex].cursorStops))return n.offsetInInputWithInjections+n.length;{let o=n.offsetInInputWithInjections;if(Lse(this.injectionOptions[n.injectedTextIndex].cursorStops))return o;let r=n.injectedTextIndex-1;for(;r>=0&&this.injectionOffsets[r]===this.injectionOffsets[n.injectedTextIndex]&&!(xse(this.injectionOptions[r].cursorStops)||(o-=this.injectionOptions[r].content.length,Lse(this.injectionOptions[r].cursorStops)));)r--;return o}}else if(t===1||t===4){let o=n.offsetInInputWithInjections+n.length,r=n.injectedTextIndex;for(;r+1=0&&this.injectionOffsets[r-1]===this.injectionOffsets[r];)o-=this.injectionOptions[r-1].content.length,r--;return o}Y4()}getInjectedText(e,t){const n=this.outputPositionToOffsetInInputWithInjections(e,t),o=this.getInjectedTextAtOffset(n);return o?{options:this.injectionOptions[o.injectedTextIndex]}:null}getInjectedTextAtOffset(e){const t=this.injectionOffsets,n=this.injectionOptions;if(t!==null){let o=0;for(let r=0;re)break;if(e<=l)return{injectedTextIndex:r,offsetInInputWithInjections:a,length:s};o+=s}}}}function xse(i){return i==null?!0:i===Nd.Right||i===Nd.Both}function Lse(i){return i==null?!0:i===Nd.Left||i===Nd.Both}class y2{constructor(e,t){this.outputLineIndex=e,this.outputOffset=t}toString(){return`${this.outputLineIndex}:${this.outputOffset}`}toPosition(e){return new ae(e+this.outputLineIndex,this.outputOffset+1)}}class KG{static create(e){return new KG(e.get(132),e.get(131))}constructor(e,t){this.classifier=new Elt(e,t)}createLineBreaksComputer(e,t,n,o,r){const s=[],a=[],l=[];return{addRequest:(c,u,d)=>{s.push(c),a.push(u),l.push(d)},finalize:()=>{const c=e.typicalFullwidthCharacterWidth/e.typicalHalfwidthCharacterWidth,u=[];for(let d=0,h=s.length;d=0&&e<256?this._asciiMap[e]:e>=12352&&e<=12543||e>=13312&&e<=19903||e>=19968&&e<=40959?3:this._map.get(e)||this._defaultValue}}let IH=[],TH=[];function Dlt(i,e,t,n,o,r,s,a){if(o===-1)return null;const l=t.length;if(l<=1)return null;const c=a==="keepAll",u=e.breakOffsets,d=e.breakOffsetsVisibleColumn,h=t1e(t,n,o,r,s),f=o-h,g=IH,p=TH;let v=0,m=0,_=0,w=o;const y=u.length;let L=0;if(L>=0){let D=Math.abs(d[L]-w);for(;L+1=D)break;D=E,L++}}for(;LD&&(D=m,E=_);let I=0,k=0,R=0,A=0;if(E<=w){let N=E,M=D===0?0:t.charCodeAt(D-1),H=D===0?0:i.get(M),W=!0;for(let F=D;Fm&&NH(M,H,z,K,c)&&(I=$,k=N),N+=j,N>w){$>m?(R=$,A=N-j):(R=F+1,A=N),N-k>f&&(I=0),W=!1;break}M=z,H=K}if(W){v>0&&(g[v]=u[u.length-1],p[v]=d[u.length-1],v++);break}}if(I===0){let N=E,M=t.charCodeAt(D),H=i.get(M),W=!1;for(let F=D-1;F>=m;F--){const $=F+1,z=t.charCodeAt(F);if(z===9){W=!0;break}let K,j;if(Y0(z)?(F--,K=0,j=2):(K=i.get(z),j=bv(z)?r:1),N<=w){if(R===0&&(R=$,A=N),N<=w-f)break;if(NH(z,K,M,H,c)){I=$,k=N;break}}N-=j,M=z,H=K}if(I!==0){const F=f-(A-k);if(F<=n){const $=t.charCodeAt(R);let z;fr($)?z=2:z=SE($,A,n,r),F-z<0&&(I=0)}}if(W){L--;continue}}if(I===0&&(I=R,k=A),I<=m){const N=t.charCodeAt(m);fr(N)?(I=m+2,k=_+2):(I=m+1,k=_+SE(N,_,n,r))}for(m=I,g[v]=I,_=k,p[v]=k,v++,w=k+f;L<0||L=P)break;P=N,L++}}return v===0?null:(g.length=v,p.length=v,IH=e.breakOffsets,TH=e.breakOffsetsVisibleColumn,e.breakOffsets=g,e.breakOffsetsVisibleColumn=p,e.wrappedTextIndentLength=h,e)}function klt(i,e,t,n,o,r,s,a){const l=qd.applyInjectedText(e,t);let c,u;if(t&&t.length>0?(c=t.map(k=>k.options),u=t.map(k=>k.column-1)):(c=null,u=null),o===-1)return c?new yE(u,c,[l.length],[],0):null;const d=l.length;if(d<=1)return c?new yE(u,c,[l.length],[],0):null;const h=a==="keepAll",f=t1e(l,n,o,r,s),g=o-f,p=[],v=[];let m=0,_=0,w=0,y=o,L=l.charCodeAt(0),D=i.get(L),E=SE(L,0,n,r),I=1;fr(L)&&(E+=1,L=l.charCodeAt(1),D=i.get(L),I++);for(let k=I;ky&&((_===0||E-w>g)&&(_=R,w=E-N),p[m]=_,v[m]=w,m++,y=w+g,_=0),L=A,D=P}return m===0&&(!t||t.length===0)?null:(p[m]=d,v[m]=E,new yE(u,c,p,v,f))}function SE(i,e,t,n){return i===9?t-e%t:bv(i)||i<32?n:1}function Ese(i,e){return e-i%e}function NH(i,e,t,n,o){return t!==32&&(e===2&&n!==2||e!==1&&n===1||!o&&e===3&&n!==2||!o&&n===3&&e!==1)}function t1e(i,e,t,n,o){let r=0;if(o!==0){const s=Ws(i);if(s!==-1){for(let l=0;lt&&(r=0)}}return r}const y9=gp("domLineBreaksComputer",{createHTML:i=>i});class qG{static create(){return new qG}constructor(){}createLineBreaksComputer(e,t,n,o,r){const s=[],a=[];return{addRequest:(l,c,u)=>{s.push(l),a.push(c)},finalize:()=>Ilt(s,e,t,n,o,r,a)}}}function Ilt(i,e,t,n,o,r,s){var a;function l(k){const R=s[k];if(R){const A=qd.applyInjectedText(i[k],R),P=R.map(M=>M.options),N=R.map(M=>M.column-1);return new yE(N,P,[A.length],[],0)}else return null}if(n===-1){const k=[];for(let R=0,A=i.length;Rc?(A=0,P=0):N=c-W}const M=R.substr(A),H=Tlt(M,P,t,N,g,h);p[k]=A,v[k]=P,m[k]=M,_[k]=H[0],w[k]=H[1]}const y=g.build(),L=(a=y9==null?void 0:y9.createHTML(y))!==null&&a!==void 0?a:y;f.innerHTML=L,f.style.position="absolute",f.style.top="10000",r==="keepAll"?(f.style.wordBreak="keep-all",f.style.overflowWrap="anywhere"):(f.style.wordBreak="inherit",f.style.overflowWrap="break-word"),document.body.appendChild(f);const D=document.createRange(),E=Array.prototype.slice.call(f.children,0),I=[];for(let k=0;kz.options),F=$.map(z=>z.column-1)):(W=null,F=null),I[k]=new yE(F,W,A,H,N)}return document.body.removeChild(f),I}function Tlt(i,e,t,n,o,r){if(r!==0){const h=String(r);o.appendString('
');const s=i.length;let a=e,l=0;const c=[],u=[];let d=0");for(let h=0;h"),c[h]=l,u[h]=a;const f=d;d=h+1"),c[i.length]=l,u[i.length]=a,o.appendString("
"),[c,u]}function Nlt(i,e,t,n){if(t.length<=1)return null;const o=Array.prototype.slice.call(e.children,0),r=[];try{RH(i,o,n,0,null,t.length-1,null,r)}catch(s){return console.log(s),null}return r.length===0?null:(r.push(t.length),r)}function RH(i,e,t,n,o,r,s,a){if(n===r||(o=o||S9(i,e,t[n],t[n+1]),s=s||S9(i,e,t[r],t[r+1]),Math.abs(o[0].top-s[0].top)<=.1))return;if(n+1===r){a.push(r);return}const l=n+(r-n)/2|0,c=S9(i,e,t[l],t[l+1]);RH(i,e,t,n,o,l,c,a),RH(i,e,t,l,c,r,s,a)}function S9(i,e,t,n){return i.setStart(e[t/16384|0].firstChild,t%16384),i.setEnd(e[n/16384|0].firstChild,n%16384),i.getClientRects()}class Rlt extends _e{constructor(){super(),this._editor=null,this._instantiationService=null,this._instances=this._register(new Mq),this._pending=new Map,this._finishedInstantiation=[],this._finishedInstantiation[0]=!1,this._finishedInstantiation[1]=!1,this._finishedInstantiation[2]=!1,this._finishedInstantiation[3]=!1}initialize(e,t,n){this._editor=e,this._instantiationService=n;for(const o of t){if(this._pending.has(o.id)){en(new Error(`Cannot have two contributions with the same id ${o.id}`));continue}this._pending.set(o.id,o)}this._instantiateSome(0),this._register(Rg(()=>{this._instantiateSome(1)})),this._register(Rg(()=>{this._instantiateSome(2)})),this._register(Rg(()=>{this._instantiateSome(3)},5e3))}saveViewState(){const e={};for(const[t,n]of this._instances)typeof n.saveViewState=="function"&&(e[t]=n.saveViewState());return e}restoreViewState(e){for(const[t,n]of this._instances)typeof n.restoreViewState=="function"&&n.restoreViewState(e[t])}get(e){return this._instantiateById(e),this._instances.get(e)||null}onBeforeInteractionEvent(){this._instantiateSome(2)}onAfterModelAttached(){this._register(Rg(()=>{this._instantiateSome(1)},50))}_instantiateSome(e){if(this._finishedInstantiation[e])return;this._finishedInstantiation[e]=!0;const t=this._findPendingContributionsByInstantiation(e);for(const n of t)this._instantiateById(n.id)}_findPendingContributionsByInstantiation(e){const t=[];for(const[,n]of this._pending)n.instantiation===e&&t.push(n);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 n=this._instantiationService.createInstance(t.ctor,this._editor);this._instances.set(t.id,n),typeof n.restoreViewState=="function"&&t.instantiation!==0&&console.warn(`Editor contribution '${t.id}' should be eager instantiated because it uses saveViewState / restoreViewState.`)}catch(n){en(n)}}}}var Mlt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Zf=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},Alt=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},M_;let Plt=0;class Olt{constructor(e,t,n,o,r,s){this.model=e,this.viewModel=t,this.view=n,this.hasRealView=o,this.listenersToRemove=r,this.attachedView=s}dispose(){si(this.listenersToRemove),this.model.onBeforeDetached(this.attachedView),this.hasRealView&&this.view.dispose(),this.viewModel.dispose()}}let ky=M_=class extends _e{get isSimpleWidget(){return this._configuration.isSimpleWidget}constructor(e,t,n,o,r,s,a,l,c,u,d,h){var f;super(),this.languageConfigurationService=d,this._deliveryQueue=LYe(),this._contributions=this._register(new Rlt),this._onDidDispose=this._register(new le),this.onDidDispose=this._onDidDispose.event,this._onDidChangeModelContent=this._register(new le({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelContent=this._onDidChangeModelContent.event,this._onDidChangeModelLanguage=this._register(new le({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelLanguage=this._onDidChangeModelLanguage.event,this._onDidChangeModelLanguageConfiguration=this._register(new le({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelLanguageConfiguration=this._onDidChangeModelLanguageConfiguration.event,this._onDidChangeModelOptions=this._register(new le({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelOptions=this._onDidChangeModelOptions.event,this._onDidChangeModelDecorations=this._register(new le({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelDecorations=this._onDidChangeModelDecorations.event,this._onDidChangeModelTokens=this._register(new le({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelTokens=this._onDidChangeModelTokens.event,this._onDidChangeConfiguration=this._register(new le({deliveryQueue:this._deliveryQueue})),this.onDidChangeConfiguration=this._onDidChangeConfiguration.event,this._onDidChangeModel=this._register(new le({deliveryQueue:this._deliveryQueue})),this.onDidChangeModel=this._onDidChangeModel.event,this._onDidChangeCursorPosition=this._register(new le({deliveryQueue:this._deliveryQueue})),this.onDidChangeCursorPosition=this._onDidChangeCursorPosition.event,this._onDidChangeCursorSelection=this._register(new le({deliveryQueue:this._deliveryQueue})),this.onDidChangeCursorSelection=this._onDidChangeCursorSelection.event,this._onDidAttemptReadOnlyEdit=this._register(new Rs(this._contributions,this._deliveryQueue)),this.onDidAttemptReadOnlyEdit=this._onDidAttemptReadOnlyEdit.event,this._onDidLayoutChange=this._register(new le({deliveryQueue:this._deliveryQueue})),this.onDidLayoutChange=this._onDidLayoutChange.event,this._editorTextFocus=this._register(new Dse({deliveryQueue:this._deliveryQueue})),this.onDidFocusEditorText=this._editorTextFocus.onDidChangeToTrue,this.onDidBlurEditorText=this._editorTextFocus.onDidChangeToFalse,this._editorWidgetFocus=this._register(new Dse({deliveryQueue:this._deliveryQueue})),this.onDidFocusEditorWidget=this._editorWidgetFocus.onDidChangeToTrue,this.onDidBlurEditorWidget=this._editorWidgetFocus.onDidChangeToFalse,this._onWillType=this._register(new Rs(this._contributions,this._deliveryQueue)),this.onWillType=this._onWillType.event,this._onDidType=this._register(new Rs(this._contributions,this._deliveryQueue)),this.onDidType=this._onDidType.event,this._onDidCompositionStart=this._register(new Rs(this._contributions,this._deliveryQueue)),this.onDidCompositionStart=this._onDidCompositionStart.event,this._onDidCompositionEnd=this._register(new Rs(this._contributions,this._deliveryQueue)),this.onDidCompositionEnd=this._onDidCompositionEnd.event,this._onDidPaste=this._register(new Rs(this._contributions,this._deliveryQueue)),this.onDidPaste=this._onDidPaste.event,this._onMouseUp=this._register(new Rs(this._contributions,this._deliveryQueue)),this.onMouseUp=this._onMouseUp.event,this._onMouseDown=this._register(new Rs(this._contributions,this._deliveryQueue)),this.onMouseDown=this._onMouseDown.event,this._onMouseDrag=this._register(new Rs(this._contributions,this._deliveryQueue)),this.onMouseDrag=this._onMouseDrag.event,this._onMouseDrop=this._register(new Rs(this._contributions,this._deliveryQueue)),this.onMouseDrop=this._onMouseDrop.event,this._onMouseDropCanceled=this._register(new Rs(this._contributions,this._deliveryQueue)),this.onMouseDropCanceled=this._onMouseDropCanceled.event,this._onDropIntoEditor=this._register(new Rs(this._contributions,this._deliveryQueue)),this.onDropIntoEditor=this._onDropIntoEditor.event,this._onContextMenu=this._register(new Rs(this._contributions,this._deliveryQueue)),this.onContextMenu=this._onContextMenu.event,this._onMouseMove=this._register(new Rs(this._contributions,this._deliveryQueue)),this.onMouseMove=this._onMouseMove.event,this._onMouseLeave=this._register(new Rs(this._contributions,this._deliveryQueue)),this.onMouseLeave=this._onMouseLeave.event,this._onMouseWheel=this._register(new Rs(this._contributions,this._deliveryQueue)),this.onMouseWheel=this._onMouseWheel.event,this._onKeyUp=this._register(new Rs(this._contributions,this._deliveryQueue)),this.onKeyUp=this._onKeyUp.event,this._onKeyDown=this._register(new Rs(this._contributions,this._deliveryQueue)),this.onKeyDown=this._onKeyDown.event,this._onDidContentSizeChange=this._register(new le({deliveryQueue:this._deliveryQueue})),this.onDidContentSizeChange=this._onDidContentSizeChange.event,this._onDidScrollChange=this._register(new le({deliveryQueue:this._deliveryQueue})),this.onDidScrollChange=this._onDidScrollChange.event,this._onDidChangeViewZones=this._register(new le({deliveryQueue:this._deliveryQueue})),this.onDidChangeViewZones=this._onDidChangeViewZones.event,this._onDidChangeHiddenAreas=this._register(new le({deliveryQueue:this._deliveryQueue})),this.onDidChangeHiddenAreas=this._onDidChangeHiddenAreas.event,this._actions=new Map,this._bannerDomNode=null,this._dropIntoEditorDecorations=this.createDecorationsCollection(),r.willCreateCodeEditor();const g=Object.assign({},t);this._domElement=e,this._overflowWidgetsDomNode=g.overflowWidgetsDomNode,delete g.overflowWidgetsDomNode,this._id=++Plt,this._decorationTypeKeysToIds={},this._decorationTypeSubtypes={},this._telemetryData=n.telemetryData,this._configuration=this._register(this._createConfiguration(n.isSimpleWidget||!1,g,u)),this._register(this._configuration.onDidChange(m=>{this._onDidChangeConfiguration.fire(m);const _=this._configuration.options;if(m.hasChanged(143)){const w=_.get(143);this._onDidLayoutChange.fire(w)}})),this._contextKeyService=this._register(a.createScoped(this._domElement)),this._notificationService=c,this._codeEditorService=r,this._commandService=s,this._themeService=l,this._register(new Flt(this,this._contextKeyService)),this._register(new Blt(this,this._contextKeyService,h)),this._instantiationService=o.createChild(new x5([Ut,this._contextKeyService])),this._modelData=null,this._focusTracker=new Wlt(e),this._register(this._focusTracker.onChange(()=>{this._editorWidgetFocus.setValue(this._focusTracker.hasFocus())})),this._contentWidgets={},this._overlayWidgets={},this._glyphMarginWidgets={};let p;Array.isArray(n.contributions)?p=n.contributions:p=vw.getEditorContributions(),this._contributions.initialize(this,p,this._instantiationService);for(const m of vw.getEditorActions()){if(this._actions.has(m.id)){en(new Error(`Cannot have two actions with the same id ${m.id}`));continue}const _=new Nbe(m.id,m.label,m.alias,(f=m.precondition)!==null&&f!==void 0?f:void 0,()=>this._instantiationService.invokeFunction(w=>Promise.resolve(m.runEditorCommand(w,this,null))),this._contextKeyService);this._actions.set(_.id,_)}const v=()=>!this._configuration.options.get(90)&&this._configuration.options.get(36).enabled;this._register(new UQe(this._domElement,{onDragEnter:()=>{},onDragOver:m=>{if(!v())return;const _=this.getTargetAtClientPoint(m.clientX,m.clientY);_!=null&&_.position&&this.showDropIndicatorAt(_.position)},onDrop:m=>Alt(this,void 0,void 0,function*(){if(!v()||(this.removeDropIndicator(),!m.dataTransfer))return;const _=this.getTargetAtClientPoint(m.clientX,m.clientY);_!=null&&_.position&&this._onDropIntoEditor.fire({position:_.position,event:m})}),onDragLeave:()=>{this.removeDropIndicator()},onDragEnd:()=>{this.removeDropIndicator()}})),this._codeEditorService.addCodeEditor(this)}writeScreenReaderContent(e){var t;(t=this._modelData)===null||t===void 0||t.view.writeScreenReaderContent(e)}_createConfiguration(e,t,n){return new aH(e,t,this._domElement,n)}getId(){return this.getEditorType()+":"+this._id}getEditorType(){return $I.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?Qn.getWordAtPosition(this._modelData.model,this._configuration.options.get(129),e):null}getValue(e=null){if(!this._modelData)return"";const t=!!(e&&e.preserveBOM);let n=0;return e&&e.lineEnding&&e.lineEnding===` +`)){d=!1;break}}if(d){const h=new V(c,1,c,u);t.push(new Z6(null,h,null,!1,!1,!1))}}this._trimAutoWhitespaceLines=null}return this._initialUndoRedoSnapshot===null&&(this._initialUndoRedoSnapshot=this._undoRedoService.createSnapshot(this.uri)),this._commandManager.pushEditOperation(e,t,n,o)}_applyUndo(e,t,n,o){const r=e.map(s=>{const a=this.getPositionAt(s.newPosition),l=this.getPositionAt(s.newEnd);return{range:new V(a.lineNumber,a.column,l.lineNumber,l.column),text:s.oldText}});this._applyUndoRedoEdits(r,t,!0,!1,n,o)}_applyRedo(e,t,n,o){const r=e.map(s=>{const a=this.getPositionAt(s.oldPosition),l=this.getPositionAt(s.oldEnd);return{range:new V(a.lineNumber,a.column,l.lineNumber,l.column),text:s.newText}});this._applyUndoRedoEdits(r,t,!1,!0,n,o)}_applyUndoRedoEdits(e,t,n,o,r,s){try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit(),this._isUndoing=n,this._isRedoing=o,this.applyEdits(e,!1),this.setEOL(t),this._overwriteAlternativeVersionId(r)}finally{this._isUndoing=!1,this._isRedoing=!1,this._eventEmitter.endDeferredEmit(s),this._onDidChangeDecorations.endDeferredEmit()}}applyEdits(e,t=!1){try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit();const n=this._validateEditOperations(e);return this._doApplyEdits(n,t)}finally{this._eventEmitter.endDeferredEmit(),this._onDidChangeDecorations.endDeferredEmit()}}_doApplyEdits(e,t){const n=this._buffer.getLineCount(),o=this._buffer.applyEdits(e,this._options.trimAutoWhitespace,t),r=this._buffer.getLineCount(),s=o.changes;if(this._trimAutoWhitespaceLines=o.trimAutoWhitespaceLineNumbers,s.length!==0){for(let c=0,u=s.length;c=0;k--){const R=f+k,A=y+k;I.takeFromEndWhile(N=>N.lineNumber>A);const P=I.takeFromEndWhile(N=>N.lineNumber===A);a.push(new vse(R,this.getLineContent(A),P))}if(mF.lineNumberF.lineNumber===B)}a.push(new xat(R+1,f+v,M,N))}l+=_}this._emitContentChangedEvent(new Ty(a,this.getVersionId(),this._isUndoing,this._isRedoing),{changes:s,eol:this._buffer.getEOL(),isEolChange:!1,versionId:this.getVersionId(),isUndoing:this._isUndoing,isRedoing:this._isRedoing,isFlush:!1})}return o.reverseEdits===null?void 0:o.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 n=Array.from(e).map(o=>new vse(o,this.getLineContent(o),this._getInjectedTextInLine(o)));this._onDidChangeInjectedText.fire(new o1e(n))}changeDecorations(e,t=0){this._assertNotDisposed();try{return this._onDidChangeDecorations.beginDeferredEmit(),this._changeDecorations(t,e)}finally{this._onDidChangeDecorations.endDeferredEmit()}}_changeDecorations(e,t){const n={addDecoration:(r,s)=>this._deltaDecorationsImpl(e,[],[{range:r,options:s}])[0],changeDecoration:(r,s)=>{this._changeDecorationImpl(r,s)},changeDecorationOptions:(r,s)=>{this._changeDecorationOptionsImpl(r,yse(s))},removeDecoration:r=>{this._deltaDecorationsImpl(e,[r],[])},deltaDecorations:(r,s)=>r.length===0&&s.length===0?[]:this._deltaDecorationsImpl(e,r,s)};let o=null;try{o=t(n)}catch(r){en(r)}return n.addDecoration=$x,n.changeDecoration=$x,n.changeDecorationOptions=$x,n.removeDecoration=$x,n.deltaDecorations=$x,o}deltaDecorations(e,t,n=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."),en(new Error("Invoking deltaDecorations recursively could lead to leaking decorations."))),this._onDidChangeDecorations.beginDeferredEmit(),this._deltaDecorationsImpl(n,e,t)}finally{this._onDidChangeDecorations.endDeferredEmit(),this._deltaDecorationCallCnt--}}_getTrackedRange(e){return this.getDecorationRange(e)}_setTrackedRange(e,t,n){const o=e?this._decorations[e]:null;if(!o)return t?this._deltaDecorationsImpl(0,[],[{range:t,options:Cse[n]}],!0)[0]:null;if(!t)return this._decorationsTree.delete(o),delete this._decorations[o.id],null;const r=this._validateRangeRelaxedNoAllocations(t),s=this._buffer.getOffsetAt(r.startLineNumber,r.startColumn),a=this._buffer.getOffsetAt(r.endLineNumber,r.endColumn);return this._decorationsTree.delete(o),o.reset(this.getVersionId(),s,a,r),o.setOptions(Cse[n]),this._decorationsTree.insert(o),o.id}removeAllDecorationsWithOwnerId(e){if(this._isDisposed)return;const t=this._decorationsTree.collectNodesFromOwner(e);for(let n=0,o=t.length;nthis.getLineCount()?[]:this.getLinesDecorations(e,e,t,n)}getLinesDecorations(e,t,n=0,o=!1,r=!1){const s=this.getLineCount(),a=Math.min(s,Math.max(1,e)),l=Math.min(s,Math.max(1,t)),c=this.getLineMaxColumn(l),u=new V(a,1,l,c),d=this._getDecorationsInRange(u,n,o,r);return jW(d,this._decorationProvider.getDecorationsInRange(u,n,o)),d}getDecorationsInRange(e,t=0,n=!1,o=!1,r=!1){const s=this.validateRange(e),a=this._getDecorationsInRange(s,t,n,r);return jW(a,this._decorationProvider.getDecorationsInRange(s,t,n,o)),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),n=t+this._buffer.getLineLength(e),o=this._decorationsTree.getInjectedTextInInterval(this,t,n,0);return Gd.fromDecorations(o).filter(r=>r.lineNumber===e)}getAllDecorations(e=0,t=!1){let n=this._decorationsTree.getAll(this,e,t,!1,!1);return n=n.concat(this._decorationProvider.getAllDecorations(e,t)),n}getAllMarginDecorations(e=0){return this._decorationsTree.getAll(this,e,!1,!1,!0)}_getDecorationsInRange(e,t,n,o){const r=this._buffer.getOffsetAt(e.startLineNumber,e.startColumn),s=this._buffer.getOffsetAt(e.endLineNumber,e.endColumn);return this._decorationsTree.getAllInInterval(this,r,s,t,n,o)}getRangeAt(e,t){return this._buffer.getRangeAt(e,t-e)}_changeDecorationImpl(e,t){const n=this._decorations[e];if(!n)return;if(n.options.after){const a=this.getDecorationRange(e);this._onDidChangeDecorations.recordLineAffectedByInjectedText(a.endLineNumber)}if(n.options.before){const a=this.getDecorationRange(e);this._onDidChangeDecorations.recordLineAffectedByInjectedText(a.startLineNumber)}const o=this._validateRangeRelaxedNoAllocations(t),r=this._buffer.getOffsetAt(o.startLineNumber,o.startColumn),s=this._buffer.getOffsetAt(o.endLineNumber,o.endColumn);this._decorationsTree.delete(n),n.reset(this.getVersionId(),r,s,o),this._decorationsTree.insert(n),this._onDidChangeDecorations.checkAffectedAndFire(n.options),n.options.after&&this._onDidChangeDecorations.recordLineAffectedByInjectedText(o.endLineNumber),n.options.before&&this._onDidChangeDecorations.recordLineAffectedByInjectedText(o.startLineNumber)}_changeDecorationOptionsImpl(e,t){const n=this._decorations[e];if(!n)return;const o=!!(n.options.overviewRuler&&n.options.overviewRuler.color),r=!!(t.overviewRuler&&t.overviewRuler.color);if(this._onDidChangeDecorations.checkAffectedAndFire(n.options),this._onDidChangeDecorations.checkAffectedAndFire(t),n.options.after||t.after){const s=this._decorationsTree.getNodeRange(this,n);this._onDidChangeDecorations.recordLineAffectedByInjectedText(s.endLineNumber)}if(n.options.before||t.before){const s=this._decorationsTree.getNodeRange(this,n);this._onDidChangeDecorations.recordLineAffectedByInjectedText(s.startLineNumber)}o!==r?(this._decorationsTree.delete(n),n.setOptions(t),this._decorationsTree.insert(n)):n.setOptions(t)}_deltaDecorationsImpl(e,t,n,o=!1){const r=this.getVersionId(),s=t.length;let a=0;const l=n.length;let c=0;this._onDidChangeDecorations.beginDeferredEmit();try{const u=new Array(l);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 Rat(this.getLineContent(e))+1}};bf._MODEL_SYNC_LIMIT=50*1024*1024;bf.LARGE_FILE_SIZE_THRESHOLD=20*1024*1024;bf.LARGE_FILE_LINE_COUNT_THRESHOLD=300*1e3;bf.LARGE_FILE_HEAP_OPERATION_THRESHOLD=256*1024*1024;bf.DEFAULT_CREATION_OPTIONS={isForSimpleWidget:!1,tabSize:vs.tabSize,indentSize:vs.indentSize,insertSpaces:vs.insertSpaces,detectIndentation:!1,defaultEOL:1,trimAutoWhitespace:vs.trimAutoWhitespace,largeFileOptimizations:vs.largeFileOptimizations,bracketPairColorizationOptions:vs.bracketPairColorizationOptions};bf=M_=Eat([v9(4,x5),v9(5,Ki),v9(6,Ti)],bf);function Rat(i){let e=0;for(const t of i)if(t===" "||t===" ")e++;else break;return e}function _9(i){return!!(i.options.overviewRuler&&i.options.overviewRuler.color)}function b9(i){return!!i.options.after||!!i.options.before}class bse{constructor(){this._decorationsTree0=new g9,this._decorationsTree1=new g9,this._injectedTextDecorationsTree=new g9}ensureAllNodesHaveRanges(e){this.getAll(e,0,!1,!1,!1)}_ensureNodesHaveRanges(e,t){for(const n of t)n.range===null&&(n.range=e.getRangeAt(n.cachedAbsoluteStart,n.cachedAbsoluteEnd));return t}getAllInInterval(e,t,n,o,r,s){const a=e.getVersionId(),l=this._intervalSearch(t,n,o,r,a,s);return this._ensureNodesHaveRanges(e,l)}_intervalSearch(e,t,n,o,r,s){const a=this._decorationsTree0.intervalSearch(e,t,n,o,r,s),l=this._decorationsTree1.intervalSearch(e,t,n,o,r,s),c=this._injectedTextDecorationsTree.intervalSearch(e,t,n,o,r,s);return a.concat(l).concat(c)}getInjectedTextInInterval(e,t,n,o){const r=e.getVersionId(),s=this._injectedTextDecorationsTree.intervalSearch(t,n,o,!1,r,!1);return this._ensureNodesHaveRanges(e,s).filter(a=>a.options.showIfCollapsed||!a.range.isEmpty())}getAllInjectedText(e,t){const n=e.getVersionId(),o=this._injectedTextDecorationsTree.search(t,!1,n,!1);return this._ensureNodesHaveRanges(e,o).filter(r=>r.options.showIfCollapsed||!r.range.isEmpty())}getAll(e,t,n,o,r){const s=e.getVersionId(),a=this._search(t,n,o,s,r);return this._ensureNodesHaveRanges(e,a)}_search(e,t,n,o,r){if(n)return this._decorationsTree1.search(e,t,o,r);{const s=this._decorationsTree0.search(e,t,o,r),a=this._decorationsTree1.search(e,t,o,r),l=this._injectedTextDecorationsTree.search(e,t,o,r);return s.concat(a).concat(l)}}collectNodesFromOwner(e){const t=this._decorationsTree0.collectNodesFromOwner(e),n=this._decorationsTree1.collectNodesFromOwner(e),o=this._injectedTextDecorationsTree.collectNodesFromOwner(e);return t.concat(n).concat(o)}collectNodesPostOrder(){const e=this._decorationsTree0.collectNodesPostOrder(),t=this._decorationsTree1.collectNodesPostOrder(),n=this._injectedTextDecorationsTree.collectNodesPostOrder();return e.concat(t).concat(n)}insert(e){b9(e)?this._injectedTextDecorationsTree.insert(e):_9(e)?this._decorationsTree1.insert(e):this._decorationsTree0.insert(e)}delete(e){b9(e)?this._injectedTextDecorationsTree.delete(e):_9(e)?this._decorationsTree1.delete(e):this._decorationsTree0.delete(e)}getNodeRange(e,t){const n=e.getVersionId();return t.cachedVersionId!==n&&this._resolveNode(t,n),t.range===null&&(t.range=e.getRangeAt(t.cachedAbsoluteStart,t.cachedAbsoluteEnd)),t.range}_resolveNode(e,t){b9(e)?this._injectedTextDecorationsTree.resolveNode(e,t):_9(e)?this._decorationsTree1.resolveNode(e,t):this._decorationsTree0.resolveNode(e,t)}acceptReplace(e,t,n,o){this._decorationsTree0.acceptReplace(e,t,n,o),this._decorationsTree1.acceptReplace(e,t,n,o),this._injectedTextDecorationsTree.acceptReplace(e,t,n,o)}}function Zf(i){return i.replace(/[^a-z0-9\-_]/gi," ")}class s1e{constructor(e){this.color=e.color||"",this.darkColor=e.darkColor||""}}class Mat extends s1e{constructor(e){super(e),this._resolvedColor=null,this.position=typeof e.position=="number"?e.position:Yl.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 n=e?t.getColor(e.id):null;return n?n.toString():""}}class Aat{constructor(e){var t;this.position=(t=e==null?void 0:e.position)!==null&&t!==void 0?t:Cy.Left}}class Pat extends s1e{constructor(e){super(e),this.position=e.position}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"?ve.fromHex(e):t.getColor(e.id)}}class Nv{static from(e){return e instanceof Nv?e:new Nv(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 Jt{static register(e){return new Jt(e)}static createDynamic(e){return new Jt(e)}constructor(e){var t,n,o,r,s,a;this.description=e.description,this.blockClassName=e.blockClassName?Zf(e.blockClassName):null,this.blockDoesNotCollapse=(t=e.blockDoesNotCollapse)!==null&&t!==void 0?t:null,this.blockIsAfterEnd=(n=e.blockIsAfterEnd)!==null&&n!==void 0?n:null,this.blockPadding=(o=e.blockPadding)!==null&&o!==void 0?o:null,this.stickiness=e.stickiness||0,this.zIndex=e.zIndex||0,this.className=e.className?Zf(e.className):null,this.shouldFillLineOnLineBreak=(r=e.shouldFillLineOnLineBreak)!==null&&r!==void 0?r:null,this.hoverMessage=e.hoverMessage||null,this.glyphMarginHoverMessage=e.glyphMarginHoverMessage||null,this.isWholeLine=e.isWholeLine||!1,this.showIfCollapsed=e.showIfCollapsed||!1,this.collapseOnReplaceEdit=e.collapseOnReplaceEdit||!1,this.overviewRuler=e.overviewRuler?new Mat(e.overviewRuler):null,this.minimap=e.minimap?new Pat(e.minimap):null,this.glyphMargin=e.glyphMarginClassName?new Aat(e.glyphMargin):null,this.glyphMarginClassName=e.glyphMarginClassName?Zf(e.glyphMarginClassName):null,this.linesDecorationsClassName=e.linesDecorationsClassName?Zf(e.linesDecorationsClassName):null,this.firstLineDecorationClassName=e.firstLineDecorationClassName?Zf(e.firstLineDecorationClassName):null,this.marginClassName=e.marginClassName?Zf(e.marginClassName):null,this.inlineClassName=e.inlineClassName?Zf(e.inlineClassName):null,this.inlineClassNameAffectsLetterSpacing=e.inlineClassNameAffectsLetterSpacing||!1,this.beforeContentClassName=e.beforeContentClassName?Zf(e.beforeContentClassName):null,this.afterContentClassName=e.afterContentClassName?Zf(e.afterContentClassName):null,this.after=e.after?Nv.from(e.after):null,this.before=e.before?Nv.from(e.before):null,this.hideInCommentTokens=(s=e.hideInCommentTokens)!==null&&s!==void 0?s:!1,this.hideInStringTokens=(a=e.hideInStringTokens)!==null&&a!==void 0?a:!1}}Jt.EMPTY=Jt.register({description:"empty"});const Cse=[Jt.register({description:"tracked-range-always-grows-when-typing-at-edges",stickiness:0}),Jt.register({description:"tracked-range-never-grows-when-typing-at-edges",stickiness:1}),Jt.register({description:"tracked-range-grows-only-when-typing-before",stickiness:2}),Jt.register({description:"tracked-range-grows-only-when-typing-after",stickiness:3})];function yse(i){return i instanceof Jt?i:Jt.createDynamic(i)}class Oat extends _e{constructor(e){super(),this.handleBeforeFire=e,this._actual=this._register(new le),this.event=this._actual.event,this._affectedInjectedTextLines=null,this._deferredCnt=0,this._shouldFireDeferred=!1,this._affectsMinimap=!1,this._affectsOverviewRuler=!1,this._affectsGlyphMargin=!1}beginDeferredEmit(){this._deferredCnt++}endDeferredEmit(){var e;this._deferredCnt--,this._deferredCnt===0&&(this._shouldFireDeferred&&this.doFire(),(e=this._affectedInjectedTextLines)===null||e===void 0||e.clear(),this._affectedInjectedTextLines=null)}recordLineAffectedByInjectedText(e){this._affectedInjectedTextLines||(this._affectedInjectedTextLines=new Set),this._affectedInjectedTextLines.add(e)}checkAffectedAndFire(e){this._affectsMinimap||(this._affectsMinimap=!!(e.minimap&&e.minimap.position)),this._affectsOverviewRuler||(this._affectsOverviewRuler=!!(e.overviewRuler&&e.overviewRuler.color)),this._affectsGlyphMargin||(this._affectsGlyphMargin=!!e.glyphMarginClassName),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};this._shouldFireDeferred=!1,this._affectsMinimap=!1,this._affectsOverviewRuler=!1,this._affectsGlyphMargin=!1,this._actual.fire(e)}}class Fat extends _e{constructor(){super(),this._fastEmitter=this._register(new le),this.fastEvent=this._fastEmitter.event,this._slowEmitter=this._register(new le),this.slowEvent=this._slowEmitter.event,this._deferredCnt=0,this._deferredEvent=null}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 Bat{constructor(){this._onDidChangeVisibleRanges=new le,this.onDidChangeVisibleRanges=this._onDidChangeVisibleRanges.event,this._views=new Set}attachView(){const e=new Wat(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 Wat{constructor(e){this.handleStateChange=e}setVisibleLines(e,t){const n=e.map(o=>new ln(o.startLineNumber,o.endLineNumber+1));this.handleStateChange({visibleLineRanges:n,stabilized:t})}}class bP{constructor(e){this._selTrackedRange=null,this._trackSelection=!0,this._setState(e,new Br(new V(1,1,1,1),0,0,new ae(1,1),0),new Br(new V(1,1,1,1),0,0,new ae(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,0))}_removeTrackedRange(e){this._selTrackedRange=e.model._setTrackedRange(this._selTrackedRange,null,0)}asCursorState(){return new kn(this.modelState,this.viewState)}readSelectionFromMarkers(e){const t=e.model._getTrackedRange(this._selTrackedRange);return this.modelState.selection.isEmpty()&&!t.isEmpty()?gt.fromRange(t.collapseToEnd(),this.modelState.selection.getDirection()):gt.fromRange(t,this.modelState.selection.getDirection())}ensureValidState(e){this._setState(e,this.modelState,this.viewState)}setState(e,t,n){this._setState(e,t,n)}static _validatePositionWithCache(e,t,n,o){return t.equals(n)?o:e.normalizePosition(t,2)}static _validateViewState(e,t){const n=t.position,o=t.selectionStart.getStartPosition(),r=t.selectionStart.getEndPosition(),s=e.normalizePosition(n,2),a=this._validatePositionWithCache(e,o,n,s),l=this._validatePositionWithCache(e,r,o,a);return n.equals(s)&&o.equals(a)&&r.equals(l)?t:new Br(V.fromPositions(a,l),t.selectionStartKind,t.selectionStartLeftoverVisibleColumns+o.column-a.column,s,t.leftoverVisibleColumns+n.column-s.column)}_setState(e,t,n){if(n&&(n=bP._validateViewState(e.viewModel,n)),t){const o=e.model.validateRange(t.selectionStart),r=t.selectionStart.equalsRange(o)?t.selectionStartLeftoverVisibleColumns:0,s=e.model.validatePosition(t.position),a=t.position.equals(s)?t.leftoverVisibleColumns:0;t=new Br(o,t.selectionStartKind,r,s,a)}else{if(!n)return;const o=e.model.validateRange(e.coordinatesConverter.convertViewRangeToModelRange(n.selectionStart)),r=e.model.validatePosition(e.coordinatesConverter.convertViewPositionToModelPosition(n.position));t=new Br(o,n.selectionStartKind,n.selectionStartLeftoverVisibleColumns,r,n.leftoverVisibleColumns)}if(n){const o=e.coordinatesConverter.validateViewRange(n.selectionStart,t.selectionStart),r=e.coordinatesConverter.validateViewPosition(n.position,t.position);n=new Br(o,t.selectionStartKind,t.selectionStartLeftoverVisibleColumns,r,t.leftoverVisibleColumns)}else{const o=e.coordinatesConverter.convertModelPositionToViewPosition(new ae(t.selectionStart.startLineNumber,t.selectionStart.startColumn)),r=e.coordinatesConverter.convertModelPositionToViewPosition(new ae(t.selectionStart.endLineNumber,t.selectionStart.endColumn)),s=new V(o.lineNumber,o.column,r.lineNumber,r.column),a=e.coordinatesConverter.convertModelPositionToViewPosition(t.position);n=new Br(s,t.selectionStartKind,t.selectionStartLeftoverVisibleColumns,a,t.leftoverVisibleColumns)}this.modelState=t,this.viewState=n,this._updateTrackedRange(e)}}class wse{constructor(e){this.context=e,this.cursors=[new bP(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 ket(this.cursors,Rc(e=>e.viewState.position,ae.compare)).viewState.position}getBottomMostViewPosition(){return Det(this.cursors,Rc(e=>e.viewState.position,ae.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(kn.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,n=e.length;if(tn){const o=t-n;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 n=0,o=e.length;nn.selection,V.compareRangesUsingStarts));for(let n=0;nd&&p.index--;e.splice(d,1),t.splice(u,1),this._removeSecondaryCursor(d-1),n--}}}}class Sse{constructor(e,t,n,o){this._cursorContextBrand=void 0,this.model=e,this.viewModel=t,this.coordinatesConverter=n,this.cursorConfig=o}}class Vat{constructor(){this.type=0}}class Hat{constructor(){this.type=1}}class $at{constructor(e){this.type=2,this._source=e}hasChanged(e){return this._source.hasChanged(e)}}class zat{constructor(e,t,n){this.selections=e,this.modelSelections=t,this.reason=n,this.type=3}}class K1{constructor(e){this.type=4,e?(this.affectsMinimap=e.affectsMinimap,this.affectsOverviewRuler=e.affectsOverviewRuler,this.affectsGlyphMargin=e.affectsGlyphMargin):(this.affectsMinimap=!0,this.affectsOverviewRuler=!0,this.affectsGlyphMargin=!0)}}class S2{constructor(){this.type=5}}class Uat{constructor(e){this.type=6,this.isFocused=e}}class jat{constructor(){this.type=7}}class x2{constructor(){this.type=8}}class a1e{constructor(e,t){this.fromLineNumber=e,this.count=t,this.type=9}}class NH{constructor(e,t){this.type=10,this.fromLineNumber=e,this.toLineNumber=t}}class RH{constructor(e,t){this.type=11,this.fromLineNumber=e,this.toLineNumber=t}}class fM{constructor(e,t,n,o,r,s,a){this.source=e,this.minimalReveal=t,this.range=n,this.selections=o,this.verticalType=r,this.revealHorizontal=s,this.scrollType=a,this.type=12}}class Kat{constructor(e){this.type=13,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 qat{constructor(e){this.theme=e,this.type=14}}class Gat{constructor(e){this.type=15,this.ranges=e}}class Xat{constructor(){this.type=16}}class Yat{constructor(){this.type=17}}class Zat extends _e{constructor(){super(),this._onEvent=this._register(new le),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,n=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,n=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 n of t)n.handleEvents(e)}}}class Qat{constructor(){this.viewEvents=[],this.outgoingEvents=[]}emitViewEvent(e){this.viewEvents.push(e)}emitOutgoingEvent(e){this.outgoingEvents.push(e)}}class KG{constructor(e,t,n,o){this.kind=0,this._oldContentWidth=e,this._oldContentHeight=t,this.contentWidth=n,this.contentHeight=o,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 KG(this._oldContentWidth,this._oldContentHeight,e.contentWidth,e.contentHeight)}}class qG{constructor(e,t){this.kind=1,this.oldHasFocus=e,this.hasFocus=t}isNoOp(){return this.oldHasFocus===this.hasFocus}attemptToMerge(e){return e.kind!==this.kind?null:new qG(this.oldHasFocus,e.hasFocus)}}class GG{constructor(e,t,n,o,r,s,a,l){this.kind=2,this._oldScrollWidth=e,this._oldScrollLeft=t,this._oldScrollHeight=n,this._oldScrollTop=o,this.scrollWidth=r,this.scrollLeft=s,this.scrollHeight=a,this.scrollTop=l,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 GG(this._oldScrollWidth,this._oldScrollLeft,this._oldScrollHeight,this._oldScrollTop,e.scrollWidth,e.scrollLeft,e.scrollHeight,e.scrollTop)}}class Jat{constructor(){this.kind=3}isNoOp(){return!1}attemptToMerge(e){return e.kind!==this.kind?null:this}}class elt{constructor(){this.kind=4}isNoOp(){return!1}attemptToMerge(e){return e.kind!==this.kind?null:this}}class CP{constructor(e,t,n,o,r,s,a){this.kind=6,this.oldSelections=e,this.selections=t,this.oldModelVersionId=n,this.modelVersionId=o,this.source=r,this.reason=s,this.reachedMaxCursorCount=a}static _selectionsAreEqual(e,t){if(!e&&!t)return!0;if(!e||!t)return!1;const n=e.length,o=t.length;if(n!==o)return!1;for(let r=0;r0){const e=this._cursors.getSelections();for(let t=0;ts&&(o=o.slice(0,s),r=!0);const a=yE.from(this._model,this);return this._cursors.setStates(o),this._cursors.normalize(),this._columnSelectData=null,this._validateAutoClosedActions(),this._emitStateChangedIfNecessary(e,t,n,a,r)}setCursorColumnSelectData(e){this._columnSelectData=e}revealPrimary(e,t,n,o,r,s){const a=this._cursors.getViewPositions();let l=null,c=null;a.length>1?c=this._cursors.getViewSelections():l=V.fromPositions(a[0],a[0]),e.emitViewEvent(new fM(t,n,l,c,o,r,s))}saveState(){const e=[],t=this._cursors.getSelections();for(let n=0,o=t.length;n0){const r=kn.fromModelSelections(n.resultingSelection);this.setStates(e,"modelChange",n.isUndoing?5:n.isRedoing?6:2,r)&&this.revealPrimary(e,"modelChange",!1,0,!0,0)}else{const r=this._cursors.readSelectionFromMarkers();this.setStates(e,"modelChange",2,kn.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(),n=e.viewState.position;return{isReal:!1,fromViewLineNumber:t.lineNumber,fromViewVisualColumn:this.context.cursorConfig.visibleColumnFromColumn(this._viewModel,t),toViewLineNumber:n.lineNumber,toViewVisualColumn:this.context.cursorConfig.visibleColumnFromColumn(this._viewModel,n)}}getSelections(){return this._cursors.getSelections()}setSelections(e,t,n,o){this.setStates(e,t,o,kn.fromModelSelections(n))}getPrevEditOperationType(){return this._prevEditOperationType}setPrevEditOperationType(e){this._prevEditOperationType=e}_pushAutoClosedAction(e,t){const n=[],o=[];for(let a=0,l=e.length;a0&&this._pushAutoClosedAction(n,o),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,n,o,r){const s=yE.from(this._model,this);if(s.equals(o))return!1;const a=this._cursors.getSelections(),l=this._cursors.getViewSelections();if(e.emitViewEvent(new zat(l,a,n)),!o||o.cursorState.length!==s.cursorState.length||s.cursorState.some((c,u)=>!c.modelState.equals(o.cursorState[u].modelState))){const c=o?o.cursorState.map(d=>d.modelState.selection):null,u=o?o.modelVersionId:0;e.emitOutgoingEvent(new CP(c,a,u,s.modelVersionId,t||"keyboard",n,r))}return!0}_findAutoClosingPairs(e){if(!e.length)return null;const t=[];for(let n=0,o=e.length;n=0)return null;const s=r.text.match(/([)\]}>'"`])([^)\]}>'"`]*)$/);if(!s)return null;const a=s[1],l=this.context.cursorConfig.autoClosingPairs.autoClosingPairsCloseSingleChar.get(a);if(!l||l.length!==1)return null;const c=l[0].open,u=r.text.length-s[2].length-1,d=r.text.lastIndexOf(c,u-1);if(d===-1)return null;t.push([d,u])}return t}executeEdits(e,t,n,o){let r=null;t==="snippet"&&(r=this._findAutoClosingPairs(n)),r&&(n[0]._isTracked=!0);const s=[],a=[],l=this._model.pushEditOperations(this.getSelections(),n,c=>{if(r)for(let d=0,h=r.length;d0&&this._pushAutoClosedAction(s,a)}_executeEdit(e,t,n,o=0){if(this.context.cursorConfig.readOnly)return;const r=yE.from(this._model,this);this._cursors.stopTrackingSelections(),this._isHandling=!0;try{this._cursors.ensureValidState(),e()}catch(s){en(s)}this._isHandling=!1,this._cursors.startTrackingSelections(),this._validateAutoClosedActions(),this._emitStateChangedIfNecessary(t,n,o,r,!1)&&this.revealPrimary(t,n,!1,0,!0,0)}getAutoClosedCharacters(){return xse.getAllAutoClosedCharacters(this._autoClosedActions)}startComposition(e){this._compositionState=new wE(this._model,this.getSelections())}endComposition(e,t){const n=this._compositionState?this._compositionState.deduceOutcome(this._model,this.getSelections()):null;this._compositionState=null,this._executeEdit(()=>{t==="keyboard"&&this._executeEditOperation(eo.compositionEndWithInterceptors(this._prevEditOperationType,this.context.cursorConfig,this._model,n,this.getSelections(),this.getAutoClosedCharacters()))},e,t)}type(e,t,n){this._executeEdit(()=>{if(n==="keyboard"){const o=t.length;let r=0;for(;r{const c=l.getPosition();return new gt(c.lineNumber,c.column+r,c.lineNumber,c.column+r)});this.setSelections(e,s,a,0)}return}this._executeEdit(()=>{this._executeEditOperation(eo.compositionType(this._prevEditOperationType,this.context.cursorConfig,this._model,this.getSelections(),t,n,o,r))},e,s)}paste(e,t,n,o,r){this._executeEdit(()=>{this._executeEditOperation(eo.paste(this.context.cursorConfig,this._model,this.getSelections(),t,n,o||[]))},e,r,4)}cut(e,t){this._executeEdit(()=>{this._executeEditOperation(nb.cut(this.context.cursorConfig,this._model,this.getSelections()))},e,t)}executeCommand(e,t,n){this._executeEdit(()=>{this._cursors.killSecondaryCursors(),this._executeEditOperation(new Sa(0,[t],{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!1}))},e,n)}executeCommands(e,t,n){this._executeEdit(()=>{this._executeEditOperation(new Sa(0,t,{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!1}))},e,n)}}class yE{static from(e,t){return new yE(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,n=this.cursorState.length;t=t.length||!t[n].strictContainsRange(e[n]))return!1;return!0}}class clt{static executeCommands(e,t,n){const o={model:e,selectionsBefore:t,trackedRanges:[],trackedRangesDirection:[]},r=this._innerExecuteCommands(o,n);for(let s=0,a=o.trackedRanges.length;s0&&(s[0]._isTracked=!0);let a=e.model.pushEditOperations(e.selectionsBefore,s,c=>{const u=[];for(let f=0;ff.identifier.minor-g.identifier.minor,h=[];for(let f=0;f0?(u[f].sort(d),h[f]=t[f].computeCursorState(e.model,{getInverseEditOperations:()=>u[f],getTrackedSelection:g=>{const p=parseInt(g,10),v=e.model._getTrackedRange(e.trackedRanges[p]);return e.trackedRangesDirection[p]===0?new gt(v.startLineNumber,v.startColumn,v.endLineNumber,v.endColumn):new gt(v.endLineNumber,v.endColumn,v.startLineNumber,v.startColumn)}})):h[f]=e.selectionsBefore[f];return h});a||(a=e.selectionsBefore);const l=[];for(const c in r)r.hasOwnProperty(c)&&l.push(parseInt(c,10));l.sort((c,u)=>u-c);for(const c of l)a.splice(c,1);return a}static _arrayIsEmpty(e){for(let t=0,n=e.length;t{V.isEmpty(d)&&h===""||o.push({identifier:{major:t,minor:r++},range:d,text:h,forceMoveMarkers:f,isAutoWhitespaceEdit:n.insertsAutoWhitespace})};let a=!1;const u={addEditOperation:s,addTrackedEditOperation:(d,h,f)=>{a=!0,s(d,h,f)},trackSelection:(d,h)=>{const f=gt.liftSelection(d);let g;if(f.isEmpty())if(typeof h=="boolean")h?g=2:g=3;else{const m=e.model.getLineMaxColumn(f.startLineNumber);f.startColumn===m?g=2:g=3}else g=1;const p=e.trackedRanges.length,v=e.model._setTrackedRange(null,f,g);return e.trackedRanges[p]=v,e.trackedRangesDirection[p]=f.getDirection(),p.toString()}};try{n.getEditOperations(e.model,u)}catch(d){return en(d),{operations:[],hadTrackedEditOperation:!1}}return{operations:o,hadTrackedEditOperation:a}}static _getLoserCursorMap(e){e=e.slice(0),e.sort((n,o)=>-V.compareRangesUsingEnds(n.range,o.range));const t={};for(let n=1;nr.identifier.major?s=o.identifier.major:s=r.identifier.major,t[s.toString()]=!0;for(let a=0;a0&&n--}}return t}}class ult{constructor(e,t,n){this.text=e,this.startSelection=t,this.endSelection=n}}class wE{static _capture(e,t){const n=[];for(const o of t){if(o.startLineNumber!==o.endLineNumber)return null;n.push(new ult(e.getLineContent(o.startLineNumber),o.startColumn-1,o.endColumn-1))}return n}constructor(e,t){this._original=wE._capture(e,t)}deduceOutcome(e,t){if(!this._original)return null;const n=wE._capture(e,t);if(!n||this._original.length!==n.length)return null;const o=[];for(let r=0,s=this._original.length;rCw,tokenizeEncoded:(i,e,t)=>d5(0,t)};function hlt(i,e,t){return dlt(this,void 0,void 0,function*(){if(!t)return Ese(e,i.languageIdCodec,Lse);const n=yield oo.getOrCreate(t);return Ese(e,i.languageIdCodec,n||Lse)})}function flt(i,e,t,n,o,r,s){let a="
",l=n,c=0,u=!0;for(let d=0,h=e.getCount();d0;)s&&u?(g+=" ",u=!1):(g+=" ",u=!0),v--;break}case 60:g+="<",u=!1;break;case 62:g+=">",u=!1;break;case 38:g+="&",u=!1;break;case 0:g+="�",u=!1;break;case 65279:case 8232:case 8233:case 133:g+="\uFFFD",u=!1;break;case 13:g+="​",u=!1;break;case 32:s&&u?(g+=" ",u=!1):(g+=" ",u=!0);break;default:g+=String.fromCharCode(p),u=!1}}if(a+=`${g}`,f>o||l>=o)break}return a+="
",a}function Ese(i,e,t){let n='
';const o=gf(i);let r=t.getInitialState();for(let s=0,a=o.length;s0&&(n+="
");const c=t.tokenizeEncoded(l,!0,r);pr.convertToEndOffset(c.tokens,l.length);const d=new pr(c.tokens,l,e).inflate();let h=0;for(let f=0,g=d.getCount();f${$A(l.substring(h,v))}`,h=v}r=c.endState}return n+="
",n}class glt{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,n=this._changes,o=this._removes;this._hasPending=!1,this._inserts=[],this._changes=[],this._removes=[],e._commitPendingChanges(t,n,o)}}class plt{constructor(e,t,n,o,r){this.id=e,this.afterLineNumber=t,this.ordinal=n,this.height=o,this.minWidth=r,this.prefixSum=0}}class ck{constructor(e,t,n,o){this._instanceId=K_e(++ck.INSTANCE_COUNT),this._pendingChanges=new glt,this._lastWhitespaceId=0,this._arr=[],this._prefixSumValidIndex=-1,this._minWidth=-1,this._lineCount=e,this._lineHeight=t,this._paddingTop=n,this._paddingBottom=o}static findInsertionIndex(e,t,n){let o=0,r=e.length;for(;o>>1;t===e[s].afterLineNumber?n{t=!0,o=o|0,r=r|0,s=s|0,a=a|0;const l=this._instanceId+ ++this._lastWhitespaceId;return this._pendingChanges.insert(new plt(l,o,r,s,a)),l},changeOneWhitespace:(o,r,s)=>{t=!0,r=r|0,s=s|0,this._pendingChanges.change({id:o,newAfterLineNumber:r,newHeight:s})},removeWhitespace:o=>{t=!0,this._pendingChanges.remove({id:o})}})}finally{this._pendingChanges.commit(this)}return t}_commitPendingChanges(e,t,n){if((e.length>0||n.length>0)&&(this._minWidth=-1),e.length+t.length+n.length<=1){for(const l of e)this._insertWhitespace(l);for(const l of t)this._changeOneWhitespace(l.id,l.newAfterLineNumber,l.newHeight);for(const l of n){const c=this._findWhitespaceIndex(l.id);c!==-1&&this._removeWhitespace(c)}return}const o=new Set;for(const l of n)o.add(l.id);const r=new Map;for(const l of t)r.set(l.id,l);const s=l=>{const c=[];for(const u of l)if(!o.has(u.id)){if(r.has(u.id)){const d=r.get(u.id);u.afterLineNumber=d.newAfterLineNumber,u.height=d.newHeight}c.push(u)}return c},a=s(this._arr).concat(s(e));a.sort((l,c)=>l.afterLineNumber===c.afterLineNumber?l.ordinal-c.ordinal:l.afterLineNumber-c.afterLineNumber),this._arr=a,this._prefixSumValidIndex=-1}_checkPendingChanges(){this._pendingChanges.mustCommit()&&this._pendingChanges.commit(this)}_insertWhitespace(e){const t=ck.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 n=0,o=t.length;nt&&(this._arr[n].afterLineNumber-=t-e+1)}}onLinesInserted(e,t){this._checkPendingChanges(),e=e|0,t=t|0,this._lineCount+=t-e+1;for(let n=0,o=this._arr.length;n=t.length||t[a+1].afterLineNumber>=e)return a;n=a+1|0}else o=a-1|0}return-1}_findFirstWhitespaceAfterLineNumber(e){e=e|0;const n=this._findLastWhitespaceBeforeLineNumber(e)+1;return n1?n=this._lineHeight*(e-1):n=0;const o=this.getWhitespaceAccumulatedHeightBeforeLineNumber(e-(t?1:0));return n+o+this._paddingTop}getVerticalOffsetAfterLineNumber(e,t=!1){this._checkPendingChanges(),e=e|0;const n=this._lineHeight*e,o=this.getWhitespaceAccumulatedHeightBeforeLineNumber(e+(t?1:0));return n+o+this._paddingTop}getWhitespaceMinWidth(){if(this._checkPendingChanges(),this._minWidth===-1){let e=0;for(let t=0,n=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,n=this._lineHeight;let o=1,r=t;for(;o=a+n)o=s+1;else{if(e>=a)return s;r=s}}return o>t?t:o}getLinesViewportData(e,t){this._checkPendingChanges(),e=e|0,t=t|0;const n=this._lineHeight,o=this.getLineNumberAtOrAfterVerticalOffset(e)|0,r=this.getVerticalOffsetForLineNumber(o)|0;let s=this._lineCount|0,a=this.getFirstWhitespaceIndexAfterLineNumber(o)|0;const l=this.getWhitespacesCount()|0;let c,u;a===-1?(a=l,u=s+1,c=0):(u=this.getAfterLineNumberForWhitespaceIndex(a)|0,c=this.getHeightForWhitespaceIndex(a)|0);let d=r,h=d;const f=5e5;let g=0;r>=f&&(g=Math.floor(r/f)*f,g=Math.floor(g/n)*n,h-=g);const p=[],v=e+(t-e)/2;let m=-1;for(let L=o;L<=s;L++){if(m===-1){const D=d,E=d+n;(D<=v&&vv)&&(m=L)}for(d+=n,p[L-o]=h,h+=n;u===L;)h+=c,d+=c,a++,a>=l?u=s+1:(u=this.getAfterLineNumberForWhitespaceIndex(a)|0,c=this.getHeightForWhitespaceIndex(a)|0);if(d>=t){s=L;break}}m===-1&&(m=s);const _=this.getVerticalOffsetForLineNumber(s)|0;let y=o,w=s;return yt&&w--,{bigNumbersDelta:g,startLineNumber:o,endLineNumber:s,relativeVerticalOffset:p,centeredLineNumber:m,completelyVisibleStartLineNumber:y,completelyVisibleEndLineNumber:w}}getVerticalOffsetForWhitespaceIndex(e){this._checkPendingChanges(),e=e|0;const t=this.getAfterLineNumberForWhitespaceIndex(e);let n;t>=1?n=this._lineHeight*t:n=0;let o;return e>0?o=this.getWhitespacesAccumulatedHeight(e-1):o=0,n+o+this._paddingTop}getWhitespaceIndexAtOrAfterVerticallOffset(e){this._checkPendingChanges(),e=e|0;let t=0,n=this.getWhitespacesCount()-1;if(n<0)return-1;const o=this.getVerticalOffsetForWhitespaceIndex(n),r=this.getHeightForWhitespaceIndex(n);if(e>=o+r)return-1;for(;t=a+l)t=s+1;else{if(e>=a)return s;n=s}}return t}getWhitespaceAtVerticalOffset(e){this._checkPendingChanges(),e=e|0;const t=this.getWhitespaceIndexAtOrAfterVerticallOffset(e);if(t<0||t>=this.getWhitespacesCount())return null;const n=this.getVerticalOffsetForWhitespaceIndex(t);if(n>e)return null;const o=this.getHeightForWhitespaceIndex(t),r=this.getIdForWhitespaceIndex(t),s=this.getAfterLineNumberForWhitespaceIndex(t);return{id:r,afterLineNumber:s,verticalOffset:n,height:o}}getWhitespaceViewportData(e,t){this._checkPendingChanges(),e=e|0,t=t|0;const n=this.getWhitespaceIndexAtOrAfterVerticallOffset(e),o=this.getWhitespacesCount()-1;if(n<0)return[];const r=[];for(let s=n;s<=o;s++){const a=this.getVerticalOffsetForWhitespaceIndex(s),l=this.getHeightForWhitespaceIndex(s);if(a>=t)break;r.push({id:this.getIdForWhitespaceIndex(s),afterLineNumber:this.getAfterLineNumberForWhitespaceIndex(s),verticalOffset:a,height:l})}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}}ck.INSTANCE_COUNT=0;const mlt=125;class kL{constructor(e,t,n,o){e=e|0,t=t|0,n=n|0,o=o|0,e<0&&(e=0),t<0&&(t=0),n<0&&(n=0),o<0&&(o=0),this.width=e,this.contentWidth=t,this.scrollWidth=Math.max(e,t),this.height=n,this.contentHeight=o,this.scrollHeight=Math.max(n,o)}equals(e){return this.width===e.width&&this.contentWidth===e.contentWidth&&this.height===e.height&&this.contentHeight===e.contentHeight}}class vlt extends _e{constructor(e,t){super(),this._onDidContentSizeChange=this._register(new le),this.onDidContentSizeChange=this._onDidContentSizeChange.event,this._dimensions=new kL(0,0,0,0),this._scrollable=this._register(new XI({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 n=t.contentWidth!==e.contentWidth,o=t.contentHeight!==e.contentHeight;(n||o)&&this._onDidContentSizeChange.fire(new KG(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 _lt extends _e{constructor(e,t,n){super(),this._configuration=e;const o=this._configuration.options,r=o.get(143),s=o.get(83);this._linesLayout=new ck(t,o.get(66),s.top,s.bottom),this._maxLineWidth=0,this._overlayWidgetsMinWidth=0,this._scrollable=this._register(new vlt(0,n)),this._configureSmoothScrollDuration(),this._scrollable.setScrollDimensions(new kL(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(113)?mlt:0)}onConfigurationChanged(e){const t=this._configuration.options;if(e.hasChanged(66)&&this._linesLayout.setLineHeight(t.get(66)),e.hasChanged(83)){const n=t.get(83);this._linesLayout.setPadding(n.top,n.bottom)}if(e.hasChanged(143)){const n=t.get(143),o=n.contentWidth,r=n.height,s=this._scrollable.getScrollDimensions(),a=s.contentWidth;this._scrollable.setScrollDimensions(new kL(o,s.contentWidth,r,this._getContentHeight(o,r,a)))}else this._updateHeight();e.hasChanged(113)&&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 o=this._configuration.options.get(102);return o.horizontal===2||e>=t?0:o.horizontalScrollbarSize}_getContentHeight(e,t,n){const o=this._configuration.options;let r=this._linesLayout.getLinesTotalHeight();return o.get(104)?r+=Math.max(0,t-o.get(66)-o.get(83).bottom):r+=this._getHorizontalScrollbarHeight(e,n),r}_updateHeight(){const e=this._scrollable.getScrollDimensions(),t=e.width,n=e.height,o=e.contentWidth;this._scrollable.setScrollDimensions(new kL(t,e.contentWidth,n,this._getContentHeight(t,n,o)))}getCurrentViewport(){const e=this._scrollable.getScrollDimensions(),t=this._scrollable.getCurrentScrollPosition();return new bre(t.scrollTop,t.scrollLeft,e.width,e.height)}getFutureViewport(){const e=this._scrollable.getScrollDimensions(),t=this._scrollable.getFutureScrollPosition();return new bre(t.scrollTop,t.scrollLeft,e.width,e.height)}_computeContentWidth(){const e=this._configuration.options,t=this._maxLineWidth,n=e.get(144),o=e.get(50),r=e.get(143);if(n.isViewportWrapping){const s=e.get(72);return t>r.contentWidth+o.typicalHalfwidthCharacterWidth&&s.enabled&&s.side==="right"?t+r.verticalScrollbarWidth:t}else{const s=e.get(103)*o.typicalHalfwidthCharacterWidth,a=this._linesLayout.getWhitespaceMinWidth();return Math.max(t+s+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 kL(e.width,this._computeContentWidth(),e.height,e.contentHeight)),this._updateHeight()}saveState(){const e=this._scrollable.getFutureScrollPosition(),t=e.scrollTop,n=this._linesLayout.getLineNumberAtOrAfterVerticalOffset(t),o=this._linesLayout.getWhitespaceAccumulatedHeightBeforeLineNumber(n);return{scrollTop:t,scrollTopWithoutViewZones:t-o,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===1?this._scrollable.setScrollPositionNow(e):this._scrollable.setScrollPositionSmooth(e)}hasPendingScrollAnimation(){return this._scrollable.hasPendingScrollAnimation()}deltaScrollNow(e,t){const n=this._scrollable.getCurrentScrollPosition();this._scrollable.setScrollPositionNow({scrollLeft:n.scrollLeft+e,scrollTop:n.scrollTop+t})}}class blt{constructor(e,t,n,o,r){this.editorId=e,this.model=t,this.configuration=n,this._linesCollection=o,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 n=this._decorationsCache[t];if(!n){const o=e.range,r=e.options;let s;if(r.isWholeLine){const a=this._coordinatesConverter.convertModelPositionToViewPosition(new ae(o.startLineNumber,1),0,!1,!0),l=this._coordinatesConverter.convertModelPositionToViewPosition(new ae(o.endLineNumber,this.model.getLineMaxColumn(o.endLineNumber)),1);s=new V(a.lineNumber,a.column,l.lineNumber,l.column)}else s=this._coordinatesConverter.convertModelRangeToViewRange(o,1);n=new Z0e(s,r),this._decorationsCache[t]=n}return n}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,n=!1){const o=new V(e,this._linesCollection.getViewLineMinColumn(e),e,this._linesCollection.getViewLineMaxColumn(e));return this._getDecorationsInRange(o,t,n).inlineDecorations[0]}_getDecorationsInRange(e,t,n){const o=this._linesCollection.getDecorationsInRange(e,this.editorId,PA(this.configuration.options),t,n),r=e.startLineNumber,s=e.endLineNumber,a=[];let l=0;const c=[];for(let u=r;u<=s;u++)c[u-r]=[];for(let u=0,d=o.length;ut===1)}function ZG(i,e){return l1e(i,e.range,t=>t===2)}function l1e(i,e,t){for(let n=e.startLineNumber;n<=e.endLineNumber;n++){const o=i.tokenization.getLineTokens(n),r=n===e.startLineNumber,s=n===e.endLineNumber;let a=r?o.findTokenIndexAtOffset(e.startColumn-1):0;for(;ae.endColumn-1);){if(!t(o.getStandardTokenType(a)))return!1;a++}}return!0}function C9(i,e){return i===null?e?yP.INSTANCE:wP.INSTANCE:new Clt(i,e)}class Clt{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,n){this._assertVisible();const o=n>0?this._projectionData.breakOffsets[n-1]:0,r=this._projectionData.breakOffsets[n];let s;if(this._projectionData.injectionOffsets!==null){const a=this._projectionData.injectionOffsets.map((c,u)=>new Gd(0,0,c+1,this._projectionData.injectionOptions[u],0));s=Gd.applyInjectedText(e.getLineContent(t),a).substring(o,r)}else s=e.getValueInRange({startLineNumber:t,startColumn:o+1,endLineNumber:t,endColumn:r+1});return n>0&&(s=Dse(this._projectionData.wrappedTextIndentLength)+s),s}getViewLineLength(e,t,n){return this._assertVisible(),this._projectionData.getLineLength(n)}getViewLineMinColumn(e,t,n){return this._assertVisible(),this._projectionData.getMinOutputOffset(n)+1}getViewLineMaxColumn(e,t,n){return this._assertVisible(),this._projectionData.getMaxOutputOffset(n)+1}getViewLineData(e,t,n){const o=new Array;return this.getViewLinesData(e,t,n,1,0,[!0],o),o[0]}getViewLinesData(e,t,n,o,r,s,a){this._assertVisible();const l=this._projectionData,c=l.injectionOffsets,u=l.injectionOptions;let d=null;if(c){d=[];let f=0,g=0;for(let p=0;p0?l.breakOffsets[p-1]:0,_=l.breakOffsets[p];for(;g_)break;if(m0?l.wrappedTextIndentLength:0,I=E+Math.max(w-m,0),k=E+Math.min(L-m,_-m);I!==k&&v.push(new Dtt(I,k,D.inlineClassName,D.inlineClassNameAffectsLetterSpacing))}}if(L<=_)f+=y,g++;else break}}}let h;c?h=e.tokenization.getLineTokens(t).withInserted(c.map((f,g)=>({offset:f,text:u[g].content,tokenMetadata:pr.defaultTokenMetadata}))):h=e.tokenization.getLineTokens(t);for(let f=n;f0?o.wrappedTextIndentLength:0,s=n>0?o.breakOffsets[n-1]:0,a=o.breakOffsets[n],l=e.sliceAndInflate(s,a,r);let c=l.getLineContent();n>0&&(c=Dse(o.wrappedTextIndentLength)+c);const u=this._projectionData.getMinOutputOffset(n)+1,d=c.length+1,h=n+1=y9.length)for(let e=1;e<=i;e++)y9[e]=ylt(e);return y9[i]}function ylt(i){return new Array(i+1).join(" ")}class wlt{constructor(e,t,n,o,r,s,a,l,c,u){this._editorId=e,this.model=t,this._validModelVersionId=-1,this._domLineBreaksComputerFactory=n,this._monospaceLineBreaksComputerFactory=o,this.fontInfo=r,this.tabSize=s,this.wrappingStrategy=a,this.wrappingColumn=l,this.wrappingIndent=c,this.wordBreak=u,this._constructLines(!0,null)}dispose(){this.hiddenAreasDecorationIds=this.model.deltaDecorations(this.hiddenAreasDecorationIds,[])}createCoordinatesConverter(){return new xlt(this)}_constructLines(e,t){this.modelLineProjections=[],e&&(this.hiddenAreasDecorationIds=this.model.deltaDecorations(this.hiddenAreasDecorationIds,[]));const n=this.model.getLinesContent(),o=this.model.getInjectedTextDecorations(this._editorId),r=n.length,s=this.createLineBreaksComputer(),a=new sp(Gd.fromDecorations(o));for(let p=0;pm.lineNumber===p+1);s.addRequest(n[p],v,t?t[p]:null)}const l=s.finalize(),c=[],u=this.hiddenAreasDecorationIds.map(p=>this.model.getDecorationRange(p)).sort(V.compareRangesUsingStarts);let d=1,h=0,f=-1,g=f+1=d&&v<=h,_=C9(l[p],!m);c[p]=_.getViewLineCount(),this.modelLineProjections[p]=_}this._validModelVersionId=this.model.getVersionId(),this.projectedModelLineLineCounts=new ret(c)}getHiddenAreas(){return this.hiddenAreasDecorationIds.map(e=>this.model.getDecorationRange(e))}setHiddenAreas(e){const t=e.map(h=>this.model.validateRange(h)),n=Slt(t),o=this.hiddenAreasDecorationIds.map(h=>this.model.getDecorationRange(h)).sort(V.compareRangesUsingStarts);if(n.length===o.length){let h=!1;for(let f=0;f({range:h,options:Jt.EMPTY}));this.hiddenAreasDecorationIds=this.model.deltaDecorations(this.hiddenAreasDecorationIds,r);const s=n;let a=1,l=0,c=-1,u=c+1=a&&f<=l?this.modelLineProjections[h].isVisible()&&(this.modelLineProjections[h]=this.modelLineProjections[h].setVisible(!1),g=!0):(d=!0,this.modelLineProjections[h].isVisible()||(this.modelLineProjections[h]=this.modelLineProjections[h].setVisible(!0),g=!0)),g){const p=this.modelLineProjections[h].getViewLineCount();this.projectedModelLineLineCounts.setValue(h,p)}}return d||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,n,o,r){const s=this.fontInfo.equals(e),a=this.wrappingStrategy===t,l=this.wrappingColumn===n,c=this.wrappingIndent===o,u=this.wordBreak===r;if(s&&a&&l&&c&&u)return!1;const d=s&&a&&!l&&c&&u;this.fontInfo=e,this.wrappingStrategy=t,this.wrappingColumn=n,this.wrappingIndent=o,this.wordBreak=r;let h=null;if(d){h=[];for(let f=0,g=this.modelLineProjections.length;f2&&!this.modelLineProjections[t-2].isVisible(),s=t===1?1:this.projectedModelLineLineCounts.getPrefixSum(t-1)+1;let a=0;const l=[],c=[];for(let u=0,d=o.length;ul?(u=this.projectedModelLineLineCounts.getPrefixSum(t-1)+1,d=u+l-1,g=d+1,p=g+(r-l)-1,c=!0):rt?t:e|0}getActiveIndentGuide(e,t,n){e=this._toValidViewLineNumber(e),t=this._toValidViewLineNumber(t),n=this._toValidViewLineNumber(n);const o=this.convertViewPositionToModelPosition(e,this.getViewLineMinColumn(e)),r=this.convertViewPositionToModelPosition(t,this.getViewLineMinColumn(t)),s=this.convertViewPositionToModelPosition(n,this.getViewLineMinColumn(n)),a=this.model.guides.getActiveIndentGuide(o.lineNumber,r.lineNumber,s.lineNumber),l=this.convertModelPositionToViewPosition(a.startLineNumber,1),c=this.convertModelPositionToViewPosition(a.endLineNumber,this.model.getLineMaxColumn(a.endLineNumber));return{startLineNumber:l.lineNumber,endLineNumber:c.lineNumber,indent:a.indent}}getViewLineInfo(e){e=this._toValidViewLineNumber(e);const t=this.projectedModelLineLineCounts.getIndexOf(e-1),n=t.index,o=t.remainder;return new kse(n+1,o)}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],n=t.getViewLineMinColumn(this.model,e.modelLineNumber,e.modelLineWrappedLineIdx),o=t.getModelColumnOfViewPosition(e.modelLineWrappedLineIdx,n);return new ae(e.modelLineNumber,o)}getModelEndPositionOfViewLine(e){const t=this.modelLineProjections[e.modelLineNumber-1],n=t.getViewLineMaxColumn(this.model,e.modelLineNumber,e.modelLineWrappedLineIdx),o=t.getModelColumnOfViewPosition(e.modelLineWrappedLineIdx,n);return new ae(e.modelLineNumber,o)}getViewLineInfosGroupedByModelRanges(e,t){const n=this.getViewLineInfo(e),o=this.getViewLineInfo(t),r=new Array;let s=this.getModelStartPositionOfViewLine(n),a=new Array;for(let l=n.modelLineNumber;l<=o.modelLineNumber;l++){const c=this.modelLineProjections[l-1];if(c.isVisible()){const u=l===n.modelLineNumber?n.modelLineWrappedLineIdx:0,d=l===o.modelLineNumber?o.modelLineWrappedLineIdx+1:c.getViewLineCount();for(let h=u;h{if(f.forWrappedLinesAfterColumn!==-1&&this.modelLineProjections[u.modelLineNumber-1].getViewPositionOfModelPosition(0,f.forWrappedLinesAfterColumn).lineNumber>=u.modelLineWrappedLineIdx||f.forWrappedLinesBeforeOrAtColumn!==-1&&this.modelLineProjections[u.modelLineNumber-1].getViewPositionOfModelPosition(0,f.forWrappedLinesBeforeOrAtColumn).lineNumberu.modelLineWrappedLineIdx)return}const p=this.convertModelPositionToViewPosition(u.modelLineNumber,f.horizontalLine.endColumn),v=this.modelLineProjections[u.modelLineNumber-1].getViewPositionOfModelPosition(0,f.horizontalLine.endColumn);return v.lineNumber===u.modelLineWrappedLineIdx?new p0(f.visibleColumn,g,f.className,new gE(f.horizontalLine.top,p.column),-1,-1):v.lineNumber!!f))}}return s}getViewLinesIndentGuides(e,t){e=this._toValidViewLineNumber(e),t=this._toValidViewLineNumber(t);const n=this.convertViewPositionToModelPosition(e,this.getViewLineMinColumn(e)),o=this.convertViewPositionToModelPosition(t,this.getViewLineMaxColumn(t));let r=[];const s=[],a=[],l=n.lineNumber-1,c=o.lineNumber-1;let u=null;for(let g=l;g<=c;g++){const p=this.modelLineProjections[g];if(p.isVisible()){const v=p.getViewLineNumberOfModelPosition(0,g===l?n.column:1),m=p.getViewLineNumberOfModelPosition(0,this.model.getLineMaxColumn(g+1)),_=m-v+1;let y=0;_>1&&p.getViewLineMinColumn(this.model,g+1,m)===1&&(y=v===0?1:2),s.push(_),a.push(y),u===null&&(u=new ae(g+1,0))}else u!==null&&(r=r.concat(this.model.guides.getLinesIndentGuides(u.lineNumber,g)),u=null)}u!==null&&(r=r.concat(this.model.guides.getLinesIndentGuides(u.lineNumber,o.lineNumber)),u=null);const d=t-e+1,h=new Array(d);let f=0;for(let g=0,p=r.length;gt&&(g=!0,f=t-r+1),d.getViewLinesData(this.model,c+1,h,f,r-e,n,l),r+=f,g)break}return l}validateViewPosition(e,t,n){e=this._toValidViewLineNumber(e);const o=this.projectedModelLineLineCounts.getIndexOf(e-1),r=o.index,s=o.remainder,a=this.modelLineProjections[r],l=a.getViewLineMinColumn(this.model,r+1,s),c=a.getViewLineMaxColumn(this.model,r+1,s);tc&&(t=c);const u=a.getModelColumnOfViewPosition(s,t);return this.model.validatePosition(new ae(r+1,u)).equals(n)?new ae(e,t):this.convertModelPositionToViewPosition(n.lineNumber,n.column)}validateViewRange(e,t){const n=this.validateViewPosition(e.startLineNumber,e.startColumn,t.getStartPosition()),o=this.validateViewPosition(e.endLineNumber,e.endColumn,t.getEndPosition());return new V(n.lineNumber,n.column,o.lineNumber,o.column)}convertViewPositionToModelPosition(e,t){const n=this.getViewLineInfo(e),o=this.modelLineProjections[n.modelLineNumber-1].getModelColumnOfViewPosition(n.modelLineWrappedLineIdx,t);return this.model.validatePosition(new ae(n.modelLineNumber,o))}convertViewRangeToModelRange(e){const t=this.convertViewPositionToModelPosition(e.startLineNumber,e.startColumn),n=this.convertViewPositionToModelPosition(e.endLineNumber,e.endColumn);return new V(t.lineNumber,t.column,n.lineNumber,n.column)}convertModelPositionToViewPosition(e,t,n=2,o=!1,r=!1){const s=this.model.validatePosition(new ae(e,t)),a=s.lineNumber,l=s.column;let c=a-1,u=!1;if(r)for(;c0&&!this.modelLineProjections[c].isVisible();)c--,u=!0;if(c===0&&!this.modelLineProjections[c].isVisible())return new ae(o?0:1,1);const d=1+this.projectedModelLineLineCounts.getPrefixSum(c);let h;return u?r?h=this.modelLineProjections[c].getViewPositionOfModelPosition(d,1,n):h=this.modelLineProjections[c].getViewPositionOfModelPosition(d,this.model.getLineMaxColumn(c+1),n):h=this.modelLineProjections[a-1].getViewPositionOfModelPosition(d,l,n),h}convertModelRangeToViewRange(e,t=0){if(e.isEmpty()){const n=this.convertModelPositionToViewPosition(e.startLineNumber,e.startColumn,t);return V.fromPositions(n)}else{const n=this.convertModelPositionToViewPosition(e.startLineNumber,e.startColumn,1),o=this.convertModelPositionToViewPosition(e.endLineNumber,e.endColumn,0);return new V(n.lineNumber,n.column,o.lineNumber,o.column)}}getViewLineNumberOfModelPosition(e,t){let n=e-1;if(this.modelLineProjections[n].isVisible()){const r=1+this.projectedModelLineLineCounts.getPrefixSum(n);return this.modelLineProjections[n].getViewLineNumberOfModelPosition(r,t)}for(;n>0&&!this.modelLineProjections[n].isVisible();)n--;if(n===0&&!this.modelLineProjections[n].isVisible())return 1;const o=1+this.projectedModelLineLineCounts.getPrefixSum(n);return this.modelLineProjections[n].getViewLineNumberOfModelPosition(o,this.model.getLineMaxColumn(n+1))}getDecorationsInRange(e,t,n,o,r){const s=this.convertViewPositionToModelPosition(e.startLineNumber,e.startColumn),a=this.convertViewPositionToModelPosition(e.endLineNumber,e.endColumn);if(a.lineNumber-s.lineNumber<=e.endLineNumber-e.startLineNumber)return this.model.getDecorationsInRange(new V(s.lineNumber,1,a.lineNumber,a.column),t,n,o,r);let l=[];const c=s.lineNumber-1,u=a.lineNumber-1;let d=null;for(let p=c;p<=u;p++)if(this.modelLineProjections[p].isVisible())d===null&&(d=new ae(p+1,p===c?s.column:1));else if(d!==null){const m=this.model.getLineMaxColumn(p);l=l.concat(this.model.getDecorationsInRange(new V(d.lineNumber,d.column,p,m),t,n,o)),d=null}d!==null&&(l=l.concat(this.model.getDecorationsInRange(new V(d.lineNumber,d.column,a.lineNumber,a.column),t,n,o)),d=null),l.sort((p,v)=>{const m=V.compareRangesUsingStarts(p.range,v.range);return m===0?p.idv.id?1:0:m});const h=[];let f=0,g=null;for(const p of l){const v=p.id;g!==v&&(g=v,h[f++]=p)}return h}getInjectedTextAt(e){const t=this.getViewLineInfo(e.lineNumber);return this.modelLineProjections[t.modelLineNumber-1].getInjectedTextAt(t.modelLineWrappedLineIdx,e.column)}normalizePosition(e,t){const n=this.getViewLineInfo(e.lineNumber);return this.modelLineProjections[n.modelLineNumber-1].normalizePosition(n.modelLineWrappedLineIdx,e,t)}getLineIndentColumn(e){const t=this.getViewLineInfo(e);return t.modelLineWrappedLineIdx===0?this.model.getLineIndentColumn(t.modelLineNumber):0}}function Slt(i){if(i.length===0)return[];const e=i.slice();e.sort(V.compareRangesUsingStarts);const t=[];let n=e[0].startLineNumber,o=e[0].endLineNumber;for(let r=1,s=e.length;ro+1?(t.push(new V(n,1,o,1)),n=a.startLineNumber,o=a.endLineNumber):a.endLineNumber>o&&(o=a.endLineNumber)}return t.push(new V(n,1,o,1)),t}class kse{constructor(e,t){this.modelLineNumber=e,this.modelLineWrappedLineIdx=t}}class Ise{constructor(e,t){this.modelRange=e,this.viewLines=t}}class xlt{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,n,o){return this._lines.convertModelPositionToViewPosition(e.lineNumber,e.column,t,n,o)}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)}}class Llt{constructor(e){this.model=e}dispose(){}createCoordinatesConverter(){return new Elt(this)}getHiddenAreas(){return[]}setHiddenAreas(e){return!1}setTabSize(e){return!1}setWrappingSettings(e,t,n,o){return!1}createLineBreaksComputer(){const e=[];return{addRequest:(t,n,o)=>{e.push(null)},finalize:()=>e}}onModelFlushed(){}onModelLinesDeleted(e,t,n){return new NH(t,n)}onModelLinesInserted(e,t,n,o){return new RH(t,n)}onModelLineChanged(e,t,n){return[!1,new a1e(t,1),null,null]}acceptVersionId(e){}getViewLineCount(){return this.model.getLineCount()}getActiveIndentGuide(e,t,n){return{startLineNumber:e,endLineNumber:e,indent:0}}getViewLinesBracketGuides(e,t,n){return new Array(t-e+1).fill([])}getViewLinesIndentGuides(e,t){const n=t-e+1,o=new Array(n);for(let r=0;rt)}getModelLineViewLineCount(e){return 1}getViewLineNumberOfModelPosition(e,t){return e}}class Dlt extends _e{constructor(e,t,n,o,r,s,a,l,c){if(super(),this.languageConfigurationService=a,this._themeService=l,this._attachedView=c,this.hiddenAreasModel=new Ilt,this.previousHiddenAreas=[],this._editorId=e,this._configuration=t,this.model=n,this._eventDispatcher=new Zat,this.onEvent=this._eventDispatcher.onEvent,this.cursorConfig=new $1(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._updateConfigurationViewLineCount=this._register(new bi(()=>this._updateConfigurationViewLineCountNow(),0)),this._hasFocus=!1,this._viewportStart=QG.create(this.model),this.model.isTooLargeForTokenization())this._lines=new Llt(this.model);else{const u=this._configuration.options,d=u.get(50),h=u.get(137),f=u.get(144),g=u.get(136),p=u.get(128);this._lines=new wlt(this._editorId,this.model,o,r,d,this.model.getOptions().tabSize,h,f.wrappingColumn,g,p)}this.coordinatesConverter=this._lines.createCoordinatesConverter(),this._cursor=this._register(new llt(n,this,this.coordinatesConverter,this.cursorConfig)),this.viewLayout=this._register(new _lt(this._configuration,this.getLineCount(),s)),this._register(this.viewLayout.onDidScroll(u=>{u.scrollTopChanged&&this._handleVisibleLinesChanged(),u.scrollTopChanged&&this._viewportStart.invalidate(),this._eventDispatcher.emitSingleViewEvent(new Kat(u)),this._eventDispatcher.emitOutgoingEvent(new GG(u.oldScrollWidth,u.oldScrollLeft,u.oldScrollHeight,u.oldScrollTop,u.scrollWidth,u.scrollLeft,u.scrollHeight,u.scrollTop))})),this._register(this.viewLayout.onDidContentSizeChange(u=>{this._eventDispatcher.emitOutgoingEvent(u)})),this._decorations=new blt(this._editorId,this.model,this._configuration,this._lines,this.coordinatesConverter),this._registerModelEvents(),this._register(this._configuration.onDidChangeFast(u=>{try{const d=this._eventDispatcher.beginEmitViewEvents();this._onConfigurationChanged(d,u)}finally{this._eventDispatcher.endEmitViewEvents()}})),this._register(eT.getInstance().onDidChange(()=>{this._eventDispatcher.emitSingleViewEvent(new Xat)})),this._register(this._themeService.onDidColorThemeChange(u=>{this._invalidateDecorationsColorCache(),this._eventDispatcher.emitSingleViewEvent(new qat(u))})),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 V(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 Uat(e)),this._eventDispatcher.emitOutgoingEvent(new qG(!e,e))}onCompositionStart(){this._eventDispatcher.emitSingleViewEvent(new Vat)}onCompositionEnd(){this._eventDispatcher.emitSingleViewEvent(new Hat)}_captureStableViewport(){if(this._viewportStart.isValid&&this.viewLayout.getCurrentScrollTop()>0){const e=new ae(this._viewportStart.viewLineNumber,this.getLineMinColumn(this._viewportStart.viewLineNumber)),t=this.coordinatesConverter.convertViewPositionToModelPosition(e);return new Nse(t,this._viewportStart.startLineDelta)}return new Nse(null,0)}_onConfigurationChanged(e,t){const n=this._captureStableViewport(),o=this._configuration.options,r=o.get(50),s=o.get(137),a=o.get(144),l=o.get(136),c=o.get(128);this._lines.setWrappingSettings(r,s,a.wrappingColumn,l,c)&&(e.emitViewEvent(new S2),e.emitViewEvent(new x2),e.emitViewEvent(new K1(null)),this._cursor.onLineMappingChanged(e),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount()),this._updateConfigurationViewLineCount.schedule()),t.hasChanged(90)&&(this._decorations.reset(),e.emitViewEvent(new K1(null))),e.emitViewEvent(new $at(t)),this.viewLayout.onConfigurationChanged(t),n.recoverViewportStart(this.coordinatesConverter,this.viewLayout),$1.shouldRecreate(t)&&(this.cursorConfig=new $1(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig))}_registerModelEvents(){this._register(this.model.onDidChangeContentOrInjectedText(e=>{try{const n=this._eventDispatcher.beginEmitViewEvents();let o=!1,r=!1;const s=e instanceof N0?e.rawContentChangedEvent.changes:e.changes,a=e instanceof N0?e.rawContentChangedEvent.versionId:null,l=this._lines.createLineBreaksComputer();for(const d of s)switch(d.changeType){case 4:{for(let h=0;h!p.ownerId||p.ownerId===this._editorId)),l.addRequest(f,g,null)}break}case 2:{let h=null;d.injectedText&&(h=d.injectedText.filter(f=>!f.ownerId||f.ownerId===this._editorId)),l.addRequest(d.detail,h,null);break}}const c=l.finalize(),u=new sp(c);for(const d of s)switch(d.changeType){case 1:{this._lines.onModelFlushed(),n.emitViewEvent(new S2),this._decorations.reset(),this.viewLayout.onFlushed(this.getLineCount()),o=!0;break}case 3:{const h=this._lines.onModelLinesDeleted(a,d.fromLineNumber,d.toLineNumber);h!==null&&(n.emitViewEvent(h),this.viewLayout.onLinesDeleted(h.fromLineNumber,h.toLineNumber)),o=!0;break}case 4:{const h=u.takeCount(d.detail.length),f=this._lines.onModelLinesInserted(a,d.fromLineNumber,d.toLineNumber,h);f!==null&&(n.emitViewEvent(f),this.viewLayout.onLinesInserted(f.fromLineNumber,f.toLineNumber)),o=!0;break}case 2:{const h=u.dequeue(),[f,g,p,v]=this._lines.onModelLineChanged(a,d.lineNumber,h);r=f,g&&n.emitViewEvent(g),p&&(n.emitViewEvent(p),this.viewLayout.onLinesInserted(p.fromLineNumber,p.toLineNumber)),v&&(n.emitViewEvent(v),this.viewLayout.onLinesDeleted(v.fromLineNumber,v.toLineNumber));break}case 5:break}a!==null&&this._lines.acceptVersionId(a),this.viewLayout.onHeightMaybeChanged(),!o&&r&&(n.emitViewEvent(new x2),n.emitViewEvent(new K1(null)),this._cursor.onLineMappingChanged(n),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 n=this.model._getTrackedRange(this._viewportStart.modelTrackedRange);if(n){const o=this.coordinatesConverter.convertModelPositionToViewPosition(n.getStartPosition()),r=this.viewLayout.getVerticalOffsetForLineNumber(o.lineNumber);this.viewLayout.setScrollPosition({scrollTop:r+this._viewportStart.startLineDelta},1)}}try{const n=this._eventDispatcher.beginEmitViewEvents();e instanceof N0&&n.emitOutgoingEvent(new rlt(e.contentChangedEvent)),this._cursor.onModelContentChanged(n,e)}finally{this._eventDispatcher.endEmitViewEvents()}this._handleVisibleLinesChanged()})),this._register(this.model.onDidChangeTokens(e=>{const t=[];for(let n=0,o=e.ranges.length;n{this._eventDispatcher.emitSingleViewEvent(new jat),this.cursorConfig=new $1(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig),this._eventDispatcher.emitOutgoingEvent(new olt(e))})),this._register(this.model.onDidChangeLanguage(e=>{this.cursorConfig=new $1(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig),this._eventDispatcher.emitOutgoingEvent(new ilt(e))})),this._register(this.model.onDidChangeOptions(e=>{if(this._lines.setTabSize(this.model.getOptions().tabSize)){try{const t=this._eventDispatcher.beginEmitViewEvents();t.emitViewEvent(new S2),t.emitViewEvent(new x2),t.emitViewEvent(new K1(null)),this._cursor.onLineMappingChanged(t),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount())}finally{this._eventDispatcher.endEmitViewEvents()}this._updateConfigurationViewLineCount.schedule()}this.cursorConfig=new $1(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig),this._eventDispatcher.emitOutgoingEvent(new slt(e))})),this._register(this.model.onDidChangeDecorations(e=>{this._decorations.onModelDecorationsChanged(),this._eventDispatcher.emitSingleViewEvent(new K1(e)),this._eventDispatcher.emitOutgoingEvent(new nlt(e))}))}setHiddenAreas(e,t){this.hiddenAreasModel.setHiddenAreas(t,e);const n=this.hiddenAreasModel.getMergedRanges();if(n===this.previousHiddenAreas)return;this.previousHiddenAreas=n;const o=this._captureStableViewport();let r=!1;try{const s=this._eventDispatcher.beginEmitViewEvents();r=this._lines.setHiddenAreas(n),r&&(s.emitViewEvent(new S2),s.emitViewEvent(new x2),s.emitViewEvent(new K1(null)),this._cursor.onLineMappingChanged(s),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount()),this.viewLayout.onHeightMaybeChanged()),o.recoverViewportStart(this.coordinatesConverter,this.viewLayout)}finally{this._eventDispatcher.endEmitViewEvents()}this._updateConfigurationViewLineCount.schedule(),r&&this._eventDispatcher.emitOutgoingEvent(new elt)}getVisibleRangesPlusViewportAboveBelow(){const e=this._configuration.options.get(143),t=this._configuration.options.get(66),n=Math.max(20,Math.round(e.height/t)),o=this.viewLayout.getLinesViewportData(),r=Math.max(1,o.completelyVisibleStartLineNumber-n),s=Math.min(this.getLineCount(),o.completelyVisibleEndLineNumber+n);return this._toModelVisibleRanges(new V(r,this.getLineMinColumn(r),s,this.getLineMaxColumn(s)))}getVisibleRanges(){const e=this.getCompletelyVisibleViewRange();return this._toModelVisibleRanges(e)}getHiddenAreas(){return this._lines.getHiddenAreas()}_toModelVisibleRanges(e){const t=this.coordinatesConverter.convertViewRangeToModelRange(e),n=this._lines.getHiddenAreas();if(n.length===0)return[t];const o=[];let r=0,s=t.startLineNumber,a=t.startColumn;const l=t.endLineNumber,c=t.endColumn;for(let u=0,d=n.length;ul||(sa.toInlineDecoration(e))]),new Zl(s.minColumn,s.maxColumn,s.content,s.continuesWithWrappedLine,n,o,s.tokens,t,r,s.startVisibleColumn)}getViewLineData(e){return this._lines.getViewLineData(e)}getMinimapLinesRenderingData(e,t,n){const o=this._lines.getViewLinesData(e,t,n);return new Ett(this.getTabSize(),o)}getAllOverviewRulerDecorations(e){const t=this.model.getOverviewRulerDecorations(this._editorId,PA(this._configuration.options)),n=new klt;for(const o of t){const r=o.options,s=r.overviewRuler;if(!s)continue;const a=s.position;if(a===0)continue;const l=s.getColor(e.value),c=this.coordinatesConverter.getViewLineNumberOfModelPosition(o.range.startLineNumber,o.range.startColumn),u=this.coordinatesConverter.getViewLineNumberOfModelPosition(o.range.endLineNumber,o.range.endColumn);n.accept(l,r.zIndex,c,u,a)}return n.asArray}_invalidateDecorationsColorCache(){const e=this.model.getOverviewRulerDecorations();for(const t of e){const n=t.options.overviewRuler;n==null||n.invalidateCachedColor();const o=t.options.minimap;o==null||o.invalidateCachedColor()}}getValueInRange(e,t){const n=this.coordinatesConverter.convertViewRangeToModelRange(e);return this.model.getValueInRange(n,t)}getValueLengthInRange(e,t){const n=this.coordinatesConverter.convertViewRangeToModelRange(e);return this.model.getValueLengthInRange(n,t)}modifyPosition(e,t){const n=this.coordinatesConverter.convertViewPositionToModelPosition(e);return this.model.modifyPosition(n,t)}deduceModelPositionRelativeToViewPosition(e,t,n){const o=this.coordinatesConverter.convertViewPositionToModelPosition(e);this.model.getEOL().length===2&&(t<0?t-=n:t+=n);const s=this.model.getOffsetAt(o)+t;return this.model.getPositionAt(s)}getPlainTextToCopy(e,t,n){const o=n?`\r +`:this.model.getEOL();e=e.slice(0),e.sort(V.compareRangesUsingStarts);let r=!1,s=!1;for(const l of e)l.isEmpty()?r=!0:s=!0;if(!s){if(!t)return"";const l=e.map(u=>u.startLineNumber);let c="";for(let u=0;u0&&l[u-1]===l[u]||(c+=this.model.getLineContent(l[u])+o);return c}if(r&&t){const l=[];let c=0;for(const u of e){const d=u.startLineNumber;u.isEmpty()?d!==c&&l.push(this.model.getLineContent(d)):l.push(this.model.getValueInRange(u,n?2:0)),c=d}return l.length===1?l[0]:l}const a=[];for(const l of e)l.isEmpty()||a.push(this.model.getValueInRange(l,n?2:0));return a.length===1?a[0]:a}getRichTextToCopy(e,t){const n=this.model.getLanguageId();if(n===Gl||e.length!==1)return null;let o=e[0];if(o.isEmpty()){if(!t)return null;const u=o.startLineNumber;o=new V(u,this.model.getLineMinColumn(u),u,this.model.getLineMaxColumn(u))}const r=this._configuration.options.get(50),s=this._getColorMap(),l=/[:;\\\/<>]/.test(r.fontFamily)||r.fontFamily===al.fontFamily;let c;return l?c=al.fontFamily:(c=r.fontFamily,c=c.replace(/"/g,"'"),/[,']/.test(c)||/[+ ]/.test(c)&&(c=`'${c}'`),c=`${c}, ${al.fontFamily}`),{mode:n,html:`
`+this._getHTMLToCopy(o,s)+"
"}}_getHTMLToCopy(e,t){const n=e.startLineNumber,o=e.startColumn,r=e.endLineNumber,s=e.endColumn,a=this.getTabSize();let l="";for(let c=n;c<=r;c++){const u=this.model.tokenization.getLineTokens(c),d=u.getLineContent(),h=c===n?o-1:0,f=c===r?s-1:d.length;d===""?l+="
":l+=flt(d,u.inflate(),t,h,f,a,ls)}return l}_getColorMap(){const e=oo.getColorMap(),t=["#000000"];if(e)for(let n=1,o=e.length;nthis._cursor.setStates(o,e,t,n))}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,n=0){this._withViewEventsCollector(o=>this._cursor.setSelections(o,e,t,n))}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 tlt);return}this._withViewEventsCollector(e)}executeEdits(e,t,n){this._executeCursorEdit(o=>this._cursor.executeEdits(o,e,t,n))}startComposition(){this._executeCursorEdit(e=>this._cursor.startComposition(e))}endComposition(e){this._executeCursorEdit(t=>this._cursor.endComposition(t,e))}type(e,t){this._executeCursorEdit(n=>this._cursor.type(n,e,t))}compositionType(e,t,n,o,r){this._executeCursorEdit(s=>this._cursor.compositionType(s,e,t,n,o,r))}paste(e,t,n,o){this._executeCursorEdit(r=>this._cursor.paste(r,e,t,n,o))}cut(e){this._executeCursorEdit(t=>this._cursor.cut(t,e))}executeCommand(e,t){this._executeCursorEdit(n=>this._cursor.executeCommand(n,e,t))}executeCommands(e,t){this._executeCursorEdit(n=>this._cursor.executeCommands(n,e,t))}revealPrimaryCursor(e,t,n=!1){this._withViewEventsCollector(o=>this._cursor.revealPrimary(o,e,n,0,t,0))}revealTopMostCursor(e){const t=this._cursor.getTopMostViewPosition(),n=new V(t.lineNumber,t.column,t.lineNumber,t.column);this._withViewEventsCollector(o=>o.emitViewEvent(new fM(e,!1,n,null,0,!0,0)))}revealBottomMostCursor(e){const t=this._cursor.getBottomMostViewPosition(),n=new V(t.lineNumber,t.column,t.lineNumber,t.column);this._withViewEventsCollector(o=>o.emitViewEvent(new fM(e,!1,n,null,0,!0,0)))}revealRange(e,t,n,o,r){this._withViewEventsCollector(s=>s.emitViewEvent(new fM(e,!1,n,null,o,t,r)))}changeWhitespace(e){this.viewLayout.changeWhitespace(e)&&(this._eventDispatcher.emitSingleViewEvent(new Yat),this._eventDispatcher.emitOutgoingEvent(new Jat))}_withViewEventsCollector(e){try{const t=this._eventDispatcher.beginEmitViewEvents();return e(t)}finally{this._eventDispatcher.endEmitViewEvents()}}normalizePosition(e,t){return this._lines.normalizePosition(e,t)}getLineIndentColumn(e){return this._lines.getLineIndentColumn(e)}}class QG{static create(e){const t=e._setTrackedRange(null,new V(1,1,1,1),1);return new QG(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,n,o,r){this._model=e,this._viewLineNumber=t,this._isValid=n,this._modelTrackedRange=o,this._startLineDelta=r}dispose(){this._model._setTrackedRange(this._modelTrackedRange,null,1)}update(e,t){const n=e.coordinatesConverter.convertViewPositionToModelPosition(new ae(t,e.getLineMinColumn(t))),o=e.model._setTrackedRange(this._modelTrackedRange,new V(n.lineNumber,n.column,n.lineNumber,n.column),1),r=e.viewLayout.getVerticalOffsetForLineNumber(t),s=e.viewLayout.getCurrentScrollTop();this._viewLineNumber=t,this._isValid=!0,this._modelTrackedRange=o,this._startLineDelta=s-r}invalidate(){this._isValid=!1}}class klt{constructor(){this._asMap=Object.create(null),this.asArray=[]}accept(e,t,n,o,r){const s=this._asMap[e];if(s){const a=s.data,l=a[a.length-3],c=a[a.length-1];if(l===r&&c+1>=n){o>c&&(a[a.length-1]=o);return}a.push(r,n,o)}else{const a=new UD(e,t,[r,n,o]);this._asMap[e]=a,this.asArray.push(a)}}}class Ilt{constructor(){this.hiddenAreas=new Map,this.shouldRecompute=!1,this.ranges=[]}setHiddenAreas(e,t){const n=this.hiddenAreas.get(e);n&&Tse(n,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,n)=>Tlt(t,n),[]);return Tse(this.ranges,e)?this.ranges:(this.ranges=e,this.ranges)}}function Tlt(i,e){const t=[];let n=0,o=0;for(;n0?this.wrappedTextIndentLength:0}getLineLength(e){const t=e>0?this.breakOffsets[e-1]:0;let o=this.breakOffsets[e]-t;return e>0&&(o+=this.wrappedTextIndentLength),o}getMaxOutputOffset(e){return this.getLineLength(e)}translateToInputOffset(e,t){e>0&&(t=Math.max(0,t-this.wrappedTextIndentLength));let o=e===0?t:this.breakOffsets[e-1]+t;if(this.injectionOffsets!==null)for(let r=0;rthis.injectionOffsets[r];r++)o0?this.breakOffsets[r-1]:0,t===0)if(e<=s)o=r-1;else if(e>l)n=r+1;else break;else if(e=l)n=r+1;else break}let a=e-s;return r>0&&(a+=this.wrappedTextIndentLength),new L2(r,a)}normalizeOutputPosition(e,t,n){if(this.injectionOffsets!==null){const o=this.outputPositionToOffsetInInputWithInjections(e,t),r=this.normalizeOffsetInInputWithInjectionsAroundInjections(o,n);if(r!==o)return this.offsetInInputWithInjectionsToOutputPosition(r,n)}if(n===0){if(e>0&&t===this.getMinOutputOffset(e))return new L2(e-1,this.getMaxOutputOffset(e-1))}else if(n===1){const o=this.getOutputLineCount()-1;if(e0&&(t=Math.max(0,t-this.wrappedTextIndentLength)),(e>0?this.breakOffsets[e-1]:0)+t}normalizeOffsetInInputWithInjectionsAroundInjections(e,t){const n=this.getInjectedTextAtOffset(e);if(!n)return e;if(t===2){if(e===n.offsetInInputWithInjections+n.length&&Rse(this.injectionOptions[n.injectedTextIndex].cursorStops))return n.offsetInInputWithInjections+n.length;{let o=n.offsetInInputWithInjections;if(Mse(this.injectionOptions[n.injectedTextIndex].cursorStops))return o;let r=n.injectedTextIndex-1;for(;r>=0&&this.injectionOffsets[r]===this.injectionOffsets[n.injectedTextIndex]&&!(Rse(this.injectionOptions[r].cursorStops)||(o-=this.injectionOptions[r].content.length,Mse(this.injectionOptions[r].cursorStops)));)r--;return o}}else if(t===1||t===4){let o=n.offsetInInputWithInjections+n.length,r=n.injectedTextIndex;for(;r+1=0&&this.injectionOffsets[r-1]===this.injectionOffsets[r];)o-=this.injectionOptions[r-1].content.length,r--;return o}Z4()}getInjectedText(e,t){const n=this.outputPositionToOffsetInInputWithInjections(e,t),o=this.getInjectedTextAtOffset(n);return o?{options:this.injectionOptions[o.injectedTextIndex]}:null}getInjectedTextAtOffset(e){const t=this.injectionOffsets,n=this.injectionOptions;if(t!==null){let o=0;for(let r=0;re)break;if(e<=l)return{injectedTextIndex:r,offsetInInputWithInjections:a,length:s};o+=s}}}}function Rse(i){return i==null?!0:i===Nd.Right||i===Nd.Both}function Mse(i){return i==null?!0:i===Nd.Left||i===Nd.Both}class L2{constructor(e,t){this.outputLineIndex=e,this.outputOffset=t}toString(){return`${this.outputLineIndex}:${this.outputOffset}`}toPosition(e){return new ae(e+this.outputLineIndex,this.outputOffset+1)}}class JG{static create(e){return new JG(e.get(132),e.get(131))}constructor(e,t){this.classifier=new Rlt(e,t)}createLineBreaksComputer(e,t,n,o,r){const s=[],a=[],l=[];return{addRequest:(c,u,d)=>{s.push(c),a.push(u),l.push(d)},finalize:()=>{const c=e.typicalFullwidthCharacterWidth/e.typicalHalfwidthCharacterWidth,u=[];for(let d=0,h=s.length;d=0&&e<256?this._asciiMap[e]:e>=12352&&e<=12543||e>=13312&&e<=19903||e>=19968&&e<=40959?3:this._map.get(e)||this._defaultValue}}let MH=[],AH=[];function Mlt(i,e,t,n,o,r,s,a){if(o===-1)return null;const l=t.length;if(l<=1)return null;const c=a==="keepAll",u=e.breakOffsets,d=e.breakOffsetsVisibleColumn,h=c1e(t,n,o,r,s),f=o-h,g=MH,p=AH;let v=0,m=0,_=0,y=o;const w=u.length;let L=0;if(L>=0){let D=Math.abs(d[L]-y);for(;L+1=D)break;D=E,L++}}for(;LD&&(D=m,E=_);let I=0,k=0,R=0,A=0;if(E<=y){let N=E,M=D===0?0:t.charCodeAt(D-1),H=D===0?0:i.get(M),B=!0;for(let F=D;Fm&&PH(M,H,z,K,c)&&(I=$,k=N),N+=j,N>y){$>m?(R=$,A=N-j):(R=F+1,A=N),N-k>f&&(I=0),B=!1;break}M=z,H=K}if(B){v>0&&(g[v]=u[u.length-1],p[v]=d[u.length-1],v++);break}}if(I===0){let N=E,M=t.charCodeAt(D),H=i.get(M),B=!1;for(let F=D-1;F>=m;F--){const $=F+1,z=t.charCodeAt(F);if(z===9){B=!0;break}let K,j;if(Z0(z)?(F--,K=0,j=2):(K=i.get(z),j=Cv(z)?r:1),N<=y){if(R===0&&(R=$,A=N),N<=y-f)break;if(PH(z,K,M,H,c)){I=$,k=N;break}}N-=j,M=z,H=K}if(I!==0){const F=f-(A-k);if(F<=n){const $=t.charCodeAt(R);let z;gr($)?z=2:z=xE($,A,n,r),F-z<0&&(I=0)}}if(B){L--;continue}}if(I===0&&(I=R,k=A),I<=m){const N=t.charCodeAt(m);gr(N)?(I=m+2,k=_+2):(I=m+1,k=_+xE(N,_,n,r))}for(m=I,g[v]=I,_=k,p[v]=k,v++,y=k+f;L<0||L=P)break;P=N,L++}}return v===0?null:(g.length=v,p.length=v,MH=e.breakOffsets,AH=e.breakOffsetsVisibleColumn,e.breakOffsets=g,e.breakOffsetsVisibleColumn=p,e.wrappedTextIndentLength=h,e)}function Alt(i,e,t,n,o,r,s,a){const l=Gd.applyInjectedText(e,t);let c,u;if(t&&t.length>0?(c=t.map(k=>k.options),u=t.map(k=>k.column-1)):(c=null,u=null),o===-1)return c?new SE(u,c,[l.length],[],0):null;const d=l.length;if(d<=1)return c?new SE(u,c,[l.length],[],0):null;const h=a==="keepAll",f=c1e(l,n,o,r,s),g=o-f,p=[],v=[];let m=0,_=0,y=0,w=o,L=l.charCodeAt(0),D=i.get(L),E=xE(L,0,n,r),I=1;gr(L)&&(E+=1,L=l.charCodeAt(1),D=i.get(L),I++);for(let k=I;kw&&((_===0||E-y>g)&&(_=R,y=E-N),p[m]=_,v[m]=y,m++,w=y+g,_=0),L=A,D=P}return m===0&&(!t||t.length===0)?null:(p[m]=d,v[m]=E,new SE(u,c,p,v,f))}function xE(i,e,t,n){return i===9?t-e%t:Cv(i)||i<32?n:1}function Ase(i,e){return e-i%e}function PH(i,e,t,n,o){return t!==32&&(e===2&&n!==2||e!==1&&n===1||!o&&e===3&&n!==2||!o&&n===3&&e!==1)}function c1e(i,e,t,n,o){let r=0;if(o!==0){const s=Ws(i);if(s!==-1){for(let l=0;lt&&(r=0)}}return r}const w9=mp("domLineBreaksComputer",{createHTML:i=>i});class eX{static create(){return new eX}constructor(){}createLineBreaksComputer(e,t,n,o,r){const s=[],a=[];return{addRequest:(l,c,u)=>{s.push(l),a.push(c)},finalize:()=>Plt(s,e,t,n,o,r,a)}}}function Plt(i,e,t,n,o,r,s){var a;function l(k){const R=s[k];if(R){const A=Gd.applyInjectedText(i[k],R),P=R.map(M=>M.options),N=R.map(M=>M.column-1);return new SE(N,P,[A.length],[],0)}else return null}if(n===-1){const k=[];for(let R=0,A=i.length;Rc?(A=0,P=0):N=c-B}const M=R.substr(A),H=Olt(M,P,t,N,g,h);p[k]=A,v[k]=P,m[k]=M,_[k]=H[0],y[k]=H[1]}const w=g.build(),L=(a=w9==null?void 0:w9.createHTML(w))!==null&&a!==void 0?a:w;f.innerHTML=L,f.style.position="absolute",f.style.top="10000",r==="keepAll"?(f.style.wordBreak="keep-all",f.style.overflowWrap="anywhere"):(f.style.wordBreak="inherit",f.style.overflowWrap="break-word"),document.body.appendChild(f);const D=document.createRange(),E=Array.prototype.slice.call(f.children,0),I=[];for(let k=0;kz.options),F=$.map(z=>z.column-1)):(B=null,F=null),I[k]=new SE(F,B,A,H,N)}return document.body.removeChild(f),I}function Olt(i,e,t,n,o,r){if(r!==0){const h=String(r);o.appendString('
');const s=i.length;let a=e,l=0;const c=[],u=[];let d=0");for(let h=0;h"),c[h]=l,u[h]=a;const f=d;d=h+1"),c[i.length]=l,u[i.length]=a,o.appendString("
"),[c,u]}function Flt(i,e,t,n){if(t.length<=1)return null;const o=Array.prototype.slice.call(e.children,0),r=[];try{OH(i,o,n,0,null,t.length-1,null,r)}catch(s){return console.log(s),null}return r.length===0?null:(r.push(t.length),r)}function OH(i,e,t,n,o,r,s,a){if(n===r||(o=o||S9(i,e,t[n],t[n+1]),s=s||S9(i,e,t[r],t[r+1]),Math.abs(o[0].top-s[0].top)<=.1))return;if(n+1===r){a.push(r);return}const l=n+(r-n)/2|0,c=S9(i,e,t[l],t[l+1]);OH(i,e,t,n,o,l,c,a),OH(i,e,t,l,c,r,s,a)}function S9(i,e,t,n){return i.setStart(e[t/16384|0].firstChild,t%16384),i.setEnd(e[n/16384|0].firstChild,n%16384),i.getClientRects()}class Blt extends _e{constructor(){super(),this._editor=null,this._instantiationService=null,this._instances=this._register(new Vq),this._pending=new Map,this._finishedInstantiation=[],this._finishedInstantiation[0]=!1,this._finishedInstantiation[1]=!1,this._finishedInstantiation[2]=!1,this._finishedInstantiation[3]=!1}initialize(e,t,n){this._editor=e,this._instantiationService=n;for(const o of t){if(this._pending.has(o.id)){en(new Error(`Cannot have two contributions with the same id ${o.id}`));continue}this._pending.set(o.id,o)}this._instantiateSome(0),this._register(Mg(()=>{this._instantiateSome(1)})),this._register(Mg(()=>{this._instantiateSome(2)})),this._register(Mg(()=>{this._instantiateSome(3)},5e3))}saveViewState(){const e={};for(const[t,n]of this._instances)typeof n.saveViewState=="function"&&(e[t]=n.saveViewState());return e}restoreViewState(e){for(const[t,n]of this._instances)typeof n.restoreViewState=="function"&&n.restoreViewState(e[t])}get(e){return this._instantiateById(e),this._instances.get(e)||null}onBeforeInteractionEvent(){this._instantiateSome(2)}onAfterModelAttached(){this._register(Mg(()=>{this._instantiateSome(1)},50))}_instantiateSome(e){if(this._finishedInstantiation[e])return;this._finishedInstantiation[e]=!0;const t=this._findPendingContributionsByInstantiation(e);for(const n of t)this._instantiateById(n.id)}_findPendingContributionsByInstantiation(e){const t=[];for(const[,n]of this._pending)n.instantiation===e&&t.push(n);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 n=this._instantiationService.createInstance(t.ctor,this._editor);this._instances.set(t.id,n),typeof n.restoreViewState=="function"&&t.instantiation!==0&&console.warn(`Editor contribution '${t.id}' should be eager instantiated because it uses saveViewState / restoreViewState.`)}catch(n){en(n)}}}}var Wlt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Qf=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},Vlt=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},A_;let Hlt=0;class $lt{constructor(e,t,n,o,r,s){this.model=e,this.viewModel=t,this.view=n,this.hasRealView=o,this.listenersToRemove=r,this.attachedView=s}dispose(){si(this.listenersToRemove),this.model.onBeforeDetached(this.attachedView),this.hasRealView&&this.view.dispose(),this.viewModel.dispose()}}let Iw=A_=class extends _e{get isSimpleWidget(){return this._configuration.isSimpleWidget}constructor(e,t,n,o,r,s,a,l,c,u,d,h){var f;super(),this.languageConfigurationService=d,this._deliveryQueue=NYe(),this._contributions=this._register(new Blt),this._onDidDispose=this._register(new le),this.onDidDispose=this._onDidDispose.event,this._onDidChangeModelContent=this._register(new le({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelContent=this._onDidChangeModelContent.event,this._onDidChangeModelLanguage=this._register(new le({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelLanguage=this._onDidChangeModelLanguage.event,this._onDidChangeModelLanguageConfiguration=this._register(new le({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelLanguageConfiguration=this._onDidChangeModelLanguageConfiguration.event,this._onDidChangeModelOptions=this._register(new le({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelOptions=this._onDidChangeModelOptions.event,this._onDidChangeModelDecorations=this._register(new le({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelDecorations=this._onDidChangeModelDecorations.event,this._onDidChangeModelTokens=this._register(new le({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelTokens=this._onDidChangeModelTokens.event,this._onDidChangeConfiguration=this._register(new le({deliveryQueue:this._deliveryQueue})),this.onDidChangeConfiguration=this._onDidChangeConfiguration.event,this._onDidChangeModel=this._register(new le({deliveryQueue:this._deliveryQueue})),this.onDidChangeModel=this._onDidChangeModel.event,this._onDidChangeCursorPosition=this._register(new le({deliveryQueue:this._deliveryQueue})),this.onDidChangeCursorPosition=this._onDidChangeCursorPosition.event,this._onDidChangeCursorSelection=this._register(new le({deliveryQueue:this._deliveryQueue})),this.onDidChangeCursorSelection=this._onDidChangeCursorSelection.event,this._onDidAttemptReadOnlyEdit=this._register(new Ms(this._contributions,this._deliveryQueue)),this.onDidAttemptReadOnlyEdit=this._onDidAttemptReadOnlyEdit.event,this._onDidLayoutChange=this._register(new le({deliveryQueue:this._deliveryQueue})),this.onDidLayoutChange=this._onDidLayoutChange.event,this._editorTextFocus=this._register(new Pse({deliveryQueue:this._deliveryQueue})),this.onDidFocusEditorText=this._editorTextFocus.onDidChangeToTrue,this.onDidBlurEditorText=this._editorTextFocus.onDidChangeToFalse,this._editorWidgetFocus=this._register(new Pse({deliveryQueue:this._deliveryQueue})),this.onDidFocusEditorWidget=this._editorWidgetFocus.onDidChangeToTrue,this.onDidBlurEditorWidget=this._editorWidgetFocus.onDidChangeToFalse,this._onWillType=this._register(new Ms(this._contributions,this._deliveryQueue)),this.onWillType=this._onWillType.event,this._onDidType=this._register(new Ms(this._contributions,this._deliveryQueue)),this.onDidType=this._onDidType.event,this._onDidCompositionStart=this._register(new Ms(this._contributions,this._deliveryQueue)),this.onDidCompositionStart=this._onDidCompositionStart.event,this._onDidCompositionEnd=this._register(new Ms(this._contributions,this._deliveryQueue)),this.onDidCompositionEnd=this._onDidCompositionEnd.event,this._onDidPaste=this._register(new Ms(this._contributions,this._deliveryQueue)),this.onDidPaste=this._onDidPaste.event,this._onMouseUp=this._register(new Ms(this._contributions,this._deliveryQueue)),this.onMouseUp=this._onMouseUp.event,this._onMouseDown=this._register(new Ms(this._contributions,this._deliveryQueue)),this.onMouseDown=this._onMouseDown.event,this._onMouseDrag=this._register(new Ms(this._contributions,this._deliveryQueue)),this.onMouseDrag=this._onMouseDrag.event,this._onMouseDrop=this._register(new Ms(this._contributions,this._deliveryQueue)),this.onMouseDrop=this._onMouseDrop.event,this._onMouseDropCanceled=this._register(new Ms(this._contributions,this._deliveryQueue)),this.onMouseDropCanceled=this._onMouseDropCanceled.event,this._onDropIntoEditor=this._register(new Ms(this._contributions,this._deliveryQueue)),this.onDropIntoEditor=this._onDropIntoEditor.event,this._onContextMenu=this._register(new Ms(this._contributions,this._deliveryQueue)),this.onContextMenu=this._onContextMenu.event,this._onMouseMove=this._register(new Ms(this._contributions,this._deliveryQueue)),this.onMouseMove=this._onMouseMove.event,this._onMouseLeave=this._register(new Ms(this._contributions,this._deliveryQueue)),this.onMouseLeave=this._onMouseLeave.event,this._onMouseWheel=this._register(new Ms(this._contributions,this._deliveryQueue)),this.onMouseWheel=this._onMouseWheel.event,this._onKeyUp=this._register(new Ms(this._contributions,this._deliveryQueue)),this.onKeyUp=this._onKeyUp.event,this._onKeyDown=this._register(new Ms(this._contributions,this._deliveryQueue)),this.onKeyDown=this._onKeyDown.event,this._onDidContentSizeChange=this._register(new le({deliveryQueue:this._deliveryQueue})),this.onDidContentSizeChange=this._onDidContentSizeChange.event,this._onDidScrollChange=this._register(new le({deliveryQueue:this._deliveryQueue})),this.onDidScrollChange=this._onDidScrollChange.event,this._onDidChangeViewZones=this._register(new le({deliveryQueue:this._deliveryQueue})),this.onDidChangeViewZones=this._onDidChangeViewZones.event,this._onDidChangeHiddenAreas=this._register(new le({deliveryQueue:this._deliveryQueue})),this.onDidChangeHiddenAreas=this._onDidChangeHiddenAreas.event,this._actions=new Map,this._bannerDomNode=null,this._dropIntoEditorDecorations=this.createDecorationsCollection(),r.willCreateCodeEditor();const g=Object.assign({},t);this._domElement=e,this._overflowWidgetsDomNode=g.overflowWidgetsDomNode,delete g.overflowWidgetsDomNode,this._id=++Hlt,this._decorationTypeKeysToIds={},this._decorationTypeSubtypes={},this._telemetryData=n.telemetryData,this._configuration=this._register(this._createConfiguration(n.isSimpleWidget||!1,g,u)),this._register(this._configuration.onDidChange(m=>{this._onDidChangeConfiguration.fire(m);const _=this._configuration.options;if(m.hasChanged(143)){const y=_.get(143);this._onDidLayoutChange.fire(y)}})),this._contextKeyService=this._register(a.createScoped(this._domElement)),this._notificationService=c,this._codeEditorService=r,this._commandService=s,this._themeService=l,this._register(new zlt(this,this._contextKeyService)),this._register(new Ult(this,this._contextKeyService,h)),this._instantiationService=o.createChild(new L5([Ut,this._contextKeyService])),this._modelData=null,this._focusTracker=new jlt(e),this._register(this._focusTracker.onChange(()=>{this._editorWidgetFocus.setValue(this._focusTracker.hasFocus())})),this._contentWidgets={},this._overlayWidgets={},this._glyphMarginWidgets={};let p;Array.isArray(n.contributions)?p=n.contributions:p=vy.getEditorContributions(),this._contributions.initialize(this,p,this._instantiationService);for(const m of vy.getEditorActions()){if(this._actions.has(m.id)){en(new Error(`Cannot have two actions with the same id ${m.id}`));continue}const _=new Wbe(m.id,m.label,m.alias,(f=m.precondition)!==null&&f!==void 0?f:void 0,()=>this._instantiationService.invokeFunction(y=>Promise.resolve(m.runEditorCommand(y,this,null))),this._contextKeyService);this._actions.set(_.id,_)}const v=()=>!this._configuration.options.get(90)&&this._configuration.options.get(36).enabled;this._register(new YQe(this._domElement,{onDragEnter:()=>{},onDragOver:m=>{if(!v())return;const _=this.getTargetAtClientPoint(m.clientX,m.clientY);_!=null&&_.position&&this.showDropIndicatorAt(_.position)},onDrop:m=>Vlt(this,void 0,void 0,function*(){if(!v()||(this.removeDropIndicator(),!m.dataTransfer))return;const _=this.getTargetAtClientPoint(m.clientX,m.clientY);_!=null&&_.position&&this._onDropIntoEditor.fire({position:_.position,event:m})}),onDragLeave:()=>{this.removeDropIndicator()},onDragEnd:()=>{this.removeDropIndicator()}})),this._codeEditorService.addCodeEditor(this)}writeScreenReaderContent(e){var t;(t=this._modelData)===null||t===void 0||t.view.writeScreenReaderContent(e)}_createConfiguration(e,t,n){return new dH(e,t,this._domElement,n)}getId(){return this.getEditorType()+":"+this._id}getEditorType(){return UI.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?Qn.getWordAtPosition(this._modelData.model,this._configuration.options.get(129),e):null}getValue(e=null){if(!this._modelData)return"";const t=!!(e&&e.preserveBOM);let n=0;return e&&e.lineEnding&&e.lineEnding===` `?n=1:e&&e.lineEnding&&e.lineEnding===`\r -`&&(n=2),this._modelData.model.getValue(n,t)}setValue(e){!this._modelData||this._modelData.model.setValue(e)}getModel(){return this._modelData?this._modelData.model:null}setModel(e=null){const t=e;if(this._modelData===null&&t===null||this._modelData&&this._modelData.model===t)return;const n=this.hasTextFocus(),o=this._detachModel();this._attachModel(t),n&&this.hasModel()&&this.focus();const r={oldModelUrl:o?o.uri:null,newModelUrl:t?t.uri:null};this._removeDecorationTypes(),this._onDidChangeModel.fire(r),this._postDetachModelCleanup(o),this._contributions.onAfterModelAttached()}_removeDecorationTypes(){if(this._decorationTypeKeysToIds={},this._decorationTypeSubtypes){for(const e in this._decorationTypeSubtypes){const t=this._decorationTypeSubtypes[e];for(const n in t)this._removeDecorationType(e+"-"+n)}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,n,o){const r=e.model.validatePosition({lineNumber:t,column:n}),s=e.viewModel.coordinatesConverter.convertModelPositionToViewPosition(r);return e.viewModel.viewLayout.getVerticalOffsetAfterLineNumber(s.lineNumber,o)}getTopForLineNumber(e,t=!1){return this._modelData?M_._getVerticalOffsetForPosition(this._modelData,e,1,t):-1}getTopForPosition(e,t){return this._modelData?M_._getVerticalOffsetForPosition(this._modelData,e,t,!1):-1}static _getVerticalOffsetForPosition(e,t,n,o=!1){const r=e.model.validatePosition({lineNumber:t,column:n}),s=e.viewModel.coordinatesConverter.convertModelPositionToViewPosition(r);return e.viewModel.viewLayout.getVerticalOffsetForLineNumber(s.lineNumber,o)}getBottomForLineNumber(e,t=!1){return this._modelData?M_._getVerticalOffsetAfterPosition(this._modelData,e,1,t):-1}setHiddenAreas(e,t){var n;(n=this._modelData)===null||n===void 0||n.viewModel.setHiddenAreas(e.map(o=>V.lift(o)),t)}getVisibleColumnFromPosition(e){if(!this._modelData)return e.column;const t=this._modelData.model.validatePosition(e),n=this._modelData.model.getOptions().tabSize;return or.visibleColumnFromColumn(this._modelData.model.getLineContent(t.lineNumber),t.column,n)+1}getPosition(){return this._modelData?this._modelData.viewModel.getPosition():null}setPosition(e,t="api"){if(!!this._modelData){if(!ae.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,n,o){if(!this._modelData)return;if(!V.isIRange(e))throw new Error("Invalid arguments");const r=this._modelData.model.validateRange(e),s=this._modelData.viewModel.coordinatesConverter.convertModelRangeToViewRange(r);this._modelData.viewModel.revealRange("api",n,s,t,o)}revealLine(e,t=0){this._revealLine(e,0,t)}revealLineInCenter(e,t=0){this._revealLine(e,1,t)}revealLineInCenterIfOutsideViewport(e,t=0){this._revealLine(e,2,t)}revealLineNearTop(e,t=0){this._revealLine(e,5,t)}_revealLine(e,t,n){if(typeof e!="number")throw new Error("Invalid arguments");this._sendRevealRange(new V(e,1,e,1),t,!1,n)}revealPosition(e,t=0){this._revealPosition(e,0,!0,t)}revealPositionInCenter(e,t=0){this._revealPosition(e,1,!0,t)}revealPositionInCenterIfOutsideViewport(e,t=0){this._revealPosition(e,2,!0,t)}revealPositionNearTop(e,t=0){this._revealPosition(e,5,!0,t)}_revealPosition(e,t,n,o){if(!ae.isIPosition(e))throw new Error("Invalid arguments");this._sendRevealRange(new V(e.lineNumber,e.column,e.lineNumber,e.column),t,n,o)}getSelection(){return this._modelData?this._modelData.viewModel.getSelection():null}getSelections(){return this._modelData?this._modelData.viewModel.getSelections():null}setSelection(e,t="api"){const n=gt.isISelection(e),o=V.isIRange(e);if(!n&&!o)throw new Error("Invalid arguments");if(n)this._setSelectionImpl(e,t);else if(o){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 n=new gt(e.selectionStartLineNumber,e.selectionStartColumn,e.positionLineNumber,e.positionColumn);this._modelData.viewModel.setSelections(t,[n])}revealLines(e,t,n=0){this._revealLines(e,t,0,n)}revealLinesInCenter(e,t,n=0){this._revealLines(e,t,1,n)}revealLinesInCenterIfOutsideViewport(e,t,n=0){this._revealLines(e,t,2,n)}revealLinesNearTop(e,t,n=0){this._revealLines(e,t,5,n)}_revealLines(e,t,n,o){if(typeof e!="number"||typeof t!="number")throw new Error("Invalid arguments");this._sendRevealRange(new V(e,1,t,1),n,!1,o)}revealRange(e,t=0,n=!1,o=!0){this._revealRange(e,n?1:0,o,t)}revealRangeInCenter(e,t=0){this._revealRange(e,1,!0,t)}revealRangeInCenterIfOutsideViewport(e,t=0){this._revealRange(e,2,!0,t)}revealRangeNearTop(e,t=0){this._revealRange(e,5,!0,t)}revealRangeNearTopIfOutsideViewport(e,t=0){this._revealRange(e,6,!0,t)}revealRangeAtTop(e,t=0){this._revealRange(e,3,!0,t)}_revealRange(e,t,n,o){if(!V.isIRange(e))throw new Error("Invalid arguments");this._sendRevealRange(V.lift(e),t,n,o)}setSelections(e,t="api",n=0){if(!!this._modelData){if(!e||e.length===0)throw new Error("Invalid arguments");for(let o=0,r=e.length;o0&&this._modelData.viewModel.restoreCursorState(n):this._modelData.viewModel.restoreCursorState([n]),this._contributions.restoreViewState(t.contributionsState||{});const o=this._modelData.viewModel.reduceRestoreState(t.viewState);this._modelData.view.restoreState(o)}}handleInitialized(){var e;(e=this._getViewModel())===null||e===void 0||e.visibleLinesStabilized()}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,n){switch(n=n||{},t){case"compositionStart":this._startComposition();return;case"compositionEnd":this._endComposition(e);return;case"type":{const r=n;this._type(e,r.text||"");return}case"replacePreviousChar":{const r=n;this._compositionType(e,r.text||"",r.replaceCharCnt||0,0,0);return}case"compositionType":{const r=n;this._compositionType(e,r.text||"",r.replacePrevCharCnt||0,r.replaceNextCharCnt||0,r.positionDelta||0);return}case"paste":{const r=n;this._paste(e,r.text||"",r.pasteOnNewLine||!1,r.multicursorText||null,r.mode||null);return}case"cut":this._cut(e);return}const o=this.getAction(t);if(o){Promise.resolve(o.run(n)).then(void 0,en);return}!this._modelData||this._triggerEditorCommand(e,t,n)||this._triggerCommand(t,n)}_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,n,o,r){!this._modelData||this._modelData.viewModel.compositionType(t,n,o,r,e)}_paste(e,t,n,o,r){if(!this._modelData||t.length===0)return;const s=this._modelData.viewModel,a=s.getSelection().getStartPosition();s.paste(t,n,o,e);const l=s.getSelection().getStartPosition();e==="keyboard"&&this._onDidPaste.fire({range:new V(a.lineNumber,a.column,l.lineNumber,l.column),languageId:r})}_cut(e){!this._modelData||this._modelData.viewModel.cut(e)}_triggerEditorCommand(e,t,n){const o=vw.getEditorCommand(t);return o?(n=n||{},n.source=e,this._instantiationService.invokeFunction(r=>{Promise.resolve(o.runEditorCommand(r,this,n)).then(void 0,en)}),!0):!1}_getViewModel(){return this._modelData?this._modelData.viewModel:null}pushUndoStop(){return!this._modelData||this._configuration.options.get(90)?!1:(this._modelData.model.pushStackElement(),!0)}popUndoStop(){return!this._modelData||this._configuration.options.get(90)?!1:(this._modelData.model.popStackElement(),!0)}executeEdits(e,t,n){if(!this._modelData||this._configuration.options.get(90))return!1;let o;return n?Array.isArray(n)?o=()=>n:o=n:o=()=>null,this._modelData.viewModel.executeEdits(e,t,o),!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 Vlt(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,RA(this._configuration.options)):null}getDecorationsInRange(e){return this._modelData?this._modelData.model.getDecorationsInRange(e,this._id,RA(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,[])})}removeDecorationsByType(e){const t=this._decorationTypeKeysToIds[e];t&&this.deltaDecorations(t,[]),this._decorationTypeKeysToIds.hasOwnProperty(e)&&delete this._decorationTypeKeysToIds[e],this._decorationTypeSubtypes.hasOwnProperty(e)&&delete this._decorationTypeSubtypes[e]}getLayoutInfo(){return this._configuration.options.get(143)}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){this._configuration.observeContainer(e),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."),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 n=this._contentWidgets[t];n.position=e.getPosition(),this._modelData&&this._modelData.hasRealView&&this._modelData.view.layoutContentWidget(n)}}removeContentWidget(e){const t=e.getId();if(this._contentWidgets.hasOwnProperty(t)){const n=this._contentWidgets[t];delete this._contentWidgets[t],this._modelData&&this._modelData.hasRealView&&this._modelData.view.removeContentWidget(n)}}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 n=this._overlayWidgets[t];n.position=e.getPosition(),this._modelData&&this._modelData.hasRealView&&this._modelData.view.layoutOverlayWidget(n)}}removeOverlayWidget(e){const t=e.getId();if(this._overlayWidgets.hasOwnProperty(t)){const n=this._overlayWidgets[t];delete this._overlayWidgets[t],this._modelData&&this._modelData.hasRealView&&this._modelData.view.removeOverlayWidget(n)}}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 n=this._glyphMarginWidgets[t];n.position=e.getPosition(),this._modelData&&this._modelData.hasRealView&&this._modelData.view.layoutGlyphMarginWidget(n)}}removeGlyphMarginWidget(e){const t=e.getId();if(this._glyphMarginWidgets.hasOwnProperty(t)){const n=this._glyphMarginWidgets[t];delete this._glyphMarginWidgets[t],this._modelData&&this._modelData.hasRealView&&this._modelData.view.removeGlyphMarginWidget(n)}}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),n=this._configuration.options,o=n.get(143),r=M_._getVerticalOffsetForPosition(this._modelData,t.lineNumber,t.column)-this.getScrollTop(),s=this._modelData.view.getOffsetForColumn(t.lineNumber,t.column)+o.glyphMarginWidth+o.lineNumbersWidth+o.decorationsWidth-this.getScrollLeft();return{top:r,left:s,height:n.get(66)}}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.view.render(!0,e)}setAriaOptions(e){!this._modelData||!this._modelData.hasRealView||this._modelData.view.setAriaOptions(e)}applyFontInfo(e){rs(e,this._configuration.options.get(50))}setBanner(e,t){this._bannerDomNode&&this._domElement.contains(this._bannerDomNode)&&this._domElement.removeChild(this._bannerDomNode),this._bannerDomNode=e,this._configuration.setReservedHeight(e?t:0),this._bannerDomNode&&this._domElement.prepend(this._bannerDomNode)}_attachModel(e){if(!e){this._modelData=null;return}const t=[];this._domElement.setAttribute("data-mode-id",e.getLanguageId()),this._configuration.setIsDominatedByLongLines(e.isDominatedByLongLines()),this._configuration.setModelLineCount(e.getLineCount());const n=e.onBeforeAttached(),o=new wlt(this._id,this._configuration,e,qG.create(),KG.create(this._configuration.options),a=>Fc(a),this.languageConfigurationService,this._themeService,n);t.push(e.onWillDispose(()=>this.setModel(null))),t.push(o.onEvent(a=>{switch(a.kind){case 0:this._onDidContentSizeChange.fire(a);break;case 1:this._editorTextFocus.setValue(a.hasFocus);break;case 2:this._onDidScrollChange.fire(a);break;case 3:this._onDidChangeViewZones.fire();break;case 4:this._onDidChangeHiddenAreas.fire();break;case 5:this._onDidAttemptReadOnlyEdit.fire();break;case 6:{if(a.reachedMaxCursorCount){const d=this.getOption(79),h=C("cursors.maximum","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.",d);this._notificationService.prompt(L5.Warning,h,[{label:"Find and Replace",run:()=>{this._commandService.executeCommand("editor.action.startFindReplaceAction")}},{label:C("goToSetting","Increase Multi Cursor Limit"),run:()=>{this._commandService.executeCommand("workbench.action.openSettings2",{query:"editor.multiCursorLimit"})}}])}const l=[];for(let d=0,h=a.selections.length;d{this._paste("keyboard",r,s,a,l)},type:r=>{this._type("keyboard",r)},compositionType:(r,s,a,l)=>{this._compositionType("keyboard",r,s,a,l)},startComposition:()=>{this._startComposition()},endComposition:()=>{this._endComposition("keyboard")},cut:()=>{this._cut("keyboard")}}:t={paste:(r,s,a,l)=>{const c={text:r,pasteOnNewLine:s,multicursorText:a,mode:l};this._commandService.executeCommand("paste",c)},type:r=>{const s={text:r};this._commandService.executeCommand("type",s)},compositionType:(r,s,a,l)=>{if(a||l){const c={text:r,replacePrevCharCnt:s,replaceNextCharCnt:a,positionDelta:l};this._commandService.executeCommand("compositionType",c)}else{const c={text:r,replaceCharCnt:s};this._commandService.executeCommand("replacePreviousChar",c)}},startComposition:()=>{this._commandService.executeCommand("compositionStart",{})},endComposition:()=>{this._commandService.executeCommand("compositionEnd",{})},cut:()=>{this._commandService.executeCommand("cut",{})}};const n=new b5(e.coordinatesConverter);return n.onKeyDown=r=>this._onKeyDown.fire(r),n.onKeyUp=r=>this._onKeyUp.fire(r),n.onContextMenu=r=>this._onContextMenu.fire(r),n.onMouseMove=r=>this._onMouseMove.fire(r),n.onMouseLeave=r=>this._onMouseLeave.fire(r),n.onMouseDown=r=>this._onMouseDown.fire(r),n.onMouseUp=r=>this._onMouseUp.fire(r),n.onMouseDrag=r=>this._onMouseDrag.fire(r),n.onMouseDrop=r=>this._onMouseDrop.fire(r),n.onMouseDropCanceled=r=>this._onMouseDropCanceled.fire(r),n.onMouseWheel=r=>this._onMouseWheel.fire(r),[new _H(t,this._configuration,this._themeService.getColorTheme(),e,n,this._overflowWidgetsDomNode,this._instantiationService),!0]}_postDetachModelCleanup(e){e==null||e.removeAllDecorationsWithOwnerId(this._id)}_detachModel(){if(!this._modelData)return null;const e=this._modelData.model,t=this._modelData.hasRealView?this._modelData.view.domNode.domNode:null;return this._modelData.dispose(),this._modelData=null,this._domElement.removeAttribute("data-mode-id"),t&&this._domElement.contains(t)&&this._domElement.removeChild(t),this._bannerDomNode&&this._domElement.contains(this._bannerDomNode)&&this._domElement.removeChild(this._bannerDomNode),e}_removeDecorationType(e){this._codeEditorService.removeDecorationType(e)}hasModel(){return this._modelData!==null}showDropIndicatorAt(e){const t=[{range:new V(e.lineNumber,e.column,e.lineNumber,e.column),options:M_.dropIntoEditorDecorationOptions}];this._dropIntoEditorDecorations.set(t),this.revealPosition(e,1)}removeDropIndicator(){this._dropIntoEditorDecorations.clear()}setContextValue(e,t){this._contextKeyService.createKey(e,t)}};ky.dropIntoEditorDecorationOptions=Jt.register({description:"workbench-dnd-target",className:"dnd-target"});ky=M_=Mlt([Zf(3,$t),Zf(4,Jn),Zf(5,_o),Zf(6,Ut),Zf(7,mr),Zf(8,Ao),Zf(9,pp),Zf(10,Ti),Zf(11,pt)],ky);class Dse extends _e{constructor(e){super(),this._emitterOptions=e,this._onDidChangeToTrue=this._register(new le(this._emitterOptions)),this.onDidChangeToTrue=this._onDidChangeToTrue.event,this._onDidChangeToFalse=this._register(new le(this._emitterOptions)),this.onDidChangeToFalse=this._onDidChangeToFalse.event,this._value=0}setValue(e){const t=e?2:1;this._value!==t&&(this._value=t,this._value===2?this._onDidChangeToTrue.fire():this._value===1&&this._onDidChangeToFalse.fire())}}class Rs extends le{constructor(e,t){super({deliveryQueue:t}),this._contributions=e}fire(e){this._contributions.onBeforeInteractionEvent(),super.fire(e)}}class Flt extends _e{constructor(e,t){super(),this._editor=e,t.createKey("editorId",e.getId()),this._editorSimpleInput=Q.editorSimpleInput.bindTo(t),this._editorFocus=Q.focus.bindTo(t),this._textInputFocus=Q.textInputFocus.bindTo(t),this._editorTextFocus=Q.editorTextFocus.bindTo(t),this._tabMovesFocus=Q.tabMovesFocus.bindTo(t),this._editorReadonly=Q.readOnly.bindTo(t),this._inDiffEditor=Q.inDiffEditor.bindTo(t),this._editorColumnSelection=Q.columnSelection.bindTo(t),this._hasMultipleSelections=Q.hasMultipleSelections.bindTo(t),this._hasNonEmptySelection=Q.hasNonEmptySelection.bindTo(t),this._canUndo=Q.canUndo.bindTo(t),this._canRedo=Q.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(Cy.onDidChangeTabFocus(n=>this._tabMovesFocus.set(n))),this._updateFromConfig(),this._updateFromSelection(),this._updateFromFocus(),this._updateFromModel(),this._editorSimpleInput.set(this._editor.isSimpleWidget)}_updateFromConfig(){const e=this._editor.getOptions();this._tabMovesFocus.set(Cy.getTabFocusMode()),this._editorReadonly.set(e.get(90)),this._inDiffEditor.set(e.get(61)),this._editorColumnSelection.set(e.get(22))}_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(Boolean(e&&e.canUndo())),this._canRedo.set(Boolean(e&&e.canRedo()))}}class Blt extends _e{constructor(e,t,n){super(),this._editor=e,this._contextKeyService=t,this._languageFeaturesService=n,this._langId=Q.languageId.bindTo(t),this._hasCompletionItemProvider=Q.hasCompletionItemProvider.bindTo(t),this._hasCodeActionsProvider=Q.hasCodeActionsProvider.bindTo(t),this._hasCodeLensProvider=Q.hasCodeLensProvider.bindTo(t),this._hasDefinitionProvider=Q.hasDefinitionProvider.bindTo(t),this._hasDeclarationProvider=Q.hasDeclarationProvider.bindTo(t),this._hasImplementationProvider=Q.hasImplementationProvider.bindTo(t),this._hasTypeDefinitionProvider=Q.hasTypeDefinitionProvider.bindTo(t),this._hasHoverProvider=Q.hasHoverProvider.bindTo(t),this._hasDocumentHighlightProvider=Q.hasDocumentHighlightProvider.bindTo(t),this._hasDocumentSymbolProvider=Q.hasDocumentSymbolProvider.bindTo(t),this._hasReferenceProvider=Q.hasReferenceProvider.bindTo(t),this._hasRenameProvider=Q.hasRenameProvider.bindTo(t),this._hasSignatureHelpProvider=Q.hasSignatureHelpProvider.bindTo(t),this._hasInlayHintsProvider=Q.hasInlayHintsProvider.bindTo(t),this._hasDocumentFormattingProvider=Q.hasDocumentFormattingProvider.bindTo(t),this._hasDocumentSelectionFormattingProvider=Q.hasDocumentSelectionFormattingProvider.bindTo(t),this._hasMultipleDocumentFormattingProvider=Q.hasMultipleDocumentFormattingProvider.bindTo(t),this._hasMultipleDocumentSelectionFormattingProvider=Q.hasMultipleDocumentSelectionFormattingProvider.bindTo(t),this._isInWalkThrough=Q.isInWalkThroughSnippet.bindTo(t);const o=()=>this._update();this._register(e.onDidChangeModel(o)),this._register(e.onDidChangeModelLanguage(o)),this._register(n.completionProvider.onDidChange(o)),this._register(n.codeActionProvider.onDidChange(o)),this._register(n.codeLensProvider.onDidChange(o)),this._register(n.definitionProvider.onDidChange(o)),this._register(n.declarationProvider.onDidChange(o)),this._register(n.implementationProvider.onDidChange(o)),this._register(n.typeDefinitionProvider.onDidChange(o)),this._register(n.hoverProvider.onDidChange(o)),this._register(n.documentHighlightProvider.onDidChange(o)),this._register(n.documentSymbolProvider.onDidChange(o)),this._register(n.referenceProvider.onDidChange(o)),this._register(n.renameProvider.onDidChange(o)),this._register(n.documentFormattingEditProvider.onDidChange(o)),this._register(n.documentRangeFormattingEditProvider.onDidChange(o)),this._register(n.signatureHelpProvider.onDidChange(o)),this._register(n.inlayHintsProvider.onDidChange(o)),o()}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._isInWalkThrough.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._isInWalkThrough.set(e.uri.scheme===hn.walkThroughSnippet)})}}class Wlt extends _e{constructor(e){super(),this._onChange=this._register(new le),this.onChange=this._onChange.event,this._hasFocus=!1,this._domFocusTracker=this._register(gf(e)),this._register(this._domFocusTracker.onDidFocus(()=>{this._hasFocus=!0,this._onChange.fire(void 0)})),this._register(this._domFocusTracker.onDidBlur(()=>{this._hasFocus=!1,this._onChange.fire(void 0)}))}hasFocus(){return this._hasFocus}}class Vlt{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,n){return this._editor.onDidChangeModelDecorations(o=>{this._isChangingDecorations||e.call(t,o)},n)}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 n of this._decorationIds){const o=e.getDecorationRange(n);o&&t.push(o)}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}}const Hlt=encodeURIComponent("");function x9(i){return Hlt+encodeURIComponent(i.toString())+$lt}const zlt=encodeURIComponent('');function jlt(i){return zlt+encodeURIComponent(i.toString())+Ult}Uu((i,e)=>{const t=i.getColor(Gh);t&&e.addRule(`.monaco-editor .squiggly-error { background: url("data:image/svg+xml,${x9(t)}") repeat-x bottom left; }`);const n=i.getColor(Hl);n&&e.addRule(`.monaco-editor .squiggly-warning { background: url("data:image/svg+xml,${x9(n)}") repeat-x bottom left; }`);const o=i.getColor(Ra);o&&e.addRule(`.monaco-editor .squiggly-info { background: url("data:image/svg+xml,${x9(o)}") repeat-x bottom left; }`);const r=i.getColor(pnt);r&&e.addRule(`.monaco-editor .squiggly-hint { background: url("data:image/svg+xml,${jlt(r)}") no-repeat bottom left; }`);const s=i.getColor(Dot);s&&e.addRule(`.monaco-editor.showUnused .squiggly-inline-unnecessary { opacity: ${s.rgba.a}; }`)});var Klt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},qlt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},Glt=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};let MH=class extends _e{constructor(e){super(),this._themeService=e,this._onWillCreateCodeEditor=this._register(new le),this._onCodeEditorAdd=this._register(new le),this.onCodeEditorAdd=this._onCodeEditorAdd.event,this._onCodeEditorRemove=this._register(new le),this.onCodeEditorRemove=this._onCodeEditorRemove.event,this._onWillCreateDiffEditor=this._register(new le),this._onDiffEditorAdd=this._register(new le),this.onDiffEditorAdd=this._onDiffEditorAdd.event,this._onDiffEditorRemove=this._register(new le),this.onDiffEditorRemove=this._onDiffEditorRemove.event,this._decorationOptionProviders=new Map,this._codeEditorOpenHandlers=new ia,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)}listDiffEditors(){return Object.keys(this._diffEditors).map(e=>this._diffEditors[e])}getFocusedCodeEditor(){let e=null;const t=this.listCodeEditors();for(const n of t){if(n.hasTextFocus())return n;n.hasWidgetFocus()&&(e=n)}return e}removeDecorationType(e){const t=this._decorationOptionProviders.get(e);t&&(t.refCount--,t.refCount<=0&&(this._decorationOptionProviders.delete(e),t.dispose(),this.listCodeEditors().forEach(n=>n.removeDecorationsByType(e))))}setModelProperty(e,t,n){const o=e.toString();let r;this._modelProperties.has(o)?r=this._modelProperties.get(o):(r=new Map,this._modelProperties.set(o,r)),r.set(t,n)}getModelProperty(e,t){const n=e.toString();if(this._modelProperties.has(n))return this._modelProperties.get(n).get(t)}openCodeEditor(e,t,n){return Glt(this,void 0,void 0,function*(){for(const o of this._codeEditorOpenHandlers){const r=yield o(e,t,n);if(r!==null)return r}return null})}registerCodeEditorOpenHandler(e){const t=this._codeEditorOpenHandlers.unshift(e);return zt(t)}};MH=Klt([qlt(0,mr)],MH);var Xlt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},kse=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},Ylt=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};let CP=class extends MH{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((n,o,r)=>Ylt(this,void 0,void 0,function*(){return o?this.doOpenEditor(o,n):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===hn.http||r===hn.https)return c0e(t.resource.toString()),e}return null}const o=t.options?t.options.selection:null;if(o)if(typeof o.endLineNumber=="number"&&typeof o.endColumn=="number")e.setSelection(o),e.revealRangeInCenter(o,1);else{const r={lineNumber:o.startLineNumber,column:o.startColumn};e.setPosition(r),e.revealPositionInCenter(r,1)}return e}findModel(e,t){const n=e.getModel();return n&&n.uri.toString()!==t.toString()?null:n}};CP=Xlt([kse(0,Ut),kse(1,mr)],CP);Mn(Jn,CP,0);const yS=wn("layoutService");var n1e=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},i1e=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let wP=class{get dimension(){return this._dimension||(this._dimension=mS(window.document.body)),this._dimension}get hasContainer(){return!1}get container(){throw new Error("ILayoutService.container is not available in the standalone editor!")}focus(){var e;(e=this._codeEditorService.getFocusedCodeEditor())===null||e===void 0||e.focus()}constructor(e){this._codeEditorService=e,this.onDidLayout=st.None,this.offset={top:0,quickPickTop:0}}};wP=n1e([i1e(0,Jn)],wP);let AH=class extends wP{get hasContainer(){return!1}get container(){return this._container}constructor(e,t){super(t),this._container=e}};AH=n1e([i1e(1,Jn)],AH);Mn(yS,wP,1);const JI=wn("dialogService");var Zlt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Ise=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},S2=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};function x2(i){return i.scheme===hn.file?i.fsPath:i.path}let o1e=0;class L2{constructor(e,t,n,o,r,s,a){this.id=++o1e,this.type=0,this.actual=e,this.label=e.label,this.confirmBeforeUndo=e.confirmBeforeUndo||!1,this.resourceLabel=t,this.strResource=n,this.resourceLabels=[this.resourceLabel],this.strResources=[this.strResource],this.groupId=o,this.groupOrder=r,this.sourceId=s,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}`}}class Tse{constructor(e,t){this.resourceLabel=e,this.reason=t}}class Nse{constructor(){this.elements=new Map}createMessage(){const e=[],t=[];for(const[,o]of this.elements)(o.reason===0?e:t).push(o.resourceLabel);const n=[];return e.length>0&&n.push(C({key:"externalRemoval",comment:["{0} is a list of filenames"]},"The following files have been closed and modified on disk: {0}.",e.join(", "))),t.length>0&&n.push(C({key:"noParallelUniverses",comment:["{0} is a list of filenames"]},"The following files have been modified in an incompatible way: {0}.",t.join(", "))),n.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 Qlt{constructor(e,t,n,o,r,s,a){this.id=++o1e,this.type=1,this.actual=e,this.label=e.label,this.confirmBeforeUndo=e.confirmBeforeUndo||!1,this.resourceLabels=t,this.strResources=n,this.groupId=o,this.groupOrder=r,this.sourceId=s,this.sourceOrder=a,this.removedResources=null,this.invalidatedResources=null}canSplit(){return typeof this.actual.split=="function"}removeResource(e,t,n){this.removedResources||(this.removedResources=new Nse),this.removedResources.has(t)||this.removedResources.set(t,new Tse(e,n))}setValid(e,t,n){n?this.invalidatedResources&&(this.invalidatedResources.delete(t),this.invalidatedResources.size===0&&(this.invalidatedResources=null)):(this.invalidatedResources||(this.invalidatedResources=new Nse),this.invalidatedResources.has(t)||this.invalidatedResources.set(t,new Tse(e,0)))}toString(){return`[id:${this.id}] [group:${this.groupId}] [${this.invalidatedResources?"INVALID":" VALID"}] ${this.actual.constructor.name} - ${this.actual}`}}class r1e{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===1&&e.removeResource(this.resourceLabel,this.strResource,0);for(const e of this._future)e.type===1&&e.removeResource(this.resourceLabel,this.strResource,0);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++}_setElementValidFlag(e,t){e.type===1?e.setValid(this.resourceLabel,this.strResource,t):e.setValid(t)}setElementsValidFlag(e,t){for(const n of this._past)t(n.actual)&&this._setElementValidFlag(n,e);for(const n of this._future)t(n.actual)&&this._setElementValidFlag(n,e)}pushElement(e){for(const t of this._future)t.type===1&&t.removeResource(this.resourceLabel,this.strResource,1);this._future=[],this._past.push(e),this.versionId++}createSnapshot(e){const t=[];for(let n=0,o=this._past.length;n=0;n--)t.push(this._future[n].id);return new Zbe(e,t)}restoreSnapshot(e){const t=e.elements.length;let n=!0,o=0,r=-1;for(let a=0,l=this._past.length;a=t||c.id!==e.elements[o])&&(n=!1,r=0),!n&&c.type===1&&c.removeResource(this.resourceLabel,this.strResource,0)}let s=-1;for(let a=this._future.length-1;a>=0;a--,o++){const l=this._future[a];n&&(o>=t||l.id!==e.elements[o])&&(n=!1,s=a),!n&&l.type===1&&l.removeResource(this.resourceLabel,this.strResource,0)}r!==-1&&(this._past=this._past.slice(0,r)),s!==-1&&(this._future=this._future.slice(s+1)),this.versionId++}getElements(){const e=[],t=[];for(const n of this._past)e.push(n.actual);for(const n of this._future)t.push(n.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 n=this._past.length-1;n>=0;n--)if(this._past[n]===e){t.has(this.strResource)?this._past[n]=t.get(this.strResource):this._past.splice(n,1);break}this.versionId++}splitFutureWorkspaceElement(e,t){for(let n=this._future.length-1;n>=0;n--)if(this._future[n]===e){t.has(this.strResource)?this._future[n]=t.get(this.strResource):this._future.splice(n,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 L9{constructor(e){this.editStacks=e,this._versionIds=[];for(let t=0,n=this.editStacks.length;tt.sourceOrder)&&(t=s,n=o)}return[t,n]}canUndo(e){if(e instanceof Ph){const[,n]=this._findClosestUndoElementWithSource(e.id);return!!n}const t=this.getUriComparisonKey(e);return this._editStacks.has(t)?this._editStacks.get(t).hasPastElements():!1}_onError(e,t){en(e);for(const n of t.strResources)this.removeElements(n);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,n,o,r){const s=this._acquireLocks(n);let a;try{a=t()}catch(l){return s(),o.dispose(),this._onError(l,e)}return a?a.then(()=>(s(),o.dispose(),r()),l=>(s(),o.dispose(),this._onError(l,e))):(s(),o.dispose(),r())}_invokeWorkspacePrepare(e){return S2(this,void 0,void 0,function*(){if(typeof e.actual.prepareUndoRedo=="undefined")return _e.None;const t=e.actual.prepareUndoRedo();return typeof t=="undefined"?_e.None:t})}_invokeResourcePrepare(e,t){if(e.actual.type!==1||typeof e.actual.prepareUndoRedo=="undefined")return t(_e.None);const n=e.actual.prepareUndoRedo();return n?Rq(n)?t(n):n.then(o=>t(o)):t(_e.None)}_getAffectedEditStacks(e){const t=[];for(const n of e.strResources)t.push(this._editStacks.get(n)||s1e);return new L9(t)}_tryToSplitAndUndo(e,t,n,o){if(t.canSplit())return this._splitPastWorkspaceElement(t,n),this._notificationService.warn(o),new E2(this._undo(e,0,!0));for(const r of t.strResources)this.removeElements(r);return this._notificationService.warn(o),new E2}_checkWorkspaceUndo(e,t,n,o){if(t.removedResources)return this._tryToSplitAndUndo(e,t,t.removedResources,C({key:"cannotWorkspaceUndo",comment:["{0} is a label for an operation. {1} is another message."]},"Could not undo '{0}' across all files. {1}",t.label,t.removedResources.createMessage()));if(o&&t.invalidatedResources)return this._tryToSplitAndUndo(e,t,t.invalidatedResources,C({key:"cannotWorkspaceUndo",comment:["{0} is a label for an operation. {1} is another message."]},"Could not undo '{0}' across all files. {1}",t.label,t.invalidatedResources.createMessage()));const r=[];for(const a of n.editStacks)a.getClosestPastElement()!==t&&r.push(a.resourceLabel);if(r.length>0)return this._tryToSplitAndUndo(e,t,null,C({key:"cannotWorkspaceUndoDueToChanges",comment:["{0} is a label for an operation. {1} is a list of filenames."]},"Could not undo '{0}' across all files because changes were made to {1}",t.label,r.join(", ")));const s=[];for(const a of n.editStacks)a.locked&&s.push(a.resourceLabel);return s.length>0?this._tryToSplitAndUndo(e,t,null,C({key:"cannotWorkspaceUndoDueToInProgressUndoRedo",comment:["{0} is a label for an operation. {1} is a list of filenames."]},"Could not undo '{0}' across all files because there is already an undo or redo operation running on {1}",t.label,s.join(", "))):n.isValid()?null:this._tryToSplitAndUndo(e,t,null,C({key:"cannotWorkspaceUndoDueToInMeantimeUndoRedo",comment:["{0} is a label for an operation. {1} is a list of filenames."]},"Could not undo '{0}' across all files because an undo or redo operation occurred in the meantime",t.label))}_workspaceUndo(e,t,n){const o=this._getAffectedEditStacks(t),r=this._checkWorkspaceUndo(e,t,o,!1);return r?r.returnValue:this._confirmAndExecuteWorkspaceUndo(e,t,o,n)}_isPartOfUndoGroup(e){if(!e.groupId)return!1;for(const[,t]of this._editStacks){const n=t.getClosestPastElement();if(!!n){if(n===e){const o=t.getSecondClosestPastElement();if(o&&o.groupId===e.groupId)return!0}if(n.groupId===e.groupId)return!0}}return!1}_confirmAndExecuteWorkspaceUndo(e,t,n,o){return S2(this,void 0,void 0,function*(){if(t.canSplit()&&!this._isPartOfUndoGroup(t)){let a;(function(u){u[u.All=0]="All",u[u.This=1]="This",u[u.Cancel=2]="Cancel"})(a||(a={}));const{result:l}=yield this._dialogService.prompt({type:So.Info,message:C("confirmWorkspace","Would you like to undo '{0}' across all files?",t.label),buttons:[{label:C({key:"ok",comment:["{0} denotes a number that is > 1, && denotes a mnemonic"]},"&&Undo in {0} Files",n.editStacks.length),run:()=>a.All},{label:C({key:"nok",comment:["&& denotes a mnemonic"]},"Undo this &&File"),run:()=>a.This}],cancelButton:{run:()=>a.Cancel}});if(l===a.Cancel)return;if(l===a.This)return this._splitPastWorkspaceElement(t,null),this._undo(e,0,!0);const c=this._checkWorkspaceUndo(e,t,n,!1);if(c)return c.returnValue;o=!0}let r;try{r=yield this._invokeWorkspacePrepare(t)}catch(a){return this._onError(a,t)}const s=this._checkWorkspaceUndo(e,t,n,!0);if(s)return r.dispose(),s.returnValue;for(const a of n.editStacks)a.moveBackward(t);return this._safeInvokeWithLocks(t,()=>t.actual.undo(),n,r,()=>this._continueUndoInGroup(t.groupId,o))})}_resourceUndo(e,t,n){if(!t.isValid){e.flushAllElements();return}if(e.locked){const o=C({key:"cannotResourceUndoDueToInProgressUndoRedo",comment:["{0} is a label for an operation."]},"Could not undo '{0}' because there is already an undo or redo operation running.",t.label);this._notificationService.warn(o);return}return this._invokeResourcePrepare(t,o=>(e.moveBackward(t),this._safeInvokeWithLocks(t,()=>t.actual.undo(),new L9([e]),o,()=>this._continueUndoInGroup(t.groupId,n))))}_findClosestUndoElementInGroup(e){if(!e)return[null,null];let t=null,n=null;for(const[o,r]of this._editStacks){const s=r.getClosestPastElement();!s||s.groupId===e&&(!t||s.groupOrder>t.groupOrder)&&(t=s,n=o)}return[t,n]}_continueUndoInGroup(e,t){if(!e)return;const[,n]=this._findClosestUndoElementInGroup(e);if(n)return this._undo(n,0,t)}undo(e){if(e instanceof Ph){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,n){if(!this._editStacks.has(e))return;const o=this._editStacks.get(e),r=o.getClosestPastElement();if(!r)return;if(r.groupId){const[a,l]=this._findClosestUndoElementInGroup(r.groupId);if(r!==a&&l)return this._undo(l,t,n)}if((r.sourceId!==t||r.confirmBeforeUndo)&&!n)return this._confirmAndContinueUndo(e,t,r);try{return r.type===1?this._workspaceUndo(e,r,n):this._resourceUndo(o,r,n)}finally{}}_confirmAndContinueUndo(e,t,n){return S2(this,void 0,void 0,function*(){if(!!(yield this._dialogService.confirm({message:C("confirmDifferentSource","Would you like to undo '{0}'?",n.label),primaryButton:C({key:"confirmDifferentSource.yes",comment:["&& denotes a mnemonic"]},"&&Yes"),cancelButton:C("confirmDifferentSource.no","No")})).confirmed)return this._undo(e,t,!0)})}_findClosestRedoElementWithSource(e){if(!e)return[null,null];let t=null,n=null;for(const[o,r]of this._editStacks){const s=r.getClosestFutureElement();!s||s.sourceId===e&&(!t||s.sourceOrder0)return this._tryToSplitAndRedo(e,t,null,C({key:"cannotWorkspaceRedoDueToChanges",comment:["{0} is a label for an operation. {1} is a list of filenames."]},"Could not redo '{0}' across all files because changes were made to {1}",t.label,r.join(", ")));const s=[];for(const a of n.editStacks)a.locked&&s.push(a.resourceLabel);return s.length>0?this._tryToSplitAndRedo(e,t,null,C({key:"cannotWorkspaceRedoDueToInProgressUndoRedo",comment:["{0} is a label for an operation. {1} is a list of filenames."]},"Could not redo '{0}' across all files because there is already an undo or redo operation running on {1}",t.label,s.join(", "))):n.isValid()?null:this._tryToSplitAndRedo(e,t,null,C({key:"cannotWorkspaceRedoDueToInMeantimeUndoRedo",comment:["{0} is a label for an operation. {1} is a list of filenames."]},"Could not redo '{0}' across all files because an undo or redo operation occurred in the meantime",t.label))}_workspaceRedo(e,t){const n=this._getAffectedEditStacks(t),o=this._checkWorkspaceRedo(e,t,n,!1);return o?o.returnValue:this._executeWorkspaceRedo(e,t,n)}_executeWorkspaceRedo(e,t,n){return S2(this,void 0,void 0,function*(){let o;try{o=yield this._invokeWorkspacePrepare(t)}catch(s){return this._onError(s,t)}const r=this._checkWorkspaceRedo(e,t,n,!0);if(r)return o.dispose(),r.returnValue;for(const s of n.editStacks)s.moveForward(t);return this._safeInvokeWithLocks(t,()=>t.actual.redo(),n,o,()=>this._continueRedoInGroup(t.groupId))})}_resourceRedo(e,t){if(!t.isValid){e.flushAllElements();return}if(e.locked){const n=C({key:"cannotResourceRedoDueToInProgressUndoRedo",comment:["{0} is a label for an operation."]},"Could not redo '{0}' because there is already an undo or redo operation running.",t.label);this._notificationService.warn(n);return}return this._invokeResourcePrepare(t,n=>(e.moveForward(t),this._safeInvokeWithLocks(t,()=>t.actual.redo(),new L9([e]),n,()=>this._continueRedoInGroup(t.groupId))))}_findClosestRedoElementInGroup(e){if(!e)return[null,null];let t=null,n=null;for(const[o,r]of this._editStacks){const s=r.getClosestFutureElement();!s||s.groupId===e&&(!t||s.groupOrderXG(i,t))}function ect(i){let e;const t=/^L?(\d+)(?:,(\d+))?(-L?(\d+)(?:,(\d+))?)?/.exec(i.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},i=i.with({fragment:""})),{selection:e,uri:i}}var tct=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Mse=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const Kc=wn("ILanguageFeatureDebounceService");var yP;(function(i){const e=new WeakMap;let t=0;function n(o){let r=e.get(o);return r===void 0&&(r=++t,e.set(o,r)),r}i.of=n})(yP||(yP={}));class nct{constructor(e){this._default=e}get(e){return this._default}update(e,t){return this._default}default(){return this._default}}class ict{constructor(e,t,n,o,r,s){this._logService=e,this._name=t,this._registry=n,this._default=o,this._min=r,this._max=s,this._cache=new Yv(50,.7)}_key(e){return e.id+this._registry.all(e).reduce((t,n)=>l5(yP.of(n),t),0)}get(e){const t=this._key(e),n=this._cache.get(t);return n?Za(n.value,this._min,this._max):this.default()}update(e,t){const n=this._key(e);let o=this._cache.get(n);o||(o=new Jlt(6),this._cache.set(n,o));const r=Za(o.update(t),this._min,this._max);return XG(e.uri,"output")||this._logService.trace(`[DEBOUNCE: ${this._name}] for ${e.uri.toString()} is ${r}ms`),r}_overall(){const e=new a1e;for(const[,t]of this._cache)e.update(t.value);return e.value}default(){const e=this._overall()|0||this._default;return Za(e,this._min,this._max)}}let OH=class{constructor(e,t){this._logService=e,this._data=new Map,this._isDev=t.isExtensionDevelopment||!t.isBuilt}for(e,t,n){var o,r,s;const a=(o=n==null?void 0:n.min)!==null&&o!==void 0?o:50,l=(r=n==null?void 0:n.max)!==null&&r!==void 0?r:Math.pow(a,2),c=(s=n==null?void 0:n.key)!==null&&s!==void 0?s:void 0,u=`${yP.of(e)},${a}${c?","+c:""}`;let d=this._data.get(u);return d||(this._isDev?d=new ict(this._logService,t,e,this._overallAverage()|0||a*1.5,a,l):(this._logService.debug(`[DEBOUNCE: ${t}] is disabled in developed mode`),d=new nct(a*1.5)),this._data.set(u,d)),d}_overallAverage(){const e=new a1e;for(const t of this._data.values())e.update(t.default());return e.value}};OH=tct([Mse(0,tc),Mse(1,GG)],OH);Mn(Kc,OH,1);class xE{static create(e,t){return new xE(e,new SP(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 V(this._startLineNumber+e.startLineNumber,e.startColumn,this._startLineNumber+e.endLineNumber,e.endColumn)}removeTokens(e){const t=e.startLineNumber-this._startLineNumber,n=e.endLineNumber-this._startLineNumber;this._startLineNumber+=this._tokens.removeTokens(t,e.startColumn-1,n,e.endColumn-1),this._updateEndLineNumber()}split(e){const t=e.startLineNumber-this._startLineNumber,n=e.endLineNumber-this._startLineNumber,[o,r,s]=this._tokens.split(t,e.startColumn-1,n,e.endColumn-1);return[new xE(this._startLineNumber,o),new xE(this._startLineNumber+s,r)]}applyEdit(e,t){const[n,o,r]=Dv(t);this.acceptEdit(e,n,o,r,t.length>0?t.charCodeAt(0):0)}acceptEdit(e,t,n,o,r){this._acceptDeleteRange(e),this._acceptInsertText(new ae(e.startLineNumber,e.startColumn),t,n,o,r),this._updateEndLineNumber()}_acceptDeleteRange(e){if(e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn)return;const t=e.startLineNumber-this._startLineNumber,n=e.endLineNumber-this._startLineNumber;if(n<0){const r=n-t;this._startLineNumber-=r;return}const o=this._tokens.getMaxDeltaLine();if(!(t>=o+1)){if(t<0&&n>=o+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,n,e.endColumn-1)}else this._tokens.acceptDeleteRange(0,t,e.startColumn-1,n,e.endColumn-1)}}_acceptInsertText(e,t,n,o,r){if(t===0&&n===0)return;const s=e.lineNumber-this._startLineNumber;if(s<0){this._startLineNumber+=t;return}const a=this._tokens.getMaxDeltaLine();s>=a+1||this._tokens.acceptInsertText(s,e.column-1,t,n,o,r)}}class SP{constructor(e){this._tokens=e,this._tokenCount=e.length/4}toString(e){const t=[];for(let n=0;ne)n=o-1;else{let s=o;for(;s>t&&this._getDeltaLine(s-1)===e;)s--;let a=o;for(;ae||h===e&&g>=t)&&(he||g===e&&v>=t){if(gr?p-=r-n:p=n;else if(f===t&&g===n)if(f===o&&p>r)p-=r-n;else{u=!0;continue}else if(fr)f=t,g=n,p=g+(p-r);else{u=!0;continue}else if(f>o){if(l===0&&!u){c=a;break}f-=l}else if(f===o&&g>=r)e&&f===0&&(g+=e,p+=e),f-=l,g-=r-n,p-=r-n;else throw new Error("Not possible!");const m=4*c;s[m]=f,s[m+1]=g,s[m+2]=p,s[m+3]=v,c++}this._tokenCount=c}acceptInsertText(e,t,n,o,r,s){const a=n===0&&o===1&&(s>=48&&s<=57||s>=65&&s<=90||s>=97&&s<=122),l=this._tokens,c=this._tokenCount;for(let u=0;u=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},E9=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let FH=class{constructor(e,t,n,o){this._legend=e,this._themeService=t,this._languageService=n,this._logService=o,this._hasWarnedOverlappingTokens=!1,this._hasWarnedInvalidLengthTokens=!1,this._hasWarnedInvalidEditStart=!1,this._hashTable=new pg}getMetadata(e,t,n){const o=this._languageService.languageIdCodec.encodeLanguageId(n),r=this._hashTable.get(e,t,o);let s;if(r)s=r.metadata,this._logService.getLevel()===ts.Trace&&this._logService.trace(`SemanticTokensProviderStyling [CACHED] ${e} / ${t}: foreground ${ns.getForeground(s)}, fontStyle ${ns.getFontStyle(s).toString(2)}`);else{let a=this._legend.tokenTypes[e];const l=[];if(a){let c=t;for(let d=0;c>0&&d>1;c>0&&this._logService.getLevel()===ts.Trace&&(this._logService.trace(`SemanticTokensProviderStyling: unknown token modifier index: ${t.toString(2)} for legend: ${JSON.stringify(this._legend.tokenModifiers)}`),l.push("not-in-legend"));const u=this._themeService.getColorTheme().getTokenStyleMetadata(a,l,n);typeof u=="undefined"?s=2147483647:(s=0,typeof u.italic!="undefined"&&(s|=(u.italic?1:0)<<11|1),typeof u.bold!="undefined"&&(s|=(u.bold?2:0)<<11|2),typeof u.underline!="undefined"&&(s|=(u.underline?4:0)<<11|4),typeof u.strikethrough!="undefined"&&(s|=(u.strikethrough?8:0)<<11|8),u.foreground&&(s|=u.foreground<<15|16),s===0&&(s=2147483647))}else this._logService.getLevel()===ts.Trace&&this._logService.trace(`SemanticTokensProviderStyling: unknown token type index: ${e} for legend: ${JSON.stringify(this._legend.tokenTypes)}`),s=2147483647,a="not-in-legend";this._hashTable.add(e,t,o,s),this._logService.getLevel()===ts.Trace&&this._logService.trace(`SemanticTokensProviderStyling ${e} (${a}) / ${t} (${l.join(" ")}): foreground ${ns.getForeground(s)}, fontStyle ${ns.getFontStyle(s).toString(2)}`)}return s}warnOverlappingSemanticTokens(e,t){this._hasWarnedOverlappingTokens||(this._hasWarnedOverlappingTokens=!0,console.warn(`Overlapping semantic tokens detected at lineNumber ${e}, column ${t}`))}warnInvalidLengthSemanticTokens(e,t){this._hasWarnedInvalidLengthTokens||(this._hasWarnedInvalidLengthTokens=!0,console.warn(`Semantic token with invalid length detected at lineNumber ${e}, column ${t}`))}warnInvalidEditStart(e,t,n,o,r){this._hasWarnedInvalidEditStart||(this._hasWarnedInvalidEditStart=!0,console.warn(`Invalid semantic tokens edit detected (previousResultId: ${e}, resultId: ${t}) at edit #${n}: The provided start offset ${o} is outside the previous data (length ${r}).`))}};FH=oct([E9(1,mr),E9(2,Ki),E9(3,tc)],FH);function l1e(i,e,t){const n=i.data,o=i.data.length/5|0,r=Math.max(Math.ceil(o/1024),400),s=[];let a=0,l=1,c=0;for(;au&&n[5*_]===0;)_--;if(_-1===u){let w=d;for(;w+1D)e.warnOverlappingSemanticTokens(L,D+1);else{const A=e.getMetadata(k,R,t);A!==2147483647&&(g===0&&(g=L),h[f]=L-g,h[f+1]=D,h[f+2]=I,h[f+3]=A,f+=4,p=L,v=I)}l=L,c=D,a++}f!==h.length&&(h=h.subarray(0,f));const m=xE.create(g,h);s.push(m)}return s}class rct{constructor(e,t,n,o){this.tokenTypeIndex=e,this.tokenModifierSet=t,this.languageId=n,this.metadata=o,this.next=null}}class pg{constructor(){this._elementsCount=0,this._currentLengthIndex=0,this._currentLength=pg._SIZES[this._currentLengthIndex],this._growCount=Math.round(this._currentLengthIndex+1=this._growCount){const r=this._elements;this._currentLengthIndex++,this._currentLength=pg._SIZES[this._currentLengthIndex],this._growCount=Math.round(this._currentLengthIndex+1=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},D9=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let BH=class extends _e{constructor(e,t,n){super(),this._themeService=e,this._logService=t,this._languageService=n,this._caches=new WeakMap,this._register(this._themeService.onDidColorThemeChange(()=>{this._caches=new WeakMap}))}getStyling(e){return this._caches.has(e)||this._caches.set(e,new FH(e.getLegend(),this._themeService,this._languageService,this._logService)),this._caches.get(e)}};BH=sct([D9(0,mr),D9(1,tc),D9(2,Ki)],BH);Mn(E5,BH,1);var Pse=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};const D2="**",Ose="/",dM="[/\\\\]",hM="[^/\\\\]",act=/\//g;function Fse(i,e){switch(i){case 0:return"";case 1:return`${hM}*?`;default:return`(?:${dM}|${hM}+${dM}${e?`|${dM}${hM}+`:""})*?`}}function Bse(i,e){if(!i)return[];const t=[];let n=!1,o=!1,r="";for(const s of i){switch(s){case e:if(!n&&!o){t.push(r),r="";continue}break;case"{":n=!0;break;case"}":n=!1;break;case"[":o=!0;break;case"]":o=!1;break}r+=s}return r&&t.push(r),t}function c1e(i){if(!i)return"";let e="";const t=Bse(i,Ose);if(t.every(n=>n===D2))e=".*";else{let n=!1;t.forEach((o,r)=>{if(o===D2){if(n)return;e+=Fse(2,r===t.length-1)}else{let s=!1,a="",l=!1,c="";for(const u of o){if(u!=="}"&&s){a+=u;continue}if(l&&(u!=="]"||!c)){let d;u==="-"?d=u:(u==="^"||u==="!")&&!c?d="^":u===Ose?d="":d=Gl(u),c+=d;continue}switch(u){case"{":s=!0;continue;case"[":l=!0;continue;case"}":{e+=`(?:${Bse(a,",").map(f=>c1e(f)).join("|")})`,s=!1,a="";break}case"]":{e+="["+c+"]",l=!1,c="";break}case"?":e+=hM;continue;case"*":e+=Fse(1);continue;default:e+=Gl(u)}}rYG(a,e)).filter(a=>a!==lf),i),n=t.length;if(!n)return lf;if(n===1)return t[0];const o=function(a,l){for(let c=0,u=t.length;c!!a.allBasenames);r&&(o.allBasenames=r.allBasenames);const s=t.reduce((a,l)=>l.allPaths?a.concat(l.allPaths):a,[]);return s.length&&(o.allPaths=s),o}function $se(i,e,t){const n=Bd===Go.sep,o=n?i:i.replace(act,Bd),r=Bd+o,s=Go.sep+i;let a;return t?a=function(l,c){return typeof l=="string"&&(l===o||l.endsWith(r)||!n&&(l===i||l.endsWith(s)))?e:null}:a=function(l,c){return typeof l=="string"&&(l===o||!n&&l===i)?e:null},a.allPaths=[(t?"*/":"./")+i],a}function vct(i){try{const e=new RegExp(`^${c1e(i)}$`);return function(t){return e.lastIndex=0,typeof t=="string"&&e.test(t)?i:null}}catch{return lf}}function _ct(i,e,t){return!i||typeof e!="string"?!1:u1e(i)(e,void 0,t)}function u1e(i,e={}){if(!i)return Vse;if(typeof i=="string"||bct(i)){const t=YG(i,e);if(t===lf)return Vse;const n=function(o,r){return!!t(o,r)};return t.allBasenames&&(n.allBasenames=t.allBasenames),t.allPaths&&(n.allPaths=t.allPaths),n}return Cct(i,e)}function bct(i){const e=i;return e?typeof e.base=="string"&&typeof e.pattern=="string":!1}function Cct(i,e){const t=d1e(Object.getOwnPropertyNames(i).map(a=>wct(a,i[a],e)).filter(a=>a!==lf)),n=t.length;if(!n)return lf;if(!t.some(a=>!!a.requiresSiblings)){if(n===1)return t[0];const a=function(u,d){let h;for(let f=0,g=t.length;fPse(this,void 0,void 0,function*(){for(const f of h){const g=yield f;if(typeof g=="string")return g}return null}))():null},l=t.find(u=>!!u.allBasenames);l&&(a.allBasenames=l.allBasenames);const c=t.reduce((u,d)=>d.allPaths?u.concat(d.allPaths):u,[]);return c.length&&(a.allPaths=c),a}const o=function(a,l,c){let u,d;for(let h=0,f=t.length;hPse(this,void 0,void 0,function*(){for(const h of d){const f=yield h;if(typeof f=="string")return f}return null}))():null},r=t.find(a=>!!a.allBasenames);r&&(o.allBasenames=r.allBasenames);const s=t.reduce((a,l)=>l.allPaths?a.concat(l.allPaths):a,[]);return s.length&&(o.allPaths=s),o}function wct(i,e,t){if(e===!1)return lf;const n=YG(i,t);if(n===lf)return lf;if(typeof e=="boolean")return n;if(e){const o=e.when;if(typeof o=="string"){const r=(s,a,l,c)=>{if(!c||!n(s,a))return null;const u=o.replace("$(basename)",()=>l),d=c(u);return jV(d)?d.then(h=>h?i:null):d?i:null};return r.requiresSiblings=!0,r}}return n}function d1e(i,e){const t=i.filter(a=>!!a.basenames);if(t.length<2)return i;const n=t.reduce((a,l)=>{const c=l.basenames;return c?a.concat(c):a},[]);let o;if(e){o=[];for(let a=0,l=n.length;a{const c=l.patterns;return c?a.concat(c):a},[]);const r=function(a,l){if(typeof a!="string")return null;if(!l){let u;for(u=a.length;u>0;u--){const d=a.charCodeAt(u-1);if(d===47||d===92)break}l=a.substr(u)}const c=n.indexOf(l);return c!==-1?o[c]:null};r.basenames=n,r.patterns=o,r.allBasenames=n;const s=i.filter(a=>!a.basenames);return s.push(r),s}function h1e(i,e,t,n,o,r){if(Array.isArray(i)){let s=0;for(const a of i){const l=h1e(a,e,t,n,o,r);if(l===10)return l;l>s&&(s=l)}return s}else{if(typeof i=="string")return n?i==="*"?5:i===t?10:0:0;if(i){const{language:s,pattern:a,scheme:l,hasAccessToAllModels:c,notebookType:u}=i;if(!n&&!c)return 0;u&&o&&(e=o);let d=0;if(l)if(l===e.scheme)d=10;else if(l==="*")d=5;else return 0;if(s)if(s===t)d=10;else if(s==="*")d=Math.max(d,5);else return 0;if(u)if(u===r)d=10;else if(u==="*"&&r!==void 0)d=Math.max(d,5);else return 0;if(a){let h;if(typeof a=="string"?h=a:h=Object.assign(Object.assign({},a),{base:x_e(a.base)}),h===e.fsPath||_ct(h,e.fsPath))d=10;else return 0}return d}else return 0}}function f1e(i){return typeof i=="string"?!1:Array.isArray(i)?i.every(f1e):!!i.exclusive}class zse{constructor(e,t,n,o){this.uri=e,this.languageId=t,this.notebookUri=n,this.notebookType=o}equals(e){var t,n;return this.notebookType===e.notebookType&&this.languageId===e.languageId&&this.uri.toString()===e.uri.toString()&&((t=this.notebookUri)===null||t===void 0?void 0:t.toString())===((n=e.notebookUri)===null||n===void 0?void 0:n.toString())}}class fo{constructor(e){this._notebookInfoResolver=e,this._clock=0,this._entries=[],this._onDidChange=new le,this.onDidChange=this._onDidChange.event}register(e,t){let n={selector:e,provider:t,_score:-1,_time:this._clock++};return this._entries.push(n),this._lastCandidate=void 0,this._onDidChange.fire(this._entries.length),zt(()=>{if(n){const o=this._entries.indexOf(n);o>=0&&(this._entries.splice(o,1),this._lastCandidate=void 0,this._onDidChange.fire(this._entries.length),n=void 0)}})}has(e){return this.all(e).length>0}all(e){if(!e)return[];this._updateScores(e);const t=[];for(const n of this._entries)n._score>0&&t.push(n.provider);return t}ordered(e){const t=[];return this._orderedForEach(e,n=>t.push(n.provider)),t}orderedGroups(e){const t=[];let n,o;return this._orderedForEach(e,r=>{n&&o===r._score?n.push(r.provider):(o=r._score,n=[r.provider],t.push(n))}),t}_orderedForEach(e,t){this._updateScores(e);for(const n of this._entries)n._score>0&&t(n)}_updateScores(e){var t,n;const o=(t=this._notebookInfoResolver)===null||t===void 0?void 0:t.call(this,e.uri),r=o?new zse(e.uri,e.getLanguageId(),o.uri,o.type):new zse(e.uri,e.getLanguageId(),void 0,void 0);if(!(!((n=this._lastCandidate)===null||n===void 0)&&n.equals(r))){this._lastCandidate=r;for(const s of this._entries)if(s._score=h1e(s.selector,r.uri,r.languageId,het(e),r.notebookUri,r.notebookType),f1e(s.selector)&&s._score>0){for(const a of this._entries)a._score=0;s._score=1e3;break}this._entries.sort(fo._compareByScoreAndTime)}}static _compareByScoreAndTime(e,t){return e._scoret._score?-1:kL(e.selector)&&!kL(t.selector)?1:!kL(e.selector)&&kL(t.selector)?-1:e._timet._time?-1:0}}function kL(i){return typeof i=="string"?!1:Array.isArray(i)?i.some(kL):Boolean(i.isBuiltin)}class yct{constructor(){this.referenceProvider=new fo(this._score.bind(this)),this.renameProvider=new fo(this._score.bind(this)),this.codeActionProvider=new fo(this._score.bind(this)),this.definitionProvider=new fo(this._score.bind(this)),this.typeDefinitionProvider=new fo(this._score.bind(this)),this.declarationProvider=new fo(this._score.bind(this)),this.implementationProvider=new fo(this._score.bind(this)),this.documentSymbolProvider=new fo(this._score.bind(this)),this.inlayHintsProvider=new fo(this._score.bind(this)),this.colorProvider=new fo(this._score.bind(this)),this.codeLensProvider=new fo(this._score.bind(this)),this.documentFormattingEditProvider=new fo(this._score.bind(this)),this.documentRangeFormattingEditProvider=new fo(this._score.bind(this)),this.onTypeFormattingEditProvider=new fo(this._score.bind(this)),this.signatureHelpProvider=new fo(this._score.bind(this)),this.hoverProvider=new fo(this._score.bind(this)),this.documentHighlightProvider=new fo(this._score.bind(this)),this.selectionRangeProvider=new fo(this._score.bind(this)),this.foldingRangeProvider=new fo(this._score.bind(this)),this.linkProvider=new fo(this._score.bind(this)),this.inlineCompletionsProvider=new fo(this._score.bind(this)),this.completionProvider=new fo(this._score.bind(this)),this.linkedEditingRangeProvider=new fo(this._score.bind(this)),this.documentRangeSemanticTokensProvider=new fo(this._score.bind(this)),this.documentSemanticTokensProvider=new fo(this._score.bind(this)),this.documentOnDropEditProvider=new fo(this._score.bind(this)),this.documentPasteEditProvider=new fo(this._score.bind(this))}_score(e){var t;return(t=this._notebookTypeResolver)===null||t===void 0?void 0:t.call(this,e)}}Mn(pt,yct,1);const eT=wn("IWorkspaceEditService");class ZG{constructor(e){this.metadata=e}static convert(e){return e.edits.map(t=>{if(Kg.is(t))return Kg.lift(t);if(Nw.is(t))return Nw.lift(t);throw new Error("Unsupported edit")})}}class Kg extends ZG{static is(e){return e instanceof Kg?!0:na(e)&&Rt.isUri(e.resource)&&na(e.textEdit)}static lift(e){return e instanceof Kg?e:new Kg(e.resource,e.textEdit,e.versionId,e.metadata)}constructor(e,t,n=void 0,o){super(o),this.resource=e,this.textEdit=t,this.versionId=n}}class Nw extends ZG{static is(e){return e instanceof Nw?!0:na(e)&&(Boolean(e.newResource)||Boolean(e.oldResource))}static lift(e){return e instanceof Nw?e:new Nw(e.oldResource,e.newResource,e.options,e.metadata)}constructor(e,t,n={},o){super(o),this.oldResource=e,this.newResource=t,this.options=n}}const Ms={enableSplitViewResizing:!0,splitViewDefaultRatio:.5,renderSideBySide:!0,renderMarginRevertIcon:!0,maxComputationTime:5e3,maxFileSize:50,ignoreTrimWhitespace:!0,renderIndicators:!0,originalEditable:!1,diffCodeLens:!1,renderOverviewRuler:!0,diffWordWrap:"inherit",diffAlgorithm:"advanced",accessibilityVerbose:!1,experimental:{showMoves:!1,showEmptyDecorations:!0},hideUnchangedRegions:{enabled:!1,contextLineCount:3,minimumLineCount:3,revealLineCount:20},isInEmbeddedEditor:!1,onlyShowAccessibleDiffViewer:!1,renderSideBySideInlineBreakpoint:900,useInlineViewWhenSpaceIsLimited:!0},D5=Object.freeze({id:"editor",order:5,type:"object",title:C("editorConfigurationTitle","Editor"),scope:5}),xP=Object.assign(Object.assign({},D5),{properties:{"editor.tabSize":{type:"number",default:ms.tabSize,minimum:1,markdownDescription:C("tabSize","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:C("indentSize",'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:ms.insertSpaces,markdownDescription:C("insertSpaces","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:ms.detectIndentation,markdownDescription:C("detectIndentation","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:ms.trimAutoWhitespace,description:C("trimAutoWhitespace","Remove trailing auto inserted whitespace.")},"editor.largeFileOptimizations":{type:"boolean",default:ms.largeFileOptimizations,description:C("largeFileOptimizations","Special handling for large files to disable certain memory intensive features.")},"editor.wordBasedSuggestions":{type:"boolean",default:!0,description:C("wordBasedSuggestions","Controls whether completions should be computed based on words in the document.")},"editor.wordBasedSuggestionsMode":{enum:["currentDocument","matchingDocuments","allDocuments"],default:"matchingDocuments",enumDescriptions:[C("wordBasedSuggestionsMode.currentDocument","Only suggest words from the active document."),C("wordBasedSuggestionsMode.matchingDocuments","Suggest words from all open documents of the same language."),C("wordBasedSuggestionsMode.allDocuments","Suggest words from all open documents.")],description:C("wordBasedSuggestionsMode","Controls from which documents word based completions are computed.")},"editor.semanticHighlighting.enabled":{enum:[!0,!1,"configuredByTheme"],enumDescriptions:[C("semanticHighlighting.true","Semantic highlighting enabled for all color themes."),C("semanticHighlighting.false","Semantic highlighting disabled for all color themes."),C("semanticHighlighting.configuredByTheme","Semantic highlighting is configured by the current color theme's `semanticHighlighting` setting.")],default:"configuredByTheme",description:C("semanticHighlighting.enabled","Controls whether the semanticHighlighting is shown for the languages that support it.")},"editor.stablePeek":{type:"boolean",default:!1,markdownDescription:C("stablePeek","Keep peek editors open even when double-clicking their content or when hitting `Escape`.")},"editor.maxTokenizationLineLength":{type:"integer",default:2e4,description:C("maxTokenizationLineLength","Lines above this length will not be tokenized for performance reasons")},"editor.experimental.asyncTokenization":{type:"boolean",default:!1,description:C("editor.experimental.asyncTokenization","Controls whether the tokenization should happen asynchronously on a web worker."),tags:["experimental"]},"editor.experimental.asyncTokenizationLogging":{type:"boolean",default:!1,description:C("editor.experimental.asyncTokenizationLogging","Controls whether async tokenization should be logged. For debugging only.")},"editor.experimental.asyncTokenizationVerification":{type:"boolean",default:!1,description:C("editor.experimental.asyncTokenizationVerification","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:C("schema.brackets","Defines the bracket symbols that increase or decrease the indentation."),items:{type:"array",items:[{type:"string",description:C("schema.openBracket","The opening bracket character or string sequence.")},{type:"string",description:C("schema.closeBracket","The closing bracket character or string sequence.")}]}},"editor.language.colorizedBracketPairs":{type:["array","null"],default:null,description:C("schema.colorizedBracketPairs","Defines the bracket pairs that are colorized by their nesting level if bracket pair colorization is enabled."),items:{type:"array",items:[{type:"string",description:C("schema.openBracket","The opening bracket character or string sequence.")},{type:"string",description:C("schema.closeBracket","The closing bracket character or string sequence.")}]}},"diffEditor.maxComputationTime":{type:"number",default:Ms.maxComputationTime,description:C("maxComputationTime","Timeout in milliseconds after which diff computation is cancelled. Use 0 for no timeout.")},"diffEditor.maxFileSize":{type:"number",default:Ms.maxFileSize,description:C("maxFileSize","Maximum file size in MB for which to compute diffs. Use 0 for no limit.")},"diffEditor.renderSideBySide":{type:"boolean",default:Ms.renderSideBySide,description:C("sideBySide","Controls whether the diff editor shows the diff side by side or inline.")},"diffEditor.renderSideBySideInlineBreakpoint":{type:"number",default:Ms.renderSideBySideInlineBreakpoint,description:C("renderSideBySideInlineBreakpoint","If the diff editor width is smaller than this value, the inline view is used.")},"diffEditor.useInlineViewWhenSpaceIsLimited":{type:"boolean",default:Ms.useInlineViewWhenSpaceIsLimited,description:C("useInlineViewWhenSpaceIsLimited","If enabled and the editor width is too small, the inline view is used.")},"diffEditor.renderMarginRevertIcon":{type:"boolean",default:Ms.renderMarginRevertIcon,description:C("renderMarginRevertIcon","When enabled, the diff editor shows arrows in its glyph margin to revert changes.")},"diffEditor.ignoreTrimWhitespace":{type:"boolean",default:Ms.ignoreTrimWhitespace,description:C("ignoreTrimWhitespace","When enabled, the diff editor ignores changes in leading or trailing whitespace.")},"diffEditor.renderIndicators":{type:"boolean",default:Ms.renderIndicators,description:C("renderIndicators","Controls whether the diff editor shows +/- indicators for added/removed changes.")},"diffEditor.codeLens":{type:"boolean",default:Ms.diffCodeLens,description:C("codeLens","Controls whether the editor shows CodeLens.")},"diffEditor.wordWrap":{type:"string",enum:["off","on","inherit"],default:Ms.diffWordWrap,markdownEnumDescriptions:[C("wordWrap.off","Lines will never wrap."),C("wordWrap.on","Lines will wrap at the viewport width."),C("wordWrap.inherit","Lines will wrap according to the {0} setting.","`#editor.wordWrap#`")]},"diffEditor.diffAlgorithm":{type:"string",enum:["legacy","advanced"],default:Ms.diffAlgorithm,markdownEnumDescriptions:[C("diffAlgorithm.legacy","Uses the legacy diffing algorithm."),C("diffAlgorithm.advanced","Uses the advanced diffing algorithm.")],tags:["experimental"]},"diffEditor.hideUnchangedRegions.enabled":{type:"boolean",default:Ms.hideUnchangedRegions.enabled,markdownDescription:C("hideUnchangedRegions.enabled","Controls whether the diff editor shows unchanged regions.")},"diffEditor.hideUnchangedRegions.revealLineCount":{type:"integer",default:Ms.hideUnchangedRegions.revealLineCount,markdownDescription:C("hideUnchangedRegions.revealLineCount","Controls how many lines are used for unchanged regions."),minimum:1},"diffEditor.hideUnchangedRegions.minimumLineCount":{type:"integer",default:Ms.hideUnchangedRegions.minimumLineCount,markdownDescription:C("hideUnchangedRegions.minimumLineCount","Controls how many lines are used as a minimum for unchanged regions."),minimum:1},"diffEditor.hideUnchangedRegions.contextLineCount":{type:"integer",default:Ms.hideUnchangedRegions.contextLineCount,markdownDescription:C("hideUnchangedRegions.contextLineCount","Controls how many lines are used as context when comparing unchanged regions."),minimum:1},"diffEditor.experimental.showMoves":{type:"boolean",default:Ms.experimental.showMoves,markdownDescription:C("showMoves","Controls whether the diff editor should show detected code moves.")},"diffEditor.experimental.showEmptyDecorations":{type:"boolean",default:Ms.experimental.showEmptyDecorations,description:C("showEmptyDecorations","Controls whether the diff editor shows empty decorations to see where characters got inserted or deleted.")}}});function Sct(i){return typeof i.type!="undefined"||typeof i.anyOf!="undefined"}for(const i of DC){const e=i.schema;if(typeof e!="undefined")if(Sct(e))xP.properties[`editor.${i.name}`]=e;else for(const t in e)Object.hasOwnProperty.call(e,t)&&(xP.properties[t]=e[t])}let k2=null;function g1e(){return k2===null&&(k2=Object.create(null),Object.keys(xP.properties).forEach(i=>{k2[i]=!0})),k2}function xct(i){return g1e()[`editor.${i}`]||!1}function Lct(i){return g1e()[`diffEditor.${i}`]||!1}const Ect=no.as(ah.Configuration);Ect.registerConfiguration(xP);class Gi{static insert(e,t){return{range:new V(e.lineNumber,e.column,e.lineNumber,e.column),text:t,forceMoveMarkers:!0}}static delete(e){return{range:e,text:null}}static replace(e,t){return{range:e,text:t}}static replaceMove(e,t){return{range:e,text:t,forceMoveMarkers:!0}}}function I9(i){return Object.isFrozen(i)?i:dXe(i)}class gs{constructor(e={},t=[],n=[],o){this._contents=e,this._keys=t,this._overrides=n,this.raw=o,this.overrideConfigurations=new Map}get rawConfiguration(){var e;if(!this._rawConfiguration)if(!((e=this.raw)===null||e===void 0)&&e.length){const t=this.raw.map(n=>{if(n instanceof gs)return n;const o=new Dct("");return o.parseRaw(n),o.configurationModel});this._rawConfiguration=t.reduce((n,o)=>o===n?o:n.merge(o),t[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?Noe(this.contents,e):this.contents}inspect(e,t){const n=this.rawConfiguration.getValue(e),o=t?this.rawConfiguration.getOverrideValue(e,t):void 0,r=t?this.rawConfiguration.override(t).getValue(e):n;return{value:n,override:o,merged:r}}getOverrideValue(e,t){const n=this.getContentsForOverrideIdentifer(t);return n?e?Noe(n,e):n:void 0}override(e){let t=this.overrideConfigurations.get(e);return t||(t=this.createOverrideConfigurationModel(e),this.overrideConfigurations.set(e,t)),t}merge(...e){var t,n;const o=hg(this.contents),r=hg(this.overrides),s=[...this.keys],a=!((t=this.raw)===null||t===void 0)&&t.length?[...this.raw]:[this];for(const l of e)if(a.push(...!((n=l.raw)===null||n===void 0)&&n.length?l.raw:[l]),!l.isEmpty()){this.mergeContents(o,l.contents);for(const c of l.overrides){const[u]=r.filter(d=>Lo(d.identifiers,c.identifiers));u?(this.mergeContents(u.contents,c.contents),u.keys.push(...c.keys),u.keys=mv(u.keys)):r.push(hg(c))}for(const c of l.keys)s.indexOf(c)===-1&&s.push(c)}return new gs(o,s,r,a.every(l=>l instanceof gs)?void 0:a)}createOverrideConfigurationModel(e){const t=this.getContentsForOverrideIdentifer(e);if(!t||typeof t!="object"||!Object.keys(t).length)return this;const n={};for(const o of mv([...Object.keys(this.contents),...Object.keys(t)])){let r=this.contents[o];const s=t[o];s&&(typeof r=="object"&&typeof s=="object"?(r=hg(r),this.mergeContents(r,s)):r=s),n[o]=r}return new gs(n,this.keys,this.overrides)}mergeContents(e,t){for(const n of Object.keys(t)){if(n in e&&na(e[n])&&na(t[n])){this.mergeContents(e[n],t[n]);continue}e[n]=hg(t[n])}}getContentsForOverrideIdentifer(e){let t=null,n=null;const o=r=>{r&&(n?this.mergeContents(n,r):n=hg(r))};for(const r of this.overrides)r.identifiers.length===1&&r.identifiers[0]===e?t=r.contents:r.identifiers.includes(e)&&o(r.contents);return o(t),n}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),DJe(this.contents,e),Sv.test(e)&&this.overrides.splice(this.overrides.findIndex(n=>Lo(n.identifiers,qA(e))),1))}updateValue(e,t,n){x0e(this.contents,e,t,o=>console.error(o)),n=n||this.keys.indexOf(e)===-1,n&&this.keys.push(e),Sv.test(e)&&this.overrides.push({identifiers:qA(e),keys:Object.keys(this.contents[e]),contents:GV(this.contents[e],o=>console.error(o))})}}class Dct{constructor(e){this._name=e,this._raw=null,this._configurationModel=null,this._restrictedConfigurations=[]}get configurationModel(){return this._configurationModel||new gs}parseRaw(e,t){this._raw=e;const{contents:n,keys:o,overrides:r,restricted:s,hasExcludedProperties:a}=this.doParseRaw(e,t);this._configurationModel=new gs(n,o,r,a?[e]:void 0),this._restrictedConfigurations=s||[]}doParseRaw(e,t){const n=no.as(ah.Configuration).getConfigurationProperties(),o=this.filter(e,n,!0,t);e=o.raw;const r=GV(e,l=>console.error(`Conflict in settings file ${this._name}: ${l}`)),s=Object.keys(e),a=this.toOverrides(e,l=>console.error(`Conflict in settings file ${this._name}: ${l}`));return{contents:r,keys:s,overrides:a,restricted:o.restricted,hasExcludedProperties:o.hasExcludedProperties}}filter(e,t,n,o){var r,s,a;let l=!1;if(!(o!=null&&o.scopes)&&!(o!=null&&o.skipRestricted)&&!(!((r=o==null?void 0:o.exclude)===null||r===void 0)&&r.length))return{raw:e,restricted:[],hasExcludedProperties:l};const c={},u=[];for(const d in e)if(Sv.test(d)&&n){const h=this.filter(e[d],t,!1,o);c[d]=h.raw,l=l||h.hasExcludedProperties,u.push(...h.restricted)}else{const h=t[d],f=h?typeof h.scope!="undefined"?h.scope:3:void 0;h!=null&&h.restricted&&u.push(d),!(!((s=o.exclude)===null||s===void 0)&&s.includes(d))&&(((a=o.include)===null||a===void 0?void 0:a.includes(d))||(f===void 0||o.scopes===void 0||o.scopes.includes(f))&&!(o.skipRestricted&&(h==null?void 0:h.restricted)))?c[d]=e[d]:l=!0}return{raw:c,restricted:u,hasExcludedProperties:l}}toOverrides(e,t){const n=[];for(const o of Object.keys(e))if(Sv.test(o)){const r={};for(const s in e[o])r[s]=e[o][s];n.push({identifiers:qA(o),keys:Object.keys(r),contents:GV(r,t)})}return n}}class kct{constructor(e,t,n,o,r,s,a,l,c,u,d,h,f){this.key=e,this.overrides=t,this._value=n,this.overrideIdentifiers=o,this.defaultConfiguration=r,this.policyConfiguration=s,this.applicationConfiguration=a,this.userConfiguration=l,this.localUserConfiguration=c,this.remoteUserConfiguration=u,this.workspaceConfiguration=d,this.folderConfigurationModel=h,this.memoryConfigurationModel=f}inspect(e,t,n){const o=e.inspect(t,n);return{get value(){return I9(o.value)},get override(){return I9(o.override)},get merged(){return I9(o.merged)}}}get userInspectValue(){return this._userInspectValue||(this._userInspectValue=this.inspect(this.userConfiguration,this.key,this.overrides.overrideIdentifier)),this._userInspectValue}get user(){return this.userInspectValue.value!==void 0||this.userInspectValue.override!==void 0?{value:this.userInspectValue.value,override:this.userInspectValue.override}:void 0}}class k5{constructor(e,t,n,o,r=new gs,s=new gs,a=new vs,l=new gs,c=new vs){this._defaultConfiguration=e,this._policyConfiguration=t,this._applicationConfiguration=n,this._localUserConfiguration=o,this._remoteUserConfiguration=r,this._workspaceConfiguration=s,this._folderConfigurations=a,this._memoryConfiguration=l,this._memoryConfigurationByResource=c,this._workspaceConsolidatedConfiguration=null,this._foldersConsolidatedConfigurations=new vs,this._userConfiguration=null}getValue(e,t,n){return this.getConsolidatedConfigurationModel(e,t,n).getValue(e)}updateValue(e,t,n={}){let o;n.resource?(o=this._memoryConfigurationByResource.get(n.resource),o||(o=new gs,this._memoryConfigurationByResource.set(n.resource,o))):o=this._memoryConfiguration,t===void 0?o.removeValue(e):o.setValue(e,t),n.resource||(this._workspaceConsolidatedConfiguration=null)}inspect(e,t,n){const o=this.getConsolidatedConfigurationModel(e,t,n),r=this.getFolderConfigurationModelForResource(t.resource,n),s=t.resource?this._memoryConfigurationByResource.get(t.resource)||this._memoryConfiguration:this._memoryConfiguration,a=new Set;for(const l of o.overrides)for(const c of l.identifiers)o.getOverrideValue(e,c)!==void 0&&a.add(c);return new kct(e,t,o.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,n?this._workspaceConfiguration:void 0,r||void 0,s)}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}getConsolidatedConfigurationModel(e,t,n){let o=this.getConsolidatedConfigurationModelForResource(t,n);return t.overrideIdentifier&&(o=o.override(t.overrideIdentifier)),!this._policyConfiguration.isEmpty()&&this._policyConfiguration.getValue(e)!==void 0&&(o=o.merge(this._policyConfiguration)),o}getConsolidatedConfigurationModelForResource({resource:e},t){let n=this.getWorkspaceConsolidatedConfiguration();if(t&&e){const o=t.getFolder(e);o&&(n=this.getFolderConsolidatedConfiguration(o.uri)||n);const r=this._memoryConfigurationByResource.get(e);r&&(n=n.merge(r))}return n}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 n=this.getWorkspaceConsolidatedConfiguration(),o=this._folderConfigurations.get(e);o?(t=n.merge(o),this._foldersConsolidatedConfigurations.set(e,t)):t=n}return t}getFolderConfigurationModelForResource(e,t){if(t&&e){const n=t.getFolder(e);if(n)return this._folderConfigurations.get(n.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:n,overrides:o,keys:r}=this._folderConfigurations.get(t);return e.push([t,{contents:n,overrides:o,keys:r}]),e},[])}}static parse(e){const t=this.parseConfigurationModel(e.defaults),n=this.parseConfigurationModel(e.policy),o=this.parseConfigurationModel(e.application),r=this.parseConfigurationModel(e.user),s=this.parseConfigurationModel(e.workspace),a=e.folders.reduce((l,c)=>(l.set(Rt.revive(c[0]),this.parseConfigurationModel(c[1])),l),new vs);return new k5(t,n,o,r,new gs,s,a,new gs,new vs)}static parseConfigurationModel(e){return new gs(e.contents,e.keys,e.overrides)}}class Ict{constructor(e,t,n,o){this.change=e,this.previous=t,this.currentConfiguraiton=n,this.currentWorkspace=o,this._marker=` -`,this._markerCode1=this._marker.charCodeAt(0),this._markerCode2=".".charCodeAt(0),this.affectedKeys=new Set,this._previousConfiguration=void 0;for(const r of e.keys)this.affectedKeys.add(r);for(const[,r]of e.overrides)for(const s of r)this.affectedKeys.add(s);this._affectsConfigStr=this._marker;for(const r of this.affectedKeys)this._affectsConfigStr+=r+this._marker}get previousConfiguration(){return!this._previousConfiguration&&this.previous&&(this._previousConfiguration=k5.parse(this.previous.data)),this._previousConfiguration}affectsConfiguration(e,t){var n;const o=this._marker+e,r=this._affectsConfigStr.indexOf(o);if(r<0)return!1;const s=r+o.length;if(s>=this._affectsConfigStr.length)return!1;const a=this._affectsConfigStr.charCodeAt(s);if(a!==this._markerCode1&&a!==this._markerCode2)return!1;if(t){const l=this.previousConfiguration?this.previousConfiguration.getValue(e,t,(n=this.previous)===null||n===void 0?void 0:n.workspace):void 0,c=this.currentConfiguraiton.getValue(e,t,this.currentWorkspace);return!Kl(l,c)}return!0}}const LP={kind:0},Tct={kind:1};function Nct(i,e,t){return{kind:2,commandId:i,commandArgs:e,isBubble:t}}class LE{constructor(e,t,n){var o;this._log=n,this._defaultKeybindings=e,this._defaultBoundCommands=new Map;for(const r of e){const s=r.command;s&&s.charAt(0)!=="-"&&this._defaultBoundCommands.set(s,!0)}this._map=new Map,this._lookupMap=new Map,this._keybindings=LE.handleRemovals([].concat(e).concat(t));for(let r=0,s=this._keybindings.length;r=0;o--){const r=n[o];if(r.command===t.command)continue;let s=!0;for(let a=1;a=0;o--){const r=n[o];if(t.contextMatchesRules(r.when))return r}return n[n.length-1]}resolve(e,t,n){const o=[...t,n];this._log(`| Resolving ${o}`);const r=this._map.get(o[0]);if(r===void 0)return this._log("\\ No keybinding entries."),LP;let s=null;if(o.length<2)s=r;else{s=[];for(let l=0,c=r.length;lu.chords.length)continue;let d=!0;for(let h=1;h=0;n--){const o=t[n];if(!!LE._contextMatchesRules(e,o.when))return o}return null}static _contextMatchesRules(e,t){return t?t.evaluate(e):!0}}function Use(i){return i?`${i.serialize()}`:"no when condition"}function jse(i){return i.extensionId?i.isBuiltinExtension?`built-in extension ${i.extensionId}`:`user extension ${i.extensionId}`:i.isDefault?"built-in":"user"}const Rct=/^(cursor|delete|undo|redo|tab|editor\.action\.clipboard)/;class Mct extends _e{get onDidUpdateKeybindings(){return this._onDidUpdateKeybindings?this._onDidUpdateKeybindings.event:st.None}get inChordMode(){return this._currentChords.length>0}constructor(e,t,n,o,r){super(),this._contextKeyService=e,this._commandService=t,this._telemetryService=n,this._notificationService=o,this._logService=r,this._onDidUpdateKeybindings=this._register(new le),this._currentChords=[],this._currentChordChecker=new VI,this._currentChordStatusMessage=null,this._ignoreSingleModifiers=$C.EMPTY,this._currentSingleModifier=null,this._currentSingleModifierClearTimeout=new $u,this._logging=!1}dispose(){super.dispose()}_log(e){this._logging&&this._logService.info(`[KeybindingService]: ${e}`)}getKeybindings(){return this._getResolver().getKeybindings()}lookupKeybinding(e,t){const n=this._getResolver().lookupPrimaryKeybinding(e,t||this._contextKeyService);if(!!n)return n.resolvedKeybinding}dispatchEvent(e,t){return this._dispatch(e,t)}softDispatch(e,t){this._log("/ Soft dispatching keyboard event");const n=this.resolveKeyboardEvent(e);if(n.hasMultipleChords())return console.warn("keyboard event should not be mapped to multiple chords"),LP;const[o]=n.getDispatchChords();if(o===null)return this._log("\\ Keyboard event cannot be dispatched"),LP;const r=this._contextKeyService.getContext(t),s=this._currentChords.map(({keypress:a})=>a);return this._getResolver().resolve(r,s,o)}_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 Nq("impossible");case 1:this._currentChordStatusMessage=this._notificationService.status(C("first.chord","({0}) was pressed. Waiting for second key of chord...",t));break;default:{const n=this._currentChords.map(({label:o})=>o).join(", ");this._currentChordStatusMessage=this._notificationService.status(C("next.chord","({0}) was pressed. Waiting for next key of chord...",n))}}this._scheduleLeaveChordMode(),dE.enabled&&dE.disable()}_leaveChordMode(){this._currentChordStatusMessage&&(this._currentChordStatusMessage.dispose(),this._currentChordStatusMessage=null),this._currentChordChecker.cancel(),this._currentChords=[],dE.enable()}_dispatch(e,t){return this._doDispatch(this.resolveKeyboardEvent(e),t,!1)}_singleModifierDispatch(e,t){const n=this.resolveKeyboardEvent(e),[o]=n.getSingleModifierDispatchChords();if(o)return this._ignoreSingleModifiers.has(o)?(this._log(`+ Ignoring single modifier ${o} due to it being pressed together with other keys.`),this._ignoreSingleModifiers=$C.EMPTY,this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1):(this._ignoreSingleModifiers=$C.EMPTY,this._currentSingleModifier===null?(this._log(`+ Storing single modifier for possible chord ${o}.`),this._currentSingleModifier=o,this._currentSingleModifierClearTimeout.cancelAndSet(()=>{this._log("+ Clearing single modifier due to 300ms elapsed."),this._currentSingleModifier=null},300),!1):o===this._currentSingleModifier?(this._log(`/ Dispatching single modifier chord ${o} ${o}`),this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,this._doDispatch(n,t,!0)):(this._log(`+ Clearing single modifier due to modifier mismatch: ${this._currentSingleModifier} ${o}`),this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1));const[r]=n.getChords();return this._ignoreSingleModifiers=new $C(r),this._currentSingleModifier!==null&&this._log("+ Clearing single modifier due to other key up."),this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1}_doDispatch(e,t,n=!1){var o;let r=!1;if(e.hasMultipleChords())return console.warn("Unexpected keyboard event mapped to multiple chords"),!1;let s=null,a=null;if(n){const[d]=e.getSingleModifierDispatchChords();s=d,a=d?[d]:[]}else[s]=e.getDispatchChords(),a=this._currentChords.map(({keypress:d})=>d);if(s===null)return this._log("\\ Keyboard event cannot be dispatched in keydown phase."),r;const l=this._contextKeyService.getContext(t),c=e.getLabel(),u=this._getResolver().resolve(l,a,s);switch(u.kind){case 0:{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(C("missing.chord","The key combination ({0}, {1}) is not a command.",d,c),{hideAfter:10*1e3}),this._leaveChordMode(),r=!0}return r}case 1:return this._logService.trace("KeybindingService#dispatch",c,"[ Several keybindings match - more chords needed ]"),r=!0,this._expectAnotherChord(s,c),this._log(this._currentChords.length===1?"+ Entering multi-chord mode...":"+ Continuing multi-chord mode..."),r;case 2:{if(this._logService.trace("KeybindingService#dispatch",c,`[ Will dispatch command ${u.commandId} ]`),u.commandId===null||u.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(C("missing.chord","The key combination ({0}, {1}) is not a command.",d,c),{hideAfter:10*1e3}),this._leaveChordMode(),r=!0}}else this.inChordMode&&this._leaveChordMode(),u.isBubble||(r=!0),this._log(`+ Invoking command ${u.commandId}.`),typeof u.commandArgs=="undefined"?this._commandService.executeCommand(u.commandId).then(void 0,d=>this._notificationService.warn(d)):this._commandService.executeCommand(u.commandId,u.commandArgs).then(void 0,d=>this._notificationService.warn(d)),Rct.test(u.commandId)||this._telemetryService.publicLog2("workbenchActionExecuted",{id:u.commandId,from:"keybinding",detail:(o=e.getUserSettingsLabel())!==null&&o!==void 0?o:void 0});return r}}}mightProducePrintableCharacter(e){return e.ctrlKey||e.metaKey?!1:e.keyCode>=31&&e.keyCode<=56||e.keyCode>=21&&e.keyCode<=30}}class $C{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}}}$C.EMPTY=new $C(null);class Kse{constructor(e,t,n,o,r,s,a){this._resolvedKeybindingItemBrand=void 0,this.resolvedKeybinding=e,this.chords=e?WH(e.getDispatchChords()):[],e&&this.chords.length===0&&(this.chords=WH(e.getSingleModifierDispatchChords())),this.bubble=t?t.charCodeAt(0)===94:!1,this.command=this.bubble?t.substr(1):t,this.commandArgs=n,this.when=o,this.isDefault=r,this.extensionId=s,this.isBuiltinExtension=a}}function WH(i){const e=[];for(let t=0,n=i.length;tthis._getLabel(e))}getAriaLabel(){return Act.toLabel(this._os,this._chords,e=>this._getAriaLabel(e))}getElectronAccelerator(){return this._chords.length>1||this._chords[0].isDuplicateModifierCase()?null:Pct.toLabel(this._os,this._chords,e=>this._getElectronAccelerator(e))}getUserSettingsLabel(){return Oct.toLabel(this._os,this._chords,e=>this._getUserSettingsLabel(e))}hasMultipleChords(){return this._chords.length>1}getChords(){return this._chords.map(e=>this._getChord(e))}_getChord(e){return new VZe(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 dk extends Bct{constructor(e,t){super(t,e)}_keyCodeToUILabel(e){if(this._os===2)switch(e){case 15:return"\u2190";case 16:return"\u2191";case 17:return"\u2192";case 18:return"\u2193"}return yg.toString(e)}_getLabel(e){return e.isDuplicateModifierCase()?"":this._keyCodeToUILabel(e.keyCode)}_getAriaLabel(e){return e.isDuplicateModifierCase()?"":yg.toString(e.keyCode)}_getElectronAccelerator(e){return yg.toElectronAccelerator(e.keyCode)}_getUserSettingsLabel(e){if(e.isDuplicateModifierCase())return"";const t=yg.toUserSettingsUS(e.keyCode);return t&&t.toLowerCase()}_getChordDispatch(e){return dk.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+=yg.toString(e.keyCode),t}_getSingleModifierChordDispatch(e){return e.keyCode===5&&!e.shiftKey&&!e.altKey&&!e.metaKey?"ctrl":e.keyCode===4&&!e.ctrlKey&&!e.altKey&&!e.metaKey?"shift":e.keyCode===6&&!e.ctrlKey&&!e.shiftKey&&!e.metaKey?"alt":e.keyCode===57&&!e.ctrlKey&&!e.shiftKey&&!e.altKey?"meta":null}static _scanCodeToKeyCode(e){const t=Fq[e];if(t!==-1)return t;switch(e){case 10:return 31;case 11:return 32;case 12:return 33;case 13:return 34;case 14:return 35;case 15:return 36;case 16:return 37;case 17:return 38;case 18:return 39;case 19:return 40;case 20:return 41;case 21:return 42;case 22:return 43;case 23:return 44;case 24:return 45;case 25:return 46;case 26:return 47;case 27:return 48;case 28:return 49;case 29:return 50;case 30:return 51;case 31:return 52;case 32:return 53;case 33:return 54;case 34:return 55;case 35:return 56;case 36:return 22;case 37:return 23;case 38:return 24;case 39:return 25;case 40:return 26;case 41:return 27;case 42:return 28;case 43:return 29;case 44:return 30;case 45:return 21;case 51:return 88;case 52:return 86;case 53:return 92;case 54:return 94;case 55:return 93;case 56:return 0;case 57:return 85;case 58:return 95;case 59:return 91;case 60:return 87;case 61:return 89;case 62:return 90;case 106:return 97}return 0}static _toKeyCodeChord(e){if(!e)return null;if(e instanceof ap)return e;const t=this._scanCodeToKeyCode(e.scanCode);return t===0?null:new ap(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,t)}static resolveKeybinding(e,t){const n=WH(e.chords.map(o=>this._toKeyCodeChord(o)));return n.length>0?[new dk(n,t)]:[]}}const Iy=wn("labelService"),p1e=wn("progressService");Object.freeze({total(){},worked(){},done(){}});class qg{constructor(e,t){this.callback=e,this.report=t!=null&&t.async?this._reportAsync.bind(this):this._reportSync.bind(this)}_reportSync(e){this._value=e,this.callback(this._value)}_reportAsync(e){Promise.resolve(this._lastTask).finally(()=>{this._value=e;const t=this.callback(this._value);this._lastTask=Promise.resolve(t).finally(()=>this._lastTask=void 0)})}}qg.None=Object.freeze({report(){}});const Jv=wn("editorProgressService");class Wct{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 n=this._value.charCodeAt(t);if(!(n===47||this._splitOnBackslash&&n===92))break}return this.next()}hasNext(){return this._to!1,t=()=>!1){return new Rw(new $ct(e,t))}static forStrings(){return new Rw(new Wct)}static forConfigKeys(){return new Rw(new Vct)}constructor(e){this._iter=e}clear(){this._root=void 0}set(e,t){const n=this._iter.reset(e);let o;this._root||(this._root=new I2,this._root.segment=n.value());const r=[];for(o=this._root;;){const a=n.cmp(o.segment);if(a>0)o.left||(o.left=new I2,o.left.segment=n.value()),r.push([-1,o]),o=o.left;else if(a<0)o.right||(o.right=new I2,o.right.segment=n.value()),r.push([1,o]),o=o.right;else if(n.hasNext())n.next(),o.mid||(o.mid=new I2,o.mid.segment=n.value()),r.push([0,o]),o=o.mid;else break}const s=o.value;o.value=t,o.key=e;for(let a=r.length-1;a>=0;a--){const l=r[a][1];l.updateHeight();const c=l.balanceFactor();if(c<-1||c>1){const u=r[a][0],d=r[a+1][0];if(u===1&&d===1)r[a][1]=l.rotateLeft();else if(u===-1&&d===-1)r[a][1]=l.rotateRight();else if(u===1&&d===-1)l.right=r[a+1][1]=r[a+1][1].rotateRight(),r[a][1]=l.rotateLeft();else if(u===-1&&d===1)l.left=r[a+1][1]=r[a+1][1].rotateLeft(),r[a][1]=l.rotateRight();else throw new Error;if(a>0)switch(r[a-1][0]){case-1:r[a-1][1].left=r[a][1];break;case 1:r[a-1][1].right=r[a][1];break;case 0:r[a-1][1].mid=r[a][1];break}else this._root=r[0][1]}}return s}get(e){var t;return(t=this._getNode(e))===null||t===void 0?void 0:t.value}_getNode(e){const t=this._iter.reset(e);let n=this._root;for(;n;){const o=t.cmp(n.segment);if(o>0)n=n.left;else if(o<0)n=n.right;else if(t.hasNext())t.next(),n=n.mid;else break}return n}has(e){const t=this._getNode(e);return!((t==null?void 0:t.value)===void 0&&(t==null?void 0:t.mid)===void 0)}delete(e){return this._delete(e,!1)}deleteSuperstr(e){return this._delete(e,!0)}_delete(e,t){var n;const o=this._iter.reset(e),r=[];let s=this._root;for(;s;){const a=o.cmp(s.segment);if(a>0)r.push([-1,s]),s=s.left;else if(a<0)r.push([1,s]),s=s.right;else if(o.hasNext())o.next(),r.push([0,s]),s=s.mid;else break}if(!!s){if(t?(s.left=void 0,s.mid=void 0,s.right=void 0,s.height=1):(s.key=void 0,s.value=void 0),!s.mid&&!s.value)if(s.left&&s.right){const a=this._min(s.right);if(a.key){const{key:l,value:c,segment:u}=a;this._delete(a.key,!1),s.key=l,s.value=c,s.segment=u}}else{const a=(n=s.left)!==null&&n!==void 0?n:s.right;if(r.length>0){const[l,c]=r[r.length-1];switch(l){case-1:c.left=a;break;case 0:c.mid=a;break;case 1:c.right=a;break}}else this._root=a}for(let a=r.length-1;a>=0;a--){const l=r[a][1];l.updateHeight();const c=l.balanceFactor();if(c>1?(l.right.balanceFactor()>=0||(l.right=l.right.rotateRight()),r[a][1]=l.rotateLeft()):c<-1&&(l.left.balanceFactor()<=0||(l.left=l.left.rotateLeft()),r[a][1]=l.rotateRight()),a>0)switch(r[a-1][0]){case-1:r[a-1][1].left=r[a][1];break;case 1:r[a-1][1].right=r[a][1];break;case 0:r[a-1][1].mid=r[a][1];break}else this._root=r[0][1]}}}_min(e){for(;e.left;)e=e.left;return e}findSubstr(e){const t=this._iter.reset(e);let n=this._root,o;for(;n;){const r=t.cmp(n.segment);if(r>0)n=n.left;else if(r<0)n=n.right;else if(t.hasNext())t.next(),o=n.value||o,n=n.mid;else break}return n&&n.value||o}findSuperstr(e){return this._findSuperstrOrElement(e,!1)}_findSuperstrOrElement(e,t){const n=this._iter.reset(e);let o=this._root;for(;o;){const r=n.cmp(o.segment);if(r>0)o=o.left;else if(r<0)o=o.right;else if(n.hasNext())n.next(),o=o.mid;else return o.mid?this._entries(o.mid):t?o.value:void 0}}forEach(e){for(const[t,n]of this)e(n,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))}}const nb=wn("contextService");function VH(i){const e=i;return typeof(e==null?void 0:e.id)=="string"&&Rt.isUri(e.uri)}function zct(i){const e=i;return typeof(e==null?void 0:e.id)=="string"&&!VH(i)&&!qct(i)}const Uct={id:"ext-dev"},jct={id:"empty-window"};function Kct(i,e){if(typeof i=="string"||typeof i=="undefined")return typeof i=="string"?{id:jm(i)}:e?Uct:jct;const t=i;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 qct(i){const e=i;return typeof(e==null?void 0:e.id)=="string"&&Rt.isUri(e.configPath)}class Gct{constructor(e,t){this.raw=t,this.uri=e.uri,this.index=e.index,this.name=e.name}toJSON(){return{uri:this.uri,name:this.name,index:this.index}}}const HH="code-workspace";C("codeWorkspace","Code Workspace");const m1e="4064f6ec-cb38-4ad0-af64-ee6467e63c82";function Xct(i){return i.id===m1e}var $H;(function(i){i.inspectTokensAction=C("inspectTokens","Developer: Inspect Tokens")})($H||($H={}));var EP;(function(i){i.gotoLineActionLabel=C("gotoLineActionLabel","Go to Line/Column...")})(EP||(EP={}));var zH;(function(i){i.helpQuickAccessActionLabel=C("helpQuickAccess","Show all Quick Access Providers")})(zH||(zH={}));var DP;(function(i){i.quickCommandActionLabel=C("quickCommandActionLabel","Command Palette"),i.quickCommandHelp=C("quickCommandActionHelp","Show And Run Commands")})(DP||(DP={}));var hk;(function(i){i.quickOutlineActionLabel=C("quickOutlineActionLabel","Go to Symbol..."),i.quickOutlineByCategoryActionLabel=C("quickOutlineByCategoryActionLabel","Go to Symbol by Category...")})(hk||(hk={}));var kP;(function(i){i.editorViewAccessibleLabel=C("editorViewAccessibleLabel","Editor content"),i.accessibilityHelpMessage=C("accessibilityHelpMessage","Press Alt+F1 for Accessibility Options.")})(kP||(kP={}));var UH;(function(i){i.toggleHighContrast=C("toggleHighContrast","Toggle High Contrast Theme")})(UH||(UH={}));var jH;(function(i){i.bulkEditServiceSummary=C("bulkEditServiceSummary","Made {0} edits in {1} files")})(jH||(jH={}));const v1e=wn("workspaceTrustManagementService"),mp=wn("contextViewService"),ju=wn("contextMenuService");var hs;(function(i){function e(r,s){if(r.start>=s.end||s.start>=r.end)return{start:0,end:0};const a=Math.max(r.start,s.start),l=Math.min(r.end,s.end);return l-a<=0?{start:0,end:0}:{start:a,end:l}}i.intersect=e;function t(r){return r.end-r.start<=0}i.isEmpty=t;function n(r,s){return!t(e(r,s))}i.intersects=n;function o(r,s){const a=[],l={start:r.start,end:Math.min(s.start,r.end)},c={start:Math.max(s.end,r.start),end:r.end};return t(l)||a.push(l),t(c)||a.push(c),a}i.relativeComplement=o})(hs||(hs={}));function Yct(i){const e=i;return!!e&&typeof e.x=="number"&&typeof e.y=="number"}var Em;(function(i){i[i.AVOID=0]="AVOID",i[i.ALIGN=1]="ALIGN"})(Em||(Em={}));function zC(i,e,t){const n=t.mode===Em.ALIGN?t.offset:t.offset+t.size,o=t.mode===Em.ALIGN?t.offset+t.size:t.offset;return t.position===0?e<=i-n?n:e<=o?o-e:Math.max(i-e,0):e<=o?o-e:e<=i-n?n:0}class Ty extends _e{constructor(e,t){super(),this.container=null,this.delegate=null,this.toDisposeOnClean=_e.None,this.toDisposeOnSetContainer=_e.None,this.shadowRoot=null,this.shadowRootHostElement=null,this.view=He(".context-view"),this.useFixedPosition=!1,this.useShadowDOM=!1,Qs(this.view),this.setContainer(e,t),this._register(zt(()=>this.setContainer(null,1)))}setContainer(e,t){var n;if(this.container&&(this.toDisposeOnSetContainer.dispose(),this.shadowRoot?(this.shadowRoot.removeChild(this.view),this.shadowRoot=null,(n=this.shadowRootHostElement)===null||n===void 0||n.remove(),this.shadowRootHostElement=null):this.container.removeChild(this.view),this.container=null),e){if(this.container=e,this.useFixedPosition=t!==1,this.useShadowDOM=t===3,this.useShadowDOM){this.shadowRootHostElement=He(".shadow-root-host"),this.container.appendChild(this.shadowRootHostElement),this.shadowRoot=this.shadowRootHostElement.attachShadow({mode:"open"});const r=document.createElement("style");r.textContent=Zct,this.shadowRoot.appendChild(r),this.shadowRoot.appendChild(this.view),this.shadowRoot.appendChild(He("slot"))}else this.container.appendChild(this.view);const o=new Be;Ty.BUBBLE_UP_EVENTS.forEach(r=>{o.add(No(this.container,r,s=>{this.onDOMEvent(s,!1)}))}),Ty.BUBBLE_DOWN_EVENTS.forEach(r=>{o.add(No(this.container,r,s=>{this.onDOMEvent(s,!0)},!0))}),this.toDisposeOnSetContainer=o}}show(e){var t,n;this.isVisible()&&this.hide(),Ur(this.view),this.view.className="context-view",this.view.style.top="0px",this.view.style.left="0px",this.view.style.zIndex="2575",this.view.style.position=this.useFixedPosition?"fixed":"absolute",tl(this.view),this.toDisposeOnClean=e.render(this.view)||_e.None,this.delegate=e,this.doLayout(),(n=(t=this.delegate).focus)===null||n===void 0||n.call(t)}getViewElement(){return this.view}layout(){if(!!this.isVisible()){if(this.delegate.canRelayout===!1&&!(jd&&Yq.pointerEvents)){this.hide();return}this.delegate.layout&&this.delegate.layout(),this.doLayout()}}doLayout(){if(!this.isVisible())return;const e=this.delegate.getAnchor();let t;if(Qq(e)){const d=Yo(e),h=RQe(e);t={top:d.top*h,left:d.left*h,width:d.width*h,height:d.height*h}}else Yct(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 n=La(this.view),o=c0(this.view),r=this.delegate.anchorPosition||0,s=this.delegate.anchorAlignment||0,a=this.delegate.anchorAxisAlignment||0;let l,c;if(a===0){const d={offset:t.top-window.pageYOffset,size:t.height,position:r===0?0:1},h={offset:t.left,size:t.width,position:s===0?0:1,mode:Em.ALIGN};l=zC(window.innerHeight,o,d)+window.pageYOffset,hs.intersects({start:l,end:l+o},{start:d.offset,end:d.offset+d.size})&&(h.mode=Em.AVOID),c=zC(window.innerWidth,n,h)}else{const d={offset:t.left,size:t.width,position:s===0?0:1},h={offset:t.top,size:t.height,position:r===0?0:1,mode:Em.ALIGN};c=zC(window.innerWidth,n,d),hs.intersects({start:c,end:c+n},{start:d.offset,end:d.offset+d.size})&&(h.mode=Em.AVOID),l=zC(window.innerHeight,o,h)+window.pageYOffset}this.view.classList.remove("top","bottom","left","right"),this.view.classList.add(r===0?"bottom":"top"),this.view.classList.add(s===0?"left":"right"),this.view.classList.toggle("fixed",this.useFixedPosition);const u=Yo(this.container);this.view.style.top=`${l-(this.useFixedPosition?Yo(this.view).top:u.top)}px`,this.view.style.left=`${c-(this.useFixedPosition?Yo(this.view).left:u.left)}px`,this.view.style.width="initial"}hide(e){const t=this.delegate;this.delegate=null,t!=null&&t.onHide&&t.onHide(e),this.toDisposeOnClean.dispose(),Qs(this.view)}isVisible(){return!!this.delegate}onDOMEvent(e,t){this.delegate&&(this.delegate.onDOMEvent?this.delegate.onDOMEvent(e,document.activeElement):t&&!os(e.target,this.container)&&this.hide())}dispose(){this.hide(),super.dispose()}}Ty.BUBBLE_UP_EVENTS=["click","keydown","focus","blur"];Ty.BUBBLE_DOWN_EVENTS=["click"];const Zct=` +`&&(n=2),this._modelData.model.getValue(n,t)}setValue(e){!this._modelData||this._modelData.model.setValue(e)}getModel(){return this._modelData?this._modelData.model:null}setModel(e=null){const t=e;if(this._modelData===null&&t===null||this._modelData&&this._modelData.model===t)return;const n=this.hasTextFocus(),o=this._detachModel();this._attachModel(t),n&&this.hasModel()&&this.focus();const r={oldModelUrl:o?o.uri:null,newModelUrl:t?t.uri:null};this._removeDecorationTypes(),this._onDidChangeModel.fire(r),this._postDetachModelCleanup(o),this._contributions.onAfterModelAttached()}_removeDecorationTypes(){if(this._decorationTypeKeysToIds={},this._decorationTypeSubtypes){for(const e in this._decorationTypeSubtypes){const t=this._decorationTypeSubtypes[e];for(const n in t)this._removeDecorationType(e+"-"+n)}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,n,o){const r=e.model.validatePosition({lineNumber:t,column:n}),s=e.viewModel.coordinatesConverter.convertModelPositionToViewPosition(r);return e.viewModel.viewLayout.getVerticalOffsetAfterLineNumber(s.lineNumber,o)}getTopForLineNumber(e,t=!1){return this._modelData?A_._getVerticalOffsetForPosition(this._modelData,e,1,t):-1}getTopForPosition(e,t){return this._modelData?A_._getVerticalOffsetForPosition(this._modelData,e,t,!1):-1}static _getVerticalOffsetForPosition(e,t,n,o=!1){const r=e.model.validatePosition({lineNumber:t,column:n}),s=e.viewModel.coordinatesConverter.convertModelPositionToViewPosition(r);return e.viewModel.viewLayout.getVerticalOffsetForLineNumber(s.lineNumber,o)}getBottomForLineNumber(e,t=!1){return this._modelData?A_._getVerticalOffsetAfterPosition(this._modelData,e,1,t):-1}setHiddenAreas(e,t){var n;(n=this._modelData)===null||n===void 0||n.viewModel.setHiddenAreas(e.map(o=>V.lift(o)),t)}getVisibleColumnFromPosition(e){if(!this._modelData)return e.column;const t=this._modelData.model.validatePosition(e),n=this._modelData.model.getOptions().tabSize;return or.visibleColumnFromColumn(this._modelData.model.getLineContent(t.lineNumber),t.column,n)+1}getPosition(){return this._modelData?this._modelData.viewModel.getPosition():null}setPosition(e,t="api"){if(!!this._modelData){if(!ae.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,n,o){if(!this._modelData)return;if(!V.isIRange(e))throw new Error("Invalid arguments");const r=this._modelData.model.validateRange(e),s=this._modelData.viewModel.coordinatesConverter.convertModelRangeToViewRange(r);this._modelData.viewModel.revealRange("api",n,s,t,o)}revealLine(e,t=0){this._revealLine(e,0,t)}revealLineInCenter(e,t=0){this._revealLine(e,1,t)}revealLineInCenterIfOutsideViewport(e,t=0){this._revealLine(e,2,t)}revealLineNearTop(e,t=0){this._revealLine(e,5,t)}_revealLine(e,t,n){if(typeof e!="number")throw new Error("Invalid arguments");this._sendRevealRange(new V(e,1,e,1),t,!1,n)}revealPosition(e,t=0){this._revealPosition(e,0,!0,t)}revealPositionInCenter(e,t=0){this._revealPosition(e,1,!0,t)}revealPositionInCenterIfOutsideViewport(e,t=0){this._revealPosition(e,2,!0,t)}revealPositionNearTop(e,t=0){this._revealPosition(e,5,!0,t)}_revealPosition(e,t,n,o){if(!ae.isIPosition(e))throw new Error("Invalid arguments");this._sendRevealRange(new V(e.lineNumber,e.column,e.lineNumber,e.column),t,n,o)}getSelection(){return this._modelData?this._modelData.viewModel.getSelection():null}getSelections(){return this._modelData?this._modelData.viewModel.getSelections():null}setSelection(e,t="api"){const n=gt.isISelection(e),o=V.isIRange(e);if(!n&&!o)throw new Error("Invalid arguments");if(n)this._setSelectionImpl(e,t);else if(o){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 n=new gt(e.selectionStartLineNumber,e.selectionStartColumn,e.positionLineNumber,e.positionColumn);this._modelData.viewModel.setSelections(t,[n])}revealLines(e,t,n=0){this._revealLines(e,t,0,n)}revealLinesInCenter(e,t,n=0){this._revealLines(e,t,1,n)}revealLinesInCenterIfOutsideViewport(e,t,n=0){this._revealLines(e,t,2,n)}revealLinesNearTop(e,t,n=0){this._revealLines(e,t,5,n)}_revealLines(e,t,n,o){if(typeof e!="number"||typeof t!="number")throw new Error("Invalid arguments");this._sendRevealRange(new V(e,1,t,1),n,!1,o)}revealRange(e,t=0,n=!1,o=!0){this._revealRange(e,n?1:0,o,t)}revealRangeInCenter(e,t=0){this._revealRange(e,1,!0,t)}revealRangeInCenterIfOutsideViewport(e,t=0){this._revealRange(e,2,!0,t)}revealRangeNearTop(e,t=0){this._revealRange(e,5,!0,t)}revealRangeNearTopIfOutsideViewport(e,t=0){this._revealRange(e,6,!0,t)}revealRangeAtTop(e,t=0){this._revealRange(e,3,!0,t)}_revealRange(e,t,n,o){if(!V.isIRange(e))throw new Error("Invalid arguments");this._sendRevealRange(V.lift(e),t,n,o)}setSelections(e,t="api",n=0){if(!!this._modelData){if(!e||e.length===0)throw new Error("Invalid arguments");for(let o=0,r=e.length;o0&&this._modelData.viewModel.restoreCursorState(n):this._modelData.viewModel.restoreCursorState([n]),this._contributions.restoreViewState(t.contributionsState||{});const o=this._modelData.viewModel.reduceRestoreState(t.viewState);this._modelData.view.restoreState(o)}}handleInitialized(){var e;(e=this._getViewModel())===null||e===void 0||e.visibleLinesStabilized()}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,n){switch(n=n||{},t){case"compositionStart":this._startComposition();return;case"compositionEnd":this._endComposition(e);return;case"type":{const r=n;this._type(e,r.text||"");return}case"replacePreviousChar":{const r=n;this._compositionType(e,r.text||"",r.replaceCharCnt||0,0,0);return}case"compositionType":{const r=n;this._compositionType(e,r.text||"",r.replacePrevCharCnt||0,r.replaceNextCharCnt||0,r.positionDelta||0);return}case"paste":{const r=n;this._paste(e,r.text||"",r.pasteOnNewLine||!1,r.multicursorText||null,r.mode||null);return}case"cut":this._cut(e);return}const o=this.getAction(t);if(o){Promise.resolve(o.run(n)).then(void 0,en);return}!this._modelData||this._triggerEditorCommand(e,t,n)||this._triggerCommand(t,n)}_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,n,o,r){!this._modelData||this._modelData.viewModel.compositionType(t,n,o,r,e)}_paste(e,t,n,o,r){if(!this._modelData||t.length===0)return;const s=this._modelData.viewModel,a=s.getSelection().getStartPosition();s.paste(t,n,o,e);const l=s.getSelection().getStartPosition();e==="keyboard"&&this._onDidPaste.fire({range:new V(a.lineNumber,a.column,l.lineNumber,l.column),languageId:r})}_cut(e){!this._modelData||this._modelData.viewModel.cut(e)}_triggerEditorCommand(e,t,n){const o=vy.getEditorCommand(t);return o?(n=n||{},n.source=e,this._instantiationService.invokeFunction(r=>{Promise.resolve(o.runEditorCommand(r,this,n)).then(void 0,en)}),!0):!1}_getViewModel(){return this._modelData?this._modelData.viewModel:null}pushUndoStop(){return!this._modelData||this._configuration.options.get(90)?!1:(this._modelData.model.pushStackElement(),!0)}popUndoStop(){return!this._modelData||this._configuration.options.get(90)?!1:(this._modelData.model.popStackElement(),!0)}executeEdits(e,t,n){if(!this._modelData||this._configuration.options.get(90))return!1;let o;return n?Array.isArray(n)?o=()=>n:o=n:o=()=>null,this._modelData.viewModel.executeEdits(e,t,o),!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 Klt(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,PA(this._configuration.options)):null}getDecorationsInRange(e){return this._modelData?this._modelData.model.getDecorationsInRange(e,this._id,PA(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,[])})}removeDecorationsByType(e){const t=this._decorationTypeKeysToIds[e];t&&this.deltaDecorations(t,[]),this._decorationTypeKeysToIds.hasOwnProperty(e)&&delete this._decorationTypeKeysToIds[e],this._decorationTypeSubtypes.hasOwnProperty(e)&&delete this._decorationTypeSubtypes[e]}getLayoutInfo(){return this._configuration.options.get(143)}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){this._configuration.observeContainer(e),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."),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 n=this._contentWidgets[t];n.position=e.getPosition(),this._modelData&&this._modelData.hasRealView&&this._modelData.view.layoutContentWidget(n)}}removeContentWidget(e){const t=e.getId();if(this._contentWidgets.hasOwnProperty(t)){const n=this._contentWidgets[t];delete this._contentWidgets[t],this._modelData&&this._modelData.hasRealView&&this._modelData.view.removeContentWidget(n)}}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 n=this._overlayWidgets[t];n.position=e.getPosition(),this._modelData&&this._modelData.hasRealView&&this._modelData.view.layoutOverlayWidget(n)}}removeOverlayWidget(e){const t=e.getId();if(this._overlayWidgets.hasOwnProperty(t)){const n=this._overlayWidgets[t];delete this._overlayWidgets[t],this._modelData&&this._modelData.hasRealView&&this._modelData.view.removeOverlayWidget(n)}}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 n=this._glyphMarginWidgets[t];n.position=e.getPosition(),this._modelData&&this._modelData.hasRealView&&this._modelData.view.layoutGlyphMarginWidget(n)}}removeGlyphMarginWidget(e){const t=e.getId();if(this._glyphMarginWidgets.hasOwnProperty(t)){const n=this._glyphMarginWidgets[t];delete this._glyphMarginWidgets[t],this._modelData&&this._modelData.hasRealView&&this._modelData.view.removeGlyphMarginWidget(n)}}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),n=this._configuration.options,o=n.get(143),r=A_._getVerticalOffsetForPosition(this._modelData,t.lineNumber,t.column)-this.getScrollTop(),s=this._modelData.view.getOffsetForColumn(t.lineNumber,t.column)+o.glyphMarginWidth+o.lineNumbersWidth+o.decorationsWidth-this.getScrollLeft();return{top:r,left:s,height:n.get(66)}}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.view.render(!0,e)}setAriaOptions(e){!this._modelData||!this._modelData.hasRealView||this._modelData.view.setAriaOptions(e)}applyFontInfo(e){ss(e,this._configuration.options.get(50))}setBanner(e,t){this._bannerDomNode&&this._domElement.contains(this._bannerDomNode)&&this._domElement.removeChild(this._bannerDomNode),this._bannerDomNode=e,this._configuration.setReservedHeight(e?t:0),this._bannerDomNode&&this._domElement.prepend(this._bannerDomNode)}_attachModel(e){if(!e){this._modelData=null;return}const t=[];this._domElement.setAttribute("data-mode-id",e.getLanguageId()),this._configuration.setIsDominatedByLongLines(e.isDominatedByLongLines()),this._configuration.setModelLineCount(e.getLineCount());const n=e.onBeforeAttached(),o=new Dlt(this._id,this._configuration,e,eX.create(),JG.create(this._configuration.options),a=>Bc(a),this.languageConfigurationService,this._themeService,n);t.push(e.onWillDispose(()=>this.setModel(null))),t.push(o.onEvent(a=>{switch(a.kind){case 0:this._onDidContentSizeChange.fire(a);break;case 1:this._editorTextFocus.setValue(a.hasFocus);break;case 2:this._onDidScrollChange.fire(a);break;case 3:this._onDidChangeViewZones.fire();break;case 4:this._onDidChangeHiddenAreas.fire();break;case 5:this._onDidAttemptReadOnlyEdit.fire();break;case 6:{if(a.reachedMaxCursorCount){const d=this.getOption(79),h=C("cursors.maximum","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.",d);this._notificationService.prompt(E5.Warning,h,[{label:"Find and Replace",run:()=>{this._commandService.executeCommand("editor.action.startFindReplaceAction")}},{label:C("goToSetting","Increase Multi Cursor Limit"),run:()=>{this._commandService.executeCommand("workbench.action.openSettings2",{query:"editor.multiCursorLimit"})}}])}const l=[];for(let d=0,h=a.selections.length;d{this._paste("keyboard",r,s,a,l)},type:r=>{this._type("keyboard",r)},compositionType:(r,s,a,l)=>{this._compositionType("keyboard",r,s,a,l)},startComposition:()=>{this._startComposition()},endComposition:()=>{this._endComposition("keyboard")},cut:()=>{this._cut("keyboard")}}:t={paste:(r,s,a,l)=>{const c={text:r,pasteOnNewLine:s,multicursorText:a,mode:l};this._commandService.executeCommand("paste",c)},type:r=>{const s={text:r};this._commandService.executeCommand("type",s)},compositionType:(r,s,a,l)=>{if(a||l){const c={text:r,replacePrevCharCnt:s,replaceNextCharCnt:a,positionDelta:l};this._commandService.executeCommand("compositionType",c)}else{const c={text:r,replaceCharCnt:s};this._commandService.executeCommand("replacePreviousChar",c)}},startComposition:()=>{this._commandService.executeCommand("compositionStart",{})},endComposition:()=>{this._commandService.executeCommand("compositionEnd",{})},cut:()=>{this._commandService.executeCommand("cut",{})}};const n=new C5(e.coordinatesConverter);return n.onKeyDown=r=>this._onKeyDown.fire(r),n.onKeyUp=r=>this._onKeyUp.fire(r),n.onContextMenu=r=>this._onContextMenu.fire(r),n.onMouseMove=r=>this._onMouseMove.fire(r),n.onMouseLeave=r=>this._onMouseLeave.fire(r),n.onMouseDown=r=>this._onMouseDown.fire(r),n.onMouseUp=r=>this._onMouseUp.fire(r),n.onMouseDrag=r=>this._onMouseDrag.fire(r),n.onMouseDrop=r=>this._onMouseDrop.fire(r),n.onMouseDropCanceled=r=>this._onMouseDropCanceled.fire(r),n.onMouseWheel=r=>this._onMouseWheel.fire(r),[new wH(t,this._configuration,this._themeService.getColorTheme(),e,n,this._overflowWidgetsDomNode,this._instantiationService),!0]}_postDetachModelCleanup(e){e==null||e.removeAllDecorationsWithOwnerId(this._id)}_detachModel(){if(!this._modelData)return null;const e=this._modelData.model,t=this._modelData.hasRealView?this._modelData.view.domNode.domNode:null;return this._modelData.dispose(),this._modelData=null,this._domElement.removeAttribute("data-mode-id"),t&&this._domElement.contains(t)&&this._domElement.removeChild(t),this._bannerDomNode&&this._domElement.contains(this._bannerDomNode)&&this._domElement.removeChild(this._bannerDomNode),e}_removeDecorationType(e){this._codeEditorService.removeDecorationType(e)}hasModel(){return this._modelData!==null}showDropIndicatorAt(e){const t=[{range:new V(e.lineNumber,e.column,e.lineNumber,e.column),options:A_.dropIntoEditorDecorationOptions}];this._dropIntoEditorDecorations.set(t),this.revealPosition(e,1)}removeDropIndicator(){this._dropIntoEditorDecorations.clear()}setContextValue(e,t){this._contextKeyService.createKey(e,t)}};Iw.dropIntoEditorDecorationOptions=Jt.register({description:"workbench-dnd-target",className:"dnd-target"});Iw=A_=Wlt([Qf(3,$t),Qf(4,Jn),Qf(5,_o),Qf(6,Ut),Qf(7,vr),Qf(8,Ao),Qf(9,vp),Qf(10,Ti),Qf(11,pt)],Iw);class Pse extends _e{constructor(e){super(),this._emitterOptions=e,this._onDidChangeToTrue=this._register(new le(this._emitterOptions)),this.onDidChangeToTrue=this._onDidChangeToTrue.event,this._onDidChangeToFalse=this._register(new le(this._emitterOptions)),this.onDidChangeToFalse=this._onDidChangeToFalse.event,this._value=0}setValue(e){const t=e?2:1;this._value!==t&&(this._value=t,this._value===2?this._onDidChangeToTrue.fire():this._value===1&&this._onDidChangeToFalse.fire())}}class Ms extends le{constructor(e,t){super({deliveryQueue:t}),this._contributions=e}fire(e){this._contributions.onBeforeInteractionEvent(),super.fire(e)}}class zlt extends _e{constructor(e,t){super(),this._editor=e,t.createKey("editorId",e.getId()),this._editorSimpleInput=Q.editorSimpleInput.bindTo(t),this._editorFocus=Q.focus.bindTo(t),this._textInputFocus=Q.textInputFocus.bindTo(t),this._editorTextFocus=Q.editorTextFocus.bindTo(t),this._tabMovesFocus=Q.tabMovesFocus.bindTo(t),this._editorReadonly=Q.readOnly.bindTo(t),this._inDiffEditor=Q.inDiffEditor.bindTo(t),this._editorColumnSelection=Q.columnSelection.bindTo(t),this._hasMultipleSelections=Q.hasMultipleSelections.bindTo(t),this._hasNonEmptySelection=Q.hasNonEmptySelection.bindTo(t),this._canUndo=Q.canUndo.bindTo(t),this._canRedo=Q.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(yw.onDidChangeTabFocus(n=>this._tabMovesFocus.set(n))),this._updateFromConfig(),this._updateFromSelection(),this._updateFromFocus(),this._updateFromModel(),this._editorSimpleInput.set(this._editor.isSimpleWidget)}_updateFromConfig(){const e=this._editor.getOptions();this._tabMovesFocus.set(yw.getTabFocusMode()),this._editorReadonly.set(e.get(90)),this._inDiffEditor.set(e.get(61)),this._editorColumnSelection.set(e.get(22))}_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(Boolean(e&&e.canUndo())),this._canRedo.set(Boolean(e&&e.canRedo()))}}class Ult extends _e{constructor(e,t,n){super(),this._editor=e,this._contextKeyService=t,this._languageFeaturesService=n,this._langId=Q.languageId.bindTo(t),this._hasCompletionItemProvider=Q.hasCompletionItemProvider.bindTo(t),this._hasCodeActionsProvider=Q.hasCodeActionsProvider.bindTo(t),this._hasCodeLensProvider=Q.hasCodeLensProvider.bindTo(t),this._hasDefinitionProvider=Q.hasDefinitionProvider.bindTo(t),this._hasDeclarationProvider=Q.hasDeclarationProvider.bindTo(t),this._hasImplementationProvider=Q.hasImplementationProvider.bindTo(t),this._hasTypeDefinitionProvider=Q.hasTypeDefinitionProvider.bindTo(t),this._hasHoverProvider=Q.hasHoverProvider.bindTo(t),this._hasDocumentHighlightProvider=Q.hasDocumentHighlightProvider.bindTo(t),this._hasDocumentSymbolProvider=Q.hasDocumentSymbolProvider.bindTo(t),this._hasReferenceProvider=Q.hasReferenceProvider.bindTo(t),this._hasRenameProvider=Q.hasRenameProvider.bindTo(t),this._hasSignatureHelpProvider=Q.hasSignatureHelpProvider.bindTo(t),this._hasInlayHintsProvider=Q.hasInlayHintsProvider.bindTo(t),this._hasDocumentFormattingProvider=Q.hasDocumentFormattingProvider.bindTo(t),this._hasDocumentSelectionFormattingProvider=Q.hasDocumentSelectionFormattingProvider.bindTo(t),this._hasMultipleDocumentFormattingProvider=Q.hasMultipleDocumentFormattingProvider.bindTo(t),this._hasMultipleDocumentSelectionFormattingProvider=Q.hasMultipleDocumentSelectionFormattingProvider.bindTo(t),this._isInWalkThrough=Q.isInWalkThroughSnippet.bindTo(t);const o=()=>this._update();this._register(e.onDidChangeModel(o)),this._register(e.onDidChangeModelLanguage(o)),this._register(n.completionProvider.onDidChange(o)),this._register(n.codeActionProvider.onDidChange(o)),this._register(n.codeLensProvider.onDidChange(o)),this._register(n.definitionProvider.onDidChange(o)),this._register(n.declarationProvider.onDidChange(o)),this._register(n.implementationProvider.onDidChange(o)),this._register(n.typeDefinitionProvider.onDidChange(o)),this._register(n.hoverProvider.onDidChange(o)),this._register(n.documentHighlightProvider.onDidChange(o)),this._register(n.documentSymbolProvider.onDidChange(o)),this._register(n.referenceProvider.onDidChange(o)),this._register(n.renameProvider.onDidChange(o)),this._register(n.documentFormattingEditProvider.onDidChange(o)),this._register(n.documentRangeFormattingEditProvider.onDidChange(o)),this._register(n.signatureHelpProvider.onDidChange(o)),this._register(n.inlayHintsProvider.onDidChange(o)),o()}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._isInWalkThrough.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._isInWalkThrough.set(e.uri.scheme===hn.walkThroughSnippet)})}}class jlt extends _e{constructor(e){super(),this._onChange=this._register(new le),this.onChange=this._onChange.event,this._hasFocus=!1,this._domFocusTracker=this._register(pf(e)),this._register(this._domFocusTracker.onDidFocus(()=>{this._hasFocus=!0,this._onChange.fire(void 0)})),this._register(this._domFocusTracker.onDidBlur(()=>{this._hasFocus=!1,this._onChange.fire(void 0)}))}hasFocus(){return this._hasFocus}}class Klt{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,n){return this._editor.onDidChangeModelDecorations(o=>{this._isChangingDecorations||e.call(t,o)},n)}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 n of this._decorationIds){const o=e.getDecorationRange(n);o&&t.push(o)}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}}const qlt=encodeURIComponent("");function x9(i){return qlt+encodeURIComponent(i.toString())+Glt}const Xlt=encodeURIComponent('');function Zlt(i){return Xlt+encodeURIComponent(i.toString())+Ylt}ju((i,e)=>{const t=i.getColor(Yh);t&&e.addRule(`.monaco-editor .squiggly-error { background: url("data:image/svg+xml,${x9(t)}") repeat-x bottom left; }`);const n=i.getColor($l);n&&e.addRule(`.monaco-editor .squiggly-warning { background: url("data:image/svg+xml,${x9(n)}") repeat-x bottom left; }`);const o=i.getColor(Ma);o&&e.addRule(`.monaco-editor .squiggly-info { background: url("data:image/svg+xml,${x9(o)}") repeat-x bottom left; }`);const r=i.getColor(ynt);r&&e.addRule(`.monaco-editor .squiggly-hint { background: url("data:image/svg+xml,${Zlt(r)}") no-repeat bottom left; }`);const s=i.getColor(Mot);s&&e.addRule(`.monaco-editor.showUnused .squiggly-inline-unnecessary { opacity: ${s.rgba.a}; }`)});var Qlt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Jlt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},ect=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};let FH=class extends _e{constructor(e){super(),this._themeService=e,this._onWillCreateCodeEditor=this._register(new le),this._onCodeEditorAdd=this._register(new le),this.onCodeEditorAdd=this._onCodeEditorAdd.event,this._onCodeEditorRemove=this._register(new le),this.onCodeEditorRemove=this._onCodeEditorRemove.event,this._onWillCreateDiffEditor=this._register(new le),this._onDiffEditorAdd=this._register(new le),this.onDiffEditorAdd=this._onDiffEditorAdd.event,this._onDiffEditorRemove=this._register(new le),this.onDiffEditorRemove=this._onDiffEditorRemove.event,this._decorationOptionProviders=new Map,this._codeEditorOpenHandlers=new oa,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)}listDiffEditors(){return Object.keys(this._diffEditors).map(e=>this._diffEditors[e])}getFocusedCodeEditor(){let e=null;const t=this.listCodeEditors();for(const n of t){if(n.hasTextFocus())return n;n.hasWidgetFocus()&&(e=n)}return e}removeDecorationType(e){const t=this._decorationOptionProviders.get(e);t&&(t.refCount--,t.refCount<=0&&(this._decorationOptionProviders.delete(e),t.dispose(),this.listCodeEditors().forEach(n=>n.removeDecorationsByType(e))))}setModelProperty(e,t,n){const o=e.toString();let r;this._modelProperties.has(o)?r=this._modelProperties.get(o):(r=new Map,this._modelProperties.set(o,r)),r.set(t,n)}getModelProperty(e,t){const n=e.toString();if(this._modelProperties.has(n))return this._modelProperties.get(n).get(t)}openCodeEditor(e,t,n){return ect(this,void 0,void 0,function*(){for(const o of this._codeEditorOpenHandlers){const r=yield o(e,t,n);if(r!==null)return r}return null})}registerCodeEditorOpenHandler(e){const t=this._codeEditorOpenHandlers.unshift(e);return zt(t)}};FH=Qlt([Jlt(0,vr)],FH);var tct=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Ose=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},nct=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};let SP=class extends FH{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((n,o,r)=>nct(this,void 0,void 0,function*(){return o?this.doOpenEditor(o,n):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===hn.http||r===hn.https)return v0e(t.resource.toString()),e}return null}const o=t.options?t.options.selection:null;if(o)if(typeof o.endLineNumber=="number"&&typeof o.endColumn=="number")e.setSelection(o),e.revealRangeInCenter(o,1);else{const r={lineNumber:o.startLineNumber,column:o.startColumn};e.setPosition(r),e.revealPositionInCenter(r,1)}return e}findModel(e,t){const n=e.getModel();return n&&n.uri.toString()!==t.toString()?null:n}};SP=tct([Ose(0,Ut),Ose(1,vr)],SP);Mn(Jn,SP,0);const SS=yn("layoutService");var u1e=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},d1e=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let xP=class{get dimension(){return this._dimension||(this._dimension=vS(window.document.body)),this._dimension}get hasContainer(){return!1}get container(){throw new Error("ILayoutService.container is not available in the standalone editor!")}focus(){var e;(e=this._codeEditorService.getFocusedCodeEditor())===null||e===void 0||e.focus()}constructor(e){this._codeEditorService=e,this.onDidLayout=st.None,this.offset={top:0,quickPickTop:0}}};xP=u1e([d1e(0,Jn)],xP);let BH=class extends xP{get hasContainer(){return!1}get container(){return this._container}constructor(e,t){super(t),this._container=e}};BH=u1e([d1e(1,Jn)],BH);Mn(SS,xP,1);const tT=yn("dialogService");var ict=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Fse=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},E2=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};function D2(i){return i.scheme===hn.file?i.fsPath:i.path}let h1e=0;class k2{constructor(e,t,n,o,r,s,a){this.id=++h1e,this.type=0,this.actual=e,this.label=e.label,this.confirmBeforeUndo=e.confirmBeforeUndo||!1,this.resourceLabel=t,this.strResource=n,this.resourceLabels=[this.resourceLabel],this.strResources=[this.strResource],this.groupId=o,this.groupOrder=r,this.sourceId=s,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}`}}class Bse{constructor(e,t){this.resourceLabel=e,this.reason=t}}class Wse{constructor(){this.elements=new Map}createMessage(){const e=[],t=[];for(const[,o]of this.elements)(o.reason===0?e:t).push(o.resourceLabel);const n=[];return e.length>0&&n.push(C({key:"externalRemoval",comment:["{0} is a list of filenames"]},"The following files have been closed and modified on disk: {0}.",e.join(", "))),t.length>0&&n.push(C({key:"noParallelUniverses",comment:["{0} is a list of filenames"]},"The following files have been modified in an incompatible way: {0}.",t.join(", "))),n.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 oct{constructor(e,t,n,o,r,s,a){this.id=++h1e,this.type=1,this.actual=e,this.label=e.label,this.confirmBeforeUndo=e.confirmBeforeUndo||!1,this.resourceLabels=t,this.strResources=n,this.groupId=o,this.groupOrder=r,this.sourceId=s,this.sourceOrder=a,this.removedResources=null,this.invalidatedResources=null}canSplit(){return typeof this.actual.split=="function"}removeResource(e,t,n){this.removedResources||(this.removedResources=new Wse),this.removedResources.has(t)||this.removedResources.set(t,new Bse(e,n))}setValid(e,t,n){n?this.invalidatedResources&&(this.invalidatedResources.delete(t),this.invalidatedResources.size===0&&(this.invalidatedResources=null)):(this.invalidatedResources||(this.invalidatedResources=new Wse),this.invalidatedResources.has(t)||this.invalidatedResources.set(t,new Bse(e,0)))}toString(){return`[id:${this.id}] [group:${this.groupId}] [${this.invalidatedResources?"INVALID":" VALID"}] ${this.actual.constructor.name} - ${this.actual}`}}class f1e{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===1&&e.removeResource(this.resourceLabel,this.strResource,0);for(const e of this._future)e.type===1&&e.removeResource(this.resourceLabel,this.strResource,0);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++}_setElementValidFlag(e,t){e.type===1?e.setValid(this.resourceLabel,this.strResource,t):e.setValid(t)}setElementsValidFlag(e,t){for(const n of this._past)t(n.actual)&&this._setElementValidFlag(n,e);for(const n of this._future)t(n.actual)&&this._setElementValidFlag(n,e)}pushElement(e){for(const t of this._future)t.type===1&&t.removeResource(this.resourceLabel,this.strResource,1);this._future=[],this._past.push(e),this.versionId++}createSnapshot(e){const t=[];for(let n=0,o=this._past.length;n=0;n--)t.push(this._future[n].id);return new r1e(e,t)}restoreSnapshot(e){const t=e.elements.length;let n=!0,o=0,r=-1;for(let a=0,l=this._past.length;a=t||c.id!==e.elements[o])&&(n=!1,r=0),!n&&c.type===1&&c.removeResource(this.resourceLabel,this.strResource,0)}let s=-1;for(let a=this._future.length-1;a>=0;a--,o++){const l=this._future[a];n&&(o>=t||l.id!==e.elements[o])&&(n=!1,s=a),!n&&l.type===1&&l.removeResource(this.resourceLabel,this.strResource,0)}r!==-1&&(this._past=this._past.slice(0,r)),s!==-1&&(this._future=this._future.slice(s+1)),this.versionId++}getElements(){const e=[],t=[];for(const n of this._past)e.push(n.actual);for(const n of this._future)t.push(n.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 n=this._past.length-1;n>=0;n--)if(this._past[n]===e){t.has(this.strResource)?this._past[n]=t.get(this.strResource):this._past.splice(n,1);break}this.versionId++}splitFutureWorkspaceElement(e,t){for(let n=this._future.length-1;n>=0;n--)if(this._future[n]===e){t.has(this.strResource)?this._future[n]=t.get(this.strResource):this._future.splice(n,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 L9{constructor(e){this.editStacks=e,this._versionIds=[];for(let t=0,n=this.editStacks.length;tt.sourceOrder)&&(t=s,n=o)}return[t,n]}canUndo(e){if(e instanceof Fh){const[,n]=this._findClosestUndoElementWithSource(e.id);return!!n}const t=this.getUriComparisonKey(e);return this._editStacks.has(t)?this._editStacks.get(t).hasPastElements():!1}_onError(e,t){en(e);for(const n of t.strResources)this.removeElements(n);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,n,o,r){const s=this._acquireLocks(n);let a;try{a=t()}catch(l){return s(),o.dispose(),this._onError(l,e)}return a?a.then(()=>(s(),o.dispose(),r()),l=>(s(),o.dispose(),this._onError(l,e))):(s(),o.dispose(),r())}_invokeWorkspacePrepare(e){return E2(this,void 0,void 0,function*(){if(typeof e.actual.prepareUndoRedo=="undefined")return _e.None;const t=e.actual.prepareUndoRedo();return typeof t=="undefined"?_e.None:t})}_invokeResourcePrepare(e,t){if(e.actual.type!==1||typeof e.actual.prepareUndoRedo=="undefined")return t(_e.None);const n=e.actual.prepareUndoRedo();return n?Wq(n)?t(n):n.then(o=>t(o)):t(_e.None)}_getAffectedEditStacks(e){const t=[];for(const n of e.strResources)t.push(this._editStacks.get(n)||g1e);return new L9(t)}_tryToSplitAndUndo(e,t,n,o){if(t.canSplit())return this._splitPastWorkspaceElement(t,n),this._notificationService.warn(o),new I2(this._undo(e,0,!0));for(const r of t.strResources)this.removeElements(r);return this._notificationService.warn(o),new I2}_checkWorkspaceUndo(e,t,n,o){if(t.removedResources)return this._tryToSplitAndUndo(e,t,t.removedResources,C({key:"cannotWorkspaceUndo",comment:["{0} is a label for an operation. {1} is another message."]},"Could not undo '{0}' across all files. {1}",t.label,t.removedResources.createMessage()));if(o&&t.invalidatedResources)return this._tryToSplitAndUndo(e,t,t.invalidatedResources,C({key:"cannotWorkspaceUndo",comment:["{0} is a label for an operation. {1} is another message."]},"Could not undo '{0}' across all files. {1}",t.label,t.invalidatedResources.createMessage()));const r=[];for(const a of n.editStacks)a.getClosestPastElement()!==t&&r.push(a.resourceLabel);if(r.length>0)return this._tryToSplitAndUndo(e,t,null,C({key:"cannotWorkspaceUndoDueToChanges",comment:["{0} is a label for an operation. {1} is a list of filenames."]},"Could not undo '{0}' across all files because changes were made to {1}",t.label,r.join(", ")));const s=[];for(const a of n.editStacks)a.locked&&s.push(a.resourceLabel);return s.length>0?this._tryToSplitAndUndo(e,t,null,C({key:"cannotWorkspaceUndoDueToInProgressUndoRedo",comment:["{0} is a label for an operation. {1} is a list of filenames."]},"Could not undo '{0}' across all files because there is already an undo or redo operation running on {1}",t.label,s.join(", "))):n.isValid()?null:this._tryToSplitAndUndo(e,t,null,C({key:"cannotWorkspaceUndoDueToInMeantimeUndoRedo",comment:["{0} is a label for an operation. {1} is a list of filenames."]},"Could not undo '{0}' across all files because an undo or redo operation occurred in the meantime",t.label))}_workspaceUndo(e,t,n){const o=this._getAffectedEditStacks(t),r=this._checkWorkspaceUndo(e,t,o,!1);return r?r.returnValue:this._confirmAndExecuteWorkspaceUndo(e,t,o,n)}_isPartOfUndoGroup(e){if(!e.groupId)return!1;for(const[,t]of this._editStacks){const n=t.getClosestPastElement();if(!!n){if(n===e){const o=t.getSecondClosestPastElement();if(o&&o.groupId===e.groupId)return!0}if(n.groupId===e.groupId)return!0}}return!1}_confirmAndExecuteWorkspaceUndo(e,t,n,o){return E2(this,void 0,void 0,function*(){if(t.canSplit()&&!this._isPartOfUndoGroup(t)){let a;(function(u){u[u.All=0]="All",u[u.This=1]="This",u[u.Cancel=2]="Cancel"})(a||(a={}));const{result:l}=yield this._dialogService.prompt({type:So.Info,message:C("confirmWorkspace","Would you like to undo '{0}' across all files?",t.label),buttons:[{label:C({key:"ok",comment:["{0} denotes a number that is > 1, && denotes a mnemonic"]},"&&Undo in {0} Files",n.editStacks.length),run:()=>a.All},{label:C({key:"nok",comment:["&& denotes a mnemonic"]},"Undo this &&File"),run:()=>a.This}],cancelButton:{run:()=>a.Cancel}});if(l===a.Cancel)return;if(l===a.This)return this._splitPastWorkspaceElement(t,null),this._undo(e,0,!0);const c=this._checkWorkspaceUndo(e,t,n,!1);if(c)return c.returnValue;o=!0}let r;try{r=yield this._invokeWorkspacePrepare(t)}catch(a){return this._onError(a,t)}const s=this._checkWorkspaceUndo(e,t,n,!0);if(s)return r.dispose(),s.returnValue;for(const a of n.editStacks)a.moveBackward(t);return this._safeInvokeWithLocks(t,()=>t.actual.undo(),n,r,()=>this._continueUndoInGroup(t.groupId,o))})}_resourceUndo(e,t,n){if(!t.isValid){e.flushAllElements();return}if(e.locked){const o=C({key:"cannotResourceUndoDueToInProgressUndoRedo",comment:["{0} is a label for an operation."]},"Could not undo '{0}' because there is already an undo or redo operation running.",t.label);this._notificationService.warn(o);return}return this._invokeResourcePrepare(t,o=>(e.moveBackward(t),this._safeInvokeWithLocks(t,()=>t.actual.undo(),new L9([e]),o,()=>this._continueUndoInGroup(t.groupId,n))))}_findClosestUndoElementInGroup(e){if(!e)return[null,null];let t=null,n=null;for(const[o,r]of this._editStacks){const s=r.getClosestPastElement();!s||s.groupId===e&&(!t||s.groupOrder>t.groupOrder)&&(t=s,n=o)}return[t,n]}_continueUndoInGroup(e,t){if(!e)return;const[,n]=this._findClosestUndoElementInGroup(e);if(n)return this._undo(n,0,t)}undo(e){if(e instanceof Fh){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,n){if(!this._editStacks.has(e))return;const o=this._editStacks.get(e),r=o.getClosestPastElement();if(!r)return;if(r.groupId){const[a,l]=this._findClosestUndoElementInGroup(r.groupId);if(r!==a&&l)return this._undo(l,t,n)}if((r.sourceId!==t||r.confirmBeforeUndo)&&!n)return this._confirmAndContinueUndo(e,t,r);try{return r.type===1?this._workspaceUndo(e,r,n):this._resourceUndo(o,r,n)}finally{}}_confirmAndContinueUndo(e,t,n){return E2(this,void 0,void 0,function*(){if(!!(yield this._dialogService.confirm({message:C("confirmDifferentSource","Would you like to undo '{0}'?",n.label),primaryButton:C({key:"confirmDifferentSource.yes",comment:["&& denotes a mnemonic"]},"&&Yes"),cancelButton:C("confirmDifferentSource.no","No")})).confirmed)return this._undo(e,t,!0)})}_findClosestRedoElementWithSource(e){if(!e)return[null,null];let t=null,n=null;for(const[o,r]of this._editStacks){const s=r.getClosestFutureElement();!s||s.sourceId===e&&(!t||s.sourceOrder0)return this._tryToSplitAndRedo(e,t,null,C({key:"cannotWorkspaceRedoDueToChanges",comment:["{0} is a label for an operation. {1} is a list of filenames."]},"Could not redo '{0}' across all files because changes were made to {1}",t.label,r.join(", ")));const s=[];for(const a of n.editStacks)a.locked&&s.push(a.resourceLabel);return s.length>0?this._tryToSplitAndRedo(e,t,null,C({key:"cannotWorkspaceRedoDueToInProgressUndoRedo",comment:["{0} is a label for an operation. {1} is a list of filenames."]},"Could not redo '{0}' across all files because there is already an undo or redo operation running on {1}",t.label,s.join(", "))):n.isValid()?null:this._tryToSplitAndRedo(e,t,null,C({key:"cannotWorkspaceRedoDueToInMeantimeUndoRedo",comment:["{0} is a label for an operation. {1} is a list of filenames."]},"Could not redo '{0}' across all files because an undo or redo operation occurred in the meantime",t.label))}_workspaceRedo(e,t){const n=this._getAffectedEditStacks(t),o=this._checkWorkspaceRedo(e,t,n,!1);return o?o.returnValue:this._executeWorkspaceRedo(e,t,n)}_executeWorkspaceRedo(e,t,n){return E2(this,void 0,void 0,function*(){let o;try{o=yield this._invokeWorkspacePrepare(t)}catch(s){return this._onError(s,t)}const r=this._checkWorkspaceRedo(e,t,n,!0);if(r)return o.dispose(),r.returnValue;for(const s of n.editStacks)s.moveForward(t);return this._safeInvokeWithLocks(t,()=>t.actual.redo(),n,o,()=>this._continueRedoInGroup(t.groupId))})}_resourceRedo(e,t){if(!t.isValid){e.flushAllElements();return}if(e.locked){const n=C({key:"cannotResourceRedoDueToInProgressUndoRedo",comment:["{0} is a label for an operation."]},"Could not redo '{0}' because there is already an undo or redo operation running.",t.label);this._notificationService.warn(n);return}return this._invokeResourcePrepare(t,n=>(e.moveForward(t),this._safeInvokeWithLocks(t,()=>t.actual.redo(),new L9([e]),n,()=>this._continueRedoInGroup(t.groupId))))}_findClosestRedoElementInGroup(e){if(!e)return[null,null];let t=null,n=null;for(const[o,r]of this._editStacks){const s=r.getClosestFutureElement();!s||s.groupId===e&&(!t||s.groupOrdernX(i,t))}function sct(i){let e;const t=/^L?(\d+)(?:,(\d+))?(-L?(\d+)(?:,(\d+))?)?/.exec(i.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},i=i.with({fragment:""})),{selection:e,uri:i}}var act=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Hse=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const qc=yn("ILanguageFeatureDebounceService");var LP;(function(i){const e=new WeakMap;let t=0;function n(o){let r=e.get(o);return r===void 0&&(r=++t,e.set(o,r)),r}i.of=n})(LP||(LP={}));class lct{constructor(e){this._default=e}get(e){return this._default}update(e,t){return this._default}default(){return this._default}}class cct{constructor(e,t,n,o,r,s){this._logService=e,this._name=t,this._registry=n,this._default=o,this._min=r,this._max=s,this._cache=new Yv(50,.7)}_key(e){return e.id+this._registry.all(e).reduce((t,n)=>c5(LP.of(n),t),0)}get(e){const t=this._key(e),n=this._cache.get(t);return n?Za(n.value,this._min,this._max):this.default()}update(e,t){const n=this._key(e);let o=this._cache.get(n);o||(o=new rct(6),this._cache.set(n,o));const r=Za(o.update(t),this._min,this._max);return nX(e.uri,"output")||this._logService.trace(`[DEBOUNCE: ${this._name}] for ${e.uri.toString()} is ${r}ms`),r}_overall(){const e=new p1e;for(const[,t]of this._cache)e.update(t.value);return e.value}default(){const e=this._overall()|0||this._default;return Za(e,this._min,this._max)}}let VH=class{constructor(e,t){this._logService=e,this._data=new Map,this._isDev=t.isExtensionDevelopment||!t.isBuilt}for(e,t,n){var o,r,s;const a=(o=n==null?void 0:n.min)!==null&&o!==void 0?o:50,l=(r=n==null?void 0:n.max)!==null&&r!==void 0?r:Math.pow(a,2),c=(s=n==null?void 0:n.key)!==null&&s!==void 0?s:void 0,u=`${LP.of(e)},${a}${c?","+c:""}`;let d=this._data.get(u);return d||(this._isDev?d=new cct(this._logService,t,e,this._overallAverage()|0||a*1.5,a,l):(this._logService.debug(`[DEBOUNCE: ${t}] is disabled in developed mode`),d=new lct(a*1.5)),this._data.set(u,d)),d}_overallAverage(){const e=new p1e;for(const t of this._data.values())e.update(t.default());return e.value}};VH=act([Hse(0,nc),Hse(1,tX)],VH);Mn(qc,VH,1);class LE{static create(e,t){return new LE(e,new EP(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 V(this._startLineNumber+e.startLineNumber,e.startColumn,this._startLineNumber+e.endLineNumber,e.endColumn)}removeTokens(e){const t=e.startLineNumber-this._startLineNumber,n=e.endLineNumber-this._startLineNumber;this._startLineNumber+=this._tokens.removeTokens(t,e.startColumn-1,n,e.endColumn-1),this._updateEndLineNumber()}split(e){const t=e.startLineNumber-this._startLineNumber,n=e.endLineNumber-this._startLineNumber,[o,r,s]=this._tokens.split(t,e.startColumn-1,n,e.endColumn-1);return[new LE(this._startLineNumber,o),new LE(this._startLineNumber+s,r)]}applyEdit(e,t){const[n,o,r]=kv(t);this.acceptEdit(e,n,o,r,t.length>0?t.charCodeAt(0):0)}acceptEdit(e,t,n,o,r){this._acceptDeleteRange(e),this._acceptInsertText(new ae(e.startLineNumber,e.startColumn),t,n,o,r),this._updateEndLineNumber()}_acceptDeleteRange(e){if(e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn)return;const t=e.startLineNumber-this._startLineNumber,n=e.endLineNumber-this._startLineNumber;if(n<0){const r=n-t;this._startLineNumber-=r;return}const o=this._tokens.getMaxDeltaLine();if(!(t>=o+1)){if(t<0&&n>=o+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,n,e.endColumn-1)}else this._tokens.acceptDeleteRange(0,t,e.startColumn-1,n,e.endColumn-1)}}_acceptInsertText(e,t,n,o,r){if(t===0&&n===0)return;const s=e.lineNumber-this._startLineNumber;if(s<0){this._startLineNumber+=t;return}const a=this._tokens.getMaxDeltaLine();s>=a+1||this._tokens.acceptInsertText(s,e.column-1,t,n,o,r)}}class EP{constructor(e){this._tokens=e,this._tokenCount=e.length/4}toString(e){const t=[];for(let n=0;ne)n=o-1;else{let s=o;for(;s>t&&this._getDeltaLine(s-1)===e;)s--;let a=o;for(;ae||h===e&&g>=t)&&(he||g===e&&v>=t){if(gr?p-=r-n:p=n;else if(f===t&&g===n)if(f===o&&p>r)p-=r-n;else{u=!0;continue}else if(fr)f=t,g=n,p=g+(p-r);else{u=!0;continue}else if(f>o){if(l===0&&!u){c=a;break}f-=l}else if(f===o&&g>=r)e&&f===0&&(g+=e,p+=e),f-=l,g-=r-n,p-=r-n;else throw new Error("Not possible!");const m=4*c;s[m]=f,s[m+1]=g,s[m+2]=p,s[m+3]=v,c++}this._tokenCount=c}acceptInsertText(e,t,n,o,r,s){const a=n===0&&o===1&&(s>=48&&s<=57||s>=65&&s<=90||s>=97&&s<=122),l=this._tokens,c=this._tokenCount;for(let u=0;u=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},E9=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let HH=class{constructor(e,t,n,o){this._legend=e,this._themeService=t,this._languageService=n,this._logService=o,this._hasWarnedOverlappingTokens=!1,this._hasWarnedInvalidLengthTokens=!1,this._hasWarnedInvalidEditStart=!1,this._hashTable=new mg}getMetadata(e,t,n){const o=this._languageService.languageIdCodec.encodeLanguageId(n),r=this._hashTable.get(e,t,o);let s;if(r)s=r.metadata,this._logService.getLevel()===ns.Trace&&this._logService.trace(`SemanticTokensProviderStyling [CACHED] ${e} / ${t}: foreground ${is.getForeground(s)}, fontStyle ${is.getFontStyle(s).toString(2)}`);else{let a=this._legend.tokenTypes[e];const l=[];if(a){let c=t;for(let d=0;c>0&&d>1;c>0&&this._logService.getLevel()===ns.Trace&&(this._logService.trace(`SemanticTokensProviderStyling: unknown token modifier index: ${t.toString(2)} for legend: ${JSON.stringify(this._legend.tokenModifiers)}`),l.push("not-in-legend"));const u=this._themeService.getColorTheme().getTokenStyleMetadata(a,l,n);typeof u=="undefined"?s=2147483647:(s=0,typeof u.italic!="undefined"&&(s|=(u.italic?1:0)<<11|1),typeof u.bold!="undefined"&&(s|=(u.bold?2:0)<<11|2),typeof u.underline!="undefined"&&(s|=(u.underline?4:0)<<11|4),typeof u.strikethrough!="undefined"&&(s|=(u.strikethrough?8:0)<<11|8),u.foreground&&(s|=u.foreground<<15|16),s===0&&(s=2147483647))}else this._logService.getLevel()===ns.Trace&&this._logService.trace(`SemanticTokensProviderStyling: unknown token type index: ${e} for legend: ${JSON.stringify(this._legend.tokenTypes)}`),s=2147483647,a="not-in-legend";this._hashTable.add(e,t,o,s),this._logService.getLevel()===ns.Trace&&this._logService.trace(`SemanticTokensProviderStyling ${e} (${a}) / ${t} (${l.join(" ")}): foreground ${is.getForeground(s)}, fontStyle ${is.getFontStyle(s).toString(2)}`)}return s}warnOverlappingSemanticTokens(e,t){this._hasWarnedOverlappingTokens||(this._hasWarnedOverlappingTokens=!0,console.warn(`Overlapping semantic tokens detected at lineNumber ${e}, column ${t}`))}warnInvalidLengthSemanticTokens(e,t){this._hasWarnedInvalidLengthTokens||(this._hasWarnedInvalidLengthTokens=!0,console.warn(`Semantic token with invalid length detected at lineNumber ${e}, column ${t}`))}warnInvalidEditStart(e,t,n,o,r){this._hasWarnedInvalidEditStart||(this._hasWarnedInvalidEditStart=!0,console.warn(`Invalid semantic tokens edit detected (previousResultId: ${e}, resultId: ${t}) at edit #${n}: The provided start offset ${o} is outside the previous data (length ${r}).`))}};HH=uct([E9(1,vr),E9(2,Ki),E9(3,nc)],HH);function m1e(i,e,t){const n=i.data,o=i.data.length/5|0,r=Math.max(Math.ceil(o/1024),400),s=[];let a=0,l=1,c=0;for(;au&&n[5*_]===0;)_--;if(_-1===u){let y=d;for(;y+1D)e.warnOverlappingSemanticTokens(L,D+1);else{const A=e.getMetadata(k,R,t);A!==2147483647&&(g===0&&(g=L),h[f]=L-g,h[f+1]=D,h[f+2]=I,h[f+3]=A,f+=4,p=L,v=I)}l=L,c=D,a++}f!==h.length&&(h=h.subarray(0,f));const m=LE.create(g,h);s.push(m)}return s}class dct{constructor(e,t,n,o){this.tokenTypeIndex=e,this.tokenModifierSet=t,this.languageId=n,this.metadata=o,this.next=null}}class mg{constructor(){this._elementsCount=0,this._currentLengthIndex=0,this._currentLength=mg._SIZES[this._currentLengthIndex],this._growCount=Math.round(this._currentLengthIndex+1=this._growCount){const r=this._elements;this._currentLengthIndex++,this._currentLength=mg._SIZES[this._currentLengthIndex],this._growCount=Math.round(this._currentLengthIndex+1=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},D9=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let $H=class extends _e{constructor(e,t,n){super(),this._themeService=e,this._logService=t,this._languageService=n,this._caches=new WeakMap,this._register(this._themeService.onDidColorThemeChange(()=>{this._caches=new WeakMap}))}getStyling(e){return this._caches.has(e)||this._caches.set(e,new HH(e.getLegend(),this._themeService,this._languageService,this._logService)),this._caches.get(e)}};$H=hct([D9(0,vr),D9(1,nc),D9(2,Ki)],$H);Mn(D5,$H,1);var zse=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};const T2="**",Use="/",gM="[/\\\\]",pM="[^/\\\\]",fct=/\//g;function jse(i,e){switch(i){case 0:return"";case 1:return`${pM}*?`;default:return`(?:${gM}|${pM}+${gM}${e?`|${gM}${pM}+`:""})*?`}}function Kse(i,e){if(!i)return[];const t=[];let n=!1,o=!1,r="";for(const s of i){switch(s){case e:if(!n&&!o){t.push(r),r="";continue}break;case"{":n=!0;break;case"}":n=!1;break;case"[":o=!0;break;case"]":o=!1;break}r+=s}return r&&t.push(r),t}function v1e(i){if(!i)return"";let e="";const t=Kse(i,Use);if(t.every(n=>n===T2))e=".*";else{let n=!1;t.forEach((o,r)=>{if(o===T2){if(n)return;e+=jse(2,r===t.length-1)}else{let s=!1,a="",l=!1,c="";for(const u of o){if(u!=="}"&&s){a+=u;continue}if(l&&(u!=="]"||!c)){let d;u==="-"?d=u:(u==="^"||u==="!")&&!c?d="^":u===Use?d="":d=Xl(u),c+=d;continue}switch(u){case"{":s=!0;continue;case"[":l=!0;continue;case"}":{e+=`(?:${Kse(a,",").map(f=>v1e(f)).join("|")})`,s=!1,a="";break}case"]":{e+="["+c+"]",l=!1,c="";break}case"?":e+=pM;continue;case"*":e+=jse(1);continue;default:e+=Xl(u)}}riX(a,e)).filter(a=>a!==uf),i),n=t.length;if(!n)return uf;if(n===1)return t[0];const o=function(a,l){for(let c=0,u=t.length;c!!a.allBasenames);r&&(o.allBasenames=r.allBasenames);const s=t.reduce((a,l)=>l.allPaths?a.concat(l.allPaths):a,[]);return s.length&&(o.allPaths=s),o}function Yse(i,e,t){const n=Bd===Go.sep,o=n?i:i.replace(fct,Bd),r=Bd+o,s=Go.sep+i;let a;return t?a=function(l,c){return typeof l=="string"&&(l===o||l.endsWith(r)||!n&&(l===i||l.endsWith(s)))?e:null}:a=function(l,c){return typeof l=="string"&&(l===o||!n&&l===i)?e:null},a.allPaths=[(t?"*/":"./")+i],a}function Sct(i){try{const e=new RegExp(`^${v1e(i)}$`);return function(t){return e.lastIndex=0,typeof t=="string"&&e.test(t)?i:null}}catch{return uf}}function xct(i,e,t){return!i||typeof e!="string"?!1:_1e(i)(e,void 0,t)}function _1e(i,e={}){if(!i)return Gse;if(typeof i=="string"||Lct(i)){const t=iX(i,e);if(t===uf)return Gse;const n=function(o,r){return!!t(o,r)};return t.allBasenames&&(n.allBasenames=t.allBasenames),t.allPaths&&(n.allPaths=t.allPaths),n}return Ect(i,e)}function Lct(i){const e=i;return e?typeof e.base=="string"&&typeof e.pattern=="string":!1}function Ect(i,e){const t=b1e(Object.getOwnPropertyNames(i).map(a=>Dct(a,i[a],e)).filter(a=>a!==uf)),n=t.length;if(!n)return uf;if(!t.some(a=>!!a.requiresSiblings)){if(n===1)return t[0];const a=function(u,d){let h;for(let f=0,g=t.length;fzse(this,void 0,void 0,function*(){for(const f of h){const g=yield f;if(typeof g=="string")return g}return null}))():null},l=t.find(u=>!!u.allBasenames);l&&(a.allBasenames=l.allBasenames);const c=t.reduce((u,d)=>d.allPaths?u.concat(d.allPaths):u,[]);return c.length&&(a.allPaths=c),a}const o=function(a,l,c){let u,d;for(let h=0,f=t.length;hzse(this,void 0,void 0,function*(){for(const h of d){const f=yield h;if(typeof f=="string")return f}return null}))():null},r=t.find(a=>!!a.allBasenames);r&&(o.allBasenames=r.allBasenames);const s=t.reduce((a,l)=>l.allPaths?a.concat(l.allPaths):a,[]);return s.length&&(o.allPaths=s),o}function Dct(i,e,t){if(e===!1)return uf;const n=iX(i,t);if(n===uf)return uf;if(typeof e=="boolean")return n;if(e){const o=e.when;if(typeof o=="string"){const r=(s,a,l,c)=>{if(!c||!n(s,a))return null;const u=o.replace("$(basename)",()=>l),d=c(u);return XV(d)?d.then(h=>h?i:null):d?i:null};return r.requiresSiblings=!0,r}}return n}function b1e(i,e){const t=i.filter(a=>!!a.basenames);if(t.length<2)return i;const n=t.reduce((a,l)=>{const c=l.basenames;return c?a.concat(c):a},[]);let o;if(e){o=[];for(let a=0,l=n.length;a{const c=l.patterns;return c?a.concat(c):a},[]);const r=function(a,l){if(typeof a!="string")return null;if(!l){let u;for(u=a.length;u>0;u--){const d=a.charCodeAt(u-1);if(d===47||d===92)break}l=a.substr(u)}const c=n.indexOf(l);return c!==-1?o[c]:null};r.basenames=n,r.patterns=o,r.allBasenames=n;const s=i.filter(a=>!a.basenames);return s.push(r),s}function C1e(i,e,t,n,o,r){if(Array.isArray(i)){let s=0;for(const a of i){const l=C1e(a,e,t,n,o,r);if(l===10)return l;l>s&&(s=l)}return s}else{if(typeof i=="string")return n?i==="*"?5:i===t?10:0:0;if(i){const{language:s,pattern:a,scheme:l,hasAccessToAllModels:c,notebookType:u}=i;if(!n&&!c)return 0;u&&o&&(e=o);let d=0;if(l)if(l===e.scheme)d=10;else if(l==="*")d=5;else return 0;if(s)if(s===t)d=10;else if(s==="*")d=Math.max(d,5);else return 0;if(u)if(u===r)d=10;else if(u==="*"&&r!==void 0)d=Math.max(d,5);else return 0;if(a){let h;if(typeof a=="string"?h=a:h=Object.assign(Object.assign({},a),{base:R_e(a.base)}),h===e.fsPath||xct(h,e.fsPath))d=10;else return 0}return d}else return 0}}function y1e(i){return typeof i=="string"?!1:Array.isArray(i)?i.every(y1e):!!i.exclusive}class Zse{constructor(e,t,n,o){this.uri=e,this.languageId=t,this.notebookUri=n,this.notebookType=o}equals(e){var t,n;return this.notebookType===e.notebookType&&this.languageId===e.languageId&&this.uri.toString()===e.uri.toString()&&((t=this.notebookUri)===null||t===void 0?void 0:t.toString())===((n=e.notebookUri)===null||n===void 0?void 0:n.toString())}}class fo{constructor(e){this._notebookInfoResolver=e,this._clock=0,this._entries=[],this._onDidChange=new le,this.onDidChange=this._onDidChange.event}register(e,t){let n={selector:e,provider:t,_score:-1,_time:this._clock++};return this._entries.push(n),this._lastCandidate=void 0,this._onDidChange.fire(this._entries.length),zt(()=>{if(n){const o=this._entries.indexOf(n);o>=0&&(this._entries.splice(o,1),this._lastCandidate=void 0,this._onDidChange.fire(this._entries.length),n=void 0)}})}has(e){return this.all(e).length>0}all(e){if(!e)return[];this._updateScores(e);const t=[];for(const n of this._entries)n._score>0&&t.push(n.provider);return t}ordered(e){const t=[];return this._orderedForEach(e,n=>t.push(n.provider)),t}orderedGroups(e){const t=[];let n,o;return this._orderedForEach(e,r=>{n&&o===r._score?n.push(r.provider):(o=r._score,n=[r.provider],t.push(n))}),t}_orderedForEach(e,t){this._updateScores(e);for(const n of this._entries)n._score>0&&t(n)}_updateScores(e){var t,n;const o=(t=this._notebookInfoResolver)===null||t===void 0?void 0:t.call(this,e.uri),r=o?new Zse(e.uri,e.getLanguageId(),o.uri,o.type):new Zse(e.uri,e.getLanguageId(),void 0,void 0);if(!(!((n=this._lastCandidate)===null||n===void 0)&&n.equals(r))){this._lastCandidate=r;for(const s of this._entries)if(s._score=C1e(s.selector,r.uri,r.languageId,_et(e),r.notebookUri,r.notebookType),y1e(s.selector)&&s._score>0){for(const a of this._entries)a._score=0;s._score=1e3;break}this._entries.sort(fo._compareByScoreAndTime)}}static _compareByScoreAndTime(e,t){return e._scoret._score?-1:IL(e.selector)&&!IL(t.selector)?1:!IL(e.selector)&&IL(t.selector)?-1:e._timet._time?-1:0}}function IL(i){return typeof i=="string"?!1:Array.isArray(i)?i.some(IL):Boolean(i.isBuiltin)}class kct{constructor(){this.referenceProvider=new fo(this._score.bind(this)),this.renameProvider=new fo(this._score.bind(this)),this.codeActionProvider=new fo(this._score.bind(this)),this.definitionProvider=new fo(this._score.bind(this)),this.typeDefinitionProvider=new fo(this._score.bind(this)),this.declarationProvider=new fo(this._score.bind(this)),this.implementationProvider=new fo(this._score.bind(this)),this.documentSymbolProvider=new fo(this._score.bind(this)),this.inlayHintsProvider=new fo(this._score.bind(this)),this.colorProvider=new fo(this._score.bind(this)),this.codeLensProvider=new fo(this._score.bind(this)),this.documentFormattingEditProvider=new fo(this._score.bind(this)),this.documentRangeFormattingEditProvider=new fo(this._score.bind(this)),this.onTypeFormattingEditProvider=new fo(this._score.bind(this)),this.signatureHelpProvider=new fo(this._score.bind(this)),this.hoverProvider=new fo(this._score.bind(this)),this.documentHighlightProvider=new fo(this._score.bind(this)),this.selectionRangeProvider=new fo(this._score.bind(this)),this.foldingRangeProvider=new fo(this._score.bind(this)),this.linkProvider=new fo(this._score.bind(this)),this.inlineCompletionsProvider=new fo(this._score.bind(this)),this.completionProvider=new fo(this._score.bind(this)),this.linkedEditingRangeProvider=new fo(this._score.bind(this)),this.documentRangeSemanticTokensProvider=new fo(this._score.bind(this)),this.documentSemanticTokensProvider=new fo(this._score.bind(this)),this.documentOnDropEditProvider=new fo(this._score.bind(this)),this.documentPasteEditProvider=new fo(this._score.bind(this))}_score(e){var t;return(t=this._notebookTypeResolver)===null||t===void 0?void 0:t.call(this,e)}}Mn(pt,kct,1);const nT=yn("IWorkspaceEditService");class oX{constructor(e){this.metadata=e}static convert(e){return e.edits.map(t=>{if(qg.is(t))return qg.lift(t);if(Ny.is(t))return Ny.lift(t);throw new Error("Unsupported edit")})}}class qg extends oX{static is(e){return e instanceof qg?!0:ia(e)&&Rt.isUri(e.resource)&&ia(e.textEdit)}static lift(e){return e instanceof qg?e:new qg(e.resource,e.textEdit,e.versionId,e.metadata)}constructor(e,t,n=void 0,o){super(o),this.resource=e,this.textEdit=t,this.versionId=n}}class Ny extends oX{static is(e){return e instanceof Ny?!0:ia(e)&&(Boolean(e.newResource)||Boolean(e.oldResource))}static lift(e){return e instanceof Ny?e:new Ny(e.oldResource,e.newResource,e.options,e.metadata)}constructor(e,t,n={},o){super(o),this.oldResource=e,this.newResource=t,this.options=n}}const As={enableSplitViewResizing:!0,splitViewDefaultRatio:.5,renderSideBySide:!0,renderMarginRevertIcon:!0,maxComputationTime:5e3,maxFileSize:50,ignoreTrimWhitespace:!0,renderIndicators:!0,originalEditable:!1,diffCodeLens:!1,renderOverviewRuler:!0,diffWordWrap:"inherit",diffAlgorithm:"advanced",accessibilityVerbose:!1,experimental:{showMoves:!1,showEmptyDecorations:!0},hideUnchangedRegions:{enabled:!1,contextLineCount:3,minimumLineCount:3,revealLineCount:20},isInEmbeddedEditor:!1,onlyShowAccessibleDiffViewer:!1,renderSideBySideInlineBreakpoint:900,useInlineViewWhenSpaceIsLimited:!0},k5=Object.freeze({id:"editor",order:5,type:"object",title:C("editorConfigurationTitle","Editor"),scope:5}),DP=Object.assign(Object.assign({},k5),{properties:{"editor.tabSize":{type:"number",default:vs.tabSize,minimum:1,markdownDescription:C("tabSize","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:C("indentSize",'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:vs.insertSpaces,markdownDescription:C("insertSpaces","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:vs.detectIndentation,markdownDescription:C("detectIndentation","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:vs.trimAutoWhitespace,description:C("trimAutoWhitespace","Remove trailing auto inserted whitespace.")},"editor.largeFileOptimizations":{type:"boolean",default:vs.largeFileOptimizations,description:C("largeFileOptimizations","Special handling for large files to disable certain memory intensive features.")},"editor.wordBasedSuggestions":{type:"boolean",default:!0,description:C("wordBasedSuggestions","Controls whether completions should be computed based on words in the document.")},"editor.wordBasedSuggestionsMode":{enum:["currentDocument","matchingDocuments","allDocuments"],default:"matchingDocuments",enumDescriptions:[C("wordBasedSuggestionsMode.currentDocument","Only suggest words from the active document."),C("wordBasedSuggestionsMode.matchingDocuments","Suggest words from all open documents of the same language."),C("wordBasedSuggestionsMode.allDocuments","Suggest words from all open documents.")],description:C("wordBasedSuggestionsMode","Controls from which documents word based completions are computed.")},"editor.semanticHighlighting.enabled":{enum:[!0,!1,"configuredByTheme"],enumDescriptions:[C("semanticHighlighting.true","Semantic highlighting enabled for all color themes."),C("semanticHighlighting.false","Semantic highlighting disabled for all color themes."),C("semanticHighlighting.configuredByTheme","Semantic highlighting is configured by the current color theme's `semanticHighlighting` setting.")],default:"configuredByTheme",description:C("semanticHighlighting.enabled","Controls whether the semanticHighlighting is shown for the languages that support it.")},"editor.stablePeek":{type:"boolean",default:!1,markdownDescription:C("stablePeek","Keep peek editors open even when double-clicking their content or when hitting `Escape`.")},"editor.maxTokenizationLineLength":{type:"integer",default:2e4,description:C("maxTokenizationLineLength","Lines above this length will not be tokenized for performance reasons")},"editor.experimental.asyncTokenization":{type:"boolean",default:!1,description:C("editor.experimental.asyncTokenization","Controls whether the tokenization should happen asynchronously on a web worker."),tags:["experimental"]},"editor.experimental.asyncTokenizationLogging":{type:"boolean",default:!1,description:C("editor.experimental.asyncTokenizationLogging","Controls whether async tokenization should be logged. For debugging only.")},"editor.experimental.asyncTokenizationVerification":{type:"boolean",default:!1,description:C("editor.experimental.asyncTokenizationVerification","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:C("schema.brackets","Defines the bracket symbols that increase or decrease the indentation."),items:{type:"array",items:[{type:"string",description:C("schema.openBracket","The opening bracket character or string sequence.")},{type:"string",description:C("schema.closeBracket","The closing bracket character or string sequence.")}]}},"editor.language.colorizedBracketPairs":{type:["array","null"],default:null,description:C("schema.colorizedBracketPairs","Defines the bracket pairs that are colorized by their nesting level if bracket pair colorization is enabled."),items:{type:"array",items:[{type:"string",description:C("schema.openBracket","The opening bracket character or string sequence.")},{type:"string",description:C("schema.closeBracket","The closing bracket character or string sequence.")}]}},"diffEditor.maxComputationTime":{type:"number",default:As.maxComputationTime,description:C("maxComputationTime","Timeout in milliseconds after which diff computation is cancelled. Use 0 for no timeout.")},"diffEditor.maxFileSize":{type:"number",default:As.maxFileSize,description:C("maxFileSize","Maximum file size in MB for which to compute diffs. Use 0 for no limit.")},"diffEditor.renderSideBySide":{type:"boolean",default:As.renderSideBySide,description:C("sideBySide","Controls whether the diff editor shows the diff side by side or inline.")},"diffEditor.renderSideBySideInlineBreakpoint":{type:"number",default:As.renderSideBySideInlineBreakpoint,description:C("renderSideBySideInlineBreakpoint","If the diff editor width is smaller than this value, the inline view is used.")},"diffEditor.useInlineViewWhenSpaceIsLimited":{type:"boolean",default:As.useInlineViewWhenSpaceIsLimited,description:C("useInlineViewWhenSpaceIsLimited","If enabled and the editor width is too small, the inline view is used.")},"diffEditor.renderMarginRevertIcon":{type:"boolean",default:As.renderMarginRevertIcon,description:C("renderMarginRevertIcon","When enabled, the diff editor shows arrows in its glyph margin to revert changes.")},"diffEditor.ignoreTrimWhitespace":{type:"boolean",default:As.ignoreTrimWhitespace,description:C("ignoreTrimWhitespace","When enabled, the diff editor ignores changes in leading or trailing whitespace.")},"diffEditor.renderIndicators":{type:"boolean",default:As.renderIndicators,description:C("renderIndicators","Controls whether the diff editor shows +/- indicators for added/removed changes.")},"diffEditor.codeLens":{type:"boolean",default:As.diffCodeLens,description:C("codeLens","Controls whether the editor shows CodeLens.")},"diffEditor.wordWrap":{type:"string",enum:["off","on","inherit"],default:As.diffWordWrap,markdownEnumDescriptions:[C("wordWrap.off","Lines will never wrap."),C("wordWrap.on","Lines will wrap at the viewport width."),C("wordWrap.inherit","Lines will wrap according to the {0} setting.","`#editor.wordWrap#`")]},"diffEditor.diffAlgorithm":{type:"string",enum:["legacy","advanced"],default:As.diffAlgorithm,markdownEnumDescriptions:[C("diffAlgorithm.legacy","Uses the legacy diffing algorithm."),C("diffAlgorithm.advanced","Uses the advanced diffing algorithm.")],tags:["experimental"]},"diffEditor.hideUnchangedRegions.enabled":{type:"boolean",default:As.hideUnchangedRegions.enabled,markdownDescription:C("hideUnchangedRegions.enabled","Controls whether the diff editor shows unchanged regions.")},"diffEditor.hideUnchangedRegions.revealLineCount":{type:"integer",default:As.hideUnchangedRegions.revealLineCount,markdownDescription:C("hideUnchangedRegions.revealLineCount","Controls how many lines are used for unchanged regions."),minimum:1},"diffEditor.hideUnchangedRegions.minimumLineCount":{type:"integer",default:As.hideUnchangedRegions.minimumLineCount,markdownDescription:C("hideUnchangedRegions.minimumLineCount","Controls how many lines are used as a minimum for unchanged regions."),minimum:1},"diffEditor.hideUnchangedRegions.contextLineCount":{type:"integer",default:As.hideUnchangedRegions.contextLineCount,markdownDescription:C("hideUnchangedRegions.contextLineCount","Controls how many lines are used as context when comparing unchanged regions."),minimum:1},"diffEditor.experimental.showMoves":{type:"boolean",default:As.experimental.showMoves,markdownDescription:C("showMoves","Controls whether the diff editor should show detected code moves.")},"diffEditor.experimental.showEmptyDecorations":{type:"boolean",default:As.experimental.showEmptyDecorations,description:C("showEmptyDecorations","Controls whether the diff editor shows empty decorations to see where characters got inserted or deleted.")}}});function Ict(i){return typeof i.type!="undefined"||typeof i.anyOf!="undefined"}for(const i of DC){const e=i.schema;if(typeof e!="undefined")if(Ict(e))DP.properties[`editor.${i.name}`]=e;else for(const t in e)Object.hasOwnProperty.call(e,t)&&(DP.properties[t]=e[t])}let N2=null;function w1e(){return N2===null&&(N2=Object.create(null),Object.keys(DP.properties).forEach(i=>{N2[i]=!0})),N2}function Tct(i){return w1e()[`editor.${i}`]||!1}function Nct(i){return w1e()[`diffEditor.${i}`]||!1}const Rct=no.as(ch.Configuration);Rct.registerConfiguration(DP);class Gi{static insert(e,t){return{range:new V(e.lineNumber,e.column,e.lineNumber,e.column),text:t,forceMoveMarkers:!0}}static delete(e){return{range:e,text:null}}static replace(e,t){return{range:e,text:t}}static replaceMove(e,t){return{range:e,text:t,forceMoveMarkers:!0}}}function I9(i){return Object.isFrozen(i)?i:vXe(i)}class ps{constructor(e={},t=[],n=[],o){this._contents=e,this._keys=t,this._overrides=n,this.raw=o,this.overrideConfigurations=new Map}get rawConfiguration(){var e;if(!this._rawConfiguration)if(!((e=this.raw)===null||e===void 0)&&e.length){const t=this.raw.map(n=>{if(n instanceof ps)return n;const o=new Mct("");return o.parseRaw(n),o.configurationModel});this._rawConfiguration=t.reduce((n,o)=>o===n?o:n.merge(o),t[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?Woe(this.contents,e):this.contents}inspect(e,t){const n=this.rawConfiguration.getValue(e),o=t?this.rawConfiguration.getOverrideValue(e,t):void 0,r=t?this.rawConfiguration.override(t).getValue(e):n;return{value:n,override:o,merged:r}}getOverrideValue(e,t){const n=this.getContentsForOverrideIdentifer(t);return n?e?Woe(n,e):n:void 0}override(e){let t=this.overrideConfigurations.get(e);return t||(t=this.createOverrideConfigurationModel(e),this.overrideConfigurations.set(e,t)),t}merge(...e){var t,n;const o=fg(this.contents),r=fg(this.overrides),s=[...this.keys],a=!((t=this.raw)===null||t===void 0)&&t.length?[...this.raw]:[this];for(const l of e)if(a.push(...!((n=l.raw)===null||n===void 0)&&n.length?l.raw:[l]),!l.isEmpty()){this.mergeContents(o,l.contents);for(const c of l.overrides){const[u]=r.filter(d=>Lo(d.identifiers,c.identifiers));u?(this.mergeContents(u.contents,c.contents),u.keys.push(...c.keys),u.keys=vv(u.keys)):r.push(fg(c))}for(const c of l.keys)s.indexOf(c)===-1&&s.push(c)}return new ps(o,s,r,a.every(l=>l instanceof ps)?void 0:a)}createOverrideConfigurationModel(e){const t=this.getContentsForOverrideIdentifer(e);if(!t||typeof t!="object"||!Object.keys(t).length)return this;const n={};for(const o of vv([...Object.keys(this.contents),...Object.keys(t)])){let r=this.contents[o];const s=t[o];s&&(typeof r=="object"&&typeof s=="object"?(r=fg(r),this.mergeContents(r,s)):r=s),n[o]=r}return new ps(n,this.keys,this.overrides)}mergeContents(e,t){for(const n of Object.keys(t)){if(n in e&&ia(e[n])&&ia(t[n])){this.mergeContents(e[n],t[n]);continue}e[n]=fg(t[n])}}getContentsForOverrideIdentifer(e){let t=null,n=null;const o=r=>{r&&(n?this.mergeContents(n,r):n=fg(r))};for(const r of this.overrides)r.identifiers.length===1&&r.identifiers[0]===e?t=r.contents:r.identifiers.includes(e)&&o(r.contents);return o(t),n}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),MJe(this.contents,e),xv.test(e)&&this.overrides.splice(this.overrides.findIndex(n=>Lo(n.identifiers,YA(e))),1))}updateValue(e,t,n){R0e(this.contents,e,t,o=>console.error(o)),n=n||this.keys.indexOf(e)===-1,n&&this.keys.push(e),xv.test(e)&&this.overrides.push({identifiers:YA(e),keys:Object.keys(this.contents[e]),contents:QV(this.contents[e],o=>console.error(o))})}}class Mct{constructor(e){this._name=e,this._raw=null,this._configurationModel=null,this._restrictedConfigurations=[]}get configurationModel(){return this._configurationModel||new ps}parseRaw(e,t){this._raw=e;const{contents:n,keys:o,overrides:r,restricted:s,hasExcludedProperties:a}=this.doParseRaw(e,t);this._configurationModel=new ps(n,o,r,a?[e]:void 0),this._restrictedConfigurations=s||[]}doParseRaw(e,t){const n=no.as(ch.Configuration).getConfigurationProperties(),o=this.filter(e,n,!0,t);e=o.raw;const r=QV(e,l=>console.error(`Conflict in settings file ${this._name}: ${l}`)),s=Object.keys(e),a=this.toOverrides(e,l=>console.error(`Conflict in settings file ${this._name}: ${l}`));return{contents:r,keys:s,overrides:a,restricted:o.restricted,hasExcludedProperties:o.hasExcludedProperties}}filter(e,t,n,o){var r,s,a;let l=!1;if(!(o!=null&&o.scopes)&&!(o!=null&&o.skipRestricted)&&!(!((r=o==null?void 0:o.exclude)===null||r===void 0)&&r.length))return{raw:e,restricted:[],hasExcludedProperties:l};const c={},u=[];for(const d in e)if(xv.test(d)&&n){const h=this.filter(e[d],t,!1,o);c[d]=h.raw,l=l||h.hasExcludedProperties,u.push(...h.restricted)}else{const h=t[d],f=h?typeof h.scope!="undefined"?h.scope:3:void 0;h!=null&&h.restricted&&u.push(d),!(!((s=o.exclude)===null||s===void 0)&&s.includes(d))&&(((a=o.include)===null||a===void 0?void 0:a.includes(d))||(f===void 0||o.scopes===void 0||o.scopes.includes(f))&&!(o.skipRestricted&&(h==null?void 0:h.restricted)))?c[d]=e[d]:l=!0}return{raw:c,restricted:u,hasExcludedProperties:l}}toOverrides(e,t){const n=[];for(const o of Object.keys(e))if(xv.test(o)){const r={};for(const s in e[o])r[s]=e[o][s];n.push({identifiers:YA(o),keys:Object.keys(r),contents:QV(r,t)})}return n}}class Act{constructor(e,t,n,o,r,s,a,l,c,u,d,h,f){this.key=e,this.overrides=t,this._value=n,this.overrideIdentifiers=o,this.defaultConfiguration=r,this.policyConfiguration=s,this.applicationConfiguration=a,this.userConfiguration=l,this.localUserConfiguration=c,this.remoteUserConfiguration=u,this.workspaceConfiguration=d,this.folderConfigurationModel=h,this.memoryConfigurationModel=f}inspect(e,t,n){const o=e.inspect(t,n);return{get value(){return I9(o.value)},get override(){return I9(o.override)},get merged(){return I9(o.merged)}}}get userInspectValue(){return this._userInspectValue||(this._userInspectValue=this.inspect(this.userConfiguration,this.key,this.overrides.overrideIdentifier)),this._userInspectValue}get user(){return this.userInspectValue.value!==void 0||this.userInspectValue.override!==void 0?{value:this.userInspectValue.value,override:this.userInspectValue.override}:void 0}}class I5{constructor(e,t,n,o,r=new ps,s=new ps,a=new _s,l=new ps,c=new _s){this._defaultConfiguration=e,this._policyConfiguration=t,this._applicationConfiguration=n,this._localUserConfiguration=o,this._remoteUserConfiguration=r,this._workspaceConfiguration=s,this._folderConfigurations=a,this._memoryConfiguration=l,this._memoryConfigurationByResource=c,this._workspaceConsolidatedConfiguration=null,this._foldersConsolidatedConfigurations=new _s,this._userConfiguration=null}getValue(e,t,n){return this.getConsolidatedConfigurationModel(e,t,n).getValue(e)}updateValue(e,t,n={}){let o;n.resource?(o=this._memoryConfigurationByResource.get(n.resource),o||(o=new ps,this._memoryConfigurationByResource.set(n.resource,o))):o=this._memoryConfiguration,t===void 0?o.removeValue(e):o.setValue(e,t),n.resource||(this._workspaceConsolidatedConfiguration=null)}inspect(e,t,n){const o=this.getConsolidatedConfigurationModel(e,t,n),r=this.getFolderConfigurationModelForResource(t.resource,n),s=t.resource?this._memoryConfigurationByResource.get(t.resource)||this._memoryConfiguration:this._memoryConfiguration,a=new Set;for(const l of o.overrides)for(const c of l.identifiers)o.getOverrideValue(e,c)!==void 0&&a.add(c);return new Act(e,t,o.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,n?this._workspaceConfiguration:void 0,r||void 0,s)}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}getConsolidatedConfigurationModel(e,t,n){let o=this.getConsolidatedConfigurationModelForResource(t,n);return t.overrideIdentifier&&(o=o.override(t.overrideIdentifier)),!this._policyConfiguration.isEmpty()&&this._policyConfiguration.getValue(e)!==void 0&&(o=o.merge(this._policyConfiguration)),o}getConsolidatedConfigurationModelForResource({resource:e},t){let n=this.getWorkspaceConsolidatedConfiguration();if(t&&e){const o=t.getFolder(e);o&&(n=this.getFolderConsolidatedConfiguration(o.uri)||n);const r=this._memoryConfigurationByResource.get(e);r&&(n=n.merge(r))}return n}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 n=this.getWorkspaceConsolidatedConfiguration(),o=this._folderConfigurations.get(e);o?(t=n.merge(o),this._foldersConsolidatedConfigurations.set(e,t)):t=n}return t}getFolderConfigurationModelForResource(e,t){if(t&&e){const n=t.getFolder(e);if(n)return this._folderConfigurations.get(n.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:n,overrides:o,keys:r}=this._folderConfigurations.get(t);return e.push([t,{contents:n,overrides:o,keys:r}]),e},[])}}static parse(e){const t=this.parseConfigurationModel(e.defaults),n=this.parseConfigurationModel(e.policy),o=this.parseConfigurationModel(e.application),r=this.parseConfigurationModel(e.user),s=this.parseConfigurationModel(e.workspace),a=e.folders.reduce((l,c)=>(l.set(Rt.revive(c[0]),this.parseConfigurationModel(c[1])),l),new _s);return new I5(t,n,o,r,new ps,s,a,new ps,new _s)}static parseConfigurationModel(e){return new ps(e.contents,e.keys,e.overrides)}}class Pct{constructor(e,t,n,o){this.change=e,this.previous=t,this.currentConfiguraiton=n,this.currentWorkspace=o,this._marker=` +`,this._markerCode1=this._marker.charCodeAt(0),this._markerCode2=".".charCodeAt(0),this.affectedKeys=new Set,this._previousConfiguration=void 0;for(const r of e.keys)this.affectedKeys.add(r);for(const[,r]of e.overrides)for(const s of r)this.affectedKeys.add(s);this._affectsConfigStr=this._marker;for(const r of this.affectedKeys)this._affectsConfigStr+=r+this._marker}get previousConfiguration(){return!this._previousConfiguration&&this.previous&&(this._previousConfiguration=I5.parse(this.previous.data)),this._previousConfiguration}affectsConfiguration(e,t){var n;const o=this._marker+e,r=this._affectsConfigStr.indexOf(o);if(r<0)return!1;const s=r+o.length;if(s>=this._affectsConfigStr.length)return!1;const a=this._affectsConfigStr.charCodeAt(s);if(a!==this._markerCode1&&a!==this._markerCode2)return!1;if(t){const l=this.previousConfiguration?this.previousConfiguration.getValue(e,t,(n=this.previous)===null||n===void 0?void 0:n.workspace):void 0,c=this.currentConfiguraiton.getValue(e,t,this.currentWorkspace);return!ql(l,c)}return!0}}const kP={kind:0},Oct={kind:1};function Fct(i,e,t){return{kind:2,commandId:i,commandArgs:e,isBubble:t}}class EE{constructor(e,t,n){var o;this._log=n,this._defaultKeybindings=e,this._defaultBoundCommands=new Map;for(const r of e){const s=r.command;s&&s.charAt(0)!=="-"&&this._defaultBoundCommands.set(s,!0)}this._map=new Map,this._lookupMap=new Map,this._keybindings=EE.handleRemovals([].concat(e).concat(t));for(let r=0,s=this._keybindings.length;r=0;o--){const r=n[o];if(r.command===t.command)continue;let s=!0;for(let a=1;a=0;o--){const r=n[o];if(t.contextMatchesRules(r.when))return r}return n[n.length-1]}resolve(e,t,n){const o=[...t,n];this._log(`| Resolving ${o}`);const r=this._map.get(o[0]);if(r===void 0)return this._log("\\ No keybinding entries."),kP;let s=null;if(o.length<2)s=r;else{s=[];for(let l=0,c=r.length;lu.chords.length)continue;let d=!0;for(let h=1;h=0;n--){const o=t[n];if(!!EE._contextMatchesRules(e,o.when))return o}return null}static _contextMatchesRules(e,t){return t?t.evaluate(e):!0}}function Qse(i){return i?`${i.serialize()}`:"no when condition"}function Jse(i){return i.extensionId?i.isBuiltinExtension?`built-in extension ${i.extensionId}`:`user extension ${i.extensionId}`:i.isDefault?"built-in":"user"}const Bct=/^(cursor|delete|undo|redo|tab|editor\.action\.clipboard)/;class Wct extends _e{get onDidUpdateKeybindings(){return this._onDidUpdateKeybindings?this._onDidUpdateKeybindings.event:st.None}get inChordMode(){return this._currentChords.length>0}constructor(e,t,n,o,r){super(),this._contextKeyService=e,this._commandService=t,this._telemetryService=n,this._notificationService=o,this._logService=r,this._onDidUpdateKeybindings=this._register(new le),this._currentChords=[],this._currentChordChecker=new $I,this._currentChordStatusMessage=null,this._ignoreSingleModifiers=$C.EMPTY,this._currentSingleModifier=null,this._currentSingleModifierClearTimeout=new zu,this._logging=!1}dispose(){super.dispose()}_log(e){this._logging&&this._logService.info(`[KeybindingService]: ${e}`)}getKeybindings(){return this._getResolver().getKeybindings()}lookupKeybinding(e,t){const n=this._getResolver().lookupPrimaryKeybinding(e,t||this._contextKeyService);if(!!n)return n.resolvedKeybinding}dispatchEvent(e,t){return this._dispatch(e,t)}softDispatch(e,t){this._log("/ Soft dispatching keyboard event");const n=this.resolveKeyboardEvent(e);if(n.hasMultipleChords())return console.warn("keyboard event should not be mapped to multiple chords"),kP;const[o]=n.getDispatchChords();if(o===null)return this._log("\\ Keyboard event cannot be dispatched"),kP;const r=this._contextKeyService.getContext(t),s=this._currentChords.map(({keypress:a})=>a);return this._getResolver().resolve(r,s,o)}_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 Bq("impossible");case 1:this._currentChordStatusMessage=this._notificationService.status(C("first.chord","({0}) was pressed. Waiting for second key of chord...",t));break;default:{const n=this._currentChords.map(({label:o})=>o).join(", ");this._currentChordStatusMessage=this._notificationService.status(C("next.chord","({0}) was pressed. Waiting for next key of chord...",n))}}this._scheduleLeaveChordMode(),hE.enabled&&hE.disable()}_leaveChordMode(){this._currentChordStatusMessage&&(this._currentChordStatusMessage.dispose(),this._currentChordStatusMessage=null),this._currentChordChecker.cancel(),this._currentChords=[],hE.enable()}_dispatch(e,t){return this._doDispatch(this.resolveKeyboardEvent(e),t,!1)}_singleModifierDispatch(e,t){const n=this.resolveKeyboardEvent(e),[o]=n.getSingleModifierDispatchChords();if(o)return this._ignoreSingleModifiers.has(o)?(this._log(`+ Ignoring single modifier ${o} due to it being pressed together with other keys.`),this._ignoreSingleModifiers=$C.EMPTY,this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1):(this._ignoreSingleModifiers=$C.EMPTY,this._currentSingleModifier===null?(this._log(`+ Storing single modifier for possible chord ${o}.`),this._currentSingleModifier=o,this._currentSingleModifierClearTimeout.cancelAndSet(()=>{this._log("+ Clearing single modifier due to 300ms elapsed."),this._currentSingleModifier=null},300),!1):o===this._currentSingleModifier?(this._log(`/ Dispatching single modifier chord ${o} ${o}`),this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,this._doDispatch(n,t,!0)):(this._log(`+ Clearing single modifier due to modifier mismatch: ${this._currentSingleModifier} ${o}`),this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1));const[r]=n.getChords();return this._ignoreSingleModifiers=new $C(r),this._currentSingleModifier!==null&&this._log("+ Clearing single modifier due to other key up."),this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1}_doDispatch(e,t,n=!1){var o;let r=!1;if(e.hasMultipleChords())return console.warn("Unexpected keyboard event mapped to multiple chords"),!1;let s=null,a=null;if(n){const[d]=e.getSingleModifierDispatchChords();s=d,a=d?[d]:[]}else[s]=e.getDispatchChords(),a=this._currentChords.map(({keypress:d})=>d);if(s===null)return this._log("\\ Keyboard event cannot be dispatched in keydown phase."),r;const l=this._contextKeyService.getContext(t),c=e.getLabel(),u=this._getResolver().resolve(l,a,s);switch(u.kind){case 0:{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(C("missing.chord","The key combination ({0}, {1}) is not a command.",d,c),{hideAfter:10*1e3}),this._leaveChordMode(),r=!0}return r}case 1:return this._logService.trace("KeybindingService#dispatch",c,"[ Several keybindings match - more chords needed ]"),r=!0,this._expectAnotherChord(s,c),this._log(this._currentChords.length===1?"+ Entering multi-chord mode...":"+ Continuing multi-chord mode..."),r;case 2:{if(this._logService.trace("KeybindingService#dispatch",c,`[ Will dispatch command ${u.commandId} ]`),u.commandId===null||u.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(C("missing.chord","The key combination ({0}, {1}) is not a command.",d,c),{hideAfter:10*1e3}),this._leaveChordMode(),r=!0}}else this.inChordMode&&this._leaveChordMode(),u.isBubble||(r=!0),this._log(`+ Invoking command ${u.commandId}.`),typeof u.commandArgs=="undefined"?this._commandService.executeCommand(u.commandId).then(void 0,d=>this._notificationService.warn(d)):this._commandService.executeCommand(u.commandId,u.commandArgs).then(void 0,d=>this._notificationService.warn(d)),Bct.test(u.commandId)||this._telemetryService.publicLog2("workbenchActionExecuted",{id:u.commandId,from:"keybinding",detail:(o=e.getUserSettingsLabel())!==null&&o!==void 0?o:void 0});return r}}}mightProducePrintableCharacter(e){return e.ctrlKey||e.metaKey?!1:e.keyCode>=31&&e.keyCode<=56||e.keyCode>=21&&e.keyCode<=30}}class $C{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}}}$C.EMPTY=new $C(null);class eae{constructor(e,t,n,o,r,s,a){this._resolvedKeybindingItemBrand=void 0,this.resolvedKeybinding=e,this.chords=e?zH(e.getDispatchChords()):[],e&&this.chords.length===0&&(this.chords=zH(e.getSingleModifierDispatchChords())),this.bubble=t?t.charCodeAt(0)===94:!1,this.command=this.bubble?t.substr(1):t,this.commandArgs=n,this.when=o,this.isDefault=r,this.extensionId=s,this.isBuiltinExtension=a}}function zH(i){const e=[];for(let t=0,n=i.length;tthis._getLabel(e))}getAriaLabel(){return Vct.toLabel(this._os,this._chords,e=>this._getAriaLabel(e))}getElectronAccelerator(){return this._chords.length>1||this._chords[0].isDuplicateModifierCase()?null:Hct.toLabel(this._os,this._chords,e=>this._getElectronAccelerator(e))}getUserSettingsLabel(){return $ct.toLabel(this._os,this._chords,e=>this._getUserSettingsLabel(e))}hasMultipleChords(){return this._chords.length>1}getChords(){return this._chords.map(e=>this._getChord(e))}_getChord(e){return new KZe(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 dk extends Uct{constructor(e,t){super(t,e)}_keyCodeToUILabel(e){if(this._os===2)switch(e){case 15:return"\u2190";case 16:return"\u2191";case 17:return"\u2192";case 18:return"\u2193"}return Sg.toString(e)}_getLabel(e){return e.isDuplicateModifierCase()?"":this._keyCodeToUILabel(e.keyCode)}_getAriaLabel(e){return e.isDuplicateModifierCase()?"":Sg.toString(e.keyCode)}_getElectronAccelerator(e){return Sg.toElectronAccelerator(e.keyCode)}_getUserSettingsLabel(e){if(e.isDuplicateModifierCase())return"";const t=Sg.toUserSettingsUS(e.keyCode);return t&&t.toLowerCase()}_getChordDispatch(e){return dk.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+=Sg.toString(e.keyCode),t}_getSingleModifierChordDispatch(e){return e.keyCode===5&&!e.shiftKey&&!e.altKey&&!e.metaKey?"ctrl":e.keyCode===4&&!e.ctrlKey&&!e.altKey&&!e.metaKey?"shift":e.keyCode===6&&!e.ctrlKey&&!e.shiftKey&&!e.metaKey?"alt":e.keyCode===57&&!e.ctrlKey&&!e.shiftKey&&!e.altKey?"meta":null}static _scanCodeToKeyCode(e){const t=Uq[e];if(t!==-1)return t;switch(e){case 10:return 31;case 11:return 32;case 12:return 33;case 13:return 34;case 14:return 35;case 15:return 36;case 16:return 37;case 17:return 38;case 18:return 39;case 19:return 40;case 20:return 41;case 21:return 42;case 22:return 43;case 23:return 44;case 24:return 45;case 25:return 46;case 26:return 47;case 27:return 48;case 28:return 49;case 29:return 50;case 30:return 51;case 31:return 52;case 32:return 53;case 33:return 54;case 34:return 55;case 35:return 56;case 36:return 22;case 37:return 23;case 38:return 24;case 39:return 25;case 40:return 26;case 41:return 27;case 42:return 28;case 43:return 29;case 44:return 30;case 45:return 21;case 51:return 88;case 52:return 86;case 53:return 92;case 54:return 94;case 55:return 93;case 56:return 0;case 57:return 85;case 58:return 95;case 59:return 91;case 60:return 87;case 61:return 89;case 62:return 90;case 106:return 97}return 0}static _toKeyCodeChord(e){if(!e)return null;if(e instanceof lp)return e;const t=this._scanCodeToKeyCode(e.scanCode);return t===0?null:new lp(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,t)}static resolveKeybinding(e,t){const n=zH(e.chords.map(o=>this._toKeyCodeChord(o)));return n.length>0?[new dk(n,t)]:[]}}const Tw=yn("labelService"),S1e=yn("progressService");Object.freeze({total(){},worked(){},done(){}});class Gg{constructor(e,t){this.callback=e,this.report=t!=null&&t.async?this._reportAsync.bind(this):this._reportSync.bind(this)}_reportSync(e){this._value=e,this.callback(this._value)}_reportAsync(e){Promise.resolve(this._lastTask).finally(()=>{this._value=e;const t=this.callback(this._value);this._lastTask=Promise.resolve(t).finally(()=>this._lastTask=void 0)})}}Gg.None=Object.freeze({report(){}});const Jv=yn("editorProgressService");class jct{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 n=this._value.charCodeAt(t);if(!(n===47||this._splitOnBackslash&&n===92))break}return this.next()}hasNext(){return this._to!1,t=()=>!1){return new Ry(new Gct(e,t))}static forStrings(){return new Ry(new jct)}static forConfigKeys(){return new Ry(new Kct)}constructor(e){this._iter=e}clear(){this._root=void 0}set(e,t){const n=this._iter.reset(e);let o;this._root||(this._root=new R2,this._root.segment=n.value());const r=[];for(o=this._root;;){const a=n.cmp(o.segment);if(a>0)o.left||(o.left=new R2,o.left.segment=n.value()),r.push([-1,o]),o=o.left;else if(a<0)o.right||(o.right=new R2,o.right.segment=n.value()),r.push([1,o]),o=o.right;else if(n.hasNext())n.next(),o.mid||(o.mid=new R2,o.mid.segment=n.value()),r.push([0,o]),o=o.mid;else break}const s=o.value;o.value=t,o.key=e;for(let a=r.length-1;a>=0;a--){const l=r[a][1];l.updateHeight();const c=l.balanceFactor();if(c<-1||c>1){const u=r[a][0],d=r[a+1][0];if(u===1&&d===1)r[a][1]=l.rotateLeft();else if(u===-1&&d===-1)r[a][1]=l.rotateRight();else if(u===1&&d===-1)l.right=r[a+1][1]=r[a+1][1].rotateRight(),r[a][1]=l.rotateLeft();else if(u===-1&&d===1)l.left=r[a+1][1]=r[a+1][1].rotateLeft(),r[a][1]=l.rotateRight();else throw new Error;if(a>0)switch(r[a-1][0]){case-1:r[a-1][1].left=r[a][1];break;case 1:r[a-1][1].right=r[a][1];break;case 0:r[a-1][1].mid=r[a][1];break}else this._root=r[0][1]}}return s}get(e){var t;return(t=this._getNode(e))===null||t===void 0?void 0:t.value}_getNode(e){const t=this._iter.reset(e);let n=this._root;for(;n;){const o=t.cmp(n.segment);if(o>0)n=n.left;else if(o<0)n=n.right;else if(t.hasNext())t.next(),n=n.mid;else break}return n}has(e){const t=this._getNode(e);return!((t==null?void 0:t.value)===void 0&&(t==null?void 0:t.mid)===void 0)}delete(e){return this._delete(e,!1)}deleteSuperstr(e){return this._delete(e,!0)}_delete(e,t){var n;const o=this._iter.reset(e),r=[];let s=this._root;for(;s;){const a=o.cmp(s.segment);if(a>0)r.push([-1,s]),s=s.left;else if(a<0)r.push([1,s]),s=s.right;else if(o.hasNext())o.next(),r.push([0,s]),s=s.mid;else break}if(!!s){if(t?(s.left=void 0,s.mid=void 0,s.right=void 0,s.height=1):(s.key=void 0,s.value=void 0),!s.mid&&!s.value)if(s.left&&s.right){const a=this._min(s.right);if(a.key){const{key:l,value:c,segment:u}=a;this._delete(a.key,!1),s.key=l,s.value=c,s.segment=u}}else{const a=(n=s.left)!==null&&n!==void 0?n:s.right;if(r.length>0){const[l,c]=r[r.length-1];switch(l){case-1:c.left=a;break;case 0:c.mid=a;break;case 1:c.right=a;break}}else this._root=a}for(let a=r.length-1;a>=0;a--){const l=r[a][1];l.updateHeight();const c=l.balanceFactor();if(c>1?(l.right.balanceFactor()>=0||(l.right=l.right.rotateRight()),r[a][1]=l.rotateLeft()):c<-1&&(l.left.balanceFactor()<=0||(l.left=l.left.rotateLeft()),r[a][1]=l.rotateRight()),a>0)switch(r[a-1][0]){case-1:r[a-1][1].left=r[a][1];break;case 1:r[a-1][1].right=r[a][1];break;case 0:r[a-1][1].mid=r[a][1];break}else this._root=r[0][1]}}}_min(e){for(;e.left;)e=e.left;return e}findSubstr(e){const t=this._iter.reset(e);let n=this._root,o;for(;n;){const r=t.cmp(n.segment);if(r>0)n=n.left;else if(r<0)n=n.right;else if(t.hasNext())t.next(),o=n.value||o,n=n.mid;else break}return n&&n.value||o}findSuperstr(e){return this._findSuperstrOrElement(e,!1)}_findSuperstrOrElement(e,t){const n=this._iter.reset(e);let o=this._root;for(;o;){const r=n.cmp(o.segment);if(r>0)o=o.left;else if(r<0)o=o.right;else if(n.hasNext())n.next(),o=o.mid;else return o.mid?this._entries(o.mid):t?o.value:void 0}}forEach(e){for(const[t,n]of this)e(n,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))}}const ib=yn("contextService");function UH(i){const e=i;return typeof(e==null?void 0:e.id)=="string"&&Rt.isUri(e.uri)}function Xct(i){const e=i;return typeof(e==null?void 0:e.id)=="string"&&!UH(i)&&!Jct(i)}const Yct={id:"ext-dev"},Zct={id:"empty-window"};function Qct(i,e){if(typeof i=="string"||typeof i=="undefined")return typeof i=="string"?{id:Km(i)}:e?Yct:Zct;const t=i;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 Jct(i){const e=i;return typeof(e==null?void 0:e.id)=="string"&&Rt.isUri(e.configPath)}class eut{constructor(e,t){this.raw=t,this.uri=e.uri,this.index=e.index,this.name=e.name}toJSON(){return{uri:this.uri,name:this.name,index:this.index}}}const jH="code-workspace";C("codeWorkspace","Code Workspace");const x1e="4064f6ec-cb38-4ad0-af64-ee6467e63c82";function tut(i){return i.id===x1e}var KH;(function(i){i.inspectTokensAction=C("inspectTokens","Developer: Inspect Tokens")})(KH||(KH={}));var IP;(function(i){i.gotoLineActionLabel=C("gotoLineActionLabel","Go to Line/Column...")})(IP||(IP={}));var qH;(function(i){i.helpQuickAccessActionLabel=C("helpQuickAccess","Show all Quick Access Providers")})(qH||(qH={}));var TP;(function(i){i.quickCommandActionLabel=C("quickCommandActionLabel","Command Palette"),i.quickCommandHelp=C("quickCommandActionHelp","Show And Run Commands")})(TP||(TP={}));var hk;(function(i){i.quickOutlineActionLabel=C("quickOutlineActionLabel","Go to Symbol..."),i.quickOutlineByCategoryActionLabel=C("quickOutlineByCategoryActionLabel","Go to Symbol by Category...")})(hk||(hk={}));var NP;(function(i){i.editorViewAccessibleLabel=C("editorViewAccessibleLabel","Editor content"),i.accessibilityHelpMessage=C("accessibilityHelpMessage","Press Alt+F1 for Accessibility Options.")})(NP||(NP={}));var GH;(function(i){i.toggleHighContrast=C("toggleHighContrast","Toggle High Contrast Theme")})(GH||(GH={}));var XH;(function(i){i.bulkEditServiceSummary=C("bulkEditServiceSummary","Made {0} edits in {1} files")})(XH||(XH={}));const L1e=yn("workspaceTrustManagementService"),_p=yn("contextViewService"),Ku=yn("contextMenuService");var fs;(function(i){function e(r,s){if(r.start>=s.end||s.start>=r.end)return{start:0,end:0};const a=Math.max(r.start,s.start),l=Math.min(r.end,s.end);return l-a<=0?{start:0,end:0}:{start:a,end:l}}i.intersect=e;function t(r){return r.end-r.start<=0}i.isEmpty=t;function n(r,s){return!t(e(r,s))}i.intersects=n;function o(r,s){const a=[],l={start:r.start,end:Math.min(s.start,r.end)},c={start:Math.max(s.end,r.start),end:r.end};return t(l)||a.push(l),t(c)||a.push(c),a}i.relativeComplement=o})(fs||(fs={}));function nut(i){const e=i;return!!e&&typeof e.x=="number"&&typeof e.y=="number"}var Dm;(function(i){i[i.AVOID=0]="AVOID",i[i.ALIGN=1]="ALIGN"})(Dm||(Dm={}));function zC(i,e,t){const n=t.mode===Dm.ALIGN?t.offset:t.offset+t.size,o=t.mode===Dm.ALIGN?t.offset+t.size:t.offset;return t.position===0?e<=i-n?n:e<=o?o-e:Math.max(i-e,0):e<=o?o-e:e<=i-n?n:0}class Nw extends _e{constructor(e,t){super(),this.container=null,this.delegate=null,this.toDisposeOnClean=_e.None,this.toDisposeOnSetContainer=_e.None,this.shadowRoot=null,this.shadowRootHostElement=null,this.view=He(".context-view"),this.useFixedPosition=!1,this.useShadowDOM=!1,Js(this.view),this.setContainer(e,t),this._register(zt(()=>this.setContainer(null,1)))}setContainer(e,t){var n;if(this.container&&(this.toDisposeOnSetContainer.dispose(),this.shadowRoot?(this.shadowRoot.removeChild(this.view),this.shadowRoot=null,(n=this.shadowRootHostElement)===null||n===void 0||n.remove(),this.shadowRootHostElement=null):this.container.removeChild(this.view),this.container=null),e){if(this.container=e,this.useFixedPosition=t!==1,this.useShadowDOM=t===3,this.useShadowDOM){this.shadowRootHostElement=He(".shadow-root-host"),this.container.appendChild(this.shadowRootHostElement),this.shadowRoot=this.shadowRootHostElement.attachShadow({mode:"open"});const r=document.createElement("style");r.textContent=iut,this.shadowRoot.appendChild(r),this.shadowRoot.appendChild(this.view),this.shadowRoot.appendChild(He("slot"))}else this.container.appendChild(this.view);const o=new Be;Nw.BUBBLE_UP_EVENTS.forEach(r=>{o.add(No(this.container,r,s=>{this.onDOMEvent(s,!1)}))}),Nw.BUBBLE_DOWN_EVENTS.forEach(r=>{o.add(No(this.container,r,s=>{this.onDOMEvent(s,!0)},!0))}),this.toDisposeOnSetContainer=o}}show(e){var t,n;this.isVisible()&&this.hide(),Ur(this.view),this.view.className="context-view",this.view.style.top="0px",this.view.style.left="0px",this.view.style.zIndex="2575",this.view.style.position=this.useFixedPosition?"fixed":"absolute",nl(this.view),this.toDisposeOnClean=e.render(this.view)||_e.None,this.delegate=e,this.doLayout(),(n=(t=this.delegate).focus)===null||n===void 0||n.call(t)}getViewElement(){return this.view}layout(){if(!!this.isVisible()){if(this.delegate.canRelayout===!1&&!(Kd&&iG.pointerEvents)){this.hide();return}this.delegate.layout&&this.delegate.layout(),this.doLayout()}}doLayout(){if(!this.isVisible())return;const e=this.delegate.getAnchor();let t;if(rG(e)){const d=Yo(e),h=BQe(e);t={top:d.top*h,left:d.left*h,width:d.width*h,height:d.height*h}}else nut(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 n=Ea(this.view),o=u0(this.view),r=this.delegate.anchorPosition||0,s=this.delegate.anchorAlignment||0,a=this.delegate.anchorAxisAlignment||0;let l,c;if(a===0){const d={offset:t.top-window.pageYOffset,size:t.height,position:r===0?0:1},h={offset:t.left,size:t.width,position:s===0?0:1,mode:Dm.ALIGN};l=zC(window.innerHeight,o,d)+window.pageYOffset,fs.intersects({start:l,end:l+o},{start:d.offset,end:d.offset+d.size})&&(h.mode=Dm.AVOID),c=zC(window.innerWidth,n,h)}else{const d={offset:t.left,size:t.width,position:s===0?0:1},h={offset:t.top,size:t.height,position:r===0?0:1,mode:Dm.ALIGN};c=zC(window.innerWidth,n,d),fs.intersects({start:c,end:c+n},{start:d.offset,end:d.offset+d.size})&&(h.mode=Dm.AVOID),l=zC(window.innerHeight,o,h)+window.pageYOffset}this.view.classList.remove("top","bottom","left","right"),this.view.classList.add(r===0?"bottom":"top"),this.view.classList.add(s===0?"left":"right"),this.view.classList.toggle("fixed",this.useFixedPosition);const u=Yo(this.container);this.view.style.top=`${l-(this.useFixedPosition?Yo(this.view).top:u.top)}px`,this.view.style.left=`${c-(this.useFixedPosition?Yo(this.view).left:u.left)}px`,this.view.style.width="initial"}hide(e){const t=this.delegate;this.delegate=null,t!=null&&t.onHide&&t.onHide(e),this.toDisposeOnClean.dispose(),Js(this.view)}isVisible(){return!!this.delegate}onDOMEvent(e,t){this.delegate&&(this.delegate.onDOMEvent?this.delegate.onDOMEvent(e,document.activeElement):t&&!rs(e.target,this.container)&&this.hide())}dispose(){this.hide(),super.dispose()}}Nw.BUBBLE_UP_EVENTS=["click","keydown","focus","blur"];Nw.BUBBLE_DOWN_EVENTS=["click"];const iut=` :host { all: initial; /* 1st rule so subsequent properties are reset. */ } @@ -510,46 +511,46 @@ Received: '{1}'.`,e,Nh.getLexeme(t)),r=t.offset,s=Nh.getLexeme(t);return this._p :host-context(.linux:lang(zh-Hant)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans TC", "Source Han Sans TW", "Source Han Sans", sans-serif; } :host-context(.linux:lang(ja)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans J", "Source Han Sans JP", "Source Han Sans", sans-serif; } :host-context(.linux:lang(ko)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans K", "Source Han Sans JR", "Source Han Sans", "UnDotum", "FBaekmuk Gulim", sans-serif; } -`;var Qct=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Jct=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let KH=class extends _e{constructor(e){super(),this.layoutService=e,this.currentViewDisposable=_e.None,this.container=e.hasContainer?e.container:null,this.contextView=this._register(new Ty(this.container,1)),this.layout(),this._register(e.onDidLayout(()=>this.layout()))}setContainer(e,t){this.contextView.setContainer(e,t||1)}showContextView(e,t,n){t?(t!==this.container||this.shadowRoot!==n)&&(this.container=t,this.setContainer(t,n?3:2)):this.layoutService.hasContainer&&this.container!==this.layoutService.container&&(this.container=this.layoutService.container,this.setContainer(this.container,1)),this.shadowRoot=n,this.contextView.show(e);const o=zt(()=>{this.currentViewDisposable===o&&this.hideContextView()});return this.currentViewDisposable=o,o}getContextViewElement(){return this.contextView.getViewElement()}layout(){this.contextView.layout()}hideContextView(e){this.contextView.hide(e)}};KH=Qct([Jct(0,yS)],KH);let Ny=[],JG=[],_1e=[];function T2(i,e=!1){eut(i,!1,e)}function eut(i,e,t){const n=tut(i,e);Ny.push(n),n.userConfigured?_1e.push(n):JG.push(n),t&&!n.userConfigured&&Ny.forEach(o=>{o.mime===n.mime||o.userConfigured||(n.extension&&o.extension===n.extension&&console.warn(`Overwriting extension <<${n.extension}>> to now point to mime <<${n.mime}>>`),n.filename&&o.filename===n.filename&&console.warn(`Overwriting filename <<${n.filename}>> to now point to mime <<${n.mime}>>`),n.filepattern&&o.filepattern===n.filepattern&&console.warn(`Overwriting filepattern <<${n.filepattern}>> to now point to mime <<${n.mime}>>`),n.firstline&&o.firstline===n.firstline&&console.warn(`Overwriting firstline <<${n.firstline}>> to now point to mime <<${n.mime}>>`))})}function tut(i,e){return{id:i.id,mime:i.mime,filename:i.filename,extension:i.extension,filepattern:i.filepattern,firstline:i.firstline,userConfigured:e,filenameLowercase:i.filename?i.filename.toLowerCase():void 0,extensionLowercase:i.extension?i.extension.toLowerCase():void 0,filepatternLowercase:i.filepattern?u1e(i.filepattern.toLowerCase()):void 0,filepatternOnPath:i.filepattern?i.filepattern.indexOf(Go.sep)>=0:!1}}function nut(){Ny=Ny.filter(i=>i.userConfigured),JG=[]}function iut(i,e){return out(i,e).map(t=>t.id)}function out(i,e){let t;if(i)switch(i.scheme){case hn.file:t=i.fsPath;break;case hn.data:{t=kv.parseMetaData(i).get(kv.META_DATA_LABEL);break}case hn.vscodeNotebookCell:t=void 0;break;default:t=i.path}if(!t)return[{id:"unknown",mime:xo.unknown}];t=t.toLowerCase();const n=jm(t),o=qse(t,n,_1e);if(o)return[o,{id:ql,mime:xo.text}];const r=qse(t,n,JG);if(r)return[r,{id:ql,mime:xo.text}];if(e){const s=rut(e);if(s)return[s,{id:ql,mime:xo.text}]}return[{id:"unknown",mime:xo.unknown}]}function qse(i,e,t){var n;let o,r,s;for(let a=t.length-1;a>=0;a--){const l=t[a];if(e===l.filenameLowercase){o=l;break}if(l.filepattern&&(!r||l.filepattern.length>r.filepattern.length)){const c=l.filepatternOnPath?i:e;!((n=l.filepatternLowercase)===null||n===void 0)&&n.call(l,c)&&(r=l)}l.extension&&(!s||l.extension.length>s.extension.length)&&e.endsWith(l.extensionLowercase)&&(s=l)}if(o)return o;if(r)return r;if(s)return s}function rut(i){if(jq(i)&&(i=i.substr(1)),i.length>0)for(let e=Ny.length-1;e>=0;e--){const t=Ny[e];if(!t.firstline)continue;const n=i.match(t.firstline);if(n&&n.length>0)return t}}const N2=Object.prototype.hasOwnProperty,Gse="vs.editor.nullLanguage";class sut{constructor(){this._languageIdToLanguage=[],this._languageToLanguageId=new Map,this._register(Gse,0),this._register(ql,1),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)||0}decodeLanguageId(e){return this._languageIdToLanguage[e]||Gse}}class fk extends _e{constructor(e=!0,t=!1){super(),this._onDidChange=this._register(new le),this.onDidChange=this._onDidChange.event,fk.instanceCount++,this._warnOnOverwrite=t,this.languageIdCodec=new sut,this._dynamicLanguages=[],this._languages={},this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},e&&(this._initializeFromRegistry(),this._register(vy.onDidChangeLanguages(n=>{this._initializeFromRegistry()})))}dispose(){fk.instanceCount--,super.dispose()}_initializeFromRegistry(){this._languages={},this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},nut();const e=[].concat(vy.getLanguages()).concat(this._dynamicLanguages);this._registerLanguages(e)}_registerLanguages(e){for(const t of e)this._registerLanguage(t);this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},Object.keys(this._languages).forEach(t=>{const n=this._languages[t];n.name&&(this._nameMap[n.name]=n.identifier),n.aliases.forEach(o=>{this._lowercaseNameMap[o.toLowerCase()]=n.identifier}),n.mimetypes.forEach(o=>{this._mimeTypesMap[o]=n.identifier})}),no.as(ah.Configuration).registerOverrideIdentifiers(this.getRegisteredLanguageIds()),this._onDidChange.fire()}_registerLanguage(e){const t=e.id;let n;N2.call(this._languages,t)?n=this._languages[t]:(this.languageIdCodec.register(t),n={identifier:t,name:null,mimetypes:[],aliases:[],extensions:[],filenames:[],configurationFiles:[],icons:[]},this._languages[t]=n),this._mergeLanguage(n,e)}_mergeLanguage(e,t){const n=t.id;let o=null;if(Array.isArray(t.mimetypes)&&t.mimetypes.length>0&&(e.mimetypes.push(...t.mimetypes),o=t.mimetypes[0]),o||(o=`text/x-${n}`,e.mimetypes.push(o)),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)T2({id:n,mime:o,extension:a},this._warnOnOverwrite)}if(Array.isArray(t.filenames))for(const a of t.filenames)T2({id:n,mime:o,filename:a},this._warnOnOverwrite),e.filenames.push(a);if(Array.isArray(t.filenamePatterns))for(const a of t.filenamePatterns)T2({id:n,mime:o,filepattern:a},this._warnOnOverwrite);if(typeof t.firstLine=="string"&&t.firstLine.length>0){let a=t.firstLine;a.charAt(0)!=="^"&&(a="^"+a);try{const l=new RegExp(a);sZe(l)||T2({id:n,mime:o,firstline:l},this._warnOnOverwrite)}catch(l){console.warn(`[${t.id}]: Invalid regular expression \`${a}\`: `,l)}}e.aliases.push(n);let r=null;if(typeof t.aliases!="undefined"&&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 s=r!==null&&r.length>0;if(!(s&&r[0]===null)){const a=(s?r[0]:null)||n;(s||!e.name)&&(e.name=a)}t.configuration&&e.configurationFiles.push(t.configuration),t.icon&&e.icons.push(t.icon)}isRegisteredLanguageId(e){return e?N2.call(this._languages,e):!1}getRegisteredLanguageIds(){return Object.keys(this._languages)}getLanguageIdByLanguageName(e){const t=e.toLowerCase();return N2.call(this._lowercaseNameMap,t)?this._lowercaseNameMap[t]:null}getLanguageIdByMimeType(e){return e&&N2.call(this._mimeTypesMap,e)?this._mimeTypesMap[e]:null}guessLanguageIdByFilepathOrFirstLine(e,t){return!e&&!t?[]:iut(e,t)}}fk.instanceCount=0;class gk extends _e{constructor(e=!1){super(),this._onDidRequestBasicLanguageFeatures=this._register(new le),this.onDidRequestBasicLanguageFeatures=this._onDidRequestBasicLanguageFeatures.event,this._onDidRequestRichLanguageFeatures=this._register(new le),this.onDidRequestRichLanguageFeatures=this._onDidRequestRichLanguageFeatures.event,this._onDidChange=this._register(new le({leakWarningThreshold:200})),this.onDidChange=this._onDidChange.event,this._requestedBasicLanguages=new Set,this._requestedRichLanguages=new Set,gk.instanceCount++,this._registry=this._register(new fk(!0,e)),this.languageIdCodec=this._registry.languageIdCodec,this._register(this._registry.onDidChange(()=>this._onDidChange.fire()))}dispose(){gk.instanceCount--,super.dispose()}isRegisteredLanguageId(e){return this._registry.isRegisteredLanguageId(e)}getLanguageIdByLanguageName(e){return this._registry.getLanguageIdByLanguageName(e)}getLanguageIdByMimeType(e){return this._registry.getLanguageIdByMimeType(e)}guessLanguageIdByFilepathOrFirstLine(e,t){const n=this._registry.guessLanguageIdByFilepathOrFirstLine(e,t);return e_e(n,null)}createById(e){return new Xse(this.onDidChange,()=>this._createAndGetLanguageIdentifier(e))}createByFilepathOrFirstLine(e,t){return new Xse(this.onDidChange,()=>{const n=this.guessLanguageIdByFilepathOrFirstLine(e,t);return this._createAndGetLanguageIdentifier(n)})}_createAndGetLanguageIdentifier(e){return(!e||!this.isRegisteredLanguageId(e))&&(e=ql),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),oo.getOrCreate(e),this._onDidRequestRichLanguageFeatures.fire(e))}}gk.instanceCount=0;class Xse{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 le({onDidRemoveLastListener:()=>{this._dispose()}})),this._emitter.event}_evaluate(){var e;const t=this._selector();t!==this.languageId&&(this.languageId=t,(e=this._emitter)===null||e===void 0||e.fire(this.languageId))}}const pk={RESOURCES:"ResourceURLs",DOWNLOAD_URL:"DownloadURL",FILES:"Files",TEXT:xo.text,INTERNAL_URI_LIST:"application/vnd.code.uri-list"};function eX(...i){return function(e,t){for(let n=0,o=i.length;n0?[{start:0,end:e.length}]:[]:null}function C1e(i,e){const t=e.toLowerCase().indexOf(i.toLowerCase());return t===-1?null:[{start:t,end:t+i.length}]}function w1e(i,e){return qH(i.toLowerCase(),e.toLowerCase(),0,0)}function qH(i,e,t,n){if(t===i.length)return[];if(n===e.length)return null;if(i[t]===e[n]){let o=null;return(o=qH(i,e,t+1,n+1))?iX({start:n,end:n+1},o):null}return qH(i,e,t,n+1)}function tX(i){return 97<=i&&i<=122}function T5(i){return 65<=i&&i<=90}function nX(i){return 48<=i&&i<=57}function y1e(i){return i===32||i===9||i===10||i===13}const S1e=new Set;"()[]{}<>`'\"-/;:,.?!".split("").forEach(i=>S1e.add(i.charCodeAt(0)));function IP(i){return y1e(i)||S1e.has(i)}function aut(i,e){return i===e||IP(i)&&IP(e)}function x1e(i){return tX(i)||T5(i)||nX(i)}function iX(i,e){return e.length===0?e=[i]:i.end===e[0].start?e[0].start=i.start:e.unshift(i),e}function L1e(i,e){for(let t=e;t0&&!x1e(i.charCodeAt(t-1)))return t}return i.length}function GH(i,e,t,n){if(t===i.length)return[];if(n===e.length)return null;if(i[t]!==e[n].toLowerCase())return null;{let o=null,r=n+1;for(o=GH(i,e,t+1,n+1);!o&&(r=L1e(e,r)).6}function uut(i){const{upperPercent:e,lowerPercent:t,alphaPercent:n,numericPercent:o}=i;return t>.2&&e<.8&&n>.6&&o<.2}function dut(i){let e=0,t=0,n=0,o=0;for(let r=0;r60)return null;const t=lut(e);if(!uut(t)){if(!cut(t))return null;e=e.toLowerCase()}let n=null,o=0;for(i=i.toLowerCase();o0&&IP(i.charCodeAt(t-1)))return t;return i.length}const fut=eX(mk,E1e,C1e),gut=eX(mk,E1e,w1e),Yse=new Yv(1e4);function Zse(i,e,t=!1){if(typeof i!="string"||typeof e!="string")return null;let n=Yse.get(i);n||(n=new RegExp(oZe(i),"i"),Yse.set(i,n));const o=n.exec(e);return o?[{start:o.index,end:o.index+o[0].length}]:t?gut(i,e):fut(i,e)}function put(i,e){const t=ib(i,i.toLowerCase(),0,e,e.toLowerCase(),0,{firstMatchCanBeWeak:!0,boostFullMatch:!0});return t?tT(t):null}function mut(i,e,t,n,o,r){const s=Math.min(13,i.length);for(;t1;n--){const o=i[n]+t,r=e[e.length-1];r&&r.end===o?r.end=o+1:e.push({start:o,end:o+1})}return e}const Dm=128;function oX(){const i=[],e=[];for(let t=0;t<=Dm;t++)e[t]=0;for(let t=0;t<=Dm;t++)i.push(e.slice(0));return i}function k1e(i){const e=[];for(let t=0;t<=i;t++)e[t]=0;return e}const I1e=k1e(2*Dm),YH=k1e(2*Dm),Qf=oX(),v_=oX(),R2=oX();function M2(i,e){if(e<0||e>=i.length)return!1;const t=i.codePointAt(e);switch(t){case 95:case 45:case 46:case 32:case 47:case 92:case 39:case 34:case 58:case 36:case 60:case 62:case 40:case 41:case 91:case 93:case 123:case 125:return!0;case void 0:return!1;default:return!!Uq(t)}}function Qse(i,e){if(e<0||e>=i.length)return!1;switch(i.charCodeAt(e)){case 32:case 9:return!0;default:return!1}}function fM(i,e,t){return e[i]!==t[i]}function vut(i,e,t,n,o,r,s=!1){for(;eDm?Dm:i.length,l=n.length>Dm?Dm:n.length;if(t>=a||r>=l||a-t>l-r||!vut(e,t,a,o,r,l,!0))return;_ut(a,l,t,r,e,o);let c=1,u=1,d=t,h=r;const f=[!1];for(c=1,d=t;d_,k=I?v_[c][u-1]+(Qf[c][u-1]>0?-5:0):0,R=h>_+1&&Qf[c][u-1]>0,A=R?v_[c][u-2]+(Qf[c][u-2]>0?-5:0):0;if(R&&(!I||A>=k)&&(!D||A>=E))v_[c][u]=A,R2[c][u]=3,Qf[c][u]=0;else if(I&&(!D||k>=E))v_[c][u]=k,R2[c][u]=2,Qf[c][u]=0;else if(D)v_[c][u]=E,R2[c][u]=1,Qf[c][u]=Qf[c-1][u-1]+1;else throw new Error("not possible")}}if(!f[0]&&!s.firstMatchCanBeWeak)return;c--,u--;const g=[v_[c][u],r];let p=0,v=0;for(;c>=1;){let _=u;do{const w=R2[c][_];if(w===3)_=_-2;else if(w===2)_=_-1;else break}while(_>=1);p>1&&e[t+c-1]===o[r+u-1]&&!fM(_+r-1,n,o)&&p+1>Qf[c][_]&&(_=u),_===u?p++:p=1,v||(v=_),c--,u=_-1,g.push(u)}l===a&&s.boostFullMatch&&(g[0]+=2);const m=v-a;return g[0]-=m,g}function _ut(i,e,t,n,o,r){let s=i-1,a=e-1;for(;s>=t&&a>=n;)o[s]===r[a]&&(YH[s]=a,s--),a--}function but(i,e,t,n,o,r,s,a,l,c,u){if(e[t]!==r[s])return Number.MIN_SAFE_INTEGER;let d=1,h=!1;return s===t-n?d=i[t]===o[s]?7:5:fM(s,o,r)&&(s===0||!fM(s-1,o,r))?(d=i[t]===o[s]?7:5,h=!0):M2(r,s)&&(s===0||!M2(r,s-1))?d=5:(M2(r,s-1)||Qse(r,s-1))&&(d=5,h=!0),d>1&&t===n&&(u[0]=!0),h||(h=fM(s,o,r)||M2(r,s-1)||Qse(r,s-1)),t===n?s>l&&(d-=h?3:5):c?d+=h?2:0:d+=h?0:1,s+1===a&&(d-=h?3:5),d}function Cut(i,e,t,n,o,r,s){return wut(i,e,t,n,o,r,!0,s)}function wut(i,e,t,n,o,r,s,a){let l=ib(i,e,t,n,o,r,a);if(l&&!s)return l;if(i.length>=3){const c=Math.min(7,i.length-1);for(let u=t+1;ul[0])&&(l=h))}}}return l}function yut(i,e){if(e+1>=i.length)return;const t=i[e],n=i[e+1];if(t!==n)return i.slice(0,e)+n+t+i.slice(e+2)}const Sut="$(",rX=new RegExp(`\\$\\(${Mt.iconNameExpression}(?:${Mt.iconModifierExpression})?\\)`,"g"),xut=new RegExp(`(\\\\)?${rX.source}`,"g");function Lut(i){return i.replace(xut,(e,t)=>t?e:`\\${e}`)}const Eut=new RegExp(`\\\\${rX.source}`,"g");function Dut(i){return i.replace(Eut,e=>`\\${e}`)}const kut=new RegExp(`(\\s)?(\\\\)?${rX.source}(\\s)?`,"g");function sX(i){return i.indexOf(Sut)===-1?i:i.replace(kut,(e,t,n,o)=>n?e:t||o||"")}function Iut(i){return i?i.replace(/\$\((.*?)\)/g,(e,t)=>` ${t} `).trim():""}const T9=new RegExp(`\\$\\(${Mt.iconNameCharacter}+\\)`,"g");function IL(i){T9.lastIndex=0;let e="";const t=[];let n=0;for(;;){const o=T9.lastIndex,r=T9.exec(i),s=i.substring(o,r==null?void 0:r.index);if(s.length>0){e+=s;for(let a=0;a" ".repeat(o.length)).replace(/\>/gm,"\\>").replace(/\n/g,t===1?`\\ +`;var out=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},rut=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let YH=class extends _e{constructor(e){super(),this.layoutService=e,this.currentViewDisposable=_e.None,this.container=e.hasContainer?e.container:null,this.contextView=this._register(new Nw(this.container,1)),this.layout(),this._register(e.onDidLayout(()=>this.layout()))}setContainer(e,t){this.contextView.setContainer(e,t||1)}showContextView(e,t,n){t?(t!==this.container||this.shadowRoot!==n)&&(this.container=t,this.setContainer(t,n?3:2)):this.layoutService.hasContainer&&this.container!==this.layoutService.container&&(this.container=this.layoutService.container,this.setContainer(this.container,1)),this.shadowRoot=n,this.contextView.show(e);const o=zt(()=>{this.currentViewDisposable===o&&this.hideContextView()});return this.currentViewDisposable=o,o}getContextViewElement(){return this.contextView.getViewElement()}layout(){this.contextView.layout()}hideContextView(e){this.contextView.hide(e)}};YH=out([rut(0,SS)],YH);let Rw=[],sX=[],E1e=[];function M2(i,e=!1){sut(i,!1,e)}function sut(i,e,t){const n=aut(i,e);Rw.push(n),n.userConfigured?E1e.push(n):sX.push(n),t&&!n.userConfigured&&Rw.forEach(o=>{o.mime===n.mime||o.userConfigured||(n.extension&&o.extension===n.extension&&console.warn(`Overwriting extension <<${n.extension}>> to now point to mime <<${n.mime}>>`),n.filename&&o.filename===n.filename&&console.warn(`Overwriting filename <<${n.filename}>> to now point to mime <<${n.mime}>>`),n.filepattern&&o.filepattern===n.filepattern&&console.warn(`Overwriting filepattern <<${n.filepattern}>> to now point to mime <<${n.mime}>>`),n.firstline&&o.firstline===n.firstline&&console.warn(`Overwriting firstline <<${n.firstline}>> to now point to mime <<${n.mime}>>`))})}function aut(i,e){return{id:i.id,mime:i.mime,filename:i.filename,extension:i.extension,filepattern:i.filepattern,firstline:i.firstline,userConfigured:e,filenameLowercase:i.filename?i.filename.toLowerCase():void 0,extensionLowercase:i.extension?i.extension.toLowerCase():void 0,filepatternLowercase:i.filepattern?_1e(i.filepattern.toLowerCase()):void 0,filepatternOnPath:i.filepattern?i.filepattern.indexOf(Go.sep)>=0:!1}}function lut(){Rw=Rw.filter(i=>i.userConfigured),sX=[]}function cut(i,e){return uut(i,e).map(t=>t.id)}function uut(i,e){let t;if(i)switch(i.scheme){case hn.file:t=i.fsPath;break;case hn.data:{t=Iv.parseMetaData(i).get(Iv.META_DATA_LABEL);break}case hn.vscodeNotebookCell:t=void 0;break;default:t=i.path}if(!t)return[{id:"unknown",mime:xo.unknown}];t=t.toLowerCase();const n=Km(t),o=tae(t,n,E1e);if(o)return[o,{id:Gl,mime:xo.text}];const r=tae(t,n,sX);if(r)return[r,{id:Gl,mime:xo.text}];if(e){const s=dut(e);if(s)return[s,{id:Gl,mime:xo.text}]}return[{id:"unknown",mime:xo.unknown}]}function tae(i,e,t){var n;let o,r,s;for(let a=t.length-1;a>=0;a--){const l=t[a];if(e===l.filenameLowercase){o=l;break}if(l.filepattern&&(!r||l.filepattern.length>r.filepattern.length)){const c=l.filepatternOnPath?i:e;!((n=l.filepatternLowercase)===null||n===void 0)&&n.call(l,c)&&(r=l)}l.extension&&(!s||l.extension.length>s.extension.length)&&e.endsWith(l.extensionLowercase)&&(s=l)}if(o)return o;if(r)return r;if(s)return s}function dut(i){if(Qq(i)&&(i=i.substr(1)),i.length>0)for(let e=Rw.length-1;e>=0;e--){const t=Rw[e];if(!t.firstline)continue;const n=i.match(t.firstline);if(n&&n.length>0)return t}}const A2=Object.prototype.hasOwnProperty,nae="vs.editor.nullLanguage";class hut{constructor(){this._languageIdToLanguage=[],this._languageToLanguageId=new Map,this._register(nae,0),this._register(Gl,1),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)||0}decodeLanguageId(e){return this._languageIdToLanguage[e]||nae}}class fk extends _e{constructor(e=!0,t=!1){super(),this._onDidChange=this._register(new le),this.onDidChange=this._onDidChange.event,fk.instanceCount++,this._warnOnOverwrite=t,this.languageIdCodec=new hut,this._dynamicLanguages=[],this._languages={},this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},e&&(this._initializeFromRegistry(),this._register(_w.onDidChangeLanguages(n=>{this._initializeFromRegistry()})))}dispose(){fk.instanceCount--,super.dispose()}_initializeFromRegistry(){this._languages={},this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},lut();const e=[].concat(_w.getLanguages()).concat(this._dynamicLanguages);this._registerLanguages(e)}_registerLanguages(e){for(const t of e)this._registerLanguage(t);this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},Object.keys(this._languages).forEach(t=>{const n=this._languages[t];n.name&&(this._nameMap[n.name]=n.identifier),n.aliases.forEach(o=>{this._lowercaseNameMap[o.toLowerCase()]=n.identifier}),n.mimetypes.forEach(o=>{this._mimeTypesMap[o]=n.identifier})}),no.as(ch.Configuration).registerOverrideIdentifiers(this.getRegisteredLanguageIds()),this._onDidChange.fire()}_registerLanguage(e){const t=e.id;let n;A2.call(this._languages,t)?n=this._languages[t]:(this.languageIdCodec.register(t),n={identifier:t,name:null,mimetypes:[],aliases:[],extensions:[],filenames:[],configurationFiles:[],icons:[]},this._languages[t]=n),this._mergeLanguage(n,e)}_mergeLanguage(e,t){const n=t.id;let o=null;if(Array.isArray(t.mimetypes)&&t.mimetypes.length>0&&(e.mimetypes.push(...t.mimetypes),o=t.mimetypes[0]),o||(o=`text/x-${n}`,e.mimetypes.push(o)),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)M2({id:n,mime:o,extension:a},this._warnOnOverwrite)}if(Array.isArray(t.filenames))for(const a of t.filenames)M2({id:n,mime:o,filename:a},this._warnOnOverwrite),e.filenames.push(a);if(Array.isArray(t.filenamePatterns))for(const a of t.filenamePatterns)M2({id:n,mime:o,filepattern:a},this._warnOnOverwrite);if(typeof t.firstLine=="string"&&t.firstLine.length>0){let a=t.firstLine;a.charAt(0)!=="^"&&(a="^"+a);try{const l=new RegExp(a);hZe(l)||M2({id:n,mime:o,firstline:l},this._warnOnOverwrite)}catch(l){console.warn(`[${t.id}]: Invalid regular expression \`${a}\`: `,l)}}e.aliases.push(n);let r=null;if(typeof t.aliases!="undefined"&&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 s=r!==null&&r.length>0;if(!(s&&r[0]===null)){const a=(s?r[0]:null)||n;(s||!e.name)&&(e.name=a)}t.configuration&&e.configurationFiles.push(t.configuration),t.icon&&e.icons.push(t.icon)}isRegisteredLanguageId(e){return e?A2.call(this._languages,e):!1}getRegisteredLanguageIds(){return Object.keys(this._languages)}getLanguageIdByLanguageName(e){const t=e.toLowerCase();return A2.call(this._lowercaseNameMap,t)?this._lowercaseNameMap[t]:null}getLanguageIdByMimeType(e){return e&&A2.call(this._mimeTypesMap,e)?this._mimeTypesMap[e]:null}guessLanguageIdByFilepathOrFirstLine(e,t){return!e&&!t?[]:cut(e,t)}}fk.instanceCount=0;class gk extends _e{constructor(e=!1){super(),this._onDidRequestBasicLanguageFeatures=this._register(new le),this.onDidRequestBasicLanguageFeatures=this._onDidRequestBasicLanguageFeatures.event,this._onDidRequestRichLanguageFeatures=this._register(new le),this.onDidRequestRichLanguageFeatures=this._onDidRequestRichLanguageFeatures.event,this._onDidChange=this._register(new le({leakWarningThreshold:200})),this.onDidChange=this._onDidChange.event,this._requestedBasicLanguages=new Set,this._requestedRichLanguages=new Set,gk.instanceCount++,this._registry=this._register(new fk(!0,e)),this.languageIdCodec=this._registry.languageIdCodec,this._register(this._registry.onDidChange(()=>this._onDidChange.fire()))}dispose(){gk.instanceCount--,super.dispose()}isRegisteredLanguageId(e){return this._registry.isRegisteredLanguageId(e)}getLanguageIdByLanguageName(e){return this._registry.getLanguageIdByLanguageName(e)}getLanguageIdByMimeType(e){return this._registry.getLanguageIdByMimeType(e)}guessLanguageIdByFilepathOrFirstLine(e,t){const n=this._registry.guessLanguageIdByFilepathOrFirstLine(e,t);return l_e(n,null)}createById(e){return new iae(this.onDidChange,()=>this._createAndGetLanguageIdentifier(e))}createByFilepathOrFirstLine(e,t){return new iae(this.onDidChange,()=>{const n=this.guessLanguageIdByFilepathOrFirstLine(e,t);return this._createAndGetLanguageIdentifier(n)})}_createAndGetLanguageIdentifier(e){return(!e||!this.isRegisteredLanguageId(e))&&(e=Gl),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),oo.getOrCreate(e),this._onDidRequestRichLanguageFeatures.fire(e))}}gk.instanceCount=0;class iae{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 le({onDidRemoveLastListener:()=>{this._dispose()}})),this._emitter.event}_evaluate(){var e;const t=this._selector();t!==this.languageId&&(this.languageId=t,(e=this._emitter)===null||e===void 0||e.fire(this.languageId))}}const pk={RESOURCES:"ResourceURLs",DOWNLOAD_URL:"DownloadURL",FILES:"Files",TEXT:xo.text,INTERNAL_URI_LIST:"application/vnd.code.uri-list"};function aX(...i){return function(e,t){for(let n=0,o=i.length;n0?[{start:0,end:e.length}]:[]:null}function k1e(i,e){const t=e.toLowerCase().indexOf(i.toLowerCase());return t===-1?null:[{start:t,end:t+i.length}]}function I1e(i,e){return ZH(i.toLowerCase(),e.toLowerCase(),0,0)}function ZH(i,e,t,n){if(t===i.length)return[];if(n===e.length)return null;if(i[t]===e[n]){let o=null;return(o=ZH(i,e,t+1,n+1))?uX({start:n,end:n+1},o):null}return ZH(i,e,t,n+1)}function lX(i){return 97<=i&&i<=122}function N5(i){return 65<=i&&i<=90}function cX(i){return 48<=i&&i<=57}function T1e(i){return i===32||i===9||i===10||i===13}const N1e=new Set;"()[]{}<>`'\"-/;:,.?!".split("").forEach(i=>N1e.add(i.charCodeAt(0)));function RP(i){return T1e(i)||N1e.has(i)}function fut(i,e){return i===e||RP(i)&&RP(e)}function R1e(i){return lX(i)||N5(i)||cX(i)}function uX(i,e){return e.length===0?e=[i]:i.end===e[0].start?e[0].start=i.start:e.unshift(i),e}function M1e(i,e){for(let t=e;t0&&!R1e(i.charCodeAt(t-1)))return t}return i.length}function QH(i,e,t,n){if(t===i.length)return[];if(n===e.length)return null;if(i[t]!==e[n].toLowerCase())return null;{let o=null,r=n+1;for(o=QH(i,e,t+1,n+1);!o&&(r=M1e(e,r)).6}function mut(i){const{upperPercent:e,lowerPercent:t,alphaPercent:n,numericPercent:o}=i;return t>.2&&e<.8&&n>.6&&o<.2}function vut(i){let e=0,t=0,n=0,o=0;for(let r=0;r60)return null;const t=gut(e);if(!mut(t)){if(!put(t))return null;e=e.toLowerCase()}let n=null,o=0;for(i=i.toLowerCase();o0&&RP(i.charCodeAt(t-1)))return t;return i.length}const but=aX(mk,A1e,k1e),Cut=aX(mk,A1e,I1e),oae=new Yv(1e4);function rae(i,e,t=!1){if(typeof i!="string"||typeof e!="string")return null;let n=oae.get(i);n||(n=new RegExp(uZe(i),"i"),oae.set(i,n));const o=n.exec(e);return o?[{start:o.index,end:o.index+o[0].length}]:t?Cut(i,e):but(i,e)}function yut(i,e){const t=ob(i,i.toLowerCase(),0,e,e.toLowerCase(),0,{firstMatchCanBeWeak:!0,boostFullMatch:!0});return t?iT(t):null}function wut(i,e,t,n,o,r){const s=Math.min(13,i.length);for(;t1;n--){const o=i[n]+t,r=e[e.length-1];r&&r.end===o?r.end=o+1:e.push({start:o,end:o+1})}return e}const km=128;function dX(){const i=[],e=[];for(let t=0;t<=km;t++)e[t]=0;for(let t=0;t<=km;t++)i.push(e.slice(0));return i}function O1e(i){const e=[];for(let t=0;t<=i;t++)e[t]=0;return e}const F1e=O1e(2*km),e$=O1e(2*km),Jf=dX(),v_=dX(),P2=dX();function O2(i,e){if(e<0||e>=i.length)return!1;const t=i.codePointAt(e);switch(t){case 95:case 45:case 46:case 32:case 47:case 92:case 39:case 34:case 58:case 36:case 60:case 62:case 40:case 41:case 91:case 93:case 123:case 125:return!0;case void 0:return!1;default:return!!Zq(t)}}function sae(i,e){if(e<0||e>=i.length)return!1;switch(i.charCodeAt(e)){case 32:case 9:return!0;default:return!1}}function mM(i,e,t){return e[i]!==t[i]}function Sut(i,e,t,n,o,r,s=!1){for(;ekm?km:i.length,l=n.length>km?km:n.length;if(t>=a||r>=l||a-t>l-r||!Sut(e,t,a,o,r,l,!0))return;xut(a,l,t,r,e,o);let c=1,u=1,d=t,h=r;const f=[!1];for(c=1,d=t;d_,k=I?v_[c][u-1]+(Jf[c][u-1]>0?-5:0):0,R=h>_+1&&Jf[c][u-1]>0,A=R?v_[c][u-2]+(Jf[c][u-2]>0?-5:0):0;if(R&&(!I||A>=k)&&(!D||A>=E))v_[c][u]=A,P2[c][u]=3,Jf[c][u]=0;else if(I&&(!D||k>=E))v_[c][u]=k,P2[c][u]=2,Jf[c][u]=0;else if(D)v_[c][u]=E,P2[c][u]=1,Jf[c][u]=Jf[c-1][u-1]+1;else throw new Error("not possible")}}if(!f[0]&&!s.firstMatchCanBeWeak)return;c--,u--;const g=[v_[c][u],r];let p=0,v=0;for(;c>=1;){let _=u;do{const y=P2[c][_];if(y===3)_=_-2;else if(y===2)_=_-1;else break}while(_>=1);p>1&&e[t+c-1]===o[r+u-1]&&!mM(_+r-1,n,o)&&p+1>Jf[c][_]&&(_=u),_===u?p++:p=1,v||(v=_),c--,u=_-1,g.push(u)}l===a&&s.boostFullMatch&&(g[0]+=2);const m=v-a;return g[0]-=m,g}function xut(i,e,t,n,o,r){let s=i-1,a=e-1;for(;s>=t&&a>=n;)o[s]===r[a]&&(e$[s]=a,s--),a--}function Lut(i,e,t,n,o,r,s,a,l,c,u){if(e[t]!==r[s])return Number.MIN_SAFE_INTEGER;let d=1,h=!1;return s===t-n?d=i[t]===o[s]?7:5:mM(s,o,r)&&(s===0||!mM(s-1,o,r))?(d=i[t]===o[s]?7:5,h=!0):O2(r,s)&&(s===0||!O2(r,s-1))?d=5:(O2(r,s-1)||sae(r,s-1))&&(d=5,h=!0),d>1&&t===n&&(u[0]=!0),h||(h=mM(s,o,r)||O2(r,s-1)||sae(r,s-1)),t===n?s>l&&(d-=h?3:5):c?d+=h?2:0:d+=h?0:1,s+1===a&&(d-=h?3:5),d}function Eut(i,e,t,n,o,r,s){return Dut(i,e,t,n,o,r,!0,s)}function Dut(i,e,t,n,o,r,s,a){let l=ob(i,e,t,n,o,r,a);if(l&&!s)return l;if(i.length>=3){const c=Math.min(7,i.length-1);for(let u=t+1;ul[0])&&(l=h))}}}return l}function kut(i,e){if(e+1>=i.length)return;const t=i[e],n=i[e+1];if(t!==n)return i.slice(0,e)+n+t+i.slice(e+2)}const Iut="$(",hX=new RegExp(`\\$\\(${Mt.iconNameExpression}(?:${Mt.iconModifierExpression})?\\)`,"g"),Tut=new RegExp(`(\\\\)?${hX.source}`,"g");function Nut(i){return i.replace(Tut,(e,t)=>t?e:`\\${e}`)}const Rut=new RegExp(`\\\\${hX.source}`,"g");function Mut(i){return i.replace(Rut,e=>`\\${e}`)}const Aut=new RegExp(`(\\s)?(\\\\)?${hX.source}(\\s)?`,"g");function fX(i){return i.indexOf(Iut)===-1?i:i.replace(Aut,(e,t,n,o)=>n?e:t||o||"")}function Put(i){return i?i.replace(/\$\((.*?)\)/g,(e,t)=>` ${t} `).trim():""}const T9=new RegExp(`\\$\\(${Mt.iconNameCharacter}+\\)`,"g");function TL(i){T9.lastIndex=0;let e="";const t=[];let n=0;for(;;){const o=T9.lastIndex,r=T9.exec(i),s=i.substring(o,r==null?void 0:r.index);if(s.length>0){e+=s;for(let a=0;a" ".repeat(o.length)).replace(/\>/gm,"\\>").replace(/\n/g,t===1?`\\ `:` `),this}appendMarkdown(e){return this.value+=e,this}appendCodeblock(e,t){return this.value+="\n```",this.value+=e,this.value+=` -`,this.value+=t,this.value+="\n```\n",this}appendLink(e,t,n){return this.value+="[",this.value+=this._escape(t,"]"),this.value+="](",this.value+=this._escape(String(e),")"),n&&(this.value+=` "${this._escape(this._escape(n,'"'),")")}"`),this.value+=")",this}_escape(e,t){const n=new RegExp(Gl(t),"g");return e.replace(n,(o,r)=>e.charAt(r-1)!=="\\"?`\\${o}`:o)}}function Ry(i){return Ym(i)?!i.value:Array.isArray(i)?i.every(Ry):!0}function Ym(i){return i instanceof is?!0:i&&typeof i=="object"?typeof i.value=="string"&&(typeof i.isTrusted=="boolean"||typeof i.isTrusted=="object"||i.isTrusted===void 0)&&(typeof i.supportThemeIcons=="boolean"||i.supportThemeIcons===void 0):!1}function Tut(i,e){return i===e?!0:!i||!e?!1:i.value===e.value&&i.isTrusted===e.isTrusted&&i.supportThemeIcons===e.supportThemeIcons&&i.supportHtml===e.supportHtml&&(i.baseUri===e.baseUri||!!i.baseUri&&!!e.baseUri&&MG(Rt.from(i.baseUri),Rt.from(e.baseUri)))}function Nut(i){return i.replace(/[\\`*_{}[\]()#+\-!~]/g,"\\$&")}function A2(i){return i.replace(/"/g,""")}function R9(i){return i&&i.replace(/\\([\\`*_{}[\]()#+\-.!~])/g,"$1")}function Rut(i){const e=[],t=i.split("|").map(o=>o.trim());i=t[0];const n=t[1];if(n){const o=/height=(\d+)/.exec(n),r=/width=(\d+)/.exec(n),s=o?o[1]:"",a=r?r[1]:"",l=isFinite(parseInt(a)),c=isFinite(parseInt(s));l&&e.push(`width="${a}"`),c&&e.push(`height="${s}"`)}return{href:i,dimensions:e}}var ZH=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};function Mut(i,e){aa(e)?i.title=sX(e):e!=null&&e.markdownNotSupportedFallback?i.title=e.markdownNotSupportedFallback:i.removeAttribute("title")}class Aut{constructor(e,t,n){this.hoverDelegate=e,this.target=t,this.fadeInAnimation=n}update(e,t,n){var o;return ZH(this,void 0,void 0,function*(){if(this._cancellationTokenSource&&(this._cancellationTokenSource.dispose(!0),this._cancellationTokenSource=void 0),this.isDisposed)return;let r;if(e===void 0||aa(e)||e instanceof HTMLElement)r=e;else if(!DD(e.markdown))r=(o=e.markdown)!==null&&o!==void 0?o:e.markdownNotSupportedFallback;else{this._hoverWidget||this.show(C("iconLabel.loading","Loading..."),t),this._cancellationTokenSource=new Ro;const s=this._cancellationTokenSource.token;if(r=yield e.markdown(s),r===void 0&&(r=e.markdownNotSupportedFallback),this.isDisposed||s.isCancellationRequested)return}this.show(r,t,n)})}show(e,t,n){const o=this._hoverWidget;if(this.hasContent(e)){const r=Object.assign({content:e,target:this.target,showPointer:this.hoverDelegate.placement==="element",hoverPosition:2,skipFadeInAnimation:!this.fadeInAnimation||!!o},n);this._hoverWidget=this.hoverDelegate.showHover(r,t)}o==null||o.dispose()}hasContent(e){return e?Ym(e)?!!e.value:!0:!1}get isDisposed(){var e;return(e=this._hoverWidget)===null||e===void 0?void 0:e.isDisposed}dispose(){var e,t;(e=this._hoverWidget)===null||e===void 0||e.dispose(),(t=this._cancellationTokenSource)===null||t===void 0||t.dispose(!0),this._cancellationTokenSource=void 0}}function T1e(i,e,t,n){let o,r;const s=(d,h)=>{var f;const g=r!==void 0;d&&(r==null||r.dispose(),r=void 0),h&&(o==null||o.dispose(),o=void 0),g&&((f=i.onDidHideHover)===null||f===void 0||f.call(i))},a=(d,h,f)=>new $u(()=>ZH(this,void 0,void 0,function*(){(!r||r.isDisposed)&&(r=new Aut(i,f||e,d>0),yield r.update(t,h,n))}),d),l=()=>{if(o)return;const d=new Be,h=p=>s(!1,p.fromElement===e);d.add(ke(e,et.MOUSE_LEAVE,h,!0));const f=()=>s(!0,!0);d.add(ke(e,et.MOUSE_DOWN,f,!0));const g={targetElements:[e],dispose:()=>{}};if(i.placement===void 0||i.placement==="mouse"){const p=v=>{g.x=v.x+10,v.target instanceof HTMLElement&&v.target.classList.contains("action-label")&&s(!0,!0)};d.add(ke(e,et.MOUSE_MOVE,p,!0))}d.add(a(i.delay,!1,g)),o=d},c=ke(e,et.MOUSE_OVER,l,!0);return{show:d=>{s(!1,!0),a(0,d)},hide:()=>{s(!0,!0)},update:(d,h)=>ZH(this,void 0,void 0,function*(){t=d,yield r==null?void 0:r.update(t,void 0,h)}),dispose:()=>{c.dispose(),s(!0,!0)}}}function Put(i,e={}){const t=aX(e);return t.textContent=i,t}function Out(i,e={}){const t=aX(e);return N1e(t,But(i,!!e.renderCodeSegments),e.actionHandler,e.renderCodeSegments),t}function aX(i){const e=i.inline?"span":"div",t=document.createElement(e);return i.className&&(t.className=i.className),t}class Fut{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++}}function N1e(i,e,t,n){let o;if(e.type===2)o=document.createTextNode(e.content||"");else if(e.type===3)o=document.createElement("b");else if(e.type===4)o=document.createElement("i");else if(e.type===7&&n)o=document.createElement("code");else if(e.type===5&&t){const r=document.createElement("a");t.disposables.add(No(r,"click",s=>{t.callback(String(e.index),s)})),o=r}else e.type===8?o=document.createElement("br"):e.type===1&&(o=i);o&&i!==o&&i.appendChild(o),o&&Array.isArray(e.children)&&e.children.forEach(r=>{N1e(o,r,t,n)})}function But(i,e){const t={type:1,children:[]};let n=0,o=t;const r=[],s=new Fut(i);for(;!s.eos();){let a=s.next();const l=a==="\\"&&QH(s.peek(),e)!==0;if(l&&(a=s.next()),!l&&Wut(a,e)&&a===s.peek()){s.advance(),o.type===2&&(o=r.pop());const c=QH(a,e);if(o.type===c||o.type===5&&c===6)o=r.pop();else{const u={type:c,children:[]};c===5&&(u.index=n,n++),o.children.push(u),r.push(o),o=u}}else if(a===` -`)o.type===2&&(o=r.pop()),o.children.push({type:8});else if(o.type!==2){const c={type:2,content:a};o.children.push(c),r.push(o),o=c}else o.content+=a}return o.type===2&&(o=r.pop()),t}function Wut(i,e){return QH(i,e)!==0}function QH(i,e){switch(i){case"*":return 3;case"_":return 4;case"[":return 5;case"]":return 6;case"`":return e?7:0;default:return 0}}const Vut=new RegExp(`(\\\\)?\\$\\((${Mt.iconNameExpression}(?:${Mt.iconModifierExpression})?)\\)`,"g");function Zm(i){const e=new Array;let t,n=0,o=0;for(;(t=Vut.exec(i))!==null;){o=t.index||0,nre.length)&&(ie=re.length);for(var se=0,U=new Array(ie);se=re.length?{done:!0}:{done:!1,value:re[U++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function a(){return{async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}e.defaults=a();function l(re){e.defaults=re}var c=/[&<>"']/,u=/[&<>"']/g,d=/[<>"']|&(?!#?\w+;)/,h=/[<>"']|&(?!#?\w+;)/g,f={"&":"&","<":"<",">":">",'"':""","'":"'"},g=function(ie){return f[ie]};function p(re,ie){if(ie){if(c.test(re))return re.replace(u,g)}else if(d.test(re))return re.replace(h,g);return re}var v=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function m(re){return re.replace(v,function(ie,se){return se=se.toLowerCase(),se==="colon"?":":se.charAt(0)==="#"?se.charAt(1)==="x"?String.fromCharCode(parseInt(se.substring(2),16)):String.fromCharCode(+se.substring(1)):""})}var _=/(^|[^\[])\^/g;function w(re,ie){re=typeof re=="string"?re:re.source,ie=ie||"";var se={replace:function(Y,oe){return oe=oe.source||oe,oe=oe.replace(_,"$1"),re=re.replace(Y,oe),se},getRegex:function(){return new RegExp(re,ie)}};return se}var y=/[^\w:]/g,L=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function D(re,ie,se){if(re){var U;try{U=decodeURIComponent(m(se)).replace(y,"").toLowerCase()}catch{return null}if(U.indexOf("javascript:")===0||U.indexOf("vbscript:")===0||U.indexOf("data:")===0)return null}ie&&!L.test(se)&&(se=A(ie,se));try{se=encodeURI(se).replace(/%25/g,"%")}catch{return null}return se}var E={},I=/^[^:]+:\/*[^/]*$/,k=/^([^:]+:)[\s\S]*$/,R=/^([^:]+:\/*[^/]*)[\s\S]*$/;function A(re,ie){E[" "+re]||(I.test(re)?E[" "+re]=re+"/":E[" "+re]=H(re,"/",!0)),re=E[" "+re];var se=re.indexOf(":")===-1;return ie.substring(0,2)==="//"?se?ie:re.replace(k,"$1")+ie:ie.charAt(0)==="/"?se?ie:re.replace(R,"$1")+ie:re+ie}var P={exec:function(){}};function N(re){for(var ie=1,se,U;ie=0&&we[Te]==="\\";)Le=!Le;return Le?"|":" |"}),U=se.split(/ \|/),Y=0;if(U[0].trim()||U.shift(),U.length>0&&!U[U.length-1].trim()&&U.pop(),U.length>ie)U.splice(ie);else for(;U.length1;)ie&1&&(se+=re),ie>>=1,re+=re;return se+re}function z(re,ie,se,U){var Y=ie.href,oe=ie.title?p(ie.title):null,te=re[1].replace(/\\([\[\]])/g,"$1");if(re[0].charAt(0)!=="!"){U.state.inLink=!0;var we={type:"link",raw:se,href:Y,title:oe,text:te,tokens:U.inlineTokens(te)};return U.state.inLink=!1,we}return{type:"image",raw:se,href:Y,title:oe,text:p(te)}}function K(re,ie){var se=re.match(/^(\s+)(?:```)/);if(se===null)return ie;var U=se[1];return ie.split(` +`,this.value+=t,this.value+="\n```\n",this}appendLink(e,t,n){return this.value+="[",this.value+=this._escape(t,"]"),this.value+="](",this.value+=this._escape(String(e),")"),n&&(this.value+=` "${this._escape(this._escape(n,'"'),")")}"`),this.value+=")",this}_escape(e,t){const n=new RegExp(Xl(t),"g");return e.replace(n,(o,r)=>e.charAt(r-1)!=="\\"?`\\${o}`:o)}}function Mw(i){return Zm(i)?!i.value:Array.isArray(i)?i.every(Mw):!0}function Zm(i){return i instanceof os?!0:i&&typeof i=="object"?typeof i.value=="string"&&(typeof i.isTrusted=="boolean"||typeof i.isTrusted=="object"||i.isTrusted===void 0)&&(typeof i.supportThemeIcons=="boolean"||i.supportThemeIcons===void 0):!1}function Out(i,e){return i===e?!0:!i||!e?!1:i.value===e.value&&i.isTrusted===e.isTrusted&&i.supportThemeIcons===e.supportThemeIcons&&i.supportHtml===e.supportHtml&&(i.baseUri===e.baseUri||!!i.baseUri&&!!e.baseUri&&VG(Rt.from(i.baseUri),Rt.from(e.baseUri)))}function Fut(i){return i.replace(/[\\`*_{}[\]()#+\-!~]/g,"\\$&")}function F2(i){return i.replace(/"/g,""")}function R9(i){return i&&i.replace(/\\([\\`*_{}[\]()#+\-.!~])/g,"$1")}function But(i){const e=[],t=i.split("|").map(o=>o.trim());i=t[0];const n=t[1];if(n){const o=/height=(\d+)/.exec(n),r=/width=(\d+)/.exec(n),s=o?o[1]:"",a=r?r[1]:"",l=isFinite(parseInt(a)),c=isFinite(parseInt(s));l&&e.push(`width="${a}"`),c&&e.push(`height="${s}"`)}return{href:i,dimensions:e}}var t$=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};function Wut(i,e){la(e)?i.title=fX(e):e!=null&&e.markdownNotSupportedFallback?i.title=e.markdownNotSupportedFallback:i.removeAttribute("title")}class Vut{constructor(e,t,n){this.hoverDelegate=e,this.target=t,this.fadeInAnimation=n}update(e,t,n){var o;return t$(this,void 0,void 0,function*(){if(this._cancellationTokenSource&&(this._cancellationTokenSource.dispose(!0),this._cancellationTokenSource=void 0),this.isDisposed)return;let r;if(e===void 0||la(e)||e instanceof HTMLElement)r=e;else if(!DD(e.markdown))r=(o=e.markdown)!==null&&o!==void 0?o:e.markdownNotSupportedFallback;else{this._hoverWidget||this.show(C("iconLabel.loading","Loading..."),t),this._cancellationTokenSource=new Ro;const s=this._cancellationTokenSource.token;if(r=yield e.markdown(s),r===void 0&&(r=e.markdownNotSupportedFallback),this.isDisposed||s.isCancellationRequested)return}this.show(r,t,n)})}show(e,t,n){const o=this._hoverWidget;if(this.hasContent(e)){const r=Object.assign({content:e,target:this.target,showPointer:this.hoverDelegate.placement==="element",hoverPosition:2,skipFadeInAnimation:!this.fadeInAnimation||!!o},n);this._hoverWidget=this.hoverDelegate.showHover(r,t)}o==null||o.dispose()}hasContent(e){return e?Zm(e)?!!e.value:!0:!1}get isDisposed(){var e;return(e=this._hoverWidget)===null||e===void 0?void 0:e.isDisposed}dispose(){var e,t;(e=this._hoverWidget)===null||e===void 0||e.dispose(),(t=this._cancellationTokenSource)===null||t===void 0||t.dispose(!0),this._cancellationTokenSource=void 0}}function B1e(i,e,t,n){let o,r;const s=(d,h)=>{var f;const g=r!==void 0;d&&(r==null||r.dispose(),r=void 0),h&&(o==null||o.dispose(),o=void 0),g&&((f=i.onDidHideHover)===null||f===void 0||f.call(i))},a=(d,h,f)=>new zu(()=>t$(this,void 0,void 0,function*(){(!r||r.isDisposed)&&(r=new Vut(i,f||e,d>0),yield r.update(t,h,n))}),d),l=()=>{if(o)return;const d=new Be,h=p=>s(!1,p.fromElement===e);d.add(ke(e,et.MOUSE_LEAVE,h,!0));const f=()=>s(!0,!0);d.add(ke(e,et.MOUSE_DOWN,f,!0));const g={targetElements:[e],dispose:()=>{}};if(i.placement===void 0||i.placement==="mouse"){const p=v=>{g.x=v.x+10,v.target instanceof HTMLElement&&v.target.classList.contains("action-label")&&s(!0,!0)};d.add(ke(e,et.MOUSE_MOVE,p,!0))}d.add(a(i.delay,!1,g)),o=d},c=ke(e,et.MOUSE_OVER,l,!0);return{show:d=>{s(!1,!0),a(0,d)},hide:()=>{s(!0,!0)},update:(d,h)=>t$(this,void 0,void 0,function*(){t=d,yield r==null?void 0:r.update(t,void 0,h)}),dispose:()=>{c.dispose(),s(!0,!0)}}}function Hut(i,e={}){const t=gX(e);return t.textContent=i,t}function $ut(i,e={}){const t=gX(e);return W1e(t,Uut(i,!!e.renderCodeSegments),e.actionHandler,e.renderCodeSegments),t}function gX(i){const e=i.inline?"span":"div",t=document.createElement(e);return i.className&&(t.className=i.className),t}class zut{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++}}function W1e(i,e,t,n){let o;if(e.type===2)o=document.createTextNode(e.content||"");else if(e.type===3)o=document.createElement("b");else if(e.type===4)o=document.createElement("i");else if(e.type===7&&n)o=document.createElement("code");else if(e.type===5&&t){const r=document.createElement("a");t.disposables.add(No(r,"click",s=>{t.callback(String(e.index),s)})),o=r}else e.type===8?o=document.createElement("br"):e.type===1&&(o=i);o&&i!==o&&i.appendChild(o),o&&Array.isArray(e.children)&&e.children.forEach(r=>{W1e(o,r,t,n)})}function Uut(i,e){const t={type:1,children:[]};let n=0,o=t;const r=[],s=new zut(i);for(;!s.eos();){let a=s.next();const l=a==="\\"&&n$(s.peek(),e)!==0;if(l&&(a=s.next()),!l&&jut(a,e)&&a===s.peek()){s.advance(),o.type===2&&(o=r.pop());const c=n$(a,e);if(o.type===c||o.type===5&&c===6)o=r.pop();else{const u={type:c,children:[]};c===5&&(u.index=n,n++),o.children.push(u),r.push(o),o=u}}else if(a===` +`)o.type===2&&(o=r.pop()),o.children.push({type:8});else if(o.type!==2){const c={type:2,content:a};o.children.push(c),r.push(o),o=c}else o.content+=a}return o.type===2&&(o=r.pop()),t}function jut(i,e){return n$(i,e)!==0}function n$(i,e){switch(i){case"*":return 3;case"_":return 4;case"[":return 5;case"]":return 6;case"`":return e?7:0;default:return 0}}const Kut=new RegExp(`(\\\\)?\\$\\((${Mt.iconNameExpression}(?:${Mt.iconModifierExpression})?)\\)`,"g");function Qm(i){const e=new Array;let t,n=0,o=0;for(;(t=Kut.exec(i))!==null;){o=t.index||0,nre.length)&&(ie=re.length);for(var se=0,U=new Array(ie);se=re.length?{done:!0}:{done:!1,value:re[U++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function a(){return{async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}e.defaults=a();function l(re){e.defaults=re}var c=/[&<>"']/,u=/[&<>"']/g,d=/[<>"']|&(?!#?\w+;)/,h=/[<>"']|&(?!#?\w+;)/g,f={"&":"&","<":"<",">":">",'"':""","'":"'"},g=function(ie){return f[ie]};function p(re,ie){if(ie){if(c.test(re))return re.replace(u,g)}else if(d.test(re))return re.replace(h,g);return re}var v=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function m(re){return re.replace(v,function(ie,se){return se=se.toLowerCase(),se==="colon"?":":se.charAt(0)==="#"?se.charAt(1)==="x"?String.fromCharCode(parseInt(se.substring(2),16)):String.fromCharCode(+se.substring(1)):""})}var _=/(^|[^\[])\^/g;function y(re,ie){re=typeof re=="string"?re:re.source,ie=ie||"";var se={replace:function(Y,oe){return oe=oe.source||oe,oe=oe.replace(_,"$1"),re=re.replace(Y,oe),se},getRegex:function(){return new RegExp(re,ie)}};return se}var w=/[^\w:]/g,L=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function D(re,ie,se){if(re){var U;try{U=decodeURIComponent(m(se)).replace(w,"").toLowerCase()}catch{return null}if(U.indexOf("javascript:")===0||U.indexOf("vbscript:")===0||U.indexOf("data:")===0)return null}ie&&!L.test(se)&&(se=A(ie,se));try{se=encodeURI(se).replace(/%25/g,"%")}catch{return null}return se}var E={},I=/^[^:]+:\/*[^/]*$/,k=/^([^:]+:)[\s\S]*$/,R=/^([^:]+:\/*[^/]*)[\s\S]*$/;function A(re,ie){E[" "+re]||(I.test(re)?E[" "+re]=re+"/":E[" "+re]=H(re,"/",!0)),re=E[" "+re];var se=re.indexOf(":")===-1;return ie.substring(0,2)==="//"?se?ie:re.replace(k,"$1")+ie:ie.charAt(0)==="/"?se?ie:re.replace(R,"$1")+ie:re+ie}var P={exec:function(){}};function N(re){for(var ie=1,se,U;ie=0&&ye[Te]==="\\";)Le=!Le;return Le?"|":" |"}),U=se.split(/ \|/),Y=0;if(U[0].trim()||U.shift(),U.length>0&&!U[U.length-1].trim()&&U.pop(),U.length>ie)U.splice(ie);else for(;U.length1;)ie&1&&(se+=re),ie>>=1,re+=re;return se+re}function z(re,ie,se,U){var Y=ie.href,oe=ie.title?p(ie.title):null,te=re[1].replace(/\\([\[\]])/g,"$1");if(re[0].charAt(0)!=="!"){U.state.inLink=!0;var ye={type:"link",raw:se,href:Y,title:oe,text:te,tokens:U.inlineTokens(te)};return U.state.inLink=!1,ye}return{type:"image",raw:se,href:Y,title:oe,text:p(te)}}function K(re,ie){var se=re.match(/^(\s+)(?:```)/);if(se===null)return ie;var U=se[1];return ie.split(` `).map(function(Y){var oe=Y.match(/^\s+/);if(oe===null)return Y;var te=oe[0];return te.length>=U.length?Y.slice(U.length):Y}).join(` `)}var j=function(){function re(se){this.options=se||e.defaults}var ie=re.prototype;return ie.space=function(U){var Y=this.rules.block.newline.exec(U);if(Y&&Y[0].length>0)return{type:"space",raw:Y[0]}},ie.code=function(U){var Y=this.rules.block.code.exec(U);if(Y){var oe=Y[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:Y[0],codeBlockStyle:"indented",text:this.options.pedantic?oe:H(oe,` -`)}}},ie.fences=function(U){var Y=this.rules.block.fences.exec(U);if(Y){var oe=Y[0],te=K(oe,Y[3]||"");return{type:"code",raw:oe,lang:Y[2]?Y[2].trim():Y[2],text:te}}},ie.heading=function(U){var Y=this.rules.block.heading.exec(U);if(Y){var oe=Y[2].trim();if(/#$/.test(oe)){var te=H(oe,"#");(this.options.pedantic||!te||/ $/.test(te))&&(oe=te.trim())}return{type:"heading",raw:Y[0],depth:Y[1].length,text:oe,tokens:this.lexer.inline(oe)}}},ie.hr=function(U){var Y=this.rules.block.hr.exec(U);if(Y)return{type:"hr",raw:Y[0]}},ie.blockquote=function(U){var Y=this.rules.block.blockquote.exec(U);if(Y){var oe=Y[0].replace(/^ *>[ \t]?/gm,"");return{type:"blockquote",raw:Y[0],tokens:this.lexer.blockTokens(oe,[]),text:oe}}},ie.list=function(U){var Y=this.rules.block.list.exec(U);if(Y){var oe,te,we,Le,Te,We,je,mt,Et,At,Je,xt,Ot=Y[1].trim(),Vn=Ot.length>1,Lt={type:"list",raw:"",ordered:Vn,start:Vn?+Ot.slice(0,-1):"",loose:!1,items:[]};Ot=Vn?"\\d{1,9}\\"+Ot.slice(-1):"\\"+Ot,this.options.pedantic&&(Ot=Vn?Ot:"[*+-]");for(var tn=new RegExp("^( {0,3}"+Ot+")((?:[ ][^\\n]*)?(?:\\n|$))");U&&(xt=!1,!(!(Y=tn.exec(U))||this.rules.block.hr.test(U)));){if(oe=Y[0],U=U.substring(oe.length),mt=Y[2].split(` -`,1)[0],Et=U.split(` -`,1)[0],this.options.pedantic?(Le=2,Je=mt.trimLeft()):(Le=Y[2].search(/[^ ]/),Le=Le>4?1:Le,Je=mt.slice(Le),Le+=Y[1].length),We=!1,!mt&&/^ *$/.test(Et)&&(oe+=Et+` -`,U=U.substring(Et.length+1),xt=!0),!xt)for(var ui=new RegExp("^ {0,"+Math.min(3,Le-1)+"}(?:[*+-]|\\d{1,9}[.)])((?: [^\\n]*)?(?:\\n|$))"),cn=new RegExp("^ {0,"+Math.min(3,Le-1)+"}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)"),qn=new RegExp("^ {0,"+Math.min(3,Le-1)+"}(?:```|~~~)"),bn=new RegExp("^ {0,"+Math.min(3,Le-1)+"}#");U&&(At=U.split(` +`)}}},ie.fences=function(U){var Y=this.rules.block.fences.exec(U);if(Y){var oe=Y[0],te=K(oe,Y[3]||"");return{type:"code",raw:oe,lang:Y[2]?Y[2].trim():Y[2],text:te}}},ie.heading=function(U){var Y=this.rules.block.heading.exec(U);if(Y){var oe=Y[2].trim();if(/#$/.test(oe)){var te=H(oe,"#");(this.options.pedantic||!te||/ $/.test(te))&&(oe=te.trim())}return{type:"heading",raw:Y[0],depth:Y[1].length,text:oe,tokens:this.lexer.inline(oe)}}},ie.hr=function(U){var Y=this.rules.block.hr.exec(U);if(Y)return{type:"hr",raw:Y[0]}},ie.blockquote=function(U){var Y=this.rules.block.blockquote.exec(U);if(Y){var oe=Y[0].replace(/^ *>[ \t]?/gm,"");return{type:"blockquote",raw:Y[0],tokens:this.lexer.blockTokens(oe,[]),text:oe}}},ie.list=function(U){var Y=this.rules.block.list.exec(U);if(Y){var oe,te,ye,Le,Te,We,je,mt,Dt,At,Je,Lt,Ot=Y[1].trim(),Vn=Ot.length>1,Et={type:"list",raw:"",ordered:Vn,start:Vn?+Ot.slice(0,-1):"",loose:!1,items:[]};Ot=Vn?"\\d{1,9}\\"+Ot.slice(-1):"\\"+Ot,this.options.pedantic&&(Ot=Vn?Ot:"[*+-]");for(var tn=new RegExp("^( {0,3}"+Ot+")((?:[ ][^\\n]*)?(?:\\n|$))");U&&(Lt=!1,!(!(Y=tn.exec(U))||this.rules.block.hr.test(U)));){if(oe=Y[0],U=U.substring(oe.length),mt=Y[2].split(` +`,1)[0],Dt=U.split(` +`,1)[0],this.options.pedantic?(Le=2,Je=mt.trimLeft()):(Le=Y[2].search(/[^ ]/),Le=Le>4?1:Le,Je=mt.slice(Le),Le+=Y[1].length),We=!1,!mt&&/^ *$/.test(Dt)&&(oe+=Dt+` +`,U=U.substring(Dt.length+1),Lt=!0),!Lt)for(var ui=new RegExp("^ {0,"+Math.min(3,Le-1)+"}(?:[*+-]|\\d{1,9}[.)])((?: [^\\n]*)?(?:\\n|$))"),cn=new RegExp("^ {0,"+Math.min(3,Le-1)+"}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)"),qn=new RegExp("^ {0,"+Math.min(3,Le-1)+"}(?:```|~~~)"),bn=new RegExp("^ {0,"+Math.min(3,Le-1)+"}#");U&&(At=U.split(` `,1)[0],mt=At,this.options.pedantic&&(mt=mt.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),!(qn.test(mt)||bn.test(mt)||ui.test(mt)||cn.test(U)));){if(mt.search(/[^ ]/)>=Le||!mt.trim())Je+=` `+mt.slice(Le);else if(!We)Je+=` `+mt;else break;!We&&!mt.trim()&&(We=!0),oe+=At+` -`,U=U.substring(At.length+1)}Lt.loose||(je?Lt.loose=!0:/\n *\n *$/.test(oe)&&(je=!0)),this.options.gfm&&(te=/^\[[ xX]\] /.exec(Je),te&&(we=te[0]!=="[ ] ",Je=Je.replace(/^\[[ xX]\] +/,""))),Lt.items.push({type:"list_item",raw:oe,task:!!te,checked:we,loose:!1,text:Je}),Lt.raw+=oe}Lt.items[Lt.items.length-1].raw=oe.trimRight(),Lt.items[Lt.items.length-1].text=Je.trimRight(),Lt.raw=Lt.raw.trimRight();var Pt=Lt.items.length;for(Te=0;Te1)return!0}return!1});!Lt.loose&&qt.length&&Nt&&(Lt.loose=!0,Lt.items[Te].loose=!0)}return Lt}},ie.html=function(U){var Y=this.rules.block.html.exec(U);if(Y){var oe={type:"html",raw:Y[0],pre:!this.options.sanitizer&&(Y[1]==="pre"||Y[1]==="script"||Y[1]==="style"),text:Y[0]};if(this.options.sanitize){var te=this.options.sanitizer?this.options.sanitizer(Y[0]):p(Y[0]);oe.type="paragraph",oe.text=te,oe.tokens=this.lexer.inline(te)}return oe}},ie.def=function(U){var Y=this.rules.block.def.exec(U);if(Y){Y[3]&&(Y[3]=Y[3].substring(1,Y[3].length-1));var oe=Y[1].toLowerCase().replace(/\s+/g," ");return{type:"def",tag:oe,raw:Y[0],href:Y[2],title:Y[3]}}},ie.table=function(U){var Y=this.rules.block.table.exec(U);if(Y){var oe={type:"table",header:M(Y[1]).map(function(je){return{text:je}}),align:Y[2].replace(/^ *|\| *$/g,"").split(/ *\| */),rows:Y[3]&&Y[3].trim()?Y[3].replace(/\n[ \t]*$/,"").split(` -`):[]};if(oe.header.length===oe.align.length){oe.raw=Y[0];var te=oe.align.length,we,Le,Te,We;for(we=0;we/i.test(Y[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(Y[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(Y[0])&&(this.lexer.state.inRawBlock=!1),{type:this.options.sanitize?"text":"html",raw:Y[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(Y[0]):p(Y[0]):Y[0]}},ie.link=function(U){var Y=this.rules.inline.link.exec(U);if(Y){var oe=Y[2].trim();if(!this.options.pedantic&&/^$/.test(oe))return;var te=H(oe.slice(0,-1),"\\");if((oe.length-te.length)%2===0)return}else{var we=W(Y[2],"()");if(we>-1){var Le=Y[0].indexOf("!")===0?5:4,Te=Le+Y[1].length+we;Y[2]=Y[2].substring(0,we),Y[0]=Y[0].substring(0,Te).trim(),Y[3]=""}}var We=Y[2],je="";if(this.options.pedantic){var mt=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(We);mt&&(We=mt[1],je=mt[3])}else je=Y[3]?Y[3].slice(1,-1):"";return We=We.trim(),/^$/.test(oe)?We=We.slice(1):We=We.slice(1,-1)),z(Y,{href:We&&We.replace(this.rules.inline._escapes,"$1"),title:je&&je.replace(this.rules.inline._escapes,"$1")},Y[0],this.lexer)}},ie.reflink=function(U,Y){var oe;if((oe=this.rules.inline.reflink.exec(U))||(oe=this.rules.inline.nolink.exec(U))){var te=(oe[2]||oe[1]).replace(/\s+/g," ");if(te=Y[te.toLowerCase()],!te||!te.href){var we=oe[0].charAt(0);return{type:"text",raw:we,text:we}}return z(oe,te,oe[0],this.lexer)}},ie.emStrong=function(U,Y,oe){oe===void 0&&(oe="");var te=this.rules.inline.emStrong.lDelim.exec(U);if(!!te&&!(te[3]&&oe.match(/(?:[0-9A-Za-z\xAA\xB2\xB3\xB5\xB9\xBA\xBC-\xBE\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u0660-\u0669\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0966-\u096F\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09E6-\u09F1\u09F4-\u09F9\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A66-\u0A6F\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AE6-\u0AEF\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B66-\u0B6F\u0B71-\u0B77\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0BE6-\u0BF2\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C66-\u0C6F\u0C78-\u0C7E\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CE6-\u0CEF\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D58-\u0D61\u0D66-\u0D78\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DE6-\u0DEF\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F20-\u0F33\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F-\u1049\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u1090-\u1099\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1369-\u137C\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A16\u1A20-\u1A54\u1A80-\u1A89\u1A90-\u1A99\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B50-\u1B59\u1B83-\u1BA0\u1BAE-\u1BE5\u1C00-\u1C23\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2070\u2071\u2074-\u2079\u207F-\u2089\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2150-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2CFD\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u3192-\u3195\u31A0-\u31BF\u31F0-\u31FF\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA830-\uA835\uA840-\uA873\uA882-\uA8B3\uA8D0-\uA8D9\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA900-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF-\uA9D9\uA9E0-\uA9E4\uA9E6-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA50-\uAA59\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDE80-\uDE9C\uDEA0-\uDED0\uDEE1-\uDEFB\uDF00-\uDF23\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC58-\uDC76\uDC79-\uDC9E\uDCA7-\uDCAF\uDCE0-\uDCF2\uDCF4\uDCF5\uDCFB-\uDD1B\uDD20-\uDD39\uDD80-\uDDB7\uDDBC-\uDDCF\uDDD2-\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE40-\uDE48\uDE60-\uDE7E\uDE80-\uDE9F\uDEC0-\uDEC7\uDEC9-\uDEE4\uDEEB-\uDEEF\uDF00-\uDF35\uDF40-\uDF55\uDF58-\uDF72\uDF78-\uDF91\uDFA9-\uDFAF]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDCFA-\uDD23\uDD30-\uDD39\uDE60-\uDE7E\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF27\uDF30-\uDF45\uDF51-\uDF54\uDF70-\uDF81\uDFB0-\uDFCB\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC52-\uDC6F\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD03-\uDD26\uDD36-\uDD3F\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDD0-\uDDDA\uDDDC\uDDE1-\uDDF4\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDEF0-\uDEF9\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC50-\uDC59\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE50-\uDE59\uDE80-\uDEAA\uDEB8\uDEC0-\uDEC9\uDF00-\uDF1A\uDF30-\uDF3B\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCF2\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDD50-\uDD59\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC50-\uDC6C\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD50-\uDD59\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDDA0-\uDDA9\uDEE0-\uDEF2\uDFB0\uDFC0-\uDFD4]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDE70-\uDEBE\uDEC0-\uDEC9\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF50-\uDF59\uDF5B-\uDF61\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE96\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD834[\uDEE0-\uDEF3\uDF60-\uDF78]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD837[\uDF00-\uDF1E]|\uD838[\uDD00-\uDD2C\uDD37-\uDD3D\uDD40-\uDD49\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB\uDEF0-\uDEF9]|\uD839[\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDCC7-\uDCCF\uDD00-\uDD43\uDD4B\uDD50-\uDD59]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4\uDD01-\uDD2D\uDD2F-\uDD3D\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD83C[\uDD00-\uDD0C]|\uD83E[\uDFF0-\uDFF9]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF38\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A])/))){var we=te[1]||te[2]||"";if(!we||we&&(oe===""||this.rules.inline.punctuation.exec(oe))){var Le=te[0].length-1,Te,We,je=Le,mt=0,Et=te[0][0]==="*"?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(Et.lastIndex=0,Y=Y.slice(-1*U.length+Le);(te=Et.exec(Y))!=null;)if(Te=te[1]||te[2]||te[3]||te[4]||te[5]||te[6],!!Te){if(We=Te.length,te[3]||te[4]){je+=We;continue}else if((te[5]||te[6])&&Le%3&&!((Le+We)%3)){mt+=We;continue}if(je-=We,!(je>0)){if(We=Math.min(We,We+je+mt),Math.min(Le,We)%2){var At=U.slice(1,Le+te.index+We);return{type:"em",raw:U.slice(0,Le+te.index+We+1),text:At,tokens:this.lexer.inlineTokens(At)}}var Je=U.slice(2,Le+te.index+We-1);return{type:"strong",raw:U.slice(0,Le+te.index+We+1),text:Je,tokens:this.lexer.inlineTokens(Je)}}}}}},ie.codespan=function(U){var Y=this.rules.inline.code.exec(U);if(Y){var oe=Y[2].replace(/\n/g," "),te=/[^ ]/.test(oe),we=/^ /.test(oe)&&/ $/.test(oe);return te&&we&&(oe=oe.substring(1,oe.length-1)),oe=p(oe,!0),{type:"codespan",raw:Y[0],text:oe}}},ie.br=function(U){var Y=this.rules.inline.br.exec(U);if(Y)return{type:"br",raw:Y[0]}},ie.del=function(U){var Y=this.rules.inline.del.exec(U);if(Y)return{type:"del",raw:Y[0],text:Y[2],tokens:this.lexer.inlineTokens(Y[2])}},ie.autolink=function(U,Y){var oe=this.rules.inline.autolink.exec(U);if(oe){var te,we;return oe[2]==="@"?(te=p(this.options.mangle?Y(oe[1]):oe[1]),we="mailto:"+te):(te=p(oe[1]),we=te),{type:"link",raw:oe[0],text:te,href:we,tokens:[{type:"text",raw:te,text:te}]}}},ie.url=function(U,Y){var oe;if(oe=this.rules.inline.url.exec(U)){var te,we;if(oe[2]==="@")te=p(this.options.mangle?Y(oe[0]):oe[0]),we="mailto:"+te;else{var Le;do Le=oe[0],oe[0]=this.rules.inline._backpedal.exec(oe[0])[0];while(Le!==oe[0]);te=p(oe[0]),oe[1]==="www."?we="http://"+te:we=te}return{type:"link",raw:oe[0],text:te,href:we,tokens:[{type:"text",raw:te,text:te}]}}},ie.inlineText=function(U,Y){var oe=this.rules.inline.text.exec(U);if(oe){var te;return this.lexer.state.inRawBlock?te=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(oe[0]):p(oe[0]):oe[0]:te=p(this.options.smartypants?Y(oe[0]):oe[0]),{type:"text",raw:oe[0],text:te}}},re}(),G={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr:/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *(?:\n *)?]+)>?(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:P,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/};G._label=/(?!\s*\])(?:\\.|[^\[\]\\])+/,G._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,G.def=w(G.def).replace("label",G._label).replace("title",G._title).getRegex(),G.bullet=/(?:[*+-]|\d{1,9}[.)])/,G.listItemStart=w(/^( *)(bull) */).replace("bull",G.bullet).getRegex(),G.list=w(G.list).replace(/bull/g,G.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+G.def.source+")").getRegex(),G._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",G._comment=/|$)/,G.html=w(G.html,"i").replace("comment",G._comment).replace("tag",G._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),G.paragraph=w(G._paragraph).replace("hr",G.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",G._tag).getRegex(),G.blockquote=w(G.blockquote).replace("paragraph",G.paragraph).getRegex(),G.normal=N({},G),G.gfm=N({},G.normal,{table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),G.gfm.table=w(G.gfm.table).replace("hr",G.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",G._tag).getRegex(),G.gfm.paragraph=w(G._paragraph).replace("hr",G.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("table",G.gfm.table).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",G._tag).getRegex(),G.pedantic=N({},G.normal,{html:w(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",G._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:P,paragraph:w(G.normal._paragraph).replace("hr",G.hr).replace("heading",` *#{1,6} *[^ -]`).replace("lheading",G.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var X={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:P,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/^[^_*]*?\_\_[^_*]*?\*[^_*]*?(?=\_\_)|[^*]+(?=[^*])|[punct_](\*+)(?=[\s]|$)|[^punct*_\s](\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|[^punct*_\s](\*+)(?=[^punct*_\s])/,rDelimUnd:/^[^_*]*?\*\*[^_*]*?\_[^_*]*?(?=\*\*)|[^_]+(?=[^_])|[punct*](\_+)(?=[\s]|$)|[^punct*_\s](\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:P,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~",X.punctuation=w(X.punctuation).replace(/punctuation/g,X._punctuation).getRegex(),X.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,X.escapedEmSt=/\\\*|\\_/g,X._comment=w(G._comment).replace("(?:-->|$)","-->").getRegex(),X.emStrong.lDelim=w(X.emStrong.lDelim).replace(/punct/g,X._punctuation).getRegex(),X.emStrong.rDelimAst=w(X.emStrong.rDelimAst,"g").replace(/punct/g,X._punctuation).getRegex(),X.emStrong.rDelimUnd=w(X.emStrong.rDelimUnd,"g").replace(/punct/g,X._punctuation).getRegex(),X._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,X._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,X._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,X.autolink=w(X.autolink).replace("scheme",X._scheme).replace("email",X._email).getRegex(),X._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,X.tag=w(X.tag).replace("comment",X._comment).replace("attribute",X._attribute).getRegex(),X._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,X._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,X._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,X.link=w(X.link).replace("label",X._label).replace("href",X._href).replace("title",X._title).getRegex(),X.reflink=w(X.reflink).replace("label",X._label).replace("ref",G._label).getRegex(),X.nolink=w(X.nolink).replace("ref",G._label).getRegex(),X.reflinkSearch=w(X.reflinkSearch,"g").replace("reflink",X.reflink).replace("nolink",X.nolink).getRegex(),X.normal=N({},X),X.pedantic=N({},X.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:w(/^!?\[(label)\]\((.*?)\)/).replace("label",X._label).getRegex(),reflink:w(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",X._label).getRegex()}),X.gfm=N({},X.normal,{escape:w(X.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\.5&&(U="x"+U.toString(16)),ie+="&#"+U+";";return ie}var pe=function(){function re(se){this.tokens=[],this.tokens.links=Object.create(null),this.options=se||e.defaults,this.options.tokenizer=this.options.tokenizer||new j,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};var U={block:G.normal,inline:X.normal};this.options.pedantic?(U.block=G.pedantic,U.inline=X.pedantic):this.options.gfm&&(U.block=G.gfm,this.options.breaks?U.inline=X.breaks:U.inline=X.gfm),this.tokenizer.rules=U}re.lex=function(U,Y){var oe=new re(Y);return oe.lex(U)},re.lexInline=function(U,Y){var oe=new re(Y);return oe.inlineTokens(U)};var ie=re.prototype;return ie.lex=function(U){U=U.replace(/\r\n|\r/g,` -`),this.blockTokens(U,this.tokens);for(var Y;Y=this.inlineQueue.shift();)this.inlineTokens(Y.src,Y.tokens);return this.tokens},ie.blockTokens=function(U,Y){var oe=this;Y===void 0&&(Y=[]),this.options.pedantic?U=U.replace(/\t/g," ").replace(/^ +$/gm,""):U=U.replace(/^( *)(\t+)/gm,function(je,mt,Et){return mt+" ".repeat(Et.length)});for(var te,we,Le,Te;U;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(function(je){return(te=je.call({lexer:oe},U,Y))?(U=U.substring(te.raw.length),Y.push(te),!0):!1}))){if(te=this.tokenizer.space(U)){U=U.substring(te.raw.length),te.raw.length===1&&Y.length>0?Y[Y.length-1].raw+=` -`:Y.push(te);continue}if(te=this.tokenizer.code(U)){U=U.substring(te.raw.length),we=Y[Y.length-1],we&&(we.type==="paragraph"||we.type==="text")?(we.raw+=` -`+te.raw,we.text+=` -`+te.text,this.inlineQueue[this.inlineQueue.length-1].src=we.text):Y.push(te);continue}if(te=this.tokenizer.fences(U)){U=U.substring(te.raw.length),Y.push(te);continue}if(te=this.tokenizer.heading(U)){U=U.substring(te.raw.length),Y.push(te);continue}if(te=this.tokenizer.hr(U)){U=U.substring(te.raw.length),Y.push(te);continue}if(te=this.tokenizer.blockquote(U)){U=U.substring(te.raw.length),Y.push(te);continue}if(te=this.tokenizer.list(U)){U=U.substring(te.raw.length),Y.push(te);continue}if(te=this.tokenizer.html(U)){U=U.substring(te.raw.length),Y.push(te);continue}if(te=this.tokenizer.def(U)){U=U.substring(te.raw.length),we=Y[Y.length-1],we&&(we.type==="paragraph"||we.type==="text")?(we.raw+=` -`+te.raw,we.text+=` -`+te.raw,this.inlineQueue[this.inlineQueue.length-1].src=we.text):this.tokens.links[te.tag]||(this.tokens.links[te.tag]={href:te.href,title:te.title});continue}if(te=this.tokenizer.table(U)){U=U.substring(te.raw.length),Y.push(te);continue}if(te=this.tokenizer.lheading(U)){U=U.substring(te.raw.length),Y.push(te);continue}if(Le=U,this.options.extensions&&this.options.extensions.startBlock&&function(){var je=1/0,mt=U.slice(1),Et=void 0;oe.options.extensions.startBlock.forEach(function(At){Et=At.call({lexer:this},mt),typeof Et=="number"&&Et>=0&&(je=Math.min(je,Et))}),je<1/0&&je>=0&&(Le=U.substring(0,je+1))}(),this.state.top&&(te=this.tokenizer.paragraph(Le))){we=Y[Y.length-1],Te&&we.type==="paragraph"?(we.raw+=` -`+te.raw,we.text+=` -`+te.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=we.text):Y.push(te),Te=Le.length!==U.length,U=U.substring(te.raw.length);continue}if(te=this.tokenizer.text(U)){U=U.substring(te.raw.length),we=Y[Y.length-1],we&&we.type==="text"?(we.raw+=` -`+te.raw,we.text+=` -`+te.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=we.text):Y.push(te);continue}if(U){var We="Infinite loop on byte: "+U.charCodeAt(0);if(this.options.silent){console.error(We);break}else throw new Error(We)}}return this.state.top=!0,Y},ie.inline=function(U,Y){return Y===void 0&&(Y=[]),this.inlineQueue.push({src:U,tokens:Y}),Y},ie.inlineTokens=function(U,Y){var oe=this;Y===void 0&&(Y=[]);var te,we,Le,Te=U,We,je,mt;if(this.tokens.links){var Et=Object.keys(this.tokens.links);if(Et.length>0)for(;(We=this.tokenizer.rules.inline.reflinkSearch.exec(Te))!=null;)Et.includes(We[0].slice(We[0].lastIndexOf("[")+1,-1))&&(Te=Te.slice(0,We.index)+"["+$("a",We[0].length-2)+"]"+Te.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(We=this.tokenizer.rules.inline.blockSkip.exec(Te))!=null;)Te=Te.slice(0,We.index)+"["+$("a",We[0].length-2)+"]"+Te.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(We=this.tokenizer.rules.inline.escapedEmSt.exec(Te))!=null;)Te=Te.slice(0,We.index)+"++"+Te.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);for(;U;)if(je||(mt=""),je=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(function(Je){return(te=Je.call({lexer:oe},U,Y))?(U=U.substring(te.raw.length),Y.push(te),!0):!1}))){if(te=this.tokenizer.escape(U)){U=U.substring(te.raw.length),Y.push(te);continue}if(te=this.tokenizer.tag(U)){U=U.substring(te.raw.length),we=Y[Y.length-1],we&&te.type==="text"&&we.type==="text"?(we.raw+=te.raw,we.text+=te.text):Y.push(te);continue}if(te=this.tokenizer.link(U)){U=U.substring(te.raw.length),Y.push(te);continue}if(te=this.tokenizer.reflink(U,this.tokens.links)){U=U.substring(te.raw.length),we=Y[Y.length-1],we&&te.type==="text"&&we.type==="text"?(we.raw+=te.raw,we.text+=te.text):Y.push(te);continue}if(te=this.tokenizer.emStrong(U,Te,mt)){U=U.substring(te.raw.length),Y.push(te);continue}if(te=this.tokenizer.codespan(U)){U=U.substring(te.raw.length),Y.push(te);continue}if(te=this.tokenizer.br(U)){U=U.substring(te.raw.length),Y.push(te);continue}if(te=this.tokenizer.del(U)){U=U.substring(te.raw.length),Y.push(te);continue}if(te=this.tokenizer.autolink(U,he)){U=U.substring(te.raw.length),Y.push(te);continue}if(!this.state.inLink&&(te=this.tokenizer.url(U,he))){U=U.substring(te.raw.length),Y.push(te);continue}if(Le=U,this.options.extensions&&this.options.extensions.startInline&&function(){var Je=1/0,xt=U.slice(1),Ot=void 0;oe.options.extensions.startInline.forEach(function(Vn){Ot=Vn.call({lexer:this},xt),typeof Ot=="number"&&Ot>=0&&(Je=Math.min(Je,Ot))}),Je<1/0&&Je>=0&&(Le=U.substring(0,Je+1))}(),te=this.tokenizer.inlineText(Le,de)){U=U.substring(te.raw.length),te.raw.slice(-1)!=="_"&&(mt=te.raw.slice(-1)),je=!0,we=Y[Y.length-1],we&&we.type==="text"?(we.raw+=te.raw,we.text+=te.text):Y.push(te);continue}if(U){var At="Infinite loop on byte: "+U.charCodeAt(0);if(this.options.silent){console.error(At);break}else throw new Error(At)}}return Y},n(re,null,[{key:"rules",get:function(){return{block:G,inline:X}}}]),re}(),be=function(){function re(se){this.options=se||e.defaults}var ie=re.prototype;return ie.code=function(U,Y,oe){var te=(Y||"").match(/\S*/)[0];if(this.options.highlight){var we=this.options.highlight(U,te);we!=null&&we!==U&&(oe=!0,U=we)}return U=U.replace(/\n$/,"")+` +`,U=U.substring(At.length+1)}Et.loose||(je?Et.loose=!0:/\n *\n *$/.test(oe)&&(je=!0)),this.options.gfm&&(te=/^\[[ xX]\] /.exec(Je),te&&(ye=te[0]!=="[ ] ",Je=Je.replace(/^\[[ xX]\] +/,""))),Et.items.push({type:"list_item",raw:oe,task:!!te,checked:ye,loose:!1,text:Je}),Et.raw+=oe}Et.items[Et.items.length-1].raw=oe.trimRight(),Et.items[Et.items.length-1].text=Je.trimRight(),Et.raw=Et.raw.trimRight();var Pt=Et.items.length;for(Te=0;Te1)return!0}return!1});!Et.loose&&qt.length&&Nt&&(Et.loose=!0,Et.items[Te].loose=!0)}return Et}},ie.html=function(U){var Y=this.rules.block.html.exec(U);if(Y){var oe={type:"html",raw:Y[0],pre:!this.options.sanitizer&&(Y[1]==="pre"||Y[1]==="script"||Y[1]==="style"),text:Y[0]};if(this.options.sanitize){var te=this.options.sanitizer?this.options.sanitizer(Y[0]):p(Y[0]);oe.type="paragraph",oe.text=te,oe.tokens=this.lexer.inline(te)}return oe}},ie.def=function(U){var Y=this.rules.block.def.exec(U);if(Y){Y[3]&&(Y[3]=Y[3].substring(1,Y[3].length-1));var oe=Y[1].toLowerCase().replace(/\s+/g," ");return{type:"def",tag:oe,raw:Y[0],href:Y[2],title:Y[3]}}},ie.table=function(U){var Y=this.rules.block.table.exec(U);if(Y){var oe={type:"table",header:M(Y[1]).map(function(je){return{text:je}}),align:Y[2].replace(/^ *|\| *$/g,"").split(/ *\| */),rows:Y[3]&&Y[3].trim()?Y[3].replace(/\n[ \t]*$/,"").split(` +`):[]};if(oe.header.length===oe.align.length){oe.raw=Y[0];var te=oe.align.length,ye,Le,Te,We;for(ye=0;ye/i.test(Y[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(Y[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(Y[0])&&(this.lexer.state.inRawBlock=!1),{type:this.options.sanitize?"text":"html",raw:Y[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(Y[0]):p(Y[0]):Y[0]}},ie.link=function(U){var Y=this.rules.inline.link.exec(U);if(Y){var oe=Y[2].trim();if(!this.options.pedantic&&/^$/.test(oe))return;var te=H(oe.slice(0,-1),"\\");if((oe.length-te.length)%2===0)return}else{var ye=B(Y[2],"()");if(ye>-1){var Le=Y[0].indexOf("!")===0?5:4,Te=Le+Y[1].length+ye;Y[2]=Y[2].substring(0,ye),Y[0]=Y[0].substring(0,Te).trim(),Y[3]=""}}var We=Y[2],je="";if(this.options.pedantic){var mt=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(We);mt&&(We=mt[1],je=mt[3])}else je=Y[3]?Y[3].slice(1,-1):"";return We=We.trim(),/^$/.test(oe)?We=We.slice(1):We=We.slice(1,-1)),z(Y,{href:We&&We.replace(this.rules.inline._escapes,"$1"),title:je&&je.replace(this.rules.inline._escapes,"$1")},Y[0],this.lexer)}},ie.reflink=function(U,Y){var oe;if((oe=this.rules.inline.reflink.exec(U))||(oe=this.rules.inline.nolink.exec(U))){var te=(oe[2]||oe[1]).replace(/\s+/g," ");if(te=Y[te.toLowerCase()],!te||!te.href){var ye=oe[0].charAt(0);return{type:"text",raw:ye,text:ye}}return z(oe,te,oe[0],this.lexer)}},ie.emStrong=function(U,Y,oe){oe===void 0&&(oe="");var te=this.rules.inline.emStrong.lDelim.exec(U);if(!!te&&!(te[3]&&oe.match(/(?:[0-9A-Za-z\xAA\xB2\xB3\xB5\xB9\xBA\xBC-\xBE\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u0660-\u0669\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0966-\u096F\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09E6-\u09F1\u09F4-\u09F9\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A66-\u0A6F\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AE6-\u0AEF\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B66-\u0B6F\u0B71-\u0B77\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0BE6-\u0BF2\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C66-\u0C6F\u0C78-\u0C7E\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CE6-\u0CEF\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D58-\u0D61\u0D66-\u0D78\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DE6-\u0DEF\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F20-\u0F33\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F-\u1049\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u1090-\u1099\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1369-\u137C\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A16\u1A20-\u1A54\u1A80-\u1A89\u1A90-\u1A99\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B50-\u1B59\u1B83-\u1BA0\u1BAE-\u1BE5\u1C00-\u1C23\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2070\u2071\u2074-\u2079\u207F-\u2089\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2150-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2CFD\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u3192-\u3195\u31A0-\u31BF\u31F0-\u31FF\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA830-\uA835\uA840-\uA873\uA882-\uA8B3\uA8D0-\uA8D9\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA900-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF-\uA9D9\uA9E0-\uA9E4\uA9E6-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA50-\uAA59\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDE80-\uDE9C\uDEA0-\uDED0\uDEE1-\uDEFB\uDF00-\uDF23\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC58-\uDC76\uDC79-\uDC9E\uDCA7-\uDCAF\uDCE0-\uDCF2\uDCF4\uDCF5\uDCFB-\uDD1B\uDD20-\uDD39\uDD80-\uDDB7\uDDBC-\uDDCF\uDDD2-\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE40-\uDE48\uDE60-\uDE7E\uDE80-\uDE9F\uDEC0-\uDEC7\uDEC9-\uDEE4\uDEEB-\uDEEF\uDF00-\uDF35\uDF40-\uDF55\uDF58-\uDF72\uDF78-\uDF91\uDFA9-\uDFAF]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDCFA-\uDD23\uDD30-\uDD39\uDE60-\uDE7E\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF27\uDF30-\uDF45\uDF51-\uDF54\uDF70-\uDF81\uDFB0-\uDFCB\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC52-\uDC6F\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD03-\uDD26\uDD36-\uDD3F\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDD0-\uDDDA\uDDDC\uDDE1-\uDDF4\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDEF0-\uDEF9\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC50-\uDC59\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE50-\uDE59\uDE80-\uDEAA\uDEB8\uDEC0-\uDEC9\uDF00-\uDF1A\uDF30-\uDF3B\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCF2\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDD50-\uDD59\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC50-\uDC6C\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD50-\uDD59\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDDA0-\uDDA9\uDEE0-\uDEF2\uDFB0\uDFC0-\uDFD4]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDE70-\uDEBE\uDEC0-\uDEC9\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF50-\uDF59\uDF5B-\uDF61\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE96\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD834[\uDEE0-\uDEF3\uDF60-\uDF78]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD837[\uDF00-\uDF1E]|\uD838[\uDD00-\uDD2C\uDD37-\uDD3D\uDD40-\uDD49\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB\uDEF0-\uDEF9]|\uD839[\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDCC7-\uDCCF\uDD00-\uDD43\uDD4B\uDD50-\uDD59]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4\uDD01-\uDD2D\uDD2F-\uDD3D\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD83C[\uDD00-\uDD0C]|\uD83E[\uDFF0-\uDFF9]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF38\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A])/))){var ye=te[1]||te[2]||"";if(!ye||ye&&(oe===""||this.rules.inline.punctuation.exec(oe))){var Le=te[0].length-1,Te,We,je=Le,mt=0,Dt=te[0][0]==="*"?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(Dt.lastIndex=0,Y=Y.slice(-1*U.length+Le);(te=Dt.exec(Y))!=null;)if(Te=te[1]||te[2]||te[3]||te[4]||te[5]||te[6],!!Te){if(We=Te.length,te[3]||te[4]){je+=We;continue}else if((te[5]||te[6])&&Le%3&&!((Le+We)%3)){mt+=We;continue}if(je-=We,!(je>0)){if(We=Math.min(We,We+je+mt),Math.min(Le,We)%2){var At=U.slice(1,Le+te.index+We);return{type:"em",raw:U.slice(0,Le+te.index+We+1),text:At,tokens:this.lexer.inlineTokens(At)}}var Je=U.slice(2,Le+te.index+We-1);return{type:"strong",raw:U.slice(0,Le+te.index+We+1),text:Je,tokens:this.lexer.inlineTokens(Je)}}}}}},ie.codespan=function(U){var Y=this.rules.inline.code.exec(U);if(Y){var oe=Y[2].replace(/\n/g," "),te=/[^ ]/.test(oe),ye=/^ /.test(oe)&&/ $/.test(oe);return te&&ye&&(oe=oe.substring(1,oe.length-1)),oe=p(oe,!0),{type:"codespan",raw:Y[0],text:oe}}},ie.br=function(U){var Y=this.rules.inline.br.exec(U);if(Y)return{type:"br",raw:Y[0]}},ie.del=function(U){var Y=this.rules.inline.del.exec(U);if(Y)return{type:"del",raw:Y[0],text:Y[2],tokens:this.lexer.inlineTokens(Y[2])}},ie.autolink=function(U,Y){var oe=this.rules.inline.autolink.exec(U);if(oe){var te,ye;return oe[2]==="@"?(te=p(this.options.mangle?Y(oe[1]):oe[1]),ye="mailto:"+te):(te=p(oe[1]),ye=te),{type:"link",raw:oe[0],text:te,href:ye,tokens:[{type:"text",raw:te,text:te}]}}},ie.url=function(U,Y){var oe;if(oe=this.rules.inline.url.exec(U)){var te,ye;if(oe[2]==="@")te=p(this.options.mangle?Y(oe[0]):oe[0]),ye="mailto:"+te;else{var Le;do Le=oe[0],oe[0]=this.rules.inline._backpedal.exec(oe[0])[0];while(Le!==oe[0]);te=p(oe[0]),oe[1]==="www."?ye="http://"+te:ye=te}return{type:"link",raw:oe[0],text:te,href:ye,tokens:[{type:"text",raw:te,text:te}]}}},ie.inlineText=function(U,Y){var oe=this.rules.inline.text.exec(U);if(oe){var te;return this.lexer.state.inRawBlock?te=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(oe[0]):p(oe[0]):oe[0]:te=p(this.options.smartypants?Y(oe[0]):oe[0]),{type:"text",raw:oe[0],text:te}}},re}(),G={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr:/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *(?:\n *)?]+)>?(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:P,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/};G._label=/(?!\s*\])(?:\\.|[^\[\]\\])+/,G._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,G.def=y(G.def).replace("label",G._label).replace("title",G._title).getRegex(),G.bullet=/(?:[*+-]|\d{1,9}[.)])/,G.listItemStart=y(/^( *)(bull) */).replace("bull",G.bullet).getRegex(),G.list=y(G.list).replace(/bull/g,G.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+G.def.source+")").getRegex(),G._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",G._comment=/|$)/,G.html=y(G.html,"i").replace("comment",G._comment).replace("tag",G._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),G.paragraph=y(G._paragraph).replace("hr",G.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",G._tag).getRegex(),G.blockquote=y(G.blockquote).replace("paragraph",G.paragraph).getRegex(),G.normal=N({},G),G.gfm=N({},G.normal,{table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),G.gfm.table=y(G.gfm.table).replace("hr",G.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",G._tag).getRegex(),G.gfm.paragraph=y(G._paragraph).replace("hr",G.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("table",G.gfm.table).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",G._tag).getRegex(),G.pedantic=N({},G.normal,{html:y(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",G._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:P,paragraph:y(G.normal._paragraph).replace("hr",G.hr).replace("heading",` *#{1,6} *[^ +]`).replace("lheading",G.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var X={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:P,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/^[^_*]*?\_\_[^_*]*?\*[^_*]*?(?=\_\_)|[^*]+(?=[^*])|[punct_](\*+)(?=[\s]|$)|[^punct*_\s](\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|[^punct*_\s](\*+)(?=[^punct*_\s])/,rDelimUnd:/^[^_*]*?\*\*[^_*]*?\_[^_*]*?(?=\*\*)|[^_]+(?=[^_])|[punct*](\_+)(?=[\s]|$)|[^punct*_\s](\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:P,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~",X.punctuation=y(X.punctuation).replace(/punctuation/g,X._punctuation).getRegex(),X.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,X.escapedEmSt=/\\\*|\\_/g,X._comment=y(G._comment).replace("(?:-->|$)","-->").getRegex(),X.emStrong.lDelim=y(X.emStrong.lDelim).replace(/punct/g,X._punctuation).getRegex(),X.emStrong.rDelimAst=y(X.emStrong.rDelimAst,"g").replace(/punct/g,X._punctuation).getRegex(),X.emStrong.rDelimUnd=y(X.emStrong.rDelimUnd,"g").replace(/punct/g,X._punctuation).getRegex(),X._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,X._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,X._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,X.autolink=y(X.autolink).replace("scheme",X._scheme).replace("email",X._email).getRegex(),X._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,X.tag=y(X.tag).replace("comment",X._comment).replace("attribute",X._attribute).getRegex(),X._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,X._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,X._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,X.link=y(X.link).replace("label",X._label).replace("href",X._href).replace("title",X._title).getRegex(),X.reflink=y(X.reflink).replace("label",X._label).replace("ref",G._label).getRegex(),X.nolink=y(X.nolink).replace("ref",G._label).getRegex(),X.reflinkSearch=y(X.reflinkSearch,"g").replace("reflink",X.reflink).replace("nolink",X.nolink).getRegex(),X.normal=N({},X),X.pedantic=N({},X.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:y(/^!?\[(label)\]\((.*?)\)/).replace("label",X._label).getRegex(),reflink:y(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",X._label).getRegex()}),X.gfm=N({},X.normal,{escape:y(X.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\.5&&(U="x"+U.toString(16)),ie+="&#"+U+";";return ie}var pe=function(){function re(se){this.tokens=[],this.tokens.links=Object.create(null),this.options=se||e.defaults,this.options.tokenizer=this.options.tokenizer||new j,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};var U={block:G.normal,inline:X.normal};this.options.pedantic?(U.block=G.pedantic,U.inline=X.pedantic):this.options.gfm&&(U.block=G.gfm,this.options.breaks?U.inline=X.breaks:U.inline=X.gfm),this.tokenizer.rules=U}re.lex=function(U,Y){var oe=new re(Y);return oe.lex(U)},re.lexInline=function(U,Y){var oe=new re(Y);return oe.inlineTokens(U)};var ie=re.prototype;return ie.lex=function(U){U=U.replace(/\r\n|\r/g,` +`),this.blockTokens(U,this.tokens);for(var Y;Y=this.inlineQueue.shift();)this.inlineTokens(Y.src,Y.tokens);return this.tokens},ie.blockTokens=function(U,Y){var oe=this;Y===void 0&&(Y=[]),this.options.pedantic?U=U.replace(/\t/g," ").replace(/^ +$/gm,""):U=U.replace(/^( *)(\t+)/gm,function(je,mt,Dt){return mt+" ".repeat(Dt.length)});for(var te,ye,Le,Te;U;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(function(je){return(te=je.call({lexer:oe},U,Y))?(U=U.substring(te.raw.length),Y.push(te),!0):!1}))){if(te=this.tokenizer.space(U)){U=U.substring(te.raw.length),te.raw.length===1&&Y.length>0?Y[Y.length-1].raw+=` +`:Y.push(te);continue}if(te=this.tokenizer.code(U)){U=U.substring(te.raw.length),ye=Y[Y.length-1],ye&&(ye.type==="paragraph"||ye.type==="text")?(ye.raw+=` +`+te.raw,ye.text+=` +`+te.text,this.inlineQueue[this.inlineQueue.length-1].src=ye.text):Y.push(te);continue}if(te=this.tokenizer.fences(U)){U=U.substring(te.raw.length),Y.push(te);continue}if(te=this.tokenizer.heading(U)){U=U.substring(te.raw.length),Y.push(te);continue}if(te=this.tokenizer.hr(U)){U=U.substring(te.raw.length),Y.push(te);continue}if(te=this.tokenizer.blockquote(U)){U=U.substring(te.raw.length),Y.push(te);continue}if(te=this.tokenizer.list(U)){U=U.substring(te.raw.length),Y.push(te);continue}if(te=this.tokenizer.html(U)){U=U.substring(te.raw.length),Y.push(te);continue}if(te=this.tokenizer.def(U)){U=U.substring(te.raw.length),ye=Y[Y.length-1],ye&&(ye.type==="paragraph"||ye.type==="text")?(ye.raw+=` +`+te.raw,ye.text+=` +`+te.raw,this.inlineQueue[this.inlineQueue.length-1].src=ye.text):this.tokens.links[te.tag]||(this.tokens.links[te.tag]={href:te.href,title:te.title});continue}if(te=this.tokenizer.table(U)){U=U.substring(te.raw.length),Y.push(te);continue}if(te=this.tokenizer.lheading(U)){U=U.substring(te.raw.length),Y.push(te);continue}if(Le=U,this.options.extensions&&this.options.extensions.startBlock&&function(){var je=1/0,mt=U.slice(1),Dt=void 0;oe.options.extensions.startBlock.forEach(function(At){Dt=At.call({lexer:this},mt),typeof Dt=="number"&&Dt>=0&&(je=Math.min(je,Dt))}),je<1/0&&je>=0&&(Le=U.substring(0,je+1))}(),this.state.top&&(te=this.tokenizer.paragraph(Le))){ye=Y[Y.length-1],Te&&ye.type==="paragraph"?(ye.raw+=` +`+te.raw,ye.text+=` +`+te.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=ye.text):Y.push(te),Te=Le.length!==U.length,U=U.substring(te.raw.length);continue}if(te=this.tokenizer.text(U)){U=U.substring(te.raw.length),ye=Y[Y.length-1],ye&&ye.type==="text"?(ye.raw+=` +`+te.raw,ye.text+=` +`+te.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=ye.text):Y.push(te);continue}if(U){var We="Infinite loop on byte: "+U.charCodeAt(0);if(this.options.silent){console.error(We);break}else throw new Error(We)}}return this.state.top=!0,Y},ie.inline=function(U,Y){return Y===void 0&&(Y=[]),this.inlineQueue.push({src:U,tokens:Y}),Y},ie.inlineTokens=function(U,Y){var oe=this;Y===void 0&&(Y=[]);var te,ye,Le,Te=U,We,je,mt;if(this.tokens.links){var Dt=Object.keys(this.tokens.links);if(Dt.length>0)for(;(We=this.tokenizer.rules.inline.reflinkSearch.exec(Te))!=null;)Dt.includes(We[0].slice(We[0].lastIndexOf("[")+1,-1))&&(Te=Te.slice(0,We.index)+"["+$("a",We[0].length-2)+"]"+Te.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(We=this.tokenizer.rules.inline.blockSkip.exec(Te))!=null;)Te=Te.slice(0,We.index)+"["+$("a",We[0].length-2)+"]"+Te.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(We=this.tokenizer.rules.inline.escapedEmSt.exec(Te))!=null;)Te=Te.slice(0,We.index)+"++"+Te.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);for(;U;)if(je||(mt=""),je=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(function(Je){return(te=Je.call({lexer:oe},U,Y))?(U=U.substring(te.raw.length),Y.push(te),!0):!1}))){if(te=this.tokenizer.escape(U)){U=U.substring(te.raw.length),Y.push(te);continue}if(te=this.tokenizer.tag(U)){U=U.substring(te.raw.length),ye=Y[Y.length-1],ye&&te.type==="text"&&ye.type==="text"?(ye.raw+=te.raw,ye.text+=te.text):Y.push(te);continue}if(te=this.tokenizer.link(U)){U=U.substring(te.raw.length),Y.push(te);continue}if(te=this.tokenizer.reflink(U,this.tokens.links)){U=U.substring(te.raw.length),ye=Y[Y.length-1],ye&&te.type==="text"&&ye.type==="text"?(ye.raw+=te.raw,ye.text+=te.text):Y.push(te);continue}if(te=this.tokenizer.emStrong(U,Te,mt)){U=U.substring(te.raw.length),Y.push(te);continue}if(te=this.tokenizer.codespan(U)){U=U.substring(te.raw.length),Y.push(te);continue}if(te=this.tokenizer.br(U)){U=U.substring(te.raw.length),Y.push(te);continue}if(te=this.tokenizer.del(U)){U=U.substring(te.raw.length),Y.push(te);continue}if(te=this.tokenizer.autolink(U,fe)){U=U.substring(te.raw.length),Y.push(te);continue}if(!this.state.inLink&&(te=this.tokenizer.url(U,fe))){U=U.substring(te.raw.length),Y.push(te);continue}if(Le=U,this.options.extensions&&this.options.extensions.startInline&&function(){var Je=1/0,Lt=U.slice(1),Ot=void 0;oe.options.extensions.startInline.forEach(function(Vn){Ot=Vn.call({lexer:this},Lt),typeof Ot=="number"&&Ot>=0&&(Je=Math.min(Je,Ot))}),Je<1/0&&Je>=0&&(Le=U.substring(0,Je+1))}(),te=this.tokenizer.inlineText(Le,de)){U=U.substring(te.raw.length),te.raw.slice(-1)!=="_"&&(mt=te.raw.slice(-1)),je=!0,ye=Y[Y.length-1],ye&&ye.type==="text"?(ye.raw+=te.raw,ye.text+=te.text):Y.push(te);continue}if(U){var At="Infinite loop on byte: "+U.charCodeAt(0);if(this.options.silent){console.error(At);break}else throw new Error(At)}}return Y},n(re,null,[{key:"rules",get:function(){return{block:G,inline:X}}}]),re}(),be=function(){function re(se){this.options=se||e.defaults}var ie=re.prototype;return ie.code=function(U,Y,oe){var te=(Y||"").match(/\S*/)[0];if(this.options.highlight){var ye=this.options.highlight(U,te);ye!=null&&ye!==U&&(oe=!0,U=ye)}return U=U.replace(/\n$/,"")+` `,te?'
'+(oe?U:p(U,!0))+`
`:"
"+(oe?U:p(U,!0))+`
`},ie.blockquote=function(U){return`
`+U+`
-`},ie.html=function(U){return U},ie.heading=function(U,Y,oe,te){if(this.options.headerIds){var we=this.options.headerPrefix+te.slug(oe);return"'+U+" +`},ie.html=function(U){return U},ie.heading=function(U,Y,oe,te){if(this.options.headerIds){var ye=this.options.headerPrefix+te.slug(oe);return"'+U+" `}return""+U+" `},ie.hr=function(){return this.options.xhtml?`
`:`
-`},ie.list=function(U,Y,oe){var te=Y?"ol":"ul",we=Y&&oe!==1?' start="'+oe+'"':"";return"<"+te+we+`> +`},ie.list=function(U,Y,oe){var te=Y?"ol":"ul",ye=Y&&oe!==1?' start="'+oe+'"':"";return"<"+te+ye+`> `+U+" `},ie.listitem=function(U){return"
  • "+U+`
  • `},ie.checkbox=function(U){return" "},ie.paragraph=function(U){return"

    "+U+`

    @@ -560,29 +561,29 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho `},ie.tablerow=function(U){return` `+U+` `},ie.tablecell=function(U,Y){var oe=Y.header?"th":"td",te=Y.align?"<"+oe+' align="'+Y.align+'">':"<"+oe+">";return te+U+(" -`)},ie.strong=function(U){return""+U+""},ie.em=function(U){return""+U+""},ie.codespan=function(U){return""+U+""},ie.br=function(){return this.options.xhtml?"
    ":"
    "},ie.del=function(U){return""+U+""},ie.link=function(U,Y,oe){if(U=D(this.options.sanitize,this.options.baseUrl,U),U===null)return oe;var te='",te},ie.image=function(U,Y,oe){if(U=D(this.options.sanitize,this.options.baseUrl,U),U===null)return oe;var te=''+oe+'":">",te},ie.text=function(U){return U},re}(),Se=function(){function re(){}var ie=re.prototype;return ie.strong=function(U){return U},ie.em=function(U){return U},ie.codespan=function(U){return U},ie.del=function(U){return U},ie.html=function(U){return U},ie.text=function(U){return U},ie.link=function(U,Y,oe){return""+oe},ie.image=function(U,Y,oe){return""+oe},ie.br=function(){return""},re}(),Fe=function(){function re(){this.seen={}}var ie=re.prototype;return ie.serialize=function(U){return U.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")},ie.getNextSafeSlug=function(U,Y){var oe=U,te=0;if(this.seen.hasOwnProperty(oe)){te=this.seen[U];do te++,oe=U+"-"+te;while(this.seen.hasOwnProperty(oe))}return Y||(this.seen[U]=te,this.seen[oe]=0),oe},ie.slug=function(U,Y){Y===void 0&&(Y={});var oe=this.serialize(U);return this.getNextSafeSlug(oe,Y.dryrun)},re}(),De=function(){function re(se){this.options=se||e.defaults,this.options.renderer=this.options.renderer||new be,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Se,this.slugger=new Fe}re.parse=function(U,Y){var oe=new re(Y);return oe.parse(U)},re.parseInline=function(U,Y){var oe=new re(Y);return oe.parseInline(U)};var ie=re.prototype;return ie.parse=function(U,Y){Y===void 0&&(Y=!0);var oe="",te,we,Le,Te,We,je,mt,Et,At,Je,xt,Ot,Vn,Lt,tn,ui,cn,qn,bn,Pt=U.length;for(te=0;te0&&tn.tokens[0].type==="paragraph"?(tn.tokens[0].text=qn+" "+tn.tokens[0].text,tn.tokens[0].tokens&&tn.tokens[0].tokens.length>0&&tn.tokens[0].tokens[0].type==="text"&&(tn.tokens[0].tokens[0].text=qn+" "+tn.tokens[0].tokens[0].text)):tn.tokens.unshift({type:"text",text:qn}):Lt+=qn),Lt+=this.parse(tn.tokens,Vn),At+=this.renderer.listitem(Lt,cn,ui);oe+=this.renderer.list(At,xt,Ot);continue}case"html":{oe+=this.renderer.html(Je.text);continue}case"paragraph":{oe+=this.renderer.paragraph(this.parseInline(Je.tokens));continue}case"text":{for(At=Je.tokens?this.parseInline(Je.tokens):Je.text;te+1An error occurred:

    "+p(Te.message+"",!0)+"
    ";throw Te}try{var Le=pe.lex(re,ie);if(ie.walkTokens){if(ie.async)return Promise.all(ce.walkTokens(Le,ie.walkTokens)).then(function(){return De.parse(Le,ie)}).catch(we);ce.walkTokens(Le,ie.walkTokens)}return De.parse(Le,ie)}catch(Te){we(Te)}}ce.options=ce.setOptions=function(re){return N(ce.defaults,re),l(ce.defaults),ce},ce.getDefaults=a,ce.defaults=e.defaults,ce.use=function(){for(var re=arguments.length,ie=new Array(re),se=0;seAn error occurred:

    "+p(U.message+"",!0)+"
    ";throw U}},ce.Parser=De,ce.parser=De.parse,ce.Renderer=be,ce.TextRenderer=Se,ce.Lexer=pe,ce.lexer=pe.lex,ce.Tokenizer=j,ce.Slugger=Fe,ce.parse=ce;var Pe=ce.options,Oe=ce.setOptions,xe=ce.use,Ee=ce.walkTokens,tt=ce.parseInline,nt=ce,Qe=De.parse,Ge=pe.lex;e.Lexer=pe,e.Parser=De,e.Renderer=be,e.Slugger=Fe,e.TextRenderer=Se,e.Tokenizer=j,e.getDefaults=a,e.lexer=Ge,e.marked=ce,e.options=Pe,e.parse=nt,e.parseInline=tt,e.parser=Qe,e.setOptions=Oe,e.use=xe,e.walkTokens=Ee,Object.defineProperty(e,"__esModule",{value:!0})})})();pa.Lexer||exports.Lexer;pa.Parser||exports.Parser;pa.Renderer||exports.Renderer;pa.Slugger||exports.Slugger;pa.TextRenderer||exports.TextRenderer;pa.Tokenizer||exports.Tokenizer;pa.getDefaults||exports.getDefaults;pa.lexer||exports.lexer;var Oh=pa.marked||exports.marked;pa.options||exports.options;pa.parse||exports.parse;pa.parseInline||exports.parseInline;pa.parser||exports.parser;pa.setOptions||exports.setOptions;pa.use||exports.use;pa.walkTokens||exports.walkTokens;function Hut(i){return JSON.stringify(i,$ut)}function t$(i){let e=JSON.parse(i);return e=n$(e),e}function $ut(i,e){return e instanceof RegExp?{$mid:2,source:e.source,flags:e.flags}:e}function n$(i,e=0){if(!i||e>200)return i;if(typeof i=="object"){switch(i.$mid){case 1:return Rt.revive(i);case 2:return new RegExp(i.source,i.flags);case 17:return new Date(i.source)}if(i instanceof o5||i instanceof Uint8Array)return i;if(Array.isArray(i))for(let t=0;t{let n=[],o=[];return i&&({href:i,dimensions:n}=Rut(i),o.push(`src="${A2(i)}"`)),t&&o.push(`alt="${A2(t)}"`),e&&o.push(`title="${A2(e)}"`),n.length&&(o=o.concat(n)),""},paragraph:i=>`

    ${i}

    `,link:(i,e,t)=>typeof i!="string"?"":(i===t&&(t=R9(t)),e=typeof e=="string"?A2(R9(e)):"",i=R9(i),i=i.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'"),`
    ${t}`)});function R5(i,e={},t={}){var n,o;const r=new Be;let s=!1;const a=aX(e),l=function(m){let _;try{_=t$(decodeURIComponent(m))}catch{}return _?(_=r_e(_,w=>{if(i.uris&&i.uris[w])return Rt.revive(i.uris[w])}),encodeURIComponent(JSON.stringify(_))):m},c=function(m,_){const w=i.uris&&i.uris[m];let y=Rt.revive(w);return _?m.startsWith(hn.data+":")?m:(y||(y=Rt.parse(m)),n0e.uriToBrowserUri(y).toString(!0)):!y||Rt.parse(m).toString()===y.toString()?m:(y.query&&(y=y.with({query:l(y.query)})),y.toString())},u=new Oh.Renderer;u.image=M9.image,u.link=M9.link,u.paragraph=M9.paragraph;const d=[],h=[];if(e.codeBlockRendererSync?u.code=(m,_)=>{const w=e$.nextId(),y=e.codeBlockRendererSync(Jse(_),m);return h.push([w,y]),`
    ${WA(m)}
    `}:e.codeBlockRenderer&&(u.code=(m,_)=>{const w=e$.nextId(),y=e.codeBlockRenderer(Jse(_),m);return d.push(y.then(L=>[w,L])),`
    ${WA(m)}
    `}),e.actionHandler){const m=function(y){let L=y.target;if(!(L.tagName!=="A"&&(L=L.parentElement,!L||L.tagName!=="A")))try{let D=L.dataset.href;D&&(i.baseUri&&(D=A9(Rt.from(i.baseUri),D)),e.actionHandler.callback(D,y))}catch(D){en(D)}finally{y.preventDefault()}},_=e.actionHandler.disposables.add(new xn(a,"click")),w=e.actionHandler.disposables.add(new xn(a,"auxclick"));e.actionHandler.disposables.add(st.any(_.event,w.event)(y=>{const L=new Dc(y);!L.leftButton&&!L.middleButton||m(L)})),e.actionHandler.disposables.add(ke(a,"keydown",y=>{const L=new Pi(y);!L.equals(10)&&!L.equals(3)||m(L)}))}i.supportHtml||(t.sanitizer=m=>(i.isTrusted?m.match(/^(]+>)|(<\/\s*span>)$/):void 0)?m:"",t.sanitize=!0,t.silent=!0),t.renderer=u;let f=(n=i.value)!==null&&n!==void 0?n:"";f.length>1e5&&(f=`${f.substr(0,1e5)}\u2026`),i.supportThemeIcons&&(f=Dut(f));let g;if(e.fillInIncompleteTokens){const m=Object.assign(Object.assign({},Oh.defaults),t),_=Oh.lexer(f,m),w=Yut(_);g=Oh.parser(w,m)}else g=Oh.parse(f,t);i.supportThemeIcons&&(g=Zm(g).map(_=>typeof _=="string"?_:_.outerHTML).join(""));const v=new DOMParser().parseFromString(i$(i,g),"text/html");if(v.body.querySelectorAll("img").forEach(m=>{const _=m.getAttribute("src");if(_){let w=_;try{i.baseUri&&(w=A9(Rt.from(i.baseUri),w))}catch{}m.src=c(w,!0)}}),v.body.querySelectorAll("a").forEach(m=>{const _=m.getAttribute("href");if(m.setAttribute("href",""),!_||/^data:|javascript:/i.test(_)||/^command:/i.test(_)&&!i.isTrusted||/^command:(\/\/\/)?_workbench\.downloadResource/i.test(_))m.replaceWith(...m.childNodes);else{let w=c(_,!1);i.baseUri&&(w=A9(Rt.from(i.baseUri),_)),m.dataset.href=w}}),a.innerHTML=i$(i,v.body.innerHTML),d.length>0)Promise.all(d).then(m=>{var _,w;if(s)return;const y=new Map(m),L=a.querySelectorAll("div[data-code]");for(const D of L){const E=y.get((_=D.dataset.code)!==null&&_!==void 0?_:"");E&&jr(D,E)}(w=e.asyncRenderCallback)===null||w===void 0||w.call(e)});else if(h.length>0){const m=new Map(h),_=a.querySelectorAll("div[data-code]");for(const w of _){const y=m.get((o=w.dataset.code)!==null&&o!==void 0?o:"");y&&jr(w,y)}}if(e.asyncRenderCallback)for(const m of a.getElementsByTagName("img")){const _=r.add(ke(m,"load",()=>{_.dispose(),e.asyncRenderCallback()}))}return{element:a,dispose:()=>{s=!0,r.dispose()}}}function Jse(i){if(!i)return"";const e=i.split(/[\s+|:|,|\{|\?]/,1);return e.length?e[0]:i}function A9(i,e){return/^\w[\w\d+.-]*:/.test(e)?e:i.path.endsWith("/")?Zre(i,e).toString():Zre(y5(i),e).toString()}function i$(i,e){const{config:t,allowedSchemes:n}=Uut(i);J_e("uponSanitizeAttribute",(r,s)=>{if(s.attrName==="style"||s.attrName==="class"){if(r.tagName==="SPAN"){if(s.attrName==="style"){s.keepAttr=/^(color\:(#[0-9a-fA-F]+|var\(--vscode(-[a-zA-Z]+)+\));)?(background-color\:(#[0-9a-fA-F]+|var\(--vscode(-[a-zA-Z]+)+\));)?$/.test(s.attrValue);return}else if(s.attrName==="class"){s.keepAttr=/^codicon codicon-[a-z\-]+( codicon-modifier-[a-z\-]+)?$/.test(s.attrValue);return}}s.keepAttr=!1;return}});const o=$Qe(n);try{return Q_e(e,Object.assign(Object.assign({},t),{RETURN_TRUSTED_TYPE:!0}))}finally{e0e("uponSanitizeAttribute"),o.dispose()}}const zut=["align","autoplay","alt","class","controls","data-code","data-href","height","href","loop","muted","playsinline","poster","src","style","target","title","width","start"];function Uut(i){const e=[hn.http,hn.https,hn.mailto,hn.data,hn.file,hn.vscodeFileResource,hn.vscodeRemote,hn.vscodeRemoteResource];return i.isTrusted&&e.push(hn.command),{config:{ALLOWED_TAGS:[...zQe],ALLOWED_ATTR:zut,ALLOW_UNKNOWN_PROTOCOLS:!0},allowedSchemes:e}}function jut(i){return typeof i=="string"?i:Kut(i)}function Kut(i){var e;let t=(e=i.value)!==null&&e!==void 0?e:"";t.length>1e5&&(t=`${t.substr(0,1e5)}\u2026`);const n=Oh.parse(t,{renderer:Gut.value}).replace(/&(#\d+|[a-zA-Z]+);/g,o=>{var r;return(r=qut.get(o))!==null&&r!==void 0?r:o});return i$({isTrusted:!1},n).toString()}const qut=new Map([[""",'"'],[" "," "],["&","&"],["'","'"],["<","<"],[">",">"]]),Gut=new rh(()=>{const i=new Oh.Renderer;return i.code=e=>e,i.blockquote=e=>e,i.html=e=>"",i.heading=(e,t,n)=>e+` +`)},ie.strong=function(U){return""+U+""},ie.em=function(U){return""+U+""},ie.codespan=function(U){return""+U+""},ie.br=function(){return this.options.xhtml?"
    ":"
    "},ie.del=function(U){return""+U+""},ie.link=function(U,Y,oe){if(U=D(this.options.sanitize,this.options.baseUrl,U),U===null)return oe;var te='",te},ie.image=function(U,Y,oe){if(U=D(this.options.sanitize,this.options.baseUrl,U),U===null)return oe;var te=''+oe+'":">",te},ie.text=function(U){return U},re}(),Se=function(){function re(){}var ie=re.prototype;return ie.strong=function(U){return U},ie.em=function(U){return U},ie.codespan=function(U){return U},ie.del=function(U){return U},ie.html=function(U){return U},ie.text=function(U){return U},ie.link=function(U,Y,oe){return""+oe},ie.image=function(U,Y,oe){return""+oe},ie.br=function(){return""},re}(),Fe=function(){function re(){this.seen={}}var ie=re.prototype;return ie.serialize=function(U){return U.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")},ie.getNextSafeSlug=function(U,Y){var oe=U,te=0;if(this.seen.hasOwnProperty(oe)){te=this.seen[U];do te++,oe=U+"-"+te;while(this.seen.hasOwnProperty(oe))}return Y||(this.seen[U]=te,this.seen[oe]=0),oe},ie.slug=function(U,Y){Y===void 0&&(Y={});var oe=this.serialize(U);return this.getNextSafeSlug(oe,Y.dryrun)},re}(),De=function(){function re(se){this.options=se||e.defaults,this.options.renderer=this.options.renderer||new be,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Se,this.slugger=new Fe}re.parse=function(U,Y){var oe=new re(Y);return oe.parse(U)},re.parseInline=function(U,Y){var oe=new re(Y);return oe.parseInline(U)};var ie=re.prototype;return ie.parse=function(U,Y){Y===void 0&&(Y=!0);var oe="",te,ye,Le,Te,We,je,mt,Dt,At,Je,Lt,Ot,Vn,Et,tn,ui,cn,qn,bn,Pt=U.length;for(te=0;te0&&tn.tokens[0].type==="paragraph"?(tn.tokens[0].text=qn+" "+tn.tokens[0].text,tn.tokens[0].tokens&&tn.tokens[0].tokens.length>0&&tn.tokens[0].tokens[0].type==="text"&&(tn.tokens[0].tokens[0].text=qn+" "+tn.tokens[0].tokens[0].text)):tn.tokens.unshift({type:"text",text:qn}):Et+=qn),Et+=this.parse(tn.tokens,Vn),At+=this.renderer.listitem(Et,cn,ui);oe+=this.renderer.list(At,Lt,Ot);continue}case"html":{oe+=this.renderer.html(Je.text);continue}case"paragraph":{oe+=this.renderer.paragraph(this.parseInline(Je.tokens));continue}case"text":{for(At=Je.tokens?this.parseInline(Je.tokens):Je.text;te+1An error occurred:

    "+p(Te.message+"",!0)+"
    ";throw Te}try{var Le=pe.lex(re,ie);if(ie.walkTokens){if(ie.async)return Promise.all(ce.walkTokens(Le,ie.walkTokens)).then(function(){return De.parse(Le,ie)}).catch(ye);ce.walkTokens(Le,ie.walkTokens)}return De.parse(Le,ie)}catch(Te){ye(Te)}}ce.options=ce.setOptions=function(re){return N(ce.defaults,re),l(ce.defaults),ce},ce.getDefaults=a,ce.defaults=e.defaults,ce.use=function(){for(var re=arguments.length,ie=new Array(re),se=0;seAn error occurred:

    "+p(U.message+"",!0)+"
    ";throw U}},ce.Parser=De,ce.parser=De.parse,ce.Renderer=be,ce.TextRenderer=Se,ce.Lexer=pe,ce.lexer=pe.lex,ce.Tokenizer=j,ce.Slugger=Fe,ce.parse=ce;var Pe=ce.options,Oe=ce.setOptions,xe=ce.use,Ee=ce.walkTokens,tt=ce.parseInline,nt=ce,Qe=De.parse,Ge=pe.lex;e.Lexer=pe,e.Parser=De,e.Renderer=be,e.Slugger=Fe,e.TextRenderer=Se,e.Tokenizer=j,e.getDefaults=a,e.lexer=Ge,e.marked=ce,e.options=Pe,e.parse=nt,e.parseInline=tt,e.parser=Qe,e.setOptions=Oe,e.use=xe,e.walkTokens=Ee,Object.defineProperty(e,"__esModule",{value:!0})})})();ma.Lexer||exports.Lexer;ma.Parser||exports.Parser;ma.Renderer||exports.Renderer;ma.Slugger||exports.Slugger;ma.TextRenderer||exports.TextRenderer;ma.Tokenizer||exports.Tokenizer;ma.getDefaults||exports.getDefaults;ma.lexer||exports.lexer;var Bh=ma.marked||exports.marked;ma.options||exports.options;ma.parse||exports.parse;ma.parseInline||exports.parseInline;ma.parser||exports.parser;ma.setOptions||exports.setOptions;ma.use||exports.use;ma.walkTokens||exports.walkTokens;function qut(i){return JSON.stringify(i,Gut)}function r$(i){let e=JSON.parse(i);return e=s$(e),e}function Gut(i,e){return e instanceof RegExp?{$mid:2,source:e.source,flags:e.flags}:e}function s$(i,e=0){if(!i||e>200)return i;if(typeof i=="object"){switch(i.$mid){case 1:return Rt.revive(i);case 2:return new RegExp(i.source,i.flags);case 17:return new Date(i.source)}if(i instanceof r5||i instanceof Uint8Array)return i;if(Array.isArray(i))for(let t=0;t{let n=[],o=[];return i&&({href:i,dimensions:n}=But(i),o.push(`src="${F2(i)}"`)),t&&o.push(`alt="${F2(t)}"`),e&&o.push(`title="${F2(e)}"`),n.length&&(o=o.concat(n)),""},paragraph:i=>`

    ${i}

    `,link:(i,e,t)=>typeof i!="string"?"":(i===t&&(t=R9(t)),e=typeof e=="string"?F2(R9(e)):"",i=R9(i),i=i.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'"),`
    ${t}`)});function M5(i,e={},t={}){var n,o;const r=new Be;let s=!1;const a=gX(e),l=function(m){let _;try{_=r$(decodeURIComponent(m))}catch{}return _?(_=f_e(_,y=>{if(i.uris&&i.uris[y])return Rt.revive(i.uris[y])}),encodeURIComponent(JSON.stringify(_))):m},c=function(m,_){const y=i.uris&&i.uris[m];let w=Rt.revive(y);return _?m.startsWith(hn.data+":")?m:(w||(w=Rt.parse(m)),u0e.uriToBrowserUri(w).toString(!0)):!w||Rt.parse(m).toString()===w.toString()?m:(w.query&&(w=w.with({query:l(w.query)})),w.toString())},u=new Bh.Renderer;u.image=M9.image,u.link=M9.link,u.paragraph=M9.paragraph;const d=[],h=[];if(e.codeBlockRendererSync?u.code=(m,_)=>{const y=o$.nextId(),w=e.codeBlockRendererSync(aae(_),m);return h.push([y,w]),`
    ${$A(m)}
    `}:e.codeBlockRenderer&&(u.code=(m,_)=>{const y=o$.nextId(),w=e.codeBlockRenderer(aae(_),m);return d.push(w.then(L=>[y,L])),`
    ${$A(m)}
    `}),e.actionHandler){const m=function(w){let L=w.target;if(!(L.tagName!=="A"&&(L=L.parentElement,!L||L.tagName!=="A")))try{let D=L.dataset.href;D&&(i.baseUri&&(D=A9(Rt.from(i.baseUri),D)),e.actionHandler.callback(D,w))}catch(D){en(D)}finally{w.preventDefault()}},_=e.actionHandler.disposables.add(new xn(a,"click")),y=e.actionHandler.disposables.add(new xn(a,"auxclick"));e.actionHandler.disposables.add(st.any(_.event,y.event)(w=>{const L=new kc(w);!L.leftButton&&!L.middleButton||m(L)})),e.actionHandler.disposables.add(ke(a,"keydown",w=>{const L=new Pi(w);!L.equals(10)&&!L.equals(3)||m(L)}))}i.supportHtml||(t.sanitizer=m=>(i.isTrusted?m.match(/^(]+>)|(<\/\s*span>)$/):void 0)?m:"",t.sanitize=!0,t.silent=!0),t.renderer=u;let f=(n=i.value)!==null&&n!==void 0?n:"";f.length>1e5&&(f=`${f.substr(0,1e5)}\u2026`),i.supportThemeIcons&&(f=Mut(f));let g;if(e.fillInIncompleteTokens){const m=Object.assign(Object.assign({},Bh.defaults),t),_=Bh.lexer(f,m),y=ndt(_);g=Bh.parser(y,m)}else g=Bh.parse(f,t);i.supportThemeIcons&&(g=Qm(g).map(_=>typeof _=="string"?_:_.outerHTML).join(""));const v=new DOMParser().parseFromString(a$(i,g),"text/html");if(v.body.querySelectorAll("img").forEach(m=>{const _=m.getAttribute("src");if(_){let y=_;try{i.baseUri&&(y=A9(Rt.from(i.baseUri),y))}catch{}m.src=c(y,!0)}}),v.body.querySelectorAll("a").forEach(m=>{const _=m.getAttribute("href");if(m.setAttribute("href",""),!_||/^data:|javascript:/i.test(_)||/^command:/i.test(_)&&!i.isTrusted||/^command:(\/\/\/)?_workbench\.downloadResource/i.test(_))m.replaceWith(...m.childNodes);else{let y=c(_,!1);i.baseUri&&(y=A9(Rt.from(i.baseUri),_)),m.dataset.href=y}}),a.innerHTML=a$(i,v.body.innerHTML),d.length>0)Promise.all(d).then(m=>{var _,y;if(s)return;const w=new Map(m),L=a.querySelectorAll("div[data-code]");for(const D of L){const E=w.get((_=D.dataset.code)!==null&&_!==void 0?_:"");E&&jr(D,E)}(y=e.asyncRenderCallback)===null||y===void 0||y.call(e)});else if(h.length>0){const m=new Map(h),_=a.querySelectorAll("div[data-code]");for(const y of _){const w=m.get((o=y.dataset.code)!==null&&o!==void 0?o:"");w&&jr(y,w)}}if(e.asyncRenderCallback)for(const m of a.getElementsByTagName("img")){const _=r.add(ke(m,"load",()=>{_.dispose(),e.asyncRenderCallback()}))}return{element:a,dispose:()=>{s=!0,r.dispose()}}}function aae(i){if(!i)return"";const e=i.split(/[\s+|:|,|\{|\?]/,1);return e.length?e[0]:i}function A9(i,e){return/^\w[\w\d+.-]*:/.test(e)?e:i.path.endsWith("/")?rse(i,e).toString():rse(S5(i),e).toString()}function a$(i,e){const{config:t,allowedSchemes:n}=Yut(i);a0e("uponSanitizeAttribute",(r,s)=>{if(s.attrName==="style"||s.attrName==="class"){if(r.tagName==="SPAN"){if(s.attrName==="style"){s.keepAttr=/^(color\:(#[0-9a-fA-F]+|var\(--vscode(-[a-zA-Z]+)+\));)?(background-color\:(#[0-9a-fA-F]+|var\(--vscode(-[a-zA-Z]+)+\));)?$/.test(s.attrValue);return}else if(s.attrName==="class"){s.keepAttr=/^codicon codicon-[a-z\-]+( codicon-modifier-[a-z\-]+)?$/.test(s.attrValue);return}}s.keepAttr=!1;return}});const o=GQe(n);try{return s0e(e,Object.assign(Object.assign({},t),{RETURN_TRUSTED_TYPE:!0}))}finally{l0e("uponSanitizeAttribute"),o.dispose()}}const Xut=["align","autoplay","alt","class","controls","data-code","data-href","height","href","loop","muted","playsinline","poster","src","style","target","title","width","start"];function Yut(i){const e=[hn.http,hn.https,hn.mailto,hn.data,hn.file,hn.vscodeFileResource,hn.vscodeRemote,hn.vscodeRemoteResource];return i.isTrusted&&e.push(hn.command),{config:{ALLOWED_TAGS:[...XQe],ALLOWED_ATTR:Xut,ALLOW_UNKNOWN_PROTOCOLS:!0},allowedSchemes:e}}function Zut(i){return typeof i=="string"?i:Qut(i)}function Qut(i){var e;let t=(e=i.value)!==null&&e!==void 0?e:"";t.length>1e5&&(t=`${t.substr(0,1e5)}\u2026`);const n=Bh.parse(t,{renderer:edt.value}).replace(/&(#\d+|[a-zA-Z]+);/g,o=>{var r;return(r=Jut.get(o))!==null&&r!==void 0?r:o});return a$({isTrusted:!1},n).toString()}const Jut=new Map([[""",'"'],[" "," "],["&","&"],["'","'"],["<","<"],[">",">"]]),edt=new ah(()=>{const i=new Bh.Renderer;return i.code=e=>e,i.blockquote=e=>e,i.html=e=>"",i.heading=(e,t,n)=>e+` `,i.hr=()=>"",i.list=(e,t)=>e,i.listitem=e=>e+` `,i.paragraph=e=>e+` `,i.table=(e,t)=>e+t+` `,i.tablerow=e=>e,i.tablecell=(e,t)=>e+" ",i.strong=e=>e,i.em=e=>e,i.codespan=e=>e,i.br=()=>` -`,i.del=e=>e,i.image=(e,t,n)=>"",i.text=e=>e,i.link=(e,t,n)=>n,i});function cX(i){let e="";return i.forEach(t=>{e+=t.raw}),e}function Xut(i){for(const e of i.tokens)if(e.type==="text"){const t=e.raw.split(` -`),n=t[t.length-1];if(n.includes("`"))return Qut(i);if(n.includes("**"))return idt(i);if(n.match(/\*\w/))return Jut(i);if(n.match(/(^|\s)__\w/))return odt(i);if(n.match(/(^|\s)_\w/))return edt(i);if(n.match(/(^|\s)\[.*\]\(\w*/))return tdt(i);if(n.match(/(^|\s)\[\w/))return ndt(i)}}function Yut(i){let e,t;for(e=0;ee,i.image=(e,t,n)=>"",i.text=e=>e,i.link=(e,t,n)=>n,i});function mX(i){let e="";return i.forEach(t=>{e+=t.raw}),e}function tdt(i){for(const e of i.tokens)if(e.type==="text"){const t=e.raw.split(` +`),n=t[t.length-1];if(n.includes("`"))return odt(i);if(n.includes("**"))return cdt(i);if(n.match(/\*\w/))return rdt(i);if(n.match(/(^|\s)__\w/))return udt(i);if(n.match(/(^|\s)_\w/))return sdt(i);if(n.match(/(^|\s)\[.*\]\(\w*/))return adt(i);if(n.match(/(^|\s)\[\w/))return ldt(i)}}function ndt(i){let e,t;for(e=0;e0){const r=o?t.slice(0,-1).join(` `):e,s=!!r.match(/\|\s*$/),a=r+(s?"":"|")+` -|${" --- |".repeat(n)}`;return Oh.lexer(a)}}class sdt{constructor(e){this.spliceables=e}splice(e,t,n){this.spliceables.forEach(o=>o.splice(e,t,n))}}class q1 extends Error{constructor(e,t){super(`ListError [${e}] ${t}`)}}function eae(i,e){const t=[];for(const n of e){if(i.start>=n.range.end)continue;if(i.ende.concat(t),[]))}class tae{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!=null?e:0,this._size=this._paddingTop}splice(e,t,n=[]){const o=n.length-t,r=eae({start:0,end:e},this.groups),s=eae({start:e+t,end:Number.POSITIVE_INFINITY},this.groups).map(l=>({range:o$(l.range,o),size:l.size})),a=n.map((l,c)=>({range:{start:e+c,end:e+c+1},size:l.size}));this.groups=ldt(r,a,s),this._size=this._paddingTop+this.groups.reduce((l,c)=>l+c.size*(c.range.end-c.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 n of e)this.getRenderer(t).disposeTemplate(n.templateData),n.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}}var vp=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r};const __={CurrentDragAndDropData:void 0},ph={useShadows:!0,verticalScrollMode:1,setRowLineHeight:!0,setRowHeight:!0,supportDynamicHeights:!1,dnd:{getDragElements(i){return[i]},getDragURI(){return null},onDragStart(){},onDragOver(){return!1},drop(){},dispose(){}},horizontalScrolling:!1,transformOptimization:!0,alwaysConsumeMouseWheel:!0};class nT{constructor(e){this.elements=e}update(){}getData(){return this.elements}}class ddt{constructor(e){this.elements=e}update(){}getData(){return this.elements}}class hdt{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;to,e!=null&&e.getPosInSet?this.getPosInSet=e.getPosInSet.bind(e):this.getPosInSet=(t,n)=>n+1,e!=null&&e.getRole?this.getRole=e.getRole.bind(e):this.getRole=t=>"listitem",e!=null&&e.isChecked?this.isChecked=e.isChecked.bind(e):this.isChecked=t=>{}}}class qc{get contentHeight(){return this.rangeMap.size}get onDidScroll(){return this.scrollableElement.onScroll}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:V6(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,n,o=ph){var r,s,a,l,c,u,d,h,f,g,p,v,m;if(this.virtualDelegate=t,this.domId=`list_id_${++qc.InstanceCount}`,this.renderers=new Map,this.renderWidth=0,this._scrollHeight=0,this.scrollableElementUpdateDisposable=null,this.scrollableElementWidthDelayer=new Bu(50),this.splicing=!1,this.dragOverAnimationStopDisposable=_e.None,this.dragOverMouseY=0,this.canDrop=!1,this.currentDragFeedbackDisposable=_e.None,this.onDragLeaveTimeout=_e.None,this.disposables=new Be,this._onDidChangeContentHeight=new le,this._onDidChangeContentWidth=new le,this._horizontalScrolling=!1,o.horizontalScrolling&&o.supportDynamicHeights)throw new Error("Horizontal scrolling and dynamic heights not supported simultaneously");this.items=[],this.itemId=0,this.rangeMap=new tae((r=o.paddingTop)!==null&&r!==void 0?r:0);for(const w of n)this.renderers.set(w.templateId,w);this.cache=this.disposables.add(new udt(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 o.mouseSupport=="boolean"?o.mouseSupport:!0),this._horizontalScrolling=(s=o.horizontalScrolling)!==null&&s!==void 0?s:ph.horizontalScrolling,this.domNode.classList.toggle("horizontal-scrolling",this._horizontalScrolling),this.paddingBottom=typeof o.paddingBottom=="undefined"?0:o.paddingBottom,this.accessibilityProvider=new gdt(o.accessibilityProvider),this.rowsContainer=document.createElement("div"),this.rowsContainer.className="monaco-list-rows",((a=o.transformOptimization)!==null&&a!==void 0?a:ph.transformOptimization)&&(this.rowsContainer.style.transform="translate3d(0px, 0px, 0px)",this.rowsContainer.style.overflow="hidden",this.rowsContainer.style.contain="strict"),this.disposables.add(Ei.addTarget(this.rowsContainer)),this.scrollable=this.disposables.add(new qI({forceIntegerValues:!0,smoothScrollDuration:(l=o.smoothScrolling)!==null&&l!==void 0&&l?125:0,scheduleAtNextAnimationFrame:w=>Fc(w)})),this.scrollableElement=this.disposables.add(new xG(this.rowsContainer,{alwaysConsumeMouseWheel:(c=o.alwaysConsumeMouseWheel)!==null&&c!==void 0?c:ph.alwaysConsumeMouseWheel,horizontal:1,vertical:(u=o.verticalScrollMode)!==null&&u!==void 0?u:ph.verticalScrollMode,useShadows:(d=o.useShadows)!==null&&d!==void 0?d:ph.useShadows,mouseWheelScrollSensitivity:o.mouseWheelScrollSensitivity,fastScrollSensitivity:o.fastScrollSensitivity,scrollByPage:o.scrollByPage},this.scrollable)),this.domNode.appendChild(this.scrollableElement.getDomNode()),e.appendChild(this.domNode),this.scrollableElement.onScroll(this.onScroll,this,this.disposables),this.disposables.add(ke(this.rowsContainer,Di.Change,w=>this.onTouchChange(w))),this.disposables.add(ke(this.scrollableElement.getDomNode(),"scroll",w=>w.target.scrollTop=0)),this.disposables.add(ke(this.domNode,"dragover",w=>this.onDragOver(this.toDragEvent(w)))),this.disposables.add(ke(this.domNode,"drop",w=>this.onDrop(this.toDragEvent(w)))),this.disposables.add(ke(this.domNode,"dragleave",w=>this.onDragLeave(this.toDragEvent(w)))),this.disposables.add(ke(this.domNode,"dragend",w=>this.onDragEnd(w))),this.setRowLineHeight=(h=o.setRowLineHeight)!==null&&h!==void 0?h:ph.setRowLineHeight,this.setRowHeight=(f=o.setRowHeight)!==null&&f!==void 0?f:ph.setRowHeight,this.supportDynamicHeights=(g=o.supportDynamicHeights)!==null&&g!==void 0?g:ph.supportDynamicHeights,this.dnd=(p=o.dnd)!==null&&p!==void 0?p:this.disposables.add(ph.dnd),this.layout((v=o.initialSize)===null||v===void 0?void 0:v.height,(m=o.initialSize)===null||m===void 0?void 0:m.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=Object.assign(Object.assign({},t!=null?t:{}),{scrollByPage:e.scrollByPage})),e.mouseWheelScrollSensitivity!==void 0&&(t=Object.assign(Object.assign({},t!=null?t:{}),{mouseWheelScrollSensitivity:e.mouseWheelScrollSensitivity})),e.fastScrollSensitivity!==void 0&&(t=Object.assign(Object.assign({},t!=null?t:{}),{fastScrollSensitivity:e.fastScrollSensitivity})),t&&this.scrollableElement.updateOptions(t),e.paddingTop!==void 0&&e.paddingTop!==this.rangeMap.paddingTop){const n=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),o=e.paddingTop-this.rangeMap.paddingTop;this.rangeMap.paddingTop=e.paddingTop,this.render(n,Math.max(0,this.lastRenderTop+o),this.lastRenderHeight,void 0,void 0,!0),this.setScrollTop(this.lastRenderTop),this.eventuallyUpdateScrollDimensions(),this.supportDynamicHeights&&this._rerender(this.lastRenderTop,this.lastRenderHeight)}}splice(e,t,n=[]){if(this.splicing)throw new Error("Can't run recursive splices.");this.splicing=!0;try{return this._splice(e,t,n)}finally{this.splicing=!1,this._onDidChangeContentHeight.fire(this.contentHeight)}}_splice(e,t,n=[]){const o=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),r={start:e,end:e+t},s=hs.intersect(o,r),a=new Map;for(let D=s.end-1;D>=s.start;D--){const E=this.items[D];if(E.dragStartDisposable.dispose(),E.checkedDisposable.dispose(),E.row){let I=a.get(E.templateId);I||(I=[],a.set(E.templateId,I));const k=this.renderers.get(E.templateId);k&&k.disposeElement&&k.disposeElement(E.element,D,E.row.templateData,E.size),I.push(E.row)}E.row=null}const l={start:e+t,end:this.items.length},c=hs.intersect(l,o),u=hs.relativeComplement(l,o),d=n.map(D=>({id:String(this.itemId++),element:D,templateId:this.virtualDelegate.getTemplateId(D),size:this.virtualDelegate.getHeight(D),width:void 0,hasDynamicHeight:!!this.virtualDelegate.hasDynamicHeight&&this.virtualDelegate.hasDynamicHeight(D),lastDynamicHeightWidth:void 0,row:null,uri:void 0,dropTarget:!1,dragStartDisposable:_e.None,checkedDisposable:_e.None}));let h;e===0&&t>=this.items.length?(this.rangeMap=new tae(this.rangeMap.paddingTop),this.rangeMap.splice(0,0,d),h=this.items,this.items=d):(this.rangeMap.splice(e,t,d),h=this.items.splice(e,t,...d));const f=n.length-t,g=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),p=o$(c,f),v=hs.intersect(g,p);for(let D=v.start;Do$(D,f)),y=[{start:e,end:e+n.length},..._].map(D=>hs.intersect(g,D)),L=this.getNextToLastElement(y);for(const D of y)for(let E=D.start;ED.element)}eventuallyUpdateScrollDimensions(){this._scrollHeight=this.contentHeight,this.rowsContainer.style.height=`${this._scrollHeight}px`,this.scrollableElementUpdateDisposable||(this.scrollableElementUpdateDisposable=Fc(()=>{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!="undefined"&&(e=Math.max(e,t.width));this.scrollWidth=e,this.scrollableElement.setScrollDimensions({scrollWidth:e===0?0:e+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(){const e=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),t=this.rangeMap.positionAt(e.start),n=this.rangeMap.positionAt(e.start+1);return n!==-1&&(n-t)/2+t{for(const d of c)for(let h=d.start;ho.row.domNode.setAttribute("aria-checked",String(!!d));u(a.value),o.checkedDisposable=a.onDidChange(u)}(r||!o.row.domNode.parentElement)&&(t?this.rowsContainer.insertBefore(o.row.domNode,t):this.rowsContainer.appendChild(o.row.domNode)),this.updateItemInDOM(o,e);const l=this.renderers.get(o.templateId);if(!l)throw new Error(`No renderer found for template id ${o.templateId}`);l==null||l.renderElement(o.element,e,o.row.templateData,o.size);const c=this.dnd.getDragURI(o.element);o.dragStartDisposable.dispose(),o.row.domNode.draggable=!!c,c&&(o.dragStartDisposable=ke(o.row.domNode,"dragstart",u=>this.onDragStart(o.element,c,u))),this.horizontalScrolling&&(this.measureItemWidth(o),this.eventuallyUpdateScrollWidth())}measureItemWidth(e){if(!e.row||!e.row.domNode)return;e.row.domNode.style.width="fit-content",e.width=V6(e.row.domNode);const t=window.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 n=this.renderers.get(t.templateId);n&&n.disposeElement&&n.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})}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 st.map(this.disposables.add(new xn(this.domNode,"click")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseDblClick(){return st.map(this.disposables.add(new xn(this.domNode,"dblclick")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseMiddleClick(){return st.filter(st.map(this.disposables.add(new xn(this.domNode,"auxclick")).event,e=>this.toMouseEvent(e),this.disposables),e=>e.browserEvent.button===1,this.disposables)}get onMouseDown(){return st.map(this.disposables.add(new xn(this.domNode,"mousedown")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseOver(){return st.map(this.disposables.add(new xn(this.domNode,"mouseover")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseOut(){return st.map(this.disposables.add(new xn(this.domNode,"mouseout")).event,e=>this.toMouseEvent(e),this.disposables)}get onContextMenu(){return st.any(st.map(this.disposables.add(new xn(this.domNode,"contextmenu")).event,e=>this.toMouseEvent(e),this.disposables),st.map(this.disposables.add(new xn(this.domNode,Di.Contextmenu)).event,e=>this.toGestureEvent(e),this.disposables))}get onTouchStart(){return st.map(this.disposables.add(new xn(this.domNode,"touchstart")).event,e=>this.toTouchEvent(e),this.disposables)}get onTap(){return st.map(this.disposables.add(new xn(this.rowsContainer,Di.Tap)).event,e=>this.toGestureEvent(e),this.disposables)}toMouseEvent(e){const t=this.getItemIndexFromEventTarget(e.target||null),n=typeof t=="undefined"?void 0:this.items[t],o=n&&n.element;return{browserEvent:e,index:t,element:o}}toTouchEvent(e){const t=this.getItemIndexFromEventTarget(e.target||null),n=typeof t=="undefined"?void 0:this.items[t],o=n&&n.element;return{browserEvent:e,index:t,element:o}}toGestureEvent(e){const t=this.getItemIndexFromEventTarget(e.initialTarget||null),n=typeof t=="undefined"?void 0:this.items[t],o=n&&n.element;return{browserEvent:e,index:t,element:o}}toDragEvent(e){const t=this.getItemIndexFromEventTarget(e.target||null),n=typeof t=="undefined"?void 0:this.items[t],o=n&&n.element;return{browserEvent:e,index:t,element:o}}onScroll(e){try{const t=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight);this.render(t,e.scrollTop,e.height,e.scrollLeft,e.scrollWidth),this.supportDynamicHeights&&this._rerender(e.scrollTop,e.height,e.inSmoothScrolling)}catch(t){throw console.error("Got bad scroll event:",e),t}}onTouchChange(e){e.preventDefault(),e.stopPropagation(),this.scrollTop-=e.translationY}onDragStart(e,t,n){var o,r;if(!n.dataTransfer)return;const s=this.dnd.getDragElements(e);if(n.dataTransfer.effectAllowed="copyMove",n.dataTransfer.setData(pk.TEXT,t),n.dataTransfer.setDragImage){let a;this.dnd.getDragLabel&&(a=this.dnd.getDragLabel(s,n)),typeof a=="undefined"&&(a=String(s.length));const l=He(".monaco-drag-image");l.textContent=a;const u=(d=>{for(;d&&!d.classList.contains("monaco-workbench");)d=d.parentElement;return d||document.body})(this.domNode);u.appendChild(l),n.dataTransfer.setDragImage(l,-10,-10),setTimeout(()=>u.removeChild(l),0)}this.domNode.classList.add("dragging"),this.currentDragData=new nT(s),__.CurrentDragAndDropData=new ddt(s),(r=(o=this.dnd).onDragStart)===null||r===void 0||r.call(o,this.currentDragData,n)}onDragOver(e){var t;if(e.browserEvent.preventDefault(),this.onDragLeaveTimeout.dispose(),__.CurrentDragAndDropData&&__.CurrentDragAndDropData.getData()==="vscode-ui"||(this.setupDragAndDropScrollTopAnimation(e.browserEvent),!e.browserEvent.dataTransfer))return!1;if(!this.currentDragData)if(__.CurrentDragAndDropData)this.currentDragData=__.CurrentDragAndDropData;else{if(!e.browserEvent.dataTransfer.types)return!1;this.currentDragData=new hdt}const n=this.dnd.onDragOver(this.currentDragData,e.element,e.index,e.browserEvent);if(this.canDrop=typeof n=="boolean"?n:n.accept,!this.canDrop)return this.currentDragFeedback=void 0,this.currentDragFeedbackDisposable.dispose(),!1;e.browserEvent.dataTransfer.dropEffect=typeof n!="boolean"&&n.effect===0?"copy":"move";let o;if(typeof n!="boolean"&&n.feedback?o=n.feedback:typeof e.index=="undefined"?o=[-1]:o=[e.index],o=mv(o).filter(r=>r>=-1&&rr-s),o=o[0]===-1?[-1]:o,fdt(this.currentDragFeedback,o))return!0;if(this.currentDragFeedback=o,this.currentDragFeedbackDisposable.dispose(),o[0]===-1)this.domNode.classList.add("drop-target"),this.rowsContainer.classList.add("drop-target"),this.currentDragFeedbackDisposable=zt(()=>{this.domNode.classList.remove("drop-target"),this.rowsContainer.classList.remove("drop-target")});else{for(const r of o){const s=this.items[r];s.dropTarget=!0,(t=s.row)===null||t===void 0||t.domNode.classList.add("drop-target")}this.currentDragFeedbackDisposable=zt(()=>{var r;for(const s of o){const a=this.items[s];a.dropTarget=!1,(r=a.row)===null||r===void 0||r.domNode.classList.remove("drop-target")}})}return!0}onDragLeave(e){var t,n;this.onDragLeaveTimeout.dispose(),this.onDragLeaveTimeout=yv(()=>this.clearDragOverFeedback(),100,this.disposables),this.currentDragData&&((n=(t=this.dnd).onDragLeave)===null||n===void 0||n.call(t,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,__.CurrentDragAndDropData=void 0,!(!t||!e.browserEvent.dataTransfer)&&(e.browserEvent.preventDefault(),t.update(e.browserEvent.dataTransfer),this.dnd.drop(t,e.element,e.index,e.browserEvent))}onDragEnd(e){var t,n;this.canDrop=!1,this.teardownDragAndDropScrollTopAnimation(),this.clearDragOverFeedback(),this.domNode.classList.remove("dragging"),this.currentDragData=void 0,__.CurrentDragAndDropData=void 0,(n=(t=this.dnd).onDragEnd)===null||n===void 0||n.call(t,e)}clearDragOverFeedback(){this.currentDragFeedback=void 0,this.currentDragFeedbackDisposable.dispose(),this.currentDragFeedbackDisposable=_e.None}setupDragAndDropScrollTopAnimation(e){if(!this.dragOverAnimationDisposable){const t=o0e(this.domNode).top;this.dragOverAnimationDisposable=HQe(this.animateDragAndDropScrollTop.bind(this,t))}this.dragOverAnimationStopDisposable.dispose(),this.dragOverAnimationStopDisposable=yv(()=>{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,n=this.renderHeight-35;t<35?this.scrollTop+=Math.max(-14,Math.floor(.3*(t-35))):t>n&&(this.scrollTop+=Math.min(14,Math.floor(.3*(t-n))))}teardownDragAndDropScrollTopAnimation(){this.dragOverAnimationStopDisposable.dispose(),this.dragOverAnimationDisposable&&(this.dragOverAnimationDisposable.dispose(),this.dragOverAnimationDisposable=void 0)}getItemIndexFromEventTarget(e){const t=this.scrollableElement.getDomNode();let n=e;for(;n instanceof HTMLElement&&n!==this.rowsContainer&&t.contains(n);){const o=n.getAttribute("data-index");if(o){const r=Number(o);if(!isNaN(r))return r}n=n.parentElement}}getRenderRange(e,t){return{start:this.rangeMap.indexAt(e),end:this.rangeMap.indexAfter(e+t-1)}}_rerender(e,t,n){const o=this.getRenderRange(e,t);let r,s;e===this.elementTop(o.start)?(r=o.start,s=0):o.end-o.start>1&&(r=o.start+1,s=this.elementTop(r)-e);let a=0;for(;;){const l=this.getRenderRange(e,t);let c=!1;for(let u=l.start;u=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},nae=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};class pdt{constructor(e){this.trait=e,this.renderedElements=[]}get templateId(){return`template:${this.trait.name}`}renderTemplate(e){return e}renderElement(e,t,n){const o=this.renderedElements.findIndex(r=>r.templateData===n);if(o>=0){const r=this.renderedElements[o];this.trait.unrender(n),r.index=t}else{const r={index:t,templateData:n};this.renderedElements.push(r)}this.trait.renderIndex(t,n)}splice(e,t,n){const o=[];for(const r of this.renderedElements)r.index=e+t&&o.push({index:r.index+n-t,templateData:r.templateData});this.renderedElements=o}renderIndexes(e){for(const{index:t,templateData:n}of this.renderedElements)e.indexOf(t)>-1&&this.trait.renderIndex(t,n)}disposeTemplate(e){const t=this.renderedElements.findIndex(n=>n.templateData===e);t<0||this.renderedElements.splice(t,1)}}class TP{get name(){return this._trait}get renderer(){return new pdt(this)}constructor(e){this._trait=e,this.length=0,this.indexes=[],this.sortedIndexes=[],this._onChange=new le,this.onChange=this._onChange.event}splice(e,t,n){var o;t=Math.max(0,Math.min(t,this.length-e));const r=n.length-t,s=e+t,a=[];let l=0;for(;l=s;)a.push(this.sortedIndexes[l++]+r);const c=this.length+r;if(this.sortedIndexes.length>0&&a.length===0&&c>0){const u=(o=this.sortedIndexes.find(d=>d>=e))!==null&&o!==void 0?o:c-1;a.push(Math.min(u,c-1))}this.renderer.splice(e,t,n.length),this._set(a,a),this.length=c}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(oae),t)}_set(e,t,n){const o=this.indexes,r=this.sortedIndexes;this.indexes=e,this.sortedIndexes=t;const s=r$(r,e);return this.renderer.renderIndexes(s),this._onChange.fire({indexes:e,browserEvent:n}),o}get(){return this.indexes}contains(e){return xD(this.sortedIndexes,e,oae)>=0}dispose(){si(this._onChange)}}zb([Mo],TP.prototype,"renderer",null);class mdt extends TP{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 P9{constructor(e,t,n){this.trait=e,this.view=t,this.identityProvider=n}splice(e,t,n){if(!this.identityProvider)return this.trait.splice(e,t,new Array(n.length).fill(!1));const o=this.trait.get().map(a=>this.identityProvider.getId(this.view.element(a)).toString());if(o.length===0)return this.trait.splice(e,t,new Array(n.length).fill(!1));const r=new Set(o),s=n.map(a=>r.has(this.identityProvider.getId(a).toString()));this.trait.splice(e,t,s)}}function Qm(i){return i.tagName==="INPUT"||i.tagName==="TEXTAREA"}function UC(i){return i.classList.contains("monaco-editor")?!0:i.classList.contains("monaco-list")||!i.parentElement?!1:UC(i.parentElement)}function R1e(i){return i.tagName==="A"&&i.classList.contains("monaco-button")||i.tagName==="DIV"&&i.classList.contains("monaco-button-dropdown")?!0:i.classList.contains("monaco-list")||!i.parentElement?!1:R1e(i.parentElement)}class M1e{get onKeyDown(){return st.chain(this.disposables.add(new xn(this.view.domNode,"keydown")).event,e=>e.filter(t=>!Qm(t.target)).map(t=>new Pi(t)))}constructor(e,t,n){this.list=e,this.view=t,this.disposables=new Be,this.multipleSelectionDisposables=new Be,this.multipleSelectionSupport=n.multipleSelectionSupport,this.disposables.add(this.onKeyDown(o=>{switch(o.keyCode){case 3:return this.onEnter(o);case 16:return this.onUpArrow(o);case 18:return this.onDownArrow(o);case 11:return this.onPageUpArrow(o);case 12:return this.onPageDownArrow(o);case 9:return this.onEscape(o);case 31:this.multipleSelectionSupport&&(Nn?o.metaKey:o.ctrlKey)&&this.onCtrlA(o)}}))}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(Gs(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()}}zb([Mo],M1e.prototype,"onKeyDown",null);var Fh;(function(i){i[i.Automatic=0]="Automatic",i[i.Trigger=1]="Trigger"})(Fh||(Fh={}));var jC;(function(i){i[i.Idle=0]="Idle",i[i.Typing=1]="Typing"})(jC||(jC={}));const vdt=new class{mightProducePrintableCharacter(i){return i.ctrlKey||i.metaKey||i.altKey?!1:i.keyCode>=31&&i.keyCode<=56||i.keyCode>=21&&i.keyCode<=30||i.keyCode>=98&&i.keyCode<=107||i.keyCode>=85&&i.keyCode<=95}};class _dt{constructor(e,t,n,o,r){this.list=e,this.view=t,this.keyboardNavigationLabelProvider=n,this.keyboardNavigationEventFilter=o,this.delegate=r,this.enabled=!1,this.state=jC.Idle,this.mode=Fh.Automatic,this.triggered=!1,this.previouslyFocused=-1,this.enabledDisposables=new Be,this.disposables=new Be,this.updateOptions(e.options)}updateOptions(e){var t,n;!((t=e.typeNavigationEnabled)!==null&&t!==void 0)||t?this.enable():this.disable(),this.mode=(n=e.typeNavigationMode)!==null&&n!==void 0?n:Fh.Automatic}enable(){if(this.enabled)return;let e=!1;const t=st.chain(this.enabledDisposables.add(new xn(this.view.domNode,"keydown")).event,r=>r.filter(s=>!Qm(s.target)).filter(()=>this.mode===Fh.Automatic||this.triggered).map(s=>new Pi(s)).filter(s=>e||this.keyboardNavigationEventFilter(s)).filter(s=>this.delegate.mightProducePrintableCharacter(s)).forEach(s=>dn.stop(s,!0)).map(s=>s.browserEvent.key)),n=st.debounce(t,()=>null,800,void 0,void 0,void 0,this.enabledDisposables);st.reduce(st.any(t,n),(r,s)=>s===null?null:(r||"")+s,void 0,this.enabledDisposables)(this.onInput,this,this.enabledDisposables),n(this.onClear,this,this.enabledDisposables),t(()=>e=!0,void 0,this.enabledDisposables),n(()=>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(){var e;const t=this.list.getFocus();if(t.length>0&&t[0]===this.previouslyFocused){const n=(e=this.list.options.accessibilityProvider)===null||e===void 0?void 0:e.getAriaLabel(this.list.element(t[0]));n&&bs(n)}this.previouslyFocused=-1}onInput(e){if(!e){this.state=jC.Idle,this.triggered=!1;return}const t=this.list.getFocus(),n=t.length>0?t[0]:0,o=this.state===jC.Idle?1:0;this.state=jC.Typing;for(let r=0;r1&&c.length===1){this.previouslyFocused=n,this.list.setFocus([s]),this.list.reveal(s);return}}}else if(typeof l=="undefined"||mk(e,l)){this.previouslyFocused=n,this.list.setFocus([s]),this.list.reveal(s);return}}}dispose(){this.disable(),this.enabledDisposables.dispose(),this.disposables.dispose()}}class bdt{constructor(e,t){this.list=e,this.view=t,this.disposables=new Be;const n=st.chain(this.disposables.add(new xn(t.domNode,"keydown")).event,r=>r.filter(s=>!Qm(s.target)).map(s=>new Pi(s)));st.chain(n,r=>r.filter(s=>s.keyCode===2&&!s.ctrlKey&&!s.metaKey&&!s.shiftKey&&!s.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 n=this.view.domElement(t[0]);if(!n)return;const o=n.querySelector("[tabIndex]");if(!o||!(o instanceof HTMLElement)||o.tabIndex===-1)return;const r=window.getComputedStyle(o);r.visibility==="hidden"||r.display==="none"||(e.preventDefault(),e.stopPropagation(),o.focus())}dispose(){this.disposables.dispose()}}function A1e(i){return Nn?i.browserEvent.metaKey:i.browserEvent.ctrlKey}function P1e(i){return i.browserEvent.shiftKey}function Cdt(i){return i instanceof MouseEvent&&i.button===2}const iae={isSelectionSingleChangeEvent:A1e,isSelectionRangeChangeEvent:P1e};class O1e{constructor(e){this.list=e,this.disposables=new Be,this._onPointer=new le,this.onPointer=this._onPointer.event,e.options.multipleSelectionSupport!==!1&&(this.multipleSelectionController=this.list.options.multipleSelectionController||iae),this.mouseSupport=typeof e.options.mouseSupport=="undefined"||!!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(Ei.addTarget(e.getHTMLElement()))),st.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||iae))}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){UC(e.browserEvent.target)||document.activeElement!==e.browserEvent.target&&this.list.domFocus()}onContextMenu(e){if(Qm(e.browserEvent.target)||UC(e.browserEvent.target))return;const t=typeof e.index=="undefined"?[]:[e.index];this.list.setFocus(t,e.browserEvent)}onViewPointer(e){if(!this.mouseSupport||Qm(e.browserEvent.target)||UC(e.browserEvent.target)||e.browserEvent.isHandledByList)return;e.browserEvent.isHandledByList=!0;const t=e.index;if(typeof t=="undefined"){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),Cdt(e.browserEvent)||this.list.setSelection([t],e.browserEvent),this._onPointer.fire(e)}onDoubleClick(e){if(Qm(e.browserEvent.target)||UC(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 n=this.list.getAnchor();if(this.isSelectionRangeChangeEvent(e)){if(typeof n=="undefined"){const u=this.list.getFocus()[0];n=u!=null?u:t,this.list.setAnchor(n)}const o=Math.min(n,t),r=Math.max(n,t),s=Gs(o,r+1),a=this.list.getSelection(),l=Sdt(r$(a,[n]),n);if(l.length===0)return;const c=r$(s,xdt(a,l));this.list.setSelection(c,e.browserEvent),this.list.setFocus([t],e.browserEvent)}else if(this.isSelectionSingleChangeEvent(e)){const o=this.list.getSelection(),r=o.filter(s=>s!==t);this.list.setFocus([t]),this.list.setAnchor(t),o.length===r.length?this.list.setSelection([...r,t],e.browserEvent):this.list.setSelection(r,e.browserEvent)}}dispose(){this.disposables.dispose()}}class F1e{constructor(e,t){this.styleElement=e,this.selectorSuffix=t}style(e){var t,n;const o=this.selectorSuffix&&`.${this.selectorSuffix}`,r=[];e.listBackground&&r.push(`.monaco-list${o} .monaco-list-rows { background: ${e.listBackground}; }`),e.listFocusBackground&&(r.push(`.monaco-list${o}:focus .monaco-list-row.focused { background-color: ${e.listFocusBackground}; }`),r.push(`.monaco-list${o}:focus .monaco-list-row.focused:hover { background-color: ${e.listFocusBackground}; }`)),e.listFocusForeground&&r.push(`.monaco-list${o}:focus .monaco-list-row.focused { color: ${e.listFocusForeground}; }`),e.listActiveSelectionBackground&&(r.push(`.monaco-list${o}:focus .monaco-list-row.selected { background-color: ${e.listActiveSelectionBackground}; }`),r.push(`.monaco-list${o}:focus .monaco-list-row.selected:hover { background-color: ${e.listActiveSelectionBackground}; }`)),e.listActiveSelectionForeground&&r.push(`.monaco-list${o}:focus .monaco-list-row.selected { color: ${e.listActiveSelectionForeground}; }`),e.listActiveSelectionIconForeground&&r.push(`.monaco-list${o}:focus .monaco-list-row.selected .codicon { color: ${e.listActiveSelectionIconForeground}; }`),e.listFocusAndSelectionBackground&&r.push(` +|${" --- |".repeat(n)}`;return Bh.lexer(a)}}class hdt{constructor(e){this.spliceables=e}splice(e,t,n){this.spliceables.forEach(o=>o.splice(e,t,n))}}class q1 extends Error{constructor(e,t){super(`ListError [${e}] ${t}`)}}function lae(i,e){const t=[];for(const n of e){if(i.start>=n.range.end)continue;if(i.ende.concat(t),[]))}class cae{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!=null?e:0,this._size=this._paddingTop}splice(e,t,n=[]){const o=n.length-t,r=lae({start:0,end:e},this.groups),s=lae({start:e+t,end:Number.POSITIVE_INFINITY},this.groups).map(l=>({range:l$(l.range,o),size:l.size})),a=n.map((l,c)=>({range:{start:e+c,end:e+c+1},size:l.size}));this.groups=gdt(r,a,s),this._size=this._paddingTop+this.groups.reduce((l,c)=>l+c.size*(c.range.end-c.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 n of e)this.getRenderer(t).disposeTemplate(n.templateData),n.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}}var bp=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r};const __={CurrentDragAndDropData:void 0},vh={useShadows:!0,verticalScrollMode:1,setRowLineHeight:!0,setRowHeight:!0,supportDynamicHeights:!1,dnd:{getDragElements(i){return[i]},getDragURI(){return null},onDragStart(){},onDragOver(){return!1},drop(){},dispose(){}},horizontalScrolling:!1,transformOptimization:!0,alwaysConsumeMouseWheel:!0};class oT{constructor(e){this.elements=e}update(){}getData(){return this.elements}}class vdt{constructor(e){this.elements=e}update(){}getData(){return this.elements}}class _dt{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;to,e!=null&&e.getPosInSet?this.getPosInSet=e.getPosInSet.bind(e):this.getPosInSet=(t,n)=>n+1,e!=null&&e.getRole?this.getRole=e.getRole.bind(e):this.getRole=t=>"listitem",e!=null&&e.isChecked?this.isChecked=e.isChecked.bind(e):this.isChecked=t=>{}}}class Gc{get contentHeight(){return this.rangeMap.size}get onDidScroll(){return this.scrollableElement.onScroll}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:V6(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,n,o=vh){var r,s,a,l,c,u,d,h,f,g,p,v,m;if(this.virtualDelegate=t,this.domId=`list_id_${++Gc.InstanceCount}`,this.renderers=new Map,this.renderWidth=0,this._scrollHeight=0,this.scrollableElementUpdateDisposable=null,this.scrollableElementWidthDelayer=new Wu(50),this.splicing=!1,this.dragOverAnimationStopDisposable=_e.None,this.dragOverMouseY=0,this.canDrop=!1,this.currentDragFeedbackDisposable=_e.None,this.onDragLeaveTimeout=_e.None,this.disposables=new Be,this._onDidChangeContentHeight=new le,this._onDidChangeContentWidth=new le,this._horizontalScrolling=!1,o.horizontalScrolling&&o.supportDynamicHeights)throw new Error("Horizontal scrolling and dynamic heights not supported simultaneously");this.items=[],this.itemId=0,this.rangeMap=new cae((r=o.paddingTop)!==null&&r!==void 0?r:0);for(const y of n)this.renderers.set(y.templateId,y);this.cache=this.disposables.add(new mdt(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 o.mouseSupport=="boolean"?o.mouseSupport:!0),this._horizontalScrolling=(s=o.horizontalScrolling)!==null&&s!==void 0?s:vh.horizontalScrolling,this.domNode.classList.toggle("horizontal-scrolling",this._horizontalScrolling),this.paddingBottom=typeof o.paddingBottom=="undefined"?0:o.paddingBottom,this.accessibilityProvider=new Cdt(o.accessibilityProvider),this.rowsContainer=document.createElement("div"),this.rowsContainer.className="monaco-list-rows",((a=o.transformOptimization)!==null&&a!==void 0?a:vh.transformOptimization)&&(this.rowsContainer.style.transform="translate3d(0px, 0px, 0px)",this.rowsContainer.style.overflow="hidden",this.rowsContainer.style.contain="strict"),this.disposables.add(Ei.addTarget(this.rowsContainer)),this.scrollable=this.disposables.add(new XI({forceIntegerValues:!0,smoothScrollDuration:(l=o.smoothScrolling)!==null&&l!==void 0&&l?125:0,scheduleAtNextAnimationFrame:y=>Bc(y)})),this.scrollableElement=this.disposables.add(new NG(this.rowsContainer,{alwaysConsumeMouseWheel:(c=o.alwaysConsumeMouseWheel)!==null&&c!==void 0?c:vh.alwaysConsumeMouseWheel,horizontal:1,vertical:(u=o.verticalScrollMode)!==null&&u!==void 0?u:vh.verticalScrollMode,useShadows:(d=o.useShadows)!==null&&d!==void 0?d:vh.useShadows,mouseWheelScrollSensitivity:o.mouseWheelScrollSensitivity,fastScrollSensitivity:o.fastScrollSensitivity,scrollByPage:o.scrollByPage},this.scrollable)),this.domNode.appendChild(this.scrollableElement.getDomNode()),e.appendChild(this.domNode),this.scrollableElement.onScroll(this.onScroll,this,this.disposables),this.disposables.add(ke(this.rowsContainer,Di.Change,y=>this.onTouchChange(y))),this.disposables.add(ke(this.scrollableElement.getDomNode(),"scroll",y=>y.target.scrollTop=0)),this.disposables.add(ke(this.domNode,"dragover",y=>this.onDragOver(this.toDragEvent(y)))),this.disposables.add(ke(this.domNode,"drop",y=>this.onDrop(this.toDragEvent(y)))),this.disposables.add(ke(this.domNode,"dragleave",y=>this.onDragLeave(this.toDragEvent(y)))),this.disposables.add(ke(this.domNode,"dragend",y=>this.onDragEnd(y))),this.setRowLineHeight=(h=o.setRowLineHeight)!==null&&h!==void 0?h:vh.setRowLineHeight,this.setRowHeight=(f=o.setRowHeight)!==null&&f!==void 0?f:vh.setRowHeight,this.supportDynamicHeights=(g=o.supportDynamicHeights)!==null&&g!==void 0?g:vh.supportDynamicHeights,this.dnd=(p=o.dnd)!==null&&p!==void 0?p:this.disposables.add(vh.dnd),this.layout((v=o.initialSize)===null||v===void 0?void 0:v.height,(m=o.initialSize)===null||m===void 0?void 0:m.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=Object.assign(Object.assign({},t!=null?t:{}),{scrollByPage:e.scrollByPage})),e.mouseWheelScrollSensitivity!==void 0&&(t=Object.assign(Object.assign({},t!=null?t:{}),{mouseWheelScrollSensitivity:e.mouseWheelScrollSensitivity})),e.fastScrollSensitivity!==void 0&&(t=Object.assign(Object.assign({},t!=null?t:{}),{fastScrollSensitivity:e.fastScrollSensitivity})),t&&this.scrollableElement.updateOptions(t),e.paddingTop!==void 0&&e.paddingTop!==this.rangeMap.paddingTop){const n=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),o=e.paddingTop-this.rangeMap.paddingTop;this.rangeMap.paddingTop=e.paddingTop,this.render(n,Math.max(0,this.lastRenderTop+o),this.lastRenderHeight,void 0,void 0,!0),this.setScrollTop(this.lastRenderTop),this.eventuallyUpdateScrollDimensions(),this.supportDynamicHeights&&this._rerender(this.lastRenderTop,this.lastRenderHeight)}}splice(e,t,n=[]){if(this.splicing)throw new Error("Can't run recursive splices.");this.splicing=!0;try{return this._splice(e,t,n)}finally{this.splicing=!1,this._onDidChangeContentHeight.fire(this.contentHeight)}}_splice(e,t,n=[]){const o=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),r={start:e,end:e+t},s=fs.intersect(o,r),a=new Map;for(let D=s.end-1;D>=s.start;D--){const E=this.items[D];if(E.dragStartDisposable.dispose(),E.checkedDisposable.dispose(),E.row){let I=a.get(E.templateId);I||(I=[],a.set(E.templateId,I));const k=this.renderers.get(E.templateId);k&&k.disposeElement&&k.disposeElement(E.element,D,E.row.templateData,E.size),I.push(E.row)}E.row=null}const l={start:e+t,end:this.items.length},c=fs.intersect(l,o),u=fs.relativeComplement(l,o),d=n.map(D=>({id:String(this.itemId++),element:D,templateId:this.virtualDelegate.getTemplateId(D),size:this.virtualDelegate.getHeight(D),width:void 0,hasDynamicHeight:!!this.virtualDelegate.hasDynamicHeight&&this.virtualDelegate.hasDynamicHeight(D),lastDynamicHeightWidth:void 0,row:null,uri:void 0,dropTarget:!1,dragStartDisposable:_e.None,checkedDisposable:_e.None}));let h;e===0&&t>=this.items.length?(this.rangeMap=new cae(this.rangeMap.paddingTop),this.rangeMap.splice(0,0,d),h=this.items,this.items=d):(this.rangeMap.splice(e,t,d),h=this.items.splice(e,t,...d));const f=n.length-t,g=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),p=l$(c,f),v=fs.intersect(g,p);for(let D=v.start;Dl$(D,f)),w=[{start:e,end:e+n.length},..._].map(D=>fs.intersect(g,D)),L=this.getNextToLastElement(w);for(const D of w)for(let E=D.start;ED.element)}eventuallyUpdateScrollDimensions(){this._scrollHeight=this.contentHeight,this.rowsContainer.style.height=`${this._scrollHeight}px`,this.scrollableElementUpdateDisposable||(this.scrollableElementUpdateDisposable=Bc(()=>{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!="undefined"&&(e=Math.max(e,t.width));this.scrollWidth=e,this.scrollableElement.setScrollDimensions({scrollWidth:e===0?0:e+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(){const e=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),t=this.rangeMap.positionAt(e.start),n=this.rangeMap.positionAt(e.start+1);return n!==-1&&(n-t)/2+t{for(const d of c)for(let h=d.start;ho.row.domNode.setAttribute("aria-checked",String(!!d));u(a.value),o.checkedDisposable=a.onDidChange(u)}(r||!o.row.domNode.parentElement)&&(t?this.rowsContainer.insertBefore(o.row.domNode,t):this.rowsContainer.appendChild(o.row.domNode)),this.updateItemInDOM(o,e);const l=this.renderers.get(o.templateId);if(!l)throw new Error(`No renderer found for template id ${o.templateId}`);l==null||l.renderElement(o.element,e,o.row.templateData,o.size);const c=this.dnd.getDragURI(o.element);o.dragStartDisposable.dispose(),o.row.domNode.draggable=!!c,c&&(o.dragStartDisposable=ke(o.row.domNode,"dragstart",u=>this.onDragStart(o.element,c,u))),this.horizontalScrolling&&(this.measureItemWidth(o),this.eventuallyUpdateScrollWidth())}measureItemWidth(e){if(!e.row||!e.row.domNode)return;e.row.domNode.style.width="fit-content",e.width=V6(e.row.domNode);const t=window.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 n=this.renderers.get(t.templateId);n&&n.disposeElement&&n.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})}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 st.map(this.disposables.add(new xn(this.domNode,"click")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseDblClick(){return st.map(this.disposables.add(new xn(this.domNode,"dblclick")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseMiddleClick(){return st.filter(st.map(this.disposables.add(new xn(this.domNode,"auxclick")).event,e=>this.toMouseEvent(e),this.disposables),e=>e.browserEvent.button===1,this.disposables)}get onMouseDown(){return st.map(this.disposables.add(new xn(this.domNode,"mousedown")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseOver(){return st.map(this.disposables.add(new xn(this.domNode,"mouseover")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseOut(){return st.map(this.disposables.add(new xn(this.domNode,"mouseout")).event,e=>this.toMouseEvent(e),this.disposables)}get onContextMenu(){return st.any(st.map(this.disposables.add(new xn(this.domNode,"contextmenu")).event,e=>this.toMouseEvent(e),this.disposables),st.map(this.disposables.add(new xn(this.domNode,Di.Contextmenu)).event,e=>this.toGestureEvent(e),this.disposables))}get onTouchStart(){return st.map(this.disposables.add(new xn(this.domNode,"touchstart")).event,e=>this.toTouchEvent(e),this.disposables)}get onTap(){return st.map(this.disposables.add(new xn(this.rowsContainer,Di.Tap)).event,e=>this.toGestureEvent(e),this.disposables)}toMouseEvent(e){const t=this.getItemIndexFromEventTarget(e.target||null),n=typeof t=="undefined"?void 0:this.items[t],o=n&&n.element;return{browserEvent:e,index:t,element:o}}toTouchEvent(e){const t=this.getItemIndexFromEventTarget(e.target||null),n=typeof t=="undefined"?void 0:this.items[t],o=n&&n.element;return{browserEvent:e,index:t,element:o}}toGestureEvent(e){const t=this.getItemIndexFromEventTarget(e.initialTarget||null),n=typeof t=="undefined"?void 0:this.items[t],o=n&&n.element;return{browserEvent:e,index:t,element:o}}toDragEvent(e){const t=this.getItemIndexFromEventTarget(e.target||null),n=typeof t=="undefined"?void 0:this.items[t],o=n&&n.element;return{browserEvent:e,index:t,element:o}}onScroll(e){try{const t=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight);this.render(t,e.scrollTop,e.height,e.scrollLeft,e.scrollWidth),this.supportDynamicHeights&&this._rerender(e.scrollTop,e.height,e.inSmoothScrolling)}catch(t){throw console.error("Got bad scroll event:",e),t}}onTouchChange(e){e.preventDefault(),e.stopPropagation(),this.scrollTop-=e.translationY}onDragStart(e,t,n){var o,r;if(!n.dataTransfer)return;const s=this.dnd.getDragElements(e);if(n.dataTransfer.effectAllowed="copyMove",n.dataTransfer.setData(pk.TEXT,t),n.dataTransfer.setDragImage){let a;this.dnd.getDragLabel&&(a=this.dnd.getDragLabel(s,n)),typeof a=="undefined"&&(a=String(s.length));const l=He(".monaco-drag-image");l.textContent=a;const u=(d=>{for(;d&&!d.classList.contains("monaco-workbench");)d=d.parentElement;return d||document.body})(this.domNode);u.appendChild(l),n.dataTransfer.setDragImage(l,-10,-10),setTimeout(()=>u.removeChild(l),0)}this.domNode.classList.add("dragging"),this.currentDragData=new oT(s),__.CurrentDragAndDropData=new vdt(s),(r=(o=this.dnd).onDragStart)===null||r===void 0||r.call(o,this.currentDragData,n)}onDragOver(e){var t;if(e.browserEvent.preventDefault(),this.onDragLeaveTimeout.dispose(),__.CurrentDragAndDropData&&__.CurrentDragAndDropData.getData()==="vscode-ui"||(this.setupDragAndDropScrollTopAnimation(e.browserEvent),!e.browserEvent.dataTransfer))return!1;if(!this.currentDragData)if(__.CurrentDragAndDropData)this.currentDragData=__.CurrentDragAndDropData;else{if(!e.browserEvent.dataTransfer.types)return!1;this.currentDragData=new _dt}const n=this.dnd.onDragOver(this.currentDragData,e.element,e.index,e.browserEvent);if(this.canDrop=typeof n=="boolean"?n:n.accept,!this.canDrop)return this.currentDragFeedback=void 0,this.currentDragFeedbackDisposable.dispose(),!1;e.browserEvent.dataTransfer.dropEffect=typeof n!="boolean"&&n.effect===0?"copy":"move";let o;if(typeof n!="boolean"&&n.feedback?o=n.feedback:typeof e.index=="undefined"?o=[-1]:o=[e.index],o=vv(o).filter(r=>r>=-1&&rr-s),o=o[0]===-1?[-1]:o,bdt(this.currentDragFeedback,o))return!0;if(this.currentDragFeedback=o,this.currentDragFeedbackDisposable.dispose(),o[0]===-1)this.domNode.classList.add("drop-target"),this.rowsContainer.classList.add("drop-target"),this.currentDragFeedbackDisposable=zt(()=>{this.domNode.classList.remove("drop-target"),this.rowsContainer.classList.remove("drop-target")});else{for(const r of o){const s=this.items[r];s.dropTarget=!0,(t=s.row)===null||t===void 0||t.domNode.classList.add("drop-target")}this.currentDragFeedbackDisposable=zt(()=>{var r;for(const s of o){const a=this.items[s];a.dropTarget=!1,(r=a.row)===null||r===void 0||r.domNode.classList.remove("drop-target")}})}return!0}onDragLeave(e){var t,n;this.onDragLeaveTimeout.dispose(),this.onDragLeaveTimeout=Sv(()=>this.clearDragOverFeedback(),100,this.disposables),this.currentDragData&&((n=(t=this.dnd).onDragLeave)===null||n===void 0||n.call(t,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,__.CurrentDragAndDropData=void 0,!(!t||!e.browserEvent.dataTransfer)&&(e.browserEvent.preventDefault(),t.update(e.browserEvent.dataTransfer),this.dnd.drop(t,e.element,e.index,e.browserEvent))}onDragEnd(e){var t,n;this.canDrop=!1,this.teardownDragAndDropScrollTopAnimation(),this.clearDragOverFeedback(),this.domNode.classList.remove("dragging"),this.currentDragData=void 0,__.CurrentDragAndDropData=void 0,(n=(t=this.dnd).onDragEnd)===null||n===void 0||n.call(t,e)}clearDragOverFeedback(){this.currentDragFeedback=void 0,this.currentDragFeedbackDisposable.dispose(),this.currentDragFeedbackDisposable=_e.None}setupDragAndDropScrollTopAnimation(e){if(!this.dragOverAnimationDisposable){const t=h0e(this.domNode).top;this.dragOverAnimationDisposable=qQe(this.animateDragAndDropScrollTop.bind(this,t))}this.dragOverAnimationStopDisposable.dispose(),this.dragOverAnimationStopDisposable=Sv(()=>{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,n=this.renderHeight-35;t<35?this.scrollTop+=Math.max(-14,Math.floor(.3*(t-35))):t>n&&(this.scrollTop+=Math.min(14,Math.floor(.3*(t-n))))}teardownDragAndDropScrollTopAnimation(){this.dragOverAnimationStopDisposable.dispose(),this.dragOverAnimationDisposable&&(this.dragOverAnimationDisposable.dispose(),this.dragOverAnimationDisposable=void 0)}getItemIndexFromEventTarget(e){const t=this.scrollableElement.getDomNode();let n=e;for(;n instanceof HTMLElement&&n!==this.rowsContainer&&t.contains(n);){const o=n.getAttribute("data-index");if(o){const r=Number(o);if(!isNaN(r))return r}n=n.parentElement}}getRenderRange(e,t){return{start:this.rangeMap.indexAt(e),end:this.rangeMap.indexAfter(e+t-1)}}_rerender(e,t,n){const o=this.getRenderRange(e,t);let r,s;e===this.elementTop(o.start)?(r=o.start,s=0):o.end-o.start>1&&(r=o.start+1,s=this.elementTop(r)-e);let a=0;for(;;){const l=this.getRenderRange(e,t);let c=!1;for(let u=l.start;u=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},uae=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};class ydt{constructor(e){this.trait=e,this.renderedElements=[]}get templateId(){return`template:${this.trait.name}`}renderTemplate(e){return e}renderElement(e,t,n){const o=this.renderedElements.findIndex(r=>r.templateData===n);if(o>=0){const r=this.renderedElements[o];this.trait.unrender(n),r.index=t}else{const r={index:t,templateData:n};this.renderedElements.push(r)}this.trait.renderIndex(t,n)}splice(e,t,n){const o=[];for(const r of this.renderedElements)r.index=e+t&&o.push({index:r.index+n-t,templateData:r.templateData});this.renderedElements=o}renderIndexes(e){for(const{index:t,templateData:n}of this.renderedElements)e.indexOf(t)>-1&&this.trait.renderIndex(t,n)}disposeTemplate(e){const t=this.renderedElements.findIndex(n=>n.templateData===e);t<0||this.renderedElements.splice(t,1)}}class MP{get name(){return this._trait}get renderer(){return new ydt(this)}constructor(e){this._trait=e,this.length=0,this.indexes=[],this.sortedIndexes=[],this._onChange=new le,this.onChange=this._onChange.event}splice(e,t,n){var o;t=Math.max(0,Math.min(t,this.length-e));const r=n.length-t,s=e+t,a=[];let l=0;for(;l=s;)a.push(this.sortedIndexes[l++]+r);const c=this.length+r;if(this.sortedIndexes.length>0&&a.length===0&&c>0){const u=(o=this.sortedIndexes.find(d=>d>=e))!==null&&o!==void 0?o:c-1;a.push(Math.min(u,c-1))}this.renderer.splice(e,t,n.length),this._set(a,a),this.length=c}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(hae),t)}_set(e,t,n){const o=this.indexes,r=this.sortedIndexes;this.indexes=e,this.sortedIndexes=t;const s=c$(r,e);return this.renderer.renderIndexes(s),this._onChange.fire({indexes:e,browserEvent:n}),o}get(){return this.indexes}contains(e){return xD(this.sortedIndexes,e,hae)>=0}dispose(){si(this._onChange)}}Ub([Mo],MP.prototype,"renderer",null);class wdt extends MP{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 P9{constructor(e,t,n){this.trait=e,this.view=t,this.identityProvider=n}splice(e,t,n){if(!this.identityProvider)return this.trait.splice(e,t,new Array(n.length).fill(!1));const o=this.trait.get().map(a=>this.identityProvider.getId(this.view.element(a)).toString());if(o.length===0)return this.trait.splice(e,t,new Array(n.length).fill(!1));const r=new Set(o),s=n.map(a=>r.has(this.identityProvider.getId(a).toString()));this.trait.splice(e,t,s)}}function Jm(i){return i.tagName==="INPUT"||i.tagName==="TEXTAREA"}function UC(i){return i.classList.contains("monaco-editor")?!0:i.classList.contains("monaco-list")||!i.parentElement?!1:UC(i.parentElement)}function V1e(i){return i.tagName==="A"&&i.classList.contains("monaco-button")||i.tagName==="DIV"&&i.classList.contains("monaco-button-dropdown")?!0:i.classList.contains("monaco-list")||!i.parentElement?!1:V1e(i.parentElement)}class H1e{get onKeyDown(){return st.chain(this.disposables.add(new xn(this.view.domNode,"keydown")).event,e=>e.filter(t=>!Jm(t.target)).map(t=>new Pi(t)))}constructor(e,t,n){this.list=e,this.view=t,this.disposables=new Be,this.multipleSelectionDisposables=new Be,this.multipleSelectionSupport=n.multipleSelectionSupport,this.disposables.add(this.onKeyDown(o=>{switch(o.keyCode){case 3:return this.onEnter(o);case 16:return this.onUpArrow(o);case 18:return this.onDownArrow(o);case 11:return this.onPageUpArrow(o);case 12:return this.onPageDownArrow(o);case 9:return this.onEscape(o);case 31:this.multipleSelectionSupport&&(Nn?o.metaKey:o.ctrlKey)&&this.onCtrlA(o)}}))}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(Gs(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()}}Ub([Mo],H1e.prototype,"onKeyDown",null);var Wh;(function(i){i[i.Automatic=0]="Automatic",i[i.Trigger=1]="Trigger"})(Wh||(Wh={}));var jC;(function(i){i[i.Idle=0]="Idle",i[i.Typing=1]="Typing"})(jC||(jC={}));const Sdt=new class{mightProducePrintableCharacter(i){return i.ctrlKey||i.metaKey||i.altKey?!1:i.keyCode>=31&&i.keyCode<=56||i.keyCode>=21&&i.keyCode<=30||i.keyCode>=98&&i.keyCode<=107||i.keyCode>=85&&i.keyCode<=95}};class xdt{constructor(e,t,n,o,r){this.list=e,this.view=t,this.keyboardNavigationLabelProvider=n,this.keyboardNavigationEventFilter=o,this.delegate=r,this.enabled=!1,this.state=jC.Idle,this.mode=Wh.Automatic,this.triggered=!1,this.previouslyFocused=-1,this.enabledDisposables=new Be,this.disposables=new Be,this.updateOptions(e.options)}updateOptions(e){var t,n;!((t=e.typeNavigationEnabled)!==null&&t!==void 0)||t?this.enable():this.disable(),this.mode=(n=e.typeNavigationMode)!==null&&n!==void 0?n:Wh.Automatic}enable(){if(this.enabled)return;let e=!1;const t=st.chain(this.enabledDisposables.add(new xn(this.view.domNode,"keydown")).event,r=>r.filter(s=>!Jm(s.target)).filter(()=>this.mode===Wh.Automatic||this.triggered).map(s=>new Pi(s)).filter(s=>e||this.keyboardNavigationEventFilter(s)).filter(s=>this.delegate.mightProducePrintableCharacter(s)).forEach(s=>dn.stop(s,!0)).map(s=>s.browserEvent.key)),n=st.debounce(t,()=>null,800,void 0,void 0,void 0,this.enabledDisposables);st.reduce(st.any(t,n),(r,s)=>s===null?null:(r||"")+s,void 0,this.enabledDisposables)(this.onInput,this,this.enabledDisposables),n(this.onClear,this,this.enabledDisposables),t(()=>e=!0,void 0,this.enabledDisposables),n(()=>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(){var e;const t=this.list.getFocus();if(t.length>0&&t[0]===this.previouslyFocused){const n=(e=this.list.options.accessibilityProvider)===null||e===void 0?void 0:e.getAriaLabel(this.list.element(t[0]));n&&Cs(n)}this.previouslyFocused=-1}onInput(e){if(!e){this.state=jC.Idle,this.triggered=!1;return}const t=this.list.getFocus(),n=t.length>0?t[0]:0,o=this.state===jC.Idle?1:0;this.state=jC.Typing;for(let r=0;r1&&c.length===1){this.previouslyFocused=n,this.list.setFocus([s]),this.list.reveal(s);return}}}else if(typeof l=="undefined"||mk(e,l)){this.previouslyFocused=n,this.list.setFocus([s]),this.list.reveal(s);return}}}dispose(){this.disable(),this.enabledDisposables.dispose(),this.disposables.dispose()}}class Ldt{constructor(e,t){this.list=e,this.view=t,this.disposables=new Be;const n=st.chain(this.disposables.add(new xn(t.domNode,"keydown")).event,r=>r.filter(s=>!Jm(s.target)).map(s=>new Pi(s)));st.chain(n,r=>r.filter(s=>s.keyCode===2&&!s.ctrlKey&&!s.metaKey&&!s.shiftKey&&!s.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 n=this.view.domElement(t[0]);if(!n)return;const o=n.querySelector("[tabIndex]");if(!o||!(o instanceof HTMLElement)||o.tabIndex===-1)return;const r=window.getComputedStyle(o);r.visibility==="hidden"||r.display==="none"||(e.preventDefault(),e.stopPropagation(),o.focus())}dispose(){this.disposables.dispose()}}function $1e(i){return Nn?i.browserEvent.metaKey:i.browserEvent.ctrlKey}function z1e(i){return i.browserEvent.shiftKey}function Edt(i){return i instanceof MouseEvent&&i.button===2}const dae={isSelectionSingleChangeEvent:$1e,isSelectionRangeChangeEvent:z1e};class U1e{constructor(e){this.list=e,this.disposables=new Be,this._onPointer=new le,this.onPointer=this._onPointer.event,e.options.multipleSelectionSupport!==!1&&(this.multipleSelectionController=this.list.options.multipleSelectionController||dae),this.mouseSupport=typeof e.options.mouseSupport=="undefined"||!!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(Ei.addTarget(e.getHTMLElement()))),st.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||dae))}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){UC(e.browserEvent.target)||document.activeElement!==e.browserEvent.target&&this.list.domFocus()}onContextMenu(e){if(Jm(e.browserEvent.target)||UC(e.browserEvent.target))return;const t=typeof e.index=="undefined"?[]:[e.index];this.list.setFocus(t,e.browserEvent)}onViewPointer(e){if(!this.mouseSupport||Jm(e.browserEvent.target)||UC(e.browserEvent.target)||e.browserEvent.isHandledByList)return;e.browserEvent.isHandledByList=!0;const t=e.index;if(typeof t=="undefined"){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),Edt(e.browserEvent)||this.list.setSelection([t],e.browserEvent),this._onPointer.fire(e)}onDoubleClick(e){if(Jm(e.browserEvent.target)||UC(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 n=this.list.getAnchor();if(this.isSelectionRangeChangeEvent(e)){if(typeof n=="undefined"){const u=this.list.getFocus()[0];n=u!=null?u:t,this.list.setAnchor(n)}const o=Math.min(n,t),r=Math.max(n,t),s=Gs(o,r+1),a=this.list.getSelection(),l=Idt(c$(a,[n]),n);if(l.length===0)return;const c=c$(s,Tdt(a,l));this.list.setSelection(c,e.browserEvent),this.list.setFocus([t],e.browserEvent)}else if(this.isSelectionSingleChangeEvent(e)){const o=this.list.getSelection(),r=o.filter(s=>s!==t);this.list.setFocus([t]),this.list.setAnchor(t),o.length===r.length?this.list.setSelection([...r,t],e.browserEvent):this.list.setSelection(r,e.browserEvent)}}dispose(){this.disposables.dispose()}}class j1e{constructor(e,t){this.styleElement=e,this.selectorSuffix=t}style(e){var t,n;const o=this.selectorSuffix&&`.${this.selectorSuffix}`,r=[];e.listBackground&&r.push(`.monaco-list${o} .monaco-list-rows { background: ${e.listBackground}; }`),e.listFocusBackground&&(r.push(`.monaco-list${o}:focus .monaco-list-row.focused { background-color: ${e.listFocusBackground}; }`),r.push(`.monaco-list${o}:focus .monaco-list-row.focused:hover { background-color: ${e.listFocusBackground}; }`)),e.listFocusForeground&&r.push(`.monaco-list${o}:focus .monaco-list-row.focused { color: ${e.listFocusForeground}; }`),e.listActiveSelectionBackground&&(r.push(`.monaco-list${o}:focus .monaco-list-row.selected { background-color: ${e.listActiveSelectionBackground}; }`),r.push(`.monaco-list${o}:focus .monaco-list-row.selected:hover { background-color: ${e.listActiveSelectionBackground}; }`)),e.listActiveSelectionForeground&&r.push(`.monaco-list${o}:focus .monaco-list-row.selected { color: ${e.listActiveSelectionForeground}; }`),e.listActiveSelectionIconForeground&&r.push(`.monaco-list${o}:focus .monaco-list-row.selected .codicon { color: ${e.listActiveSelectionIconForeground}; }`),e.listFocusAndSelectionBackground&&r.push(` .monaco-drag-image, .monaco-list${o}:focus .monaco-list-row.selected.focused { background-color: ${e.listFocusAndSelectionBackground}; } `),e.listFocusAndSelectionForeground&&r.push(` .monaco-drag-image, .monaco-list${o}:focus .monaco-list-row.selected.focused { color: ${e.listFocusAndSelectionForeground}; } - `),e.listInactiveFocusForeground&&(r.push(`.monaco-list${o} .monaco-list-row.focused { color: ${e.listInactiveFocusForeground}; }`),r.push(`.monaco-list${o} .monaco-list-row.focused:hover { color: ${e.listInactiveFocusForeground}; }`)),e.listInactiveSelectionIconForeground&&r.push(`.monaco-list${o} .monaco-list-row.focused .codicon { color: ${e.listInactiveSelectionIconForeground}; }`),e.listInactiveFocusBackground&&(r.push(`.monaco-list${o} .monaco-list-row.focused { background-color: ${e.listInactiveFocusBackground}; }`),r.push(`.monaco-list${o} .monaco-list-row.focused:hover { background-color: ${e.listInactiveFocusBackground}; }`)),e.listInactiveSelectionBackground&&(r.push(`.monaco-list${o} .monaco-list-row.selected { background-color: ${e.listInactiveSelectionBackground}; }`),r.push(`.monaco-list${o} .monaco-list-row.selected:hover { background-color: ${e.listInactiveSelectionBackground}; }`)),e.listInactiveSelectionForeground&&r.push(`.monaco-list${o} .monaco-list-row.selected { color: ${e.listInactiveSelectionForeground}; }`),e.listHoverBackground&&r.push(`.monaco-list${o}:not(.drop-target):not(.dragging) .monaco-list-row:hover:not(.selected):not(.focused) { background-color: ${e.listHoverBackground}; }`),e.listHoverForeground&&r.push(`.monaco-list${o}:not(.drop-target):not(.dragging) .monaco-list-row:hover:not(.selected):not(.focused) { color: ${e.listHoverForeground}; }`);const s=E0(e.listFocusAndSelectionOutline,E0(e.listSelectionOutline,(t=e.listFocusOutline)!==null&&t!==void 0?t:""));s&&r.push(`.monaco-list${o}:focus .monaco-list-row.focused.selected { outline: 1px solid ${s}; outline-offset: -1px;}`),e.listFocusOutline&&r.push(` + `),e.listInactiveFocusForeground&&(r.push(`.monaco-list${o} .monaco-list-row.focused { color: ${e.listInactiveFocusForeground}; }`),r.push(`.monaco-list${o} .monaco-list-row.focused:hover { color: ${e.listInactiveFocusForeground}; }`)),e.listInactiveSelectionIconForeground&&r.push(`.monaco-list${o} .monaco-list-row.focused .codicon { color: ${e.listInactiveSelectionIconForeground}; }`),e.listInactiveFocusBackground&&(r.push(`.monaco-list${o} .monaco-list-row.focused { background-color: ${e.listInactiveFocusBackground}; }`),r.push(`.monaco-list${o} .monaco-list-row.focused:hover { background-color: ${e.listInactiveFocusBackground}; }`)),e.listInactiveSelectionBackground&&(r.push(`.monaco-list${o} .monaco-list-row.selected { background-color: ${e.listInactiveSelectionBackground}; }`),r.push(`.monaco-list${o} .monaco-list-row.selected:hover { background-color: ${e.listInactiveSelectionBackground}; }`)),e.listInactiveSelectionForeground&&r.push(`.monaco-list${o} .monaco-list-row.selected { color: ${e.listInactiveSelectionForeground}; }`),e.listHoverBackground&&r.push(`.monaco-list${o}:not(.drop-target):not(.dragging) .monaco-list-row:hover:not(.selected):not(.focused) { background-color: ${e.listHoverBackground}; }`),e.listHoverForeground&&r.push(`.monaco-list${o}:not(.drop-target):not(.dragging) .monaco-list-row:hover:not(.selected):not(.focused) { color: ${e.listHoverForeground}; }`);const s=D0(e.listFocusAndSelectionOutline,D0(e.listSelectionOutline,(t=e.listFocusOutline)!==null&&t!==void 0?t:""));s&&r.push(`.monaco-list${o}:focus .monaco-list-row.focused.selected { outline: 1px solid ${s}; outline-offset: -1px;}`),e.listFocusOutline&&r.push(` .monaco-drag-image, .monaco-list${o}:focus .monaco-list-row.focused { outline: 1px solid ${e.listFocusOutline}; outline-offset: -1px; } .monaco-workbench.context-menu-visible .monaco-list${o}.last-focused .monaco-list-row.focused { outline: 1px solid ${e.listFocusOutline}; outline-offset: -1px; } - `);const a=E0(e.listSelectionOutline,(n=e.listInactiveFocusOutline)!==null&&n!==void 0?n:"");a&&r.push(`.monaco-list${o} .monaco-list-row.focused.selected { outline: 1px dotted ${a}; outline-offset: -1px; }`),e.listSelectionOutline&&r.push(`.monaco-list${o} .monaco-list-row.selected { outline: 1px dotted ${e.listSelectionOutline}; outline-offset: -1px; }`),e.listInactiveFocusOutline&&r.push(`.monaco-list${o} .monaco-list-row.focused { outline: 1px dotted ${e.listInactiveFocusOutline}; outline-offset: -1px; }`),e.listHoverOutline&&r.push(`.monaco-list${o} .monaco-list-row:hover { outline: 1px dashed ${e.listHoverOutline}; outline-offset: -1px; }`),e.listDropBackground&&r.push(` + `);const a=D0(e.listSelectionOutline,(n=e.listInactiveFocusOutline)!==null&&n!==void 0?n:"");a&&r.push(`.monaco-list${o} .monaco-list-row.focused.selected { outline: 1px dotted ${a}; outline-offset: -1px; }`),e.listSelectionOutline&&r.push(`.monaco-list${o} .monaco-list-row.selected { outline: 1px dotted ${e.listSelectionOutline}; outline-offset: -1px; }`),e.listInactiveFocusOutline&&r.push(`.monaco-list${o} .monaco-list-row.focused { outline: 1px dotted ${e.listInactiveFocusOutline}; outline-offset: -1px; }`),e.listHoverOutline&&r.push(`.monaco-list${o} .monaco-list-row:hover { outline: 1px dashed ${e.listHoverOutline}; outline-offset: -1px; }`),e.listDropBackground&&r.push(` .monaco-list${o}.drop-target, .monaco-list${o} .monaco-list-rows.drop-target, .monaco-list${o} .monaco-list-row.drop-target { background-color: ${e.listDropBackground} !important; color: inherit !important; } @@ -605,17 +606,17 @@ Please report this to https://github.com/markedjs/marked.`,ie.silent)return"

    A background-color: ${e.tableOddRowsBackgroundColor}; } `),this.styleElement.textContent=r.join(` -`)}}const wdt={listFocusBackground:"#7FB0D0",listActiveSelectionBackground:"#0E639C",listActiveSelectionForeground:"#FFFFFF",listActiveSelectionIconForeground:"#FFFFFF",listFocusAndSelectionOutline:"#90C2F9",listFocusAndSelectionBackground:"#094771",listFocusAndSelectionForeground:"#FFFFFF",listInactiveSelectionBackground:"#3F3F46",listInactiveSelectionIconForeground:"#FFFFFF",listHoverBackground:"#2A2D2E",listDropBackground:"#383B3D",treeIndentGuidesStroke:"#a9a9a9",treeInactiveIndentGuidesStroke:ve.fromHex("#a9a9a9").transparent(.4).toString(),tableColumnsBorder:ve.fromHex("#cccccc").transparent(.2).toString(),tableOddRowsBackgroundColor:ve.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},ydt={keyboardSupport:!0,mouseSupport:!0,multipleSelectionSupport:!0,dnd:{getDragURI(){return null},onDragStart(){},onDragOver(){return!1},drop(){},dispose(){}}};function Sdt(i,e){const t=i.indexOf(e);if(t===-1)return[];const n=[];let o=t-1;for(;o>=0&&i[o]===e-(t-o);)n.push(i[o--]);for(n.reverse(),o=t;o=i.length)t.push(e[o++]);else if(o>=e.length)t.push(i[n++]);else if(i[n]===e[o]){t.push(i[n]),n++,o++;continue}else i[n]=i.length)t.push(e[o++]);else if(o>=e.length)t.push(i[n++]);else if(i[n]===e[o]){n++,o++;continue}else i[n]i-e;class Ldt{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,n,o){let r=0;for(const s of this.renderers)s.renderElement(e,t,n[r++],o)}disposeElement(e,t,n,o){var r;let s=0;for(const a of this.renderers)(r=a.disposeElement)===null||r===void 0||r.call(a,e,t,n[s],o),s+=1}disposeTemplate(e){let t=0;for(const n of this.renderers)n.disposeTemplate(e[t++])}}class Edt{constructor(e){this.accessibilityProvider=e,this.templateId="a18n"}renderTemplate(e){return e}renderElement(e,t,n){const o=this.accessibilityProvider.getAriaLabel(e);o?n.setAttribute("aria-label",o):n.removeAttribute("aria-label");const r=this.accessibilityProvider.getAriaLevel&&this.accessibilityProvider.getAriaLevel(e);typeof r=="number"?n.setAttribute("aria-level",`${r}`):n.removeAttribute("aria-level")}disposeTemplate(e){}}class Ddt{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){var n,o;(o=(n=this.dnd).onDragStart)===null||o===void 0||o.call(n,e,t)}onDragOver(e,t,n,o){return this.dnd.onDragOver(e,t,n,o)}onDragLeave(e,t,n,o){var r,s;(s=(r=this.dnd).onDragLeave)===null||s===void 0||s.call(r,e,t,n,o)}onDragEnd(e){var t,n;(n=(t=this.dnd).onDragEnd)===null||n===void 0||n.call(t,e)}drop(e,t,n,o){this.dnd.drop(e,t,n,o)}dispose(){this.dnd.dispose()}}class Ku{get onDidChangeFocus(){return st.map(this.eventBufferer.wrapEvent(this.focus.onChange),e=>this.toListEvent(e),this.disposables)}get onDidChangeSelection(){return st.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 onMouseDown(){return this.view.onMouseDown}get onMouseOver(){return this.view.onMouseOver}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=st.chain(this.disposables.add(new xn(this.view.domNode,"keydown")).event,r=>r.map(s=>new Pi(s)).filter(s=>e=s.keyCode===58||s.shiftKey&&s.keyCode===68).map(s=>dn.stop(s,!0)).filter(()=>!1)),n=st.chain(this.disposables.add(new xn(this.view.domNode,"keyup")).event,r=>r.forEach(()=>e=!1).map(s=>new Pi(s)).filter(s=>s.keyCode===58||s.shiftKey&&s.keyCode===68).map(s=>dn.stop(s,!0)).map(({browserEvent:s})=>{const a=this.getFocus(),l=a.length?a[0]:void 0,c=typeof l!="undefined"?this.view.element(l):void 0,u=typeof l!="undefined"?this.view.domElement(l):this.view.domNode;return{index:l,element:c,anchor:u,browserEvent:s}})),o=st.chain(this.view.onContextMenu,r=>r.filter(s=>!e).map(({element:s,index:a,browserEvent:l})=>({element:s,index:a,anchor:new Dc(l),browserEvent:l})));return st.any(t,n,o)}get onKeyDown(){return this.disposables.add(new xn(this.view.domNode,"keydown")).event}get onDidFocus(){return st.signal(this.disposables.add(new xn(this.view.domNode,"focus",!0)).event)}constructor(e,t,n,o,r=ydt){var s,a,l,c;this.user=e,this._options=r,this.focus=new TP("focused"),this.anchor=new TP("anchor"),this.eventBufferer=new Pq,this._ariaLabel="",this.disposables=new Be,this._onDidDispose=new le,this.onDidDispose=this._onDidDispose.event;const u=this._options.accessibilityProvider&&this._options.accessibilityProvider.getWidgetRole?(s=this._options.accessibilityProvider)===null||s===void 0?void 0:s.getWidgetRole():"list";this.selection=new mdt(u!=="listbox");const d=[this.focus.renderer,this.selection.renderer];this.accessibilityProvider=r.accessibilityProvider,this.accessibilityProvider&&(d.push(new Edt(this.accessibilityProvider)),(l=(a=this.accessibilityProvider).onDidChangeActiveDescendant)===null||l===void 0||l.call(a,this.onDidChangeActiveDescendant,this,this.disposables)),o=o.map(f=>new Ldt(f.templateId,[...d,f]));const h=Object.assign(Object.assign({},r),{dnd:r.dnd&&new Ddt(this,r.dnd)});if(this.view=this.createListView(t,n,o,h),this.view.domNode.setAttribute("role",u),r.styleController)this.styleController=r.styleController(this.view.domId);else{const f=Bc(this.view.domNode);this.styleController=new F1e(f,this.view.domId)}if(this.spliceable=new sdt([new P9(this.focus,this.view,r.identityProvider),new P9(this.selection,this.view,r.identityProvider),new P9(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 bdt(this,this.view)),(typeof r.keyboardSupport!="boolean"||r.keyboardSupport)&&(this.keyboardController=new M1e(this,this.view,r),this.disposables.add(this.keyboardController)),r.keyboardNavigationLabelProvider){const f=r.keyboardNavigationDelegate||vdt;this.typeNavigationController=new _dt(this,this.view,r.keyboardNavigationLabelProvider,(c=r.keyboardNavigationEventFilter)!==null&&c!==void 0?c:()=>!0,f),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,n,o){return new qc(e,t,n,o)}createMouseController(e){return new O1e(this)}updateOptions(e={}){var t,n;this._options=Object.assign(Object.assign({},this._options),e),(t=this.typeNavigationController)===null||t===void 0||t.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),(n=this.keyboardController)===null||n===void 0||n.updateOptions(e),this.view.updateOptions(e)}get options(){return this._options}splice(e,t,n=[]){if(e<0||e>this.view.length)throw new q1(this.user,`Invalid start index: ${e}`);if(t<0)throw new q1(this.user,`Invalid delete count: ${t}`);t===0&&n.length===0||this.eventBufferer.bufferEvents(()=>this.spliceable.splice(e,t,n))}rerender(){this.view.rerender()}element(e){return this.view.element(e)}get length(){return this.view.length}get contentHeight(){return this.view.contentHeight}get scrollTop(){return this.view.getScrollTop()}set scrollTop(e){this.view.setScrollTop(e)}get scrollHeight(){return this.view.scrollHeight}get renderHeight(){return this.view.renderHeight}get firstVisibleIndex(){return this.view.firstVisibleIndex}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)}setSelection(e,t){for(const n of e)if(n<0||n>=this.length)throw new q1(this.user,`Invalid index ${n}`);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=="undefined"){this.anchor.set([]);return}if(e<0||e>=this.length)throw new q1(this.user,`Invalid index ${e}`);this.anchor.set([e])}getAnchor(){return e_e(this.anchor.get(),void 0)}getAnchorElement(){const e=this.getAnchor();return typeof e=="undefined"?void 0:this.element(e)}setFocus(e,t){for(const n of e)if(n<0||n>=this.length)throw new q1(this.user,`Invalid index ${n}`);this.focus.set(e,t)}focusNext(e=1,t=!1,n,o){if(this.length===0)return;const r=this.focus.get(),s=this.findNextIndex(r.length>0?r[0]+e:0,t,o);s>-1&&this.setFocus([s],n)}focusPrevious(e=1,t=!1,n,o){if(this.length===0)return;const r=this.focus.get(),s=this.findPreviousIndex(r.length>0?r[0]-e:0,t,o);s>-1&&this.setFocus([s],n)}focusNextPage(e,t){return nae(this,void 0,void 0,function*(){let n=this.view.indexAt(this.view.getScrollTop()+this.view.renderHeight);n=n===0?0:n-1;const o=this.getFocus()[0];if(o!==n&&(o===void 0||n>o)){const r=this.findPreviousIndex(n,!1,t);r>-1&&o!==r?this.setFocus([r],e):this.setFocus([n],e)}else{const r=this.view.getScrollTop();let s=r+this.view.renderHeight;n>o&&(s-=this.view.elementHeight(n)),this.view.setScrollTop(s),this.view.getScrollTop()!==r&&(this.setFocus([]),yield wv(0),yield this.focusNextPage(e,t))}})}focusPreviousPage(e,t){return nae(this,void 0,void 0,function*(){let n;const o=this.view.getScrollTop();o===0?n=this.view.indexAt(o):n=this.view.indexAfter(o-1);const r=this.getFocus()[0];if(r!==n&&(r===void 0||r>=n)){const s=this.findNextIndex(n,!1,t);s>-1&&r!==s?this.setFocus([s],e):this.setFocus([n],e)}else{const s=o;this.view.setScrollTop(o-this.view.renderHeight),this.view.getScrollTop()!==s&&(this.setFocus([]),yield wv(0),yield this.focusPreviousPage(e,t))}})}focusLast(e,t){if(this.length===0)return;const n=this.findPreviousIndex(this.length-1,!1,t);n>-1&&this.setFocus([n],e)}focusFirst(e,t){this.focusNth(0,e,t)}focusNth(e,t,n){if(this.length===0)return;const o=this.findNextIndex(e,!1,n);o>-1&&this.setFocus([o],t)}findNextIndex(e,t=!1,n){for(let o=0;o=this.length&&!t)return-1;if(e=e%this.length,!n||n(this.element(e)))return e;e++}return-1}findPreviousIndex(e,t=!1,n){for(let o=0;othis.view.element(e))}reveal(e,t){if(e<0||e>=this.length)throw new q1(this.user,`Invalid index ${e}`);const n=this.view.getScrollTop(),o=this.view.elementTop(e),r=this.view.elementHeight(e);if(vv(t)){const s=r-this.view.renderHeight;this.view.setScrollTop(s*Za(t,0,1)+o)}else{const s=o+r,a=n+this.view.renderHeight;o=a||(o=a&&r>=this.view.renderHeight?this.view.setScrollTop(o):s>=a&&this.view.setScrollTop(s-this.view.renderHeight))}}getHTMLElement(){return this.view.domNode}getElementID(e){return this.view.getElementDomId(e)}style(e){this.styleController.style(e)}toListEvent({indexes:e,browserEvent:t}){return{indexes:e,elements:e.map(n=>this.view.element(n)),browserEvent:t}}_onFocusChange(){const e=this.focus.get();this.view.domNode.classList.toggle("element-focused",e.length>0),this.onDidChangeActiveDescendant()}onDidChangeActiveDescendant(){var e;const t=this.focus.get();if(t.length>0){let n;!((e=this.accessibilityProvider)===null||e===void 0)&&e.getActiveDescendantId&&(n=this.accessibilityProvider.getActiveDescendantId(this.view.element(t[0]))),this.view.domNode.setAttribute("aria-activedescendant",n||this.view.getElementDomId(t[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()}}zb([Mo],Ku.prototype,"onDidChangeFocus",null);zb([Mo],Ku.prototype,"onDidChangeSelection",null);zb([Mo],Ku.prototype,"onContextMenu",null);zb([Mo],Ku.prototype,"onKeyDown",null);zb([Mo],Ku.prototype,"onDidFocus",null);const p0=He,B1e="selectOption.entry.template";class kdt{get templateId(){return B1e}renderTemplate(e){const t=Object.create(null);return t.root=e,t.text=Ae(e,p0(".option-text")),t.detail=Ae(e,p0(".option-detail")),t.decoratorRight=Ae(e,p0(".option-decorator-right")),t}renderElement(e,t,n){const o=n,r=e.text,s=e.detail,a=e.decoratorRight,l=e.isDisabled;o.text.textContent=r,o.detail.textContent=s||"",o.decoratorRight.innerText=a||"",l?o.root.classList.add("option-disabled"):o.root.classList.remove("option-disabled")}disposeTemplate(e){}}class Bh extends _e{constructor(e,t,n,o,r){super(),this.options=[],this._currentSelection=0,this._hasDetails=!1,this._skipLayout=!1,this._sticky=!1,this._isVisible=!1,this.styles=o,this.selectBoxOptions=r||Object.create(null),typeof this.selectBoxOptions.minBottomMargin!="number"?this.selectBoxOptions.minBottomMargin=Bh.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 le,this._register(this._onDidSelect),this.registerListeners(),this.constructSelectDropDown(n),this.selected=t||0,e&&this.setOptions(e,t),this.initStyleSheet()}getHeight(){return 22}getTemplateId(){return B1e}constructSelectDropDown(e){this.contextViewProvider=e,this.selectDropDownContainer=He(".monaco-select-box-dropdown-container"),this.selectDropDownContainer.classList.add("monaco-select-box-dropdown-padding"),this.selectionDetailsPane=Ae(this.selectDropDownContainer,p0(".select-box-details-pane"));const t=Ae(this.selectDropDownContainer,p0(".select-box-dropdown-container-width-control")),n=Ae(t,p0(".width-control-div"));this.widthControlElement=document.createElement("span"),this.widthControlElement.className="option-text-width-control",Ae(n,this.widthControlElement),this._dropDownPosition=0,this.styleElement=Bc(this.selectDropDownContainer),this.selectDropDownContainer.setAttribute("draggable","true"),this._register(ke(this.selectDropDownContainer,et.DRAG_START,o=>{dn.stop(o,!0)}))}registerListeners(){this._register(No(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.selectElement.title=this.options[this.selected].text)})),this._register(ke(this.selectElement,et.CLICK,t=>{dn.stop(t),this._isVisible?this.hideSelectDropDown(!0):this.showSelectDropDown()})),this._register(ke(this.selectElement,et.MOUSE_DOWN,t=>{dn.stop(t)}));let e;this._register(ke(this.selectElement,"touchstart",t=>{e=this._isVisible})),this._register(ke(this.selectElement,"touchend",t=>{dn.stop(t),e?this.hideSelectDropDown(!0):this.showSelectDropDown()})),this._register(ke(this.selectElement,et.KEY_DOWN,t=>{const n=new Pi(t);let o=!1;Nn?(n.keyCode===18||n.keyCode===16||n.keyCode===10||n.keyCode===3)&&(o=!0):(n.keyCode===18&&n.altKey||n.keyCode===16&&n.altKey||n.keyCode===10||n.keyCode===3)&&(o=!0),o&&(this.showSelectDropDown(),dn.stop(t,!0))}))}get onDidSelect(){return this._onDidSelect.event}setOptions(e,t){Lo(this.options,e)||(this.options=e,this.selectElement.options.length=0,this._hasDetails=!1,this._cachedMaxDetailsHeight=void 0,this.options.forEach((n,o)=>{this.selectElement.add(this.createOption(n.text,o,n.isDisabled)),typeof n.description=="string"&&(this._hasDetails=!0)})),t!==void 0&&(this.select(t),this._currentSelection=this.selected)}setOptionsList(){var e;(e=this.selectList)===null||e===void 0||e.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.selectElement.title=this.options[this.selected].text)}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(){var e,t,n;const o=(e=this.styles.selectBackground)!==null&&e!==void 0?e:"",r=(t=this.styles.selectForeground)!==null&&t!==void 0?t:"",s=(n=this.styles.selectBorder)!==null&&n!==void 0?n:"";this.selectElement.style.backgroundColor=o,this.selectElement.style.color=r,this.selectElement.style.borderColor=s}styleList(){var e,t;const n=(e=this.styles.selectBackground)!==null&&e!==void 0?e:"",o=E0(this.styles.selectListBackground,n);this.selectDropDownListContainer.style.backgroundColor=o,this.selectionDetailsPane.style.backgroundColor=o;const r=(t=this.styles.focusBorder)!==null&&t!==void 0?t:"";this.selectDropDownContainer.style.outlineColor=r,this.selectDropDownContainer.style.outlineOffset="-1px",this.selectList.style(this.styles)}createOption(e,t,n){const o=document.createElement("option");return o.value=e,o.text=e,o.disabled=!!n,o}showSelectDropDown(){this.selectionDetailsPane.innerText="",!(!this.contextViewProvider||this._isVisible)&&(this.createSelectList(this.selectDropDownContainer),this.setOptionsList(),this.contextViewProvider.showContextView({getAnchor:()=>this.selectElement,render:e=>this.renderSelectDropDown(e,!0),layout:()=>{this.layoutSelectDropDown()},onHide:()=>{this.selectDropDownContainer.classList.remove("visible"),this.selectElement.classList.remove("synthetic-focus")},anchorPosition:this._dropDownPosition},this.selectBoxOptions.optionsAsChildren?this.container:void 0),this._isVisible=!0,this.hideSelectDropDown(!1),this.contextViewProvider.showContextView({getAnchor:()=>this.selectElement,render:e=>this.renderSelectDropDown(e),layout:()=>this.layoutSelectDropDown(),onHide:()=>{this.selectDropDownContainer.classList.remove("visible"),this.selectElement.classList.remove("synthetic-focus")},anchorPosition:this._dropDownPosition},this.selectBoxOptions.optionsAsChildren?this.container:void 0),this._currentSelection=this.selected,this._isVisible=!0,this.selectElement.setAttribute("aria-expanded","true"))}hideSelectDropDown(e){!this.contextViewProvider||!this._isVisible||(this._isVisible=!1,this.selectElement.setAttribute("aria-expanded","false"),e&&this.selectElement.focus(),this.contextViewProvider.hideContextView())}renderSelectDropDown(e,t){return e.appendChild(this.selectDropDownContainer),this.layoutSelectDropDown(t),{dispose:()=>{try{e.removeChild(this.selectDropDownContainer)}catch{}}}}measureMaxDetailsHeight(){let e=0;return this.options.forEach((t,n)=>{this.updateDetail(n),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=Yo(this.selectElement),n=getComputedStyle(this.selectElement),o=parseFloat(n.getPropertyValue("--dropdown-padding-top"))+parseFloat(n.getPropertyValue("--dropdown-padding-bottom")),r=window.innerHeight-t.top-t.height-(this.selectBoxOptions.minBottomMargin||0),s=t.top-Bh.DEFAULT_DROPDOWN_MINIMUM_TOP_MARGIN,a=this.selectElement.offsetWidth,l=this.setWidthControlElement(this.widthControlElement),c=Math.max(l,Math.round(a)).toString()+"px";this.selectDropDownContainer.style.width=c,this.selectList.getHTMLElement().style.height="",this.selectList.layout();let u=this.selectList.contentHeight;this._hasDetails&&this._cachedMaxDetailsHeight===void 0&&(this._cachedMaxDetailsHeight=this.measureMaxDetailsHeight());const d=this._hasDetails?this._cachedMaxDetailsHeight:0,h=u+o+d,f=Math.floor((r-o-d)/this.getHeight()),g=Math.floor((s-o-d)/this.getHeight());if(e)return t.top+t.height>window.innerHeight-22||t.topf&&this.options.length>f?(this._dropDownPosition=1,this.selectDropDownContainer.removeChild(this.selectDropDownListContainer),this.selectDropDownContainer.removeChild(this.selectionDetailsPane),this.selectDropDownContainer.appendChild(this.selectionDetailsPane),this.selectDropDownContainer.appendChild(this.selectDropDownListContainer),this.selectionDetailsPane.classList.remove("border-top"),this.selectionDetailsPane.classList.add("border-bottom")):(this._dropDownPosition=0,this.selectDropDownContainer.removeChild(this.selectDropDownListContainer),this.selectDropDownContainer.removeChild(this.selectionDetailsPane),this.selectDropDownContainer.appendChild(this.selectDropDownListContainer),this.selectDropDownContainer.appendChild(this.selectionDetailsPane),this.selectionDetailsPane.classList.remove("border-bottom"),this.selectionDetailsPane.classList.add("border-top")),!0);if(t.top+t.height>window.innerHeight-22||t.topr&&(u=f*this.getHeight())}else h>s&&(u=g*this.getHeight());return this.selectList.layout(u),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=u+o+"px",this.selectDropDownContainer.style.height=""):this.selectDropDownContainer.style.height=u+o+"px",this.updateDetail(this.selected),this.selectDropDownContainer.style.width=c,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 n=0,o=0;this.options.forEach((r,s)=>{const a=r.detail?r.detail.length:0,l=r.decoratorRight?r.decoratorRight.length:0,c=r.text.length+a+l;c>o&&(n=s,o=c)}),e.textContent=this.options[n].text+(this.options[n].decoratorRight?this.options[n].decoratorRight+" ":""),t=La(e)}return t}createSelectList(e){if(this.selectList)return;this.selectDropDownListContainer=Ae(e,p0(".select-box-dropdown-list-container")),this.listRenderer=new kdt,this.selectList=new Ku("SelectBoxCustom",this.selectDropDownListContainer,this,[this.listRenderer],{useShadows:!1,verticalScrollMode:3,keyboardSupport:!1,mouseSupport:!1,accessibilityProvider:{getAriaLabel:o=>{let r=o.text;return o.detail&&(r+=`. ${o.detail}`),o.decoratorRight&&(r+=`. ${o.decoratorRight}`),o.description&&(r+=`. ${o.description}`),r},getWidgetAriaLabel:()=>C({key:"selectBox",comment:["Behave like native select dropdown element."]},"Select Box"),getRole:()=>Nn?"":"option",getWidgetRole:()=>"listbox"}}),this.selectBoxOptions.ariaLabel&&(this.selectList.ariaLabel=this.selectBoxOptions.ariaLabel);const t=this._register(new xn(this.selectDropDownListContainer,"keydown")),n=st.chain(t.event,o=>o.filter(()=>this.selectList.length>0).map(r=>new Pi(r)));this._register(st.chain(n,o=>o.filter(r=>r.keyCode===3))(this.onEnter,this)),this._register(st.chain(n,o=>o.filter(r=>r.keyCode===2))(this.onEnter,this)),this._register(st.chain(n,o=>o.filter(r=>r.keyCode===9))(this.onEscape,this)),this._register(st.chain(n,o=>o.filter(r=>r.keyCode===16))(this.onUpArrow,this)),this._register(st.chain(n,o=>o.filter(r=>r.keyCode===18))(this.onDownArrow,this)),this._register(st.chain(n,o=>o.filter(r=>r.keyCode===12))(this.onPageDown,this)),this._register(st.chain(n,o=>o.filter(r=>r.keyCode===11))(this.onPageUp,this)),this._register(st.chain(n,o=>o.filter(r=>r.keyCode===14))(this.onHome,this)),this._register(st.chain(n,o=>o.filter(r=>r.keyCode===13))(this.onEnd,this)),this._register(st.chain(n,o=>o.filter(r=>r.keyCode>=21&&r.keyCode<=56||r.keyCode>=85&&r.keyCode<=113))(this.onCharacter,this)),this._register(ke(this.selectList.getHTMLElement(),et.POINTER_UP,o=>this.onPointerUp(o))),this._register(this.selectList.onMouseOver(o=>typeof o.index!="undefined"&&this.selectList.setFocus([o.index]))),this._register(this.selectList.onDidChangeFocus(o=>this.onListFocus(o))),this._register(ke(this.selectDropDownContainer,et.FOCUS_OUT,o=>{!this._isVisible||os(o.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;dn.stop(e);const t=e.target;if(!t||t.classList.contains("slider"))return;const n=t.closest(".monaco-list-row");if(!n)return;const o=Number(n.getAttribute("data-index")),r=n.classList.contains("option-disabled");o>=0&&o{for(let s=0;sthis.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&&(dn.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){dn.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){dn.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){dn.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=yg.toString(e.keyCode);let n=-1;for(let o=0;o{this._register(ke(this.selectElement,e,t=>{this.selectElement.focus()}))}),this._register(No(this.selectElement,"click",e=>{dn.stop(e,!0)})),this._register(No(this.selectElement,"change",e=>{this.selectElement.title=e.target.value,this._onDidSelect.fire({index:e.target.selectedIndex,selected:e.target.value})})),this._register(No(this.selectElement,"keydown",e=>{let t=!1;Nn?(e.keyCode===18||e.keyCode===16||e.keyCode===10)&&(t=!0):(e.keyCode===18&&e.altKey||e.keyCode===10||e.keyCode===3)&&(t=!0),t&&e.stopPropagation()}))}get onDidSelect(){return this._onDidSelect.event}setOptions(e,t){(!this.options||!Lo(this.options,e))&&(this.options=e,this.selectElement.options.length=0,this.options.forEach((n,o)=>{this.selectElement.add(this.createOption(n.text,o,n.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(o)}))}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 gy)),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(Ei.addTarget(e));const n=this.options&&this.options.draggable;n&&(e.draggable=!0,Oc&&this._register(ke(e,et.DRAG_START,o=>{var r;return(r=o.dataTransfer)===null||r===void 0?void 0:r.setData(pk.TEXT,this._action.label)}))),this._register(ke(t,Di.Tap,o=>this.onClick(o,!0))),this._register(ke(t,et.MOUSE_DOWN,o=>{n||dn.stop(o,!0),this._action.enabled&&o.button===0&&t.classList.add("active")})),Nn&&this._register(ke(t,et.CONTEXT_MENU,o=>{o.button===0&&o.ctrlKey===!0&&this.onClick(o)})),this._register(ke(t,et.CLICK,o=>{dn.stop(o,!0),this.options&&this.options.isMenu||this.onClick(o)})),this._register(ke(t,et.DBLCLICK,o=>{dn.stop(o,!0)})),[et.MOUSE_UP,et.MOUSE_OUT].forEach(o=>{this._register(ke(t,o,r=>{dn.stop(r),t.classList.remove("active")}))})}onClick(e,t=!1){var n;dn.stop(e,!0);const o=Ml(this._context)?!((n=this.options)===null||n===void 0)&&n.useEventAsContext?e:{preserveFocus:t}:this._context;this.actionRunner.run(this._action,o)}focus(){this.element&&(this.element.tabIndex=0,this.element.focus(),this.element.classList.add("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(){}getTooltip(){return this.action.tooltip}updateTooltip(){var e;if(!this.element)return;const t=(e=this.getTooltip())!==null&&e!==void 0?e:"";this.updateAriaLabel(),this.options.hoverDelegate?(this.element.title="",this.customHover?this.customHover.update(t):(this.customHover=T1e(this.options.hoverDelegate,this.element,t),this._store.add(this.customHover))):this.element.title=t}updateAriaLabel(){var e;if(this.element){const t=(e=this.getTooltip())!==null&&e!==void 0?e:"";this.element.setAttribute("aria-label",t)}}updateClass(){}updateChecked(){}dispose(){this.element&&(this.element.remove(),this.element=void 0),this._context=void 0,super.dispose()}}class My extends wd{constructor(e,t,n){super(e,t,n),this.options=n,this.options.icon=n.icon!==void 0?n.icon:!1,this.options.label=n.label!==void 0?n.label:!0,this.cssClass=""}render(e){super.render(e),this.element&&(this.label=Ae(this.element,He("a.action-label"))),this.label&&this.label.setAttribute("role",this.getDefaultAriaRole()),this.options.label&&this.options.keybinding&&this.element&&(Ae(this.element,He("span.keybinding")).textContent=this.options.keybinding),this.updateClass(),this.updateLabel(),this.updateTooltip(),this.updateEnabled(),this.updateChecked()}getDefaultAriaRole(){return this._action.id===kr.ID?"presentation":this.options.isMenu?"menuitem":"button"}focus(){this.label&&(this.label.tabIndex=0,this.label.focus())}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=C({key:"titleLabel",comment:["action title","action keybinding"]},"{0} ({1})",e,this.options.keybinding))),e!=null?e:void 0}updateClass(){var e;this.cssClass&&this.label&&this.label.classList.remove(...this.cssClass.split(" ")),this.options.icon?(this.cssClass=this.action.class,this.label&&(this.label.classList.add("codicon"),this.cssClass&&this.label.classList.add(...this.cssClass.split(" "))),this.updateEnabled()):(e=this.label)===null||e===void 0||e.classList.remove("codicon")}updateEnabled(){var e,t;this.action.enabled?(this.label&&(this.label.removeAttribute("aria-disabled"),this.label.classList.remove("disabled")),(e=this.element)===null||e===void 0||e.classList.remove("disabled")):(this.label&&(this.label.setAttribute("aria-disabled","true"),this.label.classList.add("disabled")),(t=this.element)===null||t===void 0||t.classList.add("disabled"))}updateAriaLabel(){var e;if(this.label){const t=(e=this.getTooltip())!==null&&e!==void 0?e:"";this.label.setAttribute("aria-label",t)}}updateChecked(){this.label&&(this.action.checked!==void 0?(this.label.classList.toggle("checked",this.action.checked),this.label.setAttribute("aria-checked",this.action.checked?"true":"false"),this.label.setAttribute("role","checkbox")):(this.label.classList.remove("checked"),this.label.setAttribute("aria-checked",""),this.label.setAttribute("role",this.getDefaultAriaRole())))}}class Ndt extends wd{constructor(e,t,n,o,r,s,a){super(e,t),this.selectBox=new Tdt(n,o,r,s,a),this.selectBox.setFocusable(!1),this._register(this.selectBox),this.registerListeners()}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(){var e;(e=this.selectBox)===null||e===void 0||e.focus()}blur(){var e;(e=this.selectBox)===null||e===void 0||e.blur()}render(e){this.selectBox.render(e)}}class Rdt extends gy{constructor(e,t){super(),this._onDidChangeVisibility=this._register(new le),this.onDidChangeVisibility=this._onDidChangeVisibility.event,this._element=Ae(e,He(".monaco-dropdown")),this._label=Ae(this._element,He(".dropdown-label"));let n=t.labelRenderer;n||(n=r=>(r.textContent=t.label||"",null));for(const r of[et.CLICK,et.MOUSE_DOWN,Di.Tap])this._register(ke(this.element,r,s=>dn.stop(s,!0)));for(const r of[et.MOUSE_DOWN,Di.Tap])this._register(ke(this._label,r,s=>{s instanceof MouseEvent&&(s.detail>1||s.button!==0)||(this.visible?this.hide():this.show())}));this._register(ke(this._label,et.KEY_UP,r=>{const s=new Pi(r);(s.equals(3)||s.equals(10))&&(dn.stop(r,!0),this.visible?this.hide():this.show())}));const o=n(this._label);o&&this._register(o),this._register(Ei.addTarget(this._label))}get element(){return this._element}show(){this.visible||(this.visible=!0,this._onDidChangeVisibility.fire(!0))}hide(){this.visible&&(this.visible=!1,this._onDidChangeVisibility.fire(!1))}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 Mdt extends Rdt{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:0,domForShadowRoot:this._options.menuAsChild?this.element:void 0,skipTelemetry:this._options.skipTelemetry})}hide(){super.hide()}onHide(){this.hide(),this.element.classList.remove("active")}}class NP extends wd{constructor(e,t,n,o=Object.create(null)){super(null,e,o),this.actionItem=null,this._onDidChangeVisibility=this._register(new le),this.onDidChangeVisibility=this._onDidChangeVisibility.event,this.menuActionsOrProvider=t,this.contextMenuProvider=n,this.options=o,this.options.actionRunner&&(this.actionRunner=this.options.actionRunner)}render(e){this.actionItem=e;const t=r=>{this.element=Ae(r,He("a.action-label"));let s=[];return typeof this.options.classNames=="string"?s=this.options.classNames.split(/\s+/g).filter(a=>!!a):this.options.classNames&&(s=this.options.classNames),s.find(a=>a==="icon")||s.push("codicon"),this.element.classList.add(...s),this.element.setAttribute("role","button"),this.element.setAttribute("aria-haspopup","true"),this.element.setAttribute("aria-expanded","false"),this.element.title=this._action.label||"",this.element.ariaLabel=this._action.label||"",null},n=Array.isArray(this.menuActionsOrProvider),o={contextMenuProvider:this.contextMenuProvider,labelRenderer:t,menuAsChild:this.options.menuAsChild,actions:n?this.menuActionsOrProvider:void 0,actionProvider:n?void 0:this.menuActionsOrProvider,skipTelemetry:this.options.skipTelemetry};if(this.dropdownMenu=this._register(new Mdt(e,o)),this._register(this.dropdownMenu.onDidChangeVisibility(r=>{var s;(s=this.element)===null||s===void 0||s.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=Object.assign(Object.assign({},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!=null?e:void 0}setActionContext(e){super.setActionContext(e),this.dropdownMenu&&(this.dropdownMenu.menuOptions?this.dropdownMenu.menuOptions.context=e:this.dropdownMenu.menuOptions={context:e})}show(){var e;(e=this.dropdownMenu)===null||e===void 0||e.show()}updateEnabled(){var e,t;const n=!this.action.enabled;(e=this.actionItem)===null||e===void 0||e.classList.toggle("disabled",n),(t=this.element)===null||t===void 0||t.classList.toggle("disabled",n)}}function Adt(i){return i?i.condition!==void 0:!1}var TL=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},Mw;(function(i){i[i.STORAGE_DOES_NOT_EXIST=0]="STORAGE_DOES_NOT_EXIST",i[i.STORAGE_IN_MEMORY=1]="STORAGE_IN_MEMORY"})(Mw||(Mw={}));var KC;(function(i){i[i.None=0]="None",i[i.Initialized=1]="Initialized",i[i.Closed=2]="Closed"})(KC||(KC={}));class Aw extends _e{constructor(e,t=Object.create(null)){super(),this.database=e,this.options=t,this._onDidChangeStorage=this._register(new q0),this.onDidChangeStorage=this._onDidChangeStorage.event,this.state=KC.None,this.cache=new Map,this.flushDelayer=this._register(new m0e(Aw.DEFAULT_FLUSH_DELAY)),this.pendingDeletes=new Set,this.pendingInserts=new Map,this.whenFlushedCallbacks=[],this.registerListeners()}registerListeners(){this._register(this.database.onDidChangeItemsExternal(e=>this.onDidChangeItemsExternal(e)))}onDidChangeItemsExternal(e){var t,n;this._onDidChangeStorage.pause();try{(t=e.changed)===null||t===void 0||t.forEach((o,r)=>this.acceptExternal(r,o)),(n=e.deleted)===null||n===void 0||n.forEach(o=>this.acceptExternal(o,void 0))}finally{this._onDidChangeStorage.resume()}}acceptExternal(e,t){if(this.state===KC.Closed)return;let n=!1;Ml(t)?n=this.cache.delete(e):this.cache.get(e)!==t&&(this.cache.set(e,t),n=!0),n&&this._onDidChangeStorage.fire({key:e,external:!0})}get(e,t){const n=this.cache.get(e);return Ml(n)?t:n}getBoolean(e,t){const n=this.get(e);return Ml(n)?t:n==="true"}getNumber(e,t){const n=this.get(e);return Ml(n)?t:parseInt(n,10)}set(e,t,n=!1){return TL(this,void 0,void 0,function*(){if(this.state===KC.Closed)return;if(Ml(t))return this.delete(e,n);const o=na(t)||Array.isArray(t)?Hut(t):String(t);if(this.cache.get(e)!==o)return this.cache.set(e,o),this.pendingInserts.set(e,o),this.pendingDeletes.delete(e),this._onDidChangeStorage.fire({key:e,external:n}),this.doFlush()})}delete(e,t=!1){return TL(this,void 0,void 0,function*(){if(!(this.state===KC.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()})}get hasPending(){return this.pendingInserts.size>0||this.pendingDeletes.size>0}flushPending(){return TL(this,void 0,void 0,function*(){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(()=>{var t;if(!this.hasPending)for(;this.whenFlushedCallbacks.length;)(t=this.whenFlushedCallbacks.pop())===null||t===void 0||t()})})}doFlush(e){return TL(this,void 0,void 0,function*(){return this.options.hint===Mw.STORAGE_IN_MEMORY?this.flushPending():this.flushDelayer.trigger(()=>this.flushPending(),e)})}}Aw.DEFAULT_FLUSH_DELAY=100;class O9{constructor(){this.onDidChangeItemsExternal=st.None,this.items=new Map}updateItems(e){var t,n;return TL(this,void 0,void 0,function*(){(t=e.insert)===null||t===void 0||t.forEach((o,r)=>this.items.set(r,o)),(n=e.delete)===null||n===void 0||n.forEach(o=>this.items.delete(o))})}}const gM="__$__targetStorageMarker",qu=wn("storageService");var RP;(function(i){i[i.NONE=0]="NONE",i[i.SHUTDOWN=1]="SHUTDOWN"})(RP||(RP={}));function Pdt(i){const e=i.get(gM);if(e)try{return JSON.parse(e)}catch{}return Object.create(null)}class M5 extends _e{constructor(e={flushInterval:M5.DEFAULT_FLUSH_INTERVAL}){super(),this.options=e,this._onDidChangeValue=this._register(new q0),this._onDidChangeTarget=this._register(new q0),this._onWillSaveState=this._register(new le),this.onWillSaveState=this._onWillSaveState.event,this._workspaceKeyTargets=void 0,this._profileKeyTargets=void 0,this._applicationKeyTargets=void 0}onDidChangeValue(e,t,n){return st.filter(this._onDidChangeValue.event,o=>o.scope===e&&(t===void 0||o.key===t),n)}emitDidChangeValue(e,t){const{key:n,external:o}=t;if(n===gM){switch(e){case-1:this._applicationKeyTargets=void 0;break;case 0:this._profileKeyTargets=void 0;break;case 1:this._workspaceKeyTargets=void 0;break}this._onDidChangeTarget.fire({scope:e})}else this._onDidChangeValue.fire({scope:e,key:n,target:this.getKeyTargets(e)[n],external:o})}get(e,t,n){var o;return(o=this.getStorage(t))===null||o===void 0?void 0:o.get(e,n)}getBoolean(e,t,n){var o;return(o=this.getStorage(t))===null||o===void 0?void 0:o.getBoolean(e,n)}getNumber(e,t,n){var o;return(o=this.getStorage(t))===null||o===void 0?void 0:o.getNumber(e,n)}store(e,t,n,o,r=!1){if(Ml(t)){this.remove(e,n,r);return}this.withPausedEmitters(()=>{var s;this.updateKeyTarget(e,n,o),(s=this.getStorage(n))===null||s===void 0||s.set(e,t,r)})}remove(e,t,n=!1){this.withPausedEmitters(()=>{var o;this.updateKeyTarget(e,t,void 0),(o=this.getStorage(t))===null||o===void 0||o.delete(e,n)})}withPausedEmitters(e){this._onDidChangeValue.pause(),this._onDidChangeTarget.pause();try{e()}finally{this._onDidChangeValue.resume(),this._onDidChangeTarget.resume()}}updateKeyTarget(e,t,n,o=!1){var r,s;const a=this.getKeyTargets(t);typeof n=="number"?a[e]!==n&&(a[e]=n,(r=this.getStorage(t))===null||r===void 0||r.set(gM,JSON.stringify(a),o)):typeof a[e]=="number"&&(delete a[e],(s=this.getStorage(t))===null||s===void 0||s.set(gM,JSON.stringify(a),o))}get workspaceKeyTargets(){return this._workspaceKeyTargets||(this._workspaceKeyTargets=this.loadKeyTargets(1)),this._workspaceKeyTargets}get profileKeyTargets(){return this._profileKeyTargets||(this._profileKeyTargets=this.loadKeyTargets(0)),this._profileKeyTargets}get applicationKeyTargets(){return this._applicationKeyTargets||(this._applicationKeyTargets=this.loadKeyTargets(-1)),this._applicationKeyTargets}getKeyTargets(e){switch(e){case-1:return this.applicationKeyTargets;case 0:return this.profileKeyTargets;default:return this.workspaceKeyTargets}}loadKeyTargets(e){const t=this.getStorage(e);return t?Pdt(t):Object.create(null)}}M5.DEFAULT_FLUSH_INTERVAL=60*1e3;class Odt extends M5{constructor(){super(),this.applicationStorage=this._register(new Aw(new O9,{hint:Mw.STORAGE_IN_MEMORY})),this.profileStorage=this._register(new Aw(new O9,{hint:Mw.STORAGE_IN_MEMORY})),this.workspaceStorage=this._register(new Aw(new O9,{hint:Mw.STORAGE_IN_MEMORY})),this._register(this.workspaceStorage.onDidChangeStorage(e=>this.emitDidChangeValue(1,e))),this._register(this.profileStorage.onDidChangeStorage(e=>this.emitDidChangeValue(0,e))),this._register(this.applicationStorage.onDidChangeStorage(e=>this.emitDidChangeValue(-1,e)))}getStorage(e){switch(e){case-1:return this.applicationStorage;case 0:return this.profileStorage;default:return this.workspaceStorage}}}function Fdt(i,e){const t=Object.assign({},e);for(const n in i){const o=i[n];t[n]=o!==void 0?ct(o):void 0}return t}const Bdt={keybindingLabelBackground:ct(Cnt),keybindingLabelForeground:ct(wnt),keybindingLabelBorder:ct(ynt),keybindingLabelBottomBorder:ct(Snt),keybindingLabelShadow:ct(Kh)},Wdt={buttonForeground:ct(vL),buttonSeparator:ct(snt),buttonBackground:ct(_L),buttonHoverBackground:ct(ant),buttonSecondaryForeground:ct(cnt),buttonSecondaryBackground:ct(lH),buttonSecondaryHoverBackground:ct(unt),buttonBorder:ct(lnt)},Vdt={progressBarBackground:ct(fnt)},MP={inputActiveOptionBorder:ct(pG),inputActiveOptionForeground:ct(mG),inputActiveOptionBackground:ct(u0)};ct(nit),ct(oit),ct(iit);ct(po),ct(Xh),ct(Kh),ct(Ln),ct(Cit),ct(wit),ct(yit),ct(Xtt);const AP={inputBackground:ct(G0e),inputForeground:ct(X0e),inputBorder:ct(Y0e),inputValidationInfoBorder:ct(Qtt),inputValidationInfoBackground:ct(Ytt),inputValidationInfoForeground:ct(Ztt),inputValidationWarningBorder:ct(tnt),inputValidationWarningBackground:ct(Jtt),inputValidationWarningForeground:ct(ent),inputValidationErrorBorder:ct(ont),inputValidationErrorBackground:ct(nnt),inputValidationErrorForeground:ct(int)},Hdt={listFilterWidgetBackground:ct(Xnt),listFilterWidgetOutline:ct(Ynt),listFilterWidgetNoMatchesOutline:ct(Znt),listFilterWidgetShadow:ct(Qnt),inputBoxStyles:AP,toggleStyles:MP},W1e={badgeBackground:ct(rM),badgeForeground:ct(dnt),badgeBorder:ct(Ln)};ct(fit),ct(hit),ct(bre),ct(bre),ct(git);const Ub={listBackground:void 0,listInactiveFocusForeground:void 0,listFocusBackground:ct(Wnt),listFocusForeground:ct(Vnt),listFocusOutline:ct(Hnt),listActiveSelectionBackground:ct(Fg),listActiveSelectionForeground:ct(Qh),listActiveSelectionIconForeground:ct(yL),listFocusAndSelectionOutline:ct($nt),listFocusAndSelectionBackground:ct(Fg),listFocusAndSelectionForeground:ct(Qh),listInactiveSelectionBackground:ct(znt),listInactiveSelectionIconForeground:ct(jnt),listInactiveSelectionForeground:ct(Unt),listInactiveFocusBackground:ct(Knt),listInactiveFocusOutline:ct(qnt),listHoverBackground:ct(J0e),listHoverForeground:ct(ebe),listDropBackground:ct(Gnt),listSelectionOutline:ct(Wi),listHoverOutline:ct(Wi),treeIndentGuidesStroke:ct(SL),treeInactiveIndentGuidesStroke:ct(Jnt),tableColumnsBorder:ct(eit),tableOddRowsBackgroundColor:ct(tit)};function SS(i){return Fdt(i,Ub)}const $dt={selectBackground:ct(qh),selectListBackground:ct(rnt),selectForeground:ct(Ag),decoratorRightForeground:ct(Z0e),selectBorder:ct(MC),focusBorder:ct(Vl),listFocusBackground:ct(h0),listInactiveSelectionIconForeground:ct(AC),listFocusForeground:ct(d0),listFocusOutline:Ktt(Wi,ve.transparent.toString()),listHoverBackground:ct(J0e),listHoverForeground:ct(ebe),listHoverOutline:ct(Wi),selectListBorder:ct(Yh),listBackground:void 0,listActiveSelectionBackground:void 0,listActiveSelectionForeground:void 0,listActiveSelectionIconForeground:void 0,listFocusAndSelectionBackground:void 0,listDropBackground: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},zdt={shadowColor:ct(Kh),borderColor:ct(rit),foregroundColor:ct(sit),backgroundColor:ct(ait),selectionForegroundColor:ct(lit),selectionBackgroundColor:ct(cit),selectionBorderColor:ct(uit),separatorColor:ct(dit),scrollbarShadow:ct(hnt),scrollbarSliderBackground:ct(bL),scrollbarSliderHoverBackground:ct(CL),scrollbarSliderActiveBackground:ct(wL)};var A5=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Ta=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},V1e=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};function Udt(i,e,t,n){const o=i.getActions(e),r=Ng.getInstance(),s=r.keyStatus.altKey||(as||Ss)&&r.keyStatus.shiftKey;$1e(o,t,s,n?a=>a===n:a=>a==="navigation")}function H1e(i,e,t,n,o,r){const s=i.getActions(e);$1e(s,t,!1,typeof n=="string"?l=>l===n:n,o,r)}function $1e(i,e,t,n=s=>s==="navigation",o=()=>!1,r=!1){let s,a;Array.isArray(e)?(s=e,a=e):(s=e.primary,a=e.secondary);const l=new Set;for(const[c,u]of i){let d;n(c)?(d=s,d.length>0&&r&&d.push(new kr)):(d=a,d.length>0&&d.push(new kr));for(let h of u){t&&(h=h instanceof Ou&&h.alt?h.alt:h);const f=d.push(h);h instanceof py&&l.add({group:c,action:h,index:f-1})}}for(const{group:c,action:u,index:d}of l){const h=n(c)?s:a,f=u.actions;o(u,c,h.length)&&h.splice(d,1,...f)}}let ob=class extends My{constructor(e,t,n,o,r,s,a,l){super(void 0,e,{icon:!!(e.class||e.item.icon),label:!e.class&&!e.item.icon,draggable:t==null?void 0:t.draggable,keybinding:t==null?void 0:t.keybinding,hoverDelegate:t==null?void 0:t.hoverDelegate}),this._keybindingService=n,this._notificationService=o,this._contextKeyService=r,this._themeService=s,this._contextMenuService=a,this._accessibilityService=l,this._wantsAltCommand=!1,this._itemClassDispose=this._register(new Kr),this._altKey=Ng.getInstance()}get _menuItemAction(){return this._action}get _commandAction(){return this._wantsAltCommand&&this._menuItemAction.alt||this._menuItemAction}onClick(e){return V1e(this,void 0,void 0,function*(){e.preventDefault(),e.stopPropagation();try{yield 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 n=()=>{var o;const r=!!(!((o=this._menuItemAction.alt)===null||o===void 0)&&o.enabled)&&(!this._accessibilityService.isMotionReduced()||t)&&(this._altKey.keyStatus.altKey||this._altKey.keyStatus.shiftKey&&t);r!==this._wantsAltCommand&&(this._wantsAltCommand=r,this.updateLabel(),this.updateTooltip(),this.updateClass())};this._register(this._altKey.event(n)),this._register(ke(e,"mouseleave",o=>{t=!1,n()})),this._register(ke(e,"mouseenter",o=>{t=!0,n()})),n()}}updateLabel(){this.options.label&&this.label&&(this.label.textContent=this._commandAction.label)}getTooltip(){var e;const t=this._keybindingService.lookupKeybinding(this._commandAction.id,this._contextKeyService),n=t&&t.getLabel(),o=this._commandAction.tooltip||this._commandAction.label;let r=n?C("titleAndKb","{0} ({1})",o,n):o;if(!this._wantsAltCommand&&((e=this._menuItemAction.alt)===null||e===void 0?void 0:e.enabled)){const s=this._menuItemAction.alt.tooltip||this._menuItemAction.alt.label,a=this._keybindingService.lookupKeybinding(this._menuItemAction.alt.id,this._contextKeyService),l=a&&a.getLabel(),c=l?C("titleAndKb","{0} ({1})",s,l):s;r=C("titleAndKbAndAlt",`{0} -[{1}] {2}`,r,QG.modifierLabels[Wl].altKey,c)}return r}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:n}=this;if(!t||!n)return;const o=this._commandAction.checked&&Adt(e.toggled)&&e.toggled.icon?e.toggled.icon:e.icon;if(!!o)if(Mt.isThemeIcon(o)){const r=Mt.asClassNameArray(o);n.classList.add(...r),this._itemClassDispose.value=zt(()=>{n.classList.remove(...r)})}else{const r=Sy(this._themeService.getColorTheme().type)?Cv(o.dark):Cv(o.light),s=He("span");s.style.webkitMask=s.style.mask=`${r} no-repeat 50% 50%`,s.style.background="var(--vscode-icon-foreground)",s.style.display="inline-block",s.style.width="100%",s.style.height="100%",n.appendChild(s),n.classList.add("icon"),this._itemClassDispose.value=Iu(zt(()=>{n.classList.remove("icon"),jr(n)}),this._themeService.onDidColorThemeChange(()=>{this.updateClass()}))}}};ob=A5([Ta(2,xi),Ta(3,Ao),Ta(4,Ut),Ta(5,mr),Ta(6,ju),Ta(7,pp)],ob);let s$=class extends NP{constructor(e,t,n,o,r){var s,a,l;const c=Object.assign(Object.assign({},t),{menuAsChild:(s=t==null?void 0:t.menuAsChild)!==null&&s!==void 0?s:!1,classNames:(a=t==null?void 0:t.classNames)!==null&&a!==void 0?a:Mt.isThemeIcon(e.item.icon)?Mt.asClassName(e.item.icon):void 0,keybindingProvider:(l=t==null?void 0:t.keybindingProvider)!==null&&l!==void 0?l:u=>n.lookupKeybinding(u.id)});super(e,{getActions:()=>e.actions},o,c),this._keybindingService=n,this._contextMenuService=o,this._themeService=r}render(e){super.render(e),fi(this.element),e.classList.add("menu-entry");const t=this._action,{icon:n}=t.item;if(n&&!Mt.isThemeIcon(n)){this.element.classList.add("icon");const o=()=>{this.element&&(this.element.style.backgroundImage=Sy(this._themeService.getColorTheme().type)?Cv(n.dark):Cv(n.light))};o(),this._register(this._themeService.onDidColorThemeChange(()=>{o()}))}}};s$=A5([Ta(2,xi),Ta(3,ju),Ta(4,mr)],s$);let a$=class extends wd{constructor(e,t,n,o,r,s,a,l){var c,u,d;super(null,e),this._keybindingService=n,this._notificationService=o,this._contextMenuService=r,this._menuService=s,this._instaService=a,this._storageService=l,this._container=null,this._options=t,this._storageKey=`${e.item.submenu.id}_lastActionId`;let h;const f=t!=null&&t.persistLastActionId?l.get(this._storageKey,1):void 0;f&&(h=e.actions.find(p=>f===p.id)),h||(h=e.actions[0]),this._defaultAction=this._instaService.createInstance(ob,h,{keybinding:this._getDefaultActionKeybindingLabel(h)});const g=Object.assign(Object.assign({keybindingProvider:p=>this._keybindingService.lookupKeybinding(p.id)},t),{menuAsChild:(c=t==null?void 0:t.menuAsChild)!==null&&c!==void 0?c:!0,classNames:(u=t==null?void 0:t.classNames)!==null&&u!==void 0?u:["codicon","codicon-chevron-down"],actionRunner:(d=t==null?void 0:t.actionRunner)!==null&&d!==void 0?d:new gy});this._dropdown=new NP(e,e.actions,this._contextMenuService,g),this._dropdown.actionRunner.onDidRun(p=>{p.action instanceof Ou&&this.update(p.action)})}update(e){var t;!((t=this._options)===null||t===void 0)&&t.persistLastActionId&&this._storageService.store(this._storageKey,e.id,1,1),this._defaultAction.dispose(),this._defaultAction=this._instaService.createInstance(ob,e,{keybinding:this._getDefaultActionKeybindingLabel(e)}),this._defaultAction.actionRunner=new class extends gy{runAction(n,o){return V1e(this,void 0,void 0,function*(){yield n.run(void 0)})}},this._container&&this._defaultAction.render(a0e(this._container,He(".action-container")))}_getDefaultActionKeybindingLabel(e){var t;let n;if(!((t=this._options)===null||t===void 0)&&t.renderKeybindingWithDefaultActionLabel){const o=this._keybindingService.lookupKeybinding(e.id);o&&(n=`(${o.getLabel()})`)}return n}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=He(".action-container");this._defaultAction.render(Ae(this._container,t)),this._register(ke(t,et.KEY_DOWN,o=>{const r=new Pi(o);r.equals(17)&&(this._defaultAction.element.tabIndex=-1,this._dropdown.focus(),r.stopPropagation())}));const n=He(".dropdown-action-container");this._dropdown.render(Ae(this._container,n)),this._register(ke(n,et.KEY_DOWN,o=>{var r;const s=new Pi(o);s.equals(15)&&(this._defaultAction.element.tabIndex=0,this._dropdown.setFocusable(!1),(r=this._defaultAction.element)===null||r===void 0||r.focus(),s.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()}};a$=A5([Ta(2,xi),Ta(3,Ao),Ta(4,ju),Ta(5,If),Ta(6,$t),Ta(7,qu)],a$);let l$=class extends Ndt{constructor(e,t){super(null,e,e.actions.map(n=>({text:n.id===kr.ID?"\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500":n.label,isDisabled:!n.enabled})),0,t,$dt,{ariaLabel:e.tooltip,optionsAsChildren:!0}),this.select(Math.max(0,e.actions.findIndex(n=>n.checked)))}render(e){super.render(e),e.style.borderColor=ct(MC)}runAction(e,t){const n=this.action.actions[t];n&&this.actionRunner.run(n)}};l$=A5([Ta(1,mp)],l$);function jdt(i,e,t){return e instanceof Ou?i.createInstance(ob,e,t):e instanceof OD?e.item.isSelection?i.createInstance(l$,e):e.item.rememberDefaultAction?i.createInstance(a$,e,Object.assign(Object.assign({},t),{persistLastActionId:!0})):i.createInstance(s$,e,t):void 0}var Kdt=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};class $c extends _e{constructor(e,t={}){var n,o,r,s,a,l;super(),this._actionRunnerDisposables=this._register(new Be),this.viewItemDisposables=this._register(new Mq),this.triggerKeyDown=!1,this.focusable=!0,this._onDidBlur=this._register(new le),this.onDidBlur=this._onDidBlur.event,this._onDidCancel=this._register(new le({onWillAddFirstListener:()=>this.cancelHasListener=!0})),this.onDidCancel=this._onDidCancel.event,this.cancelHasListener=!1,this._onDidRun=this._register(new le),this.onDidRun=this._onDidRun.event,this._onWillRun=this._register(new le),this.onWillRun=this._onWillRun.event,this.options=t,this._context=(n=t.context)!==null&&n!==void 0?n:null,this._orientation=(o=this.options.orientation)!==null&&o!==void 0?o:0,this._triggerKeys={keyDown:(s=(r=this.options.triggerKeys)===null||r===void 0?void 0:r.keyDown)!==null&&s!==void 0?s:!1,keys:(l=(a=this.options.triggerKeys)===null||a===void 0?void 0:a.keys)!==null&&l!==void 0?l:[3,10]},this.options.actionRunner?this._actionRunner=this.options.actionRunner:(this._actionRunner=new gy,this._actionRunnerDisposables.add(this._actionRunner)),this._actionRunnerDisposables.add(this._actionRunner.onDidRun(d=>this._onDidRun.fire(d))),this._actionRunnerDisposables.add(this._actionRunner.onWillRun(d=>this._onWillRun.fire(d))),this.viewItems=[],this.focusedItem=void 0,this.domNode=document.createElement("div"),this.domNode.className="monaco-action-bar",t.animated!==!1&&this.domNode.classList.add("animated");let c,u;switch(this._orientation){case 0:c=[15],u=[17];break;case 1:c=[16],u=[18],this.domNode.className+=" vertical";break}this._register(ke(this.domNode,et.KEY_DOWN,d=>{const h=new Pi(d);let f=!0;const g=typeof this.focusedItem=="number"?this.viewItems[this.focusedItem]:void 0;c&&(h.equals(c[0])||h.equals(c[1]))?f=this.focusPrevious():u&&(h.equals(u[0])||h.equals(u[1]))?f=this.focusNext():h.equals(9)&&this.cancelHasListener?this._onDidCancel.fire():h.equals(14)?f=this.focusFirst():h.equals(13)?f=this.focusLast():h.equals(2)&&g instanceof wd&&g.trapsArrowNavigation?f=this.focusNext():this.isTriggerKeyEvent(h)?this._triggerKeys.keyDown?this.doTrigger(h):this.triggerKeyDown=!0:f=!1,f&&(h.preventDefault(),h.stopPropagation())})),this._register(ke(this.domNode,et.KEY_UP,d=>{const h=new Pi(d);this.isTriggerKeyEvent(h)?(!this._triggerKeys.keyDown&&this.triggerKeyDown&&(this.triggerKeyDown=!1,this.doTrigger(h)),h.preventDefault(),h.stopPropagation()):(h.equals(2)||h.equals(1026))&&this.updateFocusedItem()})),this.focusTracker=this._register(gf(this.domNode)),this._register(this.focusTracker.onDidBlur(()=>{(Tu()===this.domNode||!os(Tu(),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()>=2?this.actionsList.setAttribute("role",this.options.ariaRole||"toolbar"):this.actionsList.setAttribute("role","presentation")}setFocusable(e){if(this.focusable=e,this.focusable){const t=this.viewItems.find(n=>n instanceof wd&&n.isEnabled());t instanceof wd&&t.setFocusable(!0)}else this.viewItems.forEach(t=>{t instanceof wd&&t.setFocusable(!1)})}isTriggerKeyEvent(e){let t=!1;return this._triggerKeys.keys.forEach(n=>{t=t||e.equals(n)}),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}getAction(e){var t;if(typeof e=="number")return(t=this.viewItems[e])===null||t===void 0?void 0:t.action;if(e instanceof HTMLElement){for(;e.parentElement!==this.actionsList;){if(!e.parentElement)return;e=e.parentElement}for(let n=0;n{const s=document.createElement("li");s.className="action-item",s.setAttribute("role","presentation");let a;const l=Object.assign({hoverDelegate:this.options.hoverDelegate},t);this.options.actionViewItemProvider&&(a=this.options.actionViewItemProvider(r,l)),a||(a=new My(this.context,r,l)),this.options.allowContextMenu||this.viewItemDisposables.set(a,ke(s,et.CONTEXT_MENU,c=>{dn.stop(c,!0)})),a.actionRunner=this._actionRunner,a.setActionContext(this.context),a.render(s),this.focusable&&a instanceof wd&&this.viewItems.length===0&&a.setFocusable(!0),o===null||o<0||o>=this.actionsList.children.length?(this.actionsList.appendChild(s),this.viewItems.push(a)):(this.actionsList.insertBefore(s,this.actionsList.children[o]),this.viewItems.splice(o,0,a),o++)}),typeof this.focusedItem=="number"&&this.focus(this.focusedItem),this.refreshRole()}clear(){this.isEmpty()||(this.viewItems=si(this.viewItems),this.viewItemDisposables.clearAndDisposeAll(),Ur(this.actionsList),this.refreshRole())}length(){return this.viewItems.length}isEmpty(){return this.viewItems.length===0}focus(e){let t=!1,n;if(e===void 0?t=!0:typeof e=="number"?n=e:typeof e=="boolean"&&(t=e),t&&typeof this.focusedItem=="undefined"){const o=this.viewItems.findIndex(r=>r.isEnabled());this.focusedItem=o===-1?void 0:o,this.updateFocus(void 0,void 0,!0)}else n!==void 0&&(this.focusedItem=n),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=="undefined")this.focusedItem=this.viewItems.length-1;else if(this.viewItems.length<=1)return!1;const t=this.focusedItem;let n;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,n=this.viewItems[this.focusedItem]}while(this.focusedItem!==t&&(this.options.focusOnlyEnabledItems&&!n.isEnabled()||n.action.id===kr.ID));return this.updateFocus(),!0}focusPrevious(e){if(typeof this.focusedItem=="undefined")this.focusedItem=0;else if(this.viewItems.length<=1)return!1;const t=this.focusedItem;let n;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}n=this.viewItems[this.focusedItem]}while(this.focusedItem!==t&&(this.options.focusOnlyEnabledItems&&!n.isEnabled()||n.action.id===kr.ID));return this.updateFocus(!0),!0}updateFocus(e,t,n=!1){var o;typeof this.focusedItem=="undefined"&&this.actionsList.focus({preventScroll:t}),this.previouslyFocusedItem!==void 0&&this.previouslyFocusedItem!==this.focusedItem&&((o=this.viewItems[this.previouslyFocusedItem])===null||o===void 0||o.blur());const r=this.focusedItem!==void 0&&this.viewItems[this.focusedItem];if(r){let s=!0;DD(r.focus)||(s=!1),this.options.focusOnlyEnabledItems&&DD(r.isEnabled)&&!r.isEnabled()&&(s=!1),r.action.id===kr.ID&&(s=!1),s?(n||this.previouslyFocusedItem!==this.focusedItem)&&(r.focus(e),this.previouslyFocusedItem=this.focusedItem):(this.actionsList.focus({preventScroll:t}),this.previouslyFocusedItem=void 0)}}doTrigger(e){if(typeof this.focusedItem=="undefined")return;const t=this.viewItems[this.focusedItem];if(t instanceof wd){const n=t._context===null||t._context===void 0?e:t._context;this.run(t._action,n)}}run(e,t){return Kdt(this,void 0,void 0,function*(){yield this._actionRunner.run(e,t)})}dispose(){this._context=void 0,this.viewItems=si(this.viewItems),this.getContainer().remove(),super.dispose()}}const c$=/\(&([^\s&])\)|(^|[^&])&([^\s&])/,F9=/(&)?(&)([^\s&])/g;var PP;(function(i){i[i.Right=0]="Right",i[i.Left=1]="Left"})(PP||(PP={}));class Pw extends $c{constructor(e,t,n,o){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:1,actionViewItemProvider:l=>this.doGetActionViewItem(l,n,s),context:n.context,actionRunner:n.actionRunner,ariaLabel:n.ariaLabel,ariaRole:"menu",focusOnlyEnabledItems:!0,triggerKeys:{keys:[3,...Nn||Ss?[10]:[]],keyDown:!0}}),this.menuStyles=o,this.menuElement=r,this.actionsList.tabIndex=0,this.menuDisposables=this._register(new Be),this.initializeOrUpdateStyleSheet(e,o),this._register(Ei.addTarget(r)),ke(r,et.KEY_DOWN,l=>{new Pi(l).equals(2)&&l.preventDefault()}),n.enableMnemonics&&this.menuDisposables.add(ke(r,et.KEY_DOWN,l=>{const c=l.key.toLocaleLowerCase();if(this.mnemonics.has(c)){dn.stop(l,!0);const u=this.mnemonics.get(c);if(u.length===1&&(u[0]instanceof rae&&u[0].container&&this.focusItemByElement(u[0].container),u[0].onClick(l)),u.length>1){const d=u.shift();d&&d.container&&(this.focusItemByElement(d.container),u.push(d)),this.mnemonics.set(c,u)}}})),Ss&&this._register(ke(r,et.KEY_DOWN,l=>{const c=new Pi(l);c.equals(14)||c.equals(11)?(this.focusedItem=this.viewItems.length-1,this.focusNext(),dn.stop(l,!0)):(c.equals(13)||c.equals(12))&&(this.focusedItem=0,this.focusPrevious(),dn.stop(l,!0))})),this._register(ke(this.domNode,et.MOUSE_OUT,l=>{const c=l.relatedTarget;os(c,this.domNode)||(this.focusedItem=void 0,this.updateFocus(),l.stopPropagation())})),this._register(ke(this.actionsList,et.MOUSE_OVER,l=>{let c=l.target;if(!(!c||!os(c,this.actionsList)||c===this.actionsList)){for(;c.parentElement!==this.actionsList&&c.parentElement!==null;)c=c.parentElement;if(c.classList.contains("action-item")){const u=this.focusedItem;this.setFocusedItem(c),u!==this.focusedItem&&this.updateFocus()}}})),this._register(Ei.addTarget(this.actionsList)),this._register(ke(this.actionsList,Di.Tap,l=>{let c=l.initialTarget;if(!(!c||!os(c,this.actionsList)||c===this.actionsList)){for(;c.parentElement!==this.actionsList&&c.parentElement!==null;)c=c.parentElement;if(c.classList.contains("action-item")){const u=this.focusedItem;this.setFocusedItem(c),u!==this.focusedItem&&this.updateFocus()}}}));const s={parent:this};this.mnemonics=new Map,this.scrollableElement=this._register(new GI(r,{alwaysConsumeMouseWheel:!0,horizontal:2,vertical:3,verticalScrollbarSize:7,handleMouseWheel:!0,useShadows:!0}));const a=this.scrollableElement.getDomNode();a.style.position="",this.styleScrollElement(a,o),this._register(ke(r,Di.Change,l=>{dn.stop(l,!0);const c=this.scrollableElement.getScrollPosition().scrollTop;this.scrollableElement.setScrollPosition({scrollTop:c-l.translationY})})),this._register(ke(a,et.MOUSE_UP,l=>{l.preventDefault()})),r.style.maxHeight=`${Math.max(10,window.innerHeight-e.getBoundingClientRect().top-35)}px`,t=t.filter(l=>{var c;return!((c=n.submenuIds)===null||c===void 0)&&c.has(l.id)?(console.warn(`Found submenu cycle: ${l.id}`),!1):!0}),this.push(t,{icon:!0,label:!0,isMenu:!0}),e.appendChild(this.scrollableElement.getDomNode()),this.scrollableElement.scanDomNode(),this.viewItems.filter(l=>!(l instanceof sae)).forEach((l,c,u)=>{l.updatePositionInSet(c+1,u.length)})}initializeOrUpdateStyleSheet(e,t){this.styleSheet||(UA(e)?this.styleSheet=Bc(e):(Pw.globalStyleSheet||(Pw.globalStyleSheet=Bc()),this.styleSheet=Pw.globalStyleSheet)),this.styleSheet.textContent=Gdt(t,UA(e))}styleScrollElement(e,t){var n,o;const r=(n=t.foregroundColor)!==null&&n!==void 0?n:"",s=(o=t.backgroundColor)!==null&&o!==void 0?o:"",a=t.borderColor?`1px solid ${t.borderColor}`:"",l="5px",c=t.shadowColor?`0 2px 8px ${t.shadowColor}`:"";e.style.outline=a,e.style.borderRadius=l,e.style.color=r,e.style.backgroundColor=s,e.style.boxShadow=c}getContainer(){return this.scrollableElement.getDomNode()}get onScroll(){return this.scrollableElement.onScroll}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(ke(this.element,et.MOUSE_UP,r=>{if(dn.stop(r,!0),Oc){if(new Dc(r).rightButton)return;this.onClick(r)}else setTimeout(()=>{this.onClick(r)},0)})),this._register(ke(this.element,et.CONTEXT_MENU,r=>{dn.stop(r,!0)})))},100),this._register(this.runOnceToEnableMouseUp)}render(e){super.render(e),this.element&&(this.container=e,this.item=Ae(this.element,He("a.action-menu-item")),this._action.id===kr.ID?this.item.setAttribute("role","presentation"):(this.item.setAttribute("role","menuitem"),this.mnemonic&&this.item.setAttribute("aria-keyshortcuts",`${this.mnemonic}`)),this.check=Ae(this.item,He("span.menu-item-check"+Mt.asCSSSelector(Xe.menuSelection))),this.check.setAttribute("role","none"),this.label=Ae(this.item,He("span.action-label")),this.options.label&&this.options.keybinding&&(Ae(this.item,He("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(){var e;super.focus(),(e=this.item)===null||e===void 0||e.focus(),this.applyStyle()}updatePositionInSet(e,t){this.item&&(this.item.setAttribute("aria-posinset",`${e}`),this.item.setAttribute("aria-setsize",`${t}`))}updateLabel(){var e;if(!!this.label&&this.options.label){Ur(this.label);let t=sX(this.action.label);if(t){const n=qdt(t);this.options.enableMnemonics||(t=n),this.label.setAttribute("aria-label",n.replace(/&&/g,"&"));const o=c$.exec(t);if(o){t=WA(t),F9.lastIndex=0;let r=F9.exec(t);for(;r&&r[1];)r=F9.exec(t);const s=a=>a.replace(/&&/g,"&");r?this.label.append(OI(s(t.substr(0,r.index))," "),He("u",{"aria-hidden":"true"},r[3]),M_e(s(t.substr(r.index+r[0].length))," ")):this.label.innerText=s(t).trim(),(e=this.item)===null||e===void 0||e.setAttribute("aria-keyshortcuts",(o[1]?o[1]:o[3]).toLocaleLowerCase())}else this.label.innerText=t.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,n=e&&this.menuStyle.selectionBackgroundColor?this.menuStyle.selectionBackgroundColor:void 0,o=e&&this.menuStyle.selectionBorderColor?`1px solid ${this.menuStyle.selectionBorderColor}`:"",r=e&&this.menuStyle.selectionBorderColor?"-1px":"";this.item&&(this.item.style.color=t!=null?t:"",this.item.style.backgroundColor=n!=null?n:"",this.item.style.outline=o,this.item.style.outlineOffset=r),this.check&&(this.check.style.color=t!=null?t:"")}}class rae extends z1e{constructor(e,t,n,o,r){super(e,e,o,r),this.submenuActions=t,this.parentData=n,this.submenuOptions=o,this.mysubmenu=null,this.submenuDisposables=this._register(new Be),this.mouseOver=!1,this.expandDirection=o&&o.expandDirection!==void 0?o.expandDirection:PP.Right,this.showScheduler=new bi(()=>{this.mouseOver&&(this.cleanupExistingSubmenu(!1),this.createSubmenu(!1))},250),this.hideScheduler=new bi(()=>{this.element&&!os(Tu(),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=Ae(this.item,He("span.submenu-indicator"+Mt.asCSSSelector(Xe.menuSubmenu))),this.submenuIndicator.setAttribute("aria-hidden","true")),this._register(ke(this.element,et.KEY_UP,t=>{const n=new Pi(t);(n.equals(17)||n.equals(3))&&(dn.stop(t,!0),this.createSubmenu(!0))})),this._register(ke(this.element,et.KEY_DOWN,t=>{const n=new Pi(t);Tu()===this.item&&(n.equals(17)||n.equals(3))&&dn.stop(t,!0)})),this._register(ke(this.element,et.MOUSE_OVER,t=>{this.mouseOver||(this.mouseOver=!0,this.showScheduler.schedule())})),this._register(ke(this.element,et.MOUSE_LEAVE,t=>{this.mouseOver=!1})),this._register(ke(this.element,et.FOCUS_OUT,t=>{this.element&&!os(Tu(),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(){}onClick(e){dn.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,n,o){const r={top:0,left:0};return r.left=zC(e.width,t.width,{position:o===PP.Right?0:1,offset:n.left,size:n.width}),r.left>=n.left&&r.left{new Pi(c).equals(15)&&(dn.stop(c,!0),this.parentData.parent.focus(),this.cleanupExistingSubmenu(!0))})),this.submenuDisposables.add(ke(this.submenuContainer,et.KEY_DOWN,c=>{new Pi(c).equals(15)&&dn.stop(c,!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){var t;this.item&&((t=this.item)===null||t===void 0||t.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!=null?t:"")}dispose(){super.dispose(),this.hideScheduler.dispose(),this.mysubmenu&&(this.mysubmenu.dispose(),this.mysubmenu=null),this.submenuContainer&&(this.submenuContainer=void 0)}}class sae extends My{constructor(e,t,n,o){super(e,t,n),this.menuStyles=o}render(e){super.render(e),this.label&&(this.label.style.borderBottomColor=this.menuStyles.separatorColor?`${this.menuStyles.separatorColor}`:"")}}function qdt(i){const e=c$,t=e.exec(i);if(!t)return i;const n=!t[1];return i.replace(e,n?"$2$3":"").trim()}function aae(i){const e=I_e()[i.id];return`.codicon-${i.id}:before { content: '\\${e.toString(16)}'; }`}function Gdt(i,e){let t=` +`)}}const Ddt={listFocusBackground:"#7FB0D0",listActiveSelectionBackground:"#0E639C",listActiveSelectionForeground:"#FFFFFF",listActiveSelectionIconForeground:"#FFFFFF",listFocusAndSelectionOutline:"#90C2F9",listFocusAndSelectionBackground:"#094771",listFocusAndSelectionForeground:"#FFFFFF",listInactiveSelectionBackground:"#3F3F46",listInactiveSelectionIconForeground:"#FFFFFF",listHoverBackground:"#2A2D2E",listDropBackground:"#383B3D",treeIndentGuidesStroke:"#a9a9a9",treeInactiveIndentGuidesStroke:ve.fromHex("#a9a9a9").transparent(.4).toString(),tableColumnsBorder:ve.fromHex("#cccccc").transparent(.2).toString(),tableOddRowsBackgroundColor:ve.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},kdt={keyboardSupport:!0,mouseSupport:!0,multipleSelectionSupport:!0,dnd:{getDragURI(){return null},onDragStart(){},onDragOver(){return!1},drop(){},dispose(){}}};function Idt(i,e){const t=i.indexOf(e);if(t===-1)return[];const n=[];let o=t-1;for(;o>=0&&i[o]===e-(t-o);)n.push(i[o--]);for(n.reverse(),o=t;o=i.length)t.push(e[o++]);else if(o>=e.length)t.push(i[n++]);else if(i[n]===e[o]){t.push(i[n]),n++,o++;continue}else i[n]=i.length)t.push(e[o++]);else if(o>=e.length)t.push(i[n++]);else if(i[n]===e[o]){n++,o++;continue}else i[n]i-e;class Ndt{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,n,o){let r=0;for(const s of this.renderers)s.renderElement(e,t,n[r++],o)}disposeElement(e,t,n,o){var r;let s=0;for(const a of this.renderers)(r=a.disposeElement)===null||r===void 0||r.call(a,e,t,n[s],o),s+=1}disposeTemplate(e){let t=0;for(const n of this.renderers)n.disposeTemplate(e[t++])}}class Rdt{constructor(e){this.accessibilityProvider=e,this.templateId="a18n"}renderTemplate(e){return e}renderElement(e,t,n){const o=this.accessibilityProvider.getAriaLabel(e);o?n.setAttribute("aria-label",o):n.removeAttribute("aria-label");const r=this.accessibilityProvider.getAriaLevel&&this.accessibilityProvider.getAriaLevel(e);typeof r=="number"?n.setAttribute("aria-level",`${r}`):n.removeAttribute("aria-level")}disposeTemplate(e){}}class Mdt{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){var n,o;(o=(n=this.dnd).onDragStart)===null||o===void 0||o.call(n,e,t)}onDragOver(e,t,n,o){return this.dnd.onDragOver(e,t,n,o)}onDragLeave(e,t,n,o){var r,s;(s=(r=this.dnd).onDragLeave)===null||s===void 0||s.call(r,e,t,n,o)}onDragEnd(e){var t,n;(n=(t=this.dnd).onDragEnd)===null||n===void 0||n.call(t,e)}drop(e,t,n,o){this.dnd.drop(e,t,n,o)}dispose(){this.dnd.dispose()}}class qu{get onDidChangeFocus(){return st.map(this.eventBufferer.wrapEvent(this.focus.onChange),e=>this.toListEvent(e),this.disposables)}get onDidChangeSelection(){return st.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 onMouseDown(){return this.view.onMouseDown}get onMouseOver(){return this.view.onMouseOver}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=st.chain(this.disposables.add(new xn(this.view.domNode,"keydown")).event,r=>r.map(s=>new Pi(s)).filter(s=>e=s.keyCode===58||s.shiftKey&&s.keyCode===68).map(s=>dn.stop(s,!0)).filter(()=>!1)),n=st.chain(this.disposables.add(new xn(this.view.domNode,"keyup")).event,r=>r.forEach(()=>e=!1).map(s=>new Pi(s)).filter(s=>s.keyCode===58||s.shiftKey&&s.keyCode===68).map(s=>dn.stop(s,!0)).map(({browserEvent:s})=>{const a=this.getFocus(),l=a.length?a[0]:void 0,c=typeof l!="undefined"?this.view.element(l):void 0,u=typeof l!="undefined"?this.view.domElement(l):this.view.domNode;return{index:l,element:c,anchor:u,browserEvent:s}})),o=st.chain(this.view.onContextMenu,r=>r.filter(s=>!e).map(({element:s,index:a,browserEvent:l})=>({element:s,index:a,anchor:new kc(l),browserEvent:l})));return st.any(t,n,o)}get onKeyDown(){return this.disposables.add(new xn(this.view.domNode,"keydown")).event}get onDidFocus(){return st.signal(this.disposables.add(new xn(this.view.domNode,"focus",!0)).event)}constructor(e,t,n,o,r=kdt){var s,a,l,c;this.user=e,this._options=r,this.focus=new MP("focused"),this.anchor=new MP("anchor"),this.eventBufferer=new $q,this._ariaLabel="",this.disposables=new Be,this._onDidDispose=new le,this.onDidDispose=this._onDidDispose.event;const u=this._options.accessibilityProvider&&this._options.accessibilityProvider.getWidgetRole?(s=this._options.accessibilityProvider)===null||s===void 0?void 0:s.getWidgetRole():"list";this.selection=new wdt(u!=="listbox");const d=[this.focus.renderer,this.selection.renderer];this.accessibilityProvider=r.accessibilityProvider,this.accessibilityProvider&&(d.push(new Rdt(this.accessibilityProvider)),(l=(a=this.accessibilityProvider).onDidChangeActiveDescendant)===null||l===void 0||l.call(a,this.onDidChangeActiveDescendant,this,this.disposables)),o=o.map(f=>new Ndt(f.templateId,[...d,f]));const h=Object.assign(Object.assign({},r),{dnd:r.dnd&&new Mdt(this,r.dnd)});if(this.view=this.createListView(t,n,o,h),this.view.domNode.setAttribute("role",u),r.styleController)this.styleController=r.styleController(this.view.domId);else{const f=Wc(this.view.domNode);this.styleController=new j1e(f,this.view.domId)}if(this.spliceable=new hdt([new P9(this.focus,this.view,r.identityProvider),new P9(this.selection,this.view,r.identityProvider),new P9(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 Ldt(this,this.view)),(typeof r.keyboardSupport!="boolean"||r.keyboardSupport)&&(this.keyboardController=new H1e(this,this.view,r),this.disposables.add(this.keyboardController)),r.keyboardNavigationLabelProvider){const f=r.keyboardNavigationDelegate||Sdt;this.typeNavigationController=new xdt(this,this.view,r.keyboardNavigationLabelProvider,(c=r.keyboardNavigationEventFilter)!==null&&c!==void 0?c:()=>!0,f),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,n,o){return new Gc(e,t,n,o)}createMouseController(e){return new U1e(this)}updateOptions(e={}){var t,n;this._options=Object.assign(Object.assign({},this._options),e),(t=this.typeNavigationController)===null||t===void 0||t.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),(n=this.keyboardController)===null||n===void 0||n.updateOptions(e),this.view.updateOptions(e)}get options(){return this._options}splice(e,t,n=[]){if(e<0||e>this.view.length)throw new q1(this.user,`Invalid start index: ${e}`);if(t<0)throw new q1(this.user,`Invalid delete count: ${t}`);t===0&&n.length===0||this.eventBufferer.bufferEvents(()=>this.spliceable.splice(e,t,n))}rerender(){this.view.rerender()}element(e){return this.view.element(e)}get length(){return this.view.length}get contentHeight(){return this.view.contentHeight}get scrollTop(){return this.view.getScrollTop()}set scrollTop(e){this.view.setScrollTop(e)}get scrollHeight(){return this.view.scrollHeight}get renderHeight(){return this.view.renderHeight}get firstVisibleIndex(){return this.view.firstVisibleIndex}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)}setSelection(e,t){for(const n of e)if(n<0||n>=this.length)throw new q1(this.user,`Invalid index ${n}`);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=="undefined"){this.anchor.set([]);return}if(e<0||e>=this.length)throw new q1(this.user,`Invalid index ${e}`);this.anchor.set([e])}getAnchor(){return l_e(this.anchor.get(),void 0)}getAnchorElement(){const e=this.getAnchor();return typeof e=="undefined"?void 0:this.element(e)}setFocus(e,t){for(const n of e)if(n<0||n>=this.length)throw new q1(this.user,`Invalid index ${n}`);this.focus.set(e,t)}focusNext(e=1,t=!1,n,o){if(this.length===0)return;const r=this.focus.get(),s=this.findNextIndex(r.length>0?r[0]+e:0,t,o);s>-1&&this.setFocus([s],n)}focusPrevious(e=1,t=!1,n,o){if(this.length===0)return;const r=this.focus.get(),s=this.findPreviousIndex(r.length>0?r[0]-e:0,t,o);s>-1&&this.setFocus([s],n)}focusNextPage(e,t){return uae(this,void 0,void 0,function*(){let n=this.view.indexAt(this.view.getScrollTop()+this.view.renderHeight);n=n===0?0:n-1;const o=this.getFocus()[0];if(o!==n&&(o===void 0||n>o)){const r=this.findPreviousIndex(n,!1,t);r>-1&&o!==r?this.setFocus([r],e):this.setFocus([n],e)}else{const r=this.view.getScrollTop();let s=r+this.view.renderHeight;n>o&&(s-=this.view.elementHeight(n)),this.view.setScrollTop(s),this.view.getScrollTop()!==r&&(this.setFocus([]),yield wv(0),yield this.focusNextPage(e,t))}})}focusPreviousPage(e,t){return uae(this,void 0,void 0,function*(){let n;const o=this.view.getScrollTop();o===0?n=this.view.indexAt(o):n=this.view.indexAfter(o-1);const r=this.getFocus()[0];if(r!==n&&(r===void 0||r>=n)){const s=this.findNextIndex(n,!1,t);s>-1&&r!==s?this.setFocus([s],e):this.setFocus([n],e)}else{const s=o;this.view.setScrollTop(o-this.view.renderHeight),this.view.getScrollTop()!==s&&(this.setFocus([]),yield wv(0),yield this.focusPreviousPage(e,t))}})}focusLast(e,t){if(this.length===0)return;const n=this.findPreviousIndex(this.length-1,!1,t);n>-1&&this.setFocus([n],e)}focusFirst(e,t){this.focusNth(0,e,t)}focusNth(e,t,n){if(this.length===0)return;const o=this.findNextIndex(e,!1,n);o>-1&&this.setFocus([o],t)}findNextIndex(e,t=!1,n){for(let o=0;o=this.length&&!t)return-1;if(e=e%this.length,!n||n(this.element(e)))return e;e++}return-1}findPreviousIndex(e,t=!1,n){for(let o=0;othis.view.element(e))}reveal(e,t){if(e<0||e>=this.length)throw new q1(this.user,`Invalid index ${e}`);const n=this.view.getScrollTop(),o=this.view.elementTop(e),r=this.view.elementHeight(e);if(_v(t)){const s=r-this.view.renderHeight;this.view.setScrollTop(s*Za(t,0,1)+o)}else{const s=o+r,a=n+this.view.renderHeight;o=a||(o=a&&r>=this.view.renderHeight?this.view.setScrollTop(o):s>=a&&this.view.setScrollTop(s-this.view.renderHeight))}}getHTMLElement(){return this.view.domNode}getElementID(e){return this.view.getElementDomId(e)}style(e){this.styleController.style(e)}toListEvent({indexes:e,browserEvent:t}){return{indexes:e,elements:e.map(n=>this.view.element(n)),browserEvent:t}}_onFocusChange(){const e=this.focus.get();this.view.domNode.classList.toggle("element-focused",e.length>0),this.onDidChangeActiveDescendant()}onDidChangeActiveDescendant(){var e;const t=this.focus.get();if(t.length>0){let n;!((e=this.accessibilityProvider)===null||e===void 0)&&e.getActiveDescendantId&&(n=this.accessibilityProvider.getActiveDescendantId(this.view.element(t[0]))),this.view.domNode.setAttribute("aria-activedescendant",n||this.view.getElementDomId(t[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()}}Ub([Mo],qu.prototype,"onDidChangeFocus",null);Ub([Mo],qu.prototype,"onDidChangeSelection",null);Ub([Mo],qu.prototype,"onContextMenu",null);Ub([Mo],qu.prototype,"onKeyDown",null);Ub([Mo],qu.prototype,"onDidFocus",null);const m0=He,K1e="selectOption.entry.template";class Adt{get templateId(){return K1e}renderTemplate(e){const t=Object.create(null);return t.root=e,t.text=Ae(e,m0(".option-text")),t.detail=Ae(e,m0(".option-detail")),t.decoratorRight=Ae(e,m0(".option-decorator-right")),t}renderElement(e,t,n){const o=n,r=e.text,s=e.detail,a=e.decoratorRight,l=e.isDisabled;o.text.textContent=r,o.detail.textContent=s||"",o.decoratorRight.innerText=a||"",l?o.root.classList.add("option-disabled"):o.root.classList.remove("option-disabled")}disposeTemplate(e){}}class Vh extends _e{constructor(e,t,n,o,r){super(),this.options=[],this._currentSelection=0,this._hasDetails=!1,this._skipLayout=!1,this._sticky=!1,this._isVisible=!1,this.styles=o,this.selectBoxOptions=r||Object.create(null),typeof this.selectBoxOptions.minBottomMargin!="number"?this.selectBoxOptions.minBottomMargin=Vh.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 le,this._register(this._onDidSelect),this.registerListeners(),this.constructSelectDropDown(n),this.selected=t||0,e&&this.setOptions(e,t),this.initStyleSheet()}getHeight(){return 22}getTemplateId(){return K1e}constructSelectDropDown(e){this.contextViewProvider=e,this.selectDropDownContainer=He(".monaco-select-box-dropdown-container"),this.selectDropDownContainer.classList.add("monaco-select-box-dropdown-padding"),this.selectionDetailsPane=Ae(this.selectDropDownContainer,m0(".select-box-details-pane"));const t=Ae(this.selectDropDownContainer,m0(".select-box-dropdown-container-width-control")),n=Ae(t,m0(".width-control-div"));this.widthControlElement=document.createElement("span"),this.widthControlElement.className="option-text-width-control",Ae(n,this.widthControlElement),this._dropDownPosition=0,this.styleElement=Wc(this.selectDropDownContainer),this.selectDropDownContainer.setAttribute("draggable","true"),this._register(ke(this.selectDropDownContainer,et.DRAG_START,o=>{dn.stop(o,!0)}))}registerListeners(){this._register(No(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.selectElement.title=this.options[this.selected].text)})),this._register(ke(this.selectElement,et.CLICK,t=>{dn.stop(t),this._isVisible?this.hideSelectDropDown(!0):this.showSelectDropDown()})),this._register(ke(this.selectElement,et.MOUSE_DOWN,t=>{dn.stop(t)}));let e;this._register(ke(this.selectElement,"touchstart",t=>{e=this._isVisible})),this._register(ke(this.selectElement,"touchend",t=>{dn.stop(t),e?this.hideSelectDropDown(!0):this.showSelectDropDown()})),this._register(ke(this.selectElement,et.KEY_DOWN,t=>{const n=new Pi(t);let o=!1;Nn?(n.keyCode===18||n.keyCode===16||n.keyCode===10||n.keyCode===3)&&(o=!0):(n.keyCode===18&&n.altKey||n.keyCode===16&&n.altKey||n.keyCode===10||n.keyCode===3)&&(o=!0),o&&(this.showSelectDropDown(),dn.stop(t,!0))}))}get onDidSelect(){return this._onDidSelect.event}setOptions(e,t){Lo(this.options,e)||(this.options=e,this.selectElement.options.length=0,this._hasDetails=!1,this._cachedMaxDetailsHeight=void 0,this.options.forEach((n,o)=>{this.selectElement.add(this.createOption(n.text,o,n.isDisabled)),typeof n.description=="string"&&(this._hasDetails=!0)})),t!==void 0&&(this.select(t),this._currentSelection=this.selected)}setOptionsList(){var e;(e=this.selectList)===null||e===void 0||e.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.selectElement.title=this.options[this.selected].text)}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(){var e,t,n;const o=(e=this.styles.selectBackground)!==null&&e!==void 0?e:"",r=(t=this.styles.selectForeground)!==null&&t!==void 0?t:"",s=(n=this.styles.selectBorder)!==null&&n!==void 0?n:"";this.selectElement.style.backgroundColor=o,this.selectElement.style.color=r,this.selectElement.style.borderColor=s}styleList(){var e,t;const n=(e=this.styles.selectBackground)!==null&&e!==void 0?e:"",o=D0(this.styles.selectListBackground,n);this.selectDropDownListContainer.style.backgroundColor=o,this.selectionDetailsPane.style.backgroundColor=o;const r=(t=this.styles.focusBorder)!==null&&t!==void 0?t:"";this.selectDropDownContainer.style.outlineColor=r,this.selectDropDownContainer.style.outlineOffset="-1px",this.selectList.style(this.styles)}createOption(e,t,n){const o=document.createElement("option");return o.value=e,o.text=e,o.disabled=!!n,o}showSelectDropDown(){this.selectionDetailsPane.innerText="",!(!this.contextViewProvider||this._isVisible)&&(this.createSelectList(this.selectDropDownContainer),this.setOptionsList(),this.contextViewProvider.showContextView({getAnchor:()=>this.selectElement,render:e=>this.renderSelectDropDown(e,!0),layout:()=>{this.layoutSelectDropDown()},onHide:()=>{this.selectDropDownContainer.classList.remove("visible"),this.selectElement.classList.remove("synthetic-focus")},anchorPosition:this._dropDownPosition},this.selectBoxOptions.optionsAsChildren?this.container:void 0),this._isVisible=!0,this.hideSelectDropDown(!1),this.contextViewProvider.showContextView({getAnchor:()=>this.selectElement,render:e=>this.renderSelectDropDown(e),layout:()=>this.layoutSelectDropDown(),onHide:()=>{this.selectDropDownContainer.classList.remove("visible"),this.selectElement.classList.remove("synthetic-focus")},anchorPosition:this._dropDownPosition},this.selectBoxOptions.optionsAsChildren?this.container:void 0),this._currentSelection=this.selected,this._isVisible=!0,this.selectElement.setAttribute("aria-expanded","true"))}hideSelectDropDown(e){!this.contextViewProvider||!this._isVisible||(this._isVisible=!1,this.selectElement.setAttribute("aria-expanded","false"),e&&this.selectElement.focus(),this.contextViewProvider.hideContextView())}renderSelectDropDown(e,t){return e.appendChild(this.selectDropDownContainer),this.layoutSelectDropDown(t),{dispose:()=>{try{e.removeChild(this.selectDropDownContainer)}catch{}}}}measureMaxDetailsHeight(){let e=0;return this.options.forEach((t,n)=>{this.updateDetail(n),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=Yo(this.selectElement),n=getComputedStyle(this.selectElement),o=parseFloat(n.getPropertyValue("--dropdown-padding-top"))+parseFloat(n.getPropertyValue("--dropdown-padding-bottom")),r=window.innerHeight-t.top-t.height-(this.selectBoxOptions.minBottomMargin||0),s=t.top-Vh.DEFAULT_DROPDOWN_MINIMUM_TOP_MARGIN,a=this.selectElement.offsetWidth,l=this.setWidthControlElement(this.widthControlElement),c=Math.max(l,Math.round(a)).toString()+"px";this.selectDropDownContainer.style.width=c,this.selectList.getHTMLElement().style.height="",this.selectList.layout();let u=this.selectList.contentHeight;this._hasDetails&&this._cachedMaxDetailsHeight===void 0&&(this._cachedMaxDetailsHeight=this.measureMaxDetailsHeight());const d=this._hasDetails?this._cachedMaxDetailsHeight:0,h=u+o+d,f=Math.floor((r-o-d)/this.getHeight()),g=Math.floor((s-o-d)/this.getHeight());if(e)return t.top+t.height>window.innerHeight-22||t.topf&&this.options.length>f?(this._dropDownPosition=1,this.selectDropDownContainer.removeChild(this.selectDropDownListContainer),this.selectDropDownContainer.removeChild(this.selectionDetailsPane),this.selectDropDownContainer.appendChild(this.selectionDetailsPane),this.selectDropDownContainer.appendChild(this.selectDropDownListContainer),this.selectionDetailsPane.classList.remove("border-top"),this.selectionDetailsPane.classList.add("border-bottom")):(this._dropDownPosition=0,this.selectDropDownContainer.removeChild(this.selectDropDownListContainer),this.selectDropDownContainer.removeChild(this.selectionDetailsPane),this.selectDropDownContainer.appendChild(this.selectDropDownListContainer),this.selectDropDownContainer.appendChild(this.selectionDetailsPane),this.selectionDetailsPane.classList.remove("border-bottom"),this.selectionDetailsPane.classList.add("border-top")),!0);if(t.top+t.height>window.innerHeight-22||t.topr&&(u=f*this.getHeight())}else h>s&&(u=g*this.getHeight());return this.selectList.layout(u),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=u+o+"px",this.selectDropDownContainer.style.height=""):this.selectDropDownContainer.style.height=u+o+"px",this.updateDetail(this.selected),this.selectDropDownContainer.style.width=c,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 n=0,o=0;this.options.forEach((r,s)=>{const a=r.detail?r.detail.length:0,l=r.decoratorRight?r.decoratorRight.length:0,c=r.text.length+a+l;c>o&&(n=s,o=c)}),e.textContent=this.options[n].text+(this.options[n].decoratorRight?this.options[n].decoratorRight+" ":""),t=Ea(e)}return t}createSelectList(e){if(this.selectList)return;this.selectDropDownListContainer=Ae(e,m0(".select-box-dropdown-list-container")),this.listRenderer=new Adt,this.selectList=new qu("SelectBoxCustom",this.selectDropDownListContainer,this,[this.listRenderer],{useShadows:!1,verticalScrollMode:3,keyboardSupport:!1,mouseSupport:!1,accessibilityProvider:{getAriaLabel:o=>{let r=o.text;return o.detail&&(r+=`. ${o.detail}`),o.decoratorRight&&(r+=`. ${o.decoratorRight}`),o.description&&(r+=`. ${o.description}`),r},getWidgetAriaLabel:()=>C({key:"selectBox",comment:["Behave like native select dropdown element."]},"Select Box"),getRole:()=>Nn?"":"option",getWidgetRole:()=>"listbox"}}),this.selectBoxOptions.ariaLabel&&(this.selectList.ariaLabel=this.selectBoxOptions.ariaLabel);const t=this._register(new xn(this.selectDropDownListContainer,"keydown")),n=st.chain(t.event,o=>o.filter(()=>this.selectList.length>0).map(r=>new Pi(r)));this._register(st.chain(n,o=>o.filter(r=>r.keyCode===3))(this.onEnter,this)),this._register(st.chain(n,o=>o.filter(r=>r.keyCode===2))(this.onEnter,this)),this._register(st.chain(n,o=>o.filter(r=>r.keyCode===9))(this.onEscape,this)),this._register(st.chain(n,o=>o.filter(r=>r.keyCode===16))(this.onUpArrow,this)),this._register(st.chain(n,o=>o.filter(r=>r.keyCode===18))(this.onDownArrow,this)),this._register(st.chain(n,o=>o.filter(r=>r.keyCode===12))(this.onPageDown,this)),this._register(st.chain(n,o=>o.filter(r=>r.keyCode===11))(this.onPageUp,this)),this._register(st.chain(n,o=>o.filter(r=>r.keyCode===14))(this.onHome,this)),this._register(st.chain(n,o=>o.filter(r=>r.keyCode===13))(this.onEnd,this)),this._register(st.chain(n,o=>o.filter(r=>r.keyCode>=21&&r.keyCode<=56||r.keyCode>=85&&r.keyCode<=113))(this.onCharacter,this)),this._register(ke(this.selectList.getHTMLElement(),et.POINTER_UP,o=>this.onPointerUp(o))),this._register(this.selectList.onMouseOver(o=>typeof o.index!="undefined"&&this.selectList.setFocus([o.index]))),this._register(this.selectList.onDidChangeFocus(o=>this.onListFocus(o))),this._register(ke(this.selectDropDownContainer,et.FOCUS_OUT,o=>{!this._isVisible||rs(o.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;dn.stop(e);const t=e.target;if(!t||t.classList.contains("slider"))return;const n=t.closest(".monaco-list-row");if(!n)return;const o=Number(n.getAttribute("data-index")),r=n.classList.contains("option-disabled");o>=0&&o{for(let s=0;sthis.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&&(dn.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){dn.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){dn.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){dn.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=Sg.toString(e.keyCode);let n=-1;for(let o=0;o{this._register(ke(this.selectElement,e,t=>{this.selectElement.focus()}))}),this._register(No(this.selectElement,"click",e=>{dn.stop(e,!0)})),this._register(No(this.selectElement,"change",e=>{this.selectElement.title=e.target.value,this._onDidSelect.fire({index:e.target.selectedIndex,selected:e.target.value})})),this._register(No(this.selectElement,"keydown",e=>{let t=!1;Nn?(e.keyCode===18||e.keyCode===16||e.keyCode===10)&&(t=!0):(e.keyCode===18&&e.altKey||e.keyCode===10||e.keyCode===3)&&(t=!0),t&&e.stopPropagation()}))}get onDidSelect(){return this._onDidSelect.event}setOptions(e,t){(!this.options||!Lo(this.options,e))&&(this.options=e,this.selectElement.options.length=0,this.options.forEach((n,o)=>{this.selectElement.add(this.createOption(n.text,o,n.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(o)}))}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 pw)),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(Ei.addTarget(e));const n=this.options&&this.options.draggable;n&&(e.draggable=!0,Fc&&this._register(ke(e,et.DRAG_START,o=>{var r;return(r=o.dataTransfer)===null||r===void 0?void 0:r.setData(pk.TEXT,this._action.label)}))),this._register(ke(t,Di.Tap,o=>this.onClick(o,!0))),this._register(ke(t,et.MOUSE_DOWN,o=>{n||dn.stop(o,!0),this._action.enabled&&o.button===0&&t.classList.add("active")})),Nn&&this._register(ke(t,et.CONTEXT_MENU,o=>{o.button===0&&o.ctrlKey===!0&&this.onClick(o)})),this._register(ke(t,et.CLICK,o=>{dn.stop(o,!0),this.options&&this.options.isMenu||this.onClick(o)})),this._register(ke(t,et.DBLCLICK,o=>{dn.stop(o,!0)})),[et.MOUSE_UP,et.MOUSE_OUT].forEach(o=>{this._register(ke(t,o,r=>{dn.stop(r),t.classList.remove("active")}))})}onClick(e,t=!1){var n;dn.stop(e,!0);const o=Al(this._context)?!((n=this.options)===null||n===void 0)&&n.useEventAsContext?e:{preserveFocus:t}:this._context;this.actionRunner.run(this._action,o)}focus(){this.element&&(this.element.tabIndex=0,this.element.focus(),this.element.classList.add("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(){}getTooltip(){return this.action.tooltip}updateTooltip(){var e;if(!this.element)return;const t=(e=this.getTooltip())!==null&&e!==void 0?e:"";this.updateAriaLabel(),this.options.hoverDelegate?(this.element.title="",this.customHover?this.customHover.update(t):(this.customHover=B1e(this.options.hoverDelegate,this.element,t),this._store.add(this.customHover))):this.element.title=t}updateAriaLabel(){var e;if(this.element){const t=(e=this.getTooltip())!==null&&e!==void 0?e:"";this.element.setAttribute("aria-label",t)}}updateClass(){}updateChecked(){}dispose(){this.element&&(this.element.remove(),this.element=void 0),this._context=void 0,super.dispose()}}class Aw extends wd{constructor(e,t,n){super(e,t,n),this.options=n,this.options.icon=n.icon!==void 0?n.icon:!1,this.options.label=n.label!==void 0?n.label:!0,this.cssClass=""}render(e){super.render(e),this.element&&(this.label=Ae(this.element,He("a.action-label"))),this.label&&this.label.setAttribute("role",this.getDefaultAriaRole()),this.options.label&&this.options.keybinding&&this.element&&(Ae(this.element,He("span.keybinding")).textContent=this.options.keybinding),this.updateClass(),this.updateLabel(),this.updateTooltip(),this.updateEnabled(),this.updateChecked()}getDefaultAriaRole(){return this._action.id===kr.ID?"presentation":this.options.isMenu?"menuitem":"button"}focus(){this.label&&(this.label.tabIndex=0,this.label.focus())}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=C({key:"titleLabel",comment:["action title","action keybinding"]},"{0} ({1})",e,this.options.keybinding))),e!=null?e:void 0}updateClass(){var e;this.cssClass&&this.label&&this.label.classList.remove(...this.cssClass.split(" ")),this.options.icon?(this.cssClass=this.action.class,this.label&&(this.label.classList.add("codicon"),this.cssClass&&this.label.classList.add(...this.cssClass.split(" "))),this.updateEnabled()):(e=this.label)===null||e===void 0||e.classList.remove("codicon")}updateEnabled(){var e,t;this.action.enabled?(this.label&&(this.label.removeAttribute("aria-disabled"),this.label.classList.remove("disabled")),(e=this.element)===null||e===void 0||e.classList.remove("disabled")):(this.label&&(this.label.setAttribute("aria-disabled","true"),this.label.classList.add("disabled")),(t=this.element)===null||t===void 0||t.classList.add("disabled"))}updateAriaLabel(){var e;if(this.label){const t=(e=this.getTooltip())!==null&&e!==void 0?e:"";this.label.setAttribute("aria-label",t)}}updateChecked(){this.label&&(this.action.checked!==void 0?(this.label.classList.toggle("checked",this.action.checked),this.label.setAttribute("aria-checked",this.action.checked?"true":"false"),this.label.setAttribute("role","checkbox")):(this.label.classList.remove("checked"),this.label.setAttribute("aria-checked",""),this.label.setAttribute("role",this.getDefaultAriaRole())))}}class Fdt extends wd{constructor(e,t,n,o,r,s,a){super(e,t),this.selectBox=new Odt(n,o,r,s,a),this.selectBox.setFocusable(!1),this._register(this.selectBox),this.registerListeners()}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(){var e;(e=this.selectBox)===null||e===void 0||e.focus()}blur(){var e;(e=this.selectBox)===null||e===void 0||e.blur()}render(e){this.selectBox.render(e)}}class Bdt extends pw{constructor(e,t){super(),this._onDidChangeVisibility=this._register(new le),this.onDidChangeVisibility=this._onDidChangeVisibility.event,this._element=Ae(e,He(".monaco-dropdown")),this._label=Ae(this._element,He(".dropdown-label"));let n=t.labelRenderer;n||(n=r=>(r.textContent=t.label||"",null));for(const r of[et.CLICK,et.MOUSE_DOWN,Di.Tap])this._register(ke(this.element,r,s=>dn.stop(s,!0)));for(const r of[et.MOUSE_DOWN,Di.Tap])this._register(ke(this._label,r,s=>{s instanceof MouseEvent&&(s.detail>1||s.button!==0)||(this.visible?this.hide():this.show())}));this._register(ke(this._label,et.KEY_UP,r=>{const s=new Pi(r);(s.equals(3)||s.equals(10))&&(dn.stop(r,!0),this.visible?this.hide():this.show())}));const o=n(this._label);o&&this._register(o),this._register(Ei.addTarget(this._label))}get element(){return this._element}show(){this.visible||(this.visible=!0,this._onDidChangeVisibility.fire(!0))}hide(){this.visible&&(this.visible=!1,this._onDidChangeVisibility.fire(!1))}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 Wdt extends Bdt{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:0,domForShadowRoot:this._options.menuAsChild?this.element:void 0,skipTelemetry:this._options.skipTelemetry})}hide(){super.hide()}onHide(){this.hide(),this.element.classList.remove("active")}}class AP extends wd{constructor(e,t,n,o=Object.create(null)){super(null,e,o),this.actionItem=null,this._onDidChangeVisibility=this._register(new le),this.onDidChangeVisibility=this._onDidChangeVisibility.event,this.menuActionsOrProvider=t,this.contextMenuProvider=n,this.options=o,this.options.actionRunner&&(this.actionRunner=this.options.actionRunner)}render(e){this.actionItem=e;const t=r=>{this.element=Ae(r,He("a.action-label"));let s=[];return typeof this.options.classNames=="string"?s=this.options.classNames.split(/\s+/g).filter(a=>!!a):this.options.classNames&&(s=this.options.classNames),s.find(a=>a==="icon")||s.push("codicon"),this.element.classList.add(...s),this.element.setAttribute("role","button"),this.element.setAttribute("aria-haspopup","true"),this.element.setAttribute("aria-expanded","false"),this.element.title=this._action.label||"",this.element.ariaLabel=this._action.label||"",null},n=Array.isArray(this.menuActionsOrProvider),o={contextMenuProvider:this.contextMenuProvider,labelRenderer:t,menuAsChild:this.options.menuAsChild,actions:n?this.menuActionsOrProvider:void 0,actionProvider:n?void 0:this.menuActionsOrProvider,skipTelemetry:this.options.skipTelemetry};if(this.dropdownMenu=this._register(new Wdt(e,o)),this._register(this.dropdownMenu.onDidChangeVisibility(r=>{var s;(s=this.element)===null||s===void 0||s.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=Object.assign(Object.assign({},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!=null?e:void 0}setActionContext(e){super.setActionContext(e),this.dropdownMenu&&(this.dropdownMenu.menuOptions?this.dropdownMenu.menuOptions.context=e:this.dropdownMenu.menuOptions={context:e})}show(){var e;(e=this.dropdownMenu)===null||e===void 0||e.show()}updateEnabled(){var e,t;const n=!this.action.enabled;(e=this.actionItem)===null||e===void 0||e.classList.toggle("disabled",n),(t=this.element)===null||t===void 0||t.classList.toggle("disabled",n)}}function Vdt(i){return i?i.condition!==void 0:!1}var NL=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},My;(function(i){i[i.STORAGE_DOES_NOT_EXIST=0]="STORAGE_DOES_NOT_EXIST",i[i.STORAGE_IN_MEMORY=1]="STORAGE_IN_MEMORY"})(My||(My={}));var KC;(function(i){i[i.None=0]="None",i[i.Initialized=1]="Initialized",i[i.Closed=2]="Closed"})(KC||(KC={}));class Ay extends _e{constructor(e,t=Object.create(null)){super(),this.database=e,this.options=t,this._onDidChangeStorage=this._register(new G0),this.onDidChangeStorage=this._onDidChangeStorage.event,this.state=KC.None,this.cache=new Map,this.flushDelayer=this._register(new x0e(Ay.DEFAULT_FLUSH_DELAY)),this.pendingDeletes=new Set,this.pendingInserts=new Map,this.whenFlushedCallbacks=[],this.registerListeners()}registerListeners(){this._register(this.database.onDidChangeItemsExternal(e=>this.onDidChangeItemsExternal(e)))}onDidChangeItemsExternal(e){var t,n;this._onDidChangeStorage.pause();try{(t=e.changed)===null||t===void 0||t.forEach((o,r)=>this.acceptExternal(r,o)),(n=e.deleted)===null||n===void 0||n.forEach(o=>this.acceptExternal(o,void 0))}finally{this._onDidChangeStorage.resume()}}acceptExternal(e,t){if(this.state===KC.Closed)return;let n=!1;Al(t)?n=this.cache.delete(e):this.cache.get(e)!==t&&(this.cache.set(e,t),n=!0),n&&this._onDidChangeStorage.fire({key:e,external:!0})}get(e,t){const n=this.cache.get(e);return Al(n)?t:n}getBoolean(e,t){const n=this.get(e);return Al(n)?t:n==="true"}getNumber(e,t){const n=this.get(e);return Al(n)?t:parseInt(n,10)}set(e,t,n=!1){return NL(this,void 0,void 0,function*(){if(this.state===KC.Closed)return;if(Al(t))return this.delete(e,n);const o=ia(t)||Array.isArray(t)?qut(t):String(t);if(this.cache.get(e)!==o)return this.cache.set(e,o),this.pendingInserts.set(e,o),this.pendingDeletes.delete(e),this._onDidChangeStorage.fire({key:e,external:n}),this.doFlush()})}delete(e,t=!1){return NL(this,void 0,void 0,function*(){if(!(this.state===KC.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()})}get hasPending(){return this.pendingInserts.size>0||this.pendingDeletes.size>0}flushPending(){return NL(this,void 0,void 0,function*(){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(()=>{var t;if(!this.hasPending)for(;this.whenFlushedCallbacks.length;)(t=this.whenFlushedCallbacks.pop())===null||t===void 0||t()})})}doFlush(e){return NL(this,void 0,void 0,function*(){return this.options.hint===My.STORAGE_IN_MEMORY?this.flushPending():this.flushDelayer.trigger(()=>this.flushPending(),e)})}}Ay.DEFAULT_FLUSH_DELAY=100;class O9{constructor(){this.onDidChangeItemsExternal=st.None,this.items=new Map}updateItems(e){var t,n;return NL(this,void 0,void 0,function*(){(t=e.insert)===null||t===void 0||t.forEach((o,r)=>this.items.set(r,o)),(n=e.delete)===null||n===void 0||n.forEach(o=>this.items.delete(o))})}}const vM="__$__targetStorageMarker",Gu=yn("storageService");var PP;(function(i){i[i.NONE=0]="NONE",i[i.SHUTDOWN=1]="SHUTDOWN"})(PP||(PP={}));function Hdt(i){const e=i.get(vM);if(e)try{return JSON.parse(e)}catch{}return Object.create(null)}class A5 extends _e{constructor(e={flushInterval:A5.DEFAULT_FLUSH_INTERVAL}){super(),this.options=e,this._onDidChangeValue=this._register(new G0),this._onDidChangeTarget=this._register(new G0),this._onWillSaveState=this._register(new le),this.onWillSaveState=this._onWillSaveState.event,this._workspaceKeyTargets=void 0,this._profileKeyTargets=void 0,this._applicationKeyTargets=void 0}onDidChangeValue(e,t,n){return st.filter(this._onDidChangeValue.event,o=>o.scope===e&&(t===void 0||o.key===t),n)}emitDidChangeValue(e,t){const{key:n,external:o}=t;if(n===vM){switch(e){case-1:this._applicationKeyTargets=void 0;break;case 0:this._profileKeyTargets=void 0;break;case 1:this._workspaceKeyTargets=void 0;break}this._onDidChangeTarget.fire({scope:e})}else this._onDidChangeValue.fire({scope:e,key:n,target:this.getKeyTargets(e)[n],external:o})}get(e,t,n){var o;return(o=this.getStorage(t))===null||o===void 0?void 0:o.get(e,n)}getBoolean(e,t,n){var o;return(o=this.getStorage(t))===null||o===void 0?void 0:o.getBoolean(e,n)}getNumber(e,t,n){var o;return(o=this.getStorage(t))===null||o===void 0?void 0:o.getNumber(e,n)}store(e,t,n,o,r=!1){if(Al(t)){this.remove(e,n,r);return}this.withPausedEmitters(()=>{var s;this.updateKeyTarget(e,n,o),(s=this.getStorage(n))===null||s===void 0||s.set(e,t,r)})}remove(e,t,n=!1){this.withPausedEmitters(()=>{var o;this.updateKeyTarget(e,t,void 0),(o=this.getStorage(t))===null||o===void 0||o.delete(e,n)})}withPausedEmitters(e){this._onDidChangeValue.pause(),this._onDidChangeTarget.pause();try{e()}finally{this._onDidChangeValue.resume(),this._onDidChangeTarget.resume()}}updateKeyTarget(e,t,n,o=!1){var r,s;const a=this.getKeyTargets(t);typeof n=="number"?a[e]!==n&&(a[e]=n,(r=this.getStorage(t))===null||r===void 0||r.set(vM,JSON.stringify(a),o)):typeof a[e]=="number"&&(delete a[e],(s=this.getStorage(t))===null||s===void 0||s.set(vM,JSON.stringify(a),o))}get workspaceKeyTargets(){return this._workspaceKeyTargets||(this._workspaceKeyTargets=this.loadKeyTargets(1)),this._workspaceKeyTargets}get profileKeyTargets(){return this._profileKeyTargets||(this._profileKeyTargets=this.loadKeyTargets(0)),this._profileKeyTargets}get applicationKeyTargets(){return this._applicationKeyTargets||(this._applicationKeyTargets=this.loadKeyTargets(-1)),this._applicationKeyTargets}getKeyTargets(e){switch(e){case-1:return this.applicationKeyTargets;case 0:return this.profileKeyTargets;default:return this.workspaceKeyTargets}}loadKeyTargets(e){const t=this.getStorage(e);return t?Hdt(t):Object.create(null)}}A5.DEFAULT_FLUSH_INTERVAL=60*1e3;class $dt extends A5{constructor(){super(),this.applicationStorage=this._register(new Ay(new O9,{hint:My.STORAGE_IN_MEMORY})),this.profileStorage=this._register(new Ay(new O9,{hint:My.STORAGE_IN_MEMORY})),this.workspaceStorage=this._register(new Ay(new O9,{hint:My.STORAGE_IN_MEMORY})),this._register(this.workspaceStorage.onDidChangeStorage(e=>this.emitDidChangeValue(1,e))),this._register(this.profileStorage.onDidChangeStorage(e=>this.emitDidChangeValue(0,e))),this._register(this.applicationStorage.onDidChangeStorage(e=>this.emitDidChangeValue(-1,e)))}getStorage(e){switch(e){case-1:return this.applicationStorage;case 0:return this.profileStorage;default:return this.workspaceStorage}}}function zdt(i,e){const t=Object.assign({},e);for(const n in i){const o=i[n];t[n]=o!==void 0?ct(o):void 0}return t}const Udt={keybindingLabelBackground:ct(Ent),keybindingLabelForeground:ct(Dnt),keybindingLabelBorder:ct(knt),keybindingLabelBottomBorder:ct(Int),keybindingLabelShadow:ct(Gh)},jdt={buttonForeground:ct(_L),buttonSeparator:ct(hnt),buttonBackground:ct(bL),buttonHoverBackground:ct(fnt),buttonSecondaryForeground:ct(pnt),buttonSecondaryBackground:ct(hH),buttonSecondaryHoverBackground:ct(mnt),buttonBorder:ct(gnt)},Kdt={progressBarBackground:ct(bnt)},OP={inputActiveOptionBorder:ct(wG),inputActiveOptionForeground:ct(SG),inputActiveOptionBackground:ct(d0)};ct(lit),ct(uit),ct(cit);ct(po),ct(Zh),ct(Gh),ct(Ln),ct(Eit),ct(Dit),ct(kit),ct(tnt);const FP={inputBackground:ct(nbe),inputForeground:ct(ibe),inputBorder:ct(obe),inputValidationInfoBorder:ct(ont),inputValidationInfoBackground:ct(nnt),inputValidationInfoForeground:ct(int),inputValidationWarningBorder:ct(ant),inputValidationWarningBackground:ct(rnt),inputValidationWarningForeground:ct(snt),inputValidationErrorBorder:ct(unt),inputValidationErrorBackground:ct(lnt),inputValidationErrorForeground:ct(cnt)},qdt={listFilterWidgetBackground:ct(tit),listFilterWidgetOutline:ct(nit),listFilterWidgetNoMatchesOutline:ct(iit),listFilterWidgetShadow:ct(oit),inputBoxStyles:FP,toggleStyles:OP},q1e={badgeBackground:ct(lM),badgeForeground:ct(vnt),badgeBorder:ct(Ln)};ct(bit),ct(_it),ct(Dre),ct(Dre),ct(Cit);const jb={listBackground:void 0,listInactiveFocusForeground:void 0,listFocusBackground:ct(jnt),listFocusForeground:ct(Knt),listFocusOutline:ct(qnt),listActiveSelectionBackground:ct(Bg),listActiveSelectionForeground:ct(ef),listActiveSelectionIconForeground:ct(SL),listFocusAndSelectionOutline:ct(Gnt),listFocusAndSelectionBackground:ct(Bg),listFocusAndSelectionForeground:ct(ef),listInactiveSelectionBackground:ct(Xnt),listInactiveSelectionIconForeground:ct(Znt),listInactiveSelectionForeground:ct(Ynt),listInactiveFocusBackground:ct(Qnt),listInactiveFocusOutline:ct(Jnt),listHoverBackground:ct(abe),listHoverForeground:ct(lbe),listDropBackground:ct(eit),listSelectionOutline:ct(Wi),listHoverOutline:ct(Wi),treeIndentGuidesStroke:ct(xL),treeInactiveIndentGuidesStroke:ct(rit),tableColumnsBorder:ct(sit),tableOddRowsBackgroundColor:ct(ait)};function xS(i){return zdt(i,jb)}const Gdt={selectBackground:ct(Xh),selectListBackground:ct(dnt),selectForeground:ct(Pg),decoratorRightForeground:ct(rbe),selectBorder:ct(MC),focusBorder:ct(Hl),listFocusBackground:ct(f0),listInactiveSelectionIconForeground:ct(AC),listFocusForeground:ct(h0),listFocusOutline:Qtt(Wi,ve.transparent.toString()),listHoverBackground:ct(abe),listHoverForeground:ct(lbe),listHoverOutline:ct(Wi),selectListBorder:ct(Qh),listBackground:void 0,listActiveSelectionBackground:void 0,listActiveSelectionForeground:void 0,listActiveSelectionIconForeground:void 0,listFocusAndSelectionBackground:void 0,listDropBackground: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},Xdt={shadowColor:ct(Gh),borderColor:ct(dit),foregroundColor:ct(hit),backgroundColor:ct(fit),selectionForegroundColor:ct(git),selectionBackgroundColor:ct(pit),selectionBorderColor:ct(mit),separatorColor:ct(vit),scrollbarShadow:ct(_nt),scrollbarSliderBackground:ct(CL),scrollbarSliderHoverBackground:ct(yL),scrollbarSliderActiveBackground:ct(wL)};var P5=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Na=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},G1e=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};function Ydt(i,e,t,n){const o=i.getActions(e),r=Rg.getInstance(),s=r.keyStatus.altKey||(ls||xs)&&r.keyStatus.shiftKey;Y1e(o,t,s,n?a=>a===n:a=>a==="navigation")}function X1e(i,e,t,n,o,r){const s=i.getActions(e);Y1e(s,t,!1,typeof n=="string"?l=>l===n:n,o,r)}function Y1e(i,e,t,n=s=>s==="navigation",o=()=>!1,r=!1){let s,a;Array.isArray(e)?(s=e,a=e):(s=e.primary,a=e.secondary);const l=new Set;for(const[c,u]of i){let d;n(c)?(d=s,d.length>0&&r&&d.push(new kr)):(d=a,d.length>0&&d.push(new kr));for(let h of u){t&&(h=h instanceof Fu&&h.alt?h.alt:h);const f=d.push(h);h instanceof mw&&l.add({group:c,action:h,index:f-1})}}for(const{group:c,action:u,index:d}of l){const h=n(c)?s:a,f=u.actions;o(u,c,h.length)&&h.splice(d,1,...f)}}let rb=class extends Aw{constructor(e,t,n,o,r,s,a,l){super(void 0,e,{icon:!!(e.class||e.item.icon),label:!e.class&&!e.item.icon,draggable:t==null?void 0:t.draggable,keybinding:t==null?void 0:t.keybinding,hoverDelegate:t==null?void 0:t.hoverDelegate}),this._keybindingService=n,this._notificationService=o,this._contextKeyService=r,this._themeService=s,this._contextMenuService=a,this._accessibilityService=l,this._wantsAltCommand=!1,this._itemClassDispose=this._register(new Kr),this._altKey=Rg.getInstance()}get _menuItemAction(){return this._action}get _commandAction(){return this._wantsAltCommand&&this._menuItemAction.alt||this._menuItemAction}onClick(e){return G1e(this,void 0,void 0,function*(){e.preventDefault(),e.stopPropagation();try{yield 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 n=()=>{var o;const r=!!(!((o=this._menuItemAction.alt)===null||o===void 0)&&o.enabled)&&(!this._accessibilityService.isMotionReduced()||t)&&(this._altKey.keyStatus.altKey||this._altKey.keyStatus.shiftKey&&t);r!==this._wantsAltCommand&&(this._wantsAltCommand=r,this.updateLabel(),this.updateTooltip(),this.updateClass())};this._register(this._altKey.event(n)),this._register(ke(e,"mouseleave",o=>{t=!1,n()})),this._register(ke(e,"mouseenter",o=>{t=!0,n()})),n()}}updateLabel(){this.options.label&&this.label&&(this.label.textContent=this._commandAction.label)}getTooltip(){var e;const t=this._keybindingService.lookupKeybinding(this._commandAction.id,this._contextKeyService),n=t&&t.getLabel(),o=this._commandAction.tooltip||this._commandAction.label;let r=n?C("titleAndKb","{0} ({1})",o,n):o;if(!this._wantsAltCommand&&((e=this._menuItemAction.alt)===null||e===void 0?void 0:e.enabled)){const s=this._menuItemAction.alt.tooltip||this._menuItemAction.alt.label,a=this._keybindingService.lookupKeybinding(this._menuItemAction.alt.id,this._contextKeyService),l=a&&a.getLabel(),c=l?C("titleAndKb","{0} ({1})",s,l):s;r=C("titleAndKbAndAlt",`{0} +[{1}] {2}`,r,rX.modifierLabels[Vl].altKey,c)}return r}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:n}=this;if(!t||!n)return;const o=this._commandAction.checked&&Vdt(e.toggled)&&e.toggled.icon?e.toggled.icon:e.icon;if(!!o)if(Mt.isThemeIcon(o)){const r=Mt.asClassNameArray(o);n.classList.add(...r),this._itemClassDispose.value=zt(()=>{n.classList.remove(...r)})}else{const r=xw(this._themeService.getColorTheme().type)?yv(o.dark):yv(o.light),s=He("span");s.style.webkitMask=s.style.mask=`${r} no-repeat 50% 50%`,s.style.background="var(--vscode-icon-foreground)",s.style.display="inline-block",s.style.width="100%",s.style.height="100%",n.appendChild(s),n.classList.add("icon"),this._itemClassDispose.value=Tu(zt(()=>{n.classList.remove("icon"),jr(n)}),this._themeService.onDidColorThemeChange(()=>{this.updateClass()}))}}};rb=P5([Na(2,xi),Na(3,Ao),Na(4,Ut),Na(5,vr),Na(6,Ku),Na(7,vp)],rb);let u$=class extends AP{constructor(e,t,n,o,r){var s,a,l;const c=Object.assign(Object.assign({},t),{menuAsChild:(s=t==null?void 0:t.menuAsChild)!==null&&s!==void 0?s:!1,classNames:(a=t==null?void 0:t.classNames)!==null&&a!==void 0?a:Mt.isThemeIcon(e.item.icon)?Mt.asClassName(e.item.icon):void 0,keybindingProvider:(l=t==null?void 0:t.keybindingProvider)!==null&&l!==void 0?l:u=>n.lookupKeybinding(u.id)});super(e,{getActions:()=>e.actions},o,c),this._keybindingService=n,this._contextMenuService=o,this._themeService=r}render(e){super.render(e),fi(this.element),e.classList.add("menu-entry");const t=this._action,{icon:n}=t.item;if(n&&!Mt.isThemeIcon(n)){this.element.classList.add("icon");const o=()=>{this.element&&(this.element.style.backgroundImage=xw(this._themeService.getColorTheme().type)?yv(n.dark):yv(n.light))};o(),this._register(this._themeService.onDidColorThemeChange(()=>{o()}))}}};u$=P5([Na(2,xi),Na(3,Ku),Na(4,vr)],u$);let d$=class extends wd{constructor(e,t,n,o,r,s,a,l){var c,u,d;super(null,e),this._keybindingService=n,this._notificationService=o,this._contextMenuService=r,this._menuService=s,this._instaService=a,this._storageService=l,this._container=null,this._options=t,this._storageKey=`${e.item.submenu.id}_lastActionId`;let h;const f=t!=null&&t.persistLastActionId?l.get(this._storageKey,1):void 0;f&&(h=e.actions.find(p=>f===p.id)),h||(h=e.actions[0]),this._defaultAction=this._instaService.createInstance(rb,h,{keybinding:this._getDefaultActionKeybindingLabel(h)});const g=Object.assign(Object.assign({keybindingProvider:p=>this._keybindingService.lookupKeybinding(p.id)},t),{menuAsChild:(c=t==null?void 0:t.menuAsChild)!==null&&c!==void 0?c:!0,classNames:(u=t==null?void 0:t.classNames)!==null&&u!==void 0?u:["codicon","codicon-chevron-down"],actionRunner:(d=t==null?void 0:t.actionRunner)!==null&&d!==void 0?d:new pw});this._dropdown=new AP(e,e.actions,this._contextMenuService,g),this._dropdown.actionRunner.onDidRun(p=>{p.action instanceof Fu&&this.update(p.action)})}update(e){var t;!((t=this._options)===null||t===void 0)&&t.persistLastActionId&&this._storageService.store(this._storageKey,e.id,1,1),this._defaultAction.dispose(),this._defaultAction=this._instaService.createInstance(rb,e,{keybinding:this._getDefaultActionKeybindingLabel(e)}),this._defaultAction.actionRunner=new class extends pw{runAction(n,o){return G1e(this,void 0,void 0,function*(){yield n.run(void 0)})}},this._container&&this._defaultAction.render(p0e(this._container,He(".action-container")))}_getDefaultActionKeybindingLabel(e){var t;let n;if(!((t=this._options)===null||t===void 0)&&t.renderKeybindingWithDefaultActionLabel){const o=this._keybindingService.lookupKeybinding(e.id);o&&(n=`(${o.getLabel()})`)}return n}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=He(".action-container");this._defaultAction.render(Ae(this._container,t)),this._register(ke(t,et.KEY_DOWN,o=>{const r=new Pi(o);r.equals(17)&&(this._defaultAction.element.tabIndex=-1,this._dropdown.focus(),r.stopPropagation())}));const n=He(".dropdown-action-container");this._dropdown.render(Ae(this._container,n)),this._register(ke(n,et.KEY_DOWN,o=>{var r;const s=new Pi(o);s.equals(15)&&(this._defaultAction.element.tabIndex=0,this._dropdown.setFocusable(!1),(r=this._defaultAction.element)===null||r===void 0||r.focus(),s.stopPropagation())}))}focus(e){e?this._dropdown.focus():(this._defaultAction.element.tabIndex=0,this._defaultAction.element.focus())}blur(){this._defaultAction.element.tabIndex=-1,this._dropdown.blur(),this._container.blur()}setFocusable(e){e?this._defaultAction.element.tabIndex=0:(this._defaultAction.element.tabIndex=-1,this._dropdown.setFocusable(!1))}dispose(){this._defaultAction.dispose(),this._dropdown.dispose(),super.dispose()}};d$=P5([Na(2,xi),Na(3,Ao),Na(4,Ku),Na(5,If),Na(6,$t),Na(7,Gu)],d$);let h$=class extends Fdt{constructor(e,t){super(null,e,e.actions.map(n=>({text:n.id===kr.ID?"\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500":n.label,isDisabled:!n.enabled})),0,t,Gdt,{ariaLabel:e.tooltip,optionsAsChildren:!0}),this.select(Math.max(0,e.actions.findIndex(n=>n.checked)))}render(e){super.render(e),e.style.borderColor=ct(MC)}runAction(e,t){const n=this.action.actions[t];n&&this.actionRunner.run(n)}};h$=P5([Na(1,_p)],h$);function Zdt(i,e,t){return e instanceof Fu?i.createInstance(rb,e,t):e instanceof OD?e.item.isSelection?i.createInstance(h$,e):e.item.rememberDefaultAction?i.createInstance(d$,e,Object.assign(Object.assign({},t),{persistLastActionId:!0})):i.createInstance(u$,e,t):void 0}var Qdt=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};class zc extends _e{constructor(e,t={}){var n,o,r,s,a,l;super(),this._actionRunnerDisposables=this._register(new Be),this.viewItemDisposables=this._register(new Vq),this.triggerKeyDown=!1,this.focusable=!0,this._onDidBlur=this._register(new le),this.onDidBlur=this._onDidBlur.event,this._onDidCancel=this._register(new le({onWillAddFirstListener:()=>this.cancelHasListener=!0})),this.onDidCancel=this._onDidCancel.event,this.cancelHasListener=!1,this._onDidRun=this._register(new le),this.onDidRun=this._onDidRun.event,this._onWillRun=this._register(new le),this.onWillRun=this._onWillRun.event,this.options=t,this._context=(n=t.context)!==null&&n!==void 0?n:null,this._orientation=(o=this.options.orientation)!==null&&o!==void 0?o:0,this._triggerKeys={keyDown:(s=(r=this.options.triggerKeys)===null||r===void 0?void 0:r.keyDown)!==null&&s!==void 0?s:!1,keys:(l=(a=this.options.triggerKeys)===null||a===void 0?void 0:a.keys)!==null&&l!==void 0?l:[3,10]},this.options.actionRunner?this._actionRunner=this.options.actionRunner:(this._actionRunner=new pw,this._actionRunnerDisposables.add(this._actionRunner)),this._actionRunnerDisposables.add(this._actionRunner.onDidRun(d=>this._onDidRun.fire(d))),this._actionRunnerDisposables.add(this._actionRunner.onWillRun(d=>this._onWillRun.fire(d))),this.viewItems=[],this.focusedItem=void 0,this.domNode=document.createElement("div"),this.domNode.className="monaco-action-bar",t.animated!==!1&&this.domNode.classList.add("animated");let c,u;switch(this._orientation){case 0:c=[15],u=[17];break;case 1:c=[16],u=[18],this.domNode.className+=" vertical";break}this._register(ke(this.domNode,et.KEY_DOWN,d=>{const h=new Pi(d);let f=!0;const g=typeof this.focusedItem=="number"?this.viewItems[this.focusedItem]:void 0;c&&(h.equals(c[0])||h.equals(c[1]))?f=this.focusPrevious():u&&(h.equals(u[0])||h.equals(u[1]))?f=this.focusNext():h.equals(9)&&this.cancelHasListener?this._onDidCancel.fire():h.equals(14)?f=this.focusFirst():h.equals(13)?f=this.focusLast():h.equals(2)&&g instanceof wd&&g.trapsArrowNavigation?f=this.focusNext():this.isTriggerKeyEvent(h)?this._triggerKeys.keyDown?this.doTrigger(h):this.triggerKeyDown=!0:f=!1,f&&(h.preventDefault(),h.stopPropagation())})),this._register(ke(this.domNode,et.KEY_UP,d=>{const h=new Pi(d);this.isTriggerKeyEvent(h)?(!this._triggerKeys.keyDown&&this.triggerKeyDown&&(this.triggerKeyDown=!1,this.doTrigger(h)),h.preventDefault(),h.stopPropagation()):(h.equals(2)||h.equals(1026))&&this.updateFocusedItem()})),this.focusTracker=this._register(pf(this.domNode)),this._register(this.focusTracker.onDidBlur(()=>{(Nu()===this.domNode||!rs(Nu(),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()>=2?this.actionsList.setAttribute("role",this.options.ariaRole||"toolbar"):this.actionsList.setAttribute("role","presentation")}setFocusable(e){if(this.focusable=e,this.focusable){const t=this.viewItems.find(n=>n instanceof wd&&n.isEnabled());t instanceof wd&&t.setFocusable(!0)}else this.viewItems.forEach(t=>{t instanceof wd&&t.setFocusable(!1)})}isTriggerKeyEvent(e){let t=!1;return this._triggerKeys.keys.forEach(n=>{t=t||e.equals(n)}),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}getAction(e){var t;if(typeof e=="number")return(t=this.viewItems[e])===null||t===void 0?void 0:t.action;if(e instanceof HTMLElement){for(;e.parentElement!==this.actionsList;){if(!e.parentElement)return;e=e.parentElement}for(let n=0;n{const s=document.createElement("li");s.className="action-item",s.setAttribute("role","presentation");let a;const l=Object.assign({hoverDelegate:this.options.hoverDelegate},t);this.options.actionViewItemProvider&&(a=this.options.actionViewItemProvider(r,l)),a||(a=new Aw(this.context,r,l)),this.options.allowContextMenu||this.viewItemDisposables.set(a,ke(s,et.CONTEXT_MENU,c=>{dn.stop(c,!0)})),a.actionRunner=this._actionRunner,a.setActionContext(this.context),a.render(s),this.focusable&&a instanceof wd&&this.viewItems.length===0&&a.setFocusable(!0),o===null||o<0||o>=this.actionsList.children.length?(this.actionsList.appendChild(s),this.viewItems.push(a)):(this.actionsList.insertBefore(s,this.actionsList.children[o]),this.viewItems.splice(o,0,a),o++)}),typeof this.focusedItem=="number"&&this.focus(this.focusedItem),this.refreshRole()}clear(){this.isEmpty()||(this.viewItems=si(this.viewItems),this.viewItemDisposables.clearAndDisposeAll(),Ur(this.actionsList),this.refreshRole())}length(){return this.viewItems.length}isEmpty(){return this.viewItems.length===0}focus(e){let t=!1,n;if(e===void 0?t=!0:typeof e=="number"?n=e:typeof e=="boolean"&&(t=e),t&&typeof this.focusedItem=="undefined"){const o=this.viewItems.findIndex(r=>r.isEnabled());this.focusedItem=o===-1?void 0:o,this.updateFocus(void 0,void 0,!0)}else n!==void 0&&(this.focusedItem=n),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=="undefined")this.focusedItem=this.viewItems.length-1;else if(this.viewItems.length<=1)return!1;const t=this.focusedItem;let n;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,n=this.viewItems[this.focusedItem]}while(this.focusedItem!==t&&(this.options.focusOnlyEnabledItems&&!n.isEnabled()||n.action.id===kr.ID));return this.updateFocus(),!0}focusPrevious(e){if(typeof this.focusedItem=="undefined")this.focusedItem=0;else if(this.viewItems.length<=1)return!1;const t=this.focusedItem;let n;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}n=this.viewItems[this.focusedItem]}while(this.focusedItem!==t&&(this.options.focusOnlyEnabledItems&&!n.isEnabled()||n.action.id===kr.ID));return this.updateFocus(!0),!0}updateFocus(e,t,n=!1){var o;typeof this.focusedItem=="undefined"&&this.actionsList.focus({preventScroll:t}),this.previouslyFocusedItem!==void 0&&this.previouslyFocusedItem!==this.focusedItem&&((o=this.viewItems[this.previouslyFocusedItem])===null||o===void 0||o.blur());const r=this.focusedItem!==void 0&&this.viewItems[this.focusedItem];if(r){let s=!0;DD(r.focus)||(s=!1),this.options.focusOnlyEnabledItems&&DD(r.isEnabled)&&!r.isEnabled()&&(s=!1),r.action.id===kr.ID&&(s=!1),s?(n||this.previouslyFocusedItem!==this.focusedItem)&&(r.focus(e),this.previouslyFocusedItem=this.focusedItem):(this.actionsList.focus({preventScroll:t}),this.previouslyFocusedItem=void 0)}}doTrigger(e){if(typeof this.focusedItem=="undefined")return;const t=this.viewItems[this.focusedItem];if(t instanceof wd){const n=t._context===null||t._context===void 0?e:t._context;this.run(t._action,n)}}run(e,t){return Qdt(this,void 0,void 0,function*(){yield this._actionRunner.run(e,t)})}dispose(){this._context=void 0,this.viewItems=si(this.viewItems),this.getContainer().remove(),super.dispose()}}const f$=/\(&([^\s&])\)|(^|[^&])&([^\s&])/,F9=/(&)?(&)([^\s&])/g;var BP;(function(i){i[i.Right=0]="Right",i[i.Left=1]="Left"})(BP||(BP={}));class Py extends zc{constructor(e,t,n,o){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:1,actionViewItemProvider:l=>this.doGetActionViewItem(l,n,s),context:n.context,actionRunner:n.actionRunner,ariaLabel:n.ariaLabel,ariaRole:"menu",focusOnlyEnabledItems:!0,triggerKeys:{keys:[3,...Nn||xs?[10]:[]],keyDown:!0}}),this.menuStyles=o,this.menuElement=r,this.actionsList.tabIndex=0,this.menuDisposables=this._register(new Be),this.initializeOrUpdateStyleSheet(e,o),this._register(Ei.addTarget(r)),ke(r,et.KEY_DOWN,l=>{new Pi(l).equals(2)&&l.preventDefault()}),n.enableMnemonics&&this.menuDisposables.add(ke(r,et.KEY_DOWN,l=>{const c=l.key.toLocaleLowerCase();if(this.mnemonics.has(c)){dn.stop(l,!0);const u=this.mnemonics.get(c);if(u.length===1&&(u[0]instanceof fae&&u[0].container&&this.focusItemByElement(u[0].container),u[0].onClick(l)),u.length>1){const d=u.shift();d&&d.container&&(this.focusItemByElement(d.container),u.push(d)),this.mnemonics.set(c,u)}}})),xs&&this._register(ke(r,et.KEY_DOWN,l=>{const c=new Pi(l);c.equals(14)||c.equals(11)?(this.focusedItem=this.viewItems.length-1,this.focusNext(),dn.stop(l,!0)):(c.equals(13)||c.equals(12))&&(this.focusedItem=0,this.focusPrevious(),dn.stop(l,!0))})),this._register(ke(this.domNode,et.MOUSE_OUT,l=>{const c=l.relatedTarget;rs(c,this.domNode)||(this.focusedItem=void 0,this.updateFocus(),l.stopPropagation())})),this._register(ke(this.actionsList,et.MOUSE_OVER,l=>{let c=l.target;if(!(!c||!rs(c,this.actionsList)||c===this.actionsList)){for(;c.parentElement!==this.actionsList&&c.parentElement!==null;)c=c.parentElement;if(c.classList.contains("action-item")){const u=this.focusedItem;this.setFocusedItem(c),u!==this.focusedItem&&this.updateFocus()}}})),this._register(Ei.addTarget(this.actionsList)),this._register(ke(this.actionsList,Di.Tap,l=>{let c=l.initialTarget;if(!(!c||!rs(c,this.actionsList)||c===this.actionsList)){for(;c.parentElement!==this.actionsList&&c.parentElement!==null;)c=c.parentElement;if(c.classList.contains("action-item")){const u=this.focusedItem;this.setFocusedItem(c),u!==this.focusedItem&&this.updateFocus()}}}));const s={parent:this};this.mnemonics=new Map,this.scrollableElement=this._register(new YI(r,{alwaysConsumeMouseWheel:!0,horizontal:2,vertical:3,verticalScrollbarSize:7,handleMouseWheel:!0,useShadows:!0}));const a=this.scrollableElement.getDomNode();a.style.position="",this.styleScrollElement(a,o),this._register(ke(r,Di.Change,l=>{dn.stop(l,!0);const c=this.scrollableElement.getScrollPosition().scrollTop;this.scrollableElement.setScrollPosition({scrollTop:c-l.translationY})})),this._register(ke(a,et.MOUSE_UP,l=>{l.preventDefault()})),r.style.maxHeight=`${Math.max(10,window.innerHeight-e.getBoundingClientRect().top-35)}px`,t=t.filter(l=>{var c;return!((c=n.submenuIds)===null||c===void 0)&&c.has(l.id)?(console.warn(`Found submenu cycle: ${l.id}`),!1):!0}),this.push(t,{icon:!0,label:!0,isMenu:!0}),e.appendChild(this.scrollableElement.getDomNode()),this.scrollableElement.scanDomNode(),this.viewItems.filter(l=>!(l instanceof gae)).forEach((l,c,u)=>{l.updatePositionInSet(c+1,u.length)})}initializeOrUpdateStyleSheet(e,t){this.styleSheet||(qA(e)?this.styleSheet=Wc(e):(Py.globalStyleSheet||(Py.globalStyleSheet=Wc()),this.styleSheet=Py.globalStyleSheet)),this.styleSheet.textContent=eht(t,qA(e))}styleScrollElement(e,t){var n,o;const r=(n=t.foregroundColor)!==null&&n!==void 0?n:"",s=(o=t.backgroundColor)!==null&&o!==void 0?o:"",a=t.borderColor?`1px solid ${t.borderColor}`:"",l="5px",c=t.shadowColor?`0 2px 8px ${t.shadowColor}`:"";e.style.outline=a,e.style.borderRadius=l,e.style.color=r,e.style.backgroundColor=s,e.style.boxShadow=c}getContainer(){return this.scrollableElement.getDomNode()}get onScroll(){return this.scrollableElement.onScroll}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(ke(this.element,et.MOUSE_UP,r=>{if(dn.stop(r,!0),Fc){if(new kc(r).rightButton)return;this.onClick(r)}else setTimeout(()=>{this.onClick(r)},0)})),this._register(ke(this.element,et.CONTEXT_MENU,r=>{dn.stop(r,!0)})))},100),this._register(this.runOnceToEnableMouseUp)}render(e){super.render(e),this.element&&(this.container=e,this.item=Ae(this.element,He("a.action-menu-item")),this._action.id===kr.ID?this.item.setAttribute("role","presentation"):(this.item.setAttribute("role","menuitem"),this.mnemonic&&this.item.setAttribute("aria-keyshortcuts",`${this.mnemonic}`)),this.check=Ae(this.item,He("span.menu-item-check"+Mt.asCSSSelector(Xe.menuSelection))),this.check.setAttribute("role","none"),this.label=Ae(this.item,He("span.action-label")),this.options.label&&this.options.keybinding&&(Ae(this.item,He("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(){var e;super.focus(),(e=this.item)===null||e===void 0||e.focus(),this.applyStyle()}updatePositionInSet(e,t){this.item&&(this.item.setAttribute("aria-posinset",`${e}`),this.item.setAttribute("aria-setsize",`${t}`))}updateLabel(){var e;if(!!this.label&&this.options.label){Ur(this.label);let t=fX(this.action.label);if(t){const n=Jdt(t);this.options.enableMnemonics||(t=n),this.label.setAttribute("aria-label",n.replace(/&&/g,"&"));const o=f$.exec(t);if(o){t=$A(t),F9.lastIndex=0;let r=F9.exec(t);for(;r&&r[1];)r=F9.exec(t);const s=a=>a.replace(/&&/g,"&");r?this.label.append(BI(s(t.substr(0,r.index))," "),He("u",{"aria-hidden":"true"},r[3]),H_e(s(t.substr(r.index+r[0].length))," ")):this.label.innerText=s(t).trim(),(e=this.item)===null||e===void 0||e.setAttribute("aria-keyshortcuts",(o[1]?o[1]:o[3]).toLocaleLowerCase())}else this.label.innerText=t.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,n=e&&this.menuStyle.selectionBackgroundColor?this.menuStyle.selectionBackgroundColor:void 0,o=e&&this.menuStyle.selectionBorderColor?`1px solid ${this.menuStyle.selectionBorderColor}`:"",r=e&&this.menuStyle.selectionBorderColor?"-1px":"";this.item&&(this.item.style.color=t!=null?t:"",this.item.style.backgroundColor=n!=null?n:"",this.item.style.outline=o,this.item.style.outlineOffset=r),this.check&&(this.check.style.color=t!=null?t:"")}}class fae extends Z1e{constructor(e,t,n,o,r){super(e,e,o,r),this.submenuActions=t,this.parentData=n,this.submenuOptions=o,this.mysubmenu=null,this.submenuDisposables=this._register(new Be),this.mouseOver=!1,this.expandDirection=o&&o.expandDirection!==void 0?o.expandDirection:BP.Right,this.showScheduler=new bi(()=>{this.mouseOver&&(this.cleanupExistingSubmenu(!1),this.createSubmenu(!1))},250),this.hideScheduler=new bi(()=>{this.element&&!rs(Nu(),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=Ae(this.item,He("span.submenu-indicator"+Mt.asCSSSelector(Xe.menuSubmenu))),this.submenuIndicator.setAttribute("aria-hidden","true")),this._register(ke(this.element,et.KEY_UP,t=>{const n=new Pi(t);(n.equals(17)||n.equals(3))&&(dn.stop(t,!0),this.createSubmenu(!0))})),this._register(ke(this.element,et.KEY_DOWN,t=>{const n=new Pi(t);Nu()===this.item&&(n.equals(17)||n.equals(3))&&dn.stop(t,!0)})),this._register(ke(this.element,et.MOUSE_OVER,t=>{this.mouseOver||(this.mouseOver=!0,this.showScheduler.schedule())})),this._register(ke(this.element,et.MOUSE_LEAVE,t=>{this.mouseOver=!1})),this._register(ke(this.element,et.FOCUS_OUT,t=>{this.element&&!rs(Nu(),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(){}onClick(e){dn.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,n,o){const r={top:0,left:0};return r.left=zC(e.width,t.width,{position:o===BP.Right?0:1,offset:n.left,size:n.width}),r.left>=n.left&&r.left{new Pi(c).equals(15)&&(dn.stop(c,!0),this.parentData.parent.focus(),this.cleanupExistingSubmenu(!0))})),this.submenuDisposables.add(ke(this.submenuContainer,et.KEY_DOWN,c=>{new Pi(c).equals(15)&&dn.stop(c,!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){var t;this.item&&((t=this.item)===null||t===void 0||t.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!=null?t:"")}dispose(){super.dispose(),this.hideScheduler.dispose(),this.mysubmenu&&(this.mysubmenu.dispose(),this.mysubmenu=null),this.submenuContainer&&(this.submenuContainer=void 0)}}class gae extends Aw{constructor(e,t,n,o){super(e,t,n),this.menuStyles=o}render(e){super.render(e),this.label&&(this.label.style.borderBottomColor=this.menuStyles.separatorColor?`${this.menuStyles.separatorColor}`:"")}}function Jdt(i){const e=f$,t=e.exec(i);if(!t)return i;const n=!t[1];return i.replace(e,n?"$2$3":"").trim()}function pae(i){const e=F_e()[i.id];return`.codicon-${i.id}:before { content: '\\${e.toString(16)}'; }`}function eht(i,e){let t=` .monaco-menu { font-size: 13px; border-radius: 5px; min-width: 160px; } -${aae(Xe.menuSelection)} -${aae(Xe.menuSubmenu)} +${pae(Xe.menuSelection)} +${pae(Xe.menuSubmenu)} .monaco-menu .monaco-action-bar { text-align: right; @@ -975,78 +976,78 @@ ${aae(Xe.menuSubmenu)} .monaco-scrollable-element > .scrollbar > .slider.active { background: ${s}; } - `)}return t}class Xdt{constructor(e,t,n,o){this.contextViewService=e,this.telemetryService=t,this.notificationService=n,this.keybindingService=o,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=document.activeElement;let n;const o=Qq(e.domForShadowRoot)?e.domForShadowRoot:void 0;this.contextViewService.showContextView({getAnchor:()=>e.getAnchor(),canRelayout:!1,anchorAlignment:e.anchorAlignment,anchorAxisAlignment:e.anchorAxisAlignment,render:r=>{var s;this.lastContainer=r;const a=e.getMenuClassName?e.getMenuClassName():"";a&&(r.className+=" "+a),this.options.blockMouse&&(this.block=r.appendChild(He(".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",(s=this.blockDisposable)===null||s===void 0||s.dispose(),this.blockDisposable=ke(this.block,et.MOUSE_DOWN,u=>u.stopPropagation()));const l=new Be,c=e.actionRunner||new gy;return c.onWillRun(u=>this.onActionRun(u,!e.skipTelemetry),this,l),c.onDidRun(this.onDidActionRun,this,l),n=new Pw(r,t,{actionViewItemProvider:e.getActionViewItem,context:e.getActionsContext?e.getActionsContext():null,actionRunner:c,getKeyBinding:e.getKeyBinding?e.getKeyBinding:u=>this.keybindingService.lookupKeybinding(u.id)},zdt),n.onDidCancel(()=>this.contextViewService.hideContextView(!0),null,l),n.onDidBlur(()=>this.contextViewService.hideContextView(!0),null,l),l.add(ke(window,et.BLUR,()=>this.contextViewService.hideContextView(!0))),l.add(ke(window,et.MOUSE_DOWN,u=>{if(u.defaultPrevented)return;const d=new Dc(u);let h=d.target;if(!d.rightButton){for(;h;){if(h===r)return;h=h.parentElement}this.contextViewService.hideContextView(!0)}})),Iu(l,n)},focus:()=>{n==null||n.focus(!!e.autoSelectFirstItem)},onHide:r=>{var s,a,l;(s=e.onHide)===null||s===void 0||s.call(e,!!r),this.block&&(this.block.remove(),this.block=null),(a=this.blockDisposable)===null||a===void 0||a.dispose(),this.blockDisposable=null,!!this.lastContainer&&(Tu()===this.lastContainer||os(Tu(),this.lastContainer))&&((l=this.focusToReturn)===null||l===void 0||l.focus()),this.lastContainer=null}},o,!!o)}onActionRun(e,t){t&&this.telemetryService.publicLog2("workbenchActionExecuted",{id:e.action.id,from:"contextMenu"}),this.contextViewService.hideContextView(!1)}onDidActionRun(e){e.error&&!oh(e.error)&&this.notificationService.error(e.error)}}var Ydt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},G1=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let u$=class extends _e{get contextMenuHandler(){return this._contextMenuHandler||(this._contextMenuHandler=new Xdt(this.contextViewService,this.telemetryService,this.notificationService,this.keybindingService)),this._contextMenuHandler}constructor(e,t,n,o,r,s){super(),this.telemetryService=e,this.notificationService=t,this.contextViewService=n,this.keybindingService=o,this.menuService=r,this.contextKeyService=s,this._contextMenuHandler=void 0,this._onDidShowContextMenu=this._store.add(new le),this._onDidHideContextMenu=this._store.add(new le)}configure(e){this.contextMenuHandler.configure(e)}showContextMenu(e){e=d$.transform(e,this.menuService,this.contextKeyService),this.contextMenuHandler.showContextMenu(Object.assign(Object.assign({},e),{onHide:t=>{var n;(n=e.onHide)===null||n===void 0||n.call(e,t),this._onDidHideContextMenu.fire()}})),Ng.getInstance().resetKeyStatus(),this._onDidShowContextMenu.fire()}};u$=Ydt([G1(0,ec),G1(1,Ao),G1(2,mp),G1(3,xi),G1(4,If),G1(5,Ut)],u$);var d$;(function(i){function e(n){return n&&n.menuId instanceof Z}function t(n,o,r){if(!e(n))return n;const{menuId:s,menuActionOptions:a,contextKeyService:l}=n;return Object.assign(Object.assign({},n),{getActions:()=>{const c=[];if(s){const u=o.createMenu(s,l!=null?l:r);Udt(u,a,c),u.dispose()}return n.getActions?kr.join(n.getActions(),c):c}})}i.transform=t})(d$||(d$={}));var OP;(function(i){i[i.API=0]="API",i[i.USER=1]="USER"})(OP||(OP={}));var uX=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},FP=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},j_=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};let h$=class{constructor(e){this._commandService=e}open(e,t){return j_(this,void 0,void 0,function*(){if(!XG(e,hn.command))return!1;if(!(t!=null&&t.allowCommands)||(typeof e=="string"&&(e=Rt.parse(e)),Array.isArray(t.allowCommands)&&!t.allowCommands.includes(e.path)))return!0;let n=[];try{n=t$(decodeURIComponent(e.query))}catch{try{n=t$(e.query)}catch{}}return Array.isArray(n)||(n=[n]),yield this._commandService.executeCommand(e.path,...n),!0})}};h$=uX([FP(0,_o)],h$);let f$=class{constructor(e){this._editorService=e}open(e,t){return j_(this,void 0,void 0,function*(){typeof e=="string"&&(e=Rt.parse(e));const{selection:n,uri:o}=ect(e);return e=o,e.scheme===hn.file&&(e=Ost(e)),yield this._editorService.openCodeEditor({resource:e,options:Object.assign({selection:n,source:t!=null&&t.fromUserGesture?OP.USER:OP.API},t==null?void 0:t.editorOptions)},this._editorService.getFocusedCodeEditor(),t==null?void 0:t.openToSide),!0})}};f$=uX([FP(0,Jn)],f$);let g$=class{constructor(e,t){this._openers=new ia,this._validators=new ia,this._resolvers=new ia,this._resolvedUriTargets=new vs(n=>n.with({path:null,fragment:null,query:null}).toString()),this._externalOpeners=new ia,this._defaultExternalOpener={openExternal:n=>j_(this,void 0,void 0,function*(){return Rse(n,hn.http,hn.https)?c0e(n):window.location.href=n,!0})},this._openers.push({open:(n,o)=>j_(this,void 0,void 0,function*(){return(o==null?void 0:o.openExternal)||Rse(n,hn.mailto,hn.http,hn.https,hn.vsls)?(yield this._doOpenExternal(n,o),!0):!1})}),this._openers.push(new h$(t)),this._openers.push(new f$(e))}registerOpener(e){return{dispose:this._openers.unshift(e)}}open(e,t){var n;return j_(this,void 0,void 0,function*(){const o=typeof e=="string"?Rt.parse(e):e,r=(n=this._resolvedUriTargets.get(o))!==null&&n!==void 0?n:e;for(const s of this._validators)if(!(yield s.shouldOpen(r,t)))return!1;for(const s of this._openers)if(yield s.open(e,t))return!0;return!1})}resolveExternalUri(e,t){return j_(this,void 0,void 0,function*(){for(const n of this._resolvers)try{const o=yield n.resolveExternalUri(e,t);if(o)return this._resolvedUriTargets.has(o.resolved)||this._resolvedUriTargets.set(o.resolved,e),o}catch{}throw new Error("Could not resolve external URI: "+e.toString())})}_doOpenExternal(e,t){return j_(this,void 0,void 0,function*(){const n=typeof e=="string"?Rt.parse(e):e;let o;try{o=(yield this.resolveExternalUri(n,t)).resolved}catch{o=n}let r;if(typeof e=="string"&&n.toString()===o.toString()?r=e:r=encodeURI(o.toString(!0)),t!=null&&t.allowContributedOpeners){const s=typeof(t==null?void 0:t.allowContributedOpeners)=="string"?t==null?void 0:t.allowContributedOpeners:void 0;for(const a of this._externalOpeners)if(yield a.openExternal(r,{sourceUri:n,preferredOpenerId:s},_n.None))return!0}return this._defaultExternalOpener.openExternal(r,{sourceUri:n},_n.None)})}dispose(){this._validators.clear()}};g$=uX([FP(0,Jn),FP(1,_o)],g$);const Gu=wn("editorWorkerService");var ao;(function(i){i[i.Hint=1]="Hint",i[i.Info=2]="Info",i[i.Warning=4]="Warning",i[i.Error=8]="Error"})(ao||(ao={}));(function(i){function e(s,a){return a-s}i.compare=e;const t=Object.create(null);t[i.Error]=C("sev.error","Error"),t[i.Warning]=C("sev.warning","Warning"),t[i.Info]=C("sev.info","Info");function n(s){return t[s]||""}i.toString=n;function o(s){switch(s){case So.Error:return i.Error;case So.Warning:return i.Warning;case So.Info:return i.Info;case So.Ignore:return i.Hint}}i.fromSeverity=o;function r(s){switch(s){case i.Error:return So.Error;case i.Warning:return So.Warning;case i.Info:return So.Info;case i.Hint:return So.Ignore}}i.toSeverity=r})(ao||(ao={}));var BP;(function(i){const e="";function t(o){return n(o,!0)}i.makeKey=t;function n(o,r){const s=[e];return o.source?s.push(o.source.replace("\xA6","\\\xA6")):s.push(e),o.code?typeof o.code=="string"?s.push(o.code.replace("\xA6","\\\xA6")):s.push(o.code.value.replace("\xA6","\\\xA6")):s.push(e),o.severity!==void 0&&o.severity!==null?s.push(ao.toString(o.severity)):s.push(e),o.message&&r?s.push(o.message.replace("\xA6","\\\xA6")):s.push(e),o.startLineNumber!==void 0&&o.startLineNumber!==null?s.push(o.startLineNumber.toString()):s.push(e),o.startColumn!==void 0&&o.startColumn!==null?s.push(o.startColumn.toString()):s.push(e),o.endLineNumber!==void 0&&o.endLineNumber!==null?s.push(o.endLineNumber.toString()):s.push(e),o.endColumn!==void 0&&o.endColumn!==null?s.push(o.endColumn.toString()):s.push(e),s.push(e),s.join("\xA6")}i.makeKeyOptionalMessage=n})(BP||(BP={}));const Rf=wn("markerService");function Zdt(i,e){const t=[],n=[];for(const o of i)e.has(o)||t.push(o);for(const o of e)i.has(o)||n.push(o);return{removed:t,added:n}}function Qdt(i,e){const t=new Set;for(const n of e)i.has(n)&&t.add(n);return t}var Jdt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},lae=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let p$=class extends _e{constructor(e,t){super(),this._markerService=t,this._onDidChangeMarker=this._register(new le),this._markerDecorations=new vs,e.getModels().forEach(n=>this._onModelAdded(n)),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 n=this._markerDecorations.get(e);return n&&n.getMarker(t)||null}_handleMarkerChange(e){e.forEach(t=>{const n=this._markerDecorations.get(t);n&&this._updateDecorations(n)})}_onModelAdded(e){const t=new eht(e);this._markerDecorations.set(e.uri,t),this._updateDecorations(t)}_onModelRemoved(e){var t;const n=this._markerDecorations.get(e.uri);n&&(n.dispose(),this._markerDecorations.delete(e.uri)),(e.uri.scheme===hn.inMemory||e.uri.scheme===hn.internal||e.uri.scheme===hn.vscode)&&((t=this._markerService)===null||t===void 0||t.read({resource:e.uri}).map(o=>o.owner).forEach(o=>this._markerService.remove(o,[e.uri])))}_updateDecorations(e){const t=this._markerService.read({resource:e.model.uri,take:500});e.update(t)&&this._onDidChangeMarker.fire(e.model)}};p$=Jdt([lae(0,Yi),lae(1,Rf)],p$);class eht extends _e{constructor(e){super(),this.model=e,this._map=new Fet,this._register(zt(()=>{this.model.deltaDecorations([...this._map.values()],[]),this._map.clear()}))}update(e){const{added:t,removed:n}=Zdt(new Set(this._map.keys()),new Set(e));if(t.length===0&&n.length===0)return!1;const o=n.map(a=>this._map.get(a)),r=t.map(a=>({range:this._createDecorationRange(this.model,a),options:this._createDecorationOption(a)})),s=this.model.deltaDecorations(o,r);for(const a of n)this._map.delete(a);for(let a=0;a=o)return n;const r=e.getWordAtPosition(n.getStartPosition());r&&(n=new V(n.startLineNumber,r.startColumn,n.endLineNumber,r.endColumn))}else if(t.endColumn===Number.MAX_VALUE&&t.startColumn===1&&n.startLineNumber===n.endLineNumber){const o=e.getLineFirstNonWhitespaceColumn(t.startLineNumber);o=0:!1}}var tht=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},$x=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},uC;function b_(i){return i.toString()}class nht{constructor(e,t,n){this.model=e,this._modelEventListeners=new Be,this.model=e,this._modelEventListeners.add(e.onWillDispose(()=>t(e))),this._modelEventListeners.add(e.onDidChangeLanguage(o=>n(e,o)))}dispose(){this._modelEventListeners.dispose()}}const iht=Ss||Nn?1:2;class oht{constructor(e,t,n,o,r,s,a,l){this.uri=e,this.initialUndoRedoSnapshot=t,this.time=n,this.sharesUndoRedoStack=o,this.heapSize=r,this.sha1=s,this.versionId=a,this.alternativeVersionId=l}}let WP=uC=class extends _e{constructor(e,t,n,o,r){super(),this._configurationService=e,this._resourcePropertiesService=t,this._undoRedoService=n,this._languageService=o,this._languageConfigurationService=r,this._onModelAdded=this._register(new le),this.onModelAdded=this._onModelAdded.event,this._onModelRemoved=this._register(new le),this.onModelRemoved=this._onModelRemoved.event,this._onModelModeChanged=this._register(new le),this.onModelLanguageChanged=this._onModelModeChanged.event,this._modelCreationOptionsByLanguageAndResource=Object.create(null),this._models={},this._disposedModels=new Map,this._disposedModelsHeapSize=0,this._register(this._configurationService.onDidChangeConfiguration(s=>this._updateModelOptions(s))),this._updateModelOptions(void 0)}static _readModelOptions(e,t){var n;let o=ms.tabSize;if(e.editor&&typeof e.editor.tabSize!="undefined"){const f=parseInt(e.editor.tabSize,10);isNaN(f)||(o=f),o<1&&(o=1)}let r="tabSize";if(e.editor&&typeof e.editor.indentSize!="undefined"&&e.editor.indentSize!=="tabSize"){const f=parseInt(e.editor.indentSize,10);isNaN(f)||(r=Math.max(f,1))}let s=ms.insertSpaces;e.editor&&typeof e.editor.insertSpaces!="undefined"&&(s=e.editor.insertSpaces==="false"?!1:Boolean(e.editor.insertSpaces));let a=iht;const l=e.eol;l===`\r + `)}return t}class tht{constructor(e,t,n,o){this.contextViewService=e,this.telemetryService=t,this.notificationService=n,this.keybindingService=o,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=document.activeElement;let n;const o=rG(e.domForShadowRoot)?e.domForShadowRoot:void 0;this.contextViewService.showContextView({getAnchor:()=>e.getAnchor(),canRelayout:!1,anchorAlignment:e.anchorAlignment,anchorAxisAlignment:e.anchorAxisAlignment,render:r=>{var s;this.lastContainer=r;const a=e.getMenuClassName?e.getMenuClassName():"";a&&(r.className+=" "+a),this.options.blockMouse&&(this.block=r.appendChild(He(".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",(s=this.blockDisposable)===null||s===void 0||s.dispose(),this.blockDisposable=ke(this.block,et.MOUSE_DOWN,u=>u.stopPropagation()));const l=new Be,c=e.actionRunner||new pw;return c.onWillRun(u=>this.onActionRun(u,!e.skipTelemetry),this,l),c.onDidRun(this.onDidActionRun,this,l),n=new Py(r,t,{actionViewItemProvider:e.getActionViewItem,context:e.getActionsContext?e.getActionsContext():null,actionRunner:c,getKeyBinding:e.getKeyBinding?e.getKeyBinding:u=>this.keybindingService.lookupKeybinding(u.id)},Xdt),n.onDidCancel(()=>this.contextViewService.hideContextView(!0),null,l),n.onDidBlur(()=>this.contextViewService.hideContextView(!0),null,l),l.add(ke(window,et.BLUR,()=>this.contextViewService.hideContextView(!0))),l.add(ke(window,et.MOUSE_DOWN,u=>{if(u.defaultPrevented)return;const d=new kc(u);let h=d.target;if(!d.rightButton){for(;h;){if(h===r)return;h=h.parentElement}this.contextViewService.hideContextView(!0)}})),Tu(l,n)},focus:()=>{n==null||n.focus(!!e.autoSelectFirstItem)},onHide:r=>{var s,a,l;(s=e.onHide)===null||s===void 0||s.call(e,!!r),this.block&&(this.block.remove(),this.block=null),(a=this.blockDisposable)===null||a===void 0||a.dispose(),this.blockDisposable=null,!!this.lastContainer&&(Nu()===this.lastContainer||rs(Nu(),this.lastContainer))&&((l=this.focusToReturn)===null||l===void 0||l.focus()),this.lastContainer=null}},o,!!o)}onActionRun(e,t){t&&this.telemetryService.publicLog2("workbenchActionExecuted",{id:e.action.id,from:"contextMenu"}),this.contextViewService.hideContextView(!1)}onDidActionRun(e){e.error&&!sh(e.error)&&this.notificationService.error(e.error)}}var nht=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},G1=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let g$=class extends _e{get contextMenuHandler(){return this._contextMenuHandler||(this._contextMenuHandler=new tht(this.contextViewService,this.telemetryService,this.notificationService,this.keybindingService)),this._contextMenuHandler}constructor(e,t,n,o,r,s){super(),this.telemetryService=e,this.notificationService=t,this.contextViewService=n,this.keybindingService=o,this.menuService=r,this.contextKeyService=s,this._contextMenuHandler=void 0,this._onDidShowContextMenu=this._store.add(new le),this._onDidHideContextMenu=this._store.add(new le)}configure(e){this.contextMenuHandler.configure(e)}showContextMenu(e){e=p$.transform(e,this.menuService,this.contextKeyService),this.contextMenuHandler.showContextMenu(Object.assign(Object.assign({},e),{onHide:t=>{var n;(n=e.onHide)===null||n===void 0||n.call(e,t),this._onDidHideContextMenu.fire()}})),Rg.getInstance().resetKeyStatus(),this._onDidShowContextMenu.fire()}};g$=nht([G1(0,tc),G1(1,Ao),G1(2,_p),G1(3,xi),G1(4,If),G1(5,Ut)],g$);var p$;(function(i){function e(n){return n&&n.menuId instanceof Z}function t(n,o,r){if(!e(n))return n;const{menuId:s,menuActionOptions:a,contextKeyService:l}=n;return Object.assign(Object.assign({},n),{getActions:()=>{const c=[];if(s){const u=o.createMenu(s,l!=null?l:r);Ydt(u,a,c),u.dispose()}return n.getActions?kr.join(n.getActions(),c):c}})}i.transform=t})(p$||(p$={}));var WP;(function(i){i[i.API=0]="API",i[i.USER=1]="USER"})(WP||(WP={}));var vX=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},VP=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},K_=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};let m$=class{constructor(e){this._commandService=e}open(e,t){return K_(this,void 0,void 0,function*(){if(!nX(e,hn.command))return!1;if(!(t!=null&&t.allowCommands)||(typeof e=="string"&&(e=Rt.parse(e)),Array.isArray(t.allowCommands)&&!t.allowCommands.includes(e.path)))return!0;let n=[];try{n=r$(decodeURIComponent(e.query))}catch{try{n=r$(e.query)}catch{}}return Array.isArray(n)||(n=[n]),yield this._commandService.executeCommand(e.path,...n),!0})}};m$=vX([VP(0,_o)],m$);let v$=class{constructor(e){this._editorService=e}open(e,t){return K_(this,void 0,void 0,function*(){typeof e=="string"&&(e=Rt.parse(e));const{selection:n,uri:o}=sct(e);return e=o,e.scheme===hn.file&&(e=$st(e)),yield this._editorService.openCodeEditor({resource:e,options:Object.assign({selection:n,source:t!=null&&t.fromUserGesture?WP.USER:WP.API},t==null?void 0:t.editorOptions)},this._editorService.getFocusedCodeEditor(),t==null?void 0:t.openToSide),!0})}};v$=vX([VP(0,Jn)],v$);let _$=class{constructor(e,t){this._openers=new oa,this._validators=new oa,this._resolvers=new oa,this._resolvedUriTargets=new _s(n=>n.with({path:null,fragment:null,query:null}).toString()),this._externalOpeners=new oa,this._defaultExternalOpener={openExternal:n=>K_(this,void 0,void 0,function*(){return Vse(n,hn.http,hn.https)?v0e(n):window.location.href=n,!0})},this._openers.push({open:(n,o)=>K_(this,void 0,void 0,function*(){return(o==null?void 0:o.openExternal)||Vse(n,hn.mailto,hn.http,hn.https,hn.vsls)?(yield this._doOpenExternal(n,o),!0):!1})}),this._openers.push(new m$(t)),this._openers.push(new v$(e))}registerOpener(e){return{dispose:this._openers.unshift(e)}}open(e,t){var n;return K_(this,void 0,void 0,function*(){const o=typeof e=="string"?Rt.parse(e):e,r=(n=this._resolvedUriTargets.get(o))!==null&&n!==void 0?n:e;for(const s of this._validators)if(!(yield s.shouldOpen(r,t)))return!1;for(const s of this._openers)if(yield s.open(e,t))return!0;return!1})}resolveExternalUri(e,t){return K_(this,void 0,void 0,function*(){for(const n of this._resolvers)try{const o=yield n.resolveExternalUri(e,t);if(o)return this._resolvedUriTargets.has(o.resolved)||this._resolvedUriTargets.set(o.resolved,e),o}catch{}throw new Error("Could not resolve external URI: "+e.toString())})}_doOpenExternal(e,t){return K_(this,void 0,void 0,function*(){const n=typeof e=="string"?Rt.parse(e):e;let o;try{o=(yield this.resolveExternalUri(n,t)).resolved}catch{o=n}let r;if(typeof e=="string"&&n.toString()===o.toString()?r=e:r=encodeURI(o.toString(!0)),t!=null&&t.allowContributedOpeners){const s=typeof(t==null?void 0:t.allowContributedOpeners)=="string"?t==null?void 0:t.allowContributedOpeners:void 0;for(const a of this._externalOpeners)if(yield a.openExternal(r,{sourceUri:n,preferredOpenerId:s},_n.None))return!0}return this._defaultExternalOpener.openExternal(r,{sourceUri:n},_n.None)})}dispose(){this._validators.clear()}};_$=vX([VP(0,Jn),VP(1,_o)],_$);const Xu=yn("editorWorkerService");var ao;(function(i){i[i.Hint=1]="Hint",i[i.Info=2]="Info",i[i.Warning=4]="Warning",i[i.Error=8]="Error"})(ao||(ao={}));(function(i){function e(s,a){return a-s}i.compare=e;const t=Object.create(null);t[i.Error]=C("sev.error","Error"),t[i.Warning]=C("sev.warning","Warning"),t[i.Info]=C("sev.info","Info");function n(s){return t[s]||""}i.toString=n;function o(s){switch(s){case So.Error:return i.Error;case So.Warning:return i.Warning;case So.Info:return i.Info;case So.Ignore:return i.Hint}}i.fromSeverity=o;function r(s){switch(s){case i.Error:return So.Error;case i.Warning:return So.Warning;case i.Info:return So.Info;case i.Hint:return So.Ignore}}i.toSeverity=r})(ao||(ao={}));var HP;(function(i){const e="";function t(o){return n(o,!0)}i.makeKey=t;function n(o,r){const s=[e];return o.source?s.push(o.source.replace("\xA6","\\\xA6")):s.push(e),o.code?typeof o.code=="string"?s.push(o.code.replace("\xA6","\\\xA6")):s.push(o.code.value.replace("\xA6","\\\xA6")):s.push(e),o.severity!==void 0&&o.severity!==null?s.push(ao.toString(o.severity)):s.push(e),o.message&&r?s.push(o.message.replace("\xA6","\\\xA6")):s.push(e),o.startLineNumber!==void 0&&o.startLineNumber!==null?s.push(o.startLineNumber.toString()):s.push(e),o.startColumn!==void 0&&o.startColumn!==null?s.push(o.startColumn.toString()):s.push(e),o.endLineNumber!==void 0&&o.endLineNumber!==null?s.push(o.endLineNumber.toString()):s.push(e),o.endColumn!==void 0&&o.endColumn!==null?s.push(o.endColumn.toString()):s.push(e),s.push(e),s.join("\xA6")}i.makeKeyOptionalMessage=n})(HP||(HP={}));const Rf=yn("markerService");function iht(i,e){const t=[],n=[];for(const o of i)e.has(o)||t.push(o);for(const o of e)i.has(o)||n.push(o);return{removed:t,added:n}}function oht(i,e){const t=new Set;for(const n of e)i.has(n)&&t.add(n);return t}var rht=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},mae=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let b$=class extends _e{constructor(e,t){super(),this._markerService=t,this._onDidChangeMarker=this._register(new le),this._markerDecorations=new _s,e.getModels().forEach(n=>this._onModelAdded(n)),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 n=this._markerDecorations.get(e);return n&&n.getMarker(t)||null}_handleMarkerChange(e){e.forEach(t=>{const n=this._markerDecorations.get(t);n&&this._updateDecorations(n)})}_onModelAdded(e){const t=new sht(e);this._markerDecorations.set(e.uri,t),this._updateDecorations(t)}_onModelRemoved(e){var t;const n=this._markerDecorations.get(e.uri);n&&(n.dispose(),this._markerDecorations.delete(e.uri)),(e.uri.scheme===hn.inMemory||e.uri.scheme===hn.internal||e.uri.scheme===hn.vscode)&&((t=this._markerService)===null||t===void 0||t.read({resource:e.uri}).map(o=>o.owner).forEach(o=>this._markerService.remove(o,[e.uri])))}_updateDecorations(e){const t=this._markerService.read({resource:e.model.uri,take:500});e.update(t)&&this._onDidChangeMarker.fire(e.model)}};b$=rht([mae(0,Yi),mae(1,Rf)],b$);class sht extends _e{constructor(e){super(),this.model=e,this._map=new zet,this._register(zt(()=>{this.model.deltaDecorations([...this._map.values()],[]),this._map.clear()}))}update(e){const{added:t,removed:n}=iht(new Set(this._map.keys()),new Set(e));if(t.length===0&&n.length===0)return!1;const o=n.map(a=>this._map.get(a)),r=t.map(a=>({range:this._createDecorationRange(this.model,a),options:this._createDecorationOption(a)})),s=this.model.deltaDecorations(o,r);for(const a of n)this._map.delete(a);for(let a=0;a=o)return n;const r=e.getWordAtPosition(n.getStartPosition());r&&(n=new V(n.startLineNumber,r.startColumn,n.endLineNumber,r.endColumn))}else if(t.endColumn===Number.MAX_VALUE&&t.startColumn===1&&n.startLineNumber===n.endLineNumber){const o=e.getLineFirstNonWhitespaceColumn(t.startLineNumber);o=0:!1}}var aht=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},zx=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},uC;function b_(i){return i.toString()}class lht{constructor(e,t,n){this.model=e,this._modelEventListeners=new Be,this.model=e,this._modelEventListeners.add(e.onWillDispose(()=>t(e))),this._modelEventListeners.add(e.onDidChangeLanguage(o=>n(e,o)))}dispose(){this._modelEventListeners.dispose()}}const cht=xs||Nn?1:2;class uht{constructor(e,t,n,o,r,s,a,l){this.uri=e,this.initialUndoRedoSnapshot=t,this.time=n,this.sharesUndoRedoStack=o,this.heapSize=r,this.sha1=s,this.versionId=a,this.alternativeVersionId=l}}let $P=uC=class extends _e{constructor(e,t,n,o,r){super(),this._configurationService=e,this._resourcePropertiesService=t,this._undoRedoService=n,this._languageService=o,this._languageConfigurationService=r,this._onModelAdded=this._register(new le),this.onModelAdded=this._onModelAdded.event,this._onModelRemoved=this._register(new le),this.onModelRemoved=this._onModelRemoved.event,this._onModelModeChanged=this._register(new le),this.onModelLanguageChanged=this._onModelModeChanged.event,this._modelCreationOptionsByLanguageAndResource=Object.create(null),this._models={},this._disposedModels=new Map,this._disposedModelsHeapSize=0,this._register(this._configurationService.onDidChangeConfiguration(s=>this._updateModelOptions(s))),this._updateModelOptions(void 0)}static _readModelOptions(e,t){var n;let o=vs.tabSize;if(e.editor&&typeof e.editor.tabSize!="undefined"){const f=parseInt(e.editor.tabSize,10);isNaN(f)||(o=f),o<1&&(o=1)}let r="tabSize";if(e.editor&&typeof e.editor.indentSize!="undefined"&&e.editor.indentSize!=="tabSize"){const f=parseInt(e.editor.indentSize,10);isNaN(f)||(r=Math.max(f,1))}let s=vs.insertSpaces;e.editor&&typeof e.editor.insertSpaces!="undefined"&&(s=e.editor.insertSpaces==="false"?!1:Boolean(e.editor.insertSpaces));let a=cht;const l=e.eol;l===`\r `?a=2:l===` -`&&(a=1);let c=ms.trimAutoWhitespace;e.editor&&typeof e.editor.trimAutoWhitespace!="undefined"&&(c=e.editor.trimAutoWhitespace==="false"?!1:Boolean(e.editor.trimAutoWhitespace));let u=ms.detectIndentation;e.editor&&typeof e.editor.detectIndentation!="undefined"&&(u=e.editor.detectIndentation==="false"?!1:Boolean(e.editor.detectIndentation));let d=ms.largeFileOptimizations;e.editor&&typeof e.editor.largeFileOptimizations!="undefined"&&(d=e.editor.largeFileOptimizations==="false"?!1:Boolean(e.editor.largeFileOptimizations));let h=ms.bracketPairColorizationOptions;return((n=e.editor)===null||n===void 0?void 0:n.bracketPairColorization)&&typeof e.editor.bracketPairColorization=="object"&&(h={enabled:!!e.editor.bracketPairColorization.enabled,independentColorPoolPerBracketType:!!e.editor.bracketPairColorization.independentColorPoolPerBracketType}),{isForSimpleWidget:t,tabSize:o,indentSize:r,insertSpaces:s,detectIndentation:u,defaultEOL:a,trimAutoWhitespace:c,largeFileOptimizations:d,bracketPairColorizationOptions:h}}_getEOL(e,t){if(e)return this._resourcePropertiesService.getEOL(e,t);const n=this._configurationService.getValue("files.eol",{overrideIdentifier:t});return n&&typeof n=="string"&&n!=="auto"?n:Wl===3||Wl===2?` +`&&(a=1);let c=vs.trimAutoWhitespace;e.editor&&typeof e.editor.trimAutoWhitespace!="undefined"&&(c=e.editor.trimAutoWhitespace==="false"?!1:Boolean(e.editor.trimAutoWhitespace));let u=vs.detectIndentation;e.editor&&typeof e.editor.detectIndentation!="undefined"&&(u=e.editor.detectIndentation==="false"?!1:Boolean(e.editor.detectIndentation));let d=vs.largeFileOptimizations;e.editor&&typeof e.editor.largeFileOptimizations!="undefined"&&(d=e.editor.largeFileOptimizations==="false"?!1:Boolean(e.editor.largeFileOptimizations));let h=vs.bracketPairColorizationOptions;return((n=e.editor)===null||n===void 0?void 0:n.bracketPairColorization)&&typeof e.editor.bracketPairColorization=="object"&&(h={enabled:!!e.editor.bracketPairColorization.enabled,independentColorPoolPerBracketType:!!e.editor.bracketPairColorization.independentColorPoolPerBracketType}),{isForSimpleWidget:t,tabSize:o,indentSize:r,insertSpaces:s,detectIndentation:u,defaultEOL:a,trimAutoWhitespace:c,largeFileOptimizations:d,bracketPairColorizationOptions:h}}_getEOL(e,t){if(e)return this._resourcePropertiesService.getEOL(e,t);const n=this._configurationService.getValue("files.eol",{overrideIdentifier:t});return n&&typeof n=="string"&&n!=="auto"?n:Vl===3||Vl===2?` `:`\r -`}_shouldRestoreUndoStack(){const e=this._configurationService.getValue("files.restoreUndoStack");return typeof e=="boolean"?e:!0}getCreationOptions(e,t,n){const o=typeof e=="string"?e:e.languageId;let r=this._modelCreationOptionsByLanguageAndResource[o+t];if(!r){const s=this._configurationService.getValue("editor",{overrideIdentifier:o,resource:t}),a=this._getEOL(t,o);r=uC._readModelOptions({editor:s,eol:a},n),this._modelCreationOptionsByLanguageAndResource[o+t]=r}return r}_updateModelOptions(e){const t=this._modelCreationOptionsByLanguageAndResource;this._modelCreationOptionsByLanguageAndResource=Object.create(null);const n=Object.keys(this._models);for(let o=0,r=n.length;oe){const t=[];for(this._disposedModels.forEach(n=>{n.sharesUndoRedoStack||t.push(n)}),t.sort((n,o)=>n.time-o.time);t.length>0&&this._disposedModelsHeapSize>e;){const n=t.shift();this._removeDisposedModel(n.uri),n.initialUndoRedoSnapshot!==null&&this._undoRedoService.restoreSnapshot(n.initialUndoRedoSnapshot)}}}_createModelData(e,t,n,o){const r=this.getCreationOptions(t,n,o),s=new _f(e,t,r,n,this._undoRedoService,this._languageService,this._languageConfigurationService);if(n&&this._disposedModels.has(b_(n))){const c=this._removeDisposedModel(n),u=this._undoRedoService.getElements(n),d=this._getSHA1Computer(),h=d.canComputeSHA1(s)?d.computeSHA1(s)===c.sha1:!1;if(h||c.sharesUndoRedoStack){for(const f of u.past)gg(f)&&f.matchesResource(n)&&f.setModel(s);for(const f of u.future)gg(f)&&f.matchesResource(n)&&f.setModel(s);this._undoRedoService.setElementsValidFlag(n,!0,f=>gg(f)&&f.matchesResource(n)),h&&(s._overwriteVersionId(c.versionId),s._overwriteAlternativeVersionId(c.alternativeVersionId),s._overwriteInitialUndoRedoSnapshot(c.initialUndoRedoSnapshot))}else c.initialUndoRedoSnapshot!==null&&this._undoRedoService.restoreSnapshot(c.initialUndoRedoSnapshot)}const a=b_(s.uri);if(this._models[a])throw new Error("ModelService: Cannot add model because it already exists!");const l=new nht(s,c=>this._onWillDispose(c),(c,u)=>this._onDidChangeLanguage(c,u));return this._models[a]=l,l}createModel(e,t,n,o=!1){let r;return t?r=this._createModelData(e,t,n,o):r=this._createModelData(e,ql,n,o),this._onModelAdded.fire(r.model),r.model}getModels(){const e=[],t=Object.keys(this._models);for(let n=0,o=t.length;n0||c.future.length>0){for(const u of c.past)gg(u)&&u.matchesResource(e.uri)&&(r=!0,s+=u.heapSize(e.uri),u.setModel(e.uri));for(const u of c.future)gg(u)&&u.matchesResource(e.uri)&&(r=!0,s+=u.heapSize(e.uri),u.setModel(e.uri))}}const a=uC.MAX_MEMORY_FOR_CLOSED_FILES_UNDO_STACK,l=this._getSHA1Computer();if(r)if(!o&&(s>a||!l.canComputeSHA1(e))){const c=n.model.getInitialUndoRedoSnapshot();c!==null&&this._undoRedoService.restoreSnapshot(c)}else this._ensureDisposedModelsHeapSize(a-s),this._undoRedoService.setElementsValidFlag(e.uri,!1,c=>gg(c)&&c.matchesResource(e.uri)),this._insertDisposedModel(new oht(e.uri,n.model.getInitialUndoRedoSnapshot(),Date.now(),o,s,l.computeSHA1(e),e.getVersionId(),e.getAlternativeVersionId()));else if(!o){const c=n.model.getInitialUndoRedoSnapshot();c!==null&&this._undoRedoService.restoreSnapshot(c)}delete this._models[t],n.dispose(),delete this._modelCreationOptionsByLanguageAndResource[e.getLanguageId()+e.uri],this._onModelRemoved.fire(e)}_onDidChangeLanguage(e,t){const n=t.oldLanguage,o=e.getLanguageId(),r=this.getCreationOptions(n,e.uri,e.isForSimpleWidget),s=this.getCreationOptions(o,e.uri,e.isForSimpleWidget);uC._setModelOptionsForModel(e,s,r),this._onModelModeChanged.fire({model:e,oldLanguageId:n})}_getSHA1Computer(){return new P5}};WP.MAX_MEMORY_FOR_CLOSED_FILES_UNDO_STACK=20*1024*1024;WP=uC=tht([$x(0,En),$x(1,W0e),$x(2,S5),$x(3,Ki),$x(4,Ti)],WP);class P5{canComputeSHA1(e){return e.getValueLength()<=P5.MAX_MODEL_SIZE}computeSHA1(e){const t=new c5,n=e.createSnapshot();let o;for(;o=n.read();)t.update(o);return t.digest()}}P5.MAX_MODEL_SIZE=10*1024*1024;class rht{get templateId(){return this.renderer.templateId}constructor(e,t){this.renderer=e,this.modelProvider=t}renderTemplate(e){return{data:this.renderer.renderTemplate(e),disposable:_e.None}}renderElement(e,t,n,o){var r;if((r=n.disposable)===null||r===void 0||r.dispose(),!n.data)return;const s=this.modelProvider();if(s.isResolved(e))return this.renderer.renderElement(s.get(e),e,n.data,o);const a=new Ro,l=s.resolve(e,a.token);n.disposable={dispose:()=>a.cancel()},this.renderer.renderPlaceholder(e,n.data),l.then(c=>this.renderer.renderElement(c,e,n.data,o))}disposeTemplate(e){e.disposable&&(e.disposable.dispose(),e.disposable=void 0),e.data&&(this.renderer.disposeTemplate(e.data),e.data=void 0)}}class sht{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 aht(i,e){return Object.assign(Object.assign({},e),{accessibilityProvider:e.accessibilityProvider&&new sht(i,e.accessibilityProvider)})}class lht{constructor(e,t,n,o,r={}){const s=()=>this.model,a=o.map(l=>new rht(l,s));this.list=new Ku(e,t,n,a,aht(s,r))}updateOptions(e){this.list.updateOptions(e)}getHTMLElement(){return this.list.getHTMLElement()}get onDidFocus(){return this.list.onDidFocus}get widget(){return this.list}get onDidDispose(){return this.list.onDidDispose}get onMouseDblClick(){return st.map(this.list.onMouseDblClick,({element:e,index:t,browserEvent:n})=>({element:e===void 0?void 0:this._model.get(e),index:t,browserEvent:n}))}get onPointer(){return st.map(this.list.onPointer,({element:e,index:t,browserEvent:n})=>({element:e===void 0?void 0:this._model.get(e),index:t,browserEvent:n}))}get onDidChangeSelection(){return st.map(this.list.onDidChangeSelection,({elements:e,indexes:t,browserEvent:n})=>({elements:e.map(o=>this._model.get(o)),indexes:t,browserEvent:n}))}get model(){return this._model}set model(e){this._model=e,this.list.splice(0,this.list.length,Gs(e.length))}getFocus(){return this.list.getFocus()}getSelection(){return this.list.getSelection()}getSelectedElements(){return this.getSelection().map(e=>this.model.get(e))}style(e){this.list.style(e)}dispose(){this.list.dispose()}}var xS=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r};const cht=!1;var VP;(function(i){i.North="north",i.South="south",i.East="east",i.West="west"})(VP||(VP={}));let uht=4;const dht=new le;let hht=300;const fht=new le;class dX{constructor(){this.disposables=new Be}get onPointerMove(){return this.disposables.add(new xn(window,"mousemove")).event}get onPointerUp(){return this.disposables.add(new xn(window,"mouseup")).event}dispose(){this.disposables.dispose()}}xS([Mo],dX.prototype,"onPointerMove",null);xS([Mo],dX.prototype,"onPointerUp",null);class hX{get onPointerMove(){return this.disposables.add(new xn(this.el,Di.Change)).event}get onPointerUp(){return this.disposables.add(new xn(this.el,Di.End)).event}constructor(e){this.el=e,this.disposables=new Be}dispose(){this.disposables.dispose()}}xS([Mo],hX.prototype,"onPointerMove",null);xS([Mo],hX.prototype,"onPointerUp",null);class HP{get onPointerMove(){return this.factory.onPointerMove}get onPointerUp(){return this.factory.onPointerUp}constructor(e){this.factory=e}dispose(){}}xS([Mo],HP.prototype,"onPointerMove",null);xS([Mo],HP.prototype,"onPointerUp",null);const cae="pointer-events-disabled";class fs extends _e{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===0),this.el.classList.toggle("minimum",e===1),this.el.classList.toggle("maximum",e===2),this._state=e,this.onDidEnablementChange.fire(e))}set orthogonalStartSash(e){if(this._orthogonalStartSash!==e){if(this.orthogonalStartDragHandleDisposables.clear(),this.orthogonalStartSashDisposables.clear(),e){const t=n=>{this.orthogonalStartDragHandleDisposables.clear(),n!==0&&(this._orthogonalStartDragHandle=Ae(this.el,He(".orthogonal-drag-handle.start")),this.orthogonalStartDragHandleDisposables.add(zt(()=>this._orthogonalStartDragHandle.remove())),this.orthogonalStartDragHandleDisposables.add(new xn(this._orthogonalStartDragHandle,"mouseenter")).event(()=>fs.onMouseEnter(e),void 0,this.orthogonalStartDragHandleDisposables),this.orthogonalStartDragHandleDisposables.add(new xn(this._orthogonalStartDragHandle,"mouseleave")).event(()=>fs.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=n=>{this.orthogonalEndDragHandleDisposables.clear(),n!==0&&(this._orthogonalEndDragHandle=Ae(this.el,He(".orthogonal-drag-handle.end")),this.orthogonalEndDragHandleDisposables.add(zt(()=>this._orthogonalEndDragHandle.remove())),this.orthogonalEndDragHandleDisposables.add(new xn(this._orthogonalEndDragHandle,"mouseenter")).event(()=>fs.onMouseEnter(e),void 0,this.orthogonalEndDragHandleDisposables),this.orthogonalEndDragHandleDisposables.add(new xn(this._orthogonalEndDragHandle,"mouseleave")).event(()=>fs.onMouseLeave(e),void 0,this.orthogonalEndDragHandleDisposables))};this.orthogonalEndSashDisposables.add(e.onDidEnablementChange.event(t,this)),t(e.state)}this._orthogonalEndSash=e}}constructor(e,t,n){super(),this.hoverDelay=hht,this.hoverDelayer=this._register(new Bu(this.hoverDelay)),this._state=3,this.onDidEnablementChange=this._register(new le),this._onDidStart=this._register(new le),this._onDidChange=this._register(new le),this._onDidReset=this._register(new le),this._onDidEnd=this._register(new le),this.orthogonalStartSashDisposables=this._register(new Be),this.orthogonalStartDragHandleDisposables=this._register(new Be),this.orthogonalEndSashDisposables=this._register(new Be),this.orthogonalEndDragHandleDisposables=this._register(new Be),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=Ae(e,He(".monaco-sash")),n.orthogonalEdge&&this.el.classList.add(`orthogonal-edge-${n.orthogonalEdge}`),Nn&&this.el.classList.add("mac");const o=this._register(new xn(this.el,"mousedown")).event;this._register(o(d=>this.onPointerStart(d,new dX),this));const r=this._register(new xn(this.el,"dblclick")).event;this._register(r(this.onPointerDoublePress,this));const s=this._register(new xn(this.el,"mouseenter")).event;this._register(s(()=>fs.onMouseEnter(this)));const a=this._register(new xn(this.el,"mouseleave")).event;this._register(a(()=>fs.onMouseLeave(this))),this._register(Ei.addTarget(this.el));const l=this._register(new xn(this.el,Di.Start)).event;this._register(l(d=>this.onPointerStart(d,new hX(this.el)),this));const c=this._register(new xn(this.el,Di.Tap)).event;let u;this._register(c(d=>{if(u){clearTimeout(u),u=void 0,this.onPointerDoublePress(d);return}clearTimeout(u),u=setTimeout(()=>u=void 0,250)},this)),typeof n.size=="number"?(this.size=n.size,n.orientation===0?this.el.style.width=`${this.size}px`:this.el.style.height=`${this.size}px`):(this.size=uht,this._register(dht.event(d=>{this.size=d,this.layout()}))),this._register(fht.event(d=>this.hoverDelay=d)),this.layoutProvider=t,this.orthogonalStartSash=n.orthogonalStartSash,this.orthogonalEndSash=n.orthogonalEndSash,this.orientation=n.orientation||0,this.orientation===1?(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",cht),this.layout()}onPointerStart(e,t){dn.stop(e);let n=!1;if(!e.__orthogonalSashEvent){const g=this.getOrthogonalSash(e);g&&(n=!0,e.__orthogonalSashEvent=!0,g.onPointerStart(e,new HP(t)))}if(this.linkedSash&&!e.__linkedSashEvent&&(e.__linkedSashEvent=!0,this.linkedSash.onPointerStart(e,new HP(t))),!this.state)return;const o=document.getElementsByTagName("iframe");for(const g of o)g.classList.add(cae);const r=e.pageX,s=e.pageY,a=e.altKey,l={startX:r,currentX:r,startY:s,currentY:s,altKey:a};this.el.classList.add("active"),this._onDidStart.fire(l);const c=Bc(this.el),u=()=>{let g="";n?g="all-scroll":this.orientation===1?this.state===1?g="s-resize":this.state===2?g="n-resize":g=Nn?"row-resize":"ns-resize":this.state===1?g="e-resize":this.state===2?g="w-resize":g=Nn?"col-resize":"ew-resize",c.textContent=`* { cursor: ${g} !important; }`},d=new Be;u(),n||this.onDidEnablementChange.event(u,null,d);const h=g=>{dn.stop(g,!1);const p={startX:r,currentX:g.pageX,startY:s,currentY:g.pageY,altKey:a};this._onDidChange.fire(p)},f=g=>{dn.stop(g,!1),this.el.removeChild(c),this.el.classList.remove("active"),this._onDidEnd.fire(),d.dispose();for(const p of o)p.classList.remove(cae)};t.onPointerMove(h,null,d),t.onPointerUp(f,null,d),d.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&&fs.onMouseEnter(e.linkedSash,!0)}static onMouseLeave(e,t=!1){e.hoverDelayer.cancel(),e.el.classList.remove("hover"),!t&&e.linkedSash&&fs.onMouseLeave(e.linkedSash,!0)}clearSashHoverState(){fs.onMouseLeave(this)}layout(){if(this.orientation===0){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){var t;const n=(t=e.initialTarget)!==null&&t!==void 0?t:e.target;if(!(!n||!(n instanceof HTMLElement))&&n.classList.contains("orthogonal-drag-handle"))return n.classList.contains("start")?this.orthogonalStartSash:this.orthogonalEndSash}dispose(){super.dispose(),this.el.remove()}}const ght={separatorBorder:ve.transparent};class U1e{set size(e){this._size=e}get size(){return this._size}get visible(){return typeof this._cachedVisibleSize=="undefined"}setVisible(e,t){var n,o;e!==this.visible&&(e?(this.size=Za(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),(o=(n=this.view).setVisible)===null||o===void 0||o.call(n,e))}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(){var e;return(e=this.view.proportionalLayout)!==null&&e!==void 0?e:!0}get snap(){return!!this.view.snap}set enabled(e){this.container.style.pointerEvents=e?"":"none"}constructor(e,t,n,o){this.container=e,this.view=t,this.disposable=o,this._cachedVisibleSize=void 0,typeof n=="number"?(this._size=n,this._cachedVisibleSize=void 0,e.classList.add("visible")):(this._size=0,this._cachedVisibleSize=n.cachedVisibleSize)}layout(e,t){this.layoutContainer(e),this.view.layout(this.size,e,t)}dispose(){this.disposable.dispose()}}class pht extends U1e{layoutContainer(e){this.container.style.top=`${e}px`,this.container.style.height=`${this.size}px`}}class mht extends U1e{layoutContainer(e){this.container.style.left=`${e}px`,this.container.style.width=`${this.size}px`}}var lg;(function(i){i[i.Idle=0]="Idle",i[i.Busy=1]="Busy"})(lg||(lg={}));var $P;(function(i){i.Distribute={type:"distribute"};function e(o){return{type:"split",index:o}}i.Split=e;function t(o){return{type:"auto",index:o}}i.Auto=t;function n(o){return{type:"invisible",cachedVisibleSize:o}}i.Invisible=n})($P||($P={}));class j1e extends _e{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}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={}){var n,o,r,s,a;super(),this.size=0,this.contentSize=0,this.proportions=void 0,this.viewItems=[],this.sashItems=[],this.state=lg.Idle,this._onDidSashChange=this._register(new le),this._onDidSashReset=this._register(new le),this._startSnappingEnabled=!0,this._endSnappingEnabled=!0,this.onDidSashChange=this._onDidSashChange.event,this.onDidSashReset=this._onDidSashReset.event,this.orientation=(n=t.orientation)!==null&&n!==void 0?n:0,this.inverseAltBehavior=(o=t.inverseAltBehavior)!==null&&o!==void 0?o:!1,this.proportionalLayout=(r=t.proportionalLayout)!==null&&r!==void 0?r:!0,this.getSashOrthogonalSize=t.getSashOrthogonalSize,this.el=document.createElement("div"),this.el.classList.add("monaco-split-view2"),this.el.classList.add(this.orientation===0?"vertical":"horizontal"),e.appendChild(this.el),this.sashContainer=Ae(this.el,He(".sash-container")),this.viewContainer=He(".split-view-container"),this.scrollable=this._register(new qI({forceIntegerValues:!0,smoothScrollDuration:125,scheduleAtNextAnimationFrame:Fc})),this.scrollableElement=this._register(new xG(this.viewContainer,{vertical:this.orientation===0?(s=t.scrollbarVisibility)!==null&&s!==void 0?s:1:2,horizontal:this.orientation===1?(a=t.scrollbarVisibility)!==null&&a!==void 0?a:1:2},this.scrollable));const l=this._register(new xn(this.viewContainer,"scroll")).event;this._register(l(c=>{const u=this.scrollableElement.getScrollPosition(),d=Math.abs(this.viewContainer.scrollLeft-u.scrollLeft)<=1?void 0:this.viewContainer.scrollLeft,h=Math.abs(this.viewContainer.scrollTop-u.scrollTop)<=1?void 0:this.viewContainer.scrollTop;(d!==void 0||h!==void 0)&&this.scrollableElement.setScrollPosition({scrollLeft:d,scrollTop:h})})),this.onDidScroll=this.scrollableElement.onScroll,this._register(this.onDidScroll(c=>{c.scrollTopChanged&&(this.viewContainer.scrollTop=c.scrollTop),c.scrollLeftChanged&&(this.viewContainer.scrollLeft=c.scrollLeft)})),Ae(this.el,this.scrollableElement.getDomNode()),this.style(t.styles||ght),t.descriptor&&(this.size=t.descriptor.size,t.descriptor.views.forEach((c,u)=>{const d=nl(c.visible)||c.visible?c.size:{type:"invisible",cachedVisibleSize:c.size},h=c.view;this.doAddView(h,d,u,!0)}),this.contentSize=this.viewItems.reduce((c,u)=>c+u.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,n=this.viewItems.length,o){this.doAddView(e,t,n,o)}layout(e,t){const n=Math.max(this.size,this.contentSize);if(this.size=e,this.layoutContext=t,this.proportions){let o=0;for(let r=0;rthis.viewItems[a].priority===1),s=o.filter(a=>this.viewItems[a].priority===2);this.resize(this.viewItems.length-1,e-n,void 0,r,s)}this.distributeEmptySpace(),this.layoutViews()}saveProportions(){this.proportionalLayout&&this.contentSize>0&&(this.proportions=this.viewItems.map(e=>e.proportionalLayout?e.size/this.contentSize:void 0))}onSashStart({sash:e,start:t,alt:n}){for(const a of this.viewItems)a.enabled=!1;const o=this.sashItems.findIndex(a=>a.sash===e),r=Iu(ke(document.body,"keydown",a=>s(this.sashDragState.current,a.altKey)),ke(document.body,"keyup",()=>s(this.sashDragState.current,!1))),s=(a,l)=>{const c=this.viewItems.map(g=>g.size);let u=Number.NEGATIVE_INFINITY,d=Number.POSITIVE_INFINITY;if(this.inverseAltBehavior&&(l=!l),l)if(o===this.sashItems.length-1){const p=this.viewItems[o];u=(p.minimumSize-p.size)/2,d=(p.maximumSize-p.size)/2}else{const p=this.viewItems[o+1];u=(p.size-p.maximumSize)/2,d=(p.size-p.minimumSize)/2}let h,f;if(!l){const g=Gs(o,-1),p=Gs(o+1,this.viewItems.length),v=g.reduce((I,k)=>I+(this.viewItems[k].minimumSize-c[k]),0),m=g.reduce((I,k)=>I+(this.viewItems[k].viewMaximumSize-c[k]),0),_=p.length===0?Number.POSITIVE_INFINITY:p.reduce((I,k)=>I+(c[k]-this.viewItems[k].minimumSize),0),w=p.length===0?Number.NEGATIVE_INFINITY:p.reduce((I,k)=>I+(c[k]-this.viewItems[k].viewMaximumSize),0),y=Math.max(v,w),L=Math.min(_,m),D=this.findFirstSnapIndex(g),E=this.findFirstSnapIndex(p);if(typeof D=="number"){const I=this.viewItems[D],k=Math.floor(I.viewMinimumSize/2);h={index:D,limitDelta:I.visible?y-k:y+k,size:I.size}}if(typeof E=="number"){const I=this.viewItems[E],k=Math.floor(I.viewMinimumSize/2);f={index:E,limitDelta:I.visible?L+k:L-k,size:I.size}}}this.sashDragState={start:a,current:a,index:o,sizes:c,minDelta:u,maxDelta:d,alt:l,snapBefore:h,snapAfter:f,disposable:r}};s(t,n)}onSashChange({current:e}){const{index:t,start:n,sizes:o,alt:r,minDelta:s,maxDelta:a,snapBefore:l,snapAfter:c}=this.sashDragState;this.sashDragState.current=e;const u=e-n,d=this.resize(t,u,o,void 0,void 0,s,a,l,c);if(r){const h=t===this.sashItems.length-1,f=this.viewItems.map(w=>w.size),g=h?t:t+1,p=this.viewItems[g],v=p.size-p.maximumSize,m=p.size-p.minimumSize,_=h?t-1:t+1;this.resize(_,-d,f,void 0,void 0,v,m)}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 n=this.viewItems.indexOf(e);n<0||n>=this.viewItems.length||(t=typeof t=="number"?t:e.size,t=Za(t,e.minimumSize,e.maximumSize),this.inverseAltBehavior&&n>0?(this.resize(n-1,Math.floor((e.size-t)/2)),this.distributeEmptySpace(),this.layoutViews()):(e.size=t,this.relayout([n],void 0)))}resizeView(e,t){if(this.state!==lg.Idle)throw new Error("Cant modify splitview");if(this.state=lg.Busy,e<0||e>=this.viewItems.length)return;const n=Gs(this.viewItems.length).filter(a=>a!==e),o=[...n.filter(a=>this.viewItems[a].priority===1),e],r=n.filter(a=>this.viewItems[a].priority===2),s=this.viewItems[e];t=Math.round(t),t=Za(t,s.minimumSize,Math.min(s.maximumSize,this.size)),s.size=t,this.relayout(o,r),this.state=lg.Idle}distributeViewSizes(){const e=[];let t=0;for(const a of this.viewItems)a.maximumSize-a.minimumSize>0&&(e.push(a),t+=a.size);const n=Math.floor(t/e.length);for(const a of e)a.size=Za(n,a.minimumSize,a.maximumSize);const o=Gs(this.viewItems.length),r=o.filter(a=>this.viewItems[a].priority===1),s=o.filter(a=>this.viewItems[a].priority===2);this.relayout(r,s)}getViewSize(e){return e<0||e>=this.viewItems.length?-1:this.viewItems[e].size}doAddView(e,t,n=this.viewItems.length,o){if(this.state!==lg.Idle)throw new Error("Cant modify splitview");this.state=lg.Busy;const r=He(".split-view-view");n===this.viewItems.length?this.viewContainer.appendChild(r):this.viewContainer.insertBefore(r,this.viewContainer.children.item(n));const s=e.onDidChange(h=>this.onViewChange(u,h)),a=zt(()=>this.viewContainer.removeChild(r)),l=Iu(s,a);let c;typeof t=="number"?c=t:(t.type==="auto"&&(this.areViewsDistributed()?t={type:"distribute"}:t={type:"split",index:t.index}),t.type==="split"?c=this.getViewSize(t.index)/2:t.type==="invisible"?c={cachedVisibleSize:t.cachedVisibleSize}:c=e.minimumSize);const u=this.orientation===0?new pht(r,e,c,l):new mht(r,e,c,l);if(this.viewItems.splice(n,0,u),this.viewItems.length>1){const h={orthogonalStartSash:this.orthogonalStartSash,orthogonalEndSash:this.orthogonalEndSash},f=this.orientation===0?new fs(this.sashContainer,{getHorizontalSashTop:I=>this.getSashPosition(I),getHorizontalSashWidth:this.getSashOrthogonalSize},Object.assign(Object.assign({},h),{orientation:1})):new fs(this.sashContainer,{getVerticalSashLeft:I=>this.getSashPosition(I),getVerticalSashHeight:this.getSashOrthogonalSize},Object.assign(Object.assign({},h),{orientation:0})),g=this.orientation===0?I=>({sash:f,start:I.startY,current:I.currentY,alt:I.altKey}):I=>({sash:f,start:I.startX,current:I.currentX,alt:I.altKey}),v=st.map(f.onDidStart,g)(this.onSashStart,this),_=st.map(f.onDidChange,g)(this.onSashChange,this),y=st.map(f.onDidEnd,()=>this.sashItems.findIndex(I=>I.sash===f))(this.onSashEnd,this),L=f.onDidReset(()=>{const I=this.sashItems.findIndex(N=>N.sash===f),k=Gs(I,-1),R=Gs(I+1,this.viewItems.length),A=this.findFirstSnapIndex(k),P=this.findFirstSnapIndex(R);typeof A=="number"&&!this.viewItems[A].visible||typeof P=="number"&&!this.viewItems[P].visible||this._onDidSashReset.fire(I)}),D=Iu(v,_,y,L,f),E={sash:f,disposable:D};this.sashItems.splice(n-1,0,E)}r.appendChild(e.element);let d;typeof t!="number"&&t.type==="split"&&(d=[t.index]),o||this.relayout([n],d),this.state=lg.Idle,!o&&typeof t!="number"&&t.type==="distribute"&&this.distributeViewSizes()}relayout(e,t){const n=this.viewItems.reduce((o,r)=>o+r.size,0);this.resize(this.viewItems.length-1,this.size-n,void 0,e,t),this.distributeEmptySpace(),this.layoutViews(),this.saveProportions()}resize(e,t,n=this.viewItems.map(u=>u.size),o,r,s=Number.NEGATIVE_INFINITY,a=Number.POSITIVE_INFINITY,l,c){if(e<0||e>=this.viewItems.length)return 0;const u=Gs(e,-1),d=Gs(e+1,this.viewItems.length);if(r)for(const E of r)E6(u,E),E6(d,E);if(o)for(const E of o)XN(u,E),XN(d,E);const h=u.map(E=>this.viewItems[E]),f=u.map(E=>n[E]),g=d.map(E=>this.viewItems[E]),p=d.map(E=>n[E]),v=u.reduce((E,I)=>E+(this.viewItems[I].minimumSize-n[I]),0),m=u.reduce((E,I)=>E+(this.viewItems[I].maximumSize-n[I]),0),_=d.length===0?Number.POSITIVE_INFINITY:d.reduce((E,I)=>E+(n[I]-this.viewItems[I].minimumSize),0),w=d.length===0?Number.NEGATIVE_INFINITY:d.reduce((E,I)=>E+(n[I]-this.viewItems[I].maximumSize),0),y=Math.max(v,w,s),L=Math.min(_,m,a);let D=!1;if(l){const E=this.viewItems[l.index],I=t>=l.limitDelta;D=I!==E.visible,E.setVisible(I,l.size)}if(!D&&c){const E=this.viewItems[c.index],I=ta+l.size,0);let n=this.size-t;const o=Gs(this.viewItems.length-1,-1),r=o.filter(a=>this.viewItems[a].priority===1),s=o.filter(a=>this.viewItems[a].priority===2);for(const a of s)E6(o,a);for(const a of r)XN(o,a);typeof e=="number"&&XN(o,e);for(let a=0;n!==0&&at+n.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===0?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(l=>e=l.size-l.minimumSize>0||e);e=!1;const n=this.viewItems.map(l=>e=l.maximumSize-l.size>0||e),o=[...this.viewItems].reverse();e=!1;const r=o.map(l=>e=l.size-l.minimumSize>0||e).reverse();e=!1;const s=o.map(l=>e=l.maximumSize-l.size>0||e).reverse();let a=0;for(let l=0;l0||this.startSnappingEnabled)?c.state=1:_&&t[l]&&(a0)return;if(!n.visible&&n.snap)return t}}areViewsDistributed(){let e,t;for(const n of this.viewItems)if(e=e===void 0?n.size:Math.min(e,n.size),t=t===void 0?n.size:Math.max(t,n.size),t-e>2)return!1;return!0}dispose(){var e;(e=this.sashDragState)===null||e===void 0||e.disposable.dispose(),si(this.viewItems),this.viewItems=[],this.sashItems.forEach(t=>t.disposable.dispose()),this.sashItems=[],super.dispose()}}class iT{constructor(e,t,n){this.columns=e,this.getColumnSize=n,this.templateId=iT.TemplateId,this.renderedTemplates=new Set;const o=new Map(t.map(r=>[r.templateId,r]));this.renderers=[];for(const r of e){const s=o.get(r.templateId);if(!s)throw new Error(`Table cell renderer for template id ${r.templateId} not found.`);this.renderers.push(s)}}renderTemplate(e){const t=Ae(e,He(".monaco-table-tr")),n=[],o=[];for(let s=0;snew _ht(u,d)),l={size:a.reduce((u,d)=>u+d.column.weight,0),views:a.map(u=>({size:u.column.weight,view:u}))};this.splitview=this.disposables.add(new j1e(this.domNode,{orientation:1,scrollbarVisibility:2,getSashOrthogonalSize:()=>this.cachedHeight,descriptor:l})),this.splitview.el.style.height=`${n.headerRowHeight}px`,this.splitview.el.style.lineHeight=`${n.headerRowHeight}px`;const c=new iT(o,r,u=>this.splitview.getViewSize(u));this.list=this.disposables.add(new Ku(e,this.domNode,vht(n),[c],s)),st.any(...a.map(u=>u.onDidLayout))(([u,d])=>c.layoutColumn(u,d),null,this.disposables),this.splitview.onDidSashReset(u=>{const d=o.reduce((f,g)=>f+g.weight,0),h=o[u].weight/d*this.cachedWidth;this.splitview.resizeView(u,h)},null,this.disposables),this.styleElement=Bc(this.domNode),this.style(wdt)}updateOptions(e){this.list.updateOptions(e)}splice(e,t,n=[]){this.list.splice(e,t,n)}getHTMLElement(){return this.domNode}style(e){const t=[];t.push(`.monaco-table.${this.domId} > .monaco-split-view2 .monaco-sash.vertical::before { +`}_shouldRestoreUndoStack(){const e=this._configurationService.getValue("files.restoreUndoStack");return typeof e=="boolean"?e:!0}getCreationOptions(e,t,n){const o=typeof e=="string"?e:e.languageId;let r=this._modelCreationOptionsByLanguageAndResource[o+t];if(!r){const s=this._configurationService.getValue("editor",{overrideIdentifier:o,resource:t}),a=this._getEOL(t,o);r=uC._readModelOptions({editor:s,eol:a},n),this._modelCreationOptionsByLanguageAndResource[o+t]=r}return r}_updateModelOptions(e){const t=this._modelCreationOptionsByLanguageAndResource;this._modelCreationOptionsByLanguageAndResource=Object.create(null);const n=Object.keys(this._models);for(let o=0,r=n.length;oe){const t=[];for(this._disposedModels.forEach(n=>{n.sharesUndoRedoStack||t.push(n)}),t.sort((n,o)=>n.time-o.time);t.length>0&&this._disposedModelsHeapSize>e;){const n=t.shift();this._removeDisposedModel(n.uri),n.initialUndoRedoSnapshot!==null&&this._undoRedoService.restoreSnapshot(n.initialUndoRedoSnapshot)}}}_createModelData(e,t,n,o){const r=this.getCreationOptions(t,n,o),s=new bf(e,t,r,n,this._undoRedoService,this._languageService,this._languageConfigurationService);if(n&&this._disposedModels.has(b_(n))){const c=this._removeDisposedModel(n),u=this._undoRedoService.getElements(n),d=this._getSHA1Computer(),h=d.canComputeSHA1(s)?d.computeSHA1(s)===c.sha1:!1;if(h||c.sharesUndoRedoStack){for(const f of u.past)pg(f)&&f.matchesResource(n)&&f.setModel(s);for(const f of u.future)pg(f)&&f.matchesResource(n)&&f.setModel(s);this._undoRedoService.setElementsValidFlag(n,!0,f=>pg(f)&&f.matchesResource(n)),h&&(s._overwriteVersionId(c.versionId),s._overwriteAlternativeVersionId(c.alternativeVersionId),s._overwriteInitialUndoRedoSnapshot(c.initialUndoRedoSnapshot))}else c.initialUndoRedoSnapshot!==null&&this._undoRedoService.restoreSnapshot(c.initialUndoRedoSnapshot)}const a=b_(s.uri);if(this._models[a])throw new Error("ModelService: Cannot add model because it already exists!");const l=new lht(s,c=>this._onWillDispose(c),(c,u)=>this._onDidChangeLanguage(c,u));return this._models[a]=l,l}createModel(e,t,n,o=!1){let r;return t?r=this._createModelData(e,t,n,o):r=this._createModelData(e,Gl,n,o),this._onModelAdded.fire(r.model),r.model}getModels(){const e=[],t=Object.keys(this._models);for(let n=0,o=t.length;n0||c.future.length>0){for(const u of c.past)pg(u)&&u.matchesResource(e.uri)&&(r=!0,s+=u.heapSize(e.uri),u.setModel(e.uri));for(const u of c.future)pg(u)&&u.matchesResource(e.uri)&&(r=!0,s+=u.heapSize(e.uri),u.setModel(e.uri))}}const a=uC.MAX_MEMORY_FOR_CLOSED_FILES_UNDO_STACK,l=this._getSHA1Computer();if(r)if(!o&&(s>a||!l.canComputeSHA1(e))){const c=n.model.getInitialUndoRedoSnapshot();c!==null&&this._undoRedoService.restoreSnapshot(c)}else this._ensureDisposedModelsHeapSize(a-s),this._undoRedoService.setElementsValidFlag(e.uri,!1,c=>pg(c)&&c.matchesResource(e.uri)),this._insertDisposedModel(new uht(e.uri,n.model.getInitialUndoRedoSnapshot(),Date.now(),o,s,l.computeSHA1(e),e.getVersionId(),e.getAlternativeVersionId()));else if(!o){const c=n.model.getInitialUndoRedoSnapshot();c!==null&&this._undoRedoService.restoreSnapshot(c)}delete this._models[t],n.dispose(),delete this._modelCreationOptionsByLanguageAndResource[e.getLanguageId()+e.uri],this._onModelRemoved.fire(e)}_onDidChangeLanguage(e,t){const n=t.oldLanguage,o=e.getLanguageId(),r=this.getCreationOptions(n,e.uri,e.isForSimpleWidget),s=this.getCreationOptions(o,e.uri,e.isForSimpleWidget);uC._setModelOptionsForModel(e,s,r),this._onModelModeChanged.fire({model:e,oldLanguageId:n})}_getSHA1Computer(){return new O5}};$P.MAX_MEMORY_FOR_CLOSED_FILES_UNDO_STACK=20*1024*1024;$P=uC=aht([zx(0,En),zx(1,q0e),zx(2,x5),zx(3,Ki),zx(4,Ti)],$P);class O5{canComputeSHA1(e){return e.getValueLength()<=O5.MAX_MODEL_SIZE}computeSHA1(e){const t=new u5,n=e.createSnapshot();let o;for(;o=n.read();)t.update(o);return t.digest()}}O5.MAX_MODEL_SIZE=10*1024*1024;class dht{get templateId(){return this.renderer.templateId}constructor(e,t){this.renderer=e,this.modelProvider=t}renderTemplate(e){return{data:this.renderer.renderTemplate(e),disposable:_e.None}}renderElement(e,t,n,o){var r;if((r=n.disposable)===null||r===void 0||r.dispose(),!n.data)return;const s=this.modelProvider();if(s.isResolved(e))return this.renderer.renderElement(s.get(e),e,n.data,o);const a=new Ro,l=s.resolve(e,a.token);n.disposable={dispose:()=>a.cancel()},this.renderer.renderPlaceholder(e,n.data),l.then(c=>this.renderer.renderElement(c,e,n.data,o))}disposeTemplate(e){e.disposable&&(e.disposable.dispose(),e.disposable=void 0),e.data&&(this.renderer.disposeTemplate(e.data),e.data=void 0)}}class hht{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 fht(i,e){return Object.assign(Object.assign({},e),{accessibilityProvider:e.accessibilityProvider&&new hht(i,e.accessibilityProvider)})}class ght{constructor(e,t,n,o,r={}){const s=()=>this.model,a=o.map(l=>new dht(l,s));this.list=new qu(e,t,n,a,fht(s,r))}updateOptions(e){this.list.updateOptions(e)}getHTMLElement(){return this.list.getHTMLElement()}get onDidFocus(){return this.list.onDidFocus}get widget(){return this.list}get onDidDispose(){return this.list.onDidDispose}get onMouseDblClick(){return st.map(this.list.onMouseDblClick,({element:e,index:t,browserEvent:n})=>({element:e===void 0?void 0:this._model.get(e),index:t,browserEvent:n}))}get onPointer(){return st.map(this.list.onPointer,({element:e,index:t,browserEvent:n})=>({element:e===void 0?void 0:this._model.get(e),index:t,browserEvent:n}))}get onDidChangeSelection(){return st.map(this.list.onDidChangeSelection,({elements:e,indexes:t,browserEvent:n})=>({elements:e.map(o=>this._model.get(o)),indexes:t,browserEvent:n}))}get model(){return this._model}set model(e){this._model=e,this.list.splice(0,this.list.length,Gs(e.length))}getFocus(){return this.list.getFocus()}getSelection(){return this.list.getSelection()}getSelectedElements(){return this.getSelection().map(e=>this.model.get(e))}style(e){this.list.style(e)}dispose(){this.list.dispose()}}var LS=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r};const pht=!1;var zP;(function(i){i.North="north",i.South="south",i.East="east",i.West="west"})(zP||(zP={}));let mht=4;const vht=new le;let _ht=300;const bht=new le;class _X{constructor(){this.disposables=new Be}get onPointerMove(){return this.disposables.add(new xn(window,"mousemove")).event}get onPointerUp(){return this.disposables.add(new xn(window,"mouseup")).event}dispose(){this.disposables.dispose()}}LS([Mo],_X.prototype,"onPointerMove",null);LS([Mo],_X.prototype,"onPointerUp",null);class bX{get onPointerMove(){return this.disposables.add(new xn(this.el,Di.Change)).event}get onPointerUp(){return this.disposables.add(new xn(this.el,Di.End)).event}constructor(e){this.el=e,this.disposables=new Be}dispose(){this.disposables.dispose()}}LS([Mo],bX.prototype,"onPointerMove",null);LS([Mo],bX.prototype,"onPointerUp",null);class UP{get onPointerMove(){return this.factory.onPointerMove}get onPointerUp(){return this.factory.onPointerUp}constructor(e){this.factory=e}dispose(){}}LS([Mo],UP.prototype,"onPointerMove",null);LS([Mo],UP.prototype,"onPointerUp",null);const vae="pointer-events-disabled";class gs extends _e{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===0),this.el.classList.toggle("minimum",e===1),this.el.classList.toggle("maximum",e===2),this._state=e,this.onDidEnablementChange.fire(e))}set orthogonalStartSash(e){if(this._orthogonalStartSash!==e){if(this.orthogonalStartDragHandleDisposables.clear(),this.orthogonalStartSashDisposables.clear(),e){const t=n=>{this.orthogonalStartDragHandleDisposables.clear(),n!==0&&(this._orthogonalStartDragHandle=Ae(this.el,He(".orthogonal-drag-handle.start")),this.orthogonalStartDragHandleDisposables.add(zt(()=>this._orthogonalStartDragHandle.remove())),this.orthogonalStartDragHandleDisposables.add(new xn(this._orthogonalStartDragHandle,"mouseenter")).event(()=>gs.onMouseEnter(e),void 0,this.orthogonalStartDragHandleDisposables),this.orthogonalStartDragHandleDisposables.add(new xn(this._orthogonalStartDragHandle,"mouseleave")).event(()=>gs.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=n=>{this.orthogonalEndDragHandleDisposables.clear(),n!==0&&(this._orthogonalEndDragHandle=Ae(this.el,He(".orthogonal-drag-handle.end")),this.orthogonalEndDragHandleDisposables.add(zt(()=>this._orthogonalEndDragHandle.remove())),this.orthogonalEndDragHandleDisposables.add(new xn(this._orthogonalEndDragHandle,"mouseenter")).event(()=>gs.onMouseEnter(e),void 0,this.orthogonalEndDragHandleDisposables),this.orthogonalEndDragHandleDisposables.add(new xn(this._orthogonalEndDragHandle,"mouseleave")).event(()=>gs.onMouseLeave(e),void 0,this.orthogonalEndDragHandleDisposables))};this.orthogonalEndSashDisposables.add(e.onDidEnablementChange.event(t,this)),t(e.state)}this._orthogonalEndSash=e}}constructor(e,t,n){super(),this.hoverDelay=_ht,this.hoverDelayer=this._register(new Wu(this.hoverDelay)),this._state=3,this.onDidEnablementChange=this._register(new le),this._onDidStart=this._register(new le),this._onDidChange=this._register(new le),this._onDidReset=this._register(new le),this._onDidEnd=this._register(new le),this.orthogonalStartSashDisposables=this._register(new Be),this.orthogonalStartDragHandleDisposables=this._register(new Be),this.orthogonalEndSashDisposables=this._register(new Be),this.orthogonalEndDragHandleDisposables=this._register(new Be),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=Ae(e,He(".monaco-sash")),n.orthogonalEdge&&this.el.classList.add(`orthogonal-edge-${n.orthogonalEdge}`),Nn&&this.el.classList.add("mac");const o=this._register(new xn(this.el,"mousedown")).event;this._register(o(d=>this.onPointerStart(d,new _X),this));const r=this._register(new xn(this.el,"dblclick")).event;this._register(r(this.onPointerDoublePress,this));const s=this._register(new xn(this.el,"mouseenter")).event;this._register(s(()=>gs.onMouseEnter(this)));const a=this._register(new xn(this.el,"mouseleave")).event;this._register(a(()=>gs.onMouseLeave(this))),this._register(Ei.addTarget(this.el));const l=this._register(new xn(this.el,Di.Start)).event;this._register(l(d=>this.onPointerStart(d,new bX(this.el)),this));const c=this._register(new xn(this.el,Di.Tap)).event;let u;this._register(c(d=>{if(u){clearTimeout(u),u=void 0,this.onPointerDoublePress(d);return}clearTimeout(u),u=setTimeout(()=>u=void 0,250)},this)),typeof n.size=="number"?(this.size=n.size,n.orientation===0?this.el.style.width=`${this.size}px`:this.el.style.height=`${this.size}px`):(this.size=mht,this._register(vht.event(d=>{this.size=d,this.layout()}))),this._register(bht.event(d=>this.hoverDelay=d)),this.layoutProvider=t,this.orthogonalStartSash=n.orthogonalStartSash,this.orthogonalEndSash=n.orthogonalEndSash,this.orientation=n.orientation||0,this.orientation===1?(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",pht),this.layout()}onPointerStart(e,t){dn.stop(e);let n=!1;if(!e.__orthogonalSashEvent){const g=this.getOrthogonalSash(e);g&&(n=!0,e.__orthogonalSashEvent=!0,g.onPointerStart(e,new UP(t)))}if(this.linkedSash&&!e.__linkedSashEvent&&(e.__linkedSashEvent=!0,this.linkedSash.onPointerStart(e,new UP(t))),!this.state)return;const o=document.getElementsByTagName("iframe");for(const g of o)g.classList.add(vae);const r=e.pageX,s=e.pageY,a=e.altKey,l={startX:r,currentX:r,startY:s,currentY:s,altKey:a};this.el.classList.add("active"),this._onDidStart.fire(l);const c=Wc(this.el),u=()=>{let g="";n?g="all-scroll":this.orientation===1?this.state===1?g="s-resize":this.state===2?g="n-resize":g=Nn?"row-resize":"ns-resize":this.state===1?g="e-resize":this.state===2?g="w-resize":g=Nn?"col-resize":"ew-resize",c.textContent=`* { cursor: ${g} !important; }`},d=new Be;u(),n||this.onDidEnablementChange.event(u,null,d);const h=g=>{dn.stop(g,!1);const p={startX:r,currentX:g.pageX,startY:s,currentY:g.pageY,altKey:a};this._onDidChange.fire(p)},f=g=>{dn.stop(g,!1),this.el.removeChild(c),this.el.classList.remove("active"),this._onDidEnd.fire(),d.dispose();for(const p of o)p.classList.remove(vae)};t.onPointerMove(h,null,d),t.onPointerUp(f,null,d),d.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&&gs.onMouseEnter(e.linkedSash,!0)}static onMouseLeave(e,t=!1){e.hoverDelayer.cancel(),e.el.classList.remove("hover"),!t&&e.linkedSash&&gs.onMouseLeave(e.linkedSash,!0)}clearSashHoverState(){gs.onMouseLeave(this)}layout(){if(this.orientation===0){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){var t;const n=(t=e.initialTarget)!==null&&t!==void 0?t:e.target;if(!(!n||!(n instanceof HTMLElement))&&n.classList.contains("orthogonal-drag-handle"))return n.classList.contains("start")?this.orthogonalStartSash:this.orthogonalEndSash}dispose(){super.dispose(),this.el.remove()}}const Cht={separatorBorder:ve.transparent};class Q1e{set size(e){this._size=e}get size(){return this._size}get visible(){return typeof this._cachedVisibleSize=="undefined"}setVisible(e,t){var n,o;e!==this.visible&&(e?(this.size=Za(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),(o=(n=this.view).setVisible)===null||o===void 0||o.call(n,e))}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(){var e;return(e=this.view.proportionalLayout)!==null&&e!==void 0?e:!0}get snap(){return!!this.view.snap}set enabled(e){this.container.style.pointerEvents=e?"":"none"}constructor(e,t,n,o){this.container=e,this.view=t,this.disposable=o,this._cachedVisibleSize=void 0,typeof n=="number"?(this._size=n,this._cachedVisibleSize=void 0,e.classList.add("visible")):(this._size=0,this._cachedVisibleSize=n.cachedVisibleSize)}layout(e,t){this.layoutContainer(e),this.view.layout(this.size,e,t)}dispose(){this.disposable.dispose()}}class yht extends Q1e{layoutContainer(e){this.container.style.top=`${e}px`,this.container.style.height=`${this.size}px`}}class wht extends Q1e{layoutContainer(e){this.container.style.left=`${e}px`,this.container.style.width=`${this.size}px`}}var cg;(function(i){i[i.Idle=0]="Idle",i[i.Busy=1]="Busy"})(cg||(cg={}));var jP;(function(i){i.Distribute={type:"distribute"};function e(o){return{type:"split",index:o}}i.Split=e;function t(o){return{type:"auto",index:o}}i.Auto=t;function n(o){return{type:"invisible",cachedVisibleSize:o}}i.Invisible=n})(jP||(jP={}));class J1e extends _e{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}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={}){var n,o,r,s,a;super(),this.size=0,this.contentSize=0,this.proportions=void 0,this.viewItems=[],this.sashItems=[],this.state=cg.Idle,this._onDidSashChange=this._register(new le),this._onDidSashReset=this._register(new le),this._startSnappingEnabled=!0,this._endSnappingEnabled=!0,this.onDidSashChange=this._onDidSashChange.event,this.onDidSashReset=this._onDidSashReset.event,this.orientation=(n=t.orientation)!==null&&n!==void 0?n:0,this.inverseAltBehavior=(o=t.inverseAltBehavior)!==null&&o!==void 0?o:!1,this.proportionalLayout=(r=t.proportionalLayout)!==null&&r!==void 0?r:!0,this.getSashOrthogonalSize=t.getSashOrthogonalSize,this.el=document.createElement("div"),this.el.classList.add("monaco-split-view2"),this.el.classList.add(this.orientation===0?"vertical":"horizontal"),e.appendChild(this.el),this.sashContainer=Ae(this.el,He(".sash-container")),this.viewContainer=He(".split-view-container"),this.scrollable=this._register(new XI({forceIntegerValues:!0,smoothScrollDuration:125,scheduleAtNextAnimationFrame:Bc})),this.scrollableElement=this._register(new NG(this.viewContainer,{vertical:this.orientation===0?(s=t.scrollbarVisibility)!==null&&s!==void 0?s:1:2,horizontal:this.orientation===1?(a=t.scrollbarVisibility)!==null&&a!==void 0?a:1:2},this.scrollable));const l=this._register(new xn(this.viewContainer,"scroll")).event;this._register(l(c=>{const u=this.scrollableElement.getScrollPosition(),d=Math.abs(this.viewContainer.scrollLeft-u.scrollLeft)<=1?void 0:this.viewContainer.scrollLeft,h=Math.abs(this.viewContainer.scrollTop-u.scrollTop)<=1?void 0:this.viewContainer.scrollTop;(d!==void 0||h!==void 0)&&this.scrollableElement.setScrollPosition({scrollLeft:d,scrollTop:h})})),this.onDidScroll=this.scrollableElement.onScroll,this._register(this.onDidScroll(c=>{c.scrollTopChanged&&(this.viewContainer.scrollTop=c.scrollTop),c.scrollLeftChanged&&(this.viewContainer.scrollLeft=c.scrollLeft)})),Ae(this.el,this.scrollableElement.getDomNode()),this.style(t.styles||Cht),t.descriptor&&(this.size=t.descriptor.size,t.descriptor.views.forEach((c,u)=>{const d=il(c.visible)||c.visible?c.size:{type:"invisible",cachedVisibleSize:c.size},h=c.view;this.doAddView(h,d,u,!0)}),this.contentSize=this.viewItems.reduce((c,u)=>c+u.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,n=this.viewItems.length,o){this.doAddView(e,t,n,o)}layout(e,t){const n=Math.max(this.size,this.contentSize);if(this.size=e,this.layoutContext=t,this.proportions){let o=0;for(let r=0;rthis.viewItems[a].priority===1),s=o.filter(a=>this.viewItems[a].priority===2);this.resize(this.viewItems.length-1,e-n,void 0,r,s)}this.distributeEmptySpace(),this.layoutViews()}saveProportions(){this.proportionalLayout&&this.contentSize>0&&(this.proportions=this.viewItems.map(e=>e.proportionalLayout?e.size/this.contentSize:void 0))}onSashStart({sash:e,start:t,alt:n}){for(const a of this.viewItems)a.enabled=!1;const o=this.sashItems.findIndex(a=>a.sash===e),r=Tu(ke(document.body,"keydown",a=>s(this.sashDragState.current,a.altKey)),ke(document.body,"keyup",()=>s(this.sashDragState.current,!1))),s=(a,l)=>{const c=this.viewItems.map(g=>g.size);let u=Number.NEGATIVE_INFINITY,d=Number.POSITIVE_INFINITY;if(this.inverseAltBehavior&&(l=!l),l)if(o===this.sashItems.length-1){const p=this.viewItems[o];u=(p.minimumSize-p.size)/2,d=(p.maximumSize-p.size)/2}else{const p=this.viewItems[o+1];u=(p.size-p.maximumSize)/2,d=(p.size-p.minimumSize)/2}let h,f;if(!l){const g=Gs(o,-1),p=Gs(o+1,this.viewItems.length),v=g.reduce((I,k)=>I+(this.viewItems[k].minimumSize-c[k]),0),m=g.reduce((I,k)=>I+(this.viewItems[k].viewMaximumSize-c[k]),0),_=p.length===0?Number.POSITIVE_INFINITY:p.reduce((I,k)=>I+(c[k]-this.viewItems[k].minimumSize),0),y=p.length===0?Number.NEGATIVE_INFINITY:p.reduce((I,k)=>I+(c[k]-this.viewItems[k].viewMaximumSize),0),w=Math.max(v,y),L=Math.min(_,m),D=this.findFirstSnapIndex(g),E=this.findFirstSnapIndex(p);if(typeof D=="number"){const I=this.viewItems[D],k=Math.floor(I.viewMinimumSize/2);h={index:D,limitDelta:I.visible?w-k:w+k,size:I.size}}if(typeof E=="number"){const I=this.viewItems[E],k=Math.floor(I.viewMinimumSize/2);f={index:E,limitDelta:I.visible?L+k:L-k,size:I.size}}}this.sashDragState={start:a,current:a,index:o,sizes:c,minDelta:u,maxDelta:d,alt:l,snapBefore:h,snapAfter:f,disposable:r}};s(t,n)}onSashChange({current:e}){const{index:t,start:n,sizes:o,alt:r,minDelta:s,maxDelta:a,snapBefore:l,snapAfter:c}=this.sashDragState;this.sashDragState.current=e;const u=e-n,d=this.resize(t,u,o,void 0,void 0,s,a,l,c);if(r){const h=t===this.sashItems.length-1,f=this.viewItems.map(y=>y.size),g=h?t:t+1,p=this.viewItems[g],v=p.size-p.maximumSize,m=p.size-p.minimumSize,_=h?t-1:t+1;this.resize(_,-d,f,void 0,void 0,v,m)}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 n=this.viewItems.indexOf(e);n<0||n>=this.viewItems.length||(t=typeof t=="number"?t:e.size,t=Za(t,e.minimumSize,e.maximumSize),this.inverseAltBehavior&&n>0?(this.resize(n-1,Math.floor((e.size-t)/2)),this.distributeEmptySpace(),this.layoutViews()):(e.size=t,this.relayout([n],void 0)))}resizeView(e,t){if(this.state!==cg.Idle)throw new Error("Cant modify splitview");if(this.state=cg.Busy,e<0||e>=this.viewItems.length)return;const n=Gs(this.viewItems.length).filter(a=>a!==e),o=[...n.filter(a=>this.viewItems[a].priority===1),e],r=n.filter(a=>this.viewItems[a].priority===2),s=this.viewItems[e];t=Math.round(t),t=Za(t,s.minimumSize,Math.min(s.maximumSize,this.size)),s.size=t,this.relayout(o,r),this.state=cg.Idle}distributeViewSizes(){const e=[];let t=0;for(const a of this.viewItems)a.maximumSize-a.minimumSize>0&&(e.push(a),t+=a.size);const n=Math.floor(t/e.length);for(const a of e)a.size=Za(n,a.minimumSize,a.maximumSize);const o=Gs(this.viewItems.length),r=o.filter(a=>this.viewItems[a].priority===1),s=o.filter(a=>this.viewItems[a].priority===2);this.relayout(r,s)}getViewSize(e){return e<0||e>=this.viewItems.length?-1:this.viewItems[e].size}doAddView(e,t,n=this.viewItems.length,o){if(this.state!==cg.Idle)throw new Error("Cant modify splitview");this.state=cg.Busy;const r=He(".split-view-view");n===this.viewItems.length?this.viewContainer.appendChild(r):this.viewContainer.insertBefore(r,this.viewContainer.children.item(n));const s=e.onDidChange(h=>this.onViewChange(u,h)),a=zt(()=>this.viewContainer.removeChild(r)),l=Tu(s,a);let c;typeof t=="number"?c=t:(t.type==="auto"&&(this.areViewsDistributed()?t={type:"distribute"}:t={type:"split",index:t.index}),t.type==="split"?c=this.getViewSize(t.index)/2:t.type==="invisible"?c={cachedVisibleSize:t.cachedVisibleSize}:c=e.minimumSize);const u=this.orientation===0?new yht(r,e,c,l):new wht(r,e,c,l);if(this.viewItems.splice(n,0,u),this.viewItems.length>1){const h={orthogonalStartSash:this.orthogonalStartSash,orthogonalEndSash:this.orthogonalEndSash},f=this.orientation===0?new gs(this.sashContainer,{getHorizontalSashTop:I=>this.getSashPosition(I),getHorizontalSashWidth:this.getSashOrthogonalSize},Object.assign(Object.assign({},h),{orientation:1})):new gs(this.sashContainer,{getVerticalSashLeft:I=>this.getSashPosition(I),getVerticalSashHeight:this.getSashOrthogonalSize},Object.assign(Object.assign({},h),{orientation:0})),g=this.orientation===0?I=>({sash:f,start:I.startY,current:I.currentY,alt:I.altKey}):I=>({sash:f,start:I.startX,current:I.currentX,alt:I.altKey}),v=st.map(f.onDidStart,g)(this.onSashStart,this),_=st.map(f.onDidChange,g)(this.onSashChange,this),w=st.map(f.onDidEnd,()=>this.sashItems.findIndex(I=>I.sash===f))(this.onSashEnd,this),L=f.onDidReset(()=>{const I=this.sashItems.findIndex(N=>N.sash===f),k=Gs(I,-1),R=Gs(I+1,this.viewItems.length),A=this.findFirstSnapIndex(k),P=this.findFirstSnapIndex(R);typeof A=="number"&&!this.viewItems[A].visible||typeof P=="number"&&!this.viewItems[P].visible||this._onDidSashReset.fire(I)}),D=Tu(v,_,w,L,f),E={sash:f,disposable:D};this.sashItems.splice(n-1,0,E)}r.appendChild(e.element);let d;typeof t!="number"&&t.type==="split"&&(d=[t.index]),o||this.relayout([n],d),this.state=cg.Idle,!o&&typeof t!="number"&&t.type==="distribute"&&this.distributeViewSizes()}relayout(e,t){const n=this.viewItems.reduce((o,r)=>o+r.size,0);this.resize(this.viewItems.length-1,this.size-n,void 0,e,t),this.distributeEmptySpace(),this.layoutViews(),this.saveProportions()}resize(e,t,n=this.viewItems.map(u=>u.size),o,r,s=Number.NEGATIVE_INFINITY,a=Number.POSITIVE_INFINITY,l,c){if(e<0||e>=this.viewItems.length)return 0;const u=Gs(e,-1),d=Gs(e+1,this.viewItems.length);if(r)for(const E of r)E6(u,E),E6(d,E);if(o)for(const E of o)QN(u,E),QN(d,E);const h=u.map(E=>this.viewItems[E]),f=u.map(E=>n[E]),g=d.map(E=>this.viewItems[E]),p=d.map(E=>n[E]),v=u.reduce((E,I)=>E+(this.viewItems[I].minimumSize-n[I]),0),m=u.reduce((E,I)=>E+(this.viewItems[I].maximumSize-n[I]),0),_=d.length===0?Number.POSITIVE_INFINITY:d.reduce((E,I)=>E+(n[I]-this.viewItems[I].minimumSize),0),y=d.length===0?Number.NEGATIVE_INFINITY:d.reduce((E,I)=>E+(n[I]-this.viewItems[I].maximumSize),0),w=Math.max(v,y,s),L=Math.min(_,m,a);let D=!1;if(l){const E=this.viewItems[l.index],I=t>=l.limitDelta;D=I!==E.visible,E.setVisible(I,l.size)}if(!D&&c){const E=this.viewItems[c.index],I=ta+l.size,0);let n=this.size-t;const o=Gs(this.viewItems.length-1,-1),r=o.filter(a=>this.viewItems[a].priority===1),s=o.filter(a=>this.viewItems[a].priority===2);for(const a of s)E6(o,a);for(const a of r)QN(o,a);typeof e=="number"&&QN(o,e);for(let a=0;n!==0&&at+n.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===0?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(l=>e=l.size-l.minimumSize>0||e);e=!1;const n=this.viewItems.map(l=>e=l.maximumSize-l.size>0||e),o=[...this.viewItems].reverse();e=!1;const r=o.map(l=>e=l.size-l.minimumSize>0||e).reverse();e=!1;const s=o.map(l=>e=l.maximumSize-l.size>0||e).reverse();let a=0;for(let l=0;l0||this.startSnappingEnabled)?c.state=1:_&&t[l]&&(a0)return;if(!n.visible&&n.snap)return t}}areViewsDistributed(){let e,t;for(const n of this.viewItems)if(e=e===void 0?n.size:Math.min(e,n.size),t=t===void 0?n.size:Math.max(t,n.size),t-e>2)return!1;return!0}dispose(){var e;(e=this.sashDragState)===null||e===void 0||e.disposable.dispose(),si(this.viewItems),this.viewItems=[],this.sashItems.forEach(t=>t.disposable.dispose()),this.sashItems=[],super.dispose()}}class rT{constructor(e,t,n){this.columns=e,this.getColumnSize=n,this.templateId=rT.TemplateId,this.renderedTemplates=new Set;const o=new Map(t.map(r=>[r.templateId,r]));this.renderers=[];for(const r of e){const s=o.get(r.templateId);if(!s)throw new Error(`Table cell renderer for template id ${r.templateId} not found.`);this.renderers.push(s)}}renderTemplate(e){const t=Ae(e,He(".monaco-table-tr")),n=[],o=[];for(let s=0;snew xht(u,d)),l={size:a.reduce((u,d)=>u+d.column.weight,0),views:a.map(u=>({size:u.column.weight,view:u}))};this.splitview=this.disposables.add(new J1e(this.domNode,{orientation:1,scrollbarVisibility:2,getSashOrthogonalSize:()=>this.cachedHeight,descriptor:l})),this.splitview.el.style.height=`${n.headerRowHeight}px`,this.splitview.el.style.lineHeight=`${n.headerRowHeight}px`;const c=new rT(o,r,u=>this.splitview.getViewSize(u));this.list=this.disposables.add(new qu(e,this.domNode,Sht(n),[c],s)),st.any(...a.map(u=>u.onDidLayout))(([u,d])=>c.layoutColumn(u,d),null,this.disposables),this.splitview.onDidSashReset(u=>{const d=o.reduce((f,g)=>f+g.weight,0),h=o[u].weight/d*this.cachedWidth;this.splitview.resizeView(u,h)},null,this.disposables),this.styleElement=Wc(this.domNode),this.style(Ddt)}updateOptions(e){this.list.updateOptions(e)}splice(e,t,n=[]){this.list.splice(e,t,n)}getHTMLElement(){return this.domNode}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)}getSelectedElements(){return this.list.getSelectedElements()}getSelection(){return this.list.getSelection()}getFocus(){return this.list.getFocus()}dispose(){this.disposables.dispose()}}O5.InstanceCount=0;class LS extends zu{constructor(e){super(),this._onChange=this._register(new le),this.onChange=this._onChange.event,this._onKeyDown=this._register(new le),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(...Mt.asClassNameArray(this._icon))),this._opts.actionClassName&&t.push(...this._opts.actionClassName.split(" ")),this._checked&&t.push("checked"),this.domNode=document.createElement("div"),this.domNode.title=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,n=>{this.enabled&&(this.checked=!this._checked,this._onChange.fire(!1),n.preventDefault())}),this._register(this.ignoreGesture(this.domNode)),this.onkeydown(this.domNode,n=>{if(n.keyCode===10||n.keyCode===3){this.checked=!this._checked,this._onChange.fire(!0),n.preventDefault(),n.stopPropagation();return}this._onKeyDown.fire(n)})}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()}width(){return 2+2+2+16}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))}}const bht=C("caseDescription","Match Case"),Cht=C("wordsDescription","Match Whole Word"),wht=C("regexDescription","Use Regular Expression");class K1e extends LS{constructor(e){super({icon:Xe.caseSensitive,title:bht+e.appendTitle,isChecked:e.isChecked,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class q1e extends LS{constructor(e){super({icon:Xe.wholeWord,title:Cht+e.appendTitle,isChecked:e.isChecked,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class G1e extends LS{constructor(e){super({icon:Xe.regex,title:wht+e.appendTitle,isChecked:e.isChecked,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class yht{constructor(e,t=0,n=e.length,o=t-1){this.items=e,this.start=t,this.end=n,this.index=o}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 Sht{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()}isLast(){return this._currentPosition()>=this._elements.length-1}isNowhere(){return this._navigator.current()===null}has(e){return this._history.has(e)}_onChange(){this._reduceToLimit();const e=this._elements;this._navigator=new yht(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}}const zx=He;class xht extends zu{constructor(e,t,n){var o;super(),this.state="idle",this.maxHeight=Number.POSITIVE_INFINITY,this._onDidChange=this._register(new le),this.onDidChange=this._onDidChange.event,this._onDidHeightChange=this._register(new le),this.onDidHeightChange=this._onDidHeightChange.event,this.contextViewProvider=t,this.options=n,this.message=null,this.placeholder=this.options.placeholder||"",this.tooltip=(o=this.options.tooltip)!==null&&o!==void 0?o:this.placeholder||"",this.ariaLabel=this.options.ariaLabel||"",this.options.validationOptions&&(this.validation=this.options.validationOptions.validation),this.element=Ae(e,zx(".monaco-inputbox.idle"));const r=this.options.flexibleHeight?"textarea":"input",s=Ae(this.element,zx(".ibwrapper"));if(this.input=Ae(s,zx(r+".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=Ae(s,zx("div.mirror")),this.mirror.innerText="\xA0",this.scrollableElement=new cbe(this.element,{vertical:1}),this.options.flexibleWidth&&(this.input.setAttribute("wrap","off"),this.mirror.style.whiteSpace="pre",this.mirror.style.wordWrap="initial"),Ae(e,this.scrollableElement.getDomNode()),this._register(this.scrollableElement),this._register(this.scrollableElement.onScroll(c=>this.input.scrollTop=c.scrollTop));const a=this._register(new xn(document,"selectionchange")),l=st.filter(a.event,()=>{const c=document.getSelection();return(c==null?void 0:c.anchorNode)===s});this._register(l(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 $c(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.input.title=e}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 height(){return typeof this.cachedHeight=="number"?this.cachedHeight:c0(this.element)}focus(){this.input.focus()}blur(){this.input.blur()}hasFocus(){return document.activeElement===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}enable(){this.input.removeAttribute("disabled")}disable(){this.blur(),this.input.disabled=!0,this._hideMessage()}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,n=this.input.scrollTop;this.scrollableElement.setScrollDimensions({scrollHeight:e,height:t}),this.scrollableElement.setScrollPosition({scrollTop:n})}showMessage(e,t){if(this.state==="open"&&Kl(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 n=this.stylesForType(this.message.type);this.element.style.border=`1px solid ${E0(n.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()}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==null?void 0:e.type}stylesForType(e){const t=this.options.inputBoxStyles;switch(e){case 1:return{border:t.inputValidationInfoBorder,background:t.inputValidationInfoBackground,foreground:t.inputValidationInfoForeground};case 2: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 1:return"info";case 2:return"warning";default:return"error"}}_showMessage(){if(!this.contextViewProvider||!this.message)return;let e;const t=()=>e.style.width=La(this.element)+"px";this.contextViewProvider.showContextView({getAnchor:()=>this.element,anchorAlignment:1,render:o=>{var r,s;if(!this.message)return null;e=Ae(o,zx(".monaco-inputbox-container")),t();const a={inline:!0,className:"monaco-inputbox-message"},l=this.message.formatContent?Out(this.message.content,a):Put(this.message.content,a);l.classList.add(this.classForType(this.message.type));const c=this.stylesForType(this.message.type);return l.style.backgroundColor=(r=c.background)!==null&&r!==void 0?r:"",l.style.color=(s=c.foreground)!==null&&s!==void 0?s:"",l.style.border=c.border?`1px solid ${c.border}`:"",Ae(e,l),null},onHide:()=>{this.state="closed"},layout:t});let n;this.message.type===3?n=C("alertErrorMessage","Error: {0}",this.message.content):this.message.type===2?n=C("alertWarningMessage","Warning: {0}",this.message.content):n=C("alertInfoMessage","Info: {0}",this.message.content),bs(n),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,n=e.charCodeAt(e.length-1)===10?" ":"";(e+n).replace(/\u000c/g,"")?this.mirror.textContent=e+n:this.mirror.innerText="\xA0",this.layout()}applyStyles(){var e,t,n;const o=this.options.inputBoxStyles,r=(e=o.inputBackground)!==null&&e!==void 0?e:"",s=(t=o.inputForeground)!==null&&t!==void 0?t:"",a=(n=o.inputBorder)!==null&&n!==void 0?n:"";this.element.style.backgroundColor=r,this.element.style.color=s,this.input.style.backgroundColor="inherit",this.input.style.color=s,this.element.style.border=`1px solid ${E0(a,"transparent")}`}layout(){if(!this.mirror)return;const e=this.cachedContentHeight;this.cachedContentHeight=c0(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,n=t.selectionStart,o=t.selectionEnd,r=t.value;n!==null&&o!==null&&(this.value=r.substr(0,n)+e+r.substr(o),t.setSelectionRange(n+1,n+1),this.layout())}dispose(){var e;this._hideMessage(),this.message=null,(e=this.actionbar)===null||e===void 0||e.dispose(),super.dispose()}}class X1e extends xht{constructor(e,t,n){const o=C({key:"history.inputbox.hint",comment:["Text will be prefixed with \u21C5 plus a single space, then used as a hint where input field keeps history"]},"for history"),r=` or \u21C5 ${o}`,s=` (\u21C5 ${o})`;super(e,t,n),this._onDidFocus=this._register(new le),this.onDidFocus=this._onDidFocus.event,this._onDidBlur=this._register(new le),this.onDidBlur=this._onDidBlur.event,this.history=new Sht(n.history,100);const a=()=>{if(n.showHistoryHint&&n.showHistoryHint()&&!this.placeholder.endsWith(r)&&!this.placeholder.endsWith(s)&&this.history.getHistory().length){const l=this.placeholder.endsWith(")")?r:s,c=this.placeholder+l;n.showPlaceholderOnFocus&&document.activeElement!==this.input?this.placeholder=c:this.setPlaceHolder(c)}};this.observer=new MutationObserver((l,c)=>{l.forEach(u=>{u.target.textContent||a()})}),this.observer.observe(this.input,{attributeFilter:["class"]}),this.onfocus(this.input,()=>a()),this.onblur(this.input,()=>{const l=c=>{if(this.placeholder.endsWith(c)){const u=this.placeholder.slice(0,this.placeholder.length-c.length);return n.showPlaceholderOnFocus?this.placeholder=u:this.setPlaceHolder(u),!0}else return!1};l(s)||l(r)})}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)}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!=null?e:"",Lv(this.value?this.value:C("clearedInput","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,Lv(this.value))}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()}}const Lht=C("defaultLabel","input");class Y1e extends zu{constructor(e,t,n){super(),this.fixFocusOnOptionClickEnabled=!0,this.imeSessionInProgress=!1,this.additionalTogglesDisposables=this._register(new Kr),this.additionalToggles=[],this._onDidOptionChange=this._register(new le),this.onDidOptionChange=this._onDidOptionChange.event,this._onKeyDown=this._register(new le),this.onKeyDown=this._onKeyDown.event,this._onMouseDown=this._register(new le),this.onMouseDown=this._onMouseDown.event,this._onInput=this._register(new le),this._onKeyUp=this._register(new le),this._onCaseSensitiveKeyDown=this._register(new le),this.onCaseSensitiveKeyDown=this._onCaseSensitiveKeyDown.event,this._onRegexKeyDown=this._register(new le),this.onRegexKeyDown=this._onRegexKeyDown.event,this._lastHighlightFindOptions=0,this.placeholder=n.placeholder||"",this.validation=n.validation,this.label=n.label||Lht,this.showCommonFindToggles=!!n.showCommonFindToggles;const o=n.appendCaseSensitiveLabel||"",r=n.appendWholeWordsLabel||"",s=n.appendRegexLabel||"",a=n.history||[],l=!!n.flexibleHeight,c=!!n.flexibleWidth,u=n.flexibleMaxHeight;if(this.domNode=document.createElement("div"),this.domNode.classList.add("monaco-findInput"),this.inputBox=this._register(new X1e(this.domNode,t,{placeholder:this.placeholder||"",ariaLabel:this.label||"",validationOptions:{validation:this.validation},history:a,showHistoryHint:n.showHistoryHint,flexibleHeight:l,flexibleWidth:c,flexibleMaxHeight:u,inputBoxStyles:n.inputBoxStyles})),this.showCommonFindToggles){this.regex=this._register(new G1e(Object.assign({appendTitle:s,isChecked:!1},n.toggleStyles))),this._register(this.regex.onChange(h=>{this._onDidOptionChange.fire(h),!h&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this._register(this.regex.onKeyDown(h=>{this._onRegexKeyDown.fire(h)})),this.wholeWords=this._register(new q1e(Object.assign({appendTitle:r,isChecked:!1},n.toggleStyles))),this._register(this.wholeWords.onChange(h=>{this._onDidOptionChange.fire(h),!h&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this.caseSensitive=this._register(new K1e(Object.assign({appendTitle:o,isChecked:!1},n.toggleStyles))),this._register(this.caseSensitive.onChange(h=>{this._onDidOptionChange.fire(h),!h&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this._register(this.caseSensitive.onKeyDown(h=>{this._onCaseSensitiveKeyDown.fire(h)}));const d=[this.caseSensitive.domNode,this.wholeWords.domNode,this.regex.domNode];this.onkeydown(this.domNode,h=>{if(h.equals(15)||h.equals(17)||h.equals(9)){const f=d.indexOf(document.activeElement);if(f>=0){let g=-1;h.equals(17)?g=(f+1)%d.length:h.equals(15)&&(f===0?g=d.length-1:g=f-1),h.equals(9)?(d[f].blur(),this.inputBox.focus()):g>=0&&d[g].focus(),dn.stop(h,!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(n==null?void 0:n.additionalToggles),this.controls&&this.domNode.appendChild(this.controls),e==null||e.appendChild(this.domNode),this._register(ke(this.inputBox.inputElement,"compositionstart",d=>{this.imeSessionInProgress=!0})),this._register(ke(this.inputBox.inputElement,"compositionend",d=>{this.imeSessionInProgress=!1,this._onInput.fire()})),this.onkeydown(this.inputBox.inputElement,d=>this._onKeyDown.fire(d)),this.onkeyup(this.inputBox.inputElement,d=>this._onKeyUp.fire(d)),this.oninput(this.inputBox.inputElement,d=>this._onInput.fire()),this.onmousedown(this.inputBox.inputElement,d=>this._onMouseDown.fire(d))}get onDidChange(){return this.inputBox.onDidChange}layout(e){this.inputBox.layout(),this.updateInputBoxPadding(e.collapsedFindWidget)}enable(){var e,t,n;this.domNode.classList.remove("disabled"),this.inputBox.enable(),(e=this.regex)===null||e===void 0||e.enable(),(t=this.wholeWords)===null||t===void 0||t.enable(),(n=this.caseSensitive)===null||n===void 0||n.enable();for(const o of this.additionalToggles)o.enable()}disable(){var e,t,n;this.domNode.classList.add("disabled"),this.inputBox.disable(),(e=this.regex)===null||e===void 0||e.disable(),(t=this.wholeWords)===null||t===void 0||t.disable(),(n=this.caseSensitive)===null||n===void 0||n.disable();for(const o of this.additionalToggles)o.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 Be;for(const t of e!=null?e:[])this.additionalTogglesDisposables.value.add(t),this.controls.appendChild(t.domNode),this.additionalTogglesDisposables.value.add(t.onChange(n=>{this._onDidOptionChange.fire(n),!n&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus()})),this.additionalToggles.push(t);this.additionalToggles.length>0&&(this.controls.style.display=""),this.updateInputBoxPadding()}updateInputBoxPadding(e=!1){var t,n,o,r,s,a;e?this.inputBox.paddingRight=0:this.inputBox.paddingRight=((n=(t=this.caseSensitive)===null||t===void 0?void 0:t.width())!==null&&n!==void 0?n:0)+((r=(o=this.wholeWords)===null||o===void 0?void 0:o.width())!==null&&r!==void 0?r:0)+((a=(s=this.regex)===null||s===void 0?void 0:s.width())!==null&&a!==void 0?a:0)+this.additionalToggles.reduce((l,c)=>l+c.width(),0)}getValue(){return this.inputBox.value}setValue(e){this.inputBox.value!==e&&(this.inputBox.value=e)}select(){this.inputBox.select()}focus(){this.inputBox.focus()}getCaseSensitive(){var e,t;return(t=(e=this.caseSensitive)===null||e===void 0?void 0:e.checked)!==null&&t!==void 0?t:!1}setCaseSensitive(e){this.caseSensitive&&(this.caseSensitive.checked=e)}getWholeWords(){var e,t;return(t=(e=this.wholeWords)===null||e===void 0?void 0:e.checked)!==null&&t!==void 0?t:!1}setWholeWords(e){this.wholeWords&&(this.wholeWords.checked=e)}getRegex(){var e,t;return(t=(e=this.regex)===null||e===void 0?void 0:e.checked)!==null&&t!==void 0?t:!1}setRegex(e){this.regex&&(this.regex.checked=e,this.validate())}focusOnCaseSensitive(){var e;(e=this.caseSensitive)===null||e===void 0||e.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()}}var yh;(function(i){i[i.Expanded=0]="Expanded",i[i.Collapsed=1]="Collapsed",i[i.PreserveOrExpanded=2]="PreserveOrExpanded",i[i.PreserveOrCollapsed=3]="PreserveOrCollapsed"})(yh||(yh={}));var m0;(function(i){i[i.Unknown=0]="Unknown",i[i.Twistie=1]="Twistie",i[i.Element=2]="Element",i[i.Filter=3]="Filter"})(m0||(m0={}));class Pl extends Error{constructor(e,t){super(`TreeError [${e}] ${t}`)}}class fX{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 gX(i){return typeof i=="object"&&"visibility"in i&&"data"in i}function vk(i){switch(i){case!0:return 1;case!1:return 0;default:return i}}function B9(i){return typeof i.collapsible=="boolean"}class Eht{constructor(e,t,n,o={}){this.user=e,this.list=t,this.rootRef=[],this.eventBufferer=new Pq,this._onDidChangeCollapseState=new le,this.onDidChangeCollapseState=this.eventBufferer.wrapEvent(this._onDidChangeCollapseState.event),this._onDidChangeRenderNodeCount=new le,this.onDidChangeRenderNodeCount=this.eventBufferer.wrapEvent(this._onDidChangeRenderNodeCount.event),this._onDidSplice=new le,this.onDidSplice=this._onDidSplice.event,this.refilterDelayer=new Bu(p0e),this.collapseByDefault=typeof o.collapseByDefault=="undefined"?!1:o.collapseByDefault,this.filter=o.filter,this.autoExpandSingleChildren=typeof o.autoExpandSingleChildren=="undefined"?!1:o.autoExpandSingleChildren,this.root={parent:void 0,element:n,children:[],depth:0,visibleChildrenCount:0,visibleChildIndex:-1,collapsible:!1,collapsed:!1,renderNodeCount:0,visibility:1,visible:!0,filterData:void 0}}splice(e,t,n=mn.empty(),o={}){if(e.length===0)throw new Pl(this.user,"Invalid tree location");o.diffIdentityProvider?this.spliceSmart(o.diffIdentityProvider,e,t,n,o):this.spliceSimple(e,t,n,o)}spliceSmart(e,t,n,o,r,s){var a;o===void 0&&(o=mn.empty()),s===void 0&&(s=(a=r.diffDepth)!==null&&a!==void 0?a:0);const{parentNode:l}=this.getParentNodeWithListIndex(t);if(!l.lastDiffIds)return this.spliceSimple(t,n,o,r);const c=[...o],u=t[t.length-1],d=new Rh({getElements:()=>l.lastDiffIds},{getElements:()=>[...l.children.slice(0,u),...c,...l.children.slice(u+n)].map(v=>e.getId(v.element).toString())}).ComputeDiff(!1);if(d.quitEarly)return l.lastDiffIds=void 0,this.spliceSimple(t,n,c,r);const h=t.slice(0,-1),f=(v,m,_)=>{if(s>0)for(let w=0;w<_;w++)v--,m--,this.spliceSmart(e,[...h,v,0],Number.MAX_SAFE_INTEGER,c[m].children,r,s-1)};let g=Math.min(l.children.length,u+n),p=c.length;for(const v of d.changes.sort((m,_)=>_.originalStart-m.originalStart))f(g,p,g-(v.originalStart+v.originalLength)),g=v.originalStart,p=v.modifiedStart-u,this.spliceSimple([...h,g],v.originalLength,mn.slice(c,p,p+v.modifiedLength),r);f(g,p,g)}spliceSimple(e,t,n=mn.empty(),{onDidCreateNode:o,onDidDeleteNode:r,diffIdentityProvider:s}){const{parentNode:a,listIndex:l,revealed:c,visible:u}=this.getParentNodeWithListIndex(e),d=[],h=mn.map(n,E=>this.createTreeNode(E,a,a.visible?1:0,c,d,o)),f=e[e.length-1],g=a.children.length>0;let p=0;for(let E=f;E>=0&&Es.getId(E.element).toString())):a.lastDiffIds=a.children.map(E=>s.getId(E.element).toString()):a.lastDiffIds=void 0;let y=0;for(const E of w)E.visible&&y++;if(y!==0)for(let E=f+v.length;EI+(k.visible?k.renderNodeCount:0),0);this._updateAncestorsRenderNodeCount(a,_-E),this.list.splice(l,E,d)}if(w.length>0&&r){const E=I=>{r(I),I.children.forEach(E)};w.forEach(E)}this._onDidSplice.fire({insertedNodes:v,deletedNodes:w});const L=a.children.length>0;g!==L&&this.setCollapsible(e.slice(0,-1),L);let D=a;for(;D;){if(D.visibility===2){this.refilterDelayer.trigger(()=>this.refilter());break}D=D.parent}}rerender(e){if(e.length===0)throw new Pl(this.user,"Invalid tree location");const{node:t,listIndex:n,revealed:o}=this.getTreeNodeWithListIndex(e);t.visible&&o&&this.list.splice(n,1,[t])}has(e){return this.hasTreeNode(e)}getListIndex(e){const{listIndex:t,visible:n,revealed:o}=this.getTreeNodeWithListIndex(e);return n&&o?t:-1}getListRenderCount(e){return this.getTreeNode(e).renderNodeCount}isCollapsible(e){return this.getTreeNode(e).collapsible}setCollapsible(e,t){const n=this.getTreeNode(e);typeof t=="undefined"&&(t=!n.collapsible);const o={collapsible:t};return this.eventBufferer.bufferEvents(()=>this._setCollapseState(e,o))}isCollapsed(e){return this.getTreeNode(e).collapsed}setCollapsed(e,t,n){const o=this.getTreeNode(e);typeof t=="undefined"&&(t=!o.collapsed);const r={collapsed:t,recursive:n||!1};return this.eventBufferer.bufferEvents(()=>this._setCollapseState(e,r))}_setCollapseState(e,t){const{node:n,listIndex:o,revealed:r}=this.getTreeNodeWithListIndex(e),s=this._setListNodeCollapseState(n,o,r,t);if(n!==this.root&&this.autoExpandSingleChildren&&s&&!B9(t)&&n.collapsible&&!n.collapsed&&!t.recursive){let a=-1;for(let l=0;l-1){a=-1;break}else a=l;a>-1&&this._setCollapseState([...e,a],t)}return s}_setListNodeCollapseState(e,t,n,o){const r=this._setNodeCollapseState(e,o,!1);if(!n||!e.visible||!r)return r;const s=e.renderNodeCount,a=this.updateNodeAfterCollapseChange(e),l=s-(t===-1?0:1);return this.list.splice(t+1,l,a.slice(1)),r}_setNodeCollapseState(e,t,n){let o;if(e===this.root?o=!1:(B9(t)?(o=e.collapsible!==t.collapsible,e.collapsible=t.collapsible):e.collapsible?(o=e.collapsed!==t.collapsed,e.collapsed=t.collapsed):o=!1,o&&this._onDidChangeCollapseState.fire({node:e,deep:n})),!B9(t)&&t.recursive)for(const r of e.children)o=this._setNodeCollapseState(r,t,!0)||o;return o}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,n,o,r,s){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!="undefined",collapsed:typeof e.collapsed=="undefined"?this.collapseByDefault:e.collapsed,renderNodeCount:1,visibility:1,visible:!0,filterData:void 0},l=this._filterNode(a,n);a.visibility=l,o&&r.push(a);const c=e.children||mn.empty(),u=o&&l!==0&&!a.collapsed;let d=0,h=1;for(const f of c){const g=this.createTreeNode(f,a,l,u,r,s);a.children.push(g),h+=g.renderNodeCount,g.visible&&(g.visibleChildIndex=d++)}return a.collapsible=a.collapsible||a.children.length>0,a.visibleChildrenCount=d,a.visible=l===2?d>0:l===1,a.visible?a.collapsed||(a.renderNodeCount=h):(a.renderNodeCount=0,o&&r.pop()),s==null||s(a),a}updateNodeAfterCollapseChange(e){const t=e.renderNodeCount,n=[];return this._updateNodeAfterCollapseChange(e,n),this._updateAncestorsRenderNodeCount(e.parent,n.length-t),n}_updateNodeAfterCollapseChange(e,t){if(e.visible===!1)return 0;if(t.push(e),e.renderNodeCount=1,!e.collapsed)for(const n of e.children)e.renderNodeCount+=this._updateNodeAfterCollapseChange(n,t);return this._onDidChangeRenderNodeCount.fire(e),e.renderNodeCount}updateNodeAfterFilterChange(e){const t=e.renderNodeCount,n=[];return this._updateNodeAfterFilterChange(e,e.visible?1:0,n),this._updateAncestorsRenderNodeCount(e.parent,n.length-t),n}_updateNodeAfterFilterChange(e,t,n,o=!0){let r;if(e!==this.root){if(r=this._filterNode(e,t),r===0)return e.visible=!1,e.renderNodeCount=0,!1;o&&n.push(e)}const s=n.length;e.renderNodeCount=e===this.root?0:1;let a=!1;if(!e.collapsed||r!==0){let l=0;for(const c of e.children)a=this._updateNodeAfterFilterChange(c,r,n,o&&!e.collapsed)||a,c.visible&&(c.visibleChildIndex=l++);e.visibleChildrenCount=l}else e.visibleChildrenCount=0;return e!==this.root&&(e.visible=r===2?a:r===1,e.visibility=r),e.visible?e.collapsed||(e.renderNodeCount+=n.length-s):(e.renderNodeCount=0,o&&n.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 n=this.filter?this.filter.filter(e.element,t):1;return typeof n=="boolean"?(e.filterData=void 0,n?1:0):gX(n)?(e.filterData=n.data,vk(n.visibility)):(e.filterData=void 0,vk(n))}hasTreeNode(e,t=this.root){if(!e||e.length===0)return!0;const[n,...o]=e;return n<0||n>t.children.length?!1:this.hasTreeNode(o,t.children[n])}getTreeNode(e,t=this.root){if(!e||e.length===0)return t;const[n,...o]=e;if(n<0||n>t.children.length)throw new Pl(this.user,"Invalid tree location");return this.getTreeNode(o,t.children[n])}getTreeNodeWithListIndex(e){if(e.length===0)return{node:this.root,listIndex:-1,revealed:!0,visible:!1};const{parentNode:t,listIndex:n,revealed:o,visible:r}=this.getParentNodeWithListIndex(e),s=e[e.length-1];if(s<0||s>t.children.length)throw new Pl(this.user,"Invalid tree location");const a=t.children[s];return{node:a,listIndex:n,revealed:o,visible:r&&a.visible}}getParentNodeWithListIndex(e,t=this.root,n=0,o=!0,r=!0){const[s,...a]=e;if(s<0||s>t.children.length)throw new Pl(this.user,"Invalid tree location");for(let l=0;lt.element)),this.data=e}}function W9(i){return i instanceof nT?new Dht(i):i}class kht{constructor(e,t){this.modelProvider=e,this.dnd=t,this.autoExpandDisposable=_e.None,this.disposables=new Be}getDragURI(e){return this.dnd.getDragURI(e.element)}getDragLabel(e,t){if(this.dnd.getDragLabel)return this.dnd.getDragLabel(e.map(n=>n.element),t)}onDragStart(e,t){var n,o;(o=(n=this.dnd).onDragStart)===null||o===void 0||o.call(n,W9(e),t)}onDragOver(e,t,n,o,r=!0){const s=this.dnd.onDragOver(W9(e),t&&t.element,n,o),a=this.autoExpandNode!==t;if(a&&(this.autoExpandDisposable.dispose(),this.autoExpandNode=t),typeof t=="undefined")return s;if(a&&typeof s!="boolean"&&s.autoExpand&&(this.autoExpandDisposable=yv(()=>{const h=this.modelProvider(),f=h.getNodeLocation(t);h.isCollapsed(f)&&h.setCollapsed(f,!1),this.autoExpandNode=void 0},500,this.disposables)),typeof s=="boolean"||!s.accept||typeof s.bubble=="undefined"||s.feedback){if(!r){const h=typeof s=="boolean"?s:s.accept,f=typeof s=="boolean"?void 0:s.effect;return{accept:h,effect:f,feedback:[n]}}return s}if(s.bubble===1){const h=this.modelProvider(),f=h.getNodeLocation(t),g=h.getParentNodeLocation(f),p=h.getNode(g),v=g&&h.getListIndex(g);return this.onDragOver(e,p,v,o,!1)}const l=this.modelProvider(),c=l.getNodeLocation(t),u=l.getListIndex(c),d=l.getListRenderCount(c);return Object.assign(Object.assign({},s),{feedback:Gs(u,u+d)})}drop(e,t,n,o){this.autoExpandDisposable.dispose(),this.autoExpandNode=void 0,this.dnd.drop(W9(e),t&&t.element,n,o)}onDragEnd(e){var t,n;(n=(t=this.dnd).onDragEnd)===null||n===void 0||n.call(t,e)}dispose(){this.disposables.dispose(),this.dnd.dispose()}}function Iht(i,e){return e&&Object.assign(Object.assign({},e),{identityProvider:e.identityProvider&&{getId(t){return e.identityProvider.getId(t.element)}},dnd:e.dnd&&new kht(i,e.dnd),multipleSelectionController:e.multipleSelectionController&&{isSelectionSingleChangeEvent(t){return e.multipleSelectionController.isSelectionSingleChangeEvent(Object.assign(Object.assign({},t),{element:t.element}))},isSelectionRangeChangeEvent(t){return e.multipleSelectionController.isSelectionRangeChangeEvent(Object.assign(Object.assign({},t),{element:t.element}))}},accessibilityProvider:e.accessibilityProvider&&Object.assign(Object.assign({},e.accessibilityProvider),{getSetSize(t){const n=i(),o=n.getNodeLocation(t),r=n.getParentNodeLocation(o);return n.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&&Object.assign(Object.assign({},e.keyboardNavigationLabelProvider),{getKeyboardNavigationLabel(t){return e.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(t.element)}})})}class pX{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){var n,o;(o=(n=this.delegate).setDynamicHeight)===null||o===void 0||o.call(n,e.element,t)}}var _k;(function(i){i.None="none",i.OnHover="onHover",i.Always="always"})(_k||(_k={}));class Tht{get elements(){return this._elements}constructor(e,t=[]){this._elements=t,this.disposables=new Be,this.onDidChange=st.forEach(e,n=>this._elements=n,this.disposables)}dispose(){this.disposables.dispose()}}class bk{constructor(e,t,n,o,r,s={}){var a;this.renderer=e,this.modelProvider=t,this.activeNodes=o,this.renderedIndentGuides=r,this.renderedElements=new Map,this.renderedNodes=new Map,this.indent=bk.DefaultIndent,this.hideTwistiesOfChildlessElements=!1,this.shouldRenderIndentGuides=!1,this.activeIndentNodes=new Set,this.indentGuidesDisposable=_e.None,this.disposables=new Be,this.templateId=e.templateId,this.updateOptions(s),st.map(n,l=>l.node)(this.onDidChangeNodeTwistieState,this,this.disposables),(a=e.onDidChangeTwistieState)===null||a===void 0||a.call(e,this.onDidChangeTwistieState,this,this.disposables)}updateOptions(e={}){if(typeof e.indent!="undefined"){const t=Za(e.indent,0,40);if(t!==this.indent){this.indent=t;for(const[n,o]of this.renderedNodes)this.renderTreeElement(n,o)}}if(typeof e.renderIndentGuides!="undefined"){const t=e.renderIndentGuides!==_k.None;if(t!==this.shouldRenderIndentGuides){this.shouldRenderIndentGuides=t;for(const[n,o]of this.renderedNodes)this._renderIndentGuides(n,o);if(this.indentGuidesDisposable.dispose(),t){const n=new Be;this.activeNodes.onDidChange(this._onDidChangeActiveNodes,this,n),this.indentGuidesDisposable=n,this._onDidChangeActiveNodes(this.activeNodes.elements)}}}typeof e.hideTwistiesOfChildlessElements!="undefined"&&(this.hideTwistiesOfChildlessElements=e.hideTwistiesOfChildlessElements)}renderTemplate(e){const t=Ae(e,He(".monaco-tl-row")),n=Ae(t,He(".monaco-tl-indent")),o=Ae(t,He(".monaco-tl-twistie")),r=Ae(t,He(".monaco-tl-contents")),s=this.renderer.renderTemplate(r);return{container:e,indent:n,twistie:o,indentGuidesDisposable:_e.None,templateData:s}}renderElement(e,t,n,o){this.renderedNodes.set(e,n),this.renderedElements.set(e.element,e),this.renderTreeElement(e,n),this.renderer.renderElement(e,t,n.templateData,o)}disposeElement(e,t,n,o){var r,s;n.indentGuidesDisposable.dispose(),(s=(r=this.renderer).disposeElement)===null||s===void 0||s.call(r,e,t,n.templateData,o),typeof o=="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 n=bk.DefaultIndent+(e.depth-1)*this.indent;t.twistie.style.paddingLeft=`${n}px`,t.indent.style.width=`${n+this.indent-16}px`,e.collapsible?t.container.setAttribute("aria-expanded",String(!e.collapsed)):t.container.removeAttribute("aria-expanded"),t.twistie.classList.remove(...Mt.asClassNameArray(Xe.treeItemExpanded));let o=!1;this.renderer.renderTwistie&&(o=this.renderer.renderTwistie(e.element,t.twistie)),e.collapsible&&(!this.hideTwistiesOfChildlessElements||e.visibleChildrenCount>0)?(o||t.twistie.classList.add(...Mt.asClassNameArray(Xe.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(Ur(t.indent),t.indentGuidesDisposable.dispose(),!this.shouldRenderIndentGuides)return;const n=new Be,o=this.modelProvider();for(;;){const r=o.getNodeLocation(e),s=o.getParentNodeLocation(r);if(!s)break;const a=o.getNode(s),l=He(".indent-guide",{style:`width: ${this.indent}px`});this.activeIndentNodes.has(a)&&l.classList.add("active"),t.indent.childElementCount===0?t.indent.appendChild(l):t.indent.insertBefore(l,t.indent.firstElementChild),this.renderedIndentGuides.add(a,l),n.add(zt(()=>this.renderedIndentGuides.delete(a,l))),e=a}t.indentGuidesDisposable=n}_onDidChangeActiveNodes(e){if(!this.shouldRenderIndentGuides)return;const t=new Set,n=this.modelProvider();e.forEach(o=>{const r=n.getNodeLocation(o);try{const s=n.getParentNodeLocation(r);o.collapsible&&o.children.length>0&&!o.collapsed?t.add(o):s&&t.add(n.getNode(s))}catch{}}),this.activeIndentNodes.forEach(o=>{t.has(o)||this.renderedIndentGuides.forEach(o,r=>r.classList.remove("active"))}),t.forEach(o=>{this.activeIndentNodes.has(o)||this.renderedIndentGuides.forEach(o,r=>r.classList.add("active"))}),this.activeIndentNodes=t}dispose(){this.renderedNodes.clear(),this.renderedElements.clear(),this.indentGuidesDisposable.dispose(),si(this.disposables)}}bk.DefaultIndent=8;class Nht{get totalCount(){return this._totalCount}get matchCount(){return this._matchCount}constructor(e,t,n){this.tree=e,this.keyboardNavigationLabelProvider=t,this._filter=n,this._totalCount=0,this._matchCount=0,this._pattern="",this._lowercasePattern="",this.disposables=new Be,e.onWillRefilter(this.reset,this,this.disposables)}filter(e,t){let n=1;if(this._filter){const s=this._filter.filter(e,t);if(typeof s=="boolean"?n=s?1:0:gX(s)?n=vk(s.visibility):n=s,n===0)return!1}if(this._totalCount++,!this._pattern)return this._matchCount++,{data:$d.Default,visibility:n};const o=this.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(e),r=Array.isArray(o)?o:[o];for(const s of r){const a=s&&s.toString();if(typeof a=="undefined")return{data:$d.Default,visibility:n};let l;if(this.tree.findMatchType===rb.Contiguous){const c=a.toLowerCase().indexOf(this._lowercasePattern);if(c>-1){l=[Number.MAX_SAFE_INTEGER,0];for(let u=this._lowercasePattern.length;u>0;u--)l.push(c+u-1)}}else l=ib(this._pattern,this._lowercasePattern,0,a,a.toLowerCase(),0,{firstMatchCanBeWeak:!0,boostFullMatch:!0});if(l)return this._matchCount++,r.length===1?{data:l,visibility:n}:{data:{label:a,score:l},visibility:n}}return this.tree.findMode===Jh.Filter?typeof this.tree.options.defaultFindVisibility=="number"?this.tree.options.defaultFindVisibility:this.tree.options.defaultFindVisibility?this.tree.options.defaultFindVisibility(e):2:{data:$d.Default,visibility:n}}reset(){this._totalCount=0,this._matchCount=0}dispose(){si(this.disposables)}}var Jh;(function(i){i[i.Highlight=0]="Highlight",i[i.Filter=1]="Filter"})(Jh||(Jh={}));var rb;(function(i){i[i.Fuzzy=0]="Fuzzy",i[i.Contiguous=1]="Contiguous"})(rb||(rb={}));class Rht{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,n,o,r,s={}){var a,l;this.tree=e,this.view=n,this.filter=o,this.contextViewProvider=r,this.options=s,this._pattern="",this.width=0,this._onDidChangeMode=new le,this.onDidChangeMode=this._onDidChangeMode.event,this._onDidChangeMatchType=new le,this.onDidChangeMatchType=this._onDidChangeMatchType.event,this._onDidChangePattern=new le,this._onDidChangeOpenState=new le,this.onDidChangeOpenState=this._onDidChangeOpenState.event,this.enabledDisposables=new Be,this.disposables=new Be,this._mode=(a=e.options.defaultFindMode)!==null&&a!==void 0?a:Jh.Highlight,this._matchType=(l=e.options.defaultFindMatchType)!==null&&l!==void 0?l:rb.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)}onDidSpliceModel(){!this.widget||this.pattern.length===0||(this.tree.refilter(),this.render())}render(){var e,t,n,o;const r=this.filter.totalCount>0&&this.filter.matchCount===0;this.pattern&&r?!((e=this.tree.options.showNotFoundMessage)!==null&&e!==void 0)||e?(t=this.widget)===null||t===void 0||t.showMessage({type:2,content:C("not found","No elements found.")}):(n=this.widget)===null||n===void 0||n.showMessage({type:2}):(o=this.widget)===null||o===void 0||o.clearMessage()}shouldAllowFocus(e){return!this.widget||!this.pattern||this._mode===Jh.Filter||this.filter.totalCount>0&&this.filter.matchCount<=1?!0:!$d.isDefault(e.filterData)}layout(e){var t;this.width=e,(t=this.widget)===null||t===void 0||t.layout(e)}dispose(){this._history=void 0,this._onDidChangePattern.dispose(),this.enabledDisposables.dispose(),this.disposables.dispose()}}function uae(i){let e=m0.Unknown;return H6(i.browserEvent.target,"monaco-tl-twistie","monaco-tl-row")?e=m0.Twistie:H6(i.browserEvent.target,"monaco-tl-contents","monaco-tl-row")?e=m0.Element:H6(i.browserEvent.target,"monaco-tree-type-filter","monaco-list")&&(e=m0.Filter),{browserEvent:i.browserEvent,element:i.element?i.element.element:null,target:e}}function pM(i,e){e(i),i.children.forEach(t=>pM(t,e))}class V9{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 le,this.onDidChange=this._onDidChange.event}set(e,t){!(t!=null&&t.__forceEvent)&&Lo(this.nodes,e)||this._set(e,!1,t)}_set(e,t,n){if(this.nodes=[...e],this.elements=void 0,this._nodeSet=void 0,!t){const o=this;this._onDidChange.fire({get elements(){return o.get()},browserEvent:n})}}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 l=this.createNodeSet(),c=u=>l.delete(u);t.forEach(u=>pM(u,c)),this.set([...l.values()]);return}const n=new Set,o=l=>n.add(this.identityProvider.getId(l.element).toString());t.forEach(l=>pM(l,o));const r=new Map,s=l=>r.set(this.identityProvider.getId(l.element).toString(),l);e.forEach(l=>pM(l,s));const a=[];for(const l of this.nodes){const c=this.identityProvider.getId(l.element).toString();if(!n.has(c))a.push(l);else{const d=r.get(c);d&&d.visible&&a.push(d)}}if(this.nodes.length>0&&a.length===0){const l=this.getFirstViewElementWithTrait();l&&a.push(l)}this._set(a,!0)}createNodeSet(){const e=new Set;for(const t of this.nodes)e.add(t);return e}}class Mht extends O1e{constructor(e,t){super(e),this.tree=t}onViewPointer(e){if(R1e(e.browserEvent.target)||Qm(e.browserEvent.target)||UC(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 n=e.browserEvent.target,o=n.classList.contains("monaco-tl-twistie")||n.classList.contains("monaco-icon-label")&&n.classList.contains("folder-icon")&&e.browserEvent.offsetX<16;let r=!1;if(typeof this.tree.expandOnlyOnTwistieClick=="function"?r=this.tree.expandOnlyOnTwistieClick(t.element):r=!!this.tree.expandOnlyOnTwistieClick,r&&!o&&e.browserEvent.detail!==2)return super.onViewPointer(e);if(!this.tree.expandOnDoubleClick&&e.browserEvent.detail===2)return super.onViewPointer(e);if(t.collapsible){const s=this.tree.getNodeLocation(t),a=e.browserEvent.altKey;if(this.tree.setFocus([s]),this.tree.toggleCollapsed(s,a),r&&o){e.browserEvent.isHandledByList=!0;return}}super.onViewPointer(e)}onDoubleClick(e){e.browserEvent.target.classList.contains("monaco-tl-twistie")||!this.tree.expandOnDoubleClick||e.browserEvent.isHandledByList||super.onDoubleClick(e)}}class Aht extends Ku{constructor(e,t,n,o,r,s,a,l){super(e,t,n,o,l),this.focusTrait=r,this.selectionTrait=s,this.anchorTrait=a}createMouseController(e){return new Mht(this,e.tree)}splice(e,t,n=[]){if(super.splice(e,t,n),n.length===0)return;const o=[],r=[];let s;n.forEach((a,l)=>{this.focusTrait.has(a)&&o.push(e+l),this.selectionTrait.has(a)&&r.push(e+l),this.anchorTrait.has(a)&&(s=e+l)}),o.length>0&&super.setFocus(mv([...super.getFocus(),...o])),r.length>0&&super.setSelection(mv([...super.getSelection(),...r])),typeof s=="number"&&super.setAnchor(s)}setFocus(e,t,n=!1){super.setFocus(e,t),n||this.focusTrait.set(e.map(o=>this.element(o)),t)}setSelection(e,t,n=!1){super.setSelection(e,t),n||this.selectionTrait.set(e.map(o=>this.element(o)),t)}setAnchor(e,t=!1){super.setAnchor(e),t||(typeof e=="undefined"?this.anchorTrait.set([]):this.anchorTrait.set([this.element(e)]))}}class Z1e{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 onMouseDblClick(){return st.filter(st.map(this.view.onMouseDblClick,uae),e=>e.target!==m0.Filter)}get onPointer(){return st.map(this.view.onPointer,uae)}get onDidFocus(){return this.view.onDidFocus}get onDidChangeModel(){return st.signal(this.model.onDidSplice)}get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}get findMode(){var e,t;return(t=(e=this.findController)===null||e===void 0?void 0:e.mode)!==null&&t!==void 0?t:Jh.Highlight}set findMode(e){this.findController&&(this.findController.mode=e)}get findMatchType(){var e,t;return(t=(e=this.findController)===null||e===void 0?void 0:e.matchType)!==null&&t!==void 0?t:rb.Fuzzy}set findMatchType(e){this.findController&&(this.findController.matchType=e)}get expandOnDoubleClick(){return typeof this._options.expandOnDoubleClick=="undefined"?!0:this._options.expandOnDoubleClick}get expandOnlyOnTwistieClick(){return typeof this._options.expandOnlyOnTwistieClick=="undefined"?!0:this._options.expandOnlyOnTwistieClick}get onDidDispose(){return this.view.onDidDispose}constructor(e,t,n,o,r={}){var s;this._user=e,this._options=r,this.eventBufferer=new Pq,this.onDidChangeFindOpenState=st.None,this.disposables=new Be,this._onWillRefilter=new le,this.onWillRefilter=this._onWillRefilter.event,this._onDidUpdateOptions=new le;const a=new pX(n),l=new toe,c=new toe,u=this.disposables.add(new Tht(c.event)),d=new oG;this.renderers=o.map(v=>new bk(v,()=>this.model,l.event,u,d,r));for(const v of this.renderers)this.disposables.add(v);let h;r.keyboardNavigationLabelProvider&&(h=new Nht(this,r.keyboardNavigationLabelProvider,r.filter),r=Object.assign(Object.assign({},r),{filter:h}),this.disposables.add(h)),this.focus=new V9(()=>this.view.getFocusedElements()[0],r.identityProvider),this.selection=new V9(()=>this.view.getSelectedElements()[0],r.identityProvider),this.anchor=new V9(()=>this.view.getAnchorElement(),r.identityProvider),this.view=new Aht(e,t,a,this.renderers,this.focus,this.selection,this.anchor,Object.assign(Object.assign({},Iht(()=>this.model,r)),{tree:this})),this.model=this.createModel(e,this.view,r),l.input=this.model.onDidChangeCollapseState;const f=st.forEach(this.model.onDidSplice,v=>{this.eventBufferer.bufferEvents(()=>{this.focus.onDidModelSplice(v),this.selection.onDidModelSplice(v)})},this.disposables);f(()=>null,null,this.disposables);const g=this.disposables.add(new le),p=this.disposables.add(new Bu(0));if(this.disposables.add(st.any(f,this.focus.onDidChange,this.selection.onDidChange)(()=>{p.trigger(()=>{const v=new Set;for(const m of this.focus.getNodes())v.add(m);for(const m of this.selection.getNodes())v.add(m);g.fire([...v.values()])})})),c.input=g.event,r.keyboardSupport!==!1){const v=st.chain(this.view.onKeyDown,m=>m.filter(_=>!Qm(_.target)).map(_=>new Pi(_)));st.chain(v,m=>m.filter(_=>_.keyCode===15))(this.onLeftArrow,this,this.disposables),st.chain(v,m=>m.filter(_=>_.keyCode===17))(this.onRightArrow,this,this.disposables),st.chain(v,m=>m.filter(_=>_.keyCode===10))(this.onSpace,this,this.disposables)}if(((s=r.findWidgetEnabled)!==null&&s!==void 0?s:!0)&&r.keyboardNavigationLabelProvider&&r.contextViewProvider){const v=this.options.findWidgetStyles?{styles:this.options.findWidgetStyles}:void 0;this.findController=new Rht(this,this.model,this.view,h,r.contextViewProvider,v),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=st.None,this.onDidChangeFindMatchType=st.None;this.styleElement=Bc(this.view.getHTMLElement()),this.getHTMLElement().classList.toggle("always",this._options.renderIndentGuides===_k.Always)}updateOptions(e={}){var t;this._options=Object.assign(Object.assign({},this._options),e);for(const n of this.renderers)n.updateOptions(e);this.view.updateOptions(this._options),(t=this.findController)===null||t===void 0||t.updateOptions(e),this._onDidUpdateOptions.fire(this._options),this.getHTMLElement().classList.toggle("always",this._options.renderIndentGuides===_k.Always)}get options(){return this._options}getHTMLElement(){return this.view.getHTMLElement()}get scrollTop(){return this.view.scrollTop}set scrollTop(e){this.view.scrollTop=e}get scrollHeight(){return this.view.scrollHeight}get renderHeight(){return this.view.renderHeight}domFocus(){this.view.domFocus()}layout(e,t){var n;this.view.layout(e,t),vv(t)&&((n=this.findController)===null||n===void 0||n.layout(t))}style(e){const t=`.${this.view.domId}`,n=[];e.treeIndentGuidesStroke&&(n.push(`.monaco-list${t}:hover .monaco-tl-indent > .indent-guide, .monaco-list${t}.always .monaco-tl-indent > .indent-guide { border-color: ${e.treeInactiveIndentGuidesStroke}; }`),n.push(`.monaco-list${t} .monaco-tl-indent > .indent-guide.active { border-color: ${e.treeIndentGuidesStroke}; }`)),this.styleElement.textContent=n.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)}isCollapsible(e){return this.model.isCollapsible(e)}setCollapsible(e,t){return this.model.setCollapsible(e,t)}isCollapsed(e){return this.model.isCollapsed(e)}refilter(){this._onWillRefilter.fire(void 0),this.model.refilter()}setSelection(e,t){const n=e.map(r=>this.model.getNode(r));this.selection.set(n,t);const o=e.map(r=>this.model.getListIndex(r)).filter(r=>r>-1);this.view.setSelection(o,t,!0)}getSelection(){return this.selection.get()}setFocus(e,t){const n=e.map(r=>this.model.getNode(r));this.focus.set(n,t);const o=e.map(r=>this.model.getListIndex(r)).filter(r=>r>-1);this.view.setFocus(o,t,!0)}getFocus(){return this.focus.get()}reveal(e,t){this.model.expandTo(e);const n=this.model.getListIndex(e);n!==-1&&this.view.reveal(n,t)}onLeftArrow(e){e.preventDefault(),e.stopPropagation();const t=this.view.getFocusedElements();if(t.length===0)return;const n=t[0],o=this.model.getNodeLocation(n);if(!this.model.setCollapsed(o,!0)){const s=this.model.getParentNodeLocation(o);if(!s)return;const a=this.model.getListIndex(s);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 n=t[0],o=this.model.getNodeLocation(n);if(!this.model.setCollapsed(o,!1)){if(!n.children.some(l=>l.visible))return;const[s]=this.view.getFocus(),a=s+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 n=t[0],o=this.model.getNodeLocation(n),r=e.browserEvent.altKey;this.model.setCollapsed(o,void 0,r)}dispose(){si(this.disposables),this.view.dispose()}}class mX{constructor(e,t,n={}){this.user=e,this.rootRef=null,this.nodes=new Map,this.nodesByIdentity=new Map,this.model=new Eht(e,t,null,n),this.onDidSplice=this.model.onDidSplice,this.onDidChangeCollapseState=this.model.onDidChangeCollapseState,this.onDidChangeRenderNodeCount=this.model.onDidChangeRenderNodeCount,n.sorter&&(this.sorter={compare(o,r){return n.sorter.compare(o.element,r.element)}}),this.identityProvider=n.identityProvider}setChildren(e,t=mn.empty(),n={}){const o=this.getElementLocation(e);this._setChildren(o,this.preserveCollapseState(t),n)}_setChildren(e,t=mn.empty(),n){const o=new Set,r=new Set,s=l=>{var c;if(l.element===null)return;const u=l;if(o.add(u.element),this.nodes.set(u.element,u),this.identityProvider){const d=this.identityProvider.getId(u.element).toString();r.add(d),this.nodesByIdentity.set(d,u)}(c=n.onDidCreateNode)===null||c===void 0||c.call(n,u)},a=l=>{var c;if(l.element===null)return;const u=l;if(o.has(u.element)||this.nodes.delete(u.element),this.identityProvider){const d=this.identityProvider.getId(u.element).toString();r.has(d)||this.nodesByIdentity.delete(d)}(c=n.onDidDeleteNode)===null||c===void 0||c.call(n,u)};this.model.splice([...e,0],Number.MAX_VALUE,t,Object.assign(Object.assign({},n),{onDidCreateNode:s,onDidDeleteNode:a}))}preserveCollapseState(e=mn.empty()){return this.sorter&&(e=[...e].sort(this.sorter.compare.bind(this.sorter))),mn.map(e,t=>{let n=this.nodes.get(t.element);if(!n&&this.identityProvider){const s=this.identityProvider.getId(t.element).toString();n=this.nodesByIdentity.get(s)}if(!n){let s;return typeof t.collapsed=="undefined"?s=void 0:t.collapsed===yh.Collapsed||t.collapsed===yh.PreserveOrCollapsed?s=!0:t.collapsed===yh.Expanded||t.collapsed===yh.PreserveOrExpanded?s=!1:s=Boolean(t.collapsed),Object.assign(Object.assign({},t),{children:this.preserveCollapseState(t.children),collapsed:s})}const o=typeof t.collapsible=="boolean"?t.collapsible:n.collapsible;let r;return typeof t.collapsed=="undefined"||t.collapsed===yh.PreserveOrCollapsed||t.collapsed===yh.PreserveOrExpanded?r=n.collapsed:t.collapsed===yh.Collapsed?r=!0:t.collapsed===yh.Expanded?r=!1:r=Boolean(t.collapsed),Object.assign(Object.assign({},t),{collapsible:o,collapsed:r,children:this.preserveCollapseState(t.children)})})}rerender(e){const t=this.getElementLocation(e);this.model.rerender(t)}getFirstElementChild(e=null){const t=this.getElementLocation(e);return this.model.getFirstElementChild(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 n=this.getElementLocation(e);return this.model.setCollapsible(n,t)}isCollapsed(e){const t=this.getElementLocation(e);return this.model.isCollapsed(t)}setCollapsed(e,t,n){const o=this.getElementLocation(e);return this.model.setCollapsed(o,t,n)}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 Pl(this.user,`Tree element not found: ${e}`);return t}getNodeLocation(e){return e.element}getParentNodeLocation(e){if(e===null)throw new Pl(this.user,"Invalid getParentNodeLocation call");const t=this.nodes.get(e);if(!t)throw new Pl(this.user,`Tree element not found: ${e}`);const n=this.model.getNodeLocation(t),o=this.model.getParentNodeLocation(n);return this.model.getNode(o).element}getElementLocation(e){if(e===null)return[];const t=this.nodes.get(e);if(!t)throw new Pl(this.user,`Tree element not found: ${e}`);return this.model.getNodeLocation(t)}}function mM(i){const e=[i.element],t=i.incompressible||!1;return{element:{elements:e,incompressible:t},children:mn.map(mn.from(i.children),mM),collapsible:i.collapsible,collapsed:i.collapsed}}function vM(i){const e=[i.element],t=i.incompressible||!1;let n,o;for(;[o,n]=mn.consume(mn.from(i.children),2),!(o.length!==1||o[0].incompressible);)i=o[0],e.push(i.element);return{element:{elements:e,incompressible:t},children:mn.map(mn.concat(o,n),vM),collapsible:i.collapsible,collapsed:i.collapsed}}function m$(i,e=0){let t;return em$(n,0)),e===0&&i.element.incompressible?{element:i.element.elements[e],children:t,incompressible:!0,collapsible:i.collapsible,collapsed:i.collapsed}:{element:i.element.elements[e],children:t,collapsible:i.collapsible,collapsed:i.collapsed}}function dae(i){return m$(i,0)}function Q1e(i,e,t){return i.element===e?Object.assign(Object.assign({},i),{children:t}):Object.assign(Object.assign({},i),{children:mn.map(mn.from(i.children),n=>Q1e(n,e,t))})}const Pht=i=>({getId(e){return e.elements.map(t=>i.getId(t).toString()).join("\0")}});class Oht{get onDidSplice(){return this.model.onDidSplice}get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}get onDidChangeRenderNodeCount(){return this.model.onDidChangeRenderNodeCount}constructor(e,t,n={}){this.user=e,this.rootRef=null,this.nodes=new Map,this.model=new mX(e,t,n),this.enabled=typeof n.compressionEnabled=="undefined"?!0:n.compressionEnabled,this.identityProvider=n.identityProvider}setChildren(e,t=mn.empty(),n){const o=n.diffIdentityProvider&&Pht(n.diffIdentityProvider);if(e===null){const g=mn.map(t,this.enabled?vM:mM);this._setChildren(null,g,{diffIdentityProvider:o,diffDepth:1/0});return}const r=this.nodes.get(e);if(!r)throw new Pl(this.user,"Unknown compressed tree node");const s=this.model.getNode(r),a=this.model.getParentNodeLocation(r),l=this.model.getNode(a),c=dae(s),u=Q1e(c,e,t),d=(this.enabled?vM:mM)(u),h=n.diffIdentityProvider?(g,p)=>n.diffIdentityProvider.getId(g)===n.diffIdentityProvider.getId(p):void 0;if(Lo(d.element.elements,s.element.elements,h)){this._setChildren(r,d.children||mn.empty(),{diffIdentityProvider:o,diffDepth:1});return}const f=l.children.map(g=>g===s?d:g);this._setChildren(l.element,f,{diffIdentityProvider:o,diffDepth:s.depth-l.depth})}setCompressionEnabled(e){if(e===this.enabled)return;this.enabled=e;const n=this.model.getNode().children,o=mn.map(n,dae),r=mn.map(o,e?vM:mM);this._setChildren(null,r,{diffIdentityProvider:this.identityProvider,diffDepth:1/0})}_setChildren(e,t,n){const o=new Set,r=a=>{for(const l of a.element.elements)o.add(l),this.nodes.set(l,a.element)},s=a=>{for(const l of a.element.elements)o.has(l)||this.nodes.delete(l)};this.model.setChildren(e,t,Object.assign(Object.assign({},n),{onDidCreateNode:r,onDidDeleteNode:s}))}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=="undefined")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),n=this.model.getParentNodeLocation(t);return n===null?null:n.elements[n.elements.length-1]}getFirstElementChild(e){const t=this.getCompressedNode(e);return this.model.getFirstElementChild(t)}isCollapsible(e){const t=this.getCompressedNode(e);return this.model.isCollapsible(t)}setCollapsible(e,t){const n=this.getCompressedNode(e);return this.model.setCollapsible(n,t)}isCollapsed(e){const t=this.getCompressedNode(e);return this.model.isCollapsed(t)}setCollapsed(e,t,n){const o=this.getCompressedNode(e);return this.model.setCollapsed(o,t,n)}expandTo(e){const t=this.getCompressedNode(e);this.model.expandTo(t)}rerender(e){const t=this.getCompressedNode(e);this.model.rerender(t)}refilter(){this.model.refilter()}getCompressedNode(e){if(e===null)return null;const t=this.nodes.get(e);if(!t)throw new Pl(this.user,`Tree element not found: ${e}`);return t}}const Fht=i=>i[i.length-1];class vX{get element(){return this.node.element===null?null:this.unwrapper(this.node.element)}get children(){return this.node.children.map(e=>new vX(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 Bht(i,e){return{splice(t,n,o){e.splice(t,n,o.map(r=>i.map(r)))},updateElementHeight(t,n){e.updateElementHeight(t,n)}}}function Wht(i,e){return Object.assign(Object.assign({},e),{identityProvider:e.identityProvider&&{getId(t){return e.identityProvider.getId(i(t))}},sorter:e.sorter&&{compare(t,n){return e.sorter.compare(t.elements[0],n.elements[0])}},filter:e.filter&&{filter(t,n){return e.filter.filter(i(t),n)}}})}class Vht{get onDidSplice(){return st.map(this.model.onDidSplice,({insertedNodes:e,deletedNodes:t})=>({insertedNodes:e.map(n=>this.nodeMapper.map(n)),deletedNodes:t.map(n=>this.nodeMapper.map(n))}))}get onDidChangeCollapseState(){return st.map(this.model.onDidChangeCollapseState,({node:e,deep:t})=>({node:this.nodeMapper.map(e),deep:t}))}get onDidChangeRenderNodeCount(){return st.map(this.model.onDidChangeRenderNodeCount,e=>this.nodeMapper.map(e))}constructor(e,t,n={}){this.rootRef=null,this.elementMapper=n.elementMapper||Fht;const o=r=>this.elementMapper(r.elements);this.nodeMapper=new fX(r=>new vX(o,r)),this.model=new Oht(e,Bht(this.nodeMapper,t),Wht(o,n))}setChildren(e,t=mn.empty(),n={}){this.model.setChildren(e,t,n)}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=="undefined"?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,n){return this.model.setCollapsed(e,t,n)}expandTo(e){return this.model.expandTo(e)}rerender(e){return this.model.rerender(e)}refilter(){return this.model.refilter()}getCompressedTreeNode(e=null){return this.model.getNode(e)}}var Hht=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r};class _X extends Z1e{get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}constructor(e,t,n,o,r={}){super(e,t,n,o,r),this.user=e}setChildren(e,t=mn.empty(),n){this.model.setChildren(e,t,n)}rerender(e){if(e===void 0){this.view.rerender();return}this.model.rerender(e)}hasElement(e){return this.model.has(e)}createModel(e,t,n){return new mX(e,t,n)}}class J1e{get compressedTreeNodeProvider(){return this._compressedTreeNodeProvider()}constructor(e,t){this._compressedTreeNodeProvider=e,this.renderer=t,this.templateId=t.templateId,t.onDidChangeTwistieState&&(this.onDidChangeTwistieState=t.onDidChangeTwistieState)}renderTemplate(e){const t=this.renderer.renderTemplate(e);return{compressedTreeNode:void 0,data:t}}renderElement(e,t,n,o){const r=this.compressedTreeNodeProvider.getCompressedTreeNode(e.element);r.element.elements.length===1?(n.compressedTreeNode=void 0,this.renderer.renderElement(e,t,n.data,o)):(n.compressedTreeNode=r,this.renderer.renderCompressedElements(r,t,n.data,o))}disposeElement(e,t,n,o){var r,s,a,l;n.compressedTreeNode?(s=(r=this.renderer).disposeCompressedElements)===null||s===void 0||s.call(r,n.compressedTreeNode,t,n.data,o):(l=(a=this.renderer).disposeElement)===null||l===void 0||l.call(a,e,t,n.data,o)}disposeTemplate(e){this.renderer.disposeTemplate(e.data)}renderTwistie(e,t){return this.renderer.renderTwistie?this.renderer.renderTwistie(e,t):!1}}Hht([Mo],J1e.prototype,"compressedTreeNodeProvider",null);function $ht(i,e){return e&&Object.assign(Object.assign({},e),{keyboardNavigationLabelProvider:e.keyboardNavigationLabelProvider&&{getKeyboardNavigationLabel(t){let n;try{n=i().getCompressedTreeNode(t)}catch{return e.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(t)}return n.element.elements.length===1?e.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(t):e.keyboardNavigationLabelProvider.getCompressedNodeKeyboardNavigationLabel(n.element.elements)}}})}class eCe extends _X{constructor(e,t,n,o,r={}){const s=()=>this,a=o.map(l=>new J1e(s,l));super(e,t,n,a,$ht(s,r))}setChildren(e,t=mn.empty(),n){this.model.setChildren(e,t,n)}createModel(e,t,n){return new Vht(e,t,n)}updateOptions(e={}){super.updateOptions(e),typeof e.compressionEnabled!="undefined"&&this.model.setCompressionEnabled(e.compressionEnabled)}getCompressedTreeNode(e=null){return this.model.getCompressedTreeNode(e)}}var Vp=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};function H9(i){return Object.assign(Object.assign({},i),{children:[],refreshPromise:void 0,stale:!0,slow:!1,collapsedByDefault:void 0})}function v$(i,e){return e.parent?e.parent===i?!0:v$(i,e.parent):!1}function zht(i,e){return i===e||v$(i,e)||v$(e,i)}class bX{get element(){return this.node.element.element}get children(){return this.node.children.map(e=>new bX(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 Uht{constructor(e,t,n){this.renderer=e,this.nodeMapper=t,this.onDidChangeTwistieState=n,this.renderedNodes=new Map,this.templateId=e.templateId}renderTemplate(e){return{templateData:this.renderer.renderTemplate(e)}}renderElement(e,t,n,o){this.renderer.renderElement(this.nodeMapper.map(e),t,n.templateData,o)}renderTwistie(e,t){return e.slow?(t.classList.add(...Mt.asClassNameArray(Xe.treeItemLoading)),!0):(t.classList.remove(...Mt.asClassNameArray(Xe.treeItemLoading)),!1)}disposeElement(e,t,n,o){var r,s;(s=(r=this.renderer).disposeElement)===null||s===void 0||s.call(r,this.nodeMapper.map(e),t,n.templateData,o)}disposeTemplate(e){this.renderer.disposeTemplate(e.templateData)}dispose(){this.renderedNodes.clear()}}function hae(i){return{browserEvent:i.browserEvent,elements:i.elements.map(e=>e.element)}}function fae(i){return{browserEvent:i.browserEvent,element:i.element&&i.element.element,target:i.target}}class jht extends nT{constructor(e){super(e.elements.map(t=>t.element)),this.data=e}}function $9(i){return i instanceof nT?new jht(i):i}class Kht{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(n=>n.element),t)}onDragStart(e,t){var n,o;(o=(n=this.dnd).onDragStart)===null||o===void 0||o.call(n,$9(e),t)}onDragOver(e,t,n,o,r=!0){return this.dnd.onDragOver($9(e),t&&t.element,n,o)}drop(e,t,n,o){this.dnd.drop($9(e),t&&t.element,n,o)}onDragEnd(e){var t,n;(n=(t=this.dnd).onDragEnd)===null||n===void 0||n.call(t,e)}dispose(){this.dnd.dispose()}}function tCe(i){return i&&Object.assign(Object.assign({},i),{collapseByDefault:!0,identityProvider:i.identityProvider&&{getId(e){return i.identityProvider.getId(e.element)}},dnd:i.dnd&&new Kht(i.dnd),multipleSelectionController:i.multipleSelectionController&&{isSelectionSingleChangeEvent(e){return i.multipleSelectionController.isSelectionSingleChangeEvent(Object.assign(Object.assign({},e),{element:e.element}))},isSelectionRangeChangeEvent(e){return i.multipleSelectionController.isSelectionRangeChangeEvent(Object.assign(Object.assign({},e),{element:e.element}))}},accessibilityProvider:i.accessibilityProvider&&Object.assign(Object.assign({},i.accessibilityProvider),{getPosInSet:void 0,getSetSize:void 0,getRole:i.accessibilityProvider.getRole?e=>i.accessibilityProvider.getRole(e.element):()=>"treeitem",isChecked:i.accessibilityProvider.isChecked?e=>{var t;return!!(!((t=i.accessibilityProvider)===null||t===void 0)&&t.isChecked(e.element))}:void 0,getAriaLabel(e){return i.accessibilityProvider.getAriaLabel(e.element)},getWidgetAriaLabel(){return i.accessibilityProvider.getWidgetAriaLabel()},getWidgetRole:i.accessibilityProvider.getWidgetRole?()=>i.accessibilityProvider.getWidgetRole():()=>"tree",getAriaLevel:i.accessibilityProvider.getAriaLevel&&(e=>i.accessibilityProvider.getAriaLevel(e.element)),getActiveDescendantId:i.accessibilityProvider.getActiveDescendantId&&(e=>i.accessibilityProvider.getActiveDescendantId(e.element))}),filter:i.filter&&{filter(e,t){return i.filter.filter(e.element,t)}},keyboardNavigationLabelProvider:i.keyboardNavigationLabelProvider&&Object.assign(Object.assign({},i.keyboardNavigationLabelProvider),{getKeyboardNavigationLabel(e){return i.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(e.element)}}),sorter:void 0,expandOnlyOnTwistieClick:typeof i.expandOnlyOnTwistieClick=="undefined"?void 0:typeof i.expandOnlyOnTwistieClick!="function"?i.expandOnlyOnTwistieClick:e=>i.expandOnlyOnTwistieClick(e.element),defaultFindVisibility:e=>e.hasChildren&&e.stale?1:typeof i.defaultFindVisibility=="number"?i.defaultFindVisibility:typeof i.defaultFindVisibility=="undefined"?2:i.defaultFindVisibility(e.element)})}function _$(i,e){e(i),i.children.forEach(t=>_$(t,e))}class nCe{get onDidScroll(){return this.tree.onDidScroll}get onDidChangeFocus(){return st.map(this.tree.onDidChangeFocus,hae)}get onDidChangeSelection(){return st.map(this.tree.onDidChangeSelection,hae)}get onMouseDblClick(){return st.map(this.tree.onMouseDblClick,fae)}get onPointer(){return st.map(this.tree.onPointer,fae)}get onDidFocus(){return this.tree.onDidFocus}get onDidChangeModel(){return this.tree.onDidChangeModel}get onDidChangeCollapseState(){return this.tree.onDidChangeCollapseState}get onDidChangeFindOpenState(){return this.tree.onDidChangeFindOpenState}get onDidDispose(){return this.tree.onDidDispose}constructor(e,t,n,o,r,s={}){this.user=e,this.dataSource=r,this.nodes=new Map,this.subTreeRefreshPromises=new Map,this.refreshPromises=new Map,this._onDidRender=new le,this._onDidChangeNodeSlowState=new le,this.nodeMapper=new fX(a=>new bX(a)),this.disposables=new Be,this.identityProvider=s.identityProvider,this.autoExpandSingleChildren=typeof s.autoExpandSingleChildren=="undefined"?!1:s.autoExpandSingleChildren,this.sorter=s.sorter,this.collapseByDefault=s.collapseByDefault,this.tree=this.createTree(e,t,n,o,s),this.onDidChangeFindMode=this.tree.onDidChangeFindMode,this.root=H9({element:void 0,parent:null,hasChildren:!0}),this.identityProvider&&(this.root=Object.assign(Object.assign({},this.root),{id:null})),this.nodes.set(null,this.root),this.tree.onDidChangeCollapseState(this._onDidChangeCollapseState,this,this.disposables)}createTree(e,t,n,o,r){const s=new pX(n),a=o.map(c=>new Uht(c,this.nodeMapper,this._onDidChangeNodeSlowState.event)),l=tCe(r)||{};return new _X(e,t,s,a,l)}updateOptions(e={}){this.tree.updateOptions(e)}getHTMLElement(){return this.tree.getHTMLElement()}get scrollTop(){return this.tree.scrollTop}set scrollTop(e){this.tree.scrollTop=e}get scrollHeight(){return this.tree.scrollHeight}get renderHeight(){return this.tree.renderHeight}domFocus(){this.tree.domFocus()}layout(e,t){this.tree.layout(e,t)}style(e){this.tree.style(e)}getInput(){return this.root.element}setInput(e,t){return Vp(this,void 0,void 0,function*(){this.refreshPromises.forEach(o=>o.cancel()),this.refreshPromises.clear(),this.root.element=e;const n=t&&{viewState:t,focus:[],selection:[]};yield this._updateChildren(e,!0,!1,n),n&&(this.tree.setFocus(n.focus),this.tree.setSelection(n.selection)),t&&typeof t.scrollTop=="number"&&(this.scrollTop=t.scrollTop)})}_updateChildren(e=this.root.element,t=!0,n=!1,o,r){return Vp(this,void 0,void 0,function*(){if(typeof this.root.element=="undefined")throw new Pl(this.user,"Tree input not set");this.root.refreshPromise&&(yield this.root.refreshPromise,yield st.toPromise(this._onDidRender.event));const s=this.getDataNode(e);if(yield this.refreshAndRenderNode(s,t,o,r),n)try{this.tree.rerender(s)}catch{}})}rerender(e){if(e===void 0||e===this.root.element){this.tree.rerender();return}const t=this.getDataNode(e);this.tree.rerender(t)}getNode(e=this.root.element){const t=this.getDataNode(e),n=this.tree.getNode(t===this.root?null:t);return this.nodeMapper.map(n)}collapse(e,t=!1){const n=this.getDataNode(e);return this.tree.collapse(n===this.root?null:n,t)}expand(e,t=!1){return Vp(this,void 0,void 0,function*(){if(typeof this.root.element=="undefined")throw new Pl(this.user,"Tree input not set");this.root.refreshPromise&&(yield this.root.refreshPromise,yield st.toPromise(this._onDidRender.event));const n=this.getDataNode(e);if(this.tree.hasElement(n)&&!this.tree.isCollapsible(n)||(n.refreshPromise&&(yield this.root.refreshPromise,yield st.toPromise(this._onDidRender.event)),n!==this.root&&!n.refreshPromise&&!this.tree.isCollapsed(n)))return!1;const o=this.tree.expand(n===this.root?null:n,t);return n.refreshPromise&&(yield this.root.refreshPromise,yield st.toPromise(this._onDidRender.event)),o})}setSelection(e,t){const n=e.map(o=>this.getDataNode(o));this.tree.setSelection(n,t)}getSelection(){return this.tree.getSelection().map(t=>t.element)}setFocus(e,t){const n=e.map(o=>this.getDataNode(o));this.tree.setFocus(n,t)}getFocus(){return this.tree.getFocus().map(t=>t.element)}reveal(e,t){this.tree.reveal(this.getDataNode(e),t)}getParentElement(e){const t=this.tree.getParentElement(this.getDataNode(e));return t&&t.element}getFirstElementChild(e=this.root.element){const t=this.getDataNode(e),n=this.tree.getFirstElementChild(t===this.root?null:t);return n&&n.element}getDataNode(e){const t=this.nodes.get(e===this.root.element?null:e);if(!t)throw new Pl(this.user,`Data tree node not found: ${e}`);return t}refreshAndRenderNode(e,t,n,o){return Vp(this,void 0,void 0,function*(){yield this.refreshNode(e,t,n),this.render(e,n,o)})}refreshNode(e,t,n){return Vp(this,void 0,void 0,function*(){let o;if(this.subTreeRefreshPromises.forEach((r,s)=>{!o&&zht(s,e)&&(o=r.then(()=>this.refreshNode(e,t,n)))}),o)return o;if(e!==this.root&&this.tree.getNode(e).collapsed){e.hasChildren=!!this.dataSource.hasChildren(e.element),e.stale=!0;return}return this.doRefreshSubTree(e,t,n)})}doRefreshSubTree(e,t,n){return Vp(this,void 0,void 0,function*(){let o;e.refreshPromise=new Promise(r=>o=r),this.subTreeRefreshPromises.set(e,e.refreshPromise),e.refreshPromise.finally(()=>{e.refreshPromise=void 0,this.subTreeRefreshPromises.delete(e)});try{const r=yield this.doRefreshNode(e,t,n);e.stale=!1,yield KV.settled(r.map(s=>this.doRefreshSubTree(s,t,n)))}finally{o()}})}doRefreshNode(e,t,n){return Vp(this,void 0,void 0,function*(){e.hasChildren=!!this.dataSource.hasChildren(e.element);let o;if(!e.hasChildren)o=Promise.resolve(mn.empty());else{const r=this.doGetChildren(e);if(Xie(r))o=Promise.resolve(r);else{const s=wv(800);s.then(()=>{e.slow=!0,this._onDidChangeNodeSlowState.fire(e)},a=>null),o=r.finally(()=>s.cancel())}}try{const r=yield o;return this.setChildren(e,r,t,n)}catch(r){if(e!==this.root&&this.tree.hasElement(e)&&this.tree.collapse(e),oh(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 n=this.dataSource.getChildren(e.element);return Xie(n)?this.processChildren(n):(t=sr(()=>Vp(this,void 0,void 0,function*(){return this.processChildren(yield n)})),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(en))}setChildren(e,t,n,o){const r=[...t];if(e.children.length===0&&r.length===0)return[];const s=new Map,a=new Map;for(const u of e.children)if(s.set(u.element,u),this.identityProvider){const d=this.tree.isCollapsed(u);a.set(u.id,{node:u,collapsed:d})}const l=[],c=r.map(u=>{const d=!!this.dataSource.hasChildren(u);if(!this.identityProvider){const p=H9({element:u,parent:e,hasChildren:d});return d&&this.collapseByDefault&&!this.collapseByDefault(u)&&(p.collapsedByDefault=!1,l.push(p)),p}const h=this.identityProvider.getId(u).toString(),f=a.get(h);if(f){const p=f.node;return s.delete(p.element),this.nodes.delete(p.element),this.nodes.set(u,p),p.element=u,p.hasChildren=d,n?f.collapsed?(p.children.forEach(v=>_$(v,m=>this.nodes.delete(m.element))),p.children.splice(0,p.children.length),p.stale=!0):l.push(p):d&&this.collapseByDefault&&!this.collapseByDefault(u)&&(p.collapsedByDefault=!1,l.push(p)),p}const g=H9({element:u,parent:e,id:h,hasChildren:d});return o&&o.viewState.focus&&o.viewState.focus.indexOf(h)>-1&&o.focus.push(g),o&&o.viewState.selection&&o.viewState.selection.indexOf(h)>-1&&o.selection.push(g),o&&o.viewState.expanded&&o.viewState.expanded.indexOf(h)>-1?l.push(g):d&&this.collapseByDefault&&!this.collapseByDefault(u)&&(g.collapsedByDefault=!1,l.push(g)),g});for(const u of s.values())_$(u,d=>this.nodes.delete(d.element));for(const u of c)this.nodes.set(u.element,u);return e.children.splice(0,e.children.length,...c),e!==this.root&&this.autoExpandSingleChildren&&c.length===1&&l.length===0&&(c[0].collapsedByDefault=!1,l.push(c[0])),l}render(e,t,n){const o=e.children.map(s=>this.asTreeElement(s,t)),r=n&&Object.assign(Object.assign({},n),{diffIdentityProvider:n.diffIdentityProvider&&{getId(s){return n.diffIdentityProvider.getId(s.element)}}});this.tree.setChildren(e===this.root?null:e,o,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 n;return t&&t.viewState.expanded&&e.id&&t.viewState.expanded.indexOf(e.id)>-1?n=!1:n=e.collapsedByDefault,e.collapsedByDefault=void 0,{element:e,children:e.hasChildren?mn.map(e.children,o=>this.asTreeElement(o,t)):[],collapsible:e.hasChildren,collapsed:n}}processChildren(e){return this.sorter&&(e=[...e].sort(this.sorter.compare.bind(this.sorter))),e}dispose(){this.disposables.dispose(),this.tree.dispose()}}class CX{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 CX(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 qht{constructor(e,t,n,o){this.renderer=e,this.nodeMapper=t,this.compressibleNodeMapperProvider=n,this.onDidChangeTwistieState=o,this.renderedNodes=new Map,this.disposables=[],this.templateId=e.templateId}renderTemplate(e){return{templateData:this.renderer.renderTemplate(e)}}renderElement(e,t,n,o){this.renderer.renderElement(this.nodeMapper.map(e),t,n.templateData,o)}renderCompressedElements(e,t,n,o){this.renderer.renderCompressedElements(this.compressibleNodeMapperProvider().map(e),t,n.templateData,o)}renderTwistie(e,t){return e.slow?(t.classList.add(...Mt.asClassNameArray(Xe.treeItemLoading)),!0):(t.classList.remove(...Mt.asClassNameArray(Xe.treeItemLoading)),!1)}disposeElement(e,t,n,o){var r,s;(s=(r=this.renderer).disposeElement)===null||s===void 0||s.call(r,this.nodeMapper.map(e),t,n.templateData,o)}disposeCompressedElements(e,t,n,o){var r,s;(s=(r=this.renderer).disposeCompressedElements)===null||s===void 0||s.call(r,this.compressibleNodeMapperProvider().map(e),t,n.templateData,o)}disposeTemplate(e){this.renderer.disposeTemplate(e.templateData)}dispose(){this.renderedNodes.clear(),this.disposables=si(this.disposables)}}function Ght(i){const e=i&&tCe(i);return e&&Object.assign(Object.assign({},e),{keyboardNavigationLabelProvider:e.keyboardNavigationLabelProvider&&Object.assign(Object.assign({},e.keyboardNavigationLabelProvider),{getCompressedNodeKeyboardNavigationLabel(t){return i.keyboardNavigationLabelProvider.getCompressedNodeKeyboardNavigationLabel(t.map(n=>n.element))}})})}class Xht extends nCe{constructor(e,t,n,o,r,s,a={}){super(e,t,n,r,s,a),this.compressionDelegate=o,this.compressibleNodeMapper=new fX(l=>new CX(l)),this.filter=a.filter}createTree(e,t,n,o,r){const s=new pX(n),a=o.map(c=>new qht(c,this.nodeMapper,()=>this.compressibleNodeMapper,this._onDidChangeNodeSlowState.event)),l=Ght(r)||{};return new eCe(e,t,s,a,l)}asTreeElement(e,t){return Object.assign({incompressible:this.compressionDelegate.isIncompressible(e.element)},super.asTreeElement(e,t))}updateOptions(e={}){this.tree.updateOptions(e)}render(e,t){if(!this.identityProvider)return super.render(e,t);const n=h=>this.identityProvider.getId(h).toString(),o=h=>{const f=new Set;for(const g of h){const p=this.tree.getCompressedTreeNode(g===this.root?null:g);if(!!p.element)for(const v of p.element.elements)f.add(n(v.element))}return f},r=o(this.tree.getSelection()),s=o(this.tree.getFocus());super.render(e,t);const a=this.getSelection();let l=!1;const c=this.getFocus();let u=!1;const d=h=>{const f=h.element;if(f)for(let g=0;g{const n=this.filter.filter(t,1),o=Yht(n);if(o===2)throw new Error("Recursive tree visibility not supported in async data compressed trees");return o===1})),super.processChildren(e)}}function Yht(i){return typeof i=="boolean"?i?1:0:gX(i)?vk(i.visibility):vk(i)}class Zht extends Z1e{constructor(e,t,n,o,r,s={}){super(e,t,n,o,s),this.user=e,this.dataSource=r,this.identityProvider=s.identityProvider}createModel(e,t,n){return new mX(e,t,n)}}new lt("isMac",Nn,C("isMac","Whether the operating system is macOS"));new lt("isLinux",Ss,C("isLinux","Whether the operating system is Linux"));const F5=new lt("isWindows",as,C("isWindows","Whether the operating system is Windows")),iCe=new lt("isWeb",qv,C("isWeb","Whether the platform is a web browser"));new lt("isMacNative",Nn&&!qv,C("isMacNative","Whether the operating system is macOS on a non-browser platform"));new lt("isIOS",jd,C("isIOS","Whether the operating system is iOS"));new lt("isMobile",CXe,C("isMobile","Whether the platform is a mobile web browser"));new lt("isDevelopment",!1,!0);new lt("productQualityType","",C("productQualityType","Quality type of VS Code"));const oCe="inputFocus";new lt(oCe,!1,C("inputFocus","Whether keyboard focus is inside an input box"));var _p=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Oi=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const Gc=wn("listService");class Qht{get lastFocusedList(){return this._lastFocusedWidget}constructor(){this.disposables=new Be,this.lists=[],this._lastFocusedWidget=void 0,this._hasCreatedStyleController=!1}setLastFocusedList(e){var t,n;e!==this._lastFocusedWidget&&((t=this._lastFocusedWidget)===null||t===void 0||t.getHTMLElement().classList.remove("last-focused"),this._lastFocusedWidget=e,(n=this._lastFocusedWidget)===null||n===void 0||n.getHTMLElement().classList.add("last-focused"))}register(e,t){if(this._hasCreatedStyleController||(this._hasCreatedStyleController=!0,new F1e(Bc(),"").style(Ub)),this.lists.some(o=>o.widget===e))throw new Error("Cannot register the same widget multiple times");const n={widget:e,extraContextKeys:t};return this.lists.push(n),e.getHTMLElement()===document.activeElement&&this.setLastFocusedList(e),Iu(e.onDidFocus(()=>this.setLastFocusedList(e)),zt(()=>this.lists.splice(this.lists.indexOf(n),1)),e.onDidDispose(()=>{this.lists=this.lists.filter(o=>o!==n),this._lastFocusedWidget===e&&this.setLastFocusedList(void 0)}))}dispose(){this.disposables.dispose()}}const Ck=new lt("listScrollAtBoundary","none");Me.or(Ck.isEqualTo("top"),Ck.isEqualTo("both"));Me.or(Ck.isEqualTo("bottom"),Ck.isEqualTo("both"));const rCe=new lt("listFocus",!0),B5=new lt("listSupportsMultiselect",!0),sCe=Me.and(rCe,Me.not(oCe)),wX=new lt("listHasSelectionOrFocus",!1),yX=new lt("listDoubleSelection",!1),SX=new lt("listMultiSelection",!1),W5=new lt("listSelectionNavigation",!1),Jht=new lt("listSupportsFind",!0),xX=new lt("treeElementCanCollapse",!1),eft=new lt("treeElementHasParent",!1),LX=new lt("treeElementCanExpand",!1),tft=new lt("treeElementHasChild",!1),nft=new lt("treeFindOpen",!1),aCe="listTypeNavigationMode",lCe="listAutomaticKeyboardNavigation";function V5(i,e){const t=i.createScoped(e.getHTMLElement());return rCe.bindTo(t),t}function H5(i,e){const t=Ck.bindTo(i),n=()=>{const o=e.scrollTop===0,r=e.scrollHeight-e.renderHeight-e.scrollTop<1;o&&r?t.set("both"):o?t.set("top"):r?t.set("bottom"):t.set("none")};return n(),e.onDidScroll(n)}const jb="workbench.list.multiSelectModifier",_M="workbench.list.openMode",Ac="workbench.list.horizontalScrolling",EX="workbench.list.defaultFindMode",DX="workbench.list.typeNavigationMode",zP="workbench.list.keyboardNavigation",Gd="workbench.list.scrollByPage",kX="workbench.list.defaultFindMatchType",wk="workbench.tree.indent",UP="workbench.tree.renderIndentGuides",Xd="workbench.list.smoothScrolling",bf="workbench.list.mouseWheelScrollSensitivity",Cf="workbench.list.fastScrollSensitivity",jP="workbench.tree.expandMode";function wf(i){return i.getValue(jb)==="alt"}class ift extends _e{constructor(e){super(),this.configurationService=e,this.useAltAsMultipleSelectionModifier=wf(e),this.registerListeners()}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration(e=>{e.affectsConfiguration(jb)&&(this.useAltAsMultipleSelectionModifier=wf(this.configurationService))}))}isSelectionSingleChangeEvent(e){return this.useAltAsMultipleSelectionModifier?e.browserEvent.altKey:A1e(e)}isSelectionRangeChangeEvent(e){return P1e(e)}}function $5(i,e){var t;const n=i.get(En),o=i.get(xi),r=new Be;return[Object.assign(Object.assign({},e),{keyboardNavigationDelegate:{mightProducePrintableCharacter(a){return o.mightProducePrintableCharacter(a)}},smoothScrolling:Boolean(n.getValue(Xd)),mouseWheelScrollSensitivity:n.getValue(bf),fastScrollSensitivity:n.getValue(Cf),multipleSelectionController:(t=e.multipleSelectionController)!==null&&t!==void 0?t:r.add(new ift(n)),keyboardNavigationEventFilter:sft(o),scrollByPage:Boolean(n.getValue(Gd))}),r]}let b$=class extends Ku{constructor(e,t,n,o,r,s,a,l,c){const u=typeof r.horizontalScrolling!="undefined"?r.horizontalScrolling:Boolean(l.getValue(Ac)),[d,h]=c.invokeFunction($5,r);super(e,t,n,o,Object.assign(Object.assign({keyboardSupport:!1},d),{horizontalScrolling:u})),this.disposables.add(h),this.contextKeyService=V5(s,this),this.disposables.add(H5(this.contextKeyService,this)),this.listSupportsMultiSelect=B5.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(r.multipleSelectionSupport!==!1),W5.bindTo(this.contextKeyService).set(Boolean(r.selectionNavigation)),this.listHasSelectionOrFocus=wX.bindTo(this.contextKeyService),this.listDoubleSelection=yX.bindTo(this.contextKeyService),this.listMultiSelection=SX.bindTo(this.contextKeyService),this.horizontalScrolling=r.horizontalScrolling,this._useAltAsMultipleSelectionModifier=wf(l),this.disposables.add(this.contextKeyService),this.disposables.add(a.register(this)),this.updateStyles(r.overrideStyles),this.disposables.add(this.onDidChangeSelection(()=>{const g=this.getSelection(),p=this.getFocus();this.contextKeyService.bufferChangeEvents(()=>{this.listHasSelectionOrFocus.set(g.length>0||p.length>0),this.listMultiSelection.set(g.length>1),this.listDoubleSelection.set(g.length===2)})})),this.disposables.add(this.onDidChangeFocus(()=>{const g=this.getSelection(),p=this.getFocus();this.listHasSelectionOrFocus.set(g.length>0||p.length>0)})),this.disposables.add(l.onDidChangeConfiguration(g=>{g.affectsConfiguration(jb)&&(this._useAltAsMultipleSelectionModifier=wf(l));let p={};if(g.affectsConfiguration(Ac)&&this.horizontalScrolling===void 0){const v=Boolean(l.getValue(Ac));p=Object.assign(Object.assign({},p),{horizontalScrolling:v})}if(g.affectsConfiguration(Gd)){const v=Boolean(l.getValue(Gd));p=Object.assign(Object.assign({},p),{scrollByPage:v})}if(g.affectsConfiguration(Xd)){const v=Boolean(l.getValue(Xd));p=Object.assign(Object.assign({},p),{smoothScrolling:v})}if(g.affectsConfiguration(bf)){const v=l.getValue(bf);p=Object.assign(Object.assign({},p),{mouseWheelScrollSensitivity:v})}if(g.affectsConfiguration(Cf)){const v=l.getValue(Cf);p=Object.assign(Object.assign({},p),{fastScrollSensitivity:v})}Object.keys(p).length>0&&this.updateOptions(p)})),this.navigator=new cCe(this,Object.assign({configurationService:l},r)),this.disposables.add(this.navigator)}updateOptions(e){super.updateOptions(e),e.overrideStyles!==void 0&&this.updateStyles(e.overrideStyles),e.multipleSelectionSupport!==void 0&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyles(e){this.style(e?SS(e):Ub)}};b$=_p([Oi(5,Ut),Oi(6,Gc),Oi(7,En),Oi(8,$t)],b$);let gae=class extends lht{constructor(e,t,n,o,r,s,a,l,c){const u=typeof r.horizontalScrolling!="undefined"?r.horizontalScrolling:Boolean(l.getValue(Ac)),[d,h]=c.invokeFunction($5,r);super(e,t,n,o,Object.assign(Object.assign({keyboardSupport:!1},d),{horizontalScrolling:u})),this.disposables=new Be,this.disposables.add(h),this.contextKeyService=V5(s,this),this.disposables.add(H5(this.contextKeyService,this.widget)),this.horizontalScrolling=r.horizontalScrolling,this.listSupportsMultiSelect=B5.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(r.multipleSelectionSupport!==!1),W5.bindTo(this.contextKeyService).set(Boolean(r.selectionNavigation)),this._useAltAsMultipleSelectionModifier=wf(l),this.disposables.add(this.contextKeyService),this.disposables.add(a.register(this)),this.updateStyles(r.overrideStyles),this.disposables.add(l.onDidChangeConfiguration(g=>{g.affectsConfiguration(jb)&&(this._useAltAsMultipleSelectionModifier=wf(l));let p={};if(g.affectsConfiguration(Ac)&&this.horizontalScrolling===void 0){const v=Boolean(l.getValue(Ac));p=Object.assign(Object.assign({},p),{horizontalScrolling:v})}if(g.affectsConfiguration(Gd)){const v=Boolean(l.getValue(Gd));p=Object.assign(Object.assign({},p),{scrollByPage:v})}if(g.affectsConfiguration(Xd)){const v=Boolean(l.getValue(Xd));p=Object.assign(Object.assign({},p),{smoothScrolling:v})}if(g.affectsConfiguration(bf)){const v=l.getValue(bf);p=Object.assign(Object.assign({},p),{mouseWheelScrollSensitivity:v})}if(g.affectsConfiguration(Cf)){const v=l.getValue(Cf);p=Object.assign(Object.assign({},p),{fastScrollSensitivity:v})}Object.keys(p).length>0&&this.updateOptions(p)})),this.navigator=new cCe(this,Object.assign({configurationService:l},r)),this.disposables.add(this.navigator)}updateOptions(e){super.updateOptions(e),e.overrideStyles!==void 0&&this.updateStyles(e.overrideStyles),e.multipleSelectionSupport!==void 0&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyles(e){this.style(e?SS(e):Ub)}dispose(){this.disposables.dispose(),super.dispose()}};gae=_p([Oi(5,Ut),Oi(6,Gc),Oi(7,En),Oi(8,$t)],gae);let pae=class extends O5{constructor(e,t,n,o,r,s,a,l,c,u){const d=typeof s.horizontalScrolling!="undefined"?s.horizontalScrolling:Boolean(c.getValue(Ac)),[h,f]=u.invokeFunction($5,s);super(e,t,n,o,r,Object.assign(Object.assign({keyboardSupport:!1},h),{horizontalScrolling:d})),this.disposables.add(f),this.contextKeyService=V5(a,this),this.disposables.add(H5(this.contextKeyService,this)),this.listSupportsMultiSelect=B5.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(s.multipleSelectionSupport!==!1),W5.bindTo(this.contextKeyService).set(Boolean(s.selectionNavigation)),this.listHasSelectionOrFocus=wX.bindTo(this.contextKeyService),this.listDoubleSelection=yX.bindTo(this.contextKeyService),this.listMultiSelection=SX.bindTo(this.contextKeyService),this.horizontalScrolling=s.horizontalScrolling,this._useAltAsMultipleSelectionModifier=wf(c),this.disposables.add(this.contextKeyService),this.disposables.add(l.register(this)),this.updateStyles(s.overrideStyles),this.disposables.add(this.onDidChangeSelection(()=>{const p=this.getSelection(),v=this.getFocus();this.contextKeyService.bufferChangeEvents(()=>{this.listHasSelectionOrFocus.set(p.length>0||v.length>0),this.listMultiSelection.set(p.length>1),this.listDoubleSelection.set(p.length===2)})})),this.disposables.add(this.onDidChangeFocus(()=>{const p=this.getSelection(),v=this.getFocus();this.listHasSelectionOrFocus.set(p.length>0||v.length>0)})),this.disposables.add(c.onDidChangeConfiguration(p=>{p.affectsConfiguration(jb)&&(this._useAltAsMultipleSelectionModifier=wf(c));let v={};if(p.affectsConfiguration(Ac)&&this.horizontalScrolling===void 0){const m=Boolean(c.getValue(Ac));v=Object.assign(Object.assign({},v),{horizontalScrolling:m})}if(p.affectsConfiguration(Gd)){const m=Boolean(c.getValue(Gd));v=Object.assign(Object.assign({},v),{scrollByPage:m})}if(p.affectsConfiguration(Xd)){const m=Boolean(c.getValue(Xd));v=Object.assign(Object.assign({},v),{smoothScrolling:m})}if(p.affectsConfiguration(bf)){const m=c.getValue(bf);v=Object.assign(Object.assign({},v),{mouseWheelScrollSensitivity:m})}if(p.affectsConfiguration(Cf)){const m=c.getValue(Cf);v=Object.assign(Object.assign({},v),{fastScrollSensitivity:m})}Object.keys(v).length>0&&this.updateOptions(v)})),this.navigator=new oft(this,Object.assign({configurationService:c},s)),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?SS(e):Ub)}dispose(){this.disposables.dispose(),super.dispose()}};pae=_p([Oi(6,Ut),Oi(7,Gc),Oi(8,En),Oi(9,$t)],pae);class IX extends _e{constructor(e,t){var n;super(),this.widget=e,this._onDidOpen=this._register(new le),this.onDidOpen=this._onDidOpen.event,this._register(st.filter(this.widget.onDidChangeSelection,o=>o.browserEvent instanceof KeyboardEvent)(o=>this.onSelectionFromKeyboard(o))),this._register(this.widget.onPointer(o=>this.onPointer(o.element,o.browserEvent))),this._register(this.widget.onMouseDblClick(o=>this.onMouseDblClick(o.element,o.browserEvent))),typeof(t==null?void 0:t.openOnSingleClick)!="boolean"&&(t==null?void 0:t.configurationService)?(this.openOnSingleClick=(t==null?void 0:t.configurationService.getValue(_M))!=="doubleClick",this._register(t==null?void 0:t.configurationService.onDidChangeConfiguration(o=>{o.affectsConfiguration(_M)&&(this.openOnSingleClick=(t==null?void 0:t.configurationService.getValue(_M))!=="doubleClick")}))):this.openOnSingleClick=(n=t==null?void 0:t.openOnSingleClick)!==null&&n!==void 0?n:!0}onSelectionFromKeyboard(e){if(e.elements.length!==1)return;const t=e.browserEvent,n=typeof t.preserveFocus=="boolean"?t.preserveFocus:!0,o=typeof t.pinned=="boolean"?t.pinned:!n,r=!1;this._open(this.getSelectedElement(),n,o,r,e.browserEvent)}onPointer(e,t){if(!this.openOnSingleClick||t.detail===2)return;const o=t.button===1,r=!0,s=o,a=t.ctrlKey||t.metaKey||t.altKey;this._open(e,r,s,a,t)}onMouseDblClick(e,t){if(!t)return;const n=t.target;if(n.classList.contains("monaco-tl-twistie")||n.classList.contains("monaco-icon-label")&&n.classList.contains("folder-icon")&&t.offsetX<16)return;const r=!1,s=!0,a=t.ctrlKey||t.metaKey||t.altKey;this._open(e,r,s,a,t)}_open(e,t,n,o,r){!e||this._onDidOpen.fire({editorOptions:{preserveFocus:t,pinned:n,revealIfVisible:!0},sideBySide:o,element:e,browserEvent:r})}}class cCe extends IX{constructor(e,t){super(e,t),this.widget=e}getSelectedElement(){return this.widget.getSelectedElements()[0]}}class oft extends IX{constructor(e,t){super(e,t)}getSelectedElement(){return this.widget.getSelectedElements()[0]}}class rft extends IX{constructor(e,t){super(e,t)}getSelectedElement(){var e;return(e=this.widget.getSelection()[0])!==null&&e!==void 0?e:void 0}}function sft(i){let e=!1;return t=>{if(t.toKeyCodeChord().isModifierKey())return!1;if(e)return e=!1,!1;const n=i.softDispatch(t,t.target);return n.kind===1?(e=!0,!1):(e=!1,n.kind===0)}}let mae=class extends _X{constructor(e,t,n,o,r,s,a,l,c){const{options:u,getTypeNavigationMode:d,disposable:h}=s.invokeFunction(oT,r);super(e,t,n,o,u),this.disposables.add(h),this.internals=new sb(this,r,d,r.overrideStyles,a,l,c),this.disposables.add(this.internals)}updateOptions(e){super.updateOptions(e),this.internals.updateOptions(e)}};mae=_p([Oi(5,$t),Oi(6,Ut),Oi(7,Gc),Oi(8,En)],mae);let vae=class extends eCe{constructor(e,t,n,o,r,s,a,l,c){const{options:u,getTypeNavigationMode:d,disposable:h}=s.invokeFunction(oT,r);super(e,t,n,o,u),this.disposables.add(h),this.internals=new sb(this,r,d,r.overrideStyles,a,l,c),this.disposables.add(this.internals)}updateOptions(e={}){super.updateOptions(e),e.overrideStyles&&this.internals.updateStyleOverrides(e.overrideStyles),this.internals.updateOptions(e)}};vae=_p([Oi(5,$t),Oi(6,Ut),Oi(7,Gc),Oi(8,En)],vae);let _ae=class extends Zht{constructor(e,t,n,o,r,s,a,l,c,u){const{options:d,getTypeNavigationMode:h,disposable:f}=a.invokeFunction(oT,s);super(e,t,n,o,r,d),this.disposables.add(f),this.internals=new sb(this,s,h,s.overrideStyles,l,c,u),this.disposables.add(this.internals)}updateOptions(e={}){super.updateOptions(e),e.overrideStyles!==void 0&&this.internals.updateStyleOverrides(e.overrideStyles),this.internals.updateOptions(e)}};_ae=_p([Oi(6,$t),Oi(7,Ut),Oi(8,Gc),Oi(9,En)],_ae);let C$=class extends nCe{get onDidOpen(){return this.internals.onDidOpen}constructor(e,t,n,o,r,s,a,l,c,u){const{options:d,getTypeNavigationMode:h,disposable:f}=a.invokeFunction(oT,s);super(e,t,n,o,r,d),this.disposables.add(f),this.internals=new sb(this,s,h,s.overrideStyles,l,c,u),this.disposables.add(this.internals)}updateOptions(e={}){super.updateOptions(e),e.overrideStyles&&this.internals.updateStyleOverrides(e.overrideStyles),this.internals.updateOptions(e)}};C$=_p([Oi(6,$t),Oi(7,Ut),Oi(8,Gc),Oi(9,En)],C$);let bae=class extends Xht{constructor(e,t,n,o,r,s,a,l,c,u,d){const{options:h,getTypeNavigationMode:f,disposable:g}=l.invokeFunction(oT,a);super(e,t,n,o,r,s,h),this.disposables.add(g),this.internals=new sb(this,a,f,a.overrideStyles,c,u,d),this.disposables.add(this.internals)}updateOptions(e){super.updateOptions(e),this.internals.updateOptions(e)}};bae=_p([Oi(7,$t),Oi(8,Ut),Oi(9,Gc),Oi(10,En)],bae);function uCe(i){const e=i.getValue(EX);if(e==="highlight")return Jh.Highlight;if(e==="filter")return Jh.Filter;const t=i.getValue(zP);if(t==="simple"||t==="highlight")return Jh.Highlight;if(t==="filter")return Jh.Filter}function dCe(i){const e=i.getValue(kX);if(e==="fuzzy")return rb.Fuzzy;if(e==="contiguous")return rb.Contiguous}function oT(i,e){var t;const n=i.get(En),o=i.get(mp),r=i.get(Ut),s=i.get($t),a=()=>{const f=r.getContextKeyValue(aCe);if(f==="automatic")return Fh.Automatic;if(f==="trigger"||r.getContextKeyValue(lCe)===!1)return Fh.Trigger;const p=n.getValue(DX);if(p==="automatic")return Fh.Automatic;if(p==="trigger")return Fh.Trigger},l=e.horizontalScrolling!==void 0?e.horizontalScrolling:Boolean(n.getValue(Ac)),[c,u]=s.invokeFunction($5,e),d=e.paddingBottom,h=e.renderIndentGuides!==void 0?e.renderIndentGuides:n.getValue(UP);return{getTypeNavigationMode:a,disposable:u,options:Object.assign(Object.assign({keyboardSupport:!1},c),{indent:typeof n.getValue(wk)=="number"?n.getValue(wk):void 0,renderIndentGuides:h,smoothScrolling:Boolean(n.getValue(Xd)),defaultFindMode:uCe(n),defaultFindMatchType:dCe(n),horizontalScrolling:l,scrollByPage:Boolean(n.getValue(Gd)),paddingBottom:d,hideTwistiesOfChildlessElements:e.hideTwistiesOfChildlessElements,expandOnlyOnTwistieClick:(t=e.expandOnlyOnTwistieClick)!==null&&t!==void 0?t:n.getValue(jP)==="doubleClick",contextViewProvider:o,findWidgetStyles:Hdt})}}let sb=class{get onDidOpen(){return this.navigator.onDidOpen}constructor(e,t,n,o,r,s,a){var l;this.tree=e,this.disposables=[],this.contextKeyService=V5(r,e),this.disposables.push(H5(this.contextKeyService,e)),this.listSupportsMultiSelect=B5.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(t.multipleSelectionSupport!==!1),W5.bindTo(this.contextKeyService).set(Boolean(t.selectionNavigation)),this.listSupportFindWidget=Jht.bindTo(this.contextKeyService),this.listSupportFindWidget.set((l=t.findWidgetEnabled)!==null&&l!==void 0?l:!0),this.hasSelectionOrFocus=wX.bindTo(this.contextKeyService),this.hasDoubleSelection=yX.bindTo(this.contextKeyService),this.hasMultiSelection=SX.bindTo(this.contextKeyService),this.treeElementCanCollapse=xX.bindTo(this.contextKeyService),this.treeElementHasParent=eft.bindTo(this.contextKeyService),this.treeElementCanExpand=LX.bindTo(this.contextKeyService),this.treeElementHasChild=tft.bindTo(this.contextKeyService),this.treeFindOpen=nft.bindTo(this.contextKeyService),this._useAltAsMultipleSelectionModifier=wf(a),this.updateStyleOverrides(o);const u=()=>{const h=e.getFocus()[0];if(!h)return;const f=e.getNode(h);this.treeElementCanCollapse.set(f.collapsible&&!f.collapsed),this.treeElementHasParent.set(!!e.getParentElement(h)),this.treeElementCanExpand.set(f.collapsible&&f.collapsed),this.treeElementHasChild.set(!!e.getFirstElementChild(h))},d=new Set;d.add(aCe),d.add(lCe),this.disposables.push(this.contextKeyService,s.register(e),e.onDidChangeSelection(()=>{const h=e.getSelection(),f=e.getFocus();this.contextKeyService.bufferChangeEvents(()=>{this.hasSelectionOrFocus.set(h.length>0||f.length>0),this.hasMultiSelection.set(h.length>1),this.hasDoubleSelection.set(h.length===2)})}),e.onDidChangeFocus(()=>{const h=e.getSelection(),f=e.getFocus();this.hasSelectionOrFocus.set(h.length>0||f.length>0),u()}),e.onDidChangeCollapseState(u),e.onDidChangeModel(u),e.onDidChangeFindOpenState(h=>this.treeFindOpen.set(h)),a.onDidChangeConfiguration(h=>{let f={};if(h.affectsConfiguration(jb)&&(this._useAltAsMultipleSelectionModifier=wf(a)),h.affectsConfiguration(wk)){const g=a.getValue(wk);f=Object.assign(Object.assign({},f),{indent:g})}if(h.affectsConfiguration(UP)&&t.renderIndentGuides===void 0){const g=a.getValue(UP);f=Object.assign(Object.assign({},f),{renderIndentGuides:g})}if(h.affectsConfiguration(Xd)){const g=Boolean(a.getValue(Xd));f=Object.assign(Object.assign({},f),{smoothScrolling:g})}if(h.affectsConfiguration(EX)||h.affectsConfiguration(zP)){const g=uCe(a);f=Object.assign(Object.assign({},f),{defaultFindMode:g})}if(h.affectsConfiguration(DX)||h.affectsConfiguration(zP)){const g=n();f=Object.assign(Object.assign({},f),{typeNavigationMode:g})}if(h.affectsConfiguration(kX)){const g=dCe(a);f=Object.assign(Object.assign({},f),{defaultFindMatchType:g})}if(h.affectsConfiguration(Ac)&&t.horizontalScrolling===void 0){const g=Boolean(a.getValue(Ac));f=Object.assign(Object.assign({},f),{horizontalScrolling:g})}if(h.affectsConfiguration(Gd)){const g=Boolean(a.getValue(Gd));f=Object.assign(Object.assign({},f),{scrollByPage:g})}if(h.affectsConfiguration(jP)&&t.expandOnlyOnTwistieClick===void 0&&(f=Object.assign(Object.assign({},f),{expandOnlyOnTwistieClick:a.getValue(jP)==="doubleClick"})),h.affectsConfiguration(bf)){const g=a.getValue(bf);f=Object.assign(Object.assign({},f),{mouseWheelScrollSensitivity:g})}if(h.affectsConfiguration(Cf)){const g=a.getValue(Cf);f=Object.assign(Object.assign({},f),{fastScrollSensitivity:g})}Object.keys(f).length>0&&e.updateOptions(f)}),this.contextKeyService.onDidChangeContext(h=>{h.affectsSome(d)&&e.updateOptions({typeNavigationMode:n()})})),this.navigator=new rft(e,Object.assign({configurationService:a},t)),this.disposables.push(this.navigator)}updateOptions(e){e.multipleSelectionSupport!==void 0&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyleOverrides(e){this.tree.style(e?SS(e):Ub)}dispose(){this.disposables=si(this.disposables)}};sb=_p([Oi(4,Ut),Oi(5,Gc),Oi(6,En)],sb);const aft=no.as(ah.Configuration);aft.registerConfiguration({id:"workbench",order:7,title:C("workbenchConfigurationTitle","Workbench"),type:"object",properties:{[jb]:{type:"string",enum:["ctrlCmd","alt"],markdownEnumDescriptions:[C("multiSelectModifier.ctrlCmd","Maps to `Control` on Windows and Linux and to `Command` on macOS."),C("multiSelectModifier.alt","Maps to `Alt` on Windows and Linux and to `Option` on macOS.")],default:"ctrlCmd",description:C({key:"multiSelectModifier",comment:["- `ctrlCmd` refers to a value the setting can take and should not be localized.","- `Control` and `Command` refer to the modifier keys Ctrl or Cmd on the keyboard and can be localized."]},"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.")},[_M]:{type:"string",enum:["singleClick","doubleClick"],default:"singleClick",description:C({key:"openModeModifier",comment:["`singleClick` and `doubleClick` refers to a value the setting can take and should not be localized."]},"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.")},[Ac]:{type:"boolean",default:!1,description:C("horizontalScrolling setting","Controls whether lists and trees support horizontal scrolling in the workbench. Warning: turning on this setting has a performance implication.")},[Gd]:{type:"boolean",default:!1,description:C("list.scrollByPage","Controls whether clicks in the scrollbar scroll page by page.")},[wk]:{type:"number",default:8,minimum:4,maximum:40,description:C("tree indent setting","Controls tree indentation in pixels.")},[UP]:{type:"string",enum:["none","onHover","always"],default:"onHover",description:C("render tree indent guides","Controls whether the tree should render indent guides.")},[Xd]:{type:"boolean",default:!1,description:C("list smoothScrolling setting","Controls whether lists and trees have smooth scrolling.")},[bf]:{type:"number",default:1,markdownDescription:C("Mouse Wheel Scroll Sensitivity","A multiplier to be used on the `deltaX` and `deltaY` of mouse wheel scroll events.")},[Cf]:{type:"number",default:5,markdownDescription:C("Fast Scroll Sensitivity","Scrolling speed multiplier when pressing `Alt`.")},[EX]:{type:"string",enum:["highlight","filter"],enumDescriptions:[C("defaultFindModeSettingKey.highlight","Highlight elements when searching. Further up and down navigation will traverse only the highlighted elements."),C("defaultFindModeSettingKey.filter","Filter elements when searching.")],default:"highlight",description:C("defaultFindModeSettingKey","Controls the default find mode for lists and trees in the workbench.")},[zP]:{type:"string",enum:["simple","highlight","filter"],enumDescriptions:[C("keyboardNavigationSettingKey.simple","Simple keyboard navigation focuses elements which match the keyboard input. Matching is done only on prefixes."),C("keyboardNavigationSettingKey.highlight","Highlight keyboard navigation highlights elements which match the keyboard input. Further up and down navigation will traverse only the highlighted elements."),C("keyboardNavigationSettingKey.filter","Filter keyboard navigation will filter out and hide all the elements which do not match the keyboard input.")],default:"highlight",description:C("keyboardNavigationSettingKey","Controls the keyboard navigation style for lists and trees in the workbench. Can be simple, highlight and filter."),deprecated:!0,deprecationMessage:C("keyboardNavigationSettingKeyDeprecated","Please use 'workbench.list.defaultFindMode' and 'workbench.list.typeNavigationMode' instead.")},[kX]:{type:"string",enum:["fuzzy","contiguous"],enumDescriptions:[C("defaultFindMatchTypeSettingKey.fuzzy","Use fuzzy matching when searching."),C("defaultFindMatchTypeSettingKey.contiguous","Use contiguous matching when searching.")],default:"fuzzy",description:C("defaultFindMatchTypeSettingKey","Controls the type of matching used when searching lists and trees in the workbench.")},[jP]:{type:"string",enum:["singleClick","doubleClick"],default:"singleClick",description:C("expand mode","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.")},[DX]:{type:"string",enum:["automatic","trigger"],default:"automatic",markdownDescription:C("typeNavigationMode2","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 w$;(function(i){i[i.PRESERVE=0]="PRESERVE",i[i.LAST=1]="LAST"})(w$||(w$={}));const Kb={Quickaccess:"workbench.contributions.quickaccess"};class lft{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,n)=>n.prefix.length-t.prefix.length),zt(()=>{this.providers.splice(this.providers.indexOf(e),1),this.defaultProvider===e&&(this.defaultProvider=void 0)})}getQuickAccessProviders(){return df([this.defaultProvider,...this.providers])}getQuickAccessProvider(e){return e&&this.providers.find(n=>e.startsWith(n.prefix))||void 0||this.defaultProvider}}no.add(Kb.Quickaccess,new lft);const cft={ctrlCmd:!1,alt:!1};var yk;(function(i){i[i.Blur=1]="Blur",i[i.Gesture=2]="Gesture",i[i.Other=3]="Other"})(yk||(yk={}));var md;(function(i){i[i.NONE=0]="NONE",i[i.FIRST=1]="FIRST",i[i.SECOND=2]="SECOND",i[i.LAST=3]="LAST"})(md||(md={}));const lh=wn("quickInputService");var uft=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Cae=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let y$=class extends _e{constructor(e,t){super(),this.quickInputService=e,this.instantiationService=t,this.registry=no.as(Kb.Quickaccess),this.mapProviderToDescriptor=new Map,this.lastAcceptedPickerValues=new Map,this.visibleQuickAccess=void 0}show(e="",t){this.doShowOrPick(e,!1,t)}doShowOrPick(e,t,n){var o;const[r,s]=this.getOrInstantiateProvider(e),a=this.visibleQuickAccess,l=a==null?void 0:a.descriptor;if(a&&s&&l===s){e!==s.prefix&&!(n!=null&&n.preserveValue)&&(a.picker.value=e),this.adjustValueSelection(a.picker,s,n);return}if(s&&!(n!=null&&n.preserveValue)){let f;if(a&&l&&l!==s){const g=a.value.substr(l.prefix.length);g&&(f=`${s.prefix}${g}`)}if(!f){const g=r==null?void 0:r.defaultFilterValue;g===w$.LAST?f=this.lastAcceptedPickerValues.get(s):typeof g=="string"&&(f=`${s.prefix}${g}`)}typeof f=="string"&&(e=f)}const c=new Be,u=c.add(this.quickInputService.createQuickPick());u.value=e,this.adjustValueSelection(u,s,n),u.placeholder=s==null?void 0:s.placeholder,u.quickNavigate=n==null?void 0:n.quickNavigateConfiguration,u.hideInput=!!u.quickNavigate&&!a,(typeof(n==null?void 0:n.itemActivation)=="number"||(n==null?void 0:n.quickNavigateConfiguration))&&(u.itemActivation=(o=n==null?void 0:n.itemActivation)!==null&&o!==void 0?o:md.SECOND),u.contextKey=s==null?void 0:s.contextKey,u.filterValue=f=>f.substring(s?s.prefix.length:0);let d;t&&(d=new t5,c.add(st.once(u.onWillAccept)(f=>{f.veto(),u.hide()}))),c.add(this.registerPickerListeners(u,r,s,e,n==null?void 0:n.providerOptions));const h=c.add(new Ro);if(r&&c.add(r.provide(u,h.token,n==null?void 0:n.providerOptions)),st.once(u.onDidHide)(()=>{u.selectedItems.length===0&&h.cancel(),c.dispose(),d==null||d.complete(u.selectedItems.slice(0))}),u.show(),t)return d==null?void 0:d.p}adjustValueSelection(e,t,n){var o;let r;n!=null&&n.preserveValue?r=[e.value.length,e.value.length]:r=[(o=t==null?void 0:t.prefix.length)!==null&&o!==void 0?o:0,e.value.length],e.valueSelection=r}registerPickerListeners(e,t,n,o,r){const s=new Be,a=this.visibleQuickAccess={picker:e,descriptor:n,value:o};return s.add(zt(()=>{a===this.visibleQuickAccess&&(this.visibleQuickAccess=void 0)})),s.add(e.onDidChangeValue(l=>{const[c]=this.getOrInstantiateProvider(l);c!==t?this.show(l,{preserveValue:!0,providerOptions:r}):a.value=l})),n&&s.add(e.onDidAccept(()=>{this.lastAcceptedPickerValues.set(n,e.value)})),s}getOrInstantiateProvider(e){const t=this.registry.getQuickAccessProvider(e);if(!t)return[void 0,void 0];let n=this.mapProviderToDescriptor.get(t);return n||(n=this.instantiationService.createInstance(t.ctor),this.mapProviderToDescriptor.set(t,n)),[n,t]}};y$=uft([Cae(0,lh),Cae(1,$t)],y$);ve.white.toString(),ve.white.toString();class S$ extends _e{get onDidClick(){return this._onDidClick.event}constructor(e,t){super(),this._label="",this._onDidClick=this._register(new le),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 n=t.secondary?t.buttonSecondaryBackground:t.buttonBackground,o=t.secondary?t.buttonSecondaryForeground:t.buttonForeground;this._element.style.color=o||"",this._element.style.backgroundColor=n||"",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")),e.appendChild(this._element),this._register(Ei.addTarget(this._element)),[et.CLICK,Di.Tap].forEach(r=>{this._register(ke(this._element,r,s=>{if(!this.enabled){dn.stop(s);return}this._onDidClick.fire(s)}))}),this._register(ke(this._element,et.KEY_DOWN,r=>{const s=new Pi(r);let a=!1;this.enabled&&(s.equals(3)||s.equals(10))?(this._onDidClick.fire(r),a=!0):s.equals(9)&&(this._element.blur(),a=!0),a&&dn.stop(s,!0)})),this._register(ke(this._element,et.MOUSE_OVER,r=>{this._element.classList.contains("disabled")||this.updateBackground(!0)})),this._register(ke(this._element,et.MOUSE_OUT,r=>{this.updateBackground(!1)})),this.focusTracker=this._register(gf(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 n of Zm(e))if(typeof n=="string"){if(n=n.trim(),n==="")continue;const o=document.createElement("span");o.textContent=n,t.push(o)}else t.push(n);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){var t;if(this._label===e||Ym(this._label)&&Ym(e)&&Tut(this._label,e))return;this._element.classList.add("monaco-text-button");const n=this.options.supportShortLabel?this._labelElement:this._element;if(Ym(e)){const o=R5(e,{inline:!0});o.dispose();const r=(t=o.element.querySelector("p"))===null||t===void 0?void 0:t.innerHTML;if(r){const s=Q_e(r,{ADD_TAGS:["b","i","u","code","span"],ALLOWED_ATTR:["class"],RETURN_TRUSTED_TYPE:!0});n.innerHTML=s}else jr(n)}else this.options.supportIcons?jr(n,...this.getContentElements(e)):n.textContent=e;typeof this.options.title=="string"?this._element.title=this.options.title:this.options.title&&(this._element.title=jut(e)),this._label=e}get label(){return this._label}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")}}class x${constructor(e,t,n){this.options=t,this.styles=n,this.count=0,this.element=Ae(e,He(".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()}setTitleFormat(e){this.titleFormat=e,this.render()}render(){var e,t;this.element.textContent=G0(this.countFormat,this.count),this.element.title=G0(this.titleFormat,this.count),this.element.style.backgroundColor=(e=this.styles.badgeBackground)!==null&&e!==void 0?e:"",this.element.style.color=(t=this.styles.badgeForeground)!==null&&t!==void 0?t:"",this.styles.badgeBorder&&(this.element.style.border=`1px solid ${this.styles.badgeBorder}`)}}const wae="done",yae="active",z9="infinite",U9="infinite-long-running",Sae="discrete";class z5 extends _e{constructor(e,t){super(),this.workedVal=0,this.showDelayedScheduler=this._register(new bi(()=>tl(this.element),0)),this.longRunningScheduler=this._register(new bi(()=>this.infiniteLongRunning(),z5.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==null?void 0:t.progressBarBackground)||"#0E70C0",this.element.appendChild(this.bit)}off(){this.bit.style.width="inherit",this.bit.style.opacity="1",this.element.classList.remove(yae,z9,U9,Sae),this.workedVal=0,this.totalWork=void 0,this.longRunningScheduler.cancel()}stop(){return this.doDone(!1)}doDone(e){return this.element.classList.add(wae),this.element.classList.contains(z9)?(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(Sae,wae,U9),this.element.classList.add(yae,z9),this.longRunningScheduler.schedule(),this}infiniteLongRunning(){this.element.classList.add(U9)}getContainer(){return this.element}}z5.LONG_RUNNING_INFINITE_THRESHOLD=1e4;const dft=He;class hft extends _e{constructor(e,t,n){super(),this.parent=e,this.onKeyDown=r=>ke(this.findInput.inputBox.inputElement,et.KEY_DOWN,s=>{r(new Pi(s))}),this.onMouseDown=r=>ke(this.findInput.inputBox.inputElement,et.MOUSE_DOWN,s=>{r(new Dc(s))}),this.onDidChange=r=>this.findInput.onDidChange(r),this.container=Ae(this.parent,dft(".quick-input-box")),this.findInput=this._register(new Y1e(this.container,void 0,{label:"",inputBoxStyles:t,toggleStyles:n}));const o=this.findInput.inputBox.inputElement;o.role="combobox",o.ariaHasPopup="menu",o.ariaAutoComplete="list",o.ariaExpanded="true"}get value(){return this.findInput.getValue()}set value(e){this.findInput.setValue(e)}select(e=null){this.findInput.inputBox.select(e)}isSelectionAtEnd(){return this.findInput.inputBox.isSelectionAtEnd()}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)}setAttribute(e,t){this.findInput.inputBox.inputElement.setAttribute(e,t)}showDecoration(e){e===So.Ignore?this.findInput.clearMessage():this.findInput.showMessage({type:e===So.Info?1:e===So.Warning?2:3,content:""})}stylesForType(e){return this.findInput.inputBox.stylesForType(e===So.Info?1:e===So.Warning?2:3)}setFocus(){this.findInput.focus()}layout(){this.findInput.inputBox.layout()}}class Jm{constructor(e,t){var n;this.text="",this.title="",this.highlights=[],this.didEverRender=!1,this.supportIcons=(n=t==null?void 0:t.supportIcons)!==null&&n!==void 0?n:!1,this.domNode=Ae(e,He("span.monaco-highlighted-label"))}get element(){return this.domNode}set(e,t=[],n="",o){e||(e=""),o&&(e=Jm.escapeNewLines(e,t)),!(this.didEverRender&&this.text===e&&this.title===n&&Kl(this.highlights,t))&&(this.text=e,this.title=n,this.highlights=t,this.render())}render(){const e=[];let t=0;for(const n of this.highlights){if(n.end===n.start)continue;if(t{o=r===`\r -`?-1:0,s+=n;for(const a of t)a.end<=s||(a.start>=s&&(a.start+=o),a.end>=s&&(a.end+=o));return n+=o,"\u23CE"})}}class j9{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 KP extends _e{constructor(e,t){super(),this.customHovers=new Map,this.creationOptions=t,this.domNode=this._register(new j9(Ae(e,He(".monaco-icon-label")))),this.labelContainer=Ae(this.domNode.element,He(".monaco-icon-label-container"));const n=Ae(this.labelContainer,He("span.monaco-icon-name-container"));(t==null?void 0:t.supportHighlights)||(t==null?void 0:t.supportIcons)?this.nameNode=new pft(n,!!t.supportIcons):this.nameNode=new fft(n),this.hoverDelegate=t==null?void 0:t.hoverDelegate}get element(){return this.domNode.element}setLabel(e,t,n){const o=["monaco-icon-label"],r=["monaco-icon-label-container"];let s="";if(n&&(n.extraClasses&&o.push(...n.extraClasses),n.italic&&o.push("italic"),n.strikethrough&&o.push("strikethrough"),n.disabledCommand&&r.push("disabled"),n.title&&(s+=n.title)),this.domNode.className=o.join(" "),this.domNode.element.setAttribute("aria-label",s),this.labelContainer.className=r.join(" "),this.setupHover(n!=null&&n.descriptionTitle?this.labelContainer:this.element,n==null?void 0:n.title),this.nameNode.setLabel(e,n),t||this.descriptionNode){const a=this.getOrCreateDescriptionNode();a instanceof Jm?(a.set(t||"",n?n.descriptionMatches:void 0,void 0,n==null?void 0:n.labelEscapeNewLines),this.setupHover(a.element,n==null?void 0:n.descriptionTitle)):(a.textContent=t&&(n==null?void 0:n.labelEscapeNewLines)?Jm.escapeNewLines(t,[]):t||"",this.setupHover(a.element,(n==null?void 0:n.descriptionTitle)||""),a.empty=!t)}}setupHover(e,t){const n=this.customHovers.get(e);if(n&&(n.dispose(),this.customHovers.delete(e)),!t){e.removeAttribute("title");return}if(!this.hoverDelegate)Mut(e,t);else{const o=T1e(this.hoverDelegate,e,t);o&&this.customHovers.set(e,o)}}dispose(){super.dispose();for(const e of this.customHovers.values())e.dispose();this.customHovers.clear()}getOrCreateDescriptionNode(){var e;if(!this.descriptionNode){const t=this._register(new j9(Ae(this.labelContainer,He("span.monaco-icon-description-container"))));!((e=this.creationOptions)===null||e===void 0)&&e.supportDescriptionHighlights?this.descriptionNode=new Jm(Ae(t.element,He("span.label-description")),{supportIcons:!!this.creationOptions.supportIcons}):this.descriptionNode=this._register(new j9(Ae(t.element,He("span.label-description"))))}return this.descriptionNode}}class fft{constructor(e){this.container=e,this.label=void 0,this.singleLabel=void 0}setLabel(e,t){if(!(this.label===e&&Kl(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=Ae(this.container,He("a.label-name",{id:t==null?void 0:t.domId}))),this.singleLabel.textContent=e;else{this.container.innerText="",this.container.classList.add("multiple"),this.singleLabel=void 0;for(let n=0;n{const r={start:n,end:n+o.length},s=t.map(a=>hs.intersect(r,a)).filter(a=>!hs.isEmpty(a)).map(({start:a,end:l})=>({start:a-n,end:l-n}));return n=r.end+e.length,s})}class pft{constructor(e,t){this.container=e,this.supportIcons=t,this.label=void 0,this.singleLabel=void 0}setLabel(e,t){if(!(this.label===e&&Kl(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=new Jm(Ae(this.container,He("a.label-name",{id:t==null?void 0:t.domId})),{supportIcons:this.supportIcons})),this.singleLabel.set(e,t==null?void 0:t.matches,void 0,t==null?void 0:t.labelEscapeNewLines);else{this.container.innerText="",this.container.classList.add("multiple"),this.singleLabel=void 0;const n=(t==null?void 0:t.separator)||"/",o=gft(e,n,t==null?void 0:t.matches);for(let r=0;r{const i=new Intl.Collator(void 0,{numeric:!0,sensitivity:"base"});return{collator:i,collatorIsNumeric:i.resolvedOptions().numeric}});new rh(()=>({collator:new Intl.Collator(void 0,{numeric:!0})}));new rh(()=>({collator:new Intl.Collator(void 0,{numeric:!0,sensitivity:"accent"})}));function vft(i,e,t=!1){const n=i||"",o=e||"",r=xae.value.collator.compare(n,o);return xae.value.collatorIsNumeric&&r===0&&n!==o?no.length)return 1}return 0}var Cft=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r};class hCe{constructor(e){this.nodes=e}toString(){return this.nodes.map(e=>typeof e=="string"?e:e.label).join("")}}Cft([Mo],hCe.prototype,"toString",null);const wft=/\[([^\]]+)\]\(((?:https?:\/\/|command:|file:)[^\)\s]+)(?: (["'])(.+?)(\3))?\)/gi;function yft(i){const e=[];let t=0,n;for(;n=wft.exec(i);){n.index-t>0&&e.push(i.substring(t,n.index));const[,o,r,,s]=n;s?e.push({label:o,href:r,title:s}):e.push({label:o,href:r}),t=n.index+n[0].length}return t{OQe(f)&&dn.stop(f,!0),t.callback(r.href)},c=t.disposables.add(new xn(a,et.CLICK)).event,u=t.disposables.add(new xn(a,et.KEY_DOWN)).event,d=st.chain(u,f=>f.filter(g=>{const p=new Pi(g);return p.equals(10)||p.equals(3)}));t.disposables.add(Ei.addTarget(a));const h=t.disposables.add(new xn(a,Di.Tap)).event;st.any(c,h,d)(l,null,t.disposables),e.appendChild(a)}}var fCe=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Lae=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};const sd=He;class Lft{constructor(e,t,n,o,r,s,a){var l,c,u;this._checked=!1,this._hidden=!1,this.hasCheckbox=o,this.index=n,this.fireButtonTriggered=r,this.fireSeparatorButtonTriggered=s,this._onChecked=a,this.onChecked=o?st.map(st.filter(this._onChecked.event,d=>d.listElement===this),d=>d.checked):st.None,e.type==="separator"?this._separator=e:(this.item=e,t&&t.type==="separator"&&!t.buttons&&(this._separator=t),this.saneDescription=this.item.description,this.saneDetail=this.item.detail,this._labelHighlights=(l=this.item.highlights)===null||l===void 0?void 0:l.label,this._descriptionHighlights=(c=this.item.highlights)===null||c===void 0?void 0:c.description,this._detailHighlights=(u=this.item.highlights)===null||u===void 0?void 0:u.detail,this.saneTooltip=this.item.tooltip),this._init=new rh(()=>{var d;const h=(d=e.label)!==null&&d!==void 0?d:"",f=IL(h).text.trim(),g=e.ariaLabel||[h,this.saneDescription,this.saneDetail].map(p=>Iut(p)).filter(p=>!!p).join(", ");return{saneLabel:h,saneSortLabel:f,saneAriaLabel:g}})}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 checked(){return this._checked}set checked(e){e!==this._checked&&(this._checked=e,this._onChecked.fire({listElement:this,checked:e}))}get separator(){return this._separator}set separator(e){this._separator=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 sT{constructor(e){this.themeService=e}get templateId(){return sT.ID}renderTemplate(e){const t=Object.create(null);t.toDisposeElement=[],t.toDisposeTemplate=[],t.entry=Ae(e,sd(".quick-input-list-entry"));const n=Ae(t.entry,sd("label.quick-input-list-label"));t.toDisposeTemplate.push(No(n,et.CLICK,c=>{t.checkbox.offsetParent||c.preventDefault()})),t.checkbox=Ae(n,sd("input.quick-input-list-checkbox")),t.checkbox.type="checkbox",t.toDisposeTemplate.push(No(t.checkbox,et.CHANGE,c=>{t.element.checked=t.checkbox.checked}));const o=Ae(n,sd(".quick-input-list-rows")),r=Ae(o,sd(".quick-input-list-row")),s=Ae(o,sd(".quick-input-list-row"));t.label=new KP(r,{supportHighlights:!0,supportDescriptionHighlights:!0,supportIcons:!0}),t.toDisposeTemplate.push(t.label),t.icon=a0e(t.label.element,sd(".quick-input-list-icon"));const a=Ae(r,sd(".quick-input-list-entry-keybinding"));t.keybinding=new rT(a,Wl);const l=Ae(s,sd(".quick-input-list-label-meta"));return t.detail=new KP(l,{supportHighlights:!0,supportIcons:!0}),t.toDisposeTemplate.push(t.detail),t.separator=Ae(t.entry,sd(".quick-input-list-separator")),t.actionBar=new $c(t.entry),t.actionBar.domNode.classList.add("quick-input-list-entry-action-bar"),t.toDisposeTemplate.push(t.actionBar),t}renderElement(e,t,n){var o,r,s,a;n.element=e,e.element=(o=n.entry)!==null&&o!==void 0?o:void 0;const l=e.item?e.item:e.separator;n.checkbox.checked=e.checked,n.toDisposeElement.push(e.onChecked(g=>n.checkbox.checked=g));const{labelHighlights:c,descriptionHighlights:u,detailHighlights:d}=e;if(!((r=e.item)===null||r===void 0)&&r.iconPath){const g=Sy(this.themeService.getColorTheme().type)?e.item.iconPath.dark:(s=e.item.iconPath.light)!==null&&s!==void 0?s:e.item.iconPath.dark,p=Rt.revive(g);n.icon.className="quick-input-list-icon",n.icon.style.backgroundImage=Cv(p)}else n.icon.style.backgroundImage="",n.icon.className=!((a=e.item)===null||a===void 0)&&a.iconClass?`quick-input-list-icon ${e.item.iconClass}`:"";const h={matches:c||[],descriptionTitle:e.saneDescription,descriptionMatches:u||[],labelEscapeNewLines:!0};l.type!=="separator"?(h.extraClasses=l.iconClasses,h.italic=l.italic,h.strikethrough=l.strikethrough,n.entry.classList.remove("quick-input-list-separator-as-item")):n.entry.classList.add("quick-input-list-separator-as-item"),n.label.setLabel(e.saneLabel,e.saneDescription,h),n.keybinding.set(l.type==="separator"?void 0:l.keybinding),e.saneDetail?(n.detail.element.style.display="",n.detail.setLabel(e.saneDetail,void 0,{matches:d,title:e.saneDetail,labelEscapeNewLines:!0})):n.detail.element.style.display="none",e.item&&e.separator&&e.separator.label?(n.separator.textContent=e.separator.label,n.separator.style.display=""):n.separator.style.display="none",n.entry.classList.toggle("quick-input-list-separator-border",!!e.separator);const f=l.buttons;f&&f.length?(n.actionBar.push(f.map((g,p)=>{let v=g.iconClass||(g.iconPath?L$(g.iconPath):void 0);return g.alwaysVisible&&(v=v?`${v} always-visible`:"always-visible"),{id:`id-${p}`,class:v,enabled:!0,label:"",tooltip:g.tooltip||"",run:()=>{l.type!=="separator"?e.fireButtonTriggered({button:g,item:l}):e.fireSeparatorButtonTriggered({button:g,separator:l})}}}),{icon:!0,label:!1}),n.entry.classList.add("has-actions")):n.entry.classList.remove("has-actions")}disposeElement(e,t,n){n.toDisposeElement=si(n.toDisposeElement),n.actionBar.clear()}disposeTemplate(e){e.toDisposeElement=si(e.toDisposeElement),e.toDisposeTemplate=si(e.toDisposeTemplate)}}sT.ID="listelement";class Eft{getHeight(e){return e.item?e.saneDetail?44:22:24}getTemplateId(e){return sT.ID}}var yr;(function(i){i[i.First=1]="First",i[i.Second=2]="Second",i[i.Last=3]="Last",i[i.Next=4]="Next",i[i.Previous=5]="Previous",i[i.NextPage=6]="NextPage",i[i.PreviousPage=7]="PreviousPage"})(yr||(yr={}));class TX{constructor(e,t,n,o){this.parent=e,this.options=n,this.inputElements=[],this.elements=[],this.elementsToIndexes=new Map,this.matchOnDescription=!1,this.matchOnDetail=!1,this.matchOnLabel=!0,this.matchOnLabelMode="fuzzy",this.sortByLabel=!0,this._onChangedAllVisibleChecked=new le,this.onChangedAllVisibleChecked=this._onChangedAllVisibleChecked.event,this._onChangedCheckedCount=new le,this.onChangedCheckedCount=this._onChangedCheckedCount.event,this._onChangedVisibleCount=new le,this.onChangedVisibleCount=this._onChangedVisibleCount.event,this._onChangedCheckedElements=new le,this.onChangedCheckedElements=this._onChangedCheckedElements.event,this._onButtonTriggered=new le,this.onButtonTriggered=this._onButtonTriggered.event,this._onSeparatorButtonTriggered=new le,this.onSeparatorButtonTriggered=this._onSeparatorButtonTriggered.event,this._onKeyDown=new le,this.onKeyDown=this._onKeyDown.event,this._onLeave=new le,this.onLeave=this._onLeave.event,this._listElementChecked=new le,this._fireCheckedEvents=!0,this.elementDisposables=[],this.disposables=[],this.id=t,this.container=Ae(this.parent,sd(".quick-input-list"));const r=new Eft,s=new Ift;if(this.list=n.createList("QuickInput",this.container,r,[new sT(o)],{identityProvider:{getId:a=>{var l,c,u,d,h,f,g,p;return(p=(f=(d=(c=(l=a.item)===null||l===void 0?void 0:l.id)!==null&&c!==void 0?c:(u=a.item)===null||u===void 0?void 0:u.label)!==null&&d!==void 0?d:(h=a.separator)===null||h===void 0?void 0:h.id)!==null&&f!==void 0?f:(g=a.separator)===null||g===void 0?void 0:g.label)!==null&&p!==void 0?p:""}},setRowLineHeight:!1,multipleSelectionSupport:!1,horizontalScrolling:!1,accessibilityProvider:s}),this.list.getHTMLElement().id=t,this.disposables.push(this.list),this.disposables.push(this.list.onKeyDown(a=>{const l=new Pi(a);switch(l.keyCode){case 10:this.toggleCheckbox();break;case 31:(Nn?a.metaKey:a.ctrlKey)&&this.list.setFocus(Gs(this.list.length));break;case 16:{const c=this.list.getFocus();c.length===1&&c[0]===0&&this._onLeave.fire();break}case 18:{const c=this.list.getFocus();c.length===1&&c[0]===this.list.length-1&&this._onLeave.fire();break}}this._onKeyDown.fire(l)})),this.disposables.push(this.list.onMouseDown(a=>{a.browserEvent.button!==2&&a.browserEvent.preventDefault()})),this.disposables.push(ke(this.container,et.CLICK,a=>{(a.x||a.y)&&this._onLeave.fire()})),this.disposables.push(this.list.onMouseMiddleClick(a=>{this._onLeave.fire()})),this.disposables.push(this.list.onContextMenu(a=>{typeof a.index=="number"&&(a.browserEvent.preventDefault(),this.list.setSelection([a.index]))})),n.hoverDelegate){const a=new m0e(n.hoverDelegate.delay);this.disposables.push(this.list.onMouseOver(l=>Lae(this,void 0,void 0,function*(){var c;if(l.browserEvent.target instanceof HTMLAnchorElement){a.cancel();return}if(!(!(l.browserEvent.relatedTarget instanceof HTMLAnchorElement)&&os(l.browserEvent.relatedTarget,(c=l.element)===null||c===void 0?void 0:c.element)))try{yield a.trigger(()=>Lae(this,void 0,void 0,function*(){l.element&&this.showHover(l.element)}))}catch(u){if(!oh(u))throw u}}))),this.disposables.push(this.list.onMouseOut(l=>{var c;os(l.browserEvent.relatedTarget,(c=l.element)===null||c===void 0?void 0:c.element)||a.cancel()})),this.disposables.push(a)}this.disposables.push(this._listElementChecked.event(a=>this.fireCheckedEvents())),this.disposables.push(this._onChangedAllVisibleChecked,this._onChangedCheckedCount,this._onChangedVisibleCount,this._onChangedCheckedElements,this._onButtonTriggered,this._onSeparatorButtonTriggered,this._onLeave,this._onKeyDown)}get onDidChangeFocus(){return st.map(this.list.onDidChangeFocus,e=>e.elements.map(t=>t.item))}get onDidChangeSelection(){return st.map(this.list.onDidChangeSelection,e=>({items:e.elements.map(t=>t.item),event:e.browserEvent}))}get scrollTop(){return this.list.scrollTop}set scrollTop(e){this.list.scrollTop=e}get ariaLabel(){return this.list.getHTMLElement().ariaLabel}set ariaLabel(e){this.list.getHTMLElement().ariaLabel=e}getAllVisibleChecked(){return this.allVisibleChecked(this.elements,!1)}allVisibleChecked(e,t=!0){for(let n=0,o=e.length;n{t.hidden||(t.checked=e)})}finally{this._fireCheckedEvents=!0,this.fireCheckedEvents()}}setElements(e){this.elementDisposables=si(this.elementDisposables);const t=s=>this.fireButtonTriggered(s),n=s=>this.fireSeparatorButtonTriggered(s);this.inputElements=e;const o=new Map,r=this.parent.classList.contains("show-checkboxes");this.elements=e.reduce((s,a,l)=>{var c;const u=l>0?e[l-1]:void 0;if(a.type==="separator"&&!a.buttons)return s;const d=new Lft(a,u,l,r,t,n,this._listElementChecked),h=s.length;return s.push(d),o.set((c=d.item)!==null&&c!==void 0?c:d.separator,h),s},[]),this.elementsToIndexes=o,this.list.splice(0,this.list.length),this.list.splice(0,this.list.length,this.elements),this._onChangedVisibleCount.fire(this.elements.length)}getFocusedElements(){return this.list.getFocusedElements().map(e=>e.item)}setFocusedElements(e){if(this.list.setFocus(e.filter(t=>this.elementsToIndexes.has(t)).map(t=>this.elementsToIndexes.get(t))),e.length>0){const t=this.list.getFocus()[0];typeof t=="number"&&this.list.reveal(t)}}getActiveDescendant(){return this.list.getHTMLElement().getAttribute("aria-activedescendant")}setSelectedElements(e){this.list.setSelection(e.filter(t=>this.elementsToIndexes.has(t)).map(t=>this.elementsToIndexes.get(t)))}getCheckedElements(){return this.elements.filter(e=>e.checked).map(e=>e.item).filter(e=>!!e)}setCheckedElements(e){try{this._fireCheckedEvents=!1;const t=new Set;for(const n of e)t.add(n);for(const n of this.elements)n.checked=t.has(n.item)}finally{this._fireCheckedEvents=!0,this.fireCheckedEvents()}}set enabled(e){this.list.getHTMLElement().style.pointerEvents=e?"":"none"}focus(e){if(!this.list.length)return;switch(e===yr.Second&&this.list.length<2&&(e=yr.First),e){case yr.First:this.list.scrollTop=0,this.list.focusFirst(void 0,n=>!!n.item);break;case yr.Second:this.list.scrollTop=0,this.list.focusNth(1,void 0,n=>!!n.item);break;case yr.Last:this.list.scrollTop=this.list.scrollHeight,this.list.focusLast(void 0,n=>!!n.item);break;case yr.Next:{this.list.focusNext(void 0,!0,void 0,o=>!!o.item);const n=this.list.getFocus()[0];n!==0&&!this.elements[n-1].item&&this.list.firstVisibleIndex>n-1&&this.list.reveal(n-1);break}case yr.Previous:{this.list.focusPrevious(void 0,!0,void 0,o=>!!o.item);const n=this.list.getFocus()[0];n!==0&&!this.elements[n-1].item&&this.list.firstVisibleIndex>n-1&&this.list.reveal(n-1);break}case yr.NextPage:this.list.focusNextPage(void 0,n=>!!n.item);break;case yr.PreviousPage:this.list.focusPreviousPage(void 0,n=>!!n.item);break}const t=this.list.getFocus()[0];typeof t=="number"&&this.list.reveal(t)}clearFocus(){this.list.setFocus([])}domFocus(){this.list.domFocus()}showHover(e){var t,n,o;this.options.hoverDelegate!==void 0&&(this._lastHover&&!this._lastHover.isDisposed&&((n=(t=this.options.hoverDelegate).onDidHideHover)===null||n===void 0||n.call(t),(o=this._lastHover)===null||o===void 0||o.dispose()),!(!e.element||!e.saneTooltip)&&(this._lastHover=this.options.hoverDelegate.showHover({content:e.saneTooltip,target:e.element,linkHandler:r=>{this.options.linkOpenerDelegate(r)},showPointer:!0,container:this.container,hoverPosition:1},!1)))}layout(e){this.list.getHTMLElement().style.maxHeight=e?`${Math.floor(e/44)*44+6}px`:"",this.list.layout()}filter(e){if(!(this.sortByLabel||this.matchOnLabel||this.matchOnDescription||this.matchOnDetail))return this.list.layout(),!1;const t=e;if(e=e.trim(),!e||!(this.matchOnLabel||this.matchOnDescription||this.matchOnDetail))this.elements.forEach(o=>{o.labelHighlights=void 0,o.descriptionHighlights=void 0,o.detailHighlights=void 0,o.hidden=!1;const r=o.index&&this.inputElements[o.index-1];o.item&&(o.separator=r&&r.type==="separator"&&!r.buttons?r:void 0)});else{let o;this.elements.forEach(r=>{var s,a,l,c;let u;this.matchOnLabelMode==="fuzzy"?u=this.matchOnLabel&&(s=N9(e,IL(r.saneLabel)))!==null&&s!==void 0?s:void 0:u=this.matchOnLabel&&(a=Dft(t,IL(r.saneLabel)))!==null&&a!==void 0?a:void 0;const d=this.matchOnDescription&&(l=N9(e,IL(r.saneDescription||"")))!==null&&l!==void 0?l:void 0,h=this.matchOnDetail&&(c=N9(e,IL(r.saneDetail||"")))!==null&&c!==void 0?c:void 0;if(u||d||h?(r.labelHighlights=u,r.descriptionHighlights=d,r.detailHighlights=h,r.hidden=!1):(r.labelHighlights=void 0,r.descriptionHighlights=void 0,r.detailHighlights=void 0,r.hidden=r.item?!r.item.alwaysShow:!0),r.item?r.separator=void 0:r.separator&&(r.hidden=!0),!this.sortByLabel){const f=r.index&&this.inputElements[r.index-1];o=f&&f.type==="separator"?f:o,o&&!r.hidden&&(r.separator=o,o=void 0)}})}const n=this.elements.filter(o=>!o.hidden);if(this.sortByLabel&&e){const o=e.toLowerCase();n.sort((r,s)=>kft(r,s,o))}return this.elementsToIndexes=n.reduce((o,r,s)=>{var a;return o.set((a=r.item)!==null&&a!==void 0?a:r.separator,s),o},new Map),this.list.splice(0,this.list.length,n),this.list.setFocus([]),this.list.layout(),this._onChangedAllVisibleChecked.fire(this.getAllVisibleChecked()),this._onChangedVisibleCount.fire(n.length),!0}toggleCheckbox(){try{this._fireCheckedEvents=!1;const e=this.list.getFocusedElements(),t=this.allVisibleChecked(e);for(const n of e)n.checked=!t}finally{this._fireCheckedEvents=!0,this.fireCheckedEvents()}}display(e){this.container.style.display=e?"":"none"}isDisplayed(){return this.container.style.display!=="none"}dispose(){this.elementDisposables=si(this.elementDisposables),this.disposables=si(this.disposables)}fireCheckedEvents(){this._fireCheckedEvents&&(this._onChangedAllVisibleChecked.fire(this.getAllVisibleChecked()),this._onChangedCheckedCount.fire(this.getCheckedCount()),this._onChangedCheckedElements.fire(this.getCheckedElements()))}fireButtonTriggered(e){this._onButtonTriggered.fire(e)}fireSeparatorButtonTriggered(e){this._onSeparatorButtonTriggered.fire(e)}style(e){this.list.style(e)}toggleHover(){const e=this.list.getFocusedElements()[0];if(!(e!=null&&e.saneTooltip))return;if(this._lastHover&&!this._lastHover.isDisposed){this._lastHover.dispose();return}const t=this.list.getFocusedElements()[0];if(!t)return;this.showHover(t);const n=new Be;n.add(this.list.onDidChangeFocus(o=>{o.indexes.length&&this.showHover(o.elements[0])})),this._lastHover&&n.add(this._lastHover),this._toggleHover=n,this.elementDisposables.push(this._toggleHover)}}fCe([Mo],TX.prototype,"onDidChangeFocus",null);fCe([Mo],TX.prototype,"onDidChangeSelection",null);function Dft(i,e){const{text:t,iconOffsets:n}=e;if(!n||n.length===0)return Eae(i,t);const o=OI(t," "),r=t.length-o.length,s=Eae(i,o);if(s)for(const a of s){const l=n[a.start+r]+r;a.start+=l,a.end+=l}return s}function Eae(i,e){const t=e.toLowerCase().indexOf(i.toLowerCase());return t!==-1?[{start:t,end:t+i.length}]:null}function kft(i,e,t){const n=i.labelHighlights||[],o=e.labelHighlights||[];return n.length&&!o.length?-1:!n.length&&o.length?1:n.length===0&&o.length===0?0:_ft(i.saneSortLabel,e.saneSortLabel,t)}class Ift{getWidgetAriaLabel(){return C("quickInput","Quick Input")}getAriaLabel(e){var t;return!((t=e.separator)===null||t===void 0)&&t.label?`${e.saneAriaLabel}, ${e.separator.label}`:e.saneAriaLabel}getWidgetRole(){return"listbox"}getRole(e){return e.hasCheckbox?"checkbox":"option"}isChecked(e){if(!!e.hasCheckbox)return{value:e.checked,onDidChange:e.onChecked}}}var Dae=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};const E$={iconClass:Mt.asClassName(Xe.quickInputBack),tooltip:C("quickInput.back","Back"),handle:-1};class aT extends _e{constructor(e){super(),this.ui=e,this._widgetUpdated=!1,this.visible=!1,this._enabled=!0,this._busy=!1,this._ignoreFocusOut=!1,this._buttons=[],this.buttonsUpdated=!1,this._toggles=[],this.togglesUpdated=!1,this.noValidationMessage=aT.noPromptMessage,this._severity=So.Ignore,this.onDidTriggerButtonEmitter=this._register(new le),this.onDidHideEmitter=this._register(new le),this.onDisposeEmitter=this._register(new le),this.visibleDisposables=this._register(new Be),this.onDidHide=this.onDidHideEmitter.event}get title(){return this._title}set title(e){this._title=e,this.update()}get description(){return this._description}set description(e){this._description=e,this.update()}get step(){return this._steps}set step(e){this._steps=e,this.update()}get totalSteps(){return this._totalSteps}set totalSteps(e){this._totalSteps=e,this.update()}get enabled(){return this._enabled}set enabled(e){this._enabled=e,this.update()}get contextKey(){return this._contextKey}set contextKey(e){this._contextKey=e,this.update()}get busy(){return this._busy}set busy(e){this._busy=e,this.update()}get ignoreFocusOut(){return this._ignoreFocusOut}set ignoreFocusOut(e){const t=this._ignoreFocusOut!==e&&!jd;this._ignoreFocusOut=e&&!jd,t&&this.update()}get buttons(){return this._buttons}set buttons(e){this._buttons=e,this.buttonsUpdated=!0,this.update()}get toggles(){return this._toggles}set toggles(e){this._toggles=e!=null?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=yk.Other){this.visible=!1,this.visibleDisposables.clear(),this.onDidHideEmitter.fire({reason:e})}update(){var e,t;if(!this.visible)return;const n=this.getTitle();n&&this.ui.title.textContent!==n?this.ui.title.textContent=n:!n&&this.ui.title.innerHTML!==" "&&(this.ui.title.innerText="\xA0");const o=this.getDescription();if(this.ui.description1.textContent!==o&&(this.ui.description1.textContent=o),this.ui.description2.textContent!==o&&(this.ui.description2.textContent=o),this._widgetUpdated&&(this._widgetUpdated=!1,this._widget?jr(this.ui.widget,this._widget):jr(this.ui.widget)),this.busy&&!this.busyDelay&&(this.busyDelay=new $u,this.busyDelay.setIfNotSet(()=>{this.visible&&this.ui.progressBar.infinite()},800)),!this.busy&&this.busyDelay&&(this.ui.progressBar.stop(),this.busyDelay.cancel(),this.busyDelay=void 0),this.buttonsUpdated){this.buttonsUpdated=!1,this.ui.leftActionBar.clear();const s=this.buttons.filter(l=>l===E$);this.ui.leftActionBar.push(s.map((l,c)=>{const u=new la(`id-${c}`,"",l.iconClass||L$(l.iconPath),!0,()=>Dae(this,void 0,void 0,function*(){this.onDidTriggerButtonEmitter.fire(l)}));return u.tooltip=l.tooltip||"",u}),{icon:!0,label:!1}),this.ui.rightActionBar.clear();const a=this.buttons.filter(l=>l!==E$);this.ui.rightActionBar.push(a.map((l,c)=>{const u=new la(`id-${c}`,"",l.iconClass||L$(l.iconPath),!0,()=>Dae(this,void 0,void 0,function*(){this.onDidTriggerButtonEmitter.fire(l)}));return u.tooltip=l.tooltip||"",u}),{icon:!0,label:!1})}if(this.togglesUpdated){this.togglesUpdated=!1;const s=(t=(e=this.toggles)===null||e===void 0?void 0:e.filter(a=>a instanceof LS))!==null&&t!==void 0?t:[];this.ui.inputBox.toggles=s}this.ui.ignoreFocusOut=this.ignoreFocusOut,this.ui.setEnabled(this.enabled),this.ui.setContextKey(this.contextKey);const r=this.validationMessage||this.noValidationMessage;this._lastValidationMessage!==r&&(this._lastValidationMessage=r,jr(this.ui.message),xft(r,this.ui.message,{callback:s=>{this.ui.linkOpenerDelegate(s)},disposables:this.visibleDisposables})),this._lastSeverity!==this.severity&&(this._lastSeverity=this.severity,this.showMessageDecoration(this.severity))}getTitle(){return this.title&&this.step?`${this.title} (${this.getSteps()})`:this.title?this.title:this.step?this.getSteps():""}getDescription(){return this.description||""}getSteps(){return this.step&&this.totalSteps?C("quickInput.steps","{0}/{1}",this.step,this.totalSteps):this.step?String(this.step):""}showMessageDecoration(e){if(this.ui.inputBox.showDecoration(e),e!==So.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()}}aT.noPromptMessage=C("inputModeEntry","Press 'Enter' to confirm your input or 'Escape' to cancel");class Sk extends aT{constructor(){super(...arguments),this._value="",this.onDidChangeValueEmitter=this._register(new le),this.onWillAcceptEmitter=this._register(new le),this.onDidAcceptEmitter=this._register(new le),this.onDidCustomEmitter=this._register(new le),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._autoFocusOnList=!0,this._keepScrollPosition=!1,this._itemActivation=md.FIRST,this._activeItems=[],this.activeItemsUpdated=!1,this.activeItemsToConfirm=[],this.onDidChangeActiveEmitter=this._register(new le),this._selectedItems=[],this.selectedItemsUpdated=!1,this.selectedItemsToConfirm=[],this.onDidChangeSelectionEmitter=this._register(new le),this.onDidTriggerItemButtonEmitter=this._register(new le),this.onDidTriggerSeparatorButtonEmitter=this._register(new le),this.valueSelectionUpdated=!0,this._ok="default",this._customButton=!1,this.filterValue=e=>e,this.onDidChangeValue=this.onDidChangeValueEmitter.event,this.onWillAccept=this.onWillAcceptEmitter.event,this.onDidAccept=this.onDidAcceptEmitter.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 autoFocusOnList(){return this._autoFocusOnList}set autoFocusOnList(e){this._autoFocusOnList=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?cft:this.ui.keyMods}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()}get hideInput(){return!!this._hideInput}set hideInput(e){this._hideInput=e,this.update()}trySelectFirst(){this.autoFocusOnList&&(this.canSelectMany||this.ui.list.focus(yr.First))}show(){this.visible||(this.visibleDisposables.add(this.ui.inputBox.onDidChange(e=>{this.doSetValue(e,!0)})),this.visibleDisposables.add(this.ui.inputBox.onMouseDown(e=>{this.autoFocusOnList||this.ui.list.clearFocus()})),this.visibleDisposables.add((this._hideInput?this.ui.list:this.ui.inputBox).onKeyDown(e=>{switch(e.keyCode){case 18:this.ui.list.focus(yr.Next),this.canSelectMany&&this.ui.list.domFocus(),dn.stop(e,!0);break;case 16:this.ui.list.getFocusedElements().length?this.ui.list.focus(yr.Previous):this.ui.list.focus(yr.Last),this.canSelectMany&&this.ui.list.domFocus(),dn.stop(e,!0);break;case 12:this.ui.list.focus(yr.NextPage),this.canSelectMany&&this.ui.list.domFocus(),dn.stop(e,!0);break;case 11:this.ui.list.focus(yr.PreviousPage),this.canSelectMany&&this.ui.list.domFocus(),dn.stop(e,!0);break;case 17:if(!this._canAcceptInBackground||!this.ui.inputBox.isSelectionAtEnd())return;this.activeItems[0]&&(this._selectedItems=[this.activeItems[0]],this.onDidChangeSelectionEmitter.fire(this.selectedItems),this.handleAccept(!0));break;case 14:(e.ctrlKey||e.metaKey)&&!e.shiftKey&&!e.altKey&&(this.ui.list.focus(yr.First),dn.stop(e,!0));break;case 13:(e.ctrlKey||e.metaKey)&&!e.shiftKey&&!e.altKey&&(this.ui.list.focus(yr.Last),dn.stop(e,!0));break}})),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.ui.list.onDidChangeFocus(e=>{this.activeItemsUpdated||this.activeItemsToConfirm!==this._activeItems&&Lo(e,this._activeItems,(t,n)=>t===n)||(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&&Lo(e,this._selectedItems,(n,o)=>n===o)||(this._selectedItems=e,this.onDidChangeSelectionEmitter.fire(e),e.length&&this.handleAccept(t instanceof MouseEvent&&t.button===1))})),this.visibleDisposables.add(this.ui.list.onChangedCheckedElements(e=>{!this.canSelectMany||this.selectedItemsToConfirm!==this._selectedItems&&Lo(e,this._selectedItems,(t,n)=>t===n)||(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 ke(this.ui.container,et.KEY_UP,e=>{if(this.canSelectMany||!this._quickNavigate)return;const t=new Pi(e),n=t.keyCode;this._quickNavigate.keybindings.some(s=>{const a=s.getChords();return a.length>1?!1:a[0].shiftKey&&n===4?!(t.ctrlKey||t.altKey||t.metaKey):!!(a[0].altKey&&n===6||a[0].ctrlKey&&n===5||a[0].metaKey&&n===57)})&&(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,n={title:!!this.title||!!this.step||!!this.buttons.length,description:t,checkAll:this.canSelectMany&&!this._hideCheckAll,checkBox:this.canSelectMany,inputBox:!this._hideInput,progressBar:!this._hideInput||t,visibleCount:!0,count:this.canSelectMany&&!this._hideCountBadge,ok:this.ok==="default"?this.canSelectMany:this.ok,list:!0,message:!!this.validationMessage,customButton:this.customButton};this.ui.setVisibilities(n),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 o=this.ariaLabel;if(!o&&n.inputBox&&(o=this.placeholder||Sk.DEFAULT_ARIA_LABEL,this.title&&(o+=` - ${this.title}`)),this.ui.list.ariaLabel!==o&&(this.ui.list.ariaLabel=o!=null?o: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)switch(this.itemsUpdated=!1,this.ui.list.setElements(this.items),this.ui.list.filter(this.filterValue(this.ui.inputBox.value)),this.ui.checkAll.checked=this.ui.list.getAllVisibleChecked(),this.ui.visibleCount.setCount(this.ui.list.getVisibleCount()),this.ui.count.setCount(this.ui.list.getCheckedCount()),this._itemActivation){case md.NONE:this._itemActivation=md.FIRST;break;case md.SECOND:this.ui.list.focus(yr.Second),this._itemActivation=md.FIRST;break;case md.LAST:this.ui.list.focus(yr.Last),this._itemActivation=md.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||"",n.inputBox||(this.ui.list.domFocus(),this.canSelectMany&&this.ui.list.focus(yr.First)),this.keepScrollPosition&&(this.scrollTop=e)}}Sk.DEFAULT_ARIA_LABEL=C("quickInputBox.ariaLabel","Type to narrow down results.");class Tft extends aT{constructor(){super(...arguments),this._value="",this.valueSelectionUpdated=!0,this._password=!1,this.onDidValueChangeEmitter=this._register(new le),this.onDidAcceptEmitter=this._register(new le),this.onDidChangeValue=this.onDidValueChangeEmitter.event,this.onDidAccept=this.onDidAcceptEmitter.event}get value(){return this._value}set value(e){this._value=e||"",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()}show(){this.visible||(this.visibleDisposables.add(this.ui.inputBox.onDidChange(e=>{e!==this.value&&(this._value=e,this.onDidValueChangeEmitter.fire(e))})),this.visibleDisposables.add(this.ui.onDidAccept(()=>this.onDidAcceptEmitter.fire())),this.valueSelectionUpdated=!0),super.show()}update(){if(!this.visible)return;this.ui.container.classList.remove("hidden-input");const e={title:!!this.title||!!this.step||!!this.buttons.length,description:!!this.description||!!this.step,inputBox:!0,message:!0,progressBar:!0};this.ui.setVisibilities(e),super.update(),this.ui.inputBox.value!==this.value&&(this.ui.inputBox.value=this.value),this.valueSelectionUpdated&&(this.valueSelectionUpdated=!1,this.ui.inputBox.select(this._valueSelection&&{start:this._valueSelection[0],end:this._valueSelection[1]})),this.ui.inputBox.placeholder!==(this.placeholder||"")&&(this.ui.inputBox.placeholder=this.placeholder||""),this.ui.inputBox.password!==this.password&&(this.ui.inputBox.password=this.password)}}const Ga=He;class U5 extends _e{constructor(e,t){super(),this.options=e,this.themeService=t,this.enabled=!0,this.onDidAcceptEmitter=this._register(new le),this.onDidCustomEmitter=this._register(new le),this.onDidTriggerButtonEmitter=this._register(new le),this.keyMods={ctrlCmd:!1,alt:!1},this.controller=null,this.onShowEmitter=this._register(new le),this.onShow=this.onShowEmitter.event,this.onHideEmitter=this._register(new le),this.onHide=this.onHideEmitter.event,this.idPrefix=e.idPrefix,this.parentElement=e.container,this.styles=e.styles,this.registerKeyModsListeners()}registerKeyModsListeners(){const e=t=>{this.keyMods.ctrlCmd=t.ctrlKey||t.metaKey,this.keyMods.alt=t.altKey};this._register(ke(window,et.KEY_DOWN,e,!0)),this._register(ke(window,et.KEY_UP,e,!0)),this._register(ke(window,et.MOUSE_DOWN,e,!0))}getUI(){if(this.ui)return this.ui;const e=Ae(this.parentElement,Ga(".quick-input-widget.show-file-icons"));e.tabIndex=-1,e.style.display="none";const t=Bc(e),n=Ae(e,Ga(".quick-input-titlebar")),o=this.options.hoverDelegate?{hoverDelegate:this.options.hoverDelegate}:void 0,r=this._register(new $c(n,o));r.domNode.classList.add("quick-input-left-action-bar");const s=Ae(n,Ga(".quick-input-title")),a=this._register(new $c(n,o));a.domNode.classList.add("quick-input-right-action-bar");const l=Ae(e,Ga(".quick-input-header")),c=Ae(l,Ga("input.quick-input-check-all"));c.type="checkbox",c.setAttribute("aria-label",C("quickInput.checkAll","Toggle all checkboxes")),this._register(No(c,et.CHANGE,N=>{const M=c.checked;A.setAllVisibleChecked(M)})),this._register(ke(c,et.CLICK,N=>{(N.x||N.y)&&f.setFocus()}));const u=Ae(l,Ga(".quick-input-description")),d=Ae(l,Ga(".quick-input-and-message")),h=Ae(d,Ga(".quick-input-filter")),f=this._register(new hft(h,this.styles.inputBox,this.styles.toggle));f.setAttribute("aria-describedby",`${this.idPrefix}message`);const g=Ae(h,Ga(".quick-input-visible-count"));g.setAttribute("aria-live","polite"),g.setAttribute("aria-atomic","true");const p=new x$(g,{countFormat:C({key:"quickInput.visibleCount",comment:["This tells the user how many items are shown in a list of items to select from. The items can be anything. Currently not visible, but read by screen readers."]},"{0} Results")},this.styles.countBadge),v=Ae(h,Ga(".quick-input-count"));v.setAttribute("aria-live","polite");const m=new x$(v,{countFormat:C({key:"quickInput.countSelected",comment:["This tells the user how many items are selected in a list of items to select from. The items can be anything."]},"{0} Selected")},this.styles.countBadge),_=Ae(l,Ga(".quick-input-action")),w=this._register(new S$(_,this.styles.button));w.label=C("ok","OK"),this._register(w.onDidClick(N=>{this.onDidAcceptEmitter.fire()}));const y=Ae(l,Ga(".quick-input-action")),L=this._register(new S$(y,this.styles.button));L.label=C("custom","Custom"),this._register(L.onDidClick(N=>{this.onDidCustomEmitter.fire()}));const D=Ae(d,Ga(`#${this.idPrefix}message.quick-input-message`)),E=this._register(new z5(e,this.styles.progressBar));E.getContainer().classList.add("quick-input-progress");const I=Ae(e,Ga(".quick-input-html-widget"));I.tabIndex=-1;const k=Ae(e,Ga(".quick-input-description")),R=this.idPrefix+"list",A=this._register(new TX(e,R,this.options,this.themeService));f.setAttribute("aria-controls",R),this._register(A.onDidChangeFocus(()=>{var N;f.setAttribute("aria-activedescendant",(N=A.getActiveDescendant())!==null&&N!==void 0?N:"")})),this._register(A.onChangedAllVisibleChecked(N=>{c.checked=N})),this._register(A.onChangedVisibleCount(N=>{p.setCount(N)})),this._register(A.onChangedCheckedCount(N=>{m.setCount(N)})),this._register(A.onLeave(()=>{setTimeout(()=>{f.setFocus(),this.controller instanceof Sk&&this.controller.canSelectMany&&A.clearFocus()},0)}));const P=gf(e);return this._register(P),this._register(ke(e,et.FOCUS,N=>{os(N.relatedTarget,e)||(this.previousFocusElement=N.relatedTarget instanceof HTMLElement?N.relatedTarget:void 0)},!0)),this._register(P.onDidBlur(()=>{!this.getUI().ignoreFocusOut&&!this.options.ignoreFocusOut()&&this.hide(yk.Blur),this.previousFocusElement=void 0})),this._register(ke(e,et.FOCUS,N=>{f.setFocus()})),this._register(No(e,et.KEY_DOWN,N=>{if(!os(N.target,I))switch(N.keyCode){case 3:dn.stop(N,!0),this.enabled&&this.onDidAcceptEmitter.fire();break;case 9:dn.stop(N,!0),this.hide(yk.Gesture);break;case 2:if(!N.altKey&&!N.ctrlKey&&!N.metaKey){const M=[".quick-input-list .monaco-action-bar .always-visible",".quick-input-list-entry:hover .monaco-action-bar",".monaco-list-row.focused .monaco-action-bar"];if(e.classList.contains("show-checkboxes")?M.push("input"):M.push("input[type=text]"),this.getUI().list.isDisplayed()&&M.push(".monaco-list"),this.getUI().message&&M.push(".quick-input-message a"),this.getUI().widget){if(os(N.target,this.getUI().widget))break;M.push(".quick-input-html-widget")}const H=e.querySelectorAll(M.join(", "));N.shiftKey&&N.target===H[0]?(dn.stop(N,!0),A.clearFocus()):!N.shiftKey&&os(N.target,H[H.length-1])&&(dn.stop(N,!0),H[0].focus())}break;case 10:N.ctrlKey&&(dn.stop(N,!0),this.getUI().list.toggleHover());break}})),this.ui={container:e,styleSheet:t,leftActionBar:r,titleBar:n,title:s,description1:k,description2:u,widget:I,rightActionBar:a,checkAll:c,inputContainer:d,filterContainer:h,inputBox:f,visibleCountContainer:g,visibleCount:p,countContainer:v,count:m,okContainer:_,ok:w,message:D,customButtonContainer:y,customButton:L,list:A,progressBar:E,onDidAccept:this.onDidAcceptEmitter.event,onDidCustom:this.onDidCustomEmitter.event,onDidTriggerButton:this.onDidTriggerButtonEmitter.event,ignoreFocusOut:!1,keyMods:this.keyMods,show:N=>this.show(N),hide:()=>this.hide(),setVisibilities:N=>this.setVisibilities(N),setEnabled:N=>this.setEnabled(N),setContextKey:N=>this.options.setContextKey(N),linkOpenerDelegate:N=>this.options.linkOpenerDelegate(N)},this.updateStyles(),this.ui}pick(e,t={},n=_n.None){return new Promise((o,r)=>{let s=u=>{var d;s=o,(d=t.onKeyMods)===null||d===void 0||d.call(t,a.keyMods),o(u)};if(n.isCancellationRequested){s(void 0);return}const a=this.createQuickPick();let l;const c=[a,a.onDidAccept(()=>{if(a.canSelectMany)s(a.selectedItems.slice()),a.hide();else{const u=a.activeItems[0];u&&(s(u),a.hide())}}),a.onDidChangeActive(u=>{const d=u[0];d&&t.onDidFocus&&t.onDidFocus(d)}),a.onDidChangeSelection(u=>{if(!a.canSelectMany){const d=u[0];d&&(s(d),a.hide())}}),a.onDidTriggerItemButton(u=>t.onDidTriggerItemButton&&t.onDidTriggerItemButton(Object.assign(Object.assign({},u),{removeItem:()=>{const d=a.items.indexOf(u.item);if(d!==-1){const h=a.items.slice(),f=h.splice(d,1),g=a.activeItems.filter(v=>v!==f[0]),p=a.keepScrollPosition;a.keepScrollPosition=!0,a.items=h,g&&(a.activeItems=g),a.keepScrollPosition=p}}}))),a.onDidTriggerSeparatorButton(u=>{var d;return(d=t.onDidTriggerSeparatorButton)===null||d===void 0?void 0:d.call(t,u)}),a.onDidChangeValue(u=>{l&&!u&&(a.activeItems.length!==1||a.activeItems[0]!==l)&&(a.activeItems=[l])}),n.onCancellationRequested(()=>{a.hide()}),a.onDidHide(()=>{si(c),s(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.autoFocusOnList=t.autoFocusOnList===void 0||t.autoFocusOnList,a.quickNavigate=t.quickNavigate,a.hideInput=!!t.hideInput,a.contextKey=t.contextKey,a.busy=!0,Promise.all([e,t.activeItem]).then(([u,d])=>{l=d,a.busy=!1,a.items=u,a.canSelectMany&&(a.selectedItems=u.filter(h=>h.type!=="separator"&&h.picked)),l&&(a.activeItems=[l])}),a.show(),Promise.resolve(e).then(void 0,u=>{r(u),a.hide()})})}createQuickPick(){const e=this.getUI();return new Sk(e)}createInputBox(){const e=this.getUI();return new Tft(e)}show(e){const t=this.getUI();this.onShowEmitter.fire();const n=this.controller;this.controller=e,n==null||n.didHide(),this.setEnabled(!0),t.leftActionBar.clear(),t.title.textContent="",t.description1.textContent="",t.description2.textContent="",jr(t.widget),t.rightActionBar.clear(),t.checkAll.checked=!1,t.inputBox.placeholder="",t.inputBox.password=!1,t.inputBox.showDecoration(So.Ignore),t.visibleCount.setCount(0),t.count.setCount(0),jr(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 o=this.options.backKeybindingLabel();E$.tooltip=o?C("quickInput.backWithKeybinding","Back ({0})",o):C("quickInput.back","Back"),t.container.style.display="",this.updateLayout(),t.inputBox.setFocus()}setVisibilities(e){const t=this.getUI();t.title.style.display=e.title?"":"none",t.description1.style.display=e.description&&(e.inputBox||e.checkAll)?"":"none",t.description2.style.display=e.description&&!(e.inputBox||e.checkAll)?"":"none",t.checkAll.style.display=e.checkAll?"":"none",t.inputContainer.style.display=e.inputBox?"":"none",t.filterContainer.style.display=e.inputBox?"":"none",t.visibleCountContainer.style.display=e.visibleCount?"":"none",t.countContainer.style.display=e.count?"":"none",t.okContainer.style.display=e.ok?"":"none",t.customButtonContainer.style.display=e.customButton?"":"none",t.message.style.display=e.message?"":"none",t.progressBar.getContainer().style.display=e.progressBar?"":"none",t.list.display(!!e.list),t.container.classList.toggle("show-checkboxes",!!e.checkBox),t.container.classList.toggle("hidden-input",!e.inputBox&&!e.description),this.updateLayout()}setEnabled(e){if(e!==this.enabled){this.enabled=e;for(const t of this.getUI().leftActionBar.viewItems)t.action.enabled=e;for(const t of this.getUI().rightActionBar.viewItems)t.action.enabled=e;this.getUI().checkAll.disabled=!e,this.getUI().inputBox.enabled=e,this.getUI().ok.enabled=e,this.getUI().list.enabled=e}}hide(e){var t,n,o;const r=this.controller;if(!r)return;const s=!os(document.activeElement,(n=(t=this.ui)===null||t===void 0?void 0:t.container)!==null&&n!==void 0?n:null);if(this.controller=null,this.onHideEmitter.fire(),this.getUI().container.style.display="none",!s){let a=this.previousFocusElement;for(;a&&!a.offsetParent;)a=(o=a.parentElement)!==null&&o!==void 0?o:void 0;a!=null&&a.offsetParent?(a.focus(),this.previousFocusElement=void 0):this.options.returnFocus()}r.didHide(e)}layout(e,t){this.dimension=e,this.titleBarOffset=t,this.updateLayout()}updateLayout(){if(this.ui&&this.isDisplayed()){this.ui.container.style.top=`${this.titleBarOffset}px`;const e=this.ui.container.style,t=Math.min(this.dimension.width*.62,U5.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:n,widgetBorder:o,widgetShadow:r}=this.styles.widget;this.ui.titleBar.style.backgroundColor=e!=null?e:"",this.ui.container.style.backgroundColor=t!=null?t:"",this.ui.container.style.color=n!=null?n:"",this.ui.container.style.border=o?`1px solid ${o}`:"",this.ui.container.style.boxShadow=r?`0 0 8px 2px ${r}`:"",this.ui.list.style(this.styles.list);const s=[];this.styles.pickerGroup.pickerGroupBorder&&s.push(`.quick-input-list .quick-input-list-entry { border-top-color: ${this.styles.pickerGroup.pickerGroupBorder}; }`),this.styles.pickerGroup.pickerGroupForeground&&s.push(`.quick-input-list .quick-input-list-separator { color: ${this.styles.pickerGroup.pickerGroupForeground}; }`),this.styles.pickerGroup.pickerGroupForeground&&s.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)&&(s.push(".quick-input-list .monaco-keybinding > .monaco-keybinding-key {"),this.styles.keybindingLabel.keybindingLabelBackground&&s.push(`background-color: ${this.styles.keybindingLabel.keybindingLabelBackground};`),this.styles.keybindingLabel.keybindingLabelBorder&&s.push(`border-color: ${this.styles.keybindingLabel.keybindingLabelBorder};`),this.styles.keybindingLabel.keybindingLabelBottomBorder&&s.push(`border-bottom-color: ${this.styles.keybindingLabel.keybindingLabelBottomBorder};`),this.styles.keybindingLabel.keybindingLabelShadow&&s.push(`box-shadow: inset 0 -1px 0 ${this.styles.keybindingLabel.keybindingLabelShadow};`),this.styles.keybindingLabel.keybindingLabelForeground&&s.push(`color: ${this.styles.keybindingLabel.keybindingLabelForeground};`),s.push("}"));const a=s.join(` -`);a!==this.ui.styleSheet.textContent&&(this.ui.styleSheet.textContent=a)}}isDisplayed(){return this.ui&&this.ui.container.style.display!=="none"}}U5.MAX_WIDTH=600;var Nft=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},O2=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let D$=class extends dot{get controller(){return this._controller||(this._controller=this._register(this.createController())),this._controller}get hasController(){return!!this._controller}get quickAccess(){return this._quickAccess||(this._quickAccess=this._register(this.instantiationService.createInstance(y$))),this._quickAccess}constructor(e,t,n,o){super(n),this.instantiationService=e,this.contextKeyService=t,this.layoutService=o,this._onShow=this._register(new le),this._onHide=this._register(new le),this.contexts=new Map}createController(e=this.layoutService,t){const n={idPrefix:"quickInput_",container:e.container,ignoreFocusOut:()=>!1,backKeybindingLabel:()=>{},setContextKey:r=>this.setContextKey(r),linkOpenerDelegate:r=>{this.instantiationService.invokeFunction(s=>{s.get(pl).open(r,{allowCommands:!0,fromUserGesture:!0})})},returnFocus:()=>e.focus(),createList:(r,s,a,l,c)=>this.instantiationService.createInstance(b$,r,s,a,l,c),styles:this.computeStyles()},o=this._register(new U5(Object.assign(Object.assign({},n),t),this.themeService));return o.layout(e.dimension,e.offset.quickPickTop),this._register(e.onDidLayout(r=>o.layout(r,e.offset.quickPickTop))),this._register(o.onShow(()=>{this.resetContextKeys(),this._onShow.fire()})),this._register(o.onHide(()=>{this.resetContextKeys(),this._onHide.fire()})),o}setContextKey(e){let t;e&&(t=this.contexts.get(e),t||(t=new lt(e,!1).bindTo(this.contextKeyService),this.contexts.set(e,t))),!(t&&t.get())&&(this.resetContextKeys(),t==null||t.set(!0))}resetContextKeys(){this.contexts.forEach(e=>{e.get()&&e.reset()})}pick(e,t={},n=_n.None){return this.controller.pick(e,t,n)}createQuickPick(){return this.controller.createQuickPick()}createInputBox(){return this.controller.createInputBox()}updateStyles(){this.hasController&&this.controller.applyStyles(this.computeStyles())}computeStyles(){return{widget:{quickInputBackground:ct(vre),quickInputForeground:ct(vnt),quickInputTitleBackground:ct(_nt),widgetBorder:ct(gG),widgetShadow:ct(Kh)},inputBox:AP,toggle:MP,countBadge:W1e,button:Wdt,progressBar:Vdt,keybindingLabel:Bdt,list:SS({listBackground:vre,listFocusBackground:h0,listFocusForeground:d0,listInactiveFocusForeground:d0,listInactiveSelectionIconForeground:AC,listInactiveFocusBackground:h0,listFocusOutline:Wi,listInactiveFocusOutline:Wi}),pickerGroup:{pickerGroupBorder:ct(bnt),pickerGroupForeground:ct(Z0e)}}}};D$=Nft([O2(0,$t),O2(1,Ut),O2(2,mr),O2(3,yS)],D$);var gCe=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},qC=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let k$=class extends D${constructor(e,t,n,o,r){super(t,n,o,new AH(e.getContainerDomNode(),r)),this.host=void 0;const s=Ay.get(e);if(s){const a=s.widget;this.host={_serviceBrand:void 0,get hasContainer(){return!0},get container(){return a.getDomNode()},get dimension(){return e.getLayoutInfo()},get onDidLayout(){return e.onDidLayoutChange},focus:()=>e.focus(),offset:{top:0,quickPickTop:0}}}else this.host=void 0}createController(){return super.createController(this.host)}};k$=gCe([qC(1,$t),qC(2,Ut),qC(3,mr),qC(4,Jn)],k$);let I$=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 n=t=this.instantiationService.createInstance(k$,e);this.mapEditorToService.set(e,t),_v(e.onDidDispose)(()=>{n.dispose(),this.mapEditorToService.delete(e)})}return t}get quickAccess(){return this.activeService.quickAccess}constructor(e,t){this.instantiationService=e,this.codeEditorService=t,this.mapEditorToService=new Map}pick(e,t={},n=_n.None){return this.activeService.pick(e,t,n)}createQuickPick(){return this.activeService.createQuickPick()}createInputBox(){return this.activeService.createInputBox()}};I$=gCe([qC(0,$t),qC(1,Jn)],I$);class Ay{static get(e){return e.getContribution(Ay.ID)}constructor(e){this.editor=e,this.widget=new j5(this.editor)}dispose(){this.widget.dispose()}}Ay.ID="editor.controller.quickInput";class j5{constructor(e){this.codeEditor=e,this.domNode=document.createElement("div"),this.codeEditor.addOverlayWidget(this)}getId(){return j5.ID}getDomNode(){return this.domNode}getPosition(){return{preference:2}}dispose(){this.codeEditor.removeOverlayWidget(this)}}j5.ID="editor.contrib.quickInputWidget";zn(Ay.ID,Ay,4);class Rft{constructor(e,t,n,o,r){this._parsedThemeRuleBrand=void 0,this.token=e,this.index=t,this.fontStyle=n,this.foreground=o,this.background=r}}function Mft(i){if(!i||!Array.isArray(i))return[];const e=[];let t=0;for(let n=0,o=i.length;n{const h=Wft(u.token,d.token);return h!==0?h:u.index-d.index});let t=0,n="000000",o="ffffff";for(;i.length>=1&&i[0].token==="";){const u=i.shift();u.fontStyle!==-1&&(t=u.fontStyle),u.foreground!==null&&(n=u.foreground),u.background!==null&&(o=u.background)}const r=new Oft;for(const u of e)r.getId(u);const s=r.getId(n),a=r.getId(o),l=new NX(t,s,a),c=new RX(l);for(let u=0,d=i.length;u>>0,this._cache.set(t,n)}return(n|e<<0)>>>0}}const Fft=/\b(comment|string|regex|regexp)\b/;function Bft(i){const e=i.match(Fft);if(!e)return 0;switch(e[1]){case"comment":return 1;case"string":return 2;case"regex":return 3;case"regexp":return 3}throw new Error("Unexpected match for standard token type!")}function Wft(i,e){return ie?1:0}class NX{constructor(e,t,n){this._themeTrieElementRuleBrand=void 0,this._fontStyle=e,this._foreground=t,this._background=n,this.metadata=(this._fontStyle<<11|this._foreground<<15|this._background<<24)>>>0}clone(){return new NX(this._fontStyle,this._foreground,this._background)}acceptOverwrite(e,t,n){e!==-1&&(this._fontStyle=e),t!==0&&(this._foreground=t),n!==0&&(this._background=n),this.metadata=(this._fontStyle<<11|this._foreground<<15|this._background<<24)>>>0}}class RX{constructor(e){this._themeTrieElementBrand=void 0,this._mainRule=e,this._children=new Map}match(e){if(e==="")return this._mainRule;const t=e.indexOf(".");let n,o;t===-1?(n=e,o=""):(n=e.substring(0,t),o=e.substring(t+1));const r=this._children.get(n);return typeof r!="undefined"?r.match(o):this._mainRule}insert(e,t,n,o){if(e===""){this._mainRule.acceptOverwrite(t,n,o);return}const r=e.indexOf(".");let s,a;r===-1?(s=e,a=""):(s=e.substring(0,r),a=e.substring(r+1));let l=this._children.get(s);typeof l=="undefined"&&(l=new RX(this._mainRule.clone()),this._children.set(s,l)),l.insert(a,t,n,o)}}function Vft(i){const e=[];for(let t=1,n=i.length;t({format:o.format,location:o.location.toString()}))}}i.toJSONObject=e;function t(n){const o=r=>aa(r)?r:void 0;if(n&&Array.isArray(n.src)&&n.src.every(r=>aa(r.format)&&aa(r.location)))return{weight:o(n.weight),style:o(n.style),src:n.src.map(r=>({format:r.format,location:Rt.parse(r.location)}))}}i.fromJSONObject=t})(Iae||(Iae={}));class Kft{constructor(){this._onDidChange=new le,this.onDidChange=this._onDidChange.event,this.iconSchema={definitions:{icons:{type:"object",properties:{fontId:{type:"string",description:C("iconDefinition.fontId","The id of the font to use. If not set, the font that is defined first is used.")},fontCharacter:{type:"string",description:C("iconDefinition.fontCharacter","The font character associated with the icon definition.")}},additionalProperties:!1,defaultSnippets:[{body:{fontCharacter:"\\\\e030"}}]}},type:"object",properties:{}},this.iconReferenceSchema={type:"string",pattern:`^${Mt.iconNameExpression}$`,enum:[],enumDescriptions:[]},this.iconsById={},this.iconFontsById={}}registerIcon(e,t,n,o){const r=this.iconsById[e];if(r){if(n&&!r.description){r.description=n,this.iconSchema.properties[e].markdownDescription=`${n} $(${e})`;const l=this.iconReferenceSchema.enum.indexOf(e);l!==-1&&(this.iconReferenceSchema.enumDescriptions[l]=n),this._onDidChange.fire()}return r}const s={id:e,description:n,defaults:t,deprecationMessage:o};this.iconsById[e]=s;const a={$ref:"#/definitions/icons"};return o&&(a.deprecationMessage=o),n&&(a.markdownDescription=`${n}: $(${e})`),this.iconSchema.properties[e]=a,this.iconReferenceSchema.enum.push(e),this.iconReferenceSchema.enumDescriptions.push(n||""),this._onDidChange.fire(),{id:e}}getIcons(){return Object.keys(this.iconsById).map(e=>this.iconsById[e])}getIcon(e){return this.iconsById[e]}getIconSchema(){return this.iconSchema}toString(){const e=(r,s)=>r.id.localeCompare(s.id),t=r=>{for(;Mt.isThemeIcon(r.defaults);)r=this.iconsById[r.defaults.id];return`codicon codicon-${r?r.id:""}`},n=[];n.push("| preview | identifier | default codicon ID | description"),n.push("| ----------- | --------------------------------- | --------------------------------- | --------------------------------- |");const o=Object.keys(this.iconsById).map(r=>this.iconsById[r]);for(const r of o.filter(s=>!!s.description).sort(e))n.push(`||${r.id}|${Mt.isThemeIcon(r.defaults)?r.defaults.id:r.id}|${r.description||""}|`);n.push("| preview | identifier "),n.push("| ----------- | --------------------------------- |");for(const r of o.filter(s=>!Mt.isThemeIcon(s.defaults)).sort(e))n.push(`||${r.id}|`);return n.join(` -`)}}const qb=new Kft;no.add(jft.IconContribution,qb);function Eo(i,e,t,n){return qb.registerIcon(i,e,t,n)}function mCe(){return qb}function qft(){const i=I_e();for(const e in i){const t="\\"+i[e].toString(16);qb.registerIcon(e,{fontCharacter:t})}}qft();const vCe="vscode://schemas/icons",_Ce=no.as(a5.JSONContribution);_Ce.registerSchema(vCe,qb.getIconSchema());const Tae=new bi(()=>_Ce.notifySchemaChanged(vCe),200);qb.onDidChange(()=>{Tae.isScheduled()||Tae.schedule()});const bCe=Eo("widget-close",Xe.close,C("widgetClose","Icon for the close action in widgets."));Eo("goto-previous-location",Xe.arrowUp,C("previousChangeIcon","Icon for goto previous editor location."));Eo("goto-next-location",Xe.arrowDown,C("nextChangeIcon","Icon for goto next editor location."));Mt.modify(Xe.sync,"spin");Mt.modify(Xe.loading,"spin");function Gft(i){const e=new Be,t=e.add(new le),n=mCe();return e.add(n.onDidChange(()=>t.fire())),i&&e.add(i.onDidProductIconThemeChange(()=>t.fire())),{dispose:()=>e.dispose(),onDidChange:t.event,getCSS(){const o=i?i.getProductIconTheme():new CCe,r={},s=l=>{const c=o.getIcon(l);if(!c)return;const u=c.font;return u?(r[u.id]=u.definition,`.codicon-${l.id}:before { content: '${c.fontCharacter}'; font-family: ${Soe(u.id)}; }`):`.codicon-${l.id}:before { content: '${c.fontCharacter}'; }`},a=[];for(const l of n.getIcons()){const c=s(l);c&&a.push(c)}for(const l in r){const c=r[l],u=c.weight?`font-weight: ${c.weight};`:"",d=c.style?`font-style: ${c.style};`:"",h=c.src.map(f=>`${Cv(f.location)} format('${f.format}')`).join(", ");a.push(`@font-face { src: ${h}; font-family: ${Soe(l)};${u}${d} font-display: block; }`)}return a.join(` -`)}}}class CCe{getIcon(e){const t=mCe();let n=e.defaults;for(;Mt.isThemeIcon(n);){const o=t.getIcon(n.id);if(!o)return;n=o.defaults}return n}}const Dg="vs",Ow="vs-dark",N0="hc-black",R0="hc-light",wCe=no.as(q0e.ColorContribution),Xft=no.as(ube.ThemingContribution);class yCe{constructor(e,t){this.semanticHighlighting=!1,this.themeData=t;const n=t.base;e.length>0?(bM(e)?this.id=e:this.id=n+" "+e,this.themeName=e):(this.id=n,this.themeName=n),this.colors=null,this.defaultColors=Object.create(null),this._tokenTheme=null}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,ve.fromHex(this.themeData.colors[t]));if(this.themeData.inherit){const t=T$(this.themeData.base);for(const n in t.colors)e.has(n)||e.set(n,ve.fromHex(t.colors[n]))}this.colors=e}return this.colors}getColor(e,t){const n=this.getColors().get(e);if(n)return n;if(t!==!1)return this.getDefault(e)}getDefault(e){let t=this.defaultColors[e];return t||(t=wCe.resolveDefaultColor(e,this),this.defaultColors[e]=t,t)}defines(e){return this.getColors().has(e)}get type(){switch(this.base){case Dg:return kc.LIGHT;case N0:return kc.HIGH_CONTRAST_DARK;case R0:return kc.HIGH_CONTRAST_LIGHT;default:return kc.DARK}}get tokenTheme(){if(!this._tokenTheme){let e=[],t=[];if(this.themeData.inherit){const r=T$(this.themeData.base);e=r.rules,r.encodedTokensColors&&(t=r.encodedTokensColors)}const n=this.themeData.colors["editor.foreground"],o=this.themeData.colors["editor.background"];if(n||o){const r={token:""};n&&(r.foreground=n),o&&(r.background=o),e.push(r)}e=e.concat(this.themeData.rules),this.themeData.encodedTokensColors&&(t=this.themeData.encodedTokensColors),this._tokenTheme=pCe.createFromRawTokenTheme(e,t)}return this._tokenTheme}getTokenStyleMetadata(e,t,n){const r=this.tokenTheme._match([e].concat(t).join(".")).metadata,s=ns.getForeground(r),a=ns.getFontStyle(r);return{foreground:s,italic:Boolean(a&1),bold:Boolean(a&2),underline:Boolean(a&4),strikethrough:Boolean(a&8)}}}function bM(i){return i===Dg||i===Ow||i===N0||i===R0}function T$(i){switch(i){case Dg:return Hft;case Ow:return $ft;case N0:return zft;case R0:return Uft}}function F2(i){const e=T$(i);return new yCe(i,e)}class Yft extends _e{constructor(){super(),this._onColorThemeChange=this._register(new le),this.onDidColorThemeChange=this._onColorThemeChange.event,this._onProductIconThemeChange=this._register(new le),this.onDidProductIconThemeChange=this._onProductIconThemeChange.event,this._environment=Object.create(null),this._builtInProductIconTheme=new CCe,this._autoDetectHighContrast=!0,this._knownThemes=new Map,this._knownThemes.set(Dg,F2(Dg)),this._knownThemes.set(Ow,F2(Ow)),this._knownThemes.set(N0,F2(N0)),this._knownThemes.set(R0,F2(R0));const e=this._register(Gft(this));this._codiconCSS=e.getCSS(),this._themeCSS="",this._allCSS=`${this._codiconCSS} -${this._themeCSS}`,this._globalStyleElement=null,this._styleElements=[],this._colorMapOverride=null,this.setTheme(Dg),this._onOSSchemeChanged(),this._register(e.onDidChange(()=>{this._codiconCSS=e.getCSS(),this._updateCSS()})),V_e("(forced-colors: active)",()=>{this._onOSSchemeChanged()})}registerEditorContainer(e){return UA(e)?this._registerShadowDomContainer(e):this._registerRegularEditorContainer()}_registerRegularEditorContainer(){return this._globalStyleElement||(this._globalStyleElement=Bc(void 0,e=>{e.className="monaco-colors",e.textContent=this._allCSS}),this._styleElements.push(this._globalStyleElement)),_e.None}_registerShadowDomContainer(e){const t=Bc(e,n=>{n.className="monaco-colors",n.textContent=this._allCSS});return this._styleElements.push(t),{dispose:()=>{for(let n=0;n{n.base===e&&n.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(Dg),this._updateActualTheme(t)}_updateActualTheme(e){!e||this._theme===e||(this._theme=e,this._updateThemeOrColorMap())}_onOSSchemeChanged(){if(this._autoDetectHighContrast){const e=window.matchMedia("(forced-colors: active)").matches;if(e!==Hd(this._theme.type)){let t;Sy(this._theme.type)?t=e?N0:Ow:t=e?R0:Dg,this._updateActualTheme(this._knownThemes.get(t))}}}setAutoDetectHighContrast(e){this._autoDetectHighContrast=e,this._onOSSchemeChanged()}_updateThemeOrColorMap(){const e=[],t={},n={addRule:s=>{t[s]||(e.push(s),t[s]=!0)}};Xft.getThemingParticipants().forEach(s=>s(this._theme,n,this._environment));const o=[];for(const s of wCe.getColors()){const a=this._theme.getColor(s.id,!0);a&&o.push(`${fG(s.id)}: ${a.toString()};`)}n.addRule(`.monaco-editor, .monaco-diff-editor { ${o.join(` -`)} }`);const r=this._colorMapOverride||this._theme.tokenTheme.getColorMap();n.addRule(Vft(r)),this._themeCSS=e.join(` +`),this.list.style(e)}getSelectedElements(){return this.list.getSelectedElements()}getSelection(){return this.list.getSelection()}getFocus(){return this.list.getFocus()}dispose(){this.disposables.dispose()}}F5.InstanceCount=0;class ES extends Uu{constructor(e){super(),this._onChange=this._register(new le),this.onChange=this._onChange.event,this._onKeyDown=this._register(new le),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(...Mt.asClassNameArray(this._icon))),this._opts.actionClassName&&t.push(...this._opts.actionClassName.split(" ")),this._checked&&t.push("checked"),this.domNode=document.createElement("div"),this.domNode.title=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,n=>{this.enabled&&(this.checked=!this._checked,this._onChange.fire(!1),n.preventDefault())}),this._register(this.ignoreGesture(this.domNode)),this.onkeydown(this.domNode,n=>{if(n.keyCode===10||n.keyCode===3){this.checked=!this._checked,this._onChange.fire(!0),n.preventDefault(),n.stopPropagation();return}this._onKeyDown.fire(n)})}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()}width(){return 2+2+2+16}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))}}const Lht=C("caseDescription","Match Case"),Eht=C("wordsDescription","Match Whole Word"),Dht=C("regexDescription","Use Regular Expression");class eCe extends ES{constructor(e){super({icon:Xe.caseSensitive,title:Lht+e.appendTitle,isChecked:e.isChecked,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class tCe extends ES{constructor(e){super({icon:Xe.wholeWord,title:Eht+e.appendTitle,isChecked:e.isChecked,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class nCe extends ES{constructor(e){super({icon:Xe.regex,title:Dht+e.appendTitle,isChecked:e.isChecked,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class kht{constructor(e,t=0,n=e.length,o=t-1){this.items=e,this.start=t,this.end=n,this.index=o}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 Iht{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()}isLast(){return this._currentPosition()>=this._elements.length-1}isNowhere(){return this._navigator.current()===null}has(e){return this._history.has(e)}_onChange(){this._reduceToLimit();const e=this._elements;this._navigator=new kht(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}}const Ux=He;class Tht extends Uu{constructor(e,t,n){var o;super(),this.state="idle",this.maxHeight=Number.POSITIVE_INFINITY,this._onDidChange=this._register(new le),this.onDidChange=this._onDidChange.event,this._onDidHeightChange=this._register(new le),this.onDidHeightChange=this._onDidHeightChange.event,this.contextViewProvider=t,this.options=n,this.message=null,this.placeholder=this.options.placeholder||"",this.tooltip=(o=this.options.tooltip)!==null&&o!==void 0?o:this.placeholder||"",this.ariaLabel=this.options.ariaLabel||"",this.options.validationOptions&&(this.validation=this.options.validationOptions.validation),this.element=Ae(e,Ux(".monaco-inputbox.idle"));const r=this.options.flexibleHeight?"textarea":"input",s=Ae(this.element,Ux(".ibwrapper"));if(this.input=Ae(s,Ux(r+".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=Ae(s,Ux("div.mirror")),this.mirror.innerText="\xA0",this.scrollableElement=new vbe(this.element,{vertical:1}),this.options.flexibleWidth&&(this.input.setAttribute("wrap","off"),this.mirror.style.whiteSpace="pre",this.mirror.style.wordWrap="initial"),Ae(e,this.scrollableElement.getDomNode()),this._register(this.scrollableElement),this._register(this.scrollableElement.onScroll(c=>this.input.scrollTop=c.scrollTop));const a=this._register(new xn(document,"selectionchange")),l=st.filter(a.event,()=>{const c=document.getSelection();return(c==null?void 0:c.anchorNode)===s});this._register(l(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 zc(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.input.title=e}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 height(){return typeof this.cachedHeight=="number"?this.cachedHeight:u0(this.element)}focus(){this.input.focus()}blur(){this.input.blur()}hasFocus(){return document.activeElement===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}enable(){this.input.removeAttribute("disabled")}disable(){this.blur(),this.input.disabled=!0,this._hideMessage()}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,n=this.input.scrollTop;this.scrollableElement.setScrollDimensions({scrollHeight:e,height:t}),this.scrollableElement.setScrollPosition({scrollTop:n})}showMessage(e,t){if(this.state==="open"&&ql(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 n=this.stylesForType(this.message.type);this.element.style.border=`1px solid ${D0(n.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()}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==null?void 0:e.type}stylesForType(e){const t=this.options.inputBoxStyles;switch(e){case 1:return{border:t.inputValidationInfoBorder,background:t.inputValidationInfoBackground,foreground:t.inputValidationInfoForeground};case 2: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 1:return"info";case 2:return"warning";default:return"error"}}_showMessage(){if(!this.contextViewProvider||!this.message)return;let e;const t=()=>e.style.width=Ea(this.element)+"px";this.contextViewProvider.showContextView({getAnchor:()=>this.element,anchorAlignment:1,render:o=>{var r,s;if(!this.message)return null;e=Ae(o,Ux(".monaco-inputbox-container")),t();const a={inline:!0,className:"monaco-inputbox-message"},l=this.message.formatContent?$ut(this.message.content,a):Hut(this.message.content,a);l.classList.add(this.classForType(this.message.type));const c=this.stylesForType(this.message.type);return l.style.backgroundColor=(r=c.background)!==null&&r!==void 0?r:"",l.style.color=(s=c.foreground)!==null&&s!==void 0?s:"",l.style.border=c.border?`1px solid ${c.border}`:"",Ae(e,l),null},onHide:()=>{this.state="closed"},layout:t});let n;this.message.type===3?n=C("alertErrorMessage","Error: {0}",this.message.content):this.message.type===2?n=C("alertWarningMessage","Warning: {0}",this.message.content):n=C("alertInfoMessage","Info: {0}",this.message.content),Cs(n),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,n=e.charCodeAt(e.length-1)===10?" ":"";(e+n).replace(/\u000c/g,"")?this.mirror.textContent=e+n:this.mirror.innerText="\xA0",this.layout()}applyStyles(){var e,t,n;const o=this.options.inputBoxStyles,r=(e=o.inputBackground)!==null&&e!==void 0?e:"",s=(t=o.inputForeground)!==null&&t!==void 0?t:"",a=(n=o.inputBorder)!==null&&n!==void 0?n:"";this.element.style.backgroundColor=r,this.element.style.color=s,this.input.style.backgroundColor="inherit",this.input.style.color=s,this.element.style.border=`1px solid ${D0(a,"transparent")}`}layout(){if(!this.mirror)return;const e=this.cachedContentHeight;this.cachedContentHeight=u0(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,n=t.selectionStart,o=t.selectionEnd,r=t.value;n!==null&&o!==null&&(this.value=r.substr(0,n)+e+r.substr(o),t.setSelectionRange(n+1,n+1),this.layout())}dispose(){var e;this._hideMessage(),this.message=null,(e=this.actionbar)===null||e===void 0||e.dispose(),super.dispose()}}class iCe extends Tht{constructor(e,t,n){const o=C({key:"history.inputbox.hint",comment:["Text will be prefixed with \u21C5 plus a single space, then used as a hint where input field keeps history"]},"for history"),r=` or \u21C5 ${o}`,s=` (\u21C5 ${o})`;super(e,t,n),this._onDidFocus=this._register(new le),this.onDidFocus=this._onDidFocus.event,this._onDidBlur=this._register(new le),this.onDidBlur=this._onDidBlur.event,this.history=new Iht(n.history,100);const a=()=>{if(n.showHistoryHint&&n.showHistoryHint()&&!this.placeholder.endsWith(r)&&!this.placeholder.endsWith(s)&&this.history.getHistory().length){const l=this.placeholder.endsWith(")")?r:s,c=this.placeholder+l;n.showPlaceholderOnFocus&&document.activeElement!==this.input?this.placeholder=c:this.setPlaceHolder(c)}};this.observer=new MutationObserver((l,c)=>{l.forEach(u=>{u.target.textContent||a()})}),this.observer.observe(this.input,{attributeFilter:["class"]}),this.onfocus(this.input,()=>a()),this.onblur(this.input,()=>{const l=c=>{if(this.placeholder.endsWith(c)){const u=this.placeholder.slice(0,this.placeholder.length-c.length);return n.showPlaceholderOnFocus?this.placeholder=u:this.setPlaceHolder(u),!0}else return!1};l(s)||l(r)})}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)}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!=null?e:"",Ev(this.value?this.value:C("clearedInput","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,Ev(this.value))}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()}}const Nht=C("defaultLabel","input");class oCe extends Uu{constructor(e,t,n){super(),this.fixFocusOnOptionClickEnabled=!0,this.imeSessionInProgress=!1,this.additionalTogglesDisposables=this._register(new Kr),this.additionalToggles=[],this._onDidOptionChange=this._register(new le),this.onDidOptionChange=this._onDidOptionChange.event,this._onKeyDown=this._register(new le),this.onKeyDown=this._onKeyDown.event,this._onMouseDown=this._register(new le),this.onMouseDown=this._onMouseDown.event,this._onInput=this._register(new le),this._onKeyUp=this._register(new le),this._onCaseSensitiveKeyDown=this._register(new le),this.onCaseSensitiveKeyDown=this._onCaseSensitiveKeyDown.event,this._onRegexKeyDown=this._register(new le),this.onRegexKeyDown=this._onRegexKeyDown.event,this._lastHighlightFindOptions=0,this.placeholder=n.placeholder||"",this.validation=n.validation,this.label=n.label||Nht,this.showCommonFindToggles=!!n.showCommonFindToggles;const o=n.appendCaseSensitiveLabel||"",r=n.appendWholeWordsLabel||"",s=n.appendRegexLabel||"",a=n.history||[],l=!!n.flexibleHeight,c=!!n.flexibleWidth,u=n.flexibleMaxHeight;if(this.domNode=document.createElement("div"),this.domNode.classList.add("monaco-findInput"),this.inputBox=this._register(new iCe(this.domNode,t,{placeholder:this.placeholder||"",ariaLabel:this.label||"",validationOptions:{validation:this.validation},history:a,showHistoryHint:n.showHistoryHint,flexibleHeight:l,flexibleWidth:c,flexibleMaxHeight:u,inputBoxStyles:n.inputBoxStyles})),this.showCommonFindToggles){this.regex=this._register(new nCe(Object.assign({appendTitle:s,isChecked:!1},n.toggleStyles))),this._register(this.regex.onChange(h=>{this._onDidOptionChange.fire(h),!h&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this._register(this.regex.onKeyDown(h=>{this._onRegexKeyDown.fire(h)})),this.wholeWords=this._register(new tCe(Object.assign({appendTitle:r,isChecked:!1},n.toggleStyles))),this._register(this.wholeWords.onChange(h=>{this._onDidOptionChange.fire(h),!h&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this.caseSensitive=this._register(new eCe(Object.assign({appendTitle:o,isChecked:!1},n.toggleStyles))),this._register(this.caseSensitive.onChange(h=>{this._onDidOptionChange.fire(h),!h&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this._register(this.caseSensitive.onKeyDown(h=>{this._onCaseSensitiveKeyDown.fire(h)}));const d=[this.caseSensitive.domNode,this.wholeWords.domNode,this.regex.domNode];this.onkeydown(this.domNode,h=>{if(h.equals(15)||h.equals(17)||h.equals(9)){const f=d.indexOf(document.activeElement);if(f>=0){let g=-1;h.equals(17)?g=(f+1)%d.length:h.equals(15)&&(f===0?g=d.length-1:g=f-1),h.equals(9)?(d[f].blur(),this.inputBox.focus()):g>=0&&d[g].focus(),dn.stop(h,!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(n==null?void 0:n.additionalToggles),this.controls&&this.domNode.appendChild(this.controls),e==null||e.appendChild(this.domNode),this._register(ke(this.inputBox.inputElement,"compositionstart",d=>{this.imeSessionInProgress=!0})),this._register(ke(this.inputBox.inputElement,"compositionend",d=>{this.imeSessionInProgress=!1,this._onInput.fire()})),this.onkeydown(this.inputBox.inputElement,d=>this._onKeyDown.fire(d)),this.onkeyup(this.inputBox.inputElement,d=>this._onKeyUp.fire(d)),this.oninput(this.inputBox.inputElement,d=>this._onInput.fire()),this.onmousedown(this.inputBox.inputElement,d=>this._onMouseDown.fire(d))}get onDidChange(){return this.inputBox.onDidChange}layout(e){this.inputBox.layout(),this.updateInputBoxPadding(e.collapsedFindWidget)}enable(){var e,t,n;this.domNode.classList.remove("disabled"),this.inputBox.enable(),(e=this.regex)===null||e===void 0||e.enable(),(t=this.wholeWords)===null||t===void 0||t.enable(),(n=this.caseSensitive)===null||n===void 0||n.enable();for(const o of this.additionalToggles)o.enable()}disable(){var e,t,n;this.domNode.classList.add("disabled"),this.inputBox.disable(),(e=this.regex)===null||e===void 0||e.disable(),(t=this.wholeWords)===null||t===void 0||t.disable(),(n=this.caseSensitive)===null||n===void 0||n.disable();for(const o of this.additionalToggles)o.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 Be;for(const t of e!=null?e:[])this.additionalTogglesDisposables.value.add(t),this.controls.appendChild(t.domNode),this.additionalTogglesDisposables.value.add(t.onChange(n=>{this._onDidOptionChange.fire(n),!n&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus()})),this.additionalToggles.push(t);this.additionalToggles.length>0&&(this.controls.style.display=""),this.updateInputBoxPadding()}updateInputBoxPadding(e=!1){var t,n,o,r,s,a;e?this.inputBox.paddingRight=0:this.inputBox.paddingRight=((n=(t=this.caseSensitive)===null||t===void 0?void 0:t.width())!==null&&n!==void 0?n:0)+((r=(o=this.wholeWords)===null||o===void 0?void 0:o.width())!==null&&r!==void 0?r:0)+((a=(s=this.regex)===null||s===void 0?void 0:s.width())!==null&&a!==void 0?a:0)+this.additionalToggles.reduce((l,c)=>l+c.width(),0)}getValue(){return this.inputBox.value}setValue(e){this.inputBox.value!==e&&(this.inputBox.value=e)}select(){this.inputBox.select()}focus(){this.inputBox.focus()}getCaseSensitive(){var e,t;return(t=(e=this.caseSensitive)===null||e===void 0?void 0:e.checked)!==null&&t!==void 0?t:!1}setCaseSensitive(e){this.caseSensitive&&(this.caseSensitive.checked=e)}getWholeWords(){var e,t;return(t=(e=this.wholeWords)===null||e===void 0?void 0:e.checked)!==null&&t!==void 0?t:!1}setWholeWords(e){this.wholeWords&&(this.wholeWords.checked=e)}getRegex(){var e,t;return(t=(e=this.regex)===null||e===void 0?void 0:e.checked)!==null&&t!==void 0?t:!1}setRegex(e){this.regex&&(this.regex.checked=e,this.validate())}focusOnCaseSensitive(){var e;(e=this.caseSensitive)===null||e===void 0||e.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()}}var xh;(function(i){i[i.Expanded=0]="Expanded",i[i.Collapsed=1]="Collapsed",i[i.PreserveOrExpanded=2]="PreserveOrExpanded",i[i.PreserveOrCollapsed=3]="PreserveOrCollapsed"})(xh||(xh={}));var v0;(function(i){i[i.Unknown=0]="Unknown",i[i.Twistie=1]="Twistie",i[i.Element=2]="Element",i[i.Filter=3]="Filter"})(v0||(v0={}));class Ol extends Error{constructor(e,t){super(`TreeError [${e}] ${t}`)}}class CX{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 yX(i){return typeof i=="object"&&"visibility"in i&&"data"in i}function vk(i){switch(i){case!0:return 1;case!1:return 0;default:return i}}function B9(i){return typeof i.collapsible=="boolean"}class Rht{constructor(e,t,n,o={}){this.user=e,this.list=t,this.rootRef=[],this.eventBufferer=new $q,this._onDidChangeCollapseState=new le,this.onDidChangeCollapseState=this.eventBufferer.wrapEvent(this._onDidChangeCollapseState.event),this._onDidChangeRenderNodeCount=new le,this.onDidChangeRenderNodeCount=this.eventBufferer.wrapEvent(this._onDidChangeRenderNodeCount.event),this._onDidSplice=new le,this.onDidSplice=this._onDidSplice.event,this.refilterDelayer=new Wu(S0e),this.collapseByDefault=typeof o.collapseByDefault=="undefined"?!1:o.collapseByDefault,this.filter=o.filter,this.autoExpandSingleChildren=typeof o.autoExpandSingleChildren=="undefined"?!1:o.autoExpandSingleChildren,this.root={parent:void 0,element:n,children:[],depth:0,visibleChildrenCount:0,visibleChildIndex:-1,collapsible:!1,collapsed:!1,renderNodeCount:0,visibility:1,visible:!0,filterData:void 0}}splice(e,t,n=vn.empty(),o={}){if(e.length===0)throw new Ol(this.user,"Invalid tree location");o.diffIdentityProvider?this.spliceSmart(o.diffIdentityProvider,e,t,n,o):this.spliceSimple(e,t,n,o)}spliceSmart(e,t,n,o,r,s){var a;o===void 0&&(o=vn.empty()),s===void 0&&(s=(a=r.diffDepth)!==null&&a!==void 0?a:0);const{parentNode:l}=this.getParentNodeWithListIndex(t);if(!l.lastDiffIds)return this.spliceSimple(t,n,o,r);const c=[...o],u=t[t.length-1],d=new Ah({getElements:()=>l.lastDiffIds},{getElements:()=>[...l.children.slice(0,u),...c,...l.children.slice(u+n)].map(v=>e.getId(v.element).toString())}).ComputeDiff(!1);if(d.quitEarly)return l.lastDiffIds=void 0,this.spliceSimple(t,n,c,r);const h=t.slice(0,-1),f=(v,m,_)=>{if(s>0)for(let y=0;y<_;y++)v--,m--,this.spliceSmart(e,[...h,v,0],Number.MAX_SAFE_INTEGER,c[m].children,r,s-1)};let g=Math.min(l.children.length,u+n),p=c.length;for(const v of d.changes.sort((m,_)=>_.originalStart-m.originalStart))f(g,p,g-(v.originalStart+v.originalLength)),g=v.originalStart,p=v.modifiedStart-u,this.spliceSimple([...h,g],v.originalLength,vn.slice(c,p,p+v.modifiedLength),r);f(g,p,g)}spliceSimple(e,t,n=vn.empty(),{onDidCreateNode:o,onDidDeleteNode:r,diffIdentityProvider:s}){const{parentNode:a,listIndex:l,revealed:c,visible:u}=this.getParentNodeWithListIndex(e),d=[],h=vn.map(n,E=>this.createTreeNode(E,a,a.visible?1:0,c,d,o)),f=e[e.length-1],g=a.children.length>0;let p=0;for(let E=f;E>=0&&Es.getId(E.element).toString())):a.lastDiffIds=a.children.map(E=>s.getId(E.element).toString()):a.lastDiffIds=void 0;let w=0;for(const E of y)E.visible&&w++;if(w!==0)for(let E=f+v.length;EI+(k.visible?k.renderNodeCount:0),0);this._updateAncestorsRenderNodeCount(a,_-E),this.list.splice(l,E,d)}if(y.length>0&&r){const E=I=>{r(I),I.children.forEach(E)};y.forEach(E)}this._onDidSplice.fire({insertedNodes:v,deletedNodes:y});const L=a.children.length>0;g!==L&&this.setCollapsible(e.slice(0,-1),L);let D=a;for(;D;){if(D.visibility===2){this.refilterDelayer.trigger(()=>this.refilter());break}D=D.parent}}rerender(e){if(e.length===0)throw new Ol(this.user,"Invalid tree location");const{node:t,listIndex:n,revealed:o}=this.getTreeNodeWithListIndex(e);t.visible&&o&&this.list.splice(n,1,[t])}has(e){return this.hasTreeNode(e)}getListIndex(e){const{listIndex:t,visible:n,revealed:o}=this.getTreeNodeWithListIndex(e);return n&&o?t:-1}getListRenderCount(e){return this.getTreeNode(e).renderNodeCount}isCollapsible(e){return this.getTreeNode(e).collapsible}setCollapsible(e,t){const n=this.getTreeNode(e);typeof t=="undefined"&&(t=!n.collapsible);const o={collapsible:t};return this.eventBufferer.bufferEvents(()=>this._setCollapseState(e,o))}isCollapsed(e){return this.getTreeNode(e).collapsed}setCollapsed(e,t,n){const o=this.getTreeNode(e);typeof t=="undefined"&&(t=!o.collapsed);const r={collapsed:t,recursive:n||!1};return this.eventBufferer.bufferEvents(()=>this._setCollapseState(e,r))}_setCollapseState(e,t){const{node:n,listIndex:o,revealed:r}=this.getTreeNodeWithListIndex(e),s=this._setListNodeCollapseState(n,o,r,t);if(n!==this.root&&this.autoExpandSingleChildren&&s&&!B9(t)&&n.collapsible&&!n.collapsed&&!t.recursive){let a=-1;for(let l=0;l-1){a=-1;break}else a=l;a>-1&&this._setCollapseState([...e,a],t)}return s}_setListNodeCollapseState(e,t,n,o){const r=this._setNodeCollapseState(e,o,!1);if(!n||!e.visible||!r)return r;const s=e.renderNodeCount,a=this.updateNodeAfterCollapseChange(e),l=s-(t===-1?0:1);return this.list.splice(t+1,l,a.slice(1)),r}_setNodeCollapseState(e,t,n){let o;if(e===this.root?o=!1:(B9(t)?(o=e.collapsible!==t.collapsible,e.collapsible=t.collapsible):e.collapsible?(o=e.collapsed!==t.collapsed,e.collapsed=t.collapsed):o=!1,o&&this._onDidChangeCollapseState.fire({node:e,deep:n})),!B9(t)&&t.recursive)for(const r of e.children)o=this._setNodeCollapseState(r,t,!0)||o;return o}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,n,o,r,s){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!="undefined",collapsed:typeof e.collapsed=="undefined"?this.collapseByDefault:e.collapsed,renderNodeCount:1,visibility:1,visible:!0,filterData:void 0},l=this._filterNode(a,n);a.visibility=l,o&&r.push(a);const c=e.children||vn.empty(),u=o&&l!==0&&!a.collapsed;let d=0,h=1;for(const f of c){const g=this.createTreeNode(f,a,l,u,r,s);a.children.push(g),h+=g.renderNodeCount,g.visible&&(g.visibleChildIndex=d++)}return a.collapsible=a.collapsible||a.children.length>0,a.visibleChildrenCount=d,a.visible=l===2?d>0:l===1,a.visible?a.collapsed||(a.renderNodeCount=h):(a.renderNodeCount=0,o&&r.pop()),s==null||s(a),a}updateNodeAfterCollapseChange(e){const t=e.renderNodeCount,n=[];return this._updateNodeAfterCollapseChange(e,n),this._updateAncestorsRenderNodeCount(e.parent,n.length-t),n}_updateNodeAfterCollapseChange(e,t){if(e.visible===!1)return 0;if(t.push(e),e.renderNodeCount=1,!e.collapsed)for(const n of e.children)e.renderNodeCount+=this._updateNodeAfterCollapseChange(n,t);return this._onDidChangeRenderNodeCount.fire(e),e.renderNodeCount}updateNodeAfterFilterChange(e){const t=e.renderNodeCount,n=[];return this._updateNodeAfterFilterChange(e,e.visible?1:0,n),this._updateAncestorsRenderNodeCount(e.parent,n.length-t),n}_updateNodeAfterFilterChange(e,t,n,o=!0){let r;if(e!==this.root){if(r=this._filterNode(e,t),r===0)return e.visible=!1,e.renderNodeCount=0,!1;o&&n.push(e)}const s=n.length;e.renderNodeCount=e===this.root?0:1;let a=!1;if(!e.collapsed||r!==0){let l=0;for(const c of e.children)a=this._updateNodeAfterFilterChange(c,r,n,o&&!e.collapsed)||a,c.visible&&(c.visibleChildIndex=l++);e.visibleChildrenCount=l}else e.visibleChildrenCount=0;return e!==this.root&&(e.visible=r===2?a:r===1,e.visibility=r),e.visible?e.collapsed||(e.renderNodeCount+=n.length-s):(e.renderNodeCount=0,o&&n.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 n=this.filter?this.filter.filter(e.element,t):1;return typeof n=="boolean"?(e.filterData=void 0,n?1:0):yX(n)?(e.filterData=n.data,vk(n.visibility)):(e.filterData=void 0,vk(n))}hasTreeNode(e,t=this.root){if(!e||e.length===0)return!0;const[n,...o]=e;return n<0||n>t.children.length?!1:this.hasTreeNode(o,t.children[n])}getTreeNode(e,t=this.root){if(!e||e.length===0)return t;const[n,...o]=e;if(n<0||n>t.children.length)throw new Ol(this.user,"Invalid tree location");return this.getTreeNode(o,t.children[n])}getTreeNodeWithListIndex(e){if(e.length===0)return{node:this.root,listIndex:-1,revealed:!0,visible:!1};const{parentNode:t,listIndex:n,revealed:o,visible:r}=this.getParentNodeWithListIndex(e),s=e[e.length-1];if(s<0||s>t.children.length)throw new Ol(this.user,"Invalid tree location");const a=t.children[s];return{node:a,listIndex:n,revealed:o,visible:r&&a.visible}}getParentNodeWithListIndex(e,t=this.root,n=0,o=!0,r=!0){const[s,...a]=e;if(s<0||s>t.children.length)throw new Ol(this.user,"Invalid tree location");for(let l=0;lt.element)),this.data=e}}function W9(i){return i instanceof oT?new Mht(i):i}class Aht{constructor(e,t){this.modelProvider=e,this.dnd=t,this.autoExpandDisposable=_e.None,this.disposables=new Be}getDragURI(e){return this.dnd.getDragURI(e.element)}getDragLabel(e,t){if(this.dnd.getDragLabel)return this.dnd.getDragLabel(e.map(n=>n.element),t)}onDragStart(e,t){var n,o;(o=(n=this.dnd).onDragStart)===null||o===void 0||o.call(n,W9(e),t)}onDragOver(e,t,n,o,r=!0){const s=this.dnd.onDragOver(W9(e),t&&t.element,n,o),a=this.autoExpandNode!==t;if(a&&(this.autoExpandDisposable.dispose(),this.autoExpandNode=t),typeof t=="undefined")return s;if(a&&typeof s!="boolean"&&s.autoExpand&&(this.autoExpandDisposable=Sv(()=>{const h=this.modelProvider(),f=h.getNodeLocation(t);h.isCollapsed(f)&&h.setCollapsed(f,!1),this.autoExpandNode=void 0},500,this.disposables)),typeof s=="boolean"||!s.accept||typeof s.bubble=="undefined"||s.feedback){if(!r){const h=typeof s=="boolean"?s:s.accept,f=typeof s=="boolean"?void 0:s.effect;return{accept:h,effect:f,feedback:[n]}}return s}if(s.bubble===1){const h=this.modelProvider(),f=h.getNodeLocation(t),g=h.getParentNodeLocation(f),p=h.getNode(g),v=g&&h.getListIndex(g);return this.onDragOver(e,p,v,o,!1)}const l=this.modelProvider(),c=l.getNodeLocation(t),u=l.getListIndex(c),d=l.getListRenderCount(c);return Object.assign(Object.assign({},s),{feedback:Gs(u,u+d)})}drop(e,t,n,o){this.autoExpandDisposable.dispose(),this.autoExpandNode=void 0,this.dnd.drop(W9(e),t&&t.element,n,o)}onDragEnd(e){var t,n;(n=(t=this.dnd).onDragEnd)===null||n===void 0||n.call(t,e)}dispose(){this.disposables.dispose(),this.dnd.dispose()}}function Pht(i,e){return e&&Object.assign(Object.assign({},e),{identityProvider:e.identityProvider&&{getId(t){return e.identityProvider.getId(t.element)}},dnd:e.dnd&&new Aht(i,e.dnd),multipleSelectionController:e.multipleSelectionController&&{isSelectionSingleChangeEvent(t){return e.multipleSelectionController.isSelectionSingleChangeEvent(Object.assign(Object.assign({},t),{element:t.element}))},isSelectionRangeChangeEvent(t){return e.multipleSelectionController.isSelectionRangeChangeEvent(Object.assign(Object.assign({},t),{element:t.element}))}},accessibilityProvider:e.accessibilityProvider&&Object.assign(Object.assign({},e.accessibilityProvider),{getSetSize(t){const n=i(),o=n.getNodeLocation(t),r=n.getParentNodeLocation(o);return n.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&&Object.assign(Object.assign({},e.keyboardNavigationLabelProvider),{getKeyboardNavigationLabel(t){return e.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(t.element)}})})}class wX{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){var n,o;(o=(n=this.delegate).setDynamicHeight)===null||o===void 0||o.call(n,e.element,t)}}var _k;(function(i){i.None="none",i.OnHover="onHover",i.Always="always"})(_k||(_k={}));class Oht{get elements(){return this._elements}constructor(e,t=[]){this._elements=t,this.disposables=new Be,this.onDidChange=st.forEach(e,n=>this._elements=n,this.disposables)}dispose(){this.disposables.dispose()}}class bk{constructor(e,t,n,o,r,s={}){var a;this.renderer=e,this.modelProvider=t,this.activeNodes=o,this.renderedIndentGuides=r,this.renderedElements=new Map,this.renderedNodes=new Map,this.indent=bk.DefaultIndent,this.hideTwistiesOfChildlessElements=!1,this.shouldRenderIndentGuides=!1,this.activeIndentNodes=new Set,this.indentGuidesDisposable=_e.None,this.disposables=new Be,this.templateId=e.templateId,this.updateOptions(s),st.map(n,l=>l.node)(this.onDidChangeNodeTwistieState,this,this.disposables),(a=e.onDidChangeTwistieState)===null||a===void 0||a.call(e,this.onDidChangeTwistieState,this,this.disposables)}updateOptions(e={}){if(typeof e.indent!="undefined"){const t=Za(e.indent,0,40);if(t!==this.indent){this.indent=t;for(const[n,o]of this.renderedNodes)this.renderTreeElement(n,o)}}if(typeof e.renderIndentGuides!="undefined"){const t=e.renderIndentGuides!==_k.None;if(t!==this.shouldRenderIndentGuides){this.shouldRenderIndentGuides=t;for(const[n,o]of this.renderedNodes)this._renderIndentGuides(n,o);if(this.indentGuidesDisposable.dispose(),t){const n=new Be;this.activeNodes.onDidChange(this._onDidChangeActiveNodes,this,n),this.indentGuidesDisposable=n,this._onDidChangeActiveNodes(this.activeNodes.elements)}}}typeof e.hideTwistiesOfChildlessElements!="undefined"&&(this.hideTwistiesOfChildlessElements=e.hideTwistiesOfChildlessElements)}renderTemplate(e){const t=Ae(e,He(".monaco-tl-row")),n=Ae(t,He(".monaco-tl-indent")),o=Ae(t,He(".monaco-tl-twistie")),r=Ae(t,He(".monaco-tl-contents")),s=this.renderer.renderTemplate(r);return{container:e,indent:n,twistie:o,indentGuidesDisposable:_e.None,templateData:s}}renderElement(e,t,n,o){this.renderedNodes.set(e,n),this.renderedElements.set(e.element,e),this.renderTreeElement(e,n),this.renderer.renderElement(e,t,n.templateData,o)}disposeElement(e,t,n,o){var r,s;n.indentGuidesDisposable.dispose(),(s=(r=this.renderer).disposeElement)===null||s===void 0||s.call(r,e,t,n.templateData,o),typeof o=="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 n=bk.DefaultIndent+(e.depth-1)*this.indent;t.twistie.style.paddingLeft=`${n}px`,t.indent.style.width=`${n+this.indent-16}px`,e.collapsible?t.container.setAttribute("aria-expanded",String(!e.collapsed)):t.container.removeAttribute("aria-expanded"),t.twistie.classList.remove(...Mt.asClassNameArray(Xe.treeItemExpanded));let o=!1;this.renderer.renderTwistie&&(o=this.renderer.renderTwistie(e.element,t.twistie)),e.collapsible&&(!this.hideTwistiesOfChildlessElements||e.visibleChildrenCount>0)?(o||t.twistie.classList.add(...Mt.asClassNameArray(Xe.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(Ur(t.indent),t.indentGuidesDisposable.dispose(),!this.shouldRenderIndentGuides)return;const n=new Be,o=this.modelProvider();for(;;){const r=o.getNodeLocation(e),s=o.getParentNodeLocation(r);if(!s)break;const a=o.getNode(s),l=He(".indent-guide",{style:`width: ${this.indent}px`});this.activeIndentNodes.has(a)&&l.classList.add("active"),t.indent.childElementCount===0?t.indent.appendChild(l):t.indent.insertBefore(l,t.indent.firstElementChild),this.renderedIndentGuides.add(a,l),n.add(zt(()=>this.renderedIndentGuides.delete(a,l))),e=a}t.indentGuidesDisposable=n}_onDidChangeActiveNodes(e){if(!this.shouldRenderIndentGuides)return;const t=new Set,n=this.modelProvider();e.forEach(o=>{const r=n.getNodeLocation(o);try{const s=n.getParentNodeLocation(r);o.collapsible&&o.children.length>0&&!o.collapsed?t.add(o):s&&t.add(n.getNode(s))}catch{}}),this.activeIndentNodes.forEach(o=>{t.has(o)||this.renderedIndentGuides.forEach(o,r=>r.classList.remove("active"))}),t.forEach(o=>{this.activeIndentNodes.has(o)||this.renderedIndentGuides.forEach(o,r=>r.classList.add("active"))}),this.activeIndentNodes=t}dispose(){this.renderedNodes.clear(),this.renderedElements.clear(),this.indentGuidesDisposable.dispose(),si(this.disposables)}}bk.DefaultIndent=8;class Fht{get totalCount(){return this._totalCount}get matchCount(){return this._matchCount}constructor(e,t,n){this.tree=e,this.keyboardNavigationLabelProvider=t,this._filter=n,this._totalCount=0,this._matchCount=0,this._pattern="",this._lowercasePattern="",this.disposables=new Be,e.onWillRefilter(this.reset,this,this.disposables)}filter(e,t){let n=1;if(this._filter){const s=this._filter.filter(e,t);if(typeof s=="boolean"?n=s?1:0:yX(s)?n=vk(s.visibility):n=s,n===0)return!1}if(this._totalCount++,!this._pattern)return this._matchCount++,{data:$d.Default,visibility:n};const o=this.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(e),r=Array.isArray(o)?o:[o];for(const s of r){const a=s&&s.toString();if(typeof a=="undefined")return{data:$d.Default,visibility:n};let l;if(this.tree.findMatchType===sb.Contiguous){const c=a.toLowerCase().indexOf(this._lowercasePattern);if(c>-1){l=[Number.MAX_SAFE_INTEGER,0];for(let u=this._lowercasePattern.length;u>0;u--)l.push(c+u-1)}}else l=ob(this._pattern,this._lowercasePattern,0,a,a.toLowerCase(),0,{firstMatchCanBeWeak:!0,boostFullMatch:!0});if(l)return this._matchCount++,r.length===1?{data:l,visibility:n}:{data:{label:a,score:l},visibility:n}}return this.tree.findMode===tf.Filter?typeof this.tree.options.defaultFindVisibility=="number"?this.tree.options.defaultFindVisibility:this.tree.options.defaultFindVisibility?this.tree.options.defaultFindVisibility(e):2:{data:$d.Default,visibility:n}}reset(){this._totalCount=0,this._matchCount=0}dispose(){si(this.disposables)}}var tf;(function(i){i[i.Highlight=0]="Highlight",i[i.Filter=1]="Filter"})(tf||(tf={}));var sb;(function(i){i[i.Fuzzy=0]="Fuzzy",i[i.Contiguous=1]="Contiguous"})(sb||(sb={}));class Bht{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,n,o,r,s={}){var a,l;this.tree=e,this.view=n,this.filter=o,this.contextViewProvider=r,this.options=s,this._pattern="",this.width=0,this._onDidChangeMode=new le,this.onDidChangeMode=this._onDidChangeMode.event,this._onDidChangeMatchType=new le,this.onDidChangeMatchType=this._onDidChangeMatchType.event,this._onDidChangePattern=new le,this._onDidChangeOpenState=new le,this.onDidChangeOpenState=this._onDidChangeOpenState.event,this.enabledDisposables=new Be,this.disposables=new Be,this._mode=(a=e.options.defaultFindMode)!==null&&a!==void 0?a:tf.Highlight,this._matchType=(l=e.options.defaultFindMatchType)!==null&&l!==void 0?l: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)}onDidSpliceModel(){!this.widget||this.pattern.length===0||(this.tree.refilter(),this.render())}render(){var e,t,n,o;const r=this.filter.totalCount>0&&this.filter.matchCount===0;this.pattern&&r?!((e=this.tree.options.showNotFoundMessage)!==null&&e!==void 0)||e?(t=this.widget)===null||t===void 0||t.showMessage({type:2,content:C("not found","No elements found.")}):(n=this.widget)===null||n===void 0||n.showMessage({type:2}):(o=this.widget)===null||o===void 0||o.clearMessage()}shouldAllowFocus(e){return!this.widget||!this.pattern||this._mode===tf.Filter||this.filter.totalCount>0&&this.filter.matchCount<=1?!0:!$d.isDefault(e.filterData)}layout(e){var t;this.width=e,(t=this.widget)===null||t===void 0||t.layout(e)}dispose(){this._history=void 0,this._onDidChangePattern.dispose(),this.enabledDisposables.dispose(),this.disposables.dispose()}}function _ae(i){let e=v0.Unknown;return H6(i.browserEvent.target,"monaco-tl-twistie","monaco-tl-row")?e=v0.Twistie:H6(i.browserEvent.target,"monaco-tl-contents","monaco-tl-row")?e=v0.Element:H6(i.browserEvent.target,"monaco-tree-type-filter","monaco-list")&&(e=v0.Filter),{browserEvent:i.browserEvent,element:i.element?i.element.element:null,target:e}}function _M(i,e){e(i),i.children.forEach(t=>_M(t,e))}class V9{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 le,this.onDidChange=this._onDidChange.event}set(e,t){!(t!=null&&t.__forceEvent)&&Lo(this.nodes,e)||this._set(e,!1,t)}_set(e,t,n){if(this.nodes=[...e],this.elements=void 0,this._nodeSet=void 0,!t){const o=this;this._onDidChange.fire({get elements(){return o.get()},browserEvent:n})}}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 l=this.createNodeSet(),c=u=>l.delete(u);t.forEach(u=>_M(u,c)),this.set([...l.values()]);return}const n=new Set,o=l=>n.add(this.identityProvider.getId(l.element).toString());t.forEach(l=>_M(l,o));const r=new Map,s=l=>r.set(this.identityProvider.getId(l.element).toString(),l);e.forEach(l=>_M(l,s));const a=[];for(const l of this.nodes){const c=this.identityProvider.getId(l.element).toString();if(!n.has(c))a.push(l);else{const d=r.get(c);d&&d.visible&&a.push(d)}}if(this.nodes.length>0&&a.length===0){const l=this.getFirstViewElementWithTrait();l&&a.push(l)}this._set(a,!0)}createNodeSet(){const e=new Set;for(const t of this.nodes)e.add(t);return e}}class Wht extends U1e{constructor(e,t){super(e),this.tree=t}onViewPointer(e){if(V1e(e.browserEvent.target)||Jm(e.browserEvent.target)||UC(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 n=e.browserEvent.target,o=n.classList.contains("monaco-tl-twistie")||n.classList.contains("monaco-icon-label")&&n.classList.contains("folder-icon")&&e.browserEvent.offsetX<16;let r=!1;if(typeof this.tree.expandOnlyOnTwistieClick=="function"?r=this.tree.expandOnlyOnTwistieClick(t.element):r=!!this.tree.expandOnlyOnTwistieClick,r&&!o&&e.browserEvent.detail!==2)return super.onViewPointer(e);if(!this.tree.expandOnDoubleClick&&e.browserEvent.detail===2)return super.onViewPointer(e);if(t.collapsible){const s=this.tree.getNodeLocation(t),a=e.browserEvent.altKey;if(this.tree.setFocus([s]),this.tree.toggleCollapsed(s,a),r&&o){e.browserEvent.isHandledByList=!0;return}}super.onViewPointer(e)}onDoubleClick(e){e.browserEvent.target.classList.contains("monaco-tl-twistie")||!this.tree.expandOnDoubleClick||e.browserEvent.isHandledByList||super.onDoubleClick(e)}}class Vht extends qu{constructor(e,t,n,o,r,s,a,l){super(e,t,n,o,l),this.focusTrait=r,this.selectionTrait=s,this.anchorTrait=a}createMouseController(e){return new Wht(this,e.tree)}splice(e,t,n=[]){if(super.splice(e,t,n),n.length===0)return;const o=[],r=[];let s;n.forEach((a,l)=>{this.focusTrait.has(a)&&o.push(e+l),this.selectionTrait.has(a)&&r.push(e+l),this.anchorTrait.has(a)&&(s=e+l)}),o.length>0&&super.setFocus(vv([...super.getFocus(),...o])),r.length>0&&super.setSelection(vv([...super.getSelection(),...r])),typeof s=="number"&&super.setAnchor(s)}setFocus(e,t,n=!1){super.setFocus(e,t),n||this.focusTrait.set(e.map(o=>this.element(o)),t)}setSelection(e,t,n=!1){super.setSelection(e,t),n||this.selectionTrait.set(e.map(o=>this.element(o)),t)}setAnchor(e,t=!1){super.setAnchor(e),t||(typeof e=="undefined"?this.anchorTrait.set([]):this.anchorTrait.set([this.element(e)]))}}class rCe{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 onMouseDblClick(){return st.filter(st.map(this.view.onMouseDblClick,_ae),e=>e.target!==v0.Filter)}get onPointer(){return st.map(this.view.onPointer,_ae)}get onDidFocus(){return this.view.onDidFocus}get onDidChangeModel(){return st.signal(this.model.onDidSplice)}get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}get findMode(){var e,t;return(t=(e=this.findController)===null||e===void 0?void 0:e.mode)!==null&&t!==void 0?t:tf.Highlight}set findMode(e){this.findController&&(this.findController.mode=e)}get findMatchType(){var e,t;return(t=(e=this.findController)===null||e===void 0?void 0:e.matchType)!==null&&t!==void 0?t:sb.Fuzzy}set findMatchType(e){this.findController&&(this.findController.matchType=e)}get expandOnDoubleClick(){return typeof this._options.expandOnDoubleClick=="undefined"?!0:this._options.expandOnDoubleClick}get expandOnlyOnTwistieClick(){return typeof this._options.expandOnlyOnTwistieClick=="undefined"?!0:this._options.expandOnlyOnTwistieClick}get onDidDispose(){return this.view.onDidDispose}constructor(e,t,n,o,r={}){var s;this._user=e,this._options=r,this.eventBufferer=new $q,this.onDidChangeFindOpenState=st.None,this.disposables=new Be,this._onWillRefilter=new le,this.onWillRefilter=this._onWillRefilter.event,this._onDidUpdateOptions=new le;const a=new wX(n),l=new coe,c=new coe,u=this.disposables.add(new Oht(c.event)),d=new dG;this.renderers=o.map(v=>new bk(v,()=>this.model,l.event,u,d,r));for(const v of this.renderers)this.disposables.add(v);let h;r.keyboardNavigationLabelProvider&&(h=new Fht(this,r.keyboardNavigationLabelProvider,r.filter),r=Object.assign(Object.assign({},r),{filter:h}),this.disposables.add(h)),this.focus=new V9(()=>this.view.getFocusedElements()[0],r.identityProvider),this.selection=new V9(()=>this.view.getSelectedElements()[0],r.identityProvider),this.anchor=new V9(()=>this.view.getAnchorElement(),r.identityProvider),this.view=new Vht(e,t,a,this.renderers,this.focus,this.selection,this.anchor,Object.assign(Object.assign({},Pht(()=>this.model,r)),{tree:this})),this.model=this.createModel(e,this.view,r),l.input=this.model.onDidChangeCollapseState;const f=st.forEach(this.model.onDidSplice,v=>{this.eventBufferer.bufferEvents(()=>{this.focus.onDidModelSplice(v),this.selection.onDidModelSplice(v)})},this.disposables);f(()=>null,null,this.disposables);const g=this.disposables.add(new le),p=this.disposables.add(new Wu(0));if(this.disposables.add(st.any(f,this.focus.onDidChange,this.selection.onDidChange)(()=>{p.trigger(()=>{const v=new Set;for(const m of this.focus.getNodes())v.add(m);for(const m of this.selection.getNodes())v.add(m);g.fire([...v.values()])})})),c.input=g.event,r.keyboardSupport!==!1){const v=st.chain(this.view.onKeyDown,m=>m.filter(_=>!Jm(_.target)).map(_=>new Pi(_)));st.chain(v,m=>m.filter(_=>_.keyCode===15))(this.onLeftArrow,this,this.disposables),st.chain(v,m=>m.filter(_=>_.keyCode===17))(this.onRightArrow,this,this.disposables),st.chain(v,m=>m.filter(_=>_.keyCode===10))(this.onSpace,this,this.disposables)}if(((s=r.findWidgetEnabled)!==null&&s!==void 0?s:!0)&&r.keyboardNavigationLabelProvider&&r.contextViewProvider){const v=this.options.findWidgetStyles?{styles:this.options.findWidgetStyles}:void 0;this.findController=new Bht(this,this.model,this.view,h,r.contextViewProvider,v),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=st.None,this.onDidChangeFindMatchType=st.None;this.styleElement=Wc(this.view.getHTMLElement()),this.getHTMLElement().classList.toggle("always",this._options.renderIndentGuides===_k.Always)}updateOptions(e={}){var t;this._options=Object.assign(Object.assign({},this._options),e);for(const n of this.renderers)n.updateOptions(e);this.view.updateOptions(this._options),(t=this.findController)===null||t===void 0||t.updateOptions(e),this._onDidUpdateOptions.fire(this._options),this.getHTMLElement().classList.toggle("always",this._options.renderIndentGuides===_k.Always)}get options(){return this._options}getHTMLElement(){return this.view.getHTMLElement()}get scrollTop(){return this.view.scrollTop}set scrollTop(e){this.view.scrollTop=e}get scrollHeight(){return this.view.scrollHeight}get renderHeight(){return this.view.renderHeight}domFocus(){this.view.domFocus()}layout(e,t){var n;this.view.layout(e,t),_v(t)&&((n=this.findController)===null||n===void 0||n.layout(t))}style(e){const t=`.${this.view.domId}`,n=[];e.treeIndentGuidesStroke&&(n.push(`.monaco-list${t}:hover .monaco-tl-indent > .indent-guide, .monaco-list${t}.always .monaco-tl-indent > .indent-guide { border-color: ${e.treeInactiveIndentGuidesStroke}; }`),n.push(`.monaco-list${t} .monaco-tl-indent > .indent-guide.active { border-color: ${e.treeIndentGuidesStroke}; }`)),this.styleElement.textContent=n.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)}isCollapsible(e){return this.model.isCollapsible(e)}setCollapsible(e,t){return this.model.setCollapsible(e,t)}isCollapsed(e){return this.model.isCollapsed(e)}refilter(){this._onWillRefilter.fire(void 0),this.model.refilter()}setSelection(e,t){const n=e.map(r=>this.model.getNode(r));this.selection.set(n,t);const o=e.map(r=>this.model.getListIndex(r)).filter(r=>r>-1);this.view.setSelection(o,t,!0)}getSelection(){return this.selection.get()}setFocus(e,t){const n=e.map(r=>this.model.getNode(r));this.focus.set(n,t);const o=e.map(r=>this.model.getListIndex(r)).filter(r=>r>-1);this.view.setFocus(o,t,!0)}getFocus(){return this.focus.get()}reveal(e,t){this.model.expandTo(e);const n=this.model.getListIndex(e);n!==-1&&this.view.reveal(n,t)}onLeftArrow(e){e.preventDefault(),e.stopPropagation();const t=this.view.getFocusedElements();if(t.length===0)return;const n=t[0],o=this.model.getNodeLocation(n);if(!this.model.setCollapsed(o,!0)){const s=this.model.getParentNodeLocation(o);if(!s)return;const a=this.model.getListIndex(s);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 n=t[0],o=this.model.getNodeLocation(n);if(!this.model.setCollapsed(o,!1)){if(!n.children.some(l=>l.visible))return;const[s]=this.view.getFocus(),a=s+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 n=t[0],o=this.model.getNodeLocation(n),r=e.browserEvent.altKey;this.model.setCollapsed(o,void 0,r)}dispose(){si(this.disposables),this.view.dispose()}}class SX{constructor(e,t,n={}){this.user=e,this.rootRef=null,this.nodes=new Map,this.nodesByIdentity=new Map,this.model=new Rht(e,t,null,n),this.onDidSplice=this.model.onDidSplice,this.onDidChangeCollapseState=this.model.onDidChangeCollapseState,this.onDidChangeRenderNodeCount=this.model.onDidChangeRenderNodeCount,n.sorter&&(this.sorter={compare(o,r){return n.sorter.compare(o.element,r.element)}}),this.identityProvider=n.identityProvider}setChildren(e,t=vn.empty(),n={}){const o=this.getElementLocation(e);this._setChildren(o,this.preserveCollapseState(t),n)}_setChildren(e,t=vn.empty(),n){const o=new Set,r=new Set,s=l=>{var c;if(l.element===null)return;const u=l;if(o.add(u.element),this.nodes.set(u.element,u),this.identityProvider){const d=this.identityProvider.getId(u.element).toString();r.add(d),this.nodesByIdentity.set(d,u)}(c=n.onDidCreateNode)===null||c===void 0||c.call(n,u)},a=l=>{var c;if(l.element===null)return;const u=l;if(o.has(u.element)||this.nodes.delete(u.element),this.identityProvider){const d=this.identityProvider.getId(u.element).toString();r.has(d)||this.nodesByIdentity.delete(d)}(c=n.onDidDeleteNode)===null||c===void 0||c.call(n,u)};this.model.splice([...e,0],Number.MAX_VALUE,t,Object.assign(Object.assign({},n),{onDidCreateNode:s,onDidDeleteNode:a}))}preserveCollapseState(e=vn.empty()){return this.sorter&&(e=[...e].sort(this.sorter.compare.bind(this.sorter))),vn.map(e,t=>{let n=this.nodes.get(t.element);if(!n&&this.identityProvider){const s=this.identityProvider.getId(t.element).toString();n=this.nodesByIdentity.get(s)}if(!n){let s;return typeof t.collapsed=="undefined"?s=void 0:t.collapsed===xh.Collapsed||t.collapsed===xh.PreserveOrCollapsed?s=!0:t.collapsed===xh.Expanded||t.collapsed===xh.PreserveOrExpanded?s=!1:s=Boolean(t.collapsed),Object.assign(Object.assign({},t),{children:this.preserveCollapseState(t.children),collapsed:s})}const o=typeof t.collapsible=="boolean"?t.collapsible:n.collapsible;let r;return typeof t.collapsed=="undefined"||t.collapsed===xh.PreserveOrCollapsed||t.collapsed===xh.PreserveOrExpanded?r=n.collapsed:t.collapsed===xh.Collapsed?r=!0:t.collapsed===xh.Expanded?r=!1:r=Boolean(t.collapsed),Object.assign(Object.assign({},t),{collapsible:o,collapsed:r,children:this.preserveCollapseState(t.children)})})}rerender(e){const t=this.getElementLocation(e);this.model.rerender(t)}getFirstElementChild(e=null){const t=this.getElementLocation(e);return this.model.getFirstElementChild(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 n=this.getElementLocation(e);return this.model.setCollapsible(n,t)}isCollapsed(e){const t=this.getElementLocation(e);return this.model.isCollapsed(t)}setCollapsed(e,t,n){const o=this.getElementLocation(e);return this.model.setCollapsed(o,t,n)}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 Ol(this.user,`Tree element not found: ${e}`);return t}getNodeLocation(e){return e.element}getParentNodeLocation(e){if(e===null)throw new Ol(this.user,"Invalid getParentNodeLocation call");const t=this.nodes.get(e);if(!t)throw new Ol(this.user,`Tree element not found: ${e}`);const n=this.model.getNodeLocation(t),o=this.model.getParentNodeLocation(n);return this.model.getNode(o).element}getElementLocation(e){if(e===null)return[];const t=this.nodes.get(e);if(!t)throw new Ol(this.user,`Tree element not found: ${e}`);return this.model.getNodeLocation(t)}}function bM(i){const e=[i.element],t=i.incompressible||!1;return{element:{elements:e,incompressible:t},children:vn.map(vn.from(i.children),bM),collapsible:i.collapsible,collapsed:i.collapsed}}function CM(i){const e=[i.element],t=i.incompressible||!1;let n,o;for(;[o,n]=vn.consume(vn.from(i.children),2),!(o.length!==1||o[0].incompressible);)i=o[0],e.push(i.element);return{element:{elements:e,incompressible:t},children:vn.map(vn.concat(o,n),CM),collapsible:i.collapsible,collapsed:i.collapsed}}function C$(i,e=0){let t;return eC$(n,0)),e===0&&i.element.incompressible?{element:i.element.elements[e],children:t,incompressible:!0,collapsible:i.collapsible,collapsed:i.collapsed}:{element:i.element.elements[e],children:t,collapsible:i.collapsible,collapsed:i.collapsed}}function bae(i){return C$(i,0)}function sCe(i,e,t){return i.element===e?Object.assign(Object.assign({},i),{children:t}):Object.assign(Object.assign({},i),{children:vn.map(vn.from(i.children),n=>sCe(n,e,t))})}const Hht=i=>({getId(e){return e.elements.map(t=>i.getId(t).toString()).join("\0")}});class $ht{get onDidSplice(){return this.model.onDidSplice}get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}get onDidChangeRenderNodeCount(){return this.model.onDidChangeRenderNodeCount}constructor(e,t,n={}){this.user=e,this.rootRef=null,this.nodes=new Map,this.model=new SX(e,t,n),this.enabled=typeof n.compressionEnabled=="undefined"?!0:n.compressionEnabled,this.identityProvider=n.identityProvider}setChildren(e,t=vn.empty(),n){const o=n.diffIdentityProvider&&Hht(n.diffIdentityProvider);if(e===null){const g=vn.map(t,this.enabled?CM:bM);this._setChildren(null,g,{diffIdentityProvider:o,diffDepth:1/0});return}const r=this.nodes.get(e);if(!r)throw new Ol(this.user,"Unknown compressed tree node");const s=this.model.getNode(r),a=this.model.getParentNodeLocation(r),l=this.model.getNode(a),c=bae(s),u=sCe(c,e,t),d=(this.enabled?CM:bM)(u),h=n.diffIdentityProvider?(g,p)=>n.diffIdentityProvider.getId(g)===n.diffIdentityProvider.getId(p):void 0;if(Lo(d.element.elements,s.element.elements,h)){this._setChildren(r,d.children||vn.empty(),{diffIdentityProvider:o,diffDepth:1});return}const f=l.children.map(g=>g===s?d:g);this._setChildren(l.element,f,{diffIdentityProvider:o,diffDepth:s.depth-l.depth})}setCompressionEnabled(e){if(e===this.enabled)return;this.enabled=e;const n=this.model.getNode().children,o=vn.map(n,bae),r=vn.map(o,e?CM:bM);this._setChildren(null,r,{diffIdentityProvider:this.identityProvider,diffDepth:1/0})}_setChildren(e,t,n){const o=new Set,r=a=>{for(const l of a.element.elements)o.add(l),this.nodes.set(l,a.element)},s=a=>{for(const l of a.element.elements)o.has(l)||this.nodes.delete(l)};this.model.setChildren(e,t,Object.assign(Object.assign({},n),{onDidCreateNode:r,onDidDeleteNode:s}))}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=="undefined")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),n=this.model.getParentNodeLocation(t);return n===null?null:n.elements[n.elements.length-1]}getFirstElementChild(e){const t=this.getCompressedNode(e);return this.model.getFirstElementChild(t)}isCollapsible(e){const t=this.getCompressedNode(e);return this.model.isCollapsible(t)}setCollapsible(e,t){const n=this.getCompressedNode(e);return this.model.setCollapsible(n,t)}isCollapsed(e){const t=this.getCompressedNode(e);return this.model.isCollapsed(t)}setCollapsed(e,t,n){const o=this.getCompressedNode(e);return this.model.setCollapsed(o,t,n)}expandTo(e){const t=this.getCompressedNode(e);this.model.expandTo(t)}rerender(e){const t=this.getCompressedNode(e);this.model.rerender(t)}refilter(){this.model.refilter()}getCompressedNode(e){if(e===null)return null;const t=this.nodes.get(e);if(!t)throw new Ol(this.user,`Tree element not found: ${e}`);return t}}const zht=i=>i[i.length-1];class xX{get element(){return this.node.element===null?null:this.unwrapper(this.node.element)}get children(){return this.node.children.map(e=>new xX(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 Uht(i,e){return{splice(t,n,o){e.splice(t,n,o.map(r=>i.map(r)))},updateElementHeight(t,n){e.updateElementHeight(t,n)}}}function jht(i,e){return Object.assign(Object.assign({},e),{identityProvider:e.identityProvider&&{getId(t){return e.identityProvider.getId(i(t))}},sorter:e.sorter&&{compare(t,n){return e.sorter.compare(t.elements[0],n.elements[0])}},filter:e.filter&&{filter(t,n){return e.filter.filter(i(t),n)}}})}class Kht{get onDidSplice(){return st.map(this.model.onDidSplice,({insertedNodes:e,deletedNodes:t})=>({insertedNodes:e.map(n=>this.nodeMapper.map(n)),deletedNodes:t.map(n=>this.nodeMapper.map(n))}))}get onDidChangeCollapseState(){return st.map(this.model.onDidChangeCollapseState,({node:e,deep:t})=>({node:this.nodeMapper.map(e),deep:t}))}get onDidChangeRenderNodeCount(){return st.map(this.model.onDidChangeRenderNodeCount,e=>this.nodeMapper.map(e))}constructor(e,t,n={}){this.rootRef=null,this.elementMapper=n.elementMapper||zht;const o=r=>this.elementMapper(r.elements);this.nodeMapper=new CX(r=>new xX(o,r)),this.model=new $ht(e,Uht(this.nodeMapper,t),jht(o,n))}setChildren(e,t=vn.empty(),n={}){this.model.setChildren(e,t,n)}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=="undefined"?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,n){return this.model.setCollapsed(e,t,n)}expandTo(e){return this.model.expandTo(e)}rerender(e){return this.model.rerender(e)}refilter(){return this.model.refilter()}getCompressedTreeNode(e=null){return this.model.getNode(e)}}var qht=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r};class LX extends rCe{get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}constructor(e,t,n,o,r={}){super(e,t,n,o,r),this.user=e}setChildren(e,t=vn.empty(),n){this.model.setChildren(e,t,n)}rerender(e){if(e===void 0){this.view.rerender();return}this.model.rerender(e)}hasElement(e){return this.model.has(e)}createModel(e,t,n){return new SX(e,t,n)}}class aCe{get compressedTreeNodeProvider(){return this._compressedTreeNodeProvider()}constructor(e,t){this._compressedTreeNodeProvider=e,this.renderer=t,this.templateId=t.templateId,t.onDidChangeTwistieState&&(this.onDidChangeTwistieState=t.onDidChangeTwistieState)}renderTemplate(e){const t=this.renderer.renderTemplate(e);return{compressedTreeNode:void 0,data:t}}renderElement(e,t,n,o){const r=this.compressedTreeNodeProvider.getCompressedTreeNode(e.element);r.element.elements.length===1?(n.compressedTreeNode=void 0,this.renderer.renderElement(e,t,n.data,o)):(n.compressedTreeNode=r,this.renderer.renderCompressedElements(r,t,n.data,o))}disposeElement(e,t,n,o){var r,s,a,l;n.compressedTreeNode?(s=(r=this.renderer).disposeCompressedElements)===null||s===void 0||s.call(r,n.compressedTreeNode,t,n.data,o):(l=(a=this.renderer).disposeElement)===null||l===void 0||l.call(a,e,t,n.data,o)}disposeTemplate(e){this.renderer.disposeTemplate(e.data)}renderTwistie(e,t){return this.renderer.renderTwistie?this.renderer.renderTwistie(e,t):!1}}qht([Mo],aCe.prototype,"compressedTreeNodeProvider",null);function Ght(i,e){return e&&Object.assign(Object.assign({},e),{keyboardNavigationLabelProvider:e.keyboardNavigationLabelProvider&&{getKeyboardNavigationLabel(t){let n;try{n=i().getCompressedTreeNode(t)}catch{return e.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(t)}return n.element.elements.length===1?e.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(t):e.keyboardNavigationLabelProvider.getCompressedNodeKeyboardNavigationLabel(n.element.elements)}}})}class lCe extends LX{constructor(e,t,n,o,r={}){const s=()=>this,a=o.map(l=>new aCe(s,l));super(e,t,n,a,Ght(s,r))}setChildren(e,t=vn.empty(),n){this.model.setChildren(e,t,n)}createModel(e,t,n){return new Kht(e,t,n)}updateOptions(e={}){super.updateOptions(e),typeof e.compressionEnabled!="undefined"&&this.model.setCompressionEnabled(e.compressionEnabled)}getCompressedTreeNode(e=null){return this.model.getCompressedTreeNode(e)}}var Hp=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};function H9(i){return Object.assign(Object.assign({},i),{children:[],refreshPromise:void 0,stale:!0,slow:!1,collapsedByDefault:void 0})}function y$(i,e){return e.parent?e.parent===i?!0:y$(i,e.parent):!1}function Xht(i,e){return i===e||y$(i,e)||y$(e,i)}class EX{get element(){return this.node.element.element}get children(){return this.node.children.map(e=>new EX(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 Yht{constructor(e,t,n){this.renderer=e,this.nodeMapper=t,this.onDidChangeTwistieState=n,this.renderedNodes=new Map,this.templateId=e.templateId}renderTemplate(e){return{templateData:this.renderer.renderTemplate(e)}}renderElement(e,t,n,o){this.renderer.renderElement(this.nodeMapper.map(e),t,n.templateData,o)}renderTwistie(e,t){return e.slow?(t.classList.add(...Mt.asClassNameArray(Xe.treeItemLoading)),!0):(t.classList.remove(...Mt.asClassNameArray(Xe.treeItemLoading)),!1)}disposeElement(e,t,n,o){var r,s;(s=(r=this.renderer).disposeElement)===null||s===void 0||s.call(r,this.nodeMapper.map(e),t,n.templateData,o)}disposeTemplate(e){this.renderer.disposeTemplate(e.templateData)}dispose(){this.renderedNodes.clear()}}function Cae(i){return{browserEvent:i.browserEvent,elements:i.elements.map(e=>e.element)}}function yae(i){return{browserEvent:i.browserEvent,element:i.element&&i.element.element,target:i.target}}class Zht extends oT{constructor(e){super(e.elements.map(t=>t.element)),this.data=e}}function $9(i){return i instanceof oT?new Zht(i):i}class Qht{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(n=>n.element),t)}onDragStart(e,t){var n,o;(o=(n=this.dnd).onDragStart)===null||o===void 0||o.call(n,$9(e),t)}onDragOver(e,t,n,o,r=!0){return this.dnd.onDragOver($9(e),t&&t.element,n,o)}drop(e,t,n,o){this.dnd.drop($9(e),t&&t.element,n,o)}onDragEnd(e){var t,n;(n=(t=this.dnd).onDragEnd)===null||n===void 0||n.call(t,e)}dispose(){this.dnd.dispose()}}function cCe(i){return i&&Object.assign(Object.assign({},i),{collapseByDefault:!0,identityProvider:i.identityProvider&&{getId(e){return i.identityProvider.getId(e.element)}},dnd:i.dnd&&new Qht(i.dnd),multipleSelectionController:i.multipleSelectionController&&{isSelectionSingleChangeEvent(e){return i.multipleSelectionController.isSelectionSingleChangeEvent(Object.assign(Object.assign({},e),{element:e.element}))},isSelectionRangeChangeEvent(e){return i.multipleSelectionController.isSelectionRangeChangeEvent(Object.assign(Object.assign({},e),{element:e.element}))}},accessibilityProvider:i.accessibilityProvider&&Object.assign(Object.assign({},i.accessibilityProvider),{getPosInSet:void 0,getSetSize:void 0,getRole:i.accessibilityProvider.getRole?e=>i.accessibilityProvider.getRole(e.element):()=>"treeitem",isChecked:i.accessibilityProvider.isChecked?e=>{var t;return!!(!((t=i.accessibilityProvider)===null||t===void 0)&&t.isChecked(e.element))}:void 0,getAriaLabel(e){return i.accessibilityProvider.getAriaLabel(e.element)},getWidgetAriaLabel(){return i.accessibilityProvider.getWidgetAriaLabel()},getWidgetRole:i.accessibilityProvider.getWidgetRole?()=>i.accessibilityProvider.getWidgetRole():()=>"tree",getAriaLevel:i.accessibilityProvider.getAriaLevel&&(e=>i.accessibilityProvider.getAriaLevel(e.element)),getActiveDescendantId:i.accessibilityProvider.getActiveDescendantId&&(e=>i.accessibilityProvider.getActiveDescendantId(e.element))}),filter:i.filter&&{filter(e,t){return i.filter.filter(e.element,t)}},keyboardNavigationLabelProvider:i.keyboardNavigationLabelProvider&&Object.assign(Object.assign({},i.keyboardNavigationLabelProvider),{getKeyboardNavigationLabel(e){return i.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(e.element)}}),sorter:void 0,expandOnlyOnTwistieClick:typeof i.expandOnlyOnTwistieClick=="undefined"?void 0:typeof i.expandOnlyOnTwistieClick!="function"?i.expandOnlyOnTwistieClick:e=>i.expandOnlyOnTwistieClick(e.element),defaultFindVisibility:e=>e.hasChildren&&e.stale?1:typeof i.defaultFindVisibility=="number"?i.defaultFindVisibility:typeof i.defaultFindVisibility=="undefined"?2:i.defaultFindVisibility(e.element)})}function w$(i,e){e(i),i.children.forEach(t=>w$(t,e))}class uCe{get onDidScroll(){return this.tree.onDidScroll}get onDidChangeFocus(){return st.map(this.tree.onDidChangeFocus,Cae)}get onDidChangeSelection(){return st.map(this.tree.onDidChangeSelection,Cae)}get onMouseDblClick(){return st.map(this.tree.onMouseDblClick,yae)}get onPointer(){return st.map(this.tree.onPointer,yae)}get onDidFocus(){return this.tree.onDidFocus}get onDidChangeModel(){return this.tree.onDidChangeModel}get onDidChangeCollapseState(){return this.tree.onDidChangeCollapseState}get onDidChangeFindOpenState(){return this.tree.onDidChangeFindOpenState}get onDidDispose(){return this.tree.onDidDispose}constructor(e,t,n,o,r,s={}){this.user=e,this.dataSource=r,this.nodes=new Map,this.subTreeRefreshPromises=new Map,this.refreshPromises=new Map,this._onDidRender=new le,this._onDidChangeNodeSlowState=new le,this.nodeMapper=new CX(a=>new EX(a)),this.disposables=new Be,this.identityProvider=s.identityProvider,this.autoExpandSingleChildren=typeof s.autoExpandSingleChildren=="undefined"?!1:s.autoExpandSingleChildren,this.sorter=s.sorter,this.collapseByDefault=s.collapseByDefault,this.tree=this.createTree(e,t,n,o,s),this.onDidChangeFindMode=this.tree.onDidChangeFindMode,this.root=H9({element:void 0,parent:null,hasChildren:!0}),this.identityProvider&&(this.root=Object.assign(Object.assign({},this.root),{id:null})),this.nodes.set(null,this.root),this.tree.onDidChangeCollapseState(this._onDidChangeCollapseState,this,this.disposables)}createTree(e,t,n,o,r){const s=new wX(n),a=o.map(c=>new Yht(c,this.nodeMapper,this._onDidChangeNodeSlowState.event)),l=cCe(r)||{};return new LX(e,t,s,a,l)}updateOptions(e={}){this.tree.updateOptions(e)}getHTMLElement(){return this.tree.getHTMLElement()}get scrollTop(){return this.tree.scrollTop}set scrollTop(e){this.tree.scrollTop=e}get scrollHeight(){return this.tree.scrollHeight}get renderHeight(){return this.tree.renderHeight}domFocus(){this.tree.domFocus()}layout(e,t){this.tree.layout(e,t)}style(e){this.tree.style(e)}getInput(){return this.root.element}setInput(e,t){return Hp(this,void 0,void 0,function*(){this.refreshPromises.forEach(o=>o.cancel()),this.refreshPromises.clear(),this.root.element=e;const n=t&&{viewState:t,focus:[],selection:[]};yield this._updateChildren(e,!0,!1,n),n&&(this.tree.setFocus(n.focus),this.tree.setSelection(n.selection)),t&&typeof t.scrollTop=="number"&&(this.scrollTop=t.scrollTop)})}_updateChildren(e=this.root.element,t=!0,n=!1,o,r){return Hp(this,void 0,void 0,function*(){if(typeof this.root.element=="undefined")throw new Ol(this.user,"Tree input not set");this.root.refreshPromise&&(yield this.root.refreshPromise,yield st.toPromise(this._onDidRender.event));const s=this.getDataNode(e);if(yield this.refreshAndRenderNode(s,t,o,r),n)try{this.tree.rerender(s)}catch{}})}rerender(e){if(e===void 0||e===this.root.element){this.tree.rerender();return}const t=this.getDataNode(e);this.tree.rerender(t)}getNode(e=this.root.element){const t=this.getDataNode(e),n=this.tree.getNode(t===this.root?null:t);return this.nodeMapper.map(n)}collapse(e,t=!1){const n=this.getDataNode(e);return this.tree.collapse(n===this.root?null:n,t)}expand(e,t=!1){return Hp(this,void 0,void 0,function*(){if(typeof this.root.element=="undefined")throw new Ol(this.user,"Tree input not set");this.root.refreshPromise&&(yield this.root.refreshPromise,yield st.toPromise(this._onDidRender.event));const n=this.getDataNode(e);if(this.tree.hasElement(n)&&!this.tree.isCollapsible(n)||(n.refreshPromise&&(yield this.root.refreshPromise,yield st.toPromise(this._onDidRender.event)),n!==this.root&&!n.refreshPromise&&!this.tree.isCollapsed(n)))return!1;const o=this.tree.expand(n===this.root?null:n,t);return n.refreshPromise&&(yield this.root.refreshPromise,yield st.toPromise(this._onDidRender.event)),o})}setSelection(e,t){const n=e.map(o=>this.getDataNode(o));this.tree.setSelection(n,t)}getSelection(){return this.tree.getSelection().map(t=>t.element)}setFocus(e,t){const n=e.map(o=>this.getDataNode(o));this.tree.setFocus(n,t)}getFocus(){return this.tree.getFocus().map(t=>t.element)}reveal(e,t){this.tree.reveal(this.getDataNode(e),t)}getParentElement(e){const t=this.tree.getParentElement(this.getDataNode(e));return t&&t.element}getFirstElementChild(e=this.root.element){const t=this.getDataNode(e),n=this.tree.getFirstElementChild(t===this.root?null:t);return n&&n.element}getDataNode(e){const t=this.nodes.get(e===this.root.element?null:e);if(!t)throw new Ol(this.user,`Data tree node not found: ${e}`);return t}refreshAndRenderNode(e,t,n,o){return Hp(this,void 0,void 0,function*(){yield this.refreshNode(e,t,n),this.render(e,n,o)})}refreshNode(e,t,n){return Hp(this,void 0,void 0,function*(){let o;if(this.subTreeRefreshPromises.forEach((r,s)=>{!o&&Xht(s,e)&&(o=r.then(()=>this.refreshNode(e,t,n)))}),o)return o;if(e!==this.root&&this.tree.getNode(e).collapsed){e.hasChildren=!!this.dataSource.hasChildren(e.element),e.stale=!0;return}return this.doRefreshSubTree(e,t,n)})}doRefreshSubTree(e,t,n){return Hp(this,void 0,void 0,function*(){let o;e.refreshPromise=new Promise(r=>o=r),this.subTreeRefreshPromises.set(e,e.refreshPromise),e.refreshPromise.finally(()=>{e.refreshPromise=void 0,this.subTreeRefreshPromises.delete(e)});try{const r=yield this.doRefreshNode(e,t,n);e.stale=!1,yield YV.settled(r.map(s=>this.doRefreshSubTree(s,t,n)))}finally{o()}})}doRefreshNode(e,t,n){return Hp(this,void 0,void 0,function*(){e.hasChildren=!!this.dataSource.hasChildren(e.element);let o;if(!e.hasChildren)o=Promise.resolve(vn.empty());else{const r=this.doGetChildren(e);if(ioe(r))o=Promise.resolve(r);else{const s=wv(800);s.then(()=>{e.slow=!0,this._onDidChangeNodeSlowState.fire(e)},a=>null),o=r.finally(()=>s.cancel())}}try{const r=yield o;return this.setChildren(e,r,t,n)}catch(r){if(e!==this.root&&this.tree.hasElement(e)&&this.tree.collapse(e),sh(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 n=this.dataSource.getChildren(e.element);return ioe(n)?this.processChildren(n):(t=sr(()=>Hp(this,void 0,void 0,function*(){return this.processChildren(yield n)})),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(en))}setChildren(e,t,n,o){const r=[...t];if(e.children.length===0&&r.length===0)return[];const s=new Map,a=new Map;for(const u of e.children)if(s.set(u.element,u),this.identityProvider){const d=this.tree.isCollapsed(u);a.set(u.id,{node:u,collapsed:d})}const l=[],c=r.map(u=>{const d=!!this.dataSource.hasChildren(u);if(!this.identityProvider){const p=H9({element:u,parent:e,hasChildren:d});return d&&this.collapseByDefault&&!this.collapseByDefault(u)&&(p.collapsedByDefault=!1,l.push(p)),p}const h=this.identityProvider.getId(u).toString(),f=a.get(h);if(f){const p=f.node;return s.delete(p.element),this.nodes.delete(p.element),this.nodes.set(u,p),p.element=u,p.hasChildren=d,n?f.collapsed?(p.children.forEach(v=>w$(v,m=>this.nodes.delete(m.element))),p.children.splice(0,p.children.length),p.stale=!0):l.push(p):d&&this.collapseByDefault&&!this.collapseByDefault(u)&&(p.collapsedByDefault=!1,l.push(p)),p}const g=H9({element:u,parent:e,id:h,hasChildren:d});return o&&o.viewState.focus&&o.viewState.focus.indexOf(h)>-1&&o.focus.push(g),o&&o.viewState.selection&&o.viewState.selection.indexOf(h)>-1&&o.selection.push(g),o&&o.viewState.expanded&&o.viewState.expanded.indexOf(h)>-1?l.push(g):d&&this.collapseByDefault&&!this.collapseByDefault(u)&&(g.collapsedByDefault=!1,l.push(g)),g});for(const u of s.values())w$(u,d=>this.nodes.delete(d.element));for(const u of c)this.nodes.set(u.element,u);return e.children.splice(0,e.children.length,...c),e!==this.root&&this.autoExpandSingleChildren&&c.length===1&&l.length===0&&(c[0].collapsedByDefault=!1,l.push(c[0])),l}render(e,t,n){const o=e.children.map(s=>this.asTreeElement(s,t)),r=n&&Object.assign(Object.assign({},n),{diffIdentityProvider:n.diffIdentityProvider&&{getId(s){return n.diffIdentityProvider.getId(s.element)}}});this.tree.setChildren(e===this.root?null:e,o,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 n;return t&&t.viewState.expanded&&e.id&&t.viewState.expanded.indexOf(e.id)>-1?n=!1:n=e.collapsedByDefault,e.collapsedByDefault=void 0,{element:e,children:e.hasChildren?vn.map(e.children,o=>this.asTreeElement(o,t)):[],collapsible:e.hasChildren,collapsed:n}}processChildren(e){return this.sorter&&(e=[...e].sort(this.sorter.compare.bind(this.sorter))),e}dispose(){this.disposables.dispose(),this.tree.dispose()}}class DX{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 DX(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 Jht{constructor(e,t,n,o){this.renderer=e,this.nodeMapper=t,this.compressibleNodeMapperProvider=n,this.onDidChangeTwistieState=o,this.renderedNodes=new Map,this.disposables=[],this.templateId=e.templateId}renderTemplate(e){return{templateData:this.renderer.renderTemplate(e)}}renderElement(e,t,n,o){this.renderer.renderElement(this.nodeMapper.map(e),t,n.templateData,o)}renderCompressedElements(e,t,n,o){this.renderer.renderCompressedElements(this.compressibleNodeMapperProvider().map(e),t,n.templateData,o)}renderTwistie(e,t){return e.slow?(t.classList.add(...Mt.asClassNameArray(Xe.treeItemLoading)),!0):(t.classList.remove(...Mt.asClassNameArray(Xe.treeItemLoading)),!1)}disposeElement(e,t,n,o){var r,s;(s=(r=this.renderer).disposeElement)===null||s===void 0||s.call(r,this.nodeMapper.map(e),t,n.templateData,o)}disposeCompressedElements(e,t,n,o){var r,s;(s=(r=this.renderer).disposeCompressedElements)===null||s===void 0||s.call(r,this.compressibleNodeMapperProvider().map(e),t,n.templateData,o)}disposeTemplate(e){this.renderer.disposeTemplate(e.templateData)}dispose(){this.renderedNodes.clear(),this.disposables=si(this.disposables)}}function eft(i){const e=i&&cCe(i);return e&&Object.assign(Object.assign({},e),{keyboardNavigationLabelProvider:e.keyboardNavigationLabelProvider&&Object.assign(Object.assign({},e.keyboardNavigationLabelProvider),{getCompressedNodeKeyboardNavigationLabel(t){return i.keyboardNavigationLabelProvider.getCompressedNodeKeyboardNavigationLabel(t.map(n=>n.element))}})})}class tft extends uCe{constructor(e,t,n,o,r,s,a={}){super(e,t,n,r,s,a),this.compressionDelegate=o,this.compressibleNodeMapper=new CX(l=>new DX(l)),this.filter=a.filter}createTree(e,t,n,o,r){const s=new wX(n),a=o.map(c=>new Jht(c,this.nodeMapper,()=>this.compressibleNodeMapper,this._onDidChangeNodeSlowState.event)),l=eft(r)||{};return new lCe(e,t,s,a,l)}asTreeElement(e,t){return Object.assign({incompressible:this.compressionDelegate.isIncompressible(e.element)},super.asTreeElement(e,t))}updateOptions(e={}){this.tree.updateOptions(e)}render(e,t){if(!this.identityProvider)return super.render(e,t);const n=h=>this.identityProvider.getId(h).toString(),o=h=>{const f=new Set;for(const g of h){const p=this.tree.getCompressedTreeNode(g===this.root?null:g);if(!!p.element)for(const v of p.element.elements)f.add(n(v.element))}return f},r=o(this.tree.getSelection()),s=o(this.tree.getFocus());super.render(e,t);const a=this.getSelection();let l=!1;const c=this.getFocus();let u=!1;const d=h=>{const f=h.element;if(f)for(let g=0;g{const n=this.filter.filter(t,1),o=nft(n);if(o===2)throw new Error("Recursive tree visibility not supported in async data compressed trees");return o===1})),super.processChildren(e)}}function nft(i){return typeof i=="boolean"?i?1:0:yX(i)?vk(i.visibility):vk(i)}class ift extends rCe{constructor(e,t,n,o,r,s={}){super(e,t,n,o,s),this.user=e,this.dataSource=r,this.identityProvider=s.identityProvider}createModel(e,t,n){return new SX(e,t,n)}}new lt("isMac",Nn,C("isMac","Whether the operating system is macOS"));new lt("isLinux",xs,C("isLinux","Whether the operating system is Linux"));const B5=new lt("isWindows",ls,C("isWindows","Whether the operating system is Windows")),dCe=new lt("isWeb",qv,C("isWeb","Whether the platform is a web browser"));new lt("isMacNative",Nn&&!qv,C("isMacNative","Whether the operating system is macOS on a non-browser platform"));new lt("isIOS",Kd,C("isIOS","Whether the operating system is iOS"));new lt("isMobile",EXe,C("isMobile","Whether the platform is a mobile web browser"));new lt("isDevelopment",!1,!0);new lt("productQualityType","",C("productQualityType","Quality type of VS Code"));const hCe="inputFocus";new lt(hCe,!1,C("inputFocus","Whether keyboard focus is inside an input box"));var Cp=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Oi=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const Xc=yn("listService");class oft{get lastFocusedList(){return this._lastFocusedWidget}constructor(){this.disposables=new Be,this.lists=[],this._lastFocusedWidget=void 0,this._hasCreatedStyleController=!1}setLastFocusedList(e){var t,n;e!==this._lastFocusedWidget&&((t=this._lastFocusedWidget)===null||t===void 0||t.getHTMLElement().classList.remove("last-focused"),this._lastFocusedWidget=e,(n=this._lastFocusedWidget)===null||n===void 0||n.getHTMLElement().classList.add("last-focused"))}register(e,t){if(this._hasCreatedStyleController||(this._hasCreatedStyleController=!0,new j1e(Wc(),"").style(jb)),this.lists.some(o=>o.widget===e))throw new Error("Cannot register the same widget multiple times");const n={widget:e,extraContextKeys:t};return this.lists.push(n),e.getHTMLElement()===document.activeElement&&this.setLastFocusedList(e),Tu(e.onDidFocus(()=>this.setLastFocusedList(e)),zt(()=>this.lists.splice(this.lists.indexOf(n),1)),e.onDidDispose(()=>{this.lists=this.lists.filter(o=>o!==n),this._lastFocusedWidget===e&&this.setLastFocusedList(void 0)}))}dispose(){this.disposables.dispose()}}const Ck=new lt("listScrollAtBoundary","none");Me.or(Ck.isEqualTo("top"),Ck.isEqualTo("both"));Me.or(Ck.isEqualTo("bottom"),Ck.isEqualTo("both"));const fCe=new lt("listFocus",!0),W5=new lt("listSupportsMultiselect",!0),gCe=Me.and(fCe,Me.not(hCe)),kX=new lt("listHasSelectionOrFocus",!1),IX=new lt("listDoubleSelection",!1),TX=new lt("listMultiSelection",!1),V5=new lt("listSelectionNavigation",!1),rft=new lt("listSupportsFind",!0),NX=new lt("treeElementCanCollapse",!1),sft=new lt("treeElementHasParent",!1),RX=new lt("treeElementCanExpand",!1),aft=new lt("treeElementHasChild",!1),lft=new lt("treeFindOpen",!1),pCe="listTypeNavigationMode",mCe="listAutomaticKeyboardNavigation";function H5(i,e){const t=i.createScoped(e.getHTMLElement());return fCe.bindTo(t),t}function $5(i,e){const t=Ck.bindTo(i),n=()=>{const o=e.scrollTop===0,r=e.scrollHeight-e.renderHeight-e.scrollTop<1;o&&r?t.set("both"):o?t.set("top"):r?t.set("bottom"):t.set("none")};return n(),e.onDidScroll(n)}const Kb="workbench.list.multiSelectModifier",yM="workbench.list.openMode",Pc="workbench.list.horizontalScrolling",MX="workbench.list.defaultFindMode",AX="workbench.list.typeNavigationMode",KP="workbench.list.keyboardNavigation",Xd="workbench.list.scrollByPage",PX="workbench.list.defaultFindMatchType",yk="workbench.tree.indent",qP="workbench.tree.renderIndentGuides",Yd="workbench.list.smoothScrolling",Cf="workbench.list.mouseWheelScrollSensitivity",yf="workbench.list.fastScrollSensitivity",GP="workbench.tree.expandMode";function wf(i){return i.getValue(Kb)==="alt"}class cft extends _e{constructor(e){super(),this.configurationService=e,this.useAltAsMultipleSelectionModifier=wf(e),this.registerListeners()}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration(e=>{e.affectsConfiguration(Kb)&&(this.useAltAsMultipleSelectionModifier=wf(this.configurationService))}))}isSelectionSingleChangeEvent(e){return this.useAltAsMultipleSelectionModifier?e.browserEvent.altKey:$1e(e)}isSelectionRangeChangeEvent(e){return z1e(e)}}function z5(i,e){var t;const n=i.get(En),o=i.get(xi),r=new Be;return[Object.assign(Object.assign({},e),{keyboardNavigationDelegate:{mightProducePrintableCharacter(a){return o.mightProducePrintableCharacter(a)}},smoothScrolling:Boolean(n.getValue(Yd)),mouseWheelScrollSensitivity:n.getValue(Cf),fastScrollSensitivity:n.getValue(yf),multipleSelectionController:(t=e.multipleSelectionController)!==null&&t!==void 0?t:r.add(new cft(n)),keyboardNavigationEventFilter:hft(o),scrollByPage:Boolean(n.getValue(Xd))}),r]}let S$=class extends qu{constructor(e,t,n,o,r,s,a,l,c){const u=typeof r.horizontalScrolling!="undefined"?r.horizontalScrolling:Boolean(l.getValue(Pc)),[d,h]=c.invokeFunction(z5,r);super(e,t,n,o,Object.assign(Object.assign({keyboardSupport:!1},d),{horizontalScrolling:u})),this.disposables.add(h),this.contextKeyService=H5(s,this),this.disposables.add($5(this.contextKeyService,this)),this.listSupportsMultiSelect=W5.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(r.multipleSelectionSupport!==!1),V5.bindTo(this.contextKeyService).set(Boolean(r.selectionNavigation)),this.listHasSelectionOrFocus=kX.bindTo(this.contextKeyService),this.listDoubleSelection=IX.bindTo(this.contextKeyService),this.listMultiSelection=TX.bindTo(this.contextKeyService),this.horizontalScrolling=r.horizontalScrolling,this._useAltAsMultipleSelectionModifier=wf(l),this.disposables.add(this.contextKeyService),this.disposables.add(a.register(this)),this.updateStyles(r.overrideStyles),this.disposables.add(this.onDidChangeSelection(()=>{const g=this.getSelection(),p=this.getFocus();this.contextKeyService.bufferChangeEvents(()=>{this.listHasSelectionOrFocus.set(g.length>0||p.length>0),this.listMultiSelection.set(g.length>1),this.listDoubleSelection.set(g.length===2)})})),this.disposables.add(this.onDidChangeFocus(()=>{const g=this.getSelection(),p=this.getFocus();this.listHasSelectionOrFocus.set(g.length>0||p.length>0)})),this.disposables.add(l.onDidChangeConfiguration(g=>{g.affectsConfiguration(Kb)&&(this._useAltAsMultipleSelectionModifier=wf(l));let p={};if(g.affectsConfiguration(Pc)&&this.horizontalScrolling===void 0){const v=Boolean(l.getValue(Pc));p=Object.assign(Object.assign({},p),{horizontalScrolling:v})}if(g.affectsConfiguration(Xd)){const v=Boolean(l.getValue(Xd));p=Object.assign(Object.assign({},p),{scrollByPage:v})}if(g.affectsConfiguration(Yd)){const v=Boolean(l.getValue(Yd));p=Object.assign(Object.assign({},p),{smoothScrolling:v})}if(g.affectsConfiguration(Cf)){const v=l.getValue(Cf);p=Object.assign(Object.assign({},p),{mouseWheelScrollSensitivity:v})}if(g.affectsConfiguration(yf)){const v=l.getValue(yf);p=Object.assign(Object.assign({},p),{fastScrollSensitivity:v})}Object.keys(p).length>0&&this.updateOptions(p)})),this.navigator=new vCe(this,Object.assign({configurationService:l},r)),this.disposables.add(this.navigator)}updateOptions(e){super.updateOptions(e),e.overrideStyles!==void 0&&this.updateStyles(e.overrideStyles),e.multipleSelectionSupport!==void 0&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyles(e){this.style(e?xS(e):jb)}};S$=Cp([Oi(5,Ut),Oi(6,Xc),Oi(7,En),Oi(8,$t)],S$);let wae=class extends ght{constructor(e,t,n,o,r,s,a,l,c){const u=typeof r.horizontalScrolling!="undefined"?r.horizontalScrolling:Boolean(l.getValue(Pc)),[d,h]=c.invokeFunction(z5,r);super(e,t,n,o,Object.assign(Object.assign({keyboardSupport:!1},d),{horizontalScrolling:u})),this.disposables=new Be,this.disposables.add(h),this.contextKeyService=H5(s,this),this.disposables.add($5(this.contextKeyService,this.widget)),this.horizontalScrolling=r.horizontalScrolling,this.listSupportsMultiSelect=W5.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(r.multipleSelectionSupport!==!1),V5.bindTo(this.contextKeyService).set(Boolean(r.selectionNavigation)),this._useAltAsMultipleSelectionModifier=wf(l),this.disposables.add(this.contextKeyService),this.disposables.add(a.register(this)),this.updateStyles(r.overrideStyles),this.disposables.add(l.onDidChangeConfiguration(g=>{g.affectsConfiguration(Kb)&&(this._useAltAsMultipleSelectionModifier=wf(l));let p={};if(g.affectsConfiguration(Pc)&&this.horizontalScrolling===void 0){const v=Boolean(l.getValue(Pc));p=Object.assign(Object.assign({},p),{horizontalScrolling:v})}if(g.affectsConfiguration(Xd)){const v=Boolean(l.getValue(Xd));p=Object.assign(Object.assign({},p),{scrollByPage:v})}if(g.affectsConfiguration(Yd)){const v=Boolean(l.getValue(Yd));p=Object.assign(Object.assign({},p),{smoothScrolling:v})}if(g.affectsConfiguration(Cf)){const v=l.getValue(Cf);p=Object.assign(Object.assign({},p),{mouseWheelScrollSensitivity:v})}if(g.affectsConfiguration(yf)){const v=l.getValue(yf);p=Object.assign(Object.assign({},p),{fastScrollSensitivity:v})}Object.keys(p).length>0&&this.updateOptions(p)})),this.navigator=new vCe(this,Object.assign({configurationService:l},r)),this.disposables.add(this.navigator)}updateOptions(e){super.updateOptions(e),e.overrideStyles!==void 0&&this.updateStyles(e.overrideStyles),e.multipleSelectionSupport!==void 0&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyles(e){this.style(e?xS(e):jb)}dispose(){this.disposables.dispose(),super.dispose()}};wae=Cp([Oi(5,Ut),Oi(6,Xc),Oi(7,En),Oi(8,$t)],wae);let Sae=class extends F5{constructor(e,t,n,o,r,s,a,l,c,u){const d=typeof s.horizontalScrolling!="undefined"?s.horizontalScrolling:Boolean(c.getValue(Pc)),[h,f]=u.invokeFunction(z5,s);super(e,t,n,o,r,Object.assign(Object.assign({keyboardSupport:!1},h),{horizontalScrolling:d})),this.disposables.add(f),this.contextKeyService=H5(a,this),this.disposables.add($5(this.contextKeyService,this)),this.listSupportsMultiSelect=W5.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(s.multipleSelectionSupport!==!1),V5.bindTo(this.contextKeyService).set(Boolean(s.selectionNavigation)),this.listHasSelectionOrFocus=kX.bindTo(this.contextKeyService),this.listDoubleSelection=IX.bindTo(this.contextKeyService),this.listMultiSelection=TX.bindTo(this.contextKeyService),this.horizontalScrolling=s.horizontalScrolling,this._useAltAsMultipleSelectionModifier=wf(c),this.disposables.add(this.contextKeyService),this.disposables.add(l.register(this)),this.updateStyles(s.overrideStyles),this.disposables.add(this.onDidChangeSelection(()=>{const p=this.getSelection(),v=this.getFocus();this.contextKeyService.bufferChangeEvents(()=>{this.listHasSelectionOrFocus.set(p.length>0||v.length>0),this.listMultiSelection.set(p.length>1),this.listDoubleSelection.set(p.length===2)})})),this.disposables.add(this.onDidChangeFocus(()=>{const p=this.getSelection(),v=this.getFocus();this.listHasSelectionOrFocus.set(p.length>0||v.length>0)})),this.disposables.add(c.onDidChangeConfiguration(p=>{p.affectsConfiguration(Kb)&&(this._useAltAsMultipleSelectionModifier=wf(c));let v={};if(p.affectsConfiguration(Pc)&&this.horizontalScrolling===void 0){const m=Boolean(c.getValue(Pc));v=Object.assign(Object.assign({},v),{horizontalScrolling:m})}if(p.affectsConfiguration(Xd)){const m=Boolean(c.getValue(Xd));v=Object.assign(Object.assign({},v),{scrollByPage:m})}if(p.affectsConfiguration(Yd)){const m=Boolean(c.getValue(Yd));v=Object.assign(Object.assign({},v),{smoothScrolling:m})}if(p.affectsConfiguration(Cf)){const m=c.getValue(Cf);v=Object.assign(Object.assign({},v),{mouseWheelScrollSensitivity:m})}if(p.affectsConfiguration(yf)){const m=c.getValue(yf);v=Object.assign(Object.assign({},v),{fastScrollSensitivity:m})}Object.keys(v).length>0&&this.updateOptions(v)})),this.navigator=new uft(this,Object.assign({configurationService:c},s)),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?xS(e):jb)}dispose(){this.disposables.dispose(),super.dispose()}};Sae=Cp([Oi(6,Ut),Oi(7,Xc),Oi(8,En),Oi(9,$t)],Sae);class OX extends _e{constructor(e,t){var n;super(),this.widget=e,this._onDidOpen=this._register(new le),this.onDidOpen=this._onDidOpen.event,this._register(st.filter(this.widget.onDidChangeSelection,o=>o.browserEvent instanceof KeyboardEvent)(o=>this.onSelectionFromKeyboard(o))),this._register(this.widget.onPointer(o=>this.onPointer(o.element,o.browserEvent))),this._register(this.widget.onMouseDblClick(o=>this.onMouseDblClick(o.element,o.browserEvent))),typeof(t==null?void 0:t.openOnSingleClick)!="boolean"&&(t==null?void 0:t.configurationService)?(this.openOnSingleClick=(t==null?void 0:t.configurationService.getValue(yM))!=="doubleClick",this._register(t==null?void 0:t.configurationService.onDidChangeConfiguration(o=>{o.affectsConfiguration(yM)&&(this.openOnSingleClick=(t==null?void 0:t.configurationService.getValue(yM))!=="doubleClick")}))):this.openOnSingleClick=(n=t==null?void 0:t.openOnSingleClick)!==null&&n!==void 0?n:!0}onSelectionFromKeyboard(e){if(e.elements.length!==1)return;const t=e.browserEvent,n=typeof t.preserveFocus=="boolean"?t.preserveFocus:!0,o=typeof t.pinned=="boolean"?t.pinned:!n,r=!1;this._open(this.getSelectedElement(),n,o,r,e.browserEvent)}onPointer(e,t){if(!this.openOnSingleClick||t.detail===2)return;const o=t.button===1,r=!0,s=o,a=t.ctrlKey||t.metaKey||t.altKey;this._open(e,r,s,a,t)}onMouseDblClick(e,t){if(!t)return;const n=t.target;if(n.classList.contains("monaco-tl-twistie")||n.classList.contains("monaco-icon-label")&&n.classList.contains("folder-icon")&&t.offsetX<16)return;const r=!1,s=!0,a=t.ctrlKey||t.metaKey||t.altKey;this._open(e,r,s,a,t)}_open(e,t,n,o,r){!e||this._onDidOpen.fire({editorOptions:{preserveFocus:t,pinned:n,revealIfVisible:!0},sideBySide:o,element:e,browserEvent:r})}}class vCe extends OX{constructor(e,t){super(e,t),this.widget=e}getSelectedElement(){return this.widget.getSelectedElements()[0]}}class uft extends OX{constructor(e,t){super(e,t)}getSelectedElement(){return this.widget.getSelectedElements()[0]}}class dft extends OX{constructor(e,t){super(e,t)}getSelectedElement(){var e;return(e=this.widget.getSelection()[0])!==null&&e!==void 0?e:void 0}}function hft(i){let e=!1;return t=>{if(t.toKeyCodeChord().isModifierKey())return!1;if(e)return e=!1,!1;const n=i.softDispatch(t,t.target);return n.kind===1?(e=!0,!1):(e=!1,n.kind===0)}}let xae=class extends LX{constructor(e,t,n,o,r,s,a,l,c){const{options:u,getTypeNavigationMode:d,disposable:h}=s.invokeFunction(sT,r);super(e,t,n,o,u),this.disposables.add(h),this.internals=new ab(this,r,d,r.overrideStyles,a,l,c),this.disposables.add(this.internals)}updateOptions(e){super.updateOptions(e),this.internals.updateOptions(e)}};xae=Cp([Oi(5,$t),Oi(6,Ut),Oi(7,Xc),Oi(8,En)],xae);let Lae=class extends lCe{constructor(e,t,n,o,r,s,a,l,c){const{options:u,getTypeNavigationMode:d,disposable:h}=s.invokeFunction(sT,r);super(e,t,n,o,u),this.disposables.add(h),this.internals=new ab(this,r,d,r.overrideStyles,a,l,c),this.disposables.add(this.internals)}updateOptions(e={}){super.updateOptions(e),e.overrideStyles&&this.internals.updateStyleOverrides(e.overrideStyles),this.internals.updateOptions(e)}};Lae=Cp([Oi(5,$t),Oi(6,Ut),Oi(7,Xc),Oi(8,En)],Lae);let Eae=class extends ift{constructor(e,t,n,o,r,s,a,l,c,u){const{options:d,getTypeNavigationMode:h,disposable:f}=a.invokeFunction(sT,s);super(e,t,n,o,r,d),this.disposables.add(f),this.internals=new ab(this,s,h,s.overrideStyles,l,c,u),this.disposables.add(this.internals)}updateOptions(e={}){super.updateOptions(e),e.overrideStyles!==void 0&&this.internals.updateStyleOverrides(e.overrideStyles),this.internals.updateOptions(e)}};Eae=Cp([Oi(6,$t),Oi(7,Ut),Oi(8,Xc),Oi(9,En)],Eae);let x$=class extends uCe{get onDidOpen(){return this.internals.onDidOpen}constructor(e,t,n,o,r,s,a,l,c,u){const{options:d,getTypeNavigationMode:h,disposable:f}=a.invokeFunction(sT,s);super(e,t,n,o,r,d),this.disposables.add(f),this.internals=new ab(this,s,h,s.overrideStyles,l,c,u),this.disposables.add(this.internals)}updateOptions(e={}){super.updateOptions(e),e.overrideStyles&&this.internals.updateStyleOverrides(e.overrideStyles),this.internals.updateOptions(e)}};x$=Cp([Oi(6,$t),Oi(7,Ut),Oi(8,Xc),Oi(9,En)],x$);let Dae=class extends tft{constructor(e,t,n,o,r,s,a,l,c,u,d){const{options:h,getTypeNavigationMode:f,disposable:g}=l.invokeFunction(sT,a);super(e,t,n,o,r,s,h),this.disposables.add(g),this.internals=new ab(this,a,f,a.overrideStyles,c,u,d),this.disposables.add(this.internals)}updateOptions(e){super.updateOptions(e),this.internals.updateOptions(e)}};Dae=Cp([Oi(7,$t),Oi(8,Ut),Oi(9,Xc),Oi(10,En)],Dae);function _Ce(i){const e=i.getValue(MX);if(e==="highlight")return tf.Highlight;if(e==="filter")return tf.Filter;const t=i.getValue(KP);if(t==="simple"||t==="highlight")return tf.Highlight;if(t==="filter")return tf.Filter}function bCe(i){const e=i.getValue(PX);if(e==="fuzzy")return sb.Fuzzy;if(e==="contiguous")return sb.Contiguous}function sT(i,e){var t;const n=i.get(En),o=i.get(_p),r=i.get(Ut),s=i.get($t),a=()=>{const f=r.getContextKeyValue(pCe);if(f==="automatic")return Wh.Automatic;if(f==="trigger"||r.getContextKeyValue(mCe)===!1)return Wh.Trigger;const p=n.getValue(AX);if(p==="automatic")return Wh.Automatic;if(p==="trigger")return Wh.Trigger},l=e.horizontalScrolling!==void 0?e.horizontalScrolling:Boolean(n.getValue(Pc)),[c,u]=s.invokeFunction(z5,e),d=e.paddingBottom,h=e.renderIndentGuides!==void 0?e.renderIndentGuides:n.getValue(qP);return{getTypeNavigationMode:a,disposable:u,options:Object.assign(Object.assign({keyboardSupport:!1},c),{indent:typeof n.getValue(yk)=="number"?n.getValue(yk):void 0,renderIndentGuides:h,smoothScrolling:Boolean(n.getValue(Yd)),defaultFindMode:_Ce(n),defaultFindMatchType:bCe(n),horizontalScrolling:l,scrollByPage:Boolean(n.getValue(Xd)),paddingBottom:d,hideTwistiesOfChildlessElements:e.hideTwistiesOfChildlessElements,expandOnlyOnTwistieClick:(t=e.expandOnlyOnTwistieClick)!==null&&t!==void 0?t:n.getValue(GP)==="doubleClick",contextViewProvider:o,findWidgetStyles:qdt})}}let ab=class{get onDidOpen(){return this.navigator.onDidOpen}constructor(e,t,n,o,r,s,a){var l;this.tree=e,this.disposables=[],this.contextKeyService=H5(r,e),this.disposables.push($5(this.contextKeyService,e)),this.listSupportsMultiSelect=W5.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(t.multipleSelectionSupport!==!1),V5.bindTo(this.contextKeyService).set(Boolean(t.selectionNavigation)),this.listSupportFindWidget=rft.bindTo(this.contextKeyService),this.listSupportFindWidget.set((l=t.findWidgetEnabled)!==null&&l!==void 0?l:!0),this.hasSelectionOrFocus=kX.bindTo(this.contextKeyService),this.hasDoubleSelection=IX.bindTo(this.contextKeyService),this.hasMultiSelection=TX.bindTo(this.contextKeyService),this.treeElementCanCollapse=NX.bindTo(this.contextKeyService),this.treeElementHasParent=sft.bindTo(this.contextKeyService),this.treeElementCanExpand=RX.bindTo(this.contextKeyService),this.treeElementHasChild=aft.bindTo(this.contextKeyService),this.treeFindOpen=lft.bindTo(this.contextKeyService),this._useAltAsMultipleSelectionModifier=wf(a),this.updateStyleOverrides(o);const u=()=>{const h=e.getFocus()[0];if(!h)return;const f=e.getNode(h);this.treeElementCanCollapse.set(f.collapsible&&!f.collapsed),this.treeElementHasParent.set(!!e.getParentElement(h)),this.treeElementCanExpand.set(f.collapsible&&f.collapsed),this.treeElementHasChild.set(!!e.getFirstElementChild(h))},d=new Set;d.add(pCe),d.add(mCe),this.disposables.push(this.contextKeyService,s.register(e),e.onDidChangeSelection(()=>{const h=e.getSelection(),f=e.getFocus();this.contextKeyService.bufferChangeEvents(()=>{this.hasSelectionOrFocus.set(h.length>0||f.length>0),this.hasMultiSelection.set(h.length>1),this.hasDoubleSelection.set(h.length===2)})}),e.onDidChangeFocus(()=>{const h=e.getSelection(),f=e.getFocus();this.hasSelectionOrFocus.set(h.length>0||f.length>0),u()}),e.onDidChangeCollapseState(u),e.onDidChangeModel(u),e.onDidChangeFindOpenState(h=>this.treeFindOpen.set(h)),a.onDidChangeConfiguration(h=>{let f={};if(h.affectsConfiguration(Kb)&&(this._useAltAsMultipleSelectionModifier=wf(a)),h.affectsConfiguration(yk)){const g=a.getValue(yk);f=Object.assign(Object.assign({},f),{indent:g})}if(h.affectsConfiguration(qP)&&t.renderIndentGuides===void 0){const g=a.getValue(qP);f=Object.assign(Object.assign({},f),{renderIndentGuides:g})}if(h.affectsConfiguration(Yd)){const g=Boolean(a.getValue(Yd));f=Object.assign(Object.assign({},f),{smoothScrolling:g})}if(h.affectsConfiguration(MX)||h.affectsConfiguration(KP)){const g=_Ce(a);f=Object.assign(Object.assign({},f),{defaultFindMode:g})}if(h.affectsConfiguration(AX)||h.affectsConfiguration(KP)){const g=n();f=Object.assign(Object.assign({},f),{typeNavigationMode:g})}if(h.affectsConfiguration(PX)){const g=bCe(a);f=Object.assign(Object.assign({},f),{defaultFindMatchType:g})}if(h.affectsConfiguration(Pc)&&t.horizontalScrolling===void 0){const g=Boolean(a.getValue(Pc));f=Object.assign(Object.assign({},f),{horizontalScrolling:g})}if(h.affectsConfiguration(Xd)){const g=Boolean(a.getValue(Xd));f=Object.assign(Object.assign({},f),{scrollByPage:g})}if(h.affectsConfiguration(GP)&&t.expandOnlyOnTwistieClick===void 0&&(f=Object.assign(Object.assign({},f),{expandOnlyOnTwistieClick:a.getValue(GP)==="doubleClick"})),h.affectsConfiguration(Cf)){const g=a.getValue(Cf);f=Object.assign(Object.assign({},f),{mouseWheelScrollSensitivity:g})}if(h.affectsConfiguration(yf)){const g=a.getValue(yf);f=Object.assign(Object.assign({},f),{fastScrollSensitivity:g})}Object.keys(f).length>0&&e.updateOptions(f)}),this.contextKeyService.onDidChangeContext(h=>{h.affectsSome(d)&&e.updateOptions({typeNavigationMode:n()})})),this.navigator=new dft(e,Object.assign({configurationService:a},t)),this.disposables.push(this.navigator)}updateOptions(e){e.multipleSelectionSupport!==void 0&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyleOverrides(e){this.tree.style(e?xS(e):jb)}dispose(){this.disposables=si(this.disposables)}};ab=Cp([Oi(4,Ut),Oi(5,Xc),Oi(6,En)],ab);const fft=no.as(ch.Configuration);fft.registerConfiguration({id:"workbench",order:7,title:C("workbenchConfigurationTitle","Workbench"),type:"object",properties:{[Kb]:{type:"string",enum:["ctrlCmd","alt"],markdownEnumDescriptions:[C("multiSelectModifier.ctrlCmd","Maps to `Control` on Windows and Linux and to `Command` on macOS."),C("multiSelectModifier.alt","Maps to `Alt` on Windows and Linux and to `Option` on macOS.")],default:"ctrlCmd",description:C({key:"multiSelectModifier",comment:["- `ctrlCmd` refers to a value the setting can take and should not be localized.","- `Control` and `Command` refer to the modifier keys Ctrl or Cmd on the keyboard and can be localized."]},"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.")},[yM]:{type:"string",enum:["singleClick","doubleClick"],default:"singleClick",description:C({key:"openModeModifier",comment:["`singleClick` and `doubleClick` refers to a value the setting can take and should not be localized."]},"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.")},[Pc]:{type:"boolean",default:!1,description:C("horizontalScrolling setting","Controls whether lists and trees support horizontal scrolling in the workbench. Warning: turning on this setting has a performance implication.")},[Xd]:{type:"boolean",default:!1,description:C("list.scrollByPage","Controls whether clicks in the scrollbar scroll page by page.")},[yk]:{type:"number",default:8,minimum:4,maximum:40,description:C("tree indent setting","Controls tree indentation in pixels.")},[qP]:{type:"string",enum:["none","onHover","always"],default:"onHover",description:C("render tree indent guides","Controls whether the tree should render indent guides.")},[Yd]:{type:"boolean",default:!1,description:C("list smoothScrolling setting","Controls whether lists and trees have smooth scrolling.")},[Cf]:{type:"number",default:1,markdownDescription:C("Mouse Wheel Scroll Sensitivity","A multiplier to be used on the `deltaX` and `deltaY` of mouse wheel scroll events.")},[yf]:{type:"number",default:5,markdownDescription:C("Fast Scroll Sensitivity","Scrolling speed multiplier when pressing `Alt`.")},[MX]:{type:"string",enum:["highlight","filter"],enumDescriptions:[C("defaultFindModeSettingKey.highlight","Highlight elements when searching. Further up and down navigation will traverse only the highlighted elements."),C("defaultFindModeSettingKey.filter","Filter elements when searching.")],default:"highlight",description:C("defaultFindModeSettingKey","Controls the default find mode for lists and trees in the workbench.")},[KP]:{type:"string",enum:["simple","highlight","filter"],enumDescriptions:[C("keyboardNavigationSettingKey.simple","Simple keyboard navigation focuses elements which match the keyboard input. Matching is done only on prefixes."),C("keyboardNavigationSettingKey.highlight","Highlight keyboard navigation highlights elements which match the keyboard input. Further up and down navigation will traverse only the highlighted elements."),C("keyboardNavigationSettingKey.filter","Filter keyboard navigation will filter out and hide all the elements which do not match the keyboard input.")],default:"highlight",description:C("keyboardNavigationSettingKey","Controls the keyboard navigation style for lists and trees in the workbench. Can be simple, highlight and filter."),deprecated:!0,deprecationMessage:C("keyboardNavigationSettingKeyDeprecated","Please use 'workbench.list.defaultFindMode' and 'workbench.list.typeNavigationMode' instead.")},[PX]:{type:"string",enum:["fuzzy","contiguous"],enumDescriptions:[C("defaultFindMatchTypeSettingKey.fuzzy","Use fuzzy matching when searching."),C("defaultFindMatchTypeSettingKey.contiguous","Use contiguous matching when searching.")],default:"fuzzy",description:C("defaultFindMatchTypeSettingKey","Controls the type of matching used when searching lists and trees in the workbench.")},[GP]:{type:"string",enum:["singleClick","doubleClick"],default:"singleClick",description:C("expand mode","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.")},[AX]:{type:"string",enum:["automatic","trigger"],default:"automatic",markdownDescription:C("typeNavigationMode2","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 L$;(function(i){i[i.PRESERVE=0]="PRESERVE",i[i.LAST=1]="LAST"})(L$||(L$={}));const qb={Quickaccess:"workbench.contributions.quickaccess"};class gft{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,n)=>n.prefix.length-t.prefix.length),zt(()=>{this.providers.splice(this.providers.indexOf(e),1),this.defaultProvider===e&&(this.defaultProvider=void 0)})}getQuickAccessProviders(){return hf([this.defaultProvider,...this.providers])}getQuickAccessProvider(e){return e&&this.providers.find(n=>e.startsWith(n.prefix))||void 0||this.defaultProvider}}no.add(qb.Quickaccess,new gft);const pft={ctrlCmd:!1,alt:!1};var wk;(function(i){i[i.Blur=1]="Blur",i[i.Gesture=2]="Gesture",i[i.Other=3]="Other"})(wk||(wk={}));var vd;(function(i){i[i.NONE=0]="NONE",i[i.FIRST=1]="FIRST",i[i.SECOND=2]="SECOND",i[i.LAST=3]="LAST"})(vd||(vd={}));const uh=yn("quickInputService");var mft=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},kae=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let E$=class extends _e{constructor(e,t){super(),this.quickInputService=e,this.instantiationService=t,this.registry=no.as(qb.Quickaccess),this.mapProviderToDescriptor=new Map,this.lastAcceptedPickerValues=new Map,this.visibleQuickAccess=void 0}show(e="",t){this.doShowOrPick(e,!1,t)}doShowOrPick(e,t,n){var o;const[r,s]=this.getOrInstantiateProvider(e),a=this.visibleQuickAccess,l=a==null?void 0:a.descriptor;if(a&&s&&l===s){e!==s.prefix&&!(n!=null&&n.preserveValue)&&(a.picker.value=e),this.adjustValueSelection(a.picker,s,n);return}if(s&&!(n!=null&&n.preserveValue)){let f;if(a&&l&&l!==s){const g=a.value.substr(l.prefix.length);g&&(f=`${s.prefix}${g}`)}if(!f){const g=r==null?void 0:r.defaultFilterValue;g===L$.LAST?f=this.lastAcceptedPickerValues.get(s):typeof g=="string"&&(f=`${s.prefix}${g}`)}typeof f=="string"&&(e=f)}const c=new Be,u=c.add(this.quickInputService.createQuickPick());u.value=e,this.adjustValueSelection(u,s,n),u.placeholder=s==null?void 0:s.placeholder,u.quickNavigate=n==null?void 0:n.quickNavigateConfiguration,u.hideInput=!!u.quickNavigate&&!a,(typeof(n==null?void 0:n.itemActivation)=="number"||(n==null?void 0:n.quickNavigateConfiguration))&&(u.itemActivation=(o=n==null?void 0:n.itemActivation)!==null&&o!==void 0?o:vd.SECOND),u.contextKey=s==null?void 0:s.contextKey,u.filterValue=f=>f.substring(s?s.prefix.length:0);let d;t&&(d=new n5,c.add(st.once(u.onWillAccept)(f=>{f.veto(),u.hide()}))),c.add(this.registerPickerListeners(u,r,s,e,n==null?void 0:n.providerOptions));const h=c.add(new Ro);if(r&&c.add(r.provide(u,h.token,n==null?void 0:n.providerOptions)),st.once(u.onDidHide)(()=>{u.selectedItems.length===0&&h.cancel(),c.dispose(),d==null||d.complete(u.selectedItems.slice(0))}),u.show(),t)return d==null?void 0:d.p}adjustValueSelection(e,t,n){var o;let r;n!=null&&n.preserveValue?r=[e.value.length,e.value.length]:r=[(o=t==null?void 0:t.prefix.length)!==null&&o!==void 0?o:0,e.value.length],e.valueSelection=r}registerPickerListeners(e,t,n,o,r){const s=new Be,a=this.visibleQuickAccess={picker:e,descriptor:n,value:o};return s.add(zt(()=>{a===this.visibleQuickAccess&&(this.visibleQuickAccess=void 0)})),s.add(e.onDidChangeValue(l=>{const[c]=this.getOrInstantiateProvider(l);c!==t?this.show(l,{preserveValue:!0,providerOptions:r}):a.value=l})),n&&s.add(e.onDidAccept(()=>{this.lastAcceptedPickerValues.set(n,e.value)})),s}getOrInstantiateProvider(e){const t=this.registry.getQuickAccessProvider(e);if(!t)return[void 0,void 0];let n=this.mapProviderToDescriptor.get(t);return n||(n=this.instantiationService.createInstance(t.ctor),this.mapProviderToDescriptor.set(t,n)),[n,t]}};E$=mft([kae(0,uh),kae(1,$t)],E$);ve.white.toString(),ve.white.toString();class D$ extends _e{get onDidClick(){return this._onDidClick.event}constructor(e,t){super(),this._label="",this._onDidClick=this._register(new le),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 n=t.secondary?t.buttonSecondaryBackground:t.buttonBackground,o=t.secondary?t.buttonSecondaryForeground:t.buttonForeground;this._element.style.color=o||"",this._element.style.backgroundColor=n||"",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")),e.appendChild(this._element),this._register(Ei.addTarget(this._element)),[et.CLICK,Di.Tap].forEach(r=>{this._register(ke(this._element,r,s=>{if(!this.enabled){dn.stop(s);return}this._onDidClick.fire(s)}))}),this._register(ke(this._element,et.KEY_DOWN,r=>{const s=new Pi(r);let a=!1;this.enabled&&(s.equals(3)||s.equals(10))?(this._onDidClick.fire(r),a=!0):s.equals(9)&&(this._element.blur(),a=!0),a&&dn.stop(s,!0)})),this._register(ke(this._element,et.MOUSE_OVER,r=>{this._element.classList.contains("disabled")||this.updateBackground(!0)})),this._register(ke(this._element,et.MOUSE_OUT,r=>{this.updateBackground(!1)})),this.focusTracker=this._register(pf(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 n of Qm(e))if(typeof n=="string"){if(n=n.trim(),n==="")continue;const o=document.createElement("span");o.textContent=n,t.push(o)}else t.push(n);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){var t;if(this._label===e||Zm(this._label)&&Zm(e)&&Out(this._label,e))return;this._element.classList.add("monaco-text-button");const n=this.options.supportShortLabel?this._labelElement:this._element;if(Zm(e)){const o=M5(e,{inline:!0});o.dispose();const r=(t=o.element.querySelector("p"))===null||t===void 0?void 0:t.innerHTML;if(r){const s=s0e(r,{ADD_TAGS:["b","i","u","code","span"],ALLOWED_ATTR:["class"],RETURN_TRUSTED_TYPE:!0});n.innerHTML=s}else jr(n)}else this.options.supportIcons?jr(n,...this.getContentElements(e)):n.textContent=e;typeof this.options.title=="string"?this._element.title=this.options.title:this.options.title&&(this._element.title=Zut(e)),this._label=e}get label(){return this._label}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")}}class k${constructor(e,t,n){this.options=t,this.styles=n,this.count=0,this.element=Ae(e,He(".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()}setTitleFormat(e){this.titleFormat=e,this.render()}render(){var e,t;this.element.textContent=X0(this.countFormat,this.count),this.element.title=X0(this.titleFormat,this.count),this.element.style.backgroundColor=(e=this.styles.badgeBackground)!==null&&e!==void 0?e:"",this.element.style.color=(t=this.styles.badgeForeground)!==null&&t!==void 0?t:"",this.styles.badgeBorder&&(this.element.style.border=`1px solid ${this.styles.badgeBorder}`)}}const Iae="done",Tae="active",z9="infinite",U9="infinite-long-running",Nae="discrete";class U5 extends _e{constructor(e,t){super(),this.workedVal=0,this.showDelayedScheduler=this._register(new bi(()=>nl(this.element),0)),this.longRunningScheduler=this._register(new bi(()=>this.infiniteLongRunning(),U5.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==null?void 0:t.progressBarBackground)||"#0E70C0",this.element.appendChild(this.bit)}off(){this.bit.style.width="inherit",this.bit.style.opacity="1",this.element.classList.remove(Tae,z9,U9,Nae),this.workedVal=0,this.totalWork=void 0,this.longRunningScheduler.cancel()}stop(){return this.doDone(!1)}doDone(e){return this.element.classList.add(Iae),this.element.classList.contains(z9)?(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(Nae,Iae,U9),this.element.classList.add(Tae,z9),this.longRunningScheduler.schedule(),this}infiniteLongRunning(){this.element.classList.add(U9)}getContainer(){return this.element}}U5.LONG_RUNNING_INFINITE_THRESHOLD=1e4;const vft=He;class _ft extends _e{constructor(e,t,n){super(),this.parent=e,this.onKeyDown=r=>ke(this.findInput.inputBox.inputElement,et.KEY_DOWN,s=>{r(new Pi(s))}),this.onMouseDown=r=>ke(this.findInput.inputBox.inputElement,et.MOUSE_DOWN,s=>{r(new kc(s))}),this.onDidChange=r=>this.findInput.onDidChange(r),this.container=Ae(this.parent,vft(".quick-input-box")),this.findInput=this._register(new oCe(this.container,void 0,{label:"",inputBoxStyles:t,toggleStyles:n}));const o=this.findInput.inputBox.inputElement;o.role="combobox",o.ariaHasPopup="menu",o.ariaAutoComplete="list",o.ariaExpanded="true"}get value(){return this.findInput.getValue()}set value(e){this.findInput.setValue(e)}select(e=null){this.findInput.inputBox.select(e)}isSelectionAtEnd(){return this.findInput.inputBox.isSelectionAtEnd()}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)}setAttribute(e,t){this.findInput.inputBox.inputElement.setAttribute(e,t)}showDecoration(e){e===So.Ignore?this.findInput.clearMessage():this.findInput.showMessage({type:e===So.Info?1:e===So.Warning?2:3,content:""})}stylesForType(e){return this.findInput.inputBox.stylesForType(e===So.Info?1:e===So.Warning?2:3)}setFocus(){this.findInput.focus()}layout(){this.findInput.inputBox.layout()}}class ev{constructor(e,t){var n;this.text="",this.title="",this.highlights=[],this.didEverRender=!1,this.supportIcons=(n=t==null?void 0:t.supportIcons)!==null&&n!==void 0?n:!1,this.domNode=Ae(e,He("span.monaco-highlighted-label"))}get element(){return this.domNode}set(e,t=[],n="",o){e||(e=""),o&&(e=ev.escapeNewLines(e,t)),!(this.didEverRender&&this.text===e&&this.title===n&&ql(this.highlights,t))&&(this.text=e,this.title=n,this.highlights=t,this.render())}render(){const e=[];let t=0;for(const n of this.highlights){if(n.end===n.start)continue;if(t{o=r===`\r +`?-1:0,s+=n;for(const a of t)a.end<=s||(a.start>=s&&(a.start+=o),a.end>=s&&(a.end+=o));return n+=o,"\u23CE"})}}class j9{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 XP extends _e{constructor(e,t){super(),this.customHovers=new Map,this.creationOptions=t,this.domNode=this._register(new j9(Ae(e,He(".monaco-icon-label")))),this.labelContainer=Ae(this.domNode.element,He(".monaco-icon-label-container"));const n=Ae(this.labelContainer,He("span.monaco-icon-name-container"));(t==null?void 0:t.supportHighlights)||(t==null?void 0:t.supportIcons)?this.nameNode=new yft(n,!!t.supportIcons):this.nameNode=new bft(n),this.hoverDelegate=t==null?void 0:t.hoverDelegate}get element(){return this.domNode.element}setLabel(e,t,n){const o=["monaco-icon-label"],r=["monaco-icon-label-container"];let s="";if(n&&(n.extraClasses&&o.push(...n.extraClasses),n.italic&&o.push("italic"),n.strikethrough&&o.push("strikethrough"),n.disabledCommand&&r.push("disabled"),n.title&&(s+=n.title)),this.domNode.className=o.join(" "),this.domNode.element.setAttribute("aria-label",s),this.labelContainer.className=r.join(" "),this.setupHover(n!=null&&n.descriptionTitle?this.labelContainer:this.element,n==null?void 0:n.title),this.nameNode.setLabel(e,n),t||this.descriptionNode){const a=this.getOrCreateDescriptionNode();a instanceof ev?(a.set(t||"",n?n.descriptionMatches:void 0,void 0,n==null?void 0:n.labelEscapeNewLines),this.setupHover(a.element,n==null?void 0:n.descriptionTitle)):(a.textContent=t&&(n==null?void 0:n.labelEscapeNewLines)?ev.escapeNewLines(t,[]):t||"",this.setupHover(a.element,(n==null?void 0:n.descriptionTitle)||""),a.empty=!t)}}setupHover(e,t){const n=this.customHovers.get(e);if(n&&(n.dispose(),this.customHovers.delete(e)),!t){e.removeAttribute("title");return}if(!this.hoverDelegate)Wut(e,t);else{const o=B1e(this.hoverDelegate,e,t);o&&this.customHovers.set(e,o)}}dispose(){super.dispose();for(const e of this.customHovers.values())e.dispose();this.customHovers.clear()}getOrCreateDescriptionNode(){var e;if(!this.descriptionNode){const t=this._register(new j9(Ae(this.labelContainer,He("span.monaco-icon-description-container"))));!((e=this.creationOptions)===null||e===void 0)&&e.supportDescriptionHighlights?this.descriptionNode=new ev(Ae(t.element,He("span.label-description")),{supportIcons:!!this.creationOptions.supportIcons}):this.descriptionNode=this._register(new j9(Ae(t.element,He("span.label-description"))))}return this.descriptionNode}}class bft{constructor(e){this.container=e,this.label=void 0,this.singleLabel=void 0}setLabel(e,t){if(!(this.label===e&&ql(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=Ae(this.container,He("a.label-name",{id:t==null?void 0:t.domId}))),this.singleLabel.textContent=e;else{this.container.innerText="",this.container.classList.add("multiple"),this.singleLabel=void 0;for(let n=0;n{const r={start:n,end:n+o.length},s=t.map(a=>fs.intersect(r,a)).filter(a=>!fs.isEmpty(a)).map(({start:a,end:l})=>({start:a-n,end:l-n}));return n=r.end+e.length,s})}class yft{constructor(e,t){this.container=e,this.supportIcons=t,this.label=void 0,this.singleLabel=void 0}setLabel(e,t){if(!(this.label===e&&ql(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=new ev(Ae(this.container,He("a.label-name",{id:t==null?void 0:t.domId})),{supportIcons:this.supportIcons})),this.singleLabel.set(e,t==null?void 0:t.matches,void 0,t==null?void 0:t.labelEscapeNewLines);else{this.container.innerText="",this.container.classList.add("multiple"),this.singleLabel=void 0;const n=(t==null?void 0:t.separator)||"/",o=Cft(e,n,t==null?void 0:t.matches);for(let r=0;r{const i=new Intl.Collator(void 0,{numeric:!0,sensitivity:"base"});return{collator:i,collatorIsNumeric:i.resolvedOptions().numeric}});new ah(()=>({collator:new Intl.Collator(void 0,{numeric:!0})}));new ah(()=>({collator:new Intl.Collator(void 0,{numeric:!0,sensitivity:"accent"})}));function Sft(i,e,t=!1){const n=i||"",o=e||"",r=Rae.value.collator.compare(n,o);return Rae.value.collatorIsNumeric&&r===0&&n!==o?no.length)return 1}return 0}var Eft=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r};class CCe{constructor(e){this.nodes=e}toString(){return this.nodes.map(e=>typeof e=="string"?e:e.label).join("")}}Eft([Mo],CCe.prototype,"toString",null);const Dft=/\[([^\]]+)\]\(((?:https?:\/\/|command:|file:)[^\)\s]+)(?: (["'])(.+?)(\3))?\)/gi;function kft(i){const e=[];let t=0,n;for(;n=Dft.exec(i);){n.index-t>0&&e.push(i.substring(t,n.index));const[,o,r,,s]=n;s?e.push({label:o,href:r,title:s}):e.push({label:o,href:r}),t=n.index+n[0].length}return t{$Qe(f)&&dn.stop(f,!0),t.callback(r.href)},c=t.disposables.add(new xn(a,et.CLICK)).event,u=t.disposables.add(new xn(a,et.KEY_DOWN)).event,d=st.chain(u,f=>f.filter(g=>{const p=new Pi(g);return p.equals(10)||p.equals(3)}));t.disposables.add(Ei.addTarget(a));const h=t.disposables.add(new xn(a,Di.Tap)).event;st.any(c,h,d)(l,null,t.disposables),e.appendChild(a)}}var yCe=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Mae=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};const ad=He;class Nft{constructor(e,t,n,o,r,s,a){var l,c,u;this._checked=!1,this._hidden=!1,this.hasCheckbox=o,this.index=n,this.fireButtonTriggered=r,this.fireSeparatorButtonTriggered=s,this._onChecked=a,this.onChecked=o?st.map(st.filter(this._onChecked.event,d=>d.listElement===this),d=>d.checked):st.None,e.type==="separator"?this._separator=e:(this.item=e,t&&t.type==="separator"&&!t.buttons&&(this._separator=t),this.saneDescription=this.item.description,this.saneDetail=this.item.detail,this._labelHighlights=(l=this.item.highlights)===null||l===void 0?void 0:l.label,this._descriptionHighlights=(c=this.item.highlights)===null||c===void 0?void 0:c.description,this._detailHighlights=(u=this.item.highlights)===null||u===void 0?void 0:u.detail,this.saneTooltip=this.item.tooltip),this._init=new ah(()=>{var d;const h=(d=e.label)!==null&&d!==void 0?d:"",f=TL(h).text.trim(),g=e.ariaLabel||[h,this.saneDescription,this.saneDetail].map(p=>Put(p)).filter(p=>!!p).join(", ");return{saneLabel:h,saneSortLabel:f,saneAriaLabel:g}})}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 checked(){return this._checked}set checked(e){e!==this._checked&&(this._checked=e,this._onChecked.fire({listElement:this,checked:e}))}get separator(){return this._separator}set separator(e){this._separator=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 lT{constructor(e){this.themeService=e}get templateId(){return lT.ID}renderTemplate(e){const t=Object.create(null);t.toDisposeElement=[],t.toDisposeTemplate=[],t.entry=Ae(e,ad(".quick-input-list-entry"));const n=Ae(t.entry,ad("label.quick-input-list-label"));t.toDisposeTemplate.push(No(n,et.CLICK,c=>{t.checkbox.offsetParent||c.preventDefault()})),t.checkbox=Ae(n,ad("input.quick-input-list-checkbox")),t.checkbox.type="checkbox",t.toDisposeTemplate.push(No(t.checkbox,et.CHANGE,c=>{t.element.checked=t.checkbox.checked}));const o=Ae(n,ad(".quick-input-list-rows")),r=Ae(o,ad(".quick-input-list-row")),s=Ae(o,ad(".quick-input-list-row"));t.label=new XP(r,{supportHighlights:!0,supportDescriptionHighlights:!0,supportIcons:!0}),t.toDisposeTemplate.push(t.label),t.icon=p0e(t.label.element,ad(".quick-input-list-icon"));const a=Ae(r,ad(".quick-input-list-entry-keybinding"));t.keybinding=new aT(a,Vl);const l=Ae(s,ad(".quick-input-list-label-meta"));return t.detail=new XP(l,{supportHighlights:!0,supportIcons:!0}),t.toDisposeTemplate.push(t.detail),t.separator=Ae(t.entry,ad(".quick-input-list-separator")),t.actionBar=new zc(t.entry),t.actionBar.domNode.classList.add("quick-input-list-entry-action-bar"),t.toDisposeTemplate.push(t.actionBar),t}renderElement(e,t,n){var o,r,s,a;n.element=e,e.element=(o=n.entry)!==null&&o!==void 0?o:void 0;const l=e.item?e.item:e.separator;n.checkbox.checked=e.checked,n.toDisposeElement.push(e.onChecked(g=>n.checkbox.checked=g));const{labelHighlights:c,descriptionHighlights:u,detailHighlights:d}=e;if(!((r=e.item)===null||r===void 0)&&r.iconPath){const g=xw(this.themeService.getColorTheme().type)?e.item.iconPath.dark:(s=e.item.iconPath.light)!==null&&s!==void 0?s:e.item.iconPath.dark,p=Rt.revive(g);n.icon.className="quick-input-list-icon",n.icon.style.backgroundImage=yv(p)}else n.icon.style.backgroundImage="",n.icon.className=!((a=e.item)===null||a===void 0)&&a.iconClass?`quick-input-list-icon ${e.item.iconClass}`:"";const h={matches:c||[],descriptionTitle:e.saneDescription,descriptionMatches:u||[],labelEscapeNewLines:!0};l.type!=="separator"?(h.extraClasses=l.iconClasses,h.italic=l.italic,h.strikethrough=l.strikethrough,n.entry.classList.remove("quick-input-list-separator-as-item")):n.entry.classList.add("quick-input-list-separator-as-item"),n.label.setLabel(e.saneLabel,e.saneDescription,h),n.keybinding.set(l.type==="separator"?void 0:l.keybinding),e.saneDetail?(n.detail.element.style.display="",n.detail.setLabel(e.saneDetail,void 0,{matches:d,title:e.saneDetail,labelEscapeNewLines:!0})):n.detail.element.style.display="none",e.item&&e.separator&&e.separator.label?(n.separator.textContent=e.separator.label,n.separator.style.display=""):n.separator.style.display="none",n.entry.classList.toggle("quick-input-list-separator-border",!!e.separator);const f=l.buttons;f&&f.length?(n.actionBar.push(f.map((g,p)=>{let v=g.iconClass||(g.iconPath?I$(g.iconPath):void 0);return g.alwaysVisible&&(v=v?`${v} always-visible`:"always-visible"),{id:`id-${p}`,class:v,enabled:!0,label:"",tooltip:g.tooltip||"",run:()=>{l.type!=="separator"?e.fireButtonTriggered({button:g,item:l}):e.fireSeparatorButtonTriggered({button:g,separator:l})}}}),{icon:!0,label:!1}),n.entry.classList.add("has-actions")):n.entry.classList.remove("has-actions")}disposeElement(e,t,n){n.toDisposeElement=si(n.toDisposeElement),n.actionBar.clear()}disposeTemplate(e){e.toDisposeElement=si(e.toDisposeElement),e.toDisposeTemplate=si(e.toDisposeTemplate)}}lT.ID="listelement";class Rft{getHeight(e){return e.item?e.saneDetail?44:22:24}getTemplateId(e){return lT.ID}}var Sr;(function(i){i[i.First=1]="First",i[i.Second=2]="Second",i[i.Last=3]="Last",i[i.Next=4]="Next",i[i.Previous=5]="Previous",i[i.NextPage=6]="NextPage",i[i.PreviousPage=7]="PreviousPage"})(Sr||(Sr={}));class FX{constructor(e,t,n,o){this.parent=e,this.options=n,this.inputElements=[],this.elements=[],this.elementsToIndexes=new Map,this.matchOnDescription=!1,this.matchOnDetail=!1,this.matchOnLabel=!0,this.matchOnLabelMode="fuzzy",this.sortByLabel=!0,this._onChangedAllVisibleChecked=new le,this.onChangedAllVisibleChecked=this._onChangedAllVisibleChecked.event,this._onChangedCheckedCount=new le,this.onChangedCheckedCount=this._onChangedCheckedCount.event,this._onChangedVisibleCount=new le,this.onChangedVisibleCount=this._onChangedVisibleCount.event,this._onChangedCheckedElements=new le,this.onChangedCheckedElements=this._onChangedCheckedElements.event,this._onButtonTriggered=new le,this.onButtonTriggered=this._onButtonTriggered.event,this._onSeparatorButtonTriggered=new le,this.onSeparatorButtonTriggered=this._onSeparatorButtonTriggered.event,this._onKeyDown=new le,this.onKeyDown=this._onKeyDown.event,this._onLeave=new le,this.onLeave=this._onLeave.event,this._listElementChecked=new le,this._fireCheckedEvents=!0,this.elementDisposables=[],this.disposables=[],this.id=t,this.container=Ae(this.parent,ad(".quick-input-list"));const r=new Rft,s=new Pft;if(this.list=n.createList("QuickInput",this.container,r,[new lT(o)],{identityProvider:{getId:a=>{var l,c,u,d,h,f,g,p;return(p=(f=(d=(c=(l=a.item)===null||l===void 0?void 0:l.id)!==null&&c!==void 0?c:(u=a.item)===null||u===void 0?void 0:u.label)!==null&&d!==void 0?d:(h=a.separator)===null||h===void 0?void 0:h.id)!==null&&f!==void 0?f:(g=a.separator)===null||g===void 0?void 0:g.label)!==null&&p!==void 0?p:""}},setRowLineHeight:!1,multipleSelectionSupport:!1,horizontalScrolling:!1,accessibilityProvider:s}),this.list.getHTMLElement().id=t,this.disposables.push(this.list),this.disposables.push(this.list.onKeyDown(a=>{const l=new Pi(a);switch(l.keyCode){case 10:this.toggleCheckbox();break;case 31:(Nn?a.metaKey:a.ctrlKey)&&this.list.setFocus(Gs(this.list.length));break;case 16:{const c=this.list.getFocus();c.length===1&&c[0]===0&&this._onLeave.fire();break}case 18:{const c=this.list.getFocus();c.length===1&&c[0]===this.list.length-1&&this._onLeave.fire();break}}this._onKeyDown.fire(l)})),this.disposables.push(this.list.onMouseDown(a=>{a.browserEvent.button!==2&&a.browserEvent.preventDefault()})),this.disposables.push(ke(this.container,et.CLICK,a=>{(a.x||a.y)&&this._onLeave.fire()})),this.disposables.push(this.list.onMouseMiddleClick(a=>{this._onLeave.fire()})),this.disposables.push(this.list.onContextMenu(a=>{typeof a.index=="number"&&(a.browserEvent.preventDefault(),this.list.setSelection([a.index]))})),n.hoverDelegate){const a=new x0e(n.hoverDelegate.delay);this.disposables.push(this.list.onMouseOver(l=>Mae(this,void 0,void 0,function*(){var c;if(l.browserEvent.target instanceof HTMLAnchorElement){a.cancel();return}if(!(!(l.browserEvent.relatedTarget instanceof HTMLAnchorElement)&&rs(l.browserEvent.relatedTarget,(c=l.element)===null||c===void 0?void 0:c.element)))try{yield a.trigger(()=>Mae(this,void 0,void 0,function*(){l.element&&this.showHover(l.element)}))}catch(u){if(!sh(u))throw u}}))),this.disposables.push(this.list.onMouseOut(l=>{var c;rs(l.browserEvent.relatedTarget,(c=l.element)===null||c===void 0?void 0:c.element)||a.cancel()})),this.disposables.push(a)}this.disposables.push(this._listElementChecked.event(a=>this.fireCheckedEvents())),this.disposables.push(this._onChangedAllVisibleChecked,this._onChangedCheckedCount,this._onChangedVisibleCount,this._onChangedCheckedElements,this._onButtonTriggered,this._onSeparatorButtonTriggered,this._onLeave,this._onKeyDown)}get onDidChangeFocus(){return st.map(this.list.onDidChangeFocus,e=>e.elements.map(t=>t.item))}get onDidChangeSelection(){return st.map(this.list.onDidChangeSelection,e=>({items:e.elements.map(t=>t.item),event:e.browserEvent}))}get scrollTop(){return this.list.scrollTop}set scrollTop(e){this.list.scrollTop=e}get ariaLabel(){return this.list.getHTMLElement().ariaLabel}set ariaLabel(e){this.list.getHTMLElement().ariaLabel=e}getAllVisibleChecked(){return this.allVisibleChecked(this.elements,!1)}allVisibleChecked(e,t=!0){for(let n=0,o=e.length;n{t.hidden||(t.checked=e)})}finally{this._fireCheckedEvents=!0,this.fireCheckedEvents()}}setElements(e){this.elementDisposables=si(this.elementDisposables);const t=s=>this.fireButtonTriggered(s),n=s=>this.fireSeparatorButtonTriggered(s);this.inputElements=e;const o=new Map,r=this.parent.classList.contains("show-checkboxes");this.elements=e.reduce((s,a,l)=>{var c;const u=l>0?e[l-1]:void 0;if(a.type==="separator"&&!a.buttons)return s;const d=new Nft(a,u,l,r,t,n,this._listElementChecked),h=s.length;return s.push(d),o.set((c=d.item)!==null&&c!==void 0?c:d.separator,h),s},[]),this.elementsToIndexes=o,this.list.splice(0,this.list.length),this.list.splice(0,this.list.length,this.elements),this._onChangedVisibleCount.fire(this.elements.length)}getFocusedElements(){return this.list.getFocusedElements().map(e=>e.item)}setFocusedElements(e){if(this.list.setFocus(e.filter(t=>this.elementsToIndexes.has(t)).map(t=>this.elementsToIndexes.get(t))),e.length>0){const t=this.list.getFocus()[0];typeof t=="number"&&this.list.reveal(t)}}getActiveDescendant(){return this.list.getHTMLElement().getAttribute("aria-activedescendant")}setSelectedElements(e){this.list.setSelection(e.filter(t=>this.elementsToIndexes.has(t)).map(t=>this.elementsToIndexes.get(t)))}getCheckedElements(){return this.elements.filter(e=>e.checked).map(e=>e.item).filter(e=>!!e)}setCheckedElements(e){try{this._fireCheckedEvents=!1;const t=new Set;for(const n of e)t.add(n);for(const n of this.elements)n.checked=t.has(n.item)}finally{this._fireCheckedEvents=!0,this.fireCheckedEvents()}}set enabled(e){this.list.getHTMLElement().style.pointerEvents=e?"":"none"}focus(e){if(!this.list.length)return;switch(e===Sr.Second&&this.list.length<2&&(e=Sr.First),e){case Sr.First:this.list.scrollTop=0,this.list.focusFirst(void 0,n=>!!n.item);break;case Sr.Second:this.list.scrollTop=0,this.list.focusNth(1,void 0,n=>!!n.item);break;case Sr.Last:this.list.scrollTop=this.list.scrollHeight,this.list.focusLast(void 0,n=>!!n.item);break;case Sr.Next:{this.list.focusNext(void 0,!0,void 0,o=>!!o.item);const n=this.list.getFocus()[0];n!==0&&!this.elements[n-1].item&&this.list.firstVisibleIndex>n-1&&this.list.reveal(n-1);break}case Sr.Previous:{this.list.focusPrevious(void 0,!0,void 0,o=>!!o.item);const n=this.list.getFocus()[0];n!==0&&!this.elements[n-1].item&&this.list.firstVisibleIndex>n-1&&this.list.reveal(n-1);break}case Sr.NextPage:this.list.focusNextPage(void 0,n=>!!n.item);break;case Sr.PreviousPage:this.list.focusPreviousPage(void 0,n=>!!n.item);break}const t=this.list.getFocus()[0];typeof t=="number"&&this.list.reveal(t)}clearFocus(){this.list.setFocus([])}domFocus(){this.list.domFocus()}showHover(e){var t,n,o;this.options.hoverDelegate!==void 0&&(this._lastHover&&!this._lastHover.isDisposed&&((n=(t=this.options.hoverDelegate).onDidHideHover)===null||n===void 0||n.call(t),(o=this._lastHover)===null||o===void 0||o.dispose()),!(!e.element||!e.saneTooltip)&&(this._lastHover=this.options.hoverDelegate.showHover({content:e.saneTooltip,target:e.element,linkHandler:r=>{this.options.linkOpenerDelegate(r)},showPointer:!0,container:this.container,hoverPosition:1},!1)))}layout(e){this.list.getHTMLElement().style.maxHeight=e?`${Math.floor(e/44)*44+6}px`:"",this.list.layout()}filter(e){if(!(this.sortByLabel||this.matchOnLabel||this.matchOnDescription||this.matchOnDetail))return this.list.layout(),!1;const t=e;if(e=e.trim(),!e||!(this.matchOnLabel||this.matchOnDescription||this.matchOnDetail))this.elements.forEach(o=>{o.labelHighlights=void 0,o.descriptionHighlights=void 0,o.detailHighlights=void 0,o.hidden=!1;const r=o.index&&this.inputElements[o.index-1];o.item&&(o.separator=r&&r.type==="separator"&&!r.buttons?r:void 0)});else{let o;this.elements.forEach(r=>{var s,a,l,c;let u;this.matchOnLabelMode==="fuzzy"?u=this.matchOnLabel&&(s=N9(e,TL(r.saneLabel)))!==null&&s!==void 0?s:void 0:u=this.matchOnLabel&&(a=Mft(t,TL(r.saneLabel)))!==null&&a!==void 0?a:void 0;const d=this.matchOnDescription&&(l=N9(e,TL(r.saneDescription||"")))!==null&&l!==void 0?l:void 0,h=this.matchOnDetail&&(c=N9(e,TL(r.saneDetail||"")))!==null&&c!==void 0?c:void 0;if(u||d||h?(r.labelHighlights=u,r.descriptionHighlights=d,r.detailHighlights=h,r.hidden=!1):(r.labelHighlights=void 0,r.descriptionHighlights=void 0,r.detailHighlights=void 0,r.hidden=r.item?!r.item.alwaysShow:!0),r.item?r.separator=void 0:r.separator&&(r.hidden=!0),!this.sortByLabel){const f=r.index&&this.inputElements[r.index-1];o=f&&f.type==="separator"?f:o,o&&!r.hidden&&(r.separator=o,o=void 0)}})}const n=this.elements.filter(o=>!o.hidden);if(this.sortByLabel&&e){const o=e.toLowerCase();n.sort((r,s)=>Aft(r,s,o))}return this.elementsToIndexes=n.reduce((o,r,s)=>{var a;return o.set((a=r.item)!==null&&a!==void 0?a:r.separator,s),o},new Map),this.list.splice(0,this.list.length,n),this.list.setFocus([]),this.list.layout(),this._onChangedAllVisibleChecked.fire(this.getAllVisibleChecked()),this._onChangedVisibleCount.fire(n.length),!0}toggleCheckbox(){try{this._fireCheckedEvents=!1;const e=this.list.getFocusedElements(),t=this.allVisibleChecked(e);for(const n of e)n.checked=!t}finally{this._fireCheckedEvents=!0,this.fireCheckedEvents()}}display(e){this.container.style.display=e?"":"none"}isDisplayed(){return this.container.style.display!=="none"}dispose(){this.elementDisposables=si(this.elementDisposables),this.disposables=si(this.disposables)}fireCheckedEvents(){this._fireCheckedEvents&&(this._onChangedAllVisibleChecked.fire(this.getAllVisibleChecked()),this._onChangedCheckedCount.fire(this.getCheckedCount()),this._onChangedCheckedElements.fire(this.getCheckedElements()))}fireButtonTriggered(e){this._onButtonTriggered.fire(e)}fireSeparatorButtonTriggered(e){this._onSeparatorButtonTriggered.fire(e)}style(e){this.list.style(e)}toggleHover(){const e=this.list.getFocusedElements()[0];if(!(e!=null&&e.saneTooltip))return;if(this._lastHover&&!this._lastHover.isDisposed){this._lastHover.dispose();return}const t=this.list.getFocusedElements()[0];if(!t)return;this.showHover(t);const n=new Be;n.add(this.list.onDidChangeFocus(o=>{o.indexes.length&&this.showHover(o.elements[0])})),this._lastHover&&n.add(this._lastHover),this._toggleHover=n,this.elementDisposables.push(this._toggleHover)}}yCe([Mo],FX.prototype,"onDidChangeFocus",null);yCe([Mo],FX.prototype,"onDidChangeSelection",null);function Mft(i,e){const{text:t,iconOffsets:n}=e;if(!n||n.length===0)return Aae(i,t);const o=BI(t," "),r=t.length-o.length,s=Aae(i,o);if(s)for(const a of s){const l=n[a.start+r]+r;a.start+=l,a.end+=l}return s}function Aae(i,e){const t=e.toLowerCase().indexOf(i.toLowerCase());return t!==-1?[{start:t,end:t+i.length}]:null}function Aft(i,e,t){const n=i.labelHighlights||[],o=e.labelHighlights||[];return n.length&&!o.length?-1:!n.length&&o.length?1:n.length===0&&o.length===0?0:xft(i.saneSortLabel,e.saneSortLabel,t)}class Pft{getWidgetAriaLabel(){return C("quickInput","Quick Input")}getAriaLabel(e){var t;return!((t=e.separator)===null||t===void 0)&&t.label?`${e.saneAriaLabel}, ${e.separator.label}`:e.saneAriaLabel}getWidgetRole(){return"listbox"}getRole(e){return e.hasCheckbox?"checkbox":"option"}isChecked(e){if(!!e.hasCheckbox)return{value:e.checked,onDidChange:e.onChecked}}}var Pae=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};const T$={iconClass:Mt.asClassName(Xe.quickInputBack),tooltip:C("quickInput.back","Back"),handle:-1};class cT extends _e{constructor(e){super(),this.ui=e,this._widgetUpdated=!1,this.visible=!1,this._enabled=!0,this._busy=!1,this._ignoreFocusOut=!1,this._buttons=[],this.buttonsUpdated=!1,this._toggles=[],this.togglesUpdated=!1,this.noValidationMessage=cT.noPromptMessage,this._severity=So.Ignore,this.onDidTriggerButtonEmitter=this._register(new le),this.onDidHideEmitter=this._register(new le),this.onDisposeEmitter=this._register(new le),this.visibleDisposables=this._register(new Be),this.onDidHide=this.onDidHideEmitter.event}get title(){return this._title}set title(e){this._title=e,this.update()}get description(){return this._description}set description(e){this._description=e,this.update()}get step(){return this._steps}set step(e){this._steps=e,this.update()}get totalSteps(){return this._totalSteps}set totalSteps(e){this._totalSteps=e,this.update()}get enabled(){return this._enabled}set enabled(e){this._enabled=e,this.update()}get contextKey(){return this._contextKey}set contextKey(e){this._contextKey=e,this.update()}get busy(){return this._busy}set busy(e){this._busy=e,this.update()}get ignoreFocusOut(){return this._ignoreFocusOut}set ignoreFocusOut(e){const t=this._ignoreFocusOut!==e&&!Kd;this._ignoreFocusOut=e&&!Kd,t&&this.update()}get buttons(){return this._buttons}set buttons(e){this._buttons=e,this.buttonsUpdated=!0,this.update()}get toggles(){return this._toggles}set toggles(e){this._toggles=e!=null?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=wk.Other){this.visible=!1,this.visibleDisposables.clear(),this.onDidHideEmitter.fire({reason:e})}update(){var e,t;if(!this.visible)return;const n=this.getTitle();n&&this.ui.title.textContent!==n?this.ui.title.textContent=n:!n&&this.ui.title.innerHTML!==" "&&(this.ui.title.innerText="\xA0");const o=this.getDescription();if(this.ui.description1.textContent!==o&&(this.ui.description1.textContent=o),this.ui.description2.textContent!==o&&(this.ui.description2.textContent=o),this._widgetUpdated&&(this._widgetUpdated=!1,this._widget?jr(this.ui.widget,this._widget):jr(this.ui.widget)),this.busy&&!this.busyDelay&&(this.busyDelay=new zu,this.busyDelay.setIfNotSet(()=>{this.visible&&this.ui.progressBar.infinite()},800)),!this.busy&&this.busyDelay&&(this.ui.progressBar.stop(),this.busyDelay.cancel(),this.busyDelay=void 0),this.buttonsUpdated){this.buttonsUpdated=!1,this.ui.leftActionBar.clear();const s=this.buttons.filter(l=>l===T$);this.ui.leftActionBar.push(s.map((l,c)=>{const u=new ca(`id-${c}`,"",l.iconClass||I$(l.iconPath),!0,()=>Pae(this,void 0,void 0,function*(){this.onDidTriggerButtonEmitter.fire(l)}));return u.tooltip=l.tooltip||"",u}),{icon:!0,label:!1}),this.ui.rightActionBar.clear();const a=this.buttons.filter(l=>l!==T$);this.ui.rightActionBar.push(a.map((l,c)=>{const u=new ca(`id-${c}`,"",l.iconClass||I$(l.iconPath),!0,()=>Pae(this,void 0,void 0,function*(){this.onDidTriggerButtonEmitter.fire(l)}));return u.tooltip=l.tooltip||"",u}),{icon:!0,label:!1})}if(this.togglesUpdated){this.togglesUpdated=!1;const s=(t=(e=this.toggles)===null||e===void 0?void 0:e.filter(a=>a instanceof ES))!==null&&t!==void 0?t:[];this.ui.inputBox.toggles=s}this.ui.ignoreFocusOut=this.ignoreFocusOut,this.ui.setEnabled(this.enabled),this.ui.setContextKey(this.contextKey);const r=this.validationMessage||this.noValidationMessage;this._lastValidationMessage!==r&&(this._lastValidationMessage=r,jr(this.ui.message),Tft(r,this.ui.message,{callback:s=>{this.ui.linkOpenerDelegate(s)},disposables:this.visibleDisposables})),this._lastSeverity!==this.severity&&(this._lastSeverity=this.severity,this.showMessageDecoration(this.severity))}getTitle(){return this.title&&this.step?`${this.title} (${this.getSteps()})`:this.title?this.title:this.step?this.getSteps():""}getDescription(){return this.description||""}getSteps(){return this.step&&this.totalSteps?C("quickInput.steps","{0}/{1}",this.step,this.totalSteps):this.step?String(this.step):""}showMessageDecoration(e){if(this.ui.inputBox.showDecoration(e),e!==So.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()}}cT.noPromptMessage=C("inputModeEntry","Press 'Enter' to confirm your input or 'Escape' to cancel");class Sk extends cT{constructor(){super(...arguments),this._value="",this.onDidChangeValueEmitter=this._register(new le),this.onWillAcceptEmitter=this._register(new le),this.onDidAcceptEmitter=this._register(new le),this.onDidCustomEmitter=this._register(new le),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._autoFocusOnList=!0,this._keepScrollPosition=!1,this._itemActivation=vd.FIRST,this._activeItems=[],this.activeItemsUpdated=!1,this.activeItemsToConfirm=[],this.onDidChangeActiveEmitter=this._register(new le),this._selectedItems=[],this.selectedItemsUpdated=!1,this.selectedItemsToConfirm=[],this.onDidChangeSelectionEmitter=this._register(new le),this.onDidTriggerItemButtonEmitter=this._register(new le),this.onDidTriggerSeparatorButtonEmitter=this._register(new le),this.valueSelectionUpdated=!0,this._ok="default",this._customButton=!1,this.filterValue=e=>e,this.onDidChangeValue=this.onDidChangeValueEmitter.event,this.onWillAccept=this.onWillAcceptEmitter.event,this.onDidAccept=this.onDidAcceptEmitter.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 autoFocusOnList(){return this._autoFocusOnList}set autoFocusOnList(e){this._autoFocusOnList=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?pft:this.ui.keyMods}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()}get hideInput(){return!!this._hideInput}set hideInput(e){this._hideInput=e,this.update()}trySelectFirst(){this.autoFocusOnList&&(this.canSelectMany||this.ui.list.focus(Sr.First))}show(){this.visible||(this.visibleDisposables.add(this.ui.inputBox.onDidChange(e=>{this.doSetValue(e,!0)})),this.visibleDisposables.add(this.ui.inputBox.onMouseDown(e=>{this.autoFocusOnList||this.ui.list.clearFocus()})),this.visibleDisposables.add((this._hideInput?this.ui.list:this.ui.inputBox).onKeyDown(e=>{switch(e.keyCode){case 18:this.ui.list.focus(Sr.Next),this.canSelectMany&&this.ui.list.domFocus(),dn.stop(e,!0);break;case 16:this.ui.list.getFocusedElements().length?this.ui.list.focus(Sr.Previous):this.ui.list.focus(Sr.Last),this.canSelectMany&&this.ui.list.domFocus(),dn.stop(e,!0);break;case 12:this.ui.list.focus(Sr.NextPage),this.canSelectMany&&this.ui.list.domFocus(),dn.stop(e,!0);break;case 11:this.ui.list.focus(Sr.PreviousPage),this.canSelectMany&&this.ui.list.domFocus(),dn.stop(e,!0);break;case 17:if(!this._canAcceptInBackground||!this.ui.inputBox.isSelectionAtEnd())return;this.activeItems[0]&&(this._selectedItems=[this.activeItems[0]],this.onDidChangeSelectionEmitter.fire(this.selectedItems),this.handleAccept(!0));break;case 14:(e.ctrlKey||e.metaKey)&&!e.shiftKey&&!e.altKey&&(this.ui.list.focus(Sr.First),dn.stop(e,!0));break;case 13:(e.ctrlKey||e.metaKey)&&!e.shiftKey&&!e.altKey&&(this.ui.list.focus(Sr.Last),dn.stop(e,!0));break}})),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.ui.list.onDidChangeFocus(e=>{this.activeItemsUpdated||this.activeItemsToConfirm!==this._activeItems&&Lo(e,this._activeItems,(t,n)=>t===n)||(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&&Lo(e,this._selectedItems,(n,o)=>n===o)||(this._selectedItems=e,this.onDidChangeSelectionEmitter.fire(e),e.length&&this.handleAccept(t instanceof MouseEvent&&t.button===1))})),this.visibleDisposables.add(this.ui.list.onChangedCheckedElements(e=>{!this.canSelectMany||this.selectedItemsToConfirm!==this._selectedItems&&Lo(e,this._selectedItems,(t,n)=>t===n)||(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 ke(this.ui.container,et.KEY_UP,e=>{if(this.canSelectMany||!this._quickNavigate)return;const t=new Pi(e),n=t.keyCode;this._quickNavigate.keybindings.some(s=>{const a=s.getChords();return a.length>1?!1:a[0].shiftKey&&n===4?!(t.ctrlKey||t.altKey||t.metaKey):!!(a[0].altKey&&n===6||a[0].ctrlKey&&n===5||a[0].metaKey&&n===57)})&&(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,n={title:!!this.title||!!this.step||!!this.buttons.length,description:t,checkAll:this.canSelectMany&&!this._hideCheckAll,checkBox:this.canSelectMany,inputBox:!this._hideInput,progressBar:!this._hideInput||t,visibleCount:!0,count:this.canSelectMany&&!this._hideCountBadge,ok:this.ok==="default"?this.canSelectMany:this.ok,list:!0,message:!!this.validationMessage,customButton:this.customButton};this.ui.setVisibilities(n),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 o=this.ariaLabel;if(!o&&n.inputBox&&(o=this.placeholder||Sk.DEFAULT_ARIA_LABEL,this.title&&(o+=` - ${this.title}`)),this.ui.list.ariaLabel!==o&&(this.ui.list.ariaLabel=o!=null?o: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)switch(this.itemsUpdated=!1,this.ui.list.setElements(this.items),this.ui.list.filter(this.filterValue(this.ui.inputBox.value)),this.ui.checkAll.checked=this.ui.list.getAllVisibleChecked(),this.ui.visibleCount.setCount(this.ui.list.getVisibleCount()),this.ui.count.setCount(this.ui.list.getCheckedCount()),this._itemActivation){case vd.NONE:this._itemActivation=vd.FIRST;break;case vd.SECOND:this.ui.list.focus(Sr.Second),this._itemActivation=vd.FIRST;break;case vd.LAST:this.ui.list.focus(Sr.Last),this._itemActivation=vd.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||"",n.inputBox||(this.ui.list.domFocus(),this.canSelectMany&&this.ui.list.focus(Sr.First)),this.keepScrollPosition&&(this.scrollTop=e)}}Sk.DEFAULT_ARIA_LABEL=C("quickInputBox.ariaLabel","Type to narrow down results.");class Oft extends cT{constructor(){super(...arguments),this._value="",this.valueSelectionUpdated=!0,this._password=!1,this.onDidValueChangeEmitter=this._register(new le),this.onDidAcceptEmitter=this._register(new le),this.onDidChangeValue=this.onDidValueChangeEmitter.event,this.onDidAccept=this.onDidAcceptEmitter.event}get value(){return this._value}set value(e){this._value=e||"",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()}show(){this.visible||(this.visibleDisposables.add(this.ui.inputBox.onDidChange(e=>{e!==this.value&&(this._value=e,this.onDidValueChangeEmitter.fire(e))})),this.visibleDisposables.add(this.ui.onDidAccept(()=>this.onDidAcceptEmitter.fire())),this.valueSelectionUpdated=!0),super.show()}update(){if(!this.visible)return;this.ui.container.classList.remove("hidden-input");const e={title:!!this.title||!!this.step||!!this.buttons.length,description:!!this.description||!!this.step,inputBox:!0,message:!0,progressBar:!0};this.ui.setVisibilities(e),super.update(),this.ui.inputBox.value!==this.value&&(this.ui.inputBox.value=this.value),this.valueSelectionUpdated&&(this.valueSelectionUpdated=!1,this.ui.inputBox.select(this._valueSelection&&{start:this._valueSelection[0],end:this._valueSelection[1]})),this.ui.inputBox.placeholder!==(this.placeholder||"")&&(this.ui.inputBox.placeholder=this.placeholder||""),this.ui.inputBox.password!==this.password&&(this.ui.inputBox.password=this.password)}}const Xa=He;class j5 extends _e{constructor(e,t){super(),this.options=e,this.themeService=t,this.enabled=!0,this.onDidAcceptEmitter=this._register(new le),this.onDidCustomEmitter=this._register(new le),this.onDidTriggerButtonEmitter=this._register(new le),this.keyMods={ctrlCmd:!1,alt:!1},this.controller=null,this.onShowEmitter=this._register(new le),this.onShow=this.onShowEmitter.event,this.onHideEmitter=this._register(new le),this.onHide=this.onHideEmitter.event,this.idPrefix=e.idPrefix,this.parentElement=e.container,this.styles=e.styles,this.registerKeyModsListeners()}registerKeyModsListeners(){const e=t=>{this.keyMods.ctrlCmd=t.ctrlKey||t.metaKey,this.keyMods.alt=t.altKey};this._register(ke(window,et.KEY_DOWN,e,!0)),this._register(ke(window,et.KEY_UP,e,!0)),this._register(ke(window,et.MOUSE_DOWN,e,!0))}getUI(){if(this.ui)return this.ui;const e=Ae(this.parentElement,Xa(".quick-input-widget.show-file-icons"));e.tabIndex=-1,e.style.display="none";const t=Wc(e),n=Ae(e,Xa(".quick-input-titlebar")),o=this.options.hoverDelegate?{hoverDelegate:this.options.hoverDelegate}:void 0,r=this._register(new zc(n,o));r.domNode.classList.add("quick-input-left-action-bar");const s=Ae(n,Xa(".quick-input-title")),a=this._register(new zc(n,o));a.domNode.classList.add("quick-input-right-action-bar");const l=Ae(e,Xa(".quick-input-header")),c=Ae(l,Xa("input.quick-input-check-all"));c.type="checkbox",c.setAttribute("aria-label",C("quickInput.checkAll","Toggle all checkboxes")),this._register(No(c,et.CHANGE,N=>{const M=c.checked;A.setAllVisibleChecked(M)})),this._register(ke(c,et.CLICK,N=>{(N.x||N.y)&&f.setFocus()}));const u=Ae(l,Xa(".quick-input-description")),d=Ae(l,Xa(".quick-input-and-message")),h=Ae(d,Xa(".quick-input-filter")),f=this._register(new _ft(h,this.styles.inputBox,this.styles.toggle));f.setAttribute("aria-describedby",`${this.idPrefix}message`);const g=Ae(h,Xa(".quick-input-visible-count"));g.setAttribute("aria-live","polite"),g.setAttribute("aria-atomic","true");const p=new k$(g,{countFormat:C({key:"quickInput.visibleCount",comment:["This tells the user how many items are shown in a list of items to select from. The items can be anything. Currently not visible, but read by screen readers."]},"{0} Results")},this.styles.countBadge),v=Ae(h,Xa(".quick-input-count"));v.setAttribute("aria-live","polite");const m=new k$(v,{countFormat:C({key:"quickInput.countSelected",comment:["This tells the user how many items are selected in a list of items to select from. The items can be anything."]},"{0} Selected")},this.styles.countBadge),_=Ae(l,Xa(".quick-input-action")),y=this._register(new D$(_,this.styles.button));y.label=C("ok","OK"),this._register(y.onDidClick(N=>{this.onDidAcceptEmitter.fire()}));const w=Ae(l,Xa(".quick-input-action")),L=this._register(new D$(w,this.styles.button));L.label=C("custom","Custom"),this._register(L.onDidClick(N=>{this.onDidCustomEmitter.fire()}));const D=Ae(d,Xa(`#${this.idPrefix}message.quick-input-message`)),E=this._register(new U5(e,this.styles.progressBar));E.getContainer().classList.add("quick-input-progress");const I=Ae(e,Xa(".quick-input-html-widget"));I.tabIndex=-1;const k=Ae(e,Xa(".quick-input-description")),R=this.idPrefix+"list",A=this._register(new FX(e,R,this.options,this.themeService));f.setAttribute("aria-controls",R),this._register(A.onDidChangeFocus(()=>{var N;f.setAttribute("aria-activedescendant",(N=A.getActiveDescendant())!==null&&N!==void 0?N:"")})),this._register(A.onChangedAllVisibleChecked(N=>{c.checked=N})),this._register(A.onChangedVisibleCount(N=>{p.setCount(N)})),this._register(A.onChangedCheckedCount(N=>{m.setCount(N)})),this._register(A.onLeave(()=>{setTimeout(()=>{f.setFocus(),this.controller instanceof Sk&&this.controller.canSelectMany&&A.clearFocus()},0)}));const P=pf(e);return this._register(P),this._register(ke(e,et.FOCUS,N=>{rs(N.relatedTarget,e)||(this.previousFocusElement=N.relatedTarget instanceof HTMLElement?N.relatedTarget:void 0)},!0)),this._register(P.onDidBlur(()=>{!this.getUI().ignoreFocusOut&&!this.options.ignoreFocusOut()&&this.hide(wk.Blur),this.previousFocusElement=void 0})),this._register(ke(e,et.FOCUS,N=>{f.setFocus()})),this._register(No(e,et.KEY_DOWN,N=>{if(!rs(N.target,I))switch(N.keyCode){case 3:dn.stop(N,!0),this.enabled&&this.onDidAcceptEmitter.fire();break;case 9:dn.stop(N,!0),this.hide(wk.Gesture);break;case 2:if(!N.altKey&&!N.ctrlKey&&!N.metaKey){const M=[".quick-input-list .monaco-action-bar .always-visible",".quick-input-list-entry:hover .monaco-action-bar",".monaco-list-row.focused .monaco-action-bar"];if(e.classList.contains("show-checkboxes")?M.push("input"):M.push("input[type=text]"),this.getUI().list.isDisplayed()&&M.push(".monaco-list"),this.getUI().message&&M.push(".quick-input-message a"),this.getUI().widget){if(rs(N.target,this.getUI().widget))break;M.push(".quick-input-html-widget")}const H=e.querySelectorAll(M.join(", "));N.shiftKey&&N.target===H[0]?(dn.stop(N,!0),A.clearFocus()):!N.shiftKey&&rs(N.target,H[H.length-1])&&(dn.stop(N,!0),H[0].focus())}break;case 10:N.ctrlKey&&(dn.stop(N,!0),this.getUI().list.toggleHover());break}})),this.ui={container:e,styleSheet:t,leftActionBar:r,titleBar:n,title:s,description1:k,description2:u,widget:I,rightActionBar:a,checkAll:c,inputContainer:d,filterContainer:h,inputBox:f,visibleCountContainer:g,visibleCount:p,countContainer:v,count:m,okContainer:_,ok:y,message:D,customButtonContainer:w,customButton:L,list:A,progressBar:E,onDidAccept:this.onDidAcceptEmitter.event,onDidCustom:this.onDidCustomEmitter.event,onDidTriggerButton:this.onDidTriggerButtonEmitter.event,ignoreFocusOut:!1,keyMods:this.keyMods,show:N=>this.show(N),hide:()=>this.hide(),setVisibilities:N=>this.setVisibilities(N),setEnabled:N=>this.setEnabled(N),setContextKey:N=>this.options.setContextKey(N),linkOpenerDelegate:N=>this.options.linkOpenerDelegate(N)},this.updateStyles(),this.ui}pick(e,t={},n=_n.None){return new Promise((o,r)=>{let s=u=>{var d;s=o,(d=t.onKeyMods)===null||d===void 0||d.call(t,a.keyMods),o(u)};if(n.isCancellationRequested){s(void 0);return}const a=this.createQuickPick();let l;const c=[a,a.onDidAccept(()=>{if(a.canSelectMany)s(a.selectedItems.slice()),a.hide();else{const u=a.activeItems[0];u&&(s(u),a.hide())}}),a.onDidChangeActive(u=>{const d=u[0];d&&t.onDidFocus&&t.onDidFocus(d)}),a.onDidChangeSelection(u=>{if(!a.canSelectMany){const d=u[0];d&&(s(d),a.hide())}}),a.onDidTriggerItemButton(u=>t.onDidTriggerItemButton&&t.onDidTriggerItemButton(Object.assign(Object.assign({},u),{removeItem:()=>{const d=a.items.indexOf(u.item);if(d!==-1){const h=a.items.slice(),f=h.splice(d,1),g=a.activeItems.filter(v=>v!==f[0]),p=a.keepScrollPosition;a.keepScrollPosition=!0,a.items=h,g&&(a.activeItems=g),a.keepScrollPosition=p}}}))),a.onDidTriggerSeparatorButton(u=>{var d;return(d=t.onDidTriggerSeparatorButton)===null||d===void 0?void 0:d.call(t,u)}),a.onDidChangeValue(u=>{l&&!u&&(a.activeItems.length!==1||a.activeItems[0]!==l)&&(a.activeItems=[l])}),n.onCancellationRequested(()=>{a.hide()}),a.onDidHide(()=>{si(c),s(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.autoFocusOnList=t.autoFocusOnList===void 0||t.autoFocusOnList,a.quickNavigate=t.quickNavigate,a.hideInput=!!t.hideInput,a.contextKey=t.contextKey,a.busy=!0,Promise.all([e,t.activeItem]).then(([u,d])=>{l=d,a.busy=!1,a.items=u,a.canSelectMany&&(a.selectedItems=u.filter(h=>h.type!=="separator"&&h.picked)),l&&(a.activeItems=[l])}),a.show(),Promise.resolve(e).then(void 0,u=>{r(u),a.hide()})})}createQuickPick(){const e=this.getUI();return new Sk(e)}createInputBox(){const e=this.getUI();return new Oft(e)}show(e){const t=this.getUI();this.onShowEmitter.fire();const n=this.controller;this.controller=e,n==null||n.didHide(),this.setEnabled(!0),t.leftActionBar.clear(),t.title.textContent="",t.description1.textContent="",t.description2.textContent="",jr(t.widget),t.rightActionBar.clear(),t.checkAll.checked=!1,t.inputBox.placeholder="",t.inputBox.password=!1,t.inputBox.showDecoration(So.Ignore),t.visibleCount.setCount(0),t.count.setCount(0),jr(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 o=this.options.backKeybindingLabel();T$.tooltip=o?C("quickInput.backWithKeybinding","Back ({0})",o):C("quickInput.back","Back"),t.container.style.display="",this.updateLayout(),t.inputBox.setFocus()}setVisibilities(e){const t=this.getUI();t.title.style.display=e.title?"":"none",t.description1.style.display=e.description&&(e.inputBox||e.checkAll)?"":"none",t.description2.style.display=e.description&&!(e.inputBox||e.checkAll)?"":"none",t.checkAll.style.display=e.checkAll?"":"none",t.inputContainer.style.display=e.inputBox?"":"none",t.filterContainer.style.display=e.inputBox?"":"none",t.visibleCountContainer.style.display=e.visibleCount?"":"none",t.countContainer.style.display=e.count?"":"none",t.okContainer.style.display=e.ok?"":"none",t.customButtonContainer.style.display=e.customButton?"":"none",t.message.style.display=e.message?"":"none",t.progressBar.getContainer().style.display=e.progressBar?"":"none",t.list.display(!!e.list),t.container.classList.toggle("show-checkboxes",!!e.checkBox),t.container.classList.toggle("hidden-input",!e.inputBox&&!e.description),this.updateLayout()}setEnabled(e){if(e!==this.enabled){this.enabled=e;for(const t of this.getUI().leftActionBar.viewItems)t.action.enabled=e;for(const t of this.getUI().rightActionBar.viewItems)t.action.enabled=e;this.getUI().checkAll.disabled=!e,this.getUI().inputBox.enabled=e,this.getUI().ok.enabled=e,this.getUI().list.enabled=e}}hide(e){var t,n,o;const r=this.controller;if(!r)return;const s=!rs(document.activeElement,(n=(t=this.ui)===null||t===void 0?void 0:t.container)!==null&&n!==void 0?n:null);if(this.controller=null,this.onHideEmitter.fire(),this.getUI().container.style.display="none",!s){let a=this.previousFocusElement;for(;a&&!a.offsetParent;)a=(o=a.parentElement)!==null&&o!==void 0?o:void 0;a!=null&&a.offsetParent?(a.focus(),this.previousFocusElement=void 0):this.options.returnFocus()}r.didHide(e)}layout(e,t){this.dimension=e,this.titleBarOffset=t,this.updateLayout()}updateLayout(){if(this.ui&&this.isDisplayed()){this.ui.container.style.top=`${this.titleBarOffset}px`;const e=this.ui.container.style,t=Math.min(this.dimension.width*.62,j5.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:n,widgetBorder:o,widgetShadow:r}=this.styles.widget;this.ui.titleBar.style.backgroundColor=e!=null?e:"",this.ui.container.style.backgroundColor=t!=null?t:"",this.ui.container.style.color=n!=null?n:"",this.ui.container.style.border=o?`1px solid ${o}`:"",this.ui.container.style.boxShadow=r?`0 0 8px 2px ${r}`:"",this.ui.list.style(this.styles.list);const s=[];this.styles.pickerGroup.pickerGroupBorder&&s.push(`.quick-input-list .quick-input-list-entry { border-top-color: ${this.styles.pickerGroup.pickerGroupBorder}; }`),this.styles.pickerGroup.pickerGroupForeground&&s.push(`.quick-input-list .quick-input-list-separator { color: ${this.styles.pickerGroup.pickerGroupForeground}; }`),this.styles.pickerGroup.pickerGroupForeground&&s.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)&&(s.push(".quick-input-list .monaco-keybinding > .monaco-keybinding-key {"),this.styles.keybindingLabel.keybindingLabelBackground&&s.push(`background-color: ${this.styles.keybindingLabel.keybindingLabelBackground};`),this.styles.keybindingLabel.keybindingLabelBorder&&s.push(`border-color: ${this.styles.keybindingLabel.keybindingLabelBorder};`),this.styles.keybindingLabel.keybindingLabelBottomBorder&&s.push(`border-bottom-color: ${this.styles.keybindingLabel.keybindingLabelBottomBorder};`),this.styles.keybindingLabel.keybindingLabelShadow&&s.push(`box-shadow: inset 0 -1px 0 ${this.styles.keybindingLabel.keybindingLabelShadow};`),this.styles.keybindingLabel.keybindingLabelForeground&&s.push(`color: ${this.styles.keybindingLabel.keybindingLabelForeground};`),s.push("}"));const a=s.join(` +`);a!==this.ui.styleSheet.textContent&&(this.ui.styleSheet.textContent=a)}}isDisplayed(){return this.ui&&this.ui.container.style.display!=="none"}}j5.MAX_WIDTH=600;var Fft=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},W2=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let N$=class extends vot{get controller(){return this._controller||(this._controller=this._register(this.createController())),this._controller}get hasController(){return!!this._controller}get quickAccess(){return this._quickAccess||(this._quickAccess=this._register(this.instantiationService.createInstance(E$))),this._quickAccess}constructor(e,t,n,o){super(n),this.instantiationService=e,this.contextKeyService=t,this.layoutService=o,this._onShow=this._register(new le),this._onHide=this._register(new le),this.contexts=new Map}createController(e=this.layoutService,t){const n={idPrefix:"quickInput_",container:e.container,ignoreFocusOut:()=>!1,backKeybindingLabel:()=>{},setContextKey:r=>this.setContextKey(r),linkOpenerDelegate:r=>{this.instantiationService.invokeFunction(s=>{s.get(ml).open(r,{allowCommands:!0,fromUserGesture:!0})})},returnFocus:()=>e.focus(),createList:(r,s,a,l,c)=>this.instantiationService.createInstance(S$,r,s,a,l,c),styles:this.computeStyles()},o=this._register(new j5(Object.assign(Object.assign({},n),t),this.themeService));return o.layout(e.dimension,e.offset.quickPickTop),this._register(e.onDidLayout(r=>o.layout(r,e.offset.quickPickTop))),this._register(o.onShow(()=>{this.resetContextKeys(),this._onShow.fire()})),this._register(o.onHide(()=>{this.resetContextKeys(),this._onHide.fire()})),o}setContextKey(e){let t;e&&(t=this.contexts.get(e),t||(t=new lt(e,!1).bindTo(this.contextKeyService),this.contexts.set(e,t))),!(t&&t.get())&&(this.resetContextKeys(),t==null||t.set(!0))}resetContextKeys(){this.contexts.forEach(e=>{e.get()&&e.reset()})}pick(e,t={},n=_n.None){return this.controller.pick(e,t,n)}createQuickPick(){return this.controller.createQuickPick()}createInputBox(){return this.controller.createInputBox()}updateStyles(){this.hasController&&this.controller.applyStyles(this.computeStyles())}computeStyles(){return{widget:{quickInputBackground:ct(Lre),quickInputForeground:ct(Snt),quickInputTitleBackground:ct(xnt),widgetBorder:ct(yG),widgetShadow:ct(Gh)},inputBox:FP,toggle:OP,countBadge:q1e,button:jdt,progressBar:Kdt,keybindingLabel:Udt,list:xS({listBackground:Lre,listFocusBackground:f0,listFocusForeground:h0,listInactiveFocusForeground:h0,listInactiveSelectionIconForeground:AC,listInactiveFocusBackground:f0,listFocusOutline:Wi,listInactiveFocusOutline:Wi}),pickerGroup:{pickerGroupBorder:ct(Lnt),pickerGroupForeground:ct(rbe)}}}};N$=Fft([W2(0,$t),W2(1,Ut),W2(2,vr),W2(3,SS)],N$);var wCe=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},qC=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let R$=class extends N${constructor(e,t,n,o,r){super(t,n,o,new BH(e.getContainerDomNode(),r)),this.host=void 0;const s=Pw.get(e);if(s){const a=s.widget;this.host={_serviceBrand:void 0,get hasContainer(){return!0},get container(){return a.getDomNode()},get dimension(){return e.getLayoutInfo()},get onDidLayout(){return e.onDidLayoutChange},focus:()=>e.focus(),offset:{top:0,quickPickTop:0}}}else this.host=void 0}createController(){return super.createController(this.host)}};R$=wCe([qC(1,$t),qC(2,Ut),qC(3,vr),qC(4,Jn)],R$);let M$=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 n=t=this.instantiationService.createInstance(R$,e);this.mapEditorToService.set(e,t),bv(e.onDidDispose)(()=>{n.dispose(),this.mapEditorToService.delete(e)})}return t}get quickAccess(){return this.activeService.quickAccess}constructor(e,t){this.instantiationService=e,this.codeEditorService=t,this.mapEditorToService=new Map}pick(e,t={},n=_n.None){return this.activeService.pick(e,t,n)}createQuickPick(){return this.activeService.createQuickPick()}createInputBox(){return this.activeService.createInputBox()}};M$=wCe([qC(0,$t),qC(1,Jn)],M$);class Pw{static get(e){return e.getContribution(Pw.ID)}constructor(e){this.editor=e,this.widget=new K5(this.editor)}dispose(){this.widget.dispose()}}Pw.ID="editor.controller.quickInput";class K5{constructor(e){this.codeEditor=e,this.domNode=document.createElement("div"),this.codeEditor.addOverlayWidget(this)}getId(){return K5.ID}getDomNode(){return this.domNode}getPosition(){return{preference:2}}dispose(){this.codeEditor.removeOverlayWidget(this)}}K5.ID="editor.contrib.quickInputWidget";zn(Pw.ID,Pw,4);class Bft{constructor(e,t,n,o,r){this._parsedThemeRuleBrand=void 0,this.token=e,this.index=t,this.fontStyle=n,this.foreground=o,this.background=r}}function Wft(i){if(!i||!Array.isArray(i))return[];const e=[];let t=0;for(let n=0,o=i.length;n{const h=jft(u.token,d.token);return h!==0?h:u.index-d.index});let t=0,n="000000",o="ffffff";for(;i.length>=1&&i[0].token==="";){const u=i.shift();u.fontStyle!==-1&&(t=u.fontStyle),u.foreground!==null&&(n=u.foreground),u.background!==null&&(o=u.background)}const r=new $ft;for(const u of e)r.getId(u);const s=r.getId(n),a=r.getId(o),l=new BX(t,s,a),c=new WX(l);for(let u=0,d=i.length;u>>0,this._cache.set(t,n)}return(n|e<<0)>>>0}}const zft=/\b(comment|string|regex|regexp)\b/;function Uft(i){const e=i.match(zft);if(!e)return 0;switch(e[1]){case"comment":return 1;case"string":return 2;case"regex":return 3;case"regexp":return 3}throw new Error("Unexpected match for standard token type!")}function jft(i,e){return ie?1:0}class BX{constructor(e,t,n){this._themeTrieElementRuleBrand=void 0,this._fontStyle=e,this._foreground=t,this._background=n,this.metadata=(this._fontStyle<<11|this._foreground<<15|this._background<<24)>>>0}clone(){return new BX(this._fontStyle,this._foreground,this._background)}acceptOverwrite(e,t,n){e!==-1&&(this._fontStyle=e),t!==0&&(this._foreground=t),n!==0&&(this._background=n),this.metadata=(this._fontStyle<<11|this._foreground<<15|this._background<<24)>>>0}}class WX{constructor(e){this._themeTrieElementBrand=void 0,this._mainRule=e,this._children=new Map}match(e){if(e==="")return this._mainRule;const t=e.indexOf(".");let n,o;t===-1?(n=e,o=""):(n=e.substring(0,t),o=e.substring(t+1));const r=this._children.get(n);return typeof r!="undefined"?r.match(o):this._mainRule}insert(e,t,n,o){if(e===""){this._mainRule.acceptOverwrite(t,n,o);return}const r=e.indexOf(".");let s,a;r===-1?(s=e,a=""):(s=e.substring(0,r),a=e.substring(r+1));let l=this._children.get(s);typeof l=="undefined"&&(l=new WX(this._mainRule.clone()),this._children.set(s,l)),l.insert(a,t,n,o)}}function Kft(i){const e=[];for(let t=1,n=i.length;t({format:o.format,location:o.location.toString()}))}}i.toJSONObject=e;function t(n){const o=r=>la(r)?r:void 0;if(n&&Array.isArray(n.src)&&n.src.every(r=>la(r.format)&&la(r.location)))return{weight:o(n.weight),style:o(n.style),src:n.src.map(r=>({format:r.format,location:Rt.parse(r.location)}))}}i.fromJSONObject=t})(Fae||(Fae={}));class Qft{constructor(){this._onDidChange=new le,this.onDidChange=this._onDidChange.event,this.iconSchema={definitions:{icons:{type:"object",properties:{fontId:{type:"string",description:C("iconDefinition.fontId","The id of the font to use. If not set, the font that is defined first is used.")},fontCharacter:{type:"string",description:C("iconDefinition.fontCharacter","The font character associated with the icon definition.")}},additionalProperties:!1,defaultSnippets:[{body:{fontCharacter:"\\\\e030"}}]}},type:"object",properties:{}},this.iconReferenceSchema={type:"string",pattern:`^${Mt.iconNameExpression}$`,enum:[],enumDescriptions:[]},this.iconsById={},this.iconFontsById={}}registerIcon(e,t,n,o){const r=this.iconsById[e];if(r){if(n&&!r.description){r.description=n,this.iconSchema.properties[e].markdownDescription=`${n} $(${e})`;const l=this.iconReferenceSchema.enum.indexOf(e);l!==-1&&(this.iconReferenceSchema.enumDescriptions[l]=n),this._onDidChange.fire()}return r}const s={id:e,description:n,defaults:t,deprecationMessage:o};this.iconsById[e]=s;const a={$ref:"#/definitions/icons"};return o&&(a.deprecationMessage=o),n&&(a.markdownDescription=`${n}: $(${e})`),this.iconSchema.properties[e]=a,this.iconReferenceSchema.enum.push(e),this.iconReferenceSchema.enumDescriptions.push(n||""),this._onDidChange.fire(),{id:e}}getIcons(){return Object.keys(this.iconsById).map(e=>this.iconsById[e])}getIcon(e){return this.iconsById[e]}getIconSchema(){return this.iconSchema}toString(){const e=(r,s)=>r.id.localeCompare(s.id),t=r=>{for(;Mt.isThemeIcon(r.defaults);)r=this.iconsById[r.defaults.id];return`codicon codicon-${r?r.id:""}`},n=[];n.push("| preview | identifier | default codicon ID | description"),n.push("| ----------- | --------------------------------- | --------------------------------- | --------------------------------- |");const o=Object.keys(this.iconsById).map(r=>this.iconsById[r]);for(const r of o.filter(s=>!!s.description).sort(e))n.push(`||${r.id}|${Mt.isThemeIcon(r.defaults)?r.defaults.id:r.id}|${r.description||""}|`);n.push("| preview | identifier "),n.push("| ----------- | --------------------------------- |");for(const r of o.filter(s=>!Mt.isThemeIcon(s.defaults)).sort(e))n.push(`||${r.id}|`);return n.join(` +`)}}const Gb=new Qft;no.add(Zft.IconContribution,Gb);function Eo(i,e,t,n){return Gb.registerIcon(i,e,t,n)}function xCe(){return Gb}function Jft(){const i=F_e();for(const e in i){const t="\\"+i[e].toString(16);Gb.registerIcon(e,{fontCharacter:t})}}Jft();const LCe="vscode://schemas/icons",ECe=no.as(l5.JSONContribution);ECe.registerSchema(LCe,Gb.getIconSchema());const Bae=new bi(()=>ECe.notifySchemaChanged(LCe),200);Gb.onDidChange(()=>{Bae.isScheduled()||Bae.schedule()});const DCe=Eo("widget-close",Xe.close,C("widgetClose","Icon for the close action in widgets."));Eo("goto-previous-location",Xe.arrowUp,C("previousChangeIcon","Icon for goto previous editor location."));Eo("goto-next-location",Xe.arrowDown,C("nextChangeIcon","Icon for goto next editor location."));Mt.modify(Xe.sync,"spin");Mt.modify(Xe.loading,"spin");function egt(i){const e=new Be,t=e.add(new le),n=xCe();return e.add(n.onDidChange(()=>t.fire())),i&&e.add(i.onDidProductIconThemeChange(()=>t.fire())),{dispose:()=>e.dispose(),onDidChange:t.event,getCSS(){const o=i?i.getProductIconTheme():new kCe,r={},s=l=>{const c=o.getIcon(l);if(!c)return;const u=c.font;return u?(r[u.id]=u.definition,`.codicon-${l.id}:before { content: '${c.fontCharacter}'; font-family: ${Noe(u.id)}; }`):`.codicon-${l.id}:before { content: '${c.fontCharacter}'; }`},a=[];for(const l of n.getIcons()){const c=s(l);c&&a.push(c)}for(const l in r){const c=r[l],u=c.weight?`font-weight: ${c.weight};`:"",d=c.style?`font-style: ${c.style};`:"",h=c.src.map(f=>`${yv(f.location)} format('${f.format}')`).join(", ");a.push(`@font-face { src: ${h}; font-family: ${Noe(l)};${u}${d} font-display: block; }`)}return a.join(` +`)}}}class kCe{getIcon(e){const t=xCe();let n=e.defaults;for(;Mt.isThemeIcon(n);){const o=t.getIcon(n.id);if(!o)return;n=o.defaults}return n}}const kg="vs",Oy="vs-dark",R0="hc-black",M0="hc-light",ICe=no.as(tbe.ColorContribution),tgt=no.as(_be.ThemingContribution);class TCe{constructor(e,t){this.semanticHighlighting=!1,this.themeData=t;const n=t.base;e.length>0?(wM(e)?this.id=e:this.id=n+" "+e,this.themeName=e):(this.id=n,this.themeName=n),this.colors=null,this.defaultColors=Object.create(null),this._tokenTheme=null}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,ve.fromHex(this.themeData.colors[t]));if(this.themeData.inherit){const t=A$(this.themeData.base);for(const n in t.colors)e.has(n)||e.set(n,ve.fromHex(t.colors[n]))}this.colors=e}return this.colors}getColor(e,t){const n=this.getColors().get(e);if(n)return n;if(t!==!1)return this.getDefault(e)}getDefault(e){let t=this.defaultColors[e];return t||(t=ICe.resolveDefaultColor(e,this),this.defaultColors[e]=t,t)}defines(e){return this.getColors().has(e)}get type(){switch(this.base){case kg:return Ic.LIGHT;case R0:return Ic.HIGH_CONTRAST_DARK;case M0:return Ic.HIGH_CONTRAST_LIGHT;default:return Ic.DARK}}get tokenTheme(){if(!this._tokenTheme){let e=[],t=[];if(this.themeData.inherit){const r=A$(this.themeData.base);e=r.rules,r.encodedTokensColors&&(t=r.encodedTokensColors)}const n=this.themeData.colors["editor.foreground"],o=this.themeData.colors["editor.background"];if(n||o){const r={token:""};n&&(r.foreground=n),o&&(r.background=o),e.push(r)}e=e.concat(this.themeData.rules),this.themeData.encodedTokensColors&&(t=this.themeData.encodedTokensColors),this._tokenTheme=SCe.createFromRawTokenTheme(e,t)}return this._tokenTheme}getTokenStyleMetadata(e,t,n){const r=this.tokenTheme._match([e].concat(t).join(".")).metadata,s=is.getForeground(r),a=is.getFontStyle(r);return{foreground:s,italic:Boolean(a&1),bold:Boolean(a&2),underline:Boolean(a&4),strikethrough:Boolean(a&8)}}}function wM(i){return i===kg||i===Oy||i===R0||i===M0}function A$(i){switch(i){case kg:return qft;case Oy:return Gft;case R0:return Xft;case M0:return Yft}}function V2(i){const e=A$(i);return new TCe(i,e)}class ngt extends _e{constructor(){super(),this._onColorThemeChange=this._register(new le),this.onDidColorThemeChange=this._onColorThemeChange.event,this._onProductIconThemeChange=this._register(new le),this.onDidProductIconThemeChange=this._onProductIconThemeChange.event,this._environment=Object.create(null),this._builtInProductIconTheme=new kCe,this._autoDetectHighContrast=!0,this._knownThemes=new Map,this._knownThemes.set(kg,V2(kg)),this._knownThemes.set(Oy,V2(Oy)),this._knownThemes.set(R0,V2(R0)),this._knownThemes.set(M0,V2(M0));const e=this._register(egt(this));this._codiconCSS=e.getCSS(),this._themeCSS="",this._allCSS=`${this._codiconCSS} +${this._themeCSS}`,this._globalStyleElement=null,this._styleElements=[],this._colorMapOverride=null,this.setTheme(kg),this._onOSSchemeChanged(),this._register(e.onDidChange(()=>{this._codiconCSS=e.getCSS(),this._updateCSS()})),G_e("(forced-colors: active)",()=>{this._onOSSchemeChanged()})}registerEditorContainer(e){return qA(e)?this._registerShadowDomContainer(e):this._registerRegularEditorContainer()}_registerRegularEditorContainer(){return this._globalStyleElement||(this._globalStyleElement=Wc(void 0,e=>{e.className="monaco-colors",e.textContent=this._allCSS}),this._styleElements.push(this._globalStyleElement)),_e.None}_registerShadowDomContainer(e){const t=Wc(e,n=>{n.className="monaco-colors",n.textContent=this._allCSS});return this._styleElements.push(t),{dispose:()=>{for(let n=0;n{n.base===e&&n.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(kg),this._updateActualTheme(t)}_updateActualTheme(e){!e||this._theme===e||(this._theme=e,this._updateThemeOrColorMap())}_onOSSchemeChanged(){if(this._autoDetectHighContrast){const e=window.matchMedia("(forced-colors: active)").matches;if(e!==Hd(this._theme.type)){let t;xw(this._theme.type)?t=e?R0:Oy:t=e?M0:kg,this._updateActualTheme(this._knownThemes.get(t))}}}setAutoDetectHighContrast(e){this._autoDetectHighContrast=e,this._onOSSchemeChanged()}_updateThemeOrColorMap(){const e=[],t={},n={addRule:s=>{t[s]||(e.push(s),t[s]=!0)}};tgt.getThemingParticipants().forEach(s=>s(this._theme,n,this._environment));const o=[];for(const s of ICe.getColors()){const a=this._theme.getColor(s.id,!0);a&&o.push(`${CG(s.id)}: ${a.toString()};`)}n.addRule(`.monaco-editor, .monaco-diff-editor { ${o.join(` +`)} }`);const r=this._colorMapOverride||this._theme.tokenTheme.getColorMap();n.addRule(Kft(r)),this._themeCSS=e.join(` `),this._updateCSS(),oo.setColorMap(r),this._onColorThemeChange.fire(this._theme)}_updateCSS(){this._allCSS=`${this._codiconCSS} -${this._themeCSS}`,this._styleElements.forEach(e=>e.textContent=this._allCSS)}getFileIconTheme(){return{hasFileIcons:!1,hasFolderIcons:!1,hidesExplorerArrows:!1}}getProductIconTheme(){return this._builtInProductIconTheme}}const nc=wn("themeService");var Zft=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},q9=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let N$=class extends _e{constructor(e,t,n){super(),this._contextKeyService=e,this._layoutService=t,this._configurationService=n,this._accessibilitySupport=0,this._onDidChangeScreenReaderOptimized=new le,this._onDidChangeReducedMotion=new le,this._accessibilityModeEnabledContext=UI.bindTo(this._contextKeyService);const o=()=>this._accessibilityModeEnabledContext.set(this.isScreenReaderOptimized());this._register(this._configurationService.onDidChangeConfiguration(s=>{s.affectsConfiguration("editor.accessibilitySupport")&&(o(),this._onDidChangeScreenReaderOptimized.fire()),s.affectsConfiguration("workbench.reduceMotion")&&(this._configMotionReduced=this._configurationService.getValue("workbench.reduceMotion"),this._onDidChangeReducedMotion.fire())})),o(),this._register(this.onDidChangeScreenReaderOptimized(()=>o()));const r=window.matchMedia("(prefers-reduced-motion: reduce)");this._systemMotionReduced=r.matches,this._configMotionReduced=this._configurationService.getValue("workbench.reduceMotion"),this.initReducedMotionListeners(r)}initReducedMotionListeners(e){if(!this._layoutService.hasContainer)return;this._register(ke(e,"change",()=>{this._systemMotionReduced=e.matches,this._configMotionReduced==="auto"&&this._onDidChangeReducedMotion.fire()}));const t=()=>{const n=this.isMotionReduced();this._layoutService.container.classList.toggle("reduce-motion",n),this._layoutService.container.classList.toggle("enable-motion",!n)};t(),this._register(this.onDidChangeReducedMotion(()=>t()))}get onDidChangeScreenReaderOptimized(){return this._onDidChangeScreenReaderOptimized.event}isScreenReaderOptimized(){const e=this._configurationService.getValue("editor.accessibilitySupport");return e==="on"||e==="auto"&&this._accessibilitySupport===2}get onDidChangeReducedMotion(){return this._onDidChangeReducedMotion.event}isMotionReduced(){const e=this._configMotionReduced;return e==="on"||e==="auto"&&this._systemMotionReduced}getAccessibilitySupport(){return this._accessibilitySupport}};N$=Zft([q9(0,Ut),q9(1,yS),q9(2,En)],N$);var K5=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},ab=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},dC,Xp;let R$=class{constructor(e,t){this._commandService=e,this._hiddenStates=new qP(t)}createMenu(e,t,n){return new A$(e,this._hiddenStates,Object.assign({emitEventsForSubmenuChanges:!1,eventDebounceDelay:50},n),this._commandService,t)}resetHiddenStates(e){this._hiddenStates.reset(e)}};R$=K5([ab(0,_o),ab(1,qu)],R$);let qP=dC=class{constructor(e){this._storageService=e,this._disposables=new Be,this._onDidChange=new le,this.onDidChange=this._onDidChange.event,this._ignoreChangeEvent=!1,this._hiddenByDefaultCache=new Map;try{const t=e.get(dC._key,0,"{}");this._data=JSON.parse(t)}catch{this._data=Object.create(null)}this._disposables.add(e.onDidChangeValue(0,dC._key,this._disposables)(()=>{if(!this._ignoreChangeEvent)try{const t=e.get(dC._key,0,"{}");this._data=JSON.parse(t)}catch(t){console.log("FAILED to read storage after UPDATE",t)}this._onDidChange.fire()}))}dispose(){this._onDidChange.dispose(),this._disposables.dispose()}_isHiddenByDefault(e,t){var n;return(n=this._hiddenByDefaultCache.get(`${e.id}/${t}`))!==null&&n!==void 0?n:!1}setDefaultState(e,t,n){this._hiddenByDefaultCache.set(`${e.id}/${t}`,n)}isHidden(e,t){var n,o;const r=this._isHiddenByDefault(e,t),s=(o=(n=this._data[e.id])===null||n===void 0?void 0:n.includes(t))!==null&&o!==void 0?o:!1;return r?!s:s}updateHidden(e,t,n){this._isHiddenByDefault(e,t)&&(n=!n);const r=this._data[e.id];if(n)r?r.indexOf(t)<0&&r.push(t):this._data[e.id]=[t];else if(r){const s=r.indexOf(t);s>=0&&nXe(r,s),r.length===0&&delete this._data[e.id]}this._persist()}reset(e){if(e===void 0)this._data=Object.create(null),this._persist();else{for(const{id:t}of e)this._data[t]&&delete this._data[t];this._persist()}}_persist(){try{this._ignoreChangeEvent=!0;const e=JSON.stringify(this._data);this._storageService.store(dC._key,e,0,0)}finally{this._ignoreChangeEvent=!1}}};qP._key="menu.hiddenCommands";qP=dC=K5([ab(0,qu)],qP);let M$=Xp=class{constructor(e,t,n,o,r){this._id=e,this._hiddenStates=t,this._collectContextKeysForSubmenus=n,this._commandService=o,this._contextKeyService=r,this._menuGroups=[],this._structureContextKeys=new Set,this._preconditionContextKeys=new Set,this._toggledContextKeys=new Set,this.refresh()}get structureContextKeys(){return this._structureContextKeys}get preconditionContextKeys(){return this._preconditionContextKeys}get toggledContextKeys(){return this._toggledContextKeys}refresh(){this._menuGroups.length=0,this._structureContextKeys.clear(),this._preconditionContextKeys.clear(),this._toggledContextKeys.clear();const e=Hr.getMenuItems(this._id);let t;e.sort(Xp._compareMenuItems);for(const n of e){const o=n.group||"";(!t||t[0]!==o)&&(t=[o,[]],this._menuGroups.push(t)),t[1].push(n),this._collectContextKeys(n)}}_collectContextKeys(e){if(Xp._fillInKbExprKeys(e.when,this._structureContextKeys),IC(e)){if(e.command.precondition&&Xp._fillInKbExprKeys(e.command.precondition,this._preconditionContextKeys),e.command.toggled){const t=e.command.toggled.condition||e.command.toggled;Xp._fillInKbExprKeys(t,this._toggledContextKeys)}}else this._collectContextKeysForSubmenus&&Hr.getMenuItems(e.submenu).forEach(this._collectContextKeys,this)}createActionGroups(e){const t=[];for(const n of this._menuGroups){const[o,r]=n,s=[];for(const a of r)if(this._contextKeyService.contextMatchesRules(a.when)){const l=IC(a);l&&this._hiddenStates.setDefaultState(this._id,a.command.id,!!a.isHiddenByDefault);const c=Qft(this._id,l?a.command:a,this._hiddenStates);if(l)s.push(new Ou(a.command,a.alt,e,c,this._contextKeyService,this._commandService));else{const u=new Xp(a.submenu,this._hiddenStates,this._collectContextKeysForSubmenus,this._commandService,this._contextKeyService).createActionGroups(e),d=kr.join(...u.map(h=>h[1]));d.length>0&&s.push(new OD(a,c,d))}}s.length>0&&t.push([o,s])}return t}static _fillInKbExprKeys(e,t){if(e)for(const n of e.keys())t.add(n)}static _compareMenuItems(e,t){const n=e.group,o=t.group;if(n!==o){if(n){if(!o)return-1}else return 1;if(n==="navigation")return-1;if(o==="navigation")return 1;const a=n.localeCompare(o);if(a!==0)return a}const r=e.order||0,s=t.order||0;return rs?1:Xp._compareTitles(IC(e)?e.command.title:e.title,IC(t)?t.command.title:t.title)}static _compareTitles(e,t){const n=typeof e=="string"?e:e.original,o=typeof t=="string"?t:t.original;return n.localeCompare(o)}};M$=Xp=K5([ab(3,_o),ab(4,Ut)],M$);let A$=class{constructor(e,t,n,o,r){this._disposables=new Be,this._menuInfo=new M$(e,t,n.emitEventsForSubmenuChanges,o,r);const s=new bi(()=>{this._menuInfo.refresh(),this._onDidChange.fire({menu:this,isStructuralChange:!0,isEnablementChange:!0,isToggleChange:!0})},n.eventDebounceDelay);this._disposables.add(s),this._disposables.add(Hr.onDidChangeMenu(u=>{u.has(e)&&s.schedule()}));const a=this._disposables.add(new Be),l=u=>{let d=!1,h=!1,f=!1;for(const g of u)if(d=d||g.isStructuralChange,h=h||g.isEnablementChange,f=f||g.isToggleChange,d&&h&&f)break;return{menu:this,isStructuralChange:d,isEnablementChange:h,isToggleChange:f}},c=()=>{a.add(r.onDidChangeContext(u=>{const d=u.affectsSome(this._menuInfo.structureContextKeys),h=u.affectsSome(this._menuInfo.preconditionContextKeys),f=u.affectsSome(this._menuInfo.toggledContextKeys);(d||h||f)&&this._onDidChange.fire({menu:this,isStructuralChange:d,isEnablementChange:h,isToggleChange:f})})),a.add(t.onDidChange(u=>{this._onDidChange.fire({menu:this,isStructuralChange:!0,isEnablementChange:!1,isToggleChange:!1})}))};this._onDidChange=new __e({onWillAddFirstListener:c,onDidRemoveLastListener:a.clear.bind(a),delay:n.eventDebounceDelay,merge:l}),this.onDidChange=this._onDidChange.event}getActions(e){return this._menuInfo.createActionGroups(e)}dispose(){this._disposables.dispose(),this._onDidChange.dispose()}};A$=K5([ab(3,_o),ab(4,Ut)],A$);function Qft(i,e,t){const n=qZe(e)?e.submenu.id:e.id,o=typeof e.title=="string"?e.title:e.title.value,r=mw({id:`hide/${i.id}/${n}`,label:C("hide.label","Hide '{0}'",o),run(){t.updateHidden(i,n,!0)}}),s=mw({id:`toggle/${i.id}/${n}`,label:o,get checked(){return!t.isHidden(i,n)},run(){t.updateHidden(i,n,!!this.checked)}});return{hide:r,toggle:s,get isHidden(){return!s.checked}}}var Jft=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Nae=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},C_=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};let P$=class extends _e{constructor(e,t){super(),this.layoutService=e,this.logService=t,this.mapTextToType=new Map,this.findText="",this.resources=[],(sp||H_e)&&this.installWebKitWriteTextWorkaround()}installWebKitWriteTextWorkaround(){const e=()=>{const t=new t5;this.webKitPendingClipboardWritePromise&&!this.webKitPendingClipboardWritePromise.isSettled&&this.webKitPendingClipboardWritePromise.cancel(),this.webKitPendingClipboardWritePromise=t,navigator.clipboard.write([new ClipboardItem({"text/plain":t.p})]).catch(n=>C_(this,void 0,void 0,function*(){(!(n instanceof Error)||n.name!=="NotAllowedError"||!t.isRejected)&&this.logService.error(n)}))};this.layoutService.hasContainer&&(this._register(ke(this.layoutService.container,"click",e)),this._register(ke(this.layoutService.container,"keydown",e)))}writeText(e,t){return C_(this,void 0,void 0,function*(){if(t){this.mapTextToType.set(t,e);return}if(this.webKitPendingClipboardWritePromise)return this.webKitPendingClipboardWritePromise.complete(e);try{return yield navigator.clipboard.writeText(e)}catch(r){console.error(r)}const n=document.activeElement,o=document.body.appendChild(He("textarea",{"aria-hidden":!0}));o.style.height="1px",o.style.width="1px",o.style.position="absolute",o.value=e,o.focus(),o.select(),document.execCommand("copy"),n instanceof HTMLElement&&n.focus(),document.body.removeChild(o)})}readText(e){return C_(this,void 0,void 0,function*(){if(e)return this.mapTextToType.get(e)||"";try{return yield navigator.clipboard.readText()}catch(t){return console.error(t),""}})}readFindText(){return C_(this,void 0,void 0,function*(){return this.findText})}writeFindText(e){return C_(this,void 0,void 0,function*(){this.findText=e})}writeResources(e){return C_(this,void 0,void 0,function*(){this.resources=e})}readResources(){return C_(this,void 0,void 0,function*(){return this.resources})}};P$=Jft([Nae(0,yS),Nae(1,tc)],P$);const bp=wn("clipboardService");var egt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},tgt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const EE="data-keybinding-context";class MX{constructor(e,t){this._id=e,this._parent=t,this._value=Object.create(null),this._value._contextId=e}get value(){return Object.assign({},this._value)}setValue(e,t){return this._value[e]!==t?(this._value[e]=t,!0):!1}removeValue(e){return e in this._value?(delete this._value[e],!0):!1}getValue(e){const t=this._value[e];return typeof t=="undefined"&&this._parent?this._parent.getValue(e):t}}class Py extends MX{constructor(){super(-1,null)}setValue(e,t){return!1}removeValue(e){return!1}getValue(e){}}Py.INSTANCE=new Py;class xk extends MX{constructor(e,t,n){super(e,null),this._configurationService=t,this._values=Rw.forConfigKeys(),this._listener=this._configurationService.onDidChangeConfiguration(o=>{if(o.source===7){const r=Array.from(this._values,([s])=>s);this._values.clear(),n.fire(new Mae(r))}else{const r=[];for(const s of o.affectedKeys){const a=`config.${s}`,l=this._values.findSuperstr(a);l!==void 0&&(r.push(...mn.map(l,([c])=>c)),this._values.deleteSuperstr(a)),this._values.has(a)&&(r.push(a),this._values.delete(a))}n.fire(new Mae(r))}})}dispose(){this._listener.dispose()}getValue(e){if(e.indexOf(xk._keyPrefix)!==0)return super.getValue(e);if(this._values.has(e))return this._values.get(e);const t=e.substr(xk._keyPrefix.length),n=this._configurationService.getValue(t);let o;switch(typeof n){case"number":case"boolean":case"string":o=n;break;default:Array.isArray(n)?o=JSON.stringify(n):o=n}return this._values.set(e,o),o}setValue(e,t){return super.setValue(e,t)}removeValue(e){return super.removeValue(e)}}xk._keyPrefix="config.";class ngt{constructor(e,t,n){this._service=e,this._key=t,this._defaultValue=n,this.reset()}set(e){this._service.setContext(this._key,e)}reset(){typeof this._defaultValue=="undefined"?this._service.removeContext(this._key):this._service.setContext(this._key,this._defaultValue)}get(){return this._service.getContextKeyValue(this._key)}}class Rae{constructor(e){this.key=e}affectsSome(e){return e.has(this.key)}allKeysContainedIn(e){return this.affectsSome(e)}}class Mae{constructor(e){this.keys=e}affectsSome(e){for(const t of this.keys)if(e.has(t))return!0;return!1}allKeysContainedIn(e){return this.keys.every(t=>e.has(t))}}class igt{constructor(e){this.events=e}affectsSome(e){for(const t of this.events)if(t.affectsSome(e))return!0;return!1}allKeysContainedIn(e){return this.events.every(t=>t.allKeysContainedIn(e))}}function ogt(i,e){return i.allKeysContainedIn(new Set(Object.keys(e)))}class SCe extends _e{constructor(e){super(),this._onDidChangeContext=this._register(new q0({merge:t=>new igt(t)})),this.onDidChangeContext=this._onDidChangeContext.event,this._isDisposed=!1,this._myContextId=e}createKey(e,t){if(this._isDisposed)throw new Error("AbstractContextKeyService has been disposed");return new ngt(this,e,t)}bufferChangeEvents(e){this._onDidChangeContext.pause();try{e()}finally{this._onDidChangeContext.resume()}}createScoped(e){if(this._isDisposed)throw new Error("AbstractContextKeyService has been disposed");return new rgt(this,e)}contextMatchesRules(e){if(this._isDisposed)throw new Error("AbstractContextKeyService has been disposed");const t=this.getContextValuesContainer(this._myContextId);return e?e.evaluate(t):!0}getContextKeyValue(e){if(!this._isDisposed)return this.getContextValuesContainer(this._myContextId).getValue(e)}setContext(e,t){if(this._isDisposed)return;const n=this.getContextValuesContainer(this._myContextId);!n||n.setValue(e,t)&&this._onDidChangeContext.fire(new Rae(e))}removeContext(e){this._isDisposed||this.getContextValuesContainer(this._myContextId).removeValue(e)&&this._onDidChangeContext.fire(new Rae(e))}getContext(e){return this._isDisposed?Py.INSTANCE:this.getContextValuesContainer(sgt(e))}dispose(){super.dispose(),this._isDisposed=!0}}let O$=class extends SCe{constructor(e){super(0),this._contexts=new Map,this._lastContextId=0;const t=this._register(new xk(this._myContextId,e,this._onDidChangeContext));this._contexts.set(this._myContextId,t)}getContextValuesContainer(e){return this._isDisposed?Py.INSTANCE:this._contexts.get(e)||Py.INSTANCE}createChildContext(e=this._myContextId){if(this._isDisposed)throw new Error("ContextKeyService has been disposed");const t=++this._lastContextId;return this._contexts.set(t,new MX(t,this.getContextValuesContainer(e))),t}disposeContext(e){this._isDisposed||this._contexts.delete(e)}};O$=egt([tgt(0,En)],O$);class rgt extends SCe{constructor(e,t){if(super(e.createChildContext()),this._parentChangeListener=this._register(new Kr),this._parent=e,this._updateParentChangeListener(),this._domNode=t,this._domNode.hasAttribute(EE)){let n="";this._domNode.classList&&(n=Array.from(this._domNode.classList.values()).join(", ")),console.error(`Element already has context attribute${n?": "+n:""}`)}this._domNode.setAttribute(EE,String(this._myContextId))}_updateParentChangeListener(){this._parentChangeListener.value=this._parent.onDidChangeContext(e=>{const n=this._parent.getContextValuesContainer(this._myContextId).value;ogt(e,n)||this._onDidChangeContext.fire(e)})}dispose(){this._isDisposed||(this._parent.disposeContext(this._myContextId),this._domNode.removeAttribute(EE),super.dispose())}getContextValuesContainer(e){return this._isDisposed?Py.INSTANCE:this._parent.getContextValuesContainer(e)}createChildContext(e=this._myContextId){if(this._isDisposed)throw new Error("ScopedContextKeyService has been disposed");return this._parent.createChildContext(e)}disposeContext(e){this._isDisposed||this._parent.disposeContext(e)}}function sgt(i){for(;i;){if(i.hasAttribute(EE)){const e=i.getAttribute(EE);return e?parseInt(e,10):NaN}i=i.parentElement}return 0}function agt(i,e,t){i.get(Ut).createKey(String(e),lgt(t))}function lgt(i){return r_e(i,e=>{if(typeof e=="object"&&e.$mid===1)return Rt.revive(e).toString();if(e instanceof Rt)return e.toString()})}Rn.registerCommand("_setContext",agt);Rn.registerCommand({id:"getContextKeyInfo",handler(){return[...lt.all()].sort((i,e)=>i.key.localeCompare(e.key))},description:{description:C("getContextKeyInfo","A command that returns information about context keys"),args:[]}});Rn.registerCommand("_generateContextKeyInfo",function(){const i=[],e=new Set;for(const t of lt.all())e.has(t.key)||(e.add(t.key),i.push(t));i.sort((t,n)=>t.key.localeCompare(n.key)),console.log(JSON.stringify(i,void 0,2))});class cgt{constructor(e,t){this.key=e,this.data=t,this.incoming=new Map,this.outgoing=new Map}}class Aae{constructor(e){this._hashFn=e,this._nodes=new Map}roots(){const e=[];for(const t of this._nodes.values())t.outgoing.size===0&&e.push(t);return e}insertEdge(e,t){const n=this.lookupOrInsertNode(e),o=this.lookupOrInsertNode(t);n.outgoing.set(o.key,o),o.incoming.set(n.key,n)}removeNode(e){const t=this._hashFn(e);this._nodes.delete(t);for(const n of this._nodes.values())n.outgoing.delete(t),n.incoming.delete(t)}lookupOrInsertNode(e){const t=this._hashFn(e);let n=this._nodes.get(t);return n||(n=new cgt(t,e),this._nodes.set(t,n)),n}isEmpty(){return this._nodes.size===0}toString(){const e=[];for(const[t,n]of this._nodes)e.push(`${t} +${this._themeCSS}`,this._styleElements.forEach(e=>e.textContent=this._allCSS)}getFileIconTheme(){return{hasFileIcons:!1,hasFolderIcons:!1,hidesExplorerArrows:!1}}getProductIconTheme(){return this._builtInProductIconTheme}}const ic=yn("themeService");var igt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},q9=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let P$=class extends _e{constructor(e,t,n){super(),this._contextKeyService=e,this._layoutService=t,this._configurationService=n,this._accessibilitySupport=0,this._onDidChangeScreenReaderOptimized=new le,this._onDidChangeReducedMotion=new le,this._accessibilityModeEnabledContext=KI.bindTo(this._contextKeyService);const o=()=>this._accessibilityModeEnabledContext.set(this.isScreenReaderOptimized());this._register(this._configurationService.onDidChangeConfiguration(s=>{s.affectsConfiguration("editor.accessibilitySupport")&&(o(),this._onDidChangeScreenReaderOptimized.fire()),s.affectsConfiguration("workbench.reduceMotion")&&(this._configMotionReduced=this._configurationService.getValue("workbench.reduceMotion"),this._onDidChangeReducedMotion.fire())})),o(),this._register(this.onDidChangeScreenReaderOptimized(()=>o()));const r=window.matchMedia("(prefers-reduced-motion: reduce)");this._systemMotionReduced=r.matches,this._configMotionReduced=this._configurationService.getValue("workbench.reduceMotion"),this.initReducedMotionListeners(r)}initReducedMotionListeners(e){if(!this._layoutService.hasContainer)return;this._register(ke(e,"change",()=>{this._systemMotionReduced=e.matches,this._configMotionReduced==="auto"&&this._onDidChangeReducedMotion.fire()}));const t=()=>{const n=this.isMotionReduced();this._layoutService.container.classList.toggle("reduce-motion",n),this._layoutService.container.classList.toggle("enable-motion",!n)};t(),this._register(this.onDidChangeReducedMotion(()=>t()))}get onDidChangeScreenReaderOptimized(){return this._onDidChangeScreenReaderOptimized.event}isScreenReaderOptimized(){const e=this._configurationService.getValue("editor.accessibilitySupport");return e==="on"||e==="auto"&&this._accessibilitySupport===2}get onDidChangeReducedMotion(){return this._onDidChangeReducedMotion.event}isMotionReduced(){const e=this._configMotionReduced;return e==="on"||e==="auto"&&this._systemMotionReduced}getAccessibilitySupport(){return this._accessibilitySupport}};P$=igt([q9(0,Ut),q9(1,SS),q9(2,En)],P$);var q5=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},lb=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},dC,Yp;let O$=class{constructor(e,t){this._commandService=e,this._hiddenStates=new YP(t)}createMenu(e,t,n){return new B$(e,this._hiddenStates,Object.assign({emitEventsForSubmenuChanges:!1,eventDebounceDelay:50},n),this._commandService,t)}resetHiddenStates(e){this._hiddenStates.reset(e)}};O$=q5([lb(0,_o),lb(1,Gu)],O$);let YP=dC=class{constructor(e){this._storageService=e,this._disposables=new Be,this._onDidChange=new le,this.onDidChange=this._onDidChange.event,this._ignoreChangeEvent=!1,this._hiddenByDefaultCache=new Map;try{const t=e.get(dC._key,0,"{}");this._data=JSON.parse(t)}catch{this._data=Object.create(null)}this._disposables.add(e.onDidChangeValue(0,dC._key,this._disposables)(()=>{if(!this._ignoreChangeEvent)try{const t=e.get(dC._key,0,"{}");this._data=JSON.parse(t)}catch(t){console.log("FAILED to read storage after UPDATE",t)}this._onDidChange.fire()}))}dispose(){this._onDidChange.dispose(),this._disposables.dispose()}_isHiddenByDefault(e,t){var n;return(n=this._hiddenByDefaultCache.get(`${e.id}/${t}`))!==null&&n!==void 0?n:!1}setDefaultState(e,t,n){this._hiddenByDefaultCache.set(`${e.id}/${t}`,n)}isHidden(e,t){var n,o;const r=this._isHiddenByDefault(e,t),s=(o=(n=this._data[e.id])===null||n===void 0?void 0:n.includes(t))!==null&&o!==void 0?o:!1;return r?!s:s}updateHidden(e,t,n){this._isHiddenByDefault(e,t)&&(n=!n);const r=this._data[e.id];if(n)r?r.indexOf(t)<0&&r.push(t):this._data[e.id]=[t];else if(r){const s=r.indexOf(t);s>=0&&lXe(r,s),r.length===0&&delete this._data[e.id]}this._persist()}reset(e){if(e===void 0)this._data=Object.create(null),this._persist();else{for(const{id:t}of e)this._data[t]&&delete this._data[t];this._persist()}}_persist(){try{this._ignoreChangeEvent=!0;const e=JSON.stringify(this._data);this._storageService.store(dC._key,e,0,0)}finally{this._ignoreChangeEvent=!1}}};YP._key="menu.hiddenCommands";YP=dC=q5([lb(0,Gu)],YP);let F$=Yp=class{constructor(e,t,n,o,r){this._id=e,this._hiddenStates=t,this._collectContextKeysForSubmenus=n,this._commandService=o,this._contextKeyService=r,this._menuGroups=[],this._structureContextKeys=new Set,this._preconditionContextKeys=new Set,this._toggledContextKeys=new Set,this.refresh()}get structureContextKeys(){return this._structureContextKeys}get preconditionContextKeys(){return this._preconditionContextKeys}get toggledContextKeys(){return this._toggledContextKeys}refresh(){this._menuGroups.length=0,this._structureContextKeys.clear(),this._preconditionContextKeys.clear(),this._toggledContextKeys.clear();const e=Hr.getMenuItems(this._id);let t;e.sort(Yp._compareMenuItems);for(const n of e){const o=n.group||"";(!t||t[0]!==o)&&(t=[o,[]],this._menuGroups.push(t)),t[1].push(n),this._collectContextKeys(n)}}_collectContextKeys(e){if(Yp._fillInKbExprKeys(e.when,this._structureContextKeys),IC(e)){if(e.command.precondition&&Yp._fillInKbExprKeys(e.command.precondition,this._preconditionContextKeys),e.command.toggled){const t=e.command.toggled.condition||e.command.toggled;Yp._fillInKbExprKeys(t,this._toggledContextKeys)}}else this._collectContextKeysForSubmenus&&Hr.getMenuItems(e.submenu).forEach(this._collectContextKeys,this)}createActionGroups(e){const t=[];for(const n of this._menuGroups){const[o,r]=n,s=[];for(const a of r)if(this._contextKeyService.contextMatchesRules(a.when)){const l=IC(a);l&&this._hiddenStates.setDefaultState(this._id,a.command.id,!!a.isHiddenByDefault);const c=ogt(this._id,l?a.command:a,this._hiddenStates);if(l)s.push(new Fu(a.command,a.alt,e,c,this._contextKeyService,this._commandService));else{const u=new Yp(a.submenu,this._hiddenStates,this._collectContextKeysForSubmenus,this._commandService,this._contextKeyService).createActionGroups(e),d=kr.join(...u.map(h=>h[1]));d.length>0&&s.push(new OD(a,c,d))}}s.length>0&&t.push([o,s])}return t}static _fillInKbExprKeys(e,t){if(e)for(const n of e.keys())t.add(n)}static _compareMenuItems(e,t){const n=e.group,o=t.group;if(n!==o){if(n){if(!o)return-1}else return 1;if(n==="navigation")return-1;if(o==="navigation")return 1;const a=n.localeCompare(o);if(a!==0)return a}const r=e.order||0,s=t.order||0;return rs?1:Yp._compareTitles(IC(e)?e.command.title:e.title,IC(t)?t.command.title:t.title)}static _compareTitles(e,t){const n=typeof e=="string"?e:e.original,o=typeof t=="string"?t:t.original;return n.localeCompare(o)}};F$=Yp=q5([lb(3,_o),lb(4,Ut)],F$);let B$=class{constructor(e,t,n,o,r){this._disposables=new Be,this._menuInfo=new F$(e,t,n.emitEventsForSubmenuChanges,o,r);const s=new bi(()=>{this._menuInfo.refresh(),this._onDidChange.fire({menu:this,isStructuralChange:!0,isEnablementChange:!0,isToggleChange:!0})},n.eventDebounceDelay);this._disposables.add(s),this._disposables.add(Hr.onDidChangeMenu(u=>{u.has(e)&&s.schedule()}));const a=this._disposables.add(new Be),l=u=>{let d=!1,h=!1,f=!1;for(const g of u)if(d=d||g.isStructuralChange,h=h||g.isEnablementChange,f=f||g.isToggleChange,d&&h&&f)break;return{menu:this,isStructuralChange:d,isEnablementChange:h,isToggleChange:f}},c=()=>{a.add(r.onDidChangeContext(u=>{const d=u.affectsSome(this._menuInfo.structureContextKeys),h=u.affectsSome(this._menuInfo.preconditionContextKeys),f=u.affectsSome(this._menuInfo.toggledContextKeys);(d||h||f)&&this._onDidChange.fire({menu:this,isStructuralChange:d,isEnablementChange:h,isToggleChange:f})})),a.add(t.onDidChange(u=>{this._onDidChange.fire({menu:this,isStructuralChange:!0,isEnablementChange:!1,isToggleChange:!1})}))};this._onDidChange=new E_e({onWillAddFirstListener:c,onDidRemoveLastListener:a.clear.bind(a),delay:n.eventDebounceDelay,merge:l}),this.onDidChange=this._onDidChange.event}getActions(e){return this._menuInfo.createActionGroups(e)}dispose(){this._disposables.dispose(),this._onDidChange.dispose()}};B$=q5([lb(3,_o),lb(4,Ut)],B$);function ogt(i,e,t){const n=JZe(e)?e.submenu.id:e.id,o=typeof e.title=="string"?e.title:e.title.value,r=my({id:`hide/${i.id}/${n}`,label:C("hide.label","Hide '{0}'",o),run(){t.updateHidden(i,n,!0)}}),s=my({id:`toggle/${i.id}/${n}`,label:o,get checked(){return!t.isHidden(i,n)},run(){t.updateHidden(i,n,!!this.checked)}});return{hide:r,toggle:s,get isHidden(){return!s.checked}}}var rgt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Wae=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},C_=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};let W$=class extends _e{constructor(e,t){super(),this.layoutService=e,this.logService=t,this.mapTextToType=new Map,this.findText="",this.resources=[],(ap||X_e)&&this.installWebKitWriteTextWorkaround()}installWebKitWriteTextWorkaround(){const e=()=>{const t=new n5;this.webKitPendingClipboardWritePromise&&!this.webKitPendingClipboardWritePromise.isSettled&&this.webKitPendingClipboardWritePromise.cancel(),this.webKitPendingClipboardWritePromise=t,navigator.clipboard.write([new ClipboardItem({"text/plain":t.p})]).catch(n=>C_(this,void 0,void 0,function*(){(!(n instanceof Error)||n.name!=="NotAllowedError"||!t.isRejected)&&this.logService.error(n)}))};this.layoutService.hasContainer&&(this._register(ke(this.layoutService.container,"click",e)),this._register(ke(this.layoutService.container,"keydown",e)))}writeText(e,t){return C_(this,void 0,void 0,function*(){if(t){this.mapTextToType.set(t,e);return}if(this.webKitPendingClipboardWritePromise)return this.webKitPendingClipboardWritePromise.complete(e);try{return yield navigator.clipboard.writeText(e)}catch(r){console.error(r)}const n=document.activeElement,o=document.body.appendChild(He("textarea",{"aria-hidden":!0}));o.style.height="1px",o.style.width="1px",o.style.position="absolute",o.value=e,o.focus(),o.select(),document.execCommand("copy"),n instanceof HTMLElement&&n.focus(),document.body.removeChild(o)})}readText(e){return C_(this,void 0,void 0,function*(){if(e)return this.mapTextToType.get(e)||"";try{return yield navigator.clipboard.readText()}catch(t){return console.error(t),""}})}readFindText(){return C_(this,void 0,void 0,function*(){return this.findText})}writeFindText(e){return C_(this,void 0,void 0,function*(){this.findText=e})}writeResources(e){return C_(this,void 0,void 0,function*(){this.resources=e})}readResources(){return C_(this,void 0,void 0,function*(){return this.resources})}};W$=rgt([Wae(0,SS),Wae(1,nc)],W$);const yp=yn("clipboardService");var sgt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},agt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const DE="data-keybinding-context";class VX{constructor(e,t){this._id=e,this._parent=t,this._value=Object.create(null),this._value._contextId=e}get value(){return Object.assign({},this._value)}setValue(e,t){return this._value[e]!==t?(this._value[e]=t,!0):!1}removeValue(e){return e in this._value?(delete this._value[e],!0):!1}getValue(e){const t=this._value[e];return typeof t=="undefined"&&this._parent?this._parent.getValue(e):t}}class Ow extends VX{constructor(){super(-1,null)}setValue(e,t){return!1}removeValue(e){return!1}getValue(e){}}Ow.INSTANCE=new Ow;class xk extends VX{constructor(e,t,n){super(e,null),this._configurationService=t,this._values=Ry.forConfigKeys(),this._listener=this._configurationService.onDidChangeConfiguration(o=>{if(o.source===7){const r=Array.from(this._values,([s])=>s);this._values.clear(),n.fire(new Hae(r))}else{const r=[];for(const s of o.affectedKeys){const a=`config.${s}`,l=this._values.findSuperstr(a);l!==void 0&&(r.push(...vn.map(l,([c])=>c)),this._values.deleteSuperstr(a)),this._values.has(a)&&(r.push(a),this._values.delete(a))}n.fire(new Hae(r))}})}dispose(){this._listener.dispose()}getValue(e){if(e.indexOf(xk._keyPrefix)!==0)return super.getValue(e);if(this._values.has(e))return this._values.get(e);const t=e.substr(xk._keyPrefix.length),n=this._configurationService.getValue(t);let o;switch(typeof n){case"number":case"boolean":case"string":o=n;break;default:Array.isArray(n)?o=JSON.stringify(n):o=n}return this._values.set(e,o),o}setValue(e,t){return super.setValue(e,t)}removeValue(e){return super.removeValue(e)}}xk._keyPrefix="config.";class lgt{constructor(e,t,n){this._service=e,this._key=t,this._defaultValue=n,this.reset()}set(e){this._service.setContext(this._key,e)}reset(){typeof this._defaultValue=="undefined"?this._service.removeContext(this._key):this._service.setContext(this._key,this._defaultValue)}get(){return this._service.getContextKeyValue(this._key)}}class Vae{constructor(e){this.key=e}affectsSome(e){return e.has(this.key)}allKeysContainedIn(e){return this.affectsSome(e)}}class Hae{constructor(e){this.keys=e}affectsSome(e){for(const t of this.keys)if(e.has(t))return!0;return!1}allKeysContainedIn(e){return this.keys.every(t=>e.has(t))}}class cgt{constructor(e){this.events=e}affectsSome(e){for(const t of this.events)if(t.affectsSome(e))return!0;return!1}allKeysContainedIn(e){return this.events.every(t=>t.allKeysContainedIn(e))}}function ugt(i,e){return i.allKeysContainedIn(new Set(Object.keys(e)))}class NCe extends _e{constructor(e){super(),this._onDidChangeContext=this._register(new G0({merge:t=>new cgt(t)})),this.onDidChangeContext=this._onDidChangeContext.event,this._isDisposed=!1,this._myContextId=e}createKey(e,t){if(this._isDisposed)throw new Error("AbstractContextKeyService has been disposed");return new lgt(this,e,t)}bufferChangeEvents(e){this._onDidChangeContext.pause();try{e()}finally{this._onDidChangeContext.resume()}}createScoped(e){if(this._isDisposed)throw new Error("AbstractContextKeyService has been disposed");return new dgt(this,e)}contextMatchesRules(e){if(this._isDisposed)throw new Error("AbstractContextKeyService has been disposed");const t=this.getContextValuesContainer(this._myContextId);return e?e.evaluate(t):!0}getContextKeyValue(e){if(!this._isDisposed)return this.getContextValuesContainer(this._myContextId).getValue(e)}setContext(e,t){if(this._isDisposed)return;const n=this.getContextValuesContainer(this._myContextId);!n||n.setValue(e,t)&&this._onDidChangeContext.fire(new Vae(e))}removeContext(e){this._isDisposed||this.getContextValuesContainer(this._myContextId).removeValue(e)&&this._onDidChangeContext.fire(new Vae(e))}getContext(e){return this._isDisposed?Ow.INSTANCE:this.getContextValuesContainer(hgt(e))}dispose(){super.dispose(),this._isDisposed=!0}}let V$=class extends NCe{constructor(e){super(0),this._contexts=new Map,this._lastContextId=0;const t=this._register(new xk(this._myContextId,e,this._onDidChangeContext));this._contexts.set(this._myContextId,t)}getContextValuesContainer(e){return this._isDisposed?Ow.INSTANCE:this._contexts.get(e)||Ow.INSTANCE}createChildContext(e=this._myContextId){if(this._isDisposed)throw new Error("ContextKeyService has been disposed");const t=++this._lastContextId;return this._contexts.set(t,new VX(t,this.getContextValuesContainer(e))),t}disposeContext(e){this._isDisposed||this._contexts.delete(e)}};V$=sgt([agt(0,En)],V$);class dgt extends NCe{constructor(e,t){if(super(e.createChildContext()),this._parentChangeListener=this._register(new Kr),this._parent=e,this._updateParentChangeListener(),this._domNode=t,this._domNode.hasAttribute(DE)){let n="";this._domNode.classList&&(n=Array.from(this._domNode.classList.values()).join(", ")),console.error(`Element already has context attribute${n?": "+n:""}`)}this._domNode.setAttribute(DE,String(this._myContextId))}_updateParentChangeListener(){this._parentChangeListener.value=this._parent.onDidChangeContext(e=>{const n=this._parent.getContextValuesContainer(this._myContextId).value;ugt(e,n)||this._onDidChangeContext.fire(e)})}dispose(){this._isDisposed||(this._parent.disposeContext(this._myContextId),this._domNode.removeAttribute(DE),super.dispose())}getContextValuesContainer(e){return this._isDisposed?Ow.INSTANCE:this._parent.getContextValuesContainer(e)}createChildContext(e=this._myContextId){if(this._isDisposed)throw new Error("ScopedContextKeyService has been disposed");return this._parent.createChildContext(e)}disposeContext(e){this._isDisposed||this._parent.disposeContext(e)}}function hgt(i){for(;i;){if(i.hasAttribute(DE)){const e=i.getAttribute(DE);return e?parseInt(e,10):NaN}i=i.parentElement}return 0}function fgt(i,e,t){i.get(Ut).createKey(String(e),ggt(t))}function ggt(i){return f_e(i,e=>{if(typeof e=="object"&&e.$mid===1)return Rt.revive(e).toString();if(e instanceof Rt)return e.toString()})}Rn.registerCommand("_setContext",fgt);Rn.registerCommand({id:"getContextKeyInfo",handler(){return[...lt.all()].sort((i,e)=>i.key.localeCompare(e.key))},description:{description:C("getContextKeyInfo","A command that returns information about context keys"),args:[]}});Rn.registerCommand("_generateContextKeyInfo",function(){const i=[],e=new Set;for(const t of lt.all())e.has(t.key)||(e.add(t.key),i.push(t));i.sort((t,n)=>t.key.localeCompare(n.key)),console.log(JSON.stringify(i,void 0,2))});class pgt{constructor(e,t){this.key=e,this.data=t,this.incoming=new Map,this.outgoing=new Map}}class $ae{constructor(e){this._hashFn=e,this._nodes=new Map}roots(){const e=[];for(const t of this._nodes.values())t.outgoing.size===0&&e.push(t);return e}insertEdge(e,t){const n=this.lookupOrInsertNode(e),o=this.lookupOrInsertNode(t);n.outgoing.set(o.key,o),o.incoming.set(n.key,n)}removeNode(e){const t=this._hashFn(e);this._nodes.delete(t);for(const n of this._nodes.values())n.outgoing.delete(t),n.incoming.delete(t)}lookupOrInsertNode(e){const t=this._hashFn(e);let n=this._nodes.get(t);return n||(n=new pgt(t,e),this._nodes.set(t,n)),n}isEmpty(){return this._nodes.size===0}toString(){const e=[];for(const[t,n]of this._nodes)e.push(`${t} (-> incoming)[${[...n.incoming.keys()].join(", ")}] (outgoing ->)[${[...n.outgoing.keys()].join(",")}] `);return e.join(` -`)}findCycleSlow(){for(const[e,t]of this._nodes){const n=new Set([e]),o=this._findCycle(t,n);if(o)return o}}_findCycle(e,t){for(const[n,o]of e.outgoing){if(t.has(n))return[...t,n].join(" -> ");t.add(n);const r=this._findCycle(o,t);if(r)return r;t.delete(n)}}}const ugt=!1;class Pae extends Error{constructor(e){var t;super("cyclic dependency between services"),this.message=(t=e.findCycleSlow())!==null&&t!==void 0?t:`UNABLE to detect cycle, dumping graph: -${e.toString()}`}}class GP{constructor(e=new x5,t=!1,n,o=ugt){var r;this._services=e,this._strict=t,this._parent=n,this._enableTracing=o,this._activeInstantiations=new Set,this._services.set($t,this),this._globalGraph=o?(r=n==null?void 0:n._globalGraph)!==null&&r!==void 0?r:new Aae(s=>s):void 0}createChild(e){return new GP(e,this._strict,this,this._enableTracing)}invokeFunction(e,...t){const n=ka.traceInvocation(this._enableTracing,e);let o=!1;try{return e({get:s=>{if(o)throw Nq("service accessor is only valid during the invocation of its target method");const a=this._getOrCreateServiceInstance(s,n);if(!a)throw new Error(`[invokeFunction] unknown service '${s}'`);return a}},...t)}finally{o=!0,n.stop()}}createInstance(e,...t){let n,o;return e instanceof Dh?(n=ka.traceCreation(this._enableTracing,e.ctor),o=this._createInstance(e.ctor,e.staticArguments.concat(t),n)):(n=ka.traceCreation(this._enableTracing,e),o=this._createInstance(e,t,n)),n.stop(),o}_createInstance(e,t=[],n){const o=Td.getServiceDependencies(e).sort((a,l)=>a.index-l.index),r=[];for(const a of o){const l=this._getOrCreateServiceInstance(a.id,n);l||this._throwIfStrict(`[createInstance] ${e.name} depends on UNKNOWN service ${a.id}.`,!1),r.push(l)}const s=o.length>0?o[0].index:t.length;if(t.length!==s){console.trace(`[createInstance] First service dependency of ${e.name} at position ${s+1} conflicts with ${t.length} static arguments`);const a=s-t.length;a>0?t=t.concat(new Array(a)):t=t.slice(0,s)}return Reflect.construct(e,t.concat(r))}_setServiceInstance(e,t){if(this._services.get(e)instanceof Dh)this._services.set(e,t);else if(this._parent)this._parent._setServiceInstance(e,t);else throw new Error("illegalState - setting UNKNOWN service instance")}_getServiceInstanceOrDescriptor(e){const t=this._services.get(e);return!t&&this._parent?this._parent._getServiceInstanceOrDescriptor(e):t}_getOrCreateServiceInstance(e,t){this._globalGraph&&this._globalGraphImplicitDependency&&this._globalGraph.insertEdge(this._globalGraphImplicitDependency,String(e));const n=this._getServiceInstanceOrDescriptor(e);return n instanceof Dh?this._safeCreateAndCacheServiceInstance(e,n,t.branch(e,!0)):(t.branch(e,!1),n)}_safeCreateAndCacheServiceInstance(e,t,n){if(this._activeInstantiations.has(e))throw new Error(`illegal state - RECURSIVELY instantiating service '${e}'`);this._activeInstantiations.add(e);try{return this._createAndCacheServiceInstance(e,t,n)}finally{this._activeInstantiations.delete(e)}}_createAndCacheServiceInstance(e,t,n){var o;const r=new Aae(l=>l.id.toString());let s=0;const a=[{id:e,desc:t,_trace:n}];for(;a.length;){const l=a.pop();if(r.lookupOrInsertNode(l),s++>1e3)throw new Pae(r);for(const c of Td.getServiceDependencies(l.desc.ctor)){const u=this._getServiceInstanceOrDescriptor(c.id);if(u||this._throwIfStrict(`[createInstance] ${e} depends on ${c.id} which is NOT registered.`,!0),(o=this._globalGraph)===null||o===void 0||o.insertEdge(String(l.id),String(c.id)),u instanceof Dh){const d={id:c.id,desc:u,_trace:l._trace.branch(c.id,!0)};r.insertEdge(l,d),a.push(d)}}}for(;;){const l=r.roots();if(l.length===0){if(!r.isEmpty())throw new Pae(r);break}for(const{data:c}of l){if(this._getServiceInstanceOrDescriptor(c.id)instanceof Dh){const d=this._createServiceInstanceWithOwner(c.id,c.desc.ctor,c.desc.staticArguments,c.desc.supportsDelayedInstantiation,c._trace);this._setServiceInstance(c.id,d)}r.removeNode(c)}}return this._getServiceInstanceOrDescriptor(e)}_createServiceInstanceWithOwner(e,t,n=[],o,r){if(this._services.get(e)instanceof Dh)return this._createServiceInstance(e,t,n,o,r);if(this._parent)return this._parent._createServiceInstanceWithOwner(e,t,n,o,r);throw new Error(`illegalState - creating UNKNOWN service instance ${t.name}`)}_createServiceInstance(e,t,n=[],o,r){if(o){const s=new GP(void 0,this._strict,this,this._enableTracing);s._globalGraphImplicitDependency=String(e);const a=new Map,l=new JR(()=>{const c=s._createInstance(t,n,r);for(const[u,d]of a){const h=c[u];if(typeof h=="function")for(const f of d)h.apply(c,f)}return a.clear(),c});return new Proxy(Object.create(null),{get(c,u){if(!l.isInitialized&&typeof u=="string"&&(u.startsWith("onDid")||u.startsWith("onWill"))){let f=a.get(u);return f||(f=new ia,a.set(u,f)),(p,v,m)=>{const _=f.push([p,v,m]);return zt(_)}}if(u in c)return c[u];const d=l.value;let h=d[u];return typeof h!="function"||(h=h.bind(d),c[u]=h),h},set(c,u,d){return l.value[u]=d,!0},getPrototypeOf(c){return t.prototype}})}else return this._createInstance(t,n,r)}_throwIfStrict(e,t){if(t&&console.warn(e),this._strict)throw new Error(e)}}class ka{static traceInvocation(e,t){return e?new ka(2,t.name||new Error().stack.split(` +`)}findCycleSlow(){for(const[e,t]of this._nodes){const n=new Set([e]),o=this._findCycle(t,n);if(o)return o}}_findCycle(e,t){for(const[n,o]of e.outgoing){if(t.has(n))return[...t,n].join(" -> ");t.add(n);const r=this._findCycle(o,t);if(r)return r;t.delete(n)}}}const mgt=!1;class zae extends Error{constructor(e){var t;super("cyclic dependency between services"),this.message=(t=e.findCycleSlow())!==null&&t!==void 0?t:`UNABLE to detect cycle, dumping graph: +${e.toString()}`}}class ZP{constructor(e=new L5,t=!1,n,o=mgt){var r;this._services=e,this._strict=t,this._parent=n,this._enableTracing=o,this._activeInstantiations=new Set,this._services.set($t,this),this._globalGraph=o?(r=n==null?void 0:n._globalGraph)!==null&&r!==void 0?r:new $ae(s=>s):void 0}createChild(e){return new ZP(e,this._strict,this,this._enableTracing)}invokeFunction(e,...t){const n=Ia.traceInvocation(this._enableTracing,e);let o=!1;try{return e({get:s=>{if(o)throw Bq("service accessor is only valid during the invocation of its target method");const a=this._getOrCreateServiceInstance(s,n);if(!a)throw new Error(`[invokeFunction] unknown service '${s}'`);return a}},...t)}finally{o=!0,n.stop()}}createInstance(e,...t){let n,o;return e instanceof Ih?(n=Ia.traceCreation(this._enableTracing,e.ctor),o=this._createInstance(e.ctor,e.staticArguments.concat(t),n)):(n=Ia.traceCreation(this._enableTracing,e),o=this._createInstance(e,t,n)),n.stop(),o}_createInstance(e,t=[],n){const o=Td.getServiceDependencies(e).sort((a,l)=>a.index-l.index),r=[];for(const a of o){const l=this._getOrCreateServiceInstance(a.id,n);l||this._throwIfStrict(`[createInstance] ${e.name} depends on UNKNOWN service ${a.id}.`,!1),r.push(l)}const s=o.length>0?o[0].index:t.length;if(t.length!==s){console.trace(`[createInstance] First service dependency of ${e.name} at position ${s+1} conflicts with ${t.length} static arguments`);const a=s-t.length;a>0?t=t.concat(new Array(a)):t=t.slice(0,s)}return Reflect.construct(e,t.concat(r))}_setServiceInstance(e,t){if(this._services.get(e)instanceof Ih)this._services.set(e,t);else if(this._parent)this._parent._setServiceInstance(e,t);else throw new Error("illegalState - setting UNKNOWN service instance")}_getServiceInstanceOrDescriptor(e){const t=this._services.get(e);return!t&&this._parent?this._parent._getServiceInstanceOrDescriptor(e):t}_getOrCreateServiceInstance(e,t){this._globalGraph&&this._globalGraphImplicitDependency&&this._globalGraph.insertEdge(this._globalGraphImplicitDependency,String(e));const n=this._getServiceInstanceOrDescriptor(e);return n instanceof Ih?this._safeCreateAndCacheServiceInstance(e,n,t.branch(e,!0)):(t.branch(e,!1),n)}_safeCreateAndCacheServiceInstance(e,t,n){if(this._activeInstantiations.has(e))throw new Error(`illegal state - RECURSIVELY instantiating service '${e}'`);this._activeInstantiations.add(e);try{return this._createAndCacheServiceInstance(e,t,n)}finally{this._activeInstantiations.delete(e)}}_createAndCacheServiceInstance(e,t,n){var o;const r=new $ae(l=>l.id.toString());let s=0;const a=[{id:e,desc:t,_trace:n}];for(;a.length;){const l=a.pop();if(r.lookupOrInsertNode(l),s++>1e3)throw new zae(r);for(const c of Td.getServiceDependencies(l.desc.ctor)){const u=this._getServiceInstanceOrDescriptor(c.id);if(u||this._throwIfStrict(`[createInstance] ${e} depends on ${c.id} which is NOT registered.`,!0),(o=this._globalGraph)===null||o===void 0||o.insertEdge(String(l.id),String(c.id)),u instanceof Ih){const d={id:c.id,desc:u,_trace:l._trace.branch(c.id,!0)};r.insertEdge(l,d),a.push(d)}}}for(;;){const l=r.roots();if(l.length===0){if(!r.isEmpty())throw new zae(r);break}for(const{data:c}of l){if(this._getServiceInstanceOrDescriptor(c.id)instanceof Ih){const d=this._createServiceInstanceWithOwner(c.id,c.desc.ctor,c.desc.staticArguments,c.desc.supportsDelayedInstantiation,c._trace);this._setServiceInstance(c.id,d)}r.removeNode(c)}}return this._getServiceInstanceOrDescriptor(e)}_createServiceInstanceWithOwner(e,t,n=[],o,r){if(this._services.get(e)instanceof Ih)return this._createServiceInstance(e,t,n,o,r);if(this._parent)return this._parent._createServiceInstanceWithOwner(e,t,n,o,r);throw new Error(`illegalState - creating UNKNOWN service instance ${t.name}`)}_createServiceInstance(e,t,n=[],o,r){if(o){const s=new ZP(void 0,this._strict,this,this._enableTracing);s._globalGraphImplicitDependency=String(e);const a=new Map,l=new nM(()=>{const c=s._createInstance(t,n,r);for(const[u,d]of a){const h=c[u];if(typeof h=="function")for(const f of d)h.apply(c,f)}return a.clear(),c});return new Proxy(Object.create(null),{get(c,u){if(!l.isInitialized&&typeof u=="string"&&(u.startsWith("onDid")||u.startsWith("onWill"))){let f=a.get(u);return f||(f=new oa,a.set(u,f)),(p,v,m)=>{const _=f.push([p,v,m]);return zt(_)}}if(u in c)return c[u];const d=l.value;let h=d[u];return typeof h!="function"||(h=h.bind(d),c[u]=h),h},set(c,u,d){return l.value[u]=d,!0},getPrototypeOf(c){return t.prototype}})}else return this._createInstance(t,n,r)}_throwIfStrict(e,t){if(t&&console.warn(e),this._strict)throw new Error(e)}}class Ia{static traceInvocation(e,t){return e?new Ia(2,t.name||new Error().stack.split(` `).slice(3,4).join(` -`)):ka._None}static traceCreation(e,t){return e?new ka(1,t.name):ka._None}constructor(e,t){this.type=e,this.name=t,this._start=Date.now(),this._dep=[]}branch(e,t){const n=new ka(3,e.toString());return this._dep.push([e,t,n]),n}stop(){const e=Date.now()-this._start;ka._totals+=e;let t=!1;function n(r,s){const a=[],l=new Array(r+1).join(" ");for(const[c,u,d]of s._dep)if(u&&d){t=!0,a.push(`${l}CREATES -> ${c}`);const h=n(r+1,d);h&&a.push(h)}else a.push(`${l}uses -> ${c}`);return a.join(` -`)}const o=[`${this.type===1?"CREATE":"CALL"} ${this.name}`,`${n(1,this)}`,`DONE, took ${e.toFixed(2)}ms (grand total ${ka._totals.toFixed(2)}ms)`];(e>2||t)&&ka.all.add(o.join(` -`))}}ka.all=new Set;ka._None=new class extends ka{constructor(){super(0,null)}stop(){}branch(){return this}};ka._totals=0;const dgt=new Set([hn.inMemory,hn.vscodeSourceControl,hn.walkThrough,hn.walkThroughSnippet]);class hgt{constructor(){this._byResource=new vs,this._byOwner=new Map}set(e,t,n){let o=this._byResource.get(e);o||(o=new Map,this._byResource.set(e,o)),o.set(t,n);let r=this._byOwner.get(t);r||(r=new vs,this._byOwner.set(t,r)),r.set(e,n)}get(e,t){const n=this._byResource.get(e);return n==null?void 0:n.get(t)}delete(e,t){let n=!1,o=!1;const r=this._byResource.get(e);r&&(n=r.delete(t));const s=this._byOwner.get(t);if(s&&(o=s.delete(e)),n!==o)throw new Error("illegal state");return n&&o}values(e){var t,n,o,r;return typeof e=="string"?(n=(t=this._byOwner.get(e))===null||t===void 0?void 0:t.values())!==null&&n!==void 0?n:mn.empty():Rt.isUri(e)?(r=(o=this._byResource.get(e))===null||o===void 0?void 0:o.values())!==null&&r!==void 0?r:mn.empty():mn.map(mn.concat(...this._byOwner.values()),s=>s[1])}}class fgt{constructor(e){this.errors=0,this.infos=0,this.warnings=0,this.unknowns=0,this._data=new vs,this._service=e,this._subscription=e.onMarkerChanged(this._update,this)}dispose(){this._subscription.dispose()}_update(e){for(const t of e){const n=this._data.get(t);n&&this._substract(n);const o=this._resourceStats(t);this._add(o),this._data.set(t,o)}}_resourceStats(e){const t={errors:0,warnings:0,infos:0,unknowns:0};if(dgt.has(e.scheme))return t;for(const{severity:n}of this._service.read({resource:e}))n===ao.Error?t.errors+=1:n===ao.Warning?t.warnings+=1:n===ao.Info?t.infos+=1:t.unknowns+=1;return t}_substract(e){this.errors-=e.errors,this.warnings-=e.warnings,this.infos-=e.infos,this.unknowns-=e.unknowns}_add(e){this.errors+=e.errors,this.warnings+=e.warnings,this.infos+=e.infos,this.unknowns+=e.unknowns}}class em{constructor(){this._onMarkerChanged=new __e({delay:0,merge:em._merge}),this.onMarkerChanged=this._onMarkerChanged.event,this._data=new hgt,this._stats=new fgt(this)}dispose(){this._stats.dispose(),this._onMarkerChanged.dispose()}remove(e,t){for(const n of t||[])this.changeOne(e,n,[])}changeOne(e,t,n){if(Jve(n))this._data.delete(t,e)&&this._onMarkerChanged.fire([t]);else{const o=[];for(const r of n){const s=em._toMarker(e,t,r);s&&o.push(s)}this._data.set(t,e,o),this._onMarkerChanged.fire([t])}}static _toMarker(e,t,n){let{code:o,severity:r,message:s,source:a,startLineNumber:l,startColumn:c,endLineNumber:u,endColumn:d,relatedInformation:h,tags:f}=n;if(!!s)return l=l>0?l:1,c=c>0?c:1,u=u>=l?u:l,d=d>0?d:c,{resource:t,owner:e,code:o,severity:r,message:s,source:a,startLineNumber:l,startColumn:c,endLineNumber:u,endColumn:d,relatedInformation:h,tags:f}}changeAll(e,t){const n=[],o=this._data.values(e);if(o)for(const r of o){const s=mn.first(r);s&&(n.push(s.resource),this._data.delete(s.resource,e))}if(ws(t)){const r=new vs;for(const{resource:s,marker:a}of t){const l=em._toMarker(e,s,a);if(!l)continue;const c=r.get(s);c?c.push(l):(r.set(s,[l]),n.push(s))}for(const[s,a]of r)this._data.set(s,e,a)}n.length>0&&this._onMarkerChanged.fire(n)}read(e=Object.create(null)){let{owner:t,resource:n,severities:o,take:r}=e;if((!r||r<0)&&(r=-1),t&&n){const s=this._data.get(n,t);if(s){const a=[];for(const l of s)if(em._accept(l,o)){const c=a.push(l);if(r>0&&c===r)break}return a}else return[]}else if(!t&&!n){const s=[];for(const a of this._data.values())for(const l of a)if(em._accept(l,o)){const c=s.push(l);if(r>0&&c===r)return s}return s}else{const s=this._data.values(n!=null?n:t),a=[];for(const l of s)for(const c of l)if(em._accept(c,o)){const u=a.push(c);if(r>0&&u===r)return a}return a}}static _accept(e,t){return t===void 0||(t&e.severity)===e.severity}static _merge(e){const t=new vs;for(const n of e)for(const o of n)t.set(o,!0);return Array.from(t.keys())}}class ggt extends _e{constructor(){super(...arguments),this._configurationModel=new gs}get configurationModel(){return this._configurationModel}reload(){return this.resetConfigurationModel(),this.configurationModel}getConfigurationDefaultOverrides(){return{}}resetConfigurationModel(){this._configurationModel=new gs;const e=no.as(ah.Configuration).getConfigurationProperties();this.updateConfigurationModel(Object.keys(e),e)}updateConfigurationModel(e,t){const n=this.getConfigurationDefaultOverrides();for(const o of e){const r=n[o],s=t[o];r!==void 0?this._configurationModel.addValue(o,r):s?this._configurationModel.addValue(o,s.default):this._configurationModel.removeValue(o)}}}const lT=wn("audioCue");class fn{static register(e){return new fn(e.fileName)}constructor(e){this.fileName=e}}fn.error=fn.register({fileName:"error.mp3"});fn.warning=fn.register({fileName:"warning.mp3"});fn.foldedArea=fn.register({fileName:"foldedAreas.mp3"});fn.break=fn.register({fileName:"break.mp3"});fn.quickFixes=fn.register({fileName:"quickFixes.mp3"});fn.taskCompleted=fn.register({fileName:"taskCompleted.mp3"});fn.taskFailed=fn.register({fileName:"taskFailed.mp3"});fn.terminalBell=fn.register({fileName:"terminalBell.mp3"});fn.diffLineInserted=fn.register({fileName:"diffLineInserted.mp3"});fn.diffLineDeleted=fn.register({fileName:"diffLineDeleted.mp3"});fn.diffLineModified=fn.register({fileName:"diffLineModified.mp3"});fn.chatRequestSent=fn.register({fileName:"chatRequestSent.mp3"});fn.chatResponsePending=fn.register({fileName:"chatResponsePending.mp3"});fn.chatResponseReceived1=fn.register({fileName:"chatResponseReceived1.mp3"});fn.chatResponseReceived2=fn.register({fileName:"chatResponseReceived2.mp3"});fn.chatResponseReceived3=fn.register({fileName:"chatResponseReceived3.mp3"});fn.chatResponseReceived4=fn.register({fileName:"chatResponseReceived4.mp3"});class pgt{constructor(e){this.randomOneOf=e}}class Wn{static register(e){const t=new pgt("randomOneOf"in e.sound?e.sound.randomOneOf:[e.sound]),n=new Wn(t,e.name,e.settingsKey);return Wn._audioCues.add(n),n}constructor(e,t,n){this.sound=e,this.name=t,this.settingsKey=n}}Wn._audioCues=new Set;Wn.error=Wn.register({name:C("audioCues.lineHasError.name","Error on Line"),sound:fn.error,settingsKey:"audioCues.lineHasError"});Wn.warning=Wn.register({name:C("audioCues.lineHasWarning.name","Warning on Line"),sound:fn.warning,settingsKey:"audioCues.lineHasWarning"});Wn.foldedArea=Wn.register({name:C("audioCues.lineHasFoldedArea.name","Folded Area on Line"),sound:fn.foldedArea,settingsKey:"audioCues.lineHasFoldedArea"});Wn.break=Wn.register({name:C("audioCues.lineHasBreakpoint.name","Breakpoint on Line"),sound:fn.break,settingsKey:"audioCues.lineHasBreakpoint"});Wn.inlineSuggestion=Wn.register({name:C("audioCues.lineHasInlineSuggestion.name","Inline Suggestion on Line"),sound:fn.quickFixes,settingsKey:"audioCues.lineHasInlineSuggestion"});Wn.terminalQuickFix=Wn.register({name:C("audioCues.terminalQuickFix.name","Terminal Quick Fix"),sound:fn.quickFixes,settingsKey:"audioCues.terminalQuickFix"});Wn.onDebugBreak=Wn.register({name:C("audioCues.onDebugBreak.name","Debugger Stopped on Breakpoint"),sound:fn.break,settingsKey:"audioCues.onDebugBreak"});Wn.noInlayHints=Wn.register({name:C("audioCues.noInlayHints","No Inlay Hints on Line"),sound:fn.error,settingsKey:"audioCues.noInlayHints"});Wn.taskCompleted=Wn.register({name:C("audioCues.taskCompleted","Task Completed"),sound:fn.taskCompleted,settingsKey:"audioCues.taskCompleted"});Wn.taskFailed=Wn.register({name:C("audioCues.taskFailed","Task Failed"),sound:fn.taskFailed,settingsKey:"audioCues.taskFailed"});Wn.terminalCommandFailed=Wn.register({name:C("audioCues.terminalCommandFailed","Terminal Command Failed"),sound:fn.error,settingsKey:"audioCues.terminalCommandFailed"});Wn.terminalBell=Wn.register({name:C("audioCues.terminalBell","Terminal Bell"),sound:fn.terminalBell,settingsKey:"audioCues.terminalBell"});Wn.notebookCellCompleted=Wn.register({name:C("audioCues.notebookCellCompleted","Notebook Cell Completed"),sound:fn.taskCompleted,settingsKey:"audioCues.notebookCellCompleted"});Wn.notebookCellFailed=Wn.register({name:C("audioCues.notebookCellFailed","Notebook Cell Failed"),sound:fn.taskFailed,settingsKey:"audioCues.notebookCellFailed"});Wn.diffLineInserted=Wn.register({name:C("audioCues.diffLineInserted","Diff Line Inserted"),sound:fn.diffLineInserted,settingsKey:"audioCues.diffLineInserted"});Wn.diffLineDeleted=Wn.register({name:C("audioCues.diffLineDeleted","Diff Line Deleted"),sound:fn.diffLineDeleted,settingsKey:"audioCues.diffLineDeleted"});Wn.diffLineModified=Wn.register({name:C("audioCues.diffLineModified","Diff Line Modified"),sound:fn.diffLineModified,settingsKey:"audioCues.diffLineModified"});Wn.chatRequestSent=Wn.register({name:C("audioCues.chatRequestSent","Chat Request Sent"),sound:fn.chatRequestSent,settingsKey:"audioCues.chatRequestSent"});Wn.chatResponseReceived=Wn.register({name:C("audioCues.chatResponseReceived","Chat Response Received"),settingsKey:"audioCues.chatResponseReceived",sound:{randomOneOf:[fn.chatResponseReceived1,fn.chatResponseReceived2,fn.chatResponseReceived3,fn.chatResponseReceived4]}});Wn.chatResponsePending=Wn.register({name:C("audioCues.chatResponsePending","Chat Response Pending"),sound:fn.chatResponsePending,settingsKey:"audioCues.chatResponsePending"});class mgt extends _e{constructor(e,t=[]){super(),this.logger=new XZe([e,...t]),this._register(e.onDidChangeLogLevel(n=>this.setLevel(n)))}get onDidChangeLogLevel(){return this.logger.onDidChangeLogLevel}setLevel(e){this.logger.setLevel(e)}getLevel(){return this.logger.getLevel()}trace(e,...t){this.logger.trace(e,...t)}debug(e,...t){this.logger.debug(e,...t)}info(e,...t){this.logger.info(e,...t)}warn(e,...t){this.logger.warn(e,...t)}error(e,...t){this.logger.error(e,...t)}}const xCe=[];function q5(i){xCe.push(i)}function vgt(){return xCe.slice(0)}var e_=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Vr=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},Fw=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};class _gt{constructor(e){this.disposed=!1,this.model=e,this._onWillDispose=new le}get textEditorModel(){return this.model}dispose(){this.disposed=!0,this._onWillDispose.fire()}}let F$=class{constructor(e){this.modelService=e}createModelReference(e){const t=this.modelService.getModel(e);return t?Promise.resolve(new CYe(new _gt(t))):Promise.reject(new Error("Model not found"))}};F$=e_([Vr(0,Yi)],F$);class G5{show(){return G5.NULL_PROGRESS_RUNNER}showWhile(e,t){return Fw(this,void 0,void 0,function*(){yield e})}}G5.NULL_PROGRESS_RUNNER={done:()=>{},total:()=>{},worked:()=>{}};class bgt{withProgress(e,t,n){return t({report:()=>{}})}}class Cgt{constructor(){this.isExtensionDevelopment=!1,this.isBuilt=!1}}class wgt{confirm(e){return Fw(this,void 0,void 0,function*(){return{confirmed:this.doConfirm(e.message,e.detail),checkboxChecked:!1}})}doConfirm(e,t){let n=e;return t&&(n=n+` +`)):Ia._None}static traceCreation(e,t){return e?new Ia(1,t.name):Ia._None}constructor(e,t){this.type=e,this.name=t,this._start=Date.now(),this._dep=[]}branch(e,t){const n=new Ia(3,e.toString());return this._dep.push([e,t,n]),n}stop(){const e=Date.now()-this._start;Ia._totals+=e;let t=!1;function n(r,s){const a=[],l=new Array(r+1).join(" ");for(const[c,u,d]of s._dep)if(u&&d){t=!0,a.push(`${l}CREATES -> ${c}`);const h=n(r+1,d);h&&a.push(h)}else a.push(`${l}uses -> ${c}`);return a.join(` +`)}const o=[`${this.type===1?"CREATE":"CALL"} ${this.name}`,`${n(1,this)}`,`DONE, took ${e.toFixed(2)}ms (grand total ${Ia._totals.toFixed(2)}ms)`];(e>2||t)&&Ia.all.add(o.join(` +`))}}Ia.all=new Set;Ia._None=new class extends Ia{constructor(){super(0,null)}stop(){}branch(){return this}};Ia._totals=0;const vgt=new Set([hn.inMemory,hn.vscodeSourceControl,hn.walkThrough,hn.walkThroughSnippet]);class _gt{constructor(){this._byResource=new _s,this._byOwner=new Map}set(e,t,n){let o=this._byResource.get(e);o||(o=new Map,this._byResource.set(e,o)),o.set(t,n);let r=this._byOwner.get(t);r||(r=new _s,this._byOwner.set(t,r)),r.set(e,n)}get(e,t){const n=this._byResource.get(e);return n==null?void 0:n.get(t)}delete(e,t){let n=!1,o=!1;const r=this._byResource.get(e);r&&(n=r.delete(t));const s=this._byOwner.get(t);if(s&&(o=s.delete(e)),n!==o)throw new Error("illegal state");return n&&o}values(e){var t,n,o,r;return typeof e=="string"?(n=(t=this._byOwner.get(e))===null||t===void 0?void 0:t.values())!==null&&n!==void 0?n:vn.empty():Rt.isUri(e)?(r=(o=this._byResource.get(e))===null||o===void 0?void 0:o.values())!==null&&r!==void 0?r:vn.empty():vn.map(vn.concat(...this._byOwner.values()),s=>s[1])}}class bgt{constructor(e){this.errors=0,this.infos=0,this.warnings=0,this.unknowns=0,this._data=new _s,this._service=e,this._subscription=e.onMarkerChanged(this._update,this)}dispose(){this._subscription.dispose()}_update(e){for(const t of e){const n=this._data.get(t);n&&this._substract(n);const o=this._resourceStats(t);this._add(o),this._data.set(t,o)}}_resourceStats(e){const t={errors:0,warnings:0,infos:0,unknowns:0};if(vgt.has(e.scheme))return t;for(const{severity:n}of this._service.read({resource:e}))n===ao.Error?t.errors+=1:n===ao.Warning?t.warnings+=1:n===ao.Info?t.infos+=1:t.unknowns+=1;return t}_substract(e){this.errors-=e.errors,this.warnings-=e.warnings,this.infos-=e.infos,this.unknowns-=e.unknowns}_add(e){this.errors+=e.errors,this.warnings+=e.warnings,this.infos+=e.infos,this.unknowns+=e.unknowns}}class tm{constructor(){this._onMarkerChanged=new E_e({delay:0,merge:tm._merge}),this.onMarkerChanged=this._onMarkerChanged.event,this._data=new _gt,this._stats=new bgt(this)}dispose(){this._stats.dispose(),this._onMarkerChanged.dispose()}remove(e,t){for(const n of t||[])this.changeOne(e,n,[])}changeOne(e,t,n){if(a_e(n))this._data.delete(t,e)&&this._onMarkerChanged.fire([t]);else{const o=[];for(const r of n){const s=tm._toMarker(e,t,r);s&&o.push(s)}this._data.set(t,e,o),this._onMarkerChanged.fire([t])}}static _toMarker(e,t,n){let{code:o,severity:r,message:s,source:a,startLineNumber:l,startColumn:c,endLineNumber:u,endColumn:d,relatedInformation:h,tags:f}=n;if(!!s)return l=l>0?l:1,c=c>0?c:1,u=u>=l?u:l,d=d>0?d:c,{resource:t,owner:e,code:o,severity:r,message:s,source:a,startLineNumber:l,startColumn:c,endLineNumber:u,endColumn:d,relatedInformation:h,tags:f}}changeAll(e,t){const n=[],o=this._data.values(e);if(o)for(const r of o){const s=vn.first(r);s&&(n.push(s.resource),this._data.delete(s.resource,e))}if(ws(t)){const r=new _s;for(const{resource:s,marker:a}of t){const l=tm._toMarker(e,s,a);if(!l)continue;const c=r.get(s);c?c.push(l):(r.set(s,[l]),n.push(s))}for(const[s,a]of r)this._data.set(s,e,a)}n.length>0&&this._onMarkerChanged.fire(n)}read(e=Object.create(null)){let{owner:t,resource:n,severities:o,take:r}=e;if((!r||r<0)&&(r=-1),t&&n){const s=this._data.get(n,t);if(s){const a=[];for(const l of s)if(tm._accept(l,o)){const c=a.push(l);if(r>0&&c===r)break}return a}else return[]}else if(!t&&!n){const s=[];for(const a of this._data.values())for(const l of a)if(tm._accept(l,o)){const c=s.push(l);if(r>0&&c===r)return s}return s}else{const s=this._data.values(n!=null?n:t),a=[];for(const l of s)for(const c of l)if(tm._accept(c,o)){const u=a.push(c);if(r>0&&u===r)return a}return a}}static _accept(e,t){return t===void 0||(t&e.severity)===e.severity}static _merge(e){const t=new _s;for(const n of e)for(const o of n)t.set(o,!0);return Array.from(t.keys())}}class Cgt extends _e{constructor(){super(...arguments),this._configurationModel=new ps}get configurationModel(){return this._configurationModel}reload(){return this.resetConfigurationModel(),this.configurationModel}getConfigurationDefaultOverrides(){return{}}resetConfigurationModel(){this._configurationModel=new ps;const e=no.as(ch.Configuration).getConfigurationProperties();this.updateConfigurationModel(Object.keys(e),e)}updateConfigurationModel(e,t){const n=this.getConfigurationDefaultOverrides();for(const o of e){const r=n[o],s=t[o];r!==void 0?this._configurationModel.addValue(o,r):s?this._configurationModel.addValue(o,s.default):this._configurationModel.removeValue(o)}}}const uT=yn("audioCue");class gn{static register(e){return new gn(e.fileName)}constructor(e){this.fileName=e}}gn.error=gn.register({fileName:"error.mp3"});gn.warning=gn.register({fileName:"warning.mp3"});gn.foldedArea=gn.register({fileName:"foldedAreas.mp3"});gn.break=gn.register({fileName:"break.mp3"});gn.quickFixes=gn.register({fileName:"quickFixes.mp3"});gn.taskCompleted=gn.register({fileName:"taskCompleted.mp3"});gn.taskFailed=gn.register({fileName:"taskFailed.mp3"});gn.terminalBell=gn.register({fileName:"terminalBell.mp3"});gn.diffLineInserted=gn.register({fileName:"diffLineInserted.mp3"});gn.diffLineDeleted=gn.register({fileName:"diffLineDeleted.mp3"});gn.diffLineModified=gn.register({fileName:"diffLineModified.mp3"});gn.chatRequestSent=gn.register({fileName:"chatRequestSent.mp3"});gn.chatResponsePending=gn.register({fileName:"chatResponsePending.mp3"});gn.chatResponseReceived1=gn.register({fileName:"chatResponseReceived1.mp3"});gn.chatResponseReceived2=gn.register({fileName:"chatResponseReceived2.mp3"});gn.chatResponseReceived3=gn.register({fileName:"chatResponseReceived3.mp3"});gn.chatResponseReceived4=gn.register({fileName:"chatResponseReceived4.mp3"});class ygt{constructor(e){this.randomOneOf=e}}class Wn{static register(e){const t=new ygt("randomOneOf"in e.sound?e.sound.randomOneOf:[e.sound]),n=new Wn(t,e.name,e.settingsKey);return Wn._audioCues.add(n),n}constructor(e,t,n){this.sound=e,this.name=t,this.settingsKey=n}}Wn._audioCues=new Set;Wn.error=Wn.register({name:C("audioCues.lineHasError.name","Error on Line"),sound:gn.error,settingsKey:"audioCues.lineHasError"});Wn.warning=Wn.register({name:C("audioCues.lineHasWarning.name","Warning on Line"),sound:gn.warning,settingsKey:"audioCues.lineHasWarning"});Wn.foldedArea=Wn.register({name:C("audioCues.lineHasFoldedArea.name","Folded Area on Line"),sound:gn.foldedArea,settingsKey:"audioCues.lineHasFoldedArea"});Wn.break=Wn.register({name:C("audioCues.lineHasBreakpoint.name","Breakpoint on Line"),sound:gn.break,settingsKey:"audioCues.lineHasBreakpoint"});Wn.inlineSuggestion=Wn.register({name:C("audioCues.lineHasInlineSuggestion.name","Inline Suggestion on Line"),sound:gn.quickFixes,settingsKey:"audioCues.lineHasInlineSuggestion"});Wn.terminalQuickFix=Wn.register({name:C("audioCues.terminalQuickFix.name","Terminal Quick Fix"),sound:gn.quickFixes,settingsKey:"audioCues.terminalQuickFix"});Wn.onDebugBreak=Wn.register({name:C("audioCues.onDebugBreak.name","Debugger Stopped on Breakpoint"),sound:gn.break,settingsKey:"audioCues.onDebugBreak"});Wn.noInlayHints=Wn.register({name:C("audioCues.noInlayHints","No Inlay Hints on Line"),sound:gn.error,settingsKey:"audioCues.noInlayHints"});Wn.taskCompleted=Wn.register({name:C("audioCues.taskCompleted","Task Completed"),sound:gn.taskCompleted,settingsKey:"audioCues.taskCompleted"});Wn.taskFailed=Wn.register({name:C("audioCues.taskFailed","Task Failed"),sound:gn.taskFailed,settingsKey:"audioCues.taskFailed"});Wn.terminalCommandFailed=Wn.register({name:C("audioCues.terminalCommandFailed","Terminal Command Failed"),sound:gn.error,settingsKey:"audioCues.terminalCommandFailed"});Wn.terminalBell=Wn.register({name:C("audioCues.terminalBell","Terminal Bell"),sound:gn.terminalBell,settingsKey:"audioCues.terminalBell"});Wn.notebookCellCompleted=Wn.register({name:C("audioCues.notebookCellCompleted","Notebook Cell Completed"),sound:gn.taskCompleted,settingsKey:"audioCues.notebookCellCompleted"});Wn.notebookCellFailed=Wn.register({name:C("audioCues.notebookCellFailed","Notebook Cell Failed"),sound:gn.taskFailed,settingsKey:"audioCues.notebookCellFailed"});Wn.diffLineInserted=Wn.register({name:C("audioCues.diffLineInserted","Diff Line Inserted"),sound:gn.diffLineInserted,settingsKey:"audioCues.diffLineInserted"});Wn.diffLineDeleted=Wn.register({name:C("audioCues.diffLineDeleted","Diff Line Deleted"),sound:gn.diffLineDeleted,settingsKey:"audioCues.diffLineDeleted"});Wn.diffLineModified=Wn.register({name:C("audioCues.diffLineModified","Diff Line Modified"),sound:gn.diffLineModified,settingsKey:"audioCues.diffLineModified"});Wn.chatRequestSent=Wn.register({name:C("audioCues.chatRequestSent","Chat Request Sent"),sound:gn.chatRequestSent,settingsKey:"audioCues.chatRequestSent"});Wn.chatResponseReceived=Wn.register({name:C("audioCues.chatResponseReceived","Chat Response Received"),settingsKey:"audioCues.chatResponseReceived",sound:{randomOneOf:[gn.chatResponseReceived1,gn.chatResponseReceived2,gn.chatResponseReceived3,gn.chatResponseReceived4]}});Wn.chatResponsePending=Wn.register({name:C("audioCues.chatResponsePending","Chat Response Pending"),sound:gn.chatResponsePending,settingsKey:"audioCues.chatResponsePending"});class wgt extends _e{constructor(e,t=[]){super(),this.logger=new tQe([e,...t]),this._register(e.onDidChangeLogLevel(n=>this.setLevel(n)))}get onDidChangeLogLevel(){return this.logger.onDidChangeLogLevel}setLevel(e){this.logger.setLevel(e)}getLevel(){return this.logger.getLevel()}trace(e,...t){this.logger.trace(e,...t)}debug(e,...t){this.logger.debug(e,...t)}info(e,...t){this.logger.info(e,...t)}warn(e,...t){this.logger.warn(e,...t)}error(e,...t){this.logger.error(e,...t)}}const RCe=[];function G5(i){RCe.push(i)}function Sgt(){return RCe.slice(0)}var e_=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Vr=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},Fy=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};class xgt{constructor(e){this.disposed=!1,this.model=e,this._onWillDispose=new le}get textEditorModel(){return this.model}dispose(){this.disposed=!0,this._onWillDispose.fire()}}let H$=class{constructor(e){this.modelService=e}createModelReference(e){const t=this.modelService.getModel(e);return t?Promise.resolve(new EYe(new xgt(t))):Promise.reject(new Error("Model not found"))}};H$=e_([Vr(0,Yi)],H$);class X5{show(){return X5.NULL_PROGRESS_RUNNER}showWhile(e,t){return Fy(this,void 0,void 0,function*(){yield e})}}X5.NULL_PROGRESS_RUNNER={done:()=>{},total:()=>{},worked:()=>{}};class Lgt{withProgress(e,t,n){return t({report:()=>{}})}}class Egt{constructor(){this.isExtensionDevelopment=!1,this.isBuilt=!1}}class Dgt{confirm(e){return Fy(this,void 0,void 0,function*(){return{confirmed:this.doConfirm(e.message,e.detail),checkboxChecked:!1}})}doConfirm(e,t){let n=e;return t&&(n=n+` -`+t),window.confirm(n)}prompt(e){var t,n;return Fw(this,void 0,void 0,function*(){let o;if(this.doConfirm(e.message,e.detail)){const s=[...(t=e.buttons)!==null&&t!==void 0?t:[]];e.cancelButton&&typeof e.cancelButton!="string"&&typeof e.cancelButton!="boolean"&&s.push(e.cancelButton),o=yield(n=s[0])===null||n===void 0?void 0:n.run({checkboxChecked:!1})}return{result:o}})}error(e,t){return Fw(this,void 0,void 0,function*(){yield this.prompt({type:So.Error,message:e,detail:t})})}}class Lk{info(e){return this.notify({severity:So.Info,message:e})}warn(e){return this.notify({severity:So.Warning,message:e})}error(e){return this.notify({severity:So.Error,message:e})}notify(e){switch(e.severity){case So.Error:console.error(e.message);break;case So.Warning:console.warn(e.message);break;default:console.log(e.message);break}return Lk.NO_OP}prompt(e,t,n,o){return Lk.NO_OP}status(e,t){return _e.None}}Lk.NO_OP=new Llt;let B$=class{constructor(e){this._onWillExecuteCommand=new le,this._onDidExecuteCommand=new le,this.onDidExecuteCommand=this._onDidExecuteCommand.event,this._instantiationService=e}executeCommand(e,...t){const n=Rn.getCommand(e);if(!n)return Promise.reject(new Error(`command '${e}' not found`));try{this._onWillExecuteCommand.fire({commandId:e,args:t});const o=this._instantiationService.invokeFunction.apply(this._instantiationService,[n.handler,...t]);return this._onDidExecuteCommand.fire({commandId:e,args:t}),Promise.resolve(o)}catch(o){return Promise.reject(o)}}};B$=e_([Vr(0,$t)],B$);let Oy=class extends Mct{constructor(e,t,n,o,r,s){super(e,t,n,o,r),this._cachedResolver=null,this._dynamicKeybindings=[],this._domNodeListeners=[];const a=f=>{const g=new Be;g.add(ke(f,et.KEY_DOWN,p=>{const v=new Pi(p);this._dispatch(v,v.target)&&(v.preventDefault(),v.stopPropagation())})),g.add(ke(f,et.KEY_UP,p=>{const v=new Pi(p);this._singleModifierDispatch(v,v.target)&&v.preventDefault()})),this._domNodeListeners.push(new ygt(f,g))},l=f=>{for(let g=0;g{f.getOption(61)||a(f.getContainerDomNode())},u=f=>{f.getOption(61)||l(f.getContainerDomNode())};this._register(s.onCodeEditorAdd(c)),this._register(s.onCodeEditorRemove(u)),s.listCodeEditors().forEach(c);const d=f=>{a(f.getContainerDomNode())},h=f=>{l(f.getContainerDomNode())};this._register(s.onDiffEditorAdd(d)),this._register(s.onDiffEditorRemove(h)),s.listDiffEditors().forEach(d)}addDynamicKeybinding(e,t,n,o){return Iu(Rn.registerCommand(e,n),this.addDynamicKeybindings([{keybinding:t,command:e,when:o}]))}addDynamicKeybindings(e){const t=e.map(n=>{var o;return{keybinding:HV(n.keybinding,Wl),command:(o=n.command)!==null&&o!==void 0?o:null,commandArgs:n.commandArgs,when:n.when,weight1:1e3,weight2:0,extensionId:null,isBuiltinExtension:!1}});return this._dynamicKeybindings=this._dynamicKeybindings.concat(t),this.updateResolver(),zt(()=>{for(let n=0;nthis._log(n))}return this._cachedResolver}_documentHasFocus(){return document.hasFocus()}_toNormalizedKeybindingItems(e,t){const n=[];let o=0;for(const r of e){const s=r.when||void 0,a=r.keybinding;if(!a)n[o++]=new Kse(void 0,r.command,r.commandArgs,s,t,null,!1);else{const l=dk.resolveKeybinding(a,Wl);for(const c of l)n[o++]=new Kse(c,r.command,r.commandArgs,s,t,null,!1)}}return n}resolveKeyboardEvent(e){const t=new ap(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,e.keyCode);return new dk([t],Wl)}};Oy=e_([Vr(0,Ut),Vr(1,_o),Vr(2,ec),Vr(3,Ao),Vr(4,tc),Vr(5,Jn)],Oy);class ygt extends _e{constructor(e,t){super(),this.domNode=e,this._register(t)}}function Oae(i){return i&&typeof i=="object"&&(!i.overrideIdentifier||typeof i.overrideIdentifier=="string")&&(!i.resource||i.resource instanceof Rt)}class LCe{constructor(){this._onDidChangeConfiguration=new le,this.onDidChangeConfiguration=this._onDidChangeConfiguration.event;const e=new ggt;this._configuration=new k5(e.reload(),new gs,new gs,new gs),e.dispose()}getValue(e,t){const n=typeof e=="string"?e:void 0,o=Oae(e)?e:Oae(t)?t:{};return this._configuration.getValue(n,o,void 0)}updateValues(e){const t={data:this._configuration.toData()},n=[];for(const o of e){const[r,s]=o;this.getValue(r)!==s&&(this._configuration.updateValue(r,s),n.push(r))}if(n.length>0){const o=new Ict({keys:n,overrides:[]},t,this._configuration);o.source=8,o.sourceConfig=null,this._onDidChangeConfiguration.fire(o)}return Promise.resolve()}updateValue(e,t,n,o){return this.updateValues([[e,t]])}inspect(e,t={}){return this._configuration.inspect(e,t,void 0)}}let W$=class{constructor(e,t,n){this.configurationService=e,this.modelService=t,this.languageService=n,this._onDidChangeConfiguration=new le,this.configurationService.onDidChangeConfiguration(o=>{this._onDidChangeConfiguration.fire({affectedKeys:o.affectedKeys,affectsConfiguration:(r,s)=>o.affectsConfiguration(s)})})}getValue(e,t,n){const o=ae.isIPosition(t)?t:null,r=o?typeof n=="string"?n:void 0:typeof t=="string"?t:void 0,s=e?this.getLanguage(e,o):void 0;return typeof r=="undefined"?this.configurationService.getValue({resource:e,overrideIdentifier:s}):this.configurationService.getValue(r,{resource:e,overrideIdentifier:s})}getLanguage(e,t){const n=this.modelService.getModel(e);return n?t?n.getLanguageIdAtPosition(t.lineNumber,t.column):n.getLanguageId():this.languageService.guessLanguageIdByFilepathOrFirstLine(e)}};W$=e_([Vr(0,En),Vr(1,Yi),Vr(2,Ki)],W$);let V$=class{constructor(e){this.configurationService=e}getEOL(e,t){const n=this.configurationService.getValue("files.eol",{overrideIdentifier:t,resource:e});return n&&typeof n=="string"&&n!=="auto"?n:Ss||Nn?` +`+t),window.confirm(n)}prompt(e){var t,n;return Fy(this,void 0,void 0,function*(){let o;if(this.doConfirm(e.message,e.detail)){const s=[...(t=e.buttons)!==null&&t!==void 0?t:[]];e.cancelButton&&typeof e.cancelButton!="string"&&typeof e.cancelButton!="boolean"&&s.push(e.cancelButton),o=yield(n=s[0])===null||n===void 0?void 0:n.run({checkboxChecked:!1})}return{result:o}})}error(e,t){return Fy(this,void 0,void 0,function*(){yield this.prompt({type:So.Error,message:e,detail:t})})}}class Lk{info(e){return this.notify({severity:So.Info,message:e})}warn(e){return this.notify({severity:So.Warning,message:e})}error(e){return this.notify({severity:So.Error,message:e})}notify(e){switch(e.severity){case So.Error:console.error(e.message);break;case So.Warning:console.warn(e.message);break;default:console.log(e.message);break}return Lk.NO_OP}prompt(e,t,n,o){return Lk.NO_OP}status(e,t){return _e.None}}Lk.NO_OP=new Nlt;let $$=class{constructor(e){this._onWillExecuteCommand=new le,this._onDidExecuteCommand=new le,this.onDidExecuteCommand=this._onDidExecuteCommand.event,this._instantiationService=e}executeCommand(e,...t){const n=Rn.getCommand(e);if(!n)return Promise.reject(new Error(`command '${e}' not found`));try{this._onWillExecuteCommand.fire({commandId:e,args:t});const o=this._instantiationService.invokeFunction.apply(this._instantiationService,[n.handler,...t]);return this._onDidExecuteCommand.fire({commandId:e,args:t}),Promise.resolve(o)}catch(o){return Promise.reject(o)}}};$$=e_([Vr(0,$t)],$$);let Fw=class extends Wct{constructor(e,t,n,o,r,s){super(e,t,n,o,r),this._cachedResolver=null,this._dynamicKeybindings=[],this._domNodeListeners=[];const a=f=>{const g=new Be;g.add(ke(f,et.KEY_DOWN,p=>{const v=new Pi(p);this._dispatch(v,v.target)&&(v.preventDefault(),v.stopPropagation())})),g.add(ke(f,et.KEY_UP,p=>{const v=new Pi(p);this._singleModifierDispatch(v,v.target)&&v.preventDefault()})),this._domNodeListeners.push(new kgt(f,g))},l=f=>{for(let g=0;g{f.getOption(61)||a(f.getContainerDomNode())},u=f=>{f.getOption(61)||l(f.getContainerDomNode())};this._register(s.onCodeEditorAdd(c)),this._register(s.onCodeEditorRemove(u)),s.listCodeEditors().forEach(c);const d=f=>{a(f.getContainerDomNode())},h=f=>{l(f.getContainerDomNode())};this._register(s.onDiffEditorAdd(d)),this._register(s.onDiffEditorRemove(h)),s.listDiffEditors().forEach(d)}addDynamicKeybinding(e,t,n,o){return Tu(Rn.registerCommand(e,n),this.addDynamicKeybindings([{keybinding:t,command:e,when:o}]))}addDynamicKeybindings(e){const t=e.map(n=>{var o;return{keybinding:jV(n.keybinding,Vl),command:(o=n.command)!==null&&o!==void 0?o:null,commandArgs:n.commandArgs,when:n.when,weight1:1e3,weight2:0,extensionId:null,isBuiltinExtension:!1}});return this._dynamicKeybindings=this._dynamicKeybindings.concat(t),this.updateResolver(),zt(()=>{for(let n=0;nthis._log(n))}return this._cachedResolver}_documentHasFocus(){return document.hasFocus()}_toNormalizedKeybindingItems(e,t){const n=[];let o=0;for(const r of e){const s=r.when||void 0,a=r.keybinding;if(!a)n[o++]=new eae(void 0,r.command,r.commandArgs,s,t,null,!1);else{const l=dk.resolveKeybinding(a,Vl);for(const c of l)n[o++]=new eae(c,r.command,r.commandArgs,s,t,null,!1)}}return n}resolveKeyboardEvent(e){const t=new lp(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,e.keyCode);return new dk([t],Vl)}};Fw=e_([Vr(0,Ut),Vr(1,_o),Vr(2,tc),Vr(3,Ao),Vr(4,nc),Vr(5,Jn)],Fw);class kgt extends _e{constructor(e,t){super(),this.domNode=e,this._register(t)}}function Uae(i){return i&&typeof i=="object"&&(!i.overrideIdentifier||typeof i.overrideIdentifier=="string")&&(!i.resource||i.resource instanceof Rt)}class MCe{constructor(){this._onDidChangeConfiguration=new le,this.onDidChangeConfiguration=this._onDidChangeConfiguration.event;const e=new Cgt;this._configuration=new I5(e.reload(),new ps,new ps,new ps),e.dispose()}getValue(e,t){const n=typeof e=="string"?e:void 0,o=Uae(e)?e:Uae(t)?t:{};return this._configuration.getValue(n,o,void 0)}updateValues(e){const t={data:this._configuration.toData()},n=[];for(const o of e){const[r,s]=o;this.getValue(r)!==s&&(this._configuration.updateValue(r,s),n.push(r))}if(n.length>0){const o=new Pct({keys:n,overrides:[]},t,this._configuration);o.source=8,o.sourceConfig=null,this._onDidChangeConfiguration.fire(o)}return Promise.resolve()}updateValue(e,t,n,o){return this.updateValues([[e,t]])}inspect(e,t={}){return this._configuration.inspect(e,t,void 0)}}let z$=class{constructor(e,t,n){this.configurationService=e,this.modelService=t,this.languageService=n,this._onDidChangeConfiguration=new le,this.configurationService.onDidChangeConfiguration(o=>{this._onDidChangeConfiguration.fire({affectedKeys:o.affectedKeys,affectsConfiguration:(r,s)=>o.affectsConfiguration(s)})})}getValue(e,t,n){const o=ae.isIPosition(t)?t:null,r=o?typeof n=="string"?n:void 0:typeof t=="string"?t:void 0,s=e?this.getLanguage(e,o):void 0;return typeof r=="undefined"?this.configurationService.getValue({resource:e,overrideIdentifier:s}):this.configurationService.getValue(r,{resource:e,overrideIdentifier:s})}getLanguage(e,t){const n=this.modelService.getModel(e);return n?t?n.getLanguageIdAtPosition(t.lineNumber,t.column):n.getLanguageId():this.languageService.guessLanguageIdByFilepathOrFirstLine(e)}};z$=e_([Vr(0,En),Vr(1,Yi),Vr(2,Ki)],z$);let U$=class{constructor(e){this.configurationService=e}getEOL(e,t){const n=this.configurationService.getValue("files.eol",{overrideIdentifier:t,resource:e});return n&&typeof n=="string"&&n!=="auto"?n:xs||Nn?` `:`\r -`}};V$=e_([Vr(0,En)],V$);class Sgt{publicLog2(){}}class Ek{constructor(){const e=Rt.from({scheme:Ek.SCHEME,authority:"model",path:"/"});this.workspace={id:m1e,folders:[new Gct({uri:e,name:"",index:0})]}}getWorkspace(){return this.workspace}getWorkspaceFolder(e){return e&&e.scheme===Ek.SCHEME?this.workspace.folders[0]:null}}Ek.SCHEME="inmemory";function XP(i,e,t){if(!e||!(i instanceof LCe))return;const n=[];Object.keys(e).forEach(o=>{xct(o)&&n.push([`editor.${o}`,e[o]]),t&&Lct(o)&&n.push([`diffEditor.${o}`,e[o]])}),n.length>0&&i.updateValues(n)}let H$=class{constructor(e){this._modelService=e}hasPreviewHandler(){return!1}apply(e,t){return Fw(this,void 0,void 0,function*(){const n=Array.isArray(e)?e:ZG.convert(e),o=new Map;for(const a of n){if(!(a instanceof Kg))throw new Error("bad edit - only text edits are supported");const l=this._modelService.getModel(a.resource);if(!l)throw new Error("bad edit - model not found");if(typeof a.versionId=="number"&&l.getVersionId()!==a.versionId)throw new Error("bad state - model changed in the meantime");let c=o.get(l);c||(c=[],o.set(l,c)),c.push(Gi.replaceMove(V.lift(a.textEdit.range),a.textEdit.text))}let r=0,s=0;for(const[a,l]of o)a.pushStackElement(),a.pushEditOperations([],l,()=>[]),a.pushStackElement(),s+=1,r+=l.length;return{ariaSummary:G0(jH.bulkEditServiceSummary,r,s),isApplied:r>0}})}};H$=e_([Vr(0,Yi)],H$);class xgt{getUriLabel(e,t){return e.scheme==="file"?e.fsPath:e.path}getUriBasenameLabel(e){return Hc(e)}}let $$=class extends KH{constructor(e,t){super(e),this._codeEditorService=t}showContextView(e,t,n){if(!t){const o=this._codeEditorService.getFocusedCodeEditor()||this._codeEditorService.getActiveCodeEditor();o&&(t=o.getContainerDomNode())}return super.showContextView(e,t,n)}};$$=e_([Vr(0,yS),Vr(1,Jn)],$$);class Lgt{constructor(){this._neverEmitter=new le,this.onDidChangeTrust=this._neverEmitter.event}isWorkspaceTrusted(){return!0}}class Egt extends gk{constructor(){super()}}class Dgt extends mgt{constructor(){super(new GZe)}}let z$=class extends u${constructor(e,t,n,o,r,s){super(e,t,n,o,r,s),this.configure({blockMouse:!1})}};z$=e_([Vr(0,ec),Vr(1,Ao),Vr(2,mp),Vr(3,xi),Vr(4,If),Vr(5,Ut)],z$);class kgt{playAudioCue(e,t){return Fw(this,void 0,void 0,function*(){})}}Mn(En,LCe,0);Mn(sG,W$,0);Mn(W0e,V$,0);Mn(nb,Ek,0);Mn(Iy,xgt,0);Mn(ec,Sgt,0);Mn(JI,wgt,0);Mn(GG,Cgt,0);Mn(Ao,Lk,0);Mn(Rf,em,0);Mn(Ki,Egt,0);Mn(nc,Yft,0);Mn(tc,Dgt,0);Mn(Yi,WP,0);Mn(hG,p$,0);Mn(Ut,O$,0);Mn(p1e,bgt,0);Mn(Jv,G5,0);Mn(qu,Odt,0);Mn(Gu,nH,0);Mn(eT,H$,0);Mn(v1e,Lgt,0);Mn($a,F$,0);Mn(pp,N$,0);Mn(Gc,Qht,0);Mn(_o,B$,0);Mn(xi,Oy,0);Mn(lh,I$,0);Mn(mp,$$,0);Mn(pl,g$,0);Mn(bp,P$,0);Mn(ju,z$,0);Mn(If,R$,0);Mn(lT,kgt,0);var Vt;(function(i){const e=new x5;for(const[l,c]of Roe())e.set(l,c);const t=new GP(e,!0);e.set($t,t);function n(l){o||s({});const c=e.get(l);if(!c)throw new Error("Missing service "+l);return c instanceof Dh?t.invokeFunction(u=>u.get(l)):c}i.get=n;let o=!1;const r=new le;function s(l){if(o)return t;o=!0;for(const[u,d]of Roe())e.get(u)||e.set(u,d);for(const u in l)if(l.hasOwnProperty(u)){const d=wn(u);e.get(d)instanceof Dh&&e.set(d,l[u])}const c=vgt();for(const u of c)try{t.createInstance(u)}catch(d){en(d)}return r.fire(),t}i.initialize=s;function a(l){if(o)return l();const c=new Be,u=c.add(r.event(()=>{u.dispose(),c.add(l())}));return c}i.withServices=a})(Vt||(Vt={}));let Igt;function Gg(){return Igt}let ECe;function Tgt(i){ECe=i}class DCe{get TChange(){return null}reportChanges(){this.get()}read(e){return e?e.readObservable(this):this.get()}map(e,t){const n=t===void 0?void 0:e,o=t===void 0?e:t;return ECe({owner:n,debugName:()=>{const r=Gb(o);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(o.toString());if(a)return`${this.debugName}.${a[2]}`;if(!n)return`${this.debugName} (mapped)`}},r=>o(this.read(r),r))}}class cT extends DCe{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 qi(i,e){const t=new kCe(i,e);try{i(t)}finally{t.finish()}}function U$(i,e,t){i?e(i):qi(e,t)}class kCe{constructor(e,t){var n;this._fn=e,this._getDebugName=t,this.updatingObservers=[],(n=Gg())===null||n===void 0||n.handleBeginTransaction(this)}getDebugName(){return this._getDebugName?this._getDebugName():Gb(this._fn)}updateObserver(e,t){this.updatingObservers.push({observer:e,observable:t}),e.beginUpdate(t)}finish(){var e;const t=this.updatingObservers;this.updatingObservers=null;for(const{observer:n,observable:o}of t)n.endUpdate(o);(e=Gg())===null||e===void 0||e.handleEndTransaction()}}function AX(i,e,t,n){let o;if(i!==void 0)if(typeof i=="function"){if(o=i(),o!==void 0)return o}else return i;if(e!==void 0&&(o=Gb(e),o!==void 0))return o;if(t!==void 0){for(const r in t)if(t[r]===n)return r}}function Gb(i){const e=i.toString(),n=/\/\*\*\s*@description\s*([^*]*)\*\//.exec(e),o=n?n[1]:void 0;return o==null?void 0:o.trim()}function Ai(i,e){return typeof i=="string"?new j$(void 0,i,e):new j$(i,void 0,e)}class j$ extends cT{get debugName(){var e;return(e=AX(this._debugName,void 0,this._owner,this))!==null&&e!==void 0?e:"ObservableValue"}constructor(e,t,n){super(),this._owner=e,this._debugName=t,this._value=n}get(){return this._value}set(e,t,n){var o;if(this._value===e)return;let r;t||(t=r=new kCe(()=>{},()=>`Setting ${this.debugName}`));try{const s=this._value;this._setValue(e),(o=Gg())===null||o===void 0||o.handleObservableChanged(this,{oldValue:s,newValue:e,change:n,didChange:!0,hadValue:!0});for(const a of this.observers)t.updateObserver(a,this),a.handleChange(this,n)}finally{r&&r.finish()}}toString(){return`${this.debugName}: ${this._value}`}_setValue(e){this._value=e}}function YP(i,e){return typeof i=="string"?new Fae(void 0,i,e):new Fae(i,void 0,e)}class Fae extends j${_setValue(e){this._value!==e&&(this._value&&this._value.dispose(),this._value=e)}dispose(){var e;(e=this._value)===null||e===void 0||e.dispose()}}const Dk=(i,e)=>i===e;function In(i,e){return e!==void 0?new Ik(i,void 0,e,void 0,void 0,void 0,Dk):new Ik(void 0,void 0,i,void 0,void 0,void 0,Dk)}function Bae(i,e){var t;return new Ik(i.owner,i.debugName,e,void 0,void 0,void 0,(t=i.equalityComparer)!==null&&t!==void 0?t:Dk)}function Ngt(i,e){var t;return new Ik(i.owner,i.debugName,e,i.createEmptyChangeSummary,i.handleChange,void 0,(t=i.equalityComparer)!==null&&t!==void 0?t:Dk)}function kk(i,e){let t,n;e===void 0?(t=i,n=void 0):(n=i,t=e);const o=new Be;return new Ik(n,()=>{var r;return(r=Gb(t))!==null&&r!==void 0?r:"(anonymous)"},r=>(o.clear(),t(r,o)),void 0,void 0,()=>o.dispose(),Dk)}Tgt(In);class Ik extends cT{get debugName(){var e;return(e=AX(this._debugName,this._computeFn,this._owner,this))!==null&&e!==void 0?e:"(anonymous)"}constructor(e,t,n,o,r,s=void 0,a){var l,c;super(),this._owner=e,this._debugName=t,this._computeFn=n,this.createChangeSummary=o,this._handleChange=r,this._handleLastObserverRemoved=s,this._equalityComparator=a,this.state=0,this.value=void 0,this.updateCount=0,this.dependencies=new Set,this.dependenciesToBeRemoved=new Set,this.changeSummary=void 0,this.changeSummary=(l=this.createChangeSummary)===null||l===void 0?void 0:l.call(this),(c=Gg())===null||c===void 0||c.handleDerivedCreated(this)}onLastObserverRemoved(){var e;this.state=0,this.value=void 0;for(const t of this.dependencies)t.removeObserver(this);this.dependencies.clear(),(e=this._handleLastObserverRemoved)===null||e===void 0||e.call(this)}get(){var e;if(this.observers.size===0){const t=this._computeFn(this,(e=this.createChangeSummary)===null||e===void 0?void 0:e.call(this));return this.onLastObserverRemoved(),t}else{do{if(this.state===1){for(const t of this.dependencies)if(t.reportChanges(),this.state===2)break}this.state===1&&(this.state=3),this._recomputeIfNeeded()}while(this.state!==3);return this.value}}_recomputeIfNeeded(){var e,t;if(this.state===3)return;const n=this.dependenciesToBeRemoved;this.dependenciesToBeRemoved=this.dependencies,this.dependencies=n;const o=this.state!==0,r=this.value;this.state=3;const s=this.changeSummary;this.changeSummary=(e=this.createChangeSummary)===null||e===void 0?void 0:e.call(this);try{this.value=this._computeFn(this,s)}finally{for(const l of this.dependenciesToBeRemoved)l.removeObserver(this);this.dependenciesToBeRemoved.clear()}const a=o&&!this._equalityComparator(r,this.value);if((t=Gg())===null||t===void 0||t.handleDerivedRecomputed(this,{oldValue:r,newValue:this.value,change:void 0,didChange:a,hadValue:o}),a)for(const l of this.observers)l.handleChange(this,void 0)}toString(){return`LazyDerived<${this.debugName}>`}beginUpdate(e){this.updateCount++;const t=this.updateCount===1;if(this.state===3&&(this.state=1,!t))for(const n of this.observers)n.handlePossibleChange(this);if(t)for(const n of this.observers)n.beginUpdate(this)}endUpdate(e){if(this.updateCount--,this.updateCount===0){const t=[...this.observers];for(const n of t)n.endUpdate(this)}if(this.updateCount<0)throw new Vo}handlePossibleChange(e){if(this.state===3&&this.dependencies.has(e)&&!this.dependenciesToBeRemoved.has(e)){this.state=1;for(const t of this.observers)t.handlePossibleChange(this)}}handleChange(e,t){if(this.dependencies.has(e)&&!this.dependenciesToBeRemoved.has(e)){const n=this._handleChange?this._handleChange({changedObservable:e,change:t,didChange:r=>r===e},this.changeSummary):!0,o=this.state===3;if(n&&(this.state===1||o)&&(this.state=2,o))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)}}function PX(i,e){return new Y5(i.debugName,e,void 0,void 0)}function Ii(i){return new Y5(void 0,i,void 0,void 0)}function X5(i,e){return new Y5(i.debugName,e,i.createEmptyChangeSummary,i.handleChange)}function Ja(i){const e=new Be,t=PX({debugName:()=>Gb(i)||"(anonymous)"},n=>{e.clear(),i(n,e)});return zt(()=>{t.dispose(),e.dispose()})}class Y5{get debugName(){if(typeof this._debugName=="string")return this._debugName;if(typeof this._debugName=="function"){const t=this._debugName();if(t!==void 0)return t}const e=Gb(this._runFn);return e!==void 0?e:"(anonymous)"}constructor(e,t,n,o){var r,s;this._debugName=e,this._runFn=t,this.createChangeSummary=n,this._handleChange=o,this.state=2,this.updateCount=0,this.disposed=!1,this.dependencies=new Set,this.dependenciesToBeRemoved=new Set,this.changeSummary=(r=this.createChangeSummary)===null||r===void 0?void 0:r.call(this),(s=Gg())===null||s===void 0||s.handleAutorunCreated(this),this._runIfNeeded()}dispose(){this.disposed=!0;for(const e of this.dependencies)e.removeObserver(this);this.dependencies.clear()}_runIfNeeded(){var e,t,n;if(this.state===3)return;const o=this.dependenciesToBeRemoved;this.dependenciesToBeRemoved=this.dependencies,this.dependencies=o,this.state=3;try{if(!this.disposed){(e=Gg())===null||e===void 0||e.handleAutorunTriggered(this);const r=this.changeSummary;this.changeSummary=(t=this.createChangeSummary)===null||t===void 0?void 0:t.call(this),this._runFn(this,r)}}finally{(n=Gg())===null||n===void 0||n.handleAutorunFinished(this);for(const r of this.dependenciesToBeRemoved)r.removeObserver(this);this.dependenciesToBeRemoved.clear()}}toString(){return`Autorun<${this.debugName}>`}beginUpdate(){this.state===3&&(this.state=1),this.updateCount++}endUpdate(){if(this.updateCount===1)do{if(this.state===1){this.state=3;for(const e of this.dependencies)if(e.reportChanges(),this.state===2)break}this._runIfNeeded()}while(this.state!==3);this.updateCount--,PD(()=>this.updateCount>=0)}handlePossibleChange(e){this.state===3&&this.dependencies.has(e)&&!this.dependenciesToBeRemoved.has(e)&&(this.state=1)}handleChange(e,t){this.dependencies.has(e)&&!this.dependenciesToBeRemoved.has(e)&&(this._handleChange?this._handleChange({changedObservable:e,change:t,didChange:o=>o===e},this.changeSummary):!0)&&(this.state=2)}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(i){i.Observer=Y5})(Ii||(Ii={}));function ZP(i){return new Rgt(i)}class Rgt extends DCe{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 Mgt(i,e){return new Promise(t=>{let n=!1,o=!1;const r=Ii(s=>{const a=i.read(s);e(a)&&(n?r.dispose():o=!0,t(a))});n=!0,o&&r.dispose()})}function $r(i,e){return new ICe(i,e)}class ICe extends cT{constructor(e,t){super(),this.event=e,this._getValue=t,this.hasValue=!1,this.handleEvent=n=>{var o;const r=this._getValue(n),s=!this.hasValue||this.value!==r;(o=Gg())===null||o===void 0||o.handleFromEventObservableTriggered(this,{oldValue:this.value,newValue:r,change:void 0,didChange:s,hadValue:this.hasValue}),s&&(this.value=r,this.hasValue&&qi(a=>{for(const l of this.observers)a.updateObserver(l,this),l.handleChange(this,void 0)},()=>{const a=this.getDebugName();return"Event fired"+(a?`: ${a}`:"")}),this.hasValue=!0)}}getDebugName(){return Gb(this._getValue)}get debugName(){const e=this.getDebugName();return"From Event"+(e?`: ${e}`:"")}onFirstObserverAdded(){this.subscription=this.event(this.handleEvent)}onLastObserverRemoved(){this.subscription.dispose(),this.subscription=void 0,this.hasValue=!1,this.value=void 0}get(){return this.subscription?(this.hasValue||this.handleEvent(void 0),this.value):this._getValue(void 0)}}(function(i){i.Observer=ICe})($r||($r={}));function Ol(i,e){return new Agt(i,e)}class Agt extends cT{constructor(e,t){super(),this.debugName=e,this.event=t,this.handleEvent=()=>{qi(n=>{for(const o of this.observers)n.updateObserver(o,this),o.handleChange(this,void 0)},()=>this.debugName)}}onFirstObserverAdded(){this.subscription=this.event(this.handleEvent)}onLastObserverRemoved(){this.subscription.dispose(),this.subscription=void 0}get(){}}function TCe(i){return typeof i=="string"?new Wae(i):new Wae(void 0,i)}class Wae extends cT{get debugName(){var e;return(e=AX(this._debugName,void 0,this._owner,this))!==null&&e!==void 0?e:"Observable Signal"}constructor(e,t){super(),this._debugName=e,this._owner=t}trigger(e,t){if(!e){qi(n=>{this.trigger(n,t)},()=>`Trigger signal ${this.debugName}`);return}for(const n of this.observers)e.updateObserver(n,this),n.handleChange(this,t)}get(){}}function Tk(i){const e=new Pgt(!0);return i.addObserver(e),i.reportChanges(),zt(()=>{i.removeObserver(e)})}class Pgt{constructor(e){this.forceRecompute=e,this.counter=0}beginUpdate(e){this.counter++}endUpdate(e){this.counter--,this.counter===0&&this.forceRecompute&&e.reportChanges()}handlePossibleChange(e){}handleChange(e,t){}}function NCe(){return!!w_e.VSCODE_DEV}function Ogt(i){if(NCe()){const e=Fgt();return e.add(i),{dispose(){e.delete(i)}}}else return{dispose(){}}}function Fgt(){B2||(B2=new Set);const i=globalThis;return i.$hotReload_applyNewExports||(i.$hotReload_applyNewExports=e=>{for(const t of B2){const n=t(e);if(n)return n}}),B2}let B2;function Bgt(i,e,t,n){if(i.length===0)return e;if(e.length===0)return i;const o=[];let r=0,s=0;for(;ru?(o.push(l),s++):(o.push(n(a,l)),r++,s++)}for(;r`Apply decorations from ${e.debugName}`},o=>{const r=e.read(o);n.set(r)})),t.add({dispose:()=>{n.clear()}}),t}function W2(i,e){return i.appendChild(e),zt(()=>{i.removeChild(e)})}class Wgt extends _e{get width(){return this._width}get height(){return this._height}constructor(e,t){super(),this.elementSizeObserver=this._register(new K0e(e,t)),this._width=Ai(this,this.elementSizeObserver.getWidth()),this._height=Ai(this,this.elementSizeObserver.getHeight()),this._register(this.elementSizeObserver.onDidChange(n=>qi(o=>{this._width.set(this.elementSizeObserver.getWidth(),o),this._height.set(this.elementSizeObserver.getHeight(),o)})))}observe(e){this.elementSizeObserver.observe(e)}setAutomaticLayout(e){e?this.elementSizeObserver.startObserving():this.elementSizeObserver.stopObserving()}}function Vae(i,e){let t=i.get(),n=t,o=t;const r=Ai("animatedValue",t);let s=-1;const a=300;let l;e.add(X5({createEmptyChangeSummary:()=>({animate:!1}),handleChange:(u,d)=>(u.didChange(i)&&(d.animate=d.animate||u.change),!0)},(u,d)=>{l!==void 0&&(cancelAnimationFrame(l),l=void 0),n=o,t=i.read(u),s=Date.now()-(d.animate?0:a),c()}));function c(){const u=Date.now()-s;o=Math.floor(Vgt(u,n,t-n,a)),u{this._actualTop.set(n,void 0)},this.onComputedHeight=n=>{this._actualHeight.set(n,void 0)}}}class Z5{constructor(e,t){this._editor=e,this._domElement=t,this._overlayWidgetId=`managedOverlayWidget-${Z5._counter++}`,this._overlayWidget={getId:()=>this._overlayWidgetId,getDomNode:()=>this._domElement,getPosition:()=>null},this._editor.addOverlayWidget(this._overlayWidget)}dispose(){this._editor.removeOverlayWidget(this._overlayWidget)}}Z5._counter=0;function ev(i,e){return Ii(t=>{for(let[n,o]of Object.entries(e))o&&typeof o=="object"&&"read"in o&&(o=o.read(t)),typeof o=="number"&&(o=`${o}px`),n=n.replace(/[A-Z]/g,r=>"-"+r.toLowerCase()),i.style[n]=o})}function tm(i,e){return Hgt([i],e),i}function Hgt(i,e){NCe()&&Ol("reload",n=>Ogt(o=>{if(!![...Object.values(o)].some(r=>i.includes(r)))return r=>(n(void 0),!0)})).read(e)}function eO(i,e,t){const n=new Be,o=[];return n.add(Ii(r=>{const s=e.read(r),a=new Map,l=new Map;t&&t(!0),i.changeViewZones(c=>{for(const u of o)c.removeZone(u);o.length=0;for(const u of s){const d=c.addZone(u);o.push(d),a.set(u,d)}}),t&&t(!1),n.add(X5({createEmptyChangeSummary(){return[]},handleChange(c,u){const d=l.get(c.changedObservable);return d!==void 0&&u.push(d),!0}},(c,u)=>{for(const d of s)d.onChange&&(l.set(d.onChange,a.get(d)),d.onChange.read(c));t&&t(!0),i.changeViewZones(d=>{for(const h of u)d.layoutZone(h)}),t&&t(!1)}))})),n.add({dispose(){t&&t(!0),i.changeViewZones(r=>{for(const s of o)r.removeZone(s)}),t&&t(!1)}}),n}class $gt extends Ro{dispose(){super.dispose(!0)}}var OX=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},FX=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},zgt=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};const Ugt=Eo("diff-review-insert",Xe.add,C("accessibleDiffViewerInsertIcon","Icon for 'Insert' in accessible diff viewer.")),jgt=Eo("diff-review-remove",Xe.remove,C("accessibleDiffViewerRemoveIcon","Icon for 'Remove' in accessible diff viewer.")),Kgt=Eo("diff-review-close",Xe.close,C("accessibleDiffViewerCloseIcon","Icon for 'Close' in accessible diff viewer."));let km=class extends _e{constructor(e,t,n,o,r,s,a,l,c){super(),this._parentNode=e,this._visible=t,this._setVisible=n,this._canClose=o,this._width=r,this._height=s,this._diffs=a,this._editors=l,this._instantiationService=c,this.model=kk(this,(u,d)=>{const h=this._visible.read(u);if(this._parentNode.style.visibility=h?"visible":"hidden",!h)return null;const f=d.add(this._instantiationService.createInstance(K$,this._diffs,this._editors,this._setVisible,this._canClose)),g=d.add(this._instantiationService.createInstance(q$,this._parentNode,f,this._width,this._height,this._editors));return{model:f,view:g}}),this._register(Tk(this.model))}next(){qi(e=>{const t=this._visible.get();this._setVisible(!0,e),t&&this.model.get().model.nextGroup(e)})}prev(){qi(e=>{this._setVisible(!0,e),this.model.get().model.previousGroup(e)})}close(){qi(e=>{this._setVisible(!1,e)})}};km._ttPolicy=gp("diffReview",{createHTML:i=>i});km=OX([FX(8,$t)],km);let K$=class extends _e{constructor(e,t,n,o,r){super(),this._diffs=e,this._editors=t,this._setVisible=n,this.canClose=o,this._audioCueService=r,this._groups=Ai(this,[]),this._currentGroupIdx=Ai(this,0),this._currentElementIdx=Ai(this,0),this.groups=this._groups,this.currentGroup=this._currentGroupIdx.map((s,a)=>this._groups.read(a)[s]),this.currentGroupIndex=this._currentGroupIdx,this.currentElement=this._currentElementIdx.map((s,a)=>{var l;return(l=this.currentGroup.read(a))===null||l===void 0?void 0:l.lines[s]}),this._register(Ii(s=>{const a=this._diffs.read(s);if(!a){this._groups.set([],void 0);return}const l=qgt(a,this._editors.original.getModel().getLineCount(),this._editors.modified.getModel().getLineCount());qi(c=>{const u=this._editors.modified.getPosition();if(u){const d=l.findIndex(h=>(u==null?void 0:u.lineNumber){const a=this.currentElement.read(s);(a==null?void 0:a.type)===Js.Deleted?this._audioCueService.playAudioCue(Wn.diffLineDeleted,{source:"accessibleDiffViewer.currentElementChanged"}):(a==null?void 0:a.type)===Js.Added&&this._audioCueService.playAudioCue(Wn.diffLineInserted,{source:"accessibleDiffViewer.currentElementChanged"})})),this._register(Ii(s=>{var a;const l=this.currentElement.read(s);if(l&&l.type!==Js.Header){const c=(a=l.modifiedLineNumber)!==null&&a!==void 0?a:l.diff.modified.startLineNumber;this._editors.modified.setSelection(V.fromPositions(new ae(c,1)))}}))}_goToGroupDelta(e,t){const n=this.groups.get();!n||n.length<=1||U$(t,o=>{this._currentGroupIdx.set(Cn.ofLength(n.length).clipCyclic(this._currentGroupIdx.get()+e),o),this._currentElementIdx.set(0,o)})}nextGroup(e){this._goToGroupDelta(1,e)}previousGroup(e){this._goToGroupDelta(-1,e)}_goToLineDelta(e){const t=this.currentGroup.get();!t||t.lines.length<=1||qi(n=>{this._currentElementIdx.set(Cn.ofLength(t.lines.length).clip(this._currentElementIdx.get()+e),n)})}goToNextLine(){this._goToLineDelta(1)}goToPreviousLine(){this._goToLineDelta(-1)}goToLine(e){const t=this.currentGroup.get();if(!t)return;const n=t.lines.indexOf(e);n!==-1&&qi(o=>{this._currentElementIdx.set(n,o)})}revealCurrentElementInEditor(){this._setVisible(!1,void 0);const e=this.currentElement.get();e&&(e.type===Js.Deleted?(this._editors.original.setSelection(V.fromPositions(new ae(e.originalLineNumber,1))),this._editors.original.revealLine(e.originalLineNumber),this._editors.original.focus()):(e.type!==Js.Header&&(this._editors.modified.setSelection(V.fromPositions(new ae(e.modifiedLineNumber,1))),this._editors.modified.revealLine(e.modifiedLineNumber)),this._editors.modified.focus()))}close(){this._setVisible(!1,void 0),this._editors.modified.focus()}};K$=OX([FX(4,lT)],K$);const Ux=3;function qgt(i,e,t){const n=[];for(const o of Zve(i,(r,s)=>s.modified.startLineNumber-r.modified.endLineNumberExclusive<2*Ux)){const r=[];r.push(new Xgt);const s=new ln(Math.max(1,o[0].original.startLineNumber-Ux),Math.min(o[o.length-1].original.endLineNumberExclusive+Ux,e+1)),a=new ln(Math.max(1,o[0].modified.startLineNumber-Ux),Math.min(o[o.length-1].modified.endLineNumberExclusive+Ux,t+1));Qve(o,(u,d)=>{const h=new ln(u?u.original.endLineNumberExclusive:s.startLineNumber,d?d.original.startLineNumber:s.endLineNumberExclusive),f=new ln(u?u.modified.endLineNumberExclusive:a.startLineNumber,d?d.modified.startLineNumber:a.endLineNumberExclusive);h.forEach(g=>{r.push(new Qgt(g,f.startLineNumber+(g-h.startLineNumber)))}),d&&(d.original.forEach(g=>{r.push(new Ygt(d,g))}),d.modified.forEach(g=>{r.push(new Zgt(d,g))}))});const l=o[0].modified.join(o[o.length-1].modified),c=o[0].original.join(o[o.length-1].original);n.push(new Ggt(new pf(l,c),r))}return n}var Js;(function(i){i[i.Header=0]="Header",i[i.Unchanged=1]="Unchanged",i[i.Deleted=2]="Deleted",i[i.Added=3]="Added"})(Js||(Js={}));class Ggt{constructor(e,t){this.range=e,this.lines=t}}class Xgt{constructor(){this.type=Js.Header}}class Ygt{constructor(e,t){this.diff=e,this.originalLineNumber=t,this.type=Js.Deleted,this.modifiedLineNumber=void 0}}class Zgt{constructor(e,t){this.diff=e,this.modifiedLineNumber=t,this.type=Js.Added,this.originalLineNumber=void 0}}class Qgt{constructor(e,t){this.originalLineNumber=e,this.modifiedLineNumber=t,this.type=Js.Unchanged}}let q$=class extends _e{constructor(e,t,n,o,r,s){super(),this._element=e,this._model=t,this._width=n,this._height=o,this._editors=r,this._languageService=s,this.domNode=this._element,this.domNode.className="diff-review monaco-editor-background";const a=document.createElement("div");a.className="diff-review-actions",this._actionBar=this._register(new $c(a)),this._register(Ii(l=>{this._actionBar.clear(),this._model.canClose.read(l)&&this._actionBar.push(new la("diffreview.close",C("label.close","Close"),"close-diff-review "+Mt.asClassName(Kgt),!0,()=>zgt(this,void 0,void 0,function*(){return 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 GI(this._content,{})),jr(this.domNode,this._scrollbar.getDomNode(),a),this._register(zt(()=>{jr(this.domNode)})),this._register(ev(this.domNode,{width:this._width,height:this._height})),this._register(ev(this._content,{width:this._width,height:this._height})),this._register(Ja((l,c)=>{this._model.currentGroup.read(l),this._render(c)})),this._register(No(this.domNode,"keydown",l=>{(l.equals(18)||l.equals(2066)||l.equals(530))&&(l.preventDefault(),this._model.goToNextLine()),(l.equals(16)||l.equals(2064)||l.equals(528))&&(l.preventDefault(),this._model.goToPreviousLine()),(l.equals(9)||l.equals(2057)||l.equals(521)||l.equals(1033))&&(l.preventDefault(),this._model.close()),(l.equals(10)||l.equals(3))&&(l.preventDefault(),this._model.revealCurrentElementInEditor())}))}_render(e){const t=this._editors.original.getOptions(),n=this._editors.modified.getOptions(),o=document.createElement("div");o.className="diff-review-table",o.setAttribute("role","list"),o.setAttribute("aria-label",C("ariaLabel","Accessible Diff Viewer. Use arrow up and down to navigate.")),rs(o,n.get(50)),jr(this._content,o);const r=this._editors.original.getModel(),s=this._editors.modified.getModel();if(!r||!s)return;const a=r.getOptions(),l=s.getOptions(),c=n.get(66),u=this._model.currentGroup.get();for(const d of(u==null?void 0:u.lines)||[]){if(!u)break;let h;if(d.type===Js.Header){const g=document.createElement("div");g.className="diff-review-row",g.setAttribute("role","listitem");const p=u.range,v=this._model.currentGroupIndex.get(),m=this._model.groups.get().length,_=D=>D===0?C("no_lines_changed","no lines changed"):D===1?C("one_line_changed","1 line changed"):C("more_lines_changed","{0} lines changed",D),w=_(p.original.length),y=_(p.modified.length);g.setAttribute("aria-label",C({key:"header",comment:["This is the ARIA label for a git diff header.","A git diff header looks like this: @@ -154,12 +159,39 @@.","That encodes that at original line 154 (which is now line 159), 12 lines were removed/changed with 39 lines.","Variables 0 and 1 refer to the diff index out of total number of diffs.","Variables 2 and 4 will be numbers (a line number).",'Variables 3 and 5 will be "no lines changed", "1 line changed" or "X lines changed", localized separately.']},"Difference {0} of {1}: original line {2}, {3}, modified line {4}, {5}",v+1,m,p.original.startLineNumber,w,p.modified.startLineNumber,y));const L=document.createElement("div");L.className="diff-review-cell diff-review-summary",L.appendChild(document.createTextNode(`${v+1}/${m}: @@ -${p.original.startLineNumber},${p.original.length} +${p.modified.startLineNumber},${p.modified.length} @@`)),g.appendChild(L),h=g}else h=this._createRow(d,c,this._width.get(),t,r,a,n,s,l);o.appendChild(h);const f=In(g=>this._model.currentElement.read(g)===d);e.add(Ii(g=>{const p=f.read(g);h.tabIndex=p?0:-1,p&&h.focus()})),e.add(ke(h,"focus",()=>{this._model.goToLine(d)}))}this._scrollbar.scanDomNode()}_createRow(e,t,n,o,r,s,a,l,c){const u=o.get(143),d=u.glyphMarginWidth+u.lineNumbersWidth,h=a.get(143),f=10+h.glyphMarginWidth+h.lineNumbersWidth;let g="diff-review-row",p="";const v="diff-review-spacer";let m=null;switch(e.type){case Js.Added:g="diff-review-row line-insert",p=" char-insert",m=Ugt;break;case Js.Deleted:g="diff-review-row line-delete",p=" char-delete",m=jgt;break}const _=document.createElement("div");_.style.minWidth=n+"px",_.className=g,_.setAttribute("role","listitem"),_.ariaLevel="";const w=document.createElement("div");w.className="diff-review-cell",w.style.height=`${t}px`,_.appendChild(w);const y=document.createElement("span");y.style.width=d+"px",y.style.minWidth=d+"px",y.className="diff-review-line-number"+p,e.originalLineNumber!==void 0?y.appendChild(document.createTextNode(String(e.originalLineNumber))):y.innerText="\xA0",w.appendChild(y);const L=document.createElement("span");L.style.width=f+"px",L.style.minWidth=f+"px",L.style.paddingRight="10px",L.className="diff-review-line-number"+p,e.modifiedLineNumber!==void 0?L.appendChild(document.createTextNode(String(e.modifiedLineNumber))):L.innerText="\xA0",w.appendChild(L);const D=document.createElement("span");if(D.className=v,m){const k=document.createElement("span");k.className=Mt.asClassName(m),k.innerText="\xA0\xA0",D.appendChild(k)}else D.innerText="\xA0\xA0";w.appendChild(D);let E;if(e.modifiedLineNumber!==void 0){let k=this._getLineHtml(l,a,c.tabSize,e.modifiedLineNumber,this._languageService.languageIdCodec);km._ttPolicy&&(k=km._ttPolicy.createHTML(k)),w.insertAdjacentHTML("beforeend",k),E=l.getLineContent(e.modifiedLineNumber)}else{let k=this._getLineHtml(r,o,s.tabSize,e.originalLineNumber,this._languageService.languageIdCodec);km._ttPolicy&&(k=km._ttPolicy.createHTML(k)),w.insertAdjacentHTML("beforeend",k),E=r.getLineContent(e.originalLineNumber)}E.length===0&&(E=C("blankLine","blank"));let I="";switch(e.type){case Js.Unchanged:e.originalLineNumber===e.modifiedLineNumber?I=C({key:"unchangedLine",comment:["The placeholders are contents of the line and should not be translated."]},"{0} unchanged line {1}",E,e.originalLineNumber):I=C("equalLine","{0} original line {1} modified line {2}",E,e.originalLineNumber,e.modifiedLineNumber);break;case Js.Added:I=C("insertLine","+ {0} modified line {1}",E,e.modifiedLineNumber);break;case Js.Deleted:I=C("deleteLine","- {0} original line {1}",E,e.originalLineNumber);break}return _.setAttribute("aria-label",I),_}_getLineHtml(e,t,n,o,r){const s=e.getLineContent(o),a=t.get(50),l=gr.createEmpty(s,r),c=Yl.isBasicASCII(s,e.mightContainNonBasicASCII()),u=Yl.containsRTL(s,c,e.mightContainRTL());return d5(new Zv(a.isMonospace&&!t.get(33),a.canUseHalfwidthRightwardsArrow,s,!1,c,u,0,l,[],n,0,a.spaceWidth,a.middotWidth,a.wsmiddotWidth,t.get(116),t.get(98),t.get(93),t.get(51)!==Al.OFF,null)).html}};q$=OX([FX(5,Ki)],q$);const Jgt=Eo("diff-insert",Xe.add,C("diffInsertIcon","Line decoration for inserts in the diff editor.")),MCe=Eo("diff-remove",Xe.remove,C("diffRemoveIcon","Line decoration for removals in the diff editor.")),Hae=Jt.register({className:"line-insert",description:"line-insert",isWholeLine:!0,linesDecorationsClassName:"insert-sign "+Mt.asClassName(Jgt),marginClassName:"gutter-insert"}),$ae=Jt.register({className:"line-delete",description:"line-delete",isWholeLine:!0,linesDecorationsClassName:"delete-sign "+Mt.asClassName(MCe),marginClassName:"gutter-delete"}),zae=Jt.register({className:"line-insert",description:"line-insert",isWholeLine:!0,marginClassName:"gutter-insert"}),Uae=Jt.register({className:"line-delete",description:"line-delete",isWholeLine:!0,marginClassName:"gutter-delete"}),jae=Jt.register({className:"char-insert",description:"char-insert",shouldFillLineOnLineBreak:!0}),ept=Jt.register({className:"char-insert",description:"char-insert",isWholeLine:!0}),tpt=Jt.register({className:"char-insert diff-range-empty",description:"char-insert diff-range-empty"}),G$=Jt.register({className:"char-delete",description:"char-delete",shouldFillLineOnLineBreak:!0}),npt=Jt.register({className:"char-delete",description:"char-delete",isWholeLine:!0}),ipt=Jt.register({className:"char-delete diff-range-empty",description:"char-delete diff-range-empty"}),opt=Jt.register({description:"diff-editor-arrow-revert-change",glyphMarginHoverMessage:new is(void 0,{isTrusted:!0,supportThemeIcons:!0}).appendMarkdown(C("revertChangeHoverMessage","Click to revert change")),glyphMarginClassName:"arrow-revert-change "+Mt.asClassName(Xe.arrowRight),zIndex:10001});class tv extends _e{constructor(e,t,n,o,r){super(),this._rootElement=e,this._diffModel=t,this._originalEditorLayoutInfo=n,this._modifiedEditorLayoutInfo=o,this._editors=r,this._originalScrollTop=$r(this._editors.original.onDidScrollChange,()=>this._editors.original.getScrollTop()),this._modifiedScrollTop=$r(this._editors.modified.onDidScrollChange,()=>this._editors.modified.getScrollTop()),this._viewZonesChanged=Ol("onDidChangeViewZones",this._editors.modified.onDidChangeViewZones),this.width=Ai(this,0),this._modifiedViewZonesChangedSignal=Ol("modified.onDidChangeViewZones",this._editors.modified.onDidChangeViewZones),this._originalViewZonesChangedSignal=Ol("original.onDidChangeViewZones",this._editors.original.onDidChangeViewZones),this._state=kk((h,f)=>{var g;this._element.replaceChildren();const p=this._diffModel.read(h),v=(g=p==null?void 0:p.diff.read(h))===null||g===void 0?void 0:g.movedTexts;if(!v||v.length===0){this.width.set(0,void 0);return}this._viewZonesChanged.read(h);const m=this._originalEditorLayoutInfo.read(h),_=this._modifiedEditorLayoutInfo.read(h);if(!m||!_){this.width.set(0,void 0);return}this._modifiedViewZonesChangedSignal.read(h),this._originalViewZonesChangedSignal.read(h);const w=v.map(R=>{function A(K,j){const G=j.getTopForLineNumber(K.startLineNumber,!0),X=j.getTopForLineNumber(K.endLineNumberExclusive,!0);return(G+X)/2}const P=A(R.lineRangeMapping.original,this._editors.original),N=this._originalScrollTop.read(h),M=A(R.lineRangeMapping.modified,this._editors.modified),H=this._modifiedScrollTop.read(h),W=P-N,F=M-H,$=Math.min(P,M),z=Math.max(P,M);return{range:new Cn($,z),from:W,to:F,fromWithoutScroll:P,toWithoutScroll:M,move:R}});w.sort(sXe(Nc(R=>R.fromWithoutScroll>R.toWithoutScroll,aXe),Nc(R=>R.fromWithoutScroll>R.toWithoutScroll?R.fromWithoutScroll:-R.toWithoutScroll,zg)));const y=BX.compute(w.map(R=>R.range)),L=10,D=m.verticalScrollbarWidth,E=(y.getTrackCount()-1)*10+L*2,I=D+E+(_.contentLeft-tv.movedCodeBlockPadding);let k=0;for(const R of w){const A=y.getTrack(k),P=D+L+A*10,N=15,M=15,H=I,W=_.glyphMarginWidth+_.lineNumbersWidth,F=18,$=document.createElementNS("http://www.w3.org/2000/svg","rect");$.classList.add("arrow-rectangle"),$.setAttribute("x",`${H-W}`),$.setAttribute("y",`${R.to-F/2}`),$.setAttribute("width",`${W}`),$.setAttribute("height",`${F}`),this._element.appendChild($);const z=document.createElementNS("http://www.w3.org/2000/svg","g"),K=document.createElementNS("http://www.w3.org/2000/svg","path");K.setAttribute("d",`M ${0} ${R.from} L ${P} ${R.from} L ${P} ${R.to} L ${H-M} ${R.to}`),K.setAttribute("fill","none"),z.appendChild(K);const j=document.createElementNS("http://www.w3.org/2000/svg","polygon");j.classList.add("arrow"),f.add(Ii(G=>{K.classList.toggle("currentMove",R.move===p.activeMovedText.read(G)),j.classList.toggle("currentMove",R.move===p.activeMovedText.read(G))})),j.setAttribute("points",`${H-M},${R.to-N/2} ${H},${R.to} ${H-M},${R.to+N/2}`),z.appendChild(j),this._element.appendChild(z),k++}this.width.set(E,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(zt(()=>this._element.remove())),this._register(Ii(h=>{const f=this._originalEditorLayoutInfo.read(h),g=this._modifiedEditorLayoutInfo.read(h);!f||!g||(this._element.style.left=`${f.width-f.verticalScrollbarWidth}px`,this._element.style.height=`${f.height}px`,this._element.style.width=`${f.verticalScrollbarWidth+f.contentLeft-tv.movedCodeBlockPadding+this.width.read(h)}px`)})),this._register(Tk(this._state));const s=In(h=>{const f=this._diffModel.read(h),g=f==null?void 0:f.diff.read(h);return g?g.movedTexts.map(p=>({move:p,original:new JP(ZP(p.lineRangeMapping.original.startLineNumber-1),18),modified:new JP(ZP(p.lineRangeMapping.modified.startLineNumber-1),18)})):[]});this._register(eO(this._editors.original,s.map(h=>h.map(f=>f.original)))),this._register(eO(this._editors.modified,s.map(h=>h.map(f=>f.modified)))),this._register(Ja((h,f)=>{const g=s.read(h);for(const p of g)f.add(new Kae(this._editors.original,p.original,p.move,"original",this._diffModel.get())),f.add(new Kae(this._editors.modified,p.modified,p.move,"modified",this._diffModel.get()))}));const a=$r(this._editors.original.onDidChangeCursorPosition,()=>this._editors.original.getPosition()),l=$r(this._editors.modified.onDidChangeCursorPosition,()=>this._editors.modified.getPosition()),c=Ol("original.onDidFocusEditorWidget",h=>this._editors.original.onDidFocusEditorWidget(()=>setTimeout(()=>h(void 0),0))),u=Ol("modified.onDidFocusEditorWidget",h=>this._editors.modified.onDidFocusEditorWidget(()=>setTimeout(()=>h(void 0),0)));let d="modified";this._register(X5({createEmptyChangeSummary:()=>{},handleChange:(h,f)=>(h.didChange(c)&&(d="original"),h.didChange(u)&&(d="modified"),!0)},h=>{c.read(h),u.read(h);const f=this._diffModel.read(h);if(!f)return;const g=f.diff.read(h);let p;if(g&&d==="original"){const v=a.read(h);v&&(p=g.movedTexts.find(m=>m.lineRangeMapping.original.contains(v.lineNumber)))}if(g&&d==="modified"){const v=l.read(h);v&&(p=g.movedTexts.find(m=>m.lineRangeMapping.modified.contains(v.lineNumber)))}p!==f.movedTextToCompare.get()&&f.movedTextToCompare.set(void 0,void 0),f.setActiveMovedText(p)}))}}tv.movedCodeBlockPadding=4;class BX{static compute(e){const t=[],n=[];for(const o of e){let r=t.findIndex(s=>!s.intersectsStrict(o));r===-1&&(t.length>=6?r=yet(t,Nc(a=>a.intersectWithRangeLength(o),zg)):(r=t.length,t.push(new iG))),t[r].addRange(o),n.push(r)}return new BX(t.length,n)}constructor(e,t){this._trackCount=e,this.trackPerLineIdx=t}getTrack(e){return this.trackPerLineIdx[e]}getTrackCount(){return this._trackCount}}class Kae extends RCe{constructor(e,t,n,o,r){const s=Or("div.diff-hidden-lines-widget");super(e,t,s.root),this._editor=e,this._move=n,this._kind=o,this._diffModel=r,this._nodes=Or("div.diff-moved-code-block",{style:{marginRight:"4px"}},[Or("div.text-content@textContent"),Or("div.action-bar@actionBar")]),s.root.appendChild(this._nodes.root);const a=$r(this._editor.onDidLayoutChange,()=>this._editor.getLayoutInfo());this._register(ev(this._nodes.root,{paddingRight:a.map(h=>h.verticalScrollbarWidth)}));let l;n.changes.length>0?l=this._kind==="original"?C("codeMovedToWithChanges","Code moved with changes to line {0}-{1}",this._move.lineRangeMapping.modified.startLineNumber,this._move.lineRangeMapping.modified.endLineNumberExclusive-1):C("codeMovedFromWithChanges","Code moved with changes from line {0}-{1}",this._move.lineRangeMapping.original.startLineNumber,this._move.lineRangeMapping.original.endLineNumberExclusive-1):l=this._kind==="original"?C("codeMovedTo","Code moved to line {0}-{1}",this._move.lineRangeMapping.modified.startLineNumber,this._move.lineRangeMapping.modified.endLineNumberExclusive-1):C("codeMovedFrom","Code moved from line {0}-{1}",this._move.lineRangeMapping.original.startLineNumber,this._move.lineRangeMapping.original.endLineNumberExclusive-1);const c=this._register(new $c(this._nodes.actionBar,{highlightToggledItems:!0})),u=new la("",l,"",!1);c.push(u,{icon:!1,label:!0});const d=new la("","Compare",Mt.asClassName(Xe.compareChanges),!0,()=>{this._editor.focus(),this._diffModel.movedTextToCompare.set(this._diffModel.movedTextToCompare.get()===n?void 0:this._move,void 0)});this._register(Ii(h=>{const f=this._diffModel.movedTextToCompare.read(h)===n;d.checked=f})),c.push(d,{icon:!1,label:!0})}}class rpt extends _e{constructor(e,t,n){super(),this._editors=e,this._diffModel=t,this._options=n,this._decorations=In(this,o=>{var r;const s=(r=this._diffModel.read(o))===null||r===void 0?void 0:r.diff.read(o);if(!s)return null;const a=this._diffModel.read(o).movedTextToCompare.read(o),l=this._options.renderIndicators.read(o),c=this._options.showEmptyDecorations.read(o),u=[],d=[];if(!a)for(const f of s.mappings){if(f.lineRangeMapping.original.isEmpty||u.push({range:f.lineRangeMapping.original.toInclusiveRange(),options:l?$ae:Uae}),f.lineRangeMapping.modified.isEmpty||d.push({range:f.lineRangeMapping.modified.toInclusiveRange(),options:l?Hae:zae}),f.lineRangeMapping.modified.isEmpty||f.lineRangeMapping.original.isEmpty)f.lineRangeMapping.original.isEmpty||u.push({range:f.lineRangeMapping.original.toInclusiveRange(),options:npt}),f.lineRangeMapping.modified.isEmpty||d.push({range:f.lineRangeMapping.modified.toInclusiveRange(),options:ept});else for(const g of f.lineRangeMapping.innerChanges||[])f.lineRangeMapping.original.contains(g.originalRange.startLineNumber)&&u.push({range:g.originalRange,options:g.originalRange.isEmpty()&&c?ipt:G$}),f.lineRangeMapping.modified.contains(g.modifiedRange.startLineNumber)&&d.push({range:g.modifiedRange,options:g.modifiedRange.isEmpty()&&c?tpt:jae});!f.lineRangeMapping.modified.isEmpty&&this._options.shouldRenderRevertArrows.read(o)&&!a&&d.push({range:V.fromPositions(new ae(f.lineRangeMapping.modified.startLineNumber,1)),options:opt})}if(a)for(const f of a.changes){const g=f.original.toInclusiveRange();g&&u.push({range:g,options:l?$ae:Uae});const p=f.modified.toInclusiveRange();p&&d.push({range:p,options:l?Hae:zae});for(const v of f.innerChanges||[])u.push({range:v.originalRange,options:G$}),d.push({range:v.modifiedRange,options:jae})}const h=this._diffModel.read(o).activeMovedText.read(o);for(const f of s.movedTexts)u.push({range:f.lineRangeMapping.original.toInclusiveRange(),options:{description:"moved",blockClassName:"movedOriginal"+(f===h?" currentMove":""),blockPadding:[tv.movedCodeBlockPadding,0,tv.movedCodeBlockPadding,tv.movedCodeBlockPadding]}}),d.push({range:f.lineRangeMapping.modified.toInclusiveRange(),options:{description:"moved",blockClassName:"movedModified"+(f===h?" currentMove":""),blockPadding:[4,0,4,4]}});return{originalDecorations:u,modifiedDecorations:d}}),this._register(QP(this._editors.original,this._decorations.map(o=>(o==null?void 0:o.originalDecorations)||[]))),this._register(QP(this._editors.modified,this._decorations.map(o=>(o==null?void 0:o.modifiedDecorations)||[])))}}class spt extends _e{constructor(e,t,n){super(),this._options=e,this._domNode=t,this._dimensions=n,this._sashRatio=Ai(this,void 0),this.sashLeft=In(this,o=>{var r;const s=(r=this._sashRatio.read(o))!==null&&r!==void 0?r:this._options.splitViewDefaultRatio.read(o);return this._computeSashLeft(s,o)}),this._sash=this._register(new fs(this._domNode,{getVerticalSashTop:o=>0,getVerticalSashLeft:o=>this.sashLeft.get(),getVerticalSashHeight:o=>this._dimensions.height.get()},{orientation:0})),this._startSashPosition=void 0,this._register(this._sash.onDidStart(()=>{this._startSashPosition=this.sashLeft.get()})),this._register(this._sash.onDidChange(o=>{const r=this._dimensions.width.get(),s=this._computeSashLeft((this._startSashPosition+(o.currentX-o.startX))/r,void 0);this._sashRatio.set(s/r,void 0)})),this._register(this._sash.onDidEnd(()=>this._sash.layout())),this._register(this._sash.onDidReset(()=>this._sashRatio.set(void 0,void 0))),this._register(Ii(o=>{const r=this._options.enableSplitViewResizing.read(o);this._sash.state=r?3:0,this.sashLeft.read(o),this._dimensions.height.read(o),this._sash.layout()}))}setBoundarySashes(e){this._sash.orthogonalEndSash=e.bottom}_computeSashLeft(e,t){const n=this._dimensions.width.read(t),o=Math.floor(this._options.splitViewDefaultRatio.read(t)*n),r=this._options.enableSplitViewResizing.read(t)?Math.floor(e*n):o,s=100;return n<=s*2?o:rn-s?n-s:r}}class GC{remove(){var e;(e=this.parent)===null||e===void 0||e.children.delete(this.id)}static findId(e,t){let n;typeof e=="string"?n=`${t.id}/${e}`:(n=`${t.id}/${e.name}`,t.children.get(n)!==void 0&&(n=`${t.id}/${e.name}_${e.range.startLineNumber}_${e.range.startColumn}`));let o=n;for(let r=0;t.children.get(o)!==void 0;r++)o=`${n}_${r}`;return o}static empty(e){return e.children.size===0}}class qae extends GC{constructor(e,t,n){super(),this.id=e,this.parent=t,this.symbol=n,this.children=new Map}}class apt extends GC{constructor(e,t,n,o){super(),this.id=e,this.parent=t,this.label=n,this.order=o,this.children=new Map}}class nm extends GC{static create(e,t,n){const o=new Ro(n),r=new nm(t.uri),s=e.ordered(t),a=s.map((c,u)=>{var d;const h=GC.findId(`provider_${u}`,r),f=new apt(h,r,(d=c.displayName)!==null&&d!==void 0?d:"Unknown Outline Provider",u);return Promise.resolve(c.provideDocumentSymbols(t,o.token)).then(g=>{for(const p of g||[])nm._makeOutlineElement(p,f);return f},g=>($o(g),f)).then(g=>{GC.empty(g)?g.remove():r._groups.set(h,g)})}),l=e.onDidChange(()=>{const c=e.ordered(t);Lo(c,s)||o.cancel()});return Promise.all(a).then(()=>o.token.isCancellationRequested&&!n.isCancellationRequested?nm.create(e,t,n):r._compact()).finally(()=>{o.dispose(),l.dispose()})}static _makeOutlineElement(e,t){const n=GC.findId(e,t),o=new qae(n,t,e);if(e.children)for(const r of e.children)nm._makeOutlineElement(r,o);t.children.set(o.id,o)}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,n]of this._groups)n.children.size===0?this._groups.delete(t):e+=1;if(e!==1)this.children=this._groups;else{const t=mn.first(this._groups.values());for(const[,n]of t.children)n.parent=this,this.children.set(n.id,n)}return this}getTopLevelSymbols(){const e=[];for(const t of this.children.values())t instanceof qae?e.push(t.symbol):e.push(...mn.map(t.children.values(),n=>n.symbol));return e.sort((t,n)=>V.compareRangesUsingStarts(t.range,n.range))}asListOfDocumentSymbols(){const e=this.getTopLevelSymbols(),t=[];return nm._flattenDocumentSymbols(t,e,""),t.sort((n,o)=>ae.compare(V.getStartPosition(n.range),V.getStartPosition(o.range))||ae.compare(V.getEndPosition(o.range),V.getEndPosition(n.range)))}static _flattenDocumentSymbols(e,t,n){for(const o of t)e.push({kind:o.kind,tags:o.tags,name:o.name,detail:o.detail,containerName:o.containerName||n,range:o.range,selectionRange:o.selectionRange,children:void 0}),o.children&&nm._flattenDocumentSymbols(e,o.children,o.name)}}var ACe=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},PCe=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},lpt=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};let X$=class extends _e{get isUpdatingViewZones(){return this._isUpdatingViewZones}constructor(e,t,n,o){super(),this._editors=e,this._diffModel=t,this._options=n,this._languageFeaturesService=o,this._isUpdatingViewZones=!1,this._modifiedOutlineSource=kk(this,(c,u)=>{const d=this._editors.modifiedModel.read(c);if(!!d)return u.add(new Y$(this._languageFeaturesService,d))}),this._register(this._editors.original.onDidChangeCursorPosition(c=>{if(c.reason===3){const u=this._diffModel.get();qi(d=>{for(const h of this._editors.original.getSelections()||[])u==null||u.ensureOriginalLineIsVisible(h.getStartPosition().lineNumber,d),u==null||u.ensureOriginalLineIsVisible(h.getEndPosition().lineNumber,d)})}})),this._register(this._editors.modified.onDidChangeCursorPosition(c=>{if(c.reason===3){const u=this._diffModel.get();qi(d=>{for(const h of this._editors.modified.getSelections()||[])u==null||u.ensureModifiedLineIsVisible(h.getStartPosition().lineNumber,d),u==null||u.ensureModifiedLineIsVisible(h.getEndPosition().lineNumber,d)})}}));const r=this._diffModel.map((c,u)=>{var d,h;return((d=c==null?void 0:c.diff.read(u))===null||d===void 0?void 0:d.mappings.length)===0?[]:(h=c==null?void 0:c.unchangedRegions.read(u))!==null&&h!==void 0?h:[]}),s=kk(this,(c,u)=>{const d=this._modifiedOutlineSource.read(c);if(!d)return{origViewZones:[],modViewZones:[]};const h=[],f=[],g=this._options.renderSideBySide.read(c),p=r.read(c);for(const v of p)if(!v.shouldHideControls(c)){{const m=In(w=>v.getHiddenOriginalRange(w).startLineNumber-1),_=new JP(m,24);h.push(_),u.add(new Gae(this._editors.original,_,v,v.originalUnchangedRange,!g,d,w=>this._diffModel.get().ensureModifiedLineIsVisible(w,void 0),this._options))}{const m=In(w=>v.getHiddenModifiedRange(w).startLineNumber-1),_=new JP(m,24);f.push(_),u.add(new Gae(this._editors.modified,_,v,v.modifiedUnchangedRange,!1,d,w=>this._diffModel.get().ensureModifiedLineIsVisible(w,void 0),this._options))}}return{origViewZones:h,modViewZones:f}}),a={description:"unchanged lines",className:"diff-unchanged-lines",isWholeLine:!0},l={description:"Fold Unchanged",glyphMarginHoverMessage:new is(void 0,{isTrusted:!0,supportThemeIcons:!0}).appendMarkdown(C("foldUnchanged","Fold Unchanged Region")),glyphMarginClassName:"fold-unchanged "+Mt.asClassName(Xe.fold),zIndex:10001};this._register(QP(this._editors.original,In(c=>{const u=r.read(c),d=u.map(h=>({range:h.originalUnchangedRange.toInclusiveRange(),options:a}));for(const h of u)h.shouldHideControls(c)&&d.push({range:V.fromPositions(new ae(h.originalLineNumber,1)),options:l});return d}))),this._register(QP(this._editors.modified,In(c=>{const u=r.read(c),d=u.map(h=>({range:h.modifiedUnchangedRange.toInclusiveRange(),options:a}));for(const h of u)h.shouldHideControls(c)&&d.push({range:ln.ofLength(h.modifiedLineNumber,1).toInclusiveRange(),options:l});return d}))),this._register(eO(this._editors.original,s.map(c=>c.origViewZones),c=>this._isUpdatingViewZones=c)),this._register(eO(this._editors.modified,s.map(c=>c.modViewZones),c=>this._isUpdatingViewZones=c)),this._register(Ii(c=>{const u=r.read(c);this._editors.original.setHiddenAreas(u.map(d=>d.getHiddenOriginalRange(c).toInclusiveRange()).filter(ED)),this._editors.modified.setHiddenAreas(u.map(d=>d.getHiddenModifiedRange(c).toInclusiveRange()).filter(ED))})),this._register(this._editors.modified.onMouseUp(c=>{var u;if(!c.event.rightButton&&c.target.position&&((u=c.target.element)===null||u===void 0?void 0:u.className.includes("fold-unchanged"))){const d=c.target.position.lineNumber,h=this._diffModel.get();if(!h)return;const f=h.unchangedRegions.get().find(g=>g.modifiedUnchangedRange.includes(d));if(!f)return;f.collapseAll(void 0),c.event.stopPropagation(),c.event.preventDefault()}})),this._register(this._editors.original.onMouseUp(c=>{var u;if(!c.event.rightButton&&c.target.position&&((u=c.target.element)===null||u===void 0?void 0:u.className.includes("fold-unchanged"))){const d=c.target.position.lineNumber,h=this._diffModel.get();if(!h)return;const f=h.unchangedRegions.get().find(g=>g.originalUnchangedRange.includes(d));if(!f)return;f.collapseAll(void 0),c.event.stopPropagation(),c.event.preventDefault()}}))}};X$=ACe([PCe(3,pt)],X$);let Y$=class extends _e{constructor(e,t){super(),this._languageFeaturesService=e,this._textModel=t,this._currentModel=Ai(this,void 0);const n=Ol("documentSymbolProvider.onDidChange",this._languageFeaturesService.documentSymbolProvider.onDidChange),o=Ol("_textModel.onDidChangeContent",st.debounce(r=>this._textModel.onDidChangeContent(r),()=>{},100));this._register(Ja((r,s)=>lpt(this,void 0,void 0,function*(){n.read(r),o.read(r);const a=s.add(new $gt),l=yield nm.create(this._languageFeaturesService.documentSymbolProvider,this._textModel,a.token);s.isDisposed||this._currentModel.set(l,void 0)})))}getBreadcrumbItems(e,t){const n=this._currentModel.read(t);if(!n)return[];const o=n.asListOfDocumentSymbols().filter(r=>e.contains(r.range.startLineNumber)&&!e.contains(r.range.endLineNumber));return o.sort(n_e(Nc(r=>r.range.endLineNumber-r.range.startLineNumber,zg))),o.map(r=>({name:r.name,kind:r.kind,startLineNumber:r.range.startLineNumber}))}};Y$=ACe([PCe(0,pt)],Y$);class Gae extends RCe{constructor(e,t,n,o,r,s,a,l){const c=Or("div.diff-hidden-lines-widget");super(e,t,c.root),this._editor=e,this._unchangedRegion=n,this._unchangedRegionRange=o,this.hide=r,this._modifiedOutlineSource=s,this._revealModifiedHiddenLine=a,this._options=l,this._nodes=Or("div.diff-hidden-lines",[Or("div.top@top",{title:C("diff.hiddenLines.top","Click or drag to show more above")}),Or("div.center@content",{style:{display:"flex"}},[Or("div@first",{style:{display:"flex",justifyContent:"center",alignItems:"center",flexShrink:"0"}},[He("a",{title:C("showAll","Show all"),role:"button",onclick:()=>{this._unchangedRegion.showAll(void 0)}},...Zm("$(unfold)"))]),Or("div@others",{style:{display:"flex",justifyContent:"center",alignItems:"center"}})]),Or("div.bottom@bottom",{title:C("diff.bottom","Click or drag to show more below"),role:"button"})]),c.root.appendChild(this._nodes.root);const u=$r(this._editor.onDidLayoutChange,()=>this._editor.getLayoutInfo());this.hide?jr(this._nodes.first):this._register(ev(this._nodes.first,{width:u.map(h=>h.contentLeft)}));const d=this._editor;this._register(ke(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 f=h.clientY;let g=!1;const p=this._unchangedRegion.visibleLineCountTop.get();this._unchangedRegion.isDragged.set(!0,void 0);const v=ke(window,"mousemove",_=>{const y=_.clientY-f;g=g||Math.abs(y)>2;const L=Math.round(y/d.getOption(66)),D=Math.max(0,Math.min(p+L,this._unchangedRegion.getMaxVisibleLineCountTop()));this._unchangedRegion.visibleLineCountTop.set(D,void 0)}),m=ke(window,"mouseup",_=>{g||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(!1,void 0),v.dispose(),m.dispose()})})),this._register(ke(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 f=h.clientY;let g=!1;const p=this._unchangedRegion.visibleLineCountBottom.get();this._unchangedRegion.isDragged.set(!0,void 0);const v=ke(window,"mousemove",_=>{const y=_.clientY-f;g=g||Math.abs(y)>2;const L=Math.round(y/d.getOption(66)),D=Math.max(0,Math.min(p-L,this._unchangedRegion.getMaxVisibleLineCountBottom())),E=d.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);this._unchangedRegion.visibleLineCountBottom.set(D,void 0);const I=d.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);d.setScrollTop(d.getScrollTop()+(I-E))}),m=ke(window,"mouseup",_=>{if(this._unchangedRegion.isDragged.set(!1,void 0),!g){const w=d.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);this._unchangedRegion.showMoreBelow(this._options.hideUnchangedRegionsRevealLineCount.get(),void 0);const y=d.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);d.setScrollTop(d.getScrollTop()+(y-w))}this._nodes.bottom.classList.toggle("dragging",!1),this._nodes.root.classList.toggle("dragging",!1),v.dispose(),m.dispose()})})),this._register(Ii(h=>{const f=[];if(!this.hide){const g=n.getHiddenModifiedRange(h).length,p=C("hiddenLines","{0} hidden lines",g),v=He("span",{title:C("diff.hiddenLines.expandAll","Double click to unfold")},p);v.addEventListener("dblclick",w=>{w.button===0&&(w.preventDefault(),this._unchangedRegion.showAll(void 0))}),f.push(v);const m=this._unchangedRegion.getHiddenModifiedRange(h),_=this._modifiedOutlineSource.getBreadcrumbItems(m,h);if(_.length>0){f.push(He("span",void 0,"\xA0\xA0|\xA0\xA0"));for(let w=0;w<_.length;w++){const y=_[w],L=FA.toIcon(y.kind),D=Or("div.breadcrumb-item",{style:{display:"flex",alignItems:"center"}},[JH(L),"\xA0",y.name,...w===_.length-1?[]:[JH(Xe.chevronRight)]]).root;f.push(D),D.onclick=()=>{this._revealModifiedHiddenLine(y.startLineNumber)}}}}jr(this._nodes.others,...f)}))}}class Yd{static capture(e){if(e.getScrollTop()===0||e.hasPendingScrollAnimation())return new Yd(e.getScrollTop(),e.getContentHeight(),null,0,null);let t=null,n=0;const o=e.getVisibleRanges();if(o.length>0){t=o[0].getStartPosition();const r=e.getTopForPosition(t.lineNumber,t.column);n=e.getScrollTop()-r}return new Yd(e.getScrollTop(),e.getContentHeight(),t,n,e.getPosition())}constructor(e,t,n,o,r){this._initialScrollTop=e,this._initialContentHeight=t,this._visiblePosition=n,this._visiblePositionScrollDelta=o,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 n=e.getTopForLineNumber(t.lineNumber)-e.getTopForLineNumber(this._cursorPosition.lineNumber);e.setScrollTop(e.getScrollTop()+n)}}var cpt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Xae=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},upt=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},A_;let tO=A_=class{constructor(e,t,n){this.editorWorkerService=t,this.telemetryService=n,this.onDidChangeEventEmitter=new le,this.onDidChange=this.onDidChangeEventEmitter.event,this.diffAlgorithm="advanced",this.diffAlgorithmOnDidChangeSubscription=void 0,this.setOptions(e)}dispose(){var e;(e=this.diffAlgorithmOnDidChangeSubscription)===null||e===void 0||e.dispose()}computeDiff(e,t,n,o){var r,s;return upt(this,void 0,void 0,function*(){if(typeof this.diffAlgorithm!="string")return this.diffAlgorithm.computeDiff(e,t,n,o);if(e.getLineCount()===1&&e.getLineMaxColumn(1)===1)return t.getLineCount()===1&&t.getLineMaxColumn(1)===1?{changes:[],identical:!0,quitEarly:!1,moves:[]}:{changes:[new Vc(new ln(1,2),new ln(1,t.getLineCount()+1),[new xv(e.getFullModelRange(),t.getFullModelRange())])],identical:!1,quitEarly:!1,moves:[]};const a=JSON.stringify([e.uri.toString(),t.uri.toString()]),l=JSON.stringify([e.id,t.id,e.getAlternativeVersionId(),t.getAlternativeVersionId(),JSON.stringify(n)]),c=A_.diffCache.get(a);if(c&&c.context===l)return c.result;const u=xs.create(),d=yield this.editorWorkerService.computeDiff(e.uri,t.uri,n,this.diffAlgorithm),h=u.elapsed();if(this.telemetryService.publicLog2("diffEditor.computeDiff",{timeMs:h,timedOut:(r=d==null?void 0:d.quitEarly)!==null&&r!==void 0?r:!0,detectedMoves:n.computeMoves?(s=d==null?void 0:d.moves.length)!==null&&s!==void 0?s:0:-1}),o.isCancellationRequested)return{changes:[],identical:!1,quitEarly:!0,moves:[]};if(!d)throw new Error("no diff result available");return A_.diffCache.size>10&&A_.diffCache.delete(A_.diffCache.keys().next().value),A_.diffCache.set(a,{result:d,context:l}),d})}setOptions(e){var t;let n=!1;e.diffAlgorithm&&this.diffAlgorithm!==e.diffAlgorithm&&((t=this.diffAlgorithmOnDidChangeSubscription)===null||t===void 0||t.dispose(),this.diffAlgorithmOnDidChangeSubscription=void 0,this.diffAlgorithm=e.diffAlgorithm,typeof e.diffAlgorithm!="string"&&(this.diffAlgorithmOnDidChangeSubscription=e.diffAlgorithm.onDidChange(()=>this.onDidChangeEventEmitter.fire())),n=!0),n&&this.onDidChangeEventEmitter.fire()}};tO.diffCache=new Map;tO=A_=cpt([Xae(1,Gu),Xae(2,ec)],tO);var dpt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},hpt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const OCe=wn("diffProviderFactoryService");let Z$=class{constructor(e){this.instantiationService=e}createDiffProvider(e,t){return this.instantiationService.createInstance(tO,t)}};Z$=dpt([hpt(0,$t)],Z$);Mn(OCe,Z$,1);var fpt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},gpt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},Yae=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};let Q$=class extends _e{setActiveMovedText(e){this._activeMovedText.set(e,void 0)}constructor(e,t,n,o){super(),this.model=e,this._options=t,this._editor=n,this._diffProviderFactoryService=o,this._isDiffUpToDate=Ai(this,!1),this.isDiffUpToDate=this._isDiffUpToDate,this._diff=Ai(this,void 0),this.diff=this._diff,this._unchangedRegions=Ai(this,{regions:[],originalDecorationIds:[],modifiedDecorationIds:[]}),this.unchangedRegions=In(this,l=>this._options.hideUnchangedRegions.read(l)?this._unchangedRegions.read(l).regions:(qi(c=>{for(const u of this._unchangedRegions.get().regions)u.collapseAll(c)}),[])),this.movedTextToCompare=Ai(this,void 0),this._activeMovedText=Ai(this,void 0),this._hoveredMovedText=Ai(this,void 0),this.activeMovedText=In(this,l=>{var c,u;return(u=(c=this.movedTextToCompare.read(l))!==null&&c!==void 0?c:this._hoveredMovedText.read(l))!==null&&u!==void 0?u:this._activeMovedText.read(l)}),this._cancellationTokenSource=new Ro,this._diffProvider=In(this,l=>{const c=this._diffProviderFactoryService.createDiffProvider(this._editor,{diffAlgorithm:this._options.diffAlgorithm.read(l)}),u=Ol("onDidChange",c.onDidChange);return{diffProvider:c,onChangeSignal:u}}),this._register(zt(()=>this._cancellationTokenSource.cancel()));const r=TCe("contentChangedSignal"),s=this._register(new bi(()=>r.trigger(void 0),200)),a=(l,c,u)=>{const d=nO.fromDiffs(l.changes,e.original.getLineCount(),e.modified.getLineCount(),this._options.hideUnchangedRegionsMinimumLineCount.read(u),this._options.hideUnchangedRegionsContextLineCount.read(u)),h=this._unchangedRegions.get(),f=h.originalDecorationIds.map(m=>e.original.getDecorationRange(m)).filter(m=>!!m).map(m=>ln.fromRange(m)),g=h.modifiedDecorationIds.map(m=>e.modified.getDecorationRange(m)).filter(m=>!!m).map(m=>ln.fromRange(m)),p=e.original.deltaDecorations(h.originalDecorationIds,d.map(m=>({range:m.originalUnchangedRange.toInclusiveRange(),options:{description:"unchanged"}}))),v=e.modified.deltaDecorations(h.modifiedDecorationIds,d.map(m=>({range:m.modifiedUnchangedRange.toInclusiveRange(),options:{description:"unchanged"}})));for(const m of d)for(let _=0;_{if(this._diff.get()){const u=Wg.fromModelContentChanges(l.changes);this._lastDiff,e.original,e.modified}s.schedule()})),this._register(e.original.onDidChangeContent(l=>{if(this._diff.get()){const u=Wg.fromModelContentChanges(l.changes);this._lastDiff,e.original,e.modified}s.schedule()})),this._register(Ja((l,c)=>Yae(this,void 0,void 0,function*(){var u,d;this._options.hideUnchangedRegionsMinimumLineCount.read(l),this._options.hideUnchangedRegionsContextLineCount.read(l),s.cancel(),r.read(l);const h=this._diffProvider.read(l);h.onChangeSignal.read(l),tm(F0e,l),tm(tH,l),this._isDiffUpToDate.set(!1,void 0);let f=[];c.add(e.original.onDidChangeContent(v=>{const m=Wg.fromModelContentChanges(v.changes);f=gP(f,m)}));let g=[];c.add(e.modified.onDidChangeContent(v=>{const m=Wg.fromModelContentChanges(v.changes);g=gP(g,m)}));let p=yield h.diffProvider.computeDiff(e.original,e.modified,{ignoreTrimWhitespace:this._options.ignoreTrimWhitespace.read(l),maxComputationTimeMs:this._options.maxComputationTimeMs.read(l),computeMoves:this._options.showMoves.read(l)},this._cancellationTokenSource.token);this._cancellationTokenSource.token.isCancellationRequested||(p=ppt(p,e.original,e.modified),p=(u=(e.original,e.modified,void 0))!==null&&u!==void 0?u:p,p=(d=(e.original,e.modified,void 0))!==null&&d!==void 0?d:p,qi(v=>{a(p,v),this._lastDiff=p;const m=WX.fromDiffResult(p);this._diff.set(m,v),this._isDiffUpToDate.set(!0,v);const _=this.movedTextToCompare.get();this.movedTextToCompare.set(_?this._lastDiff.moves.find(w=>w.lineRangeMapping.modified.intersect(_.lineRangeMapping.modified)):void 0,v)}))})))}ensureModifiedLineIsVisible(e,t){var n;if(((n=this.diff.get())===null||n===void 0?void 0:n.mappings.length)===0)return;const o=this._unchangedRegions.get().regions;for(const r of o)if(r.getHiddenModifiedRange(void 0).contains(e)){r.showModifiedLine(e,t);return}}ensureOriginalLineIsVisible(e,t){var n;if(((n=this.diff.get())===null||n===void 0?void 0:n.mappings.length)===0)return;const o=this._unchangedRegions.get().regions;for(const r of o)if(r.getHiddenOriginalRange(void 0).contains(e)){r.showOriginalLine(e,t);return}}waitForDiff(){return Yae(this,void 0,void 0,function*(){yield Mgt(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(o=>ln.deserialize(o.range)),n=this._unchangedRegions.get();qi(o=>{for(const r of n.regions)for(const s of t)if(r.modifiedUnchangedRange.intersect(s)){r.setHiddenModifiedRange(s,o);break}})}};Q$=fpt([gpt(3,OCe)],Q$);function ppt(i,e,t){return{changes:i.changes.map(n=>new Vc(n.original,n.modified,n.innerChanges?n.innerChanges.map(o=>mpt(o,e,t)):void 0)),moves:i.moves,identical:i.identical,quitEarly:i.quitEarly}}function mpt(i,e,t){let n=i.originalRange,o=i.modifiedRange;return(n.endColumn!==1||o.endColumn!==1)&&n.endColumn===e.getLineMaxColumn(n.endLineNumber)&&o.endColumn===t.getLineMaxColumn(o.endLineNumber)&&n.endLineNumbernew FCe(t)),e.moves||[],e.identical,e.quitEarly)}constructor(e,t,n,o){this.mappings=e,this.movedTexts=t,this.identical=n,this.quitEarly=o}}class FCe{constructor(e){this.lineRangeMapping=e}}class nO{static fromDiffs(e,t,n,o,r){const s=Vc.inverse(e,t,n),a=[];for(const l of s){let c=l.original.startLineNumber,u=l.modified.startLineNumber,d=l.original.length;const h=c===1&&u===1,f=c+d===t+1&&u+d===n+1;(h||f)&&d>=r+o?(h&&!f&&(d-=r),f&&!h&&(c+=r,u+=r,d-=r),a.push(new nO(c,u,d,0,0))):d>=r*2+o&&(c+=r,u+=r,d-=r*2,a.push(new nO(c,u,d,0,0)))}return a}get originalUnchangedRange(){return ln.ofLength(this.originalLineNumber,this.lineCount)}get modifiedUnchangedRange(){return ln.ofLength(this.modifiedLineNumber,this.lineCount)}constructor(e,t,n,o,r){this.originalLineNumber=e,this.modifiedLineNumber=t,this.lineCount=n,this._visibleLineCountTop=Ai(this,0),this.visibleLineCountTop=this._visibleLineCountTop,this._visibleLineCountBottom=Ai(this,0),this.visibleLineCountBottom=this._visibleLineCountBottom,this._shouldHideControls=In(this,s=>this.visibleLineCountTop.read(s)+this.visibleLineCountBottom.read(s)===this.lineCount&&!this.isDragged.read(s)),this.isDragged=Ai(this,!1),this._visibleLineCountTop.set(o,void 0),this._visibleLineCountBottom.set(r,void 0)}shouldHideControls(e){return this._shouldHideControls.read(e)}getHiddenOriginalRange(e){return ln.ofLength(this.originalLineNumber+this._visibleLineCountTop.read(e),this.lineCount-this._visibleLineCountTop.read(e)-this._visibleLineCountBottom.read(e))}getHiddenModifiedRange(e){return ln.ofLength(this.modifiedLineNumber+this._visibleLineCountTop.read(e),this.lineCount-this._visibleLineCountTop.read(e)-this._visibleLineCountBottom.read(e))}setHiddenModifiedRange(e,t){const n=e.startLineNumber-this.modifiedLineNumber,o=this.modifiedLineNumber+this.lineCount-e.endLineNumberExclusive;this.setState(n,o,t)}getMaxVisibleLineCountTop(){return this.lineCount-this._visibleLineCountBottom.get()}getMaxVisibleLineCountBottom(){return this.lineCount-this._visibleLineCountTop.get()}showMoreAbove(e=10,t){const n=this.getMaxVisibleLineCountTop();this._visibleLineCountTop.set(Math.min(this._visibleLineCountTop.get()+e,n),t)}showMoreBelow(e=10,t){const n=this.lineCount-this._visibleLineCountTop.get();this._visibleLineCountBottom.set(Math.min(this._visibleLineCountBottom.get()+e,n),t)}showAll(e){this._visibleLineCountBottom.set(this.lineCount-this._visibleLineCountTop.get(),e)}showModifiedLine(e,t){const n=e+1-(this.modifiedLineNumber+this._visibleLineCountTop.get()),o=this.modifiedLineNumber-this._visibleLineCountBottom.get()+this.lineCount-e;n{var v;this._contextMenuService.showContextMenu({domForShadowRoot:h&&(v=n.getDomNode())!==null&&v!==void 0?v:void 0,getAnchor:()=>({x:g,y:p}),getActions:()=>{const m=[],_=o.modified.isEmpty;return m.push(new la("diff.clipboard.copyDeletedContent",_?o.original.length>1?C("diff.clipboard.copyDeletedLinesContent.label","Copy deleted lines"):C("diff.clipboard.copyDeletedLinesContent.single.label","Copy deleted line"):o.original.length>1?C("diff.clipboard.copyChangedLinesContent.label","Copy changed lines"):C("diff.clipboard.copyChangedLinesContent.single.label","Copy changed line"),void 0,!0,()=>G9(this,void 0,void 0,function*(){const y=this._originalTextModel.getValueInRange(o.original.toExclusiveRange());yield this._clipboardService.writeText(y)}))),o.original.length>1&&m.push(new la("diff.clipboard.copyDeletedLineContent",_?C("diff.clipboard.copyDeletedLineContent.label","Copy deleted line ({0})",o.original.startLineNumber+d):C("diff.clipboard.copyChangedLineContent.label","Copy changed line ({0})",o.original.startLineNumber+d),void 0,!0,()=>G9(this,void 0,void 0,function*(){let y=this._originalTextModel.getLineContent(o.original.startLineNumber+d);y===""&&(y=this._originalTextModel.getEndOfLineSequence()===0?` +`}};U$=e_([Vr(0,En)],U$);class Igt{publicLog2(){}}class Ek{constructor(){const e=Rt.from({scheme:Ek.SCHEME,authority:"model",path:"/"});this.workspace={id:x1e,folders:[new eut({uri:e,name:"",index:0})]}}getWorkspace(){return this.workspace}getWorkspaceFolder(e){return e&&e.scheme===Ek.SCHEME?this.workspace.folders[0]:null}}Ek.SCHEME="inmemory";function QP(i,e,t){if(!e||!(i instanceof MCe))return;const n=[];Object.keys(e).forEach(o=>{Tct(o)&&n.push([`editor.${o}`,e[o]]),t&&Nct(o)&&n.push([`diffEditor.${o}`,e[o]])}),n.length>0&&i.updateValues(n)}let j$=class{constructor(e){this._modelService=e}hasPreviewHandler(){return!1}apply(e,t){return Fy(this,void 0,void 0,function*(){const n=Array.isArray(e)?e:oX.convert(e),o=new Map;for(const a of n){if(!(a instanceof qg))throw new Error("bad edit - only text edits are supported");const l=this._modelService.getModel(a.resource);if(!l)throw new Error("bad edit - model not found");if(typeof a.versionId=="number"&&l.getVersionId()!==a.versionId)throw new Error("bad state - model changed in the meantime");let c=o.get(l);c||(c=[],o.set(l,c)),c.push(Gi.replaceMove(V.lift(a.textEdit.range),a.textEdit.text))}let r=0,s=0;for(const[a,l]of o)a.pushStackElement(),a.pushEditOperations([],l,()=>[]),a.pushStackElement(),s+=1,r+=l.length;return{ariaSummary:X0(XH.bulkEditServiceSummary,r,s),isApplied:r>0}})}};j$=e_([Vr(0,Yi)],j$);class Tgt{getUriLabel(e,t){return e.scheme==="file"?e.fsPath:e.path}getUriBasenameLabel(e){return $c(e)}}let K$=class extends YH{constructor(e,t){super(e),this._codeEditorService=t}showContextView(e,t,n){if(!t){const o=this._codeEditorService.getFocusedCodeEditor()||this._codeEditorService.getActiveCodeEditor();o&&(t=o.getContainerDomNode())}return super.showContextView(e,t,n)}};K$=e_([Vr(0,SS),Vr(1,Jn)],K$);class Ngt{constructor(){this._neverEmitter=new le,this.onDidChangeTrust=this._neverEmitter.event}isWorkspaceTrusted(){return!0}}class Rgt extends gk{constructor(){super()}}class Mgt extends wgt{constructor(){super(new eQe)}}let q$=class extends g${constructor(e,t,n,o,r,s){super(e,t,n,o,r,s),this.configure({blockMouse:!1})}};q$=e_([Vr(0,tc),Vr(1,Ao),Vr(2,_p),Vr(3,xi),Vr(4,If),Vr(5,Ut)],q$);class Agt{playAudioCue(e,t){return Fy(this,void 0,void 0,function*(){})}}Mn(En,MCe,0);Mn(fG,z$,0);Mn(q0e,U$,0);Mn(ib,Ek,0);Mn(Tw,Tgt,0);Mn(tc,Igt,0);Mn(tT,Dgt,0);Mn(tX,Egt,0);Mn(Ao,Lk,0);Mn(Rf,tm,0);Mn(Ki,Rgt,0);Mn(ic,ngt,0);Mn(nc,Mgt,0);Mn(Yi,$P,0);Mn(bG,b$,0);Mn(Ut,V$,0);Mn(S1e,Lgt,0);Mn(Jv,X5,0);Mn(Gu,$dt,0);Mn(Xu,sH,0);Mn(nT,j$,0);Mn(L1e,Ngt,0);Mn(za,H$,0);Mn(vp,P$,0);Mn(Xc,oft,0);Mn(_o,$$,0);Mn(xi,Fw,0);Mn(uh,M$,0);Mn(_p,K$,0);Mn(ml,_$,0);Mn(yp,W$,0);Mn(Ku,q$,0);Mn(If,O$,0);Mn(uT,Agt,0);var Vt;(function(i){const e=new L5;for(const[l,c]of Voe())e.set(l,c);const t=new ZP(e,!0);e.set($t,t);function n(l){o||s({});const c=e.get(l);if(!c)throw new Error("Missing service "+l);return c instanceof Ih?t.invokeFunction(u=>u.get(l)):c}i.get=n;let o=!1;const r=new le;function s(l){if(o)return t;o=!0;for(const[u,d]of Voe())e.get(u)||e.set(u,d);for(const u in l)if(l.hasOwnProperty(u)){const d=yn(u);e.get(d)instanceof Ih&&e.set(d,l[u])}const c=Sgt();for(const u of c)try{t.createInstance(u)}catch(d){en(d)}return r.fire(),t}i.initialize=s;function a(l){if(o)return l();const c=new Be,u=c.add(r.event(()=>{u.dispose(),c.add(l())}));return c}i.withServices=a})(Vt||(Vt={}));let Pgt;function Xg(){return Pgt}let ACe;function Ogt(i){ACe=i}class PCe{get TChange(){return null}reportChanges(){this.get()}read(e){return e?e.readObservable(this):this.get()}map(e,t){const n=t===void 0?void 0:e,o=t===void 0?e:t;return ACe({owner:n,debugName:()=>{const r=Xb(o);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(o.toString());if(a)return`${this.debugName}.${a[2]}`;if(!n)return`${this.debugName} (mapped)`}},r=>o(this.read(r),r))}}class dT extends PCe{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 qi(i,e){const t=new OCe(i,e);try{i(t)}finally{t.finish()}}function G$(i,e,t){i?e(i):qi(e,t)}class OCe{constructor(e,t){var n;this._fn=e,this._getDebugName=t,this.updatingObservers=[],(n=Xg())===null||n===void 0||n.handleBeginTransaction(this)}getDebugName(){return this._getDebugName?this._getDebugName():Xb(this._fn)}updateObserver(e,t){this.updatingObservers.push({observer:e,observable:t}),e.beginUpdate(t)}finish(){var e;const t=this.updatingObservers;this.updatingObservers=null;for(const{observer:n,observable:o}of t)n.endUpdate(o);(e=Xg())===null||e===void 0||e.handleEndTransaction()}}function HX(i,e,t,n){let o;if(i!==void 0)if(typeof i=="function"){if(o=i(),o!==void 0)return o}else return i;if(e!==void 0&&(o=Xb(e),o!==void 0))return o;if(t!==void 0){for(const r in t)if(t[r]===n)return r}}function Xb(i){const e=i.toString(),n=/\/\*\*\s*@description\s*([^*]*)\*\//.exec(e),o=n?n[1]:void 0;return o==null?void 0:o.trim()}function Ai(i,e){return typeof i=="string"?new X$(void 0,i,e):new X$(i,void 0,e)}class X$ extends dT{get debugName(){var e;return(e=HX(this._debugName,void 0,this._owner,this))!==null&&e!==void 0?e:"ObservableValue"}constructor(e,t,n){super(),this._owner=e,this._debugName=t,this._value=n}get(){return this._value}set(e,t,n){var o;if(this._value===e)return;let r;t||(t=r=new OCe(()=>{},()=>`Setting ${this.debugName}`));try{const s=this._value;this._setValue(e),(o=Xg())===null||o===void 0||o.handleObservableChanged(this,{oldValue:s,newValue:e,change:n,didChange:!0,hadValue:!0});for(const a of this.observers)t.updateObserver(a,this),a.handleChange(this,n)}finally{r&&r.finish()}}toString(){return`${this.debugName}: ${this._value}`}_setValue(e){this._value=e}}function JP(i,e){return typeof i=="string"?new jae(void 0,i,e):new jae(i,void 0,e)}class jae extends X${_setValue(e){this._value!==e&&(this._value&&this._value.dispose(),this._value=e)}dispose(){var e;(e=this._value)===null||e===void 0||e.dispose()}}const Dk=(i,e)=>i===e;function In(i,e){return e!==void 0?new Ik(i,void 0,e,void 0,void 0,void 0,Dk):new Ik(void 0,void 0,i,void 0,void 0,void 0,Dk)}function Kae(i,e){var t;return new Ik(i.owner,i.debugName,e,void 0,void 0,void 0,(t=i.equalityComparer)!==null&&t!==void 0?t:Dk)}function Fgt(i,e){var t;return new Ik(i.owner,i.debugName,e,i.createEmptyChangeSummary,i.handleChange,void 0,(t=i.equalityComparer)!==null&&t!==void 0?t:Dk)}function kk(i,e){let t,n;e===void 0?(t=i,n=void 0):(n=i,t=e);const o=new Be;return new Ik(n,()=>{var r;return(r=Xb(t))!==null&&r!==void 0?r:"(anonymous)"},r=>(o.clear(),t(r,o)),void 0,void 0,()=>o.dispose(),Dk)}Ogt(In);class Ik extends dT{get debugName(){var e;return(e=HX(this._debugName,this._computeFn,this._owner,this))!==null&&e!==void 0?e:"(anonymous)"}constructor(e,t,n,o,r,s=void 0,a){var l,c;super(),this._owner=e,this._debugName=t,this._computeFn=n,this.createChangeSummary=o,this._handleChange=r,this._handleLastObserverRemoved=s,this._equalityComparator=a,this.state=0,this.value=void 0,this.updateCount=0,this.dependencies=new Set,this.dependenciesToBeRemoved=new Set,this.changeSummary=void 0,this.changeSummary=(l=this.createChangeSummary)===null||l===void 0?void 0:l.call(this),(c=Xg())===null||c===void 0||c.handleDerivedCreated(this)}onLastObserverRemoved(){var e;this.state=0,this.value=void 0;for(const t of this.dependencies)t.removeObserver(this);this.dependencies.clear(),(e=this._handleLastObserverRemoved)===null||e===void 0||e.call(this)}get(){var e;if(this.observers.size===0){const t=this._computeFn(this,(e=this.createChangeSummary)===null||e===void 0?void 0:e.call(this));return this.onLastObserverRemoved(),t}else{do{if(this.state===1){for(const t of this.dependencies)if(t.reportChanges(),this.state===2)break}this.state===1&&(this.state=3),this._recomputeIfNeeded()}while(this.state!==3);return this.value}}_recomputeIfNeeded(){var e,t;if(this.state===3)return;const n=this.dependenciesToBeRemoved;this.dependenciesToBeRemoved=this.dependencies,this.dependencies=n;const o=this.state!==0,r=this.value;this.state=3;const s=this.changeSummary;this.changeSummary=(e=this.createChangeSummary)===null||e===void 0?void 0:e.call(this);try{this.value=this._computeFn(this,s)}finally{for(const l of this.dependenciesToBeRemoved)l.removeObserver(this);this.dependenciesToBeRemoved.clear()}const a=o&&!this._equalityComparator(r,this.value);if((t=Xg())===null||t===void 0||t.handleDerivedRecomputed(this,{oldValue:r,newValue:this.value,change:void 0,didChange:a,hadValue:o}),a)for(const l of this.observers)l.handleChange(this,void 0)}toString(){return`LazyDerived<${this.debugName}>`}beginUpdate(e){this.updateCount++;const t=this.updateCount===1;if(this.state===3&&(this.state=1,!t))for(const n of this.observers)n.handlePossibleChange(this);if(t)for(const n of this.observers)n.beginUpdate(this)}endUpdate(e){if(this.updateCount--,this.updateCount===0){const t=[...this.observers];for(const n of t)n.endUpdate(this)}if(this.updateCount<0)throw new Vo}handlePossibleChange(e){if(this.state===3&&this.dependencies.has(e)&&!this.dependenciesToBeRemoved.has(e)){this.state=1;for(const t of this.observers)t.handlePossibleChange(this)}}handleChange(e,t){if(this.dependencies.has(e)&&!this.dependenciesToBeRemoved.has(e)){const n=this._handleChange?this._handleChange({changedObservable:e,change:t,didChange:r=>r===e},this.changeSummary):!0,o=this.state===3;if(n&&(this.state===1||o)&&(this.state=2,o))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)}}function $X(i,e){return new Z5(i.debugName,e,void 0,void 0)}function Ii(i){return new Z5(void 0,i,void 0,void 0)}function Y5(i,e){return new Z5(i.debugName,e,i.createEmptyChangeSummary,i.handleChange)}function Ja(i){const e=new Be,t=$X({debugName:()=>Xb(i)||"(anonymous)"},n=>{e.clear(),i(n,e)});return zt(()=>{t.dispose(),e.dispose()})}class Z5{get debugName(){if(typeof this._debugName=="string")return this._debugName;if(typeof this._debugName=="function"){const t=this._debugName();if(t!==void 0)return t}const e=Xb(this._runFn);return e!==void 0?e:"(anonymous)"}constructor(e,t,n,o){var r,s;this._debugName=e,this._runFn=t,this.createChangeSummary=n,this._handleChange=o,this.state=2,this.updateCount=0,this.disposed=!1,this.dependencies=new Set,this.dependenciesToBeRemoved=new Set,this.changeSummary=(r=this.createChangeSummary)===null||r===void 0?void 0:r.call(this),(s=Xg())===null||s===void 0||s.handleAutorunCreated(this),this._runIfNeeded()}dispose(){this.disposed=!0;for(const e of this.dependencies)e.removeObserver(this);this.dependencies.clear()}_runIfNeeded(){var e,t,n;if(this.state===3)return;const o=this.dependenciesToBeRemoved;this.dependenciesToBeRemoved=this.dependencies,this.dependencies=o,this.state=3;try{if(!this.disposed){(e=Xg())===null||e===void 0||e.handleAutorunTriggered(this);const r=this.changeSummary;this.changeSummary=(t=this.createChangeSummary)===null||t===void 0?void 0:t.call(this),this._runFn(this,r)}}finally{(n=Xg())===null||n===void 0||n.handleAutorunFinished(this);for(const r of this.dependenciesToBeRemoved)r.removeObserver(this);this.dependenciesToBeRemoved.clear()}}toString(){return`Autorun<${this.debugName}>`}beginUpdate(){this.state===3&&(this.state=1),this.updateCount++}endUpdate(){if(this.updateCount===1)do{if(this.state===1){this.state=3;for(const e of this.dependencies)if(e.reportChanges(),this.state===2)break}this._runIfNeeded()}while(this.state!==3);this.updateCount--,PD(()=>this.updateCount>=0)}handlePossibleChange(e){this.state===3&&this.dependencies.has(e)&&!this.dependenciesToBeRemoved.has(e)&&(this.state=1)}handleChange(e,t){this.dependencies.has(e)&&!this.dependenciesToBeRemoved.has(e)&&(this._handleChange?this._handleChange({changedObservable:e,change:t,didChange:o=>o===e},this.changeSummary):!0)&&(this.state=2)}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(i){i.Observer=Z5})(Ii||(Ii={}));function eO(i){return new Bgt(i)}class Bgt extends PCe{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 Wgt(i,e){return new Promise(t=>{let n=!1,o=!1;const r=Ii(s=>{const a=i.read(s);e(a)&&(n?r.dispose():o=!0,t(a))});n=!0,o&&r.dispose()})}function $r(i,e){return new FCe(i,e)}class FCe extends dT{constructor(e,t){super(),this.event=e,this._getValue=t,this.hasValue=!1,this.handleEvent=n=>{var o;const r=this._getValue(n),s=!this.hasValue||this.value!==r;(o=Xg())===null||o===void 0||o.handleFromEventObservableTriggered(this,{oldValue:this.value,newValue:r,change:void 0,didChange:s,hadValue:this.hasValue}),s&&(this.value=r,this.hasValue&&qi(a=>{for(const l of this.observers)a.updateObserver(l,this),l.handleChange(this,void 0)},()=>{const a=this.getDebugName();return"Event fired"+(a?`: ${a}`:"")}),this.hasValue=!0)}}getDebugName(){return Xb(this._getValue)}get debugName(){const e=this.getDebugName();return"From Event"+(e?`: ${e}`:"")}onFirstObserverAdded(){this.subscription=this.event(this.handleEvent)}onLastObserverRemoved(){this.subscription.dispose(),this.subscription=void 0,this.hasValue=!1,this.value=void 0}get(){return this.subscription?(this.hasValue||this.handleEvent(void 0),this.value):this._getValue(void 0)}}(function(i){i.Observer=FCe})($r||($r={}));function Fl(i,e){return new Vgt(i,e)}class Vgt extends dT{constructor(e,t){super(),this.debugName=e,this.event=t,this.handleEvent=()=>{qi(n=>{for(const o of this.observers)n.updateObserver(o,this),o.handleChange(this,void 0)},()=>this.debugName)}}onFirstObserverAdded(){this.subscription=this.event(this.handleEvent)}onLastObserverRemoved(){this.subscription.dispose(),this.subscription=void 0}get(){}}function BCe(i){return typeof i=="string"?new qae(i):new qae(void 0,i)}class qae extends dT{get debugName(){var e;return(e=HX(this._debugName,void 0,this._owner,this))!==null&&e!==void 0?e:"Observable Signal"}constructor(e,t){super(),this._debugName=e,this._owner=t}trigger(e,t){if(!e){qi(n=>{this.trigger(n,t)},()=>`Trigger signal ${this.debugName}`);return}for(const n of this.observers)e.updateObserver(n,this),n.handleChange(this,t)}get(){}}function Tk(i){const e=new Hgt(!0);return i.addObserver(e),i.reportChanges(),zt(()=>{i.removeObserver(e)})}class Hgt{constructor(e){this.forceRecompute=e,this.counter=0}beginUpdate(e){this.counter++}endUpdate(e){this.counter--,this.counter===0&&this.forceRecompute&&e.reportChanges()}handlePossibleChange(e){}handleChange(e,t){}}function WCe(){return!!I_e.VSCODE_DEV}function $gt(i){if(WCe()){const e=zgt();return e.add(i),{dispose(){e.delete(i)}}}else return{dispose(){}}}function zgt(){H2||(H2=new Set);const i=globalThis;return i.$hotReload_applyNewExports||(i.$hotReload_applyNewExports=e=>{for(const t of H2){const n=t(e);if(n)return n}}),H2}let H2;function Ugt(i,e,t,n){if(i.length===0)return e;if(e.length===0)return i;const o=[];let r=0,s=0;for(;ru?(o.push(l),s++):(o.push(n(a,l)),r++,s++)}for(;r`Apply decorations from ${e.debugName}`},o=>{const r=e.read(o);n.set(r)})),t.add({dispose:()=>{n.clear()}}),t}function $2(i,e){return i.appendChild(e),zt(()=>{i.removeChild(e)})}class jgt extends _e{get width(){return this._width}get height(){return this._height}constructor(e,t){super(),this.elementSizeObserver=this._register(new ebe(e,t)),this._width=Ai(this,this.elementSizeObserver.getWidth()),this._height=Ai(this,this.elementSizeObserver.getHeight()),this._register(this.elementSizeObserver.onDidChange(n=>qi(o=>{this._width.set(this.elementSizeObserver.getWidth(),o),this._height.set(this.elementSizeObserver.getHeight(),o)})))}observe(e){this.elementSizeObserver.observe(e)}setAutomaticLayout(e){e?this.elementSizeObserver.startObserving():this.elementSizeObserver.stopObserving()}}function Gae(i,e){let t=i.get(),n=t,o=t;const r=Ai("animatedValue",t);let s=-1;const a=300;let l;e.add(Y5({createEmptyChangeSummary:()=>({animate:!1}),handleChange:(u,d)=>(u.didChange(i)&&(d.animate=d.animate||u.change),!0)},(u,d)=>{l!==void 0&&(cancelAnimationFrame(l),l=void 0),n=o,t=i.read(u),s=Date.now()-(d.animate?0:a),c()}));function c(){const u=Date.now()-s;o=Math.floor(Kgt(u,n,t-n,a)),u{this._actualTop.set(n,void 0)},this.onComputedHeight=n=>{this._actualHeight.set(n,void 0)}}}class Q5{constructor(e,t){this._editor=e,this._domElement=t,this._overlayWidgetId=`managedOverlayWidget-${Q5._counter++}`,this._overlayWidget={getId:()=>this._overlayWidgetId,getDomNode:()=>this._domElement,getPosition:()=>null},this._editor.addOverlayWidget(this._overlayWidget)}dispose(){this._editor.removeOverlayWidget(this._overlayWidget)}}Q5._counter=0;function tv(i,e){return Ii(t=>{for(let[n,o]of Object.entries(e))o&&typeof o=="object"&&"read"in o&&(o=o.read(t)),typeof o=="number"&&(o=`${o}px`),n=n.replace(/[A-Z]/g,r=>"-"+r.toLowerCase()),i.style[n]=o})}function nm(i,e){return qgt([i],e),i}function qgt(i,e){WCe()&&Fl("reload",n=>$gt(o=>{if(!![...Object.values(o)].some(r=>i.includes(r)))return r=>(n(void 0),!0)})).read(e)}function iO(i,e,t){const n=new Be,o=[];return n.add(Ii(r=>{const s=e.read(r),a=new Map,l=new Map;t&&t(!0),i.changeViewZones(c=>{for(const u of o)c.removeZone(u);o.length=0;for(const u of s){const d=c.addZone(u);o.push(d),a.set(u,d)}}),t&&t(!1),n.add(Y5({createEmptyChangeSummary(){return[]},handleChange(c,u){const d=l.get(c.changedObservable);return d!==void 0&&u.push(d),!0}},(c,u)=>{for(const d of s)d.onChange&&(l.set(d.onChange,a.get(d)),d.onChange.read(c));t&&t(!0),i.changeViewZones(d=>{for(const h of u)d.layoutZone(h)}),t&&t(!1)}))})),n.add({dispose(){t&&t(!0),i.changeViewZones(r=>{for(const s of o)r.removeZone(s)}),t&&t(!1)}}),n}class Ggt extends Ro{dispose(){super.dispose(!0)}}var zX=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},UX=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},Xgt=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};const Ygt=Eo("diff-review-insert",Xe.add,C("accessibleDiffViewerInsertIcon","Icon for 'Insert' in accessible diff viewer.")),Zgt=Eo("diff-review-remove",Xe.remove,C("accessibleDiffViewerRemoveIcon","Icon for 'Remove' in accessible diff viewer.")),Qgt=Eo("diff-review-close",Xe.close,C("accessibleDiffViewerCloseIcon","Icon for 'Close' in accessible diff viewer."));let Im=class extends _e{constructor(e,t,n,o,r,s,a,l,c){super(),this._parentNode=e,this._visible=t,this._setVisible=n,this._canClose=o,this._width=r,this._height=s,this._diffs=a,this._editors=l,this._instantiationService=c,this.model=kk(this,(u,d)=>{const h=this._visible.read(u);if(this._parentNode.style.visibility=h?"visible":"hidden",!h)return null;const f=d.add(this._instantiationService.createInstance(Y$,this._diffs,this._editors,this._setVisible,this._canClose)),g=d.add(this._instantiationService.createInstance(Z$,this._parentNode,f,this._width,this._height,this._editors));return{model:f,view:g}}),this._register(Tk(this.model))}next(){qi(e=>{const t=this._visible.get();this._setVisible(!0,e),t&&this.model.get().model.nextGroup(e)})}prev(){qi(e=>{this._setVisible(!0,e),this.model.get().model.previousGroup(e)})}close(){qi(e=>{this._setVisible(!1,e)})}};Im._ttPolicy=mp("diffReview",{createHTML:i=>i});Im=zX([UX(8,$t)],Im);let Y$=class extends _e{constructor(e,t,n,o,r){super(),this._diffs=e,this._editors=t,this._setVisible=n,this.canClose=o,this._audioCueService=r,this._groups=Ai(this,[]),this._currentGroupIdx=Ai(this,0),this._currentElementIdx=Ai(this,0),this.groups=this._groups,this.currentGroup=this._currentGroupIdx.map((s,a)=>this._groups.read(a)[s]),this.currentGroupIndex=this._currentGroupIdx,this.currentElement=this._currentElementIdx.map((s,a)=>{var l;return(l=this.currentGroup.read(a))===null||l===void 0?void 0:l.lines[s]}),this._register(Ii(s=>{const a=this._diffs.read(s);if(!a){this._groups.set([],void 0);return}const l=Jgt(a,this._editors.original.getModel().getLineCount(),this._editors.modified.getModel().getLineCount());qi(c=>{const u=this._editors.modified.getPosition();if(u){const d=l.findIndex(h=>(u==null?void 0:u.lineNumber){const a=this.currentElement.read(s);(a==null?void 0:a.type)===ea.Deleted?this._audioCueService.playAudioCue(Wn.diffLineDeleted,{source:"accessibleDiffViewer.currentElementChanged"}):(a==null?void 0:a.type)===ea.Added&&this._audioCueService.playAudioCue(Wn.diffLineInserted,{source:"accessibleDiffViewer.currentElementChanged"})})),this._register(Ii(s=>{var a;const l=this.currentElement.read(s);if(l&&l.type!==ea.Header){const c=(a=l.modifiedLineNumber)!==null&&a!==void 0?a:l.diff.modified.startLineNumber;this._editors.modified.setSelection(V.fromPositions(new ae(c,1)))}}))}_goToGroupDelta(e,t){const n=this.groups.get();!n||n.length<=1||G$(t,o=>{this._currentGroupIdx.set(Cn.ofLength(n.length).clipCyclic(this._currentGroupIdx.get()+e),o),this._currentElementIdx.set(0,o)})}nextGroup(e){this._goToGroupDelta(1,e)}previousGroup(e){this._goToGroupDelta(-1,e)}_goToLineDelta(e){const t=this.currentGroup.get();!t||t.lines.length<=1||qi(n=>{this._currentElementIdx.set(Cn.ofLength(t.lines.length).clip(this._currentElementIdx.get()+e),n)})}goToNextLine(){this._goToLineDelta(1)}goToPreviousLine(){this._goToLineDelta(-1)}goToLine(e){const t=this.currentGroup.get();if(!t)return;const n=t.lines.indexOf(e);n!==-1&&qi(o=>{this._currentElementIdx.set(n,o)})}revealCurrentElementInEditor(){this._setVisible(!1,void 0);const e=this.currentElement.get();e&&(e.type===ea.Deleted?(this._editors.original.setSelection(V.fromPositions(new ae(e.originalLineNumber,1))),this._editors.original.revealLine(e.originalLineNumber),this._editors.original.focus()):(e.type!==ea.Header&&(this._editors.modified.setSelection(V.fromPositions(new ae(e.modifiedLineNumber,1))),this._editors.modified.revealLine(e.modifiedLineNumber)),this._editors.modified.focus()))}close(){this._setVisible(!1,void 0),this._editors.modified.focus()}};Y$=zX([UX(4,uT)],Y$);const jx=3;function Jgt(i,e,t){const n=[];for(const o of r_e(i,(r,s)=>s.modified.startLineNumber-r.modified.endLineNumberExclusive<2*jx)){const r=[];r.push(new tpt);const s=new ln(Math.max(1,o[0].original.startLineNumber-jx),Math.min(o[o.length-1].original.endLineNumberExclusive+jx,e+1)),a=new ln(Math.max(1,o[0].modified.startLineNumber-jx),Math.min(o[o.length-1].modified.endLineNumberExclusive+jx,t+1));s_e(o,(u,d)=>{const h=new ln(u?u.original.endLineNumberExclusive:s.startLineNumber,d?d.original.startLineNumber:s.endLineNumberExclusive),f=new ln(u?u.modified.endLineNumberExclusive:a.startLineNumber,d?d.modified.startLineNumber:a.endLineNumberExclusive);h.forEach(g=>{r.push(new opt(g,f.startLineNumber+(g-h.startLineNumber)))}),d&&(d.original.forEach(g=>{r.push(new npt(d,g))}),d.modified.forEach(g=>{r.push(new ipt(d,g))}))});const l=o[0].modified.join(o[o.length-1].modified),c=o[0].original.join(o[o.length-1].original);n.push(new ept(new mf(l,c),r))}return n}var ea;(function(i){i[i.Header=0]="Header",i[i.Unchanged=1]="Unchanged",i[i.Deleted=2]="Deleted",i[i.Added=3]="Added"})(ea||(ea={}));class ept{constructor(e,t){this.range=e,this.lines=t}}class tpt{constructor(){this.type=ea.Header}}class npt{constructor(e,t){this.diff=e,this.originalLineNumber=t,this.type=ea.Deleted,this.modifiedLineNumber=void 0}}class ipt{constructor(e,t){this.diff=e,this.modifiedLineNumber=t,this.type=ea.Added,this.originalLineNumber=void 0}}class opt{constructor(e,t){this.originalLineNumber=e,this.modifiedLineNumber=t,this.type=ea.Unchanged}}let Z$=class extends _e{constructor(e,t,n,o,r,s){super(),this._element=e,this._model=t,this._width=n,this._height=o,this._editors=r,this._languageService=s,this.domNode=this._element,this.domNode.className="diff-review monaco-editor-background";const a=document.createElement("div");a.className="diff-review-actions",this._actionBar=this._register(new zc(a)),this._register(Ii(l=>{this._actionBar.clear(),this._model.canClose.read(l)&&this._actionBar.push(new ca("diffreview.close",C("label.close","Close"),"close-diff-review "+Mt.asClassName(Qgt),!0,()=>Xgt(this,void 0,void 0,function*(){return 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 YI(this._content,{})),jr(this.domNode,this._scrollbar.getDomNode(),a),this._register(zt(()=>{jr(this.domNode)})),this._register(tv(this.domNode,{width:this._width,height:this._height})),this._register(tv(this._content,{width:this._width,height:this._height})),this._register(Ja((l,c)=>{this._model.currentGroup.read(l),this._render(c)})),this._register(No(this.domNode,"keydown",l=>{(l.equals(18)||l.equals(2066)||l.equals(530))&&(l.preventDefault(),this._model.goToNextLine()),(l.equals(16)||l.equals(2064)||l.equals(528))&&(l.preventDefault(),this._model.goToPreviousLine()),(l.equals(9)||l.equals(2057)||l.equals(521)||l.equals(1033))&&(l.preventDefault(),this._model.close()),(l.equals(10)||l.equals(3))&&(l.preventDefault(),this._model.revealCurrentElementInEditor())}))}_render(e){const t=this._editors.original.getOptions(),n=this._editors.modified.getOptions(),o=document.createElement("div");o.className="diff-review-table",o.setAttribute("role","list"),o.setAttribute("aria-label",C("ariaLabel","Accessible Diff Viewer. Use arrow up and down to navigate.")),ss(o,n.get(50)),jr(this._content,o);const r=this._editors.original.getModel(),s=this._editors.modified.getModel();if(!r||!s)return;const a=r.getOptions(),l=s.getOptions(),c=n.get(66),u=this._model.currentGroup.get();for(const d of(u==null?void 0:u.lines)||[]){if(!u)break;let h;if(d.type===ea.Header){const g=document.createElement("div");g.className="diff-review-row",g.setAttribute("role","listitem");const p=u.range,v=this._model.currentGroupIndex.get(),m=this._model.groups.get().length,_=D=>D===0?C("no_lines_changed","no lines changed"):D===1?C("one_line_changed","1 line changed"):C("more_lines_changed","{0} lines changed",D),y=_(p.original.length),w=_(p.modified.length);g.setAttribute("aria-label",C({key:"header",comment:["This is the ARIA label for a git diff header.","A git diff header looks like this: @@ -154,12 +159,39 @@.","That encodes that at original line 154 (which is now line 159), 12 lines were removed/changed with 39 lines.","Variables 0 and 1 refer to the diff index out of total number of diffs.","Variables 2 and 4 will be numbers (a line number).",'Variables 3 and 5 will be "no lines changed", "1 line changed" or "X lines changed", localized separately.']},"Difference {0} of {1}: original line {2}, {3}, modified line {4}, {5}",v+1,m,p.original.startLineNumber,y,p.modified.startLineNumber,w));const L=document.createElement("div");L.className="diff-review-cell diff-review-summary",L.appendChild(document.createTextNode(`${v+1}/${m}: @@ -${p.original.startLineNumber},${p.original.length} +${p.modified.startLineNumber},${p.modified.length} @@`)),g.appendChild(L),h=g}else h=this._createRow(d,c,this._width.get(),t,r,a,n,s,l);o.appendChild(h);const f=In(g=>this._model.currentElement.read(g)===d);e.add(Ii(g=>{const p=f.read(g);h.tabIndex=p?0:-1,p&&h.focus()})),e.add(ke(h,"focus",()=>{this._model.goToLine(d)}))}this._scrollbar.scanDomNode()}_createRow(e,t,n,o,r,s,a,l,c){const u=o.get(143),d=u.glyphMarginWidth+u.lineNumbersWidth,h=a.get(143),f=10+h.glyphMarginWidth+h.lineNumbersWidth;let g="diff-review-row",p="";const v="diff-review-spacer";let m=null;switch(e.type){case ea.Added:g="diff-review-row line-insert",p=" char-insert",m=Ygt;break;case ea.Deleted:g="diff-review-row line-delete",p=" char-delete",m=Zgt;break}const _=document.createElement("div");_.style.minWidth=n+"px",_.className=g,_.setAttribute("role","listitem"),_.ariaLevel="";const y=document.createElement("div");y.className="diff-review-cell",y.style.height=`${t}px`,_.appendChild(y);const w=document.createElement("span");w.style.width=d+"px",w.style.minWidth=d+"px",w.className="diff-review-line-number"+p,e.originalLineNumber!==void 0?w.appendChild(document.createTextNode(String(e.originalLineNumber))):w.innerText="\xA0",y.appendChild(w);const L=document.createElement("span");L.style.width=f+"px",L.style.minWidth=f+"px",L.style.paddingRight="10px",L.className="diff-review-line-number"+p,e.modifiedLineNumber!==void 0?L.appendChild(document.createTextNode(String(e.modifiedLineNumber))):L.innerText="\xA0",y.appendChild(L);const D=document.createElement("span");if(D.className=v,m){const k=document.createElement("span");k.className=Mt.asClassName(m),k.innerText="\xA0\xA0",D.appendChild(k)}else D.innerText="\xA0\xA0";y.appendChild(D);let E;if(e.modifiedLineNumber!==void 0){let k=this._getLineHtml(l,a,c.tabSize,e.modifiedLineNumber,this._languageService.languageIdCodec);Im._ttPolicy&&(k=Im._ttPolicy.createHTML(k)),y.insertAdjacentHTML("beforeend",k),E=l.getLineContent(e.modifiedLineNumber)}else{let k=this._getLineHtml(r,o,s.tabSize,e.originalLineNumber,this._languageService.languageIdCodec);Im._ttPolicy&&(k=Im._ttPolicy.createHTML(k)),y.insertAdjacentHTML("beforeend",k),E=r.getLineContent(e.originalLineNumber)}E.length===0&&(E=C("blankLine","blank"));let I="";switch(e.type){case ea.Unchanged:e.originalLineNumber===e.modifiedLineNumber?I=C({key:"unchangedLine",comment:["The placeholders are contents of the line and should not be translated."]},"{0} unchanged line {1}",E,e.originalLineNumber):I=C("equalLine","{0} original line {1} modified line {2}",E,e.originalLineNumber,e.modifiedLineNumber);break;case ea.Added:I=C("insertLine","+ {0} modified line {1}",E,e.modifiedLineNumber);break;case ea.Deleted:I=C("deleteLine","- {0} original line {1}",E,e.originalLineNumber);break}return _.setAttribute("aria-label",I),_}_getLineHtml(e,t,n,o,r){const s=e.getLineContent(o),a=t.get(50),l=pr.createEmpty(s,r),c=Zl.isBasicASCII(s,e.mightContainNonBasicASCII()),u=Zl.containsRTL(s,c,e.mightContainRTL());return h5(new Zv(a.isMonospace&&!t.get(33),a.canUseHalfwidthRightwardsArrow,s,!1,c,u,0,l,[],n,0,a.spaceWidth,a.middotWidth,a.wsmiddotWidth,t.get(116),t.get(98),t.get(93),t.get(51)!==Pl.OFF,null)).html}};Z$=zX([UX(5,Ki)],Z$);const rpt=Eo("diff-insert",Xe.add,C("diffInsertIcon","Line decoration for inserts in the diff editor.")),HCe=Eo("diff-remove",Xe.remove,C("diffRemoveIcon","Line decoration for removals in the diff editor.")),Xae=Jt.register({className:"line-insert",description:"line-insert",isWholeLine:!0,linesDecorationsClassName:"insert-sign "+Mt.asClassName(rpt),marginClassName:"gutter-insert"}),Yae=Jt.register({className:"line-delete",description:"line-delete",isWholeLine:!0,linesDecorationsClassName:"delete-sign "+Mt.asClassName(HCe),marginClassName:"gutter-delete"}),Zae=Jt.register({className:"line-insert",description:"line-insert",isWholeLine:!0,marginClassName:"gutter-insert"}),Qae=Jt.register({className:"line-delete",description:"line-delete",isWholeLine:!0,marginClassName:"gutter-delete"}),Jae=Jt.register({className:"char-insert",description:"char-insert",shouldFillLineOnLineBreak:!0}),spt=Jt.register({className:"char-insert",description:"char-insert",isWholeLine:!0}),apt=Jt.register({className:"char-insert diff-range-empty",description:"char-insert diff-range-empty"}),Q$=Jt.register({className:"char-delete",description:"char-delete",shouldFillLineOnLineBreak:!0}),lpt=Jt.register({className:"char-delete",description:"char-delete",isWholeLine:!0}),cpt=Jt.register({className:"char-delete diff-range-empty",description:"char-delete diff-range-empty"}),upt=Jt.register({description:"diff-editor-arrow-revert-change",glyphMarginHoverMessage:new os(void 0,{isTrusted:!0,supportThemeIcons:!0}).appendMarkdown(C("revertChangeHoverMessage","Click to revert change")),glyphMarginClassName:"arrow-revert-change "+Mt.asClassName(Xe.arrowRight),zIndex:10001});class nv extends _e{constructor(e,t,n,o,r){super(),this._rootElement=e,this._diffModel=t,this._originalEditorLayoutInfo=n,this._modifiedEditorLayoutInfo=o,this._editors=r,this._originalScrollTop=$r(this._editors.original.onDidScrollChange,()=>this._editors.original.getScrollTop()),this._modifiedScrollTop=$r(this._editors.modified.onDidScrollChange,()=>this._editors.modified.getScrollTop()),this._viewZonesChanged=Fl("onDidChangeViewZones",this._editors.modified.onDidChangeViewZones),this.width=Ai(this,0),this._modifiedViewZonesChangedSignal=Fl("modified.onDidChangeViewZones",this._editors.modified.onDidChangeViewZones),this._originalViewZonesChangedSignal=Fl("original.onDidChangeViewZones",this._editors.original.onDidChangeViewZones),this._state=kk((h,f)=>{var g;this._element.replaceChildren();const p=this._diffModel.read(h),v=(g=p==null?void 0:p.diff.read(h))===null||g===void 0?void 0:g.movedTexts;if(!v||v.length===0){this.width.set(0,void 0);return}this._viewZonesChanged.read(h);const m=this._originalEditorLayoutInfo.read(h),_=this._modifiedEditorLayoutInfo.read(h);if(!m||!_){this.width.set(0,void 0);return}this._modifiedViewZonesChangedSignal.read(h),this._originalViewZonesChangedSignal.read(h);const y=v.map(R=>{function A(K,j){const G=j.getTopForLineNumber(K.startLineNumber,!0),X=j.getTopForLineNumber(K.endLineNumberExclusive,!0);return(G+X)/2}const P=A(R.lineRangeMapping.original,this._editors.original),N=this._originalScrollTop.read(h),M=A(R.lineRangeMapping.modified,this._editors.modified),H=this._modifiedScrollTop.read(h),B=P-N,F=M-H,$=Math.min(P,M),z=Math.max(P,M);return{range:new Cn($,z),from:B,to:F,fromWithoutScroll:P,toWithoutScroll:M,move:R}});y.sort(hXe(Rc(R=>R.fromWithoutScroll>R.toWithoutScroll,fXe),Rc(R=>R.fromWithoutScroll>R.toWithoutScroll?R.fromWithoutScroll:-R.toWithoutScroll,Ug)));const w=jX.compute(y.map(R=>R.range)),L=10,D=m.verticalScrollbarWidth,E=(w.getTrackCount()-1)*10+L*2,I=D+E+(_.contentLeft-nv.movedCodeBlockPadding);let k=0;for(const R of y){const A=w.getTrack(k),P=D+L+A*10,N=15,M=15,H=I,B=_.glyphMarginWidth+_.lineNumbersWidth,F=18,$=document.createElementNS("http://www.w3.org/2000/svg","rect");$.classList.add("arrow-rectangle"),$.setAttribute("x",`${H-B}`),$.setAttribute("y",`${R.to-F/2}`),$.setAttribute("width",`${B}`),$.setAttribute("height",`${F}`),this._element.appendChild($);const z=document.createElementNS("http://www.w3.org/2000/svg","g"),K=document.createElementNS("http://www.w3.org/2000/svg","path");K.setAttribute("d",`M ${0} ${R.from} L ${P} ${R.from} L ${P} ${R.to} L ${H-M} ${R.to}`),K.setAttribute("fill","none"),z.appendChild(K);const j=document.createElementNS("http://www.w3.org/2000/svg","polygon");j.classList.add("arrow"),f.add(Ii(G=>{K.classList.toggle("currentMove",R.move===p.activeMovedText.read(G)),j.classList.toggle("currentMove",R.move===p.activeMovedText.read(G))})),j.setAttribute("points",`${H-M},${R.to-N/2} ${H},${R.to} ${H-M},${R.to+N/2}`),z.appendChild(j),this._element.appendChild(z),k++}this.width.set(E,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(zt(()=>this._element.remove())),this._register(Ii(h=>{const f=this._originalEditorLayoutInfo.read(h),g=this._modifiedEditorLayoutInfo.read(h);!f||!g||(this._element.style.left=`${f.width-f.verticalScrollbarWidth}px`,this._element.style.height=`${f.height}px`,this._element.style.width=`${f.verticalScrollbarWidth+f.contentLeft-nv.movedCodeBlockPadding+this.width.read(h)}px`)})),this._register(Tk(this._state));const s=In(h=>{const f=this._diffModel.read(h),g=f==null?void 0:f.diff.read(h);return g?g.movedTexts.map(p=>({move:p,original:new nO(eO(p.lineRangeMapping.original.startLineNumber-1),18),modified:new nO(eO(p.lineRangeMapping.modified.startLineNumber-1),18)})):[]});this._register(iO(this._editors.original,s.map(h=>h.map(f=>f.original)))),this._register(iO(this._editors.modified,s.map(h=>h.map(f=>f.modified)))),this._register(Ja((h,f)=>{const g=s.read(h);for(const p of g)f.add(new ele(this._editors.original,p.original,p.move,"original",this._diffModel.get())),f.add(new ele(this._editors.modified,p.modified,p.move,"modified",this._diffModel.get()))}));const a=$r(this._editors.original.onDidChangeCursorPosition,()=>this._editors.original.getPosition()),l=$r(this._editors.modified.onDidChangeCursorPosition,()=>this._editors.modified.getPosition()),c=Fl("original.onDidFocusEditorWidget",h=>this._editors.original.onDidFocusEditorWidget(()=>setTimeout(()=>h(void 0),0))),u=Fl("modified.onDidFocusEditorWidget",h=>this._editors.modified.onDidFocusEditorWidget(()=>setTimeout(()=>h(void 0),0)));let d="modified";this._register(Y5({createEmptyChangeSummary:()=>{},handleChange:(h,f)=>(h.didChange(c)&&(d="original"),h.didChange(u)&&(d="modified"),!0)},h=>{c.read(h),u.read(h);const f=this._diffModel.read(h);if(!f)return;const g=f.diff.read(h);let p;if(g&&d==="original"){const v=a.read(h);v&&(p=g.movedTexts.find(m=>m.lineRangeMapping.original.contains(v.lineNumber)))}if(g&&d==="modified"){const v=l.read(h);v&&(p=g.movedTexts.find(m=>m.lineRangeMapping.modified.contains(v.lineNumber)))}p!==f.movedTextToCompare.get()&&f.movedTextToCompare.set(void 0,void 0),f.setActiveMovedText(p)}))}}nv.movedCodeBlockPadding=4;class jX{static compute(e){const t=[],n=[];for(const o of e){let r=t.findIndex(s=>!s.intersectsStrict(o));r===-1&&(t.length>=6?r=Iet(t,Rc(a=>a.intersectWithRangeLength(o),Ug)):(r=t.length,t.push(new uG))),t[r].addRange(o),n.push(r)}return new jX(t.length,n)}constructor(e,t){this._trackCount=e,this.trackPerLineIdx=t}getTrack(e){return this.trackPerLineIdx[e]}getTrackCount(){return this._trackCount}}class ele extends VCe{constructor(e,t,n,o,r){const s=Or("div.diff-hidden-lines-widget");super(e,t,s.root),this._editor=e,this._move=n,this._kind=o,this._diffModel=r,this._nodes=Or("div.diff-moved-code-block",{style:{marginRight:"4px"}},[Or("div.text-content@textContent"),Or("div.action-bar@actionBar")]),s.root.appendChild(this._nodes.root);const a=$r(this._editor.onDidLayoutChange,()=>this._editor.getLayoutInfo());this._register(tv(this._nodes.root,{paddingRight:a.map(h=>h.verticalScrollbarWidth)}));let l;n.changes.length>0?l=this._kind==="original"?C("codeMovedToWithChanges","Code moved with changes to line {0}-{1}",this._move.lineRangeMapping.modified.startLineNumber,this._move.lineRangeMapping.modified.endLineNumberExclusive-1):C("codeMovedFromWithChanges","Code moved with changes from line {0}-{1}",this._move.lineRangeMapping.original.startLineNumber,this._move.lineRangeMapping.original.endLineNumberExclusive-1):l=this._kind==="original"?C("codeMovedTo","Code moved to line {0}-{1}",this._move.lineRangeMapping.modified.startLineNumber,this._move.lineRangeMapping.modified.endLineNumberExclusive-1):C("codeMovedFrom","Code moved from line {0}-{1}",this._move.lineRangeMapping.original.startLineNumber,this._move.lineRangeMapping.original.endLineNumberExclusive-1);const c=this._register(new zc(this._nodes.actionBar,{highlightToggledItems:!0})),u=new ca("",l,"",!1);c.push(u,{icon:!1,label:!0});const d=new ca("","Compare",Mt.asClassName(Xe.compareChanges),!0,()=>{this._editor.focus(),this._diffModel.movedTextToCompare.set(this._diffModel.movedTextToCompare.get()===n?void 0:this._move,void 0)});this._register(Ii(h=>{const f=this._diffModel.movedTextToCompare.read(h)===n;d.checked=f})),c.push(d,{icon:!1,label:!0})}}class dpt extends _e{constructor(e,t,n){super(),this._editors=e,this._diffModel=t,this._options=n,this._decorations=In(this,o=>{var r;const s=(r=this._diffModel.read(o))===null||r===void 0?void 0:r.diff.read(o);if(!s)return null;const a=this._diffModel.read(o).movedTextToCompare.read(o),l=this._options.renderIndicators.read(o),c=this._options.showEmptyDecorations.read(o),u=[],d=[];if(!a)for(const f of s.mappings){if(f.lineRangeMapping.original.isEmpty||u.push({range:f.lineRangeMapping.original.toInclusiveRange(),options:l?Yae:Qae}),f.lineRangeMapping.modified.isEmpty||d.push({range:f.lineRangeMapping.modified.toInclusiveRange(),options:l?Xae:Zae}),f.lineRangeMapping.modified.isEmpty||f.lineRangeMapping.original.isEmpty)f.lineRangeMapping.original.isEmpty||u.push({range:f.lineRangeMapping.original.toInclusiveRange(),options:lpt}),f.lineRangeMapping.modified.isEmpty||d.push({range:f.lineRangeMapping.modified.toInclusiveRange(),options:spt});else for(const g of f.lineRangeMapping.innerChanges||[])f.lineRangeMapping.original.contains(g.originalRange.startLineNumber)&&u.push({range:g.originalRange,options:g.originalRange.isEmpty()&&c?cpt:Q$}),f.lineRangeMapping.modified.contains(g.modifiedRange.startLineNumber)&&d.push({range:g.modifiedRange,options:g.modifiedRange.isEmpty()&&c?apt:Jae});!f.lineRangeMapping.modified.isEmpty&&this._options.shouldRenderRevertArrows.read(o)&&!a&&d.push({range:V.fromPositions(new ae(f.lineRangeMapping.modified.startLineNumber,1)),options:upt})}if(a)for(const f of a.changes){const g=f.original.toInclusiveRange();g&&u.push({range:g,options:l?Yae:Qae});const p=f.modified.toInclusiveRange();p&&d.push({range:p,options:l?Xae:Zae});for(const v of f.innerChanges||[])u.push({range:v.originalRange,options:Q$}),d.push({range:v.modifiedRange,options:Jae})}const h=this._diffModel.read(o).activeMovedText.read(o);for(const f of s.movedTexts)u.push({range:f.lineRangeMapping.original.toInclusiveRange(),options:{description:"moved",blockClassName:"movedOriginal"+(f===h?" currentMove":""),blockPadding:[nv.movedCodeBlockPadding,0,nv.movedCodeBlockPadding,nv.movedCodeBlockPadding]}}),d.push({range:f.lineRangeMapping.modified.toInclusiveRange(),options:{description:"moved",blockClassName:"movedModified"+(f===h?" currentMove":""),blockPadding:[4,0,4,4]}});return{originalDecorations:u,modifiedDecorations:d}}),this._register(tO(this._editors.original,this._decorations.map(o=>(o==null?void 0:o.originalDecorations)||[]))),this._register(tO(this._editors.modified,this._decorations.map(o=>(o==null?void 0:o.modifiedDecorations)||[])))}}class hpt extends _e{constructor(e,t,n){super(),this._options=e,this._domNode=t,this._dimensions=n,this._sashRatio=Ai(this,void 0),this.sashLeft=In(this,o=>{var r;const s=(r=this._sashRatio.read(o))!==null&&r!==void 0?r:this._options.splitViewDefaultRatio.read(o);return this._computeSashLeft(s,o)}),this._sash=this._register(new gs(this._domNode,{getVerticalSashTop:o=>0,getVerticalSashLeft:o=>this.sashLeft.get(),getVerticalSashHeight:o=>this._dimensions.height.get()},{orientation:0})),this._startSashPosition=void 0,this._register(this._sash.onDidStart(()=>{this._startSashPosition=this.sashLeft.get()})),this._register(this._sash.onDidChange(o=>{const r=this._dimensions.width.get(),s=this._computeSashLeft((this._startSashPosition+(o.currentX-o.startX))/r,void 0);this._sashRatio.set(s/r,void 0)})),this._register(this._sash.onDidEnd(()=>this._sash.layout())),this._register(this._sash.onDidReset(()=>this._sashRatio.set(void 0,void 0))),this._register(Ii(o=>{const r=this._options.enableSplitViewResizing.read(o);this._sash.state=r?3:0,this.sashLeft.read(o),this._dimensions.height.read(o),this._sash.layout()}))}setBoundarySashes(e){this._sash.orthogonalEndSash=e.bottom}_computeSashLeft(e,t){const n=this._dimensions.width.read(t),o=Math.floor(this._options.splitViewDefaultRatio.read(t)*n),r=this._options.enableSplitViewResizing.read(t)?Math.floor(e*n):o,s=100;return n<=s*2?o:rn-s?n-s:r}}class GC{remove(){var e;(e=this.parent)===null||e===void 0||e.children.delete(this.id)}static findId(e,t){let n;typeof e=="string"?n=`${t.id}/${e}`:(n=`${t.id}/${e.name}`,t.children.get(n)!==void 0&&(n=`${t.id}/${e.name}_${e.range.startLineNumber}_${e.range.startColumn}`));let o=n;for(let r=0;t.children.get(o)!==void 0;r++)o=`${n}_${r}`;return o}static empty(e){return e.children.size===0}}class tle extends GC{constructor(e,t,n){super(),this.id=e,this.parent=t,this.symbol=n,this.children=new Map}}class fpt extends GC{constructor(e,t,n,o){super(),this.id=e,this.parent=t,this.label=n,this.order=o,this.children=new Map}}class im extends GC{static create(e,t,n){const o=new Ro(n),r=new im(t.uri),s=e.ordered(t),a=s.map((c,u)=>{var d;const h=GC.findId(`provider_${u}`,r),f=new fpt(h,r,(d=c.displayName)!==null&&d!==void 0?d:"Unknown Outline Provider",u);return Promise.resolve(c.provideDocumentSymbols(t,o.token)).then(g=>{for(const p of g||[])im._makeOutlineElement(p,f);return f},g=>($o(g),f)).then(g=>{GC.empty(g)?g.remove():r._groups.set(h,g)})}),l=e.onDidChange(()=>{const c=e.ordered(t);Lo(c,s)||o.cancel()});return Promise.all(a).then(()=>o.token.isCancellationRequested&&!n.isCancellationRequested?im.create(e,t,n):r._compact()).finally(()=>{o.dispose(),l.dispose()})}static _makeOutlineElement(e,t){const n=GC.findId(e,t),o=new tle(n,t,e);if(e.children)for(const r of e.children)im._makeOutlineElement(r,o);t.children.set(o.id,o)}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,n]of this._groups)n.children.size===0?this._groups.delete(t):e+=1;if(e!==1)this.children=this._groups;else{const t=vn.first(this._groups.values());for(const[,n]of t.children)n.parent=this,this.children.set(n.id,n)}return this}getTopLevelSymbols(){const e=[];for(const t of this.children.values())t instanceof tle?e.push(t.symbol):e.push(...vn.map(t.children.values(),n=>n.symbol));return e.sort((t,n)=>V.compareRangesUsingStarts(t.range,n.range))}asListOfDocumentSymbols(){const e=this.getTopLevelSymbols(),t=[];return im._flattenDocumentSymbols(t,e,""),t.sort((n,o)=>ae.compare(V.getStartPosition(n.range),V.getStartPosition(o.range))||ae.compare(V.getEndPosition(o.range),V.getEndPosition(n.range)))}static _flattenDocumentSymbols(e,t,n){for(const o of t)e.push({kind:o.kind,tags:o.tags,name:o.name,detail:o.detail,containerName:o.containerName||n,range:o.range,selectionRange:o.selectionRange,children:void 0}),o.children&&im._flattenDocumentSymbols(e,o.children,o.name)}}var $Ce=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},zCe=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},gpt=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};let J$=class extends _e{get isUpdatingViewZones(){return this._isUpdatingViewZones}constructor(e,t,n,o){super(),this._editors=e,this._diffModel=t,this._options=n,this._languageFeaturesService=o,this._isUpdatingViewZones=!1,this._modifiedOutlineSource=kk(this,(c,u)=>{const d=this._editors.modifiedModel.read(c);if(!!d)return u.add(new ez(this._languageFeaturesService,d))}),this._register(this._editors.original.onDidChangeCursorPosition(c=>{if(c.reason===3){const u=this._diffModel.get();qi(d=>{for(const h of this._editors.original.getSelections()||[])u==null||u.ensureOriginalLineIsVisible(h.getStartPosition().lineNumber,d),u==null||u.ensureOriginalLineIsVisible(h.getEndPosition().lineNumber,d)})}})),this._register(this._editors.modified.onDidChangeCursorPosition(c=>{if(c.reason===3){const u=this._diffModel.get();qi(d=>{for(const h of this._editors.modified.getSelections()||[])u==null||u.ensureModifiedLineIsVisible(h.getStartPosition().lineNumber,d),u==null||u.ensureModifiedLineIsVisible(h.getEndPosition().lineNumber,d)})}}));const r=this._diffModel.map((c,u)=>{var d,h;return((d=c==null?void 0:c.diff.read(u))===null||d===void 0?void 0:d.mappings.length)===0?[]:(h=c==null?void 0:c.unchangedRegions.read(u))!==null&&h!==void 0?h:[]}),s=kk(this,(c,u)=>{const d=this._modifiedOutlineSource.read(c);if(!d)return{origViewZones:[],modViewZones:[]};const h=[],f=[],g=this._options.renderSideBySide.read(c),p=r.read(c);for(const v of p)if(!v.shouldHideControls(c)){{const m=In(y=>v.getHiddenOriginalRange(y).startLineNumber-1),_=new nO(m,24);h.push(_),u.add(new nle(this._editors.original,_,v,v.originalUnchangedRange,!g,d,y=>this._diffModel.get().ensureModifiedLineIsVisible(y,void 0),this._options))}{const m=In(y=>v.getHiddenModifiedRange(y).startLineNumber-1),_=new nO(m,24);f.push(_),u.add(new nle(this._editors.modified,_,v,v.modifiedUnchangedRange,!1,d,y=>this._diffModel.get().ensureModifiedLineIsVisible(y,void 0),this._options))}}return{origViewZones:h,modViewZones:f}}),a={description:"unchanged lines",className:"diff-unchanged-lines",isWholeLine:!0},l={description:"Fold Unchanged",glyphMarginHoverMessage:new os(void 0,{isTrusted:!0,supportThemeIcons:!0}).appendMarkdown(C("foldUnchanged","Fold Unchanged Region")),glyphMarginClassName:"fold-unchanged "+Mt.asClassName(Xe.fold),zIndex:10001};this._register(tO(this._editors.original,In(c=>{const u=r.read(c),d=u.map(h=>({range:h.originalUnchangedRange.toInclusiveRange(),options:a}));for(const h of u)h.shouldHideControls(c)&&d.push({range:V.fromPositions(new ae(h.originalLineNumber,1)),options:l});return d}))),this._register(tO(this._editors.modified,In(c=>{const u=r.read(c),d=u.map(h=>({range:h.modifiedUnchangedRange.toInclusiveRange(),options:a}));for(const h of u)h.shouldHideControls(c)&&d.push({range:ln.ofLength(h.modifiedLineNumber,1).toInclusiveRange(),options:l});return d}))),this._register(iO(this._editors.original,s.map(c=>c.origViewZones),c=>this._isUpdatingViewZones=c)),this._register(iO(this._editors.modified,s.map(c=>c.modViewZones),c=>this._isUpdatingViewZones=c)),this._register(Ii(c=>{const u=r.read(c);this._editors.original.setHiddenAreas(u.map(d=>d.getHiddenOriginalRange(c).toInclusiveRange()).filter(ED)),this._editors.modified.setHiddenAreas(u.map(d=>d.getHiddenModifiedRange(c).toInclusiveRange()).filter(ED))})),this._register(this._editors.modified.onMouseUp(c=>{var u;if(!c.event.rightButton&&c.target.position&&((u=c.target.element)===null||u===void 0?void 0:u.className.includes("fold-unchanged"))){const d=c.target.position.lineNumber,h=this._diffModel.get();if(!h)return;const f=h.unchangedRegions.get().find(g=>g.modifiedUnchangedRange.includes(d));if(!f)return;f.collapseAll(void 0),c.event.stopPropagation(),c.event.preventDefault()}})),this._register(this._editors.original.onMouseUp(c=>{var u;if(!c.event.rightButton&&c.target.position&&((u=c.target.element)===null||u===void 0?void 0:u.className.includes("fold-unchanged"))){const d=c.target.position.lineNumber,h=this._diffModel.get();if(!h)return;const f=h.unchangedRegions.get().find(g=>g.originalUnchangedRange.includes(d));if(!f)return;f.collapseAll(void 0),c.event.stopPropagation(),c.event.preventDefault()}}))}};J$=$Ce([zCe(3,pt)],J$);let ez=class extends _e{constructor(e,t){super(),this._languageFeaturesService=e,this._textModel=t,this._currentModel=Ai(this,void 0);const n=Fl("documentSymbolProvider.onDidChange",this._languageFeaturesService.documentSymbolProvider.onDidChange),o=Fl("_textModel.onDidChangeContent",st.debounce(r=>this._textModel.onDidChangeContent(r),()=>{},100));this._register(Ja((r,s)=>gpt(this,void 0,void 0,function*(){n.read(r),o.read(r);const a=s.add(new Ggt),l=yield im.create(this._languageFeaturesService.documentSymbolProvider,this._textModel,a.token);s.isDisposed||this._currentModel.set(l,void 0)})))}getBreadcrumbItems(e,t){const n=this._currentModel.read(t);if(!n)return[];const o=n.asListOfDocumentSymbols().filter(r=>e.contains(r.range.startLineNumber)&&!e.contains(r.range.endLineNumber));return o.sort(u_e(Rc(r=>r.range.endLineNumber-r.range.startLineNumber,Ug))),o.map(r=>({name:r.name,kind:r.kind,startLineNumber:r.range.startLineNumber}))}};ez=$Ce([zCe(0,pt)],ez);class nle extends VCe{constructor(e,t,n,o,r,s,a,l){const c=Or("div.diff-hidden-lines-widget");super(e,t,c.root),this._editor=e,this._unchangedRegion=n,this._unchangedRegionRange=o,this.hide=r,this._modifiedOutlineSource=s,this._revealModifiedHiddenLine=a,this._options=l,this._nodes=Or("div.diff-hidden-lines",[Or("div.top@top",{title:C("diff.hiddenLines.top","Click or drag to show more above")}),Or("div.center@content",{style:{display:"flex"}},[Or("div@first",{style:{display:"flex",justifyContent:"center",alignItems:"center",flexShrink:"0"}},[He("a",{title:C("showAll","Show all"),role:"button",onclick:()=>{this._unchangedRegion.showAll(void 0)}},...Qm("$(unfold)"))]),Or("div@others",{style:{display:"flex",justifyContent:"center",alignItems:"center"}})]),Or("div.bottom@bottom",{title:C("diff.bottom","Click or drag to show more below"),role:"button"})]),c.root.appendChild(this._nodes.root);const u=$r(this._editor.onDidLayoutChange,()=>this._editor.getLayoutInfo());this.hide?jr(this._nodes.first):this._register(tv(this._nodes.first,{width:u.map(h=>h.contentLeft)}));const d=this._editor;this._register(ke(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 f=h.clientY;let g=!1;const p=this._unchangedRegion.visibleLineCountTop.get();this._unchangedRegion.isDragged.set(!0,void 0);const v=ke(window,"mousemove",_=>{const w=_.clientY-f;g=g||Math.abs(w)>2;const L=Math.round(w/d.getOption(66)),D=Math.max(0,Math.min(p+L,this._unchangedRegion.getMaxVisibleLineCountTop()));this._unchangedRegion.visibleLineCountTop.set(D,void 0)}),m=ke(window,"mouseup",_=>{g||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(!1,void 0),v.dispose(),m.dispose()})})),this._register(ke(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 f=h.clientY;let g=!1;const p=this._unchangedRegion.visibleLineCountBottom.get();this._unchangedRegion.isDragged.set(!0,void 0);const v=ke(window,"mousemove",_=>{const w=_.clientY-f;g=g||Math.abs(w)>2;const L=Math.round(w/d.getOption(66)),D=Math.max(0,Math.min(p-L,this._unchangedRegion.getMaxVisibleLineCountBottom())),E=d.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);this._unchangedRegion.visibleLineCountBottom.set(D,void 0);const I=d.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);d.setScrollTop(d.getScrollTop()+(I-E))}),m=ke(window,"mouseup",_=>{if(this._unchangedRegion.isDragged.set(!1,void 0),!g){const y=d.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);this._unchangedRegion.showMoreBelow(this._options.hideUnchangedRegionsRevealLineCount.get(),void 0);const w=d.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);d.setScrollTop(d.getScrollTop()+(w-y))}this._nodes.bottom.classList.toggle("dragging",!1),this._nodes.root.classList.toggle("dragging",!1),v.dispose(),m.dispose()})})),this._register(Ii(h=>{const f=[];if(!this.hide){const g=n.getHiddenModifiedRange(h).length,p=C("hiddenLines","{0} hidden lines",g),v=He("span",{title:C("diff.hiddenLines.expandAll","Double click to unfold")},p);v.addEventListener("dblclick",y=>{y.button===0&&(y.preventDefault(),this._unchangedRegion.showAll(void 0))}),f.push(v);const m=this._unchangedRegion.getHiddenModifiedRange(h),_=this._modifiedOutlineSource.getBreadcrumbItems(m,h);if(_.length>0){f.push(He("span",void 0,"\xA0\xA0|\xA0\xA0"));for(let y=0;y<_.length;y++){const w=_[y],L=VA.toIcon(w.kind),D=Or("div.breadcrumb-item",{style:{display:"flex",alignItems:"center"}},[i$(L),"\xA0",w.name,...y===_.length-1?[]:[i$(Xe.chevronRight)]]).root;f.push(D),D.onclick=()=>{this._revealModifiedHiddenLine(w.startLineNumber)}}}}jr(this._nodes.others,...f)}))}}class Zd{static capture(e){if(e.getScrollTop()===0||e.hasPendingScrollAnimation())return new Zd(e.getScrollTop(),e.getContentHeight(),null,0,null);let t=null,n=0;const o=e.getVisibleRanges();if(o.length>0){t=o[0].getStartPosition();const r=e.getTopForPosition(t.lineNumber,t.column);n=e.getScrollTop()-r}return new Zd(e.getScrollTop(),e.getContentHeight(),t,n,e.getPosition())}constructor(e,t,n,o,r){this._initialScrollTop=e,this._initialContentHeight=t,this._visiblePosition=n,this._visiblePositionScrollDelta=o,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 n=e.getTopForLineNumber(t.lineNumber)-e.getTopForLineNumber(this._cursorPosition.lineNumber);e.setScrollTop(e.getScrollTop()+n)}}var ppt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},ile=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},mpt=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},P_;let oO=P_=class{constructor(e,t,n){this.editorWorkerService=t,this.telemetryService=n,this.onDidChangeEventEmitter=new le,this.onDidChange=this.onDidChangeEventEmitter.event,this.diffAlgorithm="advanced",this.diffAlgorithmOnDidChangeSubscription=void 0,this.setOptions(e)}dispose(){var e;(e=this.diffAlgorithmOnDidChangeSubscription)===null||e===void 0||e.dispose()}computeDiff(e,t,n,o){var r,s;return mpt(this,void 0,void 0,function*(){if(typeof this.diffAlgorithm!="string")return this.diffAlgorithm.computeDiff(e,t,n,o);if(e.getLineCount()===1&&e.getLineMaxColumn(1)===1)return t.getLineCount()===1&&t.getLineMaxColumn(1)===1?{changes:[],identical:!0,quitEarly:!1,moves:[]}:{changes:[new Hc(new ln(1,2),new ln(1,t.getLineCount()+1),[new Lv(e.getFullModelRange(),t.getFullModelRange())])],identical:!1,quitEarly:!1,moves:[]};const a=JSON.stringify([e.uri.toString(),t.uri.toString()]),l=JSON.stringify([e.id,t.id,e.getAlternativeVersionId(),t.getAlternativeVersionId(),JSON.stringify(n)]),c=P_.diffCache.get(a);if(c&&c.context===l)return c.result;const u=Ls.create(),d=yield this.editorWorkerService.computeDiff(e.uri,t.uri,n,this.diffAlgorithm),h=u.elapsed();if(this.telemetryService.publicLog2("diffEditor.computeDiff",{timeMs:h,timedOut:(r=d==null?void 0:d.quitEarly)!==null&&r!==void 0?r:!0,detectedMoves:n.computeMoves?(s=d==null?void 0:d.moves.length)!==null&&s!==void 0?s:0:-1}),o.isCancellationRequested)return{changes:[],identical:!1,quitEarly:!0,moves:[]};if(!d)throw new Error("no diff result available");return P_.diffCache.size>10&&P_.diffCache.delete(P_.diffCache.keys().next().value),P_.diffCache.set(a,{result:d,context:l}),d})}setOptions(e){var t;let n=!1;e.diffAlgorithm&&this.diffAlgorithm!==e.diffAlgorithm&&((t=this.diffAlgorithmOnDidChangeSubscription)===null||t===void 0||t.dispose(),this.diffAlgorithmOnDidChangeSubscription=void 0,this.diffAlgorithm=e.diffAlgorithm,typeof e.diffAlgorithm!="string"&&(this.diffAlgorithmOnDidChangeSubscription=e.diffAlgorithm.onDidChange(()=>this.onDidChangeEventEmitter.fire())),n=!0),n&&this.onDidChangeEventEmitter.fire()}};oO.diffCache=new Map;oO=P_=ppt([ile(1,Xu),ile(2,tc)],oO);var vpt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},_pt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const UCe=yn("diffProviderFactoryService");let tz=class{constructor(e){this.instantiationService=e}createDiffProvider(e,t){return this.instantiationService.createInstance(oO,t)}};tz=vpt([_pt(0,$t)],tz);Mn(UCe,tz,1);var bpt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Cpt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},ole=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};let nz=class extends _e{setActiveMovedText(e){this._activeMovedText.set(e,void 0)}constructor(e,t,n,o){super(),this.model=e,this._options=t,this._editor=n,this._diffProviderFactoryService=o,this._isDiffUpToDate=Ai(this,!1),this.isDiffUpToDate=this._isDiffUpToDate,this._diff=Ai(this,void 0),this.diff=this._diff,this._unchangedRegions=Ai(this,{regions:[],originalDecorationIds:[],modifiedDecorationIds:[]}),this.unchangedRegions=In(this,l=>this._options.hideUnchangedRegions.read(l)?this._unchangedRegions.read(l).regions:(qi(c=>{for(const u of this._unchangedRegions.get().regions)u.collapseAll(c)}),[])),this.movedTextToCompare=Ai(this,void 0),this._activeMovedText=Ai(this,void 0),this._hoveredMovedText=Ai(this,void 0),this.activeMovedText=In(this,l=>{var c,u;return(u=(c=this.movedTextToCompare.read(l))!==null&&c!==void 0?c:this._hoveredMovedText.read(l))!==null&&u!==void 0?u:this._activeMovedText.read(l)}),this._cancellationTokenSource=new Ro,this._diffProvider=In(this,l=>{const c=this._diffProviderFactoryService.createDiffProvider(this._editor,{diffAlgorithm:this._options.diffAlgorithm.read(l)}),u=Fl("onDidChange",c.onDidChange);return{diffProvider:c,onChangeSignal:u}}),this._register(zt(()=>this._cancellationTokenSource.cancel()));const r=BCe("contentChangedSignal"),s=this._register(new bi(()=>r.trigger(void 0),200)),a=(l,c,u)=>{const d=rO.fromDiffs(l.changes,e.original.getLineCount(),e.modified.getLineCount(),this._options.hideUnchangedRegionsMinimumLineCount.read(u),this._options.hideUnchangedRegionsContextLineCount.read(u)),h=this._unchangedRegions.get(),f=h.originalDecorationIds.map(m=>e.original.getDecorationRange(m)).filter(m=>!!m).map(m=>ln.fromRange(m)),g=h.modifiedDecorationIds.map(m=>e.modified.getDecorationRange(m)).filter(m=>!!m).map(m=>ln.fromRange(m)),p=e.original.deltaDecorations(h.originalDecorationIds,d.map(m=>({range:m.originalUnchangedRange.toInclusiveRange(),options:{description:"unchanged"}}))),v=e.modified.deltaDecorations(h.modifiedDecorationIds,d.map(m=>({range:m.modifiedUnchangedRange.toInclusiveRange(),options:{description:"unchanged"}})));for(const m of d)for(let _=0;_{if(this._diff.get()){const u=Vg.fromModelContentChanges(l.changes);this._lastDiff,e.original,e.modified}s.schedule()})),this._register(e.original.onDidChangeContent(l=>{if(this._diff.get()){const u=Vg.fromModelContentChanges(l.changes);this._lastDiff,e.original,e.modified}s.schedule()})),this._register(Ja((l,c)=>ole(this,void 0,void 0,function*(){var u,d;this._options.hideUnchangedRegionsMinimumLineCount.read(l),this._options.hideUnchangedRegionsContextLineCount.read(l),s.cancel(),r.read(l);const h=this._diffProvider.read(l);h.onChangeSignal.read(l),nm(j0e,l),nm(rH,l),this._isDiffUpToDate.set(!1,void 0);let f=[];c.add(e.original.onDidChangeContent(v=>{const m=Vg.fromModelContentChanges(v.changes);f=vP(f,m)}));let g=[];c.add(e.modified.onDidChangeContent(v=>{const m=Vg.fromModelContentChanges(v.changes);g=vP(g,m)}));let p=yield h.diffProvider.computeDiff(e.original,e.modified,{ignoreTrimWhitespace:this._options.ignoreTrimWhitespace.read(l),maxComputationTimeMs:this._options.maxComputationTimeMs.read(l),computeMoves:this._options.showMoves.read(l)},this._cancellationTokenSource.token);this._cancellationTokenSource.token.isCancellationRequested||(p=ypt(p,e.original,e.modified),p=(u=(e.original,e.modified,void 0))!==null&&u!==void 0?u:p,p=(d=(e.original,e.modified,void 0))!==null&&d!==void 0?d:p,qi(v=>{a(p,v),this._lastDiff=p;const m=KX.fromDiffResult(p);this._diff.set(m,v),this._isDiffUpToDate.set(!0,v);const _=this.movedTextToCompare.get();this.movedTextToCompare.set(_?this._lastDiff.moves.find(y=>y.lineRangeMapping.modified.intersect(_.lineRangeMapping.modified)):void 0,v)}))})))}ensureModifiedLineIsVisible(e,t){var n;if(((n=this.diff.get())===null||n===void 0?void 0:n.mappings.length)===0)return;const o=this._unchangedRegions.get().regions;for(const r of o)if(r.getHiddenModifiedRange(void 0).contains(e)){r.showModifiedLine(e,t);return}}ensureOriginalLineIsVisible(e,t){var n;if(((n=this.diff.get())===null||n===void 0?void 0:n.mappings.length)===0)return;const o=this._unchangedRegions.get().regions;for(const r of o)if(r.getHiddenOriginalRange(void 0).contains(e)){r.showOriginalLine(e,t);return}}waitForDiff(){return ole(this,void 0,void 0,function*(){yield Wgt(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(o=>ln.deserialize(o.range)),n=this._unchangedRegions.get();qi(o=>{for(const r of n.regions)for(const s of t)if(r.modifiedUnchangedRange.intersect(s)){r.setHiddenModifiedRange(s,o);break}})}};nz=bpt([Cpt(3,UCe)],nz);function ypt(i,e,t){return{changes:i.changes.map(n=>new Hc(n.original,n.modified,n.innerChanges?n.innerChanges.map(o=>wpt(o,e,t)):void 0)),moves:i.moves,identical:i.identical,quitEarly:i.quitEarly}}function wpt(i,e,t){let n=i.originalRange,o=i.modifiedRange;return(n.endColumn!==1||o.endColumn!==1)&&n.endColumn===e.getLineMaxColumn(n.endLineNumber)&&o.endColumn===t.getLineMaxColumn(o.endLineNumber)&&n.endLineNumbernew jCe(t)),e.moves||[],e.identical,e.quitEarly)}constructor(e,t,n,o){this.mappings=e,this.movedTexts=t,this.identical=n,this.quitEarly=o}}class jCe{constructor(e){this.lineRangeMapping=e}}class rO{static fromDiffs(e,t,n,o,r){const s=Hc.inverse(e,t,n),a=[];for(const l of s){let c=l.original.startLineNumber,u=l.modified.startLineNumber,d=l.original.length;const h=c===1&&u===1,f=c+d===t+1&&u+d===n+1;(h||f)&&d>=r+o?(h&&!f&&(d-=r),f&&!h&&(c+=r,u+=r,d-=r),a.push(new rO(c,u,d,0,0))):d>=r*2+o&&(c+=r,u+=r,d-=r*2,a.push(new rO(c,u,d,0,0)))}return a}get originalUnchangedRange(){return ln.ofLength(this.originalLineNumber,this.lineCount)}get modifiedUnchangedRange(){return ln.ofLength(this.modifiedLineNumber,this.lineCount)}constructor(e,t,n,o,r){this.originalLineNumber=e,this.modifiedLineNumber=t,this.lineCount=n,this._visibleLineCountTop=Ai(this,0),this.visibleLineCountTop=this._visibleLineCountTop,this._visibleLineCountBottom=Ai(this,0),this.visibleLineCountBottom=this._visibleLineCountBottom,this._shouldHideControls=In(this,s=>this.visibleLineCountTop.read(s)+this.visibleLineCountBottom.read(s)===this.lineCount&&!this.isDragged.read(s)),this.isDragged=Ai(this,!1),this._visibleLineCountTop.set(o,void 0),this._visibleLineCountBottom.set(r,void 0)}shouldHideControls(e){return this._shouldHideControls.read(e)}getHiddenOriginalRange(e){return ln.ofLength(this.originalLineNumber+this._visibleLineCountTop.read(e),this.lineCount-this._visibleLineCountTop.read(e)-this._visibleLineCountBottom.read(e))}getHiddenModifiedRange(e){return ln.ofLength(this.modifiedLineNumber+this._visibleLineCountTop.read(e),this.lineCount-this._visibleLineCountTop.read(e)-this._visibleLineCountBottom.read(e))}setHiddenModifiedRange(e,t){const n=e.startLineNumber-this.modifiedLineNumber,o=this.modifiedLineNumber+this.lineCount-e.endLineNumberExclusive;this.setState(n,o,t)}getMaxVisibleLineCountTop(){return this.lineCount-this._visibleLineCountBottom.get()}getMaxVisibleLineCountBottom(){return this.lineCount-this._visibleLineCountTop.get()}showMoreAbove(e=10,t){const n=this.getMaxVisibleLineCountTop();this._visibleLineCountTop.set(Math.min(this._visibleLineCountTop.get()+e,n),t)}showMoreBelow(e=10,t){const n=this.lineCount-this._visibleLineCountTop.get();this._visibleLineCountBottom.set(Math.min(this._visibleLineCountBottom.get()+e,n),t)}showAll(e){this._visibleLineCountBottom.set(this.lineCount-this._visibleLineCountTop.get(),e)}showModifiedLine(e,t){const n=e+1-(this.modifiedLineNumber+this._visibleLineCountTop.get()),o=this.modifiedLineNumber-this._visibleLineCountBottom.get()+this.lineCount-e;n{var v;this._contextMenuService.showContextMenu({domForShadowRoot:h&&(v=n.getDomNode())!==null&&v!==void 0?v:void 0,getAnchor:()=>({x:g,y:p}),getActions:()=>{const m=[],_=o.modified.isEmpty;return m.push(new ca("diff.clipboard.copyDeletedContent",_?o.original.length>1?C("diff.clipboard.copyDeletedLinesContent.label","Copy deleted lines"):C("diff.clipboard.copyDeletedLinesContent.single.label","Copy deleted line"):o.original.length>1?C("diff.clipboard.copyChangedLinesContent.label","Copy changed lines"):C("diff.clipboard.copyChangedLinesContent.single.label","Copy changed line"),void 0,!0,()=>G9(this,void 0,void 0,function*(){const w=this._originalTextModel.getValueInRange(o.original.toExclusiveRange());yield this._clipboardService.writeText(w)}))),o.original.length>1&&m.push(new ca("diff.clipboard.copyDeletedLineContent",_?C("diff.clipboard.copyDeletedLineContent.label","Copy deleted line ({0})",o.original.startLineNumber+d):C("diff.clipboard.copyChangedLineContent.label","Copy changed line ({0})",o.original.startLineNumber+d),void 0,!0,()=>G9(this,void 0,void 0,function*(){let w=this._originalTextModel.getLineContent(o.original.startLineNumber+d);w===""&&(w=this._originalTextModel.getEndOfLineSequence()===0?` `:`\r -`),yield this._clipboardService.writeText(y)}))),n.getOption(90)||m.push(new la("diff.inline.revertChange",C("diff.inline.revertChange.label","Revert this change"),void 0,!0,()=>G9(this,void 0,void 0,function*(){this._editor.revert(this._diff)}))),m},autoSelectFirstItem:!0})};this._register(No(this._diffActions,"mousedown",g=>{const{top:p,height:v}=Yo(this._diffActions),m=Math.floor(u/3);g.preventDefault(),f(g.posx,p+v+m)})),this._register(n.onMouseMove(g=>{(g.target.type===8||g.target.type===5)&&g.target.detail.viewZoneId===this._getViewZoneId()?(d=this._updateLightBulbPosition(this._marginDomNode,g.event.browserEvent.y,u),this.visibility=!0):this.visibility=!1})),this._register(n.onMouseDown(g=>{!g.event.rightButton||(g.target.type===8||g.target.type===5)&&g.target.detail.viewZoneId===this._getViewZoneId()&&(g.event.preventDefault(),d=this._updateLightBulbPosition(this._marginDomNode,g.event.browserEvent.y,u),f(g.event.posx,g.event.posy+u))}))}_updateLightBulbPosition(e,t,n){const{top:o}=Yo(e),r=t-o,s=Math.floor(r/n),a=s*n;if(this._diffActions.style.top=`${a}px`,this._viewLineCounts){let l=0;for(let c=0;ci});function _pt(i,e,t,n){rs(n,e.fontInfo);const o=t.length>0,r=new _S(1e4);let s=0,a=0;const l=[];for(let h=0;h');const l=e.getLineContent(),c=Yl.isBasicASCII(l,o),u=Yl.containsRTL(l,c,r),d=zI(new Zv(s.fontInfo.isMonospace&&!s.disableMonospaceOptimizations,s.fontInfo.canUseHalfwidthRightwardsArrow,l,!1,c,u,0,e,t,s.tabSize,0,s.fontInfo.spaceWidth,s.fontInfo.middotWidth,s.fontInfo.wsmiddotWidth,s.stopRenderingLineAfter,s.renderWhitespace,s.renderControlCharacters,s.fontLigatures!==Al.OFF,null),a);return a.appendString(""),d.characterMapping.getHorizontalOffset(d.characterMapping.length)}var Cpt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Jae=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let J$=class extends _e{constructor(e,t,n,o,r,s,a){super(),this._editors=e,this._diffModel=t,this._options=n,this._diffEditorWidget=o,this._canIgnoreViewZoneUpdateEvent=r,this._clipboardService=s,this._contextMenuService=a,this._originalTopPadding=Ai(this,0),this._originalScrollOffset=Ai(this,0),this._originalScrollOffsetAnimated=Vae(this._originalScrollOffset,this._store),this._modifiedTopPadding=Ai(this,0),this._modifiedScrollOffset=Ai(this,0),this._modifiedScrollOffsetAnimated=Vae(this._modifiedScrollOffset,this._store);let l=!1;const c=Ai("state",0),u=this._register(new bi(()=>{c.set(c.get()+1,void 0)},0));this._register(this._editors.original.onDidChangeViewZones(y=>{!l&&!this._canIgnoreViewZoneUpdateEvent()&&u.schedule()})),this._register(this._editors.modified.onDidChangeViewZones(y=>{!l&&!this._canIgnoreViewZoneUpdateEvent()&&u.schedule()})),this._register(this._editors.original.onDidChangeConfiguration(y=>{(y.hasChanged(144)||y.hasChanged(66))&&u.schedule()})),this._register(this._editors.modified.onDidChangeConfiguration(y=>{(y.hasChanged(144)||y.hasChanged(66))&&u.schedule()}));const d=this._diffModel.map(y=>y?$r(y.model.original.onDidChangeTokens,()=>y.model.original.tokenization.backgroundTokenizationState===2):void 0).map((y,L)=>y==null?void 0:y.read(L)),h=new Set,f=new Set,g=In(y=>{const L=this._diffModel.read(y),D=L==null?void 0:L.diff.read(y);if(!L||!D)return null;c.read(y);const I=this._options.renderSideBySide.read(y);return ele(this._editors.original,this._editors.modified,D.mappings,h,f,I)}),p=In(y=>{var L;const D=(L=this._diffModel.read(y))===null||L===void 0?void 0:L.movedTextToCompare.read(y);if(!D)return null;c.read(y);const E=D.changes.map(I=>new FCe(I));return ele(this._editors.original,this._editors.modified,E,h,f,!0)});function v(){const y=document.createElement("div");return y.className="diagonal-fill",y}const m=this._register(new Be),_=In(y=>{var L,D,E,I,k,R,A,P;m.clear();const N=g.read(y)||[],M=[],H=[],W=this._modifiedTopPadding.read(y);W>0&&H.push({afterLineNumber:0,domNode:document.createElement("div"),heightInPx:W,showInHiddenAreas:!0,suppressMouseDown:!0});const F=this._originalTopPadding.read(y);F>0&&M.push({afterLineNumber:0,domNode:document.createElement("div"),heightInPx:F,showInHiddenAreas:!0,suppressMouseDown:!0});const $=this._options.renderSideBySide.read(y),z=$||(L=this._editors.modified._getViewModel())===null||L===void 0?void 0:L.createLineBreaksComputer();if(z){for(const be of N)if(be.diff)for(let Se=be.originalRange.startLineNumber;Sethis._editors.original.getModel().tokenization.getLineTokens(Ee)),be.originalRange.mapToLineArray(Ee=>K[j++]),de,he),ce=[];for(const Ee of be.diff.innerChanges||[])ce.push(new cE(Ee.originalRange.delta(-(be.diff.original.startLineNumber-1)),G$.className,0));const Pe=_pt(De,pe,ce,Fe),Oe=document.createElement("div");if(Oe.className="inline-deleted-margin-view-zone",rs(Oe,pe.fontInfo),this._options.renderIndicators.read(y))for(let Ee=0;Ees0(xe),Oe,this._editors.modified,be.diff,this._diffEditorWidget,Pe.viewLineCounts,this._editors.original.getModel(),this._contextMenuService,this._clipboardService));for(let Ee=0;Ee1&&M.push({afterLineNumber:be.originalRange.startLineNumber+Ee,domNode:v(),heightInPx:(tt-1)*G,showInHiddenAreas:!0,suppressMouseDown:!0})}H.push({afterLineNumber:be.modifiedRange.startLineNumber-1,domNode:Fe,heightInPx:Pe.heightInLines*G,minWidthInPx:Pe.minWidthInPx,marginDomNode:Oe,setZoneId(Ee){xe=Ee},showInHiddenAreas:!0,suppressMouseDown:!0})}const Se=document.createElement("div");Se.className="gutter-delete",M.push({afterLineNumber:be.originalRange.endLineNumberExclusive-1,domNode:v(),heightInPx:be.modifiedHeightInPx,marginDomNode:Se,showInHiddenAreas:!0,suppressMouseDown:!0})}else{const Se=be.modifiedHeightInPx-be.originalHeightInPx;if(Se>0){if(X!=null&&X.lineRangeMapping.original.delta(-1).deltaLength(2).contains(be.originalRange.endLineNumberExclusive-1))continue;M.push({afterLineNumber:be.originalRange.endLineNumberExclusive-1,domNode:v(),heightInPx:Se,showInHiddenAreas:!0,suppressMouseDown:!0})}else{let Fe=function(){const ce=document.createElement("div");return ce.className="arrow-revert-change "+Mt.asClassName(Xe.arrowRight),He("div",{},ce)};if(X!=null&&X.lineRangeMapping.modified.delta(-1).deltaLength(2).contains(be.modifiedRange.endLineNumberExclusive-1))continue;let De;be.diff&&be.diff.modified.isEmpty&&this._options.shouldRenderRevertArrows.read(y)&&(De=Fe()),H.push({afterLineNumber:be.modifiedRange.endLineNumberExclusive-1,domNode:v(),heightInPx:-Se,marginDomNode:De,showInHiddenAreas:!0,suppressMouseDown:!0})}}for(const be of(P=p.read(y))!==null&&P!==void 0?P:[]){if(!(X!=null&&X.lineRangeMapping.original.intersect(be.originalRange))||!(X!=null&&X.lineRangeMapping.modified.intersect(be.modifiedRange)))continue;const Se=be.modifiedHeightInPx-be.originalHeightInPx;Se>0?M.push({afterLineNumber:be.originalRange.endLineNumberExclusive-1,domNode:v(),heightInPx:Se,showInHiddenAreas:!0,suppressMouseDown:!0}):H.push({afterLineNumber:be.modifiedRange.endLineNumberExclusive-1,domNode:v(),heightInPx:-Se,showInHiddenAreas:!0,suppressMouseDown:!0})}return{orig:M,mod:H}});this._register(Ja(y=>{const L=Yd.capture(this._editors.modified),D=_.read(y);l=!0,this._editors.original.changeViewZones(E=>{for(const I of h)E.removeZone(I);h.clear();for(const I of D.orig){const k=E.addZone(I);I.setZoneId&&I.setZoneId(k),h.add(k)}}),this._editors.modified.changeViewZones(E=>{for(const I of f)E.removeZone(I);f.clear();for(const I of D.mod){const k=E.addZone(I);I.setZoneId&&I.setZoneId(k),f.add(k)}}),l=!1,L.restore(this._editors.modified)})),this._register(zt(()=>{this._editors.original.changeViewZones(y=>{for(const L of h)y.removeZone(L);h.clear()}),this._editors.modified.changeViewZones(y=>{for(const L of f)y.removeZone(L);f.clear()})}));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=$r(this._editors.original.onDidScrollChange,()=>this._editors.original.getScrollTop()),this._modifiedScrollTop=$r(this._editors.modified.onDidScrollChange,()=>this._editors.modified.getScrollTop()),this._register(Ii(y=>{const L=this._originalScrollTop.read(y)-(this._originalScrollOffsetAnimated.get()-this._modifiedScrollOffsetAnimated.read(y))-(this._originalTopPadding.get()-this._modifiedTopPadding.read(y));L!==this._editors.modified.getScrollTop()&&this._editors.modified.setScrollTop(L,1)})),this._register(Ii(y=>{const L=this._modifiedScrollTop.read(y)-(this._modifiedScrollOffsetAnimated.get()-this._originalScrollOffsetAnimated.read(y))-(this._modifiedTopPadding.get()-this._originalTopPadding.read(y));L!==this._editors.original.getScrollTop()&&this._editors.original.setScrollTop(L,1)})),this._register(Ii(y=>{var L;const D=(L=this._diffModel.read(y))===null||L===void 0?void 0:L.movedTextToCompare.read(y);let E=0;if(D){const I=this._editors.original.getTopForLineNumber(D.lineRangeMapping.original.startLineNumber,!0)-this._originalTopPadding.get();E=this._editors.modified.getTopForLineNumber(D.lineRangeMapping.modified.startLineNumber,!0)-this._modifiedTopPadding.get()-I}E>0?(this._modifiedTopPadding.set(0,void 0),this._originalTopPadding.set(E,void 0)):E<0?(this._modifiedTopPadding.set(-E,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()-E,void 0,!0):this._modifiedScrollOffset.set(this._originalScrollOffset.get()+E,void 0,!0)}))}};J$=Cpt([Jae(5,bp),Jae(6,ju)],J$);function ele(i,e,t,n,o,r){const s=new rp(tle(i,n)),a=new rp(tle(e,o)),l=i.getOption(66),c=e.getOption(66),u=[];let d=0,h=0;function f(g,p){for(;;){let v=s.peek(),m=a.peek();if(v&&v.lineNumber>=g&&(v=void 0),m&&m.lineNumber>=p&&(m=void 0),!v&&!m)break;const _=v?v.lineNumber-d:Number.MAX_VALUE,w=m?m.lineNumber-h:Number.MAX_VALUE;_w?(a.dequeue(),v={lineNumber:m.lineNumber-h+d,heightInPx:0}):(s.dequeue(),a.dequeue()),u.push({originalRange:ln.ofLength(v.lineNumber,1),modifiedRange:ln.ofLength(m.lineNumber,1),originalHeightInPx:l+v.heightInPx,modifiedHeightInPx:c+m.heightInPx,diff:void 0})}}for(const g of t){let w=function(y,L){var D,E,I,k;if(y<_||LM.lineNumberM+H.heightInPx,0))!==null&&E!==void 0?E:0,N=(k=(I=a.takeWhile(M=>M.lineNumberM+H.heightInPx,0))!==null&&k!==void 0?k:0;u.push({originalRange:R,modifiedRange:A,originalHeightInPx:R.length*l+P,modifiedHeightInPx:A.length*c+N,diff:g.lineRangeMapping}),_=y,m=L};const p=g.lineRangeMapping;f(p.original.startLineNumber,p.modified.startLineNumber);let v=!0,m=p.modified.startLineNumber,_=p.original.startLineNumber;if(r)for(const y of p.innerChanges||[])y.originalRange.startColumn>1&&y.modifiedRange.startColumn>1&&w(y.originalRange.startLineNumber,y.modifiedRange.startLineNumber),y.originalRange.endColumn1&&n.push({lineNumber:l,heightInPx:s*(c-1)})}for(const l of i.getWhitespaces()){if(e.has(l.id))continue;const c=l.afterLineNumber===0?0:r.convertViewPositionToModelPosition(new ae(l.afterLineNumber,1)).lineNumber;t.push({lineNumber:c,heightInPx:l.height})}return Bgt(t,n,l=>l.lineNumber,(l,c)=>({lineNumber:l.lineNumber,heightInPx:l.heightInPx+c.heightInPx}))}var wpt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},ypt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},ld;let Xg=ld=class extends _e{constructor(e,t,n,o,r,s,a,l){super(),this._editors=e,this._rootElement=t,this._diffModel=n,this._rootWidth=o,this._rootHeight=r,this._modifiedEditorLayoutInfo=s,this._options=a,this._themeService=l;const c=$r(this._themeService.onDidColorThemeChange,()=>this._themeService.getColorTheme()),u=In(f=>{const g=c.read(f),p=g.getColor(Fnt)||(g.getColor(Pnt)||cH).transparent(2),v=g.getColor(Bnt)||(g.getColor(Ont)||uH).transparent(2);return{insertColor:p,removeColor:v}}),d=$r(this._editors.modified.onDidScrollChange,()=>this._editors.modified.getScrollTop()),h=$r(this._editors.modified.onDidScrollChange,()=>this._editors.modified.getScrollHeight());this._register(Ja((f,g)=>{if(!this._options.renderOverviewRuler.read(f))return;const p=ti(document.createElement("div"));p.setClassName("diffViewport"),p.setPosition("absolute");const v=Or("div.diffOverview",{style:{position:"absolute",top:"0px",width:ld.ENTIRE_DIFF_OVERVIEW_WIDTH+"px"}}).root;g.add(W2(v,p.domNode)),g.add(No(v,et.POINTER_DOWN,m=>{this._editors.modified.delegateVerticalScrollbarPointerDown(m)})),g.add(ke(v,et.MOUSE_WHEEL,m=>{this._editors.modified.delegateScrollFromMouseWheelEvent(m)},{passive:!1})),g.add(W2(this._rootElement,v)),g.add(Ja((m,_)=>{const w=this._diffModel.read(m),y=this._editors.original.createOverviewRuler("original diffOverviewRuler");y&&(_.add(y),_.add(W2(v,y.getDomNode())));const L=this._editors.modified.createOverviewRuler("modified diffOverviewRuler");if(L&&(_.add(L),_.add(W2(v,L.getDomNode()))),!y||!L)return;const D=Ol("viewZoneChanged",this._editors.original.onDidChangeViewZones),E=Ol("viewZoneChanged",this._editors.modified.onDidChangeViewZones),I=Ol("hiddenRangesChanged",this._editors.original.onDidChangeHiddenAreas),k=Ol("hiddenRangesChanged",this._editors.modified.onDidChangeHiddenAreas);_.add(Ii(R=>{var A;D.read(R),E.read(R),I.read(R),k.read(R);const P=u.read(R),N=(A=w==null?void 0:w.diff.read(R))===null||A===void 0?void 0:A.mappings;function M(F,$,z){const K=z._getViewModel();return K?F.filter(j=>j.length>0).map(j=>{const G=K.coordinatesConverter.convertModelPositionToViewPosition(new ae(j.startLineNumber,1)),X=K.coordinatesConverter.convertModelPositionToViewPosition(new ae(j.endLineNumberExclusive,1)),de=X.lineNumber-G.lineNumber;return new Tbe(G.lineNumber,X.lineNumber,de,$.toString())}):[]}const H=M((N||[]).map(F=>F.lineRangeMapping.original),P.removeColor,this._editors.original),W=M((N||[]).map(F=>F.lineRangeMapping.modified),P.insertColor,this._editors.modified);y==null||y.setZones(H),L==null||L.setZones(W)})),_.add(Ii(R=>{const A=this._rootHeight.read(R),P=this._rootWidth.read(R),N=this._modifiedEditorLayoutInfo.read(R);if(N){const M=ld.ENTIRE_DIFF_OVERVIEW_WIDTH-2*ld.ONE_OVERVIEW_WIDTH;y.setLayout({top:0,height:A,right:M+ld.ONE_OVERVIEW_WIDTH,width:ld.ONE_OVERVIEW_WIDTH}),L.setLayout({top:0,height:A,right:0,width:ld.ONE_OVERVIEW_WIDTH});const H=d.read(R),W=h.read(R),F=this._editors.modified.getOption(102),$=new Ey(F.verticalHasArrows?F.arrowSize:0,F.verticalScrollbarSize,0,N.height,W,H);p.setTop($.getSliderPosition()),p.setHeight($.getSliderSize())}else p.setTop(0),p.setHeight(0);v.style.height=A+"px",v.style.left=P-ld.ENTIRE_DIFF_OVERVIEW_WIDTH+"px",p.setWidth(ld.ENTIRE_DIFF_OVERVIEW_WIDTH)}))}))}))}};Xg.ONE_OVERVIEW_WIDTH=15;Xg.ENTIRE_DIFF_OVERVIEW_WIDTH=ld.ONE_OVERVIEW_WIDTH*2;Xg=ld=wpt([ypt(7,mr)],Xg);J("diffEditor.move.border",{dark:"#8b8b8b9c",light:"#8b8b8b9c",hcDark:"#8b8b8b9c",hcLight:"#8b8b8b9c"},C("diffEditor.move.border","The border color for text that got moved in the diff editor."));J("diffEditor.moveActive.border",{dark:"#FFA500",light:"#FFA500",hcDark:"#FFA500",hcLight:"#FFA500"},C("diffEditor.moveActive.border","The active border color for text that got moved in the diff editor."));class Q5 extends _e{constructor(){super(...arguments),this._id=++Q5.idCounter,this._onDidDispose=this._register(new le),this.onDidDispose=this._onDidDispose.event}getId(){return this.getEditorType()+":v2:"+this._id}getVisibleColumnFromPosition(e){return this._targetEditor.getVisibleColumnFromPosition(e)}getPosition(){return this._targetEditor.getPosition()}setPosition(e,t="api"){this._targetEditor.setPosition(e,t)}revealLine(e,t=0){this._targetEditor.revealLine(e,t)}revealLineInCenter(e,t=0){this._targetEditor.revealLineInCenter(e,t)}revealLineInCenterIfOutsideViewport(e,t=0){this._targetEditor.revealLineInCenterIfOutsideViewport(e,t)}revealLineNearTop(e,t=0){this._targetEditor.revealLineNearTop(e,t)}revealPosition(e,t=0){this._targetEditor.revealPosition(e,t)}revealPositionInCenter(e,t=0){this._targetEditor.revealPositionInCenter(e,t)}revealPositionInCenterIfOutsideViewport(e,t=0){this._targetEditor.revealPositionInCenterIfOutsideViewport(e,t)}revealPositionNearTop(e,t=0){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,n=0){this._targetEditor.revealLines(e,t,n)}revealLinesInCenter(e,t,n=0){this._targetEditor.revealLinesInCenter(e,t,n)}revealLinesInCenterIfOutsideViewport(e,t,n=0){this._targetEditor.revealLinesInCenterIfOutsideViewport(e,t,n)}revealLinesNearTop(e,t,n=0){this._targetEditor.revealLinesNearTop(e,t,n)}revealRange(e,t=0,n=!1,o=!0){this._targetEditor.revealRange(e,t,n,o)}revealRangeInCenter(e,t=0){this._targetEditor.revealRangeInCenter(e,t)}revealRangeInCenterIfOutsideViewport(e,t=0){this._targetEditor.revealRangeInCenterIfOutsideViewport(e,t)}revealRangeNearTop(e,t=0){this._targetEditor.revealRangeNearTop(e,t)}revealRangeNearTopIfOutsideViewport(e,t=0){this._targetEditor.revealRangeNearTopIfOutsideViewport(e,t)}revealRangeAtTop(e,t=0){this._targetEditor.revealRangeAtTop(e,t)}getSupportedActions(){return this._targetEditor.getSupportedActions()}focus(){this._targetEditor.focus()}trigger(e,t,n){this._targetEditor.trigger(e,t,n)}createDecorationsCollection(e){return this._targetEditor.createDecorationsCollection(e)}changeDecorations(e){return this._targetEditor.changeDecorations(e)}}Q5.idCounter=0;var Spt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},nle=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let ez=class extends _e{constructor(e,t,n,o,r,s,a){super(),this.originalEditorElement=e,this.modifiedEditorElement=t,this._options=n,this._createInnerEditor=r,this._instantiationService=s,this._keybindingService=a,this._onDidContentSizeChange=this._register(new le),this.original=this._register(this._createLeftHandSideEditor(n.editorOptions.get(),o.originalEditor||{})),this.modified=this._register(this._createRightHandSideEditor(n.editorOptions.get(),o.modifiedEditor||{})),this.modifiedModel=$r(this.modified.onDidChangeModel,()=>this.modified.getModel()),this._register(X5({createEmptyChangeSummary:()=>({}),handleChange:(l,c)=>(l.didChange(n.editorOptions)&&Object.assign(c,l.change.changedOptions),!0)},(l,c)=>{n.editorOptions.read(l),this._options.renderSideBySide.read(l),this.modified.updateOptions(this._adjustOptionsForRightHandSide(l,c)),this.original.updateOptions(this._adjustOptionsForLeftHandSide(l,c))}))}_createLeftHandSideEditor(e,t){const n=this._adjustOptionsForLeftHandSide(void 0,e),o=this._constructInnerEditor(this._instantiationService,this.originalEditorElement,n,t);return o.setContextValue("isInDiffLeftEditor",!0),o}_createRightHandSideEditor(e,t){const n=this._adjustOptionsForRightHandSide(void 0,e),o=this._constructInnerEditor(this._instantiationService,this.modifiedEditorElement,n,t);return o.setContextValue("isInDiffRightEditor",!0),o}_constructInnerEditor(e,t,n,o){const r=this._createInnerEditor(e,t,n,o);return this._register(r.onDidContentSizeChange(s=>{const a=this.original.getContentWidth()+this.modified.getContentWidth()+Xg.ENTIRE_DIFF_OVERVIEW_WIDTH,l=Math.max(this.modified.getContentHeight(),this.original.getContentHeight());this._onDidContentSizeChange.fire({contentHeight:l,contentWidth:a,contentHeightChanged:s.contentHeightChanged,contentWidthChanged:s.contentWidthChanged})})),r}_adjustOptionsForLeftHandSide(e,t){const n=this._adjustOptionsForSubEditor(t);return this._options.renderSideBySide.get()?(n.unicodeHighlight=this._options.editorOptions.get().unicodeHighlight||{},n.wordWrapOverride1=this._options.diffWordWrap.get()):(n.wordWrapOverride1="off",n.wordWrapOverride2="off",n.stickyScroll={enabled:!1},n.unicodeHighlight={nonBasicASCII:!1,ambiguousCharacters:!1,invisibleCharacters:!1}),t.originalAriaLabel&&(n.ariaLabel=t.originalAriaLabel),n.ariaLabel=this._updateAriaLabel(n.ariaLabel),n.readOnly=!this._options.originalEditable.get(),n.dropIntoEditor={enabled:!n.readOnly},n.extraEditorClassName="original-in-monaco-diff-editor",n}_adjustOptionsForRightHandSide(e,t){const n=this._adjustOptionsForSubEditor(t);return t.modifiedAriaLabel&&(n.ariaLabel=t.modifiedAriaLabel),n.ariaLabel=this._updateAriaLabel(n.ariaLabel),n.wordWrapOverride1=this._options.diffWordWrap.get(),n.revealHorizontalRightPadding=ih.revealHorizontalRightPadding.defaultValue+Xg.ENTIRE_DIFF_OVERVIEW_WIDTH,n.scrollbar.verticalHasArrows=!1,n.extraEditorClassName="modified-in-monaco-diff-editor",n}_adjustOptionsForSubEditor(e){const t=Object.assign(Object.assign({},e),{dimension:{height:0,width:0}});return t.inDiffEditor=!0,t.automaticLayout=!1,t.scrollbar=Object.assign({},t.scrollbar||{}),t.scrollbar.vertical="visible",t.folding=!1,t.codeLens=this._options.diffCodeLens.get(),t.fixedOverflowWidgets=!0,t.minimap=Object.assign({},t.minimap||{}),t.minimap.enabled=!1,this._options.hideUnchangedRegions.get()?t.stickyScroll={enabled:!1}:t.stickyScroll=this._options.editorOptions.get().stickyScroll,t}_updateAriaLabel(e){var t;e||(e="");const n=C("diff-aria-navigation-tip"," use {0} to open the accessibility help.",(t=this._keybindingService.lookupKeybinding("editor.action.accessibilityHelp"))===null||t===void 0?void 0:t.getAriaLabel());return this._options.accessibilityVerbose.get()?e+n:e?e.replaceAll(n,""):""}};ez=Spt([nle(5,$t),nle(6,xi)],ez);class xpt{get editorOptions(){return this._options}constructor(e,t){this.diffEditorWidth=t,this.couldShowInlineViewBecauseOfSize=In(this,o=>this._options.read(o).renderSideBySide&&this.diffEditorWidth.read(o)<=this._options.read(o).renderSideBySideInlineBreakpoint),this.renderOverviewRuler=In(this,o=>this._options.read(o).renderOverviewRuler),this.renderSideBySide=In(this,o=>this._options.read(o).renderSideBySide&&!(this._options.read(o).useInlineViewWhenSpaceIsLimited&&this.couldShowInlineViewBecauseOfSize.read(o))),this.readOnly=In(this,o=>this._options.read(o).readOnly),this.shouldRenderRevertArrows=In(this,o=>!(!this._options.read(o).renderMarginRevertIcon||!this.renderSideBySide.read(o)||this.readOnly.read(o))),this.renderIndicators=In(this,o=>this._options.read(o).renderIndicators),this.enableSplitViewResizing=In(this,o=>this._options.read(o).enableSplitViewResizing),this.splitViewDefaultRatio=In(this,o=>this._options.read(o).splitViewDefaultRatio),this.ignoreTrimWhitespace=In(this,o=>this._options.read(o).ignoreTrimWhitespace),this.maxComputationTimeMs=In(this,o=>this._options.read(o).maxComputationTime),this.showMoves=In(this,o=>this._options.read(o).experimental.showMoves&&this.renderSideBySide.read(o)),this.isInEmbeddedEditor=In(this,o=>this._options.read(o).isInEmbeddedEditor),this.diffWordWrap=In(this,o=>this._options.read(o).diffWordWrap),this.originalEditable=In(this,o=>this._options.read(o).originalEditable),this.diffCodeLens=In(this,o=>this._options.read(o).diffCodeLens),this.accessibilityVerbose=In(this,o=>this._options.read(o).accessibilityVerbose),this.diffAlgorithm=In(this,o=>this._options.read(o).diffAlgorithm),this.showEmptyDecorations=In(this,o=>this._options.read(o).experimental.showEmptyDecorations),this.onlyShowAccessibleDiffViewer=In(this,o=>this._options.read(o).onlyShowAccessibleDiffViewer),this.hideUnchangedRegions=In(this,o=>this._options.read(o).hideUnchangedRegions.enabled),this.hideUnchangedRegionsRevealLineCount=In(this,o=>this._options.read(o).hideUnchangedRegions.revealLineCount),this.hideUnchangedRegionsContextLineCount=In(this,o=>this._options.read(o).hideUnchangedRegions.contextLineCount),this.hideUnchangedRegionsMinimumLineCount=In(this,o=>this._options.read(o).hideUnchangedRegions.minimumLineCount);const n=Object.assign(Object.assign({},e),ile(e,Ms));this._options=Ai(this,n)}updateOptions(e){const t=ile(e,this._options.get()),n=Object.assign(Object.assign(Object.assign({},this._options.get()),e),t);this._options.set(n,void 0,{changedOptions:e})}}function ile(i,e){var t,n,o,r,s,a,l,c;return{enableSplitViewResizing:St(i.enableSplitViewResizing,e.enableSplitViewResizing),splitViewDefaultRatio:kXe(i.splitViewDefaultRatio,.5,.1,.9),renderSideBySide:St(i.renderSideBySide,e.renderSideBySide),renderMarginRevertIcon:St(i.renderMarginRevertIcon,e.renderMarginRevertIcon),maxComputationTime:T_(i.maxComputationTime,e.maxComputationTime,0,1073741824),maxFileSize:T_(i.maxFileSize,e.maxFileSize,0,1073741824),ignoreTrimWhitespace:St(i.ignoreTrimWhitespace,e.ignoreTrimWhitespace),renderIndicators:St(i.renderIndicators,e.renderIndicators),originalEditable:St(i.originalEditable,e.originalEditable),diffCodeLens:St(i.diffCodeLens,e.diffCodeLens),renderOverviewRuler:St(i.renderOverviewRuler,e.renderOverviewRuler),diffWordWrap:To(i.diffWordWrap,e.diffWordWrap,["off","on","inherit"]),diffAlgorithm:To(i.diffAlgorithm,e.diffAlgorithm,["legacy","advanced"],{smart:"legacy",experimental:"advanced"}),accessibilityVerbose:St(i.accessibilityVerbose,e.accessibilityVerbose),experimental:{showMoves:St((t=i.experimental)===null||t===void 0?void 0:t.showMoves,e.experimental.showMoves),showEmptyDecorations:St((n=i.experimental)===null||n===void 0?void 0:n.showEmptyDecorations,e.experimental.showEmptyDecorations)},hideUnchangedRegions:{enabled:St((r=(o=i.hideUnchangedRegions)===null||o===void 0?void 0:o.enabled)!==null&&r!==void 0?r:(s=i.experimental)===null||s===void 0?void 0:s.collapseUnchangedRegions,e.hideUnchangedRegions.enabled),contextLineCount:T_((a=i.hideUnchangedRegions)===null||a===void 0?void 0:a.contextLineCount,e.hideUnchangedRegions.contextLineCount,0,1073741824),minimumLineCount:T_((l=i.hideUnchangedRegions)===null||l===void 0?void 0:l.minimumLineCount,e.hideUnchangedRegions.minimumLineCount,0,1073741824),revealLineCount:T_((c=i.hideUnchangedRegions)===null||c===void 0?void 0:c.revealLineCount,e.hideUnchangedRegions.revealLineCount,0,1073741824)},isInEmbeddedEditor:St(i.isInEmbeddedEditor,e.isInEmbeddedEditor),onlyShowAccessibleDiffViewer:St(i.onlyShowAccessibleDiffViewer,e.onlyShowAccessibleDiffViewer),renderSideBySideInlineBreakpoint:T_(i.renderSideBySideInlineBreakpoint,e.renderSideBySideInlineBreakpoint,0,1073741824),useInlineViewWhenSpaceIsLimited:St(i.useInlineViewWhenSpaceIsLimited,e.useInlineViewWhenSpaceIsLimited)}}var Lpt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},jx=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let lb=class extends Q5{constructor(e,t,n,o,r,s,a,l){var c;super(),this._domElement=e,this._parentContextKeyService=o,this._parentInstantiationService=r,this._audioCueService=a,this._editorProgressService=l,this.elements=Or("div.monaco-diff-editor.side-by-side",{style:{position:"relative",height:"100%"}},[Or("div.noModificationsOverlay@overlay",{style:{position:"absolute",height:"100%",visibility:"hidden"}},[He("span",{},"No Changes")]),Or("div.editor.original@original",{style:{position:"absolute",height:"100%"}}),Or("div.editor.modified@modified",{style:{position:"absolute",height:"100%"}}),Or("div.accessibleDiffViewer@accessibleDiffViewer",{style:{position:"absolute",height:"100%"}})]),this._diffModel=this._register(YP("diffModel",void 0)),this.onDidChangeModel=st.fromObservableLight(this._diffModel),this._contextKeyService=this._register(this._parentContextKeyService.createScoped(this._domElement)),this._instantiationService=this._parentInstantiationService.createChild(new x5([Ut,this._contextKeyService])),this._boundarySashes=Ai(this,void 0),this._accessibleDiffViewerShouldBeVisible=Ai(this,!1),this._accessibleDiffViewerVisible=In(this,p=>this._options.onlyShowAccessibleDiffViewer.read(p)?!0:this._accessibleDiffViewerShouldBeVisible.read(p)),this.movedBlocksLinesPart=Ai(this,void 0),this._layoutInfo=In(this,p=>{var v,m,_;const w=this._rootSizeObserver.width.read(p),y=this._rootSizeObserver.height.read(p),L=(v=this._sash.read(p))===null||v===void 0?void 0:v.sashLeft.read(p),D=L!=null?L:Math.max(5,this._editors.original.getLayoutInfo().decorationsLeft),E=w-D-(this._options.renderOverviewRuler.read(p)?Xg.ENTIRE_DIFF_OVERVIEW_WIDTH:0),I=(_=(m=this.movedBlocksLinesPart.read(p))===null||m===void 0?void 0:m.width.read(p))!==null&&_!==void 0?_:0,k=D-I;return this.elements.original.style.width=k+"px",this.elements.original.style.left="0px",this.elements.modified.style.width=E+"px",this.elements.modified.style.left=D+"px",this._editors.original.layout({width:k,height:y}),this._editors.modified.layout({width:E,height:y}),{modifiedEditor:this._editors.modified.getLayoutInfo(),originalEditor:this._editors.original.getLayoutInfo()}}),this._diffValue=this._diffModel.map((p,v)=>p==null?void 0:p.diff.read(v)),this.onDidUpdateDiff=st.fromObservableLight(this._diffValue),s.willCreateDiffEditor(),this._contextKeyService.createKey("isInDiffEditor",!0),this._domElement.appendChild(this.elements.root),this._register(zt(()=>this._domElement.removeChild(this.elements.root))),this._rootSizeObserver=this._register(new Wgt(this.elements.root,t.dimension)),this._rootSizeObserver.setAutomaticLayout((c=t.automaticLayout)!==null&&c!==void 0?c:!1),this._options=new xpt(t,this._rootSizeObserver.width),this._contextKeyService.createKey(Q.isEmbeddedDiffEditor.key,!1);const u=Q.isEmbeddedDiffEditor.bindTo(this._contextKeyService);this._register(Ii(p=>{u.set(this._options.isInEmbeddedEditor.read(p))}));const d=Q.comparingMovedCode.bindTo(this._contextKeyService);this._register(Ii(p=>{var v;d.set(!!(!((v=this._diffModel.read(p))===null||v===void 0)&&v.movedTextToCompare.read(p)))}));const h=Q.diffEditorRenderSideBySideInlineBreakpointReached.bindTo(this._contextKeyService);this._register(Ii(p=>{h.set(this._options.couldShowInlineViewBecauseOfSize.read(p))})),this._editors=this._register(this._instantiationService.createInstance(ez,this.elements.original,this.elements.modified,this._options,n,(p,v,m,_)=>this._createInnerEditor(p,v,m,_))),this._sash=kk(this,(p,v)=>{const m=this._options.renderSideBySide.read(p);if(this.elements.root.classList.toggle("side-by-side",m),!m)return;const _=v.add(new spt(this._options,this.elements.root,{height:this._rootSizeObserver.height,width:this._rootSizeObserver.width.map((w,y)=>w-(this._options.renderOverviewRuler.read(y)?Xg.ENTIRE_DIFF_OVERVIEW_WIDTH:0))}));return v.add(Ii(w=>{const y=this._boundarySashes.read(w);y&&_.setBoundarySashes(y)})),_}),this._register(Tk(this._sash)),this._register(Ja((p,v)=>{this.unchangedRangesFeature=v.add(this._instantiationService.createInstance(tm(X$,p),this._editors,this._diffModel,this._options))})),this._register(Ja((p,v)=>{v.add(new(tm(rpt,p))(this._editors,this._diffModel,this._options))})),this._register(Ja((p,v)=>{v.add(this._instantiationService.createInstance(tm(J$,p),this._editors,this._diffModel,this._options,this,()=>this.unchangedRangesFeature.isUpdatingViewZones))})),this._register(Ja((p,v)=>{v.add(this._instantiationService.createInstance(tm(Xg,p),this._editors,this.elements.root,this._diffModel,this._rootSizeObserver.width,this._rootSizeObserver.height,this._layoutInfo.map(m=>m.modifiedEditor),this._options))})),this._register(Ja((p,v)=>{this._accessibleDiffViewer=v.add(this._register(this._instantiationService.createInstance(tm(km,p),this.elements.accessibleDiffViewer,this._accessibleDiffViewerVisible,(m,_)=>this._accessibleDiffViewerShouldBeVisible.set(m,_),this._options.onlyShowAccessibleDiffViewer.map(m=>!m),this._rootSizeObserver.width,this._rootSizeObserver.height,this._diffModel.map((m,_)=>{var w;return(w=m==null?void 0:m.diff.read(_))===null||w===void 0?void 0:w.mappings.map(y=>y.lineRangeMapping)}),this._editors)))}));const f=this._accessibleDiffViewerVisible.map(p=>p?"hidden":"visible");this._register(ev(this.elements.modified,{visibility:f})),this._register(ev(this.elements.original,{visibility:f})),this._createDiffEditorContributions(),s.addDiffEditor(this),this._register(Tk(this._layoutInfo)),this._register(Ja((p,v)=>{this.movedBlocksLinesPart.set(v.add(new(tm(tv,p))(this.elements.root,this._diffModel,this._layoutInfo.map(m=>m.originalEditor),this._layoutInfo.map(m=>m.modifiedEditor),this._editors)),void 0)})),this._register(ev(this.elements.overlay,{width:this._layoutInfo.map((p,v)=>p.originalEditor.width+(this._options.renderSideBySide.read(v)?0:p.modifiedEditor.width)),visibility:In(p=>{var v,m;return this._options.hideUnchangedRegions.read(p)&&((m=(v=this._diffModel.read(p))===null||v===void 0?void 0:v.diff.read(p))===null||m===void 0?void 0:m.mappings.length)===0?"visible":"hidden"})})),this._register(this._editors.modified.onMouseDown(p=>{var v,m;if(!p.event.rightButton&&p.target.position&&((v=p.target.element)===null||v===void 0?void 0:v.className.includes("arrow-revert-change"))){const _=p.target.position.lineNumber,w=p.target,y=this._diffModel.get();if(!y)return;const L=(m=y.diff.get())===null||m===void 0?void 0:m.mappings;if(!L)return;const D=L.find(E=>(w==null?void 0:w.detail.afterLineNumber)===E.lineRangeMapping.modified.startLineNumber-1||E.lineRangeMapping.modified.startLineNumber===_);if(!D)return;this.revert(D.lineRangeMapping),p.event.stopPropagation()}})),this._register(st.runAndSubscribe(this._editors.modified.onDidChangeCursorPosition,p=>{var v,m;if((p==null?void 0:p.reason)===3){const _=(m=(v=this._diffModel.get())===null||v===void 0?void 0:v.diff.get())===null||m===void 0?void 0:m.mappings.find(w=>w.lineRangeMapping.modified.contains(p.position.lineNumber));_!=null&&_.lineRangeMapping.modified.isEmpty?this._audioCueService.playAudioCue(Wn.diffLineDeleted,{source:"diffEditor.cursorPositionChanged"}):_!=null&&_.lineRangeMapping.original.isEmpty?this._audioCueService.playAudioCue(Wn.diffLineInserted,{source:"diffEditor.cursorPositionChanged"}):_&&this._audioCueService.playAudioCue(Wn.diffLineModified,{source:"diffEditor.cursorPositionChanged"})}}));const g=this._diffModel.map((p,v)=>p==null?void 0:p.isDiffUpToDate.read(v));this._register(Ja((p,v)=>{if(g.read(p)===!1){const m=this._editorProgressService.show(!0,1e3);v.add(zt(()=>m.done()))}}))}_createInnerEditor(e,t,n,o){return e.createInstance(ky,t,n,o)}_createDiffEditorContributions(){const e=vw.getDiffEditorContributions();for(const t of e)try{this._register(this._instantiationService.createInstance(t.ctor,this))}catch(n){en(n)}}get _targetEditor(){return this._editors.modified}getEditorType(){return $I.IDiffEditor}layout(e){this._rootSizeObserver.observe(e)}hasTextFocus(){return this._editors.original.hasTextFocus()||this._editors.modified.hasTextFocus()}saveViewState(){var e;const t=this._editors.original.saveViewState(),n=this._editors.modified.saveViewState();return{original:t,modified:n,modelState:(e=this._diffModel.get())===null||e===void 0?void 0:e.serializeState()}}restoreViewState(e){var t;if(e&&e.original&&e.modified){const n=e;this._editors.original.restoreViewState(n.original),this._editors.modified.restoreViewState(n.modified),n.modelState&&((t=this._diffModel.get())===null||t===void 0||t.restoreSerializedState(n.modelState))}}createViewModel(e){return this._instantiationService.createInstance(Q$,e,this._options,this)}getModel(){var e,t;return(t=(e=this._diffModel.get())===null||e===void 0?void 0:e.model)!==null&&t!==void 0?t:null}setModel(e){!e&&this._diffModel.get()&&this._accessibleDiffViewer.close();const t=e?"model"in e?e:this.createViewModel(e):void 0;this._editors.original.setModel(t?t.model.original:null),this._editors.modified.setModel(t?t.model.modified:null),qi(n=>{this._diffModel.set(t,n)})}updateOptions(e){this._options.updateOptions(e)}getContainerDomNode(){return this._domElement}getOriginalEditor(){return this._editors.original}getModifiedEditor(){return this._editors.modified}getLineChanges(){var e;const t=(e=this._diffModel.get())===null||e===void 0?void 0:e.diff.get();return t?kpt(t):null}revert(e){var t;const n=(t=this._diffModel.get())===null||t===void 0?void 0:t.model;if(!n)return;const o=e.innerChanges?e.innerChanges.map(r=>({range:r.modifiedRange,text:n.original.getValueInRange(r.originalRange)})):[{range:e.modified.toExclusiveRange(),text:n.original.getValueInRange(e.original.toExclusiveRange())}];this._editors.modified.executeEdits("diffEditor",o)}accessibleDiffViewerNext(){this._accessibleDiffViewer.next()}accessibleDiffViewerPrev(){this._accessibleDiffViewer.prev()}mapToOtherSide(){var e,t;const n=this._editors.modified.hasWidgetFocus(),o=n?this._editors.modified:this._editors.original,r=n?this._editors.original:this._editors.modified;let s;const a=o.getSelection();if(a){const l=(t=(e=this._diffModel.get())===null||e===void 0?void 0:e.diff.get())===null||t===void 0?void 0:t.mappings.map(c=>n?c.lineRangeMapping.flip():c.lineRangeMapping);if(l){const c=ole(a.getStartPosition(),l),u=ole(a.getEndPosition(),l);s=V.plusRange(c,u)}}return{destination:r,destinationSelection:s}}switchSide(){const{destination:e,destinationSelection:t}=this.mapToOtherSide();e.focus(),t&&e.setSelection(t)}exitCompareMove(){const e=this._diffModel.get();!e||e.movedTextToCompare.set(void 0,void 0)}collapseAllUnchangedRegions(){var e;const t=(e=this._diffModel.get())===null||e===void 0?void 0:e.unchangedRegions.get();!t||qi(n=>{for(const o of t)o.collapseAll(n)})}showAllUnchangedRegions(){var e;const t=(e=this._diffModel.get())===null||e===void 0?void 0:e.unchangedRegions.get();!t||qi(n=>{for(const o of t)o.showAll(n)})}};lb=Lpt([jx(3,Ut),jx(4,$t),jx(5,Jn),jx(6,lT),jx(7,Jv)],lb);function ole(i,e){const t=ZA(e,o=>o.original.startLineNumber<=i.lineNumber);if(!t)return V.fromPositions(i);if(t.original.endLineNumberExclusive<=i.lineNumber){const o=i.lineNumber-t.original.endLineNumberExclusive+t.modified.endLineNumberExclusive;return V.fromPositions(new ae(o,i.column))}if(!t.innerChanges)return V.fromPositions(new ae(t.modified.startLineNumber,1));const n=ZA(t.innerChanges,o=>o.originalRange.getStartPosition().isBeforeOrEqual(i));if(!n){const o=i.lineNumber-t.original.startLineNumber+t.modified.startLineNumber;return V.fromPositions(new ae(o,i.column))}if(n.originalRange.containsPosition(i))return n.modifiedRange;{const o=Ept(n.originalRange.getEndPosition(),i);return V.fromPositions(Dpt(n.modifiedRange.getEndPosition(),o))}}function Ept(i,e){return i.lineNumber===e.lineNumber?new ok(0,e.column-i.column):new ok(e.lineNumber-i.lineNumber,e.column-1)}function Dpt(i,e){return e.lineCount===0?new ae(i.lineNumber,i.column+e.columnCount):new ae(i.lineNumber+e.lineCount,e.columnCount+1)}function kpt(i){return i.mappings.map(e=>{const t=e.lineRangeMapping;let n,o,r,s,a=t.innerChanges;return t.original.isEmpty?(n=t.original.startLineNumber-1,o=0,a=void 0):(n=t.original.startLineNumber,o=t.original.endLineNumberExclusive-1),t.modified.isEmpty?(r=t.modified.startLineNumber-1,s=0,a=void 0):(r=t.modified.startLineNumber,s=t.modified.endLineNumberExclusive-1),{originalStartLineNumber:n,originalEndLineNumber:o,modifiedStartLineNumber:r,modifiedEndLineNumber:s,charChanges:a==null?void 0:a.map(l=>({originalStartLineNumber:l.originalRange.startLineNumber,originalStartColumn:l.originalRange.startColumn,originalEndLineNumber:l.originalRange.endLineNumber,originalEndColumn:l.originalRange.endColumn,modifiedStartLineNumber:l.modifiedRange.startLineNumber,modifiedStartColumn:l.modifiedRange.startColumn,modifiedEndLineNumber:l.modifiedRange.endLineNumber,modifiedEndColumn:l.modifiedRange.endColumn}))}})}var HX=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},zi=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let Ipt=0,rle=!1;function Tpt(i){if(!i){if(rle)return;rle=!0}Mtt(i||document.body)}let iO=class extends ky{constructor(e,t,n,o,r,s,a,l,c,u,d,h){const f=Object.assign({},t);f.ariaLabel=f.ariaLabel||kP.editorViewAccessibleLabel,f.ariaLabel=f.ariaLabel+";"+kP.accessibilityHelpMessage,super(e,f,{},n,o,r,s,l,c,u,d,h),a instanceof Oy?this._standaloneKeybindingService=a:this._standaloneKeybindingService=null,Tpt(f.ariaContainerElement)}addCommand(e,t,n){if(!this._standaloneKeybindingService)return console.warn("Cannot add command because the editor is configured with an unrecognized KeybindingService"),null;const o="DYNAMIC_"+ ++Ipt,r=Me.deserialize(n);return this._standaloneKeybindingService.addDynamicKeybinding(o,e,t,r),o}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"),_e.None;const t=e.id,n=e.label,o=Me.and(Me.equals("editorId",this.getId()),Me.deserialize(e.precondition)),r=e.keybindings,s=Me.and(o,Me.deserialize(e.keybindingContext)),a=e.contextMenuGroupId||null,l=e.contextMenuOrder||0,c=(f,...g)=>Promise.resolve(e.run(this,...g)),u=new Be,d=this.getId()+":"+t;if(u.add(Rn.registerCommand(d,c)),a){const f={command:{id:d,title:n},when:o,group:a,order:l};u.add(Hr.appendMenuItem(Z.EditorContext,f))}if(Array.isArray(r))for(const f of r)u.add(this._standaloneKeybindingService.addDynamicKeybinding(d,f,c,s));const h=new Nbe(d,n,n,o,(...f)=>Promise.resolve(e.run(this,...f)),this._contextKeyService);return this._actions.set(t,h),u.add(zt(()=>{this._actions.delete(t)})),u}_triggerCommand(e,t){if(this._codeEditorService instanceof CP)try{this._codeEditorService.setActiveCodeEditor(this),super._triggerCommand(e,t)}finally{this._codeEditorService.setActiveCodeEditor(null)}else super._triggerCommand(e,t)}};iO=HX([zi(2,$t),zi(3,Jn),zi(4,_o),zi(5,Ut),zi(6,xi),zi(7,mr),zi(8,Ao),zi(9,pp),zi(10,Ti),zi(11,pt)],iO);let tz=class extends iO{constructor(e,t,n,o,r,s,a,l,c,u,d,h,f,g,p){const v=Object.assign({},t);XP(u,v,!1);const m=l.registerEditorContainer(e);typeof v.theme=="string"&&l.setTheme(v.theme),typeof v.autoDetectHighContrast!="undefined"&&l.setAutoDetectHighContrast(Boolean(v.autoDetectHighContrast));const _=v.model;delete v.model,super(e,v,n,o,r,s,a,l,c,d,g,p),this._configurationService=u,this._standaloneThemeService=l,this._register(m);let w;if(typeof _=="undefined"){const y=f.getLanguageIdByMimeType(v.language)||v.language||ql;w=BCe(h,f,v.value||"",y,void 0),this._ownsModel=!0}else w=_,this._ownsModel=!1;if(this._attachModel(w),w){const y={oldModelUrl:null,newModelUrl:w.uri};this._onDidChangeModel.fire(y)}}dispose(){super.dispose()}updateOptions(e){XP(this._configurationService,e,!1),typeof e.theme=="string"&&this._standaloneThemeService.setTheme(e.theme),typeof e.autoDetectHighContrast!="undefined"&&this._standaloneThemeService.setAutoDetectHighContrast(Boolean(e.autoDetectHighContrast)),super.updateOptions(e)}_postDetachModelCleanup(e){super._postDetachModelCleanup(e),e&&this._ownsModel&&(e.dispose(),this._ownsModel=!1)}};tz=HX([zi(2,$t),zi(3,Jn),zi(4,_o),zi(5,Ut),zi(6,xi),zi(7,nc),zi(8,Ao),zi(9,En),zi(10,pp),zi(11,Yi),zi(12,Ki),zi(13,Ti),zi(14,pt)],tz);let nz=class extends lb{constructor(e,t,n,o,r,s,a,l,c,u,d,h){const f=Object.assign({},t);XP(l,f,!0);const g=s.registerEditorContainer(e);typeof f.theme=="string"&&s.setTheme(f.theme),typeof f.autoDetectHighContrast!="undefined"&&s.setAutoDetectHighContrast(Boolean(f.autoDetectHighContrast)),super(e,f,{},o,n,r,h,u),this._configurationService=l,this._standaloneThemeService=s,this._register(g)}dispose(){super.dispose()}updateOptions(e){XP(this._configurationService,e,!0),typeof e.theme=="string"&&this._standaloneThemeService.setTheme(e.theme),typeof e.autoDetectHighContrast!="undefined"&&this._standaloneThemeService.setAutoDetectHighContrast(Boolean(e.autoDetectHighContrast)),super.updateOptions(e)}_createInnerEditor(e,t,n){return e.createInstance(iO,t,n)}getOriginalEditor(){return super.getOriginalEditor()}getModifiedEditor(){return super.getModifiedEditor()}addCommand(e,t,n){return this.getModifiedEditor().addCommand(e,t,n)}createContextKey(e,t){return this.getModifiedEditor().createContextKey(e,t)}addAction(e){return this.getModifiedEditor().addAction(e)}};nz=HX([zi(2,$t),zi(3,Ut),zi(4,Jn),zi(5,nc),zi(6,Ao),zi(7,En),zi(8,ju),zi(9,Jv),zi(10,bp),zi(11,lT)],nz);function BCe(i,e,t,n,o){if(t=t||"",!n){const r=t.indexOf(` -`);let s=t;return r!==-1&&(s=t.substring(0,r)),sle(i,t,e.createByFilepathOrFirstLine(o||null,s),o)}return sle(i,t,e.createById(n),o)}function sle(i,e,t,n){return i.createModel(e,t,n)}var WCe=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};function Npt(i,e,t){return Vt.initialize(t||{}).createInstance(tz,i,e)}function Rpt(i){return Vt.get(Jn).onCodeEditorAdd(t=>{i(t)})}function Mpt(i){return Vt.get(Jn).onDiffEditorAdd(t=>{i(t)})}function Apt(){return Vt.get(Jn).listCodeEditors()}function Ppt(){return Vt.get(Jn).listDiffEditors()}function Opt(i,e,t){return Vt.initialize(t||{}).createInstance(nz,i,e)}function Fpt(i){if(typeof i.id!="string"||typeof i.run!="function")throw new Error("Invalid command descriptor, `id` and `run` are required properties!");return Rn.registerCommand(i.id,i.run)}function Bpt(i){if(typeof i.id!="string"||typeof i.label!="string"||typeof i.run!="function")throw new Error("Invalid action descriptor, `id`, `label` and `run` are required properties!");const e=Me.deserialize(i.precondition),t=(o,...r)=>Ir.runEditorCommand(o,r,e,(s,a,l)=>Promise.resolve(i.run(a,...l))),n=new Be;if(n.add(Rn.registerCommand(i.id,t)),i.contextMenuGroupId){const o={command:{id:i.id,title:i.label},when:e,group:i.contextMenuGroupId,order:i.contextMenuOrder||0};n.add(Hr.appendMenuItem(Z.EditorContext,o))}if(Array.isArray(i.keybindings)){const o=Vt.get(xi);if(!(o instanceof Oy))console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService");else{const r=Me.and(e,Me.deserialize(i.keybindingContext));n.add(o.addDynamicKeybindings(i.keybindings.map(s=>({keybinding:s,command:i.id,when:r}))))}}return n}function Wpt(i){return VCe([i])}function VCe(i){const e=Vt.get(xi);return e instanceof Oy?e.addDynamicKeybindings(i.map(t=>({keybinding:t.keybinding,command:t.command,commandArgs:t.commandArgs,when:Me.deserialize(t.when)}))):(console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService"),_e.None)}function Vpt(i,e,t){const n=Vt.get(Ki),o=n.getLanguageIdByMimeType(e)||e;return BCe(Vt.get(Yi),n,i,o,t)}function Hpt(i,e){const t=Vt.get(Ki),n=t.getLanguageIdByMimeType(e)||e||ql;i.setLanguage(t.createById(n))}function $pt(i,e,t){i&&Vt.get(Rf).changeOne(e,i.uri,t)}function zpt(i){Vt.get(Rf).changeAll(i,[])}function Upt(i){return Vt.get(Rf).read(i)}function jpt(i){return Vt.get(Rf).onMarkerChanged(i)}function Kpt(i){return Vt.get(Yi).getModel(i)}function qpt(){return Vt.get(Yi).getModels()}function Gpt(i){return Vt.get(Yi).onModelAdded(i)}function Xpt(i){return Vt.get(Yi).onModelRemoved(i)}function Ypt(i){return Vt.get(Yi).onModelLanguageChanged(t=>{i({model:t.model,oldLanguage:t.oldLanguageId})})}function Zpt(i){return stt(Vt.get(Yi),Vt.get(Ti),i)}function Qpt(i,e){const t=Vt.get(Ki),n=Vt.get(nc);return dG.colorizeElement(n,t,i,e).then(()=>{n.registerEditorContainer(i)})}function Jpt(i,e,t){const n=Vt.get(Ki);return Vt.get(nc).registerEditorContainer(document.body),dG.colorize(n,i,e,t)}function emt(i,e,t=4){return Vt.get(nc).registerEditorContainer(document.body),dG.colorizeModelLine(i,e,t)}function tmt(i){const e=oo.get(i);return e||{getInitialState:()=>by,tokenize:(t,n,o)=>lG(i,o)}}function nmt(i,e){oo.getOrCreate(e);const t=tmt(e),n=ff(i),o=[];let r=t.getInitialState();for(let s=0,a=n.length;sWCe(this,void 0,void 0,function*(){var r;if(!n)return null;const s=(r=t.options)===null||r===void 0?void 0:r.selection;let a;return s&&typeof s.endLineNumber=="number"&&typeof s.endColumn=="number"?a=s:s&&(a={lineNumber:s.startLineNumber,column:s.startColumn}),(yield i.openCodeEditor(n,t.resource,a))?n:null}))}function cmt(){return{create:Npt,getEditors:Apt,getDiffEditors:Ppt,onDidCreateEditor:Rpt,onDidCreateDiffEditor:Mpt,createDiffEditor:Opt,addCommand:Fpt,addEditorAction:Bpt,addKeybindingRule:Wpt,addKeybindingRules:VCe,createModel:Vpt,setModelLanguage:Hpt,setModelMarkers:$pt,getModelMarkers:Upt,removeAllMarkers:zpt,onDidChangeMarkers:jpt,getModels:qpt,getModel:Kpt,onDidCreateModel:Gpt,onWillDisposeModel:Xpt,onDidChangeModelLanguage:Ypt,createWebWorker:Zpt,colorizeElement:Qpt,colorize:Jpt,colorizeModelLine:emt,tokenize:nmt,defineTheme:imt,setTheme:omt,remeasureFonts:rmt,registerCommand:smt,registerLinkOpener:amt,registerEditorOpener:lmt,AccessibilitySupport:YW,ContentWidgetPositionPreference:nV,CursorChangeReason:iV,DefaultEndOfLine:oV,EditorAutoIndentStrategy:sV,EditorOption:aV,EndOfLinePreference:lV,EndOfLineSequence:cV,MinimapPosition:_V,MouseTargetType:bV,OverlayWidgetPositionPreference:CV,OverviewRulerLane:wV,GlyphMarginLane:uV,RenderLineNumbersType:SV,RenderMinimap:xV,ScrollbarVisibility:EV,ScrollType:LV,TextEditorCursorBlinkingStyle:NV,TextEditorCursorStyle:RV,TrackedRangeStickiness:MV,WrappingIndent:AV,InjectedTextCursorStops:hV,PositionAffinity:yV,ConfigurationChangedEvent:g_e,BareFontInfo:L0,FontInfo:FV,TextModelResolvedOptions:tM,FindMatch:WD,ApplyUpdateResult:sE,EditorZoom:Sc,EditorType:$I,EditorOptions:ih}}function umt(i,e){if(!e||!Array.isArray(e))return!1;for(const t of e)if(!i(t))return!1;return!0}function V2(i,e){return typeof i=="boolean"?i:e}function ale(i,e){return typeof i=="string"?i:e}function dmt(i){const e={};for(const t of i)e[t]=!0;return e}function lle(i,e=!1){e&&(i=i.map(function(n){return n.toLowerCase()}));const t=dmt(i);return e?function(n){return t[n.toLowerCase()]!==void 0&&t.hasOwnProperty(n.toLowerCase())}:function(n){return t[n]!==void 0&&t.hasOwnProperty(n)}}function iz(i,e){e=e.replace(/@@/g,"");let t=0,n;do n=!1,e=e.replace(/@(\w+)/g,function(r,s){n=!0;let a="";if(typeof i[s]=="string")a=i[s];else if(i[s]&&i[s]instanceof RegExp)a=i[s].source;else throw i[s]===void 0?Bi(i,"language definition does not contain attribute '"+s+"', used at: "+e):Bi(i,"attribute reference '"+s+"' must be a string, used at: "+e);return cC(a)?"":"(?:"+a+")"}),t++;while(n&&t<5);e=e.replace(/\x01/g,"@");const o=(i.ignoreCase?"i":"")+(i.unicode?"u":"");return new RegExp(e,o)}function hmt(i,e,t,n){if(n<0)return i;if(n=100){n=n-100;const o=t.split(".");if(o.unshift(t),n=0&&(n.tokenSubst=!0),typeof t.bracket=="string")if(t.bracket==="@open")n.bracket=1;else if(t.bracket==="@close")n.bracket=-1;else throw Bi(i,"a 'bracket' attribute must be either '@open' or '@close', in rule: "+e);if(t.next){if(typeof t.next!="string")throw Bi(i,"the next state must be a string value in rule: "+e);{let o=t.next;if(!/^(@pop|@push|@popall)$/.test(o)&&(o[0]==="@"&&(o=o.substr(1)),o.indexOf("$")<0&&!Ltt(i,sm(i,o,"",[],""))))throw Bi(i,"the next state '"+t.next+"' is not defined in rule: "+e);n.next=o}}return typeof t.goBack=="number"&&(n.goBack=t.goBack),typeof t.switchTo=="string"&&(n.switchTo=t.switchTo),typeof t.log=="string"&&(n.log=t.log),typeof t.nextEmbedded=="string"&&(n.nextEmbedded=t.nextEmbedded,i.usesEmbedded=!0),n}}else if(Array.isArray(t)){const n=[];for(let o=0,r=t.length;o0&&n[0]==="^",this.name=this.name+": "+n,this.regex=iz(e,"^(?:"+(this.matchOnlyAtLineStart?n.substr(1):n)+")")}setAction(e,t){this.action=oz(e,this.name,t)}}function HCe(i,e){if(!e||typeof e!="object")throw new Error("Monarch: expecting a language definition object");const t={};t.languageId=i,t.includeLF=V2(e.includeLF,!1),t.noThrow=!1,t.maxStack=100,t.start=typeof e.start=="string"?e.start:null,t.ignoreCase=V2(e.ignoreCase,!1),t.unicode=V2(e.unicode,!1),t.tokenPostfix=ale(e.tokenPostfix,"."+t.languageId),t.defaultToken=ale(e.defaultToken,"source"),t.usesEmbedded=!1;const n=e;n.languageId=i,n.includeLF=t.includeLF,n.ignoreCase=t.ignoreCase,n.unicode=t.unicode,n.noThrow=t.noThrow,n.usesEmbedded=t.usesEmbedded,n.stateNames=e.tokenizer,n.defaultToken=t.defaultToken;function o(s,a,l){for(const c of l){let u=c.include;if(u){if(typeof u!="string")throw Bi(t,"an 'include' attribute must be a string at: "+s);if(u[0]==="@"&&(u=u.substr(1)),!e.tokenizer[u])throw Bi(t,"include target '"+u+"' is not defined at: "+s);o(s+"."+u,a,e.tokenizer[u])}else{const d=new gmt(s);if(Array.isArray(c)&&c.length>=1&&c.length<=3)if(d.setRegex(n,c[0]),c.length>=3)if(typeof c[1]=="string")d.setAction(n,{token:c[1],next:c[2]});else if(typeof c[1]=="object"){const h=c[1];h.next=c[2],d.setAction(n,h)}else throw Bi(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: "+s);else d.setAction(n,c[1]);else{if(!c.regex)throw Bi(t,"a rule must either be an array, or an object with a 'regex' or 'include' field at: "+s);c.name&&typeof c.name=="string"&&(d.name=c.name),c.matchOnlyAtStart&&(d.matchOnlyAtLineStart=V2(c.matchOnlyAtLineStart,!1)),d.setRegex(n,c.regex),d.setAction(n,c.action)}a.push(d)}}}if(!e.tokenizer||typeof e.tokenizer!="object")throw Bi(t,"a language definition must define the 'tokenizer' attribute as an object");t.tokenizer=[];for(const s in e.tokenizer)if(e.tokenizer.hasOwnProperty(s)){t.start||(t.start=s);const a=e.tokenizer[s];t.tokenizer[s]=new Array,o("tokenizer."+s,t.tokenizer[s],a)}if(t.usesEmbedded=n.usesEmbedded,e.brackets){if(!Array.isArray(e.brackets))throw Bi(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 s of e.brackets){let a=s;if(a&&Array.isArray(a)&&a.length===3&&(a={token:a[2],open:a[0],close:a[1]}),a.open===a.close)throw Bi(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:Gm(t,a.open),close:Gm(t,a.close)});else throw Bi(t,"every element in the 'brackets' array must be a '{open,close,token}' object or array")}return t.brackets=r,t.noThrow=!0,t}var pmt=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};function mmt(i){vy.registerLanguage(i)}function vmt(){let i=[];return i=i.concat(vy.getLanguages()),i}function _mt(i){return Vt.get(Ki).languageIdCodec.encodeLanguageId(i)}function bmt(i,e){return Vt.withServices(()=>{const n=Vt.get(Ki).onDidRequestRichLanguageFeatures(o=>{o===i&&(n.dispose(),e())});return n})}function Cmt(i,e){return Vt.withServices(()=>{const n=Vt.get(Ki).onDidRequestBasicLanguageFeatures(o=>{o===i&&(n.dispose(),e())});return n})}function wmt(i,e){if(!Vt.get(Ki).isRegisteredLanguageId(i))throw new Error(`Cannot set configuration for unknown language ${i}`);return Vt.get(Ti).register(i,e,100)}class ymt{constructor(e,t){this._languageId=e,this._actual=t}dispose(){}getInitialState(){return this._actual.getInitialState()}tokenize(e,t,n){if(typeof this._actual.tokenize=="function")return Nk.adaptTokenize(this._languageId,this._actual,e,n);throw new Error("Not supported!")}tokenizeEncoded(e,t,n){const o=this._actual.tokenizeEncoded(e,n);return new V4(o.tokens,o.endState)}}class Nk{constructor(e,t,n,o){this._languageId=e,this._actual=t,this._languageService=n,this._standaloneThemeService=o}dispose(){}getInitialState(){return this._actual.getInitialState()}static _toClassicTokens(e,t){const n=[];let o=0;for(let r=0,s=e.length;r0&&r[s-1]===h)continue;let f=d.startIndex;c===0?f=0:fpmt(this,void 0,void 0,function*(){const n=yield Promise.resolve(e.create());return n?Smt(n)?zCe(i,n):new KD(Vt.get(Ki),Vt.get(nc),i,HCe(i,n),Vt.get(En)):null}));return oo.registerFactory(i,t)}function Emt(i,e){if(!Vt.get(Ki).isRegisteredLanguageId(i))throw new Error(`Cannot set tokens provider for unknown language ${i}`);return $Ce(e)?$X(i,{create:()=>e}):oo.register(i,zCe(i,e))}function Dmt(i,e){const t=n=>new KD(Vt.get(Ki),Vt.get(nc),i,HCe(i,n),Vt.get(En));return $Ce(e)?$X(i,{create:()=>e}):oo.register(i,t(e))}function kmt(i,e){return Vt.get(pt).referenceProvider.register(i,e)}function Imt(i,e){return Vt.get(pt).renameProvider.register(i,e)}function Tmt(i,e){return Vt.get(pt).signatureHelpProvider.register(i,e)}function Nmt(i,e){return Vt.get(pt).hoverProvider.register(i,{provideHover:(n,o,r)=>{const s=n.getWordAtPosition(o);return Promise.resolve(e.provideHover(n,o,r)).then(a=>{if(!!a)return!a.range&&s&&(a.range=new V(o.lineNumber,s.startColumn,o.lineNumber,s.endColumn)),a.range||(a.range=new V(o.lineNumber,o.column,o.lineNumber,o.column)),a})}})}function Rmt(i,e){return Vt.get(pt).documentSymbolProvider.register(i,e)}function Mmt(i,e){return Vt.get(pt).documentHighlightProvider.register(i,e)}function Amt(i,e){return Vt.get(pt).linkedEditingRangeProvider.register(i,e)}function Pmt(i,e){return Vt.get(pt).definitionProvider.register(i,e)}function Omt(i,e){return Vt.get(pt).implementationProvider.register(i,e)}function Fmt(i,e){return Vt.get(pt).typeDefinitionProvider.register(i,e)}function Bmt(i,e){return Vt.get(pt).codeLensProvider.register(i,e)}function Wmt(i,e,t){return Vt.get(pt).codeActionProvider.register(i,{providedCodeActionKinds:t==null?void 0:t.providedCodeActionKinds,documentation:t==null?void 0:t.documentation,provideCodeActions:(o,r,s,a)=>{const c=Vt.get(Rf).read({resource:o.uri}).filter(u=>V.areIntersectingOrTouching(u,r));return e.provideCodeActions(o,r,{markers:c,only:s.only,trigger:s.trigger},a)},resolveCodeAction:e.resolveCodeAction})}function Vmt(i,e){return Vt.get(pt).documentFormattingEditProvider.register(i,e)}function Hmt(i,e){return Vt.get(pt).documentRangeFormattingEditProvider.register(i,e)}function $mt(i,e){return Vt.get(pt).onTypeFormattingEditProvider.register(i,e)}function zmt(i,e){return Vt.get(pt).linkProvider.register(i,e)}function Umt(i,e){return Vt.get(pt).completionProvider.register(i,e)}function jmt(i,e){return Vt.get(pt).colorProvider.register(i,e)}function Kmt(i,e){return Vt.get(pt).foldingRangeProvider.register(i,e)}function qmt(i,e){return Vt.get(pt).declarationProvider.register(i,e)}function Gmt(i,e){return Vt.get(pt).selectionRangeProvider.register(i,e)}function Xmt(i,e){return Vt.get(pt).documentSemanticTokensProvider.register(i,e)}function Ymt(i,e){return Vt.get(pt).documentRangeSemanticTokensProvider.register(i,e)}function Zmt(i,e){return Vt.get(pt).inlineCompletionsProvider.register(i,e)}function Qmt(i,e){return Vt.get(pt).inlayHintsProvider.register(i,e)}function Jmt(){return{register:mmt,getLanguages:vmt,onLanguage:bmt,onLanguageEncountered:Cmt,getEncodedLanguageId:_mt,setLanguageConfiguration:wmt,setColorMap:Lmt,registerTokensProviderFactory:$X,setTokensProvider:Emt,setMonarchTokensProvider:Dmt,registerReferenceProvider:kmt,registerRenameProvider:Imt,registerCompletionItemProvider:Umt,registerSignatureHelpProvider:Tmt,registerHoverProvider:Nmt,registerDocumentSymbolProvider:Rmt,registerDocumentHighlightProvider:Mmt,registerLinkedEditingRangeProvider:Amt,registerDefinitionProvider:Pmt,registerImplementationProvider:Omt,registerTypeDefinitionProvider:Fmt,registerCodeLensProvider:Bmt,registerCodeActionProvider:Wmt,registerDocumentFormattingEditProvider:Vmt,registerDocumentRangeFormattingEditProvider:Hmt,registerOnTypeFormattingEditProvider:$mt,registerLinkProvider:zmt,registerColorProvider:jmt,registerFoldingRangeProvider:Kmt,registerDeclarationProvider:qmt,registerSelectionRangeProvider:Gmt,registerDocumentSemanticTokensProvider:Xmt,registerDocumentRangeSemanticTokensProvider:Ymt,registerInlineCompletionsProvider:Zmt,registerInlayHintsProvider:Qmt,DocumentHighlightKind:rV,CompletionItemKind:JW,CompletionItemTag:eV,CompletionItemInsertTextRule:QW,SymbolKind:IV,SymbolTag:TV,IndentAction:dV,CompletionTriggerKind:tV,SignatureHelpTriggerKind:kV,InlayHintKind:fV,InlineCompletionTriggerKind:gV,CodeActionTriggerType:ZW,FoldingRangeKind:oa,SelectedSuggestionInfo:T_e}}const zX=wn("IEditorCancelService"),UCe=new lt("cancellableOperation",!1,C("cancellableOperation","Whether the editor runs a cancellable operation, e.g. like 'Peek References'"));Mn(zX,class{constructor(){this._tokens=new WeakMap}add(i,e){let t=this._tokens.get(i);t||(t=i.invokeWithinContext(o=>{const r=UCe.bindTo(o.get(Ut)),s=new ia;return{key:r,tokens:s}}),this._tokens.set(i,t));let n;return t.key.set(!0),n=t.tokens.push(e),()=>{n&&(n(),t.key.set(!t.tokens.isEmpty()),n=void 0)}}cancel(i){const e=this._tokens.get(i);if(!e)return;const t=e.tokens.pop();t&&(t.cancel(),e.key.set(!e.tokens.isEmpty()))}},1);class evt extends Ro{constructor(e,t){super(t),this.editor=e,this._unregister=e.invokeWithinContext(n=>n.get(zX).add(e,this))}dispose(){this._unregister(),super.dispose()}}Ye(new class extends Ir{constructor(){super({id:"editor.cancelOperation",kbOpts:{weight:100,primary:9},precondition:UCe})}runEditorCommand(i,e){i.get(zX).cancel(e)}});class Rk{constructor(e,t){if(this.flags=t,(this.flags&1)!==0){const n=e.getModel();this.modelVersionId=n?G0("{0}#{1}",n.uri.toString(),n.getVersionId()):null}else this.modelVersionId=null;(this.flags&4)!==0?this.position=e.getPosition():this.position=null,(this.flags&2)!==0?this.selection=e.getSelection():this.selection=null,(this.flags&8)!==0?(this.scrollLeft=e.getScrollLeft(),this.scrollTop=e.getScrollTop()):(this.scrollLeft=-1,this.scrollTop=-1)}_equals(e){if(!(e instanceof Rk))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 Rk(e,this.flags))}}class Nv extends evt{constructor(e,t,n,o){super(e,o),this._listener=new Be,t&4&&this._listener.add(e.onDidChangeCursorPosition(r=>{(!n||!V.containsPosition(n,r.position))&&this.cancel()})),t&2&&this._listener.add(e.onDidChangeCursorSelection(r=>{(!n||!V.containsRange(n,r.selection))&&this.cancel()})),t&8&&this._listener.add(e.onDidScrollChange(r=>this.cancel())),t&1&&(this._listener.add(e.onDidChangeModel(r=>this.cancel())),this._listener.add(e.onDidChangeModelContent(r=>this.cancel())))}dispose(){this._listener.dispose(),super.dispose()}}class UX extends Ro{constructor(e,t){super(t),this._listener=e.onDidChangeContent(()=>this.cancel())}dispose(){this._listener.dispose(),super.dispose()}}function yf(i){return i&&typeof i.getEditorType=="function"?i.getEditorType()===$I.ICodeEditor:!1}function jCe(i){return i&&typeof i.getEditorType=="function"?i.getEditorType()===$I.IDiffEditor:!1}function tvt(i){return!!i&&typeof i=="object"&&typeof i.onDidChangeActiveEditor=="function"}function KCe(i){return yf(i)?i:jCe(i)?i.getModifiedEditor():tvt(i)&&yf(i.activeCodeEditor)?i.activeCodeEditor:null}class Fy{static _handleEolEdits(e,t){let n;const o=[];for(const r of t)typeof r.eol=="number"&&(n=r.eol),r.range&&typeof r.text=="string"&&o.push(r);return typeof n=="number"&&e.hasModel()&&e.getModel().pushEOL(n),o}static _isFullModelReplaceEdit(e,t){if(!e.hasModel())return!1;const n=e.getModel(),o=n.validateRange(t.range);return n.getFullModelRange().equalsRange(o)}static execute(e,t,n){n&&e.pushUndoStop();const o=Yd.capture(e),r=Fy._handleEolEdits(e,t);r.length===1&&Fy._isFullModelReplaceEdit(e,r[0])?e.executeEdits("formatEditsCommand",r.map(s=>Gi.replace(V.lift(s.range),s.text))):e.executeEdits("formatEditsCommand",r.map(s=>Gi.replaceMove(V.lift(s.range),s.text))),n&&e.pushUndoStop(),o.restoreRelativeVerticalPositionOfCursor(e)}}class cle{constructor(e){this.value=e,this._lower=e.toLowerCase()}static toKey(e){return typeof e=="string"?e.toLowerCase():e._lower}}class nvt{constructor(e){if(this._set=new Set,e)for(const t of e)this.add(t)}add(e){this._set.add(cle.toKey(e))}has(e){return this._set.has(cle.toKey(e))}}var Zd=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};function jX(i){if(i=i.filter(o=>o.range),!i.length)return;let{range:e}=i[0];for(let o=1;o0&&V.areIntersectingOrTouching(d[h-1],m)?d[h-1]=V.fromPositions(d[h-1].getStartPosition(),m.getEndPosition()):h=d.push(m);const f=m=>Zd(this,void 0,void 0,function*(){var _,w;l.trace("[format][provideDocumentRangeFormattingEdits] (request)",(_=e.extensionId)===null||_===void 0?void 0:_.value,m);const y=(yield e.provideDocumentRangeFormattingEdits(c,m,c.getFormattingOptions(),u.token))||[];return l.trace("[format][provideDocumentRangeFormattingEdits] (response)",(w=e.extensionId)===null||w===void 0?void 0:w.value,y),y}),g=(m,_)=>{if(!m.length||!_.length)return!1;const w=m.reduce((y,L)=>V.plusRange(y,L.range),m[0].range);if(!_.some(y=>V.intersectRanges(w,y.range)))return!1;for(const y of m)for(const L of _)if(V.intersectRanges(y.range,L.range))return!0;return!1},p=[],v=[];try{if(typeof e.provideDocumentRangesFormattingEdits=="function"){l.trace("[format][provideDocumentRangeFormattingEdits] (request)",(r=e.extensionId)===null||r===void 0?void 0:r.value,d);const m=(yield e.provideDocumentRangesFormattingEdits(c,d,c.getFormattingOptions(),u.token))||[];l.trace("[format][provideDocumentRangeFormattingEdits] (response)",(s=e.extensionId)===null||s===void 0?void 0:s.value,m),v.push(m)}else{for(const m of d){if(u.token.isCancellationRequested)return!0;v.push(yield f(m))}for(let m=0;m({text:w.text,range:V.lift(w.range),forceMoveMarkers:!0})),w=>{for(const{range:y}of w)if(V.areIntersectingOrTouching(y,_))return[new gt(y.startLineNumber,y.startColumn,y.endLineNumber,y.endColumn)];return null})}return!0})}function ovt(i,e,t,n,o){return Zd(this,void 0,void 0,function*(){const r=i.get($t),s=i.get(pt),a=yf(e)?e.getModel():e,l=qCe(s.documentFormattingEditProvider,s.documentRangeFormattingEditProvider,a),c=yield cb.select(l,a,t);c&&(n.report(c),yield r.invokeFunction(rvt,c,e,t,o))})}function rvt(i,e,t,n,o){return Zd(this,void 0,void 0,function*(){const r=i.get(Gu);let s,a;yf(t)?(s=t.getModel(),a=new Nv(t,5,void 0,o)):(s=t,a=new UX(t,o));let l;try{const c=yield e.provideDocumentFormattingEdits(s,s.getFormattingOptions(),a.token);if(l=yield r.computeMoreMinimalEdits(s.uri,c),a.token.isCancellationRequested)return!0}finally{a.dispose()}if(!l||l.length===0)return!1;if(yf(t))Fy.execute(t,l,n!==2),n!==2&&(jX(l),t.revealPositionInCenterIfOutsideViewport(t.getPosition(),1));else{const[{range:c}]=l,u=new gt(c.startLineNumber,c.startColumn,c.endLineNumber,c.endColumn);s.pushEditOperations([u],l.map(d=>({text:d.text,range:V.lift(d.range),forceMoveMarkers:!0})),d=>{for(const{range:h}of d)if(V.areIntersectingOrTouching(h,u))return[new gt(h.startLineNumber,h.startColumn,h.endLineNumber,h.endColumn)];return null})}return!0})}function svt(i,e,t,n,o,r){return Zd(this,void 0,void 0,function*(){const s=e.documentRangeFormattingEditProvider.ordered(t);for(const a of s){const l=yield Promise.resolve(a.provideDocumentRangeFormattingEdits(t,n,o,r)).catch($o);if(ws(l))return yield i.computeMoreMinimalEdits(t.uri,l)}})}function avt(i,e,t,n,o){return Zd(this,void 0,void 0,function*(){const r=qCe(e.documentFormattingEditProvider,e.documentRangeFormattingEditProvider,t);for(const s of r){const a=yield Promise.resolve(s.provideDocumentFormattingEdits(t,n,o)).catch($o);if(ws(a))return yield i.computeMoreMinimalEdits(t.uri,a)}})}function XCe(i,e,t,n,o,r,s){const a=e.onTypeFormattingEditProvider.ordered(t);return a.length===0||a[0].autoFormatTriggerCharacters.indexOf(o)<0?Promise.resolve(void 0):Promise.resolve(a[0].provideOnTypeFormattingEdits(t,n,o,r,s)).catch($o).then(l=>i.computeMoreMinimalEdits(t.uri,l))}Rn.registerCommand("_executeFormatRangeProvider",function(i,...e){return Zd(this,void 0,void 0,function*(){const[t,n,o]=e;fi(Rt.isUri(t)),fi(V.isIRange(n));const r=i.get($a),s=i.get(Gu),a=i.get(pt),l=yield r.createModelReference(t);try{return svt(s,a,l.object.textEditorModel,V.lift(n),o,_n.None)}finally{l.dispose()}})});Rn.registerCommand("_executeFormatDocumentProvider",function(i,...e){return Zd(this,void 0,void 0,function*(){const[t,n]=e;fi(Rt.isUri(t));const o=i.get($a),r=i.get(Gu),s=i.get(pt),a=yield o.createModelReference(t);try{return avt(r,s,a.object.textEditorModel,n,_n.None)}finally{a.dispose()}})});Rn.registerCommand("_executeFormatOnTypeProvider",function(i,...e){return Zd(this,void 0,void 0,function*(){const[t,n,o,r]=e;fi(Rt.isUri(t)),fi(ae.isIPosition(n)),fi(typeof o=="string");const s=i.get($a),a=i.get(Gu),l=i.get(pt),c=yield s.createModelReference(t);try{return XCe(a,l,c.object.textEditorModel,ae.lift(n),o,r,_n.None)}finally{c.dispose()}})});ih.wrappingIndent.defaultValue=0;ih.glyphMargin.defaultValue=!1;ih.autoIndent.defaultValue=3;ih.overviewRulerLanes.defaultValue=2;cb.setFormatterSelector((i,e,t)=>Promise.resolve(i[0]));const ma=N_e();ma.editor=cmt();ma.languages=Jmt();const lvt=ma.CancellationTokenSource,cvt=ma.Emitter,uvt=ma.KeyCode,dvt=ma.KeyMod,hvt=ma.Position,fvt=ma.Range,gvt=ma.Selection,pvt=ma.SelectionDirection,mvt=ma.MarkerSeverity,vvt=ma.MarkerTag,_vt=ma.Uri,bvt=ma.Token,YCe=ma.editor,ZCe=ma.languages,X9=globalThis.MonacoEnvironment;((X9==null?void 0:X9.globalAPI)||typeof define=="function"&&define.amd)&&(globalThis.monaco=ma);typeof globalThis.require!="undefined"&&typeof globalThis.require.config=="function"&&globalThis.require.config({ignoreDuplicateModules:["vscode-languageserver-types","vscode-languageserver-types/main","vscode-languageserver-textdocument","vscode-languageserver-textdocument/main","vscode-nls","vscode-nls/vscode-nls","jsonc-parser","jsonc-parser/main","vscode-uri","vscode-uri/index","vs/basic-languages/typescript/typescript"]});var uT=Object.freeze(Object.defineProperty({__proto__:null,CancellationTokenSource:lvt,Emitter:cvt,KeyCode:uvt,KeyMod:dvt,Position:hvt,Range:fvt,Selection:gvt,SelectionDirection:pvt,MarkerSeverity:mvt,MarkerTag:vvt,Uri:_vt,Token:bvt,editor:YCe,languages:ZCe},Symbol.toStringTag,{value:"Module"}));const Cvt="_editor_yw7yc_1";var wvt={editor:Cvt};const yvt="modulepreload",ule={},Svt="/eos/",wt=function(e,t){return!t||t.length===0?e():Promise.all(t.map(n=>{if(n=`${Svt}${n}`,n in ule)return;ule[n]=!0;const o=n.endsWith(".css"),r=o?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${n}"]${r}`))return;const s=document.createElement("link");if(s.rel=o?"stylesheet":yvt,o||(s.as="script",s.crossOrigin=""),s.href=n,document.head.appendChild(s),o)return new Promise((a,l)=>{s.addEventListener("load",a),s.addEventListener("error",()=>l(new Error(`Unable to preload CSS for ${n}`)))})})).then(()=>e())};/*!----------------------------------------------------------------------------- +`),yield this._clipboardService.writeText(w)}))),n.getOption(90)||m.push(new ca("diff.inline.revertChange",C("diff.inline.revertChange.label","Revert this change"),void 0,!0,()=>G9(this,void 0,void 0,function*(){this._editor.revert(this._diff)}))),m},autoSelectFirstItem:!0})};this._register(No(this._diffActions,"mousedown",g=>{const{top:p,height:v}=Yo(this._diffActions),m=Math.floor(u/3);g.preventDefault(),f(g.posx,p+v+m)})),this._register(n.onMouseMove(g=>{(g.target.type===8||g.target.type===5)&&g.target.detail.viewZoneId===this._getViewZoneId()?(d=this._updateLightBulbPosition(this._marginDomNode,g.event.browserEvent.y,u),this.visibility=!0):this.visibility=!1})),this._register(n.onMouseDown(g=>{!g.event.rightButton||(g.target.type===8||g.target.type===5)&&g.target.detail.viewZoneId===this._getViewZoneId()&&(g.event.preventDefault(),d=this._updateLightBulbPosition(this._marginDomNode,g.event.browserEvent.y,u),f(g.event.posx,g.event.posy+u))}))}_updateLightBulbPosition(e,t,n){const{top:o}=Yo(e),r=t-o,s=Math.floor(r/n),a=s*n;if(this._diffActions.style.top=`${a}px`,this._viewLineCounts){let l=0;for(let c=0;ci});function xpt(i,e,t,n){ss(n,e.fontInfo);const o=t.length>0,r=new bS(1e4);let s=0,a=0;const l=[];for(let h=0;h');const l=e.getLineContent(),c=Zl.isBasicASCII(l,o),u=Zl.containsRTL(l,c,r),d=jI(new Zv(s.fontInfo.isMonospace&&!s.disableMonospaceOptimizations,s.fontInfo.canUseHalfwidthRightwardsArrow,l,!1,c,u,0,e,t,s.tabSize,0,s.fontInfo.spaceWidth,s.fontInfo.middotWidth,s.fontInfo.wsmiddotWidth,s.stopRenderingLineAfter,s.renderWhitespace,s.renderControlCharacters,s.fontLigatures!==Pl.OFF,null),a);return a.appendString(""),d.characterMapping.getHorizontalOffset(d.characterMapping.length)}var Ept=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},ale=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let iz=class extends _e{constructor(e,t,n,o,r,s,a){super(),this._editors=e,this._diffModel=t,this._options=n,this._diffEditorWidget=o,this._canIgnoreViewZoneUpdateEvent=r,this._clipboardService=s,this._contextMenuService=a,this._originalTopPadding=Ai(this,0),this._originalScrollOffset=Ai(this,0),this._originalScrollOffsetAnimated=Gae(this._originalScrollOffset,this._store),this._modifiedTopPadding=Ai(this,0),this._modifiedScrollOffset=Ai(this,0),this._modifiedScrollOffsetAnimated=Gae(this._modifiedScrollOffset,this._store);let l=!1;const c=Ai("state",0),u=this._register(new bi(()=>{c.set(c.get()+1,void 0)},0));this._register(this._editors.original.onDidChangeViewZones(w=>{!l&&!this._canIgnoreViewZoneUpdateEvent()&&u.schedule()})),this._register(this._editors.modified.onDidChangeViewZones(w=>{!l&&!this._canIgnoreViewZoneUpdateEvent()&&u.schedule()})),this._register(this._editors.original.onDidChangeConfiguration(w=>{(w.hasChanged(144)||w.hasChanged(66))&&u.schedule()})),this._register(this._editors.modified.onDidChangeConfiguration(w=>{(w.hasChanged(144)||w.hasChanged(66))&&u.schedule()}));const d=this._diffModel.map(w=>w?$r(w.model.original.onDidChangeTokens,()=>w.model.original.tokenization.backgroundTokenizationState===2):void 0).map((w,L)=>w==null?void 0:w.read(L)),h=new Set,f=new Set,g=In(w=>{const L=this._diffModel.read(w),D=L==null?void 0:L.diff.read(w);if(!L||!D)return null;c.read(w);const I=this._options.renderSideBySide.read(w);return lle(this._editors.original,this._editors.modified,D.mappings,h,f,I)}),p=In(w=>{var L;const D=(L=this._diffModel.read(w))===null||L===void 0?void 0:L.movedTextToCompare.read(w);if(!D)return null;c.read(w);const E=D.changes.map(I=>new jCe(I));return lle(this._editors.original,this._editors.modified,E,h,f,!0)});function v(){const w=document.createElement("div");return w.className="diagonal-fill",w}const m=this._register(new Be),_=In(w=>{var L,D,E,I,k,R,A,P;m.clear();const N=g.read(w)||[],M=[],H=[],B=this._modifiedTopPadding.read(w);B>0&&H.push({afterLineNumber:0,domNode:document.createElement("div"),heightInPx:B,showInHiddenAreas:!0,suppressMouseDown:!0});const F=this._originalTopPadding.read(w);F>0&&M.push({afterLineNumber:0,domNode:document.createElement("div"),heightInPx:F,showInHiddenAreas:!0,suppressMouseDown:!0});const $=this._options.renderSideBySide.read(w),z=$||(L=this._editors.modified._getViewModel())===null||L===void 0?void 0:L.createLineBreaksComputer();if(z){for(const be of N)if(be.diff)for(let Se=be.originalRange.startLineNumber;Sethis._editors.original.getModel().tokenization.getLineTokens(Ee)),be.originalRange.mapToLineArray(Ee=>K[j++]),de,fe),ce=[];for(const Ee of be.diff.innerChanges||[])ce.push(new uE(Ee.originalRange.delta(-(be.diff.original.startLineNumber-1)),Q$.className,0));const Pe=xpt(De,pe,ce,Fe),Oe=document.createElement("div");if(Oe.className="inline-deleted-margin-view-zone",ss(Oe,pe.fontInfo),this._options.renderIndicators.read(w))for(let Ee=0;Eea0(xe),Oe,this._editors.modified,be.diff,this._diffEditorWidget,Pe.viewLineCounts,this._editors.original.getModel(),this._contextMenuService,this._clipboardService));for(let Ee=0;Ee1&&M.push({afterLineNumber:be.originalRange.startLineNumber+Ee,domNode:v(),heightInPx:(tt-1)*G,showInHiddenAreas:!0,suppressMouseDown:!0})}H.push({afterLineNumber:be.modifiedRange.startLineNumber-1,domNode:Fe,heightInPx:Pe.heightInLines*G,minWidthInPx:Pe.minWidthInPx,marginDomNode:Oe,setZoneId(Ee){xe=Ee},showInHiddenAreas:!0,suppressMouseDown:!0})}const Se=document.createElement("div");Se.className="gutter-delete",M.push({afterLineNumber:be.originalRange.endLineNumberExclusive-1,domNode:v(),heightInPx:be.modifiedHeightInPx,marginDomNode:Se,showInHiddenAreas:!0,suppressMouseDown:!0})}else{const Se=be.modifiedHeightInPx-be.originalHeightInPx;if(Se>0){if(X!=null&&X.lineRangeMapping.original.delta(-1).deltaLength(2).contains(be.originalRange.endLineNumberExclusive-1))continue;M.push({afterLineNumber:be.originalRange.endLineNumberExclusive-1,domNode:v(),heightInPx:Se,showInHiddenAreas:!0,suppressMouseDown:!0})}else{let Fe=function(){const ce=document.createElement("div");return ce.className="arrow-revert-change "+Mt.asClassName(Xe.arrowRight),He("div",{},ce)};if(X!=null&&X.lineRangeMapping.modified.delta(-1).deltaLength(2).contains(be.modifiedRange.endLineNumberExclusive-1))continue;let De;be.diff&&be.diff.modified.isEmpty&&this._options.shouldRenderRevertArrows.read(w)&&(De=Fe()),H.push({afterLineNumber:be.modifiedRange.endLineNumberExclusive-1,domNode:v(),heightInPx:-Se,marginDomNode:De,showInHiddenAreas:!0,suppressMouseDown:!0})}}for(const be of(P=p.read(w))!==null&&P!==void 0?P:[]){if(!(X!=null&&X.lineRangeMapping.original.intersect(be.originalRange))||!(X!=null&&X.lineRangeMapping.modified.intersect(be.modifiedRange)))continue;const Se=be.modifiedHeightInPx-be.originalHeightInPx;Se>0?M.push({afterLineNumber:be.originalRange.endLineNumberExclusive-1,domNode:v(),heightInPx:Se,showInHiddenAreas:!0,suppressMouseDown:!0}):H.push({afterLineNumber:be.modifiedRange.endLineNumberExclusive-1,domNode:v(),heightInPx:-Se,showInHiddenAreas:!0,suppressMouseDown:!0})}return{orig:M,mod:H}});this._register(Ja(w=>{const L=Zd.capture(this._editors.modified),D=_.read(w);l=!0,this._editors.original.changeViewZones(E=>{for(const I of h)E.removeZone(I);h.clear();for(const I of D.orig){const k=E.addZone(I);I.setZoneId&&I.setZoneId(k),h.add(k)}}),this._editors.modified.changeViewZones(E=>{for(const I of f)E.removeZone(I);f.clear();for(const I of D.mod){const k=E.addZone(I);I.setZoneId&&I.setZoneId(k),f.add(k)}}),l=!1,L.restore(this._editors.modified)})),this._register(zt(()=>{this._editors.original.changeViewZones(w=>{for(const L of h)w.removeZone(L);h.clear()}),this._editors.modified.changeViewZones(w=>{for(const L of f)w.removeZone(L);f.clear()})}));let y=!1;this._register(this._editors.original.onDidScrollChange(w=>{w.scrollLeftChanged&&!y&&(y=!0,this._editors.modified.setScrollLeft(w.scrollLeft),y=!1)})),this._register(this._editors.modified.onDidScrollChange(w=>{w.scrollLeftChanged&&!y&&(y=!0,this._editors.original.setScrollLeft(w.scrollLeft),y=!1)})),this._originalScrollTop=$r(this._editors.original.onDidScrollChange,()=>this._editors.original.getScrollTop()),this._modifiedScrollTop=$r(this._editors.modified.onDidScrollChange,()=>this._editors.modified.getScrollTop()),this._register(Ii(w=>{const L=this._originalScrollTop.read(w)-(this._originalScrollOffsetAnimated.get()-this._modifiedScrollOffsetAnimated.read(w))-(this._originalTopPadding.get()-this._modifiedTopPadding.read(w));L!==this._editors.modified.getScrollTop()&&this._editors.modified.setScrollTop(L,1)})),this._register(Ii(w=>{const L=this._modifiedScrollTop.read(w)-(this._modifiedScrollOffsetAnimated.get()-this._originalScrollOffsetAnimated.read(w))-(this._modifiedTopPadding.get()-this._originalTopPadding.read(w));L!==this._editors.original.getScrollTop()&&this._editors.original.setScrollTop(L,1)})),this._register(Ii(w=>{var L;const D=(L=this._diffModel.read(w))===null||L===void 0?void 0:L.movedTextToCompare.read(w);let E=0;if(D){const I=this._editors.original.getTopForLineNumber(D.lineRangeMapping.original.startLineNumber,!0)-this._originalTopPadding.get();E=this._editors.modified.getTopForLineNumber(D.lineRangeMapping.modified.startLineNumber,!0)-this._modifiedTopPadding.get()-I}E>0?(this._modifiedTopPadding.set(0,void 0),this._originalTopPadding.set(E,void 0)):E<0?(this._modifiedTopPadding.set(-E,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()-E,void 0,!0):this._modifiedScrollOffset.set(this._originalScrollOffset.get()+E,void 0,!0)}))}};iz=Ept([ale(5,yp),ale(6,Ku)],iz);function lle(i,e,t,n,o,r){const s=new sp(cle(i,n)),a=new sp(cle(e,o)),l=i.getOption(66),c=e.getOption(66),u=[];let d=0,h=0;function f(g,p){for(;;){let v=s.peek(),m=a.peek();if(v&&v.lineNumber>=g&&(v=void 0),m&&m.lineNumber>=p&&(m=void 0),!v&&!m)break;const _=v?v.lineNumber-d:Number.MAX_VALUE,y=m?m.lineNumber-h:Number.MAX_VALUE;_y?(a.dequeue(),v={lineNumber:m.lineNumber-h+d,heightInPx:0}):(s.dequeue(),a.dequeue()),u.push({originalRange:ln.ofLength(v.lineNumber,1),modifiedRange:ln.ofLength(m.lineNumber,1),originalHeightInPx:l+v.heightInPx,modifiedHeightInPx:c+m.heightInPx,diff:void 0})}}for(const g of t){let y=function(w,L){var D,E,I,k;if(w<_||LM.lineNumberM+H.heightInPx,0))!==null&&E!==void 0?E:0,N=(k=(I=a.takeWhile(M=>M.lineNumberM+H.heightInPx,0))!==null&&k!==void 0?k:0;u.push({originalRange:R,modifiedRange:A,originalHeightInPx:R.length*l+P,modifiedHeightInPx:A.length*c+N,diff:g.lineRangeMapping}),_=w,m=L};const p=g.lineRangeMapping;f(p.original.startLineNumber,p.modified.startLineNumber);let v=!0,m=p.modified.startLineNumber,_=p.original.startLineNumber;if(r)for(const w of p.innerChanges||[])w.originalRange.startColumn>1&&w.modifiedRange.startColumn>1&&y(w.originalRange.startLineNumber,w.modifiedRange.startLineNumber),w.originalRange.endColumn1&&n.push({lineNumber:l,heightInPx:s*(c-1)})}for(const l of i.getWhitespaces()){if(e.has(l.id))continue;const c=l.afterLineNumber===0?0:r.convertViewPositionToModelPosition(new ae(l.afterLineNumber,1)).lineNumber;t.push({lineNumber:c,heightInPx:l.height})}return Ugt(t,n,l=>l.lineNumber,(l,c)=>({lineNumber:l.lineNumber,heightInPx:l.heightInPx+c.heightInPx}))}var Dpt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},kpt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},cd;let Yg=cd=class extends _e{constructor(e,t,n,o,r,s,a,l){super(),this._editors=e,this._rootElement=t,this._diffModel=n,this._rootWidth=o,this._rootHeight=r,this._modifiedEditorLayoutInfo=s,this._options=a,this._themeService=l;const c=$r(this._themeService.onDidColorThemeChange,()=>this._themeService.getColorTheme()),u=In(f=>{const g=c.read(f),p=g.getColor(znt)||(g.getColor(Hnt)||fH).transparent(2),v=g.getColor(Unt)||(g.getColor($nt)||gH).transparent(2);return{insertColor:p,removeColor:v}}),d=$r(this._editors.modified.onDidScrollChange,()=>this._editors.modified.getScrollTop()),h=$r(this._editors.modified.onDidScrollChange,()=>this._editors.modified.getScrollHeight());this._register(Ja((f,g)=>{if(!this._options.renderOverviewRuler.read(f))return;const p=ti(document.createElement("div"));p.setClassName("diffViewport"),p.setPosition("absolute");const v=Or("div.diffOverview",{style:{position:"absolute",top:"0px",width:cd.ENTIRE_DIFF_OVERVIEW_WIDTH+"px"}}).root;g.add($2(v,p.domNode)),g.add(No(v,et.POINTER_DOWN,m=>{this._editors.modified.delegateVerticalScrollbarPointerDown(m)})),g.add(ke(v,et.MOUSE_WHEEL,m=>{this._editors.modified.delegateScrollFromMouseWheelEvent(m)},{passive:!1})),g.add($2(this._rootElement,v)),g.add(Ja((m,_)=>{const y=this._diffModel.read(m),w=this._editors.original.createOverviewRuler("original diffOverviewRuler");w&&(_.add(w),_.add($2(v,w.getDomNode())));const L=this._editors.modified.createOverviewRuler("modified diffOverviewRuler");if(L&&(_.add(L),_.add($2(v,L.getDomNode()))),!w||!L)return;const D=Fl("viewZoneChanged",this._editors.original.onDidChangeViewZones),E=Fl("viewZoneChanged",this._editors.modified.onDidChangeViewZones),I=Fl("hiddenRangesChanged",this._editors.original.onDidChangeHiddenAreas),k=Fl("hiddenRangesChanged",this._editors.modified.onDidChangeHiddenAreas);_.add(Ii(R=>{var A;D.read(R),E.read(R),I.read(R),k.read(R);const P=u.read(R),N=(A=y==null?void 0:y.diff.read(R))===null||A===void 0?void 0:A.mappings;function M(F,$,z){const K=z._getViewModel();return K?F.filter(j=>j.length>0).map(j=>{const G=K.coordinatesConverter.convertModelPositionToViewPosition(new ae(j.startLineNumber,1)),X=K.coordinatesConverter.convertModelPositionToViewPosition(new ae(j.endLineNumberExclusive,1)),de=X.lineNumber-G.lineNumber;return new Bbe(G.lineNumber,X.lineNumber,de,$.toString())}):[]}const H=M((N||[]).map(F=>F.lineRangeMapping.original),P.removeColor,this._editors.original),B=M((N||[]).map(F=>F.lineRangeMapping.modified),P.insertColor,this._editors.modified);w==null||w.setZones(H),L==null||L.setZones(B)})),_.add(Ii(R=>{const A=this._rootHeight.read(R),P=this._rootWidth.read(R),N=this._modifiedEditorLayoutInfo.read(R);if(N){const M=cd.ENTIRE_DIFF_OVERVIEW_WIDTH-2*cd.ONE_OVERVIEW_WIDTH;w.setLayout({top:0,height:A,right:M+cd.ONE_OVERVIEW_WIDTH,width:cd.ONE_OVERVIEW_WIDTH}),L.setLayout({top:0,height:A,right:0,width:cd.ONE_OVERVIEW_WIDTH});const H=d.read(R),B=h.read(R),F=this._editors.modified.getOption(102),$=new Dw(F.verticalHasArrows?F.arrowSize:0,F.verticalScrollbarSize,0,N.height,B,H);p.setTop($.getSliderPosition()),p.setHeight($.getSliderSize())}else p.setTop(0),p.setHeight(0);v.style.height=A+"px",v.style.left=P-cd.ENTIRE_DIFF_OVERVIEW_WIDTH+"px",p.setWidth(cd.ENTIRE_DIFF_OVERVIEW_WIDTH)}))}))}))}};Yg.ONE_OVERVIEW_WIDTH=15;Yg.ENTIRE_DIFF_OVERVIEW_WIDTH=cd.ONE_OVERVIEW_WIDTH*2;Yg=cd=Dpt([kpt(7,vr)],Yg);J("diffEditor.move.border",{dark:"#8b8b8b9c",light:"#8b8b8b9c",hcDark:"#8b8b8b9c",hcLight:"#8b8b8b9c"},C("diffEditor.move.border","The border color for text that got moved in the diff editor."));J("diffEditor.moveActive.border",{dark:"#FFA500",light:"#FFA500",hcDark:"#FFA500",hcLight:"#FFA500"},C("diffEditor.moveActive.border","The active border color for text that got moved in the diff editor."));class J5 extends _e{constructor(){super(...arguments),this._id=++J5.idCounter,this._onDidDispose=this._register(new le),this.onDidDispose=this._onDidDispose.event}getId(){return this.getEditorType()+":v2:"+this._id}getVisibleColumnFromPosition(e){return this._targetEditor.getVisibleColumnFromPosition(e)}getPosition(){return this._targetEditor.getPosition()}setPosition(e,t="api"){this._targetEditor.setPosition(e,t)}revealLine(e,t=0){this._targetEditor.revealLine(e,t)}revealLineInCenter(e,t=0){this._targetEditor.revealLineInCenter(e,t)}revealLineInCenterIfOutsideViewport(e,t=0){this._targetEditor.revealLineInCenterIfOutsideViewport(e,t)}revealLineNearTop(e,t=0){this._targetEditor.revealLineNearTop(e,t)}revealPosition(e,t=0){this._targetEditor.revealPosition(e,t)}revealPositionInCenter(e,t=0){this._targetEditor.revealPositionInCenter(e,t)}revealPositionInCenterIfOutsideViewport(e,t=0){this._targetEditor.revealPositionInCenterIfOutsideViewport(e,t)}revealPositionNearTop(e,t=0){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,n=0){this._targetEditor.revealLines(e,t,n)}revealLinesInCenter(e,t,n=0){this._targetEditor.revealLinesInCenter(e,t,n)}revealLinesInCenterIfOutsideViewport(e,t,n=0){this._targetEditor.revealLinesInCenterIfOutsideViewport(e,t,n)}revealLinesNearTop(e,t,n=0){this._targetEditor.revealLinesNearTop(e,t,n)}revealRange(e,t=0,n=!1,o=!0){this._targetEditor.revealRange(e,t,n,o)}revealRangeInCenter(e,t=0){this._targetEditor.revealRangeInCenter(e,t)}revealRangeInCenterIfOutsideViewport(e,t=0){this._targetEditor.revealRangeInCenterIfOutsideViewport(e,t)}revealRangeNearTop(e,t=0){this._targetEditor.revealRangeNearTop(e,t)}revealRangeNearTopIfOutsideViewport(e,t=0){this._targetEditor.revealRangeNearTopIfOutsideViewport(e,t)}revealRangeAtTop(e,t=0){this._targetEditor.revealRangeAtTop(e,t)}getSupportedActions(){return this._targetEditor.getSupportedActions()}focus(){this._targetEditor.focus()}trigger(e,t,n){this._targetEditor.trigger(e,t,n)}createDecorationsCollection(e){return this._targetEditor.createDecorationsCollection(e)}changeDecorations(e){return this._targetEditor.changeDecorations(e)}}J5.idCounter=0;var Ipt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},ule=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let oz=class extends _e{constructor(e,t,n,o,r,s,a){super(),this.originalEditorElement=e,this.modifiedEditorElement=t,this._options=n,this._createInnerEditor=r,this._instantiationService=s,this._keybindingService=a,this._onDidContentSizeChange=this._register(new le),this.original=this._register(this._createLeftHandSideEditor(n.editorOptions.get(),o.originalEditor||{})),this.modified=this._register(this._createRightHandSideEditor(n.editorOptions.get(),o.modifiedEditor||{})),this.modifiedModel=$r(this.modified.onDidChangeModel,()=>this.modified.getModel()),this._register(Y5({createEmptyChangeSummary:()=>({}),handleChange:(l,c)=>(l.didChange(n.editorOptions)&&Object.assign(c,l.change.changedOptions),!0)},(l,c)=>{n.editorOptions.read(l),this._options.renderSideBySide.read(l),this.modified.updateOptions(this._adjustOptionsForRightHandSide(l,c)),this.original.updateOptions(this._adjustOptionsForLeftHandSide(l,c))}))}_createLeftHandSideEditor(e,t){const n=this._adjustOptionsForLeftHandSide(void 0,e),o=this._constructInnerEditor(this._instantiationService,this.originalEditorElement,n,t);return o.setContextValue("isInDiffLeftEditor",!0),o}_createRightHandSideEditor(e,t){const n=this._adjustOptionsForRightHandSide(void 0,e),o=this._constructInnerEditor(this._instantiationService,this.modifiedEditorElement,n,t);return o.setContextValue("isInDiffRightEditor",!0),o}_constructInnerEditor(e,t,n,o){const r=this._createInnerEditor(e,t,n,o);return this._register(r.onDidContentSizeChange(s=>{const a=this.original.getContentWidth()+this.modified.getContentWidth()+Yg.ENTIRE_DIFF_OVERVIEW_WIDTH,l=Math.max(this.modified.getContentHeight(),this.original.getContentHeight());this._onDidContentSizeChange.fire({contentHeight:l,contentWidth:a,contentHeightChanged:s.contentHeightChanged,contentWidthChanged:s.contentWidthChanged})})),r}_adjustOptionsForLeftHandSide(e,t){const n=this._adjustOptionsForSubEditor(t);return this._options.renderSideBySide.get()?(n.unicodeHighlight=this._options.editorOptions.get().unicodeHighlight||{},n.wordWrapOverride1=this._options.diffWordWrap.get()):(n.wordWrapOverride1="off",n.wordWrapOverride2="off",n.stickyScroll={enabled:!1},n.unicodeHighlight={nonBasicASCII:!1,ambiguousCharacters:!1,invisibleCharacters:!1}),t.originalAriaLabel&&(n.ariaLabel=t.originalAriaLabel),n.ariaLabel=this._updateAriaLabel(n.ariaLabel),n.readOnly=!this._options.originalEditable.get(),n.dropIntoEditor={enabled:!n.readOnly},n.extraEditorClassName="original-in-monaco-diff-editor",n}_adjustOptionsForRightHandSide(e,t){const n=this._adjustOptionsForSubEditor(t);return t.modifiedAriaLabel&&(n.ariaLabel=t.modifiedAriaLabel),n.ariaLabel=this._updateAriaLabel(n.ariaLabel),n.wordWrapOverride1=this._options.diffWordWrap.get(),n.revealHorizontalRightPadding=rh.revealHorizontalRightPadding.defaultValue+Yg.ENTIRE_DIFF_OVERVIEW_WIDTH,n.scrollbar.verticalHasArrows=!1,n.extraEditorClassName="modified-in-monaco-diff-editor",n}_adjustOptionsForSubEditor(e){const t=Object.assign(Object.assign({},e),{dimension:{height:0,width:0}});return t.inDiffEditor=!0,t.automaticLayout=!1,t.scrollbar=Object.assign({},t.scrollbar||{}),t.scrollbar.vertical="visible",t.folding=!1,t.codeLens=this._options.diffCodeLens.get(),t.fixedOverflowWidgets=!0,t.minimap=Object.assign({},t.minimap||{}),t.minimap.enabled=!1,this._options.hideUnchangedRegions.get()?t.stickyScroll={enabled:!1}:t.stickyScroll=this._options.editorOptions.get().stickyScroll,t}_updateAriaLabel(e){var t;e||(e="");const n=C("diff-aria-navigation-tip"," use {0} to open the accessibility help.",(t=this._keybindingService.lookupKeybinding("editor.action.accessibilityHelp"))===null||t===void 0?void 0:t.getAriaLabel());return this._options.accessibilityVerbose.get()?e+n:e?e.replaceAll(n,""):""}};oz=Ipt([ule(5,$t),ule(6,xi)],oz);class Tpt{get editorOptions(){return this._options}constructor(e,t){this.diffEditorWidth=t,this.couldShowInlineViewBecauseOfSize=In(this,o=>this._options.read(o).renderSideBySide&&this.diffEditorWidth.read(o)<=this._options.read(o).renderSideBySideInlineBreakpoint),this.renderOverviewRuler=In(this,o=>this._options.read(o).renderOverviewRuler),this.renderSideBySide=In(this,o=>this._options.read(o).renderSideBySide&&!(this._options.read(o).useInlineViewWhenSpaceIsLimited&&this.couldShowInlineViewBecauseOfSize.read(o))),this.readOnly=In(this,o=>this._options.read(o).readOnly),this.shouldRenderRevertArrows=In(this,o=>!(!this._options.read(o).renderMarginRevertIcon||!this.renderSideBySide.read(o)||this.readOnly.read(o))),this.renderIndicators=In(this,o=>this._options.read(o).renderIndicators),this.enableSplitViewResizing=In(this,o=>this._options.read(o).enableSplitViewResizing),this.splitViewDefaultRatio=In(this,o=>this._options.read(o).splitViewDefaultRatio),this.ignoreTrimWhitespace=In(this,o=>this._options.read(o).ignoreTrimWhitespace),this.maxComputationTimeMs=In(this,o=>this._options.read(o).maxComputationTime),this.showMoves=In(this,o=>this._options.read(o).experimental.showMoves&&this.renderSideBySide.read(o)),this.isInEmbeddedEditor=In(this,o=>this._options.read(o).isInEmbeddedEditor),this.diffWordWrap=In(this,o=>this._options.read(o).diffWordWrap),this.originalEditable=In(this,o=>this._options.read(o).originalEditable),this.diffCodeLens=In(this,o=>this._options.read(o).diffCodeLens),this.accessibilityVerbose=In(this,o=>this._options.read(o).accessibilityVerbose),this.diffAlgorithm=In(this,o=>this._options.read(o).diffAlgorithm),this.showEmptyDecorations=In(this,o=>this._options.read(o).experimental.showEmptyDecorations),this.onlyShowAccessibleDiffViewer=In(this,o=>this._options.read(o).onlyShowAccessibleDiffViewer),this.hideUnchangedRegions=In(this,o=>this._options.read(o).hideUnchangedRegions.enabled),this.hideUnchangedRegionsRevealLineCount=In(this,o=>this._options.read(o).hideUnchangedRegions.revealLineCount),this.hideUnchangedRegionsContextLineCount=In(this,o=>this._options.read(o).hideUnchangedRegions.contextLineCount),this.hideUnchangedRegionsMinimumLineCount=In(this,o=>this._options.read(o).hideUnchangedRegions.minimumLineCount);const n=Object.assign(Object.assign({},e),dle(e,As));this._options=Ai(this,n)}updateOptions(e){const t=dle(e,this._options.get()),n=Object.assign(Object.assign(Object.assign({},this._options.get()),e),t);this._options.set(n,void 0,{changedOptions:e})}}function dle(i,e){var t,n,o,r,s,a,l,c;return{enableSplitViewResizing:xt(i.enableSplitViewResizing,e.enableSplitViewResizing),splitViewDefaultRatio:AXe(i.splitViewDefaultRatio,.5,.1,.9),renderSideBySide:xt(i.renderSideBySide,e.renderSideBySide),renderMarginRevertIcon:xt(i.renderMarginRevertIcon,e.renderMarginRevertIcon),maxComputationTime:N_(i.maxComputationTime,e.maxComputationTime,0,1073741824),maxFileSize:N_(i.maxFileSize,e.maxFileSize,0,1073741824),ignoreTrimWhitespace:xt(i.ignoreTrimWhitespace,e.ignoreTrimWhitespace),renderIndicators:xt(i.renderIndicators,e.renderIndicators),originalEditable:xt(i.originalEditable,e.originalEditable),diffCodeLens:xt(i.diffCodeLens,e.diffCodeLens),renderOverviewRuler:xt(i.renderOverviewRuler,e.renderOverviewRuler),diffWordWrap:To(i.diffWordWrap,e.diffWordWrap,["off","on","inherit"]),diffAlgorithm:To(i.diffAlgorithm,e.diffAlgorithm,["legacy","advanced"],{smart:"legacy",experimental:"advanced"}),accessibilityVerbose:xt(i.accessibilityVerbose,e.accessibilityVerbose),experimental:{showMoves:xt((t=i.experimental)===null||t===void 0?void 0:t.showMoves,e.experimental.showMoves),showEmptyDecorations:xt((n=i.experimental)===null||n===void 0?void 0:n.showEmptyDecorations,e.experimental.showEmptyDecorations)},hideUnchangedRegions:{enabled:xt((r=(o=i.hideUnchangedRegions)===null||o===void 0?void 0:o.enabled)!==null&&r!==void 0?r:(s=i.experimental)===null||s===void 0?void 0:s.collapseUnchangedRegions,e.hideUnchangedRegions.enabled),contextLineCount:N_((a=i.hideUnchangedRegions)===null||a===void 0?void 0:a.contextLineCount,e.hideUnchangedRegions.contextLineCount,0,1073741824),minimumLineCount:N_((l=i.hideUnchangedRegions)===null||l===void 0?void 0:l.minimumLineCount,e.hideUnchangedRegions.minimumLineCount,0,1073741824),revealLineCount:N_((c=i.hideUnchangedRegions)===null||c===void 0?void 0:c.revealLineCount,e.hideUnchangedRegions.revealLineCount,0,1073741824)},isInEmbeddedEditor:xt(i.isInEmbeddedEditor,e.isInEmbeddedEditor),onlyShowAccessibleDiffViewer:xt(i.onlyShowAccessibleDiffViewer,e.onlyShowAccessibleDiffViewer),renderSideBySideInlineBreakpoint:N_(i.renderSideBySideInlineBreakpoint,e.renderSideBySideInlineBreakpoint,0,1073741824),useInlineViewWhenSpaceIsLimited:xt(i.useInlineViewWhenSpaceIsLimited,e.useInlineViewWhenSpaceIsLimited)}}var Npt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Kx=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let cb=class extends J5{constructor(e,t,n,o,r,s,a,l){var c;super(),this._domElement=e,this._parentContextKeyService=o,this._parentInstantiationService=r,this._audioCueService=a,this._editorProgressService=l,this.elements=Or("div.monaco-diff-editor.side-by-side",{style:{position:"relative",height:"100%"}},[Or("div.noModificationsOverlay@overlay",{style:{position:"absolute",height:"100%",visibility:"hidden"}},[He("span",{},"No Changes")]),Or("div.editor.original@original",{style:{position:"absolute",height:"100%"}}),Or("div.editor.modified@modified",{style:{position:"absolute",height:"100%"}}),Or("div.accessibleDiffViewer@accessibleDiffViewer",{style:{position:"absolute",height:"100%"}})]),this._diffModel=this._register(JP("diffModel",void 0)),this.onDidChangeModel=st.fromObservableLight(this._diffModel),this._contextKeyService=this._register(this._parentContextKeyService.createScoped(this._domElement)),this._instantiationService=this._parentInstantiationService.createChild(new L5([Ut,this._contextKeyService])),this._boundarySashes=Ai(this,void 0),this._accessibleDiffViewerShouldBeVisible=Ai(this,!1),this._accessibleDiffViewerVisible=In(this,p=>this._options.onlyShowAccessibleDiffViewer.read(p)?!0:this._accessibleDiffViewerShouldBeVisible.read(p)),this.movedBlocksLinesPart=Ai(this,void 0),this._layoutInfo=In(this,p=>{var v,m,_;const y=this._rootSizeObserver.width.read(p),w=this._rootSizeObserver.height.read(p),L=(v=this._sash.read(p))===null||v===void 0?void 0:v.sashLeft.read(p),D=L!=null?L:Math.max(5,this._editors.original.getLayoutInfo().decorationsLeft),E=y-D-(this._options.renderOverviewRuler.read(p)?Yg.ENTIRE_DIFF_OVERVIEW_WIDTH:0),I=(_=(m=this.movedBlocksLinesPart.read(p))===null||m===void 0?void 0:m.width.read(p))!==null&&_!==void 0?_:0,k=D-I;return this.elements.original.style.width=k+"px",this.elements.original.style.left="0px",this.elements.modified.style.width=E+"px",this.elements.modified.style.left=D+"px",this._editors.original.layout({width:k,height:w}),this._editors.modified.layout({width:E,height:w}),{modifiedEditor:this._editors.modified.getLayoutInfo(),originalEditor:this._editors.original.getLayoutInfo()}}),this._diffValue=this._diffModel.map((p,v)=>p==null?void 0:p.diff.read(v)),this.onDidUpdateDiff=st.fromObservableLight(this._diffValue),s.willCreateDiffEditor(),this._contextKeyService.createKey("isInDiffEditor",!0),this._domElement.appendChild(this.elements.root),this._register(zt(()=>this._domElement.removeChild(this.elements.root))),this._rootSizeObserver=this._register(new jgt(this.elements.root,t.dimension)),this._rootSizeObserver.setAutomaticLayout((c=t.automaticLayout)!==null&&c!==void 0?c:!1),this._options=new Tpt(t,this._rootSizeObserver.width),this._contextKeyService.createKey(Q.isEmbeddedDiffEditor.key,!1);const u=Q.isEmbeddedDiffEditor.bindTo(this._contextKeyService);this._register(Ii(p=>{u.set(this._options.isInEmbeddedEditor.read(p))}));const d=Q.comparingMovedCode.bindTo(this._contextKeyService);this._register(Ii(p=>{var v;d.set(!!(!((v=this._diffModel.read(p))===null||v===void 0)&&v.movedTextToCompare.read(p)))}));const h=Q.diffEditorRenderSideBySideInlineBreakpointReached.bindTo(this._contextKeyService);this._register(Ii(p=>{h.set(this._options.couldShowInlineViewBecauseOfSize.read(p))})),this._editors=this._register(this._instantiationService.createInstance(oz,this.elements.original,this.elements.modified,this._options,n,(p,v,m,_)=>this._createInnerEditor(p,v,m,_))),this._sash=kk(this,(p,v)=>{const m=this._options.renderSideBySide.read(p);if(this.elements.root.classList.toggle("side-by-side",m),!m)return;const _=v.add(new hpt(this._options,this.elements.root,{height:this._rootSizeObserver.height,width:this._rootSizeObserver.width.map((y,w)=>y-(this._options.renderOverviewRuler.read(w)?Yg.ENTIRE_DIFF_OVERVIEW_WIDTH:0))}));return v.add(Ii(y=>{const w=this._boundarySashes.read(y);w&&_.setBoundarySashes(w)})),_}),this._register(Tk(this._sash)),this._register(Ja((p,v)=>{this.unchangedRangesFeature=v.add(this._instantiationService.createInstance(nm(J$,p),this._editors,this._diffModel,this._options))})),this._register(Ja((p,v)=>{v.add(new(nm(dpt,p))(this._editors,this._diffModel,this._options))})),this._register(Ja((p,v)=>{v.add(this._instantiationService.createInstance(nm(iz,p),this._editors,this._diffModel,this._options,this,()=>this.unchangedRangesFeature.isUpdatingViewZones))})),this._register(Ja((p,v)=>{v.add(this._instantiationService.createInstance(nm(Yg,p),this._editors,this.elements.root,this._diffModel,this._rootSizeObserver.width,this._rootSizeObserver.height,this._layoutInfo.map(m=>m.modifiedEditor),this._options))})),this._register(Ja((p,v)=>{this._accessibleDiffViewer=v.add(this._register(this._instantiationService.createInstance(nm(Im,p),this.elements.accessibleDiffViewer,this._accessibleDiffViewerVisible,(m,_)=>this._accessibleDiffViewerShouldBeVisible.set(m,_),this._options.onlyShowAccessibleDiffViewer.map(m=>!m),this._rootSizeObserver.width,this._rootSizeObserver.height,this._diffModel.map((m,_)=>{var y;return(y=m==null?void 0:m.diff.read(_))===null||y===void 0?void 0:y.mappings.map(w=>w.lineRangeMapping)}),this._editors)))}));const f=this._accessibleDiffViewerVisible.map(p=>p?"hidden":"visible");this._register(tv(this.elements.modified,{visibility:f})),this._register(tv(this.elements.original,{visibility:f})),this._createDiffEditorContributions(),s.addDiffEditor(this),this._register(Tk(this._layoutInfo)),this._register(Ja((p,v)=>{this.movedBlocksLinesPart.set(v.add(new(nm(nv,p))(this.elements.root,this._diffModel,this._layoutInfo.map(m=>m.originalEditor),this._layoutInfo.map(m=>m.modifiedEditor),this._editors)),void 0)})),this._register(tv(this.elements.overlay,{width:this._layoutInfo.map((p,v)=>p.originalEditor.width+(this._options.renderSideBySide.read(v)?0:p.modifiedEditor.width)),visibility:In(p=>{var v,m;return this._options.hideUnchangedRegions.read(p)&&((m=(v=this._diffModel.read(p))===null||v===void 0?void 0:v.diff.read(p))===null||m===void 0?void 0:m.mappings.length)===0?"visible":"hidden"})})),this._register(this._editors.modified.onMouseDown(p=>{var v,m;if(!p.event.rightButton&&p.target.position&&((v=p.target.element)===null||v===void 0?void 0:v.className.includes("arrow-revert-change"))){const _=p.target.position.lineNumber,y=p.target,w=this._diffModel.get();if(!w)return;const L=(m=w.diff.get())===null||m===void 0?void 0:m.mappings;if(!L)return;const D=L.find(E=>(y==null?void 0:y.detail.afterLineNumber)===E.lineRangeMapping.modified.startLineNumber-1||E.lineRangeMapping.modified.startLineNumber===_);if(!D)return;this.revert(D.lineRangeMapping),p.event.stopPropagation()}})),this._register(st.runAndSubscribe(this._editors.modified.onDidChangeCursorPosition,p=>{var v,m;if((p==null?void 0:p.reason)===3){const _=(m=(v=this._diffModel.get())===null||v===void 0?void 0:v.diff.get())===null||m===void 0?void 0:m.mappings.find(y=>y.lineRangeMapping.modified.contains(p.position.lineNumber));_!=null&&_.lineRangeMapping.modified.isEmpty?this._audioCueService.playAudioCue(Wn.diffLineDeleted,{source:"diffEditor.cursorPositionChanged"}):_!=null&&_.lineRangeMapping.original.isEmpty?this._audioCueService.playAudioCue(Wn.diffLineInserted,{source:"diffEditor.cursorPositionChanged"}):_&&this._audioCueService.playAudioCue(Wn.diffLineModified,{source:"diffEditor.cursorPositionChanged"})}}));const g=this._diffModel.map((p,v)=>p==null?void 0:p.isDiffUpToDate.read(v));this._register(Ja((p,v)=>{if(g.read(p)===!1){const m=this._editorProgressService.show(!0,1e3);v.add(zt(()=>m.done()))}}))}_createInnerEditor(e,t,n,o){return e.createInstance(Iw,t,n,o)}_createDiffEditorContributions(){const e=vy.getDiffEditorContributions();for(const t of e)try{this._register(this._instantiationService.createInstance(t.ctor,this))}catch(n){en(n)}}get _targetEditor(){return this._editors.modified}getEditorType(){return UI.IDiffEditor}layout(e){this._rootSizeObserver.observe(e)}hasTextFocus(){return this._editors.original.hasTextFocus()||this._editors.modified.hasTextFocus()}saveViewState(){var e;const t=this._editors.original.saveViewState(),n=this._editors.modified.saveViewState();return{original:t,modified:n,modelState:(e=this._diffModel.get())===null||e===void 0?void 0:e.serializeState()}}restoreViewState(e){var t;if(e&&e.original&&e.modified){const n=e;this._editors.original.restoreViewState(n.original),this._editors.modified.restoreViewState(n.modified),n.modelState&&((t=this._diffModel.get())===null||t===void 0||t.restoreSerializedState(n.modelState))}}createViewModel(e){return this._instantiationService.createInstance(nz,e,this._options,this)}getModel(){var e,t;return(t=(e=this._diffModel.get())===null||e===void 0?void 0:e.model)!==null&&t!==void 0?t:null}setModel(e){!e&&this._diffModel.get()&&this._accessibleDiffViewer.close();const t=e?"model"in e?e:this.createViewModel(e):void 0;this._editors.original.setModel(t?t.model.original:null),this._editors.modified.setModel(t?t.model.modified:null),qi(n=>{this._diffModel.set(t,n)})}updateOptions(e){this._options.updateOptions(e)}getContainerDomNode(){return this._domElement}getOriginalEditor(){return this._editors.original}getModifiedEditor(){return this._editors.modified}getLineChanges(){var e;const t=(e=this._diffModel.get())===null||e===void 0?void 0:e.diff.get();return t?Apt(t):null}revert(e){var t;const n=(t=this._diffModel.get())===null||t===void 0?void 0:t.model;if(!n)return;const o=e.innerChanges?e.innerChanges.map(r=>({range:r.modifiedRange,text:n.original.getValueInRange(r.originalRange)})):[{range:e.modified.toExclusiveRange(),text:n.original.getValueInRange(e.original.toExclusiveRange())}];this._editors.modified.executeEdits("diffEditor",o)}accessibleDiffViewerNext(){this._accessibleDiffViewer.next()}accessibleDiffViewerPrev(){this._accessibleDiffViewer.prev()}mapToOtherSide(){var e,t;const n=this._editors.modified.hasWidgetFocus(),o=n?this._editors.modified:this._editors.original,r=n?this._editors.original:this._editors.modified;let s;const a=o.getSelection();if(a){const l=(t=(e=this._diffModel.get())===null||e===void 0?void 0:e.diff.get())===null||t===void 0?void 0:t.mappings.map(c=>n?c.lineRangeMapping.flip():c.lineRangeMapping);if(l){const c=hle(a.getStartPosition(),l),u=hle(a.getEndPosition(),l);s=V.plusRange(c,u)}}return{destination:r,destinationSelection:s}}switchSide(){const{destination:e,destinationSelection:t}=this.mapToOtherSide();e.focus(),t&&e.setSelection(t)}exitCompareMove(){const e=this._diffModel.get();!e||e.movedTextToCompare.set(void 0,void 0)}collapseAllUnchangedRegions(){var e;const t=(e=this._diffModel.get())===null||e===void 0?void 0:e.unchangedRegions.get();!t||qi(n=>{for(const o of t)o.collapseAll(n)})}showAllUnchangedRegions(){var e;const t=(e=this._diffModel.get())===null||e===void 0?void 0:e.unchangedRegions.get();!t||qi(n=>{for(const o of t)o.showAll(n)})}};cb=Npt([Kx(3,Ut),Kx(4,$t),Kx(5,Jn),Kx(6,uT),Kx(7,Jv)],cb);function hle(i,e){const t=eP(e,o=>o.original.startLineNumber<=i.lineNumber);if(!t)return V.fromPositions(i);if(t.original.endLineNumberExclusive<=i.lineNumber){const o=i.lineNumber-t.original.endLineNumberExclusive+t.modified.endLineNumberExclusive;return V.fromPositions(new ae(o,i.column))}if(!t.innerChanges)return V.fromPositions(new ae(t.modified.startLineNumber,1));const n=eP(t.innerChanges,o=>o.originalRange.getStartPosition().isBeforeOrEqual(i));if(!n){const o=i.lineNumber-t.original.startLineNumber+t.modified.startLineNumber;return V.fromPositions(new ae(o,i.column))}if(n.originalRange.containsPosition(i))return n.modifiedRange;{const o=Rpt(n.originalRange.getEndPosition(),i);return V.fromPositions(Mpt(n.modifiedRange.getEndPosition(),o))}}function Rpt(i,e){return i.lineNumber===e.lineNumber?new ok(0,e.column-i.column):new ok(e.lineNumber-i.lineNumber,e.column-1)}function Mpt(i,e){return e.lineCount===0?new ae(i.lineNumber,i.column+e.columnCount):new ae(i.lineNumber+e.lineCount,e.columnCount+1)}function Apt(i){return i.mappings.map(e=>{const t=e.lineRangeMapping;let n,o,r,s,a=t.innerChanges;return t.original.isEmpty?(n=t.original.startLineNumber-1,o=0,a=void 0):(n=t.original.startLineNumber,o=t.original.endLineNumberExclusive-1),t.modified.isEmpty?(r=t.modified.startLineNumber-1,s=0,a=void 0):(r=t.modified.startLineNumber,s=t.modified.endLineNumberExclusive-1),{originalStartLineNumber:n,originalEndLineNumber:o,modifiedStartLineNumber:r,modifiedEndLineNumber:s,charChanges:a==null?void 0:a.map(l=>({originalStartLineNumber:l.originalRange.startLineNumber,originalStartColumn:l.originalRange.startColumn,originalEndLineNumber:l.originalRange.endLineNumber,originalEndColumn:l.originalRange.endColumn,modifiedStartLineNumber:l.modifiedRange.startLineNumber,modifiedStartColumn:l.modifiedRange.startColumn,modifiedEndLineNumber:l.modifiedRange.endLineNumber,modifiedEndColumn:l.modifiedRange.endColumn}))}})}var GX=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},zi=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let Ppt=0,fle=!1;function Opt(i){if(!i){if(fle)return;fle=!0}Wtt(i||document.body)}let sO=class extends Iw{constructor(e,t,n,o,r,s,a,l,c,u,d,h){const f=Object.assign({},t);f.ariaLabel=f.ariaLabel||NP.editorViewAccessibleLabel,f.ariaLabel=f.ariaLabel+";"+NP.accessibilityHelpMessage,super(e,f,{},n,o,r,s,l,c,u,d,h),a instanceof Fw?this._standaloneKeybindingService=a:this._standaloneKeybindingService=null,Opt(f.ariaContainerElement)}addCommand(e,t,n){if(!this._standaloneKeybindingService)return console.warn("Cannot add command because the editor is configured with an unrecognized KeybindingService"),null;const o="DYNAMIC_"+ ++Ppt,r=Me.deserialize(n);return this._standaloneKeybindingService.addDynamicKeybinding(o,e,t,r),o}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"),_e.None;const t=e.id,n=e.label,o=Me.and(Me.equals("editorId",this.getId()),Me.deserialize(e.precondition)),r=e.keybindings,s=Me.and(o,Me.deserialize(e.keybindingContext)),a=e.contextMenuGroupId||null,l=e.contextMenuOrder||0,c=(f,...g)=>Promise.resolve(e.run(this,...g)),u=new Be,d=this.getId()+":"+t;if(u.add(Rn.registerCommand(d,c)),a){const f={command:{id:d,title:n},when:o,group:a,order:l};u.add(Hr.appendMenuItem(Z.EditorContext,f))}if(Array.isArray(r))for(const f of r)u.add(this._standaloneKeybindingService.addDynamicKeybinding(d,f,c,s));const h=new Wbe(d,n,n,o,(...f)=>Promise.resolve(e.run(this,...f)),this._contextKeyService);return this._actions.set(t,h),u.add(zt(()=>{this._actions.delete(t)})),u}_triggerCommand(e,t){if(this._codeEditorService instanceof SP)try{this._codeEditorService.setActiveCodeEditor(this),super._triggerCommand(e,t)}finally{this._codeEditorService.setActiveCodeEditor(null)}else super._triggerCommand(e,t)}};sO=GX([zi(2,$t),zi(3,Jn),zi(4,_o),zi(5,Ut),zi(6,xi),zi(7,vr),zi(8,Ao),zi(9,vp),zi(10,Ti),zi(11,pt)],sO);let rz=class extends sO{constructor(e,t,n,o,r,s,a,l,c,u,d,h,f,g,p){const v=Object.assign({},t);QP(u,v,!1);const m=l.registerEditorContainer(e);typeof v.theme=="string"&&l.setTheme(v.theme),typeof v.autoDetectHighContrast!="undefined"&&l.setAutoDetectHighContrast(Boolean(v.autoDetectHighContrast));const _=v.model;delete v.model,super(e,v,n,o,r,s,a,l,c,d,g,p),this._configurationService=u,this._standaloneThemeService=l,this._register(m);let y;if(typeof _=="undefined"){const w=f.getLanguageIdByMimeType(v.language)||v.language||Gl;y=KCe(h,f,v.value||"",w,void 0),this._ownsModel=!0}else y=_,this._ownsModel=!1;if(this._attachModel(y),y){const w={oldModelUrl:null,newModelUrl:y.uri};this._onDidChangeModel.fire(w)}}dispose(){super.dispose()}updateOptions(e){QP(this._configurationService,e,!1),typeof e.theme=="string"&&this._standaloneThemeService.setTheme(e.theme),typeof e.autoDetectHighContrast!="undefined"&&this._standaloneThemeService.setAutoDetectHighContrast(Boolean(e.autoDetectHighContrast)),super.updateOptions(e)}_postDetachModelCleanup(e){super._postDetachModelCleanup(e),e&&this._ownsModel&&(e.dispose(),this._ownsModel=!1)}};rz=GX([zi(2,$t),zi(3,Jn),zi(4,_o),zi(5,Ut),zi(6,xi),zi(7,ic),zi(8,Ao),zi(9,En),zi(10,vp),zi(11,Yi),zi(12,Ki),zi(13,Ti),zi(14,pt)],rz);let sz=class extends cb{constructor(e,t,n,o,r,s,a,l,c,u,d,h){const f=Object.assign({},t);QP(l,f,!0);const g=s.registerEditorContainer(e);typeof f.theme=="string"&&s.setTheme(f.theme),typeof f.autoDetectHighContrast!="undefined"&&s.setAutoDetectHighContrast(Boolean(f.autoDetectHighContrast)),super(e,f,{},o,n,r,h,u),this._configurationService=l,this._standaloneThemeService=s,this._register(g)}dispose(){super.dispose()}updateOptions(e){QP(this._configurationService,e,!0),typeof e.theme=="string"&&this._standaloneThemeService.setTheme(e.theme),typeof e.autoDetectHighContrast!="undefined"&&this._standaloneThemeService.setAutoDetectHighContrast(Boolean(e.autoDetectHighContrast)),super.updateOptions(e)}_createInnerEditor(e,t,n){return e.createInstance(sO,t,n)}getOriginalEditor(){return super.getOriginalEditor()}getModifiedEditor(){return super.getModifiedEditor()}addCommand(e,t,n){return this.getModifiedEditor().addCommand(e,t,n)}createContextKey(e,t){return this.getModifiedEditor().createContextKey(e,t)}addAction(e){return this.getModifiedEditor().addAction(e)}};sz=GX([zi(2,$t),zi(3,Ut),zi(4,Jn),zi(5,ic),zi(6,Ao),zi(7,En),zi(8,Ku),zi(9,Jv),zi(10,yp),zi(11,uT)],sz);function KCe(i,e,t,n,o){if(t=t||"",!n){const r=t.indexOf(` +`);let s=t;return r!==-1&&(s=t.substring(0,r)),gle(i,t,e.createByFilepathOrFirstLine(o||null,s),o)}return gle(i,t,e.createById(n),o)}function gle(i,e,t,n){return i.createModel(e,t,n)}var qCe=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};function Fpt(i,e,t){return Vt.initialize(t||{}).createInstance(rz,i,e)}function Bpt(i){return Vt.get(Jn).onCodeEditorAdd(t=>{i(t)})}function Wpt(i){return Vt.get(Jn).onDiffEditorAdd(t=>{i(t)})}function Vpt(){return Vt.get(Jn).listCodeEditors()}function Hpt(){return Vt.get(Jn).listDiffEditors()}function $pt(i,e,t){return Vt.initialize(t||{}).createInstance(sz,i,e)}function zpt(i){if(typeof i.id!="string"||typeof i.run!="function")throw new Error("Invalid command descriptor, `id` and `run` are required properties!");return Rn.registerCommand(i.id,i.run)}function Upt(i){if(typeof i.id!="string"||typeof i.label!="string"||typeof i.run!="function")throw new Error("Invalid action descriptor, `id`, `label` and `run` are required properties!");const e=Me.deserialize(i.precondition),t=(o,...r)=>Ir.runEditorCommand(o,r,e,(s,a,l)=>Promise.resolve(i.run(a,...l))),n=new Be;if(n.add(Rn.registerCommand(i.id,t)),i.contextMenuGroupId){const o={command:{id:i.id,title:i.label},when:e,group:i.contextMenuGroupId,order:i.contextMenuOrder||0};n.add(Hr.appendMenuItem(Z.EditorContext,o))}if(Array.isArray(i.keybindings)){const o=Vt.get(xi);if(!(o instanceof Fw))console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService");else{const r=Me.and(e,Me.deserialize(i.keybindingContext));n.add(o.addDynamicKeybindings(i.keybindings.map(s=>({keybinding:s,command:i.id,when:r}))))}}return n}function jpt(i){return GCe([i])}function GCe(i){const e=Vt.get(xi);return e instanceof Fw?e.addDynamicKeybindings(i.map(t=>({keybinding:t.keybinding,command:t.command,commandArgs:t.commandArgs,when:Me.deserialize(t.when)}))):(console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService"),_e.None)}function Kpt(i,e,t){const n=Vt.get(Ki),o=n.getLanguageIdByMimeType(e)||e;return KCe(Vt.get(Yi),n,i,o,t)}function qpt(i,e){const t=Vt.get(Ki),n=t.getLanguageIdByMimeType(e)||e||Gl;i.setLanguage(t.createById(n))}function Gpt(i,e,t){i&&Vt.get(Rf).changeOne(e,i.uri,t)}function Xpt(i){Vt.get(Rf).changeAll(i,[])}function Ypt(i){return Vt.get(Rf).read(i)}function Zpt(i){return Vt.get(Rf).onMarkerChanged(i)}function Qpt(i){return Vt.get(Yi).getModel(i)}function Jpt(){return Vt.get(Yi).getModels()}function emt(i){return Vt.get(Yi).onModelAdded(i)}function tmt(i){return Vt.get(Yi).onModelRemoved(i)}function nmt(i){return Vt.get(Yi).onModelLanguageChanged(t=>{i({model:t.model,oldLanguage:t.oldLanguageId})})}function imt(i){return htt(Vt.get(Yi),Vt.get(Ti),i)}function omt(i,e){const t=Vt.get(Ki),n=Vt.get(ic);return _G.colorizeElement(n,t,i,e).then(()=>{n.registerEditorContainer(i)})}function rmt(i,e,t){const n=Vt.get(Ki);return Vt.get(ic).registerEditorContainer(document.body),_G.colorize(n,i,e,t)}function smt(i,e,t=4){return Vt.get(ic).registerEditorContainer(document.body),_G.colorizeModelLine(i,e,t)}function amt(i){const e=oo.get(i);return e||{getInitialState:()=>Cw,tokenize:(t,n,o)=>pG(i,o)}}function lmt(i,e){oo.getOrCreate(e);const t=amt(e),n=gf(i),o=[];let r=t.getInitialState();for(let s=0,a=n.length;sqCe(this,void 0,void 0,function*(){var r;if(!n)return null;const s=(r=t.options)===null||r===void 0?void 0:r.selection;let a;return s&&typeof s.endLineNumber=="number"&&typeof s.endColumn=="number"?a=s:s&&(a={lineNumber:s.startLineNumber,column:s.startColumn}),(yield i.openCodeEditor(n,t.resource,a))?n:null}))}function pmt(){return{create:Fpt,getEditors:Vpt,getDiffEditors:Hpt,onDidCreateEditor:Bpt,onDidCreateDiffEditor:Wpt,createDiffEditor:$pt,addCommand:zpt,addEditorAction:Upt,addKeybindingRule:jpt,addKeybindingRules:GCe,createModel:Kpt,setModelLanguage:qpt,setModelMarkers:Gpt,getModelMarkers:Ypt,removeAllMarkers:Xpt,onDidChangeMarkers:Zpt,getModels:Jpt,getModel:Qpt,onDidCreateModel:emt,onWillDisposeModel:tmt,onDidChangeModelLanguage:nmt,createWebWorker:imt,colorizeElement:omt,colorize:rmt,colorizeModelLine:smt,tokenize:lmt,defineTheme:cmt,setTheme:umt,remeasureFonts:dmt,registerCommand:hmt,registerLinkOpener:fmt,registerEditorOpener:gmt,AccessibilitySupport:eV,ContentWidgetPositionPreference:sV,CursorChangeReason:aV,DefaultEndOfLine:lV,EditorAutoIndentStrategy:uV,EditorOption:dV,EndOfLinePreference:hV,EndOfLineSequence:fV,MinimapPosition:wV,MouseTargetType:SV,OverlayWidgetPositionPreference:xV,OverviewRulerLane:LV,GlyphMarginLane:gV,RenderLineNumbersType:DV,RenderMinimap:kV,ScrollbarVisibility:TV,ScrollType:IV,TextEditorCursorBlinkingStyle:PV,TextEditorCursorStyle:OV,TrackedRangeStickiness:FV,WrappingIndent:BV,InjectedTextCursorStops:mV,PositionAffinity:EV,ConfigurationChangedEvent:w_e,BareFontInfo:E0,FontInfo:HV,TextModelResolvedOptions:oM,FindMatch:WD,ApplyUpdateResult:aE,EditorZoom:xc,EditorType:UI,EditorOptions:rh}}function mmt(i,e){if(!e||!Array.isArray(e))return!1;for(const t of e)if(!i(t))return!1;return!0}function z2(i,e){return typeof i=="boolean"?i:e}function ple(i,e){return typeof i=="string"?i:e}function vmt(i){const e={};for(const t of i)e[t]=!0;return e}function mle(i,e=!1){e&&(i=i.map(function(n){return n.toLowerCase()}));const t=vmt(i);return e?function(n){return t[n.toLowerCase()]!==void 0&&t.hasOwnProperty(n.toLowerCase())}:function(n){return t[n]!==void 0&&t.hasOwnProperty(n)}}function az(i,e){e=e.replace(/@@/g,"");let t=0,n;do n=!1,e=e.replace(/@(\w+)/g,function(r,s){n=!0;let a="";if(typeof i[s]=="string")a=i[s];else if(i[s]&&i[s]instanceof RegExp)a=i[s].source;else throw i[s]===void 0?Bi(i,"language definition does not contain attribute '"+s+"', used at: "+e):Bi(i,"attribute reference '"+s+"' must be a string, used at: "+e);return cC(a)?"":"(?:"+a+")"}),t++;while(n&&t<5);e=e.replace(/\x01/g,"@");const o=(i.ignoreCase?"i":"")+(i.unicode?"u":"");return new RegExp(e,o)}function _mt(i,e,t,n){if(n<0)return i;if(n=100){n=n-100;const o=t.split(".");if(o.unshift(t),n=0&&(n.tokenSubst=!0),typeof t.bracket=="string")if(t.bracket==="@open")n.bracket=1;else if(t.bracket==="@close")n.bracket=-1;else throw Bi(i,"a 'bracket' attribute must be either '@open' or '@close', in rule: "+e);if(t.next){if(typeof t.next!="string")throw Bi(i,"the next state must be a string value in rule: "+e);{let o=t.next;if(!/^(@pop|@push|@popall)$/.test(o)&&(o[0]==="@"&&(o=o.substr(1)),o.indexOf("$")<0&&!Ntt(i,am(i,o,"",[],""))))throw Bi(i,"the next state '"+t.next+"' is not defined in rule: "+e);n.next=o}}return typeof t.goBack=="number"&&(n.goBack=t.goBack),typeof t.switchTo=="string"&&(n.switchTo=t.switchTo),typeof t.log=="string"&&(n.log=t.log),typeof t.nextEmbedded=="string"&&(n.nextEmbedded=t.nextEmbedded,i.usesEmbedded=!0),n}}else if(Array.isArray(t)){const n=[];for(let o=0,r=t.length;o0&&n[0]==="^",this.name=this.name+": "+n,this.regex=az(e,"^(?:"+(this.matchOnlyAtLineStart?n.substr(1):n)+")")}setAction(e,t){this.action=lz(e,this.name,t)}}function XCe(i,e){if(!e||typeof e!="object")throw new Error("Monarch: expecting a language definition object");const t={};t.languageId=i,t.includeLF=z2(e.includeLF,!1),t.noThrow=!1,t.maxStack=100,t.start=typeof e.start=="string"?e.start:null,t.ignoreCase=z2(e.ignoreCase,!1),t.unicode=z2(e.unicode,!1),t.tokenPostfix=ple(e.tokenPostfix,"."+t.languageId),t.defaultToken=ple(e.defaultToken,"source"),t.usesEmbedded=!1;const n=e;n.languageId=i,n.includeLF=t.includeLF,n.ignoreCase=t.ignoreCase,n.unicode=t.unicode,n.noThrow=t.noThrow,n.usesEmbedded=t.usesEmbedded,n.stateNames=e.tokenizer,n.defaultToken=t.defaultToken;function o(s,a,l){for(const c of l){let u=c.include;if(u){if(typeof u!="string")throw Bi(t,"an 'include' attribute must be a string at: "+s);if(u[0]==="@"&&(u=u.substr(1)),!e.tokenizer[u])throw Bi(t,"include target '"+u+"' is not defined at: "+s);o(s+"."+u,a,e.tokenizer[u])}else{const d=new Cmt(s);if(Array.isArray(c)&&c.length>=1&&c.length<=3)if(d.setRegex(n,c[0]),c.length>=3)if(typeof c[1]=="string")d.setAction(n,{token:c[1],next:c[2]});else if(typeof c[1]=="object"){const h=c[1];h.next=c[2],d.setAction(n,h)}else throw Bi(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: "+s);else d.setAction(n,c[1]);else{if(!c.regex)throw Bi(t,"a rule must either be an array, or an object with a 'regex' or 'include' field at: "+s);c.name&&typeof c.name=="string"&&(d.name=c.name),c.matchOnlyAtStart&&(d.matchOnlyAtLineStart=z2(c.matchOnlyAtLineStart,!1)),d.setRegex(n,c.regex),d.setAction(n,c.action)}a.push(d)}}}if(!e.tokenizer||typeof e.tokenizer!="object")throw Bi(t,"a language definition must define the 'tokenizer' attribute as an object");t.tokenizer=[];for(const s in e.tokenizer)if(e.tokenizer.hasOwnProperty(s)){t.start||(t.start=s);const a=e.tokenizer[s];t.tokenizer[s]=new Array,o("tokenizer."+s,t.tokenizer[s],a)}if(t.usesEmbedded=n.usesEmbedded,e.brackets){if(!Array.isArray(e.brackets))throw Bi(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 s of e.brackets){let a=s;if(a&&Array.isArray(a)&&a.length===3&&(a={token:a[2],open:a[0],close:a[1]}),a.open===a.close)throw Bi(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:Xm(t,a.open),close:Xm(t,a.close)});else throw Bi(t,"every element in the 'brackets' array must be a '{open,close,token}' object or array")}return t.brackets=r,t.noThrow=!0,t}var ymt=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};function wmt(i){_w.registerLanguage(i)}function Smt(){let i=[];return i=i.concat(_w.getLanguages()),i}function xmt(i){return Vt.get(Ki).languageIdCodec.encodeLanguageId(i)}function Lmt(i,e){return Vt.withServices(()=>{const n=Vt.get(Ki).onDidRequestRichLanguageFeatures(o=>{o===i&&(n.dispose(),e())});return n})}function Emt(i,e){return Vt.withServices(()=>{const n=Vt.get(Ki).onDidRequestBasicLanguageFeatures(o=>{o===i&&(n.dispose(),e())});return n})}function Dmt(i,e){if(!Vt.get(Ki).isRegisteredLanguageId(i))throw new Error(`Cannot set configuration for unknown language ${i}`);return Vt.get(Ti).register(i,e,100)}class kmt{constructor(e,t){this._languageId=e,this._actual=t}dispose(){}getInitialState(){return this._actual.getInitialState()}tokenize(e,t,n){if(typeof this._actual.tokenize=="function")return Nk.adaptTokenize(this._languageId,this._actual,e,n);throw new Error("Not supported!")}tokenizeEncoded(e,t,n){const o=this._actual.tokenizeEncoded(e,n);return new H4(o.tokens,o.endState)}}class Nk{constructor(e,t,n,o){this._languageId=e,this._actual=t,this._languageService=n,this._standaloneThemeService=o}dispose(){}getInitialState(){return this._actual.getInitialState()}static _toClassicTokens(e,t){const n=[];let o=0;for(let r=0,s=e.length;r0&&r[s-1]===h)continue;let f=d.startIndex;c===0?f=0:fymt(this,void 0,void 0,function*(){const n=yield Promise.resolve(e.create());return n?Imt(n)?ZCe(i,n):new KD(Vt.get(Ki),Vt.get(ic),i,XCe(i,n),Vt.get(En)):null}));return oo.registerFactory(i,t)}function Rmt(i,e){if(!Vt.get(Ki).isRegisteredLanguageId(i))throw new Error(`Cannot set tokens provider for unknown language ${i}`);return YCe(e)?XX(i,{create:()=>e}):oo.register(i,ZCe(i,e))}function Mmt(i,e){const t=n=>new KD(Vt.get(Ki),Vt.get(ic),i,XCe(i,n),Vt.get(En));return YCe(e)?XX(i,{create:()=>e}):oo.register(i,t(e))}function Amt(i,e){return Vt.get(pt).referenceProvider.register(i,e)}function Pmt(i,e){return Vt.get(pt).renameProvider.register(i,e)}function Omt(i,e){return Vt.get(pt).signatureHelpProvider.register(i,e)}function Fmt(i,e){return Vt.get(pt).hoverProvider.register(i,{provideHover:(n,o,r)=>{const s=n.getWordAtPosition(o);return Promise.resolve(e.provideHover(n,o,r)).then(a=>{if(!!a)return!a.range&&s&&(a.range=new V(o.lineNumber,s.startColumn,o.lineNumber,s.endColumn)),a.range||(a.range=new V(o.lineNumber,o.column,o.lineNumber,o.column)),a})}})}function Bmt(i,e){return Vt.get(pt).documentSymbolProvider.register(i,e)}function Wmt(i,e){return Vt.get(pt).documentHighlightProvider.register(i,e)}function Vmt(i,e){return Vt.get(pt).linkedEditingRangeProvider.register(i,e)}function Hmt(i,e){return Vt.get(pt).definitionProvider.register(i,e)}function $mt(i,e){return Vt.get(pt).implementationProvider.register(i,e)}function zmt(i,e){return Vt.get(pt).typeDefinitionProvider.register(i,e)}function Umt(i,e){return Vt.get(pt).codeLensProvider.register(i,e)}function jmt(i,e,t){return Vt.get(pt).codeActionProvider.register(i,{providedCodeActionKinds:t==null?void 0:t.providedCodeActionKinds,documentation:t==null?void 0:t.documentation,provideCodeActions:(o,r,s,a)=>{const c=Vt.get(Rf).read({resource:o.uri}).filter(u=>V.areIntersectingOrTouching(u,r));return e.provideCodeActions(o,r,{markers:c,only:s.only,trigger:s.trigger},a)},resolveCodeAction:e.resolveCodeAction})}function Kmt(i,e){return Vt.get(pt).documentFormattingEditProvider.register(i,e)}function qmt(i,e){return Vt.get(pt).documentRangeFormattingEditProvider.register(i,e)}function Gmt(i,e){return Vt.get(pt).onTypeFormattingEditProvider.register(i,e)}function Xmt(i,e){return Vt.get(pt).linkProvider.register(i,e)}function Ymt(i,e){return Vt.get(pt).completionProvider.register(i,e)}function Zmt(i,e){return Vt.get(pt).colorProvider.register(i,e)}function Qmt(i,e){return Vt.get(pt).foldingRangeProvider.register(i,e)}function Jmt(i,e){return Vt.get(pt).declarationProvider.register(i,e)}function evt(i,e){return Vt.get(pt).selectionRangeProvider.register(i,e)}function tvt(i,e){return Vt.get(pt).documentSemanticTokensProvider.register(i,e)}function nvt(i,e){return Vt.get(pt).documentRangeSemanticTokensProvider.register(i,e)}function ivt(i,e){return Vt.get(pt).inlineCompletionsProvider.register(i,e)}function ovt(i,e){return Vt.get(pt).inlayHintsProvider.register(i,e)}function rvt(){return{register:wmt,getLanguages:Smt,onLanguage:Lmt,onLanguageEncountered:Emt,getEncodedLanguageId:xmt,setLanguageConfiguration:Dmt,setColorMap:Nmt,registerTokensProviderFactory:XX,setTokensProvider:Rmt,setMonarchTokensProvider:Mmt,registerReferenceProvider:Amt,registerRenameProvider:Pmt,registerCompletionItemProvider:Ymt,registerSignatureHelpProvider:Omt,registerHoverProvider:Fmt,registerDocumentSymbolProvider:Bmt,registerDocumentHighlightProvider:Wmt,registerLinkedEditingRangeProvider:Vmt,registerDefinitionProvider:Hmt,registerImplementationProvider:$mt,registerTypeDefinitionProvider:zmt,registerCodeLensProvider:Umt,registerCodeActionProvider:jmt,registerDocumentFormattingEditProvider:Kmt,registerDocumentRangeFormattingEditProvider:qmt,registerOnTypeFormattingEditProvider:Gmt,registerLinkProvider:Xmt,registerColorProvider:Zmt,registerFoldingRangeProvider:Qmt,registerDeclarationProvider:Jmt,registerSelectionRangeProvider:evt,registerDocumentSemanticTokensProvider:tvt,registerDocumentRangeSemanticTokensProvider:nvt,registerInlineCompletionsProvider:ivt,registerInlayHintsProvider:ovt,DocumentHighlightKind:cV,CompletionItemKind:iV,CompletionItemTag:oV,CompletionItemInsertTextRule:nV,SymbolKind:MV,SymbolTag:AV,IndentAction:pV,CompletionTriggerKind:rV,SignatureHelpTriggerKind:RV,InlayHintKind:vV,InlineCompletionTriggerKind:_V,CodeActionTriggerType:tV,FoldingRangeKind:ra,SelectedSuggestionInfo:B_e}}const YX=yn("IEditorCancelService"),QCe=new lt("cancellableOperation",!1,C("cancellableOperation","Whether the editor runs a cancellable operation, e.g. like 'Peek References'"));Mn(YX,class{constructor(){this._tokens=new WeakMap}add(i,e){let t=this._tokens.get(i);t||(t=i.invokeWithinContext(o=>{const r=QCe.bindTo(o.get(Ut)),s=new oa;return{key:r,tokens:s}}),this._tokens.set(i,t));let n;return t.key.set(!0),n=t.tokens.push(e),()=>{n&&(n(),t.key.set(!t.tokens.isEmpty()),n=void 0)}}cancel(i){const e=this._tokens.get(i);if(!e)return;const t=e.tokens.pop();t&&(t.cancel(),e.key.set(!e.tokens.isEmpty()))}},1);class svt extends Ro{constructor(e,t){super(t),this.editor=e,this._unregister=e.invokeWithinContext(n=>n.get(YX).add(e,this))}dispose(){this._unregister(),super.dispose()}}Ye(new class extends Ir{constructor(){super({id:"editor.cancelOperation",kbOpts:{weight:100,primary:9},precondition:QCe})}runEditorCommand(i,e){i.get(YX).cancel(e)}});class Rk{constructor(e,t){if(this.flags=t,(this.flags&1)!==0){const n=e.getModel();this.modelVersionId=n?X0("{0}#{1}",n.uri.toString(),n.getVersionId()):null}else this.modelVersionId=null;(this.flags&4)!==0?this.position=e.getPosition():this.position=null,(this.flags&2)!==0?this.selection=e.getSelection():this.selection=null,(this.flags&8)!==0?(this.scrollLeft=e.getScrollLeft(),this.scrollTop=e.getScrollTop()):(this.scrollLeft=-1,this.scrollTop=-1)}_equals(e){if(!(e instanceof Rk))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 Rk(e,this.flags))}}class Rv extends svt{constructor(e,t,n,o){super(e,o),this._listener=new Be,t&4&&this._listener.add(e.onDidChangeCursorPosition(r=>{(!n||!V.containsPosition(n,r.position))&&this.cancel()})),t&2&&this._listener.add(e.onDidChangeCursorSelection(r=>{(!n||!V.containsRange(n,r.selection))&&this.cancel()})),t&8&&this._listener.add(e.onDidScrollChange(r=>this.cancel())),t&1&&(this._listener.add(e.onDidChangeModel(r=>this.cancel())),this._listener.add(e.onDidChangeModelContent(r=>this.cancel())))}dispose(){this._listener.dispose(),super.dispose()}}class ZX extends Ro{constructor(e,t){super(t),this._listener=e.onDidChangeContent(()=>this.cancel())}dispose(){this._listener.dispose(),super.dispose()}}function Sf(i){return i&&typeof i.getEditorType=="function"?i.getEditorType()===UI.ICodeEditor:!1}function JCe(i){return i&&typeof i.getEditorType=="function"?i.getEditorType()===UI.IDiffEditor:!1}function avt(i){return!!i&&typeof i=="object"&&typeof i.onDidChangeActiveEditor=="function"}function eye(i){return Sf(i)?i:JCe(i)?i.getModifiedEditor():avt(i)&&Sf(i.activeCodeEditor)?i.activeCodeEditor:null}class Bw{static _handleEolEdits(e,t){let n;const o=[];for(const r of t)typeof r.eol=="number"&&(n=r.eol),r.range&&typeof r.text=="string"&&o.push(r);return typeof n=="number"&&e.hasModel()&&e.getModel().pushEOL(n),o}static _isFullModelReplaceEdit(e,t){if(!e.hasModel())return!1;const n=e.getModel(),o=n.validateRange(t.range);return n.getFullModelRange().equalsRange(o)}static execute(e,t,n){n&&e.pushUndoStop();const o=Zd.capture(e),r=Bw._handleEolEdits(e,t);r.length===1&&Bw._isFullModelReplaceEdit(e,r[0])?e.executeEdits("formatEditsCommand",r.map(s=>Gi.replace(V.lift(s.range),s.text))):e.executeEdits("formatEditsCommand",r.map(s=>Gi.replaceMove(V.lift(s.range),s.text))),n&&e.pushUndoStop(),o.restoreRelativeVerticalPositionOfCursor(e)}}class vle{constructor(e){this.value=e,this._lower=e.toLowerCase()}static toKey(e){return typeof e=="string"?e.toLowerCase():e._lower}}class lvt{constructor(e){if(this._set=new Set,e)for(const t of e)this.add(t)}add(e){this._set.add(vle.toKey(e))}has(e){return this._set.has(vle.toKey(e))}}var Qd=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};function QX(i){if(i=i.filter(o=>o.range),!i.length)return;let{range:e}=i[0];for(let o=1;o0&&V.areIntersectingOrTouching(d[h-1],m)?d[h-1]=V.fromPositions(d[h-1].getStartPosition(),m.getEndPosition()):h=d.push(m);const f=m=>Qd(this,void 0,void 0,function*(){var _,y;l.trace("[format][provideDocumentRangeFormattingEdits] (request)",(_=e.extensionId)===null||_===void 0?void 0:_.value,m);const w=(yield e.provideDocumentRangeFormattingEdits(c,m,c.getFormattingOptions(),u.token))||[];return l.trace("[format][provideDocumentRangeFormattingEdits] (response)",(y=e.extensionId)===null||y===void 0?void 0:y.value,w),w}),g=(m,_)=>{if(!m.length||!_.length)return!1;const y=m.reduce((w,L)=>V.plusRange(w,L.range),m[0].range);if(!_.some(w=>V.intersectRanges(y,w.range)))return!1;for(const w of m)for(const L of _)if(V.intersectRanges(w.range,L.range))return!0;return!1},p=[],v=[];try{if(typeof e.provideDocumentRangesFormattingEdits=="function"){l.trace("[format][provideDocumentRangeFormattingEdits] (request)",(r=e.extensionId)===null||r===void 0?void 0:r.value,d);const m=(yield e.provideDocumentRangesFormattingEdits(c,d,c.getFormattingOptions(),u.token))||[];l.trace("[format][provideDocumentRangeFormattingEdits] (response)",(s=e.extensionId)===null||s===void 0?void 0:s.value,m),v.push(m)}else{for(const m of d){if(u.token.isCancellationRequested)return!0;v.push(yield f(m))}for(let m=0;m({text:y.text,range:V.lift(y.range),forceMoveMarkers:!0})),y=>{for(const{range:w}of y)if(V.areIntersectingOrTouching(w,_))return[new gt(w.startLineNumber,w.startColumn,w.endLineNumber,w.endColumn)];return null})}return!0})}function uvt(i,e,t,n,o){return Qd(this,void 0,void 0,function*(){const r=i.get($t),s=i.get(pt),a=Sf(e)?e.getModel():e,l=tye(s.documentFormattingEditProvider,s.documentRangeFormattingEditProvider,a),c=yield ub.select(l,a,t);c&&(n.report(c),yield r.invokeFunction(dvt,c,e,t,o))})}function dvt(i,e,t,n,o){return Qd(this,void 0,void 0,function*(){const r=i.get(Xu);let s,a;Sf(t)?(s=t.getModel(),a=new Rv(t,5,void 0,o)):(s=t,a=new ZX(t,o));let l;try{const c=yield e.provideDocumentFormattingEdits(s,s.getFormattingOptions(),a.token);if(l=yield r.computeMoreMinimalEdits(s.uri,c),a.token.isCancellationRequested)return!0}finally{a.dispose()}if(!l||l.length===0)return!1;if(Sf(t))Bw.execute(t,l,n!==2),n!==2&&(QX(l),t.revealPositionInCenterIfOutsideViewport(t.getPosition(),1));else{const[{range:c}]=l,u=new gt(c.startLineNumber,c.startColumn,c.endLineNumber,c.endColumn);s.pushEditOperations([u],l.map(d=>({text:d.text,range:V.lift(d.range),forceMoveMarkers:!0})),d=>{for(const{range:h}of d)if(V.areIntersectingOrTouching(h,u))return[new gt(h.startLineNumber,h.startColumn,h.endLineNumber,h.endColumn)];return null})}return!0})}function hvt(i,e,t,n,o,r){return Qd(this,void 0,void 0,function*(){const s=e.documentRangeFormattingEditProvider.ordered(t);for(const a of s){const l=yield Promise.resolve(a.provideDocumentRangeFormattingEdits(t,n,o,r)).catch($o);if(ws(l))return yield i.computeMoreMinimalEdits(t.uri,l)}})}function fvt(i,e,t,n,o){return Qd(this,void 0,void 0,function*(){const r=tye(e.documentFormattingEditProvider,e.documentRangeFormattingEditProvider,t);for(const s of r){const a=yield Promise.resolve(s.provideDocumentFormattingEdits(t,n,o)).catch($o);if(ws(a))return yield i.computeMoreMinimalEdits(t.uri,a)}})}function iye(i,e,t,n,o,r,s){const a=e.onTypeFormattingEditProvider.ordered(t);return a.length===0||a[0].autoFormatTriggerCharacters.indexOf(o)<0?Promise.resolve(void 0):Promise.resolve(a[0].provideOnTypeFormattingEdits(t,n,o,r,s)).catch($o).then(l=>i.computeMoreMinimalEdits(t.uri,l))}Rn.registerCommand("_executeFormatRangeProvider",function(i,...e){return Qd(this,void 0,void 0,function*(){const[t,n,o]=e;fi(Rt.isUri(t)),fi(V.isIRange(n));const r=i.get(za),s=i.get(Xu),a=i.get(pt),l=yield r.createModelReference(t);try{return hvt(s,a,l.object.textEditorModel,V.lift(n),o,_n.None)}finally{l.dispose()}})});Rn.registerCommand("_executeFormatDocumentProvider",function(i,...e){return Qd(this,void 0,void 0,function*(){const[t,n]=e;fi(Rt.isUri(t));const o=i.get(za),r=i.get(Xu),s=i.get(pt),a=yield o.createModelReference(t);try{return fvt(r,s,a.object.textEditorModel,n,_n.None)}finally{a.dispose()}})});Rn.registerCommand("_executeFormatOnTypeProvider",function(i,...e){return Qd(this,void 0,void 0,function*(){const[t,n,o,r]=e;fi(Rt.isUri(t)),fi(ae.isIPosition(n)),fi(typeof o=="string");const s=i.get(za),a=i.get(Xu),l=i.get(pt),c=yield s.createModelReference(t);try{return iye(a,l,c.object.textEditorModel,ae.lift(n),o,r,_n.None)}finally{c.dispose()}})});rh.wrappingIndent.defaultValue=0;rh.glyphMargin.defaultValue=!1;rh.autoIndent.defaultValue=3;rh.overviewRulerLanes.defaultValue=2;ub.setFormatterSelector((i,e,t)=>Promise.resolve(i[0]));const va=W_e();va.editor=pmt();va.languages=rvt();const gvt=va.CancellationTokenSource,pvt=va.Emitter,mvt=va.KeyCode,vvt=va.KeyMod,_vt=va.Position,bvt=va.Range,Cvt=va.Selection,yvt=va.SelectionDirection,wvt=va.MarkerSeverity,Svt=va.MarkerTag,xvt=va.Uri,Lvt=va.Token,oye=va.editor,rye=va.languages,X9=globalThis.MonacoEnvironment;((X9==null?void 0:X9.globalAPI)||typeof define=="function"&&define.amd)&&(globalThis.monaco=va);typeof globalThis.require!="undefined"&&typeof globalThis.require.config=="function"&&globalThis.require.config({ignoreDuplicateModules:["vscode-languageserver-types","vscode-languageserver-types/main","vscode-languageserver-textdocument","vscode-languageserver-textdocument/main","vscode-nls","vscode-nls/vscode-nls","jsonc-parser","jsonc-parser/main","vscode-uri","vscode-uri/index","vs/basic-languages/typescript/typescript"]});var hT=Object.freeze(Object.defineProperty({__proto__:null,CancellationTokenSource:gvt,Emitter:pvt,KeyCode:mvt,KeyMod:vvt,Position:_vt,Range:bvt,Selection:Cvt,SelectionDirection:yvt,MarkerSeverity:wvt,MarkerTag:Svt,Uri:xvt,Token:Lvt,editor:oye,languages:rye},Symbol.toStringTag,{value:"Module"}));const Evt="_editor_yw7yc_1";var Dvt={editor:Evt};const kvt="modulepreload",_le={},Ivt="/eos/",wt=function(e,t){return!t||t.length===0?e():Promise.all(t.map(n=>{if(n=`${Ivt}${n}`,n in _le)return;_le[n]=!0;const o=n.endsWith(".css"),r=o?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${n}"]${r}`))return;const s=document.createElement("link");if(s.rel=o?"stylesheet":kvt,o||(s.as="script",s.crossOrigin=""),s.href=n,document.head.appendChild(s),o)return new Promise((a,l)=>{s.addEventListener("load",a),s.addEventListener("error",()=>l(new Error(`Unable to preload CSS for ${n}`)))})})).then(()=>e())};/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.44.0(3e047efd345ff102c8c61b5398fb30845aaac166) * Released under the MIT license * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt - *-----------------------------------------------------------------------------*/var xvt=Object.defineProperty,Lvt=Object.getOwnPropertyDescriptor,Evt=Object.getOwnPropertyNames,Dvt=Object.prototype.hasOwnProperty,dle=(i,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of Evt(e))!Dvt.call(i,o)&&o!==t&&xvt(i,o,{get:()=>e[o],enumerable:!(n=Lvt(e,o))||n.enumerable});return i},kvt=(i,e,t)=>(dle(i,e,"default"),t&&dle(t,e,"default")),NL={};kvt(NL,uT);var QCe={},Y9={},JCe=class{constructor(i){Tt(this,"_languageId");Tt(this,"_loadingTriggered");Tt(this,"_lazyLoadPromise");Tt(this,"_lazyLoadPromiseResolve");Tt(this,"_lazyLoadPromiseReject");this._languageId=i,this._loadingTriggered=!1,this._lazyLoadPromise=new Promise((e,t)=>{this._lazyLoadPromiseResolve=e,this._lazyLoadPromiseReject=t})}static getOrCreate(i){return Y9[i]||(Y9[i]=new JCe(i)),Y9[i]}load(){return this._loadingTriggered||(this._loadingTriggered=!0,QCe[this._languageId].loader().then(i=>this._lazyLoadPromiseResolve(i),i=>this._lazyLoadPromiseReject(i))),this._lazyLoadPromise}};function Dt(i){const e=i.id;QCe[e]=i,NL.languages.register(i);const t=JCe.getOrCreate(e);NL.languages.registerTokensProviderFactory(e,{create:async()=>(await t.load()).language}),NL.languages.onLanguageEncountered(e,async()=>{const n=await t.load();NL.languages.setLanguageConfiguration(e,n.conf)})}Dt({id:"abap",extensions:[".abap"],aliases:["abap","ABAP"],loader:()=>wt(()=>import("./abap.2a64499e.js"),[])});Dt({id:"apex",extensions:[".cls"],aliases:["Apex","apex"],mimetypes:["text/x-apex-source","text/x-apex"],loader:()=>wt(()=>import("./apex.adabbb71.js"),[])});Dt({id:"azcli",extensions:[".azcli"],aliases:["Azure CLI","azcli"],loader:()=>wt(()=>import("./azcli.4230daab.js"),[])});Dt({id:"bat",extensions:[".bat",".cmd"],aliases:["Batch","bat"],loader:()=>wt(()=>import("./bat.70abea5d.js"),[])});Dt({id:"bicep",extensions:[".bicep"],aliases:["Bicep"],loader:()=>wt(()=>import("./bicep.1f4ee952.js"),[])});Dt({id:"cameligo",extensions:[".mligo"],aliases:["Cameligo"],loader:()=>wt(()=>import("./cameligo.d567b5fd.js"),[])});Dt({id:"clojure",extensions:[".clj",".cljs",".cljc",".edn"],aliases:["clojure","Clojure"],loader:()=>wt(()=>import("./clojure.ac0cbaa3.js"),[])});Dt({id:"coffeescript",extensions:[".coffee"],aliases:["CoffeeScript","coffeescript","coffee"],mimetypes:["text/x-coffeescript","text/coffeescript"],loader:()=>wt(()=>import("./coffee.9cf857be.js"),[])});Dt({id:"c",extensions:[".c",".h"],aliases:["C","c"],loader:()=>wt(()=>import("./cpp.adb9e9b9.js"),[])});Dt({id:"cpp",extensions:[".cpp",".cc",".cxx",".hpp",".hh",".hxx"],aliases:["C++","Cpp","cpp"],loader:()=>wt(()=>import("./cpp.adb9e9b9.js"),[])});Dt({id:"csharp",extensions:[".cs",".csx",".cake"],aliases:["C#","csharp"],loader:()=>wt(()=>import("./csharp.9ef497b1.js"),[])});Dt({id:"csp",extensions:[],aliases:["CSP","csp"],loader:()=>wt(()=>import("./csp.ba6bfec1.js"),[])});Dt({id:"css",extensions:[".css"],aliases:["CSS","css"],mimetypes:["text/css"],loader:()=>wt(()=>import("./css.6b4f08cc.js"),[])});Dt({id:"cypher",extensions:[".cypher",".cyp"],aliases:["Cypher","OpenCypher"],loader:()=>wt(()=>import("./cypher.d2f3fc3d.js"),[])});Dt({id:"dart",extensions:[".dart"],aliases:["Dart","dart"],mimetypes:["text/x-dart-source","text/x-dart"],loader:()=>wt(()=>import("./dart.aca5c06f.js"),[])});Dt({id:"dockerfile",extensions:[".dockerfile"],filenames:["Dockerfile"],aliases:["Dockerfile"],loader:()=>wt(()=>import("./dockerfile.ab3746b1.js"),[])});Dt({id:"ecl",extensions:[".ecl"],aliases:["ECL","Ecl","ecl"],loader:()=>wt(()=>import("./ecl.b1b63495.js"),[])});Dt({id:"elixir",extensions:[".ex",".exs"],aliases:["Elixir","elixir","ex"],loader:()=>wt(()=>import("./elixir.eab285c4.js"),[])});Dt({id:"flow9",extensions:[".flow"],aliases:["Flow9","Flow","flow9","flow"],loader:()=>wt(()=>import("./flow9.6f54e64d.js"),[])});Dt({id:"fsharp",extensions:[".fs",".fsi",".ml",".mli",".fsx",".fsscript"],aliases:["F#","FSharp","fsharp"],loader:()=>wt(()=>import("./fsharp.1b51a049.js"),[])});Dt({id:"freemarker2",extensions:[".ftl",".ftlh",".ftlx"],aliases:["FreeMarker2","Apache FreeMarker2"],loader:()=>wt(()=>import("./freemarker2.8484e5c8.js"),[]).then(i=>i.TagAutoInterpolationDollar)});Dt({id:"freemarker2.tag-angle.interpolation-dollar",aliases:["FreeMarker2 (Angle/Dollar)","Apache FreeMarker2 (Angle/Dollar)"],loader:()=>wt(()=>import("./freemarker2.8484e5c8.js"),[]).then(i=>i.TagAngleInterpolationDollar)});Dt({id:"freemarker2.tag-bracket.interpolation-dollar",aliases:["FreeMarker2 (Bracket/Dollar)","Apache FreeMarker2 (Bracket/Dollar)"],loader:()=>wt(()=>import("./freemarker2.8484e5c8.js"),[]).then(i=>i.TagBracketInterpolationDollar)});Dt({id:"freemarker2.tag-angle.interpolation-bracket",aliases:["FreeMarker2 (Angle/Bracket)","Apache FreeMarker2 (Angle/Bracket)"],loader:()=>wt(()=>import("./freemarker2.8484e5c8.js"),[]).then(i=>i.TagAngleInterpolationBracket)});Dt({id:"freemarker2.tag-bracket.interpolation-bracket",aliases:["FreeMarker2 (Bracket/Bracket)","Apache FreeMarker2 (Bracket/Bracket)"],loader:()=>wt(()=>import("./freemarker2.8484e5c8.js"),[]).then(i=>i.TagBracketInterpolationBracket)});Dt({id:"freemarker2.tag-auto.interpolation-dollar",aliases:["FreeMarker2 (Auto/Dollar)","Apache FreeMarker2 (Auto/Dollar)"],loader:()=>wt(()=>import("./freemarker2.8484e5c8.js"),[]).then(i=>i.TagAutoInterpolationDollar)});Dt({id:"freemarker2.tag-auto.interpolation-bracket",aliases:["FreeMarker2 (Auto/Bracket)","Apache FreeMarker2 (Auto/Bracket)"],loader:()=>wt(()=>import("./freemarker2.8484e5c8.js"),[]).then(i=>i.TagAutoInterpolationBracket)});Dt({id:"go",extensions:[".go"],aliases:["Go"],loader:()=>wt(()=>import("./go.6f02d6b0.js"),[])});Dt({id:"graphql",extensions:[".graphql",".gql"],aliases:["GraphQL","graphql","gql"],mimetypes:["application/graphql"],loader:()=>wt(()=>import("./graphql.985c7427.js"),[])});Dt({id:"handlebars",extensions:[".handlebars",".hbs"],aliases:["Handlebars","handlebars","hbs"],mimetypes:["text/x-handlebars-template"],loader:()=>wt(()=>import("./handlebars.1296dc2c.js"),[])});Dt({id:"hcl",extensions:[".tf",".tfvars",".hcl"],aliases:["Terraform","tf","HCL","hcl"],loader:()=>wt(()=>import("./hcl.13b00686.js"),[])});Dt({id:"html",extensions:[".html",".htm",".shtml",".xhtml",".mdoc",".jsp",".asp",".aspx",".jshtm"],aliases:["HTML","htm","html","xhtml"],mimetypes:["text/html","text/x-jshtm","text/template","text/ng-template"],loader:()=>wt(()=>import("./html.88b2a518.js"),[])});Dt({id:"ini",extensions:[".ini",".properties",".gitconfig"],filenames:["config",".gitattributes",".gitconfig",".editorconfig"],aliases:["Ini","ini"],loader:()=>wt(()=>import("./ini.c760118b.js"),[])});Dt({id:"java",extensions:[".java",".jav"],aliases:["Java","java"],mimetypes:["text/x-java-source","text/x-java"],loader:()=>wt(()=>import("./java.49f1a029.js"),[])});Dt({id:"javascript",extensions:[".js",".es6",".jsx",".mjs",".cjs"],firstLine:"^#!.*\\bnode",filenames:["jakefile"],aliases:["JavaScript","javascript","js"],mimetypes:["text/javascript"],loader:()=>wt(()=>import("./javascript.fe852d41.js"),["assets/javascript.fe852d41.js","assets/typescript.c49ce84c.js"])});Dt({id:"julia",extensions:[".jl"],aliases:["julia","Julia"],loader:()=>wt(()=>import("./julia.9e475446.js"),[])});Dt({id:"kotlin",extensions:[".kt",".kts"],aliases:["Kotlin","kotlin"],mimetypes:["text/x-kotlin-source","text/x-kotlin"],loader:()=>wt(()=>import("./kotlin.d9624a70.js"),[])});Dt({id:"less",extensions:[".less"],aliases:["Less","less"],mimetypes:["text/x-less","text/less"],loader:()=>wt(()=>import("./less.9dfe1539.js"),[])});Dt({id:"lexon",extensions:[".lex"],aliases:["Lexon"],loader:()=>wt(()=>import("./lexon.b8473576.js"),[])});Dt({id:"lua",extensions:[".lua"],aliases:["Lua","lua"],loader:()=>wt(()=>import("./lua.3d4b8bfc.js"),[])});Dt({id:"liquid",extensions:[".liquid",".html.liquid"],aliases:["Liquid","liquid"],mimetypes:["application/liquid"],loader:()=>wt(()=>import("./liquid.2fea4883.js"),[])});Dt({id:"m3",extensions:[".m3",".i3",".mg",".ig"],aliases:["Modula-3","Modula3","modula3","m3"],loader:()=>wt(()=>import("./m3.eb4fda63.js"),[])});Dt({id:"markdown",extensions:[".md",".markdown",".mdown",".mkdn",".mkd",".mdwn",".mdtxt",".mdtext"],aliases:["Markdown","markdown"],loader:()=>wt(()=>import("./markdown.8cdaf78b.js"),[])});Dt({id:"mdx",extensions:[".mdx"],aliases:["MDX","mdx"],loader:()=>wt(()=>import("./mdx.8e3968ec.js"),[])});Dt({id:"mips",extensions:[".s"],aliases:["MIPS","MIPS-V"],mimetypes:["text/x-mips","text/mips","text/plaintext"],loader:()=>wt(()=>import("./mips.4fc7bcc7.js"),[])});Dt({id:"msdax",extensions:[".dax",".msdax"],aliases:["DAX","MSDAX"],loader:()=>wt(()=>import("./msdax.7f51ffc9.js"),[])});Dt({id:"mysql",extensions:[],aliases:["MySQL","mysql"],loader:()=>wt(()=>import("./mysql.68e8116a.js"),[])});Dt({id:"objective-c",extensions:[".m"],aliases:["Objective-C"],loader:()=>wt(()=>import("./objective-c.e389bc52.js"),[])});Dt({id:"pascal",extensions:[".pas",".p",".pp"],aliases:["Pascal","pas"],mimetypes:["text/x-pascal-source","text/x-pascal"],loader:()=>wt(()=>import("./pascal.beea0bd9.js"),[])});Dt({id:"pascaligo",extensions:[".ligo"],aliases:["Pascaligo","ligo"],loader:()=>wt(()=>import("./pascaligo.1d03ed08.js"),[])});Dt({id:"perl",extensions:[".pl",".pm"],aliases:["Perl","pl"],loader:()=>wt(()=>import("./perl.1578ab4e.js"),[])});Dt({id:"pgsql",extensions:[],aliases:["PostgreSQL","postgres","pg","postgre"],loader:()=>wt(()=>import("./pgsql.2d1aed48.js"),[])});Dt({id:"php",extensions:[".php",".php4",".php5",".phtml",".ctp"],aliases:["PHP","php"],mimetypes:["application/x-php"],loader:()=>wt(()=>import("./php.d8620fbc.js"),[])});Dt({id:"pla",extensions:[".pla"],loader:()=>wt(()=>import("./pla.d953ad85.js"),[])});Dt({id:"postiats",extensions:[".dats",".sats",".hats"],aliases:["ATS","ATS/Postiats"],loader:()=>wt(()=>import("./postiats.e54990a1.js"),[])});Dt({id:"powerquery",extensions:[".pq",".pqm"],aliases:["PQ","M","Power Query","Power Query M"],loader:()=>wt(()=>import("./powerquery.13203fd8.js"),[])});Dt({id:"powershell",extensions:[".ps1",".psm1",".psd1"],aliases:["PowerShell","powershell","ps","ps1"],loader:()=>wt(()=>import("./powershell.9c7adb6d.js"),[])});Dt({id:"proto",extensions:[".proto"],aliases:["protobuf","Protocol Buffers"],loader:()=>wt(()=>import("./protobuf.61d5c9dd.js"),[])});Dt({id:"pug",extensions:[".jade",".pug"],aliases:["Pug","Jade","jade"],loader:()=>wt(()=>import("./pug.0e6096f3.js"),[])});Dt({id:"python",extensions:[".py",".rpy",".pyw",".cpy",".gyp",".gypi"],aliases:["Python","py"],firstLine:"^#!/.*\\bpython[0-9.-]*\\b",loader:()=>wt(()=>import("./python.b3efcf1e.js"),[])});Dt({id:"qsharp",extensions:[".qs"],aliases:["Q#","qsharp"],loader:()=>wt(()=>import("./qsharp.90cf2ff9.js"),[])});Dt({id:"r",extensions:[".r",".rhistory",".rmd",".rprofile",".rt"],aliases:["R","r"],loader:()=>wt(()=>import("./r.8c4b58d5.js"),[])});Dt({id:"razor",extensions:[".cshtml"],aliases:["Razor","razor"],mimetypes:["text/x-cshtml"],loader:()=>wt(()=>import("./razor.f6f86f4c.js"),[])});Dt({id:"redis",extensions:[".redis"],aliases:["redis"],loader:()=>wt(()=>import("./redis.6046b29d.js"),[])});Dt({id:"redshift",extensions:[],aliases:["Redshift","redshift"],loader:()=>wt(()=>import("./redshift.82dd1d48.js"),[])});Dt({id:"restructuredtext",extensions:[".rst"],aliases:["reStructuredText","restructuredtext"],loader:()=>wt(()=>import("./restructuredtext.fbef1d20.js"),[])});Dt({id:"ruby",extensions:[".rb",".rbx",".rjs",".gemspec",".pp"],filenames:["rakefile","Gemfile"],aliases:["Ruby","rb"],loader:()=>wt(()=>import("./ruby.f035def9.js"),[])});Dt({id:"rust",extensions:[".rs",".rlib"],aliases:["Rust","rust"],loader:()=>wt(()=>import("./rust.0d7dad0a.js"),[])});Dt({id:"sb",extensions:[".sb"],aliases:["Small Basic","sb"],loader:()=>wt(()=>import("./sb.3a04efa3.js"),[])});Dt({id:"scala",extensions:[".scala",".sc",".sbt"],aliases:["Scala","scala","SBT","Sbt","sbt","Dotty","dotty"],mimetypes:["text/x-scala-source","text/x-scala","text/x-sbt","text/x-dotty"],loader:()=>wt(()=>import("./scala.74b9fa72.js"),[])});Dt({id:"scheme",extensions:[".scm",".ss",".sch",".rkt"],aliases:["scheme","Scheme"],loader:()=>wt(()=>import("./scheme.ddbbe914.js"),[])});Dt({id:"scss",extensions:[".scss"],aliases:["Sass","sass","scss"],mimetypes:["text/x-scss","text/scss"],loader:()=>wt(()=>import("./scss.f7a71f10.js"),[])});Dt({id:"shell",extensions:[".sh",".bash"],aliases:["Shell","sh"],loader:()=>wt(()=>import("./shell.fde92548.js"),[])});Dt({id:"sol",extensions:[".sol"],aliases:["sol","solidity","Solidity"],loader:()=>wt(()=>import("./solidity.40177dde.js"),[])});Dt({id:"aes",extensions:[".aes"],aliases:["aes","sophia","Sophia"],loader:()=>wt(()=>import("./sophia.b5de0f63.js"),[])});Dt({id:"sparql",extensions:[".rq"],aliases:["sparql","SPARQL"],loader:()=>wt(()=>import("./sparql.ffdfafe1.js"),[])});Dt({id:"sql",extensions:[".sql"],aliases:["SQL"],loader:()=>wt(()=>import("./sql.3c08f89c.js"),[])});Dt({id:"st",extensions:[".st",".iecst",".iecplc",".lc3lib",".TcPOU",".TcDUT",".TcGVL",".TcIO"],aliases:["StructuredText","scl","stl"],loader:()=>wt(()=>import("./st.35f68a52.js"),[])});Dt({id:"swift",aliases:["Swift","swift"],extensions:[".swift"],mimetypes:["text/swift"],loader:()=>wt(()=>import("./swift.899e2ec5.js"),[])});Dt({id:"systemverilog",extensions:[".sv",".svh"],aliases:["SV","sv","SystemVerilog","systemverilog"],loader:()=>wt(()=>import("./systemverilog.6236ddae.js"),[])});Dt({id:"verilog",extensions:[".v",".vh"],aliases:["V","v","Verilog","verilog"],loader:()=>wt(()=>import("./systemverilog.6236ddae.js"),[])});Dt({id:"tcl",extensions:[".tcl"],aliases:["tcl","Tcl","tcltk","TclTk","tcl/tk","Tcl/Tk"],loader:()=>wt(()=>import("./tcl.b70da54d.js"),[])});Dt({id:"twig",extensions:[".twig"],aliases:["Twig","twig"],mimetypes:["text/x-twig"],loader:()=>wt(()=>import("./twig.ce34242b.js"),[])});Dt({id:"typescript",extensions:[".ts",".tsx",".cts",".mts"],aliases:["TypeScript","ts","typescript"],mimetypes:["text/typescript"],loader:()=>wt(()=>import("./typescript.c49ce84c.js"),[])});Dt({id:"vb",extensions:[".vb"],aliases:["Visual Basic","vb"],loader:()=>wt(()=>import("./vb.28a2cd4e.js"),[])});Dt({id:"wgsl",extensions:[".wgsl"],aliases:["WebGPU Shading Language","WGSL","wgsl"],loader:()=>wt(()=>import("./wgsl.06adf453.js"),[])});Dt({id:"xml",extensions:[".xml",".xsd",".dtd",".ascx",".csproj",".config",".props",".targets",".wxi",".wxl",".wxs",".xaml",".svg",".svgz",".opf",".xslt",".xsl"],firstLine:"(\\<\\?xml.*)|(\\wt(()=>import("./xml.0e2004a8.js"),[])});Dt({id:"yaml",extensions:[".yaml",".yml"],aliases:["YAML","yaml","YML","yml"],mimetypes:["application/x-yaml","text/x-yaml"],loader:()=>wt(()=>import("./yaml.d8d18b9a.js"),[])});/*!----------------------------------------------------------------------------- + *-----------------------------------------------------------------------------*/var Tvt=Object.defineProperty,Nvt=Object.getOwnPropertyDescriptor,Rvt=Object.getOwnPropertyNames,Mvt=Object.prototype.hasOwnProperty,ble=(i,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of Rvt(e))!Mvt.call(i,o)&&o!==t&&Tvt(i,o,{get:()=>e[o],enumerable:!(n=Nvt(e,o))||n.enumerable});return i},Avt=(i,e,t)=>(ble(i,e,"default"),t&&ble(t,e,"default")),RL={};Avt(RL,hT);var sye={},Y9={},aye=class{constructor(i){Ct(this,"_languageId");Ct(this,"_loadingTriggered");Ct(this,"_lazyLoadPromise");Ct(this,"_lazyLoadPromiseResolve");Ct(this,"_lazyLoadPromiseReject");this._languageId=i,this._loadingTriggered=!1,this._lazyLoadPromise=new Promise((e,t)=>{this._lazyLoadPromiseResolve=e,this._lazyLoadPromiseReject=t})}static getOrCreate(i){return Y9[i]||(Y9[i]=new aye(i)),Y9[i]}load(){return this._loadingTriggered||(this._loadingTriggered=!0,sye[this._languageId].loader().then(i=>this._lazyLoadPromiseResolve(i),i=>this._lazyLoadPromiseReject(i))),this._lazyLoadPromise}};function kt(i){const e=i.id;sye[e]=i,RL.languages.register(i);const t=aye.getOrCreate(e);RL.languages.registerTokensProviderFactory(e,{create:async()=>(await t.load()).language}),RL.languages.onLanguageEncountered(e,async()=>{const n=await t.load();RL.languages.setLanguageConfiguration(e,n.conf)})}kt({id:"abap",extensions:[".abap"],aliases:["abap","ABAP"],loader:()=>wt(()=>import("./abap.2a64499e.js"),[])});kt({id:"apex",extensions:[".cls"],aliases:["Apex","apex"],mimetypes:["text/x-apex-source","text/x-apex"],loader:()=>wt(()=>import("./apex.adabbb71.js"),[])});kt({id:"azcli",extensions:[".azcli"],aliases:["Azure CLI","azcli"],loader:()=>wt(()=>import("./azcli.4230daab.js"),[])});kt({id:"bat",extensions:[".bat",".cmd"],aliases:["Batch","bat"],loader:()=>wt(()=>import("./bat.70abea5d.js"),[])});kt({id:"bicep",extensions:[".bicep"],aliases:["Bicep"],loader:()=>wt(()=>import("./bicep.1f4ee952.js"),[])});kt({id:"cameligo",extensions:[".mligo"],aliases:["Cameligo"],loader:()=>wt(()=>import("./cameligo.d567b5fd.js"),[])});kt({id:"clojure",extensions:[".clj",".cljs",".cljc",".edn"],aliases:["clojure","Clojure"],loader:()=>wt(()=>import("./clojure.ac0cbaa3.js"),[])});kt({id:"coffeescript",extensions:[".coffee"],aliases:["CoffeeScript","coffeescript","coffee"],mimetypes:["text/x-coffeescript","text/coffeescript"],loader:()=>wt(()=>import("./coffee.9cf857be.js"),[])});kt({id:"c",extensions:[".c",".h"],aliases:["C","c"],loader:()=>wt(()=>import("./cpp.adb9e9b9.js"),[])});kt({id:"cpp",extensions:[".cpp",".cc",".cxx",".hpp",".hh",".hxx"],aliases:["C++","Cpp","cpp"],loader:()=>wt(()=>import("./cpp.adb9e9b9.js"),[])});kt({id:"csharp",extensions:[".cs",".csx",".cake"],aliases:["C#","csharp"],loader:()=>wt(()=>import("./csharp.9ef497b1.js"),[])});kt({id:"csp",extensions:[],aliases:["CSP","csp"],loader:()=>wt(()=>import("./csp.ba6bfec1.js"),[])});kt({id:"css",extensions:[".css"],aliases:["CSS","css"],mimetypes:["text/css"],loader:()=>wt(()=>import("./css.6b4f08cc.js"),[])});kt({id:"cypher",extensions:[".cypher",".cyp"],aliases:["Cypher","OpenCypher"],loader:()=>wt(()=>import("./cypher.d2f3fc3d.js"),[])});kt({id:"dart",extensions:[".dart"],aliases:["Dart","dart"],mimetypes:["text/x-dart-source","text/x-dart"],loader:()=>wt(()=>import("./dart.aca5c06f.js"),[])});kt({id:"dockerfile",extensions:[".dockerfile"],filenames:["Dockerfile"],aliases:["Dockerfile"],loader:()=>wt(()=>import("./dockerfile.ab3746b1.js"),[])});kt({id:"ecl",extensions:[".ecl"],aliases:["ECL","Ecl","ecl"],loader:()=>wt(()=>import("./ecl.b1b63495.js"),[])});kt({id:"elixir",extensions:[".ex",".exs"],aliases:["Elixir","elixir","ex"],loader:()=>wt(()=>import("./elixir.eab285c4.js"),[])});kt({id:"flow9",extensions:[".flow"],aliases:["Flow9","Flow","flow9","flow"],loader:()=>wt(()=>import("./flow9.6f54e64d.js"),[])});kt({id:"fsharp",extensions:[".fs",".fsi",".ml",".mli",".fsx",".fsscript"],aliases:["F#","FSharp","fsharp"],loader:()=>wt(()=>import("./fsharp.1b51a049.js"),[])});kt({id:"freemarker2",extensions:[".ftl",".ftlh",".ftlx"],aliases:["FreeMarker2","Apache FreeMarker2"],loader:()=>wt(()=>import("./freemarker2.99824c06.js"),[]).then(i=>i.TagAutoInterpolationDollar)});kt({id:"freemarker2.tag-angle.interpolation-dollar",aliases:["FreeMarker2 (Angle/Dollar)","Apache FreeMarker2 (Angle/Dollar)"],loader:()=>wt(()=>import("./freemarker2.99824c06.js"),[]).then(i=>i.TagAngleInterpolationDollar)});kt({id:"freemarker2.tag-bracket.interpolation-dollar",aliases:["FreeMarker2 (Bracket/Dollar)","Apache FreeMarker2 (Bracket/Dollar)"],loader:()=>wt(()=>import("./freemarker2.99824c06.js"),[]).then(i=>i.TagBracketInterpolationDollar)});kt({id:"freemarker2.tag-angle.interpolation-bracket",aliases:["FreeMarker2 (Angle/Bracket)","Apache FreeMarker2 (Angle/Bracket)"],loader:()=>wt(()=>import("./freemarker2.99824c06.js"),[]).then(i=>i.TagAngleInterpolationBracket)});kt({id:"freemarker2.tag-bracket.interpolation-bracket",aliases:["FreeMarker2 (Bracket/Bracket)","Apache FreeMarker2 (Bracket/Bracket)"],loader:()=>wt(()=>import("./freemarker2.99824c06.js"),[]).then(i=>i.TagBracketInterpolationBracket)});kt({id:"freemarker2.tag-auto.interpolation-dollar",aliases:["FreeMarker2 (Auto/Dollar)","Apache FreeMarker2 (Auto/Dollar)"],loader:()=>wt(()=>import("./freemarker2.99824c06.js"),[]).then(i=>i.TagAutoInterpolationDollar)});kt({id:"freemarker2.tag-auto.interpolation-bracket",aliases:["FreeMarker2 (Auto/Bracket)","Apache FreeMarker2 (Auto/Bracket)"],loader:()=>wt(()=>import("./freemarker2.99824c06.js"),[]).then(i=>i.TagAutoInterpolationBracket)});kt({id:"go",extensions:[".go"],aliases:["Go"],loader:()=>wt(()=>import("./go.6f02d6b0.js"),[])});kt({id:"graphql",extensions:[".graphql",".gql"],aliases:["GraphQL","graphql","gql"],mimetypes:["application/graphql"],loader:()=>wt(()=>import("./graphql.985c7427.js"),[])});kt({id:"handlebars",extensions:[".handlebars",".hbs"],aliases:["Handlebars","handlebars","hbs"],mimetypes:["text/x-handlebars-template"],loader:()=>wt(()=>import("./handlebars.c3f8044d.js"),[])});kt({id:"hcl",extensions:[".tf",".tfvars",".hcl"],aliases:["Terraform","tf","HCL","hcl"],loader:()=>wt(()=>import("./hcl.13b00686.js"),[])});kt({id:"html",extensions:[".html",".htm",".shtml",".xhtml",".mdoc",".jsp",".asp",".aspx",".jshtm"],aliases:["HTML","htm","html","xhtml"],mimetypes:["text/html","text/x-jshtm","text/template","text/ng-template"],loader:()=>wt(()=>import("./html.c57dab11.js"),[])});kt({id:"ini",extensions:[".ini",".properties",".gitconfig"],filenames:["config",".gitattributes",".gitconfig",".editorconfig"],aliases:["Ini","ini"],loader:()=>wt(()=>import("./ini.c760118b.js"),[])});kt({id:"java",extensions:[".java",".jav"],aliases:["Java","java"],mimetypes:["text/x-java-source","text/x-java"],loader:()=>wt(()=>import("./java.49f1a029.js"),[])});kt({id:"javascript",extensions:[".js",".es6",".jsx",".mjs",".cjs"],firstLine:"^#!.*\\bnode",filenames:["jakefile"],aliases:["JavaScript","javascript","js"],mimetypes:["text/javascript"],loader:()=>wt(()=>import("./javascript.0f9cbf01.js"),["assets/javascript.0f9cbf01.js","assets/typescript.d26c4d00.js"])});kt({id:"julia",extensions:[".jl"],aliases:["julia","Julia"],loader:()=>wt(()=>import("./julia.9e475446.js"),[])});kt({id:"kotlin",extensions:[".kt",".kts"],aliases:["Kotlin","kotlin"],mimetypes:["text/x-kotlin-source","text/x-kotlin"],loader:()=>wt(()=>import("./kotlin.d9624a70.js"),[])});kt({id:"less",extensions:[".less"],aliases:["Less","less"],mimetypes:["text/x-less","text/less"],loader:()=>wt(()=>import("./less.9dfe1539.js"),[])});kt({id:"lexon",extensions:[".lex"],aliases:["Lexon"],loader:()=>wt(()=>import("./lexon.b8473576.js"),[])});kt({id:"lua",extensions:[".lua"],aliases:["Lua","lua"],loader:()=>wt(()=>import("./lua.3d4b8bfc.js"),[])});kt({id:"liquid",extensions:[".liquid",".html.liquid"],aliases:["Liquid","liquid"],mimetypes:["application/liquid"],loader:()=>wt(()=>import("./liquid.88902e43.js"),[])});kt({id:"m3",extensions:[".m3",".i3",".mg",".ig"],aliases:["Modula-3","Modula3","modula3","m3"],loader:()=>wt(()=>import("./m3.eb4fda63.js"),[])});kt({id:"markdown",extensions:[".md",".markdown",".mdown",".mkdn",".mkd",".mdwn",".mdtxt",".mdtext"],aliases:["Markdown","markdown"],loader:()=>wt(()=>import("./markdown.8cdaf78b.js"),[])});kt({id:"mdx",extensions:[".mdx"],aliases:["MDX","mdx"],loader:()=>wt(()=>import("./mdx.cb22bf12.js"),[])});kt({id:"mips",extensions:[".s"],aliases:["MIPS","MIPS-V"],mimetypes:["text/x-mips","text/mips","text/plaintext"],loader:()=>wt(()=>import("./mips.4fc7bcc7.js"),[])});kt({id:"msdax",extensions:[".dax",".msdax"],aliases:["DAX","MSDAX"],loader:()=>wt(()=>import("./msdax.7f51ffc9.js"),[])});kt({id:"mysql",extensions:[],aliases:["MySQL","mysql"],loader:()=>wt(()=>import("./mysql.68e8116a.js"),[])});kt({id:"objective-c",extensions:[".m"],aliases:["Objective-C"],loader:()=>wt(()=>import("./objective-c.e389bc52.js"),[])});kt({id:"pascal",extensions:[".pas",".p",".pp"],aliases:["Pascal","pas"],mimetypes:["text/x-pascal-source","text/x-pascal"],loader:()=>wt(()=>import("./pascal.beea0bd9.js"),[])});kt({id:"pascaligo",extensions:[".ligo"],aliases:["Pascaligo","ligo"],loader:()=>wt(()=>import("./pascaligo.1d03ed08.js"),[])});kt({id:"perl",extensions:[".pl",".pm"],aliases:["Perl","pl"],loader:()=>wt(()=>import("./perl.1578ab4e.js"),[])});kt({id:"pgsql",extensions:[],aliases:["PostgreSQL","postgres","pg","postgre"],loader:()=>wt(()=>import("./pgsql.2d1aed48.js"),[])});kt({id:"php",extensions:[".php",".php4",".php5",".phtml",".ctp"],aliases:["PHP","php"],mimetypes:["application/x-php"],loader:()=>wt(()=>import("./php.d8620fbc.js"),[])});kt({id:"pla",extensions:[".pla"],loader:()=>wt(()=>import("./pla.d953ad85.js"),[])});kt({id:"postiats",extensions:[".dats",".sats",".hats"],aliases:["ATS","ATS/Postiats"],loader:()=>wt(()=>import("./postiats.e54990a1.js"),[])});kt({id:"powerquery",extensions:[".pq",".pqm"],aliases:["PQ","M","Power Query","Power Query M"],loader:()=>wt(()=>import("./powerquery.13203fd8.js"),[])});kt({id:"powershell",extensions:[".ps1",".psm1",".psd1"],aliases:["PowerShell","powershell","ps","ps1"],loader:()=>wt(()=>import("./powershell.9c7adb6d.js"),[])});kt({id:"proto",extensions:[".proto"],aliases:["protobuf","Protocol Buffers"],loader:()=>wt(()=>import("./protobuf.61d5c9dd.js"),[])});kt({id:"pug",extensions:[".jade",".pug"],aliases:["Pug","Jade","jade"],loader:()=>wt(()=>import("./pug.0e6096f3.js"),[])});kt({id:"python",extensions:[".py",".rpy",".pyw",".cpy",".gyp",".gypi"],aliases:["Python","py"],firstLine:"^#!/.*\\bpython[0-9.-]*\\b",loader:()=>wt(()=>import("./python.6b3a176a.js"),[])});kt({id:"qsharp",extensions:[".qs"],aliases:["Q#","qsharp"],loader:()=>wt(()=>import("./qsharp.90cf2ff9.js"),[])});kt({id:"r",extensions:[".r",".rhistory",".rmd",".rprofile",".rt"],aliases:["R","r"],loader:()=>wt(()=>import("./r.8c4b58d5.js"),[])});kt({id:"razor",extensions:[".cshtml"],aliases:["Razor","razor"],mimetypes:["text/x-cshtml"],loader:()=>wt(()=>import("./razor.185f6816.js"),[])});kt({id:"redis",extensions:[".redis"],aliases:["redis"],loader:()=>wt(()=>import("./redis.6046b29d.js"),[])});kt({id:"redshift",extensions:[],aliases:["Redshift","redshift"],loader:()=>wt(()=>import("./redshift.82dd1d48.js"),[])});kt({id:"restructuredtext",extensions:[".rst"],aliases:["reStructuredText","restructuredtext"],loader:()=>wt(()=>import("./restructuredtext.fbef1d20.js"),[])});kt({id:"ruby",extensions:[".rb",".rbx",".rjs",".gemspec",".pp"],filenames:["rakefile","Gemfile"],aliases:["Ruby","rb"],loader:()=>wt(()=>import("./ruby.f035def9.js"),[])});kt({id:"rust",extensions:[".rs",".rlib"],aliases:["Rust","rust"],loader:()=>wt(()=>import("./rust.0d7dad0a.js"),[])});kt({id:"sb",extensions:[".sb"],aliases:["Small Basic","sb"],loader:()=>wt(()=>import("./sb.3a04efa3.js"),[])});kt({id:"scala",extensions:[".scala",".sc",".sbt"],aliases:["Scala","scala","SBT","Sbt","sbt","Dotty","dotty"],mimetypes:["text/x-scala-source","text/x-scala","text/x-sbt","text/x-dotty"],loader:()=>wt(()=>import("./scala.74b9fa72.js"),[])});kt({id:"scheme",extensions:[".scm",".ss",".sch",".rkt"],aliases:["scheme","Scheme"],loader:()=>wt(()=>import("./scheme.ddbbe914.js"),[])});kt({id:"scss",extensions:[".scss"],aliases:["Sass","sass","scss"],mimetypes:["text/x-scss","text/scss"],loader:()=>wt(()=>import("./scss.f7a71f10.js"),[])});kt({id:"shell",extensions:[".sh",".bash"],aliases:["Shell","sh"],loader:()=>wt(()=>import("./shell.fde92548.js"),[])});kt({id:"sol",extensions:[".sol"],aliases:["sol","solidity","Solidity"],loader:()=>wt(()=>import("./solidity.40177dde.js"),[])});kt({id:"aes",extensions:[".aes"],aliases:["aes","sophia","Sophia"],loader:()=>wt(()=>import("./sophia.b5de0f63.js"),[])});kt({id:"sparql",extensions:[".rq"],aliases:["sparql","SPARQL"],loader:()=>wt(()=>import("./sparql.ffdfafe1.js"),[])});kt({id:"sql",extensions:[".sql"],aliases:["SQL"],loader:()=>wt(()=>import("./sql.3c08f89c.js"),[])});kt({id:"st",extensions:[".st",".iecst",".iecplc",".lc3lib",".TcPOU",".TcDUT",".TcGVL",".TcIO"],aliases:["StructuredText","scl","stl"],loader:()=>wt(()=>import("./st.35f68a52.js"),[])});kt({id:"swift",aliases:["Swift","swift"],extensions:[".swift"],mimetypes:["text/swift"],loader:()=>wt(()=>import("./swift.899e2ec5.js"),[])});kt({id:"systemverilog",extensions:[".sv",".svh"],aliases:["SV","sv","SystemVerilog","systemverilog"],loader:()=>wt(()=>import("./systemverilog.6236ddae.js"),[])});kt({id:"verilog",extensions:[".v",".vh"],aliases:["V","v","Verilog","verilog"],loader:()=>wt(()=>import("./systemverilog.6236ddae.js"),[])});kt({id:"tcl",extensions:[".tcl"],aliases:["tcl","Tcl","tcltk","TclTk","tcl/tk","Tcl/Tk"],loader:()=>wt(()=>import("./tcl.b70da54d.js"),[])});kt({id:"twig",extensions:[".twig"],aliases:["Twig","twig"],mimetypes:["text/x-twig"],loader:()=>wt(()=>import("./twig.ce34242b.js"),[])});kt({id:"typescript",extensions:[".ts",".tsx",".cts",".mts"],aliases:["TypeScript","ts","typescript"],mimetypes:["text/typescript"],loader:()=>wt(()=>import("./typescript.d26c4d00.js"),[])});kt({id:"vb",extensions:[".vb"],aliases:["Visual Basic","vb"],loader:()=>wt(()=>import("./vb.28a2cd4e.js"),[])});kt({id:"wgsl",extensions:[".wgsl"],aliases:["WebGPU Shading Language","WGSL","wgsl"],loader:()=>wt(()=>import("./wgsl.06adf453.js"),[])});kt({id:"xml",extensions:[".xml",".xsd",".dtd",".ascx",".csproj",".config",".props",".targets",".wxi",".wxl",".wxs",".xaml",".svg",".svgz",".opf",".xslt",".xsl"],firstLine:"(\\<\\?xml.*)|(\\wt(()=>import("./xml.9a07e129.js"),[])});kt({id:"yaml",extensions:[".yaml",".yml"],aliases:["YAML","yaml","YML","yml"],mimetypes:["application/x-yaml","text/x-yaml"],loader:()=>wt(()=>import("./yaml.c0e89368.js"),[])});/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.44.0(3e047efd345ff102c8c61b5398fb30845aaac166) * Released under the MIT license * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt - *-----------------------------------------------------------------------------*/var Ivt=Object.defineProperty,Tvt=Object.getOwnPropertyDescriptor,Nvt=Object.getOwnPropertyNames,Rvt=Object.prototype.hasOwnProperty,hle=(i,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of Nvt(e))!Rvt.call(i,o)&&o!==t&&Ivt(i,o,{get:()=>e[o],enumerable:!(n=Tvt(e,o))||n.enumerable});return i},Mvt=(i,e,t)=>(hle(i,e,"default"),t&&hle(t,e,"default")),ES={};Mvt(ES,uT);var KX=class{constructor(i,e,t){Tt(this,"_onDidChange",new ES.Emitter);Tt(this,"_options");Tt(this,"_modeConfiguration");Tt(this,"_languageId");this._languageId=i,this.setOptions(e),this.setModeConfiguration(t)}get onDidChange(){return this._onDidChange.event}get languageId(){return this._languageId}get modeConfiguration(){return this._modeConfiguration}get diagnosticsOptions(){return this.options}get options(){return this._options}setOptions(i){this._options=i||Object.create(null),this._onDidChange.fire(this)}setDiagnosticsOptions(i){this.setOptions(i)}setModeConfiguration(i){this._modeConfiguration=i||Object.create(null),this._onDidChange.fire(this)}},qX={validate:!0,lint:{compatibleVendorPrefixes:"ignore",vendorPrefix:"warning",duplicateProperties:"warning",emptyRules:"warning",importStatement:"ignore",boxModel:"ignore",universalSelector:"ignore",zeroUnits:"ignore",fontFaceProperties:"warning",hexColorLength:"error",argumentsInColorFunction:"error",unknownProperties:"warning",ieHack:"ignore",unknownVendorSpecificProperties:"ignore",propertyIgnoredDueToDisplay:"warning",important:"ignore",float:"ignore",idSelector:"ignore"},data:{useDefaultDataProvider:!0},format:{newlineBetweenSelectors:!0,newlineBetweenRules:!0,spaceAroundSelectorSeparator:!1,braceStyle:"collapse",maxPreserveNewLines:void 0,preserveNewLines:!0}},GX={completionItems:!0,hovers:!0,documentSymbols:!0,definitions:!0,references:!0,documentHighlights:!0,rename:!0,colors:!0,foldingRanges:!0,diagnostics:!0,selectionRanges:!0,documentFormattingEdits:!0,documentRangeFormattingEdits:!0},ewe=new KX("css",qX,GX),twe=new KX("scss",qX,GX),nwe=new KX("less",qX,GX);ES.languages.css={cssDefaults:ewe,lessDefaults:nwe,scssDefaults:twe};function XX(){return wt(()=>import("./cssMode.9c40aad4.js"),[])}ES.languages.onLanguage("less",()=>{XX().then(i=>i.setupMode(nwe))});ES.languages.onLanguage("scss",()=>{XX().then(i=>i.setupMode(twe))});ES.languages.onLanguage("css",()=>{XX().then(i=>i.setupMode(ewe))});/*!----------------------------------------------------------------------------- + *-----------------------------------------------------------------------------*/var Pvt=Object.defineProperty,Ovt=Object.getOwnPropertyDescriptor,Fvt=Object.getOwnPropertyNames,Bvt=Object.prototype.hasOwnProperty,Cle=(i,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of Fvt(e))!Bvt.call(i,o)&&o!==t&&Pvt(i,o,{get:()=>e[o],enumerable:!(n=Ovt(e,o))||n.enumerable});return i},Wvt=(i,e,t)=>(Cle(i,e,"default"),t&&Cle(t,e,"default")),DS={};Wvt(DS,hT);var JX=class{constructor(i,e,t){Ct(this,"_onDidChange",new DS.Emitter);Ct(this,"_options");Ct(this,"_modeConfiguration");Ct(this,"_languageId");this._languageId=i,this.setOptions(e),this.setModeConfiguration(t)}get onDidChange(){return this._onDidChange.event}get languageId(){return this._languageId}get modeConfiguration(){return this._modeConfiguration}get diagnosticsOptions(){return this.options}get options(){return this._options}setOptions(i){this._options=i||Object.create(null),this._onDidChange.fire(this)}setDiagnosticsOptions(i){this.setOptions(i)}setModeConfiguration(i){this._modeConfiguration=i||Object.create(null),this._onDidChange.fire(this)}},eY={validate:!0,lint:{compatibleVendorPrefixes:"ignore",vendorPrefix:"warning",duplicateProperties:"warning",emptyRules:"warning",importStatement:"ignore",boxModel:"ignore",universalSelector:"ignore",zeroUnits:"ignore",fontFaceProperties:"warning",hexColorLength:"error",argumentsInColorFunction:"error",unknownProperties:"warning",ieHack:"ignore",unknownVendorSpecificProperties:"ignore",propertyIgnoredDueToDisplay:"warning",important:"ignore",float:"ignore",idSelector:"ignore"},data:{useDefaultDataProvider:!0},format:{newlineBetweenSelectors:!0,newlineBetweenRules:!0,spaceAroundSelectorSeparator:!1,braceStyle:"collapse",maxPreserveNewLines:void 0,preserveNewLines:!0}},tY={completionItems:!0,hovers:!0,documentSymbols:!0,definitions:!0,references:!0,documentHighlights:!0,rename:!0,colors:!0,foldingRanges:!0,diagnostics:!0,selectionRanges:!0,documentFormattingEdits:!0,documentRangeFormattingEdits:!0},lye=new JX("css",eY,tY),cye=new JX("scss",eY,tY),uye=new JX("less",eY,tY);DS.languages.css={cssDefaults:lye,lessDefaults:uye,scssDefaults:cye};function nY(){return wt(()=>import("./cssMode.b3903c5b.js"),[])}DS.languages.onLanguage("less",()=>{nY().then(i=>i.setupMode(uye))});DS.languages.onLanguage("scss",()=>{nY().then(i=>i.setupMode(cye))});DS.languages.onLanguage("css",()=>{nY().then(i=>i.setupMode(lye))});/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.44.0(3e047efd345ff102c8c61b5398fb30845aaac166) * Released under the MIT license * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt - *-----------------------------------------------------------------------------*/var Avt=Object.defineProperty,Pvt=Object.getOwnPropertyDescriptor,Ovt=Object.getOwnPropertyNames,Fvt=Object.prototype.hasOwnProperty,fle=(i,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of Ovt(e))!Fvt.call(i,o)&&o!==t&&Avt(i,o,{get:()=>e[o],enumerable:!(n=Pvt(e,o))||n.enumerable});return i},Bvt=(i,e,t)=>(fle(i,e,"default"),t&&fle(t,e,"default")),J5={};Bvt(J5,uT);var Wvt=class{constructor(i,e,t){Tt(this,"_onDidChange",new J5.Emitter);Tt(this,"_options");Tt(this,"_modeConfiguration");Tt(this,"_languageId");this._languageId=i,this.setOptions(e),this.setModeConfiguration(t)}get onDidChange(){return this._onDidChange.event}get languageId(){return this._languageId}get options(){return this._options}get modeConfiguration(){return this._modeConfiguration}setOptions(i){this._options=i||Object.create(null),this._onDidChange.fire(this)}setModeConfiguration(i){this._modeConfiguration=i||Object.create(null),this._onDidChange.fire(this)}},Vvt={tabSize:4,insertSpaces:!1,wrapLineLength:120,unformatted:'default": "a, abbr, acronym, b, bdo, big, br, button, cite, code, dfn, em, i, img, input, kbd, label, map, object, q, samp, select, small, span, strong, sub, sup, textarea, tt, var',contentUnformatted:"pre",indentInnerHtml:!1,preserveNewLines:!0,maxPreserveNewLines:void 0,indentHandlebars:!1,endWithNewline:!1,extraLiners:"head, body, /html",wrapAttributes:"auto"},eF={format:Vvt,suggest:{},data:{useDefaultDataProvider:!0}};function tF(i){return{completionItems:!0,hovers:!0,documentSymbols:!0,links:!0,documentHighlights:!0,rename:!0,colors:!0,foldingRanges:!0,selectionRanges:!0,diagnostics:i===DE,documentFormattingEdits:i===DE,documentRangeFormattingEdits:i===DE}}var DE="html",gle="handlebars",ple="razor",iwe=nF(DE,eF,tF(DE)),Hvt=iwe.defaults,owe=nF(gle,eF,tF(gle)),$vt=owe.defaults,rwe=nF(ple,eF,tF(ple)),zvt=rwe.defaults;J5.languages.html={htmlDefaults:Hvt,razorDefaults:zvt,handlebarDefaults:$vt,htmlLanguageService:iwe,handlebarLanguageService:owe,razorLanguageService:rwe,registerHTMLLanguageService:nF};function Uvt(){return wt(()=>import("./htmlMode.cd274e43.js"),[])}function nF(i,e=eF,t=tF(i)){const n=new Wvt(i,e,t);let o;const r=J5.languages.onLanguage(i,async()=>{o=(await Uvt()).setupMode(n)});return{defaults:n,dispose(){r.dispose(),o==null||o.dispose(),o=void 0}}}/*!----------------------------------------------------------------------------- + *-----------------------------------------------------------------------------*/var Vvt=Object.defineProperty,Hvt=Object.getOwnPropertyDescriptor,$vt=Object.getOwnPropertyNames,zvt=Object.prototype.hasOwnProperty,yle=(i,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of $vt(e))!zvt.call(i,o)&&o!==t&&Vvt(i,o,{get:()=>e[o],enumerable:!(n=Hvt(e,o))||n.enumerable});return i},Uvt=(i,e,t)=>(yle(i,e,"default"),t&&yle(t,e,"default")),eF={};Uvt(eF,hT);var jvt=class{constructor(i,e,t){Ct(this,"_onDidChange",new eF.Emitter);Ct(this,"_options");Ct(this,"_modeConfiguration");Ct(this,"_languageId");this._languageId=i,this.setOptions(e),this.setModeConfiguration(t)}get onDidChange(){return this._onDidChange.event}get languageId(){return this._languageId}get options(){return this._options}get modeConfiguration(){return this._modeConfiguration}setOptions(i){this._options=i||Object.create(null),this._onDidChange.fire(this)}setModeConfiguration(i){this._modeConfiguration=i||Object.create(null),this._onDidChange.fire(this)}},Kvt={tabSize:4,insertSpaces:!1,wrapLineLength:120,unformatted:'default": "a, abbr, acronym, b, bdo, big, br, button, cite, code, dfn, em, i, img, input, kbd, label, map, object, q, samp, select, small, span, strong, sub, sup, textarea, tt, var',contentUnformatted:"pre",indentInnerHtml:!1,preserveNewLines:!0,maxPreserveNewLines:void 0,indentHandlebars:!1,endWithNewline:!1,extraLiners:"head, body, /html",wrapAttributes:"auto"},tF={format:Kvt,suggest:{},data:{useDefaultDataProvider:!0}};function nF(i){return{completionItems:!0,hovers:!0,documentSymbols:!0,links:!0,documentHighlights:!0,rename:!0,colors:!0,foldingRanges:!0,selectionRanges:!0,diagnostics:i===kE,documentFormattingEdits:i===kE,documentRangeFormattingEdits:i===kE}}var kE="html",wle="handlebars",Sle="razor",dye=iF(kE,tF,nF(kE)),qvt=dye.defaults,hye=iF(wle,tF,nF(wle)),Gvt=hye.defaults,fye=iF(Sle,tF,nF(Sle)),Xvt=fye.defaults;eF.languages.html={htmlDefaults:qvt,razorDefaults:Xvt,handlebarDefaults:Gvt,htmlLanguageService:dye,handlebarLanguageService:hye,razorLanguageService:fye,registerHTMLLanguageService:iF};function Yvt(){return wt(()=>import("./htmlMode.f8eb8ad7.js"),[])}function iF(i,e=tF,t=nF(i)){const n=new jvt(i,e,t);let o;const r=eF.languages.onLanguage(i,async()=>{o=(await Yvt()).setupMode(n)});return{defaults:n,dispose(){r.dispose(),o==null||o.dispose(),o=void 0}}}/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.44.0(3e047efd345ff102c8c61b5398fb30845aaac166) * Released under the MIT license * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt - *-----------------------------------------------------------------------------*/var jvt=Object.defineProperty,Kvt=Object.getOwnPropertyDescriptor,qvt=Object.getOwnPropertyNames,Gvt=Object.prototype.hasOwnProperty,mle=(i,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of qvt(e))!Gvt.call(i,o)&&o!==t&&jvt(i,o,{get:()=>e[o],enumerable:!(n=Kvt(e,o))||n.enumerable});return i},Xvt=(i,e,t)=>(mle(i,e,"default"),t&&mle(t,e,"default")),dT={};Xvt(dT,uT);var Yvt=class{constructor(i,e,t){Tt(this,"_onDidChange",new dT.Emitter);Tt(this,"_diagnosticsOptions");Tt(this,"_modeConfiguration");Tt(this,"_languageId");this._languageId=i,this.setDiagnosticsOptions(e),this.setModeConfiguration(t)}get onDidChange(){return this._onDidChange.event}get languageId(){return this._languageId}get modeConfiguration(){return this._modeConfiguration}get diagnosticsOptions(){return this._diagnosticsOptions}setDiagnosticsOptions(i){this._diagnosticsOptions=i||Object.create(null),this._onDidChange.fire(this)}setModeConfiguration(i){this._modeConfiguration=i||Object.create(null),this._onDidChange.fire(this)}},Zvt={validate:!0,allowComments:!0,schemas:[],enableSchemaRequest:!1,schemaRequest:"warning",schemaValidation:"warning",comments:"error",trailingCommas:"error"},Qvt={documentFormattingEdits:!0,documentRangeFormattingEdits:!0,completionItems:!0,hovers:!0,documentSymbols:!0,tokens:!0,colors:!0,foldingRanges:!0,diagnostics:!0,selectionRanges:!0},swe=new Yvt("json",Zvt,Qvt);dT.languages.json={jsonDefaults:swe};function Jvt(){return wt(()=>import("./jsonMode.fdf27383.js"),[])}dT.languages.register({id:"json",extensions:[".json",".bowerrc",".jshintrc",".jscsrc",".eslintrc",".babelrc",".har"],aliases:["JSON","json"],mimetypes:["application/json"]});dT.languages.onLanguage("json",()=>{Jvt().then(i=>i.setupMode(swe))});/*!----------------------------------------------------------------------------- + *-----------------------------------------------------------------------------*/var Zvt=Object.defineProperty,Qvt=Object.getOwnPropertyDescriptor,Jvt=Object.getOwnPropertyNames,e_t=Object.prototype.hasOwnProperty,xle=(i,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of Jvt(e))!e_t.call(i,o)&&o!==t&&Zvt(i,o,{get:()=>e[o],enumerable:!(n=Qvt(e,o))||n.enumerable});return i},t_t=(i,e,t)=>(xle(i,e,"default"),t&&xle(t,e,"default")),fT={};t_t(fT,hT);var n_t=class{constructor(i,e,t){Ct(this,"_onDidChange",new fT.Emitter);Ct(this,"_diagnosticsOptions");Ct(this,"_modeConfiguration");Ct(this,"_languageId");this._languageId=i,this.setDiagnosticsOptions(e),this.setModeConfiguration(t)}get onDidChange(){return this._onDidChange.event}get languageId(){return this._languageId}get modeConfiguration(){return this._modeConfiguration}get diagnosticsOptions(){return this._diagnosticsOptions}setDiagnosticsOptions(i){this._diagnosticsOptions=i||Object.create(null),this._onDidChange.fire(this)}setModeConfiguration(i){this._modeConfiguration=i||Object.create(null),this._onDidChange.fire(this)}},i_t={validate:!0,allowComments:!0,schemas:[],enableSchemaRequest:!1,schemaRequest:"warning",schemaValidation:"warning",comments:"error",trailingCommas:"error"},o_t={documentFormattingEdits:!0,documentRangeFormattingEdits:!0,completionItems:!0,hovers:!0,documentSymbols:!0,tokens:!0,colors:!0,foldingRanges:!0,diagnostics:!0,selectionRanges:!0},gye=new n_t("json",i_t,o_t);fT.languages.json={jsonDefaults:gye};function r_t(){return wt(()=>import("./jsonMode.f3303325.js"),[])}fT.languages.register({id:"json",extensions:[".json",".bowerrc",".jshintrc",".jscsrc",".eslintrc",".babelrc",".har"],aliases:["JSON","json"],mimetypes:["application/json"]});fT.languages.onLanguage("json",()=>{r_t().then(i=>i.setupMode(gye))});/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.44.0(3e047efd345ff102c8c61b5398fb30845aaac166) * Released under the MIT license * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt - *-----------------------------------------------------------------------------*/var e_t=Object.defineProperty,t_t=Object.getOwnPropertyDescriptor,n_t=Object.getOwnPropertyNames,i_t=Object.prototype.hasOwnProperty,vle=(i,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of n_t(e))!i_t.call(i,o)&&o!==t&&e_t(i,o,{get:()=>e[o],enumerable:!(n=t_t(e,o))||n.enumerable});return i},o_t=(i,e,t)=>(vle(i,e,"default"),t&&vle(t,e,"default")),r_t="5.0.2",By={};o_t(By,uT);var awe=(i=>(i[i.None=0]="None",i[i.CommonJS=1]="CommonJS",i[i.AMD=2]="AMD",i[i.UMD=3]="UMD",i[i.System=4]="System",i[i.ES2015=5]="ES2015",i[i.ESNext=99]="ESNext",i))(awe||{}),lwe=(i=>(i[i.None=0]="None",i[i.Preserve=1]="Preserve",i[i.React=2]="React",i[i.ReactNative=3]="ReactNative",i[i.ReactJSX=4]="ReactJSX",i[i.ReactJSXDev=5]="ReactJSXDev",i))(lwe||{}),cwe=(i=>(i[i.CarriageReturnLineFeed=0]="CarriageReturnLineFeed",i[i.LineFeed=1]="LineFeed",i))(cwe||{}),uwe=(i=>(i[i.ES3=0]="ES3",i[i.ES5=1]="ES5",i[i.ES2015=2]="ES2015",i[i.ES2016=3]="ES2016",i[i.ES2017=4]="ES2017",i[i.ES2018=5]="ES2018",i[i.ES2019=6]="ES2019",i[i.ES2020=7]="ES2020",i[i.ESNext=99]="ESNext",i[i.JSON=100]="JSON",i[i.Latest=99]="Latest",i))(uwe||{}),dwe=(i=>(i[i.Classic=1]="Classic",i[i.NodeJs=2]="NodeJs",i))(dwe||{}),hwe=class{constructor(i,e,t,n,o){Tt(this,"_onDidChange",new By.Emitter);Tt(this,"_onDidExtraLibsChange",new By.Emitter);Tt(this,"_extraLibs");Tt(this,"_removedExtraLibs");Tt(this,"_eagerModelSync");Tt(this,"_compilerOptions");Tt(this,"_diagnosticsOptions");Tt(this,"_workerOptions");Tt(this,"_onDidExtraLibsChangeTimeout");Tt(this,"_inlayHintsOptions");Tt(this,"_modeConfiguration");this._extraLibs=Object.create(null),this._removedExtraLibs=Object.create(null),this._eagerModelSync=!1,this.setCompilerOptions(i),this.setDiagnosticsOptions(e),this.setWorkerOptions(t),this.setInlayHintsOptions(n),this.setModeConfiguration(o),this._onDidExtraLibsChangeTimeout=-1}get onDidChange(){return this._onDidChange.event}get onDidExtraLibsChange(){return this._onDidExtraLibsChange.event}get modeConfiguration(){return this._modeConfiguration}get workerOptions(){return this._workerOptions}get inlayHintsOptions(){return this._inlayHintsOptions}getExtraLibs(){return this._extraLibs}addExtraLib(i,e){let t;if(typeof e=="undefined"?t=`ts:extralib-${Math.random().toString(36).substring(2,15)}`:t=e,this._extraLibs[t]&&this._extraLibs[t].content===i)return{dispose:()=>{}};let n=1;return this._removedExtraLibs[t]&&(n=this._removedExtraLibs[t]+1),this._extraLibs[t]&&(n=this._extraLibs[t].version+1),this._extraLibs[t]={content:i,version:n},this._fireOnDidExtraLibsChangeSoon(),{dispose:()=>{let o=this._extraLibs[t];!o||o.version===n&&(delete this._extraLibs[t],this._removedExtraLibs[t]=n,this._fireOnDidExtraLibsChangeSoon())}}}setExtraLibs(i){for(const e in this._extraLibs)this._removedExtraLibs[e]=this._extraLibs[e].version;if(this._extraLibs=Object.create(null),i&&i.length>0)for(const e of i){const t=e.filePath||`ts:extralib-${Math.random().toString(36).substring(2,15)}`,n=e.content;let o=1;this._removedExtraLibs[t]&&(o=this._removedExtraLibs[t]+1),this._extraLibs[t]={content:n,version:o}}this._fireOnDidExtraLibsChangeSoon()}_fireOnDidExtraLibsChangeSoon(){this._onDidExtraLibsChangeTimeout===-1&&(this._onDidExtraLibsChangeTimeout=window.setTimeout(()=>{this._onDidExtraLibsChangeTimeout=-1,this._onDidExtraLibsChange.fire(void 0)},0))}getCompilerOptions(){return this._compilerOptions}setCompilerOptions(i){this._compilerOptions=i||Object.create(null),this._onDidChange.fire(void 0)}getDiagnosticsOptions(){return this._diagnosticsOptions}setDiagnosticsOptions(i){this._diagnosticsOptions=i||Object.create(null),this._onDidChange.fire(void 0)}setWorkerOptions(i){this._workerOptions=i||Object.create(null),this._onDidChange.fire(void 0)}setInlayHintsOptions(i){this._inlayHintsOptions=i||Object.create(null),this._onDidChange.fire(void 0)}setMaximumWorkerIdleTime(i){}setEagerModelSync(i){this._eagerModelSync=i}getEagerModelSync(){return this._eagerModelSync}setModeConfiguration(i){this._modeConfiguration=i||Object.create(null),this._onDidChange.fire(void 0)}},s_t=r_t,fwe={completionItems:!0,hovers:!0,documentSymbols:!0,definitions:!0,references:!0,documentHighlights:!0,rename:!0,diagnostics:!0,documentRangeFormattingEdits:!0,signatureHelp:!0,onTypeFormattingEdits:!0,codeActions:!0,inlayHints:!0},gwe=new hwe({allowNonTsExtensions:!0,target:99},{noSemanticValidation:!1,noSyntaxValidation:!1,onlyVisible:!1},{},{},fwe),pwe=new hwe({allowNonTsExtensions:!0,allowJs:!0,target:99},{noSemanticValidation:!0,noSyntaxValidation:!1,onlyVisible:!1},{},{},fwe),a_t=()=>iF().then(i=>i.getTypeScriptWorker()),l_t=()=>iF().then(i=>i.getJavaScriptWorker());By.languages.typescript={ModuleKind:awe,JsxEmit:lwe,NewLineKind:cwe,ScriptTarget:uwe,ModuleResolutionKind:dwe,typescriptVersion:s_t,typescriptDefaults:gwe,javascriptDefaults:pwe,getTypeScriptWorker:a_t,getJavaScriptWorker:l_t};function iF(){return wt(()=>import("./tsMode.cdbe9b4c.js"),[])}By.languages.onLanguage("typescript",()=>iF().then(i=>i.setupTypeScript(gwe)));By.languages.onLanguage("javascript",()=>iF().then(i=>i.setupJavaScript(pwe)));class c_t extends Jl{constructor(){super({id:"diffEditor.toggleCollapseUnchangedRegions",title:{value:C("toggleCollapseUnchangedRegions","Toggle Collapse Unchanged Regions"),original:"Toggle Collapse Unchanged Regions"},icon:Xe.map,toggled:Me.has("config.diffEditor.hideUnchangedRegions.enabled"),precondition:Me.has("isInDiffEditor"),menu:{when:Me.has("isInDiffEditor"),id:Z.EditorTitle,order:22,group:"navigation"}})}run(e,...t){const n=e.get(En),o=!n.getValue("diffEditor.hideUnchangedRegions.enabled");n.updateValue("diffEditor.hideUnchangedRegions.enabled",o)}}$i(c_t);class mwe extends Jl{constructor(){super({id:"diffEditor.toggleShowMovedCodeBlocks",title:{value:C("toggleShowMovedCodeBlocks","Toggle Show Moved Code Blocks"),original:"Toggle Show Moved Code Blocks"},precondition:Me.has("isInDiffEditor")})}run(e,...t){const n=e.get(En),o=!n.getValue("diffEditor.experimental.showMoves");n.updateValue("diffEditor.experimental.showMoves",o)}}$i(mwe);class vwe extends Jl{constructor(){super({id:"diffEditor.toggleUseInlineViewWhenSpaceIsLimited",title:{value:C("toggleUseInlineViewWhenSpaceIsLimited","Toggle Use Inline View When Space Is Limited"),original:"Toggle Use Inline View When Space Is Limited"},precondition:Me.has("isInDiffEditor")})}run(e,...t){const n=e.get(En),o=!n.getValue("diffEditor.useInlineViewWhenSpaceIsLimited");n.updateValue("diffEditor.useInlineViewWhenSpaceIsLimited",o)}}$i(vwe);Hr.appendMenuItem(Z.EditorTitle,{command:{id:new vwe().desc.id,title:C("useInlineViewWhenSpaceIsLimited","Use Inline View When Space Is Limited"),toggled:Me.has("config.diffEditor.useInlineViewWhenSpaceIsLimited"),precondition:Me.has("isInDiffEditor")},order:11,group:"1_diff",when:Me.and(Q.diffEditorRenderSideBySideInlineBreakpointReached,Me.has("isInDiffEditor"))});Hr.appendMenuItem(Z.EditorTitle,{command:{id:new mwe().desc.id,title:C("showMoves","Show Moved Code Blocks"),icon:Xe.move,toggled:pS.create("config.diffEditor.experimental.showMoves",!0),precondition:Me.has("isInDiffEditor")},order:10,group:"1_diff",when:Me.has("isInDiffEditor")});const oF={value:C("diffEditor","Diff Editor"),original:"Diff Editor"};class u_t extends sh{constructor(){super({id:"diffEditor.switchSide",title:{value:C("switchSide","Switch Side"),original:"Switch Side"},icon:Xe.arrowSwap,precondition:Me.has("isInDiffEditor"),f1:!0,category:oF})}runEditorCommand(e,t,n){const o=kS(e);if(o instanceof lb){if(n&&n.dryRun)return{destinationSelection:o.mapToOtherSide().destinationSelection};o.switchSide()}}}$i(u_t);class d_t extends sh{constructor(){super({id:"diffEditor.exitCompareMove",title:{value:C("exitCompareMove","Exit Compare Move"),original:"Exit Compare Move"},icon:Xe.close,precondition:Q.comparingMovedCode,f1:!1,category:oF,keybinding:{weight:1e4,primary:9}})}runEditorCommand(e,t,...n){const o=kS(e);o instanceof lb&&o.exitCompareMove()}}$i(d_t);class h_t extends sh{constructor(){super({id:"diffEditor.collapseAllUnchangedRegions",title:{value:C("collapseAllUnchangedRegions","Collapse All Unchanged Regions"),original:"Collapse All Unchanged Regions"},icon:Xe.fold,precondition:Me.has("isInDiffEditor"),f1:!0,category:oF})}runEditorCommand(e,t,...n){const o=kS(e);o instanceof lb&&o.collapseAllUnchangedRegions()}}$i(h_t);class f_t extends sh{constructor(){super({id:"diffEditor.showAllUnchangedRegions",title:{value:C("showAllUnchangedRegions","Show All Unchanged Regions"),original:"Show All Unchanged Regions"},icon:Xe.unfold,precondition:Me.has("isInDiffEditor"),f1:!0,category:oF})}runEditorCommand(e,t,...n){const o=kS(e);o instanceof lb&&o.showAllUnchangedRegions()}}$i(f_t);const _we={value:C("accessibleDiffViewer","Accessible Diff Viewer"),original:"Accessible Diff Viewer"};class DS extends Jl{constructor(){super({id:DS.id,title:{value:C("editor.action.accessibleDiffViewer.next","Go to Next Difference"),original:"Go to Next Difference"},category:_we,precondition:Me.has("isInDiffEditor"),keybinding:{primary:65,weight:100},f1:!0})}run(e){const t=kS(e);t==null||t.accessibleDiffViewerNext()}}DS.id="editor.action.accessibleDiffViewer.next";Hr.appendMenuItem(Z.EditorTitle,{command:{id:DS.id,title:C("Open Accessible Diff Viewer","Open Accessible Diff Viewer"),precondition:Me.has("isInDiffEditor")},order:10,group:"2_diff",when:Me.and(Q.accessibleDiffViewerVisible.negate(),Me.has("isInDiffEditor"))});class hT extends Jl{constructor(){super({id:hT.id,title:{value:C("editor.action.accessibleDiffViewer.prev","Go to Previous Difference"),original:"Go to Previous Difference"},category:_we,precondition:Me.has("isInDiffEditor"),keybinding:{primary:1089,weight:100},f1:!0})}run(e){const t=kS(e);t==null||t.accessibleDiffViewerPrev()}}hT.id="editor.action.accessibleDiffViewer.prev";function kS(i){var e;const t=i.get(Jn),n=t.listDiffEditors(),o=(e=t.getFocusedCodeEditor())!==null&&e!==void 0?e:t.getActiveCodeEditor();if(!o)return null;for(let s=0,a=n.length;s=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},m_t=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},rF=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},rz;const sF=new lt("selectionAnchorSet",!1);let lp=rz=class{static get(e){return e.getContribution(rz.ID)}constructor(e,t){this.editor=e,this.selectionAnchorSetContextKey=sF.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(gt.fromPositions(e,e),{description:"selection-anchor",stickiness:1,hoverMessage:new is().appendText(C("selectionAnchor","Selection Anchor")),className:"selection-anchor"})}),this.selectionAnchorSetContextKey.set(!!this.decorationId),bs(C("anchorSet","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(gt.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()}};lp.ID="editor.contrib.selectionAnchorController";lp=rz=p_t([m_t(1,Ut)],lp);class v_t extends ft{constructor(){super({id:"editor.action.setSelectionAnchor",label:C("setSelectionAnchor","Set Selection Anchor"),alias:"Set Selection Anchor",precondition:void 0,kbOpts:{kbExpr:Q.editorTextFocus,primary:Zo(2089,2080),weight:100}})}run(e,t){var n;return rF(this,void 0,void 0,function*(){(n=lp.get(t))===null||n===void 0||n.setSelectionAnchor()})}}class __t extends ft{constructor(){super({id:"editor.action.goToSelectionAnchor",label:C("goToSelectionAnchor","Go to Selection Anchor"),alias:"Go to Selection Anchor",precondition:sF})}run(e,t){var n;return rF(this,void 0,void 0,function*(){(n=lp.get(t))===null||n===void 0||n.goToSelectionAnchor()})}}class b_t extends ft{constructor(){super({id:"editor.action.selectFromAnchorToCursor",label:C("selectFromAnchorToCursor","Select from Anchor to Cursor"),alias:"Select from Anchor to Cursor",precondition:sF,kbOpts:{kbExpr:Q.editorTextFocus,primary:Zo(2089,2089),weight:100}})}run(e,t){var n;return rF(this,void 0,void 0,function*(){(n=lp.get(t))===null||n===void 0||n.selectFromAnchorToCursor()})}}class C_t extends ft{constructor(){super({id:"editor.action.cancelSelectionAnchor",label:C("cancelSelectionAnchor","Cancel Selection Anchor"),alias:"Cancel Selection Anchor",precondition:sF,kbOpts:{kbExpr:Q.editorTextFocus,primary:9,weight:100}})}run(e,t){var n;return rF(this,void 0,void 0,function*(){(n=lp.get(t))===null||n===void 0||n.cancelSelectionAnchor()})}}zn(lp.ID,lp,4);ze(v_t);ze(__t);ze(b_t);ze(C_t);const w_t=J("editorOverviewRuler.bracketMatchForeground",{dark:"#A0A0A0",light:"#A0A0A0",hcDark:"#A0A0A0",hcLight:"#A0A0A0"},C("overviewRulerBracketMatchForeground","Overview ruler marker color for matching brackets."));class y_t extends ft{constructor(){super({id:"editor.action.jumpToBracket",label:C("smartSelect.jumpBracket","Go to Bracket"),alias:"Go to Bracket",precondition:void 0,kbOpts:{kbExpr:Q.editorTextFocus,primary:3165,weight:100}})}run(e,t){var n;(n=Nu.get(t))===null||n===void 0||n.jumpToBracket()}}class S_t extends ft{constructor(){super({id:"editor.action.selectToBracket",label:C("smartSelect.selectToBracket","Select to Bracket"),alias:"Select to Bracket",precondition:void 0,description:{description:"Select to Bracket",args:[{name:"args",schema:{type:"object",properties:{selectBrackets:{type:"boolean",default:!0}}}}]}})}run(e,t,n){var o;let r=!0;n&&n.selectBrackets===!1&&(r=!1),(o=Nu.get(t))===null||o===void 0||o.selectToBracket(r)}}class x_t extends ft{constructor(){super({id:"editor.action.removeBrackets",label:C("smartSelect.removeBrackets","Remove Brackets"),alias:"Remove Brackets",precondition:void 0,kbOpts:{kbExpr:Q.editorTextFocus,primary:2561,weight:100}})}run(e,t){var n;(n=Nu.get(t))===null||n===void 0||n.removeBrackets(this.id)}}class L_t{constructor(e,t,n){this.position=e,this.brackets=t,this.options=n}}class Nu extends _e{static get(e){return e.getContribution(Nu.ID)}constructor(e){super(),this._editor=e,this._lastBracketsData=[],this._lastVersionId=0,this._decorations=this._editor.createDecorationsCollection(),this._updateBracketsSoon=this._register(new bi(()=>this._updateBrackets(),50)),this._matchBrackets=this._editor.getOption(71),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(71)&&(this._matchBrackets=this._editor.getOption(71),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(n=>{const o=n.getStartPosition(),r=e.bracketPairs.matchBracket(o);let s=null;if(r)r[0].containsPosition(o)&&!r[1].containsPosition(o)?s=r[1].getStartPosition():r[1].containsPosition(o)&&(s=r[0].getStartPosition());else{const a=e.bracketPairs.findEnclosingBrackets(o);if(a)s=a[1].getStartPosition();else{const l=e.bracketPairs.findNextBracket(o);l&&l.range&&(s=l.range.getStartPosition())}}return s?new gt(s.lineNumber,s.column,s.lineNumber,s.column):new gt(o.lineNumber,o.column,o.lineNumber,o.column)});this._editor.setSelections(t),this._editor.revealRange(t[0])}selectToBracket(e){if(!this._editor.hasModel())return;const t=this._editor.getModel(),n=[];this._editor.getSelections().forEach(o=>{const r=o.getStartPosition();let s=t.bracketPairs.matchBracket(r);if(!s&&(s=t.bracketPairs.findEnclosingBrackets(r),!s)){const c=t.bracketPairs.findNextBracket(r);c&&c.range&&(s=t.bracketPairs.matchBracket(c.range.getStartPosition()))}let a=null,l=null;if(s){s.sort(V.compareRangesUsingStarts);const[c,u]=s;if(a=e?c.getStartPosition():c.getEndPosition(),l=e?u.getEndPosition():u.getStartPosition(),u.containsPosition(r)){const d=a;a=l,l=d}}a&&l&&n.push(new gt(a.lineNumber,a.column,l.lineNumber,l.column))}),n.length>0&&(this._editor.setSelections(n),this._editor.revealRange(n[0]))}removeBrackets(e){if(!this._editor.hasModel())return;const t=this._editor.getModel();this._editor.getSelections().forEach(n=>{const o=n.getPosition();let r=t.bracketPairs.matchBracket(o);r||(r=t.bracketPairs.findEnclosingBrackets(o)),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 n of this._lastBracketsData){const o=n.brackets;o&&(e[t++]={range:o[0],options:n.options},e[t++]={range:o[1],options:n.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(),n=t.getVersionId();let o=[];this._lastVersionId===n&&(o=this._lastBracketsData);const r=[];let s=0;for(let d=0,h=e.length;d1&&r.sort(ae.compare);const a=[];let l=0,c=0;const u=o.length;for(let d=0,h=r.length;d0&&(t.pushUndoStop(),t.executeCommands(this.id,o),t.pushUndoStop())}}ze(I_t);var T_t=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};const ub="9_cutcopypaste",N_t=Fd||document.queryCommandSupported("cut"),Cwe=Fd||document.queryCommandSupported("copy"),R_t=typeof navigator.clipboard=="undefined"||Oc?document.queryCommandSupported("paste"):!0;function YX(i){return i.register(),i}const M_t=N_t?YX(new vS({id:"editor.action.clipboardCutAction",precondition:void 0,kbOpts:Fd?{primary:2102,win:{primary:2102,secondary:[1044]},weight:100}:void 0,menuOpts:[{menuId:Z.MenubarEditMenu,group:"2_ccp",title:C({key:"miCut",comment:["&& denotes a mnemonic"]},"Cu&&t"),order:1},{menuId:Z.EditorContext,group:ub,title:C("actions.clipboard.cutLabel","Cut"),when:Q.writable,order:1},{menuId:Z.CommandPalette,group:"",title:C("actions.clipboard.cutLabel","Cut"),order:1},{menuId:Z.SimpleEditorContext,group:ub,title:C("actions.clipboard.cutLabel","Cut"),when:Q.writable,order:1}]})):void 0,A_t=Cwe?YX(new vS({id:"editor.action.clipboardCopyAction",precondition:void 0,kbOpts:Fd?{primary:2081,win:{primary:2081,secondary:[2067]},weight:100}:void 0,menuOpts:[{menuId:Z.MenubarEditMenu,group:"2_ccp",title:C({key:"miCopy",comment:["&& denotes a mnemonic"]},"&&Copy"),order:2},{menuId:Z.EditorContext,group:ub,title:C("actions.clipboard.copyLabel","Copy"),order:2},{menuId:Z.CommandPalette,group:"",title:C("actions.clipboard.copyLabel","Copy"),order:1},{menuId:Z.SimpleEditorContext,group:ub,title:C("actions.clipboard.copyLabel","Copy"),order:2}]})):void 0;Hr.appendMenuItem(Z.MenubarEditMenu,{submenu:Z.MenubarCopy,title:{value:C("copy as","Copy As"),original:"Copy As"},group:"2_ccp",order:3});Hr.appendMenuItem(Z.EditorContext,{submenu:Z.EditorContextCopy,title:{value:C("copy as","Copy As"),original:"Copy As"},group:ub,order:3});Hr.appendMenuItem(Z.EditorContext,{submenu:Z.EditorContextShare,title:{value:C("share","Share"),original:"Share"},group:"11_share",order:-1,when:Me.and(Me.notEquals("resourceScheme","output"),Q.editorTextFocus)});Hr.appendMenuItem(Z.EditorTitleContext,{submenu:Z.EditorTitleContextShare,title:{value:C("share","Share"),original:"Share"},group:"11_share",order:-1});Hr.appendMenuItem(Z.ExplorerContext,{submenu:Z.ExplorerContextShare,title:{value:C("share","Share"),original:"Share"},group:"11_share",order:-1});const Z9=R_t?YX(new vS({id:"editor.action.clipboardPasteAction",precondition:void 0,kbOpts:Fd?{primary:2100,win:{primary:2100,secondary:[1043]},linux:{primary:2100,secondary:[1043]},weight:100}:void 0,menuOpts:[{menuId:Z.MenubarEditMenu,group:"2_ccp",title:C({key:"miPaste",comment:["&& denotes a mnemonic"]},"&&Paste"),order:4},{menuId:Z.EditorContext,group:ub,title:C("actions.clipboard.pasteLabel","Paste"),when:Q.writable,order:4},{menuId:Z.CommandPalette,group:"",title:C("actions.clipboard.pasteLabel","Paste"),order:1},{menuId:Z.SimpleEditorContext,group:ub,title:C("actions.clipboard.pasteLabel","Paste"),when:Q.writable,order:4}]})):void 0;class P_t extends ft{constructor(){super({id:"editor.action.clipboardCopyWithSyntaxHighlightingAction",label:C("actions.clipboard.copyWithSyntaxHighlightingLabel","Copy With Syntax Highlighting"),alias:"Copy With Syntax Highlighting",precondition:void 0,kbOpts:{kbExpr:Q.textInputFocus,primary:0,weight:100}})}run(e,t){!t.hasModel()||!t.getOption(37)&&t.getSelection().isEmpty()||(hH.forceCopyWithSyntaxHighlighting=!0,t.focus(),t.getContainerDomNode().ownerDocument.execCommand("copy"),hH.forceCopyWithSyntaxHighlighting=!1)}}function wwe(i,e){!i||(i.addImplementation(1e4,"code-editor",(t,n)=>{const o=t.get(Jn).getFocusedCodeEditor();if(o&&o.hasTextFocus()){const r=o.getOption(37),s=o.getSelection();return s&&s.isEmpty()&&!r||o.getContainerDomNode().ownerDocument.execCommand(e),!0}return!1}),i.addImplementation(0,"generic-dom",(t,n)=>(Q4().execCommand(e),!0)))}wwe(M_t,"cut");wwe(A_t,"copy");Z9&&(Z9.addImplementation(1e4,"code-editor",(i,e)=>{const t=i.get(Jn),n=i.get(bp),o=t.getFocusedCodeEditor();return o&&o.hasTextFocus()?!o.getContainerDomNode().ownerDocument.execCommand("paste")&&qv?(()=>T_t(void 0,void 0,void 0,function*(){const s=yield n.readText();if(s!==""){const a=JD.INSTANCE.get(s);let l=!1,c=null,u=null;a&&(l=o.getOption(37)&&!!a.isFromEmptySelection,c=typeof a.multicursorText!="undefined"?a.multicursorText:null,u=a.mode),o.trigger("keyboard","paste",{text:s,pasteOnNewLine:l,multicursorText:c,mode:u})}}))():!0:!1}),Z9.addImplementation(0,"generic-dom",(i,e)=>(Q4().execCommand("paste"),!0)));Cwe&&ze(P_t);var O_t=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};class Wt{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+Wt.sep)}intersects(e){return this.contains(e)||e.contains(this)}append(e){return new Wt(this.value+Wt.sep+e)}}Wt.sep=".";Wt.None=new Wt("@@none@@");Wt.Empty=new Wt("");Wt.QuickFix=new Wt("quickfix");Wt.Refactor=new Wt("refactor");Wt.RefactorExtract=Wt.Refactor.append("extract");Wt.RefactorInline=Wt.Refactor.append("inline");Wt.RefactorMove=Wt.Refactor.append("move");Wt.RefactorRewrite=Wt.Refactor.append("rewrite");Wt.Notebook=new Wt("notebook");Wt.Source=new Wt("source");Wt.SourceOrganizeImports=Wt.Source.append("organizeImports");Wt.SourceFixAll=Wt.Source.append("fixAll");Wt.SurroundWith=Wt.Refactor.append("surround");var hl;(function(i){i.Refactor="refactor",i.RefactorPreview="refactor preview",i.Lightbulb="lightbulb",i.Default="other (default)",i.SourceAction="source action",i.QuickFix="quick fix action",i.FixAll="fix all",i.OrganizeImports="organize imports",i.AutoFix="auto fix",i.QuickFixHover="quick fix hover window",i.OnSave="save participants",i.ProblemsView="problems view"})(hl||(hl={}));function F_t(i,e){return!(i.include&&!i.include.intersects(e)||i.excludes&&i.excludes.some(t=>ywe(e,t,i.include))||!i.includeSourceActions&&Wt.Source.contains(e))}function B_t(i,e){const t=e.kind?new Wt(e.kind):void 0;return!(i.include&&(!t||!i.include.contains(t))||i.excludes&&t&&i.excludes.some(n=>ywe(t,n,i.include))||!i.includeSourceActions&&t&&Wt.Source.contains(t)||i.onlyIncludePreferredActions&&!e.isPreferred)}function ywe(i,e,t){return!(!e.contains(i)||t&&e.contains(t))}class Wh{static fromUser(e,t){return!e||typeof e!="object"?new Wh(t.kind,t.apply,!1):new Wh(Wh.getKindFromUser(e,t.kind),Wh.getApplyFromUser(e,t.apply),Wh.getPreferredUser(e))}static getApplyFromUser(e,t){switch(typeof e.apply=="string"?e.apply.toLowerCase():""){case"first":return"first";case"never":return"never";case"ifsingle":return"ifSingle";default:return t}}static getKindFromUser(e,t){return typeof e.kind=="string"?new Wt(e.kind):t}static getPreferredUser(e){return typeof e.preferred=="boolean"?e.preferred:!1}constructor(e,t,n){this.kind=e,this.apply=t,this.preferred=n}}class W_t{constructor(e,t,n){this.action=e,this.provider=t,this.highlightRange=n}resolve(e){var t;return O_t(this,void 0,void 0,function*(){if(((t=this.provider)===null||t===void 0?void 0:t.resolveCodeAction)&&!this.action.edit){let n;try{n=yield this.provider.resolveCodeAction(this.action,e)}catch(o){$o(o)}n&&(this.action.edit=n.edit)}return this})}}var oO=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};const Swe="editor.action.codeAction",ZX="editor.action.quickFix",xwe="editor.action.autoFix",Lwe="editor.action.refactor",Ewe="editor.action.sourceAction",QX="editor.action.organizeImports",JX="editor.action.fixAll";class kE extends _e{static codeActionsPreferredComparator(e,t){return e.isPreferred&&!t.isPreferred?-1:!e.isPreferred&&t.isPreferred?1:0}static codeActionsComparator({action:e},{action:t}){return ws(e.diagnostics)?ws(t.diagnostics)?kE.codeActionsPreferredComparator(e,t):-1:ws(t.diagnostics)?1:kE.codeActionsPreferredComparator(e,t)}constructor(e,t,n){super(),this.documentation=t,this._register(n),this.allActions=[...e].sort(kE.codeActionsComparator),this.validActions=this.allActions.filter(({action:o})=>!o.disabled)}get hasAutoFix(){return this.validActions.some(({action:e})=>!!e.kind&&Wt.QuickFix.contains(new Wt(e.kind))&&!!e.isPreferred)}}const _le={actions:[],documentation:void 0};function IE(i,e,t,n,o,r){var s;return oO(this,void 0,void 0,function*(){const a=n.filter||{},l=Object.assign(Object.assign({},a),{excludes:[...a.excludes||[],Wt.Notebook]}),c={only:(s=a.include)===null||s===void 0?void 0:s.value,trigger:n.type},u=new UX(e,r),d=n.type===2,h=V_t(i,e,d?l:a),f=new Be,g=h.map(v=>oO(this,void 0,void 0,function*(){try{o.report(v);const m=yield v.provideCodeActions(e,t,c,u.token);if(m&&f.add(m),u.token.isCancellationRequested)return _le;const _=((m==null?void 0:m.actions)||[]).filter(y=>y&&B_t(a,y)),w=$_t(v,_,a.include);return{actions:_.map(y=>new W_t(y,v)),documentation:w}}catch(m){if(oh(m))throw m;return $o(m),_le}})),p=i.onDidChange(()=>{const v=i.all(e);Lo(v,h)||u.cancel()});try{const v=yield Promise.all(g),m=v.map(w=>w.actions).flat(),_=[...df(v.map(w=>w.documentation)),...H_t(i,e,n,m)];return new kE(m,_,f)}finally{p.dispose(),u.dispose()}})}function V_t(i,e,t){return i.all(e).filter(n=>n.providedCodeActionKinds?n.providedCodeActionKinds.some(o=>F_t(t,new Wt(o))):!0)}function*H_t(i,e,t,n){var o,r,s;if(e&&n.length)for(const a of i.all(e))a._getAdditionalMenuItems&&(yield*(o=a._getAdditionalMenuItems)===null||o===void 0?void 0:o.call(a,{trigger:t.type,only:(s=(r=t.filter)===null||r===void 0?void 0:r.include)===null||s===void 0?void 0:s.value},n.map(l=>l.action)))}function $_t(i,e,t){if(!i.documentation)return;const n=i.documentation.map(o=>({kind:new Wt(o.kind),command:o.command}));if(t){let o;for(const r of n)r.kind.contains(t)&&(o?o.kind.contains(r.kind)&&(o=r):o=r);if(o)return o==null?void 0:o.command}for(const o of e)if(!!o.kind){for(const r of n)if(r.kind.contains(new Wt(o.kind)))return r.command}}var rO;(function(i){i.OnSave="onSave",i.FromProblemsView="fromProblemsView",i.FromCodeActions="fromCodeActions"})(rO||(rO={}));function z_t(i,e,t,n,o=_n.None){var r;return oO(this,void 0,void 0,function*(){const s=i.get(eT),a=i.get(_o),l=i.get(ec),c=i.get(Ao);if(l.publicLog2("codeAction.applyCodeAction",{codeActionTitle:e.action.title,codeActionKind:e.action.kind,codeActionIsPreferred:!!e.action.isPreferred,reason:t}),yield e.resolve(o),!o.isCancellationRequested&&!(!((r=e.action.edit)===null||r===void 0)&&r.edits.length&&!(yield s.apply(e.action.edit,{editor:n==null?void 0:n.editor,label:e.action.title,quotableLabel:e.action.title,code:"undoredo.codeAction",respectAutoSaveConfig:t!==rO.OnSave,showPreview:n==null?void 0:n.preview})).isApplied)&&e.action.command)try{yield a.executeCommand(e.action.command.id,...e.action.command.arguments||[])}catch(u){const d=U_t(u);c.error(typeof d=="string"?d:C("applyCodeActionFailed","An unknown error occurred while applying the code action"))}})}function U_t(i){return typeof i=="string"?i:i instanceof Error&&typeof i.message=="string"?i.message:void 0}Rn.registerCommand("_executeCodeActionProvider",function(i,e,t,n,o){return oO(this,void 0,void 0,function*(){if(!(e instanceof Rt))throw Rc();const{codeActionProvider:r}=i.get(pt),s=i.get(Yi).getModel(e);if(!s)throw Rc();const a=gt.isISelection(t)?gt.liftSelection(t):V.isIRange(t)?s.validateRange(t):void 0;if(!a)throw Rc();const l=typeof n=="string"?new Wt(n):void 0,c=yield IE(r,s,a,{type:1,triggerAction:hl.Default,filter:{includeSourceActions:!0,include:l}},qg.None,_n.None),u=[],d=Math.min(c.validActions.length,typeof o=="number"?o:0);for(let h=0;hh.action)}finally{setTimeout(()=>c.dispose(),100)}})});var j_t=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},K_t=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},sz;let sO=sz=class{constructor(e){this.keybindingService=e}getResolver(){const e=new rh(()=>this.keybindingService.getKeybindings().filter(t=>sz.codeActionCommands.indexOf(t.command)>=0).filter(t=>t.resolvedKeybinding).map(t=>{let n=t.commandArgs;return t.command===QX?n={kind:Wt.SourceOrganizeImports.value}:t.command===JX&&(n={kind:Wt.SourceFixAll.value}),Object.assign({resolvedKeybinding:t.resolvedKeybinding},Wh.fromUser(n,{kind:Wt.None,apply:"never"}))}));return t=>{if(t.kind){const n=this.bestKeybindingForCodeAction(t,e.value);return n==null?void 0:n.resolvedKeybinding}}}bestKeybindingForCodeAction(e,t){if(!e.kind)return;const n=new Wt(e.kind);return t.filter(o=>o.kind.contains(n)).filter(o=>o.preferred?e.isPreferred:!0).reduceRight((o,r)=>o?o.kind.contains(r.kind)?r:o:r,void 0)}};sO.codeActionCommands=[Lwe,Swe,Ewe,QX,JX];sO=sz=j_t([K_t(0,xi)],sO);J("symbolIcon.arrayForeground",{dark:Ke,light:Ke,hcDark:Ke,hcLight:Ke},C("symbolIcon.arrayForeground","The foreground color for array symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));J("symbolIcon.booleanForeground",{dark:Ke,light:Ke,hcDark:Ke,hcLight:Ke},C("symbolIcon.booleanForeground","The foreground color for boolean symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));J("symbolIcon.classForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},C("symbolIcon.classForeground","The foreground color for class symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));J("symbolIcon.colorForeground",{dark:Ke,light:Ke,hcDark:Ke,hcLight:Ke},C("symbolIcon.colorForeground","The foreground color for color symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));J("symbolIcon.constantForeground",{dark:Ke,light:Ke,hcDark:Ke,hcLight:Ke},C("symbolIcon.constantForeground","The foreground color for constant symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));J("symbolIcon.constructorForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},C("symbolIcon.constructorForeground","The foreground color for constructor symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));J("symbolIcon.enumeratorForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},C("symbolIcon.enumeratorForeground","The foreground color for enumerator symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));J("symbolIcon.enumeratorMemberForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},C("symbolIcon.enumeratorMemberForeground","The foreground color for enumerator member symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));J("symbolIcon.eventForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},C("symbolIcon.eventForeground","The foreground color for event symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));J("symbolIcon.fieldForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},C("symbolIcon.fieldForeground","The foreground color for field symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));J("symbolIcon.fileForeground",{dark:Ke,light:Ke,hcDark:Ke,hcLight:Ke},C("symbolIcon.fileForeground","The foreground color for file symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));J("symbolIcon.folderForeground",{dark:Ke,light:Ke,hcDark:Ke,hcLight:Ke},C("symbolIcon.folderForeground","The foreground color for folder symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));J("symbolIcon.functionForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},C("symbolIcon.functionForeground","The foreground color for function symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));J("symbolIcon.interfaceForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},C("symbolIcon.interfaceForeground","The foreground color for interface symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));J("symbolIcon.keyForeground",{dark:Ke,light:Ke,hcDark:Ke,hcLight:Ke},C("symbolIcon.keyForeground","The foreground color for key symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));J("symbolIcon.keywordForeground",{dark:Ke,light:Ke,hcDark:Ke,hcLight:Ke},C("symbolIcon.keywordForeground","The foreground color for keyword symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));J("symbolIcon.methodForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},C("symbolIcon.methodForeground","The foreground color for method symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));J("symbolIcon.moduleForeground",{dark:Ke,light:Ke,hcDark:Ke,hcLight:Ke},C("symbolIcon.moduleForeground","The foreground color for module symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));J("symbolIcon.namespaceForeground",{dark:Ke,light:Ke,hcDark:Ke,hcLight:Ke},C("symbolIcon.namespaceForeground","The foreground color for namespace symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));J("symbolIcon.nullForeground",{dark:Ke,light:Ke,hcDark:Ke,hcLight:Ke},C("symbolIcon.nullForeground","The foreground color for null symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));J("symbolIcon.numberForeground",{dark:Ke,light:Ke,hcDark:Ke,hcLight:Ke},C("symbolIcon.numberForeground","The foreground color for number symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));J("symbolIcon.objectForeground",{dark:Ke,light:Ke,hcDark:Ke,hcLight:Ke},C("symbolIcon.objectForeground","The foreground color for object symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));J("symbolIcon.operatorForeground",{dark:Ke,light:Ke,hcDark:Ke,hcLight:Ke},C("symbolIcon.operatorForeground","The foreground color for operator symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));J("symbolIcon.packageForeground",{dark:Ke,light:Ke,hcDark:Ke,hcLight:Ke},C("symbolIcon.packageForeground","The foreground color for package symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));J("symbolIcon.propertyForeground",{dark:Ke,light:Ke,hcDark:Ke,hcLight:Ke},C("symbolIcon.propertyForeground","The foreground color for property symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));J("symbolIcon.referenceForeground",{dark:Ke,light:Ke,hcDark:Ke,hcLight:Ke},C("symbolIcon.referenceForeground","The foreground color for reference symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));J("symbolIcon.snippetForeground",{dark:Ke,light:Ke,hcDark:Ke,hcLight:Ke},C("symbolIcon.snippetForeground","The foreground color for snippet symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));J("symbolIcon.stringForeground",{dark:Ke,light:Ke,hcDark:Ke,hcLight:Ke},C("symbolIcon.stringForeground","The foreground color for string symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));J("symbolIcon.structForeground",{dark:Ke,light:Ke,hcDark:Ke,hcLight:Ke},C("symbolIcon.structForeground","The foreground color for struct symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));J("symbolIcon.textForeground",{dark:Ke,light:Ke,hcDark:Ke,hcLight:Ke},C("symbolIcon.textForeground","The foreground color for text symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));J("symbolIcon.typeParameterForeground",{dark:Ke,light:Ke,hcDark:Ke,hcLight:Ke},C("symbolIcon.typeParameterForeground","The foreground color for type parameter symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));J("symbolIcon.unitForeground",{dark:Ke,light:Ke,hcDark:Ke,hcLight:Ke},C("symbolIcon.unitForeground","The foreground color for unit symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));J("symbolIcon.variableForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},C("symbolIcon.variableForeground","The foreground color for variable symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));const Dwe=Object.freeze({kind:Wt.Empty,title:C("codeAction.widget.id.more","More Actions...")}),q_t=Object.freeze([{kind:Wt.QuickFix,title:C("codeAction.widget.id.quickfix","Quick Fix")},{kind:Wt.RefactorExtract,title:C("codeAction.widget.id.extract","Extract"),icon:Xe.wrench},{kind:Wt.RefactorInline,title:C("codeAction.widget.id.inline","Inline"),icon:Xe.wrench},{kind:Wt.RefactorRewrite,title:C("codeAction.widget.id.convert","Rewrite"),icon:Xe.wrench},{kind:Wt.RefactorMove,title:C("codeAction.widget.id.move","Move"),icon:Xe.wrench},{kind:Wt.SurroundWith,title:C("codeAction.widget.id.surround","Surround With"),icon:Xe.symbolSnippet},{kind:Wt.Source,title:C("codeAction.widget.id.source","Source Action"),icon:Xe.symbolFile},Dwe]);function G_t(i,e,t){if(!e)return i.map(r=>{var s;return{kind:"action",item:r,group:Dwe,disabled:!!r.action.disabled,label:r.action.disabled||r.action.title,canPreview:!!(!((s=r.action.edit)===null||s===void 0)&&s.edits.length)}});const n=q_t.map(r=>({group:r,actions:[]}));for(const r of i){const s=r.action.kind?new Wt(r.action.kind):Wt.None;for(const a of n)if(a.group.kind.contains(s)){a.actions.push(r);break}}const o=[];for(const r of n)if(r.actions.length){o.push({kind:"header",group:r.group});for(const s of r.actions)o.push({kind:"action",item:s,group:r.group,label:s.action.title,disabled:!!s.action.disabled,keybinding:t(s.action)})}return o}var X_t=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Y_t=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},az,XC;(function(i){i.Hidden={type:0};class e{constructor(n,o,r,s){this.actions=n,this.trigger=o,this.editorPosition=r,this.widgetPosition=s,this.type=1}}i.Showing=e})(XC||(XC={}));let db=az=class extends _e{constructor(e,t){super(),this._editor=e,this._onClick=this._register(new le),this.onClick=this._onClick.event,this._state=XC.Hidden,this._domNode=He("div.lightBulbWidget"),this._register(Ei.ignoreTarget(this._domNode)),this._editor.addContentWidget(this),this._register(this._editor.onDidChangeModelContent(n=>{const o=this._editor.getModel();(this.state.type!==1||!o||this.state.editorPosition.lineNumber>=o.getLineCount())&&this.hide()})),this._register(IQe(this._domNode,n=>{if(this.state.type!==1)return;this._editor.focus(),n.preventDefault();const{top:o,height:r}=Yo(this._domNode),s=this._editor.getOption(66);let a=Math.floor(s/3);this.state.widgetPosition.position!==null&&this.state.widgetPosition.position.lineNumber{(n.buttons&1)===1&&this.hide()})),this._register(this._editor.onDidChangeConfiguration(n=>{n.hasChanged(64)&&!this._editor.getOption(64).enabled&&this.hide()})),this._register(st.runAndSubscribe(t.onDidUpdateKeybindings,()=>{var n,o,r,s;this._preferredKbLabel=(o=(n=t.lookupKeybinding(xwe))===null||n===void 0?void 0:n.getLabel())!==null&&o!==void 0?o:void 0,this._quickFixKbLabel=(s=(r=t.lookupKeybinding(ZX))===null||r===void 0?void 0:r.getLabel())!==null&&s!==void 0?s:void 0,this._updateLightBulbTitleAndIcon()}))}dispose(){super.dispose(),this._editor.removeContentWidget(this)}getId(){return"LightBulbWidget"}getDomNode(){return this._domNode}getPosition(){return this._state.type===1?this._state.widgetPosition:null}update(e,t,n){if(e.validActions.length<=0)return this.hide();const o=this._editor.getOptions();if(!o.get(64).enabled)return this.hide();const r=this._editor.getModel();if(!r)return this.hide();const{lineNumber:s,column:a}=r.validatePosition(n),l=r.getOptions().tabSize,c=o.get(50),u=r.getLineContent(s),d=C5(u,l),h=c.spaceWidth*d>22,f=p=>p>2&&this._editor.getTopForLineNumber(p)===this._editor.getTopForLineNumber(p-1);let g=s;if(!h){if(s>1&&!f(s-1))g-=1;else if(!f(s+1))g+=1;else if(a*c.spaceWidth<22)return this.hide()}this.state=new XC.Showing(e,t,n,{position:{lineNumber:g,column:1},preference:az._posPref}),this._editor.layoutContentWidget(this)}hide(){this.state!==XC.Hidden&&(this.state=XC.Hidden,this._editor.layoutContentWidget(this))}get state(){return this._state}set state(e){this._state=e,this._updateLightBulbTitleAndIcon()}_updateLightBulbTitleAndIcon(){if(this.state.type===1&&this.state.actions.hasAutoFix&&(this._domNode.classList.remove(...Mt.asClassNameArray(Xe.lightBulb)),this._domNode.classList.add(...Mt.asClassNameArray(Xe.lightbulbAutofix)),this._preferredKbLabel)){this.title=C("preferredcodeActionWithKb","Show Code Actions. Preferred Quick Fix Available ({0})",this._preferredKbLabel);return}this._domNode.classList.remove(...Mt.asClassNameArray(Xe.lightbulbAutofix)),this._domNode.classList.add(...Mt.asClassNameArray(Xe.lightBulb)),this._quickFixKbLabel?this.title=C("codeActionWithKb","Show Code Actions ({0})",this._quickFixKbLabel):this.title=C("codeAction","Show Code Actions")}set title(e){this._domNode.title=e}};db.ID="editor.contrib.lightbulbWidget";db._posPref=[0];db=az=X_t([Y_t(1,xi)],db);var Z_t=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},ble=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},kwe=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},lz;let cp=lz=class{constructor(e,t,n){this._options=e,this._languageService=t,this._openerService=n,this._onDidRenderAsync=new le,this.onDidRenderAsync=this._onDidRenderAsync.event}dispose(){this._onDidRenderAsync.dispose()}render(e,t,n){if(!e)return{element:document.createElement("span"),dispose:()=>{}};const o=new Be,r=o.add(R5(e,Object.assign(Object.assign({},this._getRenderOptions(e,o)),t),n));return r.element.classList.add("rendered-markdown"),{element:r.element,dispose:()=>o.dispose()}}_getRenderOptions(e,t){return{codeBlockRenderer:(n,o)=>kwe(this,void 0,void 0,function*(){var r,s,a;let l;n?l=this._languageService.getLanguageIdByLanguageName(n):this._options.editor&&(l=(r=this._options.editor.getModel())===null||r===void 0?void 0:r.getLanguageId()),l||(l=ql);const c=yield slt(this._languageService,o,l),u=document.createElement("span");if(u.innerHTML=(a=(s=lz._ttpTokenizer)===null||s===void 0?void 0:s.createHTML(c))!==null&&a!==void 0?a:c,this._options.editor){const d=this._options.editor.getOption(50);rs(u,d)}else this._options.codeBlockFontFamily&&(u.style.fontFamily=this._options.codeBlockFontFamily);return this._options.codeBlockFontSize!==void 0&&(u.style.fontSize=this._options.codeBlockFontSize),u}),asyncRenderCallback:()=>this._onDidRenderAsync.fire(),actionHandler:{callback:n=>Iwe(this._openerService,n,e.isTrusted),disposables:t}}}};cp._ttpTokenizer=gp("tokenizeToString",{createHTML(i){return i}});cp=lz=Z_t([ble(1,Ki),ble(2,pl)],cp);function Iwe(i,e,t){return kwe(this,void 0,void 0,function*(){try{return yield i.open(e,{fromUserGesture:!0,allowContributedOpeners:!0,allowCommands:Q_t(t)})}catch(n){return en(n),!1}})}function Q_t(i){return i===!0?!0:i&&Array.isArray(i.enabledCommands)?i.enabledCommands:!1}var J_t=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Cle=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},CM;let ll=CM=class{static get(e){return e.getContribution(CM.ID)}constructor(e,t,n){this._openerService=n,this._messageWidget=new Kr,this._messageListeners=new Be,this._mouseOverMessage=!1,this._editor=e,this._visible=CM.MESSAGE_VISIBLE.bindTo(t)}dispose(){var e;(e=this._message)===null||e===void 0||e.dispose(),this._messageListeners.dispose(),this._messageWidget.dispose(),this._visible.reset()}showMessage(e,t){bs(Ym(e)?e.value:e),this._visible.set(!0),this._messageWidget.clear(),this._messageListeners.clear(),this._message=Ym(e)?R5(e,{actionHandler:{callback:o=>Iwe(this._openerService,o,Ym(e)?e.isTrusted:void 0),disposables:this._messageListeners}}):void 0,this._messageWidget.value=new wle(this._editor,t,typeof e=="string"?e:this._message.element),this._messageListeners.add(st.debounce(this._editor.onDidBlurEditorText,(o,r)=>r,0)(()=>{this._mouseOverMessage||this._messageWidget.value&&os(Tu(),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(ke(this._messageWidget.value.getDomNode(),et.MOUSE_ENTER,()=>this._mouseOverMessage=!0,!0)),this._messageListeners.add(ke(this._messageWidget.value.getDomNode(),et.MOUSE_LEAVE,()=>this._mouseOverMessage=!1,!0));let n;this._messageListeners.add(this._editor.onMouseMove(o=>{!o.target.position||(n?n.containsPosition(o.target.position)||this.closeMessage():n=new V(t.lineNumber-3,1,o.target.position.lineNumber+3,1))}))}closeMessage(){this._visible.reset(),this._messageListeners.clear(),this._messageWidget.value&&this._messageListeners.add(wle.fadeOut(this._messageWidget.value))}};ll.ID="editor.contrib.messageController";ll.MESSAGE_VISIBLE=new lt("messageVisible",!1,C("messageVisible","Whether the editor is currently showing an inline message"));ll=CM=J_t([Cle(1,Ut),Cle(2,pl)],ll);const e0t=Ir.bindToContribution(ll.get);Ye(new e0t({id:"leaveEditorMessage",precondition:ll.MESSAGE_VISIBLE,handler:i=>i.closeMessage(),kbOpts:{weight:100+30,primary:9}}));class wle{static fadeOut(e){const t=()=>{e.dispose(),clearTimeout(n),e.getDomNode().removeEventListener("animationend",t)},n=setTimeout(t,110);return e.getDomNode().addEventListener("animationend",t),e.getDomNode().classList.add("fadeOut"),{dispose:t}}constructor(e,{lineNumber:t,column:n},o){this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._editor=e,this._editor.revealLinesInCenterIfOutsideViewport(t,t,0),this._position={lineNumber:t,column:n},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 s=document.createElement("div");typeof o=="string"?(s.classList.add("message"),s.textContent=o):(o.classList.add("message"),s.appendChild(o)),this._domNode.appendChild(s);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:[1,2],positionAffinity:1}}afterRender(e){this._domNode.classList.toggle("below",e===2)}}zn(ll.ID,ll,4);var Twe=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},cz=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},t0t=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};const Nwe="acceptSelectedCodeAction",Rwe="previewSelectedCodeAction";class n0t{get templateId(){return"header"}renderTemplate(e){e.classList.add("group-header");const t=document.createElement("span");return e.append(t),{container:e,text:t}}renderElement(e,t,n){var o,r;n.text.textContent=(r=(o=e.group)===null||o===void 0?void 0:o.title)!==null&&r!==void 0?r:""}disposeTemplate(e){}}let uz=class{get templateId(){return"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 n=document.createElement("span");n.className="title",e.append(n);const o=new rT(e,Wl);return{container:e,icon:t,text:n,keybinding:o}}renderElement(e,t,n){var o,r,s;if(!((o=e.group)===null||o===void 0)&&o.icon?(n.icon.className=Mt.asClassName(e.group.icon),e.group.icon.color&&(n.icon.style.color=ct(e.group.icon.color.id))):(n.icon.className=Mt.asClassName(Xe.lightBulb),n.icon.style.color="var(--vscode-editorLightBulb-foreground)"),!e.item||!e.label)return;n.text.textContent=Mwe(e.label),n.keybinding.set(e.keybinding),VQe(!!e.keybinding,n.keybinding.element);const a=(r=this._keybindingService.lookupKeybinding(Nwe))===null||r===void 0?void 0:r.getLabel(),l=(s=this._keybindingService.lookupKeybinding(Rwe))===null||s===void 0?void 0:s.getLabel();n.container.classList.toggle("option-disabled",e.disabled),e.disabled?n.container.title=e.label:a&&l?this._supportsPreview&&e.canPreview?n.container.title=C({key:"label-preview",comment:['placeholders are keybindings, e.g "F2 to apply, Shift+F2 to preview"']},"{0} to apply, {1} to preview",a,l):n.container.title=C({key:"label",comment:['placeholder is a keybinding, e.g "F2 to apply"']},"{0} to apply",a):n.container.title=""}disposeTemplate(e){}};uz=Twe([cz(1,xi)],uz);class i0t extends UIEvent{constructor(){super("acceptSelectedAction")}}class yle extends UIEvent{constructor(){super("previewSelectedAction")}}function o0t(i){if(i.kind==="action")return i.label}let dz=class extends _e{constructor(e,t,n,o,r,s){super(),this._delegate=o,this._contextViewService=r,this._keybindingService=s,this._actionLineHeight=24,this._headerLineHeight=26,this.cts=this._register(new Ro),this.domNode=document.createElement("div"),this.domNode.classList.add("actionList");const a={getHeight:l=>l.kind==="header"?this._headerLineHeight:this._actionLineHeight,getTemplateId:l=>l.kind};this._list=this._register(new Ku(e,this.domNode,a,[new uz(t,this._keybindingService),new n0t],{keyboardSupport:!1,typeNavigationEnabled:!0,keyboardNavigationLabelProvider:{getKeyboardNavigationLabel:o0t},accessibilityProvider:{getAriaLabel:l=>{if(l.kind==="action"){let c=l.label?Mwe(l==null?void 0:l.label):"";return l.disabled&&(c=C({key:"customQuickFixWidget.labels",comment:["Action widget labels for accessibility."]},"{0}, Disabled Reason: {1}",c,l.disabled)),c}return null},getWidgetAriaLabel:()=>C({key:"customQuickFixWidget",comment:["An action widget option"]},"Action Widget"),getRole:l=>l.kind==="action"?"option":"separator",getWidgetRole:()=>"listbox"}})),this._list.style(Ub),this._register(this._list.onMouseClick(l=>this.onListClick(l))),this._register(this._list.onMouseOver(l=>this.onListHover(l))),this._register(this._list.onDidChangeFocus(()=>this.onFocus())),this._register(this._list.onDidChangeSelection(l=>this.onListSelection(l))),this._allMenuItems=n,this._list.splice(0,this._list.length,this._allMenuItems),this._list.length&&this.focusNext()}focusCondition(e){return!e.disabled&&e.kind==="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,o=this._allMenuItems.length*this._actionLineHeight+t*this._headerLineHeight-t*this._actionLineHeight;this._list.layout(o);const r=this._allMenuItems.map((c,u)=>{const d=document.getElementById(this._list.getElementID(u));if(d){d.style.width="auto";const h=d.getBoundingClientRect().width;return d.style.width="",h}return 0}),s=Math.max(...r,e),a=.7,l=Math.min(o,document.body.clientHeight*a);return this._list.layout(l,s),this.domNode.style.height=`${l}px`,this._list.domFocus(),s}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 n=t[0],o=this._list.element(n);if(!this.focusCondition(o))return;const r=e?new yle:new i0t;this._list.setSelection([n],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 yle):this._list.setSelection([])}onFocus(){var e,t;this._list.domFocus();const n=this._list.getFocus();if(n.length===0)return;const o=n[0],r=this._list.element(o);(t=(e=this._delegate).onFocus)===null||t===void 0||t.call(e,r.item)}onListHover(e){return t0t(this,void 0,void 0,function*(){const t=e.element;if(t&&t.item&&this.focusCondition(t)){if(this._delegate.onHover&&!t.disabled&&t.kind==="action"){const n=yield this._delegate.onHover(t.item,this.cts.token);t.canPreview=n?n.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([])}};dz=Twe([cz(4,mp),cz(5,xi)],dz);function Mwe(i){return i.replace(/\r\n|\r|\n/g," ")}var r0t=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Q9=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};J("actionBar.toggledBackground",{dark:u0,light:u0,hcDark:u0,hcLight:u0},C("actionBar.toggledBackground","Background color for toggled action items in action bar."));const hb={Visible:new lt("codeActionMenuVisible",!1,C("codeActionMenuVisible","Whether the action widget list is visible"))},Xb=wn("actionWidgetService");let fb=class extends _e{get isVisible(){return hb.Visible.getValue(this._contextKeyService)||!1}constructor(e,t,n){super(),this._contextViewService=e,this._contextKeyService=t,this._instantiationService=n,this._list=this._register(new Kr)}show(e,t,n,o,r,s,a){const l=hb.Visible.bindTo(this._contextKeyService),c=this._instantiationService.createInstance(dz,e,t,n,o);this._contextViewService.showContextView({getAnchor:()=>r,render:u=>(l.set(!0),this._renderWidget(u,c,a!=null?a:[])),onHide:u=>{l.reset(),this._onWidgetClosed(u)}},s,!1)}acceptSelected(e){var t;(t=this._list.value)===null||t===void 0||t.acceptSelected(e)}focusPrevious(){var e,t;(t=(e=this._list)===null||e===void 0?void 0:e.value)===null||t===void 0||t.focusPrevious()}focusNext(){var e,t;(t=(e=this._list)===null||e===void 0?void 0:e.value)===null||t===void 0||t.focusNext()}hide(){var e;(e=this._list.value)===null||e===void 0||e.hide(),this._list.clear()}_renderWidget(e,t,n){var o;const r=document.createElement("div");if(r.classList.add("action-widget"),e.appendChild(r),this._list.value=t,this._list.value)r.appendChild(this._list.value.domNode);else throw new Error("List has no value");const s=new Be,a=document.createElement("div"),l=e.appendChild(a);l.classList.add("context-view-block"),s.add(ke(l,et.MOUSE_DOWN,g=>g.stopPropagation()));const c=document.createElement("div"),u=e.appendChild(c);u.classList.add("context-view-pointerBlock"),s.add(ke(u,et.POINTER_MOVE,()=>u.remove())),s.add(ke(u,et.MOUSE_DOWN,()=>u.remove()));let d=0;if(n.length){const g=this._createActionBar(".action-widget-action-bar",n);g&&(r.appendChild(g.getContainer().parentElement),s.add(g),d=g.getContainer().offsetWidth)}const h=(o=this._list.value)===null||o===void 0?void 0:o.layout(d);r.style.width=`${h}px`;const f=s.add(gf(e));return s.add(f.onDidBlur(()=>this.hide())),s}_createActionBar(e,t){if(!t.length)return;const n=He(e),o=new $c(n);return o.push(t,{icon:!1,label:!0}),o}_onWidgetClosed(e){var t;(t=this._list.value)===null||t===void 0||t.hide(e)}};fb=r0t([Q9(0,mp),Q9(1,Ut),Q9(2,$t)],fb);Mn(Xb,fb,1);const fT=100+1e3;$i(class extends Jl{constructor(){super({id:"hideCodeActionWidget",title:{value:C("hideCodeActionWidget.title","Hide action widget"),original:"Hide action widget"},precondition:hb.Visible,keybinding:{weight:fT,primary:9,secondary:[1033]}})}run(i){i.get(Xb).hide()}});$i(class extends Jl{constructor(){super({id:"selectPrevCodeAction",title:{value:C("selectPrevCodeAction.title","Select previous action"),original:"Select previous action"},precondition:hb.Visible,keybinding:{weight:fT,primary:16,secondary:[2064],mac:{primary:16,secondary:[2064,302]}}})}run(i){const e=i.get(Xb);e instanceof fb&&e.focusPrevious()}});$i(class extends Jl{constructor(){super({id:"selectNextCodeAction",title:{value:C("selectNextCodeAction.title","Select next action"),original:"Select next action"},precondition:hb.Visible,keybinding:{weight:fT,primary:18,secondary:[2066],mac:{primary:18,secondary:[2066,300]}}})}run(i){const e=i.get(Xb);e instanceof fb&&e.focusNext()}});$i(class extends Jl{constructor(){super({id:Nwe,title:{value:C("acceptSelected.title","Accept selected action"),original:"Accept selected action"},precondition:hb.Visible,keybinding:{weight:fT,primary:3,secondary:[2137]}})}run(i){const e=i.get(Xb);e instanceof fb&&e.acceptSelected()}});$i(class extends Jl{constructor(){super({id:Rwe,title:{value:C("previewSelected.title","Preview selected action"),original:"Preview selected action"},precondition:hb.Visible,keybinding:{weight:fT,primary:2051}})}run(i){const e=i.get(Xb);e instanceof fb&&e.acceptSelected(!0)}});var s0t=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};const Awe=new lt("supportedCodeAction","");class a0t extends _e{constructor(e,t,n,o=250){super(),this._editor=e,this._markerService=t,this._signalChange=n,this._delay=o,this._autoTriggerTimer=this._register(new $u),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(n=>MG(n,t.uri))&&this._tryAutoTrigger()}_tryAutoTrigger(){this._autoTriggerTimer.cancelAndSet(()=>{this.trigger({type:2,triggerAction:hl.Default})},this._delay)}_getRangeOfSelectionUnlessWhitespaceEnclosed(e){if(!this._editor.hasModel())return;const t=this._editor.getModel(),n=this._editor.getSelection();if(n.isEmpty()&&e.type===2){const{lineNumber:o,column:r}=n.getPosition(),s=t.getLineContent(o);if(s.length===0)return;if(r===1){if(/\s/.test(s[0]))return}else if(r===t.getLineMaxColumn(o)){if(/\s/.test(s[s.length-1]))return}else if(/\s/.test(s[r-2])&&/\s/.test(s[r-1]))return}return n}}var K_;(function(i){i.Empty={type:0};class e{constructor(n,o,r){this.trigger=n,this.position=o,this._cancellablePromise=r,this.type=1,this.actions=r.catch(s=>{if(oh(s))return Pwe;throw s})}cancel(){this._cancellablePromise.cancel()}}i.Triggered=e})(K_||(K_={}));const Pwe=Object.freeze({allActions:[],validActions:[],dispose:()=>{},documentation:[],hasAutoFix:!1});class l0t extends _e{constructor(e,t,n,o,r,s){super(),this._editor=e,this._registry=t,this._markerService=n,this._progressService=r,this._configurationService=s,this._codeActionOracle=this._register(new Kr),this._state=K_.Empty,this._onDidChangeState=this._register(new le),this.onDidChangeState=this._onDidChangeState.event,this._disposed=!1,this._supportedCodeActions=Awe.bindTo(o),this._register(this._editor.onDidChangeModel(()=>this._update())),this._register(this._editor.onDidChangeModelLanguage(()=>this._update())),this._register(this._registry.onDidChange(()=>this._update())),this._update()}dispose(){this._disposed||(this._disposed=!0,super.dispose(),this.setState(K_.Empty,!0))}_settingEnabledNearbyQuickfixes(){var e;const t=(e=this._editor)===null||e===void 0?void 0:e.getModel();return this._configurationService?this._configurationService.getValue("editor.codeActionWidget.includeNearbyQuickfixes",{resource:t==null?void 0:t.uri}):!1}_update(){if(this._disposed)return;this._codeActionOracle.value=void 0,this.setState(K_.Empty);const e=this._editor.getModel();if(e&&this._registry.has(e)&&!this._editor.getOption(90)){const t=this._registry.all(e).flatMap(n=>{var o;return(o=n.providedCodeActionKinds)!==null&&o!==void 0?o:[]});this._supportedCodeActions.set(t.join(" ")),this._codeActionOracle.value=new a0t(this._editor,this._markerService,n=>{var o;if(!n){this.setState(K_.Empty);return}const r=n.selection.getStartPosition(),s=sr(a=>s0t(this,void 0,void 0,function*(){var l,c,u,d,h,f;if(this._settingEnabledNearbyQuickfixes()&&n.trigger.type===1&&(n.trigger.triggerAction===hl.QuickFix||((c=(l=n.trigger.filter)===null||l===void 0?void 0:l.include)===null||c===void 0?void 0:c.contains(Wt.QuickFix)))){const g=yield IE(this._registry,e,n.selection,n.trigger,qg.None,a);if(a.isCancellationRequested)return Pwe;if(!((u=g.validActions)===null||u===void 0?void 0:u.some(v=>v.action.kind?Wt.QuickFix.contains(new Wt(v.action.kind)):!1))){const v=this._markerService.read({resource:e.uri});if(v.length>0){const m=n.selection.getPosition();let _=m,w=Number.MAX_VALUE,y=!1;for(const L of v){const D=L.endColumn,E=L.endLineNumber,I=L.startLineNumber;(E===m.lineNumber||I===m.lineNumber)&&Math.abs(m.column-D){k.highlightRange=k.action.isPreferred}),I.push(...E.validActions)),{validActions:I,allActions:g.allActions,documentation:g.documentation,hasAutoFix:g.hasAutoFix,dispose:()=>{g.dispose()}}}}}}return IE(this._registry,e,n.selection,n.trigger,qg.None,a)}));n.trigger.type===1&&((o=this._progressService)===null||o===void 0||o.showWhile(s,250)),this.setState(new K_.Triggered(n.trigger,r,s))},void 0),this._codeActionOracle.value.trigger({type:2,triggerAction:hl.Default})}else this._supportedCodeActions.reset()}trigger(e){var t;(t=this._codeActionOracle.value)===null||t===void 0||t.trigger(e)}setState(e,t){e!==this._state&&(this._state.type===1&&this._state.cancel(),this._state=e,!t&&!this._disposed&&this._onDidChangeState.fire(e))}}var c0t=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Jf=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},Kx=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},wM;const u0t="quickfix-edit-highlight";let Rv=wM=class extends _e{static get(e){return e.getContribution(wM.ID)}constructor(e,t,n,o,r,s,a,l,c,u){super(),this._commandService=a,this._configurationService=l,this._actionWidgetService=c,this._instantiationService=u,this._activeCodeActions=this._register(new Kr),this._showDisabled=!1,this._disposed=!1,this._editor=e,this._model=this._register(new l0t(this._editor,r.codeActionProvider,t,n,s,l)),this._register(this._model.onDidChangeState(d=>this.update(d))),this._lightBulbWidget=new rh(()=>{const d=this._editor.getContribution(db.ID);return d&&this._register(d.onClick(h=>this.showCodeActionList(h.actions,h,{includeDisabledActions:!1,fromLightbulb:!0}))),d}),this._resolver=o.createInstance(sO),this._register(this._editor.onDidLayoutChange(()=>this._actionWidgetService.hide()))}dispose(){this._disposed=!0,super.dispose()}showCodeActions(e,t,n){return this.showCodeActionList(t,n,{includeDisabledActions:!1,fromLightbulb:!1})}manualTriggerAtCurrentPosition(e,t,n,o){var r;if(!this._editor.hasModel())return;(r=ll.get(this._editor))===null||r===void 0||r.closeMessage();const s=this._editor.getPosition();this._trigger({type:1,triggerAction:t,filter:n,autoApply:o,context:{notAvailableMessage:e,position:s}})}_trigger(e){return this._model.trigger(e)}_applyCodeAction(e,t,n){return Kx(this,void 0,void 0,function*(){try{yield this._instantiationService.invokeFunction(z_t,e,rO.FromCodeActions,{preview:n,editor:this._editor})}finally{t&&this._trigger({type:2,triggerAction:hl.QuickFix,filter:{}})}})}update(e){var t,n,o,r,s,a,l;return Kx(this,void 0,void 0,function*(){if(e.type!==1){(t=this._lightBulbWidget.rawValue)===null||t===void 0||t.hide();return}let c;try{c=yield e.actions}catch(u){en(u);return}if(!this._disposed)if((n=this._lightBulbWidget.value)===null||n===void 0||n.update(c,e.trigger,e.position),e.trigger.type===1){if(!((o=e.trigger.filter)===null||o===void 0)&&o.include){const d=this.tryGetValidActionToApply(e.trigger,c);if(d){try{(r=this._lightBulbWidget.value)===null||r===void 0||r.hide(),yield this._applyCodeAction(d,!1,!1)}finally{c.dispose()}return}if(e.trigger.context){const h=this.getInvalidActionThatWouldHaveBeenApplied(e.trigger,c);if(h&&h.action.disabled){(s=ll.get(this._editor))===null||s===void 0||s.showMessage(h.action.disabled,e.trigger.context.position),c.dispose();return}}}const u=!!(!((a=e.trigger.filter)===null||a===void 0)&&a.include);if(e.trigger.context&&(!c.allActions.length||!u&&!c.validActions.length)){(l=ll.get(this._editor))===null||l===void 0||l.showMessage(e.trigger.context.notAvailableMessage,e.trigger.context.position),this._activeCodeActions.value=c,c.dispose();return}this._activeCodeActions.value=c,this.showCodeActionList(c,this.toCoords(e.position),{includeDisabledActions:u,fromLightbulb:!1})}else this._actionWidgetService.isVisible?c.dispose():this._activeCodeActions.value=c})}getInvalidActionThatWouldHaveBeenApplied(e,t){if(!!t.allActions.length&&(e.autoApply==="first"&&t.validActions.length===0||e.autoApply==="ifSingle"&&t.allActions.length===1))return t.allActions.find(({action:n})=>n.disabled)}tryGetValidActionToApply(e,t){if(!!t.validActions.length&&(e.autoApply==="first"&&t.validActions.length>0||e.autoApply==="ifSingle"&&t.validActions.length===1))return t.validActions[0]}showCodeActionList(e,t,n){return Kx(this,void 0,void 0,function*(){const o=this._editor.createDecorationsCollection(),r=this._editor.getDomNode();if(!r)return;const s=n.includeDisabledActions&&(this._showDisabled||e.validActions.length===0)?e.allActions:e.validActions;if(!s.length)return;const a=ae.isIPosition(t)?this.toCoords(t):t,l={onSelect:(c,u)=>Kx(this,void 0,void 0,function*(){this._applyCodeAction(c,!0,!!u),this._actionWidgetService.hide(),o.clear()}),onHide:()=>{var c;(c=this._editor)===null||c===void 0||c.focus(),o.clear()},onHover:(c,u)=>Kx(this,void 0,void 0,function*(){var d;if(yield c.resolve(u),!u.isCancellationRequested)return{canPreview:!!(!((d=c.action.edit)===null||d===void 0)&&d.edits.length)}}),onFocus:c=>{var u,d;if(c&&c.highlightRange&&c.action.diagnostics){const h=[{range:c.action.diagnostics[0],options:wM.DECORATION}];o.set(h);const f=c.action.diagnostics[0],g=(d=(u=this._editor.getModel())===null||u===void 0?void 0:u.getWordAtPosition({lineNumber:f.startLineNumber,column:f.startColumn}))===null||d===void 0?void 0:d.word;Lv(C("editingNewSelection","Context: {0} at line {1} and column {2}.",g,f.startLineNumber,f.startColumn))}else o.clear()}};this._actionWidgetService.show("codeActionWidget",!0,G_t(s,this._shouldShowHeaders(),this._resolver.getResolver()),l,a,r,this._getActionBarActions(e,t,n))})}toCoords(e){if(!this._editor.hasModel())return{x:0,y:0};this._editor.revealPosition(e,1),this._editor.render();const t=this._editor.getScrolledVisiblePosition(e),n=Yo(this._editor.getDomNode()),o=n.left+t.left,r=n.top+t.top+t.height;return{x:o,y:r}}_shouldShowHeaders(){var e;const t=(e=this._editor)===null||e===void 0?void 0:e.getModel();return this._configurationService.getValue("editor.codeActionWidget.showHeaders",{resource:t==null?void 0:t.uri})}_getActionBarActions(e,t,n){if(n.fromLightbulb)return[];const o=e.documentation.map(r=>{var s;return{id:r.id,label:r.title,tooltip:(s=r.tooltip)!==null&&s!==void 0?s:"",class:void 0,enabled:!0,run:()=>{var a;return this._commandService.executeCommand(r.id,...(a=r.arguments)!==null&&a!==void 0?a:[])}}});return n.includeDisabledActions&&e.validActions.length>0&&e.allActions.length!==e.validActions.length&&o.push(this._showDisabled?{id:"hideMoreActions",label:C("hideMoreActions","Hide Disabled"),enabled:!0,tooltip:"",class:void 0,run:()=>(this._showDisabled=!1,this.showCodeActionList(e,t,n))}:{id:"showMoreActions",label:C("showMoreActions","Show Disabled"),enabled:!0,tooltip:"",class:void 0,run:()=>(this._showDisabled=!0,this.showCodeActionList(e,t,n))}),o}};Rv.ID="editor.contrib.codeActionController";Rv.DECORATION=Jt.register({description:"quickfix-highlight",className:u0t});Rv=wM=c0t([Jf(1,Rf),Jf(2,Ut),Jf(3,$t),Jf(4,pt),Jf(5,Jv),Jf(6,_o),Jf(7,En),Jf(8,Xb),Jf(9,$t)],Rv);Uu((i,e)=>{((o,r)=>{r&&e.addRule(`.monaco-editor ${o} { background-color: ${r}; }`)})(".quickfix-edit-highlight",i.getColor(Zh));const n=i.getColor(Sm);n&&e.addRule(`.monaco-editor .quickfix-edit-highlight { border: 1px ${Hd(i.type)?"dotted":"solid"} ${n}; box-sizing: border-box; }`)});function gT(i){return Me.regex(Awe.keys()[0],new RegExp("(\\s|^)"+Gl(i.value)+"\\b"))}const eY={type:"object",defaultSnippets:[{body:{kind:""}}],properties:{kind:{type:"string",description:C("args.schema.kind","Kind of the code action to run.")},apply:{type:"string",description:C("args.schema.apply","Controls when the returned actions are applied."),default:"ifSingle",enum:["first","ifSingle","never"],enumDescriptions:[C("args.schema.apply.first","Always apply the first returned code action."),C("args.schema.apply.ifSingle","Apply the first returned code action if it is the only one."),C("args.schema.apply.never","Do not apply the returned code actions.")]},preferred:{type:"boolean",default:!1,description:C("args.schema.preferred","Controls if only preferred code actions should be returned.")}}};function Yb(i,e,t,n,o=hl.Default){if(i.hasModel()){const r=Rv.get(i);r==null||r.manualTriggerAtCurrentPosition(e,o,t,n)}}class d0t extends ft{constructor(){super({id:ZX,label:C("quickfix.trigger.label","Quick Fix..."),alias:"Quick Fix...",precondition:Me.and(Q.writable,Q.hasCodeActionsProvider),kbOpts:{kbExpr:Q.textInputFocus,primary:2137,weight:100}})}run(e,t){return Yb(t,C("editor.action.quickFix.noneMessage","No code actions available"),void 0,void 0,hl.QuickFix)}}class h0t extends Ir{constructor(){super({id:Swe,precondition:Me.and(Q.writable,Q.hasCodeActionsProvider),description:{description:"Trigger a code action",args:[{name:"args",schema:eY}]}})}runEditorCommand(e,t,n){const o=Wh.fromUser(n,{kind:Wt.Empty,apply:"ifSingle"});return Yb(t,typeof(n==null?void 0:n.kind)=="string"?o.preferred?C("editor.action.codeAction.noneMessage.preferred.kind","No preferred code actions for '{0}' available",n.kind):C("editor.action.codeAction.noneMessage.kind","No code actions for '{0}' available",n.kind):o.preferred?C("editor.action.codeAction.noneMessage.preferred","No preferred code actions available"):C("editor.action.codeAction.noneMessage","No code actions available"),{include:o.kind,includeSourceActions:!0,onlyIncludePreferredActions:o.preferred},o.apply)}}class f0t extends ft{constructor(){super({id:Lwe,label:C("refactor.label","Refactor..."),alias:"Refactor...",precondition:Me.and(Q.writable,Q.hasCodeActionsProvider),kbOpts:{kbExpr:Q.textInputFocus,primary:3120,mac:{primary:1328},weight:100},contextMenuOpts:{group:"1_modification",order:2,when:Me.and(Q.writable,gT(Wt.Refactor))},description:{description:"Refactor...",args:[{name:"args",schema:eY}]}})}run(e,t,n){const o=Wh.fromUser(n,{kind:Wt.Refactor,apply:"never"});return Yb(t,typeof(n==null?void 0:n.kind)=="string"?o.preferred?C("editor.action.refactor.noneMessage.preferred.kind","No preferred refactorings for '{0}' available",n.kind):C("editor.action.refactor.noneMessage.kind","No refactorings for '{0}' available",n.kind):o.preferred?C("editor.action.refactor.noneMessage.preferred","No preferred refactorings available"):C("editor.action.refactor.noneMessage","No refactorings available"),{include:Wt.Refactor.contains(o.kind)?o.kind:Wt.None,onlyIncludePreferredActions:o.preferred},o.apply,hl.Refactor)}}class g0t extends ft{constructor(){super({id:Ewe,label:C("source.label","Source Action..."),alias:"Source Action...",precondition:Me.and(Q.writable,Q.hasCodeActionsProvider),contextMenuOpts:{group:"1_modification",order:2.1,when:Me.and(Q.writable,gT(Wt.Source))},description:{description:"Source Action...",args:[{name:"args",schema:eY}]}})}run(e,t,n){const o=Wh.fromUser(n,{kind:Wt.Source,apply:"never"});return Yb(t,typeof(n==null?void 0:n.kind)=="string"?o.preferred?C("editor.action.source.noneMessage.preferred.kind","No preferred source actions for '{0}' available",n.kind):C("editor.action.source.noneMessage.kind","No source actions for '{0}' available",n.kind):o.preferred?C("editor.action.source.noneMessage.preferred","No preferred source actions available"):C("editor.action.source.noneMessage","No source actions available"),{include:Wt.Source.contains(o.kind)?o.kind:Wt.None,includeSourceActions:!0,onlyIncludePreferredActions:o.preferred},o.apply,hl.SourceAction)}}class p0t extends ft{constructor(){super({id:QX,label:C("organizeImports.label","Organize Imports"),alias:"Organize Imports",precondition:Me.and(Q.writable,gT(Wt.SourceOrganizeImports)),kbOpts:{kbExpr:Q.textInputFocus,primary:1581,weight:100}})}run(e,t){return Yb(t,C("editor.action.organize.noneMessage","No organize imports action available"),{include:Wt.SourceOrganizeImports,includeSourceActions:!0},"ifSingle",hl.OrganizeImports)}}class m0t extends ft{constructor(){super({id:JX,label:C("fixAll.label","Fix All"),alias:"Fix All",precondition:Me.and(Q.writable,gT(Wt.SourceFixAll))})}run(e,t){return Yb(t,C("fixAll.noneMessage","No fix all action available"),{include:Wt.SourceFixAll,includeSourceActions:!0},"ifSingle",hl.FixAll)}}class v0t extends ft{constructor(){super({id:xwe,label:C("autoFix.label","Auto Fix..."),alias:"Auto Fix...",precondition:Me.and(Q.writable,gT(Wt.QuickFix)),kbOpts:{kbExpr:Q.textInputFocus,primary:1625,mac:{primary:2649},weight:100}})}run(e,t){return Yb(t,C("editor.action.autoFix.noneMessage","No auto fixes available"),{include:Wt.QuickFix,onlyIncludePreferredActions:!0},"ifSingle",hl.AutoFix)}}zn(Rv.ID,Rv,3);zn(db.ID,db,4);ze(d0t);ze(f0t);ze(g0t);ze(p0t);ze(v0t);ze(m0t);Ye(new h0t);no.as(ah.Configuration).registerConfiguration(Object.assign(Object.assign({},D5),{properties:{"editor.codeActionWidget.showHeaders":{type:"boolean",scope:5,description:C("showCodeActionHeaders","Enable/disable showing group headers in the Code Action menu."),default:!0}}}));no.as(ah.Configuration).registerConfiguration(Object.assign(Object.assign({},D5),{properties:{"editor.codeActionWidget.includeNearbyQuickfixes":{type:"boolean",scope:5,description:C("includeNearbyQuickfixes","Enable/disable showing nearest quickfix within a line when not currently on a diagnostic."),default:!1}}}));var Sle=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};class hz{constructor(){this.lenses=[],this._disposables=new Be}dispose(){this._disposables.dispose()}get isDisposed(){return this._disposables.isDisposed}add(e,t){this._disposables.add(e);for(const n of e.lenses)this.lenses.push({symbol:n,provider:t})}}function Owe(i,e,t){return Sle(this,void 0,void 0,function*(){const n=i.ordered(e),o=new Map,r=new hz,s=n.map((a,l)=>Sle(this,void 0,void 0,function*(){o.set(a,l);try{const c=yield Promise.resolve(a.provideCodeLenses(e,t));c&&r.add(c,a)}catch(c){$o(c)}}));return yield Promise.all(s),r.lenses=r.lenses.sort((a,l)=>a.symbol.range.startLineNumberl.symbol.range.startLineNumber?1:o.get(a.provider)o.get(l.provider)?1:a.symbol.range.startColumnl.symbol.range.startColumn?1:0),r})}Rn.registerCommand("_executeCodeLensProvider",function(i,...e){let[t,n]=e;fi(Rt.isUri(t)),fi(typeof n=="number"||!n);const{codeLensProvider:o}=i.get(pt),r=i.get(Yi).getModel(t);if(!r)throw Rc();const s=[],a=new Be;return Owe(o,r,_n.None).then(l=>{a.add(l);const c=[];for(const u of l.lenses)n==null||Boolean(u.symbol.command)?s.push(u.symbol):n-- >0&&u.provider.resolveCodeLens&&c.push(Promise.resolve(u.provider.resolveCodeLens(r,u.symbol,_n.None)).then(d=>s.push(d||u.symbol)));return Promise.all(c)}).then(()=>s).finally(()=>{setTimeout(()=>a.dispose(),100)})});var _0t=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},b0t=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const Fwe=wn("ICodeLensCache");class xle{constructor(e,t){this.lineCount=e,this.data=t}}let fz=class{constructor(e){this._fakeProvider=new class{provideCodeLenses(){throw new Error("not supported")}},this._cache=new Yv(20,.75);const t="codelens/cache";Rg(()=>e.remove(t,1));const n="codelens/cache2",o=e.get(n,1,"{}");this._deserialize(o),st.once(e.onWillSaveState)(r=>{r.reason===RP.SHUTDOWN&&e.store(n,this._serialize(),1,1)})}put(e,t){const n=t.lenses.map(s=>{var a;return{range:s.symbol.range,command:s.symbol.command&&{id:"",title:(a=s.symbol.command)===null||a===void 0?void 0:a.title}}}),o=new hz;o.add({lenses:n,dispose:()=>{}},this._fakeProvider);const r=new xle(e.getLineCount(),o);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,n]of this._cache){const o=new Set;for(const r of n.data.lenses)o.add(r.symbol.range.startLineNumber);e[t]={lineCount:n.lineCount,lines:[...o.values()]}}return JSON.stringify(e)}_deserialize(e){try{const t=JSON.parse(e);for(const n in t){const o=t[n],r=[];for(const a of o.lines)r.push({range:new V(a,1,a,11)});const s=new hz;s.add({lenses:r,dispose(){}},this._fakeProvider),this._cache.set(n,new xle(o.lineCount,s))}}catch{}}};fz=_0t([b0t(0,qu)],fz);Mn(Fwe,fz,1);class C0t{constructor(e,t,n){this.afterColumn=1073741824,this.afterLineNumber=e,this.heightInPx=t,this._onHeight=n,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")}}class aF{constructor(e,t){this.allowEditorOverflow=!1,this.suppressMouseDown=!0,this._commands=new Map,this._isEmpty=!0,this._editor=e,this._id=`codelens.widget-${aF._idPool++}`,this.updatePosition(t),this._domNode=document.createElement("span"),this._domNode.className="codelens-decoration"}withCommands(e,t){this._commands.clear();const n=[];let o=!1;for(let r=0;r{c.symbol.command&&l.push(c.symbol),n.addDecoration({range:c.symbol.range,options:Lle},d=>this._decorationIds[u]=d),a?a=V.plusRange(a,c.symbol.range):a=V.lift(c.symbol.range)}),this._viewZone=new C0t(a.startLineNumber-1,r,s),this._viewZoneId=o.addZone(this._viewZone),l.length>0&&(this._createContentWidgetIfNecessary(),this._contentWidget.withCommands(l,!1))}_createContentWidgetIfNecessary(){this._contentWidget?this._editor.layoutContentWidget(this._contentWidget):(this._contentWidget=new aF(this._editor,this._viewZone.afterLineNumber+1),this._editor.addContentWidget(this._contentWidget))}dispose(e,t){this._decorationIds.forEach(e.removeDecoration,e),this._decorationIds=[],t==null||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 n=this._editor.getModel().getDecorationRange(e),o=this._data[t].symbol;return!!(n&&V.isEmpty(o.range)===n.isEmpty())})}updateCodeLensSymbols(e,t){this._decorationIds.forEach(t.removeDecoration,t),this._decorationIds=[],this._data=e,this._data.forEach((n,o)=>{t.addDecoration({range:n.symbol.range,options:Lle},r=>this._decorationIds[o]=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;t=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},qx=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},Bwe=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};let Wy=class{constructor(e,t,n,o,r,s){this._editor=e,this._languageFeaturesService=t,this._commandService=o,this._notificationService=r,this._codeLensCache=s,this._disposables=new Be,this._localToDispose=new Be,this._lenses=[],this._oldCodeLensModels=new Be,this._provideCodeLensDebounce=n.for(t.codeLensProvider,"CodeLensProvide",{min:250}),this._resolveCodeLensesDebounce=n.for(t.codeLensProvider,"CodeLensResolve",{min:250,salt:"resolve"}),this._resolveCodeLensesScheduler=new bi(()=>this._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(50)||a.hasChanged(19)||a.hasChanged(18))&&this._updateLensStyle(),a.hasChanged(17)&&this._onModelChange()})),this._disposables.add(t.codeLensProvider.onDidChange(this._onModelChange,this)),this._onModelChange(),this._updateLensStyle()}dispose(){var e;this._localDispose(),this._disposables.dispose(),this._oldCodeLensModels.dispose(),(e=this._currentCodeLensModel)===null||e===void 0||e.dispose()}_getLayoutInfo(){const e=Math.max(1.3,this._editor.getOption(66)/this._editor.getOption(52));let t=this._editor.getOption(19);return(!t||t<5)&&(t=this._editor.getOption(52)*.9|0),{fontSize:t,codeLensHeight:t*e|0}}_updateLensStyle(){const{codeLensHeight:e,fontSize:t}=this._getLayoutInfo(),n=this._editor.getOption(18),o=this._editor.getOption(50),{style:r}=this._editor.getContainerDomNode();r.setProperty("--vscode-editorCodeLens-lineHeight",`${e}px`),r.setProperty("--vscode-editorCodeLens-fontSize",`${t}px`),r.setProperty("--vscode-editorCodeLens-fontFeatureSettings",o.fontFeatureSettings),n&&(r.setProperty("--vscode-editorCodeLens-fontFamily",n),r.setProperty("--vscode-editorCodeLens-fontFamilyDefault",sl.fontFamily)),this._editor.changeViewZones(s=>{for(const a of this._lenses)a.updateHeight(e,s)})}_localDispose(){var e,t,n;(e=this._getCodeLensModelPromise)===null||e===void 0||e.cancel(),this._getCodeLensModelPromise=void 0,(t=this._resolveCodeLensesPromise)===null||t===void 0||t.cancel(),this._resolveCodeLensesPromise=void 0,this._localToDispose.clear(),this._oldCodeLensModels.clear(),(n=this._currentCodeLensModel)===null||n===void 0||n.dispose()}_onModelChange(){this._localDispose();const e=this._editor.getModel();if(!e||!this._editor.getOption(17)||e.isTooLargeForTokenization())return;const t=this._codeLensCache.get(e);if(t&&this._renderCodeLensSymbols(t),!this._languageFeaturesService.codeLensProvider.has(e)){t&&this._localToDispose.add(yv(()=>{const o=this._codeLensCache.get(e);t===o&&(this._codeLensCache.delete(e),this._onModelChange())},30*1e3));return}for(const o of this._languageFeaturesService.codeLensProvider.all(e))if(typeof o.onDidChange=="function"){const r=o.onDidChange(()=>n.schedule());this._localToDispose.add(r)}const n=new bi(()=>{var o;const r=Date.now();(o=this._getCodeLensModelPromise)===null||o===void 0||o.cancel(),this._getCodeLensModelPromise=sr(s=>Owe(this._languageFeaturesService.codeLensProvider,e,s)),this._getCodeLensModelPromise.then(s=>{this._currentCodeLensModel&&this._oldCodeLensModels.add(this._currentCodeLensModel),this._currentCodeLensModel=s,this._codeLensCache.put(e,s);const a=this._provideCodeLensDebounce.update(e,Date.now()-r);n.delay=a,this._renderCodeLensSymbols(s),this._resolveCodeLensesInViewportSoon()},en)},this._provideCodeLensDebounce.get(e));this._localToDispose.add(n),this._localToDispose.add(zt(()=>this._resolveCodeLensesScheduler.cancel())),this._localToDispose.add(this._editor.onDidChangeModelContent(()=>{var o;this._editor.changeDecorations(r=>{this._editor.changeViewZones(s=>{const a=[];let l=-1;this._lenses.forEach(u=>{!u.isValid()||l===u.getLineNumber()?a.push(u):(u.update(s),l=u.getLineNumber())});const c=new J9;a.forEach(u=>{u.dispose(c,s),this._lenses.splice(this._lenses.indexOf(u),1)}),c.commit(r)})}),n.schedule(),this._resolveCodeLensesScheduler.cancel(),(o=this._resolveCodeLensesPromise)===null||o===void 0||o.cancel(),this._resolveCodeLensesPromise=void 0})),this._localToDispose.add(this._editor.onDidFocusEditorWidget(()=>{n.schedule()})),this._localToDispose.add(this._editor.onDidBlurEditorText(()=>{n.cancel()})),this._localToDispose.add(this._editor.onDidScrollChange(o=>{o.scrollTopChanged&&this._lenses.length>0&&this._resolveCodeLensesInViewportSoon()})),this._localToDispose.add(this._editor.onDidLayoutChange(()=>{this._resolveCodeLensesInViewportSoon()})),this._localToDispose.add(zt(()=>{if(this._editor.getModel()){const o=Yd.capture(this._editor);this._editor.changeDecorations(r=>{this._editor.changeViewZones(s=>{this._disposeAllLenses(r,s)})}),o.restore(this._editor)}else this._disposeAllLenses(void 0,void 0)})),this._localToDispose.add(this._editor.onMouseDown(o=>{if(o.target.type!==9)return;let r=o.target.element;if((r==null?void 0:r.tagName)==="SPAN"&&(r=r.parentElement),(r==null?void 0:r.tagName)==="A")for(const s of this._lenses){const a=s.getCommand(r);if(a){this._commandService.executeCommand(a.id,...a.arguments||[]).catch(l=>this._notificationService.error(l));break}}})),n.schedule()}_disposeAllLenses(e,t){const n=new J9;for(const o of this._lenses)o.dispose(n,t);e&&n.commit(e),this._lenses.length=0}_renderCodeLensSymbols(e){if(!this._editor.hasModel())return;const t=this._editor.getModel().getLineCount(),n=[];let o;for(const a of e.lenses){const l=a.symbol.range.startLineNumber;l<1||l>t||(o&&o[o.length-1].symbol.range.startLineNumber===l?o.push(a):(o=[a],n.push(o)))}if(!n.length&&!this._lenses.length)return;const r=Yd.capture(this._editor),s=this._getLayoutInfo();this._editor.changeDecorations(a=>{this._editor.changeViewZones(l=>{const c=new J9;let u=0,d=0;for(;dthis._resolveCodeLensesInViewportSoon())),u++,d++)}for(;uthis._resolveCodeLensesInViewportSoon())),d++;c.commit(a)})}),r.restore(this._editor)}_resolveCodeLensesInViewportSoon(){this._editor.getModel()&&this._resolveCodeLensesScheduler.schedule()}_resolveCodeLensesInViewport(){var e;(e=this._resolveCodeLensesPromise)===null||e===void 0||e.cancel(),this._resolveCodeLensesPromise=void 0;const t=this._editor.getModel();if(!t)return;const n=[],o=[];if(this._lenses.forEach(a=>{const l=a.computeIfNecessary(t);l&&(n.push(l),o.push(a))}),n.length===0)return;const r=Date.now(),s=sr(a=>{const l=n.map((c,u)=>{const d=new Array(c.length),h=c.map((f,g)=>!f.symbol.command&&typeof f.provider.resolveCodeLens=="function"?Promise.resolve(f.provider.resolveCodeLens(t,f.symbol,a)).then(p=>{d[g]=p},$o):(d[g]=f.symbol,Promise.resolve(void 0)));return Promise.all(h).then(()=>{!a.isCancellationRequested&&!o[u].isDisposed()&&o[u].updateCommands(d)})});return Promise.all(l)});this._resolveCodeLensesPromise=s,this._resolveCodeLensesPromise.then(()=>{const a=this._resolveCodeLensesDebounce.update(t,Date.now()-r);this._resolveCodeLensesScheduler.delay=a,this._currentCodeLensModel&&this._codeLensCache.put(t,this._currentCodeLensModel),this._oldCodeLensModels.clear(),s===this._resolveCodeLensesPromise&&(this._resolveCodeLensesPromise=void 0)},a=>{en(a),s===this._resolveCodeLensesPromise&&(this._resolveCodeLensesPromise=void 0)})}getModel(){var e;return Bwe(this,void 0,void 0,function*(){return yield this._getCodeLensModelPromise,yield this._resolveCodeLensesPromise,!((e=this._currentCodeLensModel)===null||e===void 0)&&e.isDisposed?void 0:this._currentCodeLensModel})}};Wy.ID="css.editor.codeLens";Wy=w0t([qx(1,pt),qx(2,Kc),qx(3,_o),qx(4,Ao),qx(5,Fwe)],Wy);zn(Wy.ID,Wy,1);ze(class extends ft{constructor(){super({id:"codelens.showLensesInCurrentLine",precondition:Q.hasCodeLensProvider,label:C("showLensOnLine","Show CodeLens Commands For Current Line"),alias:"Show CodeLens Commands For Current Line"})}run(e,t){return Bwe(this,void 0,void 0,function*(){if(!t.hasModel())return;const n=e.get(lh),o=e.get(_o),r=e.get(Ao),s=t.getSelection().positionLineNumber,a=t.getContribution(Wy.ID);if(!a)return;const l=yield a.getModel();if(!l)return;const c=[];for(const h of l.lenses)h.symbol.command&&h.symbol.range.startLineNumber===s&&c.push({label:h.symbol.command.title,command:h.symbol.command});if(c.length===0)return;const u=yield n.pick(c,{canPickMany:!1,placeHolder:C("placeHolder","Select a command")});if(!u)return;let d=u.command;if(l.isDisposed){const h=yield a.getModel(),f=h==null?void 0:h.lenses.find(g=>{var p;return g.symbol.range.startLineNumber===s&&((p=g.symbol.command)===null||p===void 0?void 0:p.title)===d.title});if(!f||!f.symbol.command)return;d=f.symbol.command}try{yield o.executeCommand(d.id,...d.arguments||[])}catch(h){r.error(h)}})}});var y0t=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},e7=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},S0t=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};class tY{constructor(e,t){this._editorWorkerClient=new aG(e,!1,"editorWorkerService",t)}provideDocumentColors(e,t){return S0t(this,void 0,void 0,function*(){return this._editorWorkerClient.computeDefaultDocumentColors(e.uri)})}provideColorPresentations(e,t,n){const o=t.range,r=t.color,s=r.alpha,a=new ve(new Tn(Math.round(255*r.red),Math.round(255*r.green),Math.round(255*r.blue),s)),l=s?ve.Format.CSS.formatRGB(a):ve.Format.CSS.formatRGBA(a),c=s?ve.Format.CSS.formatHSL(a):ve.Format.CSS.formatHSLA(a),u=s?ve.Format.CSS.formatHex(a):ve.Format.CSS.formatHexA(a),d=[];return d.push({label:l,textEdit:{range:o,text:l}}),d.push({label:c,textEdit:{range:o,text:c}}),d.push({label:u,textEdit:{range:o,text:u}}),d}}let gz=class extends _e{constructor(e,t,n){super(),this._register(n.colorProvider.register("*",new tY(e,t)))}};gz=y0t([e7(0,Yi),e7(1,Ti),e7(2,pt)],gz);q5(gz);var pT=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};function Wwe(i,e,t,n=!0){return pT(this,void 0,void 0,function*(){return nY(new x0t,i,e,t,n)})}function Vwe(i,e,t,n){return Promise.resolve(t.provideColorPresentations(i,e,n))}class x0t{constructor(){}compute(e,t,n,o){return pT(this,void 0,void 0,function*(){const r=yield e.provideDocumentColors(t,n);if(Array.isArray(r))for(const s of r)o.push({colorInfo:s,provider:e});return Array.isArray(r)})}}class L0t{constructor(){}compute(e,t,n,o){return pT(this,void 0,void 0,function*(){const r=yield e.provideDocumentColors(t,n);if(Array.isArray(r))for(const s of r)o.push({range:s.range,color:[s.color.red,s.color.green,s.color.blue,s.color.alpha]});return Array.isArray(r)})}}class E0t{constructor(e){this.colorInfo=e}compute(e,t,n,o){return pT(this,void 0,void 0,function*(){const r=yield e.provideColorPresentations(t,this.colorInfo,_n.None);return Array.isArray(r)&&o.push(...r),Array.isArray(r)})}}function nY(i,e,t,n,o){return pT(this,void 0,void 0,function*(){let r=!1,s;const a=[],l=e.ordered(t);for(let c=l.length-1;c>=0;c--){const u=l[c];if(u instanceof tY)s=u;else try{(yield i.compute(u,t,n,a))&&(r=!0)}catch(d){$o(d)}}return r?a:s&&o?(yield i.compute(s,t,n,a),a):[]})}function Hwe(i,e){const{colorProvider:t}=i.get(pt),n=i.get(Yi).getModel(e);if(!n)throw Rc();const o=i.get(En).getValue("editor.defaultColorDecorators",{resource:e});return{model:n,colorProviderRegistry:t,isDefaultColorDecoratorsEnabled:o}}Rn.registerCommand("_executeDocumentColorProvider",function(i,...e){const[t]=e;if(!(t instanceof Rt))throw Rc();const{model:n,colorProviderRegistry:o,isDefaultColorDecoratorsEnabled:r}=Hwe(i,t);return nY(new L0t,o,n,_n.None,r)});Rn.registerCommand("_executeColorPresentationProvider",function(i,...e){const[t,n]=e,{uri:o,range:r}=n;if(!(o instanceof Rt)||!Array.isArray(t)||t.length!==4||!V.isIRange(r))throw Rc();const{model:s,colorProviderRegistry:a,isDefaultColorDecoratorsEnabled:l}=Hwe(i,o),[c,u,d,h]=t;return nY(new E0t({range:r,color:{red:c,green:u,blue:d,alpha:h}}),a,s,_n.None,l)});var D0t=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},t7=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},Dle=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},pz;const $we=Object.create({});let Mv=pz=class extends _e{constructor(e,t,n,o){super(),this._editor=e,this._configurationService=t,this._languageFeaturesService=n,this._localToDispose=this._register(new Be),this._decorationsIds=[],this._colorDatas=new Map,this._colorDecoratorIds=this._editor.createDecorationsCollection(),this._ruleFactory=new jI(this._editor),this._decoratorLimitReporter=new k0t,this._colorDecorationClassRefs=this._register(new Be),this._debounceInformation=o.for(n.colorProvider,"Document Colors",{min:pz.RECOMPUTE_TIME}),this._register(e.onDidChangeModel(()=>{this._isColorDecoratorsEnabled=this.isEnabled(),this.updateColors()})),this._register(e.onDidChangeModelLanguage(()=>this.updateColors())),this._register(n.colorProvider.onDidChange(()=>this.updateColors())),this._register(e.onDidChangeConfiguration(r=>{const s=this._isColorDecoratorsEnabled;this._isColorDecoratorsEnabled=this.isEnabled(),this._isDefaultColorDecoratorsEnabled=this._editor.getOption(145);const a=s!==this._isColorDecoratorsEnabled||r.hasChanged(21),l=r.hasChanged(145);(a||l)&&(this._isColorDecoratorsEnabled?this.updateColors():this.removeAllDecorations())})),this._timeoutTimer=null,this._computePromise=null,this._isColorDecoratorsEnabled=this.isEnabled(),this._isDefaultColorDecoratorsEnabled=this._editor.getOption(145),this.updateColors()}isEnabled(){const e=this._editor.getModel();if(!e)return!1;const t=e.getLanguageId(),n=this._configurationService.getValue(t);if(n&&typeof n=="object"){const o=n.colorDecorators;if(o&&o.enable!==void 0&&!o.enable)return o.enable}return this._editor.getOption(20)}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 $u,this._timeoutTimer.cancelAndSet(()=>{this._timeoutTimer=null,this.beginCompute()},this._debounceInformation.get(e)))})),this.beginCompute())}beginCompute(){return Dle(this,void 0,void 0,function*(){this._computePromise=sr(e=>Dle(this,void 0,void 0,function*(){const t=this._editor.getModel();if(!t)return[];const n=new xs(!1),o=yield Wwe(this._languageFeaturesService.colorProvider,t,e,this._isDefaultColorDecoratorsEnabled);return this._debounceInformation.update(t,n.elapsed()),o}));try{const e=yield this._computePromise;this.updateDecorations(e),this.updateColorDecorators(e),this._computePromise=null}catch(e){en(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(n=>({range:{startLineNumber:n.colorInfo.range.startLineNumber,startColumn:n.colorInfo.range.startColumn,endLineNumber:n.colorInfo.range.endLineNumber,endColumn:n.colorInfo.range.endColumn},options:Jt.EMPTY}));this._editor.changeDecorations(n=>{this._decorationsIds=n.deltaDecorations(this._decorationsIds,t),this._colorDatas=new Map,this._decorationsIds.forEach((o,r)=>this._colorDatas.set(o,e[r]))})}updateColorDecorators(e){this._colorDecorationClassRefs.clear();const t=[],n=this._editor.getOption(21);for(let r=0;rthis._colorDatas.has(o.id));return n.length===0?null:this._colorDatas.get(n[0].id)}isColorDecoration(e){return this._colorDecoratorIds.has(e)}};Mv.ID="editor.contrib.colorDetector";Mv.RECOMPUTE_TIME=1e3;Mv=pz=D0t([t7(1,En),t7(2,pt),t7(3,Kc)],Mv);class k0t{constructor(){this._onDidChange=new le,this._computed=0,this._limited=!1}update(e,t){(e!==this._computed||t!==this._limited)&&(this._computed=e,this._limited=t,this._onDidChange.fire())}}zn(Mv.ID,Mv,1);class I0t{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,n){this.presentationIndex=n,this._onColorFlushed=new le,this.onColorFlushed=this._onColorFlushed.event,this._onDidChangeColor=new le,this.onDidChangeColor=this._onDidChangeColor.event,this._onDidChangePresentation=new le,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 n=-1;for(let o=0;o{this.backgroundColor=s.getColor(iP)||ve.white})),this._register(ke(this._pickedColorNode,et.CLICK,()=>this.model.selectNextColorPresentation())),this._register(ke(this._originalColorNode,et.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=ve.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 N0t(this._domNode)))}get closeButton(){return this._closeButton}get pickedColorNode(){return this._pickedColorNode}get originalColorNode(){return this._originalColorNode}onDidChangeColor(e){this._pickedColorNode.style.backgroundColor=ve.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 N0t extends _e{constructor(e){super(),this._onClicked=this._register(new le),this.onClicked=this._onClicked.event,this._button=document.createElement("div"),this._button.classList.add("close-button"),Ae(e,this._button);const t=document.createElement("div");t.classList.add("close-button-inner-div"),Ae(this._button,t),Ae(t,Fl(".button"+Mt.asCSSSelector(Eo("color-picker-close",Xe.close,C("closeIcon","Icon to close the color picker"))))).classList.add("close-icon"),this._button.onclick=()=>{this._onClicked.fire()}}}class R0t extends _e{constructor(e,t,n,o=!1){super(),this.model=t,this.pixelRatio=n,this._insertButton=null,this._domNode=Fl(".colorpicker-body"),Ae(e,this._domNode),this._saturationBox=new M0t(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 A0t(this._domNode,this.model,o),this._register(this._opacityStrip),this._register(this._opacityStrip.onDidChange(this.onDidOpacityChange,this)),this._register(this._opacityStrip.onColorFlushed(this.flushColor,this)),this._hueStrip=new P0t(this._domNode,this.model,o),this._register(this._hueStrip),this._register(this._hueStrip.onDidChange(this.onDidHueChange,this)),this._register(this._hueStrip.onColorFlushed(this.flushColor,this)),o&&(this._insertButton=this._register(new O0t(this._domNode)),this._domNode.classList.add("standalone-colorpicker"))}flushColor(){this.model.flushColor()}onDidSaturationValueChange({s:e,v:t}){const n=this.model.color.hsva;this.model.color=new ve(new jh(n.h,e,t,n.a))}onDidOpacityChange(e){const t=this.model.color.hsva;this.model.color=new ve(new jh(t.h,t.s,t.v,e))}onDidHueChange(e){const t=this.model.color.hsva,n=(1-e)*360;this.model.color=new ve(new jh(n===360?0:n,t.s,t.v,t.a))}get domNode(){return this._domNode}get saturationBox(){return this._saturationBox}get enterButton(){return this._insertButton}layout(){this._saturationBox.layout(),this._opacityStrip.layout(),this._hueStrip.layout()}}class M0t extends _e{constructor(e,t,n){super(),this.model=t,this.pixelRatio=n,this._onDidChange=new le,this.onDidChange=this._onDidChange.event,this._onColorFlushed=new le,this.onColorFlushed=this._onColorFlushed.event,this._domNode=Fl(".saturation-wrap"),Ae(e,this._domNode),this._canvas=document.createElement("canvas"),this._canvas.className="saturation-box",Ae(this._domNode,this._canvas),this.selection=Fl(".saturation-selection"),Ae(this._domNode,this.selection),this.layout(),this._register(ke(this._domNode,et.POINTER_DOWN,o=>this.onPointerDown(o))),this._register(this.model.onDidChangeColor(this.onDidChangeColor,this)),this.monitor=null}get domNode(){return this._domNode}onPointerDown(e){if(!e.target||!(e.target instanceof Element))return;this.monitor=this._register(new CS);const t=Yo(this._domNode);e.target!==this.selection&&this.onDidChangePosition(e.offsetX,e.offsetY),this.monitor.startMonitoring(e.target,e.pointerId,e.buttons,o=>this.onDidChangePosition(o.pageX-t.left,o.pageY-t.top),()=>null);const n=ke(e.target.ownerDocument,et.POINTER_UP,()=>{this._onColorFlushed.fire(),n.dispose(),this.monitor&&(this.monitor.stopMonitoring(!0),this.monitor=null)},!0)}onDidChangePosition(e,t){const n=Math.max(0,Math.min(1,e/this.width)),o=Math.max(0,Math.min(1,1-t/this.height));this.paintSelection(n,o),this._onDidChange.fire({s:n,v:o})}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 ve(new jh(e.h,1,1,1)),n=this._canvas.getContext("2d"),o=n.createLinearGradient(0,0,this._canvas.width,0);o.addColorStop(0,"rgba(255, 255, 255, 1)"),o.addColorStop(.5,"rgba(255, 255, 255, 0.5)"),o.addColorStop(1,"rgba(255, 255, 255, 0)");const r=n.createLinearGradient(0,0,0,this._canvas.height);r.addColorStop(0,"rgba(0, 0, 0, 0)"),r.addColorStop(1,"rgba(0, 0, 0, 1)"),n.rect(0,0,this._canvas.width,this._canvas.height),n.fillStyle=ve.Format.CSS.format(t),n.fill(),n.fillStyle=o,n.fill(),n.fillStyle=r,n.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 zwe extends _e{constructor(e,t,n=!1){super(),this.model=t,this._onDidChange=new le,this.onDidChange=this._onDidChange.event,this._onColorFlushed=new le,this.onColorFlushed=this._onColorFlushed.event,n?(this.domNode=Ae(e,Fl(".standalone-strip")),this.overlay=Ae(this.domNode,Fl(".standalone-overlay"))):(this.domNode=Ae(e,Fl(".strip")),this.overlay=Ae(this.domNode,Fl(".overlay"))),this.slider=Ae(this.domNode,Fl(".slider")),this.slider.style.top="0px",this._register(ke(this.domNode,et.POINTER_DOWN,o=>this.onPointerDown(o))),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 CS),n=Yo(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-n.top),()=>null);const o=ke(e.target.ownerDocument,et.POINTER_UP,()=>{this._onColorFlushed.fire(),o.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 A0t extends zwe{constructor(e,t,n=!1){super(e,t,n),this.domNode.classList.add("opacity-strip"),this.onDidChangeColor(this.model.color)}onDidChangeColor(e){super.onDidChangeColor(e);const{r:t,g:n,b:o}=e.rgba,r=new ve(new Tn(t,n,o,1)),s=new ve(new Tn(t,n,o,0));this.overlay.style.background=`linear-gradient(to bottom, ${r} 0%, ${s} 100%)`}getValue(e){return e.hsva.a}}class P0t extends zwe{constructor(e,t,n=!1){super(e,t,n),this.domNode.classList.add("hue-strip")}getValue(e){return 1-e.hsva.h/360}}class O0t extends _e{constructor(e){super(),this._onClicked=this._register(new le),this.onClicked=this._onClicked.event,this._button=Ae(e,document.createElement("button")),this._button.classList.add("insert-button"),this._button.textContent="Insert",this._button.onclick=t=>{this._onClicked.fire()}}get button(){return this._button}}class F0t extends zu{constructor(e,t,n,o,r=!1){super(),this.model=t,this.pixelRatio=n,this._register(MD.onDidChange(()=>this.layout()));const s=Fl(".colorpicker-widget");e.appendChild(s),this.header=this._register(new T0t(s,this.model,o,r)),this.body=this._register(new R0t(s,this.model,this.pixelRatio,r))}layout(){this.body.layout()}}var Uwe=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},jwe=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},Vy=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};class B0t{constructor(e,t,n,o){this.owner=e,this.range=t,this.model=n,this.provider=o,this.forceShowAtRange=!0}isValidForHoverAnchor(e){return e.type===1&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}let aO=class{constructor(e,t){this._editor=e,this._themeService=t,this.hoverOrdinal=2}computeSync(e,t){return[]}computeAsync(e,t,n){return Wo.fromPromise(this._computeAsync(e,t,n))}_computeAsync(e,t,n){return Vy(this,void 0,void 0,function*(){if(!this._editor.hasModel())return[];const o=Mv.get(this._editor);if(!o)return[];for(const r of t){if(!o.isColorDecoration(r))continue;const s=o.getColorData(r.range.getStartPosition());if(s)return[yield Kwe(this,this._editor.getModel(),s.colorInfo,s.provider)]}return[]})}renderHoverParts(e,t){return qwe(this,this._editor,this._themeService,t,e)}};aO=Uwe([jwe(1,mr)],aO);class W0t{constructor(e,t,n,o){this.owner=e,this.range=t,this.model=n,this.provider=o}}let Mk=class{constructor(e,t){this._editor=e,this._themeService=t,this._color=null}createColorHover(e,t,n){return Vy(this,void 0,void 0,function*(){if(!this._editor.hasModel()||!Mv.get(this._editor))return null;const r=yield Wwe(n,this._editor.getModel(),_n.None);let s=null,a=null;for(const d of r){const h=d.colorInfo;V.containsRange(h.range,e.range)&&(s=h,a=d.provider)}const l=s!=null?s:e,c=a!=null?a:t,u=!!s;return{colorHover:yield Kwe(this,this._editor.getModel(),l,c),foundInEditor:u}})}updateEditorModel(e){return Vy(this,void 0,void 0,function*(){if(!this._editor.hasModel())return;const t=e.model;let n=new V(e.range.startLineNumber,e.range.startColumn,e.range.endLineNumber,e.range.endColumn);this._color&&(yield yM(this._editor.getModel(),t,this._color,n,e),n=Gwe(this._editor,n,t))})}renderHoverParts(e,t){return qwe(this,this._editor,this._themeService,t,e)}set color(e){this._color=e}get color(){return this._color}};Mk=Uwe([jwe(1,mr)],Mk);function Kwe(i,e,t,n){return Vy(this,void 0,void 0,function*(){const o=e.getValueInRange(t.range),{red:r,green:s,blue:a,alpha:l}=t.color,c=new Tn(Math.round(r*255),Math.round(s*255),Math.round(a*255),l),u=new ve(c),d=yield Vwe(e,t,n,_n.None),h=new I0t(u,[],0);return h.colorPresentations=d||[],h.guessColorPresentation(u,o),i instanceof aO?new B0t(i,V.lift(t.range),h,n):new W0t(i,V.lift(t.range),h,n)})}function qwe(i,e,t,n,o){if(n.length===0||!e.hasModel())return _e.None;if(o.setMinimumDimensions){const h=e.getOption(66)+8;o.setMinimumDimensions(new jn(302,h))}const r=new Be,s=n[0],a=e.getModel(),l=s.model,c=r.add(new F0t(o.fragment,l,e.getOption(141),t,i instanceof Mk));o.setColorPicker(c);let u=!1,d=new V(s.range.startLineNumber,s.range.startColumn,s.range.endLineNumber,s.range.endColumn);if(i instanceof Mk){const h=n[0].model.color;i.color=h,yM(a,l,h,d,s),r.add(l.onColorFlushed(f=>{i.color=f}))}else r.add(l.onColorFlushed(h=>Vy(this,void 0,void 0,function*(){yield yM(a,l,h,d,s),u=!0,d=Gwe(e,d,l,o)})));return r.add(l.onDidChangeColor(h=>{yM(a,l,h,d,s)})),r.add(e.onDidChangeModelContent(h=>{u?u=!1:(o.hide(),e.focus())})),r}function Gwe(i,e,t,n){let o,r;if(t.presentation.textEdit){o=[t.presentation.textEdit],r=new V(t.presentation.textEdit.range.startLineNumber,t.presentation.textEdit.range.startColumn,t.presentation.textEdit.range.endLineNumber,t.presentation.textEdit.range.endColumn);const s=i.getModel()._setTrackedRange(null,r,3);i.pushUndoStop(),i.executeEdits("colorpicker",o),r=i.getModel()._getTrackedRange(s)||r}else o=[{range:e,text:t.presentation.label,forceMoveMarkers:!1}],r=e.setEndPosition(e.endLineNumber,e.startColumn+t.presentation.label.length),i.pushUndoStop(),i.executeEdits("colorpicker",o);return t.presentation.additionalTextEdits&&(o=[...t.presentation.additionalTextEdits],i.executeEdits("colorpicker",o),n&&n.hide()),i.pushUndoStop(),r}function yM(i,e,t,n,o){return Vy(this,void 0,void 0,function*(){const r=yield Vwe(i,{range:n,color:{red:t.rgba.r/255,green:t.rgba.g/255,blue:t.rgba.b/255,alpha:t.rgba.a}},o.provider,_n.None);e.colorPresentations=r||[]})}function mz(i,e){return!!i[e]}class n7{constructor(e,t){this.target=e.target,this.isLeftClick=e.event.leftButton,this.isMiddleClick=e.event.middleButton,this.isRightClick=e.event.rightButton,this.hasTriggerModifier=mz(e.event,t.triggerModifier),this.hasSideBySideModifier=mz(e.event,t.triggerSideBySideModifier),this.isNoneOrSingleMouseDown=e.event.detail<=1}}class kle{constructor(e,t){this.keyCodeIsTriggerKey=e.keyCode===t.triggerKey,this.keyCodeIsSideBySideKey=e.keyCode===t.triggerSideBySideKey,this.hasTriggerModifier=mz(e,t.triggerModifier)}}class H2{constructor(e,t,n,o){this.triggerKey=e,this.triggerModifier=t,this.triggerSideBySideKey=n,this.triggerSideBySideModifier=o}equals(e){return this.triggerKey===e.triggerKey&&this.triggerModifier===e.triggerModifier&&this.triggerSideBySideKey===e.triggerSideBySideKey&&this.triggerSideBySideModifier===e.triggerSideBySideModifier}}function Ile(i){return i==="altKey"?Nn?new H2(57,"metaKey",6,"altKey"):new H2(5,"ctrlKey",6,"altKey"):Nn?new H2(6,"altKey",57,"metaKey"):new H2(6,"altKey",5,"ctrlKey")}class lF extends _e{constructor(e,t){var n;super(),this._onMouseMoveOrRelevantKeyDown=this._register(new le),this.onMouseMoveOrRelevantKeyDown=this._onMouseMoveOrRelevantKeyDown.event,this._onExecute=this._register(new le),this.onExecute=this._onExecute.event,this._onCancel=this._register(new le),this.onCancel=this._onCancel.event,this._editor=e,this._extractLineNumberFromMouseEvent=(n=t==null?void 0:t.extractLineNumberFromMouseEvent)!==null&&n!==void 0?n:o=>o.target.position?o.target.position.lineNumber:0,this._opts=Ile(this._editor.getOption(77)),this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._lineNumberOnMouseDown=0,this._register(this._editor.onDidChangeConfiguration(o=>{if(o.hasChanged(77)){const r=Ile(this._editor.getOption(77));if(this._opts.equals(r))return;this._opts=r,this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._lineNumberOnMouseDown=0,this._onCancel.fire()}})),this._register(this._editor.onMouseMove(o=>this._onEditorMouseMove(new n7(o,this._opts)))),this._register(this._editor.onMouseDown(o=>this._onEditorMouseDown(new n7(o,this._opts)))),this._register(this._editor.onMouseUp(o=>this._onEditorMouseUp(new n7(o,this._opts)))),this._register(this._editor.onKeyDown(o=>this._onEditorKeyDown(new kle(o,this._opts)))),this._register(this._editor.onKeyUp(o=>this._onEditorKeyUp(new kle(o,this._opts)))),this._register(this._editor.onMouseDrag(()=>this._resetHandler())),this._register(this._editor.onDidChangeCursorSelection(o=>this._onDidChangeCursorSelection(o))),this._register(this._editor.onDidChangeModel(o=>this._resetHandler())),this._register(this._editor.onDidChangeModelContent(()=>this._resetHandler())),this._register(this._editor.onDidScrollChange(o=>{(o.scrollTopChanged||o.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()}}var V0t=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},eg=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let Av=class extends ky{constructor(e,t,n,o,r,s,a,l,c,u,d,h,f){super(e,Object.assign(Object.assign({},o.getRawOptions()),{overflowWidgetsDomNode:o.getOverflowWidgetsDomNode()}),n,r,s,a,l,c,u,d,h,f),this._parentEditor=o,this._overwriteOptions=t,super.updateOptions(this._overwriteOptions),this._register(o.onDidChangeConfiguration(g=>this._onParentConfigurationChanged(g)))}getParentEditor(){return this._parentEditor}_onParentConfigurationChanged(e){super.updateOptions(this._parentEditor.getRawOptions()),super.updateOptions(this._overwriteOptions)}updateOptions(e){B4(this._overwriteOptions,e,!0),super.updateOptions(this._overwriteOptions)}};Av=V0t([eg(4,$t),eg(5,Jn),eg(6,_o),eg(7,Ut),eg(8,mr),eg(9,Ao),eg(10,pp),eg(11,Ti),eg(12,pt)],Av);const Tle=new ve(new Tn(0,122,204)),H0t={showArrow:!0,showFrame:!0,className:"",frameColor:Tle,arrowColor:Tle,keepEditorSelection:!1},$0t="vs.editor.contrib.zoneWidget";class z0t{constructor(e,t,n,o,r,s,a,l){this.id="",this.domNode=e,this.afterLineNumber=t,this.afterColumn=n,this.heightInLines=o,this.showInHiddenAreas=a,this.ordinal=l,this._onDomNodeTop=r,this._onComputedHeight=s}onDomNodeTop(e){this._onDomNodeTop(e)}onComputedHeight(e){this._onComputedHeight(e)}}class U0t{constructor(e,t){this._id=e,this._domNode=t}getId(){return this._id}getDomNode(){return this._domNode}getPosition(){return null}}class cF{constructor(e){this._editor=e,this._ruleName=cF._IdGenerator.nextId(),this._decorations=this._editor.createDecorationsCollection(),this._color=null,this._height=-1}dispose(){this.hide(),woe(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(){woe(this._ruleName),UV(`.monaco-editor ${this._ruleName}`,`border-style: solid; border-color: transparent; border-bottom-color: ${this._color}; border-width: ${this._height}px; bottom: -${this._height}px; margin-left: -${this._height}px; `)}show(e){e.column===1&&(e={lineNumber:e.lineNumber,column:2}),this._decorations.set([{range:V.fromPositions(e),options:{description:"zone-widget-arrow",className:this._ruleName,stickiness:1}}])}hide(){this._decorations.clear()}}cF._IdGenerator=new lX(".arrow-decoration-");class j0t{constructor(e,t={}){this._arrow=null,this._overlayWidget=null,this._resizeSash=null,this._viewZone=null,this._disposables=new Be,this.container=null,this._isShowing=!1,this.editor=e,this._positionMarkerId=this.editor.createDecorationsCollection(),this.options=hg(t),B4(this.options,H0t,!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(n=>{const o=this._getWidth(n);this.domNode.style.width=o+"px",this.domNode.style.left=this._getLeft(n)+"px",this._onWidth(o)}))}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 cF(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){var t;if(this.domNode.style.height=`${e}px`,this.container){const n=e-this._decoratingElementsHeight();this.container.style.height=`${n}px`;const o=this.editor.getLayoutInfo();this._doLayout(n,this._getWidth(o))}(t=this._resizeSash)===null||t===void 0||t.layout()}get position(){const e=this._positionMarkerId.getRange(0);if(!!e)return e.getStartPosition()}show(e,t){const n=V.isIRange(e)?V.lift(e):V.fromPositions(e);this._isShowing=!0,this._showImpl(n,t),this._isShowing=!1,this._positionMarkerId.set([{range:n,options:Jt.EMPTY}])}hide(){var e;this._viewZone&&(this.editor.changeViewZones(t=>{this._viewZone&&t.removeZone(this._viewZone.id)}),this._viewZone=null),this._overlayWidget&&(this.editor.removeOverlayWidget(this._overlayWidget),this._overlayWidget=null),(e=this._arrow)===null||e===void 0||e.hide(),this._positionMarkerId.clear()}_decoratingElementsHeight(){const e=this.editor.getOption(66);let t=0;if(this.options.showArrow){const n=Math.round(e/3);t+=2*n}if(this.options.showFrame){const n=Math.round(e/9);t+=2*n}return t}_showImpl(e,t){const n=e.getStartPosition(),o=this.editor.getLayoutInfo(),r=this._getWidth(o);this.domNode.style.width=`${r}px`,this.domNode.style.left=this._getLeft(o)+"px";const s=document.createElement("div");s.style.overflow="hidden";const a=this.editor.getOption(66);if(!this.options.allowUnlimitedHeight){const h=Math.max(12,this.editor.getLayoutInfo().height/a*.8);t=Math.min(t,h)}let l=0,c=0;if(this._arrow&&this.options.showArrow&&(l=Math.round(a/3),this._arrow.height=l,this._arrow.show(n)),this.options.showFrame&&(c=Math.round(a/9)),this.editor.changeViewZones(h=>{this._viewZone&&h.removeZone(this._viewZone.id),this._overlayWidget&&(this.editor.removeOverlayWidget(this._overlayWidget),this._overlayWidget=null),this.domNode.style.top="-1000px",this._viewZone=new z0t(s,n.lineNumber,n.column,t,f=>this._onViewZoneTop(f),f=>this._onViewZoneHeight(f),this.options.showInHiddenAreas,this.options.ordinal),this._viewZone.id=h.addZone(this._viewZone),this._overlayWidget=new U0t($0t+this._viewZone.id,this.domNode),this.editor.addOverlayWidget(this._overlayWidget)}),this.container&&this.options.showFrame){const h=this.options.frameWidth?this.options.frameWidth:c;this.container.style.borderTopWidth=h+"px",this.container.style.borderBottomWidth=h+"px"}const u=t*a-this._decoratingElementsHeight();this.container&&(this.container.style.top=l+"px",this.container.style.height=u+"px",this.container.style.overflow="hidden"),this._doLayout(u,r),this.options.keepEditorSelection||this.editor.setSelection(e);const d=this.editor.getModel();if(d){const h=d.validateRange(new V(e.startLineNumber,1,e.endLineNumber+1,1));this.revealRange(h,h.startLineNumber===d.getLineCount())}}revealRange(e,t){t?this.editor.revealLineNearTop(e.endLineNumber,0):this.editor.revealRange(e,0)}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 fs(this.domNode,this,{orientation:1})),this.options.isResizeable||(this._resizeSash.state=0);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 n=(t.currentY-e.startY)/this.editor.getOption(66),o=n<0?Math.ceil(n):Math.floor(n),r=e.heightInLines+o;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}}var Xwe=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Ywe=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const Zwe=wn("IPeekViewService");Mn(Zwe,class{constructor(){this._widgets=new Map}addExclusiveWidget(i,e){const t=this._widgets.get(i);t&&(t.listener.dispose(),t.widget.dispose());const n=()=>{const o=this._widgets.get(i);o&&o.widget===e&&(o.listener.dispose(),this._widgets.delete(i))};this._widgets.set(i,{widget:e,listener:e.onDidClose(n)})}},1);var Va;(function(i){i.inPeekEditor=new lt("inReferenceSearchEditor",!0,C("inReferenceSearchEditor","Whether the current code editor is embedded inside peek")),i.notInPeekEditor=i.inPeekEditor.toNegated()})(Va||(Va={}));let Ak=class{constructor(e,t){e instanceof Av&&Va.inPeekEditor.bindTo(t)}dispose(){}};Ak.ID="editor.contrib.referenceController";Ak=Xwe([Ywe(1,Ut)],Ak);zn(Ak.ID,Ak,0);function K0t(i){const e=i.get(Jn).getFocusedCodeEditor();return e instanceof Av?e.getParentEditor():e}const q0t={headerBackgroundColor:ve.white,primaryHeadingColor:ve.fromHex("#333333"),secondaryHeadingColor:ve.fromHex("#6c6c6cb3")};let lO=class extends j0t{constructor(e,t,n){super(e,t),this.instantiationService=n,this._onDidClose=new le,this.onDidClose=this._onDidClose.event,B4(this.options,q0t,!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=He(".head"),this._bodyElement=He(".body"),this._fillHead(this._headElement),this._fillBody(this._bodyElement),e.appendChild(this._headElement),e.appendChild(this._bodyElement)}_fillHead(e,t){this._titleElement=He(".peekview-title"),this.options.supportOnTitleClick&&(this._titleElement.classList.add("clickable"),No(this._titleElement,"click",r=>this._onTitleClick(r))),Ae(this._headElement,this._titleElement),this._fillTitleIcon(this._titleElement),this._primaryHeading=He("span.filename"),this._secondaryHeading=He("span.dirname"),this._metaHeading=He("span.meta"),Ae(this._titleElement,this._primaryHeading,this._secondaryHeading,this._metaHeading);const n=He(".peekview-actions");Ae(this._headElement,n);const o=this._getActionBarOptions();this._actionbarWidget=new $c(n,o),this._disposables.add(this._actionbarWidget),t||this._actionbarWidget.push(new la("peekview.close",C("label.close","Close"),Mt.asClassName(Xe.close),!0,()=>(this.dispose(),Promise.resolve())),{label:!1,icon:!0})}_fillTitleIcon(e){}_getActionBarOptions(){return{actionViewItemProvider:jdt.bind(void 0,this.instantiationService),orientation:0}}_onTitleClick(e){}setTitle(e,t){this._primaryHeading&&this._secondaryHeading&&(this._primaryHeading.innerText=e,this._primaryHeading.setAttribute("title",e),t?this._secondaryHeading.innerText=t:Ur(this._secondaryHeading))}setMetaTitle(e){this._metaHeading&&(e?(this._metaHeading.innerText=e,tl(this._metaHeading)):Qs(this._metaHeading))}_doLayout(e,t){if(!this._isShowing&&e<0){this.dispose();return}const n=Math.ceil(this.editor.getOption(66)*1.2),o=Math.round(e-(n+2));this._doLayoutHead(n,t),this._doLayoutBody(o,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`)}};lO=Xwe([Ywe(2,$t)],lO);const G0t=J("peekViewTitle.background",{dark:"#252526",light:"#F3F3F3",hcDark:ve.black,hcLight:ve.white},C("peekViewTitleBackground","Background color of the peek view title area.")),Qwe=J("peekViewTitleLabel.foreground",{dark:ve.white,light:ve.black,hcDark:ve.white,hcLight:yu},C("peekViewTitleForeground","Color of the peek view title.")),Jwe=J("peekViewTitleDescription.foreground",{dark:"#ccccccb3",light:"#616161",hcDark:"#FFFFFF99",hcLight:"#292929"},C("peekViewTitleInfoForeground","Color of the peek view title info.")),X0t=J("peekView.border",{dark:Ra,light:Ra,hcDark:Ln,hcLight:Ln},C("peekViewBorder","Color of the peek view borders and arrow.")),Y0t=J("peekViewResult.background",{dark:"#252526",light:"#F3F3F3",hcDark:ve.black,hcLight:ve.white},C("peekViewResultsBackground","Background color of the peek view result list."));J("peekViewResult.lineForeground",{dark:"#bbbbbb",light:"#646465",hcDark:ve.white,hcLight:yu},C("peekViewResultsMatchForeground","Foreground color for line nodes in the peek view result list."));J("peekViewResult.fileForeground",{dark:ve.white,light:"#1E1E1E",hcDark:ve.white,hcLight:yu},C("peekViewResultsFileForeground","Foreground color for file nodes in the peek view result list."));J("peekViewResult.selectionBackground",{dark:"#3399ff33",light:"#3399ff33",hcDark:null,hcLight:null},C("peekViewResultsSelectionBackground","Background color of the selected entry in the peek view result list."));J("peekViewResult.selectionForeground",{dark:ve.white,light:"#6C6C6C",hcDark:ve.white,hcLight:yu},C("peekViewResultsSelectionForeground","Foreground color of the selected entry in the peek view result list."));const Im=J("peekViewEditor.background",{dark:"#001F33",light:"#F2F8FC",hcDark:ve.black,hcLight:ve.white},C("peekViewEditorBackground","Background color of the peek view editor."));J("peekViewEditorGutter.background",{dark:Im,light:Im,hcDark:Im,hcLight:Im},C("peekViewEditorGutterBackground","Background color of the gutter in the peek view editor."));J("peekViewEditorStickyScroll.background",{dark:Im,light:Im,hcDark:Im,hcLight:Im},C("peekViewEditorStickScrollBackground","Background color of sticky scroll in the peek view editor."));J("peekViewResult.matchHighlightBackground",{dark:"#ea5c004d",light:"#ea5c004d",hcDark:null,hcLight:null},C("peekViewResultsMatchHighlight","Match highlight color in the peek view result list."));J("peekViewEditor.matchHighlightBackground",{dark:"#ff8f0099",light:"#f5d802de",hcDark:null,hcLight:null},C("peekViewEditorMatchHighlight","Match highlight color in the peek view editor."));J("peekViewEditor.matchHighlightBorder",{dark:null,light:null,hcDark:Wi,hcLight:Wi},C("peekViewEditorMatchHighlightBorder","Match highlight border in the peek view editor."));var Z0t=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};class Pv{constructor(e,t,n,o){this.isProviderFirst=e,this.parent=t,this.link=n,this._rangeCallback=o,this.id=e$.nextId()}get uri(){return this.link.uri}get range(){var e,t;return(t=(e=this._range)!==null&&e!==void 0?e:this.link.targetSelectionRange)!==null&&t!==void 0?t:this.link.range}set range(e){this._range=e,this._rangeCallback(this)}get ariaMessage(){var e;const t=(e=this.parent.getPreview(this))===null||e===void 0?void 0:e.preview(this.range);return t?C({key:"aria.oneReference.preview",comment:["Placeholders are: 0: filename, 1:line number, 2: column number, 3: preview snippet of source code"]},"{0} in {1} on line {2} at column {3}",t.value,Hc(this.uri),this.range.startLineNumber,this.range.startColumn):C("aria.oneReference","in {0} on line {1} at column {2}",Hc(this.uri),this.range.startLineNumber,this.range.startColumn)}}class Q0t{constructor(e){this._modelReference=e}dispose(){this._modelReference.dispose()}preview(e,t=8){const n=this._modelReference.object.textEditorModel;if(!n)return;const{startLineNumber:o,startColumn:r,endLineNumber:s,endColumn:a}=e,l=n.getWordUntilPosition({lineNumber:o,column:r-t}),c=new V(o,l.startColumn,o,r),u=new V(s,a,s,1073741824),d=n.getValueInRange(c).replace(/^\s+/,""),h=n.getValueInRange(e),f=n.getValueInRange(u).replace(/\s+$/,"");return{value:d+h+f,highlight:{start:d.length,end:d.length+h.length}}}}class Pk{constructor(e,t){this.parent=e,this.uri=t,this.children=[],this._previews=new vs}dispose(){si(this._previews.values()),this._previews.clear()}getPreview(e){return this._previews.get(e.uri)}get ariaMessage(){const e=this.children.length;return e===1?C("aria.fileReferences.1","1 symbol in {0}, full path {1}",Hc(this.uri),this.uri.fsPath):C("aria.fileReferences.N","{0} symbols in {1}, full path {2}",e,Hc(this.uri),this.uri.fsPath)}resolve(e){return Z0t(this,void 0,void 0,function*(){if(this._previews.size!==0)return this;for(const t of this.children)if(!this._previews.has(t.uri))try{const n=yield e.createModelReference(t.uri);this._previews.set(t.uri,new Q0t(n))}catch(n){en(n)}return this})}}class cl{constructor(e,t){this.groups=[],this.references=[],this._onDidChangeReferenceRange=new le,this.onDidChangeReferenceRange=this._onDidChangeReferenceRange.event,this._links=e,this._title=t;const[n]=e;e.sort(cl._compareReferences);let o;for(const r of e)if((!o||!Vi.isEqual(o.uri,r.uri,!0))&&(o=new Pk(this,r.uri),this.groups.push(o)),o.children.length===0||cl._compareReferences(r,o.children[o.children.length-1])!==0){const s=new Pv(n===r,o,r,a=>this._onDidChangeReferenceRange.fire(a));this.references.push(s),o.children.push(s)}}dispose(){si(this.groups),this._onDidChangeReferenceRange.dispose(),this.groups.length=0}clone(){return new cl(this._links,this._title)}get title(){return this._title}get isEmpty(){return this.groups.length===0}get ariaMessage(){return this.isEmpty?C("aria.result.0","No results found"):this.references.length===1?C("aria.result.1","Found 1 symbol in {0}",this.references[0].uri.fsPath):this.groups.length===1?C("aria.result.n1","Found {0} symbols in {1}",this.references.length,this.groups[0].uri.fsPath):C("aria.result.nm","Found {0} symbols in {1} files",this.references.length,this.groups.length)}nextOrPreviousReference(e,t){const{parent:n}=e;let o=n.children.indexOf(e);const r=n.children.length,s=n.parent.groups.length;return s===1||t&&o+10?(t?o=(o+1)%r:o=(o+r-1)%r,n.children[o]):(o=n.parent.groups.indexOf(n),t?(o=(o+1)%s,n.parent.groups[o].children[0]):(o=(o+s-1)%s,n.parent.groups[o].children[n.parent.groups[o].children.length-1]))}nearestReference(e,t){const n=this.references.map((o,r)=>({idx:r,prefixLen:X0(o.uri.toString(),e.toString()),offsetDist:Math.abs(o.range.startLineNumber-t.lineNumber)*100+Math.abs(o.range.startColumn-t.column)})).sort((o,r)=>o.prefixLen>r.prefixLen?-1:o.prefixLenr.offsetDist?1:0)[0];if(n)return this.references[n.idx]}referenceAt(e,t){for(const n of this.references)if(n.uri.toString()===e.toString()&&V.containsPosition(n.range,t))return n}firstReference(){for(const e of this.references)if(e.isProviderFirst)return e;return this.references[0]}static _compareReferences(e,t){return Vi.compare(e.uri,t.uri)||V.compareRangesUsingStarts(e.range,t.range)}}var uF=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},dF=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},vz;let _z=class{constructor(e){this._resolverService=e}hasChildren(e){return e instanceof cl||e instanceof Pk}getChildren(e){if(e instanceof cl)return e.groups;if(e instanceof Pk)return e.resolve(this._resolverService).then(t=>t.children);throw new Error("bad tree")}};_z=uF([dF(0,$a)],_z);class J0t{getHeight(){return 23}getTemplateId(e){return e instanceof Pk?Ok.id:mT.id}}let bz=class{constructor(e){this._keybindingService=e}getKeyboardNavigationLabel(e){var t;if(e instanceof Pv){const n=(t=e.parent.getPreview(e))===null||t===void 0?void 0:t.preview(e.range);if(n)return n.value}return Hc(e.uri)}};bz=uF([dF(0,xi)],bz);class ebt{getId(e){return e instanceof Pv?e.id:e.uri}}let Cz=class extends _e{constructor(e,t){super(),this._labelService=t;const n=document.createElement("div");n.classList.add("reference-file"),this.file=this._register(new KP(n,{supportHighlights:!0})),this.badge=new x$(Ae(n,He(".count")),{},W1e),e.appendChild(n)}set(e,t){const n=y5(e.uri);this.file.setLabel(this._labelService.getUriBasenameLabel(e.uri),this._labelService.getUriLabel(n,{relative:!0}),{title:this._labelService.getUriLabel(e.uri),matches:t});const o=e.children.length;this.badge.setCount(o),o>1?this.badge.setTitleFormat(C("referencesCount","{0} references",o)):this.badge.setTitleFormat(C("referenceCount","{0} reference",o))}};Cz=uF([dF(1,Iy)],Cz);let Ok=vz=class{constructor(e){this._instantiationService=e,this.templateId=vz.id}renderTemplate(e){return this._instantiationService.createInstance(Cz,e)}renderElement(e,t,n){n.set(e.element,tT(e.filterData))}disposeTemplate(e){e.dispose()}};Ok.id="FileReferencesRenderer";Ok=vz=uF([dF(0,$t)],Ok);class tbt{constructor(e){this.label=new Jm(e)}set(e,t){var n;const o=(n=e.parent.getPreview(e))===null||n===void 0?void 0:n.preview(e.range);if(!o||!o.value)this.label.set(`${Hc(e.uri)}:${e.range.startLineNumber+1}:${e.range.startColumn+1}`);else{const{value:r,highlight:s}=o;t&&!$d.isDefault(t)?(this.label.element.classList.toggle("referenceMatch",!1),this.label.set(r,tT(t))):(this.label.element.classList.toggle("referenceMatch",!0),this.label.set(r,[s]))}}}class mT{constructor(){this.templateId=mT.id}renderTemplate(e){return new tbt(e)}renderElement(e,t,n){n.set(e.element,e.filterData)}disposeTemplate(){}}mT.id="OneReferenceRenderer";class nbt{getWidgetAriaLabel(){return C("treeAriaLabel","References")}getAriaLabel(e){return e.ariaMessage}}var ibt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},tg=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},Nle=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};class hF{constructor(e,t){this._editor=e,this._model=t,this._decorations=new Map,this._decorationIgnoreSet=new Set,this._callOnDispose=new Be,this._callOnModelChange=new Be,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=[],n=[];for(let o=0,r=e.children.length;o{const r=o.deltaDecorations([],t);for(let s=0;s{r.equals(9)&&(this._keybindingService.dispatchEvent(r,r.target),r.stopPropagation())},!0)),this._tree=this._instantiationService.createInstance(rbt,"ReferencesWidget",this._treeContainer,new J0t,[this._instantiationService.createInstance(Ok),this._instantiationService.createInstance(mT)],this._instantiationService.createInstance(_z),n),this._splitView.addView({onDidChange:st.None,element:this._previewContainer,minimumSize:200,maximumSize:Number.MAX_VALUE,layout:r=>{this._preview.layout({height:this._dim.height,width:r})}},$P.Distribute),this._splitView.addView({onDidChange:st.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)}},$P.Distribute),this._disposables.add(this._splitView.onDidSashChange(()=>{this._dim.width&&(this.layoutData.ratio=this._splitView.getViewSize(0)/this._dim.width)},void 0));const o=(r,s)=>{r instanceof Pv&&(s==="show"&&this._revealReference(r,!1),this._onDidSelectReference.fire({element:r,kind:s,source:"tree"}))};this._tree.onDidOpen(r=>{r.sideBySide?o(r.element,"side"):r.editorOptions.pinned?o(r.element,"goto"):o(r.element,"show")}),Qs(this._treeContainer)}_onWidth(e){this._dim&&this._doLayoutBody(this._dim.height,e)}_doLayoutBody(e,t){super._doLayoutBody(e,t),this._dim=new jn(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=C("noResults","No results"),tl(this._messageContainer),Promise.resolve(void 0)):(Qs(this._messageContainer),this._decorationsManager=new hF(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:n}=e;if(t.detail!==2)return;const o=this._getFocusedReference();!o||this._onDidSelectReference.fire({element:{uri:o.uri,range:n.range},kind:t.ctrlKey||t.metaKey||t.altKey?"side":"open",source:"editor"})})),this.container.classList.add("results-loaded"),tl(this._treeContainer),tl(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 Pv)return e;if(e instanceof Pk&&e.children.length>0)return e.children[0]}revealReference(e){return Nle(this,void 0,void 0,function*(){yield this._revealReference(e,!1),this._onDidSelectReference.fire({element:e,kind:"goto",source:"tree"})})}_revealReference(e,t){return Nle(this,void 0,void 0,function*(){if(this._revealedReference===e)return;this._revealedReference=e,e.uri.scheme!==hn.inMemory?this.setTitle(Mst(e.uri),this._uriLabel.getUriLabel(y5(e.uri))):this.setTitle(C("peekView.alternateTitle","References"));const n=this._textModelResolverService.createModelReference(e.uri);this._tree.getInput()===e.parent?this._tree.reveal(e):(t&&this._tree.reveal(e.parent),yield this._tree.expand(e.parent),this._tree.reveal(e));const o=yield n;if(!this._model){o.dispose();return}si(this._previewModelReference);const r=o.object;if(r){const s=this._preview.getModel()===r.textEditorModel?0:1,a=V.lift(e.range).collapseToStart();this._previewModelReference=o,this._preview.setModel(r.textEditorModel),this._preview.setSelection(a),this._preview.revealRangeInCenter(a,s)}else this._preview.setModel(this._previewNotAvailableMessage),o.dispose()})}};wz=ibt([tg(3,mr),tg(4,$a),tg(5,$t),tg(6,Zwe),tg(7,Iy),tg(8,S5),tg(9,xi),tg(10,Ki),tg(11,Ti)],wz);var sbt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},X1=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},Rle=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},SM;const Zb=new lt("referenceSearchVisible",!1,C("referenceSearchVisible","Whether reference peek is visible, like 'Peek References' or 'Peek Definition'"));let Ov=SM=class{static get(e){return e.getContribution(SM.ID)}constructor(e,t,n,o,r,s,a,l){this._defaultTreeKeyboardSupport=e,this._editor=t,this._editorService=o,this._notificationService=r,this._instantiationService=s,this._storageService=a,this._configurationService=l,this._disposables=new Be,this._requestIdPool=0,this._ignoreModelChangeEvent=!1,this._referenceSearchVisible=Zb.bindTo(n)}dispose(){var e,t;this._referenceSearchVisible.reset(),this._disposables.dispose(),(e=this._widget)===null||e===void 0||e.dispose(),(t=this._model)===null||t===void 0||t.dispose(),this._widget=void 0,this._model=void 0}toggleWidget(e,t,n){let o;if(this._widget&&(o=this._widget.position),this.closeWidget(),!!o&&e.containsPosition(o))return;this._peekMode=n,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",s=obt.fromJSON(this._storageService.get(r,0,"{}"));this._widget=this._instantiationService.createInstance(wz,this._editor,this._defaultTreeKeyboardSupport,s),this._widget.setTitle(C("labelLoading","Loading...")),this._widget.show(e),this._disposables.add(this._widget.onDidClose(()=>{t.cancel(),this._widget&&(this._storageService.store(r,JSON.stringify(this._widget.layoutData),0,1),this._widget=void 0),this.closeWidget()})),this._disposables.add(this._widget.onDidSelectReference(l=>{const{element:c,kind:u}=l;if(!!c)switch(u){case"open":(l.source!=="editor"||!this._configurationService.getValue("editor.stablePeek"))&&this.openReference(c,!1,!1);break;case"side":this.openReference(c,!0,!1);break;case"goto":n?this._gotoReference(c,!0):this.openReference(c,!1,!0);break}}));const a=++this._requestIdPool;t.then(l=>{var c;if(a!==this._requestIdPool||!this._widget){l.dispose();return}return(c=this._model)===null||c===void 0||c.dispose(),this._model=l,this._widget.setModel(this._model).then(()=>{if(this._widget&&this._model&&this._editor.hasModel()){this._model.isEmpty?this._widget.setMetaTitle(""):this._widget.setMetaTitle(C("metaTitle.N","{0} ({1})",this._model.title,this._model.references.length));const u=this._editor.getModel().uri,d=new ae(e.startLineNumber,e.startColumn),h=this._model.nearestReference(u,d);if(h)return this._widget.setSelection(h).then(()=>{this._widget&&this._editor.getOption(86)==="editor"&&this._widget.focusOnPreviewEditor()})}})},l=>{this._notificationService.error(l)})}changeFocusBetweenPreviewAndReferences(){!this._widget||(this._widget.isPreviewEditorFocused()?this._widget.focusOnReferenceTree():this._widget.focusOnPreviewEditor())}goToNextOrPreviousReference(e){return Rle(this,void 0,void 0,function*(){if(!this._editor.hasModel()||!this._model||!this._widget)return;const t=this._widget.position;if(!t)return;const n=this._model.nearestReference(this._editor.getModel().uri,t);if(!n)return;const o=this._model.nextOrPreviousReference(n,e),r=this._editor.hasTextFocus(),s=this._widget.isPreviewEditorFocused();yield this._widget.setSelection(o),yield this._gotoReference(o,!1),r?this._editor.focus():this._widget&&s&&this._widget.focusOnPreviewEditor()})}revealReference(e){return Rle(this,void 0,void 0,function*(){!this._editor.hasModel()||!this._model||!this._widget||(yield this._widget.revealReference(e))})}closeWidget(e=!0){var t,n;(t=this._widget)===null||t===void 0||t.dispose(),(n=this._model)===null||n===void 0||n.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){var n;(n=this._widget)===null||n===void 0||n.hide(),this._ignoreModelChangeEvent=!0;const o=V.lift(e.range).collapseToStart();return this._editorService.openCodeEditor({resource:e.uri,options:{selection:o,selectionSource:"code.jump",pinned:t}},this._editor).then(r=>{var s;if(this._ignoreModelChangeEvent=!1,!r||!this._widget){this.closeWidget();return}if(this._editor===r)this._widget.show(o),this._widget.focusOnReferenceTree();else{const a=SM.get(r),l=this._model.clone();this.closeWidget(),r.focus(),a==null||a.toggleWidget(o,sr(c=>Promise.resolve(l)),(s=this._peekMode)!==null&&s!==void 0?s:!1)}},r=>{this._ignoreModelChangeEvent=!1,en(r)})}openReference(e,t,n){t||this.closeWidget();const{uri:o,range:r}=e;this._editorService.openCodeEditor({resource:o,options:{selection:r,selectionSource:"code.jump",pinned:n}},this._editor,t)}};Ov.ID="editor.contrib.referencesController";Ov=SM=sbt([X1(2,Ut),X1(3,Jn),X1(4,Ao),X1(5,$t),X1(6,qu),X1(7,En)],Ov);function Qb(i,e){const t=K0t(i);if(!t)return;const n=Ov.get(t);n&&e(n)}Wa.registerCommandAndKeybindingRule({id:"togglePeekWidgetFocus",weight:100,primary:Zo(2089,60),when:Me.or(Zb,Va.inPeekEditor),handler(i){Qb(i,e=>{e.changeFocusBetweenPreviewAndReferences()})}});Wa.registerCommandAndKeybindingRule({id:"goToNextReference",weight:100-10,primary:62,secondary:[70],when:Me.or(Zb,Va.inPeekEditor),handler(i){Qb(i,e=>{e.goToNextOrPreviousReference(!0)})}});Wa.registerCommandAndKeybindingRule({id:"goToPreviousReference",weight:100-10,primary:1086,secondary:[1094],when:Me.or(Zb,Va.inPeekEditor),handler(i){Qb(i,e=>{e.goToNextOrPreviousReference(!1)})}});Rn.registerCommandAlias("goToNextReferenceFromEmbeddedEditor","goToNextReference");Rn.registerCommandAlias("goToPreviousReferenceFromEmbeddedEditor","goToPreviousReference");Rn.registerCommandAlias("closeReferenceSearchEditor","closeReferenceSearch");Rn.registerCommand("closeReferenceSearch",i=>Qb(i,e=>e.closeWidget()));Wa.registerKeybindingRule({id:"closeReferenceSearch",weight:100-101,primary:9,secondary:[1033],when:Me.and(Va.inPeekEditor,Me.not("config.editor.stablePeek"))});Wa.registerKeybindingRule({id:"closeReferenceSearch",weight:200+50,primary:9,secondary:[1033],when:Me.and(Zb,Me.not("config.editor.stablePeek"))});Wa.registerCommandAndKeybindingRule({id:"revealReference",weight:200,primary:3,mac:{primary:3,secondary:[2066]},when:Me.and(Zb,sCe,xX.negate(),LX.negate()),handler(i){var e;const n=(e=i.get(Gc).lastFocusedList)===null||e===void 0?void 0:e.getFocus();Array.isArray(n)&&n[0]instanceof Pv&&Qb(i,o=>o.revealReference(n[0]))}});Wa.registerCommandAndKeybindingRule({id:"openReferenceToSide",weight:100,primary:2051,mac:{primary:259},when:Me.and(Zb,sCe,xX.negate(),LX.negate()),handler(i){var e;const n=(e=i.get(Gc).lastFocusedList)===null||e===void 0?void 0:e.getFocus();Array.isArray(n)&&n[0]instanceof Pv&&Qb(i,o=>o.openReference(n[0],!0,!0))}});Rn.registerCommand("openReference",i=>{var e;const n=(e=i.get(Gc).lastFocusedList)===null||e===void 0?void 0:e.getFocus();Array.isArray(n)&&n[0]instanceof Pv&&Qb(i,o=>o.openReference(n[0],!1,!0))});var eye=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},RL=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const iY=new lt("hasSymbols",!1,C("hasSymbols","Whether there are symbol locations that can be navigated via keyboard-only.")),fF=wn("ISymbolNavigationService");let yz=class{constructor(e,t,n,o){this._editorService=t,this._notificationService=n,this._keybindingService=o,this._currentModel=void 0,this._currentIdx=-1,this._ignoreEditorChange=!1,this._ctxHasSymbols=iY.bindTo(e)}reset(){var e,t;this._ctxHasSymbols.reset(),(e=this._currentState)===null||e===void 0||e.dispose(),(t=this._currentMessage)===null||t===void 0||t.dispose(),this._currentModel=void 0,this._currentIdx=-1}put(e){const t=e.parent.parent;if(t.references.length<=1){this.reset();return}this._currentModel=t,this._currentIdx=t.references.indexOf(e),this._ctxHasSymbols.set(!0),this._showMessage();const n=new Sz(this._editorService),o=n.onDidChange(r=>{if(this._ignoreEditorChange)return;const s=this._editorService.getActiveCodeEditor();if(!s)return;const a=s.getModel(),l=s.getPosition();if(!a||!l)return;let c=!1,u=!1;for(const d of t.references)if(MG(d.uri,a.uri))c=!0,u=u||V.containsPosition(d.range,l);else if(c)break;(!c||!u)&&this.reset()});this._currentState=Iu(n,o)}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:V.collapseToStart(t.range),selectionRevealType:3}},e).finally(()=>{this._ignoreEditorChange=!1})}_showMessage(){var e;(e=this._currentMessage)===null||e===void 0||e.dispose();const t=this._keybindingService.lookupKeybinding("editor.gotoNextSymbolFromResult"),n=t?C("location.kb","Symbol {0} of {1}, {2} for next",this._currentIdx+1,this._currentModel.references.length,t.getLabel()):C("location","Symbol {0} of {1}",this._currentIdx+1,this._currentModel.references.length);this._currentMessage=this._notificationService.status(n)}};yz=eye([RL(0,Ut),RL(1,Jn),RL(2,Ao),RL(3,xi)],yz);Mn(fF,yz,1);Ye(new class extends Ir{constructor(){super({id:"editor.gotoNextSymbolFromResult",precondition:iY,kbOpts:{weight:100,primary:70}})}runEditorCommand(i,e){return i.get(fF).revealNext(e)}});Wa.registerCommandAndKeybindingRule({id:"editor.gotoNextSymbolFromResult.cancel",weight:100,when:iY,primary:9,handler(i){i.get(fF).reset()}});let Sz=class{constructor(e){this._listener=new Map,this._disposables=new Be,this._onDidChange=new le,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(),si(this._listener.values())}_onDidAddEditor(e){this._listener.set(e,Iu(e.onDidChangeCursorPosition(t=>this._onDidChange.fire({editor:e})),e.onDidChangeModelContent(t=>this._onDidChange.fire({editor:e}))))}_onDidRemoveEditor(e){var t;(t=this._listener.get(e))===null||t===void 0||t.dispose(),this._listener.delete(e)}};Sz=eye([RL(0,Jn)],Sz);var oY=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};function vT(i,e,t,n){return oY(this,void 0,void 0,function*(){const r=t.ordered(i).map(a=>Promise.resolve(n(a,i,e)).then(void 0,l=>{$o(l)})),s=yield Promise.all(r);return df(s.flat())})}function gF(i,e,t,n){return vT(e,t,i,(o,r,s)=>o.provideDefinition(r,s,n))}function tye(i,e,t,n){return vT(e,t,i,(o,r,s)=>o.provideDeclaration(r,s,n))}function nye(i,e,t,n){return vT(e,t,i,(o,r,s)=>o.provideImplementation(r,s,n))}function iye(i,e,t,n){return vT(e,t,i,(o,r,s)=>o.provideTypeDefinition(r,s,n))}function pF(i,e,t,n,o){return vT(e,t,i,(r,s,a)=>oY(this,void 0,void 0,function*(){const l=yield r.provideReferences(s,a,{includeDeclaration:!0},o);if(!n||!l||l.length!==2)return l;const c=yield r.provideReferences(s,a,{includeDeclaration:!1},o);return c&&c.length===1?c:l}))}function _T(i){return oY(this,void 0,void 0,function*(){const e=yield i(),t=new cl(e,""),n=t.references.map(o=>o.link);return t.dispose(),n})}Nf("_executeDefinitionProvider",(i,e,t)=>{const n=i.get(pt),o=gF(n.definitionProvider,e,t,_n.None);return _T(()=>o)});Nf("_executeTypeDefinitionProvider",(i,e,t)=>{const n=i.get(pt),o=iye(n.typeDefinitionProvider,e,t,_n.None);return _T(()=>o)});Nf("_executeDeclarationProvider",(i,e,t)=>{const n=i.get(pt),o=tye(n.declarationProvider,e,t,_n.None);return _T(()=>o)});Nf("_executeReferenceProvider",(i,e,t)=>{const n=i.get(pt),o=pF(n.referenceProvider,e,t,!1,_n.None);return _T(()=>o)});Nf("_executeImplementationProvider",(i,e,t)=>{const n=i.get(pt),o=nye(n.implementationProvider,e,t,_n.None);return _T(()=>o)});var Ru=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},Gx,Xx,Yx,$2,z2,U2,j2,K2;Hr.appendMenuItem(Z.EditorContext,{submenu:Z.EditorContextPeek,title:C("peek.submenu","Peek"),group:"navigation",order:100});class Hy{static is(e){return!e||typeof e!="object"?!1:!!(e instanceof Hy||ae.isIPosition(e.position)&&e.model)}constructor(e,t){this.model=e,this.position=t}}class Fs extends sh{static all(){return Fs._allSymbolNavigationCommands.values()}static _patchConfig(e){const t=Object.assign(Object.assign({},e),{f1:!0});if(t.menu)for(const n of mn.wrap(t.menu))(n.id===Z.EditorContext||n.id===Z.EditorContextPeek)&&(n.when=Me.and(e.precondition,n.when));return t}constructor(e,t){super(Fs._patchConfig(t)),this.configuration=e,Fs._allSymbolNavigationCommands.set(t.id,this)}runEditorCommand(e,t,n,o){if(!t.hasModel())return Promise.resolve(void 0);const r=e.get(Ao),s=e.get(Jn),a=e.get(Jv),l=e.get(fF),c=e.get(pt),u=e.get($t),d=t.getModel(),h=t.getPosition(),f=Hy.is(n)?n:new Hy(d,h),g=new Nv(t,5),p=e5(this._getLocationModel(c,f.model,f.position,g.token),g.token).then(v=>Ru(this,void 0,void 0,function*(){var m;if(!v||g.token.isCancellationRequested)return;bs(v.ariaMessage);let _;if(v.referenceAt(d.uri,h)){const y=this._getAlternativeCommand(t);!Fs._activeAlternativeCommands.has(y)&&Fs._allSymbolNavigationCommands.has(y)&&(_=Fs._allSymbolNavigationCommands.get(y))}const w=v.references.length;if(w===0){if(!this.configuration.muteMessage){const y=d.getWordAtPosition(h);(m=ll.get(t))===null||m===void 0||m.showMessage(this._getNoResultFoundMessage(y),h)}}else if(w===1&&_)Fs._activeAlternativeCommands.add(this.desc.id),u.invokeFunction(y=>_.runEditorCommand(y,t,n,o).finally(()=>{Fs._activeAlternativeCommands.delete(this.desc.id)}));else return this._onResult(s,l,t,v,o)}),v=>{r.error(v)}).finally(()=>{g.dispose()});return a.showWhile(p,250),p}_onResult(e,t,n,o,r){return Ru(this,void 0,void 0,function*(){const s=this._getGoToPreference(n);if(!(n instanceof Av)&&(this.configuration.openInPeek||s==="peek"&&o.references.length>1))this._openInPeek(n,o,r);else{const a=o.firstReference(),l=o.references.length>1&&s==="gotoAndPeek",c=yield this._openReference(n,e,a,this.configuration.openToSide,!l);l&&c?this._openInPeek(c,o,r):o.dispose(),s==="goto"&&t.put(a)}})}_openReference(e,t,n,o,r){return Ru(this,void 0,void 0,function*(){let s;if(ZYe(n)&&(s=n.targetSelectionRange),s||(s=n.range),!s)return;const a=yield t.openCodeEditor({resource:n.uri,options:{selection:V.collapseToStart(s),selectionRevealType:3,selectionSource:"code.jump"}},e,o);if(!!a){if(r){const l=a.getModel(),c=a.createDecorationsCollection([{range:s,options:{description:"symbol-navigate-action-highlight",className:"symbolHighlight"}}]);setTimeout(()=>{a.getModel()===l&&c.clear()},350)}return a}})}_openInPeek(e,t,n){const o=Ov.get(e);o&&e.hasModel()?o.toggleWidget(n!=null?n:e.getSelection(),sr(r=>Promise.resolve(t)),this.configuration.openInPeek):t.dispose()}}Fs._allSymbolNavigationCommands=new Map;Fs._activeAlternativeCommands=new Set;class bT extends Fs{_getLocationModel(e,t,n,o){return Ru(this,void 0,void 0,function*(){return new cl(yield gF(e.definitionProvider,t,n,o),C("def.title","Definitions"))})}_getNoResultFoundMessage(e){return e&&e.word?C("noResultWord","No definition found for '{0}'",e.word):C("generic.noResults","No definition found")}_getAlternativeCommand(e){return e.getOption(58).alternativeDefinitionCommand}_getGoToPreference(e){return e.getOption(58).multipleDefinitions}}$i((Gx=class extends bT{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:Gx.id,title:{value:C("actions.goToDecl.label","Go to Definition"),original:"Go to Definition",mnemonicTitle:C({key:"miGotoDefinition",comment:["&& denotes a mnemonic"]},"Go to &&Definition")},precondition:Me.and(Q.hasDefinitionProvider,Q.isInWalkThroughSnippet.toNegated()),keybinding:[{when:Q.editorTextFocus,primary:70,weight:100},{when:Me.and(Q.editorTextFocus,iCe),primary:2118,weight:100}],menu:[{id:Z.EditorContext,group:"navigation",order:1.1},{id:Z.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:2}]}),Rn.registerCommandAlias("editor.action.goToDeclaration",Gx.id)}},Gx.id="editor.action.revealDefinition",Gx));$i((Xx=class extends bT{constructor(){super({openToSide:!0,openInPeek:!1,muteMessage:!1},{id:Xx.id,title:{value:C("actions.goToDeclToSide.label","Open Definition to the Side"),original:"Open Definition to the Side"},precondition:Me.and(Q.hasDefinitionProvider,Q.isInWalkThroughSnippet.toNegated()),keybinding:[{when:Q.editorTextFocus,primary:Zo(2089,70),weight:100},{when:Me.and(Q.editorTextFocus,iCe),primary:Zo(2089,2118),weight:100}]}),Rn.registerCommandAlias("editor.action.openDeclarationToTheSide",Xx.id)}},Xx.id="editor.action.revealDefinitionAside",Xx));$i((Yx=class extends bT{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:Yx.id,title:{value:C("actions.previewDecl.label","Peek Definition"),original:"Peek Definition"},precondition:Me.and(Q.hasDefinitionProvider,Va.notInPeekEditor,Q.isInWalkThroughSnippet.toNegated()),keybinding:{when:Q.editorTextFocus,primary:582,linux:{primary:3140},weight:100},menu:{id:Z.EditorContextPeek,group:"peek",order:2}}),Rn.registerCommandAlias("editor.action.previewDeclaration",Yx.id)}},Yx.id="editor.action.peekDefinition",Yx));class oye extends Fs{_getLocationModel(e,t,n,o){return Ru(this,void 0,void 0,function*(){return new cl(yield tye(e.declarationProvider,t,n,o),C("decl.title","Declarations"))})}_getNoResultFoundMessage(e){return e&&e.word?C("decl.noResultWord","No declaration found for '{0}'",e.word):C("decl.generic.noResults","No declaration found")}_getAlternativeCommand(e){return e.getOption(58).alternativeDeclarationCommand}_getGoToPreference(e){return e.getOption(58).multipleDeclarations}}$i(($2=class extends oye{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:$2.id,title:{value:C("actions.goToDeclaration.label","Go to Declaration"),original:"Go to Declaration",mnemonicTitle:C({key:"miGotoDeclaration",comment:["&& denotes a mnemonic"]},"Go to &&Declaration")},precondition:Me.and(Q.hasDeclarationProvider,Q.isInWalkThroughSnippet.toNegated()),menu:[{id:Z.EditorContext,group:"navigation",order:1.3},{id:Z.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:3}]})}_getNoResultFoundMessage(e){return e&&e.word?C("decl.noResultWord","No declaration found for '{0}'",e.word):C("decl.generic.noResults","No declaration found")}},$2.id="editor.action.revealDeclaration",$2));$i(class extends oye{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:"editor.action.peekDeclaration",title:{value:C("actions.peekDecl.label","Peek Declaration"),original:"Peek Declaration"},precondition:Me.and(Q.hasDeclarationProvider,Va.notInPeekEditor,Q.isInWalkThroughSnippet.toNegated()),menu:{id:Z.EditorContextPeek,group:"peek",order:3}})}});class rye extends Fs{_getLocationModel(e,t,n,o){return Ru(this,void 0,void 0,function*(){return new cl(yield iye(e.typeDefinitionProvider,t,n,o),C("typedef.title","Type Definitions"))})}_getNoResultFoundMessage(e){return e&&e.word?C("goToTypeDefinition.noResultWord","No type definition found for '{0}'",e.word):C("goToTypeDefinition.generic.noResults","No type definition found")}_getAlternativeCommand(e){return e.getOption(58).alternativeTypeDefinitionCommand}_getGoToPreference(e){return e.getOption(58).multipleTypeDefinitions}}$i((z2=class extends rye{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:z2.ID,title:{value:C("actions.goToTypeDefinition.label","Go to Type Definition"),original:"Go to Type Definition",mnemonicTitle:C({key:"miGotoTypeDefinition",comment:["&& denotes a mnemonic"]},"Go to &&Type Definition")},precondition:Me.and(Q.hasTypeDefinitionProvider,Q.isInWalkThroughSnippet.toNegated()),keybinding:{when:Q.editorTextFocus,primary:0,weight:100},menu:[{id:Z.EditorContext,group:"navigation",order:1.4},{id:Z.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:3}]})}},z2.ID="editor.action.goToTypeDefinition",z2));$i((U2=class extends rye{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:U2.ID,title:{value:C("actions.peekTypeDefinition.label","Peek Type Definition"),original:"Peek Type Definition"},precondition:Me.and(Q.hasTypeDefinitionProvider,Va.notInPeekEditor,Q.isInWalkThroughSnippet.toNegated()),menu:{id:Z.EditorContextPeek,group:"peek",order:4}})}},U2.ID="editor.action.peekTypeDefinition",U2));class sye extends Fs{_getLocationModel(e,t,n,o){return Ru(this,void 0,void 0,function*(){return new cl(yield nye(e.implementationProvider,t,n,o),C("impl.title","Implementations"))})}_getNoResultFoundMessage(e){return e&&e.word?C("goToImplementation.noResultWord","No implementation found for '{0}'",e.word):C("goToImplementation.generic.noResults","No implementation found")}_getAlternativeCommand(e){return e.getOption(58).alternativeImplementationCommand}_getGoToPreference(e){return e.getOption(58).multipleImplementations}}$i((j2=class extends sye{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:j2.ID,title:{value:C("actions.goToImplementation.label","Go to Implementations"),original:"Go to Implementations",mnemonicTitle:C({key:"miGotoImplementation",comment:["&& denotes a mnemonic"]},"Go to &&Implementations")},precondition:Me.and(Q.hasImplementationProvider,Q.isInWalkThroughSnippet.toNegated()),keybinding:{when:Q.editorTextFocus,primary:2118,weight:100},menu:[{id:Z.EditorContext,group:"navigation",order:1.45},{id:Z.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:4}]})}},j2.ID="editor.action.goToImplementation",j2));$i((K2=class extends sye{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:K2.ID,title:{value:C("actions.peekImplementation.label","Peek Implementations"),original:"Peek Implementations"},precondition:Me.and(Q.hasImplementationProvider,Va.notInPeekEditor,Q.isInWalkThroughSnippet.toNegated()),keybinding:{when:Q.editorTextFocus,primary:3142,weight:100},menu:{id:Z.EditorContextPeek,group:"peek",order:5}})}},K2.ID="editor.action.peekImplementation",K2));class aye extends Fs{_getNoResultFoundMessage(e){return e?C("references.no","No references found for '{0}'",e.word):C("references.noGeneric","No references found")}_getAlternativeCommand(e){return e.getOption(58).alternativeReferenceCommand}_getGoToPreference(e){return e.getOption(58).multipleReferences}}$i(class extends aye{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:"editor.action.goToReferences",title:{value:C("goToReferences.label","Go to References"),original:"Go to References",mnemonicTitle:C({key:"miGotoReference",comment:["&& denotes a mnemonic"]},"Go to &&References")},precondition:Me.and(Q.hasReferenceProvider,Va.notInPeekEditor,Q.isInWalkThroughSnippet.toNegated()),keybinding:{when:Q.editorTextFocus,primary:1094,weight:100},menu:[{id:Z.EditorContext,group:"navigation",order:1.45},{id:Z.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:5}]})}_getLocationModel(e,t,n,o){return Ru(this,void 0,void 0,function*(){return new cl(yield pF(e.referenceProvider,t,n,!0,o),C("ref.title","References"))})}});$i(class extends aye{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:"editor.action.referenceSearch.trigger",title:{value:C("references.action.label","Peek References"),original:"Peek References"},precondition:Me.and(Q.hasReferenceProvider,Va.notInPeekEditor,Q.isInWalkThroughSnippet.toNegated()),menu:{id:Z.EditorContextPeek,group:"peek",order:6}})}_getLocationModel(e,t,n,o){return Ru(this,void 0,void 0,function*(){return new cl(yield pF(e.referenceProvider,t,n,!1,o),C("ref.title","References"))})}});class abt extends Fs{constructor(e,t,n){super(e,{id:"editor.action.goToLocation",title:{value:C("label.generic","Go to Any Symbol"),original:"Go to Any Symbol"},precondition:Me.and(Va.notInPeekEditor,Q.isInWalkThroughSnippet.toNegated())}),this._references=t,this._gotoMultipleBehaviour=n}_getLocationModel(e,t,n,o){return Ru(this,void 0,void 0,function*(){return new cl(this._references,C("generic.title","Locations"))})}_getNoResultFoundMessage(e){return e&&C("generic.noResult","No results for '{0}'",e.word)||""}_getGoToPreference(e){var t;return(t=this._gotoMultipleBehaviour)!==null&&t!==void 0?t:e.getOption(58).multipleReferences}_getAlternativeCommand(){return""}}Rn.registerCommand({id:"editor.action.goToLocations",description:{description:"Go to locations from a position in a file",args:[{name:"uri",description:"The text document in which to start",constraint:Rt},{name:"position",description:"The position at which to start",constraint:ae.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:(i,e,t,n,o,r,s)=>Ru(void 0,void 0,void 0,function*(){fi(Rt.isUri(e)),fi(ae.isIPosition(t)),fi(Array.isArray(n)),fi(typeof o=="undefined"||typeof o=="string"),fi(typeof s=="undefined"||typeof s=="boolean");const a=i.get(Jn),l=yield a.openCodeEditor({resource:e},a.getFocusedCodeEditor());if(yf(l))return l.setPosition(t),l.revealPositionInCenterIfOutsideViewport(t,0),l.invokeWithinContext(c=>{const u=new class extends abt{_getNoResultFoundMessage(d){return r||super._getNoResultFoundMessage(d)}}({muteMessage:!Boolean(r),openInPeek:Boolean(s),openToSide:!1},n,o);c.get($t).invokeFunction(u.run.bind(u),l)})})});Rn.registerCommand({id:"editor.action.peekLocations",description:{description:"Peek locations from a position in a file",args:[{name:"uri",description:"The text document in which to start",constraint:Rt},{name:"position",description:"The position at which to start",constraint:ae.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:(i,e,t,n,o)=>Ru(void 0,void 0,void 0,function*(){i.get(_o).executeCommand("editor.action.goToLocations",e,t,n,o,void 0,!0)})});Rn.registerCommand({id:"editor.action.findReferences",handler:(i,e,t)=>{fi(Rt.isUri(e)),fi(ae.isIPosition(t));const n=i.get(pt),o=i.get(Jn);return o.openCodeEditor({resource:e},o.getFocusedCodeEditor()).then(r=>{if(!yf(r)||!r.hasModel())return;const s=Ov.get(r);if(!s)return;const a=sr(c=>pF(n.referenceProvider,r.getModel(),ae.lift(t),!1,c).then(u=>new cl(u,C("ref.title","References")))),l=new V(t.lineNumber,t.column,t.lineNumber,t.column);return Promise.resolve(s.toggleWidget(l,a,!1))})}});Rn.registerCommandAlias("editor.action.showReferences","editor.action.peekLocations");var lbt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},i7=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},Mle=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},ML;let gb=ML=class{constructor(e,t,n,o){this.textModelResolverService=t,this.languageService=n,this.languageFeaturesService=o,this.toUnhook=new Be,this.toUnhookForKeyboard=new Be,this.currentWordAtPosition=null,this.previousPromise=null,this.editor=e,this.linkDecorations=this.editor.createDecorationsCollection();const r=new lF(e);this.toUnhook.add(r),this.toUnhook.add(r.onMouseMoveOrRelevantKeyDown(([s,a])=>{this.startFindDefinitionFromMouse(s,a!=null?a:void 0)})),this.toUnhook.add(r.onExecute(s=>{this.isEnabled(s)&&this.gotoDefinition(s.target.position,s.hasSideBySideModifier).catch(a=>{en(a)}).finally(()=>{this.removeLinkDecorations()})})),this.toUnhook.add(r.onCancel(()=>{this.removeLinkDecorations(),this.currentWordAtPosition=null}))}static get(e){return e.getContribution(ML.ID)}startFindDefinitionFromCursor(e){return Mle(this,void 0,void 0,function*(){yield 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===9&&this.linkDecorations.length>0)return;if(!this.editor.hasModel()||!this.isEnabled(e,t)){this.currentWordAtPosition=null,this.removeLinkDecorations();return}const n=e.target.position;this.startFindDefinition(n)}startFindDefinition(e){var t;return Mle(this,void 0,void 0,function*(){this.toUnhookForKeyboard.clear();const n=e?(t=this.editor.getModel())===null||t===void 0?void 0:t.getWordAtPosition(e):null;if(!n){this.currentWordAtPosition=null,this.removeLinkDecorations();return}if(this.currentWordAtPosition&&this.currentWordAtPosition.startColumn===n.startColumn&&this.currentWordAtPosition.endColumn===n.endColumn&&this.currentWordAtPosition.word===n.word)return;this.currentWordAtPosition=n;const o=new Rk(this.editor,15);this.previousPromise&&(this.previousPromise.cancel(),this.previousPromise=null),this.previousPromise=sr(a=>this.findDefinition(e,a));let r;try{r=yield this.previousPromise}catch(a){en(a);return}if(!r||!r.length||!o.validate(this.editor)){this.removeLinkDecorations();return}const s=r[0].originSelectionRange?V.lift(r[0].originSelectionRange):new V(e.lineNumber,n.startColumn,e.lineNumber,n.endColumn);if(r.length>1){let a=s;for(const{originSelectionRange:l}of r)l&&(a=V.plusRange(a,l));this.addDecoration(a,new is().appendText(C("multipleResults","Click to show {0} definitions.",r.length)))}else{const a=r[0];if(!a.uri)return;this.textModelResolverService.createModelReference(a.uri).then(l=>{if(!l.object||!l.object.textEditorModel){l.dispose();return}const{object:{textEditorModel:c}}=l,{startLineNumber:u}=a.range;if(u<1||u>c.getLineCount()){l.dispose();return}const d=this.getPreviewValue(c,u,a),h=this.languageService.guessLanguageIdByFilepathOrFirstLine(c.uri);this.addDecoration(s,d?new is().appendCodeblock(h||"",d):void 0),l.dispose()})}})}getPreviewValue(e,t,n){let o=n.range;return o.endLineNumber-o.startLineNumber>=ML.MAX_SOURCE_PREVIEW_LINES&&(o=this.getPreviewRangeBasedOnIndentation(e,t)),this.stripIndentationFromPreviewRange(e,t,o)}stripIndentationFromPreviewRange(e,t,n){let r=e.getLineFirstNonWhitespaceColumn(t);for(let a=t+1;a{const o=!t&&this.editor.getOption(87)&&!this.isInPeekEditor(n);return new bT({openToSide:t,openInPeek:o,muteMessage:!0},{title:{value:"",original:""},id:"",precondition:void 0}).run(n)})}isInPeekEditor(e){const t=e.get(Ut);return Va.inPeekEditor.getValue(t)}dispose(){this.toUnhook.dispose(),this.toUnhookForKeyboard.dispose()}};gb.ID="editor.contrib.gotodefinitionatposition";gb.MAX_SOURCE_PREVIEW_LINES=8;gb=ML=lbt([i7(1,$a),i7(2,Ki),i7(3,pt)],gb);zn(gb.ID,gb,2);const q2=He;class lye extends _e{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 GI(this.contentsDomNode,{consumeMouseWheelIfScrollbarIsNeeded:!0})),this.containerDomNode.appendChild(this.scrollbar.getDomNode())}onContentsChanged(){this.scrollbar.scanDomNode()}}class rY extends _e{static render(e,t,n){return new rY(e,t,n)}constructor(e,t,n){super(),this.actionContainer=Ae(e,q2("div.action-container")),this.actionContainer.setAttribute("tabindex","0"),this.action=Ae(this.actionContainer,q2("a.action")),this.action.setAttribute("role","button"),t.iconClass&&Ae(this.action,q2(`span.icon.${t.iconClass}`));const o=Ae(this.action,q2("span"));o.textContent=n?`${t.label} (${n})`:t.label,this._register(ke(this.actionContainer,et.CLICK,r=>{r.stopPropagation(),r.preventDefault(),t.run(this.actionContainer)})),this._register(ke(this.actionContainer,et.KEY_DOWN,r=>{const s=new Pi(r);(s.equals(3)||s.equals(10))&&(r.stopPropagation(),r.preventDefault(),t.run(this.actionContainer))})),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 cbt(i,e){return i&&e?C("acessibleViewHint","Inspect this in the accessible view with {0}.",e):i?C("acessibleViewHintNoKbOpen","Inspect this in the accessible view via the command Open Accessible View which is currently not triggerable via keybinding."):""}var ubt=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},dbt=globalThis&&globalThis.__asyncValues||function(i){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=i[Symbol.asyncIterator],t;return e?e.call(i):(i=typeof __values=="function"?__values(i):i[Symbol.iterator](),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(r){t[r]=i[r]&&function(s){return new Promise(function(a,l){s=i[r](s),o(a,l,s.done,s.value)})}}function o(r,s,a,l){Promise.resolve(l).then(function(c){r({value:c,done:a})},s)}};class hbt{constructor(e,t,n){this.value=e,this.isComplete=t,this.hasLoadingMessage=n}}class cye extends _e{constructor(e,t){super(),this._editor=e,this._computer=t,this._onResult=this._register(new le),this.onResult=this._onResult.event,this._firstWaitScheduler=this._register(new bi(()=>this._triggerAsyncComputation(),0)),this._secondWaitScheduler=this._register(new bi(()=>this._triggerSyncComputation(),0)),this._loadingMessageScheduler=this._register(new bi(()=>this._triggerLoadingMessage(),0)),this._state=0,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(60).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(2),this._secondWaitScheduler.schedule(this._secondWaitTime),this._computer.computeAsync?(this._asyncIterableDone=!1,this._asyncIterable=JQe(e=>this._computer.computeAsync(e)),ubt(this,void 0,void 0,function*(){var e,t,n,o;try{try{for(var r=!0,s=dbt(this._asyncIterable),a;a=yield s.next(),e=a.done,!e;r=!0){o=a.value,r=!1;const l=o;l&&(this._result.push(l),this._fireResult())}}catch(l){t={error:l}}finally{try{!r&&!e&&(n=s.return)&&(yield n.call(s))}finally{if(t)throw t.error}}this._asyncIterableDone=!0,(this._state===3||this._state===4)&&this._setState(0)}catch(l){en(l)}})):this._asyncIterableDone=!0}_triggerSyncComputation(){this._computer.computeSync&&(this._result=this._result.concat(this._computer.computeSync())),this._setState(this._asyncIterableDone?0:3)}_triggerLoadingMessage(){this._state===3&&this._setState(4)}_fireResult(){if(this._state===1||this._state===2)return;const e=this._state===0,t=this._state===4;this._onResult.fire(new hbt(this._result.slice(0),e,t))}start(e){if(e===0)this._state===0&&(this._setState(1),this._firstWaitScheduler.schedule(this._firstWaitTime),this._loadingMessageScheduler.schedule(this._loadingMessageTime));else switch(this._state){case 0:this._triggerAsyncComputation(),this._secondWaitScheduler.cancel(),this._triggerSyncComputation();break;case 2: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(0,!1)}}class o7{constructor(e,t,n,o){this.priority=e,this.range=t,this.initialMousePosX=n,this.initialMousePosY=o,this.type=1}equals(e){return e.type===1&&this.range.equalsRange(e.range)}canAdoptVisibleHover(e,t){return e.type===1&&t.lineNumber===this.range.startLineNumber}}class xM{constructor(e,t,n,o,r,s){this.priority=e,this.owner=t,this.range=n,this.initialMousePosX=o,this.initialMousePosY=r,this.supportsMarkerHover=s,this.type=2}equals(e){return e.type===2&&this.owner===e.owner}canAdoptVisibleHover(e,t){return e.type===2&&this.owner===e.owner}}const Jb=new class{constructor(){this._participants=[]}register(e){this._participants.push(e)}getAll(){return this._participants}};class sY{constructor(){this._onDidWillResize=new le,this.onDidWillResize=this._onDidWillResize.event,this._onDidResize=new le,this.onDidResize=this._onDidResize.event,this._sashListener=new Be,this._size=new jn(0,0),this._minSize=new jn(0,0),this._maxSize=new jn(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER),this.domNode=document.createElement("div"),this._eastSash=new fs(this.domNode,{getVerticalSashLeft:()=>this._size.width},{orientation:0}),this._westSash=new fs(this.domNode,{getVerticalSashLeft:()=>0},{orientation:0}),this._northSash=new fs(this.domNode,{getHorizontalSashTop:()=>0},{orientation:1,orthogonalEdge:VP.North}),this._southSash=new fs(this.domNode,{getHorizontalSashTop:()=>this._size.height},{orientation:1,orthogonalEdge:VP.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,n=0;this._sashListener.add(st.any(this._northSash.onDidStart,this._eastSash.onDidStart,this._southSash.onDidStart,this._westSash.onDidStart)(()=>{e===void 0&&(this._onDidWillResize.fire(),e=this._size,t=0,n=0)})),this._sashListener.add(st.any(this._northSash.onDidEnd,this._eastSash.onDidEnd,this._southSash.onDidEnd,this._westSash.onDidEnd)(()=>{e!==void 0&&(e=void 0,t=0,n=0,this._onDidResize.fire({dimension:this._size,done:!0}))})),this._sashListener.add(this._eastSash.onDidChange(o=>{e&&(n=o.currentX-o.startX,this.layout(e.height+t,e.width+n),this._onDidResize.fire({dimension:this._size,done:!1,east:!0}))})),this._sashListener.add(this._westSash.onDidChange(o=>{e&&(n=-(o.currentX-o.startX),this.layout(e.height+t,e.width+n),this._onDidResize.fire({dimension:this._size,done:!1,west:!0}))})),this._sashListener.add(this._northSash.onDidChange(o=>{e&&(t=-(o.currentY-o.startY),this.layout(e.height+t,e.width+n),this._onDidResize.fire({dimension:this._size,done:!1,north:!0}))})),this._sashListener.add(this._southSash.onDidChange(o=>{e&&(t=o.currentY-o.startY,this.layout(e.height+t,e.width+n),this._onDidResize.fire({dimension:this._size,done:!1,south:!0}))})),this._sashListener.add(st.any(this._eastSash.onDidReset,this._westSash.onDidReset)(o=>{this._preferredSize&&(this.layout(this._size.height,this._preferredSize.width),this._onDidResize.fire({dimension:this._size,done:!0}))})),this._sashListener.add(st.any(this._northSash.onDidReset,this._southSash.onDidReset)(o=>{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,n,o){this._northSash.state=e?3:0,this._eastSash.state=t?3:0,this._southSash.state=n?3:0,this._westSash.state=o?3:0}layout(e=this.size.height,t=this.size.width){const{height:n,width:o}=this._minSize,{height:r,width:s}=this._maxSize;e=Math.max(n,Math.min(r,e)),t=Math.max(o,Math.min(s,t));const a=new jn(t,e);jn.equals(a,this._size)||(this.domNode.style.height=e+"px",this.domNode.style.width=t+"px",this._size=a,this._northSash.layout(),this._eastSash.layout(),this._southSash.layout(),this._westSash.layout())}clearSashHoverState(){this._eastSash.clearSashHoverState(),this._westSash.clearSashHoverState(),this._northSash.clearSashHoverState(),this._southSash.clearSashHoverState()}get size(){return this._size}set maxSize(e){this._maxSize=e}get maxSize(){return this._maxSize}set minSize(e){this._minSize=e}get minSize(){return this._minSize}set preferredSize(e){this._preferredSize=e}get preferredSize(){return this._preferredSize}}const fbt=30,gbt=24;class pbt extends _e{constructor(e,t=new jn(10,10)){super(),this._editor=e,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._resizableNode=this._register(new sY),this._contentPosition=null,this._isResizing=!1,this._resizableNode.domNode.style.position="absolute",this._resizableNode.minSize=jn.lift(t),this._resizableNode.layout(t.height,t.width),this._resizableNode.enableSashes(!0,!0,!0,!0),this._register(this._resizableNode.onDidResize(n=>{this._resize(new jn(n.dimension.width,n.dimension.height)),n.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(){var e;return!((e=this._contentPosition)===null||e===void 0)&&e.position?ae.lift(this._contentPosition.position):void 0}_availableVerticalSpaceAbove(e){const t=this._editor.getDomNode(),n=this._editor.getScrolledVisiblePosition(e);return!t||!n?void 0:Yo(t).top+n.top-fbt}_availableVerticalSpaceBelow(e){const t=this._editor.getDomNode(),n=this._editor.getScrolledVisiblePosition(e);if(!t||!n)return;const o=Yo(t),r=mS(t.ownerDocument.body),s=o.top+n.top+n.height;return r.height-s-gbt}_findPositionPreference(e,t){var n,o;const r=Math.min((n=this._availableVerticalSpaceBelow(t))!==null&&n!==void 0?n:1/0,e),s=Math.min((o=this._availableVerticalSpaceAbove(t))!==null&&o!==void 0?o:1/0,e),a=Math.min(Math.max(s,r),e),l=Math.min(e,a);let c;return this._editor.getOption(60).above?c=l<=s?1:2:c=l<=r?2:1,c===1?this._resizableNode.enableSashes(!0,!0,!1,!1):this._resizableNode.enableSashes(!1,!0,!0,!1),c}_resize(e){this._resizableNode.layout(e.height,e.width)}}var aY=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},v0=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},LM,Ch;const Ale=He;let cO=LM=class extends _e{constructor(e,t,n){super(),this._editor=e,this._instantiationService=t,this._keybindingService=n,this._currentResult=null,this._widget=this._register(this._instantiationService.createInstance(nv,this._editor)),this._participants=[];for(const o of Jb.getAll())this._participants.push(this._instantiationService.createInstance(o,this._editor));this._participants.sort((o,r)=>o.hoverOrdinal-r.hoverOrdinal),this._computer=new dO(this._editor,this._participants),this._hoverOperation=this._register(new cye(this._editor,this._computer)),this._register(this._hoverOperation.onResult(o=>{if(!this._computer.anchor)return;const r=o.hasLoadingMessage?this._addLoadingMessage(o.value):o.value;this._withResult(new uye(this._computer.anchor,r,o.isComplete))})),this._register(No(this._widget.getDomNode(),"keydown",o=>{o.equals(9)&&this.hide()})),this._register(oo.onDidChange(()=>{this._widget.position&&this._currentResult&&this._setCurrentResult(this._currentResult)}))}get widget(){return this._widget}maybeShowAt(e){if(this._widget.isResizing)return!0;const t=[];for(const o of this._participants)if(o.suggestHoverAnchor){const r=o.suggestHoverAnchor(e);r&&t.push(r)}const n=e.target;if(n.type===6&&t.push(new o7(0,n.range,e.event.posx,e.event.posy)),n.type===7){const o=this._editor.getOption(50).typicalHalfwidthCharacterWidth/2;!n.detail.isAfterLines&&typeof n.detail.horizontalDistanceToText=="number"&&n.detail.horizontalDistanceToTextr.priority-o.priority),this._startShowingOrUpdateHover(t[0],0,0,!1,e))}startShowingAtRange(e,t,n,o){this._startShowingOrUpdateHover(new o7(0,e,void 0,void 0),t,n,o,null)}_startShowingOrUpdateHover(e,t,n,o,r){return!this._widget.position||!this._currentResult?e?(this._startHoverOperationIfNecessary(e,t,n,o,!1),!0):!1:this._editor.getOption(60).sticky&&r&&this._widget.isMouseGettingCloser(r.event.posx,r.event.posy)?(e&&this._startHoverOperationIfNecessary(e,t,n,o,!0),!0):e?e&&this._currentResult.anchor.equals(e)?!0:e.canAdoptVisibleHover(this._currentResult.anchor,this._widget.position)?(this._setCurrentResult(this._currentResult.filter(e)),this._startHoverOperationIfNecessary(e,t,n,o,!1),!0):(this._setCurrentResult(null),this._startHoverOperationIfNecessary(e,t,n,o,!1),!0):(this._setCurrentResult(null),!1)}_startHoverOperationIfNecessary(e,t,n,o,r){this._computer.anchor&&this._computer.anchor.equals(e)||(this._hoverOperation.cancel(),this._computer.anchor=e,this._computer.shouldFocus=o,this._computer.source=n,this._computer.insistOnKeepingHoverVisible=r,this._hoverOperation.start(t))}_setCurrentResult(e){this._currentResult!==e&&(e&&e.messages.length===0&&(e=null),this._currentResult=e,this._currentResult?this._renderMessages(this._currentResult.anchor,this._currentResult.messages):this._widget.hide())}hide(){this._computer.anchor=null,this._hoverOperation.cancel(),this._setCurrentResult(null)}get isColorPickerVisible(){return this._widget.isColorPickerVisible}get isVisibleFromKeyboard(){return this._widget.isVisibleFromKeyboard}get isVisible(){return this._widget.isVisible}get isFocused(){return this._widget.isFocused}get isResizing(){return this._widget.isResizing}containsNode(e){return e?this._widget.getDomNode().contains(e):!1}_addLoadingMessage(e){if(this._computer.anchor){for(const t of this._participants)if(t.createLoadingMessage){const n=t.createLoadingMessage(this._computer.anchor);if(n)return e.slice(0).concat([n])}}return e}_withResult(e){this._widget.position&&this._currentResult&&this._currentResult.isComplete&&(!e.isComplete||this._computer.insistOnKeepingHoverVisible&&e.messages.length===0)||this._setCurrentResult(e)}_renderMessages(e,t){const{showAtPosition:n,showAtSecondaryPosition:o,highlightRange:r}=LM.computeHoverRanges(this._editor,e.range,t),s=new Be,a=s.add(new uO(this._keybindingService)),l=document.createDocumentFragment();let c=null;const u={fragment:l,statusBar:a,setColorPicker:h=>c=h,onContentsChanged:()=>this._widget.onContentsChanged(),setMinimumDimensions:h=>this._widget.setMinimumDimensions(h),hide:()=>this.hide()};for(const h of this._participants){const f=t.filter(g=>g.owner===h);f.length>0&&s.add(h.renderHoverParts(u,f))}const d=t.some(h=>h.isBeforeContent);if(a.hasContent&&l.appendChild(a.hoverElement),l.hasChildNodes()){if(r){const h=this._editor.createDecorationsCollection();h.set([{range:r,options:LM._DECORATION_OPTIONS}]),s.add(zt(()=>{h.clear()}))}this._widget.showAt(l,new vbt(c,n,o,this._editor.getOption(60).above,this._computer.shouldFocus,this._computer.source,d,e.initialMousePosX,e.initialMousePosY,s))}else s.dispose()}static computeHoverRanges(e,t,n){let o=1;if(e.hasModel()){const c=e._getViewModel(),u=c.coordinatesConverter,d=u.convertModelRangeToViewRange(t),h=new ae(d.startLineNumber,c.getLineMinColumn(d.startLineNumber));o=u.convertViewPositionToModelPosition(h).column}const r=t.startLineNumber;let s=t.startColumn,a=n[0].range,l=null;for(const c of n)a=V.plusRange(a,c.range),c.range.startLineNumber===r&&c.range.endLineNumber===r&&(s=Math.max(Math.min(s,c.range.startColumn),o)),c.forceShowAtRange&&(l=c.range);return{showAtPosition:l?l.getStartPosition():new ae(r,t.startColumn),showAtSecondaryPosition:l?l.getStartPosition():new ae(r,s),highlightRange:a}}focus(){this._widget.focus()}scrollUp(){this._widget.scrollUp()}scrollDown(){this._widget.scrollDown()}scrollLeft(){this._widget.scrollLeft()}scrollRight(){this._widget.scrollRight()}pageUp(){this._widget.pageUp()}pageDown(){this._widget.pageDown()}goToTop(){this._widget.goToTop()}goToBottom(){this._widget.goToBottom()}};cO._DECORATION_OPTIONS=Jt.register({description:"content-hover-highlight",className:"hoverHighlight"});cO=LM=aY([v0(1,$t),v0(2,xi)],cO);class uye{constructor(e,t,n){this.anchor=e,this.messages=t,this.isComplete=n}filter(e){const t=this.messages.filter(n=>n.isValidForHoverAnchor(e));return t.length===this.messages.length?this:new mbt(this,this.anchor,t,this.isComplete)}}class mbt extends uye{constructor(e,t,n,o){super(t,n,o),this.original=e}filter(e){return this.original.filter(e)}}class vbt{constructor(e,t,n,o,r,s,a,l,c,u){this.colorPicker=e,this.showAtPosition=t,this.showAtSecondaryPosition=n,this.preferAbove=o,this.stoleFocus=r,this.source=s,this.isBeforeContent=a,this.initialMousePosX=l,this.initialMousePosY=c,this.disposables=u,this.closestMouseDistance=void 0}}const Ple=30,r7=10,_bt=6;let nv=Ch=class extends pbt{get isColorPickerVisible(){var e;return Boolean((e=this._visibleData)===null||e===void 0?void 0:e.colorPicker)}get isVisibleFromKeyboard(){var e;return((e=this._visibleData)===null||e===void 0?void 0:e.source)===1}get isVisible(){var e;return(e=this._hoverVisibleKey.get())!==null&&e!==void 0?e:!1}get isFocused(){var e;return(e=this._hoverFocusedKey.get())!==null&&e!==void 0?e:!1}constructor(e,t,n,o,r){const s=e.getOption(66)+8,a=150,l=new jn(a,s);super(e,l),this._configurationService=n,this._accessibilityService=o,this._keybindingService=r,this._hover=this._register(new lye),this._minimumSize=l,this._hoverVisibleKey=Q.hoverVisible.bindTo(t),this._hoverFocusedKey=Q.hoverFocused.bindTo(t),Ae(this._resizableNode.domNode,this._hover.containerDomNode),this._resizableNode.domNode.style.zIndex="50",this._register(this._editor.onDidLayoutChange(()=>this._layout())),this._register(this._editor.onDidChangeConfiguration(u=>{u.hasChanged(50)&&this._updateFont()}));const c=this._register(gf(this._resizableNode.domNode));this._register(c.onDidFocus(()=>{this._hoverFocusedKey.set(!0)})),this._register(c.onDidBlur(()=>{this._hoverFocusedKey.set(!1)})),this._setHoverData(void 0),this._layout(),this._editor.addContentWidget(this)}dispose(){var e;super.dispose(),(e=this._visibleData)===null||e===void 0||e.disposables.dispose(),this._editor.removeContentWidget(this)}getId(){return Ch.ID}static _applyDimensions(e,t,n){const o=typeof t=="number"?`${t}px`:t,r=typeof n=="number"?`${n}px`:n;e.style.width=o,e.style.height=r}_setContentsDomNodeDimensions(e,t){const n=this._hover.contentsDomNode;return Ch._applyDimensions(n,e,t)}_setContainerDomNodeDimensions(e,t){const n=this._hover.containerDomNode;return Ch._applyDimensions(n,e,t)}_setHoverWidgetDimensions(e,t){this._setContentsDomNodeDimensions(e,t),this._setContainerDomNodeDimensions(e,t),this._layoutContentWidget()}static _applyMaxDimensions(e,t,n){const o=typeof t=="number"?`${t}px`:t,r=typeof n=="number"?`${n}px`:n;e.style.maxWidth=o,e.style.maxHeight=r}_setHoverWidgetMaxDimensions(e,t){Ch._applyMaxDimensions(this._hover.contentsDomNode,e,t),Ch._applyMaxDimensions(this._hover.containerDomNode,e,t),this._hover.containerDomNode.style.setProperty("--vscode-hover-maxWidth",typeof e=="number"?`${e}px`:e),this._layoutContentWidget()}_hasHorizontalScrollbar(){const e=this._hover.scrollbar.getScrollDimensions();return e.scrollWidth>e.width}_adjustContentsBottomPadding(){const e=this._hover.contentsDomNode,t=`${this._hover.scrollbar.options.horizontalScrollbarSize}px`;e.style.paddingBottom!==t&&(e.style.paddingBottom=t)}_setAdjustedHoverWidgetDimensions(e){this._setHoverWidgetMaxDimensions("none","none");const t=e.width,n=e.height;this._setHoverWidgetDimensions(t,n),this._hasHorizontalScrollbar()&&(this._adjustContentsBottomPadding(),this._setContentsDomNodeDimensions(t,n-r7))}_updateResizableNodeMaxDimensions(){var e,t;const n=(e=this._findMaximumRenderingWidth())!==null&&e!==void 0?e:1/0,o=(t=this._findMaximumRenderingHeight())!==null&&t!==void 0?t:1/0;this._resizableNode.maxSize=new jn(n,o),this._setHoverWidgetMaxDimensions(n,o)}_resize(e){var t,n;Ch._lastDimensions=new jn(e.width,e.height),this._setAdjustedHoverWidgetDimensions(e),this._resizableNode.layout(e.height,e.width),this._updateResizableNodeMaxDimensions(),this._hover.scrollbar.scanDomNode(),this._editor.layoutContentWidget(this),(n=(t=this._visibleData)===null||t===void 0?void 0:t.colorPicker)===null||n===void 0||n.layout()}_findAvailableSpaceVertically(){var e;const t=(e=this._visibleData)===null||e===void 0?void 0:e.showAtPosition;if(!!t)return this._positionPreference===1?this._availableVerticalSpaceAbove(t):this._availableVerticalSpaceBelow(t)}_findMaximumRenderingHeight(){const e=this._findAvailableSpaceVertically();if(!e)return;let t=_bt;return Array.from(this._hover.contentsDomNode.children).forEach(n=>{t+=n.clientHeight}),this._hasHorizontalScrollbar()&&(t+=r7),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=="undefined"?0:this._contentWidth-2;return e||this._hover.containerDomNode.clientWidththis._visibleData.closestMouseDistance+4?!1:(this._visibleData.closestMouseDistance=Math.min(this._visibleData.closestMouseDistance,o),!0)}_setHoverData(e){var t;(t=this._visibleData)===null||t===void 0||t.disposables.dispose(),this._visibleData=e,this._hoverVisibleKey.set(!!e),this._hover.containerDomNode.classList.toggle("hidden",!e)}_layout(){const{fontSize:e,lineHeight:t}=this._editor.getOption(50),n=this._hover.contentsDomNode;n.style.fontSize=`${e}px`,n.style.lineHeight=`${t/e}`,this._updateMaxDimensions()}_updateFont(){Array.prototype.slice.call(this._hover.contentsDomNode.getElementsByClassName("code")).forEach(t=>this._editor.applyFontInfo(t))}_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,Ch._lastDimensions.height),t=Math.max(this._editor.getLayoutInfo().width*.66,500,Ch._lastDimensions.width);this._setHoverWidgetMaxDimensions(t,e)}_render(e,t){this._setHoverData(t),this._updateFont(),this._updateContent(e),this._updateMaxDimensions(),this.onContentsChanged(),this._editor.render()}getPosition(){var e;return this._visibleData?{position:this._visibleData.showAtPosition,secondaryPosition:this._visibleData.showAtSecondaryPosition,positionAffinity:this._visibleData.isBeforeContent?3:void 0,preference:[(e=this._positionPreference)!==null&&e!==void 0?e:1]}:null}showAt(e,t){var n,o,r,s;if(!this._editor||!this._editor.hasModel())return;this._render(e,t);const a=c0(this._hover.containerDomNode),l=t.showAtPosition;this._positionPreference=(n=this._findPositionPreference(a,l))!==null&&n!==void 0?n:1,this.onContentsChanged(),t.stoleFocus&&this._hover.containerDomNode.focus(),(o=t.colorPicker)===null||o===void 0||o.layout();const c=cbt(this._configurationService.getValue("accessibility.verbosity.hover")===!0&&this._accessibilityService.isScreenReaderOptimized(),(s=(r=this._keybindingService.lookupKeybinding("editor.action.accessibleView"))===null||r===void 0?void 0:r.getAriaLabel())!==null&&s!==void 0?s:"");c&&(this._hover.contentsDomNode.ariaLabel=this._hover.contentsDomNode.textContent+", "+c)}hide(){if(!this._visibleData)return;const e=this._visibleData.stoleFocus||this._hoverFocusedKey.get();this._setHoverData(void 0),this._resizableNode.maxSize=new jn(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")}_adjustHoverHeightForScrollbar(e){var t;const n=this._hover.containerDomNode,o=this._hover.contentsDomNode,r=(t=this._findMaximumRenderingHeight())!==null&&t!==void 0?t:1/0;this._setContainerDomNodeDimensions(La(n),Math.min(r,e)),this._setContentsDomNodeDimensions(La(o),Math.min(r,e-r7))}setMinimumDimensions(e){this._minimumSize=new jn(Math.max(this._minimumSize.width,e.width),Math.max(this._minimumSize.height,e.height)),this._updateMinimumWidth()}_updateMinimumWidth(){const e=typeof this._contentWidth=="undefined"?this._minimumSize.width:Math.min(this._contentWidth,this._minimumSize.width);this._resizableNode.minSize=new jn(e,this._minimumSize.height)}onContentsChanged(){var e;this._removeConstraintsRenderNormally();const t=this._hover.containerDomNode;let n=c0(t),o=La(t);if(this._resizableNode.layout(n,o),this._setHoverWidgetDimensions(o,n),n=c0(t),o=La(t),this._contentWidth=o,this._updateMinimumWidth(),this._resizableNode.layout(n,o),this._hasHorizontalScrollbar()&&(this._adjustContentsBottomPadding(),this._adjustHoverHeightForScrollbar(n)),!((e=this._visibleData)===null||e===void 0)&&e.showAtPosition){const r=c0(this._hover.containerDomNode);this._positionPreference=this._findPositionPreference(r,this._visibleData.showAtPosition)}this._layoutContentWidget()}focus(){this._hover.containerDomNode.focus()}scrollUp(){const e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._editor.getOption(50);this._hover.scrollbar.setScrollPosition({scrollTop:e-t.lineHeight})}scrollDown(){const e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._editor.getOption(50);this._hover.scrollbar.setScrollPosition({scrollTop:e+t.lineHeight})}scrollLeft(){const e=this._hover.scrollbar.getScrollPosition().scrollLeft;this._hover.scrollbar.setScrollPosition({scrollLeft:e-Ple})}scrollRight(){const e=this._hover.scrollbar.getScrollPosition().scrollLeft;this._hover.scrollbar.setScrollPosition({scrollLeft:e+Ple})}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})}};nv.ID="editor.contrib.resizableContentHoverWidget";nv._lastDimensions=new jn(0,0);nv=Ch=aY([v0(1,Ut),v0(2,En),v0(3,pp),v0(4,xi)],nv);let uO=class extends _e{get hasContent(){return this._hasContent}constructor(e){super(),this._keybindingService=e,this._hasContent=!1,this.hoverElement=Ale("div.hover-row.status-bar"),this.actionsElement=Ae(this.hoverElement,Ale("div.actions"))}addAction(e){const t=this._keybindingService.lookupKeybinding(e.commandId),n=t?t.getLabel():null;return this._hasContent=!0,this._register(rY.render(this.actionsElement,e,n))}append(e){const t=Ae(this.actionsElement,e);return this._hasContent=!0,t}};uO=aY([v0(0,xi)],uO);class dO{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=0,this._insistOnKeepingHoverVisible=!1}static _getLineDecorations(e,t){if(t.type!==1&&!t.supportsMarkerHover)return[];const n=e.getModel(),o=t.range.startLineNumber;if(o>n.getLineCount())return[];const r=n.getLineMaxColumn(o);return e.getLineDecorations(o).filter(s=>{if(s.options.isWholeLine)return!0;const a=s.range.startLineNumber===o?s.range.startColumn:1,l=s.range.endLineNumber===o?s.range.endColumn:r;if(s.options.showIfCollapsed){if(a>t.range.startColumn+1||t.range.endColumn-1>l)return!1}else if(a>t.range.startColumn||t.range.endColumn>l)return!1;return!0})}computeAsync(e){const t=this._anchor;if(!this._editor.hasModel()||!t)return Wo.EMPTY;const n=dO._getLineDecorations(this._editor,t);return Wo.merge(this._participants.map(o=>o.computeAsync?o.computeAsync(t,n,e):Wo.EMPTY))}computeSync(){if(!this._editor.hasModel()||!this._anchor)return[];const e=dO._getLineDecorations(this._editor,this._anchor);let t=[];for(const n of this._participants)t=t.concat(n.computeSync(this._anchor,e));return df(t)}}function Ole(i,e,t,n,o,r){const s=t+o/2,a=n+r/2,l=Math.max(Math.abs(i-s)-o/2,0),c=Math.max(Math.abs(e-a)-r/2,0);return Math.sqrt(l*l+c*c)}const Fle=He;class Bw extends _e{constructor(e,t,n){super(),this._renderDisposeables=this._register(new Be),this._editor=e,this._isVisible=!1,this._messages=[],this._hover=this._register(new lye),this._hover.containerDomNode.classList.toggle("hidden",!this._isVisible),this._markdownRenderer=this._register(new cp({editor:this._editor},t,n)),this._computer=new bbt(this._editor),this._hoverOperation=this._register(new cye(this._editor,this._computer)),this._register(this._hoverOperation.onResult(o=>{this._withResult(o.value)})),this._register(this._editor.onDidChangeModelDecorations(()=>this._onModelDecorationsChanged())),this._register(this._editor.onDidChangeConfiguration(o=>{o.hasChanged(50)&&this._updateFont()})),this._editor.addOverlayWidget(this)}dispose(){this._editor.removeOverlayWidget(this),super.dispose()}getId(){return Bw.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(0))}startShowingAt(e){this._computer.lineNumber!==e&&(this._hoverOperation.cancel(),this.hide(),this._computer.lineNumber=e,this._hoverOperation.start(0))}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 n=document.createDocumentFragment();for(const o of t){const r=Fle("div.hover-row.markdown-hover"),s=Ae(r,Fle("div.hover-contents")),a=this._renderDisposeables.add(this._markdownRenderer.render(o.value));s.appendChild(a.element),n.appendChild(r)}this._updateContents(n),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(),n=this._editor.getTopForLineNumber(e),o=this._editor.getScrollTop(),r=this._editor.getOption(66),s=this._hover.containerDomNode.clientHeight,a=n-o-(s-r)/2;this._hover.containerDomNode.style.left=`${t.glyphMarginLeft+t.glyphMarginWidth}px`,this._hover.containerDomNode.style.top=`${Math.max(Math.round(a),0)}px`}}Bw.ID="editor.contrib.modesGlyphHoverWidget";class bbt{get lineNumber(){return this._lineNumber}set lineNumber(e){this._lineNumber=e}constructor(e){this._editor=e,this._lineNumber=-1}computeSync(){const e=o=>({value:o}),t=this._editor.getLineDecorations(this._lineNumber),n=[];if(!t)return n;for(const o of t){if(!o.options.glyphMarginClassName)continue;const r=o.options.glyphMarginHoverMessage;!r||Ry(r)||n.push(...Eq(r).map(e))}return n}}var Cbt=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};class wbt{constructor(e,t,n){this.provider=e,this.hover=t,this.ordinal=n}}function ybt(i,e,t,n,o){return Cbt(this,void 0,void 0,function*(){try{const r=yield Promise.resolve(i.provideHover(t,n,o));if(r&&xbt(r))return new wbt(i,r,e)}catch(r){$o(r)}})}function lY(i,e,t,n){const r=i.ordered(e).map((s,a)=>ybt(s,a,e,t,n));return Wo.fromPromises(r).coalesce()}function Sbt(i,e,t,n){return lY(i,e,t,n).map(o=>o.hover).toPromise()}Nf("_executeHoverProvider",(i,e,t)=>{const n=i.get(pt);return Sbt(n.hoverProvider,e,t,_n.None)});function xbt(i){const e=typeof i.range!="undefined",t=typeof i.contents!="undefined"&&i.contents&&i.contents.length>0;return e&&t}var Lbt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},G2=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const Ble=He;class Dd{constructor(e,t,n,o,r){this.owner=e,this.range=t,this.contents=n,this.isBeforeContent=o,this.ordinal=r}isValidForHoverAnchor(e){return e.type===1&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}let hO=class{constructor(e,t,n,o,r){this._editor=e,this._languageService=t,this._openerService=n,this._configurationService=o,this._languageFeaturesService=r,this.hoverOrdinal=3}createLoadingMessage(e){return new Dd(this,e.range,[new is().appendText(C("modesContentHover.loading","Loading..."))],!1,2e3)}computeSync(e,t){if(!this._editor.hasModel()||e.type!==1)return[];const n=this._editor.getModel(),o=e.range.startLineNumber,r=n.getLineMaxColumn(o),s=[];let a=1e3;const l=n.getLineLength(o),c=n.getLanguageIdAtPosition(e.range.startLineNumber,e.range.startColumn),u=this._editor.getOption(116),d=this._configurationService.getValue("editor.maxTokenizationLineLength",{overrideIdentifier:c});let h=!1;u>=0&&l>u&&e.range.startColumn>=u&&(h=!0,s.push(new Dd(this,e.range,[{value:C("stopped rendering","Rendering paused for long line for performance reasons. This can be configured via `editor.stopRenderingLineAfter`.")}],!1,a++))),!h&&typeof d=="number"&&l>=d&&s.push(new Dd(this,e.range,[{value:C("too many characters","Tokenization is skipped for long lines for performance reasons. This can be configured via `editor.maxTokenizationLineLength`.")}],!1,a++));let f=!1;for(const g of t){const p=g.range.startLineNumber===o?g.range.startColumn:1,v=g.range.endLineNumber===o?g.range.endColumn:r,m=g.options.hoverMessage;if(!m||Ry(m))continue;g.options.beforeContentClassName&&(f=!0);const _=new V(e.range.startLineNumber,p,e.range.startLineNumber,v);s.push(new Dd(this,_,Eq(m),f,a++))}return s}computeAsync(e,t,n){if(!this._editor.hasModel()||e.type!==1)return Wo.EMPTY;const o=this._editor.getModel();if(!this._languageFeaturesService.hoverProvider.has(o))return Wo.EMPTY;const r=new ae(e.range.startLineNumber,e.range.startColumn);return lY(this._languageFeaturesService.hoverProvider,o,r,n).filter(s=>!Ry(s.hover.contents)).map(s=>{const a=s.hover.range?V.lift(s.hover.range):e.range;return new Dd(this,a,s.hover.contents,!1,s.ordinal)})}renderHoverParts(e,t){return dye(e,t,this._editor,this._languageService,this._openerService)}};hO=Lbt([G2(1,Ki),G2(2,pl),G2(3,En),G2(4,pt)],hO);function dye(i,e,t,n,o){e.sort((s,a)=>s.ordinal-a.ordinal);const r=new Be;for(const s of e)for(const a of s.contents){if(Ry(a))continue;const l=Ble("div.hover-row.markdown-hover"),c=Ae(l,Ble("div.hover-contents")),u=r.add(new cp({editor:t},n,o));r.add(u.onDidRenderAsync(()=>{c.className="hover-contents code-hover-contents",i.onContentsChanged()}));const d=r.add(u.render(a));c.appendChild(d.element),i.fragment.appendChild(l)}return r}var hye=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},fO=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};class Wle{constructor(e,t,n){this.marker=e,this.index=t,this.total=n}}let xz=class{constructor(e,t,n){this._markerService=t,this._configService=n,this._onDidChange=new le,this.onDidChange=this._onDidChange.event,this._dispoables=new Be,this._markers=[],this._nextIdx=-1,Rt.isUri(e)?this._resourceFilter=a=>a.toString()===e.toString():e&&(this._resourceFilter=e);const o=this._configService.getValue("problems.sortOrder"),r=(a,l)=>{let c=RD(a.resource.toString(),l.resource.toString());return c===0&&(o==="position"?c=V.compareRangesUsingStarts(a,l)||ao.compare(a.severity,l.severity):c=ao.compare(a.severity,l.severity)||V.compareRangesUsingStarts(a,l)),c},s=()=>{this._markers=this._markerService.read({resource:Rt.isUri(e)?e:void 0,severities:ao.Error|ao.Warning|ao.Info}),typeof e=="function"&&(this._markers=this._markers.filter(a=>this._resourceFilter(a.resource))),this._markers.sort(r)};s(),this._dispoables.add(t.onMarkerChanged(a=>{(!this._resourceFilter||a.some(l=>this._resourceFilter(l)))&&(s(),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 Wle(e,this._nextIdx+1,this._markers.length)}_initIdx(e,t,n){let o=!1,r=this._markers.findIndex(s=>s.resource.toString()===e.uri.toString());r<0&&(r=xD(this._markers,{resource:e.uri},(s,a)=>RD(s.resource.toString(),a.resource.toString())),r<0&&(r=~r));for(let s=r;so.resource.toString()===e.toString());if(!(n<0)){for(;n=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Y1=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},Dz;class Dbt{constructor(e,t,n,o,r){this._openerService=o,this._labelService=r,this._lines=0,this._longestLineLength=0,this._relatedDiagnostics=new WeakMap,this._disposables=new Be,this._editor=t;const s=document.createElement("div");s.className="descriptioncontainer",this._messageBlock=document.createElement("div"),this._messageBlock.classList.add("message"),this._messageBlock.setAttribute("aria-live","assertive"),this._messageBlock.setAttribute("role","alert"),s.appendChild(this._messageBlock),this._relatedBlock=document.createElement("div"),s.appendChild(this._relatedBlock),this._disposables.add(No(this._relatedBlock,"click",a=>{a.preventDefault();const l=this._relatedDiagnostics.get(a.target);l&&n(l)})),this._scrollable=new cbe(s,{horizontal:1,vertical:1,useShadows:!1,horizontalScrollbarSize:6,verticalScrollbarSize:6}),e.appendChild(this._scrollable.getDomNode()),this._disposables.add(this._scrollable.onScroll(a=>{s.style.left=`-${a.scrollLeft}px`,s.style.top=`-${a.scrollTop}px`})),this._disposables.add(this._scrollable)}dispose(){si(this._disposables)}update(e){const{source:t,message:n,relatedInformation:o,code:r}=e;let s=((t==null?void 0:t.length)||0)+2;r&&(typeof r=="string"?s+=r.length:s+=r.value.length);const a=ff(n);this._lines=a.length,this._longestLineLength=0;for(const h of a)this._longestLineLength=Math.max(h.length+s,this._longestLineLength);Ur(this._messageBlock),this._messageBlock.setAttribute("aria-label",this.getAriaLabel(e)),this._editor.applyFontInfo(this._messageBlock);let l=this._messageBlock;for(const h of a)l=document.createElement("div"),l.innerText=h,h===""&&(l.style.height=this._messageBlock.style.lineHeight),this._messageBlock.appendChild(l);if(t||r){const h=document.createElement("span");if(h.classList.add("details"),l.appendChild(h),t){const f=document.createElement("span");f.innerText=t,f.classList.add("source"),h.appendChild(f)}if(r)if(typeof r=="string"){const f=document.createElement("span");f.innerText=`(${r})`,f.classList.add("code"),h.appendChild(f)}else{this._codeLink=He("a.code-link"),this._codeLink.setAttribute("href",`${r.target.toString()}`),this._codeLink.onclick=g=>{this._openerService.open(r.target,{allowCommands:!0}),g.preventDefault(),g.stopPropagation()};const f=Ae(this._codeLink,He("span"));f.innerText=r.value,h.appendChild(this._codeLink)}}if(Ur(this._relatedBlock),this._editor.applyFontInfo(this._relatedBlock),ws(o)){const h=this._relatedBlock.appendChild(document.createElement("div"));h.style.paddingTop=`${Math.floor(this._editor.getOption(66)*.66)}px`,this._lines+=1;for(const f of o){const g=document.createElement("div"),p=document.createElement("a");p.classList.add("filename"),p.innerText=`${this._labelService.getUriBasenameLabel(f.resource)}(${f.startLineNumber}, ${f.startColumn}): `,p.title=this._labelService.getUriLabel(f.resource),this._relatedDiagnostics.set(p,f);const v=document.createElement("span");v.innerText=f.message,g.appendChild(p),g.appendChild(v),this._lines+=1,h.appendChild(g)}}const c=this._editor.getOption(50),u=Math.ceil(c.typicalFullwidthCharacterWidth*this._longestLineLength*.75),d=c.lineHeight*this._lines;this._scrollable.setScrollDimensions({scrollWidth:u,scrollHeight:d})}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 ao.Error:t=C("Error","Error");break;case ao.Warning:t=C("Warning","Warning");break;case ao.Info:t=C("Info","Info");break;case ao.Hint:t=C("Hint","Hint");break}let n=C("marker aria","{0} at {1}. ",t,e.startLineNumber+":"+e.startColumn);const o=this._editor.getModel();return o&&e.startLineNumber<=o.getLineCount()&&e.startLineNumber>=1&&(n=`${o.getLineContent(e.startLineNumber)}, ${n}`),n}}let $y=Dz=class extends lO{constructor(e,t,n,o,r,s,a){super(e,{showArrow:!0,showFrame:!0,isAccessible:!0,frameWidth:1},r),this._themeService=t,this._openerService=n,this._menuService=o,this._contextKeyService=s,this._labelService=a,this._callOnDispose=new Be,this._onDidSelectRelatedInformation=new le,this.onDidSelectRelatedInformation=this._onDidSelectRelatedInformation.event,this._severity=ao.Warning,this._backgroundColor=ve.white,this._applyTheme(t.getColorTheme()),this._callOnDispose.add(t.onDidColorThemeChange(this._applyTheme.bind(this))),this.create()}_applyTheme(e){this._backgroundColor=e.getColor(Nbt);let t=kz,n=kbt;this._severity===ao.Warning?(t=EM,n=Ibt):this._severity===ao.Info&&(t=Iz,n=Tbt);const o=e.getColor(t),r=e.getColor(n);this.style({arrowColor:o,frameColor:o,headerBackgroundColor:r,primaryHeadingColor:e.getColor(Qwe),secondaryHeadingColor:e.getColor(Jwe)})}_applyStyles(){this._parentContainer&&(this._parentContainer.style.backgroundColor=this._backgroundColor?this._backgroundColor.toString():""),super._applyStyles()}dispose(){this._callOnDispose.dispose(),super.dispose()}_fillHead(e){super._fillHead(e),this._disposables.add(this._actionbarWidget.actionRunner.onWillRun(o=>this.editor.focus()));const t=[],n=this._menuService.createMenu(Dz.TitleMenu,this._contextKeyService);H1e(n,void 0,t),this._actionbarWidget.push(t,{label:!1,icon:!0,index:0}),n.dispose()}_fillTitleIcon(e){this._icon=Ae(e,He(""))}_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 Dbt(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,n){this._container.classList.remove("stale"),this._message.update(e),this._severity=e.severity,this._applyTheme(this._themeService.getColorTheme());const o=V.lift(e),r=this.editor.getPosition(),s=r&&o.containsPosition(r)?r:o.getStartPosition();super.show(s,this.computeRequiredHeight());const a=this.editor.getModel();if(a){const l=n>1?C("problems","{0} of {1} problems",t,n):C("change","{0} of {1} problem",t,n);this.setTitle(Hc(a.uri),l)}this._icon.className=`codicon ${Ez.className(ao.toSeverity(this._severity))}`,this.editor.revealPositionNearTop(s,0),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()}};$y.TitleMenu=new Z("gotoErrorTitleMenu");$y=Dz=Ebt([Y1(1,mr),Y1(2,pl),Y1(3,If),Y1(4,$t),Y1(5,Ut),Y1(6,Iy)],$y);const Vle=YD(Gh,gnt),Hle=YD(Hl,GD),$le=YD(Ra,XD),kz=J("editorMarkerNavigationError.background",{dark:Vle,light:Vle,hcDark:Ln,hcLight:Ln},C("editorMarkerNavigationError","Editor marker navigation widget error color.")),kbt=J("editorMarkerNavigationError.headerBackground",{dark:yt(kz,.1),light:yt(kz,.1),hcDark:null,hcLight:null},C("editorMarkerNavigationErrorHeaderBackground","Editor marker navigation widget error heading background.")),EM=J("editorMarkerNavigationWarning.background",{dark:Hle,light:Hle,hcDark:Ln,hcLight:Ln},C("editorMarkerNavigationWarning","Editor marker navigation widget warning color.")),Ibt=J("editorMarkerNavigationWarning.headerBackground",{dark:yt(EM,.1),light:yt(EM,.1),hcDark:"#0C141F",hcLight:yt(EM,.2)},C("editorMarkerNavigationWarningBackground","Editor marker navigation widget warning heading background.")),Iz=J("editorMarkerNavigationInfo.background",{dark:$le,light:$le,hcDark:Ln,hcLight:Ln},C("editorMarkerNavigationInfo","Editor marker navigation widget info color.")),Tbt=J("editorMarkerNavigationInfo.headerBackground",{dark:yt(Iz,.1),light:yt(Iz,.1),hcDark:null,hcLight:null},C("editorMarkerNavigationInfoHeaderBackground","Editor marker navigation widget info heading background.")),Nbt=J("editorMarkerNavigation.background",{dark:pr,light:pr,hcDark:pr,hcLight:pr},C("editorMarkerNavigationBackground","Editor marker navigation widget background."));var Rbt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},X2=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},gye=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},AL;let Fv=AL=class{static get(e){return e.getContribution(AL.ID)}constructor(e,t,n,o,r){this._markerNavigationService=t,this._contextKeyService=n,this._editorService=o,this._instantiationService=r,this._sessionDispoables=new Be,this._editor=e,this._widgetVisible=pye.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($y,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(n=>{var o,r,s;(!(!((o=this._model)===null||o===void 0)&&o.selected)||!V.containsPosition((r=this._model)===null||r===void 0?void 0:r.selected.marker,n.position))&&((s=this._model)===null||s===void 0||s.resetIndex())})),this._sessionDispoables.add(this._model.onDidChange(()=>{if(!this._widget||!this._widget.position||!this._model)return;const n=this._model.find(this._editor.getModel().uri,this._widget.position);n?this._widget.updateMarker(n.marker):this._widget.showStale()})),this._sessionDispoables.add(this._widget.onDidSelectRelatedInformation(n=>{this._editorService.openCodeEditor({resource:n.resource,options:{pinned:!0,revealIfOpened:!0,selection:V.lift(n).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 ae(e.startLineNumber,e.startColumn)),t.selected&&this._widget.showAtMarker(t.selected.marker,t.selected.index,t.selected.total)}}nagivate(e,t){var n,o;return gye(this,void 0,void 0,function*(){if(this._editor.hasModel()){const r=this._getOrCreateModel(t?void 0:this._editor.getModel().uri);if(r.move(e,this._editor.getModel(),this._editor.getPosition()),!r.selected)return;if(r.selected.marker.resource.toString()!==this._editor.getModel().uri.toString()){this._cleanUp();const s=yield this._editorService.openCodeEditor({resource:r.selected.marker.resource,options:{pinned:!1,revealIfOpened:!0,selectionRevealType:2,selection:r.selected.marker}},this._editor);s&&((n=AL.get(s))===null||n===void 0||n.close(),(o=AL.get(s))===null||o===void 0||o.nagivate(e,t))}else this._widget.showAtMarker(r.selected.marker,r.selected.index,r.selected.total)}})}};Fv.ID="editor.contrib.markerController";Fv=AL=Rbt([X2(1,fye),X2(2,Ut),X2(3,Jn),X2(4,$t)],Fv);class mF extends ft{constructor(e,t,n){super(n),this._next=e,this._multiFile=t}run(e,t){var n;return gye(this,void 0,void 0,function*(){t.hasModel()&&((n=Fv.get(t))===null||n===void 0||n.nagivate(this._next,this._multiFile))})}}class iv extends mF{constructor(){super(!0,!1,{id:iv.ID,label:iv.LABEL,alias:"Go to Next Problem (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:Q.focus,primary:578,weight:100},menuOpts:{menuId:$y.TitleMenu,title:iv.LABEL,icon:Eo("marker-navigation-next",Xe.arrowDown,C("nextMarkerIcon","Icon for goto next marker.")),group:"navigation",order:1}})}}iv.ID="editor.action.marker.next";iv.LABEL=C("markerAction.next.label","Go to Next Problem (Error, Warning, Info)");class M0 extends mF{constructor(){super(!1,!1,{id:M0.ID,label:M0.LABEL,alias:"Go to Previous Problem (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:Q.focus,primary:1602,weight:100},menuOpts:{menuId:$y.TitleMenu,title:M0.LABEL,icon:Eo("marker-navigation-previous",Xe.arrowUp,C("previousMarkerIcon","Icon for goto previous marker.")),group:"navigation",order:2}})}}M0.ID="editor.action.marker.prev";M0.LABEL=C("markerAction.previous.label","Go to Previous Problem (Error, Warning, Info)");class Mbt extends mF{constructor(){super(!0,!0,{id:"editor.action.marker.nextInFiles",label:C("markerAction.nextInFiles.label","Go to Next Problem in Files (Error, Warning, Info)"),alias:"Go to Next Problem in Files (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:Q.focus,primary:66,weight:100},menuOpts:{menuId:Z.MenubarGoMenu,title:C({key:"miGotoNextProblem",comment:["&& denotes a mnemonic"]},"Next &&Problem"),group:"6_problem_nav",order:1}})}}class Abt extends mF{constructor(){super(!1,!0,{id:"editor.action.marker.prevInFiles",label:C("markerAction.previousInFiles.label","Go to Previous Problem in Files (Error, Warning, Info)"),alias:"Go to Previous Problem in Files (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:Q.focus,primary:1090,weight:100},menuOpts:{menuId:Z.MenubarGoMenu,title:C({key:"miGotoPreviousProblem",comment:["&& denotes a mnemonic"]},"Previous &&Problem"),group:"6_problem_nav",order:2}})}}zn(Fv.ID,Fv,4);ze(iv);ze(M0);ze(Mbt);ze(Abt);const pye=new lt("markersNavigationVisible",!1),Pbt=Ir.bindToContribution(Fv.get);Ye(new Pbt({id:"closeMarkersNavigation",precondition:pye,handler:i=>i.close(),kbOpts:{weight:100+50,kbExpr:Q.focus,primary:9,secondary:[1033]}}));var Obt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},s7=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const uu=He;class Fbt{constructor(e,t,n){this.owner=e,this.range=t,this.marker=n}isValidForHoverAnchor(e){return e.type===1&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}const zle={type:1,filter:{include:Wt.QuickFix},triggerAction:hl.QuickFixHover};let Tz=class{constructor(e,t,n,o){this._editor=e,this._markerDecorationsService=t,this._openerService=n,this._languageFeaturesService=o,this.hoverOrdinal=1,this.recentMarkerCodeActionsInfo=void 0}computeSync(e,t){if(!this._editor.hasModel()||e.type!==1&&!e.supportsMarkerHover)return[];const n=this._editor.getModel(),o=e.range.startLineNumber,r=n.getLineMaxColumn(o),s=[];for(const a of t){const l=a.range.startLineNumber===o?a.range.startColumn:1,c=a.range.endLineNumber===o?a.range.endColumn:r,u=this._markerDecorationsService.getMarker(n.uri,a);if(!u)continue;const d=new V(e.range.startLineNumber,l,e.range.startLineNumber,c);s.push(new Fbt(this,d,u))}return s}renderHoverParts(e,t){if(!t.length)return _e.None;const n=new Be;t.forEach(r=>e.fragment.appendChild(this.renderMarkerHover(r,n)));const o=t.length===1?t[0]:t.sort((r,s)=>ao.compare(r.marker.severity,s.marker.severity))[0];return this.renderMarkerStatusbar(e,o,n),n}renderMarkerHover(e,t){const n=uu("div.hover-row"),o=Ae(n,uu("div.marker.hover-contents")),{source:r,message:s,code:a,relatedInformation:l}=e.marker;this._editor.applyFontInfo(o);const c=Ae(o,uu("span"));if(c.style.whiteSpace="pre-wrap",c.innerText=s,r||a)if(a&&typeof a!="string"){const u=uu("span");if(r){const g=Ae(u,uu("span"));g.innerText=r}const d=Ae(u,uu("a.code-link"));d.setAttribute("href",a.target.toString()),t.add(ke(d,"click",g=>{this._openerService.open(a.target,{allowCommands:!0}),g.preventDefault(),g.stopPropagation()}));const h=Ae(d,uu("span"));h.innerText=a.value;const f=Ae(o,u);f.style.opacity="0.6",f.style.paddingLeft="6px"}else{const u=Ae(o,uu("span"));u.style.opacity="0.6",u.style.paddingLeft="6px",u.innerText=r&&a?`${r}(${a})`:r||`(${a})`}if(ws(l))for(const{message:u,resource:d,startLineNumber:h,startColumn:f}of l){const g=Ae(o,uu("div"));g.style.marginTop="8px";const p=Ae(g,uu("a"));p.innerText=`${Hc(d)}(${h}, ${f}): `,p.style.cursor="pointer",t.add(ke(p,"click",m=>{m.stopPropagation(),m.preventDefault(),this._openerService&&this._openerService.open(d,{fromUserGesture:!0,editorOptions:{selection:{startLineNumber:h,startColumn:f}}}).catch(en)}));const v=Ae(g,uu("span"));v.innerText=u,this._editor.applyFontInfo(v)}return n}renderMarkerStatusbar(e,t,n){if((t.marker.severity===ao.Error||t.marker.severity===ao.Warning||t.marker.severity===ao.Info)&&e.statusBar.addAction({label:C("view problem","View Problem"),commandId:iv.ID,run:()=>{var o;e.hide(),(o=Fv.get(this._editor))===null||o===void 0||o.showAtMarker(t.marker),this._editor.focus()}}),!this._editor.getOption(90)){const o=e.statusBar.append(uu("div"));this.recentMarkerCodeActionsInfo&&(BP.makeKey(this.recentMarkerCodeActionsInfo.marker)===BP.makeKey(t.marker)?this.recentMarkerCodeActionsInfo.hasCodeActions||(o.textContent=C("noQuickFixes","No quick fixes available")):this.recentMarkerCodeActionsInfo=void 0);const r=this.recentMarkerCodeActionsInfo&&!this.recentMarkerCodeActionsInfo.hasCodeActions?_e.None:n.add(yv(()=>o.textContent=C("checkingForQuickFixes","Checking for quick fixes..."),200));o.textContent||(o.textContent=String.fromCharCode(160));const s=this.getCodeActions(t.marker);n.add(zt(()=>s.cancel())),s.then(a=>{if(r.dispose(),this.recentMarkerCodeActionsInfo={marker:t.marker,hasCodeActions:a.validActions.length>0},!this.recentMarkerCodeActionsInfo.hasCodeActions){a.dispose(),o.textContent=C("noQuickFixes","No quick fixes available");return}o.style.display="none";let l=!1;n.add(zt(()=>{l||a.dispose()})),e.statusBar.addAction({label:C("quick fixes","Quick Fix..."),commandId:ZX,run:c=>{l=!0;const u=Rv.get(this._editor),d=Yo(c);e.hide(),u==null||u.showCodeActions(zle,a,{x:d.left,y:d.top,width:d.width,height:d.height})}})},en)}}getCodeActions(e){return sr(t=>IE(this._languageFeaturesService.codeActionProvider,this._editor.getModel(),new V(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn),zle,qg.None,t))}};Tz=Obt([s7(1,hG),s7(2,pl),s7(3,pt)],Tz);const mye="editor.action.inlineSuggest.commit",vye="editor.action.inlineSuggest.showPrevious",_ye="editor.action.inlineSuggest.showNext";var Bbt=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};class Wbt extends _e{constructor(e,t,n={orientation:0}){super(),this.submenuActionViewItems=[],this.hasSecondaryActions=!1,this._onDidChangeDropdownVisibility=this._register(new DYe),this.onDidChangeDropdownVisibility=this._onDidChangeDropdownVisibility.event,this.disposables=this._register(new Be),this.options=n,this.lookupKeybindings=typeof this.options.getKeyBinding=="function",this.toggleMenuAction=this._register(new Fk(()=>{var o;return(o=this.toggleMenuActionViewItem)===null||o===void 0?void 0:o.show()},n.toggleMenuTitle)),this.element=document.createElement("div"),this.element.className="monaco-toolbar",e.appendChild(this.element),this.actionBar=this._register(new $c(this.element,{orientation:n.orientation,ariaLabel:n.ariaLabel,actionRunner:n.actionRunner,allowContextMenu:n.allowContextMenu,highlightToggledItems:n.highlightToggledItems,actionViewItemProvider:(o,r)=>{var s;if(o.id===Fk.ID)return this.toggleMenuActionViewItem=new NP(o,o.menuActions,t,{actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,keybindingProvider:this.options.getKeyBinding,classNames:Mt.asClassNameArray((s=n.moreIcon)!==null&&s!==void 0?s:Xe.toolBarMore),anchorAlignmentProvider:this.options.anchorAlignmentProvider,menuAsChild:!!this.options.renderDropdownAsChildElement,skipTelemetry:this.options.skipTelemetry}),this.toggleMenuActionViewItem.setActionContext(this.actionBar.context),this.disposables.add(this._onDidChangeDropdownVisibility.add(this.toggleMenuActionViewItem.onDidChangeVisibility)),this.toggleMenuActionViewItem;if(n.actionViewItemProvider){const a=n.actionViewItemProvider(o,r);if(a)return a}if(o instanceof py){const a=new NP(o,o.actions,t,{actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,keybindingProvider:this.options.getKeyBinding,classNames:o.class,anchorAlignmentProvider:this.options.anchorAlignmentProvider,menuAsChild:!!this.options.renderDropdownAsChildElement,skipTelemetry:this.options.skipTelemetry});return a.setActionContext(this.actionBar.context),this.submenuActionViewItems.push(a),this.disposables.add(this._onDidChangeDropdownVisibility.add(a.onDidChangeVisibility)),a}}}))}set actionRunner(e){this.actionBar.actionRunner=e}get actionRunner(){return this.actionBar.actionRunner}getElement(){return this.element}getItemAction(e){return this.actionBar.getAction(e)}setActions(e,t){this.clear();const n=e?e.slice(0):[];this.hasSecondaryActions=!!(t&&t.length>0),this.hasSecondaryActions&&t&&(this.toggleMenuAction.menuActions=t.slice(0),n.push(this.toggleMenuAction)),n.forEach(o=>{this.actionBar.push(o,{icon:!0,label:!1,keybinding:this.getKeybindingLabel(o)})})}getKeybindingLabel(e){var t,n,o;const r=this.lookupKeybindings?(n=(t=this.options).getKeyBinding)===null||n===void 0?void 0:n.call(t,e):void 0;return(o=r==null?void 0:r.getLabel())!==null&&o!==void 0?o:void 0}clear(){this.submenuActionViewItems=[],this.disposables.clear(),this.actionBar.clear()}dispose(){this.clear(),this.disposables.dispose(),super.dispose()}}class Fk extends la{constructor(e,t){t=t||C("moreActions","More Actions..."),super(Fk.ID,t,void 0,!0),this._menuActions=[],this.toggleDropdownMenu=e}run(){return Bbt(this,void 0,void 0,function*(){this.toggleDropdownMenu()})}get menuActions(){return this._menuActions}set menuActions(e){this._menuActions=e}}Fk.ID="toolbar.toggle.more";var Vbt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Zx=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let Nz=class extends Wbt{constructor(e,t,n,o,r,s,a){super(e,r,Object.assign(Object.assign({getKeyBinding:c=>{var u;return(u=s.lookupKeybinding(c.id))!==null&&u!==void 0?u:void 0}},t),{allowContextMenu:!0,skipTelemetry:typeof(t==null?void 0:t.telemetrySource)=="string"})),this._options=t,this._menuService=n,this._contextKeyService=o,this._contextMenuService=r,this._sessionDisposables=this._store.add(new Be);const l=t==null?void 0:t.telemetrySource;l&&this._store.add(this.actionBar.onDidRun(c=>a.publicLog2("workbenchActionExecuted",{id:c.action.id,from:l})))}setActions(e,t=[],n){var o,r,s;this._sessionDisposables.clear();const a=e.slice(),l=t.slice(),c=[];let u=0;const d=[];let h=!1;if(((o=this._options)===null||o===void 0?void 0:o.hiddenItemStrategy)!==-1)for(let f=0;fv==null?void 0:v.id)),g=this._options.overflowBehavior.maxItems-f.size;let p=0;for(let v=0;v=g&&(a[v]=void 0,d[v]=m))}}qie(a),qie(d),super.setActions(a,kr.join(d,l)),c.length>0&&this._sessionDisposables.add(ke(this.getElement(),"contextmenu",f=>{var g,p,v,m,_;const w=new Dc(f),y=this.getItemAction(w.target);if(!y)return;w.preventDefault(),w.stopPropagation();let L=!1;if(u===1&&((g=this._options)===null||g===void 0?void 0:g.hiddenItemStrategy)===0){L=!0;for(let I=0;Ithis._menuService.resetHiddenStates(n)}))),this._contextMenuService.showContextMenu({getAnchor:()=>w,getActions:()=>E,menuId:(v=this._options)===null||v===void 0?void 0:v.contextMenu,menuActionOptions:Object.assign({renderShortTitle:!0},(m=this._options)===null||m===void 0?void 0:m.menuOptions),skipTelemetry:typeof((_=this._options)===null||_===void 0?void 0:_.telemetrySource)=="string",contextKeyService:this._contextKeyService})}))}};Nz=Vbt([Zx(2,If),Zx(3,Ut),Zx(4,ju),Zx(5,xi),Zx(6,ec)],Nz);var cY=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},kd=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},DM;let Rz=class extends _e{constructor(e,t,n){super(),this.editor=e,this.model=t,this.instantiationService=n,this.alwaysShowToolbar=$r(this.editor.onDidChangeConfiguration,()=>this.editor.getOption(62).showToolbar==="always"),this.sessionPosition=void 0,this.position=In(this,o=>{var r,s,a;const l=(r=this.model.read(o))===null||r===void 0?void 0:r.ghostText.read(o);if(!this.alwaysShowToolbar.read(o)||!l||l.parts.length===0)return this.sessionPosition=void 0,null;const c=l.parts[0].column;this.sessionPosition&&this.sessionPosition.lineNumber!==l.lineNumber&&(this.sessionPosition=void 0);const u=new ae(l.lineNumber,Math.min(c,(a=(s=this.sessionPosition)===null||s===void 0?void 0:s.column)!==null&&a!==void 0?a:Number.MAX_SAFE_INTEGER));return this.sessionPosition=u,u}),this._register(Ja((o,r)=>{const s=this.model.read(o);if(!s||!this.alwaysShowToolbar.read(o))return;const a=r.add(this.instantiationService.createInstance(Bv,this.editor,!0,this.position,s.selectedInlineCompletionIndex,s.inlineCompletionsCount,s.selectedInlineCompletion.map(l=>{var c;return(c=l==null?void 0:l.inlineCompletion.source.inlineCompletions.commands)!==null&&c!==void 0?c:[]})));e.addContentWidget(a),r.add(zt(()=>e.removeContentWidget(a))),r.add(Ii(l=>{!this.position.read(l)||s.lastTriggerKind.read(l)!==Ug.Explicit&&s.triggerExplicitly()}))}))}};Rz=cY([kd(2,$t)],Rz);const Hbt=Eo("inline-suggestion-hints-next",Xe.chevronRight,C("parameterHintsNextIcon","Icon for show next parameter hint.")),$bt=Eo("inline-suggestion-hints-previous",Xe.chevronLeft,C("parameterHintsPreviousIcon","Icon for show previous parameter hint."));let Bv=DM=class extends _e{static get dropDownVisible(){return this._dropDownVisible}createCommandAction(e,t,n){const o=new la(e,t,n,!0,()=>this._commandService.executeCommand(e)),r=this.keybindingService.lookupKeybinding(e,this._contextKeyService);let s=t;return r&&(s=C({key:"content",comment:["A label","A keybinding"]},"{0} ({1})",t,r.getLabel())),o.tooltip=s,o}constructor(e,t,n,o,r,s,a,l,c,u,d){super(),this.editor=e,this.withBorder=t,this._position=n,this._currentSuggestionIdx=o,this._suggestionCount=r,this._extraCommands=s,this._commandService=a,this.keybindingService=c,this._contextKeyService=u,this._menuService=d,this.id=`InlineSuggestionHintsContentWidget${DM.id++}`,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this.nodes=Or("div.inlineSuggestionsHints",{className:this.withBorder?".withBorder":""},[Or("div@toolBar")]),this.previousAction=this.createCommandAction(vye,C("previous","Previous"),Mt.asClassName($bt)),this.availableSuggestionCountAction=new la("inlineSuggestionHints.availableSuggestionCount","",void 0,!1),this.nextAction=this.createCommandAction(_ye,C("next","Next"),Mt.asClassName(Hbt)),this.inlineCompletionsActionsMenus=this._register(this._menuService.createMenu(Z.InlineCompletionsActions,this._contextKeyService)),this.clearAvailableSuggestionCountLabelDebounced=this._register(new bi(()=>{this.availableSuggestionCountAction.label=""},100)),this.disableButtonsDebounced=this._register(new bi(()=>{this.previousAction.enabled=this.nextAction.enabled=!1},100)),this.lastCommands=[],this.toolBar=this._register(l.createInstance(Mz,this.nodes.toolBar,Z.InlineSuggestionToolbar,{menuOptions:{renderShortTitle:!0},toolbarOptions:{primaryGroup:h=>h.startsWith("primary")},actionViewItemProvider:(h,f)=>{if(h instanceof Ou)return l.createInstance(Ubt,h,void 0);if(h===this.availableSuggestionCountAction){const g=new zbt(void 0,h,{label:!0,icon:!1});return g.setClass("availableSuggestionCount"),g}},telemetrySource:"InlineSuggestionToolbar"})),this.toolBar.setPrependedPrimaryActions([this.previousAction,this.availableSuggestionCountAction,this.nextAction]),this._register(this.toolBar.onDidChangeDropdownVisibility(h=>{DM._dropDownVisible=h})),this._register(Ii(h=>{this._position.read(h),this.editor.layoutContentWidget(this)})),this._register(Ii(h=>{const f=this._suggestionCount.read(h),g=this._currentSuggestionIdx.read(h);f!==void 0?(this.clearAvailableSuggestionCountLabelDebounced.cancel(),this.availableSuggestionCountAction.label=`${g+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(Ii(h=>{const f=this._extraCommands.read(h);if(Lo(this.lastCommands,f))return;this.lastCommands=f;const g=f.map(p=>({class:void 0,id:p.id,enabled:!0,tooltip:p.tooltip||"",label:p.title,run:v=>this._commandService.executeCommand(p.id)}));for(const[p,v]of this.inlineCompletionsActionsMenus.getActions())for(const m of v)m instanceof Ou&&g.push(m);g.length>0&&g.unshift(new kr),this.toolBar.setAdditionalSecondaryActions(g)}))}getId(){return this.id}getDomNode(){return this.nodes.root}getPosition(){return{position:this._position.get(),preference:[1,2],positionAffinity:3}}};Bv._dropDownVisible=!1;Bv.id=0;Bv=DM=cY([kd(6,_o),kd(7,$t),kd(8,xi),kd(9,Ut),kd(10,If)],Bv);class zbt extends My{constructor(){super(...arguments),this._className=void 0}setClass(e){this._className=e}render(e){super.render(e),this._className&&e.classList.add(this._className)}}class Ubt extends ob{updateLabel(){const e=this._keybindingService.lookupKeybinding(this._action.id,this._contextKeyService);if(!e)return super.updateLabel();if(this.label){const t=Or("div.keybinding").root;new rT(t,Wl,Object.assign({disableTitle:!0},mft)).set(e),this.label.textContent=this._action.label,this.label.appendChild(t),this.label.classList.add("inlineSuggestionStatusBarItemLabel")}}}let Mz=class extends Nz{constructor(e,t,n,o,r,s,a,l){super(e,Object.assign({resetMenu:t},n),o,r,s,a,l),this.menuId=t,this.options2=n,this.menuService=o,this.contextKeyService=r,this.menu=this._store.add(this.menuService.createMenu(this.menuId,this.contextKeyService,{emitEventsForSubmenuChanges:!0})),this.additionalActions=[],this.prependedPrimaryActions=[],this._store.add(this.menu.onDidChange(()=>this.updateToolbar())),this.updateToolbar()}updateToolbar(){var e,t,n,o,r,s,a;const l=[],c=[];H1e(this.menu,(e=this.options2)===null||e===void 0?void 0:e.menuOptions,{primary:l,secondary:c},(n=(t=this.options2)===null||t===void 0?void 0:t.toolbarOptions)===null||n===void 0?void 0:n.primaryGroup,(r=(o=this.options2)===null||o===void 0?void 0:o.toolbarOptions)===null||r===void 0?void 0:r.shouldInlineSubmenu,(a=(s=this.options2)===null||s===void 0?void 0:s.toolbarOptions)===null||a===void 0?void 0:a.useSeparatorsInPrimaryActions),c.push(...this.additionalActions),l.unshift(...this.prependedPrimaryActions),this.setActions(l,c)}setPrependedPrimaryActions(e){Lo(this.prependedPrimaryActions,e,(t,n)=>t===n)||(this.prependedPrimaryActions=e,this.updateToolbar())}setAdditionalSecondaryActions(e){Lo(this.additionalActions,e,(t,n)=>t===n)||(this.additionalActions=e,this.updateToolbar())}};Mz=cY([kd(3,If),kd(4,Ut),kd(5,ju),kd(6,xi),kd(7,ec)],Mz);var jbt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Y2=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},Az;const Kbt=!1;let Ha=Az=class extends _e{static get(e){return e.getContribution(Az.ID)}constructor(e,t,n,o,r){super(),this._editor=e,this._instantiationService=t,this._openerService=n,this._languageService=o,this._keybindingService=r,this._toUnhook=new Be,this._hoverActivatedByColorDecoratorClick=!1,this._isMouseDown=!1,this._hoverClicked=!1,this._contentWidget=null,this._glyphWidget=null,this._reactToEditorMouseMoveRunner=this._register(new bi(()=>this._reactToEditorMouseMove(this._mouseMoveEvent),0)),this._hookEvents(),this._register(this._editor.onDidChangeConfiguration(s=>{s.hasChanged(60)&&(this._unhookEvents(),this._hookEvents())})),this._register(this._editor.onMouseLeave(()=>{this._mouseMoveEvent=void 0,this._reactToEditorMouseMoveRunner.cancel()}))}_hookEvents(){const e=()=>this._hideWidgets(),t=this._editor.getOption(60);this._isHoverEnabled=t.enabled,this._isHoverSticky=t.sticky,this._hidingDelay=t.hidingDelay,this._isHoverEnabled?(this._toUnhook.add(this._editor.onMouseDown(n=>this._onEditorMouseDown(n))),this._toUnhook.add(this._editor.onMouseUp(n=>this._onEditorMouseUp(n))),this._toUnhook.add(this._editor.onMouseMove(n=>this._onEditorMouseMove(n))),this._toUnhook.add(this._editor.onKeyDown(n=>this._onKeyDown(n)))):(this._toUnhook.add(this._editor.onMouseMove(n=>this._onEditorMouseMove(n))),this._toUnhook.add(this._editor.onKeyDown(n=>this._onKeyDown(n)))),this._toUnhook.add(this._editor.onMouseLeave(n=>this._onEditorMouseLeave(n))),this._toUnhook.add(this._editor.onDidChangeModel(e)),this._toUnhook.add(this._editor.onDidScrollChange(n=>this._onEditorScrollChanged(n)))}_unhookEvents(){this._toUnhook.clear()}_onEditorScrollChanged(e){(e.scrollTopChanged||e.scrollLeftChanged)&&this._hideWidgets()}_onEditorMouseDown(e){var t;this._isMouseDown=!0;const n=e.target;if(n.type===9&&n.detail===nv.ID){this._hoverClicked=!0;return}n.type===12&&n.detail===Bw.ID||(n.type!==12&&(this._hoverClicked=!1),!((t=this._contentWidget)===null||t===void 0)&&t.widget.isResizing||this._hideWidgets())}_onEditorMouseUp(e){this._isMouseDown=!1}_onEditorMouseLeave(e){var t,n;const o=e.event.browserEvent.relatedTarget;((t=this._contentWidget)===null||t===void 0?void 0:t.widget.isResizing)||((n=this._contentWidget)===null||n===void 0?void 0:n.containsNode(o))||this._hideWidgets()}_isMouseOverWidget(e){var t,n,o,r,s;const a=e.target;return!!(this._isHoverSticky&&a.type===9&&a.detail===nv.ID||this._isHoverSticky&&((t=this._contentWidget)===null||t===void 0?void 0:t.containsNode((n=e.event.browserEvent.view)===null||n===void 0?void 0:n.document.activeElement))&&!(!((r=(o=e.event.browserEvent.view)===null||o===void 0?void 0:o.getSelection())===null||r===void 0)&&r.isCollapsed)||!this._isHoverSticky&&a.type===9&&a.detail===nv.ID&&((s=this._contentWidget)===null||s===void 0?void 0:s.isColorPickerVisible)||this._isHoverSticky&&a.type===12&&a.detail===Bw.ID)}_onEditorMouseMove(e){var t,n,o,r;if(this._mouseMoveEvent=e,((t=this._contentWidget)===null||t===void 0?void 0:t.isFocused)||((n=this._contentWidget)===null||n===void 0?void 0:n.isResizing)||this._isMouseDown&&this._hoverClicked||this._isHoverSticky&&((o=this._contentWidget)===null||o===void 0?void 0:o.isVisibleFromKeyboard))return;if(this._isMouseOverWidget(e)){this._reactToEditorMouseMoveRunner.cancel();return}if(((r=this._contentWidget)===null||r===void 0?void 0:r.isVisible)&&this._isHoverSticky&&this._hidingDelay>0){this._reactToEditorMouseMoveRunner.isScheduled()||this._reactToEditorMouseMoveRunner.schedule(this._hidingDelay);return}this._reactToEditorMouseMove(e)}_reactToEditorMouseMove(e){var t,n,o;if(!e)return;const r=e.target,s=(t=r.element)===null||t===void 0?void 0:t.classList.contains("colorpicker-color-decoration"),a=this._editor.getOption(146);if(s&&(a==="click"&&!this._hoverActivatedByColorDecoratorClick||a==="hover"&&!this._isHoverEnabled&&!Kbt||a==="clickAndHover"&&!this._isHoverEnabled&&!this._hoverActivatedByColorDecoratorClick)||!s&&!this._isHoverEnabled&&!this._hoverActivatedByColorDecoratorClick){this._hideWidgets();return}if(this._getOrCreateContentWidget().maybeShowAt(e)){(n=this._glyphWidget)===null||n===void 0||n.hide();return}if(r.type===2&&r.position){(o=this._contentWidget)===null||o===void 0||o.hide(),this._glyphWidget||(this._glyphWidget=new Bw(this._editor,this._languageService,this._openerService)),this._glyphWidget.startShowingAt(r.position.lineNumber);return}this._hideWidgets()}_onKeyDown(e){var t;if(!this._editor.hasModel())return;const n=this._keybindingService.softDispatch(e,this._editor.getDomNode()),o=n.kind===1||n.kind===2&&n.commandId==="editor.action.showHover"&&((t=this._contentWidget)===null||t===void 0?void 0:t.isVisible);e.keyCode!==5&&e.keyCode!==6&&e.keyCode!==57&&e.keyCode!==4&&!o&&this._hideWidgets()}_hideWidgets(){var e,t,n;this._isMouseDown&&this._hoverClicked&&((e=this._contentWidget)===null||e===void 0?void 0:e.isColorPickerVisible)||Bv.dropDownVisible||(this._hoverActivatedByColorDecoratorClick=!1,this._hoverClicked=!1,(t=this._glyphWidget)===null||t===void 0||t.hide(),(n=this._contentWidget)===null||n===void 0||n.hide())}_getOrCreateContentWidget(){return this._contentWidget||(this._contentWidget=this._instantiationService.createInstance(cO,this._editor)),this._contentWidget}showContentHover(e,t,n,o,r=!1){this._hoverActivatedByColorDecoratorClick=r,this._getOrCreateContentWidget().startShowingAtRange(e,t,n,o)}focus(){var e;(e=this._contentWidget)===null||e===void 0||e.focus()}scrollUp(){var e;(e=this._contentWidget)===null||e===void 0||e.scrollUp()}scrollDown(){var e;(e=this._contentWidget)===null||e===void 0||e.scrollDown()}scrollLeft(){var e;(e=this._contentWidget)===null||e===void 0||e.scrollLeft()}scrollRight(){var e;(e=this._contentWidget)===null||e===void 0||e.scrollRight()}pageUp(){var e;(e=this._contentWidget)===null||e===void 0||e.pageUp()}pageDown(){var e;(e=this._contentWidget)===null||e===void 0||e.pageDown()}goToTop(){var e;(e=this._contentWidget)===null||e===void 0||e.goToTop()}goToBottom(){var e;(e=this._contentWidget)===null||e===void 0||e.goToBottom()}get isColorPickerVisible(){var e;return(e=this._contentWidget)===null||e===void 0?void 0:e.isColorPickerVisible}get isHoverVisible(){var e;return(e=this._contentWidget)===null||e===void 0?void 0:e.isVisible}dispose(){var e,t;super.dispose(),this._unhookEvents(),this._toUnhook.dispose(),(e=this._glyphWidget)===null||e===void 0||e.dispose(),(t=this._contentWidget)===null||t===void 0||t.dispose()}};Ha.ID="editor.contrib.hover";Ha=Az=jbt([Y2(1,$t),Y2(2,pl),Y2(3,Ki),Y2(4,xi)],Ha);class qbt extends ft{constructor(){super({id:"editor.action.showHover",label:C({key:"showOrFocusHover",comment:["Label for action that will trigger the showing/focusing of a hover in the editor.","If the hover is not visible, it will show the hover.","This allows for users to show the hover without using the mouse.","If the hover is already visible, it will take focus."]},"Show or Focus Hover"),description:{description:"Show or Focus Hover",args:[{name:"args",schema:{type:"object",properties:{focus:{description:"Controls if when triggered with the keyboard, the hover should take focus immediately.",type:"boolean",default:!1}}}}]},alias:"Show or Focus Hover",precondition:void 0,kbOpts:{kbExpr:Q.editorTextFocus,primary:Zo(2089,2087),weight:100}})}run(e,t,n){if(!t.hasModel())return;const o=Ha.get(t);if(!o)return;const r=t.getPosition(),s=new V(r.lineNumber,r.column,r.lineNumber,r.column),a=t.getOption(2)===2||!!(n!=null&&n.focus);o.isHoverVisible?o.focus():o.showContentHover(s,1,1,a)}}class Gbt extends ft{constructor(){super({id:"editor.action.showDefinitionPreviewHover",label:C({key:"showDefinitionPreviewHover",comment:["Label for action that will trigger the showing of definition preview hover in the editor.","This allows for users to show the definition preview hover without using the mouse."]},"Show Definition Preview Hover"),alias:"Show Definition Preview Hover",precondition:void 0})}run(e,t){const n=Ha.get(t);if(!n)return;const o=t.getPosition();if(!o)return;const r=new V(o.lineNumber,o.column,o.lineNumber,o.column),s=gb.get(t);if(!s)return;s.startFindDefinitionFromCursor(o).then(()=>{n.showContentHover(r,1,1,!0)})}}class Xbt extends ft{constructor(){super({id:"editor.action.scrollUpHover",label:C({key:"scrollUpHover",comment:["Action that allows to scroll up in the hover widget with the up arrow when the hover widget is focused."]},"Scroll Up Hover"),alias:"Scroll Up Hover",precondition:Q.hoverFocused,kbOpts:{kbExpr:Q.hoverFocused,primary:16,weight:100}})}run(e,t){const n=Ha.get(t);!n||n.scrollUp()}}class Ybt extends ft{constructor(){super({id:"editor.action.scrollDownHover",label:C({key:"scrollDownHover",comment:["Action that allows to scroll down in the hover widget with the up arrow when the hover widget is focused."]},"Scroll Down Hover"),alias:"Scroll Down Hover",precondition:Q.hoverFocused,kbOpts:{kbExpr:Q.hoverFocused,primary:18,weight:100}})}run(e,t){const n=Ha.get(t);!n||n.scrollDown()}}class Zbt extends ft{constructor(){super({id:"editor.action.scrollLeftHover",label:C({key:"scrollLeftHover",comment:["Action that allows to scroll left in the hover widget with the left arrow when the hover widget is focused."]},"Scroll Left Hover"),alias:"Scroll Left Hover",precondition:Q.hoverFocused,kbOpts:{kbExpr:Q.hoverFocused,primary:15,weight:100}})}run(e,t){const n=Ha.get(t);!n||n.scrollLeft()}}class Qbt extends ft{constructor(){super({id:"editor.action.scrollRightHover",label:C({key:"scrollRightHover",comment:["Action that allows to scroll right in the hover widget with the right arrow when the hover widget is focused."]},"Scroll Right Hover"),alias:"Scroll Right Hover",precondition:Q.hoverFocused,kbOpts:{kbExpr:Q.hoverFocused,primary:17,weight:100}})}run(e,t){const n=Ha.get(t);!n||n.scrollRight()}}class Jbt extends ft{constructor(){super({id:"editor.action.pageUpHover",label:C({key:"pageUpHover",comment:["Action that allows to page up in the hover widget with the page up command when the hover widget is focused."]},"Page Up Hover"),alias:"Page Up Hover",precondition:Q.hoverFocused,kbOpts:{kbExpr:Q.hoverFocused,primary:11,secondary:[528],weight:100}})}run(e,t){const n=Ha.get(t);!n||n.pageUp()}}class e1t extends ft{constructor(){super({id:"editor.action.pageDownHover",label:C({key:"pageDownHover",comment:["Action that allows to page down in the hover widget with the page down command when the hover widget is focused."]},"Page Down Hover"),alias:"Page Down Hover",precondition:Q.hoverFocused,kbOpts:{kbExpr:Q.hoverFocused,primary:12,secondary:[530],weight:100}})}run(e,t){const n=Ha.get(t);!n||n.pageDown()}}class t1t extends ft{constructor(){super({id:"editor.action.goToTopHover",label:C({key:"goToTopHover",comment:["Action that allows to go to the top of the hover widget with the home command when the hover widget is focused."]},"Go To Top Hover"),alias:"Go To Bottom Hover",precondition:Q.hoverFocused,kbOpts:{kbExpr:Q.hoverFocused,primary:14,secondary:[2064],weight:100}})}run(e,t){const n=Ha.get(t);!n||n.goToTop()}}class n1t extends ft{constructor(){super({id:"editor.action.goToBottomHover",label:C({key:"goToBottomHover",comment:["Action that allows to go to the bottom in the hover widget with the end command when the hover widget is focused."]},"Go To Bottom Hover"),alias:"Go To Bottom Hover",precondition:Q.hoverFocused,kbOpts:{kbExpr:Q.hoverFocused,primary:13,secondary:[2066],weight:100}})}run(e,t){const n=Ha.get(t);!n||n.goToBottom()}}zn(Ha.ID,Ha,2);ze(qbt);ze(Gbt);ze(Xbt);ze(Ybt);ze(Zbt);ze(Qbt);ze(Jbt);ze(e1t);ze(t1t);ze(n1t);Jb.register(hO);Jb.register(Tz);Uu((i,e)=>{const t=i.getColor(Int);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)}; }`))});class Pz extends _e{constructor(e){super(),this._editor=e,this._register(e.onMouseDown(t=>this.onMouseDown(t)))}dispose(){super.dispose()}onMouseDown(e){const t=this._editor.getOption(146);if(t!=="click"&&t!=="clickAndHover")return;const n=e.target;if(n.type!==6||!n.detail.injectedText||n.detail.injectedText.options.attachedData!==$we||!n.range)return;const o=this._editor.getContribution(Ha.ID);if(!!o&&!o.isColorPickerVisible){const r=new V(n.range.startLineNumber,n.range.startColumn+1,n.range.endLineNumber,n.range.endColumn+1);o.showContentHover(r,1,0,!1,!0)}}}Pz.ID="editor.contrib.colorContribution";zn(Pz.ID,Pz,2);Jb.register(aO);var bye=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},yd=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},Ule=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},Oz,Fz;let Wv=Oz=class extends _e{constructor(e,t,n,o,r,s,a){super(),this._editor=e,this._modelService=n,this._keybindingService=o,this._instantiationService=r,this._languageFeatureService=s,this._languageConfigurationService=a,this._standaloneColorPickerWidget=null,this._standaloneColorPickerVisible=Q.standaloneColorPickerVisible.bindTo(t),this._standaloneColorPickerFocused=Q.standaloneColorPickerFocused.bindTo(t)}showOrFocus(){var e;!this._editor.hasModel()||(this._standaloneColorPickerVisible.get()?this._standaloneColorPickerFocused.get()||(e=this._standaloneColorPickerWidget)===null||e===void 0||e.focus():this._standaloneColorPickerWidget=new gO(this._editor,this._standaloneColorPickerVisible,this._standaloneColorPickerFocused,this._instantiationService,this._modelService,this._keybindingService,this._languageFeatureService,this._languageConfigurationService))}hide(){var e;this._standaloneColorPickerFocused.set(!1),this._standaloneColorPickerVisible.set(!1),(e=this._standaloneColorPickerWidget)===null||e===void 0||e.hide(),this._editor.focus()}insertColor(){var e;(e=this._standaloneColorPickerWidget)===null||e===void 0||e.updateEditor(),this.hide()}static get(e){return e.getContribution(Oz.ID)}};Wv.ID="editor.contrib.standaloneColorPickerController";Wv=Oz=bye([yd(1,Ut),yd(2,Yi),yd(3,xi),yd(4,$t),yd(5,pt),yd(6,Ti)],Wv);zn(Wv.ID,Wv,1);const jle=8,i1t=22;let gO=Fz=class extends _e{constructor(e,t,n,o,r,s,a,l){var c;super(),this._editor=e,this._standaloneColorPickerVisible=t,this._standaloneColorPickerFocused=n,this._modelService=r,this._keybindingService=s,this._languageFeaturesService=a,this._languageConfigurationService=l,this.allowEditorOverflow=!0,this._position=void 0,this._body=document.createElement("div"),this._colorHover=null,this._selectionSetInEditor=!1,this._onResult=this._register(new le),this.onResult=this._onResult.event,this._standaloneColorPickerVisible.set(!0),this._standaloneColorPickerParticipant=o.createInstance(Mk,this._editor),this._position=(c=this._editor._getViewModel())===null||c===void 0?void 0:c.getPrimaryCursorState().modelState.position;const u=this._editor.getSelection(),d=u?{startLineNumber:u.startLineNumber,startColumn:u.startColumn,endLineNumber:u.endLineNumber,endColumn:u.endColumn}:{startLineNumber:0,endLineNumber:0,endColumn:0,startColumn:0},h=this._register(gf(this._body));this._register(h.onDidBlur(f=>{this.hide()})),this._register(h.onDidFocus(f=>{this.focus()})),this._register(this._editor.onDidChangeCursorPosition(()=>{this._selectionSetInEditor?this._selectionSetInEditor=!1:this.hide()})),this._register(this._editor.onMouseMove(f=>{var g;const p=(g=f.target.element)===null||g===void 0?void 0:g.classList;p&&p.contains("colorpicker-color-decoration")&&this.hide()})),this._register(this.onResult(f=>{this._render(f.value,f.foundInEditor)})),this._start(d),this._body.style.zIndex="50",this._editor.addContentWidget(this)}updateEditor(){this._colorHover&&this._standaloneColorPickerParticipant.updateEditorModel(this._colorHover)}getId(){return Fz.ID}getDomNode(){return this._body}getPosition(){if(!this._position)return null;const e=this._editor.getOption(60).above;return{position:this._position,secondaryPosition:this._position,preference:e?[1,2]:[2,1],positionAffinity:2}}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()}_start(e){return Ule(this,void 0,void 0,function*(){const t=yield this._computeAsync(e);!t||this._onResult.fire(new o1t(t.result,t.foundInEditor))})}_computeAsync(e){return Ule(this,void 0,void 0,function*(){if(!this._editor.hasModel())return null;const t={range:e,color:{red:0,green:0,blue:0,alpha:1}},n=yield this._standaloneColorPickerParticipant.createColorHover(t,new tY(this._modelService,this._languageConfigurationService),this._languageFeaturesService.colorProvider);return n?{result:n.colorHover,foundInEditor:n.foundInEditor}:null})}_render(e,t){const n=document.createDocumentFragment(),o=this._register(new uO(this._keybindingService));let r;const s={fragment:n,statusBar:o,setColorPicker:p=>r=p,onContentsChanged:()=>{},hide:()=>this.hide()};if(this._colorHover=e,this._register(this._standaloneColorPickerParticipant.renderHoverParts(s,[e])),r===void 0)return;this._body.classList.add("standalone-colorpicker-body"),this._body.style.maxHeight=Math.max(this._editor.getLayoutInfo().height/4,250)+"px",this._body.style.maxWidth=Math.max(this._editor.getLayoutInfo().width*.66,500)+"px",this._body.tabIndex=0,this._body.appendChild(n),r.layout();const a=r.body,l=a.saturationBox.domNode.clientWidth,c=a.domNode.clientWidth-l-i1t-jle,u=r.body.enterButton;u==null||u.onClicked(()=>{this.updateEditor(),this.hide()});const d=r.header,h=d.pickedColorNode;h.style.width=l+jle+"px";const f=d.originalColorNode;f.style.width=c+"px";const g=r.header.closeButton;g==null||g.onClicked(()=>{this.hide()}),t&&(u&&(u.button.textContent="Replace"),this._selectionSetInEditor=!0,this._editor.setSelection(e.range)),this._editor.layoutContentWidget(this)}};gO.ID="editor.contrib.standaloneColorPickerWidget";gO=Fz=bye([yd(3,$t),yd(4,Yi),yd(5,xi),yd(6,pt),yd(7,Ti)],gO);class o1t{constructor(e,t){this.value=e,this.foundInEditor=t}}class r1t extends sh{constructor(){super({id:"editor.action.showOrFocusStandaloneColorPicker",title:{value:C("showOrFocusStandaloneColorPicker","Show or Focus Standalone Color Picker"),mnemonicTitle:C({key:"mishowOrFocusStandaloneColorPicker",comment:["&& denotes a mnemonic"]},"&&Show or Focus Standalone Color Picker"),original:"Show or Focus Standalone Color Picker"},precondition:void 0,menu:[{id:Z.CommandPalette}]})}runEditorCommand(e,t){var n;(n=Wv.get(t))===null||n===void 0||n.showOrFocus()}}class s1t extends ft{constructor(){super({id:"editor.action.hideColorPicker",label:C({key:"hideColorPicker",comment:["Action that hides the color picker"]},"Hide the Color Picker"),alias:"Hide the Color Picker",precondition:Q.standaloneColorPickerVisible.isEqualTo(!0),kbOpts:{primary:9,weight:100}})}run(e,t){var n;(n=Wv.get(t))===null||n===void 0||n.hide()}}class a1t extends ft{constructor(){super({id:"editor.action.insertColorWithStandaloneColorPicker",label:C({key:"insertColorWithStandaloneColorPicker",comment:["Action that inserts color with standalone color picker"]},"Insert Color with Standalone Color Picker"),alias:"Insert Color with Standalone Color Picker",precondition:Q.standaloneColorPickerFocused.isEqualTo(!0),kbOpts:{primary:3,weight:100}})}run(e,t){var n;(n=Wv.get(t))===null||n===void 0||n.insertColor()}}ze(s1t);ze(a1t);$i(r1t);class Tm{constructor(e,t,n){this.languageConfigurationService=n,this._selection=e,this._insertSpace=t,this._usedEndToken=null}static _haystackHasNeedleAtOffset(e,t,n){if(n<0)return!1;const o=t.length,r=e.length;if(n+o>r)return!1;for(let s=0;s=65&&a<=90&&a+32===l)&&!(l>=65&&l<=90&&l+32===a))return!1}return!0}_createOperationsForBlockComment(e,t,n,o,r,s){const a=e.startLineNumber,l=e.startColumn,c=e.endLineNumber,u=e.endColumn,d=r.getLineContent(a),h=r.getLineContent(c);let f=d.lastIndexOf(t,l-1+t.length),g=h.indexOf(n,u-1-n.length);if(f!==-1&&g!==-1)if(a===c)d.substring(f+t.length,g).indexOf(n)>=0&&(f=-1,g=-1);else{const v=d.substring(f+t.length),m=h.substring(0,g);(v.indexOf(n)>=0||m.indexOf(n)>=0)&&(f=-1,g=-1)}let p;f!==-1&&g!==-1?(o&&f+t.length0&&h.charCodeAt(g-1)===32&&(n=" "+n,g-=1),p=Tm._createRemoveBlockCommentOperations(new V(a,f+t.length+1,c,g+1),t,n)):(p=Tm._createAddBlockCommentOperations(e,t,n,this._insertSpace),this._usedEndToken=p.length===1?n:null);for(const v of p)s.addTrackedEditOperation(v.range,v.text)}static _createRemoveBlockCommentOperations(e,t,n){const o=[];return V.isEmpty(e)?o.push(Gi.delete(new V(e.startLineNumber,e.startColumn-t.length,e.endLineNumber,e.endColumn+n.length))):(o.push(Gi.delete(new V(e.startLineNumber,e.startColumn-t.length,e.startLineNumber,e.startColumn))),o.push(Gi.delete(new V(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn+n.length)))),o}static _createAddBlockCommentOperations(e,t,n,o){const r=[];return V.isEmpty(e)?r.push(Gi.replace(new V(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn),t+" "+n)):(r.push(Gi.insert(new ae(e.startLineNumber,e.startColumn),t+(o?" ":""))),r.push(Gi.insert(new ae(e.endLineNumber,e.endColumn),(o?" ":"")+n))),r}getEditOperations(e,t){const n=this._selection.startLineNumber,o=this._selection.startColumn;e.tokenization.tokenizeIfCheap(n);const r=e.getLanguageIdAtPosition(n,o),s=this.languageConfigurationService.getLanguageConfiguration(r).comments;!s||!s.blockCommentStartToken||!s.blockCommentEndToken||this._createOperationsForBlockComment(this._selection,s.blockCommentStartToken,s.blockCommentEndToken,this._insertSpace,e,t)}computeCursorState(e,t){const n=t.getInverseEditOperations();if(n.length===2){const o=n[0],r=n[1];return new gt(o.range.endLineNumber,o.range.endColumn,r.range.startLineNumber,r.range.startColumn)}else{const o=n[0].range,r=this._usedEndToken?-this._usedEndToken.length-1:0;return new gt(o.endLineNumber,o.endColumn+r,o.endLineNumber,o.endColumn+r)}}}class cg{constructor(e,t,n,o,r,s,a){this.languageConfigurationService=e,this._selection=t,this._tabSize=n,this._type=o,this._insertSpace=r,this._selectionId=null,this._deltaColumn=0,this._moveEndPositionDown=!1,this._ignoreEmptyLines=s,this._ignoreFirstLine=a||!1}static _gatherPreflightCommentStrings(e,t,n,o){e.tokenization.tokenizeIfCheap(t);const r=e.getLanguageIdAtPosition(t,1),s=o.getLanguageConfiguration(r).comments,a=s?s.lineCommentToken:null;if(!a)return null;const l=[];for(let c=0,u=n-t+1;cr?t[l].commentStrOffset=s-1:t[l].commentStrOffset=s}}}class uY extends ft{constructor(e,t){super(t),this._type=e}run(e,t){const n=e.get(Ti);if(!t.hasModel())return;const o=t.getModel(),r=[],s=o.getOptions(),a=t.getOption(23),l=t.getSelections().map((u,d)=>({selection:u,index:d,ignoreFirstLine:!1}));l.sort((u,d)=>V.compareRangesUsingStarts(u.selection,d.selection));let c=l[0];for(let u=1;u=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},w_=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},Bz;let zy=Bz=class{static get(e){return e.getContribution(Bz.ID)}constructor(e,t,n,o,r,s,a,l){this._contextMenuService=t,this._contextViewService=n,this._contextKeyService=o,this._keybindingService=r,this._menuService=s,this._configurationService=a,this._workspaceContextService=l,this._toDispose=new Be,this._contextMenuIsBeingShownCount=0,this._editor=e,this._toDispose.add(this._editor.onContextMenu(c=>this._onContextMenu(c))),this._toDispose.add(this._editor.onMouseWheel(c=>{if(this._contextMenuIsBeingShownCount>0){const u=this._contextViewService.getContextViewElement(),d=c.srcElement;d.shadowRoot&&J0(u)===d.shadowRoot||this._contextViewService.hideContextView()}})),this._toDispose.add(this._editor.onKeyDown(c=>{!this._editor.getOption(24)||c.keyCode===58&&(c.preventDefault(),c.stopPropagation(),this.showContextMenu())}))}_onContextMenu(e){if(!this._editor.hasModel())return;if(!this._editor.getOption(24)){this._editor.focus(),e.target.position&&!this._editor.getSelection().containsPosition(e.target.position)&&this._editor.setPosition(e.target.position);return}if(e.target.type===12||e.target.type===6&&e.target.detail.injectedText)return;if(e.event.preventDefault(),e.event.stopPropagation(),e.target.type===11)return this._showScrollbarContextMenu(e.event);if(e.target.type!==6&&e.target.type!==7&&e.target.type!==1)return;if(this._editor.focus(),e.target.position){let n=!1;for(const o of this._editor.getSelections())if(o.containsPosition(e.target.position)){n=!0;break}n||this._editor.setPosition(e.target.position)}let t=null;e.target.type!==1&&(t=e.event),this.showContextMenu(t)}showContextMenu(e){if(!this._editor.getOption(24)||!this._editor.hasModel())return;const t=this._getMenuActions(this._editor.getModel(),this._editor.isSimpleWidget?Z.SimpleEditorContext:Z.EditorContext);t.length>0&&this._doShowContextMenu(t,e)}_getMenuActions(e,t){const n=[],o=this._menuService.createMenu(t,this._contextKeyService),r=o.getActions({arg:e.uri});o.dispose();for(const s of r){const[,a]=s;let l=0;for(const c of a)if(c instanceof OD){const u=this._getMenuActions(e,c.item.submenu);u.length>0&&(n.push(new py(c.id,c.label,u)),l++)}else n.push(c),l++;l&&n.push(new kr)}return n.length&&n.pop(),n}_doShowContextMenu(e,t=null){if(!this._editor.hasModel())return;const n=this._editor.getOption(60);this._editor.updateOptions({hover:{enabled:!1}});let o=t;if(!o){this._editor.revealPosition(this._editor.getPosition(),1),this._editor.render();const s=this._editor.getScrolledVisiblePosition(this._editor.getPosition()),a=Yo(this._editor.getDomNode()),l=a.left+s.left,c=a.top+s.top+s.height;o={x:l,y:c}}const r=this._editor.getOption(126)&&!jd;this._contextMenuIsBeingShownCount++,this._contextMenuService.showContextMenu({domForShadowRoot:r?this._editor.getDomNode():void 0,getAnchor:()=>o,getActions:()=>e,getActionViewItem:s=>{const a=this._keybindingFor(s);if(a)return new My(s,s,{label:!0,keybinding:a.getLabel(),isMenu:!0});const l=s;return typeof l.getActionViewItem=="function"?l.getActionViewItem():new My(s,s,{icon:!0,label:!0,isMenu:!0})},getKeyBinding:s=>this._keybindingFor(s),onHide:s=>{this._contextMenuIsBeingShownCount--,this._editor.updateOptions({hover:n})}})}_showScrollbarContextMenu(e){if(!this._editor.hasModel()||Xct(this._workspaceContextService.getWorkspace()))return;const t=this._editor.getOption(72);let n=0;const o=c=>({id:`menu-action-${++n}`,label:c.label,tooltip:"",class:void 0,enabled:typeof c.enabled=="undefined"?!0:c.enabled,checked:c.checked,run:c.run}),r=(c,u)=>new py(`menu-action-${++n}`,c,u,void 0),s=(c,u,d,h,f)=>{if(!u)return o({label:c,enabled:u,run:()=>{}});const g=v=>()=>{this._configurationService.updateValue(d,v)},p=[];for(const v of f)p.push(o({label:v.label,checked:h===v.value,run:g(v.value)}));return r(c,p)},a=[];a.push(o({label:C("context.minimap.minimap","Minimap"),checked:t.enabled,run:()=>{this._configurationService.updateValue("editor.minimap.enabled",!t.enabled)}})),a.push(new kr),a.push(o({label:C("context.minimap.renderCharacters","Render Characters"),enabled:t.enabled,checked:t.renderCharacters,run:()=>{this._configurationService.updateValue("editor.minimap.renderCharacters",!t.renderCharacters)}})),a.push(s(C("context.minimap.size","Vertical size"),t.enabled,"editor.minimap.size",t.size,[{label:C("context.minimap.size.proportional","Proportional"),value:"proportional"},{label:C("context.minimap.size.fill","Fill"),value:"fill"},{label:C("context.minimap.size.fit","Fit"),value:"fit"}])),a.push(s(C("context.minimap.slider","Slider"),t.enabled,"editor.minimap.showSlider",t.showSlider,[{label:C("context.minimap.slider.mouseover","Mouse Over"),value:"mouseover"},{label:C("context.minimap.slider.always","Always"),value:"always"}]));const l=this._editor.getOption(126)&&!jd;this._contextMenuIsBeingShownCount++,this._contextMenuService.showContextMenu({domForShadowRoot:l?this._editor.getDomNode():void 0,getAnchor:()=>e,getActions:()=>a,onHide:c=>{this._contextMenuIsBeingShownCount--,this._editor.focus()}})}_keybindingFor(e){return this._keybindingService.lookupKeybinding(e.id)}dispose(){this._contextMenuIsBeingShownCount>0&&this._contextViewService.hideContextView(),this._toDispose.dispose()}};zy.ID="editor.contrib.contextmenu";zy=Bz=h1t([w_(1,ju),w_(2,mp),w_(3,Ut),w_(4,xi),w_(5,If),w_(6,En),w_(7,nb)],zy);class f1t extends ft{constructor(){super({id:"editor.action.showContextMenu",label:C("action.showContextMenu.label","Show Editor Context Menu"),alias:"Show Editor Context Menu",precondition:void 0,kbOpts:{kbExpr:Q.textInputFocus,primary:1092,weight:100}})}run(e,t){var n;(n=zy.get(t))===null||n===void 0||n.showContextMenu()}}zn(zy.ID,zy,2);ze(f1t);class a7{constructor(e){this.selections=e}equals(e){const t=this.selections.length,n=e.selections.length;if(t!==n)return!1;for(let o=0;o{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 n=new a7(t.oldSelections);this._undoStack.length>0&&this._undoStack[this._undoStack.length-1].cursorState.equals(n)||(this._undoStack.push(new l7(n,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 l7(new a7(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 l7(new a7(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}}pb.ID="editor.contrib.cursorUndoRedoController";class g1t extends ft{constructor(){super({id:"cursorUndo",label:C("cursor.undo","Cursor Undo"),alias:"Cursor Undo",precondition:void 0,kbOpts:{kbExpr:Q.textInputFocus,primary:2099,weight:100}})}run(e,t,n){var o;(o=pb.get(t))===null||o===void 0||o.cursorUndo()}}class p1t extends ft{constructor(){super({id:"cursorRedo",label:C("cursor.redo","Cursor Redo"),alias:"Cursor Redo",precondition:void 0})}run(e,t,n){var o;(o=pb.get(t))===null||o===void 0||o.cursorRedo()}}zn(pb.ID,pb,0);ze(g1t);ze(p1t);class m1t{constructor(e,t,n){this.selection=e,this.targetPosition=t,this.copy=n,this.targetSelection=null}getEditOperations(e,t){const n=e.getValueInRange(this.selection);if(this.copy||t.addEditOperation(this.selection,null),t.addEditOperation(new V(this.targetPosition.lineNumber,this.targetPosition.column,this.targetPosition.lineNumber,this.targetPosition.column),n),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 gt(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 gt(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(35)||this._editor.getOption(22)||(Z1(e)&&(this._modifierPressed=!0),this._mouseDown&&Z1(e)&&this._editor.updateOptions({mouseStyle:"copy"}))}onEditorKeyUp(e){!this._editor.getOption(35)||this._editor.getOption(22)||(Z1(e)&&(this._modifierPressed=!1),this._mouseDown&&e.keyCode===Yg.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 o=(this._editor.getSelections()||[]).filter(r=>t.position&&r.containsPosition(t.position));if(o.length===1)this._dragSelection=o[0];else return}Z1(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 ae(e.target.position.lineNumber,e.target.position.column);if(this._dragSelection===null){let n=null;if(e.event.shiftKey){const o=this._editor.getSelection();if(o){const{selectionStartLineNumber:r,selectionStartColumn:s}=o;n=[new gt(r,s,t.lineNumber,t.column)]}}else n=(this._editor.getSelections()||[]).map(o=>o.containsPosition(t)?new gt(t.lineNumber,t.column,t.lineNumber,t.column):o);this._editor.setSelections(n||[],"mouse",3)}else(!this._dragSelection.containsPosition(t)||(Z1(e.event)||this._modifierPressed)&&(this._dragSelection.getEndPosition().equals(t)||this._dragSelection.getStartPosition().equals(t)))&&(this._editor.pushUndoStop(),this._editor.executeCommand(Yg.ID,new m1t(this._dragSelection,t,Z1(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 V(e.lineNumber,e.column,e.lineNumber,e.column),options:Yg._DECORATION_OPTIONS}]),this._editor.revealPosition(e,1)}_removeDecoration(){this._dndDecorationIds.clear()}_hitContent(e){return e.type===6||e.type===7}_hitMargin(e){return e.type===2||e.type===3||e.type===4}dispose(){this._removeDecoration(),this._dragSelection=null,this._mouseDown=!1,this._modifierPressed=!1,super.dispose()}}Yg.ID="editor.contrib.dragAndDrop";Yg.TRIGGER_KEY_VALUE=Nn?6:5;Yg._DECORATION_OPTIONS=Jt.register({description:"dnd-target",className:"dnd-target"});zn(Yg.ID,Yg,2);const vF=function(){if(typeof crypto=="object"&&typeof crypto.randomUUID=="function")return crypto.randomUUID.bind(crypto);let i;typeof crypto=="object"&&typeof crypto.getRandomValues=="function"?i=crypto.getRandomValues.bind(crypto):i=function(n){for(let o=0;oCye(this,void 0,void 0,function*(){return i}),asFile:()=>{},value:typeof i=="string"?i:void 0}}function v1t(i,e,t){const n={id:vF(),name:i,uri:e,data:t};return{asString:()=>Cye(this,void 0,void 0,function*(){return""}),asFile:()=>n,value:void 0}}class wye{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 mn.some(this,([n,o])=>o.asFile())&&t.push("files"),Sye(pO(e),t)}get(e){var t;return(t=this._entries.get(this.toKey(e)))===null||t===void 0?void 0:t[0]}append(e,t){const n=this._entries.get(e);n?n.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 n of t)yield[e,n]}toKey(e){return pO(e)}}function pO(i){return i.toLowerCase()}function yye(i,e){return Sye(pO(i),e.map(pO))}function Sye(i,e){if(i==="*/*")return e.length>0;if(e.includes(i))return!0;const t=i.match(/^([a-z]+)\/([a-z]+|\*)$/i);if(!t)return!1;const[n,o,r]=t;return r==="*"?e.some(s=>s.startsWith(o+"/")):!1}const _F=Object.freeze({create:i=>mv(i.map(e=>e.toString())).join(`\r + *-----------------------------------------------------------------------------*/var s_t=Object.defineProperty,a_t=Object.getOwnPropertyDescriptor,l_t=Object.getOwnPropertyNames,c_t=Object.prototype.hasOwnProperty,Lle=(i,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of l_t(e))!c_t.call(i,o)&&o!==t&&s_t(i,o,{get:()=>e[o],enumerable:!(n=a_t(e,o))||n.enumerable});return i},u_t=(i,e,t)=>(Lle(i,e,"default"),t&&Lle(t,e,"default")),d_t="5.0.2",Ww={};u_t(Ww,hT);var pye=(i=>(i[i.None=0]="None",i[i.CommonJS=1]="CommonJS",i[i.AMD=2]="AMD",i[i.UMD=3]="UMD",i[i.System=4]="System",i[i.ES2015=5]="ES2015",i[i.ESNext=99]="ESNext",i))(pye||{}),mye=(i=>(i[i.None=0]="None",i[i.Preserve=1]="Preserve",i[i.React=2]="React",i[i.ReactNative=3]="ReactNative",i[i.ReactJSX=4]="ReactJSX",i[i.ReactJSXDev=5]="ReactJSXDev",i))(mye||{}),vye=(i=>(i[i.CarriageReturnLineFeed=0]="CarriageReturnLineFeed",i[i.LineFeed=1]="LineFeed",i))(vye||{}),_ye=(i=>(i[i.ES3=0]="ES3",i[i.ES5=1]="ES5",i[i.ES2015=2]="ES2015",i[i.ES2016=3]="ES2016",i[i.ES2017=4]="ES2017",i[i.ES2018=5]="ES2018",i[i.ES2019=6]="ES2019",i[i.ES2020=7]="ES2020",i[i.ESNext=99]="ESNext",i[i.JSON=100]="JSON",i[i.Latest=99]="Latest",i))(_ye||{}),bye=(i=>(i[i.Classic=1]="Classic",i[i.NodeJs=2]="NodeJs",i))(bye||{}),Cye=class{constructor(i,e,t,n,o){Ct(this,"_onDidChange",new Ww.Emitter);Ct(this,"_onDidExtraLibsChange",new Ww.Emitter);Ct(this,"_extraLibs");Ct(this,"_removedExtraLibs");Ct(this,"_eagerModelSync");Ct(this,"_compilerOptions");Ct(this,"_diagnosticsOptions");Ct(this,"_workerOptions");Ct(this,"_onDidExtraLibsChangeTimeout");Ct(this,"_inlayHintsOptions");Ct(this,"_modeConfiguration");this._extraLibs=Object.create(null),this._removedExtraLibs=Object.create(null),this._eagerModelSync=!1,this.setCompilerOptions(i),this.setDiagnosticsOptions(e),this.setWorkerOptions(t),this.setInlayHintsOptions(n),this.setModeConfiguration(o),this._onDidExtraLibsChangeTimeout=-1}get onDidChange(){return this._onDidChange.event}get onDidExtraLibsChange(){return this._onDidExtraLibsChange.event}get modeConfiguration(){return this._modeConfiguration}get workerOptions(){return this._workerOptions}get inlayHintsOptions(){return this._inlayHintsOptions}getExtraLibs(){return this._extraLibs}addExtraLib(i,e){let t;if(typeof e=="undefined"?t=`ts:extralib-${Math.random().toString(36).substring(2,15)}`:t=e,this._extraLibs[t]&&this._extraLibs[t].content===i)return{dispose:()=>{}};let n=1;return this._removedExtraLibs[t]&&(n=this._removedExtraLibs[t]+1),this._extraLibs[t]&&(n=this._extraLibs[t].version+1),this._extraLibs[t]={content:i,version:n},this._fireOnDidExtraLibsChangeSoon(),{dispose:()=>{let o=this._extraLibs[t];!o||o.version===n&&(delete this._extraLibs[t],this._removedExtraLibs[t]=n,this._fireOnDidExtraLibsChangeSoon())}}}setExtraLibs(i){for(const e in this._extraLibs)this._removedExtraLibs[e]=this._extraLibs[e].version;if(this._extraLibs=Object.create(null),i&&i.length>0)for(const e of i){const t=e.filePath||`ts:extralib-${Math.random().toString(36).substring(2,15)}`,n=e.content;let o=1;this._removedExtraLibs[t]&&(o=this._removedExtraLibs[t]+1),this._extraLibs[t]={content:n,version:o}}this._fireOnDidExtraLibsChangeSoon()}_fireOnDidExtraLibsChangeSoon(){this._onDidExtraLibsChangeTimeout===-1&&(this._onDidExtraLibsChangeTimeout=window.setTimeout(()=>{this._onDidExtraLibsChangeTimeout=-1,this._onDidExtraLibsChange.fire(void 0)},0))}getCompilerOptions(){return this._compilerOptions}setCompilerOptions(i){this._compilerOptions=i||Object.create(null),this._onDidChange.fire(void 0)}getDiagnosticsOptions(){return this._diagnosticsOptions}setDiagnosticsOptions(i){this._diagnosticsOptions=i||Object.create(null),this._onDidChange.fire(void 0)}setWorkerOptions(i){this._workerOptions=i||Object.create(null),this._onDidChange.fire(void 0)}setInlayHintsOptions(i){this._inlayHintsOptions=i||Object.create(null),this._onDidChange.fire(void 0)}setMaximumWorkerIdleTime(i){}setEagerModelSync(i){this._eagerModelSync=i}getEagerModelSync(){return this._eagerModelSync}setModeConfiguration(i){this._modeConfiguration=i||Object.create(null),this._onDidChange.fire(void 0)}},h_t=d_t,yye={completionItems:!0,hovers:!0,documentSymbols:!0,definitions:!0,references:!0,documentHighlights:!0,rename:!0,diagnostics:!0,documentRangeFormattingEdits:!0,signatureHelp:!0,onTypeFormattingEdits:!0,codeActions:!0,inlayHints:!0},wye=new Cye({allowNonTsExtensions:!0,target:99},{noSemanticValidation:!1,noSyntaxValidation:!1,onlyVisible:!1},{},{},yye),Sye=new Cye({allowNonTsExtensions:!0,allowJs:!0,target:99},{noSemanticValidation:!0,noSyntaxValidation:!1,onlyVisible:!1},{},{},yye),f_t=()=>oF().then(i=>i.getTypeScriptWorker()),g_t=()=>oF().then(i=>i.getJavaScriptWorker());Ww.languages.typescript={ModuleKind:pye,JsxEmit:mye,NewLineKind:vye,ScriptTarget:_ye,ModuleResolutionKind:bye,typescriptVersion:h_t,typescriptDefaults:wye,javascriptDefaults:Sye,getTypeScriptWorker:f_t,getJavaScriptWorker:g_t};function oF(){return wt(()=>import("./tsMode.f71d2839.js"),[])}Ww.languages.onLanguage("typescript",()=>oF().then(i=>i.setupTypeScript(wye)));Ww.languages.onLanguage("javascript",()=>oF().then(i=>i.setupJavaScript(Sye)));class p_t extends ec{constructor(){super({id:"diffEditor.toggleCollapseUnchangedRegions",title:{value:C("toggleCollapseUnchangedRegions","Toggle Collapse Unchanged Regions"),original:"Toggle Collapse Unchanged Regions"},icon:Xe.map,toggled:Me.has("config.diffEditor.hideUnchangedRegions.enabled"),precondition:Me.has("isInDiffEditor"),menu:{when:Me.has("isInDiffEditor"),id:Z.EditorTitle,order:22,group:"navigation"}})}run(e,...t){const n=e.get(En),o=!n.getValue("diffEditor.hideUnchangedRegions.enabled");n.updateValue("diffEditor.hideUnchangedRegions.enabled",o)}}$i(p_t);class xye extends ec{constructor(){super({id:"diffEditor.toggleShowMovedCodeBlocks",title:{value:C("toggleShowMovedCodeBlocks","Toggle Show Moved Code Blocks"),original:"Toggle Show Moved Code Blocks"},precondition:Me.has("isInDiffEditor")})}run(e,...t){const n=e.get(En),o=!n.getValue("diffEditor.experimental.showMoves");n.updateValue("diffEditor.experimental.showMoves",o)}}$i(xye);class Lye extends ec{constructor(){super({id:"diffEditor.toggleUseInlineViewWhenSpaceIsLimited",title:{value:C("toggleUseInlineViewWhenSpaceIsLimited","Toggle Use Inline View When Space Is Limited"),original:"Toggle Use Inline View When Space Is Limited"},precondition:Me.has("isInDiffEditor")})}run(e,...t){const n=e.get(En),o=!n.getValue("diffEditor.useInlineViewWhenSpaceIsLimited");n.updateValue("diffEditor.useInlineViewWhenSpaceIsLimited",o)}}$i(Lye);Hr.appendMenuItem(Z.EditorTitle,{command:{id:new Lye().desc.id,title:C("useInlineViewWhenSpaceIsLimited","Use Inline View When Space Is Limited"),toggled:Me.has("config.diffEditor.useInlineViewWhenSpaceIsLimited"),precondition:Me.has("isInDiffEditor")},order:11,group:"1_diff",when:Me.and(Q.diffEditorRenderSideBySideInlineBreakpointReached,Me.has("isInDiffEditor"))});Hr.appendMenuItem(Z.EditorTitle,{command:{id:new xye().desc.id,title:C("showMoves","Show Moved Code Blocks"),icon:Xe.move,toggled:mS.create("config.diffEditor.experimental.showMoves",!0),precondition:Me.has("isInDiffEditor")},order:10,group:"1_diff",when:Me.has("isInDiffEditor")});const rF={value:C("diffEditor","Diff Editor"),original:"Diff Editor"};class m_t extends lh{constructor(){super({id:"diffEditor.switchSide",title:{value:C("switchSide","Switch Side"),original:"Switch Side"},icon:Xe.arrowSwap,precondition:Me.has("isInDiffEditor"),f1:!0,category:rF})}runEditorCommand(e,t,n){const o=IS(e);if(o instanceof cb){if(n&&n.dryRun)return{destinationSelection:o.mapToOtherSide().destinationSelection};o.switchSide()}}}$i(m_t);class v_t extends lh{constructor(){super({id:"diffEditor.exitCompareMove",title:{value:C("exitCompareMove","Exit Compare Move"),original:"Exit Compare Move"},icon:Xe.close,precondition:Q.comparingMovedCode,f1:!1,category:rF,keybinding:{weight:1e4,primary:9}})}runEditorCommand(e,t,...n){const o=IS(e);o instanceof cb&&o.exitCompareMove()}}$i(v_t);class __t extends lh{constructor(){super({id:"diffEditor.collapseAllUnchangedRegions",title:{value:C("collapseAllUnchangedRegions","Collapse All Unchanged Regions"),original:"Collapse All Unchanged Regions"},icon:Xe.fold,precondition:Me.has("isInDiffEditor"),f1:!0,category:rF})}runEditorCommand(e,t,...n){const o=IS(e);o instanceof cb&&o.collapseAllUnchangedRegions()}}$i(__t);class b_t extends lh{constructor(){super({id:"diffEditor.showAllUnchangedRegions",title:{value:C("showAllUnchangedRegions","Show All Unchanged Regions"),original:"Show All Unchanged Regions"},icon:Xe.unfold,precondition:Me.has("isInDiffEditor"),f1:!0,category:rF})}runEditorCommand(e,t,...n){const o=IS(e);o instanceof cb&&o.showAllUnchangedRegions()}}$i(b_t);const Eye={value:C("accessibleDiffViewer","Accessible Diff Viewer"),original:"Accessible Diff Viewer"};class kS extends ec{constructor(){super({id:kS.id,title:{value:C("editor.action.accessibleDiffViewer.next","Go to Next Difference"),original:"Go to Next Difference"},category:Eye,precondition:Me.has("isInDiffEditor"),keybinding:{primary:65,weight:100},f1:!0})}run(e){const t=IS(e);t==null||t.accessibleDiffViewerNext()}}kS.id="editor.action.accessibleDiffViewer.next";Hr.appendMenuItem(Z.EditorTitle,{command:{id:kS.id,title:C("Open Accessible Diff Viewer","Open Accessible Diff Viewer"),precondition:Me.has("isInDiffEditor")},order:10,group:"2_diff",when:Me.and(Q.accessibleDiffViewerVisible.negate(),Me.has("isInDiffEditor"))});class gT extends ec{constructor(){super({id:gT.id,title:{value:C("editor.action.accessibleDiffViewer.prev","Go to Previous Difference"),original:"Go to Previous Difference"},category:Eye,precondition:Me.has("isInDiffEditor"),keybinding:{primary:1089,weight:100},f1:!0})}run(e){const t=IS(e);t==null||t.accessibleDiffViewerPrev()}}gT.id="editor.action.accessibleDiffViewer.prev";function IS(i){var e;const t=i.get(Jn),n=t.listDiffEditors(),o=(e=t.getFocusedCodeEditor())!==null&&e!==void 0?e:t.getActiveCodeEditor();if(!o)return null;for(let s=0,a=n.length;s=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},w_t=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},sF=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},cz;const aF=new lt("selectionAnchorSet",!1);let cp=cz=class{static get(e){return e.getContribution(cz.ID)}constructor(e,t){this.editor=e,this.selectionAnchorSetContextKey=aF.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(gt.fromPositions(e,e),{description:"selection-anchor",stickiness:1,hoverMessage:new os().appendText(C("selectionAnchor","Selection Anchor")),className:"selection-anchor"})}),this.selectionAnchorSetContextKey.set(!!this.decorationId),Cs(C("anchorSet","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(gt.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()}};cp.ID="editor.contrib.selectionAnchorController";cp=cz=y_t([w_t(1,Ut)],cp);class S_t extends ft{constructor(){super({id:"editor.action.setSelectionAnchor",label:C("setSelectionAnchor","Set Selection Anchor"),alias:"Set Selection Anchor",precondition:void 0,kbOpts:{kbExpr:Q.editorTextFocus,primary:Zo(2089,2080),weight:100}})}run(e,t){var n;return sF(this,void 0,void 0,function*(){(n=cp.get(t))===null||n===void 0||n.setSelectionAnchor()})}}class x_t extends ft{constructor(){super({id:"editor.action.goToSelectionAnchor",label:C("goToSelectionAnchor","Go to Selection Anchor"),alias:"Go to Selection Anchor",precondition:aF})}run(e,t){var n;return sF(this,void 0,void 0,function*(){(n=cp.get(t))===null||n===void 0||n.goToSelectionAnchor()})}}class L_t extends ft{constructor(){super({id:"editor.action.selectFromAnchorToCursor",label:C("selectFromAnchorToCursor","Select from Anchor to Cursor"),alias:"Select from Anchor to Cursor",precondition:aF,kbOpts:{kbExpr:Q.editorTextFocus,primary:Zo(2089,2089),weight:100}})}run(e,t){var n;return sF(this,void 0,void 0,function*(){(n=cp.get(t))===null||n===void 0||n.selectFromAnchorToCursor()})}}class E_t extends ft{constructor(){super({id:"editor.action.cancelSelectionAnchor",label:C("cancelSelectionAnchor","Cancel Selection Anchor"),alias:"Cancel Selection Anchor",precondition:aF,kbOpts:{kbExpr:Q.editorTextFocus,primary:9,weight:100}})}run(e,t){var n;return sF(this,void 0,void 0,function*(){(n=cp.get(t))===null||n===void 0||n.cancelSelectionAnchor()})}}zn(cp.ID,cp,4);ze(S_t);ze(x_t);ze(L_t);ze(E_t);const D_t=J("editorOverviewRuler.bracketMatchForeground",{dark:"#A0A0A0",light:"#A0A0A0",hcDark:"#A0A0A0",hcLight:"#A0A0A0"},C("overviewRulerBracketMatchForeground","Overview ruler marker color for matching brackets."));class k_t extends ft{constructor(){super({id:"editor.action.jumpToBracket",label:C("smartSelect.jumpBracket","Go to Bracket"),alias:"Go to Bracket",precondition:void 0,kbOpts:{kbExpr:Q.editorTextFocus,primary:3165,weight:100}})}run(e,t){var n;(n=Ru.get(t))===null||n===void 0||n.jumpToBracket()}}class I_t extends ft{constructor(){super({id:"editor.action.selectToBracket",label:C("smartSelect.selectToBracket","Select to Bracket"),alias:"Select to Bracket",precondition:void 0,description:{description:"Select to Bracket",args:[{name:"args",schema:{type:"object",properties:{selectBrackets:{type:"boolean",default:!0}}}}]}})}run(e,t,n){var o;let r=!0;n&&n.selectBrackets===!1&&(r=!1),(o=Ru.get(t))===null||o===void 0||o.selectToBracket(r)}}class T_t extends ft{constructor(){super({id:"editor.action.removeBrackets",label:C("smartSelect.removeBrackets","Remove Brackets"),alias:"Remove Brackets",precondition:void 0,kbOpts:{kbExpr:Q.editorTextFocus,primary:2561,weight:100}})}run(e,t){var n;(n=Ru.get(t))===null||n===void 0||n.removeBrackets(this.id)}}class N_t{constructor(e,t,n){this.position=e,this.brackets=t,this.options=n}}class Ru extends _e{static get(e){return e.getContribution(Ru.ID)}constructor(e){super(),this._editor=e,this._lastBracketsData=[],this._lastVersionId=0,this._decorations=this._editor.createDecorationsCollection(),this._updateBracketsSoon=this._register(new bi(()=>this._updateBrackets(),50)),this._matchBrackets=this._editor.getOption(71),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(71)&&(this._matchBrackets=this._editor.getOption(71),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(n=>{const o=n.getStartPosition(),r=e.bracketPairs.matchBracket(o);let s=null;if(r)r[0].containsPosition(o)&&!r[1].containsPosition(o)?s=r[1].getStartPosition():r[1].containsPosition(o)&&(s=r[0].getStartPosition());else{const a=e.bracketPairs.findEnclosingBrackets(o);if(a)s=a[1].getStartPosition();else{const l=e.bracketPairs.findNextBracket(o);l&&l.range&&(s=l.range.getStartPosition())}}return s?new gt(s.lineNumber,s.column,s.lineNumber,s.column):new gt(o.lineNumber,o.column,o.lineNumber,o.column)});this._editor.setSelections(t),this._editor.revealRange(t[0])}selectToBracket(e){if(!this._editor.hasModel())return;const t=this._editor.getModel(),n=[];this._editor.getSelections().forEach(o=>{const r=o.getStartPosition();let s=t.bracketPairs.matchBracket(r);if(!s&&(s=t.bracketPairs.findEnclosingBrackets(r),!s)){const c=t.bracketPairs.findNextBracket(r);c&&c.range&&(s=t.bracketPairs.matchBracket(c.range.getStartPosition()))}let a=null,l=null;if(s){s.sort(V.compareRangesUsingStarts);const[c,u]=s;if(a=e?c.getStartPosition():c.getEndPosition(),l=e?u.getEndPosition():u.getStartPosition(),u.containsPosition(r)){const d=a;a=l,l=d}}a&&l&&n.push(new gt(a.lineNumber,a.column,l.lineNumber,l.column))}),n.length>0&&(this._editor.setSelections(n),this._editor.revealRange(n[0]))}removeBrackets(e){if(!this._editor.hasModel())return;const t=this._editor.getModel();this._editor.getSelections().forEach(n=>{const o=n.getPosition();let r=t.bracketPairs.matchBracket(o);r||(r=t.bracketPairs.findEnclosingBrackets(o)),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 n of this._lastBracketsData){const o=n.brackets;o&&(e[t++]={range:o[0],options:n.options},e[t++]={range:o[1],options:n.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(),n=t.getVersionId();let o=[];this._lastVersionId===n&&(o=this._lastBracketsData);const r=[];let s=0;for(let d=0,h=e.length;d1&&r.sort(ae.compare);const a=[];let l=0,c=0;const u=o.length;for(let d=0,h=r.length;d0&&(t.pushUndoStop(),t.executeCommands(this.id,o),t.pushUndoStop())}}ze(P_t);var O_t=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};const db="9_cutcopypaste",F_t=Fd||document.queryCommandSupported("cut"),kye=Fd||document.queryCommandSupported("copy"),B_t=typeof navigator.clipboard=="undefined"||Fc?document.queryCommandSupported("paste"):!0;function iY(i){return i.register(),i}const W_t=F_t?iY(new _S({id:"editor.action.clipboardCutAction",precondition:void 0,kbOpts:Fd?{primary:2102,win:{primary:2102,secondary:[1044]},weight:100}:void 0,menuOpts:[{menuId:Z.MenubarEditMenu,group:"2_ccp",title:C({key:"miCut",comment:["&& denotes a mnemonic"]},"Cu&&t"),order:1},{menuId:Z.EditorContext,group:db,title:C("actions.clipboard.cutLabel","Cut"),when:Q.writable,order:1},{menuId:Z.CommandPalette,group:"",title:C("actions.clipboard.cutLabel","Cut"),order:1},{menuId:Z.SimpleEditorContext,group:db,title:C("actions.clipboard.cutLabel","Cut"),when:Q.writable,order:1}]})):void 0,V_t=kye?iY(new _S({id:"editor.action.clipboardCopyAction",precondition:void 0,kbOpts:Fd?{primary:2081,win:{primary:2081,secondary:[2067]},weight:100}:void 0,menuOpts:[{menuId:Z.MenubarEditMenu,group:"2_ccp",title:C({key:"miCopy",comment:["&& denotes a mnemonic"]},"&&Copy"),order:2},{menuId:Z.EditorContext,group:db,title:C("actions.clipboard.copyLabel","Copy"),order:2},{menuId:Z.CommandPalette,group:"",title:C("actions.clipboard.copyLabel","Copy"),order:1},{menuId:Z.SimpleEditorContext,group:db,title:C("actions.clipboard.copyLabel","Copy"),order:2}]})):void 0;Hr.appendMenuItem(Z.MenubarEditMenu,{submenu:Z.MenubarCopy,title:{value:C("copy as","Copy As"),original:"Copy As"},group:"2_ccp",order:3});Hr.appendMenuItem(Z.EditorContext,{submenu:Z.EditorContextCopy,title:{value:C("copy as","Copy As"),original:"Copy As"},group:db,order:3});Hr.appendMenuItem(Z.EditorContext,{submenu:Z.EditorContextShare,title:{value:C("share","Share"),original:"Share"},group:"11_share",order:-1,when:Me.and(Me.notEquals("resourceScheme","output"),Q.editorTextFocus)});Hr.appendMenuItem(Z.EditorTitleContext,{submenu:Z.EditorTitleContextShare,title:{value:C("share","Share"),original:"Share"},group:"11_share",order:-1});Hr.appendMenuItem(Z.ExplorerContext,{submenu:Z.ExplorerContextShare,title:{value:C("share","Share"),original:"Share"},group:"11_share",order:-1});const Z9=B_t?iY(new _S({id:"editor.action.clipboardPasteAction",precondition:void 0,kbOpts:Fd?{primary:2100,win:{primary:2100,secondary:[1043]},linux:{primary:2100,secondary:[1043]},weight:100}:void 0,menuOpts:[{menuId:Z.MenubarEditMenu,group:"2_ccp",title:C({key:"miPaste",comment:["&& denotes a mnemonic"]},"&&Paste"),order:4},{menuId:Z.EditorContext,group:db,title:C("actions.clipboard.pasteLabel","Paste"),when:Q.writable,order:4},{menuId:Z.CommandPalette,group:"",title:C("actions.clipboard.pasteLabel","Paste"),order:1},{menuId:Z.SimpleEditorContext,group:db,title:C("actions.clipboard.pasteLabel","Paste"),when:Q.writable,order:4}]})):void 0;class H_t extends ft{constructor(){super({id:"editor.action.clipboardCopyWithSyntaxHighlightingAction",label:C("actions.clipboard.copyWithSyntaxHighlightingLabel","Copy With Syntax Highlighting"),alias:"Copy With Syntax Highlighting",precondition:void 0,kbOpts:{kbExpr:Q.textInputFocus,primary:0,weight:100}})}run(e,t){!t.hasModel()||!t.getOption(37)&&t.getSelection().isEmpty()||(mH.forceCopyWithSyntaxHighlighting=!0,t.focus(),t.getContainerDomNode().ownerDocument.execCommand("copy"),mH.forceCopyWithSyntaxHighlighting=!1)}}function Iye(i,e){!i||(i.addImplementation(1e4,"code-editor",(t,n)=>{const o=t.get(Jn).getFocusedCodeEditor();if(o&&o.hasTextFocus()){const r=o.getOption(37),s=o.getSelection();return s&&s.isEmpty()&&!r||o.getContainerDomNode().ownerDocument.execCommand(e),!0}return!1}),i.addImplementation(0,"generic-dom",(t,n)=>(J4().execCommand(e),!0)))}Iye(W_t,"cut");Iye(V_t,"copy");Z9&&(Z9.addImplementation(1e4,"code-editor",(i,e)=>{const t=i.get(Jn),n=i.get(yp),o=t.getFocusedCodeEditor();return o&&o.hasTextFocus()?!o.getContainerDomNode().ownerDocument.execCommand("paste")&&qv?(()=>O_t(void 0,void 0,void 0,function*(){const s=yield n.readText();if(s!==""){const a=JD.INSTANCE.get(s);let l=!1,c=null,u=null;a&&(l=o.getOption(37)&&!!a.isFromEmptySelection,c=typeof a.multicursorText!="undefined"?a.multicursorText:null,u=a.mode),o.trigger("keyboard","paste",{text:s,pasteOnNewLine:l,multicursorText:c,mode:u})}}))():!0:!1}),Z9.addImplementation(0,"generic-dom",(i,e)=>(J4().execCommand("paste"),!0)));kye&&ze(H_t);var $_t=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};class Wt{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+Wt.sep)}intersects(e){return this.contains(e)||e.contains(this)}append(e){return new Wt(this.value+Wt.sep+e)}}Wt.sep=".";Wt.None=new Wt("@@none@@");Wt.Empty=new Wt("");Wt.QuickFix=new Wt("quickfix");Wt.Refactor=new Wt("refactor");Wt.RefactorExtract=Wt.Refactor.append("extract");Wt.RefactorInline=Wt.Refactor.append("inline");Wt.RefactorMove=Wt.Refactor.append("move");Wt.RefactorRewrite=Wt.Refactor.append("rewrite");Wt.Notebook=new Wt("notebook");Wt.Source=new Wt("source");Wt.SourceOrganizeImports=Wt.Source.append("organizeImports");Wt.SourceFixAll=Wt.Source.append("fixAll");Wt.SurroundWith=Wt.Refactor.append("surround");var fl;(function(i){i.Refactor="refactor",i.RefactorPreview="refactor preview",i.Lightbulb="lightbulb",i.Default="other (default)",i.SourceAction="source action",i.QuickFix="quick fix action",i.FixAll="fix all",i.OrganizeImports="organize imports",i.AutoFix="auto fix",i.QuickFixHover="quick fix hover window",i.OnSave="save participants",i.ProblemsView="problems view"})(fl||(fl={}));function z_t(i,e){return!(i.include&&!i.include.intersects(e)||i.excludes&&i.excludes.some(t=>Tye(e,t,i.include))||!i.includeSourceActions&&Wt.Source.contains(e))}function U_t(i,e){const t=e.kind?new Wt(e.kind):void 0;return!(i.include&&(!t||!i.include.contains(t))||i.excludes&&t&&i.excludes.some(n=>Tye(t,n,i.include))||!i.includeSourceActions&&t&&Wt.Source.contains(t)||i.onlyIncludePreferredActions&&!e.isPreferred)}function Tye(i,e,t){return!(!e.contains(i)||t&&e.contains(t))}class Hh{static fromUser(e,t){return!e||typeof e!="object"?new Hh(t.kind,t.apply,!1):new Hh(Hh.getKindFromUser(e,t.kind),Hh.getApplyFromUser(e,t.apply),Hh.getPreferredUser(e))}static getApplyFromUser(e,t){switch(typeof e.apply=="string"?e.apply.toLowerCase():""){case"first":return"first";case"never":return"never";case"ifsingle":return"ifSingle";default:return t}}static getKindFromUser(e,t){return typeof e.kind=="string"?new Wt(e.kind):t}static getPreferredUser(e){return typeof e.preferred=="boolean"?e.preferred:!1}constructor(e,t,n){this.kind=e,this.apply=t,this.preferred=n}}class j_t{constructor(e,t,n){this.action=e,this.provider=t,this.highlightRange=n}resolve(e){var t;return $_t(this,void 0,void 0,function*(){if(((t=this.provider)===null||t===void 0?void 0:t.resolveCodeAction)&&!this.action.edit){let n;try{n=yield this.provider.resolveCodeAction(this.action,e)}catch(o){$o(o)}n&&(this.action.edit=n.edit)}return this})}}var aO=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};const Nye="editor.action.codeAction",oY="editor.action.quickFix",Rye="editor.action.autoFix",Mye="editor.action.refactor",Aye="editor.action.sourceAction",rY="editor.action.organizeImports",sY="editor.action.fixAll";class IE extends _e{static codeActionsPreferredComparator(e,t){return e.isPreferred&&!t.isPreferred?-1:!e.isPreferred&&t.isPreferred?1:0}static codeActionsComparator({action:e},{action:t}){return ws(e.diagnostics)?ws(t.diagnostics)?IE.codeActionsPreferredComparator(e,t):-1:ws(t.diagnostics)?1:IE.codeActionsPreferredComparator(e,t)}constructor(e,t,n){super(),this.documentation=t,this._register(n),this.allActions=[...e].sort(IE.codeActionsComparator),this.validActions=this.allActions.filter(({action:o})=>!o.disabled)}get hasAutoFix(){return this.validActions.some(({action:e})=>!!e.kind&&Wt.QuickFix.contains(new Wt(e.kind))&&!!e.isPreferred)}}const Ele={actions:[],documentation:void 0};function TE(i,e,t,n,o,r){var s;return aO(this,void 0,void 0,function*(){const a=n.filter||{},l=Object.assign(Object.assign({},a),{excludes:[...a.excludes||[],Wt.Notebook]}),c={only:(s=a.include)===null||s===void 0?void 0:s.value,trigger:n.type},u=new ZX(e,r),d=n.type===2,h=K_t(i,e,d?l:a),f=new Be,g=h.map(v=>aO(this,void 0,void 0,function*(){try{o.report(v);const m=yield v.provideCodeActions(e,t,c,u.token);if(m&&f.add(m),u.token.isCancellationRequested)return Ele;const _=((m==null?void 0:m.actions)||[]).filter(w=>w&&U_t(a,w)),y=G_t(v,_,a.include);return{actions:_.map(w=>new j_t(w,v)),documentation:y}}catch(m){if(sh(m))throw m;return $o(m),Ele}})),p=i.onDidChange(()=>{const v=i.all(e);Lo(v,h)||u.cancel()});try{const v=yield Promise.all(g),m=v.map(y=>y.actions).flat(),_=[...hf(v.map(y=>y.documentation)),...q_t(i,e,n,m)];return new IE(m,_,f)}finally{p.dispose(),u.dispose()}})}function K_t(i,e,t){return i.all(e).filter(n=>n.providedCodeActionKinds?n.providedCodeActionKinds.some(o=>z_t(t,new Wt(o))):!0)}function*q_t(i,e,t,n){var o,r,s;if(e&&n.length)for(const a of i.all(e))a._getAdditionalMenuItems&&(yield*(o=a._getAdditionalMenuItems)===null||o===void 0?void 0:o.call(a,{trigger:t.type,only:(s=(r=t.filter)===null||r===void 0?void 0:r.include)===null||s===void 0?void 0:s.value},n.map(l=>l.action)))}function G_t(i,e,t){if(!i.documentation)return;const n=i.documentation.map(o=>({kind:new Wt(o.kind),command:o.command}));if(t){let o;for(const r of n)r.kind.contains(t)&&(o?o.kind.contains(r.kind)&&(o=r):o=r);if(o)return o==null?void 0:o.command}for(const o of e)if(!!o.kind){for(const r of n)if(r.kind.contains(new Wt(o.kind)))return r.command}}var lO;(function(i){i.OnSave="onSave",i.FromProblemsView="fromProblemsView",i.FromCodeActions="fromCodeActions"})(lO||(lO={}));function X_t(i,e,t,n,o=_n.None){var r;return aO(this,void 0,void 0,function*(){const s=i.get(nT),a=i.get(_o),l=i.get(tc),c=i.get(Ao);if(l.publicLog2("codeAction.applyCodeAction",{codeActionTitle:e.action.title,codeActionKind:e.action.kind,codeActionIsPreferred:!!e.action.isPreferred,reason:t}),yield e.resolve(o),!o.isCancellationRequested&&!(!((r=e.action.edit)===null||r===void 0)&&r.edits.length&&!(yield s.apply(e.action.edit,{editor:n==null?void 0:n.editor,label:e.action.title,quotableLabel:e.action.title,code:"undoredo.codeAction",respectAutoSaveConfig:t!==lO.OnSave,showPreview:n==null?void 0:n.preview})).isApplied)&&e.action.command)try{yield a.executeCommand(e.action.command.id,...e.action.command.arguments||[])}catch(u){const d=Y_t(u);c.error(typeof d=="string"?d:C("applyCodeActionFailed","An unknown error occurred while applying the code action"))}})}function Y_t(i){return typeof i=="string"?i:i instanceof Error&&typeof i.message=="string"?i.message:void 0}Rn.registerCommand("_executeCodeActionProvider",function(i,e,t,n,o){return aO(this,void 0,void 0,function*(){if(!(e instanceof Rt))throw Mc();const{codeActionProvider:r}=i.get(pt),s=i.get(Yi).getModel(e);if(!s)throw Mc();const a=gt.isISelection(t)?gt.liftSelection(t):V.isIRange(t)?s.validateRange(t):void 0;if(!a)throw Mc();const l=typeof n=="string"?new Wt(n):void 0,c=yield TE(r,s,a,{type:1,triggerAction:fl.Default,filter:{includeSourceActions:!0,include:l}},Gg.None,_n.None),u=[],d=Math.min(c.validActions.length,typeof o=="number"?o:0);for(let h=0;hh.action)}finally{setTimeout(()=>c.dispose(),100)}})});var Z_t=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Q_t=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},uz;let cO=uz=class{constructor(e){this.keybindingService=e}getResolver(){const e=new ah(()=>this.keybindingService.getKeybindings().filter(t=>uz.codeActionCommands.indexOf(t.command)>=0).filter(t=>t.resolvedKeybinding).map(t=>{let n=t.commandArgs;return t.command===rY?n={kind:Wt.SourceOrganizeImports.value}:t.command===sY&&(n={kind:Wt.SourceFixAll.value}),Object.assign({resolvedKeybinding:t.resolvedKeybinding},Hh.fromUser(n,{kind:Wt.None,apply:"never"}))}));return t=>{if(t.kind){const n=this.bestKeybindingForCodeAction(t,e.value);return n==null?void 0:n.resolvedKeybinding}}}bestKeybindingForCodeAction(e,t){if(!e.kind)return;const n=new Wt(e.kind);return t.filter(o=>o.kind.contains(n)).filter(o=>o.preferred?e.isPreferred:!0).reduceRight((o,r)=>o?o.kind.contains(r.kind)?r:o:r,void 0)}};cO.codeActionCommands=[Mye,Nye,Aye,rY,sY];cO=uz=Z_t([Q_t(0,xi)],cO);J("symbolIcon.arrayForeground",{dark:Ke,light:Ke,hcDark:Ke,hcLight:Ke},C("symbolIcon.arrayForeground","The foreground color for array symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));J("symbolIcon.booleanForeground",{dark:Ke,light:Ke,hcDark:Ke,hcLight:Ke},C("symbolIcon.booleanForeground","The foreground color for boolean symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));J("symbolIcon.classForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},C("symbolIcon.classForeground","The foreground color for class symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));J("symbolIcon.colorForeground",{dark:Ke,light:Ke,hcDark:Ke,hcLight:Ke},C("symbolIcon.colorForeground","The foreground color for color symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));J("symbolIcon.constantForeground",{dark:Ke,light:Ke,hcDark:Ke,hcLight:Ke},C("symbolIcon.constantForeground","The foreground color for constant symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));J("symbolIcon.constructorForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},C("symbolIcon.constructorForeground","The foreground color for constructor symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));J("symbolIcon.enumeratorForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},C("symbolIcon.enumeratorForeground","The foreground color for enumerator symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));J("symbolIcon.enumeratorMemberForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},C("symbolIcon.enumeratorMemberForeground","The foreground color for enumerator member symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));J("symbolIcon.eventForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},C("symbolIcon.eventForeground","The foreground color for event symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));J("symbolIcon.fieldForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},C("symbolIcon.fieldForeground","The foreground color for field symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));J("symbolIcon.fileForeground",{dark:Ke,light:Ke,hcDark:Ke,hcLight:Ke},C("symbolIcon.fileForeground","The foreground color for file symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));J("symbolIcon.folderForeground",{dark:Ke,light:Ke,hcDark:Ke,hcLight:Ke},C("symbolIcon.folderForeground","The foreground color for folder symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));J("symbolIcon.functionForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},C("symbolIcon.functionForeground","The foreground color for function symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));J("symbolIcon.interfaceForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},C("symbolIcon.interfaceForeground","The foreground color for interface symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));J("symbolIcon.keyForeground",{dark:Ke,light:Ke,hcDark:Ke,hcLight:Ke},C("symbolIcon.keyForeground","The foreground color for key symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));J("symbolIcon.keywordForeground",{dark:Ke,light:Ke,hcDark:Ke,hcLight:Ke},C("symbolIcon.keywordForeground","The foreground color for keyword symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));J("symbolIcon.methodForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},C("symbolIcon.methodForeground","The foreground color for method symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));J("symbolIcon.moduleForeground",{dark:Ke,light:Ke,hcDark:Ke,hcLight:Ke},C("symbolIcon.moduleForeground","The foreground color for module symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));J("symbolIcon.namespaceForeground",{dark:Ke,light:Ke,hcDark:Ke,hcLight:Ke},C("symbolIcon.namespaceForeground","The foreground color for namespace symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));J("symbolIcon.nullForeground",{dark:Ke,light:Ke,hcDark:Ke,hcLight:Ke},C("symbolIcon.nullForeground","The foreground color for null symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));J("symbolIcon.numberForeground",{dark:Ke,light:Ke,hcDark:Ke,hcLight:Ke},C("symbolIcon.numberForeground","The foreground color for number symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));J("symbolIcon.objectForeground",{dark:Ke,light:Ke,hcDark:Ke,hcLight:Ke},C("symbolIcon.objectForeground","The foreground color for object symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));J("symbolIcon.operatorForeground",{dark:Ke,light:Ke,hcDark:Ke,hcLight:Ke},C("symbolIcon.operatorForeground","The foreground color for operator symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));J("symbolIcon.packageForeground",{dark:Ke,light:Ke,hcDark:Ke,hcLight:Ke},C("symbolIcon.packageForeground","The foreground color for package symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));J("symbolIcon.propertyForeground",{dark:Ke,light:Ke,hcDark:Ke,hcLight:Ke},C("symbolIcon.propertyForeground","The foreground color for property symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));J("symbolIcon.referenceForeground",{dark:Ke,light:Ke,hcDark:Ke,hcLight:Ke},C("symbolIcon.referenceForeground","The foreground color for reference symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));J("symbolIcon.snippetForeground",{dark:Ke,light:Ke,hcDark:Ke,hcLight:Ke},C("symbolIcon.snippetForeground","The foreground color for snippet symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));J("symbolIcon.stringForeground",{dark:Ke,light:Ke,hcDark:Ke,hcLight:Ke},C("symbolIcon.stringForeground","The foreground color for string symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));J("symbolIcon.structForeground",{dark:Ke,light:Ke,hcDark:Ke,hcLight:Ke},C("symbolIcon.structForeground","The foreground color for struct symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));J("symbolIcon.textForeground",{dark:Ke,light:Ke,hcDark:Ke,hcLight:Ke},C("symbolIcon.textForeground","The foreground color for text symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));J("symbolIcon.typeParameterForeground",{dark:Ke,light:Ke,hcDark:Ke,hcLight:Ke},C("symbolIcon.typeParameterForeground","The foreground color for type parameter symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));J("symbolIcon.unitForeground",{dark:Ke,light:Ke,hcDark:Ke,hcLight:Ke},C("symbolIcon.unitForeground","The foreground color for unit symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));J("symbolIcon.variableForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},C("symbolIcon.variableForeground","The foreground color for variable symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));const Pye=Object.freeze({kind:Wt.Empty,title:C("codeAction.widget.id.more","More Actions...")}),J_t=Object.freeze([{kind:Wt.QuickFix,title:C("codeAction.widget.id.quickfix","Quick Fix")},{kind:Wt.RefactorExtract,title:C("codeAction.widget.id.extract","Extract"),icon:Xe.wrench},{kind:Wt.RefactorInline,title:C("codeAction.widget.id.inline","Inline"),icon:Xe.wrench},{kind:Wt.RefactorRewrite,title:C("codeAction.widget.id.convert","Rewrite"),icon:Xe.wrench},{kind:Wt.RefactorMove,title:C("codeAction.widget.id.move","Move"),icon:Xe.wrench},{kind:Wt.SurroundWith,title:C("codeAction.widget.id.surround","Surround With"),icon:Xe.symbolSnippet},{kind:Wt.Source,title:C("codeAction.widget.id.source","Source Action"),icon:Xe.symbolFile},Pye]);function e0t(i,e,t){if(!e)return i.map(r=>{var s;return{kind:"action",item:r,group:Pye,disabled:!!r.action.disabled,label:r.action.disabled||r.action.title,canPreview:!!(!((s=r.action.edit)===null||s===void 0)&&s.edits.length)}});const n=J_t.map(r=>({group:r,actions:[]}));for(const r of i){const s=r.action.kind?new Wt(r.action.kind):Wt.None;for(const a of n)if(a.group.kind.contains(s)){a.actions.push(r);break}}const o=[];for(const r of n)if(r.actions.length){o.push({kind:"header",group:r.group});for(const s of r.actions)o.push({kind:"action",item:s,group:r.group,label:s.action.title,disabled:!!s.action.disabled,keybinding:t(s.action)})}return o}var t0t=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},n0t=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},dz,XC;(function(i){i.Hidden={type:0};class e{constructor(n,o,r,s){this.actions=n,this.trigger=o,this.editorPosition=r,this.widgetPosition=s,this.type=1}}i.Showing=e})(XC||(XC={}));let hb=dz=class extends _e{constructor(e,t){super(),this._editor=e,this._onClick=this._register(new le),this.onClick=this._onClick.event,this._state=XC.Hidden,this._domNode=He("div.lightBulbWidget"),this._register(Ei.ignoreTarget(this._domNode)),this._editor.addContentWidget(this),this._register(this._editor.onDidChangeModelContent(n=>{const o=this._editor.getModel();(this.state.type!==1||!o||this.state.editorPosition.lineNumber>=o.getLineCount())&&this.hide()})),this._register(PQe(this._domNode,n=>{if(this.state.type!==1)return;this._editor.focus(),n.preventDefault();const{top:o,height:r}=Yo(this._domNode),s=this._editor.getOption(66);let a=Math.floor(s/3);this.state.widgetPosition.position!==null&&this.state.widgetPosition.position.lineNumber{(n.buttons&1)===1&&this.hide()})),this._register(this._editor.onDidChangeConfiguration(n=>{n.hasChanged(64)&&!this._editor.getOption(64).enabled&&this.hide()})),this._register(st.runAndSubscribe(t.onDidUpdateKeybindings,()=>{var n,o,r,s;this._preferredKbLabel=(o=(n=t.lookupKeybinding(Rye))===null||n===void 0?void 0:n.getLabel())!==null&&o!==void 0?o:void 0,this._quickFixKbLabel=(s=(r=t.lookupKeybinding(oY))===null||r===void 0?void 0:r.getLabel())!==null&&s!==void 0?s:void 0,this._updateLightBulbTitleAndIcon()}))}dispose(){super.dispose(),this._editor.removeContentWidget(this)}getId(){return"LightBulbWidget"}getDomNode(){return this._domNode}getPosition(){return this._state.type===1?this._state.widgetPosition:null}update(e,t,n){if(e.validActions.length<=0)return this.hide();const o=this._editor.getOptions();if(!o.get(64).enabled)return this.hide();const r=this._editor.getModel();if(!r)return this.hide();const{lineNumber:s,column:a}=r.validatePosition(n),l=r.getOptions().tabSize,c=o.get(50),u=r.getLineContent(s),d=y5(u,l),h=c.spaceWidth*d>22,f=p=>p>2&&this._editor.getTopForLineNumber(p)===this._editor.getTopForLineNumber(p-1);let g=s;if(!h){if(s>1&&!f(s-1))g-=1;else if(!f(s+1))g+=1;else if(a*c.spaceWidth<22)return this.hide()}this.state=new XC.Showing(e,t,n,{position:{lineNumber:g,column:1},preference:dz._posPref}),this._editor.layoutContentWidget(this)}hide(){this.state!==XC.Hidden&&(this.state=XC.Hidden,this._editor.layoutContentWidget(this))}get state(){return this._state}set state(e){this._state=e,this._updateLightBulbTitleAndIcon()}_updateLightBulbTitleAndIcon(){if(this.state.type===1&&this.state.actions.hasAutoFix&&(this._domNode.classList.remove(...Mt.asClassNameArray(Xe.lightBulb)),this._domNode.classList.add(...Mt.asClassNameArray(Xe.lightbulbAutofix)),this._preferredKbLabel)){this.title=C("preferredcodeActionWithKb","Show Code Actions. Preferred Quick Fix Available ({0})",this._preferredKbLabel);return}this._domNode.classList.remove(...Mt.asClassNameArray(Xe.lightbulbAutofix)),this._domNode.classList.add(...Mt.asClassNameArray(Xe.lightBulb)),this._quickFixKbLabel?this.title=C("codeActionWithKb","Show Code Actions ({0})",this._quickFixKbLabel):this.title=C("codeAction","Show Code Actions")}set title(e){this._domNode.title=e}};hb.ID="editor.contrib.lightbulbWidget";hb._posPref=[0];hb=dz=t0t([n0t(1,xi)],hb);var i0t=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Dle=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},Oye=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},hz;let up=hz=class{constructor(e,t,n){this._options=e,this._languageService=t,this._openerService=n,this._onDidRenderAsync=new le,this.onDidRenderAsync=this._onDidRenderAsync.event}dispose(){this._onDidRenderAsync.dispose()}render(e,t,n){if(!e)return{element:document.createElement("span"),dispose:()=>{}};const o=new Be,r=o.add(M5(e,Object.assign(Object.assign({},this._getRenderOptions(e,o)),t),n));return r.element.classList.add("rendered-markdown"),{element:r.element,dispose:()=>o.dispose()}}_getRenderOptions(e,t){return{codeBlockRenderer:(n,o)=>Oye(this,void 0,void 0,function*(){var r,s,a;let l;n?l=this._languageService.getLanguageIdByLanguageName(n):this._options.editor&&(l=(r=this._options.editor.getModel())===null||r===void 0?void 0:r.getLanguageId()),l||(l=Gl);const c=yield hlt(this._languageService,o,l),u=document.createElement("span");if(u.innerHTML=(a=(s=hz._ttpTokenizer)===null||s===void 0?void 0:s.createHTML(c))!==null&&a!==void 0?a:c,this._options.editor){const d=this._options.editor.getOption(50);ss(u,d)}else this._options.codeBlockFontFamily&&(u.style.fontFamily=this._options.codeBlockFontFamily);return this._options.codeBlockFontSize!==void 0&&(u.style.fontSize=this._options.codeBlockFontSize),u}),asyncRenderCallback:()=>this._onDidRenderAsync.fire(),actionHandler:{callback:n=>Fye(this._openerService,n,e.isTrusted),disposables:t}}}};up._ttpTokenizer=mp("tokenizeToString",{createHTML(i){return i}});up=hz=i0t([Dle(1,Ki),Dle(2,ml)],up);function Fye(i,e,t){return Oye(this,void 0,void 0,function*(){try{return yield i.open(e,{fromUserGesture:!0,allowContributedOpeners:!0,allowCommands:o0t(t)})}catch(n){return en(n),!1}})}function o0t(i){return i===!0?!0:i&&Array.isArray(i.enabledCommands)?i.enabledCommands:!1}var r0t=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},kle=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},SM;let cl=SM=class{static get(e){return e.getContribution(SM.ID)}constructor(e,t,n){this._openerService=n,this._messageWidget=new Kr,this._messageListeners=new Be,this._mouseOverMessage=!1,this._editor=e,this._visible=SM.MESSAGE_VISIBLE.bindTo(t)}dispose(){var e;(e=this._message)===null||e===void 0||e.dispose(),this._messageListeners.dispose(),this._messageWidget.dispose(),this._visible.reset()}showMessage(e,t){Cs(Zm(e)?e.value:e),this._visible.set(!0),this._messageWidget.clear(),this._messageListeners.clear(),this._message=Zm(e)?M5(e,{actionHandler:{callback:o=>Fye(this._openerService,o,Zm(e)?e.isTrusted:void 0),disposables:this._messageListeners}}):void 0,this._messageWidget.value=new Ile(this._editor,t,typeof e=="string"?e:this._message.element),this._messageListeners.add(st.debounce(this._editor.onDidBlurEditorText,(o,r)=>r,0)(()=>{this._mouseOverMessage||this._messageWidget.value&&rs(Nu(),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(ke(this._messageWidget.value.getDomNode(),et.MOUSE_ENTER,()=>this._mouseOverMessage=!0,!0)),this._messageListeners.add(ke(this._messageWidget.value.getDomNode(),et.MOUSE_LEAVE,()=>this._mouseOverMessage=!1,!0));let n;this._messageListeners.add(this._editor.onMouseMove(o=>{!o.target.position||(n?n.containsPosition(o.target.position)||this.closeMessage():n=new V(t.lineNumber-3,1,o.target.position.lineNumber+3,1))}))}closeMessage(){this._visible.reset(),this._messageListeners.clear(),this._messageWidget.value&&this._messageListeners.add(Ile.fadeOut(this._messageWidget.value))}};cl.ID="editor.contrib.messageController";cl.MESSAGE_VISIBLE=new lt("messageVisible",!1,C("messageVisible","Whether the editor is currently showing an inline message"));cl=SM=r0t([kle(1,Ut),kle(2,ml)],cl);const s0t=Ir.bindToContribution(cl.get);Ye(new s0t({id:"leaveEditorMessage",precondition:cl.MESSAGE_VISIBLE,handler:i=>i.closeMessage(),kbOpts:{weight:100+30,primary:9}}));class Ile{static fadeOut(e){const t=()=>{e.dispose(),clearTimeout(n),e.getDomNode().removeEventListener("animationend",t)},n=setTimeout(t,110);return e.getDomNode().addEventListener("animationend",t),e.getDomNode().classList.add("fadeOut"),{dispose:t}}constructor(e,{lineNumber:t,column:n},o){this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._editor=e,this._editor.revealLinesInCenterIfOutsideViewport(t,t,0),this._position={lineNumber:t,column:n},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 s=document.createElement("div");typeof o=="string"?(s.classList.add("message"),s.textContent=o):(o.classList.add("message"),s.appendChild(o)),this._domNode.appendChild(s);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:[1,2],positionAffinity:1}}afterRender(e){this._domNode.classList.toggle("below",e===2)}}zn(cl.ID,cl,4);var Bye=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},fz=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},a0t=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};const Wye="acceptSelectedCodeAction",Vye="previewSelectedCodeAction";class l0t{get templateId(){return"header"}renderTemplate(e){e.classList.add("group-header");const t=document.createElement("span");return e.append(t),{container:e,text:t}}renderElement(e,t,n){var o,r;n.text.textContent=(r=(o=e.group)===null||o===void 0?void 0:o.title)!==null&&r!==void 0?r:""}disposeTemplate(e){}}let gz=class{get templateId(){return"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 n=document.createElement("span");n.className="title",e.append(n);const o=new aT(e,Vl);return{container:e,icon:t,text:n,keybinding:o}}renderElement(e,t,n){var o,r,s;if(!((o=e.group)===null||o===void 0)&&o.icon?(n.icon.className=Mt.asClassName(e.group.icon),e.group.icon.color&&(n.icon.style.color=ct(e.group.icon.color.id))):(n.icon.className=Mt.asClassName(Xe.lightBulb),n.icon.style.color="var(--vscode-editorLightBulb-foreground)"),!e.item||!e.label)return;n.text.textContent=Hye(e.label),n.keybinding.set(e.keybinding),KQe(!!e.keybinding,n.keybinding.element);const a=(r=this._keybindingService.lookupKeybinding(Wye))===null||r===void 0?void 0:r.getLabel(),l=(s=this._keybindingService.lookupKeybinding(Vye))===null||s===void 0?void 0:s.getLabel();n.container.classList.toggle("option-disabled",e.disabled),e.disabled?n.container.title=e.label:a&&l?this._supportsPreview&&e.canPreview?n.container.title=C({key:"label-preview",comment:['placeholders are keybindings, e.g "F2 to apply, Shift+F2 to preview"']},"{0} to apply, {1} to preview",a,l):n.container.title=C({key:"label",comment:['placeholder is a keybinding, e.g "F2 to apply"']},"{0} to apply",a):n.container.title=""}disposeTemplate(e){}};gz=Bye([fz(1,xi)],gz);class c0t extends UIEvent{constructor(){super("acceptSelectedAction")}}class Tle extends UIEvent{constructor(){super("previewSelectedAction")}}function u0t(i){if(i.kind==="action")return i.label}let pz=class extends _e{constructor(e,t,n,o,r,s){super(),this._delegate=o,this._contextViewService=r,this._keybindingService=s,this._actionLineHeight=24,this._headerLineHeight=26,this.cts=this._register(new Ro),this.domNode=document.createElement("div"),this.domNode.classList.add("actionList");const a={getHeight:l=>l.kind==="header"?this._headerLineHeight:this._actionLineHeight,getTemplateId:l=>l.kind};this._list=this._register(new qu(e,this.domNode,a,[new gz(t,this._keybindingService),new l0t],{keyboardSupport:!1,typeNavigationEnabled:!0,keyboardNavigationLabelProvider:{getKeyboardNavigationLabel:u0t},accessibilityProvider:{getAriaLabel:l=>{if(l.kind==="action"){let c=l.label?Hye(l==null?void 0:l.label):"";return l.disabled&&(c=C({key:"customQuickFixWidget.labels",comment:["Action widget labels for accessibility."]},"{0}, Disabled Reason: {1}",c,l.disabled)),c}return null},getWidgetAriaLabel:()=>C({key:"customQuickFixWidget",comment:["An action widget option"]},"Action Widget"),getRole:l=>l.kind==="action"?"option":"separator",getWidgetRole:()=>"listbox"}})),this._list.style(jb),this._register(this._list.onMouseClick(l=>this.onListClick(l))),this._register(this._list.onMouseOver(l=>this.onListHover(l))),this._register(this._list.onDidChangeFocus(()=>this.onFocus())),this._register(this._list.onDidChangeSelection(l=>this.onListSelection(l))),this._allMenuItems=n,this._list.splice(0,this._list.length,this._allMenuItems),this._list.length&&this.focusNext()}focusCondition(e){return!e.disabled&&e.kind==="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,o=this._allMenuItems.length*this._actionLineHeight+t*this._headerLineHeight-t*this._actionLineHeight;this._list.layout(o);const r=this._allMenuItems.map((c,u)=>{const d=document.getElementById(this._list.getElementID(u));if(d){d.style.width="auto";const h=d.getBoundingClientRect().width;return d.style.width="",h}return 0}),s=Math.max(...r,e),a=.7,l=Math.min(o,document.body.clientHeight*a);return this._list.layout(l,s),this.domNode.style.height=`${l}px`,this._list.domFocus(),s}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 n=t[0],o=this._list.element(n);if(!this.focusCondition(o))return;const r=e?new Tle:new c0t;this._list.setSelection([n],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 Tle):this._list.setSelection([])}onFocus(){var e,t;this._list.domFocus();const n=this._list.getFocus();if(n.length===0)return;const o=n[0],r=this._list.element(o);(t=(e=this._delegate).onFocus)===null||t===void 0||t.call(e,r.item)}onListHover(e){return a0t(this,void 0,void 0,function*(){const t=e.element;if(t&&t.item&&this.focusCondition(t)){if(this._delegate.onHover&&!t.disabled&&t.kind==="action"){const n=yield this._delegate.onHover(t.item,this.cts.token);t.canPreview=n?n.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([])}};pz=Bye([fz(4,_p),fz(5,xi)],pz);function Hye(i){return i.replace(/\r\n|\r|\n/g," ")}var d0t=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Q9=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};J("actionBar.toggledBackground",{dark:d0,light:d0,hcDark:d0,hcLight:d0},C("actionBar.toggledBackground","Background color for toggled action items in action bar."));const fb={Visible:new lt("codeActionMenuVisible",!1,C("codeActionMenuVisible","Whether the action widget list is visible"))},Yb=yn("actionWidgetService");let gb=class extends _e{get isVisible(){return fb.Visible.getValue(this._contextKeyService)||!1}constructor(e,t,n){super(),this._contextViewService=e,this._contextKeyService=t,this._instantiationService=n,this._list=this._register(new Kr)}show(e,t,n,o,r,s,a){const l=fb.Visible.bindTo(this._contextKeyService),c=this._instantiationService.createInstance(pz,e,t,n,o);this._contextViewService.showContextView({getAnchor:()=>r,render:u=>(l.set(!0),this._renderWidget(u,c,a!=null?a:[])),onHide:u=>{l.reset(),this._onWidgetClosed(u)}},s,!1)}acceptSelected(e){var t;(t=this._list.value)===null||t===void 0||t.acceptSelected(e)}focusPrevious(){var e,t;(t=(e=this._list)===null||e===void 0?void 0:e.value)===null||t===void 0||t.focusPrevious()}focusNext(){var e,t;(t=(e=this._list)===null||e===void 0?void 0:e.value)===null||t===void 0||t.focusNext()}hide(){var e;(e=this._list.value)===null||e===void 0||e.hide(),this._list.clear()}_renderWidget(e,t,n){var o;const r=document.createElement("div");if(r.classList.add("action-widget"),e.appendChild(r),this._list.value=t,this._list.value)r.appendChild(this._list.value.domNode);else throw new Error("List has no value");const s=new Be,a=document.createElement("div"),l=e.appendChild(a);l.classList.add("context-view-block"),s.add(ke(l,et.MOUSE_DOWN,g=>g.stopPropagation()));const c=document.createElement("div"),u=e.appendChild(c);u.classList.add("context-view-pointerBlock"),s.add(ke(u,et.POINTER_MOVE,()=>u.remove())),s.add(ke(u,et.MOUSE_DOWN,()=>u.remove()));let d=0;if(n.length){const g=this._createActionBar(".action-widget-action-bar",n);g&&(r.appendChild(g.getContainer().parentElement),s.add(g),d=g.getContainer().offsetWidth)}const h=(o=this._list.value)===null||o===void 0?void 0:o.layout(d);r.style.width=`${h}px`;const f=s.add(pf(e));return s.add(f.onDidBlur(()=>this.hide())),s}_createActionBar(e,t){if(!t.length)return;const n=He(e),o=new zc(n);return o.push(t,{icon:!1,label:!0}),o}_onWidgetClosed(e){var t;(t=this._list.value)===null||t===void 0||t.hide(e)}};gb=d0t([Q9(0,_p),Q9(1,Ut),Q9(2,$t)],gb);Mn(Yb,gb,1);const pT=100+1e3;$i(class extends ec{constructor(){super({id:"hideCodeActionWidget",title:{value:C("hideCodeActionWidget.title","Hide action widget"),original:"Hide action widget"},precondition:fb.Visible,keybinding:{weight:pT,primary:9,secondary:[1033]}})}run(i){i.get(Yb).hide()}});$i(class extends ec{constructor(){super({id:"selectPrevCodeAction",title:{value:C("selectPrevCodeAction.title","Select previous action"),original:"Select previous action"},precondition:fb.Visible,keybinding:{weight:pT,primary:16,secondary:[2064],mac:{primary:16,secondary:[2064,302]}}})}run(i){const e=i.get(Yb);e instanceof gb&&e.focusPrevious()}});$i(class extends ec{constructor(){super({id:"selectNextCodeAction",title:{value:C("selectNextCodeAction.title","Select next action"),original:"Select next action"},precondition:fb.Visible,keybinding:{weight:pT,primary:18,secondary:[2066],mac:{primary:18,secondary:[2066,300]}}})}run(i){const e=i.get(Yb);e instanceof gb&&e.focusNext()}});$i(class extends ec{constructor(){super({id:Wye,title:{value:C("acceptSelected.title","Accept selected action"),original:"Accept selected action"},precondition:fb.Visible,keybinding:{weight:pT,primary:3,secondary:[2137]}})}run(i){const e=i.get(Yb);e instanceof gb&&e.acceptSelected()}});$i(class extends ec{constructor(){super({id:Vye,title:{value:C("previewSelected.title","Preview selected action"),original:"Preview selected action"},precondition:fb.Visible,keybinding:{weight:pT,primary:2051}})}run(i){const e=i.get(Yb);e instanceof gb&&e.acceptSelected(!0)}});var h0t=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};const $ye=new lt("supportedCodeAction","");class f0t extends _e{constructor(e,t,n,o=250){super(),this._editor=e,this._markerService=t,this._signalChange=n,this._delay=o,this._autoTriggerTimer=this._register(new zu),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(n=>VG(n,t.uri))&&this._tryAutoTrigger()}_tryAutoTrigger(){this._autoTriggerTimer.cancelAndSet(()=>{this.trigger({type:2,triggerAction:fl.Default})},this._delay)}_getRangeOfSelectionUnlessWhitespaceEnclosed(e){if(!this._editor.hasModel())return;const t=this._editor.getModel(),n=this._editor.getSelection();if(n.isEmpty()&&e.type===2){const{lineNumber:o,column:r}=n.getPosition(),s=t.getLineContent(o);if(s.length===0)return;if(r===1){if(/\s/.test(s[0]))return}else if(r===t.getLineMaxColumn(o)){if(/\s/.test(s[s.length-1]))return}else if(/\s/.test(s[r-2])&&/\s/.test(s[r-1]))return}return n}}var q_;(function(i){i.Empty={type:0};class e{constructor(n,o,r){this.trigger=n,this.position=o,this._cancellablePromise=r,this.type=1,this.actions=r.catch(s=>{if(sh(s))return zye;throw s})}cancel(){this._cancellablePromise.cancel()}}i.Triggered=e})(q_||(q_={}));const zye=Object.freeze({allActions:[],validActions:[],dispose:()=>{},documentation:[],hasAutoFix:!1});class g0t extends _e{constructor(e,t,n,o,r,s){super(),this._editor=e,this._registry=t,this._markerService=n,this._progressService=r,this._configurationService=s,this._codeActionOracle=this._register(new Kr),this._state=q_.Empty,this._onDidChangeState=this._register(new le),this.onDidChangeState=this._onDidChangeState.event,this._disposed=!1,this._supportedCodeActions=$ye.bindTo(o),this._register(this._editor.onDidChangeModel(()=>this._update())),this._register(this._editor.onDidChangeModelLanguage(()=>this._update())),this._register(this._registry.onDidChange(()=>this._update())),this._update()}dispose(){this._disposed||(this._disposed=!0,super.dispose(),this.setState(q_.Empty,!0))}_settingEnabledNearbyQuickfixes(){var e;const t=(e=this._editor)===null||e===void 0?void 0:e.getModel();return this._configurationService?this._configurationService.getValue("editor.codeActionWidget.includeNearbyQuickfixes",{resource:t==null?void 0:t.uri}):!1}_update(){if(this._disposed)return;this._codeActionOracle.value=void 0,this.setState(q_.Empty);const e=this._editor.getModel();if(e&&this._registry.has(e)&&!this._editor.getOption(90)){const t=this._registry.all(e).flatMap(n=>{var o;return(o=n.providedCodeActionKinds)!==null&&o!==void 0?o:[]});this._supportedCodeActions.set(t.join(" ")),this._codeActionOracle.value=new f0t(this._editor,this._markerService,n=>{var o;if(!n){this.setState(q_.Empty);return}const r=n.selection.getStartPosition(),s=sr(a=>h0t(this,void 0,void 0,function*(){var l,c,u,d,h,f;if(this._settingEnabledNearbyQuickfixes()&&n.trigger.type===1&&(n.trigger.triggerAction===fl.QuickFix||((c=(l=n.trigger.filter)===null||l===void 0?void 0:l.include)===null||c===void 0?void 0:c.contains(Wt.QuickFix)))){const g=yield TE(this._registry,e,n.selection,n.trigger,Gg.None,a);if(a.isCancellationRequested)return zye;if(!((u=g.validActions)===null||u===void 0?void 0:u.some(v=>v.action.kind?Wt.QuickFix.contains(new Wt(v.action.kind)):!1))){const v=this._markerService.read({resource:e.uri});if(v.length>0){const m=n.selection.getPosition();let _=m,y=Number.MAX_VALUE,w=!1;for(const L of v){const D=L.endColumn,E=L.endLineNumber,I=L.startLineNumber;(E===m.lineNumber||I===m.lineNumber)&&Math.abs(m.column-D){k.highlightRange=k.action.isPreferred}),I.push(...E.validActions)),{validActions:I,allActions:g.allActions,documentation:g.documentation,hasAutoFix:g.hasAutoFix,dispose:()=>{g.dispose()}}}}}}return TE(this._registry,e,n.selection,n.trigger,Gg.None,a)}));n.trigger.type===1&&((o=this._progressService)===null||o===void 0||o.showWhile(s,250)),this.setState(new q_.Triggered(n.trigger,r,s))},void 0),this._codeActionOracle.value.trigger({type:2,triggerAction:fl.Default})}else this._supportedCodeActions.reset()}trigger(e){var t;(t=this._codeActionOracle.value)===null||t===void 0||t.trigger(e)}setState(e,t){e!==this._state&&(this._state.type===1&&this._state.cancel(),this._state=e,!t&&!this._disposed&&this._onDidChangeState.fire(e))}}var p0t=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},eg=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},qx=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},xM;const m0t="quickfix-edit-highlight";let Mv=xM=class extends _e{static get(e){return e.getContribution(xM.ID)}constructor(e,t,n,o,r,s,a,l,c,u){super(),this._commandService=a,this._configurationService=l,this._actionWidgetService=c,this._instantiationService=u,this._activeCodeActions=this._register(new Kr),this._showDisabled=!1,this._disposed=!1,this._editor=e,this._model=this._register(new g0t(this._editor,r.codeActionProvider,t,n,s,l)),this._register(this._model.onDidChangeState(d=>this.update(d))),this._lightBulbWidget=new ah(()=>{const d=this._editor.getContribution(hb.ID);return d&&this._register(d.onClick(h=>this.showCodeActionList(h.actions,h,{includeDisabledActions:!1,fromLightbulb:!0}))),d}),this._resolver=o.createInstance(cO),this._register(this._editor.onDidLayoutChange(()=>this._actionWidgetService.hide()))}dispose(){this._disposed=!0,super.dispose()}showCodeActions(e,t,n){return this.showCodeActionList(t,n,{includeDisabledActions:!1,fromLightbulb:!1})}manualTriggerAtCurrentPosition(e,t,n,o){var r;if(!this._editor.hasModel())return;(r=cl.get(this._editor))===null||r===void 0||r.closeMessage();const s=this._editor.getPosition();this._trigger({type:1,triggerAction:t,filter:n,autoApply:o,context:{notAvailableMessage:e,position:s}})}_trigger(e){return this._model.trigger(e)}_applyCodeAction(e,t,n){return qx(this,void 0,void 0,function*(){try{yield this._instantiationService.invokeFunction(X_t,e,lO.FromCodeActions,{preview:n,editor:this._editor})}finally{t&&this._trigger({type:2,triggerAction:fl.QuickFix,filter:{}})}})}update(e){var t,n,o,r,s,a,l;return qx(this,void 0,void 0,function*(){if(e.type!==1){(t=this._lightBulbWidget.rawValue)===null||t===void 0||t.hide();return}let c;try{c=yield e.actions}catch(u){en(u);return}if(!this._disposed)if((n=this._lightBulbWidget.value)===null||n===void 0||n.update(c,e.trigger,e.position),e.trigger.type===1){if(!((o=e.trigger.filter)===null||o===void 0)&&o.include){const d=this.tryGetValidActionToApply(e.trigger,c);if(d){try{(r=this._lightBulbWidget.value)===null||r===void 0||r.hide(),yield this._applyCodeAction(d,!1,!1)}finally{c.dispose()}return}if(e.trigger.context){const h=this.getInvalidActionThatWouldHaveBeenApplied(e.trigger,c);if(h&&h.action.disabled){(s=cl.get(this._editor))===null||s===void 0||s.showMessage(h.action.disabled,e.trigger.context.position),c.dispose();return}}}const u=!!(!((a=e.trigger.filter)===null||a===void 0)&&a.include);if(e.trigger.context&&(!c.allActions.length||!u&&!c.validActions.length)){(l=cl.get(this._editor))===null||l===void 0||l.showMessage(e.trigger.context.notAvailableMessage,e.trigger.context.position),this._activeCodeActions.value=c,c.dispose();return}this._activeCodeActions.value=c,this.showCodeActionList(c,this.toCoords(e.position),{includeDisabledActions:u,fromLightbulb:!1})}else this._actionWidgetService.isVisible?c.dispose():this._activeCodeActions.value=c})}getInvalidActionThatWouldHaveBeenApplied(e,t){if(!!t.allActions.length&&(e.autoApply==="first"&&t.validActions.length===0||e.autoApply==="ifSingle"&&t.allActions.length===1))return t.allActions.find(({action:n})=>n.disabled)}tryGetValidActionToApply(e,t){if(!!t.validActions.length&&(e.autoApply==="first"&&t.validActions.length>0||e.autoApply==="ifSingle"&&t.validActions.length===1))return t.validActions[0]}showCodeActionList(e,t,n){return qx(this,void 0,void 0,function*(){const o=this._editor.createDecorationsCollection(),r=this._editor.getDomNode();if(!r)return;const s=n.includeDisabledActions&&(this._showDisabled||e.validActions.length===0)?e.allActions:e.validActions;if(!s.length)return;const a=ae.isIPosition(t)?this.toCoords(t):t,l={onSelect:(c,u)=>qx(this,void 0,void 0,function*(){this._applyCodeAction(c,!0,!!u),this._actionWidgetService.hide(),o.clear()}),onHide:()=>{var c;(c=this._editor)===null||c===void 0||c.focus(),o.clear()},onHover:(c,u)=>qx(this,void 0,void 0,function*(){var d;if(yield c.resolve(u),!u.isCancellationRequested)return{canPreview:!!(!((d=c.action.edit)===null||d===void 0)&&d.edits.length)}}),onFocus:c=>{var u,d;if(c&&c.highlightRange&&c.action.diagnostics){const h=[{range:c.action.diagnostics[0],options:xM.DECORATION}];o.set(h);const f=c.action.diagnostics[0],g=(d=(u=this._editor.getModel())===null||u===void 0?void 0:u.getWordAtPosition({lineNumber:f.startLineNumber,column:f.startColumn}))===null||d===void 0?void 0:d.word;Ev(C("editingNewSelection","Context: {0} at line {1} and column {2}.",g,f.startLineNumber,f.startColumn))}else o.clear()}};this._actionWidgetService.show("codeActionWidget",!0,e0t(s,this._shouldShowHeaders(),this._resolver.getResolver()),l,a,r,this._getActionBarActions(e,t,n))})}toCoords(e){if(!this._editor.hasModel())return{x:0,y:0};this._editor.revealPosition(e,1),this._editor.render();const t=this._editor.getScrolledVisiblePosition(e),n=Yo(this._editor.getDomNode()),o=n.left+t.left,r=n.top+t.top+t.height;return{x:o,y:r}}_shouldShowHeaders(){var e;const t=(e=this._editor)===null||e===void 0?void 0:e.getModel();return this._configurationService.getValue("editor.codeActionWidget.showHeaders",{resource:t==null?void 0:t.uri})}_getActionBarActions(e,t,n){if(n.fromLightbulb)return[];const o=e.documentation.map(r=>{var s;return{id:r.id,label:r.title,tooltip:(s=r.tooltip)!==null&&s!==void 0?s:"",class:void 0,enabled:!0,run:()=>{var a;return this._commandService.executeCommand(r.id,...(a=r.arguments)!==null&&a!==void 0?a:[])}}});return n.includeDisabledActions&&e.validActions.length>0&&e.allActions.length!==e.validActions.length&&o.push(this._showDisabled?{id:"hideMoreActions",label:C("hideMoreActions","Hide Disabled"),enabled:!0,tooltip:"",class:void 0,run:()=>(this._showDisabled=!1,this.showCodeActionList(e,t,n))}:{id:"showMoreActions",label:C("showMoreActions","Show Disabled"),enabled:!0,tooltip:"",class:void 0,run:()=>(this._showDisabled=!0,this.showCodeActionList(e,t,n))}),o}};Mv.ID="editor.contrib.codeActionController";Mv.DECORATION=Jt.register({description:"quickfix-highlight",className:m0t});Mv=xM=p0t([eg(1,Rf),eg(2,Ut),eg(3,$t),eg(4,pt),eg(5,Jv),eg(6,_o),eg(7,En),eg(8,Yb),eg(9,$t)],Mv);ju((i,e)=>{((o,r)=>{r&&e.addRule(`.monaco-editor ${o} { background-color: ${r}; }`)})(".quickfix-edit-highlight",i.getColor(Jh));const n=i.getColor(xm);n&&e.addRule(`.monaco-editor .quickfix-edit-highlight { border: 1px ${Hd(i.type)?"dotted":"solid"} ${n}; box-sizing: border-box; }`)});function mT(i){return Me.regex($ye.keys()[0],new RegExp("(\\s|^)"+Xl(i.value)+"\\b"))}const aY={type:"object",defaultSnippets:[{body:{kind:""}}],properties:{kind:{type:"string",description:C("args.schema.kind","Kind of the code action to run.")},apply:{type:"string",description:C("args.schema.apply","Controls when the returned actions are applied."),default:"ifSingle",enum:["first","ifSingle","never"],enumDescriptions:[C("args.schema.apply.first","Always apply the first returned code action."),C("args.schema.apply.ifSingle","Apply the first returned code action if it is the only one."),C("args.schema.apply.never","Do not apply the returned code actions.")]},preferred:{type:"boolean",default:!1,description:C("args.schema.preferred","Controls if only preferred code actions should be returned.")}}};function Zb(i,e,t,n,o=fl.Default){if(i.hasModel()){const r=Mv.get(i);r==null||r.manualTriggerAtCurrentPosition(e,o,t,n)}}class v0t extends ft{constructor(){super({id:oY,label:C("quickfix.trigger.label","Quick Fix..."),alias:"Quick Fix...",precondition:Me.and(Q.writable,Q.hasCodeActionsProvider),kbOpts:{kbExpr:Q.textInputFocus,primary:2137,weight:100}})}run(e,t){return Zb(t,C("editor.action.quickFix.noneMessage","No code actions available"),void 0,void 0,fl.QuickFix)}}class _0t extends Ir{constructor(){super({id:Nye,precondition:Me.and(Q.writable,Q.hasCodeActionsProvider),description:{description:"Trigger a code action",args:[{name:"args",schema:aY}]}})}runEditorCommand(e,t,n){const o=Hh.fromUser(n,{kind:Wt.Empty,apply:"ifSingle"});return Zb(t,typeof(n==null?void 0:n.kind)=="string"?o.preferred?C("editor.action.codeAction.noneMessage.preferred.kind","No preferred code actions for '{0}' available",n.kind):C("editor.action.codeAction.noneMessage.kind","No code actions for '{0}' available",n.kind):o.preferred?C("editor.action.codeAction.noneMessage.preferred","No preferred code actions available"):C("editor.action.codeAction.noneMessage","No code actions available"),{include:o.kind,includeSourceActions:!0,onlyIncludePreferredActions:o.preferred},o.apply)}}class b0t extends ft{constructor(){super({id:Mye,label:C("refactor.label","Refactor..."),alias:"Refactor...",precondition:Me.and(Q.writable,Q.hasCodeActionsProvider),kbOpts:{kbExpr:Q.textInputFocus,primary:3120,mac:{primary:1328},weight:100},contextMenuOpts:{group:"1_modification",order:2,when:Me.and(Q.writable,mT(Wt.Refactor))},description:{description:"Refactor...",args:[{name:"args",schema:aY}]}})}run(e,t,n){const o=Hh.fromUser(n,{kind:Wt.Refactor,apply:"never"});return Zb(t,typeof(n==null?void 0:n.kind)=="string"?o.preferred?C("editor.action.refactor.noneMessage.preferred.kind","No preferred refactorings for '{0}' available",n.kind):C("editor.action.refactor.noneMessage.kind","No refactorings for '{0}' available",n.kind):o.preferred?C("editor.action.refactor.noneMessage.preferred","No preferred refactorings available"):C("editor.action.refactor.noneMessage","No refactorings available"),{include:Wt.Refactor.contains(o.kind)?o.kind:Wt.None,onlyIncludePreferredActions:o.preferred},o.apply,fl.Refactor)}}class C0t extends ft{constructor(){super({id:Aye,label:C("source.label","Source Action..."),alias:"Source Action...",precondition:Me.and(Q.writable,Q.hasCodeActionsProvider),contextMenuOpts:{group:"1_modification",order:2.1,when:Me.and(Q.writable,mT(Wt.Source))},description:{description:"Source Action...",args:[{name:"args",schema:aY}]}})}run(e,t,n){const o=Hh.fromUser(n,{kind:Wt.Source,apply:"never"});return Zb(t,typeof(n==null?void 0:n.kind)=="string"?o.preferred?C("editor.action.source.noneMessage.preferred.kind","No preferred source actions for '{0}' available",n.kind):C("editor.action.source.noneMessage.kind","No source actions for '{0}' available",n.kind):o.preferred?C("editor.action.source.noneMessage.preferred","No preferred source actions available"):C("editor.action.source.noneMessage","No source actions available"),{include:Wt.Source.contains(o.kind)?o.kind:Wt.None,includeSourceActions:!0,onlyIncludePreferredActions:o.preferred},o.apply,fl.SourceAction)}}class y0t extends ft{constructor(){super({id:rY,label:C("organizeImports.label","Organize Imports"),alias:"Organize Imports",precondition:Me.and(Q.writable,mT(Wt.SourceOrganizeImports)),kbOpts:{kbExpr:Q.textInputFocus,primary:1581,weight:100}})}run(e,t){return Zb(t,C("editor.action.organize.noneMessage","No organize imports action available"),{include:Wt.SourceOrganizeImports,includeSourceActions:!0},"ifSingle",fl.OrganizeImports)}}class w0t extends ft{constructor(){super({id:sY,label:C("fixAll.label","Fix All"),alias:"Fix All",precondition:Me.and(Q.writable,mT(Wt.SourceFixAll))})}run(e,t){return Zb(t,C("fixAll.noneMessage","No fix all action available"),{include:Wt.SourceFixAll,includeSourceActions:!0},"ifSingle",fl.FixAll)}}class S0t extends ft{constructor(){super({id:Rye,label:C("autoFix.label","Auto Fix..."),alias:"Auto Fix...",precondition:Me.and(Q.writable,mT(Wt.QuickFix)),kbOpts:{kbExpr:Q.textInputFocus,primary:1625,mac:{primary:2649},weight:100}})}run(e,t){return Zb(t,C("editor.action.autoFix.noneMessage","No auto fixes available"),{include:Wt.QuickFix,onlyIncludePreferredActions:!0},"ifSingle",fl.AutoFix)}}zn(Mv.ID,Mv,3);zn(hb.ID,hb,4);ze(v0t);ze(b0t);ze(C0t);ze(y0t);ze(S0t);ze(w0t);Ye(new _0t);no.as(ch.Configuration).registerConfiguration(Object.assign(Object.assign({},k5),{properties:{"editor.codeActionWidget.showHeaders":{type:"boolean",scope:5,description:C("showCodeActionHeaders","Enable/disable showing group headers in the Code Action menu."),default:!0}}}));no.as(ch.Configuration).registerConfiguration(Object.assign(Object.assign({},k5),{properties:{"editor.codeActionWidget.includeNearbyQuickfixes":{type:"boolean",scope:5,description:C("includeNearbyQuickfixes","Enable/disable showing nearest quickfix within a line when not currently on a diagnostic."),default:!1}}}));var Nle=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};class mz{constructor(){this.lenses=[],this._disposables=new Be}dispose(){this._disposables.dispose()}get isDisposed(){return this._disposables.isDisposed}add(e,t){this._disposables.add(e);for(const n of e.lenses)this.lenses.push({symbol:n,provider:t})}}function Uye(i,e,t){return Nle(this,void 0,void 0,function*(){const n=i.ordered(e),o=new Map,r=new mz,s=n.map((a,l)=>Nle(this,void 0,void 0,function*(){o.set(a,l);try{const c=yield Promise.resolve(a.provideCodeLenses(e,t));c&&r.add(c,a)}catch(c){$o(c)}}));return yield Promise.all(s),r.lenses=r.lenses.sort((a,l)=>a.symbol.range.startLineNumberl.symbol.range.startLineNumber?1:o.get(a.provider)o.get(l.provider)?1:a.symbol.range.startColumnl.symbol.range.startColumn?1:0),r})}Rn.registerCommand("_executeCodeLensProvider",function(i,...e){let[t,n]=e;fi(Rt.isUri(t)),fi(typeof n=="number"||!n);const{codeLensProvider:o}=i.get(pt),r=i.get(Yi).getModel(t);if(!r)throw Mc();const s=[],a=new Be;return Uye(o,r,_n.None).then(l=>{a.add(l);const c=[];for(const u of l.lenses)n==null||Boolean(u.symbol.command)?s.push(u.symbol):n-- >0&&u.provider.resolveCodeLens&&c.push(Promise.resolve(u.provider.resolveCodeLens(r,u.symbol,_n.None)).then(d=>s.push(d||u.symbol)));return Promise.all(c)}).then(()=>s).finally(()=>{setTimeout(()=>a.dispose(),100)})});var x0t=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},L0t=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const jye=yn("ICodeLensCache");class Rle{constructor(e,t){this.lineCount=e,this.data=t}}let vz=class{constructor(e){this._fakeProvider=new class{provideCodeLenses(){throw new Error("not supported")}},this._cache=new Yv(20,.75);const t="codelens/cache";Mg(()=>e.remove(t,1));const n="codelens/cache2",o=e.get(n,1,"{}");this._deserialize(o),st.once(e.onWillSaveState)(r=>{r.reason===PP.SHUTDOWN&&e.store(n,this._serialize(),1,1)})}put(e,t){const n=t.lenses.map(s=>{var a;return{range:s.symbol.range,command:s.symbol.command&&{id:"",title:(a=s.symbol.command)===null||a===void 0?void 0:a.title}}}),o=new mz;o.add({lenses:n,dispose:()=>{}},this._fakeProvider);const r=new Rle(e.getLineCount(),o);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,n]of this._cache){const o=new Set;for(const r of n.data.lenses)o.add(r.symbol.range.startLineNumber);e[t]={lineCount:n.lineCount,lines:[...o.values()]}}return JSON.stringify(e)}_deserialize(e){try{const t=JSON.parse(e);for(const n in t){const o=t[n],r=[];for(const a of o.lines)r.push({range:new V(a,1,a,11)});const s=new mz;s.add({lenses:r,dispose(){}},this._fakeProvider),this._cache.set(n,new Rle(o.lineCount,s))}}catch{}}};vz=x0t([L0t(0,Gu)],vz);Mn(jye,vz,1);class E0t{constructor(e,t,n){this.afterColumn=1073741824,this.afterLineNumber=e,this.heightInPx=t,this._onHeight=n,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")}}class lF{constructor(e,t){this.allowEditorOverflow=!1,this.suppressMouseDown=!0,this._commands=new Map,this._isEmpty=!0,this._editor=e,this._id=`codelens.widget-${lF._idPool++}`,this.updatePosition(t),this._domNode=document.createElement("span"),this._domNode.className="codelens-decoration"}withCommands(e,t){this._commands.clear();const n=[];let o=!1;for(let r=0;r{c.symbol.command&&l.push(c.symbol),n.addDecoration({range:c.symbol.range,options:Mle},d=>this._decorationIds[u]=d),a?a=V.plusRange(a,c.symbol.range):a=V.lift(c.symbol.range)}),this._viewZone=new E0t(a.startLineNumber-1,r,s),this._viewZoneId=o.addZone(this._viewZone),l.length>0&&(this._createContentWidgetIfNecessary(),this._contentWidget.withCommands(l,!1))}_createContentWidgetIfNecessary(){this._contentWidget?this._editor.layoutContentWidget(this._contentWidget):(this._contentWidget=new lF(this._editor,this._viewZone.afterLineNumber+1),this._editor.addContentWidget(this._contentWidget))}dispose(e,t){this._decorationIds.forEach(e.removeDecoration,e),this._decorationIds=[],t==null||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 n=this._editor.getModel().getDecorationRange(e),o=this._data[t].symbol;return!!(n&&V.isEmpty(o.range)===n.isEmpty())})}updateCodeLensSymbols(e,t){this._decorationIds.forEach(t.removeDecoration,t),this._decorationIds=[],this._data=e,this._data.forEach((n,o)=>{t.addDecoration({range:n.symbol.range,options:Mle},r=>this._decorationIds[o]=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;t=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Gx=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},Kye=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};let Vw=class{constructor(e,t,n,o,r,s){this._editor=e,this._languageFeaturesService=t,this._commandService=o,this._notificationService=r,this._codeLensCache=s,this._disposables=new Be,this._localToDispose=new Be,this._lenses=[],this._oldCodeLensModels=new Be,this._provideCodeLensDebounce=n.for(t.codeLensProvider,"CodeLensProvide",{min:250}),this._resolveCodeLensesDebounce=n.for(t.codeLensProvider,"CodeLensResolve",{min:250,salt:"resolve"}),this._resolveCodeLensesScheduler=new bi(()=>this._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(50)||a.hasChanged(19)||a.hasChanged(18))&&this._updateLensStyle(),a.hasChanged(17)&&this._onModelChange()})),this._disposables.add(t.codeLensProvider.onDidChange(this._onModelChange,this)),this._onModelChange(),this._updateLensStyle()}dispose(){var e;this._localDispose(),this._disposables.dispose(),this._oldCodeLensModels.dispose(),(e=this._currentCodeLensModel)===null||e===void 0||e.dispose()}_getLayoutInfo(){const e=Math.max(1.3,this._editor.getOption(66)/this._editor.getOption(52));let t=this._editor.getOption(19);return(!t||t<5)&&(t=this._editor.getOption(52)*.9|0),{fontSize:t,codeLensHeight:t*e|0}}_updateLensStyle(){const{codeLensHeight:e,fontSize:t}=this._getLayoutInfo(),n=this._editor.getOption(18),o=this._editor.getOption(50),{style:r}=this._editor.getContainerDomNode();r.setProperty("--vscode-editorCodeLens-lineHeight",`${e}px`),r.setProperty("--vscode-editorCodeLens-fontSize",`${t}px`),r.setProperty("--vscode-editorCodeLens-fontFeatureSettings",o.fontFeatureSettings),n&&(r.setProperty("--vscode-editorCodeLens-fontFamily",n),r.setProperty("--vscode-editorCodeLens-fontFamilyDefault",al.fontFamily)),this._editor.changeViewZones(s=>{for(const a of this._lenses)a.updateHeight(e,s)})}_localDispose(){var e,t,n;(e=this._getCodeLensModelPromise)===null||e===void 0||e.cancel(),this._getCodeLensModelPromise=void 0,(t=this._resolveCodeLensesPromise)===null||t===void 0||t.cancel(),this._resolveCodeLensesPromise=void 0,this._localToDispose.clear(),this._oldCodeLensModels.clear(),(n=this._currentCodeLensModel)===null||n===void 0||n.dispose()}_onModelChange(){this._localDispose();const e=this._editor.getModel();if(!e||!this._editor.getOption(17)||e.isTooLargeForTokenization())return;const t=this._codeLensCache.get(e);if(t&&this._renderCodeLensSymbols(t),!this._languageFeaturesService.codeLensProvider.has(e)){t&&this._localToDispose.add(Sv(()=>{const o=this._codeLensCache.get(e);t===o&&(this._codeLensCache.delete(e),this._onModelChange())},30*1e3));return}for(const o of this._languageFeaturesService.codeLensProvider.all(e))if(typeof o.onDidChange=="function"){const r=o.onDidChange(()=>n.schedule());this._localToDispose.add(r)}const n=new bi(()=>{var o;const r=Date.now();(o=this._getCodeLensModelPromise)===null||o===void 0||o.cancel(),this._getCodeLensModelPromise=sr(s=>Uye(this._languageFeaturesService.codeLensProvider,e,s)),this._getCodeLensModelPromise.then(s=>{this._currentCodeLensModel&&this._oldCodeLensModels.add(this._currentCodeLensModel),this._currentCodeLensModel=s,this._codeLensCache.put(e,s);const a=this._provideCodeLensDebounce.update(e,Date.now()-r);n.delay=a,this._renderCodeLensSymbols(s),this._resolveCodeLensesInViewportSoon()},en)},this._provideCodeLensDebounce.get(e));this._localToDispose.add(n),this._localToDispose.add(zt(()=>this._resolveCodeLensesScheduler.cancel())),this._localToDispose.add(this._editor.onDidChangeModelContent(()=>{var o;this._editor.changeDecorations(r=>{this._editor.changeViewZones(s=>{const a=[];let l=-1;this._lenses.forEach(u=>{!u.isValid()||l===u.getLineNumber()?a.push(u):(u.update(s),l=u.getLineNumber())});const c=new J9;a.forEach(u=>{u.dispose(c,s),this._lenses.splice(this._lenses.indexOf(u),1)}),c.commit(r)})}),n.schedule(),this._resolveCodeLensesScheduler.cancel(),(o=this._resolveCodeLensesPromise)===null||o===void 0||o.cancel(),this._resolveCodeLensesPromise=void 0})),this._localToDispose.add(this._editor.onDidFocusEditorWidget(()=>{n.schedule()})),this._localToDispose.add(this._editor.onDidBlurEditorText(()=>{n.cancel()})),this._localToDispose.add(this._editor.onDidScrollChange(o=>{o.scrollTopChanged&&this._lenses.length>0&&this._resolveCodeLensesInViewportSoon()})),this._localToDispose.add(this._editor.onDidLayoutChange(()=>{this._resolveCodeLensesInViewportSoon()})),this._localToDispose.add(zt(()=>{if(this._editor.getModel()){const o=Zd.capture(this._editor);this._editor.changeDecorations(r=>{this._editor.changeViewZones(s=>{this._disposeAllLenses(r,s)})}),o.restore(this._editor)}else this._disposeAllLenses(void 0,void 0)})),this._localToDispose.add(this._editor.onMouseDown(o=>{if(o.target.type!==9)return;let r=o.target.element;if((r==null?void 0:r.tagName)==="SPAN"&&(r=r.parentElement),(r==null?void 0:r.tagName)==="A")for(const s of this._lenses){const a=s.getCommand(r);if(a){this._commandService.executeCommand(a.id,...a.arguments||[]).catch(l=>this._notificationService.error(l));break}}})),n.schedule()}_disposeAllLenses(e,t){const n=new J9;for(const o of this._lenses)o.dispose(n,t);e&&n.commit(e),this._lenses.length=0}_renderCodeLensSymbols(e){if(!this._editor.hasModel())return;const t=this._editor.getModel().getLineCount(),n=[];let o;for(const a of e.lenses){const l=a.symbol.range.startLineNumber;l<1||l>t||(o&&o[o.length-1].symbol.range.startLineNumber===l?o.push(a):(o=[a],n.push(o)))}if(!n.length&&!this._lenses.length)return;const r=Zd.capture(this._editor),s=this._getLayoutInfo();this._editor.changeDecorations(a=>{this._editor.changeViewZones(l=>{const c=new J9;let u=0,d=0;for(;dthis._resolveCodeLensesInViewportSoon())),u++,d++)}for(;uthis._resolveCodeLensesInViewportSoon())),d++;c.commit(a)})}),r.restore(this._editor)}_resolveCodeLensesInViewportSoon(){this._editor.getModel()&&this._resolveCodeLensesScheduler.schedule()}_resolveCodeLensesInViewport(){var e;(e=this._resolveCodeLensesPromise)===null||e===void 0||e.cancel(),this._resolveCodeLensesPromise=void 0;const t=this._editor.getModel();if(!t)return;const n=[],o=[];if(this._lenses.forEach(a=>{const l=a.computeIfNecessary(t);l&&(n.push(l),o.push(a))}),n.length===0)return;const r=Date.now(),s=sr(a=>{const l=n.map((c,u)=>{const d=new Array(c.length),h=c.map((f,g)=>!f.symbol.command&&typeof f.provider.resolveCodeLens=="function"?Promise.resolve(f.provider.resolveCodeLens(t,f.symbol,a)).then(p=>{d[g]=p},$o):(d[g]=f.symbol,Promise.resolve(void 0)));return Promise.all(h).then(()=>{!a.isCancellationRequested&&!o[u].isDisposed()&&o[u].updateCommands(d)})});return Promise.all(l)});this._resolveCodeLensesPromise=s,this._resolveCodeLensesPromise.then(()=>{const a=this._resolveCodeLensesDebounce.update(t,Date.now()-r);this._resolveCodeLensesScheduler.delay=a,this._currentCodeLensModel&&this._codeLensCache.put(t,this._currentCodeLensModel),this._oldCodeLensModels.clear(),s===this._resolveCodeLensesPromise&&(this._resolveCodeLensesPromise=void 0)},a=>{en(a),s===this._resolveCodeLensesPromise&&(this._resolveCodeLensesPromise=void 0)})}getModel(){var e;return Kye(this,void 0,void 0,function*(){return yield this._getCodeLensModelPromise,yield this._resolveCodeLensesPromise,!((e=this._currentCodeLensModel)===null||e===void 0)&&e.isDisposed?void 0:this._currentCodeLensModel})}};Vw.ID="css.editor.codeLens";Vw=D0t([Gx(1,pt),Gx(2,qc),Gx(3,_o),Gx(4,Ao),Gx(5,jye)],Vw);zn(Vw.ID,Vw,1);ze(class extends ft{constructor(){super({id:"codelens.showLensesInCurrentLine",precondition:Q.hasCodeLensProvider,label:C("showLensOnLine","Show CodeLens Commands For Current Line"),alias:"Show CodeLens Commands For Current Line"})}run(e,t){return Kye(this,void 0,void 0,function*(){if(!t.hasModel())return;const n=e.get(uh),o=e.get(_o),r=e.get(Ao),s=t.getSelection().positionLineNumber,a=t.getContribution(Vw.ID);if(!a)return;const l=yield a.getModel();if(!l)return;const c=[];for(const h of l.lenses)h.symbol.command&&h.symbol.range.startLineNumber===s&&c.push({label:h.symbol.command.title,command:h.symbol.command});if(c.length===0)return;const u=yield n.pick(c,{canPickMany:!1,placeHolder:C("placeHolder","Select a command")});if(!u)return;let d=u.command;if(l.isDisposed){const h=yield a.getModel(),f=h==null?void 0:h.lenses.find(g=>{var p;return g.symbol.range.startLineNumber===s&&((p=g.symbol.command)===null||p===void 0?void 0:p.title)===d.title});if(!f||!f.symbol.command)return;d=f.symbol.command}try{yield o.executeCommand(d.id,...d.arguments||[])}catch(h){r.error(h)}})}});var k0t=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},e7=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},I0t=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};class lY{constructor(e,t){this._editorWorkerClient=new gG(e,!1,"editorWorkerService",t)}provideDocumentColors(e,t){return I0t(this,void 0,void 0,function*(){return this._editorWorkerClient.computeDefaultDocumentColors(e.uri)})}provideColorPresentations(e,t,n){const o=t.range,r=t.color,s=r.alpha,a=new ve(new Tn(Math.round(255*r.red),Math.round(255*r.green),Math.round(255*r.blue),s)),l=s?ve.Format.CSS.formatRGB(a):ve.Format.CSS.formatRGBA(a),c=s?ve.Format.CSS.formatHSL(a):ve.Format.CSS.formatHSLA(a),u=s?ve.Format.CSS.formatHex(a):ve.Format.CSS.formatHexA(a),d=[];return d.push({label:l,textEdit:{range:o,text:l}}),d.push({label:c,textEdit:{range:o,text:c}}),d.push({label:u,textEdit:{range:o,text:u}}),d}}let _z=class extends _e{constructor(e,t,n){super(),this._register(n.colorProvider.register("*",new lY(e,t)))}};_z=k0t([e7(0,Yi),e7(1,Ti),e7(2,pt)],_z);G5(_z);var vT=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};function qye(i,e,t,n=!0){return vT(this,void 0,void 0,function*(){return cY(new T0t,i,e,t,n)})}function Gye(i,e,t,n){return Promise.resolve(t.provideColorPresentations(i,e,n))}class T0t{constructor(){}compute(e,t,n,o){return vT(this,void 0,void 0,function*(){const r=yield e.provideDocumentColors(t,n);if(Array.isArray(r))for(const s of r)o.push({colorInfo:s,provider:e});return Array.isArray(r)})}}class N0t{constructor(){}compute(e,t,n,o){return vT(this,void 0,void 0,function*(){const r=yield e.provideDocumentColors(t,n);if(Array.isArray(r))for(const s of r)o.push({range:s.range,color:[s.color.red,s.color.green,s.color.blue,s.color.alpha]});return Array.isArray(r)})}}class R0t{constructor(e){this.colorInfo=e}compute(e,t,n,o){return vT(this,void 0,void 0,function*(){const r=yield e.provideColorPresentations(t,this.colorInfo,_n.None);return Array.isArray(r)&&o.push(...r),Array.isArray(r)})}}function cY(i,e,t,n,o){return vT(this,void 0,void 0,function*(){let r=!1,s;const a=[],l=e.ordered(t);for(let c=l.length-1;c>=0;c--){const u=l[c];if(u instanceof lY)s=u;else try{(yield i.compute(u,t,n,a))&&(r=!0)}catch(d){$o(d)}}return r?a:s&&o?(yield i.compute(s,t,n,a),a):[]})}function Xye(i,e){const{colorProvider:t}=i.get(pt),n=i.get(Yi).getModel(e);if(!n)throw Mc();const o=i.get(En).getValue("editor.defaultColorDecorators",{resource:e});return{model:n,colorProviderRegistry:t,isDefaultColorDecoratorsEnabled:o}}Rn.registerCommand("_executeDocumentColorProvider",function(i,...e){const[t]=e;if(!(t instanceof Rt))throw Mc();const{model:n,colorProviderRegistry:o,isDefaultColorDecoratorsEnabled:r}=Xye(i,t);return cY(new N0t,o,n,_n.None,r)});Rn.registerCommand("_executeColorPresentationProvider",function(i,...e){const[t,n]=e,{uri:o,range:r}=n;if(!(o instanceof Rt)||!Array.isArray(t)||t.length!==4||!V.isIRange(r))throw Mc();const{model:s,colorProviderRegistry:a,isDefaultColorDecoratorsEnabled:l}=Xye(i,o),[c,u,d,h]=t;return cY(new R0t({range:r,color:{red:c,green:u,blue:d,alpha:h}}),a,s,_n.None,l)});var M0t=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},t7=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},Ple=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},bz;const Yye=Object.create({});let Av=bz=class extends _e{constructor(e,t,n,o){super(),this._editor=e,this._configurationService=t,this._languageFeaturesService=n,this._localToDispose=this._register(new Be),this._decorationsIds=[],this._colorDatas=new Map,this._colorDecoratorIds=this._editor.createDecorationsCollection(),this._ruleFactory=new qI(this._editor),this._decoratorLimitReporter=new A0t,this._colorDecorationClassRefs=this._register(new Be),this._debounceInformation=o.for(n.colorProvider,"Document Colors",{min:bz.RECOMPUTE_TIME}),this._register(e.onDidChangeModel(()=>{this._isColorDecoratorsEnabled=this.isEnabled(),this.updateColors()})),this._register(e.onDidChangeModelLanguage(()=>this.updateColors())),this._register(n.colorProvider.onDidChange(()=>this.updateColors())),this._register(e.onDidChangeConfiguration(r=>{const s=this._isColorDecoratorsEnabled;this._isColorDecoratorsEnabled=this.isEnabled(),this._isDefaultColorDecoratorsEnabled=this._editor.getOption(145);const a=s!==this._isColorDecoratorsEnabled||r.hasChanged(21),l=r.hasChanged(145);(a||l)&&(this._isColorDecoratorsEnabled?this.updateColors():this.removeAllDecorations())})),this._timeoutTimer=null,this._computePromise=null,this._isColorDecoratorsEnabled=this.isEnabled(),this._isDefaultColorDecoratorsEnabled=this._editor.getOption(145),this.updateColors()}isEnabled(){const e=this._editor.getModel();if(!e)return!1;const t=e.getLanguageId(),n=this._configurationService.getValue(t);if(n&&typeof n=="object"){const o=n.colorDecorators;if(o&&o.enable!==void 0&&!o.enable)return o.enable}return this._editor.getOption(20)}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 zu,this._timeoutTimer.cancelAndSet(()=>{this._timeoutTimer=null,this.beginCompute()},this._debounceInformation.get(e)))})),this.beginCompute())}beginCompute(){return Ple(this,void 0,void 0,function*(){this._computePromise=sr(e=>Ple(this,void 0,void 0,function*(){const t=this._editor.getModel();if(!t)return[];const n=new Ls(!1),o=yield qye(this._languageFeaturesService.colorProvider,t,e,this._isDefaultColorDecoratorsEnabled);return this._debounceInformation.update(t,n.elapsed()),o}));try{const e=yield this._computePromise;this.updateDecorations(e),this.updateColorDecorators(e),this._computePromise=null}catch(e){en(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(n=>({range:{startLineNumber:n.colorInfo.range.startLineNumber,startColumn:n.colorInfo.range.startColumn,endLineNumber:n.colorInfo.range.endLineNumber,endColumn:n.colorInfo.range.endColumn},options:Jt.EMPTY}));this._editor.changeDecorations(n=>{this._decorationsIds=n.deltaDecorations(this._decorationsIds,t),this._colorDatas=new Map,this._decorationsIds.forEach((o,r)=>this._colorDatas.set(o,e[r]))})}updateColorDecorators(e){this._colorDecorationClassRefs.clear();const t=[],n=this._editor.getOption(21);for(let r=0;rthis._colorDatas.has(o.id));return n.length===0?null:this._colorDatas.get(n[0].id)}isColorDecoration(e){return this._colorDecoratorIds.has(e)}};Av.ID="editor.contrib.colorDetector";Av.RECOMPUTE_TIME=1e3;Av=bz=M0t([t7(1,En),t7(2,pt),t7(3,qc)],Av);class A0t{constructor(){this._onDidChange=new le,this._computed=0,this._limited=!1}update(e,t){(e!==this._computed||t!==this._limited)&&(this._computed=e,this._limited=t,this._onDidChange.fire())}}zn(Av.ID,Av,1);class P0t{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,n){this.presentationIndex=n,this._onColorFlushed=new le,this.onColorFlushed=this._onColorFlushed.event,this._onDidChangeColor=new le,this.onDidChangeColor=this._onDidChangeColor.event,this._onDidChangePresentation=new le,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 n=-1;for(let o=0;o{this.backgroundColor=s.getColor(sP)||ve.white})),this._register(ke(this._pickedColorNode,et.CLICK,()=>this.model.selectNextColorPresentation())),this._register(ke(this._originalColorNode,et.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=ve.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 F0t(this._domNode)))}get closeButton(){return this._closeButton}get pickedColorNode(){return this._pickedColorNode}get originalColorNode(){return this._originalColorNode}onDidChangeColor(e){this._pickedColorNode.style.backgroundColor=ve.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 F0t extends _e{constructor(e){super(),this._onClicked=this._register(new le),this.onClicked=this._onClicked.event,this._button=document.createElement("div"),this._button.classList.add("close-button"),Ae(e,this._button);const t=document.createElement("div");t.classList.add("close-button-inner-div"),Ae(this._button,t),Ae(t,Bl(".button"+Mt.asCSSSelector(Eo("color-picker-close",Xe.close,C("closeIcon","Icon to close the color picker"))))).classList.add("close-icon"),this._button.onclick=()=>{this._onClicked.fire()}}}class B0t extends _e{constructor(e,t,n,o=!1){super(),this.model=t,this.pixelRatio=n,this._insertButton=null,this._domNode=Bl(".colorpicker-body"),Ae(e,this._domNode),this._saturationBox=new W0t(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 V0t(this._domNode,this.model,o),this._register(this._opacityStrip),this._register(this._opacityStrip.onDidChange(this.onDidOpacityChange,this)),this._register(this._opacityStrip.onColorFlushed(this.flushColor,this)),this._hueStrip=new H0t(this._domNode,this.model,o),this._register(this._hueStrip),this._register(this._hueStrip.onDidChange(this.onDidHueChange,this)),this._register(this._hueStrip.onColorFlushed(this.flushColor,this)),o&&(this._insertButton=this._register(new $0t(this._domNode)),this._domNode.classList.add("standalone-colorpicker"))}flushColor(){this.model.flushColor()}onDidSaturationValueChange({s:e,v:t}){const n=this.model.color.hsva;this.model.color=new ve(new qh(n.h,e,t,n.a))}onDidOpacityChange(e){const t=this.model.color.hsva;this.model.color=new ve(new qh(t.h,t.s,t.v,e))}onDidHueChange(e){const t=this.model.color.hsva,n=(1-e)*360;this.model.color=new ve(new qh(n===360?0:n,t.s,t.v,t.a))}get domNode(){return this._domNode}get saturationBox(){return this._saturationBox}get enterButton(){return this._insertButton}layout(){this._saturationBox.layout(),this._opacityStrip.layout(),this._hueStrip.layout()}}class W0t extends _e{constructor(e,t,n){super(),this.model=t,this.pixelRatio=n,this._onDidChange=new le,this.onDidChange=this._onDidChange.event,this._onColorFlushed=new le,this.onColorFlushed=this._onColorFlushed.event,this._domNode=Bl(".saturation-wrap"),Ae(e,this._domNode),this._canvas=document.createElement("canvas"),this._canvas.className="saturation-box",Ae(this._domNode,this._canvas),this.selection=Bl(".saturation-selection"),Ae(this._domNode,this.selection),this.layout(),this._register(ke(this._domNode,et.POINTER_DOWN,o=>this.onPointerDown(o))),this._register(this.model.onDidChangeColor(this.onDidChangeColor,this)),this.monitor=null}get domNode(){return this._domNode}onPointerDown(e){if(!e.target||!(e.target instanceof Element))return;this.monitor=this._register(new yS);const t=Yo(this._domNode);e.target!==this.selection&&this.onDidChangePosition(e.offsetX,e.offsetY),this.monitor.startMonitoring(e.target,e.pointerId,e.buttons,o=>this.onDidChangePosition(o.pageX-t.left,o.pageY-t.top),()=>null);const n=ke(e.target.ownerDocument,et.POINTER_UP,()=>{this._onColorFlushed.fire(),n.dispose(),this.monitor&&(this.monitor.stopMonitoring(!0),this.monitor=null)},!0)}onDidChangePosition(e,t){const n=Math.max(0,Math.min(1,e/this.width)),o=Math.max(0,Math.min(1,1-t/this.height));this.paintSelection(n,o),this._onDidChange.fire({s:n,v:o})}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 ve(new qh(e.h,1,1,1)),n=this._canvas.getContext("2d"),o=n.createLinearGradient(0,0,this._canvas.width,0);o.addColorStop(0,"rgba(255, 255, 255, 1)"),o.addColorStop(.5,"rgba(255, 255, 255, 0.5)"),o.addColorStop(1,"rgba(255, 255, 255, 0)");const r=n.createLinearGradient(0,0,0,this._canvas.height);r.addColorStop(0,"rgba(0, 0, 0, 0)"),r.addColorStop(1,"rgba(0, 0, 0, 1)"),n.rect(0,0,this._canvas.width,this._canvas.height),n.fillStyle=ve.Format.CSS.format(t),n.fill(),n.fillStyle=o,n.fill(),n.fillStyle=r,n.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 Zye extends _e{constructor(e,t,n=!1){super(),this.model=t,this._onDidChange=new le,this.onDidChange=this._onDidChange.event,this._onColorFlushed=new le,this.onColorFlushed=this._onColorFlushed.event,n?(this.domNode=Ae(e,Bl(".standalone-strip")),this.overlay=Ae(this.domNode,Bl(".standalone-overlay"))):(this.domNode=Ae(e,Bl(".strip")),this.overlay=Ae(this.domNode,Bl(".overlay"))),this.slider=Ae(this.domNode,Bl(".slider")),this.slider.style.top="0px",this._register(ke(this.domNode,et.POINTER_DOWN,o=>this.onPointerDown(o))),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 yS),n=Yo(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-n.top),()=>null);const o=ke(e.target.ownerDocument,et.POINTER_UP,()=>{this._onColorFlushed.fire(),o.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 V0t extends Zye{constructor(e,t,n=!1){super(e,t,n),this.domNode.classList.add("opacity-strip"),this.onDidChangeColor(this.model.color)}onDidChangeColor(e){super.onDidChangeColor(e);const{r:t,g:n,b:o}=e.rgba,r=new ve(new Tn(t,n,o,1)),s=new ve(new Tn(t,n,o,0));this.overlay.style.background=`linear-gradient(to bottom, ${r} 0%, ${s} 100%)`}getValue(e){return e.hsva.a}}class H0t extends Zye{constructor(e,t,n=!1){super(e,t,n),this.domNode.classList.add("hue-strip")}getValue(e){return 1-e.hsva.h/360}}class $0t extends _e{constructor(e){super(),this._onClicked=this._register(new le),this.onClicked=this._onClicked.event,this._button=Ae(e,document.createElement("button")),this._button.classList.add("insert-button"),this._button.textContent="Insert",this._button.onclick=t=>{this._onClicked.fire()}}get button(){return this._button}}class z0t extends Uu{constructor(e,t,n,o,r=!1){super(),this.model=t,this.pixelRatio=n,this._register(MD.onDidChange(()=>this.layout()));const s=Bl(".colorpicker-widget");e.appendChild(s),this.header=this._register(new O0t(s,this.model,o,r)),this.body=this._register(new B0t(s,this.model,this.pixelRatio,r))}layout(){this.body.layout()}}var Qye=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Jye=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},Hw=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};class U0t{constructor(e,t,n,o){this.owner=e,this.range=t,this.model=n,this.provider=o,this.forceShowAtRange=!0}isValidForHoverAnchor(e){return e.type===1&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}let uO=class{constructor(e,t){this._editor=e,this._themeService=t,this.hoverOrdinal=2}computeSync(e,t){return[]}computeAsync(e,t,n){return Wo.fromPromise(this._computeAsync(e,t,n))}_computeAsync(e,t,n){return Hw(this,void 0,void 0,function*(){if(!this._editor.hasModel())return[];const o=Av.get(this._editor);if(!o)return[];for(const r of t){if(!o.isColorDecoration(r))continue;const s=o.getColorData(r.range.getStartPosition());if(s)return[yield ewe(this,this._editor.getModel(),s.colorInfo,s.provider)]}return[]})}renderHoverParts(e,t){return twe(this,this._editor,this._themeService,t,e)}};uO=Qye([Jye(1,vr)],uO);class j0t{constructor(e,t,n,o){this.owner=e,this.range=t,this.model=n,this.provider=o}}let Mk=class{constructor(e,t){this._editor=e,this._themeService=t,this._color=null}createColorHover(e,t,n){return Hw(this,void 0,void 0,function*(){if(!this._editor.hasModel()||!Av.get(this._editor))return null;const r=yield qye(n,this._editor.getModel(),_n.None);let s=null,a=null;for(const d of r){const h=d.colorInfo;V.containsRange(h.range,e.range)&&(s=h,a=d.provider)}const l=s!=null?s:e,c=a!=null?a:t,u=!!s;return{colorHover:yield ewe(this,this._editor.getModel(),l,c),foundInEditor:u}})}updateEditorModel(e){return Hw(this,void 0,void 0,function*(){if(!this._editor.hasModel())return;const t=e.model;let n=new V(e.range.startLineNumber,e.range.startColumn,e.range.endLineNumber,e.range.endColumn);this._color&&(yield LM(this._editor.getModel(),t,this._color,n,e),n=nwe(this._editor,n,t))})}renderHoverParts(e,t){return twe(this,this._editor,this._themeService,t,e)}set color(e){this._color=e}get color(){return this._color}};Mk=Qye([Jye(1,vr)],Mk);function ewe(i,e,t,n){return Hw(this,void 0,void 0,function*(){const o=e.getValueInRange(t.range),{red:r,green:s,blue:a,alpha:l}=t.color,c=new Tn(Math.round(r*255),Math.round(s*255),Math.round(a*255),l),u=new ve(c),d=yield Gye(e,t,n,_n.None),h=new P0t(u,[],0);return h.colorPresentations=d||[],h.guessColorPresentation(u,o),i instanceof uO?new U0t(i,V.lift(t.range),h,n):new j0t(i,V.lift(t.range),h,n)})}function twe(i,e,t,n,o){if(n.length===0||!e.hasModel())return _e.None;if(o.setMinimumDimensions){const h=e.getOption(66)+8;o.setMinimumDimensions(new jn(302,h))}const r=new Be,s=n[0],a=e.getModel(),l=s.model,c=r.add(new z0t(o.fragment,l,e.getOption(141),t,i instanceof Mk));o.setColorPicker(c);let u=!1,d=new V(s.range.startLineNumber,s.range.startColumn,s.range.endLineNumber,s.range.endColumn);if(i instanceof Mk){const h=n[0].model.color;i.color=h,LM(a,l,h,d,s),r.add(l.onColorFlushed(f=>{i.color=f}))}else r.add(l.onColorFlushed(h=>Hw(this,void 0,void 0,function*(){yield LM(a,l,h,d,s),u=!0,d=nwe(e,d,l,o)})));return r.add(l.onDidChangeColor(h=>{LM(a,l,h,d,s)})),r.add(e.onDidChangeModelContent(h=>{u?u=!1:(o.hide(),e.focus())})),r}function nwe(i,e,t,n){let o,r;if(t.presentation.textEdit){o=[t.presentation.textEdit],r=new V(t.presentation.textEdit.range.startLineNumber,t.presentation.textEdit.range.startColumn,t.presentation.textEdit.range.endLineNumber,t.presentation.textEdit.range.endColumn);const s=i.getModel()._setTrackedRange(null,r,3);i.pushUndoStop(),i.executeEdits("colorpicker",o),r=i.getModel()._getTrackedRange(s)||r}else o=[{range:e,text:t.presentation.label,forceMoveMarkers:!1}],r=e.setEndPosition(e.endLineNumber,e.startColumn+t.presentation.label.length),i.pushUndoStop(),i.executeEdits("colorpicker",o);return t.presentation.additionalTextEdits&&(o=[...t.presentation.additionalTextEdits],i.executeEdits("colorpicker",o),n&&n.hide()),i.pushUndoStop(),r}function LM(i,e,t,n,o){return Hw(this,void 0,void 0,function*(){const r=yield Gye(i,{range:n,color:{red:t.rgba.r/255,green:t.rgba.g/255,blue:t.rgba.b/255,alpha:t.rgba.a}},o.provider,_n.None);e.colorPresentations=r||[]})}function Cz(i,e){return!!i[e]}class n7{constructor(e,t){this.target=e.target,this.isLeftClick=e.event.leftButton,this.isMiddleClick=e.event.middleButton,this.isRightClick=e.event.rightButton,this.hasTriggerModifier=Cz(e.event,t.triggerModifier),this.hasSideBySideModifier=Cz(e.event,t.triggerSideBySideModifier),this.isNoneOrSingleMouseDown=e.event.detail<=1}}class Ole{constructor(e,t){this.keyCodeIsTriggerKey=e.keyCode===t.triggerKey,this.keyCodeIsSideBySideKey=e.keyCode===t.triggerSideBySideKey,this.hasTriggerModifier=Cz(e,t.triggerModifier)}}class U2{constructor(e,t,n,o){this.triggerKey=e,this.triggerModifier=t,this.triggerSideBySideKey=n,this.triggerSideBySideModifier=o}equals(e){return this.triggerKey===e.triggerKey&&this.triggerModifier===e.triggerModifier&&this.triggerSideBySideKey===e.triggerSideBySideKey&&this.triggerSideBySideModifier===e.triggerSideBySideModifier}}function Fle(i){return i==="altKey"?Nn?new U2(57,"metaKey",6,"altKey"):new U2(5,"ctrlKey",6,"altKey"):Nn?new U2(6,"altKey",57,"metaKey"):new U2(6,"altKey",5,"ctrlKey")}class cF extends _e{constructor(e,t){var n;super(),this._onMouseMoveOrRelevantKeyDown=this._register(new le),this.onMouseMoveOrRelevantKeyDown=this._onMouseMoveOrRelevantKeyDown.event,this._onExecute=this._register(new le),this.onExecute=this._onExecute.event,this._onCancel=this._register(new le),this.onCancel=this._onCancel.event,this._editor=e,this._extractLineNumberFromMouseEvent=(n=t==null?void 0:t.extractLineNumberFromMouseEvent)!==null&&n!==void 0?n:o=>o.target.position?o.target.position.lineNumber:0,this._opts=Fle(this._editor.getOption(77)),this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._lineNumberOnMouseDown=0,this._register(this._editor.onDidChangeConfiguration(o=>{if(o.hasChanged(77)){const r=Fle(this._editor.getOption(77));if(this._opts.equals(r))return;this._opts=r,this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._lineNumberOnMouseDown=0,this._onCancel.fire()}})),this._register(this._editor.onMouseMove(o=>this._onEditorMouseMove(new n7(o,this._opts)))),this._register(this._editor.onMouseDown(o=>this._onEditorMouseDown(new n7(o,this._opts)))),this._register(this._editor.onMouseUp(o=>this._onEditorMouseUp(new n7(o,this._opts)))),this._register(this._editor.onKeyDown(o=>this._onEditorKeyDown(new Ole(o,this._opts)))),this._register(this._editor.onKeyUp(o=>this._onEditorKeyUp(new Ole(o,this._opts)))),this._register(this._editor.onMouseDrag(()=>this._resetHandler())),this._register(this._editor.onDidChangeCursorSelection(o=>this._onDidChangeCursorSelection(o))),this._register(this._editor.onDidChangeModel(o=>this._resetHandler())),this._register(this._editor.onDidChangeModelContent(()=>this._resetHandler())),this._register(this._editor.onDidScrollChange(o=>{(o.scrollTopChanged||o.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()}}var K0t=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},tg=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let Pv=class extends Iw{constructor(e,t,n,o,r,s,a,l,c,u,d,h,f){super(e,Object.assign(Object.assign({},o.getRawOptions()),{overflowWidgetsDomNode:o.getOverflowWidgetsDomNode()}),n,r,s,a,l,c,u,d,h,f),this._parentEditor=o,this._overwriteOptions=t,super.updateOptions(this._overwriteOptions),this._register(o.onDidChangeConfiguration(g=>this._onParentConfigurationChanged(g)))}getParentEditor(){return this._parentEditor}_onParentConfigurationChanged(e){super.updateOptions(this._parentEditor.getRawOptions()),super.updateOptions(this._overwriteOptions)}updateOptions(e){W4(this._overwriteOptions,e,!0),super.updateOptions(this._overwriteOptions)}};Pv=K0t([tg(4,$t),tg(5,Jn),tg(6,_o),tg(7,Ut),tg(8,vr),tg(9,Ao),tg(10,vp),tg(11,Ti),tg(12,pt)],Pv);const Ble=new ve(new Tn(0,122,204)),q0t={showArrow:!0,showFrame:!0,className:"",frameColor:Ble,arrowColor:Ble,keepEditorSelection:!1},G0t="vs.editor.contrib.zoneWidget";class X0t{constructor(e,t,n,o,r,s,a,l){this.id="",this.domNode=e,this.afterLineNumber=t,this.afterColumn=n,this.heightInLines=o,this.showInHiddenAreas=a,this.ordinal=l,this._onDomNodeTop=r,this._onComputedHeight=s}onDomNodeTop(e){this._onDomNodeTop(e)}onComputedHeight(e){this._onComputedHeight(e)}}class Y0t{constructor(e,t){this._id=e,this._domNode=t}getId(){return this._id}getDomNode(){return this._domNode}getPosition(){return null}}class uF{constructor(e){this._editor=e,this._ruleName=uF._IdGenerator.nextId(),this._decorations=this._editor.createDecorationsCollection(),this._color=null,this._height=-1}dispose(){this.hide(),Ioe(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(){Ioe(this._ruleName),GV(`.monaco-editor ${this._ruleName}`,`border-style: solid; border-color: transparent; border-bottom-color: ${this._color}; border-width: ${this._height}px; bottom: -${this._height}px; margin-left: -${this._height}px; `)}show(e){e.column===1&&(e={lineNumber:e.lineNumber,column:2}),this._decorations.set([{range:V.fromPositions(e),options:{description:"zone-widget-arrow",className:this._ruleName,stickiness:1}}])}hide(){this._decorations.clear()}}uF._IdGenerator=new pX(".arrow-decoration-");class Z0t{constructor(e,t={}){this._arrow=null,this._overlayWidget=null,this._resizeSash=null,this._viewZone=null,this._disposables=new Be,this.container=null,this._isShowing=!1,this.editor=e,this._positionMarkerId=this.editor.createDecorationsCollection(),this.options=fg(t),W4(this.options,q0t,!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(n=>{const o=this._getWidth(n);this.domNode.style.width=o+"px",this.domNode.style.left=this._getLeft(n)+"px",this._onWidth(o)}))}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 uF(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){var t;if(this.domNode.style.height=`${e}px`,this.container){const n=e-this._decoratingElementsHeight();this.container.style.height=`${n}px`;const o=this.editor.getLayoutInfo();this._doLayout(n,this._getWidth(o))}(t=this._resizeSash)===null||t===void 0||t.layout()}get position(){const e=this._positionMarkerId.getRange(0);if(!!e)return e.getStartPosition()}show(e,t){const n=V.isIRange(e)?V.lift(e):V.fromPositions(e);this._isShowing=!0,this._showImpl(n,t),this._isShowing=!1,this._positionMarkerId.set([{range:n,options:Jt.EMPTY}])}hide(){var e;this._viewZone&&(this.editor.changeViewZones(t=>{this._viewZone&&t.removeZone(this._viewZone.id)}),this._viewZone=null),this._overlayWidget&&(this.editor.removeOverlayWidget(this._overlayWidget),this._overlayWidget=null),(e=this._arrow)===null||e===void 0||e.hide(),this._positionMarkerId.clear()}_decoratingElementsHeight(){const e=this.editor.getOption(66);let t=0;if(this.options.showArrow){const n=Math.round(e/3);t+=2*n}if(this.options.showFrame){const n=Math.round(e/9);t+=2*n}return t}_showImpl(e,t){const n=e.getStartPosition(),o=this.editor.getLayoutInfo(),r=this._getWidth(o);this.domNode.style.width=`${r}px`,this.domNode.style.left=this._getLeft(o)+"px";const s=document.createElement("div");s.style.overflow="hidden";const a=this.editor.getOption(66);if(!this.options.allowUnlimitedHeight){const h=Math.max(12,this.editor.getLayoutInfo().height/a*.8);t=Math.min(t,h)}let l=0,c=0;if(this._arrow&&this.options.showArrow&&(l=Math.round(a/3),this._arrow.height=l,this._arrow.show(n)),this.options.showFrame&&(c=Math.round(a/9)),this.editor.changeViewZones(h=>{this._viewZone&&h.removeZone(this._viewZone.id),this._overlayWidget&&(this.editor.removeOverlayWidget(this._overlayWidget),this._overlayWidget=null),this.domNode.style.top="-1000px",this._viewZone=new X0t(s,n.lineNumber,n.column,t,f=>this._onViewZoneTop(f),f=>this._onViewZoneHeight(f),this.options.showInHiddenAreas,this.options.ordinal),this._viewZone.id=h.addZone(this._viewZone),this._overlayWidget=new Y0t(G0t+this._viewZone.id,this.domNode),this.editor.addOverlayWidget(this._overlayWidget)}),this.container&&this.options.showFrame){const h=this.options.frameWidth?this.options.frameWidth:c;this.container.style.borderTopWidth=h+"px",this.container.style.borderBottomWidth=h+"px"}const u=t*a-this._decoratingElementsHeight();this.container&&(this.container.style.top=l+"px",this.container.style.height=u+"px",this.container.style.overflow="hidden"),this._doLayout(u,r),this.options.keepEditorSelection||this.editor.setSelection(e);const d=this.editor.getModel();if(d){const h=d.validateRange(new V(e.startLineNumber,1,e.endLineNumber+1,1));this.revealRange(h,h.startLineNumber===d.getLineCount())}}revealRange(e,t){t?this.editor.revealLineNearTop(e.endLineNumber,0):this.editor.revealRange(e,0)}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 gs(this.domNode,this,{orientation:1})),this.options.isResizeable||(this._resizeSash.state=0);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 n=(t.currentY-e.startY)/this.editor.getOption(66),o=n<0?Math.ceil(n):Math.floor(n),r=e.heightInLines+o;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}}var iwe=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},owe=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const rwe=yn("IPeekViewService");Mn(rwe,class{constructor(){this._widgets=new Map}addExclusiveWidget(i,e){const t=this._widgets.get(i);t&&(t.listener.dispose(),t.widget.dispose());const n=()=>{const o=this._widgets.get(i);o&&o.widget===e&&(o.listener.dispose(),this._widgets.delete(i))};this._widgets.set(i,{widget:e,listener:e.onDidClose(n)})}},1);var Ha;(function(i){i.inPeekEditor=new lt("inReferenceSearchEditor",!0,C("inReferenceSearchEditor","Whether the current code editor is embedded inside peek")),i.notInPeekEditor=i.inPeekEditor.toNegated()})(Ha||(Ha={}));let Ak=class{constructor(e,t){e instanceof Pv&&Ha.inPeekEditor.bindTo(t)}dispose(){}};Ak.ID="editor.contrib.referenceController";Ak=iwe([owe(1,Ut)],Ak);zn(Ak.ID,Ak,0);function Q0t(i){const e=i.get(Jn).getFocusedCodeEditor();return e instanceof Pv?e.getParentEditor():e}const J0t={headerBackgroundColor:ve.white,primaryHeadingColor:ve.fromHex("#333333"),secondaryHeadingColor:ve.fromHex("#6c6c6cb3")};let dO=class extends Z0t{constructor(e,t,n){super(e,t),this.instantiationService=n,this._onDidClose=new le,this.onDidClose=this._onDidClose.event,W4(this.options,J0t,!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=He(".head"),this._bodyElement=He(".body"),this._fillHead(this._headElement),this._fillBody(this._bodyElement),e.appendChild(this._headElement),e.appendChild(this._bodyElement)}_fillHead(e,t){this._titleElement=He(".peekview-title"),this.options.supportOnTitleClick&&(this._titleElement.classList.add("clickable"),No(this._titleElement,"click",r=>this._onTitleClick(r))),Ae(this._headElement,this._titleElement),this._fillTitleIcon(this._titleElement),this._primaryHeading=He("span.filename"),this._secondaryHeading=He("span.dirname"),this._metaHeading=He("span.meta"),Ae(this._titleElement,this._primaryHeading,this._secondaryHeading,this._metaHeading);const n=He(".peekview-actions");Ae(this._headElement,n);const o=this._getActionBarOptions();this._actionbarWidget=new zc(n,o),this._disposables.add(this._actionbarWidget),t||this._actionbarWidget.push(new ca("peekview.close",C("label.close","Close"),Mt.asClassName(Xe.close),!0,()=>(this.dispose(),Promise.resolve())),{label:!1,icon:!0})}_fillTitleIcon(e){}_getActionBarOptions(){return{actionViewItemProvider:Zdt.bind(void 0,this.instantiationService),orientation:0}}_onTitleClick(e){}setTitle(e,t){this._primaryHeading&&this._secondaryHeading&&(this._primaryHeading.innerText=e,this._primaryHeading.setAttribute("title",e),t?this._secondaryHeading.innerText=t:Ur(this._secondaryHeading))}setMetaTitle(e){this._metaHeading&&(e?(this._metaHeading.innerText=e,nl(this._metaHeading)):Js(this._metaHeading))}_doLayout(e,t){if(!this._isShowing&&e<0){this.dispose();return}const n=Math.ceil(this.editor.getOption(66)*1.2),o=Math.round(e-(n+2));this._doLayoutHead(n,t),this._doLayoutBody(o,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`)}};dO=iwe([owe(2,$t)],dO);const ebt=J("peekViewTitle.background",{dark:"#252526",light:"#F3F3F3",hcDark:ve.black,hcLight:ve.white},C("peekViewTitleBackground","Background color of the peek view title area.")),swe=J("peekViewTitleLabel.foreground",{dark:ve.white,light:ve.black,hcDark:ve.white,hcLight:Su},C("peekViewTitleForeground","Color of the peek view title.")),awe=J("peekViewTitleDescription.foreground",{dark:"#ccccccb3",light:"#616161",hcDark:"#FFFFFF99",hcLight:"#292929"},C("peekViewTitleInfoForeground","Color of the peek view title info.")),tbt=J("peekView.border",{dark:Ma,light:Ma,hcDark:Ln,hcLight:Ln},C("peekViewBorder","Color of the peek view borders and arrow.")),nbt=J("peekViewResult.background",{dark:"#252526",light:"#F3F3F3",hcDark:ve.black,hcLight:ve.white},C("peekViewResultsBackground","Background color of the peek view result list."));J("peekViewResult.lineForeground",{dark:"#bbbbbb",light:"#646465",hcDark:ve.white,hcLight:Su},C("peekViewResultsMatchForeground","Foreground color for line nodes in the peek view result list."));J("peekViewResult.fileForeground",{dark:ve.white,light:"#1E1E1E",hcDark:ve.white,hcLight:Su},C("peekViewResultsFileForeground","Foreground color for file nodes in the peek view result list."));J("peekViewResult.selectionBackground",{dark:"#3399ff33",light:"#3399ff33",hcDark:null,hcLight:null},C("peekViewResultsSelectionBackground","Background color of the selected entry in the peek view result list."));J("peekViewResult.selectionForeground",{dark:ve.white,light:"#6C6C6C",hcDark:ve.white,hcLight:Su},C("peekViewResultsSelectionForeground","Foreground color of the selected entry in the peek view result list."));const Tm=J("peekViewEditor.background",{dark:"#001F33",light:"#F2F8FC",hcDark:ve.black,hcLight:ve.white},C("peekViewEditorBackground","Background color of the peek view editor."));J("peekViewEditorGutter.background",{dark:Tm,light:Tm,hcDark:Tm,hcLight:Tm},C("peekViewEditorGutterBackground","Background color of the gutter in the peek view editor."));J("peekViewEditorStickyScroll.background",{dark:Tm,light:Tm,hcDark:Tm,hcLight:Tm},C("peekViewEditorStickScrollBackground","Background color of sticky scroll in the peek view editor."));J("peekViewResult.matchHighlightBackground",{dark:"#ea5c004d",light:"#ea5c004d",hcDark:null,hcLight:null},C("peekViewResultsMatchHighlight","Match highlight color in the peek view result list."));J("peekViewEditor.matchHighlightBackground",{dark:"#ff8f0099",light:"#f5d802de",hcDark:null,hcLight:null},C("peekViewEditorMatchHighlight","Match highlight color in the peek view editor."));J("peekViewEditor.matchHighlightBorder",{dark:null,light:null,hcDark:Wi,hcLight:Wi},C("peekViewEditorMatchHighlightBorder","Match highlight border in the peek view editor."));var ibt=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};class Ov{constructor(e,t,n,o){this.isProviderFirst=e,this.parent=t,this.link=n,this._rangeCallback=o,this.id=o$.nextId()}get uri(){return this.link.uri}get range(){var e,t;return(t=(e=this._range)!==null&&e!==void 0?e:this.link.targetSelectionRange)!==null&&t!==void 0?t:this.link.range}set range(e){this._range=e,this._rangeCallback(this)}get ariaMessage(){var e;const t=(e=this.parent.getPreview(this))===null||e===void 0?void 0:e.preview(this.range);return t?C({key:"aria.oneReference.preview",comment:["Placeholders are: 0: filename, 1:line number, 2: column number, 3: preview snippet of source code"]},"{0} in {1} on line {2} at column {3}",t.value,$c(this.uri),this.range.startLineNumber,this.range.startColumn):C("aria.oneReference","in {0} on line {1} at column {2}",$c(this.uri),this.range.startLineNumber,this.range.startColumn)}}class obt{constructor(e){this._modelReference=e}dispose(){this._modelReference.dispose()}preview(e,t=8){const n=this._modelReference.object.textEditorModel;if(!n)return;const{startLineNumber:o,startColumn:r,endLineNumber:s,endColumn:a}=e,l=n.getWordUntilPosition({lineNumber:o,column:r-t}),c=new V(o,l.startColumn,o,r),u=new V(s,a,s,1073741824),d=n.getValueInRange(c).replace(/^\s+/,""),h=n.getValueInRange(e),f=n.getValueInRange(u).replace(/\s+$/,"");return{value:d+h+f,highlight:{start:d.length,end:d.length+h.length}}}}class Pk{constructor(e,t){this.parent=e,this.uri=t,this.children=[],this._previews=new _s}dispose(){si(this._previews.values()),this._previews.clear()}getPreview(e){return this._previews.get(e.uri)}get ariaMessage(){const e=this.children.length;return e===1?C("aria.fileReferences.1","1 symbol in {0}, full path {1}",$c(this.uri),this.uri.fsPath):C("aria.fileReferences.N","{0} symbols in {1}, full path {2}",e,$c(this.uri),this.uri.fsPath)}resolve(e){return ibt(this,void 0,void 0,function*(){if(this._previews.size!==0)return this;for(const t of this.children)if(!this._previews.has(t.uri))try{const n=yield e.createModelReference(t.uri);this._previews.set(t.uri,new obt(n))}catch(n){en(n)}return this})}}class ul{constructor(e,t){this.groups=[],this.references=[],this._onDidChangeReferenceRange=new le,this.onDidChangeReferenceRange=this._onDidChangeReferenceRange.event,this._links=e,this._title=t;const[n]=e;e.sort(ul._compareReferences);let o;for(const r of e)if((!o||!Vi.isEqual(o.uri,r.uri,!0))&&(o=new Pk(this,r.uri),this.groups.push(o)),o.children.length===0||ul._compareReferences(r,o.children[o.children.length-1])!==0){const s=new Ov(n===r,o,r,a=>this._onDidChangeReferenceRange.fire(a));this.references.push(s),o.children.push(s)}}dispose(){si(this.groups),this._onDidChangeReferenceRange.dispose(),this.groups.length=0}clone(){return new ul(this._links,this._title)}get title(){return this._title}get isEmpty(){return this.groups.length===0}get ariaMessage(){return this.isEmpty?C("aria.result.0","No results found"):this.references.length===1?C("aria.result.1","Found 1 symbol in {0}",this.references[0].uri.fsPath):this.groups.length===1?C("aria.result.n1","Found {0} symbols in {1}",this.references.length,this.groups[0].uri.fsPath):C("aria.result.nm","Found {0} symbols in {1} files",this.references.length,this.groups.length)}nextOrPreviousReference(e,t){const{parent:n}=e;let o=n.children.indexOf(e);const r=n.children.length,s=n.parent.groups.length;return s===1||t&&o+10?(t?o=(o+1)%r:o=(o+r-1)%r,n.children[o]):(o=n.parent.groups.indexOf(n),t?(o=(o+1)%s,n.parent.groups[o].children[0]):(o=(o+s-1)%s,n.parent.groups[o].children[n.parent.groups[o].children.length-1]))}nearestReference(e,t){const n=this.references.map((o,r)=>({idx:r,prefixLen:Y0(o.uri.toString(),e.toString()),offsetDist:Math.abs(o.range.startLineNumber-t.lineNumber)*100+Math.abs(o.range.startColumn-t.column)})).sort((o,r)=>o.prefixLen>r.prefixLen?-1:o.prefixLenr.offsetDist?1:0)[0];if(n)return this.references[n.idx]}referenceAt(e,t){for(const n of this.references)if(n.uri.toString()===e.toString()&&V.containsPosition(n.range,t))return n}firstReference(){for(const e of this.references)if(e.isProviderFirst)return e;return this.references[0]}static _compareReferences(e,t){return Vi.compare(e.uri,t.uri)||V.compareRangesUsingStarts(e.range,t.range)}}var dF=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},hF=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},yz;let wz=class{constructor(e){this._resolverService=e}hasChildren(e){return e instanceof ul||e instanceof Pk}getChildren(e){if(e instanceof ul)return e.groups;if(e instanceof Pk)return e.resolve(this._resolverService).then(t=>t.children);throw new Error("bad tree")}};wz=dF([hF(0,za)],wz);class rbt{getHeight(){return 23}getTemplateId(e){return e instanceof Pk?Ok.id:_T.id}}let Sz=class{constructor(e){this._keybindingService=e}getKeyboardNavigationLabel(e){var t;if(e instanceof Ov){const n=(t=e.parent.getPreview(e))===null||t===void 0?void 0:t.preview(e.range);if(n)return n.value}return $c(e.uri)}};Sz=dF([hF(0,xi)],Sz);class sbt{getId(e){return e instanceof Ov?e.id:e.uri}}let xz=class extends _e{constructor(e,t){super(),this._labelService=t;const n=document.createElement("div");n.classList.add("reference-file"),this.file=this._register(new XP(n,{supportHighlights:!0})),this.badge=new k$(Ae(n,He(".count")),{},q1e),e.appendChild(n)}set(e,t){const n=S5(e.uri);this.file.setLabel(this._labelService.getUriBasenameLabel(e.uri),this._labelService.getUriLabel(n,{relative:!0}),{title:this._labelService.getUriLabel(e.uri),matches:t});const o=e.children.length;this.badge.setCount(o),o>1?this.badge.setTitleFormat(C("referencesCount","{0} references",o)):this.badge.setTitleFormat(C("referenceCount","{0} reference",o))}};xz=dF([hF(1,Tw)],xz);let Ok=yz=class{constructor(e){this._instantiationService=e,this.templateId=yz.id}renderTemplate(e){return this._instantiationService.createInstance(xz,e)}renderElement(e,t,n){n.set(e.element,iT(e.filterData))}disposeTemplate(e){e.dispose()}};Ok.id="FileReferencesRenderer";Ok=yz=dF([hF(0,$t)],Ok);class abt{constructor(e){this.label=new ev(e)}set(e,t){var n;const o=(n=e.parent.getPreview(e))===null||n===void 0?void 0:n.preview(e.range);if(!o||!o.value)this.label.set(`${$c(e.uri)}:${e.range.startLineNumber+1}:${e.range.startColumn+1}`);else{const{value:r,highlight:s}=o;t&&!$d.isDefault(t)?(this.label.element.classList.toggle("referenceMatch",!1),this.label.set(r,iT(t))):(this.label.element.classList.toggle("referenceMatch",!0),this.label.set(r,[s]))}}}class _T{constructor(){this.templateId=_T.id}renderTemplate(e){return new abt(e)}renderElement(e,t,n){n.set(e.element,e.filterData)}disposeTemplate(){}}_T.id="OneReferenceRenderer";class lbt{getWidgetAriaLabel(){return C("treeAriaLabel","References")}getAriaLabel(e){return e.ariaMessage}}var cbt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},ng=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},Wle=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};class fF{constructor(e,t){this._editor=e,this._model=t,this._decorations=new Map,this._decorationIgnoreSet=new Set,this._callOnDispose=new Be,this._callOnModelChange=new Be,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=[],n=[];for(let o=0,r=e.children.length;o{const r=o.deltaDecorations([],t);for(let s=0;s{r.equals(9)&&(this._keybindingService.dispatchEvent(r,r.target),r.stopPropagation())},!0)),this._tree=this._instantiationService.createInstance(dbt,"ReferencesWidget",this._treeContainer,new rbt,[this._instantiationService.createInstance(Ok),this._instantiationService.createInstance(_T)],this._instantiationService.createInstance(wz),n),this._splitView.addView({onDidChange:st.None,element:this._previewContainer,minimumSize:200,maximumSize:Number.MAX_VALUE,layout:r=>{this._preview.layout({height:this._dim.height,width:r})}},jP.Distribute),this._splitView.addView({onDidChange:st.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)}},jP.Distribute),this._disposables.add(this._splitView.onDidSashChange(()=>{this._dim.width&&(this.layoutData.ratio=this._splitView.getViewSize(0)/this._dim.width)},void 0));const o=(r,s)=>{r instanceof Ov&&(s==="show"&&this._revealReference(r,!1),this._onDidSelectReference.fire({element:r,kind:s,source:"tree"}))};this._tree.onDidOpen(r=>{r.sideBySide?o(r.element,"side"):r.editorOptions.pinned?o(r.element,"goto"):o(r.element,"show")}),Js(this._treeContainer)}_onWidth(e){this._dim&&this._doLayoutBody(this._dim.height,e)}_doLayoutBody(e,t){super._doLayoutBody(e,t),this._dim=new jn(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=C("noResults","No results"),nl(this._messageContainer),Promise.resolve(void 0)):(Js(this._messageContainer),this._decorationsManager=new fF(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:n}=e;if(t.detail!==2)return;const o=this._getFocusedReference();!o||this._onDidSelectReference.fire({element:{uri:o.uri,range:n.range},kind:t.ctrlKey||t.metaKey||t.altKey?"side":"open",source:"editor"})})),this.container.classList.add("results-loaded"),nl(this._treeContainer),nl(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 Ov)return e;if(e instanceof Pk&&e.children.length>0)return e.children[0]}revealReference(e){return Wle(this,void 0,void 0,function*(){yield this._revealReference(e,!1),this._onDidSelectReference.fire({element:e,kind:"goto",source:"tree"})})}_revealReference(e,t){return Wle(this,void 0,void 0,function*(){if(this._revealedReference===e)return;this._revealedReference=e,e.uri.scheme!==hn.inMemory?this.setTitle(Wst(e.uri),this._uriLabel.getUriLabel(S5(e.uri))):this.setTitle(C("peekView.alternateTitle","References"));const n=this._textModelResolverService.createModelReference(e.uri);this._tree.getInput()===e.parent?this._tree.reveal(e):(t&&this._tree.reveal(e.parent),yield this._tree.expand(e.parent),this._tree.reveal(e));const o=yield n;if(!this._model){o.dispose();return}si(this._previewModelReference);const r=o.object;if(r){const s=this._preview.getModel()===r.textEditorModel?0:1,a=V.lift(e.range).collapseToStart();this._previewModelReference=o,this._preview.setModel(r.textEditorModel),this._preview.setSelection(a),this._preview.revealRangeInCenter(a,s)}else this._preview.setModel(this._previewNotAvailableMessage),o.dispose()})}};Lz=cbt([ng(3,vr),ng(4,za),ng(5,$t),ng(6,rwe),ng(7,Tw),ng(8,x5),ng(9,xi),ng(10,Ki),ng(11,Ti)],Lz);var hbt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},X1=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},Vle=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},EM;const Qb=new lt("referenceSearchVisible",!1,C("referenceSearchVisible","Whether reference peek is visible, like 'Peek References' or 'Peek Definition'"));let Fv=EM=class{static get(e){return e.getContribution(EM.ID)}constructor(e,t,n,o,r,s,a,l){this._defaultTreeKeyboardSupport=e,this._editor=t,this._editorService=o,this._notificationService=r,this._instantiationService=s,this._storageService=a,this._configurationService=l,this._disposables=new Be,this._requestIdPool=0,this._ignoreModelChangeEvent=!1,this._referenceSearchVisible=Qb.bindTo(n)}dispose(){var e,t;this._referenceSearchVisible.reset(),this._disposables.dispose(),(e=this._widget)===null||e===void 0||e.dispose(),(t=this._model)===null||t===void 0||t.dispose(),this._widget=void 0,this._model=void 0}toggleWidget(e,t,n){let o;if(this._widget&&(o=this._widget.position),this.closeWidget(),!!o&&e.containsPosition(o))return;this._peekMode=n,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",s=ubt.fromJSON(this._storageService.get(r,0,"{}"));this._widget=this._instantiationService.createInstance(Lz,this._editor,this._defaultTreeKeyboardSupport,s),this._widget.setTitle(C("labelLoading","Loading...")),this._widget.show(e),this._disposables.add(this._widget.onDidClose(()=>{t.cancel(),this._widget&&(this._storageService.store(r,JSON.stringify(this._widget.layoutData),0,1),this._widget=void 0),this.closeWidget()})),this._disposables.add(this._widget.onDidSelectReference(l=>{const{element:c,kind:u}=l;if(!!c)switch(u){case"open":(l.source!=="editor"||!this._configurationService.getValue("editor.stablePeek"))&&this.openReference(c,!1,!1);break;case"side":this.openReference(c,!0,!1);break;case"goto":n?this._gotoReference(c,!0):this.openReference(c,!1,!0);break}}));const a=++this._requestIdPool;t.then(l=>{var c;if(a!==this._requestIdPool||!this._widget){l.dispose();return}return(c=this._model)===null||c===void 0||c.dispose(),this._model=l,this._widget.setModel(this._model).then(()=>{if(this._widget&&this._model&&this._editor.hasModel()){this._model.isEmpty?this._widget.setMetaTitle(""):this._widget.setMetaTitle(C("metaTitle.N","{0} ({1})",this._model.title,this._model.references.length));const u=this._editor.getModel().uri,d=new ae(e.startLineNumber,e.startColumn),h=this._model.nearestReference(u,d);if(h)return this._widget.setSelection(h).then(()=>{this._widget&&this._editor.getOption(86)==="editor"&&this._widget.focusOnPreviewEditor()})}})},l=>{this._notificationService.error(l)})}changeFocusBetweenPreviewAndReferences(){!this._widget||(this._widget.isPreviewEditorFocused()?this._widget.focusOnReferenceTree():this._widget.focusOnPreviewEditor())}goToNextOrPreviousReference(e){return Vle(this,void 0,void 0,function*(){if(!this._editor.hasModel()||!this._model||!this._widget)return;const t=this._widget.position;if(!t)return;const n=this._model.nearestReference(this._editor.getModel().uri,t);if(!n)return;const o=this._model.nextOrPreviousReference(n,e),r=this._editor.hasTextFocus(),s=this._widget.isPreviewEditorFocused();yield this._widget.setSelection(o),yield this._gotoReference(o,!1),r?this._editor.focus():this._widget&&s&&this._widget.focusOnPreviewEditor()})}revealReference(e){return Vle(this,void 0,void 0,function*(){!this._editor.hasModel()||!this._model||!this._widget||(yield this._widget.revealReference(e))})}closeWidget(e=!0){var t,n;(t=this._widget)===null||t===void 0||t.dispose(),(n=this._model)===null||n===void 0||n.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){var n;(n=this._widget)===null||n===void 0||n.hide(),this._ignoreModelChangeEvent=!0;const o=V.lift(e.range).collapseToStart();return this._editorService.openCodeEditor({resource:e.uri,options:{selection:o,selectionSource:"code.jump",pinned:t}},this._editor).then(r=>{var s;if(this._ignoreModelChangeEvent=!1,!r||!this._widget){this.closeWidget();return}if(this._editor===r)this._widget.show(o),this._widget.focusOnReferenceTree();else{const a=EM.get(r),l=this._model.clone();this.closeWidget(),r.focus(),a==null||a.toggleWidget(o,sr(c=>Promise.resolve(l)),(s=this._peekMode)!==null&&s!==void 0?s:!1)}},r=>{this._ignoreModelChangeEvent=!1,en(r)})}openReference(e,t,n){t||this.closeWidget();const{uri:o,range:r}=e;this._editorService.openCodeEditor({resource:o,options:{selection:r,selectionSource:"code.jump",pinned:n}},this._editor,t)}};Fv.ID="editor.contrib.referencesController";Fv=EM=hbt([X1(2,Ut),X1(3,Jn),X1(4,Ao),X1(5,$t),X1(6,Gu),X1(7,En)],Fv);function Jb(i,e){const t=Q0t(i);if(!t)return;const n=Fv.get(t);n&&e(n)}Va.registerCommandAndKeybindingRule({id:"togglePeekWidgetFocus",weight:100,primary:Zo(2089,60),when:Me.or(Qb,Ha.inPeekEditor),handler(i){Jb(i,e=>{e.changeFocusBetweenPreviewAndReferences()})}});Va.registerCommandAndKeybindingRule({id:"goToNextReference",weight:100-10,primary:62,secondary:[70],when:Me.or(Qb,Ha.inPeekEditor),handler(i){Jb(i,e=>{e.goToNextOrPreviousReference(!0)})}});Va.registerCommandAndKeybindingRule({id:"goToPreviousReference",weight:100-10,primary:1086,secondary:[1094],when:Me.or(Qb,Ha.inPeekEditor),handler(i){Jb(i,e=>{e.goToNextOrPreviousReference(!1)})}});Rn.registerCommandAlias("goToNextReferenceFromEmbeddedEditor","goToNextReference");Rn.registerCommandAlias("goToPreviousReferenceFromEmbeddedEditor","goToPreviousReference");Rn.registerCommandAlias("closeReferenceSearchEditor","closeReferenceSearch");Rn.registerCommand("closeReferenceSearch",i=>Jb(i,e=>e.closeWidget()));Va.registerKeybindingRule({id:"closeReferenceSearch",weight:100-101,primary:9,secondary:[1033],when:Me.and(Ha.inPeekEditor,Me.not("config.editor.stablePeek"))});Va.registerKeybindingRule({id:"closeReferenceSearch",weight:200+50,primary:9,secondary:[1033],when:Me.and(Qb,Me.not("config.editor.stablePeek"))});Va.registerCommandAndKeybindingRule({id:"revealReference",weight:200,primary:3,mac:{primary:3,secondary:[2066]},when:Me.and(Qb,gCe,NX.negate(),RX.negate()),handler(i){var e;const n=(e=i.get(Xc).lastFocusedList)===null||e===void 0?void 0:e.getFocus();Array.isArray(n)&&n[0]instanceof Ov&&Jb(i,o=>o.revealReference(n[0]))}});Va.registerCommandAndKeybindingRule({id:"openReferenceToSide",weight:100,primary:2051,mac:{primary:259},when:Me.and(Qb,gCe,NX.negate(),RX.negate()),handler(i){var e;const n=(e=i.get(Xc).lastFocusedList)===null||e===void 0?void 0:e.getFocus();Array.isArray(n)&&n[0]instanceof Ov&&Jb(i,o=>o.openReference(n[0],!0,!0))}});Rn.registerCommand("openReference",i=>{var e;const n=(e=i.get(Xc).lastFocusedList)===null||e===void 0?void 0:e.getFocus();Array.isArray(n)&&n[0]instanceof Ov&&Jb(i,o=>o.openReference(n[0],!1,!0))});var lwe=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},ML=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const uY=new lt("hasSymbols",!1,C("hasSymbols","Whether there are symbol locations that can be navigated via keyboard-only.")),gF=yn("ISymbolNavigationService");let Ez=class{constructor(e,t,n,o){this._editorService=t,this._notificationService=n,this._keybindingService=o,this._currentModel=void 0,this._currentIdx=-1,this._ignoreEditorChange=!1,this._ctxHasSymbols=uY.bindTo(e)}reset(){var e,t;this._ctxHasSymbols.reset(),(e=this._currentState)===null||e===void 0||e.dispose(),(t=this._currentMessage)===null||t===void 0||t.dispose(),this._currentModel=void 0,this._currentIdx=-1}put(e){const t=e.parent.parent;if(t.references.length<=1){this.reset();return}this._currentModel=t,this._currentIdx=t.references.indexOf(e),this._ctxHasSymbols.set(!0),this._showMessage();const n=new Dz(this._editorService),o=n.onDidChange(r=>{if(this._ignoreEditorChange)return;const s=this._editorService.getActiveCodeEditor();if(!s)return;const a=s.getModel(),l=s.getPosition();if(!a||!l)return;let c=!1,u=!1;for(const d of t.references)if(VG(d.uri,a.uri))c=!0,u=u||V.containsPosition(d.range,l);else if(c)break;(!c||!u)&&this.reset()});this._currentState=Tu(n,o)}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:V.collapseToStart(t.range),selectionRevealType:3}},e).finally(()=>{this._ignoreEditorChange=!1})}_showMessage(){var e;(e=this._currentMessage)===null||e===void 0||e.dispose();const t=this._keybindingService.lookupKeybinding("editor.gotoNextSymbolFromResult"),n=t?C("location.kb","Symbol {0} of {1}, {2} for next",this._currentIdx+1,this._currentModel.references.length,t.getLabel()):C("location","Symbol {0} of {1}",this._currentIdx+1,this._currentModel.references.length);this._currentMessage=this._notificationService.status(n)}};Ez=lwe([ML(0,Ut),ML(1,Jn),ML(2,Ao),ML(3,xi)],Ez);Mn(gF,Ez,1);Ye(new class extends Ir{constructor(){super({id:"editor.gotoNextSymbolFromResult",precondition:uY,kbOpts:{weight:100,primary:70}})}runEditorCommand(i,e){return i.get(gF).revealNext(e)}});Va.registerCommandAndKeybindingRule({id:"editor.gotoNextSymbolFromResult.cancel",weight:100,when:uY,primary:9,handler(i){i.get(gF).reset()}});let Dz=class{constructor(e){this._listener=new Map,this._disposables=new Be,this._onDidChange=new le,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(),si(this._listener.values())}_onDidAddEditor(e){this._listener.set(e,Tu(e.onDidChangeCursorPosition(t=>this._onDidChange.fire({editor:e})),e.onDidChangeModelContent(t=>this._onDidChange.fire({editor:e}))))}_onDidRemoveEditor(e){var t;(t=this._listener.get(e))===null||t===void 0||t.dispose(),this._listener.delete(e)}};Dz=lwe([ML(0,Jn)],Dz);var dY=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};function bT(i,e,t,n){return dY(this,void 0,void 0,function*(){const r=t.ordered(i).map(a=>Promise.resolve(n(a,i,e)).then(void 0,l=>{$o(l)})),s=yield Promise.all(r);return hf(s.flat())})}function pF(i,e,t,n){return bT(e,t,i,(o,r,s)=>o.provideDefinition(r,s,n))}function cwe(i,e,t,n){return bT(e,t,i,(o,r,s)=>o.provideDeclaration(r,s,n))}function uwe(i,e,t,n){return bT(e,t,i,(o,r,s)=>o.provideImplementation(r,s,n))}function dwe(i,e,t,n){return bT(e,t,i,(o,r,s)=>o.provideTypeDefinition(r,s,n))}function mF(i,e,t,n,o){return bT(e,t,i,(r,s,a)=>dY(this,void 0,void 0,function*(){const l=yield r.provideReferences(s,a,{includeDeclaration:!0},o);if(!n||!l||l.length!==2)return l;const c=yield r.provideReferences(s,a,{includeDeclaration:!1},o);return c&&c.length===1?c:l}))}function CT(i){return dY(this,void 0,void 0,function*(){const e=yield i(),t=new ul(e,""),n=t.references.map(o=>o.link);return t.dispose(),n})}Nf("_executeDefinitionProvider",(i,e,t)=>{const n=i.get(pt),o=pF(n.definitionProvider,e,t,_n.None);return CT(()=>o)});Nf("_executeTypeDefinitionProvider",(i,e,t)=>{const n=i.get(pt),o=dwe(n.typeDefinitionProvider,e,t,_n.None);return CT(()=>o)});Nf("_executeDeclarationProvider",(i,e,t)=>{const n=i.get(pt),o=cwe(n.declarationProvider,e,t,_n.None);return CT(()=>o)});Nf("_executeReferenceProvider",(i,e,t)=>{const n=i.get(pt),o=mF(n.referenceProvider,e,t,!1,_n.None);return CT(()=>o)});Nf("_executeImplementationProvider",(i,e,t)=>{const n=i.get(pt),o=uwe(n.implementationProvider,e,t,_n.None);return CT(()=>o)});var Mu=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},Xx,Yx,Zx,j2,K2,q2,G2,X2;Hr.appendMenuItem(Z.EditorContext,{submenu:Z.EditorContextPeek,title:C("peek.submenu","Peek"),group:"navigation",order:100});class $w{static is(e){return!e||typeof e!="object"?!1:!!(e instanceof $w||ae.isIPosition(e.position)&&e.model)}constructor(e,t){this.model=e,this.position=t}}class Bs extends lh{static all(){return Bs._allSymbolNavigationCommands.values()}static _patchConfig(e){const t=Object.assign(Object.assign({},e),{f1:!0});if(t.menu)for(const n of vn.wrap(t.menu))(n.id===Z.EditorContext||n.id===Z.EditorContextPeek)&&(n.when=Me.and(e.precondition,n.when));return t}constructor(e,t){super(Bs._patchConfig(t)),this.configuration=e,Bs._allSymbolNavigationCommands.set(t.id,this)}runEditorCommand(e,t,n,o){if(!t.hasModel())return Promise.resolve(void 0);const r=e.get(Ao),s=e.get(Jn),a=e.get(Jv),l=e.get(gF),c=e.get(pt),u=e.get($t),d=t.getModel(),h=t.getPosition(),f=$w.is(n)?n:new $w(d,h),g=new Rv(t,5),p=t5(this._getLocationModel(c,f.model,f.position,g.token),g.token).then(v=>Mu(this,void 0,void 0,function*(){var m;if(!v||g.token.isCancellationRequested)return;Cs(v.ariaMessage);let _;if(v.referenceAt(d.uri,h)){const w=this._getAlternativeCommand(t);!Bs._activeAlternativeCommands.has(w)&&Bs._allSymbolNavigationCommands.has(w)&&(_=Bs._allSymbolNavigationCommands.get(w))}const y=v.references.length;if(y===0){if(!this.configuration.muteMessage){const w=d.getWordAtPosition(h);(m=cl.get(t))===null||m===void 0||m.showMessage(this._getNoResultFoundMessage(w),h)}}else if(y===1&&_)Bs._activeAlternativeCommands.add(this.desc.id),u.invokeFunction(w=>_.runEditorCommand(w,t,n,o).finally(()=>{Bs._activeAlternativeCommands.delete(this.desc.id)}));else return this._onResult(s,l,t,v,o)}),v=>{r.error(v)}).finally(()=>{g.dispose()});return a.showWhile(p,250),p}_onResult(e,t,n,o,r){return Mu(this,void 0,void 0,function*(){const s=this._getGoToPreference(n);if(!(n instanceof Pv)&&(this.configuration.openInPeek||s==="peek"&&o.references.length>1))this._openInPeek(n,o,r);else{const a=o.firstReference(),l=o.references.length>1&&s==="gotoAndPeek",c=yield this._openReference(n,e,a,this.configuration.openToSide,!l);l&&c?this._openInPeek(c,o,r):o.dispose(),s==="goto"&&t.put(a)}})}_openReference(e,t,n,o,r){return Mu(this,void 0,void 0,function*(){let s;if(iZe(n)&&(s=n.targetSelectionRange),s||(s=n.range),!s)return;const a=yield t.openCodeEditor({resource:n.uri,options:{selection:V.collapseToStart(s),selectionRevealType:3,selectionSource:"code.jump"}},e,o);if(!!a){if(r){const l=a.getModel(),c=a.createDecorationsCollection([{range:s,options:{description:"symbol-navigate-action-highlight",className:"symbolHighlight"}}]);setTimeout(()=>{a.getModel()===l&&c.clear()},350)}return a}})}_openInPeek(e,t,n){const o=Fv.get(e);o&&e.hasModel()?o.toggleWidget(n!=null?n:e.getSelection(),sr(r=>Promise.resolve(t)),this.configuration.openInPeek):t.dispose()}}Bs._allSymbolNavigationCommands=new Map;Bs._activeAlternativeCommands=new Set;class yT extends Bs{_getLocationModel(e,t,n,o){return Mu(this,void 0,void 0,function*(){return new ul(yield pF(e.definitionProvider,t,n,o),C("def.title","Definitions"))})}_getNoResultFoundMessage(e){return e&&e.word?C("noResultWord","No definition found for '{0}'",e.word):C("generic.noResults","No definition found")}_getAlternativeCommand(e){return e.getOption(58).alternativeDefinitionCommand}_getGoToPreference(e){return e.getOption(58).multipleDefinitions}}$i((Xx=class extends yT{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:Xx.id,title:{value:C("actions.goToDecl.label","Go to Definition"),original:"Go to Definition",mnemonicTitle:C({key:"miGotoDefinition",comment:["&& denotes a mnemonic"]},"Go to &&Definition")},precondition:Me.and(Q.hasDefinitionProvider,Q.isInWalkThroughSnippet.toNegated()),keybinding:[{when:Q.editorTextFocus,primary:70,weight:100},{when:Me.and(Q.editorTextFocus,dCe),primary:2118,weight:100}],menu:[{id:Z.EditorContext,group:"navigation",order:1.1},{id:Z.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:2}]}),Rn.registerCommandAlias("editor.action.goToDeclaration",Xx.id)}},Xx.id="editor.action.revealDefinition",Xx));$i((Yx=class extends yT{constructor(){super({openToSide:!0,openInPeek:!1,muteMessage:!1},{id:Yx.id,title:{value:C("actions.goToDeclToSide.label","Open Definition to the Side"),original:"Open Definition to the Side"},precondition:Me.and(Q.hasDefinitionProvider,Q.isInWalkThroughSnippet.toNegated()),keybinding:[{when:Q.editorTextFocus,primary:Zo(2089,70),weight:100},{when:Me.and(Q.editorTextFocus,dCe),primary:Zo(2089,2118),weight:100}]}),Rn.registerCommandAlias("editor.action.openDeclarationToTheSide",Yx.id)}},Yx.id="editor.action.revealDefinitionAside",Yx));$i((Zx=class extends yT{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:Zx.id,title:{value:C("actions.previewDecl.label","Peek Definition"),original:"Peek Definition"},precondition:Me.and(Q.hasDefinitionProvider,Ha.notInPeekEditor,Q.isInWalkThroughSnippet.toNegated()),keybinding:{when:Q.editorTextFocus,primary:582,linux:{primary:3140},weight:100},menu:{id:Z.EditorContextPeek,group:"peek",order:2}}),Rn.registerCommandAlias("editor.action.previewDeclaration",Zx.id)}},Zx.id="editor.action.peekDefinition",Zx));class hwe extends Bs{_getLocationModel(e,t,n,o){return Mu(this,void 0,void 0,function*(){return new ul(yield cwe(e.declarationProvider,t,n,o),C("decl.title","Declarations"))})}_getNoResultFoundMessage(e){return e&&e.word?C("decl.noResultWord","No declaration found for '{0}'",e.word):C("decl.generic.noResults","No declaration found")}_getAlternativeCommand(e){return e.getOption(58).alternativeDeclarationCommand}_getGoToPreference(e){return e.getOption(58).multipleDeclarations}}$i((j2=class extends hwe{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:j2.id,title:{value:C("actions.goToDeclaration.label","Go to Declaration"),original:"Go to Declaration",mnemonicTitle:C({key:"miGotoDeclaration",comment:["&& denotes a mnemonic"]},"Go to &&Declaration")},precondition:Me.and(Q.hasDeclarationProvider,Q.isInWalkThroughSnippet.toNegated()),menu:[{id:Z.EditorContext,group:"navigation",order:1.3},{id:Z.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:3}]})}_getNoResultFoundMessage(e){return e&&e.word?C("decl.noResultWord","No declaration found for '{0}'",e.word):C("decl.generic.noResults","No declaration found")}},j2.id="editor.action.revealDeclaration",j2));$i(class extends hwe{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:"editor.action.peekDeclaration",title:{value:C("actions.peekDecl.label","Peek Declaration"),original:"Peek Declaration"},precondition:Me.and(Q.hasDeclarationProvider,Ha.notInPeekEditor,Q.isInWalkThroughSnippet.toNegated()),menu:{id:Z.EditorContextPeek,group:"peek",order:3}})}});class fwe extends Bs{_getLocationModel(e,t,n,o){return Mu(this,void 0,void 0,function*(){return new ul(yield dwe(e.typeDefinitionProvider,t,n,o),C("typedef.title","Type Definitions"))})}_getNoResultFoundMessage(e){return e&&e.word?C("goToTypeDefinition.noResultWord","No type definition found for '{0}'",e.word):C("goToTypeDefinition.generic.noResults","No type definition found")}_getAlternativeCommand(e){return e.getOption(58).alternativeTypeDefinitionCommand}_getGoToPreference(e){return e.getOption(58).multipleTypeDefinitions}}$i((K2=class extends fwe{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:K2.ID,title:{value:C("actions.goToTypeDefinition.label","Go to Type Definition"),original:"Go to Type Definition",mnemonicTitle:C({key:"miGotoTypeDefinition",comment:["&& denotes a mnemonic"]},"Go to &&Type Definition")},precondition:Me.and(Q.hasTypeDefinitionProvider,Q.isInWalkThroughSnippet.toNegated()),keybinding:{when:Q.editorTextFocus,primary:0,weight:100},menu:[{id:Z.EditorContext,group:"navigation",order:1.4},{id:Z.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:3}]})}},K2.ID="editor.action.goToTypeDefinition",K2));$i((q2=class extends fwe{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:q2.ID,title:{value:C("actions.peekTypeDefinition.label","Peek Type Definition"),original:"Peek Type Definition"},precondition:Me.and(Q.hasTypeDefinitionProvider,Ha.notInPeekEditor,Q.isInWalkThroughSnippet.toNegated()),menu:{id:Z.EditorContextPeek,group:"peek",order:4}})}},q2.ID="editor.action.peekTypeDefinition",q2));class gwe extends Bs{_getLocationModel(e,t,n,o){return Mu(this,void 0,void 0,function*(){return new ul(yield uwe(e.implementationProvider,t,n,o),C("impl.title","Implementations"))})}_getNoResultFoundMessage(e){return e&&e.word?C("goToImplementation.noResultWord","No implementation found for '{0}'",e.word):C("goToImplementation.generic.noResults","No implementation found")}_getAlternativeCommand(e){return e.getOption(58).alternativeImplementationCommand}_getGoToPreference(e){return e.getOption(58).multipleImplementations}}$i((G2=class extends gwe{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:G2.ID,title:{value:C("actions.goToImplementation.label","Go to Implementations"),original:"Go to Implementations",mnemonicTitle:C({key:"miGotoImplementation",comment:["&& denotes a mnemonic"]},"Go to &&Implementations")},precondition:Me.and(Q.hasImplementationProvider,Q.isInWalkThroughSnippet.toNegated()),keybinding:{when:Q.editorTextFocus,primary:2118,weight:100},menu:[{id:Z.EditorContext,group:"navigation",order:1.45},{id:Z.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:4}]})}},G2.ID="editor.action.goToImplementation",G2));$i((X2=class extends gwe{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:X2.ID,title:{value:C("actions.peekImplementation.label","Peek Implementations"),original:"Peek Implementations"},precondition:Me.and(Q.hasImplementationProvider,Ha.notInPeekEditor,Q.isInWalkThroughSnippet.toNegated()),keybinding:{when:Q.editorTextFocus,primary:3142,weight:100},menu:{id:Z.EditorContextPeek,group:"peek",order:5}})}},X2.ID="editor.action.peekImplementation",X2));class pwe extends Bs{_getNoResultFoundMessage(e){return e?C("references.no","No references found for '{0}'",e.word):C("references.noGeneric","No references found")}_getAlternativeCommand(e){return e.getOption(58).alternativeReferenceCommand}_getGoToPreference(e){return e.getOption(58).multipleReferences}}$i(class extends pwe{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:"editor.action.goToReferences",title:{value:C("goToReferences.label","Go to References"),original:"Go to References",mnemonicTitle:C({key:"miGotoReference",comment:["&& denotes a mnemonic"]},"Go to &&References")},precondition:Me.and(Q.hasReferenceProvider,Ha.notInPeekEditor,Q.isInWalkThroughSnippet.toNegated()),keybinding:{when:Q.editorTextFocus,primary:1094,weight:100},menu:[{id:Z.EditorContext,group:"navigation",order:1.45},{id:Z.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:5}]})}_getLocationModel(e,t,n,o){return Mu(this,void 0,void 0,function*(){return new ul(yield mF(e.referenceProvider,t,n,!0,o),C("ref.title","References"))})}});$i(class extends pwe{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:"editor.action.referenceSearch.trigger",title:{value:C("references.action.label","Peek References"),original:"Peek References"},precondition:Me.and(Q.hasReferenceProvider,Ha.notInPeekEditor,Q.isInWalkThroughSnippet.toNegated()),menu:{id:Z.EditorContextPeek,group:"peek",order:6}})}_getLocationModel(e,t,n,o){return Mu(this,void 0,void 0,function*(){return new ul(yield mF(e.referenceProvider,t,n,!1,o),C("ref.title","References"))})}});class fbt extends Bs{constructor(e,t,n){super(e,{id:"editor.action.goToLocation",title:{value:C("label.generic","Go to Any Symbol"),original:"Go to Any Symbol"},precondition:Me.and(Ha.notInPeekEditor,Q.isInWalkThroughSnippet.toNegated())}),this._references=t,this._gotoMultipleBehaviour=n}_getLocationModel(e,t,n,o){return Mu(this,void 0,void 0,function*(){return new ul(this._references,C("generic.title","Locations"))})}_getNoResultFoundMessage(e){return e&&C("generic.noResult","No results for '{0}'",e.word)||""}_getGoToPreference(e){var t;return(t=this._gotoMultipleBehaviour)!==null&&t!==void 0?t:e.getOption(58).multipleReferences}_getAlternativeCommand(){return""}}Rn.registerCommand({id:"editor.action.goToLocations",description:{description:"Go to locations from a position in a file",args:[{name:"uri",description:"The text document in which to start",constraint:Rt},{name:"position",description:"The position at which to start",constraint:ae.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:(i,e,t,n,o,r,s)=>Mu(void 0,void 0,void 0,function*(){fi(Rt.isUri(e)),fi(ae.isIPosition(t)),fi(Array.isArray(n)),fi(typeof o=="undefined"||typeof o=="string"),fi(typeof s=="undefined"||typeof s=="boolean");const a=i.get(Jn),l=yield a.openCodeEditor({resource:e},a.getFocusedCodeEditor());if(Sf(l))return l.setPosition(t),l.revealPositionInCenterIfOutsideViewport(t,0),l.invokeWithinContext(c=>{const u=new class extends fbt{_getNoResultFoundMessage(d){return r||super._getNoResultFoundMessage(d)}}({muteMessage:!Boolean(r),openInPeek:Boolean(s),openToSide:!1},n,o);c.get($t).invokeFunction(u.run.bind(u),l)})})});Rn.registerCommand({id:"editor.action.peekLocations",description:{description:"Peek locations from a position in a file",args:[{name:"uri",description:"The text document in which to start",constraint:Rt},{name:"position",description:"The position at which to start",constraint:ae.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:(i,e,t,n,o)=>Mu(void 0,void 0,void 0,function*(){i.get(_o).executeCommand("editor.action.goToLocations",e,t,n,o,void 0,!0)})});Rn.registerCommand({id:"editor.action.findReferences",handler:(i,e,t)=>{fi(Rt.isUri(e)),fi(ae.isIPosition(t));const n=i.get(pt),o=i.get(Jn);return o.openCodeEditor({resource:e},o.getFocusedCodeEditor()).then(r=>{if(!Sf(r)||!r.hasModel())return;const s=Fv.get(r);if(!s)return;const a=sr(c=>mF(n.referenceProvider,r.getModel(),ae.lift(t),!1,c).then(u=>new ul(u,C("ref.title","References")))),l=new V(t.lineNumber,t.column,t.lineNumber,t.column);return Promise.resolve(s.toggleWidget(l,a,!1))})}});Rn.registerCommandAlias("editor.action.showReferences","editor.action.peekLocations");var gbt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},i7=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},Hle=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},AL;let pb=AL=class{constructor(e,t,n,o){this.textModelResolverService=t,this.languageService=n,this.languageFeaturesService=o,this.toUnhook=new Be,this.toUnhookForKeyboard=new Be,this.currentWordAtPosition=null,this.previousPromise=null,this.editor=e,this.linkDecorations=this.editor.createDecorationsCollection();const r=new cF(e);this.toUnhook.add(r),this.toUnhook.add(r.onMouseMoveOrRelevantKeyDown(([s,a])=>{this.startFindDefinitionFromMouse(s,a!=null?a:void 0)})),this.toUnhook.add(r.onExecute(s=>{this.isEnabled(s)&&this.gotoDefinition(s.target.position,s.hasSideBySideModifier).catch(a=>{en(a)}).finally(()=>{this.removeLinkDecorations()})})),this.toUnhook.add(r.onCancel(()=>{this.removeLinkDecorations(),this.currentWordAtPosition=null}))}static get(e){return e.getContribution(AL.ID)}startFindDefinitionFromCursor(e){return Hle(this,void 0,void 0,function*(){yield 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===9&&this.linkDecorations.length>0)return;if(!this.editor.hasModel()||!this.isEnabled(e,t)){this.currentWordAtPosition=null,this.removeLinkDecorations();return}const n=e.target.position;this.startFindDefinition(n)}startFindDefinition(e){var t;return Hle(this,void 0,void 0,function*(){this.toUnhookForKeyboard.clear();const n=e?(t=this.editor.getModel())===null||t===void 0?void 0:t.getWordAtPosition(e):null;if(!n){this.currentWordAtPosition=null,this.removeLinkDecorations();return}if(this.currentWordAtPosition&&this.currentWordAtPosition.startColumn===n.startColumn&&this.currentWordAtPosition.endColumn===n.endColumn&&this.currentWordAtPosition.word===n.word)return;this.currentWordAtPosition=n;const o=new Rk(this.editor,15);this.previousPromise&&(this.previousPromise.cancel(),this.previousPromise=null),this.previousPromise=sr(a=>this.findDefinition(e,a));let r;try{r=yield this.previousPromise}catch(a){en(a);return}if(!r||!r.length||!o.validate(this.editor)){this.removeLinkDecorations();return}const s=r[0].originSelectionRange?V.lift(r[0].originSelectionRange):new V(e.lineNumber,n.startColumn,e.lineNumber,n.endColumn);if(r.length>1){let a=s;for(const{originSelectionRange:l}of r)l&&(a=V.plusRange(a,l));this.addDecoration(a,new os().appendText(C("multipleResults","Click to show {0} definitions.",r.length)))}else{const a=r[0];if(!a.uri)return;this.textModelResolverService.createModelReference(a.uri).then(l=>{if(!l.object||!l.object.textEditorModel){l.dispose();return}const{object:{textEditorModel:c}}=l,{startLineNumber:u}=a.range;if(u<1||u>c.getLineCount()){l.dispose();return}const d=this.getPreviewValue(c,u,a),h=this.languageService.guessLanguageIdByFilepathOrFirstLine(c.uri);this.addDecoration(s,d?new os().appendCodeblock(h||"",d):void 0),l.dispose()})}})}getPreviewValue(e,t,n){let o=n.range;return o.endLineNumber-o.startLineNumber>=AL.MAX_SOURCE_PREVIEW_LINES&&(o=this.getPreviewRangeBasedOnIndentation(e,t)),this.stripIndentationFromPreviewRange(e,t,o)}stripIndentationFromPreviewRange(e,t,n){let r=e.getLineFirstNonWhitespaceColumn(t);for(let a=t+1;a{const o=!t&&this.editor.getOption(87)&&!this.isInPeekEditor(n);return new yT({openToSide:t,openInPeek:o,muteMessage:!0},{title:{value:"",original:""},id:"",precondition:void 0}).run(n)})}isInPeekEditor(e){const t=e.get(Ut);return Ha.inPeekEditor.getValue(t)}dispose(){this.toUnhook.dispose(),this.toUnhookForKeyboard.dispose()}};pb.ID="editor.contrib.gotodefinitionatposition";pb.MAX_SOURCE_PREVIEW_LINES=8;pb=AL=gbt([i7(1,za),i7(2,Ki),i7(3,pt)],pb);zn(pb.ID,pb,2);const Y2=He;class mwe extends _e{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 YI(this.contentsDomNode,{consumeMouseWheelIfScrollbarIsNeeded:!0})),this.containerDomNode.appendChild(this.scrollbar.getDomNode())}onContentsChanged(){this.scrollbar.scanDomNode()}}class hY extends _e{static render(e,t,n){return new hY(e,t,n)}constructor(e,t,n){super(),this.actionContainer=Ae(e,Y2("div.action-container")),this.actionContainer.setAttribute("tabindex","0"),this.action=Ae(this.actionContainer,Y2("a.action")),this.action.setAttribute("role","button"),t.iconClass&&Ae(this.action,Y2(`span.icon.${t.iconClass}`));const o=Ae(this.action,Y2("span"));o.textContent=n?`${t.label} (${n})`:t.label,this._register(ke(this.actionContainer,et.CLICK,r=>{r.stopPropagation(),r.preventDefault(),t.run(this.actionContainer)})),this._register(ke(this.actionContainer,et.KEY_DOWN,r=>{const s=new Pi(r);(s.equals(3)||s.equals(10))&&(r.stopPropagation(),r.preventDefault(),t.run(this.actionContainer))})),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 pbt(i,e){return i&&e?C("acessibleViewHint","Inspect this in the accessible view with {0}.",e):i?C("acessibleViewHintNoKbOpen","Inspect this in the accessible view via the command Open Accessible View which is currently not triggerable via keybinding."):""}var mbt=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},vbt=globalThis&&globalThis.__asyncValues||function(i){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=i[Symbol.asyncIterator],t;return e?e.call(i):(i=typeof __values=="function"?__values(i):i[Symbol.iterator](),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(r){t[r]=i[r]&&function(s){return new Promise(function(a,l){s=i[r](s),o(a,l,s.done,s.value)})}}function o(r,s,a,l){Promise.resolve(l).then(function(c){r({value:c,done:a})},s)}};class _bt{constructor(e,t,n){this.value=e,this.isComplete=t,this.hasLoadingMessage=n}}class vwe extends _e{constructor(e,t){super(),this._editor=e,this._computer=t,this._onResult=this._register(new le),this.onResult=this._onResult.event,this._firstWaitScheduler=this._register(new bi(()=>this._triggerAsyncComputation(),0)),this._secondWaitScheduler=this._register(new bi(()=>this._triggerSyncComputation(),0)),this._loadingMessageScheduler=this._register(new bi(()=>this._triggerLoadingMessage(),0)),this._state=0,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(60).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(2),this._secondWaitScheduler.schedule(this._secondWaitTime),this._computer.computeAsync?(this._asyncIterableDone=!1,this._asyncIterable=rJe(e=>this._computer.computeAsync(e)),mbt(this,void 0,void 0,function*(){var e,t,n,o;try{try{for(var r=!0,s=vbt(this._asyncIterable),a;a=yield s.next(),e=a.done,!e;r=!0){o=a.value,r=!1;const l=o;l&&(this._result.push(l),this._fireResult())}}catch(l){t={error:l}}finally{try{!r&&!e&&(n=s.return)&&(yield n.call(s))}finally{if(t)throw t.error}}this._asyncIterableDone=!0,(this._state===3||this._state===4)&&this._setState(0)}catch(l){en(l)}})):this._asyncIterableDone=!0}_triggerSyncComputation(){this._computer.computeSync&&(this._result=this._result.concat(this._computer.computeSync())),this._setState(this._asyncIterableDone?0:3)}_triggerLoadingMessage(){this._state===3&&this._setState(4)}_fireResult(){if(this._state===1||this._state===2)return;const e=this._state===0,t=this._state===4;this._onResult.fire(new _bt(this._result.slice(0),e,t))}start(e){if(e===0)this._state===0&&(this._setState(1),this._firstWaitScheduler.schedule(this._firstWaitTime),this._loadingMessageScheduler.schedule(this._loadingMessageTime));else switch(this._state){case 0:this._triggerAsyncComputation(),this._secondWaitScheduler.cancel(),this._triggerSyncComputation();break;case 2: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(0,!1)}}class o7{constructor(e,t,n,o){this.priority=e,this.range=t,this.initialMousePosX=n,this.initialMousePosY=o,this.type=1}equals(e){return e.type===1&&this.range.equalsRange(e.range)}canAdoptVisibleHover(e,t){return e.type===1&&t.lineNumber===this.range.startLineNumber}}class DM{constructor(e,t,n,o,r,s){this.priority=e,this.owner=t,this.range=n,this.initialMousePosX=o,this.initialMousePosY=r,this.supportsMarkerHover=s,this.type=2}equals(e){return e.type===2&&this.owner===e.owner}canAdoptVisibleHover(e,t){return e.type===2&&this.owner===e.owner}}const e1=new class{constructor(){this._participants=[]}register(e){this._participants.push(e)}getAll(){return this._participants}};class fY{constructor(){this._onDidWillResize=new le,this.onDidWillResize=this._onDidWillResize.event,this._onDidResize=new le,this.onDidResize=this._onDidResize.event,this._sashListener=new Be,this._size=new jn(0,0),this._minSize=new jn(0,0),this._maxSize=new jn(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER),this.domNode=document.createElement("div"),this._eastSash=new gs(this.domNode,{getVerticalSashLeft:()=>this._size.width},{orientation:0}),this._westSash=new gs(this.domNode,{getVerticalSashLeft:()=>0},{orientation:0}),this._northSash=new gs(this.domNode,{getHorizontalSashTop:()=>0},{orientation:1,orthogonalEdge:zP.North}),this._southSash=new gs(this.domNode,{getHorizontalSashTop:()=>this._size.height},{orientation:1,orthogonalEdge:zP.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,n=0;this._sashListener.add(st.any(this._northSash.onDidStart,this._eastSash.onDidStart,this._southSash.onDidStart,this._westSash.onDidStart)(()=>{e===void 0&&(this._onDidWillResize.fire(),e=this._size,t=0,n=0)})),this._sashListener.add(st.any(this._northSash.onDidEnd,this._eastSash.onDidEnd,this._southSash.onDidEnd,this._westSash.onDidEnd)(()=>{e!==void 0&&(e=void 0,t=0,n=0,this._onDidResize.fire({dimension:this._size,done:!0}))})),this._sashListener.add(this._eastSash.onDidChange(o=>{e&&(n=o.currentX-o.startX,this.layout(e.height+t,e.width+n),this._onDidResize.fire({dimension:this._size,done:!1,east:!0}))})),this._sashListener.add(this._westSash.onDidChange(o=>{e&&(n=-(o.currentX-o.startX),this.layout(e.height+t,e.width+n),this._onDidResize.fire({dimension:this._size,done:!1,west:!0}))})),this._sashListener.add(this._northSash.onDidChange(o=>{e&&(t=-(o.currentY-o.startY),this.layout(e.height+t,e.width+n),this._onDidResize.fire({dimension:this._size,done:!1,north:!0}))})),this._sashListener.add(this._southSash.onDidChange(o=>{e&&(t=o.currentY-o.startY,this.layout(e.height+t,e.width+n),this._onDidResize.fire({dimension:this._size,done:!1,south:!0}))})),this._sashListener.add(st.any(this._eastSash.onDidReset,this._westSash.onDidReset)(o=>{this._preferredSize&&(this.layout(this._size.height,this._preferredSize.width),this._onDidResize.fire({dimension:this._size,done:!0}))})),this._sashListener.add(st.any(this._northSash.onDidReset,this._southSash.onDidReset)(o=>{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,n,o){this._northSash.state=e?3:0,this._eastSash.state=t?3:0,this._southSash.state=n?3:0,this._westSash.state=o?3:0}layout(e=this.size.height,t=this.size.width){const{height:n,width:o}=this._minSize,{height:r,width:s}=this._maxSize;e=Math.max(n,Math.min(r,e)),t=Math.max(o,Math.min(s,t));const a=new jn(t,e);jn.equals(a,this._size)||(this.domNode.style.height=e+"px",this.domNode.style.width=t+"px",this._size=a,this._northSash.layout(),this._eastSash.layout(),this._southSash.layout(),this._westSash.layout())}clearSashHoverState(){this._eastSash.clearSashHoverState(),this._westSash.clearSashHoverState(),this._northSash.clearSashHoverState(),this._southSash.clearSashHoverState()}get size(){return this._size}set maxSize(e){this._maxSize=e}get maxSize(){return this._maxSize}set minSize(e){this._minSize=e}get minSize(){return this._minSize}set preferredSize(e){this._preferredSize=e}get preferredSize(){return this._preferredSize}}const bbt=30,Cbt=24;class ybt extends _e{constructor(e,t=new jn(10,10)){super(),this._editor=e,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._resizableNode=this._register(new fY),this._contentPosition=null,this._isResizing=!1,this._resizableNode.domNode.style.position="absolute",this._resizableNode.minSize=jn.lift(t),this._resizableNode.layout(t.height,t.width),this._resizableNode.enableSashes(!0,!0,!0,!0),this._register(this._resizableNode.onDidResize(n=>{this._resize(new jn(n.dimension.width,n.dimension.height)),n.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(){var e;return!((e=this._contentPosition)===null||e===void 0)&&e.position?ae.lift(this._contentPosition.position):void 0}_availableVerticalSpaceAbove(e){const t=this._editor.getDomNode(),n=this._editor.getScrolledVisiblePosition(e);return!t||!n?void 0:Yo(t).top+n.top-bbt}_availableVerticalSpaceBelow(e){const t=this._editor.getDomNode(),n=this._editor.getScrolledVisiblePosition(e);if(!t||!n)return;const o=Yo(t),r=vS(t.ownerDocument.body),s=o.top+n.top+n.height;return r.height-s-Cbt}_findPositionPreference(e,t){var n,o;const r=Math.min((n=this._availableVerticalSpaceBelow(t))!==null&&n!==void 0?n:1/0,e),s=Math.min((o=this._availableVerticalSpaceAbove(t))!==null&&o!==void 0?o:1/0,e),a=Math.min(Math.max(s,r),e),l=Math.min(e,a);let c;return this._editor.getOption(60).above?c=l<=s?1:2:c=l<=r?2:1,c===1?this._resizableNode.enableSashes(!0,!0,!1,!1):this._resizableNode.enableSashes(!1,!0,!0,!1),c}_resize(e){this._resizableNode.layout(e.height,e.width)}}var gY=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},_0=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},kM,wh;const $le=He;let hO=kM=class extends _e{constructor(e,t,n){super(),this._editor=e,this._instantiationService=t,this._keybindingService=n,this._currentResult=null,this._widget=this._register(this._instantiationService.createInstance(iv,this._editor)),this._participants=[];for(const o of e1.getAll())this._participants.push(this._instantiationService.createInstance(o,this._editor));this._participants.sort((o,r)=>o.hoverOrdinal-r.hoverOrdinal),this._computer=new gO(this._editor,this._participants),this._hoverOperation=this._register(new vwe(this._editor,this._computer)),this._register(this._hoverOperation.onResult(o=>{if(!this._computer.anchor)return;const r=o.hasLoadingMessage?this._addLoadingMessage(o.value):o.value;this._withResult(new _we(this._computer.anchor,r,o.isComplete))})),this._register(No(this._widget.getDomNode(),"keydown",o=>{o.equals(9)&&this.hide()})),this._register(oo.onDidChange(()=>{this._widget.position&&this._currentResult&&this._setCurrentResult(this._currentResult)}))}get widget(){return this._widget}maybeShowAt(e){if(this._widget.isResizing)return!0;const t=[];for(const o of this._participants)if(o.suggestHoverAnchor){const r=o.suggestHoverAnchor(e);r&&t.push(r)}const n=e.target;if(n.type===6&&t.push(new o7(0,n.range,e.event.posx,e.event.posy)),n.type===7){const o=this._editor.getOption(50).typicalHalfwidthCharacterWidth/2;!n.detail.isAfterLines&&typeof n.detail.horizontalDistanceToText=="number"&&n.detail.horizontalDistanceToTextr.priority-o.priority),this._startShowingOrUpdateHover(t[0],0,0,!1,e))}startShowingAtRange(e,t,n,o){this._startShowingOrUpdateHover(new o7(0,e,void 0,void 0),t,n,o,null)}_startShowingOrUpdateHover(e,t,n,o,r){return!this._widget.position||!this._currentResult?e?(this._startHoverOperationIfNecessary(e,t,n,o,!1),!0):!1:this._editor.getOption(60).sticky&&r&&this._widget.isMouseGettingCloser(r.event.posx,r.event.posy)?(e&&this._startHoverOperationIfNecessary(e,t,n,o,!0),!0):e?e&&this._currentResult.anchor.equals(e)?!0:e.canAdoptVisibleHover(this._currentResult.anchor,this._widget.position)?(this._setCurrentResult(this._currentResult.filter(e)),this._startHoverOperationIfNecessary(e,t,n,o,!1),!0):(this._setCurrentResult(null),this._startHoverOperationIfNecessary(e,t,n,o,!1),!0):(this._setCurrentResult(null),!1)}_startHoverOperationIfNecessary(e,t,n,o,r){this._computer.anchor&&this._computer.anchor.equals(e)||(this._hoverOperation.cancel(),this._computer.anchor=e,this._computer.shouldFocus=o,this._computer.source=n,this._computer.insistOnKeepingHoverVisible=r,this._hoverOperation.start(t))}_setCurrentResult(e){this._currentResult!==e&&(e&&e.messages.length===0&&(e=null),this._currentResult=e,this._currentResult?this._renderMessages(this._currentResult.anchor,this._currentResult.messages):this._widget.hide())}hide(){this._computer.anchor=null,this._hoverOperation.cancel(),this._setCurrentResult(null)}get isColorPickerVisible(){return this._widget.isColorPickerVisible}get isVisibleFromKeyboard(){return this._widget.isVisibleFromKeyboard}get isVisible(){return this._widget.isVisible}get isFocused(){return this._widget.isFocused}get isResizing(){return this._widget.isResizing}containsNode(e){return e?this._widget.getDomNode().contains(e):!1}_addLoadingMessage(e){if(this._computer.anchor){for(const t of this._participants)if(t.createLoadingMessage){const n=t.createLoadingMessage(this._computer.anchor);if(n)return e.slice(0).concat([n])}}return e}_withResult(e){this._widget.position&&this._currentResult&&this._currentResult.isComplete&&(!e.isComplete||this._computer.insistOnKeepingHoverVisible&&e.messages.length===0)||this._setCurrentResult(e)}_renderMessages(e,t){const{showAtPosition:n,showAtSecondaryPosition:o,highlightRange:r}=kM.computeHoverRanges(this._editor,e.range,t),s=new Be,a=s.add(new fO(this._keybindingService)),l=document.createDocumentFragment();let c=null;const u={fragment:l,statusBar:a,setColorPicker:h=>c=h,onContentsChanged:()=>this._widget.onContentsChanged(),setMinimumDimensions:h=>this._widget.setMinimumDimensions(h),hide:()=>this.hide()};for(const h of this._participants){const f=t.filter(g=>g.owner===h);f.length>0&&s.add(h.renderHoverParts(u,f))}const d=t.some(h=>h.isBeforeContent);if(a.hasContent&&l.appendChild(a.hoverElement),l.hasChildNodes()){if(r){const h=this._editor.createDecorationsCollection();h.set([{range:r,options:kM._DECORATION_OPTIONS}]),s.add(zt(()=>{h.clear()}))}this._widget.showAt(l,new Sbt(c,n,o,this._editor.getOption(60).above,this._computer.shouldFocus,this._computer.source,d,e.initialMousePosX,e.initialMousePosY,s))}else s.dispose()}static computeHoverRanges(e,t,n){let o=1;if(e.hasModel()){const c=e._getViewModel(),u=c.coordinatesConverter,d=u.convertModelRangeToViewRange(t),h=new ae(d.startLineNumber,c.getLineMinColumn(d.startLineNumber));o=u.convertViewPositionToModelPosition(h).column}const r=t.startLineNumber;let s=t.startColumn,a=n[0].range,l=null;for(const c of n)a=V.plusRange(a,c.range),c.range.startLineNumber===r&&c.range.endLineNumber===r&&(s=Math.max(Math.min(s,c.range.startColumn),o)),c.forceShowAtRange&&(l=c.range);return{showAtPosition:l?l.getStartPosition():new ae(r,t.startColumn),showAtSecondaryPosition:l?l.getStartPosition():new ae(r,s),highlightRange:a}}focus(){this._widget.focus()}scrollUp(){this._widget.scrollUp()}scrollDown(){this._widget.scrollDown()}scrollLeft(){this._widget.scrollLeft()}scrollRight(){this._widget.scrollRight()}pageUp(){this._widget.pageUp()}pageDown(){this._widget.pageDown()}goToTop(){this._widget.goToTop()}goToBottom(){this._widget.goToBottom()}};hO._DECORATION_OPTIONS=Jt.register({description:"content-hover-highlight",className:"hoverHighlight"});hO=kM=gY([_0(1,$t),_0(2,xi)],hO);class _we{constructor(e,t,n){this.anchor=e,this.messages=t,this.isComplete=n}filter(e){const t=this.messages.filter(n=>n.isValidForHoverAnchor(e));return t.length===this.messages.length?this:new wbt(this,this.anchor,t,this.isComplete)}}class wbt extends _we{constructor(e,t,n,o){super(t,n,o),this.original=e}filter(e){return this.original.filter(e)}}class Sbt{constructor(e,t,n,o,r,s,a,l,c,u){this.colorPicker=e,this.showAtPosition=t,this.showAtSecondaryPosition=n,this.preferAbove=o,this.stoleFocus=r,this.source=s,this.isBeforeContent=a,this.initialMousePosX=l,this.initialMousePosY=c,this.disposables=u,this.closestMouseDistance=void 0}}const zle=30,r7=10,xbt=6;let iv=wh=class extends ybt{get isColorPickerVisible(){var e;return Boolean((e=this._visibleData)===null||e===void 0?void 0:e.colorPicker)}get isVisibleFromKeyboard(){var e;return((e=this._visibleData)===null||e===void 0?void 0:e.source)===1}get isVisible(){var e;return(e=this._hoverVisibleKey.get())!==null&&e!==void 0?e:!1}get isFocused(){var e;return(e=this._hoverFocusedKey.get())!==null&&e!==void 0?e:!1}constructor(e,t,n,o,r){const s=e.getOption(66)+8,a=150,l=new jn(a,s);super(e,l),this._configurationService=n,this._accessibilityService=o,this._keybindingService=r,this._hover=this._register(new mwe),this._minimumSize=l,this._hoverVisibleKey=Q.hoverVisible.bindTo(t),this._hoverFocusedKey=Q.hoverFocused.bindTo(t),Ae(this._resizableNode.domNode,this._hover.containerDomNode),this._resizableNode.domNode.style.zIndex="50",this._register(this._editor.onDidLayoutChange(()=>this._layout())),this._register(this._editor.onDidChangeConfiguration(u=>{u.hasChanged(50)&&this._updateFont()}));const c=this._register(pf(this._resizableNode.domNode));this._register(c.onDidFocus(()=>{this._hoverFocusedKey.set(!0)})),this._register(c.onDidBlur(()=>{this._hoverFocusedKey.set(!1)})),this._setHoverData(void 0),this._layout(),this._editor.addContentWidget(this)}dispose(){var e;super.dispose(),(e=this._visibleData)===null||e===void 0||e.disposables.dispose(),this._editor.removeContentWidget(this)}getId(){return wh.ID}static _applyDimensions(e,t,n){const o=typeof t=="number"?`${t}px`:t,r=typeof n=="number"?`${n}px`:n;e.style.width=o,e.style.height=r}_setContentsDomNodeDimensions(e,t){const n=this._hover.contentsDomNode;return wh._applyDimensions(n,e,t)}_setContainerDomNodeDimensions(e,t){const n=this._hover.containerDomNode;return wh._applyDimensions(n,e,t)}_setHoverWidgetDimensions(e,t){this._setContentsDomNodeDimensions(e,t),this._setContainerDomNodeDimensions(e,t),this._layoutContentWidget()}static _applyMaxDimensions(e,t,n){const o=typeof t=="number"?`${t}px`:t,r=typeof n=="number"?`${n}px`:n;e.style.maxWidth=o,e.style.maxHeight=r}_setHoverWidgetMaxDimensions(e,t){wh._applyMaxDimensions(this._hover.contentsDomNode,e,t),wh._applyMaxDimensions(this._hover.containerDomNode,e,t),this._hover.containerDomNode.style.setProperty("--vscode-hover-maxWidth",typeof e=="number"?`${e}px`:e),this._layoutContentWidget()}_hasHorizontalScrollbar(){const e=this._hover.scrollbar.getScrollDimensions();return e.scrollWidth>e.width}_adjustContentsBottomPadding(){const e=this._hover.contentsDomNode,t=`${this._hover.scrollbar.options.horizontalScrollbarSize}px`;e.style.paddingBottom!==t&&(e.style.paddingBottom=t)}_setAdjustedHoverWidgetDimensions(e){this._setHoverWidgetMaxDimensions("none","none");const t=e.width,n=e.height;this._setHoverWidgetDimensions(t,n),this._hasHorizontalScrollbar()&&(this._adjustContentsBottomPadding(),this._setContentsDomNodeDimensions(t,n-r7))}_updateResizableNodeMaxDimensions(){var e,t;const n=(e=this._findMaximumRenderingWidth())!==null&&e!==void 0?e:1/0,o=(t=this._findMaximumRenderingHeight())!==null&&t!==void 0?t:1/0;this._resizableNode.maxSize=new jn(n,o),this._setHoverWidgetMaxDimensions(n,o)}_resize(e){var t,n;wh._lastDimensions=new jn(e.width,e.height),this._setAdjustedHoverWidgetDimensions(e),this._resizableNode.layout(e.height,e.width),this._updateResizableNodeMaxDimensions(),this._hover.scrollbar.scanDomNode(),this._editor.layoutContentWidget(this),(n=(t=this._visibleData)===null||t===void 0?void 0:t.colorPicker)===null||n===void 0||n.layout()}_findAvailableSpaceVertically(){var e;const t=(e=this._visibleData)===null||e===void 0?void 0:e.showAtPosition;if(!!t)return this._positionPreference===1?this._availableVerticalSpaceAbove(t):this._availableVerticalSpaceBelow(t)}_findMaximumRenderingHeight(){const e=this._findAvailableSpaceVertically();if(!e)return;let t=xbt;return Array.from(this._hover.contentsDomNode.children).forEach(n=>{t+=n.clientHeight}),this._hasHorizontalScrollbar()&&(t+=r7),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=="undefined"?0:this._contentWidth-2;return e||this._hover.containerDomNode.clientWidththis._visibleData.closestMouseDistance+4?!1:(this._visibleData.closestMouseDistance=Math.min(this._visibleData.closestMouseDistance,o),!0)}_setHoverData(e){var t;(t=this._visibleData)===null||t===void 0||t.disposables.dispose(),this._visibleData=e,this._hoverVisibleKey.set(!!e),this._hover.containerDomNode.classList.toggle("hidden",!e)}_layout(){const{fontSize:e,lineHeight:t}=this._editor.getOption(50),n=this._hover.contentsDomNode;n.style.fontSize=`${e}px`,n.style.lineHeight=`${t/e}`,this._updateMaxDimensions()}_updateFont(){Array.prototype.slice.call(this._hover.contentsDomNode.getElementsByClassName("code")).forEach(t=>this._editor.applyFontInfo(t))}_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,wh._lastDimensions.height),t=Math.max(this._editor.getLayoutInfo().width*.66,500,wh._lastDimensions.width);this._setHoverWidgetMaxDimensions(t,e)}_render(e,t){this._setHoverData(t),this._updateFont(),this._updateContent(e),this._updateMaxDimensions(),this.onContentsChanged(),this._editor.render()}getPosition(){var e;return this._visibleData?{position:this._visibleData.showAtPosition,secondaryPosition:this._visibleData.showAtSecondaryPosition,positionAffinity:this._visibleData.isBeforeContent?3:void 0,preference:[(e=this._positionPreference)!==null&&e!==void 0?e:1]}:null}showAt(e,t){var n,o,r,s;if(!this._editor||!this._editor.hasModel())return;this._render(e,t);const a=u0(this._hover.containerDomNode),l=t.showAtPosition;this._positionPreference=(n=this._findPositionPreference(a,l))!==null&&n!==void 0?n:1,this.onContentsChanged(),t.stoleFocus&&this._hover.containerDomNode.focus(),(o=t.colorPicker)===null||o===void 0||o.layout();const c=pbt(this._configurationService.getValue("accessibility.verbosity.hover")===!0&&this._accessibilityService.isScreenReaderOptimized(),(s=(r=this._keybindingService.lookupKeybinding("editor.action.accessibleView"))===null||r===void 0?void 0:r.getAriaLabel())!==null&&s!==void 0?s:"");c&&(this._hover.contentsDomNode.ariaLabel=this._hover.contentsDomNode.textContent+", "+c)}hide(){if(!this._visibleData)return;const e=this._visibleData.stoleFocus||this._hoverFocusedKey.get();this._setHoverData(void 0),this._resizableNode.maxSize=new jn(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")}_adjustHoverHeightForScrollbar(e){var t;const n=this._hover.containerDomNode,o=this._hover.contentsDomNode,r=(t=this._findMaximumRenderingHeight())!==null&&t!==void 0?t:1/0;this._setContainerDomNodeDimensions(Ea(n),Math.min(r,e)),this._setContentsDomNodeDimensions(Ea(o),Math.min(r,e-r7))}setMinimumDimensions(e){this._minimumSize=new jn(Math.max(this._minimumSize.width,e.width),Math.max(this._minimumSize.height,e.height)),this._updateMinimumWidth()}_updateMinimumWidth(){const e=typeof this._contentWidth=="undefined"?this._minimumSize.width:Math.min(this._contentWidth,this._minimumSize.width);this._resizableNode.minSize=new jn(e,this._minimumSize.height)}onContentsChanged(){var e;this._removeConstraintsRenderNormally();const t=this._hover.containerDomNode;let n=u0(t),o=Ea(t);if(this._resizableNode.layout(n,o),this._setHoverWidgetDimensions(o,n),n=u0(t),o=Ea(t),this._contentWidth=o,this._updateMinimumWidth(),this._resizableNode.layout(n,o),this._hasHorizontalScrollbar()&&(this._adjustContentsBottomPadding(),this._adjustHoverHeightForScrollbar(n)),!((e=this._visibleData)===null||e===void 0)&&e.showAtPosition){const r=u0(this._hover.containerDomNode);this._positionPreference=this._findPositionPreference(r,this._visibleData.showAtPosition)}this._layoutContentWidget()}focus(){this._hover.containerDomNode.focus()}scrollUp(){const e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._editor.getOption(50);this._hover.scrollbar.setScrollPosition({scrollTop:e-t.lineHeight})}scrollDown(){const e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._editor.getOption(50);this._hover.scrollbar.setScrollPosition({scrollTop:e+t.lineHeight})}scrollLeft(){const e=this._hover.scrollbar.getScrollPosition().scrollLeft;this._hover.scrollbar.setScrollPosition({scrollLeft:e-zle})}scrollRight(){const e=this._hover.scrollbar.getScrollPosition().scrollLeft;this._hover.scrollbar.setScrollPosition({scrollLeft:e+zle})}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})}};iv.ID="editor.contrib.resizableContentHoverWidget";iv._lastDimensions=new jn(0,0);iv=wh=gY([_0(1,Ut),_0(2,En),_0(3,vp),_0(4,xi)],iv);let fO=class extends _e{get hasContent(){return this._hasContent}constructor(e){super(),this._keybindingService=e,this._hasContent=!1,this.hoverElement=$le("div.hover-row.status-bar"),this.actionsElement=Ae(this.hoverElement,$le("div.actions"))}addAction(e){const t=this._keybindingService.lookupKeybinding(e.commandId),n=t?t.getLabel():null;return this._hasContent=!0,this._register(hY.render(this.actionsElement,e,n))}append(e){const t=Ae(this.actionsElement,e);return this._hasContent=!0,t}};fO=gY([_0(0,xi)],fO);class gO{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=0,this._insistOnKeepingHoverVisible=!1}static _getLineDecorations(e,t){if(t.type!==1&&!t.supportsMarkerHover)return[];const n=e.getModel(),o=t.range.startLineNumber;if(o>n.getLineCount())return[];const r=n.getLineMaxColumn(o);return e.getLineDecorations(o).filter(s=>{if(s.options.isWholeLine)return!0;const a=s.range.startLineNumber===o?s.range.startColumn:1,l=s.range.endLineNumber===o?s.range.endColumn:r;if(s.options.showIfCollapsed){if(a>t.range.startColumn+1||t.range.endColumn-1>l)return!1}else if(a>t.range.startColumn||t.range.endColumn>l)return!1;return!0})}computeAsync(e){const t=this._anchor;if(!this._editor.hasModel()||!t)return Wo.EMPTY;const n=gO._getLineDecorations(this._editor,t);return Wo.merge(this._participants.map(o=>o.computeAsync?o.computeAsync(t,n,e):Wo.EMPTY))}computeSync(){if(!this._editor.hasModel()||!this._anchor)return[];const e=gO._getLineDecorations(this._editor,this._anchor);let t=[];for(const n of this._participants)t=t.concat(n.computeSync(this._anchor,e));return hf(t)}}function Ule(i,e,t,n,o,r){const s=t+o/2,a=n+r/2,l=Math.max(Math.abs(i-s)-o/2,0),c=Math.max(Math.abs(e-a)-r/2,0);return Math.sqrt(l*l+c*c)}const jle=He;class By extends _e{constructor(e,t,n){super(),this._renderDisposeables=this._register(new Be),this._editor=e,this._isVisible=!1,this._messages=[],this._hover=this._register(new mwe),this._hover.containerDomNode.classList.toggle("hidden",!this._isVisible),this._markdownRenderer=this._register(new up({editor:this._editor},t,n)),this._computer=new Lbt(this._editor),this._hoverOperation=this._register(new vwe(this._editor,this._computer)),this._register(this._hoverOperation.onResult(o=>{this._withResult(o.value)})),this._register(this._editor.onDidChangeModelDecorations(()=>this._onModelDecorationsChanged())),this._register(this._editor.onDidChangeConfiguration(o=>{o.hasChanged(50)&&this._updateFont()})),this._editor.addOverlayWidget(this)}dispose(){this._editor.removeOverlayWidget(this),super.dispose()}getId(){return By.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(0))}startShowingAt(e){this._computer.lineNumber!==e&&(this._hoverOperation.cancel(),this.hide(),this._computer.lineNumber=e,this._hoverOperation.start(0))}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 n=document.createDocumentFragment();for(const o of t){const r=jle("div.hover-row.markdown-hover"),s=Ae(r,jle("div.hover-contents")),a=this._renderDisposeables.add(this._markdownRenderer.render(o.value));s.appendChild(a.element),n.appendChild(r)}this._updateContents(n),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(),n=this._editor.getTopForLineNumber(e),o=this._editor.getScrollTop(),r=this._editor.getOption(66),s=this._hover.containerDomNode.clientHeight,a=n-o-(s-r)/2;this._hover.containerDomNode.style.left=`${t.glyphMarginLeft+t.glyphMarginWidth}px`,this._hover.containerDomNode.style.top=`${Math.max(Math.round(a),0)}px`}}By.ID="editor.contrib.modesGlyphHoverWidget";class Lbt{get lineNumber(){return this._lineNumber}set lineNumber(e){this._lineNumber=e}constructor(e){this._editor=e,this._lineNumber=-1}computeSync(){const e=o=>({value:o}),t=this._editor.getLineDecorations(this._lineNumber),n=[];if(!t)return n;for(const o of t){if(!o.options.glyphMarginClassName)continue;const r=o.options.glyphMarginHoverMessage;!r||Mw(r)||n.push(...Mq(r).map(e))}return n}}var Ebt=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};class Dbt{constructor(e,t,n){this.provider=e,this.hover=t,this.ordinal=n}}function kbt(i,e,t,n,o){return Ebt(this,void 0,void 0,function*(){try{const r=yield Promise.resolve(i.provideHover(t,n,o));if(r&&Tbt(r))return new Dbt(i,r,e)}catch(r){$o(r)}})}function pY(i,e,t,n){const r=i.ordered(e).map((s,a)=>kbt(s,a,e,t,n));return Wo.fromPromises(r).coalesce()}function Ibt(i,e,t,n){return pY(i,e,t,n).map(o=>o.hover).toPromise()}Nf("_executeHoverProvider",(i,e,t)=>{const n=i.get(pt);return Ibt(n.hoverProvider,e,t,_n.None)});function Tbt(i){const e=typeof i.range!="undefined",t=typeof i.contents!="undefined"&&i.contents&&i.contents.length>0;return e&&t}var Nbt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Z2=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const Kle=He;class Dd{constructor(e,t,n,o,r){this.owner=e,this.range=t,this.contents=n,this.isBeforeContent=o,this.ordinal=r}isValidForHoverAnchor(e){return e.type===1&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}let pO=class{constructor(e,t,n,o,r){this._editor=e,this._languageService=t,this._openerService=n,this._configurationService=o,this._languageFeaturesService=r,this.hoverOrdinal=3}createLoadingMessage(e){return new Dd(this,e.range,[new os().appendText(C("modesContentHover.loading","Loading..."))],!1,2e3)}computeSync(e,t){if(!this._editor.hasModel()||e.type!==1)return[];const n=this._editor.getModel(),o=e.range.startLineNumber,r=n.getLineMaxColumn(o),s=[];let a=1e3;const l=n.getLineLength(o),c=n.getLanguageIdAtPosition(e.range.startLineNumber,e.range.startColumn),u=this._editor.getOption(116),d=this._configurationService.getValue("editor.maxTokenizationLineLength",{overrideIdentifier:c});let h=!1;u>=0&&l>u&&e.range.startColumn>=u&&(h=!0,s.push(new Dd(this,e.range,[{value:C("stopped rendering","Rendering paused for long line for performance reasons. This can be configured via `editor.stopRenderingLineAfter`.")}],!1,a++))),!h&&typeof d=="number"&&l>=d&&s.push(new Dd(this,e.range,[{value:C("too many characters","Tokenization is skipped for long lines for performance reasons. This can be configured via `editor.maxTokenizationLineLength`.")}],!1,a++));let f=!1;for(const g of t){const p=g.range.startLineNumber===o?g.range.startColumn:1,v=g.range.endLineNumber===o?g.range.endColumn:r,m=g.options.hoverMessage;if(!m||Mw(m))continue;g.options.beforeContentClassName&&(f=!0);const _=new V(e.range.startLineNumber,p,e.range.startLineNumber,v);s.push(new Dd(this,_,Mq(m),f,a++))}return s}computeAsync(e,t,n){if(!this._editor.hasModel()||e.type!==1)return Wo.EMPTY;const o=this._editor.getModel();if(!this._languageFeaturesService.hoverProvider.has(o))return Wo.EMPTY;const r=new ae(e.range.startLineNumber,e.range.startColumn);return pY(this._languageFeaturesService.hoverProvider,o,r,n).filter(s=>!Mw(s.hover.contents)).map(s=>{const a=s.hover.range?V.lift(s.hover.range):e.range;return new Dd(this,a,s.hover.contents,!1,s.ordinal)})}renderHoverParts(e,t){return bwe(e,t,this._editor,this._languageService,this._openerService)}};pO=Nbt([Z2(1,Ki),Z2(2,ml),Z2(3,En),Z2(4,pt)],pO);function bwe(i,e,t,n,o){e.sort((s,a)=>s.ordinal-a.ordinal);const r=new Be;for(const s of e)for(const a of s.contents){if(Mw(a))continue;const l=Kle("div.hover-row.markdown-hover"),c=Ae(l,Kle("div.hover-contents")),u=r.add(new up({editor:t},n,o));r.add(u.onDidRenderAsync(()=>{c.className="hover-contents code-hover-contents",i.onContentsChanged()}));const d=r.add(u.render(a));c.appendChild(d.element),i.fragment.appendChild(l)}return r}var Cwe=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},mO=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};class qle{constructor(e,t,n){this.marker=e,this.index=t,this.total=n}}let kz=class{constructor(e,t,n){this._markerService=t,this._configService=n,this._onDidChange=new le,this.onDidChange=this._onDidChange.event,this._dispoables=new Be,this._markers=[],this._nextIdx=-1,Rt.isUri(e)?this._resourceFilter=a=>a.toString()===e.toString():e&&(this._resourceFilter=e);const o=this._configService.getValue("problems.sortOrder"),r=(a,l)=>{let c=RD(a.resource.toString(),l.resource.toString());return c===0&&(o==="position"?c=V.compareRangesUsingStarts(a,l)||ao.compare(a.severity,l.severity):c=ao.compare(a.severity,l.severity)||V.compareRangesUsingStarts(a,l)),c},s=()=>{this._markers=this._markerService.read({resource:Rt.isUri(e)?e:void 0,severities:ao.Error|ao.Warning|ao.Info}),typeof e=="function"&&(this._markers=this._markers.filter(a=>this._resourceFilter(a.resource))),this._markers.sort(r)};s(),this._dispoables.add(t.onMarkerChanged(a=>{(!this._resourceFilter||a.some(l=>this._resourceFilter(l)))&&(s(),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 qle(e,this._nextIdx+1,this._markers.length)}_initIdx(e,t,n){let o=!1,r=this._markers.findIndex(s=>s.resource.toString()===e.uri.toString());r<0&&(r=xD(this._markers,{resource:e.uri},(s,a)=>RD(s.resource.toString(),a.resource.toString())),r<0&&(r=~r));for(let s=r;so.resource.toString()===e.toString());if(!(n<0)){for(;n=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Y1=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},Nz;class Mbt{constructor(e,t,n,o,r){this._openerService=o,this._labelService=r,this._lines=0,this._longestLineLength=0,this._relatedDiagnostics=new WeakMap,this._disposables=new Be,this._editor=t;const s=document.createElement("div");s.className="descriptioncontainer",this._messageBlock=document.createElement("div"),this._messageBlock.classList.add("message"),this._messageBlock.setAttribute("aria-live","assertive"),this._messageBlock.setAttribute("role","alert"),s.appendChild(this._messageBlock),this._relatedBlock=document.createElement("div"),s.appendChild(this._relatedBlock),this._disposables.add(No(this._relatedBlock,"click",a=>{a.preventDefault();const l=this._relatedDiagnostics.get(a.target);l&&n(l)})),this._scrollable=new vbe(s,{horizontal:1,vertical:1,useShadows:!1,horizontalScrollbarSize:6,verticalScrollbarSize:6}),e.appendChild(this._scrollable.getDomNode()),this._disposables.add(this._scrollable.onScroll(a=>{s.style.left=`-${a.scrollLeft}px`,s.style.top=`-${a.scrollTop}px`})),this._disposables.add(this._scrollable)}dispose(){si(this._disposables)}update(e){const{source:t,message:n,relatedInformation:o,code:r}=e;let s=((t==null?void 0:t.length)||0)+2;r&&(typeof r=="string"?s+=r.length:s+=r.value.length);const a=gf(n);this._lines=a.length,this._longestLineLength=0;for(const h of a)this._longestLineLength=Math.max(h.length+s,this._longestLineLength);Ur(this._messageBlock),this._messageBlock.setAttribute("aria-label",this.getAriaLabel(e)),this._editor.applyFontInfo(this._messageBlock);let l=this._messageBlock;for(const h of a)l=document.createElement("div"),l.innerText=h,h===""&&(l.style.height=this._messageBlock.style.lineHeight),this._messageBlock.appendChild(l);if(t||r){const h=document.createElement("span");if(h.classList.add("details"),l.appendChild(h),t){const f=document.createElement("span");f.innerText=t,f.classList.add("source"),h.appendChild(f)}if(r)if(typeof r=="string"){const f=document.createElement("span");f.innerText=`(${r})`,f.classList.add("code"),h.appendChild(f)}else{this._codeLink=He("a.code-link"),this._codeLink.setAttribute("href",`${r.target.toString()}`),this._codeLink.onclick=g=>{this._openerService.open(r.target,{allowCommands:!0}),g.preventDefault(),g.stopPropagation()};const f=Ae(this._codeLink,He("span"));f.innerText=r.value,h.appendChild(this._codeLink)}}if(Ur(this._relatedBlock),this._editor.applyFontInfo(this._relatedBlock),ws(o)){const h=this._relatedBlock.appendChild(document.createElement("div"));h.style.paddingTop=`${Math.floor(this._editor.getOption(66)*.66)}px`,this._lines+=1;for(const f of o){const g=document.createElement("div"),p=document.createElement("a");p.classList.add("filename"),p.innerText=`${this._labelService.getUriBasenameLabel(f.resource)}(${f.startLineNumber}, ${f.startColumn}): `,p.title=this._labelService.getUriLabel(f.resource),this._relatedDiagnostics.set(p,f);const v=document.createElement("span");v.innerText=f.message,g.appendChild(p),g.appendChild(v),this._lines+=1,h.appendChild(g)}}const c=this._editor.getOption(50),u=Math.ceil(c.typicalFullwidthCharacterWidth*this._longestLineLength*.75),d=c.lineHeight*this._lines;this._scrollable.setScrollDimensions({scrollWidth:u,scrollHeight:d})}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 ao.Error:t=C("Error","Error");break;case ao.Warning:t=C("Warning","Warning");break;case ao.Info:t=C("Info","Info");break;case ao.Hint:t=C("Hint","Hint");break}let n=C("marker aria","{0} at {1}. ",t,e.startLineNumber+":"+e.startColumn);const o=this._editor.getModel();return o&&e.startLineNumber<=o.getLineCount()&&e.startLineNumber>=1&&(n=`${o.getLineContent(e.startLineNumber)}, ${n}`),n}}let zw=Nz=class extends dO{constructor(e,t,n,o,r,s,a){super(e,{showArrow:!0,showFrame:!0,isAccessible:!0,frameWidth:1},r),this._themeService=t,this._openerService=n,this._menuService=o,this._contextKeyService=s,this._labelService=a,this._callOnDispose=new Be,this._onDidSelectRelatedInformation=new le,this.onDidSelectRelatedInformation=this._onDidSelectRelatedInformation.event,this._severity=ao.Warning,this._backgroundColor=ve.white,this._applyTheme(t.getColorTheme()),this._callOnDispose.add(t.onDidColorThemeChange(this._applyTheme.bind(this))),this.create()}_applyTheme(e){this._backgroundColor=e.getColor(Fbt);let t=Rz,n=Abt;this._severity===ao.Warning?(t=IM,n=Pbt):this._severity===ao.Info&&(t=Mz,n=Obt);const o=e.getColor(t),r=e.getColor(n);this.style({arrowColor:o,frameColor:o,headerBackgroundColor:r,primaryHeadingColor:e.getColor(swe),secondaryHeadingColor:e.getColor(awe)})}_applyStyles(){this._parentContainer&&(this._parentContainer.style.backgroundColor=this._backgroundColor?this._backgroundColor.toString():""),super._applyStyles()}dispose(){this._callOnDispose.dispose(),super.dispose()}_fillHead(e){super._fillHead(e),this._disposables.add(this._actionbarWidget.actionRunner.onWillRun(o=>this.editor.focus()));const t=[],n=this._menuService.createMenu(Nz.TitleMenu,this._contextKeyService);X1e(n,void 0,t),this._actionbarWidget.push(t,{label:!1,icon:!0,index:0}),n.dispose()}_fillTitleIcon(e){this._icon=Ae(e,He(""))}_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 Mbt(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,n){this._container.classList.remove("stale"),this._message.update(e),this._severity=e.severity,this._applyTheme(this._themeService.getColorTheme());const o=V.lift(e),r=this.editor.getPosition(),s=r&&o.containsPosition(r)?r:o.getStartPosition();super.show(s,this.computeRequiredHeight());const a=this.editor.getModel();if(a){const l=n>1?C("problems","{0} of {1} problems",t,n):C("change","{0} of {1} problem",t,n);this.setTitle($c(a.uri),l)}this._icon.className=`codicon ${Tz.className(ao.toSeverity(this._severity))}`,this.editor.revealPositionNearTop(s,0),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()}};zw.TitleMenu=new Z("gotoErrorTitleMenu");zw=Nz=Rbt([Y1(1,vr),Y1(2,ml),Y1(3,If),Y1(4,$t),Y1(5,Ut),Y1(6,Tw)],zw);const Gle=YD(Yh,Cnt),Xle=YD($l,GD),Yle=YD(Ma,XD),Rz=J("editorMarkerNavigationError.background",{dark:Gle,light:Gle,hcDark:Ln,hcLight:Ln},C("editorMarkerNavigationError","Editor marker navigation widget error color.")),Abt=J("editorMarkerNavigationError.headerBackground",{dark:St(Rz,.1),light:St(Rz,.1),hcDark:null,hcLight:null},C("editorMarkerNavigationErrorHeaderBackground","Editor marker navigation widget error heading background.")),IM=J("editorMarkerNavigationWarning.background",{dark:Xle,light:Xle,hcDark:Ln,hcLight:Ln},C("editorMarkerNavigationWarning","Editor marker navigation widget warning color.")),Pbt=J("editorMarkerNavigationWarning.headerBackground",{dark:St(IM,.1),light:St(IM,.1),hcDark:"#0C141F",hcLight:St(IM,.2)},C("editorMarkerNavigationWarningBackground","Editor marker navigation widget warning heading background.")),Mz=J("editorMarkerNavigationInfo.background",{dark:Yle,light:Yle,hcDark:Ln,hcLight:Ln},C("editorMarkerNavigationInfo","Editor marker navigation widget info color.")),Obt=J("editorMarkerNavigationInfo.headerBackground",{dark:St(Mz,.1),light:St(Mz,.1),hcDark:null,hcLight:null},C("editorMarkerNavigationInfoHeaderBackground","Editor marker navigation widget info heading background.")),Fbt=J("editorMarkerNavigation.background",{dark:mr,light:mr,hcDark:mr,hcLight:mr},C("editorMarkerNavigationBackground","Editor marker navigation widget background."));var Bbt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Q2=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},wwe=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},PL;let Bv=PL=class{static get(e){return e.getContribution(PL.ID)}constructor(e,t,n,o,r){this._markerNavigationService=t,this._contextKeyService=n,this._editorService=o,this._instantiationService=r,this._sessionDispoables=new Be,this._editor=e,this._widgetVisible=Swe.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(zw,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(n=>{var o,r,s;(!(!((o=this._model)===null||o===void 0)&&o.selected)||!V.containsPosition((r=this._model)===null||r===void 0?void 0:r.selected.marker,n.position))&&((s=this._model)===null||s===void 0||s.resetIndex())})),this._sessionDispoables.add(this._model.onDidChange(()=>{if(!this._widget||!this._widget.position||!this._model)return;const n=this._model.find(this._editor.getModel().uri,this._widget.position);n?this._widget.updateMarker(n.marker):this._widget.showStale()})),this._sessionDispoables.add(this._widget.onDidSelectRelatedInformation(n=>{this._editorService.openCodeEditor({resource:n.resource,options:{pinned:!0,revealIfOpened:!0,selection:V.lift(n).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 ae(e.startLineNumber,e.startColumn)),t.selected&&this._widget.showAtMarker(t.selected.marker,t.selected.index,t.selected.total)}}nagivate(e,t){var n,o;return wwe(this,void 0,void 0,function*(){if(this._editor.hasModel()){const r=this._getOrCreateModel(t?void 0:this._editor.getModel().uri);if(r.move(e,this._editor.getModel(),this._editor.getPosition()),!r.selected)return;if(r.selected.marker.resource.toString()!==this._editor.getModel().uri.toString()){this._cleanUp();const s=yield this._editorService.openCodeEditor({resource:r.selected.marker.resource,options:{pinned:!1,revealIfOpened:!0,selectionRevealType:2,selection:r.selected.marker}},this._editor);s&&((n=PL.get(s))===null||n===void 0||n.close(),(o=PL.get(s))===null||o===void 0||o.nagivate(e,t))}else this._widget.showAtMarker(r.selected.marker,r.selected.index,r.selected.total)}})}};Bv.ID="editor.contrib.markerController";Bv=PL=Bbt([Q2(1,ywe),Q2(2,Ut),Q2(3,Jn),Q2(4,$t)],Bv);class vF extends ft{constructor(e,t,n){super(n),this._next=e,this._multiFile=t}run(e,t){var n;return wwe(this,void 0,void 0,function*(){t.hasModel()&&((n=Bv.get(t))===null||n===void 0||n.nagivate(this._next,this._multiFile))})}}class ov extends vF{constructor(){super(!0,!1,{id:ov.ID,label:ov.LABEL,alias:"Go to Next Problem (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:Q.focus,primary:578,weight:100},menuOpts:{menuId:zw.TitleMenu,title:ov.LABEL,icon:Eo("marker-navigation-next",Xe.arrowDown,C("nextMarkerIcon","Icon for goto next marker.")),group:"navigation",order:1}})}}ov.ID="editor.action.marker.next";ov.LABEL=C("markerAction.next.label","Go to Next Problem (Error, Warning, Info)");class A0 extends vF{constructor(){super(!1,!1,{id:A0.ID,label:A0.LABEL,alias:"Go to Previous Problem (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:Q.focus,primary:1602,weight:100},menuOpts:{menuId:zw.TitleMenu,title:A0.LABEL,icon:Eo("marker-navigation-previous",Xe.arrowUp,C("previousMarkerIcon","Icon for goto previous marker.")),group:"navigation",order:2}})}}A0.ID="editor.action.marker.prev";A0.LABEL=C("markerAction.previous.label","Go to Previous Problem (Error, Warning, Info)");class Wbt extends vF{constructor(){super(!0,!0,{id:"editor.action.marker.nextInFiles",label:C("markerAction.nextInFiles.label","Go to Next Problem in Files (Error, Warning, Info)"),alias:"Go to Next Problem in Files (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:Q.focus,primary:66,weight:100},menuOpts:{menuId:Z.MenubarGoMenu,title:C({key:"miGotoNextProblem",comment:["&& denotes a mnemonic"]},"Next &&Problem"),group:"6_problem_nav",order:1}})}}class Vbt extends vF{constructor(){super(!1,!0,{id:"editor.action.marker.prevInFiles",label:C("markerAction.previousInFiles.label","Go to Previous Problem in Files (Error, Warning, Info)"),alias:"Go to Previous Problem in Files (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:Q.focus,primary:1090,weight:100},menuOpts:{menuId:Z.MenubarGoMenu,title:C({key:"miGotoPreviousProblem",comment:["&& denotes a mnemonic"]},"Previous &&Problem"),group:"6_problem_nav",order:2}})}}zn(Bv.ID,Bv,4);ze(ov);ze(A0);ze(Wbt);ze(Vbt);const Swe=new lt("markersNavigationVisible",!1),Hbt=Ir.bindToContribution(Bv.get);Ye(new Hbt({id:"closeMarkersNavigation",precondition:Swe,handler:i=>i.close(),kbOpts:{weight:100+50,kbExpr:Q.focus,primary:9,secondary:[1033]}}));var $bt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},s7=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const du=He;class zbt{constructor(e,t,n){this.owner=e,this.range=t,this.marker=n}isValidForHoverAnchor(e){return e.type===1&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}const Zle={type:1,filter:{include:Wt.QuickFix},triggerAction:fl.QuickFixHover};let Az=class{constructor(e,t,n,o){this._editor=e,this._markerDecorationsService=t,this._openerService=n,this._languageFeaturesService=o,this.hoverOrdinal=1,this.recentMarkerCodeActionsInfo=void 0}computeSync(e,t){if(!this._editor.hasModel()||e.type!==1&&!e.supportsMarkerHover)return[];const n=this._editor.getModel(),o=e.range.startLineNumber,r=n.getLineMaxColumn(o),s=[];for(const a of t){const l=a.range.startLineNumber===o?a.range.startColumn:1,c=a.range.endLineNumber===o?a.range.endColumn:r,u=this._markerDecorationsService.getMarker(n.uri,a);if(!u)continue;const d=new V(e.range.startLineNumber,l,e.range.startLineNumber,c);s.push(new zbt(this,d,u))}return s}renderHoverParts(e,t){if(!t.length)return _e.None;const n=new Be;t.forEach(r=>e.fragment.appendChild(this.renderMarkerHover(r,n)));const o=t.length===1?t[0]:t.sort((r,s)=>ao.compare(r.marker.severity,s.marker.severity))[0];return this.renderMarkerStatusbar(e,o,n),n}renderMarkerHover(e,t){const n=du("div.hover-row"),o=Ae(n,du("div.marker.hover-contents")),{source:r,message:s,code:a,relatedInformation:l}=e.marker;this._editor.applyFontInfo(o);const c=Ae(o,du("span"));if(c.style.whiteSpace="pre-wrap",c.innerText=s,r||a)if(a&&typeof a!="string"){const u=du("span");if(r){const g=Ae(u,du("span"));g.innerText=r}const d=Ae(u,du("a.code-link"));d.setAttribute("href",a.target.toString()),t.add(ke(d,"click",g=>{this._openerService.open(a.target,{allowCommands:!0}),g.preventDefault(),g.stopPropagation()}));const h=Ae(d,du("span"));h.innerText=a.value;const f=Ae(o,u);f.style.opacity="0.6",f.style.paddingLeft="6px"}else{const u=Ae(o,du("span"));u.style.opacity="0.6",u.style.paddingLeft="6px",u.innerText=r&&a?`${r}(${a})`:r||`(${a})`}if(ws(l))for(const{message:u,resource:d,startLineNumber:h,startColumn:f}of l){const g=Ae(o,du("div"));g.style.marginTop="8px";const p=Ae(g,du("a"));p.innerText=`${$c(d)}(${h}, ${f}): `,p.style.cursor="pointer",t.add(ke(p,"click",m=>{m.stopPropagation(),m.preventDefault(),this._openerService&&this._openerService.open(d,{fromUserGesture:!0,editorOptions:{selection:{startLineNumber:h,startColumn:f}}}).catch(en)}));const v=Ae(g,du("span"));v.innerText=u,this._editor.applyFontInfo(v)}return n}renderMarkerStatusbar(e,t,n){if((t.marker.severity===ao.Error||t.marker.severity===ao.Warning||t.marker.severity===ao.Info)&&e.statusBar.addAction({label:C("view problem","View Problem"),commandId:ov.ID,run:()=>{var o;e.hide(),(o=Bv.get(this._editor))===null||o===void 0||o.showAtMarker(t.marker),this._editor.focus()}}),!this._editor.getOption(90)){const o=e.statusBar.append(du("div"));this.recentMarkerCodeActionsInfo&&(HP.makeKey(this.recentMarkerCodeActionsInfo.marker)===HP.makeKey(t.marker)?this.recentMarkerCodeActionsInfo.hasCodeActions||(o.textContent=C("noQuickFixes","No quick fixes available")):this.recentMarkerCodeActionsInfo=void 0);const r=this.recentMarkerCodeActionsInfo&&!this.recentMarkerCodeActionsInfo.hasCodeActions?_e.None:n.add(Sv(()=>o.textContent=C("checkingForQuickFixes","Checking for quick fixes..."),200));o.textContent||(o.textContent=String.fromCharCode(160));const s=this.getCodeActions(t.marker);n.add(zt(()=>s.cancel())),s.then(a=>{if(r.dispose(),this.recentMarkerCodeActionsInfo={marker:t.marker,hasCodeActions:a.validActions.length>0},!this.recentMarkerCodeActionsInfo.hasCodeActions){a.dispose(),o.textContent=C("noQuickFixes","No quick fixes available");return}o.style.display="none";let l=!1;n.add(zt(()=>{l||a.dispose()})),e.statusBar.addAction({label:C("quick fixes","Quick Fix..."),commandId:oY,run:c=>{l=!0;const u=Mv.get(this._editor),d=Yo(c);e.hide(),u==null||u.showCodeActions(Zle,a,{x:d.left,y:d.top,width:d.width,height:d.height})}})},en)}}getCodeActions(e){return sr(t=>TE(this._languageFeaturesService.codeActionProvider,this._editor.getModel(),new V(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn),Zle,Gg.None,t))}};Az=$bt([s7(1,bG),s7(2,ml),s7(3,pt)],Az);const xwe="editor.action.inlineSuggest.commit",Lwe="editor.action.inlineSuggest.showPrevious",Ewe="editor.action.inlineSuggest.showNext";var Ubt=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};class jbt extends _e{constructor(e,t,n={orientation:0}){super(),this.submenuActionViewItems=[],this.hasSecondaryActions=!1,this._onDidChangeDropdownVisibility=this._register(new MYe),this.onDidChangeDropdownVisibility=this._onDidChangeDropdownVisibility.event,this.disposables=this._register(new Be),this.options=n,this.lookupKeybindings=typeof this.options.getKeyBinding=="function",this.toggleMenuAction=this._register(new Fk(()=>{var o;return(o=this.toggleMenuActionViewItem)===null||o===void 0?void 0:o.show()},n.toggleMenuTitle)),this.element=document.createElement("div"),this.element.className="monaco-toolbar",e.appendChild(this.element),this.actionBar=this._register(new zc(this.element,{orientation:n.orientation,ariaLabel:n.ariaLabel,actionRunner:n.actionRunner,allowContextMenu:n.allowContextMenu,highlightToggledItems:n.highlightToggledItems,actionViewItemProvider:(o,r)=>{var s;if(o.id===Fk.ID)return this.toggleMenuActionViewItem=new AP(o,o.menuActions,t,{actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,keybindingProvider:this.options.getKeyBinding,classNames:Mt.asClassNameArray((s=n.moreIcon)!==null&&s!==void 0?s:Xe.toolBarMore),anchorAlignmentProvider:this.options.anchorAlignmentProvider,menuAsChild:!!this.options.renderDropdownAsChildElement,skipTelemetry:this.options.skipTelemetry}),this.toggleMenuActionViewItem.setActionContext(this.actionBar.context),this.disposables.add(this._onDidChangeDropdownVisibility.add(this.toggleMenuActionViewItem.onDidChangeVisibility)),this.toggleMenuActionViewItem;if(n.actionViewItemProvider){const a=n.actionViewItemProvider(o,r);if(a)return a}if(o instanceof mw){const a=new AP(o,o.actions,t,{actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,keybindingProvider:this.options.getKeyBinding,classNames:o.class,anchorAlignmentProvider:this.options.anchorAlignmentProvider,menuAsChild:!!this.options.renderDropdownAsChildElement,skipTelemetry:this.options.skipTelemetry});return a.setActionContext(this.actionBar.context),this.submenuActionViewItems.push(a),this.disposables.add(this._onDidChangeDropdownVisibility.add(a.onDidChangeVisibility)),a}}}))}set actionRunner(e){this.actionBar.actionRunner=e}get actionRunner(){return this.actionBar.actionRunner}getElement(){return this.element}getItemAction(e){return this.actionBar.getAction(e)}setActions(e,t){this.clear();const n=e?e.slice(0):[];this.hasSecondaryActions=!!(t&&t.length>0),this.hasSecondaryActions&&t&&(this.toggleMenuAction.menuActions=t.slice(0),n.push(this.toggleMenuAction)),n.forEach(o=>{this.actionBar.push(o,{icon:!0,label:!1,keybinding:this.getKeybindingLabel(o)})})}getKeybindingLabel(e){var t,n,o;const r=this.lookupKeybindings?(n=(t=this.options).getKeyBinding)===null||n===void 0?void 0:n.call(t,e):void 0;return(o=r==null?void 0:r.getLabel())!==null&&o!==void 0?o:void 0}clear(){this.submenuActionViewItems=[],this.disposables.clear(),this.actionBar.clear()}dispose(){this.clear(),this.disposables.dispose(),super.dispose()}}class Fk extends ca{constructor(e,t){t=t||C("moreActions","More Actions..."),super(Fk.ID,t,void 0,!0),this._menuActions=[],this.toggleDropdownMenu=e}run(){return Ubt(this,void 0,void 0,function*(){this.toggleDropdownMenu()})}get menuActions(){return this._menuActions}set menuActions(e){this._menuActions=e}}Fk.ID="toolbar.toggle.more";var Kbt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Qx=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let Pz=class extends jbt{constructor(e,t,n,o,r,s,a){super(e,r,Object.assign(Object.assign({getKeyBinding:c=>{var u;return(u=s.lookupKeybinding(c.id))!==null&&u!==void 0?u:void 0}},t),{allowContextMenu:!0,skipTelemetry:typeof(t==null?void 0:t.telemetrySource)=="string"})),this._options=t,this._menuService=n,this._contextKeyService=o,this._contextMenuService=r,this._sessionDisposables=this._store.add(new Be);const l=t==null?void 0:t.telemetrySource;l&&this._store.add(this.actionBar.onDidRun(c=>a.publicLog2("workbenchActionExecuted",{id:c.action.id,from:l})))}setActions(e,t=[],n){var o,r,s;this._sessionDisposables.clear();const a=e.slice(),l=t.slice(),c=[];let u=0;const d=[];let h=!1;if(((o=this._options)===null||o===void 0?void 0:o.hiddenItemStrategy)!==-1)for(let f=0;fv==null?void 0:v.id)),g=this._options.overflowBehavior.maxItems-f.size;let p=0;for(let v=0;v=g&&(a[v]=void 0,d[v]=m))}}toe(a),toe(d),super.setActions(a,kr.join(d,l)),c.length>0&&this._sessionDisposables.add(ke(this.getElement(),"contextmenu",f=>{var g,p,v,m,_;const y=new kc(f),w=this.getItemAction(y.target);if(!w)return;y.preventDefault(),y.stopPropagation();let L=!1;if(u===1&&((g=this._options)===null||g===void 0?void 0:g.hiddenItemStrategy)===0){L=!0;for(let I=0;Ithis._menuService.resetHiddenStates(n)}))),this._contextMenuService.showContextMenu({getAnchor:()=>y,getActions:()=>E,menuId:(v=this._options)===null||v===void 0?void 0:v.contextMenu,menuActionOptions:Object.assign({renderShortTitle:!0},(m=this._options)===null||m===void 0?void 0:m.menuOptions),skipTelemetry:typeof((_=this._options)===null||_===void 0?void 0:_.telemetrySource)=="string",contextKeyService:this._contextKeyService})}))}};Pz=Kbt([Qx(2,If),Qx(3,Ut),Qx(4,Ku),Qx(5,xi),Qx(6,tc)],Pz);var mY=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},kd=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},TM;let Oz=class extends _e{constructor(e,t,n){super(),this.editor=e,this.model=t,this.instantiationService=n,this.alwaysShowToolbar=$r(this.editor.onDidChangeConfiguration,()=>this.editor.getOption(62).showToolbar==="always"),this.sessionPosition=void 0,this.position=In(this,o=>{var r,s,a;const l=(r=this.model.read(o))===null||r===void 0?void 0:r.ghostText.read(o);if(!this.alwaysShowToolbar.read(o)||!l||l.parts.length===0)return this.sessionPosition=void 0,null;const c=l.parts[0].column;this.sessionPosition&&this.sessionPosition.lineNumber!==l.lineNumber&&(this.sessionPosition=void 0);const u=new ae(l.lineNumber,Math.min(c,(a=(s=this.sessionPosition)===null||s===void 0?void 0:s.column)!==null&&a!==void 0?a:Number.MAX_SAFE_INTEGER));return this.sessionPosition=u,u}),this._register(Ja((o,r)=>{const s=this.model.read(o);if(!s||!this.alwaysShowToolbar.read(o))return;const a=r.add(this.instantiationService.createInstance(Wv,this.editor,!0,this.position,s.selectedInlineCompletionIndex,s.inlineCompletionsCount,s.selectedInlineCompletion.map(l=>{var c;return(c=l==null?void 0:l.inlineCompletion.source.inlineCompletions.commands)!==null&&c!==void 0?c:[]})));e.addContentWidget(a),r.add(zt(()=>e.removeContentWidget(a))),r.add(Ii(l=>{!this.position.read(l)||s.lastTriggerKind.read(l)!==jg.Explicit&&s.triggerExplicitly()}))}))}};Oz=mY([kd(2,$t)],Oz);const qbt=Eo("inline-suggestion-hints-next",Xe.chevronRight,C("parameterHintsNextIcon","Icon for show next parameter hint.")),Gbt=Eo("inline-suggestion-hints-previous",Xe.chevronLeft,C("parameterHintsPreviousIcon","Icon for show previous parameter hint."));let Wv=TM=class extends _e{static get dropDownVisible(){return this._dropDownVisible}createCommandAction(e,t,n){const o=new ca(e,t,n,!0,()=>this._commandService.executeCommand(e)),r=this.keybindingService.lookupKeybinding(e,this._contextKeyService);let s=t;return r&&(s=C({key:"content",comment:["A label","A keybinding"]},"{0} ({1})",t,r.getLabel())),o.tooltip=s,o}constructor(e,t,n,o,r,s,a,l,c,u,d){super(),this.editor=e,this.withBorder=t,this._position=n,this._currentSuggestionIdx=o,this._suggestionCount=r,this._extraCommands=s,this._commandService=a,this.keybindingService=c,this._contextKeyService=u,this._menuService=d,this.id=`InlineSuggestionHintsContentWidget${TM.id++}`,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this.nodes=Or("div.inlineSuggestionsHints",{className:this.withBorder?".withBorder":""},[Or("div@toolBar")]),this.previousAction=this.createCommandAction(Lwe,C("previous","Previous"),Mt.asClassName(Gbt)),this.availableSuggestionCountAction=new ca("inlineSuggestionHints.availableSuggestionCount","",void 0,!1),this.nextAction=this.createCommandAction(Ewe,C("next","Next"),Mt.asClassName(qbt)),this.inlineCompletionsActionsMenus=this._register(this._menuService.createMenu(Z.InlineCompletionsActions,this._contextKeyService)),this.clearAvailableSuggestionCountLabelDebounced=this._register(new bi(()=>{this.availableSuggestionCountAction.label=""},100)),this.disableButtonsDebounced=this._register(new bi(()=>{this.previousAction.enabled=this.nextAction.enabled=!1},100)),this.lastCommands=[],this.toolBar=this._register(l.createInstance(Fz,this.nodes.toolBar,Z.InlineSuggestionToolbar,{menuOptions:{renderShortTitle:!0},toolbarOptions:{primaryGroup:h=>h.startsWith("primary")},actionViewItemProvider:(h,f)=>{if(h instanceof Fu)return l.createInstance(Ybt,h,void 0);if(h===this.availableSuggestionCountAction){const g=new Xbt(void 0,h,{label:!0,icon:!1});return g.setClass("availableSuggestionCount"),g}},telemetrySource:"InlineSuggestionToolbar"})),this.toolBar.setPrependedPrimaryActions([this.previousAction,this.availableSuggestionCountAction,this.nextAction]),this._register(this.toolBar.onDidChangeDropdownVisibility(h=>{TM._dropDownVisible=h})),this._register(Ii(h=>{this._position.read(h),this.editor.layoutContentWidget(this)})),this._register(Ii(h=>{const f=this._suggestionCount.read(h),g=this._currentSuggestionIdx.read(h);f!==void 0?(this.clearAvailableSuggestionCountLabelDebounced.cancel(),this.availableSuggestionCountAction.label=`${g+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(Ii(h=>{const f=this._extraCommands.read(h);if(Lo(this.lastCommands,f))return;this.lastCommands=f;const g=f.map(p=>({class:void 0,id:p.id,enabled:!0,tooltip:p.tooltip||"",label:p.title,run:v=>this._commandService.executeCommand(p.id)}));for(const[p,v]of this.inlineCompletionsActionsMenus.getActions())for(const m of v)m instanceof Fu&&g.push(m);g.length>0&&g.unshift(new kr),this.toolBar.setAdditionalSecondaryActions(g)}))}getId(){return this.id}getDomNode(){return this.nodes.root}getPosition(){return{position:this._position.get(),preference:[1,2],positionAffinity:3}}};Wv._dropDownVisible=!1;Wv.id=0;Wv=TM=mY([kd(6,_o),kd(7,$t),kd(8,xi),kd(9,Ut),kd(10,If)],Wv);class Xbt extends Aw{constructor(){super(...arguments),this._className=void 0}setClass(e){this._className=e}render(e){super.render(e),this._className&&e.classList.add(this._className)}}class Ybt extends rb{updateLabel(){const e=this._keybindingService.lookupKeybinding(this._action.id,this._contextKeyService);if(!e)return super.updateLabel();if(this.label){const t=Or("div.keybinding").root;new aT(t,Vl,Object.assign({disableTitle:!0},wft)).set(e),this.label.textContent=this._action.label,this.label.appendChild(t),this.label.classList.add("inlineSuggestionStatusBarItemLabel")}}}let Fz=class extends Pz{constructor(e,t,n,o,r,s,a,l){super(e,Object.assign({resetMenu:t},n),o,r,s,a,l),this.menuId=t,this.options2=n,this.menuService=o,this.contextKeyService=r,this.menu=this._store.add(this.menuService.createMenu(this.menuId,this.contextKeyService,{emitEventsForSubmenuChanges:!0})),this.additionalActions=[],this.prependedPrimaryActions=[],this._store.add(this.menu.onDidChange(()=>this.updateToolbar())),this.updateToolbar()}updateToolbar(){var e,t,n,o,r,s,a;const l=[],c=[];X1e(this.menu,(e=this.options2)===null||e===void 0?void 0:e.menuOptions,{primary:l,secondary:c},(n=(t=this.options2)===null||t===void 0?void 0:t.toolbarOptions)===null||n===void 0?void 0:n.primaryGroup,(r=(o=this.options2)===null||o===void 0?void 0:o.toolbarOptions)===null||r===void 0?void 0:r.shouldInlineSubmenu,(a=(s=this.options2)===null||s===void 0?void 0:s.toolbarOptions)===null||a===void 0?void 0:a.useSeparatorsInPrimaryActions),c.push(...this.additionalActions),l.unshift(...this.prependedPrimaryActions),this.setActions(l,c)}setPrependedPrimaryActions(e){Lo(this.prependedPrimaryActions,e,(t,n)=>t===n)||(this.prependedPrimaryActions=e,this.updateToolbar())}setAdditionalSecondaryActions(e){Lo(this.additionalActions,e,(t,n)=>t===n)||(this.additionalActions=e,this.updateToolbar())}};Fz=mY([kd(3,If),kd(4,Ut),kd(5,Ku),kd(6,xi),kd(7,tc)],Fz);var Zbt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},J2=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},Bz;const Qbt=!1;let $a=Bz=class extends _e{static get(e){return e.getContribution(Bz.ID)}constructor(e,t,n,o,r){super(),this._editor=e,this._instantiationService=t,this._openerService=n,this._languageService=o,this._keybindingService=r,this._toUnhook=new Be,this._hoverActivatedByColorDecoratorClick=!1,this._isMouseDown=!1,this._hoverClicked=!1,this._contentWidget=null,this._glyphWidget=null,this._reactToEditorMouseMoveRunner=this._register(new bi(()=>this._reactToEditorMouseMove(this._mouseMoveEvent),0)),this._hookEvents(),this._register(this._editor.onDidChangeConfiguration(s=>{s.hasChanged(60)&&(this._unhookEvents(),this._hookEvents())})),this._register(this._editor.onMouseLeave(()=>{this._mouseMoveEvent=void 0,this._reactToEditorMouseMoveRunner.cancel()}))}_hookEvents(){const e=()=>this._hideWidgets(),t=this._editor.getOption(60);this._isHoverEnabled=t.enabled,this._isHoverSticky=t.sticky,this._hidingDelay=t.hidingDelay,this._isHoverEnabled?(this._toUnhook.add(this._editor.onMouseDown(n=>this._onEditorMouseDown(n))),this._toUnhook.add(this._editor.onMouseUp(n=>this._onEditorMouseUp(n))),this._toUnhook.add(this._editor.onMouseMove(n=>this._onEditorMouseMove(n))),this._toUnhook.add(this._editor.onKeyDown(n=>this._onKeyDown(n)))):(this._toUnhook.add(this._editor.onMouseMove(n=>this._onEditorMouseMove(n))),this._toUnhook.add(this._editor.onKeyDown(n=>this._onKeyDown(n)))),this._toUnhook.add(this._editor.onMouseLeave(n=>this._onEditorMouseLeave(n))),this._toUnhook.add(this._editor.onDidChangeModel(e)),this._toUnhook.add(this._editor.onDidScrollChange(n=>this._onEditorScrollChanged(n)))}_unhookEvents(){this._toUnhook.clear()}_onEditorScrollChanged(e){(e.scrollTopChanged||e.scrollLeftChanged)&&this._hideWidgets()}_onEditorMouseDown(e){var t;this._isMouseDown=!0;const n=e.target;if(n.type===9&&n.detail===iv.ID){this._hoverClicked=!0;return}n.type===12&&n.detail===By.ID||(n.type!==12&&(this._hoverClicked=!1),!((t=this._contentWidget)===null||t===void 0)&&t.widget.isResizing||this._hideWidgets())}_onEditorMouseUp(e){this._isMouseDown=!1}_onEditorMouseLeave(e){var t,n;const o=e.event.browserEvent.relatedTarget;((t=this._contentWidget)===null||t===void 0?void 0:t.widget.isResizing)||((n=this._contentWidget)===null||n===void 0?void 0:n.containsNode(o))||this._hideWidgets()}_isMouseOverWidget(e){var t,n,o,r,s;const a=e.target;return!!(this._isHoverSticky&&a.type===9&&a.detail===iv.ID||this._isHoverSticky&&((t=this._contentWidget)===null||t===void 0?void 0:t.containsNode((n=e.event.browserEvent.view)===null||n===void 0?void 0:n.document.activeElement))&&!(!((r=(o=e.event.browserEvent.view)===null||o===void 0?void 0:o.getSelection())===null||r===void 0)&&r.isCollapsed)||!this._isHoverSticky&&a.type===9&&a.detail===iv.ID&&((s=this._contentWidget)===null||s===void 0?void 0:s.isColorPickerVisible)||this._isHoverSticky&&a.type===12&&a.detail===By.ID)}_onEditorMouseMove(e){var t,n,o,r;if(this._mouseMoveEvent=e,((t=this._contentWidget)===null||t===void 0?void 0:t.isFocused)||((n=this._contentWidget)===null||n===void 0?void 0:n.isResizing)||this._isMouseDown&&this._hoverClicked||this._isHoverSticky&&((o=this._contentWidget)===null||o===void 0?void 0:o.isVisibleFromKeyboard))return;if(this._isMouseOverWidget(e)){this._reactToEditorMouseMoveRunner.cancel();return}if(((r=this._contentWidget)===null||r===void 0?void 0:r.isVisible)&&this._isHoverSticky&&this._hidingDelay>0){this._reactToEditorMouseMoveRunner.isScheduled()||this._reactToEditorMouseMoveRunner.schedule(this._hidingDelay);return}this._reactToEditorMouseMove(e)}_reactToEditorMouseMove(e){var t,n,o;if(!e)return;const r=e.target,s=(t=r.element)===null||t===void 0?void 0:t.classList.contains("colorpicker-color-decoration"),a=this._editor.getOption(146);if(s&&(a==="click"&&!this._hoverActivatedByColorDecoratorClick||a==="hover"&&!this._isHoverEnabled&&!Qbt||a==="clickAndHover"&&!this._isHoverEnabled&&!this._hoverActivatedByColorDecoratorClick)||!s&&!this._isHoverEnabled&&!this._hoverActivatedByColorDecoratorClick){this._hideWidgets();return}if(this._getOrCreateContentWidget().maybeShowAt(e)){(n=this._glyphWidget)===null||n===void 0||n.hide();return}if(r.type===2&&r.position){(o=this._contentWidget)===null||o===void 0||o.hide(),this._glyphWidget||(this._glyphWidget=new By(this._editor,this._languageService,this._openerService)),this._glyphWidget.startShowingAt(r.position.lineNumber);return}this._hideWidgets()}_onKeyDown(e){var t;if(!this._editor.hasModel())return;const n=this._keybindingService.softDispatch(e,this._editor.getDomNode()),o=n.kind===1||n.kind===2&&n.commandId==="editor.action.showHover"&&((t=this._contentWidget)===null||t===void 0?void 0:t.isVisible);e.keyCode!==5&&e.keyCode!==6&&e.keyCode!==57&&e.keyCode!==4&&!o&&this._hideWidgets()}_hideWidgets(){var e,t,n;this._isMouseDown&&this._hoverClicked&&((e=this._contentWidget)===null||e===void 0?void 0:e.isColorPickerVisible)||Wv.dropDownVisible||(this._hoverActivatedByColorDecoratorClick=!1,this._hoverClicked=!1,(t=this._glyphWidget)===null||t===void 0||t.hide(),(n=this._contentWidget)===null||n===void 0||n.hide())}_getOrCreateContentWidget(){return this._contentWidget||(this._contentWidget=this._instantiationService.createInstance(hO,this._editor)),this._contentWidget}showContentHover(e,t,n,o,r=!1){this._hoverActivatedByColorDecoratorClick=r,this._getOrCreateContentWidget().startShowingAtRange(e,t,n,o)}focus(){var e;(e=this._contentWidget)===null||e===void 0||e.focus()}scrollUp(){var e;(e=this._contentWidget)===null||e===void 0||e.scrollUp()}scrollDown(){var e;(e=this._contentWidget)===null||e===void 0||e.scrollDown()}scrollLeft(){var e;(e=this._contentWidget)===null||e===void 0||e.scrollLeft()}scrollRight(){var e;(e=this._contentWidget)===null||e===void 0||e.scrollRight()}pageUp(){var e;(e=this._contentWidget)===null||e===void 0||e.pageUp()}pageDown(){var e;(e=this._contentWidget)===null||e===void 0||e.pageDown()}goToTop(){var e;(e=this._contentWidget)===null||e===void 0||e.goToTop()}goToBottom(){var e;(e=this._contentWidget)===null||e===void 0||e.goToBottom()}get isColorPickerVisible(){var e;return(e=this._contentWidget)===null||e===void 0?void 0:e.isColorPickerVisible}get isHoverVisible(){var e;return(e=this._contentWidget)===null||e===void 0?void 0:e.isVisible}dispose(){var e,t;super.dispose(),this._unhookEvents(),this._toUnhook.dispose(),(e=this._glyphWidget)===null||e===void 0||e.dispose(),(t=this._contentWidget)===null||t===void 0||t.dispose()}};$a.ID="editor.contrib.hover";$a=Bz=Zbt([J2(1,$t),J2(2,ml),J2(3,Ki),J2(4,xi)],$a);class Jbt extends ft{constructor(){super({id:"editor.action.showHover",label:C({key:"showOrFocusHover",comment:["Label for action that will trigger the showing/focusing of a hover in the editor.","If the hover is not visible, it will show the hover.","This allows for users to show the hover without using the mouse.","If the hover is already visible, it will take focus."]},"Show or Focus Hover"),description:{description:"Show or Focus Hover",args:[{name:"args",schema:{type:"object",properties:{focus:{description:"Controls if when triggered with the keyboard, the hover should take focus immediately.",type:"boolean",default:!1}}}}]},alias:"Show or Focus Hover",precondition:void 0,kbOpts:{kbExpr:Q.editorTextFocus,primary:Zo(2089,2087),weight:100}})}run(e,t,n){if(!t.hasModel())return;const o=$a.get(t);if(!o)return;const r=t.getPosition(),s=new V(r.lineNumber,r.column,r.lineNumber,r.column),a=t.getOption(2)===2||!!(n!=null&&n.focus);o.isHoverVisible?o.focus():o.showContentHover(s,1,1,a)}}class e1t extends ft{constructor(){super({id:"editor.action.showDefinitionPreviewHover",label:C({key:"showDefinitionPreviewHover",comment:["Label for action that will trigger the showing of definition preview hover in the editor.","This allows for users to show the definition preview hover without using the mouse."]},"Show Definition Preview Hover"),alias:"Show Definition Preview Hover",precondition:void 0})}run(e,t){const n=$a.get(t);if(!n)return;const o=t.getPosition();if(!o)return;const r=new V(o.lineNumber,o.column,o.lineNumber,o.column),s=pb.get(t);if(!s)return;s.startFindDefinitionFromCursor(o).then(()=>{n.showContentHover(r,1,1,!0)})}}class t1t extends ft{constructor(){super({id:"editor.action.scrollUpHover",label:C({key:"scrollUpHover",comment:["Action that allows to scroll up in the hover widget with the up arrow when the hover widget is focused."]},"Scroll Up Hover"),alias:"Scroll Up Hover",precondition:Q.hoverFocused,kbOpts:{kbExpr:Q.hoverFocused,primary:16,weight:100}})}run(e,t){const n=$a.get(t);!n||n.scrollUp()}}class n1t extends ft{constructor(){super({id:"editor.action.scrollDownHover",label:C({key:"scrollDownHover",comment:["Action that allows to scroll down in the hover widget with the up arrow when the hover widget is focused."]},"Scroll Down Hover"),alias:"Scroll Down Hover",precondition:Q.hoverFocused,kbOpts:{kbExpr:Q.hoverFocused,primary:18,weight:100}})}run(e,t){const n=$a.get(t);!n||n.scrollDown()}}class i1t extends ft{constructor(){super({id:"editor.action.scrollLeftHover",label:C({key:"scrollLeftHover",comment:["Action that allows to scroll left in the hover widget with the left arrow when the hover widget is focused."]},"Scroll Left Hover"),alias:"Scroll Left Hover",precondition:Q.hoverFocused,kbOpts:{kbExpr:Q.hoverFocused,primary:15,weight:100}})}run(e,t){const n=$a.get(t);!n||n.scrollLeft()}}class o1t extends ft{constructor(){super({id:"editor.action.scrollRightHover",label:C({key:"scrollRightHover",comment:["Action that allows to scroll right in the hover widget with the right arrow when the hover widget is focused."]},"Scroll Right Hover"),alias:"Scroll Right Hover",precondition:Q.hoverFocused,kbOpts:{kbExpr:Q.hoverFocused,primary:17,weight:100}})}run(e,t){const n=$a.get(t);!n||n.scrollRight()}}class r1t extends ft{constructor(){super({id:"editor.action.pageUpHover",label:C({key:"pageUpHover",comment:["Action that allows to page up in the hover widget with the page up command when the hover widget is focused."]},"Page Up Hover"),alias:"Page Up Hover",precondition:Q.hoverFocused,kbOpts:{kbExpr:Q.hoverFocused,primary:11,secondary:[528],weight:100}})}run(e,t){const n=$a.get(t);!n||n.pageUp()}}class s1t extends ft{constructor(){super({id:"editor.action.pageDownHover",label:C({key:"pageDownHover",comment:["Action that allows to page down in the hover widget with the page down command when the hover widget is focused."]},"Page Down Hover"),alias:"Page Down Hover",precondition:Q.hoverFocused,kbOpts:{kbExpr:Q.hoverFocused,primary:12,secondary:[530],weight:100}})}run(e,t){const n=$a.get(t);!n||n.pageDown()}}class a1t extends ft{constructor(){super({id:"editor.action.goToTopHover",label:C({key:"goToTopHover",comment:["Action that allows to go to the top of the hover widget with the home command when the hover widget is focused."]},"Go To Top Hover"),alias:"Go To Bottom Hover",precondition:Q.hoverFocused,kbOpts:{kbExpr:Q.hoverFocused,primary:14,secondary:[2064],weight:100}})}run(e,t){const n=$a.get(t);!n||n.goToTop()}}class l1t extends ft{constructor(){super({id:"editor.action.goToBottomHover",label:C({key:"goToBottomHover",comment:["Action that allows to go to the bottom in the hover widget with the end command when the hover widget is focused."]},"Go To Bottom Hover"),alias:"Go To Bottom Hover",precondition:Q.hoverFocused,kbOpts:{kbExpr:Q.hoverFocused,primary:13,secondary:[2066],weight:100}})}run(e,t){const n=$a.get(t);!n||n.goToBottom()}}zn($a.ID,$a,2);ze(Jbt);ze(e1t);ze(t1t);ze(n1t);ze(i1t);ze(o1t);ze(r1t);ze(s1t);ze(a1t);ze(l1t);e1.register(pO);e1.register(Az);ju((i,e)=>{const t=i.getColor(Pnt);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)}; }`))});class Wz extends _e{constructor(e){super(),this._editor=e,this._register(e.onMouseDown(t=>this.onMouseDown(t)))}dispose(){super.dispose()}onMouseDown(e){const t=this._editor.getOption(146);if(t!=="click"&&t!=="clickAndHover")return;const n=e.target;if(n.type!==6||!n.detail.injectedText||n.detail.injectedText.options.attachedData!==Yye||!n.range)return;const o=this._editor.getContribution($a.ID);if(!!o&&!o.isColorPickerVisible){const r=new V(n.range.startLineNumber,n.range.startColumn+1,n.range.endLineNumber,n.range.endColumn+1);o.showContentHover(r,1,0,!1,!0)}}}Wz.ID="editor.contrib.colorContribution";zn(Wz.ID,Wz,2);e1.register(uO);var Dwe=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Sd=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},Qle=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},Vz,Hz;let Vv=Vz=class extends _e{constructor(e,t,n,o,r,s,a){super(),this._editor=e,this._modelService=n,this._keybindingService=o,this._instantiationService=r,this._languageFeatureService=s,this._languageConfigurationService=a,this._standaloneColorPickerWidget=null,this._standaloneColorPickerVisible=Q.standaloneColorPickerVisible.bindTo(t),this._standaloneColorPickerFocused=Q.standaloneColorPickerFocused.bindTo(t)}showOrFocus(){var e;!this._editor.hasModel()||(this._standaloneColorPickerVisible.get()?this._standaloneColorPickerFocused.get()||(e=this._standaloneColorPickerWidget)===null||e===void 0||e.focus():this._standaloneColorPickerWidget=new vO(this._editor,this._standaloneColorPickerVisible,this._standaloneColorPickerFocused,this._instantiationService,this._modelService,this._keybindingService,this._languageFeatureService,this._languageConfigurationService))}hide(){var e;this._standaloneColorPickerFocused.set(!1),this._standaloneColorPickerVisible.set(!1),(e=this._standaloneColorPickerWidget)===null||e===void 0||e.hide(),this._editor.focus()}insertColor(){var e;(e=this._standaloneColorPickerWidget)===null||e===void 0||e.updateEditor(),this.hide()}static get(e){return e.getContribution(Vz.ID)}};Vv.ID="editor.contrib.standaloneColorPickerController";Vv=Vz=Dwe([Sd(1,Ut),Sd(2,Yi),Sd(3,xi),Sd(4,$t),Sd(5,pt),Sd(6,Ti)],Vv);zn(Vv.ID,Vv,1);const Jle=8,c1t=22;let vO=Hz=class extends _e{constructor(e,t,n,o,r,s,a,l){var c;super(),this._editor=e,this._standaloneColorPickerVisible=t,this._standaloneColorPickerFocused=n,this._modelService=r,this._keybindingService=s,this._languageFeaturesService=a,this._languageConfigurationService=l,this.allowEditorOverflow=!0,this._position=void 0,this._body=document.createElement("div"),this._colorHover=null,this._selectionSetInEditor=!1,this._onResult=this._register(new le),this.onResult=this._onResult.event,this._standaloneColorPickerVisible.set(!0),this._standaloneColorPickerParticipant=o.createInstance(Mk,this._editor),this._position=(c=this._editor._getViewModel())===null||c===void 0?void 0:c.getPrimaryCursorState().modelState.position;const u=this._editor.getSelection(),d=u?{startLineNumber:u.startLineNumber,startColumn:u.startColumn,endLineNumber:u.endLineNumber,endColumn:u.endColumn}:{startLineNumber:0,endLineNumber:0,endColumn:0,startColumn:0},h=this._register(pf(this._body));this._register(h.onDidBlur(f=>{this.hide()})),this._register(h.onDidFocus(f=>{this.focus()})),this._register(this._editor.onDidChangeCursorPosition(()=>{this._selectionSetInEditor?this._selectionSetInEditor=!1:this.hide()})),this._register(this._editor.onMouseMove(f=>{var g;const p=(g=f.target.element)===null||g===void 0?void 0:g.classList;p&&p.contains("colorpicker-color-decoration")&&this.hide()})),this._register(this.onResult(f=>{this._render(f.value,f.foundInEditor)})),this._start(d),this._body.style.zIndex="50",this._editor.addContentWidget(this)}updateEditor(){this._colorHover&&this._standaloneColorPickerParticipant.updateEditorModel(this._colorHover)}getId(){return Hz.ID}getDomNode(){return this._body}getPosition(){if(!this._position)return null;const e=this._editor.getOption(60).above;return{position:this._position,secondaryPosition:this._position,preference:e?[1,2]:[2,1],positionAffinity:2}}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()}_start(e){return Qle(this,void 0,void 0,function*(){const t=yield this._computeAsync(e);!t||this._onResult.fire(new u1t(t.result,t.foundInEditor))})}_computeAsync(e){return Qle(this,void 0,void 0,function*(){if(!this._editor.hasModel())return null;const t={range:e,color:{red:0,green:0,blue:0,alpha:1}},n=yield this._standaloneColorPickerParticipant.createColorHover(t,new lY(this._modelService,this._languageConfigurationService),this._languageFeaturesService.colorProvider);return n?{result:n.colorHover,foundInEditor:n.foundInEditor}:null})}_render(e,t){const n=document.createDocumentFragment(),o=this._register(new fO(this._keybindingService));let r;const s={fragment:n,statusBar:o,setColorPicker:p=>r=p,onContentsChanged:()=>{},hide:()=>this.hide()};if(this._colorHover=e,this._register(this._standaloneColorPickerParticipant.renderHoverParts(s,[e])),r===void 0)return;this._body.classList.add("standalone-colorpicker-body"),this._body.style.maxHeight=Math.max(this._editor.getLayoutInfo().height/4,250)+"px",this._body.style.maxWidth=Math.max(this._editor.getLayoutInfo().width*.66,500)+"px",this._body.tabIndex=0,this._body.appendChild(n),r.layout();const a=r.body,l=a.saturationBox.domNode.clientWidth,c=a.domNode.clientWidth-l-c1t-Jle,u=r.body.enterButton;u==null||u.onClicked(()=>{this.updateEditor(),this.hide()});const d=r.header,h=d.pickedColorNode;h.style.width=l+Jle+"px";const f=d.originalColorNode;f.style.width=c+"px";const g=r.header.closeButton;g==null||g.onClicked(()=>{this.hide()}),t&&(u&&(u.button.textContent="Replace"),this._selectionSetInEditor=!0,this._editor.setSelection(e.range)),this._editor.layoutContentWidget(this)}};vO.ID="editor.contrib.standaloneColorPickerWidget";vO=Hz=Dwe([Sd(3,$t),Sd(4,Yi),Sd(5,xi),Sd(6,pt),Sd(7,Ti)],vO);class u1t{constructor(e,t){this.value=e,this.foundInEditor=t}}class d1t extends lh{constructor(){super({id:"editor.action.showOrFocusStandaloneColorPicker",title:{value:C("showOrFocusStandaloneColorPicker","Show or Focus Standalone Color Picker"),mnemonicTitle:C({key:"mishowOrFocusStandaloneColorPicker",comment:["&& denotes a mnemonic"]},"&&Show or Focus Standalone Color Picker"),original:"Show or Focus Standalone Color Picker"},precondition:void 0,menu:[{id:Z.CommandPalette}]})}runEditorCommand(e,t){var n;(n=Vv.get(t))===null||n===void 0||n.showOrFocus()}}class h1t extends ft{constructor(){super({id:"editor.action.hideColorPicker",label:C({key:"hideColorPicker",comment:["Action that hides the color picker"]},"Hide the Color Picker"),alias:"Hide the Color Picker",precondition:Q.standaloneColorPickerVisible.isEqualTo(!0),kbOpts:{primary:9,weight:100}})}run(e,t){var n;(n=Vv.get(t))===null||n===void 0||n.hide()}}class f1t extends ft{constructor(){super({id:"editor.action.insertColorWithStandaloneColorPicker",label:C({key:"insertColorWithStandaloneColorPicker",comment:["Action that inserts color with standalone color picker"]},"Insert Color with Standalone Color Picker"),alias:"Insert Color with Standalone Color Picker",precondition:Q.standaloneColorPickerFocused.isEqualTo(!0),kbOpts:{primary:3,weight:100}})}run(e,t){var n;(n=Vv.get(t))===null||n===void 0||n.insertColor()}}ze(h1t);ze(f1t);$i(d1t);class Nm{constructor(e,t,n){this.languageConfigurationService=n,this._selection=e,this._insertSpace=t,this._usedEndToken=null}static _haystackHasNeedleAtOffset(e,t,n){if(n<0)return!1;const o=t.length,r=e.length;if(n+o>r)return!1;for(let s=0;s=65&&a<=90&&a+32===l)&&!(l>=65&&l<=90&&l+32===a))return!1}return!0}_createOperationsForBlockComment(e,t,n,o,r,s){const a=e.startLineNumber,l=e.startColumn,c=e.endLineNumber,u=e.endColumn,d=r.getLineContent(a),h=r.getLineContent(c);let f=d.lastIndexOf(t,l-1+t.length),g=h.indexOf(n,u-1-n.length);if(f!==-1&&g!==-1)if(a===c)d.substring(f+t.length,g).indexOf(n)>=0&&(f=-1,g=-1);else{const v=d.substring(f+t.length),m=h.substring(0,g);(v.indexOf(n)>=0||m.indexOf(n)>=0)&&(f=-1,g=-1)}let p;f!==-1&&g!==-1?(o&&f+t.length0&&h.charCodeAt(g-1)===32&&(n=" "+n,g-=1),p=Nm._createRemoveBlockCommentOperations(new V(a,f+t.length+1,c,g+1),t,n)):(p=Nm._createAddBlockCommentOperations(e,t,n,this._insertSpace),this._usedEndToken=p.length===1?n:null);for(const v of p)s.addTrackedEditOperation(v.range,v.text)}static _createRemoveBlockCommentOperations(e,t,n){const o=[];return V.isEmpty(e)?o.push(Gi.delete(new V(e.startLineNumber,e.startColumn-t.length,e.endLineNumber,e.endColumn+n.length))):(o.push(Gi.delete(new V(e.startLineNumber,e.startColumn-t.length,e.startLineNumber,e.startColumn))),o.push(Gi.delete(new V(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn+n.length)))),o}static _createAddBlockCommentOperations(e,t,n,o){const r=[];return V.isEmpty(e)?r.push(Gi.replace(new V(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn),t+" "+n)):(r.push(Gi.insert(new ae(e.startLineNumber,e.startColumn),t+(o?" ":""))),r.push(Gi.insert(new ae(e.endLineNumber,e.endColumn),(o?" ":"")+n))),r}getEditOperations(e,t){const n=this._selection.startLineNumber,o=this._selection.startColumn;e.tokenization.tokenizeIfCheap(n);const r=e.getLanguageIdAtPosition(n,o),s=this.languageConfigurationService.getLanguageConfiguration(r).comments;!s||!s.blockCommentStartToken||!s.blockCommentEndToken||this._createOperationsForBlockComment(this._selection,s.blockCommentStartToken,s.blockCommentEndToken,this._insertSpace,e,t)}computeCursorState(e,t){const n=t.getInverseEditOperations();if(n.length===2){const o=n[0],r=n[1];return new gt(o.range.endLineNumber,o.range.endColumn,r.range.startLineNumber,r.range.startColumn)}else{const o=n[0].range,r=this._usedEndToken?-this._usedEndToken.length-1:0;return new gt(o.endLineNumber,o.endColumn+r,o.endLineNumber,o.endColumn+r)}}}class ug{constructor(e,t,n,o,r,s,a){this.languageConfigurationService=e,this._selection=t,this._tabSize=n,this._type=o,this._insertSpace=r,this._selectionId=null,this._deltaColumn=0,this._moveEndPositionDown=!1,this._ignoreEmptyLines=s,this._ignoreFirstLine=a||!1}static _gatherPreflightCommentStrings(e,t,n,o){e.tokenization.tokenizeIfCheap(t);const r=e.getLanguageIdAtPosition(t,1),s=o.getLanguageConfiguration(r).comments,a=s?s.lineCommentToken:null;if(!a)return null;const l=[];for(let c=0,u=n-t+1;cr?t[l].commentStrOffset=s-1:t[l].commentStrOffset=s}}}class vY extends ft{constructor(e,t){super(t),this._type=e}run(e,t){const n=e.get(Ti);if(!t.hasModel())return;const o=t.getModel(),r=[],s=o.getOptions(),a=t.getOption(23),l=t.getSelections().map((u,d)=>({selection:u,index:d,ignoreFirstLine:!1}));l.sort((u,d)=>V.compareRangesUsingStarts(u.selection,d.selection));let c=l[0];for(let u=1;u=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},y_=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},$z;let Uw=$z=class{static get(e){return e.getContribution($z.ID)}constructor(e,t,n,o,r,s,a,l){this._contextMenuService=t,this._contextViewService=n,this._contextKeyService=o,this._keybindingService=r,this._menuService=s,this._configurationService=a,this._workspaceContextService=l,this._toDispose=new Be,this._contextMenuIsBeingShownCount=0,this._editor=e,this._toDispose.add(this._editor.onContextMenu(c=>this._onContextMenu(c))),this._toDispose.add(this._editor.onMouseWheel(c=>{if(this._contextMenuIsBeingShownCount>0){const u=this._contextViewService.getContextViewElement(),d=c.srcElement;d.shadowRoot&&eb(u)===d.shadowRoot||this._contextViewService.hideContextView()}})),this._toDispose.add(this._editor.onKeyDown(c=>{!this._editor.getOption(24)||c.keyCode===58&&(c.preventDefault(),c.stopPropagation(),this.showContextMenu())}))}_onContextMenu(e){if(!this._editor.hasModel())return;if(!this._editor.getOption(24)){this._editor.focus(),e.target.position&&!this._editor.getSelection().containsPosition(e.target.position)&&this._editor.setPosition(e.target.position);return}if(e.target.type===12||e.target.type===6&&e.target.detail.injectedText)return;if(e.event.preventDefault(),e.event.stopPropagation(),e.target.type===11)return this._showScrollbarContextMenu(e.event);if(e.target.type!==6&&e.target.type!==7&&e.target.type!==1)return;if(this._editor.focus(),e.target.position){let n=!1;for(const o of this._editor.getSelections())if(o.containsPosition(e.target.position)){n=!0;break}n||this._editor.setPosition(e.target.position)}let t=null;e.target.type!==1&&(t=e.event),this.showContextMenu(t)}showContextMenu(e){if(!this._editor.getOption(24)||!this._editor.hasModel())return;const t=this._getMenuActions(this._editor.getModel(),this._editor.isSimpleWidget?Z.SimpleEditorContext:Z.EditorContext);t.length>0&&this._doShowContextMenu(t,e)}_getMenuActions(e,t){const n=[],o=this._menuService.createMenu(t,this._contextKeyService),r=o.getActions({arg:e.uri});o.dispose();for(const s of r){const[,a]=s;let l=0;for(const c of a)if(c instanceof OD){const u=this._getMenuActions(e,c.item.submenu);u.length>0&&(n.push(new mw(c.id,c.label,u)),l++)}else n.push(c),l++;l&&n.push(new kr)}return n.length&&n.pop(),n}_doShowContextMenu(e,t=null){if(!this._editor.hasModel())return;const n=this._editor.getOption(60);this._editor.updateOptions({hover:{enabled:!1}});let o=t;if(!o){this._editor.revealPosition(this._editor.getPosition(),1),this._editor.render();const s=this._editor.getScrolledVisiblePosition(this._editor.getPosition()),a=Yo(this._editor.getDomNode()),l=a.left+s.left,c=a.top+s.top+s.height;o={x:l,y:c}}const r=this._editor.getOption(126)&&!Kd;this._contextMenuIsBeingShownCount++,this._contextMenuService.showContextMenu({domForShadowRoot:r?this._editor.getDomNode():void 0,getAnchor:()=>o,getActions:()=>e,getActionViewItem:s=>{const a=this._keybindingFor(s);if(a)return new Aw(s,s,{label:!0,keybinding:a.getLabel(),isMenu:!0});const l=s;return typeof l.getActionViewItem=="function"?l.getActionViewItem():new Aw(s,s,{icon:!0,label:!0,isMenu:!0})},getKeyBinding:s=>this._keybindingFor(s),onHide:s=>{this._contextMenuIsBeingShownCount--,this._editor.updateOptions({hover:n})}})}_showScrollbarContextMenu(e){if(!this._editor.hasModel()||tut(this._workspaceContextService.getWorkspace()))return;const t=this._editor.getOption(72);let n=0;const o=c=>({id:`menu-action-${++n}`,label:c.label,tooltip:"",class:void 0,enabled:typeof c.enabled=="undefined"?!0:c.enabled,checked:c.checked,run:c.run}),r=(c,u)=>new mw(`menu-action-${++n}`,c,u,void 0),s=(c,u,d,h,f)=>{if(!u)return o({label:c,enabled:u,run:()=>{}});const g=v=>()=>{this._configurationService.updateValue(d,v)},p=[];for(const v of f)p.push(o({label:v.label,checked:h===v.value,run:g(v.value)}));return r(c,p)},a=[];a.push(o({label:C("context.minimap.minimap","Minimap"),checked:t.enabled,run:()=>{this._configurationService.updateValue("editor.minimap.enabled",!t.enabled)}})),a.push(new kr),a.push(o({label:C("context.minimap.renderCharacters","Render Characters"),enabled:t.enabled,checked:t.renderCharacters,run:()=>{this._configurationService.updateValue("editor.minimap.renderCharacters",!t.renderCharacters)}})),a.push(s(C("context.minimap.size","Vertical size"),t.enabled,"editor.minimap.size",t.size,[{label:C("context.minimap.size.proportional","Proportional"),value:"proportional"},{label:C("context.minimap.size.fill","Fill"),value:"fill"},{label:C("context.minimap.size.fit","Fit"),value:"fit"}])),a.push(s(C("context.minimap.slider","Slider"),t.enabled,"editor.minimap.showSlider",t.showSlider,[{label:C("context.minimap.slider.mouseover","Mouse Over"),value:"mouseover"},{label:C("context.minimap.slider.always","Always"),value:"always"}]));const l=this._editor.getOption(126)&&!Kd;this._contextMenuIsBeingShownCount++,this._contextMenuService.showContextMenu({domForShadowRoot:l?this._editor.getDomNode():void 0,getAnchor:()=>e,getActions:()=>a,onHide:c=>{this._contextMenuIsBeingShownCount--,this._editor.focus()}})}_keybindingFor(e){return this._keybindingService.lookupKeybinding(e.id)}dispose(){this._contextMenuIsBeingShownCount>0&&this._contextViewService.hideContextView(),this._toDispose.dispose()}};Uw.ID="editor.contrib.contextmenu";Uw=$z=_1t([y_(1,Ku),y_(2,_p),y_(3,Ut),y_(4,xi),y_(5,If),y_(6,En),y_(7,ib)],Uw);class b1t extends ft{constructor(){super({id:"editor.action.showContextMenu",label:C("action.showContextMenu.label","Show Editor Context Menu"),alias:"Show Editor Context Menu",precondition:void 0,kbOpts:{kbExpr:Q.textInputFocus,primary:1092,weight:100}})}run(e,t){var n;(n=Uw.get(t))===null||n===void 0||n.showContextMenu()}}zn(Uw.ID,Uw,2);ze(b1t);class a7{constructor(e){this.selections=e}equals(e){const t=this.selections.length,n=e.selections.length;if(t!==n)return!1;for(let o=0;o{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 n=new a7(t.oldSelections);this._undoStack.length>0&&this._undoStack[this._undoStack.length-1].cursorState.equals(n)||(this._undoStack.push(new l7(n,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 l7(new a7(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 l7(new a7(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}}mb.ID="editor.contrib.cursorUndoRedoController";class C1t extends ft{constructor(){super({id:"cursorUndo",label:C("cursor.undo","Cursor Undo"),alias:"Cursor Undo",precondition:void 0,kbOpts:{kbExpr:Q.textInputFocus,primary:2099,weight:100}})}run(e,t,n){var o;(o=mb.get(t))===null||o===void 0||o.cursorUndo()}}class y1t extends ft{constructor(){super({id:"cursorRedo",label:C("cursor.redo","Cursor Redo"),alias:"Cursor Redo",precondition:void 0})}run(e,t,n){var o;(o=mb.get(t))===null||o===void 0||o.cursorRedo()}}zn(mb.ID,mb,0);ze(C1t);ze(y1t);class w1t{constructor(e,t,n){this.selection=e,this.targetPosition=t,this.copy=n,this.targetSelection=null}getEditOperations(e,t){const n=e.getValueInRange(this.selection);if(this.copy||t.addEditOperation(this.selection,null),t.addEditOperation(new V(this.targetPosition.lineNumber,this.targetPosition.column,this.targetPosition.lineNumber,this.targetPosition.column),n),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 gt(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 gt(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(35)||this._editor.getOption(22)||(Z1(e)&&(this._modifierPressed=!0),this._mouseDown&&Z1(e)&&this._editor.updateOptions({mouseStyle:"copy"}))}onEditorKeyUp(e){!this._editor.getOption(35)||this._editor.getOption(22)||(Z1(e)&&(this._modifierPressed=!1),this._mouseDown&&e.keyCode===Zg.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 o=(this._editor.getSelections()||[]).filter(r=>t.position&&r.containsPosition(t.position));if(o.length===1)this._dragSelection=o[0];else return}Z1(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 ae(e.target.position.lineNumber,e.target.position.column);if(this._dragSelection===null){let n=null;if(e.event.shiftKey){const o=this._editor.getSelection();if(o){const{selectionStartLineNumber:r,selectionStartColumn:s}=o;n=[new gt(r,s,t.lineNumber,t.column)]}}else n=(this._editor.getSelections()||[]).map(o=>o.containsPosition(t)?new gt(t.lineNumber,t.column,t.lineNumber,t.column):o);this._editor.setSelections(n||[],"mouse",3)}else(!this._dragSelection.containsPosition(t)||(Z1(e.event)||this._modifierPressed)&&(this._dragSelection.getEndPosition().equals(t)||this._dragSelection.getStartPosition().equals(t)))&&(this._editor.pushUndoStop(),this._editor.executeCommand(Zg.ID,new w1t(this._dragSelection,t,Z1(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 V(e.lineNumber,e.column,e.lineNumber,e.column),options:Zg._DECORATION_OPTIONS}]),this._editor.revealPosition(e,1)}_removeDecoration(){this._dndDecorationIds.clear()}_hitContent(e){return e.type===6||e.type===7}_hitMargin(e){return e.type===2||e.type===3||e.type===4}dispose(){this._removeDecoration(),this._dragSelection=null,this._mouseDown=!1,this._modifierPressed=!1,super.dispose()}}Zg.ID="editor.contrib.dragAndDrop";Zg.TRIGGER_KEY_VALUE=Nn?6:5;Zg._DECORATION_OPTIONS=Jt.register({description:"dnd-target",className:"dnd-target"});zn(Zg.ID,Zg,2);const _F=function(){if(typeof crypto=="object"&&typeof crypto.randomUUID=="function")return crypto.randomUUID.bind(crypto);let i;typeof crypto=="object"&&typeof crypto.getRandomValues=="function"?i=crypto.getRandomValues.bind(crypto):i=function(n){for(let o=0;okwe(this,void 0,void 0,function*(){return i}),asFile:()=>{},value:typeof i=="string"?i:void 0}}function S1t(i,e,t){const n={id:_F(),name:i,uri:e,data:t};return{asString:()=>kwe(this,void 0,void 0,function*(){return""}),asFile:()=>n,value:void 0}}class Iwe{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 vn.some(this,([n,o])=>o.asFile())&&t.push("files"),Nwe(_O(e),t)}get(e){var t;return(t=this._entries.get(this.toKey(e)))===null||t===void 0?void 0:t[0]}append(e,t){const n=this._entries.get(e);n?n.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 n of t)yield[e,n]}toKey(e){return _O(e)}}function _O(i){return i.toLowerCase()}function Twe(i,e){return Nwe(_O(i),e.map(_O))}function Nwe(i,e){if(i==="*/*")return e.length>0;if(e.includes(i))return!0;const t=i.match(/^([a-z]+)\/([a-z]+|\*)$/i);if(!t)return!1;const[n,o,r]=t;return r==="*"?e.some(s=>s.startsWith(o+"/")):!1}const bF=Object.freeze({create:i=>vv(i.map(e=>e.toString())).join(`\r `),split:i=>i.split(`\r -`),parse:i=>_F.split(i).filter(e=>!e.startsWith("#"))}),Kle={EDITORS:"CodeEditors",FILES:"CodeFiles"};class _1t{}const b1t={DragAndDropContribution:"workbench.contributions.dragAndDrop"};no.add(b1t.DragAndDropContribution,new _1t);class Bk{constructor(){}static getInstance(){return Bk.INSTANCE}hasData(e){return e&&e===this.proto}getData(e){if(this.hasData(e))return this.data}}Bk.INSTANCE=new Bk;var C1t=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};function xye(i){const e=new wye;for(const t of i.items){const n=t.type;if(t.kind==="string"){const o=new Promise(r=>t.getAsString(r));e.append(n,dY(o))}else if(t.kind==="file"){const o=t.getAsFile();o&&e.append(n,w1t(o))}}return e}function w1t(i){const e=i.path?Rt.parse(i.path):void 0;return v1t(i.name,e,()=>C1t(this,void 0,void 0,function*(){return new Uint8Array(yield i.arrayBuffer())}))}const y1t=Object.freeze([Kle.EDITORS,Kle.FILES,pk.RESOURCES,pk.INTERNAL_URI_LIST]);function Lye(i,e=!1){const t=xye(i),n=t.get(pk.INTERNAL_URI_LIST);if(n)t.replace(xo.uriList,n);else if(e||!t.has(xo.uriList)){const o=[];for(const r of i.items){const s=r.getAsFile();if(s){const a=s.path;try{a?o.push(Rt.file(a).toString()):o.push(Rt.parse(s.name,!0).toString())}catch{}}}o.length&&t.replace(xo.uriList,dY(_F.create(o)))}for(const o of y1t)t.delete(o);return t}function S1t(i,e,t){var n,o;return{edits:[...e.map(r=>new Kg(i,typeof t.insertText=="string"?{range:r,text:t.insertText,insertAsSnippet:!1}:{range:r,text:t.insertText.snippet,insertAsSnippet:!0})),...(o=(n=t.additionalEdit)===null||n===void 0?void 0:n.edits)!==null&&o!==void 0?o:[]]}}function Eye(i){var e;function t(a,l){return"providerId"in a&&a.providerId===l.providerId||"mimeType"in a&&a.mimeType===l.handledMimeType}const n=new Map;for(const a of i)for(const l of(e=a.yieldTo)!==null&&e!==void 0?e:[])for(const c of i)if(c!==a&&t(l,c)){let u=n.get(a);u||(u=[],n.set(a,u)),u.push(c)}if(!n.size)return Array.from(i);const o=new Set,r=[];function s(a){if(!a.length)return[];const l=a[0];if(r.includes(l))return console.warn(`Yield to cycle detected for ${l.providerId}`),a;if(o.has(l))return s(a.slice(1));let c=[];const u=n.get(l);return u&&(r.push(l),c=s(u),r.pop()),o.add(l),[...c,l,...s(a.slice(1))]}return s(Array.from(i))}var x1t=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},L1t=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},E1t=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};const D1t=Jt.register({description:"inline-progress-widget",stickiness:1,showIfCollapsed:!0,after:{content:W_e,inlineClassName:"inline-editor-progress-decoration",inlineClassNameAffectsLetterSpacing:!0}});class bF extends _e{constructor(e,t,n,o,r){super(),this.typeId=e,this.editor=t,this.range=n,this.delegate=r,this.allowEditorOverflow=!1,this.suppressMouseDown=!0,this.create(o),this.editor.addContentWidget(this),this.editor.layoutContentWidget(this)}create(e){this.domNode=He(".inline-progress-widget"),this.domNode.role="button",this.domNode.title=e;const t=He("span.icon");this.domNode.append(t),t.classList.add(...Mt.asClassNameArray(Xe.loading),"codicon-modifier-spin");const n=()=>{const o=this.editor.getOption(66);this.domNode.style.height=`${o}px`,this.domNode.style.width=`${Math.ceil(.8*o)}px`};n(),this._register(this.editor.onDidChangeConfiguration(o=>{(o.hasChanged(52)||o.hasChanged(66))&&n()})),this._register(ke(this.domNode,et.CLICK,o=>{this.delegate.cancel()}))}getId(){return bF.baseId+"."+this.typeId}getDomNode(){return this.domNode}getPosition(){return{position:{lineNumber:this.range.startLineNumber,column:this.range.startColumn},preference:[0]}}dispose(){super.dispose(),this.editor.removeContentWidget(this)}}bF.baseId="editor.widget.inlineProgressWidget";let mO=class extends _e{constructor(e,t,n){super(),this.id=e,this._editor=t,this._instantiationService=n,this._showDelay=500,this._showPromise=this._register(new Kr),this._currentWidget=new Kr,this._operationIdPool=0,this._currentDecorations=t.createDecorationsCollection()}showWhile(e,t,n){return E1t(this,void 0,void 0,function*(){const o=this._operationIdPool++;this._currentOperation=o,this.clear(),this._showPromise.value=yv(()=>{const r=V.fromPositions(e);this._currentDecorations.set([{range:r,options:D1t}]).length>0&&(this._currentWidget.value=this._instantiationService.createInstance(bF,this.id,this._editor,r,t,n))},this._showDelay);try{return yield n}finally{this._currentOperation===o&&(this.clear(),this._currentOperation=void 0)}})}clear(){this._showPromise.clear(),this._currentDecorations.clear(),this._currentWidget.clear()}};mO=x1t([L1t(2,$t)],mO);var Dye=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},TE=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},qle=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},Wz;let vO=Wz=class extends _e{constructor(e,t,n,o,r,s,a,l,c,u){super(),this.typeId=e,this.editor=t,this.showCommand=o,this.range=r,this.edits=s,this.onSelectNewEdit=a,this._contextMenuService=l,this._keybindingService=u,this.allowEditorOverflow=!0,this.suppressMouseDown=!0,this.create(),this.visibleContext=n.bindTo(c),this.visibleContext.set(!0),this._register(zt(()=>this.visibleContext.reset())),this.editor.addContentWidget(this),this.editor.layoutContentWidget(this),this._register(zt(()=>this.editor.removeContentWidget(this))),this._register(this.editor.onDidChangeCursorPosition(d=>{r.containsPosition(d.position)||this.dispose()})),this._register(st.runAndSubscribe(u.onDidUpdateKeybindings,()=>{this._updateButtonTitle()}))}_updateButtonTitle(){var e;const t=(e=this._keybindingService.lookupKeybinding(this.showCommand.id))===null||e===void 0?void 0:e.getLabel();this.button.element.title=this.showCommand.label+(t?` (${t})`:"")}create(){this.domNode=He(".post-edit-widget"),this.button=this._register(new S$(this.domNode,{supportIcons:!0})),this.button.label="$(insert)",this._register(ke(this.domNode,et.CLICK,()=>this.showSelector()))}getId(){return Wz.baseId+"."+this.typeId}getDomNode(){return this.domNode}getPosition(){return{position:this.range.getEndPosition(),preference:[2]}}showSelector(){this._contextMenuService.showContextMenu({getAnchor:()=>{const e=Yo(this.button.element);return{x:e.left+e.width,y:e.top+e.height}},getActions:()=>this.edits.allEdits.map((e,t)=>mw({id:"",label:e.label,checked:t===this.edits.activeEditIndex,run:()=>{if(t!==this.edits.activeEditIndex)return this.onSelectNewEdit(t)}}))})}};vO.baseId="editor.widget.postEditWidget";vO=Wz=Dye([TE(7,ju),TE(8,Ut),TE(9,xi)],vO);let _O=class extends _e{constructor(e,t,n,o,r,s){super(),this._id=e,this._editor=t,this._visibleContext=n,this._showCommand=o,this._instantiationService=r,this._bulkEditService=s,this._currentWidget=this._register(new Kr),this._register(st.any(t.onDidChangeModel,t.onDidChangeModelContent)(()=>this.clear()))}applyEditAndShowIfNeeded(e,t,n,o){var r,s;return qle(this,void 0,void 0,function*(){const a=this._editor.getModel();if(!a||!e.length)return;const l=t.allEdits[t.activeEditIndex];if(!l)return;let c=[];(typeof l.insertText=="string"?l.insertText==="":l.insertText.snippet==="")?c=[]:c=e.map(v=>new Kg(a.uri,typeof l.insertText=="string"?{range:v,text:l.insertText,insertAsSnippet:!1}:{range:v,text:l.insertText.snippet,insertAsSnippet:!0}));const d={edits:[...c,...(s=(r=l.additionalEdit)===null||r===void 0?void 0:r.edits)!==null&&s!==void 0?s:[]]},h=e[0],f=a.deltaDecorations([],[{range:h,options:{description:"paste-line-suffix",stickiness:0}}]);let g,p;try{g=yield this._bulkEditService.apply(d,{editor:this._editor,token:o}),p=a.getDecorationRange(f[0])}finally{a.deltaDecorations(f,[])}n&&g.isApplied&&t.allEdits.length>1&&this.show(p!=null?p:h,t,v=>qle(this,void 0,void 0,function*(){const m=this._editor.getModel();!m||(yield m.undo(),this.applyEditAndShowIfNeeded(e,{activeEditIndex:v,allEdits:t.allEdits},n,o))}))})}show(e,t,n){this.clear(),this._editor.hasModel()&&(this._currentWidget.value=this._instantiationService.createInstance(vO,this._id,this._editor,this._visibleContext,this._showCommand,e,t,n))}clear(){this._currentWidget.clear()}tryShowSelector(){var e;(e=this._currentWidget.value)===null||e===void 0||e.showSelector()}};_O=Dye([TE(4,$t),TE(5,eT)],_O);var k1t=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Q1=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},ng=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},Vz;const kye="editor.changePasteType",Iye=new lt("pasteWidgetVisible",!1,C("pasteWidgetVisible","Whether the paste widget is showing")),c7="application/vnd.code.copyMetadata";let mb=Vz=class extends _e{static get(e){return e.getContribution(Vz.ID)}constructor(e,t,n,o,r,s,a){super(),this._bulkEditService=n,this._clipboardService=o,this._languageFeaturesService=r,this._quickInputService=s,this._progressService=a,this._editor=e;const l=e.getContainerDomNode();this._register(ke(l,"copy",c=>this.handleCopy(c))),this._register(ke(l,"cut",c=>this.handleCopy(c))),this._register(ke(l,"paste",c=>this.handlePaste(c),!0)),this._pasteProgressManager=this._register(new mO("pasteIntoEditor",e,t)),this._postPasteWidgetManager=this._register(t.createInstance(_O,"pasteIntoEditor",e,Iye,{id:kye,label:C("postPasteWidgetTitle","Show paste options...")}))}changePasteType(){this._postPasteWidgetManager.tryShowSelector()}pasteAs(e){this._editor.focus();try{this._pasteAsActionContext={preferredId:e},Q4().execCommand("paste")}finally{this._pasteAsActionContext=void 0}}isPasteAsEnabled(){return this._editor.getOption(84).enabled&&!this._editor.getOption(90)}handleCopy(e){var t,n;if(!this._editor.hasTextFocus()||(qv&&this._clipboardService.writeResources([]),!e.clipboardData||!this.isPasteAsEnabled()))return;const o=this._editor.getModel(),r=this._editor.getSelections();if(!o||!(r!=null&&r.length))return;const s=this._editor.getOption(37);let a=r;const l=r.length===1&&r[0].isEmpty();if(l){if(!s)return;a=[new V(a[0].startLineNumber,1,a[0].startLineNumber,1+o.getLineLength(a[0].startLineNumber))]}const c=(t=this._editor._getViewModel())===null||t===void 0?void 0:t.getPlainTextToCopy(r,s,as),d={multicursorText:Array.isArray(c)?c:null,pasteOnNewLine:l,mode:null},h=this._languageFeaturesService.documentPasteEditProvider.ordered(o).filter(m=>!!m.prepareDocumentPaste);if(!h.length){this.setCopyMetadata(e.clipboardData,{defaultPastePayload:d});return}const f=xye(e.clipboardData),g=h.flatMap(m=>{var _;return(_=m.copyMimeTypes)!==null&&_!==void 0?_:[]}),p=vF();this.setCopyMetadata(e.clipboardData,{id:p,providerCopyMimeTypes:g,defaultPastePayload:d});const v=sr(m=>ng(this,void 0,void 0,function*(){const _=df(yield Promise.all(h.map(w=>ng(this,void 0,void 0,function*(){try{return yield w.prepareDocumentPaste(o,a,f,m)}catch(y){console.error(y);return}}))));_.reverse();for(const w of _)for(const[y,L]of w)f.replace(y,L);return f}));(n=this._currentCopyOperation)===null||n===void 0||n.dataTransferPromise.cancel(),this._currentCopyOperation={handle:p,dataTransferPromise:v}}handlePaste(e){var t,n;return ng(this,void 0,void 0,function*(){if(!e.clipboardData||!this._editor.hasTextFocus())return;(t=this._currentPasteOperation)===null||t===void 0||t.cancel(),this._currentPasteOperation=void 0;const o=this._editor.getModel(),r=this._editor.getSelections();if(!(r!=null&&r.length)||!o||!this.isPasteAsEnabled())return;const s=this.fetchCopyMetadata(e),a=Lye(e.clipboardData);a.delete(c7);const l=[...e.clipboardData.types,...(n=s==null?void 0:s.providerCopyMimeTypes)!==null&&n!==void 0?n:[],xo.uriList],c=this._languageFeaturesService.documentPasteEditProvider.ordered(o).filter(u=>{var d;return(d=u.pasteMimeTypes)===null||d===void 0?void 0:d.some(h=>yye(h,l))});!c.length||(e.preventDefault(),e.stopImmediatePropagation(),this._pasteAsActionContext?this.showPasteAsPick(this._pasteAsActionContext.preferredId,c,r,a,s):this.doPasteInline(c,r,a,s))})}doPasteInline(e,t,n,o){const r=sr(s=>ng(this,void 0,void 0,function*(){const a=this._editor;if(!a.hasModel())return;const l=a.getModel(),c=new Nv(a,3,void 0,s);try{if(yield this.mergeInDataFromCopy(n,o,c.token),c.token.isCancellationRequested)return;const u=e.filter(h=>Gle(h,n));if(!u.length||u.length===1&&u[0].id==="text"){yield this.applyDefaultPasteHandler(n,o,c.token);return}const d=yield this.getPasteEdits(u,n,l,t,c.token);if(c.token.isCancellationRequested)return;if(d.length===1&&d[0].providerId==="text"){yield this.applyDefaultPasteHandler(n,o,c.token);return}if(d.length){const h=a.getOption(84).showPasteSelector==="afterPaste";return this._postPasteWidgetManager.applyEditAndShowIfNeeded(t,{activeEditIndex:0,allEdits:d},h,c.token)}yield this.applyDefaultPasteHandler(n,o,c.token)}finally{c.dispose(),this._currentPasteOperation===r&&(this._currentPasteOperation=void 0)}}));this._pasteProgressManager.showWhile(t[0].getEndPosition(),C("pasteIntoEditorProgress","Running paste handlers. Click to cancel"),r),this._currentPasteOperation=r}showPasteAsPick(e,t,n,o,r){const s=sr(a=>ng(this,void 0,void 0,function*(){const l=this._editor;if(!l.hasModel())return;const c=l.getModel(),u=new Nv(l,3,void 0,a);try{if(yield this.mergeInDataFromCopy(o,r,u.token),u.token.isCancellationRequested)return;let d=t.filter(p=>Gle(p,o));e&&(d=d.filter(p=>p.id===e));const h=yield this.getPasteEdits(d,o,c,n,u.token);if(u.token.isCancellationRequested||!h.length)return;let f;if(e)f=h.at(0);else{const p=yield this._quickInputService.pick(h.map(v=>({label:v.label,description:v.providerId,detail:v.detail,edit:v})),{placeHolder:C("pasteAsPickerPlaceholder","Select Paste Action")});f=p==null?void 0:p.edit}if(!f)return;const g=S1t(c.uri,n,f);yield this._bulkEditService.apply(g,{editor:this._editor})}finally{u.dispose(),this._currentPasteOperation===s&&(this._currentPasteOperation=void 0)}}));this._progressService.withProgress({location:10,title:C("pasteAsProgress","Running paste handlers")},()=>s)}setCopyMetadata(e,t){e.setData(c7,JSON.stringify(t))}fetchCopyMetadata(e){var t;if(!e.clipboardData)return;const n=e.clipboardData.getData(c7);if(n)try{return JSON.parse(n)}catch{return}const[o,r]=fH.getTextData(e.clipboardData);if(r)return{defaultPastePayload:{mode:r.mode,multicursorText:(t=r.multicursorText)!==null&&t!==void 0?t:null,pasteOnNewLine:!!r.isFromEmptySelection}}}mergeInDataFromCopy(e,t,n){var o;return ng(this,void 0,void 0,function*(){if((t==null?void 0:t.id)&&((o=this._currentCopyOperation)===null||o===void 0?void 0:o.handle)===t.id){const r=yield this._currentCopyOperation.dataTransferPromise;if(n.isCancellationRequested)return;for(const[s,a]of r)e.replace(s,a)}if(!e.has(xo.uriList)){const r=yield this._clipboardService.readResources();if(n.isCancellationRequested)return;r.length&&e.append(xo.uriList,dY(_F.create(r)))}})}getPasteEdits(e,t,n,o,r){return ng(this,void 0,void 0,function*(){const s=yield e5(Promise.all(e.map(l=>ng(this,void 0,void 0,function*(){var c;try{const u=yield(c=l.provideDocumentPasteEdits)===null||c===void 0?void 0:c.call(l,n,o,t,r);if(u)return Object.assign(Object.assign({},u),{providerId:l.id})}catch(u){console.error(u)}}))),r),a=df(s!=null?s:[]);return Eye(a)})}applyDefaultPasteHandler(e,t,n){var o,r,s;return ng(this,void 0,void 0,function*(){const a=(o=e.get(xo.text))!==null&&o!==void 0?o:e.get("text");if(!a)return;const l=yield a.asString();if(n.isCancellationRequested)return;const c={text:l,pasteOnNewLine:(r=t==null?void 0:t.defaultPastePayload.pasteOnNewLine)!==null&&r!==void 0?r:!1,multicursorText:(s=t==null?void 0:t.defaultPastePayload.multicursorText)!==null&&s!==void 0?s:null,mode:null};this._editor.trigger("keyboard","paste",c)})}};mb.ID="editor.contrib.copyPasteActionController";mb=Vz=k1t([Q1(1,$t),Q1(2,eT),Q1(3,bp),Q1(4,pt),Q1(5,lh),Q1(6,p1e)],mb);function Gle(i,e){var t;return Boolean((t=i.pasteMimeTypes)===null||t===void 0?void 0:t.some(n=>e.matches(n)))}var hY=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Wk=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},Uy=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};const fY=C("builtIn","Built-in");class gY{provideDocumentPasteEdits(e,t,n,o){return Uy(this,void 0,void 0,function*(){const r=yield this.getEdit(n,o);return r?{insertText:r.insertText,label:r.label,detail:r.detail,handledMimeType:r.handledMimeType,yieldTo:r.yieldTo}:void 0})}provideDocumentOnDropEdits(e,t,n,o){return Uy(this,void 0,void 0,function*(){const r=yield this.getEdit(n,o);return r?{insertText:r.insertText,label:r.label,handledMimeType:r.handledMimeType,yieldTo:r.yieldTo}:void 0})}}class Tye extends gY{constructor(){super(...arguments),this.id="text",this.dropMimeTypes=[xo.text],this.pasteMimeTypes=[xo.text]}getEdit(e,t){return Uy(this,void 0,void 0,function*(){const n=e.get(xo.text);if(!n||e.has(xo.uriList))return;const o=yield n.asString();return{handledMimeType:xo.text,label:C("text.label","Insert Plain Text"),detail:fY,insertText:o}})}}class Nye extends gY{constructor(){super(...arguments),this.id="uri",this.dropMimeTypes=[xo.uriList],this.pasteMimeTypes=[xo.uriList]}getEdit(e,t){return Uy(this,void 0,void 0,function*(){const n=yield Rye(e);if(!n.length||t.isCancellationRequested)return;let o=0;const r=n.map(({uri:a,originalText:l})=>a.scheme===hn.file?a.fsPath:(o++,l)).join(" ");let s;return o>0?s=n.length>1?C("defaultDropProvider.uriList.uris","Insert Uris"):C("defaultDropProvider.uriList.uri","Insert Uri"):s=n.length>1?C("defaultDropProvider.uriList.paths","Insert Paths"):C("defaultDropProvider.uriList.path","Insert Path"),{handledMimeType:xo.uriList,insertText:r,label:s,detail:fY}})}}let bO=class extends gY{constructor(e){super(),this._workspaceContextService=e,this.id="relativePath",this.dropMimeTypes=[xo.uriList],this.pasteMimeTypes=[xo.uriList]}getEdit(e,t){return Uy(this,void 0,void 0,function*(){const n=yield Rye(e);if(!n.length||t.isCancellationRequested)return;const o=df(n.map(({uri:r})=>{const s=this._workspaceContextService.getWorkspaceFolder(r);return s?Fst(s.uri,r):void 0}));if(!!o.length)return{handledMimeType:xo.uriList,insertText:o.join(" "),label:n.length>1?C("defaultDropProvider.uriList.relativePaths","Insert Relative Paths"):C("defaultDropProvider.uriList.relativePath","Insert Relative Path"),detail:fY}})}};bO=hY([Wk(0,nb)],bO);function Rye(i){return Uy(this,void 0,void 0,function*(){const e=i.get(xo.uriList);if(!e)return[];const t=yield e.asString(),n=[];for(const o of _F.parse(t))try{n.push({uri:Rt.parse(o),originalText:o})}catch{}return n})}let Hz=class extends _e{constructor(e,t){super(),this._register(e.documentOnDropEditProvider.register("*",new Tye)),this._register(e.documentOnDropEditProvider.register("*",new Nye)),this._register(e.documentOnDropEditProvider.register("*",new bO(t)))}};Hz=hY([Wk(0,pt),Wk(1,nb)],Hz);let $z=class extends _e{constructor(e,t){super(),this._register(e.documentPasteEditProvider.register("*",new Tye)),this._register(e.documentPasteEditProvider.register("*",new Nye)),this._register(e.documentPasteEditProvider.register("*",new bO(t)))}};$z=hY([Wk(0,pt),Wk(1,nb)],$z);zn(mb.ID,mb,0);q5($z);Ye(new class extends Ir{constructor(){super({id:kye,precondition:Iye,kbOpts:{weight:100,primary:2137}})}runEditorCommand(i,e,t){var n;return(n=mb.get(e))===null||n===void 0?void 0:n.changePasteType()}});ze(class extends ft{constructor(){super({id:"editor.action.pasteAs",label:C("pasteAs","Paste As..."),alias:"Paste As...",precondition:void 0,description:{description:"Paste as",args:[{name:"args",schema:{type:"object",properties:{id:{type:"string",description:C("pasteAs.id","The id of the paste edit to try applying. If not provided, the editor will show a picker.")}}}}]}})}run(i,e,t){var n;const o=typeof(t==null?void 0:t.id)=="string"?t.id:void 0;return(n=mb.get(e))===null||n===void 0?void 0:n.pasteAs(o)}});class I1t{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}}}class Xle{constructor(e){this.identifier=e}}const Mye=wn("treeViewsDndService");Mn(Mye,I1t,1);var T1t=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Z2=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},Qx=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},zz;const Aye="editor.experimental.dropIntoEditor.defaultProvider",Pye="editor.changeDropType",Oye=new lt("dropWidgetVisible",!1,C("dropWidgetVisible","Whether the drop widget is showing"));let jy=zz=class extends _e{static get(e){return e.getContribution(zz.ID)}constructor(e,t,n,o,r){super(),this._configService=n,this._languageFeaturesService=o,this._treeViewsDragAndDropService=r,this.treeItemsTransfer=Bk.getInstance(),this._dropProgressManager=this._register(t.createInstance(mO,"dropIntoEditor",e)),this._postDropWidgetManager=this._register(t.createInstance(_O,"dropIntoEditor",e,Oye,{id:Pye,label:C("postDropWidgetTitle","Show drop options...")})),this._register(e.onDropIntoEditor(s=>this.onDropIntoEditor(e,s.position,s.event)))}changeDropType(){this._postDropWidgetManager.tryShowSelector()}onDropIntoEditor(e,t,n){var o;return Qx(this,void 0,void 0,function*(){if(!n.dataTransfer||!e.hasModel())return;(o=this._currentOperation)===null||o===void 0||o.cancel(),e.focus(),e.setPosition(t);const r=sr(s=>Qx(this,void 0,void 0,function*(){const a=new Nv(e,1,void 0,s);try{const l=yield this.extractDataTransferData(n);if(l.size===0||a.token.isCancellationRequested)return;const c=e.getModel();if(!c)return;const u=this._languageFeaturesService.documentOnDropEditProvider.ordered(c).filter(h=>h.dropMimeTypes?h.dropMimeTypes.some(f=>l.matches(f)):!0),d=yield this.getDropEdits(u,c,t,l,a);if(a.token.isCancellationRequested)return;if(d.length){const h=this.getInitialActiveEditIndex(c,d),f=e.getOption(36).showDropSelector==="afterDrop";yield this._postDropWidgetManager.applyEditAndShowIfNeeded([V.fromPositions(t)],{activeEditIndex:h,allEdits:d},f,s)}}finally{a.dispose(),this._currentOperation===r&&(this._currentOperation=void 0)}}));this._dropProgressManager.showWhile(t,C("dropIntoEditorProgress","Running drop handlers. Click to cancel"),r),this._currentOperation=r})}getDropEdits(e,t,n,o,r){return Qx(this,void 0,void 0,function*(){const s=yield e5(Promise.all(e.map(l=>Qx(this,void 0,void 0,function*(){try{const c=yield l.provideDocumentOnDropEdits(t,n,o,r.token);if(c)return Object.assign(Object.assign({},c),{providerId:l.id})}catch(c){console.error(c)}}))),r.token),a=df(s!=null?s:[]);return Eye(a)})}getInitialActiveEditIndex(e,t){const n=this._configService.getValue(Aye,{resource:e.uri});for(const[o,r]of Object.entries(n)){const s=t.findIndex(a=>r===a.providerId&&a.handledMimeType&&yye(o,[a.handledMimeType]));if(s>=0)return s}return 0}extractDataTransferData(e){return Qx(this,void 0,void 0,function*(){if(!e.dataTransfer)return new wye;const t=Lye(e.dataTransfer);if(this.treeItemsTransfer.hasData(Xle.prototype)){const n=this.treeItemsTransfer.getData(Xle.prototype);if(Array.isArray(n))for(const o of n){const r=yield this._treeViewsDragAndDropService.removeDragOperationTransfer(o.identifier);if(r)for(const[s,a]of r)t.replace(s,a)}}return t})}};jy.ID="editor.contrib.dropIntoEditorController";jy=zz=T1t([Z2(1,$t),Z2(2,En),Z2(3,pt),Z2(4,Mye)],jy);zn(jy.ID,jy,2);Ye(new class extends Ir{constructor(){super({id:Pye,precondition:Oye,kbOpts:{weight:100,primary:2137}})}runEditorCommand(i,e,t){var n;(n=jy.get(e))===null||n===void 0||n.changeDropType()}});q5(Hz);no.as(ah.Configuration).registerConfiguration(Object.assign(Object.assign({},D5),{properties:{[Aye]:{type:"object",scope:5,description:C("defaultProviderDescription","Configures the default drop provider to use for content of a given mime type."),default:{},additionalProperties:{type:"string"}}}}));class Ps{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&&(o.changeDecorationOptions(this._highlightedDecorationId,Ps._FIND_MATCH_DECORATION),this._highlightedDecorationId=null),t!==null&&(this._highlightedDecorationId=t,o.changeDecorationOptions(this._highlightedDecorationId,Ps._CURRENT_FIND_MATCH_DECORATION)),this._rangeHighlightDecorationId!==null&&(o.removeDecoration(this._rangeHighlightDecorationId),this._rangeHighlightDecorationId=null),t!==null){let r=this._editor.getModel().getDecorationRange(t);if(r.startLineNumber!==r.endLineNumber&&r.endColumn===1){const s=r.endLineNumber-1,a=this._editor.getModel().getLineMaxColumn(s);r=new V(r.startLineNumber,r.startColumn,s,a)}this._rangeHighlightDecorationId=o.addDecoration(r,Ps._RANGE_HIGHLIGHT_DECORATION)}}),n}set(e,t){this._editor.changeDecorations(n=>{let o=Ps._FIND_MATCH_DECORATION;const r=[];if(e.length>1e3){o=Ps._FIND_MATCH_NO_OVERVIEW_DECORATION;const a=this._editor.getModel().getLineCount(),c=this._editor.getLayoutInfo().height/a,u=Math.max(2,Math.ceil(3/c));let d=e[0].range.startLineNumber,h=e[0].range.endLineNumber;for(let f=1,g=e.length;f=p.startLineNumber?p.endLineNumber>h&&(h=p.endLineNumber):(r.push({range:new V(d,1,h,1),options:Ps._FIND_MATCH_ONLY_OVERVIEW_DECORATION}),d=p.startLineNumber,h=p.endLineNumber)}r.push({range:new V(d,1,h,1),options:Ps._FIND_MATCH_ONLY_OVERVIEW_DECORATION})}const s=new Array(e.length);for(let a=0,l=e.length;an.removeDecoration(a)),this._findScopeDecorationIds=[]),t!=null&&t.length&&(this._findScopeDecorationIds=t.map(a=>n.addDecoration(a,Ps._FIND_SCOPE_DECORATION)))})}matchBeforePosition(e){if(this._decorations.length===0)return null;for(let t=this._decorations.length-1;t>=0;t--){const n=this._decorations[t],o=this._editor.getModel().getDecorationRange(n);if(!(!o||o.endLineNumber>e.lineNumber)){if(o.endLineNumbere.column))return o}}return this._editor.getModel().getDecorationRange(this._decorations[this._decorations.length-1])}matchAfterPosition(e){if(this._decorations.length===0)return null;for(let t=0,n=this._decorations.length;te.lineNumber)return r;if(!(r.startColumn0){const n=[];for(let s=0;sV.compareRangesUsingStarts(s.range,a.range));const o=[];let r=n[0];for(let s=1;s0?e[0].toUpperCase()+e.substr(1):i[0][0].toUpperCase()!==i[0][0]&&e.length>0?e[0].toLowerCase()+e.substr(1):e}else return e}function Yle(i,e,t){return i[0].indexOf(t)!==-1&&e.indexOf(t)!==-1&&i[0].split(t).length===e.split(t).length}function Zle(i,e,t){const n=e.split(t),o=i[0].split(t);let r="";return n.forEach((s,a)=>{r+=Fye([o[a]],s)+t}),r.slice(0,-1)}class Qle{constructor(e){this.staticValue=e,this.kind=0}}class R1t{constructor(e){this.pieces=e,this.kind=1}}class Ky{static fromStaticValue(e){return new Ky([A0.staticValue(e)])}get hasReplacementPatterns(){return this._state.kind===1}constructor(e){!e||e.length===0?this._state=new Qle(""):e.length===1&&e[0].staticValue!==null?this._state=new Qle(e[0].staticValue):this._state=new R1t(e)}buildReplaceString(e,t){if(this._state.kind===0)return t?Fye(e,this._state.staticValue):this._state.staticValue;let n="";for(let o=0,r=this._state.pieces.length;o0){const l=[],c=s.caseOps.length;let u=0;for(let d=0,h=a.length;d=c){l.push(a.slice(d));break}switch(s.caseOps[u]){case"U":l.push(a[d].toUpperCase());break;case"u":l.push(a[d].toUpperCase()),u++;break;case"L":l.push(a[d].toLowerCase());break;case"l":l.push(a[d].toLowerCase()),u++;break;default:l.push(a[d])}}a=l.join("")}n+=a}return n}static _substitute(e,t){if(t===null)return"";if(e===0)return t[0];let n="";for(;e>0;){if(e=o)break;const s=i.charCodeAt(n);switch(s){case 92:t.emitUnchanged(n-1),t.emitStatic("\\",n+1);break;case 110:t.emitUnchanged(n-1),t.emitStatic(` -`,n+1);break;case 116:t.emitUnchanged(n-1),t.emitStatic(" ",n+1);break;case 117:case 85:case 108:case 76:t.emitUnchanged(n-1),t.emitStatic("",n+1),e.push(String.fromCharCode(s));break}continue}if(r===36){if(n++,n>=o)break;const s=i.charCodeAt(n);if(s===36){t.emitUnchanged(n-1),t.emitStatic("$",n+1);continue}if(s===48||s===38){t.emitUnchanged(n-1),t.emitMatchIndex(0,n+1,e),e.length=0;continue}if(49<=s&&s<=57){let a=s-48;if(n+1this.research(!1),100),this._toDispose.add(this._updateDecorationsScheduler),this._toDispose.add(this._editor.onDidChangeCursorPosition(n=>{(n.reason===3||n.reason===5||n.reason===6)&&this._decorations.setStartPosition(this._editor.getPosition())})),this._ignoreModelContentChanged=!1,this._toDispose.add(this._editor.onDidChangeModelContent(n=>{this._ignoreModelContentChanged||(n.isFlush&&this._decorations.reset(),this._decorations.setStartPosition(this._editor.getPosition()),this._updateDecorationsScheduler.schedule())})),this._toDispose.add(this._state.onFindReplaceStateChange(n=>this._onStateChanged(n))),this.research(!1,this._state.searchScope)}dispose(){this._isDisposed=!0,si(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)},P1t)):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 n=null;typeof t!="undefined"?t!==null&&(Array.isArray(t)?n=t:n=[t]):n=this._decorations.getFindScopes(),n!==null&&(n=n.map(a=>{if(a.startLineNumber!==a.endLineNumber){let l=a.endLineNumber;return a.endColumn===1&&(l=l-1),new V(a.startLineNumber,1,l,this._editor.getModel().getLineMaxColumn(l))}return a}));const o=this._findMatches(n,!1,Nm);this._decorations.set(o,n);const r=this._editor.getSelection();let s=this._decorations.getCurrentMatchesPosition(r);if(s===0&&o.length>0){const a=$D(o.map(l=>l.range),l=>V.compareRangesUsingStarts(l,r)>=0);s=a>0?a-1+1:s}this._state.changeMatchInfo(s,this._decorations.getCount(),void 0),e&&this._editor.getOption(41).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,0),!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,0)}_prevSearchPosition(e){const t=this._state.isRegex&&(this._state.searchString.indexOf("^")>=0||this._state.searchString.indexOf("$")>=0);let{lineNumber:n,column:o}=e;const r=this._editor.getModel();return t||o===1?(n===1?n=r.getLineCount():n--,o=r.getLineMaxColumn(n)):o--,new ae(n,o)}_moveToPrevMatch(e,t=!1){if(!this._state.canNavigateBack()){const u=this._decorations.matchAfterPosition(e);u&&this._setCurrentFindMatch(u);return}if(this._decorations.getCount()=0||this._state.searchString.indexOf("$")>=0);let{lineNumber:n,column:o}=e;const r=this._editor.getModel();return t||o===r.getLineMaxColumn(n)?(n===r.getLineCount()?n=1:n++,o=1):o++,new ae(n,o)}_moveToNextMatch(e){if(!this._state.canNavigateForward()){const n=this._decorations.matchBeforePosition(e);n&&this._setCurrentFindMatch(n);return}if(this._decorations.getCount()NE._getSearchRange(this._editor.getModel(),r));return this._editor.getModel().findMatches(this._state.searchString,o,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getOption(129):null,t,n)}replaceAll(){if(!this._hasMatches())return;const e=this._decorations.getFindScopes();e===null&&this._state.matchesCount>=Nm?this._largeReplaceAll():this._regularReplaceAll(e),this.research(!1)}_largeReplaceAll(){const t=new N_(this._state.searchString,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getOption(129):null).parseSearchRequest();if(!t)return;let n=t.regex;if(!n.multiline){let d="mu";n.ignoreCase&&(d+="i"),n.global&&(d+="g"),n=new RegExp(n.source,d)}const o=this._editor.getModel(),r=o.getValue(1),s=o.getFullModelRange(),a=this._getReplacePattern();let l;const c=this._state.preserveCase;a.hasReplacementPatterns||c?l=r.replace(n,function(){return a.buildReplaceString(arguments,c)}):l=r.replace(n,a.buildReplaceString(null,c));const u=new EG(s,l,this._editor.getSelection());this._executeEditorCommand("replaceAll",u)}_regularReplaceAll(e){const t=this._getReplacePattern(),n=this._findMatches(e,t.hasReplacementPatterns||this._state.preserveCase,1073741824),o=[];for(let s=0,a=n.length;ss.range),o);this._executeEditorCommand("replaceAll",r)}selectAllMatches(){if(!this._hasMatches())return;const e=this._decorations.getFindScopes();let n=this._findMatches(e,!1,1073741824).map(r=>new gt(r.range.startLineNumber,r.range.startColumn,r.range.endLineNumber,r.range.endColumn));const o=this._editor.getSelection();for(let r=0,s=n.length;rthis._hide(),2e3)),this._isVisible=!1,this._editor=e,this._state=t,this._keybindingService=n,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 o={inputActiveOptionBorder:ct(pG),inputActiveOptionForeground:ct(mG),inputActiveOptionBackground:ct(u0)};this.caseSensitive=this._register(new K1e(Object.assign({appendTitle:this._keybindingLabelFor(Ri.ToggleCaseSensitiveCommand),isChecked:this._state.matchCase},o))),this._domNode.appendChild(this.caseSensitive.domNode),this._register(this.caseSensitive.onChange(()=>{this._state.change({matchCase:this.caseSensitive.checked},!1)})),this.wholeWords=this._register(new q1e(Object.assign({appendTitle:this._keybindingLabelFor(Ri.ToggleWholeWordCommand),isChecked:this._state.wholeWord},o))),this._domNode.appendChild(this.wholeWords.domNode),this._register(this.wholeWords.onChange(()=>{this._state.change({wholeWord:this.wholeWords.checked},!1)})),this.regex=this._register(new G1e(Object.assign({appendTitle:this._keybindingLabelFor(Ri.ToggleRegexCommand),isChecked:this._state.isRegex},o))),this._domNode.appendChild(this.regex.domNode),this._register(this.regex.onChange(()=>{this._state.change({isRegex:this.regex.checked},!1)})),this._editor.addOverlayWidget(this),this._register(this._state.onFindReplaceStateChange(r=>{let s=!1;r.isRegex&&(this.regex.checked=this._state.isRegex,s=!0),r.wholeWord&&(this.wholeWords.checked=this._state.wholeWord,s=!0),r.matchCase&&(this.caseSensitive.checked=this._state.matchCase,s=!0),!this._state.isRevealed&&s&&this._revealTemporarily()})),this._register(ke(this._domNode,et.MOUSE_LEAVE,r=>this._onMouseLeave())),this._register(ke(this._domNode,"mouseover",r=>this._onMouseOver()))}_keybindingLabelFor(e){const t=this._keybindingService.lookupKeybinding(e);return t?` (${t.getLabel()})`:""}dispose(){this._editor.removeOverlayWidget(this),super.dispose()}getId(){return wF.ID}getDomNode(){return this._domNode}getPosition(){return{preference:0}}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")}}wF.ID="editor.contrib.findOptionsWidget";function iR(i,e){return i===1?!0:i===2?!1:e}class O1t extends _e{get searchString(){return this._searchString}get replaceString(){return this._replaceString}get isRevealed(){return this._isRevealed}get isReplaceRevealed(){return this._isReplaceRevealed}get isRegex(){return iR(this._isRegexOverride,this._isRegex)}get wholeWord(){return iR(this._wholeWordOverride,this._wholeWord)}get matchCase(){return iR(this._matchCaseOverride,this._matchCase)}get preserveCase(){return iR(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}constructor(){super(),this._onFindReplaceStateChange=this._register(new le),this.onFindReplaceStateChange=this._onFindReplaceStateChange.event,this._searchString="",this._replaceString="",this._isRevealed=!1,this._isReplaceRevealed=!1,this._isRegex=!1,this._isRegexOverride=0,this._wholeWord=!1,this._wholeWordOverride=0,this._matchCase=!1,this._matchCaseOverride=0,this._preserveCase=!1,this._preserveCaseOverride=0,this._searchScope=null,this._matchesPosition=0,this._matchesCount=0,this._currentMatch=null,this._loop=!0,this._isSearching=!1,this._filters=null}changeMatchInfo(e,t,n){const o={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,o.matchesPosition=!0,r=!0),this._matchesCount!==t&&(this._matchesCount=t,o.matchesCount=!0,r=!0),typeof n!="undefined"&&(V.equalsRange(this._currentMatch,n)||(this._currentMatch=n,o.currentMatch=!0,r=!0)),r&&this._onFindReplaceStateChange.fire(o)}change(e,t,n=!0){var o;const r={moveCursor:t,updateHistory:n,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 s=!1;const a=this.isRegex,l=this.wholeWord,c=this.matchCase,u=this.preserveCase;typeof e.searchString!="undefined"&&this._searchString!==e.searchString&&(this._searchString=e.searchString,r.searchString=!0,s=!0),typeof e.replaceString!="undefined"&&this._replaceString!==e.replaceString&&(this._replaceString=e.replaceString,r.replaceString=!0,s=!0),typeof e.isRevealed!="undefined"&&this._isRevealed!==e.isRevealed&&(this._isRevealed=e.isRevealed,r.isRevealed=!0,s=!0),typeof e.isReplaceRevealed!="undefined"&&this._isReplaceRevealed!==e.isReplaceRevealed&&(this._isReplaceRevealed=e.isReplaceRevealed,r.isReplaceRevealed=!0,s=!0),typeof e.isRegex!="undefined"&&(this._isRegex=e.isRegex),typeof e.wholeWord!="undefined"&&(this._wholeWord=e.wholeWord),typeof e.matchCase!="undefined"&&(this._matchCase=e.matchCase),typeof e.preserveCase!="undefined"&&(this._preserveCase=e.preserveCase),typeof e.searchScope!="undefined"&&(!((o=e.searchScope)===null||o===void 0)&&o.every(d=>{var h;return(h=this._searchScope)===null||h===void 0?void 0:h.some(f=>!V.equalsRange(f,d))})||(this._searchScope=e.searchScope,r.searchScope=!0,s=!0)),typeof e.loop!="undefined"&&this._loop!==e.loop&&(this._loop=e.loop,r.loop=!0,s=!0),typeof e.isSearching!="undefined"&&this._isSearching!==e.isSearching&&(this._isSearching=e.isSearching,r.isSearching=!0,s=!0),typeof e.filters!="undefined"&&(this._filters?this._filters.update(e.filters):this._filters=e.filters,r.filters=!0,s=!0),this._isRegexOverride=typeof e.isRegexOverride!="undefined"?e.isRegexOverride:0,this._wholeWordOverride=typeof e.wholeWordOverride!="undefined"?e.wholeWordOverride:0,this._matchCaseOverride=typeof e.matchCaseOverride!="undefined"?e.matchCaseOverride:0,this._preserveCaseOverride=typeof e.preserveCaseOverride!="undefined"?e.preserveCaseOverride:0,a!==this.isRegex&&(s=!0,r.isRegex=!0),l!==this.wholeWord&&(s=!0,r.wholeWord=!0),c!==this.matchCase&&(s=!0,r.matchCase=!0),u!==this.preserveCase&&(s=!0,r.preserveCase=!0),s&&this._onFindReplaceStateChange.fire(r)}canNavigateBack(){return this.canNavigateInLoop()||this.matchesPosition!==1}canNavigateForward(){return this.canNavigateInLoop()||this.matchesPosition=Nm}}const F1t=C("defaultLabel","input"),B1t=C("label.preserveCaseToggle","Preserve Case");class W1t extends LS{constructor(e){super({icon:Xe.preserveCase,title:B1t+e.appendTitle,isChecked:e.isChecked,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class V1t extends zu{constructor(e,t,n,o){super(),this._showOptionButtons=n,this.fixFocusOnOptionClickEnabled=!0,this.cachedOptionsWidth=0,this._onDidOptionChange=this._register(new le),this.onDidOptionChange=this._onDidOptionChange.event,this._onKeyDown=this._register(new le),this.onKeyDown=this._onKeyDown.event,this._onMouseDown=this._register(new le),this._onInput=this._register(new le),this._onKeyUp=this._register(new le),this._onPreserveCaseKeyDown=this._register(new le),this.onPreserveCaseKeyDown=this._onPreserveCaseKeyDown.event,this.contextViewProvider=t,this.placeholder=o.placeholder||"",this.validation=o.validation,this.label=o.label||F1t;const r=o.appendPreserveCaseLabel||"",s=o.history||[],a=!!o.flexibleHeight,l=!!o.flexibleWidth,c=o.flexibleMaxHeight;this.domNode=document.createElement("div"),this.domNode.classList.add("monaco-findInput"),this.inputBox=this._register(new X1e(this.domNode,this.contextViewProvider,{ariaLabel:this.label||"",placeholder:this.placeholder||"",validationOptions:{validation:this.validation},history:s,showHistoryHint:o.showHistoryHint,flexibleHeight:a,flexibleWidth:l,flexibleMaxHeight:c,inputBoxStyles:o.inputBoxStyles})),this.preserveCase=this._register(new W1t(Object.assign({appendTitle:r,isChecked:!1},o.toggleStyles))),this._register(this.preserveCase.onChange(h=>{this._onDidOptionChange.fire(h),!h&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this._register(this.preserveCase.onKeyDown(h=>{this._onPreserveCaseKeyDown.fire(h)})),this._showOptionButtons?this.cachedOptionsWidth=this.preserveCase.width():this.cachedOptionsWidth=0;const u=[this.preserveCase.domNode];this.onkeydown(this.domNode,h=>{if(h.equals(15)||h.equals(17)||h.equals(9)){const f=u.indexOf(document.activeElement);if(f>=0){let g=-1;h.equals(17)?g=(f+1)%u.length:h.equals(15)&&(f===0?g=u.length-1:g=f-1),h.equals(9)?(u[f].blur(),this.inputBox.focus()):g>=0&&u[g].focus(),dn.stop(h,!0)}}});const d=document.createElement("div");d.className="controls",d.style.display=this._showOptionButtons?"block":"none",d.appendChild(this.preserveCase.domNode),this.domNode.appendChild(d),e==null||e.appendChild(this.domNode),this.onkeydown(this.inputBox.inputElement,h=>this._onKeyDown.fire(h)),this.onkeyup(this.inputBox.inputElement,h=>this._onKeyUp.fire(h)),this.oninput(this.inputBox.inputElement,h=>this._onInput.fire()),this.onmousedown(this.inputBox.inputElement,h=>this._onMouseDown.fire(h))}enable(){this.domNode.classList.remove("disabled"),this.inputBox.enable(),this.preserveCase.enable()}disable(){this.domNode.classList.add("disabled"),this.inputBox.disable(),this.preserveCase.disable()}setEnabled(e){e?this.enable():this.disable()}select(){this.inputBox.select()}focus(){this.inputBox.focus()}getPreserveCase(){return this.preserveCase.checked}setPreserveCase(e){this.preserveCase.checked=e}focusOnPreserve(){this.preserveCase.focus()}validate(){var e;(e=this.inputBox)===null||e===void 0||e.validate()}set width(e){this.inputBox.paddingRight=this.cachedOptionsWidth,this.domNode.style.width=e+"px"}dispose(){super.dispose()}}var Bye=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Wye=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const mY=new lt("suggestWidgetVisible",!1,C("suggestWidgetVisible","Whether suggestion are visible")),vY="historyNavigationWidgetFocus",Vye="historyNavigationForwardsEnabled",Hye="historyNavigationBackwardsEnabled";let Zg;const oR=[];function $ye(i,e){if(oR.includes(e))throw new Error("Cannot register the same widget multiple times");oR.push(e);const t=new Be,n=new lt(vY,!1).bindTo(i),o=new lt(Vye,!0).bindTo(i),r=new lt(Hye,!0).bindTo(i),s=()=>{n.set(!0),Zg=e},a=()=>{n.set(!1),Zg===e&&(Zg=void 0)};return e.element===document.activeElement&&s(),t.add(e.onDidFocus(()=>s())),t.add(e.onDidBlur(()=>a())),t.add(zt(()=>{oR.splice(oR.indexOf(e),1),a()})),{historyNavigationForwardsEnablement:o,historyNavigationBackwardsEnablement:r,dispose(){t.dispose()}}}let Uz=class extends Y1e{constructor(e,t,n,o){super(e,t,n);const r=this._register(o.createScoped(this.inputBox.element));this._register($ye(r,this.inputBox))}};Uz=Bye([Wye(3,Ut)],Uz);let jz=class extends V1t{constructor(e,t,n,o,r=!1){super(e,t,r,n);const s=this._register(o.createScoped(this.inputBox.element));this._register($ye(s,this.inputBox))}};jz=Bye([Wye(3,Ut)],jz);Wa.registerCommandAndKeybindingRule({id:"history.showPrevious",weight:200,when:Me.and(Me.has(vY),Me.equals(Hye,!0),Me.not("isComposing"),mY.isEqualTo(!1)),primary:16,secondary:[528],handler:i=>{Zg==null||Zg.showPreviousValue()}});Wa.registerCommandAndKeybindingRule({id:"history.showNext",weight:200,when:Me.and(Me.has(vY),Me.equals(Vye,!0),Me.not("isComposing"),mY.isEqualTo(!1)),primary:18,secondary:[530],handler:i=>{Zg==null||Zg.showNextValue()}});function Jle(i){var e,t;return((e=i.lookupKeybinding("history.showPrevious"))===null||e===void 0?void 0:e.getElectronAccelerator())==="Up"&&((t=i.lookupKeybinding("history.showNext"))===null||t===void 0?void 0:t.getElectronAccelerator())==="Down"}var H1t=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};const $1t=Eo("find-selection",Xe.selection,C("findSelectionIcon","Icon for 'Find in Selection' in the editor find widget.")),ece=Eo("find-collapsed",Xe.chevronRight,C("findCollapsedIcon","Icon to indicate that the editor find widget is collapsed.")),tce=Eo("find-expanded",Xe.chevronDown,C("findExpandedIcon","Icon to indicate that the editor find widget is expanded.")),z1t=Eo("find-replace",Xe.replace,C("findReplaceIcon","Icon for 'Replace' in the editor find widget.")),U1t=Eo("find-replace-all",Xe.replaceAll,C("findReplaceAllIcon","Icon for 'Replace All' in the editor find widget.")),j1t=Eo("find-previous-match",Xe.arrowUp,C("findPreviousMatchIcon","Icon for 'Find Previous' in the editor find widget.")),K1t=Eo("find-next-match",Xe.arrowDown,C("findNextMatchIcon","Icon for 'Find Next' in the editor find widget.")),q1t=C("label.findDialog","Find / Replace"),G1t=C("label.find","Find"),X1t=C("placeholder.find","Find"),Y1t=C("label.previousMatchButton","Previous Match"),Z1t=C("label.nextMatchButton","Next Match"),Q1t=C("label.toggleSelectionFind","Find in Selection"),J1t=C("label.closeButton","Close"),eCt=C("label.replace","Replace"),tCt=C("placeholder.replace","Replace"),nCt=C("label.replaceButton","Replace"),iCt=C("label.replaceAllButton","Replace All"),oCt=C("label.toggleReplaceButton","Toggle Replace"),rCt=C("title.matchesCountLimit","Only the first {0} results are highlighted, but all find operations work on the entire text.",Nm),sCt=C("label.matchesLocation","{0} of {1}"),nce=C("label.noResults","No results"),mh=419,aCt=275,lCt=aCt-54;let Jx=69;const cCt=33,ice="ctrlEnterReplaceAll.windows.donotask",oce=Nn?256:2048;class u7{constructor(e){this.afterLineNumber=e,this.heightInPx=cCt,this.suppressMouseDown=!1,this.domNode=document.createElement("div"),this.domNode.className="dock-find-viewzone"}}function rce(i,e,t){const n=!!e.match(/\n/);if(t&&n&&t.selectionStart>0){i.stopPropagation();return}}function sce(i,e,t){const n=!!e.match(/\n/);if(t&&n&&t.selectionEndthis._updateHistoryDelayer.cancel())),this._register(this._state.onFindReplaceStateChange(u=>this._onStateChanged(u))),this._buildDomNode(),this._updateButtons(),this._tryUpdateWidgetWidth(),this._findInput.inputBox.layout(),this._register(this._codeEditor.onDidChangeConfiguration(u=>{if(u.hasChanged(90)&&(this._codeEditor.getOption(90)&&this._state.change({isReplaceRevealed:!1},!1),this._updateButtons()),u.hasChanged(143)&&this._tryUpdateWidgetWidth(),u.hasChanged(2)&&this.updateAccessibilitySupport(),u.hasChanged(41)){const d=this._codeEditor.getOption(41).loop;this._state.change({loop:d},!1);const h=this._codeEditor.getOption(41).addExtraSpaceOnTop;h&&!this._viewZone&&(this._viewZone=new u7(0),this._showViewZone()),!h&&this._viewZone&&this._removeViewZone()}})),this.updateAccessibilitySupport(),this._register(this._codeEditor.onDidChangeCursorSelection(()=>{this._isVisible&&this._updateToggleSelectionFindButton()})),this._register(this._codeEditor.onDidFocusEditorWidget(()=>H1t(this,void 0,void 0,function*(){if(this._isVisible){const u=yield this._controller.getGlobalBufferTerm();u&&u!==this._state.searchString&&(this._state.change({searchString:u},!1),this._findInput.select())}}))),this._findInputFocused=CF.bindTo(s),this._findFocusTracker=this._register(gf(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=pY.bindTo(s),this._replaceFocusTracker=this._register(gf(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(41).addExtraSpaceOnTop&&(this._viewZone=new u7(0)),this._register(this._codeEditor.onDidChangeModel(()=>{!this._isVisible||(this._viewZoneId=void 0)})),this._register(this._codeEditor.onDidScrollChange(u=>{if(u.scrollTopChanged){this._layoutViewZone();return}setTimeout(()=>{this._layoutViewZone()},0)}))}getId(){return yF.ID}getDomNode(){return this._domNode}getPosition(){return this._isVisible?{preference:0}: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(90)&&!this._isReplaceVisible&&(this._isReplaceVisible=!0,this._replaceInput.width=La(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,en)}_updateHistory(){this._state.searchString&&this._findInput.inputBox.addToHistory(),this._state.replaceString&&this._replaceInput.inputBox.addToHistory()}_updateMatchesCount(){this._matchesCount.style.minWidth=Jx+"px",this._state.matchesCount>=Nm?this._matchesCount.title=rCt:this._matchesCount.title="",this._matchesCount.firstChild&&this._matchesCount.removeChild(this._matchesCount.firstChild);let e;if(this._state.matchesCount>0){let t=String(this._state.matchesCount);this._state.matchesCount>=Nm&&(t+="+");let n=String(this._state.matchesPosition);n==="0"&&(n="?"),e=G0(sCt,n,t)}else e=nce;this._matchesCount.appendChild(document.createTextNode(e)),bs(this._getAriaLabel(e,this._state.currentMatch,this._state.searchString)),Jx=Math.max(Jx,this._matchesCount.clientWidth)}_getAriaLabel(e,t,n){if(e===nce)return n===""?C("ariaSearchNoResultEmpty","{0} found",e):C("ariaSearchNoResult","{0} found for '{1}'",e,n);if(t){const o=C("ariaSearchNoResultWithLineNum","{0} found for '{1}', at {2}",e,n,t.startLineNumber+":"+t.startColumn),r=this._codeEditor.getModel();return r&&t.startLineNumber<=r.getLineCount()&&t.startLineNumber>=1?`${r.getLineContent(t.startLineNumber)}, ${o}`:o}return C("ariaSearchNoResultWithLineNumNoCurrentMatch","{0} found for '{1}'",e,n)}_updateToggleSelectionFindButton(){const e=this._codeEditor.getSelection(),t=e?e.startLineNumber!==e.endLineNumber||e.startColumn!==e.endColumn:!1,n=this._toggleSelectionFind.checked;this._isVisible&&(n||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 n=!this._codeEditor.getOption(90);this._toggleReplaceBtn.setEnabled(this._isVisible&&n)}_reveal(){if(this._revealTimeouts.forEach(e=>{clearTimeout(e)}),this._revealTimeouts=[],!this._isVisible){this._isVisible=!0;const e=this._codeEditor.getSelection();switch(this._codeEditor.getOption(41).autoFindInSelection){case"always":this._toggleSelectionFind.checked=!0;break;case"never":this._toggleSelectionFind.checked=!1;break;case"multiline":{const n=!!e&&e.startLineNumber!==e.endLineNumber;this._toggleSelectionFind.checked=n;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(41).seedSearchStringFromSelection&&e){const n=this._codeEditor.getDomNode();if(n){const o=Yo(n),r=this._codeEditor.getScrolledVisiblePosition(e.getStartPosition()),s=o.left+(r?r.left:0),a=r?r.top:0;if(this._viewZone&&ae.startLineNumber&&(t=!1);const l=o0e(this._domNode).left;s>l&&(t=!1);const c=this._codeEditor.getScrolledVisiblePosition(e.getEndPosition());o.left+(c?c.left:0)>l&&(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(41).addExtraSpaceOnTop){this._removeViewZone();return}if(!this._isVisible)return;const n=this._viewZone;this._viewZoneId!==void 0||!n||this._codeEditor.changeViewZones(o=>{n.heightInPx=this._getHeight(),this._viewZoneId=o.addZone(n),this._codeEditor.setScrollTop(e||this._codeEditor.getScrollTop()+n.heightInPx)})}_showViewZone(e=!0){if(!this._isVisible||!this._codeEditor.getOption(41).addExtraSpaceOnTop)return;this._viewZone===void 0&&(this._viewZone=new u7(0));const n=this._viewZone;this._codeEditor.changeViewZones(o=>{if(this._viewZoneId!==void 0){const r=this._getHeight();if(r===n.heightInPx)return;const s=r-n.heightInPx;n.heightInPx=r,o.layoutZone(this._viewZoneId),e&&this._codeEditor.setScrollTop(this._codeEditor.getScrollTop()+s);return}else{let r=this._getHeight();if(r-=this._codeEditor.getOption(83).top,r<=0)return;n.heightInPx=r,this._viewZoneId=o.addZone(n),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||!Zq(this._domNode))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 n=e.width,o=e.minimap.minimapWidth;let r=!1,s=!1,a=!1;if(this._resized&&La(this._domNode)>mh){this._domNode.style.maxWidth=`${n-28-o-15}px`,this._replaceInput.width=La(this._findInput.domNode);return}if(mh+28+o>=n&&(s=!0),mh+28+o-Jx>=n&&(a=!0),mh+28+o-Jx>=n+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",s),!a&&!r&&(this._domNode.style.maxWidth=`${n-28-o-15}px`),this._findInput.layout({collapsedFindWidget:r,narrowFindWidget:a,reducedFindWidget:s}),this._resized){const l=this._findInput.inputBox.element.clientWidth;l>0&&(this._replaceInput.width=l)}else this._isReplaceVisible&&(this._replaceInput.width=La(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 n=this._state.currentMatch;return t.startLineNumber!==t.endLineNumber&&!V.equalsRange(t,n)?t:null}).filter(t=>!!t),e.length&&this._state.change({searchScope:e},!0)}}_onFindInputMouseDown(e){e.middleButton&&e.stopPropagation()}_onFindInputKeyDown(e){if(e.equals(oce|3))if(this._keybindingService.dispatchEvent(e,e.target)){e.preventDefault();return}else{this._findInput.inputBox.insertAtCursor(` -`),e.preventDefault();return}if(e.equals(2)){this._isReplaceVisible?this._replaceInput.focus():this._findInput.focusOnCaseSensitive(),e.preventDefault();return}if(e.equals(2066)){this._codeEditor.focus(),e.preventDefault();return}if(e.equals(16))return rce(e,this._findInput.getValue(),this._findInput.domNode.querySelector("textarea"));if(e.equals(18))return sce(e,this._findInput.getValue(),this._findInput.domNode.querySelector("textarea"))}_onReplaceInputKeyDown(e){if(e.equals(oce|3))if(this._keybindingService.dispatchEvent(e,e.target)){e.preventDefault();return}else{as&&Fd&&!this._ctrlEnterReplaceAllWarningPrompted&&(this._notificationService.info(C("ctrlEnter.keybindingChanged","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(ice,!0,0,0)),this._replaceInput.inputBox.insertAtCursor(` -`),e.preventDefault();return}if(e.equals(2)){this._findInput.focusOnCaseSensitive(),e.preventDefault();return}if(e.equals(1026)){this._findInput.focus(),e.preventDefault();return}if(e.equals(2066)){this._codeEditor.focus(),e.preventDefault();return}if(e.equals(16))return rce(e,this._replaceInput.inputBox.value,this._replaceInput.inputBox.element.querySelector("textarea"));if(e.equals(18))return sce(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 Uz(null,this._contextViewProvider,{width:lCt,label:G1t,placeholder:X1t,appendCaseSensitiveLabel:this._keybindingLabelFor(Ri.ToggleCaseSensitiveCommand),appendWholeWordsLabel:this._keybindingLabelFor(Ri.ToggleWholeWordCommand),appendRegexLabel:this._keybindingLabelFor(Ri.ToggleRegexCommand),validation:l=>{if(l.length===0||!this._findInput.getRegex())return null;try{return new RegExp(l,"gu"),null}catch(c){return{content:c.message}}},flexibleHeight:!0,flexibleWidth:!0,flexibleMaxHeight:118,showCommonFindToggles:!0,showHistoryHint:()=>Jle(this._keybindingService),inputBoxStyles:AP,toggleStyles:MP},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(l=>this._onFindInputKeyDown(l))),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(l=>{l.equals(1026)&&this._isReplaceVisible&&(this._replaceInput.focus(),l.preventDefault())})),this._register(this._findInput.onRegexKeyDown(l=>{l.equals(2)&&this._isReplaceVisible&&(this._replaceInput.focusOnPreserve(),l.preventDefault())})),this._register(this._findInput.inputBox.onDidHeightChange(l=>{this._tryUpdateHeight()&&this._showViewZone()})),Ss&&this._register(this._findInput.onMouseDown(l=>this._onFindInputMouseDown(l))),this._matchesCount=document.createElement("div"),this._matchesCount.className="matchesCount",this._updateMatchesCount(),this._prevBtn=this._register(new J1({label:Y1t+this._keybindingLabelFor(Ri.PreviousMatchFindAction),icon:j1t,onTrigger:()=>{s0(this._codeEditor.getAction(Ri.PreviousMatchFindAction)).run().then(void 0,en)}})),this._nextBtn=this._register(new J1({label:Z1t+this._keybindingLabelFor(Ri.NextMatchFindAction),icon:K1t,onTrigger:()=>{s0(this._codeEditor.getAction(Ri.NextMatchFindAction)).run().then(void 0,en)}}));const n=document.createElement("div");n.className="find-part",n.appendChild(this._findInput.domNode);const o=document.createElement("div");o.className="find-actions",n.appendChild(o),o.appendChild(this._matchesCount),o.appendChild(this._prevBtn.domNode),o.appendChild(this._nextBtn.domNode),this._toggleSelectionFind=this._register(new LS({icon:$1t,title:Q1t+this._keybindingLabelFor(Ri.ToggleSearchScopeCommand),isChecked:!1,inputActiveOptionBackground:ct(u0),inputActiveOptionBorder:ct(pG),inputActiveOptionForeground:ct(mG)})),this._register(this._toggleSelectionFind.onChange(()=>{if(this._toggleSelectionFind.checked){if(this._codeEditor.hasModel()){const l=this._codeEditor.getSelections();l.map(c=>(c.endColumn===1&&c.endLineNumber>c.startLineNumber&&(c=c.setEndPosition(c.endLineNumber-1,this._codeEditor.getModel().getLineMaxColumn(c.endLineNumber-1))),c.isEmpty()?null:c)).filter(c=>!!c),l.length&&this._state.change({searchScope:l},!0)}}else this._state.change({searchScope:null},!0)})),o.appendChild(this._toggleSelectionFind.domNode),this._closeBtn=this._register(new J1({label:J1t+this._keybindingLabelFor(Ri.CloseFindWidgetCommand),icon:bCe,onTrigger:()=>{this._state.change({isRevealed:!1,searchScope:null},!1)},onKeyDown:l=>{l.equals(2)&&this._isReplaceVisible&&(this._replaceBtn.isEnabled()?this._replaceBtn.focus():this._codeEditor.focus(),l.preventDefault())}})),this._replaceInput=this._register(new jz(null,void 0,{label:eCt,placeholder:tCt,appendPreserveCaseLabel:this._keybindingLabelFor(Ri.TogglePreserveCaseCommand),history:[],flexibleHeight:!0,flexibleWidth:!0,flexibleMaxHeight:118,showHistoryHint:()=>Jle(this._keybindingService),inputBoxStyles:AP,toggleStyles:MP},this._contextKeyService,!0)),this._replaceInput.setPreserveCase(!!this._state.preserveCase),this._register(this._replaceInput.onKeyDown(l=>this._onReplaceInputKeyDown(l))),this._register(this._replaceInput.inputBox.onDidChange(()=>{this._state.change({replaceString:this._replaceInput.inputBox.value},!1)})),this._register(this._replaceInput.inputBox.onDidHeightChange(l=>{this._isReplaceVisible&&this._tryUpdateHeight()&&this._showViewZone()})),this._register(this._replaceInput.onDidOptionChange(()=>{this._state.change({preserveCase:this._replaceInput.getPreserveCase()},!0)})),this._register(this._replaceInput.onPreserveCaseKeyDown(l=>{l.equals(2)&&(this._prevBtn.isEnabled()?this._prevBtn.focus():this._nextBtn.isEnabled()?this._nextBtn.focus():this._toggleSelectionFind.enabled?this._toggleSelectionFind.focus():this._closeBtn.isEnabled()&&this._closeBtn.focus(),l.preventDefault())})),this._replaceBtn=this._register(new J1({label:nCt+this._keybindingLabelFor(Ri.ReplaceOneAction),icon:z1t,onTrigger:()=>{this._controller.replace()},onKeyDown:l=>{l.equals(1026)&&(this._closeBtn.focus(),l.preventDefault())}})),this._replaceAllBtn=this._register(new J1({label:iCt+this._keybindingLabelFor(Ri.ReplaceAllAction),icon:U1t,onTrigger:()=>{this._controller.replaceAll()}}));const r=document.createElement("div");r.className="replace-part",r.appendChild(this._replaceInput.domNode);const s=document.createElement("div");s.className="replace-actions",r.appendChild(s),s.appendChild(this._replaceBtn.domNode),s.appendChild(this._replaceAllBtn.domNode),this._toggleReplaceBtn=this._register(new J1({label:oCt,className:"codicon toggle left",onTrigger:()=>{this._state.change({isReplaceRevealed:!this._isReplaceVisible},!1),this._isReplaceVisible&&(this._replaceInput.width=La(this._findInput.domNode),this._replaceInput.inputBox.layout()),this._showViewZone()}})),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=q1t,this._domNode.role="dialog",this._domNode.style.width=`${mh}px`,this._domNode.appendChild(this._toggleReplaceBtn.domNode),this._domNode.appendChild(n),this._domNode.appendChild(this._closeBtn.domNode),this._domNode.appendChild(r),this._resizeSash=new fs(this._domNode,this,{orientation:0,size:2}),this._resized=!1;let a=mh;this._register(this._resizeSash.onDidStart(()=>{a=La(this._domNode)})),this._register(this._resizeSash.onDidChange(l=>{this._resized=!0;const c=a+l.startX-l.currentX;if(cu||(this._domNode.style.width=`${c}px`,this._isReplaceVisible&&(this._replaceInput.width=La(this._findInput.domNode)),this._findInput.inputBox.layout(),this._tryUpdateHeight())})),this._register(this._resizeSash.onDidReset(()=>{const l=La(this._domNode);if(l{this._opts.onTrigger(),n.preventDefault()}),this.onkeydown(this._domNode,n=>{var o,r;if(n.equals(10)||n.equals(3)){this._opts.onTrigger(),n.preventDefault();return}(r=(o=this._opts).onKeyDown)===null||r===void 0||r.call(o,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(...Mt.asClassNameArray(ece)),this._domNode.classList.add(...Mt.asClassNameArray(tce))):(this._domNode.classList.remove(...Mt.asClassNameArray(tce)),this._domNode.classList.add(...Mt.asClassNameArray(ece)))}}Uu((i,e)=>{const t=(p,v)=>{v&&e.addRule(`.monaco-editor ${p} { background-color: ${v}; }`)};t(".findMatch",i.getColor(Zh)),t(".currentFindMatch",i.getColor(Lnt)),t(".findScope",i.getColor(Ent));const n=i.getColor(po);t(".find-widget",n);const o=i.getColor(Kh);o&&e.addRule(`.monaco-editor .find-widget { box-shadow: 0 0 8px 2px ${o}; }`);const r=i.getColor(gG);r&&e.addRule(`.monaco-editor .find-widget { border-left: 1px solid ${r}; border-right: 1px solid ${r}; border-bottom: 1px solid ${r}; }`);const s=i.getColor(Sm);s&&e.addRule(`.monaco-editor .findMatch { border: 1px ${Hd(i.type)?"dotted":"solid"} ${s}; box-sizing: border-box; }`);const a=i.getColor(Dnt);a&&e.addRule(`.monaco-editor .currentFindMatch { border: 2px solid ${a}; padding: 1px; box-sizing: border-box; }`);const l=i.getColor(knt);l&&e.addRule(`.monaco-editor .findScope { border: 1px ${Hd(i.type)?"dashed":"solid"} ${l}; }`);const c=i.getColor(Ln);c&&e.addRule(`.monaco-editor .find-widget { border: 1px solid ${c}; }`);const u=i.getColor(Xh);u&&e.addRule(`.monaco-editor .find-widget { color: ${u}; }`);const d=i.getColor(Gtt);d&&e.addRule(`.monaco-editor .find-widget.no-results .matchesCount { color: ${d}; }`);const h=i.getColor(mnt);if(h)e.addRule(`.monaco-editor .find-widget .monaco-sash { background-color: ${h}; }`);else{const p=i.getColor(Yh);p&&e.addRule(`.monaco-editor .find-widget .monaco-sash { background-color: ${p}; }`)}const f=i.getColor(dH);f&&e.addRule(` +`),parse:i=>bF.split(i).filter(e=>!e.startsWith("#"))}),ece={EDITORS:"CodeEditors",FILES:"CodeFiles"};class x1t{}const L1t={DragAndDropContribution:"workbench.contributions.dragAndDrop"};no.add(L1t.DragAndDropContribution,new x1t);class Bk{constructor(){}static getInstance(){return Bk.INSTANCE}hasData(e){return e&&e===this.proto}getData(e){if(this.hasData(e))return this.data}}Bk.INSTANCE=new Bk;var E1t=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};function Rwe(i){const e=new Iwe;for(const t of i.items){const n=t.type;if(t.kind==="string"){const o=new Promise(r=>t.getAsString(r));e.append(n,_Y(o))}else if(t.kind==="file"){const o=t.getAsFile();o&&e.append(n,D1t(o))}}return e}function D1t(i){const e=i.path?Rt.parse(i.path):void 0;return S1t(i.name,e,()=>E1t(this,void 0,void 0,function*(){return new Uint8Array(yield i.arrayBuffer())}))}const k1t=Object.freeze([ece.EDITORS,ece.FILES,pk.RESOURCES,pk.INTERNAL_URI_LIST]);function Mwe(i,e=!1){const t=Rwe(i),n=t.get(pk.INTERNAL_URI_LIST);if(n)t.replace(xo.uriList,n);else if(e||!t.has(xo.uriList)){const o=[];for(const r of i.items){const s=r.getAsFile();if(s){const a=s.path;try{a?o.push(Rt.file(a).toString()):o.push(Rt.parse(s.name,!0).toString())}catch{}}}o.length&&t.replace(xo.uriList,_Y(bF.create(o)))}for(const o of k1t)t.delete(o);return t}function I1t(i,e,t){var n,o;return{edits:[...e.map(r=>new qg(i,typeof t.insertText=="string"?{range:r,text:t.insertText,insertAsSnippet:!1}:{range:r,text:t.insertText.snippet,insertAsSnippet:!0})),...(o=(n=t.additionalEdit)===null||n===void 0?void 0:n.edits)!==null&&o!==void 0?o:[]]}}function Awe(i){var e;function t(a,l){return"providerId"in a&&a.providerId===l.providerId||"mimeType"in a&&a.mimeType===l.handledMimeType}const n=new Map;for(const a of i)for(const l of(e=a.yieldTo)!==null&&e!==void 0?e:[])for(const c of i)if(c!==a&&t(l,c)){let u=n.get(a);u||(u=[],n.set(a,u)),u.push(c)}if(!n.size)return Array.from(i);const o=new Set,r=[];function s(a){if(!a.length)return[];const l=a[0];if(r.includes(l))return console.warn(`Yield to cycle detected for ${l.providerId}`),a;if(o.has(l))return s(a.slice(1));let c=[];const u=n.get(l);return u&&(r.push(l),c=s(u),r.pop()),o.add(l),[...c,l,...s(a.slice(1))]}return s(Array.from(i))}var T1t=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},N1t=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},R1t=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};const M1t=Jt.register({description:"inline-progress-widget",stickiness:1,showIfCollapsed:!0,after:{content:q_e,inlineClassName:"inline-editor-progress-decoration",inlineClassNameAffectsLetterSpacing:!0}});class CF extends _e{constructor(e,t,n,o,r){super(),this.typeId=e,this.editor=t,this.range=n,this.delegate=r,this.allowEditorOverflow=!1,this.suppressMouseDown=!0,this.create(o),this.editor.addContentWidget(this),this.editor.layoutContentWidget(this)}create(e){this.domNode=He(".inline-progress-widget"),this.domNode.role="button",this.domNode.title=e;const t=He("span.icon");this.domNode.append(t),t.classList.add(...Mt.asClassNameArray(Xe.loading),"codicon-modifier-spin");const n=()=>{const o=this.editor.getOption(66);this.domNode.style.height=`${o}px`,this.domNode.style.width=`${Math.ceil(.8*o)}px`};n(),this._register(this.editor.onDidChangeConfiguration(o=>{(o.hasChanged(52)||o.hasChanged(66))&&n()})),this._register(ke(this.domNode,et.CLICK,o=>{this.delegate.cancel()}))}getId(){return CF.baseId+"."+this.typeId}getDomNode(){return this.domNode}getPosition(){return{position:{lineNumber:this.range.startLineNumber,column:this.range.startColumn},preference:[0]}}dispose(){super.dispose(),this.editor.removeContentWidget(this)}}CF.baseId="editor.widget.inlineProgressWidget";let bO=class extends _e{constructor(e,t,n){super(),this.id=e,this._editor=t,this._instantiationService=n,this._showDelay=500,this._showPromise=this._register(new Kr),this._currentWidget=new Kr,this._operationIdPool=0,this._currentDecorations=t.createDecorationsCollection()}showWhile(e,t,n){return R1t(this,void 0,void 0,function*(){const o=this._operationIdPool++;this._currentOperation=o,this.clear(),this._showPromise.value=Sv(()=>{const r=V.fromPositions(e);this._currentDecorations.set([{range:r,options:M1t}]).length>0&&(this._currentWidget.value=this._instantiationService.createInstance(CF,this.id,this._editor,r,t,n))},this._showDelay);try{return yield n}finally{this._currentOperation===o&&(this.clear(),this._currentOperation=void 0)}})}clear(){this._showPromise.clear(),this._currentDecorations.clear(),this._currentWidget.clear()}};bO=T1t([N1t(2,$t)],bO);var Pwe=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},NE=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},tce=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},zz;let CO=zz=class extends _e{constructor(e,t,n,o,r,s,a,l,c,u){super(),this.typeId=e,this.editor=t,this.showCommand=o,this.range=r,this.edits=s,this.onSelectNewEdit=a,this._contextMenuService=l,this._keybindingService=u,this.allowEditorOverflow=!0,this.suppressMouseDown=!0,this.create(),this.visibleContext=n.bindTo(c),this.visibleContext.set(!0),this._register(zt(()=>this.visibleContext.reset())),this.editor.addContentWidget(this),this.editor.layoutContentWidget(this),this._register(zt(()=>this.editor.removeContentWidget(this))),this._register(this.editor.onDidChangeCursorPosition(d=>{r.containsPosition(d.position)||this.dispose()})),this._register(st.runAndSubscribe(u.onDidUpdateKeybindings,()=>{this._updateButtonTitle()}))}_updateButtonTitle(){var e;const t=(e=this._keybindingService.lookupKeybinding(this.showCommand.id))===null||e===void 0?void 0:e.getLabel();this.button.element.title=this.showCommand.label+(t?` (${t})`:"")}create(){this.domNode=He(".post-edit-widget"),this.button=this._register(new D$(this.domNode,{supportIcons:!0})),this.button.label="$(insert)",this._register(ke(this.domNode,et.CLICK,()=>this.showSelector()))}getId(){return zz.baseId+"."+this.typeId}getDomNode(){return this.domNode}getPosition(){return{position:this.range.getEndPosition(),preference:[2]}}showSelector(){this._contextMenuService.showContextMenu({getAnchor:()=>{const e=Yo(this.button.element);return{x:e.left+e.width,y:e.top+e.height}},getActions:()=>this.edits.allEdits.map((e,t)=>my({id:"",label:e.label,checked:t===this.edits.activeEditIndex,run:()=>{if(t!==this.edits.activeEditIndex)return this.onSelectNewEdit(t)}}))})}};CO.baseId="editor.widget.postEditWidget";CO=zz=Pwe([NE(7,Ku),NE(8,Ut),NE(9,xi)],CO);let yO=class extends _e{constructor(e,t,n,o,r,s){super(),this._id=e,this._editor=t,this._visibleContext=n,this._showCommand=o,this._instantiationService=r,this._bulkEditService=s,this._currentWidget=this._register(new Kr),this._register(st.any(t.onDidChangeModel,t.onDidChangeModelContent)(()=>this.clear()))}applyEditAndShowIfNeeded(e,t,n,o){var r,s;return tce(this,void 0,void 0,function*(){const a=this._editor.getModel();if(!a||!e.length)return;const l=t.allEdits[t.activeEditIndex];if(!l)return;let c=[];(typeof l.insertText=="string"?l.insertText==="":l.insertText.snippet==="")?c=[]:c=e.map(v=>new qg(a.uri,typeof l.insertText=="string"?{range:v,text:l.insertText,insertAsSnippet:!1}:{range:v,text:l.insertText.snippet,insertAsSnippet:!0}));const d={edits:[...c,...(s=(r=l.additionalEdit)===null||r===void 0?void 0:r.edits)!==null&&s!==void 0?s:[]]},h=e[0],f=a.deltaDecorations([],[{range:h,options:{description:"paste-line-suffix",stickiness:0}}]);let g,p;try{g=yield this._bulkEditService.apply(d,{editor:this._editor,token:o}),p=a.getDecorationRange(f[0])}finally{a.deltaDecorations(f,[])}n&&g.isApplied&&t.allEdits.length>1&&this.show(p!=null?p:h,t,v=>tce(this,void 0,void 0,function*(){const m=this._editor.getModel();!m||(yield m.undo(),this.applyEditAndShowIfNeeded(e,{activeEditIndex:v,allEdits:t.allEdits},n,o))}))})}show(e,t,n){this.clear(),this._editor.hasModel()&&(this._currentWidget.value=this._instantiationService.createInstance(CO,this._id,this._editor,this._visibleContext,this._showCommand,e,t,n))}clear(){this._currentWidget.clear()}tryShowSelector(){var e;(e=this._currentWidget.value)===null||e===void 0||e.showSelector()}};yO=Pwe([NE(4,$t),NE(5,nT)],yO);var A1t=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Q1=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},ig=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},Uz;const Owe="editor.changePasteType",Fwe=new lt("pasteWidgetVisible",!1,C("pasteWidgetVisible","Whether the paste widget is showing")),c7="application/vnd.code.copyMetadata";let vb=Uz=class extends _e{static get(e){return e.getContribution(Uz.ID)}constructor(e,t,n,o,r,s,a){super(),this._bulkEditService=n,this._clipboardService=o,this._languageFeaturesService=r,this._quickInputService=s,this._progressService=a,this._editor=e;const l=e.getContainerDomNode();this._register(ke(l,"copy",c=>this.handleCopy(c))),this._register(ke(l,"cut",c=>this.handleCopy(c))),this._register(ke(l,"paste",c=>this.handlePaste(c),!0)),this._pasteProgressManager=this._register(new bO("pasteIntoEditor",e,t)),this._postPasteWidgetManager=this._register(t.createInstance(yO,"pasteIntoEditor",e,Fwe,{id:Owe,label:C("postPasteWidgetTitle","Show paste options...")}))}changePasteType(){this._postPasteWidgetManager.tryShowSelector()}pasteAs(e){this._editor.focus();try{this._pasteAsActionContext={preferredId:e},J4().execCommand("paste")}finally{this._pasteAsActionContext=void 0}}isPasteAsEnabled(){return this._editor.getOption(84).enabled&&!this._editor.getOption(90)}handleCopy(e){var t,n;if(!this._editor.hasTextFocus()||(qv&&this._clipboardService.writeResources([]),!e.clipboardData||!this.isPasteAsEnabled()))return;const o=this._editor.getModel(),r=this._editor.getSelections();if(!o||!(r!=null&&r.length))return;const s=this._editor.getOption(37);let a=r;const l=r.length===1&&r[0].isEmpty();if(l){if(!s)return;a=[new V(a[0].startLineNumber,1,a[0].startLineNumber,1+o.getLineLength(a[0].startLineNumber))]}const c=(t=this._editor._getViewModel())===null||t===void 0?void 0:t.getPlainTextToCopy(r,s,ls),d={multicursorText:Array.isArray(c)?c:null,pasteOnNewLine:l,mode:null},h=this._languageFeaturesService.documentPasteEditProvider.ordered(o).filter(m=>!!m.prepareDocumentPaste);if(!h.length){this.setCopyMetadata(e.clipboardData,{defaultPastePayload:d});return}const f=Rwe(e.clipboardData),g=h.flatMap(m=>{var _;return(_=m.copyMimeTypes)!==null&&_!==void 0?_:[]}),p=_F();this.setCopyMetadata(e.clipboardData,{id:p,providerCopyMimeTypes:g,defaultPastePayload:d});const v=sr(m=>ig(this,void 0,void 0,function*(){const _=hf(yield Promise.all(h.map(y=>ig(this,void 0,void 0,function*(){try{return yield y.prepareDocumentPaste(o,a,f,m)}catch(w){console.error(w);return}}))));_.reverse();for(const y of _)for(const[w,L]of y)f.replace(w,L);return f}));(n=this._currentCopyOperation)===null||n===void 0||n.dataTransferPromise.cancel(),this._currentCopyOperation={handle:p,dataTransferPromise:v}}handlePaste(e){var t,n;return ig(this,void 0,void 0,function*(){if(!e.clipboardData||!this._editor.hasTextFocus())return;(t=this._currentPasteOperation)===null||t===void 0||t.cancel(),this._currentPasteOperation=void 0;const o=this._editor.getModel(),r=this._editor.getSelections();if(!(r!=null&&r.length)||!o||!this.isPasteAsEnabled())return;const s=this.fetchCopyMetadata(e),a=Mwe(e.clipboardData);a.delete(c7);const l=[...e.clipboardData.types,...(n=s==null?void 0:s.providerCopyMimeTypes)!==null&&n!==void 0?n:[],xo.uriList],c=this._languageFeaturesService.documentPasteEditProvider.ordered(o).filter(u=>{var d;return(d=u.pasteMimeTypes)===null||d===void 0?void 0:d.some(h=>Twe(h,l))});!c.length||(e.preventDefault(),e.stopImmediatePropagation(),this._pasteAsActionContext?this.showPasteAsPick(this._pasteAsActionContext.preferredId,c,r,a,s):this.doPasteInline(c,r,a,s))})}doPasteInline(e,t,n,o){const r=sr(s=>ig(this,void 0,void 0,function*(){const a=this._editor;if(!a.hasModel())return;const l=a.getModel(),c=new Rv(a,3,void 0,s);try{if(yield this.mergeInDataFromCopy(n,o,c.token),c.token.isCancellationRequested)return;const u=e.filter(h=>nce(h,n));if(!u.length||u.length===1&&u[0].id==="text"){yield this.applyDefaultPasteHandler(n,o,c.token);return}const d=yield this.getPasteEdits(u,n,l,t,c.token);if(c.token.isCancellationRequested)return;if(d.length===1&&d[0].providerId==="text"){yield this.applyDefaultPasteHandler(n,o,c.token);return}if(d.length){const h=a.getOption(84).showPasteSelector==="afterPaste";return this._postPasteWidgetManager.applyEditAndShowIfNeeded(t,{activeEditIndex:0,allEdits:d},h,c.token)}yield this.applyDefaultPasteHandler(n,o,c.token)}finally{c.dispose(),this._currentPasteOperation===r&&(this._currentPasteOperation=void 0)}}));this._pasteProgressManager.showWhile(t[0].getEndPosition(),C("pasteIntoEditorProgress","Running paste handlers. Click to cancel"),r),this._currentPasteOperation=r}showPasteAsPick(e,t,n,o,r){const s=sr(a=>ig(this,void 0,void 0,function*(){const l=this._editor;if(!l.hasModel())return;const c=l.getModel(),u=new Rv(l,3,void 0,a);try{if(yield this.mergeInDataFromCopy(o,r,u.token),u.token.isCancellationRequested)return;let d=t.filter(p=>nce(p,o));e&&(d=d.filter(p=>p.id===e));const h=yield this.getPasteEdits(d,o,c,n,u.token);if(u.token.isCancellationRequested||!h.length)return;let f;if(e)f=h.at(0);else{const p=yield this._quickInputService.pick(h.map(v=>({label:v.label,description:v.providerId,detail:v.detail,edit:v})),{placeHolder:C("pasteAsPickerPlaceholder","Select Paste Action")});f=p==null?void 0:p.edit}if(!f)return;const g=I1t(c.uri,n,f);yield this._bulkEditService.apply(g,{editor:this._editor})}finally{u.dispose(),this._currentPasteOperation===s&&(this._currentPasteOperation=void 0)}}));this._progressService.withProgress({location:10,title:C("pasteAsProgress","Running paste handlers")},()=>s)}setCopyMetadata(e,t){e.setData(c7,JSON.stringify(t))}fetchCopyMetadata(e){var t;if(!e.clipboardData)return;const n=e.clipboardData.getData(c7);if(n)try{return JSON.parse(n)}catch{return}const[o,r]=vH.getTextData(e.clipboardData);if(r)return{defaultPastePayload:{mode:r.mode,multicursorText:(t=r.multicursorText)!==null&&t!==void 0?t:null,pasteOnNewLine:!!r.isFromEmptySelection}}}mergeInDataFromCopy(e,t,n){var o;return ig(this,void 0,void 0,function*(){if((t==null?void 0:t.id)&&((o=this._currentCopyOperation)===null||o===void 0?void 0:o.handle)===t.id){const r=yield this._currentCopyOperation.dataTransferPromise;if(n.isCancellationRequested)return;for(const[s,a]of r)e.replace(s,a)}if(!e.has(xo.uriList)){const r=yield this._clipboardService.readResources();if(n.isCancellationRequested)return;r.length&&e.append(xo.uriList,_Y(bF.create(r)))}})}getPasteEdits(e,t,n,o,r){return ig(this,void 0,void 0,function*(){const s=yield t5(Promise.all(e.map(l=>ig(this,void 0,void 0,function*(){var c;try{const u=yield(c=l.provideDocumentPasteEdits)===null||c===void 0?void 0:c.call(l,n,o,t,r);if(u)return Object.assign(Object.assign({},u),{providerId:l.id})}catch(u){console.error(u)}}))),r),a=hf(s!=null?s:[]);return Awe(a)})}applyDefaultPasteHandler(e,t,n){var o,r,s;return ig(this,void 0,void 0,function*(){const a=(o=e.get(xo.text))!==null&&o!==void 0?o:e.get("text");if(!a)return;const l=yield a.asString();if(n.isCancellationRequested)return;const c={text:l,pasteOnNewLine:(r=t==null?void 0:t.defaultPastePayload.pasteOnNewLine)!==null&&r!==void 0?r:!1,multicursorText:(s=t==null?void 0:t.defaultPastePayload.multicursorText)!==null&&s!==void 0?s:null,mode:null};this._editor.trigger("keyboard","paste",c)})}};vb.ID="editor.contrib.copyPasteActionController";vb=Uz=A1t([Q1(1,$t),Q1(2,nT),Q1(3,yp),Q1(4,pt),Q1(5,uh),Q1(6,S1e)],vb);function nce(i,e){var t;return Boolean((t=i.pasteMimeTypes)===null||t===void 0?void 0:t.some(n=>e.matches(n)))}var bY=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Wk=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},jw=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};const CY=C("builtIn","Built-in");class yY{provideDocumentPasteEdits(e,t,n,o){return jw(this,void 0,void 0,function*(){const r=yield this.getEdit(n,o);return r?{insertText:r.insertText,label:r.label,detail:r.detail,handledMimeType:r.handledMimeType,yieldTo:r.yieldTo}:void 0})}provideDocumentOnDropEdits(e,t,n,o){return jw(this,void 0,void 0,function*(){const r=yield this.getEdit(n,o);return r?{insertText:r.insertText,label:r.label,handledMimeType:r.handledMimeType,yieldTo:r.yieldTo}:void 0})}}class Bwe extends yY{constructor(){super(...arguments),this.id="text",this.dropMimeTypes=[xo.text],this.pasteMimeTypes=[xo.text]}getEdit(e,t){return jw(this,void 0,void 0,function*(){const n=e.get(xo.text);if(!n||e.has(xo.uriList))return;const o=yield n.asString();return{handledMimeType:xo.text,label:C("text.label","Insert Plain Text"),detail:CY,insertText:o}})}}class Wwe extends yY{constructor(){super(...arguments),this.id="uri",this.dropMimeTypes=[xo.uriList],this.pasteMimeTypes=[xo.uriList]}getEdit(e,t){return jw(this,void 0,void 0,function*(){const n=yield Vwe(e);if(!n.length||t.isCancellationRequested)return;let o=0;const r=n.map(({uri:a,originalText:l})=>a.scheme===hn.file?a.fsPath:(o++,l)).join(" ");let s;return o>0?s=n.length>1?C("defaultDropProvider.uriList.uris","Insert Uris"):C("defaultDropProvider.uriList.uri","Insert Uri"):s=n.length>1?C("defaultDropProvider.uriList.paths","Insert Paths"):C("defaultDropProvider.uriList.path","Insert Path"),{handledMimeType:xo.uriList,insertText:r,label:s,detail:CY}})}}let wO=class extends yY{constructor(e){super(),this._workspaceContextService=e,this.id="relativePath",this.dropMimeTypes=[xo.uriList],this.pasteMimeTypes=[xo.uriList]}getEdit(e,t){return jw(this,void 0,void 0,function*(){const n=yield Vwe(e);if(!n.length||t.isCancellationRequested)return;const o=hf(n.map(({uri:r})=>{const s=this._workspaceContextService.getWorkspaceFolder(r);return s?zst(s.uri,r):void 0}));if(!!o.length)return{handledMimeType:xo.uriList,insertText:o.join(" "),label:n.length>1?C("defaultDropProvider.uriList.relativePaths","Insert Relative Paths"):C("defaultDropProvider.uriList.relativePath","Insert Relative Path"),detail:CY}})}};wO=bY([Wk(0,ib)],wO);function Vwe(i){return jw(this,void 0,void 0,function*(){const e=i.get(xo.uriList);if(!e)return[];const t=yield e.asString(),n=[];for(const o of bF.parse(t))try{n.push({uri:Rt.parse(o),originalText:o})}catch{}return n})}let jz=class extends _e{constructor(e,t){super(),this._register(e.documentOnDropEditProvider.register("*",new Bwe)),this._register(e.documentOnDropEditProvider.register("*",new Wwe)),this._register(e.documentOnDropEditProvider.register("*",new wO(t)))}};jz=bY([Wk(0,pt),Wk(1,ib)],jz);let Kz=class extends _e{constructor(e,t){super(),this._register(e.documentPasteEditProvider.register("*",new Bwe)),this._register(e.documentPasteEditProvider.register("*",new Wwe)),this._register(e.documentPasteEditProvider.register("*",new wO(t)))}};Kz=bY([Wk(0,pt),Wk(1,ib)],Kz);zn(vb.ID,vb,0);G5(Kz);Ye(new class extends Ir{constructor(){super({id:Owe,precondition:Fwe,kbOpts:{weight:100,primary:2137}})}runEditorCommand(i,e,t){var n;return(n=vb.get(e))===null||n===void 0?void 0:n.changePasteType()}});ze(class extends ft{constructor(){super({id:"editor.action.pasteAs",label:C("pasteAs","Paste As..."),alias:"Paste As...",precondition:void 0,description:{description:"Paste as",args:[{name:"args",schema:{type:"object",properties:{id:{type:"string",description:C("pasteAs.id","The id of the paste edit to try applying. If not provided, the editor will show a picker.")}}}}]}})}run(i,e,t){var n;const o=typeof(t==null?void 0:t.id)=="string"?t.id:void 0;return(n=vb.get(e))===null||n===void 0?void 0:n.pasteAs(o)}});class P1t{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}}}class ice{constructor(e){this.identifier=e}}const Hwe=yn("treeViewsDndService");Mn(Hwe,P1t,1);var O1t=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},eR=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},Jx=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},qz;const $we="editor.experimental.dropIntoEditor.defaultProvider",zwe="editor.changeDropType",Uwe=new lt("dropWidgetVisible",!1,C("dropWidgetVisible","Whether the drop widget is showing"));let Kw=qz=class extends _e{static get(e){return e.getContribution(qz.ID)}constructor(e,t,n,o,r){super(),this._configService=n,this._languageFeaturesService=o,this._treeViewsDragAndDropService=r,this.treeItemsTransfer=Bk.getInstance(),this._dropProgressManager=this._register(t.createInstance(bO,"dropIntoEditor",e)),this._postDropWidgetManager=this._register(t.createInstance(yO,"dropIntoEditor",e,Uwe,{id:zwe,label:C("postDropWidgetTitle","Show drop options...")})),this._register(e.onDropIntoEditor(s=>this.onDropIntoEditor(e,s.position,s.event)))}changeDropType(){this._postDropWidgetManager.tryShowSelector()}onDropIntoEditor(e,t,n){var o;return Jx(this,void 0,void 0,function*(){if(!n.dataTransfer||!e.hasModel())return;(o=this._currentOperation)===null||o===void 0||o.cancel(),e.focus(),e.setPosition(t);const r=sr(s=>Jx(this,void 0,void 0,function*(){const a=new Rv(e,1,void 0,s);try{const l=yield this.extractDataTransferData(n);if(l.size===0||a.token.isCancellationRequested)return;const c=e.getModel();if(!c)return;const u=this._languageFeaturesService.documentOnDropEditProvider.ordered(c).filter(h=>h.dropMimeTypes?h.dropMimeTypes.some(f=>l.matches(f)):!0),d=yield this.getDropEdits(u,c,t,l,a);if(a.token.isCancellationRequested)return;if(d.length){const h=this.getInitialActiveEditIndex(c,d),f=e.getOption(36).showDropSelector==="afterDrop";yield this._postDropWidgetManager.applyEditAndShowIfNeeded([V.fromPositions(t)],{activeEditIndex:h,allEdits:d},f,s)}}finally{a.dispose(),this._currentOperation===r&&(this._currentOperation=void 0)}}));this._dropProgressManager.showWhile(t,C("dropIntoEditorProgress","Running drop handlers. Click to cancel"),r),this._currentOperation=r})}getDropEdits(e,t,n,o,r){return Jx(this,void 0,void 0,function*(){const s=yield t5(Promise.all(e.map(l=>Jx(this,void 0,void 0,function*(){try{const c=yield l.provideDocumentOnDropEdits(t,n,o,r.token);if(c)return Object.assign(Object.assign({},c),{providerId:l.id})}catch(c){console.error(c)}}))),r.token),a=hf(s!=null?s:[]);return Awe(a)})}getInitialActiveEditIndex(e,t){const n=this._configService.getValue($we,{resource:e.uri});for(const[o,r]of Object.entries(n)){const s=t.findIndex(a=>r===a.providerId&&a.handledMimeType&&Twe(o,[a.handledMimeType]));if(s>=0)return s}return 0}extractDataTransferData(e){return Jx(this,void 0,void 0,function*(){if(!e.dataTransfer)return new Iwe;const t=Mwe(e.dataTransfer);if(this.treeItemsTransfer.hasData(ice.prototype)){const n=this.treeItemsTransfer.getData(ice.prototype);if(Array.isArray(n))for(const o of n){const r=yield this._treeViewsDragAndDropService.removeDragOperationTransfer(o.identifier);if(r)for(const[s,a]of r)t.replace(s,a)}}return t})}};Kw.ID="editor.contrib.dropIntoEditorController";Kw=qz=O1t([eR(1,$t),eR(2,En),eR(3,pt),eR(4,Hwe)],Kw);zn(Kw.ID,Kw,2);Ye(new class extends Ir{constructor(){super({id:zwe,precondition:Uwe,kbOpts:{weight:100,primary:2137}})}runEditorCommand(i,e,t){var n;(n=Kw.get(e))===null||n===void 0||n.changeDropType()}});G5(jz);no.as(ch.Configuration).registerConfiguration(Object.assign(Object.assign({},k5),{properties:{[$we]:{type:"object",scope:5,description:C("defaultProviderDescription","Configures the default drop provider to use for content of a given mime type."),default:{},additionalProperties:{type:"string"}}}}));class Os{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&&(o.changeDecorationOptions(this._highlightedDecorationId,Os._FIND_MATCH_DECORATION),this._highlightedDecorationId=null),t!==null&&(this._highlightedDecorationId=t,o.changeDecorationOptions(this._highlightedDecorationId,Os._CURRENT_FIND_MATCH_DECORATION)),this._rangeHighlightDecorationId!==null&&(o.removeDecoration(this._rangeHighlightDecorationId),this._rangeHighlightDecorationId=null),t!==null){let r=this._editor.getModel().getDecorationRange(t);if(r.startLineNumber!==r.endLineNumber&&r.endColumn===1){const s=r.endLineNumber-1,a=this._editor.getModel().getLineMaxColumn(s);r=new V(r.startLineNumber,r.startColumn,s,a)}this._rangeHighlightDecorationId=o.addDecoration(r,Os._RANGE_HIGHLIGHT_DECORATION)}}),n}set(e,t){this._editor.changeDecorations(n=>{let o=Os._FIND_MATCH_DECORATION;const r=[];if(e.length>1e3){o=Os._FIND_MATCH_NO_OVERVIEW_DECORATION;const a=this._editor.getModel().getLineCount(),c=this._editor.getLayoutInfo().height/a,u=Math.max(2,Math.ceil(3/c));let d=e[0].range.startLineNumber,h=e[0].range.endLineNumber;for(let f=1,g=e.length;f=p.startLineNumber?p.endLineNumber>h&&(h=p.endLineNumber):(r.push({range:new V(d,1,h,1),options:Os._FIND_MATCH_ONLY_OVERVIEW_DECORATION}),d=p.startLineNumber,h=p.endLineNumber)}r.push({range:new V(d,1,h,1),options:Os._FIND_MATCH_ONLY_OVERVIEW_DECORATION})}const s=new Array(e.length);for(let a=0,l=e.length;an.removeDecoration(a)),this._findScopeDecorationIds=[]),t!=null&&t.length&&(this._findScopeDecorationIds=t.map(a=>n.addDecoration(a,Os._FIND_SCOPE_DECORATION)))})}matchBeforePosition(e){if(this._decorations.length===0)return null;for(let t=this._decorations.length-1;t>=0;t--){const n=this._decorations[t],o=this._editor.getModel().getDecorationRange(n);if(!(!o||o.endLineNumber>e.lineNumber)){if(o.endLineNumbere.column))return o}}return this._editor.getModel().getDecorationRange(this._decorations[this._decorations.length-1])}matchAfterPosition(e){if(this._decorations.length===0)return null;for(let t=0,n=this._decorations.length;te.lineNumber)return r;if(!(r.startColumn0){const n=[];for(let s=0;sV.compareRangesUsingStarts(s.range,a.range));const o=[];let r=n[0];for(let s=1;s0?e[0].toUpperCase()+e.substr(1):i[0][0].toUpperCase()!==i[0][0]&&e.length>0?e[0].toLowerCase()+e.substr(1):e}else return e}function oce(i,e,t){return i[0].indexOf(t)!==-1&&e.indexOf(t)!==-1&&i[0].split(t).length===e.split(t).length}function rce(i,e,t){const n=e.split(t),o=i[0].split(t);let r="";return n.forEach((s,a)=>{r+=jwe([o[a]],s)+t}),r.slice(0,-1)}class sce{constructor(e){this.staticValue=e,this.kind=0}}class B1t{constructor(e){this.pieces=e,this.kind=1}}class qw{static fromStaticValue(e){return new qw([P0.staticValue(e)])}get hasReplacementPatterns(){return this._state.kind===1}constructor(e){!e||e.length===0?this._state=new sce(""):e.length===1&&e[0].staticValue!==null?this._state=new sce(e[0].staticValue):this._state=new B1t(e)}buildReplaceString(e,t){if(this._state.kind===0)return t?jwe(e,this._state.staticValue):this._state.staticValue;let n="";for(let o=0,r=this._state.pieces.length;o0){const l=[],c=s.caseOps.length;let u=0;for(let d=0,h=a.length;d=c){l.push(a.slice(d));break}switch(s.caseOps[u]){case"U":l.push(a[d].toUpperCase());break;case"u":l.push(a[d].toUpperCase()),u++;break;case"L":l.push(a[d].toLowerCase());break;case"l":l.push(a[d].toLowerCase()),u++;break;default:l.push(a[d])}}a=l.join("")}n+=a}return n}static _substitute(e,t){if(t===null)return"";if(e===0)return t[0];let n="";for(;e>0;){if(e=o)break;const s=i.charCodeAt(n);switch(s){case 92:t.emitUnchanged(n-1),t.emitStatic("\\",n+1);break;case 110:t.emitUnchanged(n-1),t.emitStatic(` +`,n+1);break;case 116:t.emitUnchanged(n-1),t.emitStatic(" ",n+1);break;case 117:case 85:case 108:case 76:t.emitUnchanged(n-1),t.emitStatic("",n+1),e.push(String.fromCharCode(s));break}continue}if(r===36){if(n++,n>=o)break;const s=i.charCodeAt(n);if(s===36){t.emitUnchanged(n-1),t.emitStatic("$",n+1);continue}if(s===48||s===38){t.emitUnchanged(n-1),t.emitMatchIndex(0,n+1,e),e.length=0;continue}if(49<=s&&s<=57){let a=s-48;if(n+1this.research(!1),100),this._toDispose.add(this._updateDecorationsScheduler),this._toDispose.add(this._editor.onDidChangeCursorPosition(n=>{(n.reason===3||n.reason===5||n.reason===6)&&this._decorations.setStartPosition(this._editor.getPosition())})),this._ignoreModelContentChanged=!1,this._toDispose.add(this._editor.onDidChangeModelContent(n=>{this._ignoreModelContentChanged||(n.isFlush&&this._decorations.reset(),this._decorations.setStartPosition(this._editor.getPosition()),this._updateDecorationsScheduler.schedule())})),this._toDispose.add(this._state.onFindReplaceStateChange(n=>this._onStateChanged(n))),this.research(!1,this._state.searchScope)}dispose(){this._isDisposed=!0,si(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)},H1t)):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 n=null;typeof t!="undefined"?t!==null&&(Array.isArray(t)?n=t:n=[t]):n=this._decorations.getFindScopes(),n!==null&&(n=n.map(a=>{if(a.startLineNumber!==a.endLineNumber){let l=a.endLineNumber;return a.endColumn===1&&(l=l-1),new V(a.startLineNumber,1,l,this._editor.getModel().getLineMaxColumn(l))}return a}));const o=this._findMatches(n,!1,Rm);this._decorations.set(o,n);const r=this._editor.getSelection();let s=this._decorations.getCurrentMatchesPosition(r);if(s===0&&o.length>0){const a=$D(o.map(l=>l.range),l=>V.compareRangesUsingStarts(l,r)>=0);s=a>0?a-1+1:s}this._state.changeMatchInfo(s,this._decorations.getCount(),void 0),e&&this._editor.getOption(41).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,0),!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,0)}_prevSearchPosition(e){const t=this._state.isRegex&&(this._state.searchString.indexOf("^")>=0||this._state.searchString.indexOf("$")>=0);let{lineNumber:n,column:o}=e;const r=this._editor.getModel();return t||o===1?(n===1?n=r.getLineCount():n--,o=r.getLineMaxColumn(n)):o--,new ae(n,o)}_moveToPrevMatch(e,t=!1){if(!this._state.canNavigateBack()){const u=this._decorations.matchAfterPosition(e);u&&this._setCurrentFindMatch(u);return}if(this._decorations.getCount()=0||this._state.searchString.indexOf("$")>=0);let{lineNumber:n,column:o}=e;const r=this._editor.getModel();return t||o===r.getLineMaxColumn(n)?(n===r.getLineCount()?n=1:n++,o=1):o++,new ae(n,o)}_moveToNextMatch(e){if(!this._state.canNavigateForward()){const n=this._decorations.matchBeforePosition(e);n&&this._setCurrentFindMatch(n);return}if(this._decorations.getCount()RE._getSearchRange(this._editor.getModel(),r));return this._editor.getModel().findMatches(this._state.searchString,o,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getOption(129):null,t,n)}replaceAll(){if(!this._hasMatches())return;const e=this._decorations.getFindScopes();e===null&&this._state.matchesCount>=Rm?this._largeReplaceAll():this._regularReplaceAll(e),this.research(!1)}_largeReplaceAll(){const t=new R_(this._state.searchString,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getOption(129):null).parseSearchRequest();if(!t)return;let n=t.regex;if(!n.multiline){let d="mu";n.ignoreCase&&(d+="i"),n.global&&(d+="g"),n=new RegExp(n.source,d)}const o=this._editor.getModel(),r=o.getValue(1),s=o.getFullModelRange(),a=this._getReplacePattern();let l;const c=this._state.preserveCase;a.hasReplacementPatterns||c?l=r.replace(n,function(){return a.buildReplaceString(arguments,c)}):l=r.replace(n,a.buildReplaceString(null,c));const u=new MG(s,l,this._editor.getSelection());this._executeEditorCommand("replaceAll",u)}_regularReplaceAll(e){const t=this._getReplacePattern(),n=this._findMatches(e,t.hasReplacementPatterns||this._state.preserveCase,1073741824),o=[];for(let s=0,a=n.length;ss.range),o);this._executeEditorCommand("replaceAll",r)}selectAllMatches(){if(!this._hasMatches())return;const e=this._decorations.getFindScopes();let n=this._findMatches(e,!1,1073741824).map(r=>new gt(r.range.startLineNumber,r.range.startColumn,r.range.endLineNumber,r.range.endColumn));const o=this._editor.getSelection();for(let r=0,s=n.length;rthis._hide(),2e3)),this._isVisible=!1,this._editor=e,this._state=t,this._keybindingService=n,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 o={inputActiveOptionBorder:ct(wG),inputActiveOptionForeground:ct(SG),inputActiveOptionBackground:ct(d0)};this.caseSensitive=this._register(new eCe(Object.assign({appendTitle:this._keybindingLabelFor(Ri.ToggleCaseSensitiveCommand),isChecked:this._state.matchCase},o))),this._domNode.appendChild(this.caseSensitive.domNode),this._register(this.caseSensitive.onChange(()=>{this._state.change({matchCase:this.caseSensitive.checked},!1)})),this.wholeWords=this._register(new tCe(Object.assign({appendTitle:this._keybindingLabelFor(Ri.ToggleWholeWordCommand),isChecked:this._state.wholeWord},o))),this._domNode.appendChild(this.wholeWords.domNode),this._register(this.wholeWords.onChange(()=>{this._state.change({wholeWord:this.wholeWords.checked},!1)})),this.regex=this._register(new nCe(Object.assign({appendTitle:this._keybindingLabelFor(Ri.ToggleRegexCommand),isChecked:this._state.isRegex},o))),this._domNode.appendChild(this.regex.domNode),this._register(this.regex.onChange(()=>{this._state.change({isRegex:this.regex.checked},!1)})),this._editor.addOverlayWidget(this),this._register(this._state.onFindReplaceStateChange(r=>{let s=!1;r.isRegex&&(this.regex.checked=this._state.isRegex,s=!0),r.wholeWord&&(this.wholeWords.checked=this._state.wholeWord,s=!0),r.matchCase&&(this.caseSensitive.checked=this._state.matchCase,s=!0),!this._state.isRevealed&&s&&this._revealTemporarily()})),this._register(ke(this._domNode,et.MOUSE_LEAVE,r=>this._onMouseLeave())),this._register(ke(this._domNode,"mouseover",r=>this._onMouseOver()))}_keybindingLabelFor(e){const t=this._keybindingService.lookupKeybinding(e);return t?` (${t.getLabel()})`:""}dispose(){this._editor.removeOverlayWidget(this),super.dispose()}getId(){return wF.ID}getDomNode(){return this._domNode}getPosition(){return{preference:0}}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")}}wF.ID="editor.contrib.findOptionsWidget";function sR(i,e){return i===1?!0:i===2?!1:e}class $1t extends _e{get searchString(){return this._searchString}get replaceString(){return this._replaceString}get isRevealed(){return this._isRevealed}get isReplaceRevealed(){return this._isReplaceRevealed}get isRegex(){return sR(this._isRegexOverride,this._isRegex)}get wholeWord(){return sR(this._wholeWordOverride,this._wholeWord)}get matchCase(){return sR(this._matchCaseOverride,this._matchCase)}get preserveCase(){return sR(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}constructor(){super(),this._onFindReplaceStateChange=this._register(new le),this.onFindReplaceStateChange=this._onFindReplaceStateChange.event,this._searchString="",this._replaceString="",this._isRevealed=!1,this._isReplaceRevealed=!1,this._isRegex=!1,this._isRegexOverride=0,this._wholeWord=!1,this._wholeWordOverride=0,this._matchCase=!1,this._matchCaseOverride=0,this._preserveCase=!1,this._preserveCaseOverride=0,this._searchScope=null,this._matchesPosition=0,this._matchesCount=0,this._currentMatch=null,this._loop=!0,this._isSearching=!1,this._filters=null}changeMatchInfo(e,t,n){const o={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,o.matchesPosition=!0,r=!0),this._matchesCount!==t&&(this._matchesCount=t,o.matchesCount=!0,r=!0),typeof n!="undefined"&&(V.equalsRange(this._currentMatch,n)||(this._currentMatch=n,o.currentMatch=!0,r=!0)),r&&this._onFindReplaceStateChange.fire(o)}change(e,t,n=!0){var o;const r={moveCursor:t,updateHistory:n,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 s=!1;const a=this.isRegex,l=this.wholeWord,c=this.matchCase,u=this.preserveCase;typeof e.searchString!="undefined"&&this._searchString!==e.searchString&&(this._searchString=e.searchString,r.searchString=!0,s=!0),typeof e.replaceString!="undefined"&&this._replaceString!==e.replaceString&&(this._replaceString=e.replaceString,r.replaceString=!0,s=!0),typeof e.isRevealed!="undefined"&&this._isRevealed!==e.isRevealed&&(this._isRevealed=e.isRevealed,r.isRevealed=!0,s=!0),typeof e.isReplaceRevealed!="undefined"&&this._isReplaceRevealed!==e.isReplaceRevealed&&(this._isReplaceRevealed=e.isReplaceRevealed,r.isReplaceRevealed=!0,s=!0),typeof e.isRegex!="undefined"&&(this._isRegex=e.isRegex),typeof e.wholeWord!="undefined"&&(this._wholeWord=e.wholeWord),typeof e.matchCase!="undefined"&&(this._matchCase=e.matchCase),typeof e.preserveCase!="undefined"&&(this._preserveCase=e.preserveCase),typeof e.searchScope!="undefined"&&(!((o=e.searchScope)===null||o===void 0)&&o.every(d=>{var h;return(h=this._searchScope)===null||h===void 0?void 0:h.some(f=>!V.equalsRange(f,d))})||(this._searchScope=e.searchScope,r.searchScope=!0,s=!0)),typeof e.loop!="undefined"&&this._loop!==e.loop&&(this._loop=e.loop,r.loop=!0,s=!0),typeof e.isSearching!="undefined"&&this._isSearching!==e.isSearching&&(this._isSearching=e.isSearching,r.isSearching=!0,s=!0),typeof e.filters!="undefined"&&(this._filters?this._filters.update(e.filters):this._filters=e.filters,r.filters=!0,s=!0),this._isRegexOverride=typeof e.isRegexOverride!="undefined"?e.isRegexOverride:0,this._wholeWordOverride=typeof e.wholeWordOverride!="undefined"?e.wholeWordOverride:0,this._matchCaseOverride=typeof e.matchCaseOverride!="undefined"?e.matchCaseOverride:0,this._preserveCaseOverride=typeof e.preserveCaseOverride!="undefined"?e.preserveCaseOverride:0,a!==this.isRegex&&(s=!0,r.isRegex=!0),l!==this.wholeWord&&(s=!0,r.wholeWord=!0),c!==this.matchCase&&(s=!0,r.matchCase=!0),u!==this.preserveCase&&(s=!0,r.preserveCase=!0),s&&this._onFindReplaceStateChange.fire(r)}canNavigateBack(){return this.canNavigateInLoop()||this.matchesPosition!==1}canNavigateForward(){return this.canNavigateInLoop()||this.matchesPosition=Rm}}const z1t=C("defaultLabel","input"),U1t=C("label.preserveCaseToggle","Preserve Case");class j1t extends ES{constructor(e){super({icon:Xe.preserveCase,title:U1t+e.appendTitle,isChecked:e.isChecked,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class K1t extends Uu{constructor(e,t,n,o){super(),this._showOptionButtons=n,this.fixFocusOnOptionClickEnabled=!0,this.cachedOptionsWidth=0,this._onDidOptionChange=this._register(new le),this.onDidOptionChange=this._onDidOptionChange.event,this._onKeyDown=this._register(new le),this.onKeyDown=this._onKeyDown.event,this._onMouseDown=this._register(new le),this._onInput=this._register(new le),this._onKeyUp=this._register(new le),this._onPreserveCaseKeyDown=this._register(new le),this.onPreserveCaseKeyDown=this._onPreserveCaseKeyDown.event,this.contextViewProvider=t,this.placeholder=o.placeholder||"",this.validation=o.validation,this.label=o.label||z1t;const r=o.appendPreserveCaseLabel||"",s=o.history||[],a=!!o.flexibleHeight,l=!!o.flexibleWidth,c=o.flexibleMaxHeight;this.domNode=document.createElement("div"),this.domNode.classList.add("monaco-findInput"),this.inputBox=this._register(new iCe(this.domNode,this.contextViewProvider,{ariaLabel:this.label||"",placeholder:this.placeholder||"",validationOptions:{validation:this.validation},history:s,showHistoryHint:o.showHistoryHint,flexibleHeight:a,flexibleWidth:l,flexibleMaxHeight:c,inputBoxStyles:o.inputBoxStyles})),this.preserveCase=this._register(new j1t(Object.assign({appendTitle:r,isChecked:!1},o.toggleStyles))),this._register(this.preserveCase.onChange(h=>{this._onDidOptionChange.fire(h),!h&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this._register(this.preserveCase.onKeyDown(h=>{this._onPreserveCaseKeyDown.fire(h)})),this._showOptionButtons?this.cachedOptionsWidth=this.preserveCase.width():this.cachedOptionsWidth=0;const u=[this.preserveCase.domNode];this.onkeydown(this.domNode,h=>{if(h.equals(15)||h.equals(17)||h.equals(9)){const f=u.indexOf(document.activeElement);if(f>=0){let g=-1;h.equals(17)?g=(f+1)%u.length:h.equals(15)&&(f===0?g=u.length-1:g=f-1),h.equals(9)?(u[f].blur(),this.inputBox.focus()):g>=0&&u[g].focus(),dn.stop(h,!0)}}});const d=document.createElement("div");d.className="controls",d.style.display=this._showOptionButtons?"block":"none",d.appendChild(this.preserveCase.domNode),this.domNode.appendChild(d),e==null||e.appendChild(this.domNode),this.onkeydown(this.inputBox.inputElement,h=>this._onKeyDown.fire(h)),this.onkeyup(this.inputBox.inputElement,h=>this._onKeyUp.fire(h)),this.oninput(this.inputBox.inputElement,h=>this._onInput.fire()),this.onmousedown(this.inputBox.inputElement,h=>this._onMouseDown.fire(h))}enable(){this.domNode.classList.remove("disabled"),this.inputBox.enable(),this.preserveCase.enable()}disable(){this.domNode.classList.add("disabled"),this.inputBox.disable(),this.preserveCase.disable()}setEnabled(e){e?this.enable():this.disable()}select(){this.inputBox.select()}focus(){this.inputBox.focus()}getPreserveCase(){return this.preserveCase.checked}setPreserveCase(e){this.preserveCase.checked=e}focusOnPreserve(){this.preserveCase.focus()}validate(){var e;(e=this.inputBox)===null||e===void 0||e.validate()}set width(e){this.inputBox.paddingRight=this.cachedOptionsWidth,this.domNode.style.width=e+"px"}dispose(){super.dispose()}}var Kwe=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},qwe=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const SY=new lt("suggestWidgetVisible",!1,C("suggestWidgetVisible","Whether suggestion are visible")),xY="historyNavigationWidgetFocus",Gwe="historyNavigationForwardsEnabled",Xwe="historyNavigationBackwardsEnabled";let Qg;const aR=[];function Ywe(i,e){if(aR.includes(e))throw new Error("Cannot register the same widget multiple times");aR.push(e);const t=new Be,n=new lt(xY,!1).bindTo(i),o=new lt(Gwe,!0).bindTo(i),r=new lt(Xwe,!0).bindTo(i),s=()=>{n.set(!0),Qg=e},a=()=>{n.set(!1),Qg===e&&(Qg=void 0)};return e.element===document.activeElement&&s(),t.add(e.onDidFocus(()=>s())),t.add(e.onDidBlur(()=>a())),t.add(zt(()=>{aR.splice(aR.indexOf(e),1),a()})),{historyNavigationForwardsEnablement:o,historyNavigationBackwardsEnablement:r,dispose(){t.dispose()}}}let Gz=class extends oCe{constructor(e,t,n,o){super(e,t,n);const r=this._register(o.createScoped(this.inputBox.element));this._register(Ywe(r,this.inputBox))}};Gz=Kwe([qwe(3,Ut)],Gz);let Xz=class extends K1t{constructor(e,t,n,o,r=!1){super(e,t,r,n);const s=this._register(o.createScoped(this.inputBox.element));this._register(Ywe(s,this.inputBox))}};Xz=Kwe([qwe(3,Ut)],Xz);Va.registerCommandAndKeybindingRule({id:"history.showPrevious",weight:200,when:Me.and(Me.has(xY),Me.equals(Xwe,!0),Me.not("isComposing"),SY.isEqualTo(!1)),primary:16,secondary:[528],handler:i=>{Qg==null||Qg.showPreviousValue()}});Va.registerCommandAndKeybindingRule({id:"history.showNext",weight:200,when:Me.and(Me.has(xY),Me.equals(Gwe,!0),Me.not("isComposing"),SY.isEqualTo(!1)),primary:18,secondary:[530],handler:i=>{Qg==null||Qg.showNextValue()}});function ace(i){var e,t;return((e=i.lookupKeybinding("history.showPrevious"))===null||e===void 0?void 0:e.getElectronAccelerator())==="Up"&&((t=i.lookupKeybinding("history.showNext"))===null||t===void 0?void 0:t.getElectronAccelerator())==="Down"}var q1t=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};const G1t=Eo("find-selection",Xe.selection,C("findSelectionIcon","Icon for 'Find in Selection' in the editor find widget.")),lce=Eo("find-collapsed",Xe.chevronRight,C("findCollapsedIcon","Icon to indicate that the editor find widget is collapsed.")),cce=Eo("find-expanded",Xe.chevronDown,C("findExpandedIcon","Icon to indicate that the editor find widget is expanded.")),X1t=Eo("find-replace",Xe.replace,C("findReplaceIcon","Icon for 'Replace' in the editor find widget.")),Y1t=Eo("find-replace-all",Xe.replaceAll,C("findReplaceAllIcon","Icon for 'Replace All' in the editor find widget.")),Z1t=Eo("find-previous-match",Xe.arrowUp,C("findPreviousMatchIcon","Icon for 'Find Previous' in the editor find widget.")),Q1t=Eo("find-next-match",Xe.arrowDown,C("findNextMatchIcon","Icon for 'Find Next' in the editor find widget.")),J1t=C("label.findDialog","Find / Replace"),eCt=C("label.find","Find"),tCt=C("placeholder.find","Find"),nCt=C("label.previousMatchButton","Previous Match"),iCt=C("label.nextMatchButton","Next Match"),oCt=C("label.toggleSelectionFind","Find in Selection"),rCt=C("label.closeButton","Close"),sCt=C("label.replace","Replace"),aCt=C("placeholder.replace","Replace"),lCt=C("label.replaceButton","Replace"),cCt=C("label.replaceAllButton","Replace All"),uCt=C("label.toggleReplaceButton","Toggle Replace"),dCt=C("title.matchesCountLimit","Only the first {0} results are highlighted, but all find operations work on the entire text.",Rm),hCt=C("label.matchesLocation","{0} of {1}"),uce=C("label.noResults","No results"),_h=419,fCt=275,gCt=fCt-54;let eL=69;const pCt=33,dce="ctrlEnterReplaceAll.windows.donotask",hce=Nn?256:2048;class u7{constructor(e){this.afterLineNumber=e,this.heightInPx=pCt,this.suppressMouseDown=!1,this.domNode=document.createElement("div"),this.domNode.className="dock-find-viewzone"}}function fce(i,e,t){const n=!!e.match(/\n/);if(t&&n&&t.selectionStart>0){i.stopPropagation();return}}function gce(i,e,t){const n=!!e.match(/\n/);if(t&&n&&t.selectionEndthis._updateHistoryDelayer.cancel())),this._register(this._state.onFindReplaceStateChange(u=>this._onStateChanged(u))),this._buildDomNode(),this._updateButtons(),this._tryUpdateWidgetWidth(),this._findInput.inputBox.layout(),this._register(this._codeEditor.onDidChangeConfiguration(u=>{if(u.hasChanged(90)&&(this._codeEditor.getOption(90)&&this._state.change({isReplaceRevealed:!1},!1),this._updateButtons()),u.hasChanged(143)&&this._tryUpdateWidgetWidth(),u.hasChanged(2)&&this.updateAccessibilitySupport(),u.hasChanged(41)){const d=this._codeEditor.getOption(41).loop;this._state.change({loop:d},!1);const h=this._codeEditor.getOption(41).addExtraSpaceOnTop;h&&!this._viewZone&&(this._viewZone=new u7(0),this._showViewZone()),!h&&this._viewZone&&this._removeViewZone()}})),this.updateAccessibilitySupport(),this._register(this._codeEditor.onDidChangeCursorSelection(()=>{this._isVisible&&this._updateToggleSelectionFindButton()})),this._register(this._codeEditor.onDidFocusEditorWidget(()=>q1t(this,void 0,void 0,function*(){if(this._isVisible){const u=yield this._controller.getGlobalBufferTerm();u&&u!==this._state.searchString&&(this._state.change({searchString:u},!1),this._findInput.select())}}))),this._findInputFocused=yF.bindTo(s),this._findFocusTracker=this._register(pf(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=wY.bindTo(s),this._replaceFocusTracker=this._register(pf(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(41).addExtraSpaceOnTop&&(this._viewZone=new u7(0)),this._register(this._codeEditor.onDidChangeModel(()=>{!this._isVisible||(this._viewZoneId=void 0)})),this._register(this._codeEditor.onDidScrollChange(u=>{if(u.scrollTopChanged){this._layoutViewZone();return}setTimeout(()=>{this._layoutViewZone()},0)}))}getId(){return SF.ID}getDomNode(){return this._domNode}getPosition(){return this._isVisible?{preference:0}: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(90)&&!this._isReplaceVisible&&(this._isReplaceVisible=!0,this._replaceInput.width=Ea(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,en)}_updateHistory(){this._state.searchString&&this._findInput.inputBox.addToHistory(),this._state.replaceString&&this._replaceInput.inputBox.addToHistory()}_updateMatchesCount(){this._matchesCount.style.minWidth=eL+"px",this._state.matchesCount>=Rm?this._matchesCount.title=dCt:this._matchesCount.title="",this._matchesCount.firstChild&&this._matchesCount.removeChild(this._matchesCount.firstChild);let e;if(this._state.matchesCount>0){let t=String(this._state.matchesCount);this._state.matchesCount>=Rm&&(t+="+");let n=String(this._state.matchesPosition);n==="0"&&(n="?"),e=X0(hCt,n,t)}else e=uce;this._matchesCount.appendChild(document.createTextNode(e)),Cs(this._getAriaLabel(e,this._state.currentMatch,this._state.searchString)),eL=Math.max(eL,this._matchesCount.clientWidth)}_getAriaLabel(e,t,n){if(e===uce)return n===""?C("ariaSearchNoResultEmpty","{0} found",e):C("ariaSearchNoResult","{0} found for '{1}'",e,n);if(t){const o=C("ariaSearchNoResultWithLineNum","{0} found for '{1}', at {2}",e,n,t.startLineNumber+":"+t.startColumn),r=this._codeEditor.getModel();return r&&t.startLineNumber<=r.getLineCount()&&t.startLineNumber>=1?`${r.getLineContent(t.startLineNumber)}, ${o}`:o}return C("ariaSearchNoResultWithLineNumNoCurrentMatch","{0} found for '{1}'",e,n)}_updateToggleSelectionFindButton(){const e=this._codeEditor.getSelection(),t=e?e.startLineNumber!==e.endLineNumber||e.startColumn!==e.endColumn:!1,n=this._toggleSelectionFind.checked;this._isVisible&&(n||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 n=!this._codeEditor.getOption(90);this._toggleReplaceBtn.setEnabled(this._isVisible&&n)}_reveal(){if(this._revealTimeouts.forEach(e=>{clearTimeout(e)}),this._revealTimeouts=[],!this._isVisible){this._isVisible=!0;const e=this._codeEditor.getSelection();switch(this._codeEditor.getOption(41).autoFindInSelection){case"always":this._toggleSelectionFind.checked=!0;break;case"never":this._toggleSelectionFind.checked=!1;break;case"multiline":{const n=!!e&&e.startLineNumber!==e.endLineNumber;this._toggleSelectionFind.checked=n;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(41).seedSearchStringFromSelection&&e){const n=this._codeEditor.getDomNode();if(n){const o=Yo(n),r=this._codeEditor.getScrolledVisiblePosition(e.getStartPosition()),s=o.left+(r?r.left:0),a=r?r.top:0;if(this._viewZone&&ae.startLineNumber&&(t=!1);const l=h0e(this._domNode).left;s>l&&(t=!1);const c=this._codeEditor.getScrolledVisiblePosition(e.getEndPosition());o.left+(c?c.left:0)>l&&(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(41).addExtraSpaceOnTop){this._removeViewZone();return}if(!this._isVisible)return;const n=this._viewZone;this._viewZoneId!==void 0||!n||this._codeEditor.changeViewZones(o=>{n.heightInPx=this._getHeight(),this._viewZoneId=o.addZone(n),this._codeEditor.setScrollTop(e||this._codeEditor.getScrollTop()+n.heightInPx)})}_showViewZone(e=!0){if(!this._isVisible||!this._codeEditor.getOption(41).addExtraSpaceOnTop)return;this._viewZone===void 0&&(this._viewZone=new u7(0));const n=this._viewZone;this._codeEditor.changeViewZones(o=>{if(this._viewZoneId!==void 0){const r=this._getHeight();if(r===n.heightInPx)return;const s=r-n.heightInPx;n.heightInPx=r,o.layoutZone(this._viewZoneId),e&&this._codeEditor.setScrollTop(this._codeEditor.getScrollTop()+s);return}else{let r=this._getHeight();if(r-=this._codeEditor.getOption(83).top,r<=0)return;n.heightInPx=r,this._viewZoneId=o.addZone(n),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||!oG(this._domNode))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 n=e.width,o=e.minimap.minimapWidth;let r=!1,s=!1,a=!1;if(this._resized&&Ea(this._domNode)>_h){this._domNode.style.maxWidth=`${n-28-o-15}px`,this._replaceInput.width=Ea(this._findInput.domNode);return}if(_h+28+o>=n&&(s=!0),_h+28+o-eL>=n&&(a=!0),_h+28+o-eL>=n+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",s),!a&&!r&&(this._domNode.style.maxWidth=`${n-28-o-15}px`),this._findInput.layout({collapsedFindWidget:r,narrowFindWidget:a,reducedFindWidget:s}),this._resized){const l=this._findInput.inputBox.element.clientWidth;l>0&&(this._replaceInput.width=l)}else this._isReplaceVisible&&(this._replaceInput.width=Ea(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 n=this._state.currentMatch;return t.startLineNumber!==t.endLineNumber&&!V.equalsRange(t,n)?t:null}).filter(t=>!!t),e.length&&this._state.change({searchScope:e},!0)}}_onFindInputMouseDown(e){e.middleButton&&e.stopPropagation()}_onFindInputKeyDown(e){if(e.equals(hce|3))if(this._keybindingService.dispatchEvent(e,e.target)){e.preventDefault();return}else{this._findInput.inputBox.insertAtCursor(` +`),e.preventDefault();return}if(e.equals(2)){this._isReplaceVisible?this._replaceInput.focus():this._findInput.focusOnCaseSensitive(),e.preventDefault();return}if(e.equals(2066)){this._codeEditor.focus(),e.preventDefault();return}if(e.equals(16))return fce(e,this._findInput.getValue(),this._findInput.domNode.querySelector("textarea"));if(e.equals(18))return gce(e,this._findInput.getValue(),this._findInput.domNode.querySelector("textarea"))}_onReplaceInputKeyDown(e){if(e.equals(hce|3))if(this._keybindingService.dispatchEvent(e,e.target)){e.preventDefault();return}else{ls&&Fd&&!this._ctrlEnterReplaceAllWarningPrompted&&(this._notificationService.info(C("ctrlEnter.keybindingChanged","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(dce,!0,0,0)),this._replaceInput.inputBox.insertAtCursor(` +`),e.preventDefault();return}if(e.equals(2)){this._findInput.focusOnCaseSensitive(),e.preventDefault();return}if(e.equals(1026)){this._findInput.focus(),e.preventDefault();return}if(e.equals(2066)){this._codeEditor.focus(),e.preventDefault();return}if(e.equals(16))return fce(e,this._replaceInput.inputBox.value,this._replaceInput.inputBox.element.querySelector("textarea"));if(e.equals(18))return gce(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 Gz(null,this._contextViewProvider,{width:gCt,label:eCt,placeholder:tCt,appendCaseSensitiveLabel:this._keybindingLabelFor(Ri.ToggleCaseSensitiveCommand),appendWholeWordsLabel:this._keybindingLabelFor(Ri.ToggleWholeWordCommand),appendRegexLabel:this._keybindingLabelFor(Ri.ToggleRegexCommand),validation:l=>{if(l.length===0||!this._findInput.getRegex())return null;try{return new RegExp(l,"gu"),null}catch(c){return{content:c.message}}},flexibleHeight:!0,flexibleWidth:!0,flexibleMaxHeight:118,showCommonFindToggles:!0,showHistoryHint:()=>ace(this._keybindingService),inputBoxStyles:FP,toggleStyles:OP},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(l=>this._onFindInputKeyDown(l))),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(l=>{l.equals(1026)&&this._isReplaceVisible&&(this._replaceInput.focus(),l.preventDefault())})),this._register(this._findInput.onRegexKeyDown(l=>{l.equals(2)&&this._isReplaceVisible&&(this._replaceInput.focusOnPreserve(),l.preventDefault())})),this._register(this._findInput.inputBox.onDidHeightChange(l=>{this._tryUpdateHeight()&&this._showViewZone()})),xs&&this._register(this._findInput.onMouseDown(l=>this._onFindInputMouseDown(l))),this._matchesCount=document.createElement("div"),this._matchesCount.className="matchesCount",this._updateMatchesCount(),this._prevBtn=this._register(new J1({label:nCt+this._keybindingLabelFor(Ri.PreviousMatchFindAction),icon:Z1t,onTrigger:()=>{a0(this._codeEditor.getAction(Ri.PreviousMatchFindAction)).run().then(void 0,en)}})),this._nextBtn=this._register(new J1({label:iCt+this._keybindingLabelFor(Ri.NextMatchFindAction),icon:Q1t,onTrigger:()=>{a0(this._codeEditor.getAction(Ri.NextMatchFindAction)).run().then(void 0,en)}}));const n=document.createElement("div");n.className="find-part",n.appendChild(this._findInput.domNode);const o=document.createElement("div");o.className="find-actions",n.appendChild(o),o.appendChild(this._matchesCount),o.appendChild(this._prevBtn.domNode),o.appendChild(this._nextBtn.domNode),this._toggleSelectionFind=this._register(new ES({icon:G1t,title:oCt+this._keybindingLabelFor(Ri.ToggleSearchScopeCommand),isChecked:!1,inputActiveOptionBackground:ct(d0),inputActiveOptionBorder:ct(wG),inputActiveOptionForeground:ct(SG)})),this._register(this._toggleSelectionFind.onChange(()=>{if(this._toggleSelectionFind.checked){if(this._codeEditor.hasModel()){const l=this._codeEditor.getSelections();l.map(c=>(c.endColumn===1&&c.endLineNumber>c.startLineNumber&&(c=c.setEndPosition(c.endLineNumber-1,this._codeEditor.getModel().getLineMaxColumn(c.endLineNumber-1))),c.isEmpty()?null:c)).filter(c=>!!c),l.length&&this._state.change({searchScope:l},!0)}}else this._state.change({searchScope:null},!0)})),o.appendChild(this._toggleSelectionFind.domNode),this._closeBtn=this._register(new J1({label:rCt+this._keybindingLabelFor(Ri.CloseFindWidgetCommand),icon:DCe,onTrigger:()=>{this._state.change({isRevealed:!1,searchScope:null},!1)},onKeyDown:l=>{l.equals(2)&&this._isReplaceVisible&&(this._replaceBtn.isEnabled()?this._replaceBtn.focus():this._codeEditor.focus(),l.preventDefault())}})),this._replaceInput=this._register(new Xz(null,void 0,{label:sCt,placeholder:aCt,appendPreserveCaseLabel:this._keybindingLabelFor(Ri.TogglePreserveCaseCommand),history:[],flexibleHeight:!0,flexibleWidth:!0,flexibleMaxHeight:118,showHistoryHint:()=>ace(this._keybindingService),inputBoxStyles:FP,toggleStyles:OP},this._contextKeyService,!0)),this._replaceInput.setPreserveCase(!!this._state.preserveCase),this._register(this._replaceInput.onKeyDown(l=>this._onReplaceInputKeyDown(l))),this._register(this._replaceInput.inputBox.onDidChange(()=>{this._state.change({replaceString:this._replaceInput.inputBox.value},!1)})),this._register(this._replaceInput.inputBox.onDidHeightChange(l=>{this._isReplaceVisible&&this._tryUpdateHeight()&&this._showViewZone()})),this._register(this._replaceInput.onDidOptionChange(()=>{this._state.change({preserveCase:this._replaceInput.getPreserveCase()},!0)})),this._register(this._replaceInput.onPreserveCaseKeyDown(l=>{l.equals(2)&&(this._prevBtn.isEnabled()?this._prevBtn.focus():this._nextBtn.isEnabled()?this._nextBtn.focus():this._toggleSelectionFind.enabled?this._toggleSelectionFind.focus():this._closeBtn.isEnabled()&&this._closeBtn.focus(),l.preventDefault())})),this._replaceBtn=this._register(new J1({label:lCt+this._keybindingLabelFor(Ri.ReplaceOneAction),icon:X1t,onTrigger:()=>{this._controller.replace()},onKeyDown:l=>{l.equals(1026)&&(this._closeBtn.focus(),l.preventDefault())}})),this._replaceAllBtn=this._register(new J1({label:cCt+this._keybindingLabelFor(Ri.ReplaceAllAction),icon:Y1t,onTrigger:()=>{this._controller.replaceAll()}}));const r=document.createElement("div");r.className="replace-part",r.appendChild(this._replaceInput.domNode);const s=document.createElement("div");s.className="replace-actions",r.appendChild(s),s.appendChild(this._replaceBtn.domNode),s.appendChild(this._replaceAllBtn.domNode),this._toggleReplaceBtn=this._register(new J1({label:uCt,className:"codicon toggle left",onTrigger:()=>{this._state.change({isReplaceRevealed:!this._isReplaceVisible},!1),this._isReplaceVisible&&(this._replaceInput.width=Ea(this._findInput.domNode),this._replaceInput.inputBox.layout()),this._showViewZone()}})),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=J1t,this._domNode.role="dialog",this._domNode.style.width=`${_h}px`,this._domNode.appendChild(this._toggleReplaceBtn.domNode),this._domNode.appendChild(n),this._domNode.appendChild(this._closeBtn.domNode),this._domNode.appendChild(r),this._resizeSash=new gs(this._domNode,this,{orientation:0,size:2}),this._resized=!1;let a=_h;this._register(this._resizeSash.onDidStart(()=>{a=Ea(this._domNode)})),this._register(this._resizeSash.onDidChange(l=>{this._resized=!0;const c=a+l.startX-l.currentX;if(c<_h)return;const u=parseFloat(Q4(this._domNode).maxWidth)||0;c>u||(this._domNode.style.width=`${c}px`,this._isReplaceVisible&&(this._replaceInput.width=Ea(this._findInput.domNode)),this._findInput.inputBox.layout(),this._tryUpdateHeight())})),this._register(this._resizeSash.onDidReset(()=>{const l=Ea(this._domNode);if(l<_h)return;let c=_h;if(!this._resized||l===_h){const u=this._codeEditor.getLayoutInfo();c=u.width-28-u.minimap.minimapWidth-15,this._resized=!0}this._domNode.style.width=`${c}px`,this._isReplaceVisible&&(this._replaceInput.width=Ea(this._findInput.domNode)),this._findInput.inputBox.layout()}))}updateAccessibilitySupport(){const e=this._codeEditor.getOption(2);this._findInput.setFocusInputOnOptionClick(e!==2)}}SF.ID="editor.contrib.findWidget";class J1 extends Uu{constructor(e){super(),this._opts=e;let t="button";this._opts.className&&(t=t+" "+this._opts.className),this._opts.icon&&(t=t+" "+Mt.asClassName(this._opts.icon)),this._domNode=document.createElement("div"),this._domNode.title=this._opts.label,this._domNode.tabIndex=0,this._domNode.className=t,this._domNode.setAttribute("role","button"),this._domNode.setAttribute("aria-label",this._opts.label),this.onclick(this._domNode,n=>{this._opts.onTrigger(),n.preventDefault()}),this.onkeydown(this._domNode,n=>{var o,r;if(n.equals(10)||n.equals(3)){this._opts.onTrigger(),n.preventDefault();return}(r=(o=this._opts).onKeyDown)===null||r===void 0||r.call(o,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(...Mt.asClassNameArray(lce)),this._domNode.classList.add(...Mt.asClassNameArray(cce))):(this._domNode.classList.remove(...Mt.asClassNameArray(cce)),this._domNode.classList.add(...Mt.asClassNameArray(lce)))}}ju((i,e)=>{const t=(p,v)=>{v&&e.addRule(`.monaco-editor ${p} { background-color: ${v}; }`)};t(".findMatch",i.getColor(Jh)),t(".currentFindMatch",i.getColor(Nnt)),t(".findScope",i.getColor(Rnt));const n=i.getColor(po);t(".find-widget",n);const o=i.getColor(Gh);o&&e.addRule(`.monaco-editor .find-widget { box-shadow: 0 0 8px 2px ${o}; }`);const r=i.getColor(yG);r&&e.addRule(`.monaco-editor .find-widget { border-left: 1px solid ${r}; border-right: 1px solid ${r}; border-bottom: 1px solid ${r}; }`);const s=i.getColor(xm);s&&e.addRule(`.monaco-editor .findMatch { border: 1px ${Hd(i.type)?"dotted":"solid"} ${s}; box-sizing: border-box; }`);const a=i.getColor(Mnt);a&&e.addRule(`.monaco-editor .currentFindMatch { border: 2px solid ${a}; padding: 1px; box-sizing: border-box; }`);const l=i.getColor(Ant);l&&e.addRule(`.monaco-editor .findScope { border: 1px ${Hd(i.type)?"dashed":"solid"} ${l}; }`);const c=i.getColor(Ln);c&&e.addRule(`.monaco-editor .find-widget { border: 1px solid ${c}; }`);const u=i.getColor(Zh);u&&e.addRule(`.monaco-editor .find-widget { color: ${u}; }`);const d=i.getColor(ent);d&&e.addRule(`.monaco-editor .find-widget.no-results .matchesCount { color: ${d}; }`);const h=i.getColor(wnt);if(h)e.addRule(`.monaco-editor .find-widget .monaco-sash { background-color: ${h}; }`);else{const p=i.getColor(Qh);p&&e.addRule(`.monaco-editor .find-widget .monaco-sash { background-color: ${p}; }`)}const f=i.getColor(pH);f&&e.addRule(` .monaco-editor .find-widget .button:not(.disabled):hover, .monaco-editor .find-widget .codicon-find-selection:hover { background-color: ${f} !important; } - `);const g=i.getColor(Vl);g&&e.addRule(`.monaco-editor .find-widget .monaco-inputbox.synthetic-focus { outline-color: ${g}; }`)});var zye=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},vd=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},vb=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},Kz;const uCt=524288;function qz(i,e="single",t=!1){if(!i.hasModel())return null;const n=i.getSelection();if(e==="single"&&n.startLineNumber===n.endLineNumber||e==="multiple"){if(n.isEmpty()){const o=i.getConfiguredWordAtPosition(n.getStartPosition());if(o&&t===!1)return o.word}else if(i.getModel().getValueLengthInRange(n)this._onStateChanged(s))),this._model=null,this._register(this._editor.onDidChangeModel(()=>{const s=this._editor.getModel()&&this._state.isRevealed;this.disposeModel(),this._state.change({searchScope:null,matchCase:this._storageService.getBoolean("editor.matchCase",1,!1),wholeWord:this._storageService.getBoolean("editor.wholeWord",1,!1),isRegex:this._storageService.getBoolean("editor.isRegex",1,!1),preserveCase:this._storageService.getBoolean("editor.preserveCase",1,!1)},!1),s&&this._start({forceRevealReplace:!1,seedSearchStringFromSelection:"none",seedSearchStringFromNonEmptySelection:!1,seedSearchStringFromGlobalClipboard:!1,shouldFocus:0,shouldAnimate:!1,updateSearchScope:!1,loop:this._editor.getOption(41).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,1,1),e.wholeWord&&this._storageService.store("editor.wholeWord",this._state.actualWholeWord,1,1),e.matchCase&&this._storageService.store("editor.matchCase",this._state.actualMatchCase,1,1),e.preserveCase&&this._storageService.store("editor.preserveCase",this._state.actualPreserveCase,1,1)}loadQueryState(){this._state.change({matchCase:this._storageService.getBoolean("editor.matchCase",1,this._state.matchCase),wholeWord:this._storageService.getBoolean("editor.wholeWord",1,this._state.wholeWord),isRegex:this._storageService.getBoolean("editor.isRegex",1,this._state.isRegex),preserveCase:this._storageService.getBoolean("editor.preserveCase",1,this._state.preserveCase)},!1)}isFindInputFocused(){return!!CF.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()){const e=this._editor.getSelections();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=Gl(e)),this._state.change({searchString:e},!1)}highlightFindOptions(e=!1){}_start(e,t){return vb(this,void 0,void 0,function*(){if(this.disposeModel(),!this._editor.hasModel())return;const n=Object.assign(Object.assign({},t),{isRevealed:!0});if(e.seedSearchStringFromSelection==="single"){const o=qz(this._editor,e.seedSearchStringFromSelection,e.seedSearchStringFromNonEmptySelection);o&&(this._state.isRegex?n.searchString=Gl(o):n.searchString=o)}else if(e.seedSearchStringFromSelection==="multiple"&&!e.updateSearchScope){const o=qz(this._editor,e.seedSearchStringFromSelection);o&&(n.searchString=o)}if(!n.searchString&&e.seedSearchStringFromGlobalClipboard){const o=yield this.getGlobalBufferTerm();if(!this._editor.hasModel())return;o&&(n.searchString=o)}if(e.forceRevealReplace||n.isReplaceRevealed?n.isReplaceRevealed=!0:this._findWidgetVisible.get()||(n.isReplaceRevealed=!1),e.updateSearchScope){const o=this._editor.getSelections();o.some(r=>!r.isEmpty())&&(n.searchScope=o)}n.loop=e.loop,this._state.change(n,!1),this._model||(this._model=new NE(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(){var e;return this._model?!((e=this._editor.getModel())===null||e===void 0)&&e.isTooLargeForHeapOperation()?(this._notificationService.warn(C("too.large.for.replaceall","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}getGlobalBufferTerm(){return vb(this,void 0,void 0,function*(){return this._editor.getOption(41).globalFindClipboard&&this._editor.hasModel()&&!this._editor.getModel().isTooLargeForSyncing()?this._clipboardService.readFindText():""})}setGlobalBufferTerm(e){this._editor.getOption(41).globalFindClipboard&&this._editor.hasModel()&&!this._editor.getModel().isTooLargeForSyncing()&&this._clipboardService.writeFindText(e)}};da.ID="editor.contrib.findController";da=Kz=zye([vd(1,Ut),vd(2,qu),vd(3,bp),vd(4,Ao)],da);let Gz=class extends da{constructor(e,t,n,o,r,s,a,l){super(e,n,a,l,s),this._contextViewService=t,this._keybindingService=o,this._themeService=r,this._widget=null,this._findOptionsWidget=null}_start(e,t){const n=Object.create(null,{_start:{get:()=>super._start}});return vb(this,void 0,void 0,function*(){this._widget||this._createFindWidget();const o=this._editor.getSelection();let r=!1;switch(this._editor.getOption(41).autoFindInSelection){case"always":r=!0;break;case"never":r=!1;break;case"multiline":{r=!!o&&o.startLineNumber!==o.endLineNumber;break}}e.updateSearchScope=e.updateSearchScope||r,yield n._start.call(this,e,t),this._widget&&(e.shouldFocus===2?this._widget.focusReplaceInput():e.shouldFocus===1&&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 yF(this._editor,this,this._state,this._contextViewService,this._keybindingService,this._contextKeyService,this._themeService,this._storageService,this._notificationService)),this._findOptionsWidget=this._register(new wF(this._editor,this._state,this._keybindingService))}};Gz=zye([vd(1,mp),vd(2,Ut),vd(3,xi),vd(4,mr),vd(5,Ao),vd(6,qu),vd(7,bp)],Gz);const dCt=h0e(new d0e({id:Ri.StartFindAction,label:C("startFindAction","Find"),alias:"Find",precondition:Me.or(Q.focus,Me.has("editorIsOpen")),kbOpts:{kbExpr:null,primary:2084,weight:100},menuOpts:{menuId:Z.MenubarEditMenu,group:"3_find",title:C({key:"miFind",comment:["&& denotes a mnemonic"]},"&&Find"),order:1}}));dCt.addImplementation(0,(i,e,t)=>{const n=da.get(e);return n?n.start({forceRevealReplace:!1,seedSearchStringFromSelection:e.getOption(41).seedSearchStringFromSelection!=="never"?"single":"none",seedSearchStringFromNonEmptySelection:e.getOption(41).seedSearchStringFromSelection==="selection",seedSearchStringFromGlobalClipboard:e.getOption(41).globalFindClipboard,shouldFocus:1,shouldAnimate:!0,updateSearchScope:!1,loop:e.getOption(41).loop}):!1});const hCt={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"},regex:{type:"boolean"},regexOverride:{type:"number",description:C("actions.find.isRegexOverride",`Overrides "Use Regular Expression" flag. + `);const g=i.getColor(Hl);g&&e.addRule(`.monaco-editor .find-widget .monaco-inputbox.synthetic-focus { outline-color: ${g}; }`)});var Zwe=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},_d=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},_b=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},Yz;const mCt=524288;function Zz(i,e="single",t=!1){if(!i.hasModel())return null;const n=i.getSelection();if(e==="single"&&n.startLineNumber===n.endLineNumber||e==="multiple"){if(n.isEmpty()){const o=i.getConfiguredWordAtPosition(n.getStartPosition());if(o&&t===!1)return o.word}else if(i.getModel().getValueLengthInRange(n)this._onStateChanged(s))),this._model=null,this._register(this._editor.onDidChangeModel(()=>{const s=this._editor.getModel()&&this._state.isRevealed;this.disposeModel(),this._state.change({searchScope:null,matchCase:this._storageService.getBoolean("editor.matchCase",1,!1),wholeWord:this._storageService.getBoolean("editor.wholeWord",1,!1),isRegex:this._storageService.getBoolean("editor.isRegex",1,!1),preserveCase:this._storageService.getBoolean("editor.preserveCase",1,!1)},!1),s&&this._start({forceRevealReplace:!1,seedSearchStringFromSelection:"none",seedSearchStringFromNonEmptySelection:!1,seedSearchStringFromGlobalClipboard:!1,shouldFocus:0,shouldAnimate:!1,updateSearchScope:!1,loop:this._editor.getOption(41).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,1,1),e.wholeWord&&this._storageService.store("editor.wholeWord",this._state.actualWholeWord,1,1),e.matchCase&&this._storageService.store("editor.matchCase",this._state.actualMatchCase,1,1),e.preserveCase&&this._storageService.store("editor.preserveCase",this._state.actualPreserveCase,1,1)}loadQueryState(){this._state.change({matchCase:this._storageService.getBoolean("editor.matchCase",1,this._state.matchCase),wholeWord:this._storageService.getBoolean("editor.wholeWord",1,this._state.wholeWord),isRegex:this._storageService.getBoolean("editor.isRegex",1,this._state.isRegex),preserveCase:this._storageService.getBoolean("editor.preserveCase",1,this._state.preserveCase)},!1)}isFindInputFocused(){return!!yF.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()){const e=this._editor.getSelections();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=Xl(e)),this._state.change({searchString:e},!1)}highlightFindOptions(e=!1){}_start(e,t){return _b(this,void 0,void 0,function*(){if(this.disposeModel(),!this._editor.hasModel())return;const n=Object.assign(Object.assign({},t),{isRevealed:!0});if(e.seedSearchStringFromSelection==="single"){const o=Zz(this._editor,e.seedSearchStringFromSelection,e.seedSearchStringFromNonEmptySelection);o&&(this._state.isRegex?n.searchString=Xl(o):n.searchString=o)}else if(e.seedSearchStringFromSelection==="multiple"&&!e.updateSearchScope){const o=Zz(this._editor,e.seedSearchStringFromSelection);o&&(n.searchString=o)}if(!n.searchString&&e.seedSearchStringFromGlobalClipboard){const o=yield this.getGlobalBufferTerm();if(!this._editor.hasModel())return;o&&(n.searchString=o)}if(e.forceRevealReplace||n.isReplaceRevealed?n.isReplaceRevealed=!0:this._findWidgetVisible.get()||(n.isReplaceRevealed=!1),e.updateSearchScope){const o=this._editor.getSelections();o.some(r=>!r.isEmpty())&&(n.searchScope=o)}n.loop=e.loop,this._state.change(n,!1),this._model||(this._model=new RE(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(){var e;return this._model?!((e=this._editor.getModel())===null||e===void 0)&&e.isTooLargeForHeapOperation()?(this._notificationService.warn(C("too.large.for.replaceall","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}getGlobalBufferTerm(){return _b(this,void 0,void 0,function*(){return this._editor.getOption(41).globalFindClipboard&&this._editor.hasModel()&&!this._editor.getModel().isTooLargeForSyncing()?this._clipboardService.readFindText():""})}setGlobalBufferTerm(e){this._editor.getOption(41).globalFindClipboard&&this._editor.hasModel()&&!this._editor.getModel().isTooLargeForSyncing()&&this._clipboardService.writeFindText(e)}};ha.ID="editor.contrib.findController";ha=Yz=Zwe([_d(1,Ut),_d(2,Gu),_d(3,yp),_d(4,Ao)],ha);let Qz=class extends ha{constructor(e,t,n,o,r,s,a,l){super(e,n,a,l,s),this._contextViewService=t,this._keybindingService=o,this._themeService=r,this._widget=null,this._findOptionsWidget=null}_start(e,t){const n=Object.create(null,{_start:{get:()=>super._start}});return _b(this,void 0,void 0,function*(){this._widget||this._createFindWidget();const o=this._editor.getSelection();let r=!1;switch(this._editor.getOption(41).autoFindInSelection){case"always":r=!0;break;case"never":r=!1;break;case"multiline":{r=!!o&&o.startLineNumber!==o.endLineNumber;break}}e.updateSearchScope=e.updateSearchScope||r,yield n._start.call(this,e,t),this._widget&&(e.shouldFocus===2?this._widget.focusReplaceInput():e.shouldFocus===1&&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 SF(this._editor,this,this._state,this._contextViewService,this._keybindingService,this._contextKeyService,this._themeService,this._storageService,this._notificationService)),this._findOptionsWidget=this._register(new wF(this._editor,this._state,this._keybindingService))}};Qz=Zwe([_d(1,_p),_d(2,Ut),_d(3,xi),_d(4,vr),_d(5,Ao),_d(6,Gu),_d(7,yp)],Qz);const vCt=C0e(new b0e({id:Ri.StartFindAction,label:C("startFindAction","Find"),alias:"Find",precondition:Me.or(Q.focus,Me.has("editorIsOpen")),kbOpts:{kbExpr:null,primary:2084,weight:100},menuOpts:{menuId:Z.MenubarEditMenu,group:"3_find",title:C({key:"miFind",comment:["&& denotes a mnemonic"]},"&&Find"),order:1}}));vCt.addImplementation(0,(i,e,t)=>{const n=ha.get(e);return n?n.start({forceRevealReplace:!1,seedSearchStringFromSelection:e.getOption(41).seedSearchStringFromSelection!=="never"?"single":"none",seedSearchStringFromNonEmptySelection:e.getOption(41).seedSearchStringFromSelection==="selection",seedSearchStringFromGlobalClipboard:e.getOption(41).globalFindClipboard,shouldFocus:1,shouldAnimate:!0,updateSearchScope:!1,loop:e.getOption(41).loop}):!1});const _Ct={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"},regex:{type:"boolean"},regexOverride:{type:"number",description:C("actions.find.isRegexOverride",`Overrides "Use Regular Expression" flag. The flag will not be saved for the future. 0: Do Nothing 1: True @@ -1062,44 +1063,44 @@ The flag will not be saved for the future. The flag will not be saved for the future. 0: Do Nothing 1: True -2: False`)},findInSelection:{type:"boolean"}}}}]};class fCt extends ft{constructor(){super({id:Ri.StartFindWithArgs,label:C("startFindWithArgsAction","Find With Arguments"),alias:"Find With Arguments",precondition:void 0,kbOpts:{kbExpr:null,primary:0,weight:100},description:hCt})}run(e,t,n){return vb(this,void 0,void 0,function*(){const o=da.get(t);if(o){const r=n?{searchString:n.searchString,replaceString:n.replaceString,isReplaceRevealed:n.replaceString!==void 0,isRegex:n.isRegex,wholeWord:n.matchWholeWord,matchCase:n.isCaseSensitive,preserveCase:n.preserveCase}:{};yield o.start({forceRevealReplace:!1,seedSearchStringFromSelection:o.getState().searchString.length===0&&t.getOption(41).seedSearchStringFromSelection!=="never"?"single":"none",seedSearchStringFromNonEmptySelection:t.getOption(41).seedSearchStringFromSelection==="selection",seedSearchStringFromGlobalClipboard:!0,shouldFocus:1,shouldAnimate:!0,updateSearchScope:(n==null?void 0:n.findInSelection)||!1,loop:t.getOption(41).loop},r),o.setGlobalBufferTerm(o.getState().searchString)}})}}class gCt extends ft{constructor(){super({id:Ri.StartFindWithSelection,label:C("startFindWithSelectionAction","Find With Selection"),alias:"Find With Selection",precondition:void 0,kbOpts:{kbExpr:null,primary:0,mac:{primary:2083},weight:100}})}run(e,t){return vb(this,void 0,void 0,function*(){const n=da.get(t);n&&(yield n.start({forceRevealReplace:!1,seedSearchStringFromSelection:"multiple",seedSearchStringFromNonEmptySelection:!1,seedSearchStringFromGlobalClipboard:!1,shouldFocus:0,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(41).loop}),n.setGlobalBufferTerm(n.getState().searchString))})}}class Uye extends ft{run(e,t){return vb(this,void 0,void 0,function*(){const n=da.get(t);n&&!this._run(n)&&(yield n.start({forceRevealReplace:!1,seedSearchStringFromSelection:n.getState().searchString.length===0&&t.getOption(41).seedSearchStringFromSelection!=="never"?"single":"none",seedSearchStringFromNonEmptySelection:t.getOption(41).seedSearchStringFromSelection==="selection",seedSearchStringFromGlobalClipboard:!0,shouldFocus:0,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(41).loop}),this._run(n))})}}class pCt extends Uye{constructor(){super({id:Ri.NextMatchFindAction,label:C("findNextMatchAction","Find Next"),alias:"Find Next",precondition:void 0,kbOpts:[{kbExpr:Q.focus,primary:61,mac:{primary:2085,secondary:[61]},weight:100},{kbExpr:Me.and(Q.focus,CF),primary:3,weight:100}]})}_run(e){return e.moveToNextMatch()?(e.editor.pushUndoStop(),!0):!1}}class mCt extends Uye{constructor(){super({id:Ri.PreviousMatchFindAction,label:C("findPreviousMatchAction","Find Previous"),alias:"Find Previous",precondition:void 0,kbOpts:[{kbExpr:Q.focus,primary:1085,mac:{primary:3109,secondary:[1085]},weight:100},{kbExpr:Me.and(Q.focus,CF),primary:1027,weight:100}]})}_run(e){return e.moveToPrevMatch()}}class vCt extends ft{constructor(){super({id:Ri.GoToMatchFindAction,label:C("findMatchAction.goToMatch","Go to Match..."),alias:"Go to Match...",precondition:Cp}),this._highlightDecorations=[]}run(e,t,n){const o=da.get(t);if(!o)return;const r=o.getState().matchesCount;if(r<1){e.get(Ao).notify({severity:L5.Warning,message:C("findMatchAction.noResults","No matches. Try searching for something else.")});return}const a=e.get(lh).createInputBox();a.placeholder=C("findMatchAction.inputPlaceHolder","Type a number to go to a specific match (between 1 and {0})",r);const l=u=>{const d=parseInt(u);if(isNaN(d))return;const h=o.getState().matchesCount;if(d>0&&d<=h)return d-1;if(d<0&&d>=-h)return h+d},c=u=>{const d=l(u);if(typeof d=="number"){a.validationMessage=void 0,o.goToMatch(d);const h=o.getState().currentMatch;h&&this.addDecorations(t,h)}else a.validationMessage=C("findMatchAction.inputValidationMessage","Please type a number between 1 and {0}",o.getState().matchesCount),this.clearDecorations(t)};a.onDidChangeValue(u=>{c(u)}),a.onDidAccept(()=>{const u=l(a.value);typeof u=="number"?(o.goToMatch(u),a.hide()):a.validationMessage=C("findMatchAction.inputValidationMessage","Please type a number between 1 and {0}",o.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(n=>{this._highlightDecorations=n.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:ro(gbe),position:Xl.Full}}}])})}}class jye extends ft{run(e,t){return vb(this,void 0,void 0,function*(){const n=da.get(t);if(!n)return;const o=qz(t,"single",!1);o&&n.setSearchString(o),this._run(n)||(yield n.start({forceRevealReplace:!1,seedSearchStringFromSelection:"none",seedSearchStringFromNonEmptySelection:!1,seedSearchStringFromGlobalClipboard:!1,shouldFocus:0,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(41).loop}),this._run(n))})}}class _Ct extends jye{constructor(){super({id:Ri.NextSelectionMatchFindAction,label:C("nextSelectionMatchFindAction","Find Next Selection"),alias:"Find Next Selection",precondition:void 0,kbOpts:{kbExpr:Q.focus,primary:2109,weight:100}})}_run(e){return e.moveToNextMatch()}}class bCt extends jye{constructor(){super({id:Ri.PreviousSelectionMatchFindAction,label:C("previousSelectionMatchFindAction","Find Previous Selection"),alias:"Find Previous Selection",precondition:void 0,kbOpts:{kbExpr:Q.focus,primary:3133,weight:100}})}_run(e){return e.moveToPrevMatch()}}const CCt=h0e(new d0e({id:Ri.StartFindReplaceAction,label:C("startReplace","Replace"),alias:"Replace",precondition:Me.or(Q.focus,Me.has("editorIsOpen")),kbOpts:{kbExpr:null,primary:2086,mac:{primary:2596},weight:100},menuOpts:{menuId:Z.MenubarEditMenu,group:"3_find",title:C({key:"miReplace",comment:["&& denotes a mnemonic"]},"&&Replace"),order:2}}));CCt.addImplementation(0,(i,e,t)=>{if(!e.hasModel()||e.getOption(90))return!1;const n=da.get(e);if(!n)return!1;const o=e.getSelection(),r=n.isFindInputFocused(),s=!o.isEmpty()&&o.startLineNumber===o.endLineNumber&&e.getOption(41).seedSearchStringFromSelection!=="never"&&!r,a=r||s?2:1;return n.start({forceRevealReplace:!0,seedSearchStringFromSelection:s?"single":"none",seedSearchStringFromNonEmptySelection:e.getOption(41).seedSearchStringFromSelection==="selection",seedSearchStringFromGlobalClipboard:e.getOption(41).seedSearchStringFromSelection!=="never",shouldFocus:a,shouldAnimate:!0,updateSearchScope:!1,loop:e.getOption(41).loop})});zn(da.ID,Gz,0);ze(fCt);ze(gCt);ze(pCt);ze(mCt);ze(vCt);ze(_Ct);ze(bCt);const ch=Ir.bindToContribution(da.get);Ye(new ch({id:Ri.CloseFindWidgetCommand,precondition:Cp,handler:i=>i.closeFindWidget(),kbOpts:{weight:100+5,kbExpr:Me.and(Q.focus,Me.not("isComposing")),primary:9,secondary:[1033]}}));Ye(new ch({id:Ri.ToggleCaseSensitiveCommand,precondition:void 0,handler:i=>i.toggleCaseSensitive(),kbOpts:{weight:100+5,kbExpr:Q.focus,primary:Q2.primary,mac:Q2.mac,win:Q2.win,linux:Q2.linux}}));Ye(new ch({id:Ri.ToggleWholeWordCommand,precondition:void 0,handler:i=>i.toggleWholeWords(),kbOpts:{weight:100+5,kbExpr:Q.focus,primary:J2.primary,mac:J2.mac,win:J2.win,linux:J2.linux}}));Ye(new ch({id:Ri.ToggleRegexCommand,precondition:void 0,handler:i=>i.toggleRegex(),kbOpts:{weight:100+5,kbExpr:Q.focus,primary:eR.primary,mac:eR.mac,win:eR.win,linux:eR.linux}}));Ye(new ch({id:Ri.ToggleSearchScopeCommand,precondition:void 0,handler:i=>i.toggleSearchScope(),kbOpts:{weight:100+5,kbExpr:Q.focus,primary:tR.primary,mac:tR.mac,win:tR.win,linux:tR.linux}}));Ye(new ch({id:Ri.TogglePreserveCaseCommand,precondition:void 0,handler:i=>i.togglePreserveCase(),kbOpts:{weight:100+5,kbExpr:Q.focus,primary:nR.primary,mac:nR.mac,win:nR.win,linux:nR.linux}}));Ye(new ch({id:Ri.ReplaceOneAction,precondition:Cp,handler:i=>i.replace(),kbOpts:{weight:100+5,kbExpr:Q.focus,primary:3094}}));Ye(new ch({id:Ri.ReplaceOneAction,precondition:Cp,handler:i=>i.replace(),kbOpts:{weight:100+5,kbExpr:Me.and(Q.focus,pY),primary:3}}));Ye(new ch({id:Ri.ReplaceAllAction,precondition:Cp,handler:i=>i.replaceAll(),kbOpts:{weight:100+5,kbExpr:Q.focus,primary:2563}}));Ye(new ch({id:Ri.ReplaceAllAction,precondition:Cp,handler:i=>i.replaceAll(),kbOpts:{weight:100+5,kbExpr:Me.and(Q.focus,pY),primary:void 0,mac:{primary:2051}}}));Ye(new ch({id:Ri.SelectAllMatchesAction,precondition:Cp,handler:i=>i.selectAllMatches(),kbOpts:{weight:100+5,kbExpr:Q.focus,primary:515}}));const wCt={[0]:" ",[1]:"u",[2]:"r"},ace=65535,_d=16777215,lce=4278190080;class d7{constructor(e){const t=Math.ceil(e/32);this._states=new Uint32Array(t)}get(e){const t=e/32|0,n=e%32;return(this._states[t]&1<ace)throw new Error("invalid startIndexes or endIndexes size");this._startIndexes=e,this._endIndexes=t,this._collapseStates=new d7(e.length),this._userDefinedStates=new d7(e.length),this._recoveredStates=new d7(e.length),this._types=n,this._parentsComputed=!1}ensureParentIndices(){if(!this._parentsComputed){this._parentsComputed=!0;const e=[],t=(n,o)=>{const r=e[e.length-1];return this.getStartLineNumber(r)<=n&&this.getEndLineNumber(r)>=o};for(let n=0,o=this._startIndexes.length;n_d||s>_d)throw new Error("startLineNumber or endLineNumber must not exceed "+_d);for(;e.length>0&&!t(r,s);)e.pop();const a=e.length>0?e[e.length-1]:-1;e.push(n),this._startIndexes[n]=r+((a&255)<<24),this._endIndexes[n]=s+((a&65280)<<16)}}}get length(){return this._startIndexes.length}getStartLineNumber(e){return this._startIndexes[e]&_d}getEndLineNumber(e){return this._endIndexes[e]&_d}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)?1:this.isRecovered(e)?2:0}setSource(e,t){t===1?(this.setUserDefined(e,!0),this.setRecovered(e,!1)):t===2?(this.setUserDefined(e,!1),this.setRecovered(e,!0)):(this.setUserDefined(e,!1),this.setRecovered(e,!1))}setCollapsedAllOfType(e,t){let n=!1;if(this._types)for(let o=0;o>>24)+((this._endIndexes[e]&lce)>>>16);return t===ace?-1:t}contains(e,t){return this.getStartLineNumber(e)<=t&&this.getEndLineNumber(e)>=t}findIndex(e){let t=0,n=this._startIndexes.length;if(n===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(p)?m=>mm=u.startLineNumber))c&&c.startLineNumber===u.startLineNumber?(u.source===1?p=u:(p=c,p.isCollapsed=u.isCollapsed&&c.endLineNumber===u.endLineNumber,p.source=0),c=r(++a)):(p=u,u.isCollapsed&&u.source===0&&(p.source=2)),u=s(++l);else{let v=l,m=u;for(;;){if(!m||m.startLineNumber>c.endLineNumber){p=c;break}if(m.source===1&&m.endLineNumber>c.endLineNumber)break;m=s(++v)}c=r(++a)}if(p){for(;h&&h.endLineNumberp.startLineNumber&&p.startLineNumber>f&&p.endLineNumber<=n&&(!h||h.endLineNumber>=p.endLineNumber)&&(g.push(p),f=p.startLineNumber,h&&d.push(h),h=p)}}return g}}class yCt{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}}class SCt{get regions(){return this._regions}get textModel(){return this._textModel}constructor(e,t){this._updateEventEmitter=new le,this.onDidChange=this._updateEventEmitter.event,this._textModel=e,this._decorationProvider=t,this._regions=new Rl(new Uint32Array(0),new Uint32Array(0)),this._editorDecorationIds=[]}toggleCollapseState(e){if(!e.length)return;e=e.sort((n,o)=>n.regionIndex-o.regionIndex);const t={};this._decorationProvider.changeDecorations(n=>{let o=0,r=-1,s=-1;const a=l=>{for(;os&&(s=c),o++}};for(const l of e){const c=l.regionIndex,u=this._editorDecorationIds[c];if(u&&!t[u]){t[u]=!0,a(c);const d=!this._regions.isCollapsed(c);this._regions.setCollapsed(c,d),r=Math.max(r,this._regions.getEndLineNumber(c))}}a(this._regions.length)}),this._updateEventEmitter.fire({model:this,collapseStateChanged:e})}removeManualRanges(e){const t=new Array,n=o=>{for(const r of e)if(!(r.startLineNumber>o.endLineNumber||o.startLineNumber>r.endLineNumber))return!0;return!1};for(let o=0;on&&(n=a)}this._decorationProvider.changeDecorations(o=>this._editorDecorationIds=o.deltaDecorations(this._editorDecorationIds,t)),this._regions=e,this._updateEventEmitter.fire({model:this})}_currentFoldedOrManualRanges(e=[]){const t=(o,r)=>{for(const s of e)if(o=s.endLineNumber||s.startLineNumber<1||s.endLineNumber>n)continue;const a=this._getLinesChecksum(s.startLineNumber+1,s.endLineNumber);t.push({startLineNumber:s.startLineNumber,endLineNumber:s.endLineNumber,isCollapsed:s.isCollapsed,source:s.source,checksum:a})}return t.length>0?t:void 0}applyMemento(e){var t,n;if(!Array.isArray(e))return;const o=[],r=this._textModel.getLineCount();for(const a of e){if(a.startLineNumber>=a.endLineNumber||a.startLineNumber<1||a.endLineNumber>r)continue;const l=this._getLinesChecksum(a.startLineNumber+1,a.endLineNumber);(!a.checksum||l===a.checksum)&&o.push({startLineNumber:a.startLineNumber,endLineNumber:a.endLineNumber,type:void 0,isCollapsed:(t=a.isCollapsed)!==null&&t!==void 0?t:!0,source:(n=a.source)!==null&&n!==void 0?n:0})}const s=Rl.sanitizeAndMerge(this._regions,o,r);this.updatePost(Rl.fromFoldRanges(s))}_getLinesChecksum(e,t){return N0e(this._textModel.getLineContent(e)+this._textModel.getLineContent(t))%1e6}dispose(){this._decorationProvider.removeDecorations(this._editorDecorationIds)}getAllRegionsAtLine(e,t){const n=[];if(this._regions){let o=this._regions.findRange(e),r=1;for(;o>=0;){const s=this._regions.toRegion(o);(!t||t(s,r))&&n.push(s),r++,o=s.parentIndex}}return n}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 n=[],o=e?e.regionIndex+1:0,r=e?e.endLineNumber:Number.MAX_VALUE;if(t&&t.length===2){const s=[];for(let a=o,l=this._regions.length;a0&&!c.containedBy(s[s.length-1]);)s.pop();s.push(c),t(c,s.length)&&n.push(c)}else break}}else for(let s=o,a=this._regions.length;s1){const a=i.getRegionsInside(r,(l,c)=>l.isCollapsed!==s&&c0)for(const r of n){const s=i.getRegionAtLine(r);if(s&&(s.isCollapsed!==e&&o.push(s),t>1)){const a=i.getRegionsInside(s,(l,c)=>l.isCollapsed!==e&&cs.isCollapsed!==e&&aa.isCollapsed!==e&&l<=t);o.push(...s)}i.toggleCollapseState(o)}function xCt(i,e,t){const n=[];for(const o of t){const r=i.getAllRegionsAtLine(o,s=>s.isCollapsed!==e);r.length>0&&n.push(r[0])}i.toggleCollapseState(n)}function LCt(i,e,t,n){const o=(s,a)=>a===e&&s.isCollapsed!==t&&!n.some(l=>s.containsLine(l)),r=i.getRegionsInside(null,o);i.toggleCollapseState(r)}function Gye(i,e,t){const n=[];for(const s of t){const a=i.getAllRegionsAtLine(s,void 0);a.length>0&&n.push(a[0])}const o=s=>n.every(a=>!a.containedBy(s)&&!s.containedBy(a))&&s.isCollapsed!==e,r=i.getRegionsInside(null,o);i.toggleCollapseState(r)}function _Y(i,e,t){const n=i.textModel,o=i.regions,r=[];for(let s=o.length-1;s>=0;s--)if(t!==o.isCollapsed(s)){const a=o.getStartLineNumber(s);e.test(n.getLineContent(a))&&r.push(o.toRegion(s))}i.toggleCollapseState(r)}function bY(i,e,t){const n=i.regions,o=[];for(let r=n.length-1;r>=0;r--)t!==n.isCollapsed(r)&&e===n.getType(r)&&o.push(n.toRegion(r));i.toggleCollapseState(o)}function ECt(i,e){let t=null;const n=e.getRegionAtLine(i);if(n!==null&&(t=n.startLineNumber,i===t)){const o=n.parentIndex;o!==-1?t=e.regions.getStartLineNumber(o):t=null}return t}function DCt(i,e){let t=e.getRegionAtLine(i);if(t!==null&&t.startLineNumber===i){if(i!==t.startLineNumber)return t.startLineNumber;{const n=t.parentIndex;let o=0;for(n!==-1&&(o=e.regions.getStartLineNumber(t.parentIndex));t!==null;)if(t.regionIndex>0){if(t=e.regions.toRegion(t.regionIndex-1),t.startLineNumber<=o)return null;if(t.parentIndex===n)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 kCt(i,e){let t=e.getRegionAtLine(i);if(t!==null&&t.startLineNumber===i){const n=t.parentIndex;let o=0;if(n!==-1)o=e.regions.getEndLineNumber(t.parentIndex);else{if(e.regions.length===0)return null;o=e.regions.getEndLineNumber(e.regions.length-1)}for(;t!==null;)if(t.regionIndex=o)return null;if(t.parentIndex===n)return t.startLineNumber}else return null}else if(e.regions.length>0)for(t=e.regions.toRegion(0);t!==null;){if(t.startLineNumber>i)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||Dv(t.text)[0]!==0))}updateHiddenRanges(){let e=!1;const t=[];let n=0,o=0,r=Number.MAX_VALUE,s=-1;const a=this._foldingModel.regions;for(;n0}isHidden(e){return cce(this._hiddenRanges,e)!==null}adjustSelections(e){let t=!1;const n=this._foldingModel.textModel;let o=null;const r=s=>((!o||!TCt(s,o))&&(o=cce(this._hiddenRanges,s)),o?o.startLineNumber-1:null);for(let s=0,a=e.length;s0&&(this._hiddenRanges=[],this._updateEventEmitter.fire(this._hiddenRanges)),this._foldingModelListener&&(this._foldingModelListener.dispose(),this._foldingModelListener=null)}}function TCt(i,e){return i>=e.startLineNumber&&i<=e.endLineNumber}function cce(i,e){const t=$D(i,n=>e=0&&i[t].endLineNumber>=e?i[t]:null}const NCt=5e3,RCt="indent";class CY{constructor(e,t,n){this.editorModel=e,this.languageConfigurationService=t,this.foldingRangesLimit=n,this.id=RCt}dispose(){}compute(e){const t=this.languageConfigurationService.getLanguageConfiguration(this.editorModel.getLanguageId()).foldingRules,n=t&&!!t.offSide,o=t&&t.markers;return Promise.resolve(PCt(this.editorModel,n,o,this.foldingRangesLimit))}}class MCt{constructor(e){this._startIndexes=[],this._endIndexes=[],this._indentOccurrences=[],this._length=0,this._foldingRangesLimit=e}insertFirst(e,t,n){if(e>_d||t>_d)return;const o=this._length;this._startIndexes[o]=e,this._endIndexes[o]=t,this._length++,n<1e3&&(this._indentOccurrences[n]=(this._indentOccurrences[n]||0)+1)}toIndentRanges(e){const t=this._foldingRangesLimit.limit;if(this._length<=t){this._foldingRangesLimit.update(this._length,!1);const n=new Uint32Array(this._length),o=new Uint32Array(this._length);for(let r=this._length-1,s=0;r>=0;r--,s++)n[s]=this._startIndexes[r],o[s]=this._endIndexes[r];return new Rl(n,o)}else{this._foldingRangesLimit.update(this._length,t);let n=0,o=this._indentOccurrences.length;for(let l=0;lt){o=l;break}n+=c}}const r=e.getOptions().tabSize,s=new Uint32Array(t),a=new Uint32Array(t);for(let l=this._length-1,c=0;l>=0;l--){const u=this._startIndexes[l],d=e.getLineContent(u),h=C5(d,r);(h{}};function PCt(i,e,t,n=ACt){const o=i.getOptions().tabSize,r=new MCt(n);let s;t&&(s=new RegExp(`(${t.start.source})|(?:${t.end.source})`));const a=[],l=i.getLineCount()+1;a.push({indent:-1,endAbove:l,line:l});for(let c=i.getLineCount();c>0;c--){const u=i.getLineContent(c),d=C5(u,o);let h=a[a.length-1];if(d===-1){e&&(h.endAbove=c);continue}let f;if(s&&(f=u.match(s)))if(f[1]){let g=a.length-1;for(;g>0&&a[g].indent!==-2;)g--;if(g>0){a.length=g+1,h=a[g],r.insertFirst(c,h.line,d),h.line=c,h.indent=d,h.endAbove=c;continue}}else{a.push({indent:-2,endAbove:c,line:c});continue}if(h.indent>d){do a.pop(),h=a[a.length-1];while(h.indent>d);const g=h.endAbove-1;g-c>=1&&r.insertFirst(c,g,d)}h.indent===d?h.endAbove=c:a.push({indent:d,endAbove:c,line:c})}return r.toIndentRanges(i)}const OCt=J("editor.foldBackground",{light:yt(ym,.3),dark:yt(ym,.3),hcDark:null,hcLight:null},C("foldBackgroundBackground","Background color behind folded ranges. The color must not be opaque so as not to hide underlying decorations."),!0);J("editorGutter.foldingControlForeground",{dark:wm,light:wm,hcDark:wm,hcLight:wm},C("editorGutter.foldingControlForeground","Color of the folding control in the editor gutter."));const SF=Eo("folding-expanded",Xe.chevronDown,C("foldingExpandedIcon","Icon for expanded ranges in the editor glyph margin.")),xF=Eo("folding-collapsed",Xe.chevronRight,C("foldingCollapsedIcon","Icon for collapsed ranges in the editor glyph margin.")),Xye=Eo("folding-manual-collapsed",xF,C("foldingManualCollapedIcon","Icon for manually collapsed ranges in the editor glyph margin.")),Yye=Eo("folding-manual-expanded",SF,C("foldingManualExpandedIcon","Icon for manually expanded ranges in the editor glyph margin.")),wY={color:ro(OCt),position:al.Inline};class Bo{constructor(e){this.editor=e,this.showFoldingControls="mouseover",this.showFoldingHighlights=!0}getDecorationOption(e,t,n){return t?Bo.HIDDEN_RANGE_DECORATION:this.showFoldingControls==="never"?e?this.showFoldingHighlights?Bo.NO_CONTROLS_COLLAPSED_HIGHLIGHTED_RANGE_DECORATION:Bo.NO_CONTROLS_COLLAPSED_RANGE_DECORATION:Bo.NO_CONTROLS_EXPANDED_RANGE_DECORATION:e?n?this.showFoldingHighlights?Bo.MANUALLY_COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION:Bo.MANUALLY_COLLAPSED_VISUAL_DECORATION:this.showFoldingHighlights?Bo.COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION:Bo.COLLAPSED_VISUAL_DECORATION:this.showFoldingControls==="mouseover"?n?Bo.MANUALLY_EXPANDED_AUTO_HIDE_VISUAL_DECORATION:Bo.EXPANDED_AUTO_HIDE_VISUAL_DECORATION:n?Bo.MANUALLY_EXPANDED_VISUAL_DECORATION:Bo.EXPANDED_VISUAL_DECORATION}changeDecorations(e){return this.editor.changeDecorations(e)}removeDecorations(e){this.editor.removeDecorations(e)}}Bo.COLLAPSED_VISUAL_DECORATION=Jt.register({description:"folding-collapsed-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",isWholeLine:!0,firstLineDecorationClassName:Mt.asClassName(xF)});Bo.COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION=Jt.register({description:"folding-collapsed-highlighted-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",className:"folded-background",minimap:wY,isWholeLine:!0,firstLineDecorationClassName:Mt.asClassName(xF)});Bo.MANUALLY_COLLAPSED_VISUAL_DECORATION=Jt.register({description:"folding-manually-collapsed-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",isWholeLine:!0,firstLineDecorationClassName:Mt.asClassName(Xye)});Bo.MANUALLY_COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION=Jt.register({description:"folding-manually-collapsed-highlighted-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",className:"folded-background",minimap:wY,isWholeLine:!0,firstLineDecorationClassName:Mt.asClassName(Xye)});Bo.NO_CONTROLS_COLLAPSED_RANGE_DECORATION=Jt.register({description:"folding-no-controls-range-decoration",stickiness:0,afterContentClassName:"inline-folded",isWholeLine:!0});Bo.NO_CONTROLS_COLLAPSED_HIGHLIGHTED_RANGE_DECORATION=Jt.register({description:"folding-no-controls-range-decoration",stickiness:0,afterContentClassName:"inline-folded",className:"folded-background",minimap:wY,isWholeLine:!0});Bo.EXPANDED_VISUAL_DECORATION=Jt.register({description:"folding-expanded-visual-decoration",stickiness:1,isWholeLine:!0,firstLineDecorationClassName:"alwaysShowFoldIcons "+Mt.asClassName(SF)});Bo.EXPANDED_AUTO_HIDE_VISUAL_DECORATION=Jt.register({description:"folding-expanded-auto-hide-visual-decoration",stickiness:1,isWholeLine:!0,firstLineDecorationClassName:Mt.asClassName(SF)});Bo.MANUALLY_EXPANDED_VISUAL_DECORATION=Jt.register({description:"folding-manually-expanded-visual-decoration",stickiness:0,isWholeLine:!0,firstLineDecorationClassName:"alwaysShowFoldIcons "+Mt.asClassName(Yye)});Bo.MANUALLY_EXPANDED_AUTO_HIDE_VISUAL_DECORATION=Jt.register({description:"folding-manually-expanded-auto-hide-visual-decoration",stickiness:0,isWholeLine:!0,firstLineDecorationClassName:Mt.asClassName(Yye)});Bo.NO_CONTROLS_EXPANDED_RANGE_DECORATION=Jt.register({description:"folding-no-controls-range-decoration",stickiness:0,isWholeLine:!0});Bo.HIDDEN_RANGE_DECORATION=Jt.register({description:"folding-hidden-range-decoration",stickiness:1});const FCt={},BCt="syntax";class yY{constructor(e,t,n,o,r){this.editorModel=e,this.providers=t,this.handleFoldingRangesChange=n,this.foldingRangesLimit=o,this.fallbackRangeProvider=r,this.id=BCt,this.disposables=new Be,r&&this.disposables.add(r);for(const s of t)typeof s.onDidChange=="function"&&this.disposables.add(s.onDidChange(n))}compute(e){return WCt(this.providers,this.editorModel,e).then(t=>{var n,o;return t?HCt(t,this.foldingRangesLimit):(o=(n=this.fallbackRangeProvider)===null||n===void 0?void 0:n.compute(e))!==null&&o!==void 0?o:null})}dispose(){this.disposables.dispose()}}function WCt(i,e,t){let n=null;const o=i.map((r,s)=>Promise.resolve(r.provideFoldingRanges(e,FCt,t)).then(a=>{if(!t.isCancellationRequested&&Array.isArray(a)){Array.isArray(n)||(n=[]);const l=e.getLineCount();for(const c of a)c.start>0&&c.end>c.start&&c.end<=l&&n.push({start:c.start,end:c.end,rank:s,kind:c.kind})}},$o));return Promise.all(o).then(r=>n)}class VCt{constructor(e){this._startIndexes=[],this._endIndexes=[],this._nestingLevels=[],this._nestingLevelCounts=[],this._types=[],this._length=0,this._foldingRangesLimit=e}add(e,t,n,o){if(e>_d||t>_d)return;const r=this._length;this._startIndexes[r]=e,this._endIndexes[r]=t,this._nestingLevels[r]=o,this._types[r]=n,this._length++,o<30&&(this._nestingLevelCounts[o]=(this._nestingLevelCounts[o]||0)+1)}toIndentRanges(){const e=this._foldingRangesLimit.limit;if(this._length<=e){this._foldingRangesLimit.update(this._length,!1);const t=new Uint32Array(this._length),n=new Uint32Array(this._length);for(let o=0;oe){n=a;break}t+=l}}const o=new Uint32Array(e),r=new Uint32Array(e),s=[];for(let a=0,l=0;a{let l=s.start-a.start;return l===0&&(l=s.rank-a.rank),l}),n=new VCt(e);let o;const r=[];for(const s of t)if(!o)o=s,n.add(s.start,s.end,s.kind&&s.kind.value,r.length);else if(s.start>o.start)if(s.end<=o.end)r.push(o),o=s,n.add(s.start,s.end,s.kind&&s.kind.value,r.length);else{if(s.start>o.end){do o=r.pop();while(o&&s.start>o.end);o&&r.push(o),o=s}n.add(s.start,s.end,s.kind&&s.kind.value,r.length)}return n.toIndentRanges()}var $Ct=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},eL=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},zCt=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},hC;const ks=new lt("foldingEnabled",!1);let Sf=hC=class extends _e{static get(e){return e.getContribution(hC.ID)}static getFoldingRangeProviders(e,t){var n,o;const r=e.foldingRangeProvider.ordered(t);return(o=(n=hC._foldingRangeSelector)===null||n===void 0?void 0:n.call(hC,r,t))!==null&&o!==void 0?o:r}constructor(e,t,n,o,r,s){super(),this.contextKeyService=t,this.languageConfigurationService=n,this.languageFeaturesService=s,this.localToDispose=this._register(new Be),this.editor=e,this._foldingLimitReporter=new Zye(e);const a=this.editor.getOptions();this._isEnabled=a.get(43),this._useFoldingProviders=a.get(44)!=="indentation",this._unfoldOnClickAfterEndOfLine=a.get(48),this._restoringViewState=!1,this._currentModelHasFoldedImports=!1,this._foldingImportsByDefault=a.get(46),this.updateDebounceInfo=r.for(s.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 Bo(e),this.foldingDecorationProvider.showFoldingControls=a.get(109),this.foldingDecorationProvider.showFoldingHighlights=a.get(45),this.foldingEnabled=ks.bindTo(this.contextKeyService),this.foldingEnabled.set(this._isEnabled),this._register(this.editor.onDidChangeModel(()=>this.onModelChanged())),this._register(this.editor.onDidChangeConfiguration(l=>{if(l.hasChanged(43)&&(this._isEnabled=this.editor.getOptions().get(43),this.foldingEnabled.set(this._isEnabled),this.onModelChanged()),l.hasChanged(47)&&this.onModelChanged(),l.hasChanged(109)||l.hasChanged(45)){const c=this.editor.getOptions();this.foldingDecorationProvider.showFoldingControls=c.get(109),this.foldingDecorationProvider.showFoldingHighlights=c.get(45),this.triggerFoldingModelChanged()}l.hasChanged(44)&&(this._useFoldingProviders=this.editor.getOptions().get(44)!=="indentation",this.onFoldingStrategyChanged()),l.hasChanged(48)&&(this._unfoldOnClickAfterEndOfLine=this.editor.getOptions().get(48)),l.hasChanged(46)&&(this._foldingImportsByDefault=this.editor.getOptions().get(46))})),this.onModelChanged()}saveViewState(){const e=this.editor.getModel();if(!e||!this._isEnabled||e.isTooLargeForTokenization())return{};if(this.foldingModel){const t=this.foldingModel.getMemento(),n=this.rangeProvider?this.rangeProvider.id:void 0;return{collapsedRegions:t,lineCount:e.getLineCount(),provider:n,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 SCt(e,this.foldingDecorationProvider),this.localToDispose.add(this.foldingModel),this.hiddenRangeModel=new ICt(this.foldingModel),this.localToDispose.add(this.hiddenRangeModel),this.localToDispose.add(this.hiddenRangeModel.onDidChange(t=>this.onHiddenRangesChanges(t))),this.updateScheduler=new Bu(this.updateDebounceInfo.get(e)),this.cursorChangedScheduler=new bi(()=>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:()=>{var t,n;this.foldingRegionPromise&&(this.foldingRegionPromise.cancel(),this.foldingRegionPromise=null),(t=this.updateScheduler)===null||t===void 0||t.cancel(),this.updateScheduler=null,this.foldingModel=null,this.foldingModelPromise=null,this.hiddenRangeModel=null,this.cursorChangedScheduler=null,(n=this.rangeProvider)===null||n===void 0||n.dispose(),this.rangeProvider=null}}),this.triggerFoldingModelChanged())}onFoldingStrategyChanged(){var e;(e=this.rangeProvider)===null||e===void 0||e.dispose(),this.rangeProvider=null,this.triggerFoldingModelChanged()}getRangeProvider(e){if(this.rangeProvider)return this.rangeProvider;const t=new CY(e,this.languageConfigurationService,this._foldingLimitReporter);if(this.rangeProvider=t,this._useFoldingProviders&&this.foldingModel){const n=hC.getFoldingRangeProviders(this.languageFeaturesService,e);n.length>0&&(this.rangeProvider=new yY(e,n,()=>this.triggerFoldingModelChanged(),this._foldingLimitReporter,t))}return this.rangeProvider}getFoldingModel(){return this.foldingModelPromise}onDidChangeModelContent(e){var t;(t=this.hiddenRangeModel)===null||t===void 0||t.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 xs,n=this.getRangeProvider(e.textModel),o=this.foldingRegionPromise=sr(r=>n.compute(r));return o.then(r=>{if(r&&o===this.foldingRegionPromise){let s;if(this._foldingImportsByDefault&&!this._currentModelHasFoldedImports){const u=r.setCollapsedAllOfType(oa.Imports.value,!0);u&&(s=Yd.capture(this.editor),this._currentModelHasFoldedImports=u)}const a=this.editor.getSelections(),l=a?a.map(u=>u.startLineNumber):[];e.update(r,l),s==null||s.restore(this.editor);const c=this.updateDebounceInfo.update(e.textModel,t.elapsed());this.updateScheduler&&(this.updateScheduler.defaultDelay=c)}return e})}).then(void 0,e=>(en(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 n=this.editor.getSelections();if(n&&n.length>0){const o=[];for(const r of n){const s=r.selectionStartLineNumber;this.hiddenRangeModel&&this.hiddenRangeModel.isHidden(s)&&o.push(...t.getAllRegionsAtLine(s,a=>a.isCollapsed&&s>a.startLineNumber))}o.length&&(t.toggleCollapseState(o),this.reveal(n[0].getPosition()))}}}).then(void 0,en)}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 n=!1;switch(e.target.type){case 4:{const o=e.target.detail,r=e.target.element.offsetLeft;if(o.offsetX-r<4)return;n=!0;break}case 7:{if(this._unfoldOnClickAfterEndOfLine&&this.hiddenRangeModel.hasRanges()&&!e.target.detail.isAfterLines)break;return}case 6:{if(this.hiddenRangeModel.hasRanges()){const o=this.editor.getModel();if(o&&t.startColumn===o.getLineMaxColumn(t.startLineNumber))break}return}default:return}this.mouseDownInfo={lineNumber:t.startLineNumber,iconClicked:n}}onEditorMouseUp(e){const t=this.foldingModel;if(!t||!this.mouseDownInfo||!e.target)return;const n=this.mouseDownInfo.lineNumber,o=this.mouseDownInfo.iconClicked,r=e.target.range;if(!r||r.startLineNumber!==n)return;if(o){if(e.target.type!==4)return}else{const a=this.editor.getModel();if(!a||r.startColumn!==a.getLineMaxColumn(n))return}const s=t.getRegionAtLine(n);if(s&&s.startLineNumber===n){const a=s.isCollapsed;if(o||a){const l=e.event.altKey;let c=[];if(l){const u=h=>!h.containedBy(s)&&!s.containedBy(h),d=t.getRegionsInside(null,u);for(const h of d)h.isCollapsed&&c.push(h);c.length===0&&(c=d)}else{const u=e.event.middleButton||e.event.shiftKey;if(u)for(const d of t.getRegionsInside(s))d.isCollapsed===a&&c.push(d);(a||!u||c.length===0)&&c.push(s)}t.toggleCollapseState(c),this.reveal({lineNumber:n,column:1})}}}reveal(e){this.editor.revealPositionInCenterIfOutsideViewport(e,0)}};Sf.ID="editor.contrib.folding";Sf=hC=$Ct([eL(1,Ut),eL(2,Ti),eL(3,Ao),eL(4,Kc),eL(5,pt)],Sf);class Zye{constructor(e){this.editor=e,this._onDidChange=new le,this._computed=0,this._limited=!1}get limit(){return this.editor.getOptions().get(47)}update(e,t){(e!==this._computed||t!==this._limited)&&(this._computed=e,this._limited=t,this._onDidChange.fire())}}class $s extends ft{runEditorCommand(e,t,n){const o=e.get(Ti),r=Sf.get(t);if(!r)return;const s=r.getFoldingModel();if(s)return this.reportTelemetry(e,t),s.then(a=>{if(a){this.invoke(r,a,t,n,o);const l=t.getSelection();l&&r.reveal(l.getStartPosition())}})}getSelectedLines(e){const t=e.getSelections();return t?t.map(n=>n.startLineNumber):[]}getLineNumbers(e,t){return e&&e.selectionLines?e.selectionLines.map(n=>n+1):this.getSelectedLines(t)}run(e,t){}}function Qye(i){if(!nl(i)){if(!na(i))return!1;const e=i;if(!nl(e.levels)&&!vv(e.levels)||!nl(e.direction)&&!aa(e.direction)||!nl(e.selectionLines)&&(!Array.isArray(e.selectionLines)||!e.selectionLines.every(vv)))return!1}return!0}class UCt extends $s{constructor(){super({id:"editor.unfold",label:C("unfoldAction.label","Unfold"),alias:"Unfold",precondition:ks,kbOpts:{kbExpr:Q.editorTextFocus,primary:3166,mac:{primary:2654},weight:100},description:{description:"Unfold the content in the editor",args:[{name:"Unfold editor argument",description:`Property-value pairs that can be passed through this argument: +2: False`)},findInSelection:{type:"boolean"}}}}]};class bCt extends ft{constructor(){super({id:Ri.StartFindWithArgs,label:C("startFindWithArgsAction","Find With Arguments"),alias:"Find With Arguments",precondition:void 0,kbOpts:{kbExpr:null,primary:0,weight:100},description:_Ct})}run(e,t,n){return _b(this,void 0,void 0,function*(){const o=ha.get(t);if(o){const r=n?{searchString:n.searchString,replaceString:n.replaceString,isReplaceRevealed:n.replaceString!==void 0,isRegex:n.isRegex,wholeWord:n.matchWholeWord,matchCase:n.isCaseSensitive,preserveCase:n.preserveCase}:{};yield o.start({forceRevealReplace:!1,seedSearchStringFromSelection:o.getState().searchString.length===0&&t.getOption(41).seedSearchStringFromSelection!=="never"?"single":"none",seedSearchStringFromNonEmptySelection:t.getOption(41).seedSearchStringFromSelection==="selection",seedSearchStringFromGlobalClipboard:!0,shouldFocus:1,shouldAnimate:!0,updateSearchScope:(n==null?void 0:n.findInSelection)||!1,loop:t.getOption(41).loop},r),o.setGlobalBufferTerm(o.getState().searchString)}})}}class CCt extends ft{constructor(){super({id:Ri.StartFindWithSelection,label:C("startFindWithSelectionAction","Find With Selection"),alias:"Find With Selection",precondition:void 0,kbOpts:{kbExpr:null,primary:0,mac:{primary:2083},weight:100}})}run(e,t){return _b(this,void 0,void 0,function*(){const n=ha.get(t);n&&(yield n.start({forceRevealReplace:!1,seedSearchStringFromSelection:"multiple",seedSearchStringFromNonEmptySelection:!1,seedSearchStringFromGlobalClipboard:!1,shouldFocus:0,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(41).loop}),n.setGlobalBufferTerm(n.getState().searchString))})}}class Qwe extends ft{run(e,t){return _b(this,void 0,void 0,function*(){const n=ha.get(t);n&&!this._run(n)&&(yield n.start({forceRevealReplace:!1,seedSearchStringFromSelection:n.getState().searchString.length===0&&t.getOption(41).seedSearchStringFromSelection!=="never"?"single":"none",seedSearchStringFromNonEmptySelection:t.getOption(41).seedSearchStringFromSelection==="selection",seedSearchStringFromGlobalClipboard:!0,shouldFocus:0,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(41).loop}),this._run(n))})}}class yCt extends Qwe{constructor(){super({id:Ri.NextMatchFindAction,label:C("findNextMatchAction","Find Next"),alias:"Find Next",precondition:void 0,kbOpts:[{kbExpr:Q.focus,primary:61,mac:{primary:2085,secondary:[61]},weight:100},{kbExpr:Me.and(Q.focus,yF),primary:3,weight:100}]})}_run(e){return e.moveToNextMatch()?(e.editor.pushUndoStop(),!0):!1}}class wCt extends Qwe{constructor(){super({id:Ri.PreviousMatchFindAction,label:C("findPreviousMatchAction","Find Previous"),alias:"Find Previous",precondition:void 0,kbOpts:[{kbExpr:Q.focus,primary:1085,mac:{primary:3109,secondary:[1085]},weight:100},{kbExpr:Me.and(Q.focus,yF),primary:1027,weight:100}]})}_run(e){return e.moveToPrevMatch()}}class SCt extends ft{constructor(){super({id:Ri.GoToMatchFindAction,label:C("findMatchAction.goToMatch","Go to Match..."),alias:"Go to Match...",precondition:wp}),this._highlightDecorations=[]}run(e,t,n){const o=ha.get(t);if(!o)return;const r=o.getState().matchesCount;if(r<1){e.get(Ao).notify({severity:E5.Warning,message:C("findMatchAction.noResults","No matches. Try searching for something else.")});return}const a=e.get(uh).createInputBox();a.placeholder=C("findMatchAction.inputPlaceHolder","Type a number to go to a specific match (between 1 and {0})",r);const l=u=>{const d=parseInt(u);if(isNaN(d))return;const h=o.getState().matchesCount;if(d>0&&d<=h)return d-1;if(d<0&&d>=-h)return h+d},c=u=>{const d=l(u);if(typeof d=="number"){a.validationMessage=void 0,o.goToMatch(d);const h=o.getState().currentMatch;h&&this.addDecorations(t,h)}else a.validationMessage=C("findMatchAction.inputValidationMessage","Please type a number between 1 and {0}",o.getState().matchesCount),this.clearDecorations(t)};a.onDidChangeValue(u=>{c(u)}),a.onDidAccept(()=>{const u=l(a.value);typeof u=="number"?(o.goToMatch(u),a.hide()):a.validationMessage=C("findMatchAction.inputValidationMessage","Please type a number between 1 and {0}",o.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(n=>{this._highlightDecorations=n.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:ro(wbe),position:Yl.Full}}}])})}}class Jwe extends ft{run(e,t){return _b(this,void 0,void 0,function*(){const n=ha.get(t);if(!n)return;const o=Zz(t,"single",!1);o&&n.setSearchString(o),this._run(n)||(yield n.start({forceRevealReplace:!1,seedSearchStringFromSelection:"none",seedSearchStringFromNonEmptySelection:!1,seedSearchStringFromGlobalClipboard:!1,shouldFocus:0,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(41).loop}),this._run(n))})}}class xCt extends Jwe{constructor(){super({id:Ri.NextSelectionMatchFindAction,label:C("nextSelectionMatchFindAction","Find Next Selection"),alias:"Find Next Selection",precondition:void 0,kbOpts:{kbExpr:Q.focus,primary:2109,weight:100}})}_run(e){return e.moveToNextMatch()}}class LCt extends Jwe{constructor(){super({id:Ri.PreviousSelectionMatchFindAction,label:C("previousSelectionMatchFindAction","Find Previous Selection"),alias:"Find Previous Selection",precondition:void 0,kbOpts:{kbExpr:Q.focus,primary:3133,weight:100}})}_run(e){return e.moveToPrevMatch()}}const ECt=C0e(new b0e({id:Ri.StartFindReplaceAction,label:C("startReplace","Replace"),alias:"Replace",precondition:Me.or(Q.focus,Me.has("editorIsOpen")),kbOpts:{kbExpr:null,primary:2086,mac:{primary:2596},weight:100},menuOpts:{menuId:Z.MenubarEditMenu,group:"3_find",title:C({key:"miReplace",comment:["&& denotes a mnemonic"]},"&&Replace"),order:2}}));ECt.addImplementation(0,(i,e,t)=>{if(!e.hasModel()||e.getOption(90))return!1;const n=ha.get(e);if(!n)return!1;const o=e.getSelection(),r=n.isFindInputFocused(),s=!o.isEmpty()&&o.startLineNumber===o.endLineNumber&&e.getOption(41).seedSearchStringFromSelection!=="never"&&!r,a=r||s?2:1;return n.start({forceRevealReplace:!0,seedSearchStringFromSelection:s?"single":"none",seedSearchStringFromNonEmptySelection:e.getOption(41).seedSearchStringFromSelection==="selection",seedSearchStringFromGlobalClipboard:e.getOption(41).seedSearchStringFromSelection!=="never",shouldFocus:a,shouldAnimate:!0,updateSearchScope:!1,loop:e.getOption(41).loop})});zn(ha.ID,Qz,0);ze(bCt);ze(CCt);ze(yCt);ze(wCt);ze(SCt);ze(xCt);ze(LCt);const dh=Ir.bindToContribution(ha.get);Ye(new dh({id:Ri.CloseFindWidgetCommand,precondition:wp,handler:i=>i.closeFindWidget(),kbOpts:{weight:100+5,kbExpr:Me.and(Q.focus,Me.not("isComposing")),primary:9,secondary:[1033]}}));Ye(new dh({id:Ri.ToggleCaseSensitiveCommand,precondition:void 0,handler:i=>i.toggleCaseSensitive(),kbOpts:{weight:100+5,kbExpr:Q.focus,primary:tR.primary,mac:tR.mac,win:tR.win,linux:tR.linux}}));Ye(new dh({id:Ri.ToggleWholeWordCommand,precondition:void 0,handler:i=>i.toggleWholeWords(),kbOpts:{weight:100+5,kbExpr:Q.focus,primary:nR.primary,mac:nR.mac,win:nR.win,linux:nR.linux}}));Ye(new dh({id:Ri.ToggleRegexCommand,precondition:void 0,handler:i=>i.toggleRegex(),kbOpts:{weight:100+5,kbExpr:Q.focus,primary:iR.primary,mac:iR.mac,win:iR.win,linux:iR.linux}}));Ye(new dh({id:Ri.ToggleSearchScopeCommand,precondition:void 0,handler:i=>i.toggleSearchScope(),kbOpts:{weight:100+5,kbExpr:Q.focus,primary:oR.primary,mac:oR.mac,win:oR.win,linux:oR.linux}}));Ye(new dh({id:Ri.TogglePreserveCaseCommand,precondition:void 0,handler:i=>i.togglePreserveCase(),kbOpts:{weight:100+5,kbExpr:Q.focus,primary:rR.primary,mac:rR.mac,win:rR.win,linux:rR.linux}}));Ye(new dh({id:Ri.ReplaceOneAction,precondition:wp,handler:i=>i.replace(),kbOpts:{weight:100+5,kbExpr:Q.focus,primary:3094}}));Ye(new dh({id:Ri.ReplaceOneAction,precondition:wp,handler:i=>i.replace(),kbOpts:{weight:100+5,kbExpr:Me.and(Q.focus,wY),primary:3}}));Ye(new dh({id:Ri.ReplaceAllAction,precondition:wp,handler:i=>i.replaceAll(),kbOpts:{weight:100+5,kbExpr:Q.focus,primary:2563}}));Ye(new dh({id:Ri.ReplaceAllAction,precondition:wp,handler:i=>i.replaceAll(),kbOpts:{weight:100+5,kbExpr:Me.and(Q.focus,wY),primary:void 0,mac:{primary:2051}}}));Ye(new dh({id:Ri.SelectAllMatchesAction,precondition:wp,handler:i=>i.selectAllMatches(),kbOpts:{weight:100+5,kbExpr:Q.focus,primary:515}}));const DCt={[0]:" ",[1]:"u",[2]:"r"},pce=65535,bd=16777215,mce=4278190080;class d7{constructor(e){const t=Math.ceil(e/32);this._states=new Uint32Array(t)}get(e){const t=e/32|0,n=e%32;return(this._states[t]&1<pce)throw new Error("invalid startIndexes or endIndexes size");this._startIndexes=e,this._endIndexes=t,this._collapseStates=new d7(e.length),this._userDefinedStates=new d7(e.length),this._recoveredStates=new d7(e.length),this._types=n,this._parentsComputed=!1}ensureParentIndices(){if(!this._parentsComputed){this._parentsComputed=!0;const e=[],t=(n,o)=>{const r=e[e.length-1];return this.getStartLineNumber(r)<=n&&this.getEndLineNumber(r)>=o};for(let n=0,o=this._startIndexes.length;nbd||s>bd)throw new Error("startLineNumber or endLineNumber must not exceed "+bd);for(;e.length>0&&!t(r,s);)e.pop();const a=e.length>0?e[e.length-1]:-1;e.push(n),this._startIndexes[n]=r+((a&255)<<24),this._endIndexes[n]=s+((a&65280)<<16)}}}get length(){return this._startIndexes.length}getStartLineNumber(e){return this._startIndexes[e]&bd}getEndLineNumber(e){return this._endIndexes[e]&bd}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)?1:this.isRecovered(e)?2:0}setSource(e,t){t===1?(this.setUserDefined(e,!0),this.setRecovered(e,!1)):t===2?(this.setUserDefined(e,!1),this.setRecovered(e,!0)):(this.setUserDefined(e,!1),this.setRecovered(e,!1))}setCollapsedAllOfType(e,t){let n=!1;if(this._types)for(let o=0;o>>24)+((this._endIndexes[e]&mce)>>>16);return t===pce?-1:t}contains(e,t){return this.getStartLineNumber(e)<=t&&this.getEndLineNumber(e)>=t}findIndex(e){let t=0,n=this._startIndexes.length;if(n===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(p)?m=>mm=u.startLineNumber))c&&c.startLineNumber===u.startLineNumber?(u.source===1?p=u:(p=c,p.isCollapsed=u.isCollapsed&&c.endLineNumber===u.endLineNumber,p.source=0),c=r(++a)):(p=u,u.isCollapsed&&u.source===0&&(p.source=2)),u=s(++l);else{let v=l,m=u;for(;;){if(!m||m.startLineNumber>c.endLineNumber){p=c;break}if(m.source===1&&m.endLineNumber>c.endLineNumber)break;m=s(++v)}c=r(++a)}if(p){for(;h&&h.endLineNumberp.startLineNumber&&p.startLineNumber>f&&p.endLineNumber<=n&&(!h||h.endLineNumber>=p.endLineNumber)&&(g.push(p),f=p.startLineNumber,h&&d.push(h),h=p)}}return g}}class kCt{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}}class ICt{get regions(){return this._regions}get textModel(){return this._textModel}constructor(e,t){this._updateEventEmitter=new le,this.onDidChange=this._updateEventEmitter.event,this._textModel=e,this._decorationProvider=t,this._regions=new Ml(new Uint32Array(0),new Uint32Array(0)),this._editorDecorationIds=[]}toggleCollapseState(e){if(!e.length)return;e=e.sort((n,o)=>n.regionIndex-o.regionIndex);const t={};this._decorationProvider.changeDecorations(n=>{let o=0,r=-1,s=-1;const a=l=>{for(;os&&(s=c),o++}};for(const l of e){const c=l.regionIndex,u=this._editorDecorationIds[c];if(u&&!t[u]){t[u]=!0,a(c);const d=!this._regions.isCollapsed(c);this._regions.setCollapsed(c,d),r=Math.max(r,this._regions.getEndLineNumber(c))}}a(this._regions.length)}),this._updateEventEmitter.fire({model:this,collapseStateChanged:e})}removeManualRanges(e){const t=new Array,n=o=>{for(const r of e)if(!(r.startLineNumber>o.endLineNumber||o.startLineNumber>r.endLineNumber))return!0;return!1};for(let o=0;on&&(n=a)}this._decorationProvider.changeDecorations(o=>this._editorDecorationIds=o.deltaDecorations(this._editorDecorationIds,t)),this._regions=e,this._updateEventEmitter.fire({model:this})}_currentFoldedOrManualRanges(e=[]){const t=(o,r)=>{for(const s of e)if(o=s.endLineNumber||s.startLineNumber<1||s.endLineNumber>n)continue;const a=this._getLinesChecksum(s.startLineNumber+1,s.endLineNumber);t.push({startLineNumber:s.startLineNumber,endLineNumber:s.endLineNumber,isCollapsed:s.isCollapsed,source:s.source,checksum:a})}return t.length>0?t:void 0}applyMemento(e){var t,n;if(!Array.isArray(e))return;const o=[],r=this._textModel.getLineCount();for(const a of e){if(a.startLineNumber>=a.endLineNumber||a.startLineNumber<1||a.endLineNumber>r)continue;const l=this._getLinesChecksum(a.startLineNumber+1,a.endLineNumber);(!a.checksum||l===a.checksum)&&o.push({startLineNumber:a.startLineNumber,endLineNumber:a.endLineNumber,type:void 0,isCollapsed:(t=a.isCollapsed)!==null&&t!==void 0?t:!0,source:(n=a.source)!==null&&n!==void 0?n:0})}const s=Ml.sanitizeAndMerge(this._regions,o,r);this.updatePost(Ml.fromFoldRanges(s))}_getLinesChecksum(e,t){return W0e(this._textModel.getLineContent(e)+this._textModel.getLineContent(t))%1e6}dispose(){this._decorationProvider.removeDecorations(this._editorDecorationIds)}getAllRegionsAtLine(e,t){const n=[];if(this._regions){let o=this._regions.findRange(e),r=1;for(;o>=0;){const s=this._regions.toRegion(o);(!t||t(s,r))&&n.push(s),r++,o=s.parentIndex}}return n}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 n=[],o=e?e.regionIndex+1:0,r=e?e.endLineNumber:Number.MAX_VALUE;if(t&&t.length===2){const s=[];for(let a=o,l=this._regions.length;a0&&!c.containedBy(s[s.length-1]);)s.pop();s.push(c),t(c,s.length)&&n.push(c)}else break}}else for(let s=o,a=this._regions.length;s1){const a=i.getRegionsInside(r,(l,c)=>l.isCollapsed!==s&&c0)for(const r of n){const s=i.getRegionAtLine(r);if(s&&(s.isCollapsed!==e&&o.push(s),t>1)){const a=i.getRegionsInside(s,(l,c)=>l.isCollapsed!==e&&cs.isCollapsed!==e&&aa.isCollapsed!==e&&l<=t);o.push(...s)}i.toggleCollapseState(o)}function TCt(i,e,t){const n=[];for(const o of t){const r=i.getAllRegionsAtLine(o,s=>s.isCollapsed!==e);r.length>0&&n.push(r[0])}i.toggleCollapseState(n)}function NCt(i,e,t,n){const o=(s,a)=>a===e&&s.isCollapsed!==t&&!n.some(l=>s.containsLine(l)),r=i.getRegionsInside(null,o);i.toggleCollapseState(r)}function nSe(i,e,t){const n=[];for(const s of t){const a=i.getAllRegionsAtLine(s,void 0);a.length>0&&n.push(a[0])}const o=s=>n.every(a=>!a.containedBy(s)&&!s.containedBy(a))&&s.isCollapsed!==e,r=i.getRegionsInside(null,o);i.toggleCollapseState(r)}function LY(i,e,t){const n=i.textModel,o=i.regions,r=[];for(let s=o.length-1;s>=0;s--)if(t!==o.isCollapsed(s)){const a=o.getStartLineNumber(s);e.test(n.getLineContent(a))&&r.push(o.toRegion(s))}i.toggleCollapseState(r)}function EY(i,e,t){const n=i.regions,o=[];for(let r=n.length-1;r>=0;r--)t!==n.isCollapsed(r)&&e===n.getType(r)&&o.push(n.toRegion(r));i.toggleCollapseState(o)}function RCt(i,e){let t=null;const n=e.getRegionAtLine(i);if(n!==null&&(t=n.startLineNumber,i===t)){const o=n.parentIndex;o!==-1?t=e.regions.getStartLineNumber(o):t=null}return t}function MCt(i,e){let t=e.getRegionAtLine(i);if(t!==null&&t.startLineNumber===i){if(i!==t.startLineNumber)return t.startLineNumber;{const n=t.parentIndex;let o=0;for(n!==-1&&(o=e.regions.getStartLineNumber(t.parentIndex));t!==null;)if(t.regionIndex>0){if(t=e.regions.toRegion(t.regionIndex-1),t.startLineNumber<=o)return null;if(t.parentIndex===n)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 ACt(i,e){let t=e.getRegionAtLine(i);if(t!==null&&t.startLineNumber===i){const n=t.parentIndex;let o=0;if(n!==-1)o=e.regions.getEndLineNumber(t.parentIndex);else{if(e.regions.length===0)return null;o=e.regions.getEndLineNumber(e.regions.length-1)}for(;t!==null;)if(t.regionIndex=o)return null;if(t.parentIndex===n)return t.startLineNumber}else return null}else if(e.regions.length>0)for(t=e.regions.toRegion(0);t!==null;){if(t.startLineNumber>i)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||kv(t.text)[0]!==0))}updateHiddenRanges(){let e=!1;const t=[];let n=0,o=0,r=Number.MAX_VALUE,s=-1;const a=this._foldingModel.regions;for(;n0}isHidden(e){return vce(this._hiddenRanges,e)!==null}adjustSelections(e){let t=!1;const n=this._foldingModel.textModel;let o=null;const r=s=>((!o||!OCt(s,o))&&(o=vce(this._hiddenRanges,s)),o?o.startLineNumber-1:null);for(let s=0,a=e.length;s0&&(this._hiddenRanges=[],this._updateEventEmitter.fire(this._hiddenRanges)),this._foldingModelListener&&(this._foldingModelListener.dispose(),this._foldingModelListener=null)}}function OCt(i,e){return i>=e.startLineNumber&&i<=e.endLineNumber}function vce(i,e){const t=$D(i,n=>e=0&&i[t].endLineNumber>=e?i[t]:null}const FCt=5e3,BCt="indent";class DY{constructor(e,t,n){this.editorModel=e,this.languageConfigurationService=t,this.foldingRangesLimit=n,this.id=BCt}dispose(){}compute(e){const t=this.languageConfigurationService.getLanguageConfiguration(this.editorModel.getLanguageId()).foldingRules,n=t&&!!t.offSide,o=t&&t.markers;return Promise.resolve(HCt(this.editorModel,n,o,this.foldingRangesLimit))}}class WCt{constructor(e){this._startIndexes=[],this._endIndexes=[],this._indentOccurrences=[],this._length=0,this._foldingRangesLimit=e}insertFirst(e,t,n){if(e>bd||t>bd)return;const o=this._length;this._startIndexes[o]=e,this._endIndexes[o]=t,this._length++,n<1e3&&(this._indentOccurrences[n]=(this._indentOccurrences[n]||0)+1)}toIndentRanges(e){const t=this._foldingRangesLimit.limit;if(this._length<=t){this._foldingRangesLimit.update(this._length,!1);const n=new Uint32Array(this._length),o=new Uint32Array(this._length);for(let r=this._length-1,s=0;r>=0;r--,s++)n[s]=this._startIndexes[r],o[s]=this._endIndexes[r];return new Ml(n,o)}else{this._foldingRangesLimit.update(this._length,t);let n=0,o=this._indentOccurrences.length;for(let l=0;lt){o=l;break}n+=c}}const r=e.getOptions().tabSize,s=new Uint32Array(t),a=new Uint32Array(t);for(let l=this._length-1,c=0;l>=0;l--){const u=this._startIndexes[l],d=e.getLineContent(u),h=y5(d,r);(h{}};function HCt(i,e,t,n=VCt){const o=i.getOptions().tabSize,r=new WCt(n);let s;t&&(s=new RegExp(`(${t.start.source})|(?:${t.end.source})`));const a=[],l=i.getLineCount()+1;a.push({indent:-1,endAbove:l,line:l});for(let c=i.getLineCount();c>0;c--){const u=i.getLineContent(c),d=y5(u,o);let h=a[a.length-1];if(d===-1){e&&(h.endAbove=c);continue}let f;if(s&&(f=u.match(s)))if(f[1]){let g=a.length-1;for(;g>0&&a[g].indent!==-2;)g--;if(g>0){a.length=g+1,h=a[g],r.insertFirst(c,h.line,d),h.line=c,h.indent=d,h.endAbove=c;continue}}else{a.push({indent:-2,endAbove:c,line:c});continue}if(h.indent>d){do a.pop(),h=a[a.length-1];while(h.indent>d);const g=h.endAbove-1;g-c>=1&&r.insertFirst(c,g,d)}h.indent===d?h.endAbove=c:a.push({indent:d,endAbove:c,line:c})}return r.toIndentRanges(i)}const $Ct=J("editor.foldBackground",{light:St(Sm,.3),dark:St(Sm,.3),hcDark:null,hcLight:null},C("foldBackgroundBackground","Background color behind folded ranges. The color must not be opaque so as not to hide underlying decorations."),!0);J("editorGutter.foldingControlForeground",{dark:wm,light:wm,hcDark:wm,hcLight:wm},C("editorGutter.foldingControlForeground","Color of the folding control in the editor gutter."));const xF=Eo("folding-expanded",Xe.chevronDown,C("foldingExpandedIcon","Icon for expanded ranges in the editor glyph margin.")),LF=Eo("folding-collapsed",Xe.chevronRight,C("foldingCollapsedIcon","Icon for collapsed ranges in the editor glyph margin.")),iSe=Eo("folding-manual-collapsed",LF,C("foldingManualCollapedIcon","Icon for manually collapsed ranges in the editor glyph margin.")),oSe=Eo("folding-manual-expanded",xF,C("foldingManualExpandedIcon","Icon for manually expanded ranges in the editor glyph margin.")),kY={color:ro($Ct),position:ll.Inline};class Bo{constructor(e){this.editor=e,this.showFoldingControls="mouseover",this.showFoldingHighlights=!0}getDecorationOption(e,t,n){return t?Bo.HIDDEN_RANGE_DECORATION:this.showFoldingControls==="never"?e?this.showFoldingHighlights?Bo.NO_CONTROLS_COLLAPSED_HIGHLIGHTED_RANGE_DECORATION:Bo.NO_CONTROLS_COLLAPSED_RANGE_DECORATION:Bo.NO_CONTROLS_EXPANDED_RANGE_DECORATION:e?n?this.showFoldingHighlights?Bo.MANUALLY_COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION:Bo.MANUALLY_COLLAPSED_VISUAL_DECORATION:this.showFoldingHighlights?Bo.COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION:Bo.COLLAPSED_VISUAL_DECORATION:this.showFoldingControls==="mouseover"?n?Bo.MANUALLY_EXPANDED_AUTO_HIDE_VISUAL_DECORATION:Bo.EXPANDED_AUTO_HIDE_VISUAL_DECORATION:n?Bo.MANUALLY_EXPANDED_VISUAL_DECORATION:Bo.EXPANDED_VISUAL_DECORATION}changeDecorations(e){return this.editor.changeDecorations(e)}removeDecorations(e){this.editor.removeDecorations(e)}}Bo.COLLAPSED_VISUAL_DECORATION=Jt.register({description:"folding-collapsed-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",isWholeLine:!0,firstLineDecorationClassName:Mt.asClassName(LF)});Bo.COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION=Jt.register({description:"folding-collapsed-highlighted-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",className:"folded-background",minimap:kY,isWholeLine:!0,firstLineDecorationClassName:Mt.asClassName(LF)});Bo.MANUALLY_COLLAPSED_VISUAL_DECORATION=Jt.register({description:"folding-manually-collapsed-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",isWholeLine:!0,firstLineDecorationClassName:Mt.asClassName(iSe)});Bo.MANUALLY_COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION=Jt.register({description:"folding-manually-collapsed-highlighted-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",className:"folded-background",minimap:kY,isWholeLine:!0,firstLineDecorationClassName:Mt.asClassName(iSe)});Bo.NO_CONTROLS_COLLAPSED_RANGE_DECORATION=Jt.register({description:"folding-no-controls-range-decoration",stickiness:0,afterContentClassName:"inline-folded",isWholeLine:!0});Bo.NO_CONTROLS_COLLAPSED_HIGHLIGHTED_RANGE_DECORATION=Jt.register({description:"folding-no-controls-range-decoration",stickiness:0,afterContentClassName:"inline-folded",className:"folded-background",minimap:kY,isWholeLine:!0});Bo.EXPANDED_VISUAL_DECORATION=Jt.register({description:"folding-expanded-visual-decoration",stickiness:1,isWholeLine:!0,firstLineDecorationClassName:"alwaysShowFoldIcons "+Mt.asClassName(xF)});Bo.EXPANDED_AUTO_HIDE_VISUAL_DECORATION=Jt.register({description:"folding-expanded-auto-hide-visual-decoration",stickiness:1,isWholeLine:!0,firstLineDecorationClassName:Mt.asClassName(xF)});Bo.MANUALLY_EXPANDED_VISUAL_DECORATION=Jt.register({description:"folding-manually-expanded-visual-decoration",stickiness:0,isWholeLine:!0,firstLineDecorationClassName:"alwaysShowFoldIcons "+Mt.asClassName(oSe)});Bo.MANUALLY_EXPANDED_AUTO_HIDE_VISUAL_DECORATION=Jt.register({description:"folding-manually-expanded-auto-hide-visual-decoration",stickiness:0,isWholeLine:!0,firstLineDecorationClassName:Mt.asClassName(oSe)});Bo.NO_CONTROLS_EXPANDED_RANGE_DECORATION=Jt.register({description:"folding-no-controls-range-decoration",stickiness:0,isWholeLine:!0});Bo.HIDDEN_RANGE_DECORATION=Jt.register({description:"folding-hidden-range-decoration",stickiness:1});const zCt={},UCt="syntax";class IY{constructor(e,t,n,o,r){this.editorModel=e,this.providers=t,this.handleFoldingRangesChange=n,this.foldingRangesLimit=o,this.fallbackRangeProvider=r,this.id=UCt,this.disposables=new Be,r&&this.disposables.add(r);for(const s of t)typeof s.onDidChange=="function"&&this.disposables.add(s.onDidChange(n))}compute(e){return jCt(this.providers,this.editorModel,e).then(t=>{var n,o;return t?qCt(t,this.foldingRangesLimit):(o=(n=this.fallbackRangeProvider)===null||n===void 0?void 0:n.compute(e))!==null&&o!==void 0?o:null})}dispose(){this.disposables.dispose()}}function jCt(i,e,t){let n=null;const o=i.map((r,s)=>Promise.resolve(r.provideFoldingRanges(e,zCt,t)).then(a=>{if(!t.isCancellationRequested&&Array.isArray(a)){Array.isArray(n)||(n=[]);const l=e.getLineCount();for(const c of a)c.start>0&&c.end>c.start&&c.end<=l&&n.push({start:c.start,end:c.end,rank:s,kind:c.kind})}},$o));return Promise.all(o).then(r=>n)}class KCt{constructor(e){this._startIndexes=[],this._endIndexes=[],this._nestingLevels=[],this._nestingLevelCounts=[],this._types=[],this._length=0,this._foldingRangesLimit=e}add(e,t,n,o){if(e>bd||t>bd)return;const r=this._length;this._startIndexes[r]=e,this._endIndexes[r]=t,this._nestingLevels[r]=o,this._types[r]=n,this._length++,o<30&&(this._nestingLevelCounts[o]=(this._nestingLevelCounts[o]||0)+1)}toIndentRanges(){const e=this._foldingRangesLimit.limit;if(this._length<=e){this._foldingRangesLimit.update(this._length,!1);const t=new Uint32Array(this._length),n=new Uint32Array(this._length);for(let o=0;oe){n=a;break}t+=l}}const o=new Uint32Array(e),r=new Uint32Array(e),s=[];for(let a=0,l=0;a{let l=s.start-a.start;return l===0&&(l=s.rank-a.rank),l}),n=new KCt(e);let o;const r=[];for(const s of t)if(!o)o=s,n.add(s.start,s.end,s.kind&&s.kind.value,r.length);else if(s.start>o.start)if(s.end<=o.end)r.push(o),o=s,n.add(s.start,s.end,s.kind&&s.kind.value,r.length);else{if(s.start>o.end){do o=r.pop();while(o&&s.start>o.end);o&&r.push(o),o=s}n.add(s.start,s.end,s.kind&&s.kind.value,r.length)}return n.toIndentRanges()}var GCt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},tL=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},XCt=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},hC;const Is=new lt("foldingEnabled",!1);let xf=hC=class extends _e{static get(e){return e.getContribution(hC.ID)}static getFoldingRangeProviders(e,t){var n,o;const r=e.foldingRangeProvider.ordered(t);return(o=(n=hC._foldingRangeSelector)===null||n===void 0?void 0:n.call(hC,r,t))!==null&&o!==void 0?o:r}constructor(e,t,n,o,r,s){super(),this.contextKeyService=t,this.languageConfigurationService=n,this.languageFeaturesService=s,this.localToDispose=this._register(new Be),this.editor=e,this._foldingLimitReporter=new rSe(e);const a=this.editor.getOptions();this._isEnabled=a.get(43),this._useFoldingProviders=a.get(44)!=="indentation",this._unfoldOnClickAfterEndOfLine=a.get(48),this._restoringViewState=!1,this._currentModelHasFoldedImports=!1,this._foldingImportsByDefault=a.get(46),this.updateDebounceInfo=r.for(s.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 Bo(e),this.foldingDecorationProvider.showFoldingControls=a.get(109),this.foldingDecorationProvider.showFoldingHighlights=a.get(45),this.foldingEnabled=Is.bindTo(this.contextKeyService),this.foldingEnabled.set(this._isEnabled),this._register(this.editor.onDidChangeModel(()=>this.onModelChanged())),this._register(this.editor.onDidChangeConfiguration(l=>{if(l.hasChanged(43)&&(this._isEnabled=this.editor.getOptions().get(43),this.foldingEnabled.set(this._isEnabled),this.onModelChanged()),l.hasChanged(47)&&this.onModelChanged(),l.hasChanged(109)||l.hasChanged(45)){const c=this.editor.getOptions();this.foldingDecorationProvider.showFoldingControls=c.get(109),this.foldingDecorationProvider.showFoldingHighlights=c.get(45),this.triggerFoldingModelChanged()}l.hasChanged(44)&&(this._useFoldingProviders=this.editor.getOptions().get(44)!=="indentation",this.onFoldingStrategyChanged()),l.hasChanged(48)&&(this._unfoldOnClickAfterEndOfLine=this.editor.getOptions().get(48)),l.hasChanged(46)&&(this._foldingImportsByDefault=this.editor.getOptions().get(46))})),this.onModelChanged()}saveViewState(){const e=this.editor.getModel();if(!e||!this._isEnabled||e.isTooLargeForTokenization())return{};if(this.foldingModel){const t=this.foldingModel.getMemento(),n=this.rangeProvider?this.rangeProvider.id:void 0;return{collapsedRegions:t,lineCount:e.getLineCount(),provider:n,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 ICt(e,this.foldingDecorationProvider),this.localToDispose.add(this.foldingModel),this.hiddenRangeModel=new PCt(this.foldingModel),this.localToDispose.add(this.hiddenRangeModel),this.localToDispose.add(this.hiddenRangeModel.onDidChange(t=>this.onHiddenRangesChanges(t))),this.updateScheduler=new Wu(this.updateDebounceInfo.get(e)),this.cursorChangedScheduler=new bi(()=>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:()=>{var t,n;this.foldingRegionPromise&&(this.foldingRegionPromise.cancel(),this.foldingRegionPromise=null),(t=this.updateScheduler)===null||t===void 0||t.cancel(),this.updateScheduler=null,this.foldingModel=null,this.foldingModelPromise=null,this.hiddenRangeModel=null,this.cursorChangedScheduler=null,(n=this.rangeProvider)===null||n===void 0||n.dispose(),this.rangeProvider=null}}),this.triggerFoldingModelChanged())}onFoldingStrategyChanged(){var e;(e=this.rangeProvider)===null||e===void 0||e.dispose(),this.rangeProvider=null,this.triggerFoldingModelChanged()}getRangeProvider(e){if(this.rangeProvider)return this.rangeProvider;const t=new DY(e,this.languageConfigurationService,this._foldingLimitReporter);if(this.rangeProvider=t,this._useFoldingProviders&&this.foldingModel){const n=hC.getFoldingRangeProviders(this.languageFeaturesService,e);n.length>0&&(this.rangeProvider=new IY(e,n,()=>this.triggerFoldingModelChanged(),this._foldingLimitReporter,t))}return this.rangeProvider}getFoldingModel(){return this.foldingModelPromise}onDidChangeModelContent(e){var t;(t=this.hiddenRangeModel)===null||t===void 0||t.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 Ls,n=this.getRangeProvider(e.textModel),o=this.foldingRegionPromise=sr(r=>n.compute(r));return o.then(r=>{if(r&&o===this.foldingRegionPromise){let s;if(this._foldingImportsByDefault&&!this._currentModelHasFoldedImports){const u=r.setCollapsedAllOfType(ra.Imports.value,!0);u&&(s=Zd.capture(this.editor),this._currentModelHasFoldedImports=u)}const a=this.editor.getSelections(),l=a?a.map(u=>u.startLineNumber):[];e.update(r,l),s==null||s.restore(this.editor);const c=this.updateDebounceInfo.update(e.textModel,t.elapsed());this.updateScheduler&&(this.updateScheduler.defaultDelay=c)}return e})}).then(void 0,e=>(en(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 n=this.editor.getSelections();if(n&&n.length>0){const o=[];for(const r of n){const s=r.selectionStartLineNumber;this.hiddenRangeModel&&this.hiddenRangeModel.isHidden(s)&&o.push(...t.getAllRegionsAtLine(s,a=>a.isCollapsed&&s>a.startLineNumber))}o.length&&(t.toggleCollapseState(o),this.reveal(n[0].getPosition()))}}}).then(void 0,en)}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 n=!1;switch(e.target.type){case 4:{const o=e.target.detail,r=e.target.element.offsetLeft;if(o.offsetX-r<4)return;n=!0;break}case 7:{if(this._unfoldOnClickAfterEndOfLine&&this.hiddenRangeModel.hasRanges()&&!e.target.detail.isAfterLines)break;return}case 6:{if(this.hiddenRangeModel.hasRanges()){const o=this.editor.getModel();if(o&&t.startColumn===o.getLineMaxColumn(t.startLineNumber))break}return}default:return}this.mouseDownInfo={lineNumber:t.startLineNumber,iconClicked:n}}onEditorMouseUp(e){const t=this.foldingModel;if(!t||!this.mouseDownInfo||!e.target)return;const n=this.mouseDownInfo.lineNumber,o=this.mouseDownInfo.iconClicked,r=e.target.range;if(!r||r.startLineNumber!==n)return;if(o){if(e.target.type!==4)return}else{const a=this.editor.getModel();if(!a||r.startColumn!==a.getLineMaxColumn(n))return}const s=t.getRegionAtLine(n);if(s&&s.startLineNumber===n){const a=s.isCollapsed;if(o||a){const l=e.event.altKey;let c=[];if(l){const u=h=>!h.containedBy(s)&&!s.containedBy(h),d=t.getRegionsInside(null,u);for(const h of d)h.isCollapsed&&c.push(h);c.length===0&&(c=d)}else{const u=e.event.middleButton||e.event.shiftKey;if(u)for(const d of t.getRegionsInside(s))d.isCollapsed===a&&c.push(d);(a||!u||c.length===0)&&c.push(s)}t.toggleCollapseState(c),this.reveal({lineNumber:n,column:1})}}}reveal(e){this.editor.revealPositionInCenterIfOutsideViewport(e,0)}};xf.ID="editor.contrib.folding";xf=hC=GCt([tL(1,Ut),tL(2,Ti),tL(3,Ao),tL(4,qc),tL(5,pt)],xf);class rSe{constructor(e){this.editor=e,this._onDidChange=new le,this._computed=0,this._limited=!1}get limit(){return this.editor.getOptions().get(47)}update(e,t){(e!==this._computed||t!==this._limited)&&(this._computed=e,this._limited=t,this._onDidChange.fire())}}class $s extends ft{runEditorCommand(e,t,n){const o=e.get(Ti),r=xf.get(t);if(!r)return;const s=r.getFoldingModel();if(s)return this.reportTelemetry(e,t),s.then(a=>{if(a){this.invoke(r,a,t,n,o);const l=t.getSelection();l&&r.reveal(l.getStartPosition())}})}getSelectedLines(e){const t=e.getSelections();return t?t.map(n=>n.startLineNumber):[]}getLineNumbers(e,t){return e&&e.selectionLines?e.selectionLines.map(n=>n+1):this.getSelectedLines(t)}run(e,t){}}function sSe(i){if(!il(i)){if(!ia(i))return!1;const e=i;if(!il(e.levels)&&!_v(e.levels)||!il(e.direction)&&!la(e.direction)||!il(e.selectionLines)&&(!Array.isArray(e.selectionLines)||!e.selectionLines.every(_v)))return!1}return!0}class YCt extends $s{constructor(){super({id:"editor.unfold",label:C("unfoldAction.label","Unfold"),alias:"Unfold",precondition:Is,kbOpts:{kbExpr:Q.editorTextFocus,primary:3166,mac:{primary:2654},weight:100},description:{description:"Unfold the content in the editor",args:[{name:"Unfold editor argument",description:`Property-value pairs that can be passed through this argument: * 'levels': Number of levels to unfold. If not set, defaults to 1. * 'direction': If 'up', unfold given number of levels up otherwise unfolds down. * 'selectionLines': Array of the start lines (0-based) of the editor selections to apply the unfold action to. If not set, the active selection(s) will be used. - `,constraint:Qye,schema:{type:"object",properties:{levels:{type:"number",default:1},direction:{type:"string",enum:["up","down"],default:"down"},selectionLines:{type:"array",items:{type:"number"}}}}}]}})}invoke(e,t,n,o){const r=o&&o.levels||1,s=this.getLineNumbers(o,n);o&&o.direction==="up"?qye(t,!1,r,s):IS(t,!1,r,s)}}class jCt extends $s{constructor(){super({id:"editor.unfoldRecursively",label:C("unFoldRecursivelyAction.label","Unfold Recursively"),alias:"Unfold Recursively",precondition:ks,kbOpts:{kbExpr:Q.editorTextFocus,primary:Zo(2089,2142),weight:100}})}invoke(e,t,n,o){IS(t,!1,Number.MAX_VALUE,this.getSelectedLines(n))}}class KCt extends $s{constructor(){super({id:"editor.fold",label:C("foldAction.label","Fold"),alias:"Fold",precondition:ks,kbOpts:{kbExpr:Q.editorTextFocus,primary:3164,mac:{primary:2652},weight:100},description:{description:"Fold the content in the editor",args:[{name:"Fold editor argument",description:`Property-value pairs that can be passed through this argument: + `,constraint:sSe,schema:{type:"object",properties:{levels:{type:"number",default:1},direction:{type:"string",enum:["up","down"],default:"down"},selectionLines:{type:"array",items:{type:"number"}}}}}]}})}invoke(e,t,n,o){const r=o&&o.levels||1,s=this.getLineNumbers(o,n);o&&o.direction==="up"?tSe(t,!1,r,s):TS(t,!1,r,s)}}class ZCt extends $s{constructor(){super({id:"editor.unfoldRecursively",label:C("unFoldRecursivelyAction.label","Unfold Recursively"),alias:"Unfold Recursively",precondition:Is,kbOpts:{kbExpr:Q.editorTextFocus,primary:Zo(2089,2142),weight:100}})}invoke(e,t,n,o){TS(t,!1,Number.MAX_VALUE,this.getSelectedLines(n))}}class QCt extends $s{constructor(){super({id:"editor.fold",label:C("foldAction.label","Fold"),alias:"Fold",precondition:Is,kbOpts:{kbExpr:Q.editorTextFocus,primary:3164,mac:{primary:2652},weight:100},description:{description:"Fold the content in the editor",args:[{name:"Fold editor argument",description:`Property-value pairs that can be passed through this argument: * 'levels': Number of levels to fold. * 'direction': If 'up', folds given number of levels up otherwise folds down. * 'selectionLines': Array of the start lines (0-based) of the editor selections to apply the fold action to. If not set, the active selection(s) will be used. If no levels or direction is set, folds the region at the locations or if already collapsed, the first uncollapsed parent instead. - `,constraint:Qye,schema:{type:"object",properties:{levels:{type:"number"},direction:{type:"string",enum:["up","down"]},selectionLines:{type:"array",items:{type:"number"}}}}}]}})}invoke(e,t,n,o){const r=this.getLineNumbers(o,n),s=o&&o.levels,a=o&&o.direction;typeof s!="number"&&typeof a!="string"?xCt(t,!0,r):a==="up"?qye(t,!0,s||1,r):IS(t,!0,s||1,r)}}class qCt extends $s{constructor(){super({id:"editor.toggleFold",label:C("toggleFoldAction.label","Toggle Fold"),alias:"Toggle Fold",precondition:ks,kbOpts:{kbExpr:Q.editorTextFocus,primary:Zo(2089,2090),weight:100}})}invoke(e,t,n){const o=this.getSelectedLines(n);Kye(t,1,o)}}class GCt extends $s{constructor(){super({id:"editor.foldRecursively",label:C("foldRecursivelyAction.label","Fold Recursively"),alias:"Fold Recursively",precondition:ks,kbOpts:{kbExpr:Q.editorTextFocus,primary:Zo(2089,2140),weight:100}})}invoke(e,t,n){const o=this.getSelectedLines(n);IS(t,!0,Number.MAX_VALUE,o)}}class XCt extends $s{constructor(){super({id:"editor.foldAllBlockComments",label:C("foldAllBlockComments.label","Fold All Block Comments"),alias:"Fold All Block Comments",precondition:ks,kbOpts:{kbExpr:Q.editorTextFocus,primary:Zo(2089,2138),weight:100}})}invoke(e,t,n,o,r){if(t.regions.hasTypes())bY(t,oa.Comment.value,!0);else{const s=n.getModel();if(!s)return;const a=r.getLanguageConfiguration(s.getLanguageId()).comments;if(a&&a.blockCommentStartToken){const l=new RegExp("^\\s*"+Gl(a.blockCommentStartToken));_Y(t,l,!0)}}}}class YCt extends $s{constructor(){super({id:"editor.foldAllMarkerRegions",label:C("foldAllMarkerRegions.label","Fold All Regions"),alias:"Fold All Regions",precondition:ks,kbOpts:{kbExpr:Q.editorTextFocus,primary:Zo(2089,2077),weight:100}})}invoke(e,t,n,o,r){if(t.regions.hasTypes())bY(t,oa.Region.value,!0);else{const s=n.getModel();if(!s)return;const a=r.getLanguageConfiguration(s.getLanguageId()).foldingRules;if(a&&a.markers&&a.markers.start){const l=new RegExp(a.markers.start);_Y(t,l,!0)}}}}class ZCt extends $s{constructor(){super({id:"editor.unfoldAllMarkerRegions",label:C("unfoldAllMarkerRegions.label","Unfold All Regions"),alias:"Unfold All Regions",precondition:ks,kbOpts:{kbExpr:Q.editorTextFocus,primary:Zo(2089,2078),weight:100}})}invoke(e,t,n,o,r){if(t.regions.hasTypes())bY(t,oa.Region.value,!1);else{const s=n.getModel();if(!s)return;const a=r.getLanguageConfiguration(s.getLanguageId()).foldingRules;if(a&&a.markers&&a.markers.start){const l=new RegExp(a.markers.start);_Y(t,l,!1)}}}}class QCt extends $s{constructor(){super({id:"editor.foldAllExcept",label:C("foldAllExcept.label","Fold All Except Selected"),alias:"Fold All Except Selected",precondition:ks,kbOpts:{kbExpr:Q.editorTextFocus,primary:Zo(2089,2136),weight:100}})}invoke(e,t,n){const o=this.getSelectedLines(n);Gye(t,!0,o)}}class JCt extends $s{constructor(){super({id:"editor.unfoldAllExcept",label:C("unfoldAllExcept.label","Unfold All Except Selected"),alias:"Unfold All Except Selected",precondition:ks,kbOpts:{kbExpr:Q.editorTextFocus,primary:Zo(2089,2134),weight:100}})}invoke(e,t,n){const o=this.getSelectedLines(n);Gye(t,!1,o)}}class ewt extends $s{constructor(){super({id:"editor.foldAll",label:C("foldAllAction.label","Fold All"),alias:"Fold All",precondition:ks,kbOpts:{kbExpr:Q.editorTextFocus,primary:Zo(2089,2069),weight:100}})}invoke(e,t,n){IS(t,!0)}}class twt extends $s{constructor(){super({id:"editor.unfoldAll",label:C("unfoldAllAction.label","Unfold All"),alias:"Unfold All",precondition:ks,kbOpts:{kbExpr:Q.editorTextFocus,primary:Zo(2089,2088),weight:100}})}invoke(e,t,n){IS(t,!1)}}class _b extends $s{getFoldingLevel(){return parseInt(this.id.substr(_b.ID_PREFIX.length))}invoke(e,t,n){LCt(t,this.getFoldingLevel(),!0,this.getSelectedLines(n))}}_b.ID_PREFIX="editor.foldLevel";_b.ID=i=>_b.ID_PREFIX+i;class nwt extends $s{constructor(){super({id:"editor.gotoParentFold",label:C("gotoParentFold.label","Go to Parent Fold"),alias:"Go to Parent Fold",precondition:ks,kbOpts:{kbExpr:Q.editorTextFocus,weight:100}})}invoke(e,t,n){const o=this.getSelectedLines(n);if(o.length>0){const r=ECt(o[0],t);r!==null&&n.setSelection({startLineNumber:r,startColumn:1,endLineNumber:r,endColumn:1})}}}class iwt extends $s{constructor(){super({id:"editor.gotoPreviousFold",label:C("gotoPreviousFold.label","Go to Previous Folding Range"),alias:"Go to Previous Folding Range",precondition:ks,kbOpts:{kbExpr:Q.editorTextFocus,weight:100}})}invoke(e,t,n){const o=this.getSelectedLines(n);if(o.length>0){const r=DCt(o[0],t);r!==null&&n.setSelection({startLineNumber:r,startColumn:1,endLineNumber:r,endColumn:1})}}}class owt extends $s{constructor(){super({id:"editor.gotoNextFold",label:C("gotoNextFold.label","Go to Next Folding Range"),alias:"Go to Next Folding Range",precondition:ks,kbOpts:{kbExpr:Q.editorTextFocus,weight:100}})}invoke(e,t,n){const o=this.getSelectedLines(n);if(o.length>0){const r=kCt(o[0],t);r!==null&&n.setSelection({startLineNumber:r,startColumn:1,endLineNumber:r,endColumn:1})}}}class rwt extends $s{constructor(){super({id:"editor.createFoldingRangeFromSelection",label:C("createManualFoldRange.label","Create Folding Range from Selection"),alias:"Create Folding Range from Selection",precondition:ks,kbOpts:{kbExpr:Q.editorTextFocus,primary:Zo(2089,2135),weight:100}})}invoke(e,t,n){var o;const r=[],s=n.getSelections();if(s){for(const a of s){let l=a.endLineNumber;a.endColumn===1&&--l,l>a.startLineNumber&&(r.push({startLineNumber:a.startLineNumber,endLineNumber:l,type:void 0,isCollapsed:!0,source:1}),n.setSelection({startLineNumber:a.startLineNumber,startColumn:1,endLineNumber:a.startLineNumber,endColumn:1}))}if(r.length>0){r.sort((l,c)=>l.startLineNumber-c.startLineNumber);const a=Rl.sanitizeAndMerge(t.regions,r,(o=n.getModel())===null||o===void 0?void 0:o.getLineCount());t.updatePost(Rl.fromFoldRanges(a))}}}}class swt extends $s{constructor(){super({id:"editor.removeManualFoldingRanges",label:C("removeManualFoldingRanges.label","Remove Manual Folding Ranges"),alias:"Remove Manual Folding Ranges",precondition:ks,kbOpts:{kbExpr:Q.editorTextFocus,primary:Zo(2089,2137),weight:100}})}invoke(e,t,n){const o=n.getSelections();if(o){const r=[];for(const s of o){const{startLineNumber:a,endLineNumber:l}=s;r.push(l>=a?{startLineNumber:a,endLineNumber:l}:{endLineNumber:l,startLineNumber:a})}t.removeManualRanges(r),e.triggerFoldingModelChanged()}}}zn(Sf.ID,Sf,0);ze(UCt);ze(jCt);ze(KCt);ze(GCt);ze(ewt);ze(twt);ze(XCt);ze(YCt);ze(ZCt);ze(QCt);ze(JCt);ze(qCt);ze(nwt);ze(iwt);ze(owt);ze(rwt);ze(swt);for(let i=1;i<=7;i++)KQe(new _b({id:_b.ID(i),label:C("foldLevelAction.label","Fold Level {0}",i),alias:`Fold Level ${i}`,precondition:ks,kbOpts:{kbExpr:Q.editorTextFocus,primary:Zo(2089,2048|21+i),weight:100}}));Rn.registerCommand("_executeFoldingRangeProvider",function(i,...e){return zCt(this,void 0,void 0,function*(){const[t]=e;if(!(t instanceof Rt))throw Rc();const n=i.get(pt),o=i.get(Yi).getModel(t);if(!o)throw Rc();const r=i.get(En);if(!r.getValue("editor.folding",{resource:t}))return[];const s=i.get(Ti),a=r.getValue("editor.foldingStrategy",{resource:t}),l={get limit(){return r.getValue("editor.foldingMaximumRegions",{resource:t})},update:(f,g)=>{}},c=new CY(o,s,l);let u=c;if(a!=="indentation"){const f=Sf.getFoldingRangeProviders(n,o);f.length&&(u=new yY(o,f,()=>{},l,c))}const d=yield u.compute(_n.None),h=[];try{if(d)for(let f=0;f=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},CO=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},SY=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};let Vk=class{constructor(e,t,n){this._editor=e,this._languageFeaturesService=t,this._workerService=n,this._disposables=new Be,this._sessionDisposables=new Be,this._disposables.add(t.onTypeFormattingEditProvider.onDidChange(this._update,this)),this._disposables.add(e.onDidChangeModel(()=>this._update())),this._disposables.add(e.onDidChangeModelLanguage(()=>this._update())),this._disposables.add(e.onDidChangeConfiguration(o=>{o.hasChanged(56)&&this._update()})),this._update()}dispose(){this._disposables.dispose(),this._sessionDisposables.dispose()}_update(){if(this._sessionDisposables.clear(),!this._editor.getOption(56)||!this._editor.hasModel())return;const e=this._editor.getModel(),[t]=this._languageFeaturesService.onTypeFormattingEditProvider.ordered(e);if(!t||!t.autoFormatTriggerCharacters)return;const n=new XA;for(const o of t.autoFormatTriggerCharacters)n.add(o.charCodeAt(0));this._sessionDisposables.add(this._editor.onDidType(o=>{const r=o.charCodeAt(o.length-1);n.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(),n=this._editor.getPosition(),o=new Ro,r=this._editor.onDidChangeModelContent(s=>{if(s.isFlush){o.cancel(),r.dispose();return}for(let a=0,l=s.changes.length;a{o.token.isCancellationRequested||ws(s)&&(Fy.execute(this._editor,s,!0),jX(s))}).finally(()=>{r.dispose()})}};Vk.ID="editor.contrib.autoFormat";Vk=Jye([CO(1,pt),CO(2,Gu)],Vk);let Hk=class{constructor(e,t,n){this.editor=e,this._languageFeaturesService=t,this._instantiationService=n,this._callOnDispose=new Be,this._callOnModel=new Be,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(55)&&(!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(GCe,this.editor,e,2,qg.None,_n.None).catch(en)}};Hk.ID="editor.contrib.formatOnPaste";Hk=Jye([CO(1,pt),CO(2,$t)],Hk);class uwt extends ft{constructor(){super({id:"editor.action.formatDocument",label:C("formatDocument.label","Format Document"),alias:"Format Document",precondition:Me.and(Q.notInCompositeEditor,Q.writable,Q.hasDocumentFormattingProvider),kbOpts:{kbExpr:Q.editorTextFocus,primary:1572,linux:{primary:3111},weight:100},contextMenuOpts:{group:"1_modification",order:1.3}})}run(e,t){return SY(this,void 0,void 0,function*(){if(t.hasModel()){const n=e.get($t);yield e.get(Jv).showWhile(n.invokeFunction(ovt,t,1,qg.None,_n.None),250)}})}}class dwt extends ft{constructor(){super({id:"editor.action.formatSelection",label:C("formatSelection.label","Format Selection"),alias:"Format Selection",precondition:Me.and(Q.writable,Q.hasDocumentSelectionFormattingProvider),kbOpts:{kbExpr:Q.editorTextFocus,primary:Zo(2089,2084),weight:100},contextMenuOpts:{when:Q.hasNonEmptySelection,group:"1_modification",order:1.31}})}run(e,t){return SY(this,void 0,void 0,function*(){if(!t.hasModel())return;const n=e.get($t),o=t.getModel(),r=t.getSelections().map(a=>a.isEmpty()?new V(a.startLineNumber,1,a.startLineNumber,o.getLineMaxColumn(a.startLineNumber)):a);yield e.get(Jv).showWhile(n.invokeFunction(GCe,t,r,1,qg.None,_n.None),250)})}}zn(Vk.ID,Vk,2);zn(Hk.ID,Hk,2);ze(uwt);ze(dwt);Rn.registerCommand("editor.action.format",i=>SY(void 0,void 0,void 0,function*(){const e=i.get(Jn).getFocusedCodeEditor();if(!e||!e.hasModel())return;const t=i.get(_o);e.getSelection().isEmpty()?yield t.executeCommand("editor.action.formatDocument"):yield t.executeCommand("editor.action.formatSelection")}));var hwt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},h7=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},fwt=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};class YC{remove(){var e;(e=this.parent)===null||e===void 0||e.children.delete(this.id)}static findId(e,t){let n;typeof e=="string"?n=`${t.id}/${e}`:(n=`${t.id}/${e.name}`,t.children.get(n)!==void 0&&(n=`${t.id}/${e.name}_${e.range.startLineNumber}_${e.range.startColumn}`));let o=n;for(let r=0;t.children.get(o)!==void 0;r++)o=`${n}_${r}`;return o}static empty(e){return e.children.size===0}}class Xz extends YC{constructor(e,t,n){super(),this.id=e,this.parent=t,this.symbol=n,this.children=new Map}}class eSe extends YC{constructor(e,t,n,o){super(),this.id=e,this.parent=t,this.label=n,this.order=o,this.children=new Map}}class mg extends YC{static create(e,t,n){const o=new Ro(n),r=new mg(t.uri),s=e.ordered(t),a=s.map((c,u)=>{var d;const h=YC.findId(`provider_${u}`,r),f=new eSe(h,r,(d=c.displayName)!==null&&d!==void 0?d:"Unknown Outline Provider",u);return Promise.resolve(c.provideDocumentSymbols(t,o.token)).then(g=>{for(const p of g||[])mg._makeOutlineElement(p,f);return f},g=>($o(g),f)).then(g=>{YC.empty(g)?g.remove():r._groups.set(h,g)})}),l=e.onDidChange(()=>{const c=e.ordered(t);Lo(c,s)||o.cancel()});return Promise.all(a).then(()=>o.token.isCancellationRequested&&!n.isCancellationRequested?mg.create(e,t,n):r._compact()).finally(()=>{o.dispose(),l.dispose(),o.dispose()})}static _makeOutlineElement(e,t){const n=YC.findId(e,t),o=new Xz(n,t,e);if(e.children)for(const r of e.children)mg._makeOutlineElement(r,o);t.children.set(o.id,o)}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,n]of this._groups)n.children.size===0?this._groups.delete(t):e+=1;if(e!==1)this.children=this._groups;else{const t=mn.first(this._groups.values());for(const[,n]of t.children)n.parent=this,this.children.set(n.id,n)}return this}getTopLevelSymbols(){const e=[];for(const t of this.children.values())t instanceof Xz?e.push(t.symbol):e.push(...mn.map(t.children.values(),n=>n.symbol));return e.sort((t,n)=>V.compareRangesUsingStarts(t.range,n.range))}asListOfDocumentSymbols(){const e=this.getTopLevelSymbols(),t=[];return mg._flattenDocumentSymbols(t,e,""),t.sort((n,o)=>ae.compare(V.getStartPosition(n.range),V.getStartPosition(o.range))||ae.compare(V.getEndPosition(o.range),V.getEndPosition(n.range)))}static _flattenDocumentSymbols(e,t,n){for(const o of t)e.push({kind:o.kind,tags:o.tags,name:o.name,detail:o.detail,containerName:o.containerName||n,range:o.range,selectionRange:o.selectionRange,children:void 0}),o.children&&mg._flattenDocumentSymbols(e,o.children,o.name)}}const LF=wn("IOutlineModelService");let Yz=class{constructor(e,t,n){this._languageFeaturesService=e,this._disposables=new Be,this._cache=new Yv(10,.7),this._debounceInformation=t.for(e.documentSymbolProvider,"DocumentSymbols",{min:350}),this._disposables.add(n.onModelRemoved(o=>{this._cache.delete(o.id)}))}dispose(){this._disposables.dispose()}getOrCreate(e,t){return fwt(this,void 0,void 0,function*(){const n=this._languageFeaturesService.documentSymbolProvider,o=n.ordered(e);let r=this._cache.get(e.id);if(!r||r.versionId!==e.getVersionId()||!Lo(r.provider,o)){const a=new Ro;r={versionId:e.getVersionId(),provider:o,promiseCnt:0,source:a,promise:mg.create(n,e,a.token),model:void 0},this._cache.set(e.id,r);const l=Date.now();r.promise.then(c=>{r.model=c,this._debounceInformation.update(e,Date.now()-l)}).catch(c=>{this._cache.delete(e.id)})}if(r.model)return r.model;r.promiseCnt+=1;const s=t.onCancellationRequested(()=>{--r.promiseCnt===0&&(r.source.cancel(),this._cache.delete(e.id))});try{return yield r.promise}finally{s.dispose()}})}};Yz=hwt([h7(0,pt),h7(1,Kc),h7(2,Yi)],Yz);Mn(LF,Yz,1);var gwt=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};Rn.registerCommand("_executeDocumentSymbolProvider",function(i,...e){return gwt(this,void 0,void 0,function*(){const[t]=e;fi(Rt.isUri(t));const n=i.get(LF),r=yield i.get($a).createModelReference(t);try{return(yield n.getOrCreate(r.object.textEditorModel,_n.None)).getTopLevelSymbols()}finally{r.dispose()}})});class Dr extends _e{constructor(e,t){super(),this.contextKeyService=e,this.model=t,this.inlineCompletionVisible=Dr.inlineSuggestionVisible.bindTo(this.contextKeyService),this.inlineCompletionSuggestsIndentation=Dr.inlineSuggestionHasIndentation.bindTo(this.contextKeyService),this.inlineCompletionSuggestsIndentationLessThanTabSize=Dr.inlineSuggestionHasIndentationLessThanTabSize.bindTo(this.contextKeyService),this.suppressSuggestions=Dr.suppressSuggestions.bindTo(this.contextKeyService),this._register(Ii(n=>{const o=this.model.read(n),r=o==null?void 0:o.state.read(n),s=!!(r!=null&&r.inlineCompletion)&&(r==null?void 0:r.ghostText)!==void 0&&!(r!=null&&r.ghostText.isEmpty());this.inlineCompletionVisible.set(s),(r==null?void 0:r.ghostText)&&(r==null?void 0:r.inlineCompletion)&&this.suppressSuggestions.set(r.inlineCompletion.inlineCompletion.source.inlineCompletions.suppressSuggestions)})),this._register(Ii(n=>{const o=this.model.read(n);let r=!1,s=!0;const a=o==null?void 0:o.ghostText.read(n);if(!!(o!=null&&o.selectedSuggestItem)&&a&&a.parts.length>0){const{column:l,lines:c}=a.parts[0],u=c[0],d=o.textModel.getLineIndentColumn(a.lineNumber);if(l<=d){let f=Ws(u);f===-1&&(f=u.length-1),r=f>0;const g=o.textModel.getOptions().tabSize;s=or.visibleColumnFromColumn(u,f+1,g){const r=V.lift(o.range);return{startOffset:t.getOffset(r.getStartPosition()),endOffset:t.getOffset(r.getEndPosition()),text:o.text}});n.sort((o,r)=>r.startOffset-o.startOffset);for(const o of n)i=i.substring(0,o.startOffset)+o.text+i.substring(o.endOffset);return i}class mwt{constructor(e){this.lineStartOffsetByLineIdx=[],this.lineStartOffsetByLineIdx.push(0);for(let t=0;tt)throw new Vo(`startColumn ${e} cannot be after endColumnExclusive ${t}`)}toRange(e){return new V(e,this.startColumn,e,this.endColumnExclusive)}equals(e){return this.startColumn===e.startColumn&&this.endColumnExclusive===e.endColumnExclusive}}function Cwt(i,e){const t=new Be,n=i.createDecorationsCollection();return t.add(PX({debugName:()=>`Apply decorations from ${e.debugName}`},o=>{const r=e.read(o);n.set(r)})),t.add({dispose:()=>{n.clear()}}),t}function Zz(i,e){return new ae(i.lineNumber+e.lineNumber-1,e.lineNumber===1?i.column+e.column-1:e.column)}function Qz(i){let e=1,t=1;for(const n of i)n===` -`?(e++,t=1):t++;return new ae(e,t)}class wO{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,n)=>t.equals(e.parts[n]))}renderForScreenReader(e){if(this.parts.length===0)return"";const t=this.parts[this.parts.length-1],n=e.substr(0,t.column-1);return pwt(n,this.parts.map(r=>({range:{startLineNumber:1,endLineNumber:1,startColumn:r.column,endColumn:r.column},text:r.lines.join(` -`)}))).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 Jz{constructor(e,t,n){this.column=e,this.lines=t,this.preview=n}equals(e){return this.column===e.column&&this.lines.length===e.lines.length&&this.lines.every((t,n)=>t===e.lines[n])}}class eU{constructor(e,t,n,o=0){this.lineNumber=e,this.columnRange=t,this.newLines=n,this.additionalReservedLineCount=o,this.parts=[new Jz(this.columnRange.endColumnExclusive,this.newLines,!1)]}renderForScreenReader(e){return this.newLines.join(` -`)}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,n)=>t===e.newLines[n])&&this.additionalReservedLineCount===e.additionalReservedLineCount}}function uce(i,e){return i===e?!0:!i||!e?!1:i instanceof wO&&e instanceof wO||i instanceof eU&&e instanceof eU?i.equals(e):!1}var wwt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},ywt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const dce="ghost-text";let tU=class extends _e{constructor(e,t,n){super(),this.editor=e,this.model=t,this.languageService=n,this.isDisposed=Ai(this,!1),this.currentTextModel=$r(this.editor.onDidChangeModel,()=>this.editor.getModel()),this.uiState=In(this,o=>{if(this.isDisposed.read(o))return;const r=this.currentTextModel.read(o);if(r!==this.model.targetTextModel.read(o))return;const s=this.model.ghostText.read(o);if(!s)return;const a=s instanceof eU?s.columnRange:void 0,l=[],c=[];function u(p,v){if(c.length>0){const m=c[c.length-1];v&&m.decorations.push(new ol(m.content.length+1,m.content.length+1+p[0].length,v,0)),m.content+=p[0],p=p.slice(1)}for(const m of p)c.push({content:m,decorations:v?[new ol(1,m.length+1,v,0)]:[]})}const d=r.getLineContent(s.lineNumber);let h,f=0;for(const p of s.parts){let v=p.lines;h===void 0?(l.push({column:p.column,text:v[0],preview:p.preview}),v=v.slice(1)):u([d.substring(f,p.column-1)],void 0),v.length>0&&(u(v,dce),h===void 0&&p.column<=d.length&&(h=p.column)),f=p.column-1}h!==void 0&&u([d.substring(f)],void 0);const g=h!==void 0?new bwt(h,d.length+1):void 0;return{replacedRange:a,inlineTexts:l,additionalLines:c,hiddenRange:g,lineNumber:s.lineNumber,additionalReservedLineCount:this.model.minReservedLineCount.read(o),targetTextModel:r}}),this.decorations=In(this,o=>{const r=this.uiState.read(o);if(!r)return[];const s=[];r.replacedRange&&s.push({range:r.replacedRange.toRange(r.lineNumber),options:{inlineClassName:"inline-completion-text-to-replace",description:"GhostTextReplacement"}}),r.hiddenRange&&s.push({range:r.hiddenRange.toRange(r.lineNumber),options:{inlineClassName:"ghost-text-hidden",description:"ghost-text-hidden"}});for(const a of r.inlineTexts)s.push({range:V.fromPositions(new ae(r.lineNumber,a.column)),options:{description:dce,after:{content:a.text,inlineClassName:a.preview?"ghost-text-decoration-preview":"ghost-text-decoration",cursorStops:Nd.Left},showIfCollapsed:!0}});return s}),this.additionalLinesWidget=this._register(new Swt(this.editor,this.languageService.languageIdCodec,In(o=>{const r=this.uiState.read(o);return r?{lineNumber:r.lineNumber,additionalLines:r.additionalLines,minReservedLineCount:r.additionalReservedLineCount,targetTextModel:r.targetTextModel}:void 0}))),this._register(zt(()=>{this.isDisposed.set(!0,void 0)})),this._register(Cwt(this.editor,this.decorations))}ownsViewZone(e){return this.additionalLinesWidget.viewZoneId===e}};tU=wwt([ywt(2,Ki)],tU);class Swt extends _e{get viewZoneId(){return this._viewZoneId}constructor(e,t,n){super(),this.editor=e,this.languageIdCodec=t,this.lines=n,this._viewZoneId=void 0,this.editorOptionsChanged=Ol("editorOptionChanged",st.filter(this.editor.onDidChangeConfiguration,o=>o.hasChanged(33)||o.hasChanged(116)||o.hasChanged(98)||o.hasChanged(93)||o.hasChanged(51)||o.hasChanged(50)||o.hasChanged(66))),this._register(Ii(o=>{const r=this.lines.read(o);this.editorOptionsChanged.read(o),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,n){const o=this.editor.getModel();if(!o)return;const{tabSize:r}=o.getOptions();this.editor.changeViewZones(s=>{this._viewZoneId&&(s.removeZone(this._viewZoneId),this._viewZoneId=void 0);const a=Math.max(t.length,n);if(a>0){const l=document.createElement("div");xwt(l,r,t,this.editor.getOptions(),this.languageIdCodec),this._viewZoneId=s.addZone({afterLineNumber:e,heightInLines:a,domNode:l,afterColumnAffinity:1})}})}}function xwt(i,e,t,n,o){const r=n.get(33),s=n.get(116),a="none",l=n.get(93),c=n.get(51),u=n.get(50),d=n.get(66),h=new _S(1e4);h.appendString('

    ');for(let p=0,v=t.length;p');const w=BI(_),y=hy(_),L=gr.createEmpty(_,o);zI(new Zv(u.isMonospace&&!r,u.canUseHalfwidthRightwardsArrow,_,!1,w,y,0,L,m.decorations,e,0,u.spaceWidth,u.middotWidth,u.wsmiddotWidth,s,a,l,c!==Al.OFF,null),h),h.appendString("
    ")}h.appendString(""),rs(i,u);const f=h.build(),g=hce?hce.createHTML(f):f;i.innerHTML=g}const hce=gp("editorGhostText",{createHTML:i=>i});function Lwt(i,e){const t=new Mbe,n=new Pbe(t,c=>e.getLanguageConfiguration(c)),o=new Abe(new Ewt([i]),n),r=bH(o,[],void 0,!0);let s="";const a=i.getLineContent();function l(c,u){if(c.kind===2)l(c.openingBracket,u),u=so(u,c.openingBracket.length),c.child&&(l(c.child,u),u=so(u,c.child.length)),c.closingBracket?(l(c.closingBracket,u),u=so(u,c.closingBracket.length)):s+=n.getSingleLanguageBracketTokens(c.openingBracket.languageId).findClosingTokenText(c.openingBracket.bracketIds);else if(c.kind!==3){if(c.kind===0||c.kind===1)s+=a.substring(u,so(u,c.length));else if(c.kind===4)for(const d of c.children)l(d,u),u=so(u,d.length)}}return l(r,ra),s}class Ewt{constructor(e){this.lines=e,this.tokenization={getLineTokens:t=>this.lines[t-1]}}getLineCount(){return this.lines.length}getLineLength(e){return this.lines[e-1].getLineContent().length}}class hu{constructor(){this.value="",this.pos=0}static isDigitCharacter(e){return e>=48&&e<=57}static isVariableCharacter(e){return e===95||e>=97&&e<=122||e>=65&&e<=90}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:14,pos:this.pos,len:0};const e=this.pos;let t=0,n=this.value.charCodeAt(e),o;if(o=hu._table[n],typeof o=="number")return this.pos+=1,{type:o,pos:e,len:1};if(hu.isDigitCharacter(n)){o=8;do t+=1,n=this.value.charCodeAt(e+t);while(hu.isDigitCharacter(n));return this.pos+=t,{type:o,pos:e,len:t}}if(hu.isVariableCharacter(n)){o=9;do n=this.value.charCodeAt(e+ ++t);while(hu.isVariableCharacter(n)||hu.isDigitCharacter(n));return this.pos+=t,{type:o,pos:e,len:t}}o=10;do t+=1,n=this.value.charCodeAt(e+t);while(!isNaN(n)&&typeof hu._table[n]=="undefined"&&!hu.isDigitCharacter(n)&&!hu.isVariableCharacter(n));return this.pos+=t,{type:o,pos:e,len:t}}}hu._table={[36]:0,[58]:1,[44]:2,[123]:3,[125]:4,[92]:5,[47]:6,[124]:7,[43]:11,[45]:12,[63]:13};class TS{constructor(){this._children=[]}appendChild(e){return e instanceof ea&&this._children[this._children.length-1]instanceof ea?this._children[this._children.length-1].value+=e.value:(e.parent=this,this._children.push(e)),this}replace(e,t){const{parent:n}=e,o=n.children.indexOf(e),r=n.children.slice(0);r.splice(o,1,...t),n._children=r,function s(a,l){for(const c of a)c.parent=l,s(c.children,c)}(t,n)}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 CT)return e;e=e.parent}}toString(){return this.children.reduce((e,t)=>e+t.toString(),"")}len(){return 0}}class ea extends TS{constructor(e){super(),this.value=e}toString(){return this.value}len(){return this.value.length}clone(){return new ea(this.value)}}class tSe extends TS{}class Cc extends tSe{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 NS?this._children[0]:void 0}clone(){const e=new Cc(this.index);return this.transform&&(e.transform=this.transform.clone()),e._children=this.children.map(t=>t.clone()),e}}class NS extends TS{constructor(){super(...arguments),this.options=[]}appendChild(e){return e instanceof ea&&(e.parent=this,this.options.push(e)),this}toString(){return this.options[0].value}len(){return this.options[0].len()}clone(){const e=new NS;return this.options.forEach(e.appendChild,e),e}}class xY extends TS{constructor(){super(...arguments),this.regexp=new RegExp("")}resolve(e){const t=this;let n=!1,o=e.replace(this.regexp,function(){return n=!0,t._replace(Array.prototype.slice.call(arguments,0,-2))});return!n&&this._children.some(r=>r instanceof bd&&Boolean(r.elseValue))&&(o=this._replace([])),o}_replace(e){let t="";for(const n of this._children)if(n instanceof bd){let o=e[n.index]||"";o=n.resolve(o),t+=o}else t+=n.toString();return t}toString(){return""}clone(){const e=new xY;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 bd extends TS{constructor(e,t,n,o){super(),this.index=e,this.shorthandName=t,this.ifValue=n,this.elseValue=o}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):"":Boolean(e)&&typeof this.ifValue=="string"?this.ifValue:!Boolean(e)&&typeof this.elseValue=="string"?this.elseValue:e||""}_toPascalCase(e){const t=e.match(/[a-z0-9]+/gi);return t?t.map(n=>n.charAt(0).toUpperCase()+n.substr(1)).join(""):e}_toCamelCase(e){const t=e.match(/[a-z0-9]+/gi);return t?t.map((n,o)=>o===0?n.charAt(0).toLowerCase()+n.substr(1):n.charAt(0).toUpperCase()+n.substr(1)).join(""):e}clone(){return new bd(this.index,this.shorthandName,this.ifValue,this.elseValue)}}class $k extends tSe{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 ea(t)],!0):!1}clone(){const e=new $k(this.name);return this.transform&&(e.transform=this.transform.clone()),e._children=this.children.map(t=>t.clone()),e}}function fce(i,e){const t=[...i];for(;t.length>0;){const n=t.shift();if(!e(n))break;t.unshift(...n.children)}}class CT extends TS{get placeholderInfo(){if(!this._placeholders){const e=[];let t;this.walk(function(n){return n instanceof Cc&&(e.push(n),t=!t||t.indexo===e?(n=!0,!1):(t+=o.len(),!0)),n?t:-1}fullLen(e){let t=0;return fce([e],n=>(t+=n.len(),!0)),t}enclosingPlaceholders(e){const t=[];let{parent:n}=e;for(;n;)n instanceof Cc&&t.push(n),n=n.parent;return t}resolveVariables(e){return this.walk(t=>(t instanceof $k&&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)}clone(){const e=new CT;return this._children=this.children.map(t=>t.clone()),e}walk(e){fce(this.children,e)}}class qy{constructor(){this._scanner=new hu,this._token={type:14,pos:0,len:0}}static escape(e){return e.replace(/\$|}|\\/g,"\\$&")}static guessNeedsClipboard(e){return/\${?CLIPBOARD/.test(e)}parse(e,t,n){const o=new CT;return this.parseFragment(e,o),this.ensureFinalTabstop(o,n!=null?n:!1,t!=null?t:!1),o}parseFragment(e,t){const n=t.children.length;for(this._scanner.text(e),this._token=this._scanner.next();this._parse(t););const o=new Map,r=[];t.walk(l=>(l instanceof Cc&&(l.isFinalTabstop?o.set(0,void 0):!o.has(l.index)&&l.children.length>0?o.set(l.index,l.children):r.push(l)),!0));const s=(l,c)=>{const u=o.get(l.index);if(!u)return;const d=new Cc(l.index);d.transform=l.transform;for(const h of u){const f=h.clone();d.appendChild(f),f instanceof Cc&&o.has(f.index)&&!c.has(f.index)&&(c.add(f.index),s(f,c),c.delete(f.index))}t.replace(l,[d])},a=new Set;for(const l of r)s(l,a);return t.children.slice(n)}ensureFinalTabstop(e,t,n){(t||n&&e.placeholders.length>0)&&(e.placeholders.find(r=>r.index===0)||e.appendChild(new Cc(0)))}_accept(e,t){if(e===void 0||this._token.type===e){const n=t?this._scanner.tokenText(this._token):!0;return this._token=this._scanner.next(),n}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===14)return!1;if(this._token.type===5){const o=this._scanner.next();if(o.type!==0&&o.type!==4&&o.type!==5)return!1}this._token=this._scanner.next()}const n=this._scanner.value.substring(t.pos,this._token.pos).replace(/\\(\$|}|\\)/g,"$1");return this._token=this._scanner.next(),n}_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(5,!0))?(t=this._accept(0,!0)||this._accept(4,!0)||this._accept(5,!0)||t,e.appendChild(new ea(t)),!0):!1}_parseTabstopOrVariableName(e){let t;const n=this._token;return this._accept(0)&&(t=this._accept(9,!0)||this._accept(8,!0))?(e.appendChild(/^\d+$/.test(t)?new Cc(Number(t)):new $k(t)),!0):this._backTo(n)}_parseComplexPlaceholder(e){let t;const n=this._token;if(!(this._accept(0)&&this._accept(3)&&(t=this._accept(8,!0))))return this._backTo(n);const r=new Cc(Number(t));if(this._accept(1))for(;;){if(this._accept(4))return e.appendChild(r),!0;if(!this._parse(r))return e.appendChild(new ea("${"+t+":")),r.children.forEach(e.appendChild,e),!0}else if(r.index>0&&this._accept(7)){const s=new NS;for(;;){if(this._parseChoiceElement(s)){if(this._accept(2))continue;if(this._accept(7)&&(r.appendChild(s),this._accept(4)))return e.appendChild(r),!0}return this._backTo(n),!1}}else return this._accept(6)?this._parseTransform(r)?(e.appendChild(r),!0):(this._backTo(n),!1):this._accept(4)?(e.appendChild(r),!0):this._backTo(n)}_parseChoiceElement(e){const t=this._token,n=[];for(;!(this._token.type===2||this._token.type===7);){let o;if((o=this._accept(5,!0))?o=this._accept(2,!0)||this._accept(7,!0)||this._accept(5,!0)||o:o=this._accept(void 0,!0),!o)return this._backTo(t),!1;n.push(o)}return n.length===0?(this._backTo(t),!1):(e.appendChild(new ea(n.join(""))),!0)}_parseComplexVariable(e){let t;const n=this._token;if(!(this._accept(0)&&this._accept(3)&&(t=this._accept(9,!0))))return this._backTo(n);const r=new $k(t);if(this._accept(1))for(;;){if(this._accept(4))return e.appendChild(r),!0;if(!this._parse(r))return e.appendChild(new ea("${"+t+":")),r.children.forEach(e.appendChild,e),!0}else return this._accept(6)?this._parseTransform(r)?(e.appendChild(r),!0):(this._backTo(n),!1):this._accept(4)?(e.appendChild(r),!0):this._backTo(n)}_parseTransform(e){const t=new xY;let n="",o="";for(;!this._accept(6);){let r;if(r=this._accept(5,!0)){r=this._accept(6,!0)||r,n+=r;continue}if(this._token.type!==14){n+=this._accept(void 0,!0);continue}return!1}for(;!this._accept(6);){let r;if(r=this._accept(5,!0)){r=this._accept(5,!0)||this._accept(6,!0)||r,t.appendChild(new ea(r));continue}if(!(this._parseFormatString(t)||this._parseAnything(t)))return!1}for(;!this._accept(4);){if(this._token.type!==14){o+=this._accept(void 0,!0);continue}return!1}try{t.regexp=new RegExp(n,o)}catch{return!1}return e.transform=t,!0}_parseFormatString(e){const t=this._token;if(!this._accept(0))return!1;let n=!1;this._accept(3)&&(n=!0);const o=this._accept(8,!0);if(o)if(n){if(this._accept(4))return e.appendChild(new bd(Number(o))),!0;if(!this._accept(1))return this._backTo(t),!1}else return e.appendChild(new bd(Number(o))),!0;else return this._backTo(t),!1;if(this._accept(6)){const r=this._accept(9,!0);return!r||!this._accept(4)?(this._backTo(t),!1):(e.appendChild(new bd(Number(o),r)),!0)}else if(this._accept(11)){const r=this._until(4);if(r)return e.appendChild(new bd(Number(o),void 0,r,void 0)),!0}else if(this._accept(12)){const r=this._until(4);if(r)return e.appendChild(new bd(Number(o),void 0,void 0,r)),!0}else if(this._accept(13)){const r=this._until(1);if(r){const s=this._until(4);if(s)return e.appendChild(new bd(Number(o),void 0,r,s)),!0}}else{const r=this._until(4);if(r)return e.appendChild(new bd(Number(o),void 0,void 0,r)),!0}return this._backTo(t),!1}_parseAnything(e){return this._token.type!==14?(e.appendChild(new ea(this._scanner.tokenText(this._token))),this._accept(void 0),!0):!1}}var f7=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};function Dwt(i,e,t,n,o=_n.None,r){return f7(this,void 0,void 0,function*(){const s=Twt(e,t),a=i.all(t),l=new oG;for(const m of a)m.groupId&&l.add(m.groupId,m);function c(m){if(!m.yieldsToGroupIds)return[];const _=[];for(const w of m.yieldsToGroupIds||[]){const y=l.get(w);for(const L of y)_.push(L)}return _}const u=new Map,d=new Set;function h(m,_){if(_=[..._,m],d.has(m))return _;d.add(m);try{const w=c(m);for(const y of w){const L=h(y,_);if(L)return L}}finally{d.delete(m)}}function f(m){const _=u.get(m);if(_)return _;const w=h(m,[]);w&&$o(new Error(`Inline completions: cyclic yield-to dependency detected. Path: ${w.map(L=>L.toString?L.toString():""+L).join(" -> ")}`));const y=new t5;return u.set(m,y.p),(()=>f7(this,void 0,void 0,function*(){if(!w){const L=c(m);for(const D of L){const E=yield f(D);if(E&&E.items.length>0)return}}try{return yield m.provideInlineCompletions(t,e,n,o)}catch(L){$o(L);return}}))().then(L=>y.complete(L),L=>y.error(L)),y.p}const g=yield Promise.all(a.map(m=>f7(this,void 0,void 0,function*(){return{provider:m,completions:yield f(m)}}))),p=new Map,v=[];for(const m of g){const _=m.completions;if(!_)continue;const w=new Iwt(_,m.provider);v.push(w);for(const y of _.items){const L=yO.from(y,w,s,t,r);p.set(L.hash(),L)}}return new kwt(Array.from(p.values()),new Set(p.keys()),v)})}class kwt{constructor(e,t,n){this.completions=e,this.hashs=t,this.providerResults=n}has(e){return this.hashs.has(e.hash())}dispose(){for(const e of this.providerResults)e.removeRef()}}class Iwt{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)}}class yO{static from(e,t,n,o,r){let s,a,l=e.range?V.lift(e.range):n;if(typeof e.insertText=="string"){if(s=e.insertText,r&&e.completeBracketPairs){s=gce(s,l.getStartPosition(),o,r);const c=s.length-e.insertText.length;c!==0&&(l=new V(l.startLineNumber,l.startColumn,l.endLineNumber,l.endColumn+c))}a=void 0}else if("snippet"in e.insertText){const c=e.insertText.snippet.length;if(r&&e.completeBracketPairs){e.insertText.snippet=gce(e.insertText.snippet,l.getStartPosition(),o,r);const d=e.insertText.snippet.length-c;d!==0&&(l=new V(l.startLineNumber,l.startColumn,l.endLineNumber,l.endColumn+d))}const u=new qy().parse(e.insertText.snippet);u.children.length===1&&u.children[0]instanceof ea?(s=u.children[0].value,a=void 0):(s=u.toString(),a={snippet:e.insertText.snippet,range:l})}else Y4(e.insertText);return new yO(s,e.command,l,s,a,e.additionalTextEdits||_wt(),e,t)}constructor(e,t,n,o,r,s,a,l){this.filterText=e,this.command=t,this.range=n,this.insertText=o,this.snippetInfo=r,this.additionalTextEdits=s,this.sourceInlineCompletion=a,this.source=l,e=e.replace(/\r\n|\r/g,` + `,constraint:sSe,schema:{type:"object",properties:{levels:{type:"number"},direction:{type:"string",enum:["up","down"]},selectionLines:{type:"array",items:{type:"number"}}}}}]}})}invoke(e,t,n,o){const r=this.getLineNumbers(o,n),s=o&&o.levels,a=o&&o.direction;typeof s!="number"&&typeof a!="string"?TCt(t,!0,r):a==="up"?tSe(t,!0,s||1,r):TS(t,!0,s||1,r)}}class JCt extends $s{constructor(){super({id:"editor.toggleFold",label:C("toggleFoldAction.label","Toggle Fold"),alias:"Toggle Fold",precondition:Is,kbOpts:{kbExpr:Q.editorTextFocus,primary:Zo(2089,2090),weight:100}})}invoke(e,t,n){const o=this.getSelectedLines(n);eSe(t,1,o)}}class eyt extends $s{constructor(){super({id:"editor.foldRecursively",label:C("foldRecursivelyAction.label","Fold Recursively"),alias:"Fold Recursively",precondition:Is,kbOpts:{kbExpr:Q.editorTextFocus,primary:Zo(2089,2140),weight:100}})}invoke(e,t,n){const o=this.getSelectedLines(n);TS(t,!0,Number.MAX_VALUE,o)}}class tyt extends $s{constructor(){super({id:"editor.foldAllBlockComments",label:C("foldAllBlockComments.label","Fold All Block Comments"),alias:"Fold All Block Comments",precondition:Is,kbOpts:{kbExpr:Q.editorTextFocus,primary:Zo(2089,2138),weight:100}})}invoke(e,t,n,o,r){if(t.regions.hasTypes())EY(t,ra.Comment.value,!0);else{const s=n.getModel();if(!s)return;const a=r.getLanguageConfiguration(s.getLanguageId()).comments;if(a&&a.blockCommentStartToken){const l=new RegExp("^\\s*"+Xl(a.blockCommentStartToken));LY(t,l,!0)}}}}class nyt extends $s{constructor(){super({id:"editor.foldAllMarkerRegions",label:C("foldAllMarkerRegions.label","Fold All Regions"),alias:"Fold All Regions",precondition:Is,kbOpts:{kbExpr:Q.editorTextFocus,primary:Zo(2089,2077),weight:100}})}invoke(e,t,n,o,r){if(t.regions.hasTypes())EY(t,ra.Region.value,!0);else{const s=n.getModel();if(!s)return;const a=r.getLanguageConfiguration(s.getLanguageId()).foldingRules;if(a&&a.markers&&a.markers.start){const l=new RegExp(a.markers.start);LY(t,l,!0)}}}}class iyt extends $s{constructor(){super({id:"editor.unfoldAllMarkerRegions",label:C("unfoldAllMarkerRegions.label","Unfold All Regions"),alias:"Unfold All Regions",precondition:Is,kbOpts:{kbExpr:Q.editorTextFocus,primary:Zo(2089,2078),weight:100}})}invoke(e,t,n,o,r){if(t.regions.hasTypes())EY(t,ra.Region.value,!1);else{const s=n.getModel();if(!s)return;const a=r.getLanguageConfiguration(s.getLanguageId()).foldingRules;if(a&&a.markers&&a.markers.start){const l=new RegExp(a.markers.start);LY(t,l,!1)}}}}class oyt extends $s{constructor(){super({id:"editor.foldAllExcept",label:C("foldAllExcept.label","Fold All Except Selected"),alias:"Fold All Except Selected",precondition:Is,kbOpts:{kbExpr:Q.editorTextFocus,primary:Zo(2089,2136),weight:100}})}invoke(e,t,n){const o=this.getSelectedLines(n);nSe(t,!0,o)}}class ryt extends $s{constructor(){super({id:"editor.unfoldAllExcept",label:C("unfoldAllExcept.label","Unfold All Except Selected"),alias:"Unfold All Except Selected",precondition:Is,kbOpts:{kbExpr:Q.editorTextFocus,primary:Zo(2089,2134),weight:100}})}invoke(e,t,n){const o=this.getSelectedLines(n);nSe(t,!1,o)}}class syt extends $s{constructor(){super({id:"editor.foldAll",label:C("foldAllAction.label","Fold All"),alias:"Fold All",precondition:Is,kbOpts:{kbExpr:Q.editorTextFocus,primary:Zo(2089,2069),weight:100}})}invoke(e,t,n){TS(t,!0)}}class ayt extends $s{constructor(){super({id:"editor.unfoldAll",label:C("unfoldAllAction.label","Unfold All"),alias:"Unfold All",precondition:Is,kbOpts:{kbExpr:Q.editorTextFocus,primary:Zo(2089,2088),weight:100}})}invoke(e,t,n){TS(t,!1)}}class bb extends $s{getFoldingLevel(){return parseInt(this.id.substr(bb.ID_PREFIX.length))}invoke(e,t,n){NCt(t,this.getFoldingLevel(),!0,this.getSelectedLines(n))}}bb.ID_PREFIX="editor.foldLevel";bb.ID=i=>bb.ID_PREFIX+i;class lyt extends $s{constructor(){super({id:"editor.gotoParentFold",label:C("gotoParentFold.label","Go to Parent Fold"),alias:"Go to Parent Fold",precondition:Is,kbOpts:{kbExpr:Q.editorTextFocus,weight:100}})}invoke(e,t,n){const o=this.getSelectedLines(n);if(o.length>0){const r=RCt(o[0],t);r!==null&&n.setSelection({startLineNumber:r,startColumn:1,endLineNumber:r,endColumn:1})}}}class cyt extends $s{constructor(){super({id:"editor.gotoPreviousFold",label:C("gotoPreviousFold.label","Go to Previous Folding Range"),alias:"Go to Previous Folding Range",precondition:Is,kbOpts:{kbExpr:Q.editorTextFocus,weight:100}})}invoke(e,t,n){const o=this.getSelectedLines(n);if(o.length>0){const r=MCt(o[0],t);r!==null&&n.setSelection({startLineNumber:r,startColumn:1,endLineNumber:r,endColumn:1})}}}class uyt extends $s{constructor(){super({id:"editor.gotoNextFold",label:C("gotoNextFold.label","Go to Next Folding Range"),alias:"Go to Next Folding Range",precondition:Is,kbOpts:{kbExpr:Q.editorTextFocus,weight:100}})}invoke(e,t,n){const o=this.getSelectedLines(n);if(o.length>0){const r=ACt(o[0],t);r!==null&&n.setSelection({startLineNumber:r,startColumn:1,endLineNumber:r,endColumn:1})}}}class dyt extends $s{constructor(){super({id:"editor.createFoldingRangeFromSelection",label:C("createManualFoldRange.label","Create Folding Range from Selection"),alias:"Create Folding Range from Selection",precondition:Is,kbOpts:{kbExpr:Q.editorTextFocus,primary:Zo(2089,2135),weight:100}})}invoke(e,t,n){var o;const r=[],s=n.getSelections();if(s){for(const a of s){let l=a.endLineNumber;a.endColumn===1&&--l,l>a.startLineNumber&&(r.push({startLineNumber:a.startLineNumber,endLineNumber:l,type:void 0,isCollapsed:!0,source:1}),n.setSelection({startLineNumber:a.startLineNumber,startColumn:1,endLineNumber:a.startLineNumber,endColumn:1}))}if(r.length>0){r.sort((l,c)=>l.startLineNumber-c.startLineNumber);const a=Ml.sanitizeAndMerge(t.regions,r,(o=n.getModel())===null||o===void 0?void 0:o.getLineCount());t.updatePost(Ml.fromFoldRanges(a))}}}}class hyt extends $s{constructor(){super({id:"editor.removeManualFoldingRanges",label:C("removeManualFoldingRanges.label","Remove Manual Folding Ranges"),alias:"Remove Manual Folding Ranges",precondition:Is,kbOpts:{kbExpr:Q.editorTextFocus,primary:Zo(2089,2137),weight:100}})}invoke(e,t,n){const o=n.getSelections();if(o){const r=[];for(const s of o){const{startLineNumber:a,endLineNumber:l}=s;r.push(l>=a?{startLineNumber:a,endLineNumber:l}:{endLineNumber:l,startLineNumber:a})}t.removeManualRanges(r),e.triggerFoldingModelChanged()}}}zn(xf.ID,xf,0);ze(YCt);ze(ZCt);ze(QCt);ze(eyt);ze(syt);ze(ayt);ze(tyt);ze(nyt);ze(iyt);ze(oyt);ze(ryt);ze(JCt);ze(lyt);ze(cyt);ze(uyt);ze(dyt);ze(hyt);for(let i=1;i<=7;i++)QQe(new bb({id:bb.ID(i),label:C("foldLevelAction.label","Fold Level {0}",i),alias:`Fold Level ${i}`,precondition:Is,kbOpts:{kbExpr:Q.editorTextFocus,primary:Zo(2089,2048|21+i),weight:100}}));Rn.registerCommand("_executeFoldingRangeProvider",function(i,...e){return XCt(this,void 0,void 0,function*(){const[t]=e;if(!(t instanceof Rt))throw Mc();const n=i.get(pt),o=i.get(Yi).getModel(t);if(!o)throw Mc();const r=i.get(En);if(!r.getValue("editor.folding",{resource:t}))return[];const s=i.get(Ti),a=r.getValue("editor.foldingStrategy",{resource:t}),l={get limit(){return r.getValue("editor.foldingMaximumRegions",{resource:t})},update:(f,g)=>{}},c=new DY(o,s,l);let u=c;if(a!=="indentation"){const f=xf.getFoldingRangeProviders(n,o);f.length&&(u=new IY(o,f,()=>{},l,c))}const d=yield u.compute(_n.None),h=[];try{if(d)for(let f=0;f=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},SO=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},TY=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};let Vk=class{constructor(e,t,n){this._editor=e,this._languageFeaturesService=t,this._workerService=n,this._disposables=new Be,this._sessionDisposables=new Be,this._disposables.add(t.onTypeFormattingEditProvider.onDidChange(this._update,this)),this._disposables.add(e.onDidChangeModel(()=>this._update())),this._disposables.add(e.onDidChangeModelLanguage(()=>this._update())),this._disposables.add(e.onDidChangeConfiguration(o=>{o.hasChanged(56)&&this._update()})),this._update()}dispose(){this._disposables.dispose(),this._sessionDisposables.dispose()}_update(){if(this._sessionDisposables.clear(),!this._editor.getOption(56)||!this._editor.hasModel())return;const e=this._editor.getModel(),[t]=this._languageFeaturesService.onTypeFormattingEditProvider.ordered(e);if(!t||!t.autoFormatTriggerCharacters)return;const n=new QA;for(const o of t.autoFormatTriggerCharacters)n.add(o.charCodeAt(0));this._sessionDisposables.add(this._editor.onDidType(o=>{const r=o.charCodeAt(o.length-1);n.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(),n=this._editor.getPosition(),o=new Ro,r=this._editor.onDidChangeModelContent(s=>{if(s.isFlush){o.cancel(),r.dispose();return}for(let a=0,l=s.changes.length;a{o.token.isCancellationRequested||ws(s)&&(Bw.execute(this._editor,s,!0),QX(s))}).finally(()=>{r.dispose()})}};Vk.ID="editor.contrib.autoFormat";Vk=aSe([SO(1,pt),SO(2,Xu)],Vk);let Hk=class{constructor(e,t,n){this.editor=e,this._languageFeaturesService=t,this._instantiationService=n,this._callOnDispose=new Be,this._callOnModel=new Be,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(55)&&(!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(nye,this.editor,e,2,Gg.None,_n.None).catch(en)}};Hk.ID="editor.contrib.formatOnPaste";Hk=aSe([SO(1,pt),SO(2,$t)],Hk);class myt extends ft{constructor(){super({id:"editor.action.formatDocument",label:C("formatDocument.label","Format Document"),alias:"Format Document",precondition:Me.and(Q.notInCompositeEditor,Q.writable,Q.hasDocumentFormattingProvider),kbOpts:{kbExpr:Q.editorTextFocus,primary:1572,linux:{primary:3111},weight:100},contextMenuOpts:{group:"1_modification",order:1.3}})}run(e,t){return TY(this,void 0,void 0,function*(){if(t.hasModel()){const n=e.get($t);yield e.get(Jv).showWhile(n.invokeFunction(uvt,t,1,Gg.None,_n.None),250)}})}}class vyt extends ft{constructor(){super({id:"editor.action.formatSelection",label:C("formatSelection.label","Format Selection"),alias:"Format Selection",precondition:Me.and(Q.writable,Q.hasDocumentSelectionFormattingProvider),kbOpts:{kbExpr:Q.editorTextFocus,primary:Zo(2089,2084),weight:100},contextMenuOpts:{when:Q.hasNonEmptySelection,group:"1_modification",order:1.31}})}run(e,t){return TY(this,void 0,void 0,function*(){if(!t.hasModel())return;const n=e.get($t),o=t.getModel(),r=t.getSelections().map(a=>a.isEmpty()?new V(a.startLineNumber,1,a.startLineNumber,o.getLineMaxColumn(a.startLineNumber)):a);yield e.get(Jv).showWhile(n.invokeFunction(nye,t,r,1,Gg.None,_n.None),250)})}}zn(Vk.ID,Vk,2);zn(Hk.ID,Hk,2);ze(myt);ze(vyt);Rn.registerCommand("editor.action.format",i=>TY(void 0,void 0,void 0,function*(){const e=i.get(Jn).getFocusedCodeEditor();if(!e||!e.hasModel())return;const t=i.get(_o);e.getSelection().isEmpty()?yield t.executeCommand("editor.action.formatDocument"):yield t.executeCommand("editor.action.formatSelection")}));var _yt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},h7=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},byt=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};class YC{remove(){var e;(e=this.parent)===null||e===void 0||e.children.delete(this.id)}static findId(e,t){let n;typeof e=="string"?n=`${t.id}/${e}`:(n=`${t.id}/${e.name}`,t.children.get(n)!==void 0&&(n=`${t.id}/${e.name}_${e.range.startLineNumber}_${e.range.startColumn}`));let o=n;for(let r=0;t.children.get(o)!==void 0;r++)o=`${n}_${r}`;return o}static empty(e){return e.children.size===0}}class Jz extends YC{constructor(e,t,n){super(),this.id=e,this.parent=t,this.symbol=n,this.children=new Map}}class lSe extends YC{constructor(e,t,n,o){super(),this.id=e,this.parent=t,this.label=n,this.order=o,this.children=new Map}}class vg extends YC{static create(e,t,n){const o=new Ro(n),r=new vg(t.uri),s=e.ordered(t),a=s.map((c,u)=>{var d;const h=YC.findId(`provider_${u}`,r),f=new lSe(h,r,(d=c.displayName)!==null&&d!==void 0?d:"Unknown Outline Provider",u);return Promise.resolve(c.provideDocumentSymbols(t,o.token)).then(g=>{for(const p of g||[])vg._makeOutlineElement(p,f);return f},g=>($o(g),f)).then(g=>{YC.empty(g)?g.remove():r._groups.set(h,g)})}),l=e.onDidChange(()=>{const c=e.ordered(t);Lo(c,s)||o.cancel()});return Promise.all(a).then(()=>o.token.isCancellationRequested&&!n.isCancellationRequested?vg.create(e,t,n):r._compact()).finally(()=>{o.dispose(),l.dispose(),o.dispose()})}static _makeOutlineElement(e,t){const n=YC.findId(e,t),o=new Jz(n,t,e);if(e.children)for(const r of e.children)vg._makeOutlineElement(r,o);t.children.set(o.id,o)}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,n]of this._groups)n.children.size===0?this._groups.delete(t):e+=1;if(e!==1)this.children=this._groups;else{const t=vn.first(this._groups.values());for(const[,n]of t.children)n.parent=this,this.children.set(n.id,n)}return this}getTopLevelSymbols(){const e=[];for(const t of this.children.values())t instanceof Jz?e.push(t.symbol):e.push(...vn.map(t.children.values(),n=>n.symbol));return e.sort((t,n)=>V.compareRangesUsingStarts(t.range,n.range))}asListOfDocumentSymbols(){const e=this.getTopLevelSymbols(),t=[];return vg._flattenDocumentSymbols(t,e,""),t.sort((n,o)=>ae.compare(V.getStartPosition(n.range),V.getStartPosition(o.range))||ae.compare(V.getEndPosition(o.range),V.getEndPosition(n.range)))}static _flattenDocumentSymbols(e,t,n){for(const o of t)e.push({kind:o.kind,tags:o.tags,name:o.name,detail:o.detail,containerName:o.containerName||n,range:o.range,selectionRange:o.selectionRange,children:void 0}),o.children&&vg._flattenDocumentSymbols(e,o.children,o.name)}}const EF=yn("IOutlineModelService");let eU=class{constructor(e,t,n){this._languageFeaturesService=e,this._disposables=new Be,this._cache=new Yv(10,.7),this._debounceInformation=t.for(e.documentSymbolProvider,"DocumentSymbols",{min:350}),this._disposables.add(n.onModelRemoved(o=>{this._cache.delete(o.id)}))}dispose(){this._disposables.dispose()}getOrCreate(e,t){return byt(this,void 0,void 0,function*(){const n=this._languageFeaturesService.documentSymbolProvider,o=n.ordered(e);let r=this._cache.get(e.id);if(!r||r.versionId!==e.getVersionId()||!Lo(r.provider,o)){const a=new Ro;r={versionId:e.getVersionId(),provider:o,promiseCnt:0,source:a,promise:vg.create(n,e,a.token),model:void 0},this._cache.set(e.id,r);const l=Date.now();r.promise.then(c=>{r.model=c,this._debounceInformation.update(e,Date.now()-l)}).catch(c=>{this._cache.delete(e.id)})}if(r.model)return r.model;r.promiseCnt+=1;const s=t.onCancellationRequested(()=>{--r.promiseCnt===0&&(r.source.cancel(),this._cache.delete(e.id))});try{return yield r.promise}finally{s.dispose()}})}};eU=_yt([h7(0,pt),h7(1,qc),h7(2,Yi)],eU);Mn(EF,eU,1);var Cyt=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};Rn.registerCommand("_executeDocumentSymbolProvider",function(i,...e){return Cyt(this,void 0,void 0,function*(){const[t]=e;fi(Rt.isUri(t));const n=i.get(EF),r=yield i.get(za).createModelReference(t);try{return(yield n.getOrCreate(r.object.textEditorModel,_n.None)).getTopLevelSymbols()}finally{r.dispose()}})});class Dr extends _e{constructor(e,t){super(),this.contextKeyService=e,this.model=t,this.inlineCompletionVisible=Dr.inlineSuggestionVisible.bindTo(this.contextKeyService),this.inlineCompletionSuggestsIndentation=Dr.inlineSuggestionHasIndentation.bindTo(this.contextKeyService),this.inlineCompletionSuggestsIndentationLessThanTabSize=Dr.inlineSuggestionHasIndentationLessThanTabSize.bindTo(this.contextKeyService),this.suppressSuggestions=Dr.suppressSuggestions.bindTo(this.contextKeyService),this._register(Ii(n=>{const o=this.model.read(n),r=o==null?void 0:o.state.read(n),s=!!(r!=null&&r.inlineCompletion)&&(r==null?void 0:r.ghostText)!==void 0&&!(r!=null&&r.ghostText.isEmpty());this.inlineCompletionVisible.set(s),(r==null?void 0:r.ghostText)&&(r==null?void 0:r.inlineCompletion)&&this.suppressSuggestions.set(r.inlineCompletion.inlineCompletion.source.inlineCompletions.suppressSuggestions)})),this._register(Ii(n=>{const o=this.model.read(n);let r=!1,s=!0;const a=o==null?void 0:o.ghostText.read(n);if(!!(o!=null&&o.selectedSuggestItem)&&a&&a.parts.length>0){const{column:l,lines:c}=a.parts[0],u=c[0],d=o.textModel.getLineIndentColumn(a.lineNumber);if(l<=d){let f=Ws(u);f===-1&&(f=u.length-1),r=f>0;const g=o.textModel.getOptions().tabSize;s=or.visibleColumnFromColumn(u,f+1,g){const r=V.lift(o.range);return{startOffset:t.getOffset(r.getStartPosition()),endOffset:t.getOffset(r.getEndPosition()),text:o.text}});n.sort((o,r)=>r.startOffset-o.startOffset);for(const o of n)i=i.substring(0,o.startOffset)+o.text+i.substring(o.endOffset);return i}class wyt{constructor(e){this.lineStartOffsetByLineIdx=[],this.lineStartOffsetByLineIdx.push(0);for(let t=0;tt)throw new Vo(`startColumn ${e} cannot be after endColumnExclusive ${t}`)}toRange(e){return new V(e,this.startColumn,e,this.endColumnExclusive)}equals(e){return this.startColumn===e.startColumn&&this.endColumnExclusive===e.endColumnExclusive}}function Eyt(i,e){const t=new Be,n=i.createDecorationsCollection();return t.add($X({debugName:()=>`Apply decorations from ${e.debugName}`},o=>{const r=e.read(o);n.set(r)})),t.add({dispose:()=>{n.clear()}}),t}function tU(i,e){return new ae(i.lineNumber+e.lineNumber-1,e.lineNumber===1?i.column+e.column-1:e.column)}function nU(i){let e=1,t=1;for(const n of i)n===` +`?(e++,t=1):t++;return new ae(e,t)}class xO{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,n)=>t.equals(e.parts[n]))}renderForScreenReader(e){if(this.parts.length===0)return"";const t=this.parts[this.parts.length-1],n=e.substr(0,t.column-1);return yyt(n,this.parts.map(r=>({range:{startLineNumber:1,endLineNumber:1,startColumn:r.column,endColumn:r.column},text:r.lines.join(` +`)}))).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 iU{constructor(e,t,n){this.column=e,this.lines=t,this.preview=n}equals(e){return this.column===e.column&&this.lines.length===e.lines.length&&this.lines.every((t,n)=>t===e.lines[n])}}class oU{constructor(e,t,n,o=0){this.lineNumber=e,this.columnRange=t,this.newLines=n,this.additionalReservedLineCount=o,this.parts=[new iU(this.columnRange.endColumnExclusive,this.newLines,!1)]}renderForScreenReader(e){return this.newLines.join(` +`)}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,n)=>t===e.newLines[n])&&this.additionalReservedLineCount===e.additionalReservedLineCount}}function _ce(i,e){return i===e?!0:!i||!e?!1:i instanceof xO&&e instanceof xO||i instanceof oU&&e instanceof oU?i.equals(e):!1}var Dyt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},kyt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const bce="ghost-text";let rU=class extends _e{constructor(e,t,n){super(),this.editor=e,this.model=t,this.languageService=n,this.isDisposed=Ai(this,!1),this.currentTextModel=$r(this.editor.onDidChangeModel,()=>this.editor.getModel()),this.uiState=In(this,o=>{if(this.isDisposed.read(o))return;const r=this.currentTextModel.read(o);if(r!==this.model.targetTextModel.read(o))return;const s=this.model.ghostText.read(o);if(!s)return;const a=s instanceof oU?s.columnRange:void 0,l=[],c=[];function u(p,v){if(c.length>0){const m=c[c.length-1];v&&m.decorations.push(new rl(m.content.length+1,m.content.length+1+p[0].length,v,0)),m.content+=p[0],p=p.slice(1)}for(const m of p)c.push({content:m,decorations:v?[new rl(1,m.length+1,v,0)]:[]})}const d=r.getLineContent(s.lineNumber);let h,f=0;for(const p of s.parts){let v=p.lines;h===void 0?(l.push({column:p.column,text:v[0],preview:p.preview}),v=v.slice(1)):u([d.substring(f,p.column-1)],void 0),v.length>0&&(u(v,bce),h===void 0&&p.column<=d.length&&(h=p.column)),f=p.column-1}h!==void 0&&u([d.substring(f)],void 0);const g=h!==void 0?new Lyt(h,d.length+1):void 0;return{replacedRange:a,inlineTexts:l,additionalLines:c,hiddenRange:g,lineNumber:s.lineNumber,additionalReservedLineCount:this.model.minReservedLineCount.read(o),targetTextModel:r}}),this.decorations=In(this,o=>{const r=this.uiState.read(o);if(!r)return[];const s=[];r.replacedRange&&s.push({range:r.replacedRange.toRange(r.lineNumber),options:{inlineClassName:"inline-completion-text-to-replace",description:"GhostTextReplacement"}}),r.hiddenRange&&s.push({range:r.hiddenRange.toRange(r.lineNumber),options:{inlineClassName:"ghost-text-hidden",description:"ghost-text-hidden"}});for(const a of r.inlineTexts)s.push({range:V.fromPositions(new ae(r.lineNumber,a.column)),options:{description:bce,after:{content:a.text,inlineClassName:a.preview?"ghost-text-decoration-preview":"ghost-text-decoration",cursorStops:Nd.Left},showIfCollapsed:!0}});return s}),this.additionalLinesWidget=this._register(new Iyt(this.editor,this.languageService.languageIdCodec,In(o=>{const r=this.uiState.read(o);return r?{lineNumber:r.lineNumber,additionalLines:r.additionalLines,minReservedLineCount:r.additionalReservedLineCount,targetTextModel:r.targetTextModel}:void 0}))),this._register(zt(()=>{this.isDisposed.set(!0,void 0)})),this._register(Eyt(this.editor,this.decorations))}ownsViewZone(e){return this.additionalLinesWidget.viewZoneId===e}};rU=Dyt([kyt(2,Ki)],rU);class Iyt extends _e{get viewZoneId(){return this._viewZoneId}constructor(e,t,n){super(),this.editor=e,this.languageIdCodec=t,this.lines=n,this._viewZoneId=void 0,this.editorOptionsChanged=Fl("editorOptionChanged",st.filter(this.editor.onDidChangeConfiguration,o=>o.hasChanged(33)||o.hasChanged(116)||o.hasChanged(98)||o.hasChanged(93)||o.hasChanged(51)||o.hasChanged(50)||o.hasChanged(66))),this._register(Ii(o=>{const r=this.lines.read(o);this.editorOptionsChanged.read(o),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,n){const o=this.editor.getModel();if(!o)return;const{tabSize:r}=o.getOptions();this.editor.changeViewZones(s=>{this._viewZoneId&&(s.removeZone(this._viewZoneId),this._viewZoneId=void 0);const a=Math.max(t.length,n);if(a>0){const l=document.createElement("div");Tyt(l,r,t,this.editor.getOptions(),this.languageIdCodec),this._viewZoneId=s.addZone({afterLineNumber:e,heightInLines:a,domNode:l,afterColumnAffinity:1})}})}}function Tyt(i,e,t,n,o){const r=n.get(33),s=n.get(116),a="none",l=n.get(93),c=n.get(51),u=n.get(50),d=n.get(66),h=new bS(1e4);h.appendString('
    ');for(let p=0,v=t.length;p');const y=VI(_),w=fw(_),L=pr.createEmpty(_,o);jI(new Zv(u.isMonospace&&!r,u.canUseHalfwidthRightwardsArrow,_,!1,y,w,0,L,m.decorations,e,0,u.spaceWidth,u.middotWidth,u.wsmiddotWidth,s,a,l,c!==Pl.OFF,null),h),h.appendString("
    ")}h.appendString(""),ss(i,u);const f=h.build(),g=Cce?Cce.createHTML(f):f;i.innerHTML=g}const Cce=mp("editorGhostText",{createHTML:i=>i});function Nyt(i,e){const t=new Hbe,n=new zbe(t,c=>e.getLanguageConfiguration(c)),o=new $be(new Ryt([i]),n),r=SH(o,[],void 0,!0);let s="";const a=i.getLineContent();function l(c,u){if(c.kind===2)l(c.openingBracket,u),u=so(u,c.openingBracket.length),c.child&&(l(c.child,u),u=so(u,c.child.length)),c.closingBracket?(l(c.closingBracket,u),u=so(u,c.closingBracket.length)):s+=n.getSingleLanguageBracketTokens(c.openingBracket.languageId).findClosingTokenText(c.openingBracket.bracketIds);else if(c.kind!==3){if(c.kind===0||c.kind===1)s+=a.substring(u,so(u,c.length));else if(c.kind===4)for(const d of c.children)l(d,u),u=so(u,d.length)}}return l(r,sa),s}class Ryt{constructor(e){this.lines=e,this.tokenization={getLineTokens:t=>this.lines[t-1]}}getLineCount(){return this.lines.length}getLineLength(e){return this.lines[e-1].getLineContent().length}}class fu{constructor(){this.value="",this.pos=0}static isDigitCharacter(e){return e>=48&&e<=57}static isVariableCharacter(e){return e===95||e>=97&&e<=122||e>=65&&e<=90}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:14,pos:this.pos,len:0};const e=this.pos;let t=0,n=this.value.charCodeAt(e),o;if(o=fu._table[n],typeof o=="number")return this.pos+=1,{type:o,pos:e,len:1};if(fu.isDigitCharacter(n)){o=8;do t+=1,n=this.value.charCodeAt(e+t);while(fu.isDigitCharacter(n));return this.pos+=t,{type:o,pos:e,len:t}}if(fu.isVariableCharacter(n)){o=9;do n=this.value.charCodeAt(e+ ++t);while(fu.isVariableCharacter(n)||fu.isDigitCharacter(n));return this.pos+=t,{type:o,pos:e,len:t}}o=10;do t+=1,n=this.value.charCodeAt(e+t);while(!isNaN(n)&&typeof fu._table[n]=="undefined"&&!fu.isDigitCharacter(n)&&!fu.isVariableCharacter(n));return this.pos+=t,{type:o,pos:e,len:t}}}fu._table={[36]:0,[58]:1,[44]:2,[123]:3,[125]:4,[92]:5,[47]:6,[124]:7,[43]:11,[45]:12,[63]:13};class NS{constructor(){this._children=[]}appendChild(e){return e instanceof ta&&this._children[this._children.length-1]instanceof ta?this._children[this._children.length-1].value+=e.value:(e.parent=this,this._children.push(e)),this}replace(e,t){const{parent:n}=e,o=n.children.indexOf(e),r=n.children.slice(0);r.splice(o,1,...t),n._children=r,function s(a,l){for(const c of a)c.parent=l,s(c.children,c)}(t,n)}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 wT)return e;e=e.parent}}toString(){return this.children.reduce((e,t)=>e+t.toString(),"")}len(){return 0}}class ta extends NS{constructor(e){super(),this.value=e}toString(){return this.value}len(){return this.value.length}clone(){return new ta(this.value)}}class cSe extends NS{}class yc extends cSe{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 RS?this._children[0]:void 0}clone(){const e=new yc(this.index);return this.transform&&(e.transform=this.transform.clone()),e._children=this.children.map(t=>t.clone()),e}}class RS extends NS{constructor(){super(...arguments),this.options=[]}appendChild(e){return e instanceof ta&&(e.parent=this,this.options.push(e)),this}toString(){return this.options[0].value}len(){return this.options[0].len()}clone(){const e=new RS;return this.options.forEach(e.appendChild,e),e}}class NY extends NS{constructor(){super(...arguments),this.regexp=new RegExp("")}resolve(e){const t=this;let n=!1,o=e.replace(this.regexp,function(){return n=!0,t._replace(Array.prototype.slice.call(arguments,0,-2))});return!n&&this._children.some(r=>r instanceof Cd&&Boolean(r.elseValue))&&(o=this._replace([])),o}_replace(e){let t="";for(const n of this._children)if(n instanceof Cd){let o=e[n.index]||"";o=n.resolve(o),t+=o}else t+=n.toString();return t}toString(){return""}clone(){const e=new NY;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 Cd extends NS{constructor(e,t,n,o){super(),this.index=e,this.shorthandName=t,this.ifValue=n,this.elseValue=o}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):"":Boolean(e)&&typeof this.ifValue=="string"?this.ifValue:!Boolean(e)&&typeof this.elseValue=="string"?this.elseValue:e||""}_toPascalCase(e){const t=e.match(/[a-z0-9]+/gi);return t?t.map(n=>n.charAt(0).toUpperCase()+n.substr(1)).join(""):e}_toCamelCase(e){const t=e.match(/[a-z0-9]+/gi);return t?t.map((n,o)=>o===0?n.charAt(0).toLowerCase()+n.substr(1):n.charAt(0).toUpperCase()+n.substr(1)).join(""):e}clone(){return new Cd(this.index,this.shorthandName,this.ifValue,this.elseValue)}}class $k extends cSe{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 ta(t)],!0):!1}clone(){const e=new $k(this.name);return this.transform&&(e.transform=this.transform.clone()),e._children=this.children.map(t=>t.clone()),e}}function yce(i,e){const t=[...i];for(;t.length>0;){const n=t.shift();if(!e(n))break;t.unshift(...n.children)}}class wT extends NS{get placeholderInfo(){if(!this._placeholders){const e=[];let t;this.walk(function(n){return n instanceof yc&&(e.push(n),t=!t||t.indexo===e?(n=!0,!1):(t+=o.len(),!0)),n?t:-1}fullLen(e){let t=0;return yce([e],n=>(t+=n.len(),!0)),t}enclosingPlaceholders(e){const t=[];let{parent:n}=e;for(;n;)n instanceof yc&&t.push(n),n=n.parent;return t}resolveVariables(e){return this.walk(t=>(t instanceof $k&&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)}clone(){const e=new wT;return this._children=this.children.map(t=>t.clone()),e}walk(e){yce(this.children,e)}}class Gw{constructor(){this._scanner=new fu,this._token={type:14,pos:0,len:0}}static escape(e){return e.replace(/\$|}|\\/g,"\\$&")}static guessNeedsClipboard(e){return/\${?CLIPBOARD/.test(e)}parse(e,t,n){const o=new wT;return this.parseFragment(e,o),this.ensureFinalTabstop(o,n!=null?n:!1,t!=null?t:!1),o}parseFragment(e,t){const n=t.children.length;for(this._scanner.text(e),this._token=this._scanner.next();this._parse(t););const o=new Map,r=[];t.walk(l=>(l instanceof yc&&(l.isFinalTabstop?o.set(0,void 0):!o.has(l.index)&&l.children.length>0?o.set(l.index,l.children):r.push(l)),!0));const s=(l,c)=>{const u=o.get(l.index);if(!u)return;const d=new yc(l.index);d.transform=l.transform;for(const h of u){const f=h.clone();d.appendChild(f),f instanceof yc&&o.has(f.index)&&!c.has(f.index)&&(c.add(f.index),s(f,c),c.delete(f.index))}t.replace(l,[d])},a=new Set;for(const l of r)s(l,a);return t.children.slice(n)}ensureFinalTabstop(e,t,n){(t||n&&e.placeholders.length>0)&&(e.placeholders.find(r=>r.index===0)||e.appendChild(new yc(0)))}_accept(e,t){if(e===void 0||this._token.type===e){const n=t?this._scanner.tokenText(this._token):!0;return this._token=this._scanner.next(),n}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===14)return!1;if(this._token.type===5){const o=this._scanner.next();if(o.type!==0&&o.type!==4&&o.type!==5)return!1}this._token=this._scanner.next()}const n=this._scanner.value.substring(t.pos,this._token.pos).replace(/\\(\$|}|\\)/g,"$1");return this._token=this._scanner.next(),n}_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(5,!0))?(t=this._accept(0,!0)||this._accept(4,!0)||this._accept(5,!0)||t,e.appendChild(new ta(t)),!0):!1}_parseTabstopOrVariableName(e){let t;const n=this._token;return this._accept(0)&&(t=this._accept(9,!0)||this._accept(8,!0))?(e.appendChild(/^\d+$/.test(t)?new yc(Number(t)):new $k(t)),!0):this._backTo(n)}_parseComplexPlaceholder(e){let t;const n=this._token;if(!(this._accept(0)&&this._accept(3)&&(t=this._accept(8,!0))))return this._backTo(n);const r=new yc(Number(t));if(this._accept(1))for(;;){if(this._accept(4))return e.appendChild(r),!0;if(!this._parse(r))return e.appendChild(new ta("${"+t+":")),r.children.forEach(e.appendChild,e),!0}else if(r.index>0&&this._accept(7)){const s=new RS;for(;;){if(this._parseChoiceElement(s)){if(this._accept(2))continue;if(this._accept(7)&&(r.appendChild(s),this._accept(4)))return e.appendChild(r),!0}return this._backTo(n),!1}}else return this._accept(6)?this._parseTransform(r)?(e.appendChild(r),!0):(this._backTo(n),!1):this._accept(4)?(e.appendChild(r),!0):this._backTo(n)}_parseChoiceElement(e){const t=this._token,n=[];for(;!(this._token.type===2||this._token.type===7);){let o;if((o=this._accept(5,!0))?o=this._accept(2,!0)||this._accept(7,!0)||this._accept(5,!0)||o:o=this._accept(void 0,!0),!o)return this._backTo(t),!1;n.push(o)}return n.length===0?(this._backTo(t),!1):(e.appendChild(new ta(n.join(""))),!0)}_parseComplexVariable(e){let t;const n=this._token;if(!(this._accept(0)&&this._accept(3)&&(t=this._accept(9,!0))))return this._backTo(n);const r=new $k(t);if(this._accept(1))for(;;){if(this._accept(4))return e.appendChild(r),!0;if(!this._parse(r))return e.appendChild(new ta("${"+t+":")),r.children.forEach(e.appendChild,e),!0}else return this._accept(6)?this._parseTransform(r)?(e.appendChild(r),!0):(this._backTo(n),!1):this._accept(4)?(e.appendChild(r),!0):this._backTo(n)}_parseTransform(e){const t=new NY;let n="",o="";for(;!this._accept(6);){let r;if(r=this._accept(5,!0)){r=this._accept(6,!0)||r,n+=r;continue}if(this._token.type!==14){n+=this._accept(void 0,!0);continue}return!1}for(;!this._accept(6);){let r;if(r=this._accept(5,!0)){r=this._accept(5,!0)||this._accept(6,!0)||r,t.appendChild(new ta(r));continue}if(!(this._parseFormatString(t)||this._parseAnything(t)))return!1}for(;!this._accept(4);){if(this._token.type!==14){o+=this._accept(void 0,!0);continue}return!1}try{t.regexp=new RegExp(n,o)}catch{return!1}return e.transform=t,!0}_parseFormatString(e){const t=this._token;if(!this._accept(0))return!1;let n=!1;this._accept(3)&&(n=!0);const o=this._accept(8,!0);if(o)if(n){if(this._accept(4))return e.appendChild(new Cd(Number(o))),!0;if(!this._accept(1))return this._backTo(t),!1}else return e.appendChild(new Cd(Number(o))),!0;else return this._backTo(t),!1;if(this._accept(6)){const r=this._accept(9,!0);return!r||!this._accept(4)?(this._backTo(t),!1):(e.appendChild(new Cd(Number(o),r)),!0)}else if(this._accept(11)){const r=this._until(4);if(r)return e.appendChild(new Cd(Number(o),void 0,r,void 0)),!0}else if(this._accept(12)){const r=this._until(4);if(r)return e.appendChild(new Cd(Number(o),void 0,void 0,r)),!0}else if(this._accept(13)){const r=this._until(1);if(r){const s=this._until(4);if(s)return e.appendChild(new Cd(Number(o),void 0,r,s)),!0}}else{const r=this._until(4);if(r)return e.appendChild(new Cd(Number(o),void 0,void 0,r)),!0}return this._backTo(t),!1}_parseAnything(e){return this._token.type!==14?(e.appendChild(new ta(this._scanner.tokenText(this._token))),this._accept(void 0),!0):!1}}var f7=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};function Myt(i,e,t,n,o=_n.None,r){return f7(this,void 0,void 0,function*(){const s=Oyt(e,t),a=i.all(t),l=new dG;for(const m of a)m.groupId&&l.add(m.groupId,m);function c(m){if(!m.yieldsToGroupIds)return[];const _=[];for(const y of m.yieldsToGroupIds||[]){const w=l.get(y);for(const L of w)_.push(L)}return _}const u=new Map,d=new Set;function h(m,_){if(_=[..._,m],d.has(m))return _;d.add(m);try{const y=c(m);for(const w of y){const L=h(w,_);if(L)return L}}finally{d.delete(m)}}function f(m){const _=u.get(m);if(_)return _;const y=h(m,[]);y&&$o(new Error(`Inline completions: cyclic yield-to dependency detected. Path: ${y.map(L=>L.toString?L.toString():""+L).join(" -> ")}`));const w=new n5;return u.set(m,w.p),(()=>f7(this,void 0,void 0,function*(){if(!y){const L=c(m);for(const D of L){const E=yield f(D);if(E&&E.items.length>0)return}}try{return yield m.provideInlineCompletions(t,e,n,o)}catch(L){$o(L);return}}))().then(L=>w.complete(L),L=>w.error(L)),w.p}const g=yield Promise.all(a.map(m=>f7(this,void 0,void 0,function*(){return{provider:m,completions:yield f(m)}}))),p=new Map,v=[];for(const m of g){const _=m.completions;if(!_)continue;const y=new Pyt(_,m.provider);v.push(y);for(const w of _.items){const L=LO.from(w,y,s,t,r);p.set(L.hash(),L)}}return new Ayt(Array.from(p.values()),new Set(p.keys()),v)})}class Ayt{constructor(e,t,n){this.completions=e,this.hashs=t,this.providerResults=n}has(e){return this.hashs.has(e.hash())}dispose(){for(const e of this.providerResults)e.removeRef()}}class Pyt{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)}}class LO{static from(e,t,n,o,r){let s,a,l=e.range?V.lift(e.range):n;if(typeof e.insertText=="string"){if(s=e.insertText,r&&e.completeBracketPairs){s=wce(s,l.getStartPosition(),o,r);const c=s.length-e.insertText.length;c!==0&&(l=new V(l.startLineNumber,l.startColumn,l.endLineNumber,l.endColumn+c))}a=void 0}else if("snippet"in e.insertText){const c=e.insertText.snippet.length;if(r&&e.completeBracketPairs){e.insertText.snippet=wce(e.insertText.snippet,l.getStartPosition(),o,r);const d=e.insertText.snippet.length-c;d!==0&&(l=new V(l.startLineNumber,l.startColumn,l.endLineNumber,l.endColumn+d))}const u=new Gw().parse(e.insertText.snippet);u.children.length===1&&u.children[0]instanceof ta?(s=u.children[0].value,a=void 0):(s=u.toString(),a={snippet:e.insertText.snippet,range:l})}else Z4(e.insertText);return new LO(s,e.command,l,s,a,e.additionalTextEdits||xyt(),e,t)}constructor(e,t,n,o,r,s,a,l){this.filterText=e,this.command=t,this.range=n,this.insertText=o,this.snippetInfo=r,this.additionalTextEdits=s,this.sourceInlineCompletion=a,this.source=l,e=e.replace(/\r\n|\r/g,` `),o=e.replace(/\r\n|\r/g,` -`)}withRange(e){return new yO(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()})}}function Twt(i,e){const t=e.getWordAtPosition(i),n=e.getLineMaxColumn(i.lineNumber);return t?new V(i.lineNumber,t.startColumn,i.lineNumber,n):V.fromPositions(i,i.with(void 0,n))}function gce(i,e,t,n){const r=t.getLineContent(e.lineNumber).substring(0,e.column-1)+i,s=t.tokenization.tokenizeLineWithEdit(e,r.length-(e.column-1),i),a=s==null?void 0:s.sliceAndInflate(e.column-1,r.length,0);return a?Lwt(a,n):i}class Gy{constructor(e,t){this.range=e,this.text=t}removeCommonPrefix(e,t){const n=t?this.range.intersectRanges(t):this.range;if(!n)return this;const o=e.getValueInRange(n,1),r=X0(o,this.text),s=Zz(this.range.getStartPosition(),Qz(o.substring(0,r))),a=this.text.substring(r),l=V.fromPositions(s,this.range.getEndPosition());return new Gy(l,a)}augments(e){return this.text.startsWith(e.text)&&Nwt(this.range,e.range)}computeGhostText(e,t,n,o=0){let r=this.removeCommonPrefix(e);if(r.range.endLineNumber!==r.range.startLineNumber)return;const s=e.getLineContent(r.range.startLineNumber),a=Si(s).length;if(r.range.startColumn-1<=a){const g=Si(r.text).length,p=s.substring(r.range.startColumn-1,a),[v,m]=[r.range.getStartPosition(),r.range.getEndPosition()],_=v.column+p.length<=m.column?v.delta(0,p.length):m,w=V.fromPositions(_,m),y=r.text.startsWith(p)?r.text.substring(p.length):r.text.substring(g);r=new Gy(w,y)}const c=e.getValueInRange(r.range),u=Rwt(c,r.text);if(!u)return;const d=r.range.startLineNumber,h=new Array;if(t==="prefix"){const g=u.filter(p=>p.originalLength===0);if(g.length>1||g.length===1&&g[0].originalStart!==c.length)return}const f=r.text.length-o;for(const g of u){const p=r.range.startColumn+g.originalStart+g.originalLength;if(t==="subwordSmart"&&n&&n.lineNumber===r.range.startLineNumber&&p0)return;if(g.modifiedLength===0)continue;const v=g.modifiedStart+g.modifiedLength,m=Math.max(g.modifiedStart,Math.min(v,f)),_=r.text.substring(g.modifiedStart,m),w=r.text.substring(m,Math.max(g.modifiedStart,v));if(_.length>0){const y=ff(_);h.push(new Jz(p,y,!1))}if(w.length>0){const y=ff(w);h.push(new Jz(p,y,!0))}}return new wO(d,h)}}function Nwt(i,e){return e.getStartPosition().equals(i.getStartPosition())&&e.getEndPosition().isBeforeOrEqual(i.getEndPosition())}let vh;function Rwt(i,e){if((vh==null?void 0:vh.originalValue)===i&&(vh==null?void 0:vh.newValue)===e)return vh==null?void 0:vh.changes;{let t=mce(i,e,!0);if(t){const n=pce(t);if(n>0){const o=mce(i,e,!1);o&&pce(o)5e3||e.length>5e3)return;function n(c){let u=0;for(let d=0,h=c.length;du&&(u=f)}return u}const o=Math.max(n(i),n(e));function r(c){if(c<0)throw new Error("unexpected");return o+c+1}function s(c){let u=0,d=0;const h=new Int32Array(c.length);for(let f=0,g=c.length;fa},{getElements:()=>l}).ComputeDiff(!1).changes}var Mwt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},vce=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},Awt=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};let nU=class extends _e{constructor(e,t,n,o,r){super(),this.textModel=e,this.versionId=t,this._debounceValue=n,this.languageFeaturesService=o,this.languageConfigurationService=r,this._updateOperation=this._register(new Kr),this.inlineCompletions=YP("inlineCompletions",void 0),this.suggestWidgetInlineCompletions=YP("suggestWidgetInlineCompletions",void 0),this._register(this.textModel.onDidChangeContent(()=>{this._updateOperation.clear()}))}fetch(e,t,n){var o,r;const s=new Owt(e,t,this.textModel.getVersionId()),a=t.selectedSuggestionInfo?this.suggestWidgetInlineCompletions:this.inlineCompletions;if(!((o=this._updateOperation.value)===null||o===void 0)&&o.request.satisfies(s))return this._updateOperation.value.promise;if(!((r=a.get())===null||r===void 0)&&r.request.satisfies(s))return Promise.resolve(!0);const l=!!this._updateOperation.value;this._updateOperation.clear();const c=new Ro,u=(()=>Awt(this,void 0,void 0,function*(){if((l||t.triggerKind===Ug.Automatic)&&(yield Pwt(this._debounceValue.get(this.textModel))),c.token.isCancellationRequested||this.textModel.getVersionId()!==s.versionId)return!1;const f=new Date,g=yield Dwt(this.languageFeaturesService.inlineCompletionsProvider,e,this.textModel,t,c.token,this.languageConfigurationService);if(c.token.isCancellationRequested||this.textModel.getVersionId()!==s.versionId)return!1;const p=new Date;this._debounceValue.update(this.textModel,p.getTime()-f.getTime());const v=new Wwt(g,s,this.textModel,this.versionId);if(n){const m=n.toInlineCompletion(void 0);n.canBeReused(this.textModel,e)&&!g.has(m)&&v.prepend(n.inlineCompletion,m.range,!0)}return this._updateOperation.clear(),qi(m=>{a.set(v,m)}),!0}))(),d=new Bwt(s,c,u);return this._updateOperation.value=d,u}clear(e){this._updateOperation.clear(),this.inlineCompletions.set(void 0,e),this.suggestWidgetInlineCompletions.set(void 0,e)}clearSuggestWidgetInlineCompletions(e){var t;!((t=this._updateOperation.value)===null||t===void 0)&&t.request.context.selectedSuggestionInfo&&this._updateOperation.clear(),this.suggestWidgetInlineCompletions.set(void 0,e)}cancelUpdate(){this._updateOperation.clear()}};nU=Mwt([vce(3,pt),vce(4,Ti)],nU);function Pwt(i,e){return new Promise(t=>{let n;const o=setTimeout(()=>{n&&n.dispose(),t()},i);e&&(n=e.onCancellationRequested(()=>{clearTimeout(o),n&&n.dispose(),t()}))})}class Owt{constructor(e,t,n){this.position=e,this.context=t,this.versionId=n}satisfies(e){return this.position.equals(e.position)&&Fwt(this.context.selectedSuggestionInfo,e.context.selectedSuggestionInfo,(t,n)=>t.equals(n))&&(e.context.triggerKind===Ug.Automatic||this.context.triggerKind===Ug.Explicit)&&this.versionId===e.versionId}}function Fwt(i,e,t){return!i||!e?i===e:t(i,e)}class Bwt{constructor(e,t,n){this.request=e,this.cancellationTokenSource=t,this.promise=n}dispose(){this.cancellationTokenSource.cancel()}}class Wwt{get inlineCompletions(){return this._inlineCompletions}constructor(e,t,n,o){this.inlineCompletionProviderResult=e,this.request=t,this.textModel=n,this.versionId=o,this._refCount=1,this._prependedInlineCompletionItems=[],this._rangeVersionIdValue=0,this._rangeVersionId=In(this,s=>{this.versionId.read(s);let a=!1;for(const l of this._inlineCompletions)a=a||l._updateRange(this.textModel);return a&&this._rangeVersionIdValue++,this._rangeVersionIdValue});const r=n.deltaDecorations([],e.completions.map(s=>({range:s.range,options:{description:"inline-completion-tracking-range"}})));this._inlineCompletions=e.completions.map((s,a)=>new _ce(s,r[a],this._rangeVersionId))}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,n){n&&e.source.addRef();const o=this.textModel.deltaDecorations([],[{range:t,options:{description:"inline-completion-tracking-range"}}])[0];this._inlineCompletions.unshift(new _ce(e,o,this._rangeVersionId,t)),this._prependedInlineCompletionItems.push(e)}}class _ce{get forwardStable(){var e;return(e=this.inlineCompletion.source.inlineCompletions.enableForwardStability)!==null&&e!==void 0?e:!1}constructor(e,t,n,o){this.inlineCompletion=e,this.decorationId=t,this.rangeVersion=n,this.semanticId=JSON.stringify([this.inlineCompletion.filterText,this.inlineCompletion.insertText,this.inlineCompletion.range.getStartPosition().toString()]),this._isValid=!0,this._updatedRange=o!=null?o:e.range}toInlineCompletion(e){return this.inlineCompletion.withRange(this._getUpdatedRange(e))}toSingleTextEdit(e){return new Gy(this._getUpdatedRange(e),this.inlineCompletion.insertText)}isVisible(e,t,n){const o=this._toFilterTextReplacement(n).removeCommonPrefix(e);if(!this._isValid||!this.inlineCompletion.range.getStartPosition().equals(this._getUpdatedRange(n).getStartPosition())||t.lineNumber!==o.range.startLineNumber)return!1;const r=e.getValueInRange(o.range,1).toLowerCase(),s=o.text.toLowerCase(),a=Math.max(0,t.column-o.range.startColumn);let l=s.substring(0,a),c=s.substring(a),u=r.substring(0,a),d=r.substring(a);const h=e.getLineIndentColumn(o.range.startLineNumber);return o.range.startColumn<=h&&(u=u.trimStart(),u.length===0&&(d=d.trimStart()),l=l.trimStart(),l.length===0&&(c=c.trimStart())),l.startsWith(u)&&!!w1e(d,c)}canBeReused(e,t){return this._isValid&&this._getUpdatedRange(void 0).containsPosition(t)&&this.isVisible(e,t,void 0)&&!this._isSmallerThanOriginal(void 0)}_toFilterTextReplacement(e){return new Gy(this._getUpdatedRange(e),this.inlineCompletion.filterText)}_isSmallerThanOriginal(e){return bce(this._getUpdatedRange(e)).isBefore(bce(this.inlineCompletion.range))}_getUpdatedRange(e){return this.rangeVersion.read(e),this._updatedRange}_updateRange(e){const t=e.getDecorationRange(this.decorationId);return t?this._updatedRange.equalsRange(t)?!1:(this._updatedRange=t,!0):(this._isValid=!1,!0)}}function bce(i){return i.startLineNumber===i.endLineNumber?new ae(1,1+i.endColumn-i.startColumn):new ae(1+i.endLineNumber-i.startLineNumber,i.endColumn)}var RE=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};const sn={Visible:mY,HasFocusedSuggestion:new lt("suggestWidgetHasFocusedSuggestion",!1,C("suggestWidgetHasSelection","Whether any suggestion is focused")),DetailsVisible:new lt("suggestWidgetDetailsVisible",!1,C("suggestWidgetDetailsVisible","Whether suggestion details are visible")),MultipleSuggestions:new lt("suggestWidgetMultipleSuggestions",!1,C("suggestWidgetMultipleSuggestions","Whether there are multiple suggestions to pick from")),MakesTextEdit:new lt("suggestionMakesTextEdit",!0,C("suggestionMakesTextEdit","Whether inserting the current suggestion yields in a change or has everything already been typed")),AcceptSuggestionsOnEnter:new lt("acceptSuggestionOnEnter",!0,C("acceptSuggestionOnEnter","Whether suggestions are inserted when pressing Enter")),HasInsertAndReplaceRange:new lt("suggestionHasInsertAndReplaceRange",!1,C("suggestionHasInsertAndReplaceRange","Whether the current suggestion has insert and replace behaviour")),InsertMode:new lt("suggestionInsertMode",void 0,{type:"string",description:C("suggestionInsertMode","Whether the default behaviour is to insert or replace")}),CanResolve:new lt("suggestionCanResolve",!1,C("suggestionCanResolve","Whether the current suggestion supports to resolve further details"))},ov=new Z("suggestWidgetStatusBar");class Vwt{constructor(e,t,n,o){var r;this.position=e,this.completion=t,this.container=n,this.provider=o,this.isInvalid=!1,this.score=$d.Default,this.distance=0,this.textLabel=typeof t.label=="string"?t.label:(r=t.label)===null||r===void 0?void 0:r.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,V.isIRange(t.range)?(this.editStart=new ae(t.range.startLineNumber,t.range.startColumn),this.editInsertEnd=new ae(t.range.endLineNumber,t.range.endColumn),this.editReplaceEnd=new ae(t.range.endLineNumber,t.range.endColumn),this.isInvalid=this.isInvalid||V.spansMultipleLines(t.range)||t.range.startLineNumber!==e.lineNumber):(this.editStart=new ae(t.range.insert.startLineNumber,t.range.insert.startColumn),this.editInsertEnd=new ae(t.range.insert.endLineNumber,t.range.insert.endColumn),this.editReplaceEnd=new ae(t.range.replace.endLineNumber,t.range.replace.endColumn),this.isInvalid=this.isInvalid||V.spansMultipleLines(t.range.insert)||V.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 o.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}resolve(e){return RE(this,void 0,void 0,function*(){if(!this._resolveCache){const t=e.onCancellationRequested(()=>{this._resolveCache=void 0,this._resolveDuration=void 0}),n=new xs(!0);this._resolveCache=Promise.resolve(this.provider.resolveCompletionItem(this.completion,e)).then(o=>{Object.assign(this.completion,o),this._resolveDuration=n.elapsed()},o=>{oh(o)&&(this._resolveCache=void 0,this._resolveDuration=void 0)}).finally(()=>{t.dispose()})}return this._resolveCache})}}class zk{constructor(e=2,t=new Set,n=new Set,o=new Map,r=!0){this.snippetSortOrder=e,this.kindFilter=t,this.providerFilter=n,this.providerItemsToReuse=o,this.showDeprecated=r}}zk.default=new zk;let Hwt;function $wt(){return Hwt}class zwt{constructor(e,t,n,o){this.items=e,this.needsClipboard=t,this.durations=n,this.disposable=o}}function LY(i,e,t,n=zk.default,o={triggerKind:0},r=_n.None){return RE(this,void 0,void 0,function*(){const s=new xs;t=t.clone();const a=e.getWordAtPosition(t),l=a?new V(t.lineNumber,a.startColumn,t.lineNumber,a.endColumn):V.fromPositions(t),c={replace:l,insert:l.setEndPosition(t.lineNumber,t.column)},u=[],d=new Be,h=[];let f=!1;const g=(v,m,_)=>{var w,y,L;let D=!1;if(!m)return D;for(const E of m.suggestions)if(!n.kindFilter.has(E.kind)){if(!n.showDeprecated&&((w=E==null?void 0:E.tags)===null||w===void 0?void 0:w.includes(1)))continue;E.range||(E.range=c),E.sortText||(E.sortText=typeof E.label=="string"?E.label:E.label.label),!f&&E.insertTextRules&&E.insertTextRules&4&&(f=qy.guessNeedsClipboard(E.insertText)),u.push(new Vwt(t,E,m,v)),D=!0}return Rq(m)&&d.add(m),h.push({providerName:(y=v._debugDisplayName)!==null&&y!==void 0?y:"unknown_provider",elapsedProvider:(L=m.duration)!==null&&L!==void 0?L:-1,elapsedOverall:_.elapsed()}),D},p=(()=>RE(this,void 0,void 0,function*(){}))();for(const v of i.orderedGroups(e)){let m=!1;if(yield Promise.all(v.map(_=>RE(this,void 0,void 0,function*(){if(n.providerItemsToReuse.has(_)){const w=n.providerItemsToReuse.get(_);w.forEach(y=>u.push(y)),m=m||w.length>0;return}if(!(n.providerFilter.size>0&&!n.providerFilter.has(_)))try{const w=new xs,y=yield _.provideCompletionItems(e,t,o,r);m=g(_,y,w)||m}catch(w){$o(w)}}))),m||r.isCancellationRequested)break}return yield p,r.isCancellationRequested?(d.dispose(),Promise.reject(new Gv)):new zwt(u.sort(Kwt(n.snippetSortOrder)),f,{entries:h,elapsed:s.elapsed()},d)})}function EY(i,e){if(i.sortTextLow&&e.sortTextLow){if(i.sortTextLowe.sortTextLow)return 1}return i.textLabele.textLabel?1:i.completion.kind-e.completion.kind}function Uwt(i,e){if(i.completion.kind!==e.completion.kind){if(i.completion.kind===27)return-1;if(e.completion.kind===27)return 1}return EY(i,e)}function jwt(i,e){if(i.completion.kind!==e.completion.kind){if(i.completion.kind===27)return 1;if(e.completion.kind===27)return-1}return EY(i,e)}const EF=new Map;EF.set(0,Uwt);EF.set(2,jwt);EF.set(1,EY);function Kwt(i){return EF.get(i)}Rn.registerCommand("_executeCompletionItemProvider",(i,...e)=>RE(void 0,void 0,void 0,function*(){const[t,n,o,r]=e;fi(Rt.isUri(t)),fi(ae.isIPosition(n)),fi(typeof o=="string"||!o),fi(typeof r=="number"||!r);const{completionProvider:s}=i.get(pt),a=yield i.get($a).createModelReference(t);try{const l={incomplete:!1,suggestions:[]},c=[],u=a.object.textEditorModel.validatePosition(n),d=yield LY(s,a.object.textEditorModel,u,void 0,{triggerCharacter:o!=null?o:void 0,triggerKind:o?1:0});for(const h of d.items)c.length<(r!=null?r:0)&&c.push(h.resolve(_n.None)),l.incomplete=l.incomplete||h.container.incomplete,l.suggestions.push(h.completion);try{return yield Promise.all(c),l}finally{setTimeout(()=>d.disposable.dispose(),100)}}finally{a.dispose()}}));function qwt(i,e){var t;(t=i.getContribution("editor.contrib.suggestController"))===null||t===void 0||t.triggerSuggest(new Set().add(e),void 0,!0)}class ZC{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 1:return e.comments;case 2:return e.strings;default:return e.other}}}function Cce(i,e=as){return Rst(i,e)?i.charAt(0).toUpperCase()+i.slice(1):i}var Gwt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Xwt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};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 wce{constructor(e){this._delegates=e}resolve(e){for(const t of this._delegates){const n=t.resolve(e);if(n!==void 0)return n}}}class yce{constructor(e,t,n,o){this._model=e,this._selection=t,this._selectionIdx=n,this._overtypingCapturer=o}resolve(e){const{name:t}=e;if(t==="SELECTION"||t==="TM_SELECTED_TEXT"){let n=this._model.getValueInRange(this._selection)||void 0,o=this._selection.startLineNumber!==this._selection.endLineNumber;if(!n&&this._overtypingCapturer){const r=this._overtypingCapturer.getLastOvertypedInfo(this._selectionIdx);r&&(n=r.value,o=r.multiline)}if(n&&o&&e.snippet){const r=this._model.getLineContent(this._selection.startLineNumber),s=Si(r,0,this._selection.startColumn-1);let a=s;e.snippet.walk(c=>c===e?!1:(c instanceof ea&&(a=Si(ff(c.value).pop())),!0));const l=X0(a,s);n=n.replace(/(\r\n|\r|\n)(.*)/g,(c,u,d)=>`${u}${a.substr(l)}${d}`)}return n}else{if(t==="TM_CURRENT_LINE")return this._model.getLineContent(this._selection.positionLineNumber);if(t==="TM_CURRENT_WORD"){const n=this._model.getWordAtPosition({lineNumber:this._selection.positionLineNumber,column:this._selection.positionColumn});return n&&n.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 Sce{constructor(e,t){this._labelService=e,this._model=t}resolve(e){const{name:t}=e;if(t==="TM_FILENAME")return jm(this._model.uri.fsPath);if(t==="TM_FILENAME_BASE"){const n=jm(this._model.uri.fsPath),o=n.lastIndexOf(".");return o<=0?n:n.slice(0,o)}else{if(t==="TM_DIRECTORY")return L_e(this._model.uri.fsPath)==="."?"":this._labelService.getUriLabel(y5(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 xce{constructor(e,t,n,o){this._readClipboardText=e,this._selectionIdx=t,this._selectionCount=n,this._spread=o}resolve(e){if(e.name!=="CLIPBOARD")return;const t=this._readClipboardText();if(!!t){if(this._spread){const n=t.split(/\r\n|\n|\r/).filter(o=>!R_e(o));if(n.length===this._selectionCount)return n[this._selectionIdx]}return t}}}let SO=class{constructor(e,t,n){this._model=e,this._selection=t,this._languageConfigurationService=n}resolve(e){const{name:t}=e,n=this._model.getLanguageIdAtPosition(this._selection.selectionStartLineNumber,this._selection.selectionStartColumn),o=this._languageConfigurationService.getLanguageConfiguration(n).comments;if(!!o){if(t==="LINE_COMMENT")return o.lineCommentToken||void 0;if(t==="BLOCK_COMMENT_START")return o.blockCommentStartToken||void 0;if(t==="BLOCK_COMMENT_END")return o.blockCommentEndToken||void 0}}};SO=Gwt([Xwt(2,Ti)],SO);class Rd{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 Rd.dayNames[this._date.getDay()];if(t==="CURRENT_DAY_NAME_SHORT")return Rd.dayNamesShort[this._date.getDay()];if(t==="CURRENT_MONTH_NAME")return Rd.monthNames[this._date.getMonth()];if(t==="CURRENT_MONTH_NAME_SHORT")return Rd.monthNamesShort[this._date.getMonth()];if(t==="CURRENT_SECONDS_UNIX")return String(Math.floor(this._date.getTime()/1e3));if(t==="CURRENT_TIMEZONE_OFFSET"){const n=this._date.getTimezoneOffset(),o=n>0?"-":"+",r=Math.trunc(Math.abs(n/60)),s=r<10?"0"+r:r,a=Math.abs(n)-r*60,l=a<10?"0"+a:a;return o+s+":"+l}}}Rd.dayNames=[C("Sunday","Sunday"),C("Monday","Monday"),C("Tuesday","Tuesday"),C("Wednesday","Wednesday"),C("Thursday","Thursday"),C("Friday","Friday"),C("Saturday","Saturday")];Rd.dayNamesShort=[C("SundayShort","Sun"),C("MondayShort","Mon"),C("TuesdayShort","Tue"),C("WednesdayShort","Wed"),C("ThursdayShort","Thu"),C("FridayShort","Fri"),C("SaturdayShort","Sat")];Rd.monthNames=[C("January","January"),C("February","February"),C("March","March"),C("April","April"),C("May","May"),C("June","June"),C("July","July"),C("August","August"),C("September","September"),C("October","October"),C("November","November"),C("December","December")];Rd.monthNamesShort=[C("JanuaryShort","Jan"),C("FebruaryShort","Feb"),C("MarchShort","Mar"),C("AprilShort","Apr"),C("MayShort","May"),C("JuneShort","Jun"),C("JulyShort","Jul"),C("AugustShort","Aug"),C("SeptemberShort","Sep"),C("OctoberShort","Oct"),C("NovemberShort","Nov"),C("DecemberShort","Dec")];class Lce{constructor(e){this._workspaceService=e}resolve(e){if(!this._workspaceService)return;const t=Kct(this._workspaceService.getWorkspace());if(!zct(t)){if(e.name==="WORKSPACE_NAME")return this._resolveWorkspaceName(t);if(e.name==="WORKSPACE_FOLDER")return this._resoveWorkspacePath(t)}}_resolveWorkspaceName(e){if(VH(e))return jm(e.uri.path);let t=jm(e.configPath.path);return t.endsWith(HH)&&(t=t.substr(0,t.length-HH.length-1)),t}_resoveWorkspacePath(e){if(VH(e))return Cce(e.uri.fsPath);const t=jm(e.configPath.path);let n=e.configPath.fsPath;return n.endsWith(t)&&(n=n.substr(0,n.length-t.length-1)),n?Cce(n):"/"}}class Ece{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 vF()}}var Ywt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Zwt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},ad;class _c{constructor(e,t,n){this._editor=e,this._snippet=t,this._snippetLineLeadingWhitespace=n,this._offset=-1,this._nestingLevel=1,this._placeholderGroups=Kie(t.placeholders,Cc.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 n of this._snippet.placeholders){const o=this._snippet.offset(n),r=this._snippet.fullLen(n),s=V.fromPositions(e.getPositionAt(this._offset+o),e.getPositionAt(this._offset+o+r)),a=n.isFinalTabstop?_c._decor.inactiveFinal:_c._decor.inactive,l=t.addDecoration(s,a);this._placeholderDecorations.set(n,l)}})}move(e){if(!this._editor.hasModel())return[];if(this._initDecorations(),this._placeholderGroupsIdx>=0){const o=[];for(const r of this._placeholderGroups[this._placeholderGroupsIdx])if(r.transform){const s=this._placeholderDecorations.get(r),a=this._editor.getModel().getDecorationRange(s),l=this._editor.getModel().getValueInRange(a),c=r.transform.resolve(l).split(/\r\n|\r|\n/);for(let u=1;u0&&this._editor.executeEdits("snippet.placeholderTransform",o)}let t=!1;e===!0&&this._placeholderGroupsIdx0&&(this._placeholderGroupsIdx-=1,t=!0);const n=this._editor.getModel().changeDecorations(o=>{const r=new Set,s=[];for(const a of this._placeholderGroups[this._placeholderGroupsIdx]){const l=this._placeholderDecorations.get(a),c=this._editor.getModel().getDecorationRange(l);s.push(new gt(c.startLineNumber,c.startColumn,c.endLineNumber,c.endColumn)),t=t&&this._hasPlaceholderBeenCollapsed(a),o.changeDecorationOptions(l,a.isFinalTabstop?_c._decor.activeFinal:_c._decor.active),r.add(a);for(const u of this._snippet.enclosingPlaceholders(a)){const d=this._placeholderDecorations.get(u);o.changeDecorationOptions(d,u.isFinalTabstop?_c._decor.activeFinal:_c._decor.active),r.add(u)}}for(const[a,l]of this._placeholderDecorations)r.has(a)||o.changeDecorationOptions(l,a.isFinalTabstop?_c._decor.inactiveFinal:_c._decor.inactive);return s});return t?this.move(e):n!=null?n:[]}_hasPlaceholderBeenCollapsed(e){let t=e;for(;t;){if(t instanceof Cc){const n=this._placeholderDecorations.get(t);if(this._editor.getModel().getDecorationRange(n).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 n;for(const o of t){if(o.isFinalTabstop)break;n||(n=[],e.set(o.index,n));const r=this._placeholderDecorations.get(o),s=this._editor.getModel().getDecorationRange(r);if(!s){e.delete(o.index);break}n.push(s)}}return e}get activeChoice(){if(!this._placeholderDecorations)return;const e=this._placeholderGroups[this._placeholderGroupsIdx][0];if(!(e!=null&&e.choice))return;const t=this._placeholderDecorations.get(e);if(!t)return;const n=this._editor.getModel().getDecorationRange(t);if(!!n)return{range:n,choice:e.choice}}get hasChoice(){let e=!1;return this._snippet.walk(t=>(e=t instanceof NS,!e)),e}merge(e){const t=this._editor.getModel();this._nestingLevel*=10,this._editor.changeDecorations(n=>{for(const o of this._placeholderGroups[this._placeholderGroupsIdx]){const r=e.shift();console.assert(r._offset!==-1),console.assert(!r._placeholderDecorations);const s=r._snippet.placeholderInfo.last.index;for(const l of r._snippet.placeholderInfo.all)l.isFinalTabstop?l.index=o.index+(s+1)/this._nestingLevel:l.index=o.index+l.index/this._nestingLevel;this._snippet.replace(o,r._snippet.children);const a=this._placeholderDecorations.get(o);n.removeDecoration(a),this._placeholderDecorations.delete(o);for(const l of r._snippet.placeholders){const c=r._snippet.offset(l),u=r._snippet.fullLen(l),d=V.fromPositions(t.getPositionAt(r._offset+c),t.getPositionAt(r._offset+c+u)),h=n.addDecoration(d,_c._decor.inactive);this._placeholderDecorations.set(l,h)}}this._placeholderGroups=Kie(this._snippet.placeholders,Cc.compareByIndex)})}}_c._decor={active:Jt.register({description:"snippet-placeholder-1",stickiness:0,className:"snippet-placeholder"}),inactive:Jt.register({description:"snippet-placeholder-2",stickiness:1,className:"snippet-placeholder"}),activeFinal:Jt.register({description:"snippet-placeholder-3",stickiness:1,className:"finish-snippet-placeholder"}),inactiveFinal:Jt.register({description:"snippet-placeholder-4",stickiness:1,className:"finish-snippet-placeholder"})};const Dce={overwriteBefore:0,overwriteAfter:0,adjustWhitespace:!0,clipboardText:void 0,overtypingCapturer:void 0};let xO=ad=class{static adjustWhitespace(e,t,n,o,r){const s=e.getLineContent(t.lineNumber),a=Si(s,0,t.column-1);let l;return o.walk(c=>{if(!(c instanceof ea)||c.parent instanceof NS||r&&!r.has(c))return!0;const u=c.value.split(/\r\n|\r|\n/);if(n){const h=o.offset(c);if(h===0)u[0]=e.normalizeIndentation(u[0]);else{l=l!=null?l:o.toString();const f=l.charCodeAt(h-1);(f===10||f===13)&&(u[0]=e.normalizeIndentation(a+u[0]))}for(let f=1;fy.get(nb)),g=e.invokeWithinContext(y=>new Sce(y.get(Iy),h)),p=()=>a,v=h.getValueInRange(ad.adjustSelection(h,e.getSelection(),n,0)),m=h.getValueInRange(ad.adjustSelection(h,e.getSelection(),0,o)),_=h.getLineFirstNonWhitespaceColumn(e.getSelection().positionLineNumber),w=e.getSelections().map((y,L)=>({selection:y,idx:L})).sort((y,L)=>V.compareRangesUsingStarts(y.selection,L.selection));for(const{selection:y,idx:L}of w){let D=ad.adjustSelection(h,y,n,0),E=ad.adjustSelection(h,y,0,o);v!==h.getValueInRange(D)&&(D=y),m!==h.getValueInRange(E)&&(E=y);const I=y.setStartPosition(D.startLineNumber,D.startColumn).setEndPosition(E.endLineNumber,E.endColumn),k=new qy().parse(t,!0,r),R=I.getStartPosition(),A=ad.adjustWhitespace(h,R,s||L>0&&_!==h.getLineFirstNonWhitespaceColumn(y.positionLineNumber),k);k.resolveVariables(new wce([g,new xce(p,L,w.length,e.getOption(78)==="spread"),new yce(h,y,L,l),new SO(h,y,c),new Rd,new Lce(f),new Ece])),u[L]=Gi.replace(I,k.toString()),u[L].identifier={major:L,minor:0},u[L]._isTracked=!0,d[L]=new _c(e,k,A)}return{edits:u,snippets:d}}static createEditsAndSnippetsFromEdits(e,t,n,o,r,s,a){if(!e.hasModel()||t.length===0)return{edits:[],snippets:[]};const l=[],c=e.getModel(),u=new qy,d=new CT,h=new wce([e.invokeWithinContext(g=>new Sce(g.get(Iy),c)),new xce(()=>r,0,e.getSelections().length,e.getOption(78)==="spread"),new yce(c,e.getSelection(),0,s),new SO(c,e.getSelection(),a),new Rd,new Lce(e.invokeWithinContext(g=>g.get(nb))),new Ece]);t=t.sort((g,p)=>V.compareRangesUsingStarts(g.range,p.range));let f=0;for(let g=0;g0){const L=t[g-1].range,D=V.fromPositions(L.getEndPosition(),p.getStartPosition()),E=new ea(c.getValueInRange(D));d.appendChild(E),f+=E.value.length}const m=u.parseFragment(v,d);ad.adjustWhitespace(c,p.getStartPosition(),!0,d,new Set(m)),d.resolveVariables(h);const _=d.toString(),w=_.slice(f);f=_.length;const y=Gi.replace(p,w);y.identifier={major:g,minor:0},y._isTracked=!0,l.push(y)}return u.ensureFinalTabstop(d,n,!0),{edits:l,snippets:[new _c(e,d,"")]}}constructor(e,t,n=Dce,o){this._editor=e,this._template=t,this._options=n,this._languageConfigurationService=o,this._templateMerges=[],this._snippets=[]}dispose(){si(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"?ad.createEditsAndSnippetsFromSelections(this._editor,this._template,this._options.overwriteBefore,this._options.overwriteAfter,!1,this._options.adjustWhitespace,this._options.clipboardText,this._options.overtypingCapturer,this._languageConfigurationService):ad.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,n=>{const o=n.filter(r=>!!r.identifier);for(let r=0;rgt.fromPositions(r.range.getEndPosition()))}),this._editor.revealRange(this._editor.getSelections()[0])}merge(e,t=Dce){if(!this._editor.hasModel())return;this._templateMerges.push([this._snippets[0]._nestingLevel,this._snippets[0]._placeholderGroupsIdx,e]);const{edits:n,snippets:o}=ad.createEditsAndSnippetsFromSelections(this._editor,e,t.overwriteBefore,t.overwriteAfter,!0,t.adjustWhitespace,t.clipboardText,t.overtypingCapturer,this._languageConfigurationService);this._editor.executeEdits("snippet",n,r=>{const s=r.filter(l=>!!l.identifier);for(let l=0;lgt.fromPositions(l.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 n of this._snippets){const o=n.move(e);t.push(...o)}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(...o.get(s))})}e.sort(V.compareRangesUsingStarts);for(const[n,o]of t){if(o.length!==e.length){t.delete(n);continue}o.sort(V.compareRangesUsingStarts);for(let r=0;r0}};xO=ad=Ywt([Zwt(3,Ti)],xO);var Qwt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},rR=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},fC;const kce={overwriteBefore:0,overwriteAfter:0,undoStopBefore:!0,undoStopAfter:!0,adjustWhitespace:!0,clipboardText:void 0,overtypingCapturer:void 0};let qr=fC=class{static get(e){return e.getContribution(fC.ID)}constructor(e,t,n,o,r){this._editor=e,this._logService=t,this._languageFeaturesService=n,this._languageConfigurationService=r,this._snippetListener=new Be,this._modelVersionId=-1,this._inSnippet=fC.InSnippetMode.bindTo(o),this._hasNextTabstop=fC.HasNextTabstop.bindTo(o),this._hasPrevTabstop=fC.HasPrevTabstop.bindTo(o)}dispose(){var e;this._inSnippet.reset(),this._hasPrevTabstop.reset(),this._hasNextTabstop.reset(),(e=this._session)===null||e===void 0||e.dispose(),this._snippetListener.dispose()}insert(e,t){try{this._doInsert(e,typeof t=="undefined"?kce:Object.assign(Object.assign({},kce),t))}catch(n){this.cancel(),this._logService.error(n),this._logService.error("snippet_error"),this._logService.error("insert_template=",e),this._logService.error("existing_template=",this._session?this._session._logInfo():"")}}_doInsert(e,t){var n;if(!!this._editor.hasModel()){if(this._snippetListener.clear(),t.undoStopBefore&&this._editor.getModel().pushStackElement(),this._session&&typeof e!="string"&&this.cancel(),this._session?(fi(typeof e=="string"),this._session.merge(e,t)):(this._modelVersionId=this._editor.getModel().getAlternativeVersionId(),this._session=new xO(this._editor,e,t,this._languageConfigurationService),this._session.insert()),t.undoStopAfter&&this._editor.getModel().pushStackElement(),!((n=this._session)===null||n===void 0)&&n.hasChoice){const o={_debugDisplayName:"snippetChoiceCompletions",provideCompletionItems:(u,d)=>{if(!this._session||u!==this._editor.getModel()||!ae.equals(this._editor.getPosition(),d))return;const{activeChoice:h}=this._session;if(!h||h.choice.options.length===0)return;const f=u.getValueInRange(h.range),g=Boolean(h.choice.options.find(v=>v.value===f)),p=[];for(let v=0;v{s==null||s.dispose(),a=!1},c=()=>{a||(s=this._languageFeaturesService.completionProvider.register({language:r.getLanguageId(),pattern:r.uri.fsPath,scheme:r.uri.scheme,exclusive:!0},o),this._snippetListener.add(s),a=!0)};this._choiceCompletions={provider:o,enable:c,disable:l}}this._updateState(),this._snippetListener.add(this._editor.onDidChangeModelContent(o=>o.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(){var e;if(!this._session||!this._editor.hasModel()){this._currentChoice=void 0;return}const{activeChoice:t}=this._session;if(!t||!this._choiceCompletions){(e=this._choiceCompletions)===null||e===void 0||e.disable(),this._currentChoice=void 0;return}this._currentChoice!==t.choice&&(this._currentChoice=t.choice,this._choiceCompletions.enable(),queueMicrotask(()=>{qwt(this._editor,this._choiceCompletions.provider)}))}finish(){for(;this._inSnippet.get();)this.next()}cancel(e=!1){var t;this._inSnippet.reset(),this._hasPrevTabstop.reset(),this._hasNextTabstop.reset(),this._snippetListener.clear(),this._currentChoice=void 0,(t=this._session)===null||t===void 0||t.dispose(),this._session=void 0,this._modelVersionId=-1,e&&this._editor.setSelections([this._editor.getSelection()])}prev(){var e;(e=this._session)===null||e===void 0||e.prev(),this._updateState()}next(){var e;(e=this._session)===null||e===void 0||e.next(),this._updateState()}isInSnippet(){return Boolean(this._inSnippet.get())}};qr.ID="snippetController2";qr.InSnippetMode=new lt("inSnippetMode",!1,C("inSnippetMode","Whether the editor in current in snippet mode"));qr.HasNextTabstop=new lt("hasNextTabstop",!1,C("hasNextTabstop","Whether there is a next tab stop when in snippet mode"));qr.HasPrevTabstop=new lt("hasPrevTabstop",!1,C("hasPrevTabstop","Whether there is a previous tab stop when in snippet mode"));qr=fC=Qwt([rR(1,tc),rR(2,pt),rR(3,Ut),rR(4,Ti)],qr);zn(qr.ID,qr,4);const DF=Ir.bindToContribution(qr.get);Ye(new DF({id:"jumpToNextSnippetPlaceholder",precondition:Me.and(qr.InSnippetMode,qr.HasNextTabstop),handler:i=>i.next(),kbOpts:{weight:100+30,kbExpr:Q.editorTextFocus,primary:2}}));Ye(new DF({id:"jumpToPrevSnippetPlaceholder",precondition:Me.and(qr.InSnippetMode,qr.HasPrevTabstop),handler:i=>i.prev(),kbOpts:{weight:100+30,kbExpr:Q.editorTextFocus,primary:1026}}));Ye(new DF({id:"leaveSnippet",precondition:qr.InSnippetMode,handler:i=>i.cancel(!0),kbOpts:{weight:100+30,kbExpr:Q.editorTextFocus,primary:9,secondary:[1033]}}));Ye(new DF({id:"acceptSnippet",precondition:qr.InSnippetMode,handler:i=>i.finish()}));var Jwt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},g7=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},ig=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},Tl;(function(i){i[i.Undo=0]="Undo",i[i.Redo=1]="Redo",i[i.AcceptWord=2]="AcceptWord",i[i.Other=3]="Other"})(Tl||(Tl={}));let iU=class extends _e{get isAcceptingPartially(){return this._isAcceptingPartially}constructor(e,t,n,o,r,s,a,l,c,u,d,h){super(),this.textModel=e,this.selectedSuggestItem=t,this.cursorPosition=n,this.textModelVersionId=o,this._debounceValue=r,this._suggestPreviewEnabled=s,this._suggestPreviewMode=a,this._inlineSuggestMode=l,this._enabled=c,this._instantiationService=u,this._commandService=d,this._languageConfigurationService=h,this._source=this._register(this._instantiationService.createInstance(nU,this.textModel,this.textModelVersionId,this._debounceValue)),this._isActive=Ai(this,!1),this._forceUpdate=TCe("forceUpdate"),this._selectedInlineCompletionId=Ai(this,void 0),this._isAcceptingPartially=!1,this._preserveCurrentCompletionReasons=new Set([Tl.Redo,Tl.Undo,Tl.AcceptWord]),this._fetchInlineCompletions=Ngt({owner:this,createEmptyChangeSummary:()=>({preserveCurrentCompletion:!1,inlineCompletionTriggerKind:Ug.Automatic}),handleChange:(g,p)=>(g.didChange(this.textModelVersionId)&&this._preserveCurrentCompletionReasons.has(g.change)?p.preserveCurrentCompletion=!0:g.didChange(this._forceUpdate)&&(p.inlineCompletionTriggerKind=g.change),!0)},(g,p)=>{if(this._forceUpdate.read(g),!(this._enabled.read(g)&&this.selectedSuggestItem.read(g)||this._isActive.read(g))){this._source.cancelUpdate();return}this.textModelVersionId.read(g);const m=this.selectedInlineCompletion.get(),_=p.preserveCurrentCompletion||(m==null?void 0:m.forwardStable)?m:void 0,w=this._source.suggestWidgetInlineCompletions.get(),y=this.selectedSuggestItem.read(g);if(w&&!y){const E=this._source.inlineCompletions.get();qi(I=>{E&&w.request.versionId>E.request.versionId&&this._source.inlineCompletions.set(w.clone(),I),this._source.clearSuggestWidgetInlineCompletions(I)})}const L=this.cursorPosition.read(g),D={triggerKind:p.inlineCompletionTriggerKind,selectedSuggestionInfo:y==null?void 0:y.toSelectedSuggestionInfo()};return this._source.fetch(L,D,_)}),this._filteredInlineCompletionItems=In(this,g=>{const p=this._source.inlineCompletions.read(g);if(!p)return[];const v=this.cursorPosition.read(g);return p.inlineCompletions.filter(_=>_.isVisible(this.textModel,v,g))}),this.selectedInlineCompletionIndex=In(this,g=>{const p=this._selectedInlineCompletionId.read(g),v=this._filteredInlineCompletionItems.read(g),m=this._selectedInlineCompletionId===void 0?-1:v.findIndex(_=>_.semanticId===p);return m===-1?(this._selectedInlineCompletionId.set(void 0,void 0),0):m}),this.selectedInlineCompletion=In(this,g=>{const p=this._filteredInlineCompletionItems.read(g),v=this.selectedInlineCompletionIndex.read(g);return p[v]}),this.lastTriggerKind=this._source.inlineCompletions.map(g=>g==null?void 0:g.request.context.triggerKind),this.inlineCompletionsCount=In(this,g=>{if(this.lastTriggerKind.read(g)===Ug.Explicit)return this._filteredInlineCompletionItems.read(g).length}),this.state=Bae({owner:this,equalityComparer:(g,p)=>!g||!p?g===p:uce(g.ghostText,p.ghostText)&&g.inlineCompletion===p.inlineCompletion&&g.suggestItem===p.suggestItem},g=>{var p;const v=this.textModel,m=this.selectedSuggestItem.read(g);if(m){const _=m.toSingleTextEdit().removeCommonPrefix(v),w=this._computeAugmentedCompletion(_,g);if(!this._suggestPreviewEnabled.read(g)&&!w)return;const L=(p=w==null?void 0:w.edit)!==null&&p!==void 0?p:_,D=w?w.edit.text.length-_.text.length:0,E=this._suggestPreviewMode.read(g),I=this.cursorPosition.read(g),k=L.computeGhostText(v,E,I,D);return{ghostText:k!=null?k:new wO(L.range.endLineNumber,[]),inlineCompletion:w==null?void 0:w.completion,suggestItem:m}}else{if(!this._isActive.read(g))return;const _=this.selectedInlineCompletion.read(g);if(!_)return;const w=_.toSingleTextEdit(g),y=this._inlineSuggestMode.read(g),L=this.cursorPosition.read(g),D=w.computeGhostText(v,y,L);return D?{ghostText:D,inlineCompletion:_,suggestItem:void 0}:void 0}}),this.ghostText=Bae({owner:this,equalityComparer:uce},g=>{const p=this.state.read(g);if(!!p)return p.ghostText}),this._register(Tk(this._fetchInlineCompletions));let f;this._register(Ii(g=>{var p,v;const m=this.state.read(g),_=m==null?void 0:m.inlineCompletion;if((_==null?void 0:_.semanticId)!==(f==null?void 0:f.semanticId)&&(f=_,_)){const w=_.inlineCompletion,y=w.source;(v=(p=y.provider).handleItemDidShow)===null||v===void 0||v.call(p,y.inlineCompletions,w.sourceInlineCompletion,w.insertText)}}))}trigger(e){return ig(this,void 0,void 0,function*(){this._isActive.set(!0,e),yield this._fetchInlineCompletions.get()})}triggerExplicitly(e){return ig(this,void 0,void 0,function*(){U$(e,t=>{this._isActive.set(!0,t),this._forceUpdate.trigger(t,Ug.Explicit)}),yield this._fetchInlineCompletions.get()})}stop(e){U$(e,t=>{this._isActive.set(!1,t),this._source.clear(t)})}_computeAugmentedCompletion(e,t){const n=this.textModel,o=this._source.suggestWidgetInlineCompletions.read(t),r=o?o.inlineCompletions:[this.selectedInlineCompletion.read(t)].filter(ED);return xet(r,a=>{let l=a.toSingleTextEdit(t);return l=l.removeCommonPrefix(n,V.fromPositions(l.range.getStartPosition(),e.range.getEndPosition())),l.augments(e)?{edit:l,completion:a}:void 0})}_deltaSelectedInlineCompletionIndex(e){return ig(this,void 0,void 0,function*(){yield this.triggerExplicitly();const t=this._filteredInlineCompletionItems.get()||[];if(t.length>0){const n=(this.selectedInlineCompletionIndex.get()+e+t.length)%t.length;this._selectedInlineCompletionId.set(t[n].semanticId,void 0)}else this._selectedInlineCompletionId.set(void 0,void 0)})}next(){return ig(this,void 0,void 0,function*(){yield this._deltaSelectedInlineCompletionIndex(1)})}previous(){return ig(this,void 0,void 0,function*(){yield this._deltaSelectedInlineCompletionIndex(-1)})}accept(e){var t;return ig(this,void 0,void 0,function*(){if(e.getModel()!==this.textModel)throw new Vo;const n=this.state.get();if(!n||n.ghostText.isEmpty()||!n.inlineCompletion)return;const o=n.inlineCompletion.toInlineCompletion(void 0);e.pushUndoStop(),o.snippetInfo?(e.executeEdits("inlineSuggestion.accept",[Gi.replaceMove(o.range,""),...o.additionalTextEdits]),e.setPosition(o.snippetInfo.range.getStartPosition()),(t=qr.get(e))===null||t===void 0||t.insert(o.snippetInfo.snippet,{undoStopBefore:!1})):e.executeEdits("inlineSuggestion.accept",[Gi.replaceMove(o.range,o.insertText),...o.additionalTextEdits]),o.command&&o.source.addRef(),qi(r=>{this._source.clear(r),this._isActive.set(!1,r)}),o.command&&(yield this._commandService.executeCommand(o.command.id,...o.command.arguments||[]).then(void 0,$o),o.source.removeRef())})}acceptNextWord(e){return ig(this,void 0,void 0,function*(){yield this._acceptNext(e,(t,n)=>{const o=this.textModel.getLanguageIdAtPosition(t.lineNumber,t.column),r=this._languageConfigurationService.getLanguageConfiguration(o),s=new RegExp(r.wordDefinition.source,r.wordDefinition.flags.replace("g","")),a=n.match(s);let l=0;a&&a.index!==void 0?a.index===0?l=a[0].length:l=a.index:l=n.length;const u=/\s+/g.exec(n);return u&&u.index!==void 0&&u.index+u[0].length{const o=n.match(/\n/);return o&&o.index!==void 0?o.index+1:n.length})})}_acceptNext(e,t){return ig(this,void 0,void 0,function*(){if(e.getModel()!==this.textModel)throw new Vo;const n=this.state.get();if(!n||n.ghostText.isEmpty()||!n.inlineCompletion)return;const o=n.ghostText,r=n.inlineCompletion.toInlineCompletion(void 0);if(r.snippetInfo||r.filterText!==r.insertText){yield this.accept(e);return}const s=o.parts[0],a=new ae(o.lineNumber,s.column),l=s.lines.join(` -`),c=t(a,l);if(c===l.length&&o.parts.length===1){this.accept(e);return}const u=l.substring(0,c);this._isAcceptingPartially=!0;try{e.pushUndoStop(),e.executeEdits("inlineSuggestion.accept",[Gi.replace(V.fromPositions(a),u)]);const d=Qz(u);e.setPosition(Zz(a,d))}finally{this._isAcceptingPartially=!1}if(r.source.provider.handlePartialAccept){const d=V.fromPositions(r.range.getStartPosition(),Zz(a,Qz(u))),h=e.getModel().getValueInRange(d,1);r.source.provider.handlePartialAccept(r.source.inlineCompletions,r.sourceInlineCompletion,h.length)}})}handleSuggestAccepted(e){var t,n;const o=e.toSingleTextEdit().removeCommonPrefix(this.textModel),r=this._computeAugmentedCompletion(o,void 0);if(!r)return;const s=r.completion.inlineCompletion;(n=(t=s.source.provider).handlePartialAccept)===null||n===void 0||n.call(t,s.source.inlineCompletions,s.sourceInlineCompletion,o.text.length)}};iU=Jwt([g7(9,$t),g7(10,_o),g7(11,Ti)],iU);var eyt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Ice=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},PL;class DY{constructor(e){this.name=e}select(e,t,n){if(n.length===0)return 0;const o=n[0].score[0];for(let r=0;rl&&d.type===n[c].completion.kind&&d.insertText===n[c].completion.insertText&&(l=d.touch,a=c),n[c].completion.preselect&&s===-1)return s=c}return a!==-1?a:s!==-1?s:0}toJSON(){return this._cache.toJSON()}fromJSON(e){this._cache.clear();const t=0;for(const[n,o]of e)o.touch=t,o.type=typeof o.type=="number"?o.type:TD.fromString(o.type),this._cache.set(n,o);this._seq=this._cache.size}}class nyt extends DY{constructor(){super("recentlyUsedByPrefix"),this._trie=Rw.forStrings(),this._seq=0}memorize(e,t,n){const{word:o}=e.getWordUntilPosition(t),r=`${e.getLanguageId()}/${o}`;this._trie.set(r,{type:n.completion.kind,insertText:n.completion.insertText,touch:this._seq++})}select(e,t,n){const{word:o}=e.getWordUntilPosition(t);if(!o)return super.select(e,t,n);const r=`${e.getLanguageId()}/${o}`;let s=this._trie.get(r);if(s||(s=this._trie.findSubstr(r)),s)for(let a=0;ae.push([n,t])),e.sort((t,n)=>-(t[1].touch-n[1].touch)).forEach((t,n)=>t[1].touch=n),e.slice(0,200)}fromJSON(e){if(this._trie.clear(),e.length>0){this._seq=e[0][1].touch+1;for(const[t,n]of e)n.type=typeof n.type=="number"?n.type:TD.fromString(n.type),this._trie.set(t,n)}}}let Uk=PL=class{constructor(e,t){this._storageService=e,this._configService=t,this._disposables=new Be,this._persistSoon=new bi(()=>this._saveState(),500),this._disposables.add(e.onWillSaveState(n=>{n.reason===RP.SHUTDOWN&&this._saveState()}))}dispose(){this._disposables.dispose(),this._persistSoon.dispose()}memorize(e,t,n){this._withStrategy(e,t).memorize(e,t,n),this._persistSoon.schedule()}select(e,t,n){return this._withStrategy(e,t).select(e,t,n)}_withStrategy(e,t){var n;const o=this._configService.getValue("editor.suggestSelection",{overrideIdentifier:e.getLanguageIdAtPosition(t.lineNumber,t.column),resource:e.uri});if(((n=this._strategy)===null||n===void 0?void 0:n.name)!==o){this._saveState();const r=PL._strategyCtors.get(o)||nSe;this._strategy=new r;try{const a=this._configService.getValue("editor.suggest.shareSuggestSelections")?0:1,l=this._storageService.get(`${PL._storagePrefix}/${o}`,a);l&&this._strategy.fromJSON(JSON.parse(l))}catch{}}return this._strategy}_saveState(){if(this._strategy){const t=this._configService.getValue("editor.suggest.shareSuggestSelections")?0:1,n=JSON.stringify(this._strategy);this._storageService.store(`${PL._storagePrefix}/${this._strategy.name}`,n,t,1)}}};Uk._strategyCtors=new Map([["recentlyUsedByPrefix",nyt],["recentlyUsed",tyt],["first",nSe]]);Uk._storagePrefix="suggest/memories";Uk=PL=eyt([Ice(0,qu),Ice(1,En)],Uk);const kF=wn("ISuggestMemories");Mn(kF,Uk,1);var iyt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},oyt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},oU;let jk=oU=class{constructor(e,t){this._editor=e,this._enabled=!1,this._ckAtEnd=oU.AtEnd.bindTo(t),this._configListener=this._editor.onDidChangeConfiguration(n=>n.hasChanged(122)&&this._update()),this._update()}dispose(){var e;this._configListener.dispose(),(e=this._selectionListener)===null||e===void 0||e.dispose(),this._ckAtEnd.reset()}_update(){const e=this._editor.getOption(122)==="on";if(this._enabled!==e)if(this._enabled=e,this._enabled){const t=()=>{if(!this._editor.hasModel()){this._ckAtEnd.set(!1);return}const n=this._editor.getModel(),o=this._editor.getSelection(),r=n.getWordAtPosition(o.getStartPosition());if(!r){this._ckAtEnd.set(!1);return}this._ckAtEnd.set(r.endColumn===o.getStartPosition().column)};this._selectionListener=this._editor.onDidChangeCursorSelection(t),t()}else this._selectionListener&&(this._ckAtEnd.reset(),this._selectionListener.dispose(),this._selectionListener=void 0)}};jk.AtEnd=new lt("atEndOfWord",!1);jk=oU=iyt([oyt(1,Ut)],jk);var ryt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},syt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},OL;let bb=OL=class{constructor(e,t){this._editor=e,this._index=0,this._ckOtherSuggestions=OL.OtherSuggestions.bindTo(t)}dispose(){this.reset()}reset(){var e;this._ckOtherSuggestions.reset(),(e=this._listener)===null||e===void 0||e.dispose(),this._model=void 0,this._acceptNext=void 0,this._ignore=!1}set({model:e,index:t},n){if(e.items.length===0){this.reset();return}if(OL._moveIndex(!0,e,t)===t){this.reset();return}this._acceptNext=n,this._model=e,this._index=t,this._listener=this._editor.onDidChangeCursorPosition(()=>{this._ignore||this.reset()}),this._ckOtherSuggestions.set(!0)}static _moveIndex(e,t,n){let o=n;for(let r=t.items.length;r>0&&(o=(o+t.items.length+(e?1:-1))%t.items.length,!(o===n||!t.items[o].completion.additionalTextEdits));r--);return o}next(){this._move(!0)}prev(){this._move(!1)}_move(e){if(!!this._model)try{this._ignore=!0,this._index=OL._moveIndex(e,this._model,this._index),this._acceptNext({index:this._index,item:this._model.items[this._index],model:this._model})}finally{this._ignore=!1}}};bb.OtherSuggestions=new lt("hasOtherSuggestions",!1);bb=OL=ryt([syt(1,Ut)],bb);class ayt{constructor(e,t,n,o){this._disposables=new Be,this._disposables.add(n.onDidSuggest(r=>{r.completionModel.items.length===0&&this.reset()})),this._disposables.add(n.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()&&n.state!==0){const s=r.charCodeAt(r.length-1);this._active.acceptCharacters.has(s)&&e.getOption(0)&&o(this._active.item)}}))}_onItem(e){if(!e||!ws(e.item.completion.commitCharacters)){this.reset();return}if(this._active&&this._active.item.item===e.item)return;const t=new XA;for(const n of e.item.completion.commitCharacters)n.length>0&&t.add(n.charCodeAt(0));this._active={acceptCharacters:t,item:e}}reset(){this._active=void 0}dispose(){this._disposables.dispose()}}var lyt=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};class Nl{provideSelectionRanges(e,t){return lyt(this,void 0,void 0,function*(){const n=[];for(const o of t){const r=[];n.push(r);const s=new Map;yield new Promise(a=>Nl._bracketsRightYield(a,0,e,o,s)),yield new Promise(a=>Nl._bracketsLeftYield(a,0,e,o,s,r))}return n})}static _bracketsRightYield(e,t,n,o,r){const s=new Map,a=Date.now();for(;;){if(t>=Nl._maxRounds){e();break}if(!o){e();break}const l=n.bracketPairs.findNextBracket(o);if(!l){e();break}if(Date.now()-a>Nl._maxDuration){setTimeout(()=>Nl._bracketsRightYield(e,t+1,n,o,r));break}if(l.bracketInfo.isOpeningBracket){const u=l.bracketInfo.bracketText,d=s.has(u)?s.get(u):0;s.set(u,d+1)}else{const u=l.bracketInfo.getOpeningBrackets()[0].bracketText;let d=s.has(u)?s.get(u):0;if(d-=1,s.set(u,Math.max(0,d)),d<0){let h=r.get(u);h||(h=new ia,r.set(u,h)),h.push(l.range)}}o=l.range.getEndPosition()}}static _bracketsLeftYield(e,t,n,o,r,s){const a=new Map,l=Date.now();for(;;){if(t>=Nl._maxRounds&&r.size===0){e();break}if(!o){e();break}const c=n.bracketPairs.findPrevBracket(o);if(!c){e();break}if(Date.now()-l>Nl._maxDuration){setTimeout(()=>Nl._bracketsLeftYield(e,t+1,n,o,r,s));break}if(c.bracketInfo.isOpeningBracket){const d=c.bracketInfo.bracketText;let h=a.has(d)?a.get(d):0;if(h-=1,a.set(d,Math.max(0,h)),h<0){const f=r.get(d);if(f){const g=f.shift();f.size===0&&r.delete(d);const p=V.fromPositions(c.range.getEndPosition(),g.getStartPosition()),v=V.fromPositions(c.range.getStartPosition(),g.getEndPosition());s.push({range:p}),s.push({range:v}),Nl._addBracketLeading(n,v,s)}}}else{const d=c.bracketInfo.getOpeningBrackets()[0].bracketText,h=a.has(d)?a.get(d):0;a.set(d,h+1)}o=c.range.getStartPosition()}}static _addBracketLeading(e,t,n){if(t.startLineNumber===t.endLineNumber)return;const o=t.startLineNumber,r=e.getLineFirstNonWhitespaceColumn(o);r!==0&&r!==t.startColumn&&(n.push({range:V.fromPositions(new ae(o,r),t.getEndPosition())}),n.push({range:V.fromPositions(new ae(o,1),t.getEndPosition())}));const s=o-1;if(s>0){const a=e.getLineFirstNonWhitespaceColumn(s);a===t.startColumn&&a!==e.getLineLastNonWhitespaceColumn(s)&&(n.push({range:V.fromPositions(new ae(s,a),t.getEndPosition())}),n.push({range:V.fromPositions(new ae(s,1),t.getEndPosition())}))}}}Nl._maxDuration=30;Nl._maxRounds=2;var cyt=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};class Sd{static create(e,t){return cyt(this,void 0,void 0,function*(){if(!t.getOption(117).localityBonus||!t.hasModel())return Sd.None;const n=t.getModel(),o=t.getPosition();if(!e.canComputeWordRanges(n.uri))return Sd.None;const[r]=yield new Nl().provideSelectionRanges(n,[o]);if(r.length===0)return Sd.None;const s=yield e.computeWordRanges(n.uri,r[0].range);if(!s)return Sd.None;const a=n.getWordUntilPosition(o);return delete s[a.word],new class extends Sd{distance(l,c){if(!o.equals(t.getPosition()))return 0;if(c.kind===17)return 2<<20;const u=typeof c.label=="string"?c.label:c.label.label,d=s[u];if(Jve(d))return 2<<20;const h=xD(d,V.fromPositions(l),V.compareRangesUsingStarts),f=h>=0?d[h]:d[Math.max(0,~h-1)];let g=r.length;for(const p of r){if(!V.containsRange(p.range,f))break;g-=1}return g}}})}}Sd.None=new class extends Sd{distance(){return 0}};class Tce{constructor(e,t){this.leadingLineContent=e,this.characterCountDelta=t}}class um{constructor(e,t,n,o,r,s,a=N5.default,l=void 0){this.clipboardText=l,this._snippetCompareFn=um._compareCompletionItems,this._items=e,this._column=t,this._wordDistance=o,this._options=r,this._refilterKind=1,this._lineContext=n,this._fuzzyScoreOptions=a,s==="top"?this._snippetCompareFn=um._compareCompletionItemsSnippetsUp:s==="bottom"&&(this._snippetCompareFn=um._compareCompletionItemsSnippetsDown)}get lineContext(){return this._lineContext}set lineContext(e){(this._lineContext.leadingLineContent!==e.leadingLineContent||this._lineContext.characterCountDelta!==e.characterCountDelta)&&(this._refilterKind=this._lineContext.characterCountDelta0&&n[0].container.incomplete&&e.add(t);return e}get stats(){return this._ensureCachedState(),this._stats}_ensureCachedState(){this._refilterKind!==0&&this._createCachedState()}_createCachedState(){this._itemsByProvider=new Map;const e=[],{leadingLineContent:t,characterCountDelta:n}=this._lineContext;let o="",r="";const s=this._refilterKind===1?this._items:this._filteredItems,a=[],l=!this._options.filterGraceful||s.length>2e3?ib:Cut;for(let c=0;c=f)u.score=$d.Default;else if(typeof u.completion.filterText=="string"){const p=l(o,r,g,u.completion.filterText,u.filterTextLow,0,this._fuzzyScoreOptions);if(!p)continue;PV(u.completion.filterText,u.textLabel)===0?u.score=p:(u.score=mut(o,r,g,u.textLabel,u.labelLow,0),u.score[0]=p[0])}else{const p=l(o,r,g,u.textLabel,u.labelLow,0,this._fuzzyScoreOptions);if(!p)continue;u.score=p}}u.idx=c,u.distance=this._wordDistance.distance(u.position,u.completion),a.push(u),e.push(u.textLabel.length)}this._filteredItems=a.sort(this._snippetCompareFn),this._refilterKind=0,this._stats={pLabelLen:e.length?VW(e.length-.85,e,(c,u)=>c-u):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===27)return 1;if(t.completion.kind===27)return-1}return um._compareCompletionItems(e,t)}static _compareCompletionItemsSnippetsUp(e,t){if(e.completion.kind!==t.completion.kind){if(e.completion.kind===27)return-1;if(t.completion.kind===27)return 1}return um._compareCompletionItems(e,t)}}var uyt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Hp=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},dyt=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},rU;class y_{static shouldAutoTrigger(e){if(!e.hasModel())return!1;const t=e.getModel(),n=e.getPosition();t.tokenization.tokenizeIfCheap(n.lineNumber);const o=t.getWordAtPosition(n);return!(!o||o.endColumn!==n.column&&o.startColumn+1!==n.column||!isNaN(Number(o.word)))}constructor(e,t,n){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=n}}function hyt(i,e,t){if(!Boolean(e.getContextKeyValue(Dr.inlineSuggestionVisible.key)))return!0;const n=e.getContextKeyValue(Dr.suppressSuggestions.key);return n!==void 0?!n:!i.getOption(62).suppressSuggestions}function fyt(i,e,t){if(!Boolean(e.getContextKeyValue("inlineSuggestionVisible")))return!0;const n=e.getContextKeyValue(Dr.suppressSuggestions.key);return n!==void 0?!n:!i.getOption(62).suppressSuggestions}let sU=rU=class{constructor(e,t,n,o,r,s,a,l,c){this._editor=e,this._editorWorkerService=t,this._clipboardService=n,this._telemetryService=o,this._logService=r,this._contextKeyService=s,this._configurationService=a,this._languageFeaturesService=l,this._envService=c,this._toDispose=new Be,this._triggerCharacterListener=new Be,this._triggerQuickSuggest=new $u,this._triggerState=void 0,this._completionDisposables=new Be,this._onDidCancel=new le,this._onDidTrigger=new le,this._onDidSuggest=new le,this.onDidCancel=this._onDidCancel.event,this.onDidTrigger=this._onDidTrigger.event,this.onDidSuggest=this._onDidSuggest.event,this._telemetryGate=0,this._currentSelection=this._editor.getSelection()||new gt(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 u=!1;this._toDispose.add(this._editor.onDidCompositionStart(()=>{u=!0})),this._toDispose.add(this._editor.onDidCompositionEnd(()=>{u=!1,this._onCompositionEnd()})),this._toDispose.add(this._editor.onDidChangeCursorSelection(d=>{u||this._onCursorChange(d)})),this._toDispose.add(this._editor.onDidChangeModelContent(()=>{!u&&this._triggerState!==void 0&&this._refilterCompletionItems()})),this._updateTriggerCharacters()}dispose(){si(this._triggerCharacterListener),si([this._onDidCancel,this._onDidSuggest,this._onDidTrigger,this._triggerQuickSuggest]),this._toDispose.dispose(),this._completionDisposables.dispose(),this.cancel()}_updateTriggerCharacters(){if(this._triggerCharacterListener.clear(),this._editor.getOption(90)||!this._editor.hasModel()||!this._editor.getOption(120))return;const e=new Map;for(const n of this._languageFeaturesService.completionProvider.all(this._editor.getModel()))for(const o of n.triggerCharacters||[]){let r=e.get(o);r||(r=new Set,r.add($wt()),e.set(o,r)),r.add(n)}const t=n=>{var o;if(!fyt(this._editor,this._contextKeyService,this._configurationService)||y_.shouldAutoTrigger(this._editor))return;if(!n){const a=this._editor.getPosition();n=this._editor.getModel().getLineContent(a.lineNumber).substr(0,a.column-1)}let r="";Y0(n.charCodeAt(n.length-1))?fr(n.charCodeAt(n.length-2))&&(r=n.substr(n.length-2)):r=n.charAt(n.length-1);const s=e.get(r);if(s){const a=new Map;if(this._completionModel)for(const[l,c]of this._completionModel.getItemsByProvider())s.has(l)||a.set(l,c);this.trigger({auto:!0,triggerKind:1,triggerCharacter:r,retrigger:Boolean(this._completionModel),clipboardText:(o=this._completionModel)===null||o===void 0?void 0:o.clipboardText,completionOptions:{providerFilter:s,providerItemsToReuse:a}})}};this._triggerCharacterListener.add(this._editor.onDidType(t)),this._triggerCharacterListener.add(this._editor.onDidCompositionEnd(()=>t()))}get state(){return this._triggerState?this._triggerState.auto?2:1:0}cancel(e=!1){var t;this._triggerState!==void 0&&(this._triggerQuickSuggest.cancel(),(t=this._requestToken)===null||t===void 0||t.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!==0&&e.reason!==3||e.source!=="keyboard"&&e.source!=="deleteLeft"){this.cancel();return}this._triggerState===void 0&&e.reason===0?(t.containsRange(this._currentSelection)||t.getEndPosition().isBeforeOrEqual(this._currentSelection.getPosition()))&&this._doTriggerQuickSuggest():this._triggerState!==void 0&&e.reason===3&&this._refilterCompletionItems()}_onCompositionEnd(){this._triggerState===void 0?this._doTriggerQuickSuggest():this._refilterCompletionItems()}_doTriggerQuickSuggest(){var e;ZC.isAllOff(this._editor.getOption(88))||this._editor.getOption(117).snippetsPreventQuickSuggestions&&((e=qr.get(this._editor))===null||e===void 0?void 0:e.isInSnippet())||(this.cancel(),this._triggerQuickSuggest.cancelAndSet(()=>{if(this._triggerState!==void 0||!y_.shouldAutoTrigger(this._editor)||!this._editor.hasModel()||!this._editor.hasWidgetFocus())return;const t=this._editor.getModel(),n=this._editor.getPosition(),o=this._editor.getOption(88);if(!ZC.isAllOff(o)){if(!ZC.isAllOn(o)){t.tokenization.tokenizeIfCheap(n.lineNumber);const r=t.tokenization.getLineTokens(n.lineNumber),s=r.getStandardTokenType(r.findTokenIndexAtOffset(Math.max(n.column-1-1,0)));if(ZC.valueFor(o,s)!=="on")return}!hyt(this._editor,this._contextKeyService,this._configurationService)||!this._languageFeaturesService.completionProvider.has(t)||this.trigger({auto:!0})}},this._editor.getOption(89)))}_refilterCompletionItems(){fi(this._editor.hasModel()),fi(this._triggerState!==void 0);const e=this._editor.getModel(),t=this._editor.getPosition(),n=new y_(e,t,Object.assign(Object.assign({},this._triggerState),{refilter:!0}));this._onNewContext(n)}trigger(e){var t,n,o,r,s,a;if(!this._editor.hasModel())return;const l=this._editor.getModel(),c=new y_(l,this._editor.getPosition(),e);this.cancel(e.retrigger),this._triggerState=e,this._onDidTrigger.fire({auto:e.auto,shy:(t=e.shy)!==null&&t!==void 0?t:!1,position:this._editor.getPosition()}),this._context=c;let u={triggerKind:(n=e.triggerKind)!==null&&n!==void 0?n:0};e.triggerCharacter&&(u={triggerKind:1,triggerCharacter:e.triggerCharacter}),this._requestToken=new Ro;const d=this._editor.getOption(111);let h=1;switch(d){case"top":h=0;break;case"bottom":h=2;break}const{itemKind:f,showDeprecated:g}=rU._createSuggestFilter(this._editor),p=new zk(h,(r=(o=e.completionOptions)===null||o===void 0?void 0:o.kindFilter)!==null&&r!==void 0?r:f,(s=e.completionOptions)===null||s===void 0?void 0:s.providerFilter,(a=e.completionOptions)===null||a===void 0?void 0:a.providerItemsToReuse,g),v=Sd.create(this._editorWorkerService,this._editor),m=LY(this._languageFeaturesService.completionProvider,l,this._editor.getPosition(),p,u,this._requestToken.token);Promise.all([m,v]).then(([_,w])=>dyt(this,void 0,void 0,function*(){var y;if((y=this._requestToken)===null||y===void 0||y.dispose(),!this._editor.hasModel())return;let L=e==null?void 0:e.clipboardText;if(!L&&_.needsClipboard&&(L=yield this._clipboardService.readText()),this._triggerState===void 0)return;const D=this._editor.getModel(),E=new y_(D,this._editor.getPosition(),e),I=Object.assign(Object.assign({},N5.default),{firstMatchCanBeWeak:!this._editor.getOption(117).matchOnWordStartOnly});if(this._completionModel=new um(_.items,this._context.column,{leadingLineContent:E.leadingLineContent,characterCountDelta:E.column-this._context.column},w,this._editor.getOption(117),this._editor.getOption(111),I,L),this._completionDisposables.add(_.disposable),this._onNewContext(E),this._reportDurationsTelemetry(_.durations),!this._envService.isBuilt||this._envService.isExtensionDevelopment)for(const k of _.items)k.isInvalid&&this._logService.warn(`[suggest] did IGNORE invalid completion item from ${k.provider._debugDisplayName}`,k.completion)})).catch(en)}_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(111)==="none"&&t.add(27);const o=e.getOption(117);return o.showMethods||t.add(0),o.showFunctions||t.add(1),o.showConstructors||t.add(2),o.showFields||t.add(3),o.showVariables||t.add(4),o.showClasses||t.add(5),o.showStructs||t.add(6),o.showInterfaces||t.add(7),o.showModules||t.add(8),o.showProperties||t.add(9),o.showEvents||t.add(10),o.showOperators||t.add(11),o.showUnits||t.add(12),o.showValues||t.add(13),o.showConstants||t.add(14),o.showEnums||t.add(15),o.showEnumMembers||t.add(16),o.showKeywords||t.add(17),o.showWords||t.add(18),o.showColors||t.add(19),o.showFiles||t.add(20),o.showReferences||t.add(21),o.showColors||t.add(22),o.showFolders||t.add(23),o.showTypeParameters||t.add(24),o.showSnippets||t.add(27),o.showUsers||t.add(25),o.showIssues||t.add(26),{itemKind:t,showDeprecated:o.showDeprecated}}_onNewContext(e){if(!!this._context){if(e.lineNumber!==this._context.lineNumber){this.cancel();return}if(Si(e.leadingLineContent)!==Si(this._context.leadingLineContent)){this.cancel();return}if(e.columnthis._context.leadingWord.startColumn){if(y_.shouldAutoTrigger(this._editor)&&this._context){const n=this._completionModel.getItemsByProvider();this.trigger({auto:this._context.triggerOptions.auto,retrigger:!0,clipboardText:this._completionModel.clipboardText,completionOptions:{providerItemsToReuse:n}})}return}if(e.column>this._context.column&&this._completionModel.getIncompleteProvider().size>0&&e.leadingWord.word.length!==0){const t=new Map,n=new Set;for(const[o,r]of this._completionModel.getItemsByProvider())r.length>0&&r[0].container.incomplete?n.add(o):t.set(o,r);this.trigger({auto:this._context.triggerOptions.auto,triggerKind:2,retrigger:!0,clipboardText:this._completionModel.clipboardText,completionOptions:{providerFilter:n,providerItemsToReuse:t}})}else{const t=this._completionModel.lineContext;let n=!1;if(this._completionModel.lineContext={leadingLineContent:e.leadingLineContent,characterCountDelta:e.column-this._context.column},this._completionModel.items.length===0){const o=y_.shouldAutoTrigger(this._editor);if(!this._context){this.cancel();return}if(o&&this._context.leadingWord.endColumn0,n&&e.leadingWord.word.length===0){this.cancel();return}}this._onDidSuggest.fire({completionModel:this._completionModel,triggerOptions:e.triggerOptions,isFrozen:n})}}}}};sU=rU=uyt([Hp(1,Gu),Hp(2,bp),Hp(3,ec),Hp(4,tc),Hp(5,Ut),Hp(6,En),Hp(7,pt),Hp(8,GG)],sU);class IF{constructor(e,t){this._disposables=new Be,this._lastOvertyped=[],this._locked=!1,this._disposables.add(e.onWillType(()=>{if(this._locked||!e.hasModel())return;const n=e.getSelections(),o=n.length;let r=!1;for(let a=0;aIF._maxSelectionLength)return;this._lastOvertyped[a]={value:s.getValueInRange(l),multiline:l.startLineNumber!==l.endLineNumber}}})),this._disposables.add(t.onDidTrigger(n=>{this._locked=!0})),this._disposables.add(t.onDidCancel(n=>{this._locked=!1}))}getLastOvertypedInfo(e){if(e>=0&&e=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},p7=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};class kY extends ob{updateLabel(){const e=this._keybindingService.lookupKeybinding(this._action.id,this._contextKeyService);if(!e)return super.updateLabel();this.label&&(this.label.textContent=C({key:"content",comment:["A label","A keybinding"]},"{0} ({1})",this._action.label,kY.symbolPrintEnter(e)))}static symbolPrintEnter(e){var t;return(t=e.getLabel())===null||t===void 0?void 0:t.replace(/\benter\b/gi,"\u23CE")}}let aU=class{constructor(e,t,n,o,r){this._menuId=t,this._menuService=o,this._contextKeyService=r,this._menuDisposables=new Be,this.element=Ae(e,He(".suggest-status-bar"));const s=a=>a instanceof Ou?n.createInstance(kY,a,void 0):void 0;this._leftActions=new $c(this.element,{actionViewItemProvider:s}),this._rightActions=new $c(this.element,{actionViewItemProvider:s}),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 n=[],o=[];for(const[r,s]of e.getActions())r==="left"?n.push(...s):o.push(...s);this._leftActions.clear(),this._leftActions.push(n),this._rightActions.clear(),this._rightActions.push(o)};this._menuDisposables.add(e.onDidChange(()=>t())),this._menuDisposables.add(e)}hide(){this._menuDisposables.clear()}};aU=gyt([p7(2,$t),p7(3,If),p7(4,Ut)],aU);var pyt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},myt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};function IY(i){return!!i&&Boolean(i.completion.documentation||i.completion.detail&&i.completion.detail!==i.completion.label)}let lU=class{constructor(e,t){this._editor=e,this._onDidClose=new le,this.onDidClose=this._onDidClose.event,this._onDidChangeContents=new le,this.onDidChangeContents=this._onDidChangeContents.event,this._disposables=new Be,this._renderDisposeable=new Be,this._borderWidth=1,this._size=new jn(330,0),this.domNode=He(".suggest-details"),this.domNode.classList.add("no-docs"),this._markdownRenderer=t.createInstance(cp,{editor:e}),this._body=He(".body"),this._scrollbar=new GI(this._body,{alwaysConsumeMouseWheel:!0}),Ae(this.domNode,this._scrollbar.getDomNode()),this._disposables.add(this._scrollbar),this._header=Ae(this._body,He(".header")),this._close=Ae(this._header,He("span"+Mt.asCSSSelector(Xe.close))),this._close.title=C("details.close","Close"),this._type=Ae(this._header,He("p.type")),this._docs=Ae(this._body,He("p.docs")),this._configureFont(),this._disposables.add(this._editor.onDidChangeConfiguration(n=>{n.hasChanged(50)&&this._configureFont()}))}dispose(){this._disposables.dispose(),this._renderDisposeable.dispose()}_configureFont(){const e=this._editor.getOptions(),t=e.get(50),n=t.getMassagedFontFamily(),o=e.get(118)||t.fontSize,r=e.get(119)||t.lineHeight,s=t.fontWeight,a=`${o}px`,l=`${r}px`;this.domNode.style.fontSize=a,this.domNode.style.lineHeight=`${r/o}`,this.domNode.style.fontWeight=s,this.domNode.style.fontFeatureSettings=t.fontFeatureSettings,this._type.style.fontFamily=n,this._close.style.height=l,this._close.style.width=l}getLayoutInfo(){const e=this._editor.getOption(119)||this._editor.getOption(50).lineHeight,t=this._borderWidth,n=t*2;return{lineHeight:e,borderWidth:t,borderHeight:n,verticalPadding:22,horizontalPadding:14}}renderLoading(){this._type.textContent=C("loading","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){var n,o;this._renderDisposeable.clear();let{detail:r,documentation:s}=e.completion;if(t){let a="";a+=`score: ${e.score[0]} +`)}withRange(e){return new LO(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()})}}function Oyt(i,e){const t=e.getWordAtPosition(i),n=e.getLineMaxColumn(i.lineNumber);return t?new V(i.lineNumber,t.startColumn,i.lineNumber,n):V.fromPositions(i,i.with(void 0,n))}function wce(i,e,t,n){const r=t.getLineContent(e.lineNumber).substring(0,e.column-1)+i,s=t.tokenization.tokenizeLineWithEdit(e,r.length-(e.column-1),i),a=s==null?void 0:s.sliceAndInflate(e.column-1,r.length,0);return a?Nyt(a,n):i}class Xw{constructor(e,t){this.range=e,this.text=t}removeCommonPrefix(e,t){const n=t?this.range.intersectRanges(t):this.range;if(!n)return this;const o=e.getValueInRange(n,1),r=Y0(o,this.text),s=tU(this.range.getStartPosition(),nU(o.substring(0,r))),a=this.text.substring(r),l=V.fromPositions(s,this.range.getEndPosition());return new Xw(l,a)}augments(e){return this.text.startsWith(e.text)&&Fyt(this.range,e.range)}computeGhostText(e,t,n,o=0){let r=this.removeCommonPrefix(e);if(r.range.endLineNumber!==r.range.startLineNumber)return;const s=e.getLineContent(r.range.startLineNumber),a=Si(s).length;if(r.range.startColumn-1<=a){const g=Si(r.text).length,p=s.substring(r.range.startColumn-1,a),[v,m]=[r.range.getStartPosition(),r.range.getEndPosition()],_=v.column+p.length<=m.column?v.delta(0,p.length):m,y=V.fromPositions(_,m),w=r.text.startsWith(p)?r.text.substring(p.length):r.text.substring(g);r=new Xw(y,w)}const c=e.getValueInRange(r.range),u=Byt(c,r.text);if(!u)return;const d=r.range.startLineNumber,h=new Array;if(t==="prefix"){const g=u.filter(p=>p.originalLength===0);if(g.length>1||g.length===1&&g[0].originalStart!==c.length)return}const f=r.text.length-o;for(const g of u){const p=r.range.startColumn+g.originalStart+g.originalLength;if(t==="subwordSmart"&&n&&n.lineNumber===r.range.startLineNumber&&p0)return;if(g.modifiedLength===0)continue;const v=g.modifiedStart+g.modifiedLength,m=Math.max(g.modifiedStart,Math.min(v,f)),_=r.text.substring(g.modifiedStart,m),y=r.text.substring(m,Math.max(g.modifiedStart,v));if(_.length>0){const w=gf(_);h.push(new iU(p,w,!1))}if(y.length>0){const w=gf(y);h.push(new iU(p,w,!0))}}return new xO(d,h)}}function Fyt(i,e){return e.getStartPosition().equals(i.getStartPosition())&&e.getEndPosition().isBeforeOrEqual(i.getEndPosition())}let bh;function Byt(i,e){if((bh==null?void 0:bh.originalValue)===i&&(bh==null?void 0:bh.newValue)===e)return bh==null?void 0:bh.changes;{let t=xce(i,e,!0);if(t){const n=Sce(t);if(n>0){const o=xce(i,e,!1);o&&Sce(o)5e3||e.length>5e3)return;function n(c){let u=0;for(let d=0,h=c.length;du&&(u=f)}return u}const o=Math.max(n(i),n(e));function r(c){if(c<0)throw new Error("unexpected");return o+c+1}function s(c){let u=0,d=0;const h=new Int32Array(c.length);for(let f=0,g=c.length;fa},{getElements:()=>l}).ComputeDiff(!1).changes}var Wyt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Lce=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},Vyt=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};let sU=class extends _e{constructor(e,t,n,o,r){super(),this.textModel=e,this.versionId=t,this._debounceValue=n,this.languageFeaturesService=o,this.languageConfigurationService=r,this._updateOperation=this._register(new Kr),this.inlineCompletions=JP("inlineCompletions",void 0),this.suggestWidgetInlineCompletions=JP("suggestWidgetInlineCompletions",void 0),this._register(this.textModel.onDidChangeContent(()=>{this._updateOperation.clear()}))}fetch(e,t,n){var o,r;const s=new $yt(e,t,this.textModel.getVersionId()),a=t.selectedSuggestionInfo?this.suggestWidgetInlineCompletions:this.inlineCompletions;if(!((o=this._updateOperation.value)===null||o===void 0)&&o.request.satisfies(s))return this._updateOperation.value.promise;if(!((r=a.get())===null||r===void 0)&&r.request.satisfies(s))return Promise.resolve(!0);const l=!!this._updateOperation.value;this._updateOperation.clear();const c=new Ro,u=(()=>Vyt(this,void 0,void 0,function*(){if((l||t.triggerKind===jg.Automatic)&&(yield Hyt(this._debounceValue.get(this.textModel))),c.token.isCancellationRequested||this.textModel.getVersionId()!==s.versionId)return!1;const f=new Date,g=yield Myt(this.languageFeaturesService.inlineCompletionsProvider,e,this.textModel,t,c.token,this.languageConfigurationService);if(c.token.isCancellationRequested||this.textModel.getVersionId()!==s.versionId)return!1;const p=new Date;this._debounceValue.update(this.textModel,p.getTime()-f.getTime());const v=new jyt(g,s,this.textModel,this.versionId);if(n){const m=n.toInlineCompletion(void 0);n.canBeReused(this.textModel,e)&&!g.has(m)&&v.prepend(n.inlineCompletion,m.range,!0)}return this._updateOperation.clear(),qi(m=>{a.set(v,m)}),!0}))(),d=new Uyt(s,c,u);return this._updateOperation.value=d,u}clear(e){this._updateOperation.clear(),this.inlineCompletions.set(void 0,e),this.suggestWidgetInlineCompletions.set(void 0,e)}clearSuggestWidgetInlineCompletions(e){var t;!((t=this._updateOperation.value)===null||t===void 0)&&t.request.context.selectedSuggestionInfo&&this._updateOperation.clear(),this.suggestWidgetInlineCompletions.set(void 0,e)}cancelUpdate(){this._updateOperation.clear()}};sU=Wyt([Lce(3,pt),Lce(4,Ti)],sU);function Hyt(i,e){return new Promise(t=>{let n;const o=setTimeout(()=>{n&&n.dispose(),t()},i);e&&(n=e.onCancellationRequested(()=>{clearTimeout(o),n&&n.dispose(),t()}))})}class $yt{constructor(e,t,n){this.position=e,this.context=t,this.versionId=n}satisfies(e){return this.position.equals(e.position)&&zyt(this.context.selectedSuggestionInfo,e.context.selectedSuggestionInfo,(t,n)=>t.equals(n))&&(e.context.triggerKind===jg.Automatic||this.context.triggerKind===jg.Explicit)&&this.versionId===e.versionId}}function zyt(i,e,t){return!i||!e?i===e:t(i,e)}class Uyt{constructor(e,t,n){this.request=e,this.cancellationTokenSource=t,this.promise=n}dispose(){this.cancellationTokenSource.cancel()}}class jyt{get inlineCompletions(){return this._inlineCompletions}constructor(e,t,n,o){this.inlineCompletionProviderResult=e,this.request=t,this.textModel=n,this.versionId=o,this._refCount=1,this._prependedInlineCompletionItems=[],this._rangeVersionIdValue=0,this._rangeVersionId=In(this,s=>{this.versionId.read(s);let a=!1;for(const l of this._inlineCompletions)a=a||l._updateRange(this.textModel);return a&&this._rangeVersionIdValue++,this._rangeVersionIdValue});const r=n.deltaDecorations([],e.completions.map(s=>({range:s.range,options:{description:"inline-completion-tracking-range"}})));this._inlineCompletions=e.completions.map((s,a)=>new Ece(s,r[a],this._rangeVersionId))}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,n){n&&e.source.addRef();const o=this.textModel.deltaDecorations([],[{range:t,options:{description:"inline-completion-tracking-range"}}])[0];this._inlineCompletions.unshift(new Ece(e,o,this._rangeVersionId,t)),this._prependedInlineCompletionItems.push(e)}}class Ece{get forwardStable(){var e;return(e=this.inlineCompletion.source.inlineCompletions.enableForwardStability)!==null&&e!==void 0?e:!1}constructor(e,t,n,o){this.inlineCompletion=e,this.decorationId=t,this.rangeVersion=n,this.semanticId=JSON.stringify([this.inlineCompletion.filterText,this.inlineCompletion.insertText,this.inlineCompletion.range.getStartPosition().toString()]),this._isValid=!0,this._updatedRange=o!=null?o:e.range}toInlineCompletion(e){return this.inlineCompletion.withRange(this._getUpdatedRange(e))}toSingleTextEdit(e){return new Xw(this._getUpdatedRange(e),this.inlineCompletion.insertText)}isVisible(e,t,n){const o=this._toFilterTextReplacement(n).removeCommonPrefix(e);if(!this._isValid||!this.inlineCompletion.range.getStartPosition().equals(this._getUpdatedRange(n).getStartPosition())||t.lineNumber!==o.range.startLineNumber)return!1;const r=e.getValueInRange(o.range,1).toLowerCase(),s=o.text.toLowerCase(),a=Math.max(0,t.column-o.range.startColumn);let l=s.substring(0,a),c=s.substring(a),u=r.substring(0,a),d=r.substring(a);const h=e.getLineIndentColumn(o.range.startLineNumber);return o.range.startColumn<=h&&(u=u.trimStart(),u.length===0&&(d=d.trimStart()),l=l.trimStart(),l.length===0&&(c=c.trimStart())),l.startsWith(u)&&!!I1e(d,c)}canBeReused(e,t){return this._isValid&&this._getUpdatedRange(void 0).containsPosition(t)&&this.isVisible(e,t,void 0)&&!this._isSmallerThanOriginal(void 0)}_toFilterTextReplacement(e){return new Xw(this._getUpdatedRange(e),this.inlineCompletion.filterText)}_isSmallerThanOriginal(e){return Dce(this._getUpdatedRange(e)).isBefore(Dce(this.inlineCompletion.range))}_getUpdatedRange(e){return this.rangeVersion.read(e),this._updatedRange}_updateRange(e){const t=e.getDecorationRange(this.decorationId);return t?this._updatedRange.equalsRange(t)?!1:(this._updatedRange=t,!0):(this._isValid=!1,!0)}}function Dce(i){return i.startLineNumber===i.endLineNumber?new ae(1,1+i.endColumn-i.startColumn):new ae(1+i.endLineNumber-i.startLineNumber,i.endColumn)}var ME=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};const sn={Visible:SY,HasFocusedSuggestion:new lt("suggestWidgetHasFocusedSuggestion",!1,C("suggestWidgetHasSelection","Whether any suggestion is focused")),DetailsVisible:new lt("suggestWidgetDetailsVisible",!1,C("suggestWidgetDetailsVisible","Whether suggestion details are visible")),MultipleSuggestions:new lt("suggestWidgetMultipleSuggestions",!1,C("suggestWidgetMultipleSuggestions","Whether there are multiple suggestions to pick from")),MakesTextEdit:new lt("suggestionMakesTextEdit",!0,C("suggestionMakesTextEdit","Whether inserting the current suggestion yields in a change or has everything already been typed")),AcceptSuggestionsOnEnter:new lt("acceptSuggestionOnEnter",!0,C("acceptSuggestionOnEnter","Whether suggestions are inserted when pressing Enter")),HasInsertAndReplaceRange:new lt("suggestionHasInsertAndReplaceRange",!1,C("suggestionHasInsertAndReplaceRange","Whether the current suggestion has insert and replace behaviour")),InsertMode:new lt("suggestionInsertMode",void 0,{type:"string",description:C("suggestionInsertMode","Whether the default behaviour is to insert or replace")}),CanResolve:new lt("suggestionCanResolve",!1,C("suggestionCanResolve","Whether the current suggestion supports to resolve further details"))},rv=new Z("suggestWidgetStatusBar");class Kyt{constructor(e,t,n,o){var r;this.position=e,this.completion=t,this.container=n,this.provider=o,this.isInvalid=!1,this.score=$d.Default,this.distance=0,this.textLabel=typeof t.label=="string"?t.label:(r=t.label)===null||r===void 0?void 0:r.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,V.isIRange(t.range)?(this.editStart=new ae(t.range.startLineNumber,t.range.startColumn),this.editInsertEnd=new ae(t.range.endLineNumber,t.range.endColumn),this.editReplaceEnd=new ae(t.range.endLineNumber,t.range.endColumn),this.isInvalid=this.isInvalid||V.spansMultipleLines(t.range)||t.range.startLineNumber!==e.lineNumber):(this.editStart=new ae(t.range.insert.startLineNumber,t.range.insert.startColumn),this.editInsertEnd=new ae(t.range.insert.endLineNumber,t.range.insert.endColumn),this.editReplaceEnd=new ae(t.range.replace.endLineNumber,t.range.replace.endColumn),this.isInvalid=this.isInvalid||V.spansMultipleLines(t.range.insert)||V.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 o.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}resolve(e){return ME(this,void 0,void 0,function*(){if(!this._resolveCache){const t=e.onCancellationRequested(()=>{this._resolveCache=void 0,this._resolveDuration=void 0}),n=new Ls(!0);this._resolveCache=Promise.resolve(this.provider.resolveCompletionItem(this.completion,e)).then(o=>{Object.assign(this.completion,o),this._resolveDuration=n.elapsed()},o=>{sh(o)&&(this._resolveCache=void 0,this._resolveDuration=void 0)}).finally(()=>{t.dispose()})}return this._resolveCache})}}class zk{constructor(e=2,t=new Set,n=new Set,o=new Map,r=!0){this.snippetSortOrder=e,this.kindFilter=t,this.providerFilter=n,this.providerItemsToReuse=o,this.showDeprecated=r}}zk.default=new zk;let qyt;function Gyt(){return qyt}class Xyt{constructor(e,t,n,o){this.items=e,this.needsClipboard=t,this.durations=n,this.disposable=o}}function RY(i,e,t,n=zk.default,o={triggerKind:0},r=_n.None){return ME(this,void 0,void 0,function*(){const s=new Ls;t=t.clone();const a=e.getWordAtPosition(t),l=a?new V(t.lineNumber,a.startColumn,t.lineNumber,a.endColumn):V.fromPositions(t),c={replace:l,insert:l.setEndPosition(t.lineNumber,t.column)},u=[],d=new Be,h=[];let f=!1;const g=(v,m,_)=>{var y,w,L;let D=!1;if(!m)return D;for(const E of m.suggestions)if(!n.kindFilter.has(E.kind)){if(!n.showDeprecated&&((y=E==null?void 0:E.tags)===null||y===void 0?void 0:y.includes(1)))continue;E.range||(E.range=c),E.sortText||(E.sortText=typeof E.label=="string"?E.label:E.label.label),!f&&E.insertTextRules&&E.insertTextRules&4&&(f=Gw.guessNeedsClipboard(E.insertText)),u.push(new Kyt(t,E,m,v)),D=!0}return Wq(m)&&d.add(m),h.push({providerName:(w=v._debugDisplayName)!==null&&w!==void 0?w:"unknown_provider",elapsedProvider:(L=m.duration)!==null&&L!==void 0?L:-1,elapsedOverall:_.elapsed()}),D},p=(()=>ME(this,void 0,void 0,function*(){}))();for(const v of i.orderedGroups(e)){let m=!1;if(yield Promise.all(v.map(_=>ME(this,void 0,void 0,function*(){if(n.providerItemsToReuse.has(_)){const y=n.providerItemsToReuse.get(_);y.forEach(w=>u.push(w)),m=m||y.length>0;return}if(!(n.providerFilter.size>0&&!n.providerFilter.has(_)))try{const y=new Ls,w=yield _.provideCompletionItems(e,t,o,r);m=g(_,w,y)||m}catch(y){$o(y)}}))),m||r.isCancellationRequested)break}return yield p,r.isCancellationRequested?(d.dispose(),Promise.reject(new Gv)):new Xyt(u.sort(Qyt(n.snippetSortOrder)),f,{entries:h,elapsed:s.elapsed()},d)})}function MY(i,e){if(i.sortTextLow&&e.sortTextLow){if(i.sortTextLowe.sortTextLow)return 1}return i.textLabele.textLabel?1:i.completion.kind-e.completion.kind}function Yyt(i,e){if(i.completion.kind!==e.completion.kind){if(i.completion.kind===27)return-1;if(e.completion.kind===27)return 1}return MY(i,e)}function Zyt(i,e){if(i.completion.kind!==e.completion.kind){if(i.completion.kind===27)return 1;if(e.completion.kind===27)return-1}return MY(i,e)}const DF=new Map;DF.set(0,Yyt);DF.set(2,Zyt);DF.set(1,MY);function Qyt(i){return DF.get(i)}Rn.registerCommand("_executeCompletionItemProvider",(i,...e)=>ME(void 0,void 0,void 0,function*(){const[t,n,o,r]=e;fi(Rt.isUri(t)),fi(ae.isIPosition(n)),fi(typeof o=="string"||!o),fi(typeof r=="number"||!r);const{completionProvider:s}=i.get(pt),a=yield i.get(za).createModelReference(t);try{const l={incomplete:!1,suggestions:[]},c=[],u=a.object.textEditorModel.validatePosition(n),d=yield RY(s,a.object.textEditorModel,u,void 0,{triggerCharacter:o!=null?o:void 0,triggerKind:o?1:0});for(const h of d.items)c.length<(r!=null?r:0)&&c.push(h.resolve(_n.None)),l.incomplete=l.incomplete||h.container.incomplete,l.suggestions.push(h.completion);try{return yield Promise.all(c),l}finally{setTimeout(()=>d.disposable.dispose(),100)}}finally{a.dispose()}}));function Jyt(i,e){var t;(t=i.getContribution("editor.contrib.suggestController"))===null||t===void 0||t.triggerSuggest(new Set().add(e),void 0,!0)}class ZC{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 1:return e.comments;case 2:return e.strings;default:return e.other}}}function kce(i,e=ls){return Bst(i,e)?i.charAt(0).toUpperCase()+i.slice(1):i}var ewt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},twt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};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 Ice{constructor(e){this._delegates=e}resolve(e){for(const t of this._delegates){const n=t.resolve(e);if(n!==void 0)return n}}}class Tce{constructor(e,t,n,o){this._model=e,this._selection=t,this._selectionIdx=n,this._overtypingCapturer=o}resolve(e){const{name:t}=e;if(t==="SELECTION"||t==="TM_SELECTED_TEXT"){let n=this._model.getValueInRange(this._selection)||void 0,o=this._selection.startLineNumber!==this._selection.endLineNumber;if(!n&&this._overtypingCapturer){const r=this._overtypingCapturer.getLastOvertypedInfo(this._selectionIdx);r&&(n=r.value,o=r.multiline)}if(n&&o&&e.snippet){const r=this._model.getLineContent(this._selection.startLineNumber),s=Si(r,0,this._selection.startColumn-1);let a=s;e.snippet.walk(c=>c===e?!1:(c instanceof ta&&(a=Si(gf(c.value).pop())),!0));const l=Y0(a,s);n=n.replace(/(\r\n|\r|\n)(.*)/g,(c,u,d)=>`${u}${a.substr(l)}${d}`)}return n}else{if(t==="TM_CURRENT_LINE")return this._model.getLineContent(this._selection.positionLineNumber);if(t==="TM_CURRENT_WORD"){const n=this._model.getWordAtPosition({lineNumber:this._selection.positionLineNumber,column:this._selection.positionColumn});return n&&n.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 Nce{constructor(e,t){this._labelService=e,this._model=t}resolve(e){const{name:t}=e;if(t==="TM_FILENAME")return Km(this._model.uri.fsPath);if(t==="TM_FILENAME_BASE"){const n=Km(this._model.uri.fsPath),o=n.lastIndexOf(".");return o<=0?n:n.slice(0,o)}else{if(t==="TM_DIRECTORY")return M_e(this._model.uri.fsPath)==="."?"":this._labelService.getUriLabel(S5(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 Rce{constructor(e,t,n,o){this._readClipboardText=e,this._selectionIdx=t,this._selectionCount=n,this._spread=o}resolve(e){if(e.name!=="CLIPBOARD")return;const t=this._readClipboardText();if(!!t){if(this._spread){const n=t.split(/\r\n|\n|\r/).filter(o=>!V_e(o));if(n.length===this._selectionCount)return n[this._selectionIdx]}return t}}}let EO=class{constructor(e,t,n){this._model=e,this._selection=t,this._languageConfigurationService=n}resolve(e){const{name:t}=e,n=this._model.getLanguageIdAtPosition(this._selection.selectionStartLineNumber,this._selection.selectionStartColumn),o=this._languageConfigurationService.getLanguageConfiguration(n).comments;if(!!o){if(t==="LINE_COMMENT")return o.lineCommentToken||void 0;if(t==="BLOCK_COMMENT_START")return o.blockCommentStartToken||void 0;if(t==="BLOCK_COMMENT_END")return o.blockCommentEndToken||void 0}}};EO=ewt([twt(2,Ti)],EO);class Rd{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 Rd.dayNames[this._date.getDay()];if(t==="CURRENT_DAY_NAME_SHORT")return Rd.dayNamesShort[this._date.getDay()];if(t==="CURRENT_MONTH_NAME")return Rd.monthNames[this._date.getMonth()];if(t==="CURRENT_MONTH_NAME_SHORT")return Rd.monthNamesShort[this._date.getMonth()];if(t==="CURRENT_SECONDS_UNIX")return String(Math.floor(this._date.getTime()/1e3));if(t==="CURRENT_TIMEZONE_OFFSET"){const n=this._date.getTimezoneOffset(),o=n>0?"-":"+",r=Math.trunc(Math.abs(n/60)),s=r<10?"0"+r:r,a=Math.abs(n)-r*60,l=a<10?"0"+a:a;return o+s+":"+l}}}Rd.dayNames=[C("Sunday","Sunday"),C("Monday","Monday"),C("Tuesday","Tuesday"),C("Wednesday","Wednesday"),C("Thursday","Thursday"),C("Friday","Friday"),C("Saturday","Saturday")];Rd.dayNamesShort=[C("SundayShort","Sun"),C("MondayShort","Mon"),C("TuesdayShort","Tue"),C("WednesdayShort","Wed"),C("ThursdayShort","Thu"),C("FridayShort","Fri"),C("SaturdayShort","Sat")];Rd.monthNames=[C("January","January"),C("February","February"),C("March","March"),C("April","April"),C("May","May"),C("June","June"),C("July","July"),C("August","August"),C("September","September"),C("October","October"),C("November","November"),C("December","December")];Rd.monthNamesShort=[C("JanuaryShort","Jan"),C("FebruaryShort","Feb"),C("MarchShort","Mar"),C("AprilShort","Apr"),C("MayShort","May"),C("JuneShort","Jun"),C("JulyShort","Jul"),C("AugustShort","Aug"),C("SeptemberShort","Sep"),C("OctoberShort","Oct"),C("NovemberShort","Nov"),C("DecemberShort","Dec")];class Mce{constructor(e){this._workspaceService=e}resolve(e){if(!this._workspaceService)return;const t=Qct(this._workspaceService.getWorkspace());if(!Xct(t)){if(e.name==="WORKSPACE_NAME")return this._resolveWorkspaceName(t);if(e.name==="WORKSPACE_FOLDER")return this._resoveWorkspacePath(t)}}_resolveWorkspaceName(e){if(UH(e))return Km(e.uri.path);let t=Km(e.configPath.path);return t.endsWith(jH)&&(t=t.substr(0,t.length-jH.length-1)),t}_resoveWorkspacePath(e){if(UH(e))return kce(e.uri.fsPath);const t=Km(e.configPath.path);let n=e.configPath.fsPath;return n.endsWith(t)&&(n=n.substr(0,n.length-t.length-1)),n?kce(n):"/"}}class Ace{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 _F()}}var nwt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},iwt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},ld;class bc{constructor(e,t,n){this._editor=e,this._snippet=t,this._snippetLineLeadingWhitespace=n,this._offset=-1,this._nestingLevel=1,this._placeholderGroups=eoe(t.placeholders,yc.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 n of this._snippet.placeholders){const o=this._snippet.offset(n),r=this._snippet.fullLen(n),s=V.fromPositions(e.getPositionAt(this._offset+o),e.getPositionAt(this._offset+o+r)),a=n.isFinalTabstop?bc._decor.inactiveFinal:bc._decor.inactive,l=t.addDecoration(s,a);this._placeholderDecorations.set(n,l)}})}move(e){if(!this._editor.hasModel())return[];if(this._initDecorations(),this._placeholderGroupsIdx>=0){const o=[];for(const r of this._placeholderGroups[this._placeholderGroupsIdx])if(r.transform){const s=this._placeholderDecorations.get(r),a=this._editor.getModel().getDecorationRange(s),l=this._editor.getModel().getValueInRange(a),c=r.transform.resolve(l).split(/\r\n|\r|\n/);for(let u=1;u0&&this._editor.executeEdits("snippet.placeholderTransform",o)}let t=!1;e===!0&&this._placeholderGroupsIdx0&&(this._placeholderGroupsIdx-=1,t=!0);const n=this._editor.getModel().changeDecorations(o=>{const r=new Set,s=[];for(const a of this._placeholderGroups[this._placeholderGroupsIdx]){const l=this._placeholderDecorations.get(a),c=this._editor.getModel().getDecorationRange(l);s.push(new gt(c.startLineNumber,c.startColumn,c.endLineNumber,c.endColumn)),t=t&&this._hasPlaceholderBeenCollapsed(a),o.changeDecorationOptions(l,a.isFinalTabstop?bc._decor.activeFinal:bc._decor.active),r.add(a);for(const u of this._snippet.enclosingPlaceholders(a)){const d=this._placeholderDecorations.get(u);o.changeDecorationOptions(d,u.isFinalTabstop?bc._decor.activeFinal:bc._decor.active),r.add(u)}}for(const[a,l]of this._placeholderDecorations)r.has(a)||o.changeDecorationOptions(l,a.isFinalTabstop?bc._decor.inactiveFinal:bc._decor.inactive);return s});return t?this.move(e):n!=null?n:[]}_hasPlaceholderBeenCollapsed(e){let t=e;for(;t;){if(t instanceof yc){const n=this._placeholderDecorations.get(t);if(this._editor.getModel().getDecorationRange(n).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 n;for(const o of t){if(o.isFinalTabstop)break;n||(n=[],e.set(o.index,n));const r=this._placeholderDecorations.get(o),s=this._editor.getModel().getDecorationRange(r);if(!s){e.delete(o.index);break}n.push(s)}}return e}get activeChoice(){if(!this._placeholderDecorations)return;const e=this._placeholderGroups[this._placeholderGroupsIdx][0];if(!(e!=null&&e.choice))return;const t=this._placeholderDecorations.get(e);if(!t)return;const n=this._editor.getModel().getDecorationRange(t);if(!!n)return{range:n,choice:e.choice}}get hasChoice(){let e=!1;return this._snippet.walk(t=>(e=t instanceof RS,!e)),e}merge(e){const t=this._editor.getModel();this._nestingLevel*=10,this._editor.changeDecorations(n=>{for(const o of this._placeholderGroups[this._placeholderGroupsIdx]){const r=e.shift();console.assert(r._offset!==-1),console.assert(!r._placeholderDecorations);const s=r._snippet.placeholderInfo.last.index;for(const l of r._snippet.placeholderInfo.all)l.isFinalTabstop?l.index=o.index+(s+1)/this._nestingLevel:l.index=o.index+l.index/this._nestingLevel;this._snippet.replace(o,r._snippet.children);const a=this._placeholderDecorations.get(o);n.removeDecoration(a),this._placeholderDecorations.delete(o);for(const l of r._snippet.placeholders){const c=r._snippet.offset(l),u=r._snippet.fullLen(l),d=V.fromPositions(t.getPositionAt(r._offset+c),t.getPositionAt(r._offset+c+u)),h=n.addDecoration(d,bc._decor.inactive);this._placeholderDecorations.set(l,h)}}this._placeholderGroups=eoe(this._snippet.placeholders,yc.compareByIndex)})}}bc._decor={active:Jt.register({description:"snippet-placeholder-1",stickiness:0,className:"snippet-placeholder"}),inactive:Jt.register({description:"snippet-placeholder-2",stickiness:1,className:"snippet-placeholder"}),activeFinal:Jt.register({description:"snippet-placeholder-3",stickiness:1,className:"finish-snippet-placeholder"}),inactiveFinal:Jt.register({description:"snippet-placeholder-4",stickiness:1,className:"finish-snippet-placeholder"})};const Pce={overwriteBefore:0,overwriteAfter:0,adjustWhitespace:!0,clipboardText:void 0,overtypingCapturer:void 0};let DO=ld=class{static adjustWhitespace(e,t,n,o,r){const s=e.getLineContent(t.lineNumber),a=Si(s,0,t.column-1);let l;return o.walk(c=>{if(!(c instanceof ta)||c.parent instanceof RS||r&&!r.has(c))return!0;const u=c.value.split(/\r\n|\r|\n/);if(n){const h=o.offset(c);if(h===0)u[0]=e.normalizeIndentation(u[0]);else{l=l!=null?l:o.toString();const f=l.charCodeAt(h-1);(f===10||f===13)&&(u[0]=e.normalizeIndentation(a+u[0]))}for(let f=1;fw.get(ib)),g=e.invokeWithinContext(w=>new Nce(w.get(Tw),h)),p=()=>a,v=h.getValueInRange(ld.adjustSelection(h,e.getSelection(),n,0)),m=h.getValueInRange(ld.adjustSelection(h,e.getSelection(),0,o)),_=h.getLineFirstNonWhitespaceColumn(e.getSelection().positionLineNumber),y=e.getSelections().map((w,L)=>({selection:w,idx:L})).sort((w,L)=>V.compareRangesUsingStarts(w.selection,L.selection));for(const{selection:w,idx:L}of y){let D=ld.adjustSelection(h,w,n,0),E=ld.adjustSelection(h,w,0,o);v!==h.getValueInRange(D)&&(D=w),m!==h.getValueInRange(E)&&(E=w);const I=w.setStartPosition(D.startLineNumber,D.startColumn).setEndPosition(E.endLineNumber,E.endColumn),k=new Gw().parse(t,!0,r),R=I.getStartPosition(),A=ld.adjustWhitespace(h,R,s||L>0&&_!==h.getLineFirstNonWhitespaceColumn(w.positionLineNumber),k);k.resolveVariables(new Ice([g,new Rce(p,L,y.length,e.getOption(78)==="spread"),new Tce(h,w,L,l),new EO(h,w,c),new Rd,new Mce(f),new Ace])),u[L]=Gi.replace(I,k.toString()),u[L].identifier={major:L,minor:0},u[L]._isTracked=!0,d[L]=new bc(e,k,A)}return{edits:u,snippets:d}}static createEditsAndSnippetsFromEdits(e,t,n,o,r,s,a){if(!e.hasModel()||t.length===0)return{edits:[],snippets:[]};const l=[],c=e.getModel(),u=new Gw,d=new wT,h=new Ice([e.invokeWithinContext(g=>new Nce(g.get(Tw),c)),new Rce(()=>r,0,e.getSelections().length,e.getOption(78)==="spread"),new Tce(c,e.getSelection(),0,s),new EO(c,e.getSelection(),a),new Rd,new Mce(e.invokeWithinContext(g=>g.get(ib))),new Ace]);t=t.sort((g,p)=>V.compareRangesUsingStarts(g.range,p.range));let f=0;for(let g=0;g0){const L=t[g-1].range,D=V.fromPositions(L.getEndPosition(),p.getStartPosition()),E=new ta(c.getValueInRange(D));d.appendChild(E),f+=E.value.length}const m=u.parseFragment(v,d);ld.adjustWhitespace(c,p.getStartPosition(),!0,d,new Set(m)),d.resolveVariables(h);const _=d.toString(),y=_.slice(f);f=_.length;const w=Gi.replace(p,y);w.identifier={major:g,minor:0},w._isTracked=!0,l.push(w)}return u.ensureFinalTabstop(d,n,!0),{edits:l,snippets:[new bc(e,d,"")]}}constructor(e,t,n=Pce,o){this._editor=e,this._template=t,this._options=n,this._languageConfigurationService=o,this._templateMerges=[],this._snippets=[]}dispose(){si(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"?ld.createEditsAndSnippetsFromSelections(this._editor,this._template,this._options.overwriteBefore,this._options.overwriteAfter,!1,this._options.adjustWhitespace,this._options.clipboardText,this._options.overtypingCapturer,this._languageConfigurationService):ld.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,n=>{const o=n.filter(r=>!!r.identifier);for(let r=0;rgt.fromPositions(r.range.getEndPosition()))}),this._editor.revealRange(this._editor.getSelections()[0])}merge(e,t=Pce){if(!this._editor.hasModel())return;this._templateMerges.push([this._snippets[0]._nestingLevel,this._snippets[0]._placeholderGroupsIdx,e]);const{edits:n,snippets:o}=ld.createEditsAndSnippetsFromSelections(this._editor,e,t.overwriteBefore,t.overwriteAfter,!0,t.adjustWhitespace,t.clipboardText,t.overtypingCapturer,this._languageConfigurationService);this._editor.executeEdits("snippet",n,r=>{const s=r.filter(l=>!!l.identifier);for(let l=0;lgt.fromPositions(l.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 n of this._snippets){const o=n.move(e);t.push(...o)}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(...o.get(s))})}e.sort(V.compareRangesUsingStarts);for(const[n,o]of t){if(o.length!==e.length){t.delete(n);continue}o.sort(V.compareRangesUsingStarts);for(let r=0;r0}};DO=ld=nwt([iwt(3,Ti)],DO);var owt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},lR=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},fC;const Oce={overwriteBefore:0,overwriteAfter:0,undoStopBefore:!0,undoStopAfter:!0,adjustWhitespace:!0,clipboardText:void 0,overtypingCapturer:void 0};let qr=fC=class{static get(e){return e.getContribution(fC.ID)}constructor(e,t,n,o,r){this._editor=e,this._logService=t,this._languageFeaturesService=n,this._languageConfigurationService=r,this._snippetListener=new Be,this._modelVersionId=-1,this._inSnippet=fC.InSnippetMode.bindTo(o),this._hasNextTabstop=fC.HasNextTabstop.bindTo(o),this._hasPrevTabstop=fC.HasPrevTabstop.bindTo(o)}dispose(){var e;this._inSnippet.reset(),this._hasPrevTabstop.reset(),this._hasNextTabstop.reset(),(e=this._session)===null||e===void 0||e.dispose(),this._snippetListener.dispose()}insert(e,t){try{this._doInsert(e,typeof t=="undefined"?Oce:Object.assign(Object.assign({},Oce),t))}catch(n){this.cancel(),this._logService.error(n),this._logService.error("snippet_error"),this._logService.error("insert_template=",e),this._logService.error("existing_template=",this._session?this._session._logInfo():"")}}_doInsert(e,t){var n;if(!!this._editor.hasModel()){if(this._snippetListener.clear(),t.undoStopBefore&&this._editor.getModel().pushStackElement(),this._session&&typeof e!="string"&&this.cancel(),this._session?(fi(typeof e=="string"),this._session.merge(e,t)):(this._modelVersionId=this._editor.getModel().getAlternativeVersionId(),this._session=new DO(this._editor,e,t,this._languageConfigurationService),this._session.insert()),t.undoStopAfter&&this._editor.getModel().pushStackElement(),!((n=this._session)===null||n===void 0)&&n.hasChoice){const o={_debugDisplayName:"snippetChoiceCompletions",provideCompletionItems:(u,d)=>{if(!this._session||u!==this._editor.getModel()||!ae.equals(this._editor.getPosition(),d))return;const{activeChoice:h}=this._session;if(!h||h.choice.options.length===0)return;const f=u.getValueInRange(h.range),g=Boolean(h.choice.options.find(v=>v.value===f)),p=[];for(let v=0;v{s==null||s.dispose(),a=!1},c=()=>{a||(s=this._languageFeaturesService.completionProvider.register({language:r.getLanguageId(),pattern:r.uri.fsPath,scheme:r.uri.scheme,exclusive:!0},o),this._snippetListener.add(s),a=!0)};this._choiceCompletions={provider:o,enable:c,disable:l}}this._updateState(),this._snippetListener.add(this._editor.onDidChangeModelContent(o=>o.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(){var e;if(!this._session||!this._editor.hasModel()){this._currentChoice=void 0;return}const{activeChoice:t}=this._session;if(!t||!this._choiceCompletions){(e=this._choiceCompletions)===null||e===void 0||e.disable(),this._currentChoice=void 0;return}this._currentChoice!==t.choice&&(this._currentChoice=t.choice,this._choiceCompletions.enable(),queueMicrotask(()=>{Jyt(this._editor,this._choiceCompletions.provider)}))}finish(){for(;this._inSnippet.get();)this.next()}cancel(e=!1){var t;this._inSnippet.reset(),this._hasPrevTabstop.reset(),this._hasNextTabstop.reset(),this._snippetListener.clear(),this._currentChoice=void 0,(t=this._session)===null||t===void 0||t.dispose(),this._session=void 0,this._modelVersionId=-1,e&&this._editor.setSelections([this._editor.getSelection()])}prev(){var e;(e=this._session)===null||e===void 0||e.prev(),this._updateState()}next(){var e;(e=this._session)===null||e===void 0||e.next(),this._updateState()}isInSnippet(){return Boolean(this._inSnippet.get())}};qr.ID="snippetController2";qr.InSnippetMode=new lt("inSnippetMode",!1,C("inSnippetMode","Whether the editor in current in snippet mode"));qr.HasNextTabstop=new lt("hasNextTabstop",!1,C("hasNextTabstop","Whether there is a next tab stop when in snippet mode"));qr.HasPrevTabstop=new lt("hasPrevTabstop",!1,C("hasPrevTabstop","Whether there is a previous tab stop when in snippet mode"));qr=fC=owt([lR(1,nc),lR(2,pt),lR(3,Ut),lR(4,Ti)],qr);zn(qr.ID,qr,4);const kF=Ir.bindToContribution(qr.get);Ye(new kF({id:"jumpToNextSnippetPlaceholder",precondition:Me.and(qr.InSnippetMode,qr.HasNextTabstop),handler:i=>i.next(),kbOpts:{weight:100+30,kbExpr:Q.editorTextFocus,primary:2}}));Ye(new kF({id:"jumpToPrevSnippetPlaceholder",precondition:Me.and(qr.InSnippetMode,qr.HasPrevTabstop),handler:i=>i.prev(),kbOpts:{weight:100+30,kbExpr:Q.editorTextFocus,primary:1026}}));Ye(new kF({id:"leaveSnippet",precondition:qr.InSnippetMode,handler:i=>i.cancel(!0),kbOpts:{weight:100+30,kbExpr:Q.editorTextFocus,primary:9,secondary:[1033]}}));Ye(new kF({id:"acceptSnippet",precondition:qr.InSnippetMode,handler:i=>i.finish()}));var rwt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},g7=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},og=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},Nl;(function(i){i[i.Undo=0]="Undo",i[i.Redo=1]="Redo",i[i.AcceptWord=2]="AcceptWord",i[i.Other=3]="Other"})(Nl||(Nl={}));let aU=class extends _e{get isAcceptingPartially(){return this._isAcceptingPartially}constructor(e,t,n,o,r,s,a,l,c,u,d,h){super(),this.textModel=e,this.selectedSuggestItem=t,this.cursorPosition=n,this.textModelVersionId=o,this._debounceValue=r,this._suggestPreviewEnabled=s,this._suggestPreviewMode=a,this._inlineSuggestMode=l,this._enabled=c,this._instantiationService=u,this._commandService=d,this._languageConfigurationService=h,this._source=this._register(this._instantiationService.createInstance(sU,this.textModel,this.textModelVersionId,this._debounceValue)),this._isActive=Ai(this,!1),this._forceUpdate=BCe("forceUpdate"),this._selectedInlineCompletionId=Ai(this,void 0),this._isAcceptingPartially=!1,this._preserveCurrentCompletionReasons=new Set([Nl.Redo,Nl.Undo,Nl.AcceptWord]),this._fetchInlineCompletions=Fgt({owner:this,createEmptyChangeSummary:()=>({preserveCurrentCompletion:!1,inlineCompletionTriggerKind:jg.Automatic}),handleChange:(g,p)=>(g.didChange(this.textModelVersionId)&&this._preserveCurrentCompletionReasons.has(g.change)?p.preserveCurrentCompletion=!0:g.didChange(this._forceUpdate)&&(p.inlineCompletionTriggerKind=g.change),!0)},(g,p)=>{if(this._forceUpdate.read(g),!(this._enabled.read(g)&&this.selectedSuggestItem.read(g)||this._isActive.read(g))){this._source.cancelUpdate();return}this.textModelVersionId.read(g);const m=this.selectedInlineCompletion.get(),_=p.preserveCurrentCompletion||(m==null?void 0:m.forwardStable)?m:void 0,y=this._source.suggestWidgetInlineCompletions.get(),w=this.selectedSuggestItem.read(g);if(y&&!w){const E=this._source.inlineCompletions.get();qi(I=>{E&&y.request.versionId>E.request.versionId&&this._source.inlineCompletions.set(y.clone(),I),this._source.clearSuggestWidgetInlineCompletions(I)})}const L=this.cursorPosition.read(g),D={triggerKind:p.inlineCompletionTriggerKind,selectedSuggestionInfo:w==null?void 0:w.toSelectedSuggestionInfo()};return this._source.fetch(L,D,_)}),this._filteredInlineCompletionItems=In(this,g=>{const p=this._source.inlineCompletions.read(g);if(!p)return[];const v=this.cursorPosition.read(g);return p.inlineCompletions.filter(_=>_.isVisible(this.textModel,v,g))}),this.selectedInlineCompletionIndex=In(this,g=>{const p=this._selectedInlineCompletionId.read(g),v=this._filteredInlineCompletionItems.read(g),m=this._selectedInlineCompletionId===void 0?-1:v.findIndex(_=>_.semanticId===p);return m===-1?(this._selectedInlineCompletionId.set(void 0,void 0),0):m}),this.selectedInlineCompletion=In(this,g=>{const p=this._filteredInlineCompletionItems.read(g),v=this.selectedInlineCompletionIndex.read(g);return p[v]}),this.lastTriggerKind=this._source.inlineCompletions.map(g=>g==null?void 0:g.request.context.triggerKind),this.inlineCompletionsCount=In(this,g=>{if(this.lastTriggerKind.read(g)===jg.Explicit)return this._filteredInlineCompletionItems.read(g).length}),this.state=Kae({owner:this,equalityComparer:(g,p)=>!g||!p?g===p:_ce(g.ghostText,p.ghostText)&&g.inlineCompletion===p.inlineCompletion&&g.suggestItem===p.suggestItem},g=>{var p;const v=this.textModel,m=this.selectedSuggestItem.read(g);if(m){const _=m.toSingleTextEdit().removeCommonPrefix(v),y=this._computeAugmentedCompletion(_,g);if(!this._suggestPreviewEnabled.read(g)&&!y)return;const L=(p=y==null?void 0:y.edit)!==null&&p!==void 0?p:_,D=y?y.edit.text.length-_.text.length:0,E=this._suggestPreviewMode.read(g),I=this.cursorPosition.read(g),k=L.computeGhostText(v,E,I,D);return{ghostText:k!=null?k:new xO(L.range.endLineNumber,[]),inlineCompletion:y==null?void 0:y.completion,suggestItem:m}}else{if(!this._isActive.read(g))return;const _=this.selectedInlineCompletion.read(g);if(!_)return;const y=_.toSingleTextEdit(g),w=this._inlineSuggestMode.read(g),L=this.cursorPosition.read(g),D=y.computeGhostText(v,w,L);return D?{ghostText:D,inlineCompletion:_,suggestItem:void 0}:void 0}}),this.ghostText=Kae({owner:this,equalityComparer:_ce},g=>{const p=this.state.read(g);if(!!p)return p.ghostText}),this._register(Tk(this._fetchInlineCompletions));let f;this._register(Ii(g=>{var p,v;const m=this.state.read(g),_=m==null?void 0:m.inlineCompletion;if((_==null?void 0:_.semanticId)!==(f==null?void 0:f.semanticId)&&(f=_,_)){const y=_.inlineCompletion,w=y.source;(v=(p=w.provider).handleItemDidShow)===null||v===void 0||v.call(p,w.inlineCompletions,y.sourceInlineCompletion,y.insertText)}}))}trigger(e){return og(this,void 0,void 0,function*(){this._isActive.set(!0,e),yield this._fetchInlineCompletions.get()})}triggerExplicitly(e){return og(this,void 0,void 0,function*(){G$(e,t=>{this._isActive.set(!0,t),this._forceUpdate.trigger(t,jg.Explicit)}),yield this._fetchInlineCompletions.get()})}stop(e){G$(e,t=>{this._isActive.set(!1,t),this._source.clear(t)})}_computeAugmentedCompletion(e,t){const n=this.textModel,o=this._source.suggestWidgetInlineCompletions.read(t),r=o?o.inlineCompletions:[this.selectedInlineCompletion.read(t)].filter(ED);return Tet(r,a=>{let l=a.toSingleTextEdit(t);return l=l.removeCommonPrefix(n,V.fromPositions(l.range.getStartPosition(),e.range.getEndPosition())),l.augments(e)?{edit:l,completion:a}:void 0})}_deltaSelectedInlineCompletionIndex(e){return og(this,void 0,void 0,function*(){yield this.triggerExplicitly();const t=this._filteredInlineCompletionItems.get()||[];if(t.length>0){const n=(this.selectedInlineCompletionIndex.get()+e+t.length)%t.length;this._selectedInlineCompletionId.set(t[n].semanticId,void 0)}else this._selectedInlineCompletionId.set(void 0,void 0)})}next(){return og(this,void 0,void 0,function*(){yield this._deltaSelectedInlineCompletionIndex(1)})}previous(){return og(this,void 0,void 0,function*(){yield this._deltaSelectedInlineCompletionIndex(-1)})}accept(e){var t;return og(this,void 0,void 0,function*(){if(e.getModel()!==this.textModel)throw new Vo;const n=this.state.get();if(!n||n.ghostText.isEmpty()||!n.inlineCompletion)return;const o=n.inlineCompletion.toInlineCompletion(void 0);e.pushUndoStop(),o.snippetInfo?(e.executeEdits("inlineSuggestion.accept",[Gi.replaceMove(o.range,""),...o.additionalTextEdits]),e.setPosition(o.snippetInfo.range.getStartPosition()),(t=qr.get(e))===null||t===void 0||t.insert(o.snippetInfo.snippet,{undoStopBefore:!1})):e.executeEdits("inlineSuggestion.accept",[Gi.replaceMove(o.range,o.insertText),...o.additionalTextEdits]),o.command&&o.source.addRef(),qi(r=>{this._source.clear(r),this._isActive.set(!1,r)}),o.command&&(yield this._commandService.executeCommand(o.command.id,...o.command.arguments||[]).then(void 0,$o),o.source.removeRef())})}acceptNextWord(e){return og(this,void 0,void 0,function*(){yield this._acceptNext(e,(t,n)=>{const o=this.textModel.getLanguageIdAtPosition(t.lineNumber,t.column),r=this._languageConfigurationService.getLanguageConfiguration(o),s=new RegExp(r.wordDefinition.source,r.wordDefinition.flags.replace("g","")),a=n.match(s);let l=0;a&&a.index!==void 0?a.index===0?l=a[0].length:l=a.index:l=n.length;const u=/\s+/g.exec(n);return u&&u.index!==void 0&&u.index+u[0].length{const o=n.match(/\n/);return o&&o.index!==void 0?o.index+1:n.length})})}_acceptNext(e,t){return og(this,void 0,void 0,function*(){if(e.getModel()!==this.textModel)throw new Vo;const n=this.state.get();if(!n||n.ghostText.isEmpty()||!n.inlineCompletion)return;const o=n.ghostText,r=n.inlineCompletion.toInlineCompletion(void 0);if(r.snippetInfo||r.filterText!==r.insertText){yield this.accept(e);return}const s=o.parts[0],a=new ae(o.lineNumber,s.column),l=s.lines.join(` +`),c=t(a,l);if(c===l.length&&o.parts.length===1){this.accept(e);return}const u=l.substring(0,c);this._isAcceptingPartially=!0;try{e.pushUndoStop(),e.executeEdits("inlineSuggestion.accept",[Gi.replace(V.fromPositions(a),u)]);const d=nU(u);e.setPosition(tU(a,d))}finally{this._isAcceptingPartially=!1}if(r.source.provider.handlePartialAccept){const d=V.fromPositions(r.range.getStartPosition(),tU(a,nU(u))),h=e.getModel().getValueInRange(d,1);r.source.provider.handlePartialAccept(r.source.inlineCompletions,r.sourceInlineCompletion,h.length)}})}handleSuggestAccepted(e){var t,n;const o=e.toSingleTextEdit().removeCommonPrefix(this.textModel),r=this._computeAugmentedCompletion(o,void 0);if(!r)return;const s=r.completion.inlineCompletion;(n=(t=s.source.provider).handlePartialAccept)===null||n===void 0||n.call(t,s.source.inlineCompletions,s.sourceInlineCompletion,o.text.length)}};aU=rwt([g7(9,$t),g7(10,_o),g7(11,Ti)],aU);var swt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Fce=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},OL;class AY{constructor(e){this.name=e}select(e,t,n){if(n.length===0)return 0;const o=n[0].score[0];for(let r=0;rl&&d.type===n[c].completion.kind&&d.insertText===n[c].completion.insertText&&(l=d.touch,a=c),n[c].completion.preselect&&s===-1)return s=c}return a!==-1?a:s!==-1?s:0}toJSON(){return this._cache.toJSON()}fromJSON(e){this._cache.clear();const t=0;for(const[n,o]of e)o.touch=t,o.type=typeof o.type=="number"?o.type:TD.fromString(o.type),this._cache.set(n,o);this._seq=this._cache.size}}class lwt extends AY{constructor(){super("recentlyUsedByPrefix"),this._trie=Ry.forStrings(),this._seq=0}memorize(e,t,n){const{word:o}=e.getWordUntilPosition(t),r=`${e.getLanguageId()}/${o}`;this._trie.set(r,{type:n.completion.kind,insertText:n.completion.insertText,touch:this._seq++})}select(e,t,n){const{word:o}=e.getWordUntilPosition(t);if(!o)return super.select(e,t,n);const r=`${e.getLanguageId()}/${o}`;let s=this._trie.get(r);if(s||(s=this._trie.findSubstr(r)),s)for(let a=0;ae.push([n,t])),e.sort((t,n)=>-(t[1].touch-n[1].touch)).forEach((t,n)=>t[1].touch=n),e.slice(0,200)}fromJSON(e){if(this._trie.clear(),e.length>0){this._seq=e[0][1].touch+1;for(const[t,n]of e)n.type=typeof n.type=="number"?n.type:TD.fromString(n.type),this._trie.set(t,n)}}}let Uk=OL=class{constructor(e,t){this._storageService=e,this._configService=t,this._disposables=new Be,this._persistSoon=new bi(()=>this._saveState(),500),this._disposables.add(e.onWillSaveState(n=>{n.reason===PP.SHUTDOWN&&this._saveState()}))}dispose(){this._disposables.dispose(),this._persistSoon.dispose()}memorize(e,t,n){this._withStrategy(e,t).memorize(e,t,n),this._persistSoon.schedule()}select(e,t,n){return this._withStrategy(e,t).select(e,t,n)}_withStrategy(e,t){var n;const o=this._configService.getValue("editor.suggestSelection",{overrideIdentifier:e.getLanguageIdAtPosition(t.lineNumber,t.column),resource:e.uri});if(((n=this._strategy)===null||n===void 0?void 0:n.name)!==o){this._saveState();const r=OL._strategyCtors.get(o)||uSe;this._strategy=new r;try{const a=this._configService.getValue("editor.suggest.shareSuggestSelections")?0:1,l=this._storageService.get(`${OL._storagePrefix}/${o}`,a);l&&this._strategy.fromJSON(JSON.parse(l))}catch{}}return this._strategy}_saveState(){if(this._strategy){const t=this._configService.getValue("editor.suggest.shareSuggestSelections")?0:1,n=JSON.stringify(this._strategy);this._storageService.store(`${OL._storagePrefix}/${this._strategy.name}`,n,t,1)}}};Uk._strategyCtors=new Map([["recentlyUsedByPrefix",lwt],["recentlyUsed",awt],["first",uSe]]);Uk._storagePrefix="suggest/memories";Uk=OL=swt([Fce(0,Gu),Fce(1,En)],Uk);const IF=yn("ISuggestMemories");Mn(IF,Uk,1);var cwt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},uwt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},lU;let jk=lU=class{constructor(e,t){this._editor=e,this._enabled=!1,this._ckAtEnd=lU.AtEnd.bindTo(t),this._configListener=this._editor.onDidChangeConfiguration(n=>n.hasChanged(122)&&this._update()),this._update()}dispose(){var e;this._configListener.dispose(),(e=this._selectionListener)===null||e===void 0||e.dispose(),this._ckAtEnd.reset()}_update(){const e=this._editor.getOption(122)==="on";if(this._enabled!==e)if(this._enabled=e,this._enabled){const t=()=>{if(!this._editor.hasModel()){this._ckAtEnd.set(!1);return}const n=this._editor.getModel(),o=this._editor.getSelection(),r=n.getWordAtPosition(o.getStartPosition());if(!r){this._ckAtEnd.set(!1);return}this._ckAtEnd.set(r.endColumn===o.getStartPosition().column)};this._selectionListener=this._editor.onDidChangeCursorSelection(t),t()}else this._selectionListener&&(this._ckAtEnd.reset(),this._selectionListener.dispose(),this._selectionListener=void 0)}};jk.AtEnd=new lt("atEndOfWord",!1);jk=lU=cwt([uwt(1,Ut)],jk);var dwt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},hwt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},FL;let Cb=FL=class{constructor(e,t){this._editor=e,this._index=0,this._ckOtherSuggestions=FL.OtherSuggestions.bindTo(t)}dispose(){this.reset()}reset(){var e;this._ckOtherSuggestions.reset(),(e=this._listener)===null||e===void 0||e.dispose(),this._model=void 0,this._acceptNext=void 0,this._ignore=!1}set({model:e,index:t},n){if(e.items.length===0){this.reset();return}if(FL._moveIndex(!0,e,t)===t){this.reset();return}this._acceptNext=n,this._model=e,this._index=t,this._listener=this._editor.onDidChangeCursorPosition(()=>{this._ignore||this.reset()}),this._ckOtherSuggestions.set(!0)}static _moveIndex(e,t,n){let o=n;for(let r=t.items.length;r>0&&(o=(o+t.items.length+(e?1:-1))%t.items.length,!(o===n||!t.items[o].completion.additionalTextEdits));r--);return o}next(){this._move(!0)}prev(){this._move(!1)}_move(e){if(!!this._model)try{this._ignore=!0,this._index=FL._moveIndex(e,this._model,this._index),this._acceptNext({index:this._index,item:this._model.items[this._index],model:this._model})}finally{this._ignore=!1}}};Cb.OtherSuggestions=new lt("hasOtherSuggestions",!1);Cb=FL=dwt([hwt(1,Ut)],Cb);class fwt{constructor(e,t,n,o){this._disposables=new Be,this._disposables.add(n.onDidSuggest(r=>{r.completionModel.items.length===0&&this.reset()})),this._disposables.add(n.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()&&n.state!==0){const s=r.charCodeAt(r.length-1);this._active.acceptCharacters.has(s)&&e.getOption(0)&&o(this._active.item)}}))}_onItem(e){if(!e||!ws(e.item.completion.commitCharacters)){this.reset();return}if(this._active&&this._active.item.item===e.item)return;const t=new QA;for(const n of e.item.completion.commitCharacters)n.length>0&&t.add(n.charCodeAt(0));this._active={acceptCharacters:t,item:e}}reset(){this._active=void 0}dispose(){this._disposables.dispose()}}var gwt=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};class Rl{provideSelectionRanges(e,t){return gwt(this,void 0,void 0,function*(){const n=[];for(const o of t){const r=[];n.push(r);const s=new Map;yield new Promise(a=>Rl._bracketsRightYield(a,0,e,o,s)),yield new Promise(a=>Rl._bracketsLeftYield(a,0,e,o,s,r))}return n})}static _bracketsRightYield(e,t,n,o,r){const s=new Map,a=Date.now();for(;;){if(t>=Rl._maxRounds){e();break}if(!o){e();break}const l=n.bracketPairs.findNextBracket(o);if(!l){e();break}if(Date.now()-a>Rl._maxDuration){setTimeout(()=>Rl._bracketsRightYield(e,t+1,n,o,r));break}if(l.bracketInfo.isOpeningBracket){const u=l.bracketInfo.bracketText,d=s.has(u)?s.get(u):0;s.set(u,d+1)}else{const u=l.bracketInfo.getOpeningBrackets()[0].bracketText;let d=s.has(u)?s.get(u):0;if(d-=1,s.set(u,Math.max(0,d)),d<0){let h=r.get(u);h||(h=new oa,r.set(u,h)),h.push(l.range)}}o=l.range.getEndPosition()}}static _bracketsLeftYield(e,t,n,o,r,s){const a=new Map,l=Date.now();for(;;){if(t>=Rl._maxRounds&&r.size===0){e();break}if(!o){e();break}const c=n.bracketPairs.findPrevBracket(o);if(!c){e();break}if(Date.now()-l>Rl._maxDuration){setTimeout(()=>Rl._bracketsLeftYield(e,t+1,n,o,r,s));break}if(c.bracketInfo.isOpeningBracket){const d=c.bracketInfo.bracketText;let h=a.has(d)?a.get(d):0;if(h-=1,a.set(d,Math.max(0,h)),h<0){const f=r.get(d);if(f){const g=f.shift();f.size===0&&r.delete(d);const p=V.fromPositions(c.range.getEndPosition(),g.getStartPosition()),v=V.fromPositions(c.range.getStartPosition(),g.getEndPosition());s.push({range:p}),s.push({range:v}),Rl._addBracketLeading(n,v,s)}}}else{const d=c.bracketInfo.getOpeningBrackets()[0].bracketText,h=a.has(d)?a.get(d):0;a.set(d,h+1)}o=c.range.getStartPosition()}}static _addBracketLeading(e,t,n){if(t.startLineNumber===t.endLineNumber)return;const o=t.startLineNumber,r=e.getLineFirstNonWhitespaceColumn(o);r!==0&&r!==t.startColumn&&(n.push({range:V.fromPositions(new ae(o,r),t.getEndPosition())}),n.push({range:V.fromPositions(new ae(o,1),t.getEndPosition())}));const s=o-1;if(s>0){const a=e.getLineFirstNonWhitespaceColumn(s);a===t.startColumn&&a!==e.getLineLastNonWhitespaceColumn(s)&&(n.push({range:V.fromPositions(new ae(s,a),t.getEndPosition())}),n.push({range:V.fromPositions(new ae(s,1),t.getEndPosition())}))}}}Rl._maxDuration=30;Rl._maxRounds=2;var pwt=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};class xd{static create(e,t){return pwt(this,void 0,void 0,function*(){if(!t.getOption(117).localityBonus||!t.hasModel())return xd.None;const n=t.getModel(),o=t.getPosition();if(!e.canComputeWordRanges(n.uri))return xd.None;const[r]=yield new Rl().provideSelectionRanges(n,[o]);if(r.length===0)return xd.None;const s=yield e.computeWordRanges(n.uri,r[0].range);if(!s)return xd.None;const a=n.getWordUntilPosition(o);return delete s[a.word],new class extends xd{distance(l,c){if(!o.equals(t.getPosition()))return 0;if(c.kind===17)return 2<<20;const u=typeof c.label=="string"?c.label:c.label.label,d=s[u];if(a_e(d))return 2<<20;const h=xD(d,V.fromPositions(l),V.compareRangesUsingStarts),f=h>=0?d[h]:d[Math.max(0,~h-1)];let g=r.length;for(const p of r){if(!V.containsRange(p.range,f))break;g-=1}return g}}})}}xd.None=new class extends xd{distance(){return 0}};class Bce{constructor(e,t){this.leadingLineContent=e,this.characterCountDelta=t}}class dm{constructor(e,t,n,o,r,s,a=R5.default,l=void 0){this.clipboardText=l,this._snippetCompareFn=dm._compareCompletionItems,this._items=e,this._column=t,this._wordDistance=o,this._options=r,this._refilterKind=1,this._lineContext=n,this._fuzzyScoreOptions=a,s==="top"?this._snippetCompareFn=dm._compareCompletionItemsSnippetsUp:s==="bottom"&&(this._snippetCompareFn=dm._compareCompletionItemsSnippetsDown)}get lineContext(){return this._lineContext}set lineContext(e){(this._lineContext.leadingLineContent!==e.leadingLineContent||this._lineContext.characterCountDelta!==e.characterCountDelta)&&(this._refilterKind=this._lineContext.characterCountDelta0&&n[0].container.incomplete&&e.add(t);return e}get stats(){return this._ensureCachedState(),this._stats}_ensureCachedState(){this._refilterKind!==0&&this._createCachedState()}_createCachedState(){this._itemsByProvider=new Map;const e=[],{leadingLineContent:t,characterCountDelta:n}=this._lineContext;let o="",r="";const s=this._refilterKind===1?this._items:this._filteredItems,a=[],l=!this._options.filterGraceful||s.length>2e3?ob:Eut;for(let c=0;c=f)u.score=$d.Default;else if(typeof u.completion.filterText=="string"){const p=l(o,r,g,u.completion.filterText,u.filterTextLow,0,this._fuzzyScoreOptions);if(!p)continue;WV(u.completion.filterText,u.textLabel)===0?u.score=p:(u.score=wut(o,r,g,u.textLabel,u.labelLow,0),u.score[0]=p[0])}else{const p=l(o,r,g,u.textLabel,u.labelLow,0,this._fuzzyScoreOptions);if(!p)continue;u.score=p}}u.idx=c,u.distance=this._wordDistance.distance(u.position,u.completion),a.push(u),e.push(u.textLabel.length)}this._filteredItems=a.sort(this._snippetCompareFn),this._refilterKind=0,this._stats={pLabelLen:e.length?UW(e.length-.85,e,(c,u)=>c-u):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===27)return 1;if(t.completion.kind===27)return-1}return dm._compareCompletionItems(e,t)}static _compareCompletionItemsSnippetsUp(e,t){if(e.completion.kind!==t.completion.kind){if(e.completion.kind===27)return-1;if(t.completion.kind===27)return 1}return dm._compareCompletionItems(e,t)}}var mwt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},$p=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},vwt=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},cU;class w_{static shouldAutoTrigger(e){if(!e.hasModel())return!1;const t=e.getModel(),n=e.getPosition();t.tokenization.tokenizeIfCheap(n.lineNumber);const o=t.getWordAtPosition(n);return!(!o||o.endColumn!==n.column&&o.startColumn+1!==n.column||!isNaN(Number(o.word)))}constructor(e,t,n){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=n}}function _wt(i,e,t){if(!Boolean(e.getContextKeyValue(Dr.inlineSuggestionVisible.key)))return!0;const n=e.getContextKeyValue(Dr.suppressSuggestions.key);return n!==void 0?!n:!i.getOption(62).suppressSuggestions}function bwt(i,e,t){if(!Boolean(e.getContextKeyValue("inlineSuggestionVisible")))return!0;const n=e.getContextKeyValue(Dr.suppressSuggestions.key);return n!==void 0?!n:!i.getOption(62).suppressSuggestions}let uU=cU=class{constructor(e,t,n,o,r,s,a,l,c){this._editor=e,this._editorWorkerService=t,this._clipboardService=n,this._telemetryService=o,this._logService=r,this._contextKeyService=s,this._configurationService=a,this._languageFeaturesService=l,this._envService=c,this._toDispose=new Be,this._triggerCharacterListener=new Be,this._triggerQuickSuggest=new zu,this._triggerState=void 0,this._completionDisposables=new Be,this._onDidCancel=new le,this._onDidTrigger=new le,this._onDidSuggest=new le,this.onDidCancel=this._onDidCancel.event,this.onDidTrigger=this._onDidTrigger.event,this.onDidSuggest=this._onDidSuggest.event,this._telemetryGate=0,this._currentSelection=this._editor.getSelection()||new gt(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 u=!1;this._toDispose.add(this._editor.onDidCompositionStart(()=>{u=!0})),this._toDispose.add(this._editor.onDidCompositionEnd(()=>{u=!1,this._onCompositionEnd()})),this._toDispose.add(this._editor.onDidChangeCursorSelection(d=>{u||this._onCursorChange(d)})),this._toDispose.add(this._editor.onDidChangeModelContent(()=>{!u&&this._triggerState!==void 0&&this._refilterCompletionItems()})),this._updateTriggerCharacters()}dispose(){si(this._triggerCharacterListener),si([this._onDidCancel,this._onDidSuggest,this._onDidTrigger,this._triggerQuickSuggest]),this._toDispose.dispose(),this._completionDisposables.dispose(),this.cancel()}_updateTriggerCharacters(){if(this._triggerCharacterListener.clear(),this._editor.getOption(90)||!this._editor.hasModel()||!this._editor.getOption(120))return;const e=new Map;for(const n of this._languageFeaturesService.completionProvider.all(this._editor.getModel()))for(const o of n.triggerCharacters||[]){let r=e.get(o);r||(r=new Set,r.add(Gyt()),e.set(o,r)),r.add(n)}const t=n=>{var o;if(!bwt(this._editor,this._contextKeyService,this._configurationService)||w_.shouldAutoTrigger(this._editor))return;if(!n){const a=this._editor.getPosition();n=this._editor.getModel().getLineContent(a.lineNumber).substr(0,a.column-1)}let r="";Z0(n.charCodeAt(n.length-1))?gr(n.charCodeAt(n.length-2))&&(r=n.substr(n.length-2)):r=n.charAt(n.length-1);const s=e.get(r);if(s){const a=new Map;if(this._completionModel)for(const[l,c]of this._completionModel.getItemsByProvider())s.has(l)||a.set(l,c);this.trigger({auto:!0,triggerKind:1,triggerCharacter:r,retrigger:Boolean(this._completionModel),clipboardText:(o=this._completionModel)===null||o===void 0?void 0:o.clipboardText,completionOptions:{providerFilter:s,providerItemsToReuse:a}})}};this._triggerCharacterListener.add(this._editor.onDidType(t)),this._triggerCharacterListener.add(this._editor.onDidCompositionEnd(()=>t()))}get state(){return this._triggerState?this._triggerState.auto?2:1:0}cancel(e=!1){var t;this._triggerState!==void 0&&(this._triggerQuickSuggest.cancel(),(t=this._requestToken)===null||t===void 0||t.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!==0&&e.reason!==3||e.source!=="keyboard"&&e.source!=="deleteLeft"){this.cancel();return}this._triggerState===void 0&&e.reason===0?(t.containsRange(this._currentSelection)||t.getEndPosition().isBeforeOrEqual(this._currentSelection.getPosition()))&&this._doTriggerQuickSuggest():this._triggerState!==void 0&&e.reason===3&&this._refilterCompletionItems()}_onCompositionEnd(){this._triggerState===void 0?this._doTriggerQuickSuggest():this._refilterCompletionItems()}_doTriggerQuickSuggest(){var e;ZC.isAllOff(this._editor.getOption(88))||this._editor.getOption(117).snippetsPreventQuickSuggestions&&((e=qr.get(this._editor))===null||e===void 0?void 0:e.isInSnippet())||(this.cancel(),this._triggerQuickSuggest.cancelAndSet(()=>{if(this._triggerState!==void 0||!w_.shouldAutoTrigger(this._editor)||!this._editor.hasModel()||!this._editor.hasWidgetFocus())return;const t=this._editor.getModel(),n=this._editor.getPosition(),o=this._editor.getOption(88);if(!ZC.isAllOff(o)){if(!ZC.isAllOn(o)){t.tokenization.tokenizeIfCheap(n.lineNumber);const r=t.tokenization.getLineTokens(n.lineNumber),s=r.getStandardTokenType(r.findTokenIndexAtOffset(Math.max(n.column-1-1,0)));if(ZC.valueFor(o,s)!=="on")return}!_wt(this._editor,this._contextKeyService,this._configurationService)||!this._languageFeaturesService.completionProvider.has(t)||this.trigger({auto:!0})}},this._editor.getOption(89)))}_refilterCompletionItems(){fi(this._editor.hasModel()),fi(this._triggerState!==void 0);const e=this._editor.getModel(),t=this._editor.getPosition(),n=new w_(e,t,Object.assign(Object.assign({},this._triggerState),{refilter:!0}));this._onNewContext(n)}trigger(e){var t,n,o,r,s,a;if(!this._editor.hasModel())return;const l=this._editor.getModel(),c=new w_(l,this._editor.getPosition(),e);this.cancel(e.retrigger),this._triggerState=e,this._onDidTrigger.fire({auto:e.auto,shy:(t=e.shy)!==null&&t!==void 0?t:!1,position:this._editor.getPosition()}),this._context=c;let u={triggerKind:(n=e.triggerKind)!==null&&n!==void 0?n:0};e.triggerCharacter&&(u={triggerKind:1,triggerCharacter:e.triggerCharacter}),this._requestToken=new Ro;const d=this._editor.getOption(111);let h=1;switch(d){case"top":h=0;break;case"bottom":h=2;break}const{itemKind:f,showDeprecated:g}=cU._createSuggestFilter(this._editor),p=new zk(h,(r=(o=e.completionOptions)===null||o===void 0?void 0:o.kindFilter)!==null&&r!==void 0?r:f,(s=e.completionOptions)===null||s===void 0?void 0:s.providerFilter,(a=e.completionOptions)===null||a===void 0?void 0:a.providerItemsToReuse,g),v=xd.create(this._editorWorkerService,this._editor),m=RY(this._languageFeaturesService.completionProvider,l,this._editor.getPosition(),p,u,this._requestToken.token);Promise.all([m,v]).then(([_,y])=>vwt(this,void 0,void 0,function*(){var w;if((w=this._requestToken)===null||w===void 0||w.dispose(),!this._editor.hasModel())return;let L=e==null?void 0:e.clipboardText;if(!L&&_.needsClipboard&&(L=yield this._clipboardService.readText()),this._triggerState===void 0)return;const D=this._editor.getModel(),E=new w_(D,this._editor.getPosition(),e),I=Object.assign(Object.assign({},R5.default),{firstMatchCanBeWeak:!this._editor.getOption(117).matchOnWordStartOnly});if(this._completionModel=new dm(_.items,this._context.column,{leadingLineContent:E.leadingLineContent,characterCountDelta:E.column-this._context.column},y,this._editor.getOption(117),this._editor.getOption(111),I,L),this._completionDisposables.add(_.disposable),this._onNewContext(E),this._reportDurationsTelemetry(_.durations),!this._envService.isBuilt||this._envService.isExtensionDevelopment)for(const k of _.items)k.isInvalid&&this._logService.warn(`[suggest] did IGNORE invalid completion item from ${k.provider._debugDisplayName}`,k.completion)})).catch(en)}_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(111)==="none"&&t.add(27);const o=e.getOption(117);return o.showMethods||t.add(0),o.showFunctions||t.add(1),o.showConstructors||t.add(2),o.showFields||t.add(3),o.showVariables||t.add(4),o.showClasses||t.add(5),o.showStructs||t.add(6),o.showInterfaces||t.add(7),o.showModules||t.add(8),o.showProperties||t.add(9),o.showEvents||t.add(10),o.showOperators||t.add(11),o.showUnits||t.add(12),o.showValues||t.add(13),o.showConstants||t.add(14),o.showEnums||t.add(15),o.showEnumMembers||t.add(16),o.showKeywords||t.add(17),o.showWords||t.add(18),o.showColors||t.add(19),o.showFiles||t.add(20),o.showReferences||t.add(21),o.showColors||t.add(22),o.showFolders||t.add(23),o.showTypeParameters||t.add(24),o.showSnippets||t.add(27),o.showUsers||t.add(25),o.showIssues||t.add(26),{itemKind:t,showDeprecated:o.showDeprecated}}_onNewContext(e){if(!!this._context){if(e.lineNumber!==this._context.lineNumber){this.cancel();return}if(Si(e.leadingLineContent)!==Si(this._context.leadingLineContent)){this.cancel();return}if(e.columnthis._context.leadingWord.startColumn){if(w_.shouldAutoTrigger(this._editor)&&this._context){const n=this._completionModel.getItemsByProvider();this.trigger({auto:this._context.triggerOptions.auto,retrigger:!0,clipboardText:this._completionModel.clipboardText,completionOptions:{providerItemsToReuse:n}})}return}if(e.column>this._context.column&&this._completionModel.getIncompleteProvider().size>0&&e.leadingWord.word.length!==0){const t=new Map,n=new Set;for(const[o,r]of this._completionModel.getItemsByProvider())r.length>0&&r[0].container.incomplete?n.add(o):t.set(o,r);this.trigger({auto:this._context.triggerOptions.auto,triggerKind:2,retrigger:!0,clipboardText:this._completionModel.clipboardText,completionOptions:{providerFilter:n,providerItemsToReuse:t}})}else{const t=this._completionModel.lineContext;let n=!1;if(this._completionModel.lineContext={leadingLineContent:e.leadingLineContent,characterCountDelta:e.column-this._context.column},this._completionModel.items.length===0){const o=w_.shouldAutoTrigger(this._editor);if(!this._context){this.cancel();return}if(o&&this._context.leadingWord.endColumn0,n&&e.leadingWord.word.length===0){this.cancel();return}}this._onDidSuggest.fire({completionModel:this._completionModel,triggerOptions:e.triggerOptions,isFrozen:n})}}}}};uU=cU=mwt([$p(1,Xu),$p(2,yp),$p(3,tc),$p(4,nc),$p(5,Ut),$p(6,En),$p(7,pt),$p(8,tX)],uU);class TF{constructor(e,t){this._disposables=new Be,this._lastOvertyped=[],this._locked=!1,this._disposables.add(e.onWillType(()=>{if(this._locked||!e.hasModel())return;const n=e.getSelections(),o=n.length;let r=!1;for(let a=0;aTF._maxSelectionLength)return;this._lastOvertyped[a]={value:s.getValueInRange(l),multiline:l.startLineNumber!==l.endLineNumber}}})),this._disposables.add(t.onDidTrigger(n=>{this._locked=!0})),this._disposables.add(t.onDidCancel(n=>{this._locked=!1}))}getLastOvertypedInfo(e){if(e>=0&&e=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},p7=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};class PY extends rb{updateLabel(){const e=this._keybindingService.lookupKeybinding(this._action.id,this._contextKeyService);if(!e)return super.updateLabel();this.label&&(this.label.textContent=C({key:"content",comment:["A label","A keybinding"]},"{0} ({1})",this._action.label,PY.symbolPrintEnter(e)))}static symbolPrintEnter(e){var t;return(t=e.getLabel())===null||t===void 0?void 0:t.replace(/\benter\b/gi,"\u23CE")}}let dU=class{constructor(e,t,n,o,r){this._menuId=t,this._menuService=o,this._contextKeyService=r,this._menuDisposables=new Be,this.element=Ae(e,He(".suggest-status-bar"));const s=a=>a instanceof Fu?n.createInstance(PY,a,void 0):void 0;this._leftActions=new zc(this.element,{actionViewItemProvider:s}),this._rightActions=new zc(this.element,{actionViewItemProvider:s}),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 n=[],o=[];for(const[r,s]of e.getActions())r==="left"?n.push(...s):o.push(...s);this._leftActions.clear(),this._leftActions.push(n),this._rightActions.clear(),this._rightActions.push(o)};this._menuDisposables.add(e.onDidChange(()=>t())),this._menuDisposables.add(e)}hide(){this._menuDisposables.clear()}};dU=Cwt([p7(2,$t),p7(3,If),p7(4,Ut)],dU);var ywt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},wwt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};function OY(i){return!!i&&Boolean(i.completion.documentation||i.completion.detail&&i.completion.detail!==i.completion.label)}let hU=class{constructor(e,t){this._editor=e,this._onDidClose=new le,this.onDidClose=this._onDidClose.event,this._onDidChangeContents=new le,this.onDidChangeContents=this._onDidChangeContents.event,this._disposables=new Be,this._renderDisposeable=new Be,this._borderWidth=1,this._size=new jn(330,0),this.domNode=He(".suggest-details"),this.domNode.classList.add("no-docs"),this._markdownRenderer=t.createInstance(up,{editor:e}),this._body=He(".body"),this._scrollbar=new YI(this._body,{alwaysConsumeMouseWheel:!0}),Ae(this.domNode,this._scrollbar.getDomNode()),this._disposables.add(this._scrollbar),this._header=Ae(this._body,He(".header")),this._close=Ae(this._header,He("span"+Mt.asCSSSelector(Xe.close))),this._close.title=C("details.close","Close"),this._type=Ae(this._header,He("p.type")),this._docs=Ae(this._body,He("p.docs")),this._configureFont(),this._disposables.add(this._editor.onDidChangeConfiguration(n=>{n.hasChanged(50)&&this._configureFont()}))}dispose(){this._disposables.dispose(),this._renderDisposeable.dispose()}_configureFont(){const e=this._editor.getOptions(),t=e.get(50),n=t.getMassagedFontFamily(),o=e.get(118)||t.fontSize,r=e.get(119)||t.lineHeight,s=t.fontWeight,a=`${o}px`,l=`${r}px`;this.domNode.style.fontSize=a,this.domNode.style.lineHeight=`${r/o}`,this.domNode.style.fontWeight=s,this.domNode.style.fontFeatureSettings=t.fontFeatureSettings,this._type.style.fontFamily=n,this._close.style.height=l,this._close.style.width=l}getLayoutInfo(){const e=this._editor.getOption(119)||this._editor.getOption(50).lineHeight,t=this._borderWidth,n=t*2;return{lineHeight:e,borderWidth:t,borderHeight:n,verticalPadding:22,horizontalPadding:14}}renderLoading(){this._type.textContent=C("loading","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){var n,o;this._renderDisposeable.clear();let{detail:r,documentation:s}=e.completion;if(t){let a="";a+=`score: ${e.score[0]} `,a+=`prefix: ${(n=e.word)!==null&&n!==void 0?n:"(no prefix)"} `,a+=`word: ${e.completion.filterText?e.completion.filterText+" (filterText)":e.textLabel} `,a+=`distance: ${e.distance} (localityBonus-setting) `,a+=`index: ${e.idx}, based on ${e.completion.sortText&&`sortText: "${e.completion.sortText}"`||"label"} `,a+=`commit_chars: ${(o=e.completion.commitCharacters)===null||o===void 0?void 0:o.join("")} -`,s=new is().appendCodeblock("empty",a),r=`Provider: ${e.provider._debugDisplayName}`}if(!t&&!IY(e)){this.clearContents();return}if(this.domNode.classList.remove("no-docs","no-type"),r){const a=r.length>1e5?`${r.substr(0,1e5)}\u2026`:r;this._type.textContent=a,this._type.title=a,tl(this._type),this._type.classList.toggle("auto-wrap",!/\r?\n^\s+/gmi.test(a))}else Ur(this._type),this._type.title="",Qs(this._type),this.domNode.classList.add("no-type");if(Ur(this._docs),typeof s=="string")this._docs.classList.remove("markdown-docs"),this._docs.textContent=s;else if(s){this._docs.classList.add("markdown-docs"),Ur(this._docs);const a=this._markdownRenderer.render(s);this._docs.appendChild(a.element),this._renderDisposeable.add(a),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=a=>{a.preventDefault(),a.stopPropagation()},this._close.onclick=a=>{a.preventDefault(),a.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 size(){return this._size}layout(e,t){const n=new jn(e,t);jn.equals(n,this._size)||(this._size=n,NQe(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}};lU=pyt([myt(1,$t)],lU);class vyt{constructor(e,t){this.widget=e,this._editor=t,this._disposables=new Be,this._added=!1,this._preferAlignAtTop=!0,this._resizable=new sY,this._resizable.domNode.classList.add("suggest-details-container"),this._resizable.domNode.appendChild(e.domNode),this._resizable.enableSashes(!1,!0,!0,!1);let n,o,r=0,s=0;this._disposables.add(this._resizable.onDidWillResize(()=>{n=this._topLeft,o=this._resizable.size})),this._disposables.add(this._resizable.onDidResize(a=>{if(n&&o){this.widget.layout(a.dimension.width,a.dimension.height);let l=!1;a.west&&(s=o.width-a.dimension.width,l=!0),a.north&&(r=o.height-a.dimension.height,l=!0),l&&this._applyTopLeft({top:n.top+r,left:n.left+s})}a.done&&(n=void 0,o=void 0,r=0,s=0,this._userSize=a.dimension)})),this._disposables.add(this.widget.onDidChangeContents(()=>{var a;this._anchorBox&&this._placeAtAnchor(this._anchorBox,(a=this._userSize)!==null&&a!==void 0?a: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 null}show(){this._added||(this._editor.addOverlayWidget(this),this.getDomNode().style.position="fixed",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){var n;const o=e.getBoundingClientRect();this._anchorBox=o,this._preferAlignAtTop=t,this._placeAtAnchor(this._anchorBox,(n=this._userSize)!==null&&n!==void 0?n:this.widget.size,t)}_placeAtAnchor(e,t,n){var o;const r=mS(this.getDomNode().ownerDocument.body),s=this.widget.getLayoutInfo(),a=new jn(220,2*s.lineHeight),l=e.top,c=function(){const w=r.width-(e.left+e.width+s.borderWidth+s.horizontalPadding),y=-s.borderWidth+e.left+e.width,L=new jn(w,r.height-e.top-s.borderHeight-s.verticalPadding),D=L.with(void 0,e.top+e.height-s.borderHeight-s.verticalPadding);return{top:l,left:y,fit:w-t.width,maxSizeTop:L,maxSizeBottom:D,minSize:a.with(Math.min(w,a.width))}}(),u=function(){const w=e.left-s.borderWidth-s.horizontalPadding,y=Math.max(s.horizontalPadding,e.left-t.width-s.borderWidth),L=new jn(w,r.height-e.top-s.borderHeight-s.verticalPadding),D=L.with(void 0,e.top+e.height-s.borderHeight-s.verticalPadding);return{top:l,left:y,fit:w-t.width,maxSizeTop:L,maxSizeBottom:D,minSize:a.with(Math.min(w,a.width))}}(),d=function(){const w=e.left,y=-s.borderWidth+e.top+e.height,L=new jn(e.width-s.borderHeight,r.height-e.top-e.height-s.verticalPadding);return{top:y,left:w,fit:L.height-t.height,maxSizeBottom:L,maxSizeTop:L,minSize:a.with(L.width)}}(),h=[c,u,d],f=(o=h.find(w=>w.fit>=0))!==null&&o!==void 0?o:h.sort((w,y)=>y.fit-w.fit)[0],g=e.top+e.height-s.borderHeight;let p,v=t.height;const m=Math.max(f.maxSizeTop.height,f.maxSizeBottom.height);v>m&&(v=m);let _;n?v<=f.maxSizeTop.height?(p=!0,_=f.maxSizeTop):(p=!1,_=f.maxSizeBottom):v<=f.maxSizeBottom.height?(p=!1,_=f.maxSizeBottom):(p=!0,_=f.maxSizeTop),this._applyTopLeft({left:f.left,top:p?f.top:g-v}),this.getDomNode().style.position="fixed",this._resizable.enableSashes(!p,f===c,p,f!==c),this._resizable.minSize=f.minSize,this._resizable.maxSize=_,this._resizable.layout(v,Math.min(_.width,t.width)),this.widget.layout(this._resizable.size.width,this._resizable.size.height)}_applyTopLeft(e){this._topLeft=e,this.getDomNode().style.left=`${this._topLeft.left}px`,this.getDomNode().style.top=`${this._topLeft.top}px`}}var Vg;(function(i){i[i.FILE=0]="FILE",i[i.FOLDER=1]="FOLDER",i[i.ROOT_FOLDER=2]="ROOT_FOLDER"})(Vg||(Vg={}));const _yt=/(?:\/|^)(?:([^\/]+)\/)?([^\/]+)$/;function sR(i,e,t,n){const o=n===Vg.ROOT_FOLDER?["rootfolder-icon"]:n===Vg.FOLDER?["folder-icon"]:["file-icon"];if(t){let r;if(t.scheme===hn.data)r=kv.parseMetaData(t).get(kv.META_DATA_LABEL);else{const s=t.path.match(_yt);s?(r=aR(s[2].toLowerCase()),s[1]&&o.push(`${aR(s[1].toLowerCase())}-name-dir-icon`)):r=aR(t.authority.toLowerCase())}if(n===Vg.FOLDER)o.push(`${r}-name-folder-icon`);else{if(r){if(o.push(`${r}-name-file-icon`),o.push("name-file-icon"),r.length<=255){const a=r.split(".");for(let l=1;l=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},m7=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},$p;function iSe(i){return`suggest-aria-id:${i}`}const wyt=Eo("suggest-more-info",Xe.chevronRight,C("suggestMoreInfoIcon","Icon for more information in the suggest widget.")),yyt=new($p=class{extract(e,t){if(e.textLabel.match($p._regexStrict))return t[0]=e.textLabel,!0;if(e.completion.detail&&e.completion.detail.match($p._regexStrict))return t[0]=e.completion.detail,!0;if(typeof e.completion.documentation=="string"){const n=$p._regexRelaxed.exec(e.completion.documentation);if(n&&(n.index===0||n.index+n[0].length===e.completion.documentation.length))return t[0]=n[0],!0}return!1}},$p._regexRelaxed=/(#([\da-fA-F]{3}){1,2}|(rgb|hsl)a\(\s*(\d{1,3}%?\s*,\s*){3}(1|0?\.\d+)\)|(rgb|hsl)\(\s*\d{1,3}%?(\s*,\s*\d{1,3}%?){2}\s*\))/,$p._regexStrict=new RegExp(`^${$p._regexRelaxed.source}$`,"i"),$p);let cU=class{constructor(e,t,n,o){this._editor=e,this._modelService=t,this._languageService=n,this._themeService=o,this._onDidToggleDetails=new le,this.onDidToggleDetails=this._onDidToggleDetails.event,this.templateId="suggestion"}dispose(){this._onDidToggleDetails.dispose()}renderTemplate(e){const t=new Be,n=e;n.classList.add("show-file-icons");const o=Ae(e,He(".icon")),r=Ae(o,He("span.colorspan")),s=Ae(e,He(".contents")),a=Ae(s,He(".main")),l=Ae(a,He(".icon-label.codicon")),c=Ae(a,He("span.left")),u=Ae(a,He("span.right")),d=new KP(c,{supportHighlights:!0,supportIcons:!0});t.add(d);const h=Ae(c,He("span.signature-label")),f=Ae(c,He("span.qualifier-label")),g=Ae(u,He("span.details-label")),p=Ae(u,He("span.readMore"+Mt.asCSSSelector(wyt)));p.title=C("readMore","Read More");const v=()=>{const m=this._editor.getOptions(),_=m.get(50),w=_.getMassagedFontFamily(),y=_.fontFeatureSettings,L=m.get(118)||_.fontSize,D=m.get(119)||_.lineHeight,E=_.fontWeight,I=_.letterSpacing,k=`${L}px`,R=`${D}px`,A=`${I}px`;n.style.fontSize=k,n.style.fontWeight=E,n.style.letterSpacing=A,a.style.fontFamily=w,a.style.fontFeatureSettings=y,a.style.lineHeight=R,o.style.height=R,o.style.width=R,p.style.height=R,p.style.width=R};return v(),t.add(this._editor.onDidChangeConfiguration(m=>{(m.hasChanged(50)||m.hasChanged(118)||m.hasChanged(119))&&v()})),{root:n,left:c,right:u,icon:o,colorspan:r,iconLabel:d,iconContainer:l,parametersLabel:h,qualifierLabel:f,detailsLabel:g,readMore:p,disposables:t}}renderElement(e,t,n){const{completion:o}=e;n.root.id=iSe(t),n.colorspan.style.backgroundColor="";const r={labelEscapeNewLines:!0,matches:tT(e.score)},s=[];if(o.kind===19&&yyt.extract(e,s))n.icon.className="icon customcolor",n.iconContainer.className="icon hide",n.colorspan.style.backgroundColor=s[0];else if(o.kind===20&&this._themeService.getFileIconTheme().hasFileIcons){n.icon.className="icon hide",n.iconContainer.className="icon hide";const a=sR(this._modelService,this._languageService,Rt.from({scheme:"fake",path:e.textLabel}),Vg.FILE),l=sR(this._modelService,this._languageService,Rt.from({scheme:"fake",path:o.detail}),Vg.FILE);r.extraClasses=a.length>l.length?a:l}else o.kind===23&&this._themeService.getFileIconTheme().hasFolderIcons?(n.icon.className="icon hide",n.iconContainer.className="icon hide",r.extraClasses=[sR(this._modelService,this._languageService,Rt.from({scheme:"fake",path:e.textLabel}),Vg.FOLDER),sR(this._modelService,this._languageService,Rt.from({scheme:"fake",path:o.detail}),Vg.FOLDER)].flat()):(n.icon.className="icon hide",n.iconContainer.className="",n.iconContainer.classList.add("suggest-icon",...Mt.asClassNameArray(TD.toIcon(o.kind))));o.tags&&o.tags.indexOf(1)>=0&&(r.extraClasses=(r.extraClasses||[]).concat(["deprecated"]),r.matches=[]),n.iconLabel.setLabel(e.textLabel,void 0,r),typeof o.label=="string"?(n.parametersLabel.textContent="",n.detailsLabel.textContent=v7(o.detail||""),n.root.classList.add("string-label")):(n.parametersLabel.textContent=v7(o.label.detail||""),n.detailsLabel.textContent=v7(o.label.description||""),n.root.classList.remove("string-label")),this._editor.getOption(117).showInlineDetails?tl(n.detailsLabel):Qs(n.detailsLabel),IY(e)?(n.right.classList.add("can-expand-details"),tl(n.readMore),n.readMore.onmousedown=a=>{a.stopPropagation(),a.preventDefault()},n.readMore.onclick=a=>{a.stopPropagation(),a.preventDefault(),this._onDidToggleDetails.fire()}):(n.right.classList.remove("can-expand-details"),Qs(n.readMore),n.readMore.onmousedown=null,n.readMore.onclick=null)}disposeTemplate(e){e.disposables.dispose()}};cU=Cyt([m7(1,Yi),m7(2,Ki),m7(3,mr)],cU);function v7(i){return i.replace(/\r\n|\r|\n/g,"")}var Syt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},lR=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},xyt=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},gC;J("editorSuggestWidget.background",{dark:po,light:po,hcDark:po,hcLight:po},C("editorSuggestWidgetBackground","Background color of the suggest widget."));J("editorSuggestWidget.border",{dark:Yh,light:Yh,hcDark:Yh,hcLight:Yh},C("editorSuggestWidgetBorder","Border color of the suggest widget."));const cR=J("editorSuggestWidget.foreground",{dark:yu,light:yu,hcDark:yu,hcLight:yu},C("editorSuggestWidgetForeground","Foreground color of the suggest widget."));J("editorSuggestWidget.selectedForeground",{dark:d0,light:d0,hcDark:d0,hcLight:d0},C("editorSuggestWidgetSelectedForeground","Foreground color of the selected entry in the suggest widget."));J("editorSuggestWidget.selectedIconForeground",{dark:AC,light:AC,hcDark:AC,hcLight:AC},C("editorSuggestWidgetSelectedIconForeground","Icon foreground color of the selected entry in the suggest widget."));const Lyt=J("editorSuggestWidget.selectedBackground",{dark:h0,light:h0,hcDark:h0,hcLight:h0},C("editorSuggestWidgetSelectedBackground","Background color of the selected entry in the suggest widget."));J("editorSuggestWidget.highlightForeground",{dark:Su,light:Su,hcDark:Su,hcLight:Su},C("editorSuggestWidgetHighlightForeground","Color of the match highlights in the suggest widget."));J("editorSuggestWidget.focusHighlightForeground",{dark:s2,light:s2,hcDark:s2,hcLight:s2},C("editorSuggestWidgetFocusHighlightForeground","Color of the match highlights in the suggest widget when an item is focused."));J("editorSuggestWidgetStatus.foreground",{dark:yt(cR,.5),light:yt(cR,.5),hcDark:yt(cR,.5),hcLight:yt(cR,.5)},C("editorSuggestWidgetStatusForeground","Foreground color of the suggest widget status."));class Eyt{constructor(e,t){this._service=e,this._key=`suggestWidget.size/${t.getEditorType()}/${t instanceof Av}`}restore(){var e;const t=(e=this._service.get(this._key,0))!==null&&e!==void 0?e:"";try{const n=JSON.parse(t);if(jn.is(n))return jn.lift(n)}catch{}}store(e){this._service.store(this._key,JSON.stringify(e),0,1)}reset(){this._service.remove(this._key,0)}}let Kk=gC=class{constructor(e,t,n,o,r){this.editor=e,this._storageService=t,this._state=0,this._isAuto=!1,this._pendingLayout=new Kr,this._pendingShowDetails=new Kr,this._ignoreFocusEvents=!1,this._forceRenderingAbove=!1,this._explainMode=!1,this._showTimeout=new $u,this._disposables=new Be,this._onDidSelect=new q0,this._onDidFocus=new q0,this._onDidHide=new le,this._onDidShow=new le,this.onDidSelect=this._onDidSelect.event,this.onDidFocus=this._onDidFocus.event,this.onDidHide=this._onDidHide.event,this.onDidShow=this._onDidShow.event,this._onDetailsKeydown=new le,this.onDetailsKeyDown=this._onDetailsKeydown.event,this.element=new sY,this.element.domNode.classList.add("editor-widget","suggest-widget"),this._contentWidget=new Dyt(this,e),this._persistedSize=new Eyt(t,e);class s{constructor(f,g,p=!1,v=!1){this.persistedSize=f,this.currentSize=g,this.persistHeight=p,this.persistWidth=v}}let a;this._disposables.add(this.element.onDidWillResize(()=>{this._contentWidget.lockPreference(),a=new s(this._persistedSize.restore(),this.element.size)})),this._disposables.add(this.element.onDidResize(h=>{var f,g,p,v;if(this._resize(h.dimension.width,h.dimension.height),a&&(a.persistHeight=a.persistHeight||!!h.north||!!h.south,a.persistWidth=a.persistWidth||!!h.east||!!h.west),!!h.done){if(a){const{itemHeight:m,defaultSize:_}=this.getLayoutInfo(),w=Math.round(m/2);let{width:y,height:L}=this.element.size;(!a.persistHeight||Math.abs(a.currentSize.height-L)<=w)&&(L=(g=(f=a.persistedSize)===null||f===void 0?void 0:f.height)!==null&&g!==void 0?g:_.height),(!a.persistWidth||Math.abs(a.currentSize.width-y)<=w)&&(y=(v=(p=a.persistedSize)===null||p===void 0?void 0:p.width)!==null&&v!==void 0?v:_.width),this._persistedSize.store(new jn(y,L))}this._contentWidget.unlockPreference(),a=void 0}})),this._messageElement=Ae(this.element.domNode,He(".message")),this._listElement=Ae(this.element.domNode,He(".tree"));const l=this._disposables.add(r.createInstance(lU,this.editor));l.onDidClose(this.toggleDetails,this,this._disposables),this._details=new vyt(l,this.editor);const c=()=>this.element.domNode.classList.toggle("no-icons",!this.editor.getOption(117).showIcons);c();const u=r.createInstance(cU,this.editor);this._disposables.add(u),this._disposables.add(u.onDidToggleDetails(()=>this.toggleDetails())),this._list=new Ku("SuggestWidget",this._listElement,{getHeight:h=>this.getLayoutInfo().itemHeight,getTemplateId:h=>"suggestion"},[u],{alwaysConsumeMouseWheel:!0,useShadows:!1,mouseSupport:!1,multipleSelectionSupport:!1,accessibilityProvider:{getRole:()=>"option",getWidgetAriaLabel:()=>C("suggest","Suggest"),getWidgetRole:()=>"listbox",getAriaLabel:h=>{let f=h.textLabel;if(typeof h.completion.label!="string"){const{detail:m,description:_}=h.completion.label;m&&_?f=C("label.full","{0} {1}, {2}",f,m,_):m?f=C("label.detail","{0} {1}",f,m):_&&(f=C("label.desc","{0}, {1}",f,_))}if(!h.isResolved||!this._isDetailsVisible())return f;const{documentation:g,detail:p}=h.completion,v=G0("{0}{1}",p||"",g?typeof g=="string"?g:g.value:"");return C("ariaCurrenttSuggestionReadDetails","{0}, docs: {1}",f,v)}}}),this._list.style(SS({listInactiveFocusBackground:Lyt,listInactiveFocusOutline:Wi})),this._status=r.createInstance(aU,this.element.domNode,ov);const d=()=>this.element.domNode.classList.toggle("with-status-bar",this.editor.getOption(117).showStatusBar);d(),this._disposables.add(o.onDidColorThemeChange(h=>this._onThemeChange(h))),this._onThemeChange(o.getColorTheme()),this._disposables.add(this._list.onMouseDown(h=>this._onListMouseDownOrTap(h))),this._disposables.add(this._list.onTap(h=>this._onListMouseDownOrTap(h))),this._disposables.add(this._list.onDidChangeSelection(h=>this._onListSelection(h))),this._disposables.add(this._list.onDidChangeFocus(h=>this._onListFocus(h))),this._disposables.add(this.editor.onDidChangeCursorSelection(()=>this._onCursorSelectionChanged())),this._disposables.add(this.editor.onDidChangeConfiguration(h=>{h.hasChanged(117)&&(d(),c())})),this._ctxSuggestWidgetVisible=sn.Visible.bindTo(n),this._ctxSuggestWidgetDetailsVisible=sn.DetailsVisible.bindTo(n),this._ctxSuggestWidgetMultipleSuggestions=sn.MultipleSuggestions.bindTo(n),this._ctxSuggestWidgetHasFocusedSuggestion=sn.HasFocusedSuggestion.bindTo(n),this._disposables.add(No(this._details.widget.domNode,"keydown",h=>{this._onDetailsKeydown.fire(h)})),this._disposables.add(this.editor.onMouseDown(h=>this._onEditorMouseDown(h)))}dispose(){var e;this._details.widget.dispose(),this._details.dispose(),this._list.dispose(),this._status.dispose(),this._disposables.dispose(),(e=this._loadingTimeout)===null||e===void 0||e.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!==0&&this._contentWidget.layout()}_onListMouseDownOrTap(e){typeof e.element=="undefined"||typeof e.index=="undefined"||(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 n=this._completionModel;n&&(this._onDidSelect.fire({item:e,index:t,model:n}),this.editor.focus())}_onThemeChange(e){this._details.widget.borderWidth=Hd(e.type)?2:1}_onListFocus(e){var t;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 n=e.elements[0],o=e.indexes[0];n!==this._focusedItem&&((t=this._currentSuggestionDetails)===null||t===void 0||t.cancel(),this._currentSuggestionDetails=void 0,this._focusedItem=n,this._list.reveal(o),this._currentSuggestionDetails=sr(r=>xyt(this,void 0,void 0,function*(){const s=yv(()=>{this._isDetailsVisible()&&this.showDetails(!0)},250),a=r.onCancellationRequested(()=>s.dispose());try{return yield n.resolve(r)}finally{s.dispose(),a.dispose()}})),this._currentSuggestionDetails.then(()=>{o>=this._list.length||n!==this._list.element(o)||(this._ignoreFocusEvents=!0,this._list.splice(o,1,[n]),this._list.setFocus([o]),this._ignoreFocusEvents=!1,this._isDetailsVisible()?this.showDetails(!1):this.element.domNode.classList.remove("docs-side"),this.editor.setAriaOptions({activeDescendant:iSe(o)}))}).catch(en)),this._onDidFocus.fire({item:n,index:o,model:this._completionModel})}_setState(e){if(this._state!==e)switch(this._state=e,this.element.domNode.classList.toggle("frozen",e===4),this.element.domNode.classList.remove("message"),e){case 0:Qs(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 1:this.element.domNode.classList.add("message"),this._messageElement.textContent=gC.LOADING_MESSAGE,Qs(this._listElement,this._status.element),tl(this._messageElement),this._details.hide(),this._show(),this._focusedItem=void 0,Lv(gC.LOADING_MESSAGE);break;case 2:this.element.domNode.classList.add("message"),this._messageElement.textContent=gC.NO_SUGGESTIONS_MESSAGE,Qs(this._listElement,this._status.element),tl(this._messageElement),this._details.hide(),this._show(),this._focusedItem=void 0,Lv(gC.NO_SUGGESTIONS_MESSAGE);break;case 3:Qs(this._messageElement),tl(this._listElement,this._status.element),this._show();break;case 4:Qs(this._messageElement),tl(this._listElement,this._status.element),this._show();break;case 5:Qs(this._messageElement),tl(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===0&&(this._contentWidget.setPosition(this.editor.getPosition()),this._isAuto=!!e,this._isAuto||(this._loadingTimeout=yv(()=>this._setState(1),t)))}showSuggestions(e,t,n,o,r){var s,a;if(this._contentWidget.setPosition(this.editor.getPosition()),(s=this._loadingTimeout)===null||s===void 0||s.dispose(),(a=this._currentSuggestionDetails)===null||a===void 0||a.cancel(),this._currentSuggestionDetails=void 0,this._completionModel!==e&&(this._completionModel=e),n&&this._state!==2&&this._state!==0){this._setState(4);return}const l=this._completionModel.items.length,c=l===0;if(this._ctxSuggestWidgetMultipleSuggestions.set(l>1),c){this._setState(o?0:2),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(n?4:3),this._list.reveal(t,0),this._list.setFocus(r?[]:[t])}finally{this._onDidFocus.resume(),this._onDidSelect.resume()}this._pendingLayout.value=zA(()=>{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 0:return!1;case 5:return this._details.widget.pageDown(),!0;case 1:return!this._isAuto;default:return this._list.focusNextPage(),!0}}selectNext(){switch(this._state){case 0:return!1;case 1:return!this._isAuto;default:return this._list.focusNext(1,!0),!0}}selectLast(){switch(this._state){case 0:return!1;case 5:return this._details.widget.scrollBottom(),!0;case 1:return!this._isAuto;default:return this._list.focusLast(),!0}}selectPreviousPage(){switch(this._state){case 0:return!1;case 5:return this._details.widget.pageUp(),!0;case 1:return!this._isAuto;default:return this._list.focusPreviousPage(),!0}}selectPrevious(){switch(this._state){case 0:return!1;case 1:return!this._isAuto;default:return this._list.focusPrevious(1,!0),!1}}selectFirst(){switch(this._state){case 0:return!1;case 5:return this._details.widget.scrollTop(),!0;case 1:return!this._isAuto;default:return this._list.focusFirst(),!0}}getFocusedItem(){if(this._state!==0&&this._state!==2&&this._state!==1&&this._completionModel&&this._list.getFocus().length>0)return{item:this._list.getFocusedElements()[0],index:this._list.getFocus()[0],model:this._completionModel}}toggleDetailsFocus(){this._state===5?(this._setState(3),this._details.widget.domNode.classList.remove("focused")):this._state===3&&this._isDetailsVisible()&&(this._setState(5),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")):(IY(this._list.getFocusedElements()[0])||this._explainMode)&&(this._state===3||this._state===5||this._state===4)&&(this._ctxSuggestWidgetDetailsVisible.set(!0),this._setDetailsVisible(!0),this.showDetails(!1))}showDetails(e){this._pendingShowDetails.value=zA(()=>{this._pendingShowDetails.clear(),this._details.show(),e?this._details.widget.renderLoading():this._details.widget.renderItem(this._list.getFocusedElements()[0],this._explainMode),this._positionDetails(),this.editor.focus(),this.element.domNode.classList.add("shows-details")})}toggleExplainMode(){this._list.getFocusedElements()[0]&&(this._explainMode=!this._explainMode,this._isDetailsVisible()?this.showDetails(!1):this.toggleDetails())}resetPersistedSize(){this._persistedSize.reset()}hideWidget(){var e;this._pendingLayout.clear(),this._pendingShowDetails.clear(),(e=this._loadingTimeout)===null||e===void 0||e.dispose(),this._setState(0),this._onDidHide.fire(this),this.element.clearSashHoverState();const t=this._persistedSize.restore(),n=Math.ceil(this.getLayoutInfo().itemHeight*4.3);t&&t.heightc&&(l=c);const u=this._completionModel?this._completionModel.stats.pLabelLen*s.typicalHalfwidthCharacterWidth:l,d=s.statusBarHeight+this._list.contentHeight+s.borderHeight,h=s.itemHeight+s.statusBarHeight,f=Yo(this.editor.getDomNode()),g=this.editor.getScrolledVisiblePosition(this.editor.getPosition()),p=f.top+g.top+g.height,v=Math.min(r.height-p-s.verticalPadding,d),m=f.top+g.top-s.verticalPadding,_=Math.min(m,d);let w=Math.min(Math.max(_,v)+s.borderHeight,d);a===((t=this._cappedHeight)===null||t===void 0?void 0:t.capped)&&(a=this._cappedHeight.wanted),aw&&(a=w);const y=150;a>v||this._forceRenderingAbove&&m>y?(this._contentWidget.setPreference(1),this.element.enableSashes(!0,!0,!1,!1),w=_):(this._contentWidget.setPreference(2),this.element.enableSashes(!1,!0,!0,!1),w=v),this.element.preferredSize=new jn(u,s.defaultSize.height),this.element.maxSize=new jn(c,w),this.element.minSize=new jn(220,h),this._cappedHeight=a===d?{wanted:(o=(n=this._cappedHeight)===null||n===void 0?void 0:n.wanted)!==null&&o!==void 0?o:e.height,capped:a}:void 0}this._resize(l,a)}_resize(e,t){const{width:n,height:o}=this.element.maxSize;e=Math.min(n,e),t=Math.min(o,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(){var e;this._isDetailsVisible()&&this._details.placeAtAnchor(this.element.domNode,((e=this._contentWidget.getPosition())===null||e===void 0?void 0:e.preference[0])===2)}getLayoutInfo(){const e=this.editor.getOption(50),t=Za(this.editor.getOption(119)||e.lineHeight,8,1e3),n=!this.editor.getOption(117).showStatusBar||this._state===2||this._state===1?0:t,o=this._details.widget.borderWidth,r=2*o;return{itemHeight:t,statusBarHeight:n,borderWidth:o,borderHeight:r,typicalHalfwidthCharacterWidth:e.typicalHalfwidthCharacterWidth,verticalPadding:22,horizontalPadding:14,defaultSize:new jn(430,n+12*t+r)}}_isDetailsVisible(){return this._storageService.getBoolean("expandSuggestionDocs",0,!1)}_setDetailsVisible(e){this._storageService.store("expandSuggestionDocs",e,0,0)}forceRenderingAbove(){this._forceRenderingAbove||(this._forceRenderingAbove=!0,this._layout(this._persistedSize.restore()))}stopForceRenderingAbove(){this._forceRenderingAbove=!1}};Kk.LOADING_MESSAGE=C("suggestWidget.loading","Loading...");Kk.NO_SUGGESTIONS_MESSAGE=C("suggestWidget.noSuggestions","No suggestions.");Kk=gC=Syt([lR(1,qu),lR(2,Ut),lR(3,mr),lR(4,$t)],Kk);class Dyt{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:n,horizontalPadding:o}=this._widget.getLayoutInfo();return new jn(t+2*n+o,e+2*n)}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 kyt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},eC=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},uU;class Iyt{constructor(e,t){if(this._model=e,this._position=t,e.getLineMaxColumn(t.lineNumber)!==t.column){const o=e.getOffsetAt(t),r=e.getPositionAt(o+1);this._marker=e.deltaDecorations([],[{range:V.fromPositions(t,r),options:{description:"suggest-line-suffix",stickiness:1}}])}}dispose(){this._marker&&!this._model.isDisposed()&&this._model.deltaDecorations(this._marker,[])}delta(e){if(this._model.isDisposed()||this._position.lineNumber!==e.lineNumber)return 0;if(this._marker){const t=this._model.getDecorationRange(this._marker[0]);return this._model.getOffsetAt(t.getStartPosition())-this._model.getOffsetAt(e)}else return this._model.getLineMaxColumn(e.lineNumber)-e.column}}let Lu=uU=class{static get(e){return e.getContribution(uU.ID)}constructor(e,t,n,o,r,s,a){this._memoryService=t,this._commandService=n,this._contextKeyService=o,this._instantiationService=r,this._logService=s,this._telemetryService=a,this._lineSuffix=new Kr,this._toDispose=new Be,this._selectors=new Tyt(d=>d.priority),this._onWillInsertSuggestItem=new le,this.onWillInsertSuggestItem=this._onWillInsertSuggestItem.event,this.editor=e,this.model=r.createInstance(sU,this.editor),this._selectors.register({priority:0,select:(d,h,f)=>this._memoryService.select(d,h,f)});const l=sn.InsertMode.bindTo(o);l.set(e.getOption(117).insertMode),this._toDispose.add(this.model.onDidTrigger(()=>l.set(e.getOption(117).insertMode))),this.widget=this._toDispose.add(new JR(()=>{const d=this._instantiationService.createInstance(Kk,this.editor);this._toDispose.add(d),this._toDispose.add(d.onDidSelect(v=>this._insertSuggestion(v,0),this));const h=new ayt(this.editor,d,this.model,v=>this._insertSuggestion(v,2));this._toDispose.add(h);const f=sn.MakesTextEdit.bindTo(this._contextKeyService),g=sn.HasInsertAndReplaceRange.bindTo(this._contextKeyService),p=sn.CanResolve.bindTo(this._contextKeyService);return this._toDispose.add(zt(()=>{f.reset(),g.reset(),p.reset()})),this._toDispose.add(d.onDidFocus(({item:v})=>{const m=this.editor.getPosition(),_=v.editStart.column,w=m.column;let y=!0;this.editor.getOption(1)==="smart"&&this.model.state===2&&!v.completion.additionalTextEdits&&!(v.completion.insertTextRules&4)&&w-_===v.completion.insertText.length&&(y=this.editor.getModel().getValueInRange({startLineNumber:m.lineNumber,startColumn:_,endLineNumber:m.lineNumber,endColumn:w})!==v.completion.insertText),f.set(y),g.set(!ae.equals(v.editInsertEnd,v.editReplaceEnd)),p.set(Boolean(v.provider.resolveCompletionItem)||Boolean(v.completion.documentation)||v.completion.detail!==v.completion.label)})),this._toDispose.add(d.onDetailsKeyDown(v=>{if(v.toKeyCodeChord().equals(new ap(!0,!1,!1,!1,33))||Nn&&v.toKeyCodeChord().equals(new ap(!1,!1,!1,!0,33))){v.stopPropagation();return}v.toKeyCodeChord().isModifierKey()||this.editor.focus()})),d})),this._overtypingCapturer=this._toDispose.add(new JR(()=>this._toDispose.add(new IF(this.editor,this.model)))),this._alternatives=this._toDispose.add(new JR(()=>this._toDispose.add(new bb(this.editor,this._contextKeyService)))),this._toDispose.add(r.createInstance(jk,e)),this._toDispose.add(this.model.onDidTrigger(d=>{this.widget.value.showTriggered(d.auto,d.shy?250:50),this._lineSuffix.value=new Iyt(this.editor.getModel(),d.position)})),this._toDispose.add(this.model.onDidSuggest(d=>{if(d.triggerOptions.shy)return;let h=-1;for(const g of this._selectors.itemsOrderedByPriorityDesc)if(h=g.select(this.editor.getModel(),this.editor.getPosition(),d.completionModel.items),h!==-1)break;h===-1&&(h=0);let f=!1;if(d.triggerOptions.auto){const g=this.editor.getOption(117);g.selectionMode==="never"||g.selectionMode==="always"?f=g.selectionMode==="never":g.selectionMode==="whenTriggerCharacter"?f=d.triggerOptions.triggerKind!==1:g.selectionMode==="whenQuickSuggestion"&&(f=d.triggerOptions.triggerKind===1&&!d.triggerOptions.refilter)}this.widget.value.showSuggestions(d.completionModel,h,d.isFrozen,d.triggerOptions.auto,f)})),this._toDispose.add(this.model.onDidCancel(d=>{d.retrigger||this.widget.value.hideWidget()})),this._toDispose.add(this.editor.onDidBlurEditorWidget(()=>{this.model.cancel(),this.model.clear()}));const c=sn.AcceptSuggestionsOnEnter.bindTo(o),u=()=>{const d=this.editor.getOption(1);c.set(d==="on"||d==="smart")};this._toDispose.add(this.editor.onDidChangeConfiguration(()=>u())),u()}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 n=qr.get(this.editor);if(!n)return;this._onWillInsertSuggestItem.fire({item:e.item});const o=this.editor.getModel(),r=o.getAlternativeVersionId(),{item:s}=e,a=[],l=new Ro;t&1||this.editor.pushUndoStop();const c=this.getOverwriteInfo(s,Boolean(t&8));this._memoryService.memorize(o,this.editor.getPosition(),s);const u=s.isResolved;let d=-1,h=-1;if(Array.isArray(s.completion.additionalTextEdits)){this.model.cancel();const g=Yd.capture(this.editor);this.editor.executeEdits("suggestController.additionalTextEdits.sync",s.completion.additionalTextEdits.map(p=>Gi.replaceMove(V.lift(p.range),p.text))),g.restoreRelativeVerticalPositionOfCursor(this.editor)}else if(!u){const g=new xs;let p;const v=o.onDidChangeContent(y=>{if(y.isFlush){l.cancel(),v.dispose();return}for(const L of y.changes){const D=V.getEndPosition(L.range);(!p||ae.isBefore(D,p))&&(p=D)}}),m=t;t|=2;let _=!1;const w=this.editor.onWillType(()=>{w.dispose(),_=!0,m&2||this.editor.pushUndoStop()});a.push(s.resolve(l.token).then(()=>{if(!s.completion.additionalTextEdits||l.token.isCancellationRequested)return;if(p&&s.completion.additionalTextEdits.some(L=>ae.isBefore(p,V.getStartPosition(L.range))))return!1;_&&this.editor.pushUndoStop();const y=Yd.capture(this.editor);return this.editor.executeEdits("suggestController.additionalTextEdits.async",s.completion.additionalTextEdits.map(L=>Gi.replaceMove(V.lift(L.range),L.text))),y.restoreRelativeVerticalPositionOfCursor(this.editor),(_||!(m&2))&&this.editor.pushUndoStop(),!0}).then(y=>{this._logService.trace("[suggest] async resolving of edits DONE (ms, applied?)",g.elapsed(),y),h=y===!0?1:y===!1?0:-2}).finally(()=>{v.dispose(),w.dispose()}))}let{insertText:f}=s.completion;if(s.completion.insertTextRules&4||(f=qy.escape(f)),this.model.cancel(),n.insert(f,{overwriteBefore:c.overwriteBefore,overwriteAfter:c.overwriteAfter,undoStopBefore:!1,undoStopAfter:!1,adjustWhitespace:!(s.completion.insertTextRules&1),clipboardText:e.model.clipboardText,overtypingCapturer:this._overtypingCapturer.value}),t&2||this.editor.pushUndoStop(),s.completion.command)if(s.completion.command.id===wT.id)this.model.trigger({auto:!0,retrigger:!0});else{const g=new xs;a.push(this._commandService.executeCommand(s.completion.command.id,...s.completion.command.arguments?[...s.completion.command.arguments]:[]).catch(p=>{s.completion.extensionId?$o(p):en(p)}).finally(()=>{d=g.elapsed()}))}t&4&&this._alternatives.value.set(e,g=>{for(l.cancel();o.canUndo();){r!==o.getAlternativeVersionId()&&o.undo(),this._insertSuggestion(g,3|(t&8?8:0));break}}),this._alertCompletionItem(s),Promise.all(a).finally(()=>{this._reportSuggestionAcceptedTelemetry(s,o,u,d,h),this.model.clear(),l.dispose()})}_reportSuggestionAcceptedTelemetry(e,t,n,o,r){var s,a,l;Math.floor(Math.random()*100)!==0&&this._telemetryService.publicLog2("suggest.acceptedSuggestion",{extensionId:(a=(s=e.extensionId)===null||s===void 0?void 0:s.value)!==null&&a!==void 0?a:"unknown",providerId:(l=e.provider._debugDisplayName)!==null&&l!==void 0?l:"unknown",kind:e.completion.kind,basenameHash:N0e(Hc(t.uri)).toString(16),languageId:t.getLanguageId(),fileExtension:Ast(t.uri),resolveInfo:e.provider.resolveCompletionItem?n?1:0:-1,resolveDuration:e.resolveDuration,commandDuration:o,additionalEditsAsync:r})}getOverwriteInfo(e,t){fi(this.editor.hasModel());let n=this.editor.getOption(117).insertMode==="replace";t&&(n=!n);const o=e.position.column-e.editStart.column,r=(n?e.editReplaceEnd.column:e.editInsertEnd.column)-e.position.column,s=this.editor.getPosition().column-e.position.column,a=this._lineSuffix.value?this._lineSuffix.value.delta(this.editor.getPosition()):0;return{overwriteBefore:o+s,overwriteAfter:r+a}}_alertCompletionItem(e){if(ws(e.completion.additionalTextEdits)){const t=C("aria.alert.snippet","Accepting '{0}' made {1} additional edits",e.textLabel,e.completion.additionalTextEdits.length);bs(t)}}triggerSuggest(e,t,n){this.editor.hasModel()&&(this.model.trigger({auto:t!=null?t:!1,completionOptions:{providerFilter:e,kindFilter:n?new Set:void 0}}),this.editor.revealPosition(this.editor.getPosition(),0),this.editor.focus())}triggerSuggestAndAcceptBest(e){if(!this.editor.hasModel())return;const t=this.editor.getPosition(),n=()=>{t.equals(this.editor.getPosition())&&this._commandService.executeCommand(e.fallback)},o=r=>{if(r.completion.insertTextRules&4||r.completion.additionalTextEdits)return!0;const s=this.editor.getPosition(),a=r.editStart.column,l=s.column;return l-a!==r.completion.insertText.length?!0:this.editor.getModel().getValueInRange({startLineNumber:s.lineNumber,startColumn:a,endLineNumber:s.lineNumber,endColumn:l})!==r.completion.insertText};st.once(this.model.onDidTrigger)(r=>{const s=[];st.any(this.model.onDidTrigger,this.model.onDidCancel)(()=>{si(s),n()},void 0,s),this.model.onDidSuggest(({completionModel:a})=>{if(si(s),a.items.length===0){n();return}const l=this._memoryService.select(this.editor.getModel(),this.editor.getPosition(),a.items),c=a.items[l];if(!o(c)){n();return}this.editor.pushUndoStop(),this._insertSuggestion({index:l,item:c,model:a},7)},void 0,s)}),this.model.trigger({auto:!1,shy:!0}),this.editor.revealPosition(t,0),this.editor.focus()}acceptSelectedSuggestion(e,t){const n=this.widget.value.getFocusedItem();let o=0;e&&(o|=4),t&&(o|=8),this._insertSuggestion(n,o)}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)}};Lu.ID="editor.contrib.suggestController";Lu=uU=kyt([eC(1,kF),eC(2,_o),eC(3,Ut),eC(4,$t),eC(5,tc),eC(6,ec)],Lu);class Tyt{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,n)=>this.prioritySelector(n)-this.prioritySelector(t)),{dispose:()=>{const t=this._items.indexOf(e);t>=0&&this._items.splice(t,1)}}}get itemsOrderedByPriorityDesc(){return this._items}}class wT extends ft{constructor(){super({id:wT.id,label:C("suggest.trigger.label","Trigger Suggest"),alias:"Trigger Suggest",precondition:Me.and(Q.writable,Q.hasCompletionItemProvider,sn.Visible.toNegated()),kbOpts:{kbExpr:Q.textInputFocus,primary:2058,secondary:[2087],mac:{primary:266,secondary:[521,2087]},weight:100}})}run(e,t,n){const o=Lu.get(t);if(!o)return;let r;n&&typeof n=="object"&&n.auto===!0&&(r=!0),o.triggerSuggest(void 0,r,void 0)}}wT.id="editor.action.triggerSuggest";zn(Lu.ID,Lu,2);ze(wT);const Zl=100+90,va=Ir.bindToContribution(Lu.get);Ye(new va({id:"acceptSelectedSuggestion",precondition:Me.and(sn.Visible,sn.HasFocusedSuggestion),handler(i){i.acceptSelectedSuggestion(!0,!1)},kbOpts:[{primary:2,kbExpr:Me.and(sn.Visible,Q.textInputFocus),weight:Zl},{primary:3,kbExpr:Me.and(sn.Visible,Q.textInputFocus,sn.AcceptSuggestionsOnEnter,sn.MakesTextEdit),weight:Zl}],menuOpts:[{menuId:ov,title:C("accept.insert","Insert"),group:"left",order:1,when:sn.HasInsertAndReplaceRange.toNegated()},{menuId:ov,title:C("accept.insert","Insert"),group:"left",order:1,when:Me.and(sn.HasInsertAndReplaceRange,sn.InsertMode.isEqualTo("insert"))},{menuId:ov,title:C("accept.replace","Replace"),group:"left",order:1,when:Me.and(sn.HasInsertAndReplaceRange,sn.InsertMode.isEqualTo("replace"))}]}));Ye(new va({id:"acceptAlternativeSelectedSuggestion",precondition:Me.and(sn.Visible,Q.textInputFocus,sn.HasFocusedSuggestion),kbOpts:{weight:Zl,kbExpr:Q.textInputFocus,primary:1027,secondary:[1026]},handler(i){i.acceptSelectedSuggestion(!1,!0)},menuOpts:[{menuId:ov,group:"left",order:2,when:Me.and(sn.HasInsertAndReplaceRange,sn.InsertMode.isEqualTo("insert")),title:C("accept.replace","Replace")},{menuId:ov,group:"left",order:2,when:Me.and(sn.HasInsertAndReplaceRange,sn.InsertMode.isEqualTo("replace")),title:C("accept.insert","Insert")}]}));Rn.registerCommandAlias("acceptSelectedSuggestionOnEnter","acceptSelectedSuggestion");Ye(new va({id:"hideSuggestWidget",precondition:sn.Visible,handler:i=>i.cancelSuggestWidget(),kbOpts:{weight:Zl,kbExpr:Q.textInputFocus,primary:9,secondary:[1033]}}));Ye(new va({id:"selectNextSuggestion",precondition:Me.and(sn.Visible,Me.or(sn.MultipleSuggestions,sn.HasFocusedSuggestion.negate())),handler:i=>i.selectNextSuggestion(),kbOpts:{weight:Zl,kbExpr:Q.textInputFocus,primary:18,secondary:[2066],mac:{primary:18,secondary:[2066,300]}}}));Ye(new va({id:"selectNextPageSuggestion",precondition:Me.and(sn.Visible,Me.or(sn.MultipleSuggestions,sn.HasFocusedSuggestion.negate())),handler:i=>i.selectNextPageSuggestion(),kbOpts:{weight:Zl,kbExpr:Q.textInputFocus,primary:12,secondary:[2060]}}));Ye(new va({id:"selectLastSuggestion",precondition:Me.and(sn.Visible,Me.or(sn.MultipleSuggestions,sn.HasFocusedSuggestion.negate())),handler:i=>i.selectLastSuggestion()}));Ye(new va({id:"selectPrevSuggestion",precondition:Me.and(sn.Visible,Me.or(sn.MultipleSuggestions,sn.HasFocusedSuggestion.negate())),handler:i=>i.selectPrevSuggestion(),kbOpts:{weight:Zl,kbExpr:Q.textInputFocus,primary:16,secondary:[2064],mac:{primary:16,secondary:[2064,302]}}}));Ye(new va({id:"selectPrevPageSuggestion",precondition:Me.and(sn.Visible,Me.or(sn.MultipleSuggestions,sn.HasFocusedSuggestion.negate())),handler:i=>i.selectPrevPageSuggestion(),kbOpts:{weight:Zl,kbExpr:Q.textInputFocus,primary:11,secondary:[2059]}}));Ye(new va({id:"selectFirstSuggestion",precondition:Me.and(sn.Visible,Me.or(sn.MultipleSuggestions,sn.HasFocusedSuggestion.negate())),handler:i=>i.selectFirstSuggestion()}));Ye(new va({id:"focusSuggestion",precondition:Me.and(sn.Visible,sn.HasFocusedSuggestion.negate()),handler:i=>i.focusSuggestion(),kbOpts:{weight:Zl,kbExpr:Q.textInputFocus,primary:2058,secondary:[2087],mac:{primary:266,secondary:[2087]}}}));Ye(new va({id:"focusAndAcceptSuggestion",precondition:Me.and(sn.Visible,sn.HasFocusedSuggestion.negate()),handler:i=>{i.focusSuggestion(),i.acceptSelectedSuggestion(!0,!1)}}));Ye(new va({id:"toggleSuggestionDetails",precondition:Me.and(sn.Visible,sn.HasFocusedSuggestion),handler:i=>i.toggleSuggestionDetails(),kbOpts:{weight:Zl,kbExpr:Q.textInputFocus,primary:2058,secondary:[2087],mac:{primary:266,secondary:[2087]}},menuOpts:[{menuId:ov,group:"right",order:1,when:Me.and(sn.DetailsVisible,sn.CanResolve),title:C("detail.more","show less")},{menuId:ov,group:"right",order:1,when:Me.and(sn.DetailsVisible.toNegated(),sn.CanResolve),title:C("detail.less","show more")}]}));Ye(new va({id:"toggleExplainMode",precondition:sn.Visible,handler:i=>i.toggleExplainMode(),kbOpts:{weight:100,primary:2138}}));Ye(new va({id:"toggleSuggestionFocus",precondition:sn.Visible,handler:i=>i.toggleSuggestionFocus(),kbOpts:{weight:Zl,kbExpr:Q.textInputFocus,primary:2570,mac:{primary:778}}}));Ye(new va({id:"insertBestCompletion",precondition:Me.and(Q.textInputFocus,Me.equals("config.editor.tabCompletion","on"),jk.AtEnd,sn.Visible.toNegated(),bb.OtherSuggestions.toNegated(),qr.InSnippetMode.toNegated()),handler:(i,e)=>{i.triggerSuggestAndAcceptBest(na(e)?Object.assign({fallback:"tab"},e):{fallback:"tab"})},kbOpts:{weight:Zl,primary:2}}));Ye(new va({id:"insertNextSuggestion",precondition:Me.and(Q.textInputFocus,Me.equals("config.editor.tabCompletion","on"),bb.OtherSuggestions,sn.Visible.toNegated(),qr.InSnippetMode.toNegated()),handler:i=>i.acceptNextSuggestion(),kbOpts:{weight:Zl,kbExpr:Q.textInputFocus,primary:2}}));Ye(new va({id:"insertPrevSuggestion",precondition:Me.and(Q.textInputFocus,Me.equals("config.editor.tabCompletion","on"),bb.OtherSuggestions,sn.Visible.toNegated(),qr.InSnippetMode.toNegated()),handler:i=>i.acceptPrevSuggestion(),kbOpts:{weight:Zl,kbExpr:Q.textInputFocus,primary:1026}}));ze(class extends ft{constructor(){super({id:"editor.action.resetSuggestSize",label:C("suggest.reset.label","Reset Suggest Widget Size"),alias:"Reset Suggest Widget Size",precondition:void 0})}run(i,e){var t;(t=Lu.get(e))===null||t===void 0||t.resetWidgetSize()}});class Nyt extends _e{get selectedItem(){return this._selectedItem}constructor(e,t,n,o){super(),this.editor=e,this.suggestControllerPreselector=t,this.checkModelVersion=n,this.onWillAccept=o,this.isSuggestWidgetVisible=!1,this.isShiftKeyPressed=!1,this._isActive=!1,this._currentSuggestItemInfo=void 0,this._selectedItem=Ai(this,void 0),this._register(e.onKeyDown(s=>{s.shiftKey&&!this.isShiftKeyPressed&&(this.isShiftKeyPressed=!0,this.update(this._isActive))})),this._register(e.onKeyUp(s=>{s.shiftKey&&this.isShiftKeyPressed&&(this.isShiftKeyPressed=!1,this.update(this._isActive))}));const r=Lu.get(this.editor);if(r){this._register(r.registerSelector({priority:100,select:(l,c,u)=>{var d;qi(m=>this.checkModelVersion(m));const h=this.editor.getModel();if(!h)return-1;const f=(d=this.suggestControllerPreselector())===null||d===void 0?void 0:d.removeCommonPrefix(h);if(!f)return-1;const g=ae.lift(c),p=u.map((m,_)=>{const y=ME.fromSuggestion(r,h,g,m,this.isShiftKeyPressed).toSingleTextEdit().removeCommonPrefix(h),L=f.augments(y);return{index:_,valid:L,prefixLength:y.text.length,suggestItem:m}}).filter(m=>m&&m.valid&&m.prefixLength>0),v=A0e(p,Nc(m=>m.prefixLength,zg));return v?v.index:-1}}));let s=!1;const a=()=>{s||(s=!0,this._register(r.widget.value.onDidShow(()=>{this.isSuggestWidgetVisible=!0,this.update(!0)})),this._register(r.widget.value.onDidHide(()=>{this.isSuggestWidgetVisible=!1,this.update(!1)})),this._register(r.widget.value.onDidFocus(()=>{this.isSuggestWidgetVisible=!0,this.update(!0)})))};this._register(st.once(r.model.onDidTrigger)(l=>{a()})),this._register(r.onWillInsertSuggestItem(l=>{const c=this.editor.getPosition(),u=this.editor.getModel();if(!c||!u)return;const d=ME.fromSuggestion(r,u,c,l.item,this.isShiftKeyPressed);this.onWillAccept(d)}))}this.update(this._isActive)}update(e){const t=this.getSuggestItemInfo();(this._isActive!==e||!Ryt(this._currentSuggestItemInfo,t))&&(this._isActive=e,this._currentSuggestItemInfo=t,qi(n=>{this.checkModelVersion(n),this._selectedItem.set(this._isActive?this._currentSuggestItemInfo:void 0,n)}))}getSuggestItemInfo(){const e=Lu.get(this.editor);if(!e||!this.isSuggestWidgetVisible)return;const t=e.widget.value.getFocusedItem(),n=this.editor.getPosition(),o=this.editor.getModel();if(!(!t||!n||!o))return ME.fromSuggestion(e,o,n,t.item,this.isShiftKeyPressed)}stopForceRenderingAbove(){const e=Lu.get(this.editor);e==null||e.stopForceRenderingAbove()}forceRenderingAbove(){const e=Lu.get(this.editor);e==null||e.forceRenderingAbove()}}class ME{static fromSuggestion(e,t,n,o,r){let{insertText:s}=o.completion,a=!1;if(o.completion.insertTextRules&4){const c=new qy().parse(s);c.children.length<100&&xO.adjustWhitespace(t,n,!0,c),s=c.toString(),a=!0}const l=e.getOverwriteInfo(o,r);return new ME(V.fromPositions(n.delta(0,-l.overwriteBefore),n.delta(0,Math.max(l.overwriteAfter,0))),s,o.completion.kind,a)}constructor(e,t,n,o){this.range=e,this.insertText=t,this.completionItemKind=n,this.isSnippetText=o}equals(e){return this.range.equalsRange(e.range)&&this.insertText===e.insertText&&this.completionItemKind===e.completionItemKind&&this.isSnippetText===e.isSnippetText}toSelectedSuggestionInfo(){return new T_e(this.range,this.insertText,this.completionItemKind,this.isSnippetText)}toSingleTextEdit(){return new Gy(this.range,this.insertText)}}function Ryt(i,e){return i===e?!0:!i||!e?!1:i.equals(e)}var Myt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},zp=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},dU;let Ql=dU=class extends _e{static get(e){return e.getContribution(dU.ID)}constructor(e,t,n,o,r,s,a,l,c){super(),this.editor=e,this.instantiationService=t,this.contextKeyService=n,this.configurationService=o,this.commandService=r,this.debounceService=s,this.languageFeaturesService=a,this.audioCueService=l,this._keybindingService=c,this.model=YP("inlineCompletionModel",void 0),this.textModelVersionId=Ai(this,-1),this.cursorPosition=Ai(this,new ae(1,1)),this.suggestWidgetAdaptor=this._register(new Nyt(this.editor,()=>{var h,f;return(f=(h=this.model.get())===null||h===void 0?void 0:h.selectedInlineCompletion.get())===null||f===void 0?void 0:f.toSingleTextEdit(void 0)},h=>this.updateObservables(h,Tl.Other),h=>{qi(f=>{var g;this.updateObservables(f,Tl.Other),(g=this.model.get())===null||g===void 0||g.handleSuggestAccepted(h)})})),this._enabled=$r(this.editor.onDidChangeConfiguration,()=>this.editor.getOption(62).enabled),this.ghostTextWidget=this._register(this.instantiationService.createInstance(tU,this.editor,{ghostText:this.model.map((h,f)=>h==null?void 0:h.ghostText.read(f)),minReservedLineCount:ZP(0),targetTextModel:this.model.map(h=>h==null?void 0:h.textModel)})),this._debounceValue=this.debounceService.for(this.languageFeaturesService.inlineCompletionsProvider,"InlineCompletionsDebounce",{min:50,max:50}),this._register(new Dr(this.contextKeyService,this.model)),this._register(st.runAndSubscribe(e.onDidChangeModel,()=>qi(h=>{this.model.set(void 0,h),this.updateObservables(h,Tl.Other);const f=e.getModel();if(f){const g=t.createInstance(iU,f,this.suggestWidgetAdaptor.selectedItem,this.cursorPosition,this.textModelVersionId,this._debounceValue,$r(e.onDidChangeConfiguration,()=>e.getOption(117).preview),$r(e.onDidChangeConfiguration,()=>e.getOption(117).previewMode),$r(e.onDidChangeConfiguration,()=>e.getOption(62).mode),this._enabled);this.model.set(g,h)}})));const u=h=>{var f;return h.isUndoing?Tl.Undo:h.isRedoing?Tl.Redo:!((f=this.model.get())===null||f===void 0)&&f.isAcceptingPartially?Tl.AcceptWord:Tl.Other};this._register(e.onDidChangeModelContent(h=>qi(f=>this.updateObservables(f,u(h))))),this._register(e.onDidChangeCursorPosition(h=>qi(f=>{var g;this.updateObservables(f,Tl.Other),(h.reason===3||h.source==="api")&&((g=this.model.get())===null||g===void 0||g.stop(f))}))),this._register(e.onDidType(()=>qi(h=>{var f;this.updateObservables(h,Tl.Other),this._enabled.get()&&((f=this.model.get())===null||f===void 0||f.trigger(h))}))),this._register(this.commandService.onDidExecuteCommand(h=>{new Set([Ew.Tab.id,Ew.DeleteLeft.id,Ew.DeleteRight.id,mye,"acceptSelectedSuggestion"]).has(h.commandId)&&e.hasTextFocus()&&this._enabled.get()&&qi(g=>{var p;(p=this.model.get())===null||p===void 0||p.trigger(g)})})),this._register(this.editor.onDidBlurEditorWidget(()=>{this.contextKeyService.getContextKeyValue("accessibleViewIsShown")||this.configurationService.getValue("editor.inlineSuggest.keepOnBlur")||e.getOption(62).keepOnBlur||Bv.dropDownVisible||qi(h=>{var f;(f=this.model.get())===null||f===void 0||f.stop(h)})})),this._register(Ii(h=>{var f;const g=(f=this.model.read(h))===null||f===void 0?void 0:f.state.read(h);g!=null&&g.suggestItem?g.ghostText.lineCount>=2&&this.suggestWidgetAdaptor.forceRenderingAbove():this.suggestWidgetAdaptor.stopForceRenderingAbove()})),this._register(zt(()=>{this.suggestWidgetAdaptor.stopForceRenderingAbove()}));let d;this._register(Ii(h=>{const f=this.model.read(h),g=f==null?void 0:f.state.read(h);if(!f||!g||!g.inlineCompletion){d=void 0;return}if(g.inlineCompletion.semanticId!==d){d=g.inlineCompletion.semanticId;const p=f.textModel.getLineContent(g.ghostText.lineNumber);this.audioCueService.playAudioCue(Wn.inlineSuggestion).then(()=>{this.editor.getOption(8)&&this.provideScreenReaderUpdate(g.ghostText.renderForScreenReader(p))})}})),this._register(new Rz(this.editor,this.model,this.instantiationService)),this._register(this.configurationService.onDidChangeConfiguration(h=>{h.affectsConfiguration("accessibility.verbosity.inlineCompletions")&&this.editor.updateOptions({inlineCompletionsAccessibilityVerbose:this.configurationService.getValue("accessibility.verbosity.inlineCompletions")})})),this.editor.updateOptions({inlineCompletionsAccessibilityVerbose:this.configurationService.getValue("accessibility.verbosity.inlineCompletions")})}provideScreenReaderUpdate(e){const t=this.contextKeyService.getContextKeyValue("accessibleViewIsShown"),n=this._keybindingService.lookupKeybinding("editor.action.accessibleView");let o;!t&&n&&this.editor.getOption(147)&&(o=C("showAccessibleViewHint","Inspect this in the accessible view ({0})",n.getAriaLabel())),bs(o?e+", "+o:e)}updateObservables(e,t){var n,o;const r=this.editor.getModel();this.textModelVersionId.set((n=r==null?void 0:r.getVersionId())!==null&&n!==void 0?n:-1,e,t),this.cursorPosition.set((o=this.editor.getPosition())!==null&&o!==void 0?o:new ae(1,1),e)}shouldShowHoverAt(e){var t;const n=(t=this.model.get())===null||t===void 0?void 0:t.ghostText.get();return n?n.parts.some(o=>e.containsPosition(new ae(n.lineNumber,o.column))):!1}shouldShowHoverAtViewZone(e){return this.ghostTextWidget.ownsViewZone(e)}};Ql.ID="editor.contrib.inlineCompletionsController";Ql=dU=Myt([zp(1,$t),zp(2,Ut),zp(3,En),zp(4,_o),zp(5,Kc),zp(6,pt),zp(7,lT),zp(8,xi)],Ql);var t_=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};class TF extends ft{constructor(){super({id:TF.ID,label:C("action.inlineSuggest.showNext","Show Next Inline Suggestion"),alias:"Show Next Inline Suggestion",precondition:Me.and(Q.writable,Dr.inlineSuggestionVisible),kbOpts:{weight:100,primary:606}})}run(e,t){var n;return t_(this,void 0,void 0,function*(){const o=Ql.get(t);(n=o==null?void 0:o.model.get())===null||n===void 0||n.next()})}}TF.ID=_ye;class NF extends ft{constructor(){super({id:NF.ID,label:C("action.inlineSuggest.showPrevious","Show Previous Inline Suggestion"),alias:"Show Previous Inline Suggestion",precondition:Me.and(Q.writable,Dr.inlineSuggestionVisible),kbOpts:{weight:100,primary:604}})}run(e,t){var n;return t_(this,void 0,void 0,function*(){const o=Ql.get(t);(n=o==null?void 0:o.model.get())===null||n===void 0||n.previous()})}}NF.ID=vye;class Ayt extends ft{constructor(){super({id:"editor.action.inlineSuggest.trigger",label:C("action.inlineSuggest.trigger","Trigger Inline Suggestion"),alias:"Trigger Inline Suggestion",precondition:Q.writable})}run(e,t){var n;return t_(this,void 0,void 0,function*(){const o=Ql.get(t);(n=o==null?void 0:o.model.get())===null||n===void 0||n.triggerExplicitly()})}}class Pyt extends ft{constructor(){super({id:"editor.action.inlineSuggest.acceptNextWord",label:C("action.inlineSuggest.acceptNextWord","Accept Next Word Of Inline Suggestion"),alias:"Accept Next Word Of Inline Suggestion",precondition:Me.and(Q.writable,Dr.inlineSuggestionVisible),kbOpts:{weight:100+1,primary:2065,kbExpr:Me.and(Q.writable,Dr.inlineSuggestionVisible)},menuOpts:[{menuId:Z.InlineSuggestionToolbar,title:C("acceptWord","Accept Word"),group:"primary",order:2}]})}run(e,t){var n;return t_(this,void 0,void 0,function*(){const o=Ql.get(t);yield(n=o==null?void 0:o.model.get())===null||n===void 0?void 0:n.acceptNextWord(o.editor)})}}class Oyt extends ft{constructor(){super({id:"editor.action.inlineSuggest.acceptNextLine",label:C("action.inlineSuggest.acceptNextLine","Accept Next Line Of Inline Suggestion"),alias:"Accept Next Line Of Inline Suggestion",precondition:Me.and(Q.writable,Dr.inlineSuggestionVisible),kbOpts:{weight:100+1},menuOpts:[{menuId:Z.InlineSuggestionToolbar,title:C("acceptLine","Accept Line"),group:"secondary",order:2}]})}run(e,t){var n;return t_(this,void 0,void 0,function*(){const o=Ql.get(t);yield(n=o==null?void 0:o.model.get())===null||n===void 0?void 0:n.acceptNextLine(o.editor)})}}class Fyt extends ft{constructor(){super({id:mye,label:C("action.inlineSuggest.accept","Accept Inline Suggestion"),alias:"Accept Inline Suggestion",precondition:Dr.inlineSuggestionVisible,menuOpts:[{menuId:Z.InlineSuggestionToolbar,title:C("accept","Accept"),group:"primary",order:1}],kbOpts:{primary:2,weight:200,kbExpr:Me.and(Dr.inlineSuggestionVisible,Q.tabMovesFocus.toNegated(),Dr.inlineSuggestionHasIndentationLessThanTabSize,sn.Visible.toNegated(),Q.hoverFocused.toNegated())}})}run(e,t){var n;return t_(this,void 0,void 0,function*(){const o=Ql.get(t);o&&((n=o.model.get())===null||n===void 0||n.accept(o.editor),o.editor.focus())})}}class RF extends ft{constructor(){super({id:RF.ID,label:C("action.inlineSuggest.hide","Hide Inline Suggestion"),alias:"Hide Inline Suggestion",precondition:Dr.inlineSuggestionVisible,kbOpts:{weight:100,primary:9}})}run(e,t){return t_(this,void 0,void 0,function*(){const n=Ql.get(t);qi(o=>{var r;(r=n==null?void 0:n.model.get())===null||r===void 0||r.stop(o)})})}}RF.ID="editor.action.inlineSuggest.hide";class MF extends Jl{constructor(){super({id:MF.ID,title:C("action.inlineSuggest.alwaysShowToolbar","Always Show Toolbar"),f1:!1,precondition:void 0,menu:[{id:Z.InlineSuggestionToolbar,group:"secondary",order:10}],toggled:Me.equals("config.editor.inlineSuggest.showToolbar","always")})}run(e,t){return t_(this,void 0,void 0,function*(){const n=e.get(En),r=n.getValue("editor.inlineSuggest.showToolbar")==="always"?"onHover":"always";n.updateValue("editor.inlineSuggest.showToolbar",r)})}}MF.ID="editor.action.inlineSuggest.toggleAlwaysShowToolbar";var Byt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},tL=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};class Wyt{constructor(e,t,n){this.owner=e,this.range=t,this.controller=n}isValidForHoverAnchor(e){return e.type===1&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}let hU=class{constructor(e,t,n,o,r,s){this._editor=e,this._languageService=t,this._openerService=n,this.accessibilityService=o,this._instantiationService=r,this._telemetryService=s,this.hoverOrdinal=4}suggestHoverAnchor(e){const t=Ql.get(this._editor);if(!t)return null;const n=e.target;if(n.type===8){const o=n.detail;if(t.shouldShowHoverAtViewZone(o.viewZoneId))return new xM(1e3,this,V.fromPositions(this._editor.getModel().validatePosition(o.positionBefore||o.position)),e.event.posx,e.event.posy,!1)}return n.type===7&&t.shouldShowHoverAt(n.range)?new xM(1e3,this,n.range,e.event.posx,e.event.posy,!1):n.type===6&&n.detail.mightBeForeignElement&&t.shouldShowHoverAt(n.range)?new xM(1e3,this,n.range,e.event.posx,e.event.posy,!1):null}computeSync(e,t){if(this._editor.getOption(62).showToolbar==="always")return[];const n=Ql.get(this._editor);return n&&n.shouldShowHoverAt(e.range)?[new Wyt(this,e.range,n)]:[]}renderHoverParts(e,t){const n=new Be,o=t[0];this._telemetryService.publicLog2("inlineCompletionHover.shown"),this.accessibilityService.isScreenReaderOptimized()&&!this._editor.getOption(8)&&this.renderScreenReaderText(e,o,n);const r=o.controller.model.get(),s=this._instantiationService.createInstance(Bv,this._editor,!1,ZP(null),r.selectedInlineCompletionIndex,r.inlineCompletionsCount,r.selectedInlineCompletion.map(a=>{var l;return(l=a==null?void 0:a.inlineCompletion.source.inlineCompletions.commands)!==null&&l!==void 0?l:[]}));return e.fragment.appendChild(s.getDomNode()),r.triggerExplicitly(),n.add(s),n}renderScreenReaderText(e,t,n){const o=He,r=o("div.hover-row.markdown-hover"),s=Ae(r,o("div.hover-contents",{["aria-live"]:"assertive"})),a=n.add(new cp({editor:this._editor},this._languageService,this._openerService)),l=c=>{n.add(a.onDidRenderAsync(()=>{s.className="hover-contents code-hover-contents",e.onContentsChanged()}));const u=C("inlineSuggestionFollows","Suggestion:"),d=n.add(a.render(new is().appendText(u).appendCodeblock("text",c)));s.replaceChildren(d.element)};n.add(Ii(c=>{var u;const d=(u=t.controller.model.read(c))===null||u===void 0?void 0:u.ghostText.read(c);if(d){const h=this._editor.getModel().getLineContent(d.lineNumber);l(d.renderForScreenReader(h))}else jr(s)})),e.fragment.appendChild(r)}};hU=Byt([tL(1,Ki),tL(2,pl),tL(3,pp),tL(4,$t),tL(5,ec)],hU);zn(Ql.ID,Ql,3);ze(Ayt);ze(TF);ze(NF);ze(Pyt);ze(Oyt);ze(Fyt);ze(RF);$i(MF);Jb.register(hU);function Ya(i,e){let t=0;for(let n=0;n=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Hyt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};function oSe(i,e,t,n,o){if(i.getLineCount()===1&&i.getLineMaxColumn(1)===1)return[];const r=e.getLanguageConfiguration(i.getLanguageId()).indentationRules;if(!r)return[];for(n=Math.min(n,i.getLineCount());t<=n&&r.unIndentedLinePattern;){const v=i.getLineContent(t);if(!r.unIndentedLinePattern.test(v))break;t++}if(t>n-1)return[];const{tabSize:s,indentSize:a,insertSpaces:l}=i.getOptions(),c=(v,m)=>(m=m||1,Lc.shiftIndent(v,v.length+m,s,a,l)),u=(v,m)=>(m=m||1,Lc.unshiftIndent(v,v.length+m,s,a,l)),d=[];let h;const f=i.getLineContent(t);let g=f;if(o!=null){h=o;const v=Si(f);g=h+f.substring(v.length),r.decreaseIndentPattern&&r.decreaseIndentPattern.test(g)&&(h=u(h),g=h+f.substring(v.length)),f!==g&&d.push(Gi.replaceMove(new gt(t,1,t,v.length+1),aP(h,a,l)))}else h=Si(f);let p=h;r.increaseIndentPattern&&r.increaseIndentPattern.test(g)?(p=c(p),h=c(h)):r.indentNextLinePattern&&r.indentNextLinePattern.test(g)&&(p=c(p)),t++;for(let v=t;v<=n;v++){const m=i.getLineContent(v),_=Si(m),w=p+m.substring(_.length);r.decreaseIndentPattern&&r.decreaseIndentPattern.test(w)&&(p=u(p),h=u(h)),_!==p&&d.push(Gi.replaceMove(new gt(v,1,v,_.length+1),aP(p,a,l))),!(r.unIndentedLinePattern&&r.unIndentedLinePattern.test(m))&&(r.increaseIndentPattern&&r.increaseIndentPattern.test(w)?(h=c(h),p=h):r.indentNextLinePattern&&r.indentNextLinePattern.test(w)?p=c(p):p=h)}return d}class AF extends ft{constructor(){super({id:AF.ID,label:C("indentationToSpaces","Convert Indentation to Spaces"),alias:"Convert Indentation to Spaces",precondition:Q.writable})}run(e,t){const n=t.getModel();if(!n)return;const o=n.getOptions(),r=t.getSelection();if(!r)return;const s=new jyt(r,o.tabSize);t.pushUndoStop(),t.executeCommands(this.id,[s]),t.pushUndoStop(),n.updateOptions({insertSpaces:!0})}}AF.ID="editor.action.indentationToSpaces";class PF extends ft{constructor(){super({id:PF.ID,label:C("indentationToTabs","Convert Indentation to Tabs"),alias:"Convert Indentation to Tabs",precondition:Q.writable})}run(e,t){const n=t.getModel();if(!n)return;const o=n.getOptions(),r=t.getSelection();if(!r)return;const s=new Kyt(r,o.tabSize);t.pushUndoStop(),t.executeCommands(this.id,[s]),t.pushUndoStop(),n.updateOptions({insertSpaces:!1})}}PF.ID="editor.action.indentationToTabs";class TY extends ft{constructor(e,t,n){super(n),this.insertSpaces=e,this.displaySizeOnly=t}run(e,t){const n=e.get(lh),o=e.get(Yi),r=t.getModel();if(!r)return;const s=o.getCreationOptions(r.getLanguageId(),r.uri,r.isForSimpleWidget),a=r.getOptions(),l=[1,2,3,4,5,6,7,8].map(u=>({id:u.toString(),label:u.toString(),description:u===s.tabSize&&u===a.tabSize?C("configuredTabSize","Configured Tab Size"):u===s.tabSize?C("defaultTabSize","Default Tab Size"):u===a.tabSize?C("currentTabSize","Current Tab Size"):void 0})),c=Math.min(r.getOptions().tabSize-1,7);setTimeout(()=>{n.pick(l,{placeHolder:C({key:"selectTabWidth",comment:["Tab corresponds to the tab key"]},"Select Tab Size for Current File"),activeItem:l[c]}).then(u=>{if(u&&r&&!r.isDisposed()){const d=parseInt(u.label,10);this.displaySizeOnly?r.updateOptions({tabSize:d}):r.updateOptions({tabSize:d,indentSize:d,insertSpaces:this.insertSpaces})}})},50)}}class OF extends TY{constructor(){super(!1,!1,{id:OF.ID,label:C("indentUsingTabs","Indent Using Tabs"),alias:"Indent Using Tabs",precondition:void 0})}}OF.ID="editor.action.indentUsingTabs";class FF extends TY{constructor(){super(!0,!1,{id:FF.ID,label:C("indentUsingSpaces","Indent Using Spaces"),alias:"Indent Using Spaces",precondition:void 0})}}FF.ID="editor.action.indentUsingSpaces";class BF extends TY{constructor(){super(!0,!0,{id:BF.ID,label:C("changeTabDisplaySize","Change Tab Display Size"),alias:"Change Tab Display Size",precondition:void 0})}}BF.ID="editor.action.changeTabDisplaySize";class WF extends ft{constructor(){super({id:WF.ID,label:C("detectIndentation","Detect Indentation from Content"),alias:"Detect Indentation from Content",precondition:void 0})}run(e,t){const n=e.get(Yi),o=t.getModel();if(!o)return;const r=n.getCreationOptions(o.getLanguageId(),o.uri,o.isForSimpleWidget);o.detectIndentation(r.insertSpaces,r.tabSize)}}WF.ID="editor.action.detectIndentation";class $yt extends ft{constructor(){super({id:"editor.action.reindentlines",label:C("editor.reindentlines","Reindent Lines"),alias:"Reindent Lines",precondition:Q.writable})}run(e,t){const n=e.get(Ti),o=t.getModel();if(!o)return;const r=oSe(o,n,1,o.getLineCount());r.length>0&&(t.pushUndoStop(),t.executeEdits(this.id,r),t.pushUndoStop())}}class zyt extends ft{constructor(){super({id:"editor.action.reindentselectedlines",label:C("editor.reindentselectedlines","Reindent Selected Lines"),alias:"Reindent Selected Lines",precondition:Q.writable})}run(e,t){const n=e.get(Ti),o=t.getModel();if(!o)return;const r=t.getSelections();if(r===null)return;const s=[];for(const a of r){let l=a.startLineNumber,c=a.endLineNumber;if(l!==c&&a.endColumn===1&&c--,l===1){if(l===c)continue}else l--;const u=oSe(o,n,l,c);s.push(...u)}s.length>0&&(t.pushUndoStop(),t.executeEdits(this.id,s),t.pushUndoStop())}}class Uyt{constructor(e,t){this._initialSelection=t,this._edits=[],this._selectionId=null;for(const n of e)n.range&&typeof n.text=="string"&&this._edits.push(n)}getEditOperations(e,t){for(const o of this._edits)t.addEditOperation(V.lift(o.range),o.text);let n=!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?(n=!0,this._selectionId=t.trackSelection(this._initialSelection,!0)):this._edits[0].range.endColumn===this._initialSelection.startColumn&&this._edits[0].range.endLineNumber===this._initialSelection.startLineNumber&&(n=!0,this._selectionId=t.trackSelection(this._initialSelection,!1))),n||(this._selectionId=t.trackSelection(this._initialSelection))}computeCursorState(e,t){return t.getTrackedSelection(this._selectionId)}}let qk=class{constructor(e,t){this.editor=e,this._languageConfigurationService=t,this.callOnDispose=new Be,this.callOnModel=new Be,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(12)<4||this.editor.getOption(55))&&(!this.editor.hasModel()||this.callOnModel.add(this.editor.onDidPaste(({range:e})=>{this.trigger(e)})))}trigger(e){const t=this.editor.getSelections();if(t===null||t.length>1)return;const n=this.editor.getModel();if(!n||!n.tokenization.isCheapToTokenize(e.getStartPosition().lineNumber))return;const o=this.editor.getOption(12),{tabSize:r,indentSize:s,insertSpaces:a}=n.getOptions(),l=[],c={shiftIndent:f=>Lc.shiftIndent(f,f.length+1,r,s,a),unshiftIndent:f=>Lc.unshiftIndent(f,f.length+1,r,s,a)};let u=e.startLineNumber;for(;u<=e.endLineNumber;){if(this.shouldIgnoreLine(n,u)){u++;continue}break}if(u>e.endLineNumber)return;let d=n.getLineContent(u);if(!/\S/.test(d.substring(0,e.startColumn-1))){const f=hE(o,n,n.getLanguageId(),u,c,this._languageConfigurationService);if(f!==null){const g=Si(d),p=Ya(f,r),v=Ya(g,r);if(p!==v){const m=AE(p,r,a);l.push({range:new V(u,1,u,g.length+1),text:m}),d=m+d.substr(g.length)}else{const m=wbe(n,u,this._languageConfigurationService);if(m===0||m===8)return}}}const h=u;for(;un.tokenization.getLineTokens(p),getLanguageId:()=>n.getLanguageId(),getLanguageIdAtPosition:(p,v)=>n.getLanguageIdAtPosition(p,v)},getLineContent:p=>p===h?d:n.getLineContent(p)},n.getLanguageId(),u+1,c,this._languageConfigurationService);if(g!==null){const p=Ya(g,r),v=Ya(Si(n.getLineContent(u+1)),r);if(p!==v){const m=p-v;for(let _=u+1;_<=e.endLineNumber;_++){const w=n.getLineContent(_),y=Si(w),D=Ya(y,r)+m,E=AE(D,r,a);E!==y&&l.push({range:new V(_,1,_,y.length+1),text:E})}}}}if(l.length>0){this.editor.pushUndoStop();const f=new Uyt(l,this.editor.getSelection());this.editor.executeCommand("autoIndentOnPaste",f),this.editor.pushUndoStop()}}shouldIgnoreLine(e,t){e.tokenization.forceTokenization(t);const n=e.getLineFirstNonWhitespaceColumn(t);if(n===0)return!0;const o=e.tokenization.getLineTokens(t);if(o.getCount()>0){const r=o.findTokenIndexAtOffset(n);if(r>=0&&o.getStandardTokenType(r)===1)return!0}return!1}dispose(){this.callOnDispose.dispose(),this.callOnModel.dispose()}};qk.ID="editor.contrib.autoIndentOnPaste";qk=Vyt([Hyt(1,Ti)],qk);function rSe(i,e,t,n){if(i.getLineCount()===1&&i.getLineMaxColumn(1)===1)return;let o="";for(let s=0;sthis._currentResolve=void 0)),yield this._currentResolve}})}_doResolve(e){var t,n;return LO(this,void 0,void 0,function*(){try{const o=yield Promise.resolve(this.provider.resolveInlayHint(this.hint,e));this.hint.tooltip=(t=o==null?void 0:o.tooltip)!==null&&t!==void 0?t:this.hint.tooltip,this.hint.label=(n=o==null?void 0:o.label)!==null&&n!==void 0?n:this.hint.label,this._isResolved=!0}catch(o){$o(o),this._isResolved=!1}})}}class Gk{static create(e,t,n,o){return LO(this,void 0,void 0,function*(){const r=[],s=e.ordered(t).reverse().map(a=>n.map(l=>LO(this,void 0,void 0,function*(){try{const c=yield a.provideInlayHints(t,l,o);c!=null&&c.hints.length&&r.push([c,a])}catch(c){$o(c)}})));if(yield Promise.all(s.flat()),o.isCancellationRequested||t.isDisposed())throw new Gv;return new Gk(n,r,t)})}constructor(e,t,n){this._disposables=new Be,this.ranges=e,this.provider=new Set;const o=[];for(const[r,s]of t){this._disposables.add(r),this.provider.add(s);for(const a of r.hints){const l=n.validatePosition(a.position);let c="before";const u=Gk._getRangeAtPosition(n,l);let d;u.getStartPosition().isBefore(l)?(d=V.fromPositions(u.getStartPosition(),l),c="after"):(d=V.fromPositions(l,u.getEndPosition()),c="before"),o.push(new NY(a,new sSe(d,c),s))}}this.items=o.sort((r,s)=>ae.compare(r.hint.position,s.hint.position))}dispose(){this._disposables.dispose()}static _getRangeAtPosition(e,t){const n=t.lineNumber,o=e.getWordAtPosition(t);if(o)return new V(n,o.startColumn,n,o.endColumn);e.tokenization.tokenizeIfCheap(n);const r=e.tokenization.getLineTokens(n),s=t.column-1,a=r.findTokenIndexAtOffset(s);let l=r.getStartOffset(a),c=r.getEndOffset(a);return c-l===1&&(l===s&&a>1?(l=r.getStartOffset(a-1),c=r.getEndOffset(a-1)):c===s&&aIC(g)?g.command.id:vF()));for(const g of Fs.all())h.has(g.desc.id)&&d.push(new la(g.desc.id,Ou.label(g.desc,{renderShortTitle:!0}),void 0,!0,()=>PE(this,void 0,void 0,function*(){const p=yield r.createModelReference(u.uri);try{const v=new Hy(p.object.textEditorModel,V.getStartPosition(u.range)),m=n.item.anchor.range;yield l.invokeFunction(g.runEditorCommand.bind(g),e,v,m)}finally{p.dispose()}})));if(n.part.command){const{command:g}=n.part;d.push(new kr),d.push(new la(g.id,g.title,void 0,!0,()=>PE(this,void 0,void 0,function*(){var p;try{yield a.executeCommand(g.id,...(p=g.arguments)!==null&&p!==void 0?p:[])}catch(v){c.notify({severity:L5.Error,source:n.item.provider.displayName,message:v})}})))}const f=e.getOption(126);s.showContextMenu({domForShadowRoot:f&&(o=e.getDomNode())!==null&&o!==void 0?o:void 0,getAnchor:()=>{const g=Yo(t);return{x:g.left,y:g.top+g.height+8}},getActions:()=>d,onHide:()=>{e.focus()},autoSelectFirstItem:!0})})}function aSe(i,e,t,n){return PE(this,void 0,void 0,function*(){const r=yield i.get($a).createModelReference(n.uri);yield t.invokeWithinContext(s=>PE(this,void 0,void 0,function*(){const a=e.hasSideBySideModifier,l=s.get(Ut),c=Va.inPeekEditor.getValue(l),u=!a&&t.getOption(87)&&!c;return new bT({openToSide:a,openInPeek:u,muteMessage:!0},{title:{value:"",original:""},id:"",precondition:void 0}).run(s,new Hy(r.object.textEditorModel,V.getStartPosition(n.range)),V.lift(n.range))})),r.dispose()})}var Xyt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},tC=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},pC=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},kM;class EO{constructor(){this._entries=new Yv(50)}get(e){const t=EO._key(e);return this._entries.get(t)}set(e,t){const n=EO._key(e);this._entries.set(n,t)}static _key(e){return`${e.uri.toString()}/${e.getVersionId()}`}}const lSe=wn("IInlayHintsCache");Mn(lSe,EO,1);class fU{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 Yyt{constructor(e,t){this.part=e,this.hasTriggerModifier=t}}let Cb=kM=class{static get(e){var t;return(t=e.getContribution(kM.ID))!==null&&t!==void 0?t:void 0}constructor(e,t,n,o,r,s,a){this._editor=e,this._languageFeaturesService=t,this._inlayHintsCache=o,this._commandService=r,this._notificationService=s,this._instaService=a,this._disposables=new Be,this._sessionDisposables=new Be,this._decorationsMetadata=new Map,this._ruleFactory=new jI(this._editor),this._activeRenderMode=0,this._debounceInfo=n.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(l=>{l.hasChanged(139)&&this._update()})),this._update()}dispose(){this._sessionDisposables.dispose(),this._removeAllDecorations(),this._disposables.dispose()}_update(){this._sessionDisposables.clear(),this._removeAllDecorations();const e=this._editor.getOption(139);if(e.enabled==="off")return;const t=this._editor.getModel();if(!t||!this._languageFeaturesService.inlayHintsProvider.has(t))return;const n=this._inlayHintsCache.get(t);n&&this._updateHintsDecorators([t.getFullModelRange()],n),this._sessionDisposables.add(zt(()=>{t.isDisposed()||this._cacheHintsForFastRestore(t)}));let o;const r=new Set,s=new bi(()=>pC(this,void 0,void 0,function*(){const a=Date.now();o==null||o.dispose(!0),o=new Ro;const l=t.onWillDispose(()=>o==null?void 0:o.cancel());try{const c=o.token,u=yield Gk.create(this._languageFeaturesService.inlayHintsProvider,t,this._getHintsRanges(),c);if(s.delay=this._debounceInfo.update(t,Date.now()-a),c.isCancellationRequested){u.dispose();return}for(const d of u.provider)typeof d.onDidChangeInlayHints=="function"&&!r.has(d)&&(r.add(d),this._sessionDisposables.add(d.onDidChangeInlayHints(()=>{s.isScheduled()||s.schedule()})));this._sessionDisposables.add(u),this._updateHintsDecorators(u.ranges,u.items),this._cacheHintsForFastRestore(t)}catch(c){en(c)}finally{o.dispose(),l.dispose()}}),this._debounceInfo.get(t));if(this._sessionDisposables.add(s),this._sessionDisposables.add(zt(()=>o==null?void 0:o.dispose(!0))),s.schedule(0),this._sessionDisposables.add(this._editor.onDidScrollChange(a=>{(a.scrollTopChanged||!s.isScheduled())&&s.schedule()})),this._sessionDisposables.add(this._editor.onDidChangeModelContent(a=>{const l=Math.max(s.delay,1250);s.schedule(l)})),e.enabled==="on")this._activeRenderMode=0;else{let a,l;e.enabled==="onUnlessPressed"?(a=0,l=1):(a=1,l=0),this._activeRenderMode=a,this._sessionDisposables.add(Ng.getInstance().event(c=>{if(!this._editor.hasModel())return;const u=c.altKey&&c.ctrlKey&&!(c.shiftKey||c.metaKey)?l:a;if(u!==this._activeRenderMode){this._activeRenderMode=u;const d=this._editor.getModel(),h=this._copyInlayHintsWithCurrentAnchor(d);this._updateHintsDecorators([d.getFullModelRange()],h),s.schedule(0)}}))}this._sessionDisposables.add(this._installDblClickGesture(()=>s.schedule(0))),this._sessionDisposables.add(this._installLinkGesture()),this._sessionDisposables.add(this._installContextMenu())}_installLinkGesture(){const e=new Be,t=e.add(new lF(this._editor)),n=new Be;return e.add(n),e.add(t.onMouseMoveOrRelevantKeyDown(o=>{const[r]=o,s=this._getInlayHintLabelPart(r),a=this._editor.getModel();if(!s||!a){n.clear();return}const l=new Ro;n.add(zt(()=>l.dispose(!0))),s.item.resolve(l.token),this._activeInlayHintPart=s.part.command||s.part.location?new Yyt(s,r.hasTriggerModifier):void 0;const c=a.validatePosition(s.item.hint.position).lineNumber,u=new V(c,1,c,a.getLineMaxColumn(c)),d=this._getInlineHintsForRange(u);this._updateHintsDecorators([u],d),n.add(zt(()=>{this._activeInlayHintPart=void 0,this._updateHintsDecorators([u],d)}))})),e.add(t.onCancel(()=>n.clear())),e.add(t.onExecute(o=>pC(this,void 0,void 0,function*(){const r=this._getInlayHintLabelPart(o);if(r){const s=r.part;s.location?this._instaService.invokeFunction(aSe,o,this._editor,s.location):XW.is(s.command)&&(yield this._invokeCommand(s.command,r.item))}}))),e}_getInlineHintsForRange(e){const t=new Set;for(const n of this._decorationsMetadata.values())e.containsRange(n.item.anchor.range)&&t.add(n.item);return Array.from(t)}_installDblClickGesture(e){return this._editor.onMouseUp(t=>pC(this,void 0,void 0,function*(){if(t.event.detail!==2)return;const n=this._getInlayHintLabelPart(t);if(!!n&&(t.event.preventDefault(),yield n.item.resolve(_n.None),ws(n.item.hint.textEdits))){const o=n.item.hint.textEdits.map(r=>Gi.replace(V.lift(r.range),r.text));this._editor.executeEdits("inlayHint.default",o),e()}}))}_installContextMenu(){return this._editor.onContextMenu(e=>pC(this,void 0,void 0,function*(){if(!(e.event.target instanceof HTMLElement))return;const t=this._getInlayHintLabelPart(e);t&&(yield this._instaService.invokeFunction(Gyt,this._editor,e.event.target,t))}))}_getInlayHintLabelPart(e){var t;if(e.target.type!==6)return;const n=(t=e.target.detail.injectedText)===null||t===void 0?void 0:t.options;if(n instanceof Tv&&(n==null?void 0:n.attachedData)instanceof fU)return n.attachedData}_invokeCommand(e,t){var n;return pC(this,void 0,void 0,function*(){try{yield this._commandService.executeCommand(e.id,...(n=e.arguments)!==null&&n!==void 0?n:[])}catch(o){this._notificationService.notify({severity:L5.Error,source:t.provider.displayName,message:o})}})}_cacheHintsForFastRestore(e){const t=this._copyInlayHintsWithCurrentAnchor(e);this._inlayHintsCache.set(e,t)}_copyInlayHintsWithCurrentAnchor(e){const t=new Map;for(const[n,o]of this._decorationsMetadata){if(t.has(o.item))continue;const r=e.getDecorationRange(n);if(r){const s=new sSe(r,o.item.anchor.direction),a=o.item.with({anchor:s});t.set(o.item,a)}}return Array.from(t.values())}_getHintsRanges(){const t=this._editor.getModel(),n=this._editor.getVisibleRangesPlusViewportAboveBelow(),o=[];for(const r of n.sort(V.compareRangesUsingStarts)){const s=t.validateRange(new V(r.startLineNumber-30,r.startColumn,r.endLineNumber+30,r.endColumn));o.length===0||!V.areIntersectingOrTouching(o[o.length-1],s)?o.push(s):o[o.length-1]=V.plusRange(o[o.length-1],s)}return o}_updateHintsDecorators(e,t){var n,o;const r=[],s=(p,v,m,_,w)=>{const y={content:m,inlineClassNameAffectsLetterSpacing:!0,inlineClassName:v.className,cursorStops:_,attachedData:w};r.push({item:p,classNameRef:v,decoration:{range:p.anchor.range,options:{description:"InlayHint",showIfCollapsed:p.anchor.range.isEmpty(),collapseOnReplaceEdit:!p.anchor.range.isEmpty(),stickiness:0,[p.anchor.direction]:this._activeRenderMode===0?y:void 0}}})},a=(p,v)=>{const m=this._ruleFactory.createClassNameRef({width:`${l/3|0}px`,display:"inline-block"});s(p,m,"\u200A",v?Nd.Right:Nd.None)},{fontSize:l,fontFamily:c,padding:u,isUniform:d}=this._getLayoutInfo(),h="--code-editorInlayHintsFontFamily";this._editor.getContainerDomNode().style.setProperty(h,c);for(const p of t){p.hint.paddingLeft&&a(p,!1);const v=typeof p.hint.label=="string"?[{label:p.hint.label}]:p.hint.label;for(let m=0;mkM._MAX_DECORATORS)break}const f=[];for(const p of e)for(const{id:v}of(o=this._editor.getDecorationsInRange(p))!==null&&o!==void 0?o:[]){const m=this._decorationsMetadata.get(v);m&&(f.push(v),m.classNameRef.dispose(),this._decorationsMetadata.delete(v))}const g=Yd.capture(this._editor);this._editor.changeDecorations(p=>{const v=p.deltaDecorations(f,r.map(m=>m.decoration));for(let m=0;mn)&&(r=n);const s=e.fontFamily||o;return{fontSize:r,fontFamily:s,padding:t,isUniform:!t&&s===o&&r===n}}_removeAllDecorations(){this._editor.removeDecorations(Array.from(this._decorationsMetadata.keys()));for(const e of this._decorationsMetadata.values())e.classNameRef.dispose();this._decorationsMetadata.clear()}};Cb.ID="editor.contrib.InlayHints";Cb._MAX_DECORATORS=1500;Cb=kM=Xyt([tC(1,pt),tC(2,Kc),tC(3,lSe),tC(4,_o),tC(5,Ao),tC(6,$t)],Cb);function Zyt(i){const e="\xA0";return i.replace(/[ \t]/g,e)}Rn.registerCommand("_executeInlayHintProvider",(i,...e)=>pC(void 0,void 0,void 0,function*(){const[t,n]=e;fi(Rt.isUri(t)),fi(V.isIRange(n));const{inlayHintsProvider:o}=i.get(pt),r=yield i.get($a).createModelReference(t);try{const s=yield Gk.create(o,r.object.textEditorModel,[V.lift(n)],_n.None),a=s.items.map(l=>l.hint);return setTimeout(()=>s.dispose(),0),a}finally{r.dispose()}}));var Qyt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},nL=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},Nce=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},Jyt=globalThis&&globalThis.__asyncValues||function(i){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=i[Symbol.asyncIterator],t;return e?e.call(i):(i=typeof __values=="function"?__values(i):i[Symbol.iterator](),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(r){t[r]=i[r]&&function(s){return new Promise(function(a,l){s=i[r](s),o(a,l,s.done,s.value)})}}function o(r,s,a,l){Promise.resolve(l).then(function(c){r({value:c,done:a})},s)}};class Rce extends xM{constructor(e,t,n,o){super(10,t,e.item.anchor.range,n,o,!0),this.part=e}}let gU=class extends hO{constructor(e,t,n,o,r,s){super(e,t,n,o,s),this._resolverService=r,this.hoverOrdinal=6}suggestHoverAnchor(e){var t;if(!Cb.get(this._editor)||e.target.type!==6)return null;const o=(t=e.target.detail.injectedText)===null||t===void 0?void 0:t.options;return o instanceof Tv&&o.attachedData instanceof fU?new Rce(o.attachedData,this,e.event.posx,e.event.posy):null}computeSync(){return[]}computeAsync(e,t,n){return e instanceof Rce?new Wo(o=>Nce(this,void 0,void 0,function*(){var r,s,a,l;const{part:c}=e;if(yield c.item.resolve(n),n.isCancellationRequested)return;let u;typeof c.item.hint.tooltip=="string"?u=new is().appendText(c.item.hint.tooltip):c.item.hint.tooltip&&(u=c.item.hint.tooltip),u&&o.emitOne(new Dd(this,e.range,[u],!1,0)),ws(c.item.hint.textEdits)&&o.emitOne(new Dd(this,e.range,[new is().appendText(C("hint.dbl","Double-click to insert"))],!1,10001));let d;if(typeof c.part.tooltip=="string"?d=new is().appendText(c.part.tooltip):c.part.tooltip&&(d=c.part.tooltip),d&&o.emitOne(new Dd(this,e.range,[d],!1,1)),c.part.location||c.part.command){let v;const _=this._editor.getOption(77)==="altKey"?Nn?C("links.navigate.kb.meta.mac","cmd + click"):C("links.navigate.kb.meta","ctrl + click"):Nn?C("links.navigate.kb.alt.mac","option + click"):C("links.navigate.kb.alt","alt + click");c.part.location&&c.part.command?v=new is().appendText(C("hint.defAndCommand","Go to Definition ({0}), right click for more",_)):c.part.location?v=new is().appendText(C("hint.def","Go to Definition ({0})",_)):c.part.command&&(v=new is(`[${C("hint.cmd","Execute Command")}](${qyt(c.part.command)} "${c.part.command.title}") (${_})`,{isTrusted:!0})),v&&o.emitOne(new Dd(this,e.range,[v],!1,1e4))}const h=yield this._resolveInlayHintLabelPartHover(c,n);try{for(var f=!0,g=Jyt(h),p;p=yield g.next(),r=p.done,!r;f=!0){l=p.value,f=!1;const v=l;o.emitOne(v)}}catch(v){s={error:v}}finally{try{!f&&!r&&(a=g.return)&&(yield a.call(g))}finally{if(s)throw s.error}}})):Wo.EMPTY}_resolveInlayHintLabelPartHover(e,t){return Nce(this,void 0,void 0,function*(){if(!e.part.location)return Wo.EMPTY;const{uri:n,range:o}=e.part.location,r=yield this._resolverService.createModelReference(n);try{const s=r.object.textEditorModel;return this._languageFeaturesService.hoverProvider.has(s)?lY(this._languageFeaturesService.hoverProvider,s,new ae(o.startLineNumber,o.startColumn),t).filter(a=>!Ry(a.hover.contents)).map(a=>new Dd(this,e.item.anchor.range,a.hover.contents,!1,2+a.ordinal)):Wo.EMPTY}finally{r.dispose()}})}};gU=Qyt([nL(1,Ki),nL(2,pl),nL(3,En),nL(4,$a),nL(5,pt)],gU);zn(Cb.ID,Cb,1);Jb.register(gU);class eSt{constructor(e,t,n){this._editRange=e,this._originalSelection=t,this._text=n}getEditOperations(e,t){t.addTrackedEditOperation(this._editRange,this._text)}computeCursorState(e,t){const o=t.getInverseEditOperations()[0].range;return this._originalSelection.isEmpty()?new gt(o.endLineNumber,Math.min(this._originalSelection.positionColumn,o.endColumn),o.endLineNumber,Math.min(this._originalSelection.positionColumn,o.endColumn)):new gt(o.endLineNumber,o.endColumn-this._text.length,o.endLineNumber,o.endColumn)}}var tSt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},nSt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},IM;let Vv=IM=class{static get(e){return e.getContribution(IM.ID)}constructor(e,t){this.editor=e,this.editorWorkerService=t,this.decorations=this.editor.createDecorationsCollection()}dispose(){}run(e,t){var n;(n=this.currentRequest)===null||n===void 0||n.cancel();const o=this.editor.getSelection(),r=this.editor.getModel();if(!r||!o)return;let s=o;if(s.startLineNumber!==s.endLineNumber)return;const a=new Rk(this.editor,5),l=r.uri;return this.editorWorkerService.canNavigateValueSet(l)?(this.currentRequest=sr(c=>this.editorWorkerService.navigateValueSet(l,s,t)),this.currentRequest.then(c=>{var u;if(!c||!c.range||!c.value||!a.validate(this.editor))return;const d=V.lift(c.range);let h=c.range;const f=c.value.length-(s.endColumn-s.startColumn);h={startLineNumber:h.startLineNumber,startColumn:h.startColumn,endLineNumber:h.endLineNumber,endColumn:h.startColumn+c.value.length},f>1&&(s=new gt(s.startLineNumber,s.startColumn,s.endLineNumber,s.endColumn+f-1));const g=new eSt(d,s,c.value);this.editor.pushUndoStop(),this.editor.executeCommand(e,g),this.editor.pushUndoStop(),this.decorations.set([{range:h,options:IM.DECORATION}]),(u=this.decorationRemover)===null||u===void 0||u.cancel(),this.decorationRemover=wv(350),this.decorationRemover.then(()=>this.decorations.clear()).catch(en)}).catch(en)):Promise.resolve(void 0)}};Vv.ID="editor.contrib.inPlaceReplaceController";Vv.DECORATION=Jt.register({description:"in-place-replace",className:"valueSetReplacement"});Vv=IM=tSt([nSt(1,Gu)],Vv);class iSt extends ft{constructor(){super({id:"editor.action.inPlaceReplace.up",label:C("InPlaceReplaceAction.previous.label","Replace with Previous Value"),alias:"Replace with Previous Value",precondition:Q.writable,kbOpts:{kbExpr:Q.editorTextFocus,primary:3159,weight:100}})}run(e,t){const n=Vv.get(t);return n?n.run(this.id,!1):Promise.resolve(void 0)}}class oSt extends ft{constructor(){super({id:"editor.action.inPlaceReplace.down",label:C("InPlaceReplaceAction.next.label","Replace with Next Value"),alias:"Replace with Next Value",precondition:Q.writable,kbOpts:{kbExpr:Q.editorTextFocus,primary:3161,weight:100}})}run(e,t){const n=Vv.get(t);return n?n.run(this.id,!0):Promise.resolve(void 0)}}zn(Vv.ID,Vv,4);ze(iSt);ze(oSt);class rSt extends ft{constructor(){super({id:"expandLineSelection",label:C("expandLineSelection","Expand Line Selection"),alias:"Expand Line Selection",precondition:void 0,kbOpts:{weight:0,kbExpr:Q.textInputFocus,primary:2090}})}run(e,t,n){if(n=n||{},!t.hasModel())return;const o=t._getViewModel();o.model.pushStackElement(),o.setCursorStates(n.source,3,Mr.expandLineSelection(o,o.getCursorStates())),o.revealPrimaryCursor(n.source,!0)}}ze(rSt);class sSt{constructor(e,t){this._selection=e,this._cursors=t,this._selectionId=null}getEditOperations(e,t){const n=aSt(e,this._cursors);for(let o=0,r=n.length;os.lineNumber===a.lineNumber?s.column-a.column:s.lineNumber-a.lineNumber);for(let s=e.length-2;s>=0;s--)e[s].lineNumber===e[s+1].lineNumber&&e.splice(s,1);const t=[];let n=0,o=0;const r=e.length;for(let s=1,a=i.getLineCount();s<=a;s++){const l=i.getLineContent(s),c=l.length+1;let u=0;if(o1e5?`${r.substr(0,1e5)}\u2026`:r;this._type.textContent=a,this._type.title=a,nl(this._type),this._type.classList.toggle("auto-wrap",!/\r?\n^\s+/gmi.test(a))}else Ur(this._type),this._type.title="",Js(this._type),this.domNode.classList.add("no-type");if(Ur(this._docs),typeof s=="string")this._docs.classList.remove("markdown-docs"),this._docs.textContent=s;else if(s){this._docs.classList.add("markdown-docs"),Ur(this._docs);const a=this._markdownRenderer.render(s);this._docs.appendChild(a.element),this._renderDisposeable.add(a),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=a=>{a.preventDefault(),a.stopPropagation()},this._close.onclick=a=>{a.preventDefault(),a.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 size(){return this._size}layout(e,t){const n=new jn(e,t);jn.equals(n,this._size)||(this._size=n,FQe(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}};hU=ywt([wwt(1,$t)],hU);class Swt{constructor(e,t){this.widget=e,this._editor=t,this._disposables=new Be,this._added=!1,this._preferAlignAtTop=!0,this._resizable=new fY,this._resizable.domNode.classList.add("suggest-details-container"),this._resizable.domNode.appendChild(e.domNode),this._resizable.enableSashes(!1,!0,!0,!1);let n,o,r=0,s=0;this._disposables.add(this._resizable.onDidWillResize(()=>{n=this._topLeft,o=this._resizable.size})),this._disposables.add(this._resizable.onDidResize(a=>{if(n&&o){this.widget.layout(a.dimension.width,a.dimension.height);let l=!1;a.west&&(s=o.width-a.dimension.width,l=!0),a.north&&(r=o.height-a.dimension.height,l=!0),l&&this._applyTopLeft({top:n.top+r,left:n.left+s})}a.done&&(n=void 0,o=void 0,r=0,s=0,this._userSize=a.dimension)})),this._disposables.add(this.widget.onDidChangeContents(()=>{var a;this._anchorBox&&this._placeAtAnchor(this._anchorBox,(a=this._userSize)!==null&&a!==void 0?a: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 null}show(){this._added||(this._editor.addOverlayWidget(this),this.getDomNode().style.position="fixed",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){var n;const o=e.getBoundingClientRect();this._anchorBox=o,this._preferAlignAtTop=t,this._placeAtAnchor(this._anchorBox,(n=this._userSize)!==null&&n!==void 0?n:this.widget.size,t)}_placeAtAnchor(e,t,n){var o;const r=vS(this.getDomNode().ownerDocument.body),s=this.widget.getLayoutInfo(),a=new jn(220,2*s.lineHeight),l=e.top,c=function(){const y=r.width-(e.left+e.width+s.borderWidth+s.horizontalPadding),w=-s.borderWidth+e.left+e.width,L=new jn(y,r.height-e.top-s.borderHeight-s.verticalPadding),D=L.with(void 0,e.top+e.height-s.borderHeight-s.verticalPadding);return{top:l,left:w,fit:y-t.width,maxSizeTop:L,maxSizeBottom:D,minSize:a.with(Math.min(y,a.width))}}(),u=function(){const y=e.left-s.borderWidth-s.horizontalPadding,w=Math.max(s.horizontalPadding,e.left-t.width-s.borderWidth),L=new jn(y,r.height-e.top-s.borderHeight-s.verticalPadding),D=L.with(void 0,e.top+e.height-s.borderHeight-s.verticalPadding);return{top:l,left:w,fit:y-t.width,maxSizeTop:L,maxSizeBottom:D,minSize:a.with(Math.min(y,a.width))}}(),d=function(){const y=e.left,w=-s.borderWidth+e.top+e.height,L=new jn(e.width-s.borderHeight,r.height-e.top-e.height-s.verticalPadding);return{top:w,left:y,fit:L.height-t.height,maxSizeBottom:L,maxSizeTop:L,minSize:a.with(L.width)}}(),h=[c,u,d],f=(o=h.find(y=>y.fit>=0))!==null&&o!==void 0?o:h.sort((y,w)=>w.fit-y.fit)[0],g=e.top+e.height-s.borderHeight;let p,v=t.height;const m=Math.max(f.maxSizeTop.height,f.maxSizeBottom.height);v>m&&(v=m);let _;n?v<=f.maxSizeTop.height?(p=!0,_=f.maxSizeTop):(p=!1,_=f.maxSizeBottom):v<=f.maxSizeBottom.height?(p=!1,_=f.maxSizeBottom):(p=!0,_=f.maxSizeTop),this._applyTopLeft({left:f.left,top:p?f.top:g-v}),this.getDomNode().style.position="fixed",this._resizable.enableSashes(!p,f===c,p,f!==c),this._resizable.minSize=f.minSize,this._resizable.maxSize=_,this._resizable.layout(v,Math.min(_.width,t.width)),this.widget.layout(this._resizable.size.width,this._resizable.size.height)}_applyTopLeft(e){this._topLeft=e,this.getDomNode().style.left=`${this._topLeft.left}px`,this.getDomNode().style.top=`${this._topLeft.top}px`}}var Hg;(function(i){i[i.FILE=0]="FILE",i[i.FOLDER=1]="FOLDER",i[i.ROOT_FOLDER=2]="ROOT_FOLDER"})(Hg||(Hg={}));const xwt=/(?:\/|^)(?:([^\/]+)\/)?([^\/]+)$/;function cR(i,e,t,n){const o=n===Hg.ROOT_FOLDER?["rootfolder-icon"]:n===Hg.FOLDER?["folder-icon"]:["file-icon"];if(t){let r;if(t.scheme===hn.data)r=Iv.parseMetaData(t).get(Iv.META_DATA_LABEL);else{const s=t.path.match(xwt);s?(r=uR(s[2].toLowerCase()),s[1]&&o.push(`${uR(s[1].toLowerCase())}-name-dir-icon`)):r=uR(t.authority.toLowerCase())}if(n===Hg.FOLDER)o.push(`${r}-name-folder-icon`);else{if(r){if(o.push(`${r}-name-file-icon`),o.push("name-file-icon"),r.length<=255){const a=r.split(".");for(let l=1;l=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},m7=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},zp;function dSe(i){return`suggest-aria-id:${i}`}const Dwt=Eo("suggest-more-info",Xe.chevronRight,C("suggestMoreInfoIcon","Icon for more information in the suggest widget.")),kwt=new(zp=class{extract(e,t){if(e.textLabel.match(zp._regexStrict))return t[0]=e.textLabel,!0;if(e.completion.detail&&e.completion.detail.match(zp._regexStrict))return t[0]=e.completion.detail,!0;if(typeof e.completion.documentation=="string"){const n=zp._regexRelaxed.exec(e.completion.documentation);if(n&&(n.index===0||n.index+n[0].length===e.completion.documentation.length))return t[0]=n[0],!0}return!1}},zp._regexRelaxed=/(#([\da-fA-F]{3}){1,2}|(rgb|hsl)a\(\s*(\d{1,3}%?\s*,\s*){3}(1|0?\.\d+)\)|(rgb|hsl)\(\s*\d{1,3}%?(\s*,\s*\d{1,3}%?){2}\s*\))/,zp._regexStrict=new RegExp(`^${zp._regexRelaxed.source}$`,"i"),zp);let fU=class{constructor(e,t,n,o){this._editor=e,this._modelService=t,this._languageService=n,this._themeService=o,this._onDidToggleDetails=new le,this.onDidToggleDetails=this._onDidToggleDetails.event,this.templateId="suggestion"}dispose(){this._onDidToggleDetails.dispose()}renderTemplate(e){const t=new Be,n=e;n.classList.add("show-file-icons");const o=Ae(e,He(".icon")),r=Ae(o,He("span.colorspan")),s=Ae(e,He(".contents")),a=Ae(s,He(".main")),l=Ae(a,He(".icon-label.codicon")),c=Ae(a,He("span.left")),u=Ae(a,He("span.right")),d=new XP(c,{supportHighlights:!0,supportIcons:!0});t.add(d);const h=Ae(c,He("span.signature-label")),f=Ae(c,He("span.qualifier-label")),g=Ae(u,He("span.details-label")),p=Ae(u,He("span.readMore"+Mt.asCSSSelector(Dwt)));p.title=C("readMore","Read More");const v=()=>{const m=this._editor.getOptions(),_=m.get(50),y=_.getMassagedFontFamily(),w=_.fontFeatureSettings,L=m.get(118)||_.fontSize,D=m.get(119)||_.lineHeight,E=_.fontWeight,I=_.letterSpacing,k=`${L}px`,R=`${D}px`,A=`${I}px`;n.style.fontSize=k,n.style.fontWeight=E,n.style.letterSpacing=A,a.style.fontFamily=y,a.style.fontFeatureSettings=w,a.style.lineHeight=R,o.style.height=R,o.style.width=R,p.style.height=R,p.style.width=R};return v(),t.add(this._editor.onDidChangeConfiguration(m=>{(m.hasChanged(50)||m.hasChanged(118)||m.hasChanged(119))&&v()})),{root:n,left:c,right:u,icon:o,colorspan:r,iconLabel:d,iconContainer:l,parametersLabel:h,qualifierLabel:f,detailsLabel:g,readMore:p,disposables:t}}renderElement(e,t,n){const{completion:o}=e;n.root.id=dSe(t),n.colorspan.style.backgroundColor="";const r={labelEscapeNewLines:!0,matches:iT(e.score)},s=[];if(o.kind===19&&kwt.extract(e,s))n.icon.className="icon customcolor",n.iconContainer.className="icon hide",n.colorspan.style.backgroundColor=s[0];else if(o.kind===20&&this._themeService.getFileIconTheme().hasFileIcons){n.icon.className="icon hide",n.iconContainer.className="icon hide";const a=cR(this._modelService,this._languageService,Rt.from({scheme:"fake",path:e.textLabel}),Hg.FILE),l=cR(this._modelService,this._languageService,Rt.from({scheme:"fake",path:o.detail}),Hg.FILE);r.extraClasses=a.length>l.length?a:l}else o.kind===23&&this._themeService.getFileIconTheme().hasFolderIcons?(n.icon.className="icon hide",n.iconContainer.className="icon hide",r.extraClasses=[cR(this._modelService,this._languageService,Rt.from({scheme:"fake",path:e.textLabel}),Hg.FOLDER),cR(this._modelService,this._languageService,Rt.from({scheme:"fake",path:o.detail}),Hg.FOLDER)].flat()):(n.icon.className="icon hide",n.iconContainer.className="",n.iconContainer.classList.add("suggest-icon",...Mt.asClassNameArray(TD.toIcon(o.kind))));o.tags&&o.tags.indexOf(1)>=0&&(r.extraClasses=(r.extraClasses||[]).concat(["deprecated"]),r.matches=[]),n.iconLabel.setLabel(e.textLabel,void 0,r),typeof o.label=="string"?(n.parametersLabel.textContent="",n.detailsLabel.textContent=v7(o.detail||""),n.root.classList.add("string-label")):(n.parametersLabel.textContent=v7(o.label.detail||""),n.detailsLabel.textContent=v7(o.label.description||""),n.root.classList.remove("string-label")),this._editor.getOption(117).showInlineDetails?nl(n.detailsLabel):Js(n.detailsLabel),OY(e)?(n.right.classList.add("can-expand-details"),nl(n.readMore),n.readMore.onmousedown=a=>{a.stopPropagation(),a.preventDefault()},n.readMore.onclick=a=>{a.stopPropagation(),a.preventDefault(),this._onDidToggleDetails.fire()}):(n.right.classList.remove("can-expand-details"),Js(n.readMore),n.readMore.onmousedown=null,n.readMore.onclick=null)}disposeTemplate(e){e.disposables.dispose()}};fU=Ewt([m7(1,Yi),m7(2,Ki),m7(3,vr)],fU);function v7(i){return i.replace(/\r\n|\r|\n/g,"")}var Iwt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},dR=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},Twt=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},gC;J("editorSuggestWidget.background",{dark:po,light:po,hcDark:po,hcLight:po},C("editorSuggestWidgetBackground","Background color of the suggest widget."));J("editorSuggestWidget.border",{dark:Qh,light:Qh,hcDark:Qh,hcLight:Qh},C("editorSuggestWidgetBorder","Border color of the suggest widget."));const hR=J("editorSuggestWidget.foreground",{dark:Su,light:Su,hcDark:Su,hcLight:Su},C("editorSuggestWidgetForeground","Foreground color of the suggest widget."));J("editorSuggestWidget.selectedForeground",{dark:h0,light:h0,hcDark:h0,hcLight:h0},C("editorSuggestWidgetSelectedForeground","Foreground color of the selected entry in the suggest widget."));J("editorSuggestWidget.selectedIconForeground",{dark:AC,light:AC,hcDark:AC,hcLight:AC},C("editorSuggestWidgetSelectedIconForeground","Icon foreground color of the selected entry in the suggest widget."));const Nwt=J("editorSuggestWidget.selectedBackground",{dark:f0,light:f0,hcDark:f0,hcLight:f0},C("editorSuggestWidgetSelectedBackground","Background color of the selected entry in the suggest widget."));J("editorSuggestWidget.highlightForeground",{dark:xu,light:xu,hcDark:xu,hcLight:xu},C("editorSuggestWidgetHighlightForeground","Color of the match highlights in the suggest widget."));J("editorSuggestWidget.focusHighlightForeground",{dark:c2,light:c2,hcDark:c2,hcLight:c2},C("editorSuggestWidgetFocusHighlightForeground","Color of the match highlights in the suggest widget when an item is focused."));J("editorSuggestWidgetStatus.foreground",{dark:St(hR,.5),light:St(hR,.5),hcDark:St(hR,.5),hcLight:St(hR,.5)},C("editorSuggestWidgetStatusForeground","Foreground color of the suggest widget status."));class Rwt{constructor(e,t){this._service=e,this._key=`suggestWidget.size/${t.getEditorType()}/${t instanceof Pv}`}restore(){var e;const t=(e=this._service.get(this._key,0))!==null&&e!==void 0?e:"";try{const n=JSON.parse(t);if(jn.is(n))return jn.lift(n)}catch{}}store(e){this._service.store(this._key,JSON.stringify(e),0,1)}reset(){this._service.remove(this._key,0)}}let Kk=gC=class{constructor(e,t,n,o,r){this.editor=e,this._storageService=t,this._state=0,this._isAuto=!1,this._pendingLayout=new Kr,this._pendingShowDetails=new Kr,this._ignoreFocusEvents=!1,this._forceRenderingAbove=!1,this._explainMode=!1,this._showTimeout=new zu,this._disposables=new Be,this._onDidSelect=new G0,this._onDidFocus=new G0,this._onDidHide=new le,this._onDidShow=new le,this.onDidSelect=this._onDidSelect.event,this.onDidFocus=this._onDidFocus.event,this.onDidHide=this._onDidHide.event,this.onDidShow=this._onDidShow.event,this._onDetailsKeydown=new le,this.onDetailsKeyDown=this._onDetailsKeydown.event,this.element=new fY,this.element.domNode.classList.add("editor-widget","suggest-widget"),this._contentWidget=new Mwt(this,e),this._persistedSize=new Rwt(t,e);class s{constructor(f,g,p=!1,v=!1){this.persistedSize=f,this.currentSize=g,this.persistHeight=p,this.persistWidth=v}}let a;this._disposables.add(this.element.onDidWillResize(()=>{this._contentWidget.lockPreference(),a=new s(this._persistedSize.restore(),this.element.size)})),this._disposables.add(this.element.onDidResize(h=>{var f,g,p,v;if(this._resize(h.dimension.width,h.dimension.height),a&&(a.persistHeight=a.persistHeight||!!h.north||!!h.south,a.persistWidth=a.persistWidth||!!h.east||!!h.west),!!h.done){if(a){const{itemHeight:m,defaultSize:_}=this.getLayoutInfo(),y=Math.round(m/2);let{width:w,height:L}=this.element.size;(!a.persistHeight||Math.abs(a.currentSize.height-L)<=y)&&(L=(g=(f=a.persistedSize)===null||f===void 0?void 0:f.height)!==null&&g!==void 0?g:_.height),(!a.persistWidth||Math.abs(a.currentSize.width-w)<=y)&&(w=(v=(p=a.persistedSize)===null||p===void 0?void 0:p.width)!==null&&v!==void 0?v:_.width),this._persistedSize.store(new jn(w,L))}this._contentWidget.unlockPreference(),a=void 0}})),this._messageElement=Ae(this.element.domNode,He(".message")),this._listElement=Ae(this.element.domNode,He(".tree"));const l=this._disposables.add(r.createInstance(hU,this.editor));l.onDidClose(this.toggleDetails,this,this._disposables),this._details=new Swt(l,this.editor);const c=()=>this.element.domNode.classList.toggle("no-icons",!this.editor.getOption(117).showIcons);c();const u=r.createInstance(fU,this.editor);this._disposables.add(u),this._disposables.add(u.onDidToggleDetails(()=>this.toggleDetails())),this._list=new qu("SuggestWidget",this._listElement,{getHeight:h=>this.getLayoutInfo().itemHeight,getTemplateId:h=>"suggestion"},[u],{alwaysConsumeMouseWheel:!0,useShadows:!1,mouseSupport:!1,multipleSelectionSupport:!1,accessibilityProvider:{getRole:()=>"option",getWidgetAriaLabel:()=>C("suggest","Suggest"),getWidgetRole:()=>"listbox",getAriaLabel:h=>{let f=h.textLabel;if(typeof h.completion.label!="string"){const{detail:m,description:_}=h.completion.label;m&&_?f=C("label.full","{0} {1}, {2}",f,m,_):m?f=C("label.detail","{0} {1}",f,m):_&&(f=C("label.desc","{0}, {1}",f,_))}if(!h.isResolved||!this._isDetailsVisible())return f;const{documentation:g,detail:p}=h.completion,v=X0("{0}{1}",p||"",g?typeof g=="string"?g:g.value:"");return C("ariaCurrenttSuggestionReadDetails","{0}, docs: {1}",f,v)}}}),this._list.style(xS({listInactiveFocusBackground:Nwt,listInactiveFocusOutline:Wi})),this._status=r.createInstance(dU,this.element.domNode,rv);const d=()=>this.element.domNode.classList.toggle("with-status-bar",this.editor.getOption(117).showStatusBar);d(),this._disposables.add(o.onDidColorThemeChange(h=>this._onThemeChange(h))),this._onThemeChange(o.getColorTheme()),this._disposables.add(this._list.onMouseDown(h=>this._onListMouseDownOrTap(h))),this._disposables.add(this._list.onTap(h=>this._onListMouseDownOrTap(h))),this._disposables.add(this._list.onDidChangeSelection(h=>this._onListSelection(h))),this._disposables.add(this._list.onDidChangeFocus(h=>this._onListFocus(h))),this._disposables.add(this.editor.onDidChangeCursorSelection(()=>this._onCursorSelectionChanged())),this._disposables.add(this.editor.onDidChangeConfiguration(h=>{h.hasChanged(117)&&(d(),c())})),this._ctxSuggestWidgetVisible=sn.Visible.bindTo(n),this._ctxSuggestWidgetDetailsVisible=sn.DetailsVisible.bindTo(n),this._ctxSuggestWidgetMultipleSuggestions=sn.MultipleSuggestions.bindTo(n),this._ctxSuggestWidgetHasFocusedSuggestion=sn.HasFocusedSuggestion.bindTo(n),this._disposables.add(No(this._details.widget.domNode,"keydown",h=>{this._onDetailsKeydown.fire(h)})),this._disposables.add(this.editor.onMouseDown(h=>this._onEditorMouseDown(h)))}dispose(){var e;this._details.widget.dispose(),this._details.dispose(),this._list.dispose(),this._status.dispose(),this._disposables.dispose(),(e=this._loadingTimeout)===null||e===void 0||e.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!==0&&this._contentWidget.layout()}_onListMouseDownOrTap(e){typeof e.element=="undefined"||typeof e.index=="undefined"||(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 n=this._completionModel;n&&(this._onDidSelect.fire({item:e,index:t,model:n}),this.editor.focus())}_onThemeChange(e){this._details.widget.borderWidth=Hd(e.type)?2:1}_onListFocus(e){var t;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 n=e.elements[0],o=e.indexes[0];n!==this._focusedItem&&((t=this._currentSuggestionDetails)===null||t===void 0||t.cancel(),this._currentSuggestionDetails=void 0,this._focusedItem=n,this._list.reveal(o),this._currentSuggestionDetails=sr(r=>Twt(this,void 0,void 0,function*(){const s=Sv(()=>{this._isDetailsVisible()&&this.showDetails(!0)},250),a=r.onCancellationRequested(()=>s.dispose());try{return yield n.resolve(r)}finally{s.dispose(),a.dispose()}})),this._currentSuggestionDetails.then(()=>{o>=this._list.length||n!==this._list.element(o)||(this._ignoreFocusEvents=!0,this._list.splice(o,1,[n]),this._list.setFocus([o]),this._ignoreFocusEvents=!1,this._isDetailsVisible()?this.showDetails(!1):this.element.domNode.classList.remove("docs-side"),this.editor.setAriaOptions({activeDescendant:dSe(o)}))}).catch(en)),this._onDidFocus.fire({item:n,index:o,model:this._completionModel})}_setState(e){if(this._state!==e)switch(this._state=e,this.element.domNode.classList.toggle("frozen",e===4),this.element.domNode.classList.remove("message"),e){case 0:Js(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 1:this.element.domNode.classList.add("message"),this._messageElement.textContent=gC.LOADING_MESSAGE,Js(this._listElement,this._status.element),nl(this._messageElement),this._details.hide(),this._show(),this._focusedItem=void 0,Ev(gC.LOADING_MESSAGE);break;case 2:this.element.domNode.classList.add("message"),this._messageElement.textContent=gC.NO_SUGGESTIONS_MESSAGE,Js(this._listElement,this._status.element),nl(this._messageElement),this._details.hide(),this._show(),this._focusedItem=void 0,Ev(gC.NO_SUGGESTIONS_MESSAGE);break;case 3:Js(this._messageElement),nl(this._listElement,this._status.element),this._show();break;case 4:Js(this._messageElement),nl(this._listElement,this._status.element),this._show();break;case 5:Js(this._messageElement),nl(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===0&&(this._contentWidget.setPosition(this.editor.getPosition()),this._isAuto=!!e,this._isAuto||(this._loadingTimeout=Sv(()=>this._setState(1),t)))}showSuggestions(e,t,n,o,r){var s,a;if(this._contentWidget.setPosition(this.editor.getPosition()),(s=this._loadingTimeout)===null||s===void 0||s.dispose(),(a=this._currentSuggestionDetails)===null||a===void 0||a.cancel(),this._currentSuggestionDetails=void 0,this._completionModel!==e&&(this._completionModel=e),n&&this._state!==2&&this._state!==0){this._setState(4);return}const l=this._completionModel.items.length,c=l===0;if(this._ctxSuggestWidgetMultipleSuggestions.set(l>1),c){this._setState(o?0:2),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(n?4:3),this._list.reveal(t,0),this._list.setFocus(r?[]:[t])}finally{this._onDidFocus.resume(),this._onDidSelect.resume()}this._pendingLayout.value=KA(()=>{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 0:return!1;case 5:return this._details.widget.pageDown(),!0;case 1:return!this._isAuto;default:return this._list.focusNextPage(),!0}}selectNext(){switch(this._state){case 0:return!1;case 1:return!this._isAuto;default:return this._list.focusNext(1,!0),!0}}selectLast(){switch(this._state){case 0:return!1;case 5:return this._details.widget.scrollBottom(),!0;case 1:return!this._isAuto;default:return this._list.focusLast(),!0}}selectPreviousPage(){switch(this._state){case 0:return!1;case 5:return this._details.widget.pageUp(),!0;case 1:return!this._isAuto;default:return this._list.focusPreviousPage(),!0}}selectPrevious(){switch(this._state){case 0:return!1;case 1:return!this._isAuto;default:return this._list.focusPrevious(1,!0),!1}}selectFirst(){switch(this._state){case 0:return!1;case 5:return this._details.widget.scrollTop(),!0;case 1:return!this._isAuto;default:return this._list.focusFirst(),!0}}getFocusedItem(){if(this._state!==0&&this._state!==2&&this._state!==1&&this._completionModel&&this._list.getFocus().length>0)return{item:this._list.getFocusedElements()[0],index:this._list.getFocus()[0],model:this._completionModel}}toggleDetailsFocus(){this._state===5?(this._setState(3),this._details.widget.domNode.classList.remove("focused")):this._state===3&&this._isDetailsVisible()&&(this._setState(5),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")):(OY(this._list.getFocusedElements()[0])||this._explainMode)&&(this._state===3||this._state===5||this._state===4)&&(this._ctxSuggestWidgetDetailsVisible.set(!0),this._setDetailsVisible(!0),this.showDetails(!1))}showDetails(e){this._pendingShowDetails.value=KA(()=>{this._pendingShowDetails.clear(),this._details.show(),e?this._details.widget.renderLoading():this._details.widget.renderItem(this._list.getFocusedElements()[0],this._explainMode),this._positionDetails(),this.editor.focus(),this.element.domNode.classList.add("shows-details")})}toggleExplainMode(){this._list.getFocusedElements()[0]&&(this._explainMode=!this._explainMode,this._isDetailsVisible()?this.showDetails(!1):this.toggleDetails())}resetPersistedSize(){this._persistedSize.reset()}hideWidget(){var e;this._pendingLayout.clear(),this._pendingShowDetails.clear(),(e=this._loadingTimeout)===null||e===void 0||e.dispose(),this._setState(0),this._onDidHide.fire(this),this.element.clearSashHoverState();const t=this._persistedSize.restore(),n=Math.ceil(this.getLayoutInfo().itemHeight*4.3);t&&t.heightc&&(l=c);const u=this._completionModel?this._completionModel.stats.pLabelLen*s.typicalHalfwidthCharacterWidth:l,d=s.statusBarHeight+this._list.contentHeight+s.borderHeight,h=s.itemHeight+s.statusBarHeight,f=Yo(this.editor.getDomNode()),g=this.editor.getScrolledVisiblePosition(this.editor.getPosition()),p=f.top+g.top+g.height,v=Math.min(r.height-p-s.verticalPadding,d),m=f.top+g.top-s.verticalPadding,_=Math.min(m,d);let y=Math.min(Math.max(_,v)+s.borderHeight,d);a===((t=this._cappedHeight)===null||t===void 0?void 0:t.capped)&&(a=this._cappedHeight.wanted),ay&&(a=y);const w=150;a>v||this._forceRenderingAbove&&m>w?(this._contentWidget.setPreference(1),this.element.enableSashes(!0,!0,!1,!1),y=_):(this._contentWidget.setPreference(2),this.element.enableSashes(!1,!0,!0,!1),y=v),this.element.preferredSize=new jn(u,s.defaultSize.height),this.element.maxSize=new jn(c,y),this.element.minSize=new jn(220,h),this._cappedHeight=a===d?{wanted:(o=(n=this._cappedHeight)===null||n===void 0?void 0:n.wanted)!==null&&o!==void 0?o:e.height,capped:a}:void 0}this._resize(l,a)}_resize(e,t){const{width:n,height:o}=this.element.maxSize;e=Math.min(n,e),t=Math.min(o,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(){var e;this._isDetailsVisible()&&this._details.placeAtAnchor(this.element.domNode,((e=this._contentWidget.getPosition())===null||e===void 0?void 0:e.preference[0])===2)}getLayoutInfo(){const e=this.editor.getOption(50),t=Za(this.editor.getOption(119)||e.lineHeight,8,1e3),n=!this.editor.getOption(117).showStatusBar||this._state===2||this._state===1?0:t,o=this._details.widget.borderWidth,r=2*o;return{itemHeight:t,statusBarHeight:n,borderWidth:o,borderHeight:r,typicalHalfwidthCharacterWidth:e.typicalHalfwidthCharacterWidth,verticalPadding:22,horizontalPadding:14,defaultSize:new jn(430,n+12*t+r)}}_isDetailsVisible(){return this._storageService.getBoolean("expandSuggestionDocs",0,!1)}_setDetailsVisible(e){this._storageService.store("expandSuggestionDocs",e,0,0)}forceRenderingAbove(){this._forceRenderingAbove||(this._forceRenderingAbove=!0,this._layout(this._persistedSize.restore()))}stopForceRenderingAbove(){this._forceRenderingAbove=!1}};Kk.LOADING_MESSAGE=C("suggestWidget.loading","Loading...");Kk.NO_SUGGESTIONS_MESSAGE=C("suggestWidget.noSuggestions","No suggestions.");Kk=gC=Iwt([dR(1,Gu),dR(2,Ut),dR(3,vr),dR(4,$t)],Kk);class Mwt{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:n,horizontalPadding:o}=this._widget.getLayoutInfo();return new jn(t+2*n+o,e+2*n)}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 Awt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},eC=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},gU;class Pwt{constructor(e,t){if(this._model=e,this._position=t,e.getLineMaxColumn(t.lineNumber)!==t.column){const o=e.getOffsetAt(t),r=e.getPositionAt(o+1);this._marker=e.deltaDecorations([],[{range:V.fromPositions(t,r),options:{description:"suggest-line-suffix",stickiness:1}}])}}dispose(){this._marker&&!this._model.isDisposed()&&this._model.deltaDecorations(this._marker,[])}delta(e){if(this._model.isDisposed()||this._position.lineNumber!==e.lineNumber)return 0;if(this._marker){const t=this._model.getDecorationRange(this._marker[0]);return this._model.getOffsetAt(t.getStartPosition())-this._model.getOffsetAt(e)}else return this._model.getLineMaxColumn(e.lineNumber)-e.column}}let Eu=gU=class{static get(e){return e.getContribution(gU.ID)}constructor(e,t,n,o,r,s,a){this._memoryService=t,this._commandService=n,this._contextKeyService=o,this._instantiationService=r,this._logService=s,this._telemetryService=a,this._lineSuffix=new Kr,this._toDispose=new Be,this._selectors=new Owt(d=>d.priority),this._onWillInsertSuggestItem=new le,this.onWillInsertSuggestItem=this._onWillInsertSuggestItem.event,this.editor=e,this.model=r.createInstance(uU,this.editor),this._selectors.register({priority:0,select:(d,h,f)=>this._memoryService.select(d,h,f)});const l=sn.InsertMode.bindTo(o);l.set(e.getOption(117).insertMode),this._toDispose.add(this.model.onDidTrigger(()=>l.set(e.getOption(117).insertMode))),this.widget=this._toDispose.add(new nM(()=>{const d=this._instantiationService.createInstance(Kk,this.editor);this._toDispose.add(d),this._toDispose.add(d.onDidSelect(v=>this._insertSuggestion(v,0),this));const h=new fwt(this.editor,d,this.model,v=>this._insertSuggestion(v,2));this._toDispose.add(h);const f=sn.MakesTextEdit.bindTo(this._contextKeyService),g=sn.HasInsertAndReplaceRange.bindTo(this._contextKeyService),p=sn.CanResolve.bindTo(this._contextKeyService);return this._toDispose.add(zt(()=>{f.reset(),g.reset(),p.reset()})),this._toDispose.add(d.onDidFocus(({item:v})=>{const m=this.editor.getPosition(),_=v.editStart.column,y=m.column;let w=!0;this.editor.getOption(1)==="smart"&&this.model.state===2&&!v.completion.additionalTextEdits&&!(v.completion.insertTextRules&4)&&y-_===v.completion.insertText.length&&(w=this.editor.getModel().getValueInRange({startLineNumber:m.lineNumber,startColumn:_,endLineNumber:m.lineNumber,endColumn:y})!==v.completion.insertText),f.set(w),g.set(!ae.equals(v.editInsertEnd,v.editReplaceEnd)),p.set(Boolean(v.provider.resolveCompletionItem)||Boolean(v.completion.documentation)||v.completion.detail!==v.completion.label)})),this._toDispose.add(d.onDetailsKeyDown(v=>{if(v.toKeyCodeChord().equals(new lp(!0,!1,!1,!1,33))||Nn&&v.toKeyCodeChord().equals(new lp(!1,!1,!1,!0,33))){v.stopPropagation();return}v.toKeyCodeChord().isModifierKey()||this.editor.focus()})),d})),this._overtypingCapturer=this._toDispose.add(new nM(()=>this._toDispose.add(new TF(this.editor,this.model)))),this._alternatives=this._toDispose.add(new nM(()=>this._toDispose.add(new Cb(this.editor,this._contextKeyService)))),this._toDispose.add(r.createInstance(jk,e)),this._toDispose.add(this.model.onDidTrigger(d=>{this.widget.value.showTriggered(d.auto,d.shy?250:50),this._lineSuffix.value=new Pwt(this.editor.getModel(),d.position)})),this._toDispose.add(this.model.onDidSuggest(d=>{if(d.triggerOptions.shy)return;let h=-1;for(const g of this._selectors.itemsOrderedByPriorityDesc)if(h=g.select(this.editor.getModel(),this.editor.getPosition(),d.completionModel.items),h!==-1)break;h===-1&&(h=0);let f=!1;if(d.triggerOptions.auto){const g=this.editor.getOption(117);g.selectionMode==="never"||g.selectionMode==="always"?f=g.selectionMode==="never":g.selectionMode==="whenTriggerCharacter"?f=d.triggerOptions.triggerKind!==1:g.selectionMode==="whenQuickSuggestion"&&(f=d.triggerOptions.triggerKind===1&&!d.triggerOptions.refilter)}this.widget.value.showSuggestions(d.completionModel,h,d.isFrozen,d.triggerOptions.auto,f)})),this._toDispose.add(this.model.onDidCancel(d=>{d.retrigger||this.widget.value.hideWidget()})),this._toDispose.add(this.editor.onDidBlurEditorWidget(()=>{this.model.cancel(),this.model.clear()}));const c=sn.AcceptSuggestionsOnEnter.bindTo(o),u=()=>{const d=this.editor.getOption(1);c.set(d==="on"||d==="smart")};this._toDispose.add(this.editor.onDidChangeConfiguration(()=>u())),u()}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 n=qr.get(this.editor);if(!n)return;this._onWillInsertSuggestItem.fire({item:e.item});const o=this.editor.getModel(),r=o.getAlternativeVersionId(),{item:s}=e,a=[],l=new Ro;t&1||this.editor.pushUndoStop();const c=this.getOverwriteInfo(s,Boolean(t&8));this._memoryService.memorize(o,this.editor.getPosition(),s);const u=s.isResolved;let d=-1,h=-1;if(Array.isArray(s.completion.additionalTextEdits)){this.model.cancel();const g=Zd.capture(this.editor);this.editor.executeEdits("suggestController.additionalTextEdits.sync",s.completion.additionalTextEdits.map(p=>Gi.replaceMove(V.lift(p.range),p.text))),g.restoreRelativeVerticalPositionOfCursor(this.editor)}else if(!u){const g=new Ls;let p;const v=o.onDidChangeContent(w=>{if(w.isFlush){l.cancel(),v.dispose();return}for(const L of w.changes){const D=V.getEndPosition(L.range);(!p||ae.isBefore(D,p))&&(p=D)}}),m=t;t|=2;let _=!1;const y=this.editor.onWillType(()=>{y.dispose(),_=!0,m&2||this.editor.pushUndoStop()});a.push(s.resolve(l.token).then(()=>{if(!s.completion.additionalTextEdits||l.token.isCancellationRequested)return;if(p&&s.completion.additionalTextEdits.some(L=>ae.isBefore(p,V.getStartPosition(L.range))))return!1;_&&this.editor.pushUndoStop();const w=Zd.capture(this.editor);return this.editor.executeEdits("suggestController.additionalTextEdits.async",s.completion.additionalTextEdits.map(L=>Gi.replaceMove(V.lift(L.range),L.text))),w.restoreRelativeVerticalPositionOfCursor(this.editor),(_||!(m&2))&&this.editor.pushUndoStop(),!0}).then(w=>{this._logService.trace("[suggest] async resolving of edits DONE (ms, applied?)",g.elapsed(),w),h=w===!0?1:w===!1?0:-2}).finally(()=>{v.dispose(),y.dispose()}))}let{insertText:f}=s.completion;if(s.completion.insertTextRules&4||(f=Gw.escape(f)),this.model.cancel(),n.insert(f,{overwriteBefore:c.overwriteBefore,overwriteAfter:c.overwriteAfter,undoStopBefore:!1,undoStopAfter:!1,adjustWhitespace:!(s.completion.insertTextRules&1),clipboardText:e.model.clipboardText,overtypingCapturer:this._overtypingCapturer.value}),t&2||this.editor.pushUndoStop(),s.completion.command)if(s.completion.command.id===ST.id)this.model.trigger({auto:!0,retrigger:!0});else{const g=new Ls;a.push(this._commandService.executeCommand(s.completion.command.id,...s.completion.command.arguments?[...s.completion.command.arguments]:[]).catch(p=>{s.completion.extensionId?$o(p):en(p)}).finally(()=>{d=g.elapsed()}))}t&4&&this._alternatives.value.set(e,g=>{for(l.cancel();o.canUndo();){r!==o.getAlternativeVersionId()&&o.undo(),this._insertSuggestion(g,3|(t&8?8:0));break}}),this._alertCompletionItem(s),Promise.all(a).finally(()=>{this._reportSuggestionAcceptedTelemetry(s,o,u,d,h),this.model.clear(),l.dispose()})}_reportSuggestionAcceptedTelemetry(e,t,n,o,r){var s,a,l;Math.floor(Math.random()*100)!==0&&this._telemetryService.publicLog2("suggest.acceptedSuggestion",{extensionId:(a=(s=e.extensionId)===null||s===void 0?void 0:s.value)!==null&&a!==void 0?a:"unknown",providerId:(l=e.provider._debugDisplayName)!==null&&l!==void 0?l:"unknown",kind:e.completion.kind,basenameHash:W0e($c(t.uri)).toString(16),languageId:t.getLanguageId(),fileExtension:Vst(t.uri),resolveInfo:e.provider.resolveCompletionItem?n?1:0:-1,resolveDuration:e.resolveDuration,commandDuration:o,additionalEditsAsync:r})}getOverwriteInfo(e,t){fi(this.editor.hasModel());let n=this.editor.getOption(117).insertMode==="replace";t&&(n=!n);const o=e.position.column-e.editStart.column,r=(n?e.editReplaceEnd.column:e.editInsertEnd.column)-e.position.column,s=this.editor.getPosition().column-e.position.column,a=this._lineSuffix.value?this._lineSuffix.value.delta(this.editor.getPosition()):0;return{overwriteBefore:o+s,overwriteAfter:r+a}}_alertCompletionItem(e){if(ws(e.completion.additionalTextEdits)){const t=C("aria.alert.snippet","Accepting '{0}' made {1} additional edits",e.textLabel,e.completion.additionalTextEdits.length);Cs(t)}}triggerSuggest(e,t,n){this.editor.hasModel()&&(this.model.trigger({auto:t!=null?t:!1,completionOptions:{providerFilter:e,kindFilter:n?new Set:void 0}}),this.editor.revealPosition(this.editor.getPosition(),0),this.editor.focus())}triggerSuggestAndAcceptBest(e){if(!this.editor.hasModel())return;const t=this.editor.getPosition(),n=()=>{t.equals(this.editor.getPosition())&&this._commandService.executeCommand(e.fallback)},o=r=>{if(r.completion.insertTextRules&4||r.completion.additionalTextEdits)return!0;const s=this.editor.getPosition(),a=r.editStart.column,l=s.column;return l-a!==r.completion.insertText.length?!0:this.editor.getModel().getValueInRange({startLineNumber:s.lineNumber,startColumn:a,endLineNumber:s.lineNumber,endColumn:l})!==r.completion.insertText};st.once(this.model.onDidTrigger)(r=>{const s=[];st.any(this.model.onDidTrigger,this.model.onDidCancel)(()=>{si(s),n()},void 0,s),this.model.onDidSuggest(({completionModel:a})=>{if(si(s),a.items.length===0){n();return}const l=this._memoryService.select(this.editor.getModel(),this.editor.getPosition(),a.items),c=a.items[l];if(!o(c)){n();return}this.editor.pushUndoStop(),this._insertSuggestion({index:l,item:c,model:a},7)},void 0,s)}),this.model.trigger({auto:!1,shy:!0}),this.editor.revealPosition(t,0),this.editor.focus()}acceptSelectedSuggestion(e,t){const n=this.widget.value.getFocusedItem();let o=0;e&&(o|=4),t&&(o|=8),this._insertSuggestion(n,o)}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)}};Eu.ID="editor.contrib.suggestController";Eu=gU=Awt([eC(1,IF),eC(2,_o),eC(3,Ut),eC(4,$t),eC(5,nc),eC(6,tc)],Eu);class Owt{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,n)=>this.prioritySelector(n)-this.prioritySelector(t)),{dispose:()=>{const t=this._items.indexOf(e);t>=0&&this._items.splice(t,1)}}}get itemsOrderedByPriorityDesc(){return this._items}}class ST extends ft{constructor(){super({id:ST.id,label:C("suggest.trigger.label","Trigger Suggest"),alias:"Trigger Suggest",precondition:Me.and(Q.writable,Q.hasCompletionItemProvider,sn.Visible.toNegated()),kbOpts:{kbExpr:Q.textInputFocus,primary:2058,secondary:[2087],mac:{primary:266,secondary:[521,2087]},weight:100}})}run(e,t,n){const o=Eu.get(t);if(!o)return;let r;n&&typeof n=="object"&&n.auto===!0&&(r=!0),o.triggerSuggest(void 0,r,void 0)}}ST.id="editor.action.triggerSuggest";zn(Eu.ID,Eu,2);ze(ST);const Ql=100+90,_a=Ir.bindToContribution(Eu.get);Ye(new _a({id:"acceptSelectedSuggestion",precondition:Me.and(sn.Visible,sn.HasFocusedSuggestion),handler(i){i.acceptSelectedSuggestion(!0,!1)},kbOpts:[{primary:2,kbExpr:Me.and(sn.Visible,Q.textInputFocus),weight:Ql},{primary:3,kbExpr:Me.and(sn.Visible,Q.textInputFocus,sn.AcceptSuggestionsOnEnter,sn.MakesTextEdit),weight:Ql}],menuOpts:[{menuId:rv,title:C("accept.insert","Insert"),group:"left",order:1,when:sn.HasInsertAndReplaceRange.toNegated()},{menuId:rv,title:C("accept.insert","Insert"),group:"left",order:1,when:Me.and(sn.HasInsertAndReplaceRange,sn.InsertMode.isEqualTo("insert"))},{menuId:rv,title:C("accept.replace","Replace"),group:"left",order:1,when:Me.and(sn.HasInsertAndReplaceRange,sn.InsertMode.isEqualTo("replace"))}]}));Ye(new _a({id:"acceptAlternativeSelectedSuggestion",precondition:Me.and(sn.Visible,Q.textInputFocus,sn.HasFocusedSuggestion),kbOpts:{weight:Ql,kbExpr:Q.textInputFocus,primary:1027,secondary:[1026]},handler(i){i.acceptSelectedSuggestion(!1,!0)},menuOpts:[{menuId:rv,group:"left",order:2,when:Me.and(sn.HasInsertAndReplaceRange,sn.InsertMode.isEqualTo("insert")),title:C("accept.replace","Replace")},{menuId:rv,group:"left",order:2,when:Me.and(sn.HasInsertAndReplaceRange,sn.InsertMode.isEqualTo("replace")),title:C("accept.insert","Insert")}]}));Rn.registerCommandAlias("acceptSelectedSuggestionOnEnter","acceptSelectedSuggestion");Ye(new _a({id:"hideSuggestWidget",precondition:sn.Visible,handler:i=>i.cancelSuggestWidget(),kbOpts:{weight:Ql,kbExpr:Q.textInputFocus,primary:9,secondary:[1033]}}));Ye(new _a({id:"selectNextSuggestion",precondition:Me.and(sn.Visible,Me.or(sn.MultipleSuggestions,sn.HasFocusedSuggestion.negate())),handler:i=>i.selectNextSuggestion(),kbOpts:{weight:Ql,kbExpr:Q.textInputFocus,primary:18,secondary:[2066],mac:{primary:18,secondary:[2066,300]}}}));Ye(new _a({id:"selectNextPageSuggestion",precondition:Me.and(sn.Visible,Me.or(sn.MultipleSuggestions,sn.HasFocusedSuggestion.negate())),handler:i=>i.selectNextPageSuggestion(),kbOpts:{weight:Ql,kbExpr:Q.textInputFocus,primary:12,secondary:[2060]}}));Ye(new _a({id:"selectLastSuggestion",precondition:Me.and(sn.Visible,Me.or(sn.MultipleSuggestions,sn.HasFocusedSuggestion.negate())),handler:i=>i.selectLastSuggestion()}));Ye(new _a({id:"selectPrevSuggestion",precondition:Me.and(sn.Visible,Me.or(sn.MultipleSuggestions,sn.HasFocusedSuggestion.negate())),handler:i=>i.selectPrevSuggestion(),kbOpts:{weight:Ql,kbExpr:Q.textInputFocus,primary:16,secondary:[2064],mac:{primary:16,secondary:[2064,302]}}}));Ye(new _a({id:"selectPrevPageSuggestion",precondition:Me.and(sn.Visible,Me.or(sn.MultipleSuggestions,sn.HasFocusedSuggestion.negate())),handler:i=>i.selectPrevPageSuggestion(),kbOpts:{weight:Ql,kbExpr:Q.textInputFocus,primary:11,secondary:[2059]}}));Ye(new _a({id:"selectFirstSuggestion",precondition:Me.and(sn.Visible,Me.or(sn.MultipleSuggestions,sn.HasFocusedSuggestion.negate())),handler:i=>i.selectFirstSuggestion()}));Ye(new _a({id:"focusSuggestion",precondition:Me.and(sn.Visible,sn.HasFocusedSuggestion.negate()),handler:i=>i.focusSuggestion(),kbOpts:{weight:Ql,kbExpr:Q.textInputFocus,primary:2058,secondary:[2087],mac:{primary:266,secondary:[2087]}}}));Ye(new _a({id:"focusAndAcceptSuggestion",precondition:Me.and(sn.Visible,sn.HasFocusedSuggestion.negate()),handler:i=>{i.focusSuggestion(),i.acceptSelectedSuggestion(!0,!1)}}));Ye(new _a({id:"toggleSuggestionDetails",precondition:Me.and(sn.Visible,sn.HasFocusedSuggestion),handler:i=>i.toggleSuggestionDetails(),kbOpts:{weight:Ql,kbExpr:Q.textInputFocus,primary:2058,secondary:[2087],mac:{primary:266,secondary:[2087]}},menuOpts:[{menuId:rv,group:"right",order:1,when:Me.and(sn.DetailsVisible,sn.CanResolve),title:C("detail.more","show less")},{menuId:rv,group:"right",order:1,when:Me.and(sn.DetailsVisible.toNegated(),sn.CanResolve),title:C("detail.less","show more")}]}));Ye(new _a({id:"toggleExplainMode",precondition:sn.Visible,handler:i=>i.toggleExplainMode(),kbOpts:{weight:100,primary:2138}}));Ye(new _a({id:"toggleSuggestionFocus",precondition:sn.Visible,handler:i=>i.toggleSuggestionFocus(),kbOpts:{weight:Ql,kbExpr:Q.textInputFocus,primary:2570,mac:{primary:778}}}));Ye(new _a({id:"insertBestCompletion",precondition:Me.and(Q.textInputFocus,Me.equals("config.editor.tabCompletion","on"),jk.AtEnd,sn.Visible.toNegated(),Cb.OtherSuggestions.toNegated(),qr.InSnippetMode.toNegated()),handler:(i,e)=>{i.triggerSuggestAndAcceptBest(ia(e)?Object.assign({fallback:"tab"},e):{fallback:"tab"})},kbOpts:{weight:Ql,primary:2}}));Ye(new _a({id:"insertNextSuggestion",precondition:Me.and(Q.textInputFocus,Me.equals("config.editor.tabCompletion","on"),Cb.OtherSuggestions,sn.Visible.toNegated(),qr.InSnippetMode.toNegated()),handler:i=>i.acceptNextSuggestion(),kbOpts:{weight:Ql,kbExpr:Q.textInputFocus,primary:2}}));Ye(new _a({id:"insertPrevSuggestion",precondition:Me.and(Q.textInputFocus,Me.equals("config.editor.tabCompletion","on"),Cb.OtherSuggestions,sn.Visible.toNegated(),qr.InSnippetMode.toNegated()),handler:i=>i.acceptPrevSuggestion(),kbOpts:{weight:Ql,kbExpr:Q.textInputFocus,primary:1026}}));ze(class extends ft{constructor(){super({id:"editor.action.resetSuggestSize",label:C("suggest.reset.label","Reset Suggest Widget Size"),alias:"Reset Suggest Widget Size",precondition:void 0})}run(i,e){var t;(t=Eu.get(e))===null||t===void 0||t.resetWidgetSize()}});class Fwt extends _e{get selectedItem(){return this._selectedItem}constructor(e,t,n,o){super(),this.editor=e,this.suggestControllerPreselector=t,this.checkModelVersion=n,this.onWillAccept=o,this.isSuggestWidgetVisible=!1,this.isShiftKeyPressed=!1,this._isActive=!1,this._currentSuggestItemInfo=void 0,this._selectedItem=Ai(this,void 0),this._register(e.onKeyDown(s=>{s.shiftKey&&!this.isShiftKeyPressed&&(this.isShiftKeyPressed=!0,this.update(this._isActive))})),this._register(e.onKeyUp(s=>{s.shiftKey&&this.isShiftKeyPressed&&(this.isShiftKeyPressed=!1,this.update(this._isActive))}));const r=Eu.get(this.editor);if(r){this._register(r.registerSelector({priority:100,select:(l,c,u)=>{var d;qi(m=>this.checkModelVersion(m));const h=this.editor.getModel();if(!h)return-1;const f=(d=this.suggestControllerPreselector())===null||d===void 0?void 0:d.removeCommonPrefix(h);if(!f)return-1;const g=ae.lift(c),p=u.map((m,_)=>{const w=AE.fromSuggestion(r,h,g,m,this.isShiftKeyPressed).toSingleTextEdit().removeCommonPrefix(h),L=f.augments(w);return{index:_,valid:L,prefixLength:w.text.length,suggestItem:m}}).filter(m=>m&&m.valid&&m.prefixLength>0),v=$0e(p,Rc(m=>m.prefixLength,Ug));return v?v.index:-1}}));let s=!1;const a=()=>{s||(s=!0,this._register(r.widget.value.onDidShow(()=>{this.isSuggestWidgetVisible=!0,this.update(!0)})),this._register(r.widget.value.onDidHide(()=>{this.isSuggestWidgetVisible=!1,this.update(!1)})),this._register(r.widget.value.onDidFocus(()=>{this.isSuggestWidgetVisible=!0,this.update(!0)})))};this._register(st.once(r.model.onDidTrigger)(l=>{a()})),this._register(r.onWillInsertSuggestItem(l=>{const c=this.editor.getPosition(),u=this.editor.getModel();if(!c||!u)return;const d=AE.fromSuggestion(r,u,c,l.item,this.isShiftKeyPressed);this.onWillAccept(d)}))}this.update(this._isActive)}update(e){const t=this.getSuggestItemInfo();(this._isActive!==e||!Bwt(this._currentSuggestItemInfo,t))&&(this._isActive=e,this._currentSuggestItemInfo=t,qi(n=>{this.checkModelVersion(n),this._selectedItem.set(this._isActive?this._currentSuggestItemInfo:void 0,n)}))}getSuggestItemInfo(){const e=Eu.get(this.editor);if(!e||!this.isSuggestWidgetVisible)return;const t=e.widget.value.getFocusedItem(),n=this.editor.getPosition(),o=this.editor.getModel();if(!(!t||!n||!o))return AE.fromSuggestion(e,o,n,t.item,this.isShiftKeyPressed)}stopForceRenderingAbove(){const e=Eu.get(this.editor);e==null||e.stopForceRenderingAbove()}forceRenderingAbove(){const e=Eu.get(this.editor);e==null||e.forceRenderingAbove()}}class AE{static fromSuggestion(e,t,n,o,r){let{insertText:s}=o.completion,a=!1;if(o.completion.insertTextRules&4){const c=new Gw().parse(s);c.children.length<100&&DO.adjustWhitespace(t,n,!0,c),s=c.toString(),a=!0}const l=e.getOverwriteInfo(o,r);return new AE(V.fromPositions(n.delta(0,-l.overwriteBefore),n.delta(0,Math.max(l.overwriteAfter,0))),s,o.completion.kind,a)}constructor(e,t,n,o){this.range=e,this.insertText=t,this.completionItemKind=n,this.isSnippetText=o}equals(e){return this.range.equalsRange(e.range)&&this.insertText===e.insertText&&this.completionItemKind===e.completionItemKind&&this.isSnippetText===e.isSnippetText}toSelectedSuggestionInfo(){return new B_e(this.range,this.insertText,this.completionItemKind,this.isSnippetText)}toSingleTextEdit(){return new Xw(this.range,this.insertText)}}function Bwt(i,e){return i===e?!0:!i||!e?!1:i.equals(e)}var Wwt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Up=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},pU;let Jl=pU=class extends _e{static get(e){return e.getContribution(pU.ID)}constructor(e,t,n,o,r,s,a,l,c){super(),this.editor=e,this.instantiationService=t,this.contextKeyService=n,this.configurationService=o,this.commandService=r,this.debounceService=s,this.languageFeaturesService=a,this.audioCueService=l,this._keybindingService=c,this.model=JP("inlineCompletionModel",void 0),this.textModelVersionId=Ai(this,-1),this.cursorPosition=Ai(this,new ae(1,1)),this.suggestWidgetAdaptor=this._register(new Fwt(this.editor,()=>{var h,f;return(f=(h=this.model.get())===null||h===void 0?void 0:h.selectedInlineCompletion.get())===null||f===void 0?void 0:f.toSingleTextEdit(void 0)},h=>this.updateObservables(h,Nl.Other),h=>{qi(f=>{var g;this.updateObservables(f,Nl.Other),(g=this.model.get())===null||g===void 0||g.handleSuggestAccepted(h)})})),this._enabled=$r(this.editor.onDidChangeConfiguration,()=>this.editor.getOption(62).enabled),this.ghostTextWidget=this._register(this.instantiationService.createInstance(rU,this.editor,{ghostText:this.model.map((h,f)=>h==null?void 0:h.ghostText.read(f)),minReservedLineCount:eO(0),targetTextModel:this.model.map(h=>h==null?void 0:h.textModel)})),this._debounceValue=this.debounceService.for(this.languageFeaturesService.inlineCompletionsProvider,"InlineCompletionsDebounce",{min:50,max:50}),this._register(new Dr(this.contextKeyService,this.model)),this._register(st.runAndSubscribe(e.onDidChangeModel,()=>qi(h=>{this.model.set(void 0,h),this.updateObservables(h,Nl.Other);const f=e.getModel();if(f){const g=t.createInstance(aU,f,this.suggestWidgetAdaptor.selectedItem,this.cursorPosition,this.textModelVersionId,this._debounceValue,$r(e.onDidChangeConfiguration,()=>e.getOption(117).preview),$r(e.onDidChangeConfiguration,()=>e.getOption(117).previewMode),$r(e.onDidChangeConfiguration,()=>e.getOption(62).mode),this._enabled);this.model.set(g,h)}})));const u=h=>{var f;return h.isUndoing?Nl.Undo:h.isRedoing?Nl.Redo:!((f=this.model.get())===null||f===void 0)&&f.isAcceptingPartially?Nl.AcceptWord:Nl.Other};this._register(e.onDidChangeModelContent(h=>qi(f=>this.updateObservables(f,u(h))))),this._register(e.onDidChangeCursorPosition(h=>qi(f=>{var g;this.updateObservables(f,Nl.Other),(h.reason===3||h.source==="api")&&((g=this.model.get())===null||g===void 0||g.stop(f))}))),this._register(e.onDidType(()=>qi(h=>{var f;this.updateObservables(h,Nl.Other),this._enabled.get()&&((f=this.model.get())===null||f===void 0||f.trigger(h))}))),this._register(this.commandService.onDidExecuteCommand(h=>{new Set([Ey.Tab.id,Ey.DeleteLeft.id,Ey.DeleteRight.id,xwe,"acceptSelectedSuggestion"]).has(h.commandId)&&e.hasTextFocus()&&this._enabled.get()&&qi(g=>{var p;(p=this.model.get())===null||p===void 0||p.trigger(g)})})),this._register(this.editor.onDidBlurEditorWidget(()=>{this.contextKeyService.getContextKeyValue("accessibleViewIsShown")||this.configurationService.getValue("editor.inlineSuggest.keepOnBlur")||e.getOption(62).keepOnBlur||Wv.dropDownVisible||qi(h=>{var f;(f=this.model.get())===null||f===void 0||f.stop(h)})})),this._register(Ii(h=>{var f;const g=(f=this.model.read(h))===null||f===void 0?void 0:f.state.read(h);g!=null&&g.suggestItem?g.ghostText.lineCount>=2&&this.suggestWidgetAdaptor.forceRenderingAbove():this.suggestWidgetAdaptor.stopForceRenderingAbove()})),this._register(zt(()=>{this.suggestWidgetAdaptor.stopForceRenderingAbove()}));let d;this._register(Ii(h=>{const f=this.model.read(h),g=f==null?void 0:f.state.read(h);if(!f||!g||!g.inlineCompletion){d=void 0;return}if(g.inlineCompletion.semanticId!==d){d=g.inlineCompletion.semanticId;const p=f.textModel.getLineContent(g.ghostText.lineNumber);this.audioCueService.playAudioCue(Wn.inlineSuggestion).then(()=>{this.editor.getOption(8)&&this.provideScreenReaderUpdate(g.ghostText.renderForScreenReader(p))})}})),this._register(new Oz(this.editor,this.model,this.instantiationService)),this._register(this.configurationService.onDidChangeConfiguration(h=>{h.affectsConfiguration("accessibility.verbosity.inlineCompletions")&&this.editor.updateOptions({inlineCompletionsAccessibilityVerbose:this.configurationService.getValue("accessibility.verbosity.inlineCompletions")})})),this.editor.updateOptions({inlineCompletionsAccessibilityVerbose:this.configurationService.getValue("accessibility.verbosity.inlineCompletions")})}provideScreenReaderUpdate(e){const t=this.contextKeyService.getContextKeyValue("accessibleViewIsShown"),n=this._keybindingService.lookupKeybinding("editor.action.accessibleView");let o;!t&&n&&this.editor.getOption(147)&&(o=C("showAccessibleViewHint","Inspect this in the accessible view ({0})",n.getAriaLabel())),Cs(o?e+", "+o:e)}updateObservables(e,t){var n,o;const r=this.editor.getModel();this.textModelVersionId.set((n=r==null?void 0:r.getVersionId())!==null&&n!==void 0?n:-1,e,t),this.cursorPosition.set((o=this.editor.getPosition())!==null&&o!==void 0?o:new ae(1,1),e)}shouldShowHoverAt(e){var t;const n=(t=this.model.get())===null||t===void 0?void 0:t.ghostText.get();return n?n.parts.some(o=>e.containsPosition(new ae(n.lineNumber,o.column))):!1}shouldShowHoverAtViewZone(e){return this.ghostTextWidget.ownsViewZone(e)}};Jl.ID="editor.contrib.inlineCompletionsController";Jl=pU=Wwt([Up(1,$t),Up(2,Ut),Up(3,En),Up(4,_o),Up(5,qc),Up(6,pt),Up(7,uT),Up(8,xi)],Jl);var t_=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};class NF extends ft{constructor(){super({id:NF.ID,label:C("action.inlineSuggest.showNext","Show Next Inline Suggestion"),alias:"Show Next Inline Suggestion",precondition:Me.and(Q.writable,Dr.inlineSuggestionVisible),kbOpts:{weight:100,primary:606}})}run(e,t){var n;return t_(this,void 0,void 0,function*(){const o=Jl.get(t);(n=o==null?void 0:o.model.get())===null||n===void 0||n.next()})}}NF.ID=Ewe;class RF extends ft{constructor(){super({id:RF.ID,label:C("action.inlineSuggest.showPrevious","Show Previous Inline Suggestion"),alias:"Show Previous Inline Suggestion",precondition:Me.and(Q.writable,Dr.inlineSuggestionVisible),kbOpts:{weight:100,primary:604}})}run(e,t){var n;return t_(this,void 0,void 0,function*(){const o=Jl.get(t);(n=o==null?void 0:o.model.get())===null||n===void 0||n.previous()})}}RF.ID=Lwe;class Vwt extends ft{constructor(){super({id:"editor.action.inlineSuggest.trigger",label:C("action.inlineSuggest.trigger","Trigger Inline Suggestion"),alias:"Trigger Inline Suggestion",precondition:Q.writable})}run(e,t){var n;return t_(this,void 0,void 0,function*(){const o=Jl.get(t);(n=o==null?void 0:o.model.get())===null||n===void 0||n.triggerExplicitly()})}}class Hwt extends ft{constructor(){super({id:"editor.action.inlineSuggest.acceptNextWord",label:C("action.inlineSuggest.acceptNextWord","Accept Next Word Of Inline Suggestion"),alias:"Accept Next Word Of Inline Suggestion",precondition:Me.and(Q.writable,Dr.inlineSuggestionVisible),kbOpts:{weight:100+1,primary:2065,kbExpr:Me.and(Q.writable,Dr.inlineSuggestionVisible)},menuOpts:[{menuId:Z.InlineSuggestionToolbar,title:C("acceptWord","Accept Word"),group:"primary",order:2}]})}run(e,t){var n;return t_(this,void 0,void 0,function*(){const o=Jl.get(t);yield(n=o==null?void 0:o.model.get())===null||n===void 0?void 0:n.acceptNextWord(o.editor)})}}class $wt extends ft{constructor(){super({id:"editor.action.inlineSuggest.acceptNextLine",label:C("action.inlineSuggest.acceptNextLine","Accept Next Line Of Inline Suggestion"),alias:"Accept Next Line Of Inline Suggestion",precondition:Me.and(Q.writable,Dr.inlineSuggestionVisible),kbOpts:{weight:100+1},menuOpts:[{menuId:Z.InlineSuggestionToolbar,title:C("acceptLine","Accept Line"),group:"secondary",order:2}]})}run(e,t){var n;return t_(this,void 0,void 0,function*(){const o=Jl.get(t);yield(n=o==null?void 0:o.model.get())===null||n===void 0?void 0:n.acceptNextLine(o.editor)})}}class zwt extends ft{constructor(){super({id:xwe,label:C("action.inlineSuggest.accept","Accept Inline Suggestion"),alias:"Accept Inline Suggestion",precondition:Dr.inlineSuggestionVisible,menuOpts:[{menuId:Z.InlineSuggestionToolbar,title:C("accept","Accept"),group:"primary",order:1}],kbOpts:{primary:2,weight:200,kbExpr:Me.and(Dr.inlineSuggestionVisible,Q.tabMovesFocus.toNegated(),Dr.inlineSuggestionHasIndentationLessThanTabSize,sn.Visible.toNegated(),Q.hoverFocused.toNegated())}})}run(e,t){var n;return t_(this,void 0,void 0,function*(){const o=Jl.get(t);o&&((n=o.model.get())===null||n===void 0||n.accept(o.editor),o.editor.focus())})}}class MF extends ft{constructor(){super({id:MF.ID,label:C("action.inlineSuggest.hide","Hide Inline Suggestion"),alias:"Hide Inline Suggestion",precondition:Dr.inlineSuggestionVisible,kbOpts:{weight:100,primary:9}})}run(e,t){return t_(this,void 0,void 0,function*(){const n=Jl.get(t);qi(o=>{var r;(r=n==null?void 0:n.model.get())===null||r===void 0||r.stop(o)})})}}MF.ID="editor.action.inlineSuggest.hide";class AF extends ec{constructor(){super({id:AF.ID,title:C("action.inlineSuggest.alwaysShowToolbar","Always Show Toolbar"),f1:!1,precondition:void 0,menu:[{id:Z.InlineSuggestionToolbar,group:"secondary",order:10}],toggled:Me.equals("config.editor.inlineSuggest.showToolbar","always")})}run(e,t){return t_(this,void 0,void 0,function*(){const n=e.get(En),r=n.getValue("editor.inlineSuggest.showToolbar")==="always"?"onHover":"always";n.updateValue("editor.inlineSuggest.showToolbar",r)})}}AF.ID="editor.action.inlineSuggest.toggleAlwaysShowToolbar";var Uwt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},nL=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};class jwt{constructor(e,t,n){this.owner=e,this.range=t,this.controller=n}isValidForHoverAnchor(e){return e.type===1&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}let mU=class{constructor(e,t,n,o,r,s){this._editor=e,this._languageService=t,this._openerService=n,this.accessibilityService=o,this._instantiationService=r,this._telemetryService=s,this.hoverOrdinal=4}suggestHoverAnchor(e){const t=Jl.get(this._editor);if(!t)return null;const n=e.target;if(n.type===8){const o=n.detail;if(t.shouldShowHoverAtViewZone(o.viewZoneId))return new DM(1e3,this,V.fromPositions(this._editor.getModel().validatePosition(o.positionBefore||o.position)),e.event.posx,e.event.posy,!1)}return n.type===7&&t.shouldShowHoverAt(n.range)?new DM(1e3,this,n.range,e.event.posx,e.event.posy,!1):n.type===6&&n.detail.mightBeForeignElement&&t.shouldShowHoverAt(n.range)?new DM(1e3,this,n.range,e.event.posx,e.event.posy,!1):null}computeSync(e,t){if(this._editor.getOption(62).showToolbar==="always")return[];const n=Jl.get(this._editor);return n&&n.shouldShowHoverAt(e.range)?[new jwt(this,e.range,n)]:[]}renderHoverParts(e,t){const n=new Be,o=t[0];this._telemetryService.publicLog2("inlineCompletionHover.shown"),this.accessibilityService.isScreenReaderOptimized()&&!this._editor.getOption(8)&&this.renderScreenReaderText(e,o,n);const r=o.controller.model.get(),s=this._instantiationService.createInstance(Wv,this._editor,!1,eO(null),r.selectedInlineCompletionIndex,r.inlineCompletionsCount,r.selectedInlineCompletion.map(a=>{var l;return(l=a==null?void 0:a.inlineCompletion.source.inlineCompletions.commands)!==null&&l!==void 0?l:[]}));return e.fragment.appendChild(s.getDomNode()),r.triggerExplicitly(),n.add(s),n}renderScreenReaderText(e,t,n){const o=He,r=o("div.hover-row.markdown-hover"),s=Ae(r,o("div.hover-contents",{["aria-live"]:"assertive"})),a=n.add(new up({editor:this._editor},this._languageService,this._openerService)),l=c=>{n.add(a.onDidRenderAsync(()=>{s.className="hover-contents code-hover-contents",e.onContentsChanged()}));const u=C("inlineSuggestionFollows","Suggestion:"),d=n.add(a.render(new os().appendText(u).appendCodeblock("text",c)));s.replaceChildren(d.element)};n.add(Ii(c=>{var u;const d=(u=t.controller.model.read(c))===null||u===void 0?void 0:u.ghostText.read(c);if(d){const h=this._editor.getModel().getLineContent(d.lineNumber);l(d.renderForScreenReader(h))}else jr(s)})),e.fragment.appendChild(r)}};mU=Uwt([nL(1,Ki),nL(2,ml),nL(3,vp),nL(4,$t),nL(5,tc)],mU);zn(Jl.ID,Jl,3);ze(Vwt);ze(NF);ze(RF);ze(Hwt);ze($wt);ze(zwt);ze(MF);$i(AF);e1.register(mU);function Ya(i,e){let t=0;for(let n=0;n=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},qwt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};function hSe(i,e,t,n,o){if(i.getLineCount()===1&&i.getLineMaxColumn(1)===1)return[];const r=e.getLanguageConfiguration(i.getLanguageId()).indentationRules;if(!r)return[];for(n=Math.min(n,i.getLineCount());t<=n&&r.unIndentedLinePattern;){const v=i.getLineContent(t);if(!r.unIndentedLinePattern.test(v))break;t++}if(t>n-1)return[];const{tabSize:s,indentSize:a,insertSpaces:l}=i.getOptions(),c=(v,m)=>(m=m||1,Ec.shiftIndent(v,v.length+m,s,a,l)),u=(v,m)=>(m=m||1,Ec.unshiftIndent(v,v.length+m,s,a,l)),d=[];let h;const f=i.getLineContent(t);let g=f;if(o!=null){h=o;const v=Si(f);g=h+f.substring(v.length),r.decreaseIndentPattern&&r.decreaseIndentPattern.test(g)&&(h=u(h),g=h+f.substring(v.length)),f!==g&&d.push(Gi.replaceMove(new gt(t,1,t,v.length+1),uP(h,a,l)))}else h=Si(f);let p=h;r.increaseIndentPattern&&r.increaseIndentPattern.test(g)?(p=c(p),h=c(h)):r.indentNextLinePattern&&r.indentNextLinePattern.test(g)&&(p=c(p)),t++;for(let v=t;v<=n;v++){const m=i.getLineContent(v),_=Si(m),y=p+m.substring(_.length);r.decreaseIndentPattern&&r.decreaseIndentPattern.test(y)&&(p=u(p),h=u(h)),_!==p&&d.push(Gi.replaceMove(new gt(v,1,v,_.length+1),uP(p,a,l))),!(r.unIndentedLinePattern&&r.unIndentedLinePattern.test(m))&&(r.increaseIndentPattern&&r.increaseIndentPattern.test(y)?(h=c(h),p=h):r.indentNextLinePattern&&r.indentNextLinePattern.test(y)?p=c(p):p=h)}return d}class PF extends ft{constructor(){super({id:PF.ID,label:C("indentationToSpaces","Convert Indentation to Spaces"),alias:"Convert Indentation to Spaces",precondition:Q.writable})}run(e,t){const n=t.getModel();if(!n)return;const o=n.getOptions(),r=t.getSelection();if(!r)return;const s=new Zwt(r,o.tabSize);t.pushUndoStop(),t.executeCommands(this.id,[s]),t.pushUndoStop(),n.updateOptions({insertSpaces:!0})}}PF.ID="editor.action.indentationToSpaces";class OF extends ft{constructor(){super({id:OF.ID,label:C("indentationToTabs","Convert Indentation to Tabs"),alias:"Convert Indentation to Tabs",precondition:Q.writable})}run(e,t){const n=t.getModel();if(!n)return;const o=n.getOptions(),r=t.getSelection();if(!r)return;const s=new Qwt(r,o.tabSize);t.pushUndoStop(),t.executeCommands(this.id,[s]),t.pushUndoStop(),n.updateOptions({insertSpaces:!1})}}OF.ID="editor.action.indentationToTabs";class FY extends ft{constructor(e,t,n){super(n),this.insertSpaces=e,this.displaySizeOnly=t}run(e,t){const n=e.get(uh),o=e.get(Yi),r=t.getModel();if(!r)return;const s=o.getCreationOptions(r.getLanguageId(),r.uri,r.isForSimpleWidget),a=r.getOptions(),l=[1,2,3,4,5,6,7,8].map(u=>({id:u.toString(),label:u.toString(),description:u===s.tabSize&&u===a.tabSize?C("configuredTabSize","Configured Tab Size"):u===s.tabSize?C("defaultTabSize","Default Tab Size"):u===a.tabSize?C("currentTabSize","Current Tab Size"):void 0})),c=Math.min(r.getOptions().tabSize-1,7);setTimeout(()=>{n.pick(l,{placeHolder:C({key:"selectTabWidth",comment:["Tab corresponds to the tab key"]},"Select Tab Size for Current File"),activeItem:l[c]}).then(u=>{if(u&&r&&!r.isDisposed()){const d=parseInt(u.label,10);this.displaySizeOnly?r.updateOptions({tabSize:d}):r.updateOptions({tabSize:d,indentSize:d,insertSpaces:this.insertSpaces})}})},50)}}class FF extends FY{constructor(){super(!1,!1,{id:FF.ID,label:C("indentUsingTabs","Indent Using Tabs"),alias:"Indent Using Tabs",precondition:void 0})}}FF.ID="editor.action.indentUsingTabs";class BF extends FY{constructor(){super(!0,!1,{id:BF.ID,label:C("indentUsingSpaces","Indent Using Spaces"),alias:"Indent Using Spaces",precondition:void 0})}}BF.ID="editor.action.indentUsingSpaces";class WF extends FY{constructor(){super(!0,!0,{id:WF.ID,label:C("changeTabDisplaySize","Change Tab Display Size"),alias:"Change Tab Display Size",precondition:void 0})}}WF.ID="editor.action.changeTabDisplaySize";class VF extends ft{constructor(){super({id:VF.ID,label:C("detectIndentation","Detect Indentation from Content"),alias:"Detect Indentation from Content",precondition:void 0})}run(e,t){const n=e.get(Yi),o=t.getModel();if(!o)return;const r=n.getCreationOptions(o.getLanguageId(),o.uri,o.isForSimpleWidget);o.detectIndentation(r.insertSpaces,r.tabSize)}}VF.ID="editor.action.detectIndentation";class Gwt extends ft{constructor(){super({id:"editor.action.reindentlines",label:C("editor.reindentlines","Reindent Lines"),alias:"Reindent Lines",precondition:Q.writable})}run(e,t){const n=e.get(Ti),o=t.getModel();if(!o)return;const r=hSe(o,n,1,o.getLineCount());r.length>0&&(t.pushUndoStop(),t.executeEdits(this.id,r),t.pushUndoStop())}}class Xwt extends ft{constructor(){super({id:"editor.action.reindentselectedlines",label:C("editor.reindentselectedlines","Reindent Selected Lines"),alias:"Reindent Selected Lines",precondition:Q.writable})}run(e,t){const n=e.get(Ti),o=t.getModel();if(!o)return;const r=t.getSelections();if(r===null)return;const s=[];for(const a of r){let l=a.startLineNumber,c=a.endLineNumber;if(l!==c&&a.endColumn===1&&c--,l===1){if(l===c)continue}else l--;const u=hSe(o,n,l,c);s.push(...u)}s.length>0&&(t.pushUndoStop(),t.executeEdits(this.id,s),t.pushUndoStop())}}class Ywt{constructor(e,t){this._initialSelection=t,this._edits=[],this._selectionId=null;for(const n of e)n.range&&typeof n.text=="string"&&this._edits.push(n)}getEditOperations(e,t){for(const o of this._edits)t.addEditOperation(V.lift(o.range),o.text);let n=!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?(n=!0,this._selectionId=t.trackSelection(this._initialSelection,!0)):this._edits[0].range.endColumn===this._initialSelection.startColumn&&this._edits[0].range.endLineNumber===this._initialSelection.startLineNumber&&(n=!0,this._selectionId=t.trackSelection(this._initialSelection,!1))),n||(this._selectionId=t.trackSelection(this._initialSelection))}computeCursorState(e,t){return t.getTrackedSelection(this._selectionId)}}let qk=class{constructor(e,t){this.editor=e,this._languageConfigurationService=t,this.callOnDispose=new Be,this.callOnModel=new Be,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(12)<4||this.editor.getOption(55))&&(!this.editor.hasModel()||this.callOnModel.add(this.editor.onDidPaste(({range:e})=>{this.trigger(e)})))}trigger(e){const t=this.editor.getSelections();if(t===null||t.length>1)return;const n=this.editor.getModel();if(!n||!n.tokenization.isCheapToTokenize(e.getStartPosition().lineNumber))return;const o=this.editor.getOption(12),{tabSize:r,indentSize:s,insertSpaces:a}=n.getOptions(),l=[],c={shiftIndent:f=>Ec.shiftIndent(f,f.length+1,r,s,a),unshiftIndent:f=>Ec.unshiftIndent(f,f.length+1,r,s,a)};let u=e.startLineNumber;for(;u<=e.endLineNumber;){if(this.shouldIgnoreLine(n,u)){u++;continue}break}if(u>e.endLineNumber)return;let d=n.getLineContent(u);if(!/\S/.test(d.substring(0,e.startColumn-1))){const f=fE(o,n,n.getLanguageId(),u,c,this._languageConfigurationService);if(f!==null){const g=Si(d),p=Ya(f,r),v=Ya(g,r);if(p!==v){const m=PE(p,r,a);l.push({range:new V(u,1,u,g.length+1),text:m}),d=m+d.substr(g.length)}else{const m=Ibe(n,u,this._languageConfigurationService);if(m===0||m===8)return}}}const h=u;for(;un.tokenization.getLineTokens(p),getLanguageId:()=>n.getLanguageId(),getLanguageIdAtPosition:(p,v)=>n.getLanguageIdAtPosition(p,v)},getLineContent:p=>p===h?d:n.getLineContent(p)},n.getLanguageId(),u+1,c,this._languageConfigurationService);if(g!==null){const p=Ya(g,r),v=Ya(Si(n.getLineContent(u+1)),r);if(p!==v){const m=p-v;for(let _=u+1;_<=e.endLineNumber;_++){const y=n.getLineContent(_),w=Si(y),D=Ya(w,r)+m,E=PE(D,r,a);E!==w&&l.push({range:new V(_,1,_,w.length+1),text:E})}}}}if(l.length>0){this.editor.pushUndoStop();const f=new Ywt(l,this.editor.getSelection());this.editor.executeCommand("autoIndentOnPaste",f),this.editor.pushUndoStop()}}shouldIgnoreLine(e,t){e.tokenization.forceTokenization(t);const n=e.getLineFirstNonWhitespaceColumn(t);if(n===0)return!0;const o=e.tokenization.getLineTokens(t);if(o.getCount()>0){const r=o.findTokenIndexAtOffset(n);if(r>=0&&o.getStandardTokenType(r)===1)return!0}return!1}dispose(){this.callOnDispose.dispose(),this.callOnModel.dispose()}};qk.ID="editor.contrib.autoIndentOnPaste";qk=Kwt([qwt(1,Ti)],qk);function fSe(i,e,t,n){if(i.getLineCount()===1&&i.getLineMaxColumn(1)===1)return;let o="";for(let s=0;sthis._currentResolve=void 0)),yield this._currentResolve}})}_doResolve(e){var t,n;return kO(this,void 0,void 0,function*(){try{const o=yield Promise.resolve(this.provider.resolveInlayHint(this.hint,e));this.hint.tooltip=(t=o==null?void 0:o.tooltip)!==null&&t!==void 0?t:this.hint.tooltip,this.hint.label=(n=o==null?void 0:o.label)!==null&&n!==void 0?n:this.hint.label,this._isResolved=!0}catch(o){$o(o),this._isResolved=!1}})}}class Gk{static create(e,t,n,o){return kO(this,void 0,void 0,function*(){const r=[],s=e.ordered(t).reverse().map(a=>n.map(l=>kO(this,void 0,void 0,function*(){try{const c=yield a.provideInlayHints(t,l,o);c!=null&&c.hints.length&&r.push([c,a])}catch(c){$o(c)}})));if(yield Promise.all(s.flat()),o.isCancellationRequested||t.isDisposed())throw new Gv;return new Gk(n,r,t)})}constructor(e,t,n){this._disposables=new Be,this.ranges=e,this.provider=new Set;const o=[];for(const[r,s]of t){this._disposables.add(r),this.provider.add(s);for(const a of r.hints){const l=n.validatePosition(a.position);let c="before";const u=Gk._getRangeAtPosition(n,l);let d;u.getStartPosition().isBefore(l)?(d=V.fromPositions(u.getStartPosition(),l),c="after"):(d=V.fromPositions(l,u.getEndPosition()),c="before"),o.push(new BY(a,new gSe(d,c),s))}}this.items=o.sort((r,s)=>ae.compare(r.hint.position,s.hint.position))}dispose(){this._disposables.dispose()}static _getRangeAtPosition(e,t){const n=t.lineNumber,o=e.getWordAtPosition(t);if(o)return new V(n,o.startColumn,n,o.endColumn);e.tokenization.tokenizeIfCheap(n);const r=e.tokenization.getLineTokens(n),s=t.column-1,a=r.findTokenIndexAtOffset(s);let l=r.getStartOffset(a),c=r.getEndOffset(a);return c-l===1&&(l===s&&a>1?(l=r.getStartOffset(a-1),c=r.getEndOffset(a-1)):c===s&&aIC(g)?g.command.id:_F()));for(const g of Bs.all())h.has(g.desc.id)&&d.push(new ca(g.desc.id,Fu.label(g.desc,{renderShortTitle:!0}),void 0,!0,()=>OE(this,void 0,void 0,function*(){const p=yield r.createModelReference(u.uri);try{const v=new $w(p.object.textEditorModel,V.getStartPosition(u.range)),m=n.item.anchor.range;yield l.invokeFunction(g.runEditorCommand.bind(g),e,v,m)}finally{p.dispose()}})));if(n.part.command){const{command:g}=n.part;d.push(new kr),d.push(new ca(g.id,g.title,void 0,!0,()=>OE(this,void 0,void 0,function*(){var p;try{yield a.executeCommand(g.id,...(p=g.arguments)!==null&&p!==void 0?p:[])}catch(v){c.notify({severity:E5.Error,source:n.item.provider.displayName,message:v})}})))}const f=e.getOption(126);s.showContextMenu({domForShadowRoot:f&&(o=e.getDomNode())!==null&&o!==void 0?o:void 0,getAnchor:()=>{const g=Yo(t);return{x:g.left,y:g.top+g.height+8}},getActions:()=>d,onHide:()=>{e.focus()},autoSelectFirstItem:!0})})}function pSe(i,e,t,n){return OE(this,void 0,void 0,function*(){const r=yield i.get(za).createModelReference(n.uri);yield t.invokeWithinContext(s=>OE(this,void 0,void 0,function*(){const a=e.hasSideBySideModifier,l=s.get(Ut),c=Ha.inPeekEditor.getValue(l),u=!a&&t.getOption(87)&&!c;return new yT({openToSide:a,openInPeek:u,muteMessage:!0},{title:{value:"",original:""},id:"",precondition:void 0}).run(s,new $w(r.object.textEditorModel,V.getStartPosition(n.range)),V.lift(n.range))})),r.dispose()})}var tSt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},tC=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},pC=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},NM;class IO{constructor(){this._entries=new Yv(50)}get(e){const t=IO._key(e);return this._entries.get(t)}set(e,t){const n=IO._key(e);this._entries.set(n,t)}static _key(e){return`${e.uri.toString()}/${e.getVersionId()}`}}const mSe=yn("IInlayHintsCache");Mn(mSe,IO,1);class vU{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 nSt{constructor(e,t){this.part=e,this.hasTriggerModifier=t}}let yb=NM=class{static get(e){var t;return(t=e.getContribution(NM.ID))!==null&&t!==void 0?t:void 0}constructor(e,t,n,o,r,s,a){this._editor=e,this._languageFeaturesService=t,this._inlayHintsCache=o,this._commandService=r,this._notificationService=s,this._instaService=a,this._disposables=new Be,this._sessionDisposables=new Be,this._decorationsMetadata=new Map,this._ruleFactory=new qI(this._editor),this._activeRenderMode=0,this._debounceInfo=n.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(l=>{l.hasChanged(139)&&this._update()})),this._update()}dispose(){this._sessionDisposables.dispose(),this._removeAllDecorations(),this._disposables.dispose()}_update(){this._sessionDisposables.clear(),this._removeAllDecorations();const e=this._editor.getOption(139);if(e.enabled==="off")return;const t=this._editor.getModel();if(!t||!this._languageFeaturesService.inlayHintsProvider.has(t))return;const n=this._inlayHintsCache.get(t);n&&this._updateHintsDecorators([t.getFullModelRange()],n),this._sessionDisposables.add(zt(()=>{t.isDisposed()||this._cacheHintsForFastRestore(t)}));let o;const r=new Set,s=new bi(()=>pC(this,void 0,void 0,function*(){const a=Date.now();o==null||o.dispose(!0),o=new Ro;const l=t.onWillDispose(()=>o==null?void 0:o.cancel());try{const c=o.token,u=yield Gk.create(this._languageFeaturesService.inlayHintsProvider,t,this._getHintsRanges(),c);if(s.delay=this._debounceInfo.update(t,Date.now()-a),c.isCancellationRequested){u.dispose();return}for(const d of u.provider)typeof d.onDidChangeInlayHints=="function"&&!r.has(d)&&(r.add(d),this._sessionDisposables.add(d.onDidChangeInlayHints(()=>{s.isScheduled()||s.schedule()})));this._sessionDisposables.add(u),this._updateHintsDecorators(u.ranges,u.items),this._cacheHintsForFastRestore(t)}catch(c){en(c)}finally{o.dispose(),l.dispose()}}),this._debounceInfo.get(t));if(this._sessionDisposables.add(s),this._sessionDisposables.add(zt(()=>o==null?void 0:o.dispose(!0))),s.schedule(0),this._sessionDisposables.add(this._editor.onDidScrollChange(a=>{(a.scrollTopChanged||!s.isScheduled())&&s.schedule()})),this._sessionDisposables.add(this._editor.onDidChangeModelContent(a=>{const l=Math.max(s.delay,1250);s.schedule(l)})),e.enabled==="on")this._activeRenderMode=0;else{let a,l;e.enabled==="onUnlessPressed"?(a=0,l=1):(a=1,l=0),this._activeRenderMode=a,this._sessionDisposables.add(Rg.getInstance().event(c=>{if(!this._editor.hasModel())return;const u=c.altKey&&c.ctrlKey&&!(c.shiftKey||c.metaKey)?l:a;if(u!==this._activeRenderMode){this._activeRenderMode=u;const d=this._editor.getModel(),h=this._copyInlayHintsWithCurrentAnchor(d);this._updateHintsDecorators([d.getFullModelRange()],h),s.schedule(0)}}))}this._sessionDisposables.add(this._installDblClickGesture(()=>s.schedule(0))),this._sessionDisposables.add(this._installLinkGesture()),this._sessionDisposables.add(this._installContextMenu())}_installLinkGesture(){const e=new Be,t=e.add(new cF(this._editor)),n=new Be;return e.add(n),e.add(t.onMouseMoveOrRelevantKeyDown(o=>{const[r]=o,s=this._getInlayHintLabelPart(r),a=this._editor.getModel();if(!s||!a){n.clear();return}const l=new Ro;n.add(zt(()=>l.dispose(!0))),s.item.resolve(l.token),this._activeInlayHintPart=s.part.command||s.part.location?new nSt(s,r.hasTriggerModifier):void 0;const c=a.validatePosition(s.item.hint.position).lineNumber,u=new V(c,1,c,a.getLineMaxColumn(c)),d=this._getInlineHintsForRange(u);this._updateHintsDecorators([u],d),n.add(zt(()=>{this._activeInlayHintPart=void 0,this._updateHintsDecorators([u],d)}))})),e.add(t.onCancel(()=>n.clear())),e.add(t.onExecute(o=>pC(this,void 0,void 0,function*(){const r=this._getInlayHintLabelPart(o);if(r){const s=r.part;s.location?this._instaService.invokeFunction(pSe,o,this._editor,s.location):JW.is(s.command)&&(yield this._invokeCommand(s.command,r.item))}}))),e}_getInlineHintsForRange(e){const t=new Set;for(const n of this._decorationsMetadata.values())e.containsRange(n.item.anchor.range)&&t.add(n.item);return Array.from(t)}_installDblClickGesture(e){return this._editor.onMouseUp(t=>pC(this,void 0,void 0,function*(){if(t.event.detail!==2)return;const n=this._getInlayHintLabelPart(t);if(!!n&&(t.event.preventDefault(),yield n.item.resolve(_n.None),ws(n.item.hint.textEdits))){const o=n.item.hint.textEdits.map(r=>Gi.replace(V.lift(r.range),r.text));this._editor.executeEdits("inlayHint.default",o),e()}}))}_installContextMenu(){return this._editor.onContextMenu(e=>pC(this,void 0,void 0,function*(){if(!(e.event.target instanceof HTMLElement))return;const t=this._getInlayHintLabelPart(e);t&&(yield this._instaService.invokeFunction(eSt,this._editor,e.event.target,t))}))}_getInlayHintLabelPart(e){var t;if(e.target.type!==6)return;const n=(t=e.target.detail.injectedText)===null||t===void 0?void 0:t.options;if(n instanceof Nv&&(n==null?void 0:n.attachedData)instanceof vU)return n.attachedData}_invokeCommand(e,t){var n;return pC(this,void 0,void 0,function*(){try{yield this._commandService.executeCommand(e.id,...(n=e.arguments)!==null&&n!==void 0?n:[])}catch(o){this._notificationService.notify({severity:E5.Error,source:t.provider.displayName,message:o})}})}_cacheHintsForFastRestore(e){const t=this._copyInlayHintsWithCurrentAnchor(e);this._inlayHintsCache.set(e,t)}_copyInlayHintsWithCurrentAnchor(e){const t=new Map;for(const[n,o]of this._decorationsMetadata){if(t.has(o.item))continue;const r=e.getDecorationRange(n);if(r){const s=new gSe(r,o.item.anchor.direction),a=o.item.with({anchor:s});t.set(o.item,a)}}return Array.from(t.values())}_getHintsRanges(){const t=this._editor.getModel(),n=this._editor.getVisibleRangesPlusViewportAboveBelow(),o=[];for(const r of n.sort(V.compareRangesUsingStarts)){const s=t.validateRange(new V(r.startLineNumber-30,r.startColumn,r.endLineNumber+30,r.endColumn));o.length===0||!V.areIntersectingOrTouching(o[o.length-1],s)?o.push(s):o[o.length-1]=V.plusRange(o[o.length-1],s)}return o}_updateHintsDecorators(e,t){var n,o;const r=[],s=(p,v,m,_,y)=>{const w={content:m,inlineClassNameAffectsLetterSpacing:!0,inlineClassName:v.className,cursorStops:_,attachedData:y};r.push({item:p,classNameRef:v,decoration:{range:p.anchor.range,options:{description:"InlayHint",showIfCollapsed:p.anchor.range.isEmpty(),collapseOnReplaceEdit:!p.anchor.range.isEmpty(),stickiness:0,[p.anchor.direction]:this._activeRenderMode===0?w:void 0}}})},a=(p,v)=>{const m=this._ruleFactory.createClassNameRef({width:`${l/3|0}px`,display:"inline-block"});s(p,m,"\u200A",v?Nd.Right:Nd.None)},{fontSize:l,fontFamily:c,padding:u,isUniform:d}=this._getLayoutInfo(),h="--code-editorInlayHintsFontFamily";this._editor.getContainerDomNode().style.setProperty(h,c);for(const p of t){p.hint.paddingLeft&&a(p,!1);const v=typeof p.hint.label=="string"?[{label:p.hint.label}]:p.hint.label;for(let m=0;mNM._MAX_DECORATORS)break}const f=[];for(const p of e)for(const{id:v}of(o=this._editor.getDecorationsInRange(p))!==null&&o!==void 0?o:[]){const m=this._decorationsMetadata.get(v);m&&(f.push(v),m.classNameRef.dispose(),this._decorationsMetadata.delete(v))}const g=Zd.capture(this._editor);this._editor.changeDecorations(p=>{const v=p.deltaDecorations(f,r.map(m=>m.decoration));for(let m=0;mn)&&(r=n);const s=e.fontFamily||o;return{fontSize:r,fontFamily:s,padding:t,isUniform:!t&&s===o&&r===n}}_removeAllDecorations(){this._editor.removeDecorations(Array.from(this._decorationsMetadata.keys()));for(const e of this._decorationsMetadata.values())e.classNameRef.dispose();this._decorationsMetadata.clear()}};yb.ID="editor.contrib.InlayHints";yb._MAX_DECORATORS=1500;yb=NM=tSt([tC(1,pt),tC(2,qc),tC(3,mSe),tC(4,_o),tC(5,Ao),tC(6,$t)],yb);function iSt(i){const e="\xA0";return i.replace(/[ \t]/g,e)}Rn.registerCommand("_executeInlayHintProvider",(i,...e)=>pC(void 0,void 0,void 0,function*(){const[t,n]=e;fi(Rt.isUri(t)),fi(V.isIRange(n));const{inlayHintsProvider:o}=i.get(pt),r=yield i.get(za).createModelReference(t);try{const s=yield Gk.create(o,r.object.textEditorModel,[V.lift(n)],_n.None),a=s.items.map(l=>l.hint);return setTimeout(()=>s.dispose(),0),a}finally{r.dispose()}}));var oSt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},iL=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},Wce=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},rSt=globalThis&&globalThis.__asyncValues||function(i){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=i[Symbol.asyncIterator],t;return e?e.call(i):(i=typeof __values=="function"?__values(i):i[Symbol.iterator](),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(r){t[r]=i[r]&&function(s){return new Promise(function(a,l){s=i[r](s),o(a,l,s.done,s.value)})}}function o(r,s,a,l){Promise.resolve(l).then(function(c){r({value:c,done:a})},s)}};class Vce extends DM{constructor(e,t,n,o){super(10,t,e.item.anchor.range,n,o,!0),this.part=e}}let _U=class extends pO{constructor(e,t,n,o,r,s){super(e,t,n,o,s),this._resolverService=r,this.hoverOrdinal=6}suggestHoverAnchor(e){var t;if(!yb.get(this._editor)||e.target.type!==6)return null;const o=(t=e.target.detail.injectedText)===null||t===void 0?void 0:t.options;return o instanceof Nv&&o.attachedData instanceof vU?new Vce(o.attachedData,this,e.event.posx,e.event.posy):null}computeSync(){return[]}computeAsync(e,t,n){return e instanceof Vce?new Wo(o=>Wce(this,void 0,void 0,function*(){var r,s,a,l;const{part:c}=e;if(yield c.item.resolve(n),n.isCancellationRequested)return;let u;typeof c.item.hint.tooltip=="string"?u=new os().appendText(c.item.hint.tooltip):c.item.hint.tooltip&&(u=c.item.hint.tooltip),u&&o.emitOne(new Dd(this,e.range,[u],!1,0)),ws(c.item.hint.textEdits)&&o.emitOne(new Dd(this,e.range,[new os().appendText(C("hint.dbl","Double-click to insert"))],!1,10001));let d;if(typeof c.part.tooltip=="string"?d=new os().appendText(c.part.tooltip):c.part.tooltip&&(d=c.part.tooltip),d&&o.emitOne(new Dd(this,e.range,[d],!1,1)),c.part.location||c.part.command){let v;const _=this._editor.getOption(77)==="altKey"?Nn?C("links.navigate.kb.meta.mac","cmd + click"):C("links.navigate.kb.meta","ctrl + click"):Nn?C("links.navigate.kb.alt.mac","option + click"):C("links.navigate.kb.alt","alt + click");c.part.location&&c.part.command?v=new os().appendText(C("hint.defAndCommand","Go to Definition ({0}), right click for more",_)):c.part.location?v=new os().appendText(C("hint.def","Go to Definition ({0})",_)):c.part.command&&(v=new os(`[${C("hint.cmd","Execute Command")}](${Jwt(c.part.command)} "${c.part.command.title}") (${_})`,{isTrusted:!0})),v&&o.emitOne(new Dd(this,e.range,[v],!1,1e4))}const h=yield this._resolveInlayHintLabelPartHover(c,n);try{for(var f=!0,g=rSt(h),p;p=yield g.next(),r=p.done,!r;f=!0){l=p.value,f=!1;const v=l;o.emitOne(v)}}catch(v){s={error:v}}finally{try{!f&&!r&&(a=g.return)&&(yield a.call(g))}finally{if(s)throw s.error}}})):Wo.EMPTY}_resolveInlayHintLabelPartHover(e,t){return Wce(this,void 0,void 0,function*(){if(!e.part.location)return Wo.EMPTY;const{uri:n,range:o}=e.part.location,r=yield this._resolverService.createModelReference(n);try{const s=r.object.textEditorModel;return this._languageFeaturesService.hoverProvider.has(s)?pY(this._languageFeaturesService.hoverProvider,s,new ae(o.startLineNumber,o.startColumn),t).filter(a=>!Mw(a.hover.contents)).map(a=>new Dd(this,e.item.anchor.range,a.hover.contents,!1,2+a.ordinal)):Wo.EMPTY}finally{r.dispose()}})}};_U=oSt([iL(1,Ki),iL(2,ml),iL(3,En),iL(4,za),iL(5,pt)],_U);zn(yb.ID,yb,1);e1.register(_U);class sSt{constructor(e,t,n){this._editRange=e,this._originalSelection=t,this._text=n}getEditOperations(e,t){t.addTrackedEditOperation(this._editRange,this._text)}computeCursorState(e,t){const o=t.getInverseEditOperations()[0].range;return this._originalSelection.isEmpty()?new gt(o.endLineNumber,Math.min(this._originalSelection.positionColumn,o.endColumn),o.endLineNumber,Math.min(this._originalSelection.positionColumn,o.endColumn)):new gt(o.endLineNumber,o.endColumn-this._text.length,o.endLineNumber,o.endColumn)}}var aSt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},lSt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},RM;let Hv=RM=class{static get(e){return e.getContribution(RM.ID)}constructor(e,t){this.editor=e,this.editorWorkerService=t,this.decorations=this.editor.createDecorationsCollection()}dispose(){}run(e,t){var n;(n=this.currentRequest)===null||n===void 0||n.cancel();const o=this.editor.getSelection(),r=this.editor.getModel();if(!r||!o)return;let s=o;if(s.startLineNumber!==s.endLineNumber)return;const a=new Rk(this.editor,5),l=r.uri;return this.editorWorkerService.canNavigateValueSet(l)?(this.currentRequest=sr(c=>this.editorWorkerService.navigateValueSet(l,s,t)),this.currentRequest.then(c=>{var u;if(!c||!c.range||!c.value||!a.validate(this.editor))return;const d=V.lift(c.range);let h=c.range;const f=c.value.length-(s.endColumn-s.startColumn);h={startLineNumber:h.startLineNumber,startColumn:h.startColumn,endLineNumber:h.endLineNumber,endColumn:h.startColumn+c.value.length},f>1&&(s=new gt(s.startLineNumber,s.startColumn,s.endLineNumber,s.endColumn+f-1));const g=new sSt(d,s,c.value);this.editor.pushUndoStop(),this.editor.executeCommand(e,g),this.editor.pushUndoStop(),this.decorations.set([{range:h,options:RM.DECORATION}]),(u=this.decorationRemover)===null||u===void 0||u.cancel(),this.decorationRemover=wv(350),this.decorationRemover.then(()=>this.decorations.clear()).catch(en)}).catch(en)):Promise.resolve(void 0)}};Hv.ID="editor.contrib.inPlaceReplaceController";Hv.DECORATION=Jt.register({description:"in-place-replace",className:"valueSetReplacement"});Hv=RM=aSt([lSt(1,Xu)],Hv);class cSt extends ft{constructor(){super({id:"editor.action.inPlaceReplace.up",label:C("InPlaceReplaceAction.previous.label","Replace with Previous Value"),alias:"Replace with Previous Value",precondition:Q.writable,kbOpts:{kbExpr:Q.editorTextFocus,primary:3159,weight:100}})}run(e,t){const n=Hv.get(t);return n?n.run(this.id,!1):Promise.resolve(void 0)}}class uSt extends ft{constructor(){super({id:"editor.action.inPlaceReplace.down",label:C("InPlaceReplaceAction.next.label","Replace with Next Value"),alias:"Replace with Next Value",precondition:Q.writable,kbOpts:{kbExpr:Q.editorTextFocus,primary:3161,weight:100}})}run(e,t){const n=Hv.get(t);return n?n.run(this.id,!0):Promise.resolve(void 0)}}zn(Hv.ID,Hv,4);ze(cSt);ze(uSt);class dSt extends ft{constructor(){super({id:"expandLineSelection",label:C("expandLineSelection","Expand Line Selection"),alias:"Expand Line Selection",precondition:void 0,kbOpts:{weight:0,kbExpr:Q.textInputFocus,primary:2090}})}run(e,t,n){if(n=n||{},!t.hasModel())return;const o=t._getViewModel();o.model.pushStackElement(),o.setCursorStates(n.source,3,Mr.expandLineSelection(o,o.getCursorStates())),o.revealPrimaryCursor(n.source,!0)}}ze(dSt);class hSt{constructor(e,t){this._selection=e,this._cursors=t,this._selectionId=null}getEditOperations(e,t){const n=fSt(e,this._cursors);for(let o=0,r=n.length;os.lineNumber===a.lineNumber?s.column-a.column:s.lineNumber-a.lineNumber);for(let s=e.length-2;s>=0;s--)e[s].lineNumber===e[s+1].lineNumber&&e.splice(s,1);const t=[];let n=0,o=0;const r=e.length;for(let s=1,a=i.getLineCount();s<=a;s++){const l=i.getLineContent(s),c=l.length+1;let u=0;if(o=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},cSt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let pU=class{constructor(e,t,n,o){this._languageConfigurationService=o,this._selection=e,this._isMovingDown=t,this._autoIndent=n,this._selectionId=null,this._moveEndLineSelectionShrink=!1}getEditOperations(e,t){const n=e.getLineCount();if(this._isMovingDown&&this._selection.endLineNumber===n){this._selectionId=t.trackSelection(this._selection);return}if(!this._isMovingDown&&this._selection.startLineNumber===1){this._selectionId=t.trackSelection(this._selection);return}this._moveEndPositionDown=!1;let o=this._selection;o.startLineNumbere.tokenization.getLineTokens(u),getLanguageId:()=>e.getLanguageId(),getLanguageIdAtPosition:(u,d)=>e.getLanguageIdAtPosition(u,d)},getLineContent:null};if(o.startLineNumber===o.endLineNumber&&e.getLineMaxColumn(o.startLineNumber)===1){const u=o.startLineNumber,d=this._isMovingDown?u+1:u-1;e.getLineMaxColumn(d)===1?t.addEditOperation(new V(1,1,1,1),null):(t.addEditOperation(new V(u,1,u,1),e.getLineContent(d)),t.addEditOperation(new V(d,1,d,e.getLineMaxColumn(d)),null)),o=new gt(d,1,d,1)}else{let u,d;if(this._isMovingDown){u=o.endLineNumber+1,d=e.getLineContent(u),t.addEditOperation(new V(u-1,e.getLineMaxColumn(u-1),u,e.getLineMaxColumn(u)),null);let h=d;if(this.shouldAutoIndent(e,o)){const f=this.matchEnterRule(e,l,r,u,o.startLineNumber-1);if(f!==null){const p=Si(e.getLineContent(u)),v=f+Ya(p,r);h=AE(v,r,a)+this.trimStart(d)}else{c.getLineContent=v=>v===o.startLineNumber?e.getLineContent(u):e.getLineContent(v);const p=hE(this._autoIndent,c,e.getLanguageIdAtPosition(u,1),o.startLineNumber,l,this._languageConfigurationService);if(p!==null){const v=Si(e.getLineContent(u)),m=Ya(p,r),_=Ya(v,r);m!==_&&(h=AE(m,r,a)+this.trimStart(d))}}t.addEditOperation(new V(o.startLineNumber,1,o.startLineNumber,1),h+` -`);const g=this.matchEnterRuleMovingDown(e,l,r,o.startLineNumber,u,h);if(g!==null)g!==0&&this.getIndentEditsOfMovingBlock(e,t,o,r,a,g);else{c.getLineContent=v=>v===o.startLineNumber?h:v>=o.startLineNumber+1&&v<=o.endLineNumber+1?e.getLineContent(v-1):e.getLineContent(v);const p=hE(this._autoIndent,c,e.getLanguageIdAtPosition(u,1),o.startLineNumber+1,l,this._languageConfigurationService);if(p!==null){const v=Si(e.getLineContent(o.startLineNumber)),m=Ya(p,r),_=Ya(v,r);if(m!==_){const w=m-_;this.getIndentEditsOfMovingBlock(e,t,o,r,a,w)}}}}else t.addEditOperation(new V(o.startLineNumber,1,o.startLineNumber,1),h+` +`+r),this._selectionId=t.trackSelection(n),this._selectionDirection=this._selection.getDirection()}computeCursorState(e,t){let n=t.getTrackedSelection(this._selectionId);if(this._startLineNumberDelta!==0||this._endLineNumberDelta!==0){let o=n.startLineNumber,r=n.startColumn,s=n.endLineNumber,a=n.endColumn;this._startLineNumberDelta!==0&&(o=o+this._startLineNumberDelta,r=1),this._endLineNumberDelta!==0&&(s=s+this._endLineNumberDelta,a=1),n=gt.createWithDirection(o,r,s,a,this._selectionDirection)}return n}}var gSt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},pSt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let bU=class{constructor(e,t,n,o){this._languageConfigurationService=o,this._selection=e,this._isMovingDown=t,this._autoIndent=n,this._selectionId=null,this._moveEndLineSelectionShrink=!1}getEditOperations(e,t){const n=e.getLineCount();if(this._isMovingDown&&this._selection.endLineNumber===n){this._selectionId=t.trackSelection(this._selection);return}if(!this._isMovingDown&&this._selection.startLineNumber===1){this._selectionId=t.trackSelection(this._selection);return}this._moveEndPositionDown=!1;let o=this._selection;o.startLineNumbere.tokenization.getLineTokens(u),getLanguageId:()=>e.getLanguageId(),getLanguageIdAtPosition:(u,d)=>e.getLanguageIdAtPosition(u,d)},getLineContent:null};if(o.startLineNumber===o.endLineNumber&&e.getLineMaxColumn(o.startLineNumber)===1){const u=o.startLineNumber,d=this._isMovingDown?u+1:u-1;e.getLineMaxColumn(d)===1?t.addEditOperation(new V(1,1,1,1),null):(t.addEditOperation(new V(u,1,u,1),e.getLineContent(d)),t.addEditOperation(new V(d,1,d,e.getLineMaxColumn(d)),null)),o=new gt(d,1,d,1)}else{let u,d;if(this._isMovingDown){u=o.endLineNumber+1,d=e.getLineContent(u),t.addEditOperation(new V(u-1,e.getLineMaxColumn(u-1),u,e.getLineMaxColumn(u)),null);let h=d;if(this.shouldAutoIndent(e,o)){const f=this.matchEnterRule(e,l,r,u,o.startLineNumber-1);if(f!==null){const p=Si(e.getLineContent(u)),v=f+Ya(p,r);h=PE(v,r,a)+this.trimStart(d)}else{c.getLineContent=v=>v===o.startLineNumber?e.getLineContent(u):e.getLineContent(v);const p=fE(this._autoIndent,c,e.getLanguageIdAtPosition(u,1),o.startLineNumber,l,this._languageConfigurationService);if(p!==null){const v=Si(e.getLineContent(u)),m=Ya(p,r),_=Ya(v,r);m!==_&&(h=PE(m,r,a)+this.trimStart(d))}}t.addEditOperation(new V(o.startLineNumber,1,o.startLineNumber,1),h+` +`);const g=this.matchEnterRuleMovingDown(e,l,r,o.startLineNumber,u,h);if(g!==null)g!==0&&this.getIndentEditsOfMovingBlock(e,t,o,r,a,g);else{c.getLineContent=v=>v===o.startLineNumber?h:v>=o.startLineNumber+1&&v<=o.endLineNumber+1?e.getLineContent(v-1):e.getLineContent(v);const p=fE(this._autoIndent,c,e.getLanguageIdAtPosition(u,1),o.startLineNumber+1,l,this._languageConfigurationService);if(p!==null){const v=Si(e.getLineContent(o.startLineNumber)),m=Ya(p,r),_=Ya(v,r);if(m!==_){const y=m-_;this.getIndentEditsOfMovingBlock(e,t,o,r,a,y)}}}}else t.addEditOperation(new V(o.startLineNumber,1,o.startLineNumber,1),h+` `)}else if(u=o.startLineNumber-1,d=e.getLineContent(u),t.addEditOperation(new V(u,1,u+1,1),null),t.addEditOperation(new V(o.endLineNumber,e.getLineMaxColumn(o.endLineNumber),o.endLineNumber,e.getLineMaxColumn(o.endLineNumber)),` -`+d),this.shouldAutoIndent(e,o)){c.getLineContent=f=>f===u?e.getLineContent(o.startLineNumber):e.getLineContent(f);const h=this.matchEnterRule(e,l,r,o.startLineNumber,o.startLineNumber-2);if(h!==null)h!==0&&this.getIndentEditsOfMovingBlock(e,t,o,r,a,h);else{const f=hE(this._autoIndent,c,e.getLanguageIdAtPosition(o.startLineNumber,1),u,l,this._languageConfigurationService);if(f!==null){const g=Si(e.getLineContent(o.startLineNumber)),p=Ya(f,r),v=Ya(g,r);if(p!==v){const m=p-v;this.getIndentEditsOfMovingBlock(e,t,o,r,a,m)}}}}}this._selectionId=t.trackSelection(o)}buildIndentConverter(e,t,n){return{shiftIndent:o=>Lc.shiftIndent(o,o.length+1,e,t,n),unshiftIndent:o=>Lc.unshiftIndent(o,o.length+1,e,t,n)}}parseEnterResult(e,t,n,o,r){if(r){let s=r.indentation;r.indentAction===Ho.None||r.indentAction===Ho.Indent?s=r.indentation+r.appendText:r.indentAction===Ho.IndentOutdent?s=r.indentation:r.indentAction===Ho.Outdent&&(s=t.unshiftIndent(r.indentation)+r.appendText);const a=e.getLineContent(o);if(this.trimStart(a).indexOf(this.trimStart(s))>=0){const l=Si(e.getLineContent(o));let c=Si(s);const u=wbe(e,o,this._languageConfigurationService);u!==null&&u&2&&(c=t.unshiftIndent(c));const d=Ya(c,n),h=Ya(l,n);return d-h}}return null}matchEnterRuleMovingDown(e,t,n,o,r,s){if(Wd(s)>=0){const a=e.getLineMaxColumn(r),l=Lw(this._autoIndent,e,new V(r,a,r,a),this._languageConfigurationService);return this.parseEnterResult(e,t,n,o,l)}else{let a=o-1;for(;a>=1;){const u=e.getLineContent(a);if(Wd(u)>=0)break;a--}if(a<1||o>e.getLineCount())return null;const l=e.getLineMaxColumn(a),c=Lw(this._autoIndent,e,new V(a,l,a,l),this._languageConfigurationService);return this.parseEnterResult(e,t,n,o,c)}}matchEnterRule(e,t,n,o,r,s){let a=r;for(;a>=1;){let u;if(a===r&&s!==void 0?u=s:u=e.getLineContent(a),Wd(u)>=0)break;a--}if(a<1||o>e.getLineCount())return null;const l=e.getLineMaxColumn(a),c=Lw(this._autoIndent,e,new V(a,l,a,l),this._languageConfigurationService);return this.parseEnterResult(e,t,n,o,c)}trimStart(e){return e.replace(/^\s+/,"")}shouldAutoIndent(e,t){if(this._autoIndent<4||!e.tokenization.isCheapToTokenize(t.startLineNumber))return!1;const n=e.getLanguageIdAtPosition(t.startLineNumber,1),o=e.getLanguageIdAtPosition(t.endLineNumber,1);return!(n!==o||this._languageConfigurationService.getLanguageConfiguration(n).indentRulesSupport===null)}getIndentEditsOfMovingBlock(e,t,n,o,r,s){for(let a=n.startLineNumber;a<=n.endLineNumber;a++){const l=e.getLineContent(a),c=Si(l),d=Ya(c,o)+s,h=AE(d,o,r);h!==c&&(t.addEditOperation(new V(a,1,a,c.length+1),h),a===n.endLineNumber&&n.endColumn<=c.length+1&&h===""&&(this._moveEndLineSelectionShrink=!0))}}computeCursorState(e,t){let n=t.getTrackedSelection(this._selectionId);return this._moveEndPositionDown&&(n=n.setEndPosition(n.endLineNumber+1,1)),this._moveEndLineSelectionShrink&&n.startLineNumber=o)return null;const r=[];for(let a=n;a<=o;a++)r.push(i.getLineContent(a));let s=r.slice(0);return s.sort(rv.getCollator().compare),t===!0&&(s=s.reverse()),{startLineNumber:n,endLineNumber:o,before:r,after:s}}function uSt(i,e,t){const n=uSe(i,e,t);return n?Gi.replace(new V(n.startLineNumber,1,n.endLineNumber,i.getLineMaxColumn(n.endLineNumber)),n.after.join(` -`)):null}class dSe extends ft{constructor(e,t){super(t),this.down=e}run(e,t){if(!t.hasModel())return;const n=t.getSelections().map((s,a)=>({selection:s,index:a,ignore:!1}));n.sort((s,a)=>V.compareRangesUsingStarts(s.selection,a.selection));let o=n[0];for(let s=1;snew ae(a.positionLineNumber,a.positionColumn)));const r=t.getSelection();if(r===null)return;const s=new sSt(r,o);t.pushUndoStop(),t.executeCommands(this.id,[s]),t.pushUndoStop()}}VF.ID="editor.action.trimTrailingWhitespace";class bSt extends ft{constructor(){super({id:"editor.action.deleteLines",label:C("lines.delete","Delete Line"),alias:"Delete Line",precondition:Q.writable,kbOpts:{kbExpr:Q.textInputFocus,primary:3113,weight:100}})}run(e,t){if(!t.hasModel())return;const n=this._getLinesToRemove(t),o=t.getModel();if(o.getLineCount()===1&&o.getLineMaxColumn(1)===1)return;let r=0;const s=[],a=[];for(let l=0,c=n.length;l1&&(d-=1,f=o.getLineMaxColumn(d)),s.push(Gi.replace(new gt(d,f,h,g),"")),a.push(new gt(d-r,u.positionColumn,d-r,u.positionColumn)),r+=u.endLineNumber-u.startLineNumber+1}t.pushUndoStop(),t.executeEdits(this.id,s,a),t.pushUndoStop()}_getLinesToRemove(e){const t=e.getSelections().map(r=>{let s=r.endLineNumber;return r.startLineNumberr.startLineNumber===s.startLineNumber?r.endLineNumber-s.endLineNumber:r.startLineNumber-s.startLineNumber);const n=[];let o=t[0];for(let r=1;r=t[r].startLineNumber?o.endLineNumber=t[r].endLineNumber:(n.push(o),o=t[r]);return n.push(o),n}}class CSt extends ft{constructor(){super({id:"editor.action.indentLines",label:C("lines.indent","Indent Line"),alias:"Indent Line",precondition:Q.writable,kbOpts:{kbExpr:Q.editorTextFocus,primary:2142,weight:100}})}run(e,t){const n=t._getViewModel();!n||(t.pushUndoStop(),t.executeCommands(this.id,eo.indent(n.cursorConfig,t.getModel(),t.getSelections())),t.pushUndoStop())}}class wSt extends ft{constructor(){super({id:"editor.action.outdentLines",label:C("lines.outdent","Outdent Line"),alias:"Outdent Line",precondition:Q.writable,kbOpts:{kbExpr:Q.editorTextFocus,primary:2140,weight:100}})}run(e,t){Ew.Outdent.runEditorCommand(e,t,null)}}class ySt extends ft{constructor(){super({id:"editor.action.insertLineBefore",label:C("lines.insertBefore","Insert Line Above"),alias:"Insert Line Above",precondition:Q.writable,kbOpts:{kbExpr:Q.editorTextFocus,primary:3075,weight:100}})}run(e,t){const n=t._getViewModel();!n||(t.pushUndoStop(),t.executeCommands(this.id,eo.lineInsertBefore(n.cursorConfig,t.getModel(),t.getSelections())))}}class SSt extends ft{constructor(){super({id:"editor.action.insertLineAfter",label:C("lines.insertAfter","Insert Line Below"),alias:"Insert Line Below",precondition:Q.writable,kbOpts:{kbExpr:Q.editorTextFocus,primary:2051,weight:100}})}run(e,t){const n=t._getViewModel();!n||(t.pushUndoStop(),t.executeCommands(this.id,eo.lineInsertAfter(n.cursorConfig,t.getModel(),t.getSelections())))}}class gSe extends ft{run(e,t){if(!t.hasModel())return;const n=t.getSelection(),o=this._getRangesToDelete(t),r=[];for(let l=0,c=o.length-1;lGi.replace(l,""));t.pushUndoStop(),t.executeEdits(this.id,a,s),t.pushUndoStop()}}class xSt extends gSe{constructor(){super({id:"deleteAllLeft",label:C("lines.deleteAllLeft","Delete All Left"),alias:"Delete All Left",precondition:Q.writable,kbOpts:{kbExpr:Q.textInputFocus,primary:0,mac:{primary:2049},weight:100}})}_getEndCursorState(e,t){let n=null;const o=[];let r=0;return t.forEach(s=>{let a;if(s.endColumn===1&&r>0){const l=s.startLineNumber-r;a=new gt(l,s.startColumn,l,s.startColumn)}else a=new gt(s.startLineNumber,s.startColumn,s.startLineNumber,s.startColumn);r+=s.endLineNumber-s.startLineNumber,s.intersectRanges(e)?n=a:o.push(a)}),n&&o.unshift(n),o}_getRangesToDelete(e){const t=e.getSelections();if(t===null)return[];let n=t;const o=e.getModel();return o===null?[]:(n.sort(V.compareRangesUsingStarts),n=n.map(r=>{if(r.isEmpty())if(r.startColumn===1){const s=Math.max(1,r.startLineNumber-1),a=r.startLineNumber===1?1:o.getLineLength(s)+1;return new V(s,a,r.startLineNumber,1)}else return new V(r.startLineNumber,1,r.startLineNumber,r.startColumn);else return new V(r.startLineNumber,1,r.endLineNumber,r.endColumn)}),n)}}class LSt extends gSe{constructor(){super({id:"deleteAllRight",label:C("lines.deleteAllRight","Delete All Right"),alias:"Delete All Right",precondition:Q.writable,kbOpts:{kbExpr:Q.textInputFocus,primary:0,mac:{primary:297,secondary:[2068]},weight:100}})}_getEndCursorState(e,t){let n=null;const o=[];for(let r=0,s=t.length,a=0;r{if(r.isEmpty()){const s=t.getLineMaxColumn(r.startLineNumber);return r.startColumn===s?new V(r.startLineNumber,r.startColumn,r.startLineNumber+1,1):new V(r.startLineNumber,r.startColumn,r.startLineNumber,s)}return r});return o.sort(V.compareRangesUsingStarts),o}}class ESt extends ft{constructor(){super({id:"editor.action.joinLines",label:C("lines.joinLines","Join Lines"),alias:"Join Lines",precondition:Q.writable,kbOpts:{kbExpr:Q.editorTextFocus,primary:0,mac:{primary:296},weight:100}})}run(e,t){const n=t.getSelections();if(n===null)return;let o=t.getSelection();if(o===null)return;n.sort(V.compareRangesUsingStarts);const r=[],s=n.reduce((h,f)=>h.isEmpty()?h.endLineNumber===f.startLineNumber?(o.equalsSelection(h)&&(o=f),f):f.startLineNumber>h.endLineNumber+1?(r.push(h),f):new gt(h.startLineNumber,h.startColumn,f.endLineNumber,f.endColumn):f.startLineNumber>h.endLineNumber?(r.push(h),f):new gt(h.startLineNumber,h.startColumn,f.endLineNumber,f.endColumn));r.push(s);const a=t.getModel();if(a===null)return;const l=[],c=[];let u=o,d=0;for(let h=0,f=r.length;h=1){let R=!0;L===""&&(R=!1),R&&(L.charAt(L.length-1)===" "||L.charAt(L.length-1)===" ")&&(R=!1,L=L.replace(/[\s\uFEFF\xA0]+$/g," "));const A=I.substr(k-1);L+=(R?" ":"")+A,R?m=A.length+1:m=A.length}else m=0}const D=new V(p,v,_,w);if(!D.isEmpty()){let E;g.isEmpty()?(l.push(Gi.replace(D,L)),E=new gt(D.startLineNumber-d,L.length-m+1,p-d,L.length-m+1)):g.startLineNumber===g.endLineNumber?(l.push(Gi.replace(D,L)),E=new gt(g.startLineNumber-d,g.startColumn,g.endLineNumber-d,g.endColumn)):(l.push(Gi.replace(D,L)),E=new gt(g.startLineNumber-d,g.startColumn,g.startLineNumber-d,L.length-y)),V.intersectRanges(D,o)!==null?u=E:c.push(E)}d+=D.endLineNumber-D.startLineNumber}c.unshift(u),t.pushUndoStop(),t.executeEdits(this.id,l,c),t.pushUndoStop()}}class DSt extends ft{constructor(){super({id:"editor.action.transpose",label:C("editor.transpose","Transpose Characters around the Cursor"),alias:"Transpose Characters around the Cursor",precondition:Q.writable})}run(e,t){const n=t.getSelections();if(n===null)return;const o=t.getModel();if(o===null)return;const r=[];for(let s=0,a=n.length;s=u){if(c.lineNumber===o.getLineCount())continue;const d=new V(c.lineNumber,Math.max(1,c.column-1),c.lineNumber+1,1),h=o.getValueInRange(d).split("").reverse().join("");r.push(new Qr(new gt(c.lineNumber,Math.max(1,c.column-1),c.lineNumber+1,1),h))}else{const d=new V(c.lineNumber,Math.max(1,c.column-1),c.lineNumber,c.column+1),h=o.getValueInRange(d).split("").reverse().join("");r.push(new EG(d,h,new gt(c.lineNumber,c.column+1,c.lineNumber,c.column+1)))}}t.pushUndoStop(),t.executeCommands(this.id,r),t.pushUndoStop()}}class RS extends ft{run(e,t){const n=t.getSelections();if(n===null)return;const o=t.getModel();if(o===null)return;const r=t.getOption(129),s=[];for(const a of n)if(a.isEmpty()){const l=a.getStartPosition(),c=t.getConfiguredWordAtPosition(l);if(!c)continue;const u=new V(l.lineNumber,c.startColumn,l.lineNumber,c.endColumn),d=o.getValueInRange(u);s.push(Gi.replace(u,this._modifyText(d,r)))}else{const l=o.getValueInRange(a);s.push(Gi.replace(a,this._modifyText(l,r)))}t.pushUndoStop(),t.executeEdits(this.id,s),t.pushUndoStop()}}class kSt extends RS{constructor(){super({id:"editor.action.transformToUppercase",label:C("editor.transformToUppercase","Transform to Uppercase"),alias:"Transform to Uppercase",precondition:Q.writable})}_modifyText(e,t){return e.toLocaleUpperCase()}}class ISt extends RS{constructor(){super({id:"editor.action.transformToLowercase",label:C("editor.transformToLowercase","Transform to Lowercase"),alias:"Transform to Lowercase",precondition:Q.writable})}_modifyText(e,t){return e.toLocaleLowerCase()}}class e1{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}}class Xk extends RS{constructor(){super({id:"editor.action.transformToTitlecase",label:C("editor.transformToTitlecase","Transform to Title Case"),alias:"Transform to Title Case",precondition:Q.writable})}_modifyText(e,t){const n=Xk.titleBoundary.get();return n?e.toLocaleLowerCase().replace(n,o=>o.toLocaleUpperCase()):e}}Xk.titleBoundary=new e1("(^|[^\\p{L}\\p{N}']|((^|\\P{L})'))\\p{L}","gmu");class sv extends RS{constructor(){super({id:"editor.action.transformToSnakecase",label:C("editor.transformToSnakecase","Transform to Snake Case"),alias:"Transform to Snake Case",precondition:Q.writable})}_modifyText(e,t){const n=sv.caseBoundary.get(),o=sv.singleLetters.get();return!n||!o?e:e.replace(n,"$1_$2").replace(o,"$1_$2$3").toLocaleLowerCase()}}sv.caseBoundary=new e1("(\\p{Ll})(\\p{Lu})","gmu");sv.singleLetters=new e1("(\\p{Lu}|\\p{N})(\\p{Lu})(\\p{Ll})","gmu");class Yk extends RS{constructor(){super({id:"editor.action.transformToCamelcase",label:C("editor.transformToCamelcase","Transform to Camel Case"),alias:"Transform to Camel Case",precondition:Q.writable})}_modifyText(e,t){const n=Yk.wordBoundary.get();if(!n)return e;const o=e.split(n);return o.shift()+o.map(s=>s.substring(0,1).toLocaleUpperCase()+s.substring(1)).join("")}}Yk.wordBoundary=new e1("[_\\s-]","gm");class Qg extends RS{static isSupported(){return[this.caseBoundary,this.singleLetters,this.underscoreBoundary].every(t=>t.isSupported())}constructor(){super({id:"editor.action.transformToKebabcase",label:C("editor.transformToKebabcase","Transform to Kebab Case"),alias:"Transform to Kebab Case",precondition:Q.writable})}_modifyText(e,t){const n=Qg.caseBoundary.get(),o=Qg.singleLetters.get(),r=Qg.underscoreBoundary.get();return!n||!o||!r?e:e.replace(r,"$1-$3").replace(n,"$1-$2").replace(o,"$1-$2").toLocaleLowerCase()}}Qg.caseBoundary=new e1("(\\p{Ll})(\\p{Lu})","gmu");Qg.singleLetters=new e1("(\\p{Lu}|\\p{N})(\\p{Lu}\\p{Ll})","gmu");Qg.underscoreBoundary=new e1("(\\S)(_)(\\S)","gm");ze(dSt);ze(hSt);ze(fSt);ze(gSt);ze(pSt);ze(mSt);ze(vSt);ze(_St);ze(VF);ze(bSt);ze(CSt);ze(wSt);ze(ySt);ze(SSt);ze(xSt);ze(LSt);ze(ESt);ze(DSt);ze(kSt);ze(ISt);sv.caseBoundary.isSupported()&&sv.singleLetters.isSupported()&&ze(sv);Yk.wordBoundary.isSupported()&&ze(Yk);Xk.titleBoundary.isSupported()&&ze(Xk);Qg.isSupported()&&ze(Qg);var TSt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},uR=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},mU=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},TM;const pSe=new lt("LinkedEditingInputVisible",!1),NSt="linked-editing-decoration";let Hv=TM=class extends _e{static get(e){return e.getContribution(TM.ID)}constructor(e,t,n,o,r){super(),this.languageConfigurationService=o,this._syncRangesToken=0,this._localToDispose=this._register(new Be),this._editor=e,this._providers=n.linkedEditingRangeProvider,this._enabled=!1,this._visibleContextKey=pSe.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 Be),this._rangeUpdateTriggerPromise=null,this._rangeSyncTriggerPromise=null,this._currentRequest=null,this._currentRequestPosition=null,this._currentRequestModelVersion=null,this._register(this._editor.onDidChangeModel(()=>this.reinitialize(!0))),this._register(this._editor.onDidChangeConfiguration(s=>{(s.hasChanged(69)||s.hasChanged(92))&&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(),n=t!==null&&(this._editor.getOption(69)||this._editor.getOption(92))&&this._providers.has(t);if(n===this._enabled&&!e||(this._enabled=n,this.clearRanges(),this._localToDispose.clear(),!n||t===null))return;this._localToDispose.add(st.runAndSubscribe(t.onDidChangeLanguageConfiguration,()=>{this._languageWordPattern=this.languageConfigurationService.getLanguageConfiguration(t.getLanguageId()).getWordDefinition()}));const o=new Bu(this._debounceInformation.get(t)),r=()=>{var l;this._rangeUpdateTriggerPromise=o.trigger(()=>this.updateRanges(),(l=this._debounceDuration)!==null&&l!==void 0?l:this._debounceInformation.get(t))},s=new Bu(0),a=l=>{this._rangeSyncTriggerPromise=s.trigger(()=>this._syncRanges(l))};this._localToDispose.add(this._editor.onDidChangeCursorPosition(()=>{r()})),this._localToDispose.add(this._editor.onDidChangeModelContent(l=>{if(!this._ignoreChangeEvent&&this._currentDecorations.length>0){const c=this._currentDecorations.getRange(0);if(c&&l.changes.every(u=>c.intersectRanges(u.range))){a(this._syncRangesToken);return}}r()})),this._localToDispose.add({dispose:()=>{o.dispose(),s.dispose()}}),this.updateRanges()}_syncRanges(e){if(!this._editor.hasModel()||e!==this._syncRangesToken||this._currentDecorations.length===0)return;const t=this._editor.getModel(),n=this._currentDecorations.getRange(0);if(!n||n.startLineNumber!==n.endLineNumber)return this.clearRanges();const o=t.getValueInRange(n);if(this._currentWordPattern){const s=o.match(this._currentWordPattern);if((s?s[0].length:0)!==o.length)return this.clearRanges()}const r=[];for(let s=1,a=this._currentDecorations.length;s1){this.clearRanges();return}const n=this._editor.getModel(),o=n.getVersionId();if(this._currentRequestPosition&&this._currentRequestModelVersion===o){if(t.equals(this._currentRequestPosition))return;if(this._currentDecorations.length>0){const s=this._currentDecorations.getRange(0);if(s&&s.containsPosition(t))return}}this.clearRanges(),this._currentRequestPosition=t,this._currentRequestModelVersion=o;const r=sr(s=>mU(this,void 0,void 0,function*(){try{const a=new xs(!1),l=yield mSe(this._providers,n,t,s);if(this._debounceInformation.update(n,a.elapsed()),r!==this._currentRequest||(this._currentRequest=null,o!==n.getVersionId()))return;let c=[];l!=null&&l.ranges&&(c=l.ranges),this._currentWordPattern=(l==null?void 0:l.wordPattern)||this._languageWordPattern;let u=!1;for(let h=0,f=c.length;h({range:h,options:TM.DECORATION}));this._visibleContextKey.set(!0),this._currentDecorations.set(d),this._syncRangesToken++}catch(a){oh(a)||en(a),(this._currentRequest===r||!this._currentRequest)&&this.clearRanges()}}));return this._currentRequest=r,r})}};Hv.ID="editor.contrib.linkedEditing";Hv.DECORATION=Jt.register({description:"linked-editing",stickiness:0,className:NSt});Hv=TM=TSt([uR(1,Ut),uR(2,pt),uR(3,Ti),uR(4,Kc)],Hv);class RSt extends ft{constructor(){super({id:"editor.action.linkedEditing",label:C("linkedEditing.label","Start Linked Editing"),alias:"Start Linked Editing",precondition:Me.and(Q.writable,Q.hasRenameProvider),kbOpts:{kbExpr:Q.editorTextFocus,primary:3132,weight:100}})}runCommand(e,t){const n=e.get(Jn),[o,r]=Array.isArray(t)&&t||[void 0,void 0];return Rt.isUri(o)&&ae.isIPosition(r)?n.openCodeEditor({resource:o},n.getActiveCodeEditor()).then(s=>{!s||(s.setPosition(r),s.invokeWithinContext(a=>(this.reportTelemetry(a,s),this.run(a,s))))},en):super.runCommand(e,t)}run(e,t){const n=Hv.get(t);return n?Promise.resolve(n.updateRanges(!0)):Promise.resolve()}}const MSt=Ir.bindToContribution(Hv.get);Ye(new MSt({id:"cancelLinkedEditingInput",precondition:pSe,handler:i=>i.clearRanges(),kbOpts:{kbExpr:Q.editorTextFocus,weight:100+99,primary:9,secondary:[1033]}}));function mSe(i,e,t,n){const o=i.ordered(e);return v0e(o.map(r=>()=>mU(this,void 0,void 0,function*(){try{return yield r.provideLinkedEditingRanges(e,t,n)}catch(s){$o(s);return}})),r=>!!r&&ws(r==null?void 0:r.ranges))}J("editor.linkedEditingBackground",{dark:ve.fromHex("#f00").transparent(.3),light:ve.fromHex("#f00").transparent(.3),hcDark:ve.fromHex("#f00").transparent(.3),hcLight:ve.white},C("editorLinkedEditingBackground","Background color when the editor auto renames on type."));Nf("_executeLinkedEditingProvider",(i,e,t)=>{const{linkedEditingRangeProvider:n}=i.get(pt);return mSe(n,e,t,_n.None)});zn(Hv.ID,Hv,1);ze(RSt);var vSe=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};class ASt{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}resolve(e){return vSe(this,void 0,void 0,function*(){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 DO{constructor(e){this._disposables=new Be;let t=[];for(const[n,o]of e){const r=n.links.map(s=>new ASt(s,o));t=DO._union(t,r),Rq(n)&&this._disposables.add(n)}this.links=t}dispose(){this._disposables.dispose(),this.links.length=0}static _union(e,t){const n=[];let o,r,s,a;for(o=0,s=0,r=e.length,a=t.length;oPromise.resolve(r.provideLinks(e,t)).then(a=>{a&&(n[s]=[a,r])},$o));return Promise.all(o).then(()=>{const r=new DO(df(n));return t.isCancellationRequested?(r.dispose(),new DO([])):r})}Rn.registerCommand("_executeLinkProvider",(i,...e)=>vSe(void 0,void 0,void 0,function*(){let[t,n]=e;fi(t instanceof Rt),typeof n!="number"&&(n=0);const{linkProvider:o}=i.get(pt),r=i.get(Yi).getModel(t);if(!r)return[];const s=yield _Se(o,r,_n.None);if(!s)return[];for(let l=0;l=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},dR=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},OSt=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},vU;let Xy=vU=class extends _e{static get(e){return e.getContribution(vU.ID)}constructor(e,t,n,o,r){super(),this.editor=e,this.openerService=t,this.notificationService=n,this.languageFeaturesService=o,this.providers=this.languageFeaturesService.linkProvider,this.debounceInformation=r.for(this.providers,"Links",{min:1e3,max:4e3}),this.computeLinks=this._register(new bi(()=>this.computeLinksNow(),1e3)),this.computePromise=null,this.activeLinksList=null,this.currentOccurrences={},this.activeLinkDecorationId=null;const s=this._register(new lF(e));this._register(s.onMouseMoveOrRelevantKeyDown(([a,l])=>{this._onEditorMouseMove(a,l)})),this._register(s.onExecute(a=>{this.onEditorMouseUp(a)})),this._register(s.onCancel(a=>{this.cleanUpActiveLinkDecoration()})),this._register(e.onDidChangeConfiguration(a=>{!a.hasChanged(70)||(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)}computeLinksNow(){return OSt(this,void 0,void 0,function*(){if(!this.editor.hasModel()||!this.editor.getOption(70))return;const e=this.editor.getModel();if(!e.isTooLargeForSyncing()&&!!this.providers.has(e)){this.activeLinksList&&(this.activeLinksList.dispose(),this.activeLinksList=null),this.computePromise=sr(t=>_Se(this.providers,e,t));try{const t=new xs(!1);if(this.activeLinksList=yield this.computePromise,this.debounceInformation.update(e,t.elapsed()),e.isDisposed())return;this.updateDecorations(this.activeLinksList.links)}catch(t){en(t)}finally{this.computePromise=null}}})}updateDecorations(e){const t=this.editor.getOption(77)==="altKey",n=[],o=Object.keys(this.currentOccurrences);for(const s of o){const a=this.currentOccurrences[s];n.push(a.decorationId)}const r=[];if(e)for(const s of e)r.push(Ww.decoration(s,t));this.editor.changeDecorations(s=>{const a=s.deltaDecorations(n,r);this.currentOccurrences={},this.activeLinkDecorationId=null;for(let l=0,c=a.length;l{o.activate(r,n),this.activeLinkDecorationId=o.decorationId})}else this.cleanUpActiveLinkDecoration()}cleanUpActiveLinkDecoration(){const e=this.editor.getOption(77)==="altKey";if(this.activeLinkDecorationId){const t=this.currentOccurrences[this.activeLinkDecorationId];t&&this.editor.changeDecorations(n=>{t.deactivate(n,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,n=!1){if(!this.openerService)return;const{link:o}=e;o.resolve(_n.None).then(r=>{if(typeof r=="string"&&this.editor.hasModel()){const s=this.editor.getModel().uri;if(s.scheme===hn.file&&r.startsWith(`${hn.file}:`)){const a=Rt.parse(r);if(a.scheme===hn.file){const l=bh(a);let c=null;l.startsWith("/./")?c=`.${l.substr(1)}`:l.startsWith("//./")&&(c=`.${l.substr(2)}`),c&&(r=Pst(s,c))}}}return this.openerService.open(r,{openToSide:t,fromUserGesture:n,allowContributedOpeners:!0,allowCommands:!0,fromWorkspace:!0})},r=>{const s=r instanceof Error?r.message:r;s==="invalid"?this.notificationService.warn(C("invalid.url","Failed to open this link because it is not well-formed: {0}",o.url.toString())):s==="missing"?this.notificationService.warn(C("missing.url","Failed to open this link because its target is missing.")):en(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 n of t){const o=this.currentOccurrences[n.id];if(o)return o}return null}isEnabled(e,t){return Boolean(e.target.type===6&&(e.hasTriggerModifier||t&&t.keyCodeIsTriggerKey))}stop(){var e;this.computeLinks.cancel(),this.activeLinksList&&((e=this.activeLinksList)===null||e===void 0||e.dispose(),this.activeLinksList=null),this.computePromise&&(this.computePromise.cancel(),this.computePromise=null)}dispose(){super.dispose(),this.stop()}};Xy.ID="editor.linkDetector";Xy=vU=PSt([dR(1,pl),dR(2,Ao),dR(3,pt),dR(4,Kc)],Xy);const Mce={general:Jt.register({description:"detected-link",stickiness:1,collapseOnReplaceEdit:!0,inlineClassName:"detected-link"}),active:Jt.register({description:"detected-link-active",stickiness:1,collapseOnReplaceEdit:!0,inlineClassName:"detected-link-active"})};class Ww{static decoration(e,t){return{range:e.range,options:Ww._getOptions(e,t,!1)}}static _getOptions(e,t,n){const o=Object.assign({},n?Mce.active:Mce.general);return o.hoverMessage=FSt(e,t),o}constructor(e,t){this.link=e,this.decorationId=t}activate(e,t){e.changeDecorationOptions(this.decorationId,Ww._getOptions(this.link,t,!0))}deactivate(e,t){e.changeDecorationOptions(this.decorationId,Ww._getOptions(this.link,t,!1))}}function FSt(i,e){const t=i.url&&/^command:/i.test(i.url.toString()),n=i.tooltip?i.tooltip:t?C("links.navigate.executeCmd","Execute command"):C("links.navigate.follow","Follow link"),o=e?Nn?C("links.navigate.kb.meta.mac","cmd + click"):C("links.navigate.kb.meta","ctrl + click"):Nn?C("links.navigate.kb.alt.mac","option + click"):C("links.navigate.kb.alt","alt + click");if(i.url){let r="";if(/^command:/i.test(i.url.toString())){const a=i.url.toString().match(/^command:([^?#]+)/);if(a){const l=a[1];r=C("tooltip.explanation","Execute command {0}",l)}}return new is("",!0).appendLink(i.url.toString(!0).replace(/ /g,"%20"),n,r).appendMarkdown(` (${o})`)}else return new is().appendText(`${n} (${o})`)}class BSt extends ft{constructor(){super({id:"editor.action.openLink",label:C("label","Open Link"),alias:"Open Link",precondition:void 0})}run(e,t){const n=Xy.get(t);if(!n||!t.hasModel())return;const o=t.getSelections();for(const r of o){const s=n.getLinkOccurrence(r.getEndPosition());s&&n.openLinkOccurrence(s,!1)}}}zn(Xy.ID,Xy,1);ze(BSt);class _U extends _e{constructor(e){super(),this._editor=e,this._register(this._editor.onMouseDown(t=>{const n=this._editor.getOption(116);n>=0&&t.target.type===6&&t.target.position.column>=n&&this._editor.updateOptions({stopRenderingLineAfter:-1})}))}}_U.ID="editor.contrib.longLinesHelper";zn(_U.ID,_U,2);const hR=J("editor.wordHighlightBackground",{dark:"#575757B8",light:"#57575740",hcDark:null,hcLight:null},C("wordHighlight","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);J("editor.wordHighlightStrongBackground",{dark:"#004972B8",light:"#0e639c40",hcDark:null,hcLight:null},C("wordHighlightStrong","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);J("editor.wordHighlightTextBackground",{light:hR,dark:hR,hcDark:hR,hcLight:hR},C("wordHighlightText","Background color of a textual occurrence for a symbol. The color must not be opaque so as not to hide underlying decorations."),!0);const fR=J("editor.wordHighlightBorder",{light:null,dark:null,hcDark:Wi,hcLight:Wi},C("wordHighlightBorder","Border color of a symbol during read-access, like reading a variable."));J("editor.wordHighlightStrongBorder",{light:null,dark:null,hcDark:Wi,hcLight:Wi},C("wordHighlightStrongBorder","Border color of a symbol during write-access, like writing to a variable."));J("editor.wordHighlightTextBorder",{light:fR,dark:fR,hcDark:fR,hcLight:fR},C("wordHighlightTextBorder","Border color of a textual occurrence for a symbol."));const WSt=J("editorOverviewRuler.wordHighlightForeground",{dark:"#A0A0A0CC",light:"#A0A0A0CC",hcDark:"#A0A0A0CC",hcLight:"#A0A0A0CC"},C("overviewRulerWordHighlightForeground","Overview ruler marker color for symbol highlights. The color must not be opaque so as not to hide underlying decorations."),!0),VSt=J("editorOverviewRuler.wordHighlightStrongForeground",{dark:"#C0A0C0CC",light:"#C0A0C0CC",hcDark:"#C0A0C0CC",hcLight:"#C0A0C0CC"},C("overviewRulerWordHighlightStrongForeground","Overview ruler marker color for write-access symbol highlights. The color must not be opaque so as not to hide underlying decorations."),!0),HSt=J("editorOverviewRuler.wordHighlightTextForeground",{dark:xL,light:xL,hcDark:xL,hcLight:xL},C("overviewRulerWordHighlightTextForeground","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),$St=Jt.register({description:"word-highlight-strong",stickiness:1,className:"wordHighlightStrong",overviewRuler:{color:ro(VSt),position:Xl.Center},minimap:{color:ro(f5),position:al.Inline}}),zSt=Jt.register({description:"word-highlight-text",stickiness:1,className:"wordHighlightText",overviewRuler:{color:ro(HSt),position:Xl.Center},minimap:{color:ro(f5),position:al.Inline}}),USt=Jt.register({description:"selection-highlight-overview",stickiness:1,className:"selectionHighlight",overviewRuler:{color:ro(xL),position:Xl.Center},minimap:{color:ro(f5),position:al.Inline}}),jSt=Jt.register({description:"selection-highlight",stickiness:1,className:"selectionHighlight"}),KSt=Jt.register({description:"word-highlight",stickiness:1,className:"wordHighlight",overviewRuler:{color:ro(WSt),position:Xl.Center},minimap:{color:ro(f5),position:al.Inline}});function qSt(i){return i===ND.Write?$St:i===ND.Text?zSt:KSt}function GSt(i){return i?jSt:USt}Uu((i,e)=>{const t=i.getColor(vG);t&&e.addRule(`.monaco-editor .selectionHighlight { background-color: ${t.transparent(.5)}; }`)});var XSt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},YSt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},bU;function n_(i,e){const t=e.filter(n=>!i.find(o=>o.equals(n)));if(t.length>=1){const n=t.map(r=>`line ${r.viewState.position.lineNumber} column ${r.viewState.position.column}`).join(", "),o=t.length===1?C("cursorAdded","Cursor added: {0}",n):C("cursorsAdded","Cursors added: {0}",n);Lv(o)}}class ZSt extends ft{constructor(){super({id:"editor.action.insertCursorAbove",label:C("mutlicursor.insertAbove","Add Cursor Above"),alias:"Add Cursor Above",precondition:void 0,kbOpts:{kbExpr:Q.editorTextFocus,primary:2576,linux:{primary:1552,secondary:[3088]},weight:100},menuOpts:{menuId:Z.MenubarSelectionMenu,group:"3_multi",title:C({key:"miInsertCursorAbove",comment:["&& denotes a mnemonic"]},"&&Add Cursor Above"),order:2}})}run(e,t,n){if(!t.hasModel())return;let o=!0;n&&n.logicalLine===!1&&(o=!1);const r=t._getViewModel();if(r.cursorConfig.readOnly)return;r.model.pushStackElement();const s=r.getCursorStates();r.setCursorStates(n.source,3,Mr.addCursorUp(r,s,o)),r.revealTopMostCursor(n.source),n_(s,r.getCursorStates())}}class QSt extends ft{constructor(){super({id:"editor.action.insertCursorBelow",label:C("mutlicursor.insertBelow","Add Cursor Below"),alias:"Add Cursor Below",precondition:void 0,kbOpts:{kbExpr:Q.editorTextFocus,primary:2578,linux:{primary:1554,secondary:[3090]},weight:100},menuOpts:{menuId:Z.MenubarSelectionMenu,group:"3_multi",title:C({key:"miInsertCursorBelow",comment:["&& denotes a mnemonic"]},"A&&dd Cursor Below"),order:3}})}run(e,t,n){if(!t.hasModel())return;let o=!0;n&&n.logicalLine===!1&&(o=!1);const r=t._getViewModel();if(r.cursorConfig.readOnly)return;r.model.pushStackElement();const s=r.getCursorStates();r.setCursorStates(n.source,3,Mr.addCursorDown(r,s,o)),r.revealBottomMostCursor(n.source),n_(s,r.getCursorStates())}}class JSt extends ft{constructor(){super({id:"editor.action.insertCursorAtEndOfEachLineSelected",label:C("mutlicursor.insertAtEndOfEachLineSelected","Add Cursors to Line Ends"),alias:"Add Cursors to Line Ends",precondition:void 0,kbOpts:{kbExpr:Q.editorTextFocus,primary:1575,weight:100},menuOpts:{menuId:Z.MenubarSelectionMenu,group:"3_multi",title:C({key:"miInsertCursorAtEndOfEachLineSelected",comment:["&& denotes a mnemonic"]},"Add C&&ursors to Line Ends"),order:4}})}getCursorsForSelection(e,t,n){if(!e.isEmpty()){for(let o=e.startLineNumber;o1&&n.push(new gt(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn))}}run(e,t){if(!t.hasModel())return;const n=t.getModel(),o=t.getSelections(),r=t._getViewModel(),s=r.getCursorStates(),a=[];o.forEach(l=>this.getCursorsForSelection(l,n,a)),a.length>0&&t.setSelections(a),n_(s,r.getCursorStates())}}class ext extends ft{constructor(){super({id:"editor.action.addCursorsToBottom",label:C("mutlicursor.addCursorsToBottom","Add Cursors To Bottom"),alias:"Add Cursors To Bottom",precondition:void 0})}run(e,t){if(!t.hasModel())return;const n=t.getSelections(),o=t.getModel().getLineCount(),r=[];for(let l=n[0].startLineNumber;l<=o;l++)r.push(new gt(l,n[0].startColumn,l,n[0].endColumn));const s=t._getViewModel(),a=s.getCursorStates();r.length>0&&t.setSelections(r),n_(a,s.getCursorStates())}}class txt extends ft{constructor(){super({id:"editor.action.addCursorsToTop",label:C("mutlicursor.addCursorsToTop","Add Cursors To Top"),alias:"Add Cursors To Top",precondition:void 0})}run(e,t){if(!t.hasModel())return;const n=t.getSelections(),o=[];for(let a=n[0].startLineNumber;a>=1;a--)o.push(new gt(a,n[0].startColumn,a,n[0].endColumn));const r=t._getViewModel(),s=r.getCursorStates();o.length>0&&t.setSelections(o),n_(s,r.getCursorStates())}}class gR{constructor(e,t,n){this.selections=e,this.revealRange=t,this.revealScrollType=n}}class Zk{static create(e,t){if(!e.hasModel())return null;const n=t.getState();if(!e.hasTextFocus()&&n.isRevealed&&n.searchString.length>0)return new Zk(e,t,!1,n.searchString,n.wholeWord,n.matchCase,null);let o=!1,r,s;const a=e.getSelections();a.length===1&&a[0].isEmpty()?(o=!0,r=!0,s=!0):(r=n.wholeWord,s=n.matchCase);const l=e.getSelection();let c,u=null;if(l.isEmpty()){const d=e.getConfiguredWordAtPosition(l.getStartPosition());if(!d)return null;c=d.word,u=new gt(l.startLineNumber,d.startColumn,l.startLineNumber,d.endColumn)}else c=e.getModel().getValueInRange(l).replace(/\r\n/g,` -`);return new Zk(e,t,o,c,r,s,u)}constructor(e,t,n,o,r,s,a){this._editor=e,this.findController=t,this.isDisconnectedFromFindController=n,this.searchText=o,this.wholeWord=r,this.matchCase=s,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 gR(t.concat(e),e,0)}moveSelectionToNextFindMatch(){if(!this._editor.hasModel())return null;const e=this._getNextMatch();if(!e)return null;const t=this._editor.getSelections();return new gR(t.slice(0,t.length-1).concat(e),e,0)}_getNextMatch(){if(!this._editor.hasModel())return null;if(this.currentMatch){const o=this.currentMatch;return this.currentMatch=null,o}this.findController.highlightFindOptions();const e=this._editor.getSelections(),t=e[e.length-1],n=this._editor.getModel().findNextMatch(this.searchText,t.getEndPosition(),!1,this.matchCase,this.wholeWord?this._editor.getOption(129):null,!1);return n?new gt(n.range.startLineNumber,n.range.startColumn,n.range.endLineNumber,n.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 gR(t.concat(e),e,0)}moveSelectionToPreviousFindMatch(){if(!this._editor.hasModel())return null;const e=this._getPreviousMatch();if(!e)return null;const t=this._editor.getSelections();return new gR(t.slice(0,t.length-1).concat(e),e,0)}_getPreviousMatch(){if(!this._editor.hasModel())return null;if(this.currentMatch){const o=this.currentMatch;return this.currentMatch=null,o}this.findController.highlightFindOptions();const e=this._editor.getSelections(),t=e[e.length-1],n=this._editor.getModel().findPreviousMatch(this.searchText,t.getStartPosition(),!1,this.matchCase,this.wholeWord?this._editor.getOption(129):null,!1);return n?new gt(n.range.startLineNumber,n.range.startColumn,n.range.endLineNumber,n.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(129):null,!1,1073741824):t.findMatches(this.searchText,!0,!1,this.matchCase,this.wholeWord?this._editor.getOption(129):null,!1,1073741824)}}class wb extends _e{static get(e){return e.getContribution(wb.ID)}constructor(e){super(),this._sessionDispose=this._register(new Be),this._editor=e,this._ignoreSelectionChange=!1,this._session=null}dispose(){this._endSession(),super.dispose()}_beginSessionIfNeeded(e){if(!this._session){const t=Zk.create(this._editor,e);if(!t)return;this._session=t;const n={searchString:this._session.searchText};this._session.isDisconnectedFromFindController&&(n.wholeWordOverride=1,n.matchCaseOverride=1,n.isRegexOverride=2),e.getState().change(n,!1),this._sessionDispose.add(this._editor.onDidChangeCursorSelection(o=>{this._ignoreSelectionChange||this._endSession()})),this._sessionDispose.add(this._editor.onDidBlurEditorText(()=>{this._endSession()})),this._sessionDispose.add(e.getState().onFindReplaceStateChange(o=>{(o.matchCase||o.wholeWord)&&this._endSession()}))}}_endSession(){if(this._sessionDispose.clear(),this._session&&this._session.isDisconnectedFromFindController){const e={wholeWordOverride:0,matchCaseOverride:0,isRegexOverride:0};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 n=this._editor.getConfiguredWordAtPosition(t.getStartPosition());return n?new gt(t.startLineNumber,n.startColumn,t.startLineNumber,n.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 o=e.getState().matchCase;if(!bSe(this._editor.getModel(),t,o)){const s=this._editor.getModel(),a=[];for(let l=0,c=t.length;l0&&n.isRegex){const o=this._editor.getModel();n.searchScope?t=o.findMatches(n.searchString,n.searchScope,n.isRegex,n.matchCase,n.wholeWord?this._editor.getOption(129):null,!1,1073741824):t=o.findMatches(n.searchString,!0,n.isRegex,n.matchCase,n.wholeWord?this._editor.getOption(129):null,!1,1073741824)}else{if(this._beginSessionIfNeeded(e),!this._session)return;t=this._session.selectAll(n.searchScope)}if(t.length>0){const o=this._editor.getSelection();for(let r=0,s=t.length;rnew gt(r.range.startLineNumber,r.range.startColumn,r.range.endLineNumber,r.range.endColumn)))}}}wb.ID="editor.contrib.multiCursorController";class MS extends ft{run(e,t){const n=wb.get(t);if(!n)return;const o=t._getViewModel();if(o){const r=o.getCursorStates(),s=da.get(t);if(s)this._run(n,s);else{const a=e.get($t).createInstance(da,t);this._run(n,a),a.dispose()}n_(r,o.getCursorStates())}}}class nxt extends MS{constructor(){super({id:"editor.action.addSelectionToNextFindMatch",label:C("addSelectionToNextFindMatch","Add Selection To Next Find Match"),alias:"Add Selection To Next Find Match",precondition:void 0,kbOpts:{kbExpr:Q.focus,primary:2082,weight:100},menuOpts:{menuId:Z.MenubarSelectionMenu,group:"3_multi",title:C({key:"miAddSelectionToNextFindMatch",comment:["&& denotes a mnemonic"]},"Add &&Next Occurrence"),order:5}})}_run(e,t){e.addSelectionToNextFindMatch(t)}}class ixt extends MS{constructor(){super({id:"editor.action.addSelectionToPreviousFindMatch",label:C("addSelectionToPreviousFindMatch","Add Selection To Previous Find Match"),alias:"Add Selection To Previous Find Match",precondition:void 0,menuOpts:{menuId:Z.MenubarSelectionMenu,group:"3_multi",title:C({key:"miAddSelectionToPreviousFindMatch",comment:["&& denotes a mnemonic"]},"Add P&&revious Occurrence"),order:6}})}_run(e,t){e.addSelectionToPreviousFindMatch(t)}}class oxt extends MS{constructor(){super({id:"editor.action.moveSelectionToNextFindMatch",label:C("moveSelectionToNextFindMatch","Move Last Selection To Next Find Match"),alias:"Move Last Selection To Next Find Match",precondition:void 0,kbOpts:{kbExpr:Q.focus,primary:Zo(2089,2082),weight:100}})}_run(e,t){e.moveSelectionToNextFindMatch(t)}}class rxt extends MS{constructor(){super({id:"editor.action.moveSelectionToPreviousFindMatch",label:C("moveSelectionToPreviousFindMatch","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 sxt extends MS{constructor(){super({id:"editor.action.selectHighlights",label:C("selectAllOccurrencesOfFindMatch","Select All Occurrences of Find Match"),alias:"Select All Occurrences of Find Match",precondition:void 0,kbOpts:{kbExpr:Q.focus,primary:3114,weight:100},menuOpts:{menuId:Z.MenubarSelectionMenu,group:"3_multi",title:C({key:"miSelectHighlights",comment:["&& denotes a mnemonic"]},"Select All &&Occurrences"),order:7}})}_run(e,t){e.selectAll(t)}}class axt extends MS{constructor(){super({id:"editor.action.changeAll",label:C("changeAll.label","Change All Occurrences"),alias:"Change All Occurrences",precondition:Me.and(Q.writable,Q.editorTextFocus),kbOpts:{kbExpr:Q.editorTextFocus,primary:2108,weight:100},contextMenuOpts:{group:"1_modification",order:1.2}})}_run(e,t){e.selectAll(t)}}class lxt{constructor(e,t,n,o,r){this._model=e,this._searchText=t,this._matchCase=n,this._wordSeparators=o,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(V.compareRangesUsingStarts)),this._cachedFindMatches}}let Qk=bU=class extends _e{constructor(e,t){super(),this._languageFeaturesService=t,this.editor=e,this._isEnabled=e.getOption(107),this._decorations=e.createDecorationsCollection(),this.updateSoon=this._register(new bi(()=>this._update(),300)),this.state=null,this._register(e.onDidChangeConfiguration(o=>{this._isEnabled=e.getOption(107)})),this._register(e.onDidChangeCursorSelection(o=>{!this._isEnabled||(o.selection.isEmpty()?o.reason===3?(this.state&&this._setState(null),this.updateSoon.schedule()):this._setState(null):this._update())})),this._register(e.onDidChangeModel(o=>{this._setState(null)})),this._register(e.onDidChangeModelContent(o=>{this._isEnabled&&this.updateSoon.schedule()}));const n=da.get(e);n&&this._register(n.getState().onFindReplaceStateChange(o=>{this._update()})),this.updateSoon.schedule()}_update(){this._setState(bU._createState(this.state,this._isEnabled,this.editor))}static _createState(e,t,n){if(!t||!n.hasModel())return null;const o=n.getSelection();if(o.startLineNumber!==o.endLineNumber)return null;const r=wb.get(n);if(!r)return null;const s=da.get(n);if(!s)return null;let a=r.getSession(s);if(!a){const u=n.getSelections();if(u.length>1){const h=s.getState().matchCase;if(!bSe(n.getModel(),u,h))return null}a=Zk.create(n,s)}if(!a||a.currentMatch||/^[ \t]+$/.test(a.searchText)||a.searchText.length>200)return null;const l=s.getState(),c=l.matchCase;if(l.isRevealed){let u=l.searchString;c||(u=u.toLowerCase());let d=a.searchText;if(c||(d=d.toLowerCase()),u===d&&a.matchCase===l.matchCase&&a.wholeWord===l.wholeWord&&!l.isRegex)return null}return new lxt(n.getModel(),a.searchText,a.matchCase,a.wholeWord?n.getOption(129):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 n=this.state.findMatches(),o=this.editor.getSelections();o.sort(V.compareRangesUsingStarts);const r=[];for(let l=0,c=0,u=n.length,d=o.length;l=d)r.push(h),l++;else{const f=V.compareRangesUsingStarts(h,o[c]);f<0?((o[c].isEmpty()||!V.areIntersecting(h,o[c]))&&r.push(h),l++):(f>0||l++,c++)}}const s=this._languageFeaturesService.documentHighlightProvider.has(t)&&this.editor.getOption(80),a=r.map(l=>({range:l,options:GSt(s)}));this._decorations.set(a)}dispose(){this._setState(null),super.dispose()}};Qk.ID="editor.contrib.selectionHighlighter";Qk=bU=XSt([YSt(1,pt)],Qk);function bSe(i,e,t){const n=Ace(i,e[0],!t);for(let o=1,r=e.length;oCSe(void 0,void 0,void 0,function*(){const[t,n,o]=e;fi(Rt.isUri(t)),fi(ae.isIPosition(n)),fi(typeof o=="string"||!o);const r=i.get(pt),s=yield i.get($a).createModelReference(t);try{const a=yield wSe(r.signatureHelpProvider,s.object.textEditorModel,ae.lift(n),{triggerKind:sf.Invoke,isRetrigger:!1,triggerCharacter:o},_n.None);return a?(setTimeout(()=>a.dispose(),0),a.value):void 0}finally{s.dispose()}}));var dxt=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},im;(function(i){i.Default={type:0};class e{constructor(o,r){this.request=o,this.previouslyActiveHints=r,this.type=2}}i.Pending=e;class t{constructor(o){this.hints=o,this.type=1}}i.Active=t})(im||(im={}));class HF extends _e{constructor(e,t,n=HF.DEFAULT_DELAY){super(),this._onChangedHints=this._register(new le),this.onChangedHints=this._onChangedHints.event,this.triggerOnType=!1,this._state=im.Default,this._pendingTriggers=[],this._lastSignatureHelpResult=this._register(new Kr),this.triggerChars=new XA,this.retriggerChars=new XA,this.triggerId=0,this.editor=e,this.providers=t,this.throttledDelayer=new Bu(n),this._register(this.editor.onDidBlurEditorWidget(()=>this.cancel())),this._register(this.editor.onDidChangeConfiguration(()=>this.onEditorConfigurationChange())),this._register(this.editor.onDidChangeModel(o=>this.onModelChanged())),this._register(this.editor.onDidChangeModelLanguage(o=>this.onModelChanged())),this._register(this.editor.onDidChangeCursorSelection(o=>this.onCursorChange(o))),this._register(this.editor.onDidChangeModelContent(o=>this.onModelContentChange())),this._register(this.providers.onDidChange(this.onModelChanged,this)),this._register(this.editor.onDidType(o=>this.onDidType(o))),this.onEditorConfigurationChange(),this.onModelChanged()}get state(){return this._state}set state(e){this._state.type===2&&this._state.request.cancel(),this._state=e}cancel(e=!1){this.state=im.Default,this.throttledDelayer.cancel(),e||this._onChangedHints.fire(void 0)}trigger(e,t){const n=this.editor.getModel();if(!n||!this.providers.has(n))return;const o=++this.triggerId;this._pendingTriggers.push(e),this.throttledDelayer.trigger(()=>this.doTrigger(o),t).catch(en)}next(){if(this.state.type!==1)return;const e=this.state.hints.signatures.length,t=this.state.hints.activeSignature,n=t%e===e-1,o=this.editor.getOption(85).cycle;if((e<2||n)&&!o){this.cancel();return}this.updateActiveSignature(n&&o?0:t+1)}previous(){if(this.state.type!==1)return;const e=this.state.hints.signatures.length,t=this.state.hints.activeSignature,n=t===0,o=this.editor.getOption(85).cycle;if((e<2||n)&&!o){this.cancel();return}this.updateActiveSignature(n&&o?e-1:t-1)}updateActiveSignature(e){this.state.type===1&&(this.state=new im.Active(Object.assign(Object.assign({},this.state.hints),{activeSignature:e})),this._onChangedHints.fire(this.state.hints))}doTrigger(e){return dxt(this,void 0,void 0,function*(){const t=this.state.type===1||this.state.type===2,n=this.getLastActiveHints();if(this.cancel(!0),this._pendingTriggers.length===0)return!1;const o=this._pendingTriggers.reduce(hxt);this._pendingTriggers=[];const r={triggerKind:o.triggerKind,triggerCharacter:o.triggerCharacter,isRetrigger:t,activeSignatureHelp:n};if(!this.editor.hasModel())return!1;const s=this.editor.getModel(),a=this.editor.getPosition();this.state=new im.Pending(sr(l=>wSe(this.providers,s,a,r,l)),n);try{const l=yield this.state.request;return e!==this.triggerId?(l==null||l.dispose(),!1):!l||!l.value.signatures||l.value.signatures.length===0?(l==null||l.dispose(),this._lastSignatureHelpResult.clear(),this.cancel(),!1):(this.state=new im.Active(l.value),this._lastSignatureHelpResult.value=l,this._onChangedHints.fire(this.state.hints),!0)}catch(l){return e===this.triggerId&&(this.state=im.Default),en(l),!1}})}getLastActiveHints(){switch(this.state.type){case 1:return this.state.hints;case 2:return this.state.previouslyActiveHints;default:return}}get isTriggered(){return this.state.type===1||this.state.type===2||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 n of t.signatureHelpTriggerCharacters||[])if(n.length){const o=n.charCodeAt(0);this.triggerChars.add(o),this.retriggerChars.add(o)}for(const n of t.signatureHelpRetriggerCharacters||[])n.length&&this.retriggerChars.add(n.charCodeAt(0))}}onDidType(e){if(!this.triggerOnType)return;const t=e.length-1,n=e.charCodeAt(t);(this.triggerChars.has(n)||this.isTriggered&&this.retriggerChars.has(n))&&this.trigger({triggerKind:sf.TriggerCharacter,triggerCharacter:e.charAt(t)})}onCursorChange(e){e.source==="mouse"?this.cancel():this.isTriggered&&this.trigger({triggerKind:sf.ContentChange})}onModelContentChange(){this.isTriggered&&this.trigger({triggerKind:sf.ContentChange})}onEditorConfigurationChange(){this.triggerOnType=this.editor.getOption(85).enabled,this.triggerOnType||this.cancel()}dispose(){this.cancel(!0),super.dispose()}}HF.DEFAULT_DELAY=120;function hxt(i,e){switch(e.triggerKind){case sf.Invoke:return e;case sf.ContentChange:return i;case sf.TriggerCharacter:default:return e}}var fxt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},_7=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},CU;const Ll=He,gxt=Eo("parameter-hints-next",Xe.chevronDown,C("parameterHintsNextIcon","Icon for show next parameter hint.")),pxt=Eo("parameter-hints-previous",Xe.chevronUp,C("parameterHintsPreviousIcon","Icon for show previous parameter hint."));let kO=CU=class extends _e{constructor(e,t,n,o,r){super(),this.editor=e,this.model=t,this.renderDisposeables=this._register(new Be),this.visible=!1,this.announcedLabel=null,this.allowEditorOverflow=!0,this.markdownRenderer=this._register(new cp({editor:e},r,o)),this.keyVisible=yb.Visible.bindTo(n),this.keyMultipleSignatures=yb.MultipleSignatures.bindTo(n)}createParameterHintDOMNodes(){const e=Ll(".editor-widget.parameter-hints-widget"),t=Ae(e,Ll(".phwrapper"));t.tabIndex=-1;const n=Ae(t,Ll(".controls")),o=Ae(n,Ll(".button"+Mt.asCSSSelector(pxt))),r=Ae(n,Ll(".overloads")),s=Ae(n,Ll(".button"+Mt.asCSSSelector(gxt)));this._register(ke(o,"click",h=>{dn.stop(h),this.previous()})),this._register(ke(s,"click",h=>{dn.stop(h),this.next()}));const a=Ll(".body"),l=new GI(a,{alwaysConsumeMouseWheel:!0});this._register(l),t.appendChild(l.getDomNode());const c=Ae(a,Ll(".signature")),u=Ae(a,Ll(".docs"));e.style.userSelect="text",this.domNodes={element:e,signature:c,overloads:r,docs:u,scrollbar:l},this.editor.addContentWidget(this),this.hide(),this._register(this.editor.onDidChangeCursorSelection(h=>{this.visible&&this.editor.layoutContentWidget(this)}));const d=()=>{if(!this.domNodes)return;const h=this.editor.getOption(50);this.domNodes.element.style.fontSize=`${h.fontSize}px`,this.domNodes.element.style.lineHeight=`${h.lineHeight/h.fontSize}`};d(),this._register(st.chain(this.editor.onDidChangeConfiguration.bind(this.editor),h=>h.filter(f=>f.hasChanged(50)))(d)),this._register(this.editor.onDidLayoutChange(h=>this.updateMaxHeight())),this.updateMaxHeight()}show(){this.visible||(this.domNodes||this.createParameterHintDOMNodes(),this.keyVisible.set(!0),this.visible=!0,setTimeout(()=>{var e;(e=this.domNodes)===null||e===void 0||e.element.classList.add("visible")},100),this.editor.layoutContentWidget(this))}hide(){var e;this.renderDisposeables.clear(),this.visible&&(this.keyVisible.reset(),this.visible=!1,this.announcedLabel=null,(e=this.domNodes)===null||e===void 0||e.element.classList.remove("visible"),this.editor.layoutContentWidget(this))}getPosition(){return this.visible?{position:this.editor.getPosition(),preference:[1,2]}:null}render(e){var t;if(this.renderDisposeables.clear(),!this.domNodes)return;const n=e.signatures.length>1;this.domNodes.element.classList.toggle("multiple",n),this.keyMultipleSignatures.set(n),this.domNodes.signature.innerText="",this.domNodes.docs.innerText="";const o=e.signatures[e.activeSignature];if(!o)return;const r=Ae(this.domNodes.signature,Ll(".code")),s=this.editor.getOption(50);r.style.fontSize=`${s.fontSize}px`,r.style.fontFamily=s.fontFamily;const a=o.parameters.length>0,l=(t=o.activeParameter)!==null&&t!==void 0?t:e.activeParameter;if(a)this.renderParameters(r,o,l);else{const d=Ae(r,Ll("span"));d.textContent=o.label}const c=o.parameters[l];if(c!=null&&c.documentation){const d=Ll("span.documentation");if(typeof c.documentation=="string")d.textContent=c.documentation;else{const h=this.renderMarkdownDocs(c.documentation);d.appendChild(h.element)}Ae(this.domNodes.docs,Ll("p",{},d))}if(o.documentation!==void 0)if(typeof o.documentation=="string")Ae(this.domNodes.docs,Ll("p",{},o.documentation));else{const d=this.renderMarkdownDocs(o.documentation);Ae(this.domNodes.docs,d.element)}const u=this.hasDocs(o,c);if(this.domNodes.signature.classList.toggle("has-docs",u),this.domNodes.docs.classList.toggle("empty",!u),this.domNodes.overloads.textContent=String(e.activeSignature+1).padStart(e.signatures.length.toString().length,"0")+"/"+e.signatures.length,c){let d="";const h=o.parameters[l];Array.isArray(h.label)?d=o.label.substring(h.label[0],h.label[1]):d=h.label,h.documentation&&(d+=typeof h.documentation=="string"?`, ${h.documentation}`:`, ${h.documentation.value}`),o.documentation&&(d+=typeof o.documentation=="string"?`, ${o.documentation}`:`, ${o.documentation.value}`),this.announcedLabel!==d&&(bs(C("hint","{0}, hint",d)),this.announcedLabel=d)}this.editor.layoutContentWidget(this),this.domNodes.scrollbar.scanDomNode()}renderMarkdownDocs(e){const t=this.renderDisposeables.add(this.markdownRenderer.render(e,{asyncRenderCallback:()=>{var n;(n=this.domNodes)===null||n===void 0||n.scrollbar.scanDomNode()}}));return t.element.classList.add("markdown-docs"),t}hasDocs(e,t){return!!(t&&typeof t.documentation=="string"&&s0(t.documentation).length>0||t&&typeof t.documentation=="object"&&s0(t.documentation).value.length>0||e.documentation&&typeof e.documentation=="string"&&s0(e.documentation).length>0||e.documentation&&typeof e.documentation=="object"&&s0(e.documentation.value).length>0)}renderParameters(e,t,n){const[o,r]=this.getParameterLabelOffsets(t,n),s=document.createElement("span");s.textContent=t.label.substring(0,o);const a=document.createElement("span");a.textContent=t.label.substring(o,r),a.className="parameter active";const l=document.createElement("span");l.textContent=t.label.substring(r),Ae(e,s,a,l)}getParameterLabelOffsets(e,t){const n=e.parameters[t];if(n){if(Array.isArray(n.label))return n.label;if(n.label.length){const o=new RegExp(`(\\W|^)${Gl(n.label)}(?=\\W|$)`,"g");o.test(e.label);const r=o.lastIndex-n.label.length;return r>=0?[r,o.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 CU.ID}updateMaxHeight(){if(!this.domNodes)return;const t=`${Math.max(this.editor.getLayoutInfo().height/4,250)}px`;this.domNodes.element.style.maxHeight=t;const n=this.domNodes.element.getElementsByClassName("phwrapper");n.length&&(n[0].style.maxHeight=t)}};kO.ID="editor.widget.parameterHintsWidget";kO=CU=fxt([_7(2,Ut),_7(3,pl),_7(4,Ki)],kO);J("editorHoverWidget.highlightForeground",{dark:Su,light:Su,hcDark:Su,hcLight:Su},C("editorHoverWidgetHighlightForeground","Foreground color of the active item in the parameter hint."));var mxt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Pce=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},wU;let Sb=wU=class extends _e{static get(e){return e.getContribution(wU.ID)}constructor(e,t,n){super(),this.editor=e,this.model=this._register(new HF(e,n.signatureHelpProvider)),this._register(this.model.onChangedHints(o=>{var r;o?(this.widget.value.show(),this.widget.value.render(o)):(r=this.widget.rawValue)===null||r===void 0||r.hide()})),this.widget=new rh(()=>this._register(t.createInstance(kO,this.editor,this.model)))}cancel(){this.model.cancel()}previous(){var e;(e=this.widget.rawValue)===null||e===void 0||e.previous()}next(){var e;(e=this.widget.rawValue)===null||e===void 0||e.next()}trigger(e){this.model.trigger(e,0)}};Sb.ID="editor.controller.parameterHints";Sb=wU=mxt([Pce(1,$t),Pce(2,pt)],Sb);class vxt extends ft{constructor(){super({id:"editor.action.triggerParameterHints",label:C("parameterHints.trigger.label","Trigger Parameter Hints"),alias:"Trigger Parameter Hints",precondition:Q.hasSignatureHelpProvider,kbOpts:{kbExpr:Q.editorTextFocus,primary:3082,weight:100}})}run(e,t){const n=Sb.get(t);n==null||n.trigger({triggerKind:sf.Invoke})}}zn(Sb.ID,Sb,2);ze(vxt);const RY=100+75,MY=Ir.bindToContribution(Sb.get);Ye(new MY({id:"closeParameterHints",precondition:yb.Visible,handler:i=>i.cancel(),kbOpts:{weight:RY,kbExpr:Q.focus,primary:9,secondary:[1033]}}));Ye(new MY({id:"showPrevParameterHint",precondition:Me.and(yb.Visible,yb.MultipleSignatures),handler:i=>i.previous(),kbOpts:{weight:RY,kbExpr:Q.focus,primary:16,secondary:[528],mac:{primary:16,secondary:[528,302]}}}));Ye(new MY({id:"showNextParameterHint",precondition:Me.and(yb.Visible,yb.MultipleSignatures),handler:i=>i.next(),kbOpts:{weight:RY,kbExpr:Q.focus,primary:18,secondary:[530],mac:{primary:18,secondary:[530,300]}}}));var _xt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},b7=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const $F=new lt("renameInputVisible",!1,C("renameInputVisible","Whether the rename input widget is visible"));let yU=class{constructor(e,t,n,o,r){this._editor=e,this._acceptKeybindings=t,this._themeService=n,this._keybindingService=o,this._disposables=new Be,this.allowEditorOverflow=!0,this._visibleContextKey=$F.bindTo(r),this._editor.addContentWidget(this),this._disposables.add(this._editor.onDidChangeConfiguration(s=>{s.hasChanged(50)&&this._updateFont()})),this._disposables.add(n.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._input=document.createElement("input"),this._input.className="rename-input",this._input.type="text",this._input.setAttribute("aria-label",C("renameAriaLabel","Rename input. Type new name and press Enter to commit.")),this._domNode.appendChild(this._input),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){var t,n,o,r;if(!this._input||!this._domNode)return;const s=e.getColor(Kh),a=e.getColor(gG);this._domNode.style.backgroundColor=String((t=e.getColor(po))!==null&&t!==void 0?t:""),this._domNode.style.boxShadow=s?` 0 0 8px 2px ${s}`:"",this._domNode.style.border=a?`1px solid ${a}`:"",this._domNode.style.color=String((n=e.getColor(X0e))!==null&&n!==void 0?n:""),this._input.style.backgroundColor=String((o=e.getColor(G0e))!==null&&o!==void 0?o:"");const l=e.getColor(Y0e);this._input.style.borderWidth=l?"1px":"0px",this._input.style.borderStyle=l?"solid":"none",this._input.style.borderColor=(r=l==null?void 0:l.toString())!==null&&r!==void 0?r:"none"}_updateFont(){if(!this._input||!this._label)return;const e=this._editor.getOption(50);this._input.style.fontFamily=e.fontFamily,this._input.style.fontWeight=e.fontWeight,this._input.style.fontSize=`${e.fontSize}px`,this._label.style.fontSize=`${e.fontSize*.8}px`}getPosition(){return this._visible?{position:this._position,preference:[2,1]}:null}beforeRender(){var e,t;const[n,o]=this._acceptKeybindings;return this._label.innerText=C({key:"label",comment:['placeholders are keybindings, e.g "F2 to Rename, Shift+F2 to Preview"']},"{0} to Rename, {1} to Preview",(e=this._keybindingService.lookupKeybinding(n))===null||e===void 0?void 0:e.getLabel(),(t=this._keybindingService.lookupKeybinding(o))===null||t===void 0?void 0:t.getLabel()),null}afterRender(e){e||this.cancelInput(!0)}acceptInput(e){var t;(t=this._currentAcceptInput)===null||t===void 0||t.call(this,e)}cancelInput(e){var t;(t=this._currentCancelInput)===null||t===void 0||t.call(this,e)}getInput(e,t,n,o,r,s){this._domNode.classList.toggle("preview",r),this._position=new ae(e.startLineNumber,e.startColumn),this._input.value=t,this._input.setAttribute("selectionStart",n.toString()),this._input.setAttribute("selectionEnd",o.toString()),this._input.size=Math.max((e.endColumn-e.startColumn)*1.1,20);const a=new Be;return new Promise(l=>{this._currentCancelInput=c=>(this._currentAcceptInput=void 0,this._currentCancelInput=void 0,l(c),!0),this._currentAcceptInput=c=>{if(this._input.value.trim().length===0||this._input.value===t){this.cancelInput(!0);return}this._currentAcceptInput=void 0,this._currentCancelInput=void 0,l({newName:this._input.value,wantsPreview:r&&c})},a.add(s.onCancellationRequested(()=>this.cancelInput(!0))),a.add(this._editor.onDidBlurEditorWidget(()=>{var c;return this.cancelInput(!(!((c=this._domNode)===null||c===void 0)&&c.ownerDocument.hasFocus()))})),this._show()}).finally(()=>{a.dispose(),this._hide()})}_show(){this._editor.revealLineInCenterIfOutsideViewport(this._position.lineNumber,0),this._visible=!0,this._visibleContextKey.set(!0),this._editor.layoutContentWidget(this),setTimeout(()=>{this._input.focus(),this._input.setSelectionRange(parseInt(this._input.getAttribute("selectionStart")),parseInt(this._input.getAttribute("selectionEnd")))},100)}_hide(){this._visible=!1,this._visibleContextKey.reset(),this._editor.layoutContentWidget(this)}};yU=_xt([b7(2,mr),b7(3,xi),b7(4,Ut)],yU);var bxt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},S_=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},P0=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},SU;class AY{constructor(e,t,n){this.model=e,this.position=t,this._providerRenameIdx=0,this._providers=n.ordered(e)}hasProvider(){return this._providers.length>0}resolveRenameLocation(e){return P0(this,void 0,void 0,function*(){const t=[];for(this._providerRenameIdx=0;this._providerRenameIdx0?t.join(` +`+d),this.shouldAutoIndent(e,o)){c.getLineContent=f=>f===u?e.getLineContent(o.startLineNumber):e.getLineContent(f);const h=this.matchEnterRule(e,l,r,o.startLineNumber,o.startLineNumber-2);if(h!==null)h!==0&&this.getIndentEditsOfMovingBlock(e,t,o,r,a,h);else{const f=fE(this._autoIndent,c,e.getLanguageIdAtPosition(o.startLineNumber,1),u,l,this._languageConfigurationService);if(f!==null){const g=Si(e.getLineContent(o.startLineNumber)),p=Ya(f,r),v=Ya(g,r);if(p!==v){const m=p-v;this.getIndentEditsOfMovingBlock(e,t,o,r,a,m)}}}}}this._selectionId=t.trackSelection(o)}buildIndentConverter(e,t,n){return{shiftIndent:o=>Ec.shiftIndent(o,o.length+1,e,t,n),unshiftIndent:o=>Ec.unshiftIndent(o,o.length+1,e,t,n)}}parseEnterResult(e,t,n,o,r){if(r){let s=r.indentation;r.indentAction===Ho.None||r.indentAction===Ho.Indent?s=r.indentation+r.appendText:r.indentAction===Ho.IndentOutdent?s=r.indentation:r.indentAction===Ho.Outdent&&(s=t.unshiftIndent(r.indentation)+r.appendText);const a=e.getLineContent(o);if(this.trimStart(a).indexOf(this.trimStart(s))>=0){const l=Si(e.getLineContent(o));let c=Si(s);const u=Ibe(e,o,this._languageConfigurationService);u!==null&&u&2&&(c=t.unshiftIndent(c));const d=Ya(c,n),h=Ya(l,n);return d-h}}return null}matchEnterRuleMovingDown(e,t,n,o,r,s){if(Wd(s)>=0){const a=e.getLineMaxColumn(r),l=Ly(this._autoIndent,e,new V(r,a,r,a),this._languageConfigurationService);return this.parseEnterResult(e,t,n,o,l)}else{let a=o-1;for(;a>=1;){const u=e.getLineContent(a);if(Wd(u)>=0)break;a--}if(a<1||o>e.getLineCount())return null;const l=e.getLineMaxColumn(a),c=Ly(this._autoIndent,e,new V(a,l,a,l),this._languageConfigurationService);return this.parseEnterResult(e,t,n,o,c)}}matchEnterRule(e,t,n,o,r,s){let a=r;for(;a>=1;){let u;if(a===r&&s!==void 0?u=s:u=e.getLineContent(a),Wd(u)>=0)break;a--}if(a<1||o>e.getLineCount())return null;const l=e.getLineMaxColumn(a),c=Ly(this._autoIndent,e,new V(a,l,a,l),this._languageConfigurationService);return this.parseEnterResult(e,t,n,o,c)}trimStart(e){return e.replace(/^\s+/,"")}shouldAutoIndent(e,t){if(this._autoIndent<4||!e.tokenization.isCheapToTokenize(t.startLineNumber))return!1;const n=e.getLanguageIdAtPosition(t.startLineNumber,1),o=e.getLanguageIdAtPosition(t.endLineNumber,1);return!(n!==o||this._languageConfigurationService.getLanguageConfiguration(n).indentRulesSupport===null)}getIndentEditsOfMovingBlock(e,t,n,o,r,s){for(let a=n.startLineNumber;a<=n.endLineNumber;a++){const l=e.getLineContent(a),c=Si(l),d=Ya(c,o)+s,h=PE(d,o,r);h!==c&&(t.addEditOperation(new V(a,1,a,c.length+1),h),a===n.endLineNumber&&n.endColumn<=c.length+1&&h===""&&(this._moveEndLineSelectionShrink=!0))}}computeCursorState(e,t){let n=t.getTrackedSelection(this._selectionId);return this._moveEndPositionDown&&(n=n.setEndPosition(n.endLineNumber+1,1)),this._moveEndLineSelectionShrink&&n.startLineNumber=o)return null;const r=[];for(let a=n;a<=o;a++)r.push(i.getLineContent(a));let s=r.slice(0);return s.sort(sv.getCollator().compare),t===!0&&(s=s.reverse()),{startLineNumber:n,endLineNumber:o,before:r,after:s}}function mSt(i,e,t){const n=_Se(i,e,t);return n?Gi.replace(new V(n.startLineNumber,1,n.endLineNumber,i.getLineMaxColumn(n.endLineNumber)),n.after.join(` +`)):null}class bSe extends ft{constructor(e,t){super(t),this.down=e}run(e,t){if(!t.hasModel())return;const n=t.getSelections().map((s,a)=>({selection:s,index:a,ignore:!1}));n.sort((s,a)=>V.compareRangesUsingStarts(s.selection,a.selection));let o=n[0];for(let s=1;snew ae(a.positionLineNumber,a.positionColumn)));const r=t.getSelection();if(r===null)return;const s=new hSt(r,o);t.pushUndoStop(),t.executeCommands(this.id,[s]),t.pushUndoStop()}}HF.ID="editor.action.trimTrailingWhitespace";class LSt extends ft{constructor(){super({id:"editor.action.deleteLines",label:C("lines.delete","Delete Line"),alias:"Delete Line",precondition:Q.writable,kbOpts:{kbExpr:Q.textInputFocus,primary:3113,weight:100}})}run(e,t){if(!t.hasModel())return;const n=this._getLinesToRemove(t),o=t.getModel();if(o.getLineCount()===1&&o.getLineMaxColumn(1)===1)return;let r=0;const s=[],a=[];for(let l=0,c=n.length;l1&&(d-=1,f=o.getLineMaxColumn(d)),s.push(Gi.replace(new gt(d,f,h,g),"")),a.push(new gt(d-r,u.positionColumn,d-r,u.positionColumn)),r+=u.endLineNumber-u.startLineNumber+1}t.pushUndoStop(),t.executeEdits(this.id,s,a),t.pushUndoStop()}_getLinesToRemove(e){const t=e.getSelections().map(r=>{let s=r.endLineNumber;return r.startLineNumberr.startLineNumber===s.startLineNumber?r.endLineNumber-s.endLineNumber:r.startLineNumber-s.startLineNumber);const n=[];let o=t[0];for(let r=1;r=t[r].startLineNumber?o.endLineNumber=t[r].endLineNumber:(n.push(o),o=t[r]);return n.push(o),n}}class ESt extends ft{constructor(){super({id:"editor.action.indentLines",label:C("lines.indent","Indent Line"),alias:"Indent Line",precondition:Q.writable,kbOpts:{kbExpr:Q.editorTextFocus,primary:2142,weight:100}})}run(e,t){const n=t._getViewModel();!n||(t.pushUndoStop(),t.executeCommands(this.id,eo.indent(n.cursorConfig,t.getModel(),t.getSelections())),t.pushUndoStop())}}class DSt extends ft{constructor(){super({id:"editor.action.outdentLines",label:C("lines.outdent","Outdent Line"),alias:"Outdent Line",precondition:Q.writable,kbOpts:{kbExpr:Q.editorTextFocus,primary:2140,weight:100}})}run(e,t){Ey.Outdent.runEditorCommand(e,t,null)}}class kSt extends ft{constructor(){super({id:"editor.action.insertLineBefore",label:C("lines.insertBefore","Insert Line Above"),alias:"Insert Line Above",precondition:Q.writable,kbOpts:{kbExpr:Q.editorTextFocus,primary:3075,weight:100}})}run(e,t){const n=t._getViewModel();!n||(t.pushUndoStop(),t.executeCommands(this.id,eo.lineInsertBefore(n.cursorConfig,t.getModel(),t.getSelections())))}}class ISt extends ft{constructor(){super({id:"editor.action.insertLineAfter",label:C("lines.insertAfter","Insert Line Below"),alias:"Insert Line Below",precondition:Q.writable,kbOpts:{kbExpr:Q.editorTextFocus,primary:2051,weight:100}})}run(e,t){const n=t._getViewModel();!n||(t.pushUndoStop(),t.executeCommands(this.id,eo.lineInsertAfter(n.cursorConfig,t.getModel(),t.getSelections())))}}class wSe extends ft{run(e,t){if(!t.hasModel())return;const n=t.getSelection(),o=this._getRangesToDelete(t),r=[];for(let l=0,c=o.length-1;lGi.replace(l,""));t.pushUndoStop(),t.executeEdits(this.id,a,s),t.pushUndoStop()}}class TSt extends wSe{constructor(){super({id:"deleteAllLeft",label:C("lines.deleteAllLeft","Delete All Left"),alias:"Delete All Left",precondition:Q.writable,kbOpts:{kbExpr:Q.textInputFocus,primary:0,mac:{primary:2049},weight:100}})}_getEndCursorState(e,t){let n=null;const o=[];let r=0;return t.forEach(s=>{let a;if(s.endColumn===1&&r>0){const l=s.startLineNumber-r;a=new gt(l,s.startColumn,l,s.startColumn)}else a=new gt(s.startLineNumber,s.startColumn,s.startLineNumber,s.startColumn);r+=s.endLineNumber-s.startLineNumber,s.intersectRanges(e)?n=a:o.push(a)}),n&&o.unshift(n),o}_getRangesToDelete(e){const t=e.getSelections();if(t===null)return[];let n=t;const o=e.getModel();return o===null?[]:(n.sort(V.compareRangesUsingStarts),n=n.map(r=>{if(r.isEmpty())if(r.startColumn===1){const s=Math.max(1,r.startLineNumber-1),a=r.startLineNumber===1?1:o.getLineLength(s)+1;return new V(s,a,r.startLineNumber,1)}else return new V(r.startLineNumber,1,r.startLineNumber,r.startColumn);else return new V(r.startLineNumber,1,r.endLineNumber,r.endColumn)}),n)}}class NSt extends wSe{constructor(){super({id:"deleteAllRight",label:C("lines.deleteAllRight","Delete All Right"),alias:"Delete All Right",precondition:Q.writable,kbOpts:{kbExpr:Q.textInputFocus,primary:0,mac:{primary:297,secondary:[2068]},weight:100}})}_getEndCursorState(e,t){let n=null;const o=[];for(let r=0,s=t.length,a=0;r{if(r.isEmpty()){const s=t.getLineMaxColumn(r.startLineNumber);return r.startColumn===s?new V(r.startLineNumber,r.startColumn,r.startLineNumber+1,1):new V(r.startLineNumber,r.startColumn,r.startLineNumber,s)}return r});return o.sort(V.compareRangesUsingStarts),o}}class RSt extends ft{constructor(){super({id:"editor.action.joinLines",label:C("lines.joinLines","Join Lines"),alias:"Join Lines",precondition:Q.writable,kbOpts:{kbExpr:Q.editorTextFocus,primary:0,mac:{primary:296},weight:100}})}run(e,t){const n=t.getSelections();if(n===null)return;let o=t.getSelection();if(o===null)return;n.sort(V.compareRangesUsingStarts);const r=[],s=n.reduce((h,f)=>h.isEmpty()?h.endLineNumber===f.startLineNumber?(o.equalsSelection(h)&&(o=f),f):f.startLineNumber>h.endLineNumber+1?(r.push(h),f):new gt(h.startLineNumber,h.startColumn,f.endLineNumber,f.endColumn):f.startLineNumber>h.endLineNumber?(r.push(h),f):new gt(h.startLineNumber,h.startColumn,f.endLineNumber,f.endColumn));r.push(s);const a=t.getModel();if(a===null)return;const l=[],c=[];let u=o,d=0;for(let h=0,f=r.length;h=1){let R=!0;L===""&&(R=!1),R&&(L.charAt(L.length-1)===" "||L.charAt(L.length-1)===" ")&&(R=!1,L=L.replace(/[\s\uFEFF\xA0]+$/g," "));const A=I.substr(k-1);L+=(R?" ":"")+A,R?m=A.length+1:m=A.length}else m=0}const D=new V(p,v,_,y);if(!D.isEmpty()){let E;g.isEmpty()?(l.push(Gi.replace(D,L)),E=new gt(D.startLineNumber-d,L.length-m+1,p-d,L.length-m+1)):g.startLineNumber===g.endLineNumber?(l.push(Gi.replace(D,L)),E=new gt(g.startLineNumber-d,g.startColumn,g.endLineNumber-d,g.endColumn)):(l.push(Gi.replace(D,L)),E=new gt(g.startLineNumber-d,g.startColumn,g.startLineNumber-d,L.length-w)),V.intersectRanges(D,o)!==null?u=E:c.push(E)}d+=D.endLineNumber-D.startLineNumber}c.unshift(u),t.pushUndoStop(),t.executeEdits(this.id,l,c),t.pushUndoStop()}}class MSt extends ft{constructor(){super({id:"editor.action.transpose",label:C("editor.transpose","Transpose Characters around the Cursor"),alias:"Transpose Characters around the Cursor",precondition:Q.writable})}run(e,t){const n=t.getSelections();if(n===null)return;const o=t.getModel();if(o===null)return;const r=[];for(let s=0,a=n.length;s=u){if(c.lineNumber===o.getLineCount())continue;const d=new V(c.lineNumber,Math.max(1,c.column-1),c.lineNumber+1,1),h=o.getValueInRange(d).split("").reverse().join("");r.push(new Qr(new gt(c.lineNumber,Math.max(1,c.column-1),c.lineNumber+1,1),h))}else{const d=new V(c.lineNumber,Math.max(1,c.column-1),c.lineNumber,c.column+1),h=o.getValueInRange(d).split("").reverse().join("");r.push(new MG(d,h,new gt(c.lineNumber,c.column+1,c.lineNumber,c.column+1)))}}t.pushUndoStop(),t.executeCommands(this.id,r),t.pushUndoStop()}}class MS extends ft{run(e,t){const n=t.getSelections();if(n===null)return;const o=t.getModel();if(o===null)return;const r=t.getOption(129),s=[];for(const a of n)if(a.isEmpty()){const l=a.getStartPosition(),c=t.getConfiguredWordAtPosition(l);if(!c)continue;const u=new V(l.lineNumber,c.startColumn,l.lineNumber,c.endColumn),d=o.getValueInRange(u);s.push(Gi.replace(u,this._modifyText(d,r)))}else{const l=o.getValueInRange(a);s.push(Gi.replace(a,this._modifyText(l,r)))}t.pushUndoStop(),t.executeEdits(this.id,s),t.pushUndoStop()}}class ASt extends MS{constructor(){super({id:"editor.action.transformToUppercase",label:C("editor.transformToUppercase","Transform to Uppercase"),alias:"Transform to Uppercase",precondition:Q.writable})}_modifyText(e,t){return e.toLocaleUpperCase()}}class PSt extends MS{constructor(){super({id:"editor.action.transformToLowercase",label:C("editor.transformToLowercase","Transform to Lowercase"),alias:"Transform to Lowercase",precondition:Q.writable})}_modifyText(e,t){return e.toLocaleLowerCase()}}class t1{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}}class Xk extends MS{constructor(){super({id:"editor.action.transformToTitlecase",label:C("editor.transformToTitlecase","Transform to Title Case"),alias:"Transform to Title Case",precondition:Q.writable})}_modifyText(e,t){const n=Xk.titleBoundary.get();return n?e.toLocaleLowerCase().replace(n,o=>o.toLocaleUpperCase()):e}}Xk.titleBoundary=new t1("(^|[^\\p{L}\\p{N}']|((^|\\P{L})'))\\p{L}","gmu");class av extends MS{constructor(){super({id:"editor.action.transformToSnakecase",label:C("editor.transformToSnakecase","Transform to Snake Case"),alias:"Transform to Snake Case",precondition:Q.writable})}_modifyText(e,t){const n=av.caseBoundary.get(),o=av.singleLetters.get();return!n||!o?e:e.replace(n,"$1_$2").replace(o,"$1_$2$3").toLocaleLowerCase()}}av.caseBoundary=new t1("(\\p{Ll})(\\p{Lu})","gmu");av.singleLetters=new t1("(\\p{Lu}|\\p{N})(\\p{Lu})(\\p{Ll})","gmu");class Yk extends MS{constructor(){super({id:"editor.action.transformToCamelcase",label:C("editor.transformToCamelcase","Transform to Camel Case"),alias:"Transform to Camel Case",precondition:Q.writable})}_modifyText(e,t){const n=Yk.wordBoundary.get();if(!n)return e;const o=e.split(n);return o.shift()+o.map(s=>s.substring(0,1).toLocaleUpperCase()+s.substring(1)).join("")}}Yk.wordBoundary=new t1("[_\\s-]","gm");class Jg extends MS{static isSupported(){return[this.caseBoundary,this.singleLetters,this.underscoreBoundary].every(t=>t.isSupported())}constructor(){super({id:"editor.action.transformToKebabcase",label:C("editor.transformToKebabcase","Transform to Kebab Case"),alias:"Transform to Kebab Case",precondition:Q.writable})}_modifyText(e,t){const n=Jg.caseBoundary.get(),o=Jg.singleLetters.get(),r=Jg.underscoreBoundary.get();return!n||!o||!r?e:e.replace(r,"$1-$3").replace(n,"$1-$2").replace(o,"$1-$2").toLocaleLowerCase()}}Jg.caseBoundary=new t1("(\\p{Ll})(\\p{Lu})","gmu");Jg.singleLetters=new t1("(\\p{Lu}|\\p{N})(\\p{Lu}\\p{Ll})","gmu");Jg.underscoreBoundary=new t1("(\\S)(_)(\\S)","gm");ze(vSt);ze(_St);ze(bSt);ze(CSt);ze(ySt);ze(wSt);ze(SSt);ze(xSt);ze(HF);ze(LSt);ze(ESt);ze(DSt);ze(kSt);ze(ISt);ze(TSt);ze(NSt);ze(RSt);ze(MSt);ze(ASt);ze(PSt);av.caseBoundary.isSupported()&&av.singleLetters.isSupported()&&ze(av);Yk.wordBoundary.isSupported()&&ze(Yk);Xk.titleBoundary.isSupported()&&ze(Xk);Jg.isSupported()&&ze(Jg);var OSt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},fR=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},CU=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},MM;const SSe=new lt("LinkedEditingInputVisible",!1),FSt="linked-editing-decoration";let $v=MM=class extends _e{static get(e){return e.getContribution(MM.ID)}constructor(e,t,n,o,r){super(),this.languageConfigurationService=o,this._syncRangesToken=0,this._localToDispose=this._register(new Be),this._editor=e,this._providers=n.linkedEditingRangeProvider,this._enabled=!1,this._visibleContextKey=SSe.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 Be),this._rangeUpdateTriggerPromise=null,this._rangeSyncTriggerPromise=null,this._currentRequest=null,this._currentRequestPosition=null,this._currentRequestModelVersion=null,this._register(this._editor.onDidChangeModel(()=>this.reinitialize(!0))),this._register(this._editor.onDidChangeConfiguration(s=>{(s.hasChanged(69)||s.hasChanged(92))&&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(),n=t!==null&&(this._editor.getOption(69)||this._editor.getOption(92))&&this._providers.has(t);if(n===this._enabled&&!e||(this._enabled=n,this.clearRanges(),this._localToDispose.clear(),!n||t===null))return;this._localToDispose.add(st.runAndSubscribe(t.onDidChangeLanguageConfiguration,()=>{this._languageWordPattern=this.languageConfigurationService.getLanguageConfiguration(t.getLanguageId()).getWordDefinition()}));const o=new Wu(this._debounceInformation.get(t)),r=()=>{var l;this._rangeUpdateTriggerPromise=o.trigger(()=>this.updateRanges(),(l=this._debounceDuration)!==null&&l!==void 0?l:this._debounceInformation.get(t))},s=new Wu(0),a=l=>{this._rangeSyncTriggerPromise=s.trigger(()=>this._syncRanges(l))};this._localToDispose.add(this._editor.onDidChangeCursorPosition(()=>{r()})),this._localToDispose.add(this._editor.onDidChangeModelContent(l=>{if(!this._ignoreChangeEvent&&this._currentDecorations.length>0){const c=this._currentDecorations.getRange(0);if(c&&l.changes.every(u=>c.intersectRanges(u.range))){a(this._syncRangesToken);return}}r()})),this._localToDispose.add({dispose:()=>{o.dispose(),s.dispose()}}),this.updateRanges()}_syncRanges(e){if(!this._editor.hasModel()||e!==this._syncRangesToken||this._currentDecorations.length===0)return;const t=this._editor.getModel(),n=this._currentDecorations.getRange(0);if(!n||n.startLineNumber!==n.endLineNumber)return this.clearRanges();const o=t.getValueInRange(n);if(this._currentWordPattern){const s=o.match(this._currentWordPattern);if((s?s[0].length:0)!==o.length)return this.clearRanges()}const r=[];for(let s=1,a=this._currentDecorations.length;s1){this.clearRanges();return}const n=this._editor.getModel(),o=n.getVersionId();if(this._currentRequestPosition&&this._currentRequestModelVersion===o){if(t.equals(this._currentRequestPosition))return;if(this._currentDecorations.length>0){const s=this._currentDecorations.getRange(0);if(s&&s.containsPosition(t))return}}this.clearRanges(),this._currentRequestPosition=t,this._currentRequestModelVersion=o;const r=sr(s=>CU(this,void 0,void 0,function*(){try{const a=new Ls(!1),l=yield xSe(this._providers,n,t,s);if(this._debounceInformation.update(n,a.elapsed()),r!==this._currentRequest||(this._currentRequest=null,o!==n.getVersionId()))return;let c=[];l!=null&&l.ranges&&(c=l.ranges),this._currentWordPattern=(l==null?void 0:l.wordPattern)||this._languageWordPattern;let u=!1;for(let h=0,f=c.length;h({range:h,options:MM.DECORATION}));this._visibleContextKey.set(!0),this._currentDecorations.set(d),this._syncRangesToken++}catch(a){sh(a)||en(a),(this._currentRequest===r||!this._currentRequest)&&this.clearRanges()}}));return this._currentRequest=r,r})}};$v.ID="editor.contrib.linkedEditing";$v.DECORATION=Jt.register({description:"linked-editing",stickiness:0,className:FSt});$v=MM=OSt([fR(1,Ut),fR(2,pt),fR(3,Ti),fR(4,qc)],$v);class BSt extends ft{constructor(){super({id:"editor.action.linkedEditing",label:C("linkedEditing.label","Start Linked Editing"),alias:"Start Linked Editing",precondition:Me.and(Q.writable,Q.hasRenameProvider),kbOpts:{kbExpr:Q.editorTextFocus,primary:3132,weight:100}})}runCommand(e,t){const n=e.get(Jn),[o,r]=Array.isArray(t)&&t||[void 0,void 0];return Rt.isUri(o)&&ae.isIPosition(r)?n.openCodeEditor({resource:o},n.getActiveCodeEditor()).then(s=>{!s||(s.setPosition(r),s.invokeWithinContext(a=>(this.reportTelemetry(a,s),this.run(a,s))))},en):super.runCommand(e,t)}run(e,t){const n=$v.get(t);return n?Promise.resolve(n.updateRanges(!0)):Promise.resolve()}}const WSt=Ir.bindToContribution($v.get);Ye(new WSt({id:"cancelLinkedEditingInput",precondition:SSe,handler:i=>i.clearRanges(),kbOpts:{kbExpr:Q.editorTextFocus,weight:100+99,primary:9,secondary:[1033]}}));function xSe(i,e,t,n){const o=i.ordered(e);return L0e(o.map(r=>()=>CU(this,void 0,void 0,function*(){try{return yield r.provideLinkedEditingRanges(e,t,n)}catch(s){$o(s);return}})),r=>!!r&&ws(r==null?void 0:r.ranges))}J("editor.linkedEditingBackground",{dark:ve.fromHex("#f00").transparent(.3),light:ve.fromHex("#f00").transparent(.3),hcDark:ve.fromHex("#f00").transparent(.3),hcLight:ve.white},C("editorLinkedEditingBackground","Background color when the editor auto renames on type."));Nf("_executeLinkedEditingProvider",(i,e,t)=>{const{linkedEditingRangeProvider:n}=i.get(pt);return xSe(n,e,t,_n.None)});zn($v.ID,$v,1);ze(BSt);var LSe=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};class VSt{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}resolve(e){return LSe(this,void 0,void 0,function*(){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 TO{constructor(e){this._disposables=new Be;let t=[];for(const[n,o]of e){const r=n.links.map(s=>new VSt(s,o));t=TO._union(t,r),Wq(n)&&this._disposables.add(n)}this.links=t}dispose(){this._disposables.dispose(),this.links.length=0}static _union(e,t){const n=[];let o,r,s,a;for(o=0,s=0,r=e.length,a=t.length;oPromise.resolve(r.provideLinks(e,t)).then(a=>{a&&(n[s]=[a,r])},$o));return Promise.all(o).then(()=>{const r=new TO(hf(n));return t.isCancellationRequested?(r.dispose(),new TO([])):r})}Rn.registerCommand("_executeLinkProvider",(i,...e)=>LSe(void 0,void 0,void 0,function*(){let[t,n]=e;fi(t instanceof Rt),typeof n!="number"&&(n=0);const{linkProvider:o}=i.get(pt),r=i.get(Yi).getModel(t);if(!r)return[];const s=yield ESe(o,r,_n.None);if(!s)return[];for(let l=0;l=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},gR=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},$St=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},yU;let Yw=yU=class extends _e{static get(e){return e.getContribution(yU.ID)}constructor(e,t,n,o,r){super(),this.editor=e,this.openerService=t,this.notificationService=n,this.languageFeaturesService=o,this.providers=this.languageFeaturesService.linkProvider,this.debounceInformation=r.for(this.providers,"Links",{min:1e3,max:4e3}),this.computeLinks=this._register(new bi(()=>this.computeLinksNow(),1e3)),this.computePromise=null,this.activeLinksList=null,this.currentOccurrences={},this.activeLinkDecorationId=null;const s=this._register(new cF(e));this._register(s.onMouseMoveOrRelevantKeyDown(([a,l])=>{this._onEditorMouseMove(a,l)})),this._register(s.onExecute(a=>{this.onEditorMouseUp(a)})),this._register(s.onCancel(a=>{this.cleanUpActiveLinkDecoration()})),this._register(e.onDidChangeConfiguration(a=>{!a.hasChanged(70)||(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)}computeLinksNow(){return $St(this,void 0,void 0,function*(){if(!this.editor.hasModel()||!this.editor.getOption(70))return;const e=this.editor.getModel();if(!e.isTooLargeForSyncing()&&!!this.providers.has(e)){this.activeLinksList&&(this.activeLinksList.dispose(),this.activeLinksList=null),this.computePromise=sr(t=>ESe(this.providers,e,t));try{const t=new Ls(!1);if(this.activeLinksList=yield this.computePromise,this.debounceInformation.update(e,t.elapsed()),e.isDisposed())return;this.updateDecorations(this.activeLinksList.links)}catch(t){en(t)}finally{this.computePromise=null}}})}updateDecorations(e){const t=this.editor.getOption(77)==="altKey",n=[],o=Object.keys(this.currentOccurrences);for(const s of o){const a=this.currentOccurrences[s];n.push(a.decorationId)}const r=[];if(e)for(const s of e)r.push(Wy.decoration(s,t));this.editor.changeDecorations(s=>{const a=s.deltaDecorations(n,r);this.currentOccurrences={},this.activeLinkDecorationId=null;for(let l=0,c=a.length;l{o.activate(r,n),this.activeLinkDecorationId=o.decorationId})}else this.cleanUpActiveLinkDecoration()}cleanUpActiveLinkDecoration(){const e=this.editor.getOption(77)==="altKey";if(this.activeLinkDecorationId){const t=this.currentOccurrences[this.activeLinkDecorationId];t&&this.editor.changeDecorations(n=>{t.deactivate(n,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,n=!1){if(!this.openerService)return;const{link:o}=e;o.resolve(_n.None).then(r=>{if(typeof r=="string"&&this.editor.hasModel()){const s=this.editor.getModel().uri;if(s.scheme===hn.file&&r.startsWith(`${hn.file}:`)){const a=Rt.parse(r);if(a.scheme===hn.file){const l=yh(a);let c=null;l.startsWith("/./")?c=`.${l.substr(1)}`:l.startsWith("//./")&&(c=`.${l.substr(2)}`),c&&(r=Hst(s,c))}}}return this.openerService.open(r,{openToSide:t,fromUserGesture:n,allowContributedOpeners:!0,allowCommands:!0,fromWorkspace:!0})},r=>{const s=r instanceof Error?r.message:r;s==="invalid"?this.notificationService.warn(C("invalid.url","Failed to open this link because it is not well-formed: {0}",o.url.toString())):s==="missing"?this.notificationService.warn(C("missing.url","Failed to open this link because its target is missing.")):en(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 n of t){const o=this.currentOccurrences[n.id];if(o)return o}return null}isEnabled(e,t){return Boolean(e.target.type===6&&(e.hasTriggerModifier||t&&t.keyCodeIsTriggerKey))}stop(){var e;this.computeLinks.cancel(),this.activeLinksList&&((e=this.activeLinksList)===null||e===void 0||e.dispose(),this.activeLinksList=null),this.computePromise&&(this.computePromise.cancel(),this.computePromise=null)}dispose(){super.dispose(),this.stop()}};Yw.ID="editor.linkDetector";Yw=yU=HSt([gR(1,ml),gR(2,Ao),gR(3,pt),gR(4,qc)],Yw);const Hce={general:Jt.register({description:"detected-link",stickiness:1,collapseOnReplaceEdit:!0,inlineClassName:"detected-link"}),active:Jt.register({description:"detected-link-active",stickiness:1,collapseOnReplaceEdit:!0,inlineClassName:"detected-link-active"})};class Wy{static decoration(e,t){return{range:e.range,options:Wy._getOptions(e,t,!1)}}static _getOptions(e,t,n){const o=Object.assign({},n?Hce.active:Hce.general);return o.hoverMessage=zSt(e,t),o}constructor(e,t){this.link=e,this.decorationId=t}activate(e,t){e.changeDecorationOptions(this.decorationId,Wy._getOptions(this.link,t,!0))}deactivate(e,t){e.changeDecorationOptions(this.decorationId,Wy._getOptions(this.link,t,!1))}}function zSt(i,e){const t=i.url&&/^command:/i.test(i.url.toString()),n=i.tooltip?i.tooltip:t?C("links.navigate.executeCmd","Execute command"):C("links.navigate.follow","Follow link"),o=e?Nn?C("links.navigate.kb.meta.mac","cmd + click"):C("links.navigate.kb.meta","ctrl + click"):Nn?C("links.navigate.kb.alt.mac","option + click"):C("links.navigate.kb.alt","alt + click");if(i.url){let r="";if(/^command:/i.test(i.url.toString())){const a=i.url.toString().match(/^command:([^?#]+)/);if(a){const l=a[1];r=C("tooltip.explanation","Execute command {0}",l)}}return new os("",!0).appendLink(i.url.toString(!0).replace(/ /g,"%20"),n,r).appendMarkdown(` (${o})`)}else return new os().appendText(`${n} (${o})`)}class USt extends ft{constructor(){super({id:"editor.action.openLink",label:C("label","Open Link"),alias:"Open Link",precondition:void 0})}run(e,t){const n=Yw.get(t);if(!n||!t.hasModel())return;const o=t.getSelections();for(const r of o){const s=n.getLinkOccurrence(r.getEndPosition());s&&n.openLinkOccurrence(s,!1)}}}zn(Yw.ID,Yw,1);ze(USt);class wU extends _e{constructor(e){super(),this._editor=e,this._register(this._editor.onMouseDown(t=>{const n=this._editor.getOption(116);n>=0&&t.target.type===6&&t.target.position.column>=n&&this._editor.updateOptions({stopRenderingLineAfter:-1})}))}}wU.ID="editor.contrib.longLinesHelper";zn(wU.ID,wU,2);const pR=J("editor.wordHighlightBackground",{dark:"#575757B8",light:"#57575740",hcDark:null,hcLight:null},C("wordHighlight","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);J("editor.wordHighlightStrongBackground",{dark:"#004972B8",light:"#0e639c40",hcDark:null,hcLight:null},C("wordHighlightStrong","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);J("editor.wordHighlightTextBackground",{light:pR,dark:pR,hcDark:pR,hcLight:pR},C("wordHighlightText","Background color of a textual occurrence for a symbol. The color must not be opaque so as not to hide underlying decorations."),!0);const mR=J("editor.wordHighlightBorder",{light:null,dark:null,hcDark:Wi,hcLight:Wi},C("wordHighlightBorder","Border color of a symbol during read-access, like reading a variable."));J("editor.wordHighlightStrongBorder",{light:null,dark:null,hcDark:Wi,hcLight:Wi},C("wordHighlightStrongBorder","Border color of a symbol during write-access, like writing to a variable."));J("editor.wordHighlightTextBorder",{light:mR,dark:mR,hcDark:mR,hcLight:mR},C("wordHighlightTextBorder","Border color of a textual occurrence for a symbol."));const jSt=J("editorOverviewRuler.wordHighlightForeground",{dark:"#A0A0A0CC",light:"#A0A0A0CC",hcDark:"#A0A0A0CC",hcLight:"#A0A0A0CC"},C("overviewRulerWordHighlightForeground","Overview ruler marker color for symbol highlights. The color must not be opaque so as not to hide underlying decorations."),!0),KSt=J("editorOverviewRuler.wordHighlightStrongForeground",{dark:"#C0A0C0CC",light:"#C0A0C0CC",hcDark:"#C0A0C0CC",hcLight:"#C0A0C0CC"},C("overviewRulerWordHighlightStrongForeground","Overview ruler marker color for write-access symbol highlights. The color must not be opaque so as not to hide underlying decorations."),!0),qSt=J("editorOverviewRuler.wordHighlightTextForeground",{dark:LL,light:LL,hcDark:LL,hcLight:LL},C("overviewRulerWordHighlightTextForeground","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),GSt=Jt.register({description:"word-highlight-strong",stickiness:1,className:"wordHighlightStrong",overviewRuler:{color:ro(KSt),position:Yl.Center},minimap:{color:ro(g5),position:ll.Inline}}),XSt=Jt.register({description:"word-highlight-text",stickiness:1,className:"wordHighlightText",overviewRuler:{color:ro(qSt),position:Yl.Center},minimap:{color:ro(g5),position:ll.Inline}}),YSt=Jt.register({description:"selection-highlight-overview",stickiness:1,className:"selectionHighlight",overviewRuler:{color:ro(LL),position:Yl.Center},minimap:{color:ro(g5),position:ll.Inline}}),ZSt=Jt.register({description:"selection-highlight",stickiness:1,className:"selectionHighlight"}),QSt=Jt.register({description:"word-highlight",stickiness:1,className:"wordHighlight",overviewRuler:{color:ro(jSt),position:Yl.Center},minimap:{color:ro(g5),position:ll.Inline}});function JSt(i){return i===ND.Write?GSt:i===ND.Text?XSt:QSt}function ext(i){return i?ZSt:YSt}ju((i,e)=>{const t=i.getColor(xG);t&&e.addRule(`.monaco-editor .selectionHighlight { background-color: ${t.transparent(.5)}; }`)});var txt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},nxt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},SU;function n_(i,e){const t=e.filter(n=>!i.find(o=>o.equals(n)));if(t.length>=1){const n=t.map(r=>`line ${r.viewState.position.lineNumber} column ${r.viewState.position.column}`).join(", "),o=t.length===1?C("cursorAdded","Cursor added: {0}",n):C("cursorsAdded","Cursors added: {0}",n);Ev(o)}}class ixt extends ft{constructor(){super({id:"editor.action.insertCursorAbove",label:C("mutlicursor.insertAbove","Add Cursor Above"),alias:"Add Cursor Above",precondition:void 0,kbOpts:{kbExpr:Q.editorTextFocus,primary:2576,linux:{primary:1552,secondary:[3088]},weight:100},menuOpts:{menuId:Z.MenubarSelectionMenu,group:"3_multi",title:C({key:"miInsertCursorAbove",comment:["&& denotes a mnemonic"]},"&&Add Cursor Above"),order:2}})}run(e,t,n){if(!t.hasModel())return;let o=!0;n&&n.logicalLine===!1&&(o=!1);const r=t._getViewModel();if(r.cursorConfig.readOnly)return;r.model.pushStackElement();const s=r.getCursorStates();r.setCursorStates(n.source,3,Mr.addCursorUp(r,s,o)),r.revealTopMostCursor(n.source),n_(s,r.getCursorStates())}}class oxt extends ft{constructor(){super({id:"editor.action.insertCursorBelow",label:C("mutlicursor.insertBelow","Add Cursor Below"),alias:"Add Cursor Below",precondition:void 0,kbOpts:{kbExpr:Q.editorTextFocus,primary:2578,linux:{primary:1554,secondary:[3090]},weight:100},menuOpts:{menuId:Z.MenubarSelectionMenu,group:"3_multi",title:C({key:"miInsertCursorBelow",comment:["&& denotes a mnemonic"]},"A&&dd Cursor Below"),order:3}})}run(e,t,n){if(!t.hasModel())return;let o=!0;n&&n.logicalLine===!1&&(o=!1);const r=t._getViewModel();if(r.cursorConfig.readOnly)return;r.model.pushStackElement();const s=r.getCursorStates();r.setCursorStates(n.source,3,Mr.addCursorDown(r,s,o)),r.revealBottomMostCursor(n.source),n_(s,r.getCursorStates())}}class rxt extends ft{constructor(){super({id:"editor.action.insertCursorAtEndOfEachLineSelected",label:C("mutlicursor.insertAtEndOfEachLineSelected","Add Cursors to Line Ends"),alias:"Add Cursors to Line Ends",precondition:void 0,kbOpts:{kbExpr:Q.editorTextFocus,primary:1575,weight:100},menuOpts:{menuId:Z.MenubarSelectionMenu,group:"3_multi",title:C({key:"miInsertCursorAtEndOfEachLineSelected",comment:["&& denotes a mnemonic"]},"Add C&&ursors to Line Ends"),order:4}})}getCursorsForSelection(e,t,n){if(!e.isEmpty()){for(let o=e.startLineNumber;o1&&n.push(new gt(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn))}}run(e,t){if(!t.hasModel())return;const n=t.getModel(),o=t.getSelections(),r=t._getViewModel(),s=r.getCursorStates(),a=[];o.forEach(l=>this.getCursorsForSelection(l,n,a)),a.length>0&&t.setSelections(a),n_(s,r.getCursorStates())}}class sxt extends ft{constructor(){super({id:"editor.action.addCursorsToBottom",label:C("mutlicursor.addCursorsToBottom","Add Cursors To Bottom"),alias:"Add Cursors To Bottom",precondition:void 0})}run(e,t){if(!t.hasModel())return;const n=t.getSelections(),o=t.getModel().getLineCount(),r=[];for(let l=n[0].startLineNumber;l<=o;l++)r.push(new gt(l,n[0].startColumn,l,n[0].endColumn));const s=t._getViewModel(),a=s.getCursorStates();r.length>0&&t.setSelections(r),n_(a,s.getCursorStates())}}class axt extends ft{constructor(){super({id:"editor.action.addCursorsToTop",label:C("mutlicursor.addCursorsToTop","Add Cursors To Top"),alias:"Add Cursors To Top",precondition:void 0})}run(e,t){if(!t.hasModel())return;const n=t.getSelections(),o=[];for(let a=n[0].startLineNumber;a>=1;a--)o.push(new gt(a,n[0].startColumn,a,n[0].endColumn));const r=t._getViewModel(),s=r.getCursorStates();o.length>0&&t.setSelections(o),n_(s,r.getCursorStates())}}class vR{constructor(e,t,n){this.selections=e,this.revealRange=t,this.revealScrollType=n}}class Zk{static create(e,t){if(!e.hasModel())return null;const n=t.getState();if(!e.hasTextFocus()&&n.isRevealed&&n.searchString.length>0)return new Zk(e,t,!1,n.searchString,n.wholeWord,n.matchCase,null);let o=!1,r,s;const a=e.getSelections();a.length===1&&a[0].isEmpty()?(o=!0,r=!0,s=!0):(r=n.wholeWord,s=n.matchCase);const l=e.getSelection();let c,u=null;if(l.isEmpty()){const d=e.getConfiguredWordAtPosition(l.getStartPosition());if(!d)return null;c=d.word,u=new gt(l.startLineNumber,d.startColumn,l.startLineNumber,d.endColumn)}else c=e.getModel().getValueInRange(l).replace(/\r\n/g,` +`);return new Zk(e,t,o,c,r,s,u)}constructor(e,t,n,o,r,s,a){this._editor=e,this.findController=t,this.isDisconnectedFromFindController=n,this.searchText=o,this.wholeWord=r,this.matchCase=s,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 vR(t.concat(e),e,0)}moveSelectionToNextFindMatch(){if(!this._editor.hasModel())return null;const e=this._getNextMatch();if(!e)return null;const t=this._editor.getSelections();return new vR(t.slice(0,t.length-1).concat(e),e,0)}_getNextMatch(){if(!this._editor.hasModel())return null;if(this.currentMatch){const o=this.currentMatch;return this.currentMatch=null,o}this.findController.highlightFindOptions();const e=this._editor.getSelections(),t=e[e.length-1],n=this._editor.getModel().findNextMatch(this.searchText,t.getEndPosition(),!1,this.matchCase,this.wholeWord?this._editor.getOption(129):null,!1);return n?new gt(n.range.startLineNumber,n.range.startColumn,n.range.endLineNumber,n.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 vR(t.concat(e),e,0)}moveSelectionToPreviousFindMatch(){if(!this._editor.hasModel())return null;const e=this._getPreviousMatch();if(!e)return null;const t=this._editor.getSelections();return new vR(t.slice(0,t.length-1).concat(e),e,0)}_getPreviousMatch(){if(!this._editor.hasModel())return null;if(this.currentMatch){const o=this.currentMatch;return this.currentMatch=null,o}this.findController.highlightFindOptions();const e=this._editor.getSelections(),t=e[e.length-1],n=this._editor.getModel().findPreviousMatch(this.searchText,t.getStartPosition(),!1,this.matchCase,this.wholeWord?this._editor.getOption(129):null,!1);return n?new gt(n.range.startLineNumber,n.range.startColumn,n.range.endLineNumber,n.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(129):null,!1,1073741824):t.findMatches(this.searchText,!0,!1,this.matchCase,this.wholeWord?this._editor.getOption(129):null,!1,1073741824)}}class wb extends _e{static get(e){return e.getContribution(wb.ID)}constructor(e){super(),this._sessionDispose=this._register(new Be),this._editor=e,this._ignoreSelectionChange=!1,this._session=null}dispose(){this._endSession(),super.dispose()}_beginSessionIfNeeded(e){if(!this._session){const t=Zk.create(this._editor,e);if(!t)return;this._session=t;const n={searchString:this._session.searchText};this._session.isDisconnectedFromFindController&&(n.wholeWordOverride=1,n.matchCaseOverride=1,n.isRegexOverride=2),e.getState().change(n,!1),this._sessionDispose.add(this._editor.onDidChangeCursorSelection(o=>{this._ignoreSelectionChange||this._endSession()})),this._sessionDispose.add(this._editor.onDidBlurEditorText(()=>{this._endSession()})),this._sessionDispose.add(e.getState().onFindReplaceStateChange(o=>{(o.matchCase||o.wholeWord)&&this._endSession()}))}}_endSession(){if(this._sessionDispose.clear(),this._session&&this._session.isDisconnectedFromFindController){const e={wholeWordOverride:0,matchCaseOverride:0,isRegexOverride:0};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 n=this._editor.getConfiguredWordAtPosition(t.getStartPosition());return n?new gt(t.startLineNumber,n.startColumn,t.startLineNumber,n.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 o=e.getState().matchCase;if(!DSe(this._editor.getModel(),t,o)){const s=this._editor.getModel(),a=[];for(let l=0,c=t.length;l0&&n.isRegex){const o=this._editor.getModel();n.searchScope?t=o.findMatches(n.searchString,n.searchScope,n.isRegex,n.matchCase,n.wholeWord?this._editor.getOption(129):null,!1,1073741824):t=o.findMatches(n.searchString,!0,n.isRegex,n.matchCase,n.wholeWord?this._editor.getOption(129):null,!1,1073741824)}else{if(this._beginSessionIfNeeded(e),!this._session)return;t=this._session.selectAll(n.searchScope)}if(t.length>0){const o=this._editor.getSelection();for(let r=0,s=t.length;rnew gt(r.range.startLineNumber,r.range.startColumn,r.range.endLineNumber,r.range.endColumn)))}}}wb.ID="editor.contrib.multiCursorController";class AS extends ft{run(e,t){const n=wb.get(t);if(!n)return;const o=t._getViewModel();if(o){const r=o.getCursorStates(),s=ha.get(t);if(s)this._run(n,s);else{const a=e.get($t).createInstance(ha,t);this._run(n,a),a.dispose()}n_(r,o.getCursorStates())}}}class lxt extends AS{constructor(){super({id:"editor.action.addSelectionToNextFindMatch",label:C("addSelectionToNextFindMatch","Add Selection To Next Find Match"),alias:"Add Selection To Next Find Match",precondition:void 0,kbOpts:{kbExpr:Q.focus,primary:2082,weight:100},menuOpts:{menuId:Z.MenubarSelectionMenu,group:"3_multi",title:C({key:"miAddSelectionToNextFindMatch",comment:["&& denotes a mnemonic"]},"Add &&Next Occurrence"),order:5}})}_run(e,t){e.addSelectionToNextFindMatch(t)}}class cxt extends AS{constructor(){super({id:"editor.action.addSelectionToPreviousFindMatch",label:C("addSelectionToPreviousFindMatch","Add Selection To Previous Find Match"),alias:"Add Selection To Previous Find Match",precondition:void 0,menuOpts:{menuId:Z.MenubarSelectionMenu,group:"3_multi",title:C({key:"miAddSelectionToPreviousFindMatch",comment:["&& denotes a mnemonic"]},"Add P&&revious Occurrence"),order:6}})}_run(e,t){e.addSelectionToPreviousFindMatch(t)}}class uxt extends AS{constructor(){super({id:"editor.action.moveSelectionToNextFindMatch",label:C("moveSelectionToNextFindMatch","Move Last Selection To Next Find Match"),alias:"Move Last Selection To Next Find Match",precondition:void 0,kbOpts:{kbExpr:Q.focus,primary:Zo(2089,2082),weight:100}})}_run(e,t){e.moveSelectionToNextFindMatch(t)}}class dxt extends AS{constructor(){super({id:"editor.action.moveSelectionToPreviousFindMatch",label:C("moveSelectionToPreviousFindMatch","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 hxt extends AS{constructor(){super({id:"editor.action.selectHighlights",label:C("selectAllOccurrencesOfFindMatch","Select All Occurrences of Find Match"),alias:"Select All Occurrences of Find Match",precondition:void 0,kbOpts:{kbExpr:Q.focus,primary:3114,weight:100},menuOpts:{menuId:Z.MenubarSelectionMenu,group:"3_multi",title:C({key:"miSelectHighlights",comment:["&& denotes a mnemonic"]},"Select All &&Occurrences"),order:7}})}_run(e,t){e.selectAll(t)}}class fxt extends AS{constructor(){super({id:"editor.action.changeAll",label:C("changeAll.label","Change All Occurrences"),alias:"Change All Occurrences",precondition:Me.and(Q.writable,Q.editorTextFocus),kbOpts:{kbExpr:Q.editorTextFocus,primary:2108,weight:100},contextMenuOpts:{group:"1_modification",order:1.2}})}_run(e,t){e.selectAll(t)}}class gxt{constructor(e,t,n,o,r){this._model=e,this._searchText=t,this._matchCase=n,this._wordSeparators=o,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(V.compareRangesUsingStarts)),this._cachedFindMatches}}let Qk=SU=class extends _e{constructor(e,t){super(),this._languageFeaturesService=t,this.editor=e,this._isEnabled=e.getOption(107),this._decorations=e.createDecorationsCollection(),this.updateSoon=this._register(new bi(()=>this._update(),300)),this.state=null,this._register(e.onDidChangeConfiguration(o=>{this._isEnabled=e.getOption(107)})),this._register(e.onDidChangeCursorSelection(o=>{!this._isEnabled||(o.selection.isEmpty()?o.reason===3?(this.state&&this._setState(null),this.updateSoon.schedule()):this._setState(null):this._update())})),this._register(e.onDidChangeModel(o=>{this._setState(null)})),this._register(e.onDidChangeModelContent(o=>{this._isEnabled&&this.updateSoon.schedule()}));const n=ha.get(e);n&&this._register(n.getState().onFindReplaceStateChange(o=>{this._update()})),this.updateSoon.schedule()}_update(){this._setState(SU._createState(this.state,this._isEnabled,this.editor))}static _createState(e,t,n){if(!t||!n.hasModel())return null;const o=n.getSelection();if(o.startLineNumber!==o.endLineNumber)return null;const r=wb.get(n);if(!r)return null;const s=ha.get(n);if(!s)return null;let a=r.getSession(s);if(!a){const u=n.getSelections();if(u.length>1){const h=s.getState().matchCase;if(!DSe(n.getModel(),u,h))return null}a=Zk.create(n,s)}if(!a||a.currentMatch||/^[ \t]+$/.test(a.searchText)||a.searchText.length>200)return null;const l=s.getState(),c=l.matchCase;if(l.isRevealed){let u=l.searchString;c||(u=u.toLowerCase());let d=a.searchText;if(c||(d=d.toLowerCase()),u===d&&a.matchCase===l.matchCase&&a.wholeWord===l.wholeWord&&!l.isRegex)return null}return new gxt(n.getModel(),a.searchText,a.matchCase,a.wholeWord?n.getOption(129):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 n=this.state.findMatches(),o=this.editor.getSelections();o.sort(V.compareRangesUsingStarts);const r=[];for(let l=0,c=0,u=n.length,d=o.length;l=d)r.push(h),l++;else{const f=V.compareRangesUsingStarts(h,o[c]);f<0?((o[c].isEmpty()||!V.areIntersecting(h,o[c]))&&r.push(h),l++):(f>0||l++,c++)}}const s=this._languageFeaturesService.documentHighlightProvider.has(t)&&this.editor.getOption(80),a=r.map(l=>({range:l,options:ext(s)}));this._decorations.set(a)}dispose(){this._setState(null),super.dispose()}};Qk.ID="editor.contrib.selectionHighlighter";Qk=SU=txt([nxt(1,pt)],Qk);function DSe(i,e,t){const n=$ce(i,e[0],!t);for(let o=1,r=e.length;okSe(void 0,void 0,void 0,function*(){const[t,n,o]=e;fi(Rt.isUri(t)),fi(ae.isIPosition(n)),fi(typeof o=="string"||!o);const r=i.get(pt),s=yield i.get(za).createModelReference(t);try{const a=yield ISe(r.signatureHelpProvider,s.object.textEditorModel,ae.lift(n),{triggerKind:lf.Invoke,isRetrigger:!1,triggerCharacter:o},_n.None);return a?(setTimeout(()=>a.dispose(),0),a.value):void 0}finally{s.dispose()}}));var vxt=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},om;(function(i){i.Default={type:0};class e{constructor(o,r){this.request=o,this.previouslyActiveHints=r,this.type=2}}i.Pending=e;class t{constructor(o){this.hints=o,this.type=1}}i.Active=t})(om||(om={}));class $F extends _e{constructor(e,t,n=$F.DEFAULT_DELAY){super(),this._onChangedHints=this._register(new le),this.onChangedHints=this._onChangedHints.event,this.triggerOnType=!1,this._state=om.Default,this._pendingTriggers=[],this._lastSignatureHelpResult=this._register(new Kr),this.triggerChars=new QA,this.retriggerChars=new QA,this.triggerId=0,this.editor=e,this.providers=t,this.throttledDelayer=new Wu(n),this._register(this.editor.onDidBlurEditorWidget(()=>this.cancel())),this._register(this.editor.onDidChangeConfiguration(()=>this.onEditorConfigurationChange())),this._register(this.editor.onDidChangeModel(o=>this.onModelChanged())),this._register(this.editor.onDidChangeModelLanguage(o=>this.onModelChanged())),this._register(this.editor.onDidChangeCursorSelection(o=>this.onCursorChange(o))),this._register(this.editor.onDidChangeModelContent(o=>this.onModelContentChange())),this._register(this.providers.onDidChange(this.onModelChanged,this)),this._register(this.editor.onDidType(o=>this.onDidType(o))),this.onEditorConfigurationChange(),this.onModelChanged()}get state(){return this._state}set state(e){this._state.type===2&&this._state.request.cancel(),this._state=e}cancel(e=!1){this.state=om.Default,this.throttledDelayer.cancel(),e||this._onChangedHints.fire(void 0)}trigger(e,t){const n=this.editor.getModel();if(!n||!this.providers.has(n))return;const o=++this.triggerId;this._pendingTriggers.push(e),this.throttledDelayer.trigger(()=>this.doTrigger(o),t).catch(en)}next(){if(this.state.type!==1)return;const e=this.state.hints.signatures.length,t=this.state.hints.activeSignature,n=t%e===e-1,o=this.editor.getOption(85).cycle;if((e<2||n)&&!o){this.cancel();return}this.updateActiveSignature(n&&o?0:t+1)}previous(){if(this.state.type!==1)return;const e=this.state.hints.signatures.length,t=this.state.hints.activeSignature,n=t===0,o=this.editor.getOption(85).cycle;if((e<2||n)&&!o){this.cancel();return}this.updateActiveSignature(n&&o?e-1:t-1)}updateActiveSignature(e){this.state.type===1&&(this.state=new om.Active(Object.assign(Object.assign({},this.state.hints),{activeSignature:e})),this._onChangedHints.fire(this.state.hints))}doTrigger(e){return vxt(this,void 0,void 0,function*(){const t=this.state.type===1||this.state.type===2,n=this.getLastActiveHints();if(this.cancel(!0),this._pendingTriggers.length===0)return!1;const o=this._pendingTriggers.reduce(_xt);this._pendingTriggers=[];const r={triggerKind:o.triggerKind,triggerCharacter:o.triggerCharacter,isRetrigger:t,activeSignatureHelp:n};if(!this.editor.hasModel())return!1;const s=this.editor.getModel(),a=this.editor.getPosition();this.state=new om.Pending(sr(l=>ISe(this.providers,s,a,r,l)),n);try{const l=yield this.state.request;return e!==this.triggerId?(l==null||l.dispose(),!1):!l||!l.value.signatures||l.value.signatures.length===0?(l==null||l.dispose(),this._lastSignatureHelpResult.clear(),this.cancel(),!1):(this.state=new om.Active(l.value),this._lastSignatureHelpResult.value=l,this._onChangedHints.fire(this.state.hints),!0)}catch(l){return e===this.triggerId&&(this.state=om.Default),en(l),!1}})}getLastActiveHints(){switch(this.state.type){case 1:return this.state.hints;case 2:return this.state.previouslyActiveHints;default:return}}get isTriggered(){return this.state.type===1||this.state.type===2||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 n of t.signatureHelpTriggerCharacters||[])if(n.length){const o=n.charCodeAt(0);this.triggerChars.add(o),this.retriggerChars.add(o)}for(const n of t.signatureHelpRetriggerCharacters||[])n.length&&this.retriggerChars.add(n.charCodeAt(0))}}onDidType(e){if(!this.triggerOnType)return;const t=e.length-1,n=e.charCodeAt(t);(this.triggerChars.has(n)||this.isTriggered&&this.retriggerChars.has(n))&&this.trigger({triggerKind:lf.TriggerCharacter,triggerCharacter:e.charAt(t)})}onCursorChange(e){e.source==="mouse"?this.cancel():this.isTriggered&&this.trigger({triggerKind:lf.ContentChange})}onModelContentChange(){this.isTriggered&&this.trigger({triggerKind:lf.ContentChange})}onEditorConfigurationChange(){this.triggerOnType=this.editor.getOption(85).enabled,this.triggerOnType||this.cancel()}dispose(){this.cancel(!0),super.dispose()}}$F.DEFAULT_DELAY=120;function _xt(i,e){switch(e.triggerKind){case lf.Invoke:return e;case lf.ContentChange:return i;case lf.TriggerCharacter:default:return e}}var bxt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},_7=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},xU;const El=He,Cxt=Eo("parameter-hints-next",Xe.chevronDown,C("parameterHintsNextIcon","Icon for show next parameter hint.")),yxt=Eo("parameter-hints-previous",Xe.chevronUp,C("parameterHintsPreviousIcon","Icon for show previous parameter hint."));let NO=xU=class extends _e{constructor(e,t,n,o,r){super(),this.editor=e,this.model=t,this.renderDisposeables=this._register(new Be),this.visible=!1,this.announcedLabel=null,this.allowEditorOverflow=!0,this.markdownRenderer=this._register(new up({editor:e},r,o)),this.keyVisible=Sb.Visible.bindTo(n),this.keyMultipleSignatures=Sb.MultipleSignatures.bindTo(n)}createParameterHintDOMNodes(){const e=El(".editor-widget.parameter-hints-widget"),t=Ae(e,El(".phwrapper"));t.tabIndex=-1;const n=Ae(t,El(".controls")),o=Ae(n,El(".button"+Mt.asCSSSelector(yxt))),r=Ae(n,El(".overloads")),s=Ae(n,El(".button"+Mt.asCSSSelector(Cxt)));this._register(ke(o,"click",h=>{dn.stop(h),this.previous()})),this._register(ke(s,"click",h=>{dn.stop(h),this.next()}));const a=El(".body"),l=new YI(a,{alwaysConsumeMouseWheel:!0});this._register(l),t.appendChild(l.getDomNode());const c=Ae(a,El(".signature")),u=Ae(a,El(".docs"));e.style.userSelect="text",this.domNodes={element:e,signature:c,overloads:r,docs:u,scrollbar:l},this.editor.addContentWidget(this),this.hide(),this._register(this.editor.onDidChangeCursorSelection(h=>{this.visible&&this.editor.layoutContentWidget(this)}));const d=()=>{if(!this.domNodes)return;const h=this.editor.getOption(50);this.domNodes.element.style.fontSize=`${h.fontSize}px`,this.domNodes.element.style.lineHeight=`${h.lineHeight/h.fontSize}`};d(),this._register(st.chain(this.editor.onDidChangeConfiguration.bind(this.editor),h=>h.filter(f=>f.hasChanged(50)))(d)),this._register(this.editor.onDidLayoutChange(h=>this.updateMaxHeight())),this.updateMaxHeight()}show(){this.visible||(this.domNodes||this.createParameterHintDOMNodes(),this.keyVisible.set(!0),this.visible=!0,setTimeout(()=>{var e;(e=this.domNodes)===null||e===void 0||e.element.classList.add("visible")},100),this.editor.layoutContentWidget(this))}hide(){var e;this.renderDisposeables.clear(),this.visible&&(this.keyVisible.reset(),this.visible=!1,this.announcedLabel=null,(e=this.domNodes)===null||e===void 0||e.element.classList.remove("visible"),this.editor.layoutContentWidget(this))}getPosition(){return this.visible?{position:this.editor.getPosition(),preference:[1,2]}:null}render(e){var t;if(this.renderDisposeables.clear(),!this.domNodes)return;const n=e.signatures.length>1;this.domNodes.element.classList.toggle("multiple",n),this.keyMultipleSignatures.set(n),this.domNodes.signature.innerText="",this.domNodes.docs.innerText="";const o=e.signatures[e.activeSignature];if(!o)return;const r=Ae(this.domNodes.signature,El(".code")),s=this.editor.getOption(50);r.style.fontSize=`${s.fontSize}px`,r.style.fontFamily=s.fontFamily;const a=o.parameters.length>0,l=(t=o.activeParameter)!==null&&t!==void 0?t:e.activeParameter;if(a)this.renderParameters(r,o,l);else{const d=Ae(r,El("span"));d.textContent=o.label}const c=o.parameters[l];if(c!=null&&c.documentation){const d=El("span.documentation");if(typeof c.documentation=="string")d.textContent=c.documentation;else{const h=this.renderMarkdownDocs(c.documentation);d.appendChild(h.element)}Ae(this.domNodes.docs,El("p",{},d))}if(o.documentation!==void 0)if(typeof o.documentation=="string")Ae(this.domNodes.docs,El("p",{},o.documentation));else{const d=this.renderMarkdownDocs(o.documentation);Ae(this.domNodes.docs,d.element)}const u=this.hasDocs(o,c);if(this.domNodes.signature.classList.toggle("has-docs",u),this.domNodes.docs.classList.toggle("empty",!u),this.domNodes.overloads.textContent=String(e.activeSignature+1).padStart(e.signatures.length.toString().length,"0")+"/"+e.signatures.length,c){let d="";const h=o.parameters[l];Array.isArray(h.label)?d=o.label.substring(h.label[0],h.label[1]):d=h.label,h.documentation&&(d+=typeof h.documentation=="string"?`, ${h.documentation}`:`, ${h.documentation.value}`),o.documentation&&(d+=typeof o.documentation=="string"?`, ${o.documentation}`:`, ${o.documentation.value}`),this.announcedLabel!==d&&(Cs(C("hint","{0}, hint",d)),this.announcedLabel=d)}this.editor.layoutContentWidget(this),this.domNodes.scrollbar.scanDomNode()}renderMarkdownDocs(e){const t=this.renderDisposeables.add(this.markdownRenderer.render(e,{asyncRenderCallback:()=>{var n;(n=this.domNodes)===null||n===void 0||n.scrollbar.scanDomNode()}}));return t.element.classList.add("markdown-docs"),t}hasDocs(e,t){return!!(t&&typeof t.documentation=="string"&&a0(t.documentation).length>0||t&&typeof t.documentation=="object"&&a0(t.documentation).value.length>0||e.documentation&&typeof e.documentation=="string"&&a0(e.documentation).length>0||e.documentation&&typeof e.documentation=="object"&&a0(e.documentation.value).length>0)}renderParameters(e,t,n){const[o,r]=this.getParameterLabelOffsets(t,n),s=document.createElement("span");s.textContent=t.label.substring(0,o);const a=document.createElement("span");a.textContent=t.label.substring(o,r),a.className="parameter active";const l=document.createElement("span");l.textContent=t.label.substring(r),Ae(e,s,a,l)}getParameterLabelOffsets(e,t){const n=e.parameters[t];if(n){if(Array.isArray(n.label))return n.label;if(n.label.length){const o=new RegExp(`(\\W|^)${Xl(n.label)}(?=\\W|$)`,"g");o.test(e.label);const r=o.lastIndex-n.label.length;return r>=0?[r,o.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 xU.ID}updateMaxHeight(){if(!this.domNodes)return;const t=`${Math.max(this.editor.getLayoutInfo().height/4,250)}px`;this.domNodes.element.style.maxHeight=t;const n=this.domNodes.element.getElementsByClassName("phwrapper");n.length&&(n[0].style.maxHeight=t)}};NO.ID="editor.widget.parameterHintsWidget";NO=xU=bxt([_7(2,Ut),_7(3,ml),_7(4,Ki)],NO);J("editorHoverWidget.highlightForeground",{dark:xu,light:xu,hcDark:xu,hcLight:xu},C("editorHoverWidgetHighlightForeground","Foreground color of the active item in the parameter hint."));var wxt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},zce=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},LU;let xb=LU=class extends _e{static get(e){return e.getContribution(LU.ID)}constructor(e,t,n){super(),this.editor=e,this.model=this._register(new $F(e,n.signatureHelpProvider)),this._register(this.model.onChangedHints(o=>{var r;o?(this.widget.value.show(),this.widget.value.render(o)):(r=this.widget.rawValue)===null||r===void 0||r.hide()})),this.widget=new ah(()=>this._register(t.createInstance(NO,this.editor,this.model)))}cancel(){this.model.cancel()}previous(){var e;(e=this.widget.rawValue)===null||e===void 0||e.previous()}next(){var e;(e=this.widget.rawValue)===null||e===void 0||e.next()}trigger(e){this.model.trigger(e,0)}};xb.ID="editor.controller.parameterHints";xb=LU=wxt([zce(1,$t),zce(2,pt)],xb);class Sxt extends ft{constructor(){super({id:"editor.action.triggerParameterHints",label:C("parameterHints.trigger.label","Trigger Parameter Hints"),alias:"Trigger Parameter Hints",precondition:Q.hasSignatureHelpProvider,kbOpts:{kbExpr:Q.editorTextFocus,primary:3082,weight:100}})}run(e,t){const n=xb.get(t);n==null||n.trigger({triggerKind:lf.Invoke})}}zn(xb.ID,xb,2);ze(Sxt);const WY=100+75,VY=Ir.bindToContribution(xb.get);Ye(new VY({id:"closeParameterHints",precondition:Sb.Visible,handler:i=>i.cancel(),kbOpts:{weight:WY,kbExpr:Q.focus,primary:9,secondary:[1033]}}));Ye(new VY({id:"showPrevParameterHint",precondition:Me.and(Sb.Visible,Sb.MultipleSignatures),handler:i=>i.previous(),kbOpts:{weight:WY,kbExpr:Q.focus,primary:16,secondary:[528],mac:{primary:16,secondary:[528,302]}}}));Ye(new VY({id:"showNextParameterHint",precondition:Me.and(Sb.Visible,Sb.MultipleSignatures),handler:i=>i.next(),kbOpts:{weight:WY,kbExpr:Q.focus,primary:18,secondary:[530],mac:{primary:18,secondary:[530,300]}}}));var xxt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},b7=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const zF=new lt("renameInputVisible",!1,C("renameInputVisible","Whether the rename input widget is visible"));let EU=class{constructor(e,t,n,o,r){this._editor=e,this._acceptKeybindings=t,this._themeService=n,this._keybindingService=o,this._disposables=new Be,this.allowEditorOverflow=!0,this._visibleContextKey=zF.bindTo(r),this._editor.addContentWidget(this),this._disposables.add(this._editor.onDidChangeConfiguration(s=>{s.hasChanged(50)&&this._updateFont()})),this._disposables.add(n.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._input=document.createElement("input"),this._input.className="rename-input",this._input.type="text",this._input.setAttribute("aria-label",C("renameAriaLabel","Rename input. Type new name and press Enter to commit.")),this._domNode.appendChild(this._input),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){var t,n,o,r;if(!this._input||!this._domNode)return;const s=e.getColor(Gh),a=e.getColor(yG);this._domNode.style.backgroundColor=String((t=e.getColor(po))!==null&&t!==void 0?t:""),this._domNode.style.boxShadow=s?` 0 0 8px 2px ${s}`:"",this._domNode.style.border=a?`1px solid ${a}`:"",this._domNode.style.color=String((n=e.getColor(ibe))!==null&&n!==void 0?n:""),this._input.style.backgroundColor=String((o=e.getColor(nbe))!==null&&o!==void 0?o:"");const l=e.getColor(obe);this._input.style.borderWidth=l?"1px":"0px",this._input.style.borderStyle=l?"solid":"none",this._input.style.borderColor=(r=l==null?void 0:l.toString())!==null&&r!==void 0?r:"none"}_updateFont(){if(!this._input||!this._label)return;const e=this._editor.getOption(50);this._input.style.fontFamily=e.fontFamily,this._input.style.fontWeight=e.fontWeight,this._input.style.fontSize=`${e.fontSize}px`,this._label.style.fontSize=`${e.fontSize*.8}px`}getPosition(){return this._visible?{position:this._position,preference:[2,1]}:null}beforeRender(){var e,t;const[n,o]=this._acceptKeybindings;return this._label.innerText=C({key:"label",comment:['placeholders are keybindings, e.g "F2 to Rename, Shift+F2 to Preview"']},"{0} to Rename, {1} to Preview",(e=this._keybindingService.lookupKeybinding(n))===null||e===void 0?void 0:e.getLabel(),(t=this._keybindingService.lookupKeybinding(o))===null||t===void 0?void 0:t.getLabel()),null}afterRender(e){e||this.cancelInput(!0)}acceptInput(e){var t;(t=this._currentAcceptInput)===null||t===void 0||t.call(this,e)}cancelInput(e){var t;(t=this._currentCancelInput)===null||t===void 0||t.call(this,e)}getInput(e,t,n,o,r,s){this._domNode.classList.toggle("preview",r),this._position=new ae(e.startLineNumber,e.startColumn),this._input.value=t,this._input.setAttribute("selectionStart",n.toString()),this._input.setAttribute("selectionEnd",o.toString()),this._input.size=Math.max((e.endColumn-e.startColumn)*1.1,20);const a=new Be;return new Promise(l=>{this._currentCancelInput=c=>(this._currentAcceptInput=void 0,this._currentCancelInput=void 0,l(c),!0),this._currentAcceptInput=c=>{if(this._input.value.trim().length===0||this._input.value===t){this.cancelInput(!0);return}this._currentAcceptInput=void 0,this._currentCancelInput=void 0,l({newName:this._input.value,wantsPreview:r&&c})},a.add(s.onCancellationRequested(()=>this.cancelInput(!0))),a.add(this._editor.onDidBlurEditorWidget(()=>{var c;return this.cancelInput(!(!((c=this._domNode)===null||c===void 0)&&c.ownerDocument.hasFocus()))})),this._show()}).finally(()=>{a.dispose(),this._hide()})}_show(){this._editor.revealLineInCenterIfOutsideViewport(this._position.lineNumber,0),this._visible=!0,this._visibleContextKey.set(!0),this._editor.layoutContentWidget(this),setTimeout(()=>{this._input.focus(),this._input.setSelectionRange(parseInt(this._input.getAttribute("selectionStart")),parseInt(this._input.getAttribute("selectionEnd")))},100)}_hide(){this._visible=!1,this._visibleContextKey.reset(),this._editor.layoutContentWidget(this)}};EU=xxt([b7(2,vr),b7(3,xi),b7(4,Ut)],EU);var Lxt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},S_=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},O0=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},DU;class HY{constructor(e,t,n){this.model=e,this.position=t,this._providerRenameIdx=0,this._providers=n.ordered(e)}hasProvider(){return this._providers.length>0}resolveRenameLocation(e){return O0(this,void 0,void 0,function*(){const t=[];for(this._providerRenameIdx=0;this._providerRenameIdx0?t.join(` `):void 0}:{range:V.fromPositions(this.position),text:"",rejectReason:t.length>0?t.join(` -`):void 0}})}provideRenameEdits(e,t){return P0(this,void 0,void 0,function*(){return this._provideRenameEdits(e,this._providerRenameIdx,[],t)})}_provideRenameEdits(e,t,n,o){return P0(this,void 0,void 0,function*(){const r=this._providers[t];if(!r)return{edits:[],rejectReason:n.join(` -`)};const s=yield r.provideRenameEdits(this.model,this.position,e,o);if(s){if(s.rejectReason)return this._provideRenameEdits(e,t+1,n.concat(s.rejectReason),o)}else return this._provideRenameEdits(e,t+1,n.concat(C("no result","No result.")),o);return s})}}function Cxt(i,e,t,n){return P0(this,void 0,void 0,function*(){const o=new AY(e,t,i),r=yield o.resolveRenameLocation(_n.None);return r!=null&&r.rejectReason?{edits:[],rejectReason:r.rejectReason}:o.provideRenameEdits(n,_n.None)})}let xb=SU=class{static get(e){return e.getContribution(SU.ID)}constructor(e,t,n,o,r,s,a,l){this.editor=e,this._instaService=t,this._notificationService=n,this._bulkEditService=o,this._progressService=r,this._logService=s,this._configService=a,this._languageFeaturesService=l,this._disposableStore=new Be,this._cts=new Ro,this._renameInputField=this._disposableStore.add(this._instaService.createInstance(yU,this.editor,["acceptRenameInput","acceptRenameInputWithPreview"]))}dispose(){this._disposableStore.dispose(),this._cts.dispose(!0)}run(){var e,t;return P0(this,void 0,void 0,function*(){if(this._cts.dispose(!0),this._cts=new Ro,!this.editor.hasModel())return;const n=this.editor.getPosition(),o=new AY(this.editor.getModel(),n,this._languageFeaturesService.renameProvider);if(!o.hasProvider())return;const r=new Nv(this.editor,5,void 0,this._cts.token);let s;try{const g=o.resolveRenameLocation(r.token);this._progressService.showWhile(g,250),s=yield g}catch(g){(e=ll.get(this.editor))===null||e===void 0||e.showMessage(g||C("resolveRenameLocationFailed","An unknown error occurred while resolving rename location"),n);return}finally{r.dispose()}if(!s)return;if(s.rejectReason){(t=ll.get(this.editor))===null||t===void 0||t.showMessage(s.rejectReason,n);return}if(r.token.isCancellationRequested)return;const a=new Nv(this.editor,5,s.range,this._cts.token),l=this.editor.getSelection();let c=0,u=s.text.length;!V.isEmpty(l)&&!V.spansMultipleLines(l)&&V.containsRange(s.range,l)&&(c=Math.max(0,l.startColumn-s.range.startColumn),u=Math.min(s.range.endColumn,l.endColumn)-s.range.startColumn);const d=this._bulkEditService.hasPreviewHandler()&&this._configService.getValue(this.editor.getModel().uri,"editor.rename.enablePreview"),h=yield this._renameInputField.getInput(s.range,s.text,c,u,d,a.token);if(typeof h=="boolean"){h&&this.editor.focus(),a.dispose();return}this.editor.focus();const f=e5(o.provideRenameEdits(h.newName,a.token),a.token).then(g=>P0(this,void 0,void 0,function*(){if(!(!g||!this.editor.hasModel())){if(g.rejectReason){this._notificationService.info(g.rejectReason);return}this.editor.setSelection(V.fromPositions(this.editor.getSelection().getPosition())),this._bulkEditService.apply(g,{editor:this.editor,showPreview:h.wantsPreview,label:C("label","Renaming '{0}' to '{1}'",s==null?void 0:s.text,h.newName),code:"undoredo.rename",quotableLabel:C("quotableLabel","Renaming {0} to {1}",s==null?void 0:s.text,h.newName),respectAutoSaveConfig:!0}).then(p=>{p.ariaSummary&&bs(C("aria","Successfully renamed '{0}' to '{1}'. Summary: {2}",s.text,h.newName,p.ariaSummary))}).catch(p=>{this._notificationService.error(C("rename.failedApply","Rename failed to apply edits")),this._logService.error(p)})}}),g=>{this._notificationService.error(C("rename.failed","Rename failed to compute edits")),this._logService.error(g)}).finally(()=>{a.dispose()});return this._progressService.showWhile(f,250),f})}acceptRenameInput(e){this._renameInputField.acceptInput(e)}cancelRenameInput(){this._renameInputField.cancelInput(!0)}};xb.ID="editor.contrib.renameController";xb=SU=bxt([S_(1,$t),S_(2,Ao),S_(3,eT),S_(4,Jv),S_(5,tc),S_(6,sG),S_(7,pt)],xb);class wxt extends ft{constructor(){super({id:"editor.action.rename",label:C("rename.label","Rename Symbol"),alias:"Rename Symbol",precondition:Me.and(Q.writable,Q.hasRenameProvider),kbOpts:{kbExpr:Q.editorTextFocus,primary:60,weight:100},contextMenuOpts:{group:"1_modification",order:1.1}})}runCommand(e,t){const n=e.get(Jn),[o,r]=Array.isArray(t)&&t||[void 0,void 0];return Rt.isUri(o)&&ae.isIPosition(r)?n.openCodeEditor({resource:o},n.getActiveCodeEditor()).then(s=>{!s||(s.setPosition(r),s.invokeWithinContext(a=>(this.reportTelemetry(a,s),this.run(a,s))))},en):super.runCommand(e,t)}run(e,t){const n=xb.get(t);return n?n.run():Promise.resolve()}}zn(xb.ID,xb,4);ze(wxt);const PY=Ir.bindToContribution(xb.get);Ye(new PY({id:"acceptRenameInput",precondition:$F,handler:i=>i.acceptRenameInput(!1),kbOpts:{weight:100+99,kbExpr:Me.and(Q.focus,Me.not("isComposing")),primary:3}}));Ye(new PY({id:"acceptRenameInputWithPreview",precondition:Me.and($F,Me.has("config.editor.rename.enablePreview")),handler:i=>i.acceptRenameInput(!0),kbOpts:{weight:100+99,kbExpr:Me.and(Q.focus,Me.not("isComposing")),primary:1024+3}}));Ye(new PY({id:"cancelRenameInput",precondition:$F,handler:i=>i.cancelRenameInput(),kbOpts:{weight:100+99,kbExpr:Q.focus,primary:9,secondary:[1033]}}));Nf("_executeDocumentRenameProvider",function(i,e,t,...n){const[o]=n;fi(typeof o=="string");const{renameProvider:r}=i.get(pt);return Cxt(r,e,t,o)});Nf("_executePrepareRename",function(i,e,t){return P0(this,void 0,void 0,function*(){const{renameProvider:n}=i.get(pt),r=yield new AY(e,t,n).resolveRenameLocation(_n.None);if(r!=null&&r.rejectReason)throw new Error(r.rejectReason);return r})});no.as(ah.Configuration).registerConfiguration({id:"editor",properties:{"editor.rename.enablePreview":{scope:5,description:C("enablePreview","Enable/disable the ability to preview changes before renaming"),default:!0,type:"boolean"}}});function yxt(i){for(let e=0,t=i.length;e0?t[0]:[]}function LSe(i,e,t,n,o){return $v(this,void 0,void 0,function*(){const r=Ext(i,e),s=yield Promise.all(r.map(a=>$v(this,void 0,void 0,function*(){let l,c=null;try{l=yield a.provideDocumentSemanticTokens(e,a===t?n:null,o)}catch(u){c=u,l=null}return(!l||!zF(l)&&!SSe(l))&&(l=null),new Lxt(a,l,c)})));for(const a of s){if(a.error)throw a.error;if(a.tokens)return a}return s.length>0?s[0]:null})}function Dxt(i,e){const t=i.orderedGroups(e);return t.length>0?t[0]:null}class kxt{constructor(e,t){this.provider=e,this.tokens=t}}function Ixt(i,e){return i.has(e)}function ESe(i,e){const t=i.orderedGroups(e);return t.length>0?t[0]:[]}function OY(i,e,t,n){return $v(this,void 0,void 0,function*(){const o=ESe(i,e),r=yield Promise.all(o.map(s=>$v(this,void 0,void 0,function*(){let a;try{a=yield s.provideDocumentRangeSemanticTokens(e,t,n)}catch(l){$o(l),a=null}return(!a||!zF(a))&&(a=null),new kxt(s,a)})));for(const s of r)if(s.tokens)return s;return r.length>0?r[0]:null})}Rn.registerCommand("_provideDocumentSemanticTokensLegend",(i,...e)=>$v(void 0,void 0,void 0,function*(){const[t]=e;fi(t instanceof Rt);const n=i.get(Yi).getModel(t);if(!n)return;const{documentSemanticTokensProvider:o}=i.get(pt),r=Dxt(o,n);return r?r[0].getLegend():i.get(_o).executeCommand("_provideDocumentRangeSemanticTokensLegend",t)}));Rn.registerCommand("_provideDocumentSemanticTokens",(i,...e)=>$v(void 0,void 0,void 0,function*(){const[t]=e;fi(t instanceof Rt);const n=i.get(Yi).getModel(t);if(!n)return;const{documentSemanticTokensProvider:o}=i.get(pt);if(!xSe(o,n))return i.get(_o).executeCommand("_provideDocumentRangeSemanticTokens",t,n.getFullModelRange());const r=yield LSe(o,n,null,null,_n.None);if(!r)return;const{provider:s,tokens:a}=r;if(!a||!zF(a))return;const l=ySe({id:0,type:"full",data:a.data});return a.resultId&&s.releaseDocumentSemanticTokens(a.resultId),l}));Rn.registerCommand("_provideDocumentRangeSemanticTokensLegend",(i,...e)=>$v(void 0,void 0,void 0,function*(){const[t,n]=e;fi(t instanceof Rt);const o=i.get(Yi).getModel(t);if(!o)return;const{documentRangeSemanticTokensProvider:r}=i.get(pt),s=ESe(r,o);if(s.length===0)return;if(s.length===1)return s[0].getLegend();if(!n||!V.isIRange(n))return console.warn("provideDocumentRangeSemanticTokensLegend might be out-of-sync with provideDocumentRangeSemanticTokens unless a range argument is passed in"),s[0].getLegend();const a=yield OY(r,o,V.lift(n),_n.None);if(!!a)return a.provider.getLegend()}));Rn.registerCommand("_provideDocumentRangeSemanticTokens",(i,...e)=>$v(void 0,void 0,void 0,function*(){const[t,n]=e;fi(t instanceof Rt),fi(V.isIRange(n));const o=i.get(Yi).getModel(t);if(!o)return;const{documentRangeSemanticTokensProvider:r}=i.get(pt),s=yield OY(r,o,V.lift(n),_n.None);if(!(!s||!s.tokens))return ySe({id:0,type:"full",data:s.tokens.data})}));const FY="editor.semanticHighlighting";function xU(i,e,t){var n;const o=(n=t.getValue(FY,{overrideIdentifier:i.getLanguageId(),resource:i.uri}))===null||n===void 0?void 0:n.enabled;return typeof o=="boolean"?o:e.getColorTheme().semanticHighlighting}var DSe=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Ih=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},Yp;let LU=class extends _e{constructor(e,t,n,o,r,s){super(),this._watchers=Object.create(null);const a=u=>{this._watchers[u.uri.toString()]=new Jk(u,e,n,r,s)},l=(u,d)=>{d.dispose(),delete this._watchers[u.uri.toString()]},c=()=>{for(const u of t.getModels()){const d=this._watchers[u.uri.toString()];xU(u,n,o)?d||a(u):d&&l(u,d)}};this._register(t.onModelAdded(u=>{xU(u,n,o)&&a(u)})),this._register(t.onModelRemoved(u=>{const d=this._watchers[u.uri.toString()];d&&l(u,d)})),this._register(o.onDidChangeConfiguration(u=>{u.affectsConfiguration(FY)&&c()})),this._register(n.onDidColorThemeChange(c))}dispose(){for(const e of Object.values(this._watchers))e.dispose();super.dispose()}};LU=DSe([Ih(0,E5),Ih(1,Yi),Ih(2,mr),Ih(3,En),Ih(4,Kc),Ih(5,pt)],LU);let Jk=Yp=class extends _e{constructor(e,t,n,o,r){super(),this._semanticTokensStylingService=t,this._isDisposed=!1,this._model=e,this._provider=r.documentSemanticTokensProvider,this._debounceInformation=o.for(this._provider,"DocumentSemanticTokens",{min:Yp.REQUEST_MIN_DELAY,max:Yp.REQUEST_MAX_DELAY}),this._fetchDocumentSemanticTokens=this._register(new bi(()=>this._fetchDocumentSemanticTokensNow(),Yp.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 s=()=>{si(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)}))};s(),this._register(this._provider.onDidChange(()=>{s(),this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))})),this._register(n.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),si(this._documentProvidersChangeListeners),this._documentProvidersChangeListeners=[],this._setDocumentSemanticTokens(null,null,null,[]),this._isDisposed=!0,super.dispose()}_fetchDocumentSemanticTokensNow(){if(this._currentDocumentRequestCancellationTokenSource)return;if(!xSe(this._provider,this._model)){this._currentDocumentResponse&&this._model.tokenization.setSemanticTokens(null,!1);return}if(!this._model.isAttachedToEditor())return;const e=new Ro,t=this._currentDocumentResponse?this._currentDocumentResponse.provider:null,n=this._currentDocumentResponse&&this._currentDocumentResponse.resultId||null,o=LSe(this._provider,this._model,t,n,e.token);this._currentDocumentRequestCancellationTokenSource=e,this._providersChangedDuringRequest=!1;const r=[],s=this._model.onDidChangeContent(l=>{r.push(l)}),a=new xs(!1);o.then(l=>{if(this._debounceInformation.update(this._model,a.elapsed()),this._currentDocumentRequestCancellationTokenSource=null,s.dispose(),!l)this._setDocumentSemanticTokens(null,null,null,r);else{const{provider:c,tokens:u}=l,d=this._semanticTokensStylingService.getStyling(c);this._setDocumentSemanticTokens(c,u||null,d,r)}},l=>{l&&(oh(l)||typeof l.message=="string"&&l.message.indexOf("busy")!==-1)||en(l),this._currentDocumentRequestCancellationTokenSource=null,s.dispose(),(r.length>0||this._providersChangedDuringRequest)&&(this._fetchDocumentSemanticTokens.isScheduled()||this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model)))})}static _copy(e,t,n,o,r){r=Math.min(r,n.length-o,e.length-t);for(let s=0;s{(o.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||!n){this._model.tokenization.setSemanticTokens(null,!1);return}if(!t){this._model.tokenization.setSemanticTokens(null,!0),s();return}if(SSe(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 h of t.edits)a+=(h.data?h.data.length:0)-h.deleteCount;const l=r.data,c=new Uint32Array(l.length+a);let u=l.length,d=c.length;for(let h=t.edits.length-1;h>=0;h--){const f=t.edits[h];if(f.start>l.length){n.warnInvalidEditStart(r.resultId,t.resultId,h,f.start,l.length),this._model.tokenization.setSemanticTokens(null,!0);return}const g=u-(f.start+f.deleteCount);g>0&&(Yp._copy(l,u-g,c,d-g,g),d-=g),f.data&&(Yp._copy(f.data,0,c,d-f.data.length,f.data.length),d-=f.data.length),u=f.start}u>0&&Yp._copy(l,0,c,0,u),t={resultId:t.resultId,data:c}}}if(zF(t)){this._currentDocumentResponse=new Txt(e,t.resultId,t.data);const a=l1e(t,n,this._model.getLanguageId());if(o.length>0)for(const l of o)for(const c of a)for(const u of l.changes)c.applyEdit(u.range,u.text);this._model.tokenization.setSemanticTokens(a,!0)}else this._model.tokenization.setSemanticTokens(null,!0);s()}};Jk.REQUEST_MIN_DELAY=300;Jk.REQUEST_MAX_DELAY=2e3;Jk=Yp=DSe([Ih(1,E5),Ih(2,mr),Ih(3,Kc),Ih(4,pt)],Jk);class Txt{constructor(e,t,n){this.provider=e,this.resultId=t,this.data=n}dispose(){this.provider.releaseDocumentSemanticTokens(this.resultId)}}q5(LU);var Nxt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},iL=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let eI=class extends _e{constructor(e,t,n,o,r,s){super(),this._semanticTokensStylingService=t,this._themeService=n,this._configurationService=o,this._editor=e,this._provider=s.documentRangeSemanticTokensProvider,this._debounceInformation=r.for(this._provider,"DocumentRangeSemanticTokens",{min:100,max:500}),this._tokenizeViewport=this._register(new bi(()=>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(l=>{this._cancelAll(),a()})),this._register(this._provider.onDidChange(()=>{this._cancelAll(),a()})),this._register(this._configurationService.onDidChangeConfiguration(l=>{l.affectsConfiguration(FY)&&(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,n=this._outstandingRequests.length;tthis._requestRange(e,n)))}_requestRange(e,t){const n=e.getVersionId(),o=sr(s=>Promise.resolve(OY(this._provider,e,t,s))),r=new xs(!1);return o.then(s=>{if(this._debounceInformation.update(e,r.elapsed()),!s||!s.tokens||e.isDisposed()||e.getVersionId()!==n)return;const{provider:a,tokens:l}=s,c=this._semanticTokensStylingService.getStyling(a);e.tokenization.setPartialSemanticTokens(t,l1e(l,c,e.getLanguageId()))}).then(()=>this._removeOutstandingRequest(o),()=>this._removeOutstandingRequest(o)),o}};eI.ID="editor.contrib.viewportSemanticTokens";eI=Nxt([iL(1,E5),iL(2,mr),iL(3,En),iL(4,Kc),iL(5,pt)],eI);zn(eI.ID,eI,1);class Rxt{constructor(e=!0){this.selectSubwords=e}provideSelectionRanges(e,t){const n=[];for(const o of t){const r=[];n.push(r),this.selectSubwords&&this._addInWordRanges(r,e,o),this._addWordRanges(r,e,o),this._addWhitespaceLine(r,e,o),r.push({range:e.getFullModelRange()})}return n}_addInWordRanges(e,t,n){const o=t.getWordAtPosition(n);if(!o)return;const{word:r,startColumn:s}=o,a=n.column-s;let l=a,c=a,u=0;for(;l>=0;l--){const d=r.charCodeAt(l);if(l!==a&&(d===95||d===45))break;if(bm(d)&&Eh(u))break;u=d}for(l+=1;c0&&t.getLineFirstNonWhitespaceColumn(n.lineNumber)===0&&t.getLineLastNonWhitespaceColumn(n.lineNumber)===0&&e.push({range:new V(n.lineNumber,1,n.lineNumber,t.getLineMaxColumn(n.lineNumber))})}}var Mxt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Axt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},UF=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},EU;class BY{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 n=new BY(t,this.ranges);return n.ranges[t].equalsRange(this.ranges[this.index])?n.mov(e):n}}let Yy=EU=class{static get(e){return e.getContribution(EU.ID)}constructor(e,t){this._editor=e,this._languageFeaturesService=t,this._ignoreSelection=!1}dispose(){var e;(e=this._selectionListener)===null||e===void 0||e.dispose()}run(e){return UF(this,void 0,void 0,function*(){if(!this._editor.hasModel())return;const t=this._editor.getSelections(),n=this._editor.getModel();if(this._state||(yield ISe(this._languageFeaturesService.selectionRangeProvider,n,t.map(r=>r.getPosition()),this._editor.getOption(112),_n.None).then(r=>{var s;if(!(!ws(r)||r.length!==t.length)&&!(!this._editor.hasModel()||!Lo(this._editor.getSelections(),t,(a,l)=>a.equalsSelection(l)))){for(let a=0;al.containsPosition(t[a].getStartPosition())&&l.containsPosition(t[a].getEndPosition())),r[a].unshift(t[a]);this._state=r.map(a=>new BY(0,a)),(s=this._selectionListener)===null||s===void 0||s.dispose(),this._selectionListener=this._editor.onDidChangeCursorPosition(()=>{var a;this._ignoreSelection||((a=this._selectionListener)===null||a===void 0||a.dispose(),this._state=void 0)})}})),!this._state)return;this._state=this._state.map(r=>r.mov(e));const o=this._state.map(r=>gt.fromPositions(r.ranges[r.index].getStartPosition(),r.ranges[r.index].getEndPosition()));this._ignoreSelection=!0;try{this._editor.setSelections(o)}finally{this._ignoreSelection=!1}})}};Yy.ID="editor.contrib.smartSelectController";Yy=EU=Mxt([Axt(1,pt)],Yy);class kSe extends ft{constructor(e,t){super(t),this._forward=e}run(e,t){return UF(this,void 0,void 0,function*(){const n=Yy.get(t);n&&(yield n.run(this._forward))})}}class Pxt extends kSe{constructor(){super(!0,{id:"editor.action.smartSelect.expand",label:C("smartSelect.expand","Expand Selection"),alias:"Expand Selection",precondition:void 0,kbOpts:{kbExpr:Q.editorTextFocus,primary:1553,mac:{primary:3345,secondary:[1297]},weight:100},menuOpts:{menuId:Z.MenubarSelectionMenu,group:"1_basic",title:C({key:"miSmartSelectGrow",comment:["&& denotes a mnemonic"]},"&&Expand Selection"),order:2}})}}Rn.registerCommandAlias("editor.action.smartSelect.grow","editor.action.smartSelect.expand");class Oxt extends kSe{constructor(){super(!1,{id:"editor.action.smartSelect.shrink",label:C("smartSelect.shrink","Shrink Selection"),alias:"Shrink Selection",precondition:void 0,kbOpts:{kbExpr:Q.editorTextFocus,primary:1551,mac:{primary:3343,secondary:[1295]},weight:100},menuOpts:{menuId:Z.MenubarSelectionMenu,group:"1_basic",title:C({key:"miSmartSelectShrink",comment:["&& denotes a mnemonic"]},"&&Shrink Selection"),order:3}})}}zn(Yy.ID,Yy,4);ze(Pxt);ze(Oxt);function ISe(i,e,t,n,o){return UF(this,void 0,void 0,function*(){const r=i.all(e).concat(new Rxt(n.selectSubwords));r.length===1&&r.unshift(new Nl);const s=[],a=[];for(const l of r)s.push(Promise.resolve(l.provideSelectionRanges(e,t,o)).then(c=>{if(ws(c)&&c.length===t.length)for(let u=0;u{if(l.length===0)return[];l.sort((h,f)=>ae.isBefore(h.getStartPosition(),f.getStartPosition())?1:ae.isBefore(f.getStartPosition(),h.getStartPosition())||ae.isBefore(h.getEndPosition(),f.getEndPosition())?-1:ae.isBefore(f.getEndPosition(),h.getEndPosition())?1:0);const c=[];let u;for(const h of l)(!u||V.containsRange(h,u)&&!V.equalsRange(h,u))&&(c.push(h),u=h);if(!n.selectLeadingAndTrailingWhitespace)return c;const d=[c[0]];for(let h=1;hi}),C7="data-sticky-line-index",Bce="data-sticky-is-line",Wxt="data-sticky-is-line-number",Wce="data-sticky-is-folding-icon";class Vxt extends _e{constructor(e){super(),this._editor=e,this._foldingIconStore=new Be,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(66),this._stickyLines=[],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 Av),this._rootDomNode.appendChild(this._lineNumbersDomNode),this._rootDomNode.appendChild(this._linesDomNodeScrollable);const t=()=>{this._linesDomNode.style.left=this._editor.getOption(114).scrollWithEditor?`-${this._editor.getScrollLeft()}px`:"0px"};this._register(this._editor.onDidChangeConfiguration(n=>{n.hasChanged(114)&&t(),n.hasChanged(66)&&(this._lineHeight=this._editor.getOption(66))})),this._register(this._editor.onDidScrollChange(n=>{n.scrollLeftChanged&&t(),n.scrollWidthChanged&&this._updateWidgetWidth()})),this._register(this._editor.onDidChangeModel(()=>{t(),this._updateWidgetWidth()})),this._register(this._foldingIconStore),t(),this._register(this._editor.onDidLayoutChange(n=>{this._updateWidgetWidth()})),this._updateWidgetWidth()}get lineNumbers(){return this._lineNumbers}get lineNumberCount(){return this._lineNumbers.length}getStickyLineForLine(e){return this._stickyLines.find(t=>t.lineNumber===e)}getCurrentLines(){return this._lineNumbers}setState(e,t,n=1/0){if((!this._previousState&&!e||this._previousState&&this._previousState.equals(e))&&n===1/0)return;this._previousState=e;const o=this._stickyLines;if(this._clearStickyWidget(),!e||!this._editor._getViewModel())return;if(e.startLineNumbers.length*this._lineHeight+e.lastLineRelativePosition>0){this._lastLineRelativePosition=e.lastLineRelativePosition;const s=[...e.startLineNumbers];e.showEndForLine!==null&&(s[e.showEndForLine]=e.endLineNumbers[e.showEndForLine]),this._lineNumbers=s}else this._lastLineRelativePosition=0,this._lineNumbers=[];this._renderRootNode(o,t,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`}_clearStickyWidget(){this._stickyLines=[],this._foldingIconStore.clear(),Ur(this._lineNumbersDomNode),Ur(this._linesDomNode),this._rootDomNode.style.display="none"}_useFoldingOpacityTransition(e){this._lineNumbersDomNode.style.setProperty("--vscode-editorStickyScroll-foldingOpacityTransition",`opacity ${e?.5:0}s`)}_setFoldingIconsVisibility(e){for(const t of this._stickyLines){const n=t.foldingIcon;!n||n.setVisible(e?!0:n.isCollapsed)}}_renderRootNode(e,t,n=1/0){return Bxt(this,void 0,void 0,function*(){const o=this._editor.getLayoutInfo();for(const[s,a]of this._lineNumbers.entries()){const l=e[s],c=a>=n||(l==null?void 0:l.lineNumber)!==a?this._renderChildNode(s,a,t,o):this._updateTopAndZIndexOfStickyLine(l);!c||(this._linesDomNode.appendChild(c.lineDomNode),this._lineNumbersDomNode.appendChild(c.lineNumberDomNode),this._stickyLines.push(c))}t&&(this._setFoldingHoverListeners(),this._useFoldingOpacityTransition(!this._isOnGlyphMargin));const r=this._lineNumbers.length*this._lineHeight+this._lastLineRelativePosition;if(r===0){this._clearStickyWidget();return}this._rootDomNode.style.display="block",this._lineNumbersDomNode.style.height=`${r}px`,this._linesDomNodeScrollable.style.height=`${r}px`,this._rootDomNode.style.height=`${r}px`,this._rootDomNode.style.marginLeft="0px",this._updateMinContentWidth(),this._editor.layoutOverlayWidget(this)})}_setFoldingHoverListeners(){this._editor.getOption(109)==="mouseover"&&(this._foldingIconStore.add(ke(this._lineNumbersDomNode,et.MOUSE_ENTER,t=>{this._isOnGlyphMargin=!0,this._setFoldingIconsVisibility(!0)})),this._foldingIconStore.add(ke(this._lineNumbersDomNode,et.MOUSE_LEAVE,()=>{this._isOnGlyphMargin=!1,this._useFoldingOpacityTransition(!0),this._setFoldingIconsVisibility(!1)})))}_renderChildNode(e,t,n,o){const r=this._editor._getViewModel();if(!r)return;const s=r.coordinatesConverter.convertModelPositionToViewPosition(new ae(t,1)).lineNumber,a=r.getViewLineRenderingData(s),l=this._editor.getOption(67);let c;try{c=ol.filter(a.inlineDecorations,s,a.minColumn,a.maxColumn)}catch{c=[]}const u=new Zv(!0,!0,a.content,a.continuesWithWrappedLine,a.isBasicASCII,a.containsRTL,0,a.tokens,c,a.tabSize,a.startVisibleColumn,1,1,1,500,"none",!0,!0,null),d=new _S(2e3),h=zI(u,d);let f;Fce?f=Fce.createHTML(d.build()):f=d.build();const g=document.createElement("span");g.setAttribute(C7,String(e)),g.setAttribute(Bce,""),g.setAttribute("role","listitem"),g.tabIndex=0,g.className="sticky-line-content",g.classList.add(`stickyLine${t}`),g.style.lineHeight=`${this._lineHeight}px`,g.innerHTML=f;const p=document.createElement("span");p.setAttribute(C7,String(e)),p.setAttribute(Wxt,""),p.className="sticky-line-number",p.style.lineHeight=`${this._lineHeight}px`;const v=o.contentLeft;p.style.width=`${v}px`;const m=document.createElement("span");l.renderType===1||l.renderType===3&&t%10===0?m.innerText=t.toString():l.renderType===2&&(m.innerText=Math.abs(t-this._editor.getPosition().lineNumber).toString()),m.className="sticky-line-number-inner",m.style.lineHeight=`${this._lineHeight}px`,m.style.width=`${o.lineNumbersWidth}px`,m.style.paddingLeft=`${o.lineNumbersLeft}px`,p.appendChild(m);const _=this._renderFoldingIconForLine(n,t);_&&p.appendChild(_.domNode),this._editor.applyFontInfo(g),this._editor.applyFontInfo(m),p.style.lineHeight=`${this._lineHeight}px`,g.style.lineHeight=`${this._lineHeight}px`,p.style.height=`${this._lineHeight}px`,g.style.height=`${this._lineHeight}px`;const w=new Hxt(e,t,g,p,_,h.characterMapping);return this._updateTopAndZIndexOfStickyLine(w)}_updateTopAndZIndexOfStickyLine(e){var t;const n=e.index,o=e.lineDomNode,r=e.lineNumberDomNode,s=n===this._lineNumbers.length-1,a="0",l="1";o.style.zIndex=s?a:l,r.style.zIndex=s?a:l;const c=`${n*this._lineHeight+this._lastLineRelativePosition+(!((t=e.foldingIcon)===null||t===void 0)&&t.isCollapsed?1:0)}px`,u=`${n*this._lineHeight}px`;return o.style.top=s?c:u,r.style.top=s?c:u,e}_renderFoldingIconForLine(e,t){const n=this._editor.getOption(109);if(!e||n==="never")return;const o=e.regions,r=o.findRange(t),s=o.getStartLineNumber(r);if(!(t===s))return;const l=o.isCollapsed(r),c=new $xt(l,s,o.getEndLineNumber(r),this._lineHeight);return c.setVisible(this._isOnGlyphMargin?!0:l||n==="always"),c.domNode.setAttribute(Wce,""),c}_updateMinContentWidth(){this._minContentWidthInPx=0;for(const e of this._stickyLines)e.lineDomNode.scrollWidth>this._minContentWidthInPx&&(this._minContentWidthInPx=e.lineDomNode.scrollWidth);this._minContentWidthInPx+=this._editor.getLayoutInfo().verticalScrollbarWidth}getId(){return"editor.contrib.stickyScrollWidget"}getDomNode(){return this._rootDomNode}getPosition(){return{preference:null}}getMinContentWidthInPx(){return this._minContentWidthInPx}focusLineWithIndex(e){0<=e&&e0)return null;const t=this._getRenderedStickyLineFromChildDomNode(e);if(!t)return null;const n=wG(t.characterMapping,e,0);return new ae(t.lineNumber,n)}getLineNumberFromChildDomNode(e){var t,n;return(n=(t=this._getRenderedStickyLineFromChildDomNode(e))===null||t===void 0?void 0:t.lineNumber)!==null&&n!==void 0?n:null}_getRenderedStickyLineFromChildDomNode(e){const t=this.getLineIndexFromChildDomNode(e);return t===null||t<0||t>=this._stickyLines.length?null:this._stickyLines[t]}getLineIndexFromChildDomNode(e){const t=this._getAttributeValue(e,C7);return t?parseInt(t,10):null}isInStickyLine(e){return this._getAttributeValue(e,Bce)!==void 0}isInFoldingIconDomNode(e){return this._getAttributeValue(e,Wce)!==void 0}_getAttributeValue(e,t){for(;e&&e!==this._rootDomNode;){const n=e.getAttribute(t);if(n!==null)return n;e=e.parentElement}}}class Hxt{constructor(e,t,n,o,r,s){this.index=e,this.lineNumber=t,this.lineDomNode=n,this.lineNumberDomNode=o,this.foldingIcon=r,this.characterMapping=s}}class $xt{constructor(e,t,n,o){this.isCollapsed=e,this.foldingStartLine=t,this.foldingEndLine=n,this.dimension=o,this.domNode=document.createElement("div"),this.domNode.style.width=`${o}px`,this.domNode.style.height=`${o}px`,this.domNode.className=Mt.asClassName(e?xF:SF)}setVisible(e){this.domNode.style.cursor=e?"pointer":"default",this.domNode.style.opacity=e?"1":"0"}}class OE{constructor(e,t){this.startLineNumber=e,this.endLineNumber=t}}class IO{constructor(e,t,n){this.range=e,this.children=t,this.parent=n}}class TSe{constructor(e,t,n,o){this.uri=e,this.version=t,this.element=n,this.outlineProviderId=o}}var jF=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},tI=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},Vce=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},FE;(function(i){i.OUTLINE_MODEL="outlineModel",i.FOLDING_PROVIDER_MODEL="foldingProviderModel",i.INDENTATION_MODEL="indentationModel"})(FE||(FE={}));var Rm;(function(i){i[i.VALID=0]="VALID",i[i.INVALID=1]="INVALID",i[i.CANCELED=2]="CANCELED"})(Rm||(Rm={}));let DU=class extends _e{constructor(e,t,n,o){super(),this._editor=e,this._languageConfigurationService=t,this._languageFeaturesService=n,this._modelProviders=[],this._modelPromise=null,this._updateScheduler=this._register(new Bu(300)),this._updateOperation=this._register(new Be);const r=new kU(n),s=new TU(this._editor,n),a=new IU(this._editor,t);switch(o){case FE.OUTLINE_MODEL:this._modelProviders.push(r),this._modelProviders.push(s),this._modelProviders.push(a);break;case FE.FOLDING_PROVIDER_MODEL:this._modelProviders.push(s),this._modelProviders.push(a);break;case FE.INDENTATION_MODEL:this._modelProviders.push(a);break}}_cancelModelPromise(){this._modelPromise&&(this._modelPromise.cancel(),this._modelPromise=null)}update(e,t,n){return Vce(this,void 0,void 0,function*(){return this._updateOperation.clear(),this._updateOperation.add({dispose:()=>{this._cancelModelPromise(),this._updateScheduler.cancel()}}),this._cancelModelPromise(),yield this._updateScheduler.trigger(()=>Vce(this,void 0,void 0,function*(){for(const o of this._modelProviders){const{statusPromise:r,modelPromise:s}=o.computeStickyModel(e,t,n);this._modelPromise=s;const a=yield r;if(this._modelPromise!==s)return null;switch(a){case Rm.CANCELED:return this._updateOperation.clear(),null;case Rm.VALID:return o.stickyModel}}return null})).catch(o=>(en(o),null))})}};DU=jF([tI(1,Ti),tI(2,pt)],DU);class NSe{constructor(){this._stickyModel=null}get stickyModel(){return this._stickyModel}_invalid(){return this._stickyModel=null,Rm.INVALID}computeStickyModel(e,t,n){if(n.isCancellationRequested||!this.isProviderValid(e))return{statusPromise:this._invalid(),modelPromise:null};const o=sr(r=>this.createModelFromProvider(e,t,r));return{statusPromise:o.then(r=>this.isModelValid(r)?n.isCancellationRequested?Rm.CANCELED:(this._stickyModel=this.createStickyModel(e,t,n,r),Rm.VALID):this._invalid()).then(void 0,r=>(en(r),Rm.CANCELED)),modelPromise:o}}isModelValid(e){return!0}isProviderValid(e){return!0}}let kU=class extends NSe{constructor(e){super(),this._languageFeaturesService=e}createModelFromProvider(e,t,n){return mg.create(this._languageFeaturesService.documentSymbolProvider,e,n)}createStickyModel(e,t,n,o){var r;const{stickyOutlineElement:s,providerID:a}=this._stickyModelFromOutlineModel(o,(r=this._stickyModel)===null||r===void 0?void 0:r.outlineProviderId);return new TSe(e.uri,t,s,a)}isModelValid(e){return e&&e.children.size>0}_stickyModelFromOutlineModel(e,t){let n;if(mn.first(e.children.values())instanceof eSe){const a=mn.find(e.children.values(),l=>l.id===t);if(a)n=a.children;else{let l="",c=-1,u;for(const[d,h]of e.children.entries()){const f=this._findSumOfRangesOfGroup(h);f>c&&(u=h,c=f,l=h.id)}t=l,n=u.children}}else n=e.children;const o=[],r=Array.from(n.values()).sort((a,l)=>{const c=new OE(a.symbol.range.startLineNumber,a.symbol.range.endLineNumber),u=new OE(l.symbol.range.startLineNumber,l.symbol.range.endLineNumber);return this._comparator(c,u)});for(const a of r)o.push(this._stickyModelFromOutlineElement(a,a.symbol.selectionRange.startLineNumber));return{stickyOutlineElement:new IO(void 0,o,void 0),providerID:t}}_stickyModelFromOutlineElement(e,t){const n=[];for(const r of e.children.values())if(r.symbol.selectionRange.startLineNumber!==r.symbol.range.endLineNumber)if(r.symbol.selectionRange.startLineNumber!==t)n.push(this._stickyModelFromOutlineElement(r,r.symbol.selectionRange.startLineNumber));else for(const s of r.children.values())n.push(this._stickyModelFromOutlineElement(s,r.symbol.selectionRange.startLineNumber));n.sort((r,s)=>this._comparator(r.range,s.range));const o=new OE(e.symbol.selectionRange.startLineNumber,e.symbol.range.endLineNumber);return new IO(o,n,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 n of e.children.values())t+=this._findSumOfRangesOfGroup(n);return e instanceof Xz?t+e.symbol.range.endLineNumber-e.symbol.selectionRange.startLineNumber:t}};kU=jF([tI(0,pt)],kU);class RSe extends NSe{constructor(e){super(),this._foldingLimitReporter=new Zye(e)}createStickyModel(e,t,n,o){const r=this._fromFoldingRegions(o);return new TSe(e.uri,t,r,void 0)}isModelValid(e){return e!==null}_fromFoldingRegions(e){const t=e.length,n=[],o=new IO(void 0,[],void 0);for(let r=0;r0}createModelFromProvider(e,t,n){const o=Sf.getFoldingRangeProviders(this._languageFeaturesService,e);return new yY(e,o,()=>this.createModelFromProvider(e,t,n),this._foldingLimitReporter,void 0).compute(n)}};TU=jF([tI(1,pt)],TU);var zxt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Hce=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},$ce=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};class Uxt{constructor(e,t,n){this.startLineNumber=e,this.endLineNumber=t,this.nestingDepth=n}}let NU=class extends _e{constructor(e,t,n){super(),this._languageFeaturesService=t,this._languageConfigurationService=n,this._onDidChangeStickyScroll=this._register(new le),this.onDidChangeStickyScroll=this._onDidChangeStickyScroll.event,this._options=null,this._model=null,this._cts=null,this._stickyModelProvider=null,this._editor=e,this._sessionStore=this._register(new Be),this._updateSoon=this._register(new bi(()=>this.update(),50)),this._register(this._editor.onDidChangeConfiguration(o=>{o.hasChanged(114)&&this.readConfiguration()})),this.readConfiguration()}readConfiguration(){this._stickyModelProvider=null,this._sessionStore.clear(),this._options=this._editor.getOption(114),this._options.enabled&&(this._stickyModelProvider=this._sessionStore.add(new DU(this._editor,this._languageConfigurationService,this._languageFeaturesService,this._options.defaultModel)),this._sessionStore.add(this._editor.onDidChangeModel(()=>{this._model=null,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.update())}getVersionId(){var e;return(e=this._model)===null||e===void 0?void 0:e.version}update(){var e;return $ce(this,void 0,void 0,function*(){(e=this._cts)===null||e===void 0||e.dispose(!0),this._cts=new Ro,yield this.updateStickyModel(this._cts.token),this._onDidChangeStickyScroll.fire()})}updateStickyModel(e){return $ce(this,void 0,void 0,function*(){if(!this._editor.hasModel()||!this._stickyModelProvider||this._editor.getModel().isTooLargeForTokenization()){this._model=null;return}const t=this._editor.getModel(),n=t.getVersionId(),o=yield this._stickyModelProvider.update(t,n,e);e.isCancellationRequested||(this._model=o)})}updateIndex(e){return e===-1?e=0:e<0&&(e=-e-2),e}getCandidateStickyLinesIntersectingFromStickyModel(e,t,n,o,r){if(t.children.length===0)return;let s=r;const a=[];for(let u=0;uu-d)),c=this.updateIndex(xD(a,e.startLineNumber+o,(u,d)=>u-d));for(let u=l;u<=c;u++){const d=t.children[u];if(!d)return;if(d.range){const h=d.range.startLineNumber,f=d.range.endLineNumber;e.startLineNumber<=f+1&&h-1<=e.endLineNumber&&h!==s&&(s=h,n.push(new Uxt(h,f-1,o+1)),this.getCandidateStickyLinesIntersectingFromStickyModel(e,d,n,o+1,h))}else this.getCandidateStickyLinesIntersectingFromStickyModel(e,d,n,o,r)}}getCandidateStickyLinesIntersecting(e){var t,n;if(!(!((t=this._model)===null||t===void 0)&&t.element))return[];let o=[];this.getCandidateStickyLinesIntersectingFromStickyModel(e,this._model.element,o,0,-1);const r=(n=this._editor._getViewModel())===null||n===void 0?void 0:n.getHiddenAreas();if(r)for(const s of r)o=o.filter(a=>!(a.startLineNumber>=s.startLineNumber&&a.endLineNumber<=s.endLineNumber+1));return o}};NU=zxt([Hce(1,pt),Hce(2,Ti)],NU);var jxt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},nC=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},w7=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},RU;let xf=RU=class extends _e{constructor(e,t,n,o,r,s,a){super(),this._editor=e,this._contextMenuService=t,this._languageFeaturesService=n,this._instaService=o,this._contextKeyService=a,this._sessionStore=new Be,this._foldingModel=null,this._maxStickyLines=Number.MAX_SAFE_INTEGER,this._candidateDefinitionsLength=-1,this._focusedStickyElementIndex=-1,this._enabled=!1,this._focused=!1,this._positionRevealed=!1,this._onMouseDown=!1,this._endLineNumbers=[],this._showEndForLine=null,this._stickyScrollWidget=new Vxt(this._editor),this._stickyLineCandidateProvider=new NU(this._editor,n,r),this._register(this._stickyScrollWidget),this._register(this._stickyLineCandidateProvider),this._widgetState=new Oce([],[],0),this._readConfiguration();const l=this._stickyScrollWidget.getDomNode();this._register(this._editor.onDidChangeConfiguration(u=>{(u.hasChanged(114)||u.hasChanged(72)||u.hasChanged(66)||u.hasChanged(109))&&this._readConfiguration()})),this._register(ke(l,et.CONTEXT_MENU,u=>w7(this,void 0,void 0,function*(){this._onContextMenu(u)}))),this._stickyScrollFocusedContextKey=Q.stickyScrollFocused.bindTo(this._contextKeyService),this._stickyScrollVisibleContextKey=Q.stickyScrollVisible.bindTo(this._contextKeyService);const c=this._register(gf(l));this._register(c.onDidBlur(u=>{this._positionRevealed===!1&&l.clientHeight===0?(this._focusedStickyElementIndex=-1,this.focus()):this._disposeFocusStickyScrollStore()})),this._register(c.onDidFocus(u=>{this.focus()})),this._registerMouseListeners(),this._register(ke(l,et.MOUSE_DOWN,u=>{this._onMouseDown=!0}))}static get(e){return e.getContribution(RU.ID)}_disposeFocusStickyScrollStore(){var e;this._stickyScrollFocusedContextKey.set(!1),(e=this._focusDisposableStore)===null||e===void 0||e.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 Be,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,0))}_reveaInEditor(e,t){this._focused&&this._disposeFocusStickyScrollStore(),this._positionRevealed=!0,t(),this._editor.setSelection(V.fromPositions(e)),this._editor.focus()}_registerMouseListeners(){const e=this._register(new Be),t=this._register(new lF(this._editor,{extractLineNumberFromMouseEvent:r=>{const s=this._stickyScrollWidget.getEditorPositionFromNode(r.target.element);return s?s.lineNumber:0}})),n=r=>{if(!this._editor.hasModel()||r.target.type!==12||r.target.detail!==this._stickyScrollWidget.getId())return null;const s=r.target.element;if(!s||s.innerText!==s.innerHTML)return null;const a=this._stickyScrollWidget.getEditorPositionFromNode(s);return a?{range:new V(a.lineNumber,a.column,a.lineNumber,a.column+s.innerText.length),textElement:s}:null},o=this._stickyScrollWidget.getDomNode();this._register(No(o,et.CLICK,r=>{if(r.ctrlKey||r.altKey||r.metaKey||!r.leftButton)return;if(r.shiftKey){const c=this._stickyScrollWidget.getLineIndexFromChildDomNode(r.target);if(c===null)return;const u=new ae(this._endLineNumbers[c],1);this._revealLineInCenterIfOutsideViewport(u);return}if(this._stickyScrollWidget.isInFoldingIconDomNode(r.target)){const c=this._stickyScrollWidget.getLineNumberFromChildDomNode(r.target);this._toggleFoldingRegionForLine(c);return}if(!this._stickyScrollWidget.isInStickyLine(r.target))return;let l=this._stickyScrollWidget.getEditorPositionFromNode(r.target);if(!l){const c=this._stickyScrollWidget.getLineNumberFromChildDomNode(r.target);if(c===null)return;l=new ae(c,1)}this._revealPosition(l)})),this._register(No(o,et.MOUSE_MOVE,r=>{if(r.shiftKey){const s=this._stickyScrollWidget.getLineIndexFromChildDomNode(r.target);if(s===null||this._showEndForLine!==null&&this._showEndForLine===s)return;this._showEndForLine=s,this._renderStickyScroll();return}this._showEndForLine!==null&&(this._showEndForLine=null,this._renderStickyScroll())})),this._register(ke(o,et.MOUSE_LEAVE,r=>{this._showEndForLine!==null&&(this._showEndForLine=null,this._renderStickyScroll())})),this._register(t.onMouseMoveOrRelevantKeyDown(([r,s])=>{const a=n(r);if(!a||!r.hasTriggerModifier||!this._editor.hasModel()){e.clear();return}const{range:l,textElement:c}=a;if(!l.equalsRange(this._stickyRangeProjectedOnEditor))this._stickyRangeProjectedOnEditor=l,e.clear();else if(c.style.textDecoration==="underline")return;const u=new Ro;e.add(zt(()=>u.dispose(!0)));let d;gF(this._languageFeaturesService.definitionProvider,this._editor.getModel(),new ae(l.startLineNumber,l.startColumn+1),u.token).then(h=>{if(!u.token.isCancellationRequested)if(h.length!==0){this._candidateDefinitionsLength=h.length;const f=c;d!==f?(e.clear(),d=f,d.style.textDecoration="underline",e.add(zt(()=>{d.style.textDecoration="none"}))):d||(d=f,d.style.textDecoration="underline",e.add(zt(()=>{d.style.textDecoration="none"})))}else e.clear()})})),this._register(t.onCancel(()=>{e.clear()})),this._register(t.onExecute(r=>w7(this,void 0,void 0,function*(){if(r.target.type!==12||r.target.detail!==this._stickyScrollWidget.getId())return;const s=this._stickyScrollWidget.getEditorPositionFromNode(r.target.element);!s||(this._candidateDefinitionsLength>1&&(this._focused&&this._disposeFocusStickyScrollStore(),this._revealPosition({lineNumber:s.lineNumber,column:1})),this._instaService.invokeFunction(aSe,r,this._editor,{uri:this._editor.getModel().uri,range:this._stickyRangeProjectedOnEditor}))})))}_onContextMenu(e){const t=new Dc(e);this._contextMenuService.showContextMenu({menuId:Z.StickyScrollContext,getAnchor:()=>t})}_toggleFoldingRegionForLine(e){if(!this._foldingModel||e===null)return;const t=this._stickyScrollWidget.getStickyLineForLine(e),n=t==null?void 0:t.foldingIcon;if(!n)return;Kye(this._foldingModel,Number.MAX_VALUE,[e]),n.isCollapsed=!n.isCollapsed;const o=(n.isCollapsed?this._editor.getTopForLineNumber(n.foldingEndLine):this._editor.getTopForLineNumber(n.foldingStartLine))-this._editor.getOption(66)*t.index+1;this._editor.setScrollTop(o),this._renderStickyScroll(e)}_readConfiguration(){const e=this._editor.getOption(114);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(n=>{n.scrollTopChanged&&(this._showEndForLine=null,this._renderStickyScroll())})),this._sessionStore.add(this._editor.onDidLayoutChange(()=>this._onDidResize())),this._sessionStore.add(this._editor.onDidChangeModelTokens(n=>this._onTokensChange(n))),this._sessionStore.add(this._stickyLineCandidateProvider.onDidChangeStickyScroll(()=>{this._showEndForLine=null,this._renderStickyScroll()})),this._enabled=!0);this._editor.getOption(67).renderType===2&&this._sessionStore.add(this._editor.onDidChangeCursorPosition(()=>{this._showEndForLine=null,this._renderStickyScroll()}))}_needsUpdate(e){const t=this._stickyScrollWidget.getCurrentLines();for(const n of t)for(const o of e.ranges)if(n>=o.fromLineNumber&&n<=o.toLineNumber)return!0;return!1}_onTokensChange(e){this._needsUpdate(e)&&this._renderStickyScroll(-1)}_onDidResize(){const t=this._editor.getLayoutInfo().height/this._editor.getOption(66);this._maxStickyLines=Math.round(t*.25)}_renderStickyScroll(e=1/0){var t,n;return w7(this,void 0,void 0,function*(){const o=this._editor.getModel();if(!o||o.isTooLargeForTokenization()){this._foldingModel=null,this._stickyScrollWidget.setState(void 0,null,e);return}const r=this._stickyLineCandidateProvider.getVersionId();if(r===void 0||r===o.getVersionId())if(this._foldingModel=(n=yield(t=Sf.get(this._editor))===null||t===void 0?void 0:t.getFoldingModel())!==null&&n!==void 0?n:null,this._widgetState=this.findScrollWidgetState(),this._stickyScrollVisibleContextKey.set(this._widgetState.startLineNumbers.length!==0),!this._focused)this._stickyScrollWidget.setState(this._widgetState,this._foldingModel,e);else if(this._focusedStickyElementIndex===-1)this._stickyScrollWidget.setState(this._widgetState,this._foldingModel,e),this._focusedStickyElementIndex=this._stickyScrollWidget.lineNumberCount-1,this._focusedStickyElementIndex!==-1&&this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex);else{const s=this._stickyScrollWidget.lineNumbers[this._focusedStickyElementIndex];this._stickyScrollWidget.setState(this._widgetState,this._foldingModel,e),this._stickyScrollWidget.lineNumberCount===0?this._focusedStickyElementIndex=-1:(this._stickyScrollWidget.lineNumbers.includes(s)||(this._focusedStickyElementIndex=this._stickyScrollWidget.lineNumberCount-1),this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex))}})}findScrollWidgetState(){const e=this._editor.getOption(66),t=Math.min(this._maxStickyLines,this._editor.getOption(114).maxLineCount),n=this._editor.getScrollTop();let o=0;const r=[],s=[],a=this._editor.getVisibleRanges();if(a.length!==0){const l=new OE(a[0].startLineNumber,a[a.length-1].endLineNumber),c=this._stickyLineCandidateProvider.getCandidateStickyLinesIntersecting(l);for(const u of c){const d=u.startLineNumber,h=u.endLineNumber,f=u.nestingDepth;if(h-d>0){const g=(f-1)*e,p=f*e,v=this._editor.getBottomForLineNumber(d)-n,m=this._editor.getTopForLineNumber(h)-n,_=this._editor.getBottomForLineNumber(h)-n;if(g>m&&g<=_){r.push(d),s.push(h+1),o=_-p;break}else p>v&&p<=_&&(r.push(d),s.push(h+1));if(r.length===t)break}}}return this._endLineNumbers=s,new Oce(r,s,o,this._showEndForLine)}dispose(){super.dispose(),this._sessionStore.dispose()}};xf.ID="store.contrib.stickyScrollController";xf=RU=jxt([nC(1,ju),nC(2,pt),nC(3,$t),nC(4,Ti),nC(5,Kc),nC(6,Ut)],xf);var Kxt=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};class qxt extends Jl{constructor(){super({id:"editor.action.toggleStickyScroll",title:{value:C("toggleStickyScroll","Toggle Sticky Scroll"),mnemonicTitle:C({key:"mitoggleStickyScroll",comment:["&& denotes a mnemonic"]},"&&Toggle Sticky Scroll"),original:"Toggle Sticky Scroll"},category:Fxt.View,toggled:{condition:Me.equals("config.editor.stickyScroll.enabled",!0),title:C("stickyScroll","Sticky Scroll"),mnemonicTitle:C({key:"miStickyScroll",comment:["&& denotes a mnemonic"]},"&&Sticky Scroll")},menu:[{id:Z.CommandPalette},{id:Z.MenubarAppearanceMenu,group:"4_editor",order:3},{id:Z.StickyScrollContext}]})}run(e){return Kxt(this,void 0,void 0,function*(){const t=e.get(En),n=!t.getValue("editor.stickyScroll.enabled");return t.updateValue("editor.stickyScroll.enabled",n)})}}const KF=100;class Gxt extends sh{constructor(){super({id:"editor.action.focusStickyScroll",title:{value:C("focusStickyScroll","Focus Sticky Scroll"),mnemonicTitle:C({key:"mifocusStickyScroll",comment:["&& denotes a mnemonic"]},"&&Focus Sticky Scroll"),original:"Focus Sticky Scroll"},precondition:Me.and(Me.has("config.editor.stickyScroll.enabled"),Q.stickyScrollVisible),menu:[{id:Z.CommandPalette}]})}runEditorCommand(e,t){var n;(n=xf.get(t))===null||n===void 0||n.focus()}}class Xxt extends sh{constructor(){super({id:"editor.action.selectNextStickyScrollLine",title:{value:C("selectNextStickyScrollLine.title","Select next sticky scroll line"),original:"Select next sticky scroll line"},precondition:Q.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:KF,primary:18}})}runEditorCommand(e,t){var n;(n=xf.get(t))===null||n===void 0||n.focusNext()}}class Yxt extends sh{constructor(){super({id:"editor.action.selectPreviousStickyScrollLine",title:{value:C("selectPreviousStickyScrollLine.title","Select previous sticky scroll line"),original:"Select previous sticky scroll line"},precondition:Q.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:KF,primary:16}})}runEditorCommand(e,t){var n;(n=xf.get(t))===null||n===void 0||n.focusPrevious()}}class Zxt extends sh{constructor(){super({id:"editor.action.goToFocusedStickyScrollLine",title:{value:C("goToFocusedStickyScrollLine.title","Go to focused sticky scroll line"),original:"Go to focused sticky scroll line"},precondition:Q.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:KF,primary:3}})}runEditorCommand(e,t){var n;(n=xf.get(t))===null||n===void 0||n.goToFocused()}}class Qxt extends sh{constructor(){super({id:"editor.action.selectEditor",title:{value:C("selectEditor.title","Select Editor"),original:"Select Editor"},precondition:Q.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:KF,primary:9}})}runEditorCommand(e,t){var n;(n=xf.get(t))===null||n===void 0||n.selectEditor()}}zn(xf.ID,xf,1);$i(qxt);$i(Gxt);$i(Yxt);$i(Xxt);$i(Zxt);$i(Qxt);var WY=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},O0=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},Jxt=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},P_;class eLt{constructor(e,t,n,o,r,s){this.range=e,this.insertText=t,this.filterText=n,this.additionalTextEdits=o,this.command=r,this.completion=s}}let MU=class extends bYe{constructor(e,t,n,o,r,s){super(r.disposable),this.model=e,this.line=t,this.word=n,this.completionModel=o,this._suggestMemoryService=s}canBeReused(e,t,n){return this.model===e&&this.line===t&&this.word.word.length>0&&this.word.startColumn===n.startColumn&&this.word.endColumn=0&&l.resolve(_n.None)}return t}};MU=WY([O0(5,kF)],MU);let AU=class{constructor(e,t,n,o){this._getEditorOption=e,this._languageFeatureService=t,this._clipboardService=n,this._suggestMemoryService=o}provideInlineCompletions(e,t,n,o){var r;return Jxt(this,void 0,void 0,function*(){if(n.selectedSuggestionInfo)return;const s=this._getEditorOption(88,e);if(ZC.isAllOff(s))return;e.tokenization.tokenizeIfCheap(t.lineNumber);const a=e.tokenization.getLineTokens(t.lineNumber),l=a.getStandardTokenType(a.findTokenIndexAtOffset(Math.max(t.column-1-1,0)));if(ZC.valueFor(s,l)!=="inline")return;let c=e.getWordAtPosition(t),u;if(c!=null&&c.word||(u=this._getTriggerCharacterInfo(e,t)),!(c!=null&&c.word)&&!u||(c||(c=e.getWordUntilPosition(t)),c.endColumn!==t.column))return;let d;const h=e.getValueInRange(new V(t.lineNumber,1,t.lineNumber,t.column));if(!u&&((r=this._lastResult)===null||r===void 0?void 0:r.canBeReused(e,t.lineNumber,c))){const f=new Tce(h,t.column-this._lastResult.word.endColumn);this._lastResult.completionModel.lineContext=f,this._lastResult.acquire(),d=this._lastResult}else{const f=yield LY(this._languageFeatureService.completionProvider,e,t,new zk(void 0,void 0,u==null?void 0:u.providers),u&&{triggerKind:1,triggerCharacter:u.ch},o);let g;f.needsClipboard&&(g=yield this._clipboardService.readText());const p=new um(f.items,t.column,new Tce(h,0),Sd.None,this._getEditorOption(117,e),this._getEditorOption(111,e),{boostFullMatch:!1,firstMatchCanBeWeak:!1},g);d=new MU(e,t.lineNumber,c,p,f,this._suggestMemoryService)}return this._lastResult=d,d})}handleItemDidShow(e,t){t.completion.resolve(_n.None)}freeInlineCompletions(e){e.release()}_getTriggerCharacterInfo(e,t){var n;const o=e.getValueInRange(V.fromPositions({lineNumber:t.lineNumber,column:t.column-1},t)),r=new Set;for(const s of this._languageFeatureService.completionProvider.all(e))!((n=s.triggerCharacters)===null||n===void 0)&&n.includes(o)&&r.add(s);if(r.size!==0)return{providers:r,ch:o}}};AU=WY([O0(1,pt),O0(2,bp),O0(3,kF)],AU);let TO=P_=class{constructor(e,t,n,o){if(++P_._counter===1){const r=o.createInstance(AU,(s,a)=>{var l;return((l=n.listCodeEditors().find(u=>u.getModel()===a))!==null&&l!==void 0?l:e).getOption(s)});P_._disposable=t.inlineCompletionsProvider.register("*",r)}}dispose(){var e;--P_._counter===0&&((e=P_._disposable)===null||e===void 0||e.dispose(),P_._disposable=void 0)}};TO._counter=0;TO=P_=WY([O0(1,pt),O0(2,Jn),O0(3,$t)],TO);zn("suggest.inlineCompletionsProvider",TO,0);class tLt extends ft{constructor(){super({id:"editor.action.forceRetokenize",label:C("forceRetokenize","Developer: Force Retokenize"),alias:"Developer: Force Retokenize",precondition:void 0})}run(e,t){if(!t.hasModel())return;const n=t.getModel();n.tokenization.resetTokenization();const o=new xs;n.tokenization.forceTokenization(n.getLineCount()),o.stop(),console.log(`tokenization took ${o.elapsed()}`)}}ze(tLt);class qF extends Jl{constructor(){super({id:qF.ID,title:{value:C({key:"toggle.tabMovesFocus",comment:["Turn on/off use of tab key for moving focus around VS Code"]},"Toggle Tab Key Moves Focus"),original:"Toggle Tab Key Moves Focus"},precondition:void 0,keybinding:{primary:2091,mac:{primary:1323},weight:100},f1:!0})}run(){const t=!Cy.getTabFocusMode();Cy.setTabFocusMode(t),bs(t?C("toggle.tabMovesFocus.on","Pressing Tab will now move focus to the next focusable element"):C("toggle.tabMovesFocus.off","Pressing Tab will now insert the tab character"))}}qF.ID="editor.action.toggleTabFocusMode";$i(qF);var nLt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},iLt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let PU=class extends _e{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}constructor(e,t,n={},o){var r;super(),this._link=t,this._enabled=!0,this.el=Ae(e,He("a.monaco-link",{tabIndex:(r=t.tabIndex)!==null&&r!==void 0?r:0,href:t.href,title:t.title},t.label)),this.el.setAttribute("role","button");const s=this._register(new xn(this.el,"click")),a=this._register(new xn(this.el,"keypress")),l=st.chain(a.event,d=>d.map(h=>new Pi(h)).filter(h=>h.keyCode===3)),c=this._register(new xn(this.el,Di.Tap)).event;this._register(Ei.addTarget(this.el));const u=st.any(s.event,l,c);this._register(u(d=>{!this.enabled||(dn.stop(d,!0),n!=null&&n.opener?n.opener(this._link.href):o.open(this._link.href,{allowCommands:!0}))})),this.enabled=!0}};PU=nLt([iLt(3,pl)],PU);var MSe=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},ASe=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const oLt=26;let OU=class extends _e{constructor(e,t){super(),this._editor=e,this.instantiationService=t,this.banner=this._register(this.instantiationService.createInstance(FU))}hide(){this._editor.setBanner(null,0),this.banner.clear()}show(e){this.banner.show(Object.assign(Object.assign({},e),{onClose:()=>{var t;this.hide(),(t=e.onClose)===null||t===void 0||t.call(e)}})),this._editor.setBanner(this.banner.element,oLt)}};OU=MSe([ASe(1,$t)],OU);let FU=class extends _e{constructor(e){super(),this.instantiationService=e,this.markdownRenderer=this.instantiationService.createInstance(cp,{}),this.element=He("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=He("span");return t.innerText=e,t}return this.markdownRenderer.render(e).element}clear(){Ur(this.element)}show(e){Ur(this.element);const t=this.getAriaLabel(e);t&&this.element.setAttribute("aria-label",t);const n=Ae(this.element,He("div.icon-container"));n.setAttribute("aria-hidden","true"),e.icon&&n.appendChild(He(`div${Mt.asCSSSelector(e.icon)}`));const o=Ae(this.element,He("div.message-container"));if(o.setAttribute("aria-hidden","true"),o.appendChild(this.getBannerMessage(e.message)),this.messageActionsContainer=Ae(this.element,He("div.message-actions-container")),e.actions)for(const s of e.actions)this._register(this.instantiationService.createInstance(PU,this.messageActionsContainer,Object.assign(Object.assign({},s),{tabIndex:-1}),{}));const r=Ae(this.element,He("div.action-container"));this.actionBar=this._register(new $c(r)),this.actionBar.push(this._register(new la("banner.close","Close Banner",Mt.asClassName(bCe),!0,()=>{typeof e.onClose=="function"&&e.onClose()})),{icon:!0,label:!1}),this.actionBar.setFocusable(!1)}};FU=MSe([ASe(0,$t)],FU);var VY=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Vw=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},ps=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};const rLt=Eo("extensions-warning-message",Xe.warning,C("warningIcon","Icon shown with a warning message in the extensions editor."));let Zy=class extends _e{constructor(e,t,n,o){super(),this._editor=e,this._editorWorkerService=t,this._workspaceTrustService=n,this._highlighter=null,this._bannerClosed=!1,this._updateState=r=>{if(r&&r.hasMore){if(this._bannerClosed)return;const s=Math.max(r.ambiguousCharacterCount,r.nonBasicAsciiCharacterCount,r.invisibleCharacterCount);let a;if(r.nonBasicAsciiCharacterCount>=s)a={message:C("unicodeHighlighting.thisDocumentHasManyNonBasicAsciiUnicodeCharacters","This document contains many non-basic ASCII unicode characters"),command:new PS};else if(r.ambiguousCharacterCount>=s)a={message:C("unicodeHighlighting.thisDocumentHasManyAmbiguousUnicodeCharacters","This document contains many ambiguous unicode characters"),command:new i_};else if(r.invisibleCharacterCount>=s)a={message:C("unicodeHighlighting.thisDocumentHasManyInvisibleUnicodeCharacters","This document contains many invisible unicode characters"),command:new AS};else throw new Error("Unreachable");this._bannerController.show({id:"unicodeHighlightBanner",message:a.message,icon:rLt,actions:[{label:a.command.shortLabel,href:`command:${a.command.id}`}],onClose:()=>{this._bannerClosed=!0}})}else this._bannerController.hide()},this._bannerController=this._register(o.createInstance(OU,e)),this._register(this._editor.onDidChangeModel(()=>{this._bannerClosed=!1,this._updateHighlighter()})),this._options=e.getOption(124),this._register(n.onDidChangeTrust(r=>{this._updateHighlighter()})),this._register(e.onDidChangeConfiguration(r=>{r.hasChanged(124)&&(this._options=e.getOption(124),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=sLt(this._workspaceTrustService.isWorkspaceTrusted(),this._options);if([e.nonBasicASCII,e.ambiguousCharacters,e.invisibleCharacters].every(n=>n===!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(n=>n.codePointAt(0)),allowedLocales:Object.keys(e.allowedLocales).map(n=>n==="_os"?new Intl.NumberFormat().resolvedOptions().locale:n==="_vscode"?wXe:n)};this._editorWorkerService.canComputeUnicodeHighlights(this._editor.getModel().uri)?this._highlighter=new BU(this._editor,t,this._updateState,this._editorWorkerService):this._highlighter=new aLt(this._editor,t,this._updateState)}getDecorationInfo(e){return this._highlighter?this._highlighter.getDecorationInfo(e):null}};Zy.ID="editor.contrib.unicodeHighlighter";Zy=VY([Vw(1,Gu),Vw(2,v1e),Vw(3,$t)],Zy);function sLt(i,e){return{nonBasicASCII:e.nonBasicASCII===Dl?!i:e.nonBasicASCII,ambiguousCharacters:e.ambiguousCharacters,invisibleCharacters:e.invisibleCharacters,includeComments:e.includeComments===Dl?!i:e.includeComments,includeStrings:e.includeStrings===Dl?!i:e.includeStrings,allowedCharacters:e.allowedCharacters,allowedLocales:e.allowedLocales}}let BU=class extends _e{constructor(e,t,n,o){super(),this._editor=e,this._options=t,this._updateState=n,this._editorWorkerService=o,this._model=this._editor.getModel(),this._decorations=this._editor.createDecorationsCollection(),this._updateSoon=this._register(new bi(()=>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 n=[];if(!t.hasMore)for(const o of t.ranges)n.push({range:o,options:NO.instance.getDecorationFromOptions(this._options)});this._decorations.set(n)})}getDecorationInfo(e){if(!this._decorations.has(e))return null;const t=this._editor.getModel();if(!$G(t,e))return null;const n=t.getValueInRange(e.range);return{reason:PSe(n,this._options),inComment:zG(t,e),inString:UG(t,e)}}};BU=VY([Vw(3,Gu)],BU);class aLt extends _e{constructor(e,t,n){super(),this._editor=e,this._options=t,this._updateState=n,this._model=this._editor.getModel(),this._decorations=this._editor.createDecorationsCollection(),this._updateSoon=this._register(new bi(()=>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=[],n={ranges:[],ambiguousCharacterCount:0,invisibleCharacterCount:0,nonBasicAsciiCharacterCount:0,hasMore:!1};for(const o of e){const r=nG.computeUnicodeHighlights(this._model,this._options,o);for(const s of r.ranges)n.ranges.push(s);n.ambiguousCharacterCount+=n.ambiguousCharacterCount,n.invisibleCharacterCount+=n.invisibleCharacterCount,n.nonBasicAsciiCharacterCount+=n.nonBasicAsciiCharacterCount,n.hasMore=n.hasMore||r.hasMore}if(!n.hasMore)for(const o of n.ranges)t.push({range:o,options:NO.instance.getDecorationFromOptions(this._options)});this._updateState(n),this._decorations.set(t)}getDecorationInfo(e){if(!this._decorations.has(e))return null;const t=this._editor.getModel(),n=t.getValueInRange(e.range);return $G(t,e)?{reason:PSe(n,this._options),inComment:zG(t,e),inString:UG(t,e)}:null}}let WU=class{constructor(e,t,n){this._editor=e,this._languageService=t,this._openerService=n,this.hoverOrdinal=5}computeSync(e,t){if(!this._editor.hasModel()||e.type!==1)return[];const n=this._editor.getModel(),o=this._editor.getContribution(Zy.ID);if(!o)return[];const r=[],s=new Set;let a=300;for(const l of t){const c=o.getDecorationInfo(l);if(!c)continue;const d=n.getValueInRange(l.range).codePointAt(0),h=y7(d);let f;switch(c.reason.kind){case 0:{BI(c.reason.confusableWith)?f=C("unicodeHighlight.characterIsAmbiguousASCII","The character {0} could be confused with the ASCII character {1}, which is more common in source code.",h,y7(c.reason.confusableWith.codePointAt(0))):f=C("unicodeHighlight.characterIsAmbiguous","The character {0} could be confused with the character {1}, which is more common in source code.",h,y7(c.reason.confusableWith.codePointAt(0)));break}case 1:f=C("unicodeHighlight.characterIsInvisible","The character {0} is invisible.",h);break;case 2:f=C("unicodeHighlight.characterIsNonBasicAscii","The character {0} is not a basic ASCII character.",h);break}if(s.has(f))continue;s.add(f);const g={codePoint:d,reason:c.reason,inComment:c.inComment,inString:c.inString},p=C("unicodeHighlight.adjustSettings","Adjust settings"),v=`command:${yT.ID}?${encodeURIComponent(JSON.stringify(g))}`,m=new is("",!0).appendMarkdown(f).appendText(" ").appendLink(v,p);r.push(new Dd(this,l.range,[m],!1,a++))}return r}renderHoverParts(e,t){return dye(e,t,this._editor,this._languageService,this._openerService)}};WU=VY([Vw(1,Ki),Vw(2,pl)],WU);function VU(i){return`U+${i.toString(16).padStart(4,"0")}`}function y7(i){let e=`\`${VU(i)}\``;return af.isInvisibleCharacter(i)||(e+=` "${`${lLt(i)}`}"`),e}function lLt(i){return i===96?"`` ` ``":"`"+String.fromCodePoint(i)+"`"}function PSe(i,e){return nG.computeUnicodeHighlightReason(i,e)}class NO{constructor(){this.map=new Map}getDecorationFromOptions(e){return this.getDecoration(!e.includeComments,!e.includeStrings)}getDecoration(e,t){const n=`${e}${t}`;let o=this.map.get(n);return o||(o=Jt.createDynamic({description:"unicode-highlight",stickiness:1,className:"unicode-highlight",showIfCollapsed:!0,overviewRuler:null,minimap:null,hideInCommentTokens:e,hideInStringTokens:t}),this.map.set(n,o)),o}}NO.instance=new NO;class cLt extends ft{constructor(){super({id:i_.ID,label:C("action.unicodeHighlight.disableHighlightingInComments","Disable highlighting of characters in comments"),alias:"Disable highlighting of characters in comments",precondition:void 0}),this.shortLabel=C("unicodeHighlight.disableHighlightingInComments.shortLabel","Disable Highlight In Comments")}run(e,t,n){return ps(this,void 0,void 0,function*(){const o=e==null?void 0:e.get(En);o&&this.runAction(o)})}runAction(e){return ps(this,void 0,void 0,function*(){yield e.updateValue(Ia.includeComments,!1,2)})}}class uLt extends ft{constructor(){super({id:i_.ID,label:C("action.unicodeHighlight.disableHighlightingInStrings","Disable highlighting of characters in strings"),alias:"Disable highlighting of characters in strings",precondition:void 0}),this.shortLabel=C("unicodeHighlight.disableHighlightingInStrings.shortLabel","Disable Highlight In Strings")}run(e,t,n){return ps(this,void 0,void 0,function*(){const o=e==null?void 0:e.get(En);o&&this.runAction(o)})}runAction(e){return ps(this,void 0,void 0,function*(){yield e.updateValue(Ia.includeStrings,!1,2)})}}class i_ extends ft{constructor(){super({id:i_.ID,label:C("action.unicodeHighlight.disableHighlightingOfAmbiguousCharacters","Disable highlighting of ambiguous characters"),alias:"Disable highlighting of ambiguous characters",precondition:void 0}),this.shortLabel=C("unicodeHighlight.disableHighlightingOfAmbiguousCharacters.shortLabel","Disable Ambiguous Highlight")}run(e,t,n){return ps(this,void 0,void 0,function*(){const o=e==null?void 0:e.get(En);o&&this.runAction(o)})}runAction(e){return ps(this,void 0,void 0,function*(){yield e.updateValue(Ia.ambiguousCharacters,!1,2)})}}i_.ID="editor.action.unicodeHighlight.disableHighlightingOfAmbiguousCharacters";class AS extends ft{constructor(){super({id:AS.ID,label:C("action.unicodeHighlight.disableHighlightingOfInvisibleCharacters","Disable highlighting of invisible characters"),alias:"Disable highlighting of invisible characters",precondition:void 0}),this.shortLabel=C("unicodeHighlight.disableHighlightingOfInvisibleCharacters.shortLabel","Disable Invisible Highlight")}run(e,t,n){return ps(this,void 0,void 0,function*(){const o=e==null?void 0:e.get(En);o&&this.runAction(o)})}runAction(e){return ps(this,void 0,void 0,function*(){yield e.updateValue(Ia.invisibleCharacters,!1,2)})}}AS.ID="editor.action.unicodeHighlight.disableHighlightingOfInvisibleCharacters";class PS extends ft{constructor(){super({id:PS.ID,label:C("action.unicodeHighlight.disableHighlightingOfNonBasicAsciiCharacters","Disable highlighting of non basic ASCII characters"),alias:"Disable highlighting of non basic ASCII characters",precondition:void 0}),this.shortLabel=C("unicodeHighlight.disableHighlightingOfNonBasicAsciiCharacters.shortLabel","Disable Non ASCII Highlight")}run(e,t,n){return ps(this,void 0,void 0,function*(){const o=e==null?void 0:e.get(En);o&&this.runAction(o)})}runAction(e){return ps(this,void 0,void 0,function*(){yield e.updateValue(Ia.nonBasicASCII,!1,2)})}}PS.ID="editor.action.unicodeHighlight.disableHighlightingOfNonBasicAsciiCharacters";class yT extends ft{constructor(){super({id:yT.ID,label:C("action.unicodeHighlight.showExcludeOptions","Show Exclude Options"),alias:"Show Exclude Options",precondition:void 0})}run(e,t,n){return ps(this,void 0,void 0,function*(){const{codePoint:o,reason:r,inString:s,inComment:a}=n,l=String.fromCodePoint(o),c=e.get(lh),u=e.get(En);function d(g){return af.isInvisibleCharacter(g)?C("unicodeHighlight.excludeInvisibleCharFromBeingHighlighted","Exclude {0} (invisible character) from being highlighted",VU(g)):C("unicodeHighlight.excludeCharFromBeingHighlighted","Exclude {0} from being highlighted",`${VU(g)} "${l}"`)}const h=[];if(r.kind===0)for(const g of r.notAmbiguousInLocales)h.push({label:C("unicodeHighlight.allowCommonCharactersInLanguage",'Allow unicode characters that are more common in the language "{0}".',g),run:()=>ps(this,void 0,void 0,function*(){hLt(u,[g])})});if(h.push({label:d(o),run:()=>dLt(u,[o])}),a){const g=new cLt;h.push({label:g.label,run:()=>ps(this,void 0,void 0,function*(){return g.runAction(u)})})}else if(s){const g=new uLt;h.push({label:g.label,run:()=>ps(this,void 0,void 0,function*(){return g.runAction(u)})})}if(r.kind===0){const g=new i_;h.push({label:g.label,run:()=>ps(this,void 0,void 0,function*(){return g.runAction(u)})})}else if(r.kind===1){const g=new AS;h.push({label:g.label,run:()=>ps(this,void 0,void 0,function*(){return g.runAction(u)})})}else if(r.kind===2){const g=new PS;h.push({label:g.label,run:()=>ps(this,void 0,void 0,function*(){return g.runAction(u)})})}else fLt(r);const f=yield c.pick(h,{title:C("unicodeHighlight.configureUnicodeHighlightOptions","Configure Unicode Highlight Options")});f&&(yield f.run())})}}yT.ID="editor.action.unicodeHighlight.showExcludeOptions";function dLt(i,e){return ps(this,void 0,void 0,function*(){const t=i.getValue(Ia.allowedCharacters);let n;typeof t=="object"&&t?n=t:n={};for(const o of e)n[String.fromCodePoint(o)]=!0;yield i.updateValue(Ia.allowedCharacters,n,2)})}function hLt(i,e){var t;return ps(this,void 0,void 0,function*(){const n=(t=i.inspect(Ia.allowedLocales).user)===null||t===void 0?void 0:t.value;let o;typeof n=="object"&&n?o=Object.assign({},n):o={};for(const r of e)o[r]=!0;yield i.updateValue(Ia.allowedLocales,o,2)})}function fLt(i){throw new Error(`Unexpected value: ${i}`)}ze(i_);ze(AS);ze(PS);ze(yT);zn(Zy.ID,Zy,1);Jb.register(WU);var gLt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},zce=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},pLt=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};const OSe="ignoreUnusualLineTerminators";function mLt(i,e,t){i.setModelProperty(e.uri,OSe,t)}function vLt(i,e){return i.getModelProperty(e.uri,OSe)}let nI=class extends _e{constructor(e,t,n){super(),this._editor=e,this._dialogService=t,this._codeEditorService=n,this._isPresentingDialog=!1,this._config=this._editor.getOption(125),this._register(this._editor.onDidChangeConfiguration(o=>{o.hasChanged(125)&&(this._config=this._editor.getOption(125),this._checkForUnusualLineTerminators())})),this._register(this._editor.onDidChangeModel(()=>{this._checkForUnusualLineTerminators()})),this._register(this._editor.onDidChangeModelContent(o=>{o.isUndoing||this._checkForUnusualLineTerminators()})),this._checkForUnusualLineTerminators()}_checkForUnusualLineTerminators(){return pLt(this,void 0,void 0,function*(){if(this._config==="off"||!this._editor.hasModel())return;const e=this._editor.getModel();if(!e.mightContainUnusualLineTerminators()||vLt(this._codeEditorService,e)===!0||this._editor.getOption(90))return;if(this._config==="auto"){e.removeUnusualLineTerminators(this._editor.getSelections());return}if(this._isPresentingDialog)return;let n;try{this._isPresentingDialog=!0,n=yield this._dialogService.confirm({title:C("unusualLineTerminators.title","Unusual Line Terminators"),message:C("unusualLineTerminators.message","Detected unusual line terminators"),detail:C("unusualLineTerminators.detail","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`.",Hc(e.uri)),primaryButton:C({key:"unusualLineTerminators.fix",comment:["&& denotes a mnemonic"]},"&&Remove Unusual Line Terminators"),cancelButton:C("unusualLineTerminators.ignore","Ignore")})}finally{this._isPresentingDialog=!1}if(!n.confirmed){mLt(this._codeEditorService,e,!0);return}e.removeUnusualLineTerminators(this._editor.getSelections())})}};nI.ID="editor.contrib.unusualLineTerminatorsDetector";nI=gLt([zce(1,JI),zce(2,Jn)],nI);zn(nI.ID,nI,1);var _Lt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Uce=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},HU;const GF=new lt("hasWordHighlights",!1);function FSe(i,e,t,n){const o=i.ordered(e);return v0e(o.map(r=>()=>Promise.resolve(r.provideDocumentHighlights(e,t,n)).then(void 0,$o)),ws)}class BSe{constructor(e,t,n){this._model=e,this._selection=t,this._wordSeparators=n,this._wordRange=this._getCurrentWordRange(e,t),this._result=null}get result(){return this._result||(this._result=sr(e=>this._compute(this._model,this._selection,this._wordSeparators,e))),this._result}_getCurrentWordRange(e,t){const n=e.getWordAtPosition(t.getPosition());return n?new V(t.startLineNumber,n.startColumn,t.startLineNumber,n.endColumn):null}isValid(e,t,n){const o=t.startLineNumber,r=t.startColumn,s=t.endColumn,a=this._getCurrentWordRange(e,t);let l=Boolean(this._wordRange&&this._wordRange.equalsRange(a));for(let c=0,u=n.length;!l&&c=s&&(l=!0)}return l}cancel(){this.result.cancel()}}class bLt extends BSe{constructor(e,t,n,o){super(e,t,n),this._providers=o}_compute(e,t,n,o){return FSe(this._providers,e,t.getPosition(),o).then(r=>r||[])}}class CLt extends BSe{constructor(e,t,n){super(e,t,n),this._selectionIsEmpty=t.isEmpty()}_compute(e,t,n,o){return wv(250,o).then(()=>{if(!t.isEmpty())return[];const r=e.getWordAtPosition(t.getPosition());return!r||r.word.length>1e3?[]:e.findMatches(r.word,!0,!1,!0,n,!1).map(a=>({range:a.range,kind:ND.Text}))})}isValid(e,t,n){const o=t.isEmpty();return this._selectionIsEmpty!==o?!1:super.isValid(e,t,n)}}function wLt(i,e,t,n){return i.has(e)?new bLt(e,t,n,i):new CLt(e,t,n)}Nf("_executeDocumentHighlights",(i,e,t)=>{const n=i.get(pt);return FSe(n.documentHighlightProvider,e,t,_n.None)});class yLt{constructor(e,t,n,o){this.toUnhook=new Be,this.workerRequestTokenId=0,this.workerRequestCompleted=!1,this.workerRequestValue=[],this.lastCursorPositionChangeTime=0,this.renderDecorationsTimer=-1,this.editor=e,this.providers=t,this.linkedHighlighters=n,this._hasWordHighlights=GF.bindTo(o),this._ignorePositionChangeEvent=!1,this.occurrencesHighlight=this.editor.getOption(80),this.model=this.editor.getModel(),this.toUnhook.add(e.onDidChangeCursorPosition(r=>{this._ignorePositionChangeEvent||!this.occurrencesHighlight||this._onPositionChanged(r)})),this.toUnhook.add(e.onDidChangeModelContent(r=>{this._stopAll()})),this.toUnhook.add(e.onDidChangeConfiguration(r=>{const s=this.editor.getOption(80);this.occurrencesHighlight!==s&&(this.occurrencesHighlight=s,this._stopAll())})),this.decorations=this.editor.createDecorationsCollection(),this.workerRequestTokenId=0,this.workerRequest=null,this.workerRequestCompleted=!1,this.lastCursorPositionChangeTime=0,this.renderDecorationsTimer=-1}hasDecorations(){return this.decorations.length>0}restore(){!this.occurrencesHighlight||this._run()}_getSortedHighlights(){return this.decorations.getRanges().sort(V.compareRangesUsingStarts)}moveNext(){const e=this._getSortedHighlights(),n=(e.findIndex(r=>r.containsPosition(this.editor.getPosition()))+1)%e.length,o=e[n];try{this._ignorePositionChangeEvent=!0,this.editor.setPosition(o.getStartPosition()),this.editor.revealRangeInCenterIfOutsideViewport(o);const r=this._getWord();if(r){const s=this.editor.getModel().getLineContent(o.startLineNumber);bs(`${s}, ${n+1} of ${e.length} for '${r.word}'`)}}finally{this._ignorePositionChangeEvent=!1}}moveBack(){const e=this._getSortedHighlights(),n=(e.findIndex(r=>r.containsPosition(this.editor.getPosition()))-1+e.length)%e.length,o=e[n];try{this._ignorePositionChangeEvent=!0,this.editor.setPosition(o.getStartPosition()),this.editor.revealRangeInCenterIfOutsideViewport(o);const r=this._getWord();if(r){const s=this.editor.getModel().getLineContent(o.startLineNumber);bs(`${s}, ${n+1} of ${e.length} for '${r.word}'`)}}finally{this._ignorePositionChangeEvent=!1}}_removeDecorations(){this.decorations.length>0&&(this.decorations.clear(),this._hasWordHighlights.set(!1))}_stopAll(){this._removeDecorations(),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){this._stopAll();return}if(e.reason!==3){this._stopAll();return}this._run()}_getWord(){const e=this.editor.getSelection(),t=e.startLineNumber,n=e.startColumn;return this.model.getWordAtPosition({lineNumber:t,column:n})}_run(){const e=this.editor.getSelection();if(e.startLineNumber!==e.endLineNumber){this._stopAll();return}const t=e.startColumn,n=e.endColumn,o=this._getWord();if(!o||o.startColumn>t||o.endColumn{s===this.workerRequestTokenId&&(this.workerRequestCompleted=!0,this.workerRequestValue=a||[],this._beginRenderDecorations())},en)}}_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=[];for(const t of this.workerRequestValue)t.range&&e.push({range:t.range,options:qSt(t.kind)});this.decorations.set(e),this._hasWordHighlights.set(this.hasDecorations());for(const t of this.linkedHighlighters())(t==null?void 0:t.editor.getModel())===this.editor.getModel()&&(t._stopAll(),t.decorations.set(e),t._hasWordHighlights.set(t.hasDecorations()))}dispose(){this._stopAll(),this.toUnhook.dispose()}}let Lb=HU=class extends _e{static get(e){return e.getContribution(HU.ID)}constructor(e,t,n){super(),this.wordHighlighter=null,this.linkedContributions=new Set;const o=()=>{e.hasModel()&&!e.getModel().isTooLargeForTokenization()&&(this.wordHighlighter=new yLt(e,n.documentHighlightProvider,()=>mn.map(this.linkedContributions,r=>r.wordHighlighter),t))};this._register(e.onDidChangeModel(r=>{this.wordHighlighter&&(this.wordHighlighter.dispose(),this.wordHighlighter=null),o()})),o()}saveViewState(){return!!(this.wordHighlighter&&this.wordHighlighter.hasDecorations())}moveNext(){var e;(e=this.wordHighlighter)===null||e===void 0||e.moveNext()}moveBack(){var e;(e=this.wordHighlighter)===null||e===void 0||e.moveBack()}restoreViewState(e){this.wordHighlighter&&e&&this.wordHighlighter.restore()}dispose(){this.wordHighlighter&&(this.wordHighlighter.dispose(),this.wordHighlighter=null),super.dispose()}};Lb.ID="editor.contrib.wordHighlighter";Lb=HU=_Lt([Uce(1,Ut),Uce(2,pt)],Lb);class WSe extends ft{constructor(e,t){super(t),this._isNext=e}run(e,t){const n=Lb.get(t);!n||(this._isNext?n.moveNext():n.moveBack())}}class SLt extends WSe{constructor(){super(!0,{id:"editor.action.wordHighlight.next",label:C("wordHighlight.next.label","Go to Next Symbol Highlight"),alias:"Go to Next Symbol Highlight",precondition:GF,kbOpts:{kbExpr:Q.editorTextFocus,primary:65,weight:100}})}}class xLt extends WSe{constructor(){super(!1,{id:"editor.action.wordHighlight.prev",label:C("wordHighlight.previous.label","Go to Previous Symbol Highlight"),alias:"Go to Previous Symbol Highlight",precondition:GF,kbOpts:{kbExpr:Q.editorTextFocus,primary:1089,weight:100}})}}class LLt extends ft{constructor(){super({id:"editor.action.wordHighlight.trigger",label:C("wordHighlight.trigger.label","Trigger Symbol Highlight"),alias:"Trigger Symbol Highlight",precondition:GF.toNegated(),kbOpts:{kbExpr:Q.editorTextFocus,primary:0,weight:100}})}run(e,t,n){const o=Lb.get(t);!o||o.restoreViewState(!0)}}zn(Lb.ID,Lb,0);ze(SLt);ze(xLt);ze(LLt);class XF extends Ir{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode,this._wordNavigationType=e.wordNavigationType}runEditorCommand(e,t,n){if(!t.hasModel())return;const o=Wc(t.getOption(129)),r=t.getModel(),a=t.getSelections().map(l=>{const c=new ae(l.positionLineNumber,l.positionColumn),u=this._move(o,r,c,this._wordNavigationType);return this._moveTo(l,u,this._inSelectionMode)});if(r.pushStackElement(),t._getViewModel().setCursorStates("moveWordCommand",3,a.map(l=>kn.fromModelSelection(l))),a.length===1){const l=new ae(a[0].positionLineNumber,a[0].positionColumn);t.revealPosition(l,0)}}_moveTo(e,t,n){return n?new gt(e.selectionStartLineNumber,e.selectionStartColumn,t.lineNumber,t.column):new gt(t.lineNumber,t.column,t.lineNumber,t.column)}}class o_ extends XF{_move(e,t,n,o){return Qn.moveWordLeft(e,t,n,o)}}class r_ extends XF{_move(e,t,n,o){return Qn.moveWordRight(e,t,n,o)}}class ELt extends o_{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordStartLeft",precondition:void 0})}}class DLt extends o_{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordEndLeft",precondition:void 0})}}class kLt extends o_{constructor(){var e;super({inSelectionMode:!1,wordNavigationType:1,id:"cursorWordLeft",precondition:void 0,kbOpts:{kbExpr:Me.and(Q.textInputFocus,(e=Me.and(UI,F5))===null||e===void 0?void 0:e.negate()),primary:2063,mac:{primary:527},weight:100}})}}class ILt extends o_{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordStartLeftSelect",precondition:void 0})}}class TLt extends o_{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordEndLeftSelect",precondition:void 0})}}class NLt extends o_{constructor(){var e;super({inSelectionMode:!0,wordNavigationType:1,id:"cursorWordLeftSelect",precondition:void 0,kbOpts:{kbExpr:Me.and(Q.textInputFocus,(e=Me.and(UI,F5))===null||e===void 0?void 0:e.negate()),primary:3087,mac:{primary:1551},weight:100}})}}class RLt extends o_{constructor(){super({inSelectionMode:!1,wordNavigationType:3,id:"cursorWordAccessibilityLeft",precondition:void 0})}_move(e,t,n,o){return super._move(Wc(ih.wordSeparators.defaultValue),t,n,o)}}class MLt extends o_{constructor(){super({inSelectionMode:!0,wordNavigationType:3,id:"cursorWordAccessibilityLeftSelect",precondition:void 0})}_move(e,t,n,o){return super._move(Wc(ih.wordSeparators.defaultValue),t,n,o)}}class ALt extends r_{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordStartRight",precondition:void 0})}}class PLt extends r_{constructor(){var e;super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordEndRight",precondition:void 0,kbOpts:{kbExpr:Me.and(Q.textInputFocus,(e=Me.and(UI,F5))===null||e===void 0?void 0:e.negate()),primary:2065,mac:{primary:529},weight:100}})}}class OLt extends r_{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordRight",precondition:void 0})}}class FLt extends r_{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordStartRightSelect",precondition:void 0})}}class BLt extends r_{constructor(){var e;super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordEndRightSelect",precondition:void 0,kbOpts:{kbExpr:Me.and(Q.textInputFocus,(e=Me.and(UI,F5))===null||e===void 0?void 0:e.negate()),primary:3089,mac:{primary:1553},weight:100}})}}class WLt extends r_{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordRightSelect",precondition:void 0})}}class VLt extends r_{constructor(){super({inSelectionMode:!1,wordNavigationType:3,id:"cursorWordAccessibilityRight",precondition:void 0})}_move(e,t,n,o){return super._move(Wc(ih.wordSeparators.defaultValue),t,n,o)}}class HLt extends r_{constructor(){super({inSelectionMode:!0,wordNavigationType:3,id:"cursorWordAccessibilityRightSelect",precondition:void 0})}_move(e,t,n,o){return super._move(Wc(ih.wordSeparators.defaultValue),t,n,o)}}class YF extends Ir{constructor(e){super(e),this._whitespaceHeuristics=e.whitespaceHeuristics,this._wordNavigationType=e.wordNavigationType}runEditorCommand(e,t,n){const o=e.get(Ti);if(!t.hasModel())return;const r=Wc(t.getOption(129)),s=t.getModel(),a=t.getSelections(),l=t.getOption(6),c=t.getOption(11),u=o.getLanguageConfiguration(s.getLanguageId()).getAutoClosingPairs(),d=t._getViewModel(),h=a.map(f=>{const g=this._delete({wordSeparators:r,model:s,selection:f,whitespaceHeuristics:this._whitespaceHeuristics,autoClosingDelete:t.getOption(9),autoClosingBrackets:l,autoClosingQuotes:c,autoClosingPairs:u,autoClosedCharacters:d.getCursorAutoClosedCharacters()},this._wordNavigationType);return new Qr(g,"")});t.pushUndoStop(),t.executeCommands(this.id,h),t.pushUndoStop()}}class HY extends YF{_delete(e,t){const n=Qn.deleteWordLeft(e,t);return n||new V(1,1,1,1)}}class $Y extends YF{_delete(e,t){const n=Qn.deleteWordRight(e,t);if(n)return n;const o=e.model.getLineCount(),r=e.model.getLineMaxColumn(o);return new V(o,r,o,r)}}class $Lt extends HY{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:0,id:"deleteWordStartLeft",precondition:Q.writable})}}class zLt extends HY{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:2,id:"deleteWordEndLeft",precondition:Q.writable})}}class ULt extends HY{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:0,id:"deleteWordLeft",precondition:Q.writable,kbOpts:{kbExpr:Q.textInputFocus,primary:2049,mac:{primary:513},weight:100}})}}class jLt extends $Y{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:0,id:"deleteWordStartRight",precondition:Q.writable})}}class KLt extends $Y{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:2,id:"deleteWordEndRight",precondition:Q.writable})}}class qLt extends $Y{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:2,id:"deleteWordRight",precondition:Q.writable,kbOpts:{kbExpr:Q.textInputFocus,primary:2068,mac:{primary:532},weight:100}})}}class GLt extends ft{constructor(){super({id:"deleteInsideWord",precondition:Q.writable,label:C("deleteInsideWord","Delete Word"),alias:"Delete Word"})}run(e,t,n){if(!t.hasModel())return;const o=Wc(t.getOption(129)),r=t.getModel(),a=t.getSelections().map(l=>{const c=Qn.deleteInsideWord(o,r,l);return new Qr(c,"")});t.pushUndoStop(),t.executeCommands(this.id,a),t.pushUndoStop()}}Ye(new ELt);Ye(new DLt);Ye(new kLt);Ye(new ILt);Ye(new TLt);Ye(new NLt);Ye(new ALt);Ye(new PLt);Ye(new OLt);Ye(new FLt);Ye(new BLt);Ye(new WLt);Ye(new RLt);Ye(new MLt);Ye(new VLt);Ye(new HLt);Ye(new $Lt);Ye(new zLt);Ye(new ULt);Ye(new jLt);Ye(new KLt);Ye(new qLt);ze(GLt);class XLt extends YF{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:0,id:"deleteWordPartLeft",precondition:Q.writable,kbOpts:{kbExpr:Q.textInputFocus,primary:0,mac:{primary:769},weight:100}})}_delete(e,t){const n=v5.deleteWordPartLeft(e);return n||new V(1,1,1,1)}}class YLt extends YF{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:2,id:"deleteWordPartRight",precondition:Q.writable,kbOpts:{kbExpr:Q.textInputFocus,primary:0,mac:{primary:788},weight:100}})}_delete(e,t){const n=v5.deleteWordPartRight(e);if(n)return n;const o=e.model.getLineCount(),r=e.model.getLineMaxColumn(o);return new V(o,r,o,r)}}class VSe extends XF{_move(e,t,n,o){return v5.moveWordPartLeft(e,t,n)}}class ZLt extends VSe{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordPartLeft",precondition:void 0,kbOpts:{kbExpr:Q.textInputFocus,primary:0,mac:{primary:783},weight:100}})}}Rn.registerCommandAlias("cursorWordPartStartLeft","cursorWordPartLeft");class QLt extends VSe{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordPartLeftSelect",precondition:void 0,kbOpts:{kbExpr:Q.textInputFocus,primary:0,mac:{primary:1807},weight:100}})}}Rn.registerCommandAlias("cursorWordPartStartLeftSelect","cursorWordPartLeftSelect");class HSe extends XF{_move(e,t,n,o){return v5.moveWordPartRight(e,t,n)}}class JLt extends HSe{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordPartRight",precondition:void 0,kbOpts:{kbExpr:Q.textInputFocus,primary:0,mac:{primary:785},weight:100}})}}class eEt extends HSe{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordPartRightSelect",precondition:void 0,kbOpts:{kbExpr:Q.textInputFocus,primary:0,mac:{primary:1809},weight:100}})}}Ye(new XLt);Ye(new YLt);Ye(new ZLt);Ye(new QLt);Ye(new JLt);Ye(new eEt);class $U extends _e{constructor(e){super(),this.editor=e,this._register(this.editor.onDidAttemptReadOnlyEdit(()=>this._onDidAttemptReadOnlyEdit()))}_onDidAttemptReadOnlyEdit(){const e=ll.get(this.editor);if(e&&this.editor.hasModel()){let t=this.editor.getOptions().get(91);t||(this.editor.isSimpleWidget?t=new is(C("editor.simple.readonly","Cannot edit in read-only input")):t=new is(C("editor.readonly","Cannot edit in read-only editor"))),e.showMessage(t,this.editor.getPosition())}}}$U.ID="editor.contrib.readOnlyMessageController";zn($U.ID,$U,2);class zU extends _e{constructor(e){super(),this.editor=e,this.widget=null,jd&&(this._register(e.onDidChangeConfiguration(()=>this.update())),this.update())}update(){const e=!this.editor.getOption(90);!this.widget&&e?this.widget=new ZF(this.editor):this.widget&&!e&&(this.widget.dispose(),this.widget=null)}dispose(){super.dispose(),this.widget&&(this.widget.dispose(),this.widget=null)}}zU.ID="editor.contrib.iPadShowKeyboard";class ZF extends _e{constructor(e){super(),this.editor=e,this._domNode=document.createElement("textarea"),this._domNode.className="iPadShowKeyboard",this._register(ke(this._domNode,"touchstart",t=>{this.editor.focus()})),this._register(ke(this._domNode,"focus",t=>{this.editor.focus()})),this.editor.addOverlayWidget(this)}dispose(){this.editor.removeOverlayWidget(this),super.dispose()}getId(){return ZF.ID}getDomNode(){return this._domNode}getPosition(){return{preference:1}}}ZF.ID="editor.contrib.ShowKeyboardWidget";zn(zU.ID,zU,3);var tEt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},jce=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},UU;let Qy=UU=class extends _e{static get(e){return e.getContribution(UU.ID)}constructor(e,t,n){super(),this._editor=e,this._languageService=n,this._widget=null,this._register(this._editor.onDidChangeModel(o=>this.stop())),this._register(this._editor.onDidChangeModelLanguage(o=>this.stop())),this._register(oo.onDidChange(o=>this.stop())),this._register(this._editor.onKeyUp(o=>o.keyCode===9&&this.stop()))}dispose(){this.stop(),super.dispose()}launch(){this._widget||!this._editor.hasModel()||(this._widget=new QF(this._editor,this._languageService))}stop(){this._widget&&(this._widget.dispose(),this._widget=null)}};Qy.ID="editor.contrib.inspectTokens";Qy=UU=tEt([jce(1,nc),jce(2,Ki)],Qy);class nEt extends ft{constructor(){super({id:"editor.action.inspectTokens",label:$H.inspectTokensAction,alias:"Developer: Inspect Tokens",precondition:void 0})}run(e,t){const n=Qy.get(t);n==null||n.launch()}}function iEt(i){let e="";for(let t=0,n=i.length;tby,tokenize:(o,r,s)=>lG(e,s),tokenizeEncoded:(o,r,s)=>u5(n,s)}}class QF extends _e{constructor(e,t){super(),this.allowEditorOverflow=!0,this._editor=e,this._languageService=t,this._model=this._editor.getModel(),this._domNode=document.createElement("div"),this._domNode.className="tokens-inspect-widget",this._tokenizationSupport=oEt(this._languageService.languageIdCodec,this._model.getLanguageId()),this._compute(this._editor.getPosition()),this._register(this._editor.onDidChangeCursorPosition(n=>this._compute(this._editor.getPosition()))),this._editor.addContentWidget(this)}dispose(){this._editor.removeContentWidget(this),super.dispose()}getId(){return QF._ID}_compute(e){const t=this._getTokensAtLine(e.lineNumber);let n=0;for(let l=t.tokens1.length-1;l>=0;l--){const c=t.tokens1[l];if(e.column-1>=c.offset){n=l;break}}let o=0;for(let l=t.tokens2.length>>>1;l>=0;l--)if(e.column-1>=t.tokens2[l<<1]){o=l;break}const r=this._model.getLineContent(e.lineNumber);let s="";if(n=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Kce=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},FL;let RO=FL=class{constructor(e,t){this.quickInputService=e,this.keybindingService=t,this.registry=no.as(Kb.Quickaccess)}provide(e){const t=new Be;return t.add(e.onDidAccept(()=>{const[n]=e.selectedItems;n&&this.quickInputService.quickAccess.show(n.prefix,{preserveValue:!0})})),t.add(e.onDidChangeValue(n=>{const o=this.registry.getQuickAccessProvider(n.substr(FL.PREFIX.length));o&&o.prefix&&o.prefix!==FL.PREFIX&&this.quickInputService.quickAccess.show(o.prefix,{preserveValue:!0})})),e.items=this.getQuickAccessProviders().filter(n=>n.prefix!==FL.PREFIX),t}getQuickAccessProviders(){return this.registry.getQuickAccessProviders().sort((t,n)=>t.prefix.localeCompare(n.prefix)).flatMap(t=>this.createPicks(t))}createPicks(e){return e.helpEntries.map(t=>{const n=t.prefix||e.prefix,o=n||"\u2026";return{prefix:n,label:o,keybinding:t.commandId?this.keybindingService.lookupKeybinding(t.commandId):void 0,ariaLabel:C("helpPickAriaLabel","{0}, {1}",o,t.description),description:t.description}})}};RO.PREFIX="?";RO=FL=rEt([Kce(0,lh),Kce(1,xi)],RO);no.as(Kb.Quickaccess).registerQuickAccessProvider({ctor:RO,prefix:"",helpEntries:[{description:zH.helpQuickAccessActionLabel}]});class $Se{constructor(e){this.options=e,this.rangeHighlightDecorationId=void 0}provide(e,t){var n;const o=new Be;e.canAcceptInBackground=!!(!((n=this.options)===null||n===void 0)&&n.canAcceptInBackground),e.matchOnLabel=e.matchOnDescription=e.matchOnDetail=e.sortByLabel=!1;const r=o.add(new Kr);return r.value=this.doProvide(e,t),o.add(this.onDidActiveTextEditorControlChange(()=>{r.value=void 0,r.value=this.doProvide(e,t)})),o}doProvide(e,t){var n;const o=new Be,r=this.activeTextEditorControl;if(r&&this.canProvideWithTextEditor(r)){const s={editor:r},a=KCe(r);if(a){let l=(n=r.saveViewState())!==null&&n!==void 0?n:void 0;o.add(a.onDidChangeCursorPosition(()=>{var c;l=(c=r.saveViewState())!==null&&c!==void 0?c:void 0})),s.restoreViewState=()=>{l&&r===this.activeTextEditorControl&&r.restoreViewState(l)},o.add(_v(t.onCancellationRequested)(()=>{var c;return(c=s.restoreViewState)===null||c===void 0?void 0:c.call(s)}))}o.add(zt(()=>this.clearDecorations(r))),o.add(this.provideWithTextEditor(s,e,t))}else o.add(this.provideWithoutTextEditor(e,t));return o}canProvideWithTextEditor(e){return!0}gotoLocation({editor:e},t){e.setSelection(t.range),e.revealRangeInCenter(t.range,0),t.preserveFocus||e.focus();const n=e.getModel();n&&"getLineContent"in n&&Lv(`${n.getLineContent(t.range.startLineNumber)}`)}getModel(e){var t;return jCe(e)?(t=e.getModel())===null||t===void 0?void 0:t.modified:e.getModel()}addDecorations(e,t){e.changeDecorations(n=>{const o=[];this.rangeHighlightDecorationId&&(o.push(this.rangeHighlightDecorationId.overviewRulerDecorationId),o.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:ro(gbe),position:Xl.Full}}}],[s,a]=n.deltaDecorations(o,r);this.rangeHighlightDecorationId={rangeHighlightId:s,overviewRulerDecorationId:a}})}clearDecorations(e){const t=this.rangeHighlightDecorationId;t&&(e.changeDecorations(n=>{n.deltaDecorations([t.overviewRulerDecorationId,t.rangeHighlightId],[])}),this.rangeHighlightDecorationId=void 0)}}class JF extends $Se{constructor(){super({canAcceptInBackground:!0})}provideWithoutTextEditor(e){const t=C("cannotRunGotoLine","Open a text editor first to go to a line.");return e.items=[{label:t}],e.ariaLabel=t,_e.None}provideWithTextEditor(e,t,n){const o=e.editor,r=new Be;r.add(t.onDidAccept(l=>{const[c]=t.selectedItems;if(c){if(!this.isValidLineNumber(o,c.lineNumber))return;this.gotoLocation(e,{range:this.toRange(c.lineNumber,c.column),keyMods:t.keyMods,preserveFocus:l.inBackground}),l.inBackground||t.hide()}}));const s=()=>{const l=this.parsePosition(o,t.value.trim().substr(JF.PREFIX.length)),c=this.getPickLabel(o,l.lineNumber,l.column);if(t.items=[{lineNumber:l.lineNumber,column:l.column,label:c}],t.ariaLabel=c,!this.isValidLineNumber(o,l.lineNumber)){this.clearDecorations(o);return}const u=this.toRange(l.lineNumber,l.column);o.revealRangeInCenter(u,0),this.addDecorations(o,u)};s(),r.add(t.onDidChangeValue(()=>s()));const a=KCe(o);return a&&a.getOptions().get(67).renderType===2&&(a.updateOptions({lineNumbers:"on"}),r.add(zt(()=>a.updateOptions({lineNumbers:"relative"})))),r}toRange(e=1,t=1){return{startLineNumber:e,startColumn:t,endLineNumber:e,endColumn:t}}parsePosition(e,t){const n=t.split(/,|:|#/).map(r=>parseInt(r,10)).filter(r=>!isNaN(r)),o=this.lineCount(e)+1;return{lineNumber:n[0]>0?n[0]:o+n[0],column:n[1]}}getPickLabel(e,t,n){if(this.isValidLineNumber(e,t))return this.isValidColumn(e,t,n)?C("gotoLineColumnLabel","Go to line {0} and character {1}.",t,n):C("gotoLineLabel","Go to line {0}.",t);const o=e.getPosition()||{lineNumber:1,column:1},r=this.lineCount(e);return r>1?C("gotoLineLabelEmptyWithLimit","Current Line: {0}, Character: {1}. Type a line number between 1 and {2} to navigate to.",o.lineNumber,o.column,r):C("gotoLineLabelEmpty","Current Line: {0}, Character: {1}. Type a line number to navigate to.",o.lineNumber,o.column)}isValidLineNumber(e,t){return!t||typeof t!="number"?!1:t>0&&t<=this.lineCount(e)}isValidColumn(e,t,n){if(!n||typeof n!="number")return!1;const o=this.getModel(e);if(!o)return!1;const r={lineNumber:t,column:n};return o.validatePosition(r).equals(r)}lineCount(e){var t,n;return(n=(t=this.getModel(e))===null||t===void 0?void 0:t.getLineCount())!==null&&n!==void 0?n:0}}JF.PREFIX=":";var sEt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},aEt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let iI=class extends JF{constructor(e){super(),this.editorService=e,this.onDidActiveTextEditorControlChange=st.None}get activeTextEditorControl(){var e;return(e=this.editorService.getFocusedCodeEditor())!==null&&e!==void 0?e:void 0}};iI=sEt([aEt(0,Jn)],iI);class ST extends ft{constructor(){super({id:ST.ID,label:EP.gotoLineActionLabel,alias:"Go to Line/Column...",precondition:void 0,kbOpts:{kbExpr:Q.focus,primary:2085,mac:{primary:293},weight:100}})}run(e){e.get(lh).quickAccess.show(iI.PREFIX)}}ST.ID="editor.action.gotoLine";ze(ST);no.as(Kb.Quickaccess).registerQuickAccessProvider({ctor:iI,prefix:iI.PREFIX,helpEntries:[{description:EP.gotoLineActionLabel,commandId:ST.ID}]});const zSe=[void 0,[]];function S7(i,e,t=0,n=0){const o=e;return o.values&&o.values.length>1?lEt(i,o.values,t,n):USe(i,e,t,n)}function lEt(i,e,t,n){let o=0;const r=[];for(const s of e){const[a,l]=USe(i,s,t,n);if(typeof a!="number")return zSe;o+=a,r.push(...l)}return[o,cEt(r)]}function USe(i,e,t,n){const o=ib(e.original,e.originalLowercase,t,i,i.toLowerCase(),n,{firstMatchCanBeWeak:!0,boostFullMatch:!0});return o?[o[0],tT(o)]:zSe}Object.freeze({score:0});function cEt(i){const e=i.sort((o,r)=>o.start-r.start),t=[];let n;for(const o of e)!n||!uEt(n,o)?(n=o,t.push(o)):(n.start=Math.min(n.start,o.start),n.end=Math.max(n.end,o.end));return t}function uEt(i,e){return!(i.end=0,s=qce(i);let a;const l=i.split(jSe);if(l.length>1)for(const c of l){const u=qce(c),{pathNormalized:d,normalized:h,normalizedLowercase:f}=Gce(c);h&&(a||(a=[]),a.push({original:c,originalLowercase:c.toLowerCase(),pathNormalized:d,normalized:h,normalizedLowercase:f,expectContiguousMatch:u}))}return{original:i,originalLowercase:e,pathNormalized:t,normalized:n,normalizedLowercase:o,values:a,containsPathSeparator:r,expectContiguousMatch:s}}function Gce(i){let e;as?e=i.replace(/\//g,Bd):e=i.replace(/\\/g,Bd);const t=rZe(e).replace(/\s|"/g,"");return{pathNormalized:e,normalized:t,normalizedLowercase:t.toLowerCase()}}function Xce(i){return Array.isArray(i)?jU(i.map(e=>e.original).join(jSe)):jU(i.original)}var dEt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Yce=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},oL=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},Hw;let cf=Hw=class extends $Se{constructor(e,t,n=Object.create(null)){super(n),this._languageFeaturesService=e,this._outlineModelService=t,this.options=n,this.options.canAcceptInBackground=!0}provideWithoutTextEditor(e){return this.provideLabelPick(e,C("cannotRunGotoSymbolWithoutEditor","To go to a symbol, first open a text editor with symbol information.")),_e.None}provideWithTextEditor(e,t,n){const o=e.editor,r=this.getModel(o);return r?this._languageFeaturesService.documentSymbolProvider.has(r)?this.doProvideWithEditorSymbols(e,r,t,n):this.doProvideWithoutEditorSymbols(e,r,t,n):_e.None}doProvideWithoutEditorSymbols(e,t,n,o){const r=new Be;return this.provideLabelPick(n,C("cannotRunGotoSymbolWithoutSymbolProvider","The active text editor does not provide symbol information.")),oL(this,void 0,void 0,function*(){!(yield this.waitForLanguageSymbolRegistry(t,r))||o.isCancellationRequested||r.add(this.doProvideWithEditorSymbols(e,t,n,o))}),r}provideLabelPick(e,t){e.items=[{label:t,index:0,kind:14}],e.ariaLabel=t}waitForLanguageSymbolRegistry(e,t){return oL(this,void 0,void 0,function*(){if(this._languageFeaturesService.documentSymbolProvider.has(e))return!0;const n=new t5,o=t.add(this._languageFeaturesService.documentSymbolProvider.onDidChange(()=>{this._languageFeaturesService.documentSymbolProvider.has(e)&&(o.dispose(),n.complete(!0))}));return t.add(zt(()=>n.complete(!1))),n.p})}doProvideWithEditorSymbols(e,t,n,o){var r;const s=e.editor,a=new Be;a.add(n.onDidAccept(d=>{const[h]=n.selectedItems;h&&h.range&&(this.gotoLocation(e,{range:h.range.selection,keyMods:n.keyMods,preserveFocus:d.inBackground}),d.inBackground||n.hide())})),a.add(n.onDidTriggerItemButton(({item:d})=>{d&&d.range&&(this.gotoLocation(e,{range:d.range.selection,keyMods:n.keyMods,forceSideBySide:!0}),n.hide())}));const l=this.getDocumentSymbols(t,o);let c;const u=d=>oL(this,void 0,void 0,function*(){c==null||c.dispose(!0),n.busy=!1,c=new Ro(o),n.busy=!0;try{const h=jU(n.value.substr(Hw.PREFIX.length).trim()),f=yield this.doGetSymbolPicks(l,h,void 0,c.token);if(o.isCancellationRequested)return;if(f.length>0){if(n.items=f,d&&h.original.length===0){const g=ZA(f,p=>Boolean(p.type!=="separator"&&p.range&&V.containsPosition(p.range.decoration,d)));g&&(n.activeItems=[g])}}else h.original.length>0?this.provideLabelPick(n,C("noMatchingSymbolResults","No matching editor symbols")):this.provideLabelPick(n,C("noSymbolResults","No editor symbols"))}finally{o.isCancellationRequested||(n.busy=!1)}});return a.add(n.onDidChangeValue(()=>u(void 0))),u((r=s.getSelection())===null||r===void 0?void 0:r.getPosition()),a.add(n.onDidChangeActive(()=>{const[d]=n.activeItems;d&&d.range&&(s.revealRangeInCenter(d.range.selection,0),this.addDecorations(s,d.range.decoration))})),a}doGetSymbolPicks(e,t,n,o){var r,s;return oL(this,void 0,void 0,function*(){const a=yield e;if(o.isCancellationRequested)return[];const l=t.original.indexOf(Hw.SCOPE_PREFIX)===0,c=l?1:0;let u,d;t.values&&t.values.length>1?(u=Xce(t.values[0]),d=Xce(t.values.slice(1))):u=t;let h;const f=(s=(r=this.options)===null||r===void 0?void 0:r.openSideBySideDirection)===null||s===void 0?void 0:s.call(r);f&&(h=[{iconClass:f==="right"?Mt.asClassName(Xe.splitHorizontal):Mt.asClassName(Xe.splitVertical),tooltip:f==="right"?C("openToSide","Open to the Side"):C("openToBottom","Open to the Bottom")}]);const g=[];for(let m=0;mc){let P=!1;if(u!==t&&([E,I]=S7(y,Object.assign(Object.assign({},t),{values:void 0}),c,L),typeof E=="number"&&(P=!0)),typeof E!="number"&&([E,I]=S7(y,u,c,L),typeof E!="number"))continue;if(!P&&d){if(D&&d.original.length>0&&([k,R]=S7(D,d)),typeof k!="number")continue;typeof E=="number"&&(E+=k)}}const A=_.tags&&_.tags.indexOf(1)>=0;g.push({index:m,kind:_.kind,score:E,label:y,ariaLabel:JYe(_.name,_.kind),description:D,highlights:A?void 0:{label:I,description:R},range:{selection:V.collapseToStart(_.selectionRange),decoration:_.range},strikethrough:A,buttons:h})}const p=g.sort((m,_)=>l?this.compareByKindAndScore(m,_):this.compareByScore(m,_));let v=[];if(l){let y=function(){_&&typeof m=="number"&&w>0&&(_.label=G0(L7[m]||x7,w))},m,_,w=0;for(const L of p)m!==L.kind?(y(),m=L.kind,w=1,_={type:"separator"},v.push(_)):w++,v.push(L);y()}else p.length>0&&(v=[{label:C("symbols","symbols ({0})",g.length),type:"separator"},...p]);return v})}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 n=L7[e.kind]||x7,o=L7[t.kind]||x7,r=n.localeCompare(o);return r===0?this.compareByScore(e,t):r}getDocumentSymbols(e,t){return oL(this,void 0,void 0,function*(){const n=yield this._outlineModelService.getOrCreate(e,t);return t.isCancellationRequested?[]:n.asListOfDocumentSymbols()})}};cf.PREFIX="@";cf.SCOPE_PREFIX=":";cf.PREFIX_BY_CATEGORY=`${Hw.PREFIX}${Hw.SCOPE_PREFIX}`;cf=Hw=dEt([Yce(0,pt),Yce(1,LF)],cf);const x7=C("property","properties ({0})"),L7={[5]:C("method","methods ({0})"),[11]:C("function","functions ({0})"),[8]:C("_constructor","constructors ({0})"),[12]:C("variable","variables ({0})"),[4]:C("class","classes ({0})"),[22]:C("struct","structs ({0})"),[23]:C("event","events ({0})"),[24]:C("operator","operators ({0})"),[10]:C("interface","interfaces ({0})"),[2]:C("namespace","namespaces ({0})"),[3]:C("package","packages ({0})"),[25]:C("typeParameter","type parameters ({0})"),[1]:C("modules","modules ({0})"),[6]:C("property","properties ({0})"),[9]:C("enum","enumerations ({0})"),[21]:C("enumMember","enumeration members ({0})"),[14]:C("string","strings ({0})"),[0]:C("file","files ({0})"),[17]:C("array","arrays ({0})"),[15]:C("number","numbers ({0})"),[16]:C("boolean","booleans ({0})"),[18]:C("object","objects ({0})"),[19]:C("key","keys ({0})"),[7]:C("field","fields ({0})"),[13]:C("constant","constants ({0})")};var hEt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},E7=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let KU=class extends cf{constructor(e,t,n){super(t,n),this.editorService=e,this.onDidActiveTextEditorControlChange=st.None}get activeTextEditorControl(){var e;return(e=this.editorService.getFocusedCodeEditor())!==null&&e!==void 0?e:void 0}};KU=hEt([E7(0,Jn),E7(1,pt),E7(2,LF)],KU);class xT extends ft{constructor(){super({id:xT.ID,label:hk.quickOutlineActionLabel,alias:"Go to Symbol...",precondition:Q.hasDocumentSymbolProvider,kbOpts:{kbExpr:Q.focus,primary:3117,weight:100},contextMenuOpts:{group:"navigation",order:3}})}run(e){e.get(lh).quickAccess.show(cf.PREFIX,{itemActivation:md.NONE})}}xT.ID="editor.action.quickOutline";ze(xT);no.as(Kb.Quickaccess).registerQuickAccessProvider({ctor:KU,prefix:cf.PREFIX,helpEntries:[{description:hk.quickOutlineActionLabel,prefix:cf.PREFIX,commandId:xT.ID},{description:hk.quickOutlineByCategoryActionLabel,prefix:cf.PREFIX_BY_CATEGORY}]});function D7(i,e){return e&&(i.stack||i.stacktrace)?C("stackTrace.format","{0}: {1}",Qce(i),Zce(i.stack)||Zce(i.stacktrace)):Qce(i)}function Zce(i){return Array.isArray(i)?i.join(` -`):i}function Qce(i){return i.code==="ERR_UNC_HOST_NOT_ALLOWED"?`${i.message}. Please update the 'security.allowedUNCHosts' setting if you want to allow this host.`:typeof i.code=="string"&&typeof i.errno=="number"&&typeof i.syscall=="string"?C("nodeExceptionMessage","A system error occurred ({0})",i.message):i.message||C("error.defaultMessage","An unknown error occurred. Please consult the log for more details.")}function KSe(i=null,e=!1){if(!i)return C("error.defaultMessage","An unknown error occurred. Please consult the log for more details.");if(Array.isArray(i)){const t=df(i),n=KSe(t[0],e);return t.length>1?C("error.moreErrors","{0} ({1} errors in total)",n,t.length):n}if(aa(i))return i;if(i.detail){const t=i.detail;if(t.error)return D7(t.error,e);if(t.exception)return D7(t.exception,e)}return i.stack?D7(i,e):i.message?i.message:C("error.defaultMessage","An unknown error occurred. Please consult the log for more details.")}function fEt(i){var e;const t=new Map;for(const n of i)t.set(n,((e=t.get(n))!==null&&e!==void 0?e:0)+1);return t}class BE{constructor(){this.chunkCount=0,this.chunkOccurrences=new Map,this.documents=new Map}calculateScores(e,t){const n=this.computeEmbedding(e),o=new Map,r=[];for(const[s,a]of this.documents){if(t.isCancellationRequested)return[];for(const l of a.chunks){const c=this.computeSimilarityScore(l,n,o);c>0&&r.push({key:s,score:c})}}return r}static termFrequencies(e){return fEt(BE.splitTerms(e))}static*splitTerms(e){const t=n=>n.toLowerCase();for(const[n]of e.matchAll(/\b\p{Letter}[\p{Letter}\d]{2,}\b/gu)){yield t(n);const o=n.split(new RegExp("(?<=[a-z])(?=[A-Z])","g"));if(o.length>1)for(const r of o)r.length>2&&/\p{Letter}{3,}/gu.test(r)&&(yield t(r))}}updateDocuments(e){var t;for(const{key:n}of e)this.deleteDocument(n);for(const n of e){const o=[];for(const r of n.textChunks){const s=BE.termFrequencies(r);for(const a of s.keys())this.chunkOccurrences.set(a,((t=this.chunkOccurrences.get(a))!==null&&t!==void 0?t:0)+1);o.push({text:r,tf:s})}this.chunkCount+=o.length,this.documents.set(n.key,{chunks:o})}return this}deleteDocument(e){const t=this.documents.get(e);if(!!t){this.documents.delete(e),this.chunkCount-=t.chunks.length;for(const n of t.chunks)for(const o of n.tf.keys()){const r=this.chunkOccurrences.get(o);if(typeof r=="number"){const s=r-1;s<=0?this.chunkOccurrences.delete(o):this.chunkOccurrences.set(o,s)}}}}computeSimilarityScore(e,t,n){let o=0;for(const[r,s]of Object.entries(t)){const a=e.tf.get(r);if(!a)continue;let l=n.get(r);typeof l!="number"&&(l=this.computeIdf(r),n.set(r,l)),o+=a*l*s}return o}computeEmbedding(e){const t=BE.termFrequencies(e);return this.computeTfidf(t)}computeIdf(e){var t;const n=(t=this.chunkOccurrences.get(e))!==null&&t!==void 0?t:0;return n>0?Math.log((this.chunkCount+1)/n):0}computeTfidf(e){const t=Object.create(null);for(const[n,o]of e){const r=this.computeIdf(n);r>0&&(t[n]=o*r)}return t}}function gEt(i){var e,t;const n=i.slice(0);n.sort((r,s)=>s.score-r.score);const o=(t=(e=n[0])===null||e===void 0?void 0:e.score)!==null&&t!==void 0?t:0;if(o>0)for(const r of n)r.score/=o;return n}var rL=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},QC;(function(i){i[i.NO_ACTION=0]="NO_ACTION",i[i.CLOSE_PICKER=1]="CLOSE_PICKER",i[i.REFRESH_PICKER=2]="REFRESH_PICKER",i[i.REMOVE_ITEM=3]="REMOVE_ITEM"})(QC||(QC={}));function k7(i){const e=i;return Array.isArray(e.items)}function Jce(i){const e=i;return!!e.picks&&e.additionalPicks instanceof Promise}class pEt extends _e{constructor(e,t){super(),this.prefix=e,this.options=t}provide(e,t,n){var o;const r=new Be;e.canAcceptInBackground=!!(!((o=this.options)===null||o===void 0)&&o.canAcceptInBackground),e.matchOnLabel=e.matchOnDescription=e.matchOnDetail=e.sortByLabel=!1;let s;const a=r.add(new Kr),l=()=>rL(this,void 0,void 0,function*(){const c=a.value=new Be;s==null||s.dispose(!0),e.busy=!1,s=new Ro(t);const u=s.token,d=e.value.substr(this.prefix.length).trim(),h=this._getPicks(d,c,u,n),f=(p,v)=>{var m;let _,w;if(k7(p)?(_=p.items,w=p.active):_=p,_.length===0){if(v)return!1;(d.length>0||e.hideInput)&&((m=this.options)===null||m===void 0?void 0:m.noResultsPick)&&(DD(this.options.noResultsPick)?_=[this.options.noResultsPick(d)]:_=[this.options.noResultsPick])}return e.items=_,w&&(e.activeItems=[w]),!0},g=p=>rL(this,void 0,void 0,function*(){let v=!1,m=!1;yield Promise.all([(()=>rL(this,void 0,void 0,function*(){typeof p.mergeDelay=="number"&&(yield wv(p.mergeDelay),u.isCancellationRequested)||m||(v=f(p.picks,!0))}))(),(()=>rL(this,void 0,void 0,function*(){e.busy=!0;try{const _=yield p.additionalPicks;if(u.isCancellationRequested)return;let w,y;k7(p.picks)?(w=p.picks.items,y=p.picks.active):w=p.picks;let L,D;if(k7(_)?(L=_.items,D=_.active):L=_,L.length>0||!v){let E;if(!y&&!D){const I=e.activeItems[0];I&&w.indexOf(I)!==-1&&(E=I)}f({items:[...w,...L],active:y||D||E})}}finally{u.isCancellationRequested||(e.busy=!1),m=!0}}))()])});if(h!==null)if(Jce(h))yield g(h);else if(!(h instanceof Promise))f(h);else{e.busy=!0;try{const p=yield h;if(u.isCancellationRequested)return;Jce(p)?yield g(p):f(p)}finally{u.isCancellationRequested||(e.busy=!1)}}});return r.add(e.onDidChangeValue(()=>l())),l(),r.add(e.onDidAccept(c=>{const[u]=e.selectedItems;typeof(u==null?void 0:u.accept)=="function"&&(c.inBackground||e.hide(),u.accept(e.keyMods,c))})),r.add(e.onDidTriggerItemButton(({button:c,item:u})=>rL(this,void 0,void 0,function*(){var d,h;if(typeof u.trigger=="function"){const f=(h=(d=u.buttons)===null||d===void 0?void 0:d.indexOf(c))!==null&&h!==void 0?h:-1;if(f>=0){const g=u.trigger(f,e.keyMods),p=typeof g=="number"?g:yield g;if(t.isCancellationRequested)return;switch(p){case QC.NO_ACTION:break;case QC.CLOSE_PICKER:e.hide();break;case QC.REFRESH_PICKER:l();break;case QC.REMOVE_ITEM:{const v=e.items.indexOf(u);if(v!==-1){const m=e.items.slice(),_=m.splice(v,1),w=e.activeItems.filter(L=>L!==_[0]),y=e.keepScrollPosition;e.keepScrollPosition=!0,e.items=m,w&&(e.activeItems=w),e.keepScrollPosition=y}break}}}}}))),r}}var qSe=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},q_=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},I7=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},O_,hr;let Eb=O_=class extends pEt{constructor(e,t,n,o,r,s){super(O_.PREFIX,e),this.instantiationService=t,this.keybindingService=n,this.commandService=o,this.telemetryService=r,this.dialogService=s,this.commandsHistory=this._register(this.instantiationService.createInstance(Db)),this.options=e}_getPicks(e,t,n,o){var r,s,a,l;return I7(this,void 0,void 0,function*(){const c=yield this.getCommandPicks(n);if(n.isCancellationRequested)return[];const u=_v(()=>{const m=new BE;m.updateDocuments(c.map(w=>({key:w.commandId,textChunks:[w.label+(w.commandAlias?` ${w.commandAlias}`:"")]})));const _=m.calculateScores(e,n);return gEt(_).filter(w=>w.score>O_.TFIDF_THRESHOLD).slice(0,O_.TFIDF_MAX_RESULTS)}),d=[];for(const m of c){const _=(r=O_.WORD_FILTER(e,m.label))!==null&&r!==void 0?r:void 0,w=m.commandAlias&&(s=O_.WORD_FILTER(e,m.commandAlias))!==null&&s!==void 0?s:void 0;if(_||w)m.highlights={label:_,detail:this.options.showAlias?w:void 0},d.push(m);else if(e===m.commandId)d.push(m);else if(e.length>=3){const y=u();if(n.isCancellationRequested)return[];const L=y.find(D=>D.key===m.commandId);L&&(m.tfIdfScore=L.score,d.push(m))}}const h=new Map;for(const m of d){const _=h.get(m.label);_?(m.description=m.commandId,_.description=_.commandId):h.set(m.label,m)}d.sort((m,_)=>{if(m.tfIdfScore&&_.tfIdfScore)return m.tfIdfScore===_.tfIdfScore?m.label.localeCompare(_.label):_.tfIdfScore-m.tfIdfScore;if(m.tfIdfScore)return 1;if(_.tfIdfScore)return-1;const w=this.commandsHistory.peek(m.commandId),y=this.commandsHistory.peek(_.commandId);if(w&&y)return w>y?-1:1;if(w)return-1;if(y)return 1;if(this.options.suggestedCommandIds){const L=this.options.suggestedCommandIds.has(m.commandId),D=this.options.suggestedCommandIds.has(_.commandId);if(L&&D)return 0;if(L)return-1;if(D)return 1}return m.label.localeCompare(_.label)});const f=[];let g=!1,p=!0,v=!!this.options.suggestedCommandIds;for(let m=0;mI7(this,void 0,void 0,function*(){var m;const _=yield this.getAdditionalCommandPicks(c,d,e,n);if(n.isCancellationRequested)return[];const w=_.map(y=>this.toCommandPick(y,o));return p&&((m=w[0])===null||m===void 0?void 0:m.type)!=="separator"&&w.unshift({type:"separator",label:C("suggested","similar commands")}),w}))()}:f})}toCommandPick(e,t){if(e.type==="separator")return e;const n=this.keybindingService.lookupKeybinding(e.commandId),o=n?C("commandPickAriaLabelWithKeybinding","{0}, {1}",e.label,n.getAriaLabel()):e.label;return Object.assign(Object.assign({},e),{ariaLabel:o,detail:this.options.showAlias&&e.commandAlias!==e.label?e.commandAlias:void 0,keybinding:n,accept:()=>I7(this,void 0,void 0,function*(){var r,s;this.commandsHistory.push(e.commandId),this.telemetryService.publicLog2("workbenchActionExecuted",{id:e.commandId,from:(r=t==null?void 0:t.from)!==null&&r!==void 0?r:"quick open"});try{!((s=e.args)===null||s===void 0)&&s.length?yield this.commandService.executeCommand(e.commandId,...e.args):yield this.commandService.executeCommand(e.commandId)}catch(a){oh(a)||this.dialogService.error(C("canNotRun","Command '{0}' resulted in an error",e.label),KSe(a))}})})}};Eb.PREFIX=">";Eb.TFIDF_THRESHOLD=.5;Eb.TFIDF_MAX_RESULTS=5;Eb.WORD_FILTER=eX(mk,hut,C1e);Eb=O_=qSe([q_(1,$t),q_(2,xi),q_(3,_o),q_(4,ec),q_(5,JI)],Eb);let Db=hr=class extends _e{constructor(e,t){super(),this.storageService=e,this.configurationService=t,this.configuredCommandsHistoryLength=0,this.updateConfiguration(),this.load(),this.registerListeners()}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration(e=>this.updateConfiguration(e)))}updateConfiguration(e){e&&!e.affectsConfiguration("workbench.commandPalette.history")||(this.configuredCommandsHistoryLength=hr.getConfiguredCommandHistoryLength(this.configurationService),hr.cache&&hr.cache.limit!==this.configuredCommandsHistoryLength&&(hr.cache.limit=this.configuredCommandsHistoryLength,hr.saveState(this.storageService)))}load(){const e=this.storageService.get(hr.PREF_KEY_CACHE,0);let t;if(e)try{t=JSON.parse(e)}catch{}const n=hr.cache=new Yv(this.configuredCommandsHistoryLength,1);if(t){let o;t.usesLRU?o=t.entries:o=t.entries.sort((r,s)=>r.value-s.value),o.forEach(r=>n.set(r.key,r.value))}hr.counter=this.storageService.getNumber(hr.PREF_KEY_COUNTER,0,hr.counter)}push(e){!hr.cache||(hr.cache.set(e,hr.counter++),hr.saveState(this.storageService))}peek(e){var t;return(t=hr.cache)===null||t===void 0?void 0:t.peek(e)}static saveState(e){if(!hr.cache)return;const t={usesLRU:!0,entries:[]};hr.cache.forEach((n,o)=>t.entries.push({key:o,value:n})),e.store(hr.PREF_KEY_CACHE,JSON.stringify(t),0,0),e.store(hr.PREF_KEY_COUNTER,hr.counter,0,0)}static getConfiguredCommandHistoryLength(e){var t,n;const r=(n=(t=e.getValue().workbench)===null||t===void 0?void 0:t.commandPalette)===null||n===void 0?void 0:n.history;return typeof r=="number"?r:hr.DEFAULT_COMMANDS_HISTORY_LENGTH}};Db.DEFAULT_COMMANDS_HISTORY_LENGTH=50;Db.PREF_KEY_CACHE="commandPalette.mru.cache";Db.PREF_KEY_COUNTER="commandPalette.mru.counter";Db.counter=1;Db=hr=qSe([q_(0,qu),q_(1,En)],Db);class mEt extends Eb{constructor(e,t,n,o,r,s){super(e,t,n,o,r,s)}getCodeEditorCommandPicks(){const e=this.activeTextEditorControl;if(!e)return[];const t=[];for(const n of e.getSupportedActions())t.push({commandId:n.id,commandAlias:n.alias,label:sX(n.label)||n.id});return t}}var vEt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},iC=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},eue=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};let oI=class extends mEt{get activeTextEditorControl(){var e;return(e=this.codeEditorService.getFocusedCodeEditor())!==null&&e!==void 0?e:void 0}constructor(e,t,n,o,r,s){super({showAlias:!1},e,n,o,r,s),this.codeEditorService=t}getCommandPicks(){return eue(this,void 0,void 0,function*(){return this.getCodeEditorCommandPicks()})}hasAdditionalCommandPicks(){return!1}getAdditionalCommandPicks(){return eue(this,void 0,void 0,function*(){return[]})}};oI=vEt([iC(0,$t),iC(1,Jn),iC(2,xi),iC(3,_o),iC(4,ec),iC(5,JI)],oI);class LT extends ft{constructor(){super({id:LT.ID,label:DP.quickCommandActionLabel,alias:"Command Palette",precondition:void 0,kbOpts:{kbExpr:Q.focus,primary:59,weight:100},contextMenuOpts:{group:"z_commands",order:1}})}run(e){e.get(lh).quickAccess.show(oI.PREFIX)}}LT.ID="editor.action.quickCommand";ze(LT);no.as(Kb.Quickaccess).registerQuickAccessProvider({ctor:oI,prefix:oI.PREFIX,helpEntries:[{description:DP.quickCommandHelp,commandId:LT.ID}]});var _Et=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},oC=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let qU=class extends Ov{constructor(e,t,n,o,r,s,a){super(!0,e,t,n,o,r,s,a)}};qU=_Et([oC(1,Ut),oC(2,Jn),oC(3,Ao),oC(4,$t),oC(5,qu),oC(6,En)],qU);zn(Ov.ID,qU,4);class bEt extends ft{constructor(){super({id:"editor.action.toggleHighContrast",label:UH.toggleHighContrast,alias:"Toggle High Contrast Theme",precondition:void 0}),this._originalThemeName=null}run(e,t){const n=e.get(nc),o=n.getColorTheme();Hd(o.type)?(n.setTheme(this._originalThemeName||(Sy(o.type)?Ow:Dg)),this._originalThemeName=null):(n.setTheme(Sy(o.type)?N0:R0),this._originalThemeName=o.themeName)}}ze(bEt);function CEt(){return new Worker("/eos/assets/editor.worker.efc65e0b.js",{type:"module"})}function wEt(){return new Worker("/eos/assets/json.worker.b6a074fe.js",{type:"module"})}function yEt(){return new Worker("/eos/assets/css.worker.903adc4e.js",{type:"module"})}function SEt(){return new Worker("/eos/assets/html.worker.dd9c9e9a.js",{type:"module"})}function xEt(){return new Worker("/eos/assets/ts.worker.d675a6ca.js",{type:"module"})}self.MonacoEnvironment={getWorker(i,e){return e==="json"?new wEt:e==="css"||e==="scss"||e==="less"?new yEt:e==="html"||e==="handlebars"||e==="razor"?new SEt:e==="typescript"||e==="javascript"?new xEt:new CEt}};ZCe.typescript.typescriptDefaults.setEagerModelSync(!0);function LEt(i,e){const{code:t,className:n,readonly:o,language:r}=i,[s,a]=x.exports.useState(null),l=x.exports.useRef(null);return x.exports.useEffect(()=>(l&&a(c=>c||YCe.create(l.current,{value:t,language:r,readOnly:o})),()=>s==null?void 0:s.dispose()),[l.current]),K5e(()=>{async function c(){var u;s&&(s.setValue(t),o&&s.updateOptions({readOnly:!1}),await((u=s.getAction("editor.action.formatDocument"))==null?void 0:u.run()),o&&s.updateOptions({readOnly:!0}))}c()},[t]),x.exports.useImperativeHandle(e,()=>({editor:s}),[s]),fe("div",{className:Ue(wvt.editor,n),ref:l})}const GSe=x.exports.forwardRef(LEt);function EEt(i){const{node:e}=i,[t,n]=x.exports.useState(!1),o=t3(),[r,s]=x.exports.useState(""),a=x.exports.useRef(null),l=xr(e);return vn("div",{className:jie.container,children:[fe("span",{style:{color:"white",cursor:"pointer",display:"block",textAlign:"center"},onClick:()=>{var c;s(((c=e.data)==null?void 0:c.customCode)||(l==null?void 0:l.getInitCustomCode())||""),n(!0)},children:"\u70B9\u51FB\u7F16\u8F91"}),fe(Fve,{title:"Basic Modal",open:t,onOk:()=>{n(!1),o.updateNode(e.id,c=>{var u,d;return(l==null?void 0:l.updateData(c,{customCode:((d=(u=a.current)==null?void 0:u.editor)==null?void 0:d.getValue())||""}))||c})},onCancel:()=>{n(!1)},destroyOnClose:!0,children:fe(GSe,{ref:a,code:r,language:"javascript",className:jie.editor})})]})}class XSe extends Kv{constructor(){super({operatorName:"Transform",operatorType:"TransformOperator",nodeType:kf.Node});Tt(this,"nodeColor","#F3F8FF")}create(){return super.create({endPointOptions:{endPointList:[new ri({type:"source",hint:"output",label:"output"}),new ri({type:"target",hint:"input",label:"input"})]}})}generateBlockDeclarations(t){var l,c,u,d,h,f,g,p;const{node:n,nodeGraph:o}=t,r=((u=(c=(l=n.data.endPointOptions)==null?void 0:l.endPointList)==null?void 0:c.find(v=>v.hint==="output"))==null?void 0:u.id)||"",s=((f=(h=(d=n.data.endPointOptions)==null?void 0:d.endPointList)==null?void 0:h.find(v=>v.hint==="input"))==null?void 0:f.id)||"",a=((p=(g=o.findSourceNodes(n.id))==null?void 0:g.find(v=>v.handleId===s))==null?void 0:p.relatedHandleId)||"";return[`${r?`const ${Ld(r)} = `:""}${hS}.transform( - ${Ld(a)}, +`):void 0}})}provideRenameEdits(e,t){return O0(this,void 0,void 0,function*(){return this._provideRenameEdits(e,this._providerRenameIdx,[],t)})}_provideRenameEdits(e,t,n,o){return O0(this,void 0,void 0,function*(){const r=this._providers[t];if(!r)return{edits:[],rejectReason:n.join(` +`)};const s=yield r.provideRenameEdits(this.model,this.position,e,o);if(s){if(s.rejectReason)return this._provideRenameEdits(e,t+1,n.concat(s.rejectReason),o)}else return this._provideRenameEdits(e,t+1,n.concat(C("no result","No result.")),o);return s})}}function Ext(i,e,t,n){return O0(this,void 0,void 0,function*(){const o=new HY(e,t,i),r=yield o.resolveRenameLocation(_n.None);return r!=null&&r.rejectReason?{edits:[],rejectReason:r.rejectReason}:o.provideRenameEdits(n,_n.None)})}let Lb=DU=class{static get(e){return e.getContribution(DU.ID)}constructor(e,t,n,o,r,s,a,l){this.editor=e,this._instaService=t,this._notificationService=n,this._bulkEditService=o,this._progressService=r,this._logService=s,this._configService=a,this._languageFeaturesService=l,this._disposableStore=new Be,this._cts=new Ro,this._renameInputField=this._disposableStore.add(this._instaService.createInstance(EU,this.editor,["acceptRenameInput","acceptRenameInputWithPreview"]))}dispose(){this._disposableStore.dispose(),this._cts.dispose(!0)}run(){var e,t;return O0(this,void 0,void 0,function*(){if(this._cts.dispose(!0),this._cts=new Ro,!this.editor.hasModel())return;const n=this.editor.getPosition(),o=new HY(this.editor.getModel(),n,this._languageFeaturesService.renameProvider);if(!o.hasProvider())return;const r=new Rv(this.editor,5,void 0,this._cts.token);let s;try{const g=o.resolveRenameLocation(r.token);this._progressService.showWhile(g,250),s=yield g}catch(g){(e=cl.get(this.editor))===null||e===void 0||e.showMessage(g||C("resolveRenameLocationFailed","An unknown error occurred while resolving rename location"),n);return}finally{r.dispose()}if(!s)return;if(s.rejectReason){(t=cl.get(this.editor))===null||t===void 0||t.showMessage(s.rejectReason,n);return}if(r.token.isCancellationRequested)return;const a=new Rv(this.editor,5,s.range,this._cts.token),l=this.editor.getSelection();let c=0,u=s.text.length;!V.isEmpty(l)&&!V.spansMultipleLines(l)&&V.containsRange(s.range,l)&&(c=Math.max(0,l.startColumn-s.range.startColumn),u=Math.min(s.range.endColumn,l.endColumn)-s.range.startColumn);const d=this._bulkEditService.hasPreviewHandler()&&this._configService.getValue(this.editor.getModel().uri,"editor.rename.enablePreview"),h=yield this._renameInputField.getInput(s.range,s.text,c,u,d,a.token);if(typeof h=="boolean"){h&&this.editor.focus(),a.dispose();return}this.editor.focus();const f=t5(o.provideRenameEdits(h.newName,a.token),a.token).then(g=>O0(this,void 0,void 0,function*(){if(!(!g||!this.editor.hasModel())){if(g.rejectReason){this._notificationService.info(g.rejectReason);return}this.editor.setSelection(V.fromPositions(this.editor.getSelection().getPosition())),this._bulkEditService.apply(g,{editor:this.editor,showPreview:h.wantsPreview,label:C("label","Renaming '{0}' to '{1}'",s==null?void 0:s.text,h.newName),code:"undoredo.rename",quotableLabel:C("quotableLabel","Renaming {0} to {1}",s==null?void 0:s.text,h.newName),respectAutoSaveConfig:!0}).then(p=>{p.ariaSummary&&Cs(C("aria","Successfully renamed '{0}' to '{1}'. Summary: {2}",s.text,h.newName,p.ariaSummary))}).catch(p=>{this._notificationService.error(C("rename.failedApply","Rename failed to apply edits")),this._logService.error(p)})}}),g=>{this._notificationService.error(C("rename.failed","Rename failed to compute edits")),this._logService.error(g)}).finally(()=>{a.dispose()});return this._progressService.showWhile(f,250),f})}acceptRenameInput(e){this._renameInputField.acceptInput(e)}cancelRenameInput(){this._renameInputField.cancelInput(!0)}};Lb.ID="editor.contrib.renameController";Lb=DU=Lxt([S_(1,$t),S_(2,Ao),S_(3,nT),S_(4,Jv),S_(5,nc),S_(6,fG),S_(7,pt)],Lb);class Dxt extends ft{constructor(){super({id:"editor.action.rename",label:C("rename.label","Rename Symbol"),alias:"Rename Symbol",precondition:Me.and(Q.writable,Q.hasRenameProvider),kbOpts:{kbExpr:Q.editorTextFocus,primary:60,weight:100},contextMenuOpts:{group:"1_modification",order:1.1}})}runCommand(e,t){const n=e.get(Jn),[o,r]=Array.isArray(t)&&t||[void 0,void 0];return Rt.isUri(o)&&ae.isIPosition(r)?n.openCodeEditor({resource:o},n.getActiveCodeEditor()).then(s=>{!s||(s.setPosition(r),s.invokeWithinContext(a=>(this.reportTelemetry(a,s),this.run(a,s))))},en):super.runCommand(e,t)}run(e,t){const n=Lb.get(t);return n?n.run():Promise.resolve()}}zn(Lb.ID,Lb,4);ze(Dxt);const $Y=Ir.bindToContribution(Lb.get);Ye(new $Y({id:"acceptRenameInput",precondition:zF,handler:i=>i.acceptRenameInput(!1),kbOpts:{weight:100+99,kbExpr:Me.and(Q.focus,Me.not("isComposing")),primary:3}}));Ye(new $Y({id:"acceptRenameInputWithPreview",precondition:Me.and(zF,Me.has("config.editor.rename.enablePreview")),handler:i=>i.acceptRenameInput(!0),kbOpts:{weight:100+99,kbExpr:Me.and(Q.focus,Me.not("isComposing")),primary:1024+3}}));Ye(new $Y({id:"cancelRenameInput",precondition:zF,handler:i=>i.cancelRenameInput(),kbOpts:{weight:100+99,kbExpr:Q.focus,primary:9,secondary:[1033]}}));Nf("_executeDocumentRenameProvider",function(i,e,t,...n){const[o]=n;fi(typeof o=="string");const{renameProvider:r}=i.get(pt);return Ext(r,e,t,o)});Nf("_executePrepareRename",function(i,e,t){return O0(this,void 0,void 0,function*(){const{renameProvider:n}=i.get(pt),r=yield new HY(e,t,n).resolveRenameLocation(_n.None);if(r!=null&&r.rejectReason)throw new Error(r.rejectReason);return r})});no.as(ch.Configuration).registerConfiguration({id:"editor",properties:{"editor.rename.enablePreview":{scope:5,description:C("enablePreview","Enable/disable the ability to preview changes before renaming"),default:!0,type:"boolean"}}});function kxt(i){for(let e=0,t=i.length;e0?t[0]:[]}function MSe(i,e,t,n,o){return zv(this,void 0,void 0,function*(){const r=Rxt(i,e),s=yield Promise.all(r.map(a=>zv(this,void 0,void 0,function*(){let l,c=null;try{l=yield a.provideDocumentSemanticTokens(e,a===t?n:null,o)}catch(u){c=u,l=null}return(!l||!UF(l)&&!NSe(l))&&(l=null),new Nxt(a,l,c)})));for(const a of s){if(a.error)throw a.error;if(a.tokens)return a}return s.length>0?s[0]:null})}function Mxt(i,e){const t=i.orderedGroups(e);return t.length>0?t[0]:null}class Axt{constructor(e,t){this.provider=e,this.tokens=t}}function Pxt(i,e){return i.has(e)}function ASe(i,e){const t=i.orderedGroups(e);return t.length>0?t[0]:[]}function zY(i,e,t,n){return zv(this,void 0,void 0,function*(){const o=ASe(i,e),r=yield Promise.all(o.map(s=>zv(this,void 0,void 0,function*(){let a;try{a=yield s.provideDocumentRangeSemanticTokens(e,t,n)}catch(l){$o(l),a=null}return(!a||!UF(a))&&(a=null),new Axt(s,a)})));for(const s of r)if(s.tokens)return s;return r.length>0?r[0]:null})}Rn.registerCommand("_provideDocumentSemanticTokensLegend",(i,...e)=>zv(void 0,void 0,void 0,function*(){const[t]=e;fi(t instanceof Rt);const n=i.get(Yi).getModel(t);if(!n)return;const{documentSemanticTokensProvider:o}=i.get(pt),r=Mxt(o,n);return r?r[0].getLegend():i.get(_o).executeCommand("_provideDocumentRangeSemanticTokensLegend",t)}));Rn.registerCommand("_provideDocumentSemanticTokens",(i,...e)=>zv(void 0,void 0,void 0,function*(){const[t]=e;fi(t instanceof Rt);const n=i.get(Yi).getModel(t);if(!n)return;const{documentSemanticTokensProvider:o}=i.get(pt);if(!RSe(o,n))return i.get(_o).executeCommand("_provideDocumentRangeSemanticTokens",t,n.getFullModelRange());const r=yield MSe(o,n,null,null,_n.None);if(!r)return;const{provider:s,tokens:a}=r;if(!a||!UF(a))return;const l=TSe({id:0,type:"full",data:a.data});return a.resultId&&s.releaseDocumentSemanticTokens(a.resultId),l}));Rn.registerCommand("_provideDocumentRangeSemanticTokensLegend",(i,...e)=>zv(void 0,void 0,void 0,function*(){const[t,n]=e;fi(t instanceof Rt);const o=i.get(Yi).getModel(t);if(!o)return;const{documentRangeSemanticTokensProvider:r}=i.get(pt),s=ASe(r,o);if(s.length===0)return;if(s.length===1)return s[0].getLegend();if(!n||!V.isIRange(n))return console.warn("provideDocumentRangeSemanticTokensLegend might be out-of-sync with provideDocumentRangeSemanticTokens unless a range argument is passed in"),s[0].getLegend();const a=yield zY(r,o,V.lift(n),_n.None);if(!!a)return a.provider.getLegend()}));Rn.registerCommand("_provideDocumentRangeSemanticTokens",(i,...e)=>zv(void 0,void 0,void 0,function*(){const[t,n]=e;fi(t instanceof Rt),fi(V.isIRange(n));const o=i.get(Yi).getModel(t);if(!o)return;const{documentRangeSemanticTokensProvider:r}=i.get(pt),s=yield zY(r,o,V.lift(n),_n.None);if(!(!s||!s.tokens))return TSe({id:0,type:"full",data:s.tokens.data})}));const UY="editor.semanticHighlighting";function kU(i,e,t){var n;const o=(n=t.getValue(UY,{overrideIdentifier:i.getLanguageId(),resource:i.uri}))===null||n===void 0?void 0:n.enabled;return typeof o=="boolean"?o:e.getColorTheme().semanticHighlighting}var PSe=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Nh=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},Zp;let IU=class extends _e{constructor(e,t,n,o,r,s){super(),this._watchers=Object.create(null);const a=u=>{this._watchers[u.uri.toString()]=new Jk(u,e,n,r,s)},l=(u,d)=>{d.dispose(),delete this._watchers[u.uri.toString()]},c=()=>{for(const u of t.getModels()){const d=this._watchers[u.uri.toString()];kU(u,n,o)?d||a(u):d&&l(u,d)}};this._register(t.onModelAdded(u=>{kU(u,n,o)&&a(u)})),this._register(t.onModelRemoved(u=>{const d=this._watchers[u.uri.toString()];d&&l(u,d)})),this._register(o.onDidChangeConfiguration(u=>{u.affectsConfiguration(UY)&&c()})),this._register(n.onDidColorThemeChange(c))}dispose(){for(const e of Object.values(this._watchers))e.dispose();super.dispose()}};IU=PSe([Nh(0,D5),Nh(1,Yi),Nh(2,vr),Nh(3,En),Nh(4,qc),Nh(5,pt)],IU);let Jk=Zp=class extends _e{constructor(e,t,n,o,r){super(),this._semanticTokensStylingService=t,this._isDisposed=!1,this._model=e,this._provider=r.documentSemanticTokensProvider,this._debounceInformation=o.for(this._provider,"DocumentSemanticTokens",{min:Zp.REQUEST_MIN_DELAY,max:Zp.REQUEST_MAX_DELAY}),this._fetchDocumentSemanticTokens=this._register(new bi(()=>this._fetchDocumentSemanticTokensNow(),Zp.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 s=()=>{si(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)}))};s(),this._register(this._provider.onDidChange(()=>{s(),this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))})),this._register(n.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),si(this._documentProvidersChangeListeners),this._documentProvidersChangeListeners=[],this._setDocumentSemanticTokens(null,null,null,[]),this._isDisposed=!0,super.dispose()}_fetchDocumentSemanticTokensNow(){if(this._currentDocumentRequestCancellationTokenSource)return;if(!RSe(this._provider,this._model)){this._currentDocumentResponse&&this._model.tokenization.setSemanticTokens(null,!1);return}if(!this._model.isAttachedToEditor())return;const e=new Ro,t=this._currentDocumentResponse?this._currentDocumentResponse.provider:null,n=this._currentDocumentResponse&&this._currentDocumentResponse.resultId||null,o=MSe(this._provider,this._model,t,n,e.token);this._currentDocumentRequestCancellationTokenSource=e,this._providersChangedDuringRequest=!1;const r=[],s=this._model.onDidChangeContent(l=>{r.push(l)}),a=new Ls(!1);o.then(l=>{if(this._debounceInformation.update(this._model,a.elapsed()),this._currentDocumentRequestCancellationTokenSource=null,s.dispose(),!l)this._setDocumentSemanticTokens(null,null,null,r);else{const{provider:c,tokens:u}=l,d=this._semanticTokensStylingService.getStyling(c);this._setDocumentSemanticTokens(c,u||null,d,r)}},l=>{l&&(sh(l)||typeof l.message=="string"&&l.message.indexOf("busy")!==-1)||en(l),this._currentDocumentRequestCancellationTokenSource=null,s.dispose(),(r.length>0||this._providersChangedDuringRequest)&&(this._fetchDocumentSemanticTokens.isScheduled()||this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model)))})}static _copy(e,t,n,o,r){r=Math.min(r,n.length-o,e.length-t);for(let s=0;s{(o.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||!n){this._model.tokenization.setSemanticTokens(null,!1);return}if(!t){this._model.tokenization.setSemanticTokens(null,!0),s();return}if(NSe(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 h of t.edits)a+=(h.data?h.data.length:0)-h.deleteCount;const l=r.data,c=new Uint32Array(l.length+a);let u=l.length,d=c.length;for(let h=t.edits.length-1;h>=0;h--){const f=t.edits[h];if(f.start>l.length){n.warnInvalidEditStart(r.resultId,t.resultId,h,f.start,l.length),this._model.tokenization.setSemanticTokens(null,!0);return}const g=u-(f.start+f.deleteCount);g>0&&(Zp._copy(l,u-g,c,d-g,g),d-=g),f.data&&(Zp._copy(f.data,0,c,d-f.data.length,f.data.length),d-=f.data.length),u=f.start}u>0&&Zp._copy(l,0,c,0,u),t={resultId:t.resultId,data:c}}}if(UF(t)){this._currentDocumentResponse=new Oxt(e,t.resultId,t.data);const a=m1e(t,n,this._model.getLanguageId());if(o.length>0)for(const l of o)for(const c of a)for(const u of l.changes)c.applyEdit(u.range,u.text);this._model.tokenization.setSemanticTokens(a,!0)}else this._model.tokenization.setSemanticTokens(null,!0);s()}};Jk.REQUEST_MIN_DELAY=300;Jk.REQUEST_MAX_DELAY=2e3;Jk=Zp=PSe([Nh(1,D5),Nh(2,vr),Nh(3,qc),Nh(4,pt)],Jk);class Oxt{constructor(e,t,n){this.provider=e,this.resultId=t,this.data=n}dispose(){this.provider.releaseDocumentSemanticTokens(this.resultId)}}G5(IU);var Fxt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},oL=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let eI=class extends _e{constructor(e,t,n,o,r,s){super(),this._semanticTokensStylingService=t,this._themeService=n,this._configurationService=o,this._editor=e,this._provider=s.documentRangeSemanticTokensProvider,this._debounceInformation=r.for(this._provider,"DocumentRangeSemanticTokens",{min:100,max:500}),this._tokenizeViewport=this._register(new bi(()=>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(l=>{this._cancelAll(),a()})),this._register(this._provider.onDidChange(()=>{this._cancelAll(),a()})),this._register(this._configurationService.onDidChangeConfiguration(l=>{l.affectsConfiguration(UY)&&(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,n=this._outstandingRequests.length;tthis._requestRange(e,n)))}_requestRange(e,t){const n=e.getVersionId(),o=sr(s=>Promise.resolve(zY(this._provider,e,t,s))),r=new Ls(!1);return o.then(s=>{if(this._debounceInformation.update(e,r.elapsed()),!s||!s.tokens||e.isDisposed()||e.getVersionId()!==n)return;const{provider:a,tokens:l}=s,c=this._semanticTokensStylingService.getStyling(a);e.tokenization.setPartialSemanticTokens(t,m1e(l,c,e.getLanguageId()))}).then(()=>this._removeOutstandingRequest(o),()=>this._removeOutstandingRequest(o)),o}};eI.ID="editor.contrib.viewportSemanticTokens";eI=Fxt([oL(1,D5),oL(2,vr),oL(3,En),oL(4,qc),oL(5,pt)],eI);zn(eI.ID,eI,1);class Bxt{constructor(e=!0){this.selectSubwords=e}provideSelectionRanges(e,t){const n=[];for(const o of t){const r=[];n.push(r),this.selectSubwords&&this._addInWordRanges(r,e,o),this._addWordRanges(r,e,o),this._addWhitespaceLine(r,e,o),r.push({range:e.getFullModelRange()})}return n}_addInWordRanges(e,t,n){const o=t.getWordAtPosition(n);if(!o)return;const{word:r,startColumn:s}=o,a=n.column-s;let l=a,c=a,u=0;for(;l>=0;l--){const d=r.charCodeAt(l);if(l!==a&&(d===95||d===45))break;if(Cm(d)&&kh(u))break;u=d}for(l+=1;c0&&t.getLineFirstNonWhitespaceColumn(n.lineNumber)===0&&t.getLineLastNonWhitespaceColumn(n.lineNumber)===0&&e.push({range:new V(n.lineNumber,1,n.lineNumber,t.getLineMaxColumn(n.lineNumber))})}}var Wxt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Vxt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},jF=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},TU;class jY{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 n=new jY(t,this.ranges);return n.ranges[t].equalsRange(this.ranges[this.index])?n.mov(e):n}}let Zw=TU=class{static get(e){return e.getContribution(TU.ID)}constructor(e,t){this._editor=e,this._languageFeaturesService=t,this._ignoreSelection=!1}dispose(){var e;(e=this._selectionListener)===null||e===void 0||e.dispose()}run(e){return jF(this,void 0,void 0,function*(){if(!this._editor.hasModel())return;const t=this._editor.getSelections(),n=this._editor.getModel();if(this._state||(yield FSe(this._languageFeaturesService.selectionRangeProvider,n,t.map(r=>r.getPosition()),this._editor.getOption(112),_n.None).then(r=>{var s;if(!(!ws(r)||r.length!==t.length)&&!(!this._editor.hasModel()||!Lo(this._editor.getSelections(),t,(a,l)=>a.equalsSelection(l)))){for(let a=0;al.containsPosition(t[a].getStartPosition())&&l.containsPosition(t[a].getEndPosition())),r[a].unshift(t[a]);this._state=r.map(a=>new jY(0,a)),(s=this._selectionListener)===null||s===void 0||s.dispose(),this._selectionListener=this._editor.onDidChangeCursorPosition(()=>{var a;this._ignoreSelection||((a=this._selectionListener)===null||a===void 0||a.dispose(),this._state=void 0)})}})),!this._state)return;this._state=this._state.map(r=>r.mov(e));const o=this._state.map(r=>gt.fromPositions(r.ranges[r.index].getStartPosition(),r.ranges[r.index].getEndPosition()));this._ignoreSelection=!0;try{this._editor.setSelections(o)}finally{this._ignoreSelection=!1}})}};Zw.ID="editor.contrib.smartSelectController";Zw=TU=Wxt([Vxt(1,pt)],Zw);class OSe extends ft{constructor(e,t){super(t),this._forward=e}run(e,t){return jF(this,void 0,void 0,function*(){const n=Zw.get(t);n&&(yield n.run(this._forward))})}}class Hxt extends OSe{constructor(){super(!0,{id:"editor.action.smartSelect.expand",label:C("smartSelect.expand","Expand Selection"),alias:"Expand Selection",precondition:void 0,kbOpts:{kbExpr:Q.editorTextFocus,primary:1553,mac:{primary:3345,secondary:[1297]},weight:100},menuOpts:{menuId:Z.MenubarSelectionMenu,group:"1_basic",title:C({key:"miSmartSelectGrow",comment:["&& denotes a mnemonic"]},"&&Expand Selection"),order:2}})}}Rn.registerCommandAlias("editor.action.smartSelect.grow","editor.action.smartSelect.expand");class $xt extends OSe{constructor(){super(!1,{id:"editor.action.smartSelect.shrink",label:C("smartSelect.shrink","Shrink Selection"),alias:"Shrink Selection",precondition:void 0,kbOpts:{kbExpr:Q.editorTextFocus,primary:1551,mac:{primary:3343,secondary:[1295]},weight:100},menuOpts:{menuId:Z.MenubarSelectionMenu,group:"1_basic",title:C({key:"miSmartSelectShrink",comment:["&& denotes a mnemonic"]},"&&Shrink Selection"),order:3}})}}zn(Zw.ID,Zw,4);ze(Hxt);ze($xt);function FSe(i,e,t,n,o){return jF(this,void 0,void 0,function*(){const r=i.all(e).concat(new Bxt(n.selectSubwords));r.length===1&&r.unshift(new Rl);const s=[],a=[];for(const l of r)s.push(Promise.resolve(l.provideSelectionRanges(e,t,o)).then(c=>{if(ws(c)&&c.length===t.length)for(let u=0;u{if(l.length===0)return[];l.sort((h,f)=>ae.isBefore(h.getStartPosition(),f.getStartPosition())?1:ae.isBefore(f.getStartPosition(),h.getStartPosition())||ae.isBefore(h.getEndPosition(),f.getEndPosition())?-1:ae.isBefore(f.getEndPosition(),h.getEndPosition())?1:0);const c=[];let u;for(const h of l)(!u||V.containsRange(h,u)&&!V.equalsRange(h,u))&&(c.push(h),u=h);if(!n.selectLeadingAndTrailingWhitespace)return c;const d=[c[0]];for(let h=1;hi}),C7="data-sticky-line-index",Kce="data-sticky-is-line",jxt="data-sticky-is-line-number",qce="data-sticky-is-folding-icon";class Kxt extends _e{constructor(e){super(),this._editor=e,this._foldingIconStore=new Be,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(66),this._stickyLines=[],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 Pv),this._rootDomNode.appendChild(this._lineNumbersDomNode),this._rootDomNode.appendChild(this._linesDomNodeScrollable);const t=()=>{this._linesDomNode.style.left=this._editor.getOption(114).scrollWithEditor?`-${this._editor.getScrollLeft()}px`:"0px"};this._register(this._editor.onDidChangeConfiguration(n=>{n.hasChanged(114)&&t(),n.hasChanged(66)&&(this._lineHeight=this._editor.getOption(66))})),this._register(this._editor.onDidScrollChange(n=>{n.scrollLeftChanged&&t(),n.scrollWidthChanged&&this._updateWidgetWidth()})),this._register(this._editor.onDidChangeModel(()=>{t(),this._updateWidgetWidth()})),this._register(this._foldingIconStore),t(),this._register(this._editor.onDidLayoutChange(n=>{this._updateWidgetWidth()})),this._updateWidgetWidth()}get lineNumbers(){return this._lineNumbers}get lineNumberCount(){return this._lineNumbers.length}getStickyLineForLine(e){return this._stickyLines.find(t=>t.lineNumber===e)}getCurrentLines(){return this._lineNumbers}setState(e,t,n=1/0){if((!this._previousState&&!e||this._previousState&&this._previousState.equals(e))&&n===1/0)return;this._previousState=e;const o=this._stickyLines;if(this._clearStickyWidget(),!e||!this._editor._getViewModel())return;if(e.startLineNumbers.length*this._lineHeight+e.lastLineRelativePosition>0){this._lastLineRelativePosition=e.lastLineRelativePosition;const s=[...e.startLineNumbers];e.showEndForLine!==null&&(s[e.showEndForLine]=e.endLineNumbers[e.showEndForLine]),this._lineNumbers=s}else this._lastLineRelativePosition=0,this._lineNumbers=[];this._renderRootNode(o,t,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`}_clearStickyWidget(){this._stickyLines=[],this._foldingIconStore.clear(),Ur(this._lineNumbersDomNode),Ur(this._linesDomNode),this._rootDomNode.style.display="none"}_useFoldingOpacityTransition(e){this._lineNumbersDomNode.style.setProperty("--vscode-editorStickyScroll-foldingOpacityTransition",`opacity ${e?.5:0}s`)}_setFoldingIconsVisibility(e){for(const t of this._stickyLines){const n=t.foldingIcon;!n||n.setVisible(e?!0:n.isCollapsed)}}_renderRootNode(e,t,n=1/0){return Uxt(this,void 0,void 0,function*(){const o=this._editor.getLayoutInfo();for(const[s,a]of this._lineNumbers.entries()){const l=e[s],c=a>=n||(l==null?void 0:l.lineNumber)!==a?this._renderChildNode(s,a,t,o):this._updateTopAndZIndexOfStickyLine(l);!c||(this._linesDomNode.appendChild(c.lineDomNode),this._lineNumbersDomNode.appendChild(c.lineNumberDomNode),this._stickyLines.push(c))}t&&(this._setFoldingHoverListeners(),this._useFoldingOpacityTransition(!this._isOnGlyphMargin));const r=this._lineNumbers.length*this._lineHeight+this._lastLineRelativePosition;if(r===0){this._clearStickyWidget();return}this._rootDomNode.style.display="block",this._lineNumbersDomNode.style.height=`${r}px`,this._linesDomNodeScrollable.style.height=`${r}px`,this._rootDomNode.style.height=`${r}px`,this._rootDomNode.style.marginLeft="0px",this._updateMinContentWidth(),this._editor.layoutOverlayWidget(this)})}_setFoldingHoverListeners(){this._editor.getOption(109)==="mouseover"&&(this._foldingIconStore.add(ke(this._lineNumbersDomNode,et.MOUSE_ENTER,t=>{this._isOnGlyphMargin=!0,this._setFoldingIconsVisibility(!0)})),this._foldingIconStore.add(ke(this._lineNumbersDomNode,et.MOUSE_LEAVE,()=>{this._isOnGlyphMargin=!1,this._useFoldingOpacityTransition(!0),this._setFoldingIconsVisibility(!1)})))}_renderChildNode(e,t,n,o){const r=this._editor._getViewModel();if(!r)return;const s=r.coordinatesConverter.convertModelPositionToViewPosition(new ae(t,1)).lineNumber,a=r.getViewLineRenderingData(s),l=this._editor.getOption(67);let c;try{c=rl.filter(a.inlineDecorations,s,a.minColumn,a.maxColumn)}catch{c=[]}const u=new Zv(!0,!0,a.content,a.continuesWithWrappedLine,a.isBasicASCII,a.containsRTL,0,a.tokens,c,a.tabSize,a.startVisibleColumn,1,1,1,500,"none",!0,!0,null),d=new bS(2e3),h=jI(u,d);let f;jce?f=jce.createHTML(d.build()):f=d.build();const g=document.createElement("span");g.setAttribute(C7,String(e)),g.setAttribute(Kce,""),g.setAttribute("role","listitem"),g.tabIndex=0,g.className="sticky-line-content",g.classList.add(`stickyLine${t}`),g.style.lineHeight=`${this._lineHeight}px`,g.innerHTML=f;const p=document.createElement("span");p.setAttribute(C7,String(e)),p.setAttribute(jxt,""),p.className="sticky-line-number",p.style.lineHeight=`${this._lineHeight}px`;const v=o.contentLeft;p.style.width=`${v}px`;const m=document.createElement("span");l.renderType===1||l.renderType===3&&t%10===0?m.innerText=t.toString():l.renderType===2&&(m.innerText=Math.abs(t-this._editor.getPosition().lineNumber).toString()),m.className="sticky-line-number-inner",m.style.lineHeight=`${this._lineHeight}px`,m.style.width=`${o.lineNumbersWidth}px`,m.style.paddingLeft=`${o.lineNumbersLeft}px`,p.appendChild(m);const _=this._renderFoldingIconForLine(n,t);_&&p.appendChild(_.domNode),this._editor.applyFontInfo(g),this._editor.applyFontInfo(m),p.style.lineHeight=`${this._lineHeight}px`,g.style.lineHeight=`${this._lineHeight}px`,p.style.height=`${this._lineHeight}px`,g.style.height=`${this._lineHeight}px`;const y=new qxt(e,t,g,p,_,h.characterMapping);return this._updateTopAndZIndexOfStickyLine(y)}_updateTopAndZIndexOfStickyLine(e){var t;const n=e.index,o=e.lineDomNode,r=e.lineNumberDomNode,s=n===this._lineNumbers.length-1,a="0",l="1";o.style.zIndex=s?a:l,r.style.zIndex=s?a:l;const c=`${n*this._lineHeight+this._lastLineRelativePosition+(!((t=e.foldingIcon)===null||t===void 0)&&t.isCollapsed?1:0)}px`,u=`${n*this._lineHeight}px`;return o.style.top=s?c:u,r.style.top=s?c:u,e}_renderFoldingIconForLine(e,t){const n=this._editor.getOption(109);if(!e||n==="never")return;const o=e.regions,r=o.findRange(t),s=o.getStartLineNumber(r);if(!(t===s))return;const l=o.isCollapsed(r),c=new Gxt(l,s,o.getEndLineNumber(r),this._lineHeight);return c.setVisible(this._isOnGlyphMargin?!0:l||n==="always"),c.domNode.setAttribute(qce,""),c}_updateMinContentWidth(){this._minContentWidthInPx=0;for(const e of this._stickyLines)e.lineDomNode.scrollWidth>this._minContentWidthInPx&&(this._minContentWidthInPx=e.lineDomNode.scrollWidth);this._minContentWidthInPx+=this._editor.getLayoutInfo().verticalScrollbarWidth}getId(){return"editor.contrib.stickyScrollWidget"}getDomNode(){return this._rootDomNode}getPosition(){return{preference:null}}getMinContentWidthInPx(){return this._minContentWidthInPx}focusLineWithIndex(e){0<=e&&e0)return null;const t=this._getRenderedStickyLineFromChildDomNode(e);if(!t)return null;const n=kG(t.characterMapping,e,0);return new ae(t.lineNumber,n)}getLineNumberFromChildDomNode(e){var t,n;return(n=(t=this._getRenderedStickyLineFromChildDomNode(e))===null||t===void 0?void 0:t.lineNumber)!==null&&n!==void 0?n:null}_getRenderedStickyLineFromChildDomNode(e){const t=this.getLineIndexFromChildDomNode(e);return t===null||t<0||t>=this._stickyLines.length?null:this._stickyLines[t]}getLineIndexFromChildDomNode(e){const t=this._getAttributeValue(e,C7);return t?parseInt(t,10):null}isInStickyLine(e){return this._getAttributeValue(e,Kce)!==void 0}isInFoldingIconDomNode(e){return this._getAttributeValue(e,qce)!==void 0}_getAttributeValue(e,t){for(;e&&e!==this._rootDomNode;){const n=e.getAttribute(t);if(n!==null)return n;e=e.parentElement}}}class qxt{constructor(e,t,n,o,r,s){this.index=e,this.lineNumber=t,this.lineDomNode=n,this.lineNumberDomNode=o,this.foldingIcon=r,this.characterMapping=s}}class Gxt{constructor(e,t,n,o){this.isCollapsed=e,this.foldingStartLine=t,this.foldingEndLine=n,this.dimension=o,this.domNode=document.createElement("div"),this.domNode.style.width=`${o}px`,this.domNode.style.height=`${o}px`,this.domNode.className=Mt.asClassName(e?LF:xF)}setVisible(e){this.domNode.style.cursor=e?"pointer":"default",this.domNode.style.opacity=e?"1":"0"}}class FE{constructor(e,t){this.startLineNumber=e,this.endLineNumber=t}}class RO{constructor(e,t,n){this.range=e,this.children=t,this.parent=n}}class BSe{constructor(e,t,n,o){this.uri=e,this.version=t,this.element=n,this.outlineProviderId=o}}var KF=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},tI=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},Gce=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},BE;(function(i){i.OUTLINE_MODEL="outlineModel",i.FOLDING_PROVIDER_MODEL="foldingProviderModel",i.INDENTATION_MODEL="indentationModel"})(BE||(BE={}));var Mm;(function(i){i[i.VALID=0]="VALID",i[i.INVALID=1]="INVALID",i[i.CANCELED=2]="CANCELED"})(Mm||(Mm={}));let NU=class extends _e{constructor(e,t,n,o){super(),this._editor=e,this._languageConfigurationService=t,this._languageFeaturesService=n,this._modelProviders=[],this._modelPromise=null,this._updateScheduler=this._register(new Wu(300)),this._updateOperation=this._register(new Be);const r=new RU(n),s=new AU(this._editor,n),a=new MU(this._editor,t);switch(o){case BE.OUTLINE_MODEL:this._modelProviders.push(r),this._modelProviders.push(s),this._modelProviders.push(a);break;case BE.FOLDING_PROVIDER_MODEL:this._modelProviders.push(s),this._modelProviders.push(a);break;case BE.INDENTATION_MODEL:this._modelProviders.push(a);break}}_cancelModelPromise(){this._modelPromise&&(this._modelPromise.cancel(),this._modelPromise=null)}update(e,t,n){return Gce(this,void 0,void 0,function*(){return this._updateOperation.clear(),this._updateOperation.add({dispose:()=>{this._cancelModelPromise(),this._updateScheduler.cancel()}}),this._cancelModelPromise(),yield this._updateScheduler.trigger(()=>Gce(this,void 0,void 0,function*(){for(const o of this._modelProviders){const{statusPromise:r,modelPromise:s}=o.computeStickyModel(e,t,n);this._modelPromise=s;const a=yield r;if(this._modelPromise!==s)return null;switch(a){case Mm.CANCELED:return this._updateOperation.clear(),null;case Mm.VALID:return o.stickyModel}}return null})).catch(o=>(en(o),null))})}};NU=KF([tI(1,Ti),tI(2,pt)],NU);class WSe{constructor(){this._stickyModel=null}get stickyModel(){return this._stickyModel}_invalid(){return this._stickyModel=null,Mm.INVALID}computeStickyModel(e,t,n){if(n.isCancellationRequested||!this.isProviderValid(e))return{statusPromise:this._invalid(),modelPromise:null};const o=sr(r=>this.createModelFromProvider(e,t,r));return{statusPromise:o.then(r=>this.isModelValid(r)?n.isCancellationRequested?Mm.CANCELED:(this._stickyModel=this.createStickyModel(e,t,n,r),Mm.VALID):this._invalid()).then(void 0,r=>(en(r),Mm.CANCELED)),modelPromise:o}}isModelValid(e){return!0}isProviderValid(e){return!0}}let RU=class extends WSe{constructor(e){super(),this._languageFeaturesService=e}createModelFromProvider(e,t,n){return vg.create(this._languageFeaturesService.documentSymbolProvider,e,n)}createStickyModel(e,t,n,o){var r;const{stickyOutlineElement:s,providerID:a}=this._stickyModelFromOutlineModel(o,(r=this._stickyModel)===null||r===void 0?void 0:r.outlineProviderId);return new BSe(e.uri,t,s,a)}isModelValid(e){return e&&e.children.size>0}_stickyModelFromOutlineModel(e,t){let n;if(vn.first(e.children.values())instanceof lSe){const a=vn.find(e.children.values(),l=>l.id===t);if(a)n=a.children;else{let l="",c=-1,u;for(const[d,h]of e.children.entries()){const f=this._findSumOfRangesOfGroup(h);f>c&&(u=h,c=f,l=h.id)}t=l,n=u.children}}else n=e.children;const o=[],r=Array.from(n.values()).sort((a,l)=>{const c=new FE(a.symbol.range.startLineNumber,a.symbol.range.endLineNumber),u=new FE(l.symbol.range.startLineNumber,l.symbol.range.endLineNumber);return this._comparator(c,u)});for(const a of r)o.push(this._stickyModelFromOutlineElement(a,a.symbol.selectionRange.startLineNumber));return{stickyOutlineElement:new RO(void 0,o,void 0),providerID:t}}_stickyModelFromOutlineElement(e,t){const n=[];for(const r of e.children.values())if(r.symbol.selectionRange.startLineNumber!==r.symbol.range.endLineNumber)if(r.symbol.selectionRange.startLineNumber!==t)n.push(this._stickyModelFromOutlineElement(r,r.symbol.selectionRange.startLineNumber));else for(const s of r.children.values())n.push(this._stickyModelFromOutlineElement(s,r.symbol.selectionRange.startLineNumber));n.sort((r,s)=>this._comparator(r.range,s.range));const o=new FE(e.symbol.selectionRange.startLineNumber,e.symbol.range.endLineNumber);return new RO(o,n,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 n of e.children.values())t+=this._findSumOfRangesOfGroup(n);return e instanceof Jz?t+e.symbol.range.endLineNumber-e.symbol.selectionRange.startLineNumber:t}};RU=KF([tI(0,pt)],RU);class VSe extends WSe{constructor(e){super(),this._foldingLimitReporter=new rSe(e)}createStickyModel(e,t,n,o){const r=this._fromFoldingRegions(o);return new BSe(e.uri,t,r,void 0)}isModelValid(e){return e!==null}_fromFoldingRegions(e){const t=e.length,n=[],o=new RO(void 0,[],void 0);for(let r=0;r0}createModelFromProvider(e,t,n){const o=xf.getFoldingRangeProviders(this._languageFeaturesService,e);return new IY(e,o,()=>this.createModelFromProvider(e,t,n),this._foldingLimitReporter,void 0).compute(n)}};AU=KF([tI(1,pt)],AU);var Xxt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Xce=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},Yce=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};class Yxt{constructor(e,t,n){this.startLineNumber=e,this.endLineNumber=t,this.nestingDepth=n}}let PU=class extends _e{constructor(e,t,n){super(),this._languageFeaturesService=t,this._languageConfigurationService=n,this._onDidChangeStickyScroll=this._register(new le),this.onDidChangeStickyScroll=this._onDidChangeStickyScroll.event,this._options=null,this._model=null,this._cts=null,this._stickyModelProvider=null,this._editor=e,this._sessionStore=this._register(new Be),this._updateSoon=this._register(new bi(()=>this.update(),50)),this._register(this._editor.onDidChangeConfiguration(o=>{o.hasChanged(114)&&this.readConfiguration()})),this.readConfiguration()}readConfiguration(){this._stickyModelProvider=null,this._sessionStore.clear(),this._options=this._editor.getOption(114),this._options.enabled&&(this._stickyModelProvider=this._sessionStore.add(new NU(this._editor,this._languageConfigurationService,this._languageFeaturesService,this._options.defaultModel)),this._sessionStore.add(this._editor.onDidChangeModel(()=>{this._model=null,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.update())}getVersionId(){var e;return(e=this._model)===null||e===void 0?void 0:e.version}update(){var e;return Yce(this,void 0,void 0,function*(){(e=this._cts)===null||e===void 0||e.dispose(!0),this._cts=new Ro,yield this.updateStickyModel(this._cts.token),this._onDidChangeStickyScroll.fire()})}updateStickyModel(e){return Yce(this,void 0,void 0,function*(){if(!this._editor.hasModel()||!this._stickyModelProvider||this._editor.getModel().isTooLargeForTokenization()){this._model=null;return}const t=this._editor.getModel(),n=t.getVersionId(),o=yield this._stickyModelProvider.update(t,n,e);e.isCancellationRequested||(this._model=o)})}updateIndex(e){return e===-1?e=0:e<0&&(e=-e-2),e}getCandidateStickyLinesIntersectingFromStickyModel(e,t,n,o,r){if(t.children.length===0)return;let s=r;const a=[];for(let u=0;uu-d)),c=this.updateIndex(xD(a,e.startLineNumber+o,(u,d)=>u-d));for(let u=l;u<=c;u++){const d=t.children[u];if(!d)return;if(d.range){const h=d.range.startLineNumber,f=d.range.endLineNumber;e.startLineNumber<=f+1&&h-1<=e.endLineNumber&&h!==s&&(s=h,n.push(new Yxt(h,f-1,o+1)),this.getCandidateStickyLinesIntersectingFromStickyModel(e,d,n,o+1,h))}else this.getCandidateStickyLinesIntersectingFromStickyModel(e,d,n,o,r)}}getCandidateStickyLinesIntersecting(e){var t,n;if(!(!((t=this._model)===null||t===void 0)&&t.element))return[];let o=[];this.getCandidateStickyLinesIntersectingFromStickyModel(e,this._model.element,o,0,-1);const r=(n=this._editor._getViewModel())===null||n===void 0?void 0:n.getHiddenAreas();if(r)for(const s of r)o=o.filter(a=>!(a.startLineNumber>=s.startLineNumber&&a.endLineNumber<=s.endLineNumber+1));return o}};PU=Xxt([Xce(1,pt),Xce(2,Ti)],PU);var Zxt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},nC=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},y7=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},OU;let Lf=OU=class extends _e{constructor(e,t,n,o,r,s,a){super(),this._editor=e,this._contextMenuService=t,this._languageFeaturesService=n,this._instaService=o,this._contextKeyService=a,this._sessionStore=new Be,this._foldingModel=null,this._maxStickyLines=Number.MAX_SAFE_INTEGER,this._candidateDefinitionsLength=-1,this._focusedStickyElementIndex=-1,this._enabled=!1,this._focused=!1,this._positionRevealed=!1,this._onMouseDown=!1,this._endLineNumbers=[],this._showEndForLine=null,this._stickyScrollWidget=new Kxt(this._editor),this._stickyLineCandidateProvider=new PU(this._editor,n,r),this._register(this._stickyScrollWidget),this._register(this._stickyLineCandidateProvider),this._widgetState=new Uce([],[],0),this._readConfiguration();const l=this._stickyScrollWidget.getDomNode();this._register(this._editor.onDidChangeConfiguration(u=>{(u.hasChanged(114)||u.hasChanged(72)||u.hasChanged(66)||u.hasChanged(109))&&this._readConfiguration()})),this._register(ke(l,et.CONTEXT_MENU,u=>y7(this,void 0,void 0,function*(){this._onContextMenu(u)}))),this._stickyScrollFocusedContextKey=Q.stickyScrollFocused.bindTo(this._contextKeyService),this._stickyScrollVisibleContextKey=Q.stickyScrollVisible.bindTo(this._contextKeyService);const c=this._register(pf(l));this._register(c.onDidBlur(u=>{this._positionRevealed===!1&&l.clientHeight===0?(this._focusedStickyElementIndex=-1,this.focus()):this._disposeFocusStickyScrollStore()})),this._register(c.onDidFocus(u=>{this.focus()})),this._registerMouseListeners(),this._register(ke(l,et.MOUSE_DOWN,u=>{this._onMouseDown=!0}))}static get(e){return e.getContribution(OU.ID)}_disposeFocusStickyScrollStore(){var e;this._stickyScrollFocusedContextKey.set(!1),(e=this._focusDisposableStore)===null||e===void 0||e.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 Be,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,0))}_reveaInEditor(e,t){this._focused&&this._disposeFocusStickyScrollStore(),this._positionRevealed=!0,t(),this._editor.setSelection(V.fromPositions(e)),this._editor.focus()}_registerMouseListeners(){const e=this._register(new Be),t=this._register(new cF(this._editor,{extractLineNumberFromMouseEvent:r=>{const s=this._stickyScrollWidget.getEditorPositionFromNode(r.target.element);return s?s.lineNumber:0}})),n=r=>{if(!this._editor.hasModel()||r.target.type!==12||r.target.detail!==this._stickyScrollWidget.getId())return null;const s=r.target.element;if(!s||s.innerText!==s.innerHTML)return null;const a=this._stickyScrollWidget.getEditorPositionFromNode(s);return a?{range:new V(a.lineNumber,a.column,a.lineNumber,a.column+s.innerText.length),textElement:s}:null},o=this._stickyScrollWidget.getDomNode();this._register(No(o,et.CLICK,r=>{if(r.ctrlKey||r.altKey||r.metaKey||!r.leftButton)return;if(r.shiftKey){const c=this._stickyScrollWidget.getLineIndexFromChildDomNode(r.target);if(c===null)return;const u=new ae(this._endLineNumbers[c],1);this._revealLineInCenterIfOutsideViewport(u);return}if(this._stickyScrollWidget.isInFoldingIconDomNode(r.target)){const c=this._stickyScrollWidget.getLineNumberFromChildDomNode(r.target);this._toggleFoldingRegionForLine(c);return}if(!this._stickyScrollWidget.isInStickyLine(r.target))return;let l=this._stickyScrollWidget.getEditorPositionFromNode(r.target);if(!l){const c=this._stickyScrollWidget.getLineNumberFromChildDomNode(r.target);if(c===null)return;l=new ae(c,1)}this._revealPosition(l)})),this._register(No(o,et.MOUSE_MOVE,r=>{if(r.shiftKey){const s=this._stickyScrollWidget.getLineIndexFromChildDomNode(r.target);if(s===null||this._showEndForLine!==null&&this._showEndForLine===s)return;this._showEndForLine=s,this._renderStickyScroll();return}this._showEndForLine!==null&&(this._showEndForLine=null,this._renderStickyScroll())})),this._register(ke(o,et.MOUSE_LEAVE,r=>{this._showEndForLine!==null&&(this._showEndForLine=null,this._renderStickyScroll())})),this._register(t.onMouseMoveOrRelevantKeyDown(([r,s])=>{const a=n(r);if(!a||!r.hasTriggerModifier||!this._editor.hasModel()){e.clear();return}const{range:l,textElement:c}=a;if(!l.equalsRange(this._stickyRangeProjectedOnEditor))this._stickyRangeProjectedOnEditor=l,e.clear();else if(c.style.textDecoration==="underline")return;const u=new Ro;e.add(zt(()=>u.dispose(!0)));let d;pF(this._languageFeaturesService.definitionProvider,this._editor.getModel(),new ae(l.startLineNumber,l.startColumn+1),u.token).then(h=>{if(!u.token.isCancellationRequested)if(h.length!==0){this._candidateDefinitionsLength=h.length;const f=c;d!==f?(e.clear(),d=f,d.style.textDecoration="underline",e.add(zt(()=>{d.style.textDecoration="none"}))):d||(d=f,d.style.textDecoration="underline",e.add(zt(()=>{d.style.textDecoration="none"})))}else e.clear()})})),this._register(t.onCancel(()=>{e.clear()})),this._register(t.onExecute(r=>y7(this,void 0,void 0,function*(){if(r.target.type!==12||r.target.detail!==this._stickyScrollWidget.getId())return;const s=this._stickyScrollWidget.getEditorPositionFromNode(r.target.element);!s||(this._candidateDefinitionsLength>1&&(this._focused&&this._disposeFocusStickyScrollStore(),this._revealPosition({lineNumber:s.lineNumber,column:1})),this._instaService.invokeFunction(pSe,r,this._editor,{uri:this._editor.getModel().uri,range:this._stickyRangeProjectedOnEditor}))})))}_onContextMenu(e){const t=new kc(e);this._contextMenuService.showContextMenu({menuId:Z.StickyScrollContext,getAnchor:()=>t})}_toggleFoldingRegionForLine(e){if(!this._foldingModel||e===null)return;const t=this._stickyScrollWidget.getStickyLineForLine(e),n=t==null?void 0:t.foldingIcon;if(!n)return;eSe(this._foldingModel,Number.MAX_VALUE,[e]),n.isCollapsed=!n.isCollapsed;const o=(n.isCollapsed?this._editor.getTopForLineNumber(n.foldingEndLine):this._editor.getTopForLineNumber(n.foldingStartLine))-this._editor.getOption(66)*t.index+1;this._editor.setScrollTop(o),this._renderStickyScroll(e)}_readConfiguration(){const e=this._editor.getOption(114);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(n=>{n.scrollTopChanged&&(this._showEndForLine=null,this._renderStickyScroll())})),this._sessionStore.add(this._editor.onDidLayoutChange(()=>this._onDidResize())),this._sessionStore.add(this._editor.onDidChangeModelTokens(n=>this._onTokensChange(n))),this._sessionStore.add(this._stickyLineCandidateProvider.onDidChangeStickyScroll(()=>{this._showEndForLine=null,this._renderStickyScroll()})),this._enabled=!0);this._editor.getOption(67).renderType===2&&this._sessionStore.add(this._editor.onDidChangeCursorPosition(()=>{this._showEndForLine=null,this._renderStickyScroll()}))}_needsUpdate(e){const t=this._stickyScrollWidget.getCurrentLines();for(const n of t)for(const o of e.ranges)if(n>=o.fromLineNumber&&n<=o.toLineNumber)return!0;return!1}_onTokensChange(e){this._needsUpdate(e)&&this._renderStickyScroll(-1)}_onDidResize(){const t=this._editor.getLayoutInfo().height/this._editor.getOption(66);this._maxStickyLines=Math.round(t*.25)}_renderStickyScroll(e=1/0){var t,n;return y7(this,void 0,void 0,function*(){const o=this._editor.getModel();if(!o||o.isTooLargeForTokenization()){this._foldingModel=null,this._stickyScrollWidget.setState(void 0,null,e);return}const r=this._stickyLineCandidateProvider.getVersionId();if(r===void 0||r===o.getVersionId())if(this._foldingModel=(n=yield(t=xf.get(this._editor))===null||t===void 0?void 0:t.getFoldingModel())!==null&&n!==void 0?n:null,this._widgetState=this.findScrollWidgetState(),this._stickyScrollVisibleContextKey.set(this._widgetState.startLineNumbers.length!==0),!this._focused)this._stickyScrollWidget.setState(this._widgetState,this._foldingModel,e);else if(this._focusedStickyElementIndex===-1)this._stickyScrollWidget.setState(this._widgetState,this._foldingModel,e),this._focusedStickyElementIndex=this._stickyScrollWidget.lineNumberCount-1,this._focusedStickyElementIndex!==-1&&this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex);else{const s=this._stickyScrollWidget.lineNumbers[this._focusedStickyElementIndex];this._stickyScrollWidget.setState(this._widgetState,this._foldingModel,e),this._stickyScrollWidget.lineNumberCount===0?this._focusedStickyElementIndex=-1:(this._stickyScrollWidget.lineNumbers.includes(s)||(this._focusedStickyElementIndex=this._stickyScrollWidget.lineNumberCount-1),this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex))}})}findScrollWidgetState(){const e=this._editor.getOption(66),t=Math.min(this._maxStickyLines,this._editor.getOption(114).maxLineCount),n=this._editor.getScrollTop();let o=0;const r=[],s=[],a=this._editor.getVisibleRanges();if(a.length!==0){const l=new FE(a[0].startLineNumber,a[a.length-1].endLineNumber),c=this._stickyLineCandidateProvider.getCandidateStickyLinesIntersecting(l);for(const u of c){const d=u.startLineNumber,h=u.endLineNumber,f=u.nestingDepth;if(h-d>0){const g=(f-1)*e,p=f*e,v=this._editor.getBottomForLineNumber(d)-n,m=this._editor.getTopForLineNumber(h)-n,_=this._editor.getBottomForLineNumber(h)-n;if(g>m&&g<=_){r.push(d),s.push(h+1),o=_-p;break}else p>v&&p<=_&&(r.push(d),s.push(h+1));if(r.length===t)break}}}return this._endLineNumbers=s,new Uce(r,s,o,this._showEndForLine)}dispose(){super.dispose(),this._sessionStore.dispose()}};Lf.ID="store.contrib.stickyScrollController";Lf=OU=Zxt([nC(1,Ku),nC(2,pt),nC(3,$t),nC(4,Ti),nC(5,qc),nC(6,Ut)],Lf);var Qxt=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};class Jxt extends ec{constructor(){super({id:"editor.action.toggleStickyScroll",title:{value:C("toggleStickyScroll","Toggle Sticky Scroll"),mnemonicTitle:C({key:"mitoggleStickyScroll",comment:["&& denotes a mnemonic"]},"&&Toggle Sticky Scroll"),original:"Toggle Sticky Scroll"},category:zxt.View,toggled:{condition:Me.equals("config.editor.stickyScroll.enabled",!0),title:C("stickyScroll","Sticky Scroll"),mnemonicTitle:C({key:"miStickyScroll",comment:["&& denotes a mnemonic"]},"&&Sticky Scroll")},menu:[{id:Z.CommandPalette},{id:Z.MenubarAppearanceMenu,group:"4_editor",order:3},{id:Z.StickyScrollContext}]})}run(e){return Qxt(this,void 0,void 0,function*(){const t=e.get(En),n=!t.getValue("editor.stickyScroll.enabled");return t.updateValue("editor.stickyScroll.enabled",n)})}}const qF=100;class eLt extends lh{constructor(){super({id:"editor.action.focusStickyScroll",title:{value:C("focusStickyScroll","Focus Sticky Scroll"),mnemonicTitle:C({key:"mifocusStickyScroll",comment:["&& denotes a mnemonic"]},"&&Focus Sticky Scroll"),original:"Focus Sticky Scroll"},precondition:Me.and(Me.has("config.editor.stickyScroll.enabled"),Q.stickyScrollVisible),menu:[{id:Z.CommandPalette}]})}runEditorCommand(e,t){var n;(n=Lf.get(t))===null||n===void 0||n.focus()}}class tLt extends lh{constructor(){super({id:"editor.action.selectNextStickyScrollLine",title:{value:C("selectNextStickyScrollLine.title","Select next sticky scroll line"),original:"Select next sticky scroll line"},precondition:Q.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:qF,primary:18}})}runEditorCommand(e,t){var n;(n=Lf.get(t))===null||n===void 0||n.focusNext()}}class nLt extends lh{constructor(){super({id:"editor.action.selectPreviousStickyScrollLine",title:{value:C("selectPreviousStickyScrollLine.title","Select previous sticky scroll line"),original:"Select previous sticky scroll line"},precondition:Q.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:qF,primary:16}})}runEditorCommand(e,t){var n;(n=Lf.get(t))===null||n===void 0||n.focusPrevious()}}class iLt extends lh{constructor(){super({id:"editor.action.goToFocusedStickyScrollLine",title:{value:C("goToFocusedStickyScrollLine.title","Go to focused sticky scroll line"),original:"Go to focused sticky scroll line"},precondition:Q.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:qF,primary:3}})}runEditorCommand(e,t){var n;(n=Lf.get(t))===null||n===void 0||n.goToFocused()}}class oLt extends lh{constructor(){super({id:"editor.action.selectEditor",title:{value:C("selectEditor.title","Select Editor"),original:"Select Editor"},precondition:Q.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:qF,primary:9}})}runEditorCommand(e,t){var n;(n=Lf.get(t))===null||n===void 0||n.selectEditor()}}zn(Lf.ID,Lf,1);$i(Jxt);$i(eLt);$i(nLt);$i(tLt);$i(iLt);$i(oLt);var KY=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},F0=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},rLt=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},O_;class sLt{constructor(e,t,n,o,r,s){this.range=e,this.insertText=t,this.filterText=n,this.additionalTextEdits=o,this.command=r,this.completion=s}}let FU=class extends LYe{constructor(e,t,n,o,r,s){super(r.disposable),this.model=e,this.line=t,this.word=n,this.completionModel=o,this._suggestMemoryService=s}canBeReused(e,t,n){return this.model===e&&this.line===t&&this.word.word.length>0&&this.word.startColumn===n.startColumn&&this.word.endColumn=0&&l.resolve(_n.None)}return t}};FU=KY([F0(5,IF)],FU);let BU=class{constructor(e,t,n,o){this._getEditorOption=e,this._languageFeatureService=t,this._clipboardService=n,this._suggestMemoryService=o}provideInlineCompletions(e,t,n,o){var r;return rLt(this,void 0,void 0,function*(){if(n.selectedSuggestionInfo)return;const s=this._getEditorOption(88,e);if(ZC.isAllOff(s))return;e.tokenization.tokenizeIfCheap(t.lineNumber);const a=e.tokenization.getLineTokens(t.lineNumber),l=a.getStandardTokenType(a.findTokenIndexAtOffset(Math.max(t.column-1-1,0)));if(ZC.valueFor(s,l)!=="inline")return;let c=e.getWordAtPosition(t),u;if(c!=null&&c.word||(u=this._getTriggerCharacterInfo(e,t)),!(c!=null&&c.word)&&!u||(c||(c=e.getWordUntilPosition(t)),c.endColumn!==t.column))return;let d;const h=e.getValueInRange(new V(t.lineNumber,1,t.lineNumber,t.column));if(!u&&((r=this._lastResult)===null||r===void 0?void 0:r.canBeReused(e,t.lineNumber,c))){const f=new Bce(h,t.column-this._lastResult.word.endColumn);this._lastResult.completionModel.lineContext=f,this._lastResult.acquire(),d=this._lastResult}else{const f=yield RY(this._languageFeatureService.completionProvider,e,t,new zk(void 0,void 0,u==null?void 0:u.providers),u&&{triggerKind:1,triggerCharacter:u.ch},o);let g;f.needsClipboard&&(g=yield this._clipboardService.readText());const p=new dm(f.items,t.column,new Bce(h,0),xd.None,this._getEditorOption(117,e),this._getEditorOption(111,e),{boostFullMatch:!1,firstMatchCanBeWeak:!1},g);d=new FU(e,t.lineNumber,c,p,f,this._suggestMemoryService)}return this._lastResult=d,d})}handleItemDidShow(e,t){t.completion.resolve(_n.None)}freeInlineCompletions(e){e.release()}_getTriggerCharacterInfo(e,t){var n;const o=e.getValueInRange(V.fromPositions({lineNumber:t.lineNumber,column:t.column-1},t)),r=new Set;for(const s of this._languageFeatureService.completionProvider.all(e))!((n=s.triggerCharacters)===null||n===void 0)&&n.includes(o)&&r.add(s);if(r.size!==0)return{providers:r,ch:o}}};BU=KY([F0(1,pt),F0(2,yp),F0(3,IF)],BU);let MO=O_=class{constructor(e,t,n,o){if(++O_._counter===1){const r=o.createInstance(BU,(s,a)=>{var l;return((l=n.listCodeEditors().find(u=>u.getModel()===a))!==null&&l!==void 0?l:e).getOption(s)});O_._disposable=t.inlineCompletionsProvider.register("*",r)}}dispose(){var e;--O_._counter===0&&((e=O_._disposable)===null||e===void 0||e.dispose(),O_._disposable=void 0)}};MO._counter=0;MO=O_=KY([F0(1,pt),F0(2,Jn),F0(3,$t)],MO);zn("suggest.inlineCompletionsProvider",MO,0);class aLt extends ft{constructor(){super({id:"editor.action.forceRetokenize",label:C("forceRetokenize","Developer: Force Retokenize"),alias:"Developer: Force Retokenize",precondition:void 0})}run(e,t){if(!t.hasModel())return;const n=t.getModel();n.tokenization.resetTokenization();const o=new Ls;n.tokenization.forceTokenization(n.getLineCount()),o.stop(),console.log(`tokenization took ${o.elapsed()}`)}}ze(aLt);class GF extends ec{constructor(){super({id:GF.ID,title:{value:C({key:"toggle.tabMovesFocus",comment:["Turn on/off use of tab key for moving focus around VS Code"]},"Toggle Tab Key Moves Focus"),original:"Toggle Tab Key Moves Focus"},precondition:void 0,keybinding:{primary:2091,mac:{primary:1323},weight:100},f1:!0})}run(){const t=!yw.getTabFocusMode();yw.setTabFocusMode(t),Cs(t?C("toggle.tabMovesFocus.on","Pressing Tab will now move focus to the next focusable element"):C("toggle.tabMovesFocus.off","Pressing Tab will now insert the tab character"))}}GF.ID="editor.action.toggleTabFocusMode";$i(GF);var lLt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},cLt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let WU=class extends _e{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}constructor(e,t,n={},o){var r;super(),this._link=t,this._enabled=!0,this.el=Ae(e,He("a.monaco-link",{tabIndex:(r=t.tabIndex)!==null&&r!==void 0?r:0,href:t.href,title:t.title},t.label)),this.el.setAttribute("role","button");const s=this._register(new xn(this.el,"click")),a=this._register(new xn(this.el,"keypress")),l=st.chain(a.event,d=>d.map(h=>new Pi(h)).filter(h=>h.keyCode===3)),c=this._register(new xn(this.el,Di.Tap)).event;this._register(Ei.addTarget(this.el));const u=st.any(s.event,l,c);this._register(u(d=>{!this.enabled||(dn.stop(d,!0),n!=null&&n.opener?n.opener(this._link.href):o.open(this._link.href,{allowCommands:!0}))})),this.enabled=!0}};WU=lLt([cLt(3,ml)],WU);var HSe=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},$Se=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const uLt=26;let VU=class extends _e{constructor(e,t){super(),this._editor=e,this.instantiationService=t,this.banner=this._register(this.instantiationService.createInstance(HU))}hide(){this._editor.setBanner(null,0),this.banner.clear()}show(e){this.banner.show(Object.assign(Object.assign({},e),{onClose:()=>{var t;this.hide(),(t=e.onClose)===null||t===void 0||t.call(e)}})),this._editor.setBanner(this.banner.element,uLt)}};VU=HSe([$Se(1,$t)],VU);let HU=class extends _e{constructor(e){super(),this.instantiationService=e,this.markdownRenderer=this.instantiationService.createInstance(up,{}),this.element=He("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=He("span");return t.innerText=e,t}return this.markdownRenderer.render(e).element}clear(){Ur(this.element)}show(e){Ur(this.element);const t=this.getAriaLabel(e);t&&this.element.setAttribute("aria-label",t);const n=Ae(this.element,He("div.icon-container"));n.setAttribute("aria-hidden","true"),e.icon&&n.appendChild(He(`div${Mt.asCSSSelector(e.icon)}`));const o=Ae(this.element,He("div.message-container"));if(o.setAttribute("aria-hidden","true"),o.appendChild(this.getBannerMessage(e.message)),this.messageActionsContainer=Ae(this.element,He("div.message-actions-container")),e.actions)for(const s of e.actions)this._register(this.instantiationService.createInstance(WU,this.messageActionsContainer,Object.assign(Object.assign({},s),{tabIndex:-1}),{}));const r=Ae(this.element,He("div.action-container"));this.actionBar=this._register(new zc(r)),this.actionBar.push(this._register(new ca("banner.close","Close Banner",Mt.asClassName(DCe),!0,()=>{typeof e.onClose=="function"&&e.onClose()})),{icon:!0,label:!1}),this.actionBar.setFocusable(!1)}};HU=HSe([$Se(0,$t)],HU);var qY=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Vy=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},ms=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};const dLt=Eo("extensions-warning-message",Xe.warning,C("warningIcon","Icon shown with a warning message in the extensions editor."));let Qw=class extends _e{constructor(e,t,n,o){super(),this._editor=e,this._editorWorkerService=t,this._workspaceTrustService=n,this._highlighter=null,this._bannerClosed=!1,this._updateState=r=>{if(r&&r.hasMore){if(this._bannerClosed)return;const s=Math.max(r.ambiguousCharacterCount,r.nonBasicAsciiCharacterCount,r.invisibleCharacterCount);let a;if(r.nonBasicAsciiCharacterCount>=s)a={message:C("unicodeHighlighting.thisDocumentHasManyNonBasicAsciiUnicodeCharacters","This document contains many non-basic ASCII unicode characters"),command:new OS};else if(r.ambiguousCharacterCount>=s)a={message:C("unicodeHighlighting.thisDocumentHasManyAmbiguousUnicodeCharacters","This document contains many ambiguous unicode characters"),command:new i_};else if(r.invisibleCharacterCount>=s)a={message:C("unicodeHighlighting.thisDocumentHasManyInvisibleUnicodeCharacters","This document contains many invisible unicode characters"),command:new PS};else throw new Error("Unreachable");this._bannerController.show({id:"unicodeHighlightBanner",message:a.message,icon:dLt,actions:[{label:a.command.shortLabel,href:`command:${a.command.id}`}],onClose:()=>{this._bannerClosed=!0}})}else this._bannerController.hide()},this._bannerController=this._register(o.createInstance(VU,e)),this._register(this._editor.onDidChangeModel(()=>{this._bannerClosed=!1,this._updateHighlighter()})),this._options=e.getOption(124),this._register(n.onDidChangeTrust(r=>{this._updateHighlighter()})),this._register(e.onDidChangeConfiguration(r=>{r.hasChanged(124)&&(this._options=e.getOption(124),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=hLt(this._workspaceTrustService.isWorkspaceTrusted(),this._options);if([e.nonBasicASCII,e.ambiguousCharacters,e.invisibleCharacters].every(n=>n===!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(n=>n.codePointAt(0)),allowedLocales:Object.keys(e.allowedLocales).map(n=>n==="_os"?new Intl.NumberFormat().resolvedOptions().locale:n==="_vscode"?DXe:n)};this._editorWorkerService.canComputeUnicodeHighlights(this._editor.getModel().uri)?this._highlighter=new $U(this._editor,t,this._updateState,this._editorWorkerService):this._highlighter=new fLt(this._editor,t,this._updateState)}getDecorationInfo(e){return this._highlighter?this._highlighter.getDecorationInfo(e):null}};Qw.ID="editor.contrib.unicodeHighlighter";Qw=qY([Vy(1,Xu),Vy(2,L1e),Vy(3,$t)],Qw);function hLt(i,e){return{nonBasicASCII:e.nonBasicASCII===kl?!i:e.nonBasicASCII,ambiguousCharacters:e.ambiguousCharacters,invisibleCharacters:e.invisibleCharacters,includeComments:e.includeComments===kl?!i:e.includeComments,includeStrings:e.includeStrings===kl?!i:e.includeStrings,allowedCharacters:e.allowedCharacters,allowedLocales:e.allowedLocales}}let $U=class extends _e{constructor(e,t,n,o){super(),this._editor=e,this._options=t,this._updateState=n,this._editorWorkerService=o,this._model=this._editor.getModel(),this._decorations=this._editor.createDecorationsCollection(),this._updateSoon=this._register(new bi(()=>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 n=[];if(!t.hasMore)for(const o of t.ranges)n.push({range:o,options:AO.instance.getDecorationFromOptions(this._options)});this._decorations.set(n)})}getDecorationInfo(e){if(!this._decorations.has(e))return null;const t=this._editor.getModel();if(!XG(t,e))return null;const n=t.getValueInRange(e.range);return{reason:zSe(n,this._options),inComment:YG(t,e),inString:ZG(t,e)}}};$U=qY([Vy(3,Xu)],$U);class fLt extends _e{constructor(e,t,n){super(),this._editor=e,this._options=t,this._updateState=n,this._model=this._editor.getModel(),this._decorations=this._editor.createDecorationsCollection(),this._updateSoon=this._register(new bi(()=>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=[],n={ranges:[],ambiguousCharacterCount:0,invisibleCharacterCount:0,nonBasicAsciiCharacterCount:0,hasMore:!1};for(const o of e){const r=cG.computeUnicodeHighlights(this._model,this._options,o);for(const s of r.ranges)n.ranges.push(s);n.ambiguousCharacterCount+=n.ambiguousCharacterCount,n.invisibleCharacterCount+=n.invisibleCharacterCount,n.nonBasicAsciiCharacterCount+=n.nonBasicAsciiCharacterCount,n.hasMore=n.hasMore||r.hasMore}if(!n.hasMore)for(const o of n.ranges)t.push({range:o,options:AO.instance.getDecorationFromOptions(this._options)});this._updateState(n),this._decorations.set(t)}getDecorationInfo(e){if(!this._decorations.has(e))return null;const t=this._editor.getModel(),n=t.getValueInRange(e.range);return XG(t,e)?{reason:zSe(n,this._options),inComment:YG(t,e),inString:ZG(t,e)}:null}}let zU=class{constructor(e,t,n){this._editor=e,this._languageService=t,this._openerService=n,this.hoverOrdinal=5}computeSync(e,t){if(!this._editor.hasModel()||e.type!==1)return[];const n=this._editor.getModel(),o=this._editor.getContribution(Qw.ID);if(!o)return[];const r=[],s=new Set;let a=300;for(const l of t){const c=o.getDecorationInfo(l);if(!c)continue;const d=n.getValueInRange(l.range).codePointAt(0),h=w7(d);let f;switch(c.reason.kind){case 0:{VI(c.reason.confusableWith)?f=C("unicodeHighlight.characterIsAmbiguousASCII","The character {0} could be confused with the ASCII character {1}, which is more common in source code.",h,w7(c.reason.confusableWith.codePointAt(0))):f=C("unicodeHighlight.characterIsAmbiguous","The character {0} could be confused with the character {1}, which is more common in source code.",h,w7(c.reason.confusableWith.codePointAt(0)));break}case 1:f=C("unicodeHighlight.characterIsInvisible","The character {0} is invisible.",h);break;case 2:f=C("unicodeHighlight.characterIsNonBasicAscii","The character {0} is not a basic ASCII character.",h);break}if(s.has(f))continue;s.add(f);const g={codePoint:d,reason:c.reason,inComment:c.inComment,inString:c.inString},p=C("unicodeHighlight.adjustSettings","Adjust settings"),v=`command:${xT.ID}?${encodeURIComponent(JSON.stringify(g))}`,m=new os("",!0).appendMarkdown(f).appendText(" ").appendLink(v,p);r.push(new Dd(this,l.range,[m],!1,a++))}return r}renderHoverParts(e,t){return bwe(e,t,this._editor,this._languageService,this._openerService)}};zU=qY([Vy(1,Ki),Vy(2,ml)],zU);function UU(i){return`U+${i.toString(16).padStart(4,"0")}`}function w7(i){let e=`\`${UU(i)}\``;return cf.isInvisibleCharacter(i)||(e+=` "${`${gLt(i)}`}"`),e}function gLt(i){return i===96?"`` ` ``":"`"+String.fromCodePoint(i)+"`"}function zSe(i,e){return cG.computeUnicodeHighlightReason(i,e)}class AO{constructor(){this.map=new Map}getDecorationFromOptions(e){return this.getDecoration(!e.includeComments,!e.includeStrings)}getDecoration(e,t){const n=`${e}${t}`;let o=this.map.get(n);return o||(o=Jt.createDynamic({description:"unicode-highlight",stickiness:1,className:"unicode-highlight",showIfCollapsed:!0,overviewRuler:null,minimap:null,hideInCommentTokens:e,hideInStringTokens:t}),this.map.set(n,o)),o}}AO.instance=new AO;class pLt extends ft{constructor(){super({id:i_.ID,label:C("action.unicodeHighlight.disableHighlightingInComments","Disable highlighting of characters in comments"),alias:"Disable highlighting of characters in comments",precondition:void 0}),this.shortLabel=C("unicodeHighlight.disableHighlightingInComments.shortLabel","Disable Highlight In Comments")}run(e,t,n){return ms(this,void 0,void 0,function*(){const o=e==null?void 0:e.get(En);o&&this.runAction(o)})}runAction(e){return ms(this,void 0,void 0,function*(){yield e.updateValue(Ta.includeComments,!1,2)})}}class mLt extends ft{constructor(){super({id:i_.ID,label:C("action.unicodeHighlight.disableHighlightingInStrings","Disable highlighting of characters in strings"),alias:"Disable highlighting of characters in strings",precondition:void 0}),this.shortLabel=C("unicodeHighlight.disableHighlightingInStrings.shortLabel","Disable Highlight In Strings")}run(e,t,n){return ms(this,void 0,void 0,function*(){const o=e==null?void 0:e.get(En);o&&this.runAction(o)})}runAction(e){return ms(this,void 0,void 0,function*(){yield e.updateValue(Ta.includeStrings,!1,2)})}}class i_ extends ft{constructor(){super({id:i_.ID,label:C("action.unicodeHighlight.disableHighlightingOfAmbiguousCharacters","Disable highlighting of ambiguous characters"),alias:"Disable highlighting of ambiguous characters",precondition:void 0}),this.shortLabel=C("unicodeHighlight.disableHighlightingOfAmbiguousCharacters.shortLabel","Disable Ambiguous Highlight")}run(e,t,n){return ms(this,void 0,void 0,function*(){const o=e==null?void 0:e.get(En);o&&this.runAction(o)})}runAction(e){return ms(this,void 0,void 0,function*(){yield e.updateValue(Ta.ambiguousCharacters,!1,2)})}}i_.ID="editor.action.unicodeHighlight.disableHighlightingOfAmbiguousCharacters";class PS extends ft{constructor(){super({id:PS.ID,label:C("action.unicodeHighlight.disableHighlightingOfInvisibleCharacters","Disable highlighting of invisible characters"),alias:"Disable highlighting of invisible characters",precondition:void 0}),this.shortLabel=C("unicodeHighlight.disableHighlightingOfInvisibleCharacters.shortLabel","Disable Invisible Highlight")}run(e,t,n){return ms(this,void 0,void 0,function*(){const o=e==null?void 0:e.get(En);o&&this.runAction(o)})}runAction(e){return ms(this,void 0,void 0,function*(){yield e.updateValue(Ta.invisibleCharacters,!1,2)})}}PS.ID="editor.action.unicodeHighlight.disableHighlightingOfInvisibleCharacters";class OS extends ft{constructor(){super({id:OS.ID,label:C("action.unicodeHighlight.disableHighlightingOfNonBasicAsciiCharacters","Disable highlighting of non basic ASCII characters"),alias:"Disable highlighting of non basic ASCII characters",precondition:void 0}),this.shortLabel=C("unicodeHighlight.disableHighlightingOfNonBasicAsciiCharacters.shortLabel","Disable Non ASCII Highlight")}run(e,t,n){return ms(this,void 0,void 0,function*(){const o=e==null?void 0:e.get(En);o&&this.runAction(o)})}runAction(e){return ms(this,void 0,void 0,function*(){yield e.updateValue(Ta.nonBasicASCII,!1,2)})}}OS.ID="editor.action.unicodeHighlight.disableHighlightingOfNonBasicAsciiCharacters";class xT extends ft{constructor(){super({id:xT.ID,label:C("action.unicodeHighlight.showExcludeOptions","Show Exclude Options"),alias:"Show Exclude Options",precondition:void 0})}run(e,t,n){return ms(this,void 0,void 0,function*(){const{codePoint:o,reason:r,inString:s,inComment:a}=n,l=String.fromCodePoint(o),c=e.get(uh),u=e.get(En);function d(g){return cf.isInvisibleCharacter(g)?C("unicodeHighlight.excludeInvisibleCharFromBeingHighlighted","Exclude {0} (invisible character) from being highlighted",UU(g)):C("unicodeHighlight.excludeCharFromBeingHighlighted","Exclude {0} from being highlighted",`${UU(g)} "${l}"`)}const h=[];if(r.kind===0)for(const g of r.notAmbiguousInLocales)h.push({label:C("unicodeHighlight.allowCommonCharactersInLanguage",'Allow unicode characters that are more common in the language "{0}".',g),run:()=>ms(this,void 0,void 0,function*(){_Lt(u,[g])})});if(h.push({label:d(o),run:()=>vLt(u,[o])}),a){const g=new pLt;h.push({label:g.label,run:()=>ms(this,void 0,void 0,function*(){return g.runAction(u)})})}else if(s){const g=new mLt;h.push({label:g.label,run:()=>ms(this,void 0,void 0,function*(){return g.runAction(u)})})}if(r.kind===0){const g=new i_;h.push({label:g.label,run:()=>ms(this,void 0,void 0,function*(){return g.runAction(u)})})}else if(r.kind===1){const g=new PS;h.push({label:g.label,run:()=>ms(this,void 0,void 0,function*(){return g.runAction(u)})})}else if(r.kind===2){const g=new OS;h.push({label:g.label,run:()=>ms(this,void 0,void 0,function*(){return g.runAction(u)})})}else bLt(r);const f=yield c.pick(h,{title:C("unicodeHighlight.configureUnicodeHighlightOptions","Configure Unicode Highlight Options")});f&&(yield f.run())})}}xT.ID="editor.action.unicodeHighlight.showExcludeOptions";function vLt(i,e){return ms(this,void 0,void 0,function*(){const t=i.getValue(Ta.allowedCharacters);let n;typeof t=="object"&&t?n=t:n={};for(const o of e)n[String.fromCodePoint(o)]=!0;yield i.updateValue(Ta.allowedCharacters,n,2)})}function _Lt(i,e){var t;return ms(this,void 0,void 0,function*(){const n=(t=i.inspect(Ta.allowedLocales).user)===null||t===void 0?void 0:t.value;let o;typeof n=="object"&&n?o=Object.assign({},n):o={};for(const r of e)o[r]=!0;yield i.updateValue(Ta.allowedLocales,o,2)})}function bLt(i){throw new Error(`Unexpected value: ${i}`)}ze(i_);ze(PS);ze(OS);ze(xT);zn(Qw.ID,Qw,1);e1.register(zU);var CLt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Zce=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},yLt=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};const USe="ignoreUnusualLineTerminators";function wLt(i,e,t){i.setModelProperty(e.uri,USe,t)}function SLt(i,e){return i.getModelProperty(e.uri,USe)}let nI=class extends _e{constructor(e,t,n){super(),this._editor=e,this._dialogService=t,this._codeEditorService=n,this._isPresentingDialog=!1,this._config=this._editor.getOption(125),this._register(this._editor.onDidChangeConfiguration(o=>{o.hasChanged(125)&&(this._config=this._editor.getOption(125),this._checkForUnusualLineTerminators())})),this._register(this._editor.onDidChangeModel(()=>{this._checkForUnusualLineTerminators()})),this._register(this._editor.onDidChangeModelContent(o=>{o.isUndoing||this._checkForUnusualLineTerminators()})),this._checkForUnusualLineTerminators()}_checkForUnusualLineTerminators(){return yLt(this,void 0,void 0,function*(){if(this._config==="off"||!this._editor.hasModel())return;const e=this._editor.getModel();if(!e.mightContainUnusualLineTerminators()||SLt(this._codeEditorService,e)===!0||this._editor.getOption(90))return;if(this._config==="auto"){e.removeUnusualLineTerminators(this._editor.getSelections());return}if(this._isPresentingDialog)return;let n;try{this._isPresentingDialog=!0,n=yield this._dialogService.confirm({title:C("unusualLineTerminators.title","Unusual Line Terminators"),message:C("unusualLineTerminators.message","Detected unusual line terminators"),detail:C("unusualLineTerminators.detail","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`.",$c(e.uri)),primaryButton:C({key:"unusualLineTerminators.fix",comment:["&& denotes a mnemonic"]},"&&Remove Unusual Line Terminators"),cancelButton:C("unusualLineTerminators.ignore","Ignore")})}finally{this._isPresentingDialog=!1}if(!n.confirmed){wLt(this._codeEditorService,e,!0);return}e.removeUnusualLineTerminators(this._editor.getSelections())})}};nI.ID="editor.contrib.unusualLineTerminatorsDetector";nI=CLt([Zce(1,tT),Zce(2,Jn)],nI);zn(nI.ID,nI,1);var xLt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Qce=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},jU;const XF=new lt("hasWordHighlights",!1);function jSe(i,e,t,n){const o=i.ordered(e);return L0e(o.map(r=>()=>Promise.resolve(r.provideDocumentHighlights(e,t,n)).then(void 0,$o)),ws)}class KSe{constructor(e,t,n){this._model=e,this._selection=t,this._wordSeparators=n,this._wordRange=this._getCurrentWordRange(e,t),this._result=null}get result(){return this._result||(this._result=sr(e=>this._compute(this._model,this._selection,this._wordSeparators,e))),this._result}_getCurrentWordRange(e,t){const n=e.getWordAtPosition(t.getPosition());return n?new V(t.startLineNumber,n.startColumn,t.startLineNumber,n.endColumn):null}isValid(e,t,n){const o=t.startLineNumber,r=t.startColumn,s=t.endColumn,a=this._getCurrentWordRange(e,t);let l=Boolean(this._wordRange&&this._wordRange.equalsRange(a));for(let c=0,u=n.length;!l&&c=s&&(l=!0)}return l}cancel(){this.result.cancel()}}class LLt extends KSe{constructor(e,t,n,o){super(e,t,n),this._providers=o}_compute(e,t,n,o){return jSe(this._providers,e,t.getPosition(),o).then(r=>r||[])}}class ELt extends KSe{constructor(e,t,n){super(e,t,n),this._selectionIsEmpty=t.isEmpty()}_compute(e,t,n,o){return wv(250,o).then(()=>{if(!t.isEmpty())return[];const r=e.getWordAtPosition(t.getPosition());return!r||r.word.length>1e3?[]:e.findMatches(r.word,!0,!1,!0,n,!1).map(a=>({range:a.range,kind:ND.Text}))})}isValid(e,t,n){const o=t.isEmpty();return this._selectionIsEmpty!==o?!1:super.isValid(e,t,n)}}function DLt(i,e,t,n){return i.has(e)?new LLt(e,t,n,i):new ELt(e,t,n)}Nf("_executeDocumentHighlights",(i,e,t)=>{const n=i.get(pt);return jSe(n.documentHighlightProvider,e,t,_n.None)});class kLt{constructor(e,t,n,o){this.toUnhook=new Be,this.workerRequestTokenId=0,this.workerRequestCompleted=!1,this.workerRequestValue=[],this.lastCursorPositionChangeTime=0,this.renderDecorationsTimer=-1,this.editor=e,this.providers=t,this.linkedHighlighters=n,this._hasWordHighlights=XF.bindTo(o),this._ignorePositionChangeEvent=!1,this.occurrencesHighlight=this.editor.getOption(80),this.model=this.editor.getModel(),this.toUnhook.add(e.onDidChangeCursorPosition(r=>{this._ignorePositionChangeEvent||!this.occurrencesHighlight||this._onPositionChanged(r)})),this.toUnhook.add(e.onDidChangeModelContent(r=>{this._stopAll()})),this.toUnhook.add(e.onDidChangeConfiguration(r=>{const s=this.editor.getOption(80);this.occurrencesHighlight!==s&&(this.occurrencesHighlight=s,this._stopAll())})),this.decorations=this.editor.createDecorationsCollection(),this.workerRequestTokenId=0,this.workerRequest=null,this.workerRequestCompleted=!1,this.lastCursorPositionChangeTime=0,this.renderDecorationsTimer=-1}hasDecorations(){return this.decorations.length>0}restore(){!this.occurrencesHighlight||this._run()}_getSortedHighlights(){return this.decorations.getRanges().sort(V.compareRangesUsingStarts)}moveNext(){const e=this._getSortedHighlights(),n=(e.findIndex(r=>r.containsPosition(this.editor.getPosition()))+1)%e.length,o=e[n];try{this._ignorePositionChangeEvent=!0,this.editor.setPosition(o.getStartPosition()),this.editor.revealRangeInCenterIfOutsideViewport(o);const r=this._getWord();if(r){const s=this.editor.getModel().getLineContent(o.startLineNumber);Cs(`${s}, ${n+1} of ${e.length} for '${r.word}'`)}}finally{this._ignorePositionChangeEvent=!1}}moveBack(){const e=this._getSortedHighlights(),n=(e.findIndex(r=>r.containsPosition(this.editor.getPosition()))-1+e.length)%e.length,o=e[n];try{this._ignorePositionChangeEvent=!0,this.editor.setPosition(o.getStartPosition()),this.editor.revealRangeInCenterIfOutsideViewport(o);const r=this._getWord();if(r){const s=this.editor.getModel().getLineContent(o.startLineNumber);Cs(`${s}, ${n+1} of ${e.length} for '${r.word}'`)}}finally{this._ignorePositionChangeEvent=!1}}_removeDecorations(){this.decorations.length>0&&(this.decorations.clear(),this._hasWordHighlights.set(!1))}_stopAll(){this._removeDecorations(),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){this._stopAll();return}if(e.reason!==3){this._stopAll();return}this._run()}_getWord(){const e=this.editor.getSelection(),t=e.startLineNumber,n=e.startColumn;return this.model.getWordAtPosition({lineNumber:t,column:n})}_run(){const e=this.editor.getSelection();if(e.startLineNumber!==e.endLineNumber){this._stopAll();return}const t=e.startColumn,n=e.endColumn,o=this._getWord();if(!o||o.startColumn>t||o.endColumn{s===this.workerRequestTokenId&&(this.workerRequestCompleted=!0,this.workerRequestValue=a||[],this._beginRenderDecorations())},en)}}_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=[];for(const t of this.workerRequestValue)t.range&&e.push({range:t.range,options:JSt(t.kind)});this.decorations.set(e),this._hasWordHighlights.set(this.hasDecorations());for(const t of this.linkedHighlighters())(t==null?void 0:t.editor.getModel())===this.editor.getModel()&&(t._stopAll(),t.decorations.set(e),t._hasWordHighlights.set(t.hasDecorations()))}dispose(){this._stopAll(),this.toUnhook.dispose()}}let Eb=jU=class extends _e{static get(e){return e.getContribution(jU.ID)}constructor(e,t,n){super(),this.wordHighlighter=null,this.linkedContributions=new Set;const o=()=>{e.hasModel()&&!e.getModel().isTooLargeForTokenization()&&(this.wordHighlighter=new kLt(e,n.documentHighlightProvider,()=>vn.map(this.linkedContributions,r=>r.wordHighlighter),t))};this._register(e.onDidChangeModel(r=>{this.wordHighlighter&&(this.wordHighlighter.dispose(),this.wordHighlighter=null),o()})),o()}saveViewState(){return!!(this.wordHighlighter&&this.wordHighlighter.hasDecorations())}moveNext(){var e;(e=this.wordHighlighter)===null||e===void 0||e.moveNext()}moveBack(){var e;(e=this.wordHighlighter)===null||e===void 0||e.moveBack()}restoreViewState(e){this.wordHighlighter&&e&&this.wordHighlighter.restore()}dispose(){this.wordHighlighter&&(this.wordHighlighter.dispose(),this.wordHighlighter=null),super.dispose()}};Eb.ID="editor.contrib.wordHighlighter";Eb=jU=xLt([Qce(1,Ut),Qce(2,pt)],Eb);class qSe extends ft{constructor(e,t){super(t),this._isNext=e}run(e,t){const n=Eb.get(t);!n||(this._isNext?n.moveNext():n.moveBack())}}class ILt extends qSe{constructor(){super(!0,{id:"editor.action.wordHighlight.next",label:C("wordHighlight.next.label","Go to Next Symbol Highlight"),alias:"Go to Next Symbol Highlight",precondition:XF,kbOpts:{kbExpr:Q.editorTextFocus,primary:65,weight:100}})}}class TLt extends qSe{constructor(){super(!1,{id:"editor.action.wordHighlight.prev",label:C("wordHighlight.previous.label","Go to Previous Symbol Highlight"),alias:"Go to Previous Symbol Highlight",precondition:XF,kbOpts:{kbExpr:Q.editorTextFocus,primary:1089,weight:100}})}}class NLt extends ft{constructor(){super({id:"editor.action.wordHighlight.trigger",label:C("wordHighlight.trigger.label","Trigger Symbol Highlight"),alias:"Trigger Symbol Highlight",precondition:XF.toNegated(),kbOpts:{kbExpr:Q.editorTextFocus,primary:0,weight:100}})}run(e,t,n){const o=Eb.get(t);!o||o.restoreViewState(!0)}}zn(Eb.ID,Eb,0);ze(ILt);ze(TLt);ze(NLt);class YF extends Ir{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode,this._wordNavigationType=e.wordNavigationType}runEditorCommand(e,t,n){if(!t.hasModel())return;const o=Vc(t.getOption(129)),r=t.getModel(),a=t.getSelections().map(l=>{const c=new ae(l.positionLineNumber,l.positionColumn),u=this._move(o,r,c,this._wordNavigationType);return this._moveTo(l,u,this._inSelectionMode)});if(r.pushStackElement(),t._getViewModel().setCursorStates("moveWordCommand",3,a.map(l=>kn.fromModelSelection(l))),a.length===1){const l=new ae(a[0].positionLineNumber,a[0].positionColumn);t.revealPosition(l,0)}}_moveTo(e,t,n){return n?new gt(e.selectionStartLineNumber,e.selectionStartColumn,t.lineNumber,t.column):new gt(t.lineNumber,t.column,t.lineNumber,t.column)}}class o_ extends YF{_move(e,t,n,o){return Qn.moveWordLeft(e,t,n,o)}}class r_ extends YF{_move(e,t,n,o){return Qn.moveWordRight(e,t,n,o)}}class RLt extends o_{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordStartLeft",precondition:void 0})}}class MLt extends o_{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordEndLeft",precondition:void 0})}}class ALt extends o_{constructor(){var e;super({inSelectionMode:!1,wordNavigationType:1,id:"cursorWordLeft",precondition:void 0,kbOpts:{kbExpr:Me.and(Q.textInputFocus,(e=Me.and(KI,B5))===null||e===void 0?void 0:e.negate()),primary:2063,mac:{primary:527},weight:100}})}}class PLt extends o_{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordStartLeftSelect",precondition:void 0})}}class OLt extends o_{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordEndLeftSelect",precondition:void 0})}}class FLt extends o_{constructor(){var e;super({inSelectionMode:!0,wordNavigationType:1,id:"cursorWordLeftSelect",precondition:void 0,kbOpts:{kbExpr:Me.and(Q.textInputFocus,(e=Me.and(KI,B5))===null||e===void 0?void 0:e.negate()),primary:3087,mac:{primary:1551},weight:100}})}}class BLt extends o_{constructor(){super({inSelectionMode:!1,wordNavigationType:3,id:"cursorWordAccessibilityLeft",precondition:void 0})}_move(e,t,n,o){return super._move(Vc(rh.wordSeparators.defaultValue),t,n,o)}}class WLt extends o_{constructor(){super({inSelectionMode:!0,wordNavigationType:3,id:"cursorWordAccessibilityLeftSelect",precondition:void 0})}_move(e,t,n,o){return super._move(Vc(rh.wordSeparators.defaultValue),t,n,o)}}class VLt extends r_{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordStartRight",precondition:void 0})}}class HLt extends r_{constructor(){var e;super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordEndRight",precondition:void 0,kbOpts:{kbExpr:Me.and(Q.textInputFocus,(e=Me.and(KI,B5))===null||e===void 0?void 0:e.negate()),primary:2065,mac:{primary:529},weight:100}})}}class $Lt extends r_{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordRight",precondition:void 0})}}class zLt extends r_{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordStartRightSelect",precondition:void 0})}}class ULt extends r_{constructor(){var e;super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordEndRightSelect",precondition:void 0,kbOpts:{kbExpr:Me.and(Q.textInputFocus,(e=Me.and(KI,B5))===null||e===void 0?void 0:e.negate()),primary:3089,mac:{primary:1553},weight:100}})}}class jLt extends r_{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordRightSelect",precondition:void 0})}}class KLt extends r_{constructor(){super({inSelectionMode:!1,wordNavigationType:3,id:"cursorWordAccessibilityRight",precondition:void 0})}_move(e,t,n,o){return super._move(Vc(rh.wordSeparators.defaultValue),t,n,o)}}class qLt extends r_{constructor(){super({inSelectionMode:!0,wordNavigationType:3,id:"cursorWordAccessibilityRightSelect",precondition:void 0})}_move(e,t,n,o){return super._move(Vc(rh.wordSeparators.defaultValue),t,n,o)}}class ZF extends Ir{constructor(e){super(e),this._whitespaceHeuristics=e.whitespaceHeuristics,this._wordNavigationType=e.wordNavigationType}runEditorCommand(e,t,n){const o=e.get(Ti);if(!t.hasModel())return;const r=Vc(t.getOption(129)),s=t.getModel(),a=t.getSelections(),l=t.getOption(6),c=t.getOption(11),u=o.getLanguageConfiguration(s.getLanguageId()).getAutoClosingPairs(),d=t._getViewModel(),h=a.map(f=>{const g=this._delete({wordSeparators:r,model:s,selection:f,whitespaceHeuristics:this._whitespaceHeuristics,autoClosingDelete:t.getOption(9),autoClosingBrackets:l,autoClosingQuotes:c,autoClosingPairs:u,autoClosedCharacters:d.getCursorAutoClosedCharacters()},this._wordNavigationType);return new Qr(g,"")});t.pushUndoStop(),t.executeCommands(this.id,h),t.pushUndoStop()}}class GY extends ZF{_delete(e,t){const n=Qn.deleteWordLeft(e,t);return n||new V(1,1,1,1)}}class XY extends ZF{_delete(e,t){const n=Qn.deleteWordRight(e,t);if(n)return n;const o=e.model.getLineCount(),r=e.model.getLineMaxColumn(o);return new V(o,r,o,r)}}class GLt extends GY{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:0,id:"deleteWordStartLeft",precondition:Q.writable})}}class XLt extends GY{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:2,id:"deleteWordEndLeft",precondition:Q.writable})}}class YLt extends GY{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:0,id:"deleteWordLeft",precondition:Q.writable,kbOpts:{kbExpr:Q.textInputFocus,primary:2049,mac:{primary:513},weight:100}})}}class ZLt extends XY{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:0,id:"deleteWordStartRight",precondition:Q.writable})}}class QLt extends XY{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:2,id:"deleteWordEndRight",precondition:Q.writable})}}class JLt extends XY{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:2,id:"deleteWordRight",precondition:Q.writable,kbOpts:{kbExpr:Q.textInputFocus,primary:2068,mac:{primary:532},weight:100}})}}class eEt extends ft{constructor(){super({id:"deleteInsideWord",precondition:Q.writable,label:C("deleteInsideWord","Delete Word"),alias:"Delete Word"})}run(e,t,n){if(!t.hasModel())return;const o=Vc(t.getOption(129)),r=t.getModel(),a=t.getSelections().map(l=>{const c=Qn.deleteInsideWord(o,r,l);return new Qr(c,"")});t.pushUndoStop(),t.executeCommands(this.id,a),t.pushUndoStop()}}Ye(new RLt);Ye(new MLt);Ye(new ALt);Ye(new PLt);Ye(new OLt);Ye(new FLt);Ye(new VLt);Ye(new HLt);Ye(new $Lt);Ye(new zLt);Ye(new ULt);Ye(new jLt);Ye(new BLt);Ye(new WLt);Ye(new KLt);Ye(new qLt);Ye(new GLt);Ye(new XLt);Ye(new YLt);Ye(new ZLt);Ye(new QLt);Ye(new JLt);ze(eEt);class tEt extends ZF{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:0,id:"deleteWordPartLeft",precondition:Q.writable,kbOpts:{kbExpr:Q.textInputFocus,primary:0,mac:{primary:769},weight:100}})}_delete(e,t){const n=_5.deleteWordPartLeft(e);return n||new V(1,1,1,1)}}class nEt extends ZF{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:2,id:"deleteWordPartRight",precondition:Q.writable,kbOpts:{kbExpr:Q.textInputFocus,primary:0,mac:{primary:788},weight:100}})}_delete(e,t){const n=_5.deleteWordPartRight(e);if(n)return n;const o=e.model.getLineCount(),r=e.model.getLineMaxColumn(o);return new V(o,r,o,r)}}class GSe extends YF{_move(e,t,n,o){return _5.moveWordPartLeft(e,t,n)}}class iEt extends GSe{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordPartLeft",precondition:void 0,kbOpts:{kbExpr:Q.textInputFocus,primary:0,mac:{primary:783},weight:100}})}}Rn.registerCommandAlias("cursorWordPartStartLeft","cursorWordPartLeft");class oEt extends GSe{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordPartLeftSelect",precondition:void 0,kbOpts:{kbExpr:Q.textInputFocus,primary:0,mac:{primary:1807},weight:100}})}}Rn.registerCommandAlias("cursorWordPartStartLeftSelect","cursorWordPartLeftSelect");class XSe extends YF{_move(e,t,n,o){return _5.moveWordPartRight(e,t,n)}}class rEt extends XSe{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordPartRight",precondition:void 0,kbOpts:{kbExpr:Q.textInputFocus,primary:0,mac:{primary:785},weight:100}})}}class sEt extends XSe{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordPartRightSelect",precondition:void 0,kbOpts:{kbExpr:Q.textInputFocus,primary:0,mac:{primary:1809},weight:100}})}}Ye(new tEt);Ye(new nEt);Ye(new iEt);Ye(new oEt);Ye(new rEt);Ye(new sEt);class KU extends _e{constructor(e){super(),this.editor=e,this._register(this.editor.onDidAttemptReadOnlyEdit(()=>this._onDidAttemptReadOnlyEdit()))}_onDidAttemptReadOnlyEdit(){const e=cl.get(this.editor);if(e&&this.editor.hasModel()){let t=this.editor.getOptions().get(91);t||(this.editor.isSimpleWidget?t=new os(C("editor.simple.readonly","Cannot edit in read-only input")):t=new os(C("editor.readonly","Cannot edit in read-only editor"))),e.showMessage(t,this.editor.getPosition())}}}KU.ID="editor.contrib.readOnlyMessageController";zn(KU.ID,KU,2);class qU extends _e{constructor(e){super(),this.editor=e,this.widget=null,Kd&&(this._register(e.onDidChangeConfiguration(()=>this.update())),this.update())}update(){const e=!this.editor.getOption(90);!this.widget&&e?this.widget=new QF(this.editor):this.widget&&!e&&(this.widget.dispose(),this.widget=null)}dispose(){super.dispose(),this.widget&&(this.widget.dispose(),this.widget=null)}}qU.ID="editor.contrib.iPadShowKeyboard";class QF extends _e{constructor(e){super(),this.editor=e,this._domNode=document.createElement("textarea"),this._domNode.className="iPadShowKeyboard",this._register(ke(this._domNode,"touchstart",t=>{this.editor.focus()})),this._register(ke(this._domNode,"focus",t=>{this.editor.focus()})),this.editor.addOverlayWidget(this)}dispose(){this.editor.removeOverlayWidget(this),super.dispose()}getId(){return QF.ID}getDomNode(){return this._domNode}getPosition(){return{preference:1}}}QF.ID="editor.contrib.ShowKeyboardWidget";zn(qU.ID,qU,3);var aEt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},Jce=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},GU;let Jw=GU=class extends _e{static get(e){return e.getContribution(GU.ID)}constructor(e,t,n){super(),this._editor=e,this._languageService=n,this._widget=null,this._register(this._editor.onDidChangeModel(o=>this.stop())),this._register(this._editor.onDidChangeModelLanguage(o=>this.stop())),this._register(oo.onDidChange(o=>this.stop())),this._register(this._editor.onKeyUp(o=>o.keyCode===9&&this.stop()))}dispose(){this.stop(),super.dispose()}launch(){this._widget||!this._editor.hasModel()||(this._widget=new JF(this._editor,this._languageService))}stop(){this._widget&&(this._widget.dispose(),this._widget=null)}};Jw.ID="editor.contrib.inspectTokens";Jw=GU=aEt([Jce(1,ic),Jce(2,Ki)],Jw);class lEt extends ft{constructor(){super({id:"editor.action.inspectTokens",label:KH.inspectTokensAction,alias:"Developer: Inspect Tokens",precondition:void 0})}run(e,t){const n=Jw.get(t);n==null||n.launch()}}function cEt(i){let e="";for(let t=0,n=i.length;tCw,tokenize:(o,r,s)=>pG(e,s),tokenizeEncoded:(o,r,s)=>d5(n,s)}}class JF extends _e{constructor(e,t){super(),this.allowEditorOverflow=!0,this._editor=e,this._languageService=t,this._model=this._editor.getModel(),this._domNode=document.createElement("div"),this._domNode.className="tokens-inspect-widget",this._tokenizationSupport=uEt(this._languageService.languageIdCodec,this._model.getLanguageId()),this._compute(this._editor.getPosition()),this._register(this._editor.onDidChangeCursorPosition(n=>this._compute(this._editor.getPosition()))),this._editor.addContentWidget(this)}dispose(){this._editor.removeContentWidget(this),super.dispose()}getId(){return JF._ID}_compute(e){const t=this._getTokensAtLine(e.lineNumber);let n=0;for(let l=t.tokens1.length-1;l>=0;l--){const c=t.tokens1[l];if(e.column-1>=c.offset){n=l;break}}let o=0;for(let l=t.tokens2.length>>>1;l>=0;l--)if(e.column-1>=t.tokens2[l<<1]){o=l;break}const r=this._model.getLineContent(e.lineNumber);let s="";if(n=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},eue=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},BL;let PO=BL=class{constructor(e,t){this.quickInputService=e,this.keybindingService=t,this.registry=no.as(qb.Quickaccess)}provide(e){const t=new Be;return t.add(e.onDidAccept(()=>{const[n]=e.selectedItems;n&&this.quickInputService.quickAccess.show(n.prefix,{preserveValue:!0})})),t.add(e.onDidChangeValue(n=>{const o=this.registry.getQuickAccessProvider(n.substr(BL.PREFIX.length));o&&o.prefix&&o.prefix!==BL.PREFIX&&this.quickInputService.quickAccess.show(o.prefix,{preserveValue:!0})})),e.items=this.getQuickAccessProviders().filter(n=>n.prefix!==BL.PREFIX),t}getQuickAccessProviders(){return this.registry.getQuickAccessProviders().sort((t,n)=>t.prefix.localeCompare(n.prefix)).flatMap(t=>this.createPicks(t))}createPicks(e){return e.helpEntries.map(t=>{const n=t.prefix||e.prefix,o=n||"\u2026";return{prefix:n,label:o,keybinding:t.commandId?this.keybindingService.lookupKeybinding(t.commandId):void 0,ariaLabel:C("helpPickAriaLabel","{0}, {1}",o,t.description),description:t.description}})}};PO.PREFIX="?";PO=BL=dEt([eue(0,uh),eue(1,xi)],PO);no.as(qb.Quickaccess).registerQuickAccessProvider({ctor:PO,prefix:"",helpEntries:[{description:qH.helpQuickAccessActionLabel}]});class YSe{constructor(e){this.options=e,this.rangeHighlightDecorationId=void 0}provide(e,t){var n;const o=new Be;e.canAcceptInBackground=!!(!((n=this.options)===null||n===void 0)&&n.canAcceptInBackground),e.matchOnLabel=e.matchOnDescription=e.matchOnDetail=e.sortByLabel=!1;const r=o.add(new Kr);return r.value=this.doProvide(e,t),o.add(this.onDidActiveTextEditorControlChange(()=>{r.value=void 0,r.value=this.doProvide(e,t)})),o}doProvide(e,t){var n;const o=new Be,r=this.activeTextEditorControl;if(r&&this.canProvideWithTextEditor(r)){const s={editor:r},a=eye(r);if(a){let l=(n=r.saveViewState())!==null&&n!==void 0?n:void 0;o.add(a.onDidChangeCursorPosition(()=>{var c;l=(c=r.saveViewState())!==null&&c!==void 0?c:void 0})),s.restoreViewState=()=>{l&&r===this.activeTextEditorControl&&r.restoreViewState(l)},o.add(bv(t.onCancellationRequested)(()=>{var c;return(c=s.restoreViewState)===null||c===void 0?void 0:c.call(s)}))}o.add(zt(()=>this.clearDecorations(r))),o.add(this.provideWithTextEditor(s,e,t))}else o.add(this.provideWithoutTextEditor(e,t));return o}canProvideWithTextEditor(e){return!0}gotoLocation({editor:e},t){e.setSelection(t.range),e.revealRangeInCenter(t.range,0),t.preserveFocus||e.focus();const n=e.getModel();n&&"getLineContent"in n&&Ev(`${n.getLineContent(t.range.startLineNumber)}`)}getModel(e){var t;return JCe(e)?(t=e.getModel())===null||t===void 0?void 0:t.modified:e.getModel()}addDecorations(e,t){e.changeDecorations(n=>{const o=[];this.rangeHighlightDecorationId&&(o.push(this.rangeHighlightDecorationId.overviewRulerDecorationId),o.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:ro(wbe),position:Yl.Full}}}],[s,a]=n.deltaDecorations(o,r);this.rangeHighlightDecorationId={rangeHighlightId:s,overviewRulerDecorationId:a}})}clearDecorations(e){const t=this.rangeHighlightDecorationId;t&&(e.changeDecorations(n=>{n.deltaDecorations([t.overviewRulerDecorationId,t.rangeHighlightId],[])}),this.rangeHighlightDecorationId=void 0)}}class e3 extends YSe{constructor(){super({canAcceptInBackground:!0})}provideWithoutTextEditor(e){const t=C("cannotRunGotoLine","Open a text editor first to go to a line.");return e.items=[{label:t}],e.ariaLabel=t,_e.None}provideWithTextEditor(e,t,n){const o=e.editor,r=new Be;r.add(t.onDidAccept(l=>{const[c]=t.selectedItems;if(c){if(!this.isValidLineNumber(o,c.lineNumber))return;this.gotoLocation(e,{range:this.toRange(c.lineNumber,c.column),keyMods:t.keyMods,preserveFocus:l.inBackground}),l.inBackground||t.hide()}}));const s=()=>{const l=this.parsePosition(o,t.value.trim().substr(e3.PREFIX.length)),c=this.getPickLabel(o,l.lineNumber,l.column);if(t.items=[{lineNumber:l.lineNumber,column:l.column,label:c}],t.ariaLabel=c,!this.isValidLineNumber(o,l.lineNumber)){this.clearDecorations(o);return}const u=this.toRange(l.lineNumber,l.column);o.revealRangeInCenter(u,0),this.addDecorations(o,u)};s(),r.add(t.onDidChangeValue(()=>s()));const a=eye(o);return a&&a.getOptions().get(67).renderType===2&&(a.updateOptions({lineNumbers:"on"}),r.add(zt(()=>a.updateOptions({lineNumbers:"relative"})))),r}toRange(e=1,t=1){return{startLineNumber:e,startColumn:t,endLineNumber:e,endColumn:t}}parsePosition(e,t){const n=t.split(/,|:|#/).map(r=>parseInt(r,10)).filter(r=>!isNaN(r)),o=this.lineCount(e)+1;return{lineNumber:n[0]>0?n[0]:o+n[0],column:n[1]}}getPickLabel(e,t,n){if(this.isValidLineNumber(e,t))return this.isValidColumn(e,t,n)?C("gotoLineColumnLabel","Go to line {0} and character {1}.",t,n):C("gotoLineLabel","Go to line {0}.",t);const o=e.getPosition()||{lineNumber:1,column:1},r=this.lineCount(e);return r>1?C("gotoLineLabelEmptyWithLimit","Current Line: {0}, Character: {1}. Type a line number between 1 and {2} to navigate to.",o.lineNumber,o.column,r):C("gotoLineLabelEmpty","Current Line: {0}, Character: {1}. Type a line number to navigate to.",o.lineNumber,o.column)}isValidLineNumber(e,t){return!t||typeof t!="number"?!1:t>0&&t<=this.lineCount(e)}isValidColumn(e,t,n){if(!n||typeof n!="number")return!1;const o=this.getModel(e);if(!o)return!1;const r={lineNumber:t,column:n};return o.validatePosition(r).equals(r)}lineCount(e){var t,n;return(n=(t=this.getModel(e))===null||t===void 0?void 0:t.getLineCount())!==null&&n!==void 0?n:0}}e3.PREFIX=":";var hEt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},fEt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let iI=class extends e3{constructor(e){super(),this.editorService=e,this.onDidActiveTextEditorControlChange=st.None}get activeTextEditorControl(){var e;return(e=this.editorService.getFocusedCodeEditor())!==null&&e!==void 0?e:void 0}};iI=hEt([fEt(0,Jn)],iI);class LT extends ft{constructor(){super({id:LT.ID,label:IP.gotoLineActionLabel,alias:"Go to Line/Column...",precondition:void 0,kbOpts:{kbExpr:Q.focus,primary:2085,mac:{primary:293},weight:100}})}run(e){e.get(uh).quickAccess.show(iI.PREFIX)}}LT.ID="editor.action.gotoLine";ze(LT);no.as(qb.Quickaccess).registerQuickAccessProvider({ctor:iI,prefix:iI.PREFIX,helpEntries:[{description:IP.gotoLineActionLabel,commandId:LT.ID}]});const ZSe=[void 0,[]];function S7(i,e,t=0,n=0){const o=e;return o.values&&o.values.length>1?gEt(i,o.values,t,n):QSe(i,e,t,n)}function gEt(i,e,t,n){let o=0;const r=[];for(const s of e){const[a,l]=QSe(i,s,t,n);if(typeof a!="number")return ZSe;o+=a,r.push(...l)}return[o,pEt(r)]}function QSe(i,e,t,n){const o=ob(e.original,e.originalLowercase,t,i,i.toLowerCase(),n,{firstMatchCanBeWeak:!0,boostFullMatch:!0});return o?[o[0],iT(o)]:ZSe}Object.freeze({score:0});function pEt(i){const e=i.sort((o,r)=>o.start-r.start),t=[];let n;for(const o of e)!n||!mEt(n,o)?(n=o,t.push(o)):(n.start=Math.min(n.start,o.start),n.end=Math.max(n.end,o.end));return t}function mEt(i,e){return!(i.end=0,s=tue(i);let a;const l=i.split(JSe);if(l.length>1)for(const c of l){const u=tue(c),{pathNormalized:d,normalized:h,normalizedLowercase:f}=nue(c);h&&(a||(a=[]),a.push({original:c,originalLowercase:c.toLowerCase(),pathNormalized:d,normalized:h,normalizedLowercase:f,expectContiguousMatch:u}))}return{original:i,originalLowercase:e,pathNormalized:t,normalized:n,normalizedLowercase:o,values:a,containsPathSeparator:r,expectContiguousMatch:s}}function nue(i){let e;ls?e=i.replace(/\//g,Bd):e=i.replace(/\\/g,Bd);const t=dZe(e).replace(/\s|"/g,"");return{pathNormalized:e,normalized:t,normalizedLowercase:t.toLowerCase()}}function iue(i){return Array.isArray(i)?XU(i.map(e=>e.original).join(JSe)):XU(i.original)}var vEt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},oue=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},rL=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},Hy;let df=Hy=class extends YSe{constructor(e,t,n=Object.create(null)){super(n),this._languageFeaturesService=e,this._outlineModelService=t,this.options=n,this.options.canAcceptInBackground=!0}provideWithoutTextEditor(e){return this.provideLabelPick(e,C("cannotRunGotoSymbolWithoutEditor","To go to a symbol, first open a text editor with symbol information.")),_e.None}provideWithTextEditor(e,t,n){const o=e.editor,r=this.getModel(o);return r?this._languageFeaturesService.documentSymbolProvider.has(r)?this.doProvideWithEditorSymbols(e,r,t,n):this.doProvideWithoutEditorSymbols(e,r,t,n):_e.None}doProvideWithoutEditorSymbols(e,t,n,o){const r=new Be;return this.provideLabelPick(n,C("cannotRunGotoSymbolWithoutSymbolProvider","The active text editor does not provide symbol information.")),rL(this,void 0,void 0,function*(){!(yield this.waitForLanguageSymbolRegistry(t,r))||o.isCancellationRequested||r.add(this.doProvideWithEditorSymbols(e,t,n,o))}),r}provideLabelPick(e,t){e.items=[{label:t,index:0,kind:14}],e.ariaLabel=t}waitForLanguageSymbolRegistry(e,t){return rL(this,void 0,void 0,function*(){if(this._languageFeaturesService.documentSymbolProvider.has(e))return!0;const n=new n5,o=t.add(this._languageFeaturesService.documentSymbolProvider.onDidChange(()=>{this._languageFeaturesService.documentSymbolProvider.has(e)&&(o.dispose(),n.complete(!0))}));return t.add(zt(()=>n.complete(!1))),n.p})}doProvideWithEditorSymbols(e,t,n,o){var r;const s=e.editor,a=new Be;a.add(n.onDidAccept(d=>{const[h]=n.selectedItems;h&&h.range&&(this.gotoLocation(e,{range:h.range.selection,keyMods:n.keyMods,preserveFocus:d.inBackground}),d.inBackground||n.hide())})),a.add(n.onDidTriggerItemButton(({item:d})=>{d&&d.range&&(this.gotoLocation(e,{range:d.range.selection,keyMods:n.keyMods,forceSideBySide:!0}),n.hide())}));const l=this.getDocumentSymbols(t,o);let c;const u=d=>rL(this,void 0,void 0,function*(){c==null||c.dispose(!0),n.busy=!1,c=new Ro(o),n.busy=!0;try{const h=XU(n.value.substr(Hy.PREFIX.length).trim()),f=yield this.doGetSymbolPicks(l,h,void 0,c.token);if(o.isCancellationRequested)return;if(f.length>0){if(n.items=f,d&&h.original.length===0){const g=eP(f,p=>Boolean(p.type!=="separator"&&p.range&&V.containsPosition(p.range.decoration,d)));g&&(n.activeItems=[g])}}else h.original.length>0?this.provideLabelPick(n,C("noMatchingSymbolResults","No matching editor symbols")):this.provideLabelPick(n,C("noSymbolResults","No editor symbols"))}finally{o.isCancellationRequested||(n.busy=!1)}});return a.add(n.onDidChangeValue(()=>u(void 0))),u((r=s.getSelection())===null||r===void 0?void 0:r.getPosition()),a.add(n.onDidChangeActive(()=>{const[d]=n.activeItems;d&&d.range&&(s.revealRangeInCenter(d.range.selection,0),this.addDecorations(s,d.range.decoration))})),a}doGetSymbolPicks(e,t,n,o){var r,s;return rL(this,void 0,void 0,function*(){const a=yield e;if(o.isCancellationRequested)return[];const l=t.original.indexOf(Hy.SCOPE_PREFIX)===0,c=l?1:0;let u,d;t.values&&t.values.length>1?(u=iue(t.values[0]),d=iue(t.values.slice(1))):u=t;let h;const f=(s=(r=this.options)===null||r===void 0?void 0:r.openSideBySideDirection)===null||s===void 0?void 0:s.call(r);f&&(h=[{iconClass:f==="right"?Mt.asClassName(Xe.splitHorizontal):Mt.asClassName(Xe.splitVertical),tooltip:f==="right"?C("openToSide","Open to the Side"):C("openToBottom","Open to the Bottom")}]);const g=[];for(let m=0;mc){let P=!1;if(u!==t&&([E,I]=S7(w,Object.assign(Object.assign({},t),{values:void 0}),c,L),typeof E=="number"&&(P=!0)),typeof E!="number"&&([E,I]=S7(w,u,c,L),typeof E!="number"))continue;if(!P&&d){if(D&&d.original.length>0&&([k,R]=S7(D,d)),typeof k!="number")continue;typeof E=="number"&&(E+=k)}}const A=_.tags&&_.tags.indexOf(1)>=0;g.push({index:m,kind:_.kind,score:E,label:w,ariaLabel:rZe(_.name,_.kind),description:D,highlights:A?void 0:{label:I,description:R},range:{selection:V.collapseToStart(_.selectionRange),decoration:_.range},strikethrough:A,buttons:h})}const p=g.sort((m,_)=>l?this.compareByKindAndScore(m,_):this.compareByScore(m,_));let v=[];if(l){let w=function(){_&&typeof m=="number"&&y>0&&(_.label=X0(L7[m]||x7,y))},m,_,y=0;for(const L of p)m!==L.kind?(w(),m=L.kind,y=1,_={type:"separator"},v.push(_)):y++,v.push(L);w()}else p.length>0&&(v=[{label:C("symbols","symbols ({0})",g.length),type:"separator"},...p]);return v})}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 n=L7[e.kind]||x7,o=L7[t.kind]||x7,r=n.localeCompare(o);return r===0?this.compareByScore(e,t):r}getDocumentSymbols(e,t){return rL(this,void 0,void 0,function*(){const n=yield this._outlineModelService.getOrCreate(e,t);return t.isCancellationRequested?[]:n.asListOfDocumentSymbols()})}};df.PREFIX="@";df.SCOPE_PREFIX=":";df.PREFIX_BY_CATEGORY=`${Hy.PREFIX}${Hy.SCOPE_PREFIX}`;df=Hy=vEt([oue(0,pt),oue(1,EF)],df);const x7=C("property","properties ({0})"),L7={[5]:C("method","methods ({0})"),[11]:C("function","functions ({0})"),[8]:C("_constructor","constructors ({0})"),[12]:C("variable","variables ({0})"),[4]:C("class","classes ({0})"),[22]:C("struct","structs ({0})"),[23]:C("event","events ({0})"),[24]:C("operator","operators ({0})"),[10]:C("interface","interfaces ({0})"),[2]:C("namespace","namespaces ({0})"),[3]:C("package","packages ({0})"),[25]:C("typeParameter","type parameters ({0})"),[1]:C("modules","modules ({0})"),[6]:C("property","properties ({0})"),[9]:C("enum","enumerations ({0})"),[21]:C("enumMember","enumeration members ({0})"),[14]:C("string","strings ({0})"),[0]:C("file","files ({0})"),[17]:C("array","arrays ({0})"),[15]:C("number","numbers ({0})"),[16]:C("boolean","booleans ({0})"),[18]:C("object","objects ({0})"),[19]:C("key","keys ({0})"),[7]:C("field","fields ({0})"),[13]:C("constant","constants ({0})")};var _Et=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},E7=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let YU=class extends df{constructor(e,t,n){super(t,n),this.editorService=e,this.onDidActiveTextEditorControlChange=st.None}get activeTextEditorControl(){var e;return(e=this.editorService.getFocusedCodeEditor())!==null&&e!==void 0?e:void 0}};YU=_Et([E7(0,Jn),E7(1,pt),E7(2,EF)],YU);class ET extends ft{constructor(){super({id:ET.ID,label:hk.quickOutlineActionLabel,alias:"Go to Symbol...",precondition:Q.hasDocumentSymbolProvider,kbOpts:{kbExpr:Q.focus,primary:3117,weight:100},contextMenuOpts:{group:"navigation",order:3}})}run(e){e.get(uh).quickAccess.show(df.PREFIX,{itemActivation:vd.NONE})}}ET.ID="editor.action.quickOutline";ze(ET);no.as(qb.Quickaccess).registerQuickAccessProvider({ctor:YU,prefix:df.PREFIX,helpEntries:[{description:hk.quickOutlineActionLabel,prefix:df.PREFIX,commandId:ET.ID},{description:hk.quickOutlineByCategoryActionLabel,prefix:df.PREFIX_BY_CATEGORY}]});function D7(i,e){return e&&(i.stack||i.stacktrace)?C("stackTrace.format","{0}: {1}",sue(i),rue(i.stack)||rue(i.stacktrace)):sue(i)}function rue(i){return Array.isArray(i)?i.join(` +`):i}function sue(i){return i.code==="ERR_UNC_HOST_NOT_ALLOWED"?`${i.message}. Please update the 'security.allowedUNCHosts' setting if you want to allow this host.`:typeof i.code=="string"&&typeof i.errno=="number"&&typeof i.syscall=="string"?C("nodeExceptionMessage","A system error occurred ({0})",i.message):i.message||C("error.defaultMessage","An unknown error occurred. Please consult the log for more details.")}function exe(i=null,e=!1){if(!i)return C("error.defaultMessage","An unknown error occurred. Please consult the log for more details.");if(Array.isArray(i)){const t=hf(i),n=exe(t[0],e);return t.length>1?C("error.moreErrors","{0} ({1} errors in total)",n,t.length):n}if(la(i))return i;if(i.detail){const t=i.detail;if(t.error)return D7(t.error,e);if(t.exception)return D7(t.exception,e)}return i.stack?D7(i,e):i.message?i.message:C("error.defaultMessage","An unknown error occurred. Please consult the log for more details.")}function bEt(i){var e;const t=new Map;for(const n of i)t.set(n,((e=t.get(n))!==null&&e!==void 0?e:0)+1);return t}class WE{constructor(){this.chunkCount=0,this.chunkOccurrences=new Map,this.documents=new Map}calculateScores(e,t){const n=this.computeEmbedding(e),o=new Map,r=[];for(const[s,a]of this.documents){if(t.isCancellationRequested)return[];for(const l of a.chunks){const c=this.computeSimilarityScore(l,n,o);c>0&&r.push({key:s,score:c})}}return r}static termFrequencies(e){return bEt(WE.splitTerms(e))}static*splitTerms(e){const t=n=>n.toLowerCase();for(const[n]of e.matchAll(/\b\p{Letter}[\p{Letter}\d]{2,}\b/gu)){yield t(n);const o=n.split(new RegExp("(?<=[a-z])(?=[A-Z])","g"));if(o.length>1)for(const r of o)r.length>2&&/\p{Letter}{3,}/gu.test(r)&&(yield t(r))}}updateDocuments(e){var t;for(const{key:n}of e)this.deleteDocument(n);for(const n of e){const o=[];for(const r of n.textChunks){const s=WE.termFrequencies(r);for(const a of s.keys())this.chunkOccurrences.set(a,((t=this.chunkOccurrences.get(a))!==null&&t!==void 0?t:0)+1);o.push({text:r,tf:s})}this.chunkCount+=o.length,this.documents.set(n.key,{chunks:o})}return this}deleteDocument(e){const t=this.documents.get(e);if(!!t){this.documents.delete(e),this.chunkCount-=t.chunks.length;for(const n of t.chunks)for(const o of n.tf.keys()){const r=this.chunkOccurrences.get(o);if(typeof r=="number"){const s=r-1;s<=0?this.chunkOccurrences.delete(o):this.chunkOccurrences.set(o,s)}}}}computeSimilarityScore(e,t,n){let o=0;for(const[r,s]of Object.entries(t)){const a=e.tf.get(r);if(!a)continue;let l=n.get(r);typeof l!="number"&&(l=this.computeIdf(r),n.set(r,l)),o+=a*l*s}return o}computeEmbedding(e){const t=WE.termFrequencies(e);return this.computeTfidf(t)}computeIdf(e){var t;const n=(t=this.chunkOccurrences.get(e))!==null&&t!==void 0?t:0;return n>0?Math.log((this.chunkCount+1)/n):0}computeTfidf(e){const t=Object.create(null);for(const[n,o]of e){const r=this.computeIdf(n);r>0&&(t[n]=o*r)}return t}}function CEt(i){var e,t;const n=i.slice(0);n.sort((r,s)=>s.score-r.score);const o=(t=(e=n[0])===null||e===void 0?void 0:e.score)!==null&&t!==void 0?t:0;if(o>0)for(const r of n)r.score/=o;return n}var sL=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},QC;(function(i){i[i.NO_ACTION=0]="NO_ACTION",i[i.CLOSE_PICKER=1]="CLOSE_PICKER",i[i.REFRESH_PICKER=2]="REFRESH_PICKER",i[i.REMOVE_ITEM=3]="REMOVE_ITEM"})(QC||(QC={}));function k7(i){const e=i;return Array.isArray(e.items)}function aue(i){const e=i;return!!e.picks&&e.additionalPicks instanceof Promise}class yEt extends _e{constructor(e,t){super(),this.prefix=e,this.options=t}provide(e,t,n){var o;const r=new Be;e.canAcceptInBackground=!!(!((o=this.options)===null||o===void 0)&&o.canAcceptInBackground),e.matchOnLabel=e.matchOnDescription=e.matchOnDetail=e.sortByLabel=!1;let s;const a=r.add(new Kr),l=()=>sL(this,void 0,void 0,function*(){const c=a.value=new Be;s==null||s.dispose(!0),e.busy=!1,s=new Ro(t);const u=s.token,d=e.value.substr(this.prefix.length).trim(),h=this._getPicks(d,c,u,n),f=(p,v)=>{var m;let _,y;if(k7(p)?(_=p.items,y=p.active):_=p,_.length===0){if(v)return!1;(d.length>0||e.hideInput)&&((m=this.options)===null||m===void 0?void 0:m.noResultsPick)&&(DD(this.options.noResultsPick)?_=[this.options.noResultsPick(d)]:_=[this.options.noResultsPick])}return e.items=_,y&&(e.activeItems=[y]),!0},g=p=>sL(this,void 0,void 0,function*(){let v=!1,m=!1;yield Promise.all([(()=>sL(this,void 0,void 0,function*(){typeof p.mergeDelay=="number"&&(yield wv(p.mergeDelay),u.isCancellationRequested)||m||(v=f(p.picks,!0))}))(),(()=>sL(this,void 0,void 0,function*(){e.busy=!0;try{const _=yield p.additionalPicks;if(u.isCancellationRequested)return;let y,w;k7(p.picks)?(y=p.picks.items,w=p.picks.active):y=p.picks;let L,D;if(k7(_)?(L=_.items,D=_.active):L=_,L.length>0||!v){let E;if(!w&&!D){const I=e.activeItems[0];I&&y.indexOf(I)!==-1&&(E=I)}f({items:[...y,...L],active:w||D||E})}}finally{u.isCancellationRequested||(e.busy=!1),m=!0}}))()])});if(h!==null)if(aue(h))yield g(h);else if(!(h instanceof Promise))f(h);else{e.busy=!0;try{const p=yield h;if(u.isCancellationRequested)return;aue(p)?yield g(p):f(p)}finally{u.isCancellationRequested||(e.busy=!1)}}});return r.add(e.onDidChangeValue(()=>l())),l(),r.add(e.onDidAccept(c=>{const[u]=e.selectedItems;typeof(u==null?void 0:u.accept)=="function"&&(c.inBackground||e.hide(),u.accept(e.keyMods,c))})),r.add(e.onDidTriggerItemButton(({button:c,item:u})=>sL(this,void 0,void 0,function*(){var d,h;if(typeof u.trigger=="function"){const f=(h=(d=u.buttons)===null||d===void 0?void 0:d.indexOf(c))!==null&&h!==void 0?h:-1;if(f>=0){const g=u.trigger(f,e.keyMods),p=typeof g=="number"?g:yield g;if(t.isCancellationRequested)return;switch(p){case QC.NO_ACTION:break;case QC.CLOSE_PICKER:e.hide();break;case QC.REFRESH_PICKER:l();break;case QC.REMOVE_ITEM:{const v=e.items.indexOf(u);if(v!==-1){const m=e.items.slice(),_=m.splice(v,1),y=e.activeItems.filter(L=>L!==_[0]),w=e.keepScrollPosition;e.keepScrollPosition=!0,e.items=m,y&&(e.activeItems=y),e.keepScrollPosition=w}break}}}}}))),r}}var txe=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},G_=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},I7=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})},F_,hr;let Db=F_=class extends yEt{constructor(e,t,n,o,r,s){super(F_.PREFIX,e),this.instantiationService=t,this.keybindingService=n,this.commandService=o,this.telemetryService=r,this.dialogService=s,this.commandsHistory=this._register(this.instantiationService.createInstance(kb)),this.options=e}_getPicks(e,t,n,o){var r,s,a,l;return I7(this,void 0,void 0,function*(){const c=yield this.getCommandPicks(n);if(n.isCancellationRequested)return[];const u=bv(()=>{const m=new WE;m.updateDocuments(c.map(y=>({key:y.commandId,textChunks:[y.label+(y.commandAlias?` ${y.commandAlias}`:"")]})));const _=m.calculateScores(e,n);return CEt(_).filter(y=>y.score>F_.TFIDF_THRESHOLD).slice(0,F_.TFIDF_MAX_RESULTS)}),d=[];for(const m of c){const _=(r=F_.WORD_FILTER(e,m.label))!==null&&r!==void 0?r:void 0,y=m.commandAlias&&(s=F_.WORD_FILTER(e,m.commandAlias))!==null&&s!==void 0?s:void 0;if(_||y)m.highlights={label:_,detail:this.options.showAlias?y:void 0},d.push(m);else if(e===m.commandId)d.push(m);else if(e.length>=3){const w=u();if(n.isCancellationRequested)return[];const L=w.find(D=>D.key===m.commandId);L&&(m.tfIdfScore=L.score,d.push(m))}}const h=new Map;for(const m of d){const _=h.get(m.label);_?(m.description=m.commandId,_.description=_.commandId):h.set(m.label,m)}d.sort((m,_)=>{if(m.tfIdfScore&&_.tfIdfScore)return m.tfIdfScore===_.tfIdfScore?m.label.localeCompare(_.label):_.tfIdfScore-m.tfIdfScore;if(m.tfIdfScore)return 1;if(_.tfIdfScore)return-1;const y=this.commandsHistory.peek(m.commandId),w=this.commandsHistory.peek(_.commandId);if(y&&w)return y>w?-1:1;if(y)return-1;if(w)return 1;if(this.options.suggestedCommandIds){const L=this.options.suggestedCommandIds.has(m.commandId),D=this.options.suggestedCommandIds.has(_.commandId);if(L&&D)return 0;if(L)return-1;if(D)return 1}return m.label.localeCompare(_.label)});const f=[];let g=!1,p=!0,v=!!this.options.suggestedCommandIds;for(let m=0;mI7(this,void 0,void 0,function*(){var m;const _=yield this.getAdditionalCommandPicks(c,d,e,n);if(n.isCancellationRequested)return[];const y=_.map(w=>this.toCommandPick(w,o));return p&&((m=y[0])===null||m===void 0?void 0:m.type)!=="separator"&&y.unshift({type:"separator",label:C("suggested","similar commands")}),y}))()}:f})}toCommandPick(e,t){if(e.type==="separator")return e;const n=this.keybindingService.lookupKeybinding(e.commandId),o=n?C("commandPickAriaLabelWithKeybinding","{0}, {1}",e.label,n.getAriaLabel()):e.label;return Object.assign(Object.assign({},e),{ariaLabel:o,detail:this.options.showAlias&&e.commandAlias!==e.label?e.commandAlias:void 0,keybinding:n,accept:()=>I7(this,void 0,void 0,function*(){var r,s;this.commandsHistory.push(e.commandId),this.telemetryService.publicLog2("workbenchActionExecuted",{id:e.commandId,from:(r=t==null?void 0:t.from)!==null&&r!==void 0?r:"quick open"});try{!((s=e.args)===null||s===void 0)&&s.length?yield this.commandService.executeCommand(e.commandId,...e.args):yield this.commandService.executeCommand(e.commandId)}catch(a){sh(a)||this.dialogService.error(C("canNotRun","Command '{0}' resulted in an error",e.label),exe(a))}})})}};Db.PREFIX=">";Db.TFIDF_THRESHOLD=.5;Db.TFIDF_MAX_RESULTS=5;Db.WORD_FILTER=aX(mk,_ut,k1e);Db=F_=txe([G_(1,$t),G_(2,xi),G_(3,_o),G_(4,tc),G_(5,tT)],Db);let kb=hr=class extends _e{constructor(e,t){super(),this.storageService=e,this.configurationService=t,this.configuredCommandsHistoryLength=0,this.updateConfiguration(),this.load(),this.registerListeners()}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration(e=>this.updateConfiguration(e)))}updateConfiguration(e){e&&!e.affectsConfiguration("workbench.commandPalette.history")||(this.configuredCommandsHistoryLength=hr.getConfiguredCommandHistoryLength(this.configurationService),hr.cache&&hr.cache.limit!==this.configuredCommandsHistoryLength&&(hr.cache.limit=this.configuredCommandsHistoryLength,hr.saveState(this.storageService)))}load(){const e=this.storageService.get(hr.PREF_KEY_CACHE,0);let t;if(e)try{t=JSON.parse(e)}catch{}const n=hr.cache=new Yv(this.configuredCommandsHistoryLength,1);if(t){let o;t.usesLRU?o=t.entries:o=t.entries.sort((r,s)=>r.value-s.value),o.forEach(r=>n.set(r.key,r.value))}hr.counter=this.storageService.getNumber(hr.PREF_KEY_COUNTER,0,hr.counter)}push(e){!hr.cache||(hr.cache.set(e,hr.counter++),hr.saveState(this.storageService))}peek(e){var t;return(t=hr.cache)===null||t===void 0?void 0:t.peek(e)}static saveState(e){if(!hr.cache)return;const t={usesLRU:!0,entries:[]};hr.cache.forEach((n,o)=>t.entries.push({key:o,value:n})),e.store(hr.PREF_KEY_CACHE,JSON.stringify(t),0,0),e.store(hr.PREF_KEY_COUNTER,hr.counter,0,0)}static getConfiguredCommandHistoryLength(e){var t,n;const r=(n=(t=e.getValue().workbench)===null||t===void 0?void 0:t.commandPalette)===null||n===void 0?void 0:n.history;return typeof r=="number"?r:hr.DEFAULT_COMMANDS_HISTORY_LENGTH}};kb.DEFAULT_COMMANDS_HISTORY_LENGTH=50;kb.PREF_KEY_CACHE="commandPalette.mru.cache";kb.PREF_KEY_COUNTER="commandPalette.mru.counter";kb.counter=1;kb=hr=txe([G_(0,Gu),G_(1,En)],kb);class wEt extends Db{constructor(e,t,n,o,r,s){super(e,t,n,o,r,s)}getCodeEditorCommandPicks(){const e=this.activeTextEditorControl;if(!e)return[];const t=[];for(const n of e.getSupportedActions())t.push({commandId:n.id,commandAlias:n.alias,label:fX(n.label)||n.id});return t}}var SEt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},iC=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},lue=globalThis&&globalThis.__awaiter||function(i,e,t,n){function o(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?r(u.value):o(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})};let oI=class extends wEt{get activeTextEditorControl(){var e;return(e=this.codeEditorService.getFocusedCodeEditor())!==null&&e!==void 0?e:void 0}constructor(e,t,n,o,r,s){super({showAlias:!1},e,n,o,r,s),this.codeEditorService=t}getCommandPicks(){return lue(this,void 0,void 0,function*(){return this.getCodeEditorCommandPicks()})}hasAdditionalCommandPicks(){return!1}getAdditionalCommandPicks(){return lue(this,void 0,void 0,function*(){return[]})}};oI=SEt([iC(0,$t),iC(1,Jn),iC(2,xi),iC(3,_o),iC(4,tc),iC(5,tT)],oI);class DT extends ft{constructor(){super({id:DT.ID,label:TP.quickCommandActionLabel,alias:"Command Palette",precondition:void 0,kbOpts:{kbExpr:Q.focus,primary:59,weight:100},contextMenuOpts:{group:"z_commands",order:1}})}run(e){e.get(uh).quickAccess.show(oI.PREFIX)}}DT.ID="editor.action.quickCommand";ze(DT);no.as(qb.Quickaccess).registerQuickAccessProvider({ctor:oI,prefix:oI.PREFIX,helpEntries:[{description:TP.quickCommandHelp,commandId:DT.ID}]});var xEt=globalThis&&globalThis.__decorate||function(i,e,t,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r},oC=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let ZU=class extends Fv{constructor(e,t,n,o,r,s,a){super(!0,e,t,n,o,r,s,a)}};ZU=xEt([oC(1,Ut),oC(2,Jn),oC(3,Ao),oC(4,$t),oC(5,Gu),oC(6,En)],ZU);zn(Fv.ID,ZU,4);class LEt extends ft{constructor(){super({id:"editor.action.toggleHighContrast",label:GH.toggleHighContrast,alias:"Toggle High Contrast Theme",precondition:void 0}),this._originalThemeName=null}run(e,t){const n=e.get(ic),o=n.getColorTheme();Hd(o.type)?(n.setTheme(this._originalThemeName||(xw(o.type)?Oy:kg)),this._originalThemeName=null):(n.setTheme(xw(o.type)?R0:M0),this._originalThemeName=o.themeName)}}ze(LEt);function EEt(){return new Worker("/eos/assets/editor.worker.efc65e0b.js",{type:"module"})}function DEt(){return new Worker("/eos/assets/json.worker.b6a074fe.js",{type:"module"})}function kEt(){return new Worker("/eos/assets/css.worker.903adc4e.js",{type:"module"})}function IEt(){return new Worker("/eos/assets/html.worker.dd9c9e9a.js",{type:"module"})}function TEt(){return new Worker("/eos/assets/ts.worker.d675a6ca.js",{type:"module"})}self.MonacoEnvironment={getWorker(i,e){return e==="json"?new DEt:e==="css"||e==="scss"||e==="less"?new kEt:e==="html"||e==="handlebars"||e==="razor"?new IEt:e==="typescript"||e==="javascript"?new TEt:new EEt}};rye.typescript.typescriptDefaults.setEagerModelSync(!0);function NEt(i,e){const{code:t,className:n,readonly:o,language:r}=i,[s,a]=x.exports.useState(null),l=x.exports.useRef(null);return x.exports.useEffect(()=>(l&&a(c=>c||oye.create(l.current,{value:t,language:r,readOnly:o})),()=>s==null?void 0:s.dispose()),[l.current]),tFe(()=>{async function c(){var u;s&&(s.setValue(t),o&&s.updateOptions({readOnly:!1}),await((u=s.getAction("editor.action.formatDocument"))==null?void 0:u.run()),o&&s.updateOptions({readOnly:!0}))}c()},[t]),x.exports.useImperativeHandle(e,()=>({editor:s}),[s]),he("div",{className:Ue(Dvt.editor,n),ref:l})}const nxe=x.exports.forwardRef(NEt);function REt(i){const{node:e}=i,[t,n]=x.exports.useState(!1),o=t3(),[r,s]=x.exports.useState(""),a=x.exports.useRef(null),l=fr(e);return fn("div",{className:Jie.container,children:[he("span",{style:{color:"white",cursor:"pointer",display:"block",textAlign:"center"},onClick:()=>{var c;s(((c=e.data)==null?void 0:c.customCode)||(l==null?void 0:l.getInitCustomCode())||""),n(!0)},children:"\u70B9\u51FB\u7F16\u8F91"}),he(Sq,{title:"Basic Modal",open:t,onOk:()=>{n(!1),o.updateNode(e.id,c=>{var u,d;return(l==null?void 0:l.updateData(c,{customCode:((d=(u=a.current)==null?void 0:u.editor)==null?void 0:d.getValue())||""}))||c})},onCancel:()=>{n(!1)},destroyOnClose:!0,children:he(nxe,{ref:a,code:r,language:"javascript",className:Jie.editor})})]})}class ixe extends pp{constructor(){super({operatorName:"Transform",operatorType:"TransformOperator",nodeType:oh.Node});Ct(this,"nodeColor","#F3F8FF")}create(){return super.create({endPointOptions:{endPointList:[new ri({type:"source",hint:"output",label:"output"}),new ri({type:"target",hint:"input",label:"input"})]}})}generateBlockDeclarations(t){var l,c,u,d,h,f,g,p;const{node:n,nodeGraph:o}=t,r=((u=(c=(l=n.data.endPointOptions)==null?void 0:l.endPointList)==null?void 0:c.find(v=>v.hint==="output"))==null?void 0:u.id)||"",s=((f=(h=(d=n.data.endPointOptions)==null?void 0:d.endPointList)==null?void 0:h.find(v=>v.hint==="input"))==null?void 0:f.id)||"",a=((p=(g=o.findSourceNodes(n.id))==null?void 0:g.find(v=>v.handleId===s))==null?void 0:p.relatedHandleId)||"";return[`${r?`const ${Cu(r)} = `:""}${fS}.transform( + ${Cu(a)}, (...args) => { const module = { exports: {} }; ((module) => { @@ -1109,14 +1110,17 @@ The flag will not be saved for the future. } )`]}generateBlockOutput(t){return[]}generateBlockRelation(t){return[]}getInitCustomCode(){return`module.exports = function transform(input) { return input; -}`}renderCustomLabel(t){return fe(EEt,{node:t})}}class DEt extends XSe{constructor(){super();Tt(this,"nodeColor","#F3F8FF");this.defaultOperatorData.operatorName="Effect",this.defaultOperatorData.operatorType="EffectOperator"}create(){const t=super.create();return this.updateData(t,{endPointOptions:{endPointList:[new ri({type:"target",hint:"input",label:"input"})]}})}getInitCustomCode(){return`module.exports = function effect(input) { +}`}renderCustomLabel(t){return he(REt,{node:t})}}class MEt extends ixe{constructor(){super();Ct(this,"nodeColor","#F3F8FF");this.defaultOperatorData.operatorName="Effect",this.defaultOperatorData.operatorType="EffectOperator"}create(){const t=super.create();return this.updateData(t,{endPointOptions:{endPointList:[new ri({type:"target",hint:"input",label:"input"})]}})}getInitCustomCode(){return`module.exports = function effect(input) { -}`}}class kEt extends Kv{constructor(){super({operatorName:"Merge",operatorType:"MergeOperator",nodeType:kf.Node});Tt(this,"nodeColor","#C21292")}create(){return super.create({endPointOptions:{endPointList:[new ri({type:"group",hint:"output",children:[new ri({label:"output",hint:"output",variableType:"array",type:"source"})]}),new ri({type:"group",hint:"input",label:"Stream",defaultChildData:{hint:"input",type:"target",ignoreDegree:!0},allowAddAndRemoveChildren:!0,children:[new ri({hint:"input",type:"target",ignoreDegree:!0})]})]}})}getHintPorts(t,n){var o,r,s;return(s=(r=(o=t.data.endPointOptions)==null?void 0:o.endPointList)==null?void 0:r.find(a=>a.hint===n))==null?void 0:s.children}getIgnoreDegreeIds(t){var o;return((o=this.getHintPorts(t,"input"))==null?void 0:o.map(r=>r.id))||[]}generateBlockDeclarations(t){var a,l,c;const{node:n,formatVariableName:o}=t,r=((l=(a=this.getHintPorts(n,"output"))==null?void 0:a.find(u=>u.hint==="output"))==null?void 0:l.id)||"",s=((c=this.getHintPorts(n,"input"))==null?void 0:c.map(u=>u.id))||[];return[...s.map(u=>`const ${o(u)} = new ${zm}.ModelState(undefined)`),`const ${o(r)} = ${hS}.merge( +}`}}class AEt extends pp{constructor(){super({operatorName:"Merge",operatorType:"MergeOperator",nodeType:oh.Node});Ct(this,"nodeColor","#C21292")}create(){return super.create({endPointOptions:{endPointList:[new ri({type:"group",hint:"output",children:[new ri({label:"output",hint:"output",variableType:"array",type:"source"})]}),new ri({type:"group",hint:"input",label:"Stream",defaultChildData:{hint:"input",type:"target",ignoreDegree:!0},allowAddAndRemoveChildren:!0,children:[new ri({hint:"input",type:"target",ignoreDegree:!0})]})]}})}getHintPorts(t,n){var o,r,s;return(s=(r=(o=t.data.endPointOptions)==null?void 0:o.endPointList)==null?void 0:r.find(a=>a.hint===n))==null?void 0:s.children}getIgnoreDegreeIds(t){var o;return((o=this.getHintPorts(t,"input"))==null?void 0:o.map(r=>r.id))||[]}generateBlockDeclarations(t){var a,l,c;const{node:n,formatVariableName:o}=t,r=((l=(a=this.getHintPorts(n,"output"))==null?void 0:a.find(u=>u.hint==="output"))==null?void 0:l.id)||"",s=((c=this.getHintPorts(n,"input"))==null?void 0:c.map(u=>u.id))||[];return[...s.map(u=>`const ${o(u)} = new ${Um}.ModelState(undefined)`),`const ${o(r)} = ${fS}.merge( [${s.map(u=>o(u)).join(",")}], )`]}generateBlockOutput(t){return[]}generateBlockRelation(t){var u;const{node:n,formatVariableName:o,nodeGraph:r}=t,s=((u=this.getHintPorts(n,"input"))==null?void 0:u.map(d=>d.id))||[],a=r.findSourceNodes(n.id)||[],l=new Map(a.map(d=>[d.handleId,d]));return[...s.map(d=>{var h;return{inputId:d,targetId:((h=l.get(d))==null?void 0:h.relatedHandleId)||""}}).filter(d=>d.inputId&&d.targetId).map(({inputId:d,targetId:h})=>`${o(h)}.subscribe((val, extraInfo) => { ${o(d)}.update(val, extraInfo.concat('${JSON.stringify({currentNodeId:n.id,fromPortId:h,toPortId:d})}')); - });`)]}}GGe([new UGe,new jGe,new ZGe,new Xve,new zGe,new KGe,new QGe,new XSe,new DEt,new kEt]);const tue=new o4("App"),zY=yRe({nodes:[],setNodes:()=>{},updateNode:()=>{},edges:[],setEdges:()=>{},updateEdge:()=>{},layer:tue,setLayer:()=>{},activeLayerId:tue.id,setActiveLayerId:()=>{}});function ET(){return SRe(zY)}function mu(i){return vhe(zY,i)}function e3(){const{nodes:i,edges:e,updateEdge:t,updateNode:n,setActiveLayerId:o,setLayer:r,setEdges:s,layer:a,activeLayerId:l}=ET(),c=uA({nodes:i,edges:e,layer:a,activeLayerId:l}),u=uA({updateEdge:t,updateNode:n,setEdges:s,setActiveLayerId:o,setLayer:r});return{currentStateRef:c,actionsRef:u}}function IEt(){const i=mu(n=>n.nodes),e=mu(n=>n.edges),t=mu(n=>n.layer);return{nodes:i,edges:e,layer:t}}function t3(){const i=mu(s=>s.setEdges),e=mu(s=>s.setNodes),t=mu(s=>s.updateEdge),n=mu(s=>s.updateNode),o=mu(s=>s.setLayer),r=mu(s=>s.setActiveLayerId);return{setEdges:i,setNodes:e,updateEdge:t,updateNode:n,setLayer:o,setActiveLayerId:r}}const TEt=i=>{const{children:e}=i,[t,n]=x.exports.useState(()=>new o4("App")),o=x.exports.useRef(t),r=o.current,[s,a]=x.exports.useState(r.id),l=wc(r,s),c=(l==null?void 0:l.nodes)||[],u=(l==null?void 0:l.edges)||[],d=x1(function(L){o.current=typeof L=="function"?L(o.current):L,n(o.current)}),h=x1(function(L,D){d(E=>{const I=wc(E,(D==null?void 0:D.layerId)||s);if(I){I.nodes=typeof L=="function"?L(I.nodes):L;const k=new Set(I.nodes.map(R=>R.id));I.children=I.children.filter(R=>R.relativeNodeId&&k.has(R.relativeNodeId))}return{...E}})}),f=x1(function(L,D){d(E=>{const I=wc(E,(D==null?void 0:D.layerId)||s);return I&&(I.edges=typeof L=="function"?L(I.edges):L),{...E}})}),g=f5e(),p=x1(function(L,D,E){!L||f(I=>{var N;const k=I.findIndex(M=>M.id===L);if(k<0)return I;const R=[...I],A=(N=R.splice(k,1))==null?void 0:N[0],P=typeof D=="function"?D(A):D;return R.concat(P)},E)}),v=x1(function(L,D,E){if(!L)return;const{updateInternal:I,layerId:k}=E||{};h(R=>{var H;const A=R.findIndex(W=>W.id===L);if(A<0)return R;const P=[...R],N=(H=P.splice(A,1))==null?void 0:H[0],M=typeof D=="function"?D(N):D;return P.concat(M)},{layerId:k}),I&&setTimeout(()=>{g(L)},0)}),m=uA({nodes:c,edges:u,layer:r,activeLayerId:s}),_=uA({updateEdge:p,updateNode:v,setEdges:f,setActiveLayerId:()=>{},setLayer:d}),w=x1(y=>{const L=s;a(y),setTimeout(()=>{const D=wc(r,L);if(D!=null&&D.parentLayerId){const E=wc(r,D.parentLayerId),I=E==null?void 0:E.nodes.find(k=>k.id===D.relativeNodeId);if(I){const k=xr(I);k==null||k.refreshNode({node:I,actions:_.current,currentState:m.current})}}})});return fe(zY.Provider,{value:{nodes:c,edges:u,updateEdge:p,updateNode:v,setEdges:f,setNodes:h,layer:r,activeLayerId:s,setLayer:d,setActiveLayerId:w},children:e})},NEt=i=>{const{children:e}=i;return fe(gK,{children:fe(TEt,{children:e})})};var REt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656zM340 683v77c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8v-77c-10.1 3.3-20.8 5-32 5s-21.9-1.8-32-5zm64-198V264c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v221c10.1-3.3 20.8-5 32-5s21.9 1.8 32 5zm-64 198c10.1 3.3 20.8 5 32 5s21.9-1.8 32-5c41.8-13.5 72-52.7 72-99s-30.2-85.5-72-99c-10.1-3.3-20.8-5-32-5s-21.9 1.8-32 5c-41.8 13.5-72 52.7-72 99s30.2 85.5 72 99zm.1-115.7c.3-.6.7-1.2 1-1.8v-.1l1.2-1.8c.1-.2.2-.3.3-.5.3-.5.7-.9 1-1.4.1-.1.2-.3.3-.4.5-.6.9-1.1 1.4-1.6l.3-.3 1.2-1.2.4-.4c.5-.5 1-.9 1.6-1.4.6-.5 1.1-.9 1.7-1.3.2-.1.3-.2.5-.3.5-.3.9-.7 1.4-1 .1-.1.3-.2.4-.3.6-.4 1.2-.7 1.9-1.1.1-.1.3-.1.4-.2.5-.3 1-.5 1.6-.8l.6-.3c.7-.3 1.3-.6 2-.8.7-.3 1.4-.5 2.1-.7.2-.1.4-.1.6-.2.6-.2 1.1-.3 1.7-.4.2 0 .3-.1.5-.1.7-.2 1.5-.3 2.2-.4.2 0 .3 0 .5-.1.6-.1 1.2-.1 1.8-.2h.6c.8 0 1.5-.1 2.3-.1s1.5 0 2.3.1h.6c.6 0 1.2.1 1.8.2.2 0 .3 0 .5.1.7.1 1.5.2 2.2.4.2 0 .3.1.5.1.6.1 1.2.3 1.7.4.2.1.4.1.6.2.7.2 1.4.4 2.1.7.7.2 1.3.5 2 .8l.6.3c.5.2 1.1.5 1.6.8.1.1.3.1.4.2.6.3 1.3.7 1.9 1.1.1.1.3.2.4.3.5.3 1 .6 1.4 1 .2.1.3.2.5.3.6.4 1.2.9 1.7 1.3s1.1.9 1.6 1.4l.4.4 1.2 1.2.3.3c.5.5 1 1.1 1.4 1.6.1.1.2.3.3.4.4.4.7.9 1 1.4.1.2.2.3.3.5l1.2 1.8s0 .1.1.1a36.18 36.18 0 015.1 18.5c0 6-1.5 11.7-4.1 16.7-.3.6-.7 1.2-1 1.8 0 0 0 .1-.1.1l-1.2 1.8c-.1.2-.2.3-.3.5-.3.5-.7.9-1 1.4-.1.1-.2.3-.3.4-.5.6-.9 1.1-1.4 1.6l-.3.3-1.2 1.2-.4.4c-.5.5-1 .9-1.6 1.4-.6.5-1.1.9-1.7 1.3-.2.1-.3.2-.5.3-.5.3-.9.7-1.4 1-.1.1-.3.2-.4.3-.6.4-1.2.7-1.9 1.1-.1.1-.3.1-.4.2-.5.3-1 .5-1.6.8l-.6.3c-.7.3-1.3.6-2 .8-.7.3-1.4.5-2.1.7-.2.1-.4.1-.6.2-.6.2-1.1.3-1.7.4-.2 0-.3.1-.5.1-.7.2-1.5.3-2.2.4-.2 0-.3 0-.5.1-.6.1-1.2.1-1.8.2h-.6c-.8 0-1.5.1-2.3.1s-1.5 0-2.3-.1h-.6c-.6 0-1.2-.1-1.8-.2-.2 0-.3 0-.5-.1-.7-.1-1.5-.2-2.2-.4-.2 0-.3-.1-.5-.1-.6-.1-1.2-.3-1.7-.4-.2-.1-.4-.1-.6-.2-.7-.2-1.4-.4-2.1-.7-.7-.2-1.3-.5-2-.8l-.6-.3c-.5-.2-1.1-.5-1.6-.8-.1-.1-.3-.1-.4-.2-.6-.3-1.3-.7-1.9-1.1-.1-.1-.3-.2-.4-.3-.5-.3-1-.6-1.4-1-.2-.1-.3-.2-.5-.3-.6-.4-1.2-.9-1.7-1.3s-1.1-.9-1.6-1.4l-.4-.4-1.2-1.2-.3-.3c-.5-.5-1-1.1-1.4-1.6-.1-.1-.2-.3-.3-.4-.4-.4-.7-.9-1-1.4-.1-.2-.2-.3-.3-.5l-1.2-1.8v-.1c-.4-.6-.7-1.2-1-1.8-2.6-5-4.1-10.7-4.1-16.7s1.5-11.7 4.1-16.7zM620 539v221c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V539c-10.1 3.3-20.8 5-32 5s-21.9-1.8-32-5zm64-198v-77c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v77c10.1-3.3 20.8-5 32-5s21.9 1.8 32 5zm-64 198c10.1 3.3 20.8 5 32 5s21.9-1.8 32-5c41.8-13.5 72-52.7 72-99s-30.2-85.5-72-99c-10.1-3.3-20.8-5-32-5s-21.9 1.8-32 5c-41.8 13.5-72 52.7-72 99s30.2 85.5 72 99zm.1-115.7c.3-.6.7-1.2 1-1.8v-.1l1.2-1.8c.1-.2.2-.3.3-.5.3-.5.7-.9 1-1.4.1-.1.2-.3.3-.4.5-.6.9-1.1 1.4-1.6l.3-.3 1.2-1.2.4-.4c.5-.5 1-.9 1.6-1.4.6-.5 1.1-.9 1.7-1.3.2-.1.3-.2.5-.3.5-.3.9-.7 1.4-1 .1-.1.3-.2.4-.3.6-.4 1.2-.7 1.9-1.1.1-.1.3-.1.4-.2.5-.3 1-.5 1.6-.8l.6-.3c.7-.3 1.3-.6 2-.8.7-.3 1.4-.5 2.1-.7.2-.1.4-.1.6-.2.6-.2 1.1-.3 1.7-.4.2 0 .3-.1.5-.1.7-.2 1.5-.3 2.2-.4.2 0 .3 0 .5-.1.6-.1 1.2-.1 1.8-.2h.6c.8 0 1.5-.1 2.3-.1s1.5 0 2.3.1h.6c.6 0 1.2.1 1.8.2.2 0 .3 0 .5.1.7.1 1.5.2 2.2.4.2 0 .3.1.5.1.6.1 1.2.3 1.7.4.2.1.4.1.6.2.7.2 1.4.4 2.1.7.7.2 1.3.5 2 .8l.6.3c.5.2 1.1.5 1.6.8.1.1.3.1.4.2.6.3 1.3.7 1.9 1.1.1.1.3.2.4.3.5.3 1 .6 1.4 1 .2.1.3.2.5.3.6.4 1.2.9 1.7 1.3s1.1.9 1.6 1.4l.4.4 1.2 1.2.3.3c.5.5 1 1.1 1.4 1.6.1.1.2.3.3.4.4.4.7.9 1 1.4.1.2.2.3.3.5l1.2 1.8v.1a36.18 36.18 0 015.1 18.5c0 6-1.5 11.7-4.1 16.7-.3.6-.7 1.2-1 1.8v.1l-1.2 1.8c-.1.2-.2.3-.3.5-.3.5-.7.9-1 1.4-.1.1-.2.3-.3.4-.5.6-.9 1.1-1.4 1.6l-.3.3-1.2 1.2-.4.4c-.5.5-1 .9-1.6 1.4-.6.5-1.1.9-1.7 1.3-.2.1-.3.2-.5.3-.5.3-.9.7-1.4 1-.1.1-.3.2-.4.3-.6.4-1.2.7-1.9 1.1-.1.1-.3.1-.4.2-.5.3-1 .5-1.6.8l-.6.3c-.7.3-1.3.6-2 .8-.7.3-1.4.5-2.1.7-.2.1-.4.1-.6.2-.6.2-1.1.3-1.7.4-.2 0-.3.1-.5.1-.7.2-1.5.3-2.2.4-.2 0-.3 0-.5.1-.6.1-1.2.1-1.8.2h-.6c-.8 0-1.5.1-2.3.1s-1.5 0-2.3-.1h-.6c-.6 0-1.2-.1-1.8-.2-.2 0-.3 0-.5-.1-.7-.1-1.5-.2-2.2-.4-.2 0-.3-.1-.5-.1-.6-.1-1.2-.3-1.7-.4-.2-.1-.4-.1-.6-.2-.7-.2-1.4-.4-2.1-.7-.7-.2-1.3-.5-2-.8l-.6-.3c-.5-.2-1.1-.5-1.6-.8-.1-.1-.3-.1-.4-.2-.6-.3-1.3-.7-1.9-1.1-.1-.1-.3-.2-.4-.3-.5-.3-1-.6-1.4-1-.2-.1-.3-.2-.5-.3-.6-.4-1.2-.9-1.7-1.3s-1.1-.9-1.6-1.4l-.4-.4-1.2-1.2-.3-.3c-.5-.5-1-1.1-1.4-1.6-.1-.1-.2-.3-.3-.4-.4-.4-.7-.9-1-1.4-.1-.2-.2-.3-.3-.5l-1.2-1.8v-.1c-.4-.6-.7-1.2-1-1.8-2.6-5-4.1-10.7-4.1-16.7s1.5-11.7 4.1-16.7z"}}]},name:"control",theme:"outlined"},MEt=REt,AEt=function(e,t){return x.exports.createElement(cr,Ct({},e,{ref:t,icon:MEt}))},PEt=x.exports.forwardRef(AEt),OEt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0042 42h216v494zM544 472c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v108H372c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h108v108c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V644h108c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H544V472z"}}]},name:"file-add",theme:"outlined"},FEt=OEt,BEt=function(e,t){return x.exports.createElement(cr,Ct({},e,{ref:t,icon:FEt}))},WEt=x.exports.forwardRef(BEt),VEt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"defs",attrs:{},children:[{tag:"style",attrs:{}}]},{tag:"path",attrs:{d:"M841 370c3-3.3 2.7-8.3-.6-11.3a8.24 8.24 0 00-5.3-2.1h-72.6c-2.4 0-4.6 1-6.1 2.8L633.5 504.6a7.96 7.96 0 01-13.4-1.9l-63.5-141.3a7.9 7.9 0 00-7.3-4.7H380.7l.9-4.7 8-42.3c10.5-55.4 38-81.4 85.8-81.4 18.6 0 35.5 1.7 48.8 4.7l14.1-66.8c-22.6-4.7-35.2-6.1-54.9-6.1-103.3 0-156.4 44.3-175.9 147.3l-9.4 49.4h-97.6c-3.8 0-7.1 2.7-7.8 6.4L181.9 415a8.07 8.07 0 007.8 9.7H284l-89 429.9a8.07 8.07 0 007.8 9.7H269c3.8 0 7.1-2.7 7.8-6.4l89.7-433.1h135.8l68.2 139.1c1.4 2.9 1 6.4-1.2 8.8l-180.6 203c-2.9 3.3-2.6 8.4.7 11.3 1.5 1.3 3.4 2 5.3 2h72.7c2.4 0 4.6-1 6.1-2.8l123.7-146.7c2.8-3.4 7.9-3.8 11.3-1 .9.8 1.6 1.7 2.1 2.8L676.4 784c1.3 2.8 4.1 4.7 7.3 4.7h64.6a8.02 8.02 0 007.2-11.5l-95.2-198.9c-1.4-2.9-.9-6.4 1.3-8.8L841 370z"}}]},name:"function",theme:"outlined"},HEt=VEt,$Et=function(e,t){return x.exports.createElement(cr,Ct({},e,{ref:t,icon:HEt}))},zEt=x.exports.forwardRef($Et);const UEt="_container_zfuq3_1",jEt="_content_zfuq3_6";var pR={container:UEt,content:jEt,"operator-item":"_operator-item_zfuq3_10"};const GU="operator_type",KEt=()=>{const i=(e,t)=>n=>{console.log("233 handleDragStart",e,t),n.dataTransfer.setData(e,t),n.dataTransfer.dropEffect="copy",n.dataTransfer.effectAllowed="all"};return vn("div",{className:pR.container,children:[fe("div",{className:pR.title,children:"Operators"}),fe("div",{className:pR.content,children:XGe().map(e=>fe("div",{className:pR["operator-item"],draggable:!0,onDragStart:i(GU,e.operatorType),children:e.operatorName},e.operatorType))})]})};function YSe(i){var t;return{key:i.id,title:i.name,children:(t=i.children)==null?void 0:t.map(n=>YSe(n))}}function qEt(){const{layer:i,activeLayerId:e,setActiveLayerId:t}=ET(),n=[YSe(i)];return vn("div",{children:[fe("div",{children:"Layer Panel"}),fe(wGe,{selectedKeys:[e],showLine:{showLeafIcon:!0},showIcon:!1,defaultExpandedKeys:[],onSelect:(r,s)=>{r!=null&&r[0]&&t(String(r==null?void 0:r[0]))},treeData:n})]})}const nue={id:"52c9a455-3b00-4240-acdc-501de8dd190d",name:"App",children:[],nodes:[{position:{x:511,y:292},id:"$flow_f0c2a254-0434-4e3c-8658-c6571c0d9d0f",type:"Node",data:{operatorName:"State",operatorType:"StateOperator",nodeType:"Node",endPointOptions:{endPointList:[{id:"3ffde193-f535-411e-8283-4616d3e29921",type:"source",variableName:"data_dkmt4",label:"data",hint:"data"},{id:"1e005bc7-6141-458a-a28a-14e2009ee1e7",type:"target",variableName:"update_w1acx",label:"update",hint:"update"}]},value:0,valueType:"number"},width:118,height:136,dragging:!1,selected:!1,positionAbsolute:{x:511,y:292}},{position:{x:725,y:290},id:"$flow_b821e643-ec8e-4422-89a4-dbd1703a1966",type:"Node",data:{operatorName:"Output",operatorType:"OutputOperator",nodeType:"Node",endPointOptions:{endPointList:[{id:"9104b74e-7f0e-49db-828d-425ccac211ed",type:"group",variableName:"state_nsrsc",label:"State",hint:"state",children:[{id:"b85cf0aa-c815-46e5-9c82-2991ee90bde5",type:"target",variableName:"state_ntaik",hint:"state"}],allowAddAndRemoveChildren:!0,defaultChildData:{type:"target",hint:"state"}},{id:"99dcb167-03be-4d95-a794-d2fb2b96598a",type:"group",variableName:"event_u7nsf",label:"Event",hint:"event",children:[],allowAddAndRemoveChildren:!0,defaultChildData:{type:"target",hint:"event"}}]}},width:118,height:148,dragging:!1,selected:!1,positionAbsolute:{x:725,y:290}},{position:{x:345,y:266},id:"$flow_f14e69ec-b1ba-4e39-9748-5d89b7ca582f",type:"Node",data:{operatorName:"Merge",operatorType:"MergeOperator",nodeType:"Node",endPointOptions:{endPointList:[{id:"3b25197b-83b3-47f6-ba2f-7d5478412086",type:"group",variableName:"output_zdn7f",hint:"output",children:[{id:"73b965fd-7fd6-4c4c-ac31-916ab3130ab3",type:"source",variableName:"output_awo8m",label:"output",hint:"output",variableType:"array"}]},{id:"ae846f6e-9501-4e0a-a7db-1a6a8f2bb81e",type:"group",variableName:"input_4oq90",label:"Stream",hint:"input",children:[{id:"b63e542a-214b-4918-9388-778413d921e3",type:"target",variableName:"input_6yw48",hint:"input"},{id:"8dd0dad0-0135-487d-9417-a05d5130e188",type:"target",variableName:"input_blxty",hint:"input"},{id:"c29b921d-acd8-4d73-9b7e-c0dbd19318c8",type:"target",variableName:"input_wdsfj",hint:"input"}],allowAddAndRemoveChildren:!0,defaultChildData:{hint:"input",type:"target"}}]}},width:118,height:163,dragging:!1,selected:!1,positionAbsolute:{x:345,y:266}},{position:{x:108,y:315},id:"$flow_17f541a4-f480-45c5-a6bd-ab654945e512",type:"Node",data:{operatorName:"Input",operatorType:"InputOperator",nodeType:"Node",endPointOptions:{endPointList:[{id:"5a102ff6-a37a-45b9-a4b4-a38fd7369e7a",type:"group",variableName:"state_buhhs",label:"State",hint:"state",children:[{id:"5bebcd05-9d98-42e9-9679-fa5cc14bc24f",type:"source",variableName:"state_fsap1",hint:"state"},{id:"8327475f-80bc-41e4-84d5-595861bb03ad",type:"source",variableName:"state_nbpuh",hint:"state"}],allowAddAndRemoveChildren:!0,defaultChildData:{type:"source",hint:"state"}},{id:"8735a717-072b-43b2-b6bc-91929f24bc88",type:"group",variableName:"event_ahxxk",label:"Event",hint:"event",children:[],allowAddAndRemoveChildren:!0,defaultChildData:{type:"source",hint:"event"}},{id:"a971b98d-5918-43ad-a586-4d0e357be2ab",type:"group",variableName:"lifecycle_6pwm1",label:"Lifecycle",hint:"lifecycle",children:[{id:"c4638ffc-aae2-41ab-b9f5-63cb314e84bc",type:"source",variableName:"beforeMount"},{id:"bf5bf823-cc10-4760-9857-fe0d123831ab",type:"source",variableName:"mount"},{id:"0cad4c93-a41a-4b0b-b884-04f6728b7196",type:"source",variableName:"beforeUnmount"},{id:"efd54e65-8abe-4b26-b745-6b80779c5c18",type:"source",variableName:"unmount"}],allowAddAndRemoveChildren:!1}]}},width:118,height:248,dragging:!1,selected:!1,positionAbsolute:{x:108,y:315}},{position:{x:365,y:571},id:"$flow_a36d1f33-2e2f-4fb5-a496-1a13db60f192",type:"Node",data:{operatorName:"Transform",operatorType:"TransformOperator",nodeType:"Node",endPointOptions:{endPointList:[{id:"ce9317fd-de38-44d0-8082-87428483a6ff",type:"source",variableName:"output_i5pnm",label:"output",hint:"output"},{id:"05b3e305-15eb-4c9f-a092-f6d8e4181236",type:"target",variableName:"input_mferc",label:"input",hint:"input"}]},customCode:`module.exports = async function transform(input) { + });`)]}}Nq([new QGe,new JGe,new iXe,new t_e,new ZGe,new eXe,new oXe,new ixe,new MEt,new AEt]);const T7=new wI("App"),YY=yhe({nodes:[],setNodes:()=>{},updateNode:()=>{},edges:[],setEdges:()=>{},updateEdge:()=>{},defaultLayer:T7,layer:T7,setLayer:()=>{},setDefaultLayer:()=>{},activeLayerId:T7.id,setActiveLayerId:()=>{}});function kT(){return She(YY)}function el(i){return whe(YY,i)}function IT(){const{nodes:i,edges:e,updateEdge:t,updateNode:n,setActiveLayerId:o,setLayer:r,setEdges:s,layer:a,activeLayerId:l,defaultLayer:c,setDefaultLayer:u}=kT(),d=fA({nodes:i,edges:e,layer:a,activeLayerId:l,defaultLayer:c}),h=fA({updateEdge:t,updateNode:n,setEdges:s,setActiveLayerId:o,setLayer:r,setDefaultLayer:u});return{currentStateRef:d,actionsRef:h}}function PEt(){const i=el(o=>o.nodes),e=el(o=>o.edges),t=el(o=>o.layer),n=el(o=>o.defaultLayer);return{nodes:i,edges:e,layer:t,defaultLayer:n}}function t3(){const i=el(a=>a.setEdges),e=el(a=>a.setNodes),t=el(a=>a.updateEdge),n=el(a=>a.updateNode),o=el(a=>a.setLayer),r=el(a=>a.setDefaultLayer),s=el(a=>a.setActiveLayerId);return{setEdges:i,setNodes:e,updateEdge:t,updateNode:n,setLayer:o,setActiveLayerId:s,setDefaultLayer:r}}const OEt=i=>{const{children:e}=i,[t,n]=x.exports.useState(()=>new wI("App")),[o,r]=x.exports.useState(t),s=x.exports.useRef(t),a=s.current,[l,c]=x.exports.useState(a.id),u=wc(a,l),d=(u==null?void 0:u.nodes)||[],h=(u==null?void 0:u.edges)||[],f=k_(function(E){var I;if(s.current=typeof E=="function"?E(s.current):E,n(s.current),(I=s.current)!=null&&I.relativeOperatorType){const k=Rq(s.current.relativeOperatorType);k==null||k.updateContent({layer:s.current})}}),g=k_(function(E,I){f(k=>{const R=wc(k,(I==null?void 0:I.layerId)||l);if(R){R.nodes=typeof E=="function"?E(R.nodes):E;const A=new Set(R.nodes.map(P=>P.id));R.children=R.children.filter(P=>P.relativeNodeId&&A.has(P.relativeNodeId))}return{...k}})}),p=k_(function(E,I){f(k=>{const R=wc(k,(I==null?void 0:I.layerId)||l);return R&&(R.edges=typeof E=="function"?E(R.edges):E),{...k}})}),v=w5e(),m=k_(function(E,I,k){!E||p(R=>{var H;const A=R.findIndex(B=>B.id===E);if(A<0)return R;const P=[...R],N=(H=P.splice(A,1))==null?void 0:H[0],M=typeof I=="function"?I(N):I;return P.concat(M)},k)}),_=k_(function(E,I,k){if(!E)return;const{updateInternal:R,layerId:A}=k||{};g(P=>{var F;const N=P.findIndex($=>$.id===E);if(N<0)return P;const M=[...P],H=(F=M.splice(N,1))==null?void 0:F[0],B=typeof I=="function"?I(H):I;return M.concat(B)},{layerId:A}),R&&setTimeout(()=>{v(E)},0)}),y=fA({nodes:d,edges:h,layer:a,activeLayerId:l,defaultLayer:o}),w=fA({updateEdge:m,updateNode:_,setEdges:p,setActiveLayerId:()=>{},setLayer:f,setDefaultLayer:r}),L=k_(D=>{const E=l;c(D),setTimeout(()=>{const I=wc(a,E);if(I!=null&&I.parentLayerId){const k=wc(a,I.parentLayerId),R=k==null?void 0:k.nodes.find(A=>A.id===I.relativeNodeId);if(R){const A=fr(R);A==null||A.refreshNode({node:R,actions:w.current,currentState:y.current})}}})});return he(YY.Provider,{value:{nodes:d,edges:h,updateEdge:m,updateNode:_,setEdges:p,setNodes:g,layer:a,defaultLayer:o,activeLayerId:l,setDefaultLayer:r,setLayer:f,setActiveLayerId:L},children:e})},FEt=i=>{const{children:e}=i;return he(_K,{children:he(OEt,{children:e})})},oxe=yhe({operators:[],refreshOperators:()=>{}});function BEt(i){const[e,t]=x.exports.useState(Qie()),n=k_(()=>{t(Qie())});return he(oxe.Provider,{value:{operators:e,refreshOperators:n},children:i==null?void 0:i.children})}function ZY(){return She(oxe)}var WEt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656zM340 683v77c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8v-77c-10.1 3.3-20.8 5-32 5s-21.9-1.8-32-5zm64-198V264c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v221c10.1-3.3 20.8-5 32-5s21.9 1.8 32 5zm-64 198c10.1 3.3 20.8 5 32 5s21.9-1.8 32-5c41.8-13.5 72-52.7 72-99s-30.2-85.5-72-99c-10.1-3.3-20.8-5-32-5s-21.9 1.8-32 5c-41.8 13.5-72 52.7-72 99s30.2 85.5 72 99zm.1-115.7c.3-.6.7-1.2 1-1.8v-.1l1.2-1.8c.1-.2.2-.3.3-.5.3-.5.7-.9 1-1.4.1-.1.2-.3.3-.4.5-.6.9-1.1 1.4-1.6l.3-.3 1.2-1.2.4-.4c.5-.5 1-.9 1.6-1.4.6-.5 1.1-.9 1.7-1.3.2-.1.3-.2.5-.3.5-.3.9-.7 1.4-1 .1-.1.3-.2.4-.3.6-.4 1.2-.7 1.9-1.1.1-.1.3-.1.4-.2.5-.3 1-.5 1.6-.8l.6-.3c.7-.3 1.3-.6 2-.8.7-.3 1.4-.5 2.1-.7.2-.1.4-.1.6-.2.6-.2 1.1-.3 1.7-.4.2 0 .3-.1.5-.1.7-.2 1.5-.3 2.2-.4.2 0 .3 0 .5-.1.6-.1 1.2-.1 1.8-.2h.6c.8 0 1.5-.1 2.3-.1s1.5 0 2.3.1h.6c.6 0 1.2.1 1.8.2.2 0 .3 0 .5.1.7.1 1.5.2 2.2.4.2 0 .3.1.5.1.6.1 1.2.3 1.7.4.2.1.4.1.6.2.7.2 1.4.4 2.1.7.7.2 1.3.5 2 .8l.6.3c.5.2 1.1.5 1.6.8.1.1.3.1.4.2.6.3 1.3.7 1.9 1.1.1.1.3.2.4.3.5.3 1 .6 1.4 1 .2.1.3.2.5.3.6.4 1.2.9 1.7 1.3s1.1.9 1.6 1.4l.4.4 1.2 1.2.3.3c.5.5 1 1.1 1.4 1.6.1.1.2.3.3.4.4.4.7.9 1 1.4.1.2.2.3.3.5l1.2 1.8s0 .1.1.1a36.18 36.18 0 015.1 18.5c0 6-1.5 11.7-4.1 16.7-.3.6-.7 1.2-1 1.8 0 0 0 .1-.1.1l-1.2 1.8c-.1.2-.2.3-.3.5-.3.5-.7.9-1 1.4-.1.1-.2.3-.3.4-.5.6-.9 1.1-1.4 1.6l-.3.3-1.2 1.2-.4.4c-.5.5-1 .9-1.6 1.4-.6.5-1.1.9-1.7 1.3-.2.1-.3.2-.5.3-.5.3-.9.7-1.4 1-.1.1-.3.2-.4.3-.6.4-1.2.7-1.9 1.1-.1.1-.3.1-.4.2-.5.3-1 .5-1.6.8l-.6.3c-.7.3-1.3.6-2 .8-.7.3-1.4.5-2.1.7-.2.1-.4.1-.6.2-.6.2-1.1.3-1.7.4-.2 0-.3.1-.5.1-.7.2-1.5.3-2.2.4-.2 0-.3 0-.5.1-.6.1-1.2.1-1.8.2h-.6c-.8 0-1.5.1-2.3.1s-1.5 0-2.3-.1h-.6c-.6 0-1.2-.1-1.8-.2-.2 0-.3 0-.5-.1-.7-.1-1.5-.2-2.2-.4-.2 0-.3-.1-.5-.1-.6-.1-1.2-.3-1.7-.4-.2-.1-.4-.1-.6-.2-.7-.2-1.4-.4-2.1-.7-.7-.2-1.3-.5-2-.8l-.6-.3c-.5-.2-1.1-.5-1.6-.8-.1-.1-.3-.1-.4-.2-.6-.3-1.3-.7-1.9-1.1-.1-.1-.3-.2-.4-.3-.5-.3-1-.6-1.4-1-.2-.1-.3-.2-.5-.3-.6-.4-1.2-.9-1.7-1.3s-1.1-.9-1.6-1.4l-.4-.4-1.2-1.2-.3-.3c-.5-.5-1-1.1-1.4-1.6-.1-.1-.2-.3-.3-.4-.4-.4-.7-.9-1-1.4-.1-.2-.2-.3-.3-.5l-1.2-1.8v-.1c-.4-.6-.7-1.2-1-1.8-2.6-5-4.1-10.7-4.1-16.7s1.5-11.7 4.1-16.7zM620 539v221c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V539c-10.1 3.3-20.8 5-32 5s-21.9-1.8-32-5zm64-198v-77c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v77c10.1-3.3 20.8-5 32-5s21.9 1.8 32 5zm-64 198c10.1 3.3 20.8 5 32 5s21.9-1.8 32-5c41.8-13.5 72-52.7 72-99s-30.2-85.5-72-99c-10.1-3.3-20.8-5-32-5s-21.9 1.8-32 5c-41.8 13.5-72 52.7-72 99s30.2 85.5 72 99zm.1-115.7c.3-.6.7-1.2 1-1.8v-.1l1.2-1.8c.1-.2.2-.3.3-.5.3-.5.7-.9 1-1.4.1-.1.2-.3.3-.4.5-.6.9-1.1 1.4-1.6l.3-.3 1.2-1.2.4-.4c.5-.5 1-.9 1.6-1.4.6-.5 1.1-.9 1.7-1.3.2-.1.3-.2.5-.3.5-.3.9-.7 1.4-1 .1-.1.3-.2.4-.3.6-.4 1.2-.7 1.9-1.1.1-.1.3-.1.4-.2.5-.3 1-.5 1.6-.8l.6-.3c.7-.3 1.3-.6 2-.8.7-.3 1.4-.5 2.1-.7.2-.1.4-.1.6-.2.6-.2 1.1-.3 1.7-.4.2 0 .3-.1.5-.1.7-.2 1.5-.3 2.2-.4.2 0 .3 0 .5-.1.6-.1 1.2-.1 1.8-.2h.6c.8 0 1.5-.1 2.3-.1s1.5 0 2.3.1h.6c.6 0 1.2.1 1.8.2.2 0 .3 0 .5.1.7.1 1.5.2 2.2.4.2 0 .3.1.5.1.6.1 1.2.3 1.7.4.2.1.4.1.6.2.7.2 1.4.4 2.1.7.7.2 1.3.5 2 .8l.6.3c.5.2 1.1.5 1.6.8.1.1.3.1.4.2.6.3 1.3.7 1.9 1.1.1.1.3.2.4.3.5.3 1 .6 1.4 1 .2.1.3.2.5.3.6.4 1.2.9 1.7 1.3s1.1.9 1.6 1.4l.4.4 1.2 1.2.3.3c.5.5 1 1.1 1.4 1.6.1.1.2.3.3.4.4.4.7.9 1 1.4.1.2.2.3.3.5l1.2 1.8v.1a36.18 36.18 0 015.1 18.5c0 6-1.5 11.7-4.1 16.7-.3.6-.7 1.2-1 1.8v.1l-1.2 1.8c-.1.2-.2.3-.3.5-.3.5-.7.9-1 1.4-.1.1-.2.3-.3.4-.5.6-.9 1.1-1.4 1.6l-.3.3-1.2 1.2-.4.4c-.5.5-1 .9-1.6 1.4-.6.5-1.1.9-1.7 1.3-.2.1-.3.2-.5.3-.5.3-.9.7-1.4 1-.1.1-.3.2-.4.3-.6.4-1.2.7-1.9 1.1-.1.1-.3.1-.4.2-.5.3-1 .5-1.6.8l-.6.3c-.7.3-1.3.6-2 .8-.7.3-1.4.5-2.1.7-.2.1-.4.1-.6.2-.6.2-1.1.3-1.7.4-.2 0-.3.1-.5.1-.7.2-1.5.3-2.2.4-.2 0-.3 0-.5.1-.6.1-1.2.1-1.8.2h-.6c-.8 0-1.5.1-2.3.1s-1.5 0-2.3-.1h-.6c-.6 0-1.2-.1-1.8-.2-.2 0-.3 0-.5-.1-.7-.1-1.5-.2-2.2-.4-.2 0-.3-.1-.5-.1-.6-.1-1.2-.3-1.7-.4-.2-.1-.4-.1-.6-.2-.7-.2-1.4-.4-2.1-.7-.7-.2-1.3-.5-2-.8l-.6-.3c-.5-.2-1.1-.5-1.6-.8-.1-.1-.3-.1-.4-.2-.6-.3-1.3-.7-1.9-1.1-.1-.1-.3-.2-.4-.3-.5-.3-1-.6-1.4-1-.2-.1-.3-.2-.5-.3-.6-.4-1.2-.9-1.7-1.3s-1.1-.9-1.6-1.4l-.4-.4-1.2-1.2-.3-.3c-.5-.5-1-1.1-1.4-1.6-.1-.1-.2-.3-.3-.4-.4-.4-.7-.9-1-1.4-.1-.2-.2-.3-.3-.5l-1.2-1.8v-.1c-.4-.6-.7-1.2-1-1.8-2.6-5-4.1-10.7-4.1-16.7s1.5-11.7 4.1-16.7z"}}]},name:"control",theme:"outlined"},VEt=WEt,HEt=function(e,t){return x.exports.createElement(cr,yt({},e,{ref:t,icon:VEt}))},$Et=x.exports.forwardRef(HEt),zEt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0042 42h216v494zM544 472c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v108H372c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h108v108c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V644h108c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H544V472z"}}]},name:"file-add",theme:"outlined"},UEt=zEt,jEt=function(e,t){return x.exports.createElement(cr,yt({},e,{ref:t,icon:UEt}))},KEt=x.exports.forwardRef(jEt),qEt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"defs",attrs:{},children:[{tag:"style",attrs:{}}]},{tag:"path",attrs:{d:"M841 370c3-3.3 2.7-8.3-.6-11.3a8.24 8.24 0 00-5.3-2.1h-72.6c-2.4 0-4.6 1-6.1 2.8L633.5 504.6a7.96 7.96 0 01-13.4-1.9l-63.5-141.3a7.9 7.9 0 00-7.3-4.7H380.7l.9-4.7 8-42.3c10.5-55.4 38-81.4 85.8-81.4 18.6 0 35.5 1.7 48.8 4.7l14.1-66.8c-22.6-4.7-35.2-6.1-54.9-6.1-103.3 0-156.4 44.3-175.9 147.3l-9.4 49.4h-97.6c-3.8 0-7.1 2.7-7.8 6.4L181.9 415a8.07 8.07 0 007.8 9.7H284l-89 429.9a8.07 8.07 0 007.8 9.7H269c3.8 0 7.1-2.7 7.8-6.4l89.7-433.1h135.8l68.2 139.1c1.4 2.9 1 6.4-1.2 8.8l-180.6 203c-2.9 3.3-2.6 8.4.7 11.3 1.5 1.3 3.4 2 5.3 2h72.7c2.4 0 4.6-1 6.1-2.8l123.7-146.7c2.8-3.4 7.9-3.8 11.3-1 .9.8 1.6 1.7 2.1 2.8L676.4 784c1.3 2.8 4.1 4.7 7.3 4.7h64.6a8.02 8.02 0 007.2-11.5l-95.2-198.9c-1.4-2.9-.9-6.4 1.3-8.8L841 370z"}}]},name:"function",theme:"outlined"},GEt=qEt,XEt=function(e,t){return x.exports.createElement(cr,yt({},e,{ref:t,icon:GEt}))},YEt=x.exports.forwardRef(XEt);class rxe extends pp{constructor(t){super({operatorName:t,operatorType:`Custom_${yI()}`,nodeType:oh.Node});Ct(this,"description","\u53CC\u51FB\u7F16\u8F91");Ct(this,"nodeColor","#DF826C");Ct(this,"isCustom",!0);Ct(this,"content");this.content={layer:new wI(t)},this.content.layer.relativeOperatorType=this.operatorType}getOperatorId(){return`custom_operator_${this.content.layer.id}`}updateContent(t){this.content=t}create(){const t=sge(),{endPointList:n}=zW(this.content.layer,t);return super.create({endPointOptions:{endPointList:n}},{id:t})}generateBlockDeclarations(t){var a;const{node:n,nodeGraph:o,formatVariableName:r,formatBlockVarName:s}=t;return[`const temp_${r(n.id)} = context.mount(${s(this.getOperatorId())}, { + ${o_e(n).map(l=>{var u,d;const c=(d=(u=o.findSourceNodes(n.id))==null?void 0:u.find(h=>h.handleId===l.id))==null?void 0:d.relatedHandleId;return c?`['${l.variableName}']: ${r(c||"")}`:""}).filter(Boolean).join(`, +`)} + })`,...(a=i_e(n)||[])==null?void 0:a.map(l=>`const ${r(l.id)} = temp_${r(n.id)}.output['${l.variableName}']`)]}generateBlockOutput(t){return[]}generateBlockRelation(t){return[]}getExtraAppContainers(){return[{appContainerId:this.getOperatorId(),data:this.content}]}onNodeDoubleClick(t){const{actions:n,currentState:o}=t;o.defaultLayer.id===o.layer.id&&n.setDefaultLayer(o.layer),n.setLayer(this.content.layer),n.setActiveLayerId(this.content.layer.id)}refreshNode(t){var s;const{node:n,currentState:o}=t,{endPointList:r}=zW(this.content.layer,n.id);r&&t.actions.updateNode(n.id,a=>this.updateData(a,{endPointOptions:{endPointList:r}}),{updateInternal:!0,layerId:(s=o.layer)==null?void 0:s.id})}onLayerChange(t){var r;const{currentState:n}=t,o=(r=n.layer.nodes)==null?void 0:r.filter(s=>{var a;return((a=s.data)==null?void 0:a.operatorType)===this.operatorType});o==null||o.forEach(s=>{this.refreshNode({node:s,...t})})}onNodeFocus(t){this==null||this.refreshNode(t)}}const ZEt="_container_zfuq3_1",QEt="_content_zfuq3_6";var _R={container:ZEt,content:QEt,"operator-item":"_operator-item_zfuq3_10"};const QU="operator_type",JEt=()=>{const i=(n,o)=>r=>{r.dataTransfer.setData(n,o),r.dataTransfer.dropEffect="copy",r.dataTransfer.effectAllowed="all"},{operators:e,refreshOperators:t}=ZY();return fn("div",{className:_R.container,children:[he("div",{className:_R.title,children:"Operators"}),fn("div",{className:_R.content,children:[he(ts,{size:"small",type:"link",onClick:()=>{let n="";function o(){if(!n){Xs.warning("Please input name");return}const a=new rxe(n);Nq([a]),t()}let r;const s=Sq.info({title:"Custom Operator Name",content:he("div",{children:he(lw,{ref:a=>{r=a},onChange:a=>{n=a.target.value||""},onKeyPress:a=>{a.key==="Enter"&&(s.destroy(),o())}})}),onOk(){o()}});setTimeout(()=>{var a;console.log("inputRef",r),(a=r==null?void 0:r.input)==null||a.focus()},200)},children:"Add Custom"}),e.map(n=>fn("div",{className:_R["operator-item"],draggable:!0,onDragStart:i(QU,n.operatorType),children:[n.isCustom?"Custom:":"",n.operatorName]},n.operatorType))]})]})};function sxe(i){var t;return{key:i.id,title:i.name,children:(t=i.children)==null?void 0:t.map(n=>sxe(n))}}function eDt(){const{layer:i,activeLayerId:e,setActiveLayerId:t}=kT(),n=[sxe(i)];return fn("div",{children:[he("div",{children:"Layer Panel"}),he(IGe,{selectedKeys:[e],showLine:{showLeafIcon:!0},showIcon:!1,defaultExpandedKeys:[],onSelect:(r,s)=>{r!=null&&r[0]&&t(String(r==null?void 0:r[0]))},treeData:n})]})}const N7={id:"52c9a455-3b00-4240-acdc-501de8dd190d",name:"App",children:[],nodes:[{position:{x:511,y:292},id:"$flow_f0c2a254-0434-4e3c-8658-c6571c0d9d0f",type:"Node",data:{operatorName:"State",operatorType:"StateOperator",nodeType:"Node",endPointOptions:{endPointList:[{id:"3ffde193-f535-411e-8283-4616d3e29921",type:"source",variableName:"data_dkmt4",label:"data",hint:"data"},{id:"1e005bc7-6141-458a-a28a-14e2009ee1e7",type:"target",variableName:"update_w1acx",label:"update",hint:"update"}]},value:0,valueType:"number"},width:118,height:136,dragging:!1,selected:!1,positionAbsolute:{x:511,y:292}},{position:{x:725,y:290},id:"$flow_b821e643-ec8e-4422-89a4-dbd1703a1966",type:"Node",data:{operatorName:"Output",operatorType:"OutputOperator",nodeType:"Node",endPointOptions:{endPointList:[{id:"9104b74e-7f0e-49db-828d-425ccac211ed",type:"group",variableName:"state_nsrsc",label:"State",hint:"state",children:[{id:"b85cf0aa-c815-46e5-9c82-2991ee90bde5",type:"target",variableName:"state_ntaik",hint:"state"}],allowAddAndRemoveChildren:!0,defaultChildData:{type:"target",hint:"state"}},{id:"99dcb167-03be-4d95-a794-d2fb2b96598a",type:"group",variableName:"event_u7nsf",label:"Event",hint:"event",children:[],allowAddAndRemoveChildren:!0,defaultChildData:{type:"target",hint:"event"}}]}},width:118,height:148,dragging:!1,selected:!1,positionAbsolute:{x:725,y:290}},{position:{x:345,y:266},id:"$flow_f14e69ec-b1ba-4e39-9748-5d89b7ca582f",type:"Node",data:{operatorName:"Merge",operatorType:"MergeOperator",nodeType:"Node",endPointOptions:{endPointList:[{id:"3b25197b-83b3-47f6-ba2f-7d5478412086",type:"group",variableName:"output_zdn7f",hint:"output",children:[{id:"73b965fd-7fd6-4c4c-ac31-916ab3130ab3",type:"source",variableName:"output_awo8m",label:"output",hint:"output",variableType:"array"}]},{id:"ae846f6e-9501-4e0a-a7db-1a6a8f2bb81e",type:"group",variableName:"input_4oq90",label:"Stream",hint:"input",children:[{id:"b63e542a-214b-4918-9388-778413d921e3",type:"target",variableName:"input_6yw48",hint:"input"},{id:"8dd0dad0-0135-487d-9417-a05d5130e188",type:"target",variableName:"input_blxty",hint:"input"},{id:"c29b921d-acd8-4d73-9b7e-c0dbd19318c8",type:"target",variableName:"input_wdsfj",hint:"input"}],allowAddAndRemoveChildren:!0,defaultChildData:{hint:"input",type:"target"}}]}},width:118,height:163,dragging:!1,selected:!1,positionAbsolute:{x:345,y:266}},{position:{x:108,y:315},id:"$flow_17f541a4-f480-45c5-a6bd-ab654945e512",type:"Node",data:{operatorName:"Input",operatorType:"InputOperator",nodeType:"Node",endPointOptions:{endPointList:[{id:"5a102ff6-a37a-45b9-a4b4-a38fd7369e7a",type:"group",variableName:"state_buhhs",label:"State",hint:"state",children:[{id:"5bebcd05-9d98-42e9-9679-fa5cc14bc24f",type:"source",variableName:"state_fsap1",hint:"state"},{id:"8327475f-80bc-41e4-84d5-595861bb03ad",type:"source",variableName:"state_nbpuh",hint:"state"}],allowAddAndRemoveChildren:!0,defaultChildData:{type:"source",hint:"state"}},{id:"8735a717-072b-43b2-b6bc-91929f24bc88",type:"group",variableName:"event_ahxxk",label:"Event",hint:"event",children:[],allowAddAndRemoveChildren:!0,defaultChildData:{type:"source",hint:"event"}},{id:"a971b98d-5918-43ad-a586-4d0e357be2ab",type:"group",variableName:"lifecycle_6pwm1",label:"Lifecycle",hint:"lifecycle",children:[{id:"c4638ffc-aae2-41ab-b9f5-63cb314e84bc",type:"source",variableName:"beforeMount"},{id:"bf5bf823-cc10-4760-9857-fe0d123831ab",type:"source",variableName:"mount"},{id:"0cad4c93-a41a-4b0b-b884-04f6728b7196",type:"source",variableName:"beforeUnmount"},{id:"efd54e65-8abe-4b26-b745-6b80779c5c18",type:"source",variableName:"unmount"}],allowAddAndRemoveChildren:!1}]}},width:118,height:248,dragging:!1,selected:!1,positionAbsolute:{x:108,y:315}},{position:{x:365,y:571},id:"$flow_a36d1f33-2e2f-4fb5-a496-1a13db60f192",type:"Node",data:{operatorName:"Transform",operatorType:"TransformOperator",nodeType:"Node",endPointOptions:{endPointList:[{id:"ce9317fd-de38-44d0-8082-87428483a6ff",type:"source",variableName:"output_i5pnm",label:"output",hint:"output"},{id:"05b3e305-15eb-4c9f-a092-f6d8e4181236",type:"target",variableName:"input_mferc",label:"input",hint:"input"}]},customCode:`module.exports = async function transform(input) { await new Promise(resolve => setTimeout(resolve, 5000)) }`,nodeLabel:"Sleep"},dragging:!1,width:118,height:136,selected:!1,positionAbsolute:{x:365,y:571}},{position:{x:572,y:522.6000000000001},id:"$flow_d02c1212-d525-4f78-8ab9-ce348eee56e6",type:"Node",data:{operatorName:"Combine",operatorType:"CombineOperator",nodeType:"Node",endPointOptions:{endPointList:[{id:"f22d87eb-a28b-4508-b24d-79e742dc7813",type:"group",variableName:"output_3huje",hint:"output",children:[{id:"2ce6eb2b-657e-4da2-b157-618523490b8b",type:"source",variableName:"output_isiqc",label:"output",hint:"output",variableType:"array"}]},{id:"2c727e8a-7add-45be-99c2-2b1a474aff30",type:"group",variableName:"mainInput_9xcls",label:"Main Stream",hint:"mainInput",children:[{id:"ee0cc676-e56b-4e1f-b075-2684dc50a33d",type:"target",variableName:"mainSource_fexm5",hint:"mainSource"}],allowAddAndRemoveChildren:!0,defaultChildData:{hint:"mainSource",type:"target"}},{id:"d23c4d13-9992-4198-90b6-33279f08fcb3",type:"group",variableName:"appendInput_nfxld",label:"Append Stream",hint:"appendInput",children:[{id:"a273cc22-9082-4ab4-a592-7df312deb4f7",type:"target",variableName:"appendSource_70qn2",hint:"appendSource"}],allowAddAndRemoveChildren:!0,defaultChildData:{hint:"appendSource",type:"target"}}]}},dragging:!1,width:141,height:194,selected:!1,positionAbsolute:{x:572,y:522.6000000000001}},{position:{x:784,y:532},id:"$flow_7c4ec381-82eb-418e-b299-feb1cd7c107d",type:"Node",data:{operatorName:"Transform",operatorType:"TransformOperator",nodeType:"Node",endPointOptions:{endPointList:[{id:"5e602cc8-1454-474f-8c75-0747f7a8c19b",type:"source",variableName:"output_akian",label:"output",hint:"output"},{id:"fb957bad-04d7-485b-bc97-b31dbf1c191b",type:"target",variableName:"input_nhkro",label:"input",hint:"input"}]},customCode:`module.exports = function transform(input) { return input[1] + 1; -}`,nodeLabel:"Plus 1"},dragging:!1,width:118,height:136,selected:!0,positionAbsolute:{x:784,y:532}}],edges:[{animated:!0,source:"$flow_f0c2a254-0434-4e3c-8658-c6571c0d9d0f",sourceHandle:"3ffde193-f535-411e-8283-4616d3e29921",target:"$flow_b821e643-ec8e-4422-89a4-dbd1703a1966",targetHandle:"b85cf0aa-c815-46e5-9c82-2991ee90bde5",id:"reactflow__edge-$flow_f0c2a254-0434-4e3c-8658-c6571c0d9d0f3ffde193-f535-411e-8283-4616d3e29921-$flow_b821e643-ec8e-4422-89a4-dbd1703a1966b85cf0aa-c815-46e5-9c82-2991ee90bde5"},{animated:!0,source:"$flow_f14e69ec-b1ba-4e39-9748-5d89b7ca582f",sourceHandle:"73b965fd-7fd6-4c4c-ac31-916ab3130ab3",target:"$flow_f0c2a254-0434-4e3c-8658-c6571c0d9d0f",targetHandle:"1e005bc7-6141-458a-a28a-14e2009ee1e7",id:"reactflow__edge-$flow_f14e69ec-b1ba-4e39-9748-5d89b7ca582f73b965fd-7fd6-4c4c-ac31-916ab3130ab3-$flow_f0c2a254-0434-4e3c-8658-c6571c0d9d0f1e005bc7-6141-458a-a28a-14e2009ee1e7"},{animated:!0,source:"$flow_17f541a4-f480-45c5-a6bd-ab654945e512",sourceHandle:"5bebcd05-9d98-42e9-9679-fa5cc14bc24f",target:"$flow_f14e69ec-b1ba-4e39-9748-5d89b7ca582f",targetHandle:"b63e542a-214b-4918-9388-778413d921e3",id:"reactflow__edge-$flow_17f541a4-f480-45c5-a6bd-ab654945e5125bebcd05-9d98-42e9-9679-fa5cc14bc24f-$flow_f14e69ec-b1ba-4e39-9748-5d89b7ca582fb63e542a-214b-4918-9388-778413d921e3"},{animated:!0,source:"$flow_17f541a4-f480-45c5-a6bd-ab654945e512",sourceHandle:"8327475f-80bc-41e4-84d5-595861bb03ad",target:"$flow_f14e69ec-b1ba-4e39-9748-5d89b7ca582f",targetHandle:"8dd0dad0-0135-487d-9417-a05d5130e188",id:"reactflow__edge-$flow_17f541a4-f480-45c5-a6bd-ab654945e5128327475f-80bc-41e4-84d5-595861bb03ad-$flow_f14e69ec-b1ba-4e39-9748-5d89b7ca582f8dd0dad0-0135-487d-9417-a05d5130e188"},{animated:!0,source:"$flow_f0c2a254-0434-4e3c-8658-c6571c0d9d0f",sourceHandle:"3ffde193-f535-411e-8283-4616d3e29921",target:"$flow_a36d1f33-2e2f-4fb5-a496-1a13db60f192",targetHandle:"05b3e305-15eb-4c9f-a092-f6d8e4181236",id:"reactflow__edge-$flow_f0c2a254-0434-4e3c-8658-c6571c0d9d0f3ffde193-f535-411e-8283-4616d3e29921-$flow_a36d1f33-2e2f-4fb5-a496-1a13db60f19205b3e305-15eb-4c9f-a092-f6d8e4181236"},{animated:!0,source:"$flow_7c4ec381-82eb-418e-b299-feb1cd7c107d",sourceHandle:"5e602cc8-1454-474f-8c75-0747f7a8c19b",target:"$flow_f14e69ec-b1ba-4e39-9748-5d89b7ca582f",targetHandle:"c29b921d-acd8-4d73-9b7e-c0dbd19318c8",id:"reactflow__edge-$flow_7c4ec381-82eb-418e-b299-feb1cd7c107d5e602cc8-1454-474f-8c75-0747f7a8c19b-$flow_f14e69ec-b1ba-4e39-9748-5d89b7ca582fc29b921d-acd8-4d73-9b7e-c0dbd19318c8"},{animated:!0,source:"$flow_a36d1f33-2e2f-4fb5-a496-1a13db60f192",sourceHandle:"ce9317fd-de38-44d0-8082-87428483a6ff",target:"$flow_d02c1212-d525-4f78-8ab9-ce348eee56e6",targetHandle:"ee0cc676-e56b-4e1f-b075-2684dc50a33d",id:"reactflow__edge-$flow_a36d1f33-2e2f-4fb5-a496-1a13db60f192ce9317fd-de38-44d0-8082-87428483a6ff-$flow_d02c1212-d525-4f78-8ab9-ce348eee56e6ee0cc676-e56b-4e1f-b075-2684dc50a33d"},{animated:!0,source:"$flow_f0c2a254-0434-4e3c-8658-c6571c0d9d0f",sourceHandle:"3ffde193-f535-411e-8283-4616d3e29921",target:"$flow_d02c1212-d525-4f78-8ab9-ce348eee56e6",targetHandle:"a273cc22-9082-4ab4-a592-7df312deb4f7",id:"reactflow__edge-$flow_f0c2a254-0434-4e3c-8658-c6571c0d9d0f3ffde193-f535-411e-8283-4616d3e29921-$flow_d02c1212-d525-4f78-8ab9-ce348eee56e6a273cc22-9082-4ab4-a592-7df312deb4f7"},{animated:!0,source:"$flow_d02c1212-d525-4f78-8ab9-ce348eee56e6",sourceHandle:"2ce6eb2b-657e-4da2-b157-618523490b8b",target:"$flow_7c4ec381-82eb-418e-b299-feb1cd7c107d",targetHandle:"fb957bad-04d7-485b-bc97-b31dbf1c191b",id:"reactflow__edge-$flow_d02c1212-d525-4f78-8ab9-ce348eee56e62ce6eb2b-657e-4da2-b157-618523490b8b-$flow_7c4ec381-82eb-418e-b299-feb1cd7c107dfb957bad-04d7-485b-bc97-b31dbf1c191b"}]},iue={id:"ffcec994-0f74-4f54-aeb7-438885dbcc72",name:"App",children:[],nodes:[{position:{x:644,y:102},id:"$flow_d59e81da-225c-40d2-9103-ee3e129514fa",type:"Node",data:{operatorName:"Output",operatorType:"OutputOperator",nodeType:"Node",endPointOptions:{endPointList:[{id:"20d9f812-f682-4b09-a201-7711882af890",type:"group",variableName:"state_rpxcg",label:"State",hint:"state",children:[{id:"4dc98fc8-57b9-4c30-8425-d33e602810cd",type:"target",variableName:"state_k9vor",hint:"state"}],allowAddAndRemoveChildren:!0,defaultChildData:{type:"target",hint:"state"}},{id:"abbf9ce7-b6a2-4d08-8a5c-90a76d044964",type:"group",variableName:"event_u8t6g",label:"Event",hint:"event",children:[],allowAddAndRemoveChildren:!0,defaultChildData:{type:"target",hint:"event"}}]}},width:118,height:148,dragging:!1},{position:{x:413,y:81},id:"$flow_ba963a6d-a83c-4609-830f-48ef8d517402",type:"Node",data:{operatorName:"Sum",operatorType:"SumOperator",nodeType:"Node",endPointOptions:{endPointList:[{id:"5d36decd-40e9-4f0f-b919-4af7a33bb481",type:"source",variableName:"output_7c53x",label:"output",hint:"output"},{id:"98aa0131-1975-4cb0-9c35-46280f69a014",type:"group",variableName:"input_3wldr",hint:"input",children:[{id:"90c2a56d-c4df-4430-a4e2-cfcdb6cac3b3",type:"target",variableName:"input_zkw5x",label:"input",hint:"input"},{id:"f85709d5-0f20-4ab8-a719-03e4130d8ec3",type:"target",variableName:"input_tntx3",label:"input",hint:"input"}],allowAddAndRemoveChildren:!0,defaultChildData:{type:"target",label:"input",hint:"input"}}]}},width:118,height:136,dragging:!1,selected:!1,positionAbsolute:{x:413,y:81}},{position:{x:130,y:65},id:"$flow_cd5a79e3-ebae-4c72-833f-32a6a6d83bed",type:"Node",data:{operatorName:"Input",operatorType:"InputOperator",nodeType:"Node",endPointOptions:{endPointList:[{id:"4b6c72b1-30a9-42c8-b5df-3e37d3acc958",type:"group",variableName:"state_pq4d3",label:"State",hint:"state",children:[{id:"1ba05470-5941-4e80-9c49-11c4bc2542fd",type:"source",variableName:"state_1naae",hint:"state"},{id:"371ff3fd-e734-48d6-a05e-371ab850313a",type:"source",variableName:"state_4lmjx",hint:"state"}],allowAddAndRemoveChildren:!0,defaultChildData:{type:"source",hint:"state"}},{id:"8827904c-48b0-4409-9489-1a73fcb99a64",type:"group",variableName:"event_dlev2",label:"Event",hint:"event",children:[],allowAddAndRemoveChildren:!0,defaultChildData:{type:"source",hint:"event"}},{id:"e0c20603-88e0-4130-a583-f7cde637dff8",type:"group",variableName:"lifecycle_l5z4n",label:"Lifecycle",hint:"lifecycle",children:[{id:"bdb74a8d-d29a-4a62-8d20-ad3a1dad8450",type:"source",variableName:"beforeMount"},{id:"82a9bb07-5619-4717-8618-a8c8cc03959a",type:"source",variableName:"mount"},{id:"d8525b49-242b-4572-8bd7-399bec64b338",type:"source",variableName:"beforeUnmount"},{id:"b6d06207-e8ea-47f8-af2c-fe2c60a328de",type:"source",variableName:"unmount"}],allowAddAndRemoveChildren:!1}]}},width:118,height:248,dragging:!1,selected:!1,positionAbsolute:{x:130,y:65}}],edges:[{animated:!0,source:"$flow_cd5a79e3-ebae-4c72-833f-32a6a6d83bed",sourceHandle:"1ba05470-5941-4e80-9c49-11c4bc2542fd",target:"$flow_ba963a6d-a83c-4609-830f-48ef8d517402",targetHandle:"90c2a56d-c4df-4430-a4e2-cfcdb6cac3b3",id:"reactflow__edge-$flow_cd5a79e3-ebae-4c72-833f-32a6a6d83bed1ba05470-5941-4e80-9c49-11c4bc2542fd-$flow_ba963a6d-a83c-4609-830f-48ef8d51740290c2a56d-c4df-4430-a4e2-cfcdb6cac3b3"},{animated:!0,source:"$flow_cd5a79e3-ebae-4c72-833f-32a6a6d83bed",sourceHandle:"371ff3fd-e734-48d6-a05e-371ab850313a",target:"$flow_ba963a6d-a83c-4609-830f-48ef8d517402",targetHandle:"f85709d5-0f20-4ab8-a719-03e4130d8ec3",id:"reactflow__edge-$flow_cd5a79e3-ebae-4c72-833f-32a6a6d83bed371ff3fd-e734-48d6-a05e-371ab850313a-$flow_ba963a6d-a83c-4609-830f-48ef8d517402f85709d5-0f20-4ab8-a719-03e4130d8ec3"},{animated:!0,source:"$flow_ba963a6d-a83c-4609-830f-48ef8d517402",sourceHandle:"5d36decd-40e9-4f0f-b919-4af7a33bb481",target:"$flow_d59e81da-225c-40d2-9103-ee3e129514fa",targetHandle:"4dc98fc8-57b9-4c30-8425-d33e602810cd",id:"reactflow__edge-$flow_ba963a6d-a83c-4609-830f-48ef8d5174025d36decd-40e9-4f0f-b919-4af7a33bb481-$flow_d59e81da-225c-40d2-9103-ee3e129514fa4dc98fc8-57b9-4c30-8425-d33e602810cd"}]},oue="layer_storage";function GEt(){const{layer:i,setLayer:e,setActiveLayerId:t}=ET(),{actionsRef:n,currentStateRef:o}=e3();async function r(){try{if(i.parentLayerId){const a=wc(i,i.parentLayerId),l=a==null?void 0:a.nodes.find(c=>c.id===i.relativeNodeId);if(l){const c=xr(l);c==null||c.refreshNode({node:l,actions:n.current,currentState:o.current})}}await gFe(200);const s=JSON.stringify(o.current.layer);localStorage.setItem(oue,s),Xa.success("success")}catch(s){Xa.error(s==null?void 0:s.message)}}return vn("div",{style:{display:"grid",gridAutoFlow:"row",gap:4},children:[fe(Bs,{type:"text",onClick:()=>{r()},children:"Save"}),fe(Bs,{type:"text",onClick:()=>{try{const s=JSON.parse(localStorage.getItem(oue)||"");e(s),t(s.id),Xa.success("success")}catch(s){Xa.error(s==null?void 0:s.message)}},children:"Load"}),fe(Bs,{type:"text",onClick:()=>{try{const s=new o4("App");e(s),t(s.id),Xa.success("success")}catch(s){Xa.error(s==null?void 0:s.message)}},children:"Reset"}),fe(Bs,{type:"text",onClick:()=>{console.log(i)},children:"Log"}),fe(Bs,{type:"text",onClick:()=>{try{e(nue),t(nue.id),Xa.success("success")}catch(s){Xa.error(s==null?void 0:s.message)}},children:"Load Loop Demo"}),fe(Bs,{type:"text",onClick:()=>{try{e(iue),t(iue.id),Xa.success("success")}catch(s){Xa.error(s==null?void 0:s.message)}},children:"Load Sum Demo"})]})}const XEt="_container_1n7r9_1";var YEt={container:XEt};function ZEt(){return fe("div",{className:YEt.container,children:fe(eje,{size:"small",tabPosition:"left",items:[{label:fe(zEt,{rev:""}),key:"Operators",children:fe(KEt,{})},{label:fe(WEt,{rev:""}),key:"Layers",children:fe(qEt,{})},{label:fe(PEt,{rev:""}),key:"commands",children:fe(GEt,{})}]})})}var QEt="\0",x_="\0",rue="",kl,_0,vc,sI,Uw,jw,fu,xh,dm,Lh,hm,vg,_g,Kw,qw,bg,hd,aI,XU;class JEt{constructor(e){Oo(this,aI);Oo(this,kl,!0);Oo(this,_0,!1);Oo(this,vc,!1);Oo(this,sI,void 0);Oo(this,Uw,()=>{});Oo(this,jw,()=>{});Oo(this,fu,{});Oo(this,xh,{});Oo(this,dm,{});Oo(this,Lh,{});Oo(this,hm,{});Oo(this,vg,{});Oo(this,_g,{});Oo(this,Kw,0);Oo(this,qw,0);Oo(this,bg,void 0);Oo(this,hd,void 0);e&&(su(this,kl,e.hasOwnProperty("directed")?e.directed:!0),su(this,_0,e.hasOwnProperty("multigraph")?e.multigraph:!1),su(this,vc,e.hasOwnProperty("compound")?e.compound:!1)),ht(this,vc)&&(su(this,bg,{}),su(this,hd,{}),ht(this,hd)[x_]={})}isDirected(){return ht(this,kl)}isMultigraph(){return ht(this,_0)}isCompound(){return ht(this,vc)}setGraph(e){return su(this,sI,e),this}graph(){return ht(this,sI)}setDefaultNodeLabel(e){return su(this,Uw,e),typeof e!="function"&&su(this,Uw,()=>e),this}nodeCount(){return ht(this,Kw)}nodes(){return Object.keys(ht(this,fu))}sources(){var e=this;return this.nodes().filter(t=>Object.keys(ht(e,xh)[t]).length===0)}sinks(){var e=this;return this.nodes().filter(t=>Object.keys(ht(e,Lh)[t]).length===0)}setNodes(e,t){var n=arguments,o=this;return e.forEach(function(r){n.length>1?o.setNode(r,t):o.setNode(r)}),this}setNode(e,t){return ht(this,fu).hasOwnProperty(e)?(arguments.length>1&&(ht(this,fu)[e]=t),this):(ht(this,fu)[e]=arguments.length>1?t:ht(this,Uw).call(this,e),ht(this,vc)&&(ht(this,bg)[e]=x_,ht(this,hd)[e]={},ht(this,hd)[x_][e]=!0),ht(this,xh)[e]={},ht(this,dm)[e]={},ht(this,Lh)[e]={},ht(this,hm)[e]={},++tx(this,Kw)._,this)}node(e){return ht(this,fu)[e]}hasNode(e){return ht(this,fu).hasOwnProperty(e)}removeNode(e){var t=this;if(ht(this,fu).hasOwnProperty(e)){var n=o=>t.removeEdge(ht(t,vg)[o]);delete ht(this,fu)[e],ht(this,vc)&&(gh(this,aI,XU).call(this,e),delete ht(this,bg)[e],this.children(e).forEach(function(o){t.setParent(o)}),delete ht(this,hd)[e]),Object.keys(ht(this,xh)[e]).forEach(n),delete ht(this,xh)[e],delete ht(this,dm)[e],Object.keys(ht(this,Lh)[e]).forEach(n),delete ht(this,Lh)[e],delete ht(this,hm)[e],--tx(this,Kw)._}return this}setParent(e,t){if(!ht(this,vc))throw new Error("Cannot set parent in a non-compound graph");if(t===void 0)t=x_;else{t+="";for(var n=t;n!==void 0;n=this.parent(n))if(n===e)throw new Error("Setting "+t+" as parent of "+e+" would create a cycle");this.setNode(t)}return this.setNode(e),gh(this,aI,XU).call(this,e),ht(this,bg)[e]=t,ht(this,hd)[t][e]=!0,this}parent(e){if(ht(this,vc)){var t=ht(this,bg)[e];if(t!==x_)return t}}children(e=x_){if(ht(this,vc)){var t=ht(this,hd)[e];if(t)return Object.keys(t)}else{if(e===x_)return this.nodes();if(this.hasNode(e))return[]}}predecessors(e){var t=ht(this,dm)[e];if(t)return Object.keys(t)}successors(e){var t=ht(this,hm)[e];if(t)return Object.keys(t)}neighbors(e){var t=this.predecessors(e);if(t){const o=new Set(t);for(var n of this.successors(e))o.add(n);return Array.from(o.values())}}isLeaf(e){var t;return this.isDirected()?t=this.successors(e):t=this.neighbors(e),t.length===0}filterNodes(e){var t=new this.constructor({directed:ht(this,kl),multigraph:ht(this,_0),compound:ht(this,vc)});t.setGraph(this.graph());var n=this;Object.entries(ht(this,fu)).forEach(function([s,a]){e(s)&&t.setNode(s,a)}),Object.values(ht(this,vg)).forEach(function(s){t.hasNode(s.v)&&t.hasNode(s.w)&&t.setEdge(s,n.edge(s))});var o={};function r(s){var a=n.parent(s);return a===void 0||t.hasNode(a)?(o[s]=a,a):a in o?o[a]:r(a)}return ht(this,vc)&&t.nodes().forEach(s=>t.setParent(s,r(s))),t}setDefaultEdgeLabel(e){return su(this,jw,e),typeof e!="function"&&su(this,jw,()=>e),this}edgeCount(){return ht(this,qw)}edges(){return Object.values(ht(this,vg))}setPath(e,t){var n=this,o=arguments;return e.reduce(function(r,s){return o.length>1?n.setEdge(r,s,t):n.setEdge(r,s),s}),this}setEdge(){var e,t,n,o,r=!1,s=arguments[0];typeof s=="object"&&s!==null&&"v"in s?(e=s.v,t=s.w,n=s.name,arguments.length===2&&(o=arguments[1],r=!0)):(e=s,t=arguments[1],n=arguments[3],arguments.length>2&&(o=arguments[2],r=!0)),e=""+e,t=""+t,n!==void 0&&(n=""+n);var a=BL(ht(this,kl),e,t,n);if(ht(this,_g).hasOwnProperty(a))return r&&(ht(this,_g)[a]=o),this;if(n!==void 0&&!ht(this,_0))throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(e),this.setNode(t),ht(this,_g)[a]=r?o:ht(this,jw).call(this,e,t,n);var l=eDt(ht(this,kl),e,t,n);return e=l.v,t=l.w,Object.freeze(l),ht(this,vg)[a]=l,sue(ht(this,dm)[t],e),sue(ht(this,hm)[e],t),ht(this,xh)[t][a]=l,ht(this,Lh)[e][a]=l,tx(this,qw)._++,this}edge(e,t,n){var o=arguments.length===1?T7(ht(this,kl),arguments[0]):BL(ht(this,kl),e,t,n);return ht(this,_g)[o]}edgeAsObj(){const e=this.edge(...arguments);return typeof e!="object"?{label:e}:e}hasEdge(e,t,n){var o=arguments.length===1?T7(ht(this,kl),arguments[0]):BL(ht(this,kl),e,t,n);return ht(this,_g).hasOwnProperty(o)}removeEdge(e,t,n){var o=arguments.length===1?T7(ht(this,kl),arguments[0]):BL(ht(this,kl),e,t,n),r=ht(this,vg)[o];return r&&(e=r.v,t=r.w,delete ht(this,_g)[o],delete ht(this,vg)[o],aue(ht(this,dm)[t],e),aue(ht(this,hm)[e],t),delete ht(this,xh)[t][o],delete ht(this,Lh)[e][o],tx(this,qw)._--),this}inEdges(e,t){var n=ht(this,xh)[e];if(n){var o=Object.values(n);return t?o.filter(r=>r.v===t):o}}outEdges(e,t){var n=ht(this,Lh)[e];if(n){var o=Object.values(n);return t?o.filter(r=>r.w===t):o}}nodeEdges(e,t){var n=this.inEdges(e,t);if(n)return n.concat(this.outEdges(e,t))}}kl=new WeakMap,_0=new WeakMap,vc=new WeakMap,sI=new WeakMap,Uw=new WeakMap,jw=new WeakMap,fu=new WeakMap,xh=new WeakMap,dm=new WeakMap,Lh=new WeakMap,hm=new WeakMap,vg=new WeakMap,_g=new WeakMap,Kw=new WeakMap,qw=new WeakMap,bg=new WeakMap,hd=new WeakMap,aI=new WeakSet,XU=function(e){delete ht(this,hd)[ht(this,bg)[e]][e]};function sue(i,e){i[e]?i[e]++:i[e]=1}function aue(i,e){--i[e]||delete i[e]}function BL(i,e,t,n){var o=""+e,r=""+t;if(!i&&o>r){var s=o;o=r,r=s}return o+rue+r+rue+(n===void 0?QEt:n)}function eDt(i,e,t,n){var o=""+e,r=""+t;if(!i&&o>r){var s=o;o=r,r=s}var a={v:o,w:r};return n&&(a.name=n),a}function T7(i,e){return BL(i,e.v,e.w,e.name)}var UY=JEt,tDt="2.1.13",nDt={Graph:UY,version:tDt},iDt=UY,oDt={write:rDt,read:lDt};function rDt(i){var e={options:{directed:i.isDirected(),multigraph:i.isMultigraph(),compound:i.isCompound()},nodes:sDt(i),edges:aDt(i)};return i.graph()!==void 0&&(e.value=structuredClone(i.graph())),e}function sDt(i){return i.nodes().map(function(e){var t=i.node(e),n=i.parent(e),o={v:e};return t!==void 0&&(o.value=t),n!==void 0&&(o.parent=n),o})}function aDt(i){return i.edges().map(function(e){var t=i.edge(e),n={v:e.v,w:e.w};return e.name!==void 0&&(n.name=e.name),t!==void 0&&(n.value=t),n})}function lDt(i){var e=new iDt(i.options).setGraph(i.value);return i.nodes.forEach(function(t){e.setNode(t.v,t.value),t.parent&&e.setParent(t.v,t.parent)}),i.edges.forEach(function(t){e.setEdge({v:t.v,w:t.w,name:t.name},t.value)}),e}var cDt=uDt;function uDt(i){var e={},t=[],n;function o(r){e.hasOwnProperty(r)||(e[r]=!0,n.push(r),i.successors(r).forEach(o),i.predecessors(r).forEach(o))}return i.nodes().forEach(function(r){n=[],o(r),n.length&&t.push(n)}),t}var xa,Cg,lI,YU,cI,ZU,Gw,NM;class dDt{constructor(){Oo(this,lI);Oo(this,cI);Oo(this,Gw);Oo(this,xa,[]);Oo(this,Cg,{})}size(){return ht(this,xa).length}keys(){return ht(this,xa).map(function(e){return e.key})}has(e){return ht(this,Cg).hasOwnProperty(e)}priority(e){var t=ht(this,Cg)[e];if(t!==void 0)return ht(this,xa)[t].priority}min(){if(this.size()===0)throw new Error("Queue underflow");return ht(this,xa)[0].key}add(e,t){var n=ht(this,Cg);if(e=String(e),!n.hasOwnProperty(e)){var o=ht(this,xa),r=o.length;return n[e]=r,o.push({key:e,priority:t}),gh(this,cI,ZU).call(this,r),!0}return!1}removeMin(){gh(this,Gw,NM).call(this,0,ht(this,xa).length-1);var e=ht(this,xa).pop();return delete ht(this,Cg)[e.key],gh(this,lI,YU).call(this,0),e.key}decrease(e,t){var n=ht(this,Cg)[e];if(t>ht(this,xa)[n].priority)throw new Error("New priority is greater than current priority. Key: "+e+" Old: "+ht(this,xa)[n].priority+" New: "+t);ht(this,xa)[n].priority=t,gh(this,cI,ZU).call(this,n)}}xa=new WeakMap,Cg=new WeakMap,lI=new WeakSet,YU=function(e){var t=ht(this,xa),n=2*e,o=n+1,r=e;n>1,!(t[o].priority1;function gDt(i,e,t,n){return pDt(i,String(e),t||fDt,n||function(o){return i.outEdges(o)})}function pDt(i,e,t,n){var o={},r=new hDt,s,a,l=function(c){var u=c.v!==s?c.v:c.w,d=o[u],h=t(c),f=a.distance+h;if(h<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+c+" Weight: "+h);f0&&(s=r.removeMin(),a=o[s],a.distance!==Number.POSITIVE_INFINITY);)n(s).forEach(l);return o}var mDt=QSe,vDt=_Dt;function _Dt(i,e,t){return i.nodes().reduce(function(n,o){return n[o]=mDt(i,o,e,t),n},{})}var JSe=bDt;function bDt(i){var e=0,t=[],n={},o=[];function r(s){var a=n[s]={onStack:!0,lowlink:e,index:e++};if(t.push(s),i.successors(s).forEach(function(u){n.hasOwnProperty(u)?n[u].onStack&&(a.lowlink=Math.min(a.lowlink,n[u].index)):(r(u),a.lowlink=Math.min(a.lowlink,n[u].lowlink))}),a.lowlink===a.index){var l=[],c;do c=t.pop(),n[c].onStack=!1,l.push(c);while(s!==c);o.push(l)}}return i.nodes().forEach(function(s){n.hasOwnProperty(s)||r(s)}),o}var CDt=JSe,wDt=yDt;function yDt(i){return CDt(i).filter(function(e){return e.length>1||e.length===1&&i.hasEdge(e[0],e[0])})}var SDt=LDt,xDt=()=>1;function LDt(i,e,t){return EDt(i,e||xDt,t||function(n){return i.outEdges(n)})}function EDt(i,e,t){var n={},o=i.nodes();return o.forEach(function(r){n[r]={},n[r][r]={distance:0},o.forEach(function(s){r!==s&&(n[r][s]={distance:Number.POSITIVE_INFINITY})}),t(r).forEach(function(s){var a=s.v===r?s.w:s.v,l=e(s);n[r][a]={distance:l,predecessor:r}})}),o.forEach(function(r){var s=n[r];o.forEach(function(a){var l=n[a];o.forEach(function(c){var u=l[r],d=s[c],h=l[c],f=u.distance+d.distance;fi.successors(a):a=>i.neighbors(a),o=t==="post"?TDt:NDt,r=[],s={};return e.forEach(a=>{if(!i.hasNode(a))throw new Error("Graph does not have node: "+a);o(a,n,s,r)}),r}function TDt(i,e,t,n){for(var o=[[i,!1]];o.length>0;){var r=o.pop();r[1]?n.push(r[0]):t.hasOwnProperty(r[0])||(t[r[0]]=!0,o.push([r[0],!0]),ixe(e(r[0]),s=>o.push([s,!1])))}}function NDt(i,e,t,n){for(var o=[i];o.length>0;){var r=o.pop();t.hasOwnProperty(r)||(t[r]=!0,n.push(r),ixe(e(r),s=>o.push(s)))}}function ixe(i,e){for(var t=i.length;t--;)e(i[t],t,i);return i}var RDt=nxe,MDt=ADt;function ADt(i,e){return RDt(i,e,"post")}var PDt=nxe,ODt=FDt;function FDt(i,e){return PDt(i,e,"pre")}var BDt=UY,WDt=ZSe,VDt=HDt;function HDt(i,e){var t=new BDt,n={},o=new WDt,r;function s(l){var c=l.v===r?l.w:l.v,u=o.priority(c);if(u!==void 0){var d=e(l);d0;){if(r=o.removeMin(),n.hasOwnProperty(r))t.setEdge(r,n[r]);else{if(a)throw new Error("Input graph is not connected: "+i);a=!0}i.nodeEdges(r).forEach(s)}return t}var $Dt={components:cDt,dijkstra:QSe,dijkstraAll:vDt,findCycles:wDt,floydWarshall:SDt,isAcyclic:DDt,postorder:MDt,preorder:ODt,prim:VDt,tarjan:JSe,topsort:txe},cue=nDt,uh={Graph:cue.Graph,json:oDt,alg:$Dt,version:cue.version};class zDt{constructor(){let e={};e._next=e._prev=e,this._sentinel=e}dequeue(){let e=this._sentinel,t=e._prev;if(t!==e)return uue(t),t}enqueue(e){let t=this._sentinel;e._prev&&e._next&&uue(e),e._next=t._next,t._next._prev=e,t._next=e,e._prev=t}toString(){let e=[],t=this._sentinel,n=t._prev;for(;n!==t;)e.push(JSON.stringify(n,UDt)),n=n._prev;return"["+e.join(", ")+"]"}}function uue(i){i._prev._next=i._next,i._next._prev=i._prev,delete i._next,delete i._prev}function UDt(i,e){if(i!=="_next"&&i!=="_prev")return e}var jDt=zDt;let KDt=uh.Graph,qDt=jDt;var GDt=YDt;let XDt=()=>1;function YDt(i,e){if(i.nodeCount()<=1)return[];let t=QDt(i,e||XDt);return ZDt(t.graph,t.buckets,t.zeroIdx).flatMap(o=>i.outEdges(o.v,o.w))}function ZDt(i,e,t){let n=[],o=e[e.length-1],r=e[0],s;for(;i.nodeCount();){for(;s=r.dequeue();)N7(i,e,t,s);for(;s=o.dequeue();)N7(i,e,t,s);if(i.nodeCount()){for(let a=e.length-2;a>0;--a)if(s=e[a].dequeue(),s){n=n.concat(N7(i,e,t,s,!0));break}}}return n}function N7(i,e,t,n,o){let r=o?[]:void 0;return i.inEdges(n.v).forEach(s=>{let a=i.edge(s),l=i.node(s.v);o&&r.push({v:s.v,w:s.w}),l.out-=a,JU(e,t,l)}),i.outEdges(n.v).forEach(s=>{let a=i.edge(s),l=s.w,c=i.node(l);c.in-=a,JU(e,t,c)}),i.removeNode(n.v),r}function QDt(i,e){let t=new KDt,n=0,o=0;i.nodes().forEach(a=>{t.setNode(a,{v:a,in:0,out:0})}),i.edges().forEach(a=>{let l=t.edge(a.v,a.w)||0,c=e(a),u=l+c;t.setEdge(a.v,a.w,u),o=Math.max(o,t.node(a.v).out+=c),n=Math.max(n,t.node(a.w).in+=c)});let r=JDt(o+n+3).map(()=>new qDt),s=n+1;return t.nodes().forEach(a=>{JU(r,s,t.node(a))}),{graph:t,buckets:r,zeroIdx:s}}function JU(i,e,t){t.out?t.in?i[t.out-t.in+e].enqueue(t):i[i.length-1].enqueue(t):i[0].enqueue(t)}function JDt(i){const e=[];for(let t=0;te.setNode(t,i.node(t))),i.edges().forEach(t=>{let n=e.edge(t.v,t.w)||{weight:0,minlen:1},o=i.edge(t);e.setEdge(t.v,t.w,{weight:n.weight+o.weight,minlen:Math.max(n.minlen,o.minlen)})}),e}function tkt(i){let e=new oxe({multigraph:i.isMultigraph()}).setGraph(i.graph());return i.nodes().forEach(t=>{i.children(t).length||e.setNode(t,i.node(t))}),i.edges().forEach(t=>{e.setEdge(t,i.edge(t))}),e}function nkt(i){let e=i.nodes().map(t=>{let n={};return i.outEdges(t).forEach(o=>{n[o.w]=(n[o.w]||0)+i.edge(o).weight}),n});return jY(i.nodes(),e)}function ikt(i){let e=i.nodes().map(t=>{let n={};return i.inEdges(t).forEach(o=>{n[o.v]=(n[o.v]||0)+i.edge(o).weight}),n});return jY(i.nodes(),e)}function okt(i,e){let t=i.x,n=i.y,o=e.x-t,r=e.y-n,s=i.width/2,a=i.height/2;if(!o&&!r)throw new Error("Not possible to find intersection inside of the rectangle");let l,c;return Math.abs(r)*s>Math.abs(o)*a?(r<0&&(a=-a),l=a*o/r,c=a):(o<0&&(s=-s),l=s,c=s*r/o),{x:t+l,y:n+c}}function rkt(i){let e=lxe(sxe(i)+1).map(()=>[]);return i.nodes().forEach(t=>{let n=i.node(t),o=n.rank;o!==void 0&&(e[o][n.order]=t)}),e}function skt(i){let e=Math.min(...i.nodes().map(t=>{let n=i.node(t).rank;return n===void 0?Number.MAX_VALUE:n}));i.nodes().forEach(t=>{let n=i.node(t);n.hasOwnProperty("rank")&&(n.rank-=e)})}function akt(i){let e=Math.min(...i.nodes().map(r=>i.node(r).rank)),t=[];i.nodes().forEach(r=>{let s=i.node(r).rank-e;t[s]||(t[s]=[]),t[s].push(r)});let n=0,o=i.graph().nodeRankFactor;Array.from(t).forEach((r,s)=>{r===void 0&&s%o!==0?--n:r!==void 0&&n&&r.forEach(a=>i.node(a).rank+=n)})}function lkt(i,e,t,n){let o={width:0,height:0};return arguments.length>=4&&(o.rank=t,o.order=n),rxe(i,"border",o,e)}function sxe(i){return Math.max(...i.nodes().map(e=>{let t=i.node(e).rank;return t===void 0?Number.MIN_VALUE:t}))}function ckt(i,e){let t={lhs:[],rhs:[]};return i.forEach(n=>{e(n)?t.lhs.push(n):t.rhs.push(n)}),t}function ukt(i,e){let t=Date.now();try{return e()}finally{console.log(i+" time: "+(Date.now()-t)+"ms")}}function dkt(i,e){return e()}let hkt=0;function axe(i){var e=++hkt;return toString(i)+e}function lxe(i,e,t=1){e==null&&(e=i,i=0);let n=r=>ren[e]),Object.entries(i).reduce((n,[o,r])=>(n[o]=t(r,o),n),{})}function jY(i,e){return i.reduce((t,n,o)=>(t[n]=e[o],t),{})}let pkt=GDt,mkt=Es.uniqueId;var vkt={run:_kt,undo:Ckt};function _kt(i){(i.graph().acyclicer==="greedy"?pkt(i,t(i)):bkt(i)).forEach(n=>{let o=i.edge(n);i.removeEdge(n),o.forwardName=n.name,o.reversed=!0,i.setEdge(n.w,n.v,o,mkt("rev"))});function t(n){return o=>n.edge(o).weight}}function bkt(i){let e=[],t={},n={};function o(r){n.hasOwnProperty(r)||(n[r]=!0,t[r]=!0,i.outEdges(r).forEach(s=>{t.hasOwnProperty(s.w)?e.push(s):o(s.w)}),delete t[r])}return i.nodes().forEach(o),e}function Ckt(i){i.edges().forEach(e=>{let t=i.edge(e);if(t.reversed){i.removeEdge(e);let n=t.forwardName;delete t.reversed,delete t.forwardName,i.setEdge(e.w,e.v,t,n)}})}let wkt=Es;var ykt={run:Skt,undo:Lkt};function Skt(i){i.graph().dummyChains=[],i.edges().forEach(e=>xkt(i,e))}function xkt(i,e){let t=e.v,n=i.node(t).rank,o=e.w,r=i.node(o).rank,s=e.name,a=i.edge(e),l=a.labelRank;if(r===n+1)return;i.removeEdge(e);let c,u,d;for(d=0,++n;n{let t=i.node(e),n=t.edgeLabel,o;for(i.setEdge(t.edgeObj,n);t.dummy;)o=i.successors(e)[0],i.removeNode(e),n.points.push({x:t.x,y:t.y}),t.dummy==="edge-label"&&(n.x=t.x,n.y=t.y,n.width=t.width,n.height=t.height),e=o,t=i.node(e)})}var n3={longestPath:Ekt,slack:Dkt};function Ekt(i){var e={};function t(n){var o=i.node(n);if(e.hasOwnProperty(n))return o.rank;e[n]=!0;var r=Math.min(...i.outEdges(n).map(s=>s==null?Number.POSITIVE_INFINITY:t(s.w)-i.edge(s).minlen));return r===Number.POSITIVE_INFINITY&&(r=0),o.rank=r}i.sources().forEach(t)}function Dkt(i,e){return i.node(e.w).rank-i.node(e.v).rank-i.edge(e).minlen}var kkt=uh.Graph,MO=n3.slack,cxe=Ikt;function Ikt(i){var e=new kkt({directed:!1}),t=i.nodes()[0],n=i.nodeCount();e.setNode(t,{});for(var o,r;Tkt(e,i){var r=o.v,s=n===r?o.w:r;!i.hasNode(s)&&!MO(e,o)&&(i.setNode(s,{}),i.setEdge(n,s,{}),t(s))})}return i.nodes().forEach(t),i.nodeCount()}function Nkt(i,e){return e.edges().reduce((n,o)=>{let r=Number.POSITIVE_INFINITY;return i.hasNode(o.v)!==i.hasNode(o.w)&&(r=MO(e,o)),re.node(n).rank+=t)}var Mkt=cxe,due=n3.slack,Akt=n3.longestPath,Pkt=uh.alg.preorder,Okt=uh.alg.postorder,Fkt=Es.simplify,Bkt=t1;t1.initLowLimValues=qY;t1.initCutValues=KY;t1.calcCutValue=uxe;t1.leaveEdge=hxe;t1.enterEdge=fxe;t1.exchangeEdges=gxe;function t1(i){i=Fkt(i),Akt(i);var e=Mkt(i);qY(e),KY(e,i);for(var t,n;t=hxe(e);)n=fxe(e,i,t),gxe(e,i,t,n)}function KY(i,e){var t=Okt(i,i.nodes());t=t.slice(0,t.length-1),t.forEach(n=>Wkt(i,e,n))}function Wkt(i,e,t){var n=i.node(t),o=n.parent;i.edge(t,o).cutvalue=uxe(i,e,t)}function uxe(i,e,t){var n=i.node(t),o=n.parent,r=!0,s=e.edge(t,o),a=0;return s||(r=!1,s=e.edge(o,t)),a=s.weight,e.nodeEdges(t).forEach(l=>{var c=l.v===t,u=c?l.w:l.v;if(u!==o){var d=c===r,h=e.edge(l).weight;if(a+=d?h:-h,Hkt(i,t,u)){var f=i.edge(t,u).cutvalue;a+=d?-f:f}}}),a}function qY(i,e){arguments.length<2&&(e=i.nodes()[0]),dxe(i,{},1,e)}function dxe(i,e,t,n,o){var r=t,s=i.node(n);return e[n]=!0,i.neighbors(n).forEach(a=>{e.hasOwnProperty(a)||(t=dxe(i,e,t,a,n))}),s.low=r,s.lim=t++,o?s.parent=o:delete s.parent,t}function hxe(i){return i.edges().find(e=>i.edge(e).cutvalue<0)}function fxe(i,e,t){var n=t.v,o=t.w;e.hasEdge(n,o)||(n=t.w,o=t.v);var r=i.node(n),s=i.node(o),a=r,l=!1;r.lim>s.lim&&(a=s,l=!0);var c=e.edges().filter(u=>l===hue(i,i.node(u.v),a)&&l!==hue(i,i.node(u.w),a));return c.reduce((u,d)=>due(e,d)!e.node(o).parent),n=Pkt(i,t);n=n.slice(1),n.forEach(o=>{var r=i.node(o).parent,s=e.edge(o,r),a=!1;s||(s=e.edge(r,o),a=!0),e.node(o).rank=e.node(r).rank+(a?s.minlen:-s.minlen)})}function Hkt(i,e,t){return i.hasEdge(e,t)}function hue(i,e,t){return t.low<=e.lim&&e.lim<=t.lim}var $kt=n3,pxe=$kt.longestPath,zkt=cxe,Ukt=Bkt,jkt=Kkt;function Kkt(i){switch(i.graph().ranker){case"network-simplex":fue(i);break;case"tight-tree":Gkt(i);break;case"longest-path":qkt(i);break;default:fue(i)}}var qkt=pxe;function Gkt(i){pxe(i),zkt(i)}function fue(i){Ukt(i)}var Xkt=Ykt;function Ykt(i){let e=Qkt(i);i.graph().dummyChains.forEach(t=>{let n=i.node(t),o=n.edgeObj,r=Zkt(i,e,o.v,o.w),s=r.path,a=r.lca,l=0,c=s[l],u=!0;for(;t!==o.w;){if(n=i.node(t),u){for(;(c=s[l])!==a&&i.node(c).maxRanks||a>e[l].lim));for(c=l,l=n;(l=i.parent(l))!==c;)r.push(l);return{path:o.concat(r.reverse()),lca:c}}function Qkt(i){let e={},t=0;function n(o){let r=t;i.children(o).forEach(n),e[o]={low:r,lim:t++}}return i.children().forEach(n),e}let ej=Es;var Jkt={run:eIt,cleanup:iIt};function eIt(i){let e=ej.addDummyNode(i,"root",{},"_root"),t=tIt(i),n=Math.max(...Object.values(t))-1,o=2*n+1;i.graph().nestingRoot=e,i.edges().forEach(s=>i.edge(s).minlen*=o);let r=nIt(i)+1;i.children().forEach(s=>mxe(i,e,o,r,n,t,s)),i.graph().nodeRankFactor=o}function mxe(i,e,t,n,o,r,s){let a=i.children(s);if(!a.length){s!==e&&i.setEdge(e,s,{weight:0,minlen:t});return}let l=ej.addBorderNode(i,"_bt"),c=ej.addBorderNode(i,"_bb"),u=i.node(s);i.setParent(l,s),u.borderTop=l,i.setParent(c,s),u.borderBottom=c,a.forEach(d=>{mxe(i,e,t,n,o,r,d);let h=i.node(d),f=h.borderTop?h.borderTop:d,g=h.borderBottom?h.borderBottom:d,p=h.borderTop?n:2*n,v=f!==g?1:o-r[s]+1;i.setEdge(l,f,{weight:p,minlen:v,nestingEdge:!0}),i.setEdge(g,c,{weight:p,minlen:v,nestingEdge:!0})}),i.parent(s)||i.setEdge(e,l,{weight:0,minlen:o+r[s]})}function tIt(i){var e={};function t(n,o){var r=i.children(n);r&&r.length&&r.forEach(s=>t(s,o+1)),e[n]=o}return i.children().forEach(n=>t(n,1)),e}function nIt(i){return i.edges().reduce((e,t)=>e+i.edge(t).weight,0)}function iIt(i){var e=i.graph();i.removeNode(e.nestingRoot),delete e.nestingRoot,i.edges().forEach(t=>{var n=i.edge(t);n.nestingEdge&&i.removeEdge(t)})}let oIt=Es;var rIt=sIt;function sIt(i){function e(t){let n=i.children(t),o=i.node(t);if(n.length&&n.forEach(e),o.hasOwnProperty("minRank")){o.borderLeft=[],o.borderRight=[];for(let r=o.minRank,s=o.maxRank+1;rpue(i.node(e))),i.edges().forEach(e=>pue(i.edge(e)))}function pue(i){let e=i.width;i.width=i.height,i.height=e}function uIt(i){i.nodes().forEach(e=>R7(i.node(e))),i.edges().forEach(e=>{let t=i.edge(e);t.points.forEach(R7),t.hasOwnProperty("y")&&R7(t)})}function R7(i){i.y=-i.y}function dIt(i){i.nodes().forEach(e=>M7(i.node(e))),i.edges().forEach(e=>{let t=i.edge(e);t.points.forEach(M7),t.hasOwnProperty("x")&&M7(t)})}function M7(i){let e=i.x;i.x=i.y,i.y=e}let hIt=Es;var fIt=gIt;function gIt(i){let e={},t=i.nodes().filter(a=>!i.children(a).length),n=Math.max(...t.map(a=>i.node(a).rank)),o=hIt.range(n+1).map(()=>[]);function r(a){if(e[a])return;e[a]=!0;let l=i.node(a);o[l.rank].push(a),i.successors(a).forEach(r)}return t.sort((a,l)=>i.node(a).rank-i.node(l).rank).forEach(r),o}let pIt=Es.zipObject;var mIt=vIt;function vIt(i,e){let t=0;for(let n=1;nu)),o=e.flatMap(c=>i.outEdges(c).map(u=>({pos:n[u.w],weight:i.edge(u).weight})).sort((u,d)=>u.pos-d.pos)),r=1;for(;r{let u=c.pos+r;a[u]+=c.weight;let d=0;for(;u>0;)u%2&&(d+=a[u+1]),u=u-1>>1,a[u]+=c.weight;l+=c.weight*d}),l}var bIt=CIt;function CIt(i,e=[]){return e.map(t=>{let n=i.inEdges(t);if(n.length){let o=n.reduce((r,s)=>{let a=i.edge(s),l=i.node(s.v);return{sum:r.sum+a.weight*l.order,weight:r.weight+a.weight}},{sum:0,weight:0});return{v:t,barycenter:o.sum/o.weight,weight:o.weight}}else return{v:t}})}let wIt=Es;var yIt=SIt;function SIt(i,e){let t={};i.forEach((o,r)=>{let s=t[o.v]={indegree:0,in:[],out:[],vs:[o.v],i:r};o.barycenter!==void 0&&(s.barycenter=o.barycenter,s.weight=o.weight)}),e.edges().forEach(o=>{let r=t[o.v],s=t[o.w];r!==void 0&&s!==void 0&&(s.indegree++,r.out.push(t[o.w]))});let n=Object.values(t).filter(o=>!o.indegree);return xIt(n)}function xIt(i){let e=[];function t(o){return r=>{r.merged||(r.barycenter===void 0||o.barycenter===void 0||r.barycenter>=o.barycenter)&&LIt(o,r)}}function n(o){return r=>{r.in.push(o),--r.indegree===0&&i.push(r)}}for(;i.length;){let o=i.pop();e.push(o),o.in.reverse().forEach(t(o)),o.out.forEach(n(o))}return e.filter(o=>!o.merged).map(o=>wIt.pick(o,["vs","i","barycenter","weight"]))}function LIt(i,e){let t=0,n=0;i.weight&&(t+=i.barycenter*i.weight,n+=i.weight),e.weight&&(t+=e.barycenter*e.weight,n+=e.weight),i.vs=e.vs.concat(i.vs),i.barycenter=t/n,i.weight=n,i.i=Math.min(e.i,i.i),e.merged=!0}let EIt=Es;var DIt=kIt;function kIt(i,e){let t=EIt.partition(i,u=>u.hasOwnProperty("barycenter")),n=t.lhs,o=t.rhs.sort((u,d)=>d.i-u.i),r=[],s=0,a=0,l=0;n.sort(IIt(!!e)),l=mue(r,o,l),n.forEach(u=>{l+=u.vs.length,r.push(u.vs),s+=u.barycenter*u.weight,a+=u.weight,l=mue(r,o,l)});let c={vs:r.flat(!0)};return a&&(c.barycenter=s/a,c.weight=a),c}function mue(i,e,t){let n;for(;e.length&&(n=e[e.length-1]).i<=t;)e.pop(),i.push(n.vs),t++;return t}function IIt(i){return(e,t)=>e.barycentert.barycenter?1:i?t.i-e.i:e.i-t.i}let TIt=bIt,NIt=yIt,RIt=DIt;var MIt=_xe;function _xe(i,e,t,n){let o=i.children(e),r=i.node(e),s=r?r.borderLeft:void 0,a=r?r.borderRight:void 0,l={};s&&(o=o.filter(h=>h!==s&&h!==a));let c=TIt(i,o);c.forEach(h=>{if(i.children(h.v).length){let f=_xe(i,h.v,t,n);l[h.v]=f,f.hasOwnProperty("barycenter")&&PIt(h,f)}});let u=NIt(c,t);AIt(u,l);let d=RIt(u,n);if(s&&(d.vs=[s,d.vs,a].flat(!0),i.predecessors(s).length)){let h=i.node(i.predecessors(s)[0]),f=i.node(i.predecessors(a)[0]);d.hasOwnProperty("barycenter")||(d.barycenter=0,d.weight=0),d.barycenter=(d.barycenter*d.weight+h.order+f.order)/(d.weight+2),d.weight+=2}return d}function AIt(i,e){i.forEach(t=>{t.vs=t.vs.flatMap(n=>e[n]?e[n].vs:n)})}function PIt(i,e){i.barycenter!==void 0?(i.barycenter=(i.barycenter*i.weight+e.barycenter*e.weight)/(i.weight+e.weight),i.weight+=e.weight):(i.barycenter=e.barycenter,i.weight=e.weight)}let OIt=uh.Graph,FIt=Es;var BIt=WIt;function WIt(i,e,t){let n=VIt(i),o=new OIt({compound:!0}).setGraph({root:n}).setDefaultNodeLabel(r=>i.node(r));return i.nodes().forEach(r=>{let s=i.node(r),a=i.parent(r);(s.rank===e||s.minRank<=e&&e<=s.maxRank)&&(o.setNode(r),o.setParent(r,a||n),i[t](r).forEach(l=>{let c=l.v===r?l.w:l.v,u=o.edge(c,r),d=u!==void 0?u.weight:0;o.setEdge(c,r,{weight:i.edge(l).weight+d})}),s.hasOwnProperty("minRank")&&o.setNode(r,{borderLeft:s.borderLeft[e],borderRight:s.borderRight[e]}))}),o}function VIt(i){for(var e;i.hasNode(e=FIt.uniqueId("_root")););return e}var HIt=$It;function $It(i,e,t){let n={},o;t.forEach(r=>{let s=i.parent(r),a,l;for(;s;){if(a=i.parent(s),a?(l=n[a],n[a]=s):(l=o,o=s),l&&l!==s){e.setEdge(l,s);return}s=a}})}let zIt=fIt,UIt=mIt,jIt=MIt,KIt=BIt,qIt=HIt,GIt=uh.Graph,mR=Es;var XIt=YIt;function YIt(i){let e=mR.maxRank(i),t=vue(i,mR.range(1,e+1),"inEdges"),n=vue(i,mR.range(e-1,-1,-1),"outEdges"),o=zIt(i);_ue(i,o);let r=Number.POSITIVE_INFINITY,s;for(let a=0,l=0;l<4;++a,++l){ZIt(a%2?t:n,a%4>=2),o=mR.buildLayerMatrix(i);let c=UIt(i,o);cn.node(s).order=a),qIt(n,t,r.vs)})}function _ue(i,e){Object.values(e).forEach(t=>t.forEach((n,o)=>i.node(n).order=o))}let QIt=uh.Graph,rI=Es;var JIt={positionX:nTt,findType1Conflicts:bxe,findType2Conflicts:Cxe,addConflict:GY,hasConflict:wxe,verticalAlignment:yxe,horizontalCompaction:Sxe,alignCoordinates:Lxe,findSmallestWidthAlignment:xxe,balance:Exe};function bxe(i,e){let t={};function n(o,r){let s=0,a=0,l=o.length,c=r[r.length-1];return r.forEach((u,d)=>{let h=eTt(i,u),f=h?i.node(h).order:l;(h||u===c)&&(r.slice(a,d+1).forEach(g=>{i.predecessors(g).forEach(p=>{let v=i.node(p),m=v.order;(m{u=r[d],i.node(u).dummy&&i.predecessors(u).forEach(h=>{let f=i.node(h);f.dummy&&(f.orderc)&&GY(t,h,u)})})}function o(r,s){let a=-1,l,c=0;return s.forEach((u,d)=>{if(i.node(u).dummy==="border"){let h=i.predecessors(u);h.length&&(l=i.node(h[0]).order,n(s,c,d,a,l),c=d,a=l)}n(s,c,s.length,l,r.length)}),s}return e.reduce(o),t}function eTt(i,e){if(i.node(e).dummy)return i.predecessors(e).find(t=>i.node(t).dummy)}function GY(i,e,t){if(e>t){let o=e;e=t,t=o}let n=i[e];n||(i[e]=n={}),n[t]=!0}function wxe(i,e,t){if(e>t){let n=e;e=t,t=n}return!!i[e]&&i[e].hasOwnProperty(t)}function yxe(i,e,t,n){let o={},r={},s={};return e.forEach(a=>{a.forEach((l,c)=>{o[l]=l,r[l]=l,s[l]=c})}),e.forEach(a=>{let l=-1;a.forEach(c=>{let u=n(c);if(u.length){u=u.sort((h,f)=>s[h]-s[f]);let d=(u.length-1)/2;for(let h=Math.floor(d),f=Math.ceil(d);h<=f;++h){let g=u[h];r[c]===c&&lMath.max(h,r[f.v]+s.edge(f)),0)}function u(d){let h=s.outEdges(d).reduce((g,p)=>Math.min(g,r[p.w]-s.edge(p)),Number.POSITIVE_INFINITY),f=i.node(d);h!==Number.POSITIVE_INFINITY&&f.borderType!==a&&(r[d]=Math.max(r[d],h))}return l(c,s.predecessors.bind(s)),l(u,s.successors.bind(s)),Object.keys(n).forEach(d=>r[d]=r[t[d]]),r}function tTt(i,e,t,n){let o=new QIt,r=i.graph(),s=iTt(r.nodesep,r.edgesep,n);return e.forEach(a=>{let l;a.forEach(c=>{let u=t[c];if(o.setNode(u),l){var d=t[l],h=o.edge(d,u);o.setEdge(d,u,Math.max(s(i,c,l),h||0))}l=c})}),o}function xxe(i,e){return Object.values(e).reduce((t,n)=>{let o=Number.NEGATIVE_INFINITY,r=Number.POSITIVE_INFINITY;Object.entries(n).forEach(([a,l])=>{let c=oTt(i,a)/2;o=Math.max(l+c,o),r=Math.min(l-c,r)});const s=o-r;return s{["l","r"].forEach(s=>{let a=r+s,l=i[a];if(l===e)return;let c=Object.values(l),u=n-Math.min(...c);s!=="l"&&(u=o-Math.max(...c)),u&&(i[a]=rI.mapValues(l,d=>d+u))})})}function Exe(i,e){return rI.mapValues(i.ul,(t,n)=>{if(e)return i[e.toLowerCase()][n];{let o=Object.values(i).map(r=>r[n]).sort((r,s)=>r-s);return(o[1]+o[2])/2}})}function nTt(i){let e=rI.buildLayerMatrix(i),t=Object.assign(bxe(i,e),Cxe(i,e)),n={},o;["u","d"].forEach(s=>{o=s==="u"?e:Object.values(e).reverse(),["l","r"].forEach(a=>{a==="r"&&(o=o.map(d=>Object.values(d).reverse()));let l=(s==="u"?i.predecessors:i.successors).bind(i),c=yxe(i,o,t,l),u=Sxe(i,o,c.root,c.align,a==="r");a==="r"&&(u=rI.mapValues(u,d=>-d)),n[s+a]=u})});let r=xxe(i,n);return Lxe(n,r),Exe(n,i.graph().align)}function iTt(i,e,t){return(n,o,r)=>{let s=n.node(o),a=n.node(r),l=0,c;if(l+=s.width/2,s.hasOwnProperty("labelpos"))switch(s.labelpos.toLowerCase()){case"l":c=-s.width/2;break;case"r":c=s.width/2;break}if(c&&(l+=t?c:-c),c=0,l+=(s.dummy?e:i)/2,l+=(a.dummy?e:i)/2,l+=a.width/2,a.hasOwnProperty("labelpos"))switch(a.labelpos.toLowerCase()){case"l":c=a.width/2;break;case"r":c=-a.width/2;break}return c&&(l+=t?c:-c),c=0,l}}function oTt(i,e){return i.node(e).width}let Dxe=Es,rTt=JIt.positionX;var sTt=aTt;function aTt(i){i=Dxe.asNonCompoundGraph(i),lTt(i),Object.entries(rTt(i)).forEach(([e,t])=>i.node(e).x=t)}function lTt(i){let e=Dxe.buildLayerMatrix(i),t=i.graph().ranksep,n=0;e.forEach(o=>{const r=o.reduce((s,a)=>{const l=i.node(a).height;return s>l?s:l},0);o.forEach(s=>i.node(s).y=n+r/2),n+=r+t})}let bue=vkt,Cue=ykt,cTt=jkt,uTt=Es.normalizeRanks,dTt=Xkt,hTt=Es.removeEmptyRanks,wue=Jkt,fTt=rIt,yue=aIt,gTt=XIt,pTt=sTt,Wu=Es,mTt=uh.Graph;var vTt=_Tt;function _Tt(i,e){let t=e&&e.debugTiming?Wu.time:Wu.notime;t("layout",()=>{let n=t(" buildLayoutGraph",()=>kTt(i));t(" runLayout",()=>bTt(n,t)),t(" updateInputGraph",()=>CTt(i,n))})}function bTt(i,e){e(" makeSpaceForEdgeLabels",()=>ITt(i)),e(" removeSelfEdges",()=>BTt(i)),e(" acyclic",()=>bue.run(i)),e(" nestingGraph.run",()=>wue.run(i)),e(" rank",()=>cTt(Wu.asNonCompoundGraph(i))),e(" injectEdgeLabelProxies",()=>TTt(i)),e(" removeEmptyRanks",()=>hTt(i)),e(" nestingGraph.cleanup",()=>wue.cleanup(i)),e(" normalizeRanks",()=>uTt(i)),e(" assignRankMinMax",()=>NTt(i)),e(" removeEdgeLabelProxies",()=>RTt(i)),e(" normalize.run",()=>Cue.run(i)),e(" parentDummyChains",()=>dTt(i)),e(" addBorderSegments",()=>fTt(i)),e(" order",()=>gTt(i)),e(" insertSelfEdges",()=>WTt(i)),e(" adjustCoordinateSystem",()=>yue.adjust(i)),e(" position",()=>pTt(i)),e(" positionSelfEdges",()=>VTt(i)),e(" removeBorderNodes",()=>FTt(i)),e(" normalize.undo",()=>Cue.undo(i)),e(" fixupEdgeLabelCoords",()=>PTt(i)),e(" undoCoordinateSystem",()=>yue.undo(i)),e(" translateGraph",()=>MTt(i)),e(" assignNodeIntersects",()=>ATt(i)),e(" reversePoints",()=>OTt(i)),e(" acyclic.undo",()=>bue.undo(i))}function CTt(i,e){i.nodes().forEach(t=>{let n=i.node(t),o=e.node(t);n&&(n.x=o.x,n.y=o.y,n.rank=o.rank,e.children(t).length&&(n.width=o.width,n.height=o.height))}),i.edges().forEach(t=>{let n=i.edge(t),o=e.edge(t);n.points=o.points,o.hasOwnProperty("x")&&(n.x=o.x,n.y=o.y)}),i.graph().width=e.graph().width,i.graph().height=e.graph().height}let wTt=["nodesep","edgesep","ranksep","marginx","marginy"],yTt={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},STt=["acyclicer","ranker","rankdir","align"],xTt=["width","height"],Sue={width:0,height:0},LTt=["minlen","weight","width","height","labeloffset"],ETt={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},DTt=["labelpos"];function kTt(i){let e=new mTt({multigraph:!0,compound:!0}),t=P7(i.graph());return e.setGraph(Object.assign({},yTt,A7(t,wTt),Wu.pick(t,STt))),i.nodes().forEach(n=>{let o=P7(i.node(n));const r=A7(o,xTt);Object.keys(Sue).forEach(s=>{r[s]===void 0&&(r[s]=Sue[s])}),e.setNode(n,r),e.setParent(n,i.parent(n))}),i.edges().forEach(n=>{let o=P7(i.edge(n));e.setEdge(n,Object.assign({},ETt,A7(o,LTt),Wu.pick(o,DTt)))}),e}function ITt(i){let e=i.graph();e.ranksep/=2,i.edges().forEach(t=>{let n=i.edge(t);n.minlen*=2,n.labelpos.toLowerCase()!=="c"&&(e.rankdir==="TB"||e.rankdir==="BT"?n.width+=n.labeloffset:n.height+=n.labeloffset)})}function TTt(i){i.edges().forEach(e=>{let t=i.edge(e);if(t.width&&t.height){let n=i.node(e.v),r={rank:(i.node(e.w).rank-n.rank)/2+n.rank,e};Wu.addDummyNode(i,"edge-proxy",r,"_ep")}})}function NTt(i){let e=0;i.nodes().forEach(t=>{let n=i.node(t);n.borderTop&&(n.minRank=i.node(n.borderTop).rank,n.maxRank=i.node(n.borderBottom).rank,e=Math.max(e,n.maxRank))}),i.graph().maxRank=e}function RTt(i){i.nodes().forEach(e=>{let t=i.node(e);t.dummy==="edge-proxy"&&(i.edge(t.e).labelRank=t.rank,i.removeNode(e))})}function MTt(i){let e=Number.POSITIVE_INFINITY,t=0,n=Number.POSITIVE_INFINITY,o=0,r=i.graph(),s=r.marginx||0,a=r.marginy||0;function l(c){let u=c.x,d=c.y,h=c.width,f=c.height;e=Math.min(e,u-h/2),t=Math.max(t,u+h/2),n=Math.min(n,d-f/2),o=Math.max(o,d+f/2)}i.nodes().forEach(c=>l(i.node(c))),i.edges().forEach(c=>{let u=i.edge(c);u.hasOwnProperty("x")&&l(u)}),e-=s,n-=a,i.nodes().forEach(c=>{let u=i.node(c);u.x-=e,u.y-=n}),i.edges().forEach(c=>{let u=i.edge(c);u.points.forEach(d=>{d.x-=e,d.y-=n}),u.hasOwnProperty("x")&&(u.x-=e),u.hasOwnProperty("y")&&(u.y-=n)}),r.width=t-e+s,r.height=o-n+a}function ATt(i){i.edges().forEach(e=>{let t=i.edge(e),n=i.node(e.v),o=i.node(e.w),r,s;t.points?(r=t.points[0],s=t.points[t.points.length-1]):(t.points=[],r=o,s=n),t.points.unshift(Wu.intersectRect(n,r)),t.points.push(Wu.intersectRect(o,s))})}function PTt(i){i.edges().forEach(e=>{let t=i.edge(e);if(t.hasOwnProperty("x"))switch((t.labelpos==="l"||t.labelpos==="r")&&(t.width-=t.labeloffset),t.labelpos){case"l":t.x-=t.width/2+t.labeloffset;break;case"r":t.x+=t.width/2+t.labeloffset;break}})}function OTt(i){i.edges().forEach(e=>{let t=i.edge(e);t.reversed&&t.points.reverse()})}function FTt(i){i.nodes().forEach(e=>{if(i.children(e).length){let t=i.node(e),n=i.node(t.borderTop),o=i.node(t.borderBottom),r=i.node(t.borderLeft[t.borderLeft.length-1]),s=i.node(t.borderRight[t.borderRight.length-1]);t.width=Math.abs(s.x-r.x),t.height=Math.abs(o.y-n.y),t.x=r.x+t.width/2,t.y=n.y+t.height/2}}),i.nodes().forEach(e=>{i.node(e).dummy==="border"&&i.removeNode(e)})}function BTt(i){i.edges().forEach(e=>{if(e.v===e.w){var t=i.node(e.v);t.selfEdges||(t.selfEdges=[]),t.selfEdges.push({e,label:i.edge(e)}),i.removeEdge(e)}})}function WTt(i){var e=Wu.buildLayerMatrix(i);e.forEach(t=>{var n=0;t.forEach((o,r)=>{var s=i.node(o);s.order=r+n,(s.selfEdges||[]).forEach(a=>{Wu.addDummyNode(i,"selfedge",{width:a.label.width,height:a.label.height,rank:s.rank,order:r+ ++n,e:a.e,label:a.label},"_se")}),delete s.selfEdges})})}function VTt(i){i.nodes().forEach(e=>{var t=i.node(e);if(t.dummy==="selfedge"){var n=i.node(t.e.v),o=n.x+n.width/2,r=n.y,s=t.x-o,a=n.height/2;i.setEdge(t.e,t.label),i.removeNode(e),t.label.points=[{x:o+2*s/3,y:r-a},{x:o+5*s/6,y:r-a},{x:o+s,y:r},{x:o+5*s/6,y:r+a},{x:o+2*s/3,y:r+a}],t.label.x=t.x,t.label.y=t.y}})}function A7(i,e){return Wu.mapValues(Wu.pick(i,e),Number)}function P7(i){var e={};return i&&Object.entries(i).forEach(([t,n])=>{typeof t=="string"&&(t=t.toLowerCase()),e[t]=n}),e}let HTt=Es,$Tt=uh.Graph;var zTt={debugOrdering:UTt};function UTt(i){let e=HTt.buildLayerMatrix(i),t=new $Tt({compound:!0,multigraph:!0}).setGraph({});return i.nodes().forEach(n=>{t.setNode(n,{label:n}),t.setParent(n,"layer"+i.node(n).rank)}),i.edges().forEach(n=>t.setEdge(n.v,n.w,{},n.name)),e.forEach((n,o)=>{let r="layer"+o;t.setNode(r,{rank:"same"}),n.reduce((s,a)=>(t.setEdge(s,a,{style:"invis"}),a))}),t}var jTt="1.0.4",xue={graphlib:uh,layout:vTt,debug:zTt,util:{time:Es.time,notime:Es.notime},version:jTt};const KTt="_container_zefjd_1",qTt="_label_zefjd_9",GTt="_content_zefjd_12",XTt="_selected_zefjd_27",YTt="_node__title_zefjd_30";var L_={container:KTt,label:qTt,content:GTt,selected:XTt,node__title:YTt,"node__operator-description":"_node__operator-description_zefjd_35","value-container":"_value-container_zefjd_38"};const ZTt="_container_1ergx_11",QTt="_wrapper_1ergx_16";var vR={"port-type-container":"_port-type-container_1ergx_1","port-type-label":"_port-type-label_1ergx_6",container:ZTt,wrapper:QTt,"add-button":"_add-button_1ergx_19"};function JTt(i){var s,a;const{node:e}=i,t=(s=e==null?void 0:e.data)==null?void 0:s.endPointOptions,{updateNode:n}=t3(),o=xr(e);function r(l){return l.type!=="source"&&l.type!=="target"?vn("div",{children:["unknown type: ",l.type]},l.id):vn("div",{style:{position:"relative"},children:[fe("div",{style:{textAlign:l.type==="source"?"right":"left"},children:l.label||l.variableName}),fe(aD,{type:l.type,position:l.type==="source"?pn.Right:pn.Left,id:l.id,isConnectable:!0})]},l.id)}return!((a=t==null?void 0:t.endPointList)!=null&&a.length)||!o?null:fe("div",{className:vR.container,children:t.endPointList.map(l=>{var c,u;return l.type==="group"?!((c=l.children)!=null&&c.length)&&!l.allowAddAndRemoveChildren?null:vn("div",{children:[vn("div",{className:vR["port-type-container"],children:[fe("div",{className:vR["port-type-label"],children:l.label}),(u=l.children)==null?void 0:u.map(d=>r(d))]}),l.allowAddAndRemoveChildren&&fe("span",{className:vR["add-button"],onClick:()=>{!(e!=null&&e.id)||n(e==null?void 0:e.id,d=>(l.children=(l.children||[]).concat(ri.createFromGroup(l)),o.updateData(d,{})))},children:"add"})]},l.id):r(l)})})}function eNt(i){var c,u;const e=xr(i),{currentStateRef:t,actionsRef:n}=e3(),{selected:o,data:r}=i,s=(c=e==null?void 0:e.getNodeProps)==null?void 0:c.call(e,i);function a(){var h;if(!(s!=null&&s.showValue))return null;const d=(h=s==null?void 0:s.getBriefValue)==null?void 0:h.call(s);return d?fe("div",{className:L_["value-container"],onClick:()=>{var f;d.hasDetail&&Xa.info(((f=s==null?void 0:s.getDetailValue)==null?void 0:f.call(s))||"")},children:d.value}):null}const l=a();return vn("div",{className:Ue(L_.container,{[L_.selected]:o}),style:{"--color-node-theme":(e==null?void 0:e.nodeColor)||void 0},onClick:()=>{e==null||e.onNodeFocus({node:i,currentState:t.current,actions:n.current})},children:[fe("div",{className:L_.label,children:(r==null?void 0:r.nodeLabel)||(r==null?void 0:r.operatorName)}),vn("div",{className:L_.content,onDoubleClick:()=>{e==null||e.onNodeDoubleClick({node:i,currentState:t.current,actions:n.current})},children:[vn("div",{className:L_.node__title,children:[(e==null?void 0:e.description)&&fe("div",{className:L_["node__operator-description"],children:e==null?void 0:e.description}),l&&fe("div",{children:l}),((u=e==null?void 0:e.renderCustomLabel)==null?void 0:u.call(e,i))||null]}),fe(JTt,{node:i})]})]},i.id)}const tNt={[kf.Node]:eNt};var nNt={"main-flow":"_main-flow_acc5o_1"};function iNt(){const[i,e]=mu(n=>{const o=wc(n.layer,n.activeLayerId),r=o!=null&&o.parentLayerId?wc(n.layer,o==null?void 0:o.parentLayerId):void 0;return[r==null?void 0:r.id,r==null?void 0:r.name]}),{setActiveLayerId:t}=t3();return fe(Ds,{children:i&&vn(Bs,{type:"text",style:{color:"white"},onClick:()=>{t(i)},children:["\u8FD4\u56DE ",e||i]})})}const oNt=i=>{const e=xr(i);return e!=null&&e.nodeColor?e==null?void 0:e.nodeColor:"#ff0072"},rNt=(i,e)=>{const t=new xue.graphlib.Graph().setDefaultEdgeLabel(()=>({}));return t.setGraph({rankdir:"LR"}),e.forEach(n=>t.setEdge(n.source,n.target)),i.forEach(n=>t.setNode(n.id,{...n,width:n.width||void 0,height:n.height||void 0})),xue.layout(t),{nodes:i.map(n=>{const{x:o,y:r}=t.node(n.id);return{...n,position:{x:o,y:r}}}),edges:e}},sNt=()=>{const{nodes:i,edges:e,setNodes:t,setEdges:n}=ET(),{actionsRef:o,currentStateRef:r}=e3(),s=mo(v=>v.addSelectedEdges),a=v=>{console.log("connection",v),n(m=>ufe(v,m).filter(_=>!(MB(_)&&!fFe(_,v)&&hFe(_,v)))),setTimeout(()=>{const m=e.find(_=>{const w=v;return MB(_)&&_.source===w.source&&_.target===w.target&&(_.sourceHandle===w.sourceHandle||!_.sourceHandle&&!w.sourceHandle)&&(_.targetHandle===w.targetHandle||!_.targetHandle&&!w.targetHandle)});s([m].filter(_=>Boolean(_)).map(_=>_.id))})},l=x.exports.useRef(null),c=mo(v=>v.updateNodePositions),u=x.exports.useRef([]);mo(v=>(u.current=v.getNodes(),u));const d=v=>{var _;const m=v.dataTransfer.getData(GU);if(m){const w=Yve(m);if(w){const y=w.create();if(w.isUnique&&i.find(I=>{var k;return((k=I.data)==null?void 0:k.operatorType)===w.operatorType})){Xa.warning(`\u53EA\u5141\u8BB8\u5B58\u5728\u4E00\u4E2A${w.operatorName}`);return}const{clientX:L,clientY:D}=v,E=(_=l.current)==null?void 0:_.getBoundingClientRect();E&&(y.position={x:L-E.left,y:D-E.y}),t(I=>[...I,y]),setTimeout(()=>{var k,R;const I=u.current.find(A=>A.id===y.id);if(I){const A={x:((k=I==null?void 0:I.position)==null?void 0:k.x)-((I==null?void 0:I.width)||0)/2,y:I.position.y-Math.max(((I==null?void 0:I.height)||0)/5,30)};I.position=A,c([I],!1,!1)}t(A=>(A.find(N=>N.id===y.id)&&(y.style={visibility:"visible"}),[...A])),(R=w==null?void 0:w.onAfterCreate)==null||R.call(w,{node:I,currentState:r.current,actions:o.current})})}}},h=v=>{v.dataTransfer.types.includes(GU)&&v.preventDefault()},f=x.exports.useCallback(v=>{t(m=>Nfe(v,m))},[]),g=x.exports.useCallback(v=>{n(m=>w4e(v,m))},[]),p=x.exports.useCallback(()=>{const v=rNt(i,e);t([...v.nodes]),n([...v.edges])},[i,e]);return fe("div",{className:nNt["main-flow"],ref:l,onDrop:d,onDragEnter:h,onDragOver:h,children:vn(Ufe,{nodeTypes:tNt,nodes:i,edges:e,onNodesChange:f,onEdgesChange:g,onConnect:a,zoomOnScroll:!1,defaultEdgeOptions:{animated:!0},children:[fe(O5e,{variant:Du.Dots,gap:24,color:"rgba(255,255,255,0.4)",size:2}),fe(S5e,{nodeColor:oNt,nodeStrokeWidth:3,zoomable:!0,pannable:!0}),fe(T5e,{}),fe(oD,{position:"top-left",children:fe(iNt,{})}),fe(oD,{position:"top-right",children:fe(Bs,{type:"text",style:{color:"white"},onClick:()=>{p()},children:"layout"})})]})})},aNt=()=>{var u,d;const e=mu(h=>h.nodes).filter(h=>h.selected),t=(e==null?void 0:e.length)===1?e[0]:void 0,n=mu(h=>h.nodes.find(f=>f.id===(t==null?void 0:t.id))),o=(u=n==null?void 0:n.data)==null?void 0:u.operatorType,r=xr(n),s=!!t&&o,{updateEdge:a,updateNode:l,setLayer:c}=t3();return vn("div",{children:[fe("div",{children:"Attributes"}),s&&((d=r==null?void 0:r.generateAttributeControl)==null?void 0:d.call(r,{node:n,actions:{updateEdge:a,updateNode:l,setLayer:c}}))]})},lNt=()=>{var p,v,m;const{store:i,nodes:e,edges:t}=WGe(),[n,o]=x.exports.useState(),r=x.exports.useRef({}),s=new Lq(e,t),a=e.find(_=>{var w;return((w=xr(_))==null?void 0:w.operatorType)==="InputOperator"}),l=a?(p=xr(a))==null?void 0:p.getStatePort(a):[],c=a?(v=xr(a))==null?void 0:v.getEventPorts(a):[],u=e.find(_=>{var w;return((w=xr(_))==null?void 0:w.operatorType)==="OutputOperator"});x.exports.useEffect(()=>{console.log("store ==> ",i),r.current=Object.fromEntries((l==null?void 0:l.map(w=>[w.variableName,new Od(void 0)]))||[]);const _=i==null?void 0:i(r.current);console.log("init ==> ",_),o(_)},[i]),x.exports.useEffect(()=>{var w;if(!u)return;const _=(w=xr(u))==null?void 0:w.getEventPorts(u);_==null||_.forEach(y=>{var L;(L=n==null?void 0:n.output[y.variableName||""])==null||L.subscribe((D,E)=>{Xa.info(`value: ${D}`),console.log("events",y,D,E)})})},[n]);const[d,h]=x.exports.useState(""),[,f]=x.exports.useState([]),g=u?(m=xr(u))==null?void 0:m.getStatePort(u).map(_=>{var y,L;const w=(L=(y=s.findSourceNodes(u.id))==null?void 0:y.find(D=>D.handleId===_.id))==null?void 0:L.relatedHandleId;return{port:_,handleId:w}}):[];return x.exports.useEffect(()=>{g==null||g.map(({port:_})=>{var w;return(w=n==null?void 0:n.output)==null?void 0:w[_.variableName||""]}).forEach(_=>{_==null||_.subscribe((w,y)=>{console.log(w,y),f([])})})},[n]),fe("div",{style:{display:"grid",gap:16,gridAutoFlow:"column",justifyContent:"start",marginBottom:16},children:(n==null?void 0:n.output)&&vn(Ds,{children:[fe("div",{children:fe("div",{style:{display:"grid",gap:12},children:vn("div",{style:{display:"grid",gap:12},children:[l==null?void 0:l.map(_=>vn("div",{children:[_.label||_.variableName,":",fe(bD,{onChange:w=>{var L,D;const y=w.target.value;console.log("instance",n),(D=(L=r.current)==null?void 0:L[_.variableName||""])==null||D.update(Number(y),new O4)}})]},_.id)),vn("div",{children:["Event Value:",fe(bD,{value:d,onChange:_=>{h(_.target.value)},size:"small",placeholder:"\u53D1\u9001\u4E8B\u4EF6\u7684\u53C2\u6570\uFF08\u8BF7\u586B\u5199 JSON\uFF09"})]}),c==null?void 0:c.map(_=>fe(Bs,{onClick:()=>{var w,y;(y=(w=n==null?void 0:n.output)==null?void 0:w[_.variableName||""])==null||y.next(JSON.parse(d))},children:_.label||_.variableName},_.id))]})})}),vn("div",{children:[fe("div",{children:"Output"}),g==null?void 0:g.map(({port:_})=>{var w,y;return fe("div",{children:fe(CD.Item,{label:_.label||_.variableName,children:JSON.stringify((y=(w=n==null?void 0:n.output)==null?void 0:w[_.variableName||""])==null?void 0:y.current)})},_.id)})]})]})})},cNt="_editor_hp5fu_1";var uNt={editor:cNt};const dNt=()=>{const{layer:i}=IEt(),[e,t]=x.exports.useState(""),[n,o]=x.exports.useState(""),[r,s]=x.exports.useState({layer:i}),[a,l]=x.exports.useState(!1);return vn("div",{children:[fe("div",{children:"Console"}),fe("br",{}),vn("div",{style:{display:"grid",gap:16,gridAutoFlow:"column",justifyContent:"start"},children:[fe(Bs,{type:"link",onClick:()=>{console.log(new Lq(i.nodes,i.edges)),console.log({layer:i})},children:"Console Graph"}),fe(Bs,{type:"link",onClick:()=>{const c=new zie;t(c.complie({layer:i}))},children:"Compile"}),fe(Bs,{type:"link",onClick:()=>{const u=new zie().complie({layer:i});s(bc.exports.cloneDeep({layer:i})),t(u),o(u)},children:"Compile and Run"}),fe(Bs,{type:"link",disabled:!e,onClick:()=>{l(!0)},children:"Show Output"})]}),vn("div",{children:[fe("br",{}),fe(HGe,{value:n,nodes:r.layer.nodes,edges:r.layer.edges,children:fe(lNt,{})})]}),fe(Fve,{open:a,width:"100vw",style:{top:0},onOk:()=>{l(!1)},onCancel:()=>{l(!1)},children:fe(GSe,{language:"typescript",readonly:!0,className:uNt.editor,code:e})})]})},hNt="_container_1hju3_1",fNt="_main_1hju3_10",gNt="_console_1hju3_13";var Lue={container:hNt,main:fNt,console:gNt};const pNt=()=>fe("div",{className:Lue.container,children:vn(NEt,{children:[fe(ZEt,{}),fe(sNt,{}),fe(aNt,{}),fe("div",{className:Lue.console,children:fe(dNt,{})})]})});function mNt(){return fe(Ds,{children:fe(pNt,{})})}Zj.render(fe(Bt.StrictMode,{children:fe(mNt,{})}),document.getElementById("root"));export{uT as m,gwe as t}; +}`,nodeLabel:"Plus 1"},dragging:!1,width:118,height:136,selected:!0,positionAbsolute:{x:784,y:532}}],edges:[{animated:!0,source:"$flow_f0c2a254-0434-4e3c-8658-c6571c0d9d0f",sourceHandle:"3ffde193-f535-411e-8283-4616d3e29921",target:"$flow_b821e643-ec8e-4422-89a4-dbd1703a1966",targetHandle:"b85cf0aa-c815-46e5-9c82-2991ee90bde5",id:"reactflow__edge-$flow_f0c2a254-0434-4e3c-8658-c6571c0d9d0f3ffde193-f535-411e-8283-4616d3e29921-$flow_b821e643-ec8e-4422-89a4-dbd1703a1966b85cf0aa-c815-46e5-9c82-2991ee90bde5"},{animated:!0,source:"$flow_f14e69ec-b1ba-4e39-9748-5d89b7ca582f",sourceHandle:"73b965fd-7fd6-4c4c-ac31-916ab3130ab3",target:"$flow_f0c2a254-0434-4e3c-8658-c6571c0d9d0f",targetHandle:"1e005bc7-6141-458a-a28a-14e2009ee1e7",id:"reactflow__edge-$flow_f14e69ec-b1ba-4e39-9748-5d89b7ca582f73b965fd-7fd6-4c4c-ac31-916ab3130ab3-$flow_f0c2a254-0434-4e3c-8658-c6571c0d9d0f1e005bc7-6141-458a-a28a-14e2009ee1e7"},{animated:!0,source:"$flow_17f541a4-f480-45c5-a6bd-ab654945e512",sourceHandle:"5bebcd05-9d98-42e9-9679-fa5cc14bc24f",target:"$flow_f14e69ec-b1ba-4e39-9748-5d89b7ca582f",targetHandle:"b63e542a-214b-4918-9388-778413d921e3",id:"reactflow__edge-$flow_17f541a4-f480-45c5-a6bd-ab654945e5125bebcd05-9d98-42e9-9679-fa5cc14bc24f-$flow_f14e69ec-b1ba-4e39-9748-5d89b7ca582fb63e542a-214b-4918-9388-778413d921e3"},{animated:!0,source:"$flow_17f541a4-f480-45c5-a6bd-ab654945e512",sourceHandle:"8327475f-80bc-41e4-84d5-595861bb03ad",target:"$flow_f14e69ec-b1ba-4e39-9748-5d89b7ca582f",targetHandle:"8dd0dad0-0135-487d-9417-a05d5130e188",id:"reactflow__edge-$flow_17f541a4-f480-45c5-a6bd-ab654945e5128327475f-80bc-41e4-84d5-595861bb03ad-$flow_f14e69ec-b1ba-4e39-9748-5d89b7ca582f8dd0dad0-0135-487d-9417-a05d5130e188"},{animated:!0,source:"$flow_f0c2a254-0434-4e3c-8658-c6571c0d9d0f",sourceHandle:"3ffde193-f535-411e-8283-4616d3e29921",target:"$flow_a36d1f33-2e2f-4fb5-a496-1a13db60f192",targetHandle:"05b3e305-15eb-4c9f-a092-f6d8e4181236",id:"reactflow__edge-$flow_f0c2a254-0434-4e3c-8658-c6571c0d9d0f3ffde193-f535-411e-8283-4616d3e29921-$flow_a36d1f33-2e2f-4fb5-a496-1a13db60f19205b3e305-15eb-4c9f-a092-f6d8e4181236"},{animated:!0,source:"$flow_7c4ec381-82eb-418e-b299-feb1cd7c107d",sourceHandle:"5e602cc8-1454-474f-8c75-0747f7a8c19b",target:"$flow_f14e69ec-b1ba-4e39-9748-5d89b7ca582f",targetHandle:"c29b921d-acd8-4d73-9b7e-c0dbd19318c8",id:"reactflow__edge-$flow_7c4ec381-82eb-418e-b299-feb1cd7c107d5e602cc8-1454-474f-8c75-0747f7a8c19b-$flow_f14e69ec-b1ba-4e39-9748-5d89b7ca582fc29b921d-acd8-4d73-9b7e-c0dbd19318c8"},{animated:!0,source:"$flow_a36d1f33-2e2f-4fb5-a496-1a13db60f192",sourceHandle:"ce9317fd-de38-44d0-8082-87428483a6ff",target:"$flow_d02c1212-d525-4f78-8ab9-ce348eee56e6",targetHandle:"ee0cc676-e56b-4e1f-b075-2684dc50a33d",id:"reactflow__edge-$flow_a36d1f33-2e2f-4fb5-a496-1a13db60f192ce9317fd-de38-44d0-8082-87428483a6ff-$flow_d02c1212-d525-4f78-8ab9-ce348eee56e6ee0cc676-e56b-4e1f-b075-2684dc50a33d"},{animated:!0,source:"$flow_f0c2a254-0434-4e3c-8658-c6571c0d9d0f",sourceHandle:"3ffde193-f535-411e-8283-4616d3e29921",target:"$flow_d02c1212-d525-4f78-8ab9-ce348eee56e6",targetHandle:"a273cc22-9082-4ab4-a592-7df312deb4f7",id:"reactflow__edge-$flow_f0c2a254-0434-4e3c-8658-c6571c0d9d0f3ffde193-f535-411e-8283-4616d3e29921-$flow_d02c1212-d525-4f78-8ab9-ce348eee56e6a273cc22-9082-4ab4-a592-7df312deb4f7"},{animated:!0,source:"$flow_d02c1212-d525-4f78-8ab9-ce348eee56e6",sourceHandle:"2ce6eb2b-657e-4da2-b157-618523490b8b",target:"$flow_7c4ec381-82eb-418e-b299-feb1cd7c107d",targetHandle:"fb957bad-04d7-485b-bc97-b31dbf1c191b",id:"reactflow__edge-$flow_d02c1212-d525-4f78-8ab9-ce348eee56e62ce6eb2b-657e-4da2-b157-618523490b8b-$flow_7c4ec381-82eb-418e-b299-feb1cd7c107dfb957bad-04d7-485b-bc97-b31dbf1c191b"}]},R7={id:"ffcec994-0f74-4f54-aeb7-438885dbcc72",name:"App",children:[],nodes:[{position:{x:644,y:102},id:"$flow_d59e81da-225c-40d2-9103-ee3e129514fa",type:"Node",data:{operatorName:"Output",operatorType:"OutputOperator",nodeType:"Node",endPointOptions:{endPointList:[{id:"20d9f812-f682-4b09-a201-7711882af890",type:"group",variableName:"state_rpxcg",label:"State",hint:"state",children:[{id:"4dc98fc8-57b9-4c30-8425-d33e602810cd",type:"target",variableName:"state_k9vor",hint:"state"}],allowAddAndRemoveChildren:!0,defaultChildData:{type:"target",hint:"state"}},{id:"abbf9ce7-b6a2-4d08-8a5c-90a76d044964",type:"group",variableName:"event_u8t6g",label:"Event",hint:"event",children:[],allowAddAndRemoveChildren:!0,defaultChildData:{type:"target",hint:"event"}}]}},width:118,height:148,dragging:!1},{position:{x:413,y:81},id:"$flow_ba963a6d-a83c-4609-830f-48ef8d517402",type:"Node",data:{operatorName:"Sum",operatorType:"SumOperator",nodeType:"Node",endPointOptions:{endPointList:[{id:"5d36decd-40e9-4f0f-b919-4af7a33bb481",type:"source",variableName:"output_7c53x",label:"output",hint:"output"},{id:"98aa0131-1975-4cb0-9c35-46280f69a014",type:"group",variableName:"input_3wldr",hint:"input",children:[{id:"90c2a56d-c4df-4430-a4e2-cfcdb6cac3b3",type:"target",variableName:"input_zkw5x",label:"input",hint:"input"},{id:"f85709d5-0f20-4ab8-a719-03e4130d8ec3",type:"target",variableName:"input_tntx3",label:"input",hint:"input"}],allowAddAndRemoveChildren:!0,defaultChildData:{type:"target",label:"input",hint:"input"}}]}},width:118,height:136,dragging:!1,selected:!1,positionAbsolute:{x:413,y:81}},{position:{x:130,y:65},id:"$flow_cd5a79e3-ebae-4c72-833f-32a6a6d83bed",type:"Node",data:{operatorName:"Input",operatorType:"InputOperator",nodeType:"Node",endPointOptions:{endPointList:[{id:"4b6c72b1-30a9-42c8-b5df-3e37d3acc958",type:"group",variableName:"state_pq4d3",label:"State",hint:"state",children:[{id:"1ba05470-5941-4e80-9c49-11c4bc2542fd",type:"source",variableName:"state_1naae",hint:"state"},{id:"371ff3fd-e734-48d6-a05e-371ab850313a",type:"source",variableName:"state_4lmjx",hint:"state"}],allowAddAndRemoveChildren:!0,defaultChildData:{type:"source",hint:"state"}},{id:"8827904c-48b0-4409-9489-1a73fcb99a64",type:"group",variableName:"event_dlev2",label:"Event",hint:"event",children:[],allowAddAndRemoveChildren:!0,defaultChildData:{type:"source",hint:"event"}},{id:"e0c20603-88e0-4130-a583-f7cde637dff8",type:"group",variableName:"lifecycle_l5z4n",label:"Lifecycle",hint:"lifecycle",children:[{id:"bdb74a8d-d29a-4a62-8d20-ad3a1dad8450",type:"source",variableName:"beforeMount"},{id:"82a9bb07-5619-4717-8618-a8c8cc03959a",type:"source",variableName:"mount"},{id:"d8525b49-242b-4572-8bd7-399bec64b338",type:"source",variableName:"beforeUnmount"},{id:"b6d06207-e8ea-47f8-af2c-fe2c60a328de",type:"source",variableName:"unmount"}],allowAddAndRemoveChildren:!1}]}},width:118,height:248,dragging:!1,selected:!1,positionAbsolute:{x:130,y:65}}],edges:[{animated:!0,source:"$flow_cd5a79e3-ebae-4c72-833f-32a6a6d83bed",sourceHandle:"1ba05470-5941-4e80-9c49-11c4bc2542fd",target:"$flow_ba963a6d-a83c-4609-830f-48ef8d517402",targetHandle:"90c2a56d-c4df-4430-a4e2-cfcdb6cac3b3",id:"reactflow__edge-$flow_cd5a79e3-ebae-4c72-833f-32a6a6d83bed1ba05470-5941-4e80-9c49-11c4bc2542fd-$flow_ba963a6d-a83c-4609-830f-48ef8d51740290c2a56d-c4df-4430-a4e2-cfcdb6cac3b3"},{animated:!0,source:"$flow_cd5a79e3-ebae-4c72-833f-32a6a6d83bed",sourceHandle:"371ff3fd-e734-48d6-a05e-371ab850313a",target:"$flow_ba963a6d-a83c-4609-830f-48ef8d517402",targetHandle:"f85709d5-0f20-4ab8-a719-03e4130d8ec3",id:"reactflow__edge-$flow_cd5a79e3-ebae-4c72-833f-32a6a6d83bed371ff3fd-e734-48d6-a05e-371ab850313a-$flow_ba963a6d-a83c-4609-830f-48ef8d517402f85709d5-0f20-4ab8-a719-03e4130d8ec3"},{animated:!0,source:"$flow_ba963a6d-a83c-4609-830f-48ef8d517402",sourceHandle:"5d36decd-40e9-4f0f-b919-4af7a33bb481",target:"$flow_d59e81da-225c-40d2-9103-ee3e129514fa",targetHandle:"4dc98fc8-57b9-4c30-8425-d33e602810cd",id:"reactflow__edge-$flow_ba963a6d-a83c-4609-830f-48ef8d5174025d36decd-40e9-4f0f-b919-4af7a33bb481-$flow_d59e81da-225c-40d2-9103-ee3e129514fa4dc98fc8-57b9-4c30-8425-d33e602810cd"}]},axe="layer_storage";function tDt(i){localStorage.setItem(axe,JSON.stringify(i))}function nDt(){return JSON.parse(localStorage.getItem(axe)||"")}function iDt(){const{layer:i,setLayer:e,setActiveLayerId:t,setDefaultLayer:n}=kT(),{actionsRef:o,currentStateRef:r}=IT(),{operators:s,refreshOperators:a}=ZY();async function l(){try{if(i.parentLayerId){const c=wc(i,i.parentLayerId),u=c==null?void 0:c.nodes.find(d=>d.id===i.relativeNodeId);if(u){const d=fr(u);d==null||d.refreshNode({node:u,actions:o.current,currentState:r.current})}}await wFe(200),tDt({layer:r.current.layer,customOperators:s.filter(c=>c.isCustom)}),Xs.success("success")}catch(c){Xs.error(c==null?void 0:c.message)}}return fn("div",{style:{display:"grid",gridAutoFlow:"row",gap:4},children:[he(ts,{type:"text",onClick:()=>{l()},children:"Save"}),he(ts,{type:"text",onClick:()=>{try{const c=nDt(),u=c.layer;e(u),n(u),t(u.id);const d=c.customOperators.map(h=>{const f=new rxe(h.operatorName);return Object.assign(f,h),f});Nq(d),a(),Xs.success("success")}catch(c){Xs.error(c==null?void 0:c.message)}},children:"Load"}),he(ts,{type:"text",onClick:()=>{try{const c=new wI("App");e(c),n(c),t(c.id),Xs.success("success")}catch(c){Xs.error(c==null?void 0:c.message)}},children:"Reset"}),he(ts,{type:"text",onClick:()=>{console.log(i)},children:"Log"}),he(ts,{type:"text",onClick:()=>{try{e(N7),n(N7),t(N7.id),Xs.success("success")}catch(c){Xs.error(c==null?void 0:c.message)}},children:"Load Loop Demo"}),he(ts,{type:"text",onClick:()=>{try{e(R7),n(R7),t(R7.id),Xs.success("success")}catch(c){Xs.error(c==null?void 0:c.message)}},children:"Load Sum Demo"})]})}const oDt="_container_1n7r9_1";var rDt={container:oDt};function sDt(){return he("div",{className:rDt.container,children:he(lje,{size:"small",tabPosition:"left",items:[{label:he(YEt,{rev:""}),key:"Operators",children:he(JEt,{})},{label:he(KEt,{rev:""}),key:"Layers",children:he(eDt,{})},{label:he($Et,{rev:""}),key:"commands",children:he(iDt,{})}]})})}var aDt="\0",x_="\0",cue="",Il,b0,_c,sI,Uy,jy,gu,Eh,hm,Dh,fm,_g,bg,Ky,qy,Cg,fd,aI,JU;class lDt{constructor(e){Oo(this,aI);Oo(this,Il,!0);Oo(this,b0,!1);Oo(this,_c,!1);Oo(this,sI,void 0);Oo(this,Uy,()=>{});Oo(this,jy,()=>{});Oo(this,gu,{});Oo(this,Eh,{});Oo(this,hm,{});Oo(this,Dh,{});Oo(this,fm,{});Oo(this,_g,{});Oo(this,bg,{});Oo(this,Ky,0);Oo(this,qy,0);Oo(this,Cg,void 0);Oo(this,fd,void 0);e&&(au(this,Il,e.hasOwnProperty("directed")?e.directed:!0),au(this,b0,e.hasOwnProperty("multigraph")?e.multigraph:!1),au(this,_c,e.hasOwnProperty("compound")?e.compound:!1)),ht(this,_c)&&(au(this,Cg,{}),au(this,fd,{}),ht(this,fd)[x_]={})}isDirected(){return ht(this,Il)}isMultigraph(){return ht(this,b0)}isCompound(){return ht(this,_c)}setGraph(e){return au(this,sI,e),this}graph(){return ht(this,sI)}setDefaultNodeLabel(e){return au(this,Uy,e),typeof e!="function"&&au(this,Uy,()=>e),this}nodeCount(){return ht(this,Ky)}nodes(){return Object.keys(ht(this,gu))}sources(){var e=this;return this.nodes().filter(t=>Object.keys(ht(e,Eh)[t]).length===0)}sinks(){var e=this;return this.nodes().filter(t=>Object.keys(ht(e,Dh)[t]).length===0)}setNodes(e,t){var n=arguments,o=this;return e.forEach(function(r){n.length>1?o.setNode(r,t):o.setNode(r)}),this}setNode(e,t){return ht(this,gu).hasOwnProperty(e)?(arguments.length>1&&(ht(this,gu)[e]=t),this):(ht(this,gu)[e]=arguments.length>1?t:ht(this,Uy).call(this,e),ht(this,_c)&&(ht(this,Cg)[e]=x_,ht(this,fd)[e]={},ht(this,fd)[x_][e]=!0),ht(this,Eh)[e]={},ht(this,hm)[e]={},ht(this,Dh)[e]={},ht(this,fm)[e]={},++nx(this,Ky)._,this)}node(e){return ht(this,gu)[e]}hasNode(e){return ht(this,gu).hasOwnProperty(e)}removeNode(e){var t=this;if(ht(this,gu).hasOwnProperty(e)){var n=o=>t.removeEdge(ht(t,_g)[o]);delete ht(this,gu)[e],ht(this,_c)&&(mh(this,aI,JU).call(this,e),delete ht(this,Cg)[e],this.children(e).forEach(function(o){t.setParent(o)}),delete ht(this,fd)[e]),Object.keys(ht(this,Eh)[e]).forEach(n),delete ht(this,Eh)[e],delete ht(this,hm)[e],Object.keys(ht(this,Dh)[e]).forEach(n),delete ht(this,Dh)[e],delete ht(this,fm)[e],--nx(this,Ky)._}return this}setParent(e,t){if(!ht(this,_c))throw new Error("Cannot set parent in a non-compound graph");if(t===void 0)t=x_;else{t+="";for(var n=t;n!==void 0;n=this.parent(n))if(n===e)throw new Error("Setting "+t+" as parent of "+e+" would create a cycle");this.setNode(t)}return this.setNode(e),mh(this,aI,JU).call(this,e),ht(this,Cg)[e]=t,ht(this,fd)[t][e]=!0,this}parent(e){if(ht(this,_c)){var t=ht(this,Cg)[e];if(t!==x_)return t}}children(e=x_){if(ht(this,_c)){var t=ht(this,fd)[e];if(t)return Object.keys(t)}else{if(e===x_)return this.nodes();if(this.hasNode(e))return[]}}predecessors(e){var t=ht(this,hm)[e];if(t)return Object.keys(t)}successors(e){var t=ht(this,fm)[e];if(t)return Object.keys(t)}neighbors(e){var t=this.predecessors(e);if(t){const o=new Set(t);for(var n of this.successors(e))o.add(n);return Array.from(o.values())}}isLeaf(e){var t;return this.isDirected()?t=this.successors(e):t=this.neighbors(e),t.length===0}filterNodes(e){var t=new this.constructor({directed:ht(this,Il),multigraph:ht(this,b0),compound:ht(this,_c)});t.setGraph(this.graph());var n=this;Object.entries(ht(this,gu)).forEach(function([s,a]){e(s)&&t.setNode(s,a)}),Object.values(ht(this,_g)).forEach(function(s){t.hasNode(s.v)&&t.hasNode(s.w)&&t.setEdge(s,n.edge(s))});var o={};function r(s){var a=n.parent(s);return a===void 0||t.hasNode(a)?(o[s]=a,a):a in o?o[a]:r(a)}return ht(this,_c)&&t.nodes().forEach(s=>t.setParent(s,r(s))),t}setDefaultEdgeLabel(e){return au(this,jy,e),typeof e!="function"&&au(this,jy,()=>e),this}edgeCount(){return ht(this,qy)}edges(){return Object.values(ht(this,_g))}setPath(e,t){var n=this,o=arguments;return e.reduce(function(r,s){return o.length>1?n.setEdge(r,s,t):n.setEdge(r,s),s}),this}setEdge(){var e,t,n,o,r=!1,s=arguments[0];typeof s=="object"&&s!==null&&"v"in s?(e=s.v,t=s.w,n=s.name,arguments.length===2&&(o=arguments[1],r=!0)):(e=s,t=arguments[1],n=arguments[3],arguments.length>2&&(o=arguments[2],r=!0)),e=""+e,t=""+t,n!==void 0&&(n=""+n);var a=WL(ht(this,Il),e,t,n);if(ht(this,bg).hasOwnProperty(a))return r&&(ht(this,bg)[a]=o),this;if(n!==void 0&&!ht(this,b0))throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(e),this.setNode(t),ht(this,bg)[a]=r?o:ht(this,jy).call(this,e,t,n);var l=cDt(ht(this,Il),e,t,n);return e=l.v,t=l.w,Object.freeze(l),ht(this,_g)[a]=l,uue(ht(this,hm)[t],e),uue(ht(this,fm)[e],t),ht(this,Eh)[t][a]=l,ht(this,Dh)[e][a]=l,nx(this,qy)._++,this}edge(e,t,n){var o=arguments.length===1?M7(ht(this,Il),arguments[0]):WL(ht(this,Il),e,t,n);return ht(this,bg)[o]}edgeAsObj(){const e=this.edge(...arguments);return typeof e!="object"?{label:e}:e}hasEdge(e,t,n){var o=arguments.length===1?M7(ht(this,Il),arguments[0]):WL(ht(this,Il),e,t,n);return ht(this,bg).hasOwnProperty(o)}removeEdge(e,t,n){var o=arguments.length===1?M7(ht(this,Il),arguments[0]):WL(ht(this,Il),e,t,n),r=ht(this,_g)[o];return r&&(e=r.v,t=r.w,delete ht(this,bg)[o],delete ht(this,_g)[o],due(ht(this,hm)[t],e),due(ht(this,fm)[e],t),delete ht(this,Eh)[t][o],delete ht(this,Dh)[e][o],nx(this,qy)._--),this}inEdges(e,t){var n=ht(this,Eh)[e];if(n){var o=Object.values(n);return t?o.filter(r=>r.v===t):o}}outEdges(e,t){var n=ht(this,Dh)[e];if(n){var o=Object.values(n);return t?o.filter(r=>r.w===t):o}}nodeEdges(e,t){var n=this.inEdges(e,t);if(n)return n.concat(this.outEdges(e,t))}}Il=new WeakMap,b0=new WeakMap,_c=new WeakMap,sI=new WeakMap,Uy=new WeakMap,jy=new WeakMap,gu=new WeakMap,Eh=new WeakMap,hm=new WeakMap,Dh=new WeakMap,fm=new WeakMap,_g=new WeakMap,bg=new WeakMap,Ky=new WeakMap,qy=new WeakMap,Cg=new WeakMap,fd=new WeakMap,aI=new WeakSet,JU=function(e){delete ht(this,fd)[ht(this,Cg)[e]][e]};function uue(i,e){i[e]?i[e]++:i[e]=1}function due(i,e){--i[e]||delete i[e]}function WL(i,e,t,n){var o=""+e,r=""+t;if(!i&&o>r){var s=o;o=r,r=s}return o+cue+r+cue+(n===void 0?aDt:n)}function cDt(i,e,t,n){var o=""+e,r=""+t;if(!i&&o>r){var s=o;o=r,r=s}var a={v:o,w:r};return n&&(a.name=n),a}function M7(i,e){return WL(i,e.v,e.w,e.name)}var QY=lDt,uDt="2.1.13",dDt={Graph:QY,version:uDt},hDt=QY,fDt={write:gDt,read:vDt};function gDt(i){var e={options:{directed:i.isDirected(),multigraph:i.isMultigraph(),compound:i.isCompound()},nodes:pDt(i),edges:mDt(i)};return i.graph()!==void 0&&(e.value=structuredClone(i.graph())),e}function pDt(i){return i.nodes().map(function(e){var t=i.node(e),n=i.parent(e),o={v:e};return t!==void 0&&(o.value=t),n!==void 0&&(o.parent=n),o})}function mDt(i){return i.edges().map(function(e){var t=i.edge(e),n={v:e.v,w:e.w};return e.name!==void 0&&(n.name=e.name),t!==void 0&&(n.value=t),n})}function vDt(i){var e=new hDt(i.options).setGraph(i.value);return i.nodes.forEach(function(t){e.setNode(t.v,t.value),t.parent&&e.setParent(t.v,t.parent)}),i.edges.forEach(function(t){e.setEdge({v:t.v,w:t.w,name:t.name},t.value)}),e}var _Dt=bDt;function bDt(i){var e={},t=[],n;function o(r){e.hasOwnProperty(r)||(e[r]=!0,n.push(r),i.successors(r).forEach(o),i.predecessors(r).forEach(o))}return i.nodes().forEach(function(r){n=[],o(r),n.length&&t.push(n)}),t}var La,yg,lI,ej,cI,tj,Gy,AM;class CDt{constructor(){Oo(this,lI);Oo(this,cI);Oo(this,Gy);Oo(this,La,[]);Oo(this,yg,{})}size(){return ht(this,La).length}keys(){return ht(this,La).map(function(e){return e.key})}has(e){return ht(this,yg).hasOwnProperty(e)}priority(e){var t=ht(this,yg)[e];if(t!==void 0)return ht(this,La)[t].priority}min(){if(this.size()===0)throw new Error("Queue underflow");return ht(this,La)[0].key}add(e,t){var n=ht(this,yg);if(e=String(e),!n.hasOwnProperty(e)){var o=ht(this,La),r=o.length;return n[e]=r,o.push({key:e,priority:t}),mh(this,cI,tj).call(this,r),!0}return!1}removeMin(){mh(this,Gy,AM).call(this,0,ht(this,La).length-1);var e=ht(this,La).pop();return delete ht(this,yg)[e.key],mh(this,lI,ej).call(this,0),e.key}decrease(e,t){var n=ht(this,yg)[e];if(t>ht(this,La)[n].priority)throw new Error("New priority is greater than current priority. Key: "+e+" Old: "+ht(this,La)[n].priority+" New: "+t);ht(this,La)[n].priority=t,mh(this,cI,tj).call(this,n)}}La=new WeakMap,yg=new WeakMap,lI=new WeakSet,ej=function(e){var t=ht(this,La),n=2*e,o=n+1,r=e;n>1,!(t[o].priority1;function SDt(i,e,t,n){return xDt(i,String(e),t||wDt,n||function(o){return i.outEdges(o)})}function xDt(i,e,t,n){var o={},r=new yDt,s,a,l=function(c){var u=c.v!==s?c.v:c.w,d=o[u],h=t(c),f=a.distance+h;if(h<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+c+" Weight: "+h);f0&&(s=r.removeMin(),a=o[s],a.distance!==Number.POSITIVE_INFINITY);)n(s).forEach(l);return o}var LDt=cxe,EDt=DDt;function DDt(i,e,t){return i.nodes().reduce(function(n,o){return n[o]=LDt(i,o,e,t),n},{})}var uxe=kDt;function kDt(i){var e=0,t=[],n={},o=[];function r(s){var a=n[s]={onStack:!0,lowlink:e,index:e++};if(t.push(s),i.successors(s).forEach(function(u){n.hasOwnProperty(u)?n[u].onStack&&(a.lowlink=Math.min(a.lowlink,n[u].index)):(r(u),a.lowlink=Math.min(a.lowlink,n[u].lowlink))}),a.lowlink===a.index){var l=[],c;do c=t.pop(),n[c].onStack=!1,l.push(c);while(s!==c);o.push(l)}}return i.nodes().forEach(function(s){n.hasOwnProperty(s)||r(s)}),o}var IDt=uxe,TDt=NDt;function NDt(i){return IDt(i).filter(function(e){return e.length>1||e.length===1&&i.hasEdge(e[0],e[0])})}var RDt=ADt,MDt=()=>1;function ADt(i,e,t){return PDt(i,e||MDt,t||function(n){return i.outEdges(n)})}function PDt(i,e,t){var n={},o=i.nodes();return o.forEach(function(r){n[r]={},n[r][r]={distance:0},o.forEach(function(s){r!==s&&(n[r][s]={distance:Number.POSITIVE_INFINITY})}),t(r).forEach(function(s){var a=s.v===r?s.w:s.v,l=e(s);n[r][a]={distance:l,predecessor:r}})}),o.forEach(function(r){var s=n[r];o.forEach(function(a){var l=n[a];o.forEach(function(c){var u=l[r],d=s[c],h=l[c],f=u.distance+d.distance;fi.successors(a):a=>i.neighbors(a),o=t==="post"?WDt:VDt,r=[],s={};return e.forEach(a=>{if(!i.hasNode(a))throw new Error("Graph does not have node: "+a);o(a,n,s,r)}),r}function WDt(i,e,t,n){for(var o=[[i,!1]];o.length>0;){var r=o.pop();r[1]?n.push(r[0]):t.hasOwnProperty(r[0])||(t[r[0]]=!0,o.push([r[0],!0]),gxe(e(r[0]),s=>o.push([s,!1])))}}function VDt(i,e,t,n){for(var o=[i];o.length>0;){var r=o.pop();t.hasOwnProperty(r)||(t[r]=!0,n.push(r),gxe(e(r),s=>o.push(s)))}}function gxe(i,e){for(var t=i.length;t--;)e(i[t],t,i);return i}var HDt=fxe,$Dt=zDt;function zDt(i,e){return HDt(i,e,"post")}var UDt=fxe,jDt=KDt;function KDt(i,e){return UDt(i,e,"pre")}var qDt=QY,GDt=lxe,XDt=YDt;function YDt(i,e){var t=new qDt,n={},o=new GDt,r;function s(l){var c=l.v===r?l.w:l.v,u=o.priority(c);if(u!==void 0){var d=e(l);d0;){if(r=o.removeMin(),n.hasOwnProperty(r))t.setEdge(r,n[r]);else{if(a)throw new Error("Input graph is not connected: "+i);a=!0}i.nodeEdges(r).forEach(s)}return t}var ZDt={components:_Dt,dijkstra:cxe,dijkstraAll:EDt,findCycles:TDt,floydWarshall:RDt,isAcyclic:ODt,postorder:$Dt,preorder:jDt,prim:XDt,tarjan:uxe,topsort:hxe},fue=dDt,hh={Graph:fue.Graph,json:fDt,alg:ZDt,version:fue.version};class QDt{constructor(){let e={};e._next=e._prev=e,this._sentinel=e}dequeue(){let e=this._sentinel,t=e._prev;if(t!==e)return gue(t),t}enqueue(e){let t=this._sentinel;e._prev&&e._next&&gue(e),e._next=t._next,t._next._prev=e,t._next=e,e._prev=t}toString(){let e=[],t=this._sentinel,n=t._prev;for(;n!==t;)e.push(JSON.stringify(n,JDt)),n=n._prev;return"["+e.join(", ")+"]"}}function gue(i){i._prev._next=i._next,i._next._prev=i._prev,delete i._next,delete i._prev}function JDt(i,e){if(i!=="_next"&&i!=="_prev")return e}var ekt=QDt;let tkt=hh.Graph,nkt=ekt;var ikt=rkt;let okt=()=>1;function rkt(i,e){if(i.nodeCount()<=1)return[];let t=akt(i,e||okt);return skt(t.graph,t.buckets,t.zeroIdx).flatMap(o=>i.outEdges(o.v,o.w))}function skt(i,e,t){let n=[],o=e[e.length-1],r=e[0],s;for(;i.nodeCount();){for(;s=r.dequeue();)A7(i,e,t,s);for(;s=o.dequeue();)A7(i,e,t,s);if(i.nodeCount()){for(let a=e.length-2;a>0;--a)if(s=e[a].dequeue(),s){n=n.concat(A7(i,e,t,s,!0));break}}}return n}function A7(i,e,t,n,o){let r=o?[]:void 0;return i.inEdges(n.v).forEach(s=>{let a=i.edge(s),l=i.node(s.v);o&&r.push({v:s.v,w:s.w}),l.out-=a,ij(e,t,l)}),i.outEdges(n.v).forEach(s=>{let a=i.edge(s),l=s.w,c=i.node(l);c.in-=a,ij(e,t,c)}),i.removeNode(n.v),r}function akt(i,e){let t=new tkt,n=0,o=0;i.nodes().forEach(a=>{t.setNode(a,{v:a,in:0,out:0})}),i.edges().forEach(a=>{let l=t.edge(a.v,a.w)||0,c=e(a),u=l+c;t.setEdge(a.v,a.w,u),o=Math.max(o,t.node(a.v).out+=c),n=Math.max(n,t.node(a.w).in+=c)});let r=lkt(o+n+3).map(()=>new nkt),s=n+1;return t.nodes().forEach(a=>{ij(r,s,t.node(a))}),{graph:t,buckets:r,zeroIdx:s}}function ij(i,e,t){t.out?t.in?i[t.out-t.in+e].enqueue(t):i[i.length-1].enqueue(t):i[0].enqueue(t)}function lkt(i){const e=[];for(let t=0;te.setNode(t,i.node(t))),i.edges().forEach(t=>{let n=e.edge(t.v,t.w)||{weight:0,minlen:1},o=i.edge(t);e.setEdge(t.v,t.w,{weight:n.weight+o.weight,minlen:Math.max(n.minlen,o.minlen)})}),e}function ukt(i){let e=new pxe({multigraph:i.isMultigraph()}).setGraph(i.graph());return i.nodes().forEach(t=>{i.children(t).length||e.setNode(t,i.node(t))}),i.edges().forEach(t=>{e.setEdge(t,i.edge(t))}),e}function dkt(i){let e=i.nodes().map(t=>{let n={};return i.outEdges(t).forEach(o=>{n[o.w]=(n[o.w]||0)+i.edge(o).weight}),n});return JY(i.nodes(),e)}function hkt(i){let e=i.nodes().map(t=>{let n={};return i.inEdges(t).forEach(o=>{n[o.v]=(n[o.v]||0)+i.edge(o).weight}),n});return JY(i.nodes(),e)}function fkt(i,e){let t=i.x,n=i.y,o=e.x-t,r=e.y-n,s=i.width/2,a=i.height/2;if(!o&&!r)throw new Error("Not possible to find intersection inside of the rectangle");let l,c;return Math.abs(r)*s>Math.abs(o)*a?(r<0&&(a=-a),l=a*o/r,c=a):(o<0&&(s=-s),l=s,c=s*r/o),{x:t+l,y:n+c}}function gkt(i){let e=bxe(vxe(i)+1).map(()=>[]);return i.nodes().forEach(t=>{let n=i.node(t),o=n.rank;o!==void 0&&(e[o][n.order]=t)}),e}function pkt(i){let e=Math.min(...i.nodes().map(t=>{let n=i.node(t).rank;return n===void 0?Number.MAX_VALUE:n}));i.nodes().forEach(t=>{let n=i.node(t);n.hasOwnProperty("rank")&&(n.rank-=e)})}function mkt(i){let e=Math.min(...i.nodes().map(r=>i.node(r).rank)),t=[];i.nodes().forEach(r=>{let s=i.node(r).rank-e;t[s]||(t[s]=[]),t[s].push(r)});let n=0,o=i.graph().nodeRankFactor;Array.from(t).forEach((r,s)=>{r===void 0&&s%o!==0?--n:r!==void 0&&n&&r.forEach(a=>i.node(a).rank+=n)})}function vkt(i,e,t,n){let o={width:0,height:0};return arguments.length>=4&&(o.rank=t,o.order=n),mxe(i,"border",o,e)}function vxe(i){return Math.max(...i.nodes().map(e=>{let t=i.node(e).rank;return t===void 0?Number.MIN_VALUE:t}))}function _kt(i,e){let t={lhs:[],rhs:[]};return i.forEach(n=>{e(n)?t.lhs.push(n):t.rhs.push(n)}),t}function bkt(i,e){let t=Date.now();try{return e()}finally{console.log(i+" time: "+(Date.now()-t)+"ms")}}function Ckt(i,e){return e()}let ykt=0;function _xe(i){var e=++ykt;return toString(i)+e}function bxe(i,e,t=1){e==null&&(e=i,i=0);let n=r=>ren[e]),Object.entries(i).reduce((n,[o,r])=>(n[o]=t(r,o),n),{})}function JY(i,e){return i.reduce((t,n,o)=>(t[n]=e[o],t),{})}let xkt=ikt,Lkt=Ds.uniqueId;var Ekt={run:Dkt,undo:Ikt};function Dkt(i){(i.graph().acyclicer==="greedy"?xkt(i,t(i)):kkt(i)).forEach(n=>{let o=i.edge(n);i.removeEdge(n),o.forwardName=n.name,o.reversed=!0,i.setEdge(n.w,n.v,o,Lkt("rev"))});function t(n){return o=>n.edge(o).weight}}function kkt(i){let e=[],t={},n={};function o(r){n.hasOwnProperty(r)||(n[r]=!0,t[r]=!0,i.outEdges(r).forEach(s=>{t.hasOwnProperty(s.w)?e.push(s):o(s.w)}),delete t[r])}return i.nodes().forEach(o),e}function Ikt(i){i.edges().forEach(e=>{let t=i.edge(e);if(t.reversed){i.removeEdge(e);let n=t.forwardName;delete t.reversed,delete t.forwardName,i.setEdge(e.w,e.v,t,n)}})}let Tkt=Ds;var Nkt={run:Rkt,undo:Akt};function Rkt(i){i.graph().dummyChains=[],i.edges().forEach(e=>Mkt(i,e))}function Mkt(i,e){let t=e.v,n=i.node(t).rank,o=e.w,r=i.node(o).rank,s=e.name,a=i.edge(e),l=a.labelRank;if(r===n+1)return;i.removeEdge(e);let c,u,d;for(d=0,++n;n{let t=i.node(e),n=t.edgeLabel,o;for(i.setEdge(t.edgeObj,n);t.dummy;)o=i.successors(e)[0],i.removeNode(e),n.points.push({x:t.x,y:t.y}),t.dummy==="edge-label"&&(n.x=t.x,n.y=t.y,n.width=t.width,n.height=t.height),e=o,t=i.node(e)})}var n3={longestPath:Pkt,slack:Okt};function Pkt(i){var e={};function t(n){var o=i.node(n);if(e.hasOwnProperty(n))return o.rank;e[n]=!0;var r=Math.min(...i.outEdges(n).map(s=>s==null?Number.POSITIVE_INFINITY:t(s.w)-i.edge(s).minlen));return r===Number.POSITIVE_INFINITY&&(r=0),o.rank=r}i.sources().forEach(t)}function Okt(i,e){return i.node(e.w).rank-i.node(e.v).rank-i.edge(e).minlen}var Fkt=hh.Graph,OO=n3.slack,Cxe=Bkt;function Bkt(i){var e=new Fkt({directed:!1}),t=i.nodes()[0],n=i.nodeCount();e.setNode(t,{});for(var o,r;Wkt(e,i){var r=o.v,s=n===r?o.w:r;!i.hasNode(s)&&!OO(e,o)&&(i.setNode(s,{}),i.setEdge(n,s,{}),t(s))})}return i.nodes().forEach(t),i.nodeCount()}function Vkt(i,e){return e.edges().reduce((n,o)=>{let r=Number.POSITIVE_INFINITY;return i.hasNode(o.v)!==i.hasNode(o.w)&&(r=OO(e,o)),re.node(n).rank+=t)}var $kt=Cxe,pue=n3.slack,zkt=n3.longestPath,Ukt=hh.alg.preorder,jkt=hh.alg.postorder,Kkt=Ds.simplify,qkt=n1;n1.initLowLimValues=tZ;n1.initCutValues=eZ;n1.calcCutValue=yxe;n1.leaveEdge=Sxe;n1.enterEdge=xxe;n1.exchangeEdges=Lxe;function n1(i){i=Kkt(i),zkt(i);var e=$kt(i);tZ(e),eZ(e,i);for(var t,n;t=Sxe(e);)n=xxe(e,i,t),Lxe(e,i,t,n)}function eZ(i,e){var t=jkt(i,i.nodes());t=t.slice(0,t.length-1),t.forEach(n=>Gkt(i,e,n))}function Gkt(i,e,t){var n=i.node(t),o=n.parent;i.edge(t,o).cutvalue=yxe(i,e,t)}function yxe(i,e,t){var n=i.node(t),o=n.parent,r=!0,s=e.edge(t,o),a=0;return s||(r=!1,s=e.edge(o,t)),a=s.weight,e.nodeEdges(t).forEach(l=>{var c=l.v===t,u=c?l.w:l.v;if(u!==o){var d=c===r,h=e.edge(l).weight;if(a+=d?h:-h,Ykt(i,t,u)){var f=i.edge(t,u).cutvalue;a+=d?-f:f}}}),a}function tZ(i,e){arguments.length<2&&(e=i.nodes()[0]),wxe(i,{},1,e)}function wxe(i,e,t,n,o){var r=t,s=i.node(n);return e[n]=!0,i.neighbors(n).forEach(a=>{e.hasOwnProperty(a)||(t=wxe(i,e,t,a,n))}),s.low=r,s.lim=t++,o?s.parent=o:delete s.parent,t}function Sxe(i){return i.edges().find(e=>i.edge(e).cutvalue<0)}function xxe(i,e,t){var n=t.v,o=t.w;e.hasEdge(n,o)||(n=t.w,o=t.v);var r=i.node(n),s=i.node(o),a=r,l=!1;r.lim>s.lim&&(a=s,l=!0);var c=e.edges().filter(u=>l===mue(i,i.node(u.v),a)&&l!==mue(i,i.node(u.w),a));return c.reduce((u,d)=>pue(e,d)!e.node(o).parent),n=Ukt(i,t);n=n.slice(1),n.forEach(o=>{var r=i.node(o).parent,s=e.edge(o,r),a=!1;s||(s=e.edge(r,o),a=!0),e.node(o).rank=e.node(r).rank+(a?s.minlen:-s.minlen)})}function Ykt(i,e,t){return i.hasEdge(e,t)}function mue(i,e,t){return t.low<=e.lim&&e.lim<=t.lim}var Zkt=n3,Exe=Zkt.longestPath,Qkt=Cxe,Jkt=qkt,eIt=tIt;function tIt(i){switch(i.graph().ranker){case"network-simplex":vue(i);break;case"tight-tree":iIt(i);break;case"longest-path":nIt(i);break;default:vue(i)}}var nIt=Exe;function iIt(i){Exe(i),Qkt(i)}function vue(i){Jkt(i)}var oIt=rIt;function rIt(i){let e=aIt(i);i.graph().dummyChains.forEach(t=>{let n=i.node(t),o=n.edgeObj,r=sIt(i,e,o.v,o.w),s=r.path,a=r.lca,l=0,c=s[l],u=!0;for(;t!==o.w;){if(n=i.node(t),u){for(;(c=s[l])!==a&&i.node(c).maxRanks||a>e[l].lim));for(c=l,l=n;(l=i.parent(l))!==c;)r.push(l);return{path:o.concat(r.reverse()),lca:c}}function aIt(i){let e={},t=0;function n(o){let r=t;i.children(o).forEach(n),e[o]={low:r,lim:t++}}return i.children().forEach(n),e}let oj=Ds;var lIt={run:cIt,cleanup:hIt};function cIt(i){let e=oj.addDummyNode(i,"root",{},"_root"),t=uIt(i),n=Math.max(...Object.values(t))-1,o=2*n+1;i.graph().nestingRoot=e,i.edges().forEach(s=>i.edge(s).minlen*=o);let r=dIt(i)+1;i.children().forEach(s=>Dxe(i,e,o,r,n,t,s)),i.graph().nodeRankFactor=o}function Dxe(i,e,t,n,o,r,s){let a=i.children(s);if(!a.length){s!==e&&i.setEdge(e,s,{weight:0,minlen:t});return}let l=oj.addBorderNode(i,"_bt"),c=oj.addBorderNode(i,"_bb"),u=i.node(s);i.setParent(l,s),u.borderTop=l,i.setParent(c,s),u.borderBottom=c,a.forEach(d=>{Dxe(i,e,t,n,o,r,d);let h=i.node(d),f=h.borderTop?h.borderTop:d,g=h.borderBottom?h.borderBottom:d,p=h.borderTop?n:2*n,v=f!==g?1:o-r[s]+1;i.setEdge(l,f,{weight:p,minlen:v,nestingEdge:!0}),i.setEdge(g,c,{weight:p,minlen:v,nestingEdge:!0})}),i.parent(s)||i.setEdge(e,l,{weight:0,minlen:o+r[s]})}function uIt(i){var e={};function t(n,o){var r=i.children(n);r&&r.length&&r.forEach(s=>t(s,o+1)),e[n]=o}return i.children().forEach(n=>t(n,1)),e}function dIt(i){return i.edges().reduce((e,t)=>e+i.edge(t).weight,0)}function hIt(i){var e=i.graph();i.removeNode(e.nestingRoot),delete e.nestingRoot,i.edges().forEach(t=>{var n=i.edge(t);n.nestingEdge&&i.removeEdge(t)})}let fIt=Ds;var gIt=pIt;function pIt(i){function e(t){let n=i.children(t),o=i.node(t);if(n.length&&n.forEach(e),o.hasOwnProperty("minRank")){o.borderLeft=[],o.borderRight=[];for(let r=o.minRank,s=o.maxRank+1;rbue(i.node(e))),i.edges().forEach(e=>bue(i.edge(e)))}function bue(i){let e=i.width;i.width=i.height,i.height=e}function bIt(i){i.nodes().forEach(e=>P7(i.node(e))),i.edges().forEach(e=>{let t=i.edge(e);t.points.forEach(P7),t.hasOwnProperty("y")&&P7(t)})}function P7(i){i.y=-i.y}function CIt(i){i.nodes().forEach(e=>O7(i.node(e))),i.edges().forEach(e=>{let t=i.edge(e);t.points.forEach(O7),t.hasOwnProperty("x")&&O7(t)})}function O7(i){let e=i.x;i.x=i.y,i.y=e}let yIt=Ds;var wIt=SIt;function SIt(i){let e={},t=i.nodes().filter(a=>!i.children(a).length),n=Math.max(...t.map(a=>i.node(a).rank)),o=yIt.range(n+1).map(()=>[]);function r(a){if(e[a])return;e[a]=!0;let l=i.node(a);o[l.rank].push(a),i.successors(a).forEach(r)}return t.sort((a,l)=>i.node(a).rank-i.node(l).rank).forEach(r),o}let xIt=Ds.zipObject;var LIt=EIt;function EIt(i,e){let t=0;for(let n=1;nu)),o=e.flatMap(c=>i.outEdges(c).map(u=>({pos:n[u.w],weight:i.edge(u).weight})).sort((u,d)=>u.pos-d.pos)),r=1;for(;r{let u=c.pos+r;a[u]+=c.weight;let d=0;for(;u>0;)u%2&&(d+=a[u+1]),u=u-1>>1,a[u]+=c.weight;l+=c.weight*d}),l}var kIt=IIt;function IIt(i,e=[]){return e.map(t=>{let n=i.inEdges(t);if(n.length){let o=n.reduce((r,s)=>{let a=i.edge(s),l=i.node(s.v);return{sum:r.sum+a.weight*l.order,weight:r.weight+a.weight}},{sum:0,weight:0});return{v:t,barycenter:o.sum/o.weight,weight:o.weight}}else return{v:t}})}let TIt=Ds;var NIt=RIt;function RIt(i,e){let t={};i.forEach((o,r)=>{let s=t[o.v]={indegree:0,in:[],out:[],vs:[o.v],i:r};o.barycenter!==void 0&&(s.barycenter=o.barycenter,s.weight=o.weight)}),e.edges().forEach(o=>{let r=t[o.v],s=t[o.w];r!==void 0&&s!==void 0&&(s.indegree++,r.out.push(t[o.w]))});let n=Object.values(t).filter(o=>!o.indegree);return MIt(n)}function MIt(i){let e=[];function t(o){return r=>{r.merged||(r.barycenter===void 0||o.barycenter===void 0||r.barycenter>=o.barycenter)&&AIt(o,r)}}function n(o){return r=>{r.in.push(o),--r.indegree===0&&i.push(r)}}for(;i.length;){let o=i.pop();e.push(o),o.in.reverse().forEach(t(o)),o.out.forEach(n(o))}return e.filter(o=>!o.merged).map(o=>TIt.pick(o,["vs","i","barycenter","weight"]))}function AIt(i,e){let t=0,n=0;i.weight&&(t+=i.barycenter*i.weight,n+=i.weight),e.weight&&(t+=e.barycenter*e.weight,n+=e.weight),i.vs=e.vs.concat(i.vs),i.barycenter=t/n,i.weight=n,i.i=Math.min(e.i,i.i),e.merged=!0}let PIt=Ds;var OIt=FIt;function FIt(i,e){let t=PIt.partition(i,u=>u.hasOwnProperty("barycenter")),n=t.lhs,o=t.rhs.sort((u,d)=>d.i-u.i),r=[],s=0,a=0,l=0;n.sort(BIt(!!e)),l=Cue(r,o,l),n.forEach(u=>{l+=u.vs.length,r.push(u.vs),s+=u.barycenter*u.weight,a+=u.weight,l=Cue(r,o,l)});let c={vs:r.flat(!0)};return a&&(c.barycenter=s/a,c.weight=a),c}function Cue(i,e,t){let n;for(;e.length&&(n=e[e.length-1]).i<=t;)e.pop(),i.push(n.vs),t++;return t}function BIt(i){return(e,t)=>e.barycentert.barycenter?1:i?t.i-e.i:e.i-t.i}let WIt=kIt,VIt=NIt,HIt=OIt;var $It=Ixe;function Ixe(i,e,t,n){let o=i.children(e),r=i.node(e),s=r?r.borderLeft:void 0,a=r?r.borderRight:void 0,l={};s&&(o=o.filter(h=>h!==s&&h!==a));let c=WIt(i,o);c.forEach(h=>{if(i.children(h.v).length){let f=Ixe(i,h.v,t,n);l[h.v]=f,f.hasOwnProperty("barycenter")&&UIt(h,f)}});let u=VIt(c,t);zIt(u,l);let d=HIt(u,n);if(s&&(d.vs=[s,d.vs,a].flat(!0),i.predecessors(s).length)){let h=i.node(i.predecessors(s)[0]),f=i.node(i.predecessors(a)[0]);d.hasOwnProperty("barycenter")||(d.barycenter=0,d.weight=0),d.barycenter=(d.barycenter*d.weight+h.order+f.order)/(d.weight+2),d.weight+=2}return d}function zIt(i,e){i.forEach(t=>{t.vs=t.vs.flatMap(n=>e[n]?e[n].vs:n)})}function UIt(i,e){i.barycenter!==void 0?(i.barycenter=(i.barycenter*i.weight+e.barycenter*e.weight)/(i.weight+e.weight),i.weight+=e.weight):(i.barycenter=e.barycenter,i.weight=e.weight)}let jIt=hh.Graph,KIt=Ds;var qIt=GIt;function GIt(i,e,t){let n=XIt(i),o=new jIt({compound:!0}).setGraph({root:n}).setDefaultNodeLabel(r=>i.node(r));return i.nodes().forEach(r=>{let s=i.node(r),a=i.parent(r);(s.rank===e||s.minRank<=e&&e<=s.maxRank)&&(o.setNode(r),o.setParent(r,a||n),i[t](r).forEach(l=>{let c=l.v===r?l.w:l.v,u=o.edge(c,r),d=u!==void 0?u.weight:0;o.setEdge(c,r,{weight:i.edge(l).weight+d})}),s.hasOwnProperty("minRank")&&o.setNode(r,{borderLeft:s.borderLeft[e],borderRight:s.borderRight[e]}))}),o}function XIt(i){for(var e;i.hasNode(e=KIt.uniqueId("_root")););return e}var YIt=ZIt;function ZIt(i,e,t){let n={},o;t.forEach(r=>{let s=i.parent(r),a,l;for(;s;){if(a=i.parent(s),a?(l=n[a],n[a]=s):(l=o,o=s),l&&l!==s){e.setEdge(l,s);return}s=a}})}let QIt=wIt,JIt=LIt,eTt=$It,tTt=qIt,nTt=YIt,iTt=hh.Graph,bR=Ds;var oTt=rTt;function rTt(i){let e=bR.maxRank(i),t=yue(i,bR.range(1,e+1),"inEdges"),n=yue(i,bR.range(e-1,-1,-1),"outEdges"),o=QIt(i);wue(i,o);let r=Number.POSITIVE_INFINITY,s;for(let a=0,l=0;l<4;++a,++l){sTt(a%2?t:n,a%4>=2),o=bR.buildLayerMatrix(i);let c=JIt(i,o);cn.node(s).order=a),nTt(n,t,r.vs)})}function wue(i,e){Object.values(e).forEach(t=>t.forEach((n,o)=>i.node(n).order=o))}let aTt=hh.Graph,rI=Ds;var lTt={positionX:dTt,findType1Conflicts:Txe,findType2Conflicts:Nxe,addConflict:nZ,hasConflict:Rxe,verticalAlignment:Mxe,horizontalCompaction:Axe,alignCoordinates:Oxe,findSmallestWidthAlignment:Pxe,balance:Fxe};function Txe(i,e){let t={};function n(o,r){let s=0,a=0,l=o.length,c=r[r.length-1];return r.forEach((u,d)=>{let h=cTt(i,u),f=h?i.node(h).order:l;(h||u===c)&&(r.slice(a,d+1).forEach(g=>{i.predecessors(g).forEach(p=>{let v=i.node(p),m=v.order;(m{u=r[d],i.node(u).dummy&&i.predecessors(u).forEach(h=>{let f=i.node(h);f.dummy&&(f.orderc)&&nZ(t,h,u)})})}function o(r,s){let a=-1,l,c=0;return s.forEach((u,d)=>{if(i.node(u).dummy==="border"){let h=i.predecessors(u);h.length&&(l=i.node(h[0]).order,n(s,c,d,a,l),c=d,a=l)}n(s,c,s.length,l,r.length)}),s}return e.reduce(o),t}function cTt(i,e){if(i.node(e).dummy)return i.predecessors(e).find(t=>i.node(t).dummy)}function nZ(i,e,t){if(e>t){let o=e;e=t,t=o}let n=i[e];n||(i[e]=n={}),n[t]=!0}function Rxe(i,e,t){if(e>t){let n=e;e=t,t=n}return!!i[e]&&i[e].hasOwnProperty(t)}function Mxe(i,e,t,n){let o={},r={},s={};return e.forEach(a=>{a.forEach((l,c)=>{o[l]=l,r[l]=l,s[l]=c})}),e.forEach(a=>{let l=-1;a.forEach(c=>{let u=n(c);if(u.length){u=u.sort((h,f)=>s[h]-s[f]);let d=(u.length-1)/2;for(let h=Math.floor(d),f=Math.ceil(d);h<=f;++h){let g=u[h];r[c]===c&&lMath.max(h,r[f.v]+s.edge(f)),0)}function u(d){let h=s.outEdges(d).reduce((g,p)=>Math.min(g,r[p.w]-s.edge(p)),Number.POSITIVE_INFINITY),f=i.node(d);h!==Number.POSITIVE_INFINITY&&f.borderType!==a&&(r[d]=Math.max(r[d],h))}return l(c,s.predecessors.bind(s)),l(u,s.successors.bind(s)),Object.keys(n).forEach(d=>r[d]=r[t[d]]),r}function uTt(i,e,t,n){let o=new aTt,r=i.graph(),s=hTt(r.nodesep,r.edgesep,n);return e.forEach(a=>{let l;a.forEach(c=>{let u=t[c];if(o.setNode(u),l){var d=t[l],h=o.edge(d,u);o.setEdge(d,u,Math.max(s(i,c,l),h||0))}l=c})}),o}function Pxe(i,e){return Object.values(e).reduce((t,n)=>{let o=Number.NEGATIVE_INFINITY,r=Number.POSITIVE_INFINITY;Object.entries(n).forEach(([a,l])=>{let c=fTt(i,a)/2;o=Math.max(l+c,o),r=Math.min(l-c,r)});const s=o-r;return s{["l","r"].forEach(s=>{let a=r+s,l=i[a];if(l===e)return;let c=Object.values(l),u=n-Math.min(...c);s!=="l"&&(u=o-Math.max(...c)),u&&(i[a]=rI.mapValues(l,d=>d+u))})})}function Fxe(i,e){return rI.mapValues(i.ul,(t,n)=>{if(e)return i[e.toLowerCase()][n];{let o=Object.values(i).map(r=>r[n]).sort((r,s)=>r-s);return(o[1]+o[2])/2}})}function dTt(i){let e=rI.buildLayerMatrix(i),t=Object.assign(Txe(i,e),Nxe(i,e)),n={},o;["u","d"].forEach(s=>{o=s==="u"?e:Object.values(e).reverse(),["l","r"].forEach(a=>{a==="r"&&(o=o.map(d=>Object.values(d).reverse()));let l=(s==="u"?i.predecessors:i.successors).bind(i),c=Mxe(i,o,t,l),u=Axe(i,o,c.root,c.align,a==="r");a==="r"&&(u=rI.mapValues(u,d=>-d)),n[s+a]=u})});let r=Pxe(i,n);return Oxe(n,r),Fxe(n,i.graph().align)}function hTt(i,e,t){return(n,o,r)=>{let s=n.node(o),a=n.node(r),l=0,c;if(l+=s.width/2,s.hasOwnProperty("labelpos"))switch(s.labelpos.toLowerCase()){case"l":c=-s.width/2;break;case"r":c=s.width/2;break}if(c&&(l+=t?c:-c),c=0,l+=(s.dummy?e:i)/2,l+=(a.dummy?e:i)/2,l+=a.width/2,a.hasOwnProperty("labelpos"))switch(a.labelpos.toLowerCase()){case"l":c=a.width/2;break;case"r":c=-a.width/2;break}return c&&(l+=t?c:-c),c=0,l}}function fTt(i,e){return i.node(e).width}let Bxe=Ds,gTt=lTt.positionX;var pTt=mTt;function mTt(i){i=Bxe.asNonCompoundGraph(i),vTt(i),Object.entries(gTt(i)).forEach(([e,t])=>i.node(e).x=t)}function vTt(i){let e=Bxe.buildLayerMatrix(i),t=i.graph().ranksep,n=0;e.forEach(o=>{const r=o.reduce((s,a)=>{const l=i.node(a).height;return s>l?s:l},0);o.forEach(s=>i.node(s).y=n+r/2),n+=r+t})}let Sue=Ekt,xue=Nkt,_Tt=eIt,bTt=Ds.normalizeRanks,CTt=oIt,yTt=Ds.removeEmptyRanks,Lue=lIt,wTt=gIt,Eue=mIt,STt=oTt,xTt=pTt,Vu=Ds,LTt=hh.Graph;var ETt=DTt;function DTt(i,e){let t=e&&e.debugTiming?Vu.time:Vu.notime;t("layout",()=>{let n=t(" buildLayoutGraph",()=>FTt(i));t(" runLayout",()=>kTt(n,t)),t(" updateInputGraph",()=>ITt(i,n))})}function kTt(i,e){e(" makeSpaceForEdgeLabels",()=>BTt(i)),e(" removeSelfEdges",()=>qTt(i)),e(" acyclic",()=>Sue.run(i)),e(" nestingGraph.run",()=>Lue.run(i)),e(" rank",()=>_Tt(Vu.asNonCompoundGraph(i))),e(" injectEdgeLabelProxies",()=>WTt(i)),e(" removeEmptyRanks",()=>yTt(i)),e(" nestingGraph.cleanup",()=>Lue.cleanup(i)),e(" normalizeRanks",()=>bTt(i)),e(" assignRankMinMax",()=>VTt(i)),e(" removeEdgeLabelProxies",()=>HTt(i)),e(" normalize.run",()=>xue.run(i)),e(" parentDummyChains",()=>CTt(i)),e(" addBorderSegments",()=>wTt(i)),e(" order",()=>STt(i)),e(" insertSelfEdges",()=>GTt(i)),e(" adjustCoordinateSystem",()=>Eue.adjust(i)),e(" position",()=>xTt(i)),e(" positionSelfEdges",()=>XTt(i)),e(" removeBorderNodes",()=>KTt(i)),e(" normalize.undo",()=>xue.undo(i)),e(" fixupEdgeLabelCoords",()=>UTt(i)),e(" undoCoordinateSystem",()=>Eue.undo(i)),e(" translateGraph",()=>$Tt(i)),e(" assignNodeIntersects",()=>zTt(i)),e(" reversePoints",()=>jTt(i)),e(" acyclic.undo",()=>Sue.undo(i))}function ITt(i,e){i.nodes().forEach(t=>{let n=i.node(t),o=e.node(t);n&&(n.x=o.x,n.y=o.y,n.rank=o.rank,e.children(t).length&&(n.width=o.width,n.height=o.height))}),i.edges().forEach(t=>{let n=i.edge(t),o=e.edge(t);n.points=o.points,o.hasOwnProperty("x")&&(n.x=o.x,n.y=o.y)}),i.graph().width=e.graph().width,i.graph().height=e.graph().height}let TTt=["nodesep","edgesep","ranksep","marginx","marginy"],NTt={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},RTt=["acyclicer","ranker","rankdir","align"],MTt=["width","height"],Due={width:0,height:0},ATt=["minlen","weight","width","height","labeloffset"],PTt={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},OTt=["labelpos"];function FTt(i){let e=new LTt({multigraph:!0,compound:!0}),t=B7(i.graph());return e.setGraph(Object.assign({},NTt,F7(t,TTt),Vu.pick(t,RTt))),i.nodes().forEach(n=>{let o=B7(i.node(n));const r=F7(o,MTt);Object.keys(Due).forEach(s=>{r[s]===void 0&&(r[s]=Due[s])}),e.setNode(n,r),e.setParent(n,i.parent(n))}),i.edges().forEach(n=>{let o=B7(i.edge(n));e.setEdge(n,Object.assign({},PTt,F7(o,ATt),Vu.pick(o,OTt)))}),e}function BTt(i){let e=i.graph();e.ranksep/=2,i.edges().forEach(t=>{let n=i.edge(t);n.minlen*=2,n.labelpos.toLowerCase()!=="c"&&(e.rankdir==="TB"||e.rankdir==="BT"?n.width+=n.labeloffset:n.height+=n.labeloffset)})}function WTt(i){i.edges().forEach(e=>{let t=i.edge(e);if(t.width&&t.height){let n=i.node(e.v),r={rank:(i.node(e.w).rank-n.rank)/2+n.rank,e};Vu.addDummyNode(i,"edge-proxy",r,"_ep")}})}function VTt(i){let e=0;i.nodes().forEach(t=>{let n=i.node(t);n.borderTop&&(n.minRank=i.node(n.borderTop).rank,n.maxRank=i.node(n.borderBottom).rank,e=Math.max(e,n.maxRank))}),i.graph().maxRank=e}function HTt(i){i.nodes().forEach(e=>{let t=i.node(e);t.dummy==="edge-proxy"&&(i.edge(t.e).labelRank=t.rank,i.removeNode(e))})}function $Tt(i){let e=Number.POSITIVE_INFINITY,t=0,n=Number.POSITIVE_INFINITY,o=0,r=i.graph(),s=r.marginx||0,a=r.marginy||0;function l(c){let u=c.x,d=c.y,h=c.width,f=c.height;e=Math.min(e,u-h/2),t=Math.max(t,u+h/2),n=Math.min(n,d-f/2),o=Math.max(o,d+f/2)}i.nodes().forEach(c=>l(i.node(c))),i.edges().forEach(c=>{let u=i.edge(c);u.hasOwnProperty("x")&&l(u)}),e-=s,n-=a,i.nodes().forEach(c=>{let u=i.node(c);u.x-=e,u.y-=n}),i.edges().forEach(c=>{let u=i.edge(c);u.points.forEach(d=>{d.x-=e,d.y-=n}),u.hasOwnProperty("x")&&(u.x-=e),u.hasOwnProperty("y")&&(u.y-=n)}),r.width=t-e+s,r.height=o-n+a}function zTt(i){i.edges().forEach(e=>{let t=i.edge(e),n=i.node(e.v),o=i.node(e.w),r,s;t.points?(r=t.points[0],s=t.points[t.points.length-1]):(t.points=[],r=o,s=n),t.points.unshift(Vu.intersectRect(n,r)),t.points.push(Vu.intersectRect(o,s))})}function UTt(i){i.edges().forEach(e=>{let t=i.edge(e);if(t.hasOwnProperty("x"))switch((t.labelpos==="l"||t.labelpos==="r")&&(t.width-=t.labeloffset),t.labelpos){case"l":t.x-=t.width/2+t.labeloffset;break;case"r":t.x+=t.width/2+t.labeloffset;break}})}function jTt(i){i.edges().forEach(e=>{let t=i.edge(e);t.reversed&&t.points.reverse()})}function KTt(i){i.nodes().forEach(e=>{if(i.children(e).length){let t=i.node(e),n=i.node(t.borderTop),o=i.node(t.borderBottom),r=i.node(t.borderLeft[t.borderLeft.length-1]),s=i.node(t.borderRight[t.borderRight.length-1]);t.width=Math.abs(s.x-r.x),t.height=Math.abs(o.y-n.y),t.x=r.x+t.width/2,t.y=n.y+t.height/2}}),i.nodes().forEach(e=>{i.node(e).dummy==="border"&&i.removeNode(e)})}function qTt(i){i.edges().forEach(e=>{if(e.v===e.w){var t=i.node(e.v);t.selfEdges||(t.selfEdges=[]),t.selfEdges.push({e,label:i.edge(e)}),i.removeEdge(e)}})}function GTt(i){var e=Vu.buildLayerMatrix(i);e.forEach(t=>{var n=0;t.forEach((o,r)=>{var s=i.node(o);s.order=r+n,(s.selfEdges||[]).forEach(a=>{Vu.addDummyNode(i,"selfedge",{width:a.label.width,height:a.label.height,rank:s.rank,order:r+ ++n,e:a.e,label:a.label},"_se")}),delete s.selfEdges})})}function XTt(i){i.nodes().forEach(e=>{var t=i.node(e);if(t.dummy==="selfedge"){var n=i.node(t.e.v),o=n.x+n.width/2,r=n.y,s=t.x-o,a=n.height/2;i.setEdge(t.e,t.label),i.removeNode(e),t.label.points=[{x:o+2*s/3,y:r-a},{x:o+5*s/6,y:r-a},{x:o+s,y:r},{x:o+5*s/6,y:r+a},{x:o+2*s/3,y:r+a}],t.label.x=t.x,t.label.y=t.y}})}function F7(i,e){return Vu.mapValues(Vu.pick(i,e),Number)}function B7(i){var e={};return i&&Object.entries(i).forEach(([t,n])=>{typeof t=="string"&&(t=t.toLowerCase()),e[t]=n}),e}let YTt=Ds,ZTt=hh.Graph;var QTt={debugOrdering:JTt};function JTt(i){let e=YTt.buildLayerMatrix(i),t=new ZTt({compound:!0,multigraph:!0}).setGraph({});return i.nodes().forEach(n=>{t.setNode(n,{label:n}),t.setParent(n,"layer"+i.node(n).rank)}),i.edges().forEach(n=>t.setEdge(n.v,n.w,{},n.name)),e.forEach((n,o)=>{let r="layer"+o;t.setNode(r,{rank:"same"}),n.reduce((s,a)=>(t.setEdge(s,a,{style:"invis"}),a))}),t}var eNt="1.0.4",kue={graphlib:hh,layout:ETt,debug:QTt,util:{time:Ds.time,notime:Ds.notime},version:eNt};const tNt="_container_zefjd_1",nNt="_label_zefjd_9",iNt="_content_zefjd_12",oNt="_selected_zefjd_27",rNt="_node__title_zefjd_30";var L_={container:tNt,label:nNt,content:iNt,selected:oNt,node__title:rNt,"node__operator-description":"_node__operator-description_zefjd_35","value-container":"_value-container_zefjd_38"};const sNt="_container_1ergx_11",aNt="_wrapper_1ergx_16";var CR={"port-type-container":"_port-type-container_1ergx_1","port-type-label":"_port-type-label_1ergx_6",container:sNt,wrapper:aNt,"add-button":"_add-button_1ergx_19"};function lNt(i){var s,a;const{node:e}=i,t=(s=e==null?void 0:e.data)==null?void 0:s.endPointOptions,{updateNode:n}=t3(),o=fr(e);function r(l){return l.type!=="source"&&l.type!=="target"?fn("div",{children:["unknown type: ",l.type]},l.id):fn("div",{style:{position:"relative"},children:[he("div",{style:{textAlign:l.type==="source"?"right":"left"},children:l.label||l.variableName}),he(lD,{type:l.type,position:l.type==="source"?mn.Right:mn.Left,id:l.id,isConnectable:!0})]},l.id)}return!((a=t==null?void 0:t.endPointList)!=null&&a.length)||!o?null:he("div",{className:CR.container,children:t.endPointList.map(l=>{var c,u;return l.type==="group"?!((c=l.children)!=null&&c.length)&&!l.allowAddAndRemoveChildren?null:fn("div",{children:[fn("div",{className:CR["port-type-container"],children:[he("div",{className:CR["port-type-label"],children:l.label}),(u=l.children)==null?void 0:u.map(d=>r(d))]}),l.allowAddAndRemoveChildren&&he("span",{className:CR["add-button"],onClick:()=>{!(e!=null&&e.id)||n(e==null?void 0:e.id,d=>(l.children=(l.children||[]).concat(ri.createFromGroup(l)),o.updateData(d,{})))},children:"add"})]},l.id):r(l)})})}function cNt(i){var c,u;const e=fr(i),{currentStateRef:t,actionsRef:n}=IT(),{selected:o,data:r}=i,s=(c=e==null?void 0:e.getNodeProps)==null?void 0:c.call(e,i);function a(){var h;if(!(s!=null&&s.showValue))return null;const d=(h=s==null?void 0:s.getBriefValue)==null?void 0:h.call(s);return d?he("div",{className:L_["value-container"],onClick:()=>{var f;d.hasDetail&&Xs.info(((f=s==null?void 0:s.getDetailValue)==null?void 0:f.call(s))||"")},children:d.value}):null}const l=a();return fn("div",{className:Ue(L_.container,{[L_.selected]:o}),style:{"--color-node-theme":(e==null?void 0:e.nodeColor)||void 0},onClick:()=>{e==null||e.onNodeFocus({node:i,currentState:t.current,actions:n.current})},children:[he("div",{className:L_.label,children:(r==null?void 0:r.nodeLabel)||(r==null?void 0:r.operatorName)}),fn("div",{className:L_.content,onDoubleClick:()=>{e==null||e.onNodeDoubleClick({node:i,currentState:t.current,actions:n.current})},children:[fn("div",{className:L_.node__title,children:[(e==null?void 0:e.description)&&he("div",{className:L_["node__operator-description"],children:e==null?void 0:e.description}),l&&he("div",{children:l}),((u=e==null?void 0:e.renderCustomLabel)==null?void 0:u.call(e,i))||null]}),he(lNt,{node:i})]})]},i.id)}const uNt={[oh.Node]:cNt};var dNt={"main-flow":"_main-flow_acc5o_1"};function hNt(){const{operators:i}=ZY(),{actionsRef:e,currentStateRef:t}=IT(),[n,o]=el(l=>{const c=wc(l.layer,l.activeLayerId),u=c!=null&&c.parentLayerId?wc(l.layer,c==null?void 0:c.parentLayerId):void 0;return[u==null?void 0:u.id,u==null?void 0:u.name]}),{setActiveLayerId:r,setLayer:s}=t3(),a=el(l=>{var c,u;if(((c=l.layer)==null?void 0:c.id)!==((u=l.defaultLayer)==null?void 0:u.id))return l.defaultLayer});return fn(ks,{children:[a?he(ts,{type:"text",style:{color:"white"},onClick:()=>{zd.exports.flushSync(()=>{s(a),r(a.id)}),setTimeout(()=>{i.forEach(l=>{var c;(c=l.onLayerChange)==null||c.call(l,{currentState:t.current,actions:e.current})})})},children:"Back To Default"}):null,n&&fn(ts,{type:"text",style:{color:"white"},onClick:()=>{r(n)},children:["\u8FD4\u56DE ",o||n]})]})}const fNt=i=>{const e=fr(i);return e!=null&&e.nodeColor?e==null?void 0:e.nodeColor:"#ff0072"},gNt=(i,e)=>{const t=new kue.graphlib.Graph().setDefaultEdgeLabel(()=>({}));return t.setGraph({rankdir:"LR"}),e.forEach(n=>t.setEdge(n.source,n.target)),i.forEach(n=>t.setNode(n.id,{...n,width:n.width||void 0,height:n.height||void 0})),kue.layout(t),{nodes:i.map(n=>{const{x:o,y:r}=t.node(n.id);return{...n,position:{x:o,y:r}}}),edges:e}},pNt=()=>{const{nodes:i,edges:e,setNodes:t,setEdges:n}=kT(),{actionsRef:o,currentStateRef:r}=IT(),s=mo(v=>v.addSelectedEdges),a=v=>{console.log("connection",v),n(m=>mfe(v,m).filter(_=>!(OB(_)&&!yFe(_,v)&&CFe(_,v)))),setTimeout(()=>{const m=e.find(_=>{const y=v;return OB(_)&&_.source===y.source&&_.target===y.target&&(_.sourceHandle===y.sourceHandle||!_.sourceHandle&&!y.sourceHandle)&&(_.targetHandle===y.targetHandle||!_.targetHandle&&!y.targetHandle)});s([m].filter(_=>Boolean(_)).map(_=>_.id))})},l=x.exports.useRef(null),c=mo(v=>v.updateNodePositions),u=x.exports.useRef([]);mo(v=>(u.current=v.getNodes(),u));const d=v=>{var _;const m=v.dataTransfer.getData(QU);if(m){const y=Rq(m);if(y){const w=y.create();if(y.isUnique&&i.find(I=>{var k;return((k=I.data)==null?void 0:k.operatorType)===y.operatorType})){Xs.warning(`\u53EA\u5141\u8BB8\u5B58\u5728\u4E00\u4E2A${y.operatorName}`);return}const{clientX:L,clientY:D}=v,E=(_=l.current)==null?void 0:_.getBoundingClientRect();E&&(w.position={x:L-E.left,y:D-E.y}),t(I=>[...I,w]),setTimeout(()=>{var k,R;const I=u.current.find(A=>A.id===w.id);if(I){const A={x:((k=I==null?void 0:I.position)==null?void 0:k.x)-((I==null?void 0:I.width)||0)/2,y:I.position.y-Math.max(((I==null?void 0:I.height)||0)/5,30)};I.position=A,c([I],!1,!1)}t(A=>(A.find(N=>N.id===w.id)&&(w.style={visibility:"visible"}),[...A])),(R=y==null?void 0:y.onAfterCreate)==null||R.call(y,{node:I,currentState:r.current,actions:o.current})})}}},h=v=>{v.dataTransfer.types.includes(QU)&&v.preventDefault()},f=x.exports.useCallback(v=>{t(m=>Ffe(v,m))},[]),g=x.exports.useCallback(v=>{n(m=>T4e(v,m))},[]),p=x.exports.useCallback(()=>{const v=gNt(i,e);t([...v.nodes]),n([...v.edges])},[i,e]);return he("div",{className:dNt["main-flow"],ref:l,onDrop:d,onDragEnter:h,onDragOver:h,children:fn(Yfe,{nodeTypes:uNt,nodes:i,edges:e,onNodesChange:f,onEdgesChange:g,onConnect:a,zoomOnScroll:!1,defaultEdgeOptions:{animated:!0},children:[he(j5e,{variant:ku.Dots,gap:24,color:"rgba(255,255,255,0.4)",size:2}),he(R5e,{nodeColor:fNt,nodeStrokeWidth:3,zoomable:!0,pannable:!0}),he(W5e,{}),he(rD,{position:"top-left",children:he(hNt,{})}),he(rD,{position:"top-right",children:he(ts,{type:"text",style:{color:"white"},onClick:()=>{p()},children:"layout"})})]})})},mNt=()=>{var u,d;const e=el(h=>h.nodes).filter(h=>h.selected),t=(e==null?void 0:e.length)===1?e[0]:void 0,n=el(h=>h.nodes.find(f=>f.id===(t==null?void 0:t.id))),o=(u=n==null?void 0:n.data)==null?void 0:u.operatorType,r=fr(n),s=!!t&&o,{updateEdge:a,updateNode:l,setLayer:c}=t3();return fn("div",{children:[he("div",{children:"Attributes"}),s&&((d=r==null?void 0:r.generateAttributeControl)==null?void 0:d.call(r,{node:n,actions:{updateEdge:a,updateNode:l,setLayer:c}}))]})},vNt=()=>{var p,v,m;const{store:i,nodes:e,edges:t}=qGe(),[n,o]=x.exports.useState(),r=x.exports.useRef({}),s=new Tq(e,t),a=e.find(_=>{var y;return((y=fr(_))==null?void 0:y.operatorType)==="InputOperator"}),l=a?(p=fr(a))==null?void 0:p.getStatePort(a):[],c=a?(v=fr(a))==null?void 0:v.getEventPorts(a):[],u=e.find(_=>{var y;return((y=fr(_))==null?void 0:y.operatorType)==="OutputOperator"});x.exports.useEffect(()=>{console.log("store ==> ",i),r.current=Object.fromEntries((l==null?void 0:l.map(y=>[y.variableName,new Od(void 0)]))||[]);const _=i==null?void 0:i(r.current);console.log("init ==> ",_),o(_)},[i]),x.exports.useEffect(()=>{var y;if(!u)return;const _=(y=fr(u))==null?void 0:y.getEventPorts(u);_==null||_.forEach(w=>{var L;(L=n==null?void 0:n.output[w.variableName||""])==null||L.subscribe((D,E)=>{Xs.info(`value: ${D}`),console.log("events",w,D,E)})})},[n]);const[d,h]=x.exports.useState(""),[,f]=x.exports.useState([]),g=u?(m=fr(u))==null?void 0:m.getStatePort(u).map(_=>{var w,L;const y=(L=(w=s.findSourceNodes(u.id))==null?void 0:w.find(D=>D.handleId===_.id))==null?void 0:L.relatedHandleId;return{port:_,handleId:y}}):[];return x.exports.useEffect(()=>{g==null||g.map(({port:_})=>{var y;return(y=n==null?void 0:n.output)==null?void 0:y[_.variableName||""]}).forEach(_=>{_==null||_.subscribe((y,w)=>{console.log(y,w),f([])})})},[n]),he("div",{style:{display:"grid",gap:16,gridAutoFlow:"column",justifyContent:"start",marginBottom:16},children:(n==null?void 0:n.output)&&fn(ks,{children:[he("div",{children:he("div",{style:{display:"grid",gap:12},children:fn("div",{style:{display:"grid",gap:12},children:[l==null?void 0:l.map(_=>fn("div",{children:[_.label||_.variableName,":",he(lw,{onChange:y=>{var L,D;const w=y.target.value;console.log("instance",n),(D=(L=r.current)==null?void 0:L[_.variableName||""])==null||D.update(Number(w),new F4)}})]},_.id)),fn("div",{children:["Event Value:",he(lw,{value:d,onChange:_=>{h(_.target.value)},size:"small",placeholder:"\u53D1\u9001\u4E8B\u4EF6\u7684\u53C2\u6570\uFF08\u8BF7\u586B\u5199 JSON\uFF09"})]}),c==null?void 0:c.map(_=>he(ts,{onClick:()=>{var y,w;(w=(y=n==null?void 0:n.output)==null?void 0:y[_.variableName||""])==null||w.next(JSON.parse(d))},children:_.label||_.variableName},_.id))]})})}),fn("div",{children:[he("div",{children:"Output"}),g==null?void 0:g.map(({port:_})=>{var y,w;return he("div",{children:he(CD.Item,{label:_.label||_.variableName,children:JSON.stringify((w=(y=n==null?void 0:n.output)==null?void 0:y[_.variableName||""])==null?void 0:w.current)})},_.id)})]})]})})},_Nt="_editor_hp5fu_1";var bNt={editor:_Nt};const CNt=()=>{const{layer:i}=PEt(),[e,t]=x.exports.useState(""),[n,o]=x.exports.useState(""),[r,s]=x.exports.useState({layer:i}),[a,l]=x.exports.useState(!1);return fn("div",{children:[he("div",{children:"Console"}),he("br",{}),fn("div",{style:{display:"grid",gap:16,gridAutoFlow:"column",justifyContent:"start"},children:[he(ts,{type:"link",onClick:()=>{console.log(new Tq(i.nodes,i.edges)),console.log({layer:i})},children:"Console Graph"}),he(ts,{type:"link",onClick:()=>{const c=new Zie;t(c.complie({layer:i}))},children:"Compile"}),he(ts,{type:"link",onClick:()=>{const u=new Zie().complie({layer:i});s(Cc.exports.cloneDeep({layer:i})),t(u),o(u)},children:"Compile and Run"}),he(ts,{type:"link",disabled:!e,onClick:()=>{l(!0)},children:"Show Output"})]}),fn("div",{children:[he("br",{}),he(XGe,{value:n,nodes:r.layer.nodes,edges:r.layer.edges,children:he(vNt,{})})]}),he(Sq,{open:a,width:"100vw",style:{top:0},onOk:()=>{l(!1)},onCancel:()=>{l(!1)},children:he(nxe,{language:"typescript",readonly:!0,className:bNt.editor,code:e})})]})},yNt="_container_1hju3_1",wNt="_main_1hju3_10",SNt="_console_1hju3_13";var Iue={container:yNt,main:wNt,console:SNt};const xNt=()=>he("div",{className:Iue.container,children:he(BEt,{children:fn(FEt,{children:[he(sDt,{}),he(pNt,{}),he(mNt,{}),he("div",{className:Iue.console,children:he(CNt,{})})]})})});function LNt(){return he(ks,{children:he(xNt,{})})}tK.render(he(Bt.StrictMode,{children:he(LNt,{})}),document.getElementById("root"));export{hT as m,wye as t}; diff --git a/assets/javascript.fe852d41.js b/assets/javascript.0f9cbf01.js similarity index 89% rename from assets/javascript.fe852d41.js rename to assets/javascript.0f9cbf01.js index 07f7aba..94fea4c 100644 --- a/assets/javascript.fe852d41.js +++ b/assets/javascript.0f9cbf01.js @@ -1,4 +1,4 @@ -import{conf as t,language as e}from"./typescript.c49ce84c.js";import"./index.b7fee645.js";/*!----------------------------------------------------------------------------- +import{conf as t,language as e}from"./typescript.d26c4d00.js";import"./index.e0b83891.js";/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.44.0(3e047efd345ff102c8c61b5398fb30845aaac166) * Released under the MIT license diff --git a/assets/jsonMode.fdf27383.js b/assets/jsonMode.f3303325.js similarity index 99% rename from assets/jsonMode.fdf27383.js rename to assets/jsonMode.f3303325.js index 51490f4..b058f19 100644 --- a/assets/jsonMode.fdf27383.js +++ b/assets/jsonMode.f3303325.js @@ -1,4 +1,4 @@ -var Ge=Object.defineProperty;var Qe=(e,n,i)=>n in e?Ge(e,n,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[n]=i;var C=(e,n,i)=>(Qe(e,typeof n!="symbol"?n+"":n,i),i);import{m as Ze}from"./index.b7fee645.js";/*!----------------------------------------------------------------------------- +var Ge=Object.defineProperty;var Qe=(e,n,i)=>n in e?Ge(e,n,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[n]=i;var C=(e,n,i)=>(Qe(e,typeof n!="symbol"?n+"":n,i),i);import{m as Ze}from"./index.e0b83891.js";/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.44.0(3e047efd345ff102c8c61b5398fb30845aaac166) * Released under the MIT license diff --git a/assets/liquid.2fea4883.js b/assets/liquid.88902e43.js similarity index 98% rename from assets/liquid.2fea4883.js rename to assets/liquid.88902e43.js index c8cf209..b195f7a 100644 --- a/assets/liquid.2fea4883.js +++ b/assets/liquid.88902e43.js @@ -1,4 +1,4 @@ -import{m as d}from"./index.b7fee645.js";/*!----------------------------------------------------------------------------- +import{m as d}from"./index.e0b83891.js";/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.44.0(3e047efd345ff102c8c61b5398fb30845aaac166) * Released under the MIT license diff --git a/assets/mdx.8e3968ec.js b/assets/mdx.cb22bf12.js similarity index 98% rename from assets/mdx.8e3968ec.js rename to assets/mdx.cb22bf12.js index e4ea794..d92fd79 100644 --- a/assets/mdx.8e3968ec.js +++ b/assets/mdx.cb22bf12.js @@ -1,4 +1,4 @@ -import{m as d}from"./index.b7fee645.js";/*!----------------------------------------------------------------------------- +import{m as d}from"./index.e0b83891.js";/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.44.0(3e047efd345ff102c8c61b5398fb30845aaac166) * Released under the MIT license diff --git a/assets/python.b3efcf1e.js b/assets/python.6b3a176a.js similarity index 98% rename from assets/python.b3efcf1e.js rename to assets/python.6b3a176a.js index cfb76cf..25a0a3b 100644 --- a/assets/python.b3efcf1e.js +++ b/assets/python.6b3a176a.js @@ -1,4 +1,4 @@ -import{m as a}from"./index.b7fee645.js";/*!----------------------------------------------------------------------------- +import{m as a}from"./index.e0b83891.js";/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.44.0(3e047efd345ff102c8c61b5398fb30845aaac166) * Released under the MIT license diff --git a/assets/razor.f6f86f4c.js b/assets/razor.185f6816.js similarity index 99% rename from assets/razor.f6f86f4c.js rename to assets/razor.185f6816.js index 1a4dc53..92241f3 100644 --- a/assets/razor.f6f86f4c.js +++ b/assets/razor.185f6816.js @@ -1,4 +1,4 @@ -import{m as s}from"./index.b7fee645.js";/*!----------------------------------------------------------------------------- +import{m as s}from"./index.e0b83891.js";/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.44.0(3e047efd345ff102c8c61b5398fb30845aaac166) * Released under the MIT license diff --git a/assets/tsMode.cdbe9b4c.js b/assets/tsMode.f71d2839.js similarity index 99% rename from assets/tsMode.cdbe9b4c.js rename to assets/tsMode.f71d2839.js index 104549e..739b48a 100644 --- a/assets/tsMode.cdbe9b4c.js +++ b/assets/tsMode.f71d2839.js @@ -1,4 +1,4 @@ -var M=Object.defineProperty;var R=(e,t,r)=>t in e?M(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var _=(e,t,r)=>(R(e,typeof t!="symbol"?t+"":t,r),r);import{t as K,m as E}from"./index.b7fee645.js";/*!----------------------------------------------------------------------------- +var M=Object.defineProperty;var R=(e,t,r)=>t in e?M(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var _=(e,t,r)=>(R(e,typeof t!="symbol"?t+"":t,r),r);import{t as K,m as E}from"./index.e0b83891.js";/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.44.0(3e047efd345ff102c8c61b5398fb30845aaac166) * Released under the MIT license diff --git a/assets/typescript.c49ce84c.js b/assets/typescript.d26c4d00.js similarity index 98% rename from assets/typescript.c49ce84c.js rename to assets/typescript.d26c4d00.js index a1b12e6..5dc46b4 100644 --- a/assets/typescript.c49ce84c.js +++ b/assets/typescript.d26c4d00.js @@ -1,4 +1,4 @@ -import{m as a}from"./index.b7fee645.js";/*!----------------------------------------------------------------------------- +import{m as a}from"./index.e0b83891.js";/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.44.0(3e047efd345ff102c8c61b5398fb30845aaac166) * Released under the MIT license diff --git a/assets/xml.0e2004a8.js b/assets/xml.9a07e129.js similarity index 97% rename from assets/xml.0e2004a8.js rename to assets/xml.9a07e129.js index 84e4489..5a3143c 100644 --- a/assets/xml.0e2004a8.js +++ b/assets/xml.9a07e129.js @@ -1,4 +1,4 @@ -import{m}from"./index.b7fee645.js";/*!----------------------------------------------------------------------------- +import{m}from"./index.e0b83891.js";/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.44.0(3e047efd345ff102c8c61b5398fb30845aaac166) * Released under the MIT license diff --git a/assets/yaml.d8d18b9a.js b/assets/yaml.c0e89368.js similarity index 98% rename from assets/yaml.d8d18b9a.js rename to assets/yaml.c0e89368.js index b48bd94..4723315 100644 --- a/assets/yaml.d8d18b9a.js +++ b/assets/yaml.c0e89368.js @@ -1,4 +1,4 @@ -import{m as i}from"./index.b7fee645.js";/*!----------------------------------------------------------------------------- +import{m as i}from"./index.e0b83891.js";/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.44.0(3e047efd345ff102c8c61b5398fb30845aaac166) * Released under the MIT license diff --git a/index.html b/index.html index 7338108..d51229d 100644 --- a/index.html +++ b/index.html @@ -5,7 +5,7 @@ @eos/Flow - +