@cubejs-backend/server-core 1.7.37 → 1.7.38

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/README.md +4 -4
  2. package/dist/src/core/CompilerApi.d.ts.map +1 -1
  3. package/dist/src/core/CompilerApi.js.map +1 -1
  4. package/dist/src/core/DevServer.js +1 -1
  5. package/dist/src/core/OptsHandler.js +4 -4
  6. package/dist/src/core/OptsHandler.js.map +1 -1
  7. package/dist/src/core/RefreshScheduler.d.ts.map +1 -1
  8. package/dist/src/core/RefreshScheduler.js.map +1 -1
  9. package/dist/src/core/server.d.ts +7 -0
  10. package/dist/src/core/server.d.ts.map +1 -1
  11. package/dist/src/core/server.js +32 -2
  12. package/dist/src/core/server.js.map +1 -1
  13. package/package.json +14 -14
  14. package/playground/assets/{index-ux1YpTSs.js → index-BLNumV43.js} +14 -14
  15. package/playground/index.html +1 -1
  16. package/playground/manifest.json +2 -2
  17. package/playground/vizard/assets/{cssMode-PbVgDCx5.js → cssMode-EIMeoZ0D.js} +1 -1
  18. package/playground/vizard/assets/{freemarker2-CJRN0A1r.js → freemarker2-BjRjUUgK.js} +1 -1
  19. package/playground/vizard/assets/{handlebars-iTWM3ahM.js → handlebars-Cp-Otq7z.js} +1 -1
  20. package/playground/vizard/assets/{html-CpaHgWrY.js → html-9X_QuFNV.js} +1 -1
  21. package/playground/vizard/assets/{htmlMode-xt8whNAd.js → htmlMode-BVz_CiVZ.js} +1 -1
  22. package/playground/vizard/assets/{icons-DuVB-IiR.js → icons-D8fX1_2-.js} +4 -4
  23. package/playground/vizard/assets/{index-CXd1H6uJ.js → index-Cn46wccg.js} +215 -333
  24. package/playground/vizard/assets/{javascript-zOLCCWF1.js → javascript-BrlNfx48.js} +1 -1
  25. package/playground/vizard/assets/{jsonMode-mWIcOV2K.js → jsonMode-CAwYRRV9.js} +1 -1
  26. package/playground/vizard/assets/{liquid-Bu0TeitP.js → liquid-B5u8u5ff.js} +1 -1
  27. package/playground/vizard/assets/{mdx-uhxhQOIT.js → mdx-BGfI80Xw.js} +1 -1
  28. package/playground/vizard/assets/{monaco-B_IR9uhL.js → monaco-QpZRkR_O.js} +7 -7
  29. package/playground/vizard/assets/{python-4inBdLoB.js → python-eaj7SXr6.js} +1 -1
  30. package/playground/vizard/assets/{razor-BGbFglDZ.js → razor-mSmpvSb7.js} +1 -1
  31. package/playground/vizard/assets/{tsMode-DWjmFJDZ.js → tsMode-DeCT_7_p.js} +1 -1
  32. package/playground/vizard/assets/{typescript-3uQjFVUM.js → typescript-DHPJO5zk.js} +1 -1
  33. package/playground/vizard/assets/{uikit-M_i__YCU.js → uikit-B7SaluUF.js} +119 -119
  34. package/playground/vizard/assets/{xml-DnmeLHVb.js → xml-BzVPTsY-.js} +1 -1
  35. package/playground/vizard/assets/{yaml-ByRsSZUB.js → yaml-BQjIkRBM.js} +1 -1
  36. package/playground/vizard/download/react-typescript-antd-table.zip +0 -0
  37. package/playground/vizard/download/react-typescript-chartjs-area+bar+doughnut+line+pie.zip +0 -0
  38. package/playground/vizard/index.html +4 -4
  39. package/playground/vizard/preview/react-typescript-antd-table/assets/index-BUeSoip0.js +355 -0
  40. package/playground/vizard/preview/react-typescript-antd-table/index.html +1 -1
  41. package/playground/vizard/preview/react-typescript-chartjs-area+bar+doughnut+line+pie/assets/index-CqgSyhTK.js +57 -0
  42. package/playground/vizard/preview/react-typescript-chartjs-area+bar+doughnut+line+pie/index.html +1 -1
  43. package/playground/vizard/preview/react-typescript-antd-table/assets/index-C6xomtdV.js +0 -355
  44. package/playground/vizard/preview/react-typescript-chartjs-area+bar+doughnut+line+pie/assets/index-DlSl_JqR.js +0 -57
@@ -1,10 +1,10 @@
1
1
  function __vite__mapDeps(indexes) {
2
2
  if (!__vite__mapDeps.viteFileDeps) {
3
- __vite__mapDeps.viteFileDeps = ["assets/freemarker2-CJRN0A1r.js","assets/uikit-M_i__YCU.js","assets/react-CJahmRYQ.js","assets/other-HgnFgCOO.js","assets/icons-DuVB-IiR.js","assets/handlebars-iTWM3ahM.js","assets/html-CpaHgWrY.js","assets/javascript-zOLCCWF1.js","assets/typescript-3uQjFVUM.js","assets/liquid-Bu0TeitP.js","assets/mdx-uhxhQOIT.js","assets/python-4inBdLoB.js","assets/razor-BGbFglDZ.js","assets/xml-DnmeLHVb.js","assets/yaml-ByRsSZUB.js","assets/cssMode-PbVgDCx5.js","assets/htmlMode-xt8whNAd.js","assets/jsonMode-mWIcOV2K.js","assets/tsMode-DWjmFJDZ.js"]
3
+ __vite__mapDeps.viteFileDeps = ["assets/freemarker2-BjRjUUgK.js","assets/uikit-B7SaluUF.js","assets/react-CJahmRYQ.js","assets/other-HgnFgCOO.js","assets/icons-D8fX1_2-.js","assets/handlebars-Cp-Otq7z.js","assets/html-9X_QuFNV.js","assets/javascript-BrlNfx48.js","assets/typescript-DHPJO5zk.js","assets/liquid-B5u8u5ff.js","assets/mdx-BGfI80Xw.js","assets/python-eaj7SXr6.js","assets/razor-mSmpvSb7.js","assets/xml-BzVPTsY-.js","assets/yaml-BQjIkRBM.js","assets/cssMode-EIMeoZ0D.js","assets/htmlMode-BVz_CiVZ.js","assets/jsonMode-CAwYRRV9.js","assets/tsMode-DeCT_7_p.js"]
4
4
  }
5
5
  return indexes.map((i) => __vite__mapDeps.viteFileDeps[i])
6
6
  }
7
- import{_ as be}from"./uikit-M_i__YCU.js";function vo(o,e=0){return o[o.length-(1+e)]}function PH(o){if(o.length===0)throw new Error("Invalid tail call");return[o.slice(0,o.length-1),o[o.length-1]]}function mi(o,e,t=(i,n)=>i===n){if(o===e)return!0;if(!o||!e||o.length!==e.length)return!1;for(let i=0,n=o.length;i<n;i++)if(!t(o[i],e[i]))return!1;return!0}function OH(o,e){const t=o.length-1;e<t&&(o[e]=o[t]),o.pop()}function B_(o,e,t){return FH(o.length,i=>t(o[i],e))}function FH(o,e){let t=0,i=o-1;for(;t<=i;){const n=(t+i)/2|0,s=e(n);if(s<0)t=n+1;else if(s>0)i=n-1;else return n}return-(t+1)}function $D(o,e,t){if(o=o|0,o>=e.length)throw new TypeError("invalid index");const i=e[Math.floor(e.length*Math.random())],n=[],s=[],r=[];for(const a of e){const l=t(a,i);l<0?n.push(a):l>0?s.push(a):r.push(a)}return o<n.length?$D(o,n,t):o<n.length+r.length?r[0]:$D(o-(n.length+r.length),s,t)}function LA(o,e){const t=[];let i;for(const n of o.slice(0).sort(e))!i||e(i[0],n)!==0?(i=[n],t.push(i)):i.push(n);return t}function*M3(o,e){let t,i;for(const n of o)i!==void 0&&e(i,n)?t.push(n):(t&&(yield t),t=[n]),i=n;t&&(yield t)}function A3(o,e){for(let t=0;t<=o.length;t++)e(t===0?void 0:o[t-1],t===o.length?void 0:o[t])}function BH(o,e){for(let t=0;t<o.length;t++)e(t===0?void 0:o[t-1],o[t],t+1===o.length?void 0:o[t+1])}function Za(o){return o.filter(e=>!!e)}function xA(o){let e=0;for(let t=0;t<o.length;t++)o[t]&&(o[e]=o[t],e+=1);o.length=e}function P3(o){return!Array.isArray(o)||o.length===0}function Fn(o){return Array.isArray(o)&&o.length>0}function bc(o,e=t=>t){const t=new Set;return o.filter(i=>{const n=e(i);return t.has(n)?!1:(t.add(n),!0)})}function O3(o,e){return o.length>0?o[0]:e}function Xn(o,e){let t=typeof e=="number"?o:0;typeof e=="number"?t=o:(t=0,e=o);const i=[];if(t<=e)for(let n=t;n<e;n++)i.push(n);else for(let n=t;n>e;n--)i.push(n);return i}function CS(o,e,t){const i=o.slice(0,e),n=o.slice(e);return i.concat(t,n)}function VL(o,e){const t=o.indexOf(e);t>-1&&(o.splice(t,1),o.unshift(e))}function ub(o,e){const t=o.indexOf(e);t>-1&&(o.splice(t,1),o.push(e))}function jD(o,e){for(const t of e)o.push(t)}function i2(o){return Array.isArray(o)?o:[o]}function WH(o,e,t){const i=F3(o,e),n=o.length,s=t.length;o.length=n+s;for(let r=n-1;r>=i;r--)o[r+s]=o[r];for(let r=0;r<s;r++)o[r+i]=t[r]}function DA(o,e,t,i){const n=F3(o,e);let s=o.splice(n,t);return s===void 0&&(s=[]),WH(o,n,i),s}function F3(o,e){return e<0?Math.max(e+o.length,0):Math.min(e,o.length)}var W_;(function(o){function e(s){return s<0}o.isLessThan=e;function t(s){return s<=0}o.isLessThanOrEqual=t;function i(s){return s>0}o.isGreaterThan=i;function n(s){return s===0}o.isNeitherLessOrGreaterThan=n,o.greaterThan=1,o.lessThan=-1,o.neitherLessOrGreaterThan=0})(W_||(W_={}));function Eo(o,e){return(t,i)=>e(o(t),o(i))}function VH(...o){return(e,t)=>{for(const i of o){const n=i(e,t);if(!W_.isNeitherLessOrGreaterThan(n))return n}return W_.neitherLessOrGreaterThan}}const Zl=(o,e)=>o-e,HH=(o,e)=>Zl(o?1:0,e?1:0);function B3(o){return(e,t)=>-o(e,t)}class od{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<this.items.length&&e(this.items[t]);)t++;const i=t===this.firstIdx?null:this.items.slice(this.firstIdx,t);return this.firstIdx=t,i}takeFromEndWhile(e){let t=this.lastIdx;for(;t>=0&&e(this.items[t]);)t--;const i=t===this.lastIdx?null:this.items.slice(t+1,this.lastIdx+1);return this.lastIdx=t,i}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 $a{constructor(e){this.iterate=e}toArray(){const e=[];return this.iterate(t=>(e.push(t),!0)),e}filter(e){return new $a(t=>this.iterate(i=>e(i)?t(i):!0))}map(e){return new $a(t=>this.iterate(i=>t(e(i))))}findLast(e){let t;return this.iterate(i=>(e(i)&&(t=i),!0)),t}findLastMaxBy(e){let t,i=!0;return this.iterate(n=>((i||W_.isGreaterThan(e(n,t)))&&(i=!1,t=n),!0)),t}}$a.empty=new $a(o=>{});function rs(o){return typeof o=="string"}function is(o){return typeof o=="object"&&o!==null&&!Array.isArray(o)&&!(o instanceof RegExp)&&!(o instanceof Date)}function zH(o){const e=Object.getPrototypeOf(Uint8Array);return typeof o=="object"&&o instanceof e}function Cc(o){return typeof o=="number"&&!isNaN(o)}function kA(o){return!!o&&typeof o[Symbol.iterator]=="function"}function W3(o){return o===!0||o===!1}function Rs(o){return typeof o>"u"}function V_(o){return!Ys(o)}function Ys(o){return Rs(o)||o===null}function xt(o,e){if(!o)throw new Error(e?`Unexpected type, expected '${e}'`:"Unexpected type")}function Wh(o){if(Ys(o))throw new Error("Assertion Failed: argument is undefined or null");return o}function H_(o){return typeof o=="function"}function UH(o,e){const t=Math.min(o.length,e.length);for(let i=0;i<t;i++)$H(o[i],e[i])}function $H(o,e){if(rs(e)){if(typeof o!==e)throw new Error(`argument does not match constraint: typeof ${e}`)}else if(H_(e)){try{if(o instanceof e)return}catch{}if(!Ys(o)&&o.constructor===e||e.length===1&&e.call(void 0,o)===!0)return;throw new Error("argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true")}}function Il(o){if(!o||typeof o!="object"||o instanceof RegExp)return o;const e=Array.isArray(o)?[]:{};return Object.entries(o).forEach(([t,i])=>{e[t]=i&&typeof i=="object"?Il(i):i}),e}function jH(o){if(!o||typeof o!="object")return o;const e=[o];for(;e.length>0;){const t=e.shift();Object.freeze(t);for(const i in t)if(V3.call(t,i)){const n=t[i];typeof n=="object"&&!Object.isFrozen(n)&&!zH(n)&&e.push(n)}}return o}const V3=Object.prototype.hasOwnProperty;function H3(o,e){return KD(o,e,new Set)}function KD(o,e,t){if(Ys(o))return o;const i=e(o);if(typeof i<"u")return i;if(Array.isArray(o)){const n=[];for(const s of o)n.push(KD(s,e,t));return n}if(is(o)){if(t.has(o))throw new Error("Cannot clone recursive data-structure");t.add(o);const n={};for(const s in o)V3.call(o,s)&&(n[s]=KD(o[s],e,t));return t.delete(o),n}return o}function wS(o,e,t=!0){return is(o)?(is(e)&&Object.keys(e).forEach(i=>{i in o?t&&(is(o[i])&&is(e[i])?wS(o[i],e[i],t):o[i]=e[i]):o[i]=e[i]}),o):e}function oo(o,e){if(o===e)return!0;if(o==null||e===null||e===void 0||typeof o!=typeof e||typeof o!="object"||Array.isArray(o)!==Array.isArray(e))return!1;let t,i;if(Array.isArray(o)){if(o.length!==e.length)return!1;for(t=0;t<o.length;t++)if(!oo(o[t],e[t]))return!1}else{const n=[];for(i in o)n.push(i);n.sort();const s=[];for(i in e)s.push(i);if(s.sort(),!oo(n,s))return!1;for(t=0;t<n.length;t++)if(!oo(o[n[t]],e[n[t]]))return!1}return!0}function KH(o){let e=[];for(;Object.prototype!==o;)e=e.concat(Object.getOwnPropertyNames(o)),o=Object.getPrototypeOf(o);return e}function n2(o){const e=[];for(const t of KH(o))typeof o[t]=="function"&&e.push(t);return e}function qH(o,e){const t=n=>function(){const s=Array.prototype.slice.call(arguments,0);return e(n,s)},i={};for(const n of o)i[n]=t(n);return i}let GH=typeof document<"u"&&document.location&&document.location.hash.indexOf("pseudo=true")>=0;function ZH(o,e){let t;return e.length===0?t=o:t=o.replace(/\{(\d+)\}/g,(i,n)=>{const s=n[0],r=e[s];let a=i;return typeof r=="string"?a=r:(typeof r=="number"||typeof r=="boolean"||r===void 0||r===null)&&(a=String(r)),a}),GH&&(t="["+t.replace(/[aouei]/g,"$&$&")+"]"),t}function g(o,e,...t){return ZH(e,t)}var HL;const Vf="en";let _1=!1,v1=!1,RC=!1,z3=!1,s2=!1,o2=!1,U3=!1,fb,MC=Vf,IA=Vf,YH,Lr;const sr=typeof self=="object"?self:typeof global=="object"?global:{};let Qn;typeof sr.vscode<"u"&&typeof sr.vscode.process<"u"?Qn=sr.vscode.process:typeof process<"u"&&(Qn=process);const XH=typeof((HL=Qn?.versions)===null||HL===void 0?void 0:HL.electron)=="string",QH=XH&&Qn?.type==="renderer";if(typeof navigator=="object"&&!QH)Lr=navigator.userAgent,_1=Lr.indexOf("Windows")>=0,v1=Lr.indexOf("Macintosh")>=0,o2=(Lr.indexOf("Macintosh")>=0||Lr.indexOf("iPad")>=0||Lr.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,RC=Lr.indexOf("Linux")>=0,U3=Lr?.indexOf("Mobi")>=0,s2=!0,g({key:"ensureLoaderPluginIsLoaded",comment:["{Locked}"]},"_"),fb=Vf,MC=fb,IA=navigator.language;else if(typeof Qn=="object"){_1=Qn.platform==="win32",v1=Qn.platform==="darwin",RC=Qn.platform==="linux",RC&&Qn.env.SNAP&&Qn.env.SNAP_REVISION,Qn.env.CI||Qn.env.BUILD_ARTIFACTSTAGINGDIRECTORY,fb=Vf,MC=Vf;const o=Qn.env.VSCODE_NLS_CONFIG;if(o)try{const e=JSON.parse(o),t=e.availableLanguages["*"];fb=e.locale,IA=e.osLocale,MC=t||Vf,YH=e._translationsConfigFile}catch{}z3=!0}else console.error("Unable to resolve platform.");const En=_1,at=v1,Zn=RC,jr=z3,Kc=s2,JH=s2&&typeof sr.importScripts=="function",Xr=o2,ez=U3,Ya=Lr,tz=MC,iz=typeof sr.postMessage=="function"&&!sr.importScripts,$3=(()=>{if(iz){const o=[];sr.addEventListener("message",t=>{if(t.data&&t.data.vscodeScheduleAsyncWork)for(let i=0,n=o.length;i<n;i++){const s=o[i];if(s.id===t.data.vscodeScheduleAsyncWork){o.splice(i,1),s.callback();return}}});let e=0;return t=>{const i=++e;o.push({id:i,callback:t}),sr.postMessage({vscodeScheduleAsyncWork:i},"*")}}return o=>setTimeout(o)})(),to=v1||o2?2:_1?1:3;let EA=!0,NA=!1;function j3(){if(!NA){NA=!0;const o=new Uint8Array(2);o[0]=1,o[1]=2,EA=new Uint16Array(o.buffer)[0]===513}return EA}const K3=!!(Ya&&Ya.indexOf("Chrome")>=0),nz=!!(Ya&&Ya.indexOf("Firefox")>=0),sz=!!(!K3&&Ya&&Ya.indexOf("Safari")>=0),oz=!!(Ya&&Ya.indexOf("Edg/")>=0);Ya&&Ya.indexOf("Android")>=0;const An={tabSize:4,indentSize:4,insertSpaces:!0,detectIndentation:!0,trimAutoWhitespace:!0,largeFileOptimizations:!0,bracketPairColorizationOptions:{enabled:!0,independentColorPoolPerBracketType:!1}};var Xe;(function(o){function e(b){return b&&typeof b=="object"&&typeof b[Symbol.iterator]=="function"}o.is=e;const t=Object.freeze([]);function i(){return t}o.empty=i;function*n(b){yield b}o.single=n;function s(b){return e(b)?b:n(b)}o.wrap=s;function r(b){return b||t}o.from=r;function*a(b){for(let C=b.length-1;C>=0;C--)yield b[C]}o.reverse=a;function l(b){return!b||b[Symbol.iterator]().next().done===!0}o.isEmpty=l;function d(b){return b[Symbol.iterator]().next().value}o.first=d;function c(b,C){for(const w of b)if(C(w))return!0;return!1}o.some=c;function h(b,C){for(const w of b)if(C(w))return w}o.find=h;function*u(b,C){for(const w of b)C(w)&&(yield w)}o.filter=u;function*f(b,C){let w=0;for(const S of b)yield C(S,w++)}o.map=f;function*p(...b){for(const C of b)for(const w of C)yield w}o.concat=p;function m(b,C,w){let S=w;for(const D of b)S=C(S,D);return S}o.reduce=m;function*v(b,C,w=b.length){for(C<0&&(C+=b.length),w<0?w+=b.length:w>b.length&&(w=b.length);C<w;C++)yield b[C]}o.slice=v;function _(b,C=Number.POSITIVE_INFINITY){const w=[];if(C===0)return[w,b];const S=b[Symbol.iterator]();for(let D=0;D<C;D++){const x=S.next();if(x.done)return[w,o.empty()];w.push(x.value)}return[w,{[Symbol.iterator](){return S}}]}o.consume=_})(Xe||(Xe={}));let Ti=class qD{constructor(e){this.element=e,this.next=qD.Undefined,this.prev=qD.Undefined}};Ti.Undefined=new Ti(void 0);class ns{constructor(){this._first=Ti.Undefined,this._last=Ti.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===Ti.Undefined}clear(){let e=this._first;for(;e!==Ti.Undefined;){const t=e.next;e.prev=Ti.Undefined,e.next=Ti.Undefined,e=t}this._first=Ti.Undefined,this._last=Ti.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){const i=new Ti(e);if(this._first===Ti.Undefined)this._first=i,this._last=i;else if(t){const s=this._last;this._last=i,i.prev=s,s.next=i}else{const s=this._first;this._first=i,i.next=s,s.prev=i}this._size+=1;let n=!1;return()=>{n||(n=!0,this._remove(i))}}shift(){if(this._first!==Ti.Undefined){const e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==Ti.Undefined){const e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==Ti.Undefined&&e.next!==Ti.Undefined){const t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===Ti.Undefined&&e.next===Ti.Undefined?(this._first=Ti.Undefined,this._last=Ti.Undefined):e.next===Ti.Undefined?(this._last=this._last.prev,this._last.next=Ti.Undefined):e.prev===Ti.Undefined&&(this._first=this._first.next,this._first.prev=Ti.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==Ti.Undefined;)yield e.element,e=e.next}}const q3="`~!@#$%^&*()-=+[{]}\\|;:'\",.<>/?";function rz(o=""){let e="(-?\\d*\\.\\d\\w*)|([^";for(const t of q3)o.indexOf(t)>=0||(e+="\\"+t);return e+="\\s]+)",new RegExp(e,"g")}const r2=rz();function G3(o){let e=r2;if(o&&o instanceof RegExp)if(o.global)e=o;else{let t="g";o.ignoreCase&&(t+="i"),o.multiline&&(t+="m"),o.unicode&&(t+="u"),e=new RegExp(o.source,t)}return e.lastIndex=0,e}const Z3=new ns;Z3.unshift({maxLen:1e3,windowSize:15,timeBudget:150});function z_(o,e,t,i,n){if(n||(n=Xe.first(Z3)),t.length>n.maxLen){let d=o-n.maxLen/2;return d<0?d=0:i+=d,t=t.substring(d,o+n.maxLen/2),z_(o,e,t,i,n)}const s=Date.now(),r=o-1-i;let a=-1,l=null;for(let d=1;!(Date.now()-s>=n.timeBudget);d++){const c=r-n.windowSize*d;e.lastIndex=Math.max(0,c);const h=az(e,t,r,a);if(!h&&l||(l=h,c<=0))break;a=c}if(l){const d={word:l[0],startColumn:i+1+l.index,endColumn:i+1+l.index+l[0].length};return e.lastIndex=0,d}return null}function az(o,e,t,i){let n;for(;n=o.exec(e);){const s=n.index||0;if(s<=t&&o.lastIndex>=t)return n;if(i>0&&s>i)return null}return null}const Dd=8;class Y3{constructor(e){this._values=e}hasChanged(e){return this._values[e]}}class X3{constructor(){this.stableMinimapLayoutInput=null,this.stableFitMaxMinimapScale=0,this.stableFitRemainingWidth=0}}class Qt{constructor(e,t,i,n){this.id=e,this.name=t,this.defaultValue=i,this.schema=n}applyUpdate(e,t){return SS(e,t)}compute(e,t,i){return i}}class o_{constructor(e,t){this.newValue=e,this.didChange=t}}function SS(o,e){if(typeof o!="object"||typeof e!="object"||!o||!e)return new o_(e,o!==e);if(Array.isArray(o)||Array.isArray(e)){const i=Array.isArray(o)&&Array.isArray(e)&&mi(o,e);return new o_(e,!i)}let t=!1;for(const i in e)if(e.hasOwnProperty(i)){const n=SS(o[i],e[i]);n.didChange&&(o[i]=n.newValue,t=!0)}return new o_(o,t)}class _0{constructor(e){this.schema=void 0,this.id=e,this.name="_never_",this.defaultValue=void 0}applyUpdate(e,t){return SS(e,t)}validate(e){return this.defaultValue}}class Rp{constructor(e,t,i,n){this.id=e,this.name=t,this.defaultValue=i,this.schema=n}applyUpdate(e,t){return SS(e,t)}validate(e){return typeof e>"u"?this.defaultValue:e}compute(e,t,i){return i}}function Se(o,e){return typeof o>"u"?e:o==="false"?!1:!!o}class ct extends Rp{constructor(e,t,i,n=void 0){typeof n<"u"&&(n.type="boolean",n.default=i),super(e,t,i,n)}validate(e){return Se(e,this.defaultValue)}}function bh(o,e,t,i){if(typeof o>"u")return e;let n=parseInt(o,10);return isNaN(n)?e:(n=Math.max(t,n),n=Math.min(i,n),n|0)}class It extends Rp{static clampedInt(e,t,i,n){return bh(e,t,i,n)}constructor(e,t,i,n,s,r=void 0){typeof r<"u"&&(r.type="integer",r.default=i,r.minimum=n,r.maximum=s),super(e,t,i,r),this.minimum=n,this.maximum=s}validate(e){return It.clampedInt(e,this.defaultValue,this.minimum,this.maximum)}}function lz(o,e,t,i){if(typeof o>"u")return e;const n=Jo.float(o,e);return Jo.clamp(n,t,i)}class Jo extends Rp{static clamp(e,t,i){return e<t?t:e>i?i:e}static float(e,t){if(typeof e=="number")return e;if(typeof e>"u")return t;const i=parseFloat(e);return isNaN(i)?t:i}constructor(e,t,i,n,s){typeof s<"u"&&(s.type="number",s.default=i),super(e,t,i,s),this.validationFn=n}validate(e){return this.validationFn(Jo.float(e,this.defaultValue))}}class Es extends Rp{static string(e,t){return typeof e!="string"?t:e}constructor(e,t,i,n=void 0){typeof n<"u"&&(n.type="string",n.default=i),super(e,t,i,n)}validate(e){return Es.string(e,this.defaultValue)}}function Ci(o,e,t,i){return typeof o!="string"?e:i&&o in i?i[o]:t.indexOf(o)===-1?e:o}class si extends Rp{constructor(e,t,i,n,s=void 0){typeof s<"u"&&(s.type="string",s.enum=n,s.default=i),super(e,t,i,s),this._allowedValues=n}validate(e){return Ci(e,this.defaultValue,this._allowedValues)}}class gb extends Qt{constructor(e,t,i,n,s,r,a=void 0){typeof a<"u"&&(a.type="string",a.enum=s,a.default=n),super(e,t,i,a),this._allowedValues=s,this._convert=r}validate(e){return typeof e!="string"?this.defaultValue:this._allowedValues.indexOf(e)===-1?this.defaultValue:this._convert(e)}}function dz(o){switch(o){case"none":return 0;case"keep":return 1;case"brackets":return 2;case"advanced":return 3;case"full":return 4}}class cz extends Qt{constructor(){super(2,"accessibilitySupport",0,{type:"string",enum:["auto","on","off"],enumDescriptions:[g("accessibilitySupport.auto","Use platform APIs to detect when a Screen Reader is attached"),g("accessibilitySupport.on","Optimize for usage with a Screen Reader"),g("accessibilitySupport.off","Assume a screen reader is not attached")],default:"auto",tags:["accessibility"],description:g("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,i){return i===0?e.accessibilitySupport:i}}class hz extends Qt{constructor(){const e={insertSpace:!0,ignoreEmptyLines:!0};super(23,"comments",e,{"editor.comments.insertSpace":{type:"boolean",default:e.insertSpace,description:g("comments.insertSpace","Controls whether a space character is inserted when commenting.")},"editor.comments.ignoreEmptyLines":{type:"boolean",default:e.ignoreEmptyLines,description:g("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:Se(t.insertSpace,this.defaultValue.insertSpace),ignoreEmptyLines:Se(t.ignoreEmptyLines,this.defaultValue.ignoreEmptyLines)}}}function uz(o){switch(o){case"blink":return 1;case"smooth":return 2;case"phase":return 3;case"expand":return 4;case"solid":return 5}}var dn;(function(o){o[o.Line=1]="Line",o[o.Block=2]="Block",o[o.Underline=3]="Underline",o[o.LineThin=4]="LineThin",o[o.BlockOutline=5]="BlockOutline",o[o.UnderlineThin=6]="UnderlineThin"})(dn||(dn={}));function fz(o){switch(o){case"line":return dn.Line;case"block":return dn.Block;case"underline":return dn.Underline;case"line-thin":return dn.LineThin;case"block-outline":return dn.BlockOutline;case"underline-thin":return dn.UnderlineThin}}class gz extends _0{constructor(){super(140)}compute(e,t,i){const n=["monaco-editor"];return t.get(39)&&n.push(t.get(39)),e.extraEditorClassName&&n.push(e.extraEditorClassName),t.get(73)==="default"?n.push("mouse-default"):t.get(73)==="copy"&&n.push("mouse-copy"),t.get(110)&&n.push("showUnused"),t.get(138)&&n.push("showDeprecated"),n.join(" ")}}class pz extends ct{constructor(){super(37,"emptySelectionClipboard",!0,{description:g("emptySelectionClipboard","Controls whether copying without a selection copies the current line.")})}compute(e,t,i){return i&&e.emptySelectionClipboard}}class mz extends Qt{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:g("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:[g("editor.find.seedSearchStringFromSelection.never","Never seed search string from the editor selection."),g("editor.find.seedSearchStringFromSelection.always","Always seed search string from the editor selection, including word at cursor position."),g("editor.find.seedSearchStringFromSelection.selection","Only seed search string from the editor selection.")],description:g("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:[g("editor.find.autoFindInSelection.never","Never turn on Find in Selection automatically (default)."),g("editor.find.autoFindInSelection.always","Always turn on Find in Selection automatically."),g("editor.find.autoFindInSelection.multiline","Turn on Find in Selection automatically when multiple lines of content are selected.")],description:g("find.autoFindInSelection","Controls the condition for turning on Find in Selection automatically.")},"editor.find.globalFindClipboard":{type:"boolean",default:e.globalFindClipboard,description:g("find.globalFindClipboard","Controls whether the Find Widget should read or modify the shared find clipboard on macOS."),included:at},"editor.find.addExtraSpaceOnTop":{type:"boolean",default:e.addExtraSpaceOnTop,description:g("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:g("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:Se(t.cursorMoveOnType,this.defaultValue.cursorMoveOnType),seedSearchStringFromSelection:typeof e.seedSearchStringFromSelection=="boolean"?e.seedSearchStringFromSelection?"always":"never":Ci(t.seedSearchStringFromSelection,this.defaultValue.seedSearchStringFromSelection,["never","always","selection"]),autoFindInSelection:typeof e.autoFindInSelection=="boolean"?e.autoFindInSelection?"always":"never":Ci(t.autoFindInSelection,this.defaultValue.autoFindInSelection,["never","always","multiline"]),globalFindClipboard:Se(t.globalFindClipboard,this.defaultValue.globalFindClipboard),addExtraSpaceOnTop:Se(t.addExtraSpaceOnTop,this.defaultValue.addExtraSpaceOnTop),loop:Se(t.loop,this.defaultValue.loop)}}}class Xs extends Qt{constructor(){super(51,"fontLigatures",Xs.OFF,{anyOf:[{type:"boolean",description:g("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:g("fontFeatureSettings","Explicit 'font-feature-settings' CSS property. A boolean can be passed instead if one only needs to turn on/off ligatures.")}],description:g("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>"u"?this.defaultValue:typeof e=="string"?e==="false"?Xs.OFF:e==="true"?Xs.ON:e:e?Xs.ON:Xs.OFF}}Xs.OFF='"liga" off, "calt" off';Xs.ON='"liga" on, "calt" on';class Wr extends Qt{constructor(){super(54,"fontVariations",Wr.OFF,{anyOf:[{type:"boolean",description:g("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:g("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:g("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>"u"?this.defaultValue:typeof e=="string"?e==="false"?Wr.OFF:e==="true"?Wr.TRANSLATE:e:e?Wr.TRANSLATE:Wr.OFF}compute(e,t,i){return e.fontInfo.fontVariationSettings}}Wr.OFF="normal";Wr.TRANSLATE="translate";class _z extends _0{constructor(){super(50)}compute(e,t,i){return e.fontInfo}}class vz extends Rp{constructor(){super(52,"fontSize",Ps.fontSize,{type:"number",minimum:6,maximum:100,default:Ps.fontSize,description:g("fontSize","Controls the font size in pixels.")})}validate(e){const t=Jo.float(e,this.defaultValue);return t===0?Ps.fontSize:Jo.clamp(t,6,100)}compute(e,t,i){return e.fontInfo.fontSize}}class xa extends Qt{constructor(){super(53,"fontWeight",Ps.fontWeight,{anyOf:[{type:"number",minimum:xa.MINIMUM_VALUE,maximum:xa.MAXIMUM_VALUE,errorMessage:g("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:xa.SUGGESTION_VALUES}],default:Ps.fontWeight,description:g("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(It.clampedInt(e,Ps.fontWeight,xa.MINIMUM_VALUE,xa.MAXIMUM_VALUE))}}xa.SUGGESTION_VALUES=["normal","bold","100","200","300","400","500","600","700","800","900"];xa.MINIMUM_VALUE=1;xa.MAXIMUM_VALUE=1e3;class bz extends Qt{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:[g("editor.gotoLocation.multiple.peek","Show Peek view of the results (default)"),g("editor.gotoLocation.multiple.gotoAndPeek","Go to the primary result and show a Peek view"),g("editor.gotoLocation.multiple.goto","Go to the primary result and enable Peek-less navigation to others")]},i=["","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:g("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:g("editor.editor.gotoLocation.multipleDefinitions","Controls the behavior the 'Go to Definition'-command when multiple target locations exist.")},t),"editor.gotoLocation.multipleTypeDefinitions":Object.assign({description:g("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:g("editor.editor.gotoLocation.multipleDeclarations","Controls the behavior the 'Go to Declaration'-command when multiple target locations exist.")},t),"editor.gotoLocation.multipleImplementations":Object.assign({description:g("editor.editor.gotoLocation.multipleImplemenattions","Controls the behavior the 'Go to Implementations'-command when multiple target locations exist.")},t),"editor.gotoLocation.multipleReferences":Object.assign({description:g("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:i,description:g("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:i,description:g("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:i,description:g("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:i,description:g("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:i,description:g("alternativeReferenceCommand","Alternative command id that is being executed when the result of 'Go to Reference' is the current location.")}})}validate(e){var t,i,n,s,r;if(!e||typeof e!="object")return this.defaultValue;const a=e;return{multiple:Ci(a.multiple,this.defaultValue.multiple,["peek","gotoAndPeek","goto"]),multipleDefinitions:(t=a.multipleDefinitions)!==null&&t!==void 0?t:Ci(a.multipleDefinitions,"peek",["peek","gotoAndPeek","goto"]),multipleTypeDefinitions:(i=a.multipleTypeDefinitions)!==null&&i!==void 0?i:Ci(a.multipleTypeDefinitions,"peek",["peek","gotoAndPeek","goto"]),multipleDeclarations:(n=a.multipleDeclarations)!==null&&n!==void 0?n:Ci(a.multipleDeclarations,"peek",["peek","gotoAndPeek","goto"]),multipleImplementations:(s=a.multipleImplementations)!==null&&s!==void 0?s:Ci(a.multipleImplementations,"peek",["peek","gotoAndPeek","goto"]),multipleReferences:(r=a.multipleReferences)!==null&&r!==void 0?r:Ci(a.multipleReferences,"peek",["peek","gotoAndPeek","goto"]),alternativeDefinitionCommand:Es.string(a.alternativeDefinitionCommand,this.defaultValue.alternativeDefinitionCommand),alternativeTypeDefinitionCommand:Es.string(a.alternativeTypeDefinitionCommand,this.defaultValue.alternativeTypeDefinitionCommand),alternativeDeclarationCommand:Es.string(a.alternativeDeclarationCommand,this.defaultValue.alternativeDeclarationCommand),alternativeImplementationCommand:Es.string(a.alternativeImplementationCommand,this.defaultValue.alternativeImplementationCommand),alternativeReferenceCommand:Es.string(a.alternativeReferenceCommand,this.defaultValue.alternativeReferenceCommand)}}}class Cz extends Qt{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:g("hover.enabled","Controls whether the hover is shown.")},"editor.hover.delay":{type:"number",default:e.delay,minimum:0,maximum:1e4,description:g("hover.delay","Controls the delay in milliseconds after which the hover is shown.")},"editor.hover.sticky":{type:"boolean",default:e.sticky,description:g("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:g("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:g("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:Se(t.enabled,this.defaultValue.enabled),delay:It.clampedInt(t.delay,this.defaultValue.delay,0,1e4),sticky:Se(t.sticky,this.defaultValue.sticky),hidingDelay:It.clampedInt(t.hidingDelay,this.defaultValue.hidingDelay,0,6e5),above:Se(t.above,this.defaultValue.above)}}}class fg extends _0{constructor(){super(143)}compute(e,t,i){return fg.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,i=Math.floor(e.paddingTop/e.lineHeight);let n=Math.floor(e.paddingBottom/e.lineHeight);e.scrollBeyondLastLine&&(n=Math.max(n,t-1));const s=(i+e.viewLineCount+n)/(e.pixelRatio*e.height),r=Math.floor(e.viewLineCount/s);return{typicalViewportLineCount:t,extraLinesBeforeFirstLine:i,extraLinesBeyondLastLine:n,desiredRatio:s,minimapLineCount:r}}static _computeMinimapLayout(e,t){const i=e.outerWidth,n=e.outerHeight,s=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(s*n),minimapCanvasOuterWidth:0,minimapCanvasOuterHeight:n};const r=t.stableMinimapLayoutInput,a=r&&e.outerHeight===r.outerHeight&&e.lineHeight===r.lineHeight&&e.typicalHalfwidthCharacterWidth===r.typicalHalfwidthCharacterWidth&&e.pixelRatio===r.pixelRatio&&e.scrollBeyondLastLine===r.scrollBeyondLastLine&&e.paddingTop===r.paddingTop&&e.paddingBottom===r.paddingBottom&&e.minimap.enabled===r.minimap.enabled&&e.minimap.side===r.minimap.side&&e.minimap.size===r.minimap.size&&e.minimap.showSlider===r.minimap.showSlider&&e.minimap.renderCharacters===r.minimap.renderCharacters&&e.minimap.maxColumn===r.minimap.maxColumn&&e.minimap.scale===r.minimap.scale&&e.verticalScrollbarWidth===r.verticalScrollbarWidth&&e.isViewportWrapping===r.isViewportWrapping,l=e.lineHeight,d=e.typicalHalfwidthCharacterWidth,c=e.scrollBeyondLastLine,h=e.minimap.renderCharacters;let u=s>=2?Math.round(e.minimap.scale*2):e.minimap.scale;const f=e.minimap.maxColumn,p=e.minimap.size,m=e.minimap.side,v=e.verticalScrollbarWidth,_=e.viewLineCount,b=e.remainingWidth,C=e.isViewportWrapping,w=h?2:3;let S=Math.floor(s*n);const D=S/s;let x=!1,I=!1,N=w*u,W=u/s,U=1;if(p==="fill"||p==="fit"){const{typicalViewportLineCount:xe,extraLinesBeforeFirstLine:me,extraLinesBeyondLastLine:Fe,desiredRatio:Oe,minimapLineCount:Le}=fg.computeContainedMinimapLineCount({viewLineCount:_,scrollBeyondLastLine:c,paddingTop:e.paddingTop,paddingBottom:e.paddingBottom,height:n,lineHeight:l,pixelRatio:s});if(_/Le>1)x=!0,I=!0,u=1,N=1,W=u/s;else{let xi=!1,_n=u+1;if(p==="fit"){const Oi=Math.ceil((me+_+Fe)*N);C&&a&&b<=t.stableFitRemainingWidth?(xi=!0,_n=t.stableFitMaxMinimapScale):xi=Oi>S}if(p==="fill"||xi){x=!0;const Oi=u;N=Math.min(l*s,Math.max(1,Math.floor(1/Oe))),C&&a&&b<=t.stableFitRemainingWidth&&(_n=t.stableFitMaxMinimapScale),u=Math.min(_n,Math.max(1,Math.floor(N/w))),u>Oi&&(U=Math.min(2,u/Oi)),W=u/s/U,S=Math.ceil(Math.max(xe,me+_+Fe)*N),C?(t.stableMinimapLayoutInput=e,t.stableFitRemainingWidth=b,t.stableFitMaxMinimapScale=u):(t.stableMinimapLayoutInput=null,t.stableFitRemainingWidth=0)}}}const F=Math.floor(f*W),O=Math.min(F,Math.max(0,Math.floor((b-v-2)*W/(d+W)))+Dd);let G=Math.floor(s*O);const Q=G/s;G=Math.floor(G*U);const ge=h?1:2,_e=m==="left"?0:i-O-v;return{renderMinimap:ge,minimapLeft:_e,minimapWidth:O,minimapHeightIsEditorHeight:x,minimapIsSampling:I,minimapScale:u,minimapLineHeight:N,minimapCanvasInnerWidth:G,minimapCanvasInnerHeight:S,minimapCanvasOuterWidth:Q,minimapCanvasOuterHeight:D}}static computeLayout(e,t){const i=t.outerWidth|0,n=t.outerHeight|0,s=t.lineHeight|0,r=t.lineNumbersDigitCount|0,a=t.typicalHalfwidthCharacterWidth,l=t.maxDigitWidth,d=t.pixelRatio,c=t.viewLineCount,h=e.get(135),u=h==="inherit"?e.get(134):h,f=u==="inherit"?e.get(130):u,p=e.get(133),m=t.isDominatedByLongLines,v=e.get(57),_=e.get(67).renderType!==0,b=e.get(68),C=e.get(104),w=e.get(83),S=e.get(72),D=e.get(102),x=D.verticalScrollbarSize,I=D.verticalHasArrows,N=D.arrowSize,W=D.horizontalScrollbarSize,U=e.get(43),F=e.get(109)!=="never";let O=e.get(65);U&&F&&(O+=16);let G=0;if(_){const Vi=Math.max(r,b);G=Math.round(Vi*l)}let Q=0;v&&(Q=s*t.glyphMarginDecorationLaneCount);let ge=0,_e=ge+Q,xe=_e+G,me=xe+O;const Fe=i-Q-G-O;let Oe=!1,Le=!1,le=-1;u==="inherit"&&m?(Oe=!0,Le=!0):f==="on"||f==="bounded"?Le=!0:f==="wordWrapColumn"&&(le=p);const xi=fg._computeMinimapLayout({outerWidth:i,outerHeight:n,lineHeight:s,typicalHalfwidthCharacterWidth:a,pixelRatio:d,scrollBeyondLastLine:C,paddingTop:w.top,paddingBottom:w.bottom,minimap:S,verticalScrollbarWidth:x,viewLineCount:c,remainingWidth:Fe,isViewportWrapping:Le},t.memory||new X3);xi.renderMinimap!==0&&xi.minimapLeft===0&&(ge+=xi.minimapWidth,_e+=xi.minimapWidth,xe+=xi.minimapWidth,me+=xi.minimapWidth);const _n=Fe-xi.minimapWidth,Oi=Math.max(1,Math.floor((_n-x-2)/a)),vt=I?N:0;return Le&&(le=Math.max(1,Oi),f==="bounded"&&(le=Math.min(le,p))),{width:i,height:n,glyphMarginLeft:ge,glyphMarginWidth:Q,glyphMarginDecorationLaneCount:t.glyphMarginDecorationLaneCount,lineNumbersLeft:_e,lineNumbersWidth:G,decorationsLeft:xe,decorationsWidth:O,contentLeft:me,contentWidth:_n,minimap:xi,viewportColumn:Oi,isWordWrapMinified:Oe,isViewportWrapping:Le,wrappingColumn:le,verticalScrollbarWidth:x,horizontalScrollbarHeight:W,overviewRuler:{top:vt,width:x,height:n-2*vt,right:0}}}}class wz extends Qt{constructor(){super(137,"wrappingStrategy","simple",{"editor.wrappingStrategy":{enumDescriptions:[g("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."),g("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:g("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 Ci(e,"simple",["simple","advanced"])}compute(e,t,i){return t.get(2)===2?"advanced":i}}class Sz extends Qt{constructor(){const e={enabled:!0};super(64,"lightbulb",e,{"editor.lightbulb.enabled":{type:"boolean",default:e.enabled,description:g("codeActions","Enables the Code Action lightbulb in the editor.")}})}validate(e){return!e||typeof e!="object"?this.defaultValue:{enabled:Se(e.enabled,this.defaultValue.enabled)}}}class yz extends Qt{constructor(){const e={enabled:!1,maxLineCount:5,defaultModel:"outlineModel",scrollWithEditor:!0};super(114,"stickyScroll",e,{"editor.stickyScroll.enabled":{type:"boolean",default:e.enabled,description:g("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:g("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:g("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:g("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:Se(t.enabled,this.defaultValue.enabled),maxLineCount:It.clampedInt(t.maxLineCount,this.defaultValue.maxLineCount,1,10),defaultModel:Ci(t.defaultModel,this.defaultValue.defaultModel,["outlineModel","foldingProviderModel","indentationModel"]),scrollWithEditor:Se(t.scrollWithEditor,this.defaultValue.scrollWithEditor)}}}class Lz extends Qt{constructor(){const e={enabled:"on",fontSize:0,fontFamily:"",padding:!1};super(139,"inlayHints",e,{"editor.inlayHints.enabled":{type:"string",default:e.enabled,description:g("inlayHints.enable","Enables the inlay hints in the editor."),enum:["on","onUnlessPressed","offUnlessPressed","off"],markdownEnumDescriptions:[g("editor.inlayHints.on","Inlay hints are enabled"),g("editor.inlayHints.onUnlessPressed","Inlay hints are showing by default and hide when holding {0}",at?"Ctrl+Option":"Ctrl+Alt"),g("editor.inlayHints.offUnlessPressed","Inlay hints are hidden by default and show when holding {0}",at?"Ctrl+Option":"Ctrl+Alt"),g("editor.inlayHints.off","Inlay hints are disabled")]},"editor.inlayHints.fontSize":{type:"number",default:e.fontSize,markdownDescription:g("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:g("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:g("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:Ci(t.enabled,this.defaultValue.enabled,["on","off","offUnlessPressed","onUnlessPressed"]),fontSize:It.clampedInt(t.fontSize,this.defaultValue.fontSize,0,100),fontFamily:Es.string(t.fontFamily,this.defaultValue.fontFamily),padding:Se(t.padding,this.defaultValue.padding)}}}class xz extends Qt{constructor(){super(65,"lineDecorationsWidth",10)}validate(e){return typeof e=="string"&&/^\d+(\.\d+)?ch$/.test(e)?-parseFloat(e.substring(0,e.length-2)):It.clampedInt(e,this.defaultValue,0,1e3)}compute(e,t,i){return i<0?It.clampedInt(-i*e.fontInfo.typicalHalfwidthCharacterWidth,this.defaultValue,0,1e3):i}}class Dz extends Jo{constructor(){super(66,"lineHeight",Ps.lineHeight,e=>Jo.clamp(e,0,150),{markdownDescription:g("lineHeight",`Controls the line height.
7
+ import{_ as be}from"./uikit-B7SaluUF.js";function vo(o,e=0){return o[o.length-(1+e)]}function PH(o){if(o.length===0)throw new Error("Invalid tail call");return[o.slice(0,o.length-1),o[o.length-1]]}function mi(o,e,t=(i,n)=>i===n){if(o===e)return!0;if(!o||!e||o.length!==e.length)return!1;for(let i=0,n=o.length;i<n;i++)if(!t(o[i],e[i]))return!1;return!0}function OH(o,e){const t=o.length-1;e<t&&(o[e]=o[t]),o.pop()}function B_(o,e,t){return FH(o.length,i=>t(o[i],e))}function FH(o,e){let t=0,i=o-1;for(;t<=i;){const n=(t+i)/2|0,s=e(n);if(s<0)t=n+1;else if(s>0)i=n-1;else return n}return-(t+1)}function $D(o,e,t){if(o=o|0,o>=e.length)throw new TypeError("invalid index");const i=e[Math.floor(e.length*Math.random())],n=[],s=[],r=[];for(const a of e){const l=t(a,i);l<0?n.push(a):l>0?s.push(a):r.push(a)}return o<n.length?$D(o,n,t):o<n.length+r.length?r[0]:$D(o-(n.length+r.length),s,t)}function LA(o,e){const t=[];let i;for(const n of o.slice(0).sort(e))!i||e(i[0],n)!==0?(i=[n],t.push(i)):i.push(n);return t}function*M3(o,e){let t,i;for(const n of o)i!==void 0&&e(i,n)?t.push(n):(t&&(yield t),t=[n]),i=n;t&&(yield t)}function A3(o,e){for(let t=0;t<=o.length;t++)e(t===0?void 0:o[t-1],t===o.length?void 0:o[t])}function BH(o,e){for(let t=0;t<o.length;t++)e(t===0?void 0:o[t-1],o[t],t+1===o.length?void 0:o[t+1])}function Za(o){return o.filter(e=>!!e)}function xA(o){let e=0;for(let t=0;t<o.length;t++)o[t]&&(o[e]=o[t],e+=1);o.length=e}function P3(o){return!Array.isArray(o)||o.length===0}function Fn(o){return Array.isArray(o)&&o.length>0}function bc(o,e=t=>t){const t=new Set;return o.filter(i=>{const n=e(i);return t.has(n)?!1:(t.add(n),!0)})}function O3(o,e){return o.length>0?o[0]:e}function Xn(o,e){let t=typeof e=="number"?o:0;typeof e=="number"?t=o:(t=0,e=o);const i=[];if(t<=e)for(let n=t;n<e;n++)i.push(n);else for(let n=t;n>e;n--)i.push(n);return i}function CS(o,e,t){const i=o.slice(0,e),n=o.slice(e);return i.concat(t,n)}function VL(o,e){const t=o.indexOf(e);t>-1&&(o.splice(t,1),o.unshift(e))}function ub(o,e){const t=o.indexOf(e);t>-1&&(o.splice(t,1),o.push(e))}function jD(o,e){for(const t of e)o.push(t)}function i2(o){return Array.isArray(o)?o:[o]}function WH(o,e,t){const i=F3(o,e),n=o.length,s=t.length;o.length=n+s;for(let r=n-1;r>=i;r--)o[r+s]=o[r];for(let r=0;r<s;r++)o[r+i]=t[r]}function DA(o,e,t,i){const n=F3(o,e);let s=o.splice(n,t);return s===void 0&&(s=[]),WH(o,n,i),s}function F3(o,e){return e<0?Math.max(e+o.length,0):Math.min(e,o.length)}var W_;(function(o){function e(s){return s<0}o.isLessThan=e;function t(s){return s<=0}o.isLessThanOrEqual=t;function i(s){return s>0}o.isGreaterThan=i;function n(s){return s===0}o.isNeitherLessOrGreaterThan=n,o.greaterThan=1,o.lessThan=-1,o.neitherLessOrGreaterThan=0})(W_||(W_={}));function Eo(o,e){return(t,i)=>e(o(t),o(i))}function VH(...o){return(e,t)=>{for(const i of o){const n=i(e,t);if(!W_.isNeitherLessOrGreaterThan(n))return n}return W_.neitherLessOrGreaterThan}}const Zl=(o,e)=>o-e,HH=(o,e)=>Zl(o?1:0,e?1:0);function B3(o){return(e,t)=>-o(e,t)}class od{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<this.items.length&&e(this.items[t]);)t++;const i=t===this.firstIdx?null:this.items.slice(this.firstIdx,t);return this.firstIdx=t,i}takeFromEndWhile(e){let t=this.lastIdx;for(;t>=0&&e(this.items[t]);)t--;const i=t===this.lastIdx?null:this.items.slice(t+1,this.lastIdx+1);return this.lastIdx=t,i}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 $a{constructor(e){this.iterate=e}toArray(){const e=[];return this.iterate(t=>(e.push(t),!0)),e}filter(e){return new $a(t=>this.iterate(i=>e(i)?t(i):!0))}map(e){return new $a(t=>this.iterate(i=>t(e(i))))}findLast(e){let t;return this.iterate(i=>(e(i)&&(t=i),!0)),t}findLastMaxBy(e){let t,i=!0;return this.iterate(n=>((i||W_.isGreaterThan(e(n,t)))&&(i=!1,t=n),!0)),t}}$a.empty=new $a(o=>{});function rs(o){return typeof o=="string"}function is(o){return typeof o=="object"&&o!==null&&!Array.isArray(o)&&!(o instanceof RegExp)&&!(o instanceof Date)}function zH(o){const e=Object.getPrototypeOf(Uint8Array);return typeof o=="object"&&o instanceof e}function Cc(o){return typeof o=="number"&&!isNaN(o)}function kA(o){return!!o&&typeof o[Symbol.iterator]=="function"}function W3(o){return o===!0||o===!1}function Rs(o){return typeof o>"u"}function V_(o){return!Ys(o)}function Ys(o){return Rs(o)||o===null}function xt(o,e){if(!o)throw new Error(e?`Unexpected type, expected '${e}'`:"Unexpected type")}function Wh(o){if(Ys(o))throw new Error("Assertion Failed: argument is undefined or null");return o}function H_(o){return typeof o=="function"}function UH(o,e){const t=Math.min(o.length,e.length);for(let i=0;i<t;i++)$H(o[i],e[i])}function $H(o,e){if(rs(e)){if(typeof o!==e)throw new Error(`argument does not match constraint: typeof ${e}`)}else if(H_(e)){try{if(o instanceof e)return}catch{}if(!Ys(o)&&o.constructor===e||e.length===1&&e.call(void 0,o)===!0)return;throw new Error("argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true")}}function Il(o){if(!o||typeof o!="object"||o instanceof RegExp)return o;const e=Array.isArray(o)?[]:{};return Object.entries(o).forEach(([t,i])=>{e[t]=i&&typeof i=="object"?Il(i):i}),e}function jH(o){if(!o||typeof o!="object")return o;const e=[o];for(;e.length>0;){const t=e.shift();Object.freeze(t);for(const i in t)if(V3.call(t,i)){const n=t[i];typeof n=="object"&&!Object.isFrozen(n)&&!zH(n)&&e.push(n)}}return o}const V3=Object.prototype.hasOwnProperty;function H3(o,e){return KD(o,e,new Set)}function KD(o,e,t){if(Ys(o))return o;const i=e(o);if(typeof i<"u")return i;if(Array.isArray(o)){const n=[];for(const s of o)n.push(KD(s,e,t));return n}if(is(o)){if(t.has(o))throw new Error("Cannot clone recursive data-structure");t.add(o);const n={};for(const s in o)V3.call(o,s)&&(n[s]=KD(o[s],e,t));return t.delete(o),n}return o}function wS(o,e,t=!0){return is(o)?(is(e)&&Object.keys(e).forEach(i=>{i in o?t&&(is(o[i])&&is(e[i])?wS(o[i],e[i],t):o[i]=e[i]):o[i]=e[i]}),o):e}function oo(o,e){if(o===e)return!0;if(o==null||e===null||e===void 0||typeof o!=typeof e||typeof o!="object"||Array.isArray(o)!==Array.isArray(e))return!1;let t,i;if(Array.isArray(o)){if(o.length!==e.length)return!1;for(t=0;t<o.length;t++)if(!oo(o[t],e[t]))return!1}else{const n=[];for(i in o)n.push(i);n.sort();const s=[];for(i in e)s.push(i);if(s.sort(),!oo(n,s))return!1;for(t=0;t<n.length;t++)if(!oo(o[n[t]],e[n[t]]))return!1}return!0}function KH(o){let e=[];for(;Object.prototype!==o;)e=e.concat(Object.getOwnPropertyNames(o)),o=Object.getPrototypeOf(o);return e}function n2(o){const e=[];for(const t of KH(o))typeof o[t]=="function"&&e.push(t);return e}function qH(o,e){const t=n=>function(){const s=Array.prototype.slice.call(arguments,0);return e(n,s)},i={};for(const n of o)i[n]=t(n);return i}let GH=typeof document<"u"&&document.location&&document.location.hash.indexOf("pseudo=true")>=0;function ZH(o,e){let t;return e.length===0?t=o:t=o.replace(/\{(\d+)\}/g,(i,n)=>{const s=n[0],r=e[s];let a=i;return typeof r=="string"?a=r:(typeof r=="number"||typeof r=="boolean"||r===void 0||r===null)&&(a=String(r)),a}),GH&&(t="["+t.replace(/[aouei]/g,"$&$&")+"]"),t}function g(o,e,...t){return ZH(e,t)}var HL;const Vf="en";let _1=!1,v1=!1,RC=!1,z3=!1,s2=!1,o2=!1,U3=!1,fb,MC=Vf,IA=Vf,YH,Lr;const sr=typeof self=="object"?self:typeof global=="object"?global:{};let Qn;typeof sr.vscode<"u"&&typeof sr.vscode.process<"u"?Qn=sr.vscode.process:typeof process<"u"&&(Qn=process);const XH=typeof((HL=Qn?.versions)===null||HL===void 0?void 0:HL.electron)=="string",QH=XH&&Qn?.type==="renderer";if(typeof navigator=="object"&&!QH)Lr=navigator.userAgent,_1=Lr.indexOf("Windows")>=0,v1=Lr.indexOf("Macintosh")>=0,o2=(Lr.indexOf("Macintosh")>=0||Lr.indexOf("iPad")>=0||Lr.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,RC=Lr.indexOf("Linux")>=0,U3=Lr?.indexOf("Mobi")>=0,s2=!0,g({key:"ensureLoaderPluginIsLoaded",comment:["{Locked}"]},"_"),fb=Vf,MC=fb,IA=navigator.language;else if(typeof Qn=="object"){_1=Qn.platform==="win32",v1=Qn.platform==="darwin",RC=Qn.platform==="linux",RC&&Qn.env.SNAP&&Qn.env.SNAP_REVISION,Qn.env.CI||Qn.env.BUILD_ARTIFACTSTAGINGDIRECTORY,fb=Vf,MC=Vf;const o=Qn.env.VSCODE_NLS_CONFIG;if(o)try{const e=JSON.parse(o),t=e.availableLanguages["*"];fb=e.locale,IA=e.osLocale,MC=t||Vf,YH=e._translationsConfigFile}catch{}z3=!0}else console.error("Unable to resolve platform.");const En=_1,at=v1,Zn=RC,jr=z3,Kc=s2,JH=s2&&typeof sr.importScripts=="function",Xr=o2,ez=U3,Ya=Lr,tz=MC,iz=typeof sr.postMessage=="function"&&!sr.importScripts,$3=(()=>{if(iz){const o=[];sr.addEventListener("message",t=>{if(t.data&&t.data.vscodeScheduleAsyncWork)for(let i=0,n=o.length;i<n;i++){const s=o[i];if(s.id===t.data.vscodeScheduleAsyncWork){o.splice(i,1),s.callback();return}}});let e=0;return t=>{const i=++e;o.push({id:i,callback:t}),sr.postMessage({vscodeScheduleAsyncWork:i},"*")}}return o=>setTimeout(o)})(),to=v1||o2?2:_1?1:3;let EA=!0,NA=!1;function j3(){if(!NA){NA=!0;const o=new Uint8Array(2);o[0]=1,o[1]=2,EA=new Uint16Array(o.buffer)[0]===513}return EA}const K3=!!(Ya&&Ya.indexOf("Chrome")>=0),nz=!!(Ya&&Ya.indexOf("Firefox")>=0),sz=!!(!K3&&Ya&&Ya.indexOf("Safari")>=0),oz=!!(Ya&&Ya.indexOf("Edg/")>=0);Ya&&Ya.indexOf("Android")>=0;const An={tabSize:4,indentSize:4,insertSpaces:!0,detectIndentation:!0,trimAutoWhitespace:!0,largeFileOptimizations:!0,bracketPairColorizationOptions:{enabled:!0,independentColorPoolPerBracketType:!1}};var Xe;(function(o){function e(b){return b&&typeof b=="object"&&typeof b[Symbol.iterator]=="function"}o.is=e;const t=Object.freeze([]);function i(){return t}o.empty=i;function*n(b){yield b}o.single=n;function s(b){return e(b)?b:n(b)}o.wrap=s;function r(b){return b||t}o.from=r;function*a(b){for(let C=b.length-1;C>=0;C--)yield b[C]}o.reverse=a;function l(b){return!b||b[Symbol.iterator]().next().done===!0}o.isEmpty=l;function d(b){return b[Symbol.iterator]().next().value}o.first=d;function c(b,C){for(const w of b)if(C(w))return!0;return!1}o.some=c;function h(b,C){for(const w of b)if(C(w))return w}o.find=h;function*u(b,C){for(const w of b)C(w)&&(yield w)}o.filter=u;function*f(b,C){let w=0;for(const S of b)yield C(S,w++)}o.map=f;function*p(...b){for(const C of b)for(const w of C)yield w}o.concat=p;function m(b,C,w){let S=w;for(const D of b)S=C(S,D);return S}o.reduce=m;function*v(b,C,w=b.length){for(C<0&&(C+=b.length),w<0?w+=b.length:w>b.length&&(w=b.length);C<w;C++)yield b[C]}o.slice=v;function _(b,C=Number.POSITIVE_INFINITY){const w=[];if(C===0)return[w,b];const S=b[Symbol.iterator]();for(let D=0;D<C;D++){const x=S.next();if(x.done)return[w,o.empty()];w.push(x.value)}return[w,{[Symbol.iterator](){return S}}]}o.consume=_})(Xe||(Xe={}));let Ti=class qD{constructor(e){this.element=e,this.next=qD.Undefined,this.prev=qD.Undefined}};Ti.Undefined=new Ti(void 0);class ns{constructor(){this._first=Ti.Undefined,this._last=Ti.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===Ti.Undefined}clear(){let e=this._first;for(;e!==Ti.Undefined;){const t=e.next;e.prev=Ti.Undefined,e.next=Ti.Undefined,e=t}this._first=Ti.Undefined,this._last=Ti.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){const i=new Ti(e);if(this._first===Ti.Undefined)this._first=i,this._last=i;else if(t){const s=this._last;this._last=i,i.prev=s,s.next=i}else{const s=this._first;this._first=i,i.next=s,s.prev=i}this._size+=1;let n=!1;return()=>{n||(n=!0,this._remove(i))}}shift(){if(this._first!==Ti.Undefined){const e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==Ti.Undefined){const e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==Ti.Undefined&&e.next!==Ti.Undefined){const t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===Ti.Undefined&&e.next===Ti.Undefined?(this._first=Ti.Undefined,this._last=Ti.Undefined):e.next===Ti.Undefined?(this._last=this._last.prev,this._last.next=Ti.Undefined):e.prev===Ti.Undefined&&(this._first=this._first.next,this._first.prev=Ti.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==Ti.Undefined;)yield e.element,e=e.next}}const q3="`~!@#$%^&*()-=+[{]}\\|;:'\",.<>/?";function rz(o=""){let e="(-?\\d*\\.\\d\\w*)|([^";for(const t of q3)o.indexOf(t)>=0||(e+="\\"+t);return e+="\\s]+)",new RegExp(e,"g")}const r2=rz();function G3(o){let e=r2;if(o&&o instanceof RegExp)if(o.global)e=o;else{let t="g";o.ignoreCase&&(t+="i"),o.multiline&&(t+="m"),o.unicode&&(t+="u"),e=new RegExp(o.source,t)}return e.lastIndex=0,e}const Z3=new ns;Z3.unshift({maxLen:1e3,windowSize:15,timeBudget:150});function z_(o,e,t,i,n){if(n||(n=Xe.first(Z3)),t.length>n.maxLen){let d=o-n.maxLen/2;return d<0?d=0:i+=d,t=t.substring(d,o+n.maxLen/2),z_(o,e,t,i,n)}const s=Date.now(),r=o-1-i;let a=-1,l=null;for(let d=1;!(Date.now()-s>=n.timeBudget);d++){const c=r-n.windowSize*d;e.lastIndex=Math.max(0,c);const h=az(e,t,r,a);if(!h&&l||(l=h,c<=0))break;a=c}if(l){const d={word:l[0],startColumn:i+1+l.index,endColumn:i+1+l.index+l[0].length};return e.lastIndex=0,d}return null}function az(o,e,t,i){let n;for(;n=o.exec(e);){const s=n.index||0;if(s<=t&&o.lastIndex>=t)return n;if(i>0&&s>i)return null}return null}const Dd=8;class Y3{constructor(e){this._values=e}hasChanged(e){return this._values[e]}}class X3{constructor(){this.stableMinimapLayoutInput=null,this.stableFitMaxMinimapScale=0,this.stableFitRemainingWidth=0}}class Qt{constructor(e,t,i,n){this.id=e,this.name=t,this.defaultValue=i,this.schema=n}applyUpdate(e,t){return SS(e,t)}compute(e,t,i){return i}}class o_{constructor(e,t){this.newValue=e,this.didChange=t}}function SS(o,e){if(typeof o!="object"||typeof e!="object"||!o||!e)return new o_(e,o!==e);if(Array.isArray(o)||Array.isArray(e)){const i=Array.isArray(o)&&Array.isArray(e)&&mi(o,e);return new o_(e,!i)}let t=!1;for(const i in e)if(e.hasOwnProperty(i)){const n=SS(o[i],e[i]);n.didChange&&(o[i]=n.newValue,t=!0)}return new o_(o,t)}class _0{constructor(e){this.schema=void 0,this.id=e,this.name="_never_",this.defaultValue=void 0}applyUpdate(e,t){return SS(e,t)}validate(e){return this.defaultValue}}class Rp{constructor(e,t,i,n){this.id=e,this.name=t,this.defaultValue=i,this.schema=n}applyUpdate(e,t){return SS(e,t)}validate(e){return typeof e>"u"?this.defaultValue:e}compute(e,t,i){return i}}function Se(o,e){return typeof o>"u"?e:o==="false"?!1:!!o}class ct extends Rp{constructor(e,t,i,n=void 0){typeof n<"u"&&(n.type="boolean",n.default=i),super(e,t,i,n)}validate(e){return Se(e,this.defaultValue)}}function bh(o,e,t,i){if(typeof o>"u")return e;let n=parseInt(o,10);return isNaN(n)?e:(n=Math.max(t,n),n=Math.min(i,n),n|0)}class It extends Rp{static clampedInt(e,t,i,n){return bh(e,t,i,n)}constructor(e,t,i,n,s,r=void 0){typeof r<"u"&&(r.type="integer",r.default=i,r.minimum=n,r.maximum=s),super(e,t,i,r),this.minimum=n,this.maximum=s}validate(e){return It.clampedInt(e,this.defaultValue,this.minimum,this.maximum)}}function lz(o,e,t,i){if(typeof o>"u")return e;const n=Jo.float(o,e);return Jo.clamp(n,t,i)}class Jo extends Rp{static clamp(e,t,i){return e<t?t:e>i?i:e}static float(e,t){if(typeof e=="number")return e;if(typeof e>"u")return t;const i=parseFloat(e);return isNaN(i)?t:i}constructor(e,t,i,n,s){typeof s<"u"&&(s.type="number",s.default=i),super(e,t,i,s),this.validationFn=n}validate(e){return this.validationFn(Jo.float(e,this.defaultValue))}}class Es extends Rp{static string(e,t){return typeof e!="string"?t:e}constructor(e,t,i,n=void 0){typeof n<"u"&&(n.type="string",n.default=i),super(e,t,i,n)}validate(e){return Es.string(e,this.defaultValue)}}function Ci(o,e,t,i){return typeof o!="string"?e:i&&o in i?i[o]:t.indexOf(o)===-1?e:o}class si extends Rp{constructor(e,t,i,n,s=void 0){typeof s<"u"&&(s.type="string",s.enum=n,s.default=i),super(e,t,i,s),this._allowedValues=n}validate(e){return Ci(e,this.defaultValue,this._allowedValues)}}class gb extends Qt{constructor(e,t,i,n,s,r,a=void 0){typeof a<"u"&&(a.type="string",a.enum=s,a.default=n),super(e,t,i,a),this._allowedValues=s,this._convert=r}validate(e){return typeof e!="string"?this.defaultValue:this._allowedValues.indexOf(e)===-1?this.defaultValue:this._convert(e)}}function dz(o){switch(o){case"none":return 0;case"keep":return 1;case"brackets":return 2;case"advanced":return 3;case"full":return 4}}class cz extends Qt{constructor(){super(2,"accessibilitySupport",0,{type:"string",enum:["auto","on","off"],enumDescriptions:[g("accessibilitySupport.auto","Use platform APIs to detect when a Screen Reader is attached"),g("accessibilitySupport.on","Optimize for usage with a Screen Reader"),g("accessibilitySupport.off","Assume a screen reader is not attached")],default:"auto",tags:["accessibility"],description:g("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,i){return i===0?e.accessibilitySupport:i}}class hz extends Qt{constructor(){const e={insertSpace:!0,ignoreEmptyLines:!0};super(23,"comments",e,{"editor.comments.insertSpace":{type:"boolean",default:e.insertSpace,description:g("comments.insertSpace","Controls whether a space character is inserted when commenting.")},"editor.comments.ignoreEmptyLines":{type:"boolean",default:e.ignoreEmptyLines,description:g("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:Se(t.insertSpace,this.defaultValue.insertSpace),ignoreEmptyLines:Se(t.ignoreEmptyLines,this.defaultValue.ignoreEmptyLines)}}}function uz(o){switch(o){case"blink":return 1;case"smooth":return 2;case"phase":return 3;case"expand":return 4;case"solid":return 5}}var dn;(function(o){o[o.Line=1]="Line",o[o.Block=2]="Block",o[o.Underline=3]="Underline",o[o.LineThin=4]="LineThin",o[o.BlockOutline=5]="BlockOutline",o[o.UnderlineThin=6]="UnderlineThin"})(dn||(dn={}));function fz(o){switch(o){case"line":return dn.Line;case"block":return dn.Block;case"underline":return dn.Underline;case"line-thin":return dn.LineThin;case"block-outline":return dn.BlockOutline;case"underline-thin":return dn.UnderlineThin}}class gz extends _0{constructor(){super(140)}compute(e,t,i){const n=["monaco-editor"];return t.get(39)&&n.push(t.get(39)),e.extraEditorClassName&&n.push(e.extraEditorClassName),t.get(73)==="default"?n.push("mouse-default"):t.get(73)==="copy"&&n.push("mouse-copy"),t.get(110)&&n.push("showUnused"),t.get(138)&&n.push("showDeprecated"),n.join(" ")}}class pz extends ct{constructor(){super(37,"emptySelectionClipboard",!0,{description:g("emptySelectionClipboard","Controls whether copying without a selection copies the current line.")})}compute(e,t,i){return i&&e.emptySelectionClipboard}}class mz extends Qt{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:g("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:[g("editor.find.seedSearchStringFromSelection.never","Never seed search string from the editor selection."),g("editor.find.seedSearchStringFromSelection.always","Always seed search string from the editor selection, including word at cursor position."),g("editor.find.seedSearchStringFromSelection.selection","Only seed search string from the editor selection.")],description:g("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:[g("editor.find.autoFindInSelection.never","Never turn on Find in Selection automatically (default)."),g("editor.find.autoFindInSelection.always","Always turn on Find in Selection automatically."),g("editor.find.autoFindInSelection.multiline","Turn on Find in Selection automatically when multiple lines of content are selected.")],description:g("find.autoFindInSelection","Controls the condition for turning on Find in Selection automatically.")},"editor.find.globalFindClipboard":{type:"boolean",default:e.globalFindClipboard,description:g("find.globalFindClipboard","Controls whether the Find Widget should read or modify the shared find clipboard on macOS."),included:at},"editor.find.addExtraSpaceOnTop":{type:"boolean",default:e.addExtraSpaceOnTop,description:g("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:g("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:Se(t.cursorMoveOnType,this.defaultValue.cursorMoveOnType),seedSearchStringFromSelection:typeof e.seedSearchStringFromSelection=="boolean"?e.seedSearchStringFromSelection?"always":"never":Ci(t.seedSearchStringFromSelection,this.defaultValue.seedSearchStringFromSelection,["never","always","selection"]),autoFindInSelection:typeof e.autoFindInSelection=="boolean"?e.autoFindInSelection?"always":"never":Ci(t.autoFindInSelection,this.defaultValue.autoFindInSelection,["never","always","multiline"]),globalFindClipboard:Se(t.globalFindClipboard,this.defaultValue.globalFindClipboard),addExtraSpaceOnTop:Se(t.addExtraSpaceOnTop,this.defaultValue.addExtraSpaceOnTop),loop:Se(t.loop,this.defaultValue.loop)}}}class Xs extends Qt{constructor(){super(51,"fontLigatures",Xs.OFF,{anyOf:[{type:"boolean",description:g("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:g("fontFeatureSettings","Explicit 'font-feature-settings' CSS property. A boolean can be passed instead if one only needs to turn on/off ligatures.")}],description:g("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>"u"?this.defaultValue:typeof e=="string"?e==="false"?Xs.OFF:e==="true"?Xs.ON:e:e?Xs.ON:Xs.OFF}}Xs.OFF='"liga" off, "calt" off';Xs.ON='"liga" on, "calt" on';class Wr extends Qt{constructor(){super(54,"fontVariations",Wr.OFF,{anyOf:[{type:"boolean",description:g("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:g("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:g("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>"u"?this.defaultValue:typeof e=="string"?e==="false"?Wr.OFF:e==="true"?Wr.TRANSLATE:e:e?Wr.TRANSLATE:Wr.OFF}compute(e,t,i){return e.fontInfo.fontVariationSettings}}Wr.OFF="normal";Wr.TRANSLATE="translate";class _z extends _0{constructor(){super(50)}compute(e,t,i){return e.fontInfo}}class vz extends Rp{constructor(){super(52,"fontSize",Ps.fontSize,{type:"number",minimum:6,maximum:100,default:Ps.fontSize,description:g("fontSize","Controls the font size in pixels.")})}validate(e){const t=Jo.float(e,this.defaultValue);return t===0?Ps.fontSize:Jo.clamp(t,6,100)}compute(e,t,i){return e.fontInfo.fontSize}}class xa extends Qt{constructor(){super(53,"fontWeight",Ps.fontWeight,{anyOf:[{type:"number",minimum:xa.MINIMUM_VALUE,maximum:xa.MAXIMUM_VALUE,errorMessage:g("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:xa.SUGGESTION_VALUES}],default:Ps.fontWeight,description:g("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(It.clampedInt(e,Ps.fontWeight,xa.MINIMUM_VALUE,xa.MAXIMUM_VALUE))}}xa.SUGGESTION_VALUES=["normal","bold","100","200","300","400","500","600","700","800","900"];xa.MINIMUM_VALUE=1;xa.MAXIMUM_VALUE=1e3;class bz extends Qt{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:[g("editor.gotoLocation.multiple.peek","Show Peek view of the results (default)"),g("editor.gotoLocation.multiple.gotoAndPeek","Go to the primary result and show a Peek view"),g("editor.gotoLocation.multiple.goto","Go to the primary result and enable Peek-less navigation to others")]},i=["","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:g("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:g("editor.editor.gotoLocation.multipleDefinitions","Controls the behavior the 'Go to Definition'-command when multiple target locations exist.")},t),"editor.gotoLocation.multipleTypeDefinitions":Object.assign({description:g("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:g("editor.editor.gotoLocation.multipleDeclarations","Controls the behavior the 'Go to Declaration'-command when multiple target locations exist.")},t),"editor.gotoLocation.multipleImplementations":Object.assign({description:g("editor.editor.gotoLocation.multipleImplemenattions","Controls the behavior the 'Go to Implementations'-command when multiple target locations exist.")},t),"editor.gotoLocation.multipleReferences":Object.assign({description:g("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:i,description:g("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:i,description:g("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:i,description:g("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:i,description:g("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:i,description:g("alternativeReferenceCommand","Alternative command id that is being executed when the result of 'Go to Reference' is the current location.")}})}validate(e){var t,i,n,s,r;if(!e||typeof e!="object")return this.defaultValue;const a=e;return{multiple:Ci(a.multiple,this.defaultValue.multiple,["peek","gotoAndPeek","goto"]),multipleDefinitions:(t=a.multipleDefinitions)!==null&&t!==void 0?t:Ci(a.multipleDefinitions,"peek",["peek","gotoAndPeek","goto"]),multipleTypeDefinitions:(i=a.multipleTypeDefinitions)!==null&&i!==void 0?i:Ci(a.multipleTypeDefinitions,"peek",["peek","gotoAndPeek","goto"]),multipleDeclarations:(n=a.multipleDeclarations)!==null&&n!==void 0?n:Ci(a.multipleDeclarations,"peek",["peek","gotoAndPeek","goto"]),multipleImplementations:(s=a.multipleImplementations)!==null&&s!==void 0?s:Ci(a.multipleImplementations,"peek",["peek","gotoAndPeek","goto"]),multipleReferences:(r=a.multipleReferences)!==null&&r!==void 0?r:Ci(a.multipleReferences,"peek",["peek","gotoAndPeek","goto"]),alternativeDefinitionCommand:Es.string(a.alternativeDefinitionCommand,this.defaultValue.alternativeDefinitionCommand),alternativeTypeDefinitionCommand:Es.string(a.alternativeTypeDefinitionCommand,this.defaultValue.alternativeTypeDefinitionCommand),alternativeDeclarationCommand:Es.string(a.alternativeDeclarationCommand,this.defaultValue.alternativeDeclarationCommand),alternativeImplementationCommand:Es.string(a.alternativeImplementationCommand,this.defaultValue.alternativeImplementationCommand),alternativeReferenceCommand:Es.string(a.alternativeReferenceCommand,this.defaultValue.alternativeReferenceCommand)}}}class Cz extends Qt{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:g("hover.enabled","Controls whether the hover is shown.")},"editor.hover.delay":{type:"number",default:e.delay,minimum:0,maximum:1e4,description:g("hover.delay","Controls the delay in milliseconds after which the hover is shown.")},"editor.hover.sticky":{type:"boolean",default:e.sticky,description:g("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:g("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:g("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:Se(t.enabled,this.defaultValue.enabled),delay:It.clampedInt(t.delay,this.defaultValue.delay,0,1e4),sticky:Se(t.sticky,this.defaultValue.sticky),hidingDelay:It.clampedInt(t.hidingDelay,this.defaultValue.hidingDelay,0,6e5),above:Se(t.above,this.defaultValue.above)}}}class fg extends _0{constructor(){super(143)}compute(e,t,i){return fg.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,i=Math.floor(e.paddingTop/e.lineHeight);let n=Math.floor(e.paddingBottom/e.lineHeight);e.scrollBeyondLastLine&&(n=Math.max(n,t-1));const s=(i+e.viewLineCount+n)/(e.pixelRatio*e.height),r=Math.floor(e.viewLineCount/s);return{typicalViewportLineCount:t,extraLinesBeforeFirstLine:i,extraLinesBeyondLastLine:n,desiredRatio:s,minimapLineCount:r}}static _computeMinimapLayout(e,t){const i=e.outerWidth,n=e.outerHeight,s=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(s*n),minimapCanvasOuterWidth:0,minimapCanvasOuterHeight:n};const r=t.stableMinimapLayoutInput,a=r&&e.outerHeight===r.outerHeight&&e.lineHeight===r.lineHeight&&e.typicalHalfwidthCharacterWidth===r.typicalHalfwidthCharacterWidth&&e.pixelRatio===r.pixelRatio&&e.scrollBeyondLastLine===r.scrollBeyondLastLine&&e.paddingTop===r.paddingTop&&e.paddingBottom===r.paddingBottom&&e.minimap.enabled===r.minimap.enabled&&e.minimap.side===r.minimap.side&&e.minimap.size===r.minimap.size&&e.minimap.showSlider===r.minimap.showSlider&&e.minimap.renderCharacters===r.minimap.renderCharacters&&e.minimap.maxColumn===r.minimap.maxColumn&&e.minimap.scale===r.minimap.scale&&e.verticalScrollbarWidth===r.verticalScrollbarWidth&&e.isViewportWrapping===r.isViewportWrapping,l=e.lineHeight,d=e.typicalHalfwidthCharacterWidth,c=e.scrollBeyondLastLine,h=e.minimap.renderCharacters;let u=s>=2?Math.round(e.minimap.scale*2):e.minimap.scale;const f=e.minimap.maxColumn,p=e.minimap.size,m=e.minimap.side,v=e.verticalScrollbarWidth,_=e.viewLineCount,b=e.remainingWidth,C=e.isViewportWrapping,w=h?2:3;let S=Math.floor(s*n);const D=S/s;let x=!1,I=!1,N=w*u,W=u/s,U=1;if(p==="fill"||p==="fit"){const{typicalViewportLineCount:xe,extraLinesBeforeFirstLine:me,extraLinesBeyondLastLine:Fe,desiredRatio:Oe,minimapLineCount:Le}=fg.computeContainedMinimapLineCount({viewLineCount:_,scrollBeyondLastLine:c,paddingTop:e.paddingTop,paddingBottom:e.paddingBottom,height:n,lineHeight:l,pixelRatio:s});if(_/Le>1)x=!0,I=!0,u=1,N=1,W=u/s;else{let xi=!1,_n=u+1;if(p==="fit"){const Oi=Math.ceil((me+_+Fe)*N);C&&a&&b<=t.stableFitRemainingWidth?(xi=!0,_n=t.stableFitMaxMinimapScale):xi=Oi>S}if(p==="fill"||xi){x=!0;const Oi=u;N=Math.min(l*s,Math.max(1,Math.floor(1/Oe))),C&&a&&b<=t.stableFitRemainingWidth&&(_n=t.stableFitMaxMinimapScale),u=Math.min(_n,Math.max(1,Math.floor(N/w))),u>Oi&&(U=Math.min(2,u/Oi)),W=u/s/U,S=Math.ceil(Math.max(xe,me+_+Fe)*N),C?(t.stableMinimapLayoutInput=e,t.stableFitRemainingWidth=b,t.stableFitMaxMinimapScale=u):(t.stableMinimapLayoutInput=null,t.stableFitRemainingWidth=0)}}}const F=Math.floor(f*W),O=Math.min(F,Math.max(0,Math.floor((b-v-2)*W/(d+W)))+Dd);let G=Math.floor(s*O);const Q=G/s;G=Math.floor(G*U);const ge=h?1:2,_e=m==="left"?0:i-O-v;return{renderMinimap:ge,minimapLeft:_e,minimapWidth:O,minimapHeightIsEditorHeight:x,minimapIsSampling:I,minimapScale:u,minimapLineHeight:N,minimapCanvasInnerWidth:G,minimapCanvasInnerHeight:S,minimapCanvasOuterWidth:Q,minimapCanvasOuterHeight:D}}static computeLayout(e,t){const i=t.outerWidth|0,n=t.outerHeight|0,s=t.lineHeight|0,r=t.lineNumbersDigitCount|0,a=t.typicalHalfwidthCharacterWidth,l=t.maxDigitWidth,d=t.pixelRatio,c=t.viewLineCount,h=e.get(135),u=h==="inherit"?e.get(134):h,f=u==="inherit"?e.get(130):u,p=e.get(133),m=t.isDominatedByLongLines,v=e.get(57),_=e.get(67).renderType!==0,b=e.get(68),C=e.get(104),w=e.get(83),S=e.get(72),D=e.get(102),x=D.verticalScrollbarSize,I=D.verticalHasArrows,N=D.arrowSize,W=D.horizontalScrollbarSize,U=e.get(43),F=e.get(109)!=="never";let O=e.get(65);U&&F&&(O+=16);let G=0;if(_){const Vi=Math.max(r,b);G=Math.round(Vi*l)}let Q=0;v&&(Q=s*t.glyphMarginDecorationLaneCount);let ge=0,_e=ge+Q,xe=_e+G,me=xe+O;const Fe=i-Q-G-O;let Oe=!1,Le=!1,le=-1;u==="inherit"&&m?(Oe=!0,Le=!0):f==="on"||f==="bounded"?Le=!0:f==="wordWrapColumn"&&(le=p);const xi=fg._computeMinimapLayout({outerWidth:i,outerHeight:n,lineHeight:s,typicalHalfwidthCharacterWidth:a,pixelRatio:d,scrollBeyondLastLine:C,paddingTop:w.top,paddingBottom:w.bottom,minimap:S,verticalScrollbarWidth:x,viewLineCount:c,remainingWidth:Fe,isViewportWrapping:Le},t.memory||new X3);xi.renderMinimap!==0&&xi.minimapLeft===0&&(ge+=xi.minimapWidth,_e+=xi.minimapWidth,xe+=xi.minimapWidth,me+=xi.minimapWidth);const _n=Fe-xi.minimapWidth,Oi=Math.max(1,Math.floor((_n-x-2)/a)),vt=I?N:0;return Le&&(le=Math.max(1,Oi),f==="bounded"&&(le=Math.min(le,p))),{width:i,height:n,glyphMarginLeft:ge,glyphMarginWidth:Q,glyphMarginDecorationLaneCount:t.glyphMarginDecorationLaneCount,lineNumbersLeft:_e,lineNumbersWidth:G,decorationsLeft:xe,decorationsWidth:O,contentLeft:me,contentWidth:_n,minimap:xi,viewportColumn:Oi,isWordWrapMinified:Oe,isViewportWrapping:Le,wrappingColumn:le,verticalScrollbarWidth:x,horizontalScrollbarHeight:W,overviewRuler:{top:vt,width:x,height:n-2*vt,right:0}}}}class wz extends Qt{constructor(){super(137,"wrappingStrategy","simple",{"editor.wrappingStrategy":{enumDescriptions:[g("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."),g("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:g("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 Ci(e,"simple",["simple","advanced"])}compute(e,t,i){return t.get(2)===2?"advanced":i}}class Sz extends Qt{constructor(){const e={enabled:!0};super(64,"lightbulb",e,{"editor.lightbulb.enabled":{type:"boolean",default:e.enabled,description:g("codeActions","Enables the Code Action lightbulb in the editor.")}})}validate(e){return!e||typeof e!="object"?this.defaultValue:{enabled:Se(e.enabled,this.defaultValue.enabled)}}}class yz extends Qt{constructor(){const e={enabled:!1,maxLineCount:5,defaultModel:"outlineModel",scrollWithEditor:!0};super(114,"stickyScroll",e,{"editor.stickyScroll.enabled":{type:"boolean",default:e.enabled,description:g("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:g("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:g("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:g("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:Se(t.enabled,this.defaultValue.enabled),maxLineCount:It.clampedInt(t.maxLineCount,this.defaultValue.maxLineCount,1,10),defaultModel:Ci(t.defaultModel,this.defaultValue.defaultModel,["outlineModel","foldingProviderModel","indentationModel"]),scrollWithEditor:Se(t.scrollWithEditor,this.defaultValue.scrollWithEditor)}}}class Lz extends Qt{constructor(){const e={enabled:"on",fontSize:0,fontFamily:"",padding:!1};super(139,"inlayHints",e,{"editor.inlayHints.enabled":{type:"string",default:e.enabled,description:g("inlayHints.enable","Enables the inlay hints in the editor."),enum:["on","onUnlessPressed","offUnlessPressed","off"],markdownEnumDescriptions:[g("editor.inlayHints.on","Inlay hints are enabled"),g("editor.inlayHints.onUnlessPressed","Inlay hints are showing by default and hide when holding {0}",at?"Ctrl+Option":"Ctrl+Alt"),g("editor.inlayHints.offUnlessPressed","Inlay hints are hidden by default and show when holding {0}",at?"Ctrl+Option":"Ctrl+Alt"),g("editor.inlayHints.off","Inlay hints are disabled")]},"editor.inlayHints.fontSize":{type:"number",default:e.fontSize,markdownDescription:g("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:g("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:g("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:Ci(t.enabled,this.defaultValue.enabled,["on","off","offUnlessPressed","onUnlessPressed"]),fontSize:It.clampedInt(t.fontSize,this.defaultValue.fontSize,0,100),fontFamily:Es.string(t.fontFamily,this.defaultValue.fontFamily),padding:Se(t.padding,this.defaultValue.padding)}}}class xz extends Qt{constructor(){super(65,"lineDecorationsWidth",10)}validate(e){return typeof e=="string"&&/^\d+(\.\d+)?ch$/.test(e)?-parseFloat(e.substring(0,e.length-2)):It.clampedInt(e,this.defaultValue,0,1e3)}compute(e,t,i){return i<0?It.clampedInt(-i*e.fontInfo.typicalHalfwidthCharacterWidth,this.defaultValue,0,1e3):i}}class Dz extends Jo{constructor(){super(66,"lineHeight",Ps.lineHeight,e=>Jo.clamp(e,0,150),{markdownDescription:g("lineHeight",`Controls the line height.
8
8
  - Use 0 to automatically compute the line height from the font size.
9
9
  - Values between 0 and 8 will be used as a multiplier with the font size.
10
10
  - Values greater than or equal to 8 will be used as effective values.`)})}compute(e,t,i){return e.fontInfo.lineHeight}}class kz extends Qt{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:g("minimap.enabled","Controls whether the minimap is shown.")},"editor.minimap.autohide":{type:"boolean",default:e.autohide,description:g("minimap.autohide","Controls whether the minimap is hidden automatically.")},"editor.minimap.size":{type:"string",enum:["proportional","fill","fit"],enumDescriptions:[g("minimap.size.proportional","The minimap has the same size as the editor contents (and might scroll)."),g("minimap.size.fill","The minimap will stretch or shrink as necessary to fill the height of the editor (no scrolling)."),g("minimap.size.fit","The minimap will shrink as necessary to never be larger than the editor (no scrolling).")],default:e.size,description:g("minimap.size","Controls the size of the minimap.")},"editor.minimap.side":{type:"string",enum:["left","right"],default:e.side,description:g("minimap.side","Controls the side where to render the minimap.")},"editor.minimap.showSlider":{type:"string",enum:["always","mouseover"],default:e.showSlider,description:g("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:g("minimap.scale","Scale of content drawn in the minimap: 1, 2 or 3.")},"editor.minimap.renderCharacters":{type:"boolean",default:e.renderCharacters,description:g("minimap.renderCharacters","Render the actual characters on a line as opposed to color blocks.")},"editor.minimap.maxColumn":{type:"number",default:e.maxColumn,description:g("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:Se(t.enabled,this.defaultValue.enabled),autohide:Se(t.autohide,this.defaultValue.autohide),size:Ci(t.size,this.defaultValue.size,["proportional","fill","fit"]),side:Ci(t.side,this.defaultValue.side,["right","left"]),showSlider:Ci(t.showSlider,this.defaultValue.showSlider,["always","mouseover"]),renderCharacters:Se(t.renderCharacters,this.defaultValue.renderCharacters),scale:It.clampedInt(t.scale,1,1,3),maxColumn:It.clampedInt(t.maxColumn,this.defaultValue.maxColumn,1,1e4)}}}function Iz(o){return o==="ctrlCmd"?at?"metaKey":"ctrlKey":"altKey"}class Ez extends Qt{constructor(){super(83,"padding",{top:0,bottom:0},{"editor.padding.top":{type:"number",default:0,minimum:0,maximum:1e3,description:g("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:g("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:It.clampedInt(t.top,0,0,1e3),bottom:It.clampedInt(t.bottom,0,0,1e3)}}}class Nz extends Qt{constructor(){const e={enabled:!0,cycle:!0};super(85,"parameterHints",e,{"editor.parameterHints.enabled":{type:"boolean",default:e.enabled,description:g("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:g("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:Se(t.enabled,this.defaultValue.enabled),cycle:Se(t.cycle,this.defaultValue.cycle)}}}class Tz extends _0{constructor(){super(141)}compute(e,t,i){return e.pixelRatio}}class Rz extends Qt{constructor(){const e={other:"on",comments:"off",strings:"off"},t=[{type:"boolean"},{type:"string",enum:["on","inline","off"],enumDescriptions:[g("on","Quick suggestions show inside the suggest widget"),g("inline","Quick suggestions show as ghost text"),g("off","Quick suggestions are disabled")]}];super(88,"quickSuggestions",e,{type:"object",additionalProperties:!1,properties:{strings:{anyOf:t,default:e.strings,description:g("quickSuggestions.strings","Enable quick suggestions inside strings.")},comments:{anyOf:t,default:e.comments,description:g("quickSuggestions.comments","Enable quick suggestions inside comments.")},other:{anyOf:t,default:e.other,description:g("quickSuggestions.other","Enable quick suggestions outside of strings and comments.")}},default:e,markdownDescription:g("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 d=e?"on":"off";return{comments:d,strings:d,other:d}}if(!e||typeof e!="object")return this.defaultValue;const{other:t,comments:i,strings:n}=e,s=["on","inline","off"];let r,a,l;return typeof t=="boolean"?r=t?"on":"off":r=Ci(t,this.defaultValue.other,s),typeof i=="boolean"?a=i?"on":"off":a=Ci(i,this.defaultValue.comments,s),typeof n=="boolean"?l=n?"on":"off":l=Ci(n,this.defaultValue.strings,s),{other:r,comments:a,strings:l}}}class Mz extends Qt{constructor(){super(67,"lineNumbers",{renderType:1,renderFn:null},{type:"string",enum:["off","on","relative","interval"],enumDescriptions:[g("lineNumbers.off","Line numbers are not rendered."),g("lineNumbers.on","Line numbers are rendered as absolute number."),g("lineNumbers.relative","Line numbers are rendered as distance in lines to cursor position."),g("lineNumbers.interval","Line numbers are rendered every 10 lines.")],default:"on",description:g("lineNumbers","Controls the display of line numbers.")})}validate(e){let t=this.defaultValue.renderType,i=this.defaultValue.renderFn;return typeof e<"u"&&(typeof e=="function"?(t=4,i=e):e==="interval"?t=3:e==="relative"?t=2:e==="on"?t=1:t=0),{renderType:t,renderFn:i}}}function b1(o){const e=o.get(97);return e==="editable"?o.get(90):e!=="on"}class Az extends Qt{constructor(){const e=[],t={type:"number",description:g("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:g("rulers.color","Color of this editor ruler."),format:"color-hex"}}}]},default:e,description:g("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 i of e)if(typeof i=="number")t.push({column:It.clampedInt(i,0,0,1e4),color:null});else if(i&&typeof i=="object"){const n=i;t.push({column:It.clampedInt(n.column,0,0,1e4),color:n.color})}return t.sort((i,n)=>i.column-n.column),t}return this.defaultValue}}class Pz extends Qt{constructor(){super(91,"readOnlyMessage",void 0)}validate(e){return!e||typeof e!="object"?this.defaultValue:e}}function TA(o,e){if(typeof o!="string")return e;switch(o){case"hidden":return 2;case"visible":return 3;default:return 1}}let Oz=class extends Qt{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:[g("scrollbar.vertical.auto","The vertical scrollbar will be visible only when necessary."),g("scrollbar.vertical.visible","The vertical scrollbar will always be visible."),g("scrollbar.vertical.fit","The vertical scrollbar will always be hidden.")],default:"auto",description:g("scrollbar.vertical","Controls the visibility of the vertical scrollbar.")},"editor.scrollbar.horizontal":{type:"string",enum:["auto","visible","hidden"],enumDescriptions:[g("scrollbar.horizontal.auto","The horizontal scrollbar will be visible only when necessary."),g("scrollbar.horizontal.visible","The horizontal scrollbar will always be visible."),g("scrollbar.horizontal.fit","The horizontal scrollbar will always be hidden.")],default:"auto",description:g("scrollbar.horizontal","Controls the visibility of the horizontal scrollbar.")},"editor.scrollbar.verticalScrollbarSize":{type:"number",default:e.verticalScrollbarSize,description:g("scrollbar.verticalScrollbarSize","The width of the vertical scrollbar.")},"editor.scrollbar.horizontalScrollbarSize":{type:"number",default:e.horizontalScrollbarSize,description:g("scrollbar.horizontalScrollbarSize","The height of the horizontal scrollbar.")},"editor.scrollbar.scrollByPage":{type:"boolean",default:e.scrollByPage,description:g("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,i=It.clampedInt(t.horizontalScrollbarSize,this.defaultValue.horizontalScrollbarSize,0,1e3),n=It.clampedInt(t.verticalScrollbarSize,this.defaultValue.verticalScrollbarSize,0,1e3);return{arrowSize:It.clampedInt(t.arrowSize,this.defaultValue.arrowSize,0,1e3),vertical:TA(t.vertical,this.defaultValue.vertical),horizontal:TA(t.horizontal,this.defaultValue.horizontal),useShadows:Se(t.useShadows,this.defaultValue.useShadows),verticalHasArrows:Se(t.verticalHasArrows,this.defaultValue.verticalHasArrows),horizontalHasArrows:Se(t.horizontalHasArrows,this.defaultValue.horizontalHasArrows),handleMouseWheel:Se(t.handleMouseWheel,this.defaultValue.handleMouseWheel),alwaysConsumeMouseWheel:Se(t.alwaysConsumeMouseWheel,this.defaultValue.alwaysConsumeMouseWheel),horizontalScrollbarSize:i,horizontalSliderSize:It.clampedInt(t.horizontalSliderSize,i,0,1e3),verticalScrollbarSize:n,verticalSliderSize:It.clampedInt(t.verticalSliderSize,n,0,1e3),scrollByPage:Se(t.scrollByPage,this.defaultValue.scrollByPage)}}};const Ks="inUntrustedWorkspace",_s={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 Fz extends Qt{constructor(){const e={nonBasicASCII:Ks,invisibleCharacters:!0,ambiguousCharacters:!0,includeComments:Ks,includeStrings:!0,allowedCharacters:{},allowedLocales:{_os:!0,_vscode:!0}};super(124,"unicodeHighlight",e,{[_s.nonBasicASCII]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,Ks],default:e.nonBasicASCII,description:g("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.")},[_s.invisibleCharacters]:{restricted:!0,type:"boolean",default:e.invisibleCharacters,description:g("unicodeHighlight.invisibleCharacters","Controls whether characters that just reserve space or have no width at all are highlighted.")},[_s.ambiguousCharacters]:{restricted:!0,type:"boolean",default:e.ambiguousCharacters,description:g("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.")},[_s.includeComments]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,Ks],default:e.includeComments,description:g("unicodeHighlight.includeComments","Controls whether characters in comments should also be subject to Unicode highlighting.")},[_s.includeStrings]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,Ks],default:e.includeStrings,description:g("unicodeHighlight.includeStrings","Controls whether characters in strings should also be subject to Unicode highlighting.")},[_s.allowedCharacters]:{restricted:!0,type:"object",default:e.allowedCharacters,description:g("unicodeHighlight.allowedCharacters","Defines allowed characters that are not being highlighted."),additionalProperties:{type:"boolean"}},[_s.allowedLocales]:{restricted:!0,type:"object",additionalProperties:{type:"boolean"},default:e.allowedLocales,description:g("unicodeHighlight.allowedLocales","Unicode characters that are common in allowed locales are not being highlighted.")}})}applyUpdate(e,t){let i=!1;t.allowedCharacters&&e&&(oo(e.allowedCharacters,t.allowedCharacters)||(e=Object.assign(Object.assign({},e),{allowedCharacters:t.allowedCharacters}),i=!0)),t.allowedLocales&&e&&(oo(e.allowedLocales,t.allowedLocales)||(e=Object.assign(Object.assign({},e),{allowedLocales:t.allowedLocales}),i=!0));const n=super.applyUpdate(e,t);return i?new o_(n.newValue,!0):n}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{nonBasicASCII:gg(t.nonBasicASCII,Ks,[!0,!1,Ks]),invisibleCharacters:Se(t.invisibleCharacters,this.defaultValue.invisibleCharacters),ambiguousCharacters:Se(t.ambiguousCharacters,this.defaultValue.ambiguousCharacters),includeComments:gg(t.includeComments,Ks,[!0,!1,Ks]),includeStrings:gg(t.includeStrings,Ks,[!0,!1,Ks]),allowedCharacters:this.validateBooleanMap(e.allowedCharacters,this.defaultValue.allowedCharacters),allowedLocales:this.validateBooleanMap(e.allowedLocales,this.defaultValue.allowedLocales)}}validateBooleanMap(e,t){if(typeof e!="object"||!e)return t;const i={};for(const[n,s]of Object.entries(e))s===!0&&(i[n]=!0);return i}}class Bz extends Qt{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:g("inlineSuggest.enabled","Controls whether to automatically show inline suggestions in the editor.")},"editor.inlineSuggest.showToolbar":{type:"string",default:e.showToolbar,enum:["always","onHover"],enumDescriptions:[g("inlineSuggest.showToolbar.always","Show the inline suggestion toolbar whenever an inline suggestion is shown."),g("inlineSuggest.showToolbar.onHover","Show the inline suggestion toolbar when hovering over an inline suggestion.")],description:g("inlineSuggest.showToolbar","Controls when to show the inline suggestion toolbar.")},"editor.inlineSuggest.suppressSuggestions":{type:"boolean",default:e.suppressSuggestions,description:g("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:Se(t.enabled,this.defaultValue.enabled),mode:Ci(t.mode,this.defaultValue.mode,["prefix","subword","subwordSmart"]),showToolbar:Ci(t.showToolbar,this.defaultValue.showToolbar,["always","onHover"]),suppressSuggestions:Se(t.suppressSuggestions,this.defaultValue.suppressSuggestions),keepOnBlur:Se(t.keepOnBlur,this.defaultValue.keepOnBlur)}}}class Wz extends Qt{constructor(){const e={enabled:An.bracketPairColorizationOptions.enabled,independentColorPoolPerBracketType:An.bracketPairColorizationOptions.independentColorPoolPerBracketType};super(15,"bracketPairColorization",e,{"editor.bracketPairColorization.enabled":{type:"boolean",default:e.enabled,markdownDescription:g("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:g("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:Se(t.enabled,this.defaultValue.enabled),independentColorPoolPerBracketType:Se(t.independentColorPoolPerBracketType,this.defaultValue.independentColorPoolPerBracketType)}}}class Vz extends Qt{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:[g("editor.guides.bracketPairs.true","Enables bracket pair guides."),g("editor.guides.bracketPairs.active","Enables bracket pair guides only for the active bracket pair."),g("editor.guides.bracketPairs.false","Disables bracket pair guides.")],default:e.bracketPairs,description:g("editor.guides.bracketPairs","Controls whether bracket pair guides are enabled or not.")},"editor.guides.bracketPairsHorizontal":{type:["boolean","string"],enum:[!0,"active",!1],enumDescriptions:[g("editor.guides.bracketPairsHorizontal.true","Enables horizontal guides as addition to vertical bracket pair guides."),g("editor.guides.bracketPairsHorizontal.active","Enables horizontal guides only for the active bracket pair."),g("editor.guides.bracketPairsHorizontal.false","Disables horizontal bracket pair guides.")],default:e.bracketPairsHorizontal,description:g("editor.guides.bracketPairsHorizontal","Controls whether horizontal bracket pair guides are enabled or not.")},"editor.guides.highlightActiveBracketPair":{type:"boolean",default:e.highlightActiveBracketPair,description:g("editor.guides.highlightActiveBracketPair","Controls whether the editor should highlight the active bracket pair.")},"editor.guides.indentation":{type:"boolean",default:e.indentation,description:g("editor.guides.indentation","Controls whether the editor should render indent guides.")},"editor.guides.highlightActiveIndentation":{type:["boolean","string"],enum:[!0,"always",!1],enumDescriptions:[g("editor.guides.highlightActiveIndentation.true","Highlights the active indent guide."),g("editor.guides.highlightActiveIndentation.always","Highlights the active indent guide even if bracket guides are highlighted."),g("editor.guides.highlightActiveIndentation.false","Do not highlight the active indent guide.")],default:e.highlightActiveIndentation,description:g("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:gg(t.bracketPairs,this.defaultValue.bracketPairs,[!0,!1,"active"]),bracketPairsHorizontal:gg(t.bracketPairsHorizontal,this.defaultValue.bracketPairsHorizontal,[!0,!1,"active"]),highlightActiveBracketPair:Se(t.highlightActiveBracketPair,this.defaultValue.highlightActiveBracketPair),indentation:Se(t.indentation,this.defaultValue.indentation),highlightActiveIndentation:gg(t.highlightActiveIndentation,this.defaultValue.highlightActiveIndentation,[!0,!1,"always"])}}}function gg(o,e,t){const i=t.indexOf(o);return i===-1?e:t[i]}class Hz extends Qt{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:[g("suggest.insertMode.insert","Insert suggestion without overwriting text right of the cursor."),g("suggest.insertMode.replace","Insert suggestion and overwrite text right of the cursor.")],default:e.insertMode,description:g("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:g("suggest.filterGraceful","Controls whether filtering and sorting suggestions accounts for small typos.")},"editor.suggest.localityBonus":{type:"boolean",default:e.localityBonus,description:g("suggest.localityBonus","Controls whether sorting favors words that appear close to the cursor.")},"editor.suggest.shareSuggestSelections":{type:"boolean",default:e.shareSuggestSelections,markdownDescription:g("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:[g("suggest.insertMode.always","Always select a suggestion when automatically triggering IntelliSense."),g("suggest.insertMode.never","Never select a suggestion when automatically triggering IntelliSense."),g("suggest.insertMode.whenTriggerCharacter","Select a suggestion only when triggering IntelliSense from a trigger character."),g("suggest.insertMode.whenQuickSuggestion","Select a suggestion only when triggering IntelliSense as you type.")],default:e.selectionMode,markdownDescription:g("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:g("suggest.snippetsPreventQuickSuggestions","Controls whether an active snippet prevents quick suggestions.")},"editor.suggest.showIcons":{type:"boolean",default:e.showIcons,description:g("suggest.showIcons","Controls whether to show or hide icons in suggestions.")},"editor.suggest.showStatusBar":{type:"boolean",default:e.showStatusBar,description:g("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:g("suggest.preview","Controls whether to preview the suggestion outcome in the editor.")},"editor.suggest.showInlineDetails":{type:"boolean",default:e.showInlineDetails,description:g("suggest.showInlineDetails","Controls whether suggest details show inline with the label or only in the details widget.")},"editor.suggest.maxVisibleSuggestions":{type:"number",deprecationMessage:g("suggest.maxVisibleSuggestions.dep","This setting is deprecated. The suggest widget can now be resized.")},"editor.suggest.filteredTypes":{type:"object",deprecationMessage:g("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:g("editor.suggest.showMethods","When enabled IntelliSense shows `method`-suggestions.")},"editor.suggest.showFunctions":{type:"boolean",default:!0,markdownDescription:g("editor.suggest.showFunctions","When enabled IntelliSense shows `function`-suggestions.")},"editor.suggest.showConstructors":{type:"boolean",default:!0,markdownDescription:g("editor.suggest.showConstructors","When enabled IntelliSense shows `constructor`-suggestions.")},"editor.suggest.showDeprecated":{type:"boolean",default:!0,markdownDescription:g("editor.suggest.showDeprecated","When enabled IntelliSense shows `deprecated`-suggestions.")},"editor.suggest.matchOnWordStartOnly":{type:"boolean",default:!0,markdownDescription:g("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:g("editor.suggest.showFields","When enabled IntelliSense shows `field`-suggestions.")},"editor.suggest.showVariables":{type:"boolean",default:!0,markdownDescription:g("editor.suggest.showVariables","When enabled IntelliSense shows `variable`-suggestions.")},"editor.suggest.showClasses":{type:"boolean",default:!0,markdownDescription:g("editor.suggest.showClasss","When enabled IntelliSense shows `class`-suggestions.")},"editor.suggest.showStructs":{type:"boolean",default:!0,markdownDescription:g("editor.suggest.showStructs","When enabled IntelliSense shows `struct`-suggestions.")},"editor.suggest.showInterfaces":{type:"boolean",default:!0,markdownDescription:g("editor.suggest.showInterfaces","When enabled IntelliSense shows `interface`-suggestions.")},"editor.suggest.showModules":{type:"boolean",default:!0,markdownDescription:g("editor.suggest.showModules","When enabled IntelliSense shows `module`-suggestions.")},"editor.suggest.showProperties":{type:"boolean",default:!0,markdownDescription:g("editor.suggest.showPropertys","When enabled IntelliSense shows `property`-suggestions.")},"editor.suggest.showEvents":{type:"boolean",default:!0,markdownDescription:g("editor.suggest.showEvents","When enabled IntelliSense shows `event`-suggestions.")},"editor.suggest.showOperators":{type:"boolean",default:!0,markdownDescription:g("editor.suggest.showOperators","When enabled IntelliSense shows `operator`-suggestions.")},"editor.suggest.showUnits":{type:"boolean",default:!0,markdownDescription:g("editor.suggest.showUnits","When enabled IntelliSense shows `unit`-suggestions.")},"editor.suggest.showValues":{type:"boolean",default:!0,markdownDescription:g("editor.suggest.showValues","When enabled IntelliSense shows `value`-suggestions.")},"editor.suggest.showConstants":{type:"boolean",default:!0,markdownDescription:g("editor.suggest.showConstants","When enabled IntelliSense shows `constant`-suggestions.")},"editor.suggest.showEnums":{type:"boolean",default:!0,markdownDescription:g("editor.suggest.showEnums","When enabled IntelliSense shows `enum`-suggestions.")},"editor.suggest.showEnumMembers":{type:"boolean",default:!0,markdownDescription:g("editor.suggest.showEnumMembers","When enabled IntelliSense shows `enumMember`-suggestions.")},"editor.suggest.showKeywords":{type:"boolean",default:!0,markdownDescription:g("editor.suggest.showKeywords","When enabled IntelliSense shows `keyword`-suggestions.")},"editor.suggest.showWords":{type:"boolean",default:!0,markdownDescription:g("editor.suggest.showTexts","When enabled IntelliSense shows `text`-suggestions.")},"editor.suggest.showColors":{type:"boolean",default:!0,markdownDescription:g("editor.suggest.showColors","When enabled IntelliSense shows `color`-suggestions.")},"editor.suggest.showFiles":{type:"boolean",default:!0,markdownDescription:g("editor.suggest.showFiles","When enabled IntelliSense shows `file`-suggestions.")},"editor.suggest.showReferences":{type:"boolean",default:!0,markdownDescription:g("editor.suggest.showReferences","When enabled IntelliSense shows `reference`-suggestions.")},"editor.suggest.showCustomcolors":{type:"boolean",default:!0,markdownDescription:g("editor.suggest.showCustomcolors","When enabled IntelliSense shows `customcolor`-suggestions.")},"editor.suggest.showFolders":{type:"boolean",default:!0,markdownDescription:g("editor.suggest.showFolders","When enabled IntelliSense shows `folder`-suggestions.")},"editor.suggest.showTypeParameters":{type:"boolean",default:!0,markdownDescription:g("editor.suggest.showTypeParameters","When enabled IntelliSense shows `typeParameter`-suggestions.")},"editor.suggest.showSnippets":{type:"boolean",default:!0,markdownDescription:g("editor.suggest.showSnippets","When enabled IntelliSense shows `snippet`-suggestions.")},"editor.suggest.showUsers":{type:"boolean",default:!0,markdownDescription:g("editor.suggest.showUsers","When enabled IntelliSense shows `user`-suggestions.")},"editor.suggest.showIssues":{type:"boolean",default:!0,markdownDescription:g("editor.suggest.showIssues","When enabled IntelliSense shows `issues`-suggestions.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{insertMode:Ci(t.insertMode,this.defaultValue.insertMode,["insert","replace"]),filterGraceful:Se(t.filterGraceful,this.defaultValue.filterGraceful),snippetsPreventQuickSuggestions:Se(t.snippetsPreventQuickSuggestions,this.defaultValue.filterGraceful),localityBonus:Se(t.localityBonus,this.defaultValue.localityBonus),shareSuggestSelections:Se(t.shareSuggestSelections,this.defaultValue.shareSuggestSelections),selectionMode:Ci(t.selectionMode,this.defaultValue.selectionMode,["always","never","whenQuickSuggestion","whenTriggerCharacter"]),showIcons:Se(t.showIcons,this.defaultValue.showIcons),showStatusBar:Se(t.showStatusBar,this.defaultValue.showStatusBar),preview:Se(t.preview,this.defaultValue.preview),previewMode:Ci(t.previewMode,this.defaultValue.previewMode,["prefix","subword","subwordSmart"]),showInlineDetails:Se(t.showInlineDetails,this.defaultValue.showInlineDetails),showMethods:Se(t.showMethods,this.defaultValue.showMethods),showFunctions:Se(t.showFunctions,this.defaultValue.showFunctions),showConstructors:Se(t.showConstructors,this.defaultValue.showConstructors),showDeprecated:Se(t.showDeprecated,this.defaultValue.showDeprecated),matchOnWordStartOnly:Se(t.matchOnWordStartOnly,this.defaultValue.matchOnWordStartOnly),showFields:Se(t.showFields,this.defaultValue.showFields),showVariables:Se(t.showVariables,this.defaultValue.showVariables),showClasses:Se(t.showClasses,this.defaultValue.showClasses),showStructs:Se(t.showStructs,this.defaultValue.showStructs),showInterfaces:Se(t.showInterfaces,this.defaultValue.showInterfaces),showModules:Se(t.showModules,this.defaultValue.showModules),showProperties:Se(t.showProperties,this.defaultValue.showProperties),showEvents:Se(t.showEvents,this.defaultValue.showEvents),showOperators:Se(t.showOperators,this.defaultValue.showOperators),showUnits:Se(t.showUnits,this.defaultValue.showUnits),showValues:Se(t.showValues,this.defaultValue.showValues),showConstants:Se(t.showConstants,this.defaultValue.showConstants),showEnums:Se(t.showEnums,this.defaultValue.showEnums),showEnumMembers:Se(t.showEnumMembers,this.defaultValue.showEnumMembers),showKeywords:Se(t.showKeywords,this.defaultValue.showKeywords),showWords:Se(t.showWords,this.defaultValue.showWords),showColors:Se(t.showColors,this.defaultValue.showColors),showFiles:Se(t.showFiles,this.defaultValue.showFiles),showReferences:Se(t.showReferences,this.defaultValue.showReferences),showFolders:Se(t.showFolders,this.defaultValue.showFolders),showTypeParameters:Se(t.showTypeParameters,this.defaultValue.showTypeParameters),showSnippets:Se(t.showSnippets,this.defaultValue.showSnippets),showUsers:Se(t.showUsers,this.defaultValue.showUsers),showIssues:Se(t.showIssues,this.defaultValue.showIssues)}}}class zz extends Qt{constructor(){super(112,"smartSelect",{selectLeadingAndTrailingWhitespace:!0,selectSubwords:!0},{"editor.smartSelect.selectLeadingAndTrailingWhitespace":{description:g("selectLeadingAndTrailingWhitespace","Whether leading and trailing whitespace should always be selected."),default:!0,type:"boolean"},"editor.smartSelect.selectSubwords":{description:g("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:Se(e.selectLeadingAndTrailingWhitespace,this.defaultValue.selectLeadingAndTrailingWhitespace),selectSubwords:Se(e.selectSubwords,this.defaultValue.selectSubwords)}}}class Uz extends Qt{constructor(){super(136,"wrappingIndent",1,{"editor.wrappingIndent":{type:"string",enum:["none","same","indent","deepIndent"],enumDescriptions:[g("wrappingIndent.none","No indentation. Wrapped lines begin at column 1."),g("wrappingIndent.same","Wrapped lines get the same indentation as the parent."),g("wrappingIndent.indent","Wrapped lines get +1 indentation toward the parent."),g("wrappingIndent.deepIndent","Wrapped lines get +2 indentation toward the parent.")],description:g("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,i){return t.get(2)===2?0:i}}class $z extends _0{constructor(){super(144)}compute(e,t,i){const n=t.get(143);return{isDominatedByLongLines:e.isDominatedByLongLines,isWordWrapMinified:n.isWordWrapMinified,isViewportWrapping:n.isViewportWrapping,wrappingColumn:n.wrappingColumn}}}class jz extends Qt{constructor(){const e={enabled:!0,showDropSelector:"afterDrop"};super(36,"dropIntoEditor",e,{"editor.dropIntoEditor.enabled":{type:"boolean",default:e.enabled,markdownDescription:g("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:g("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:[g("dropIntoEditor.showDropSelector.afterDrop","Show the drop selector widget after a file is dropped into the editor."),g("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:Se(t.enabled,this.defaultValue.enabled),showDropSelector:Ci(t.showDropSelector,this.defaultValue.showDropSelector,["afterDrop","never"])}}}class Kz extends Qt{constructor(){const e={enabled:!0,showPasteSelector:"afterPaste"};super(84,"pasteAs",e,{"editor.pasteAs.enabled":{type:"boolean",default:e.enabled,markdownDescription:g("pasteAs.enabled","Controls whether you can paste content in different ways.")},"editor.pasteAs.showPasteSelector":{type:"string",markdownDescription:g("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:[g("pasteAs.showPasteSelector.afterPaste","Show the paste selector widget after content is pasted into the editor."),g("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:Se(t.enabled,this.defaultValue.enabled),showPasteSelector:Ci(t.showPasteSelector,this.defaultValue.showPasteSelector,["afterPaste","never"])}}}const qz="Consolas, 'Courier New', monospace",Gz="Menlo, Monaco, 'Courier New', monospace",Zz="'Droid Sans Mono', 'monospace', monospace",Ps={fontFamily:at?Gz:Zn?Zz:qz,fontWeight:"normal",fontSize:at?12:14,lineHeight:0,letterSpacing:0},Hf=[];function ie(o){return Hf[o.id]=o,o}const sa={acceptSuggestionOnCommitCharacter:ie(new ct(0,"acceptSuggestionOnCommitCharacter",!0,{markdownDescription:g("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:ie(new si(1,"acceptSuggestionOnEnter","on",["on","smart","off"],{markdownEnumDescriptions:["",g("acceptSuggestionOnEnterSmart","Only accept a suggestion with `Enter` when it makes a textual change."),""],markdownDescription:g("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:ie(new cz),accessibilityPageSize:ie(new It(3,"accessibilityPageSize",10,1,1073741824,{description:g("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:ie(new Es(4,"ariaLabel",g("editorViewAccessibleLabel","Editor content"))),ariaRequired:ie(new ct(5,"ariaRequired",!1,void 0)),screenReaderAnnounceInlineSuggestion:ie(new ct(8,"screenReaderAnnounceInlineSuggestion",!0,{description:g("screenReaderAnnounceInlineSuggestion","Control whether inline suggestions are announced by a screen reader."),tags:["accessibility"]})),autoClosingBrackets:ie(new si(6,"autoClosingBrackets","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",g("editor.autoClosingBrackets.languageDefined","Use language configurations to determine when to autoclose brackets."),g("editor.autoClosingBrackets.beforeWhitespace","Autoclose brackets only when the cursor is to the left of whitespace."),""],description:g("autoClosingBrackets","Controls whether the editor should automatically close brackets after the user adds an opening bracket.")})),autoClosingComments:ie(new si(7,"autoClosingComments","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",g("editor.autoClosingComments.languageDefined","Use language configurations to determine when to autoclose comments."),g("editor.autoClosingComments.beforeWhitespace","Autoclose comments only when the cursor is to the left of whitespace."),""],description:g("autoClosingComments","Controls whether the editor should automatically close comments after the user adds an opening comment.")})),autoClosingDelete:ie(new si(9,"autoClosingDelete","auto",["always","auto","never"],{enumDescriptions:["",g("editor.autoClosingDelete.auto","Remove adjacent closing quotes or brackets only if they were automatically inserted."),""],description:g("autoClosingDelete","Controls whether the editor should remove adjacent closing quotes or brackets when deleting.")})),autoClosingOvertype:ie(new si(10,"autoClosingOvertype","auto",["always","auto","never"],{enumDescriptions:["",g("editor.autoClosingOvertype.auto","Type over closing quotes or brackets only if they were automatically inserted."),""],description:g("autoClosingOvertype","Controls whether the editor should type over closing quotes or brackets.")})),autoClosingQuotes:ie(new si(11,"autoClosingQuotes","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",g("editor.autoClosingQuotes.languageDefined","Use language configurations to determine when to autoclose quotes."),g("editor.autoClosingQuotes.beforeWhitespace","Autoclose quotes only when the cursor is to the left of whitespace."),""],description:g("autoClosingQuotes","Controls whether the editor should automatically close quotes after the user adds an opening quote.")})),autoIndent:ie(new gb(12,"autoIndent",4,"full",["none","keep","brackets","advanced","full"],dz,{enumDescriptions:[g("editor.autoIndent.none","The editor will not insert indentation automatically."),g("editor.autoIndent.keep","The editor will keep the current line's indentation."),g("editor.autoIndent.brackets","The editor will keep the current line's indentation and honor language defined brackets."),g("editor.autoIndent.advanced","The editor will keep the current line's indentation, honor language defined brackets and invoke special onEnterRules defined by languages."),g("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:g("autoIndent","Controls whether the editor should automatically adjust the indentation when users type, paste, move or indent lines.")})),automaticLayout:ie(new ct(13,"automaticLayout",!1)),autoSurround:ie(new si(14,"autoSurround","languageDefined",["languageDefined","quotes","brackets","never"],{enumDescriptions:[g("editor.autoSurround.languageDefined","Use language configurations to determine when to automatically surround selections."),g("editor.autoSurround.quotes","Surround with quotes but not brackets."),g("editor.autoSurround.brackets","Surround with brackets but not quotes."),""],description:g("autoSurround","Controls whether the editor should automatically surround selections when typing quotes or brackets.")})),bracketPairColorization:ie(new Wz),bracketPairGuides:ie(new Vz),stickyTabStops:ie(new ct(115,"stickyTabStops",!1,{description:g("stickyTabStops","Emulate selection behavior of tab characters when using spaces for indentation. Selection will stick to tab stops.")})),codeLens:ie(new ct(17,"codeLens",!0,{description:g("codeLens","Controls whether the editor shows CodeLens.")})),codeLensFontFamily:ie(new Es(18,"codeLensFontFamily","",{description:g("codeLensFontFamily","Controls the font family for CodeLens.")})),codeLensFontSize:ie(new It(19,"codeLensFontSize",0,0,100,{type:"number",default:0,minimum:0,maximum:100,markdownDescription:g("codeLensFontSize","Controls the font size in pixels for CodeLens. When set to 0, 90% of `#editor.fontSize#` is used.")})),colorDecorators:ie(new ct(20,"colorDecorators",!0,{description:g("colorDecorators","Controls whether the editor should render the inline color decorators and color picker.")})),colorDecoratorActivatedOn:ie(new si(146,"colorDecoratorsActivatedOn","clickAndHover",["clickAndHover","hover","click"],{enumDescriptions:[g("editor.colorDecoratorActivatedOn.clickAndHover","Make the color picker appear both on click and hover of the color decorator"),g("editor.colorDecoratorActivatedOn.hover","Make the color picker appear on hover of the color decorator"),g("editor.colorDecoratorActivatedOn.click","Make the color picker appear on click of the color decorator")],description:g("colorDecoratorActivatedOn","Controls the condition to make a color picker appear from a color decorator")})),colorDecoratorsLimit:ie(new It(21,"colorDecoratorsLimit",500,1,1e6,{markdownDescription:g("colorDecoratorsLimit","Controls the max number of color decorators that can be rendered in an editor at once.")})),columnSelection:ie(new ct(22,"columnSelection",!1,{description:g("columnSelection","Enable that the selection with the mouse and keys is doing column selection.")})),comments:ie(new hz),contextmenu:ie(new ct(24,"contextmenu",!0)),copyWithSyntaxHighlighting:ie(new ct(25,"copyWithSyntaxHighlighting",!0,{description:g("copyWithSyntaxHighlighting","Controls whether syntax highlighting should be copied into the clipboard.")})),cursorBlinking:ie(new gb(26,"cursorBlinking",1,"blink",["blink","smooth","phase","expand","solid"],uz,{description:g("cursorBlinking","Control the cursor animation style.")})),cursorSmoothCaretAnimation:ie(new si(27,"cursorSmoothCaretAnimation","off",["off","explicit","on"],{enumDescriptions:[g("cursorSmoothCaretAnimation.off","Smooth caret animation is disabled."),g("cursorSmoothCaretAnimation.explicit","Smooth caret animation is enabled only when the user moves the cursor with an explicit gesture."),g("cursorSmoothCaretAnimation.on","Smooth caret animation is always enabled.")],description:g("cursorSmoothCaretAnimation","Controls whether the smooth caret animation should be enabled.")})),cursorStyle:ie(new gb(28,"cursorStyle",dn.Line,"line",["line","block","underline","line-thin","block-outline","underline-thin"],fz,{description:g("cursorStyle","Controls the cursor style.")})),cursorSurroundingLines:ie(new It(29,"cursorSurroundingLines",0,0,1073741824,{description:g("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:ie(new si(30,"cursorSurroundingLinesStyle","default",["default","all"],{enumDescriptions:[g("cursorSurroundingLinesStyle.default","`cursorSurroundingLines` is enforced only when triggered via the keyboard or API."),g("cursorSurroundingLinesStyle.all","`cursorSurroundingLines` is enforced always.")],markdownDescription:g("cursorSurroundingLinesStyle","Controls when `#cursorSurroundingLines#` should be enforced.")})),cursorWidth:ie(new It(31,"cursorWidth",0,0,1073741824,{markdownDescription:g("cursorWidth","Controls the width of the cursor when `#editor.cursorStyle#` is set to `line`.")})),disableLayerHinting:ie(new ct(32,"disableLayerHinting",!1)),disableMonospaceOptimizations:ie(new ct(33,"disableMonospaceOptimizations",!1)),domReadOnly:ie(new ct(34,"domReadOnly",!1)),dragAndDrop:ie(new ct(35,"dragAndDrop",!0,{description:g("dragAndDrop","Controls whether the editor should allow moving selections via drag and drop.")})),emptySelectionClipboard:ie(new pz),dropIntoEditor:ie(new jz),stickyScroll:ie(new yz),experimentalWhitespaceRendering:ie(new si(38,"experimentalWhitespaceRendering","svg",["svg","font","off"],{enumDescriptions:[g("experimentalWhitespaceRendering.svg","Use a new rendering method with svgs."),g("experimentalWhitespaceRendering.font","Use a new rendering method with font characters."),g("experimentalWhitespaceRendering.off","Use the stable rendering method.")],description:g("experimentalWhitespaceRendering","Controls whether whitespace is rendered with a new, experimental method.")})),extraEditorClassName:ie(new Es(39,"extraEditorClassName","")),fastScrollSensitivity:ie(new Jo(40,"fastScrollSensitivity",5,o=>o<=0?5:o,{markdownDescription:g("fastScrollSensitivity","Scrolling speed multiplier when pressing `Alt`.")})),find:ie(new mz),fixedOverflowWidgets:ie(new ct(42,"fixedOverflowWidgets",!1)),folding:ie(new ct(43,"folding",!0,{description:g("folding","Controls whether the editor has code folding enabled.")})),foldingStrategy:ie(new si(44,"foldingStrategy","auto",["auto","indentation"],{enumDescriptions:[g("foldingStrategy.auto","Use a language-specific folding strategy if available, else the indentation-based one."),g("foldingStrategy.indentation","Use the indentation-based folding strategy.")],description:g("foldingStrategy","Controls the strategy for computing folding ranges.")})),foldingHighlight:ie(new ct(45,"foldingHighlight",!0,{description:g("foldingHighlight","Controls whether the editor should highlight folded ranges.")})),foldingImportsByDefault:ie(new ct(46,"foldingImportsByDefault",!1,{description:g("foldingImportsByDefault","Controls whether the editor automatically collapses import ranges.")})),foldingMaximumRegions:ie(new It(47,"foldingMaximumRegions",5e3,10,65e3,{description:g("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:ie(new ct(48,"unfoldOnClickAfterEndOfLine",!1,{description:g("unfoldOnClickAfterEndOfLine","Controls whether clicking on the empty content after a folded line will unfold the line.")})),fontFamily:ie(new Es(49,"fontFamily",Ps.fontFamily,{description:g("fontFamily","Controls the font family.")})),fontInfo:ie(new _z),fontLigatures2:ie(new Xs),fontSize:ie(new vz),fontWeight:ie(new xa),fontVariations:ie(new Wr),formatOnPaste:ie(new ct(55,"formatOnPaste",!1,{description:g("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:ie(new ct(56,"formatOnType",!1,{description:g("formatOnType","Controls whether the editor should automatically format the line after typing.")})),glyphMargin:ie(new ct(57,"glyphMargin",!0,{description:g("glyphMargin","Controls whether the editor should render the vertical glyph margin. Glyph margin is mostly used for debugging.")})),gotoLocation:ie(new bz),hideCursorInOverviewRuler:ie(new ct(59,"hideCursorInOverviewRuler",!1,{description:g("hideCursorInOverviewRuler","Controls whether the cursor should be hidden in the overview ruler.")})),hover:ie(new Cz),inDiffEditor:ie(new ct(61,"inDiffEditor",!1)),letterSpacing:ie(new Jo(63,"letterSpacing",Ps.letterSpacing,o=>Jo.clamp(o,-5,20),{description:g("letterSpacing","Controls the letter spacing in pixels.")})),lightbulb:ie(new Sz),lineDecorationsWidth:ie(new xz),lineHeight:ie(new Dz),lineNumbers:ie(new Mz),lineNumbersMinChars:ie(new It(68,"lineNumbersMinChars",5,1,300)),linkedEditing:ie(new ct(69,"linkedEditing",!1,{description:g("linkedEditing","Controls whether the editor has linked editing enabled. Depending on the language, related symbols such as HTML tags, are updated while editing.")})),links:ie(new ct(70,"links",!0,{description:g("links","Controls whether the editor should detect links and make them clickable.")})),matchBrackets:ie(new si(71,"matchBrackets","always",["always","near","never"],{description:g("matchBrackets","Highlight matching brackets.")})),minimap:ie(new kz),mouseStyle:ie(new si(73,"mouseStyle","text",["text","default","copy"])),mouseWheelScrollSensitivity:ie(new Jo(74,"mouseWheelScrollSensitivity",1,o=>o===0?1:o,{markdownDescription:g("mouseWheelScrollSensitivity","A multiplier to be used on the `deltaX` and `deltaY` of mouse wheel scroll events.")})),mouseWheelZoom:ie(new ct(75,"mouseWheelZoom",!1,{markdownDescription:g("mouseWheelZoom","Zoom the font of the editor when using mouse wheel and holding `Ctrl`.")})),multiCursorMergeOverlapping:ie(new ct(76,"multiCursorMergeOverlapping",!0,{description:g("multiCursorMergeOverlapping","Merge multiple cursors when they are overlapping.")})),multiCursorModifier:ie(new gb(77,"multiCursorModifier","altKey","alt",["ctrlCmd","alt"],Iz,{markdownEnumDescriptions:[g("multiCursorModifier.ctrlCmd","Maps to `Control` on Windows and Linux and to `Command` on macOS."),g("multiCursorModifier.alt","Maps to `Alt` on Windows and Linux and to `Option` on macOS.")],markdownDescription:g({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:ie(new si(78,"multiCursorPaste","spread",["spread","full"],{markdownEnumDescriptions:[g("multiCursorPaste.spread","Each cursor pastes a single line of the text."),g("multiCursorPaste.full","Each cursor pastes the full text.")],markdownDescription:g("multiCursorPaste","Controls pasting when the line count of the pasted text matches the cursor count.")})),multiCursorLimit:ie(new It(79,"multiCursorLimit",1e4,1,1e5,{markdownDescription:g("multiCursorLimit","Controls the max number of cursors that can be in an active editor at once.")})),occurrencesHighlight:ie(new ct(80,"occurrencesHighlight",!0,{description:g("occurrencesHighlight","Controls whether the editor should highlight semantic symbol occurrences.")})),overviewRulerBorder:ie(new ct(81,"overviewRulerBorder",!0,{description:g("overviewRulerBorder","Controls whether a border should be drawn around the overview ruler.")})),overviewRulerLanes:ie(new It(82,"overviewRulerLanes",3,0,3)),padding:ie(new Ez),pasteAs:ie(new Kz),parameterHints:ie(new Nz),peekWidgetDefaultFocus:ie(new si(86,"peekWidgetDefaultFocus","tree",["tree","editor"],{enumDescriptions:[g("peekWidgetDefaultFocus.tree","Focus the tree when opening peek"),g("peekWidgetDefaultFocus.editor","Focus the editor when opening peek")],description:g("peekWidgetDefaultFocus","Controls whether to focus the inline editor or the tree in the peek widget.")})),definitionLinkOpensInPeek:ie(new ct(87,"definitionLinkOpensInPeek",!1,{description:g("definitionLinkOpensInPeek","Controls whether the Go to Definition mouse gesture always opens the peek widget.")})),quickSuggestions:ie(new Rz),quickSuggestionsDelay:ie(new It(89,"quickSuggestionsDelay",10,0,1073741824,{description:g("quickSuggestionsDelay","Controls the delay in milliseconds after which quick suggestions will show up.")})),readOnly:ie(new ct(90,"readOnly",!1)),readOnlyMessage:ie(new Pz),renameOnType:ie(new ct(92,"renameOnType",!1,{description:g("renameOnType","Controls whether the editor auto renames on type."),markdownDeprecationMessage:g("renameOnTypeDeprecate","Deprecated, use `editor.linkedEditing` instead.")})),renderControlCharacters:ie(new ct(93,"renderControlCharacters",!0,{description:g("renderControlCharacters","Controls whether the editor should render control characters."),restricted:!0})),renderFinalNewline:ie(new si(94,"renderFinalNewline",Zn?"dimmed":"on",["off","on","dimmed"],{description:g("renderFinalNewline","Render last line number when the file ends with a newline.")})),renderLineHighlight:ie(new si(95,"renderLineHighlight","line",["none","gutter","line","all"],{enumDescriptions:["","","",g("renderLineHighlight.all","Highlights both the gutter and the current line.")],description:g("renderLineHighlight","Controls how the editor should render the current line highlight.")})),renderLineHighlightOnlyWhenFocus:ie(new ct(96,"renderLineHighlightOnlyWhenFocus",!1,{description:g("renderLineHighlightOnlyWhenFocus","Controls if the editor should render the current line highlight only when the editor is focused.")})),renderValidationDecorations:ie(new si(97,"renderValidationDecorations","editable",["editable","on","off"])),renderWhitespace:ie(new si(98,"renderWhitespace","selection",["none","boundary","selection","trailing","all"],{enumDescriptions:["",g("renderWhitespace.boundary","Render whitespace characters except for single spaces between words."),g("renderWhitespace.selection","Render whitespace characters only on selected text."),g("renderWhitespace.trailing","Render only trailing whitespace characters."),""],description:g("renderWhitespace","Controls how the editor should render whitespace characters.")})),revealHorizontalRightPadding:ie(new It(99,"revealHorizontalRightPadding",15,0,1e3)),roundedSelection:ie(new ct(100,"roundedSelection",!0,{description:g("roundedSelection","Controls whether selections should have rounded corners.")})),rulers:ie(new Az),scrollbar:ie(new Oz),scrollBeyondLastColumn:ie(new It(103,"scrollBeyondLastColumn",4,0,1073741824,{description:g("scrollBeyondLastColumn","Controls the number of extra characters beyond which the editor will scroll horizontally.")})),scrollBeyondLastLine:ie(new ct(104,"scrollBeyondLastLine",!0,{description:g("scrollBeyondLastLine","Controls whether the editor will scroll beyond the last line.")})),scrollPredominantAxis:ie(new ct(105,"scrollPredominantAxis",!0,{description:g("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:ie(new ct(106,"selectionClipboard",!0,{description:g("selectionClipboard","Controls whether the Linux primary clipboard should be supported."),included:Zn})),selectionHighlight:ie(new ct(107,"selectionHighlight",!0,{description:g("selectionHighlight","Controls whether the editor should highlight matches similar to the selection.")})),selectOnLineNumbers:ie(new ct(108,"selectOnLineNumbers",!0)),showFoldingControls:ie(new si(109,"showFoldingControls","mouseover",["always","never","mouseover"],{enumDescriptions:[g("showFoldingControls.always","Always show the folding controls."),g("showFoldingControls.never","Never show the folding controls and reduce the gutter size."),g("showFoldingControls.mouseover","Only show the folding controls when the mouse is over the gutter.")],description:g("showFoldingControls","Controls when the folding controls on the gutter are shown.")})),showUnused:ie(new ct(110,"showUnused",!0,{description:g("showUnused","Controls fading out of unused code.")})),showDeprecated:ie(new ct(138,"showDeprecated",!0,{description:g("showDeprecated","Controls strikethrough deprecated variables.")})),inlayHints:ie(new Lz),snippetSuggestions:ie(new si(111,"snippetSuggestions","inline",["top","bottom","inline","none"],{enumDescriptions:[g("snippetSuggestions.top","Show snippet suggestions on top of other suggestions."),g("snippetSuggestions.bottom","Show snippet suggestions below other suggestions."),g("snippetSuggestions.inline","Show snippets suggestions with other suggestions."),g("snippetSuggestions.none","Do not show snippet suggestions.")],description:g("snippetSuggestions","Controls whether snippets are shown with other suggestions and how they are sorted.")})),smartSelect:ie(new zz),smoothScrolling:ie(new ct(113,"smoothScrolling",!1,{description:g("smoothScrolling","Controls whether the editor will scroll using an animation.")})),stopRenderingLineAfter:ie(new It(116,"stopRenderingLineAfter",1e4,-1,1073741824)),suggest:ie(new Hz),inlineSuggest:ie(new Bz),inlineCompletionsAccessibilityVerbose:ie(new ct(147,"inlineCompletionsAccessibilityVerbose",!1,{description:g("inlineCompletionsAccessibilityVerbose","Controls whether the accessibility hint should be provided to screen reader users when an inline completion is shown.")})),suggestFontSize:ie(new It(118,"suggestFontSize",0,0,1e3,{markdownDescription:g("suggestFontSize","Font size for the suggest widget. When set to {0}, the value of {1} is used.","`0`","`#editor.fontSize#`")})),suggestLineHeight:ie(new It(119,"suggestLineHeight",0,0,1e3,{markdownDescription:g("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:ie(new ct(120,"suggestOnTriggerCharacters",!0,{description:g("suggestOnTriggerCharacters","Controls whether suggestions should automatically show up when typing trigger characters.")})),suggestSelection:ie(new si(121,"suggestSelection","first",["first","recentlyUsed","recentlyUsedByPrefix"],{markdownEnumDescriptions:[g("suggestSelection.first","Always select the first suggestion."),g("suggestSelection.recentlyUsed","Select recent suggestions unless further typing selects one, e.g. `console.| -> console.log` because `log` has been completed recently."),g("suggestSelection.recentlyUsedByPrefix","Select suggestions based on previous prefixes that have completed those suggestions, e.g. `co -> console` and `con -> const`.")],description:g("suggestSelection","Controls how suggestions are pre-selected when showing the suggest list.")})),tabCompletion:ie(new si(122,"tabCompletion","off",["on","off","onlySnippets"],{enumDescriptions:[g("tabCompletion.on","Tab complete will insert the best matching suggestion when pressing tab."),g("tabCompletion.off","Disable tab completions."),g("tabCompletion.onlySnippets","Tab complete snippets when their prefix match. Works best when 'quickSuggestions' aren't enabled.")],description:g("tabCompletion","Enables tab completions.")})),tabIndex:ie(new It(123,"tabIndex",0,-1,1073741824)),unicodeHighlight:ie(new Fz),unusualLineTerminators:ie(new si(125,"unusualLineTerminators","prompt",["auto","off","prompt"],{enumDescriptions:[g("unusualLineTerminators.auto","Unusual line terminators are automatically removed."),g("unusualLineTerminators.off","Unusual line terminators are ignored."),g("unusualLineTerminators.prompt","Unusual line terminators prompt to be removed.")],description:g("unusualLineTerminators","Remove unusual line terminators that might cause problems.")})),useShadowDOM:ie(new ct(126,"useShadowDOM",!0)),useTabStops:ie(new ct(127,"useTabStops",!0,{description:g("useTabStops","Inserting and deleting whitespace follows tab stops.")})),wordBreak:ie(new si(128,"wordBreak","normal",["normal","keepAll"],{markdownEnumDescriptions:[g("wordBreak.normal","Use the default line break rule."),g("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:g("wordBreak","Controls the word break rules used for Chinese/Japanese/Korean (CJK) text.")})),wordSeparators:ie(new Es(129,"wordSeparators",q3,{description:g("wordSeparators","Characters that will be used as word separators when doing word related navigations or operations.")})),wordWrap:ie(new si(130,"wordWrap","off",["off","on","wordWrapColumn","bounded"],{markdownEnumDescriptions:[g("wordWrap.off","Lines will never wrap."),g("wordWrap.on","Lines will wrap at the viewport width."),g({key:"wordWrap.wordWrapColumn",comment:["- `editor.wordWrapColumn` refers to a different setting and should not be localized."]},"Lines will wrap at `#editor.wordWrapColumn#`."),g({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:g({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:ie(new Es(131,"wordWrapBreakAfterCharacters"," })]?|/&.,;¢°′″‰℃、。。、¢,.:;?!%・・ゝゞヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻ァィゥェォャュョッー”〉》」』】〕)]}」")),wordWrapBreakBeforeCharacters:ie(new Es(132,"wordWrapBreakBeforeCharacters","([{‘“〈《「『【〔([{「£¥$£¥++")),wordWrapColumn:ie(new It(133,"wordWrapColumn",80,1,1073741824,{markdownDescription:g({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:ie(new si(134,"wordWrapOverride1","inherit",["off","on","inherit"])),wordWrapOverride2:ie(new si(135,"wordWrapOverride2","inherit",["off","on","inherit"])),editorClassName:ie(new gz),defaultColorDecorators:ie(new ct(145,"defaultColorDecorators",!1,{markdownDescription:g("defaultColorDecorators","Controls whether inline color decorations should be shown using the default document color provider")})),pixelRatio:ie(new Tz),tabFocusMode:ie(new ct(142,"tabFocusMode",!1,{markdownDescription:g("tabFocusMode","Controls whether the editor receives tabs or defers them to the workbench for navigation.")})),layoutInfo:ie(new fg),wrappingInfo:ie(new $z),wrappingIndent:ie(new Uz),wrappingStrategy:ie(new wz)};class Yz{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?zg.isErrorNoTelemetry(e)?new zg(e.message+`
@@ -644,27 +644,27 @@ ${e.toString()}`}}class Pw{constructor(e=new ay,t=!1,i,n=Ure){var s;this._servic
644
644
  * Version: 0.44.0(3e047efd345ff102c8c61b5398fb30845aaac166)
645
645
  * Released under the MIT license
646
646
  * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
647
- *-----------------------------------------------------------------------------*/var ice=Object.defineProperty,nce=Object.getOwnPropertyDescriptor,sce=Object.getOwnPropertyNames,oce=Object.prototype.hasOwnProperty,UF=(o,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of sce(e))!oce.call(o,n)&&n!==t&&ice(o,n,{get:()=>e[n],enumerable:!(i=nce(e,n))||i.enumerable});return o},rce=(o,e,t)=>(UF(o,e,"default"),t&&UF(t,e,"default")),Qm={};rce(Qm,q0);var O6={},cD={},F6=class{static getOrCreate(o){return cD[o]||(cD[o]=new F6(o)),cD[o]}_languageId;_loadingTriggered;_lazyLoadPromise;_lazyLoadPromiseResolve;_lazyLoadPromiseReject;constructor(o){this._languageId=o,this._loadingTriggered=!1,this._lazyLoadPromise=new Promise((e,t)=>{this._lazyLoadPromiseResolve=e,this._lazyLoadPromiseReject=t})}load(){return this._loadingTriggered||(this._loadingTriggered=!0,O6[this._languageId].loader().then(o=>this._lazyLoadPromiseResolve(o),o=>this._lazyLoadPromiseReject(o))),this._lazyLoadPromise}};function ye(o){const e=o.id;O6[e]=o,Qm.languages.register(o);const t=F6.getOrCreate(e);Qm.languages.registerTokensProviderFactory(e,{create:async()=>(await t.load()).language}),Qm.languages.onLanguageEncountered(e,async()=>{const i=await t.load();Qm.languages.setLanguageConfiguration(e,i.conf)})}ye({id:"abap",extensions:[".abap"],aliases:["abap","ABAP"],loader:()=>be(()=>import("./abap-Bs-KDgo-.js"),__vite__mapDeps([]))});ye({id:"apex",extensions:[".cls"],aliases:["Apex","apex"],mimetypes:["text/x-apex-source","text/x-apex"],loader:()=>be(()=>import("./apex-BB8ijgrA.js"),__vite__mapDeps([]))});ye({id:"azcli",extensions:[".azcli"],aliases:["Azure CLI","azcli"],loader:()=>be(()=>import("./azcli-CM0y7Ame.js"),__vite__mapDeps([]))});ye({id:"bat",extensions:[".bat",".cmd"],aliases:["Batch","bat"],loader:()=>be(()=>import("./bat-Bfxf8Mzl.js"),__vite__mapDeps([]))});ye({id:"bicep",extensions:[".bicep"],aliases:["Bicep"],loader:()=>be(()=>import("./bicep-DJPqIr_M.js"),__vite__mapDeps([]))});ye({id:"cameligo",extensions:[".mligo"],aliases:["Cameligo"],loader:()=>be(()=>import("./cameligo-PnszTm2c.js"),__vite__mapDeps([]))});ye({id:"clojure",extensions:[".clj",".cljs",".cljc",".edn"],aliases:["clojure","Clojure"],loader:()=>be(()=>import("./clojure-B3cFVYI-.js"),__vite__mapDeps([]))});ye({id:"coffeescript",extensions:[".coffee"],aliases:["CoffeeScript","coffeescript","coffee"],mimetypes:["text/x-coffeescript","text/coffeescript"],loader:()=>be(()=>import("./coffee-D8tSzcLH.js"),__vite__mapDeps([]))});ye({id:"c",extensions:[".c",".h"],aliases:["C","c"],loader:()=>be(()=>import("./cpp-CP-cATHl.js"),__vite__mapDeps([]))});ye({id:"cpp",extensions:[".cpp",".cc",".cxx",".hpp",".hh",".hxx"],aliases:["C++","Cpp","cpp"],loader:()=>be(()=>import("./cpp-CP-cATHl.js"),__vite__mapDeps([]))});ye({id:"csharp",extensions:[".cs",".csx",".cake"],aliases:["C#","csharp"],loader:()=>be(()=>import("./csharp-Dfj4WFqy.js"),__vite__mapDeps([]))});ye({id:"csp",extensions:[],aliases:["CSP","csp"],loader:()=>be(()=>import("./csp-D9HxVpWn.js"),__vite__mapDeps([]))});ye({id:"css",extensions:[".css"],aliases:["CSS","css"],mimetypes:["text/css"],loader:()=>be(()=>import("./css-CkCHETKw.js"),__vite__mapDeps([]))});ye({id:"cypher",extensions:[".cypher",".cyp"],aliases:["Cypher","OpenCypher"],loader:()=>be(()=>import("./cypher-B50w5pq9.js"),__vite__mapDeps([]))});ye({id:"dart",extensions:[".dart"],aliases:["Dart","dart"],mimetypes:["text/x-dart-source","text/x-dart"],loader:()=>be(()=>import("./dart-DvROnYA_.js"),__vite__mapDeps([]))});ye({id:"dockerfile",extensions:[".dockerfile"],filenames:["Dockerfile"],aliases:["Dockerfile"],loader:()=>be(()=>import("./dockerfile-C4f37Dvd.js"),__vite__mapDeps([]))});ye({id:"ecl",extensions:[".ecl"],aliases:["ECL","Ecl","ecl"],loader:()=>be(()=>import("./ecl-DW46Dzft.js"),__vite__mapDeps([]))});ye({id:"elixir",extensions:[".ex",".exs"],aliases:["Elixir","elixir","ex"],loader:()=>be(()=>import("./elixir-BIa5JtGe.js"),__vite__mapDeps([]))});ye({id:"flow9",extensions:[".flow"],aliases:["Flow9","Flow","flow9","flow"],loader:()=>be(()=>import("./flow9-ByI4Scwv.js"),__vite__mapDeps([]))});ye({id:"fsharp",extensions:[".fs",".fsi",".ml",".mli",".fsx",".fsscript"],aliases:["F#","FSharp","fsharp"],loader:()=>be(()=>import("./fsharp-Cgf6u04w.js"),__vite__mapDeps([]))});ye({id:"freemarker2",extensions:[".ftl",".ftlh",".ftlx"],aliases:["FreeMarker2","Apache FreeMarker2"],loader:()=>be(()=>import("./freemarker2-CJRN0A1r.js"),__vite__mapDeps([0,1,2,3,4])).then(o=>o.TagAutoInterpolationDollar)});ye({id:"freemarker2.tag-angle.interpolation-dollar",aliases:["FreeMarker2 (Angle/Dollar)","Apache FreeMarker2 (Angle/Dollar)"],loader:()=>be(()=>import("./freemarker2-CJRN0A1r.js"),__vite__mapDeps([0,1,2,3,4])).then(o=>o.TagAngleInterpolationDollar)});ye({id:"freemarker2.tag-bracket.interpolation-dollar",aliases:["FreeMarker2 (Bracket/Dollar)","Apache FreeMarker2 (Bracket/Dollar)"],loader:()=>be(()=>import("./freemarker2-CJRN0A1r.js"),__vite__mapDeps([0,1,2,3,4])).then(o=>o.TagBracketInterpolationDollar)});ye({id:"freemarker2.tag-angle.interpolation-bracket",aliases:["FreeMarker2 (Angle/Bracket)","Apache FreeMarker2 (Angle/Bracket)"],loader:()=>be(()=>import("./freemarker2-CJRN0A1r.js"),__vite__mapDeps([0,1,2,3,4])).then(o=>o.TagAngleInterpolationBracket)});ye({id:"freemarker2.tag-bracket.interpolation-bracket",aliases:["FreeMarker2 (Bracket/Bracket)","Apache FreeMarker2 (Bracket/Bracket)"],loader:()=>be(()=>import("./freemarker2-CJRN0A1r.js"),__vite__mapDeps([0,1,2,3,4])).then(o=>o.TagBracketInterpolationBracket)});ye({id:"freemarker2.tag-auto.interpolation-dollar",aliases:["FreeMarker2 (Auto/Dollar)","Apache FreeMarker2 (Auto/Dollar)"],loader:()=>be(()=>import("./freemarker2-CJRN0A1r.js"),__vite__mapDeps([0,1,2,3,4])).then(o=>o.TagAutoInterpolationDollar)});ye({id:"freemarker2.tag-auto.interpolation-bracket",aliases:["FreeMarker2 (Auto/Bracket)","Apache FreeMarker2 (Auto/Bracket)"],loader:()=>be(()=>import("./freemarker2-CJRN0A1r.js"),__vite__mapDeps([0,1,2,3,4])).then(o=>o.TagAutoInterpolationBracket)});ye({id:"go",extensions:[".go"],aliases:["Go"],loader:()=>be(()=>import("./go-CJfxPkej.js"),__vite__mapDeps([]))});ye({id:"graphql",extensions:[".graphql",".gql"],aliases:["GraphQL","graphql","gql"],mimetypes:["application/graphql"],loader:()=>be(()=>import("./graphql-CGlhcY2-.js"),__vite__mapDeps([]))});ye({id:"handlebars",extensions:[".handlebars",".hbs"],aliases:["Handlebars","handlebars","hbs"],mimetypes:["text/x-handlebars-template"],loader:()=>be(()=>import("./handlebars-iTWM3ahM.js"),__vite__mapDeps([5,1,2,3,4]))});ye({id:"hcl",extensions:[".tf",".tfvars",".hcl"],aliases:["Terraform","tf","HCL","hcl"],loader:()=>be(()=>import("./hcl-CTI7WNlW.js"),__vite__mapDeps([]))});ye({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:()=>be(()=>import("./html-CpaHgWrY.js"),__vite__mapDeps([6,1,2,3,4]))});ye({id:"ini",extensions:[".ini",".properties",".gitconfig"],filenames:["config",".gitattributes",".gitconfig",".editorconfig"],aliases:["Ini","ini"],loader:()=>be(()=>import("./ini-qJXHXiTY.js"),__vite__mapDeps([]))});ye({id:"java",extensions:[".java",".jav"],aliases:["Java","java"],mimetypes:["text/x-java-source","text/x-java"],loader:()=>be(()=>import("./java-Dnrl9822.js"),__vite__mapDeps([]))});ye({id:"javascript",extensions:[".js",".es6",".jsx",".mjs",".cjs"],firstLine:"^#!.*\\bnode",filenames:["jakefile"],aliases:["JavaScript","javascript","js"],mimetypes:["text/javascript"],loader:()=>be(()=>import("./javascript-zOLCCWF1.js"),__vite__mapDeps([7,8,1,2,3,4]))});ye({id:"julia",extensions:[".jl"],aliases:["julia","Julia"],loader:()=>be(()=>import("./julia-pqMLycLG.js"),__vite__mapDeps([]))});ye({id:"kotlin",extensions:[".kt",".kts"],aliases:["Kotlin","kotlin"],mimetypes:["text/x-kotlin-source","text/x-kotlin"],loader:()=>be(()=>import("./kotlin-DLX697jv.js"),__vite__mapDeps([]))});ye({id:"less",extensions:[".less"],aliases:["Less","less"],mimetypes:["text/x-less","text/less"],loader:()=>be(()=>import("./less-2ExdFhZM.js"),__vite__mapDeps([]))});ye({id:"lexon",extensions:[".lex"],aliases:["Lexon"],loader:()=>be(()=>import("./lexon-ABKfEwhw.js"),__vite__mapDeps([]))});ye({id:"lua",extensions:[".lua"],aliases:["Lua","lua"],loader:()=>be(()=>import("./lua-CI0blgFs.js"),__vite__mapDeps([]))});ye({id:"liquid",extensions:[".liquid",".html.liquid"],aliases:["Liquid","liquid"],mimetypes:["application/liquid"],loader:()=>be(()=>import("./liquid-Bu0TeitP.js"),__vite__mapDeps([9,1,2,3,4]))});ye({id:"m3",extensions:[".m3",".i3",".mg",".ig"],aliases:["Modula-3","Modula3","modula3","m3"],loader:()=>be(()=>import("./m3-yVPEHiu4.js"),__vite__mapDeps([]))});ye({id:"markdown",extensions:[".md",".markdown",".mdown",".mkdn",".mkd",".mdwn",".mdtxt",".mdtext"],aliases:["Markdown","markdown"],loader:()=>be(()=>import("./markdown-CjOKAnMy.js"),__vite__mapDeps([]))});ye({id:"mdx",extensions:[".mdx"],aliases:["MDX","mdx"],loader:()=>be(()=>import("./mdx-uhxhQOIT.js"),__vite__mapDeps([10,1,2,3,4]))});ye({id:"mips",extensions:[".s"],aliases:["MIPS","MIPS-V"],mimetypes:["text/x-mips","text/mips","text/plaintext"],loader:()=>be(()=>import("./mips-B7KWClFm.js"),__vite__mapDeps([]))});ye({id:"msdax",extensions:[".dax",".msdax"],aliases:["DAX","MSDAX"],loader:()=>be(()=>import("./msdax-N_40gjXO.js"),__vite__mapDeps([]))});ye({id:"mysql",extensions:[],aliases:["MySQL","mysql"],loader:()=>be(()=>import("./mysql-CzgTwwi2.js"),__vite__mapDeps([]))});ye({id:"objective-c",extensions:[".m"],aliases:["Objective-C"],loader:()=>be(()=>import("./objective-c-CwAIQX-6.js"),__vite__mapDeps([]))});ye({id:"pascal",extensions:[".pas",".p",".pp"],aliases:["Pascal","pas"],mimetypes:["text/x-pascal-source","text/x-pascal"],loader:()=>be(()=>import("./pascal-3SrKWnFX.js"),__vite__mapDeps([]))});ye({id:"pascaligo",extensions:[".ligo"],aliases:["Pascaligo","ligo"],loader:()=>be(()=>import("./pascaligo-Cv9Y0fbC.js"),__vite__mapDeps([]))});ye({id:"perl",extensions:[".pl",".pm"],aliases:["Perl","pl"],loader:()=>be(()=>import("./perl-DHxnJL0_.js"),__vite__mapDeps([]))});ye({id:"pgsql",extensions:[],aliases:["PostgreSQL","postgres","pg","postgre"],loader:()=>be(()=>import("./pgsql-DGJFw0qd.js"),__vite__mapDeps([]))});ye({id:"php",extensions:[".php",".php4",".php5",".phtml",".ctp"],aliases:["PHP","php"],mimetypes:["application/x-php"],loader:()=>be(()=>import("./php-BA3Rqjpx.js"),__vite__mapDeps([]))});ye({id:"pla",extensions:[".pla"],loader:()=>be(()=>import("./pla-DKf5_u7N.js"),__vite__mapDeps([]))});ye({id:"postiats",extensions:[".dats",".sats",".hats"],aliases:["ATS","ATS/Postiats"],loader:()=>be(()=>import("./postiats-Bup1kUyj.js"),__vite__mapDeps([]))});ye({id:"powerquery",extensions:[".pq",".pqm"],aliases:["PQ","M","Power Query","Power Query M"],loader:()=>be(()=>import("./powerquery-BfbPeLER.js"),__vite__mapDeps([]))});ye({id:"powershell",extensions:[".ps1",".psm1",".psd1"],aliases:["PowerShell","powershell","ps","ps1"],loader:()=>be(()=>import("./powershell-DAsS7BG8.js"),__vite__mapDeps([]))});ye({id:"proto",extensions:[".proto"],aliases:["protobuf","Protocol Buffers"],loader:()=>be(()=>import("./protobuf-Dzs34GPr.js"),__vite__mapDeps([]))});ye({id:"pug",extensions:[".jade",".pug"],aliases:["Pug","Jade","jade"],loader:()=>be(()=>import("./pug-CVuUMJ1K.js"),__vite__mapDeps([]))});ye({id:"python",extensions:[".py",".rpy",".pyw",".cpy",".gyp",".gypi"],aliases:["Python","py"],firstLine:"^#!/.*\\bpython[0-9.-]*\\b",loader:()=>be(()=>import("./python-4inBdLoB.js"),__vite__mapDeps([11,1,2,3,4]))});ye({id:"qsharp",extensions:[".qs"],aliases:["Q#","qsharp"],loader:()=>be(()=>import("./qsharp-BgY1GbL_.js"),__vite__mapDeps([]))});ye({id:"r",extensions:[".r",".rhistory",".rmd",".rprofile",".rt"],aliases:["R","r"],loader:()=>be(()=>import("./r-C2Iz-cGs.js"),__vite__mapDeps([]))});ye({id:"razor",extensions:[".cshtml"],aliases:["Razor","razor"],mimetypes:["text/x-cshtml"],loader:()=>be(()=>import("./razor-BGbFglDZ.js"),__vite__mapDeps([12,1,2,3,4]))});ye({id:"redis",extensions:[".redis"],aliases:["redis"],loader:()=>be(()=>import("./redis-F7UxdB6U.js"),__vite__mapDeps([]))});ye({id:"redshift",extensions:[],aliases:["Redshift","redshift"],loader:()=>be(()=>import("./redshift-CDF44XVS.js"),__vite__mapDeps([]))});ye({id:"restructuredtext",extensions:[".rst"],aliases:["reStructuredText","restructuredtext"],loader:()=>be(()=>import("./restructuredtext-C_dzeD_4.js"),__vite__mapDeps([]))});ye({id:"ruby",extensions:[".rb",".rbx",".rjs",".gemspec",".pp"],filenames:["rakefile","Gemfile"],aliases:["Ruby","rb"],loader:()=>be(()=>import("./ruby-BdxlVRg3.js"),__vite__mapDeps([]))});ye({id:"rust",extensions:[".rs",".rlib"],aliases:["Rust","rust"],loader:()=>be(()=>import("./rust-gU8692nP.js"),__vite__mapDeps([]))});ye({id:"sb",extensions:[".sb"],aliases:["Small Basic","sb"],loader:()=>be(()=>import("./sb-CsAkPjmq.js"),__vite__mapDeps([]))});ye({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:()=>be(()=>import("./scala-D_TH4Qyk.js"),__vite__mapDeps([]))});ye({id:"scheme",extensions:[".scm",".ss",".sch",".rkt"],aliases:["scheme","Scheme"],loader:()=>be(()=>import("./scheme-CTXRt_ZJ.js"),__vite__mapDeps([]))});ye({id:"scss",extensions:[".scss"],aliases:["Sass","sass","scss"],mimetypes:["text/x-scss","text/scss"],loader:()=>be(()=>import("./scss-Rf_ppwBg.js"),__vite__mapDeps([]))});ye({id:"shell",extensions:[".sh",".bash"],aliases:["Shell","sh"],loader:()=>be(()=>import("./shell-osqRiq1b.js"),__vite__mapDeps([]))});ye({id:"sol",extensions:[".sol"],aliases:["sol","solidity","Solidity"],loader:()=>be(()=>import("./solidity-BTHmi1CB.js"),__vite__mapDeps([]))});ye({id:"aes",extensions:[".aes"],aliases:["aes","sophia","Sophia"],loader:()=>be(()=>import("./sophia-BRe4RArb.js"),__vite__mapDeps([]))});ye({id:"sparql",extensions:[".rq"],aliases:["sparql","SPARQL"],loader:()=>be(()=>import("./sparql-CaSv-uNl.js"),__vite__mapDeps([]))});ye({id:"sql",extensions:[".sql"],aliases:["SQL"],loader:()=>be(()=>import("./sql-CHiRcria.js"),__vite__mapDeps([]))});ye({id:"st",extensions:[".st",".iecst",".iecplc",".lc3lib",".TcPOU",".TcDUT",".TcGVL",".TcIO"],aliases:["StructuredText","scl","stl"],loader:()=>be(()=>import("./st-CCGZ7KTi.js"),__vite__mapDeps([]))});ye({id:"swift",aliases:["Swift","swift"],extensions:[".swift"],mimetypes:["text/swift"],loader:()=>be(()=>import("./swift-DeyDsJzf.js"),__vite__mapDeps([]))});ye({id:"systemverilog",extensions:[".sv",".svh"],aliases:["SV","sv","SystemVerilog","systemverilog"],loader:()=>be(()=>import("./systemverilog-RSGMMa-l.js"),__vite__mapDeps([]))});ye({id:"verilog",extensions:[".v",".vh"],aliases:["V","v","Verilog","verilog"],loader:()=>be(()=>import("./systemverilog-RSGMMa-l.js"),__vite__mapDeps([]))});ye({id:"tcl",extensions:[".tcl"],aliases:["tcl","Tcl","tcltk","TclTk","tcl/tk","Tcl/Tk"],loader:()=>be(()=>import("./tcl-B28K5YOH.js"),__vite__mapDeps([]))});ye({id:"twig",extensions:[".twig"],aliases:["Twig","twig"],mimetypes:["text/x-twig"],loader:()=>be(()=>import("./twig-ChoE7Tfw.js"),__vite__mapDeps([]))});ye({id:"typescript",extensions:[".ts",".tsx",".cts",".mts"],aliases:["TypeScript","ts","typescript"],mimetypes:["text/typescript"],loader:()=>be(()=>import("./typescript-3uQjFVUM.js"),__vite__mapDeps([8,1,2,3,4]))});ye({id:"vb",extensions:[".vb"],aliases:["Visual Basic","vb"],loader:()=>be(()=>import("./vb-BCnlgLOU.js"),__vite__mapDeps([]))});ye({id:"wgsl",extensions:[".wgsl"],aliases:["WebGPU Shading Language","WGSL","wgsl"],loader:()=>be(()=>import("./wgsl-DlxrJ_uh.js"),__vite__mapDeps([]))});ye({id:"xml",extensions:[".xml",".xsd",".dtd",".ascx",".csproj",".config",".props",".targets",".wxi",".wxl",".wxs",".xaml",".svg",".svgz",".opf",".xslt",".xsl"],firstLine:"(\\<\\?xml.*)|(\\<svg)|(\\<\\!doctype\\s+svg)",aliases:["XML","xml"],mimetypes:["text/xml","application/xml","application/xaml+xml","application/xml-dtd"],loader:()=>be(()=>import("./xml-DnmeLHVb.js"),__vite__mapDeps([13,1,2,3,4]))});ye({id:"yaml",extensions:[".yaml",".yml"],aliases:["YAML","yaml","YML","yml"],mimetypes:["application/x-yaml","text/x-yaml"],loader:()=>be(()=>import("./yaml-ByRsSZUB.js"),__vite__mapDeps([14,1,2,3,4]))});/*!-----------------------------------------------------------------------------
647
+ *-----------------------------------------------------------------------------*/var ice=Object.defineProperty,nce=Object.getOwnPropertyDescriptor,sce=Object.getOwnPropertyNames,oce=Object.prototype.hasOwnProperty,UF=(o,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of sce(e))!oce.call(o,n)&&n!==t&&ice(o,n,{get:()=>e[n],enumerable:!(i=nce(e,n))||i.enumerable});return o},rce=(o,e,t)=>(UF(o,e,"default"),t&&UF(t,e,"default")),Qm={};rce(Qm,q0);var O6={},cD={},F6=class{static getOrCreate(o){return cD[o]||(cD[o]=new F6(o)),cD[o]}_languageId;_loadingTriggered;_lazyLoadPromise;_lazyLoadPromiseResolve;_lazyLoadPromiseReject;constructor(o){this._languageId=o,this._loadingTriggered=!1,this._lazyLoadPromise=new Promise((e,t)=>{this._lazyLoadPromiseResolve=e,this._lazyLoadPromiseReject=t})}load(){return this._loadingTriggered||(this._loadingTriggered=!0,O6[this._languageId].loader().then(o=>this._lazyLoadPromiseResolve(o),o=>this._lazyLoadPromiseReject(o))),this._lazyLoadPromise}};function ye(o){const e=o.id;O6[e]=o,Qm.languages.register(o);const t=F6.getOrCreate(e);Qm.languages.registerTokensProviderFactory(e,{create:async()=>(await t.load()).language}),Qm.languages.onLanguageEncountered(e,async()=>{const i=await t.load();Qm.languages.setLanguageConfiguration(e,i.conf)})}ye({id:"abap",extensions:[".abap"],aliases:["abap","ABAP"],loader:()=>be(()=>import("./abap-Bs-KDgo-.js"),__vite__mapDeps([]))});ye({id:"apex",extensions:[".cls"],aliases:["Apex","apex"],mimetypes:["text/x-apex-source","text/x-apex"],loader:()=>be(()=>import("./apex-BB8ijgrA.js"),__vite__mapDeps([]))});ye({id:"azcli",extensions:[".azcli"],aliases:["Azure CLI","azcli"],loader:()=>be(()=>import("./azcli-CM0y7Ame.js"),__vite__mapDeps([]))});ye({id:"bat",extensions:[".bat",".cmd"],aliases:["Batch","bat"],loader:()=>be(()=>import("./bat-Bfxf8Mzl.js"),__vite__mapDeps([]))});ye({id:"bicep",extensions:[".bicep"],aliases:["Bicep"],loader:()=>be(()=>import("./bicep-DJPqIr_M.js"),__vite__mapDeps([]))});ye({id:"cameligo",extensions:[".mligo"],aliases:["Cameligo"],loader:()=>be(()=>import("./cameligo-PnszTm2c.js"),__vite__mapDeps([]))});ye({id:"clojure",extensions:[".clj",".cljs",".cljc",".edn"],aliases:["clojure","Clojure"],loader:()=>be(()=>import("./clojure-B3cFVYI-.js"),__vite__mapDeps([]))});ye({id:"coffeescript",extensions:[".coffee"],aliases:["CoffeeScript","coffeescript","coffee"],mimetypes:["text/x-coffeescript","text/coffeescript"],loader:()=>be(()=>import("./coffee-D8tSzcLH.js"),__vite__mapDeps([]))});ye({id:"c",extensions:[".c",".h"],aliases:["C","c"],loader:()=>be(()=>import("./cpp-CP-cATHl.js"),__vite__mapDeps([]))});ye({id:"cpp",extensions:[".cpp",".cc",".cxx",".hpp",".hh",".hxx"],aliases:["C++","Cpp","cpp"],loader:()=>be(()=>import("./cpp-CP-cATHl.js"),__vite__mapDeps([]))});ye({id:"csharp",extensions:[".cs",".csx",".cake"],aliases:["C#","csharp"],loader:()=>be(()=>import("./csharp-Dfj4WFqy.js"),__vite__mapDeps([]))});ye({id:"csp",extensions:[],aliases:["CSP","csp"],loader:()=>be(()=>import("./csp-D9HxVpWn.js"),__vite__mapDeps([]))});ye({id:"css",extensions:[".css"],aliases:["CSS","css"],mimetypes:["text/css"],loader:()=>be(()=>import("./css-CkCHETKw.js"),__vite__mapDeps([]))});ye({id:"cypher",extensions:[".cypher",".cyp"],aliases:["Cypher","OpenCypher"],loader:()=>be(()=>import("./cypher-B50w5pq9.js"),__vite__mapDeps([]))});ye({id:"dart",extensions:[".dart"],aliases:["Dart","dart"],mimetypes:["text/x-dart-source","text/x-dart"],loader:()=>be(()=>import("./dart-DvROnYA_.js"),__vite__mapDeps([]))});ye({id:"dockerfile",extensions:[".dockerfile"],filenames:["Dockerfile"],aliases:["Dockerfile"],loader:()=>be(()=>import("./dockerfile-C4f37Dvd.js"),__vite__mapDeps([]))});ye({id:"ecl",extensions:[".ecl"],aliases:["ECL","Ecl","ecl"],loader:()=>be(()=>import("./ecl-DW46Dzft.js"),__vite__mapDeps([]))});ye({id:"elixir",extensions:[".ex",".exs"],aliases:["Elixir","elixir","ex"],loader:()=>be(()=>import("./elixir-BIa5JtGe.js"),__vite__mapDeps([]))});ye({id:"flow9",extensions:[".flow"],aliases:["Flow9","Flow","flow9","flow"],loader:()=>be(()=>import("./flow9-ByI4Scwv.js"),__vite__mapDeps([]))});ye({id:"fsharp",extensions:[".fs",".fsi",".ml",".mli",".fsx",".fsscript"],aliases:["F#","FSharp","fsharp"],loader:()=>be(()=>import("./fsharp-Cgf6u04w.js"),__vite__mapDeps([]))});ye({id:"freemarker2",extensions:[".ftl",".ftlh",".ftlx"],aliases:["FreeMarker2","Apache FreeMarker2"],loader:()=>be(()=>import("./freemarker2-BjRjUUgK.js"),__vite__mapDeps([0,1,2,3,4])).then(o=>o.TagAutoInterpolationDollar)});ye({id:"freemarker2.tag-angle.interpolation-dollar",aliases:["FreeMarker2 (Angle/Dollar)","Apache FreeMarker2 (Angle/Dollar)"],loader:()=>be(()=>import("./freemarker2-BjRjUUgK.js"),__vite__mapDeps([0,1,2,3,4])).then(o=>o.TagAngleInterpolationDollar)});ye({id:"freemarker2.tag-bracket.interpolation-dollar",aliases:["FreeMarker2 (Bracket/Dollar)","Apache FreeMarker2 (Bracket/Dollar)"],loader:()=>be(()=>import("./freemarker2-BjRjUUgK.js"),__vite__mapDeps([0,1,2,3,4])).then(o=>o.TagBracketInterpolationDollar)});ye({id:"freemarker2.tag-angle.interpolation-bracket",aliases:["FreeMarker2 (Angle/Bracket)","Apache FreeMarker2 (Angle/Bracket)"],loader:()=>be(()=>import("./freemarker2-BjRjUUgK.js"),__vite__mapDeps([0,1,2,3,4])).then(o=>o.TagAngleInterpolationBracket)});ye({id:"freemarker2.tag-bracket.interpolation-bracket",aliases:["FreeMarker2 (Bracket/Bracket)","Apache FreeMarker2 (Bracket/Bracket)"],loader:()=>be(()=>import("./freemarker2-BjRjUUgK.js"),__vite__mapDeps([0,1,2,3,4])).then(o=>o.TagBracketInterpolationBracket)});ye({id:"freemarker2.tag-auto.interpolation-dollar",aliases:["FreeMarker2 (Auto/Dollar)","Apache FreeMarker2 (Auto/Dollar)"],loader:()=>be(()=>import("./freemarker2-BjRjUUgK.js"),__vite__mapDeps([0,1,2,3,4])).then(o=>o.TagAutoInterpolationDollar)});ye({id:"freemarker2.tag-auto.interpolation-bracket",aliases:["FreeMarker2 (Auto/Bracket)","Apache FreeMarker2 (Auto/Bracket)"],loader:()=>be(()=>import("./freemarker2-BjRjUUgK.js"),__vite__mapDeps([0,1,2,3,4])).then(o=>o.TagAutoInterpolationBracket)});ye({id:"go",extensions:[".go"],aliases:["Go"],loader:()=>be(()=>import("./go-CJfxPkej.js"),__vite__mapDeps([]))});ye({id:"graphql",extensions:[".graphql",".gql"],aliases:["GraphQL","graphql","gql"],mimetypes:["application/graphql"],loader:()=>be(()=>import("./graphql-CGlhcY2-.js"),__vite__mapDeps([]))});ye({id:"handlebars",extensions:[".handlebars",".hbs"],aliases:["Handlebars","handlebars","hbs"],mimetypes:["text/x-handlebars-template"],loader:()=>be(()=>import("./handlebars-Cp-Otq7z.js"),__vite__mapDeps([5,1,2,3,4]))});ye({id:"hcl",extensions:[".tf",".tfvars",".hcl"],aliases:["Terraform","tf","HCL","hcl"],loader:()=>be(()=>import("./hcl-CTI7WNlW.js"),__vite__mapDeps([]))});ye({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:()=>be(()=>import("./html-9X_QuFNV.js"),__vite__mapDeps([6,1,2,3,4]))});ye({id:"ini",extensions:[".ini",".properties",".gitconfig"],filenames:["config",".gitattributes",".gitconfig",".editorconfig"],aliases:["Ini","ini"],loader:()=>be(()=>import("./ini-qJXHXiTY.js"),__vite__mapDeps([]))});ye({id:"java",extensions:[".java",".jav"],aliases:["Java","java"],mimetypes:["text/x-java-source","text/x-java"],loader:()=>be(()=>import("./java-Dnrl9822.js"),__vite__mapDeps([]))});ye({id:"javascript",extensions:[".js",".es6",".jsx",".mjs",".cjs"],firstLine:"^#!.*\\bnode",filenames:["jakefile"],aliases:["JavaScript","javascript","js"],mimetypes:["text/javascript"],loader:()=>be(()=>import("./javascript-BrlNfx48.js"),__vite__mapDeps([7,8,1,2,3,4]))});ye({id:"julia",extensions:[".jl"],aliases:["julia","Julia"],loader:()=>be(()=>import("./julia-pqMLycLG.js"),__vite__mapDeps([]))});ye({id:"kotlin",extensions:[".kt",".kts"],aliases:["Kotlin","kotlin"],mimetypes:["text/x-kotlin-source","text/x-kotlin"],loader:()=>be(()=>import("./kotlin-DLX697jv.js"),__vite__mapDeps([]))});ye({id:"less",extensions:[".less"],aliases:["Less","less"],mimetypes:["text/x-less","text/less"],loader:()=>be(()=>import("./less-2ExdFhZM.js"),__vite__mapDeps([]))});ye({id:"lexon",extensions:[".lex"],aliases:["Lexon"],loader:()=>be(()=>import("./lexon-ABKfEwhw.js"),__vite__mapDeps([]))});ye({id:"lua",extensions:[".lua"],aliases:["Lua","lua"],loader:()=>be(()=>import("./lua-CI0blgFs.js"),__vite__mapDeps([]))});ye({id:"liquid",extensions:[".liquid",".html.liquid"],aliases:["Liquid","liquid"],mimetypes:["application/liquid"],loader:()=>be(()=>import("./liquid-B5u8u5ff.js"),__vite__mapDeps([9,1,2,3,4]))});ye({id:"m3",extensions:[".m3",".i3",".mg",".ig"],aliases:["Modula-3","Modula3","modula3","m3"],loader:()=>be(()=>import("./m3-yVPEHiu4.js"),__vite__mapDeps([]))});ye({id:"markdown",extensions:[".md",".markdown",".mdown",".mkdn",".mkd",".mdwn",".mdtxt",".mdtext"],aliases:["Markdown","markdown"],loader:()=>be(()=>import("./markdown-CjOKAnMy.js"),__vite__mapDeps([]))});ye({id:"mdx",extensions:[".mdx"],aliases:["MDX","mdx"],loader:()=>be(()=>import("./mdx-BGfI80Xw.js"),__vite__mapDeps([10,1,2,3,4]))});ye({id:"mips",extensions:[".s"],aliases:["MIPS","MIPS-V"],mimetypes:["text/x-mips","text/mips","text/plaintext"],loader:()=>be(()=>import("./mips-B7KWClFm.js"),__vite__mapDeps([]))});ye({id:"msdax",extensions:[".dax",".msdax"],aliases:["DAX","MSDAX"],loader:()=>be(()=>import("./msdax-N_40gjXO.js"),__vite__mapDeps([]))});ye({id:"mysql",extensions:[],aliases:["MySQL","mysql"],loader:()=>be(()=>import("./mysql-CzgTwwi2.js"),__vite__mapDeps([]))});ye({id:"objective-c",extensions:[".m"],aliases:["Objective-C"],loader:()=>be(()=>import("./objective-c-CwAIQX-6.js"),__vite__mapDeps([]))});ye({id:"pascal",extensions:[".pas",".p",".pp"],aliases:["Pascal","pas"],mimetypes:["text/x-pascal-source","text/x-pascal"],loader:()=>be(()=>import("./pascal-3SrKWnFX.js"),__vite__mapDeps([]))});ye({id:"pascaligo",extensions:[".ligo"],aliases:["Pascaligo","ligo"],loader:()=>be(()=>import("./pascaligo-Cv9Y0fbC.js"),__vite__mapDeps([]))});ye({id:"perl",extensions:[".pl",".pm"],aliases:["Perl","pl"],loader:()=>be(()=>import("./perl-DHxnJL0_.js"),__vite__mapDeps([]))});ye({id:"pgsql",extensions:[],aliases:["PostgreSQL","postgres","pg","postgre"],loader:()=>be(()=>import("./pgsql-DGJFw0qd.js"),__vite__mapDeps([]))});ye({id:"php",extensions:[".php",".php4",".php5",".phtml",".ctp"],aliases:["PHP","php"],mimetypes:["application/x-php"],loader:()=>be(()=>import("./php-BA3Rqjpx.js"),__vite__mapDeps([]))});ye({id:"pla",extensions:[".pla"],loader:()=>be(()=>import("./pla-DKf5_u7N.js"),__vite__mapDeps([]))});ye({id:"postiats",extensions:[".dats",".sats",".hats"],aliases:["ATS","ATS/Postiats"],loader:()=>be(()=>import("./postiats-Bup1kUyj.js"),__vite__mapDeps([]))});ye({id:"powerquery",extensions:[".pq",".pqm"],aliases:["PQ","M","Power Query","Power Query M"],loader:()=>be(()=>import("./powerquery-BfbPeLER.js"),__vite__mapDeps([]))});ye({id:"powershell",extensions:[".ps1",".psm1",".psd1"],aliases:["PowerShell","powershell","ps","ps1"],loader:()=>be(()=>import("./powershell-DAsS7BG8.js"),__vite__mapDeps([]))});ye({id:"proto",extensions:[".proto"],aliases:["protobuf","Protocol Buffers"],loader:()=>be(()=>import("./protobuf-Dzs34GPr.js"),__vite__mapDeps([]))});ye({id:"pug",extensions:[".jade",".pug"],aliases:["Pug","Jade","jade"],loader:()=>be(()=>import("./pug-CVuUMJ1K.js"),__vite__mapDeps([]))});ye({id:"python",extensions:[".py",".rpy",".pyw",".cpy",".gyp",".gypi"],aliases:["Python","py"],firstLine:"^#!/.*\\bpython[0-9.-]*\\b",loader:()=>be(()=>import("./python-eaj7SXr6.js"),__vite__mapDeps([11,1,2,3,4]))});ye({id:"qsharp",extensions:[".qs"],aliases:["Q#","qsharp"],loader:()=>be(()=>import("./qsharp-BgY1GbL_.js"),__vite__mapDeps([]))});ye({id:"r",extensions:[".r",".rhistory",".rmd",".rprofile",".rt"],aliases:["R","r"],loader:()=>be(()=>import("./r-C2Iz-cGs.js"),__vite__mapDeps([]))});ye({id:"razor",extensions:[".cshtml"],aliases:["Razor","razor"],mimetypes:["text/x-cshtml"],loader:()=>be(()=>import("./razor-mSmpvSb7.js"),__vite__mapDeps([12,1,2,3,4]))});ye({id:"redis",extensions:[".redis"],aliases:["redis"],loader:()=>be(()=>import("./redis-F7UxdB6U.js"),__vite__mapDeps([]))});ye({id:"redshift",extensions:[],aliases:["Redshift","redshift"],loader:()=>be(()=>import("./redshift-CDF44XVS.js"),__vite__mapDeps([]))});ye({id:"restructuredtext",extensions:[".rst"],aliases:["reStructuredText","restructuredtext"],loader:()=>be(()=>import("./restructuredtext-C_dzeD_4.js"),__vite__mapDeps([]))});ye({id:"ruby",extensions:[".rb",".rbx",".rjs",".gemspec",".pp"],filenames:["rakefile","Gemfile"],aliases:["Ruby","rb"],loader:()=>be(()=>import("./ruby-BdxlVRg3.js"),__vite__mapDeps([]))});ye({id:"rust",extensions:[".rs",".rlib"],aliases:["Rust","rust"],loader:()=>be(()=>import("./rust-gU8692nP.js"),__vite__mapDeps([]))});ye({id:"sb",extensions:[".sb"],aliases:["Small Basic","sb"],loader:()=>be(()=>import("./sb-CsAkPjmq.js"),__vite__mapDeps([]))});ye({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:()=>be(()=>import("./scala-D_TH4Qyk.js"),__vite__mapDeps([]))});ye({id:"scheme",extensions:[".scm",".ss",".sch",".rkt"],aliases:["scheme","Scheme"],loader:()=>be(()=>import("./scheme-CTXRt_ZJ.js"),__vite__mapDeps([]))});ye({id:"scss",extensions:[".scss"],aliases:["Sass","sass","scss"],mimetypes:["text/x-scss","text/scss"],loader:()=>be(()=>import("./scss-Rf_ppwBg.js"),__vite__mapDeps([]))});ye({id:"shell",extensions:[".sh",".bash"],aliases:["Shell","sh"],loader:()=>be(()=>import("./shell-osqRiq1b.js"),__vite__mapDeps([]))});ye({id:"sol",extensions:[".sol"],aliases:["sol","solidity","Solidity"],loader:()=>be(()=>import("./solidity-BTHmi1CB.js"),__vite__mapDeps([]))});ye({id:"aes",extensions:[".aes"],aliases:["aes","sophia","Sophia"],loader:()=>be(()=>import("./sophia-BRe4RArb.js"),__vite__mapDeps([]))});ye({id:"sparql",extensions:[".rq"],aliases:["sparql","SPARQL"],loader:()=>be(()=>import("./sparql-CaSv-uNl.js"),__vite__mapDeps([]))});ye({id:"sql",extensions:[".sql"],aliases:["SQL"],loader:()=>be(()=>import("./sql-CHiRcria.js"),__vite__mapDeps([]))});ye({id:"st",extensions:[".st",".iecst",".iecplc",".lc3lib",".TcPOU",".TcDUT",".TcGVL",".TcIO"],aliases:["StructuredText","scl","stl"],loader:()=>be(()=>import("./st-CCGZ7KTi.js"),__vite__mapDeps([]))});ye({id:"swift",aliases:["Swift","swift"],extensions:[".swift"],mimetypes:["text/swift"],loader:()=>be(()=>import("./swift-DeyDsJzf.js"),__vite__mapDeps([]))});ye({id:"systemverilog",extensions:[".sv",".svh"],aliases:["SV","sv","SystemVerilog","systemverilog"],loader:()=>be(()=>import("./systemverilog-RSGMMa-l.js"),__vite__mapDeps([]))});ye({id:"verilog",extensions:[".v",".vh"],aliases:["V","v","Verilog","verilog"],loader:()=>be(()=>import("./systemverilog-RSGMMa-l.js"),__vite__mapDeps([]))});ye({id:"tcl",extensions:[".tcl"],aliases:["tcl","Tcl","tcltk","TclTk","tcl/tk","Tcl/Tk"],loader:()=>be(()=>import("./tcl-B28K5YOH.js"),__vite__mapDeps([]))});ye({id:"twig",extensions:[".twig"],aliases:["Twig","twig"],mimetypes:["text/x-twig"],loader:()=>be(()=>import("./twig-ChoE7Tfw.js"),__vite__mapDeps([]))});ye({id:"typescript",extensions:[".ts",".tsx",".cts",".mts"],aliases:["TypeScript","ts","typescript"],mimetypes:["text/typescript"],loader:()=>be(()=>import("./typescript-DHPJO5zk.js"),__vite__mapDeps([8,1,2,3,4]))});ye({id:"vb",extensions:[".vb"],aliases:["Visual Basic","vb"],loader:()=>be(()=>import("./vb-BCnlgLOU.js"),__vite__mapDeps([]))});ye({id:"wgsl",extensions:[".wgsl"],aliases:["WebGPU Shading Language","WGSL","wgsl"],loader:()=>be(()=>import("./wgsl-DlxrJ_uh.js"),__vite__mapDeps([]))});ye({id:"xml",extensions:[".xml",".xsd",".dtd",".ascx",".csproj",".config",".props",".targets",".wxi",".wxl",".wxs",".xaml",".svg",".svgz",".opf",".xslt",".xsl"],firstLine:"(\\<\\?xml.*)|(\\<svg)|(\\<\\!doctype\\s+svg)",aliases:["XML","xml"],mimetypes:["text/xml","application/xml","application/xaml+xml","application/xml-dtd"],loader:()=>be(()=>import("./xml-BzVPTsY-.js"),__vite__mapDeps([13,1,2,3,4]))});ye({id:"yaml",extensions:[".yaml",".yml"],aliases:["YAML","yaml","YML","yml"],mimetypes:["application/x-yaml","text/x-yaml"],loader:()=>be(()=>import("./yaml-BQjIkRBM.js"),__vite__mapDeps([14,1,2,3,4]))});/*!-----------------------------------------------------------------------------
648
648
  * Copyright (c) Microsoft Corporation. All rights reserved.
649
649
  * Version: 0.44.0(3e047efd345ff102c8c61b5398fb30845aaac166)
650
650
  * Released under the MIT license
651
651
  * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
652
- *-----------------------------------------------------------------------------*/var ace=Object.defineProperty,lce=Object.getOwnPropertyDescriptor,dce=Object.getOwnPropertyNames,cce=Object.prototype.hasOwnProperty,$F=(o,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of dce(e))!cce.call(o,n)&&n!==t&&ace(o,n,{get:()=>e[n],enumerable:!(i=lce(e,n))||i.enumerable});return o},hce=(o,e,t)=>($F(o,e,"default"),t&&$F(t,e,"default")),jp={};hce(jp,q0);var wM=class{_onDidChange=new jp.Emitter;_options;_modeConfiguration;_languageId;constructor(e,t,i){this._languageId=e,this.setOptions(t),this.setModeConfiguration(i)}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(e){this._options=e||Object.create(null),this._onDidChange.fire(this)}setDiagnosticsOptions(e){this.setOptions(e)}setModeConfiguration(e){this._modeConfiguration=e||Object.create(null),this._onDidChange.fire(this)}},SM={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}},yM={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},B6=new wM("css",SM,yM),W6=new wM("scss",SM,yM),V6=new wM("less",SM,yM);jp.languages.css={cssDefaults:B6,lessDefaults:V6,scssDefaults:W6};function LM(){return be(()=>import("./cssMode-PbVgDCx5.js"),__vite__mapDeps([15,1,2,3,4]))}jp.languages.onLanguage("less",()=>{LM().then(o=>o.setupMode(V6))});jp.languages.onLanguage("scss",()=>{LM().then(o=>o.setupMode(W6))});jp.languages.onLanguage("css",()=>{LM().then(o=>o.setupMode(B6))});/*!-----------------------------------------------------------------------------
652
+ *-----------------------------------------------------------------------------*/var ace=Object.defineProperty,lce=Object.getOwnPropertyDescriptor,dce=Object.getOwnPropertyNames,cce=Object.prototype.hasOwnProperty,$F=(o,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of dce(e))!cce.call(o,n)&&n!==t&&ace(o,n,{get:()=>e[n],enumerable:!(i=lce(e,n))||i.enumerable});return o},hce=(o,e,t)=>($F(o,e,"default"),t&&$F(t,e,"default")),jp={};hce(jp,q0);var wM=class{_onDidChange=new jp.Emitter;_options;_modeConfiguration;_languageId;constructor(e,t,i){this._languageId=e,this.setOptions(t),this.setModeConfiguration(i)}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(e){this._options=e||Object.create(null),this._onDidChange.fire(this)}setDiagnosticsOptions(e){this.setOptions(e)}setModeConfiguration(e){this._modeConfiguration=e||Object.create(null),this._onDidChange.fire(this)}},SM={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}},yM={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},B6=new wM("css",SM,yM),W6=new wM("scss",SM,yM),V6=new wM("less",SM,yM);jp.languages.css={cssDefaults:B6,lessDefaults:V6,scssDefaults:W6};function LM(){return be(()=>import("./cssMode-EIMeoZ0D.js"),__vite__mapDeps([15,1,2,3,4]))}jp.languages.onLanguage("less",()=>{LM().then(o=>o.setupMode(V6))});jp.languages.onLanguage("scss",()=>{LM().then(o=>o.setupMode(W6))});jp.languages.onLanguage("css",()=>{LM().then(o=>o.setupMode(B6))});/*!-----------------------------------------------------------------------------
653
653
  * Copyright (c) Microsoft Corporation. All rights reserved.
654
654
  * Version: 0.44.0(3e047efd345ff102c8c61b5398fb30845aaac166)
655
655
  * Released under the MIT license
656
656
  * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
657
- *-----------------------------------------------------------------------------*/var uce=Object.defineProperty,fce=Object.getOwnPropertyDescriptor,gce=Object.getOwnPropertyNames,pce=Object.prototype.hasOwnProperty,jF=(o,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of gce(e))!pce.call(o,n)&&n!==t&&uce(o,n,{get:()=>e[n],enumerable:!(i=fce(e,n))||i.enumerable});return o},mce=(o,e,t)=>(jF(o,e,"default"),t&&jF(t,e,"default")),Oy={};mce(Oy,q0);var _ce=class{_onDidChange=new Oy.Emitter;_options;_modeConfiguration;_languageId;constructor(e,t,i){this._languageId=e,this.setOptions(t),this.setModeConfiguration(i)}get onDidChange(){return this._onDidChange.event}get languageId(){return this._languageId}get options(){return this._options}get modeConfiguration(){return this._modeConfiguration}setOptions(e){this._options=e||Object.create(null),this._onDidChange.fire(this)}setModeConfiguration(e){this._modeConfiguration=e||Object.create(null),this._onDidChange.fire(this)}},vce={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"},Fy={format:vce,suggest:{},data:{useDefaultDataProvider:!0}};function By(o){return{completionItems:!0,hovers:!0,documentSymbols:!0,links:!0,documentHighlights:!0,rename:!0,colors:!0,foldingRanges:!0,selectionRanges:!0,diagnostics:o===D_,documentFormattingEdits:o===D_,documentRangeFormattingEdits:o===D_}}var D_="html",KF="handlebars",qF="razor",H6=Wy(D_,Fy,By(D_)),bce=H6.defaults,z6=Wy(KF,Fy,By(KF)),Cce=z6.defaults,U6=Wy(qF,Fy,By(qF)),wce=U6.defaults;Oy.languages.html={htmlDefaults:bce,razorDefaults:wce,handlebarDefaults:Cce,htmlLanguageService:H6,handlebarLanguageService:z6,razorLanguageService:U6,registerHTMLLanguageService:Wy};function Sce(){return be(()=>import("./htmlMode-xt8whNAd.js"),__vite__mapDeps([16,1,2,3,4]))}function Wy(o,e=Fy,t=By(o)){const i=new _ce(o,e,t);let n;const s=Oy.languages.onLanguage(o,async()=>{n=(await Sce()).setupMode(i)});return{defaults:i,dispose(){s.dispose(),n?.dispose(),n=void 0}}}/*!-----------------------------------------------------------------------------
657
+ *-----------------------------------------------------------------------------*/var uce=Object.defineProperty,fce=Object.getOwnPropertyDescriptor,gce=Object.getOwnPropertyNames,pce=Object.prototype.hasOwnProperty,jF=(o,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of gce(e))!pce.call(o,n)&&n!==t&&uce(o,n,{get:()=>e[n],enumerable:!(i=fce(e,n))||i.enumerable});return o},mce=(o,e,t)=>(jF(o,e,"default"),t&&jF(t,e,"default")),Oy={};mce(Oy,q0);var _ce=class{_onDidChange=new Oy.Emitter;_options;_modeConfiguration;_languageId;constructor(e,t,i){this._languageId=e,this.setOptions(t),this.setModeConfiguration(i)}get onDidChange(){return this._onDidChange.event}get languageId(){return this._languageId}get options(){return this._options}get modeConfiguration(){return this._modeConfiguration}setOptions(e){this._options=e||Object.create(null),this._onDidChange.fire(this)}setModeConfiguration(e){this._modeConfiguration=e||Object.create(null),this._onDidChange.fire(this)}},vce={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"},Fy={format:vce,suggest:{},data:{useDefaultDataProvider:!0}};function By(o){return{completionItems:!0,hovers:!0,documentSymbols:!0,links:!0,documentHighlights:!0,rename:!0,colors:!0,foldingRanges:!0,selectionRanges:!0,diagnostics:o===D_,documentFormattingEdits:o===D_,documentRangeFormattingEdits:o===D_}}var D_="html",KF="handlebars",qF="razor",H6=Wy(D_,Fy,By(D_)),bce=H6.defaults,z6=Wy(KF,Fy,By(KF)),Cce=z6.defaults,U6=Wy(qF,Fy,By(qF)),wce=U6.defaults;Oy.languages.html={htmlDefaults:bce,razorDefaults:wce,handlebarDefaults:Cce,htmlLanguageService:H6,handlebarLanguageService:z6,razorLanguageService:U6,registerHTMLLanguageService:Wy};function Sce(){return be(()=>import("./htmlMode-BVz_CiVZ.js"),__vite__mapDeps([16,1,2,3,4]))}function Wy(o,e=Fy,t=By(o)){const i=new _ce(o,e,t);let n;const s=Oy.languages.onLanguage(o,async()=>{n=(await Sce()).setupMode(i)});return{defaults:i,dispose(){s.dispose(),n?.dispose(),n=void 0}}}/*!-----------------------------------------------------------------------------
658
658
  * Copyright (c) Microsoft Corporation. All rights reserved.
659
659
  * Version: 0.44.0(3e047efd345ff102c8c61b5398fb30845aaac166)
660
660
  * Released under the MIT license
661
661
  * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
662
- *-----------------------------------------------------------------------------*/var yce=Object.defineProperty,Lce=Object.getOwnPropertyDescriptor,xce=Object.getOwnPropertyNames,Dce=Object.prototype.hasOwnProperty,GF=(o,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of xce(e))!Dce.call(o,n)&&n!==t&&yce(o,n,{get:()=>e[n],enumerable:!(i=Lce(e,n))||i.enumerable});return o},kce=(o,e,t)=>(GF(o,e,"default"),t&&GF(t,e,"default")),G0={};kce(G0,q0);var Ice=class{_onDidChange=new G0.Emitter;_diagnosticsOptions;_modeConfiguration;_languageId;constructor(e,t,i){this._languageId=e,this.setDiagnosticsOptions(t),this.setModeConfiguration(i)}get onDidChange(){return this._onDidChange.event}get languageId(){return this._languageId}get modeConfiguration(){return this._modeConfiguration}get diagnosticsOptions(){return this._diagnosticsOptions}setDiagnosticsOptions(e){this._diagnosticsOptions=e||Object.create(null),this._onDidChange.fire(this)}setModeConfiguration(e){this._modeConfiguration=e||Object.create(null),this._onDidChange.fire(this)}},Ece={validate:!0,allowComments:!0,schemas:[],enableSchemaRequest:!1,schemaRequest:"warning",schemaValidation:"warning",comments:"error",trailingCommas:"error"},Nce={documentFormattingEdits:!0,documentRangeFormattingEdits:!0,completionItems:!0,hovers:!0,documentSymbols:!0,tokens:!0,colors:!0,foldingRanges:!0,diagnostics:!0,selectionRanges:!0},$6=new Ice("json",Ece,Nce);G0.languages.json={jsonDefaults:$6};function Tce(){return be(()=>import("./jsonMode-mWIcOV2K.js"),__vite__mapDeps([17,1,2,3,4]))}G0.languages.register({id:"json",extensions:[".json",".bowerrc",".jshintrc",".jscsrc",".eslintrc",".babelrc",".har"],aliases:["JSON","json"],mimetypes:["application/json"]});G0.languages.onLanguage("json",()=>{Tce().then(o=>o.setupMode($6))});/*!-----------------------------------------------------------------------------
662
+ *-----------------------------------------------------------------------------*/var yce=Object.defineProperty,Lce=Object.getOwnPropertyDescriptor,xce=Object.getOwnPropertyNames,Dce=Object.prototype.hasOwnProperty,GF=(o,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of xce(e))!Dce.call(o,n)&&n!==t&&yce(o,n,{get:()=>e[n],enumerable:!(i=Lce(e,n))||i.enumerable});return o},kce=(o,e,t)=>(GF(o,e,"default"),t&&GF(t,e,"default")),G0={};kce(G0,q0);var Ice=class{_onDidChange=new G0.Emitter;_diagnosticsOptions;_modeConfiguration;_languageId;constructor(e,t,i){this._languageId=e,this.setDiagnosticsOptions(t),this.setModeConfiguration(i)}get onDidChange(){return this._onDidChange.event}get languageId(){return this._languageId}get modeConfiguration(){return this._modeConfiguration}get diagnosticsOptions(){return this._diagnosticsOptions}setDiagnosticsOptions(e){this._diagnosticsOptions=e||Object.create(null),this._onDidChange.fire(this)}setModeConfiguration(e){this._modeConfiguration=e||Object.create(null),this._onDidChange.fire(this)}},Ece={validate:!0,allowComments:!0,schemas:[],enableSchemaRequest:!1,schemaRequest:"warning",schemaValidation:"warning",comments:"error",trailingCommas:"error"},Nce={documentFormattingEdits:!0,documentRangeFormattingEdits:!0,completionItems:!0,hovers:!0,documentSymbols:!0,tokens:!0,colors:!0,foldingRanges:!0,diagnostics:!0,selectionRanges:!0},$6=new Ice("json",Ece,Nce);G0.languages.json={jsonDefaults:$6};function Tce(){return be(()=>import("./jsonMode-CAwYRRV9.js"),__vite__mapDeps([17,1,2,3,4]))}G0.languages.register({id:"json",extensions:[".json",".bowerrc",".jshintrc",".jscsrc",".eslintrc",".babelrc",".har"],aliases:["JSON","json"],mimetypes:["application/json"]});G0.languages.onLanguage("json",()=>{Tce().then(o=>o.setupMode($6))});/*!-----------------------------------------------------------------------------
663
663
  * Copyright (c) Microsoft Corporation. All rights reserved.
664
664
  * Version: 0.44.0(3e047efd345ff102c8c61b5398fb30845aaac166)
665
665
  * Released under the MIT license
666
666
  * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
667
- *-----------------------------------------------------------------------------*/var Rce=Object.defineProperty,Mce=Object.getOwnPropertyDescriptor,Ace=Object.getOwnPropertyNames,Pce=Object.prototype.hasOwnProperty,ZF=(o,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Ace(e))!Pce.call(o,n)&&n!==t&&Rce(o,n,{get:()=>e[n],enumerable:!(i=Mce(e,n))||i.enumerable});return o},Oce=(o,e,t)=>(ZF(o,e,"default"),t&&ZF(t,e,"default")),Fce="5.0.2",_p={};Oce(_p,q0);var j6=(o=>(o[o.None=0]="None",o[o.CommonJS=1]="CommonJS",o[o.AMD=2]="AMD",o[o.UMD=3]="UMD",o[o.System=4]="System",o[o.ES2015=5]="ES2015",o[o.ESNext=99]="ESNext",o))(j6||{}),K6=(o=>(o[o.None=0]="None",o[o.Preserve=1]="Preserve",o[o.React=2]="React",o[o.ReactNative=3]="ReactNative",o[o.ReactJSX=4]="ReactJSX",o[o.ReactJSXDev=5]="ReactJSXDev",o))(K6||{}),q6=(o=>(o[o.CarriageReturnLineFeed=0]="CarriageReturnLineFeed",o[o.LineFeed=1]="LineFeed",o))(q6||{}),G6=(o=>(o[o.ES3=0]="ES3",o[o.ES5=1]="ES5",o[o.ES2015=2]="ES2015",o[o.ES2016=3]="ES2016",o[o.ES2017=4]="ES2017",o[o.ES2018=5]="ES2018",o[o.ES2019=6]="ES2019",o[o.ES2020=7]="ES2020",o[o.ESNext=99]="ESNext",o[o.JSON=100]="JSON",o[o.Latest=99]="Latest",o))(G6||{}),Z6=(o=>(o[o.Classic=1]="Classic",o[o.NodeJs=2]="NodeJs",o))(Z6||{}),Y6=class{_onDidChange=new _p.Emitter;_onDidExtraLibsChange=new _p.Emitter;_extraLibs;_removedExtraLibs;_eagerModelSync;_compilerOptions;_diagnosticsOptions;_workerOptions;_onDidExtraLibsChangeTimeout;_inlayHintsOptions;_modeConfiguration;constructor(o,e,t,i,n){this._extraLibs=Object.create(null),this._removedExtraLibs=Object.create(null),this._eagerModelSync=!1,this.setCompilerOptions(o),this.setDiagnosticsOptions(e),this.setWorkerOptions(t),this.setInlayHintsOptions(i),this.setModeConfiguration(n),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(o,e){let t;if(typeof e>"u"?t=`ts:extralib-${Math.random().toString(36).substring(2,15)}`:t=e,this._extraLibs[t]&&this._extraLibs[t].content===o)return{dispose:()=>{}};let i=1;return this._removedExtraLibs[t]&&(i=this._removedExtraLibs[t]+1),this._extraLibs[t]&&(i=this._extraLibs[t].version+1),this._extraLibs[t]={content:o,version:i},this._fireOnDidExtraLibsChangeSoon(),{dispose:()=>{let n=this._extraLibs[t];n&&n.version===i&&(delete this._extraLibs[t],this._removedExtraLibs[t]=i,this._fireOnDidExtraLibsChangeSoon())}}}setExtraLibs(o){for(const e in this._extraLibs)this._removedExtraLibs[e]=this._extraLibs[e].version;if(this._extraLibs=Object.create(null),o&&o.length>0)for(const e of o){const t=e.filePath||`ts:extralib-${Math.random().toString(36).substring(2,15)}`,i=e.content;let n=1;this._removedExtraLibs[t]&&(n=this._removedExtraLibs[t]+1),this._extraLibs[t]={content:i,version:n}}this._fireOnDidExtraLibsChangeSoon()}_fireOnDidExtraLibsChangeSoon(){this._onDidExtraLibsChangeTimeout===-1&&(this._onDidExtraLibsChangeTimeout=window.setTimeout(()=>{this._onDidExtraLibsChangeTimeout=-1,this._onDidExtraLibsChange.fire(void 0)},0))}getCompilerOptions(){return this._compilerOptions}setCompilerOptions(o){this._compilerOptions=o||Object.create(null),this._onDidChange.fire(void 0)}getDiagnosticsOptions(){return this._diagnosticsOptions}setDiagnosticsOptions(o){this._diagnosticsOptions=o||Object.create(null),this._onDidChange.fire(void 0)}setWorkerOptions(o){this._workerOptions=o||Object.create(null),this._onDidChange.fire(void 0)}setInlayHintsOptions(o){this._inlayHintsOptions=o||Object.create(null),this._onDidChange.fire(void 0)}setMaximumWorkerIdleTime(o){}setEagerModelSync(o){this._eagerModelSync=o}getEagerModelSync(){return this._eagerModelSync}setModeConfiguration(o){this._modeConfiguration=o||Object.create(null),this._onDidChange.fire(void 0)}},Bce=Fce,X6={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},Q6=new Y6({allowNonTsExtensions:!0,target:99},{noSemanticValidation:!1,noSyntaxValidation:!1,onlyVisible:!1},{},{},X6),J6=new Y6({allowNonTsExtensions:!0,allowJs:!0,target:99},{noSemanticValidation:!0,noSyntaxValidation:!1,onlyVisible:!1},{},{},X6),Wce=()=>Vy().then(o=>o.getTypeScriptWorker()),Vce=()=>Vy().then(o=>o.getJavaScriptWorker());_p.languages.typescript={ModuleKind:j6,JsxEmit:K6,NewLineKind:q6,ScriptTarget:G6,ModuleResolutionKind:Z6,typescriptVersion:Bce,typescriptDefaults:Q6,javascriptDefaults:J6,getTypeScriptWorker:Wce,getJavaScriptWorker:Vce};function Vy(){return be(()=>import("./tsMode-DWjmFJDZ.js"),__vite__mapDeps([18,1,2,3,4]))}_p.languages.onLanguage("typescript",()=>Vy().then(o=>o.setupTypeScript(Q6)));_p.languages.onLanguage("javascript",()=>Vy().then(o=>o.setupJavaScript(J6)));class Hce extends fo{constructor(){super({id:"diffEditor.toggleCollapseUnchangedRegions",title:{value:g("toggleCollapseUnchangedRegions","Toggle Collapse Unchanged Regions"),original:"Toggle Collapse Unchanged Regions"},icon:oe.map,toggled:Z.has("config.diffEditor.hideUnchangedRegions.enabled"),precondition:Z.has("isInDiffEditor"),menu:{when:Z.has("isInDiffEditor"),id:k.EditorTitle,order:22,group:"navigation"}})}run(e,...t){const i=e.get(st),n=!i.getValue("diffEditor.hideUnchangedRegions.enabled");i.updateValue("diffEditor.hideUnchangedRegions.enabled",n)}}jt(Hce);class eW extends fo{constructor(){super({id:"diffEditor.toggleShowMovedCodeBlocks",title:{value:g("toggleShowMovedCodeBlocks","Toggle Show Moved Code Blocks"),original:"Toggle Show Moved Code Blocks"},precondition:Z.has("isInDiffEditor")})}run(e,...t){const i=e.get(st),n=!i.getValue("diffEditor.experimental.showMoves");i.updateValue("diffEditor.experimental.showMoves",n)}}jt(eW);class tW extends fo{constructor(){super({id:"diffEditor.toggleUseInlineViewWhenSpaceIsLimited",title:{value:g("toggleUseInlineViewWhenSpaceIsLimited","Toggle Use Inline View When Space Is Limited"),original:"Toggle Use Inline View When Space Is Limited"},precondition:Z.has("isInDiffEditor")})}run(e,...t){const i=e.get(st),n=!i.getValue("diffEditor.useInlineViewWhenSpaceIsLimited");i.updateValue("diffEditor.useInlineViewWhenSpaceIsLimited",n)}}jt(tW);hn.appendMenuItem(k.EditorTitle,{command:{id:new tW().desc.id,title:g("useInlineViewWhenSpaceIsLimited","Use Inline View When Space Is Limited"),toggled:Z.has("config.diffEditor.useInlineViewWhenSpaceIsLimited"),precondition:Z.has("isInDiffEditor")},order:11,group:"1_diff",when:Z.and(E.diffEditorRenderSideBySideInlineBreakpointReached,Z.has("isInDiffEditor"))});hn.appendMenuItem(k.EditorTitle,{command:{id:new eW().desc.id,title:g("showMoves","Show Moved Code Blocks"),icon:oe.move,toggled:Ap.create("config.diffEditor.experimental.showMoves",!0),precondition:Z.has("isInDiffEditor")},order:10,group:"1_diff",when:Z.has("isInDiffEditor")});const Hy={value:g("diffEditor","Diff Editor"),original:"Diff Editor"};class zce extends ra{constructor(){super({id:"diffEditor.switchSide",title:{value:g("switchSide","Switch Side"),original:"Switch Side"},icon:oe.arrowSwap,precondition:Z.has("isInDiffEditor"),f1:!0,category:Hy})}runEditorCommand(e,t,i){const n=qp(e);if(n instanceof Lu){if(i&&i.dryRun)return{destinationSelection:n.mapToOtherSide().destinationSelection};n.switchSide()}}}jt(zce);class Uce extends ra{constructor(){super({id:"diffEditor.exitCompareMove",title:{value:g("exitCompareMove","Exit Compare Move"),original:"Exit Compare Move"},icon:oe.close,precondition:E.comparingMovedCode,f1:!1,category:Hy,keybinding:{weight:1e4,primary:9}})}runEditorCommand(e,t,...i){const n=qp(e);n instanceof Lu&&n.exitCompareMove()}}jt(Uce);class $ce extends ra{constructor(){super({id:"diffEditor.collapseAllUnchangedRegions",title:{value:g("collapseAllUnchangedRegions","Collapse All Unchanged Regions"),original:"Collapse All Unchanged Regions"},icon:oe.fold,precondition:Z.has("isInDiffEditor"),f1:!0,category:Hy})}runEditorCommand(e,t,...i){const n=qp(e);n instanceof Lu&&n.collapseAllUnchangedRegions()}}jt($ce);class jce extends ra{constructor(){super({id:"diffEditor.showAllUnchangedRegions",title:{value:g("showAllUnchangedRegions","Show All Unchanged Regions"),original:"Show All Unchanged Regions"},icon:oe.unfold,precondition:Z.has("isInDiffEditor"),f1:!0,category:Hy})}runEditorCommand(e,t,...i){const n=qp(e);n instanceof Lu&&n.showAllUnchangedRegions()}}jt(jce);const iW={value:g("accessibleDiffViewer","Accessible Diff Viewer"),original:"Accessible Diff Viewer"};class Kp extends fo{constructor(){super({id:Kp.id,title:{value:g("editor.action.accessibleDiffViewer.next","Go to Next Difference"),original:"Go to Next Difference"},category:iW,precondition:Z.has("isInDiffEditor"),keybinding:{primary:65,weight:100},f1:!0})}run(e){const t=qp(e);t?.accessibleDiffViewerNext()}}Kp.id="editor.action.accessibleDiffViewer.next";hn.appendMenuItem(k.EditorTitle,{command:{id:Kp.id,title:g("Open Accessible Diff Viewer","Open Accessible Diff Viewer"),precondition:Z.has("isInDiffEditor")},order:10,group:"2_diff",when:Z.and(E.accessibleDiffViewerVisible.negate(),Z.has("isInDiffEditor"))});class Z0 extends fo{constructor(){super({id:Z0.id,title:{value:g("editor.action.accessibleDiffViewer.prev","Go to Previous Difference"),original:"Go to Previous Difference"},category:iW,precondition:Z.has("isInDiffEditor"),keybinding:{primary:1089,weight:100},f1:!0})}run(e){const t=qp(e);t?.accessibleDiffViewerPrev()}}Z0.id="editor.action.accessibleDiffViewer.prev";function qp(o){var e;const t=o.get(_t),i=t.listDiffEditors(),n=(e=t.getFocusedCodeEditor())!==null&&e!==void 0?e:t.getActiveCodeEditor();if(!n)return null;for(let r=0,a=i.length;r<a;r++){const l=i[r];if(l.getModifiedEditor().getId()===n.getId()||l.getOriginalEditor().getId()===n.getId())return l}const s=rr();if(s)for(const r of i){const a=r.getContainerDomNode();if(Kce(a,s))return r}return null}function Kce(o,e){let t=e;for(;t;){if(t===o)return!0;t=t.parentElement}return!1}lt.registerCommandAlias("editor.action.diffReview.next",Kp.id);jt(Kp);lt.registerCommandAlias("editor.action.diffReview.prev",Z0.id);jt(Z0);var qce=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Gce=function(o,e){return function(t,i){e(t,i,o)}},zy=function(o,e,t,i){function n(s){return s instanceof t?s:new t(function(r){r(s)})}return new(t||(t=Promise))(function(s,r){function a(c){try{d(i.next(c))}catch(h){r(h)}}function l(c){try{d(i.throw(c))}catch(h){r(h)}}function d(c){c.done?s(c.value):n(c.value).then(a,l)}d((i=i.apply(o,e||[])).next())})},fN;const Uy=new ce("selectionAnchorSet",!1);let ld=fN=class{static get(e){return e.getContribution(fN.ID)}constructor(e,t){this.editor=e,this.selectionAnchorSetContextKey=Uy.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(ve.fromPositions(e,e),{description:"selection-anchor",stickiness:1,hoverMessage:new xn().appendText(g("selectionAnchor","Selection Anchor")),className:"selection-anchor"})}),this.selectionAnchorSetContextKey.set(!!this.decorationId),On(g("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(ve.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()}};ld.ID="editor.contrib.selectionAnchorController";ld=fN=qce([Gce(1,Ae)],ld);class Zce extends fe{constructor(){super({id:"editor.action.setSelectionAnchor",label:g("setSelectionAnchor","Set Selection Anchor"),alias:"Set Selection Anchor",precondition:void 0,kbOpts:{kbExpr:E.editorTextFocus,primary:Pi(2089,2080),weight:100}})}run(e,t){var i;return zy(this,void 0,void 0,function*(){(i=ld.get(t))===null||i===void 0||i.setSelectionAnchor()})}}class Yce extends fe{constructor(){super({id:"editor.action.goToSelectionAnchor",label:g("goToSelectionAnchor","Go to Selection Anchor"),alias:"Go to Selection Anchor",precondition:Uy})}run(e,t){var i;return zy(this,void 0,void 0,function*(){(i=ld.get(t))===null||i===void 0||i.goToSelectionAnchor()})}}class Xce extends fe{constructor(){super({id:"editor.action.selectFromAnchorToCursor",label:g("selectFromAnchorToCursor","Select from Anchor to Cursor"),alias:"Select from Anchor to Cursor",precondition:Uy,kbOpts:{kbExpr:E.editorTextFocus,primary:Pi(2089,2089),weight:100}})}run(e,t){var i;return zy(this,void 0,void 0,function*(){(i=ld.get(t))===null||i===void 0||i.selectFromAnchorToCursor()})}}class Qce extends fe{constructor(){super({id:"editor.action.cancelSelectionAnchor",label:g("cancelSelectionAnchor","Cancel Selection Anchor"),alias:"Cancel Selection Anchor",precondition:Uy,kbOpts:{kbExpr:E.editorTextFocus,primary:9,weight:100}})}run(e,t){var i;return zy(this,void 0,void 0,function*(){(i=ld.get(t))===null||i===void 0||i.cancelSelectionAnchor()})}}ft(ld.ID,ld,4);ne(Zce);ne(Yce);ne(Xce);ne(Qce);const Jce=T("editorOverviewRuler.bracketMatchForeground",{dark:"#A0A0A0",light:"#A0A0A0",hcDark:"#A0A0A0",hcLight:"#A0A0A0"},g("overviewRulerBracketMatchForeground","Overview ruler marker color for matching brackets."));class ehe extends fe{constructor(){super({id:"editor.action.jumpToBracket",label:g("smartSelect.jumpBracket","Go to Bracket"),alias:"Go to Bracket",precondition:void 0,kbOpts:{kbExpr:E.editorTextFocus,primary:3165,weight:100}})}run(e,t){var i;(i=ar.get(t))===null||i===void 0||i.jumpToBracket()}}class the extends fe{constructor(){super({id:"editor.action.selectToBracket",label:g("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,i){var n;let s=!0;i&&i.selectBrackets===!1&&(s=!1),(n=ar.get(t))===null||n===void 0||n.selectToBracket(s)}}class ihe extends fe{constructor(){super({id:"editor.action.removeBrackets",label:g("smartSelect.removeBrackets","Remove Brackets"),alias:"Remove Brackets",precondition:void 0,kbOpts:{kbExpr:E.editorTextFocus,primary:2561,weight:100}})}run(e,t){var i;(i=ar.get(t))===null||i===void 0||i.removeBrackets(this.id)}}class nhe{constructor(e,t,i){this.position=e,this.brackets=t,this.options=i}}class ar extends H{static get(e){return e.getContribution(ar.ID)}constructor(e){super(),this._editor=e,this._lastBracketsData=[],this._lastVersionId=0,this._decorations=this._editor.createDecorationsCollection(),this._updateBracketsSoon=this._register(new Dt(()=>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(i=>{const n=i.getStartPosition(),s=e.bracketPairs.matchBracket(n);let r=null;if(s)s[0].containsPosition(n)&&!s[1].containsPosition(n)?r=s[1].getStartPosition():s[1].containsPosition(n)&&(r=s[0].getStartPosition());else{const a=e.bracketPairs.findEnclosingBrackets(n);if(a)r=a[1].getStartPosition();else{const l=e.bracketPairs.findNextBracket(n);l&&l.range&&(r=l.range.getStartPosition())}}return r?new ve(r.lineNumber,r.column,r.lineNumber,r.column):new ve(n.lineNumber,n.column,n.lineNumber,n.column)});this._editor.setSelections(t),this._editor.revealRange(t[0])}selectToBracket(e){if(!this._editor.hasModel())return;const t=this._editor.getModel(),i=[];this._editor.getSelections().forEach(n=>{const s=n.getStartPosition();let r=t.bracketPairs.matchBracket(s);if(!r&&(r=t.bracketPairs.findEnclosingBrackets(s),!r)){const d=t.bracketPairs.findNextBracket(s);d&&d.range&&(r=t.bracketPairs.matchBracket(d.range.getStartPosition()))}let a=null,l=null;if(r){r.sort(L.compareRangesUsingStarts);const[d,c]=r;if(a=e?d.getStartPosition():d.getEndPosition(),l=e?c.getEndPosition():c.getStartPosition(),c.containsPosition(s)){const h=a;a=l,l=h}}a&&l&&i.push(new ve(a.lineNumber,a.column,l.lineNumber,l.column))}),i.length>0&&(this._editor.setSelections(i),this._editor.revealRange(i[0]))}removeBrackets(e){if(!this._editor.hasModel())return;const t=this._editor.getModel();this._editor.getSelections().forEach(i=>{const n=i.getPosition();let s=t.bracketPairs.matchBracket(n);s||(s=t.bracketPairs.findEnclosingBrackets(n)),s&&(this._editor.pushUndoStop(),this._editor.executeEdits(e,[{range:s[0],text:""},{range:s[1],text:""}]),this._editor.pushUndoStop())})}_updateBrackets(){if(this._matchBrackets==="never")return;this._recomputeBrackets();const e=[];let t=0;for(const i of this._lastBracketsData){const n=i.brackets;n&&(e[t++]={range:n[0],options:i.options},e[t++]={range:n[1],options:i.options})}this._decorations.set(e)}_recomputeBrackets(){if(!this._editor.hasModel()||!this._editor.hasWidgetFocus()){this._lastBracketsData=[],this._lastVersionId=0;return}const e=this._editor.getSelections();if(e.length>100){this._lastBracketsData=[],this._lastVersionId=0;return}const t=this._editor.getModel(),i=t.getVersionId();let n=[];this._lastVersionId===i&&(n=this._lastBracketsData);const s=[];let r=0;for(let h=0,u=e.length;h<u;h++){const f=e[h];f.isEmpty()&&(s[r++]=f.getStartPosition())}s.length>1&&s.sort(P.compare);const a=[];let l=0,d=0;const c=n.length;for(let h=0,u=s.length;h<u;h++){const f=s[h];for(;d<c&&n[d].position.isBefore(f);)d++;if(d<c&&n[d].position.equals(f))a[l++]=n[d];else{let p=t.bracketPairs.matchBracket(f,20),m=ar._DECORATION_OPTIONS_WITH_OVERVIEW_RULER;!p&&this._matchBrackets==="always"&&(p=t.bracketPairs.findEnclosingBrackets(f,20),m=ar._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER),a[l++]=new nhe(f,p,m)}}this._lastBracketsData=a,this._lastVersionId=i}}ar.ID="editor.contrib.bracketMatchingController";ar._DECORATION_OPTIONS_WITH_OVERVIEW_RULER=Ve.register({description:"bracket-match-overview",stickiness:1,className:"bracket-match",overviewRuler:{color:ti(Jce),position:lo.Center}});ar._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER=Ve.register({description:"bracket-match-no-overview",stickiness:1,className:"bracket-match"});ft(ar.ID,ar,1);ne(the);ne(ehe);ne(ihe);hn.appendMenuItem(k.MenubarGoMenu,{group:"5_infile_nav",command:{id:"editor.action.jumpToBracket",title:g({key:"miGoToBracket",comment:["&& denotes a mnemonic"]},"Go to &&Bracket")},order:2});class she{constructor(e,t){this._selection=e,this._isMovingLeft=t}getEditOperations(e,t){if(this._selection.startLineNumber!==this._selection.endLineNumber||this._selection.isEmpty())return;const i=this._selection.startLineNumber,n=this._selection.startColumn,s=this._selection.endColumn;if(!(this._isMovingLeft&&n===1)&&!(!this._isMovingLeft&&s===e.getLineMaxColumn(i)))if(this._isMovingLeft){const r=new L(i,n-1,i,n),a=e.getValueInRange(r);t.addEditOperation(r,null),t.addEditOperation(new L(i,s,i,s),a)}else{const r=new L(i,s,i,s+1),a=e.getValueInRange(r);t.addEditOperation(r,null),t.addEditOperation(new L(i,n,i,n),a)}}computeCursorState(e,t){return this._isMovingLeft?new ve(this._selection.startLineNumber,this._selection.startColumn-1,this._selection.endLineNumber,this._selection.endColumn-1):new ve(this._selection.startLineNumber,this._selection.startColumn+1,this._selection.endLineNumber,this._selection.endColumn+1)}}class nW extends fe{constructor(e,t){super(t),this.left=e}run(e,t){if(!t.hasModel())return;const i=[],n=t.getSelections();for(const s of n)i.push(new she(s,this.left));t.pushUndoStop(),t.executeCommands(this.id,i),t.pushUndoStop()}}class ohe extends nW{constructor(){super(!0,{id:"editor.action.moveCarretLeftAction",label:g("caret.moveLeft","Move Selected Text Left"),alias:"Move Selected Text Left",precondition:E.writable})}}class rhe extends nW{constructor(){super(!1,{id:"editor.action.moveCarretRightAction",label:g("caret.moveRight","Move Selected Text Right"),alias:"Move Selected Text Right",precondition:E.writable})}}ne(ohe);ne(rhe);class ahe extends fe{constructor(){super({id:"editor.action.transposeLetters",label:g("transposeLetters.label","Transpose Letters"),alias:"Transpose Letters",precondition:E.writable,kbOpts:{kbExpr:E.textInputFocus,primary:0,mac:{primary:306},weight:100}})}run(e,t){if(!t.hasModel())return;const i=t.getModel(),n=[],s=t.getSelections();for(const r of s){if(!r.isEmpty())continue;const a=r.startLineNumber,l=r.startColumn,d=i.getLineMaxColumn(a);if(a===1&&(l===1||l===2&&d===2))continue;const c=l===d?r.getPosition():Ct.rightPosition(i,r.getPosition().lineNumber,r.getPosition().column),h=Ct.leftPosition(i,c),u=Ct.leftPosition(i,h),f=i.getValueInRange(L.fromPositions(u,h)),p=i.getValueInRange(L.fromPositions(h,c)),m=L.fromPositions(u,c);n.push(new wn(m,p+f))}n.length>0&&(t.pushUndoStop(),t.executeCommands(this.id,n),t.pushUndoStop())}}ne(ahe);var lhe=function(o,e,t,i){function n(s){return s instanceof t?s:new t(function(r){r(s)})}return new(t||(t=Promise))(function(s,r){function a(c){try{d(i.next(c))}catch(h){r(h)}}function l(c){try{d(i.throw(c))}catch(h){r(h)}}function d(c){c.done?s(c.value):n(c.value).then(a,l)}d((i=i.apply(o,e||[])).next())})};const Du="9_cutcopypaste",dhe=jr||document.queryCommandSupported("cut"),sW=jr||document.queryCommandSupported("copy"),che=typeof navigator.clipboard>"u"||Mo?document.queryCommandSupported("paste"):!0;function xM(o){return o.register(),o}const hhe=dhe?xM(new Op({id:"editor.action.clipboardCutAction",precondition:void 0,kbOpts:jr?{primary:2102,win:{primary:2102,secondary:[1044]},weight:100}:void 0,menuOpts:[{menuId:k.MenubarEditMenu,group:"2_ccp",title:g({key:"miCut",comment:["&& denotes a mnemonic"]},"Cu&&t"),order:1},{menuId:k.EditorContext,group:Du,title:g("actions.clipboard.cutLabel","Cut"),when:E.writable,order:1},{menuId:k.CommandPalette,group:"",title:g("actions.clipboard.cutLabel","Cut"),order:1},{menuId:k.SimpleEditorContext,group:Du,title:g("actions.clipboard.cutLabel","Cut"),when:E.writable,order:1}]})):void 0,uhe=sW?xM(new Op({id:"editor.action.clipboardCopyAction",precondition:void 0,kbOpts:jr?{primary:2081,win:{primary:2081,secondary:[2067]},weight:100}:void 0,menuOpts:[{menuId:k.MenubarEditMenu,group:"2_ccp",title:g({key:"miCopy",comment:["&& denotes a mnemonic"]},"&&Copy"),order:2},{menuId:k.EditorContext,group:Du,title:g("actions.clipboard.copyLabel","Copy"),order:2},{menuId:k.CommandPalette,group:"",title:g("actions.clipboard.copyLabel","Copy"),order:1},{menuId:k.SimpleEditorContext,group:Du,title:g("actions.clipboard.copyLabel","Copy"),order:2}]})):void 0;hn.appendMenuItem(k.MenubarEditMenu,{submenu:k.MenubarCopy,title:{value:g("copy as","Copy As"),original:"Copy As"},group:"2_ccp",order:3});hn.appendMenuItem(k.EditorContext,{submenu:k.EditorContextCopy,title:{value:g("copy as","Copy As"),original:"Copy As"},group:Du,order:3});hn.appendMenuItem(k.EditorContext,{submenu:k.EditorContextShare,title:{value:g("share","Share"),original:"Share"},group:"11_share",order:-1,when:Z.and(Z.notEquals("resourceScheme","output"),E.editorTextFocus)});hn.appendMenuItem(k.EditorTitleContext,{submenu:k.EditorTitleContextShare,title:{value:g("share","Share"),original:"Share"},group:"11_share",order:-1});hn.appendMenuItem(k.ExplorerContext,{submenu:k.ExplorerContextShare,title:{value:g("share","Share"),original:"Share"},group:"11_share",order:-1});const hD=che?xM(new Op({id:"editor.action.clipboardPasteAction",precondition:void 0,kbOpts:jr?{primary:2100,win:{primary:2100,secondary:[1043]},linux:{primary:2100,secondary:[1043]},weight:100}:void 0,menuOpts:[{menuId:k.MenubarEditMenu,group:"2_ccp",title:g({key:"miPaste",comment:["&& denotes a mnemonic"]},"&&Paste"),order:4},{menuId:k.EditorContext,group:Du,title:g("actions.clipboard.pasteLabel","Paste"),when:E.writable,order:4},{menuId:k.CommandPalette,group:"",title:g("actions.clipboard.pasteLabel","Paste"),order:1},{menuId:k.SimpleEditorContext,group:Du,title:g("actions.clipboard.pasteLabel","Paste"),when:E.writable,order:4}]})):void 0;class fhe extends fe{constructor(){super({id:"editor.action.clipboardCopyWithSyntaxHighlightingAction",label:g("actions.clipboard.copyWithSyntaxHighlightingLabel","Copy With Syntax Highlighting"),alias:"Copy With Syntax Highlighting",precondition:void 0,kbOpts:{kbExpr:E.textInputFocus,primary:0,weight:100}})}run(e,t){!t.hasModel()||!t.getOption(37)&&t.getSelection().isEmpty()||(vI.forceCopyWithSyntaxHighlighting=!0,t.focus(),t.getContainerDomNode().ownerDocument.execCommand("copy"),vI.forceCopyWithSyntaxHighlighting=!1)}}function oW(o,e){o&&(o.addImplementation(1e4,"code-editor",(t,i)=>{const n=t.get(_t).getFocusedCodeEditor();if(n&&n.hasTextFocus()){const s=n.getOption(37),r=n.getSelection();return r&&r.isEmpty()&&!s||n.getContainerDomNode().ownerDocument.execCommand(e),!0}return!1}),o.addImplementation(0,"generic-dom",(t,i)=>(PS().execCommand(e),!0)))}oW(hhe,"cut");oW(uhe,"copy");hD&&(hD.addImplementation(1e4,"code-editor",(o,e)=>{const t=o.get(_t),i=o.get(pd),n=t.getFocusedCodeEditor();return n&&n.hasTextFocus()?!n.getContainerDomNode().ownerDocument.execCommand("paste")&&Kc?lhe(void 0,void 0,void 0,function*(){const r=yield i.readText();if(r!==""){const a=fv.INSTANCE.get(r);let l=!1,d=null,c=null;a&&(l=n.getOption(37)&&!!a.isFromEmptySelection,d=typeof a.multicursorText<"u"?a.multicursorText:null,c=a.mode),n.trigger("keyboard","paste",{text:r,pasteOnNewLine:l,multicursorText:d,mode:c})}}):!0:!1}),hD.addImplementation(0,"generic-dom",(o,e)=>(PS().execCommand("paste"),!0)));sW&&ne(fhe);var ghe=function(o,e,t,i){function n(s){return s instanceof t?s:new t(function(r){r(s)})}return new(t||(t=Promise))(function(s,r){function a(c){try{d(i.next(c))}catch(h){r(h)}}function l(c){try{d(i.throw(c))}catch(h){r(h)}}function d(c){c.done?s(c.value):n(c.value).then(a,l)}d((i=i.apply(o,e||[])).next())})};class Ne{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+Ne.sep)}intersects(e){return this.contains(e)||e.contains(this)}append(e){return new Ne(this.value+Ne.sep+e)}}Ne.sep=".";Ne.None=new Ne("@@none@@");Ne.Empty=new Ne("");Ne.QuickFix=new Ne("quickfix");Ne.Refactor=new Ne("refactor");Ne.RefactorExtract=Ne.Refactor.append("extract");Ne.RefactorInline=Ne.Refactor.append("inline");Ne.RefactorMove=Ne.Refactor.append("move");Ne.RefactorRewrite=Ne.Refactor.append("rewrite");Ne.Notebook=new Ne("notebook");Ne.Source=new Ne("source");Ne.SourceOrganizeImports=Ne.Source.append("organizeImports");Ne.SourceFixAll=Ne.Source.append("fixAll");Ne.SurroundWith=Ne.Refactor.append("surround");var Vs;(function(o){o.Refactor="refactor",o.RefactorPreview="refactor preview",o.Lightbulb="lightbulb",o.Default="other (default)",o.SourceAction="source action",o.QuickFix="quick fix action",o.FixAll="fix all",o.OrganizeImports="organize imports",o.AutoFix="auto fix",o.QuickFixHover="quick fix hover window",o.OnSave="save participants",o.ProblemsView="problems view"})(Vs||(Vs={}));function phe(o,e){return!(o.include&&!o.include.intersects(e)||o.excludes&&o.excludes.some(t=>rW(e,t,o.include))||!o.includeSourceActions&&Ne.Source.contains(e))}function mhe(o,e){const t=e.kind?new Ne(e.kind):void 0;return!(o.include&&(!t||!o.include.contains(t))||o.excludes&&t&&o.excludes.some(i=>rW(t,i,o.include))||!o.includeSourceActions&&t&&Ne.Source.contains(t)||o.onlyIncludePreferredActions&&!e.isPreferred)}function rW(o,e,t){return!(!e.contains(o)||t&&e.contains(t))}class Ma{static fromUser(e,t){return!e||typeof e!="object"?new Ma(t.kind,t.apply,!1):new Ma(Ma.getKindFromUser(e,t.kind),Ma.getApplyFromUser(e,t.apply),Ma.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 Ne(e.kind):t}static getPreferredUser(e){return typeof e.preferred=="boolean"?e.preferred:!1}constructor(e,t,i){this.kind=e,this.apply=t,this.preferred=i}}class _he{constructor(e,t,i){this.action=e,this.provider=t,this.highlightRange=i}resolve(e){var t;return ghe(this,void 0,void 0,function*(){if(!((t=this.provider)===null||t===void 0)&&t.resolveCodeAction&&!this.action.edit){let i;try{i=yield this.provider.resolveCodeAction(this.action,e)}catch(n){Ni(n)}i&&(this.action.edit=i.edit)}return this})}}var jw=function(o,e,t,i){function n(s){return s instanceof t?s:new t(function(r){r(s)})}return new(t||(t=Promise))(function(s,r){function a(c){try{d(i.next(c))}catch(h){r(h)}}function l(c){try{d(i.throw(c))}catch(h){r(h)}}function d(c){c.done?s(c.value):n(c.value).then(a,l)}d((i=i.apply(o,e||[])).next())})};const aW="editor.action.codeAction",DM="editor.action.quickFix",lW="editor.action.autoFix",dW="editor.action.refactor",cW="editor.action.sourceAction",kM="editor.action.organizeImports",IM="editor.action.fixAll";class k_ extends H{static codeActionsPreferredComparator(e,t){return e.isPreferred&&!t.isPreferred?-1:!e.isPreferred&&t.isPreferred?1:0}static codeActionsComparator({action:e},{action:t}){return Fn(e.diagnostics)?Fn(t.diagnostics)?k_.codeActionsPreferredComparator(e,t):-1:Fn(t.diagnostics)?1:k_.codeActionsPreferredComparator(e,t)}constructor(e,t,i){super(),this.documentation=t,this._register(i),this.allActions=[...e].sort(k_.codeActionsComparator),this.validActions=this.allActions.filter(({action:n})=>!n.disabled)}get hasAutoFix(){return this.validActions.some(({action:e})=>!!e.kind&&Ne.QuickFix.contains(new Ne(e.kind))&&!!e.isPreferred)}}const YF={actions:[],documentation:void 0};function I_(o,e,t,i,n,s){var r;return jw(this,void 0,void 0,function*(){const a=i.filter||{},l=Object.assign(Object.assign({},a),{excludes:[...a.excludes||[],Ne.Notebook]}),d={only:(r=a.include)===null||r===void 0?void 0:r.value,trigger:i.type},c=new bM(e,s),h=i.type===2,u=vhe(o,e,h?l:a),f=new X,p=u.map(v=>jw(this,void 0,void 0,function*(){try{n.report(v);const _=yield v.provideCodeActions(e,t,d,c.token);if(_&&f.add(_),c.token.isCancellationRequested)return YF;const b=(_?.actions||[]).filter(w=>w&&mhe(a,w)),C=Che(v,b,a.include);return{actions:b.map(w=>new _he(w,v)),documentation:C}}catch(_){if(oa(_))throw _;return Ni(_),YF}})),m=o.onDidChange(()=>{const v=o.all(e);mi(v,u)||c.cancel()});try{const v=yield Promise.all(p),_=v.map(C=>C.actions).flat(),b=[...Za(v.map(C=>C.documentation)),...bhe(o,e,i,_)];return new k_(_,b,f)}finally{m.dispose(),c.dispose()}})}function vhe(o,e,t){return o.all(e).filter(i=>i.providedCodeActionKinds?i.providedCodeActionKinds.some(n=>phe(t,new Ne(n))):!0)}function*bhe(o,e,t,i){var n,s,r;if(e&&i.length)for(const a of o.all(e))a._getAdditionalMenuItems&&(yield*(n=a._getAdditionalMenuItems)===null||n===void 0?void 0:n.call(a,{trigger:t.type,only:(r=(s=t.filter)===null||s===void 0?void 0:s.include)===null||r===void 0?void 0:r.value},i.map(l=>l.action)))}function Che(o,e,t){if(!o.documentation)return;const i=o.documentation.map(n=>({kind:new Ne(n.kind),command:n.command}));if(t){let n;for(const s of i)s.kind.contains(t)&&(n?n.kind.contains(s.kind)&&(n=s):n=s);if(n)return n?.command}for(const n of e)if(n.kind){for(const s of i)if(s.kind.contains(new Ne(n.kind)))return s.command}}var Kw;(function(o){o.OnSave="onSave",o.FromProblemsView="fromProblemsView",o.FromCodeActions="fromCodeActions"})(Kw||(Kw={}));function whe(o,e,t,i,n=Qe.None){var s;return jw(this,void 0,void 0,function*(){const r=o.get(F0),a=o.get(li),l=o.get(go),d=o.get(Li);if(l.publicLog2("codeAction.applyCodeAction",{codeActionTitle:e.action.title,codeActionKind:e.action.kind,codeActionIsPreferred:!!e.action.isPreferred,reason:t}),yield e.resolve(n),!n.isCancellationRequested&&!(!((s=e.action.edit)===null||s===void 0)&&s.edits.length&&!(yield r.apply(e.action.edit,{editor:i?.editor,label:e.action.title,quotableLabel:e.action.title,code:"undoredo.codeAction",respectAutoSaveConfig:t!==Kw.OnSave,showPreview:i?.preview})).isApplied)&&e.action.command)try{yield a.executeCommand(e.action.command.id,...e.action.command.arguments||[])}catch(c){const h=She(c);d.error(typeof h=="string"?h:g("applyCodeActionFailed","An unknown error occurred while applying the code action"))}})}function She(o){return typeof o=="string"?o:o instanceof Error&&typeof o.message=="string"?o.message:void 0}lt.registerCommand("_executeCodeActionProvider",function(o,e,t,i,n){return jw(this,void 0,void 0,function*(){if(!(e instanceof ke))throw No();const{codeActionProvider:s}=o.get(pe),r=o.get(Yt).getModel(e);if(!r)throw No();const a=ve.isISelection(t)?ve.liftSelection(t):L.isIRange(t)?r.validateRange(t):void 0;if(!a)throw No();const l=typeof i=="string"?new Ne(i):void 0,d=yield I_(s,r,a,{type:1,triggerAction:Vs.Default,filter:{includeSourceActions:!0,include:l}},Jl.None,Qe.None),c=[],h=Math.min(d.validActions.length,typeof n=="number"?n:0);for(let u=0;u<h;u++)c.push(d.validActions[u].resolve(Qe.None));try{return yield Promise.all(c),d.validActions.map(u=>u.action)}finally{setTimeout(()=>d.dispose(),100)}})});var yhe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Lhe=function(o,e){return function(t,i){e(t,i,o)}},gN;let qw=gN=class{constructor(e){this.keybindingService=e}getResolver(){const e=new Zc(()=>this.keybindingService.getKeybindings().filter(t=>gN.codeActionCommands.indexOf(t.command)>=0).filter(t=>t.resolvedKeybinding).map(t=>{let i=t.commandArgs;return t.command===kM?i={kind:Ne.SourceOrganizeImports.value}:t.command===IM&&(i={kind:Ne.SourceFixAll.value}),Object.assign({resolvedKeybinding:t.resolvedKeybinding},Ma.fromUser(i,{kind:Ne.None,apply:"never"}))}));return t=>{if(t.kind){const i=this.bestKeybindingForCodeAction(t,e.value);return i?.resolvedKeybinding}}}bestKeybindingForCodeAction(e,t){if(!e.kind)return;const i=new Ne(e.kind);return t.filter(n=>n.kind.contains(i)).filter(n=>n.preferred?e.isPreferred:!0).reduceRight((n,s)=>n?n.kind.contains(s.kind)?s:n:s,void 0)}};qw.codeActionCommands=[dW,aW,cW,kM,IM];qw=gN=yhe([Lhe(0,Nt)],qw);T("symbolIcon.arrayForeground",{dark:se,light:se,hcDark:se,hcLight:se},g("symbolIcon.arrayForeground","The foreground color for array symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));T("symbolIcon.booleanForeground",{dark:se,light:se,hcDark:se,hcLight:se},g("symbolIcon.booleanForeground","The foreground color for boolean symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));T("symbolIcon.classForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},g("symbolIcon.classForeground","The foreground color for class symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));T("symbolIcon.colorForeground",{dark:se,light:se,hcDark:se,hcLight:se},g("symbolIcon.colorForeground","The foreground color for color symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));T("symbolIcon.constantForeground",{dark:se,light:se,hcDark:se,hcLight:se},g("symbolIcon.constantForeground","The foreground color for constant symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));T("symbolIcon.constructorForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},g("symbolIcon.constructorForeground","The foreground color for constructor symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));T("symbolIcon.enumeratorForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},g("symbolIcon.enumeratorForeground","The foreground color for enumerator symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));T("symbolIcon.enumeratorMemberForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},g("symbolIcon.enumeratorMemberForeground","The foreground color for enumerator member symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));T("symbolIcon.eventForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},g("symbolIcon.eventForeground","The foreground color for event symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));T("symbolIcon.fieldForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},g("symbolIcon.fieldForeground","The foreground color for field symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));T("symbolIcon.fileForeground",{dark:se,light:se,hcDark:se,hcLight:se},g("symbolIcon.fileForeground","The foreground color for file symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));T("symbolIcon.folderForeground",{dark:se,light:se,hcDark:se,hcLight:se},g("symbolIcon.folderForeground","The foreground color for folder symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));T("symbolIcon.functionForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},g("symbolIcon.functionForeground","The foreground color for function symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));T("symbolIcon.interfaceForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},g("symbolIcon.interfaceForeground","The foreground color for interface symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));T("symbolIcon.keyForeground",{dark:se,light:se,hcDark:se,hcLight:se},g("symbolIcon.keyForeground","The foreground color for key symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));T("symbolIcon.keywordForeground",{dark:se,light:se,hcDark:se,hcLight:se},g("symbolIcon.keywordForeground","The foreground color for keyword symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));T("symbolIcon.methodForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},g("symbolIcon.methodForeground","The foreground color for method symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));T("symbolIcon.moduleForeground",{dark:se,light:se,hcDark:se,hcLight:se},g("symbolIcon.moduleForeground","The foreground color for module symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));T("symbolIcon.namespaceForeground",{dark:se,light:se,hcDark:se,hcLight:se},g("symbolIcon.namespaceForeground","The foreground color for namespace symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));T("symbolIcon.nullForeground",{dark:se,light:se,hcDark:se,hcLight:se},g("symbolIcon.nullForeground","The foreground color for null symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));T("symbolIcon.numberForeground",{dark:se,light:se,hcDark:se,hcLight:se},g("symbolIcon.numberForeground","The foreground color for number symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));T("symbolIcon.objectForeground",{dark:se,light:se,hcDark:se,hcLight:se},g("symbolIcon.objectForeground","The foreground color for object symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));T("symbolIcon.operatorForeground",{dark:se,light:se,hcDark:se,hcLight:se},g("symbolIcon.operatorForeground","The foreground color for operator symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));T("symbolIcon.packageForeground",{dark:se,light:se,hcDark:se,hcLight:se},g("symbolIcon.packageForeground","The foreground color for package symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));T("symbolIcon.propertyForeground",{dark:se,light:se,hcDark:se,hcLight:se},g("symbolIcon.propertyForeground","The foreground color for property symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));T("symbolIcon.referenceForeground",{dark:se,light:se,hcDark:se,hcLight:se},g("symbolIcon.referenceForeground","The foreground color for reference symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));T("symbolIcon.snippetForeground",{dark:se,light:se,hcDark:se,hcLight:se},g("symbolIcon.snippetForeground","The foreground color for snippet symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));T("symbolIcon.stringForeground",{dark:se,light:se,hcDark:se,hcLight:se},g("symbolIcon.stringForeground","The foreground color for string symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));T("symbolIcon.structForeground",{dark:se,light:se,hcDark:se,hcLight:se},g("symbolIcon.structForeground","The foreground color for struct symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));T("symbolIcon.textForeground",{dark:se,light:se,hcDark:se,hcLight:se},g("symbolIcon.textForeground","The foreground color for text symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));T("symbolIcon.typeParameterForeground",{dark:se,light:se,hcDark:se,hcLight:se},g("symbolIcon.typeParameterForeground","The foreground color for type parameter symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));T("symbolIcon.unitForeground",{dark:se,light:se,hcDark:se,hcLight:se},g("symbolIcon.unitForeground","The foreground color for unit symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));T("symbolIcon.variableForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},g("symbolIcon.variableForeground","The foreground color for variable symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));const hW=Object.freeze({kind:Ne.Empty,title:g("codeAction.widget.id.more","More Actions...")}),xhe=Object.freeze([{kind:Ne.QuickFix,title:g("codeAction.widget.id.quickfix","Quick Fix")},{kind:Ne.RefactorExtract,title:g("codeAction.widget.id.extract","Extract"),icon:oe.wrench},{kind:Ne.RefactorInline,title:g("codeAction.widget.id.inline","Inline"),icon:oe.wrench},{kind:Ne.RefactorRewrite,title:g("codeAction.widget.id.convert","Rewrite"),icon:oe.wrench},{kind:Ne.RefactorMove,title:g("codeAction.widget.id.move","Move"),icon:oe.wrench},{kind:Ne.SurroundWith,title:g("codeAction.widget.id.surround","Surround With"),icon:oe.symbolSnippet},{kind:Ne.Source,title:g("codeAction.widget.id.source","Source Action"),icon:oe.symbolFile},hW]);function Dhe(o,e,t){if(!e)return o.map(s=>{var r;return{kind:"action",item:s,group:hW,disabled:!!s.action.disabled,label:s.action.disabled||s.action.title,canPreview:!!(!((r=s.action.edit)===null||r===void 0)&&r.edits.length)}});const i=xhe.map(s=>({group:s,actions:[]}));for(const s of o){const r=s.action.kind?new Ne(s.action.kind):Ne.None;for(const a of i)if(a.group.kind.contains(r)){a.actions.push(s);break}}const n=[];for(const s of i)if(s.actions.length){n.push({kind:"header",group:s.group});for(const r of s.actions)n.push({kind:"action",item:r,group:s.group,label:r.action.title,disabled:!!r.action.disabled,keybinding:t(r.action)})}return n}var khe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Ihe=function(o,e){return function(t,i){e(t,i,o)}},pN,dg;(function(o){o.Hidden={type:0};class e{constructor(i,n,s,r){this.actions=i,this.trigger=n,this.editorPosition=s,this.widgetPosition=r,this.type=1}}o.Showing=e})(dg||(dg={}));let ku=pN=class extends H{constructor(e,t){super(),this._editor=e,this._onClick=this._register(new A),this.onClick=this._onClick.event,this._state=dg.Hidden,this._domNode=te("div.lightBulbWidget"),this._register(Tt.ignoreTarget(this._domNode)),this._editor.addContentWidget(this),this._register(this._editor.onDidChangeModelContent(i=>{const n=this._editor.getModel();(this.state.type!==1||!n||this.state.editorPosition.lineNumber>=n.getLineCount())&&this.hide()})),this._register(dj(this._domNode,i=>{if(this.state.type!==1)return;this._editor.focus(),i.preventDefault();const{top:n,height:s}=Ai(this._domNode),r=this._editor.getOption(66);let a=Math.floor(r/3);this.state.widgetPosition.position!==null&&this.state.widgetPosition.position.lineNumber<this.state.editorPosition.lineNumber&&(a+=r),this._onClick.fire({x:i.posx,y:n+s+a,actions:this.state.actions,trigger:this.state.trigger})})),this._register($(this._domNode,"mouseenter",i=>{(i.buttons&1)===1&&this.hide()})),this._register(this._editor.onDidChangeConfiguration(i=>{i.hasChanged(64)&&!this._editor.getOption(64).enabled&&this.hide()})),this._register(de.runAndSubscribe(t.onDidUpdateKeybindings,()=>{var i,n,s,r;this._preferredKbLabel=(n=(i=t.lookupKeybinding(lW))===null||i===void 0?void 0:i.getLabel())!==null&&n!==void 0?n:void 0,this._quickFixKbLabel=(r=(s=t.lookupKeybinding(DM))===null||s===void 0?void 0:s.getLabel())!==null&&r!==void 0?r: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,i){if(e.validActions.length<=0)return this.hide();const n=this._editor.getOptions();if(!n.get(64).enabled)return this.hide();const s=this._editor.getModel();if(!s)return this.hide();const{lineNumber:r,column:a}=s.validatePosition(i),l=s.getOptions().tabSize,d=n.get(50),c=s.getLineContent(r),h=ny(c,l),u=d.spaceWidth*h>22,f=m=>m>2&&this._editor.getTopForLineNumber(m)===this._editor.getTopForLineNumber(m-1);let p=r;if(!u){if(r>1&&!f(r-1))p-=1;else if(!f(r+1))p+=1;else if(a*d.spaceWidth<22)return this.hide()}this.state=new dg.Showing(e,t,i,{position:{lineNumber:p,column:1},preference:pN._posPref}),this._editor.layoutContentWidget(this)}hide(){this.state!==dg.Hidden&&(this.state=dg.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(...Ie.asClassNameArray(oe.lightBulb)),this._domNode.classList.add(...Ie.asClassNameArray(oe.lightbulbAutofix)),this._preferredKbLabel)){this.title=g("preferredcodeActionWithKb","Show Code Actions. Preferred Quick Fix Available ({0})",this._preferredKbLabel);return}this._domNode.classList.remove(...Ie.asClassNameArray(oe.lightbulbAutofix)),this._domNode.classList.add(...Ie.asClassNameArray(oe.lightBulb)),this._quickFixKbLabel?this.title=g("codeActionWithKb","Show Code Actions ({0})",this._quickFixKbLabel):this.title=g("codeAction","Show Code Actions")}set title(e){this._domNode.title=e}};ku.ID="editor.contrib.lightbulbWidget";ku._posPref=[0];ku=pN=khe([Ihe(1,Nt)],ku);var Ehe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},XF=function(o,e){return function(t,i){e(t,i,o)}},uW=function(o,e,t,i){function n(s){return s instanceof t?s:new t(function(r){r(s)})}return new(t||(t=Promise))(function(s,r){function a(c){try{d(i.next(c))}catch(h){r(h)}}function l(c){try{d(i.throw(c))}catch(h){r(h)}}function d(c){c.done?s(c.value):n(c.value).then(a,l)}d((i=i.apply(o,e||[])).next())})},mN;let dd=mN=class{constructor(e,t,i){this._options=e,this._languageService=t,this._openerService=i,this._onDidRenderAsync=new A,this.onDidRenderAsync=this._onDidRenderAsync.event}dispose(){this._onDidRenderAsync.dispose()}render(e,t,i){if(!e)return{element:document.createElement("span"),dispose:()=>{}};const n=new X,s=n.add(py(e,Object.assign(Object.assign({},this._getRenderOptions(e,n)),t),i));return s.element.classList.add("rendered-markdown"),{element:s.element,dispose:()=>n.dispose()}}_getRenderOptions(e,t){return{codeBlockRenderer:(i,n)=>uW(this,void 0,void 0,function*(){var s,r,a;let l;i?l=this._languageService.getLanguageIdByLanguageName(i):this._options.editor&&(l=(s=this._options.editor.getModel())===null||s===void 0?void 0:s.getLanguageId()),l||(l=ro);const d=yield Wee(this._languageService,n,l),c=document.createElement("span");if(c.innerHTML=(a=(r=mN._ttpTokenizer)===null||r===void 0?void 0:r.createHTML(d))!==null&&a!==void 0?a:d,this._options.editor){const h=this._options.editor.getOption(50);kn(c,h)}else this._options.codeBlockFontFamily&&(c.style.fontFamily=this._options.codeBlockFontFamily);return this._options.codeBlockFontSize!==void 0&&(c.style.fontSize=this._options.codeBlockFontSize),c}),asyncRenderCallback:()=>this._onDidRenderAsync.fire(),actionHandler:{callback:i=>fW(this._openerService,i,e.isTrusted),disposables:t}}}};dd._ttpTokenizer=cd("tokenizeToString",{createHTML(o){return o}});dd=mN=Ehe([XF(1,qt),XF(2,zs)],dd);function fW(o,e,t){return uW(this,void 0,void 0,function*(){try{return yield o.open(e,{fromUserGesture:!0,allowContributedOpeners:!0,allowCommands:Nhe(t)})}catch(i){return He(i),!1}})}function Nhe(o){return o===!0?!0:o&&Array.isArray(o.enabledCommands)?o.enabledCommands:!1}var The=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},QF=function(o,e){return function(t,i){e(t,i,o)}},r1;let Fs=r1=class{static get(e){return e.getContribution(r1.ID)}constructor(e,t,i){this._openerService=i,this._messageWidget=new pn,this._messageListeners=new X,this._mouseOverMessage=!1,this._editor=e,this._visible=r1.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){On(lc(e)?e.value:e),this._visible.set(!0),this._messageWidget.clear(),this._messageListeners.clear(),this._message=lc(e)?py(e,{actionHandler:{callback:n=>fW(this._openerService,n,lc(e)?e.isTrusted:void 0),disposables:this._messageListeners}}):void 0,this._messageWidget.value=new JF(this._editor,t,typeof e=="string"?e:this._message.element),this._messageListeners.add(de.debounce(this._editor.onDidBlurEditorText,(n,s)=>s,0)(()=>{this._mouseOverMessage||this._messageWidget.value&&Dn(rr(),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($(this._messageWidget.value.getDomNode(),ae.MOUSE_ENTER,()=>this._mouseOverMessage=!0,!0)),this._messageListeners.add($(this._messageWidget.value.getDomNode(),ae.MOUSE_LEAVE,()=>this._mouseOverMessage=!1,!0));let i;this._messageListeners.add(this._editor.onMouseMove(n=>{n.target.position&&(i?i.containsPosition(n.target.position)||this.closeMessage():i=new L(t.lineNumber-3,1,n.target.position.lineNumber+3,1))}))}closeMessage(){this._visible.reset(),this._messageListeners.clear(),this._messageWidget.value&&this._messageListeners.add(JF.fadeOut(this._messageWidget.value))}};Fs.ID="editor.contrib.messageController";Fs.MESSAGE_VISIBLE=new ce("messageVisible",!1,g("messageVisible","Whether the editor is currently showing an inline message"));Fs=r1=The([QF(1,Ae),QF(2,zs)],Fs);const Rhe=tn.bindToContribution(Fs.get);re(new Rhe({id:"leaveEditorMessage",precondition:Fs.MESSAGE_VISIBLE,handler:o=>o.closeMessage(),kbOpts:{weight:130,primary:9}}));let JF=class{static fadeOut(e){const t=()=>{e.dispose(),clearTimeout(i),e.getDomNode().removeEventListener("animationend",t)},i=setTimeout(t,110);return e.getDomNode().addEventListener("animationend",t),e.getDomNode().classList.add("fadeOut"),{dispose:t}}constructor(e,{lineNumber:t,column:i},n){this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._editor=e,this._editor.revealLinesInCenterIfOutsideViewport(t,t,0),this._position={lineNumber:t,column:i},this._domNode=document.createElement("div"),this._domNode.classList.add("monaco-editor-overlaymessage"),this._domNode.style.marginLeft="-6px";const s=document.createElement("div");s.classList.add("anchor","top"),this._domNode.appendChild(s);const r=document.createElement("div");typeof n=="string"?(r.classList.add("message"),r.textContent=n):(n.classList.add("message"),r.appendChild(n)),this._domNode.appendChild(r);const a=document.createElement("div");a.classList.add("anchor","below"),this._domNode.appendChild(a),this._editor.addContentWidget(this),this._domNode.classList.add("fadeIn")}dispose(){this._editor.removeContentWidget(this)}getId(){return"messageoverlay"}getDomNode(){return this._domNode}getPosition(){return{position:this._position,preference:[1,2],positionAffinity:1}}afterRender(e){this._domNode.classList.toggle("below",e===2)}};ft(Fs.ID,Fs,4);var gW=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},_N=function(o,e){return function(t,i){e(t,i,o)}},Mhe=function(o,e,t,i){function n(s){return s instanceof t?s:new t(function(r){r(s)})}return new(t||(t=Promise))(function(s,r){function a(c){try{d(i.next(c))}catch(h){r(h)}}function l(c){try{d(i.throw(c))}catch(h){r(h)}}function d(c){c.done?s(c.value):n(c.value).then(a,l)}d((i=i.apply(o,e||[])).next())})};const pW="acceptSelectedCodeAction",mW="previewSelectedCodeAction";class Ahe{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,i){var n,s;i.text.textContent=(s=(n=e.group)===null||n===void 0?void 0:n.title)!==null&&s!==void 0?s:""}disposeTemplate(e){}}let vN=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 i=document.createElement("span");i.className="title",e.append(i);const n=new z0(e,to);return{container:e,icon:t,text:i,keybinding:n}}renderElement(e,t,i){var n,s,r;if(!((n=e.group)===null||n===void 0)&&n.icon?(i.icon.className=Ie.asClassName(e.group.icon),e.group.icon.color&&(i.icon.style.color=he(e.group.icon.color.id))):(i.icon.className=Ie.asClassName(oe.lightBulb),i.icon.style.color="var(--vscode-editorLightBulb-foreground)"),!e.item||!e.label)return;i.text.textContent=_W(e.label),i.keybinding.set(e.keybinding),Cj(!!e.keybinding,i.keybinding.element);const a=(s=this._keybindingService.lookupKeybinding(pW))===null||s===void 0?void 0:s.getLabel(),l=(r=this._keybindingService.lookupKeybinding(mW))===null||r===void 0?void 0:r.getLabel();i.container.classList.toggle("option-disabled",e.disabled),e.disabled?i.container.title=e.label:a&&l?this._supportsPreview&&e.canPreview?i.container.title=g({key:"label-preview",comment:['placeholders are keybindings, e.g "F2 to apply, Shift+F2 to preview"']},"{0} to apply, {1} to preview",a,l):i.container.title=g({key:"label",comment:['placeholder is a keybinding, e.g "F2 to apply"']},"{0} to apply",a):i.container.title=""}disposeTemplate(e){}};vN=gW([_N(1,Nt)],vN);class Phe extends UIEvent{constructor(){super("acceptSelectedAction")}}class e5 extends UIEvent{constructor(){super("previewSelectedAction")}}function Ohe(o){if(o.kind==="action")return o.label}let bN=class extends H{constructor(e,t,i,n,s,r){super(),this._delegate=n,this._contextViewService=s,this._keybindingService=r,this._actionLineHeight=24,this._headerLineHeight=26,this.cts=this._register(new Si),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 mr(e,this.domNode,a,[new vN(t,this._keybindingService),new Ahe],{keyboardSupport:!1,typeNavigationEnabled:!0,keyboardNavigationLabelProvider:{getKeyboardNavigationLabel:Ohe},accessibilityProvider:{getAriaLabel:l=>{if(l.kind==="action"){let d=l.label?_W(l?.label):"";return l.disabled&&(d=g({key:"customQuickFixWidget.labels",comment:["Action widget labels for accessibility."]},"{0}, Disabled Reason: {1}",d,l.disabled)),d}return null},getWidgetAriaLabel:()=>g({key:"customQuickFixWidget",comment:["An action widget option"]},"Action Widget"),getRole:l=>l.kind==="action"?"option":"separator",getWidgetRole:()=>"listbox"}})),this._list.style(Qu),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=i,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(d=>d.kind==="header").length,n=this._allMenuItems.length*this._actionLineHeight+t*this._headerLineHeight-t*this._actionLineHeight;this._list.layout(n);const s=this._allMenuItems.map((d,c)=>{const h=document.getElementById(this._list.getElementID(c));if(h){h.style.width="auto";const u=h.getBoundingClientRect().width;return h.style.width="",u}return 0}),r=Math.max(...s,e),l=Math.min(n,document.body.clientHeight*.7);return this._list.layout(l,r),this.domNode.style.height=`${l}px`,this._list.domFocus(),r}focusPrevious(){this._list.focusPrevious(1,!0,void 0,this.focusCondition)}focusNext(){this._list.focusNext(1,!0,void 0,this.focusCondition)}acceptSelected(e){const t=this._list.getFocus();if(t.length===0)return;const i=t[0],n=this._list.element(i);if(!this.focusCondition(n))return;const s=e?new e5:new Phe;this._list.setSelection([i],s)}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 e5):this._list.setSelection([])}onFocus(){var e,t;this._list.domFocus();const i=this._list.getFocus();if(i.length===0)return;const n=i[0],s=this._list.element(n);(t=(e=this._delegate).onFocus)===null||t===void 0||t.call(e,s.item)}onListHover(e){return Mhe(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 i=yield this._delegate.onHover(t.item,this.cts.token);t.canPreview=i?i.canPreview:void 0}e.index&&this._list.splice(e.index,1,[t])}this._list.setFocus(typeof e.index=="number"?[e.index]:[])})}onListClick(e){e.element&&this.focusCondition(e.element)&&this._list.setFocus([])}};bN=gW([_N(4,ud),_N(5,Nt)],bN);function _W(o){return o.replace(/\r\n|\r|\n/g," ")}var Fhe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},uD=function(o,e){return function(t,i){e(t,i,o)}};T("actionBar.toggledBackground",{dark:zh,light:zh,hcDark:zh,hcLight:zh},g("actionBar.toggledBackground","Background color for toggled action items in action bar."));const Iu={Visible:new ce("codeActionMenuVisible",!1,g("codeActionMenuVisible","Whether the action widget list is visible"))},sf=et("actionWidgetService");let Eu=class extends H{get isVisible(){return Iu.Visible.getValue(this._contextKeyService)||!1}constructor(e,t,i){super(),this._contextViewService=e,this._contextKeyService=t,this._instantiationService=i,this._list=this._register(new pn)}show(e,t,i,n,s,r,a){const l=Iu.Visible.bindTo(this._contextKeyService),d=this._instantiationService.createInstance(bN,e,t,i,n);this._contextViewService.showContextView({getAnchor:()=>s,render:c=>(l.set(!0),this._renderWidget(c,d,a??[])),onHide:c=>{l.reset(),this._onWidgetClosed(c)}},r,!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,i){var n;const s=document.createElement("div");if(s.classList.add("action-widget"),e.appendChild(s),this._list.value=t,this._list.value)s.appendChild(this._list.value.domNode);else throw new Error("List has no value");const r=new X,a=document.createElement("div"),l=e.appendChild(a);l.classList.add("context-view-block"),r.add($(l,ae.MOUSE_DOWN,p=>p.stopPropagation()));const d=document.createElement("div"),c=e.appendChild(d);c.classList.add("context-view-pointerBlock"),r.add($(c,ae.POINTER_MOVE,()=>c.remove())),r.add($(c,ae.MOUSE_DOWN,()=>c.remove()));let h=0;if(i.length){const p=this._createActionBar(".action-widget-action-bar",i);p&&(s.appendChild(p.getContainer().parentElement),r.add(p),h=p.getContainer().offsetWidth)}const u=(n=this._list.value)===null||n===void 0?void 0:n.layout(h);s.style.width=`${u}px`;const f=r.add(Qa(e));return r.add(f.onDidBlur(()=>this.hide())),r}_createActionBar(e,t){if(!t.length)return;const i=te(e),n=new Wo(i);return n.push(t,{icon:!1,label:!0}),n}_onWidgetClosed(e){var t;(t=this._list.value)===null||t===void 0||t.hide(e)}};Eu=Fhe([uD(0,ud),uD(1,Ae),uD(2,Re)],Eu);dt(sf,Eu,1);const Y0=1100;jt(class extends fo{constructor(){super({id:"hideCodeActionWidget",title:{value:g("hideCodeActionWidget.title","Hide action widget"),original:"Hide action widget"},precondition:Iu.Visible,keybinding:{weight:Y0,primary:9,secondary:[1033]}})}run(o){o.get(sf).hide()}});jt(class extends fo{constructor(){super({id:"selectPrevCodeAction",title:{value:g("selectPrevCodeAction.title","Select previous action"),original:"Select previous action"},precondition:Iu.Visible,keybinding:{weight:Y0,primary:16,secondary:[2064],mac:{primary:16,secondary:[2064,302]}}})}run(o){const e=o.get(sf);e instanceof Eu&&e.focusPrevious()}});jt(class extends fo{constructor(){super({id:"selectNextCodeAction",title:{value:g("selectNextCodeAction.title","Select next action"),original:"Select next action"},precondition:Iu.Visible,keybinding:{weight:Y0,primary:18,secondary:[2066],mac:{primary:18,secondary:[2066,300]}}})}run(o){const e=o.get(sf);e instanceof Eu&&e.focusNext()}});jt(class extends fo{constructor(){super({id:pW,title:{value:g("acceptSelected.title","Accept selected action"),original:"Accept selected action"},precondition:Iu.Visible,keybinding:{weight:Y0,primary:3,secondary:[2137]}})}run(o){const e=o.get(sf);e instanceof Eu&&e.acceptSelected()}});jt(class extends fo{constructor(){super({id:mW,title:{value:g("previewSelected.title","Preview selected action"),original:"Preview selected action"},precondition:Iu.Visible,keybinding:{weight:Y0,primary:2051}})}run(o){const e=o.get(sf);e instanceof Eu&&e.acceptSelected(!0)}});var Bhe=function(o,e,t,i){function n(s){return s instanceof t?s:new t(function(r){r(s)})}return new(t||(t=Promise))(function(s,r){function a(c){try{d(i.next(c))}catch(h){r(h)}}function l(c){try{d(i.throw(c))}catch(h){r(h)}}function d(c){c.done?s(c.value):n(c.value).then(a,l)}d((i=i.apply(o,e||[])).next())})};const vW=new ce("supportedCodeAction","");class Whe extends H{constructor(e,t,i,n=250){super(),this._editor=e,this._markerService=t,this._signalChange=i,this._delay=n,this._autoTriggerTimer=this._register(new ur),this._register(this._markerService.onMarkerChanged(s=>this._onMarkerChanges(s))),this._register(this._editor.onDidChangeCursorPosition(()=>this._tryAutoTrigger()))}trigger(e){const t=this._getRangeOfSelectionUnlessWhitespaceEnclosed(e);this._signalChange(t?{trigger:e,selection:t}:void 0)}_onMarkerChanges(e){const t=this._editor.getModel();t&&e.some(i=>lR(i,t.uri))&&this._tryAutoTrigger()}_tryAutoTrigger(){this._autoTriggerTimer.cancelAndSet(()=>{this.trigger({type:2,triggerAction:Vs.Default})},this._delay)}_getRangeOfSelectionUnlessWhitespaceEnclosed(e){if(!this._editor.hasModel())return;const t=this._editor.getModel(),i=this._editor.getSelection();if(i.isEmpty()&&e.type===2){const{lineNumber:n,column:s}=i.getPosition(),r=t.getLineContent(n);if(r.length===0)return;if(s===1){if(/\s/.test(r[0]))return}else if(s===t.getLineMaxColumn(n)){if(/\s/.test(r[r.length-1]))return}else if(/\s/.test(r[s-2])&&/\s/.test(r[s-1]))return}return i}}var Fh;(function(o){o.Empty={type:0};class e{constructor(i,n,s){this.trigger=i,this.position=n,this._cancellablePromise=s,this.type=1,this.actions=s.catch(r=>{if(oa(r))return bW;throw r})}cancel(){this._cancellablePromise.cancel()}}o.Triggered=e})(Fh||(Fh={}));const bW=Object.freeze({allActions:[],validActions:[],dispose:()=>{},documentation:[],hasAutoFix:!1});class Vhe extends H{constructor(e,t,i,n,s,r){super(),this._editor=e,this._registry=t,this._markerService=i,this._progressService=s,this._configurationService=r,this._codeActionOracle=this._register(new pn),this._state=Fh.Empty,this._onDidChangeState=this._register(new A),this.onDidChangeState=this._onDidChangeState.event,this._disposed=!1,this._supportedCodeActions=vW.bindTo(n),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(Fh.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?.uri}):!1}_update(){if(this._disposed)return;this._codeActionOracle.value=void 0,this.setState(Fh.Empty);const e=this._editor.getModel();if(e&&this._registry.has(e)&&!this._editor.getOption(90)){const t=this._registry.all(e).flatMap(i=>{var n;return(n=i.providedCodeActionKinds)!==null&&n!==void 0?n:[]});this._supportedCodeActions.set(t.join(" ")),this._codeActionOracle.value=new Whe(this._editor,this._markerService,i=>{var n;if(!i){this.setState(Fh.Empty);return}const s=i.selection.getStartPosition(),r=Wi(a=>Bhe(this,void 0,void 0,function*(){var l,d,c,h,u,f;if(this._settingEnabledNearbyQuickfixes()&&i.trigger.type===1&&(i.trigger.triggerAction===Vs.QuickFix||!((d=(l=i.trigger.filter)===null||l===void 0?void 0:l.include)===null||d===void 0)&&d.contains(Ne.QuickFix))){const p=yield I_(this._registry,e,i.selection,i.trigger,Jl.None,a);if(a.isCancellationRequested)return bW;if(!((c=p.validActions)===null||c===void 0?void 0:c.some(v=>v.action.kind?Ne.QuickFix.contains(new Ne(v.action.kind)):!1))){const v=this._markerService.read({resource:e.uri});if(v.length>0){const _=i.selection.getPosition();let b=_,C=Number.MAX_VALUE,w=!1;for(const S of v){const D=S.endColumn,x=S.endLineNumber,I=S.startLineNumber;(x===_.lineNumber||I===_.lineNumber)&&Math.abs(_.column-D)<C&&(C=Math.abs(_.column-D),w=!0,b=new P(x,D))}if(w){const S={type:i.trigger.type,triggerAction:i.trigger.triggerAction,filter:{include:!((h=i.trigger.filter)===null||h===void 0)&&h.include?(u=i.trigger.filter)===null||u===void 0?void 0:u.include:Ne.QuickFix},autoApply:i.trigger.autoApply,context:{notAvailableMessage:((f=i.trigger.context)===null||f===void 0?void 0:f.notAvailableMessage)||"",position:b}},D=new ve(b.lineNumber,b.column,b.lineNumber,b.column),x=yield I_(this._registry,e,D,S,Jl.None,a),I=[...p.validActions];return x.validActions.length!==0&&(x.validActions.forEach(N=>{N.highlightRange=N.action.isPreferred}),I.push(...x.validActions)),{validActions:I,allActions:p.allActions,documentation:p.documentation,hasAutoFix:p.hasAutoFix,dispose:()=>{p.dispose()}}}}}}return I_(this._registry,e,i.selection,i.trigger,Jl.None,a)}));i.trigger.type===1&&((n=this._progressService)===null||n===void 0||n.showWhile(r,250)),this.setState(new Fh.Triggered(i.trigger,s,r))},void 0),this._codeActionOracle.value.trigger({type:2,triggerAction:Vs.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 Hhe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},vl=function(o,e){return function(t,i){e(t,i,o)}},Sm=function(o,e,t,i){function n(s){return s instanceof t?s:new t(function(r){r(s)})}return new(t||(t=Promise))(function(s,r){function a(c){try{d(i.next(c))}catch(h){r(h)}}function l(c){try{d(i.throw(c))}catch(h){r(h)}}function d(c){c.done?s(c.value):n(c.value).then(a,l)}d((i=i.apply(o,e||[])).next())})},a1;const zhe="quickfix-edit-highlight";let Pc=a1=class extends H{static get(e){return e.getContribution(a1.ID)}constructor(e,t,i,n,s,r,a,l,d,c){super(),this._commandService=a,this._configurationService=l,this._actionWidgetService=d,this._instantiationService=c,this._activeCodeActions=this._register(new pn),this._showDisabled=!1,this._disposed=!1,this._editor=e,this._model=this._register(new Vhe(this._editor,s.codeActionProvider,t,i,r,l)),this._register(this._model.onDidChangeState(h=>this.update(h))),this._lightBulbWidget=new Zc(()=>{const h=this._editor.getContribution(ku.ID);return h&&this._register(h.onClick(u=>this.showCodeActionList(u.actions,u,{includeDisabledActions:!1,fromLightbulb:!0}))),h}),this._resolver=n.createInstance(qw),this._register(this._editor.onDidLayoutChange(()=>this._actionWidgetService.hide()))}dispose(){this._disposed=!0,super.dispose()}showCodeActions(e,t,i){return this.showCodeActionList(t,i,{includeDisabledActions:!1,fromLightbulb:!1})}manualTriggerAtCurrentPosition(e,t,i,n){var s;if(!this._editor.hasModel())return;(s=Fs.get(this._editor))===null||s===void 0||s.closeMessage();const r=this._editor.getPosition();this._trigger({type:1,triggerAction:t,filter:i,autoApply:n,context:{notAvailableMessage:e,position:r}})}_trigger(e){return this._model.trigger(e)}_applyCodeAction(e,t,i){return Sm(this,void 0,void 0,function*(){try{yield this._instantiationService.invokeFunction(whe,e,Kw.FromCodeActions,{preview:i,editor:this._editor})}finally{t&&this._trigger({type:2,triggerAction:Vs.QuickFix,filter:{}})}})}update(e){var t,i,n,s,r,a,l;return Sm(this,void 0,void 0,function*(){if(e.type!==1){(t=this._lightBulbWidget.rawValue)===null||t===void 0||t.hide();return}let d;try{d=yield e.actions}catch(c){He(c);return}if(!this._disposed)if((i=this._lightBulbWidget.value)===null||i===void 0||i.update(d,e.trigger,e.position),e.trigger.type===1){if(!((n=e.trigger.filter)===null||n===void 0)&&n.include){const h=this.tryGetValidActionToApply(e.trigger,d);if(h){try{(s=this._lightBulbWidget.value)===null||s===void 0||s.hide(),yield this._applyCodeAction(h,!1,!1)}finally{d.dispose()}return}if(e.trigger.context){const u=this.getInvalidActionThatWouldHaveBeenApplied(e.trigger,d);if(u&&u.action.disabled){(r=Fs.get(this._editor))===null||r===void 0||r.showMessage(u.action.disabled,e.trigger.context.position),d.dispose();return}}}const c=!!(!((a=e.trigger.filter)===null||a===void 0)&&a.include);if(e.trigger.context&&(!d.allActions.length||!c&&!d.validActions.length)){(l=Fs.get(this._editor))===null||l===void 0||l.showMessage(e.trigger.context.notAvailableMessage,e.trigger.context.position),this._activeCodeActions.value=d,d.dispose();return}this._activeCodeActions.value=d,this.showCodeActionList(d,this.toCoords(e.position),{includeDisabledActions:c,fromLightbulb:!1})}else this._actionWidgetService.isVisible?d.dispose():this._activeCodeActions.value=d})}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:i})=>i.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,i){return Sm(this,void 0,void 0,function*(){const n=this._editor.createDecorationsCollection(),s=this._editor.getDomNode();if(!s)return;const r=i.includeDisabledActions&&(this._showDisabled||e.validActions.length===0)?e.allActions:e.validActions;if(!r.length)return;const a=P.isIPosition(t)?this.toCoords(t):t,l={onSelect:(d,c)=>Sm(this,void 0,void 0,function*(){this._applyCodeAction(d,!0,!!c),this._actionWidgetService.hide(),n.clear()}),onHide:()=>{var d;(d=this._editor)===null||d===void 0||d.focus(),n.clear()},onHover:(d,c)=>Sm(this,void 0,void 0,function*(){var h;if(yield d.resolve(c),!c.isCancellationRequested)return{canPreview:!!(!((h=d.action.edit)===null||h===void 0)&&h.edits.length)}}),onFocus:d=>{var c,h;if(d&&d.highlightRange&&d.action.diagnostics){const u=[{range:d.action.diagnostics[0],options:a1.DECORATION}];n.set(u);const f=d.action.diagnostics[0],p=(h=(c=this._editor.getModel())===null||c===void 0?void 0:c.getWordAtPosition({lineNumber:f.startLineNumber,column:f.startColumn}))===null||h===void 0?void 0:h.word;Ic(g("editingNewSelection","Context: {0} at line {1} and column {2}.",p,f.startLineNumber,f.startColumn))}else n.clear()}};this._actionWidgetService.show("codeActionWidget",!0,Dhe(r,this._shouldShowHeaders(),this._resolver.getResolver()),l,a,s,this._getActionBarActions(e,t,i))})}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),i=Ai(this._editor.getDomNode()),n=i.left+t.left,s=i.top+t.top+t.height;return{x:n,y:s}}_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?.uri})}_getActionBarActions(e,t,i){if(i.fromLightbulb)return[];const n=e.documentation.map(s=>{var r;return{id:s.id,label:s.title,tooltip:(r=s.tooltip)!==null&&r!==void 0?r:"",class:void 0,enabled:!0,run:()=>{var a;return this._commandService.executeCommand(s.id,...(a=s.arguments)!==null&&a!==void 0?a:[])}}});return i.includeDisabledActions&&e.validActions.length>0&&e.allActions.length!==e.validActions.length&&n.push(this._showDisabled?{id:"hideMoreActions",label:g("hideMoreActions","Hide Disabled"),enabled:!0,tooltip:"",class:void 0,run:()=>(this._showDisabled=!1,this.showCodeActionList(e,t,i))}:{id:"showMoreActions",label:g("showMoreActions","Show Disabled"),enabled:!0,tooltip:"",class:void 0,run:()=>(this._showDisabled=!0,this.showCodeActionList(e,t,i))}),n}};Pc.ID="editor.contrib.codeActionController";Pc.DECORATION=Ve.register({description:"quickfix-highlight",className:zhe});Pc=a1=Hhe([vl(1,ul),vl(2,Ae),vl(3,Re),vl(4,pe),vl(5,Jc),vl(6,li),vl(7,st),vl(8,sf),vl(9,Re)],Pc);gr((o,e)=>{((n,s)=>{s&&e.addRule(`.monaco-editor ${n} { background-color: ${s}; }`)})(".quickfix-edit-highlight",o.getColor(Ha));const i=o.getColor(Kd);i&&e.addRule(`.monaco-editor .quickfix-edit-highlight { border: 1px ${Zr(o.type)?"dotted":"solid"} ${i}; box-sizing: border-box; }`)});function X0(o){return Z.regex(vW.keys()[0],new RegExp("(\\s|^)"+ao(o.value)+"\\b"))}const EM={type:"object",defaultSnippets:[{body:{kind:""}}],properties:{kind:{type:"string",description:g("args.schema.kind","Kind of the code action to run.")},apply:{type:"string",description:g("args.schema.apply","Controls when the returned actions are applied."),default:"ifSingle",enum:["first","ifSingle","never"],enumDescriptions:[g("args.schema.apply.first","Always apply the first returned code action."),g("args.schema.apply.ifSingle","Apply the first returned code action if it is the only one."),g("args.schema.apply.never","Do not apply the returned code actions.")]},preferred:{type:"boolean",default:!1,description:g("args.schema.preferred","Controls if only preferred code actions should be returned.")}}};function of(o,e,t,i,n=Vs.Default){if(o.hasModel()){const s=Pc.get(o);s?.manualTriggerAtCurrentPosition(e,n,t,i)}}class Uhe extends fe{constructor(){super({id:DM,label:g("quickfix.trigger.label","Quick Fix..."),alias:"Quick Fix...",precondition:Z.and(E.writable,E.hasCodeActionsProvider),kbOpts:{kbExpr:E.textInputFocus,primary:2137,weight:100}})}run(e,t){return of(t,g("editor.action.quickFix.noneMessage","No code actions available"),void 0,void 0,Vs.QuickFix)}}class $he extends tn{constructor(){super({id:aW,precondition:Z.and(E.writable,E.hasCodeActionsProvider),description:{description:"Trigger a code action",args:[{name:"args",schema:EM}]}})}runEditorCommand(e,t,i){const n=Ma.fromUser(i,{kind:Ne.Empty,apply:"ifSingle"});return of(t,typeof i?.kind=="string"?n.preferred?g("editor.action.codeAction.noneMessage.preferred.kind","No preferred code actions for '{0}' available",i.kind):g("editor.action.codeAction.noneMessage.kind","No code actions for '{0}' available",i.kind):n.preferred?g("editor.action.codeAction.noneMessage.preferred","No preferred code actions available"):g("editor.action.codeAction.noneMessage","No code actions available"),{include:n.kind,includeSourceActions:!0,onlyIncludePreferredActions:n.preferred},n.apply)}}class jhe extends fe{constructor(){super({id:dW,label:g("refactor.label","Refactor..."),alias:"Refactor...",precondition:Z.and(E.writable,E.hasCodeActionsProvider),kbOpts:{kbExpr:E.textInputFocus,primary:3120,mac:{primary:1328},weight:100},contextMenuOpts:{group:"1_modification",order:2,when:Z.and(E.writable,X0(Ne.Refactor))},description:{description:"Refactor...",args:[{name:"args",schema:EM}]}})}run(e,t,i){const n=Ma.fromUser(i,{kind:Ne.Refactor,apply:"never"});return of(t,typeof i?.kind=="string"?n.preferred?g("editor.action.refactor.noneMessage.preferred.kind","No preferred refactorings for '{0}' available",i.kind):g("editor.action.refactor.noneMessage.kind","No refactorings for '{0}' available",i.kind):n.preferred?g("editor.action.refactor.noneMessage.preferred","No preferred refactorings available"):g("editor.action.refactor.noneMessage","No refactorings available"),{include:Ne.Refactor.contains(n.kind)?n.kind:Ne.None,onlyIncludePreferredActions:n.preferred},n.apply,Vs.Refactor)}}class Khe extends fe{constructor(){super({id:cW,label:g("source.label","Source Action..."),alias:"Source Action...",precondition:Z.and(E.writable,E.hasCodeActionsProvider),contextMenuOpts:{group:"1_modification",order:2.1,when:Z.and(E.writable,X0(Ne.Source))},description:{description:"Source Action...",args:[{name:"args",schema:EM}]}})}run(e,t,i){const n=Ma.fromUser(i,{kind:Ne.Source,apply:"never"});return of(t,typeof i?.kind=="string"?n.preferred?g("editor.action.source.noneMessage.preferred.kind","No preferred source actions for '{0}' available",i.kind):g("editor.action.source.noneMessage.kind","No source actions for '{0}' available",i.kind):n.preferred?g("editor.action.source.noneMessage.preferred","No preferred source actions available"):g("editor.action.source.noneMessage","No source actions available"),{include:Ne.Source.contains(n.kind)?n.kind:Ne.None,includeSourceActions:!0,onlyIncludePreferredActions:n.preferred},n.apply,Vs.SourceAction)}}class qhe extends fe{constructor(){super({id:kM,label:g("organizeImports.label","Organize Imports"),alias:"Organize Imports",precondition:Z.and(E.writable,X0(Ne.SourceOrganizeImports)),kbOpts:{kbExpr:E.textInputFocus,primary:1581,weight:100}})}run(e,t){return of(t,g("editor.action.organize.noneMessage","No organize imports action available"),{include:Ne.SourceOrganizeImports,includeSourceActions:!0},"ifSingle",Vs.OrganizeImports)}}class Ghe extends fe{constructor(){super({id:IM,label:g("fixAll.label","Fix All"),alias:"Fix All",precondition:Z.and(E.writable,X0(Ne.SourceFixAll))})}run(e,t){return of(t,g("fixAll.noneMessage","No fix all action available"),{include:Ne.SourceFixAll,includeSourceActions:!0},"ifSingle",Vs.FixAll)}}class Zhe extends fe{constructor(){super({id:lW,label:g("autoFix.label","Auto Fix..."),alias:"Auto Fix...",precondition:Z.and(E.writable,X0(Ne.QuickFix)),kbOpts:{kbExpr:E.textInputFocus,primary:1625,mac:{primary:2649},weight:100}})}run(e,t){return of(t,g("editor.action.autoFix.noneMessage","No auto fixes available"),{include:Ne.QuickFix,onlyIncludePreferredActions:!0},"ifSingle",Vs.AutoFix)}}ft(Pc.ID,Pc,3);ft(ku.ID,ku,4);ne(Uhe);ne(jhe);ne(Khe);ne(qhe);ne(Zhe);ne(Ghe);re(new $he);Jt.as(aa.Configuration).registerConfiguration(Object.assign(Object.assign({},cy),{properties:{"editor.codeActionWidget.showHeaders":{type:"boolean",scope:5,description:g("showCodeActionHeaders","Enable/disable showing group headers in the Code Action menu."),default:!0}}}));Jt.as(aa.Configuration).registerConfiguration(Object.assign(Object.assign({},cy),{properties:{"editor.codeActionWidget.includeNearbyQuickfixes":{type:"boolean",scope:5,description:g("includeNearbyQuickfixes","Enable/disable showing nearest quickfix within a line when not currently on a diagnostic."),default:!1}}}));var t5=function(o,e,t,i){function n(s){return s instanceof t?s:new t(function(r){r(s)})}return new(t||(t=Promise))(function(s,r){function a(c){try{d(i.next(c))}catch(h){r(h)}}function l(c){try{d(i.throw(c))}catch(h){r(h)}}function d(c){c.done?s(c.value):n(c.value).then(a,l)}d((i=i.apply(o,e||[])).next())})};class CN{constructor(){this.lenses=[],this._disposables=new X}dispose(){this._disposables.dispose()}get isDisposed(){return this._disposables.isDisposed}add(e,t){this._disposables.add(e);for(const i of e.lenses)this.lenses.push({symbol:i,provider:t})}}function CW(o,e,t){return t5(this,void 0,void 0,function*(){const i=o.ordered(e),n=new Map,s=new CN,r=i.map((a,l)=>t5(this,void 0,void 0,function*(){n.set(a,l);try{const d=yield Promise.resolve(a.provideCodeLenses(e,t));d&&s.add(d,a)}catch(d){Ni(d)}}));return yield Promise.all(r),s.lenses=s.lenses.sort((a,l)=>a.symbol.range.startLineNumber<l.symbol.range.startLineNumber?-1:a.symbol.range.startLineNumber>l.symbol.range.startLineNumber?1:n.get(a.provider)<n.get(l.provider)?-1:n.get(a.provider)>n.get(l.provider)?1:a.symbol.range.startColumn<l.symbol.range.startColumn?-1:a.symbol.range.startColumn>l.symbol.range.startColumn?1:0),s})}lt.registerCommand("_executeCodeLensProvider",function(o,...e){let[t,i]=e;xt(ke.isUri(t)),xt(typeof i=="number"||!i);const{codeLensProvider:n}=o.get(pe),s=o.get(Yt).getModel(t);if(!s)throw No();const r=[],a=new X;return CW(n,s,Qe.None).then(l=>{a.add(l);const d=[];for(const c of l.lenses)i==null||c.symbol.command?r.push(c.symbol):i-- >0&&c.provider.resolveCodeLens&&d.push(Promise.resolve(c.provider.resolveCodeLens(s,c.symbol,Qe.None)).then(h=>r.push(h||c.symbol)));return Promise.all(d)}).then(()=>r).finally(()=>{setTimeout(()=>a.dispose(),100)})});var Yhe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Xhe=function(o,e){return function(t,i){e(t,i,o)}};const wW=et("ICodeLensCache");class i5{constructor(e,t){this.lineCount=e,this.data=t}}let wN=class{constructor(e){this._fakeProvider=new class{provideCodeLenses(){throw new Error("not supported")}},this._cache=new Yc(20,.75);const t="codelens/cache";Vl(()=>e.remove(t,1));const i="codelens/cache2",n=e.get(i,1,"{}");this._deserialize(n),de.once(e.onWillSaveState)(s=>{s.reason===bw.SHUTDOWN&&e.store(i,this._serialize(),1,1)})}put(e,t){const i=t.lenses.map(r=>{var a;return{range:r.symbol.range,command:r.symbol.command&&{id:"",title:(a=r.symbol.command)===null||a===void 0?void 0:a.title}}}),n=new CN;n.add({lenses:i,dispose:()=>{}},this._fakeProvider);const s=new i5(e.getLineCount(),n);this._cache.set(e.uri.toString(),s)}get(e){const t=this._cache.get(e.uri.toString());return t&&t.lineCount===e.getLineCount()?t.data:void 0}delete(e){this._cache.delete(e.uri.toString())}_serialize(){const e=Object.create(null);for(const[t,i]of this._cache){const n=new Set;for(const s of i.data.lenses)n.add(s.symbol.range.startLineNumber);e[t]={lineCount:i.lineCount,lines:[...n.values()]}}return JSON.stringify(e)}_deserialize(e){try{const t=JSON.parse(e);for(const i in t){const n=t[i],s=[];for(const a of n.lines)s.push({range:new L(a,1,a,11)});const r=new CN;r.add({lenses:s,dispose(){}},this._fakeProvider),this._cache.set(i,new i5(n.lineCount,r))}}catch{}}};wN=Yhe([Xhe(0,_r)],wN);dt(wW,wN,1);class Qhe{constructor(e,t,i){this.afterColumn=1073741824,this.afterLineNumber=e,this.heightInPx=t,this._onHeight=i,this.suppressMouseDown=!0,this.domNode=document.createElement("div")}onComputedHeight(e){this._lastHeight===void 0?this._lastHeight=e:this._lastHeight!==e&&(this._lastHeight=e,this._onHeight())}isVisible(){return this._lastHeight!==0&&this.domNode.hasAttribute("monaco-visible-view-zone")}}class $y{constructor(e,t){this.allowEditorOverflow=!1,this.suppressMouseDown=!0,this._commands=new Map,this._isEmpty=!0,this._editor=e,this._id=`codelens.widget-${$y._idPool++}`,this.updatePosition(t),this._domNode=document.createElement("span"),this._domNode.className="codelens-decoration"}withCommands(e,t){this._commands.clear();const i=[];let n=!1;for(let s=0;s<e.length;s++){const r=e[s];if(r&&(n=!0,r.command)){const a=dc(r.command.title.trim());r.command.id?(i.push(te("a",{id:String(s),title:r.command.tooltip,role:"button"},...a)),this._commands.set(String(s),r.command)):i.push(te("span",{title:r.command.tooltip},...a)),s+1<e.length&&i.push(te("span",void 0," | "))}}n?(gn(this._domNode,...i),this._isEmpty&&t&&this._domNode.classList.add("fadein"),this._isEmpty=!1):gn(this._domNode,te("span",void 0,"no commands"))}getCommand(e){return e.parentElement===this._domNode?this._commands.get(e.id):void 0}getId(){return this._id}getDomNode(){return this._domNode}updatePosition(e){const t=this._editor.getModel().getLineFirstNonWhitespaceColumn(e);this._widgetPosition={position:{lineNumber:e,column:t},preference:[1]}}getPosition(){return this._widgetPosition||null}}$y._idPool=0;class fD{constructor(){this._removeDecorations=[],this._addDecorations=[],this._addDecorationsCallbacks=[]}addDecoration(e,t){this._addDecorations.push(e),this._addDecorationsCallbacks.push(t)}removeDecoration(e){this._removeDecorations.push(e)}commit(e){const t=e.deltaDecorations(this._removeDecorations,this._addDecorations);for(let i=0,n=t.length;i<n;i++)this._addDecorationsCallbacks[i](t[i])}}const n5=Ve.register({collapseOnReplaceEdit:!0,description:"codelens"});class s5{constructor(e,t,i,n,s,r){this._isDisposed=!1,this._editor=t,this._data=e,this._decorationIds=[];let a;const l=[];this._data.forEach((d,c)=>{d.symbol.command&&l.push(d.symbol),i.addDecoration({range:d.symbol.range,options:n5},h=>this._decorationIds[c]=h),a?a=L.plusRange(a,d.symbol.range):a=L.lift(d.symbol.range)}),this._viewZone=new Qhe(a.startLineNumber-1,s,r),this._viewZoneId=n.addZone(this._viewZone),l.length>0&&(this._createContentWidgetIfNecessary(),this._contentWidget.withCommands(l,!1))}_createContentWidgetIfNecessary(){this._contentWidget?this._editor.layoutContentWidget(this._contentWidget):(this._contentWidget=new $y(this._editor,this._viewZone.afterLineNumber+1),this._editor.addContentWidget(this._contentWidget))}dispose(e,t){this._decorationIds.forEach(e.removeDecoration,e),this._decorationIds=[],t?.removeZone(this._viewZoneId),this._contentWidget&&(this._editor.removeContentWidget(this._contentWidget),this._contentWidget=void 0),this._isDisposed=!0}isDisposed(){return this._isDisposed}isValid(){return this._decorationIds.some((e,t)=>{const i=this._editor.getModel().getDecorationRange(e),n=this._data[t].symbol;return!!(i&&L.isEmpty(n.range)===i.isEmpty())})}updateCodeLensSymbols(e,t){this._decorationIds.forEach(t.removeDecoration,t),this._decorationIds=[],this._data=e,this._data.forEach((i,n)=>{t.addDecoration({range:i.symbol.range,options:n5},s=>this._decorationIds[n]=s)})}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<this._decorationIds.length;t++){const i=e.getDecorationRange(this._decorationIds[t]);i&&(this._data[t].symbol.range=i)}return this._data}updateCommands(e){this._createContentWidgetIfNecessary(),this._contentWidget.withCommands(e,!0);for(let t=0;t<this._data.length;t++){const i=e[t];if(i){const{symbol:n}=this._data[t];n.command=i.command||n.command}}}getCommand(e){var t;return(t=this._contentWidget)===null||t===void 0?void 0:t.getCommand(e)}getLineNumber(){const e=this._editor.getModel().getDecorationRange(this._decorationIds[0]);return e?e.startLineNumber:-1}update(e){if(this.isValid()){const t=this._editor.getModel().getDecorationRange(this._decorationIds[0]);t&&(this._viewZone.afterLineNumber=t.startLineNumber-1,e.layoutZone(this._viewZoneId),this._contentWidget&&(this._contentWidget.updatePosition(t.startLineNumber),this._editor.layoutContentWidget(this._contentWidget)))}}}var Jhe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},ym=function(o,e){return function(t,i){e(t,i,o)}},SW=function(o,e,t,i){function n(s){return s instanceof t?s:new t(function(r){r(s)})}return new(t||(t=Promise))(function(s,r){function a(c){try{d(i.next(c))}catch(h){r(h)}}function l(c){try{d(i.throw(c))}catch(h){r(h)}}function d(c){c.done?s(c.value):n(c.value).then(a,l)}d((i=i.apply(o,e||[])).next())})};let vp=class{constructor(e,t,i,n,s,r){this._editor=e,this._languageFeaturesService=t,this._commandService=n,this._notificationService=s,this._codeLensCache=r,this._disposables=new X,this._localToDispose=new X,this._lenses=[],this._oldCodeLensModels=new X,this._provideCodeLensDebounce=i.for(t.codeLensProvider,"CodeLensProvide",{min:250}),this._resolveCodeLensesDebounce=i.for(t.codeLensProvider,"CodeLensResolve",{min:250,salt:"resolve"}),this._resolveCodeLensesScheduler=new Dt(()=>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(),i=this._editor.getOption(18),n=this._editor.getOption(50),{style:s}=this._editor.getContainerDomNode();s.setProperty("--vscode-editorCodeLens-lineHeight",`${e}px`),s.setProperty("--vscode-editorCodeLens-fontSize",`${t}px`),s.setProperty("--vscode-editorCodeLens-fontFeatureSettings",n.fontFeatureSettings),i&&(s.setProperty("--vscode-editorCodeLens-fontFamily",i),s.setProperty("--vscode-editorCodeLens-fontFamilyDefault",Ps.fontFamily)),this._editor.changeViewZones(r=>{for(const a of this._lenses)a.updateHeight(e,r)})}_localDispose(){var e,t,i;(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(),(i=this._currentCodeLensModel)===null||i===void 0||i.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(xc(()=>{const n=this._codeLensCache.get(e);t===n&&(this._codeLensCache.delete(e),this._onModelChange())},30*1e3));return}for(const n of this._languageFeaturesService.codeLensProvider.all(e))if(typeof n.onDidChange=="function"){const s=n.onDidChange(()=>i.schedule());this._localToDispose.add(s)}const i=new Dt(()=>{var n;const s=Date.now();(n=this._getCodeLensModelPromise)===null||n===void 0||n.cancel(),this._getCodeLensModelPromise=Wi(r=>CW(this._languageFeaturesService.codeLensProvider,e,r)),this._getCodeLensModelPromise.then(r=>{this._currentCodeLensModel&&this._oldCodeLensModels.add(this._currentCodeLensModel),this._currentCodeLensModel=r,this._codeLensCache.put(e,r);const a=this._provideCodeLensDebounce.update(e,Date.now()-s);i.delay=a,this._renderCodeLensSymbols(r),this._resolveCodeLensesInViewportSoon()},He)},this._provideCodeLensDebounce.get(e));this._localToDispose.add(i),this._localToDispose.add(Me(()=>this._resolveCodeLensesScheduler.cancel())),this._localToDispose.add(this._editor.onDidChangeModelContent(()=>{var n;this._editor.changeDecorations(s=>{this._editor.changeViewZones(r=>{const a=[];let l=-1;this._lenses.forEach(c=>{!c.isValid()||l===c.getLineNumber()?a.push(c):(c.update(r),l=c.getLineNumber())});const d=new fD;a.forEach(c=>{c.dispose(d,r),this._lenses.splice(this._lenses.indexOf(c),1)}),d.commit(s)})}),i.schedule(),this._resolveCodeLensesScheduler.cancel(),(n=this._resolveCodeLensesPromise)===null||n===void 0||n.cancel(),this._resolveCodeLensesPromise=void 0})),this._localToDispose.add(this._editor.onDidFocusEditorWidget(()=>{i.schedule()})),this._localToDispose.add(this._editor.onDidBlurEditorText(()=>{i.cancel()})),this._localToDispose.add(this._editor.onDidScrollChange(n=>{n.scrollTopChanged&&this._lenses.length>0&&this._resolveCodeLensesInViewportSoon()})),this._localToDispose.add(this._editor.onDidLayoutChange(()=>{this._resolveCodeLensesInViewportSoon()})),this._localToDispose.add(Me(()=>{if(this._editor.getModel()){const n=ia.capture(this._editor);this._editor.changeDecorations(s=>{this._editor.changeViewZones(r=>{this._disposeAllLenses(s,r)})}),n.restore(this._editor)}else this._disposeAllLenses(void 0,void 0)})),this._localToDispose.add(this._editor.onMouseDown(n=>{if(n.target.type!==9)return;let s=n.target.element;if(s?.tagName==="SPAN"&&(s=s.parentElement),s?.tagName==="A")for(const r of this._lenses){const a=r.getCommand(s);if(a){this._commandService.executeCommand(a.id,...a.arguments||[]).catch(l=>this._notificationService.error(l));break}}})),i.schedule()}_disposeAllLenses(e,t){const i=new fD;for(const n of this._lenses)n.dispose(i,t);e&&i.commit(e),this._lenses.length=0}_renderCodeLensSymbols(e){if(!this._editor.hasModel())return;const t=this._editor.getModel().getLineCount(),i=[];let n;for(const a of e.lenses){const l=a.symbol.range.startLineNumber;l<1||l>t||(n&&n[n.length-1].symbol.range.startLineNumber===l?n.push(a):(n=[a],i.push(n)))}if(!i.length&&!this._lenses.length)return;const s=ia.capture(this._editor),r=this._getLayoutInfo();this._editor.changeDecorations(a=>{this._editor.changeViewZones(l=>{const d=new fD;let c=0,h=0;for(;h<i.length&&c<this._lenses.length;){const u=i[h][0].symbol.range.startLineNumber,f=this._lenses[c].getLineNumber();f<u?(this._lenses[c].dispose(d,l),this._lenses.splice(c,1)):f===u?(this._lenses[c].updateCodeLensSymbols(i[h],d),h++,c++):(this._lenses.splice(c,0,new s5(i[h],this._editor,d,l,r.codeLensHeight,()=>this._resolveCodeLensesInViewportSoon())),c++,h++)}for(;c<this._lenses.length;)this._lenses[c].dispose(d,l),this._lenses.splice(c,1);for(;h<i.length;)this._lenses.push(new s5(i[h],this._editor,d,l,r.codeLensHeight,()=>this._resolveCodeLensesInViewportSoon())),h++;d.commit(a)})}),s.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 i=[],n=[];if(this._lenses.forEach(a=>{const l=a.computeIfNecessary(t);l&&(i.push(l),n.push(a))}),i.length===0)return;const s=Date.now(),r=Wi(a=>{const l=i.map((d,c)=>{const h=new Array(d.length),u=d.map((f,p)=>!f.symbol.command&&typeof f.provider.resolveCodeLens=="function"?Promise.resolve(f.provider.resolveCodeLens(t,f.symbol,a)).then(m=>{h[p]=m},Ni):(h[p]=f.symbol,Promise.resolve(void 0)));return Promise.all(u).then(()=>{!a.isCancellationRequested&&!n[c].isDisposed()&&n[c].updateCommands(h)})});return Promise.all(l)});this._resolveCodeLensesPromise=r,this._resolveCodeLensesPromise.then(()=>{const a=this._resolveCodeLensesDebounce.update(t,Date.now()-s);this._resolveCodeLensesScheduler.delay=a,this._currentCodeLensModel&&this._codeLensCache.put(t,this._currentCodeLensModel),this._oldCodeLensModels.clear(),r===this._resolveCodeLensesPromise&&(this._resolveCodeLensesPromise=void 0)},a=>{He(a),r===this._resolveCodeLensesPromise&&(this._resolveCodeLensesPromise=void 0)})}getModel(){var e;return SW(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})}};vp.ID="css.editor.codeLens";vp=Jhe([ym(1,pe),ym(2,Ho),ym(3,li),ym(4,Li),ym(5,wW)],vp);ft(vp.ID,vp,1);ne(class extends fe{constructor(){super({id:"codelens.showLensesInCurrentLine",precondition:E.hasCodeLensProvider,label:g("showLensOnLine","Show CodeLens Commands For Current Line"),alias:"Show CodeLens Commands For Current Line"})}run(e,t){return SW(this,void 0,void 0,function*(){if(!t.hasModel())return;const i=e.get(la),n=e.get(li),s=e.get(Li),r=t.getSelection().positionLineNumber,a=t.getContribution(vp.ID);if(!a)return;const l=yield a.getModel();if(!l)return;const d=[];for(const u of l.lenses)u.symbol.command&&u.symbol.range.startLineNumber===r&&d.push({label:u.symbol.command.title,command:u.symbol.command});if(d.length===0)return;const c=yield i.pick(d,{canPickMany:!1,placeHolder:g("placeHolder","Select a command")});if(!c)return;let h=c.command;if(l.isDisposed){const u=yield a.getModel(),f=u?.lenses.find(p=>{var m;return p.symbol.range.startLineNumber===r&&((m=p.symbol.command)===null||m===void 0?void 0:m.title)===h.title});if(!f||!f.symbol.command)return;h=f.symbol.command}try{yield n.executeCommand(h.id,...h.arguments||[])}catch(u){s.error(u)}})}});var eue=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},gD=function(o,e){return function(t,i){e(t,i,o)}},tue=function(o,e,t,i){function n(s){return s instanceof t?s:new t(function(r){r(s)})}return new(t||(t=Promise))(function(s,r){function a(c){try{d(i.next(c))}catch(h){r(h)}}function l(c){try{d(i.throw(c))}catch(h){r(h)}}function d(c){c.done?s(c.value):n(c.value).then(a,l)}d((i=i.apply(o,e||[])).next())})};class NM{constructor(e,t){this._editorWorkerClient=new F2(e,!1,"editorWorkerService",t)}provideDocumentColors(e,t){return tue(this,void 0,void 0,function*(){return this._editorWorkerClient.computeDefaultDocumentColors(e.uri)})}provideColorPresentations(e,t,i){const n=t.range,s=t.color,r=s.alpha,a=new V(new rt(Math.round(255*s.red),Math.round(255*s.green),Math.round(255*s.blue),r)),l=r?V.Format.CSS.formatRGB(a):V.Format.CSS.formatRGBA(a),d=r?V.Format.CSS.formatHSL(a):V.Format.CSS.formatHSLA(a),c=r?V.Format.CSS.formatHex(a):V.Format.CSS.formatHexA(a),h=[];return h.push({label:l,textEdit:{range:n,text:l}}),h.push({label:d,textEdit:{range:n,text:d}}),h.push({label:c,textEdit:{range:n,text:c}}),h}}let SN=class extends H{constructor(e,t,i){super(),this._register(i.colorProvider.register("*",new NM(e,t)))}};SN=eue([gD(0,Yt),gD(1,At),gD(2,pe)],SN);Ny(SN);var Q0=function(o,e,t,i){function n(s){return s instanceof t?s:new t(function(r){r(s)})}return new(t||(t=Promise))(function(s,r){function a(c){try{d(i.next(c))}catch(h){r(h)}}function l(c){try{d(i.throw(c))}catch(h){r(h)}}function d(c){c.done?s(c.value):n(c.value).then(a,l)}d((i=i.apply(o,e||[])).next())})};function yW(o,e,t,i=!0){return Q0(this,void 0,void 0,function*(){return TM(new iue,o,e,t,i)})}function LW(o,e,t,i){return Promise.resolve(t.provideColorPresentations(o,e,i))}class iue{constructor(){}compute(e,t,i,n){return Q0(this,void 0,void 0,function*(){const s=yield e.provideDocumentColors(t,i);if(Array.isArray(s))for(const r of s)n.push({colorInfo:r,provider:e});return Array.isArray(s)})}}class nue{constructor(){}compute(e,t,i,n){return Q0(this,void 0,void 0,function*(){const s=yield e.provideDocumentColors(t,i);if(Array.isArray(s))for(const r of s)n.push({range:r.range,color:[r.color.red,r.color.green,r.color.blue,r.color.alpha]});return Array.isArray(s)})}}class sue{constructor(e){this.colorInfo=e}compute(e,t,i,n){return Q0(this,void 0,void 0,function*(){const s=yield e.provideColorPresentations(t,this.colorInfo,Qe.None);return Array.isArray(s)&&n.push(...s),Array.isArray(s)})}}function TM(o,e,t,i,n){return Q0(this,void 0,void 0,function*(){let s=!1,r;const a=[],l=e.ordered(t);for(let d=l.length-1;d>=0;d--){const c=l[d];if(c instanceof NM)r=c;else try{(yield o.compute(c,t,i,a))&&(s=!0)}catch(h){Ni(h)}}return s?a:r&&n?(yield o.compute(r,t,i,a),a):[]})}function xW(o,e){const{colorProvider:t}=o.get(pe),i=o.get(Yt).getModel(e);if(!i)throw No();const n=o.get(st).getValue("editor.defaultColorDecorators",{resource:e});return{model:i,colorProviderRegistry:t,isDefaultColorDecoratorsEnabled:n}}lt.registerCommand("_executeDocumentColorProvider",function(o,...e){const[t]=e;if(!(t instanceof ke))throw No();const{model:i,colorProviderRegistry:n,isDefaultColorDecoratorsEnabled:s}=xW(o,t);return TM(new nue,n,i,Qe.None,s)});lt.registerCommand("_executeColorPresentationProvider",function(o,...e){const[t,i]=e,{uri:n,range:s}=i;if(!(n instanceof ke)||!Array.isArray(t)||t.length!==4||!L.isIRange(s))throw No();const{model:r,colorProviderRegistry:a,isDefaultColorDecoratorsEnabled:l}=xW(o,n),[d,c,h,u]=t;return TM(new sue({range:s,color:{red:d,green:c,blue:h,alpha:u}}),a,r,Qe.None,l)});var oue=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},pD=function(o,e){return function(t,i){e(t,i,o)}},o5=function(o,e,t,i){function n(s){return s instanceof t?s:new t(function(r){r(s)})}return new(t||(t=Promise))(function(s,r){function a(c){try{d(i.next(c))}catch(h){r(h)}}function l(c){try{d(i.throw(c))}catch(h){r(h)}}function d(c){c.done?s(c.value):n(c.value).then(a,l)}d((i=i.apply(o,e||[])).next())})},yN;const DW=Object.create({});let Oc=yN=class extends H{constructor(e,t,i,n){super(),this._editor=e,this._configurationService=t,this._languageFeaturesService=i,this._localToDispose=this._register(new X),this._decorationsIds=[],this._colorDatas=new Map,this._colorDecoratorIds=this._editor.createDecorationsCollection(),this._ruleFactory=new I0(this._editor),this._decoratorLimitReporter=new rue,this._colorDecorationClassRefs=this._register(new X),this._debounceInformation=n.for(i.colorProvider,"Document Colors",{min:yN.RECOMPUTE_TIME}),this._register(e.onDidChangeModel(()=>{this._isColorDecoratorsEnabled=this.isEnabled(),this.updateColors()})),this._register(e.onDidChangeModelLanguage(()=>this.updateColors())),this._register(i.colorProvider.onDidChange(()=>this.updateColors())),this._register(e.onDidChangeConfiguration(s=>{const r=this._isColorDecoratorsEnabled;this._isColorDecoratorsEnabled=this.isEnabled(),this._isDefaultColorDecoratorsEnabled=this._editor.getOption(145);const a=r!==this._isColorDecoratorsEnabled||s.hasChanged(21),l=s.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(),i=this._configurationService.getValue(t);if(i&&typeof i=="object"){const n=i.colorDecorators;if(n&&n.enable!==void 0&&!n.enable)return n.enable}return this._editor.getOption(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 ur,this._timeoutTimer.cancelAndSet(()=>{this._timeoutTimer=null,this.beginCompute()},this._debounceInformation.get(e)))})),this.beginCompute())}beginCompute(){return o5(this,void 0,void 0,function*(){this._computePromise=Wi(e=>o5(this,void 0,void 0,function*(){const t=this._editor.getModel();if(!t)return[];const i=new Bn(!1),n=yield yW(this._languageFeaturesService.colorProvider,t,e,this._isDefaultColorDecoratorsEnabled);return this._debounceInformation.update(t,i.elapsed()),n}));try{const e=yield this._computePromise;this.updateDecorations(e),this.updateColorDecorators(e),this._computePromise=null}catch(e){He(e)}})}stop(){this._timeoutTimer&&(this._timeoutTimer.cancel(),this._timeoutTimer=null),this._computePromise&&(this._computePromise.cancel(),this._computePromise=null),this._localToDispose.clear()}updateDecorations(e){const t=e.map(i=>({range:{startLineNumber:i.colorInfo.range.startLineNumber,startColumn:i.colorInfo.range.startColumn,endLineNumber:i.colorInfo.range.endLineNumber,endColumn:i.colorInfo.range.endColumn},options:Ve.EMPTY}));this._editor.changeDecorations(i=>{this._decorationsIds=i.deltaDecorations(this._decorationsIds,t),this._colorDatas=new Map,this._decorationsIds.forEach((n,s)=>this._colorDatas.set(n,e[s]))})}updateColorDecorators(e){this._colorDecorationClassRefs.clear();const t=[],i=this._editor.getOption(21);for(let s=0;s<e.length&&t.length<i;s++){const{red:r,green:a,blue:l,alpha:d}=e[s].colorInfo.color,c=new rt(Math.round(r*255),Math.round(a*255),Math.round(l*255),d),h=`rgba(${c.r}, ${c.g}, ${c.b}, ${c.a})`,u=this._colorDecorationClassRefs.add(this._ruleFactory.createClassNameRef({backgroundColor:h}));t.push({range:{startLineNumber:e[s].colorInfo.range.startLineNumber,startColumn:e[s].colorInfo.range.startColumn,endLineNumber:e[s].colorInfo.range.endLineNumber,endColumn:e[s].colorInfo.range.endColumn},options:{description:"colorDetector",before:{content:w9,inlineClassName:`${u.className} colorpicker-color-decoration`,inlineClassNameAffectsLetterSpacing:!0,attachedData:DW}}})}const n=i<e.length?i:!1;this._decoratorLimitReporter.update(e.length,n),this._colorDecoratorIds.set(t)}removeAllDecorations(){this._editor.removeDecorations(this._decorationsIds),this._decorationsIds=[],this._colorDecoratorIds.clear(),this._colorDecorationClassRefs.clear()}getColorData(e){const t=this._editor.getModel();if(!t)return null;const i=t.getDecorationsInRange(L.fromPositions(e,e)).filter(n=>this._colorDatas.has(n.id));return i.length===0?null:this._colorDatas.get(i[0].id)}isColorDecoration(e){return this._colorDecoratorIds.has(e)}};Oc.ID="editor.contrib.colorDetector";Oc.RECOMPUTE_TIME=1e3;Oc=yN=oue([pD(1,st),pD(2,pe),pD(3,Ho)],Oc);class rue{constructor(){this._onDidChange=new A,this._computed=0,this._limited=!1}update(e,t){(e!==this._computed||t!==this._limited)&&(this._computed=e,this._limited=t,this._onDidChange.fire())}}ft(Oc.ID,Oc,1);class aue{get color(){return this._color}set color(e){this._color.equals(e)||(this._color=e,this._onDidChangeColor.fire(e))}get presentation(){return this.colorPresentations[this.presentationIndex]}get colorPresentations(){return this._colorPresentations}set colorPresentations(e){this._colorPresentations=e,this.presentationIndex>e.length-1&&(this.presentationIndex=0),this._onDidChangePresentation.fire(this.presentation)}constructor(e,t,i){this.presentationIndex=i,this._onColorFlushed=new A,this.onColorFlushed=this._onColorFlushed.event,this._onDidChangeColor=new A,this.onDidChangeColor=this._onDidChangeColor.event,this._onDidChangePresentation=new A,this.onDidChangePresentation=this._onDidChangePresentation.event,this.originalColor=e,this._color=e,this._colorPresentations=t}selectNextColorPresentation(){this.presentationIndex=(this.presentationIndex+1)%this.colorPresentations.length,this.flushColor(),this._onDidChangePresentation.fire(this.presentation)}guessColorPresentation(e,t){let i=-1;for(let n=0;n<this.colorPresentations.length;n++)if(t.toLowerCase()===this.colorPresentations[n].label){i=n;break}if(i===-1){const n=t.split("(")[0].toLowerCase();for(let s=0;s<this.colorPresentations.length;s++)if(this.colorPresentations[s].label.toLowerCase().startsWith(n)){i=s;break}}i!==-1&&i!==this.presentationIndex&&(this.presentationIndex=i,this._onDidChangePresentation.fire(this.presentation))}flushColor(){this._onColorFlushed.fire(this._color)}}const eo=te;class lue extends H{constructor(e,t,i,n=!1){super(),this.model=t,this.showingStandaloneColorPicker=n,this._closeButton=null,this._domNode=eo(".colorpicker-header"),Y(e,this._domNode),this._pickedColorNode=Y(this._domNode,eo(".picked-color")),Y(this._pickedColorNode,eo("span.codicon.codicon-color-mode")),this._pickedColorPresentation=Y(this._pickedColorNode,document.createElement("span")),this._pickedColorPresentation.classList.add("picked-color-presentation");const s=g("clickToToggleColorOptions","Click to toggle color options (rgb/hsl/hex)");this._pickedColorNode.setAttribute("title",s),this._originalColorNode=Y(this._domNode,eo(".original-color")),this._originalColorNode.style.backgroundColor=V.Format.CSS.format(this.model.originalColor)||"",this.backgroundColor=i.getColorTheme().getColor($1)||V.white,this._register(i.onDidColorThemeChange(r=>{this.backgroundColor=r.getColor($1)||V.white})),this._register($(this._pickedColorNode,ae.CLICK,()=>this.model.selectNextColorPresentation())),this._register($(this._originalColorNode,ae.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=V.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 due(this._domNode)))}get closeButton(){return this._closeButton}get pickedColorNode(){return this._pickedColorNode}get originalColorNode(){return this._originalColorNode}onDidChangeColor(e){this._pickedColorNode.style.backgroundColor=V.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 due extends H{constructor(e){super(),this._onClicked=this._register(new A),this.onClicked=this._onClicked.event,this._button=document.createElement("div"),this._button.classList.add("close-button"),Y(e,this._button);const t=document.createElement("div");t.classList.add("close-button-inner-div"),Y(this._button,t),Y(t,eo(".button"+Ie.asCSSSelector(_i("color-picker-close",oe.close,g("closeIcon","Icon to close the color picker"))))).classList.add("close-icon"),this._button.onclick=()=>{this._onClicked.fire()}}}class cue extends H{constructor(e,t,i,n=!1){super(),this.model=t,this.pixelRatio=i,this._insertButton=null,this._domNode=eo(".colorpicker-body"),Y(e,this._domNode),this._saturationBox=new hue(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 uue(this._domNode,this.model,n),this._register(this._opacityStrip),this._register(this._opacityStrip.onDidChange(this.onDidOpacityChange,this)),this._register(this._opacityStrip.onColorFlushed(this.flushColor,this)),this._hueStrip=new fue(this._domNode,this.model,n),this._register(this._hueStrip),this._register(this._hueStrip.onDidChange(this.onDidHueChange,this)),this._register(this._hueStrip.onColorFlushed(this.flushColor,this)),n&&(this._insertButton=this._register(new gue(this._domNode)),this._domNode.classList.add("standalone-colorpicker"))}flushColor(){this.model.flushColor()}onDidSaturationValueChange({s:e,v:t}){const i=this.model.color.hsva;this.model.color=new V(new Pa(i.h,e,t,i.a))}onDidOpacityChange(e){const t=this.model.color.hsva;this.model.color=new V(new Pa(t.h,t.s,t.v,e))}onDidHueChange(e){const t=this.model.color.hsva,i=(1-e)*360;this.model.color=new V(new Pa(i===360?0:i,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 hue extends H{constructor(e,t,i){super(),this.model=t,this.pixelRatio=i,this._onDidChange=new A,this.onDidChange=this._onDidChange.event,this._onColorFlushed=new A,this.onColorFlushed=this._onColorFlushed.event,this._domNode=eo(".saturation-wrap"),Y(e,this._domNode),this._canvas=document.createElement("canvas"),this._canvas.className="saturation-box",Y(this._domNode,this._canvas),this.selection=eo(".saturation-selection"),Y(this._domNode,this.selection),this.layout(),this._register($(this._domNode,ae.POINTER_DOWN,n=>this.onPointerDown(n))),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 Wp);const t=Ai(this._domNode);e.target!==this.selection&&this.onDidChangePosition(e.offsetX,e.offsetY),this.monitor.startMonitoring(e.target,e.pointerId,e.buttons,n=>this.onDidChangePosition(n.pageX-t.left,n.pageY-t.top),()=>null);const i=$(e.target.ownerDocument,ae.POINTER_UP,()=>{this._onColorFlushed.fire(),i.dispose(),this.monitor&&(this.monitor.stopMonitoring(!0),this.monitor=null)},!0)}onDidChangePosition(e,t){const i=Math.max(0,Math.min(1,e/this.width)),n=Math.max(0,Math.min(1,1-t/this.height));this.paintSelection(i,n),this._onDidChange.fire({s:i,v:n})}layout(){this.width=this._domNode.offsetWidth,this.height=this._domNode.offsetHeight,this._canvas.width=this.width*this.pixelRatio,this._canvas.height=this.height*this.pixelRatio,this.paint();const e=this.model.color.hsva;this.paintSelection(e.s,e.v)}paint(){const e=this.model.color.hsva,t=new V(new Pa(e.h,1,1,1)),i=this._canvas.getContext("2d"),n=i.createLinearGradient(0,0,this._canvas.width,0);n.addColorStop(0,"rgba(255, 255, 255, 1)"),n.addColorStop(.5,"rgba(255, 255, 255, 0.5)"),n.addColorStop(1,"rgba(255, 255, 255, 0)");const s=i.createLinearGradient(0,0,0,this._canvas.height);s.addColorStop(0,"rgba(0, 0, 0, 0)"),s.addColorStop(1,"rgba(0, 0, 0, 1)"),i.rect(0,0,this._canvas.width,this._canvas.height),i.fillStyle=V.Format.CSS.format(t),i.fill(),i.fillStyle=n,i.fill(),i.fillStyle=s,i.fill()}paintSelection(e,t){this.selection.style.left=`${e*this.width}px`,this.selection.style.top=`${this.height-t*this.height}px`}onDidChangeColor(e){if(this.monitor&&this.monitor.isMonitoring())return;this.paint();const t=e.hsva;this.paintSelection(t.s,t.v)}}class kW extends H{constructor(e,t,i=!1){super(),this.model=t,this._onDidChange=new A,this.onDidChange=this._onDidChange.event,this._onColorFlushed=new A,this.onColorFlushed=this._onColorFlushed.event,i?(this.domNode=Y(e,eo(".standalone-strip")),this.overlay=Y(this.domNode,eo(".standalone-overlay"))):(this.domNode=Y(e,eo(".strip")),this.overlay=Y(this.domNode,eo(".overlay"))),this.slider=Y(this.domNode,eo(".slider")),this.slider.style.top="0px",this._register($(this.domNode,ae.POINTER_DOWN,n=>this.onPointerDown(n))),this._register(t.onDidChangeColor(this.onDidChangeColor,this)),this.layout()}layout(){this.height=this.domNode.offsetHeight-this.slider.offsetHeight;const e=this.getValue(this.model.color);this.updateSliderPosition(e)}onDidChangeColor(e){const t=this.getValue(e);this.updateSliderPosition(t)}onPointerDown(e){if(!e.target||!(e.target instanceof Element))return;const t=this._register(new Wp),i=Ai(this.domNode);this.domNode.classList.add("grabbing"),e.target!==this.slider&&this.onDidChangeTop(e.offsetY),t.startMonitoring(e.target,e.pointerId,e.buttons,s=>this.onDidChangeTop(s.pageY-i.top),()=>null);const n=$(e.target.ownerDocument,ae.POINTER_UP,()=>{this._onColorFlushed.fire(),n.dispose(),t.stopMonitoring(!0),this.domNode.classList.remove("grabbing")},!0)}onDidChangeTop(e){const t=Math.max(0,Math.min(1,1-e/this.height));this.updateSliderPosition(t),this._onDidChange.fire(t)}updateSliderPosition(e){this.slider.style.top=`${(1-e)*this.height}px`}}class uue extends kW{constructor(e,t,i=!1){super(e,t,i),this.domNode.classList.add("opacity-strip"),this.onDidChangeColor(this.model.color)}onDidChangeColor(e){super.onDidChangeColor(e);const{r:t,g:i,b:n}=e.rgba,s=new V(new rt(t,i,n,1)),r=new V(new rt(t,i,n,0));this.overlay.style.background=`linear-gradient(to bottom, ${s} 0%, ${r} 100%)`}getValue(e){return e.hsva.a}}class fue extends kW{constructor(e,t,i=!1){super(e,t,i),this.domNode.classList.add("hue-strip")}getValue(e){return 1-e.hsva.h/360}}class gue extends H{constructor(e){super(),this._onClicked=this._register(new A),this.onClicked=this._onClicked.event,this._button=Y(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 pue extends fr{constructor(e,t,i,n,s=!1){super(),this.model=t,this.pixelRatio=i,this._register(q_.onDidChange(()=>this.layout()));const r=eo(".colorpicker-widget");e.appendChild(r),this.header=this._register(new lue(r,this.model,n,s)),this.body=this._register(new cue(r,this.model,this.pixelRatio,s))}layout(){this.body.layout()}}var IW=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},EW=function(o,e){return function(t,i){e(t,i,o)}},bp=function(o,e,t,i){function n(s){return s instanceof t?s:new t(function(r){r(s)})}return new(t||(t=Promise))(function(s,r){function a(c){try{d(i.next(c))}catch(h){r(h)}}function l(c){try{d(i.throw(c))}catch(h){r(h)}}function d(c){c.done?s(c.value):n(c.value).then(a,l)}d((i=i.apply(o,e||[])).next())})};class mue{constructor(e,t,i,n){this.owner=e,this.range=t,this.model=i,this.provider=n,this.forceShowAtRange=!0}isValidForHoverAnchor(e){return e.type===1&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}let Gw=class{constructor(e,t){this._editor=e,this._themeService=t,this.hoverOrdinal=2}computeSync(e,t){return[]}computeAsync(e,t,i){return ki.fromPromise(this._computeAsync(e,t,i))}_computeAsync(e,t,i){return bp(this,void 0,void 0,function*(){if(!this._editor.hasModel())return[];const n=Oc.get(this._editor);if(!n)return[];for(const s of t){if(!n.isColorDecoration(s))continue;const r=n.getColorData(s.range.getStartPosition());if(r)return[yield NW(this,this._editor.getModel(),r.colorInfo,r.provider)]}return[]})}renderHoverParts(e,t){return TW(this,this._editor,this._themeService,t,e)}};Gw=IW([EW(1,Ki)],Gw);class _ue{constructor(e,t,i,n){this.owner=e,this.range=t,this.model=i,this.provider=n}}let jv=class{constructor(e,t){this._editor=e,this._themeService=t,this._color=null}createColorHover(e,t,i){return bp(this,void 0,void 0,function*(){if(!this._editor.hasModel()||!Oc.get(this._editor))return null;const s=yield yW(i,this._editor.getModel(),Qe.None);let r=null,a=null;for(const h of s){const u=h.colorInfo;L.containsRange(u.range,e.range)&&(r=u,a=h.provider)}const l=r??e,d=a??t,c=!!r;return{colorHover:yield NW(this,this._editor.getModel(),l,d),foundInEditor:c}})}updateEditorModel(e){return bp(this,void 0,void 0,function*(){if(!this._editor.hasModel())return;const t=e.model;let i=new L(e.range.startLineNumber,e.range.startColumn,e.range.endLineNumber,e.range.endColumn);this._color&&(yield l1(this._editor.getModel(),t,this._color,i,e),i=RW(this._editor,i,t))})}renderHoverParts(e,t){return TW(this,this._editor,this._themeService,t,e)}set color(e){this._color=e}get color(){return this._color}};jv=IW([EW(1,Ki)],jv);function NW(o,e,t,i){return bp(this,void 0,void 0,function*(){const n=e.getValueInRange(t.range),{red:s,green:r,blue:a,alpha:l}=t.color,d=new rt(Math.round(s*255),Math.round(r*255),Math.round(a*255),l),c=new V(d),h=yield LW(e,t,i,Qe.None),u=new aue(c,[],0);return u.colorPresentations=h||[],u.guessColorPresentation(c,n),o instanceof Gw?new mue(o,L.lift(t.range),u,i):new _ue(o,L.lift(t.range),u,i)})}function TW(o,e,t,i,n){if(i.length===0||!e.hasModel())return H.None;if(n.setMinimumDimensions){const u=e.getOption(66)+8;n.setMinimumDimensions(new gt(302,u))}const s=new X,r=i[0],a=e.getModel(),l=r.model,d=s.add(new pue(n.fragment,l,e.getOption(141),t,o instanceof jv));n.setColorPicker(d);let c=!1,h=new L(r.range.startLineNumber,r.range.startColumn,r.range.endLineNumber,r.range.endColumn);if(o instanceof jv){const u=i[0].model.color;o.color=u,l1(a,l,u,h,r),s.add(l.onColorFlushed(f=>{o.color=f}))}else s.add(l.onColorFlushed(u=>bp(this,void 0,void 0,function*(){yield l1(a,l,u,h,r),c=!0,h=RW(e,h,l,n)})));return s.add(l.onDidChangeColor(u=>{l1(a,l,u,h,r)})),s.add(e.onDidChangeModelContent(u=>{c?c=!1:(n.hide(),e.focus())})),s}function RW(o,e,t,i){let n,s;if(t.presentation.textEdit){n=[t.presentation.textEdit],s=new L(t.presentation.textEdit.range.startLineNumber,t.presentation.textEdit.range.startColumn,t.presentation.textEdit.range.endLineNumber,t.presentation.textEdit.range.endColumn);const r=o.getModel()._setTrackedRange(null,s,3);o.pushUndoStop(),o.executeEdits("colorpicker",n),s=o.getModel()._getTrackedRange(r)||s}else n=[{range:e,text:t.presentation.label,forceMoveMarkers:!1}],s=e.setEndPosition(e.endLineNumber,e.startColumn+t.presentation.label.length),o.pushUndoStop(),o.executeEdits("colorpicker",n);return t.presentation.additionalTextEdits&&(n=[...t.presentation.additionalTextEdits],o.executeEdits("colorpicker",n),i&&i.hide()),o.pushUndoStop(),s}function l1(o,e,t,i,n){return bp(this,void 0,void 0,function*(){const s=yield LW(o,{range:i,color:{red:t.rgba.r/255,green:t.rgba.g/255,blue:t.rgba.b/255,alpha:t.rgba.a}},n.provider,Qe.None);e.colorPresentations=s||[]})}function LN(o,e){return!!o[e]}class mD{constructor(e,t){this.target=e.target,this.isLeftClick=e.event.leftButton,this.isMiddleClick=e.event.middleButton,this.isRightClick=e.event.rightButton,this.hasTriggerModifier=LN(e.event,t.triggerModifier),this.hasSideBySideModifier=LN(e.event,t.triggerSideBySideModifier),this.isNoneOrSingleMouseDown=e.event.detail<=1}}class r5{constructor(e,t){this.keyCodeIsTriggerKey=e.keyCode===t.triggerKey,this.keyCodeIsSideBySideKey=e.keyCode===t.triggerSideBySideKey,this.hasTriggerModifier=LN(e,t.triggerModifier)}}class sC{constructor(e,t,i,n){this.triggerKey=e,this.triggerModifier=t,this.triggerSideBySideKey=i,this.triggerSideBySideModifier=n}equals(e){return this.triggerKey===e.triggerKey&&this.triggerModifier===e.triggerModifier&&this.triggerSideBySideKey===e.triggerSideBySideKey&&this.triggerSideBySideModifier===e.triggerSideBySideModifier}}function a5(o){return o==="altKey"?at?new sC(57,"metaKey",6,"altKey"):new sC(5,"ctrlKey",6,"altKey"):at?new sC(6,"altKey",57,"metaKey"):new sC(6,"altKey",5,"ctrlKey")}class jy extends H{constructor(e,t){var i;super(),this._onMouseMoveOrRelevantKeyDown=this._register(new A),this.onMouseMoveOrRelevantKeyDown=this._onMouseMoveOrRelevantKeyDown.event,this._onExecute=this._register(new A),this.onExecute=this._onExecute.event,this._onCancel=this._register(new A),this.onCancel=this._onCancel.event,this._editor=e,this._extractLineNumberFromMouseEvent=(i=t?.extractLineNumberFromMouseEvent)!==null&&i!==void 0?i:n=>n.target.position?n.target.position.lineNumber:0,this._opts=a5(this._editor.getOption(77)),this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._lineNumberOnMouseDown=0,this._register(this._editor.onDidChangeConfiguration(n=>{if(n.hasChanged(77)){const s=a5(this._editor.getOption(77));if(this._opts.equals(s))return;this._opts=s,this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._lineNumberOnMouseDown=0,this._onCancel.fire()}})),this._register(this._editor.onMouseMove(n=>this._onEditorMouseMove(new mD(n,this._opts)))),this._register(this._editor.onMouseDown(n=>this._onEditorMouseDown(new mD(n,this._opts)))),this._register(this._editor.onMouseUp(n=>this._onEditorMouseUp(new mD(n,this._opts)))),this._register(this._editor.onKeyDown(n=>this._onEditorKeyDown(new r5(n,this._opts)))),this._register(this._editor.onKeyUp(n=>this._onEditorKeyUp(new r5(n,this._opts)))),this._register(this._editor.onMouseDrag(()=>this._resetHandler())),this._register(this._editor.onDidChangeCursorSelection(n=>this._onDidChangeCursorSelection(n))),this._register(this._editor.onDidChangeModel(n=>this._resetHandler())),this._register(this._editor.onDidChangeModelContent(()=>this._resetHandler())),this._register(this._editor.onDidScrollChange(n=>{(n.scrollTopChanged||n.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 vue=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},bl=function(o,e){return function(t,i){e(t,i,o)}};let Fc=class extends ap{constructor(e,t,i,n,s,r,a,l,d,c,h,u,f){super(e,Object.assign(Object.assign({},n.getRawOptions()),{overflowWidgetsDomNode:n.getOverflowWidgetsDomNode()}),i,s,r,a,l,d,c,h,u,f),this._parentEditor=n,this._overwriteOptions=t,super.updateOptions(this._overwriteOptions),this._register(n.onDidChangeConfiguration(p=>this._onParentConfigurationChanged(p)))}getParentEditor(){return this._parentEditor}_onParentConfigurationChanged(e){super.updateOptions(this._parentEditor.getRawOptions()),super.updateOptions(this._overwriteOptions)}updateOptions(e){wS(this._overwriteOptions,e,!0),super.updateOptions(this._overwriteOptions)}};Fc=vue([bl(4,Re),bl(5,_t),bl(6,li),bl(7,Ae),bl(8,Ki),bl(9,Li),bl(10,hd),bl(11,At),bl(12,pe)],Fc);const l5=new V(new rt(0,122,204)),bue={showArrow:!0,showFrame:!0,className:"",frameColor:l5,arrowColor:l5,keepEditorSelection:!1},Cue="vs.editor.contrib.zoneWidget";class wue{constructor(e,t,i,n,s,r,a,l){this.id="",this.domNode=e,this.afterLineNumber=t,this.afterColumn=i,this.heightInLines=n,this.showInHiddenAreas=a,this.ordinal=l,this._onDomNodeTop=s,this._onComputedHeight=r}onDomNodeTop(e){this._onDomNodeTop(e)}onComputedHeight(e){this._onComputedHeight(e)}}class Sue{constructor(e,t){this._id=e,this._domNode=t}getId(){return this._id}getDomNode(){return this._domNode}getPosition(){return null}}class Ky{constructor(e){this._editor=e,this._ruleName=Ky._IdGenerator.nextId(),this._decorations=this._editor.createDecorationsCollection(),this._color=null,this._height=-1}dispose(){this.hide(),eP(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(){eP(this._ruleName),Yk(`.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:L.fromPositions(e),options:{description:"zone-widget-arrow",className:this._ruleName,stickiness:1}}])}hide(){this._decorations.clear()}}Ky._IdGenerator=new FR(".arrow-decoration-");class yue{constructor(e,t={}){this._arrow=null,this._overlayWidget=null,this._resizeSash=null,this._viewZone=null,this._disposables=new X,this.container=null,this._isShowing=!1,this.editor=e,this._positionMarkerId=this.editor.createDecorationsCollection(),this.options=Il(t),wS(this.options,bue,!1),this.domNode=document.createElement("div"),this.options.isAccessible||(this.domNode.setAttribute("aria-hidden","true"),this.domNode.setAttribute("role","presentation")),this._disposables.add(this.editor.onDidLayoutChange(i=>{const n=this._getWidth(i);this.domNode.style.width=n+"px",this.domNode.style.left=this._getLeft(i)+"px",this._onWidth(n)}))}dispose(){this._overlayWidget&&(this.editor.removeOverlayWidget(this._overlayWidget),this._overlayWidget=null),this._viewZone&&this.editor.changeViewZones(e=>{this._viewZone&&e.removeZone(this._viewZone.id),this._viewZone=null}),this._positionMarkerId.clear(),this._disposables.dispose()}create(){this.domNode.classList.add("zone-widget"),this.options.className&&this.domNode.classList.add(this.options.className),this.container=document.createElement("div"),this.container.classList.add("zone-widget-container"),this.domNode.appendChild(this.container),this.options.showArrow&&(this._arrow=new Ky(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 i=e-this._decoratingElementsHeight();this.container.style.height=`${i}px`;const n=this.editor.getLayoutInfo();this._doLayout(i,this._getWidth(n))}(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 i=L.isIRange(e)?L.lift(e):L.fromPositions(e);this._isShowing=!0,this._showImpl(i,t),this._isShowing=!1,this._positionMarkerId.set([{range:i,options:Ve.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 i=Math.round(e/3);t+=2*i}if(this.options.showFrame){const i=Math.round(e/9);t+=2*i}return t}_showImpl(e,t){const i=e.getStartPosition(),n=this.editor.getLayoutInfo(),s=this._getWidth(n);this.domNode.style.width=`${s}px`,this.domNode.style.left=this._getLeft(n)+"px";const r=document.createElement("div");r.style.overflow="hidden";const a=this.editor.getOption(66);if(!this.options.allowUnlimitedHeight){const u=Math.max(12,this.editor.getLayoutInfo().height/a*.8);t=Math.min(t,u)}let l=0,d=0;if(this._arrow&&this.options.showArrow&&(l=Math.round(a/3),this._arrow.height=l,this._arrow.show(i)),this.options.showFrame&&(d=Math.round(a/9)),this.editor.changeViewZones(u=>{this._viewZone&&u.removeZone(this._viewZone.id),this._overlayWidget&&(this.editor.removeOverlayWidget(this._overlayWidget),this._overlayWidget=null),this.domNode.style.top="-1000px",this._viewZone=new wue(r,i.lineNumber,i.column,t,f=>this._onViewZoneTop(f),f=>this._onViewZoneHeight(f),this.options.showInHiddenAreas,this.options.ordinal),this._viewZone.id=u.addZone(this._viewZone),this._overlayWidget=new Sue(Cue+this._viewZone.id,this.domNode),this.editor.addOverlayWidget(this._overlayWidget)}),this.container&&this.options.showFrame){const u=this.options.frameWidth?this.options.frameWidth:d;this.container.style.borderTopWidth=u+"px",this.container.style.borderBottomWidth=u+"px"}const c=t*a-this._decoratingElementsHeight();this.container&&(this.container.style.top=l+"px",this.container.style.height=c+"px",this.container.style.overflow="hidden"),this._doLayout(c,s),this.options.keepEditorSelection||this.editor.setSelection(e);const h=this.editor.getModel();if(h){const u=h.validateRange(new L(e.startLineNumber,1,e.endLineNumber+1,1));this.revealRange(u,u.startLineNumber===h.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 Tn(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 i=(t.currentY-e.startY)/this.editor.getOption(66),n=i<0?Math.ceil(i):Math.floor(i),s=e.heightInLines+n;s>5&&s<35&&this._relayout(s)}}))}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 MW=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},AW=function(o,e){return function(t,i){e(t,i,o)}};const PW=et("IPeekViewService");dt(PW,class{constructor(){this._widgets=new Map}addExclusiveWidget(o,e){const t=this._widgets.get(o);t&&(t.listener.dispose(),t.widget.dispose());const i=()=>{const n=this._widgets.get(o);n&&n.widget===e&&(n.listener.dispose(),this._widgets.delete(o))};this._widgets.set(o,{widget:e,listener:e.onDidClose(i)})}},1);var Ss;(function(o){o.inPeekEditor=new ce("inReferenceSearchEditor",!0,g("inReferenceSearchEditor","Whether the current code editor is embedded inside peek")),o.notInPeekEditor=o.inPeekEditor.toNegated()})(Ss||(Ss={}));let Kv=class{constructor(e,t){e instanceof Fc&&Ss.inPeekEditor.bindTo(t)}dispose(){}};Kv.ID="editor.contrib.referenceController";Kv=MW([AW(1,Ae)],Kv);ft(Kv.ID,Kv,0);function Lue(o){const e=o.get(_t).getFocusedCodeEditor();return e instanceof Fc?e.getParentEditor():e}const xue={headerBackgroundColor:V.white,primaryHeadingColor:V.fromHex("#333333"),secondaryHeadingColor:V.fromHex("#6c6c6cb3")};let Zw=class extends yue{constructor(e,t,i){super(e,t),this.instantiationService=i,this._onDidClose=new A,this.onDidClose=this._onDidClose.event,wS(this.options,xue,!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=te(".head"),this._bodyElement=te(".body"),this._fillHead(this._headElement),this._fillBody(this._bodyElement),e.appendChild(this._headElement),e.appendChild(this._bodyElement)}_fillHead(e,t){this._titleElement=te(".peekview-title"),this.options.supportOnTitleClick&&(this._titleElement.classList.add("clickable"),wi(this._titleElement,"click",s=>this._onTitleClick(s))),Y(this._headElement,this._titleElement),this._fillTitleIcon(this._titleElement),this._primaryHeading=te("span.filename"),this._secondaryHeading=te("span.dirname"),this._metaHeading=te("span.meta"),Y(this._titleElement,this._primaryHeading,this._secondaryHeading,this._metaHeading);const i=te(".peekview-actions");Y(this._headElement,i);const n=this._getActionBarOptions();this._actionbarWidget=new Wo(i,n),this._disposables.add(this._actionbarWidget),t||this._actionbarWidget.push(new as("peekview.close",g("label.close","Close"),Ie.asClassName(oe.close),!0,()=>(this.dispose(),Promise.resolve())),{label:!1,icon:!0})}_fillTitleIcon(e){}_getActionBarOptions(){return{actionViewItemProvider:Lse.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:fn(this._secondaryHeading))}setMetaTitle(e){this._metaHeading&&(e?(this._metaHeading.innerText=e,Ts(this._metaHeading)):Jn(this._metaHeading))}_doLayout(e,t){if(!this._isShowing&&e<0){this.dispose();return}const i=Math.ceil(this.editor.getOption(66)*1.2),n=Math.round(e-(i+2));this._doLayoutHead(i,t),this._doLayoutBody(n,t)}_doLayoutHead(e,t){this._headElement&&(this._headElement.style.height=`${e}px`,this._headElement.style.lineHeight=this._headElement.style.height)}_doLayoutBody(e,t){this._bodyElement&&(this._bodyElement.style.height=`${e}px`)}};Zw=MW([AW(2,Re)],Zw);const Due=T("peekViewTitle.background",{dark:"#252526",light:"#F3F3F3",hcDark:V.black,hcLight:V.white},g("peekViewTitleBackground","Background color of the peek view title area.")),OW=T("peekViewTitleLabel.foreground",{dark:V.white,light:V.black,hcDark:V.white,hcLight:er},g("peekViewTitleForeground","Color of the peek view title.")),FW=T("peekViewTitleDescription.foreground",{dark:"#ccccccb3",light:"#616161",hcDark:"#FFFFFF99",hcLight:"#292929"},g("peekViewTitleInfoForeground","Color of the peek view title info.")),kue=T("peekView.border",{dark:bs,light:bs,hcDark:nt,hcLight:nt},g("peekViewBorder","Color of the peek view borders and arrow.")),Iue=T("peekViewResult.background",{dark:"#252526",light:"#F3F3F3",hcDark:V.black,hcLight:V.white},g("peekViewResultsBackground","Background color of the peek view result list."));T("peekViewResult.lineForeground",{dark:"#bbbbbb",light:"#646465",hcDark:V.white,hcLight:er},g("peekViewResultsMatchForeground","Foreground color for line nodes in the peek view result list."));T("peekViewResult.fileForeground",{dark:V.white,light:"#1E1E1E",hcDark:V.white,hcLight:er},g("peekViewResultsFileForeground","Foreground color for file nodes in the peek view result list."));T("peekViewResult.selectionBackground",{dark:"#3399ff33",light:"#3399ff33",hcDark:null,hcLight:null},g("peekViewResultsSelectionBackground","Background color of the selected entry in the peek view result list."));T("peekViewResult.selectionForeground",{dark:V.white,light:"#6C6C6C",hcDark:V.white,hcLight:er},g("peekViewResultsSelectionForeground","Foreground color of the selected entry in the peek view result list."));const Qd=T("peekViewEditor.background",{dark:"#001F33",light:"#F2F8FC",hcDark:V.black,hcLight:V.white},g("peekViewEditorBackground","Background color of the peek view editor."));T("peekViewEditorGutter.background",{dark:Qd,light:Qd,hcDark:Qd,hcLight:Qd},g("peekViewEditorGutterBackground","Background color of the gutter in the peek view editor."));T("peekViewEditorStickyScroll.background",{dark:Qd,light:Qd,hcDark:Qd,hcLight:Qd},g("peekViewEditorStickScrollBackground","Background color of sticky scroll in the peek view editor."));T("peekViewResult.matchHighlightBackground",{dark:"#ea5c004d",light:"#ea5c004d",hcDark:null,hcLight:null},g("peekViewResultsMatchHighlight","Match highlight color in the peek view result list."));T("peekViewEditor.matchHighlightBackground",{dark:"#ff8f0099",light:"#f5d802de",hcDark:null,hcLight:null},g("peekViewEditorMatchHighlight","Match highlight color in the peek view editor."));T("peekViewEditor.matchHighlightBorder",{dark:null,light:null,hcDark:Ut,hcLight:Ut},g("peekViewEditorMatchHighlightBorder","Match highlight border in the peek view editor."));var Eue=function(o,e,t,i){function n(s){return s instanceof t?s:new t(function(r){r(s)})}return new(t||(t=Promise))(function(s,r){function a(c){try{d(i.next(c))}catch(h){r(h)}}function l(c){try{d(i.throw(c))}catch(h){r(h)}}function d(c){c.done?s(c.value):n(c.value).then(a,l)}d((i=i.apply(o,e||[])).next())})};class Bc{constructor(e,t,i,n){this.isProviderFirst=e,this.parent=t,this.link=i,this._rangeCallback=n,this.id=aE.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?g({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,Bo(this.uri),this.range.startLineNumber,this.range.startColumn):g("aria.oneReference","in {0} on line {1} at column {2}",Bo(this.uri),this.range.startLineNumber,this.range.startColumn)}}class Nue{constructor(e){this._modelReference=e}dispose(){this._modelReference.dispose()}preview(e,t=8){const i=this._modelReference.object.textEditorModel;if(!i)return;const{startLineNumber:n,startColumn:s,endLineNumber:r,endColumn:a}=e,l=i.getWordUntilPosition({lineNumber:n,column:s-t}),d=new L(n,l.startColumn,n,s),c=new L(r,a,r,1073741824),h=i.getValueInRange(d).replace(/^\s+/,""),u=i.getValueInRange(e),f=i.getValueInRange(c).replace(/\s+$/,"");return{value:h+u+f,highlight:{start:h.length,end:h.length+u.length}}}}class qv{constructor(e,t){this.parent=e,this.uri=t,this.children=[],this._previews=new Pn}dispose(){St(this._previews.values()),this._previews.clear()}getPreview(e){return this._previews.get(e.uri)}get ariaMessage(){const e=this.children.length;return e===1?g("aria.fileReferences.1","1 symbol in {0}, full path {1}",Bo(this.uri),this.uri.fsPath):g("aria.fileReferences.N","{0} symbols in {1}, full path {2}",e,Bo(this.uri),this.uri.fsPath)}resolve(e){return Eue(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 i=yield e.createModelReference(t.uri);this._previews.set(t.uri,new Nue(i))}catch(i){He(i)}return this})}}class Bs{constructor(e,t){this.groups=[],this.references=[],this._onDidChangeReferenceRange=new A,this.onDidChangeReferenceRange=this._onDidChangeReferenceRange.event,this._links=e,this._title=t;const[i]=e;e.sort(Bs._compareReferences);let n;for(const s of e)if((!n||!$t.isEqual(n.uri,s.uri,!0))&&(n=new qv(this,s.uri),this.groups.push(n)),n.children.length===0||Bs._compareReferences(s,n.children[n.children.length-1])!==0){const r=new Bc(i===s,n,s,a=>this._onDidChangeReferenceRange.fire(a));this.references.push(r),n.children.push(r)}}dispose(){St(this.groups),this._onDidChangeReferenceRange.dispose(),this.groups.length=0}clone(){return new Bs(this._links,this._title)}get title(){return this._title}get isEmpty(){return this.groups.length===0}get ariaMessage(){return this.isEmpty?g("aria.result.0","No results found"):this.references.length===1?g("aria.result.1","Found 1 symbol in {0}",this.references[0].uri.fsPath):this.groups.length===1?g("aria.result.n1","Found {0} symbols in {1}",this.references.length,this.groups[0].uri.fsPath):g("aria.result.nm","Found {0} symbols in {1} files",this.references.length,this.groups.length)}nextOrPreviousReference(e,t){const{parent:i}=e;let n=i.children.indexOf(e);const s=i.children.length,r=i.parent.groups.length;return r===1||t&&n+1<s||!t&&n>0?(t?n=(n+1)%s:n=(n+s-1)%s,i.children[n]):(n=i.parent.groups.indexOf(i),t?(n=(n+1)%r,i.parent.groups[n].children[0]):(n=(n+r-1)%r,i.parent.groups[n].children[i.parent.groups[n].children.length-1]))}nearestReference(e,t){const i=this.references.map((n,s)=>({idx:s,prefixLen:hu(n.uri.toString(),e.toString()),offsetDist:Math.abs(n.range.startLineNumber-t.lineNumber)*100+Math.abs(n.range.startColumn-t.column)})).sort((n,s)=>n.prefixLen>s.prefixLen?-1:n.prefixLen<s.prefixLen?1:n.offsetDist<s.offsetDist?-1:n.offsetDist>s.offsetDist?1:0)[0];if(i)return this.references[i.idx]}referenceAt(e,t){for(const i of this.references)if(i.uri.toString()===e.toString()&&L.containsPosition(i.range,t))return i}firstReference(){for(const e of this.references)if(e.isProviderFirst)return e;return this.references[0]}static _compareReferences(e,t){return $t.compare(e.uri,t.uri)||L.compareRangesUsingStarts(e.range,t.range)}}var qy=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Gy=function(o,e){return function(t,i){e(t,i,o)}},xN;let DN=class{constructor(e){this._resolverService=e}hasChildren(e){return e instanceof Bs||e instanceof qv}getChildren(e){if(e instanceof Bs)return e.groups;if(e instanceof qv)return e.resolve(this._resolverService).then(t=>t.children);throw new Error("bad tree")}};DN=qy([Gy(0,Ls)],DN);class Tue{getHeight(){return 23}getTemplateId(e){return e instanceof qv?Gv.id:J0.id}}let kN=class{constructor(e){this._keybindingService=e}getKeyboardNavigationLabel(e){var t;if(e instanceof Bc){const i=(t=e.parent.getPreview(e))===null||t===void 0?void 0:t.preview(e.range);if(i)return i.value}return Bo(e.uri)}};kN=qy([Gy(0,Nt)],kN);class Rue{getId(e){return e instanceof Bc?e.id:e.uri}}let IN=class extends H{constructor(e,t){super(),this._labelService=t;const i=document.createElement("div");i.classList.add("reference-file"),this.file=this._register(new Mw(i,{supportHighlights:!0})),this.badge=new TE(Y(i,te(".count")),{},LB),e.appendChild(i)}set(e,t){const i=oy(e.uri);this.file.setLabel(this._labelService.getUriBasenameLabel(e.uri),this._labelService.getUriLabel(i,{relative:!0}),{title:this._labelService.getUriLabel(e.uri),matches:t});const n=e.children.length;this.badge.setCount(n),n>1?this.badge.setTitleFormat(g("referencesCount","{0} references",n)):this.badge.setTitleFormat(g("referenceCount","{0} reference",n))}};IN=qy([Gy(1,lp)],IN);let Gv=xN=class{constructor(e){this._instantiationService=e,this.templateId=xN.id}renderTemplate(e){return this._instantiationService.createInstance(IN,e)}renderElement(e,t,i){i.set(e.element,B0(e.filterData))}disposeTemplate(e){e.dispose()}};Gv.id="FileReferencesRenderer";Gv=xN=qy([Gy(0,Re)],Gv);class Mue{constructor(e){this.label=new hc(e)}set(e,t){var i;const n=(i=e.parent.getPreview(e))===null||i===void 0?void 0:i.preview(e.range);if(!n||!n.value)this.label.set(`${Bo(e.uri)}:${e.range.startLineNumber+1}:${e.range.startColumn+1}`);else{const{value:s,highlight:r}=n;t&&!Yr.isDefault(t)?(this.label.element.classList.toggle("referenceMatch",!1),this.label.set(s,B0(t))):(this.label.element.classList.toggle("referenceMatch",!0),this.label.set(s,[r]))}}}class J0{constructor(){this.templateId=J0.id}renderTemplate(e){return new Mue(e)}renderElement(e,t,i){i.set(e.element,e.filterData)}disposeTemplate(){}}J0.id="OneReferenceRenderer";class Aue{getWidgetAriaLabel(){return g("treeAriaLabel","References")}getAriaLabel(e){return e.ariaMessage}}var Pue=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Cl=function(o,e){return function(t,i){e(t,i,o)}},d5=function(o,e,t,i){function n(s){return s instanceof t?s:new t(function(r){r(s)})}return new(t||(t=Promise))(function(s,r){function a(c){try{d(i.next(c))}catch(h){r(h)}}function l(c){try{d(i.throw(c))}catch(h){r(h)}}function d(c){c.done?s(c.value):n(c.value).then(a,l)}d((i=i.apply(o,e||[])).next())})};class Zy{constructor(e,t){this._editor=e,this._model=t,this._decorations=new Map,this._decorationIgnoreSet=new Set,this._callOnDispose=new X,this._callOnModelChange=new X,this._callOnDispose.add(this._editor.onDidChangeModel(()=>this._onModelChanged())),this._onModelChanged()}dispose(){this._callOnModelChange.dispose(),this._callOnDispose.dispose(),this.removeDecorations()}_onModelChanged(){this._callOnModelChange.clear();const e=this._editor.getModel();if(e){for(const t of this._model.references)if(t.uri.toString()===e.uri.toString()){this._addDecorations(t.parent);return}}}_addDecorations(e){if(!this._editor.hasModel())return;this._callOnModelChange.add(this._editor.getModel().onDidChangeDecorations(()=>this._onDecorationChanged()));const t=[],i=[];for(let n=0,s=e.children.length;n<s;n++){const r=e.children[n];this._decorationIgnoreSet.has(r.id)||r.uri.toString()===this._editor.getModel().uri.toString()&&(t.push({range:r.range,options:Zy.DecorationOptions}),i.push(n))}this._editor.changeDecorations(n=>{const s=n.deltaDecorations([],t);for(let r=0;r<s.length;r++)this._decorations.set(s[r],e.children[i[r]])})}_onDecorationChanged(){const e=[],t=this._editor.getModel();if(t){for(const[i,n]of this._decorations){const s=t.getDecorationRange(i);if(!s)continue;let r=!1;if(!L.equalsRange(s,n.range)){if(L.spansMultipleLines(s))r=!0;else{const a=n.range.endColumn-n.range.startColumn,l=s.endColumn-s.startColumn;a!==l&&(r=!0)}r?(this._decorationIgnoreSet.add(n.id),e.push(i)):n.range=s}}for(let i=0,n=e.length;i<n;i++)this._decorations.delete(e[i]);this._editor.removeDecorations(e)}}removeDecorations(){this._editor.removeDecorations([...this._decorations.keys()]),this._decorations.clear()}}Zy.DecorationOptions=Ve.register({description:"reference-decoration",stickiness:1,className:"reference-decoration"});class Oue{constructor(){this.ratio=.7,this.heightInLines=18}static fromJSON(e){let t,i;try{const n=JSON.parse(e);t=n.ratio,i=n.heightInLines}catch{}return{ratio:t||.7,heightInLines:i||18}}}class Fue extends kE{}let EN=class extends Zw{constructor(e,t,i,n,s,r,a,l,d,c,h,u){super(e,{showFrame:!1,showArrow:!0,isResizeable:!0,isAccessible:!0,supportOnTitleClick:!0},r),this._defaultTreeKeyboardSupport=t,this.layoutData=i,this._textModelResolverService=s,this._instantiationService=r,this._peekViewService=a,this._uriLabel=l,this._undoRedoService=d,this._keybindingService=c,this._languageService=h,this._languageConfigurationService=u,this._disposeOnNewModel=new X,this._callOnDispose=new X,this._onDidSelectReference=new A,this.onDidSelectReference=this._onDidSelectReference.event,this._dim=new gt(0,0),this._applyTheme(n.getColorTheme()),this._callOnDispose.add(n.onDidColorThemeChange(this._applyTheme.bind(this))),this._peekViewService.addExclusiveWidget(e,this),this.create()}dispose(){this.setModel(void 0),this._callOnDispose.dispose(),this._disposeOnNewModel.dispose(),St(this._preview),St(this._previewNotAvailableMessage),St(this._tree),St(this._previewModelReference),this._splitView.dispose(),super.dispose()}_applyTheme(e){const t=e.getColor(kue)||V.transparent;this.style({arrowColor:t,frameColor:t,headerBackgroundColor:e.getColor(Due)||V.transparent,primaryHeadingColor:e.getColor(OW),secondaryHeadingColor:e.getColor(FW)})}show(e){super.show(e,this.layoutData.heightInLines||18)}focusOnReferenceTree(){this._tree.domFocus()}focusOnPreviewEditor(){this._preview.focus()}isPreviewEditorFocused(){return this._preview.hasTextFocus()}_onTitleClick(e){this._preview&&this._preview.getModel()&&this._onDidSelectReference.fire({element:this._getFocusedReference(),kind:e.ctrlKey||e.metaKey||e.altKey?"side":"open",source:"title"})}_fillBody(e){this.setCssClass("reference-zone-widget"),this._messageContainer=Y(e,te("div.messages")),Jn(this._messageContainer),this._splitView=new NB(e,{orientation:1}),this._previewContainer=Y(e,te("div.preview.inline"));const t={scrollBeyondLastLine:!1,scrollbar:{verticalScrollbarSize:14,horizontal:"auto",useShadows:!0,verticalHasArrows:!1,horizontalHasArrows:!1,alwaysConsumeMouseWheel:!0},overviewRulerLanes:2,fixedOverflowWidgets:!0,minimap:{enabled:!1}};this._preview=this._instantiationService.createInstance(Fc,this._previewContainer,t,{},this.editor),Jn(this._previewContainer),this._previewNotAvailableMessage=new il(g("missingPreviewMessage","no preview available"),ro,il.DEFAULT_CREATION_OPTIONS,null,this._undoRedoService,this._languageService,this._languageConfigurationService),this._treeContainer=Y(e,te("div.ref-tree.inline"));const i={keyboardSupport:this._defaultTreeKeyboardSupport,accessibilityProvider:new Aue,keyboardNavigationLabelProvider:this._instantiationService.createInstance(kN),identityProvider:new Rue,openOnSingleClick:!0,selectionNavigation:!0,overrideStyles:{listBackground:Iue}};this._defaultTreeKeyboardSupport&&this._callOnDispose.add(wi(this._treeContainer,"keydown",s=>{s.equals(9)&&(this._keybindingService.dispatchEvent(s,s.target),s.stopPropagation())},!0)),this._tree=this._instantiationService.createInstance(Fue,"ReferencesWidget",this._treeContainer,new Tue,[this._instantiationService.createInstance(Gv),this._instantiationService.createInstance(J0)],this._instantiationService.createInstance(DN),i),this._splitView.addView({onDidChange:de.None,element:this._previewContainer,minimumSize:200,maximumSize:Number.MAX_VALUE,layout:s=>{this._preview.layout({height:this._dim.height,width:s})}},Ew.Distribute),this._splitView.addView({onDidChange:de.None,element:this._treeContainer,minimumSize:100,maximumSize:Number.MAX_VALUE,layout:s=>{this._treeContainer.style.height=`${this._dim.height}px`,this._treeContainer.style.width=`${s}px`,this._tree.layout(this._dim.height,s)}},Ew.Distribute),this._disposables.add(this._splitView.onDidSashChange(()=>{this._dim.width&&(this.layoutData.ratio=this._splitView.getViewSize(0)/this._dim.width)},void 0));const n=(s,r)=>{s instanceof Bc&&(r==="show"&&this._revealReference(s,!1),this._onDidSelectReference.fire({element:s,kind:r,source:"tree"}))};this._tree.onDidOpen(s=>{s.sideBySide?n(s.element,"side"):s.editorOptions.pinned?n(s.element,"goto"):n(s.element,"show")}),Jn(this._treeContainer)}_onWidth(e){this._dim&&this._doLayoutBody(this._dim.height,e)}_doLayoutBody(e,t){super._doLayoutBody(e,t),this._dim=new gt(t,e),this.layoutData.heightInLines=this._viewZone?this._viewZone.heightInLines:this.layoutData.heightInLines,this._splitView.layout(t),this._splitView.resizeView(0,t*this.layoutData.ratio)}setSelection(e){return this._revealReference(e,!0).then(()=>{this._model&&(this._tree.setSelection([e]),this._tree.setFocus([e]))})}setModel(e){return this._disposeOnNewModel.clear(),this._model=e,this._model?this._onNewModel():Promise.resolve()}_onNewModel(){return this._model?this._model.isEmpty?(this.setTitle(""),this._messageContainer.innerText=g("noResults","No results"),Ts(this._messageContainer),Promise.resolve(void 0)):(Jn(this._messageContainer),this._decorationsManager=new Zy(this._preview,this._model),this._disposeOnNewModel.add(this._decorationsManager),this._disposeOnNewModel.add(this._model.onDidChangeReferenceRange(e=>this._tree.rerender(e))),this._disposeOnNewModel.add(this._preview.onMouseDown(e=>{const{event:t,target:i}=e;if(t.detail!==2)return;const n=this._getFocusedReference();n&&this._onDidSelectReference.fire({element:{uri:n.uri,range:i.range},kind:t.ctrlKey||t.metaKey||t.altKey?"side":"open",source:"editor"})})),this.container.classList.add("results-loaded"),Ts(this._treeContainer),Ts(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 Bc)return e;if(e instanceof qv&&e.children.length>0)return e.children[0]}revealReference(e){return d5(this,void 0,void 0,function*(){yield this._revealReference(e,!1),this._onDidSelectReference.fire({element:e,kind:"goto",source:"tree"})})}_revealReference(e,t){return d5(this,void 0,void 0,function*(){if(this._revealedReference===e)return;this._revealedReference=e,e.uri.scheme!==qe.inMemory?this.setTitle(uJ(e.uri),this._uriLabel.getUriLabel(oy(e.uri))):this.setTitle(g("peekView.alternateTitle","References"));const i=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 n=yield i;if(!this._model){n.dispose();return}St(this._previewModelReference);const s=n.object;if(s){const r=this._preview.getModel()===s.textEditorModel?0:1,a=L.lift(e.range).collapseToStart();this._previewModelReference=n,this._preview.setModel(s.textEditorModel),this._preview.setSelection(a),this._preview.revealRangeInCenter(a,r)}else this._preview.setModel(this._previewNotAvailableMessage),n.dispose()})}};EN=Pue([Cl(3,Ki),Cl(4,Ls),Cl(5,Re),Cl(6,PW),Cl(7,lp),Cl(8,ry),Cl(9,Nt),Cl(10,qt),Cl(11,At)],EN);var Bue=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},yf=function(o,e){return function(t,i){e(t,i,o)}},c5=function(o,e,t,i){function n(s){return s instanceof t?s:new t(function(r){r(s)})}return new(t||(t=Promise))(function(s,r){function a(c){try{d(i.next(c))}catch(h){r(h)}}function l(c){try{d(i.throw(c))}catch(h){r(h)}}function d(c){c.done?s(c.value):n(c.value).then(a,l)}d((i=i.apply(o,e||[])).next())})},d1;const rf=new ce("referenceSearchVisible",!1,g("referenceSearchVisible","Whether reference peek is visible, like 'Peek References' or 'Peek Definition'"));let Wc=d1=class{static get(e){return e.getContribution(d1.ID)}constructor(e,t,i,n,s,r,a,l){this._defaultTreeKeyboardSupport=e,this._editor=t,this._editorService=n,this._notificationService=s,this._instantiationService=r,this._storageService=a,this._configurationService=l,this._disposables=new X,this._requestIdPool=0,this._ignoreModelChangeEvent=!1,this._referenceSearchVisible=rf.bindTo(i)}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,i){let n;if(this._widget&&(n=this._widget.position),this.closeWidget(),n&&e.containsPosition(n))return;this._peekMode=i,this._referenceSearchVisible.set(!0),this._disposables.add(this._editor.onDidChangeModelLanguage(()=>{this.closeWidget()})),this._disposables.add(this._editor.onDidChangeModel(()=>{this._ignoreModelChangeEvent||this.closeWidget()}));const s="peekViewLayout",r=Oue.fromJSON(this._storageService.get(s,0,"{}"));this._widget=this._instantiationService.createInstance(EN,this._editor,this._defaultTreeKeyboardSupport,r),this._widget.setTitle(g("labelLoading","Loading...")),this._widget.show(e),this._disposables.add(this._widget.onDidClose(()=>{t.cancel(),this._widget&&(this._storageService.store(s,JSON.stringify(this._widget.layoutData),0,1),this._widget=void 0),this.closeWidget()})),this._disposables.add(this._widget.onDidSelectReference(l=>{const{element:d,kind:c}=l;if(d)switch(c){case"open":(l.source!=="editor"||!this._configurationService.getValue("editor.stablePeek"))&&this.openReference(d,!1,!1);break;case"side":this.openReference(d,!0,!1);break;case"goto":i?this._gotoReference(d,!0):this.openReference(d,!1,!0);break}}));const a=++this._requestIdPool;t.then(l=>{var d;if(a!==this._requestIdPool||!this._widget){l.dispose();return}return(d=this._model)===null||d===void 0||d.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(g("metaTitle.N","{0} ({1})",this._model.title,this._model.references.length));const c=this._editor.getModel().uri,h=new P(e.startLineNumber,e.startColumn),u=this._model.nearestReference(c,h);if(u)return this._widget.setSelection(u).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 c5(this,void 0,void 0,function*(){if(!this._editor.hasModel()||!this._model||!this._widget)return;const t=this._widget.position;if(!t)return;const i=this._model.nearestReference(this._editor.getModel().uri,t);if(!i)return;const n=this._model.nextOrPreviousReference(i,e),s=this._editor.hasTextFocus(),r=this._widget.isPreviewEditorFocused();yield this._widget.setSelection(n),yield this._gotoReference(n,!1),s?this._editor.focus():this._widget&&r&&this._widget.focusOnPreviewEditor()})}revealReference(e){return c5(this,void 0,void 0,function*(){!this._editor.hasModel()||!this._model||!this._widget||(yield this._widget.revealReference(e))})}closeWidget(e=!0){var t,i;(t=this._widget)===null||t===void 0||t.dispose(),(i=this._model)===null||i===void 0||i.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 i;(i=this._widget)===null||i===void 0||i.hide(),this._ignoreModelChangeEvent=!0;const n=L.lift(e.range).collapseToStart();return this._editorService.openCodeEditor({resource:e.uri,options:{selection:n,selectionSource:"code.jump",pinned:t}},this._editor).then(s=>{var r;if(this._ignoreModelChangeEvent=!1,!s||!this._widget){this.closeWidget();return}if(this._editor===s)this._widget.show(n),this._widget.focusOnReferenceTree();else{const a=d1.get(s),l=this._model.clone();this.closeWidget(),s.focus(),a?.toggleWidget(n,Wi(d=>Promise.resolve(l)),(r=this._peekMode)!==null&&r!==void 0?r:!1)}},s=>{this._ignoreModelChangeEvent=!1,He(s)})}openReference(e,t,i){t||this.closeWidget();const{uri:n,range:s}=e;this._editorService.openCodeEditor({resource:n,options:{selection:s,selectionSource:"code.jump",pinned:i}},this._editor,t)}};Wc.ID="editor.contrib.referencesController";Wc=d1=Bue([yf(2,Ae),yf(3,_t),yf(4,Li),yf(5,Re),yf(6,_r),yf(7,st)],Wc);function af(o,e){const t=Lue(o);if(!t)return;const i=Wc.get(t);i&&e(i)}ws.registerCommandAndKeybindingRule({id:"togglePeekWidgetFocus",weight:100,primary:Pi(2089,60),when:Z.or(rf,Ss.inPeekEditor),handler(o){af(o,e=>{e.changeFocusBetweenPreviewAndReferences()})}});ws.registerCommandAndKeybindingRule({id:"goToNextReference",weight:90,primary:62,secondary:[70],when:Z.or(rf,Ss.inPeekEditor),handler(o){af(o,e=>{e.goToNextOrPreviousReference(!0)})}});ws.registerCommandAndKeybindingRule({id:"goToPreviousReference",weight:90,primary:1086,secondary:[1094],when:Z.or(rf,Ss.inPeekEditor),handler(o){af(o,e=>{e.goToNextOrPreviousReference(!1)})}});lt.registerCommandAlias("goToNextReferenceFromEmbeddedEditor","goToNextReference");lt.registerCommandAlias("goToPreviousReferenceFromEmbeddedEditor","goToPreviousReference");lt.registerCommandAlias("closeReferenceSearchEditor","closeReferenceSearch");lt.registerCommand("closeReferenceSearch",o=>af(o,e=>e.closeWidget()));ws.registerKeybindingRule({id:"closeReferenceSearch",weight:-1,primary:9,secondary:[1033],when:Z.and(Ss.inPeekEditor,Z.not("config.editor.stablePeek"))});ws.registerKeybindingRule({id:"closeReferenceSearch",weight:250,primary:9,secondary:[1033],when:Z.and(rf,Z.not("config.editor.stablePeek"))});ws.registerCommandAndKeybindingRule({id:"revealReference",weight:200,primary:3,mac:{primary:3,secondary:[2066]},when:Z.and(rf,jB,JR.negate(),eM.negate()),handler(o){var e;const i=(e=o.get(Uo).lastFocusedList)===null||e===void 0?void 0:e.getFocus();Array.isArray(i)&&i[0]instanceof Bc&&af(o,n=>n.revealReference(i[0]))}});ws.registerCommandAndKeybindingRule({id:"openReferenceToSide",weight:100,primary:2051,mac:{primary:259},when:Z.and(rf,jB,JR.negate(),eM.negate()),handler(o){var e;const i=(e=o.get(Uo).lastFocusedList)===null||e===void 0?void 0:e.getFocus();Array.isArray(i)&&i[0]instanceof Bc&&af(o,n=>n.openReference(i[0],!0,!0))}});lt.registerCommand("openReference",o=>{var e;const i=(e=o.get(Uo).lastFocusedList)===null||e===void 0?void 0:e.getFocus();Array.isArray(i)&&i[0]instanceof Bc&&af(o,n=>n.openReference(i[0],!1,!0))});var BW=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Jm=function(o,e){return function(t,i){e(t,i,o)}};const RM=new ce("hasSymbols",!1,g("hasSymbols","Whether there are symbol locations that can be navigated via keyboard-only.")),Yy=et("ISymbolNavigationService");let NN=class{constructor(e,t,i,n){this._editorService=t,this._notificationService=i,this._keybindingService=n,this._currentModel=void 0,this._currentIdx=-1,this._ignoreEditorChange=!1,this._ctxHasSymbols=RM.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 i=new TN(this._editorService),n=i.onDidChange(s=>{if(this._ignoreEditorChange)return;const r=this._editorService.getActiveCodeEditor();if(!r)return;const a=r.getModel(),l=r.getPosition();if(!a||!l)return;let d=!1,c=!1;for(const h of t.references)if(lR(h.uri,a.uri))d=!0,c=c||L.containsPosition(h.range,l);else if(d)break;(!d||!c)&&this.reset()});this._currentState=or(i,n)}revealNext(e){if(!this._currentModel)return Promise.resolve();this._currentIdx+=1,this._currentIdx%=this._currentModel.references.length;const t=this._currentModel.references[this._currentIdx];return this._showMessage(),this._ignoreEditorChange=!0,this._editorService.openCodeEditor({resource:t.uri,options:{selection:L.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"),i=t?g("location.kb","Symbol {0} of {1}, {2} for next",this._currentIdx+1,this._currentModel.references.length,t.getLabel()):g("location","Symbol {0} of {1}",this._currentIdx+1,this._currentModel.references.length);this._currentMessage=this._notificationService.status(i)}};NN=BW([Jm(0,Ae),Jm(1,_t),Jm(2,Li),Jm(3,Nt)],NN);dt(Yy,NN,1);re(new class extends tn{constructor(){super({id:"editor.gotoNextSymbolFromResult",precondition:RM,kbOpts:{weight:100,primary:70}})}runEditorCommand(o,e){return o.get(Yy).revealNext(e)}});ws.registerCommandAndKeybindingRule({id:"editor.gotoNextSymbolFromResult.cancel",weight:100,when:RM,primary:9,handler(o){o.get(Yy).reset()}});let TN=class{constructor(e){this._listener=new Map,this._disposables=new X,this._onDidChange=new A,this.onDidChange=this._onDidChange.event,this._disposables.add(e.onCodeEditorRemove(this._onDidRemoveEditor,this)),this._disposables.add(e.onCodeEditorAdd(this._onDidAddEditor,this)),e.listCodeEditors().forEach(this._onDidAddEditor,this)}dispose(){this._disposables.dispose(),this._onDidChange.dispose(),St(this._listener.values())}_onDidAddEditor(e){this._listener.set(e,or(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)}};TN=BW([Jm(0,_t)],TN);var MM=function(o,e,t,i){function n(s){return s instanceof t?s:new t(function(r){r(s)})}return new(t||(t=Promise))(function(s,r){function a(c){try{d(i.next(c))}catch(h){r(h)}}function l(c){try{d(i.throw(c))}catch(h){r(h)}}function d(c){c.done?s(c.value):n(c.value).then(a,l)}d((i=i.apply(o,e||[])).next())})};function eb(o,e,t,i){return MM(this,void 0,void 0,function*(){const s=t.ordered(o).map(a=>Promise.resolve(i(a,o,e)).then(void 0,l=>{Ni(l)})),r=yield Promise.all(s);return Za(r.flat())})}function Xy(o,e,t,i){return eb(e,t,o,(n,s,r)=>n.provideDefinition(s,r,i))}function WW(o,e,t,i){return eb(e,t,o,(n,s,r)=>n.provideDeclaration(s,r,i))}function VW(o,e,t,i){return eb(e,t,o,(n,s,r)=>n.provideImplementation(s,r,i))}function HW(o,e,t,i){return eb(e,t,o,(n,s,r)=>n.provideTypeDefinition(s,r,i))}function Qy(o,e,t,i,n){return eb(e,t,o,(s,r,a)=>MM(this,void 0,void 0,function*(){const l=yield s.provideReferences(r,a,{includeDeclaration:!0},n);if(!i||!l||l.length!==2)return l;const d=yield s.provideReferences(r,a,{includeDeclaration:!1},n);return d&&d.length===1?d:l}))}function tb(o){return MM(this,void 0,void 0,function*(){const e=yield o(),t=new Bs(e,""),i=t.references.map(n=>n.link);return t.dispose(),i})}hl("_executeDefinitionProvider",(o,e,t)=>{const i=o.get(pe),n=Xy(i.definitionProvider,e,t,Qe.None);return tb(()=>n)});hl("_executeTypeDefinitionProvider",(o,e,t)=>{const i=o.get(pe),n=HW(i.typeDefinitionProvider,e,t,Qe.None);return tb(()=>n)});hl("_executeDeclarationProvider",(o,e,t)=>{const i=o.get(pe),n=WW(i.declarationProvider,e,t,Qe.None);return tb(()=>n)});hl("_executeReferenceProvider",(o,e,t)=>{const i=o.get(pe),n=Qy(i.referenceProvider,e,t,!1,Qe.None);return tb(()=>n)});hl("_executeImplementationProvider",(o,e,t)=>{const i=o.get(pe),n=VW(i.implementationProvider,e,t,Qe.None);return tb(()=>n)});var lr=function(o,e,t,i){function n(s){return s instanceof t?s:new t(function(r){r(s)})}return new(t||(t=Promise))(function(s,r){function a(c){try{d(i.next(c))}catch(h){r(h)}}function l(c){try{d(i.throw(c))}catch(h){r(h)}}function d(c){c.done?s(c.value):n(c.value).then(a,l)}d((i=i.apply(o,e||[])).next())})},Lm,xm,Dm,oC,rC,aC,lC,dC;hn.appendMenuItem(k.EditorContext,{submenu:k.EditorContextPeek,title:g("peek.submenu","Peek"),group:"navigation",order:100});class Cp{static is(e){return!e||typeof e!="object"?!1:!!(e instanceof Cp||P.isIPosition(e.position)&&e.model)}constructor(e,t){this.model=e,this.position=t}}class qn extends ra{static all(){return qn._allSymbolNavigationCommands.values()}static _patchConfig(e){const t=Object.assign(Object.assign({},e),{f1:!0});if(t.menu)for(const i of Xe.wrap(t.menu))(i.id===k.EditorContext||i.id===k.EditorContextPeek)&&(i.when=Z.and(e.precondition,i.when));return t}constructor(e,t){super(qn._patchConfig(t)),this.configuration=e,qn._allSymbolNavigationCommands.set(t.id,this)}runEditorCommand(e,t,i,n){if(!t.hasModel())return Promise.resolve(void 0);const s=e.get(Li),r=e.get(_t),a=e.get(Jc),l=e.get(Yy),d=e.get(pe),c=e.get(Re),h=t.getModel(),u=t.getPosition(),f=Cp.is(i)?i:new Cp(h,u),p=new Ac(t,5),m=FS(this._getLocationModel(d,f.model,f.position,p.token),p.token).then(v=>lr(this,void 0,void 0,function*(){var _;if(!v||p.token.isCancellationRequested)return;On(v.ariaMessage);let b;if(v.referenceAt(h.uri,u)){const w=this._getAlternativeCommand(t);!qn._activeAlternativeCommands.has(w)&&qn._allSymbolNavigationCommands.has(w)&&(b=qn._allSymbolNavigationCommands.get(w))}const C=v.references.length;if(C===0){if(!this.configuration.muteMessage){const w=h.getWordAtPosition(u);(_=Fs.get(t))===null||_===void 0||_.showMessage(this._getNoResultFoundMessage(w),u)}}else if(C===1&&b)qn._activeAlternativeCommands.add(this.desc.id),c.invokeFunction(w=>b.runEditorCommand(w,t,i,n).finally(()=>{qn._activeAlternativeCommands.delete(this.desc.id)}));else return this._onResult(r,l,t,v,n)}),v=>{s.error(v)}).finally(()=>{p.dispose()});return a.showWhile(m,250),m}_onResult(e,t,i,n,s){return lr(this,void 0,void 0,function*(){const r=this._getGoToPreference(i);if(!(i instanceof Fc)&&(this.configuration.openInPeek||r==="peek"&&n.references.length>1))this._openInPeek(i,n,s);else{const a=n.firstReference(),l=n.references.length>1&&r==="gotoAndPeek",d=yield this._openReference(i,e,a,this.configuration.openToSide,!l);l&&d?this._openInPeek(d,n,s):n.dispose(),r==="goto"&&t.put(a)}})}_openReference(e,t,i,n,s){return lr(this,void 0,void 0,function*(){let r;if(TU(i)&&(r=i.targetSelectionRange),r||(r=i.range),!r)return;const a=yield t.openCodeEditor({resource:i.uri,options:{selection:L.collapseToStart(r),selectionRevealType:3,selectionSource:"code.jump"}},e,n);if(a){if(s){const l=a.getModel(),d=a.createDecorationsCollection([{range:r,options:{description:"symbol-navigate-action-highlight",className:"symbolHighlight"}}]);setTimeout(()=>{a.getModel()===l&&d.clear()},350)}return a}})}_openInPeek(e,t,i){const n=Wc.get(e);n&&e.hasModel()?n.toggleWidget(i??e.getSelection(),Wi(s=>Promise.resolve(t)),this.configuration.openInPeek):t.dispose()}}qn._allSymbolNavigationCommands=new Map;qn._activeAlternativeCommands=new Set;class ib extends qn{_getLocationModel(e,t,i,n){return lr(this,void 0,void 0,function*(){return new Bs(yield Xy(e.definitionProvider,t,i,n),g("def.title","Definitions"))})}_getNoResultFoundMessage(e){return e&&e.word?g("noResultWord","No definition found for '{0}'",e.word):g("generic.noResults","No definition found")}_getAlternativeCommand(e){return e.getOption(58).alternativeDefinitionCommand}_getGoToPreference(e){return e.getOption(58).multipleDefinitions}}jt((Lm=class extends ib{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:Lm.id,title:{value:g("actions.goToDecl.label","Go to Definition"),original:"Go to Definition",mnemonicTitle:g({key:"miGotoDefinition",comment:["&& denotes a mnemonic"]},"Go to &&Definition")},precondition:Z.and(E.hasDefinitionProvider,E.isInWalkThroughSnippet.toNegated()),keybinding:[{when:E.editorTextFocus,primary:70,weight:100},{when:Z.and(E.editorTextFocus,zB),primary:2118,weight:100}],menu:[{id:k.EditorContext,group:"navigation",order:1.1},{id:k.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:2}]}),lt.registerCommandAlias("editor.action.goToDeclaration",Lm.id)}},Lm.id="editor.action.revealDefinition",Lm));jt((xm=class extends ib{constructor(){super({openToSide:!0,openInPeek:!1,muteMessage:!1},{id:xm.id,title:{value:g("actions.goToDeclToSide.label","Open Definition to the Side"),original:"Open Definition to the Side"},precondition:Z.and(E.hasDefinitionProvider,E.isInWalkThroughSnippet.toNegated()),keybinding:[{when:E.editorTextFocus,primary:Pi(2089,70),weight:100},{when:Z.and(E.editorTextFocus,zB),primary:Pi(2089,2118),weight:100}]}),lt.registerCommandAlias("editor.action.openDeclarationToTheSide",xm.id)}},xm.id="editor.action.revealDefinitionAside",xm));jt((Dm=class extends ib{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:Dm.id,title:{value:g("actions.previewDecl.label","Peek Definition"),original:"Peek Definition"},precondition:Z.and(E.hasDefinitionProvider,Ss.notInPeekEditor,E.isInWalkThroughSnippet.toNegated()),keybinding:{when:E.editorTextFocus,primary:582,linux:{primary:3140},weight:100},menu:{id:k.EditorContextPeek,group:"peek",order:2}}),lt.registerCommandAlias("editor.action.previewDeclaration",Dm.id)}},Dm.id="editor.action.peekDefinition",Dm));class zW extends qn{_getLocationModel(e,t,i,n){return lr(this,void 0,void 0,function*(){return new Bs(yield WW(e.declarationProvider,t,i,n),g("decl.title","Declarations"))})}_getNoResultFoundMessage(e){return e&&e.word?g("decl.noResultWord","No declaration found for '{0}'",e.word):g("decl.generic.noResults","No declaration found")}_getAlternativeCommand(e){return e.getOption(58).alternativeDeclarationCommand}_getGoToPreference(e){return e.getOption(58).multipleDeclarations}}jt((oC=class extends zW{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:oC.id,title:{value:g("actions.goToDeclaration.label","Go to Declaration"),original:"Go to Declaration",mnemonicTitle:g({key:"miGotoDeclaration",comment:["&& denotes a mnemonic"]},"Go to &&Declaration")},precondition:Z.and(E.hasDeclarationProvider,E.isInWalkThroughSnippet.toNegated()),menu:[{id:k.EditorContext,group:"navigation",order:1.3},{id:k.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:3}]})}_getNoResultFoundMessage(e){return e&&e.word?g("decl.noResultWord","No declaration found for '{0}'",e.word):g("decl.generic.noResults","No declaration found")}},oC.id="editor.action.revealDeclaration",oC));jt(class extends zW{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:"editor.action.peekDeclaration",title:{value:g("actions.peekDecl.label","Peek Declaration"),original:"Peek Declaration"},precondition:Z.and(E.hasDeclarationProvider,Ss.notInPeekEditor,E.isInWalkThroughSnippet.toNegated()),menu:{id:k.EditorContextPeek,group:"peek",order:3}})}});class UW extends qn{_getLocationModel(e,t,i,n){return lr(this,void 0,void 0,function*(){return new Bs(yield HW(e.typeDefinitionProvider,t,i,n),g("typedef.title","Type Definitions"))})}_getNoResultFoundMessage(e){return e&&e.word?g("goToTypeDefinition.noResultWord","No type definition found for '{0}'",e.word):g("goToTypeDefinition.generic.noResults","No type definition found")}_getAlternativeCommand(e){return e.getOption(58).alternativeTypeDefinitionCommand}_getGoToPreference(e){return e.getOption(58).multipleTypeDefinitions}}jt((rC=class extends UW{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:rC.ID,title:{value:g("actions.goToTypeDefinition.label","Go to Type Definition"),original:"Go to Type Definition",mnemonicTitle:g({key:"miGotoTypeDefinition",comment:["&& denotes a mnemonic"]},"Go to &&Type Definition")},precondition:Z.and(E.hasTypeDefinitionProvider,E.isInWalkThroughSnippet.toNegated()),keybinding:{when:E.editorTextFocus,primary:0,weight:100},menu:[{id:k.EditorContext,group:"navigation",order:1.4},{id:k.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:3}]})}},rC.ID="editor.action.goToTypeDefinition",rC));jt((aC=class extends UW{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:aC.ID,title:{value:g("actions.peekTypeDefinition.label","Peek Type Definition"),original:"Peek Type Definition"},precondition:Z.and(E.hasTypeDefinitionProvider,Ss.notInPeekEditor,E.isInWalkThroughSnippet.toNegated()),menu:{id:k.EditorContextPeek,group:"peek",order:4}})}},aC.ID="editor.action.peekTypeDefinition",aC));class $W extends qn{_getLocationModel(e,t,i,n){return lr(this,void 0,void 0,function*(){return new Bs(yield VW(e.implementationProvider,t,i,n),g("impl.title","Implementations"))})}_getNoResultFoundMessage(e){return e&&e.word?g("goToImplementation.noResultWord","No implementation found for '{0}'",e.word):g("goToImplementation.generic.noResults","No implementation found")}_getAlternativeCommand(e){return e.getOption(58).alternativeImplementationCommand}_getGoToPreference(e){return e.getOption(58).multipleImplementations}}jt((lC=class extends $W{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:lC.ID,title:{value:g("actions.goToImplementation.label","Go to Implementations"),original:"Go to Implementations",mnemonicTitle:g({key:"miGotoImplementation",comment:["&& denotes a mnemonic"]},"Go to &&Implementations")},precondition:Z.and(E.hasImplementationProvider,E.isInWalkThroughSnippet.toNegated()),keybinding:{when:E.editorTextFocus,primary:2118,weight:100},menu:[{id:k.EditorContext,group:"navigation",order:1.45},{id:k.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:4}]})}},lC.ID="editor.action.goToImplementation",lC));jt((dC=class extends $W{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:dC.ID,title:{value:g("actions.peekImplementation.label","Peek Implementations"),original:"Peek Implementations"},precondition:Z.and(E.hasImplementationProvider,Ss.notInPeekEditor,E.isInWalkThroughSnippet.toNegated()),keybinding:{when:E.editorTextFocus,primary:3142,weight:100},menu:{id:k.EditorContextPeek,group:"peek",order:5}})}},dC.ID="editor.action.peekImplementation",dC));class jW extends qn{_getNoResultFoundMessage(e){return e?g("references.no","No references found for '{0}'",e.word):g("references.noGeneric","No references found")}_getAlternativeCommand(e){return e.getOption(58).alternativeReferenceCommand}_getGoToPreference(e){return e.getOption(58).multipleReferences}}jt(class extends jW{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:"editor.action.goToReferences",title:{value:g("goToReferences.label","Go to References"),original:"Go to References",mnemonicTitle:g({key:"miGotoReference",comment:["&& denotes a mnemonic"]},"Go to &&References")},precondition:Z.and(E.hasReferenceProvider,Ss.notInPeekEditor,E.isInWalkThroughSnippet.toNegated()),keybinding:{when:E.editorTextFocus,primary:1094,weight:100},menu:[{id:k.EditorContext,group:"navigation",order:1.45},{id:k.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:5}]})}_getLocationModel(e,t,i,n){return lr(this,void 0,void 0,function*(){return new Bs(yield Qy(e.referenceProvider,t,i,!0,n),g("ref.title","References"))})}});jt(class extends jW{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:"editor.action.referenceSearch.trigger",title:{value:g("references.action.label","Peek References"),original:"Peek References"},precondition:Z.and(E.hasReferenceProvider,Ss.notInPeekEditor,E.isInWalkThroughSnippet.toNegated()),menu:{id:k.EditorContextPeek,group:"peek",order:6}})}_getLocationModel(e,t,i,n){return lr(this,void 0,void 0,function*(){return new Bs(yield Qy(e.referenceProvider,t,i,!1,n),g("ref.title","References"))})}});class Wue extends qn{constructor(e,t,i){super(e,{id:"editor.action.goToLocation",title:{value:g("label.generic","Go to Any Symbol"),original:"Go to Any Symbol"},precondition:Z.and(Ss.notInPeekEditor,E.isInWalkThroughSnippet.toNegated())}),this._references=t,this._gotoMultipleBehaviour=i}_getLocationModel(e,t,i,n){return lr(this,void 0,void 0,function*(){return new Bs(this._references,g("generic.title","Locations"))})}_getNoResultFoundMessage(e){return e&&g("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""}}lt.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:ke},{name:"position",description:"The position at which to start",constraint:P.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:(o,e,t,i,n,s,r)=>lr(void 0,void 0,void 0,function*(){xt(ke.isUri(e)),xt(P.isIPosition(t)),xt(Array.isArray(i)),xt(typeof n>"u"||typeof n=="string"),xt(typeof r>"u"||typeof r=="boolean");const a=o.get(_t),l=yield a.openCodeEditor({resource:e},a.getFocusedCodeEditor());if(rl(l))return l.setPosition(t),l.revealPositionInCenterIfOutsideViewport(t,0),l.invokeWithinContext(d=>{const c=new class extends Wue{_getNoResultFoundMessage(h){return s||super._getNoResultFoundMessage(h)}}({muteMessage:!s,openInPeek:!!r,openToSide:!1},i,n);d.get(Re).invokeFunction(c.run.bind(c),l)})})});lt.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:ke},{name:"position",description:"The position at which to start",constraint:P.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:(o,e,t,i,n)=>lr(void 0,void 0,void 0,function*(){o.get(li).executeCommand("editor.action.goToLocations",e,t,i,n,void 0,!0)})});lt.registerCommand({id:"editor.action.findReferences",handler:(o,e,t)=>{xt(ke.isUri(e)),xt(P.isIPosition(t));const i=o.get(pe),n=o.get(_t);return n.openCodeEditor({resource:e},n.getFocusedCodeEditor()).then(s=>{if(!rl(s)||!s.hasModel())return;const r=Wc.get(s);if(!r)return;const a=Wi(d=>Qy(i.referenceProvider,s.getModel(),P.lift(t),!1,d).then(c=>new Bs(c,g("ref.title","References")))),l=new L(t.lineNumber,t.column,t.lineNumber,t.column);return Promise.resolve(r.toggleWidget(l,a,!1))})}});lt.registerCommandAlias("editor.action.showReferences","editor.action.peekLocations");var Vue=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},_D=function(o,e){return function(t,i){e(t,i,o)}},h5=function(o,e,t,i){function n(s){return s instanceof t?s:new t(function(r){r(s)})}return new(t||(t=Promise))(function(s,r){function a(c){try{d(i.next(c))}catch(h){r(h)}}function l(c){try{d(i.throw(c))}catch(h){r(h)}}function d(c){c.done?s(c.value):n(c.value).then(a,l)}d((i=i.apply(o,e||[])).next())})},e_;let Nu=e_=class{constructor(e,t,i,n){this.textModelResolverService=t,this.languageService=i,this.languageFeaturesService=n,this.toUnhook=new X,this.toUnhookForKeyboard=new X,this.currentWordAtPosition=null,this.previousPromise=null,this.editor=e,this.linkDecorations=this.editor.createDecorationsCollection();const s=new jy(e);this.toUnhook.add(s),this.toUnhook.add(s.onMouseMoveOrRelevantKeyDown(([r,a])=>{this.startFindDefinitionFromMouse(r,a??void 0)})),this.toUnhook.add(s.onExecute(r=>{this.isEnabled(r)&&this.gotoDefinition(r.target.position,r.hasSideBySideModifier).catch(a=>{He(a)}).finally(()=>{this.removeLinkDecorations()})})),this.toUnhook.add(s.onCancel(()=>{this.removeLinkDecorations(),this.currentWordAtPosition=null}))}static get(e){return e.getContribution(e_.ID)}startFindDefinitionFromCursor(e){return h5(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 i=e.target.position;this.startFindDefinition(i)}startFindDefinition(e){var t;return h5(this,void 0,void 0,function*(){this.toUnhookForKeyboard.clear();const i=e?(t=this.editor.getModel())===null||t===void 0?void 0:t.getWordAtPosition(e):null;if(!i){this.currentWordAtPosition=null,this.removeLinkDecorations();return}if(this.currentWordAtPosition&&this.currentWordAtPosition.startColumn===i.startColumn&&this.currentWordAtPosition.endColumn===i.endColumn&&this.currentWordAtPosition.word===i.word)return;this.currentWordAtPosition=i;const n=new N6(this.editor,15);this.previousPromise&&(this.previousPromise.cancel(),this.previousPromise=null),this.previousPromise=Wi(a=>this.findDefinition(e,a));let s;try{s=yield this.previousPromise}catch(a){He(a);return}if(!s||!s.length||!n.validate(this.editor)){this.removeLinkDecorations();return}const r=s[0].originSelectionRange?L.lift(s[0].originSelectionRange):new L(e.lineNumber,i.startColumn,e.lineNumber,i.endColumn);if(s.length>1){let a=r;for(const{originSelectionRange:l}of s)l&&(a=L.plusRange(a,l));this.addDecoration(a,new xn().appendText(g("multipleResults","Click to show {0} definitions.",s.length)))}else{const a=s[0];if(!a.uri)return;this.textModelResolverService.createModelReference(a.uri).then(l=>{if(!l.object||!l.object.textEditorModel){l.dispose();return}const{object:{textEditorModel:d}}=l,{startLineNumber:c}=a.range;if(c<1||c>d.getLineCount()){l.dispose();return}const h=this.getPreviewValue(d,c,a),u=this.languageService.guessLanguageIdByFilepathOrFirstLine(d.uri);this.addDecoration(r,h?new xn().appendCodeblock(u||"",h):void 0),l.dispose()})}})}getPreviewValue(e,t,i){let n=i.range;return n.endLineNumber-n.startLineNumber>=e_.MAX_SOURCE_PREVIEW_LINES&&(n=this.getPreviewRangeBasedOnIndentation(e,t)),this.stripIndentationFromPreviewRange(e,t,n)}stripIndentationFromPreviewRange(e,t,i){let s=e.getLineFirstNonWhitespaceColumn(t);for(let a=t+1;a<i.endLineNumber;a++){const l=e.getLineFirstNonWhitespaceColumn(a);s=Math.min(s,l)}return e.getValueInRange(i).replace(new RegExp(`^\\s{${s-1}}`,"gm"),"").trim()}getPreviewRangeBasedOnIndentation(e,t){const i=e.getLineFirstNonWhitespaceColumn(t),n=Math.min(e.getLineCount(),t+e_.MAX_SOURCE_PREVIEW_LINES);let s=t+1;for(;s<n;s++){const r=e.getLineFirstNonWhitespaceColumn(s);if(i===r)break}return new L(t,1,s+1,1)}addDecoration(e,t){const i={range:e,options:{description:"goto-definition-link",inlineClassName:"goto-definition-link",hoverMessage:t}};this.linkDecorations.set([i])}removeLinkDecorations(){this.linkDecorations.clear()}isEnabled(e,t){var i;return this.editor.hasModel()&&e.isLeftClick&&e.isNoneOrSingleMouseDown&&e.target.type===6&&!(((i=e.target.detail.injectedText)===null||i===void 0?void 0:i.options)instanceof Mc)&&(e.hasTriggerModifier||(t?t.keyCodeIsTriggerKey:!1))&&this.languageFeaturesService.definitionProvider.has(this.editor.getModel())}findDefinition(e,t){const i=this.editor.getModel();return i?Xy(this.languageFeaturesService.definitionProvider,i,e,t):Promise.resolve(null)}gotoDefinition(e,t){return this.editor.setPosition(e),this.editor.invokeWithinContext(i=>{const n=!t&&this.editor.getOption(87)&&!this.isInPeekEditor(i);return new ib({openToSide:t,openInPeek:n,muteMessage:!0},{title:{value:"",original:""},id:"",precondition:void 0}).run(i)})}isInPeekEditor(e){const t=e.get(Ae);return Ss.inPeekEditor.getValue(t)}dispose(){this.toUnhook.dispose(),this.toUnhookForKeyboard.dispose()}};Nu.ID="editor.contrib.gotodefinitionatposition";Nu.MAX_SOURCE_PREVIEW_LINES=8;Nu=e_=Vue([_D(1,Ls),_D(2,qt),_D(3,pe)],Nu);ft(Nu.ID,Nu,2);const cC=te;class KW extends H{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 T0(this.contentsDomNode,{consumeMouseWheelIfScrollbarIsNeeded:!0})),this.containerDomNode.appendChild(this.scrollbar.getDomNode())}onContentsChanged(){this.scrollbar.scanDomNode()}}class AM extends H{static render(e,t,i){return new AM(e,t,i)}constructor(e,t,i){super(),this.actionContainer=Y(e,cC("div.action-container")),this.actionContainer.setAttribute("tabindex","0"),this.action=Y(this.actionContainer,cC("a.action")),this.action.setAttribute("role","button"),t.iconClass&&Y(this.action,cC(`span.icon.${t.iconClass}`));const n=Y(this.action,cC("span"));n.textContent=i?`${t.label} (${i})`:t.label,this._register($(this.actionContainer,ae.CLICK,s=>{s.stopPropagation(),s.preventDefault(),t.run(this.actionContainer)})),this._register($(this.actionContainer,ae.KEY_DOWN,s=>{const r=new Wt(s);(r.equals(3)||r.equals(10))&&(s.stopPropagation(),s.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 Hue(o,e){return o&&e?g("acessibleViewHint","Inspect this in the accessible view with {0}.",e):o?g("acessibleViewHintNoKbOpen","Inspect this in the accessible view via the command Open Accessible View which is currently not triggerable via keybinding."):""}var zue=function(o,e,t,i){function n(s){return s instanceof t?s:new t(function(r){r(s)})}return new(t||(t=Promise))(function(s,r){function a(c){try{d(i.next(c))}catch(h){r(h)}}function l(c){try{d(i.throw(c))}catch(h){r(h)}}function d(c){c.done?s(c.value):n(c.value).then(a,l)}d((i=i.apply(o,e||[])).next())})},Uue=function(o){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=o[Symbol.asyncIterator],t;return e?e.call(o):(o=typeof __values=="function"?__values(o):o[Symbol.iterator](),t={},i("next"),i("throw"),i("return"),t[Symbol.asyncIterator]=function(){return this},t);function i(s){t[s]=o[s]&&function(r){return new Promise(function(a,l){r=o[s](r),n(a,l,r.done,r.value)})}}function n(s,r,a,l){Promise.resolve(l).then(function(d){s({value:d,done:a})},r)}};let $ue=class{constructor(e,t,i){this.value=e,this.isComplete=t,this.hasLoadingMessage=i}};class qW extends H{constructor(e,t){super(),this._editor=e,this._computer=t,this._onResult=this._register(new A),this.onResult=this._onResult.event,this._firstWaitScheduler=this._register(new Dt(()=>this._triggerAsyncComputation(),0)),this._secondWaitScheduler=this._register(new Dt(()=>this._triggerSyncComputation(),0)),this._loadingMessageScheduler=this._register(new Dt(()=>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=Mj(e=>this._computer.computeAsync(e)),zue(this,void 0,void 0,function*(){var e,t,i,n;try{try{for(var s=!0,r=Uue(this._asyncIterable),a;a=yield r.next(),e=a.done,!e;s=!0){n=a.value,s=!1;const l=n;l&&(this._result.push(l),this._fireResult())}}catch(l){t={error:l}}finally{try{!s&&!e&&(i=r.return)&&(yield i.call(r))}finally{if(t)throw t.error}}this._asyncIterableDone=!0,(this._state===3||this._state===4)&&this._setState(0)}catch(l){He(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 $ue(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 vD{constructor(e,t,i,n){this.priority=e,this.range=t,this.initialMousePosX=i,this.initialMousePosY=n,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 c1{constructor(e,t,i,n,s,r){this.priority=e,this.owner=t,this.range=i,this.initialMousePosX=n,this.initialMousePosY=s,this.supportsMarkerHover=r,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 lf=new class{constructor(){this._participants=[]}register(e){this._participants.push(e)}getAll(){return this._participants}};class PM{constructor(){this._onDidWillResize=new A,this.onDidWillResize=this._onDidWillResize.event,this._onDidResize=new A,this.onDidResize=this._onDidResize.event,this._sashListener=new X,this._size=new gt(0,0),this._minSize=new gt(0,0),this._maxSize=new gt(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER),this.domNode=document.createElement("div"),this._eastSash=new Tn(this.domNode,{getVerticalSashLeft:()=>this._size.width},{orientation:0}),this._westSash=new Tn(this.domNode,{getVerticalSashLeft:()=>0},{orientation:0}),this._northSash=new Tn(this.domNode,{getHorizontalSashTop:()=>0},{orientation:1,orthogonalEdge:kw.North}),this._southSash=new Tn(this.domNode,{getHorizontalSashTop:()=>this._size.height},{orientation:1,orthogonalEdge:kw.South}),this._northSash.orthogonalStartSash=this._westSash,this._northSash.orthogonalEndSash=this._eastSash,this._southSash.orthogonalStartSash=this._westSash,this._southSash.orthogonalEndSash=this._eastSash;let e,t=0,i=0;this._sashListener.add(de.any(this._northSash.onDidStart,this._eastSash.onDidStart,this._southSash.onDidStart,this._westSash.onDidStart)(()=>{e===void 0&&(this._onDidWillResize.fire(),e=this._size,t=0,i=0)})),this._sashListener.add(de.any(this._northSash.onDidEnd,this._eastSash.onDidEnd,this._southSash.onDidEnd,this._westSash.onDidEnd)(()=>{e!==void 0&&(e=void 0,t=0,i=0,this._onDidResize.fire({dimension:this._size,done:!0}))})),this._sashListener.add(this._eastSash.onDidChange(n=>{e&&(i=n.currentX-n.startX,this.layout(e.height+t,e.width+i),this._onDidResize.fire({dimension:this._size,done:!1,east:!0}))})),this._sashListener.add(this._westSash.onDidChange(n=>{e&&(i=-(n.currentX-n.startX),this.layout(e.height+t,e.width+i),this._onDidResize.fire({dimension:this._size,done:!1,west:!0}))})),this._sashListener.add(this._northSash.onDidChange(n=>{e&&(t=-(n.currentY-n.startY),this.layout(e.height+t,e.width+i),this._onDidResize.fire({dimension:this._size,done:!1,north:!0}))})),this._sashListener.add(this._southSash.onDidChange(n=>{e&&(t=n.currentY-n.startY,this.layout(e.height+t,e.width+i),this._onDidResize.fire({dimension:this._size,done:!1,south:!0}))})),this._sashListener.add(de.any(this._eastSash.onDidReset,this._westSash.onDidReset)(n=>{this._preferredSize&&(this.layout(this._size.height,this._preferredSize.width),this._onDidResize.fire({dimension:this._size,done:!0}))})),this._sashListener.add(de.any(this._northSash.onDidReset,this._southSash.onDidReset)(n=>{this._preferredSize&&(this.layout(this._preferredSize.height,this._size.width),this._onDidResize.fire({dimension:this._size,done:!0}))}))}dispose(){this._northSash.dispose(),this._southSash.dispose(),this._eastSash.dispose(),this._westSash.dispose(),this._sashListener.dispose(),this._onDidResize.dispose(),this._onDidWillResize.dispose(),this.domNode.remove()}enableSashes(e,t,i,n){this._northSash.state=e?3:0,this._eastSash.state=t?3:0,this._southSash.state=i?3:0,this._westSash.state=n?3:0}layout(e=this.size.height,t=this.size.width){const{height:i,width:n}=this._minSize,{height:s,width:r}=this._maxSize;e=Math.max(i,Math.min(s,e)),t=Math.max(n,Math.min(r,t));const a=new gt(t,e);gt.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 jue=30,Kue=24;class que extends H{constructor(e,t=new gt(10,10)){super(),this._editor=e,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._resizableNode=this._register(new PM),this._contentPosition=null,this._isResizing=!1,this._resizableNode.domNode.style.position="absolute",this._resizableNode.minSize=gt.lift(t),this._resizableNode.layout(t.height,t.width),this._resizableNode.enableSashes(!0,!0,!0,!0),this._register(this._resizableNode.onDidResize(i=>{this._resize(new gt(i.dimension.width,i.dimension.height)),i.done&&(this._isResizing=!1)})),this._register(this._resizableNode.onDidWillResize(()=>{this._isResizing=!0}))}get isResizing(){return this._isResizing}getDomNode(){return this._resizableNode.domNode}getPosition(){return this._contentPosition}get position(){var e;return!((e=this._contentPosition)===null||e===void 0)&&e.position?P.lift(this._contentPosition.position):void 0}_availableVerticalSpaceAbove(e){const t=this._editor.getDomNode(),i=this._editor.getScrolledVisiblePosition(e);return!t||!i?void 0:Ai(t).top+i.top-jue}_availableVerticalSpaceBelow(e){const t=this._editor.getDomNode(),i=this._editor.getScrolledVisiblePosition(e);if(!t||!i)return;const n=Ai(t),s=Pp(t.ownerDocument.body),r=n.top+i.top+i.height;return s.height-r-Kue}_findPositionPreference(e,t){var i,n;const s=Math.min((i=this._availableVerticalSpaceBelow(t))!==null&&i!==void 0?i:1/0,e),r=Math.min((n=this._availableVerticalSpaceAbove(t))!==null&&n!==void 0?n:1/0,e),a=Math.min(Math.max(r,s),e),l=Math.min(e,a);let d;return this._editor.getOption(60).above?d=l<=r?1:2:d=l<=s?2:1,d===1?this._resizableNode.enableSashes(!0,!0,!1,!1):this._resizableNode.enableSashes(!1,!0,!0,!1),d}_resize(e){this._resizableNode.layout(e.height,e.width)}}var OM=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Zh=function(o,e){return function(t,i){e(t,i,o)}},h1,_a;const u5=te;let Yw=h1=class extends H{constructor(e,t,i){super(),this._editor=e,this._instantiationService=t,this._keybindingService=i,this._currentResult=null,this._widget=this._register(this._instantiationService.createInstance(gc,this._editor)),this._participants=[];for(const n of lf.getAll())this._participants.push(this._instantiationService.createInstance(n,this._editor));this._participants.sort((n,s)=>n.hoverOrdinal-s.hoverOrdinal),this._computer=new Qw(this._editor,this._participants),this._hoverOperation=this._register(new qW(this._editor,this._computer)),this._register(this._hoverOperation.onResult(n=>{if(!this._computer.anchor)return;const s=n.hasLoadingMessage?this._addLoadingMessage(n.value):n.value;this._withResult(new GW(this._computer.anchor,s,n.isComplete))})),this._register(wi(this._widget.getDomNode(),"keydown",n=>{n.equals(9)&&this.hide()})),this._register(ei.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 n of this._participants)if(n.suggestHoverAnchor){const s=n.suggestHoverAnchor(e);s&&t.push(s)}const i=e.target;if(i.type===6&&t.push(new vD(0,i.range,e.event.posx,e.event.posy)),i.type===7){const n=this._editor.getOption(50).typicalHalfwidthCharacterWidth/2;!i.detail.isAfterLines&&typeof i.detail.horizontalDistanceToText=="number"&&i.detail.horizontalDistanceToText<n&&t.push(new vD(0,i.range,e.event.posx,e.event.posy))}return t.length===0?this._startShowingOrUpdateHover(null,0,0,!1,e):(t.sort((n,s)=>s.priority-n.priority),this._startShowingOrUpdateHover(t[0],0,0,!1,e))}startShowingAtRange(e,t,i,n){this._startShowingOrUpdateHover(new vD(0,e,void 0,void 0),t,i,n,null)}_startShowingOrUpdateHover(e,t,i,n,s){return!this._widget.position||!this._currentResult?e?(this._startHoverOperationIfNecessary(e,t,i,n,!1),!0):!1:this._editor.getOption(60).sticky&&s&&this._widget.isMouseGettingCloser(s.event.posx,s.event.posy)?(e&&this._startHoverOperationIfNecessary(e,t,i,n,!0),!0):e?e&&this._currentResult.anchor.equals(e)?!0:e.canAdoptVisibleHover(this._currentResult.anchor,this._widget.position)?(this._setCurrentResult(this._currentResult.filter(e)),this._startHoverOperationIfNecessary(e,t,i,n,!1),!0):(this._setCurrentResult(null),this._startHoverOperationIfNecessary(e,t,i,n,!1),!0):(this._setCurrentResult(null),!1)}_startHoverOperationIfNecessary(e,t,i,n,s){this._computer.anchor&&this._computer.anchor.equals(e)||(this._hoverOperation.cancel(),this._computer.anchor=e,this._computer.shouldFocus=n,this._computer.source=i,this._computer.insistOnKeepingHoverVisible=s,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 i=t.createLoadingMessage(this._computer.anchor);if(i)return e.slice(0).concat([i])}}return e}_withResult(e){this._widget.position&&this._currentResult&&this._currentResult.isComplete&&(!e.isComplete||this._computer.insistOnKeepingHoverVisible&&e.messages.length===0)||this._setCurrentResult(e)}_renderMessages(e,t){const{showAtPosition:i,showAtSecondaryPosition:n,highlightRange:s}=h1.computeHoverRanges(this._editor,e.range,t),r=new X,a=r.add(new Xw(this._keybindingService)),l=document.createDocumentFragment();let d=null;const c={fragment:l,statusBar:a,setColorPicker:u=>d=u,onContentsChanged:()=>this._widget.onContentsChanged(),setMinimumDimensions:u=>this._widget.setMinimumDimensions(u),hide:()=>this.hide()};for(const u of this._participants){const f=t.filter(p=>p.owner===u);f.length>0&&r.add(u.renderHoverParts(c,f))}const h=t.some(u=>u.isBeforeContent);if(a.hasContent&&l.appendChild(a.hoverElement),l.hasChildNodes()){if(s){const u=this._editor.createDecorationsCollection();u.set([{range:s,options:h1._DECORATION_OPTIONS}]),r.add(Me(()=>{u.clear()}))}this._widget.showAt(l,new Zue(d,i,n,this._editor.getOption(60).above,this._computer.shouldFocus,this._computer.source,h,e.initialMousePosX,e.initialMousePosY,r))}else r.dispose()}static computeHoverRanges(e,t,i){let n=1;if(e.hasModel()){const d=e._getViewModel(),c=d.coordinatesConverter,h=c.convertModelRangeToViewRange(t),u=new P(h.startLineNumber,d.getLineMinColumn(h.startLineNumber));n=c.convertViewPositionToModelPosition(u).column}const s=t.startLineNumber;let r=t.startColumn,a=i[0].range,l=null;for(const d of i)a=L.plusRange(a,d.range),d.range.startLineNumber===s&&d.range.endLineNumber===s&&(r=Math.max(Math.min(r,d.range.startColumn),n)),d.forceShowAtRange&&(l=d.range);return{showAtPosition:l?l.getStartPosition():new P(s,t.startColumn),showAtSecondaryPosition:l?l.getStartPosition():new P(s,r),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()}};Yw._DECORATION_OPTIONS=Ve.register({description:"content-hover-highlight",className:"hoverHighlight"});Yw=h1=OM([Zh(1,Re),Zh(2,Nt)],Yw);class GW{constructor(e,t,i){this.anchor=e,this.messages=t,this.isComplete=i}filter(e){const t=this.messages.filter(i=>i.isValidForHoverAnchor(e));return t.length===this.messages.length?this:new Gue(this,this.anchor,t,this.isComplete)}}class Gue extends GW{constructor(e,t,i,n){super(t,i,n),this.original=e}filter(e){return this.original.filter(e)}}class Zue{constructor(e,t,i,n,s,r,a,l,d,c){this.colorPicker=e,this.showAtPosition=t,this.showAtSecondaryPosition=i,this.preferAbove=n,this.stoleFocus=s,this.source=r,this.isBeforeContent=a,this.initialMousePosX=l,this.initialMousePosY=d,this.disposables=c,this.closestMouseDistance=void 0}}const f5=30,bD=10,Yue=6;let gc=_a=class extends que{get isColorPickerVisible(){var e;return!!(!((e=this._visibleData)===null||e===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,i,n,s){const r=e.getOption(66)+8,a=150,l=new gt(a,r);super(e,l),this._configurationService=i,this._accessibilityService=n,this._keybindingService=s,this._hover=this._register(new KW),this._minimumSize=l,this._hoverVisibleKey=E.hoverVisible.bindTo(t),this._hoverFocusedKey=E.hoverFocused.bindTo(t),Y(this._resizableNode.domNode,this._hover.containerDomNode),this._resizableNode.domNode.style.zIndex="50",this._register(this._editor.onDidLayoutChange(()=>this._layout())),this._register(this._editor.onDidChangeConfiguration(c=>{c.hasChanged(50)&&this._updateFont()}));const d=this._register(Qa(this._resizableNode.domNode));this._register(d.onDidFocus(()=>{this._hoverFocusedKey.set(!0)})),this._register(d.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 _a.ID}static _applyDimensions(e,t,i){const n=typeof t=="number"?`${t}px`:t,s=typeof i=="number"?`${i}px`:i;e.style.width=n,e.style.height=s}_setContentsDomNodeDimensions(e,t){const i=this._hover.contentsDomNode;return _a._applyDimensions(i,e,t)}_setContainerDomNodeDimensions(e,t){const i=this._hover.containerDomNode;return _a._applyDimensions(i,e,t)}_setHoverWidgetDimensions(e,t){this._setContentsDomNodeDimensions(e,t),this._setContainerDomNodeDimensions(e,t),this._layoutContentWidget()}static _applyMaxDimensions(e,t,i){const n=typeof t=="number"?`${t}px`:t,s=typeof i=="number"?`${i}px`:i;e.style.maxWidth=n,e.style.maxHeight=s}_setHoverWidgetMaxDimensions(e,t){_a._applyMaxDimensions(this._hover.contentsDomNode,e,t),_a._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,i=e.height;this._setHoverWidgetDimensions(t,i),this._hasHorizontalScrollbar()&&(this._adjustContentsBottomPadding(),this._setContentsDomNodeDimensions(t,i-bD))}_updateResizableNodeMaxDimensions(){var e,t;const i=(e=this._findMaximumRenderingWidth())!==null&&e!==void 0?e:1/0,n=(t=this._findMaximumRenderingHeight())!==null&&t!==void 0?t:1/0;this._resizableNode.maxSize=new gt(i,n),this._setHoverWidgetMaxDimensions(i,n)}_resize(e){var t,i;_a._lastDimensions=new gt(e.width,e.height),this._setAdjustedHoverWidgetDimensions(e),this._resizableNode.layout(e.height,e.width),this._updateResizableNodeMaxDimensions(),this._hover.scrollbar.scanDomNode(),this._editor.layoutContentWidget(this),(i=(t=this._visibleData)===null||t===void 0?void 0:t.colorPicker)===null||i===void 0||i.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=Yue;return Array.from(this._hover.contentsDomNode.children).forEach(i=>{t+=i.clientHeight}),this._hasHorizontalScrollbar()&&(t+=bD),Math.min(e,t)}_isHoverTextOverflowing(){this._hover.containerDomNode.style.setProperty("--vscode-hover-whiteSpace","nowrap"),this._hover.containerDomNode.style.setProperty("--vscode-hover-sourceWhiteSpace","nowrap");const e=Array.from(this._hover.contentsDomNode.children).some(t=>t.scrollWidth>t.clientWidth);return this._hover.containerDomNode.style.removeProperty("--vscode-hover-whiteSpace"),this._hover.containerDomNode.style.removeProperty("--vscode-hover-sourceWhiteSpace"),e}_findMaximumRenderingWidth(){if(!this._editor||!this._editor.hasModel())return;const e=this._isHoverTextOverflowing(),t=typeof this._contentWidth>"u"?0:this._contentWidth-2;return e||this._hover.containerDomNode.clientWidth<t?Pp(this._hover.containerDomNode.ownerDocument.body).width-14:this._hover.containerDomNode.clientWidth+2}isMouseGettingCloser(e,t){if(!this._visibleData)return!1;if(typeof this._visibleData.initialMousePosX>"u"||typeof this._visibleData.initialMousePosY>"u")return this._visibleData.initialMousePosX=e,this._visibleData.initialMousePosY=t,!1;const i=Ai(this.getDomNode());typeof this._visibleData.closestMouseDistance>"u"&&(this._visibleData.closestMouseDistance=g5(this._visibleData.initialMousePosX,this._visibleData.initialMousePosY,i.left,i.top,i.width,i.height));const n=g5(e,t,i.left,i.top,i.width,i.height);return n>this._visibleData.closestMouseDistance+4?!1:(this._visibleData.closestMouseDistance=Math.min(this._visibleData.closestMouseDistance,n),!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),i=this._hover.contentsDomNode;i.style.fontSize=`${e}px`,i.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,_a._lastDimensions.height),t=Math.max(this._editor.getLayoutInfo().width*.66,500,_a._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 i,n,s,r;if(!this._editor||!this._editor.hasModel())return;this._render(e,t);const a=Hh(this._hover.containerDomNode),l=t.showAtPosition;this._positionPreference=(i=this._findPositionPreference(a,l))!==null&&i!==void 0?i:1,this.onContentsChanged(),t.stoleFocus&&this._hover.containerDomNode.focus(),(n=t.colorPicker)===null||n===void 0||n.layout();const d=Hue(this._configurationService.getValue("accessibility.verbosity.hover")===!0&&this._accessibilityService.isScreenReaderOptimized(),(r=(s=this._keybindingService.lookupKeybinding("editor.action.accessibleView"))===null||s===void 0?void 0:s.getAriaLabel())!==null&&r!==void 0?r:"");d&&(this._hover.contentsDomNode.ariaLabel=this._hover.contentsDomNode.textContent+", "+d)}hide(){if(!this._visibleData)return;const e=this._visibleData.stoleFocus||this._hoverFocusedKey.get();this._setHoverData(void 0),this._resizableNode.maxSize=new gt(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 i=this._hover.containerDomNode,n=this._hover.contentsDomNode,s=(t=this._findMaximumRenderingHeight())!==null&&t!==void 0?t:1/0;this._setContainerDomNodeDimensions(ps(i),Math.min(s,e)),this._setContentsDomNodeDimensions(ps(n),Math.min(s,e-bD))}setMinimumDimensions(e){this._minimumSize=new gt(Math.max(this._minimumSize.width,e.width),Math.max(this._minimumSize.height,e.height)),this._updateMinimumWidth()}_updateMinimumWidth(){const e=typeof this._contentWidth>"u"?this._minimumSize.width:Math.min(this._contentWidth,this._minimumSize.width);this._resizableNode.minSize=new gt(e,this._minimumSize.height)}onContentsChanged(){var e;this._removeConstraintsRenderNormally();const t=this._hover.containerDomNode;let i=Hh(t),n=ps(t);if(this._resizableNode.layout(i,n),this._setHoverWidgetDimensions(n,i),i=Hh(t),n=ps(t),this._contentWidth=n,this._updateMinimumWidth(),this._resizableNode.layout(i,n),this._hasHorizontalScrollbar()&&(this._adjustContentsBottomPadding(),this._adjustHoverHeightForScrollbar(i)),!((e=this._visibleData)===null||e===void 0)&&e.showAtPosition){const s=Hh(this._hover.containerDomNode);this._positionPreference=this._findPositionPreference(s,this._visibleData.showAtPosition)}this._layoutContentWidget()}focus(){this._hover.containerDomNode.focus()}scrollUp(){const e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._editor.getOption(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-f5})}scrollRight(){const e=this._hover.scrollbar.getScrollPosition().scrollLeft;this._hover.scrollbar.setScrollPosition({scrollLeft:e+f5})}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})}};gc.ID="editor.contrib.resizableContentHoverWidget";gc._lastDimensions=new gt(0,0);gc=_a=OM([Zh(1,Ae),Zh(2,st),Zh(3,hd),Zh(4,Nt)],gc);let Xw=class extends H{get hasContent(){return this._hasContent}constructor(e){super(),this._keybindingService=e,this._hasContent=!1,this.hoverElement=u5("div.hover-row.status-bar"),this.actionsElement=Y(this.hoverElement,u5("div.actions"))}addAction(e){const t=this._keybindingService.lookupKeybinding(e.commandId),i=t?t.getLabel():null;return this._hasContent=!0,this._register(AM.render(this.actionsElement,e,i))}append(e){const t=Y(this.actionsElement,e);return this._hasContent=!0,t}};Xw=OM([Zh(0,Nt)],Xw);class Qw{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 i=e.getModel(),n=t.range.startLineNumber;if(n>i.getLineCount())return[];const s=i.getLineMaxColumn(n);return e.getLineDecorations(n).filter(r=>{if(r.options.isWholeLine)return!0;const a=r.range.startLineNumber===n?r.range.startColumn:1,l=r.range.endLineNumber===n?r.range.endColumn:s;if(r.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 ki.EMPTY;const i=Qw._getLineDecorations(this._editor,t);return ki.merge(this._participants.map(n=>n.computeAsync?n.computeAsync(t,i,e):ki.EMPTY))}computeSync(){if(!this._editor.hasModel()||!this._anchor)return[];const e=Qw._getLineDecorations(this._editor,this._anchor);let t=[];for(const i of this._participants)t=t.concat(i.computeSync(this._anchor,e));return Za(t)}}function g5(o,e,t,i,n,s){const r=t+n/2,a=i+s/2,l=Math.max(Math.abs(o-r)-n/2,0),d=Math.max(Math.abs(e-a)-s/2,0);return Math.sqrt(l*l+d*d)}const p5=te;class Bg extends H{constructor(e,t,i){super(),this._renderDisposeables=this._register(new X),this._editor=e,this._isVisible=!1,this._messages=[],this._hover=this._register(new KW),this._hover.containerDomNode.classList.toggle("hidden",!this._isVisible),this._markdownRenderer=this._register(new dd({editor:this._editor},t,i)),this._computer=new Xue(this._editor),this._hoverOperation=this._register(new qW(this._editor,this._computer)),this._register(this._hoverOperation.onResult(n=>{this._withResult(n.value)})),this._register(this._editor.onDidChangeModelDecorations(()=>this._onModelDecorationsChanged())),this._register(this._editor.onDidChangeConfiguration(n=>{n.hasChanged(50)&&this._updateFont()})),this._editor.addOverlayWidget(this)}dispose(){this._editor.removeOverlayWidget(this),super.dispose()}getId(){return Bg.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 i=document.createDocumentFragment();for(const n of t){const s=p5("div.hover-row.markdown-hover"),r=Y(s,p5("div.hover-contents")),a=this._renderDisposeables.add(this._markdownRenderer.render(n.value));r.appendChild(a.element),i.appendChild(s)}this._updateContents(i),this._showAt(e)}_updateContents(e){this._hover.contentsDomNode.textContent="",this._hover.contentsDomNode.appendChild(e),this._updateFont()}_showAt(e){this._isVisible||(this._isVisible=!0,this._hover.containerDomNode.classList.toggle("hidden",!this._isVisible));const t=this._editor.getLayoutInfo(),i=this._editor.getTopForLineNumber(e),n=this._editor.getScrollTop(),s=this._editor.getOption(66),r=this._hover.containerDomNode.clientHeight,a=i-n-(r-s)/2;this._hover.containerDomNode.style.left=`${t.glyphMarginLeft+t.glyphMarginWidth}px`,this._hover.containerDomNode.style.top=`${Math.max(Math.round(a),0)}px`}}Bg.ID="editor.contrib.modesGlyphHoverWidget";class Xue{get lineNumber(){return this._lineNumber}set lineNumber(e){this._lineNumber=e}constructor(e){this._editor=e,this._lineNumber=-1}computeSync(){const e=n=>({value:n}),t=this._editor.getLineDecorations(this._lineNumber),i=[];if(!t)return i;for(const n of t){if(!n.options.glyphMarginClassName)continue;const s=n.options.glyphMarginHoverMessage;!s||hp(s)||i.push(...i2(s).map(e))}return i}}var Que=function(o,e,t,i){function n(s){return s instanceof t?s:new t(function(r){r(s)})}return new(t||(t=Promise))(function(s,r){function a(c){try{d(i.next(c))}catch(h){r(h)}}function l(c){try{d(i.throw(c))}catch(h){r(h)}}function d(c){c.done?s(c.value):n(c.value).then(a,l)}d((i=i.apply(o,e||[])).next())})};class Jue{constructor(e,t,i){this.provider=e,this.hover=t,this.ordinal=i}}function efe(o,e,t,i,n){return Que(this,void 0,void 0,function*(){try{const s=yield Promise.resolve(o.provideHover(t,i,n));if(s&&ife(s))return new Jue(o,s,e)}catch(s){Ni(s)}})}function FM(o,e,t,i){const s=o.ordered(e).map((r,a)=>efe(r,a,e,t,i));return ki.fromPromises(s).coalesce()}function tfe(o,e,t,i){return FM(o,e,t,i).map(n=>n.hover).toPromise()}hl("_executeHoverProvider",(o,e,t)=>{const i=o.get(pe);return tfe(i.hoverProvider,e,t,Qe.None)});function ife(o){const e=typeof o.range<"u",t=typeof o.contents<"u"&&o.contents&&o.contents.length>0;return e&&t}var nfe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},hC=function(o,e){return function(t,i){e(t,i,o)}};const m5=te;class Vr{constructor(e,t,i,n,s){this.owner=e,this.range=t,this.contents=i,this.isBeforeContent=n,this.ordinal=s}isValidForHoverAnchor(e){return e.type===1&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}let Jw=class{constructor(e,t,i,n,s){this._editor=e,this._languageService=t,this._openerService=i,this._configurationService=n,this._languageFeaturesService=s,this.hoverOrdinal=3}createLoadingMessage(e){return new Vr(this,e.range,[new xn().appendText(g("modesContentHover.loading","Loading..."))],!1,2e3)}computeSync(e,t){if(!this._editor.hasModel()||e.type!==1)return[];const i=this._editor.getModel(),n=e.range.startLineNumber,s=i.getLineMaxColumn(n),r=[];let a=1e3;const l=i.getLineLength(n),d=i.getLanguageIdAtPosition(e.range.startLineNumber,e.range.startColumn),c=this._editor.getOption(116),h=this._configurationService.getValue("editor.maxTokenizationLineLength",{overrideIdentifier:d});let u=!1;c>=0&&l>c&&e.range.startColumn>=c&&(u=!0,r.push(new Vr(this,e.range,[{value:g("stopped rendering","Rendering paused for long line for performance reasons. This can be configured via `editor.stopRenderingLineAfter`.")}],!1,a++))),!u&&typeof h=="number"&&l>=h&&r.push(new Vr(this,e.range,[{value:g("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 p of t){const m=p.range.startLineNumber===n?p.range.startColumn:1,v=p.range.endLineNumber===n?p.range.endColumn:s,_=p.options.hoverMessage;if(!_||hp(_))continue;p.options.beforeContentClassName&&(f=!0);const b=new L(e.range.startLineNumber,m,e.range.startLineNumber,v);r.push(new Vr(this,b,i2(_),f,a++))}return r}computeAsync(e,t,i){if(!this._editor.hasModel()||e.type!==1)return ki.EMPTY;const n=this._editor.getModel();if(!this._languageFeaturesService.hoverProvider.has(n))return ki.EMPTY;const s=new P(e.range.startLineNumber,e.range.startColumn);return FM(this._languageFeaturesService.hoverProvider,n,s,i).filter(r=>!hp(r.hover.contents)).map(r=>{const a=r.hover.range?L.lift(r.hover.range):e.range;return new Vr(this,a,r.hover.contents,!1,r.ordinal)})}renderHoverParts(e,t){return ZW(e,t,this._editor,this._languageService,this._openerService)}};Jw=nfe([hC(1,qt),hC(2,zs),hC(3,st),hC(4,pe)],Jw);function ZW(o,e,t,i,n){e.sort((r,a)=>r.ordinal-a.ordinal);const s=new X;for(const r of e)for(const a of r.contents){if(hp(a))continue;const l=m5("div.hover-row.markdown-hover"),d=Y(l,m5("div.hover-contents")),c=s.add(new dd({editor:t},i,n));s.add(c.onDidRenderAsync(()=>{d.className="hover-contents code-hover-contents",o.onContentsChanged()}));const h=s.add(c.render(a));d.appendChild(h.element),o.fragment.appendChild(l)}return s}var YW=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},eS=function(o,e){return function(t,i){e(t,i,o)}};class _5{constructor(e,t,i){this.marker=e,this.index=t,this.total=i}}let RN=class{constructor(e,t,i){this._markerService=t,this._configService=i,this._onDidChange=new A,this.onDidChange=this._onDidChange.event,this._dispoables=new X,this._markers=[],this._nextIdx=-1,ke.isUri(e)?this._resourceFilter=a=>a.toString()===e.toString():e&&(this._resourceFilter=e);const n=this._configService.getValue("problems.sortOrder"),s=(a,l)=>{let d=K_(a.resource.toString(),l.resource.toString());return d===0&&(n==="position"?d=L.compareRangesUsingStarts(a,l)||ni.compare(a.severity,l.severity):d=ni.compare(a.severity,l.severity)||L.compareRangesUsingStarts(a,l)),d},r=()=>{this._markers=this._markerService.read({resource:ke.isUri(e)?e:void 0,severities:ni.Error|ni.Warning|ni.Info}),typeof e=="function"&&(this._markers=this._markers.filter(a=>this._resourceFilter(a.resource))),this._markers.sort(s)};r(),this._dispoables.add(t.onMarkerChanged(a=>{(!this._resourceFilter||a.some(l=>this._resourceFilter(l)))&&(r(),this._nextIdx=-1,this._onDidChange.fire())}))}dispose(){this._dispoables.dispose(),this._onDidChange.dispose()}matches(e){return!this._resourceFilter&&!e?!0:!this._resourceFilter||!e?!1:this._resourceFilter(e)}get selected(){const e=this._markers[this._nextIdx];return e&&new _5(e,this._nextIdx+1,this._markers.length)}_initIdx(e,t,i){let n=!1,s=this._markers.findIndex(r=>r.resource.toString()===e.uri.toString());s<0&&(s=B_(this._markers,{resource:e.uri},(r,a)=>K_(r.resource.toString(),a.resource.toString())),s<0&&(s=~s));for(let r=s;r<this._markers.length;r++){let a=L.lift(this._markers[r]);if(a.isEmpty()){const l=e.getWordAtPosition(a.getStartPosition());l&&(a=new L(a.startLineNumber,l.startColumn,a.startLineNumber,l.endColumn))}if(t&&(a.containsPosition(t)||t.isBeforeOrEqual(a.getStartPosition()))){this._nextIdx=r,n=!0;break}if(this._markers[r].resource.toString()!==e.uri.toString())break}n||(this._nextIdx=i?0:this._markers.length-1),this._nextIdx<0&&(this._nextIdx=this._markers.length-1)}resetIndex(){this._nextIdx=-1}move(e,t,i){if(this._markers.length===0)return!1;const n=this._nextIdx;return this._nextIdx===-1?this._initIdx(t,i,e):e?this._nextIdx=(this._nextIdx+1)%this._markers.length:e||(this._nextIdx=(this._nextIdx-1+this._markers.length)%this._markers.length),n!==this._nextIdx}find(e,t){let i=this._markers.findIndex(n=>n.resource.toString()===e.toString());if(!(i<0)){for(;i<this._markers.length;i++)if(L.containsPosition(this._markers[i],t))return new _5(this._markers[i],i+1,this._markers.length)}}};RN=YW([eS(1,ul),eS(2,st)],RN);const XW=et("IMarkerNavigationService");let MN=class{constructor(e,t){this._markerService=e,this._configService=t,this._provider=new ns}getMarkerList(e){for(const t of this._provider){const i=t.getMarkerList(e);if(i)return i}return new RN(e,this._markerService,this._configService)}};MN=YW([eS(0,ul),eS(1,st)],MN);dt(XW,MN,1);var AN;(function(o){function e(t){switch(t){case gi.Ignore:return"severity-ignore "+Ie.asClassName(oe.info);case gi.Info:return Ie.asClassName(oe.info);case gi.Warning:return Ie.asClassName(oe.warning);case gi.Error:return Ie.asClassName(oe.error);default:return""}}o.className=e})(AN||(AN={}));var sfe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Lf=function(o,e){return function(t,i){e(t,i,o)}},PN;class ofe{constructor(e,t,i,n,s){this._openerService=n,this._labelService=s,this._lines=0,this._longestLineLength=0,this._relatedDiagnostics=new WeakMap,this._disposables=new X,this._editor=t;const r=document.createElement("div");r.className="descriptioncontainer",this._messageBlock=document.createElement("div"),this._messageBlock.classList.add("message"),this._messageBlock.setAttribute("aria-live","assertive"),this._messageBlock.setAttribute("role","alert"),r.appendChild(this._messageBlock),this._relatedBlock=document.createElement("div"),r.appendChild(this._relatedBlock),this._disposables.add(wi(this._relatedBlock,"click",a=>{a.preventDefault();const l=this._relatedDiagnostics.get(a.target);l&&i(l)})),this._scrollable=new K7(r,{horizontal:1,vertical:1,useShadows:!1,horizontalScrollbarSize:6,verticalScrollbarSize:6}),e.appendChild(this._scrollable.getDomNode()),this._disposables.add(this._scrollable.onScroll(a=>{r.style.left=`-${a.scrollLeft}px`,r.style.top=`-${a.scrollTop}px`})),this._disposables.add(this._scrollable)}dispose(){St(this._disposables)}update(e){const{source:t,message:i,relatedInformation:n,code:s}=e;let r=(t?.length||0)+2;s&&(typeof s=="string"?r+=s.length:r+=s.value.length);const a=Xa(i);this._lines=a.length,this._longestLineLength=0;for(const u of a)this._longestLineLength=Math.max(u.length+r,this._longestLineLength);fn(this._messageBlock),this._messageBlock.setAttribute("aria-label",this.getAriaLabel(e)),this._editor.applyFontInfo(this._messageBlock);let l=this._messageBlock;for(const u of a)l=document.createElement("div"),l.innerText=u,u===""&&(l.style.height=this._messageBlock.style.lineHeight),this._messageBlock.appendChild(l);if(t||s){const u=document.createElement("span");if(u.classList.add("details"),l.appendChild(u),t){const f=document.createElement("span");f.innerText=t,f.classList.add("source"),u.appendChild(f)}if(s)if(typeof s=="string"){const f=document.createElement("span");f.innerText=`(${s})`,f.classList.add("code"),u.appendChild(f)}else{this._codeLink=te("a.code-link"),this._codeLink.setAttribute("href",`${s.target.toString()}`),this._codeLink.onclick=p=>{this._openerService.open(s.target,{allowCommands:!0}),p.preventDefault(),p.stopPropagation()};const f=Y(this._codeLink,te("span"));f.innerText=s.value,u.appendChild(this._codeLink)}}if(fn(this._relatedBlock),this._editor.applyFontInfo(this._relatedBlock),Fn(n)){const u=this._relatedBlock.appendChild(document.createElement("div"));u.style.paddingTop=`${Math.floor(this._editor.getOption(66)*.66)}px`,this._lines+=1;for(const f of n){const p=document.createElement("div"),m=document.createElement("a");m.classList.add("filename"),m.innerText=`${this._labelService.getUriBasenameLabel(f.resource)}(${f.startLineNumber}, ${f.startColumn}): `,m.title=this._labelService.getUriLabel(f.resource),this._relatedDiagnostics.set(m,f);const v=document.createElement("span");v.innerText=f.message,p.appendChild(m),p.appendChild(v),this._lines+=1,u.appendChild(p)}}const d=this._editor.getOption(50),c=Math.ceil(d.typicalFullwidthCharacterWidth*this._longestLineLength*.75),h=d.lineHeight*this._lines;this._scrollable.setScrollDimensions({scrollWidth:c,scrollHeight:h})}layout(e,t){this._scrollable.getDomNode().style.height=`${e}px`,this._scrollable.getDomNode().style.width=`${t}px`,this._scrollable.setScrollDimensions({width:t,height:e})}getHeightInLines(){return Math.min(17,this._lines)}getAriaLabel(e){let t="";switch(e.severity){case ni.Error:t=g("Error","Error");break;case ni.Warning:t=g("Warning","Warning");break;case ni.Info:t=g("Info","Info");break;case ni.Hint:t=g("Hint","Hint");break}let i=g("marker aria","{0} at {1}. ",t,e.startLineNumber+":"+e.startColumn);const n=this._editor.getModel();return n&&e.startLineNumber<=n.getLineCount()&&e.startLineNumber>=1&&(i=`${n.getLineContent(e.startLineNumber)}, ${i}`),i}}let wp=PN=class extends Zw{constructor(e,t,i,n,s,r,a){super(e,{showArrow:!0,showFrame:!0,isAccessible:!0,frameWidth:1},s),this._themeService=t,this._openerService=i,this._menuService=n,this._contextKeyService=r,this._labelService=a,this._callOnDispose=new X,this._onDidSelectRelatedInformation=new A,this.onDidSelectRelatedInformation=this._onDidSelectRelatedInformation.event,this._severity=ni.Warning,this._backgroundColor=V.white,this._applyTheme(t.getColorTheme()),this._callOnDispose.add(t.onDidColorThemeChange(this._applyTheme.bind(this))),this.create()}_applyTheme(e){this._backgroundColor=e.getColor(dfe);let t=ON,i=rfe;this._severity===ni.Warning?(t=u1,i=afe):this._severity===ni.Info&&(t=FN,i=lfe);const n=e.getColor(t),s=e.getColor(i);this.style({arrowColor:n,frameColor:n,headerBackgroundColor:s,primaryHeadingColor:e.getColor(OW),secondaryHeadingColor:e.getColor(FW)})}_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(n=>this.editor.focus()));const t=[],i=this._menuService.createMenu(PN.TitleMenu,this._contextKeyService);DB(i,void 0,t),this._actionbarWidget.push(t,{label:!1,icon:!0,index:0}),i.dispose()}_fillTitleIcon(e){this._icon=Y(e,te(""))}_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 ofe(this._container,this.editor,t=>this._onDidSelectRelatedInformation.fire(t),this._openerService,this._labelService),this._disposables.add(this._message)}show(){throw new Error("call showAtMarker")}showAtMarker(e,t,i){this._container.classList.remove("stale"),this._message.update(e),this._severity=e.severity,this._applyTheme(this._themeService.getColorTheme());const n=L.lift(e),s=this.editor.getPosition(),r=s&&n.containsPosition(s)?s:n.getStartPosition();super.show(r,this.computeRequiredHeight());const a=this.editor.getModel();if(a){const l=i>1?g("problems","{0} of {1} problems",t,i):g("change","{0} of {1} problem",t,i);this.setTitle(Bo(a.uri),l)}this._icon.className=`codicon ${AN.className(ni.toSeverity(this._severity))}`,this.editor.revealPositionNearTop(r,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()}};wp.TitleMenu=new k("gotoErrorTitleMenu");wp=PN=sfe([Lf(1,Ki),Lf(2,zs),Lf(3,dl),Lf(4,Re),Lf(5,Ae),Lf(6,lp)],wp);const v5=cv(Ba,KG),b5=cv(no,lv),C5=cv(bs,dv),ON=T("editorMarkerNavigationError.background",{dark:v5,light:v5,hcDark:nt,hcLight:nt},g("editorMarkerNavigationError","Editor marker navigation widget error color.")),rfe=T("editorMarkerNavigationError.headerBackground",{dark:we(ON,.1),light:we(ON,.1),hcDark:null,hcLight:null},g("editorMarkerNavigationErrorHeaderBackground","Editor marker navigation widget error heading background.")),u1=T("editorMarkerNavigationWarning.background",{dark:b5,light:b5,hcDark:nt,hcLight:nt},g("editorMarkerNavigationWarning","Editor marker navigation widget warning color.")),afe=T("editorMarkerNavigationWarning.headerBackground",{dark:we(u1,.1),light:we(u1,.1),hcDark:"#0C141F",hcLight:we(u1,.2)},g("editorMarkerNavigationWarningBackground","Editor marker navigation widget warning heading background.")),FN=T("editorMarkerNavigationInfo.background",{dark:C5,light:C5,hcDark:nt,hcLight:nt},g("editorMarkerNavigationInfo","Editor marker navigation widget info color.")),lfe=T("editorMarkerNavigationInfo.headerBackground",{dark:we(FN,.1),light:we(FN,.1),hcDark:null,hcLight:null},g("editorMarkerNavigationInfoHeaderBackground","Editor marker navigation widget info heading background.")),dfe=T("editorMarkerNavigation.background",{dark:ji,light:ji,hcDark:ji,hcLight:ji},g("editorMarkerNavigationBackground","Editor marker navigation widget background."));var cfe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},uC=function(o,e){return function(t,i){e(t,i,o)}},QW=function(o,e,t,i){function n(s){return s instanceof t?s:new t(function(r){r(s)})}return new(t||(t=Promise))(function(s,r){function a(c){try{d(i.next(c))}catch(h){r(h)}}function l(c){try{d(i.throw(c))}catch(h){r(h)}}function d(c){c.done?s(c.value):n(c.value).then(a,l)}d((i=i.apply(o,e||[])).next())})},t_;let Vc=t_=class{static get(e){return e.getContribution(t_.ID)}constructor(e,t,i,n,s){this._markerNavigationService=t,this._contextKeyService=i,this._editorService=n,this._instantiationService=s,this._sessionDispoables=new X,this._editor=e,this._widgetVisible=JW.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(wp,this._editor),this._widget.onDidClose(()=>this.close(),this,this._sessionDispoables),this._widgetVisible.set(!0),this._sessionDispoables.add(this._model),this._sessionDispoables.add(this._widget),this._sessionDispoables.add(this._editor.onDidChangeCursorPosition(i=>{var n,s,r;(!(!((n=this._model)===null||n===void 0)&&n.selected)||!L.containsPosition((s=this._model)===null||s===void 0?void 0:s.selected.marker,i.position))&&((r=this._model)===null||r===void 0||r.resetIndex())})),this._sessionDispoables.add(this._model.onDidChange(()=>{if(!this._widget||!this._widget.position||!this._model)return;const i=this._model.find(this._editor.getModel().uri,this._widget.position);i?this._widget.updateMarker(i.marker):this._widget.showStale()})),this._sessionDispoables.add(this._widget.onDidSelectRelatedInformation(i=>{this._editorService.openCodeEditor({resource:i.resource,options:{pinned:!0,revealIfOpened:!0,selection:L.lift(i).collapseToStart()}},this._editor),this.close(!1)})),this._sessionDispoables.add(this._editor.onDidChangeModel(()=>this._cleanUp())),this._model}close(e=!0){this._cleanUp(),e&&this._editor.focus()}showAtMarker(e){if(this._editor.hasModel()){const t=this._getOrCreateModel(this._editor.getModel().uri);t.resetIndex(),t.move(!0,this._editor.getModel(),new P(e.startLineNumber,e.startColumn)),t.selected&&this._widget.showAtMarker(t.selected.marker,t.selected.index,t.selected.total)}}nagivate(e,t){var i,n;return QW(this,void 0,void 0,function*(){if(this._editor.hasModel()){const s=this._getOrCreateModel(t?void 0:this._editor.getModel().uri);if(s.move(e,this._editor.getModel(),this._editor.getPosition()),!s.selected)return;if(s.selected.marker.resource.toString()!==this._editor.getModel().uri.toString()){this._cleanUp();const r=yield this._editorService.openCodeEditor({resource:s.selected.marker.resource,options:{pinned:!1,revealIfOpened:!0,selectionRevealType:2,selection:s.selected.marker}},this._editor);r&&((i=t_.get(r))===null||i===void 0||i.close(),(n=t_.get(r))===null||n===void 0||n.nagivate(e,t))}else this._widget.showAtMarker(s.selected.marker,s.selected.index,s.selected.total)}})}};Vc.ID="editor.contrib.markerController";Vc=t_=cfe([uC(1,XW),uC(2,Ae),uC(3,_t),uC(4,Re)],Vc);class Jy extends fe{constructor(e,t,i){super(i),this._next=e,this._multiFile=t}run(e,t){var i;return QW(this,void 0,void 0,function*(){t.hasModel()&&((i=Vc.get(t))===null||i===void 0||i.nagivate(this._next,this._multiFile))})}}class pc extends Jy{constructor(){super(!0,!1,{id:pc.ID,label:pc.LABEL,alias:"Go to Next Problem (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:E.focus,primary:578,weight:100},menuOpts:{menuId:wp.TitleMenu,title:pc.LABEL,icon:_i("marker-navigation-next",oe.arrowDown,g("nextMarkerIcon","Icon for goto next marker.")),group:"navigation",order:1}})}}pc.ID="editor.action.marker.next";pc.LABEL=g("markerAction.next.label","Go to Next Problem (Error, Warning, Info)");class ou extends Jy{constructor(){super(!1,!1,{id:ou.ID,label:ou.LABEL,alias:"Go to Previous Problem (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:E.focus,primary:1602,weight:100},menuOpts:{menuId:wp.TitleMenu,title:ou.LABEL,icon:_i("marker-navigation-previous",oe.arrowUp,g("previousMarkerIcon","Icon for goto previous marker.")),group:"navigation",order:2}})}}ou.ID="editor.action.marker.prev";ou.LABEL=g("markerAction.previous.label","Go to Previous Problem (Error, Warning, Info)");class hfe extends Jy{constructor(){super(!0,!0,{id:"editor.action.marker.nextInFiles",label:g("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:E.focus,primary:66,weight:100},menuOpts:{menuId:k.MenubarGoMenu,title:g({key:"miGotoNextProblem",comment:["&& denotes a mnemonic"]},"Next &&Problem"),group:"6_problem_nav",order:1}})}}class ufe extends Jy{constructor(){super(!1,!0,{id:"editor.action.marker.prevInFiles",label:g("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:E.focus,primary:1090,weight:100},menuOpts:{menuId:k.MenubarGoMenu,title:g({key:"miGotoPreviousProblem",comment:["&& denotes a mnemonic"]},"Previous &&Problem"),group:"6_problem_nav",order:2}})}}ft(Vc.ID,Vc,4);ne(pc);ne(ou);ne(hfe);ne(ufe);const JW=new ce("markersNavigationVisible",!1),ffe=tn.bindToContribution(Vc.get);re(new ffe({id:"closeMarkersNavigation",precondition:JW,handler:o=>o.close(),kbOpts:{weight:150,kbExpr:E.focus,primary:9,secondary:[1033]}}));var gfe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},CD=function(o,e){return function(t,i){e(t,i,o)}};const Go=te;class pfe{constructor(e,t,i){this.owner=e,this.range=t,this.marker=i}isValidForHoverAnchor(e){return e.type===1&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}const w5={type:1,filter:{include:Ne.QuickFix},triggerAction:Vs.QuickFixHover};let BN=class{constructor(e,t,i,n){this._editor=e,this._markerDecorationsService=t,this._openerService=i,this._languageFeaturesService=n,this.hoverOrdinal=1,this.recentMarkerCodeActionsInfo=void 0}computeSync(e,t){if(!this._editor.hasModel()||e.type!==1&&!e.supportsMarkerHover)return[];const i=this._editor.getModel(),n=e.range.startLineNumber,s=i.getLineMaxColumn(n),r=[];for(const a of t){const l=a.range.startLineNumber===n?a.range.startColumn:1,d=a.range.endLineNumber===n?a.range.endColumn:s,c=this._markerDecorationsService.getMarker(i.uri,a);if(!c)continue;const h=new L(e.range.startLineNumber,l,e.range.startLineNumber,d);r.push(new pfe(this,h,c))}return r}renderHoverParts(e,t){if(!t.length)return H.None;const i=new X;t.forEach(s=>e.fragment.appendChild(this.renderMarkerHover(s,i)));const n=t.length===1?t[0]:t.sort((s,r)=>ni.compare(s.marker.severity,r.marker.severity))[0];return this.renderMarkerStatusbar(e,n,i),i}renderMarkerHover(e,t){const i=Go("div.hover-row"),n=Y(i,Go("div.marker.hover-contents")),{source:s,message:r,code:a,relatedInformation:l}=e.marker;this._editor.applyFontInfo(n);const d=Y(n,Go("span"));if(d.style.whiteSpace="pre-wrap",d.innerText=r,s||a)if(a&&typeof a!="string"){const c=Go("span");if(s){const p=Y(c,Go("span"));p.innerText=s}const h=Y(c,Go("a.code-link"));h.setAttribute("href",a.target.toString()),t.add($(h,"click",p=>{this._openerService.open(a.target,{allowCommands:!0}),p.preventDefault(),p.stopPropagation()}));const u=Y(h,Go("span"));u.innerText=a.value;const f=Y(n,c);f.style.opacity="0.6",f.style.paddingLeft="6px"}else{const c=Y(n,Go("span"));c.style.opacity="0.6",c.style.paddingLeft="6px",c.innerText=s&&a?`${s}(${a})`:s||`(${a})`}if(Fn(l))for(const{message:c,resource:h,startLineNumber:u,startColumn:f}of l){const p=Y(n,Go("div"));p.style.marginTop="8px";const m=Y(p,Go("a"));m.innerText=`${Bo(h)}(${u}, ${f}): `,m.style.cursor="pointer",t.add($(m,"click",_=>{_.stopPropagation(),_.preventDefault(),this._openerService&&this._openerService.open(h,{fromUserGesture:!0,editorOptions:{selection:{startLineNumber:u,startColumn:f}}}).catch(He)}));const v=Y(p,Go("span"));v.innerText=c,this._editor.applyFontInfo(v)}return i}renderMarkerStatusbar(e,t,i){if((t.marker.severity===ni.Error||t.marker.severity===ni.Warning||t.marker.severity===ni.Info)&&e.statusBar.addAction({label:g("view problem","View Problem"),commandId:pc.ID,run:()=>{var n;e.hide(),(n=Vc.get(this._editor))===null||n===void 0||n.showAtMarker(t.marker),this._editor.focus()}}),!this._editor.getOption(90)){const n=e.statusBar.append(Go("div"));this.recentMarkerCodeActionsInfo&&(xw.makeKey(this.recentMarkerCodeActionsInfo.marker)===xw.makeKey(t.marker)?this.recentMarkerCodeActionsInfo.hasCodeActions||(n.textContent=g("noQuickFixes","No quick fixes available")):this.recentMarkerCodeActionsInfo=void 0);const s=this.recentMarkerCodeActionsInfo&&!this.recentMarkerCodeActionsInfo.hasCodeActions?H.None:i.add(xc(()=>n.textContent=g("checkingForQuickFixes","Checking for quick fixes..."),200));n.textContent||(n.textContent=" ");const r=this.getCodeActions(t.marker);i.add(Me(()=>r.cancel())),r.then(a=>{if(s.dispose(),this.recentMarkerCodeActionsInfo={marker:t.marker,hasCodeActions:a.validActions.length>0},!this.recentMarkerCodeActionsInfo.hasCodeActions){a.dispose(),n.textContent=g("noQuickFixes","No quick fixes available");return}n.style.display="none";let l=!1;i.add(Me(()=>{l||a.dispose()})),e.statusBar.addAction({label:g("quick fixes","Quick Fix..."),commandId:DM,run:d=>{l=!0;const c=Pc.get(this._editor),h=Ai(d);e.hide(),c?.showCodeActions(w5,a,{x:h.left,y:h.top,width:h.width,height:h.height})}})},He)}}getCodeActions(e){return Wi(t=>I_(this._languageFeaturesService.codeActionProvider,this._editor.getModel(),new L(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn),w5,Jl.None,t))}};BN=gfe([CD(1,z2),CD(2,zs),CD(3,pe)],BN);const eV="editor.action.inlineSuggest.commit",tV="editor.action.inlineSuggest.showPrevious",iV="editor.action.inlineSuggest.showNext";var mfe=function(o,e,t,i){function n(s){return s instanceof t?s:new t(function(r){r(s)})}return new(t||(t=Promise))(function(s,r){function a(c){try{d(i.next(c))}catch(h){r(h)}}function l(c){try{d(i.throw(c))}catch(h){r(h)}}function d(c){c.done?s(c.value):n(c.value).then(a,l)}d((i=i.apply(o,e||[])).next())})};class _fe extends H{constructor(e,t,i={orientation:0}){super(),this.submenuActionViewItems=[],this.hasSecondaryActions=!1,this._onDidChangeDropdownVisibility=this._register(new aU),this.onDidChangeDropdownVisibility=this._onDidChangeDropdownVisibility.event,this.disposables=this._register(new X),this.options=i,this.lookupKeybindings=typeof this.options.getKeyBinding=="function",this.toggleMenuAction=this._register(new Zv(()=>{var n;return(n=this.toggleMenuActionViewItem)===null||n===void 0?void 0:n.show()},i.toggleMenuTitle)),this.element=document.createElement("div"),this.element.className="monaco-toolbar",e.appendChild(this.element),this.actionBar=this._register(new Wo(this.element,{orientation:i.orientation,ariaLabel:i.ariaLabel,actionRunner:i.actionRunner,allowContextMenu:i.allowContextMenu,highlightToggledItems:i.highlightToggledItems,actionViewItemProvider:(n,s)=>{var r;if(n.id===Zv.ID)return this.toggleMenuActionViewItem=new vw(n,n.menuActions,t,{actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,keybindingProvider:this.options.getKeyBinding,classNames:Ie.asClassNameArray((r=i.moreIcon)!==null&&r!==void 0?r:oe.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(i.actionViewItemProvider){const a=i.actionViewItemProvider(n,s);if(a)return a}if(n instanceof Gg){const a=new vw(n,n.actions,t,{actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,keybindingProvider:this.options.getKeyBinding,classNames:n.class,anchorAlignmentProvider:this.options.anchorAlignmentProvider,menuAsChild:!!this.options.renderDropdownAsChildElement,skipTelemetry:this.options.skipTelemetry});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 i=e?e.slice(0):[];this.hasSecondaryActions=!!(t&&t.length>0),this.hasSecondaryActions&&t&&(this.toggleMenuAction.menuActions=t.slice(0),i.push(this.toggleMenuAction)),i.forEach(n=>{this.actionBar.push(n,{icon:!0,label:!1,keybinding:this.getKeybindingLabel(n)})})}getKeybindingLabel(e){var t,i,n;const s=this.lookupKeybindings?(i=(t=this.options).getKeyBinding)===null||i===void 0?void 0:i.call(t,e):void 0;return(n=s?.getLabel())!==null&&n!==void 0?n:void 0}clear(){this.submenuActionViewItems=[],this.disposables.clear(),this.actionBar.clear()}dispose(){this.clear(),this.disposables.dispose(),super.dispose()}}class Zv extends as{constructor(e,t){t=t||g("moreActions","More Actions..."),super(Zv.ID,t,void 0,!0),this._menuActions=[],this.toggleDropdownMenu=e}run(){return mfe(this,void 0,void 0,function*(){this.toggleDropdownMenu()})}get menuActions(){return this._menuActions}set menuActions(e){this._menuActions=e}}Zv.ID="toolbar.toggle.more";var vfe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},km=function(o,e){return function(t,i){e(t,i,o)}};let WN=class extends _fe{constructor(e,t,i,n,s,r,a){super(e,s,Object.assign(Object.assign({getKeyBinding:d=>{var c;return(c=r.lookupKeybinding(d.id))!==null&&c!==void 0?c:void 0}},t),{allowContextMenu:!0,skipTelemetry:typeof t?.telemetrySource=="string"})),this._options=t,this._menuService=i,this._contextKeyService=n,this._contextMenuService=s,this._sessionDisposables=this._store.add(new X);const l=t?.telemetrySource;l&&this._store.add(this.actionBar.onDidRun(d=>a.publicLog2("workbenchActionExecuted",{id:d.action.id,from:l})))}setActions(e,t=[],i){var n,s,r;this._sessionDisposables.clear();const a=e.slice(),l=t.slice(),d=[];let c=0;const h=[];let u=!1;if(((n=this._options)===null||n===void 0?void 0:n.hiddenItemStrategy)!==-1)for(let f=0;f<a.length;f++){const p=a[f];!(p instanceof dr)&&!(p instanceof Y_)||p.hideActions&&(d.push(p.hideActions.toggle),p.hideActions.toggle.checked&&c++,p.hideActions.isHidden&&(u=!0,a[f]=void 0,((s=this._options)===null||s===void 0?void 0:s.hiddenItemStrategy)!==0&&(h[f]=p)))}if(((r=this._options)===null||r===void 0?void 0:r.overflowBehavior)!==void 0){const f=Tse(new Set(this._options.overflowBehavior.exempted),Xe.map(a,v=>v?.id)),p=this._options.overflowBehavior.maxItems-f.size;let m=0;for(let v=0;v<a.length;v++){const _=a[v];_&&(m++,!f.has(_.id)&&m>=p&&(a[v]=void 0,h[v]=_))}}xA(a),xA(h),super.setActions(a,en.join(h,l)),d.length>0&&this._sessionDisposables.add($(this.getElement(),"contextmenu",f=>{var p,m,v,_,b;const C=new Do(f),w=this.getItemAction(C.target);if(!w)return;C.preventDefault(),C.stopPropagation();let S=!1;if(c===1&&((p=this._options)===null||p===void 0?void 0:p.hiddenItemStrategy)===0){S=!0;for(let I=0;I<d.length;I++)if(d[I].checked){d[I]=mg({id:w.id,label:w.label,checked:!0,enabled:!1,run(){}});break}}let D;if(!S&&(w instanceof dr||w instanceof Y_)){if(!w.hideActions)return;D=w.hideActions.hide}else D=mg({id:"label",label:g("hide","Hide"),enabled:!1,run(){}});const x=en.join([D],d);!((m=this._options)===null||m===void 0)&&m.resetMenu&&!i&&(i=[this._options.resetMenu]),u&&i&&(x.push(new en),x.push(mg({id:"resetThisMenu",label:g("resetThisMenu","Reset Menu"),run:()=>this._menuService.resetHiddenStates(i)}))),this._contextMenuService.showContextMenu({getAnchor:()=>C,getActions:()=>x,menuId:(v=this._options)===null||v===void 0?void 0:v.contextMenu,menuActionOptions:Object.assign({renderShortTitle:!0},(_=this._options)===null||_===void 0?void 0:_.menuOptions),skipTelemetry:typeof((b=this._options)===null||b===void 0?void 0:b.telemetrySource)=="string",contextKeyService:this._contextKeyService})}))}};WN=vfe([km(2,dl),km(3,Ae),km(4,pr),km(5,Nt),km(6,go)],WN);var BM=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Hr=function(o,e){return function(t,i){e(t,i,o)}},f1;let VN=class extends H{constructor(e,t,i){super(),this.editor=e,this.model=t,this.instantiationService=i,this.alwaysShowToolbar=un(this.editor.onDidChangeConfiguration,()=>this.editor.getOption(62).showToolbar==="always"),this.sessionPosition=void 0,this.position=ot(this,n=>{var s,r,a;const l=(s=this.model.read(n))===null||s===void 0?void 0:s.ghostText.read(n);if(!this.alwaysShowToolbar.read(n)||!l||l.parts.length===0)return this.sessionPosition=void 0,null;const d=l.parts[0].column;this.sessionPosition&&this.sessionPosition.lineNumber!==l.lineNumber&&(this.sessionPosition=void 0);const c=new P(l.lineNumber,Math.min(d,(a=(r=this.sessionPosition)===null||r===void 0?void 0:r.column)!==null&&a!==void 0?a:Number.MAX_SAFE_INTEGER));return this.sessionPosition=c,c}),this._register(Ns((n,s)=>{const r=this.model.read(n);if(!r||!this.alwaysShowToolbar.read(n))return;const a=s.add(this.instantiationService.createInstance(Hc,this.editor,!0,this.position,r.selectedInlineCompletionIndex,r.inlineCompletionsCount,r.selectedInlineCompletion.map(l=>{var d;return(d=l?.inlineCompletion.source.inlineCompletions.commands)!==null&&d!==void 0?d:[]})));e.addContentWidget(a),s.add(Me(()=>e.removeContentWidget(a))),s.add(Mt(l=>{this.position.read(l)&&r.lastTriggerKind.read(l)!==Yl.Explicit&&r.triggerExplicitly()}))}))}};VN=BM([Hr(2,Re)],VN);const bfe=_i("inline-suggestion-hints-next",oe.chevronRight,g("parameterHintsNextIcon","Icon for show next parameter hint.")),Cfe=_i("inline-suggestion-hints-previous",oe.chevronLeft,g("parameterHintsPreviousIcon","Icon for show previous parameter hint."));let Hc=f1=class extends H{static get dropDownVisible(){return this._dropDownVisible}createCommandAction(e,t,i){const n=new as(e,t,i,!0,()=>this._commandService.executeCommand(e)),s=this.keybindingService.lookupKeybinding(e,this._contextKeyService);let r=t;return s&&(r=g({key:"content",comment:["A label","A keybinding"]},"{0} ({1})",t,s.getLabel())),n.tooltip=r,n}constructor(e,t,i,n,s,r,a,l,d,c,h){super(),this.editor=e,this.withBorder=t,this._position=i,this._currentSuggestionIdx=n,this._suggestionCount=s,this._extraCommands=r,this._commandService=a,this.keybindingService=d,this._contextKeyService=c,this._menuService=h,this.id=`InlineSuggestionHintsContentWidget${f1.id++}`,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this.nodes=rn("div.inlineSuggestionsHints",{className:this.withBorder?".withBorder":""},[rn("div@toolBar")]),this.previousAction=this.createCommandAction(tV,g("previous","Previous"),Ie.asClassName(Cfe)),this.availableSuggestionCountAction=new as("inlineSuggestionHints.availableSuggestionCount","",void 0,!1),this.nextAction=this.createCommandAction(iV,g("next","Next"),Ie.asClassName(bfe)),this.inlineCompletionsActionsMenus=this._register(this._menuService.createMenu(k.InlineCompletionsActions,this._contextKeyService)),this.clearAvailableSuggestionCountLabelDebounced=this._register(new Dt(()=>{this.availableSuggestionCountAction.label=""},100)),this.disableButtonsDebounced=this._register(new Dt(()=>{this.previousAction.enabled=this.nextAction.enabled=!1},100)),this.lastCommands=[],this.toolBar=this._register(l.createInstance(HN,this.nodes.toolBar,k.InlineSuggestionToolbar,{menuOptions:{renderShortTitle:!0},toolbarOptions:{primaryGroup:u=>u.startsWith("primary")},actionViewItemProvider:(u,f)=>{if(u instanceof dr)return l.createInstance(Sfe,u,void 0);if(u===this.availableSuggestionCountAction){const p=new wfe(void 0,u,{label:!0,icon:!1});return p.setClass("availableSuggestionCount"),p}},telemetrySource:"InlineSuggestionToolbar"})),this.toolBar.setPrependedPrimaryActions([this.previousAction,this.availableSuggestionCountAction,this.nextAction]),this._register(this.toolBar.onDidChangeDropdownVisibility(u=>{f1._dropDownVisible=u})),this._register(Mt(u=>{this._position.read(u),this.editor.layoutContentWidget(this)})),this._register(Mt(u=>{const f=this._suggestionCount.read(u),p=this._currentSuggestionIdx.read(u);f!==void 0?(this.clearAvailableSuggestionCountLabelDebounced.cancel(),this.availableSuggestionCountAction.label=`${p+1}/${f}`):this.clearAvailableSuggestionCountLabelDebounced.schedule(),f!==void 0&&f>1?(this.disableButtonsDebounced.cancel(),this.previousAction.enabled=this.nextAction.enabled=!0):this.disableButtonsDebounced.schedule()})),this._register(Mt(u=>{const f=this._extraCommands.read(u);if(mi(this.lastCommands,f))return;this.lastCommands=f;const p=f.map(m=>({class:void 0,id:m.id,enabled:!0,tooltip:m.tooltip||"",label:m.title,run:v=>this._commandService.executeCommand(m.id)}));for(const[m,v]of this.inlineCompletionsActionsMenus.getActions())for(const _ of v)_ instanceof dr&&p.push(_);p.length>0&&p.unshift(new en),this.toolBar.setAdditionalSecondaryActions(p)}))}getId(){return this.id}getDomNode(){return this.nodes.root}getPosition(){return{position:this._position.get(),preference:[1,2],positionAffinity:3}}};Hc._dropDownVisible=!1;Hc.id=0;Hc=f1=BM([Hr(6,li),Hr(7,Re),Hr(8,Nt),Hr(9,Ae),Hr(10,dl)],Hc);class wfe extends up{constructor(){super(...arguments),this._className=void 0}setClass(e){this._className=e}render(e){super.render(e),this._className&&e.classList.add(this._className)}}let Sfe=class extends Cu{updateLabel(){const e=this._keybindingService.lookupKeybinding(this._action.id,this._contextKeyService);if(!e)return super.updateLabel();if(this.label){const t=rn("div.keybinding").root;new z0(t,to,Object.assign({disableTitle:!0},Zoe)).set(e),this.label.textContent=this._action.label,this.label.appendChild(t),this.label.classList.add("inlineSuggestionStatusBarItemLabel")}}},HN=class extends WN{constructor(e,t,i,n,s,r,a,l){super(e,Object.assign({resetMenu:t},i),n,s,r,a,l),this.menuId=t,this.options2=i,this.menuService=n,this.contextKeyService=s,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,i,n,s,r,a;const l=[],d=[];DB(this.menu,(e=this.options2)===null||e===void 0?void 0:e.menuOptions,{primary:l,secondary:d},(i=(t=this.options2)===null||t===void 0?void 0:t.toolbarOptions)===null||i===void 0?void 0:i.primaryGroup,(s=(n=this.options2)===null||n===void 0?void 0:n.toolbarOptions)===null||s===void 0?void 0:s.shouldInlineSubmenu,(a=(r=this.options2)===null||r===void 0?void 0:r.toolbarOptions)===null||a===void 0?void 0:a.useSeparatorsInPrimaryActions),d.push(...this.additionalActions),l.unshift(...this.prependedPrimaryActions),this.setActions(l,d)}setPrependedPrimaryActions(e){mi(this.prependedPrimaryActions,e,(t,i)=>t===i)||(this.prependedPrimaryActions=e,this.updateToolbar())}setAdditionalSecondaryActions(e){mi(this.additionalActions,e,(t,i)=>t===i)||(this.additionalActions=e,this.updateToolbar())}};HN=BM([Hr(3,dl),Hr(4,Ae),Hr(5,pr),Hr(6,Nt),Hr(7,go)],HN);var yfe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},fC=function(o,e){return function(t,i){e(t,i,o)}},zN;const Lfe=!1;let ys=zN=class extends H{static get(e){return e.getContribution(zN.ID)}constructor(e,t,i,n,s){super(),this._editor=e,this._instantiationService=t,this._openerService=i,this._languageService=n,this._keybindingService=s,this._toUnhook=new X,this._hoverActivatedByColorDecoratorClick=!1,this._isMouseDown=!1,this._hoverClicked=!1,this._contentWidget=null,this._glyphWidget=null,this._reactToEditorMouseMoveRunner=this._register(new Dt(()=>this._reactToEditorMouseMove(this._mouseMoveEvent),0)),this._hookEvents(),this._register(this._editor.onDidChangeConfiguration(r=>{r.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(i=>this._onEditorMouseDown(i))),this._toUnhook.add(this._editor.onMouseUp(i=>this._onEditorMouseUp(i))),this._toUnhook.add(this._editor.onMouseMove(i=>this._onEditorMouseMove(i))),this._toUnhook.add(this._editor.onKeyDown(i=>this._onKeyDown(i)))):(this._toUnhook.add(this._editor.onMouseMove(i=>this._onEditorMouseMove(i))),this._toUnhook.add(this._editor.onKeyDown(i=>this._onKeyDown(i)))),this._toUnhook.add(this._editor.onMouseLeave(i=>this._onEditorMouseLeave(i))),this._toUnhook.add(this._editor.onDidChangeModel(e)),this._toUnhook.add(this._editor.onDidScrollChange(i=>this._onEditorScrollChanged(i)))}_unhookEvents(){this._toUnhook.clear()}_onEditorScrollChanged(e){(e.scrollTopChanged||e.scrollLeftChanged)&&this._hideWidgets()}_onEditorMouseDown(e){var t;this._isMouseDown=!0;const i=e.target;if(i.type===9&&i.detail===gc.ID){this._hoverClicked=!0;return}i.type===12&&i.detail===Bg.ID||(i.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,i;const n=e.event.browserEvent.relatedTarget;!((t=this._contentWidget)===null||t===void 0)&&t.widget.isResizing||!((i=this._contentWidget)===null||i===void 0)&&i.containsNode(n)||this._hideWidgets()}_isMouseOverWidget(e){var t,i,n,s,r;const a=e.target;return!!(this._isHoverSticky&&a.type===9&&a.detail===gc.ID||this._isHoverSticky&&(!((t=this._contentWidget)===null||t===void 0)&&t.containsNode((i=e.event.browserEvent.view)===null||i===void 0?void 0:i.document.activeElement))&&!(!((s=(n=e.event.browserEvent.view)===null||n===void 0?void 0:n.getSelection())===null||s===void 0)&&s.isCollapsed)||!this._isHoverSticky&&a.type===9&&a.detail===gc.ID&&(!((r=this._contentWidget)===null||r===void 0)&&r.isColorPickerVisible)||this._isHoverSticky&&a.type===12&&a.detail===Bg.ID)}_onEditorMouseMove(e){var t,i,n,s;if(this._mouseMoveEvent=e,!((t=this._contentWidget)===null||t===void 0)&&t.isFocused||!((i=this._contentWidget)===null||i===void 0)&&i.isResizing||this._isMouseDown&&this._hoverClicked||this._isHoverSticky&&(!((n=this._contentWidget)===null||n===void 0)&&n.isVisibleFromKeyboard))return;if(this._isMouseOverWidget(e)){this._reactToEditorMouseMoveRunner.cancel();return}if(!((s=this._contentWidget)===null||s===void 0)&&s.isVisible&&this._isHoverSticky&&this._hidingDelay>0){this._reactToEditorMouseMoveRunner.isScheduled()||this._reactToEditorMouseMoveRunner.schedule(this._hidingDelay);return}this._reactToEditorMouseMove(e)}_reactToEditorMouseMove(e){var t,i,n;if(!e)return;const s=e.target,r=(t=s.element)===null||t===void 0?void 0:t.classList.contains("colorpicker-color-decoration"),a=this._editor.getOption(146);if(r&&(a==="click"&&!this._hoverActivatedByColorDecoratorClick||a==="hover"&&!this._isHoverEnabled&&!Lfe||a==="clickAndHover"&&!this._isHoverEnabled&&!this._hoverActivatedByColorDecoratorClick)||!r&&!this._isHoverEnabled&&!this._hoverActivatedByColorDecoratorClick){this._hideWidgets();return}if(this._getOrCreateContentWidget().maybeShowAt(e)){(i=this._glyphWidget)===null||i===void 0||i.hide();return}if(s.type===2&&s.position){(n=this._contentWidget)===null||n===void 0||n.hide(),this._glyphWidget||(this._glyphWidget=new Bg(this._editor,this._languageService,this._openerService)),this._glyphWidget.startShowingAt(s.position.lineNumber);return}this._hideWidgets()}_onKeyDown(e){var t;if(!this._editor.hasModel())return;const i=this._keybindingService.softDispatch(e,this._editor.getDomNode()),n=i.kind===1||i.kind===2&&i.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&&!n&&this._hideWidgets()}_hideWidgets(){var e,t,i;this._isMouseDown&&this._hoverClicked&&(!((e=this._contentWidget)===null||e===void 0)&&e.isColorPickerVisible)||Hc.dropDownVisible||(this._hoverActivatedByColorDecoratorClick=!1,this._hoverClicked=!1,(t=this._glyphWidget)===null||t===void 0||t.hide(),(i=this._contentWidget)===null||i===void 0||i.hide())}_getOrCreateContentWidget(){return this._contentWidget||(this._contentWidget=this._instantiationService.createInstance(Yw,this._editor)),this._contentWidget}showContentHover(e,t,i,n,s=!1){this._hoverActivatedByColorDecoratorClick=s,this._getOrCreateContentWidget().startShowingAtRange(e,t,i,n)}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()}};ys.ID="editor.contrib.hover";ys=zN=yfe([fC(1,Re),fC(2,zs),fC(3,qt),fC(4,Nt)],ys);class xfe extends fe{constructor(){super({id:"editor.action.showHover",label:g({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:E.editorTextFocus,primary:Pi(2089,2087),weight:100}})}run(e,t,i){if(!t.hasModel())return;const n=ys.get(t);if(!n)return;const s=t.getPosition(),r=new L(s.lineNumber,s.column,s.lineNumber,s.column),a=t.getOption(2)===2||!!i?.focus;n.isHoverVisible?n.focus():n.showContentHover(r,1,1,a)}}class Dfe extends fe{constructor(){super({id:"editor.action.showDefinitionPreviewHover",label:g({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 i=ys.get(t);if(!i)return;const n=t.getPosition();if(!n)return;const s=new L(n.lineNumber,n.column,n.lineNumber,n.column),r=Nu.get(t);if(!r)return;r.startFindDefinitionFromCursor(n).then(()=>{i.showContentHover(s,1,1,!0)})}}class kfe extends fe{constructor(){super({id:"editor.action.scrollUpHover",label:g({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:E.hoverFocused,kbOpts:{kbExpr:E.hoverFocused,primary:16,weight:100}})}run(e,t){const i=ys.get(t);i&&i.scrollUp()}}class Ife extends fe{constructor(){super({id:"editor.action.scrollDownHover",label:g({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:E.hoverFocused,kbOpts:{kbExpr:E.hoverFocused,primary:18,weight:100}})}run(e,t){const i=ys.get(t);i&&i.scrollDown()}}class Efe extends fe{constructor(){super({id:"editor.action.scrollLeftHover",label:g({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:E.hoverFocused,kbOpts:{kbExpr:E.hoverFocused,primary:15,weight:100}})}run(e,t){const i=ys.get(t);i&&i.scrollLeft()}}class Nfe extends fe{constructor(){super({id:"editor.action.scrollRightHover",label:g({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:E.hoverFocused,kbOpts:{kbExpr:E.hoverFocused,primary:17,weight:100}})}run(e,t){const i=ys.get(t);i&&i.scrollRight()}}class Tfe extends fe{constructor(){super({id:"editor.action.pageUpHover",label:g({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:E.hoverFocused,kbOpts:{kbExpr:E.hoverFocused,primary:11,secondary:[528],weight:100}})}run(e,t){const i=ys.get(t);i&&i.pageUp()}}class Rfe extends fe{constructor(){super({id:"editor.action.pageDownHover",label:g({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:E.hoverFocused,kbOpts:{kbExpr:E.hoverFocused,primary:12,secondary:[530],weight:100}})}run(e,t){const i=ys.get(t);i&&i.pageDown()}}class Mfe extends fe{constructor(){super({id:"editor.action.goToTopHover",label:g({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:E.hoverFocused,kbOpts:{kbExpr:E.hoverFocused,primary:14,secondary:[2064],weight:100}})}run(e,t){const i=ys.get(t);i&&i.goToTop()}}class Afe extends fe{constructor(){super({id:"editor.action.goToBottomHover",label:g({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:E.hoverFocused,kbOpts:{kbExpr:E.hoverFocused,primary:13,secondary:[2066],weight:100}})}run(e,t){const i=ys.get(t);i&&i.goToBottom()}}ft(ys.ID,ys,2);ne(xfe);ne(Dfe);ne(kfe);ne(Ife);ne(Efe);ne(Nfe);ne(Tfe);ne(Rfe);ne(Mfe);ne(Afe);lf.register(Jw);lf.register(BN);gr((o,e)=>{const t=o.getColor(aZ);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 UN extends H{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 i=e.target;if(i.type!==6||!i.detail.injectedText||i.detail.injectedText.options.attachedData!==DW||!i.range)return;const n=this._editor.getContribution(ys.ID);if(n&&!n.isColorPickerVisible){const s=new L(i.range.startLineNumber,i.range.startColumn+1,i.range.endLineNumber,i.range.endColumn+1);n.showContentHover(s,1,0,!1,!0)}}}UN.ID="editor.contrib.colorContribution";ft(UN.ID,UN,2);lf.register(Gw);var nV=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Fr=function(o,e){return function(t,i){e(t,i,o)}},S5=function(o,e,t,i){function n(s){return s instanceof t?s:new t(function(r){r(s)})}return new(t||(t=Promise))(function(s,r){function a(c){try{d(i.next(c))}catch(h){r(h)}}function l(c){try{d(i.throw(c))}catch(h){r(h)}}function d(c){c.done?s(c.value):n(c.value).then(a,l)}d((i=i.apply(o,e||[])).next())})},$N,jN;let zc=$N=class extends H{constructor(e,t,i,n,s,r,a){super(),this._editor=e,this._modelService=i,this._keybindingService=n,this._instantiationService=s,this._languageFeatureService=r,this._languageConfigurationService=a,this._standaloneColorPickerWidget=null,this._standaloneColorPickerVisible=E.standaloneColorPickerVisible.bindTo(t),this._standaloneColorPickerFocused=E.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 tS(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($N.ID)}};zc.ID="editor.contrib.standaloneColorPickerController";zc=$N=nV([Fr(1,Ae),Fr(2,Yt),Fr(3,Nt),Fr(4,Re),Fr(5,pe),Fr(6,At)],zc);ft(zc.ID,zc,1);const y5=8,Pfe=22;let tS=jN=class extends H{constructor(e,t,i,n,s,r,a,l){var d;super(),this._editor=e,this._standaloneColorPickerVisible=t,this._standaloneColorPickerFocused=i,this._modelService=s,this._keybindingService=r,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 A),this.onResult=this._onResult.event,this._standaloneColorPickerVisible.set(!0),this._standaloneColorPickerParticipant=n.createInstance(jv,this._editor),this._position=(d=this._editor._getViewModel())===null||d===void 0?void 0:d.getPrimaryCursorState().modelState.position;const c=this._editor.getSelection(),h=c?{startLineNumber:c.startLineNumber,startColumn:c.startColumn,endLineNumber:c.endLineNumber,endColumn:c.endColumn}:{startLineNumber:0,endLineNumber:0,endColumn:0,startColumn:0},u=this._register(Qa(this._body));this._register(u.onDidBlur(f=>{this.hide()})),this._register(u.onDidFocus(f=>{this.focus()})),this._register(this._editor.onDidChangeCursorPosition(()=>{this._selectionSetInEditor?this._selectionSetInEditor=!1:this.hide()})),this._register(this._editor.onMouseMove(f=>{var p;const m=(p=f.target.element)===null||p===void 0?void 0:p.classList;m&&m.contains("colorpicker-color-decoration")&&this.hide()})),this._register(this.onResult(f=>{this._render(f.value,f.foundInEditor)})),this._start(h),this._body.style.zIndex="50",this._editor.addContentWidget(this)}updateEditor(){this._colorHover&&this._standaloneColorPickerParticipant.updateEditorModel(this._colorHover)}getId(){return jN.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 S5(this,void 0,void 0,function*(){const t=yield this._computeAsync(e);t&&this._onResult.fire(new Ofe(t.result,t.foundInEditor))})}_computeAsync(e){return S5(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}},i=yield this._standaloneColorPickerParticipant.createColorHover(t,new NM(this._modelService,this._languageConfigurationService),this._languageFeaturesService.colorProvider);return i?{result:i.colorHover,foundInEditor:i.foundInEditor}:null})}_render(e,t){const i=document.createDocumentFragment(),n=this._register(new Xw(this._keybindingService));let s;const r={fragment:i,statusBar:n,setColorPicker:m=>s=m,onContentsChanged:()=>{},hide:()=>this.hide()};if(this._colorHover=e,this._register(this._standaloneColorPickerParticipant.renderHoverParts(r,[e])),s===void 0)return;this._body.classList.add("standalone-colorpicker-body"),this._body.style.maxHeight=Math.max(this._editor.getLayoutInfo().height/4,250)+"px",this._body.style.maxWidth=Math.max(this._editor.getLayoutInfo().width*.66,500)+"px",this._body.tabIndex=0,this._body.appendChild(i),s.layout();const a=s.body,l=a.saturationBox.domNode.clientWidth,d=a.domNode.clientWidth-l-Pfe-y5,c=s.body.enterButton;c?.onClicked(()=>{this.updateEditor(),this.hide()});const h=s.header,u=h.pickedColorNode;u.style.width=l+y5+"px";const f=h.originalColorNode;f.style.width=d+"px";const p=s.header.closeButton;p?.onClicked(()=>{this.hide()}),t&&(c&&(c.button.textContent="Replace"),this._selectionSetInEditor=!0,this._editor.setSelection(e.range)),this._editor.layoutContentWidget(this)}};tS.ID="editor.contrib.standaloneColorPickerWidget";tS=jN=nV([Fr(3,Re),Fr(4,Yt),Fr(5,Nt),Fr(6,pe),Fr(7,At)],tS);class Ofe{constructor(e,t){this.value=e,this.foundInEditor=t}}class Ffe extends ra{constructor(){super({id:"editor.action.showOrFocusStandaloneColorPicker",title:{value:g("showOrFocusStandaloneColorPicker","Show or Focus Standalone Color Picker"),mnemonicTitle:g({key:"mishowOrFocusStandaloneColorPicker",comment:["&& denotes a mnemonic"]},"&&Show or Focus Standalone Color Picker"),original:"Show or Focus Standalone Color Picker"},precondition:void 0,menu:[{id:k.CommandPalette}]})}runEditorCommand(e,t){var i;(i=zc.get(t))===null||i===void 0||i.showOrFocus()}}class Bfe extends fe{constructor(){super({id:"editor.action.hideColorPicker",label:g({key:"hideColorPicker",comment:["Action that hides the color picker"]},"Hide the Color Picker"),alias:"Hide the Color Picker",precondition:E.standaloneColorPickerVisible.isEqualTo(!0),kbOpts:{primary:9,weight:100}})}run(e,t){var i;(i=zc.get(t))===null||i===void 0||i.hide()}}class Wfe extends fe{constructor(){super({id:"editor.action.insertColorWithStandaloneColorPicker",label:g({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:E.standaloneColorPickerFocused.isEqualTo(!0),kbOpts:{primary:3,weight:100}})}run(e,t){var i;(i=zc.get(t))===null||i===void 0||i.insertColor()}}ne(Bfe);ne(Wfe);jt(Ffe);class Jd{constructor(e,t,i){this.languageConfigurationService=i,this._selection=e,this._insertSpace=t,this._usedEndToken=null}static _haystackHasNeedleAtOffset(e,t,i){if(i<0)return!1;const n=t.length,s=e.length;if(i+n>s)return!1;for(let r=0;r<n;r++){const a=e.charCodeAt(i+r),l=t.charCodeAt(r);if(a!==l&&!(a>=65&&a<=90&&a+32===l)&&!(l>=65&&l<=90&&l+32===a))return!1}return!0}_createOperationsForBlockComment(e,t,i,n,s,r){const a=e.startLineNumber,l=e.startColumn,d=e.endLineNumber,c=e.endColumn,h=s.getLineContent(a),u=s.getLineContent(d);let f=h.lastIndexOf(t,l-1+t.length),p=u.indexOf(i,c-1-i.length);if(f!==-1&&p!==-1)if(a===d)h.substring(f+t.length,p).indexOf(i)>=0&&(f=-1,p=-1);else{const v=h.substring(f+t.length),_=u.substring(0,p);(v.indexOf(i)>=0||_.indexOf(i)>=0)&&(f=-1,p=-1)}let m;f!==-1&&p!==-1?(n&&f+t.length<h.length&&h.charCodeAt(f+t.length)===32&&(t=t+" "),n&&p>0&&u.charCodeAt(p-1)===32&&(i=" "+i,p-=1),m=Jd._createRemoveBlockCommentOperations(new L(a,f+t.length+1,d,p+1),t,i)):(m=Jd._createAddBlockCommentOperations(e,t,i,this._insertSpace),this._usedEndToken=m.length===1?i:null);for(const v of m)r.addTrackedEditOperation(v.range,v.text)}static _createRemoveBlockCommentOperations(e,t,i){const n=[];return L.isEmpty(e)?n.push(Zt.delete(new L(e.startLineNumber,e.startColumn-t.length,e.endLineNumber,e.endColumn+i.length))):(n.push(Zt.delete(new L(e.startLineNumber,e.startColumn-t.length,e.startLineNumber,e.startColumn))),n.push(Zt.delete(new L(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn+i.length)))),n}static _createAddBlockCommentOperations(e,t,i,n){const s=[];return L.isEmpty(e)?s.push(Zt.replace(new L(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn),t+" "+i)):(s.push(Zt.insert(new P(e.startLineNumber,e.startColumn),t+(n?" ":""))),s.push(Zt.insert(new P(e.endLineNumber,e.endColumn),(n?" ":"")+i))),s}getEditOperations(e,t){const i=this._selection.startLineNumber,n=this._selection.startColumn;e.tokenization.tokenizeIfCheap(i);const s=e.getLanguageIdAtPosition(i,n),r=this.languageConfigurationService.getLanguageConfiguration(s).comments;!r||!r.blockCommentStartToken||!r.blockCommentEndToken||this._createOperationsForBlockComment(this._selection,r.blockCommentStartToken,r.blockCommentEndToken,this._insertSpace,e,t)}computeCursorState(e,t){const i=t.getInverseEditOperations();if(i.length===2){const n=i[0],s=i[1];return new ve(n.range.endLineNumber,n.range.endColumn,s.range.startLineNumber,s.range.startColumn)}else{const n=i[0].range,s=this._usedEndToken?-this._usedEndToken.length-1:0;return new ve(n.endLineNumber,n.endColumn+s,n.endLineNumber,n.endColumn+s)}}}class kl{constructor(e,t,i,n,s,r,a){this.languageConfigurationService=e,this._selection=t,this._tabSize=i,this._type=n,this._insertSpace=s,this._selectionId=null,this._deltaColumn=0,this._moveEndPositionDown=!1,this._ignoreEmptyLines=r,this._ignoreFirstLine=a||!1}static _gatherPreflightCommentStrings(e,t,i,n){e.tokenization.tokenizeIfCheap(t);const s=e.getLanguageIdAtPosition(t,1),r=n.getLanguageConfiguration(s).comments,a=r?r.lineCommentToken:null;if(!a)return null;const l=[];for(let d=0,c=i-t+1;d<c;d++)l[d]={ignore:!1,commentStr:a,commentStrOffset:0,commentStrLength:a.length};return l}static _analyzeLines(e,t,i,n,s,r,a,l){let d=!0,c;e===0?c=!0:e===1?c=!1:c=!0;for(let h=0,u=n.length;h<u;h++){const f=n[h],p=s+h;if(p===s&&a){f.ignore=!0;continue}const m=i.getLineContent(p),v=Gn(m);if(v===-1){f.ignore=r,f.commentStrOffset=m.length;continue}if(d=!1,f.ignore=!1,f.commentStrOffset=v,c&&!Jd._haystackHasNeedleAtOffset(m,f.commentStr,v)&&(e===0?c=!1:e===1||(f.ignore=!0)),c&&t){const _=v+f.commentStrLength;_<m.length&&m.charCodeAt(_)===32&&(f.commentStrLength+=1)}}if(e===0&&d){c=!1;for(let h=0,u=n.length;h<u;h++)n[h].ignore=!1}return{supported:!0,shouldRemoveComments:c,lines:n}}static _gatherPreflightData(e,t,i,n,s,r,a,l){const d=kl._gatherPreflightCommentStrings(i,n,s,l);return d===null?{supported:!1}:kl._analyzeLines(e,t,i,d,n,r,a,l)}_executeLineComments(e,t,i,n){let s;i.shouldRemoveComments?s=kl._createRemoveLineCommentsOperations(i.lines,n.startLineNumber):(kl._normalizeInsertionPoint(e,i.lines,n.startLineNumber,this._tabSize),s=this._createAddLineCommentsOperations(i.lines,n.startLineNumber));const r=new P(n.positionLineNumber,n.positionColumn);for(let a=0,l=s.length;a<l;a++)t.addEditOperation(s[a].range,s[a].text),L.isEmpty(s[a].range)&&L.getStartPosition(s[a].range).equals(r)&&e.getLineContent(r.lineNumber).length+1===r.column&&(this._deltaColumn=(s[a].text||"").length);this._selectionId=t.trackSelection(n)}_attemptRemoveBlockComment(e,t,i,n){let s=t.startLineNumber,r=t.endLineNumber;const a=n.length+Math.max(e.getLineFirstNonWhitespaceColumn(t.startLineNumber),t.startColumn);let l=e.getLineContent(s).lastIndexOf(i,a-1),d=e.getLineContent(r).indexOf(n,t.endColumn-1-i.length);return l!==-1&&d===-1&&(d=e.getLineContent(s).indexOf(n,l+i.length),r=s),l===-1&&d!==-1&&(l=e.getLineContent(r).lastIndexOf(i,d),s=r),t.isEmpty()&&(l===-1||d===-1)&&(l=e.getLineContent(s).indexOf(i),l!==-1&&(d=e.getLineContent(s).indexOf(n,l+i.length))),l!==-1&&e.getLineContent(s).charCodeAt(l+i.length)===32&&(i+=" "),d!==-1&&e.getLineContent(r).charCodeAt(d-1)===32&&(n=" "+n,d-=1),l!==-1&&d!==-1?Jd._createRemoveBlockCommentOperations(new L(s,l+i.length+1,r,d+1),i,n):null}_executeBlockComment(e,t,i){e.tokenization.tokenizeIfCheap(i.startLineNumber);const n=e.getLanguageIdAtPosition(i.startLineNumber,1),s=this.languageConfigurationService.getLanguageConfiguration(n).comments;if(!s||!s.blockCommentStartToken||!s.blockCommentEndToken)return;const r=s.blockCommentStartToken,a=s.blockCommentEndToken;let l=this._attemptRemoveBlockComment(e,i,r,a);if(!l){if(i.isEmpty()){const d=e.getLineContent(i.startLineNumber);let c=Gn(d);c===-1&&(c=d.length),l=Jd._createAddBlockCommentOperations(new L(i.startLineNumber,c+1,i.startLineNumber,d.length+1),r,a,this._insertSpace)}else l=Jd._createAddBlockCommentOperations(new L(i.startLineNumber,e.getLineFirstNonWhitespaceColumn(i.startLineNumber),i.endLineNumber,e.getLineMaxColumn(i.endLineNumber)),r,a,this._insertSpace);l.length===1&&(this._deltaColumn=r.length+1)}this._selectionId=t.trackSelection(i);for(const d of l)t.addEditOperation(d.range,d.text)}getEditOperations(e,t){let i=this._selection;if(this._moveEndPositionDown=!1,i.startLineNumber===i.endLineNumber&&this._ignoreFirstLine){t.addEditOperation(new L(i.startLineNumber,e.getLineMaxColumn(i.startLineNumber),i.startLineNumber+1,1),i.startLineNumber===e.getLineCount()?"":`
667
+ *-----------------------------------------------------------------------------*/var Rce=Object.defineProperty,Mce=Object.getOwnPropertyDescriptor,Ace=Object.getOwnPropertyNames,Pce=Object.prototype.hasOwnProperty,ZF=(o,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Ace(e))!Pce.call(o,n)&&n!==t&&Rce(o,n,{get:()=>e[n],enumerable:!(i=Mce(e,n))||i.enumerable});return o},Oce=(o,e,t)=>(ZF(o,e,"default"),t&&ZF(t,e,"default")),Fce="5.0.2",_p={};Oce(_p,q0);var j6=(o=>(o[o.None=0]="None",o[o.CommonJS=1]="CommonJS",o[o.AMD=2]="AMD",o[o.UMD=3]="UMD",o[o.System=4]="System",o[o.ES2015=5]="ES2015",o[o.ESNext=99]="ESNext",o))(j6||{}),K6=(o=>(o[o.None=0]="None",o[o.Preserve=1]="Preserve",o[o.React=2]="React",o[o.ReactNative=3]="ReactNative",o[o.ReactJSX=4]="ReactJSX",o[o.ReactJSXDev=5]="ReactJSXDev",o))(K6||{}),q6=(o=>(o[o.CarriageReturnLineFeed=0]="CarriageReturnLineFeed",o[o.LineFeed=1]="LineFeed",o))(q6||{}),G6=(o=>(o[o.ES3=0]="ES3",o[o.ES5=1]="ES5",o[o.ES2015=2]="ES2015",o[o.ES2016=3]="ES2016",o[o.ES2017=4]="ES2017",o[o.ES2018=5]="ES2018",o[o.ES2019=6]="ES2019",o[o.ES2020=7]="ES2020",o[o.ESNext=99]="ESNext",o[o.JSON=100]="JSON",o[o.Latest=99]="Latest",o))(G6||{}),Z6=(o=>(o[o.Classic=1]="Classic",o[o.NodeJs=2]="NodeJs",o))(Z6||{}),Y6=class{_onDidChange=new _p.Emitter;_onDidExtraLibsChange=new _p.Emitter;_extraLibs;_removedExtraLibs;_eagerModelSync;_compilerOptions;_diagnosticsOptions;_workerOptions;_onDidExtraLibsChangeTimeout;_inlayHintsOptions;_modeConfiguration;constructor(o,e,t,i,n){this._extraLibs=Object.create(null),this._removedExtraLibs=Object.create(null),this._eagerModelSync=!1,this.setCompilerOptions(o),this.setDiagnosticsOptions(e),this.setWorkerOptions(t),this.setInlayHintsOptions(i),this.setModeConfiguration(n),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(o,e){let t;if(typeof e>"u"?t=`ts:extralib-${Math.random().toString(36).substring(2,15)}`:t=e,this._extraLibs[t]&&this._extraLibs[t].content===o)return{dispose:()=>{}};let i=1;return this._removedExtraLibs[t]&&(i=this._removedExtraLibs[t]+1),this._extraLibs[t]&&(i=this._extraLibs[t].version+1),this._extraLibs[t]={content:o,version:i},this._fireOnDidExtraLibsChangeSoon(),{dispose:()=>{let n=this._extraLibs[t];n&&n.version===i&&(delete this._extraLibs[t],this._removedExtraLibs[t]=i,this._fireOnDidExtraLibsChangeSoon())}}}setExtraLibs(o){for(const e in this._extraLibs)this._removedExtraLibs[e]=this._extraLibs[e].version;if(this._extraLibs=Object.create(null),o&&o.length>0)for(const e of o){const t=e.filePath||`ts:extralib-${Math.random().toString(36).substring(2,15)}`,i=e.content;let n=1;this._removedExtraLibs[t]&&(n=this._removedExtraLibs[t]+1),this._extraLibs[t]={content:i,version:n}}this._fireOnDidExtraLibsChangeSoon()}_fireOnDidExtraLibsChangeSoon(){this._onDidExtraLibsChangeTimeout===-1&&(this._onDidExtraLibsChangeTimeout=window.setTimeout(()=>{this._onDidExtraLibsChangeTimeout=-1,this._onDidExtraLibsChange.fire(void 0)},0))}getCompilerOptions(){return this._compilerOptions}setCompilerOptions(o){this._compilerOptions=o||Object.create(null),this._onDidChange.fire(void 0)}getDiagnosticsOptions(){return this._diagnosticsOptions}setDiagnosticsOptions(o){this._diagnosticsOptions=o||Object.create(null),this._onDidChange.fire(void 0)}setWorkerOptions(o){this._workerOptions=o||Object.create(null),this._onDidChange.fire(void 0)}setInlayHintsOptions(o){this._inlayHintsOptions=o||Object.create(null),this._onDidChange.fire(void 0)}setMaximumWorkerIdleTime(o){}setEagerModelSync(o){this._eagerModelSync=o}getEagerModelSync(){return this._eagerModelSync}setModeConfiguration(o){this._modeConfiguration=o||Object.create(null),this._onDidChange.fire(void 0)}},Bce=Fce,X6={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},Q6=new Y6({allowNonTsExtensions:!0,target:99},{noSemanticValidation:!1,noSyntaxValidation:!1,onlyVisible:!1},{},{},X6),J6=new Y6({allowNonTsExtensions:!0,allowJs:!0,target:99},{noSemanticValidation:!0,noSyntaxValidation:!1,onlyVisible:!1},{},{},X6),Wce=()=>Vy().then(o=>o.getTypeScriptWorker()),Vce=()=>Vy().then(o=>o.getJavaScriptWorker());_p.languages.typescript={ModuleKind:j6,JsxEmit:K6,NewLineKind:q6,ScriptTarget:G6,ModuleResolutionKind:Z6,typescriptVersion:Bce,typescriptDefaults:Q6,javascriptDefaults:J6,getTypeScriptWorker:Wce,getJavaScriptWorker:Vce};function Vy(){return be(()=>import("./tsMode-DeCT_7_p.js"),__vite__mapDeps([18,1,2,3,4]))}_p.languages.onLanguage("typescript",()=>Vy().then(o=>o.setupTypeScript(Q6)));_p.languages.onLanguage("javascript",()=>Vy().then(o=>o.setupJavaScript(J6)));class Hce extends fo{constructor(){super({id:"diffEditor.toggleCollapseUnchangedRegions",title:{value:g("toggleCollapseUnchangedRegions","Toggle Collapse Unchanged Regions"),original:"Toggle Collapse Unchanged Regions"},icon:oe.map,toggled:Z.has("config.diffEditor.hideUnchangedRegions.enabled"),precondition:Z.has("isInDiffEditor"),menu:{when:Z.has("isInDiffEditor"),id:k.EditorTitle,order:22,group:"navigation"}})}run(e,...t){const i=e.get(st),n=!i.getValue("diffEditor.hideUnchangedRegions.enabled");i.updateValue("diffEditor.hideUnchangedRegions.enabled",n)}}jt(Hce);class eW extends fo{constructor(){super({id:"diffEditor.toggleShowMovedCodeBlocks",title:{value:g("toggleShowMovedCodeBlocks","Toggle Show Moved Code Blocks"),original:"Toggle Show Moved Code Blocks"},precondition:Z.has("isInDiffEditor")})}run(e,...t){const i=e.get(st),n=!i.getValue("diffEditor.experimental.showMoves");i.updateValue("diffEditor.experimental.showMoves",n)}}jt(eW);class tW extends fo{constructor(){super({id:"diffEditor.toggleUseInlineViewWhenSpaceIsLimited",title:{value:g("toggleUseInlineViewWhenSpaceIsLimited","Toggle Use Inline View When Space Is Limited"),original:"Toggle Use Inline View When Space Is Limited"},precondition:Z.has("isInDiffEditor")})}run(e,...t){const i=e.get(st),n=!i.getValue("diffEditor.useInlineViewWhenSpaceIsLimited");i.updateValue("diffEditor.useInlineViewWhenSpaceIsLimited",n)}}jt(tW);hn.appendMenuItem(k.EditorTitle,{command:{id:new tW().desc.id,title:g("useInlineViewWhenSpaceIsLimited","Use Inline View When Space Is Limited"),toggled:Z.has("config.diffEditor.useInlineViewWhenSpaceIsLimited"),precondition:Z.has("isInDiffEditor")},order:11,group:"1_diff",when:Z.and(E.diffEditorRenderSideBySideInlineBreakpointReached,Z.has("isInDiffEditor"))});hn.appendMenuItem(k.EditorTitle,{command:{id:new eW().desc.id,title:g("showMoves","Show Moved Code Blocks"),icon:oe.move,toggled:Ap.create("config.diffEditor.experimental.showMoves",!0),precondition:Z.has("isInDiffEditor")},order:10,group:"1_diff",when:Z.has("isInDiffEditor")});const Hy={value:g("diffEditor","Diff Editor"),original:"Diff Editor"};class zce extends ra{constructor(){super({id:"diffEditor.switchSide",title:{value:g("switchSide","Switch Side"),original:"Switch Side"},icon:oe.arrowSwap,precondition:Z.has("isInDiffEditor"),f1:!0,category:Hy})}runEditorCommand(e,t,i){const n=qp(e);if(n instanceof Lu){if(i&&i.dryRun)return{destinationSelection:n.mapToOtherSide().destinationSelection};n.switchSide()}}}jt(zce);class Uce extends ra{constructor(){super({id:"diffEditor.exitCompareMove",title:{value:g("exitCompareMove","Exit Compare Move"),original:"Exit Compare Move"},icon:oe.close,precondition:E.comparingMovedCode,f1:!1,category:Hy,keybinding:{weight:1e4,primary:9}})}runEditorCommand(e,t,...i){const n=qp(e);n instanceof Lu&&n.exitCompareMove()}}jt(Uce);class $ce extends ra{constructor(){super({id:"diffEditor.collapseAllUnchangedRegions",title:{value:g("collapseAllUnchangedRegions","Collapse All Unchanged Regions"),original:"Collapse All Unchanged Regions"},icon:oe.fold,precondition:Z.has("isInDiffEditor"),f1:!0,category:Hy})}runEditorCommand(e,t,...i){const n=qp(e);n instanceof Lu&&n.collapseAllUnchangedRegions()}}jt($ce);class jce extends ra{constructor(){super({id:"diffEditor.showAllUnchangedRegions",title:{value:g("showAllUnchangedRegions","Show All Unchanged Regions"),original:"Show All Unchanged Regions"},icon:oe.unfold,precondition:Z.has("isInDiffEditor"),f1:!0,category:Hy})}runEditorCommand(e,t,...i){const n=qp(e);n instanceof Lu&&n.showAllUnchangedRegions()}}jt(jce);const iW={value:g("accessibleDiffViewer","Accessible Diff Viewer"),original:"Accessible Diff Viewer"};class Kp extends fo{constructor(){super({id:Kp.id,title:{value:g("editor.action.accessibleDiffViewer.next","Go to Next Difference"),original:"Go to Next Difference"},category:iW,precondition:Z.has("isInDiffEditor"),keybinding:{primary:65,weight:100},f1:!0})}run(e){const t=qp(e);t?.accessibleDiffViewerNext()}}Kp.id="editor.action.accessibleDiffViewer.next";hn.appendMenuItem(k.EditorTitle,{command:{id:Kp.id,title:g("Open Accessible Diff Viewer","Open Accessible Diff Viewer"),precondition:Z.has("isInDiffEditor")},order:10,group:"2_diff",when:Z.and(E.accessibleDiffViewerVisible.negate(),Z.has("isInDiffEditor"))});class Z0 extends fo{constructor(){super({id:Z0.id,title:{value:g("editor.action.accessibleDiffViewer.prev","Go to Previous Difference"),original:"Go to Previous Difference"},category:iW,precondition:Z.has("isInDiffEditor"),keybinding:{primary:1089,weight:100},f1:!0})}run(e){const t=qp(e);t?.accessibleDiffViewerPrev()}}Z0.id="editor.action.accessibleDiffViewer.prev";function qp(o){var e;const t=o.get(_t),i=t.listDiffEditors(),n=(e=t.getFocusedCodeEditor())!==null&&e!==void 0?e:t.getActiveCodeEditor();if(!n)return null;for(let r=0,a=i.length;r<a;r++){const l=i[r];if(l.getModifiedEditor().getId()===n.getId()||l.getOriginalEditor().getId()===n.getId())return l}const s=rr();if(s)for(const r of i){const a=r.getContainerDomNode();if(Kce(a,s))return r}return null}function Kce(o,e){let t=e;for(;t;){if(t===o)return!0;t=t.parentElement}return!1}lt.registerCommandAlias("editor.action.diffReview.next",Kp.id);jt(Kp);lt.registerCommandAlias("editor.action.diffReview.prev",Z0.id);jt(Z0);var qce=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Gce=function(o,e){return function(t,i){e(t,i,o)}},zy=function(o,e,t,i){function n(s){return s instanceof t?s:new t(function(r){r(s)})}return new(t||(t=Promise))(function(s,r){function a(c){try{d(i.next(c))}catch(h){r(h)}}function l(c){try{d(i.throw(c))}catch(h){r(h)}}function d(c){c.done?s(c.value):n(c.value).then(a,l)}d((i=i.apply(o,e||[])).next())})},fN;const Uy=new ce("selectionAnchorSet",!1);let ld=fN=class{static get(e){return e.getContribution(fN.ID)}constructor(e,t){this.editor=e,this.selectionAnchorSetContextKey=Uy.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(ve.fromPositions(e,e),{description:"selection-anchor",stickiness:1,hoverMessage:new xn().appendText(g("selectionAnchor","Selection Anchor")),className:"selection-anchor"})}),this.selectionAnchorSetContextKey.set(!!this.decorationId),On(g("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(ve.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()}};ld.ID="editor.contrib.selectionAnchorController";ld=fN=qce([Gce(1,Ae)],ld);class Zce extends fe{constructor(){super({id:"editor.action.setSelectionAnchor",label:g("setSelectionAnchor","Set Selection Anchor"),alias:"Set Selection Anchor",precondition:void 0,kbOpts:{kbExpr:E.editorTextFocus,primary:Pi(2089,2080),weight:100}})}run(e,t){var i;return zy(this,void 0,void 0,function*(){(i=ld.get(t))===null||i===void 0||i.setSelectionAnchor()})}}class Yce extends fe{constructor(){super({id:"editor.action.goToSelectionAnchor",label:g("goToSelectionAnchor","Go to Selection Anchor"),alias:"Go to Selection Anchor",precondition:Uy})}run(e,t){var i;return zy(this,void 0,void 0,function*(){(i=ld.get(t))===null||i===void 0||i.goToSelectionAnchor()})}}class Xce extends fe{constructor(){super({id:"editor.action.selectFromAnchorToCursor",label:g("selectFromAnchorToCursor","Select from Anchor to Cursor"),alias:"Select from Anchor to Cursor",precondition:Uy,kbOpts:{kbExpr:E.editorTextFocus,primary:Pi(2089,2089),weight:100}})}run(e,t){var i;return zy(this,void 0,void 0,function*(){(i=ld.get(t))===null||i===void 0||i.selectFromAnchorToCursor()})}}class Qce extends fe{constructor(){super({id:"editor.action.cancelSelectionAnchor",label:g("cancelSelectionAnchor","Cancel Selection Anchor"),alias:"Cancel Selection Anchor",precondition:Uy,kbOpts:{kbExpr:E.editorTextFocus,primary:9,weight:100}})}run(e,t){var i;return zy(this,void 0,void 0,function*(){(i=ld.get(t))===null||i===void 0||i.cancelSelectionAnchor()})}}ft(ld.ID,ld,4);ne(Zce);ne(Yce);ne(Xce);ne(Qce);const Jce=T("editorOverviewRuler.bracketMatchForeground",{dark:"#A0A0A0",light:"#A0A0A0",hcDark:"#A0A0A0",hcLight:"#A0A0A0"},g("overviewRulerBracketMatchForeground","Overview ruler marker color for matching brackets."));class ehe extends fe{constructor(){super({id:"editor.action.jumpToBracket",label:g("smartSelect.jumpBracket","Go to Bracket"),alias:"Go to Bracket",precondition:void 0,kbOpts:{kbExpr:E.editorTextFocus,primary:3165,weight:100}})}run(e,t){var i;(i=ar.get(t))===null||i===void 0||i.jumpToBracket()}}class the extends fe{constructor(){super({id:"editor.action.selectToBracket",label:g("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,i){var n;let s=!0;i&&i.selectBrackets===!1&&(s=!1),(n=ar.get(t))===null||n===void 0||n.selectToBracket(s)}}class ihe extends fe{constructor(){super({id:"editor.action.removeBrackets",label:g("smartSelect.removeBrackets","Remove Brackets"),alias:"Remove Brackets",precondition:void 0,kbOpts:{kbExpr:E.editorTextFocus,primary:2561,weight:100}})}run(e,t){var i;(i=ar.get(t))===null||i===void 0||i.removeBrackets(this.id)}}class nhe{constructor(e,t,i){this.position=e,this.brackets=t,this.options=i}}class ar extends H{static get(e){return e.getContribution(ar.ID)}constructor(e){super(),this._editor=e,this._lastBracketsData=[],this._lastVersionId=0,this._decorations=this._editor.createDecorationsCollection(),this._updateBracketsSoon=this._register(new Dt(()=>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(i=>{const n=i.getStartPosition(),s=e.bracketPairs.matchBracket(n);let r=null;if(s)s[0].containsPosition(n)&&!s[1].containsPosition(n)?r=s[1].getStartPosition():s[1].containsPosition(n)&&(r=s[0].getStartPosition());else{const a=e.bracketPairs.findEnclosingBrackets(n);if(a)r=a[1].getStartPosition();else{const l=e.bracketPairs.findNextBracket(n);l&&l.range&&(r=l.range.getStartPosition())}}return r?new ve(r.lineNumber,r.column,r.lineNumber,r.column):new ve(n.lineNumber,n.column,n.lineNumber,n.column)});this._editor.setSelections(t),this._editor.revealRange(t[0])}selectToBracket(e){if(!this._editor.hasModel())return;const t=this._editor.getModel(),i=[];this._editor.getSelections().forEach(n=>{const s=n.getStartPosition();let r=t.bracketPairs.matchBracket(s);if(!r&&(r=t.bracketPairs.findEnclosingBrackets(s),!r)){const d=t.bracketPairs.findNextBracket(s);d&&d.range&&(r=t.bracketPairs.matchBracket(d.range.getStartPosition()))}let a=null,l=null;if(r){r.sort(L.compareRangesUsingStarts);const[d,c]=r;if(a=e?d.getStartPosition():d.getEndPosition(),l=e?c.getEndPosition():c.getStartPosition(),c.containsPosition(s)){const h=a;a=l,l=h}}a&&l&&i.push(new ve(a.lineNumber,a.column,l.lineNumber,l.column))}),i.length>0&&(this._editor.setSelections(i),this._editor.revealRange(i[0]))}removeBrackets(e){if(!this._editor.hasModel())return;const t=this._editor.getModel();this._editor.getSelections().forEach(i=>{const n=i.getPosition();let s=t.bracketPairs.matchBracket(n);s||(s=t.bracketPairs.findEnclosingBrackets(n)),s&&(this._editor.pushUndoStop(),this._editor.executeEdits(e,[{range:s[0],text:""},{range:s[1],text:""}]),this._editor.pushUndoStop())})}_updateBrackets(){if(this._matchBrackets==="never")return;this._recomputeBrackets();const e=[];let t=0;for(const i of this._lastBracketsData){const n=i.brackets;n&&(e[t++]={range:n[0],options:i.options},e[t++]={range:n[1],options:i.options})}this._decorations.set(e)}_recomputeBrackets(){if(!this._editor.hasModel()||!this._editor.hasWidgetFocus()){this._lastBracketsData=[],this._lastVersionId=0;return}const e=this._editor.getSelections();if(e.length>100){this._lastBracketsData=[],this._lastVersionId=0;return}const t=this._editor.getModel(),i=t.getVersionId();let n=[];this._lastVersionId===i&&(n=this._lastBracketsData);const s=[];let r=0;for(let h=0,u=e.length;h<u;h++){const f=e[h];f.isEmpty()&&(s[r++]=f.getStartPosition())}s.length>1&&s.sort(P.compare);const a=[];let l=0,d=0;const c=n.length;for(let h=0,u=s.length;h<u;h++){const f=s[h];for(;d<c&&n[d].position.isBefore(f);)d++;if(d<c&&n[d].position.equals(f))a[l++]=n[d];else{let p=t.bracketPairs.matchBracket(f,20),m=ar._DECORATION_OPTIONS_WITH_OVERVIEW_RULER;!p&&this._matchBrackets==="always"&&(p=t.bracketPairs.findEnclosingBrackets(f,20),m=ar._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER),a[l++]=new nhe(f,p,m)}}this._lastBracketsData=a,this._lastVersionId=i}}ar.ID="editor.contrib.bracketMatchingController";ar._DECORATION_OPTIONS_WITH_OVERVIEW_RULER=Ve.register({description:"bracket-match-overview",stickiness:1,className:"bracket-match",overviewRuler:{color:ti(Jce),position:lo.Center}});ar._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER=Ve.register({description:"bracket-match-no-overview",stickiness:1,className:"bracket-match"});ft(ar.ID,ar,1);ne(the);ne(ehe);ne(ihe);hn.appendMenuItem(k.MenubarGoMenu,{group:"5_infile_nav",command:{id:"editor.action.jumpToBracket",title:g({key:"miGoToBracket",comment:["&& denotes a mnemonic"]},"Go to &&Bracket")},order:2});class she{constructor(e,t){this._selection=e,this._isMovingLeft=t}getEditOperations(e,t){if(this._selection.startLineNumber!==this._selection.endLineNumber||this._selection.isEmpty())return;const i=this._selection.startLineNumber,n=this._selection.startColumn,s=this._selection.endColumn;if(!(this._isMovingLeft&&n===1)&&!(!this._isMovingLeft&&s===e.getLineMaxColumn(i)))if(this._isMovingLeft){const r=new L(i,n-1,i,n),a=e.getValueInRange(r);t.addEditOperation(r,null),t.addEditOperation(new L(i,s,i,s),a)}else{const r=new L(i,s,i,s+1),a=e.getValueInRange(r);t.addEditOperation(r,null),t.addEditOperation(new L(i,n,i,n),a)}}computeCursorState(e,t){return this._isMovingLeft?new ve(this._selection.startLineNumber,this._selection.startColumn-1,this._selection.endLineNumber,this._selection.endColumn-1):new ve(this._selection.startLineNumber,this._selection.startColumn+1,this._selection.endLineNumber,this._selection.endColumn+1)}}class nW extends fe{constructor(e,t){super(t),this.left=e}run(e,t){if(!t.hasModel())return;const i=[],n=t.getSelections();for(const s of n)i.push(new she(s,this.left));t.pushUndoStop(),t.executeCommands(this.id,i),t.pushUndoStop()}}class ohe extends nW{constructor(){super(!0,{id:"editor.action.moveCarretLeftAction",label:g("caret.moveLeft","Move Selected Text Left"),alias:"Move Selected Text Left",precondition:E.writable})}}class rhe extends nW{constructor(){super(!1,{id:"editor.action.moveCarretRightAction",label:g("caret.moveRight","Move Selected Text Right"),alias:"Move Selected Text Right",precondition:E.writable})}}ne(ohe);ne(rhe);class ahe extends fe{constructor(){super({id:"editor.action.transposeLetters",label:g("transposeLetters.label","Transpose Letters"),alias:"Transpose Letters",precondition:E.writable,kbOpts:{kbExpr:E.textInputFocus,primary:0,mac:{primary:306},weight:100}})}run(e,t){if(!t.hasModel())return;const i=t.getModel(),n=[],s=t.getSelections();for(const r of s){if(!r.isEmpty())continue;const a=r.startLineNumber,l=r.startColumn,d=i.getLineMaxColumn(a);if(a===1&&(l===1||l===2&&d===2))continue;const c=l===d?r.getPosition():Ct.rightPosition(i,r.getPosition().lineNumber,r.getPosition().column),h=Ct.leftPosition(i,c),u=Ct.leftPosition(i,h),f=i.getValueInRange(L.fromPositions(u,h)),p=i.getValueInRange(L.fromPositions(h,c)),m=L.fromPositions(u,c);n.push(new wn(m,p+f))}n.length>0&&(t.pushUndoStop(),t.executeCommands(this.id,n),t.pushUndoStop())}}ne(ahe);var lhe=function(o,e,t,i){function n(s){return s instanceof t?s:new t(function(r){r(s)})}return new(t||(t=Promise))(function(s,r){function a(c){try{d(i.next(c))}catch(h){r(h)}}function l(c){try{d(i.throw(c))}catch(h){r(h)}}function d(c){c.done?s(c.value):n(c.value).then(a,l)}d((i=i.apply(o,e||[])).next())})};const Du="9_cutcopypaste",dhe=jr||document.queryCommandSupported("cut"),sW=jr||document.queryCommandSupported("copy"),che=typeof navigator.clipboard>"u"||Mo?document.queryCommandSupported("paste"):!0;function xM(o){return o.register(),o}const hhe=dhe?xM(new Op({id:"editor.action.clipboardCutAction",precondition:void 0,kbOpts:jr?{primary:2102,win:{primary:2102,secondary:[1044]},weight:100}:void 0,menuOpts:[{menuId:k.MenubarEditMenu,group:"2_ccp",title:g({key:"miCut",comment:["&& denotes a mnemonic"]},"Cu&&t"),order:1},{menuId:k.EditorContext,group:Du,title:g("actions.clipboard.cutLabel","Cut"),when:E.writable,order:1},{menuId:k.CommandPalette,group:"",title:g("actions.clipboard.cutLabel","Cut"),order:1},{menuId:k.SimpleEditorContext,group:Du,title:g("actions.clipboard.cutLabel","Cut"),when:E.writable,order:1}]})):void 0,uhe=sW?xM(new Op({id:"editor.action.clipboardCopyAction",precondition:void 0,kbOpts:jr?{primary:2081,win:{primary:2081,secondary:[2067]},weight:100}:void 0,menuOpts:[{menuId:k.MenubarEditMenu,group:"2_ccp",title:g({key:"miCopy",comment:["&& denotes a mnemonic"]},"&&Copy"),order:2},{menuId:k.EditorContext,group:Du,title:g("actions.clipboard.copyLabel","Copy"),order:2},{menuId:k.CommandPalette,group:"",title:g("actions.clipboard.copyLabel","Copy"),order:1},{menuId:k.SimpleEditorContext,group:Du,title:g("actions.clipboard.copyLabel","Copy"),order:2}]})):void 0;hn.appendMenuItem(k.MenubarEditMenu,{submenu:k.MenubarCopy,title:{value:g("copy as","Copy As"),original:"Copy As"},group:"2_ccp",order:3});hn.appendMenuItem(k.EditorContext,{submenu:k.EditorContextCopy,title:{value:g("copy as","Copy As"),original:"Copy As"},group:Du,order:3});hn.appendMenuItem(k.EditorContext,{submenu:k.EditorContextShare,title:{value:g("share","Share"),original:"Share"},group:"11_share",order:-1,when:Z.and(Z.notEquals("resourceScheme","output"),E.editorTextFocus)});hn.appendMenuItem(k.EditorTitleContext,{submenu:k.EditorTitleContextShare,title:{value:g("share","Share"),original:"Share"},group:"11_share",order:-1});hn.appendMenuItem(k.ExplorerContext,{submenu:k.ExplorerContextShare,title:{value:g("share","Share"),original:"Share"},group:"11_share",order:-1});const hD=che?xM(new Op({id:"editor.action.clipboardPasteAction",precondition:void 0,kbOpts:jr?{primary:2100,win:{primary:2100,secondary:[1043]},linux:{primary:2100,secondary:[1043]},weight:100}:void 0,menuOpts:[{menuId:k.MenubarEditMenu,group:"2_ccp",title:g({key:"miPaste",comment:["&& denotes a mnemonic"]},"&&Paste"),order:4},{menuId:k.EditorContext,group:Du,title:g("actions.clipboard.pasteLabel","Paste"),when:E.writable,order:4},{menuId:k.CommandPalette,group:"",title:g("actions.clipboard.pasteLabel","Paste"),order:1},{menuId:k.SimpleEditorContext,group:Du,title:g("actions.clipboard.pasteLabel","Paste"),when:E.writable,order:4}]})):void 0;class fhe extends fe{constructor(){super({id:"editor.action.clipboardCopyWithSyntaxHighlightingAction",label:g("actions.clipboard.copyWithSyntaxHighlightingLabel","Copy With Syntax Highlighting"),alias:"Copy With Syntax Highlighting",precondition:void 0,kbOpts:{kbExpr:E.textInputFocus,primary:0,weight:100}})}run(e,t){!t.hasModel()||!t.getOption(37)&&t.getSelection().isEmpty()||(vI.forceCopyWithSyntaxHighlighting=!0,t.focus(),t.getContainerDomNode().ownerDocument.execCommand("copy"),vI.forceCopyWithSyntaxHighlighting=!1)}}function oW(o,e){o&&(o.addImplementation(1e4,"code-editor",(t,i)=>{const n=t.get(_t).getFocusedCodeEditor();if(n&&n.hasTextFocus()){const s=n.getOption(37),r=n.getSelection();return r&&r.isEmpty()&&!s||n.getContainerDomNode().ownerDocument.execCommand(e),!0}return!1}),o.addImplementation(0,"generic-dom",(t,i)=>(PS().execCommand(e),!0)))}oW(hhe,"cut");oW(uhe,"copy");hD&&(hD.addImplementation(1e4,"code-editor",(o,e)=>{const t=o.get(_t),i=o.get(pd),n=t.getFocusedCodeEditor();return n&&n.hasTextFocus()?!n.getContainerDomNode().ownerDocument.execCommand("paste")&&Kc?lhe(void 0,void 0,void 0,function*(){const r=yield i.readText();if(r!==""){const a=fv.INSTANCE.get(r);let l=!1,d=null,c=null;a&&(l=n.getOption(37)&&!!a.isFromEmptySelection,d=typeof a.multicursorText<"u"?a.multicursorText:null,c=a.mode),n.trigger("keyboard","paste",{text:r,pasteOnNewLine:l,multicursorText:d,mode:c})}}):!0:!1}),hD.addImplementation(0,"generic-dom",(o,e)=>(PS().execCommand("paste"),!0)));sW&&ne(fhe);var ghe=function(o,e,t,i){function n(s){return s instanceof t?s:new t(function(r){r(s)})}return new(t||(t=Promise))(function(s,r){function a(c){try{d(i.next(c))}catch(h){r(h)}}function l(c){try{d(i.throw(c))}catch(h){r(h)}}function d(c){c.done?s(c.value):n(c.value).then(a,l)}d((i=i.apply(o,e||[])).next())})};class Ne{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+Ne.sep)}intersects(e){return this.contains(e)||e.contains(this)}append(e){return new Ne(this.value+Ne.sep+e)}}Ne.sep=".";Ne.None=new Ne("@@none@@");Ne.Empty=new Ne("");Ne.QuickFix=new Ne("quickfix");Ne.Refactor=new Ne("refactor");Ne.RefactorExtract=Ne.Refactor.append("extract");Ne.RefactorInline=Ne.Refactor.append("inline");Ne.RefactorMove=Ne.Refactor.append("move");Ne.RefactorRewrite=Ne.Refactor.append("rewrite");Ne.Notebook=new Ne("notebook");Ne.Source=new Ne("source");Ne.SourceOrganizeImports=Ne.Source.append("organizeImports");Ne.SourceFixAll=Ne.Source.append("fixAll");Ne.SurroundWith=Ne.Refactor.append("surround");var Vs;(function(o){o.Refactor="refactor",o.RefactorPreview="refactor preview",o.Lightbulb="lightbulb",o.Default="other (default)",o.SourceAction="source action",o.QuickFix="quick fix action",o.FixAll="fix all",o.OrganizeImports="organize imports",o.AutoFix="auto fix",o.QuickFixHover="quick fix hover window",o.OnSave="save participants",o.ProblemsView="problems view"})(Vs||(Vs={}));function phe(o,e){return!(o.include&&!o.include.intersects(e)||o.excludes&&o.excludes.some(t=>rW(e,t,o.include))||!o.includeSourceActions&&Ne.Source.contains(e))}function mhe(o,e){const t=e.kind?new Ne(e.kind):void 0;return!(o.include&&(!t||!o.include.contains(t))||o.excludes&&t&&o.excludes.some(i=>rW(t,i,o.include))||!o.includeSourceActions&&t&&Ne.Source.contains(t)||o.onlyIncludePreferredActions&&!e.isPreferred)}function rW(o,e,t){return!(!e.contains(o)||t&&e.contains(t))}class Ma{static fromUser(e,t){return!e||typeof e!="object"?new Ma(t.kind,t.apply,!1):new Ma(Ma.getKindFromUser(e,t.kind),Ma.getApplyFromUser(e,t.apply),Ma.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 Ne(e.kind):t}static getPreferredUser(e){return typeof e.preferred=="boolean"?e.preferred:!1}constructor(e,t,i){this.kind=e,this.apply=t,this.preferred=i}}class _he{constructor(e,t,i){this.action=e,this.provider=t,this.highlightRange=i}resolve(e){var t;return ghe(this,void 0,void 0,function*(){if(!((t=this.provider)===null||t===void 0)&&t.resolveCodeAction&&!this.action.edit){let i;try{i=yield this.provider.resolveCodeAction(this.action,e)}catch(n){Ni(n)}i&&(this.action.edit=i.edit)}return this})}}var jw=function(o,e,t,i){function n(s){return s instanceof t?s:new t(function(r){r(s)})}return new(t||(t=Promise))(function(s,r){function a(c){try{d(i.next(c))}catch(h){r(h)}}function l(c){try{d(i.throw(c))}catch(h){r(h)}}function d(c){c.done?s(c.value):n(c.value).then(a,l)}d((i=i.apply(o,e||[])).next())})};const aW="editor.action.codeAction",DM="editor.action.quickFix",lW="editor.action.autoFix",dW="editor.action.refactor",cW="editor.action.sourceAction",kM="editor.action.organizeImports",IM="editor.action.fixAll";class k_ extends H{static codeActionsPreferredComparator(e,t){return e.isPreferred&&!t.isPreferred?-1:!e.isPreferred&&t.isPreferred?1:0}static codeActionsComparator({action:e},{action:t}){return Fn(e.diagnostics)?Fn(t.diagnostics)?k_.codeActionsPreferredComparator(e,t):-1:Fn(t.diagnostics)?1:k_.codeActionsPreferredComparator(e,t)}constructor(e,t,i){super(),this.documentation=t,this._register(i),this.allActions=[...e].sort(k_.codeActionsComparator),this.validActions=this.allActions.filter(({action:n})=>!n.disabled)}get hasAutoFix(){return this.validActions.some(({action:e})=>!!e.kind&&Ne.QuickFix.contains(new Ne(e.kind))&&!!e.isPreferred)}}const YF={actions:[],documentation:void 0};function I_(o,e,t,i,n,s){var r;return jw(this,void 0,void 0,function*(){const a=i.filter||{},l=Object.assign(Object.assign({},a),{excludes:[...a.excludes||[],Ne.Notebook]}),d={only:(r=a.include)===null||r===void 0?void 0:r.value,trigger:i.type},c=new bM(e,s),h=i.type===2,u=vhe(o,e,h?l:a),f=new X,p=u.map(v=>jw(this,void 0,void 0,function*(){try{n.report(v);const _=yield v.provideCodeActions(e,t,d,c.token);if(_&&f.add(_),c.token.isCancellationRequested)return YF;const b=(_?.actions||[]).filter(w=>w&&mhe(a,w)),C=Che(v,b,a.include);return{actions:b.map(w=>new _he(w,v)),documentation:C}}catch(_){if(oa(_))throw _;return Ni(_),YF}})),m=o.onDidChange(()=>{const v=o.all(e);mi(v,u)||c.cancel()});try{const v=yield Promise.all(p),_=v.map(C=>C.actions).flat(),b=[...Za(v.map(C=>C.documentation)),...bhe(o,e,i,_)];return new k_(_,b,f)}finally{m.dispose(),c.dispose()}})}function vhe(o,e,t){return o.all(e).filter(i=>i.providedCodeActionKinds?i.providedCodeActionKinds.some(n=>phe(t,new Ne(n))):!0)}function*bhe(o,e,t,i){var n,s,r;if(e&&i.length)for(const a of o.all(e))a._getAdditionalMenuItems&&(yield*(n=a._getAdditionalMenuItems)===null||n===void 0?void 0:n.call(a,{trigger:t.type,only:(r=(s=t.filter)===null||s===void 0?void 0:s.include)===null||r===void 0?void 0:r.value},i.map(l=>l.action)))}function Che(o,e,t){if(!o.documentation)return;const i=o.documentation.map(n=>({kind:new Ne(n.kind),command:n.command}));if(t){let n;for(const s of i)s.kind.contains(t)&&(n?n.kind.contains(s.kind)&&(n=s):n=s);if(n)return n?.command}for(const n of e)if(n.kind){for(const s of i)if(s.kind.contains(new Ne(n.kind)))return s.command}}var Kw;(function(o){o.OnSave="onSave",o.FromProblemsView="fromProblemsView",o.FromCodeActions="fromCodeActions"})(Kw||(Kw={}));function whe(o,e,t,i,n=Qe.None){var s;return jw(this,void 0,void 0,function*(){const r=o.get(F0),a=o.get(li),l=o.get(go),d=o.get(Li);if(l.publicLog2("codeAction.applyCodeAction",{codeActionTitle:e.action.title,codeActionKind:e.action.kind,codeActionIsPreferred:!!e.action.isPreferred,reason:t}),yield e.resolve(n),!n.isCancellationRequested&&!(!((s=e.action.edit)===null||s===void 0)&&s.edits.length&&!(yield r.apply(e.action.edit,{editor:i?.editor,label:e.action.title,quotableLabel:e.action.title,code:"undoredo.codeAction",respectAutoSaveConfig:t!==Kw.OnSave,showPreview:i?.preview})).isApplied)&&e.action.command)try{yield a.executeCommand(e.action.command.id,...e.action.command.arguments||[])}catch(c){const h=She(c);d.error(typeof h=="string"?h:g("applyCodeActionFailed","An unknown error occurred while applying the code action"))}})}function She(o){return typeof o=="string"?o:o instanceof Error&&typeof o.message=="string"?o.message:void 0}lt.registerCommand("_executeCodeActionProvider",function(o,e,t,i,n){return jw(this,void 0,void 0,function*(){if(!(e instanceof ke))throw No();const{codeActionProvider:s}=o.get(pe),r=o.get(Yt).getModel(e);if(!r)throw No();const a=ve.isISelection(t)?ve.liftSelection(t):L.isIRange(t)?r.validateRange(t):void 0;if(!a)throw No();const l=typeof i=="string"?new Ne(i):void 0,d=yield I_(s,r,a,{type:1,triggerAction:Vs.Default,filter:{includeSourceActions:!0,include:l}},Jl.None,Qe.None),c=[],h=Math.min(d.validActions.length,typeof n=="number"?n:0);for(let u=0;u<h;u++)c.push(d.validActions[u].resolve(Qe.None));try{return yield Promise.all(c),d.validActions.map(u=>u.action)}finally{setTimeout(()=>d.dispose(),100)}})});var yhe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Lhe=function(o,e){return function(t,i){e(t,i,o)}},gN;let qw=gN=class{constructor(e){this.keybindingService=e}getResolver(){const e=new Zc(()=>this.keybindingService.getKeybindings().filter(t=>gN.codeActionCommands.indexOf(t.command)>=0).filter(t=>t.resolvedKeybinding).map(t=>{let i=t.commandArgs;return t.command===kM?i={kind:Ne.SourceOrganizeImports.value}:t.command===IM&&(i={kind:Ne.SourceFixAll.value}),Object.assign({resolvedKeybinding:t.resolvedKeybinding},Ma.fromUser(i,{kind:Ne.None,apply:"never"}))}));return t=>{if(t.kind){const i=this.bestKeybindingForCodeAction(t,e.value);return i?.resolvedKeybinding}}}bestKeybindingForCodeAction(e,t){if(!e.kind)return;const i=new Ne(e.kind);return t.filter(n=>n.kind.contains(i)).filter(n=>n.preferred?e.isPreferred:!0).reduceRight((n,s)=>n?n.kind.contains(s.kind)?s:n:s,void 0)}};qw.codeActionCommands=[dW,aW,cW,kM,IM];qw=gN=yhe([Lhe(0,Nt)],qw);T("symbolIcon.arrayForeground",{dark:se,light:se,hcDark:se,hcLight:se},g("symbolIcon.arrayForeground","The foreground color for array symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));T("symbolIcon.booleanForeground",{dark:se,light:se,hcDark:se,hcLight:se},g("symbolIcon.booleanForeground","The foreground color for boolean symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));T("symbolIcon.classForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},g("symbolIcon.classForeground","The foreground color for class symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));T("symbolIcon.colorForeground",{dark:se,light:se,hcDark:se,hcLight:se},g("symbolIcon.colorForeground","The foreground color for color symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));T("symbolIcon.constantForeground",{dark:se,light:se,hcDark:se,hcLight:se},g("symbolIcon.constantForeground","The foreground color for constant symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));T("symbolIcon.constructorForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},g("symbolIcon.constructorForeground","The foreground color for constructor symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));T("symbolIcon.enumeratorForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},g("symbolIcon.enumeratorForeground","The foreground color for enumerator symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));T("symbolIcon.enumeratorMemberForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},g("symbolIcon.enumeratorMemberForeground","The foreground color for enumerator member symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));T("symbolIcon.eventForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},g("symbolIcon.eventForeground","The foreground color for event symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));T("symbolIcon.fieldForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},g("symbolIcon.fieldForeground","The foreground color for field symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));T("symbolIcon.fileForeground",{dark:se,light:se,hcDark:se,hcLight:se},g("symbolIcon.fileForeground","The foreground color for file symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));T("symbolIcon.folderForeground",{dark:se,light:se,hcDark:se,hcLight:se},g("symbolIcon.folderForeground","The foreground color for folder symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));T("symbolIcon.functionForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},g("symbolIcon.functionForeground","The foreground color for function symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));T("symbolIcon.interfaceForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},g("symbolIcon.interfaceForeground","The foreground color for interface symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));T("symbolIcon.keyForeground",{dark:se,light:se,hcDark:se,hcLight:se},g("symbolIcon.keyForeground","The foreground color for key symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));T("symbolIcon.keywordForeground",{dark:se,light:se,hcDark:se,hcLight:se},g("symbolIcon.keywordForeground","The foreground color for keyword symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));T("symbolIcon.methodForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},g("symbolIcon.methodForeground","The foreground color for method symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));T("symbolIcon.moduleForeground",{dark:se,light:se,hcDark:se,hcLight:se},g("symbolIcon.moduleForeground","The foreground color for module symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));T("symbolIcon.namespaceForeground",{dark:se,light:se,hcDark:se,hcLight:se},g("symbolIcon.namespaceForeground","The foreground color for namespace symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));T("symbolIcon.nullForeground",{dark:se,light:se,hcDark:se,hcLight:se},g("symbolIcon.nullForeground","The foreground color for null symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));T("symbolIcon.numberForeground",{dark:se,light:se,hcDark:se,hcLight:se},g("symbolIcon.numberForeground","The foreground color for number symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));T("symbolIcon.objectForeground",{dark:se,light:se,hcDark:se,hcLight:se},g("symbolIcon.objectForeground","The foreground color for object symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));T("symbolIcon.operatorForeground",{dark:se,light:se,hcDark:se,hcLight:se},g("symbolIcon.operatorForeground","The foreground color for operator symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));T("symbolIcon.packageForeground",{dark:se,light:se,hcDark:se,hcLight:se},g("symbolIcon.packageForeground","The foreground color for package symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));T("symbolIcon.propertyForeground",{dark:se,light:se,hcDark:se,hcLight:se},g("symbolIcon.propertyForeground","The foreground color for property symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));T("symbolIcon.referenceForeground",{dark:se,light:se,hcDark:se,hcLight:se},g("symbolIcon.referenceForeground","The foreground color for reference symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));T("symbolIcon.snippetForeground",{dark:se,light:se,hcDark:se,hcLight:se},g("symbolIcon.snippetForeground","The foreground color for snippet symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));T("symbolIcon.stringForeground",{dark:se,light:se,hcDark:se,hcLight:se},g("symbolIcon.stringForeground","The foreground color for string symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));T("symbolIcon.structForeground",{dark:se,light:se,hcDark:se,hcLight:se},g("symbolIcon.structForeground","The foreground color for struct symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));T("symbolIcon.textForeground",{dark:se,light:se,hcDark:se,hcLight:se},g("symbolIcon.textForeground","The foreground color for text symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));T("symbolIcon.typeParameterForeground",{dark:se,light:se,hcDark:se,hcLight:se},g("symbolIcon.typeParameterForeground","The foreground color for type parameter symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));T("symbolIcon.unitForeground",{dark:se,light:se,hcDark:se,hcLight:se},g("symbolIcon.unitForeground","The foreground color for unit symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));T("symbolIcon.variableForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},g("symbolIcon.variableForeground","The foreground color for variable symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));const hW=Object.freeze({kind:Ne.Empty,title:g("codeAction.widget.id.more","More Actions...")}),xhe=Object.freeze([{kind:Ne.QuickFix,title:g("codeAction.widget.id.quickfix","Quick Fix")},{kind:Ne.RefactorExtract,title:g("codeAction.widget.id.extract","Extract"),icon:oe.wrench},{kind:Ne.RefactorInline,title:g("codeAction.widget.id.inline","Inline"),icon:oe.wrench},{kind:Ne.RefactorRewrite,title:g("codeAction.widget.id.convert","Rewrite"),icon:oe.wrench},{kind:Ne.RefactorMove,title:g("codeAction.widget.id.move","Move"),icon:oe.wrench},{kind:Ne.SurroundWith,title:g("codeAction.widget.id.surround","Surround With"),icon:oe.symbolSnippet},{kind:Ne.Source,title:g("codeAction.widget.id.source","Source Action"),icon:oe.symbolFile},hW]);function Dhe(o,e,t){if(!e)return o.map(s=>{var r;return{kind:"action",item:s,group:hW,disabled:!!s.action.disabled,label:s.action.disabled||s.action.title,canPreview:!!(!((r=s.action.edit)===null||r===void 0)&&r.edits.length)}});const i=xhe.map(s=>({group:s,actions:[]}));for(const s of o){const r=s.action.kind?new Ne(s.action.kind):Ne.None;for(const a of i)if(a.group.kind.contains(r)){a.actions.push(s);break}}const n=[];for(const s of i)if(s.actions.length){n.push({kind:"header",group:s.group});for(const r of s.actions)n.push({kind:"action",item:r,group:s.group,label:r.action.title,disabled:!!r.action.disabled,keybinding:t(r.action)})}return n}var khe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Ihe=function(o,e){return function(t,i){e(t,i,o)}},pN,dg;(function(o){o.Hidden={type:0};class e{constructor(i,n,s,r){this.actions=i,this.trigger=n,this.editorPosition=s,this.widgetPosition=r,this.type=1}}o.Showing=e})(dg||(dg={}));let ku=pN=class extends H{constructor(e,t){super(),this._editor=e,this._onClick=this._register(new A),this.onClick=this._onClick.event,this._state=dg.Hidden,this._domNode=te("div.lightBulbWidget"),this._register(Tt.ignoreTarget(this._domNode)),this._editor.addContentWidget(this),this._register(this._editor.onDidChangeModelContent(i=>{const n=this._editor.getModel();(this.state.type!==1||!n||this.state.editorPosition.lineNumber>=n.getLineCount())&&this.hide()})),this._register(dj(this._domNode,i=>{if(this.state.type!==1)return;this._editor.focus(),i.preventDefault();const{top:n,height:s}=Ai(this._domNode),r=this._editor.getOption(66);let a=Math.floor(r/3);this.state.widgetPosition.position!==null&&this.state.widgetPosition.position.lineNumber<this.state.editorPosition.lineNumber&&(a+=r),this._onClick.fire({x:i.posx,y:n+s+a,actions:this.state.actions,trigger:this.state.trigger})})),this._register($(this._domNode,"mouseenter",i=>{(i.buttons&1)===1&&this.hide()})),this._register(this._editor.onDidChangeConfiguration(i=>{i.hasChanged(64)&&!this._editor.getOption(64).enabled&&this.hide()})),this._register(de.runAndSubscribe(t.onDidUpdateKeybindings,()=>{var i,n,s,r;this._preferredKbLabel=(n=(i=t.lookupKeybinding(lW))===null||i===void 0?void 0:i.getLabel())!==null&&n!==void 0?n:void 0,this._quickFixKbLabel=(r=(s=t.lookupKeybinding(DM))===null||s===void 0?void 0:s.getLabel())!==null&&r!==void 0?r: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,i){if(e.validActions.length<=0)return this.hide();const n=this._editor.getOptions();if(!n.get(64).enabled)return this.hide();const s=this._editor.getModel();if(!s)return this.hide();const{lineNumber:r,column:a}=s.validatePosition(i),l=s.getOptions().tabSize,d=n.get(50),c=s.getLineContent(r),h=ny(c,l),u=d.spaceWidth*h>22,f=m=>m>2&&this._editor.getTopForLineNumber(m)===this._editor.getTopForLineNumber(m-1);let p=r;if(!u){if(r>1&&!f(r-1))p-=1;else if(!f(r+1))p+=1;else if(a*d.spaceWidth<22)return this.hide()}this.state=new dg.Showing(e,t,i,{position:{lineNumber:p,column:1},preference:pN._posPref}),this._editor.layoutContentWidget(this)}hide(){this.state!==dg.Hidden&&(this.state=dg.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(...Ie.asClassNameArray(oe.lightBulb)),this._domNode.classList.add(...Ie.asClassNameArray(oe.lightbulbAutofix)),this._preferredKbLabel)){this.title=g("preferredcodeActionWithKb","Show Code Actions. Preferred Quick Fix Available ({0})",this._preferredKbLabel);return}this._domNode.classList.remove(...Ie.asClassNameArray(oe.lightbulbAutofix)),this._domNode.classList.add(...Ie.asClassNameArray(oe.lightBulb)),this._quickFixKbLabel?this.title=g("codeActionWithKb","Show Code Actions ({0})",this._quickFixKbLabel):this.title=g("codeAction","Show Code Actions")}set title(e){this._domNode.title=e}};ku.ID="editor.contrib.lightbulbWidget";ku._posPref=[0];ku=pN=khe([Ihe(1,Nt)],ku);var Ehe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},XF=function(o,e){return function(t,i){e(t,i,o)}},uW=function(o,e,t,i){function n(s){return s instanceof t?s:new t(function(r){r(s)})}return new(t||(t=Promise))(function(s,r){function a(c){try{d(i.next(c))}catch(h){r(h)}}function l(c){try{d(i.throw(c))}catch(h){r(h)}}function d(c){c.done?s(c.value):n(c.value).then(a,l)}d((i=i.apply(o,e||[])).next())})},mN;let dd=mN=class{constructor(e,t,i){this._options=e,this._languageService=t,this._openerService=i,this._onDidRenderAsync=new A,this.onDidRenderAsync=this._onDidRenderAsync.event}dispose(){this._onDidRenderAsync.dispose()}render(e,t,i){if(!e)return{element:document.createElement("span"),dispose:()=>{}};const n=new X,s=n.add(py(e,Object.assign(Object.assign({},this._getRenderOptions(e,n)),t),i));return s.element.classList.add("rendered-markdown"),{element:s.element,dispose:()=>n.dispose()}}_getRenderOptions(e,t){return{codeBlockRenderer:(i,n)=>uW(this,void 0,void 0,function*(){var s,r,a;let l;i?l=this._languageService.getLanguageIdByLanguageName(i):this._options.editor&&(l=(s=this._options.editor.getModel())===null||s===void 0?void 0:s.getLanguageId()),l||(l=ro);const d=yield Wee(this._languageService,n,l),c=document.createElement("span");if(c.innerHTML=(a=(r=mN._ttpTokenizer)===null||r===void 0?void 0:r.createHTML(d))!==null&&a!==void 0?a:d,this._options.editor){const h=this._options.editor.getOption(50);kn(c,h)}else this._options.codeBlockFontFamily&&(c.style.fontFamily=this._options.codeBlockFontFamily);return this._options.codeBlockFontSize!==void 0&&(c.style.fontSize=this._options.codeBlockFontSize),c}),asyncRenderCallback:()=>this._onDidRenderAsync.fire(),actionHandler:{callback:i=>fW(this._openerService,i,e.isTrusted),disposables:t}}}};dd._ttpTokenizer=cd("tokenizeToString",{createHTML(o){return o}});dd=mN=Ehe([XF(1,qt),XF(2,zs)],dd);function fW(o,e,t){return uW(this,void 0,void 0,function*(){try{return yield o.open(e,{fromUserGesture:!0,allowContributedOpeners:!0,allowCommands:Nhe(t)})}catch(i){return He(i),!1}})}function Nhe(o){return o===!0?!0:o&&Array.isArray(o.enabledCommands)?o.enabledCommands:!1}var The=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},QF=function(o,e){return function(t,i){e(t,i,o)}},r1;let Fs=r1=class{static get(e){return e.getContribution(r1.ID)}constructor(e,t,i){this._openerService=i,this._messageWidget=new pn,this._messageListeners=new X,this._mouseOverMessage=!1,this._editor=e,this._visible=r1.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){On(lc(e)?e.value:e),this._visible.set(!0),this._messageWidget.clear(),this._messageListeners.clear(),this._message=lc(e)?py(e,{actionHandler:{callback:n=>fW(this._openerService,n,lc(e)?e.isTrusted:void 0),disposables:this._messageListeners}}):void 0,this._messageWidget.value=new JF(this._editor,t,typeof e=="string"?e:this._message.element),this._messageListeners.add(de.debounce(this._editor.onDidBlurEditorText,(n,s)=>s,0)(()=>{this._mouseOverMessage||this._messageWidget.value&&Dn(rr(),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($(this._messageWidget.value.getDomNode(),ae.MOUSE_ENTER,()=>this._mouseOverMessage=!0,!0)),this._messageListeners.add($(this._messageWidget.value.getDomNode(),ae.MOUSE_LEAVE,()=>this._mouseOverMessage=!1,!0));let i;this._messageListeners.add(this._editor.onMouseMove(n=>{n.target.position&&(i?i.containsPosition(n.target.position)||this.closeMessage():i=new L(t.lineNumber-3,1,n.target.position.lineNumber+3,1))}))}closeMessage(){this._visible.reset(),this._messageListeners.clear(),this._messageWidget.value&&this._messageListeners.add(JF.fadeOut(this._messageWidget.value))}};Fs.ID="editor.contrib.messageController";Fs.MESSAGE_VISIBLE=new ce("messageVisible",!1,g("messageVisible","Whether the editor is currently showing an inline message"));Fs=r1=The([QF(1,Ae),QF(2,zs)],Fs);const Rhe=tn.bindToContribution(Fs.get);re(new Rhe({id:"leaveEditorMessage",precondition:Fs.MESSAGE_VISIBLE,handler:o=>o.closeMessage(),kbOpts:{weight:130,primary:9}}));let JF=class{static fadeOut(e){const t=()=>{e.dispose(),clearTimeout(i),e.getDomNode().removeEventListener("animationend",t)},i=setTimeout(t,110);return e.getDomNode().addEventListener("animationend",t),e.getDomNode().classList.add("fadeOut"),{dispose:t}}constructor(e,{lineNumber:t,column:i},n){this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._editor=e,this._editor.revealLinesInCenterIfOutsideViewport(t,t,0),this._position={lineNumber:t,column:i},this._domNode=document.createElement("div"),this._domNode.classList.add("monaco-editor-overlaymessage"),this._domNode.style.marginLeft="-6px";const s=document.createElement("div");s.classList.add("anchor","top"),this._domNode.appendChild(s);const r=document.createElement("div");typeof n=="string"?(r.classList.add("message"),r.textContent=n):(n.classList.add("message"),r.appendChild(n)),this._domNode.appendChild(r);const a=document.createElement("div");a.classList.add("anchor","below"),this._domNode.appendChild(a),this._editor.addContentWidget(this),this._domNode.classList.add("fadeIn")}dispose(){this._editor.removeContentWidget(this)}getId(){return"messageoverlay"}getDomNode(){return this._domNode}getPosition(){return{position:this._position,preference:[1,2],positionAffinity:1}}afterRender(e){this._domNode.classList.toggle("below",e===2)}};ft(Fs.ID,Fs,4);var gW=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},_N=function(o,e){return function(t,i){e(t,i,o)}},Mhe=function(o,e,t,i){function n(s){return s instanceof t?s:new t(function(r){r(s)})}return new(t||(t=Promise))(function(s,r){function a(c){try{d(i.next(c))}catch(h){r(h)}}function l(c){try{d(i.throw(c))}catch(h){r(h)}}function d(c){c.done?s(c.value):n(c.value).then(a,l)}d((i=i.apply(o,e||[])).next())})};const pW="acceptSelectedCodeAction",mW="previewSelectedCodeAction";class Ahe{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,i){var n,s;i.text.textContent=(s=(n=e.group)===null||n===void 0?void 0:n.title)!==null&&s!==void 0?s:""}disposeTemplate(e){}}let vN=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 i=document.createElement("span");i.className="title",e.append(i);const n=new z0(e,to);return{container:e,icon:t,text:i,keybinding:n}}renderElement(e,t,i){var n,s,r;if(!((n=e.group)===null||n===void 0)&&n.icon?(i.icon.className=Ie.asClassName(e.group.icon),e.group.icon.color&&(i.icon.style.color=he(e.group.icon.color.id))):(i.icon.className=Ie.asClassName(oe.lightBulb),i.icon.style.color="var(--vscode-editorLightBulb-foreground)"),!e.item||!e.label)return;i.text.textContent=_W(e.label),i.keybinding.set(e.keybinding),Cj(!!e.keybinding,i.keybinding.element);const a=(s=this._keybindingService.lookupKeybinding(pW))===null||s===void 0?void 0:s.getLabel(),l=(r=this._keybindingService.lookupKeybinding(mW))===null||r===void 0?void 0:r.getLabel();i.container.classList.toggle("option-disabled",e.disabled),e.disabled?i.container.title=e.label:a&&l?this._supportsPreview&&e.canPreview?i.container.title=g({key:"label-preview",comment:['placeholders are keybindings, e.g "F2 to apply, Shift+F2 to preview"']},"{0} to apply, {1} to preview",a,l):i.container.title=g({key:"label",comment:['placeholder is a keybinding, e.g "F2 to apply"']},"{0} to apply",a):i.container.title=""}disposeTemplate(e){}};vN=gW([_N(1,Nt)],vN);class Phe extends UIEvent{constructor(){super("acceptSelectedAction")}}class e5 extends UIEvent{constructor(){super("previewSelectedAction")}}function Ohe(o){if(o.kind==="action")return o.label}let bN=class extends H{constructor(e,t,i,n,s,r){super(),this._delegate=n,this._contextViewService=s,this._keybindingService=r,this._actionLineHeight=24,this._headerLineHeight=26,this.cts=this._register(new Si),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 mr(e,this.domNode,a,[new vN(t,this._keybindingService),new Ahe],{keyboardSupport:!1,typeNavigationEnabled:!0,keyboardNavigationLabelProvider:{getKeyboardNavigationLabel:Ohe},accessibilityProvider:{getAriaLabel:l=>{if(l.kind==="action"){let d=l.label?_W(l?.label):"";return l.disabled&&(d=g({key:"customQuickFixWidget.labels",comment:["Action widget labels for accessibility."]},"{0}, Disabled Reason: {1}",d,l.disabled)),d}return null},getWidgetAriaLabel:()=>g({key:"customQuickFixWidget",comment:["An action widget option"]},"Action Widget"),getRole:l=>l.kind==="action"?"option":"separator",getWidgetRole:()=>"listbox"}})),this._list.style(Qu),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=i,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(d=>d.kind==="header").length,n=this._allMenuItems.length*this._actionLineHeight+t*this._headerLineHeight-t*this._actionLineHeight;this._list.layout(n);const s=this._allMenuItems.map((d,c)=>{const h=document.getElementById(this._list.getElementID(c));if(h){h.style.width="auto";const u=h.getBoundingClientRect().width;return h.style.width="",u}return 0}),r=Math.max(...s,e),l=Math.min(n,document.body.clientHeight*.7);return this._list.layout(l,r),this.domNode.style.height=`${l}px`,this._list.domFocus(),r}focusPrevious(){this._list.focusPrevious(1,!0,void 0,this.focusCondition)}focusNext(){this._list.focusNext(1,!0,void 0,this.focusCondition)}acceptSelected(e){const t=this._list.getFocus();if(t.length===0)return;const i=t[0],n=this._list.element(i);if(!this.focusCondition(n))return;const s=e?new e5:new Phe;this._list.setSelection([i],s)}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 e5):this._list.setSelection([])}onFocus(){var e,t;this._list.domFocus();const i=this._list.getFocus();if(i.length===0)return;const n=i[0],s=this._list.element(n);(t=(e=this._delegate).onFocus)===null||t===void 0||t.call(e,s.item)}onListHover(e){return Mhe(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 i=yield this._delegate.onHover(t.item,this.cts.token);t.canPreview=i?i.canPreview:void 0}e.index&&this._list.splice(e.index,1,[t])}this._list.setFocus(typeof e.index=="number"?[e.index]:[])})}onListClick(e){e.element&&this.focusCondition(e.element)&&this._list.setFocus([])}};bN=gW([_N(4,ud),_N(5,Nt)],bN);function _W(o){return o.replace(/\r\n|\r|\n/g," ")}var Fhe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},uD=function(o,e){return function(t,i){e(t,i,o)}};T("actionBar.toggledBackground",{dark:zh,light:zh,hcDark:zh,hcLight:zh},g("actionBar.toggledBackground","Background color for toggled action items in action bar."));const Iu={Visible:new ce("codeActionMenuVisible",!1,g("codeActionMenuVisible","Whether the action widget list is visible"))},sf=et("actionWidgetService");let Eu=class extends H{get isVisible(){return Iu.Visible.getValue(this._contextKeyService)||!1}constructor(e,t,i){super(),this._contextViewService=e,this._contextKeyService=t,this._instantiationService=i,this._list=this._register(new pn)}show(e,t,i,n,s,r,a){const l=Iu.Visible.bindTo(this._contextKeyService),d=this._instantiationService.createInstance(bN,e,t,i,n);this._contextViewService.showContextView({getAnchor:()=>s,render:c=>(l.set(!0),this._renderWidget(c,d,a??[])),onHide:c=>{l.reset(),this._onWidgetClosed(c)}},r,!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,i){var n;const s=document.createElement("div");if(s.classList.add("action-widget"),e.appendChild(s),this._list.value=t,this._list.value)s.appendChild(this._list.value.domNode);else throw new Error("List has no value");const r=new X,a=document.createElement("div"),l=e.appendChild(a);l.classList.add("context-view-block"),r.add($(l,ae.MOUSE_DOWN,p=>p.stopPropagation()));const d=document.createElement("div"),c=e.appendChild(d);c.classList.add("context-view-pointerBlock"),r.add($(c,ae.POINTER_MOVE,()=>c.remove())),r.add($(c,ae.MOUSE_DOWN,()=>c.remove()));let h=0;if(i.length){const p=this._createActionBar(".action-widget-action-bar",i);p&&(s.appendChild(p.getContainer().parentElement),r.add(p),h=p.getContainer().offsetWidth)}const u=(n=this._list.value)===null||n===void 0?void 0:n.layout(h);s.style.width=`${u}px`;const f=r.add(Qa(e));return r.add(f.onDidBlur(()=>this.hide())),r}_createActionBar(e,t){if(!t.length)return;const i=te(e),n=new Wo(i);return n.push(t,{icon:!1,label:!0}),n}_onWidgetClosed(e){var t;(t=this._list.value)===null||t===void 0||t.hide(e)}};Eu=Fhe([uD(0,ud),uD(1,Ae),uD(2,Re)],Eu);dt(sf,Eu,1);const Y0=1100;jt(class extends fo{constructor(){super({id:"hideCodeActionWidget",title:{value:g("hideCodeActionWidget.title","Hide action widget"),original:"Hide action widget"},precondition:Iu.Visible,keybinding:{weight:Y0,primary:9,secondary:[1033]}})}run(o){o.get(sf).hide()}});jt(class extends fo{constructor(){super({id:"selectPrevCodeAction",title:{value:g("selectPrevCodeAction.title","Select previous action"),original:"Select previous action"},precondition:Iu.Visible,keybinding:{weight:Y0,primary:16,secondary:[2064],mac:{primary:16,secondary:[2064,302]}}})}run(o){const e=o.get(sf);e instanceof Eu&&e.focusPrevious()}});jt(class extends fo{constructor(){super({id:"selectNextCodeAction",title:{value:g("selectNextCodeAction.title","Select next action"),original:"Select next action"},precondition:Iu.Visible,keybinding:{weight:Y0,primary:18,secondary:[2066],mac:{primary:18,secondary:[2066,300]}}})}run(o){const e=o.get(sf);e instanceof Eu&&e.focusNext()}});jt(class extends fo{constructor(){super({id:pW,title:{value:g("acceptSelected.title","Accept selected action"),original:"Accept selected action"},precondition:Iu.Visible,keybinding:{weight:Y0,primary:3,secondary:[2137]}})}run(o){const e=o.get(sf);e instanceof Eu&&e.acceptSelected()}});jt(class extends fo{constructor(){super({id:mW,title:{value:g("previewSelected.title","Preview selected action"),original:"Preview selected action"},precondition:Iu.Visible,keybinding:{weight:Y0,primary:2051}})}run(o){const e=o.get(sf);e instanceof Eu&&e.acceptSelected(!0)}});var Bhe=function(o,e,t,i){function n(s){return s instanceof t?s:new t(function(r){r(s)})}return new(t||(t=Promise))(function(s,r){function a(c){try{d(i.next(c))}catch(h){r(h)}}function l(c){try{d(i.throw(c))}catch(h){r(h)}}function d(c){c.done?s(c.value):n(c.value).then(a,l)}d((i=i.apply(o,e||[])).next())})};const vW=new ce("supportedCodeAction","");class Whe extends H{constructor(e,t,i,n=250){super(),this._editor=e,this._markerService=t,this._signalChange=i,this._delay=n,this._autoTriggerTimer=this._register(new ur),this._register(this._markerService.onMarkerChanged(s=>this._onMarkerChanges(s))),this._register(this._editor.onDidChangeCursorPosition(()=>this._tryAutoTrigger()))}trigger(e){const t=this._getRangeOfSelectionUnlessWhitespaceEnclosed(e);this._signalChange(t?{trigger:e,selection:t}:void 0)}_onMarkerChanges(e){const t=this._editor.getModel();t&&e.some(i=>lR(i,t.uri))&&this._tryAutoTrigger()}_tryAutoTrigger(){this._autoTriggerTimer.cancelAndSet(()=>{this.trigger({type:2,triggerAction:Vs.Default})},this._delay)}_getRangeOfSelectionUnlessWhitespaceEnclosed(e){if(!this._editor.hasModel())return;const t=this._editor.getModel(),i=this._editor.getSelection();if(i.isEmpty()&&e.type===2){const{lineNumber:n,column:s}=i.getPosition(),r=t.getLineContent(n);if(r.length===0)return;if(s===1){if(/\s/.test(r[0]))return}else if(s===t.getLineMaxColumn(n)){if(/\s/.test(r[r.length-1]))return}else if(/\s/.test(r[s-2])&&/\s/.test(r[s-1]))return}return i}}var Fh;(function(o){o.Empty={type:0};class e{constructor(i,n,s){this.trigger=i,this.position=n,this._cancellablePromise=s,this.type=1,this.actions=s.catch(r=>{if(oa(r))return bW;throw r})}cancel(){this._cancellablePromise.cancel()}}o.Triggered=e})(Fh||(Fh={}));const bW=Object.freeze({allActions:[],validActions:[],dispose:()=>{},documentation:[],hasAutoFix:!1});class Vhe extends H{constructor(e,t,i,n,s,r){super(),this._editor=e,this._registry=t,this._markerService=i,this._progressService=s,this._configurationService=r,this._codeActionOracle=this._register(new pn),this._state=Fh.Empty,this._onDidChangeState=this._register(new A),this.onDidChangeState=this._onDidChangeState.event,this._disposed=!1,this._supportedCodeActions=vW.bindTo(n),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(Fh.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?.uri}):!1}_update(){if(this._disposed)return;this._codeActionOracle.value=void 0,this.setState(Fh.Empty);const e=this._editor.getModel();if(e&&this._registry.has(e)&&!this._editor.getOption(90)){const t=this._registry.all(e).flatMap(i=>{var n;return(n=i.providedCodeActionKinds)!==null&&n!==void 0?n:[]});this._supportedCodeActions.set(t.join(" ")),this._codeActionOracle.value=new Whe(this._editor,this._markerService,i=>{var n;if(!i){this.setState(Fh.Empty);return}const s=i.selection.getStartPosition(),r=Wi(a=>Bhe(this,void 0,void 0,function*(){var l,d,c,h,u,f;if(this._settingEnabledNearbyQuickfixes()&&i.trigger.type===1&&(i.trigger.triggerAction===Vs.QuickFix||!((d=(l=i.trigger.filter)===null||l===void 0?void 0:l.include)===null||d===void 0)&&d.contains(Ne.QuickFix))){const p=yield I_(this._registry,e,i.selection,i.trigger,Jl.None,a);if(a.isCancellationRequested)return bW;if(!((c=p.validActions)===null||c===void 0?void 0:c.some(v=>v.action.kind?Ne.QuickFix.contains(new Ne(v.action.kind)):!1))){const v=this._markerService.read({resource:e.uri});if(v.length>0){const _=i.selection.getPosition();let b=_,C=Number.MAX_VALUE,w=!1;for(const S of v){const D=S.endColumn,x=S.endLineNumber,I=S.startLineNumber;(x===_.lineNumber||I===_.lineNumber)&&Math.abs(_.column-D)<C&&(C=Math.abs(_.column-D),w=!0,b=new P(x,D))}if(w){const S={type:i.trigger.type,triggerAction:i.trigger.triggerAction,filter:{include:!((h=i.trigger.filter)===null||h===void 0)&&h.include?(u=i.trigger.filter)===null||u===void 0?void 0:u.include:Ne.QuickFix},autoApply:i.trigger.autoApply,context:{notAvailableMessage:((f=i.trigger.context)===null||f===void 0?void 0:f.notAvailableMessage)||"",position:b}},D=new ve(b.lineNumber,b.column,b.lineNumber,b.column),x=yield I_(this._registry,e,D,S,Jl.None,a),I=[...p.validActions];return x.validActions.length!==0&&(x.validActions.forEach(N=>{N.highlightRange=N.action.isPreferred}),I.push(...x.validActions)),{validActions:I,allActions:p.allActions,documentation:p.documentation,hasAutoFix:p.hasAutoFix,dispose:()=>{p.dispose()}}}}}}return I_(this._registry,e,i.selection,i.trigger,Jl.None,a)}));i.trigger.type===1&&((n=this._progressService)===null||n===void 0||n.showWhile(r,250)),this.setState(new Fh.Triggered(i.trigger,s,r))},void 0),this._codeActionOracle.value.trigger({type:2,triggerAction:Vs.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 Hhe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},vl=function(o,e){return function(t,i){e(t,i,o)}},Sm=function(o,e,t,i){function n(s){return s instanceof t?s:new t(function(r){r(s)})}return new(t||(t=Promise))(function(s,r){function a(c){try{d(i.next(c))}catch(h){r(h)}}function l(c){try{d(i.throw(c))}catch(h){r(h)}}function d(c){c.done?s(c.value):n(c.value).then(a,l)}d((i=i.apply(o,e||[])).next())})},a1;const zhe="quickfix-edit-highlight";let Pc=a1=class extends H{static get(e){return e.getContribution(a1.ID)}constructor(e,t,i,n,s,r,a,l,d,c){super(),this._commandService=a,this._configurationService=l,this._actionWidgetService=d,this._instantiationService=c,this._activeCodeActions=this._register(new pn),this._showDisabled=!1,this._disposed=!1,this._editor=e,this._model=this._register(new Vhe(this._editor,s.codeActionProvider,t,i,r,l)),this._register(this._model.onDidChangeState(h=>this.update(h))),this._lightBulbWidget=new Zc(()=>{const h=this._editor.getContribution(ku.ID);return h&&this._register(h.onClick(u=>this.showCodeActionList(u.actions,u,{includeDisabledActions:!1,fromLightbulb:!0}))),h}),this._resolver=n.createInstance(qw),this._register(this._editor.onDidLayoutChange(()=>this._actionWidgetService.hide()))}dispose(){this._disposed=!0,super.dispose()}showCodeActions(e,t,i){return this.showCodeActionList(t,i,{includeDisabledActions:!1,fromLightbulb:!1})}manualTriggerAtCurrentPosition(e,t,i,n){var s;if(!this._editor.hasModel())return;(s=Fs.get(this._editor))===null||s===void 0||s.closeMessage();const r=this._editor.getPosition();this._trigger({type:1,triggerAction:t,filter:i,autoApply:n,context:{notAvailableMessage:e,position:r}})}_trigger(e){return this._model.trigger(e)}_applyCodeAction(e,t,i){return Sm(this,void 0,void 0,function*(){try{yield this._instantiationService.invokeFunction(whe,e,Kw.FromCodeActions,{preview:i,editor:this._editor})}finally{t&&this._trigger({type:2,triggerAction:Vs.QuickFix,filter:{}})}})}update(e){var t,i,n,s,r,a,l;return Sm(this,void 0,void 0,function*(){if(e.type!==1){(t=this._lightBulbWidget.rawValue)===null||t===void 0||t.hide();return}let d;try{d=yield e.actions}catch(c){He(c);return}if(!this._disposed)if((i=this._lightBulbWidget.value)===null||i===void 0||i.update(d,e.trigger,e.position),e.trigger.type===1){if(!((n=e.trigger.filter)===null||n===void 0)&&n.include){const h=this.tryGetValidActionToApply(e.trigger,d);if(h){try{(s=this._lightBulbWidget.value)===null||s===void 0||s.hide(),yield this._applyCodeAction(h,!1,!1)}finally{d.dispose()}return}if(e.trigger.context){const u=this.getInvalidActionThatWouldHaveBeenApplied(e.trigger,d);if(u&&u.action.disabled){(r=Fs.get(this._editor))===null||r===void 0||r.showMessage(u.action.disabled,e.trigger.context.position),d.dispose();return}}}const c=!!(!((a=e.trigger.filter)===null||a===void 0)&&a.include);if(e.trigger.context&&(!d.allActions.length||!c&&!d.validActions.length)){(l=Fs.get(this._editor))===null||l===void 0||l.showMessage(e.trigger.context.notAvailableMessage,e.trigger.context.position),this._activeCodeActions.value=d,d.dispose();return}this._activeCodeActions.value=d,this.showCodeActionList(d,this.toCoords(e.position),{includeDisabledActions:c,fromLightbulb:!1})}else this._actionWidgetService.isVisible?d.dispose():this._activeCodeActions.value=d})}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:i})=>i.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,i){return Sm(this,void 0,void 0,function*(){const n=this._editor.createDecorationsCollection(),s=this._editor.getDomNode();if(!s)return;const r=i.includeDisabledActions&&(this._showDisabled||e.validActions.length===0)?e.allActions:e.validActions;if(!r.length)return;const a=P.isIPosition(t)?this.toCoords(t):t,l={onSelect:(d,c)=>Sm(this,void 0,void 0,function*(){this._applyCodeAction(d,!0,!!c),this._actionWidgetService.hide(),n.clear()}),onHide:()=>{var d;(d=this._editor)===null||d===void 0||d.focus(),n.clear()},onHover:(d,c)=>Sm(this,void 0,void 0,function*(){var h;if(yield d.resolve(c),!c.isCancellationRequested)return{canPreview:!!(!((h=d.action.edit)===null||h===void 0)&&h.edits.length)}}),onFocus:d=>{var c,h;if(d&&d.highlightRange&&d.action.diagnostics){const u=[{range:d.action.diagnostics[0],options:a1.DECORATION}];n.set(u);const f=d.action.diagnostics[0],p=(h=(c=this._editor.getModel())===null||c===void 0?void 0:c.getWordAtPosition({lineNumber:f.startLineNumber,column:f.startColumn}))===null||h===void 0?void 0:h.word;Ic(g("editingNewSelection","Context: {0} at line {1} and column {2}.",p,f.startLineNumber,f.startColumn))}else n.clear()}};this._actionWidgetService.show("codeActionWidget",!0,Dhe(r,this._shouldShowHeaders(),this._resolver.getResolver()),l,a,s,this._getActionBarActions(e,t,i))})}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),i=Ai(this._editor.getDomNode()),n=i.left+t.left,s=i.top+t.top+t.height;return{x:n,y:s}}_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?.uri})}_getActionBarActions(e,t,i){if(i.fromLightbulb)return[];const n=e.documentation.map(s=>{var r;return{id:s.id,label:s.title,tooltip:(r=s.tooltip)!==null&&r!==void 0?r:"",class:void 0,enabled:!0,run:()=>{var a;return this._commandService.executeCommand(s.id,...(a=s.arguments)!==null&&a!==void 0?a:[])}}});return i.includeDisabledActions&&e.validActions.length>0&&e.allActions.length!==e.validActions.length&&n.push(this._showDisabled?{id:"hideMoreActions",label:g("hideMoreActions","Hide Disabled"),enabled:!0,tooltip:"",class:void 0,run:()=>(this._showDisabled=!1,this.showCodeActionList(e,t,i))}:{id:"showMoreActions",label:g("showMoreActions","Show Disabled"),enabled:!0,tooltip:"",class:void 0,run:()=>(this._showDisabled=!0,this.showCodeActionList(e,t,i))}),n}};Pc.ID="editor.contrib.codeActionController";Pc.DECORATION=Ve.register({description:"quickfix-highlight",className:zhe});Pc=a1=Hhe([vl(1,ul),vl(2,Ae),vl(3,Re),vl(4,pe),vl(5,Jc),vl(6,li),vl(7,st),vl(8,sf),vl(9,Re)],Pc);gr((o,e)=>{((n,s)=>{s&&e.addRule(`.monaco-editor ${n} { background-color: ${s}; }`)})(".quickfix-edit-highlight",o.getColor(Ha));const i=o.getColor(Kd);i&&e.addRule(`.monaco-editor .quickfix-edit-highlight { border: 1px ${Zr(o.type)?"dotted":"solid"} ${i}; box-sizing: border-box; }`)});function X0(o){return Z.regex(vW.keys()[0],new RegExp("(\\s|^)"+ao(o.value)+"\\b"))}const EM={type:"object",defaultSnippets:[{body:{kind:""}}],properties:{kind:{type:"string",description:g("args.schema.kind","Kind of the code action to run.")},apply:{type:"string",description:g("args.schema.apply","Controls when the returned actions are applied."),default:"ifSingle",enum:["first","ifSingle","never"],enumDescriptions:[g("args.schema.apply.first","Always apply the first returned code action."),g("args.schema.apply.ifSingle","Apply the first returned code action if it is the only one."),g("args.schema.apply.never","Do not apply the returned code actions.")]},preferred:{type:"boolean",default:!1,description:g("args.schema.preferred","Controls if only preferred code actions should be returned.")}}};function of(o,e,t,i,n=Vs.Default){if(o.hasModel()){const s=Pc.get(o);s?.manualTriggerAtCurrentPosition(e,n,t,i)}}class Uhe extends fe{constructor(){super({id:DM,label:g("quickfix.trigger.label","Quick Fix..."),alias:"Quick Fix...",precondition:Z.and(E.writable,E.hasCodeActionsProvider),kbOpts:{kbExpr:E.textInputFocus,primary:2137,weight:100}})}run(e,t){return of(t,g("editor.action.quickFix.noneMessage","No code actions available"),void 0,void 0,Vs.QuickFix)}}class $he extends tn{constructor(){super({id:aW,precondition:Z.and(E.writable,E.hasCodeActionsProvider),description:{description:"Trigger a code action",args:[{name:"args",schema:EM}]}})}runEditorCommand(e,t,i){const n=Ma.fromUser(i,{kind:Ne.Empty,apply:"ifSingle"});return of(t,typeof i?.kind=="string"?n.preferred?g("editor.action.codeAction.noneMessage.preferred.kind","No preferred code actions for '{0}' available",i.kind):g("editor.action.codeAction.noneMessage.kind","No code actions for '{0}' available",i.kind):n.preferred?g("editor.action.codeAction.noneMessage.preferred","No preferred code actions available"):g("editor.action.codeAction.noneMessage","No code actions available"),{include:n.kind,includeSourceActions:!0,onlyIncludePreferredActions:n.preferred},n.apply)}}class jhe extends fe{constructor(){super({id:dW,label:g("refactor.label","Refactor..."),alias:"Refactor...",precondition:Z.and(E.writable,E.hasCodeActionsProvider),kbOpts:{kbExpr:E.textInputFocus,primary:3120,mac:{primary:1328},weight:100},contextMenuOpts:{group:"1_modification",order:2,when:Z.and(E.writable,X0(Ne.Refactor))},description:{description:"Refactor...",args:[{name:"args",schema:EM}]}})}run(e,t,i){const n=Ma.fromUser(i,{kind:Ne.Refactor,apply:"never"});return of(t,typeof i?.kind=="string"?n.preferred?g("editor.action.refactor.noneMessage.preferred.kind","No preferred refactorings for '{0}' available",i.kind):g("editor.action.refactor.noneMessage.kind","No refactorings for '{0}' available",i.kind):n.preferred?g("editor.action.refactor.noneMessage.preferred","No preferred refactorings available"):g("editor.action.refactor.noneMessage","No refactorings available"),{include:Ne.Refactor.contains(n.kind)?n.kind:Ne.None,onlyIncludePreferredActions:n.preferred},n.apply,Vs.Refactor)}}class Khe extends fe{constructor(){super({id:cW,label:g("source.label","Source Action..."),alias:"Source Action...",precondition:Z.and(E.writable,E.hasCodeActionsProvider),contextMenuOpts:{group:"1_modification",order:2.1,when:Z.and(E.writable,X0(Ne.Source))},description:{description:"Source Action...",args:[{name:"args",schema:EM}]}})}run(e,t,i){const n=Ma.fromUser(i,{kind:Ne.Source,apply:"never"});return of(t,typeof i?.kind=="string"?n.preferred?g("editor.action.source.noneMessage.preferred.kind","No preferred source actions for '{0}' available",i.kind):g("editor.action.source.noneMessage.kind","No source actions for '{0}' available",i.kind):n.preferred?g("editor.action.source.noneMessage.preferred","No preferred source actions available"):g("editor.action.source.noneMessage","No source actions available"),{include:Ne.Source.contains(n.kind)?n.kind:Ne.None,includeSourceActions:!0,onlyIncludePreferredActions:n.preferred},n.apply,Vs.SourceAction)}}class qhe extends fe{constructor(){super({id:kM,label:g("organizeImports.label","Organize Imports"),alias:"Organize Imports",precondition:Z.and(E.writable,X0(Ne.SourceOrganizeImports)),kbOpts:{kbExpr:E.textInputFocus,primary:1581,weight:100}})}run(e,t){return of(t,g("editor.action.organize.noneMessage","No organize imports action available"),{include:Ne.SourceOrganizeImports,includeSourceActions:!0},"ifSingle",Vs.OrganizeImports)}}class Ghe extends fe{constructor(){super({id:IM,label:g("fixAll.label","Fix All"),alias:"Fix All",precondition:Z.and(E.writable,X0(Ne.SourceFixAll))})}run(e,t){return of(t,g("fixAll.noneMessage","No fix all action available"),{include:Ne.SourceFixAll,includeSourceActions:!0},"ifSingle",Vs.FixAll)}}class Zhe extends fe{constructor(){super({id:lW,label:g("autoFix.label","Auto Fix..."),alias:"Auto Fix...",precondition:Z.and(E.writable,X0(Ne.QuickFix)),kbOpts:{kbExpr:E.textInputFocus,primary:1625,mac:{primary:2649},weight:100}})}run(e,t){return of(t,g("editor.action.autoFix.noneMessage","No auto fixes available"),{include:Ne.QuickFix,onlyIncludePreferredActions:!0},"ifSingle",Vs.AutoFix)}}ft(Pc.ID,Pc,3);ft(ku.ID,ku,4);ne(Uhe);ne(jhe);ne(Khe);ne(qhe);ne(Zhe);ne(Ghe);re(new $he);Jt.as(aa.Configuration).registerConfiguration(Object.assign(Object.assign({},cy),{properties:{"editor.codeActionWidget.showHeaders":{type:"boolean",scope:5,description:g("showCodeActionHeaders","Enable/disable showing group headers in the Code Action menu."),default:!0}}}));Jt.as(aa.Configuration).registerConfiguration(Object.assign(Object.assign({},cy),{properties:{"editor.codeActionWidget.includeNearbyQuickfixes":{type:"boolean",scope:5,description:g("includeNearbyQuickfixes","Enable/disable showing nearest quickfix within a line when not currently on a diagnostic."),default:!1}}}));var t5=function(o,e,t,i){function n(s){return s instanceof t?s:new t(function(r){r(s)})}return new(t||(t=Promise))(function(s,r){function a(c){try{d(i.next(c))}catch(h){r(h)}}function l(c){try{d(i.throw(c))}catch(h){r(h)}}function d(c){c.done?s(c.value):n(c.value).then(a,l)}d((i=i.apply(o,e||[])).next())})};class CN{constructor(){this.lenses=[],this._disposables=new X}dispose(){this._disposables.dispose()}get isDisposed(){return this._disposables.isDisposed}add(e,t){this._disposables.add(e);for(const i of e.lenses)this.lenses.push({symbol:i,provider:t})}}function CW(o,e,t){return t5(this,void 0,void 0,function*(){const i=o.ordered(e),n=new Map,s=new CN,r=i.map((a,l)=>t5(this,void 0,void 0,function*(){n.set(a,l);try{const d=yield Promise.resolve(a.provideCodeLenses(e,t));d&&s.add(d,a)}catch(d){Ni(d)}}));return yield Promise.all(r),s.lenses=s.lenses.sort((a,l)=>a.symbol.range.startLineNumber<l.symbol.range.startLineNumber?-1:a.symbol.range.startLineNumber>l.symbol.range.startLineNumber?1:n.get(a.provider)<n.get(l.provider)?-1:n.get(a.provider)>n.get(l.provider)?1:a.symbol.range.startColumn<l.symbol.range.startColumn?-1:a.symbol.range.startColumn>l.symbol.range.startColumn?1:0),s})}lt.registerCommand("_executeCodeLensProvider",function(o,...e){let[t,i]=e;xt(ke.isUri(t)),xt(typeof i=="number"||!i);const{codeLensProvider:n}=o.get(pe),s=o.get(Yt).getModel(t);if(!s)throw No();const r=[],a=new X;return CW(n,s,Qe.None).then(l=>{a.add(l);const d=[];for(const c of l.lenses)i==null||c.symbol.command?r.push(c.symbol):i-- >0&&c.provider.resolveCodeLens&&d.push(Promise.resolve(c.provider.resolveCodeLens(s,c.symbol,Qe.None)).then(h=>r.push(h||c.symbol)));return Promise.all(d)}).then(()=>r).finally(()=>{setTimeout(()=>a.dispose(),100)})});var Yhe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Xhe=function(o,e){return function(t,i){e(t,i,o)}};const wW=et("ICodeLensCache");class i5{constructor(e,t){this.lineCount=e,this.data=t}}let wN=class{constructor(e){this._fakeProvider=new class{provideCodeLenses(){throw new Error("not supported")}},this._cache=new Yc(20,.75);const t="codelens/cache";Vl(()=>e.remove(t,1));const i="codelens/cache2",n=e.get(i,1,"{}");this._deserialize(n),de.once(e.onWillSaveState)(s=>{s.reason===bw.SHUTDOWN&&e.store(i,this._serialize(),1,1)})}put(e,t){const i=t.lenses.map(r=>{var a;return{range:r.symbol.range,command:r.symbol.command&&{id:"",title:(a=r.symbol.command)===null||a===void 0?void 0:a.title}}}),n=new CN;n.add({lenses:i,dispose:()=>{}},this._fakeProvider);const s=new i5(e.getLineCount(),n);this._cache.set(e.uri.toString(),s)}get(e){const t=this._cache.get(e.uri.toString());return t&&t.lineCount===e.getLineCount()?t.data:void 0}delete(e){this._cache.delete(e.uri.toString())}_serialize(){const e=Object.create(null);for(const[t,i]of this._cache){const n=new Set;for(const s of i.data.lenses)n.add(s.symbol.range.startLineNumber);e[t]={lineCount:i.lineCount,lines:[...n.values()]}}return JSON.stringify(e)}_deserialize(e){try{const t=JSON.parse(e);for(const i in t){const n=t[i],s=[];for(const a of n.lines)s.push({range:new L(a,1,a,11)});const r=new CN;r.add({lenses:s,dispose(){}},this._fakeProvider),this._cache.set(i,new i5(n.lineCount,r))}}catch{}}};wN=Yhe([Xhe(0,_r)],wN);dt(wW,wN,1);class Qhe{constructor(e,t,i){this.afterColumn=1073741824,this.afterLineNumber=e,this.heightInPx=t,this._onHeight=i,this.suppressMouseDown=!0,this.domNode=document.createElement("div")}onComputedHeight(e){this._lastHeight===void 0?this._lastHeight=e:this._lastHeight!==e&&(this._lastHeight=e,this._onHeight())}isVisible(){return this._lastHeight!==0&&this.domNode.hasAttribute("monaco-visible-view-zone")}}class $y{constructor(e,t){this.allowEditorOverflow=!1,this.suppressMouseDown=!0,this._commands=new Map,this._isEmpty=!0,this._editor=e,this._id=`codelens.widget-${$y._idPool++}`,this.updatePosition(t),this._domNode=document.createElement("span"),this._domNode.className="codelens-decoration"}withCommands(e,t){this._commands.clear();const i=[];let n=!1;for(let s=0;s<e.length;s++){const r=e[s];if(r&&(n=!0,r.command)){const a=dc(r.command.title.trim());r.command.id?(i.push(te("a",{id:String(s),title:r.command.tooltip,role:"button"},...a)),this._commands.set(String(s),r.command)):i.push(te("span",{title:r.command.tooltip},...a)),s+1<e.length&&i.push(te("span",void 0," | "))}}n?(gn(this._domNode,...i),this._isEmpty&&t&&this._domNode.classList.add("fadein"),this._isEmpty=!1):gn(this._domNode,te("span",void 0,"no commands"))}getCommand(e){return e.parentElement===this._domNode?this._commands.get(e.id):void 0}getId(){return this._id}getDomNode(){return this._domNode}updatePosition(e){const t=this._editor.getModel().getLineFirstNonWhitespaceColumn(e);this._widgetPosition={position:{lineNumber:e,column:t},preference:[1]}}getPosition(){return this._widgetPosition||null}}$y._idPool=0;class fD{constructor(){this._removeDecorations=[],this._addDecorations=[],this._addDecorationsCallbacks=[]}addDecoration(e,t){this._addDecorations.push(e),this._addDecorationsCallbacks.push(t)}removeDecoration(e){this._removeDecorations.push(e)}commit(e){const t=e.deltaDecorations(this._removeDecorations,this._addDecorations);for(let i=0,n=t.length;i<n;i++)this._addDecorationsCallbacks[i](t[i])}}const n5=Ve.register({collapseOnReplaceEdit:!0,description:"codelens"});class s5{constructor(e,t,i,n,s,r){this._isDisposed=!1,this._editor=t,this._data=e,this._decorationIds=[];let a;const l=[];this._data.forEach((d,c)=>{d.symbol.command&&l.push(d.symbol),i.addDecoration({range:d.symbol.range,options:n5},h=>this._decorationIds[c]=h),a?a=L.plusRange(a,d.symbol.range):a=L.lift(d.symbol.range)}),this._viewZone=new Qhe(a.startLineNumber-1,s,r),this._viewZoneId=n.addZone(this._viewZone),l.length>0&&(this._createContentWidgetIfNecessary(),this._contentWidget.withCommands(l,!1))}_createContentWidgetIfNecessary(){this._contentWidget?this._editor.layoutContentWidget(this._contentWidget):(this._contentWidget=new $y(this._editor,this._viewZone.afterLineNumber+1),this._editor.addContentWidget(this._contentWidget))}dispose(e,t){this._decorationIds.forEach(e.removeDecoration,e),this._decorationIds=[],t?.removeZone(this._viewZoneId),this._contentWidget&&(this._editor.removeContentWidget(this._contentWidget),this._contentWidget=void 0),this._isDisposed=!0}isDisposed(){return this._isDisposed}isValid(){return this._decorationIds.some((e,t)=>{const i=this._editor.getModel().getDecorationRange(e),n=this._data[t].symbol;return!!(i&&L.isEmpty(n.range)===i.isEmpty())})}updateCodeLensSymbols(e,t){this._decorationIds.forEach(t.removeDecoration,t),this._decorationIds=[],this._data=e,this._data.forEach((i,n)=>{t.addDecoration({range:i.symbol.range,options:n5},s=>this._decorationIds[n]=s)})}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<this._decorationIds.length;t++){const i=e.getDecorationRange(this._decorationIds[t]);i&&(this._data[t].symbol.range=i)}return this._data}updateCommands(e){this._createContentWidgetIfNecessary(),this._contentWidget.withCommands(e,!0);for(let t=0;t<this._data.length;t++){const i=e[t];if(i){const{symbol:n}=this._data[t];n.command=i.command||n.command}}}getCommand(e){var t;return(t=this._contentWidget)===null||t===void 0?void 0:t.getCommand(e)}getLineNumber(){const e=this._editor.getModel().getDecorationRange(this._decorationIds[0]);return e?e.startLineNumber:-1}update(e){if(this.isValid()){const t=this._editor.getModel().getDecorationRange(this._decorationIds[0]);t&&(this._viewZone.afterLineNumber=t.startLineNumber-1,e.layoutZone(this._viewZoneId),this._contentWidget&&(this._contentWidget.updatePosition(t.startLineNumber),this._editor.layoutContentWidget(this._contentWidget)))}}}var Jhe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},ym=function(o,e){return function(t,i){e(t,i,o)}},SW=function(o,e,t,i){function n(s){return s instanceof t?s:new t(function(r){r(s)})}return new(t||(t=Promise))(function(s,r){function a(c){try{d(i.next(c))}catch(h){r(h)}}function l(c){try{d(i.throw(c))}catch(h){r(h)}}function d(c){c.done?s(c.value):n(c.value).then(a,l)}d((i=i.apply(o,e||[])).next())})};let vp=class{constructor(e,t,i,n,s,r){this._editor=e,this._languageFeaturesService=t,this._commandService=n,this._notificationService=s,this._codeLensCache=r,this._disposables=new X,this._localToDispose=new X,this._lenses=[],this._oldCodeLensModels=new X,this._provideCodeLensDebounce=i.for(t.codeLensProvider,"CodeLensProvide",{min:250}),this._resolveCodeLensesDebounce=i.for(t.codeLensProvider,"CodeLensResolve",{min:250,salt:"resolve"}),this._resolveCodeLensesScheduler=new Dt(()=>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(),i=this._editor.getOption(18),n=this._editor.getOption(50),{style:s}=this._editor.getContainerDomNode();s.setProperty("--vscode-editorCodeLens-lineHeight",`${e}px`),s.setProperty("--vscode-editorCodeLens-fontSize",`${t}px`),s.setProperty("--vscode-editorCodeLens-fontFeatureSettings",n.fontFeatureSettings),i&&(s.setProperty("--vscode-editorCodeLens-fontFamily",i),s.setProperty("--vscode-editorCodeLens-fontFamilyDefault",Ps.fontFamily)),this._editor.changeViewZones(r=>{for(const a of this._lenses)a.updateHeight(e,r)})}_localDispose(){var e,t,i;(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(),(i=this._currentCodeLensModel)===null||i===void 0||i.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(xc(()=>{const n=this._codeLensCache.get(e);t===n&&(this._codeLensCache.delete(e),this._onModelChange())},30*1e3));return}for(const n of this._languageFeaturesService.codeLensProvider.all(e))if(typeof n.onDidChange=="function"){const s=n.onDidChange(()=>i.schedule());this._localToDispose.add(s)}const i=new Dt(()=>{var n;const s=Date.now();(n=this._getCodeLensModelPromise)===null||n===void 0||n.cancel(),this._getCodeLensModelPromise=Wi(r=>CW(this._languageFeaturesService.codeLensProvider,e,r)),this._getCodeLensModelPromise.then(r=>{this._currentCodeLensModel&&this._oldCodeLensModels.add(this._currentCodeLensModel),this._currentCodeLensModel=r,this._codeLensCache.put(e,r);const a=this._provideCodeLensDebounce.update(e,Date.now()-s);i.delay=a,this._renderCodeLensSymbols(r),this._resolveCodeLensesInViewportSoon()},He)},this._provideCodeLensDebounce.get(e));this._localToDispose.add(i),this._localToDispose.add(Me(()=>this._resolveCodeLensesScheduler.cancel())),this._localToDispose.add(this._editor.onDidChangeModelContent(()=>{var n;this._editor.changeDecorations(s=>{this._editor.changeViewZones(r=>{const a=[];let l=-1;this._lenses.forEach(c=>{!c.isValid()||l===c.getLineNumber()?a.push(c):(c.update(r),l=c.getLineNumber())});const d=new fD;a.forEach(c=>{c.dispose(d,r),this._lenses.splice(this._lenses.indexOf(c),1)}),d.commit(s)})}),i.schedule(),this._resolveCodeLensesScheduler.cancel(),(n=this._resolveCodeLensesPromise)===null||n===void 0||n.cancel(),this._resolveCodeLensesPromise=void 0})),this._localToDispose.add(this._editor.onDidFocusEditorWidget(()=>{i.schedule()})),this._localToDispose.add(this._editor.onDidBlurEditorText(()=>{i.cancel()})),this._localToDispose.add(this._editor.onDidScrollChange(n=>{n.scrollTopChanged&&this._lenses.length>0&&this._resolveCodeLensesInViewportSoon()})),this._localToDispose.add(this._editor.onDidLayoutChange(()=>{this._resolveCodeLensesInViewportSoon()})),this._localToDispose.add(Me(()=>{if(this._editor.getModel()){const n=ia.capture(this._editor);this._editor.changeDecorations(s=>{this._editor.changeViewZones(r=>{this._disposeAllLenses(s,r)})}),n.restore(this._editor)}else this._disposeAllLenses(void 0,void 0)})),this._localToDispose.add(this._editor.onMouseDown(n=>{if(n.target.type!==9)return;let s=n.target.element;if(s?.tagName==="SPAN"&&(s=s.parentElement),s?.tagName==="A")for(const r of this._lenses){const a=r.getCommand(s);if(a){this._commandService.executeCommand(a.id,...a.arguments||[]).catch(l=>this._notificationService.error(l));break}}})),i.schedule()}_disposeAllLenses(e,t){const i=new fD;for(const n of this._lenses)n.dispose(i,t);e&&i.commit(e),this._lenses.length=0}_renderCodeLensSymbols(e){if(!this._editor.hasModel())return;const t=this._editor.getModel().getLineCount(),i=[];let n;for(const a of e.lenses){const l=a.symbol.range.startLineNumber;l<1||l>t||(n&&n[n.length-1].symbol.range.startLineNumber===l?n.push(a):(n=[a],i.push(n)))}if(!i.length&&!this._lenses.length)return;const s=ia.capture(this._editor),r=this._getLayoutInfo();this._editor.changeDecorations(a=>{this._editor.changeViewZones(l=>{const d=new fD;let c=0,h=0;for(;h<i.length&&c<this._lenses.length;){const u=i[h][0].symbol.range.startLineNumber,f=this._lenses[c].getLineNumber();f<u?(this._lenses[c].dispose(d,l),this._lenses.splice(c,1)):f===u?(this._lenses[c].updateCodeLensSymbols(i[h],d),h++,c++):(this._lenses.splice(c,0,new s5(i[h],this._editor,d,l,r.codeLensHeight,()=>this._resolveCodeLensesInViewportSoon())),c++,h++)}for(;c<this._lenses.length;)this._lenses[c].dispose(d,l),this._lenses.splice(c,1);for(;h<i.length;)this._lenses.push(new s5(i[h],this._editor,d,l,r.codeLensHeight,()=>this._resolveCodeLensesInViewportSoon())),h++;d.commit(a)})}),s.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 i=[],n=[];if(this._lenses.forEach(a=>{const l=a.computeIfNecessary(t);l&&(i.push(l),n.push(a))}),i.length===0)return;const s=Date.now(),r=Wi(a=>{const l=i.map((d,c)=>{const h=new Array(d.length),u=d.map((f,p)=>!f.symbol.command&&typeof f.provider.resolveCodeLens=="function"?Promise.resolve(f.provider.resolveCodeLens(t,f.symbol,a)).then(m=>{h[p]=m},Ni):(h[p]=f.symbol,Promise.resolve(void 0)));return Promise.all(u).then(()=>{!a.isCancellationRequested&&!n[c].isDisposed()&&n[c].updateCommands(h)})});return Promise.all(l)});this._resolveCodeLensesPromise=r,this._resolveCodeLensesPromise.then(()=>{const a=this._resolveCodeLensesDebounce.update(t,Date.now()-s);this._resolveCodeLensesScheduler.delay=a,this._currentCodeLensModel&&this._codeLensCache.put(t,this._currentCodeLensModel),this._oldCodeLensModels.clear(),r===this._resolveCodeLensesPromise&&(this._resolveCodeLensesPromise=void 0)},a=>{He(a),r===this._resolveCodeLensesPromise&&(this._resolveCodeLensesPromise=void 0)})}getModel(){var e;return SW(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})}};vp.ID="css.editor.codeLens";vp=Jhe([ym(1,pe),ym(2,Ho),ym(3,li),ym(4,Li),ym(5,wW)],vp);ft(vp.ID,vp,1);ne(class extends fe{constructor(){super({id:"codelens.showLensesInCurrentLine",precondition:E.hasCodeLensProvider,label:g("showLensOnLine","Show CodeLens Commands For Current Line"),alias:"Show CodeLens Commands For Current Line"})}run(e,t){return SW(this,void 0,void 0,function*(){if(!t.hasModel())return;const i=e.get(la),n=e.get(li),s=e.get(Li),r=t.getSelection().positionLineNumber,a=t.getContribution(vp.ID);if(!a)return;const l=yield a.getModel();if(!l)return;const d=[];for(const u of l.lenses)u.symbol.command&&u.symbol.range.startLineNumber===r&&d.push({label:u.symbol.command.title,command:u.symbol.command});if(d.length===0)return;const c=yield i.pick(d,{canPickMany:!1,placeHolder:g("placeHolder","Select a command")});if(!c)return;let h=c.command;if(l.isDisposed){const u=yield a.getModel(),f=u?.lenses.find(p=>{var m;return p.symbol.range.startLineNumber===r&&((m=p.symbol.command)===null||m===void 0?void 0:m.title)===h.title});if(!f||!f.symbol.command)return;h=f.symbol.command}try{yield n.executeCommand(h.id,...h.arguments||[])}catch(u){s.error(u)}})}});var eue=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},gD=function(o,e){return function(t,i){e(t,i,o)}},tue=function(o,e,t,i){function n(s){return s instanceof t?s:new t(function(r){r(s)})}return new(t||(t=Promise))(function(s,r){function a(c){try{d(i.next(c))}catch(h){r(h)}}function l(c){try{d(i.throw(c))}catch(h){r(h)}}function d(c){c.done?s(c.value):n(c.value).then(a,l)}d((i=i.apply(o,e||[])).next())})};class NM{constructor(e,t){this._editorWorkerClient=new F2(e,!1,"editorWorkerService",t)}provideDocumentColors(e,t){return tue(this,void 0,void 0,function*(){return this._editorWorkerClient.computeDefaultDocumentColors(e.uri)})}provideColorPresentations(e,t,i){const n=t.range,s=t.color,r=s.alpha,a=new V(new rt(Math.round(255*s.red),Math.round(255*s.green),Math.round(255*s.blue),r)),l=r?V.Format.CSS.formatRGB(a):V.Format.CSS.formatRGBA(a),d=r?V.Format.CSS.formatHSL(a):V.Format.CSS.formatHSLA(a),c=r?V.Format.CSS.formatHex(a):V.Format.CSS.formatHexA(a),h=[];return h.push({label:l,textEdit:{range:n,text:l}}),h.push({label:d,textEdit:{range:n,text:d}}),h.push({label:c,textEdit:{range:n,text:c}}),h}}let SN=class extends H{constructor(e,t,i){super(),this._register(i.colorProvider.register("*",new NM(e,t)))}};SN=eue([gD(0,Yt),gD(1,At),gD(2,pe)],SN);Ny(SN);var Q0=function(o,e,t,i){function n(s){return s instanceof t?s:new t(function(r){r(s)})}return new(t||(t=Promise))(function(s,r){function a(c){try{d(i.next(c))}catch(h){r(h)}}function l(c){try{d(i.throw(c))}catch(h){r(h)}}function d(c){c.done?s(c.value):n(c.value).then(a,l)}d((i=i.apply(o,e||[])).next())})};function yW(o,e,t,i=!0){return Q0(this,void 0,void 0,function*(){return TM(new iue,o,e,t,i)})}function LW(o,e,t,i){return Promise.resolve(t.provideColorPresentations(o,e,i))}class iue{constructor(){}compute(e,t,i,n){return Q0(this,void 0,void 0,function*(){const s=yield e.provideDocumentColors(t,i);if(Array.isArray(s))for(const r of s)n.push({colorInfo:r,provider:e});return Array.isArray(s)})}}class nue{constructor(){}compute(e,t,i,n){return Q0(this,void 0,void 0,function*(){const s=yield e.provideDocumentColors(t,i);if(Array.isArray(s))for(const r of s)n.push({range:r.range,color:[r.color.red,r.color.green,r.color.blue,r.color.alpha]});return Array.isArray(s)})}}class sue{constructor(e){this.colorInfo=e}compute(e,t,i,n){return Q0(this,void 0,void 0,function*(){const s=yield e.provideColorPresentations(t,this.colorInfo,Qe.None);return Array.isArray(s)&&n.push(...s),Array.isArray(s)})}}function TM(o,e,t,i,n){return Q0(this,void 0,void 0,function*(){let s=!1,r;const a=[],l=e.ordered(t);for(let d=l.length-1;d>=0;d--){const c=l[d];if(c instanceof NM)r=c;else try{(yield o.compute(c,t,i,a))&&(s=!0)}catch(h){Ni(h)}}return s?a:r&&n?(yield o.compute(r,t,i,a),a):[]})}function xW(o,e){const{colorProvider:t}=o.get(pe),i=o.get(Yt).getModel(e);if(!i)throw No();const n=o.get(st).getValue("editor.defaultColorDecorators",{resource:e});return{model:i,colorProviderRegistry:t,isDefaultColorDecoratorsEnabled:n}}lt.registerCommand("_executeDocumentColorProvider",function(o,...e){const[t]=e;if(!(t instanceof ke))throw No();const{model:i,colorProviderRegistry:n,isDefaultColorDecoratorsEnabled:s}=xW(o,t);return TM(new nue,n,i,Qe.None,s)});lt.registerCommand("_executeColorPresentationProvider",function(o,...e){const[t,i]=e,{uri:n,range:s}=i;if(!(n instanceof ke)||!Array.isArray(t)||t.length!==4||!L.isIRange(s))throw No();const{model:r,colorProviderRegistry:a,isDefaultColorDecoratorsEnabled:l}=xW(o,n),[d,c,h,u]=t;return TM(new sue({range:s,color:{red:d,green:c,blue:h,alpha:u}}),a,r,Qe.None,l)});var oue=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},pD=function(o,e){return function(t,i){e(t,i,o)}},o5=function(o,e,t,i){function n(s){return s instanceof t?s:new t(function(r){r(s)})}return new(t||(t=Promise))(function(s,r){function a(c){try{d(i.next(c))}catch(h){r(h)}}function l(c){try{d(i.throw(c))}catch(h){r(h)}}function d(c){c.done?s(c.value):n(c.value).then(a,l)}d((i=i.apply(o,e||[])).next())})},yN;const DW=Object.create({});let Oc=yN=class extends H{constructor(e,t,i,n){super(),this._editor=e,this._configurationService=t,this._languageFeaturesService=i,this._localToDispose=this._register(new X),this._decorationsIds=[],this._colorDatas=new Map,this._colorDecoratorIds=this._editor.createDecorationsCollection(),this._ruleFactory=new I0(this._editor),this._decoratorLimitReporter=new rue,this._colorDecorationClassRefs=this._register(new X),this._debounceInformation=n.for(i.colorProvider,"Document Colors",{min:yN.RECOMPUTE_TIME}),this._register(e.onDidChangeModel(()=>{this._isColorDecoratorsEnabled=this.isEnabled(),this.updateColors()})),this._register(e.onDidChangeModelLanguage(()=>this.updateColors())),this._register(i.colorProvider.onDidChange(()=>this.updateColors())),this._register(e.onDidChangeConfiguration(s=>{const r=this._isColorDecoratorsEnabled;this._isColorDecoratorsEnabled=this.isEnabled(),this._isDefaultColorDecoratorsEnabled=this._editor.getOption(145);const a=r!==this._isColorDecoratorsEnabled||s.hasChanged(21),l=s.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(),i=this._configurationService.getValue(t);if(i&&typeof i=="object"){const n=i.colorDecorators;if(n&&n.enable!==void 0&&!n.enable)return n.enable}return this._editor.getOption(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 ur,this._timeoutTimer.cancelAndSet(()=>{this._timeoutTimer=null,this.beginCompute()},this._debounceInformation.get(e)))})),this.beginCompute())}beginCompute(){return o5(this,void 0,void 0,function*(){this._computePromise=Wi(e=>o5(this,void 0,void 0,function*(){const t=this._editor.getModel();if(!t)return[];const i=new Bn(!1),n=yield yW(this._languageFeaturesService.colorProvider,t,e,this._isDefaultColorDecoratorsEnabled);return this._debounceInformation.update(t,i.elapsed()),n}));try{const e=yield this._computePromise;this.updateDecorations(e),this.updateColorDecorators(e),this._computePromise=null}catch(e){He(e)}})}stop(){this._timeoutTimer&&(this._timeoutTimer.cancel(),this._timeoutTimer=null),this._computePromise&&(this._computePromise.cancel(),this._computePromise=null),this._localToDispose.clear()}updateDecorations(e){const t=e.map(i=>({range:{startLineNumber:i.colorInfo.range.startLineNumber,startColumn:i.colorInfo.range.startColumn,endLineNumber:i.colorInfo.range.endLineNumber,endColumn:i.colorInfo.range.endColumn},options:Ve.EMPTY}));this._editor.changeDecorations(i=>{this._decorationsIds=i.deltaDecorations(this._decorationsIds,t),this._colorDatas=new Map,this._decorationsIds.forEach((n,s)=>this._colorDatas.set(n,e[s]))})}updateColorDecorators(e){this._colorDecorationClassRefs.clear();const t=[],i=this._editor.getOption(21);for(let s=0;s<e.length&&t.length<i;s++){const{red:r,green:a,blue:l,alpha:d}=e[s].colorInfo.color,c=new rt(Math.round(r*255),Math.round(a*255),Math.round(l*255),d),h=`rgba(${c.r}, ${c.g}, ${c.b}, ${c.a})`,u=this._colorDecorationClassRefs.add(this._ruleFactory.createClassNameRef({backgroundColor:h}));t.push({range:{startLineNumber:e[s].colorInfo.range.startLineNumber,startColumn:e[s].colorInfo.range.startColumn,endLineNumber:e[s].colorInfo.range.endLineNumber,endColumn:e[s].colorInfo.range.endColumn},options:{description:"colorDetector",before:{content:w9,inlineClassName:`${u.className} colorpicker-color-decoration`,inlineClassNameAffectsLetterSpacing:!0,attachedData:DW}}})}const n=i<e.length?i:!1;this._decoratorLimitReporter.update(e.length,n),this._colorDecoratorIds.set(t)}removeAllDecorations(){this._editor.removeDecorations(this._decorationsIds),this._decorationsIds=[],this._colorDecoratorIds.clear(),this._colorDecorationClassRefs.clear()}getColorData(e){const t=this._editor.getModel();if(!t)return null;const i=t.getDecorationsInRange(L.fromPositions(e,e)).filter(n=>this._colorDatas.has(n.id));return i.length===0?null:this._colorDatas.get(i[0].id)}isColorDecoration(e){return this._colorDecoratorIds.has(e)}};Oc.ID="editor.contrib.colorDetector";Oc.RECOMPUTE_TIME=1e3;Oc=yN=oue([pD(1,st),pD(2,pe),pD(3,Ho)],Oc);class rue{constructor(){this._onDidChange=new A,this._computed=0,this._limited=!1}update(e,t){(e!==this._computed||t!==this._limited)&&(this._computed=e,this._limited=t,this._onDidChange.fire())}}ft(Oc.ID,Oc,1);class aue{get color(){return this._color}set color(e){this._color.equals(e)||(this._color=e,this._onDidChangeColor.fire(e))}get presentation(){return this.colorPresentations[this.presentationIndex]}get colorPresentations(){return this._colorPresentations}set colorPresentations(e){this._colorPresentations=e,this.presentationIndex>e.length-1&&(this.presentationIndex=0),this._onDidChangePresentation.fire(this.presentation)}constructor(e,t,i){this.presentationIndex=i,this._onColorFlushed=new A,this.onColorFlushed=this._onColorFlushed.event,this._onDidChangeColor=new A,this.onDidChangeColor=this._onDidChangeColor.event,this._onDidChangePresentation=new A,this.onDidChangePresentation=this._onDidChangePresentation.event,this.originalColor=e,this._color=e,this._colorPresentations=t}selectNextColorPresentation(){this.presentationIndex=(this.presentationIndex+1)%this.colorPresentations.length,this.flushColor(),this._onDidChangePresentation.fire(this.presentation)}guessColorPresentation(e,t){let i=-1;for(let n=0;n<this.colorPresentations.length;n++)if(t.toLowerCase()===this.colorPresentations[n].label){i=n;break}if(i===-1){const n=t.split("(")[0].toLowerCase();for(let s=0;s<this.colorPresentations.length;s++)if(this.colorPresentations[s].label.toLowerCase().startsWith(n)){i=s;break}}i!==-1&&i!==this.presentationIndex&&(this.presentationIndex=i,this._onDidChangePresentation.fire(this.presentation))}flushColor(){this._onColorFlushed.fire(this._color)}}const eo=te;class lue extends H{constructor(e,t,i,n=!1){super(),this.model=t,this.showingStandaloneColorPicker=n,this._closeButton=null,this._domNode=eo(".colorpicker-header"),Y(e,this._domNode),this._pickedColorNode=Y(this._domNode,eo(".picked-color")),Y(this._pickedColorNode,eo("span.codicon.codicon-color-mode")),this._pickedColorPresentation=Y(this._pickedColorNode,document.createElement("span")),this._pickedColorPresentation.classList.add("picked-color-presentation");const s=g("clickToToggleColorOptions","Click to toggle color options (rgb/hsl/hex)");this._pickedColorNode.setAttribute("title",s),this._originalColorNode=Y(this._domNode,eo(".original-color")),this._originalColorNode.style.backgroundColor=V.Format.CSS.format(this.model.originalColor)||"",this.backgroundColor=i.getColorTheme().getColor($1)||V.white,this._register(i.onDidColorThemeChange(r=>{this.backgroundColor=r.getColor($1)||V.white})),this._register($(this._pickedColorNode,ae.CLICK,()=>this.model.selectNextColorPresentation())),this._register($(this._originalColorNode,ae.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=V.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 due(this._domNode)))}get closeButton(){return this._closeButton}get pickedColorNode(){return this._pickedColorNode}get originalColorNode(){return this._originalColorNode}onDidChangeColor(e){this._pickedColorNode.style.backgroundColor=V.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 due extends H{constructor(e){super(),this._onClicked=this._register(new A),this.onClicked=this._onClicked.event,this._button=document.createElement("div"),this._button.classList.add("close-button"),Y(e,this._button);const t=document.createElement("div");t.classList.add("close-button-inner-div"),Y(this._button,t),Y(t,eo(".button"+Ie.asCSSSelector(_i("color-picker-close",oe.close,g("closeIcon","Icon to close the color picker"))))).classList.add("close-icon"),this._button.onclick=()=>{this._onClicked.fire()}}}class cue extends H{constructor(e,t,i,n=!1){super(),this.model=t,this.pixelRatio=i,this._insertButton=null,this._domNode=eo(".colorpicker-body"),Y(e,this._domNode),this._saturationBox=new hue(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 uue(this._domNode,this.model,n),this._register(this._opacityStrip),this._register(this._opacityStrip.onDidChange(this.onDidOpacityChange,this)),this._register(this._opacityStrip.onColorFlushed(this.flushColor,this)),this._hueStrip=new fue(this._domNode,this.model,n),this._register(this._hueStrip),this._register(this._hueStrip.onDidChange(this.onDidHueChange,this)),this._register(this._hueStrip.onColorFlushed(this.flushColor,this)),n&&(this._insertButton=this._register(new gue(this._domNode)),this._domNode.classList.add("standalone-colorpicker"))}flushColor(){this.model.flushColor()}onDidSaturationValueChange({s:e,v:t}){const i=this.model.color.hsva;this.model.color=new V(new Pa(i.h,e,t,i.a))}onDidOpacityChange(e){const t=this.model.color.hsva;this.model.color=new V(new Pa(t.h,t.s,t.v,e))}onDidHueChange(e){const t=this.model.color.hsva,i=(1-e)*360;this.model.color=new V(new Pa(i===360?0:i,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 hue extends H{constructor(e,t,i){super(),this.model=t,this.pixelRatio=i,this._onDidChange=new A,this.onDidChange=this._onDidChange.event,this._onColorFlushed=new A,this.onColorFlushed=this._onColorFlushed.event,this._domNode=eo(".saturation-wrap"),Y(e,this._domNode),this._canvas=document.createElement("canvas"),this._canvas.className="saturation-box",Y(this._domNode,this._canvas),this.selection=eo(".saturation-selection"),Y(this._domNode,this.selection),this.layout(),this._register($(this._domNode,ae.POINTER_DOWN,n=>this.onPointerDown(n))),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 Wp);const t=Ai(this._domNode);e.target!==this.selection&&this.onDidChangePosition(e.offsetX,e.offsetY),this.monitor.startMonitoring(e.target,e.pointerId,e.buttons,n=>this.onDidChangePosition(n.pageX-t.left,n.pageY-t.top),()=>null);const i=$(e.target.ownerDocument,ae.POINTER_UP,()=>{this._onColorFlushed.fire(),i.dispose(),this.monitor&&(this.monitor.stopMonitoring(!0),this.monitor=null)},!0)}onDidChangePosition(e,t){const i=Math.max(0,Math.min(1,e/this.width)),n=Math.max(0,Math.min(1,1-t/this.height));this.paintSelection(i,n),this._onDidChange.fire({s:i,v:n})}layout(){this.width=this._domNode.offsetWidth,this.height=this._domNode.offsetHeight,this._canvas.width=this.width*this.pixelRatio,this._canvas.height=this.height*this.pixelRatio,this.paint();const e=this.model.color.hsva;this.paintSelection(e.s,e.v)}paint(){const e=this.model.color.hsva,t=new V(new Pa(e.h,1,1,1)),i=this._canvas.getContext("2d"),n=i.createLinearGradient(0,0,this._canvas.width,0);n.addColorStop(0,"rgba(255, 255, 255, 1)"),n.addColorStop(.5,"rgba(255, 255, 255, 0.5)"),n.addColorStop(1,"rgba(255, 255, 255, 0)");const s=i.createLinearGradient(0,0,0,this._canvas.height);s.addColorStop(0,"rgba(0, 0, 0, 0)"),s.addColorStop(1,"rgba(0, 0, 0, 1)"),i.rect(0,0,this._canvas.width,this._canvas.height),i.fillStyle=V.Format.CSS.format(t),i.fill(),i.fillStyle=n,i.fill(),i.fillStyle=s,i.fill()}paintSelection(e,t){this.selection.style.left=`${e*this.width}px`,this.selection.style.top=`${this.height-t*this.height}px`}onDidChangeColor(e){if(this.monitor&&this.monitor.isMonitoring())return;this.paint();const t=e.hsva;this.paintSelection(t.s,t.v)}}class kW extends H{constructor(e,t,i=!1){super(),this.model=t,this._onDidChange=new A,this.onDidChange=this._onDidChange.event,this._onColorFlushed=new A,this.onColorFlushed=this._onColorFlushed.event,i?(this.domNode=Y(e,eo(".standalone-strip")),this.overlay=Y(this.domNode,eo(".standalone-overlay"))):(this.domNode=Y(e,eo(".strip")),this.overlay=Y(this.domNode,eo(".overlay"))),this.slider=Y(this.domNode,eo(".slider")),this.slider.style.top="0px",this._register($(this.domNode,ae.POINTER_DOWN,n=>this.onPointerDown(n))),this._register(t.onDidChangeColor(this.onDidChangeColor,this)),this.layout()}layout(){this.height=this.domNode.offsetHeight-this.slider.offsetHeight;const e=this.getValue(this.model.color);this.updateSliderPosition(e)}onDidChangeColor(e){const t=this.getValue(e);this.updateSliderPosition(t)}onPointerDown(e){if(!e.target||!(e.target instanceof Element))return;const t=this._register(new Wp),i=Ai(this.domNode);this.domNode.classList.add("grabbing"),e.target!==this.slider&&this.onDidChangeTop(e.offsetY),t.startMonitoring(e.target,e.pointerId,e.buttons,s=>this.onDidChangeTop(s.pageY-i.top),()=>null);const n=$(e.target.ownerDocument,ae.POINTER_UP,()=>{this._onColorFlushed.fire(),n.dispose(),t.stopMonitoring(!0),this.domNode.classList.remove("grabbing")},!0)}onDidChangeTop(e){const t=Math.max(0,Math.min(1,1-e/this.height));this.updateSliderPosition(t),this._onDidChange.fire(t)}updateSliderPosition(e){this.slider.style.top=`${(1-e)*this.height}px`}}class uue extends kW{constructor(e,t,i=!1){super(e,t,i),this.domNode.classList.add("opacity-strip"),this.onDidChangeColor(this.model.color)}onDidChangeColor(e){super.onDidChangeColor(e);const{r:t,g:i,b:n}=e.rgba,s=new V(new rt(t,i,n,1)),r=new V(new rt(t,i,n,0));this.overlay.style.background=`linear-gradient(to bottom, ${s} 0%, ${r} 100%)`}getValue(e){return e.hsva.a}}class fue extends kW{constructor(e,t,i=!1){super(e,t,i),this.domNode.classList.add("hue-strip")}getValue(e){return 1-e.hsva.h/360}}class gue extends H{constructor(e){super(),this._onClicked=this._register(new A),this.onClicked=this._onClicked.event,this._button=Y(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 pue extends fr{constructor(e,t,i,n,s=!1){super(),this.model=t,this.pixelRatio=i,this._register(q_.onDidChange(()=>this.layout()));const r=eo(".colorpicker-widget");e.appendChild(r),this.header=this._register(new lue(r,this.model,n,s)),this.body=this._register(new cue(r,this.model,this.pixelRatio,s))}layout(){this.body.layout()}}var IW=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},EW=function(o,e){return function(t,i){e(t,i,o)}},bp=function(o,e,t,i){function n(s){return s instanceof t?s:new t(function(r){r(s)})}return new(t||(t=Promise))(function(s,r){function a(c){try{d(i.next(c))}catch(h){r(h)}}function l(c){try{d(i.throw(c))}catch(h){r(h)}}function d(c){c.done?s(c.value):n(c.value).then(a,l)}d((i=i.apply(o,e||[])).next())})};class mue{constructor(e,t,i,n){this.owner=e,this.range=t,this.model=i,this.provider=n,this.forceShowAtRange=!0}isValidForHoverAnchor(e){return e.type===1&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}let Gw=class{constructor(e,t){this._editor=e,this._themeService=t,this.hoverOrdinal=2}computeSync(e,t){return[]}computeAsync(e,t,i){return ki.fromPromise(this._computeAsync(e,t,i))}_computeAsync(e,t,i){return bp(this,void 0,void 0,function*(){if(!this._editor.hasModel())return[];const n=Oc.get(this._editor);if(!n)return[];for(const s of t){if(!n.isColorDecoration(s))continue;const r=n.getColorData(s.range.getStartPosition());if(r)return[yield NW(this,this._editor.getModel(),r.colorInfo,r.provider)]}return[]})}renderHoverParts(e,t){return TW(this,this._editor,this._themeService,t,e)}};Gw=IW([EW(1,Ki)],Gw);class _ue{constructor(e,t,i,n){this.owner=e,this.range=t,this.model=i,this.provider=n}}let jv=class{constructor(e,t){this._editor=e,this._themeService=t,this._color=null}createColorHover(e,t,i){return bp(this,void 0,void 0,function*(){if(!this._editor.hasModel()||!Oc.get(this._editor))return null;const s=yield yW(i,this._editor.getModel(),Qe.None);let r=null,a=null;for(const h of s){const u=h.colorInfo;L.containsRange(u.range,e.range)&&(r=u,a=h.provider)}const l=r??e,d=a??t,c=!!r;return{colorHover:yield NW(this,this._editor.getModel(),l,d),foundInEditor:c}})}updateEditorModel(e){return bp(this,void 0,void 0,function*(){if(!this._editor.hasModel())return;const t=e.model;let i=new L(e.range.startLineNumber,e.range.startColumn,e.range.endLineNumber,e.range.endColumn);this._color&&(yield l1(this._editor.getModel(),t,this._color,i,e),i=RW(this._editor,i,t))})}renderHoverParts(e,t){return TW(this,this._editor,this._themeService,t,e)}set color(e){this._color=e}get color(){return this._color}};jv=IW([EW(1,Ki)],jv);function NW(o,e,t,i){return bp(this,void 0,void 0,function*(){const n=e.getValueInRange(t.range),{red:s,green:r,blue:a,alpha:l}=t.color,d=new rt(Math.round(s*255),Math.round(r*255),Math.round(a*255),l),c=new V(d),h=yield LW(e,t,i,Qe.None),u=new aue(c,[],0);return u.colorPresentations=h||[],u.guessColorPresentation(c,n),o instanceof Gw?new mue(o,L.lift(t.range),u,i):new _ue(o,L.lift(t.range),u,i)})}function TW(o,e,t,i,n){if(i.length===0||!e.hasModel())return H.None;if(n.setMinimumDimensions){const u=e.getOption(66)+8;n.setMinimumDimensions(new gt(302,u))}const s=new X,r=i[0],a=e.getModel(),l=r.model,d=s.add(new pue(n.fragment,l,e.getOption(141),t,o instanceof jv));n.setColorPicker(d);let c=!1,h=new L(r.range.startLineNumber,r.range.startColumn,r.range.endLineNumber,r.range.endColumn);if(o instanceof jv){const u=i[0].model.color;o.color=u,l1(a,l,u,h,r),s.add(l.onColorFlushed(f=>{o.color=f}))}else s.add(l.onColorFlushed(u=>bp(this,void 0,void 0,function*(){yield l1(a,l,u,h,r),c=!0,h=RW(e,h,l,n)})));return s.add(l.onDidChangeColor(u=>{l1(a,l,u,h,r)})),s.add(e.onDidChangeModelContent(u=>{c?c=!1:(n.hide(),e.focus())})),s}function RW(o,e,t,i){let n,s;if(t.presentation.textEdit){n=[t.presentation.textEdit],s=new L(t.presentation.textEdit.range.startLineNumber,t.presentation.textEdit.range.startColumn,t.presentation.textEdit.range.endLineNumber,t.presentation.textEdit.range.endColumn);const r=o.getModel()._setTrackedRange(null,s,3);o.pushUndoStop(),o.executeEdits("colorpicker",n),s=o.getModel()._getTrackedRange(r)||s}else n=[{range:e,text:t.presentation.label,forceMoveMarkers:!1}],s=e.setEndPosition(e.endLineNumber,e.startColumn+t.presentation.label.length),o.pushUndoStop(),o.executeEdits("colorpicker",n);return t.presentation.additionalTextEdits&&(n=[...t.presentation.additionalTextEdits],o.executeEdits("colorpicker",n),i&&i.hide()),o.pushUndoStop(),s}function l1(o,e,t,i,n){return bp(this,void 0,void 0,function*(){const s=yield LW(o,{range:i,color:{red:t.rgba.r/255,green:t.rgba.g/255,blue:t.rgba.b/255,alpha:t.rgba.a}},n.provider,Qe.None);e.colorPresentations=s||[]})}function LN(o,e){return!!o[e]}class mD{constructor(e,t){this.target=e.target,this.isLeftClick=e.event.leftButton,this.isMiddleClick=e.event.middleButton,this.isRightClick=e.event.rightButton,this.hasTriggerModifier=LN(e.event,t.triggerModifier),this.hasSideBySideModifier=LN(e.event,t.triggerSideBySideModifier),this.isNoneOrSingleMouseDown=e.event.detail<=1}}class r5{constructor(e,t){this.keyCodeIsTriggerKey=e.keyCode===t.triggerKey,this.keyCodeIsSideBySideKey=e.keyCode===t.triggerSideBySideKey,this.hasTriggerModifier=LN(e,t.triggerModifier)}}class sC{constructor(e,t,i,n){this.triggerKey=e,this.triggerModifier=t,this.triggerSideBySideKey=i,this.triggerSideBySideModifier=n}equals(e){return this.triggerKey===e.triggerKey&&this.triggerModifier===e.triggerModifier&&this.triggerSideBySideKey===e.triggerSideBySideKey&&this.triggerSideBySideModifier===e.triggerSideBySideModifier}}function a5(o){return o==="altKey"?at?new sC(57,"metaKey",6,"altKey"):new sC(5,"ctrlKey",6,"altKey"):at?new sC(6,"altKey",57,"metaKey"):new sC(6,"altKey",5,"ctrlKey")}class jy extends H{constructor(e,t){var i;super(),this._onMouseMoveOrRelevantKeyDown=this._register(new A),this.onMouseMoveOrRelevantKeyDown=this._onMouseMoveOrRelevantKeyDown.event,this._onExecute=this._register(new A),this.onExecute=this._onExecute.event,this._onCancel=this._register(new A),this.onCancel=this._onCancel.event,this._editor=e,this._extractLineNumberFromMouseEvent=(i=t?.extractLineNumberFromMouseEvent)!==null&&i!==void 0?i:n=>n.target.position?n.target.position.lineNumber:0,this._opts=a5(this._editor.getOption(77)),this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._lineNumberOnMouseDown=0,this._register(this._editor.onDidChangeConfiguration(n=>{if(n.hasChanged(77)){const s=a5(this._editor.getOption(77));if(this._opts.equals(s))return;this._opts=s,this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._lineNumberOnMouseDown=0,this._onCancel.fire()}})),this._register(this._editor.onMouseMove(n=>this._onEditorMouseMove(new mD(n,this._opts)))),this._register(this._editor.onMouseDown(n=>this._onEditorMouseDown(new mD(n,this._opts)))),this._register(this._editor.onMouseUp(n=>this._onEditorMouseUp(new mD(n,this._opts)))),this._register(this._editor.onKeyDown(n=>this._onEditorKeyDown(new r5(n,this._opts)))),this._register(this._editor.onKeyUp(n=>this._onEditorKeyUp(new r5(n,this._opts)))),this._register(this._editor.onMouseDrag(()=>this._resetHandler())),this._register(this._editor.onDidChangeCursorSelection(n=>this._onDidChangeCursorSelection(n))),this._register(this._editor.onDidChangeModel(n=>this._resetHandler())),this._register(this._editor.onDidChangeModelContent(()=>this._resetHandler())),this._register(this._editor.onDidScrollChange(n=>{(n.scrollTopChanged||n.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 vue=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},bl=function(o,e){return function(t,i){e(t,i,o)}};let Fc=class extends ap{constructor(e,t,i,n,s,r,a,l,d,c,h,u,f){super(e,Object.assign(Object.assign({},n.getRawOptions()),{overflowWidgetsDomNode:n.getOverflowWidgetsDomNode()}),i,s,r,a,l,d,c,h,u,f),this._parentEditor=n,this._overwriteOptions=t,super.updateOptions(this._overwriteOptions),this._register(n.onDidChangeConfiguration(p=>this._onParentConfigurationChanged(p)))}getParentEditor(){return this._parentEditor}_onParentConfigurationChanged(e){super.updateOptions(this._parentEditor.getRawOptions()),super.updateOptions(this._overwriteOptions)}updateOptions(e){wS(this._overwriteOptions,e,!0),super.updateOptions(this._overwriteOptions)}};Fc=vue([bl(4,Re),bl(5,_t),bl(6,li),bl(7,Ae),bl(8,Ki),bl(9,Li),bl(10,hd),bl(11,At),bl(12,pe)],Fc);const l5=new V(new rt(0,122,204)),bue={showArrow:!0,showFrame:!0,className:"",frameColor:l5,arrowColor:l5,keepEditorSelection:!1},Cue="vs.editor.contrib.zoneWidget";class wue{constructor(e,t,i,n,s,r,a,l){this.id="",this.domNode=e,this.afterLineNumber=t,this.afterColumn=i,this.heightInLines=n,this.showInHiddenAreas=a,this.ordinal=l,this._onDomNodeTop=s,this._onComputedHeight=r}onDomNodeTop(e){this._onDomNodeTop(e)}onComputedHeight(e){this._onComputedHeight(e)}}class Sue{constructor(e,t){this._id=e,this._domNode=t}getId(){return this._id}getDomNode(){return this._domNode}getPosition(){return null}}class Ky{constructor(e){this._editor=e,this._ruleName=Ky._IdGenerator.nextId(),this._decorations=this._editor.createDecorationsCollection(),this._color=null,this._height=-1}dispose(){this.hide(),eP(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(){eP(this._ruleName),Yk(`.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:L.fromPositions(e),options:{description:"zone-widget-arrow",className:this._ruleName,stickiness:1}}])}hide(){this._decorations.clear()}}Ky._IdGenerator=new FR(".arrow-decoration-");class yue{constructor(e,t={}){this._arrow=null,this._overlayWidget=null,this._resizeSash=null,this._viewZone=null,this._disposables=new X,this.container=null,this._isShowing=!1,this.editor=e,this._positionMarkerId=this.editor.createDecorationsCollection(),this.options=Il(t),wS(this.options,bue,!1),this.domNode=document.createElement("div"),this.options.isAccessible||(this.domNode.setAttribute("aria-hidden","true"),this.domNode.setAttribute("role","presentation")),this._disposables.add(this.editor.onDidLayoutChange(i=>{const n=this._getWidth(i);this.domNode.style.width=n+"px",this.domNode.style.left=this._getLeft(i)+"px",this._onWidth(n)}))}dispose(){this._overlayWidget&&(this.editor.removeOverlayWidget(this._overlayWidget),this._overlayWidget=null),this._viewZone&&this.editor.changeViewZones(e=>{this._viewZone&&e.removeZone(this._viewZone.id),this._viewZone=null}),this._positionMarkerId.clear(),this._disposables.dispose()}create(){this.domNode.classList.add("zone-widget"),this.options.className&&this.domNode.classList.add(this.options.className),this.container=document.createElement("div"),this.container.classList.add("zone-widget-container"),this.domNode.appendChild(this.container),this.options.showArrow&&(this._arrow=new Ky(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 i=e-this._decoratingElementsHeight();this.container.style.height=`${i}px`;const n=this.editor.getLayoutInfo();this._doLayout(i,this._getWidth(n))}(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 i=L.isIRange(e)?L.lift(e):L.fromPositions(e);this._isShowing=!0,this._showImpl(i,t),this._isShowing=!1,this._positionMarkerId.set([{range:i,options:Ve.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 i=Math.round(e/3);t+=2*i}if(this.options.showFrame){const i=Math.round(e/9);t+=2*i}return t}_showImpl(e,t){const i=e.getStartPosition(),n=this.editor.getLayoutInfo(),s=this._getWidth(n);this.domNode.style.width=`${s}px`,this.domNode.style.left=this._getLeft(n)+"px";const r=document.createElement("div");r.style.overflow="hidden";const a=this.editor.getOption(66);if(!this.options.allowUnlimitedHeight){const u=Math.max(12,this.editor.getLayoutInfo().height/a*.8);t=Math.min(t,u)}let l=0,d=0;if(this._arrow&&this.options.showArrow&&(l=Math.round(a/3),this._arrow.height=l,this._arrow.show(i)),this.options.showFrame&&(d=Math.round(a/9)),this.editor.changeViewZones(u=>{this._viewZone&&u.removeZone(this._viewZone.id),this._overlayWidget&&(this.editor.removeOverlayWidget(this._overlayWidget),this._overlayWidget=null),this.domNode.style.top="-1000px",this._viewZone=new wue(r,i.lineNumber,i.column,t,f=>this._onViewZoneTop(f),f=>this._onViewZoneHeight(f),this.options.showInHiddenAreas,this.options.ordinal),this._viewZone.id=u.addZone(this._viewZone),this._overlayWidget=new Sue(Cue+this._viewZone.id,this.domNode),this.editor.addOverlayWidget(this._overlayWidget)}),this.container&&this.options.showFrame){const u=this.options.frameWidth?this.options.frameWidth:d;this.container.style.borderTopWidth=u+"px",this.container.style.borderBottomWidth=u+"px"}const c=t*a-this._decoratingElementsHeight();this.container&&(this.container.style.top=l+"px",this.container.style.height=c+"px",this.container.style.overflow="hidden"),this._doLayout(c,s),this.options.keepEditorSelection||this.editor.setSelection(e);const h=this.editor.getModel();if(h){const u=h.validateRange(new L(e.startLineNumber,1,e.endLineNumber+1,1));this.revealRange(u,u.startLineNumber===h.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 Tn(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 i=(t.currentY-e.startY)/this.editor.getOption(66),n=i<0?Math.ceil(i):Math.floor(i),s=e.heightInLines+n;s>5&&s<35&&this._relayout(s)}}))}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 MW=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},AW=function(o,e){return function(t,i){e(t,i,o)}};const PW=et("IPeekViewService");dt(PW,class{constructor(){this._widgets=new Map}addExclusiveWidget(o,e){const t=this._widgets.get(o);t&&(t.listener.dispose(),t.widget.dispose());const i=()=>{const n=this._widgets.get(o);n&&n.widget===e&&(n.listener.dispose(),this._widgets.delete(o))};this._widgets.set(o,{widget:e,listener:e.onDidClose(i)})}},1);var Ss;(function(o){o.inPeekEditor=new ce("inReferenceSearchEditor",!0,g("inReferenceSearchEditor","Whether the current code editor is embedded inside peek")),o.notInPeekEditor=o.inPeekEditor.toNegated()})(Ss||(Ss={}));let Kv=class{constructor(e,t){e instanceof Fc&&Ss.inPeekEditor.bindTo(t)}dispose(){}};Kv.ID="editor.contrib.referenceController";Kv=MW([AW(1,Ae)],Kv);ft(Kv.ID,Kv,0);function Lue(o){const e=o.get(_t).getFocusedCodeEditor();return e instanceof Fc?e.getParentEditor():e}const xue={headerBackgroundColor:V.white,primaryHeadingColor:V.fromHex("#333333"),secondaryHeadingColor:V.fromHex("#6c6c6cb3")};let Zw=class extends yue{constructor(e,t,i){super(e,t),this.instantiationService=i,this._onDidClose=new A,this.onDidClose=this._onDidClose.event,wS(this.options,xue,!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=te(".head"),this._bodyElement=te(".body"),this._fillHead(this._headElement),this._fillBody(this._bodyElement),e.appendChild(this._headElement),e.appendChild(this._bodyElement)}_fillHead(e,t){this._titleElement=te(".peekview-title"),this.options.supportOnTitleClick&&(this._titleElement.classList.add("clickable"),wi(this._titleElement,"click",s=>this._onTitleClick(s))),Y(this._headElement,this._titleElement),this._fillTitleIcon(this._titleElement),this._primaryHeading=te("span.filename"),this._secondaryHeading=te("span.dirname"),this._metaHeading=te("span.meta"),Y(this._titleElement,this._primaryHeading,this._secondaryHeading,this._metaHeading);const i=te(".peekview-actions");Y(this._headElement,i);const n=this._getActionBarOptions();this._actionbarWidget=new Wo(i,n),this._disposables.add(this._actionbarWidget),t||this._actionbarWidget.push(new as("peekview.close",g("label.close","Close"),Ie.asClassName(oe.close),!0,()=>(this.dispose(),Promise.resolve())),{label:!1,icon:!0})}_fillTitleIcon(e){}_getActionBarOptions(){return{actionViewItemProvider:Lse.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:fn(this._secondaryHeading))}setMetaTitle(e){this._metaHeading&&(e?(this._metaHeading.innerText=e,Ts(this._metaHeading)):Jn(this._metaHeading))}_doLayout(e,t){if(!this._isShowing&&e<0){this.dispose();return}const i=Math.ceil(this.editor.getOption(66)*1.2),n=Math.round(e-(i+2));this._doLayoutHead(i,t),this._doLayoutBody(n,t)}_doLayoutHead(e,t){this._headElement&&(this._headElement.style.height=`${e}px`,this._headElement.style.lineHeight=this._headElement.style.height)}_doLayoutBody(e,t){this._bodyElement&&(this._bodyElement.style.height=`${e}px`)}};Zw=MW([AW(2,Re)],Zw);const Due=T("peekViewTitle.background",{dark:"#252526",light:"#F3F3F3",hcDark:V.black,hcLight:V.white},g("peekViewTitleBackground","Background color of the peek view title area.")),OW=T("peekViewTitleLabel.foreground",{dark:V.white,light:V.black,hcDark:V.white,hcLight:er},g("peekViewTitleForeground","Color of the peek view title.")),FW=T("peekViewTitleDescription.foreground",{dark:"#ccccccb3",light:"#616161",hcDark:"#FFFFFF99",hcLight:"#292929"},g("peekViewTitleInfoForeground","Color of the peek view title info.")),kue=T("peekView.border",{dark:bs,light:bs,hcDark:nt,hcLight:nt},g("peekViewBorder","Color of the peek view borders and arrow.")),Iue=T("peekViewResult.background",{dark:"#252526",light:"#F3F3F3",hcDark:V.black,hcLight:V.white},g("peekViewResultsBackground","Background color of the peek view result list."));T("peekViewResult.lineForeground",{dark:"#bbbbbb",light:"#646465",hcDark:V.white,hcLight:er},g("peekViewResultsMatchForeground","Foreground color for line nodes in the peek view result list."));T("peekViewResult.fileForeground",{dark:V.white,light:"#1E1E1E",hcDark:V.white,hcLight:er},g("peekViewResultsFileForeground","Foreground color for file nodes in the peek view result list."));T("peekViewResult.selectionBackground",{dark:"#3399ff33",light:"#3399ff33",hcDark:null,hcLight:null},g("peekViewResultsSelectionBackground","Background color of the selected entry in the peek view result list."));T("peekViewResult.selectionForeground",{dark:V.white,light:"#6C6C6C",hcDark:V.white,hcLight:er},g("peekViewResultsSelectionForeground","Foreground color of the selected entry in the peek view result list."));const Qd=T("peekViewEditor.background",{dark:"#001F33",light:"#F2F8FC",hcDark:V.black,hcLight:V.white},g("peekViewEditorBackground","Background color of the peek view editor."));T("peekViewEditorGutter.background",{dark:Qd,light:Qd,hcDark:Qd,hcLight:Qd},g("peekViewEditorGutterBackground","Background color of the gutter in the peek view editor."));T("peekViewEditorStickyScroll.background",{dark:Qd,light:Qd,hcDark:Qd,hcLight:Qd},g("peekViewEditorStickScrollBackground","Background color of sticky scroll in the peek view editor."));T("peekViewResult.matchHighlightBackground",{dark:"#ea5c004d",light:"#ea5c004d",hcDark:null,hcLight:null},g("peekViewResultsMatchHighlight","Match highlight color in the peek view result list."));T("peekViewEditor.matchHighlightBackground",{dark:"#ff8f0099",light:"#f5d802de",hcDark:null,hcLight:null},g("peekViewEditorMatchHighlight","Match highlight color in the peek view editor."));T("peekViewEditor.matchHighlightBorder",{dark:null,light:null,hcDark:Ut,hcLight:Ut},g("peekViewEditorMatchHighlightBorder","Match highlight border in the peek view editor."));var Eue=function(o,e,t,i){function n(s){return s instanceof t?s:new t(function(r){r(s)})}return new(t||(t=Promise))(function(s,r){function a(c){try{d(i.next(c))}catch(h){r(h)}}function l(c){try{d(i.throw(c))}catch(h){r(h)}}function d(c){c.done?s(c.value):n(c.value).then(a,l)}d((i=i.apply(o,e||[])).next())})};class Bc{constructor(e,t,i,n){this.isProviderFirst=e,this.parent=t,this.link=i,this._rangeCallback=n,this.id=aE.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?g({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,Bo(this.uri),this.range.startLineNumber,this.range.startColumn):g("aria.oneReference","in {0} on line {1} at column {2}",Bo(this.uri),this.range.startLineNumber,this.range.startColumn)}}class Nue{constructor(e){this._modelReference=e}dispose(){this._modelReference.dispose()}preview(e,t=8){const i=this._modelReference.object.textEditorModel;if(!i)return;const{startLineNumber:n,startColumn:s,endLineNumber:r,endColumn:a}=e,l=i.getWordUntilPosition({lineNumber:n,column:s-t}),d=new L(n,l.startColumn,n,s),c=new L(r,a,r,1073741824),h=i.getValueInRange(d).replace(/^\s+/,""),u=i.getValueInRange(e),f=i.getValueInRange(c).replace(/\s+$/,"");return{value:h+u+f,highlight:{start:h.length,end:h.length+u.length}}}}class qv{constructor(e,t){this.parent=e,this.uri=t,this.children=[],this._previews=new Pn}dispose(){St(this._previews.values()),this._previews.clear()}getPreview(e){return this._previews.get(e.uri)}get ariaMessage(){const e=this.children.length;return e===1?g("aria.fileReferences.1","1 symbol in {0}, full path {1}",Bo(this.uri),this.uri.fsPath):g("aria.fileReferences.N","{0} symbols in {1}, full path {2}",e,Bo(this.uri),this.uri.fsPath)}resolve(e){return Eue(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 i=yield e.createModelReference(t.uri);this._previews.set(t.uri,new Nue(i))}catch(i){He(i)}return this})}}class Bs{constructor(e,t){this.groups=[],this.references=[],this._onDidChangeReferenceRange=new A,this.onDidChangeReferenceRange=this._onDidChangeReferenceRange.event,this._links=e,this._title=t;const[i]=e;e.sort(Bs._compareReferences);let n;for(const s of e)if((!n||!$t.isEqual(n.uri,s.uri,!0))&&(n=new qv(this,s.uri),this.groups.push(n)),n.children.length===0||Bs._compareReferences(s,n.children[n.children.length-1])!==0){const r=new Bc(i===s,n,s,a=>this._onDidChangeReferenceRange.fire(a));this.references.push(r),n.children.push(r)}}dispose(){St(this.groups),this._onDidChangeReferenceRange.dispose(),this.groups.length=0}clone(){return new Bs(this._links,this._title)}get title(){return this._title}get isEmpty(){return this.groups.length===0}get ariaMessage(){return this.isEmpty?g("aria.result.0","No results found"):this.references.length===1?g("aria.result.1","Found 1 symbol in {0}",this.references[0].uri.fsPath):this.groups.length===1?g("aria.result.n1","Found {0} symbols in {1}",this.references.length,this.groups[0].uri.fsPath):g("aria.result.nm","Found {0} symbols in {1} files",this.references.length,this.groups.length)}nextOrPreviousReference(e,t){const{parent:i}=e;let n=i.children.indexOf(e);const s=i.children.length,r=i.parent.groups.length;return r===1||t&&n+1<s||!t&&n>0?(t?n=(n+1)%s:n=(n+s-1)%s,i.children[n]):(n=i.parent.groups.indexOf(i),t?(n=(n+1)%r,i.parent.groups[n].children[0]):(n=(n+r-1)%r,i.parent.groups[n].children[i.parent.groups[n].children.length-1]))}nearestReference(e,t){const i=this.references.map((n,s)=>({idx:s,prefixLen:hu(n.uri.toString(),e.toString()),offsetDist:Math.abs(n.range.startLineNumber-t.lineNumber)*100+Math.abs(n.range.startColumn-t.column)})).sort((n,s)=>n.prefixLen>s.prefixLen?-1:n.prefixLen<s.prefixLen?1:n.offsetDist<s.offsetDist?-1:n.offsetDist>s.offsetDist?1:0)[0];if(i)return this.references[i.idx]}referenceAt(e,t){for(const i of this.references)if(i.uri.toString()===e.toString()&&L.containsPosition(i.range,t))return i}firstReference(){for(const e of this.references)if(e.isProviderFirst)return e;return this.references[0]}static _compareReferences(e,t){return $t.compare(e.uri,t.uri)||L.compareRangesUsingStarts(e.range,t.range)}}var qy=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Gy=function(o,e){return function(t,i){e(t,i,o)}},xN;let DN=class{constructor(e){this._resolverService=e}hasChildren(e){return e instanceof Bs||e instanceof qv}getChildren(e){if(e instanceof Bs)return e.groups;if(e instanceof qv)return e.resolve(this._resolverService).then(t=>t.children);throw new Error("bad tree")}};DN=qy([Gy(0,Ls)],DN);class Tue{getHeight(){return 23}getTemplateId(e){return e instanceof qv?Gv.id:J0.id}}let kN=class{constructor(e){this._keybindingService=e}getKeyboardNavigationLabel(e){var t;if(e instanceof Bc){const i=(t=e.parent.getPreview(e))===null||t===void 0?void 0:t.preview(e.range);if(i)return i.value}return Bo(e.uri)}};kN=qy([Gy(0,Nt)],kN);class Rue{getId(e){return e instanceof Bc?e.id:e.uri}}let IN=class extends H{constructor(e,t){super(),this._labelService=t;const i=document.createElement("div");i.classList.add("reference-file"),this.file=this._register(new Mw(i,{supportHighlights:!0})),this.badge=new TE(Y(i,te(".count")),{},LB),e.appendChild(i)}set(e,t){const i=oy(e.uri);this.file.setLabel(this._labelService.getUriBasenameLabel(e.uri),this._labelService.getUriLabel(i,{relative:!0}),{title:this._labelService.getUriLabel(e.uri),matches:t});const n=e.children.length;this.badge.setCount(n),n>1?this.badge.setTitleFormat(g("referencesCount","{0} references",n)):this.badge.setTitleFormat(g("referenceCount","{0} reference",n))}};IN=qy([Gy(1,lp)],IN);let Gv=xN=class{constructor(e){this._instantiationService=e,this.templateId=xN.id}renderTemplate(e){return this._instantiationService.createInstance(IN,e)}renderElement(e,t,i){i.set(e.element,B0(e.filterData))}disposeTemplate(e){e.dispose()}};Gv.id="FileReferencesRenderer";Gv=xN=qy([Gy(0,Re)],Gv);class Mue{constructor(e){this.label=new hc(e)}set(e,t){var i;const n=(i=e.parent.getPreview(e))===null||i===void 0?void 0:i.preview(e.range);if(!n||!n.value)this.label.set(`${Bo(e.uri)}:${e.range.startLineNumber+1}:${e.range.startColumn+1}`);else{const{value:s,highlight:r}=n;t&&!Yr.isDefault(t)?(this.label.element.classList.toggle("referenceMatch",!1),this.label.set(s,B0(t))):(this.label.element.classList.toggle("referenceMatch",!0),this.label.set(s,[r]))}}}class J0{constructor(){this.templateId=J0.id}renderTemplate(e){return new Mue(e)}renderElement(e,t,i){i.set(e.element,e.filterData)}disposeTemplate(){}}J0.id="OneReferenceRenderer";class Aue{getWidgetAriaLabel(){return g("treeAriaLabel","References")}getAriaLabel(e){return e.ariaMessage}}var Pue=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Cl=function(o,e){return function(t,i){e(t,i,o)}},d5=function(o,e,t,i){function n(s){return s instanceof t?s:new t(function(r){r(s)})}return new(t||(t=Promise))(function(s,r){function a(c){try{d(i.next(c))}catch(h){r(h)}}function l(c){try{d(i.throw(c))}catch(h){r(h)}}function d(c){c.done?s(c.value):n(c.value).then(a,l)}d((i=i.apply(o,e||[])).next())})};class Zy{constructor(e,t){this._editor=e,this._model=t,this._decorations=new Map,this._decorationIgnoreSet=new Set,this._callOnDispose=new X,this._callOnModelChange=new X,this._callOnDispose.add(this._editor.onDidChangeModel(()=>this._onModelChanged())),this._onModelChanged()}dispose(){this._callOnModelChange.dispose(),this._callOnDispose.dispose(),this.removeDecorations()}_onModelChanged(){this._callOnModelChange.clear();const e=this._editor.getModel();if(e){for(const t of this._model.references)if(t.uri.toString()===e.uri.toString()){this._addDecorations(t.parent);return}}}_addDecorations(e){if(!this._editor.hasModel())return;this._callOnModelChange.add(this._editor.getModel().onDidChangeDecorations(()=>this._onDecorationChanged()));const t=[],i=[];for(let n=0,s=e.children.length;n<s;n++){const r=e.children[n];this._decorationIgnoreSet.has(r.id)||r.uri.toString()===this._editor.getModel().uri.toString()&&(t.push({range:r.range,options:Zy.DecorationOptions}),i.push(n))}this._editor.changeDecorations(n=>{const s=n.deltaDecorations([],t);for(let r=0;r<s.length;r++)this._decorations.set(s[r],e.children[i[r]])})}_onDecorationChanged(){const e=[],t=this._editor.getModel();if(t){for(const[i,n]of this._decorations){const s=t.getDecorationRange(i);if(!s)continue;let r=!1;if(!L.equalsRange(s,n.range)){if(L.spansMultipleLines(s))r=!0;else{const a=n.range.endColumn-n.range.startColumn,l=s.endColumn-s.startColumn;a!==l&&(r=!0)}r?(this._decorationIgnoreSet.add(n.id),e.push(i)):n.range=s}}for(let i=0,n=e.length;i<n;i++)this._decorations.delete(e[i]);this._editor.removeDecorations(e)}}removeDecorations(){this._editor.removeDecorations([...this._decorations.keys()]),this._decorations.clear()}}Zy.DecorationOptions=Ve.register({description:"reference-decoration",stickiness:1,className:"reference-decoration"});class Oue{constructor(){this.ratio=.7,this.heightInLines=18}static fromJSON(e){let t,i;try{const n=JSON.parse(e);t=n.ratio,i=n.heightInLines}catch{}return{ratio:t||.7,heightInLines:i||18}}}class Fue extends kE{}let EN=class extends Zw{constructor(e,t,i,n,s,r,a,l,d,c,h,u){super(e,{showFrame:!1,showArrow:!0,isResizeable:!0,isAccessible:!0,supportOnTitleClick:!0},r),this._defaultTreeKeyboardSupport=t,this.layoutData=i,this._textModelResolverService=s,this._instantiationService=r,this._peekViewService=a,this._uriLabel=l,this._undoRedoService=d,this._keybindingService=c,this._languageService=h,this._languageConfigurationService=u,this._disposeOnNewModel=new X,this._callOnDispose=new X,this._onDidSelectReference=new A,this.onDidSelectReference=this._onDidSelectReference.event,this._dim=new gt(0,0),this._applyTheme(n.getColorTheme()),this._callOnDispose.add(n.onDidColorThemeChange(this._applyTheme.bind(this))),this._peekViewService.addExclusiveWidget(e,this),this.create()}dispose(){this.setModel(void 0),this._callOnDispose.dispose(),this._disposeOnNewModel.dispose(),St(this._preview),St(this._previewNotAvailableMessage),St(this._tree),St(this._previewModelReference),this._splitView.dispose(),super.dispose()}_applyTheme(e){const t=e.getColor(kue)||V.transparent;this.style({arrowColor:t,frameColor:t,headerBackgroundColor:e.getColor(Due)||V.transparent,primaryHeadingColor:e.getColor(OW),secondaryHeadingColor:e.getColor(FW)})}show(e){super.show(e,this.layoutData.heightInLines||18)}focusOnReferenceTree(){this._tree.domFocus()}focusOnPreviewEditor(){this._preview.focus()}isPreviewEditorFocused(){return this._preview.hasTextFocus()}_onTitleClick(e){this._preview&&this._preview.getModel()&&this._onDidSelectReference.fire({element:this._getFocusedReference(),kind:e.ctrlKey||e.metaKey||e.altKey?"side":"open",source:"title"})}_fillBody(e){this.setCssClass("reference-zone-widget"),this._messageContainer=Y(e,te("div.messages")),Jn(this._messageContainer),this._splitView=new NB(e,{orientation:1}),this._previewContainer=Y(e,te("div.preview.inline"));const t={scrollBeyondLastLine:!1,scrollbar:{verticalScrollbarSize:14,horizontal:"auto",useShadows:!0,verticalHasArrows:!1,horizontalHasArrows:!1,alwaysConsumeMouseWheel:!0},overviewRulerLanes:2,fixedOverflowWidgets:!0,minimap:{enabled:!1}};this._preview=this._instantiationService.createInstance(Fc,this._previewContainer,t,{},this.editor),Jn(this._previewContainer),this._previewNotAvailableMessage=new il(g("missingPreviewMessage","no preview available"),ro,il.DEFAULT_CREATION_OPTIONS,null,this._undoRedoService,this._languageService,this._languageConfigurationService),this._treeContainer=Y(e,te("div.ref-tree.inline"));const i={keyboardSupport:this._defaultTreeKeyboardSupport,accessibilityProvider:new Aue,keyboardNavigationLabelProvider:this._instantiationService.createInstance(kN),identityProvider:new Rue,openOnSingleClick:!0,selectionNavigation:!0,overrideStyles:{listBackground:Iue}};this._defaultTreeKeyboardSupport&&this._callOnDispose.add(wi(this._treeContainer,"keydown",s=>{s.equals(9)&&(this._keybindingService.dispatchEvent(s,s.target),s.stopPropagation())},!0)),this._tree=this._instantiationService.createInstance(Fue,"ReferencesWidget",this._treeContainer,new Tue,[this._instantiationService.createInstance(Gv),this._instantiationService.createInstance(J0)],this._instantiationService.createInstance(DN),i),this._splitView.addView({onDidChange:de.None,element:this._previewContainer,minimumSize:200,maximumSize:Number.MAX_VALUE,layout:s=>{this._preview.layout({height:this._dim.height,width:s})}},Ew.Distribute),this._splitView.addView({onDidChange:de.None,element:this._treeContainer,minimumSize:100,maximumSize:Number.MAX_VALUE,layout:s=>{this._treeContainer.style.height=`${this._dim.height}px`,this._treeContainer.style.width=`${s}px`,this._tree.layout(this._dim.height,s)}},Ew.Distribute),this._disposables.add(this._splitView.onDidSashChange(()=>{this._dim.width&&(this.layoutData.ratio=this._splitView.getViewSize(0)/this._dim.width)},void 0));const n=(s,r)=>{s instanceof Bc&&(r==="show"&&this._revealReference(s,!1),this._onDidSelectReference.fire({element:s,kind:r,source:"tree"}))};this._tree.onDidOpen(s=>{s.sideBySide?n(s.element,"side"):s.editorOptions.pinned?n(s.element,"goto"):n(s.element,"show")}),Jn(this._treeContainer)}_onWidth(e){this._dim&&this._doLayoutBody(this._dim.height,e)}_doLayoutBody(e,t){super._doLayoutBody(e,t),this._dim=new gt(t,e),this.layoutData.heightInLines=this._viewZone?this._viewZone.heightInLines:this.layoutData.heightInLines,this._splitView.layout(t),this._splitView.resizeView(0,t*this.layoutData.ratio)}setSelection(e){return this._revealReference(e,!0).then(()=>{this._model&&(this._tree.setSelection([e]),this._tree.setFocus([e]))})}setModel(e){return this._disposeOnNewModel.clear(),this._model=e,this._model?this._onNewModel():Promise.resolve()}_onNewModel(){return this._model?this._model.isEmpty?(this.setTitle(""),this._messageContainer.innerText=g("noResults","No results"),Ts(this._messageContainer),Promise.resolve(void 0)):(Jn(this._messageContainer),this._decorationsManager=new Zy(this._preview,this._model),this._disposeOnNewModel.add(this._decorationsManager),this._disposeOnNewModel.add(this._model.onDidChangeReferenceRange(e=>this._tree.rerender(e))),this._disposeOnNewModel.add(this._preview.onMouseDown(e=>{const{event:t,target:i}=e;if(t.detail!==2)return;const n=this._getFocusedReference();n&&this._onDidSelectReference.fire({element:{uri:n.uri,range:i.range},kind:t.ctrlKey||t.metaKey||t.altKey?"side":"open",source:"editor"})})),this.container.classList.add("results-loaded"),Ts(this._treeContainer),Ts(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 Bc)return e;if(e instanceof qv&&e.children.length>0)return e.children[0]}revealReference(e){return d5(this,void 0,void 0,function*(){yield this._revealReference(e,!1),this._onDidSelectReference.fire({element:e,kind:"goto",source:"tree"})})}_revealReference(e,t){return d5(this,void 0,void 0,function*(){if(this._revealedReference===e)return;this._revealedReference=e,e.uri.scheme!==qe.inMemory?this.setTitle(uJ(e.uri),this._uriLabel.getUriLabel(oy(e.uri))):this.setTitle(g("peekView.alternateTitle","References"));const i=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 n=yield i;if(!this._model){n.dispose();return}St(this._previewModelReference);const s=n.object;if(s){const r=this._preview.getModel()===s.textEditorModel?0:1,a=L.lift(e.range).collapseToStart();this._previewModelReference=n,this._preview.setModel(s.textEditorModel),this._preview.setSelection(a),this._preview.revealRangeInCenter(a,r)}else this._preview.setModel(this._previewNotAvailableMessage),n.dispose()})}};EN=Pue([Cl(3,Ki),Cl(4,Ls),Cl(5,Re),Cl(6,PW),Cl(7,lp),Cl(8,ry),Cl(9,Nt),Cl(10,qt),Cl(11,At)],EN);var Bue=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},yf=function(o,e){return function(t,i){e(t,i,o)}},c5=function(o,e,t,i){function n(s){return s instanceof t?s:new t(function(r){r(s)})}return new(t||(t=Promise))(function(s,r){function a(c){try{d(i.next(c))}catch(h){r(h)}}function l(c){try{d(i.throw(c))}catch(h){r(h)}}function d(c){c.done?s(c.value):n(c.value).then(a,l)}d((i=i.apply(o,e||[])).next())})},d1;const rf=new ce("referenceSearchVisible",!1,g("referenceSearchVisible","Whether reference peek is visible, like 'Peek References' or 'Peek Definition'"));let Wc=d1=class{static get(e){return e.getContribution(d1.ID)}constructor(e,t,i,n,s,r,a,l){this._defaultTreeKeyboardSupport=e,this._editor=t,this._editorService=n,this._notificationService=s,this._instantiationService=r,this._storageService=a,this._configurationService=l,this._disposables=new X,this._requestIdPool=0,this._ignoreModelChangeEvent=!1,this._referenceSearchVisible=rf.bindTo(i)}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,i){let n;if(this._widget&&(n=this._widget.position),this.closeWidget(),n&&e.containsPosition(n))return;this._peekMode=i,this._referenceSearchVisible.set(!0),this._disposables.add(this._editor.onDidChangeModelLanguage(()=>{this.closeWidget()})),this._disposables.add(this._editor.onDidChangeModel(()=>{this._ignoreModelChangeEvent||this.closeWidget()}));const s="peekViewLayout",r=Oue.fromJSON(this._storageService.get(s,0,"{}"));this._widget=this._instantiationService.createInstance(EN,this._editor,this._defaultTreeKeyboardSupport,r),this._widget.setTitle(g("labelLoading","Loading...")),this._widget.show(e),this._disposables.add(this._widget.onDidClose(()=>{t.cancel(),this._widget&&(this._storageService.store(s,JSON.stringify(this._widget.layoutData),0,1),this._widget=void 0),this.closeWidget()})),this._disposables.add(this._widget.onDidSelectReference(l=>{const{element:d,kind:c}=l;if(d)switch(c){case"open":(l.source!=="editor"||!this._configurationService.getValue("editor.stablePeek"))&&this.openReference(d,!1,!1);break;case"side":this.openReference(d,!0,!1);break;case"goto":i?this._gotoReference(d,!0):this.openReference(d,!1,!0);break}}));const a=++this._requestIdPool;t.then(l=>{var d;if(a!==this._requestIdPool||!this._widget){l.dispose();return}return(d=this._model)===null||d===void 0||d.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(g("metaTitle.N","{0} ({1})",this._model.title,this._model.references.length));const c=this._editor.getModel().uri,h=new P(e.startLineNumber,e.startColumn),u=this._model.nearestReference(c,h);if(u)return this._widget.setSelection(u).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 c5(this,void 0,void 0,function*(){if(!this._editor.hasModel()||!this._model||!this._widget)return;const t=this._widget.position;if(!t)return;const i=this._model.nearestReference(this._editor.getModel().uri,t);if(!i)return;const n=this._model.nextOrPreviousReference(i,e),s=this._editor.hasTextFocus(),r=this._widget.isPreviewEditorFocused();yield this._widget.setSelection(n),yield this._gotoReference(n,!1),s?this._editor.focus():this._widget&&r&&this._widget.focusOnPreviewEditor()})}revealReference(e){return c5(this,void 0,void 0,function*(){!this._editor.hasModel()||!this._model||!this._widget||(yield this._widget.revealReference(e))})}closeWidget(e=!0){var t,i;(t=this._widget)===null||t===void 0||t.dispose(),(i=this._model)===null||i===void 0||i.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 i;(i=this._widget)===null||i===void 0||i.hide(),this._ignoreModelChangeEvent=!0;const n=L.lift(e.range).collapseToStart();return this._editorService.openCodeEditor({resource:e.uri,options:{selection:n,selectionSource:"code.jump",pinned:t}},this._editor).then(s=>{var r;if(this._ignoreModelChangeEvent=!1,!s||!this._widget){this.closeWidget();return}if(this._editor===s)this._widget.show(n),this._widget.focusOnReferenceTree();else{const a=d1.get(s),l=this._model.clone();this.closeWidget(),s.focus(),a?.toggleWidget(n,Wi(d=>Promise.resolve(l)),(r=this._peekMode)!==null&&r!==void 0?r:!1)}},s=>{this._ignoreModelChangeEvent=!1,He(s)})}openReference(e,t,i){t||this.closeWidget();const{uri:n,range:s}=e;this._editorService.openCodeEditor({resource:n,options:{selection:s,selectionSource:"code.jump",pinned:i}},this._editor,t)}};Wc.ID="editor.contrib.referencesController";Wc=d1=Bue([yf(2,Ae),yf(3,_t),yf(4,Li),yf(5,Re),yf(6,_r),yf(7,st)],Wc);function af(o,e){const t=Lue(o);if(!t)return;const i=Wc.get(t);i&&e(i)}ws.registerCommandAndKeybindingRule({id:"togglePeekWidgetFocus",weight:100,primary:Pi(2089,60),when:Z.or(rf,Ss.inPeekEditor),handler(o){af(o,e=>{e.changeFocusBetweenPreviewAndReferences()})}});ws.registerCommandAndKeybindingRule({id:"goToNextReference",weight:90,primary:62,secondary:[70],when:Z.or(rf,Ss.inPeekEditor),handler(o){af(o,e=>{e.goToNextOrPreviousReference(!0)})}});ws.registerCommandAndKeybindingRule({id:"goToPreviousReference",weight:90,primary:1086,secondary:[1094],when:Z.or(rf,Ss.inPeekEditor),handler(o){af(o,e=>{e.goToNextOrPreviousReference(!1)})}});lt.registerCommandAlias("goToNextReferenceFromEmbeddedEditor","goToNextReference");lt.registerCommandAlias("goToPreviousReferenceFromEmbeddedEditor","goToPreviousReference");lt.registerCommandAlias("closeReferenceSearchEditor","closeReferenceSearch");lt.registerCommand("closeReferenceSearch",o=>af(o,e=>e.closeWidget()));ws.registerKeybindingRule({id:"closeReferenceSearch",weight:-1,primary:9,secondary:[1033],when:Z.and(Ss.inPeekEditor,Z.not("config.editor.stablePeek"))});ws.registerKeybindingRule({id:"closeReferenceSearch",weight:250,primary:9,secondary:[1033],when:Z.and(rf,Z.not("config.editor.stablePeek"))});ws.registerCommandAndKeybindingRule({id:"revealReference",weight:200,primary:3,mac:{primary:3,secondary:[2066]},when:Z.and(rf,jB,JR.negate(),eM.negate()),handler(o){var e;const i=(e=o.get(Uo).lastFocusedList)===null||e===void 0?void 0:e.getFocus();Array.isArray(i)&&i[0]instanceof Bc&&af(o,n=>n.revealReference(i[0]))}});ws.registerCommandAndKeybindingRule({id:"openReferenceToSide",weight:100,primary:2051,mac:{primary:259},when:Z.and(rf,jB,JR.negate(),eM.negate()),handler(o){var e;const i=(e=o.get(Uo).lastFocusedList)===null||e===void 0?void 0:e.getFocus();Array.isArray(i)&&i[0]instanceof Bc&&af(o,n=>n.openReference(i[0],!0,!0))}});lt.registerCommand("openReference",o=>{var e;const i=(e=o.get(Uo).lastFocusedList)===null||e===void 0?void 0:e.getFocus();Array.isArray(i)&&i[0]instanceof Bc&&af(o,n=>n.openReference(i[0],!1,!0))});var BW=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Jm=function(o,e){return function(t,i){e(t,i,o)}};const RM=new ce("hasSymbols",!1,g("hasSymbols","Whether there are symbol locations that can be navigated via keyboard-only.")),Yy=et("ISymbolNavigationService");let NN=class{constructor(e,t,i,n){this._editorService=t,this._notificationService=i,this._keybindingService=n,this._currentModel=void 0,this._currentIdx=-1,this._ignoreEditorChange=!1,this._ctxHasSymbols=RM.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 i=new TN(this._editorService),n=i.onDidChange(s=>{if(this._ignoreEditorChange)return;const r=this._editorService.getActiveCodeEditor();if(!r)return;const a=r.getModel(),l=r.getPosition();if(!a||!l)return;let d=!1,c=!1;for(const h of t.references)if(lR(h.uri,a.uri))d=!0,c=c||L.containsPosition(h.range,l);else if(d)break;(!d||!c)&&this.reset()});this._currentState=or(i,n)}revealNext(e){if(!this._currentModel)return Promise.resolve();this._currentIdx+=1,this._currentIdx%=this._currentModel.references.length;const t=this._currentModel.references[this._currentIdx];return this._showMessage(),this._ignoreEditorChange=!0,this._editorService.openCodeEditor({resource:t.uri,options:{selection:L.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"),i=t?g("location.kb","Symbol {0} of {1}, {2} for next",this._currentIdx+1,this._currentModel.references.length,t.getLabel()):g("location","Symbol {0} of {1}",this._currentIdx+1,this._currentModel.references.length);this._currentMessage=this._notificationService.status(i)}};NN=BW([Jm(0,Ae),Jm(1,_t),Jm(2,Li),Jm(3,Nt)],NN);dt(Yy,NN,1);re(new class extends tn{constructor(){super({id:"editor.gotoNextSymbolFromResult",precondition:RM,kbOpts:{weight:100,primary:70}})}runEditorCommand(o,e){return o.get(Yy).revealNext(e)}});ws.registerCommandAndKeybindingRule({id:"editor.gotoNextSymbolFromResult.cancel",weight:100,when:RM,primary:9,handler(o){o.get(Yy).reset()}});let TN=class{constructor(e){this._listener=new Map,this._disposables=new X,this._onDidChange=new A,this.onDidChange=this._onDidChange.event,this._disposables.add(e.onCodeEditorRemove(this._onDidRemoveEditor,this)),this._disposables.add(e.onCodeEditorAdd(this._onDidAddEditor,this)),e.listCodeEditors().forEach(this._onDidAddEditor,this)}dispose(){this._disposables.dispose(),this._onDidChange.dispose(),St(this._listener.values())}_onDidAddEditor(e){this._listener.set(e,or(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)}};TN=BW([Jm(0,_t)],TN);var MM=function(o,e,t,i){function n(s){return s instanceof t?s:new t(function(r){r(s)})}return new(t||(t=Promise))(function(s,r){function a(c){try{d(i.next(c))}catch(h){r(h)}}function l(c){try{d(i.throw(c))}catch(h){r(h)}}function d(c){c.done?s(c.value):n(c.value).then(a,l)}d((i=i.apply(o,e||[])).next())})};function eb(o,e,t,i){return MM(this,void 0,void 0,function*(){const s=t.ordered(o).map(a=>Promise.resolve(i(a,o,e)).then(void 0,l=>{Ni(l)})),r=yield Promise.all(s);return Za(r.flat())})}function Xy(o,e,t,i){return eb(e,t,o,(n,s,r)=>n.provideDefinition(s,r,i))}function WW(o,e,t,i){return eb(e,t,o,(n,s,r)=>n.provideDeclaration(s,r,i))}function VW(o,e,t,i){return eb(e,t,o,(n,s,r)=>n.provideImplementation(s,r,i))}function HW(o,e,t,i){return eb(e,t,o,(n,s,r)=>n.provideTypeDefinition(s,r,i))}function Qy(o,e,t,i,n){return eb(e,t,o,(s,r,a)=>MM(this,void 0,void 0,function*(){const l=yield s.provideReferences(r,a,{includeDeclaration:!0},n);if(!i||!l||l.length!==2)return l;const d=yield s.provideReferences(r,a,{includeDeclaration:!1},n);return d&&d.length===1?d:l}))}function tb(o){return MM(this,void 0,void 0,function*(){const e=yield o(),t=new Bs(e,""),i=t.references.map(n=>n.link);return t.dispose(),i})}hl("_executeDefinitionProvider",(o,e,t)=>{const i=o.get(pe),n=Xy(i.definitionProvider,e,t,Qe.None);return tb(()=>n)});hl("_executeTypeDefinitionProvider",(o,e,t)=>{const i=o.get(pe),n=HW(i.typeDefinitionProvider,e,t,Qe.None);return tb(()=>n)});hl("_executeDeclarationProvider",(o,e,t)=>{const i=o.get(pe),n=WW(i.declarationProvider,e,t,Qe.None);return tb(()=>n)});hl("_executeReferenceProvider",(o,e,t)=>{const i=o.get(pe),n=Qy(i.referenceProvider,e,t,!1,Qe.None);return tb(()=>n)});hl("_executeImplementationProvider",(o,e,t)=>{const i=o.get(pe),n=VW(i.implementationProvider,e,t,Qe.None);return tb(()=>n)});var lr=function(o,e,t,i){function n(s){return s instanceof t?s:new t(function(r){r(s)})}return new(t||(t=Promise))(function(s,r){function a(c){try{d(i.next(c))}catch(h){r(h)}}function l(c){try{d(i.throw(c))}catch(h){r(h)}}function d(c){c.done?s(c.value):n(c.value).then(a,l)}d((i=i.apply(o,e||[])).next())})},Lm,xm,Dm,oC,rC,aC,lC,dC;hn.appendMenuItem(k.EditorContext,{submenu:k.EditorContextPeek,title:g("peek.submenu","Peek"),group:"navigation",order:100});class Cp{static is(e){return!e||typeof e!="object"?!1:!!(e instanceof Cp||P.isIPosition(e.position)&&e.model)}constructor(e,t){this.model=e,this.position=t}}class qn extends ra{static all(){return qn._allSymbolNavigationCommands.values()}static _patchConfig(e){const t=Object.assign(Object.assign({},e),{f1:!0});if(t.menu)for(const i of Xe.wrap(t.menu))(i.id===k.EditorContext||i.id===k.EditorContextPeek)&&(i.when=Z.and(e.precondition,i.when));return t}constructor(e,t){super(qn._patchConfig(t)),this.configuration=e,qn._allSymbolNavigationCommands.set(t.id,this)}runEditorCommand(e,t,i,n){if(!t.hasModel())return Promise.resolve(void 0);const s=e.get(Li),r=e.get(_t),a=e.get(Jc),l=e.get(Yy),d=e.get(pe),c=e.get(Re),h=t.getModel(),u=t.getPosition(),f=Cp.is(i)?i:new Cp(h,u),p=new Ac(t,5),m=FS(this._getLocationModel(d,f.model,f.position,p.token),p.token).then(v=>lr(this,void 0,void 0,function*(){var _;if(!v||p.token.isCancellationRequested)return;On(v.ariaMessage);let b;if(v.referenceAt(h.uri,u)){const w=this._getAlternativeCommand(t);!qn._activeAlternativeCommands.has(w)&&qn._allSymbolNavigationCommands.has(w)&&(b=qn._allSymbolNavigationCommands.get(w))}const C=v.references.length;if(C===0){if(!this.configuration.muteMessage){const w=h.getWordAtPosition(u);(_=Fs.get(t))===null||_===void 0||_.showMessage(this._getNoResultFoundMessage(w),u)}}else if(C===1&&b)qn._activeAlternativeCommands.add(this.desc.id),c.invokeFunction(w=>b.runEditorCommand(w,t,i,n).finally(()=>{qn._activeAlternativeCommands.delete(this.desc.id)}));else return this._onResult(r,l,t,v,n)}),v=>{s.error(v)}).finally(()=>{p.dispose()});return a.showWhile(m,250),m}_onResult(e,t,i,n,s){return lr(this,void 0,void 0,function*(){const r=this._getGoToPreference(i);if(!(i instanceof Fc)&&(this.configuration.openInPeek||r==="peek"&&n.references.length>1))this._openInPeek(i,n,s);else{const a=n.firstReference(),l=n.references.length>1&&r==="gotoAndPeek",d=yield this._openReference(i,e,a,this.configuration.openToSide,!l);l&&d?this._openInPeek(d,n,s):n.dispose(),r==="goto"&&t.put(a)}})}_openReference(e,t,i,n,s){return lr(this,void 0,void 0,function*(){let r;if(TU(i)&&(r=i.targetSelectionRange),r||(r=i.range),!r)return;const a=yield t.openCodeEditor({resource:i.uri,options:{selection:L.collapseToStart(r),selectionRevealType:3,selectionSource:"code.jump"}},e,n);if(a){if(s){const l=a.getModel(),d=a.createDecorationsCollection([{range:r,options:{description:"symbol-navigate-action-highlight",className:"symbolHighlight"}}]);setTimeout(()=>{a.getModel()===l&&d.clear()},350)}return a}})}_openInPeek(e,t,i){const n=Wc.get(e);n&&e.hasModel()?n.toggleWidget(i??e.getSelection(),Wi(s=>Promise.resolve(t)),this.configuration.openInPeek):t.dispose()}}qn._allSymbolNavigationCommands=new Map;qn._activeAlternativeCommands=new Set;class ib extends qn{_getLocationModel(e,t,i,n){return lr(this,void 0,void 0,function*(){return new Bs(yield Xy(e.definitionProvider,t,i,n),g("def.title","Definitions"))})}_getNoResultFoundMessage(e){return e&&e.word?g("noResultWord","No definition found for '{0}'",e.word):g("generic.noResults","No definition found")}_getAlternativeCommand(e){return e.getOption(58).alternativeDefinitionCommand}_getGoToPreference(e){return e.getOption(58).multipleDefinitions}}jt((Lm=class extends ib{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:Lm.id,title:{value:g("actions.goToDecl.label","Go to Definition"),original:"Go to Definition",mnemonicTitle:g({key:"miGotoDefinition",comment:["&& denotes a mnemonic"]},"Go to &&Definition")},precondition:Z.and(E.hasDefinitionProvider,E.isInWalkThroughSnippet.toNegated()),keybinding:[{when:E.editorTextFocus,primary:70,weight:100},{when:Z.and(E.editorTextFocus,zB),primary:2118,weight:100}],menu:[{id:k.EditorContext,group:"navigation",order:1.1},{id:k.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:2}]}),lt.registerCommandAlias("editor.action.goToDeclaration",Lm.id)}},Lm.id="editor.action.revealDefinition",Lm));jt((xm=class extends ib{constructor(){super({openToSide:!0,openInPeek:!1,muteMessage:!1},{id:xm.id,title:{value:g("actions.goToDeclToSide.label","Open Definition to the Side"),original:"Open Definition to the Side"},precondition:Z.and(E.hasDefinitionProvider,E.isInWalkThroughSnippet.toNegated()),keybinding:[{when:E.editorTextFocus,primary:Pi(2089,70),weight:100},{when:Z.and(E.editorTextFocus,zB),primary:Pi(2089,2118),weight:100}]}),lt.registerCommandAlias("editor.action.openDeclarationToTheSide",xm.id)}},xm.id="editor.action.revealDefinitionAside",xm));jt((Dm=class extends ib{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:Dm.id,title:{value:g("actions.previewDecl.label","Peek Definition"),original:"Peek Definition"},precondition:Z.and(E.hasDefinitionProvider,Ss.notInPeekEditor,E.isInWalkThroughSnippet.toNegated()),keybinding:{when:E.editorTextFocus,primary:582,linux:{primary:3140},weight:100},menu:{id:k.EditorContextPeek,group:"peek",order:2}}),lt.registerCommandAlias("editor.action.previewDeclaration",Dm.id)}},Dm.id="editor.action.peekDefinition",Dm));class zW extends qn{_getLocationModel(e,t,i,n){return lr(this,void 0,void 0,function*(){return new Bs(yield WW(e.declarationProvider,t,i,n),g("decl.title","Declarations"))})}_getNoResultFoundMessage(e){return e&&e.word?g("decl.noResultWord","No declaration found for '{0}'",e.word):g("decl.generic.noResults","No declaration found")}_getAlternativeCommand(e){return e.getOption(58).alternativeDeclarationCommand}_getGoToPreference(e){return e.getOption(58).multipleDeclarations}}jt((oC=class extends zW{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:oC.id,title:{value:g("actions.goToDeclaration.label","Go to Declaration"),original:"Go to Declaration",mnemonicTitle:g({key:"miGotoDeclaration",comment:["&& denotes a mnemonic"]},"Go to &&Declaration")},precondition:Z.and(E.hasDeclarationProvider,E.isInWalkThroughSnippet.toNegated()),menu:[{id:k.EditorContext,group:"navigation",order:1.3},{id:k.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:3}]})}_getNoResultFoundMessage(e){return e&&e.word?g("decl.noResultWord","No declaration found for '{0}'",e.word):g("decl.generic.noResults","No declaration found")}},oC.id="editor.action.revealDeclaration",oC));jt(class extends zW{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:"editor.action.peekDeclaration",title:{value:g("actions.peekDecl.label","Peek Declaration"),original:"Peek Declaration"},precondition:Z.and(E.hasDeclarationProvider,Ss.notInPeekEditor,E.isInWalkThroughSnippet.toNegated()),menu:{id:k.EditorContextPeek,group:"peek",order:3}})}});class UW extends qn{_getLocationModel(e,t,i,n){return lr(this,void 0,void 0,function*(){return new Bs(yield HW(e.typeDefinitionProvider,t,i,n),g("typedef.title","Type Definitions"))})}_getNoResultFoundMessage(e){return e&&e.word?g("goToTypeDefinition.noResultWord","No type definition found for '{0}'",e.word):g("goToTypeDefinition.generic.noResults","No type definition found")}_getAlternativeCommand(e){return e.getOption(58).alternativeTypeDefinitionCommand}_getGoToPreference(e){return e.getOption(58).multipleTypeDefinitions}}jt((rC=class extends UW{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:rC.ID,title:{value:g("actions.goToTypeDefinition.label","Go to Type Definition"),original:"Go to Type Definition",mnemonicTitle:g({key:"miGotoTypeDefinition",comment:["&& denotes a mnemonic"]},"Go to &&Type Definition")},precondition:Z.and(E.hasTypeDefinitionProvider,E.isInWalkThroughSnippet.toNegated()),keybinding:{when:E.editorTextFocus,primary:0,weight:100},menu:[{id:k.EditorContext,group:"navigation",order:1.4},{id:k.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:3}]})}},rC.ID="editor.action.goToTypeDefinition",rC));jt((aC=class extends UW{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:aC.ID,title:{value:g("actions.peekTypeDefinition.label","Peek Type Definition"),original:"Peek Type Definition"},precondition:Z.and(E.hasTypeDefinitionProvider,Ss.notInPeekEditor,E.isInWalkThroughSnippet.toNegated()),menu:{id:k.EditorContextPeek,group:"peek",order:4}})}},aC.ID="editor.action.peekTypeDefinition",aC));class $W extends qn{_getLocationModel(e,t,i,n){return lr(this,void 0,void 0,function*(){return new Bs(yield VW(e.implementationProvider,t,i,n),g("impl.title","Implementations"))})}_getNoResultFoundMessage(e){return e&&e.word?g("goToImplementation.noResultWord","No implementation found for '{0}'",e.word):g("goToImplementation.generic.noResults","No implementation found")}_getAlternativeCommand(e){return e.getOption(58).alternativeImplementationCommand}_getGoToPreference(e){return e.getOption(58).multipleImplementations}}jt((lC=class extends $W{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:lC.ID,title:{value:g("actions.goToImplementation.label","Go to Implementations"),original:"Go to Implementations",mnemonicTitle:g({key:"miGotoImplementation",comment:["&& denotes a mnemonic"]},"Go to &&Implementations")},precondition:Z.and(E.hasImplementationProvider,E.isInWalkThroughSnippet.toNegated()),keybinding:{when:E.editorTextFocus,primary:2118,weight:100},menu:[{id:k.EditorContext,group:"navigation",order:1.45},{id:k.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:4}]})}},lC.ID="editor.action.goToImplementation",lC));jt((dC=class extends $W{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:dC.ID,title:{value:g("actions.peekImplementation.label","Peek Implementations"),original:"Peek Implementations"},precondition:Z.and(E.hasImplementationProvider,Ss.notInPeekEditor,E.isInWalkThroughSnippet.toNegated()),keybinding:{when:E.editorTextFocus,primary:3142,weight:100},menu:{id:k.EditorContextPeek,group:"peek",order:5}})}},dC.ID="editor.action.peekImplementation",dC));class jW extends qn{_getNoResultFoundMessage(e){return e?g("references.no","No references found for '{0}'",e.word):g("references.noGeneric","No references found")}_getAlternativeCommand(e){return e.getOption(58).alternativeReferenceCommand}_getGoToPreference(e){return e.getOption(58).multipleReferences}}jt(class extends jW{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:"editor.action.goToReferences",title:{value:g("goToReferences.label","Go to References"),original:"Go to References",mnemonicTitle:g({key:"miGotoReference",comment:["&& denotes a mnemonic"]},"Go to &&References")},precondition:Z.and(E.hasReferenceProvider,Ss.notInPeekEditor,E.isInWalkThroughSnippet.toNegated()),keybinding:{when:E.editorTextFocus,primary:1094,weight:100},menu:[{id:k.EditorContext,group:"navigation",order:1.45},{id:k.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:5}]})}_getLocationModel(e,t,i,n){return lr(this,void 0,void 0,function*(){return new Bs(yield Qy(e.referenceProvider,t,i,!0,n),g("ref.title","References"))})}});jt(class extends jW{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:"editor.action.referenceSearch.trigger",title:{value:g("references.action.label","Peek References"),original:"Peek References"},precondition:Z.and(E.hasReferenceProvider,Ss.notInPeekEditor,E.isInWalkThroughSnippet.toNegated()),menu:{id:k.EditorContextPeek,group:"peek",order:6}})}_getLocationModel(e,t,i,n){return lr(this,void 0,void 0,function*(){return new Bs(yield Qy(e.referenceProvider,t,i,!1,n),g("ref.title","References"))})}});class Wue extends qn{constructor(e,t,i){super(e,{id:"editor.action.goToLocation",title:{value:g("label.generic","Go to Any Symbol"),original:"Go to Any Symbol"},precondition:Z.and(Ss.notInPeekEditor,E.isInWalkThroughSnippet.toNegated())}),this._references=t,this._gotoMultipleBehaviour=i}_getLocationModel(e,t,i,n){return lr(this,void 0,void 0,function*(){return new Bs(this._references,g("generic.title","Locations"))})}_getNoResultFoundMessage(e){return e&&g("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""}}lt.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:ke},{name:"position",description:"The position at which to start",constraint:P.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:(o,e,t,i,n,s,r)=>lr(void 0,void 0,void 0,function*(){xt(ke.isUri(e)),xt(P.isIPosition(t)),xt(Array.isArray(i)),xt(typeof n>"u"||typeof n=="string"),xt(typeof r>"u"||typeof r=="boolean");const a=o.get(_t),l=yield a.openCodeEditor({resource:e},a.getFocusedCodeEditor());if(rl(l))return l.setPosition(t),l.revealPositionInCenterIfOutsideViewport(t,0),l.invokeWithinContext(d=>{const c=new class extends Wue{_getNoResultFoundMessage(h){return s||super._getNoResultFoundMessage(h)}}({muteMessage:!s,openInPeek:!!r,openToSide:!1},i,n);d.get(Re).invokeFunction(c.run.bind(c),l)})})});lt.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:ke},{name:"position",description:"The position at which to start",constraint:P.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:(o,e,t,i,n)=>lr(void 0,void 0,void 0,function*(){o.get(li).executeCommand("editor.action.goToLocations",e,t,i,n,void 0,!0)})});lt.registerCommand({id:"editor.action.findReferences",handler:(o,e,t)=>{xt(ke.isUri(e)),xt(P.isIPosition(t));const i=o.get(pe),n=o.get(_t);return n.openCodeEditor({resource:e},n.getFocusedCodeEditor()).then(s=>{if(!rl(s)||!s.hasModel())return;const r=Wc.get(s);if(!r)return;const a=Wi(d=>Qy(i.referenceProvider,s.getModel(),P.lift(t),!1,d).then(c=>new Bs(c,g("ref.title","References")))),l=new L(t.lineNumber,t.column,t.lineNumber,t.column);return Promise.resolve(r.toggleWidget(l,a,!1))})}});lt.registerCommandAlias("editor.action.showReferences","editor.action.peekLocations");var Vue=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},_D=function(o,e){return function(t,i){e(t,i,o)}},h5=function(o,e,t,i){function n(s){return s instanceof t?s:new t(function(r){r(s)})}return new(t||(t=Promise))(function(s,r){function a(c){try{d(i.next(c))}catch(h){r(h)}}function l(c){try{d(i.throw(c))}catch(h){r(h)}}function d(c){c.done?s(c.value):n(c.value).then(a,l)}d((i=i.apply(o,e||[])).next())})},e_;let Nu=e_=class{constructor(e,t,i,n){this.textModelResolverService=t,this.languageService=i,this.languageFeaturesService=n,this.toUnhook=new X,this.toUnhookForKeyboard=new X,this.currentWordAtPosition=null,this.previousPromise=null,this.editor=e,this.linkDecorations=this.editor.createDecorationsCollection();const s=new jy(e);this.toUnhook.add(s),this.toUnhook.add(s.onMouseMoveOrRelevantKeyDown(([r,a])=>{this.startFindDefinitionFromMouse(r,a??void 0)})),this.toUnhook.add(s.onExecute(r=>{this.isEnabled(r)&&this.gotoDefinition(r.target.position,r.hasSideBySideModifier).catch(a=>{He(a)}).finally(()=>{this.removeLinkDecorations()})})),this.toUnhook.add(s.onCancel(()=>{this.removeLinkDecorations(),this.currentWordAtPosition=null}))}static get(e){return e.getContribution(e_.ID)}startFindDefinitionFromCursor(e){return h5(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 i=e.target.position;this.startFindDefinition(i)}startFindDefinition(e){var t;return h5(this,void 0,void 0,function*(){this.toUnhookForKeyboard.clear();const i=e?(t=this.editor.getModel())===null||t===void 0?void 0:t.getWordAtPosition(e):null;if(!i){this.currentWordAtPosition=null,this.removeLinkDecorations();return}if(this.currentWordAtPosition&&this.currentWordAtPosition.startColumn===i.startColumn&&this.currentWordAtPosition.endColumn===i.endColumn&&this.currentWordAtPosition.word===i.word)return;this.currentWordAtPosition=i;const n=new N6(this.editor,15);this.previousPromise&&(this.previousPromise.cancel(),this.previousPromise=null),this.previousPromise=Wi(a=>this.findDefinition(e,a));let s;try{s=yield this.previousPromise}catch(a){He(a);return}if(!s||!s.length||!n.validate(this.editor)){this.removeLinkDecorations();return}const r=s[0].originSelectionRange?L.lift(s[0].originSelectionRange):new L(e.lineNumber,i.startColumn,e.lineNumber,i.endColumn);if(s.length>1){let a=r;for(const{originSelectionRange:l}of s)l&&(a=L.plusRange(a,l));this.addDecoration(a,new xn().appendText(g("multipleResults","Click to show {0} definitions.",s.length)))}else{const a=s[0];if(!a.uri)return;this.textModelResolverService.createModelReference(a.uri).then(l=>{if(!l.object||!l.object.textEditorModel){l.dispose();return}const{object:{textEditorModel:d}}=l,{startLineNumber:c}=a.range;if(c<1||c>d.getLineCount()){l.dispose();return}const h=this.getPreviewValue(d,c,a),u=this.languageService.guessLanguageIdByFilepathOrFirstLine(d.uri);this.addDecoration(r,h?new xn().appendCodeblock(u||"",h):void 0),l.dispose()})}})}getPreviewValue(e,t,i){let n=i.range;return n.endLineNumber-n.startLineNumber>=e_.MAX_SOURCE_PREVIEW_LINES&&(n=this.getPreviewRangeBasedOnIndentation(e,t)),this.stripIndentationFromPreviewRange(e,t,n)}stripIndentationFromPreviewRange(e,t,i){let s=e.getLineFirstNonWhitespaceColumn(t);for(let a=t+1;a<i.endLineNumber;a++){const l=e.getLineFirstNonWhitespaceColumn(a);s=Math.min(s,l)}return e.getValueInRange(i).replace(new RegExp(`^\\s{${s-1}}`,"gm"),"").trim()}getPreviewRangeBasedOnIndentation(e,t){const i=e.getLineFirstNonWhitespaceColumn(t),n=Math.min(e.getLineCount(),t+e_.MAX_SOURCE_PREVIEW_LINES);let s=t+1;for(;s<n;s++){const r=e.getLineFirstNonWhitespaceColumn(s);if(i===r)break}return new L(t,1,s+1,1)}addDecoration(e,t){const i={range:e,options:{description:"goto-definition-link",inlineClassName:"goto-definition-link",hoverMessage:t}};this.linkDecorations.set([i])}removeLinkDecorations(){this.linkDecorations.clear()}isEnabled(e,t){var i;return this.editor.hasModel()&&e.isLeftClick&&e.isNoneOrSingleMouseDown&&e.target.type===6&&!(((i=e.target.detail.injectedText)===null||i===void 0?void 0:i.options)instanceof Mc)&&(e.hasTriggerModifier||(t?t.keyCodeIsTriggerKey:!1))&&this.languageFeaturesService.definitionProvider.has(this.editor.getModel())}findDefinition(e,t){const i=this.editor.getModel();return i?Xy(this.languageFeaturesService.definitionProvider,i,e,t):Promise.resolve(null)}gotoDefinition(e,t){return this.editor.setPosition(e),this.editor.invokeWithinContext(i=>{const n=!t&&this.editor.getOption(87)&&!this.isInPeekEditor(i);return new ib({openToSide:t,openInPeek:n,muteMessage:!0},{title:{value:"",original:""},id:"",precondition:void 0}).run(i)})}isInPeekEditor(e){const t=e.get(Ae);return Ss.inPeekEditor.getValue(t)}dispose(){this.toUnhook.dispose(),this.toUnhookForKeyboard.dispose()}};Nu.ID="editor.contrib.gotodefinitionatposition";Nu.MAX_SOURCE_PREVIEW_LINES=8;Nu=e_=Vue([_D(1,Ls),_D(2,qt),_D(3,pe)],Nu);ft(Nu.ID,Nu,2);const cC=te;class KW extends H{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 T0(this.contentsDomNode,{consumeMouseWheelIfScrollbarIsNeeded:!0})),this.containerDomNode.appendChild(this.scrollbar.getDomNode())}onContentsChanged(){this.scrollbar.scanDomNode()}}class AM extends H{static render(e,t,i){return new AM(e,t,i)}constructor(e,t,i){super(),this.actionContainer=Y(e,cC("div.action-container")),this.actionContainer.setAttribute("tabindex","0"),this.action=Y(this.actionContainer,cC("a.action")),this.action.setAttribute("role","button"),t.iconClass&&Y(this.action,cC(`span.icon.${t.iconClass}`));const n=Y(this.action,cC("span"));n.textContent=i?`${t.label} (${i})`:t.label,this._register($(this.actionContainer,ae.CLICK,s=>{s.stopPropagation(),s.preventDefault(),t.run(this.actionContainer)})),this._register($(this.actionContainer,ae.KEY_DOWN,s=>{const r=new Wt(s);(r.equals(3)||r.equals(10))&&(s.stopPropagation(),s.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 Hue(o,e){return o&&e?g("acessibleViewHint","Inspect this in the accessible view with {0}.",e):o?g("acessibleViewHintNoKbOpen","Inspect this in the accessible view via the command Open Accessible View which is currently not triggerable via keybinding."):""}var zue=function(o,e,t,i){function n(s){return s instanceof t?s:new t(function(r){r(s)})}return new(t||(t=Promise))(function(s,r){function a(c){try{d(i.next(c))}catch(h){r(h)}}function l(c){try{d(i.throw(c))}catch(h){r(h)}}function d(c){c.done?s(c.value):n(c.value).then(a,l)}d((i=i.apply(o,e||[])).next())})},Uue=function(o){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=o[Symbol.asyncIterator],t;return e?e.call(o):(o=typeof __values=="function"?__values(o):o[Symbol.iterator](),t={},i("next"),i("throw"),i("return"),t[Symbol.asyncIterator]=function(){return this},t);function i(s){t[s]=o[s]&&function(r){return new Promise(function(a,l){r=o[s](r),n(a,l,r.done,r.value)})}}function n(s,r,a,l){Promise.resolve(l).then(function(d){s({value:d,done:a})},r)}};let $ue=class{constructor(e,t,i){this.value=e,this.isComplete=t,this.hasLoadingMessage=i}};class qW extends H{constructor(e,t){super(),this._editor=e,this._computer=t,this._onResult=this._register(new A),this.onResult=this._onResult.event,this._firstWaitScheduler=this._register(new Dt(()=>this._triggerAsyncComputation(),0)),this._secondWaitScheduler=this._register(new Dt(()=>this._triggerSyncComputation(),0)),this._loadingMessageScheduler=this._register(new Dt(()=>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=Mj(e=>this._computer.computeAsync(e)),zue(this,void 0,void 0,function*(){var e,t,i,n;try{try{for(var s=!0,r=Uue(this._asyncIterable),a;a=yield r.next(),e=a.done,!e;s=!0){n=a.value,s=!1;const l=n;l&&(this._result.push(l),this._fireResult())}}catch(l){t={error:l}}finally{try{!s&&!e&&(i=r.return)&&(yield i.call(r))}finally{if(t)throw t.error}}this._asyncIterableDone=!0,(this._state===3||this._state===4)&&this._setState(0)}catch(l){He(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 $ue(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 vD{constructor(e,t,i,n){this.priority=e,this.range=t,this.initialMousePosX=i,this.initialMousePosY=n,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 c1{constructor(e,t,i,n,s,r){this.priority=e,this.owner=t,this.range=i,this.initialMousePosX=n,this.initialMousePosY=s,this.supportsMarkerHover=r,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 lf=new class{constructor(){this._participants=[]}register(e){this._participants.push(e)}getAll(){return this._participants}};class PM{constructor(){this._onDidWillResize=new A,this.onDidWillResize=this._onDidWillResize.event,this._onDidResize=new A,this.onDidResize=this._onDidResize.event,this._sashListener=new X,this._size=new gt(0,0),this._minSize=new gt(0,0),this._maxSize=new gt(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER),this.domNode=document.createElement("div"),this._eastSash=new Tn(this.domNode,{getVerticalSashLeft:()=>this._size.width},{orientation:0}),this._westSash=new Tn(this.domNode,{getVerticalSashLeft:()=>0},{orientation:0}),this._northSash=new Tn(this.domNode,{getHorizontalSashTop:()=>0},{orientation:1,orthogonalEdge:kw.North}),this._southSash=new Tn(this.domNode,{getHorizontalSashTop:()=>this._size.height},{orientation:1,orthogonalEdge:kw.South}),this._northSash.orthogonalStartSash=this._westSash,this._northSash.orthogonalEndSash=this._eastSash,this._southSash.orthogonalStartSash=this._westSash,this._southSash.orthogonalEndSash=this._eastSash;let e,t=0,i=0;this._sashListener.add(de.any(this._northSash.onDidStart,this._eastSash.onDidStart,this._southSash.onDidStart,this._westSash.onDidStart)(()=>{e===void 0&&(this._onDidWillResize.fire(),e=this._size,t=0,i=0)})),this._sashListener.add(de.any(this._northSash.onDidEnd,this._eastSash.onDidEnd,this._southSash.onDidEnd,this._westSash.onDidEnd)(()=>{e!==void 0&&(e=void 0,t=0,i=0,this._onDidResize.fire({dimension:this._size,done:!0}))})),this._sashListener.add(this._eastSash.onDidChange(n=>{e&&(i=n.currentX-n.startX,this.layout(e.height+t,e.width+i),this._onDidResize.fire({dimension:this._size,done:!1,east:!0}))})),this._sashListener.add(this._westSash.onDidChange(n=>{e&&(i=-(n.currentX-n.startX),this.layout(e.height+t,e.width+i),this._onDidResize.fire({dimension:this._size,done:!1,west:!0}))})),this._sashListener.add(this._northSash.onDidChange(n=>{e&&(t=-(n.currentY-n.startY),this.layout(e.height+t,e.width+i),this._onDidResize.fire({dimension:this._size,done:!1,north:!0}))})),this._sashListener.add(this._southSash.onDidChange(n=>{e&&(t=n.currentY-n.startY,this.layout(e.height+t,e.width+i),this._onDidResize.fire({dimension:this._size,done:!1,south:!0}))})),this._sashListener.add(de.any(this._eastSash.onDidReset,this._westSash.onDidReset)(n=>{this._preferredSize&&(this.layout(this._size.height,this._preferredSize.width),this._onDidResize.fire({dimension:this._size,done:!0}))})),this._sashListener.add(de.any(this._northSash.onDidReset,this._southSash.onDidReset)(n=>{this._preferredSize&&(this.layout(this._preferredSize.height,this._size.width),this._onDidResize.fire({dimension:this._size,done:!0}))}))}dispose(){this._northSash.dispose(),this._southSash.dispose(),this._eastSash.dispose(),this._westSash.dispose(),this._sashListener.dispose(),this._onDidResize.dispose(),this._onDidWillResize.dispose(),this.domNode.remove()}enableSashes(e,t,i,n){this._northSash.state=e?3:0,this._eastSash.state=t?3:0,this._southSash.state=i?3:0,this._westSash.state=n?3:0}layout(e=this.size.height,t=this.size.width){const{height:i,width:n}=this._minSize,{height:s,width:r}=this._maxSize;e=Math.max(i,Math.min(s,e)),t=Math.max(n,Math.min(r,t));const a=new gt(t,e);gt.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 jue=30,Kue=24;class que extends H{constructor(e,t=new gt(10,10)){super(),this._editor=e,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._resizableNode=this._register(new PM),this._contentPosition=null,this._isResizing=!1,this._resizableNode.domNode.style.position="absolute",this._resizableNode.minSize=gt.lift(t),this._resizableNode.layout(t.height,t.width),this._resizableNode.enableSashes(!0,!0,!0,!0),this._register(this._resizableNode.onDidResize(i=>{this._resize(new gt(i.dimension.width,i.dimension.height)),i.done&&(this._isResizing=!1)})),this._register(this._resizableNode.onDidWillResize(()=>{this._isResizing=!0}))}get isResizing(){return this._isResizing}getDomNode(){return this._resizableNode.domNode}getPosition(){return this._contentPosition}get position(){var e;return!((e=this._contentPosition)===null||e===void 0)&&e.position?P.lift(this._contentPosition.position):void 0}_availableVerticalSpaceAbove(e){const t=this._editor.getDomNode(),i=this._editor.getScrolledVisiblePosition(e);return!t||!i?void 0:Ai(t).top+i.top-jue}_availableVerticalSpaceBelow(e){const t=this._editor.getDomNode(),i=this._editor.getScrolledVisiblePosition(e);if(!t||!i)return;const n=Ai(t),s=Pp(t.ownerDocument.body),r=n.top+i.top+i.height;return s.height-r-Kue}_findPositionPreference(e,t){var i,n;const s=Math.min((i=this._availableVerticalSpaceBelow(t))!==null&&i!==void 0?i:1/0,e),r=Math.min((n=this._availableVerticalSpaceAbove(t))!==null&&n!==void 0?n:1/0,e),a=Math.min(Math.max(r,s),e),l=Math.min(e,a);let d;return this._editor.getOption(60).above?d=l<=r?1:2:d=l<=s?2:1,d===1?this._resizableNode.enableSashes(!0,!0,!1,!1):this._resizableNode.enableSashes(!1,!0,!0,!1),d}_resize(e){this._resizableNode.layout(e.height,e.width)}}var OM=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Zh=function(o,e){return function(t,i){e(t,i,o)}},h1,_a;const u5=te;let Yw=h1=class extends H{constructor(e,t,i){super(),this._editor=e,this._instantiationService=t,this._keybindingService=i,this._currentResult=null,this._widget=this._register(this._instantiationService.createInstance(gc,this._editor)),this._participants=[];for(const n of lf.getAll())this._participants.push(this._instantiationService.createInstance(n,this._editor));this._participants.sort((n,s)=>n.hoverOrdinal-s.hoverOrdinal),this._computer=new Qw(this._editor,this._participants),this._hoverOperation=this._register(new qW(this._editor,this._computer)),this._register(this._hoverOperation.onResult(n=>{if(!this._computer.anchor)return;const s=n.hasLoadingMessage?this._addLoadingMessage(n.value):n.value;this._withResult(new GW(this._computer.anchor,s,n.isComplete))})),this._register(wi(this._widget.getDomNode(),"keydown",n=>{n.equals(9)&&this.hide()})),this._register(ei.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 n of this._participants)if(n.suggestHoverAnchor){const s=n.suggestHoverAnchor(e);s&&t.push(s)}const i=e.target;if(i.type===6&&t.push(new vD(0,i.range,e.event.posx,e.event.posy)),i.type===7){const n=this._editor.getOption(50).typicalHalfwidthCharacterWidth/2;!i.detail.isAfterLines&&typeof i.detail.horizontalDistanceToText=="number"&&i.detail.horizontalDistanceToText<n&&t.push(new vD(0,i.range,e.event.posx,e.event.posy))}return t.length===0?this._startShowingOrUpdateHover(null,0,0,!1,e):(t.sort((n,s)=>s.priority-n.priority),this._startShowingOrUpdateHover(t[0],0,0,!1,e))}startShowingAtRange(e,t,i,n){this._startShowingOrUpdateHover(new vD(0,e,void 0,void 0),t,i,n,null)}_startShowingOrUpdateHover(e,t,i,n,s){return!this._widget.position||!this._currentResult?e?(this._startHoverOperationIfNecessary(e,t,i,n,!1),!0):!1:this._editor.getOption(60).sticky&&s&&this._widget.isMouseGettingCloser(s.event.posx,s.event.posy)?(e&&this._startHoverOperationIfNecessary(e,t,i,n,!0),!0):e?e&&this._currentResult.anchor.equals(e)?!0:e.canAdoptVisibleHover(this._currentResult.anchor,this._widget.position)?(this._setCurrentResult(this._currentResult.filter(e)),this._startHoverOperationIfNecessary(e,t,i,n,!1),!0):(this._setCurrentResult(null),this._startHoverOperationIfNecessary(e,t,i,n,!1),!0):(this._setCurrentResult(null),!1)}_startHoverOperationIfNecessary(e,t,i,n,s){this._computer.anchor&&this._computer.anchor.equals(e)||(this._hoverOperation.cancel(),this._computer.anchor=e,this._computer.shouldFocus=n,this._computer.source=i,this._computer.insistOnKeepingHoverVisible=s,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 i=t.createLoadingMessage(this._computer.anchor);if(i)return e.slice(0).concat([i])}}return e}_withResult(e){this._widget.position&&this._currentResult&&this._currentResult.isComplete&&(!e.isComplete||this._computer.insistOnKeepingHoverVisible&&e.messages.length===0)||this._setCurrentResult(e)}_renderMessages(e,t){const{showAtPosition:i,showAtSecondaryPosition:n,highlightRange:s}=h1.computeHoverRanges(this._editor,e.range,t),r=new X,a=r.add(new Xw(this._keybindingService)),l=document.createDocumentFragment();let d=null;const c={fragment:l,statusBar:a,setColorPicker:u=>d=u,onContentsChanged:()=>this._widget.onContentsChanged(),setMinimumDimensions:u=>this._widget.setMinimumDimensions(u),hide:()=>this.hide()};for(const u of this._participants){const f=t.filter(p=>p.owner===u);f.length>0&&r.add(u.renderHoverParts(c,f))}const h=t.some(u=>u.isBeforeContent);if(a.hasContent&&l.appendChild(a.hoverElement),l.hasChildNodes()){if(s){const u=this._editor.createDecorationsCollection();u.set([{range:s,options:h1._DECORATION_OPTIONS}]),r.add(Me(()=>{u.clear()}))}this._widget.showAt(l,new Zue(d,i,n,this._editor.getOption(60).above,this._computer.shouldFocus,this._computer.source,h,e.initialMousePosX,e.initialMousePosY,r))}else r.dispose()}static computeHoverRanges(e,t,i){let n=1;if(e.hasModel()){const d=e._getViewModel(),c=d.coordinatesConverter,h=c.convertModelRangeToViewRange(t),u=new P(h.startLineNumber,d.getLineMinColumn(h.startLineNumber));n=c.convertViewPositionToModelPosition(u).column}const s=t.startLineNumber;let r=t.startColumn,a=i[0].range,l=null;for(const d of i)a=L.plusRange(a,d.range),d.range.startLineNumber===s&&d.range.endLineNumber===s&&(r=Math.max(Math.min(r,d.range.startColumn),n)),d.forceShowAtRange&&(l=d.range);return{showAtPosition:l?l.getStartPosition():new P(s,t.startColumn),showAtSecondaryPosition:l?l.getStartPosition():new P(s,r),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()}};Yw._DECORATION_OPTIONS=Ve.register({description:"content-hover-highlight",className:"hoverHighlight"});Yw=h1=OM([Zh(1,Re),Zh(2,Nt)],Yw);class GW{constructor(e,t,i){this.anchor=e,this.messages=t,this.isComplete=i}filter(e){const t=this.messages.filter(i=>i.isValidForHoverAnchor(e));return t.length===this.messages.length?this:new Gue(this,this.anchor,t,this.isComplete)}}class Gue extends GW{constructor(e,t,i,n){super(t,i,n),this.original=e}filter(e){return this.original.filter(e)}}class Zue{constructor(e,t,i,n,s,r,a,l,d,c){this.colorPicker=e,this.showAtPosition=t,this.showAtSecondaryPosition=i,this.preferAbove=n,this.stoleFocus=s,this.source=r,this.isBeforeContent=a,this.initialMousePosX=l,this.initialMousePosY=d,this.disposables=c,this.closestMouseDistance=void 0}}const f5=30,bD=10,Yue=6;let gc=_a=class extends que{get isColorPickerVisible(){var e;return!!(!((e=this._visibleData)===null||e===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,i,n,s){const r=e.getOption(66)+8,a=150,l=new gt(a,r);super(e,l),this._configurationService=i,this._accessibilityService=n,this._keybindingService=s,this._hover=this._register(new KW),this._minimumSize=l,this._hoverVisibleKey=E.hoverVisible.bindTo(t),this._hoverFocusedKey=E.hoverFocused.bindTo(t),Y(this._resizableNode.domNode,this._hover.containerDomNode),this._resizableNode.domNode.style.zIndex="50",this._register(this._editor.onDidLayoutChange(()=>this._layout())),this._register(this._editor.onDidChangeConfiguration(c=>{c.hasChanged(50)&&this._updateFont()}));const d=this._register(Qa(this._resizableNode.domNode));this._register(d.onDidFocus(()=>{this._hoverFocusedKey.set(!0)})),this._register(d.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 _a.ID}static _applyDimensions(e,t,i){const n=typeof t=="number"?`${t}px`:t,s=typeof i=="number"?`${i}px`:i;e.style.width=n,e.style.height=s}_setContentsDomNodeDimensions(e,t){const i=this._hover.contentsDomNode;return _a._applyDimensions(i,e,t)}_setContainerDomNodeDimensions(e,t){const i=this._hover.containerDomNode;return _a._applyDimensions(i,e,t)}_setHoverWidgetDimensions(e,t){this._setContentsDomNodeDimensions(e,t),this._setContainerDomNodeDimensions(e,t),this._layoutContentWidget()}static _applyMaxDimensions(e,t,i){const n=typeof t=="number"?`${t}px`:t,s=typeof i=="number"?`${i}px`:i;e.style.maxWidth=n,e.style.maxHeight=s}_setHoverWidgetMaxDimensions(e,t){_a._applyMaxDimensions(this._hover.contentsDomNode,e,t),_a._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,i=e.height;this._setHoverWidgetDimensions(t,i),this._hasHorizontalScrollbar()&&(this._adjustContentsBottomPadding(),this._setContentsDomNodeDimensions(t,i-bD))}_updateResizableNodeMaxDimensions(){var e,t;const i=(e=this._findMaximumRenderingWidth())!==null&&e!==void 0?e:1/0,n=(t=this._findMaximumRenderingHeight())!==null&&t!==void 0?t:1/0;this._resizableNode.maxSize=new gt(i,n),this._setHoverWidgetMaxDimensions(i,n)}_resize(e){var t,i;_a._lastDimensions=new gt(e.width,e.height),this._setAdjustedHoverWidgetDimensions(e),this._resizableNode.layout(e.height,e.width),this._updateResizableNodeMaxDimensions(),this._hover.scrollbar.scanDomNode(),this._editor.layoutContentWidget(this),(i=(t=this._visibleData)===null||t===void 0?void 0:t.colorPicker)===null||i===void 0||i.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=Yue;return Array.from(this._hover.contentsDomNode.children).forEach(i=>{t+=i.clientHeight}),this._hasHorizontalScrollbar()&&(t+=bD),Math.min(e,t)}_isHoverTextOverflowing(){this._hover.containerDomNode.style.setProperty("--vscode-hover-whiteSpace","nowrap"),this._hover.containerDomNode.style.setProperty("--vscode-hover-sourceWhiteSpace","nowrap");const e=Array.from(this._hover.contentsDomNode.children).some(t=>t.scrollWidth>t.clientWidth);return this._hover.containerDomNode.style.removeProperty("--vscode-hover-whiteSpace"),this._hover.containerDomNode.style.removeProperty("--vscode-hover-sourceWhiteSpace"),e}_findMaximumRenderingWidth(){if(!this._editor||!this._editor.hasModel())return;const e=this._isHoverTextOverflowing(),t=typeof this._contentWidth>"u"?0:this._contentWidth-2;return e||this._hover.containerDomNode.clientWidth<t?Pp(this._hover.containerDomNode.ownerDocument.body).width-14:this._hover.containerDomNode.clientWidth+2}isMouseGettingCloser(e,t){if(!this._visibleData)return!1;if(typeof this._visibleData.initialMousePosX>"u"||typeof this._visibleData.initialMousePosY>"u")return this._visibleData.initialMousePosX=e,this._visibleData.initialMousePosY=t,!1;const i=Ai(this.getDomNode());typeof this._visibleData.closestMouseDistance>"u"&&(this._visibleData.closestMouseDistance=g5(this._visibleData.initialMousePosX,this._visibleData.initialMousePosY,i.left,i.top,i.width,i.height));const n=g5(e,t,i.left,i.top,i.width,i.height);return n>this._visibleData.closestMouseDistance+4?!1:(this._visibleData.closestMouseDistance=Math.min(this._visibleData.closestMouseDistance,n),!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),i=this._hover.contentsDomNode;i.style.fontSize=`${e}px`,i.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,_a._lastDimensions.height),t=Math.max(this._editor.getLayoutInfo().width*.66,500,_a._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 i,n,s,r;if(!this._editor||!this._editor.hasModel())return;this._render(e,t);const a=Hh(this._hover.containerDomNode),l=t.showAtPosition;this._positionPreference=(i=this._findPositionPreference(a,l))!==null&&i!==void 0?i:1,this.onContentsChanged(),t.stoleFocus&&this._hover.containerDomNode.focus(),(n=t.colorPicker)===null||n===void 0||n.layout();const d=Hue(this._configurationService.getValue("accessibility.verbosity.hover")===!0&&this._accessibilityService.isScreenReaderOptimized(),(r=(s=this._keybindingService.lookupKeybinding("editor.action.accessibleView"))===null||s===void 0?void 0:s.getAriaLabel())!==null&&r!==void 0?r:"");d&&(this._hover.contentsDomNode.ariaLabel=this._hover.contentsDomNode.textContent+", "+d)}hide(){if(!this._visibleData)return;const e=this._visibleData.stoleFocus||this._hoverFocusedKey.get();this._setHoverData(void 0),this._resizableNode.maxSize=new gt(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 i=this._hover.containerDomNode,n=this._hover.contentsDomNode,s=(t=this._findMaximumRenderingHeight())!==null&&t!==void 0?t:1/0;this._setContainerDomNodeDimensions(ps(i),Math.min(s,e)),this._setContentsDomNodeDimensions(ps(n),Math.min(s,e-bD))}setMinimumDimensions(e){this._minimumSize=new gt(Math.max(this._minimumSize.width,e.width),Math.max(this._minimumSize.height,e.height)),this._updateMinimumWidth()}_updateMinimumWidth(){const e=typeof this._contentWidth>"u"?this._minimumSize.width:Math.min(this._contentWidth,this._minimumSize.width);this._resizableNode.minSize=new gt(e,this._minimumSize.height)}onContentsChanged(){var e;this._removeConstraintsRenderNormally();const t=this._hover.containerDomNode;let i=Hh(t),n=ps(t);if(this._resizableNode.layout(i,n),this._setHoverWidgetDimensions(n,i),i=Hh(t),n=ps(t),this._contentWidth=n,this._updateMinimumWidth(),this._resizableNode.layout(i,n),this._hasHorizontalScrollbar()&&(this._adjustContentsBottomPadding(),this._adjustHoverHeightForScrollbar(i)),!((e=this._visibleData)===null||e===void 0)&&e.showAtPosition){const s=Hh(this._hover.containerDomNode);this._positionPreference=this._findPositionPreference(s,this._visibleData.showAtPosition)}this._layoutContentWidget()}focus(){this._hover.containerDomNode.focus()}scrollUp(){const e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._editor.getOption(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-f5})}scrollRight(){const e=this._hover.scrollbar.getScrollPosition().scrollLeft;this._hover.scrollbar.setScrollPosition({scrollLeft:e+f5})}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})}};gc.ID="editor.contrib.resizableContentHoverWidget";gc._lastDimensions=new gt(0,0);gc=_a=OM([Zh(1,Ae),Zh(2,st),Zh(3,hd),Zh(4,Nt)],gc);let Xw=class extends H{get hasContent(){return this._hasContent}constructor(e){super(),this._keybindingService=e,this._hasContent=!1,this.hoverElement=u5("div.hover-row.status-bar"),this.actionsElement=Y(this.hoverElement,u5("div.actions"))}addAction(e){const t=this._keybindingService.lookupKeybinding(e.commandId),i=t?t.getLabel():null;return this._hasContent=!0,this._register(AM.render(this.actionsElement,e,i))}append(e){const t=Y(this.actionsElement,e);return this._hasContent=!0,t}};Xw=OM([Zh(0,Nt)],Xw);class Qw{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 i=e.getModel(),n=t.range.startLineNumber;if(n>i.getLineCount())return[];const s=i.getLineMaxColumn(n);return e.getLineDecorations(n).filter(r=>{if(r.options.isWholeLine)return!0;const a=r.range.startLineNumber===n?r.range.startColumn:1,l=r.range.endLineNumber===n?r.range.endColumn:s;if(r.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 ki.EMPTY;const i=Qw._getLineDecorations(this._editor,t);return ki.merge(this._participants.map(n=>n.computeAsync?n.computeAsync(t,i,e):ki.EMPTY))}computeSync(){if(!this._editor.hasModel()||!this._anchor)return[];const e=Qw._getLineDecorations(this._editor,this._anchor);let t=[];for(const i of this._participants)t=t.concat(i.computeSync(this._anchor,e));return Za(t)}}function g5(o,e,t,i,n,s){const r=t+n/2,a=i+s/2,l=Math.max(Math.abs(o-r)-n/2,0),d=Math.max(Math.abs(e-a)-s/2,0);return Math.sqrt(l*l+d*d)}const p5=te;class Bg extends H{constructor(e,t,i){super(),this._renderDisposeables=this._register(new X),this._editor=e,this._isVisible=!1,this._messages=[],this._hover=this._register(new KW),this._hover.containerDomNode.classList.toggle("hidden",!this._isVisible),this._markdownRenderer=this._register(new dd({editor:this._editor},t,i)),this._computer=new Xue(this._editor),this._hoverOperation=this._register(new qW(this._editor,this._computer)),this._register(this._hoverOperation.onResult(n=>{this._withResult(n.value)})),this._register(this._editor.onDidChangeModelDecorations(()=>this._onModelDecorationsChanged())),this._register(this._editor.onDidChangeConfiguration(n=>{n.hasChanged(50)&&this._updateFont()})),this._editor.addOverlayWidget(this)}dispose(){this._editor.removeOverlayWidget(this),super.dispose()}getId(){return Bg.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 i=document.createDocumentFragment();for(const n of t){const s=p5("div.hover-row.markdown-hover"),r=Y(s,p5("div.hover-contents")),a=this._renderDisposeables.add(this._markdownRenderer.render(n.value));r.appendChild(a.element),i.appendChild(s)}this._updateContents(i),this._showAt(e)}_updateContents(e){this._hover.contentsDomNode.textContent="",this._hover.contentsDomNode.appendChild(e),this._updateFont()}_showAt(e){this._isVisible||(this._isVisible=!0,this._hover.containerDomNode.classList.toggle("hidden",!this._isVisible));const t=this._editor.getLayoutInfo(),i=this._editor.getTopForLineNumber(e),n=this._editor.getScrollTop(),s=this._editor.getOption(66),r=this._hover.containerDomNode.clientHeight,a=i-n-(r-s)/2;this._hover.containerDomNode.style.left=`${t.glyphMarginLeft+t.glyphMarginWidth}px`,this._hover.containerDomNode.style.top=`${Math.max(Math.round(a),0)}px`}}Bg.ID="editor.contrib.modesGlyphHoverWidget";class Xue{get lineNumber(){return this._lineNumber}set lineNumber(e){this._lineNumber=e}constructor(e){this._editor=e,this._lineNumber=-1}computeSync(){const e=n=>({value:n}),t=this._editor.getLineDecorations(this._lineNumber),i=[];if(!t)return i;for(const n of t){if(!n.options.glyphMarginClassName)continue;const s=n.options.glyphMarginHoverMessage;!s||hp(s)||i.push(...i2(s).map(e))}return i}}var Que=function(o,e,t,i){function n(s){return s instanceof t?s:new t(function(r){r(s)})}return new(t||(t=Promise))(function(s,r){function a(c){try{d(i.next(c))}catch(h){r(h)}}function l(c){try{d(i.throw(c))}catch(h){r(h)}}function d(c){c.done?s(c.value):n(c.value).then(a,l)}d((i=i.apply(o,e||[])).next())})};class Jue{constructor(e,t,i){this.provider=e,this.hover=t,this.ordinal=i}}function efe(o,e,t,i,n){return Que(this,void 0,void 0,function*(){try{const s=yield Promise.resolve(o.provideHover(t,i,n));if(s&&ife(s))return new Jue(o,s,e)}catch(s){Ni(s)}})}function FM(o,e,t,i){const s=o.ordered(e).map((r,a)=>efe(r,a,e,t,i));return ki.fromPromises(s).coalesce()}function tfe(o,e,t,i){return FM(o,e,t,i).map(n=>n.hover).toPromise()}hl("_executeHoverProvider",(o,e,t)=>{const i=o.get(pe);return tfe(i.hoverProvider,e,t,Qe.None)});function ife(o){const e=typeof o.range<"u",t=typeof o.contents<"u"&&o.contents&&o.contents.length>0;return e&&t}var nfe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},hC=function(o,e){return function(t,i){e(t,i,o)}};const m5=te;class Vr{constructor(e,t,i,n,s){this.owner=e,this.range=t,this.contents=i,this.isBeforeContent=n,this.ordinal=s}isValidForHoverAnchor(e){return e.type===1&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}let Jw=class{constructor(e,t,i,n,s){this._editor=e,this._languageService=t,this._openerService=i,this._configurationService=n,this._languageFeaturesService=s,this.hoverOrdinal=3}createLoadingMessage(e){return new Vr(this,e.range,[new xn().appendText(g("modesContentHover.loading","Loading..."))],!1,2e3)}computeSync(e,t){if(!this._editor.hasModel()||e.type!==1)return[];const i=this._editor.getModel(),n=e.range.startLineNumber,s=i.getLineMaxColumn(n),r=[];let a=1e3;const l=i.getLineLength(n),d=i.getLanguageIdAtPosition(e.range.startLineNumber,e.range.startColumn),c=this._editor.getOption(116),h=this._configurationService.getValue("editor.maxTokenizationLineLength",{overrideIdentifier:d});let u=!1;c>=0&&l>c&&e.range.startColumn>=c&&(u=!0,r.push(new Vr(this,e.range,[{value:g("stopped rendering","Rendering paused for long line for performance reasons. This can be configured via `editor.stopRenderingLineAfter`.")}],!1,a++))),!u&&typeof h=="number"&&l>=h&&r.push(new Vr(this,e.range,[{value:g("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 p of t){const m=p.range.startLineNumber===n?p.range.startColumn:1,v=p.range.endLineNumber===n?p.range.endColumn:s,_=p.options.hoverMessage;if(!_||hp(_))continue;p.options.beforeContentClassName&&(f=!0);const b=new L(e.range.startLineNumber,m,e.range.startLineNumber,v);r.push(new Vr(this,b,i2(_),f,a++))}return r}computeAsync(e,t,i){if(!this._editor.hasModel()||e.type!==1)return ki.EMPTY;const n=this._editor.getModel();if(!this._languageFeaturesService.hoverProvider.has(n))return ki.EMPTY;const s=new P(e.range.startLineNumber,e.range.startColumn);return FM(this._languageFeaturesService.hoverProvider,n,s,i).filter(r=>!hp(r.hover.contents)).map(r=>{const a=r.hover.range?L.lift(r.hover.range):e.range;return new Vr(this,a,r.hover.contents,!1,r.ordinal)})}renderHoverParts(e,t){return ZW(e,t,this._editor,this._languageService,this._openerService)}};Jw=nfe([hC(1,qt),hC(2,zs),hC(3,st),hC(4,pe)],Jw);function ZW(o,e,t,i,n){e.sort((r,a)=>r.ordinal-a.ordinal);const s=new X;for(const r of e)for(const a of r.contents){if(hp(a))continue;const l=m5("div.hover-row.markdown-hover"),d=Y(l,m5("div.hover-contents")),c=s.add(new dd({editor:t},i,n));s.add(c.onDidRenderAsync(()=>{d.className="hover-contents code-hover-contents",o.onContentsChanged()}));const h=s.add(c.render(a));d.appendChild(h.element),o.fragment.appendChild(l)}return s}var YW=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},eS=function(o,e){return function(t,i){e(t,i,o)}};class _5{constructor(e,t,i){this.marker=e,this.index=t,this.total=i}}let RN=class{constructor(e,t,i){this._markerService=t,this._configService=i,this._onDidChange=new A,this.onDidChange=this._onDidChange.event,this._dispoables=new X,this._markers=[],this._nextIdx=-1,ke.isUri(e)?this._resourceFilter=a=>a.toString()===e.toString():e&&(this._resourceFilter=e);const n=this._configService.getValue("problems.sortOrder"),s=(a,l)=>{let d=K_(a.resource.toString(),l.resource.toString());return d===0&&(n==="position"?d=L.compareRangesUsingStarts(a,l)||ni.compare(a.severity,l.severity):d=ni.compare(a.severity,l.severity)||L.compareRangesUsingStarts(a,l)),d},r=()=>{this._markers=this._markerService.read({resource:ke.isUri(e)?e:void 0,severities:ni.Error|ni.Warning|ni.Info}),typeof e=="function"&&(this._markers=this._markers.filter(a=>this._resourceFilter(a.resource))),this._markers.sort(s)};r(),this._dispoables.add(t.onMarkerChanged(a=>{(!this._resourceFilter||a.some(l=>this._resourceFilter(l)))&&(r(),this._nextIdx=-1,this._onDidChange.fire())}))}dispose(){this._dispoables.dispose(),this._onDidChange.dispose()}matches(e){return!this._resourceFilter&&!e?!0:!this._resourceFilter||!e?!1:this._resourceFilter(e)}get selected(){const e=this._markers[this._nextIdx];return e&&new _5(e,this._nextIdx+1,this._markers.length)}_initIdx(e,t,i){let n=!1,s=this._markers.findIndex(r=>r.resource.toString()===e.uri.toString());s<0&&(s=B_(this._markers,{resource:e.uri},(r,a)=>K_(r.resource.toString(),a.resource.toString())),s<0&&(s=~s));for(let r=s;r<this._markers.length;r++){let a=L.lift(this._markers[r]);if(a.isEmpty()){const l=e.getWordAtPosition(a.getStartPosition());l&&(a=new L(a.startLineNumber,l.startColumn,a.startLineNumber,l.endColumn))}if(t&&(a.containsPosition(t)||t.isBeforeOrEqual(a.getStartPosition()))){this._nextIdx=r,n=!0;break}if(this._markers[r].resource.toString()!==e.uri.toString())break}n||(this._nextIdx=i?0:this._markers.length-1),this._nextIdx<0&&(this._nextIdx=this._markers.length-1)}resetIndex(){this._nextIdx=-1}move(e,t,i){if(this._markers.length===0)return!1;const n=this._nextIdx;return this._nextIdx===-1?this._initIdx(t,i,e):e?this._nextIdx=(this._nextIdx+1)%this._markers.length:e||(this._nextIdx=(this._nextIdx-1+this._markers.length)%this._markers.length),n!==this._nextIdx}find(e,t){let i=this._markers.findIndex(n=>n.resource.toString()===e.toString());if(!(i<0)){for(;i<this._markers.length;i++)if(L.containsPosition(this._markers[i],t))return new _5(this._markers[i],i+1,this._markers.length)}}};RN=YW([eS(1,ul),eS(2,st)],RN);const XW=et("IMarkerNavigationService");let MN=class{constructor(e,t){this._markerService=e,this._configService=t,this._provider=new ns}getMarkerList(e){for(const t of this._provider){const i=t.getMarkerList(e);if(i)return i}return new RN(e,this._markerService,this._configService)}};MN=YW([eS(0,ul),eS(1,st)],MN);dt(XW,MN,1);var AN;(function(o){function e(t){switch(t){case gi.Ignore:return"severity-ignore "+Ie.asClassName(oe.info);case gi.Info:return Ie.asClassName(oe.info);case gi.Warning:return Ie.asClassName(oe.warning);case gi.Error:return Ie.asClassName(oe.error);default:return""}}o.className=e})(AN||(AN={}));var sfe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Lf=function(o,e){return function(t,i){e(t,i,o)}},PN;class ofe{constructor(e,t,i,n,s){this._openerService=n,this._labelService=s,this._lines=0,this._longestLineLength=0,this._relatedDiagnostics=new WeakMap,this._disposables=new X,this._editor=t;const r=document.createElement("div");r.className="descriptioncontainer",this._messageBlock=document.createElement("div"),this._messageBlock.classList.add("message"),this._messageBlock.setAttribute("aria-live","assertive"),this._messageBlock.setAttribute("role","alert"),r.appendChild(this._messageBlock),this._relatedBlock=document.createElement("div"),r.appendChild(this._relatedBlock),this._disposables.add(wi(this._relatedBlock,"click",a=>{a.preventDefault();const l=this._relatedDiagnostics.get(a.target);l&&i(l)})),this._scrollable=new K7(r,{horizontal:1,vertical:1,useShadows:!1,horizontalScrollbarSize:6,verticalScrollbarSize:6}),e.appendChild(this._scrollable.getDomNode()),this._disposables.add(this._scrollable.onScroll(a=>{r.style.left=`-${a.scrollLeft}px`,r.style.top=`-${a.scrollTop}px`})),this._disposables.add(this._scrollable)}dispose(){St(this._disposables)}update(e){const{source:t,message:i,relatedInformation:n,code:s}=e;let r=(t?.length||0)+2;s&&(typeof s=="string"?r+=s.length:r+=s.value.length);const a=Xa(i);this._lines=a.length,this._longestLineLength=0;for(const u of a)this._longestLineLength=Math.max(u.length+r,this._longestLineLength);fn(this._messageBlock),this._messageBlock.setAttribute("aria-label",this.getAriaLabel(e)),this._editor.applyFontInfo(this._messageBlock);let l=this._messageBlock;for(const u of a)l=document.createElement("div"),l.innerText=u,u===""&&(l.style.height=this._messageBlock.style.lineHeight),this._messageBlock.appendChild(l);if(t||s){const u=document.createElement("span");if(u.classList.add("details"),l.appendChild(u),t){const f=document.createElement("span");f.innerText=t,f.classList.add("source"),u.appendChild(f)}if(s)if(typeof s=="string"){const f=document.createElement("span");f.innerText=`(${s})`,f.classList.add("code"),u.appendChild(f)}else{this._codeLink=te("a.code-link"),this._codeLink.setAttribute("href",`${s.target.toString()}`),this._codeLink.onclick=p=>{this._openerService.open(s.target,{allowCommands:!0}),p.preventDefault(),p.stopPropagation()};const f=Y(this._codeLink,te("span"));f.innerText=s.value,u.appendChild(this._codeLink)}}if(fn(this._relatedBlock),this._editor.applyFontInfo(this._relatedBlock),Fn(n)){const u=this._relatedBlock.appendChild(document.createElement("div"));u.style.paddingTop=`${Math.floor(this._editor.getOption(66)*.66)}px`,this._lines+=1;for(const f of n){const p=document.createElement("div"),m=document.createElement("a");m.classList.add("filename"),m.innerText=`${this._labelService.getUriBasenameLabel(f.resource)}(${f.startLineNumber}, ${f.startColumn}): `,m.title=this._labelService.getUriLabel(f.resource),this._relatedDiagnostics.set(m,f);const v=document.createElement("span");v.innerText=f.message,p.appendChild(m),p.appendChild(v),this._lines+=1,u.appendChild(p)}}const d=this._editor.getOption(50),c=Math.ceil(d.typicalFullwidthCharacterWidth*this._longestLineLength*.75),h=d.lineHeight*this._lines;this._scrollable.setScrollDimensions({scrollWidth:c,scrollHeight:h})}layout(e,t){this._scrollable.getDomNode().style.height=`${e}px`,this._scrollable.getDomNode().style.width=`${t}px`,this._scrollable.setScrollDimensions({width:t,height:e})}getHeightInLines(){return Math.min(17,this._lines)}getAriaLabel(e){let t="";switch(e.severity){case ni.Error:t=g("Error","Error");break;case ni.Warning:t=g("Warning","Warning");break;case ni.Info:t=g("Info","Info");break;case ni.Hint:t=g("Hint","Hint");break}let i=g("marker aria","{0} at {1}. ",t,e.startLineNumber+":"+e.startColumn);const n=this._editor.getModel();return n&&e.startLineNumber<=n.getLineCount()&&e.startLineNumber>=1&&(i=`${n.getLineContent(e.startLineNumber)}, ${i}`),i}}let wp=PN=class extends Zw{constructor(e,t,i,n,s,r,a){super(e,{showArrow:!0,showFrame:!0,isAccessible:!0,frameWidth:1},s),this._themeService=t,this._openerService=i,this._menuService=n,this._contextKeyService=r,this._labelService=a,this._callOnDispose=new X,this._onDidSelectRelatedInformation=new A,this.onDidSelectRelatedInformation=this._onDidSelectRelatedInformation.event,this._severity=ni.Warning,this._backgroundColor=V.white,this._applyTheme(t.getColorTheme()),this._callOnDispose.add(t.onDidColorThemeChange(this._applyTheme.bind(this))),this.create()}_applyTheme(e){this._backgroundColor=e.getColor(dfe);let t=ON,i=rfe;this._severity===ni.Warning?(t=u1,i=afe):this._severity===ni.Info&&(t=FN,i=lfe);const n=e.getColor(t),s=e.getColor(i);this.style({arrowColor:n,frameColor:n,headerBackgroundColor:s,primaryHeadingColor:e.getColor(OW),secondaryHeadingColor:e.getColor(FW)})}_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(n=>this.editor.focus()));const t=[],i=this._menuService.createMenu(PN.TitleMenu,this._contextKeyService);DB(i,void 0,t),this._actionbarWidget.push(t,{label:!1,icon:!0,index:0}),i.dispose()}_fillTitleIcon(e){this._icon=Y(e,te(""))}_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 ofe(this._container,this.editor,t=>this._onDidSelectRelatedInformation.fire(t),this._openerService,this._labelService),this._disposables.add(this._message)}show(){throw new Error("call showAtMarker")}showAtMarker(e,t,i){this._container.classList.remove("stale"),this._message.update(e),this._severity=e.severity,this._applyTheme(this._themeService.getColorTheme());const n=L.lift(e),s=this.editor.getPosition(),r=s&&n.containsPosition(s)?s:n.getStartPosition();super.show(r,this.computeRequiredHeight());const a=this.editor.getModel();if(a){const l=i>1?g("problems","{0} of {1} problems",t,i):g("change","{0} of {1} problem",t,i);this.setTitle(Bo(a.uri),l)}this._icon.className=`codicon ${AN.className(ni.toSeverity(this._severity))}`,this.editor.revealPositionNearTop(r,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()}};wp.TitleMenu=new k("gotoErrorTitleMenu");wp=PN=sfe([Lf(1,Ki),Lf(2,zs),Lf(3,dl),Lf(4,Re),Lf(5,Ae),Lf(6,lp)],wp);const v5=cv(Ba,KG),b5=cv(no,lv),C5=cv(bs,dv),ON=T("editorMarkerNavigationError.background",{dark:v5,light:v5,hcDark:nt,hcLight:nt},g("editorMarkerNavigationError","Editor marker navigation widget error color.")),rfe=T("editorMarkerNavigationError.headerBackground",{dark:we(ON,.1),light:we(ON,.1),hcDark:null,hcLight:null},g("editorMarkerNavigationErrorHeaderBackground","Editor marker navigation widget error heading background.")),u1=T("editorMarkerNavigationWarning.background",{dark:b5,light:b5,hcDark:nt,hcLight:nt},g("editorMarkerNavigationWarning","Editor marker navigation widget warning color.")),afe=T("editorMarkerNavigationWarning.headerBackground",{dark:we(u1,.1),light:we(u1,.1),hcDark:"#0C141F",hcLight:we(u1,.2)},g("editorMarkerNavigationWarningBackground","Editor marker navigation widget warning heading background.")),FN=T("editorMarkerNavigationInfo.background",{dark:C5,light:C5,hcDark:nt,hcLight:nt},g("editorMarkerNavigationInfo","Editor marker navigation widget info color.")),lfe=T("editorMarkerNavigationInfo.headerBackground",{dark:we(FN,.1),light:we(FN,.1),hcDark:null,hcLight:null},g("editorMarkerNavigationInfoHeaderBackground","Editor marker navigation widget info heading background.")),dfe=T("editorMarkerNavigation.background",{dark:ji,light:ji,hcDark:ji,hcLight:ji},g("editorMarkerNavigationBackground","Editor marker navigation widget background."));var cfe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},uC=function(o,e){return function(t,i){e(t,i,o)}},QW=function(o,e,t,i){function n(s){return s instanceof t?s:new t(function(r){r(s)})}return new(t||(t=Promise))(function(s,r){function a(c){try{d(i.next(c))}catch(h){r(h)}}function l(c){try{d(i.throw(c))}catch(h){r(h)}}function d(c){c.done?s(c.value):n(c.value).then(a,l)}d((i=i.apply(o,e||[])).next())})},t_;let Vc=t_=class{static get(e){return e.getContribution(t_.ID)}constructor(e,t,i,n,s){this._markerNavigationService=t,this._contextKeyService=i,this._editorService=n,this._instantiationService=s,this._sessionDispoables=new X,this._editor=e,this._widgetVisible=JW.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(wp,this._editor),this._widget.onDidClose(()=>this.close(),this,this._sessionDispoables),this._widgetVisible.set(!0),this._sessionDispoables.add(this._model),this._sessionDispoables.add(this._widget),this._sessionDispoables.add(this._editor.onDidChangeCursorPosition(i=>{var n,s,r;(!(!((n=this._model)===null||n===void 0)&&n.selected)||!L.containsPosition((s=this._model)===null||s===void 0?void 0:s.selected.marker,i.position))&&((r=this._model)===null||r===void 0||r.resetIndex())})),this._sessionDispoables.add(this._model.onDidChange(()=>{if(!this._widget||!this._widget.position||!this._model)return;const i=this._model.find(this._editor.getModel().uri,this._widget.position);i?this._widget.updateMarker(i.marker):this._widget.showStale()})),this._sessionDispoables.add(this._widget.onDidSelectRelatedInformation(i=>{this._editorService.openCodeEditor({resource:i.resource,options:{pinned:!0,revealIfOpened:!0,selection:L.lift(i).collapseToStart()}},this._editor),this.close(!1)})),this._sessionDispoables.add(this._editor.onDidChangeModel(()=>this._cleanUp())),this._model}close(e=!0){this._cleanUp(),e&&this._editor.focus()}showAtMarker(e){if(this._editor.hasModel()){const t=this._getOrCreateModel(this._editor.getModel().uri);t.resetIndex(),t.move(!0,this._editor.getModel(),new P(e.startLineNumber,e.startColumn)),t.selected&&this._widget.showAtMarker(t.selected.marker,t.selected.index,t.selected.total)}}nagivate(e,t){var i,n;return QW(this,void 0,void 0,function*(){if(this._editor.hasModel()){const s=this._getOrCreateModel(t?void 0:this._editor.getModel().uri);if(s.move(e,this._editor.getModel(),this._editor.getPosition()),!s.selected)return;if(s.selected.marker.resource.toString()!==this._editor.getModel().uri.toString()){this._cleanUp();const r=yield this._editorService.openCodeEditor({resource:s.selected.marker.resource,options:{pinned:!1,revealIfOpened:!0,selectionRevealType:2,selection:s.selected.marker}},this._editor);r&&((i=t_.get(r))===null||i===void 0||i.close(),(n=t_.get(r))===null||n===void 0||n.nagivate(e,t))}else this._widget.showAtMarker(s.selected.marker,s.selected.index,s.selected.total)}})}};Vc.ID="editor.contrib.markerController";Vc=t_=cfe([uC(1,XW),uC(2,Ae),uC(3,_t),uC(4,Re)],Vc);class Jy extends fe{constructor(e,t,i){super(i),this._next=e,this._multiFile=t}run(e,t){var i;return QW(this,void 0,void 0,function*(){t.hasModel()&&((i=Vc.get(t))===null||i===void 0||i.nagivate(this._next,this._multiFile))})}}class pc extends Jy{constructor(){super(!0,!1,{id:pc.ID,label:pc.LABEL,alias:"Go to Next Problem (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:E.focus,primary:578,weight:100},menuOpts:{menuId:wp.TitleMenu,title:pc.LABEL,icon:_i("marker-navigation-next",oe.arrowDown,g("nextMarkerIcon","Icon for goto next marker.")),group:"navigation",order:1}})}}pc.ID="editor.action.marker.next";pc.LABEL=g("markerAction.next.label","Go to Next Problem (Error, Warning, Info)");class ou extends Jy{constructor(){super(!1,!1,{id:ou.ID,label:ou.LABEL,alias:"Go to Previous Problem (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:E.focus,primary:1602,weight:100},menuOpts:{menuId:wp.TitleMenu,title:ou.LABEL,icon:_i("marker-navigation-previous",oe.arrowUp,g("previousMarkerIcon","Icon for goto previous marker.")),group:"navigation",order:2}})}}ou.ID="editor.action.marker.prev";ou.LABEL=g("markerAction.previous.label","Go to Previous Problem (Error, Warning, Info)");class hfe extends Jy{constructor(){super(!0,!0,{id:"editor.action.marker.nextInFiles",label:g("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:E.focus,primary:66,weight:100},menuOpts:{menuId:k.MenubarGoMenu,title:g({key:"miGotoNextProblem",comment:["&& denotes a mnemonic"]},"Next &&Problem"),group:"6_problem_nav",order:1}})}}class ufe extends Jy{constructor(){super(!1,!0,{id:"editor.action.marker.prevInFiles",label:g("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:E.focus,primary:1090,weight:100},menuOpts:{menuId:k.MenubarGoMenu,title:g({key:"miGotoPreviousProblem",comment:["&& denotes a mnemonic"]},"Previous &&Problem"),group:"6_problem_nav",order:2}})}}ft(Vc.ID,Vc,4);ne(pc);ne(ou);ne(hfe);ne(ufe);const JW=new ce("markersNavigationVisible",!1),ffe=tn.bindToContribution(Vc.get);re(new ffe({id:"closeMarkersNavigation",precondition:JW,handler:o=>o.close(),kbOpts:{weight:150,kbExpr:E.focus,primary:9,secondary:[1033]}}));var gfe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},CD=function(o,e){return function(t,i){e(t,i,o)}};const Go=te;class pfe{constructor(e,t,i){this.owner=e,this.range=t,this.marker=i}isValidForHoverAnchor(e){return e.type===1&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}const w5={type:1,filter:{include:Ne.QuickFix},triggerAction:Vs.QuickFixHover};let BN=class{constructor(e,t,i,n){this._editor=e,this._markerDecorationsService=t,this._openerService=i,this._languageFeaturesService=n,this.hoverOrdinal=1,this.recentMarkerCodeActionsInfo=void 0}computeSync(e,t){if(!this._editor.hasModel()||e.type!==1&&!e.supportsMarkerHover)return[];const i=this._editor.getModel(),n=e.range.startLineNumber,s=i.getLineMaxColumn(n),r=[];for(const a of t){const l=a.range.startLineNumber===n?a.range.startColumn:1,d=a.range.endLineNumber===n?a.range.endColumn:s,c=this._markerDecorationsService.getMarker(i.uri,a);if(!c)continue;const h=new L(e.range.startLineNumber,l,e.range.startLineNumber,d);r.push(new pfe(this,h,c))}return r}renderHoverParts(e,t){if(!t.length)return H.None;const i=new X;t.forEach(s=>e.fragment.appendChild(this.renderMarkerHover(s,i)));const n=t.length===1?t[0]:t.sort((s,r)=>ni.compare(s.marker.severity,r.marker.severity))[0];return this.renderMarkerStatusbar(e,n,i),i}renderMarkerHover(e,t){const i=Go("div.hover-row"),n=Y(i,Go("div.marker.hover-contents")),{source:s,message:r,code:a,relatedInformation:l}=e.marker;this._editor.applyFontInfo(n);const d=Y(n,Go("span"));if(d.style.whiteSpace="pre-wrap",d.innerText=r,s||a)if(a&&typeof a!="string"){const c=Go("span");if(s){const p=Y(c,Go("span"));p.innerText=s}const h=Y(c,Go("a.code-link"));h.setAttribute("href",a.target.toString()),t.add($(h,"click",p=>{this._openerService.open(a.target,{allowCommands:!0}),p.preventDefault(),p.stopPropagation()}));const u=Y(h,Go("span"));u.innerText=a.value;const f=Y(n,c);f.style.opacity="0.6",f.style.paddingLeft="6px"}else{const c=Y(n,Go("span"));c.style.opacity="0.6",c.style.paddingLeft="6px",c.innerText=s&&a?`${s}(${a})`:s||`(${a})`}if(Fn(l))for(const{message:c,resource:h,startLineNumber:u,startColumn:f}of l){const p=Y(n,Go("div"));p.style.marginTop="8px";const m=Y(p,Go("a"));m.innerText=`${Bo(h)}(${u}, ${f}): `,m.style.cursor="pointer",t.add($(m,"click",_=>{_.stopPropagation(),_.preventDefault(),this._openerService&&this._openerService.open(h,{fromUserGesture:!0,editorOptions:{selection:{startLineNumber:u,startColumn:f}}}).catch(He)}));const v=Y(p,Go("span"));v.innerText=c,this._editor.applyFontInfo(v)}return i}renderMarkerStatusbar(e,t,i){if((t.marker.severity===ni.Error||t.marker.severity===ni.Warning||t.marker.severity===ni.Info)&&e.statusBar.addAction({label:g("view problem","View Problem"),commandId:pc.ID,run:()=>{var n;e.hide(),(n=Vc.get(this._editor))===null||n===void 0||n.showAtMarker(t.marker),this._editor.focus()}}),!this._editor.getOption(90)){const n=e.statusBar.append(Go("div"));this.recentMarkerCodeActionsInfo&&(xw.makeKey(this.recentMarkerCodeActionsInfo.marker)===xw.makeKey(t.marker)?this.recentMarkerCodeActionsInfo.hasCodeActions||(n.textContent=g("noQuickFixes","No quick fixes available")):this.recentMarkerCodeActionsInfo=void 0);const s=this.recentMarkerCodeActionsInfo&&!this.recentMarkerCodeActionsInfo.hasCodeActions?H.None:i.add(xc(()=>n.textContent=g("checkingForQuickFixes","Checking for quick fixes..."),200));n.textContent||(n.textContent=" ");const r=this.getCodeActions(t.marker);i.add(Me(()=>r.cancel())),r.then(a=>{if(s.dispose(),this.recentMarkerCodeActionsInfo={marker:t.marker,hasCodeActions:a.validActions.length>0},!this.recentMarkerCodeActionsInfo.hasCodeActions){a.dispose(),n.textContent=g("noQuickFixes","No quick fixes available");return}n.style.display="none";let l=!1;i.add(Me(()=>{l||a.dispose()})),e.statusBar.addAction({label:g("quick fixes","Quick Fix..."),commandId:DM,run:d=>{l=!0;const c=Pc.get(this._editor),h=Ai(d);e.hide(),c?.showCodeActions(w5,a,{x:h.left,y:h.top,width:h.width,height:h.height})}})},He)}}getCodeActions(e){return Wi(t=>I_(this._languageFeaturesService.codeActionProvider,this._editor.getModel(),new L(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn),w5,Jl.None,t))}};BN=gfe([CD(1,z2),CD(2,zs),CD(3,pe)],BN);const eV="editor.action.inlineSuggest.commit",tV="editor.action.inlineSuggest.showPrevious",iV="editor.action.inlineSuggest.showNext";var mfe=function(o,e,t,i){function n(s){return s instanceof t?s:new t(function(r){r(s)})}return new(t||(t=Promise))(function(s,r){function a(c){try{d(i.next(c))}catch(h){r(h)}}function l(c){try{d(i.throw(c))}catch(h){r(h)}}function d(c){c.done?s(c.value):n(c.value).then(a,l)}d((i=i.apply(o,e||[])).next())})};class _fe extends H{constructor(e,t,i={orientation:0}){super(),this.submenuActionViewItems=[],this.hasSecondaryActions=!1,this._onDidChangeDropdownVisibility=this._register(new aU),this.onDidChangeDropdownVisibility=this._onDidChangeDropdownVisibility.event,this.disposables=this._register(new X),this.options=i,this.lookupKeybindings=typeof this.options.getKeyBinding=="function",this.toggleMenuAction=this._register(new Zv(()=>{var n;return(n=this.toggleMenuActionViewItem)===null||n===void 0?void 0:n.show()},i.toggleMenuTitle)),this.element=document.createElement("div"),this.element.className="monaco-toolbar",e.appendChild(this.element),this.actionBar=this._register(new Wo(this.element,{orientation:i.orientation,ariaLabel:i.ariaLabel,actionRunner:i.actionRunner,allowContextMenu:i.allowContextMenu,highlightToggledItems:i.highlightToggledItems,actionViewItemProvider:(n,s)=>{var r;if(n.id===Zv.ID)return this.toggleMenuActionViewItem=new vw(n,n.menuActions,t,{actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,keybindingProvider:this.options.getKeyBinding,classNames:Ie.asClassNameArray((r=i.moreIcon)!==null&&r!==void 0?r:oe.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(i.actionViewItemProvider){const a=i.actionViewItemProvider(n,s);if(a)return a}if(n instanceof Gg){const a=new vw(n,n.actions,t,{actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,keybindingProvider:this.options.getKeyBinding,classNames:n.class,anchorAlignmentProvider:this.options.anchorAlignmentProvider,menuAsChild:!!this.options.renderDropdownAsChildElement,skipTelemetry:this.options.skipTelemetry});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 i=e?e.slice(0):[];this.hasSecondaryActions=!!(t&&t.length>0),this.hasSecondaryActions&&t&&(this.toggleMenuAction.menuActions=t.slice(0),i.push(this.toggleMenuAction)),i.forEach(n=>{this.actionBar.push(n,{icon:!0,label:!1,keybinding:this.getKeybindingLabel(n)})})}getKeybindingLabel(e){var t,i,n;const s=this.lookupKeybindings?(i=(t=this.options).getKeyBinding)===null||i===void 0?void 0:i.call(t,e):void 0;return(n=s?.getLabel())!==null&&n!==void 0?n:void 0}clear(){this.submenuActionViewItems=[],this.disposables.clear(),this.actionBar.clear()}dispose(){this.clear(),this.disposables.dispose(),super.dispose()}}class Zv extends as{constructor(e,t){t=t||g("moreActions","More Actions..."),super(Zv.ID,t,void 0,!0),this._menuActions=[],this.toggleDropdownMenu=e}run(){return mfe(this,void 0,void 0,function*(){this.toggleDropdownMenu()})}get menuActions(){return this._menuActions}set menuActions(e){this._menuActions=e}}Zv.ID="toolbar.toggle.more";var vfe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},km=function(o,e){return function(t,i){e(t,i,o)}};let WN=class extends _fe{constructor(e,t,i,n,s,r,a){super(e,s,Object.assign(Object.assign({getKeyBinding:d=>{var c;return(c=r.lookupKeybinding(d.id))!==null&&c!==void 0?c:void 0}},t),{allowContextMenu:!0,skipTelemetry:typeof t?.telemetrySource=="string"})),this._options=t,this._menuService=i,this._contextKeyService=n,this._contextMenuService=s,this._sessionDisposables=this._store.add(new X);const l=t?.telemetrySource;l&&this._store.add(this.actionBar.onDidRun(d=>a.publicLog2("workbenchActionExecuted",{id:d.action.id,from:l})))}setActions(e,t=[],i){var n,s,r;this._sessionDisposables.clear();const a=e.slice(),l=t.slice(),d=[];let c=0;const h=[];let u=!1;if(((n=this._options)===null||n===void 0?void 0:n.hiddenItemStrategy)!==-1)for(let f=0;f<a.length;f++){const p=a[f];!(p instanceof dr)&&!(p instanceof Y_)||p.hideActions&&(d.push(p.hideActions.toggle),p.hideActions.toggle.checked&&c++,p.hideActions.isHidden&&(u=!0,a[f]=void 0,((s=this._options)===null||s===void 0?void 0:s.hiddenItemStrategy)!==0&&(h[f]=p)))}if(((r=this._options)===null||r===void 0?void 0:r.overflowBehavior)!==void 0){const f=Tse(new Set(this._options.overflowBehavior.exempted),Xe.map(a,v=>v?.id)),p=this._options.overflowBehavior.maxItems-f.size;let m=0;for(let v=0;v<a.length;v++){const _=a[v];_&&(m++,!f.has(_.id)&&m>=p&&(a[v]=void 0,h[v]=_))}}xA(a),xA(h),super.setActions(a,en.join(h,l)),d.length>0&&this._sessionDisposables.add($(this.getElement(),"contextmenu",f=>{var p,m,v,_,b;const C=new Do(f),w=this.getItemAction(C.target);if(!w)return;C.preventDefault(),C.stopPropagation();let S=!1;if(c===1&&((p=this._options)===null||p===void 0?void 0:p.hiddenItemStrategy)===0){S=!0;for(let I=0;I<d.length;I++)if(d[I].checked){d[I]=mg({id:w.id,label:w.label,checked:!0,enabled:!1,run(){}});break}}let D;if(!S&&(w instanceof dr||w instanceof Y_)){if(!w.hideActions)return;D=w.hideActions.hide}else D=mg({id:"label",label:g("hide","Hide"),enabled:!1,run(){}});const x=en.join([D],d);!((m=this._options)===null||m===void 0)&&m.resetMenu&&!i&&(i=[this._options.resetMenu]),u&&i&&(x.push(new en),x.push(mg({id:"resetThisMenu",label:g("resetThisMenu","Reset Menu"),run:()=>this._menuService.resetHiddenStates(i)}))),this._contextMenuService.showContextMenu({getAnchor:()=>C,getActions:()=>x,menuId:(v=this._options)===null||v===void 0?void 0:v.contextMenu,menuActionOptions:Object.assign({renderShortTitle:!0},(_=this._options)===null||_===void 0?void 0:_.menuOptions),skipTelemetry:typeof((b=this._options)===null||b===void 0?void 0:b.telemetrySource)=="string",contextKeyService:this._contextKeyService})}))}};WN=vfe([km(2,dl),km(3,Ae),km(4,pr),km(5,Nt),km(6,go)],WN);var BM=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Hr=function(o,e){return function(t,i){e(t,i,o)}},f1;let VN=class extends H{constructor(e,t,i){super(),this.editor=e,this.model=t,this.instantiationService=i,this.alwaysShowToolbar=un(this.editor.onDidChangeConfiguration,()=>this.editor.getOption(62).showToolbar==="always"),this.sessionPosition=void 0,this.position=ot(this,n=>{var s,r,a;const l=(s=this.model.read(n))===null||s===void 0?void 0:s.ghostText.read(n);if(!this.alwaysShowToolbar.read(n)||!l||l.parts.length===0)return this.sessionPosition=void 0,null;const d=l.parts[0].column;this.sessionPosition&&this.sessionPosition.lineNumber!==l.lineNumber&&(this.sessionPosition=void 0);const c=new P(l.lineNumber,Math.min(d,(a=(r=this.sessionPosition)===null||r===void 0?void 0:r.column)!==null&&a!==void 0?a:Number.MAX_SAFE_INTEGER));return this.sessionPosition=c,c}),this._register(Ns((n,s)=>{const r=this.model.read(n);if(!r||!this.alwaysShowToolbar.read(n))return;const a=s.add(this.instantiationService.createInstance(Hc,this.editor,!0,this.position,r.selectedInlineCompletionIndex,r.inlineCompletionsCount,r.selectedInlineCompletion.map(l=>{var d;return(d=l?.inlineCompletion.source.inlineCompletions.commands)!==null&&d!==void 0?d:[]})));e.addContentWidget(a),s.add(Me(()=>e.removeContentWidget(a))),s.add(Mt(l=>{this.position.read(l)&&r.lastTriggerKind.read(l)!==Yl.Explicit&&r.triggerExplicitly()}))}))}};VN=BM([Hr(2,Re)],VN);const bfe=_i("inline-suggestion-hints-next",oe.chevronRight,g("parameterHintsNextIcon","Icon for show next parameter hint.")),Cfe=_i("inline-suggestion-hints-previous",oe.chevronLeft,g("parameterHintsPreviousIcon","Icon for show previous parameter hint."));let Hc=f1=class extends H{static get dropDownVisible(){return this._dropDownVisible}createCommandAction(e,t,i){const n=new as(e,t,i,!0,()=>this._commandService.executeCommand(e)),s=this.keybindingService.lookupKeybinding(e,this._contextKeyService);let r=t;return s&&(r=g({key:"content",comment:["A label","A keybinding"]},"{0} ({1})",t,s.getLabel())),n.tooltip=r,n}constructor(e,t,i,n,s,r,a,l,d,c,h){super(),this.editor=e,this.withBorder=t,this._position=i,this._currentSuggestionIdx=n,this._suggestionCount=s,this._extraCommands=r,this._commandService=a,this.keybindingService=d,this._contextKeyService=c,this._menuService=h,this.id=`InlineSuggestionHintsContentWidget${f1.id++}`,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this.nodes=rn("div.inlineSuggestionsHints",{className:this.withBorder?".withBorder":""},[rn("div@toolBar")]),this.previousAction=this.createCommandAction(tV,g("previous","Previous"),Ie.asClassName(Cfe)),this.availableSuggestionCountAction=new as("inlineSuggestionHints.availableSuggestionCount","",void 0,!1),this.nextAction=this.createCommandAction(iV,g("next","Next"),Ie.asClassName(bfe)),this.inlineCompletionsActionsMenus=this._register(this._menuService.createMenu(k.InlineCompletionsActions,this._contextKeyService)),this.clearAvailableSuggestionCountLabelDebounced=this._register(new Dt(()=>{this.availableSuggestionCountAction.label=""},100)),this.disableButtonsDebounced=this._register(new Dt(()=>{this.previousAction.enabled=this.nextAction.enabled=!1},100)),this.lastCommands=[],this.toolBar=this._register(l.createInstance(HN,this.nodes.toolBar,k.InlineSuggestionToolbar,{menuOptions:{renderShortTitle:!0},toolbarOptions:{primaryGroup:u=>u.startsWith("primary")},actionViewItemProvider:(u,f)=>{if(u instanceof dr)return l.createInstance(Sfe,u,void 0);if(u===this.availableSuggestionCountAction){const p=new wfe(void 0,u,{label:!0,icon:!1});return p.setClass("availableSuggestionCount"),p}},telemetrySource:"InlineSuggestionToolbar"})),this.toolBar.setPrependedPrimaryActions([this.previousAction,this.availableSuggestionCountAction,this.nextAction]),this._register(this.toolBar.onDidChangeDropdownVisibility(u=>{f1._dropDownVisible=u})),this._register(Mt(u=>{this._position.read(u),this.editor.layoutContentWidget(this)})),this._register(Mt(u=>{const f=this._suggestionCount.read(u),p=this._currentSuggestionIdx.read(u);f!==void 0?(this.clearAvailableSuggestionCountLabelDebounced.cancel(),this.availableSuggestionCountAction.label=`${p+1}/${f}`):this.clearAvailableSuggestionCountLabelDebounced.schedule(),f!==void 0&&f>1?(this.disableButtonsDebounced.cancel(),this.previousAction.enabled=this.nextAction.enabled=!0):this.disableButtonsDebounced.schedule()})),this._register(Mt(u=>{const f=this._extraCommands.read(u);if(mi(this.lastCommands,f))return;this.lastCommands=f;const p=f.map(m=>({class:void 0,id:m.id,enabled:!0,tooltip:m.tooltip||"",label:m.title,run:v=>this._commandService.executeCommand(m.id)}));for(const[m,v]of this.inlineCompletionsActionsMenus.getActions())for(const _ of v)_ instanceof dr&&p.push(_);p.length>0&&p.unshift(new en),this.toolBar.setAdditionalSecondaryActions(p)}))}getId(){return this.id}getDomNode(){return this.nodes.root}getPosition(){return{position:this._position.get(),preference:[1,2],positionAffinity:3}}};Hc._dropDownVisible=!1;Hc.id=0;Hc=f1=BM([Hr(6,li),Hr(7,Re),Hr(8,Nt),Hr(9,Ae),Hr(10,dl)],Hc);class wfe extends up{constructor(){super(...arguments),this._className=void 0}setClass(e){this._className=e}render(e){super.render(e),this._className&&e.classList.add(this._className)}}let Sfe=class extends Cu{updateLabel(){const e=this._keybindingService.lookupKeybinding(this._action.id,this._contextKeyService);if(!e)return super.updateLabel();if(this.label){const t=rn("div.keybinding").root;new z0(t,to,Object.assign({disableTitle:!0},Zoe)).set(e),this.label.textContent=this._action.label,this.label.appendChild(t),this.label.classList.add("inlineSuggestionStatusBarItemLabel")}}},HN=class extends WN{constructor(e,t,i,n,s,r,a,l){super(e,Object.assign({resetMenu:t},i),n,s,r,a,l),this.menuId=t,this.options2=i,this.menuService=n,this.contextKeyService=s,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,i,n,s,r,a;const l=[],d=[];DB(this.menu,(e=this.options2)===null||e===void 0?void 0:e.menuOptions,{primary:l,secondary:d},(i=(t=this.options2)===null||t===void 0?void 0:t.toolbarOptions)===null||i===void 0?void 0:i.primaryGroup,(s=(n=this.options2)===null||n===void 0?void 0:n.toolbarOptions)===null||s===void 0?void 0:s.shouldInlineSubmenu,(a=(r=this.options2)===null||r===void 0?void 0:r.toolbarOptions)===null||a===void 0?void 0:a.useSeparatorsInPrimaryActions),d.push(...this.additionalActions),l.unshift(...this.prependedPrimaryActions),this.setActions(l,d)}setPrependedPrimaryActions(e){mi(this.prependedPrimaryActions,e,(t,i)=>t===i)||(this.prependedPrimaryActions=e,this.updateToolbar())}setAdditionalSecondaryActions(e){mi(this.additionalActions,e,(t,i)=>t===i)||(this.additionalActions=e,this.updateToolbar())}};HN=BM([Hr(3,dl),Hr(4,Ae),Hr(5,pr),Hr(6,Nt),Hr(7,go)],HN);var yfe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},fC=function(o,e){return function(t,i){e(t,i,o)}},zN;const Lfe=!1;let ys=zN=class extends H{static get(e){return e.getContribution(zN.ID)}constructor(e,t,i,n,s){super(),this._editor=e,this._instantiationService=t,this._openerService=i,this._languageService=n,this._keybindingService=s,this._toUnhook=new X,this._hoverActivatedByColorDecoratorClick=!1,this._isMouseDown=!1,this._hoverClicked=!1,this._contentWidget=null,this._glyphWidget=null,this._reactToEditorMouseMoveRunner=this._register(new Dt(()=>this._reactToEditorMouseMove(this._mouseMoveEvent),0)),this._hookEvents(),this._register(this._editor.onDidChangeConfiguration(r=>{r.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(i=>this._onEditorMouseDown(i))),this._toUnhook.add(this._editor.onMouseUp(i=>this._onEditorMouseUp(i))),this._toUnhook.add(this._editor.onMouseMove(i=>this._onEditorMouseMove(i))),this._toUnhook.add(this._editor.onKeyDown(i=>this._onKeyDown(i)))):(this._toUnhook.add(this._editor.onMouseMove(i=>this._onEditorMouseMove(i))),this._toUnhook.add(this._editor.onKeyDown(i=>this._onKeyDown(i)))),this._toUnhook.add(this._editor.onMouseLeave(i=>this._onEditorMouseLeave(i))),this._toUnhook.add(this._editor.onDidChangeModel(e)),this._toUnhook.add(this._editor.onDidScrollChange(i=>this._onEditorScrollChanged(i)))}_unhookEvents(){this._toUnhook.clear()}_onEditorScrollChanged(e){(e.scrollTopChanged||e.scrollLeftChanged)&&this._hideWidgets()}_onEditorMouseDown(e){var t;this._isMouseDown=!0;const i=e.target;if(i.type===9&&i.detail===gc.ID){this._hoverClicked=!0;return}i.type===12&&i.detail===Bg.ID||(i.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,i;const n=e.event.browserEvent.relatedTarget;!((t=this._contentWidget)===null||t===void 0)&&t.widget.isResizing||!((i=this._contentWidget)===null||i===void 0)&&i.containsNode(n)||this._hideWidgets()}_isMouseOverWidget(e){var t,i,n,s,r;const a=e.target;return!!(this._isHoverSticky&&a.type===9&&a.detail===gc.ID||this._isHoverSticky&&(!((t=this._contentWidget)===null||t===void 0)&&t.containsNode((i=e.event.browserEvent.view)===null||i===void 0?void 0:i.document.activeElement))&&!(!((s=(n=e.event.browserEvent.view)===null||n===void 0?void 0:n.getSelection())===null||s===void 0)&&s.isCollapsed)||!this._isHoverSticky&&a.type===9&&a.detail===gc.ID&&(!((r=this._contentWidget)===null||r===void 0)&&r.isColorPickerVisible)||this._isHoverSticky&&a.type===12&&a.detail===Bg.ID)}_onEditorMouseMove(e){var t,i,n,s;if(this._mouseMoveEvent=e,!((t=this._contentWidget)===null||t===void 0)&&t.isFocused||!((i=this._contentWidget)===null||i===void 0)&&i.isResizing||this._isMouseDown&&this._hoverClicked||this._isHoverSticky&&(!((n=this._contentWidget)===null||n===void 0)&&n.isVisibleFromKeyboard))return;if(this._isMouseOverWidget(e)){this._reactToEditorMouseMoveRunner.cancel();return}if(!((s=this._contentWidget)===null||s===void 0)&&s.isVisible&&this._isHoverSticky&&this._hidingDelay>0){this._reactToEditorMouseMoveRunner.isScheduled()||this._reactToEditorMouseMoveRunner.schedule(this._hidingDelay);return}this._reactToEditorMouseMove(e)}_reactToEditorMouseMove(e){var t,i,n;if(!e)return;const s=e.target,r=(t=s.element)===null||t===void 0?void 0:t.classList.contains("colorpicker-color-decoration"),a=this._editor.getOption(146);if(r&&(a==="click"&&!this._hoverActivatedByColorDecoratorClick||a==="hover"&&!this._isHoverEnabled&&!Lfe||a==="clickAndHover"&&!this._isHoverEnabled&&!this._hoverActivatedByColorDecoratorClick)||!r&&!this._isHoverEnabled&&!this._hoverActivatedByColorDecoratorClick){this._hideWidgets();return}if(this._getOrCreateContentWidget().maybeShowAt(e)){(i=this._glyphWidget)===null||i===void 0||i.hide();return}if(s.type===2&&s.position){(n=this._contentWidget)===null||n===void 0||n.hide(),this._glyphWidget||(this._glyphWidget=new Bg(this._editor,this._languageService,this._openerService)),this._glyphWidget.startShowingAt(s.position.lineNumber);return}this._hideWidgets()}_onKeyDown(e){var t;if(!this._editor.hasModel())return;const i=this._keybindingService.softDispatch(e,this._editor.getDomNode()),n=i.kind===1||i.kind===2&&i.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&&!n&&this._hideWidgets()}_hideWidgets(){var e,t,i;this._isMouseDown&&this._hoverClicked&&(!((e=this._contentWidget)===null||e===void 0)&&e.isColorPickerVisible)||Hc.dropDownVisible||(this._hoverActivatedByColorDecoratorClick=!1,this._hoverClicked=!1,(t=this._glyphWidget)===null||t===void 0||t.hide(),(i=this._contentWidget)===null||i===void 0||i.hide())}_getOrCreateContentWidget(){return this._contentWidget||(this._contentWidget=this._instantiationService.createInstance(Yw,this._editor)),this._contentWidget}showContentHover(e,t,i,n,s=!1){this._hoverActivatedByColorDecoratorClick=s,this._getOrCreateContentWidget().startShowingAtRange(e,t,i,n)}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()}};ys.ID="editor.contrib.hover";ys=zN=yfe([fC(1,Re),fC(2,zs),fC(3,qt),fC(4,Nt)],ys);class xfe extends fe{constructor(){super({id:"editor.action.showHover",label:g({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:E.editorTextFocus,primary:Pi(2089,2087),weight:100}})}run(e,t,i){if(!t.hasModel())return;const n=ys.get(t);if(!n)return;const s=t.getPosition(),r=new L(s.lineNumber,s.column,s.lineNumber,s.column),a=t.getOption(2)===2||!!i?.focus;n.isHoverVisible?n.focus():n.showContentHover(r,1,1,a)}}class Dfe extends fe{constructor(){super({id:"editor.action.showDefinitionPreviewHover",label:g({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 i=ys.get(t);if(!i)return;const n=t.getPosition();if(!n)return;const s=new L(n.lineNumber,n.column,n.lineNumber,n.column),r=Nu.get(t);if(!r)return;r.startFindDefinitionFromCursor(n).then(()=>{i.showContentHover(s,1,1,!0)})}}class kfe extends fe{constructor(){super({id:"editor.action.scrollUpHover",label:g({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:E.hoverFocused,kbOpts:{kbExpr:E.hoverFocused,primary:16,weight:100}})}run(e,t){const i=ys.get(t);i&&i.scrollUp()}}class Ife extends fe{constructor(){super({id:"editor.action.scrollDownHover",label:g({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:E.hoverFocused,kbOpts:{kbExpr:E.hoverFocused,primary:18,weight:100}})}run(e,t){const i=ys.get(t);i&&i.scrollDown()}}class Efe extends fe{constructor(){super({id:"editor.action.scrollLeftHover",label:g({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:E.hoverFocused,kbOpts:{kbExpr:E.hoverFocused,primary:15,weight:100}})}run(e,t){const i=ys.get(t);i&&i.scrollLeft()}}class Nfe extends fe{constructor(){super({id:"editor.action.scrollRightHover",label:g({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:E.hoverFocused,kbOpts:{kbExpr:E.hoverFocused,primary:17,weight:100}})}run(e,t){const i=ys.get(t);i&&i.scrollRight()}}class Tfe extends fe{constructor(){super({id:"editor.action.pageUpHover",label:g({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:E.hoverFocused,kbOpts:{kbExpr:E.hoverFocused,primary:11,secondary:[528],weight:100}})}run(e,t){const i=ys.get(t);i&&i.pageUp()}}class Rfe extends fe{constructor(){super({id:"editor.action.pageDownHover",label:g({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:E.hoverFocused,kbOpts:{kbExpr:E.hoverFocused,primary:12,secondary:[530],weight:100}})}run(e,t){const i=ys.get(t);i&&i.pageDown()}}class Mfe extends fe{constructor(){super({id:"editor.action.goToTopHover",label:g({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:E.hoverFocused,kbOpts:{kbExpr:E.hoverFocused,primary:14,secondary:[2064],weight:100}})}run(e,t){const i=ys.get(t);i&&i.goToTop()}}class Afe extends fe{constructor(){super({id:"editor.action.goToBottomHover",label:g({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:E.hoverFocused,kbOpts:{kbExpr:E.hoverFocused,primary:13,secondary:[2066],weight:100}})}run(e,t){const i=ys.get(t);i&&i.goToBottom()}}ft(ys.ID,ys,2);ne(xfe);ne(Dfe);ne(kfe);ne(Ife);ne(Efe);ne(Nfe);ne(Tfe);ne(Rfe);ne(Mfe);ne(Afe);lf.register(Jw);lf.register(BN);gr((o,e)=>{const t=o.getColor(aZ);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 UN extends H{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 i=e.target;if(i.type!==6||!i.detail.injectedText||i.detail.injectedText.options.attachedData!==DW||!i.range)return;const n=this._editor.getContribution(ys.ID);if(n&&!n.isColorPickerVisible){const s=new L(i.range.startLineNumber,i.range.startColumn+1,i.range.endLineNumber,i.range.endColumn+1);n.showContentHover(s,1,0,!1,!0)}}}UN.ID="editor.contrib.colorContribution";ft(UN.ID,UN,2);lf.register(Gw);var nV=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Fr=function(o,e){return function(t,i){e(t,i,o)}},S5=function(o,e,t,i){function n(s){return s instanceof t?s:new t(function(r){r(s)})}return new(t||(t=Promise))(function(s,r){function a(c){try{d(i.next(c))}catch(h){r(h)}}function l(c){try{d(i.throw(c))}catch(h){r(h)}}function d(c){c.done?s(c.value):n(c.value).then(a,l)}d((i=i.apply(o,e||[])).next())})},$N,jN;let zc=$N=class extends H{constructor(e,t,i,n,s,r,a){super(),this._editor=e,this._modelService=i,this._keybindingService=n,this._instantiationService=s,this._languageFeatureService=r,this._languageConfigurationService=a,this._standaloneColorPickerWidget=null,this._standaloneColorPickerVisible=E.standaloneColorPickerVisible.bindTo(t),this._standaloneColorPickerFocused=E.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 tS(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($N.ID)}};zc.ID="editor.contrib.standaloneColorPickerController";zc=$N=nV([Fr(1,Ae),Fr(2,Yt),Fr(3,Nt),Fr(4,Re),Fr(5,pe),Fr(6,At)],zc);ft(zc.ID,zc,1);const y5=8,Pfe=22;let tS=jN=class extends H{constructor(e,t,i,n,s,r,a,l){var d;super(),this._editor=e,this._standaloneColorPickerVisible=t,this._standaloneColorPickerFocused=i,this._modelService=s,this._keybindingService=r,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 A),this.onResult=this._onResult.event,this._standaloneColorPickerVisible.set(!0),this._standaloneColorPickerParticipant=n.createInstance(jv,this._editor),this._position=(d=this._editor._getViewModel())===null||d===void 0?void 0:d.getPrimaryCursorState().modelState.position;const c=this._editor.getSelection(),h=c?{startLineNumber:c.startLineNumber,startColumn:c.startColumn,endLineNumber:c.endLineNumber,endColumn:c.endColumn}:{startLineNumber:0,endLineNumber:0,endColumn:0,startColumn:0},u=this._register(Qa(this._body));this._register(u.onDidBlur(f=>{this.hide()})),this._register(u.onDidFocus(f=>{this.focus()})),this._register(this._editor.onDidChangeCursorPosition(()=>{this._selectionSetInEditor?this._selectionSetInEditor=!1:this.hide()})),this._register(this._editor.onMouseMove(f=>{var p;const m=(p=f.target.element)===null||p===void 0?void 0:p.classList;m&&m.contains("colorpicker-color-decoration")&&this.hide()})),this._register(this.onResult(f=>{this._render(f.value,f.foundInEditor)})),this._start(h),this._body.style.zIndex="50",this._editor.addContentWidget(this)}updateEditor(){this._colorHover&&this._standaloneColorPickerParticipant.updateEditorModel(this._colorHover)}getId(){return jN.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 S5(this,void 0,void 0,function*(){const t=yield this._computeAsync(e);t&&this._onResult.fire(new Ofe(t.result,t.foundInEditor))})}_computeAsync(e){return S5(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}},i=yield this._standaloneColorPickerParticipant.createColorHover(t,new NM(this._modelService,this._languageConfigurationService),this._languageFeaturesService.colorProvider);return i?{result:i.colorHover,foundInEditor:i.foundInEditor}:null})}_render(e,t){const i=document.createDocumentFragment(),n=this._register(new Xw(this._keybindingService));let s;const r={fragment:i,statusBar:n,setColorPicker:m=>s=m,onContentsChanged:()=>{},hide:()=>this.hide()};if(this._colorHover=e,this._register(this._standaloneColorPickerParticipant.renderHoverParts(r,[e])),s===void 0)return;this._body.classList.add("standalone-colorpicker-body"),this._body.style.maxHeight=Math.max(this._editor.getLayoutInfo().height/4,250)+"px",this._body.style.maxWidth=Math.max(this._editor.getLayoutInfo().width*.66,500)+"px",this._body.tabIndex=0,this._body.appendChild(i),s.layout();const a=s.body,l=a.saturationBox.domNode.clientWidth,d=a.domNode.clientWidth-l-Pfe-y5,c=s.body.enterButton;c?.onClicked(()=>{this.updateEditor(),this.hide()});const h=s.header,u=h.pickedColorNode;u.style.width=l+y5+"px";const f=h.originalColorNode;f.style.width=d+"px";const p=s.header.closeButton;p?.onClicked(()=>{this.hide()}),t&&(c&&(c.button.textContent="Replace"),this._selectionSetInEditor=!0,this._editor.setSelection(e.range)),this._editor.layoutContentWidget(this)}};tS.ID="editor.contrib.standaloneColorPickerWidget";tS=jN=nV([Fr(3,Re),Fr(4,Yt),Fr(5,Nt),Fr(6,pe),Fr(7,At)],tS);class Ofe{constructor(e,t){this.value=e,this.foundInEditor=t}}class Ffe extends ra{constructor(){super({id:"editor.action.showOrFocusStandaloneColorPicker",title:{value:g("showOrFocusStandaloneColorPicker","Show or Focus Standalone Color Picker"),mnemonicTitle:g({key:"mishowOrFocusStandaloneColorPicker",comment:["&& denotes a mnemonic"]},"&&Show or Focus Standalone Color Picker"),original:"Show or Focus Standalone Color Picker"},precondition:void 0,menu:[{id:k.CommandPalette}]})}runEditorCommand(e,t){var i;(i=zc.get(t))===null||i===void 0||i.showOrFocus()}}class Bfe extends fe{constructor(){super({id:"editor.action.hideColorPicker",label:g({key:"hideColorPicker",comment:["Action that hides the color picker"]},"Hide the Color Picker"),alias:"Hide the Color Picker",precondition:E.standaloneColorPickerVisible.isEqualTo(!0),kbOpts:{primary:9,weight:100}})}run(e,t){var i;(i=zc.get(t))===null||i===void 0||i.hide()}}class Wfe extends fe{constructor(){super({id:"editor.action.insertColorWithStandaloneColorPicker",label:g({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:E.standaloneColorPickerFocused.isEqualTo(!0),kbOpts:{primary:3,weight:100}})}run(e,t){var i;(i=zc.get(t))===null||i===void 0||i.insertColor()}}ne(Bfe);ne(Wfe);jt(Ffe);class Jd{constructor(e,t,i){this.languageConfigurationService=i,this._selection=e,this._insertSpace=t,this._usedEndToken=null}static _haystackHasNeedleAtOffset(e,t,i){if(i<0)return!1;const n=t.length,s=e.length;if(i+n>s)return!1;for(let r=0;r<n;r++){const a=e.charCodeAt(i+r),l=t.charCodeAt(r);if(a!==l&&!(a>=65&&a<=90&&a+32===l)&&!(l>=65&&l<=90&&l+32===a))return!1}return!0}_createOperationsForBlockComment(e,t,i,n,s,r){const a=e.startLineNumber,l=e.startColumn,d=e.endLineNumber,c=e.endColumn,h=s.getLineContent(a),u=s.getLineContent(d);let f=h.lastIndexOf(t,l-1+t.length),p=u.indexOf(i,c-1-i.length);if(f!==-1&&p!==-1)if(a===d)h.substring(f+t.length,p).indexOf(i)>=0&&(f=-1,p=-1);else{const v=h.substring(f+t.length),_=u.substring(0,p);(v.indexOf(i)>=0||_.indexOf(i)>=0)&&(f=-1,p=-1)}let m;f!==-1&&p!==-1?(n&&f+t.length<h.length&&h.charCodeAt(f+t.length)===32&&(t=t+" "),n&&p>0&&u.charCodeAt(p-1)===32&&(i=" "+i,p-=1),m=Jd._createRemoveBlockCommentOperations(new L(a,f+t.length+1,d,p+1),t,i)):(m=Jd._createAddBlockCommentOperations(e,t,i,this._insertSpace),this._usedEndToken=m.length===1?i:null);for(const v of m)r.addTrackedEditOperation(v.range,v.text)}static _createRemoveBlockCommentOperations(e,t,i){const n=[];return L.isEmpty(e)?n.push(Zt.delete(new L(e.startLineNumber,e.startColumn-t.length,e.endLineNumber,e.endColumn+i.length))):(n.push(Zt.delete(new L(e.startLineNumber,e.startColumn-t.length,e.startLineNumber,e.startColumn))),n.push(Zt.delete(new L(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn+i.length)))),n}static _createAddBlockCommentOperations(e,t,i,n){const s=[];return L.isEmpty(e)?s.push(Zt.replace(new L(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn),t+" "+i)):(s.push(Zt.insert(new P(e.startLineNumber,e.startColumn),t+(n?" ":""))),s.push(Zt.insert(new P(e.endLineNumber,e.endColumn),(n?" ":"")+i))),s}getEditOperations(e,t){const i=this._selection.startLineNumber,n=this._selection.startColumn;e.tokenization.tokenizeIfCheap(i);const s=e.getLanguageIdAtPosition(i,n),r=this.languageConfigurationService.getLanguageConfiguration(s).comments;!r||!r.blockCommentStartToken||!r.blockCommentEndToken||this._createOperationsForBlockComment(this._selection,r.blockCommentStartToken,r.blockCommentEndToken,this._insertSpace,e,t)}computeCursorState(e,t){const i=t.getInverseEditOperations();if(i.length===2){const n=i[0],s=i[1];return new ve(n.range.endLineNumber,n.range.endColumn,s.range.startLineNumber,s.range.startColumn)}else{const n=i[0].range,s=this._usedEndToken?-this._usedEndToken.length-1:0;return new ve(n.endLineNumber,n.endColumn+s,n.endLineNumber,n.endColumn+s)}}}class kl{constructor(e,t,i,n,s,r,a){this.languageConfigurationService=e,this._selection=t,this._tabSize=i,this._type=n,this._insertSpace=s,this._selectionId=null,this._deltaColumn=0,this._moveEndPositionDown=!1,this._ignoreEmptyLines=r,this._ignoreFirstLine=a||!1}static _gatherPreflightCommentStrings(e,t,i,n){e.tokenization.tokenizeIfCheap(t);const s=e.getLanguageIdAtPosition(t,1),r=n.getLanguageConfiguration(s).comments,a=r?r.lineCommentToken:null;if(!a)return null;const l=[];for(let d=0,c=i-t+1;d<c;d++)l[d]={ignore:!1,commentStr:a,commentStrOffset:0,commentStrLength:a.length};return l}static _analyzeLines(e,t,i,n,s,r,a,l){let d=!0,c;e===0?c=!0:e===1?c=!1:c=!0;for(let h=0,u=n.length;h<u;h++){const f=n[h],p=s+h;if(p===s&&a){f.ignore=!0;continue}const m=i.getLineContent(p),v=Gn(m);if(v===-1){f.ignore=r,f.commentStrOffset=m.length;continue}if(d=!1,f.ignore=!1,f.commentStrOffset=v,c&&!Jd._haystackHasNeedleAtOffset(m,f.commentStr,v)&&(e===0?c=!1:e===1||(f.ignore=!0)),c&&t){const _=v+f.commentStrLength;_<m.length&&m.charCodeAt(_)===32&&(f.commentStrLength+=1)}}if(e===0&&d){c=!1;for(let h=0,u=n.length;h<u;h++)n[h].ignore=!1}return{supported:!0,shouldRemoveComments:c,lines:n}}static _gatherPreflightData(e,t,i,n,s,r,a,l){const d=kl._gatherPreflightCommentStrings(i,n,s,l);return d===null?{supported:!1}:kl._analyzeLines(e,t,i,d,n,r,a,l)}_executeLineComments(e,t,i,n){let s;i.shouldRemoveComments?s=kl._createRemoveLineCommentsOperations(i.lines,n.startLineNumber):(kl._normalizeInsertionPoint(e,i.lines,n.startLineNumber,this._tabSize),s=this._createAddLineCommentsOperations(i.lines,n.startLineNumber));const r=new P(n.positionLineNumber,n.positionColumn);for(let a=0,l=s.length;a<l;a++)t.addEditOperation(s[a].range,s[a].text),L.isEmpty(s[a].range)&&L.getStartPosition(s[a].range).equals(r)&&e.getLineContent(r.lineNumber).length+1===r.column&&(this._deltaColumn=(s[a].text||"").length);this._selectionId=t.trackSelection(n)}_attemptRemoveBlockComment(e,t,i,n){let s=t.startLineNumber,r=t.endLineNumber;const a=n.length+Math.max(e.getLineFirstNonWhitespaceColumn(t.startLineNumber),t.startColumn);let l=e.getLineContent(s).lastIndexOf(i,a-1),d=e.getLineContent(r).indexOf(n,t.endColumn-1-i.length);return l!==-1&&d===-1&&(d=e.getLineContent(s).indexOf(n,l+i.length),r=s),l===-1&&d!==-1&&(l=e.getLineContent(r).lastIndexOf(i,d),s=r),t.isEmpty()&&(l===-1||d===-1)&&(l=e.getLineContent(s).indexOf(i),l!==-1&&(d=e.getLineContent(s).indexOf(n,l+i.length))),l!==-1&&e.getLineContent(s).charCodeAt(l+i.length)===32&&(i+=" "),d!==-1&&e.getLineContent(r).charCodeAt(d-1)===32&&(n=" "+n,d-=1),l!==-1&&d!==-1?Jd._createRemoveBlockCommentOperations(new L(s,l+i.length+1,r,d+1),i,n):null}_executeBlockComment(e,t,i){e.tokenization.tokenizeIfCheap(i.startLineNumber);const n=e.getLanguageIdAtPosition(i.startLineNumber,1),s=this.languageConfigurationService.getLanguageConfiguration(n).comments;if(!s||!s.blockCommentStartToken||!s.blockCommentEndToken)return;const r=s.blockCommentStartToken,a=s.blockCommentEndToken;let l=this._attemptRemoveBlockComment(e,i,r,a);if(!l){if(i.isEmpty()){const d=e.getLineContent(i.startLineNumber);let c=Gn(d);c===-1&&(c=d.length),l=Jd._createAddBlockCommentOperations(new L(i.startLineNumber,c+1,i.startLineNumber,d.length+1),r,a,this._insertSpace)}else l=Jd._createAddBlockCommentOperations(new L(i.startLineNumber,e.getLineFirstNonWhitespaceColumn(i.startLineNumber),i.endLineNumber,e.getLineMaxColumn(i.endLineNumber)),r,a,this._insertSpace);l.length===1&&(this._deltaColumn=r.length+1)}this._selectionId=t.trackSelection(i);for(const d of l)t.addEditOperation(d.range,d.text)}getEditOperations(e,t){let i=this._selection;if(this._moveEndPositionDown=!1,i.startLineNumber===i.endLineNumber&&this._ignoreFirstLine){t.addEditOperation(new L(i.startLineNumber,e.getLineMaxColumn(i.startLineNumber),i.startLineNumber+1,1),i.startLineNumber===e.getLineCount()?"":`
668
668
  `),this._selectionId=t.trackSelection(i);return}i.startLineNumber<i.endLineNumber&&i.endColumn===1&&(this._moveEndPositionDown=!0,i=i.setEndPosition(i.endLineNumber-1,e.getLineMaxColumn(i.endLineNumber-1)));const n=kl._gatherPreflightData(this._type,this._insertSpace,e,i.startLineNumber,i.endLineNumber,this._ignoreEmptyLines,this._ignoreFirstLine,this.languageConfigurationService);return n.supported?this._executeLineComments(e,t,n,i):this._executeBlockComment(e,t,i)}computeCursorState(e,t){let i=t.getTrackedSelection(this._selectionId);return this._moveEndPositionDown&&(i=i.setEndPosition(i.endLineNumber+1,1)),new ve(i.selectionStartLineNumber,i.selectionStartColumn+this._deltaColumn,i.positionLineNumber,i.positionColumn+this._deltaColumn)}static _createRemoveLineCommentsOperations(e,t){const i=[];for(let n=0,s=e.length;n<s;n++){const r=e[n];r.ignore||i.push(Zt.delete(new L(t+n,r.commentStrOffset+1,t+n,r.commentStrOffset+r.commentStrLength+1)))}return i}_createAddLineCommentsOperations(e,t){const i=[],n=this._insertSpace?" ":"";for(let s=0,r=e.length;s<r;s++){const a=e[s];a.ignore||i.push(Zt.insert(new P(t+s,a.commentStrOffset+1),a.commentStr+n))}return i}static nextVisibleColumn(e,t,i,n){return i?e+(t-e%t):e+n}static _normalizeInsertionPoint(e,t,i,n){let s=1073741824,r,a;for(let l=0,d=t.length;l<d;l++){if(t[l].ignore)continue;const c=e.getLineContent(i+l);let h=0;for(let u=0,f=t[l].commentStrOffset;h<s&&u<f;u++)h=kl.nextVisibleColumn(h,n,c.charCodeAt(u)===9,1);h<s&&(s=h)}s=Math.floor(s/n)*n;for(let l=0,d=t.length;l<d;l++){if(t[l].ignore)continue;const c=e.getLineContent(i+l);let h=0;for(r=0,a=t[l].commentStrOffset;h<s&&r<a;r++)h=kl.nextVisibleColumn(h,n,c.charCodeAt(r)===9,1);h>s?t[l].commentStrOffset=r-1:t[l].commentStrOffset=r}}}class WM extends fe{constructor(e,t){super(t),this._type=e}run(e,t){const i=e.get(At);if(!t.hasModel())return;const n=t.getModel(),s=[],r=n.getOptions(),a=t.getOption(23),l=t.getSelections().map((c,h)=>({selection:c,index:h,ignoreFirstLine:!1}));l.sort((c,h)=>L.compareRangesUsingStarts(c.selection,h.selection));let d=l[0];for(let c=1;c<l.length;c++){const h=l[c];d.selection.endLineNumber===h.selection.startLineNumber&&(d.index<h.index?h.ignoreFirstLine=!0:(d.ignoreFirstLine=!0,d=h))}for(const c of l)s.push(new kl(i,c.selection,r.tabSize,this._type,a.insertSpace,a.ignoreEmptyLines,c.ignoreFirstLine));t.pushUndoStop(),t.executeCommands(this.id,s),t.pushUndoStop()}}class Vfe extends WM{constructor(){super(0,{id:"editor.action.commentLine",label:g("comment.line","Toggle Line Comment"),alias:"Toggle Line Comment",precondition:E.writable,kbOpts:{kbExpr:E.editorTextFocus,primary:2138,weight:100},menuOpts:{menuId:k.MenubarEditMenu,group:"5_insert",title:g({key:"miToggleLineComment",comment:["&& denotes a mnemonic"]},"&&Toggle Line Comment"),order:1}})}}class Hfe extends WM{constructor(){super(1,{id:"editor.action.addCommentLine",label:g("comment.line.add","Add Line Comment"),alias:"Add Line Comment",precondition:E.writable,kbOpts:{kbExpr:E.editorTextFocus,primary:Pi(2089,2081),weight:100}})}}class zfe extends WM{constructor(){super(2,{id:"editor.action.removeCommentLine",label:g("comment.line.remove","Remove Line Comment"),alias:"Remove Line Comment",precondition:E.writable,kbOpts:{kbExpr:E.editorTextFocus,primary:Pi(2089,2099),weight:100}})}}class Ufe extends fe{constructor(){super({id:"editor.action.blockComment",label:g("comment.block","Toggle Block Comment"),alias:"Toggle Block Comment",precondition:E.writable,kbOpts:{kbExpr:E.editorTextFocus,primary:1567,linux:{primary:3103},weight:100},menuOpts:{menuId:k.MenubarEditMenu,group:"5_insert",title:g({key:"miToggleBlockComment",comment:["&& denotes a mnemonic"]},"Toggle &&Block Comment"),order:2}})}run(e,t){const i=e.get(At);if(!t.hasModel())return;const n=t.getOption(23),s=[],r=t.getSelections();for(const a of r)s.push(new Jd(a,n.insertSpace,i));t.pushUndoStop(),t.executeCommands(this.id,s),t.pushUndoStop()}}ne(Vfe);ne(Hfe);ne(zfe);ne(Ufe);var $fe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},mh=function(o,e){return function(t,i){e(t,i,o)}},KN;let Sp=KN=class{static get(e){return e.getContribution(KN.ID)}constructor(e,t,i,n,s,r,a,l){this._contextMenuService=t,this._contextViewService=i,this._contextKeyService=n,this._keybindingService=s,this._menuService=r,this._configurationService=a,this._workspaceContextService=l,this._toDispose=new X,this._contextMenuIsBeingShownCount=0,this._editor=e,this._toDispose.add(this._editor.onContextMenu(d=>this._onContextMenu(d))),this._toDispose.add(this._editor.onMouseWheel(d=>{if(this._contextMenuIsBeingShownCount>0){const c=this._contextViewService.getContextViewElement(),h=d.srcElement;h.shadowRoot&&pu(c)===h.shadowRoot||this._contextViewService.hideContextView()}})),this._toDispose.add(this._editor.onKeyDown(d=>{this._editor.getOption(24)&&d.keyCode===58&&(d.preventDefault(),d.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 i=!1;for(const n of this._editor.getSelections())if(n.containsPosition(e.target.position)){i=!0;break}i||this._editor.setPosition(e.target.position)}let t=null;e.target.type!==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?k.SimpleEditorContext:k.EditorContext);t.length>0&&this._doShowContextMenu(t,e)}_getMenuActions(e,t){const i=[],n=this._menuService.createMenu(t,this._contextKeyService),s=n.getActions({arg:e.uri});n.dispose();for(const r of s){const[,a]=r;let l=0;for(const d of a)if(d instanceof Y_){const c=this._getMenuActions(e,d.item.submenu);c.length>0&&(i.push(new Gg(d.id,d.label,c)),l++)}else i.push(d),l++;l&&i.push(new en)}return i.length&&i.pop(),i}_doShowContextMenu(e,t=null){if(!this._editor.hasModel())return;const i=this._editor.getOption(60);this._editor.updateOptions({hover:{enabled:!1}});let n=t;if(!n){this._editor.revealPosition(this._editor.getPosition(),1),this._editor.render();const r=this._editor.getScrolledVisiblePosition(this._editor.getPosition()),a=Ai(this._editor.getDomNode()),l=a.left+r.left,d=a.top+r.top+r.height;n={x:l,y:d}}const s=this._editor.getOption(126)&&!Xr;this._contextMenuIsBeingShownCount++,this._contextMenuService.showContextMenu({domForShadowRoot:s?this._editor.getDomNode():void 0,getAnchor:()=>n,getActions:()=>e,getActionViewItem:r=>{const a=this._keybindingFor(r);if(a)return new up(r,r,{label:!0,keybinding:a.getLabel(),isMenu:!0});const l=r;return typeof l.getActionViewItem=="function"?l.getActionViewItem():new up(r,r,{icon:!0,label:!0,isMenu:!0})},getKeyBinding:r=>this._keybindingFor(r),onHide:r=>{this._contextMenuIsBeingShownCount--,this._editor.updateOptions({hover:i})}})}_showScrollbarContextMenu(e){if(!this._editor.hasModel()||Iie(this._workspaceContextService.getWorkspace()))return;const t=this._editor.getOption(72);let i=0;const n=d=>({id:`menu-action-${++i}`,label:d.label,tooltip:"",class:void 0,enabled:typeof d.enabled>"u"?!0:d.enabled,checked:d.checked,run:d.run}),s=(d,c)=>new Gg(`menu-action-${++i}`,d,c,void 0),r=(d,c,h,u,f)=>{if(!c)return n({label:d,enabled:c,run:()=>{}});const p=v=>()=>{this._configurationService.updateValue(h,v)},m=[];for(const v of f)m.push(n({label:v.label,checked:u===v.value,run:p(v.value)}));return s(d,m)},a=[];a.push(n({label:g("context.minimap.minimap","Minimap"),checked:t.enabled,run:()=>{this._configurationService.updateValue("editor.minimap.enabled",!t.enabled)}})),a.push(new en),a.push(n({label:g("context.minimap.renderCharacters","Render Characters"),enabled:t.enabled,checked:t.renderCharacters,run:()=>{this._configurationService.updateValue("editor.minimap.renderCharacters",!t.renderCharacters)}})),a.push(r(g("context.minimap.size","Vertical size"),t.enabled,"editor.minimap.size",t.size,[{label:g("context.minimap.size.proportional","Proportional"),value:"proportional"},{label:g("context.minimap.size.fill","Fill"),value:"fill"},{label:g("context.minimap.size.fit","Fit"),value:"fit"}])),a.push(r(g("context.minimap.slider","Slider"),t.enabled,"editor.minimap.showSlider",t.showSlider,[{label:g("context.minimap.slider.mouseover","Mouse Over"),value:"mouseover"},{label:g("context.minimap.slider.always","Always"),value:"always"}]));const l=this._editor.getOption(126)&&!Xr;this._contextMenuIsBeingShownCount++,this._contextMenuService.showContextMenu({domForShadowRoot:l?this._editor.getDomNode():void 0,getAnchor:()=>e,getActions:()=>a,onHide:d=>{this._contextMenuIsBeingShownCount--,this._editor.focus()}})}_keybindingFor(e){return this._keybindingService.lookupKeybinding(e.id)}dispose(){this._contextMenuIsBeingShownCount>0&&this._contextViewService.hideContextView(),this._toDispose.dispose()}};Sp.ID="editor.contrib.contextmenu";Sp=KN=$fe([mh(1,pr),mh(2,ud),mh(3,Ae),mh(4,Nt),mh(5,dl),mh(6,st),mh(7,vu)],Sp);class jfe extends fe{constructor(){super({id:"editor.action.showContextMenu",label:g("action.showContextMenu.label","Show Editor Context Menu"),alias:"Show Editor Context Menu",precondition:void 0,kbOpts:{kbExpr:E.textInputFocus,primary:1092,weight:100}})}run(e,t){var i;(i=Sp.get(t))===null||i===void 0||i.showContextMenu()}}ft(Sp.ID,Sp,2);ne(jfe);class wD{constructor(e){this.selections=e}equals(e){const t=this.selections.length,i=e.selections.length;if(t!==i)return!1;for(let n=0;n<t;n++)if(!this.selections[n].equalsSelection(e.selections[n]))return!1;return!0}}class SD{constructor(e,t,i){this.cursorState=e,this.scrollTop=t,this.scrollLeft=i}}class Tu extends H{static get(e){return e.getContribution(Tu.ID)}constructor(e){super(),this._editor=e,this._isCursorUndoRedo=!1,this._undoStack=[],this._redoStack=[],this._register(e.onDidChangeModel(t=>{this._undoStack=[],this._redoStack=[]})),this._register(e.onDidChangeModelContent(t=>{this._undoStack=[],this._redoStack=[]})),this._register(e.onDidChangeCursorSelection(t=>{if(this._isCursorUndoRedo||!t.oldSelections||t.oldModelVersionId!==t.modelVersionId)return;const i=new wD(t.oldSelections);this._undoStack.length>0&&this._undoStack[this._undoStack.length-1].cursorState.equals(i)||(this._undoStack.push(new SD(i,e.getScrollTop(),e.getScrollLeft())),this._redoStack=[],this._undoStack.length>50&&this._undoStack.shift())}))}cursorUndo(){!this._editor.hasModel()||this._undoStack.length===0||(this._redoStack.push(new SD(new wD(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 SD(new wD(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}}Tu.ID="editor.contrib.cursorUndoRedoController";class Kfe extends fe{constructor(){super({id:"cursorUndo",label:g("cursor.undo","Cursor Undo"),alias:"Cursor Undo",precondition:void 0,kbOpts:{kbExpr:E.textInputFocus,primary:2099,weight:100}})}run(e,t,i){var n;(n=Tu.get(t))===null||n===void 0||n.cursorUndo()}}class qfe extends fe{constructor(){super({id:"cursorRedo",label:g("cursor.redo","Cursor Redo"),alias:"Cursor Redo",precondition:void 0})}run(e,t,i){var n;(n=Tu.get(t))===null||n===void 0||n.cursorRedo()}}ft(Tu.ID,Tu,0);ne(Kfe);ne(qfe);class Gfe{constructor(e,t,i){this.selection=e,this.targetPosition=t,this.copy=i,this.targetSelection=null}getEditOperations(e,t){const i=e.getValueInRange(this.selection);if(this.copy||t.addEditOperation(this.selection,null),t.addEditOperation(new L(this.targetPosition.lineNumber,this.targetPosition.column,this.targetPosition.lineNumber,this.targetPosition.column),i),this.selection.containsPosition(this.targetPosition)&&!(this.copy&&(this.selection.getEndPosition().equals(this.targetPosition)||this.selection.getStartPosition().equals(this.targetPosition)))){this.targetSelection=this.selection;return}if(this.copy){this.targetSelection=new ve(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 ve(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.lineNumber<this.selection.endLineNumber){this.targetSelection=new ve(this.targetPosition.lineNumber,this.targetPosition.column,this.targetPosition.lineNumber+this.selection.endLineNumber-this.selection.startLineNumber,this.selection.startLineNumber===this.selection.endLineNumber?this.targetPosition.column+this.selection.endColumn-this.selection.startColumn:this.selection.endColumn);return}this.selection.endColumn<=this.targetPosition.column?this.targetSelection=new ve(this.targetPosition.lineNumber-this.selection.endLineNumber+this.selection.startLineNumber,this.selection.startLineNumber===this.selection.endLineNumber?this.targetPosition.column-this.selection.endColumn+this.selection.startColumn:this.targetPosition.column-this.selection.endColumn+this.selection.startColumn,this.targetPosition.lineNumber,this.selection.startLineNumber===this.selection.endLineNumber?this.targetPosition.column:this.selection.endColumn):this.targetSelection=new ve(this.targetPosition.lineNumber-this.selection.endLineNumber+this.selection.startLineNumber,this.targetPosition.column,this.targetPosition.lineNumber,this.targetPosition.column+this.selection.endColumn-this.selection.startColumn)}computeCursorState(e,t){return this.targetSelection}}function xf(o){return at?o.altKey:o.ctrlKey}class id extends H{constructor(e){super(),this._editor=e,this._dndDecorationIds=this._editor.createDecorationsCollection(),this._register(this._editor.onMouseDown(t=>this._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)||(xf(e)&&(this._modifierPressed=!0),this._mouseDown&&xf(e)&&this._editor.updateOptions({mouseStyle:"copy"}))}onEditorKeyUp(e){!this._editor.getOption(35)||this._editor.getOption(22)||(xf(e)&&(this._modifierPressed=!1),this._mouseDown&&e.keyCode===id.TRIGGER_KEY_VALUE&&this._editor.updateOptions({mouseStyle:"default"}))}_onEditorMouseDown(e){this._mouseDown=!0}_onEditorMouseUp(e){this._mouseDown=!1,this._editor.updateOptions({mouseStyle:"text"})}_onEditorMouseDrag(e){const t=e.target;if(this._dragSelection===null){const n=(this._editor.getSelections()||[]).filter(s=>t.position&&s.containsPosition(t.position));if(n.length===1)this._dragSelection=n[0];else return}xf(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 P(e.target.position.lineNumber,e.target.position.column);if(this._dragSelection===null){let i=null;if(e.event.shiftKey){const n=this._editor.getSelection();if(n){const{selectionStartLineNumber:s,selectionStartColumn:r}=n;i=[new ve(s,r,t.lineNumber,t.column)]}}else i=(this._editor.getSelections()||[]).map(n=>n.containsPosition(t)?new ve(t.lineNumber,t.column,t.lineNumber,t.column):n);this._editor.setSelections(i||[],"mouse",3)}else(!this._dragSelection.containsPosition(t)||(xf(e.event)||this._modifierPressed)&&(this._dragSelection.getEndPosition().equals(t)||this._dragSelection.getStartPosition().equals(t)))&&(this._editor.pushUndoStop(),this._editor.executeCommand(id.ID,new Gfe(this._dragSelection,t,xf(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 L(e.lineNumber,e.column,e.lineNumber,e.column),options:id._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()}}id.ID="editor.contrib.dragAndDrop";id.TRIGGER_KEY_VALUE=at?6:5;id._DECORATION_OPTIONS=Ve.register({description:"dnd-target",className:"dnd-target"});ft(id.ID,id,2);const eL=function(){if(typeof crypto=="object"&&typeof crypto.randomUUID=="function")return crypto.randomUUID.bind(crypto);let o;typeof crypto=="object"&&typeof crypto.getRandomValues=="function"?o=crypto.getRandomValues.bind(crypto):o=function(i){for(let n=0;n<i.length;n++)i[n]=Math.floor(Math.random()*256);return i};const e=new Uint8Array(16),t=[];for(let i=0;i<256;i++)t.push(i.toString(16).padStart(2,"0"));return function(){o(e),e[6]=e[6]&15|64,e[8]=e[8]&63|128;let n=0,s="";return s+=t[e[n++]],s+=t[e[n++]],s+=t[e[n++]],s+=t[e[n++]],s+="-",s+=t[e[n++]],s+=t[e[n++]],s+="-",s+=t[e[n++]],s+=t[e[n++]],s+="-",s+=t[e[n++]],s+=t[e[n++]],s+="-",s+=t[e[n++]],s+=t[e[n++]],s+=t[e[n++]],s+=t[e[n++]],s+=t[e[n++]],s+=t[e[n++]],s}}();var sV=function(o,e,t,i){function n(s){return s instanceof t?s:new t(function(r){r(s)})}return new(t||(t=Promise))(function(s,r){function a(c){try{d(i.next(c))}catch(h){r(h)}}function l(c){try{d(i.throw(c))}catch(h){r(h)}}function d(c){c.done?s(c.value):n(c.value).then(a,l)}d((i=i.apply(o,e||[])).next())})};function VM(o){return{asString:()=>sV(this,void 0,void 0,function*(){return o}),asFile:()=>{},value:typeof o=="string"?o:void 0}}function Zfe(o,e,t){const i={id:eL(),name:o,uri:e,data:t};return{asString:()=>sV(this,void 0,void 0,function*(){return""}),asFile:()=>i,value:void 0}}class oV{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 Xe.some(this,([i,n])=>n.asFile())&&t.push("files"),aV(iS(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 i=this._entries.get(e);i?i.push(t):this._entries.set(this.toKey(e),[t])}replace(e,t){this._entries.set(this.toKey(e),[t])}delete(e){this._entries.delete(this.toKey(e))}*[Symbol.iterator](){for(const[e,t]of this._entries)for(const i of t)yield[e,i]}toKey(e){return iS(e)}}function iS(o){return o.toLowerCase()}function rV(o,e){return aV(iS(o),e.map(iS))}function aV(o,e){if(o==="*/*")return e.length>0;if(e.includes(o))return!0;const t=o.match(/^([a-z]+)\/([a-z]+|\*)$/i);if(!t)return!1;const[i,n,s]=t;return s==="*"?e.some(r=>r.startsWith(n+"/")):!1}const tL=Object.freeze({create:o=>bc(o.map(e=>e.toString())).join(`\r
669
669
  `),split:o=>o.split(`\r
670
670
  `),parse:o=>tL.split(o).filter(e=>!e.startsWith("#"))}),L5={EDITORS:"CodeEditors",FILES:"CodeFiles"};class Yfe{}const Xfe={DragAndDropContribution:"workbench.contributions.dragAndDrop"};Jt.add(Xfe.DragAndDropContribution,new Yfe);class Yv{constructor(){}static getInstance(){return Yv.INSTANCE}hasData(e){return e&&e===this.proto}getData(e){if(this.hasData(e))return this.data}}Yv.INSTANCE=new Yv;var Qfe=function(o,e,t,i){function n(s){return s instanceof t?s:new t(function(r){r(s)})}return new(t||(t=Promise))(function(s,r){function a(c){try{d(i.next(c))}catch(h){r(h)}}function l(c){try{d(i.throw(c))}catch(h){r(h)}}function d(c){c.done?s(c.value):n(c.value).then(a,l)}d((i=i.apply(o,e||[])).next())})};function lV(o){const e=new oV;for(const t of o.items){const i=t.type;if(t.kind==="string"){const n=new Promise(s=>t.getAsString(s));e.append(i,VM(n))}else if(t.kind==="file"){const n=t.getAsFile();n&&e.append(i,Jfe(n))}}return e}function Jfe(o){const e=o.path?ke.parse(o.path):void 0;return Zfe(o.name,e,()=>Qfe(this,void 0,void 0,function*(){return new Uint8Array(yield o.arrayBuffer())}))}const ege=Object.freeze([L5.EDITORS,L5.FILES,Iv.RESOURCES,Iv.INTERNAL_URI_LIST]);function dV(o,e=!1){const t=lV(o),i=t.get(Iv.INTERNAL_URI_LIST);if(i)t.replace(pi.uriList,i);else if(e||!t.has(pi.uriList)){const n=[];for(const s of o.items){const r=s.getAsFile();if(r){const a=r.path;try{a?n.push(ke.file(a).toString()):n.push(ke.parse(r.name,!0).toString())}catch{}}}n.length&&t.replace(pi.uriList,VM(tL.create(n)))}for(const n of ege)t.delete(n);return t}function tge(o,e,t){var i,n;return{edits:[...e.map(s=>new Ql(o,typeof t.insertText=="string"?{range:s,text:t.insertText,insertAsSnippet:!1}:{range:s,text:t.insertText.snippet,insertAsSnippet:!0})),...(n=(i=t.additionalEdit)===null||i===void 0?void 0:i.edits)!==null&&n!==void 0?n:[]]}}function cV(o){var e;function t(a,l){return"providerId"in a&&a.providerId===l.providerId||"mimeType"in a&&a.mimeType===l.handledMimeType}const i=new Map;for(const a of o)for(const l of(e=a.yieldTo)!==null&&e!==void 0?e:[])for(const d of o)if(d!==a&&t(l,d)){let c=i.get(a);c||(c=[],i.set(a,c)),c.push(d)}if(!i.size)return Array.from(o);const n=new Set,s=[];function r(a){if(!a.length)return[];const l=a[0];if(s.includes(l))return console.warn(`Yield to cycle detected for ${l.providerId}`),a;if(n.has(l))return r(a.slice(1));let d=[];const c=i.get(l);return c&&(s.push(l),d=r(c),s.pop()),n.add(l),[...d,l,...r(a.slice(1))]}return r(Array.from(o))}var ige=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},nge=function(o,e){return function(t,i){e(t,i,o)}},sge=function(o,e,t,i){function n(s){return s instanceof t?s:new t(function(r){r(s)})}return new(t||(t=Promise))(function(s,r){function a(c){try{d(i.next(c))}catch(h){r(h)}}function l(c){try{d(i.throw(c))}catch(h){r(h)}}function d(c){c.done?s(c.value):n(c.value).then(a,l)}d((i=i.apply(o,e||[])).next())})};const oge=Ve.register({description:"inline-progress-widget",stickiness:1,showIfCollapsed:!0,after:{content:w9,inlineClassName:"inline-editor-progress-decoration",inlineClassNameAffectsLetterSpacing:!0}});class iL extends H{constructor(e,t,i,n,s){super(),this.typeId=e,this.editor=t,this.range=i,this.delegate=s,this.allowEditorOverflow=!1,this.suppressMouseDown=!0,this.create(n),this.editor.addContentWidget(this),this.editor.layoutContentWidget(this)}create(e){this.domNode=te(".inline-progress-widget"),this.domNode.role="button",this.domNode.title=e;const t=te("span.icon");this.domNode.append(t),t.classList.add(...Ie.asClassNameArray(oe.loading),"codicon-modifier-spin");const i=()=>{const n=this.editor.getOption(66);this.domNode.style.height=`${n}px`,this.domNode.style.width=`${Math.ceil(.8*n)}px`};i(),this._register(this.editor.onDidChangeConfiguration(n=>{(n.hasChanged(52)||n.hasChanged(66))&&i()})),this._register($(this.domNode,ae.CLICK,n=>{this.delegate.cancel()}))}getId(){return iL.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)}}iL.baseId="editor.widget.inlineProgressWidget";let nS=class extends H{constructor(e,t,i){super(),this.id=e,this._editor=t,this._instantiationService=i,this._showDelay=500,this._showPromise=this._register(new pn),this._currentWidget=new pn,this._operationIdPool=0,this._currentDecorations=t.createDecorationsCollection()}showWhile(e,t,i){return sge(this,void 0,void 0,function*(){const n=this._operationIdPool++;this._currentOperation=n,this.clear(),this._showPromise.value=xc(()=>{const s=L.fromPositions(e);this._currentDecorations.set([{range:s,options:oge}]).length>0&&(this._currentWidget.value=this._instantiationService.createInstance(iL,this.id,this._editor,s,t,i))},this._showDelay);try{return yield i}finally{this._currentOperation===n&&(this.clear(),this._currentOperation=void 0)}})}clear(){this._showPromise.clear(),this._currentDecorations.clear(),this._currentWidget.clear()}};nS=ige([nge(2,Re)],nS);var hV=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},E_=function(o,e){return function(t,i){e(t,i,o)}},x5=function(o,e,t,i){function n(s){return s instanceof t?s:new t(function(r){r(s)})}return new(t||(t=Promise))(function(s,r){function a(c){try{d(i.next(c))}catch(h){r(h)}}function l(c){try{d(i.throw(c))}catch(h){r(h)}}function d(c){c.done?s(c.value):n(c.value).then(a,l)}d((i=i.apply(o,e||[])).next())})},qN;let sS=qN=class extends H{constructor(e,t,i,n,s,r,a,l,d,c){super(),this.typeId=e,this.editor=t,this.showCommand=n,this.range=s,this.edits=r,this.onSelectNewEdit=a,this._contextMenuService=l,this._keybindingService=c,this.allowEditorOverflow=!0,this.suppressMouseDown=!0,this.create(),this.visibleContext=i.bindTo(d),this.visibleContext.set(!0),this._register(Me(()=>this.visibleContext.reset())),this.editor.addContentWidget(this),this.editor.layoutContentWidget(this),this._register(Me(()=>this.editor.removeContentWidget(this))),this._register(this.editor.onDidChangeCursorPosition(h=>{s.containsPosition(h.position)||this.dispose()})),this._register(de.runAndSubscribe(c.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=te(".post-edit-widget"),this.button=this._register(new NE(this.domNode,{supportIcons:!0})),this.button.label="$(insert)",this._register($(this.domNode,ae.CLICK,()=>this.showSelector()))}getId(){return qN.baseId+"."+this.typeId}getDomNode(){return this.domNode}getPosition(){return{position:this.range.getEndPosition(),preference:[2]}}showSelector(){this._contextMenuService.showContextMenu({getAnchor:()=>{const e=Ai(this.button.element);return{x:e.left+e.width,y:e.top+e.height}},getActions:()=>this.edits.allEdits.map((e,t)=>mg({id:"",label:e.label,checked:t===this.edits.activeEditIndex,run:()=>{if(t!==this.edits.activeEditIndex)return this.onSelectNewEdit(t)}}))})}};sS.baseId="editor.widget.postEditWidget";sS=qN=hV([E_(7,pr),E_(8,Ae),E_(9,Nt)],sS);let oS=class extends H{constructor(e,t,i,n,s,r){super(),this._id=e,this._editor=t,this._visibleContext=i,this._showCommand=n,this._instantiationService=s,this._bulkEditService=r,this._currentWidget=this._register(new pn),this._register(de.any(t.onDidChangeModel,t.onDidChangeModelContent)(()=>this.clear()))}applyEditAndShowIfNeeded(e,t,i,n){var s,r;return x5(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 d=[];(typeof l.insertText=="string"?l.insertText==="":l.insertText.snippet==="")?d=[]:d=e.map(v=>new Ql(a.uri,typeof l.insertText=="string"?{range:v,text:l.insertText,insertAsSnippet:!1}:{range:v,text:l.insertText.snippet,insertAsSnippet:!0}));const h={edits:[...d,...(r=(s=l.additionalEdit)===null||s===void 0?void 0:s.edits)!==null&&r!==void 0?r:[]]},u=e[0],f=a.deltaDecorations([],[{range:u,options:{description:"paste-line-suffix",stickiness:0}}]);let p,m;try{p=yield this._bulkEditService.apply(h,{editor:this._editor,token:n}),m=a.getDecorationRange(f[0])}finally{a.deltaDecorations(f,[])}i&&p.isApplied&&t.allEdits.length>1&&this.show(m??u,t,v=>x5(this,void 0,void 0,function*(){const _=this._editor.getModel();_&&(yield _.undo(),this.applyEditAndShowIfNeeded(e,{activeEditIndex:v,allEdits:t.allEdits},i,n))}))})}show(e,t,i){this.clear(),this._editor.hasModel()&&(this._currentWidget.value=this._instantiationService.createInstance(sS,this._id,this._editor,this._visibleContext,this._showCommand,e,t,i))}clear(){this._currentWidget.clear()}tryShowSelector(){var e;(e=this._currentWidget.value)===null||e===void 0||e.showSelector()}};oS=hV([E_(4,Re),E_(5,F0)],oS);var rge=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Df=function(o,e){return function(t,i){e(t,i,o)}},wl=function(o,e,t,i){function n(s){return s instanceof t?s:new t(function(r){r(s)})}return new(t||(t=Promise))(function(s,r){function a(c){try{d(i.next(c))}catch(h){r(h)}}function l(c){try{d(i.throw(c))}catch(h){r(h)}}function d(c){c.done?s(c.value):n(c.value).then(a,l)}d((i=i.apply(o,e||[])).next())})},GN;const uV="editor.changePasteType",fV=new ce("pasteWidgetVisible",!1,g("pasteWidgetVisible","Whether the paste widget is showing")),yD="application/vnd.code.copyMetadata";let Ru=GN=class extends H{static get(e){return e.getContribution(GN.ID)}constructor(e,t,i,n,s,r,a){super(),this._bulkEditService=i,this._clipboardService=n,this._languageFeaturesService=s,this._quickInputService=r,this._progressService=a,this._editor=e;const l=e.getContainerDomNode();this._register($(l,"copy",d=>this.handleCopy(d))),this._register($(l,"cut",d=>this.handleCopy(d))),this._register($(l,"paste",d=>this.handlePaste(d),!0)),this._pasteProgressManager=this._register(new nS("pasteIntoEditor",e,t)),this._postPasteWidgetManager=this._register(t.createInstance(oS,"pasteIntoEditor",e,fV,{id:uV,label:g("postPasteWidgetTitle","Show paste options...")}))}changePasteType(){this._postPasteWidgetManager.tryShowSelector()}pasteAs(e){this._editor.focus();try{this._pasteAsActionContext={preferredId:e},PS().execCommand("paste")}finally{this._pasteAsActionContext=void 0}}isPasteAsEnabled(){return this._editor.getOption(84).enabled&&!this._editor.getOption(90)}handleCopy(e){var t,i;if(!this._editor.hasTextFocus()||(Kc&&this._clipboardService.writeResources([]),!e.clipboardData||!this.isPasteAsEnabled()))return;const n=this._editor.getModel(),s=this._editor.getSelections();if(!n||!s?.length)return;const r=this._editor.getOption(37);let a=s;const l=s.length===1&&s[0].isEmpty();if(l){if(!r)return;a=[new L(a[0].startLineNumber,1,a[0].startLineNumber,1+n.getLineLength(a[0].startLineNumber))]}const d=(t=this._editor._getViewModel())===null||t===void 0?void 0:t.getPlainTextToCopy(s,r,En),h={multicursorText:Array.isArray(d)?d:null,pasteOnNewLine:l,mode:null},u=this._languageFeaturesService.documentPasteEditProvider.ordered(n).filter(_=>!!_.prepareDocumentPaste);if(!u.length){this.setCopyMetadata(e.clipboardData,{defaultPastePayload:h});return}const f=lV(e.clipboardData),p=u.flatMap(_=>{var b;return(b=_.copyMimeTypes)!==null&&b!==void 0?b:[]}),m=eL();this.setCopyMetadata(e.clipboardData,{id:m,providerCopyMimeTypes:p,defaultPastePayload:h});const v=Wi(_=>wl(this,void 0,void 0,function*(){const b=Za(yield Promise.all(u.map(C=>wl(this,void 0,void 0,function*(){try{return yield C.prepareDocumentPaste(n,a,f,_)}catch(w){console.error(w);return}}))));b.reverse();for(const C of b)for(const[w,S]of C)f.replace(w,S);return f}));(i=this._currentCopyOperation)===null||i===void 0||i.dataTransferPromise.cancel(),this._currentCopyOperation={handle:m,dataTransferPromise:v}}handlePaste(e){var t,i;return wl(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 n=this._editor.getModel(),s=this._editor.getSelections();if(!s?.length||!n||!this.isPasteAsEnabled())return;const r=this.fetchCopyMetadata(e),a=dV(e.clipboardData);a.delete(yD);const l=[...e.clipboardData.types,...(i=r?.providerCopyMimeTypes)!==null&&i!==void 0?i:[],pi.uriList],d=this._languageFeaturesService.documentPasteEditProvider.ordered(n).filter(c=>{var h;return(h=c.pasteMimeTypes)===null||h===void 0?void 0:h.some(u=>rV(u,l))});d.length&&(e.preventDefault(),e.stopImmediatePropagation(),this._pasteAsActionContext?this.showPasteAsPick(this._pasteAsActionContext.preferredId,d,s,a,r):this.doPasteInline(d,s,a,r))})}doPasteInline(e,t,i,n){const s=Wi(r=>wl(this,void 0,void 0,function*(){const a=this._editor;if(!a.hasModel())return;const l=a.getModel(),d=new Ac(a,3,void 0,r);try{if(yield this.mergeInDataFromCopy(i,n,d.token),d.token.isCancellationRequested)return;const c=e.filter(u=>D5(u,i));if(!c.length||c.length===1&&c[0].id==="text"){yield this.applyDefaultPasteHandler(i,n,d.token);return}const h=yield this.getPasteEdits(c,i,l,t,d.token);if(d.token.isCancellationRequested)return;if(h.length===1&&h[0].providerId==="text"){yield this.applyDefaultPasteHandler(i,n,d.token);return}if(h.length){const u=a.getOption(84).showPasteSelector==="afterPaste";return this._postPasteWidgetManager.applyEditAndShowIfNeeded(t,{activeEditIndex:0,allEdits:h},u,d.token)}yield this.applyDefaultPasteHandler(i,n,d.token)}finally{d.dispose(),this._currentPasteOperation===s&&(this._currentPasteOperation=void 0)}}));this._pasteProgressManager.showWhile(t[0].getEndPosition(),g("pasteIntoEditorProgress","Running paste handlers. Click to cancel"),s),this._currentPasteOperation=s}showPasteAsPick(e,t,i,n,s){const r=Wi(a=>wl(this,void 0,void 0,function*(){const l=this._editor;if(!l.hasModel())return;const d=l.getModel(),c=new Ac(l,3,void 0,a);try{if(yield this.mergeInDataFromCopy(n,s,c.token),c.token.isCancellationRequested)return;let h=t.filter(m=>D5(m,n));e&&(h=h.filter(m=>m.id===e));const u=yield this.getPasteEdits(h,n,d,i,c.token);if(c.token.isCancellationRequested||!u.length)return;let f;if(e)f=u.at(0);else{const m=yield this._quickInputService.pick(u.map(v=>({label:v.label,description:v.providerId,detail:v.detail,edit:v})),{placeHolder:g("pasteAsPickerPlaceholder","Select Paste Action")});f=m?.edit}if(!f)return;const p=tge(d.uri,i,f);yield this._bulkEditService.apply(p,{editor:this._editor})}finally{c.dispose(),this._currentPasteOperation===r&&(this._currentPasteOperation=void 0)}}));this._progressService.withProgress({location:10,title:g("pasteAsProgress","Running paste handlers")},()=>r)}setCopyMetadata(e,t){e.setData(yD,JSON.stringify(t))}fetchCopyMetadata(e){var t;if(!e.clipboardData)return;const i=e.clipboardData.getData(yD);if(i)try{return JSON.parse(i)}catch{return}const[n,s]=bI.getTextData(e.clipboardData);if(s)return{defaultPastePayload:{mode:s.mode,multicursorText:(t=s.multicursorText)!==null&&t!==void 0?t:null,pasteOnNewLine:!!s.isFromEmptySelection}}}mergeInDataFromCopy(e,t,i){var n;return wl(this,void 0,void 0,function*(){if(t?.id&&((n=this._currentCopyOperation)===null||n===void 0?void 0:n.handle)===t.id){const s=yield this._currentCopyOperation.dataTransferPromise;if(i.isCancellationRequested)return;for(const[r,a]of s)e.replace(r,a)}if(!e.has(pi.uriList)){const s=yield this._clipboardService.readResources();if(i.isCancellationRequested)return;s.length&&e.append(pi.uriList,VM(tL.create(s)))}})}getPasteEdits(e,t,i,n,s){return wl(this,void 0,void 0,function*(){const r=yield FS(Promise.all(e.map(l=>wl(this,void 0,void 0,function*(){var d;try{const c=yield(d=l.provideDocumentPasteEdits)===null||d===void 0?void 0:d.call(l,i,n,t,s);if(c)return Object.assign(Object.assign({},c),{providerId:l.id})}catch(c){console.error(c)}}))),s),a=Za(r??[]);return cV(a)})}applyDefaultPasteHandler(e,t,i){var n,s,r;return wl(this,void 0,void 0,function*(){const a=(n=e.get(pi.text))!==null&&n!==void 0?n:e.get("text");if(!a)return;const l=yield a.asString();if(i.isCancellationRequested)return;const d={text:l,pasteOnNewLine:(s=t?.defaultPastePayload.pasteOnNewLine)!==null&&s!==void 0?s:!1,multicursorText:(r=t?.defaultPastePayload.multicursorText)!==null&&r!==void 0?r:null,mode:null};this._editor.trigger("keyboard","paste",d)})}};Ru.ID="editor.contrib.copyPasteActionController";Ru=GN=rge([Df(1,Re),Df(2,F0),Df(3,pd),Df(4,pe),Df(5,la),Df(6,eB)],Ru);function D5(o,e){var t;return!!(!((t=o.pasteMimeTypes)===null||t===void 0)&&t.some(i=>e.matches(i)))}var HM=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Xv=function(o,e){return function(t,i){e(t,i,o)}},yp=function(o,e,t,i){function n(s){return s instanceof t?s:new t(function(r){r(s)})}return new(t||(t=Promise))(function(s,r){function a(c){try{d(i.next(c))}catch(h){r(h)}}function l(c){try{d(i.throw(c))}catch(h){r(h)}}function d(c){c.done?s(c.value):n(c.value).then(a,l)}d((i=i.apply(o,e||[])).next())})};const zM=g("builtIn","Built-in");class UM{provideDocumentPasteEdits(e,t,i,n){return yp(this,void 0,void 0,function*(){const s=yield this.getEdit(i,n);return s?{insertText:s.insertText,label:s.label,detail:s.detail,handledMimeType:s.handledMimeType,yieldTo:s.yieldTo}:void 0})}provideDocumentOnDropEdits(e,t,i,n){return yp(this,void 0,void 0,function*(){const s=yield this.getEdit(i,n);return s?{insertText:s.insertText,label:s.label,handledMimeType:s.handledMimeType,yieldTo:s.yieldTo}:void 0})}}class gV extends UM{constructor(){super(...arguments),this.id="text",this.dropMimeTypes=[pi.text],this.pasteMimeTypes=[pi.text]}getEdit(e,t){return yp(this,void 0,void 0,function*(){const i=e.get(pi.text);if(!i||e.has(pi.uriList))return;const n=yield i.asString();return{handledMimeType:pi.text,label:g("text.label","Insert Plain Text"),detail:zM,insertText:n}})}}class pV extends UM{constructor(){super(...arguments),this.id="uri",this.dropMimeTypes=[pi.uriList],this.pasteMimeTypes=[pi.uriList]}getEdit(e,t){return yp(this,void 0,void 0,function*(){const i=yield mV(e);if(!i.length||t.isCancellationRequested)return;let n=0;const s=i.map(({uri:a,originalText:l})=>a.scheme===qe.file?a.fsPath:(n++,l)).join(" ");let r;return n>0?r=i.length>1?g("defaultDropProvider.uriList.uris","Insert Uris"):g("defaultDropProvider.uriList.uri","Insert Uri"):r=i.length>1?g("defaultDropProvider.uriList.paths","Insert Paths"):g("defaultDropProvider.uriList.path","Insert Path"),{handledMimeType:pi.uriList,insertText:s,label:r,detail:zM}})}}let rS=class extends UM{constructor(e){super(),this._workspaceContextService=e,this.id="relativePath",this.dropMimeTypes=[pi.uriList],this.pasteMimeTypes=[pi.uriList]}getEdit(e,t){return yp(this,void 0,void 0,function*(){const i=yield mV(e);if(!i.length||t.isCancellationRequested)return;const n=Za(i.map(({uri:s})=>{const r=this._workspaceContextService.getWorkspaceFolder(s);return r?mJ(r.uri,s):void 0}));if(n.length)return{handledMimeType:pi.uriList,insertText:n.join(" "),label:i.length>1?g("defaultDropProvider.uriList.relativePaths","Insert Relative Paths"):g("defaultDropProvider.uriList.relativePath","Insert Relative Path"),detail:zM}})}};rS=HM([Xv(0,vu)],rS);function mV(o){return yp(this,void 0,void 0,function*(){const e=o.get(pi.uriList);if(!e)return[];const t=yield e.asString(),i=[];for(const n of tL.parse(t))try{i.push({uri:ke.parse(n),originalText:n})}catch{}return i})}let ZN=class extends H{constructor(e,t){super(),this._register(e.documentOnDropEditProvider.register("*",new gV)),this._register(e.documentOnDropEditProvider.register("*",new pV)),this._register(e.documentOnDropEditProvider.register("*",new rS(t)))}};ZN=HM([Xv(0,pe),Xv(1,vu)],ZN);let YN=class extends H{constructor(e,t){super(),this._register(e.documentPasteEditProvider.register("*",new gV)),this._register(e.documentPasteEditProvider.register("*",new pV)),this._register(e.documentPasteEditProvider.register("*",new rS(t)))}};YN=HM([Xv(0,pe),Xv(1,vu)],YN);ft(Ru.ID,Ru,0);Ny(YN);re(new class extends tn{constructor(){super({id:uV,precondition:fV,kbOpts:{weight:100,primary:2137}})}runEditorCommand(o,e,t){var i;return(i=Ru.get(e))===null||i===void 0?void 0:i.changePasteType()}});ne(class extends fe{constructor(){super({id:"editor.action.pasteAs",label:g("pasteAs","Paste As..."),alias:"Paste As...",precondition:void 0,description:{description:"Paste as",args:[{name:"args",schema:{type:"object",properties:{id:{type:"string",description:g("pasteAs.id","The id of the paste edit to try applying. If not provided, the editor will show a picker.")}}}}]}})}run(o,e,t){var i;const n=typeof t?.id=="string"?t.id:void 0;return(i=Ru.get(e))===null||i===void 0?void 0:i.pasteAs(n)}});class age{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 k5{constructor(e){this.identifier=e}}const _V=et("treeViewsDndService");dt(_V,age,1);var lge=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},gC=function(o,e){return function(t,i){e(t,i,o)}},Im=function(o,e,t,i){function n(s){return s instanceof t?s:new t(function(r){r(s)})}return new(t||(t=Promise))(function(s,r){function a(c){try{d(i.next(c))}catch(h){r(h)}}function l(c){try{d(i.throw(c))}catch(h){r(h)}}function d(c){c.done?s(c.value):n(c.value).then(a,l)}d((i=i.apply(o,e||[])).next())})},XN;const vV="editor.experimental.dropIntoEditor.defaultProvider",bV="editor.changeDropType",CV=new ce("dropWidgetVisible",!1,g("dropWidgetVisible","Whether the drop widget is showing"));let Lp=XN=class extends H{static get(e){return e.getContribution(XN.ID)}constructor(e,t,i,n,s){super(),this._configService=i,this._languageFeaturesService=n,this._treeViewsDragAndDropService=s,this.treeItemsTransfer=Yv.getInstance(),this._dropProgressManager=this._register(t.createInstance(nS,"dropIntoEditor",e)),this._postDropWidgetManager=this._register(t.createInstance(oS,"dropIntoEditor",e,CV,{id:bV,label:g("postDropWidgetTitle","Show drop options...")})),this._register(e.onDropIntoEditor(r=>this.onDropIntoEditor(e,r.position,r.event)))}changeDropType(){this._postDropWidgetManager.tryShowSelector()}onDropIntoEditor(e,t,i){var n;return Im(this,void 0,void 0,function*(){if(!i.dataTransfer||!e.hasModel())return;(n=this._currentOperation)===null||n===void 0||n.cancel(),e.focus(),e.setPosition(t);const s=Wi(r=>Im(this,void 0,void 0,function*(){const a=new Ac(e,1,void 0,r);try{const l=yield this.extractDataTransferData(i);if(l.size===0||a.token.isCancellationRequested)return;const d=e.getModel();if(!d)return;const c=this._languageFeaturesService.documentOnDropEditProvider.ordered(d).filter(u=>u.dropMimeTypes?u.dropMimeTypes.some(f=>l.matches(f)):!0),h=yield this.getDropEdits(c,d,t,l,a);if(a.token.isCancellationRequested)return;if(h.length){const u=this.getInitialActiveEditIndex(d,h),f=e.getOption(36).showDropSelector==="afterDrop";yield this._postDropWidgetManager.applyEditAndShowIfNeeded([L.fromPositions(t)],{activeEditIndex:u,allEdits:h},f,r)}}finally{a.dispose(),this._currentOperation===s&&(this._currentOperation=void 0)}}));this._dropProgressManager.showWhile(t,g("dropIntoEditorProgress","Running drop handlers. Click to cancel"),s),this._currentOperation=s})}getDropEdits(e,t,i,n,s){return Im(this,void 0,void 0,function*(){const r=yield FS(Promise.all(e.map(l=>Im(this,void 0,void 0,function*(){try{const d=yield l.provideDocumentOnDropEdits(t,i,n,s.token);if(d)return Object.assign(Object.assign({},d),{providerId:l.id})}catch(d){console.error(d)}}))),s.token),a=Za(r??[]);return cV(a)})}getInitialActiveEditIndex(e,t){const i=this._configService.getValue(vV,{resource:e.uri});for(const[n,s]of Object.entries(i)){const r=t.findIndex(a=>s===a.providerId&&a.handledMimeType&&rV(n,[a.handledMimeType]));if(r>=0)return r}return 0}extractDataTransferData(e){return Im(this,void 0,void 0,function*(){if(!e.dataTransfer)return new oV;const t=dV(e.dataTransfer);if(this.treeItemsTransfer.hasData(k5.prototype)){const i=this.treeItemsTransfer.getData(k5.prototype);if(Array.isArray(i))for(const n of i){const s=yield this._treeViewsDragAndDropService.removeDragOperationTransfer(n.identifier);if(s)for(const[r,a]of s)t.replace(r,a)}}return t})}};Lp.ID="editor.contrib.dropIntoEditorController";Lp=XN=lge([gC(1,Re),gC(2,st),gC(3,pe),gC(4,_V)],Lp);ft(Lp.ID,Lp,2);re(new class extends tn{constructor(){super({id:bV,precondition:CV,kbOpts:{weight:100,primary:2137}})}runEditorCommand(o,e,t){var i;(i=Lp.get(e))===null||i===void 0||i.changeDropType()}});Ny(ZN);Jt.as(aa.Configuration).registerConfiguration(Object.assign(Object.assign({},cy),{properties:{[vV]:{type:"object",scope:5,description:g("defaultProviderDescription","Configures the default drop provider to use for content of a given mime type."),default:{},additionalProperties:{type:"string"}}}}));class jn{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<this._decorations.length?this._decorations[e]:null;return t?this._editor.getModel().getDecorationRange(t):null}getCurrentMatchesPosition(e){const t=this._editor.getModel().getDecorationsInRange(e);for(const i of t){const n=i.options;if(n===jn._FIND_MATCH_DECORATION||n===jn._CURRENT_FIND_MATCH_DECORATION)return this._getDecorationIndex(i.id)}return 0}setCurrentFindMatch(e){let t=null,i=0;if(e)for(let n=0,s=this._decorations.length;n<s;n++){const r=this._editor.getModel().getDecorationRange(this._decorations[n]);if(e.equalsRange(r)){t=this._decorations[n],i=n+1;break}}return(this._highlightedDecorationId!==null||t!==null)&&this._editor.changeDecorations(n=>{if(this._highlightedDecorationId!==null&&(n.changeDecorationOptions(this._highlightedDecorationId,jn._FIND_MATCH_DECORATION),this._highlightedDecorationId=null),t!==null&&(this._highlightedDecorationId=t,n.changeDecorationOptions(this._highlightedDecorationId,jn._CURRENT_FIND_MATCH_DECORATION)),this._rangeHighlightDecorationId!==null&&(n.removeDecoration(this._rangeHighlightDecorationId),this._rangeHighlightDecorationId=null),t!==null){let s=this._editor.getModel().getDecorationRange(t);if(s.startLineNumber!==s.endLineNumber&&s.endColumn===1){const r=s.endLineNumber-1,a=this._editor.getModel().getLineMaxColumn(r);s=new L(s.startLineNumber,s.startColumn,r,a)}this._rangeHighlightDecorationId=n.addDecoration(s,jn._RANGE_HIGHLIGHT_DECORATION)}}),i}set(e,t){this._editor.changeDecorations(i=>{let n=jn._FIND_MATCH_DECORATION;const s=[];if(e.length>1e3){n=jn._FIND_MATCH_NO_OVERVIEW_DECORATION;const a=this._editor.getModel().getLineCount(),d=this._editor.getLayoutInfo().height/a,c=Math.max(2,Math.ceil(3/d));let h=e[0].range.startLineNumber,u=e[0].range.endLineNumber;for(let f=1,p=e.length;f<p;f++){const m=e[f].range;u+c>=m.startLineNumber?m.endLineNumber>u&&(u=m.endLineNumber):(s.push({range:new L(h,1,u,1),options:jn._FIND_MATCH_ONLY_OVERVIEW_DECORATION}),h=m.startLineNumber,u=m.endLineNumber)}s.push({range:new L(h,1,u,1),options:jn._FIND_MATCH_ONLY_OVERVIEW_DECORATION})}const r=new Array(e.length);for(let a=0,l=e.length;a<l;a++)r[a]={range:e[a].range,options:n};this._decorations=i.deltaDecorations(this._decorations,r),this._overviewRulerApproximateDecorations=i.deltaDecorations(this._overviewRulerApproximateDecorations,s),this._rangeHighlightDecorationId&&(i.removeDecoration(this._rangeHighlightDecorationId),this._rangeHighlightDecorationId=null),this._findScopeDecorationIds.length&&(this._findScopeDecorationIds.forEach(a=>i.removeDecoration(a)),this._findScopeDecorationIds=[]),t?.length&&(this._findScopeDecorationIds=t.map(a=>i.addDecoration(a,jn._FIND_SCOPE_DECORATION)))})}matchBeforePosition(e){if(this._decorations.length===0)return null;for(let t=this._decorations.length-1;t>=0;t--){const i=this._decorations[t],n=this._editor.getModel().getDecorationRange(i);if(!(!n||n.endLineNumber>e.lineNumber)){if(n.endLineNumber<e.lineNumber)return n;if(!(n.endColumn>e.column))return n}}return this._editor.getModel().getDecorationRange(this._decorations[this._decorations.length-1])}matchAfterPosition(e){if(this._decorations.length===0)return null;for(let t=0,i=this._decorations.length;t<i;t++){const n=this._decorations[t],s=this._editor.getModel().getDecorationRange(n);if(!(!s||s.startLineNumber<e.lineNumber)){if(s.startLineNumber>e.lineNumber)return s;if(!(s.startColumn<e.column))return s}}return this._editor.getModel().getDecorationRange(this._decorations[0])}_allDecorations(){let e=[];return e=e.concat(this._decorations),e=e.concat(this._overviewRulerApproximateDecorations),this._findScopeDecorationIds.length&&e.push(...this._findScopeDecorationIds),this._rangeHighlightDecorationId&&e.push(this._rangeHighlightDecorationId),e}}jn._CURRENT_FIND_MATCH_DECORATION=Ve.register({description:"current-find-match",stickiness:1,zIndex:13,className:"currentFindMatch",showIfCollapsed:!0,overviewRuler:{color:ti(G2),position:lo.Center},minimap:{color:ti(Qf),position:Os.Inline}});jn._FIND_MATCH_DECORATION=Ve.register({description:"find-match",stickiness:1,zIndex:10,className:"findMatch",showIfCollapsed:!0,overviewRuler:{color:ti(G2),position:lo.Center},minimap:{color:ti(Qf),position:Os.Inline}});jn._FIND_MATCH_NO_OVERVIEW_DECORATION=Ve.register({description:"find-match-no-overview",stickiness:1,className:"findMatch",showIfCollapsed:!0});jn._FIND_MATCH_ONLY_OVERVIEW_DECORATION=Ve.register({description:"find-match-only-overview",stickiness:1,overviewRuler:{color:ti(G2),position:lo.Center}});jn._RANGE_HIGHLIGHT_DECORATION=Ve.register({description:"find-range-highlight",stickiness:1,className:"rangeHighlight",isWholeLine:!0});jn._FIND_SCOPE_DECORATION=Ve.register({description:"find-scope",className:"findScope",isWholeLine:!0});class dge{constructor(e,t,i){this._editorSelection=e,this._ranges=t,this._replaceStrings=i,this._trackedEditorSelectionId=null}getEditOperations(e,t){if(this._ranges.length>0){const i=[];for(let r=0;r<this._ranges.length;r++)i.push({range:this._ranges[r],text:this._replaceStrings[r]});i.sort((r,a)=>L.compareRangesUsingStarts(r.range,a.range));const n=[];let s=i[0];for(let r=1;r<i.length;r++)s.range.endLineNumber===i[r].range.startLineNumber&&s.range.endColumn===i[r].range.startColumn?(s.range=s.range.plusRange(i[r].range),s.text=s.text+i[r].text):(n.push(s),s=i[r]);n.push(s);for(const r of n)t.addEditOperation(r.range,r.text)}this._trackedEditorSelectionId=t.trackSelection(this._editorSelection)}computeCursorState(e,t){return t.getTrackedSelection(this._trackedEditorSelectionId)}}function wV(o,e){if(o&&o[0]!==""){const t=I5(o,e,"-"),i=I5(o,e,"_");return t&&!i?E5(o,e,"-"):!t&&i?E5(o,e,"_"):o[0].toUpperCase()===o[0]?e.toUpperCase():o[0].toLowerCase()===o[0]?e.toLowerCase():KU(o[0][0])&&e.length>0?e[0].toUpperCase()+e.substr(1):o[0][0].toUpperCase()!==o[0][0]&&e.length>0?e[0].toLowerCase()+e.substr(1):e}else return e}function I5(o,e,t){return o[0].indexOf(t)!==-1&&e.indexOf(t)!==-1&&o[0].split(t).length===e.split(t).length}function E5(o,e,t){const i=e.split(t),n=o[0].split(t);let s="";return i.forEach((r,a)=>{s+=wV([n[a]],r)+t}),s.slice(0,-1)}class N5{constructor(e){this.staticValue=e,this.kind=0}}class cge{constructor(e){this.pieces=e,this.kind=1}}class xp{static fromStaticValue(e){return new xp([ru.staticValue(e)])}get hasReplacementPatterns(){return this._state.kind===1}constructor(e){!e||e.length===0?this._state=new N5(""):e.length===1&&e[0].staticValue!==null?this._state=new N5(e[0].staticValue):this._state=new cge(e)}buildReplaceString(e,t){if(this._state.kind===0)return t?wV(e,this._state.staticValue):this._state.staticValue;let i="";for(let n=0,s=this._state.pieces.length;n<s;n++){const r=this._state.pieces[n];if(r.staticValue!==null){i+=r.staticValue;continue}let a=xp._substitute(r.matchIndex,e);if(r.caseOps!==null&&r.caseOps.length>0){const l=[],d=r.caseOps.length;let c=0;for(let h=0,u=a.length;h<u;h++){if(c>=d){l.push(a.slice(h));break}switch(r.caseOps[c]){case"U":l.push(a[h].toUpperCase());break;case"u":l.push(a[h].toUpperCase()),c++;break;case"L":l.push(a[h].toLowerCase());break;case"l":l.push(a[h].toLowerCase()),c++;break;default:l.push(a[h])}}a=l.join("")}i+=a}return i}static _substitute(e,t){if(t===null)return"";if(e===0)return t[0];let i="";for(;e>0;){if(e<t.length)return(t[e]||"")+i;i=String(e%10)+i,e=Math.floor(e/10)}return"$"+i}}class ru{static staticValue(e){return new ru(e,-1,null)}static caseOps(e,t){return new ru(null,e,t)}constructor(e,t,i){this.staticValue=e,this.matchIndex=t,!i||i.length===0?this.caseOps=null:this.caseOps=i.slice(0)}}class hge{constructor(e){this._source=e,this._lastCharIndex=0,this._result=[],this._resultLen=0,this._currentStaticPiece=""}emitUnchanged(e){this._emitStatic(this._source.substring(this._lastCharIndex,e)),this._lastCharIndex=e}emitStatic(e,t){this._emitStatic(e),this._lastCharIndex=t}_emitStatic(e){e.length!==0&&(this._currentStaticPiece+=e)}emitMatchIndex(e,t,i){this._currentStaticPiece.length!==0&&(this._result[this._resultLen++]=ru.staticValue(this._currentStaticPiece),this._currentStaticPiece=""),this._result[this._resultLen++]=ru.caseOps(e,i),this._lastCharIndex=t}finalize(){return this.emitUnchanged(this._source.length),this._currentStaticPiece.length!==0&&(this._result[this._resultLen++]=ru.staticValue(this._currentStaticPiece),this._currentStaticPiece=""),new xp(this._result)}}function uge(o){if(!o||o.length===0)return new xp(null);const e=[],t=new hge(o);for(let i=0,n=o.length;i<n;i++){const s=o.charCodeAt(i);if(s===92){if(i++,i>=n)break;const r=o.charCodeAt(i);switch(r){case 92:t.emitUnchanged(i-1),t.emitStatic("\\",i+1);break;case 110:t.emitUnchanged(i-1),t.emitStatic(`