/*!--------------------------------------------------------
 * Copyright (C) Microsoft Corporation. All rights reserved.
 *--------------------------------------------------------*/
(function(){
var e=["exports","require","vs/base/common/path","vs/platform/instantiation/common/instantiation","vs/base/common/types","vs/base/common/objects","vs/nls!vs/code/node/cliProcessMain","vs/nls","vs/base/common/event","vs/platform/log/common/log","vs/base/node/pfs","vs/base/common/lifecycle","vs/platform/configuration/common/configuration","vs/base/common/strings","vs/platform/registry/common/platform","vs/base/common/platform","vs/platform/environment/common/environment","vs/base/common/arrays","vs/platform/configuration/common/configurationRegistry","vs/platform/extensionManagement/common/extensionManagementUtil","vs/base/common/uri","vs/base/common/errors","vs/platform/product/node/package","fs","os","vs/platform/product/node/product","vs/platform/extensionManagement/common/extensionManagement","vs/base/common/async","vs/platform/telemetry/common/telemetry","vs/platform/extensions/common/extensions","vs/base/node/extfs","vs/platform/extensions/node/extensionValidator","vs/base/common/network","vs/base/common/cancellation","vs/platform/instantiation/common/descriptors","vs/base/common/errorMessage","vs/platform/extensions/node/extensionsUtil","vs/base/common/amd","vs/base/node/request","vs/platform/instantiation/common/serviceCollection","vs/platform/configuration/common/configurationModels","vs/platform/request/node/request","vs/base/common/json","vs/base/common/uuid","vs/base/node/zip","vs/platform/extensionManagement/node/extensionManagementUtil","vs/platform/request/node/requestService","vs/platform/extensionManagement/node/extensionsManifestCache","vs/base/common/labels","vs/platform/instantiation/common/graph","vs/platform/download/common/download","vs/base/common/date","vs/base/common/collections","vs/base/common/mime","vs/nls!vs/base/common/errorMessage","vs/platform/instantiation/common/instantiationService","vs/platform/extensionManagement/node/extensionGalleryService","vs/base/node/paths","vs/platform/log/node/spdlogService","vs/base/common/decorators","vs/nls!vs/base/node/zip","vs/platform/environment/node/environmentService","vs/nls!vs/platform/configuration/common/configurationRegistry","vs/nls!vs/platform/extensionManagement/common/extensionManagement","vs/nls!vs/platform/extensionManagement/node/extensionManagementService","vs/nls!vs/platform/extensionManagement/node/extensionManagementUtil","vs/nls!vs/platform/extensions/node/extensionValidator","vs/platform/jsonschemas/common/jsonContributionRegistry","vs/nls!vs/platform/request/node/request","vs/nls!vs/platform/telemetry/common/telemetryService","vs/base/node/proxy","vs/base/common/map","vs/platform/configuration/node/configuration","vs/platform/configuration/node/configurationService","vs/platform/extensionManagement/common/extensionNls","vs/platform/state/common/state","vs/platform/state/node/stateService","vs/platform/extensionManagement/node/extensionLifecycle","vs/platform/telemetry/common/telemetryService","vs/platform/telemetry/common/telemetryUtils","vs/platform/telemetry/node/appInsightsAppender","semver","vs/platform/telemetry/node/commonProperties","url","vs/base/common/assert","vs/platform/extensionManagement/node/extensionManagementService","vs/base/node/config","yazl","yauzl","applicationinsights","crypto","child_process","zlib","vs/base/common/resources","vs/base/common/glob","vs/code/node/cliProcessMain"],t=function(t){
for(var n=[],i=0,r=t.length;i<r;i++)n[i]=e[t[i]];return n};define(e[84],t([1,0]),function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ok=function(e,t){if(!e)throw new Error(t?"Assertion failed ("+t+")":"Assertion Failed")}}),define(e[52],t([1,0]),function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=Object.prototype.hasOwnProperty;t.values=function(e){const t=[];for(let i in e)n.call(e,i)&&t.push(e[i]);return t},t.size=function(e){let t=0;for(let i in e)n.call(e,i)&&(t+=1);return t},t.first=function(e){for(let t in e)if(n.call(e,t))return e[t]},t.forEach=function(e,t){for(let i in e)if(n.call(e,i)&&!1===t({key:i,value:e[i]},function(){delete e[i]}))return},t.groupBy=function(e,t){const n=Object.create(null);for(const i of e){const e=t(i);let r=n[e];r||(r=n[e]=[]),r.push(i)}return n},t.fromMap=function(e){const t=Object.create(null);return e&&e.forEach((e,n)=>{t[n]=e}),t}}),define(e[59],t([1,0]),function(e,t){"use strict";function n(e){return(t,n,i)=>{
let r=null,s=null;if("function"==typeof i.value?(r="value",s=i.value):"function"==typeof i.get&&(r="get",s=i.get),!s)throw new Error("not supported");i[r]=e(s,n)}}Object.defineProperty(t,"__esModule",{value:!0}),t.createDecorator=n,t.memoize=function(e,t,n){let i=null,r=null;if("function"==typeof n.value?(i="value",0!==(r=n.value).length&&console.warn("Memoize should only be used in functions with zero parameters")):"function"==typeof n.get&&(i="get",r=n.get),!r)throw new Error("not supported");const s=`$memoize$${t}`;n[i]=function(...e){return this.hasOwnProperty(s)||Object.defineProperty(this,s,{configurable:!1,enumerable:!1,writable:!1,value:r.apply(this,e)}),this[s]}},t.debounce=function(e,t,i){return n((n,r)=>{const s=`$debounce$${r}`,o=`$debounce$result$${r}`;return function(...r){this[o]||(this[o]=i?i():void 0),clearTimeout(this[s]),t&&(this[o]=t(this[o],...r),r=[this[o]]),this[s]=setTimeout(()=>{n.apply(this,r),this[o]=i?i():void 0},e)}})}}),define(e[42],t([1,0]),function(e,t){"use strict"
;function n(e,t=!1){function n(t){let n=0,i=0;for(;n<t;){let t=e.charCodeAt(a);if(t>=48&&t<=57)i=16*i+t-48;else if(t>=65&&t<=70)i=16*i+t-65+10;else{if(!(t>=97&&t<=102))break;i=16*i+t-97+10}a++,n++}return n<t&&(i=-1),i}function o(){if(c="",h=0,u=a,a>=l)return u=l,d=17;let t=e.charCodeAt(a);if(i(t)){do{a++,c+=String.fromCharCode(t),t=e.charCodeAt(a)}while(i(t));return d=15}if(r(t))return a++,c+=String.fromCharCode(t),13===t&&10===e.charCodeAt(a)&&(a++,c+="\n"),d=14;switch(t){case 123:return a++,d=1;case 125:return a++,d=2;case 91:return a++,d=3;case 93:return a++,d=4;case 58:return a++,d=6;case 44:return a++,d=5;case 34:return a++,c=function(){let t="",i=a;for(;;){if(a>=l){t+=e.substring(i,a),h=2;break}let s=e.charCodeAt(a);if(34===s){t+=e.substring(i,a),a++;break}if(92!==s){if(s>=0&&s<=31){if(r(s)){t+=e.substring(i,a),h=2;break}h=6}a++}else{if(t+=e.substring(i,a),++a>=l){h=2;break}switch(i=e.charCodeAt(a++)){case 34:t+='"';break;case 92:t+="\\";break;case 47:t+="/";break;case 98:t+="\b";break;case 102:t+="\f"
;break;case 110:t+="\n";break;case 114:t+="\r";break;case 116:t+="\t";break;case 117:let i=n(4);i>=0?t+=String.fromCharCode(i):h=4;break;default:h=5}i=a}}return t}(),d=10;case 47:let o=a-1;if(47===e.charCodeAt(a+1)){for(a+=2;a<l&&!r(e.charCodeAt(a));)a++;return c=e.substring(o,a),d=12}if(42===e.charCodeAt(a+1)){a+=2;let t=l-1,n=!1;for(;a<t;){if(42===e.charCodeAt(a)&&47===e.charCodeAt(a+1)){a+=2,n=!0;break}a++}return n||(a++,h=1),c=e.substring(o,a),d=13}return c+=String.fromCharCode(t),a++,d=16;case 45:if(c+=String.fromCharCode(t),++a===l||!s(e.charCodeAt(a)))return d=16;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return c+=function(){let t=a;if(48===e.charCodeAt(a))a++;else for(a++;a<e.length&&s(e.charCodeAt(a));)a++;if(a<e.length&&46===e.charCodeAt(a)){if(!(++a<e.length&&s(e.charCodeAt(a))))return h=3,e.substring(t,a);for(a++;a<e.length&&s(e.charCodeAt(a));)a++}let n=a
;if(a<e.length&&(69===e.charCodeAt(a)||101===e.charCodeAt(a)))if((++a<e.length&&43===e.charCodeAt(a)||45===e.charCodeAt(a))&&a++,a<e.length&&s(e.charCodeAt(a))){for(a++;a<e.length&&s(e.charCodeAt(a));)a++;n=a}else h=3;return e.substring(t,n)}(),d=11;default:for(;a<l&&function(e){if(i(e)||r(e))return!1;switch(e){case 125:case 93:case 123:case 91:case 34:case 58:case 44:case 47:return!1}return!0}(t);)a++,t=e.charCodeAt(a);if(u!==a){switch(c=e.substring(u,a)){case"true":return d=8;case"false":return d=9;case"null":return d=7}return d=16}return c+=String.fromCharCode(t),a++,d=16}}let a=0,l=e.length,c="",u=0,d=16,h=0;return{setPosition:function(e){a=e,c="",u=0,d=16,h=0},getPosition:()=>a,scan:t?function(){let e;do{e=o()}while(e>=12&&e<=15);return e}:o,getToken:()=>d,getTokenValue:()=>c,getTokenOffset:()=>u,getTokenLength:()=>a-u,getTokenError:()=>h}}function i(e){return 32===e||9===e||11===e||12===e||160===e||5760===e||e>=8192&&e<=8203||8239===e||8287===e||12288===e||65279===e}function r(e){
return 10===e||13===e||8232===e||8233===e}function s(e){return e>=48&&e<=57}function o(e){if(!e.parent||!e.parent.children)return[];let t=o(e.parent);if("property"===e.parent.type){let n=e.parent.children[0].value;t.push(n)}else if("array"===e.parent.type){let n=e.parent.children.indexOf(e);-1!==n&&t.push(n)}return t}function a(e){switch(e.type){case"array":return e.children.map(a);case"object":let t=Object.create(null);for(let n of e.children){let e=n.children[1];e&&(t[n.children[0].value]=a(e))}return t;case"null":case"string":case"number":case"boolean":return e.value;default:return}}function l(e,t,n=!1){return t>=e.offset&&t<e.offset+e.length||n&&t===e.offset+e.length}function c(e,t,n=!1){if(l(e,t,n)){let i=e.children;if(Array.isArray(i))for(let e=0;e<i.length&&i[e].offset<=t;e++){let r=c(i[e],t,n);if(r)return r}return e}}function u(e,t,i=h.DEFAULT){function r(e){return e?()=>e(d.getTokenOffset(),d.getTokenLength()):()=>!0}function s(e){return e?t=>e(t,d.getTokenOffset(),d.getTokenLength()):()=>!0}
function o(){for(;;){let e=d.scan();switch(d.getTokenError()){case 4:a(14);break;case 5:a(15);break;case 3:a(13);break;case 1:C||a(11);break;case 2:a(12);break;case 6:a(16)}switch(e){case 12:case 13:C?a(10):S();break;case 16:a(1);break;case 15:case 14:break;default:return e}}}function a(e,t=[],n=[]){if(x(e),t.length+n.length>0){let e=d.getToken();for(;17!==e;){if(-1!==t.indexOf(e)){o();break}if(-1!==n.indexOf(e))break;e=o()}}}function l(e){let t=d.getTokenValue();return e?y(t):g(t),o(),!0}function c(){return 10!==d.getToken()?(a(3,[],[2,5]),!1):(l(!1),6===d.getToken()?(E(":"),o(),u()||a(4,[],[2,5])):a(5,[],[2,5]),!0)}function u(){switch(d.getToken()){case 3:return function(){m(),o();let e=!1;for(;4!==d.getToken()&&17!==d.getToken();){if(5===d.getToken()){if(e||a(4,[],[]),E(","),o(),4===d.getToken()&&b)break}else e&&a(6,[],[]);u()||a(4,[],[4,5]),e=!0}return v(),4!==d.getToken()?a(8,[4],[]):o(),!0}();case 1:return function(){f(),o();let e=!1;for(;2!==d.getToken()&&17!==d.getToken();){if(5===d.getToken()){
if(e||a(4,[],[]),E(","),o(),2===d.getToken()&&b)break}else e&&a(6,[],[]);c()||a(4,[],[2,5]),e=!0}return p(),2!==d.getToken()?a(7,[2],[]):o(),!0}();case 10:return l(!0);default:return function(){switch(d.getToken()){case 11:let e=0;try{"number"!=typeof(e=JSON.parse(d.getTokenValue()))&&(a(2),e=0)}catch(e){a(2)}y(e);break;case 7:y(null);break;case 8:y(!0);break;case 9:y(!1);break;default:return!1}return o(),!0}()}}let d=n(e,!1),f=r(t.onObjectBegin),g=s(t.onObjectProperty),p=r(t.onObjectEnd),m=r(t.onArrayBegin),v=r(t.onArrayEnd),y=s(t.onLiteralValue),E=s(t.onSeparator),S=r(t.onComment),x=s(t.onError),C=i&&i.disallowComments,b=i&&i.allowTrailingComma;return o(),17===d.getToken()||(u()?(17!==d.getToken()&&a(9,[],[]),!0):(a(4,[],[]),!1))}function d(e){switch(typeof e){case"boolean":return"boolean";case"number":return"number";case"string":return"string";default:return"null"}}Object.defineProperty(t,"__esModule",{value:!0});!function(e){e[e.None=0]="None",e[e.UnexpectedEndOfComment=1]="UnexpectedEndOfComment",
e[e.UnexpectedEndOfString=2]="UnexpectedEndOfString",e[e.UnexpectedEndOfNumber=3]="UnexpectedEndOfNumber",e[e.InvalidUnicode=4]="InvalidUnicode",e[e.InvalidEscapeCharacter=5]="InvalidEscapeCharacter",e[e.InvalidCharacter=6]="InvalidCharacter"}(t.ScanError||(t.ScanError={}));!function(e){e[e.OpenBraceToken=1]="OpenBraceToken",e[e.CloseBraceToken=2]="CloseBraceToken",e[e.OpenBracketToken=3]="OpenBracketToken",e[e.CloseBracketToken=4]="CloseBracketToken",e[e.CommaToken=5]="CommaToken",e[e.ColonToken=6]="ColonToken",e[e.NullKeyword=7]="NullKeyword",e[e.TrueKeyword=8]="TrueKeyword",e[e.FalseKeyword=9]="FalseKeyword",e[e.StringLiteral=10]="StringLiteral",e[e.NumericLiteral=11]="NumericLiteral",e[e.LineCommentTrivia=12]="LineCommentTrivia",e[e.BlockCommentTrivia=13]="BlockCommentTrivia",e[e.LineBreakTrivia=14]="LineBreakTrivia",e[e.Trivia=15]="Trivia",e[e.Unknown=16]="Unknown",e[e.EOF=17]="EOF"}(t.SyntaxKind||(t.SyntaxKind={}));!function(e){e[e.InvalidSymbol=1]="InvalidSymbol",
e[e.InvalidNumberFormat=2]="InvalidNumberFormat",e[e.PropertyNameExpected=3]="PropertyNameExpected",e[e.ValueExpected=4]="ValueExpected",e[e.ColonExpected=5]="ColonExpected",e[e.CommaExpected=6]="CommaExpected",e[e.CloseBraceExpected=7]="CloseBraceExpected",e[e.CloseBracketExpected=8]="CloseBracketExpected",e[e.EndOfFileExpected=9]="EndOfFileExpected",e[e.InvalidCommentToken=10]="InvalidCommentToken",e[e.UnexpectedEndOfComment=11]="UnexpectedEndOfComment",e[e.UnexpectedEndOfString=12]="UnexpectedEndOfString",e[e.UnexpectedEndOfNumber=13]="UnexpectedEndOfNumber",e[e.InvalidUnicode=14]="InvalidUnicode",e[e.InvalidEscapeCharacter=15]="InvalidEscapeCharacter",e[e.InvalidCharacter=16]="InvalidCharacter"}(t.ParseErrorCode||(t.ParseErrorCode={}));var h;!function(e){e.DEFAULT={allowTrailingComma:!0}}(h=t.ParseOptions||(t.ParseOptions={})),t.createScanner=n;var f;!function(e){e[e.nullCharacter=0]="nullCharacter",e[e.maxAsciiCharacter=127]="maxAsciiCharacter",e[e.lineFeed=10]="lineFeed",
e[e.carriageReturn=13]="carriageReturn",e[e.lineSeparator=8232]="lineSeparator",e[e.paragraphSeparator=8233]="paragraphSeparator",e[e.nextLine=133]="nextLine",e[e.space=32]="space",e[e.nonBreakingSpace=160]="nonBreakingSpace",e[e.enQuad=8192]="enQuad",e[e.emQuad=8193]="emQuad",e[e.enSpace=8194]="enSpace",e[e.emSpace=8195]="emSpace",e[e.threePerEmSpace=8196]="threePerEmSpace",e[e.fourPerEmSpace=8197]="fourPerEmSpace",e[e.sixPerEmSpace=8198]="sixPerEmSpace",e[e.figureSpace=8199]="figureSpace",e[e.punctuationSpace=8200]="punctuationSpace",e[e.thinSpace=8201]="thinSpace",e[e.hairSpace=8202]="hairSpace",e[e.zeroWidthSpace=8203]="zeroWidthSpace",e[e.narrowNoBreakSpace=8239]="narrowNoBreakSpace",e[e.ideographicSpace=12288]="ideographicSpace",e[e.mathematicalSpace=8287]="mathematicalSpace",e[e.ogham=5760]="ogham",e[e._=95]="_",e[e.$=36]="$",e[e._0=48]="_0",e[e._1=49]="_1",e[e._2=50]="_2",e[e._3=51]="_3",e[e._4=52]="_4",e[e._5=53]="_5",e[e._6=54]="_6",e[e._7=55]="_7",e[e._8=56]="_8",e[e._9=57]="_9",e[e.a=97]="a",
e[e.b=98]="b",e[e.c=99]="c",e[e.d=100]="d",e[e.e=101]="e",e[e.f=102]="f",e[e.g=103]="g",e[e.h=104]="h",e[e.i=105]="i",e[e.j=106]="j",e[e.k=107]="k",e[e.l=108]="l",e[e.m=109]="m",e[e.n=110]="n",e[e.o=111]="o",e[e.p=112]="p",e[e.q=113]="q",e[e.r=114]="r",e[e.s=115]="s",e[e.t=116]="t",e[e.u=117]="u",e[e.v=118]="v",e[e.w=119]="w",e[e.x=120]="x",e[e.y=121]="y",e[e.z=122]="z",e[e.A=65]="A",e[e.B=66]="B",e[e.C=67]="C",e[e.D=68]="D",e[e.E=69]="E",e[e.F=70]="F",e[e.G=71]="G",e[e.H=72]="H",e[e.I=73]="I",e[e.J=74]="J",e[e.K=75]="K",e[e.L=76]="L",e[e.M=77]="M",e[e.N=78]="N",e[e.O=79]="O",e[e.P=80]="P",e[e.Q=81]="Q",e[e.R=82]="R",e[e.S=83]="S",e[e.T=84]="T",e[e.U=85]="U",e[e.V=86]="V",e[e.W=87]="W",e[e.X=88]="X",e[e.Y=89]="Y",e[e.Z=90]="Z",e[e.ampersand=38]="ampersand",e[e.asterisk=42]="asterisk",e[e.at=64]="at",e[e.backslash=92]="backslash",e[e.bar=124]="bar",e[e.caret=94]="caret",e[e.closeBrace=125]="closeBrace",e[e.closeBracket=93]="closeBracket",e[e.closeParen=41]="closeParen",e[e.colon=58]="colon",
e[e.comma=44]="comma",e[e.dot=46]="dot",e[e.doubleQuote=34]="doubleQuote",e[e.equals=61]="equals",e[e.exclamation=33]="exclamation",e[e.greaterThan=62]="greaterThan",e[e.lessThan=60]="lessThan",e[e.minus=45]="minus",e[e.openBrace=123]="openBrace",e[e.openBracket=91]="openBracket",e[e.openParen=40]="openParen",e[e.percent=37]="percent",e[e.plus=43]="plus",e[e.question=63]="question",e[e.semicolon=59]="semicolon",e[e.singleQuote=39]="singleQuote",e[e.slash=47]="slash",e[e.tilde=126]="tilde",e[e.backspace=8]="backspace",e[e.formFeed=12]="formFeed",e[e.byteOrderMark=65279]="byteOrderMark",e[e.tab=9]="tab",e[e.verticalTab=11]="verticalTab"}(f||(f={})),t.getLocation=function(e,t){function n(e,t,n,i){o.value=e,o.offset=t,o.length=n,o.type=i,o.colonOffset=void 0,s=o}let i=[],r=new Object,s=void 0;const o={value:{},offset:0,length:0,type:"object",parent:void 0};let a=!1;try{u(e,{onObjectBegin:(e,n)=>{if(t<=e)throw r;s=void 0,a=t>e,i.push("")},onObjectProperty:(e,s,o)=>{if(t<s)throw r;if(n(e,s,o,"property"),
i[i.length-1]=e,t<=s+o)throw r},onObjectEnd:(e,n)=>{if(t<=e)throw r;s=void 0,i.pop()},onArrayBegin:(e,n)=>{if(t<=e)throw r;s=void 0,i.push(0)},onArrayEnd:(e,n)=>{if(t<=e)throw r;s=void 0,i.pop()},onLiteralValue:(e,i,s)=>{if(t<i)throw r;if(n(e,i,s,d(e)),t<=i+s)throw r},onSeparator:(e,n,o)=>{if(t<=n)throw r;if(":"===e&&s&&"property"===s.type)s.colonOffset=n,a=!1,s=void 0;else if(","===e){let e=i[i.length-1];"number"==typeof e?i[i.length-1]=e+1:(a=!0,i[i.length-1]=""),s=void 0}}})}catch(e){if(e!==r)throw e}return{path:i,previousNode:s,isAtPropertyKey:a,matches:e=>{let t=0;for(let n=0;t<e.length&&n<i.length;n++)if(e[t]===i[n]||"*"===e[t])t++;else if("**"!==e[t])return!1;return t===e.length}}},t.parse=function(e,t=[],n=h.DEFAULT){function i(e){Array.isArray(s)?s.push(e):r&&(s[r]=e)}let r=null,s=[],o=[];return u(e,{onObjectBegin:()=>{let e={};i(e),o.push(s),s=e,r=null},onObjectProperty:e=>{r=e},onObjectEnd:()=>{s=o.pop()},onArrayBegin:()=>{let e=[];i(e),o.push(s),s=e,r=null},onArrayEnd:()=>{s=o.pop()},
onLiteralValue:i,onError:(e,n,i)=>{t.push({error:e,offset:n,length:i})}},n),s[0]},t.parseTree=function(e,t=[],n=h.DEFAULT){function i(e){"property"===s.type&&(s.length=e-s.offset,s=s.parent)}function r(e){return s.children.push(e),e}let s={type:"array",offset:-1,length:-1,children:[],parent:void 0};u(e,{onObjectBegin:e=>{s=r({type:"object",offset:e,length:-1,parent:s,children:[]})},onObjectProperty:(e,t,n)=>{(s=r({type:"property",offset:t,length:-1,parent:s,children:[]})).children.push({type:"string",value:e,offset:t,length:n,parent:s})},onObjectEnd:(e,t)=>{s.length=e+t-s.offset,s=s.parent,i(e+t)},onArrayBegin:(e,t)=>{s=r({type:"array",offset:e,length:-1,parent:s,children:[]})},onArrayEnd:(e,t)=>{s.length=e+t-s.offset,s=s.parent,i(e+t)},onLiteralValue:(e,t,n)=>{r({type:d(e),offset:t,length:n,parent:s,value:e}),i(t+n)},onSeparator:(e,t,n)=>{"property"===s.type&&(":"===e?s.colonOffset=t:","===e&&i(t))},onError:(e,n,i)=>{t.push({error:e,offset:n,length:i})}},n);let o=s.children[0];return o&&delete o.parent,o},
t.findNodeAtLocation=function(e,t){if(!e)return;let n=e;for(let e of t)if("string"==typeof e){if("object"!==n.type||!Array.isArray(n.children))return;let t=!1;for(const i of n.children)if(Array.isArray(i.children)&&i.children[0].value===e){n=i.children[1],t=!0;break}if(!t)return}else{let t=e;if("array"!==n.type||t<0||!Array.isArray(n.children)||t>=n.children.length)return;n=n.children[t]}return n},t.getNodePath=o,t.getNodeValue=a,t.contains=l,t.findNodeAtOffset=c,t.visit=u,t.stripComments=function(e,t){let i,r,s=n(e),o=[],a=0;do{switch(r=s.getPosition(),i=s.scan()){case 12:case 13:case 17:a!==r&&o.push(e.substring(a,r)),void 0!==t&&o.push(s.getTokenValue().replace(/[^\r\n]/g,t)),a=s.getPosition()}}while(17!==i);return o.join("")}}),define(e[51],t([1,0,13]),function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toLocalISOString=function(e){
return e.getFullYear()+"-"+n.pad(e.getMonth()+1,2)+"-"+n.pad(e.getDate(),2)+"T"+n.pad(e.getHours(),2)+":"+n.pad(e.getMinutes(),2)+":"+n.pad(e.getSeconds(),2)+"."+(e.getMilliseconds()/1e3).toFixed(3).slice(2,5)+"Z"}}),define(e[53],t([1,0,2,13,17,94]),function(e,t,n,i,r,s){"use strict";function o(e,t=!1){const i=function(e){return{id:e.id,mime:e.mime,filename:e.filename,extension:e.extension,filepattern:e.filepattern,firstline:e.firstline,userConfigured:e.userConfigured,filenameLowercase:e.filename?e.filename.toLowerCase():void 0,extensionLowercase:e.extension?e.extension.toLowerCase():void 0,filepatternLowercase:e.filepattern?e.filepattern.toLowerCase():void 0,filepatternOnPath:!!e.filepattern&&e.filepattern.indexOf(n.posix.sep)>=0}}(e);u.push(i),i.userConfigured?h.push(i):d.push(i),t&&!i.userConfigured&&u.forEach(e=>{e.mime===i.mime||e.userConfigured||(i.extension&&e.extension===i.extension&&console.warn(`Overwriting extension <<${i.extension}>> to now point to mime <<${i.mime}>>`),
i.filename&&e.filename===i.filename&&console.warn(`Overwriting filename <<${i.filename}>> to now point to mime <<${i.mime}>>`),i.filepattern&&e.filepattern===i.filepattern&&console.warn(`Overwriting filepattern <<${i.filepattern}>> to now point to mime <<${i.mime}>>`),i.firstline&&e.firstline===i.firstline&&console.warn(`Overwriting firstline <<${i.firstline}>> to now point to mime <<${i.mime}>>`))})}function a(e,r){if(!e)return[t.MIME_UNKNOWN];e=e.toLowerCase();const s=n.basename(e),o=l(e,s,h);if(o)return[o,t.MIME_TEXT];const a=l(e,s,d);if(a)return[a,t.MIME_TEXT];if(r){const e=function(e){i.startsWithUTF8BOM(e)&&(e=e.substr(1));if(e.length>0)for(const t of u){if(!t.firstline)continue;const n=e.match(t.firstline);if(n&&n.length>0)return t.mime}return null}(r);if(e)return[e,t.MIME_TEXT]}return[t.MIME_UNKNOWN]}function l(e,t,n){let r=null,o=null,a=null;for(let l=n.length-1;l>=0;l--){const c=n[l];if(t===c.filenameLowercase){r=c;break}if(c.filepattern&&(!o||c.filepattern.length>o.filepattern.length)){
const n=c.filepatternOnPath?e:t;s.match(c.filepatternLowercase,n)&&(o=c)}c.extension&&(!a||c.extension.length>a.extension.length)&&i.endsWith(t,c.extensionLowercase)&&(a=c)}return r?r.mime:o?o.mime:a?a.mime:null}function c(e){return!e||("string"==typeof e?e===t.MIME_BINARY||e===t.MIME_TEXT||e===t.MIME_UNKNOWN:1===e.length&&c(e[0]))}Object.defineProperty(t,"__esModule",{value:!0}),t.MIME_TEXT="text/plain",t.MIME_BINARY="application/octet-stream",t.MIME_UNKNOWN="application/unknown";let u=[],d=[],h=[];t.registerTextMime=o,t.clearTextMimes=function(e){e?(u=u.filter(e=>!e.userConfigured),h=[]):(u=[],d=[],h=[])},t.guessMimeTypes=a,t.isUnspecific=c,t.suggestFilename=function(e,t){const n=u.filter(t=>!t.userConfigured&&t.extension&&t.id===e).map(e=>e.extension),s=r.coalesce(n).filter(e=>i.startsWith(e,"."));return s.length>0?t+s[0]:n[0]||t};const f={".bmp":"image/bmp",".gif":"image/gif",".jpg":"image/jpg",".jpeg":"image/jpg",".jpe":"image/jpg",".png":"image/png",".tiff":"image/tiff",".tif":"image/tiff",
".ico":"image/x-icon",".tga":"image/x-tga",".psd":"image/vnd.adobe.photoshop",".webp":"image/webp",".mid":"audio/midi",".midi":"audio/midi",".mp4a":"audio/mp4",".mpga":"audio/mpeg",".mp2":"audio/mpeg",".mp2a":"audio/mpeg",".mp3":"audio/mpeg",".m2a":"audio/mpeg",".m3a":"audio/mpeg",".oga":"audio/ogg",".ogg":"audio/ogg",".spx":"audio/ogg",".aac":"audio/x-aac",".wav":"audio/x-wav",".wma":"audio/x-ms-wma",".mp4":"video/mp4",".mp4v":"video/mp4",".mpg4":"video/mp4",".mpeg":"video/mpeg",".mpg":"video/mpeg",".mpe":"video/mpeg",".m1v":"video/mpeg",".m2v":"video/mpeg",".ogv":"video/ogg",".qt":"video/quicktime",".mov":"video/quicktime",".webm":"video/webm",".mkv":"video/x-matroska",".mk3d":"video/x-matroska",".mks":"video/x-matroska",".wmv":"video/x-ms-wmv",".flv":"video/x-flv",".avi":"video/x-msvideo",".movie":"video/x-sgi-movie"};t.getMediaMime=function(e){const t=n.extname(e);return f[t.toLowerCase()]}}),define(e[48],t([1,0,20,2,13,32,15,93]),function(e,t,n,i,r,s,o,a){"use strict";function l(e){
return!(!o.isWindows||!e||":"!==e[1])}function c(e){return l(e)?e.charAt(0).toUpperCase()+e.slice(1):e}function u(e,t){if(o.isWindows||!e||!t)return e;let n=d.original===t?d.normalized:void 0;return n||(n=`${r.rtrim(t,i.posix.sep)}${i.posix.sep}`,d={original:t,normalized:n}),(o.isLinux?r.startsWith(e,n):r.startsWithIgnoreCase(e,n))&&(e=`~/${e.substr(n.length)}`),e}Object.defineProperty(t,"__esModule",{value:!0}),t.getPathLabel=function(e,t,d){if("string"==typeof e&&(e=n.URI.file(e)),d){const t=d.getWorkspaceFolder(e);if(t){const n=d.getWorkspace().folders.length>1;let s;if(s=a.isEqual(t.uri,e)?"":i.normalize(r.ltrim(e.path.substr(t.uri.path.length),i.posix.sep)),n){const e=t&&t.name?t.name:a.basename(t.uri);s=s?e+" • "+s:e}return s}}if(e.scheme!==s.Schemas.file&&e.scheme!==s.Schemas.untitled)return e.with({query:null,fragment:null}).toString(!0);if(l(e.fsPath))return i.normalize(c(e.fsPath));let h=i.normalize(e.fsPath);return!o.isWindows&&t&&(h=u(h,t.userHome)),h},t.getBaseLabel=function(e){if(!e)return
;"string"==typeof e&&(e=n.URI.file(e));const t=a.basename(e)||(e.scheme===s.Schemas.file?e.fsPath:e.path);return l(t)?c(t):t},t.normalizeDriveLetter=c;let d=Object.create(null);t.tildify=u,t.untildify=function(e,t){return e.replace(/^~($|\/|\\)/,`${t}$1`)};const h="…",f="\\\\",g="~";t.shorten=function(e){const t=new Array(e.length);let n=!1;for(let s=0;s<e.length;s++){let o=e[s];if(""===o){t[s]=`.${i.sep}`;continue}if(!o){t[s]=o;continue}n=!0;let a="";0===o.indexOf(f)?(a=o.substr(0,o.indexOf(f)+f.length),o=o.substr(o.indexOf(f)+f.length)):0===o.indexOf(i.sep)?(a=o.substr(0,o.indexOf(i.sep)+i.sep.length),o=o.substr(o.indexOf(i.sep)+i.sep.length)):0===o.indexOf(g)&&(a=o.substr(0,o.indexOf(g)+g.length),o=o.substr(o.indexOf(g)+g.length));const l=o.split(i.sep);for(let o=1;n&&o<=l.length;o++)for(let c=l.length-o;n&&c>=0;c--){n=!1;let u=l.slice(c,c+o).join(i.sep);for(let t=0;!n&&t<e.length;t++)if(t!==s&&e[t]&&e[t].indexOf(u)>-1){const s=c+o===l.length,a=c>0&&e[t].indexOf(i.sep)>-1?i.sep+u:u,d=r.endsWith(e[t],a)
;n=!s||d}if(!n){let e="";(r.endsWith(l[0],":")||""!==a)&&(1===c&&(c=0,o++,u=l[0]+i.sep+u),c>0&&(e=l[0]+i.sep),e=a+e),c>0&&(e=e+h+i.sep),e+=u,c+o<l.length&&(e=e+i.sep+h),t[s]=e}}n&&(t[s]=o)}return t};var p;!function(e){e[e.TEXT=0]="TEXT",e[e.VARIABLE=1]="VARIABLE",e[e.SEPARATOR=2]="SEPARATOR"}(p||(p={})),t.template=function(e,t=Object.create(null)){const n=[];let i=!1,r="";for(const s of e)if("$"===s||i&&"{"===s)r&&n.push({value:r,type:p.TEXT}),r="",i=!0;else if("}"===s&&i){const e=t[r];if("string"==typeof e)e.length&&n.push({value:e,type:p.VARIABLE});else if(e){const t=n[n.length-1];t&&t.type===p.SEPARATOR||n.push({value:e.label,type:p.SEPARATOR})}r="",i=!1}else r+=s;return r&&!i&&n.push({value:r,type:p.TEXT}),n.filter((e,t)=>e.type!==p.SEPARATOR||[n[t-1],n[t+1]].every(e=>e&&(e.type===p.VARIABLE||e.type===p.TEXT)&&e.value.length>0)).map(e=>e.value).join("")},t.mnemonicMenuLabel=function(e,t){
return o.isMacintosh||t?e.replace(/\(&&\w\)|&&/g,"").replace(/&/g,o.isMacintosh?"&":"&&"):e.replace(/&&|&/g,e=>"&"===e?"&&":"&")},t.mnemonicButtonLabel=function(e){return o.isMacintosh?e.replace(/\(&&\w\)|&&/g,""):o.isWindows?e.replace(/&&|&/g,e=>"&"===e?"&&":"&"):e.replace(/&&/g,"_")},t.unmnemonicLabel=function(e){return e.replace(/&/g,"&&")}}),define(e[57],t([1,0,37]),function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n.getPathFromAmdModule(e,"paths"),r=e.__$__nodeRequire(i);t.getAppDataPath=r.getAppDataPath,t.getDefaultUserDataPath=r.getDefaultUserDataPath});var n=this&&this.__awaiter||function(e,t,n,i){return new(n||(n=Promise))(function(r,s){function o(e){try{l(i.next(e))}catch(e){s(e)}}function a(e){try{l(i.throw(e))}catch(e){s(e)}}function l(e){e.done?r(e.value):new n(function(t){t(e.value)}).then(o,a)}l((i=i.apply(e,t||[])).next())})};define(e[70],t([1,0,83,4]),function(e,t,i,r){"use strict";function s(t,s={}){return n(this,void 0,void 0,function*(){
const n=i.parse(t),o=s.proxyUrl||function(e){return"http:"===e.protocol?process.env.HTTP_PROXY||process.env.http_proxy||null:"https:"===e.protocol?process.env.HTTPS_PROXY||process.env.https_proxy||process.env.HTTP_PROXY||process.env.http_proxy||null:null}(n);if(!o)return null;const a=i.parse(o);if(!/^https?:$/.test(a.protocol||""))return null;const l={host:a.hostname||"",port:Number(a.port),auth:a.auth,rejectUnauthorized:!r.isBoolean(s.strictSSL)||s.strictSSL};return new("http:"===n.protocol?yield new Promise((t,n)=>{e(["http-proxy-agent"],t,n)}):yield new Promise((t,n)=>{e(["https-proxy-agent"],t,n)}))(l)})}Object.defineProperty(t,"__esModule",{value:!0}),t.getProxyAgent=s}),define(e[86],t([1,0,23,2,5,11,8,42,30,15]),function(e,t,n,i,r,s,o,a,l,c){"use strict";Object.defineProperty(t,"__esModule",{value:!0});class u{constructor(e,t={defaultConfig:Object.create(null),onError:e=>console.error(e)}){this._path=e,this.options=t,this.disposables=[],this.configName=i.basename(this._path),
this._onDidUpdateConfiguration=new o.Emitter,this.disposables.push(this._onDidUpdateConfiguration),this.registerWatcher(),this.initAsync()}get path(){return this._path}get hasParseErrors(){return this.parseErrors&&this.parseErrors.length>0}get onDidUpdateConfiguration(){return this._onDidUpdateConfiguration.event}initAsync(){this.loadAsync(e=>{this.loaded||this.updateCache(e),this.options.initCallback&&this.options.initCallback(this.getConfig())})}updateCache(e){this.cache=e,this.loaded=!0}loadSync(){try{return this.parse(n.readFileSync(this._path).toString())}catch(e){return this.options.defaultConfig}}loadAsync(e){n.readFile(this._path,(t,n)=>e(t?this.options.defaultConfig:this.parse(n.toString())))}parse(e){let t;try{return this.parseErrors=[],(t=this.options.parse?this.options.parse(e,this.parseErrors):a.parse(e,this.parseErrors))||this.options.defaultConfig}catch(e){return this.options.defaultConfig}}registerWatcher(){const e=i.dirname(this._path);this.watch(e,!0),n.lstat(this._path,(e,t)=>{
e||t.isDirectory()||t.isSymbolicLink()&&n.readlink(this._path,(e,t)=>{e||this.watch(t,!1)})})}watch(e,t){this.disposed||this.disposables.push(l.watch(e,(e,n)=>this.onConfigFileChange(e,n,t),e=>this.options.onError(e)))}onConfigFileChange(e,t,n){n&&(c.isWindows&&t&&t!==this.configName&&(t=i.basename(t)),t!==this.configName)||(this.timeoutHandle&&(global.clearTimeout(this.timeoutHandle),this.timeoutHandle=null),this.timeoutHandle=global.setTimeout(()=>this.reload(),this.options.changeBufferDelay||0))}reload(e){this.loadAsync(t=>{if(r.equals(t,this.cache)||(this.updateCache(t),this._onDidUpdateConfiguration.fire({config:this.cache})),e)return e(t)})}getConfig(){return this.ensureLoaded(),this.cache}ensureLoaded(){this.loaded||this.updateCache(this.loadSync())}dispose(){this.disposed=!0,this.disposables=s.dispose(this.disposables)}}t.ConfigWatcher=u}),define(e[54],t([7,6]),function(e,t){return e.create("vs/base/common/errorMessage",t)}),define(e[35],t([1,0,54,4,17]),function(e,t,n,i,r){"use strict"
;function s(e,t){return e.message?t&&(e.stack||e.stacktrace)?n.localize(0,null,o(e),e.stack||e.stacktrace):o(e):n.localize(1,null)}function o(e){return"string"==typeof e.code&&"number"==typeof e.errno&&"string"==typeof e.syscall?n.localize(2,null,e.message):e.message}function a(e=null,t=!1){if(!e)return n.localize(3,null);if(Array.isArray(e)){const i=r.coalesce(e),s=a(i[0],t);return i.length>1?n.localize(4,null,s,i.length):s}if(i.isString(e))return e;if(e.detail){const n=e.detail;if(n.error)return s(n.error,t);if(n.exception)return s(n.exception,t)}return e.stack?s(e,t):e.message?e.message:n.localize(5,null)}Object.defineProperty(t,"__esModule",{value:!0}),t.toErrorMessage=a}),define(e[60],t([7,6]),function(e,t){return e.create("vs/base/node/zip",t)}),define(e[62],t([7,6]),function(e,t){return e.create("vs/platform/configuration/common/configurationRegistry",t)}),define(e[63],t([7,6]),function(e,t){return e.create("vs/platform/extensionManagement/common/extensionManagement",t)}),
define(e[64],t([7,6]),function(e,t){return e.create("vs/platform/extensionManagement/node/extensionManagementService",t)}),define(e[65],t([7,6]),function(e,t){return e.create("vs/platform/extensionManagement/node/extensionManagementUtil",t)}),define(e[66],t([7,6]),function(e,t){return e.create("vs/platform/extensions/node/extensionValidator",t)}),define(e[68],t([7,6]),function(e,t){return e.create("vs/platform/request/node/request",t)}),define(e[69],t([7,6]),function(e,t){return e.create("vs/platform/telemetry/common/telemetryService",t)}),define(e[19],t([1,0,13]),function(e,t,n){"use strict";function i(e,t){return e.uuid&&t.uuid?e.uuid===t.uuid:e.id===t.id||0===n.compareIgnoreCase(e.id,t.id)}Object.defineProperty(t,"__esModule",{value:!0}),t.areSameExtensions=i,t.adoptToGalleryExtensionId=function(e){return e.toLocaleLowerCase()},t.getGalleryExtensionId=function(e,t){return`${e.toLocaleLowerCase()}.${t.toLocaleLowerCase()}`},t.groupByExtension=function(e,t){const n=[],r=e=>{
for(const r of n)if(r.some(n=>i(t(n),t(e))))return r;return null};for(const t of e){const e=r(t);e?e.push(t):n.push([t])}return n},t.getLocalExtensionTelemetryData=function(e){return{id:e.identifier.id,name:e.manifest.name,galleryId:null,publisherId:e.metadata?e.metadata.publisherId:null,publisherName:e.manifest.publisher,publisherDisplayName:e.metadata?e.metadata.publisherDisplayName:null,dependencies:e.manifest.extensionDependencies&&e.manifest.extensionDependencies.length>0}},t.getGalleryExtensionTelemetryData=function(e){return Object.assign({id:e.identifier.id,name:e.name,galleryId:e.identifier.uuid,publisherId:e.publisherId,publisherName:e.publisher,publisherDisplayName:e.publisherDisplayName,dependencies:!!(e.properties.dependencies&&e.properties.dependencies.length>0)},e.telemetryData)},t.BetterMergeId="pprice.better-merge",t.getMaliciousExtensionsSet=function(e){const t=new Set;for(const n of e)n.malicious&&t.add(n.id.id);return t}}),define(e[74],t([1,0,5]),function(e,t,n){"use strict"
;Object.defineProperty(t,"__esModule",{value:!0});const i=/^%([\w\d.-]+)%$/i;t.localizeManifest=function(e,t){return n.cloneAndChange(e,e=>{if("string"!=typeof e)return;const n=i.exec(e);return n?t[n[1]]||e:void 0})}}),define(e[77],t([1,0,11,91,35,2,27,8,32,10]),function(e,t,i,r,s,o,a,l,c,u){"use strict";Object.defineProperty(t,"__esModule",{value:!0});class d extends i.Disposable{constructor(e,t){super(),this.environmentService=e,this.logService=t,this.processesLimiter=new a.Limiter(5)}postUninstall(e){return n(this,void 0,void 0,function*(){const t=this.parseScript(e,"uninstall");return t&&(this.logService.info(e.identifier.id,e.manifest.version,"Running post uninstall script"),yield this.processesLimiter.queue(()=>this.runLifecycleHook(t.script,"uninstall",t.args,!0,e).then(()=>this.logService.info(e.identifier.id,e.manifest.version,"Finished running post uninstall script"),t=>this.logService.error(e.identifier.id,e.manifest.version,`Failed to run post uninstall script: ${t}`)))),
u.rimraf(this.getExtensionStoragePath(e)).then(void 0,e=>this.logService.error("Error while removing extension storage path",e))})}parseScript(e,t){const n=`vscode:${t}`;if(e.location.scheme===c.Schemas.file&&e.manifest&&e.manifest.scripts&&"string"==typeof e.manifest.scripts[n]){const t=e.manifest.scripts[n].split(" ");return t.length<2||"node"!==t[0]||!t[1]?(this.logService.warn(e.identifier.id,e.manifest.version,`${n} should be a node script`),null):{script:o.join(e.location.fsPath,t[1]),args:t.slice(2)||[]}}return null}runLifecycleHook(e,t,n,i,r){return new Promise((o,a)=>{const l=this.start(e,t,n,r);let c;const u=e=>{c&&(clearTimeout(c),c=null),e?a(e):o(void 0)};l.on("error",e=>{u(s.toErrorMessage(e)||"Unknown")}),l.on("exit",(e,n)=>{u(e?`post-${t} process exited with code ${e}`:void 0)}),i&&(c=setTimeout(()=>{c=null,l.kill(),a("timed out")},5e3))})}start(e,t,n,i){const s={silent:!0,execArgv:void 0},o=r.fork(e,[`--type=extension-post-${t}`,...n],s);o.stdout.setEncoding("utf8"),
o.stderr.setEncoding("utf8");const a=l.Event.fromNodeEventEmitter(o.stdout,"data"),c=l.Event.fromNodeEventEmitter(o.stderr,"data");a(e=>this.logService.info(i.identifier.id,i.manifest.version,`post-${t}`,e)),c(e=>this.logService.error(i.identifier.id,i.manifest.version,`post-${t}`,e));const u=l.Event.any(l.Event.map(a,e=>({data:`%c${e}`,format:[""]})),l.Event.map(c,e=>({data:`%c${e}`,format:["color: red"]})));return l.Event.debounce(u,(e,t)=>e?{data:e.data+t.data,format:[...e.format,...t.format]}:{data:t.data,format:t.format},100)(e=>{console.group(i.identifier.id),console.log(e.data,...e.format),console.groupEnd()}),o}getExtensionStoragePath(e){return o.join(this.environmentService.globalStorageHome,e.identifier.id.toLowerCase())}}t.ExtensionsLifecycle=d}),define(e[29],t([1,0,19,13]),function(e,t,n,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MANIFEST_CACHE_FOLDER="CachedExtensions",t.USER_MANIFEST_CACHE_FILE="user",t.BUILTIN_MANIFEST_CACHE_FILE="builtin";class r{constructor(e,t){
this.identifier=e,this.version=t}key(){return`${this.identifier.id}-${this.version}`}equals(e){return e instanceof r&&(n.areSameExtensions(this.identifier,e.identifier)&&this.version===e.version)}}t.ExtensionIdentifierWithVersion=r,t.isIExtensionIdentifier=function(e){return e&&"object"==typeof e&&"string"==typeof e.id&&(!e.uuid||"string"==typeof e.uuid)};!function(e){e[e.System=0]="System",e[e.User=1]="User"}(t.ExtensionType||(t.ExtensionType={}));class s{constructor(e){this.value=e,this._lower=e.toLowerCase()}static equals(e,t){if(void 0===e||null===e)return void 0===t||null===t;if(void 0===t||null===t)return!1;if("string"==typeof e||"string"==typeof t){let n="string"==typeof e?e:e.value,r="string"==typeof t?t:t.value;return i.equalsIgnoreCase(n,r)}return e._lower===t._lower}static toKey(e){return"string"==typeof e?e.toLowerCase():e._lower}}t.ExtensionIdentifier=s,t.isLanguagePackExtension=function(e){return!(!e.contributes||!e.contributes.localizations)&&e.contributes.localizations.length>0}}),
define(e[47],t([1,0,11,2,29,10]),function(e,t,n,i,r,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0});class o extends n.Disposable{constructor(e,t){super(),this.environmentService=e,this.extensionsManifestCache=i.join(this.environmentService.userDataPath,r.MANIFEST_CACHE_FOLDER,r.USER_MANIFEST_CACHE_FILE),this._register(t.onDidInstallExtension(e=>this.onDidInstallExtension(e))),this._register(t.onDidUninstallExtension(e=>this.onDidUnInstallExtension(e)))}onDidInstallExtension(e){e.error||this.invalidate()}onDidUnInstallExtension(e){e.error||this.invalidate()}invalidate(){s.del(this.extensionsManifestCache).then(()=>{},()=>{})}}t.ExtensionsManifestCache=o}),define(e[34],t([1,0]),function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});class n{constructor(e,t=[],n=!1){this.ctor=e,this.staticArguments=t,this.supportsDelayedInstantiation=n}}t.SyncDescriptor=n,t.createSyncDescriptor=((e,...t)=>new n(e,t))}),define(e[49],t([1,0,4,52]),function(e,t,n,i){"use strict"
;Object.defineProperty(t,"__esModule",{value:!0});class r{constructor(e){this._hashFn=e,this._nodes=Object.create(null)}roots(){const e=[];return i.forEach(this._nodes,t=>{n.isEmptyObject(t.value.outgoing)&&e.push(t.value)}),e}insertEdge(e,t){const n=this.lookupOrInsertNode(e),i=this.lookupOrInsertNode(t);n.outgoing[this._hashFn(t)]=i,i.incoming[this._hashFn(e)]=n}removeNode(e){const t=this._hashFn(e);delete this._nodes[t],i.forEach(this._nodes,e=>{delete e.value.outgoing[t],delete e.value.incoming[t]})}lookupOrInsertNode(e){const t=this._hashFn(e);let n=this._nodes[t];return n||(n=function(e){return{data:e,incoming:Object.create(null),outgoing:Object.create(null)}}(e),this._nodes[t]=n),n}lookup(e){return this._nodes[this._hashFn(e)]}isEmpty(){for(const e in this._nodes)return!1;return!0}toString(){let e=[];return i.forEach(this._nodes,t=>{e.push(`${t.key}, (incoming)[${Object.keys(t.value.incoming).join(", ")}], (outgoing)[${Object.keys(t.value.outgoing).join(",")}]`)}),e.join("\n")}}t.Graph=r}),
define(e[50],t([1,0,3]),function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IDownloadService=n.createDecorator("downloadService")}),define(e[16],t([1,0,3]),function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IEnvironmentService=n.createDecorator("environmentService")}),define(e[26],t([1,0,63,3]),function(e,t,n,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EXTENSION_IDENTIFIER_PATTERN="^([a-z0-9A-Z][a-z0-9-A-Z]*)\\.([a-z0-9A-Z][a-z0-9-A-Z]*)$",t.EXTENSION_IDENTIFIER_REGEX=new RegExp(t.EXTENSION_IDENTIFIER_PATTERN),t.isIExtensionIdentifier=function(e){return e&&"object"==typeof e&&"string"==typeof e.id&&(!e.uuid||"string"==typeof e.uuid)},t.IExtensionManagementService=i.createDecorator("extensionManagementService"),t.IExtensionGalleryService=i.createDecorator("extensionGalleryService");!function(e){e[e.NoneOrRelevance=0]="NoneOrRelevance",e[e.LastUpdatedDate=1]="LastUpdatedDate",e[e.Title=2]="Title",
e[e.PublisherName=3]="PublisherName",e[e.InstallCount=4]="InstallCount",e[e.PublishedDate=5]="PublishedDate",e[e.AverageRating=6]="AverageRating",e[e.WeightedRating=12]="WeightedRating"}(t.SortBy||(t.SortBy={}));!function(e){e[e.Default=0]="Default",e[e.Ascending=1]="Ascending",e[e.Descending=2]="Descending"}(t.SortOrder||(t.SortOrder={}));!function(e){e.Uninstall="uninstall"}(t.StatisticType||(t.StatisticType={}));!function(e){e[e.None=0]="None",e[e.Install=1]="Install",e[e.Update=2]="Update"}(t.InstallOperation||(t.InstallOperation={})),t.INSTALL_ERROR_MALICIOUS="malicious",t.INSTALL_ERROR_INCOMPATIBLE="incompatible",t.IExtensionManagementServerService=i.createDecorator("extensionManagementServerService");!function(e){e[e.Disabled=0]="Disabled",e[e.WorkspaceDisabled=1]="WorkspaceDisabled",e[e.Enabled=2]="Enabled",e[e.WorkspaceEnabled=3]="WorkspaceEnabled"}(t.EnablementState||(t.EnablementState={})),t.IExtensionEnablementService=i.createDecorator("extensionEnablementService"),
t.IExtensionTipsService=i.createDecorator("extensionTipsService");!function(e){e[e.Workspace=0]="Workspace",e[e.File=1]="File",e[e.Executable=2]="Executable",e[e.DynamicWorkspace=3]="DynamicWorkspace",e[e.Experimental=4]="Experimental"}(t.ExtensionRecommendationReason||(t.ExtensionRecommendationReason={})),t.ExtensionsLabel=n.localize(0,null),t.ExtensionsChannelId="extensions",t.PreferencesLabel=n.localize(1,null)}),define(e[39],t([1,0]),function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});class n{constructor(...e){this._entries=new Map;for(let[t,n]of e)this.set(t,n)}set(e,t){const n=this._entries.get(e);return this._entries.set(e,t),n}forEach(e){this._entries.forEach((t,n)=>e(n,t))}has(e){return this._entries.has(e)}get(e){return this._entries.get(e)}}t.ServiceCollection=n}),define(e[55],t([1,0,21,4,49,34,3,39]),function(e,t,n,i,r,s,o,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});class l{constructor(e=new a.ServiceCollection,t=!1,n){this._services=e,this._strict=t,
this._parent=n,this._services.set(o.IInstantiationService,this)}createChild(e){return new l(e,this._strict,this)}invokeFunction(e,...t){let i=u.traceInvocation(e),r=!1;try{const s={get:(e,t)=>{if(r)throw n.illegalState("service accessor is only valid during the invocation of its target method");const s=this._getOrCreateServiceInstance(e,i);if(!s&&t!==o.optional)throw new Error(`[invokeFunction] unknown service '${e}'`);return s}};return e.apply(void 0,[s,...t])}finally{r=!0,i.stop()}}createInstance(e,...t){let n,i;return e instanceof s.SyncDescriptor?(n=u.traceCreation(e.ctor),i=this._createInstance(e.ctor,e.staticArguments.concat(t),n)):(n=u.traceCreation(e),i=this._createInstance(e,t,n)),n.stop(),i}_createInstance(e,t=[],n){let r=o._util.getServiceDependencies(e).sort((e,t)=>e.index-t.index),s=[];for(const t of r){let i=this._getOrCreateServiceInstance(t.id,n);if(!i&&this._strict&&!t.optional)throw new Error(`[createInstance] ${e.name} depends on UNKNOWN service ${t.id}.`);s.push(i)}
let a=r.length>0?r[0].index:t.length;if(t.length!==a){console.warn(`[createInstance] First service dependency of ${e.name} at position ${a+1} conflicts with ${t.length} static arguments`);let n=a-t.length;t=n>0?t.concat(new Array(n)):t.slice(0,a)}return i.create.apply(null,[e].concat(t,s))}_setServiceInstance(e,t){if(this._services.get(e)instanceof s.SyncDescriptor)this._services.set(e,t);else{if(!this._parent)throw new Error("illegalState - setting UNKNOWN service instance");this._parent._setServiceInstance(e,t)}}_getServiceInstanceOrDescriptor(e){let t=this._services.get(e);return!t&&this._parent?this._parent._getServiceInstanceOrDescriptor(e):t}_getOrCreateServiceInstance(e,t){let n=this._getServiceInstanceOrDescriptor(e);return n instanceof s.SyncDescriptor?this._createAndCacheServiceInstance(e,n,t.branch(e,!0)):(t.branch(e,!1),n)}_createAndCacheServiceInstance(e,t,n){function i(){const e=new Error("[createInstance] cyclic dependency between services");throw e.message=a.toString(),e}
const a=new r.Graph(e=>e.id.toString());let l=0;const c=[{id:e,desc:t,_trace:n}];for(;c.length;){const t=c.pop();a.lookupOrInsertNode(t),l++>100&&i();let n=o._util.getServiceDependencies(t.desc.ctor);for(let i of n){let n=this._getServiceInstanceOrDescriptor(i.id);if(n||i.optional||console.warn(`[createInstance] ${e} depends on ${i.id} which is NOT registered.`),n instanceof s.SyncDescriptor){const e={id:i.id,desc:n,_trace:t._trace.branch(i.id,!0)};a.insertEdge(t,e),c.push(e)}}}for(;;){let e=a.roots();if(0===e.length){a.isEmpty()||i();break}for(let{data:t}of e){const e=this._createServiceInstanceWithOwner(t.id,t.desc.ctor,t.desc.staticArguments,t.desc.supportsDelayedInstantiation,t._trace);this._setServiceInstance(t.id,e),a.removeNode(t)}}return this._getServiceInstanceOrDescriptor(e)}_createServiceInstanceWithOwner(e,t,n=[],i,r){if(this._services.get(e)instanceof s.SyncDescriptor)return this._createServiceInstance(t,n,i,r);if(this._parent)return this._parent._createServiceInstanceWithOwner(e,t,n,i,r)
;throw new Error("illegalState - creating UNKNOWN service instance")}_createServiceInstance(e,t=[],n,i){return this._createInstance(e,t,i)}}t.InstantiationService=l;var c;!function(e){e[e.Creation=0]="Creation",e[e.Invocation=1]="Invocation",e[e.Branch=2]="Branch"}(c||(c={}));class u{constructor(e,t){this.type=e,this.name=t,this._start=Date.now(),this._dep=[]}static traceInvocation(e){return u._None}static traceCreation(e){return u._None}branch(e,t){let n=new u(2,e.toString());return this._dep.push([e,t,n]),n}stop(){function e(t,i){let r=[],s=new Array(t+1).join("\t");for(const[o,a,l]of i._dep)if(a&&l){n=!0,r.push(`${s}CREATES -> ${o}`);let i=e(t+1,l);i&&r.push(i)}else r.push(`${s}uses -> ${o}`);return r.join("\n")}let t=Date.now()-this._start;u._totals+=t;let n=!1,i=[`${0===this.type?"CREATE":"CALL"} ${this.name}`,`${e(1,this)}`,`DONE, took ${t.toFixed(2)}ms (grand total ${u._totals.toFixed(2)}ms)`];(t>2||n)&&console.log(i.join("\n"))}}u._None=new class extends u{constructor(){super(-1,null)}stop(){}
branch(){return this}},u._totals=0}),define(e[9],t([1,0,3,11,15,8]),function(e,t,n,i,r,s){"use strict";function o(){return(new Date).toISOString()}Object.defineProperty(t,"__esModule",{value:!0}),t.ILogService=n.createDecorator("logService");var a;!function(e){e[e.Trace=0]="Trace",e[e.Debug=1]="Debug",e[e.Info=2]="Info",e[e.Warning=3]="Warning",e[e.Error=4]="Error",e[e.Critical=5]="Critical",e[e.Off=6]="Off"}(a=t.LogLevel||(t.LogLevel={})),t.DEFAULT_LOG_LEVEL=a.Info;class l extends i.Disposable{constructor(){super(...arguments),this.level=t.DEFAULT_LOG_LEVEL,this._onDidChangeLogLevel=this._register(new s.Emitter),this.onDidChangeLogLevel=this._onDidChangeLogLevel.event}setLevel(e){this.level!==e&&(this.level=e,this._onDidChangeLogLevel.fire(this.level))}getLevel(){return this.level}}t.AbstractLogService=l;class c extends l{constructor(e=t.DEFAULT_LOG_LEVEL){super(),this.setLevel(e),this.useColors=!r.isWindows}trace(e,...t){
this.getLevel()<=a.Trace&&(this.useColors?console.log(`[90m[main ${o()}][0m`,e,...t):console.log(`[main ${o()}]`,e,...t))}debug(e,...t){this.getLevel()<=a.Debug&&(this.useColors?console.log(`[90m[main ${o()}][0m`,e,...t):console.log(`[main ${o()}]`,e,...t))}info(e,...t){this.getLevel()<=a.Info&&(this.useColors?console.log(`[90m[main ${o()}][0m`,e,...t):console.log(`[main ${o()}]`,e,...t))}warn(e,...t){this.getLevel()<=a.Warning&&(this.useColors?console.warn(`[93m[main ${o()}][0m`,e,...t):console.warn(`[main ${o()}]`,e,...t))}error(e,...t){this.getLevel()<=a.Error&&(this.useColors?console.error(`[91m[main ${o()}][0m`,e,...t):console.error(`[main ${o()}]`,e,...t))}critical(e,...t){this.getLevel()<=a.Critical&&(this.useColors?console.error(`[90m[main ${o()}][0m`,e,...t):console.error(`[main ${o()}]`,e,...t))}dispose(){}}t.ConsoleLogMainService=c;class u extends l{constructor(e=t.DEFAULT_LOG_LEVEL){super(),this.setLevel(e)}trace(e,...t){
this.getLevel()<=a.Trace&&console.log("%cTRACE","color: #888",e,...t)}debug(e,...t){this.getLevel()<=a.Debug&&console.log("%cDEBUG","background: #eee; color: #888",e,...t)}info(e,...t){this.getLevel()<=a.Info&&console.log("%c INFO","color: #33f",e,...t)}warn(e,...t){this.getLevel()<=a.Warning&&console.log("%c WARN","color: #993",e,...t)}error(e,...t){this.getLevel()<=a.Error&&console.log("%c  ERR","color: #f33",e,...t)}critical(e,...t){this.getLevel()<=a.Critical&&console.log("%cCRITI","background: #f33; color: white",e,...t)}dispose(){}}t.ConsoleLogService=u;class d extends l{constructor(e){super(),this.logServices=e,e.length&&this.setLevel(e[0].getLevel())}setLevel(e){for(const t of this.logServices)t.setLevel(e);super.setLevel(e)}trace(e,...t){for(const n of this.logServices)n.trace(e,...t)}debug(e,...t){for(const n of this.logServices)n.debug(e,...t)}info(e,...t){for(const n of this.logServices)n.info(e,...t)}warn(e,...t){for(const n of this.logServices)n.warn(e,...t)}error(e,...t){
for(const n of this.logServices)n.error(e,...t)}critical(e,...t){for(const n of this.logServices)n.critical(e,...t)}dispose(){for(const e of this.logServices)e.dispose()}}t.MultiplexLogService=d;class h extends i.Disposable{constructor(e){super(),this.logService=e,this._register(e)}get onDidChangeLogLevel(){return this.logService.onDidChangeLogLevel}setLevel(e){this.logService.setLevel(e)}getLevel(){return this.logService.getLevel()}trace(e,...t){this.logService.trace(e,...t)}debug(e,...t){this.logService.debug(e,...t)}info(e,...t){this.logService.info(e,...t)}warn(e,...t){this.logService.warn(e,...t)}error(e,...t){this.logService.error(e,...t)}critical(e,...t){this.logService.critical(e,...t)}}t.DelegatedLogService=h;class f{constructor(){this.onDidChangeLogLevel=(new s.Emitter).event}setLevel(e){}getLevel(){return a.Info}trace(e,...t){}debug(e,...t){}info(e,...t){}warn(e,...t){}error(e,...t){}critical(e,...t){}dispose(){}}t.NullLogService=f,t.getLogLevel=function(e){if(e.verbose)return a.Trace
;if("string"==typeof e.args.log)switch(e.args.log.toLowerCase()){case"trace":return a.Trace;case"debug":return a.Debug;case"info":return a.Info;case"warn":return a.Warning;case"error":return a.Error;case"critical":return a.Critical;case"off":return a.Off}return t.DEFAULT_LOG_LEVEL}}),define(e[58],t([1,0,2,9]),function(e,t,n,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createSpdLogService=function(t,s,o){try{const i=e.__$__nodeRequire("spdlog");i.setAsyncMode(8192,500);const a=n.join(o,`${t}.log`),l=new i.RotatingLogger(t,a,5242880,6);return l.setLevel(0),new r(l,s)}catch(e){console.error(e)}return new i.NullLogService},t.createRotatingLogger=function(t,n,i,r){return new(e.__$__nodeRequire("spdlog").RotatingLogger)(t,n,i,r)};class r extends i.AbstractLogService{constructor(e,t=i.LogLevel.Error){super(),this.logger=e,this.setLevel(t)}trace(){this.getLevel()<=i.LogLevel.Trace&&this.logger.trace(this.format(arguments))}debug(){
this.getLevel()<=i.LogLevel.Debug&&this.logger.debug(this.format(arguments))}info(){this.getLevel()<=i.LogLevel.Info&&this.logger.info(this.format(arguments))}warn(){this.getLevel()<=i.LogLevel.Warning&&this.logger.warn(this.format(arguments))}error(){if(this.getLevel()<=i.LogLevel.Error){const e=arguments[0];if(e instanceof Error){const t=Array.prototype.slice.call(arguments);t[0]=e.stack,this.logger.error(this.format(t))}else this.logger.error(this.format(arguments))}}critical(){this.getLevel()<=i.LogLevel.Critical&&this.logger.critical(this.format(arguments))}dispose(){this.logger.drop()}format(e){let t="";for(let n=0;n<e.length;n++){let i=e[n];if("object"==typeof i)try{i=JSON.stringify(i)}catch(e){}t+=(n>0?" ":"")+i}return t}}}),define(e[31],t([1,0,66,22]),function(e,t,n,i){"use strict";function r(e){return"*"===(e=e.trim())||c.test(e)}function s(e){if(!r(e))return null;if("*"===(e=e.trim()))return{hasCaret:!1,hasGreaterEquals:!1,majorBase:0,majorMustEqual:!1,minorBase:0,minorMustEqual:!1,patchBase:0,
patchMustEqual:!1,preRelease:null};let t=e.match(c);return t?{hasCaret:"^"===t[1],hasGreaterEquals:">="===t[1],majorBase:"x"===t[2]?0:parseInt(t[2],10),majorMustEqual:"x"!==t[2],minorBase:"x"===t[4]?0:parseInt(t[4],10),minorMustEqual:"x"!==t[4],patchBase:"x"===t[6]?0:parseInt(t[6],10),patchMustEqual:"x"!==t[6],preRelease:t[8]||null}:null}function o(e){if(!e)return null;let t=e.majorBase,n=e.majorMustEqual,i=e.minorBase,r=e.minorMustEqual,s=e.patchBase,o=e.patchMustEqual;return e.hasCaret&&(0===t?o=!1:(r=!1,o=!1)),{majorBase:t,majorMustEqual:n,minorBase:i,minorMustEqual:r,patchBase:s,patchMustEqual:o,isMinimum:e.hasGreaterEquals}}function a(e,t){let n;n="string"==typeof e?o(s(e)):e;let i;if(i="string"==typeof t?o(s(t)):t,!n||!i)return!1;let r=n.majorBase,a=n.minorBase,l=n.patchBase,c=i.majorBase,u=i.minorBase,d=i.patchBase,h=i.majorMustEqual,f=i.minorMustEqual,g=i.patchMustEqual;return i.isMinimum?r>c||!(r<c)&&(a>u||!(a<u)&&l>=d):(1!==r||0!==c||h&&f&&g||(c=1,u=0,d=0,h=!0,f=!1,g=!1),
!(r<c)&&(r>c?!h:!(a<u)&&(a>u?!f:!(l<d)&&(!(l>d)||!g))))}function l(e,t,i=[]){let r=o(s(t));if(!r)return i.push(n.localize(0,null,t)),!1;if(0===r.majorBase){if(!r.majorMustEqual||!r.minorMustEqual)return i.push(n.localize(1,null,t)),!1}else if(!r.majorMustEqual)return i.push(n.localize(2,null,t)),!1;return!!a(e,r)||(i.push(n.localize(3,null,e,t)),!1)}Object.defineProperty(t,"__esModule",{value:!0});const c=/^(\^|>=)?((\d+)|x)\.((\d+)|x)\.((\d+)|x)(\-.*)?$/;t.isValidVersionStr=r,t.parseVersion=s,t.normalizeVersion=o,t.isValidVersion=a,t.isValidExtensionVersion=function(e,t,n){return!(!t.isBuiltin&&void 0!==t.main)||l(e,t.engines.vscode,n)},t.isEngineValid=function(e){return"*"===e||l(i.default.version,e)},t.isVersionValid=l});var i=this&&this.__decorate||function(e,t,n,i){var r,s=arguments.length,o=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i
;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(s<3?r(o):s>3?r(t,n,o):r(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o};define(e[61],t([1,0,90,57,24,2,59,22,25,51,15,37,20]),function(e,t,n,r,s,o,a,l,c,u,d,h,f){"use strict";function g(e,t){return d.isWindows?function(e,t){return`\\\\.\\pipe\\${n.createHash("md5").update(e).digest("hex")}-${l.default.version}-${t}-sock`}(e,t):function(e,t){if(S){const i=n.createHash("md5").update(e).digest("hex").substr(0,8);return o.join(S,`vscode-${i}-${l.default.version}-${t}.sock`)}return o.join(e,`${l.default.version}-${t}.sock`)}(e,t)}function p(e,t){return v(e["inspect-extensions"],e["inspect-brk-extensions"],5870,t,e.debugId)}function m(e,t){return v(e["inspect-search"],e["inspect-brk-search"],5876,t)}function v(e,t,n,i,r){const s=t||e,o=Number(s)||(i?null:n);return{port:o,break:!!o&&Boolean(!!t),debugId:r}}function y(e,t){if(!e)return;const n=o.resolve(e)
;return o.normalize(e)===n?n:o.resolve(t.env.VSCODE_CWD||t.cwd(),e)}function E(e,t){return y(e["user-data-dir"],t)||o.resolve(r.getDefaultUserDataPath(t.platform))}Object.defineProperty(t,"__esModule",{value:!0});const S=process.env.XDG_RUNTIME_DIR;class x{constructor(e,t){if(this._args=e,this._execPath=t,!process.env.VSCODE_LOGS){const e=u.toLocalISOString(new Date).replace(/-|:|\.\d+Z$/g,"");process.env.VSCODE_LOGS=o.join(this.userDataPath,"logs",e)}this.logsPath=process.env.VSCODE_LOGS}get args(){return this._args}get appRoot(){return o.dirname(h.getPathFromAmdModule(e,""))}get execPath(){return this._execPath}get cliPath(){return function(e,t,n){return d.isWindows?n?o.join(o.dirname(e),"bin",`${c.default.applicationName}.cmd`):o.join(t,"scripts","code-cli.bat"):d.isLinux?n?o.join(o.dirname(e),"bin",`${c.default.applicationName}`):o.join(t,"scripts","code-cli.sh"):n?o.join(t,"bin","code"):o.join(t,"scripts","code-cli.sh")}(this.execPath,this.appRoot,this.isBuilt)}get userHome(){return s.homedir()}
get userDataPath(){const e=process.env.VSCODE_PORTABLE;return e?o.join(e,"user-data"):E(this._args,process)}get appNameLong(){return c.default.nameLong}get appQuality(){return c.default.quality}get appSettingsHome(){return o.join(this.userDataPath,"User")}get appSettingsPath(){return o.join(this.appSettingsHome,"settings.json")}get globalStorageHome(){return o.join(this.appSettingsHome,"globalStorage")}get workspaceStorageHome(){return o.join(this.appSettingsHome,"workspaceStorage")}get settingsSearchBuildId(){return c.default.settingsSearchBuildId}get settingsSearchUrl(){return c.default.settingsSearchUrl}get appKeybindingsPath(){return o.join(this.appSettingsHome,"keybindings.json")}get isExtensionDevelopment(){return!!this._args.extensionDevelopmentPath}get backupHome(){return o.join(this.userDataPath,"Backups")}get backupWorkspacesPath(){return o.join(this.backupHome,"workspaces.json")}get untitledWorkspacesHome(){return f.URI.file(o.join(this.userDataPath,"Workspaces"))}get installSourcePath(){
return o.join(this.userDataPath,"installSource")}get builtinExtensionsPath(){const t=y(this._args["builtin-extensions-dir"],process);return t||o.normalize(o.join(h.getPathFromAmdModule(e,""),"..","extensions"))}get extensionsPath(){const e=y(this._args["extensions-dir"],process);if(e)return e;const t=process.env.VSCODE_EXTENSIONS;if(t)return t;const n=process.env.VSCODE_PORTABLE;return n?o.join(n,"extensions"):o.join(this.userHome,c.default.dataFolderName,"extensions")}get extensionDevelopmentLocationURI(){const e=this._args.extensionDevelopmentPath;if(e)return/^[^:/?#]+?:\/\//.test(e)?f.URI.parse(e):f.URI.file(o.normalize(e))}get extensionTestsLocationURI(){const e=this._args.extensionTestsPath;if(e)return/^[^:/?#]+?:\/\//.test(e)?f.URI.parse(e):f.URI.file(o.normalize(e))}get disableExtensions(){if(this._args["disable-extensions"])return!0;const e=this._args["disable-extension"];if(e){if("string"==typeof e)return[e];if(Array.isArray(e)&&e.length>0)return e}return!1}get skipGettingStarted(){
return!!this._args["skip-getting-started"]}get skipReleaseNotes(){return!!this._args["skip-release-notes"]}get skipAddToRecentlyOpened(){return!!this._args["skip-add-to-recently-opened"]}get debugExtensionHost(){return p(this._args,this.isBuilt)}get debugSearch(){return m(this._args,this.isBuilt)}get isBuilt(){return!process.env.VSCODE_DEV}get verbose(){return!!this._args.verbose}get log(){return this._args.log}get wait(){return!!this._args.wait}get logExtensionHostCommunication(){return!!this._args.logExtensionHostCommunication}get status(){return!!this._args.status}get mainIPCHandle(){return g(this.userDataPath,"main")}get sharedIPCHandle(){return g(this.userDataPath,"shared")}get nodeCachedDataDir(){return process.env.VSCODE_NODE_CACHED_DATA_DIR||void 0}get disableUpdates(){return!!this._args["disable-updates"]}get disableCrashReporter(){return!!this._args["disable-crash-reporter"]}get driverHandle(){return this._args.driver}get driverVerbose(){return!!this._args["driver-verbose"]}}
i([a.memoize],x.prototype,"appRoot",null),i([a.memoize],x.prototype,"cliPath",null),i([a.memoize],x.prototype,"userHome",null),i([a.memoize],x.prototype,"userDataPath",null),i([a.memoize],x.prototype,"appSettingsHome",null),i([a.memoize],x.prototype,"appSettingsPath",null),i([a.memoize],x.prototype,"globalStorageHome",null),i([a.memoize],x.prototype,"workspaceStorageHome",null),i([a.memoize],x.prototype,"settingsSearchBuildId",null),i([a.memoize],x.prototype,"settingsSearchUrl",null),i([a.memoize],x.prototype,"appKeybindingsPath",null),i([a.memoize],x.prototype,"isExtensionDevelopment",null),i([a.memoize],x.prototype,"backupHome",null),i([a.memoize],x.prototype,"backupWorkspacesPath",null),i([a.memoize],x.prototype,"untitledWorkspacesHome",null),i([a.memoize],x.prototype,"installSourcePath",null),i([a.memoize],x.prototype,"builtinExtensionsPath",null),i([a.memoize],x.prototype,"extensionsPath",null),i([a.memoize],x.prototype,"extensionDevelopmentLocationURI",null),
i([a.memoize],x.prototype,"extensionTestsLocationURI",null),i([a.memoize],x.prototype,"debugExtensionHost",null),i([a.memoize],x.prototype,"debugSearch",null),i([a.memoize],x.prototype,"mainIPCHandle",null),i([a.memoize],x.prototype,"sharedIPCHandle",null),i([a.memoize],x.prototype,"nodeCachedDataDir",null),t.EnvironmentService=x,t.parseExtensionHostPort=p,t.parseSearchPort=m,t.parseDebugPort=v,t.parseUserDataDir=E}),define(e[36],t([1,0,19,17,25]),function(e,t,n,i,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isUIExtension=function(e,t){const s=n.getGalleryExtensionId(e.publisher,e.name),o=t.getValue("_workbench.uiExtensions")||[];if(o.length){if(-1!==o.indexOf(s))return!0;if(-1!==o.indexOf(`-${s}`))return!1}switch(e.extensionKind){case"ui":return!0;case"workspace":return!1;default:return!((!i.isNonEmptyArray(r.default.uiExtensions)||!r.default.uiExtensions.some(e=>n.areSameExtensions({id:e},{id:s})))&&(e.main||e.contributes&&i.isNonEmptyArray(e.contributes.debuggers)))}}}),
define(e[14],t([1,0,4,84]),function(e,t,n,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});class r{constructor(){this.data={}}add(e,t){i.ok(n.isString(e)),i.ok(n.isObject(t)),i.ok(!this.data.hasOwnProperty(e),"There is already an extension with this id"),this.data[e]=t}knows(e){return this.data.hasOwnProperty(e)}as(e){return this.data[e]||null}}t.Registry=new r}),define(e[67],t([1,0,14,8]),function(e,t,n,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Extensions={JSONContribution:"base.contributions.json"};class r{constructor(){this._onDidChangeSchema=new i.Emitter,this.onDidChangeSchema=this._onDidChangeSchema.event,this.schemasById={}}registerSchema(e,t){this.schemasById[function(e){return e.length>0&&"#"===e.charAt(e.length-1)?e.substring(0,e.length-1):e}(e)]=t,this._onDidChangeSchema.fire(e)}notifySchemaChanged(e){this._onDidChangeSchema.fire(e)}getSchemaContributions(){return{schemas:this.schemasById}}}const s=new r;n.Registry.add(t.Extensions.JSONContribution,s)}),
define(e[18],t([1,0,62,8,14,4,13,67]),function(e,t,n,i,r,s,o,a){"use strict";function l(e){switch(Array.isArray(e)?e[0]:e){case"boolean":return!1;case"integer":case"number":return 0;case"string":return"";case"array":return[];case"object":return{};default:return null}}function c(e){return t.OVERRIDE_PROPERTY_PATTERN.test(e)?n.localize(3,null,e):void 0!==p.getConfigurationProperties()[e]?n.localize(4,null,e):null}Object.defineProperty(t,"__esModule",{value:!0}),t.Extensions={Configuration:"base.contributions.configuration"};!function(e){e[e.APPLICATION=1]="APPLICATION",e[e.WINDOW=2]="WINDOW",e[e.RESOURCE=3]="RESOURCE"}(t.ConfigurationScope||(t.ConfigurationScope={})),t.allSettings={properties:{},patternProperties:{}},t.applicationSettings={properties:{},patternProperties:{}},t.windowSettings={properties:{},patternProperties:{}},t.resourceSettings={properties:{},patternProperties:{}},t.editorConfigurationSchemaId="vscode://schemas/settings/editor";const u=r.Registry.as(a.Extensions.JSONContribution);class d{
constructor(){this.overrideIdentifiers=[],this._onDidSchemaChange=new i.Emitter,this.onDidSchemaChange=this._onDidSchemaChange.event,this._onDidUpdateConfiguration=new i.Emitter,this.onDidUpdateConfiguration=this._onDidUpdateConfiguration.event,this.defaultOverridesConfigurationNode={id:"defaultOverrides",title:n.localize(0,null),properties:{}},this.configurationContributors=[this.defaultOverridesConfigurationNode],this.editorConfigurationSchema={properties:{},patternProperties:{},additionalProperties:!1,errorMessage:"Unknown editor configuration setting"},this.configurationProperties={},this.excludedConfigurationProperties={},this.computeOverridePropertyPattern(),u.registerSchema(t.editorConfigurationSchemaId,this.editorConfigurationSchema)}registerConfiguration(e,t=!0){this.registerConfigurations([e],t)}registerConfigurations(e,t=!0){const n=[];e.forEach(e=>{n.push(...this.validateAndRegisterProperties(e,t)),this.configurationContributors.push(e),this.registerJSONConfiguration(e),
this.updateSchemaForOverrideSettingsConfiguration(e)}),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire(n)}deregisterConfigurations(e){const n=[],i=e=>{if(e.properties)for(const i in e.properties)switch(n.push(i),delete this.configurationProperties[i],delete this.editorConfigurationSchema.properties[i],delete t.allSettings.properties[i],e.properties[i].scope){case 1:delete t.applicationSettings.properties[i];break;case 2:delete t.windowSettings.properties[i];break;case 3:delete t.resourceSettings.properties[i]}e.allOf&&e.allOf.forEach(e=>i(e))};for(const t of e){i(t);const e=this.configurationContributors.indexOf(t);-1!==e&&this.configurationContributors.splice(e,1)}u.registerSchema(t.editorConfigurationSchemaId,this.editorConfigurationSchema),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire(n)}registerDefaultConfigurations(e){const i=[];for(const r of e)for(const e in r.defaults){const s=r.defaults[e];if(t.OVERRIDE_PROPERTY_PATTERN.test(e)&&"object"==typeof s){const r={
type:"object",default:s,description:n.localize(1,null,e),$ref:t.editorConfigurationSchemaId};t.allSettings.properties[e]=r,this.defaultOverridesConfigurationNode.properties[e]=r,this.configurationProperties[e]=r,i.push(e)}}this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire(i)}deregisterDefaultConfigurations(e){const n=[];for(const i of e)for(const e in i.defaults)n.push(e),delete t.allSettings.properties[e],delete this.defaultOverridesConfigurationNode.properties[e],delete this.configurationProperties[e];this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire(n)}notifyConfigurationSchemaUpdated(...e){this._onDidSchemaChange.fire()}registerOverrideIdentifiers(e){this.overrideIdentifiers.push(...e),this.updateOverridePropertyPatternKey()}validateAndRegisterProperties(e,n=!0,i=2,r=!1){i=s.isUndefinedOrNull(e.scope)?i:e.scope,r=e.overridable||r;let o=[],a=e.properties;if(a)for(let e in a){let u;if(n&&(u=c(e))){console.warn(u),delete a[e];continue}let d=a[e],h=d.default
;s.isUndefined(h)&&(d.default=l(d.type)),r&&(d.overridable=!0),t.OVERRIDE_PROPERTY_PATTERN.test(e)?d.scope=void 0:d.scope=s.isUndefinedOrNull(d.scope)?i:d.scope,!a[e].hasOwnProperty("included")||a[e].included?(this.configurationProperties[e]=a[e],o.push(e)):(this.excludedConfigurationProperties[e]=a[e],delete a[e])}let u=e.allOf;if(u)for(let e of u)o.push(...this.validateAndRegisterProperties(e,n,i,r));return o}getConfigurations(){return this.configurationContributors}getConfigurationProperties(){return this.configurationProperties}getExcludedConfigurationProperties(){return this.excludedConfigurationProperties}registerJSONConfiguration(e){function n(e){let i=e.properties;if(i)for(const e in i)switch(t.allSettings.properties[e]=i[e],i[e].scope){case 1:t.applicationSettings.properties[e]=i[e];break;case 2:t.windowSettings.properties[e]=i[e];break;case 3:t.resourceSettings.properties[e]=i[e]}let r=e.allOf;r&&r.forEach(n)}n(e)}updateSchemaForOverrideSettingsConfiguration(e){e.id!==h&&(this.update(e),
u.registerSchema(t.editorConfigurationSchemaId,this.editorConfigurationSchema))}updateOverridePropertyPatternKey(){let e=t.allSettings.patternProperties[this.overridePropertyPattern];e||(e={type:"object",description:n.localize(2,null),errorMessage:"Unknown Identifier. Use language identifiers",$ref:t.editorConfigurationSchemaId}),delete t.allSettings.patternProperties[this.overridePropertyPattern],delete t.applicationSettings.patternProperties[this.overridePropertyPattern],delete t.windowSettings.patternProperties[this.overridePropertyPattern],delete t.resourceSettings.patternProperties[this.overridePropertyPattern],this.computeOverridePropertyPattern(),t.allSettings.patternProperties[this.overridePropertyPattern]=e,t.applicationSettings.patternProperties[this.overridePropertyPattern]=e,t.windowSettings.patternProperties[this.overridePropertyPattern]=e,t.resourceSettings.patternProperties[this.overridePropertyPattern]=e,this._onDidSchemaChange.fire()}update(e){let t=e.properties
;if(t)for(let e in t)t[e].overridable&&(this.editorConfigurationSchema.properties[e]=this.getConfigurationProperties()[e]);let n=e.allOf;n&&n.forEach(e=>this.update(e))}computeOverridePropertyPattern(){this.overridePropertyPattern=this.overrideIdentifiers.length?g.replace("${0}",this.overrideIdentifiers.map(e=>o.createRegExp(e,!1).source).join("|")):f}}const h="override",f="\\[.*\\]$",g="\\[(${0})\\]$";t.OVERRIDE_PROPERTY_PATTERN=new RegExp(f),t.getDefaultValue=l;const p=new d;r.Registry.add(t.Extensions.Configuration,p),t.validateProperty=c,t.getScopes=function(){const e={},t=p.getConfigurationProperties();for(const n of Object.keys(t))e[n]=t[n].scope;return e.launch=3,e.task=3,e}}),define(e[12],t([1,0,5,4,20,14,3,18]),function(e,t,n,i,r,s,o,a){"use strict";function l(e,t){const n=Object.create(null);for(let i in e)c(n,i,e[i],t);return n}function c(e,t,n,i){const r=t.split("."),s=r.pop();let o=e;for(let e=0;e<r.length;e++){let n=r[e],s=o[n];switch(typeof s){case"undefined":s=o[n]=Object.create(null);break
;case"object":break;default:return void i(`Ignoring ${t} as ${r.slice(0,e+1).join(".")} is ${JSON.stringify(s)}`)}o=s}"object"==typeof o?o[s]=n:i(`Ignoring ${t} as ${r.join(".")} is ${JSON.stringify(o)}`)}function u(e,t){const n=t.shift();if(0!==t.length){if(-1!==Object.keys(e).indexOf(n)){const i=e[n];"object"!=typeof i||Array.isArray(i)||(u(i,t),0===Object.keys(i).length&&delete e[n])}}else delete e[n]}function d(e,t,n){const i=function(e,t){let n=e;for(const e of t){if("object"!=typeof n||null===n)return;n=n[e]}return n}(e,t.split("."));return void 0===i?n:i}function h(e,t,n){Object.keys(t).forEach(r=>{r in e?i.isObject(e[r])&&i.isObject(t[r])?h(e[r],t[r],n):n&&(e[r]=t[r]):e[r]=t[r]})}function f(e){return e.substring(1,e.length-1)}Object.defineProperty(t,"__esModule",{value:!0}),t.IConfigurationService=o.createDecorator("configurationService"),t.isConfigurationOverrides=function(e){
return e&&"object"==typeof e&&(!e.overrideIdentifier||"string"==typeof e.overrideIdentifier)&&(!e.resource||e.resource instanceof r.URI)};!function(e){e[e.USER=1]="USER",e[e.WORKSPACE=2]="WORKSPACE",e[e.WORKSPACE_FOLDER=3]="WORKSPACE_FOLDER",e[e.DEFAULT=4]="DEFAULT",e[e.MEMORY=5]="MEMORY"}(t.ConfigurationTarget||(t.ConfigurationTarget={})),t.ConfigurationTargetToString=function(e){switch(e){case 1:return"USER";case 2:return"WORKSPACE";case 3:return"WORKSPACE_FOLDER";case 4:return"DEFAULT";case 5:return"MEMORY"}},t.compare=function(e,t){const i=t.keys.filter(t=>-1===e.keys.indexOf(t)),r=e.keys.filter(e=>-1===t.keys.indexOf(e)),s=[];for(const i of e.keys){const r=d(e.contents,i),o=d(t.contents,i);n.equals(r,o)||s.push(i)}return{added:i,removed:r,updated:s}},t.toOverrides=function(e,t){const n=[],i=s.Registry.as(a.Extensions.Configuration).getConfigurationProperties();for(const r of Object.keys(e))if(a.OVERRIDE_PROPERTY_PATTERN.test(r)){const s={};for(const t in e[r])i[t]&&i[t].overridable&&(s[t]=e[r][t])
;n.push({identifiers:[f(r).trim()],contents:l(s,t)})}return n},t.toValuesTree=l,t.addToValueTree=c,t.removeFromValueTree=function(e,t){u(e,t.split("."))},t.getConfigurationValue=d,t.merge=h,t.getConfigurationKeys=function(){const e=s.Registry.as(a.Extensions.Configuration).getConfigurationProperties();return Object.keys(e)},t.getDefaultValues=function(){const e=Object.create(null),t=s.Registry.as(a.Extensions.Configuration).getConfigurationProperties();for(let n in t)c(e,n,t[n].default,e=>console.error(`Conflict in default settings: ${e}`));return e},t.overrideIdentifierFromKey=f,t.keyFromOverrideIdentifier=function(e){return`[${e}]`},t.getMigratedSettingValue=function(e,t,n){const i=e.inspect(t),r=e.inspect(n);return void 0!==i.user||void 0!==i.workspace||void 0!==i.workspaceFolder?i.value:void 0!==r.user||void 0!==r.workspace||void 0!==r.workspaceFolder?r.value:i.default}}),define(e[40],t([1,0,42,71,17,4,5,18,12]),function(e,t,n,i,r,s,o,a,l){"use strict";Object.defineProperty(t,"__esModule",{value:!0})
;class c{constructor(e={},t=[],n=[]){this._contents=e,this._keys=t,this._overrides=n,this.isFrozen=!1}get contents(){return this.checkAndFreeze(this._contents)}get overrides(){return this.checkAndFreeze(this._overrides)}get keys(){return this.checkAndFreeze(this._keys)}getValue(e){return e?l.getConfigurationValue(this.contents,e):this.contents}override(e){const t=this.getContentsForOverrideIdentifer(e);if(!t||"object"!=typeof t||!Object.keys(t).length)return this;let n={};for(const e of r.distinct([...Object.keys(this.contents),...Object.keys(t)])){let i=this.contents[e],r=t[e];r&&("object"==typeof i&&"object"==typeof r?(i=o.deepClone(i),this.mergeContents(i,r)):i=r),n[e]=i}return new c(n)}merge(...e){const t=o.deepClone(this.contents),n=o.deepClone(this.overrides),i=[...this.keys];for(const s of e){this.mergeContents(t,s.contents);for(const e of s.overrides){const[t]=n.filter(t=>r.equals(t.identifiers,e.identifiers));t?this.mergeContents(t.contents,e.contents):n.push(o.deepClone(e))}
for(const e of s.keys)-1===i.indexOf(e)&&i.push(e)}return new c(t,i,n)}freeze(){return this.isFrozen=!0,this}mergeContents(e,t){for(const n of Object.keys(t))n in e&&s.isObject(e[n])&&s.isObject(t[n])?this.mergeContents(e[n],t[n]):e[n]=o.deepClone(t[n])}checkAndFreeze(e){return this.isFrozen&&!Object.isFrozen(e)?o.deepFreeze(e):e}getContentsForOverrideIdentifer(e){for(const t of this.overrides)if(-1!==t.identifiers.indexOf(e))return t.contents;return null}toJSON(){return{contents:this.contents,overrides:this.overrides,keys:this.keys}}setValue(e,t){this.addKey(e),l.addToValueTree(this.contents,e,t,e=>{throw new Error(e)})}removeValue(e){this.removeKey(e)&&l.removeFromValueTree(this.contents,e)}addKey(e){let t=this.keys.length;for(let n=0;n<t;n++)0===e.indexOf(this.keys[n])&&(t=n);this.keys.splice(t,1,e)}removeKey(e){let t=this.keys.indexOf(e);return-1!==t&&(this.keys.splice(t,1),!0)}}t.ConfigurationModel=c;class u extends c{constructor(){const e=l.getDefaultValues(),t=l.getConfigurationKeys(),n=[]
;for(const t of Object.keys(e))a.OVERRIDE_PROPERTY_PATTERN.test(t)&&n.push({identifiers:[l.overrideIdentifierFromKey(t).trim()],contents:l.toValuesTree(e[t],e=>console.error(`Conflict in default settings file: ${e}`))});super(e,t,n)}}t.DefaultConfigurationModel=u;class d{constructor(e){this._name=e,this._configurationModel=null,this._parseErrors=[]}get configurationModel(){return this._configurationModel||new c}get errors(){return this._parseErrors}parse(e){if(e){const t=this.parseContent(e),n=this.parseRaw(t);this._configurationModel=new c(n.contents,n.keys,n.overrides)}}parseContent(e){function t(e){Array.isArray(s)?s.push(e):r&&(s[r]=e)}let i={},r=null,s=[],o=[],a=[],l={onObjectBegin:()=>{let e={};t(e),o.push(s),s=e,r=null},onObjectProperty:e=>{r=e},onObjectEnd:()=>{s=o.pop()},onArrayBegin:()=>{let e=[];t(e),o.push(s),s=e,r=null},onArrayEnd:()=>{s=o.pop()},onLiteralValue:t,onError:(e,t,n)=>{a.push({error:e,offset:t,length:n})}};if(e)try{n.visit(e,l),i=s[0]||{}}catch(e){
console.error(`Error while parsing settings file ${this._name}: ${e}`),this._parseErrors=[e]}return i}parseRaw(e){return{contents:l.toValuesTree(e,e=>console.error(`Conflict in settings file ${this._name}: ${e}`)),keys:Object.keys(e),overrides:l.toOverrides(e,e=>console.error(`Conflict in settings file ${this._name}: ${e}`))}}}t.ConfigurationModelParser=d;class h{constructor(e,t,n=new c,r=new i.ResourceMap,s=new c,o=new i.ResourceMap,a=!0){this._defaultConfiguration=e,this._userConfiguration=t,this._workspaceConfiguration=n,this._folderConfigurations=r,this._memoryConfiguration=s,this._memoryConfigurationByResource=o,this._freeze=a,this._workspaceConsolidatedConfiguration=null,this._foldersConsolidatedConfigurations=new i.ResourceMap}getValue(e,t,n){return this.getConsolidateConfigurationModel(t,n).getValue(e)}updateValue(e,t,n={}){let i;n.resource?(i=this._memoryConfigurationByResource.get(n.resource))||(i=new c,this._memoryConfigurationByResource.set(n.resource,i)):i=this._memoryConfiguration,
void 0===t?i.removeValue(e):i.setValue(e,t),n.resource||(this._workspaceConsolidatedConfiguration=null)}inspect(e,t,n){const i=this.getConsolidateConfigurationModel(t,n),r=this.getFolderConfigurationModelForResource(t.resource,n),s=t.resource?this._memoryConfigurationByResource.get(t.resource)||this._memoryConfiguration:this._memoryConfiguration;return{default:t.overrideIdentifier?this._defaultConfiguration.freeze().override(t.overrideIdentifier).getValue(e):this._defaultConfiguration.freeze().getValue(e),user:t.overrideIdentifier?this._userConfiguration.freeze().override(t.overrideIdentifier).getValue(e):this._userConfiguration.freeze().getValue(e),workspace:n?t.overrideIdentifier?this._workspaceConfiguration.freeze().override(t.overrideIdentifier).getValue(e):this._workspaceConfiguration.freeze().getValue(e):void 0,workspaceFolder:r?t.overrideIdentifier?r.freeze().override(t.overrideIdentifier).getValue(e):r.freeze().getValue(e):void 0,
memory:t.overrideIdentifier?s.override(t.overrideIdentifier).getValue(e):s.getValue(e),value:i.getValue(e)}}keys(e){const t=this.getFolderConfigurationModelForResource(void 0,e);return{default:this._defaultConfiguration.freeze().keys,user:this._userConfiguration.freeze().keys,workspace:this._workspaceConfiguration.freeze().keys,workspaceFolder:t?t.freeze().keys:[]}}updateDefaultConfiguration(e){this._defaultConfiguration=e,this._workspaceConsolidatedConfiguration=null,this._foldersConsolidatedConfigurations.clear()}updateUserConfiguration(e){this._userConfiguration=e,this._workspaceConsolidatedConfiguration=null,this._foldersConsolidatedConfigurations.clear()}updateWorkspaceConfiguration(e){this._workspaceConfiguration=e,this._workspaceConsolidatedConfiguration=null,this._foldersConsolidatedConfigurations.clear()}updateFolderConfiguration(e,t){this._folderConfigurations.set(e,t),this._foldersConsolidatedConfigurations.delete(e)}deleteFolderConfiguration(e){this.folders.delete(e),
this._foldersConsolidatedConfigurations.delete(e)}get defaults(){return this._defaultConfiguration}get user(){return this._userConfiguration}get workspace(){return this._workspaceConfiguration}get folders(){return this._folderConfigurations}getConsolidateConfigurationModel(e,t){let n=this.getConsolidatedConfigurationModelForResource(e,t);return e.overrideIdentifier?n.override(e.overrideIdentifier):n}getConsolidatedConfigurationModelForResource({resource:e},t){let n=this.getWorkspaceConsolidatedConfiguration();if(t&&e){const i=t.getFolder(e);i&&(n=this.getFolderConsolidatedConfiguration(i.uri)||n);const r=this._memoryConfigurationByResource.get(e);r&&(n=n.merge(r))}return n}getWorkspaceConsolidatedConfiguration(){return this._workspaceConsolidatedConfiguration||(this._workspaceConsolidatedConfiguration=this._defaultConfiguration.merge(this._userConfiguration,this._workspaceConfiguration,this._memoryConfiguration),this._freeze&&(this._workspaceConfiguration=this._workspaceConfiguration.freeze())),
this._workspaceConsolidatedConfiguration}getFolderConsolidatedConfiguration(e){let t=this._foldersConsolidatedConfigurations.get(e);if(!t){const n=this.getWorkspaceConsolidatedConfiguration(),i=this._folderConfigurations.get(e);i?(t=n.merge(i),this._freeze&&(t=t.freeze()),this._foldersConsolidatedConfigurations.set(e,t)):t=n}return t}getFolderConfigurationModelForResource(e,t){if(t&&e){const n=t.getFolder(e);if(n)return this._folderConfigurations.get(n.uri)||null}return null}toData(){return{defaults:{contents:this._defaultConfiguration.contents,overrides:this._defaultConfiguration.overrides,keys:this._defaultConfiguration.keys},user:{contents:this._userConfiguration.contents,overrides:this._userConfiguration.overrides,keys:this._userConfiguration.keys},workspace:{contents:this._workspaceConfiguration.contents,overrides:this._workspaceConfiguration.overrides,keys:this._workspaceConfiguration.keys},folders:this._folderConfigurations.keys().reduce((e,t)=>{
const{contents:n,overrides:i,keys:r}=this._folderConfigurations.get(t);return e[t.toString()]={contents:n,overrides:i,keys:r},e},Object.create({})),isComplete:!0}}allKeys(e){let t=this.keys(e),n=[...t.default];const i=e=>{for(const t of e)-1===n.indexOf(t)&&n.push(t)};i(t.user),i(t.workspace);for(const e of this.folders.keys())i(this.folders.get(e).keys);return n}}t.Configuration=h;class f{doesConfigurationContains(e,t){let n,i=e.contents,r=l.toValuesTree({[t]:!0},()=>{});for(;"object"==typeof r&&(n=Object.keys(r)[0]);){if(!(i=i[n]))return!1;r=r[n]}return!0}updateKeys(e,t,n){for(const n of t)e.setValue(n,{})}}t.AbstractConfigurationChangeEvent=f;class g extends f{constructor(e=new c,t=new i.ResourceMap){super(),this._changedConfiguration=e,this._changedConfigurationByResource=t}get changedConfiguration(){return this._changedConfiguration}get changedConfigurationByResource(){return this._changedConfigurationByResource}change(e,t){if(e instanceof g){
this._changedConfiguration=this._changedConfiguration.merge(e._changedConfiguration);for(const t of e._changedConfigurationByResource.keys()){let n=this.getOrSetChangedConfigurationForResource(t);n=n.merge(e._changedConfigurationByResource.get(t)),this._changedConfigurationByResource.set(t,n)}}else this.changeWithKeys(e,t);return this}telemetryData(e,t){return this._source=e,this._sourceConfig=t,this}get affectedKeys(){const e=[...this._changedConfiguration.keys];return this._changedConfigurationByResource.forEach(t=>e.push(...t.keys)),r.distinct(e)}get source(){return this._source}get sourceConfig(){return this._sourceConfig}affectsConfiguration(e,t){let n=[this._changedConfiguration];if(t){let e=this._changedConfigurationByResource.get(t);e&&n.push(e)}else n.push(...this._changedConfigurationByResource.values());for(const t of n)if(this.doesConfigurationContains(t,e))return!0;return!1}changeWithKeys(e,t){let n=t?this.getOrSetChangedConfigurationForResource(t):this._changedConfiguration;this.updateKeys(n,e)}
getOrSetChangedConfigurationForResource(e){let t=this._changedConfigurationByResource.get(e);return t||(t=new c,this._changedConfigurationByResource.set(e,t)),t}}t.ConfigurationChangeEvent=g}),define(e[72],t([1,0,11,21,40,86,8]),function(e,t,n,i,r,s,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});class a extends n.Disposable{constructor(e){super(),this.settingsPath=e,this._onDidChangeConfiguration=this._register(new o.Emitter),this.onDidChangeConfiguration=this._onDidChangeConfiguration.event}initialize(){return this.initializePromise||(this.initializePromise=new Promise((e,t)=>{this.userConfigModelWatcher=new s.ConfigWatcher(this.settingsPath,{changeBufferDelay:300,onError:e=>i.onUnexpectedError(e),defaultConfig:new r.ConfigurationModelParser(this.settingsPath),parse:(e,t)=>{const n=new r.ConfigurationModelParser(this.settingsPath);return n.parse(e),[...n.errors],n},initCallback:()=>e(void 0)}),this._register(this.userConfigModelWatcher),
this._register(this.userConfigModelWatcher.onDidUpdateConfiguration(()=>this._onDidChangeConfiguration.fire(this.userConfigModelWatcher.getConfig().configurationModel)))})),this.initializePromise.then(()=>this.userConfigModelWatcher.getConfig().configurationModel)}initializeSync(){return this.initialize(),this.userConfigModelWatcher.getConfig().configurationModel}reload(){return this.initialize().then(()=>new Promise(e=>this.userConfigModelWatcher.reload(t=>e(t.configurationModel))))}}t.UserConfiguration=a});var r=this&&this.__param||function(e,t){return function(n,i){t(n,i,e)}};define(e[73],t([1,0,14,18,11,12,40,8,16,72]),function(e,t,n,s,o,a,l,c,u,d){"use strict";Object.defineProperty(t,"__esModule",{value:!0});let h=class extends o.Disposable{constructor(e){super(),this._onDidChangeConfiguration=this._register(new c.Emitter),this.onDidChangeConfiguration=this._onDidChangeConfiguration.event,this.userConfiguration=this._register(new d.UserConfiguration(e.appSettingsPath))
;const t=new l.DefaultConfigurationModel,i=this.userConfiguration.initializeSync();this._configuration=new l.Configuration(t,i),this._register(this.userConfiguration.onDidChangeConfiguration(e=>this.onDidChangeUserConfiguration(e))),this._register(n.Registry.as(s.Extensions.Configuration).onDidUpdateConfiguration(e=>this.onDidDefaultConfigurationChange(e)))}get configuration(){return this._configuration}getConfigurationData(){return this.configuration.toData()}getValue(e,t){const n="string"==typeof e?e:void 0,i=a.isConfigurationOverrides(e)?e:a.isConfigurationOverrides(t)?t:{};return this.configuration.getValue(n,i,void 0)}updateValue(e,t,n,i){return Promise.reject(new Error("not supported"))}inspect(e){return this.configuration.inspect(e,{},void 0)}keys(){return this.configuration.keys(void 0)}reloadConfiguration(e){return e?Promise.resolve(void 0):this.userConfiguration.reload().then(e=>this.onDidChangeUserConfiguration(e))}onDidChangeUserConfiguration(e){
const{added:t,updated:n,removed:i}=a.compare(this._configuration.user,e),r=[...t,...n,...i];r.length&&(this._configuration.updateUserConfiguration(e),this.trigger(r,1))}onDidDefaultConfigurationChange(e){this._configuration.updateDefaultConfiguration(new l.DefaultConfigurationModel),this.trigger(e,4)}trigger(e,t){this._onDidChangeConfiguration.fire((new l.ConfigurationChangeEvent).change(e).telemetryData(t,this.getTargetConfiguration(t)))}getTargetConfiguration(e){switch(e){case 4:return this._configuration.defaults.contents;case 1:return this._configuration.user.contents}return{}}};h=i([r(0,u.IEnvironmentService)],h),t.ConfigurationService=h}),define(e[41],t([1,0,68,3,18,14]),function(e,t,n,i,r,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IRequestService=i.createDecorator("requestService2"),s.Registry.as(r.Extensions.Configuration).registerConfiguration({id:"http",order:15,title:n.localize(0,null),type:"object",properties:{"http.proxy":{type:"string",
pattern:"^https?://([^:]*(:[^@]*)?@)?([^:]+)(:\\d+)?/?$|^$",description:n.localize(1,null)},"http.proxyStrictSSL":{type:"boolean",default:!0,description:n.localize(2,null)},"http.proxyAuthorization":{type:["null","string"],default:null,description:n.localize(3,null)},"http.proxySupport":{type:"string",enum:["off","on","override"],enumDescriptions:[n.localize(4,null),n.localize(5,null),n.localize(6,null)],default:"override",description:n.localize(7,null)}}})}),define(e[75],t([1,0,3]),function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IStateService=n.createDecorator("stateService")}),define(e[76],t([1,0,2,23,16,30,4,9,10]),function(e,t,n,s,o,a,l,c,u){"use strict";Object.defineProperty(t,"__esModule",{value:!0});class d{constructor(e,t){this.dbPath=e,this.onError=t,this._database=null,this.lastFlushedSerializedDatabase=null}get database(){return this._database||(this._database=this.loadSync()),this._database}init(){return u.readFile(this.dbPath).then(e=>{try{
this.lastFlushedSerializedDatabase=e.toString(),this._database=JSON.parse(this.lastFlushedSerializedDatabase)}catch(e){this._database={}}},e=>{"ENOENT"!==e.code&&this.onError(e),this._database={}})}loadSync(){try{return this.lastFlushedSerializedDatabase=s.readFileSync(this.dbPath).toString(),JSON.parse(this.lastFlushedSerializedDatabase)}catch(e){return"ENOENT"!==e.code&&this.onError(e),{}}}getItem(e,t){const n=this.database[e];return l.isUndefinedOrNull(n)?t:n}setItem(e,t){if(l.isUndefinedOrNull(t))return this.removeItem(e);("string"!=typeof t&&"number"!=typeof t&&"boolean"!=typeof t||this.database[e]!==t)&&(this.database[e]=t,this.saveSync())}removeItem(e){l.isUndefined(this.database[e])||(this.database[e]=void 0,this.saveSync())}saveSync(){const e=JSON.stringify(this.database,null,4);if(e!==this.lastFlushedSerializedDatabase)try{a.writeFileAndFlushSync(this.dbPath,e),this.lastFlushedSerializedDatabase=e}catch(e){this.onError(e)}}}t.FileStorage=d;let h=class e{constructor(t,i){
this.fileStorage=new d(n.join(t.userDataPath,e.STATE_FILE),e=>i.error(e))}init(){return this.fileStorage.init()}getItem(e,t){return this.fileStorage.getItem(e,t)}setItem(e,t){this.fileStorage.setItem(e,t)}removeItem(e){this.fileStorage.removeItem(e)}};h.STATE_FILE="storage.json",h=i([r(0,o.IEnvironmentService),r(1,c.ILogService)],h),t.StateService=h}),define(e[28],t([1,0,3]),function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ITelemetryService=n.createDecorator("telemetryService")}),define(e[78],t([1,0,69,13,3,12,18,11,5,14]),function(e,t,n,s,o,a,l,c,u,d){"use strict";Object.defineProperty(t,"__esModule",{value:!0});let h=class{constructor(e,t){this._configurationService=t,this._disposables=[],this._cleanupPatterns=[],this._appender=e.appender,this._commonProperties=e.commonProperties||Promise.resolve({}),this._piiPaths=e.piiPaths||[],this._userOptIn=!0,this._cleanupPatterns=[/file:\/\/\/.*?\/resources\/app\//gi]
;for(let e of this._piiPaths)this._cleanupPatterns.push(new RegExp(s.escapeRegExpCharacters(e),"gi"));this._configurationService&&(this._updateUserOptIn(),this._configurationService.onDidChangeConfiguration(this._updateUserOptIn,this,this._disposables),this.publicLog("optInStatus",{optIn:this._userOptIn}),this._commonProperties.then(e=>{const t=/^[a-f0-9]+$/i.test(e["common.machineId"]);this.publicLog("machineIdFallback",{usingFallbackGuid:!t})}))}_updateUserOptIn(){const e=this._configurationService.getValue(f);this._userOptIn=e?e.enableTelemetry:this._userOptIn}get isOptedIn(){return this._userOptIn}getTelemetryInfo(){return this._commonProperties.then(e=>{return{sessionId:e.sessionID,instanceId:e["common.instanceId"],machineId:e["common.machineId"]}})}dispose(){this._disposables=c.dispose(this._disposables)}publicLog(e,t,n){return this._userOptIn?this._commonProperties.then(i=>{t=u.mixin(t,i),t=u.cloneAndChange(t,e=>{if("string"==typeof e)return this._cleanupInfo(e,n)}),this._appender.log(e,t)},e=>{
console.error(e)}):Promise.resolve(void 0)}_cleanupInfo(e,t){let n=e;if(t){const t=[];for(let n of this._cleanupPatterns)for(;;){const i=n.exec(e);if(!i)break;t.push([i.index,n.lastIndex])}const i=/^[\\\/]?(node_modules|node_modules\.asar)[\\\/]/,r=/(file:\/\/)?([a-zA-Z]:(\\\\|\\|\/)|(\\\\|\\|\/))?([\w-\._]+(\\\\|\\|\/))+[\w-\._]*/g;let s=0;for(n="";;){const o=r.exec(e);if(!o)break;!i.test(o[0])&&t.every(([e,t])=>o.index<e||o.index>=t)&&(n+=e.substring(s,o.index)+"<REDACTED: user-file-path>",s=r.lastIndex)}s<e.length&&(n+=e.substr(s))}for(let e of this._cleanupPatterns)n=n.replace(e,"");return n}};h.IDLE_START_EVENT_NAME="UserIdleStart",h.IDLE_STOP_EVENT_NAME="UserIdleStop",h=i([r(1,o.optional(a.IConfigurationService))],h),t.TelemetryService=h;const f="telemetry";d.Registry.as(l.Extensions.Configuration).registerConfiguration({id:f,order:110,type:"object",title:n.localize(0,null),properties:{"telemetry.enableTelemetry":{type:"boolean",description:n.localize(1,null),default:!0,tags:["usesOnlineServices"]}}})
}),define(e[79],t([1,0,53,2,12,9]),function(e,t,n,s,o,a){"use strict";function l(e,t){return t.onDidChangeConfiguration(t=>{4!==t.source&&(e.publicLog("updateConfiguration",{configurationSource:o.ConfigurationTargetToString(t.source),configurationKeys:function(e){if(!e)return[];const t=[];return c(t,"",e),t}(t.sourceConfig)}),e.publicLog("updateConfigurationValues",{configurationSource:o.ConfigurationTargetToString(t.source),configurationValues:function(e,t){if(!e)return[];return t.reduce((t,n)=>{const i=n.split(".").reduce((e,t)=>e&&"object"==typeof e?e[t]:void 0,e);return void 0!==i&&t.push({[n]:i}),t},[])}(t.sourceConfig,d)}))})}function c(e,t,n){n&&"object"==typeof n&&!Array.isArray(n)?Object.keys(n).forEach(i=>c(e,t?`${t}.${i}`:i,n[i])):e.push(t)}Object.defineProperty(t,"__esModule",{value:!0}),t.NullTelemetryService=new class{publicLog(e,t){return Promise.resolve(void 0)}getTelemetryInfo(){return Promise.resolve({instanceId:"someValue.instanceId",sessionId:"someValue.sessionId",
machineId:"someValue.machineId"})}},t.combinedAppender=function(...e){return{log:(t,n)=>e.forEach(e=>e.log(t,n)),dispose:()=>Promise.all(e.map(e=>e.dispose()))}},t.NullAppender={log:()=>null,dispose:()=>Promise.resolve(null)};let u=class{constructor(e){this._logService=e,this.commonPropertiesRegex=/^sessionID$|^version$|^timestamp$|^commitHash$|^common\./}dispose(){return Promise.resolve(void 0)}log(e,t){const n={};Object.keys(t).forEach(e=>{this.commonPropertiesRegex.test(e)||(n[e]=t[e])}),this._logService.trace(`telemetry/${e}`,n)}};u=i([r(0,a.ILogService)],u),t.LogAppender=u,t.telemetryURIDescriptor=function(e,t){const i=e&&e.fsPath;return i?{mimeType:n.guessMimeTypes(i).join(", "),scheme:e.scheme,ext:s.extname(i),path:t(i)}:{}}
;const d=["editor.fontFamily","editor.fontWeight","editor.fontSize","editor.lineHeight","editor.letterSpacing","editor.lineNumbers","editor.rulers","editor.wordSeparators","editor.tabSize","editor.indentSize","editor.insertSpaces","editor.detectIndentation","editor.roundedSelection","editor.scrollBeyondLastLine","editor.minimap.enabled","editor.minimap.side","editor.minimap.renderCharacters","editor.minimap.maxColumn","editor.find.seedSearchStringFromSelection","editor.find.autoFindInSelection","editor.wordWrap","editor.wordWrapColumn","editor.wrappingIndent","editor.mouseWheelScrollSensitivity","editor.multiCursorModifier","editor.quickSuggestions","editor.quickSuggestionsDelay","editor.parameterHints.enabled","editor.parameterHints.cycle","editor.autoClosingBrackets","editor.autoClosingQuotes","editor.autoSurround","editor.autoIndent","editor.formatOnType","editor.formatOnPaste","editor.suggestOnTriggerCharacters","editor.acceptSuggestionOnEnter","editor.acceptSuggestionOnCommitCharacter","editor.snippetSuggestions","editor.emptySelectionClipboard","editor.wordBasedSuggestions","editor.suggestSelection","editor.suggestFontSize","editor.suggestLineHeight","editor.tabCompletion","editor.selectionHighlight","editor.occurrencesHighlight","editor.overviewRulerLanes","editor.overviewRulerBorder","editor.cursorBlinking","editor.cursorSmoothCaretAnimation","editor.cursorStyle","editor.mouseWheelZoom","editor.fontLigatures","editor.hideCursorInOverviewRuler","editor.renderWhitespace","editor.renderControlCharacters","editor.renderIndentGuides","editor.renderLineHighlight","editor.codeLens","editor.folding","editor.showFoldingControls","editor.matchBrackets","editor.glyphMargin","editor.useTabStops","editor.trimAutoWhitespace","editor.stablePeek","editor.dragAndDrop","editor.formatOnSave","editor.colorDecorators","breadcrumbs.enabled","breadcrumbs.filePath","breadcrumbs.symbolPath","breadcrumbs.symbolSortOrder","breadcrumbs.useQuickPick","explorer.openEditors.visible","extensions.autoUpdate","files.associations","files.autoGuessEncoding","files.autoSave","files.autoSaveDelay","files.encoding","files.eol","files.hotExit","files.trimTrailingWhitespace","git.confirmSync","git.enabled","http.proxyStrictSSL","javascript.validate.enable","php.builtInCompletions.enable","php.validate.enable","php.validate.run","terminal.integrated.fontFamily","window.openFilesInNewWindow","window.restoreWindows","window.zoomLevel","workbench.editor.enablePreview","workbench.editor.enablePreviewFromQuickOpen","workbench.editor.showTabs","workbench.editor.highlightModifiedTabs","workbench.editor.swipeToNavigate","workbench.sideBar.location","workbench.startupEditor","workbench.statusBar.visible","workbench.welcome.enabled"]
;t.configurationTelemetry=l,t.keybindingsTelemetry=function(e,t){return t.onDidUpdateKeybindings(t=>{2===t.source&&t.keybindings&&e.publicLog("updateKeybindings",{bindings:t.keybindings.map(e=>({key:e.key,command:e.command,when:e.when,args:!!e.args||void 0}))})})}}),define(e[80],t([1,0,89,4,5,9]),function(e,t,n,s,o,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});let l=class e{constructor(e,t,i,r){this._eventPrefix=e,this._defaultData=t,this._logService=r,this._defaultData||(this._defaultData=Object.create(null)),"string"==typeof i?this._aiClient=function(e){let t;return n.defaultClient?(t=new n.TelemetryClient(e)).channel.setUseDiskRetryCaching(!0):(n.setup(e).setAutoCollectRequests(!1).setAutoCollectPerformance(!1).setAutoCollectExceptions(!1).setAutoCollectDependencies(!1).setAutoDependencyCorrelation(!1).setAutoCollectConsole(!1).setInternalLogging(!1,!1).setUseDiskRetryCaching(!0).start(),t=n.defaultClient),
0===e.indexOf("AIF-")&&(t.config.endpointUrl="https://vortex.data.microsoft.com/collect/v1"),t}(i):"function"==typeof i&&(this._aiClient=i())}static _getData(t){const n=Object.create(null),i=Object.create(null),r=Object.create(null);e._flaten(t,r);for(let e in r){const t=r[e=e.length>150?e.substr(e.length-149):e];"number"==typeof t?i[e]=t:"boolean"==typeof t?i[e]=t?1:0:"string"==typeof t?n[e]=t.substring(0,1023):void 0!==t&&null!==t&&(n[e]=t)}return{properties:n,measurements:i}}static _flaten(t,n,i=0,r){if(t)for(let a of Object.getOwnPropertyNames(t)){const l=t[a],c=r?r+a:a;Array.isArray(l)?n[c]=o.safeStringify(l):l instanceof Date?n[c]=l.toISOString():s.isObject(l)?i<2?e._flaten(l,n,i+1,c+"."):n[c]=o.safeStringify(l):n[c]=l}}log(t,n){this._aiClient&&(n=o.mixin(n,this._defaultData),n=e._getData(n),this._logService&&this._logService.trace(`telemetry/${t}`,n),this._aiClient.trackEvent({name:this._eventPrefix+"/"+t,properties:n.properties,measurements:n.measurements}))}dispose(){
if(this._aiClient)return new Promise(e=>{this._aiClient.flush({callback:()=>{this._aiClient=void 0,e(void 0)}})})}};l=i([r(3,a.ILogService)],l),t.AppInsightsAppender=l}),define(e[82],t([1,0,15,24,43,10]),function(e,t,n,i,r,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.resolveCommonProperties=function(e,t,o,a){const l=Object.create(null);l["common.machineId"]=o,l.sessionID=r.generateUuid()+Date.now(),l.commitHash=e,l.version=t,l["common.platformVersion"]=(i.release()||"").replace(/^(\d+)(\.\d+)?(\.\d+)?(.*)/,"$1$2$3"),l["common.platform"]=n.PlatformToString(n.platform),l["common.nodePlatform"]=process.platform,l["common.nodeArch"]=process.arch;let c=0;const u=Date.now();return Object.defineProperties(l,{timestamp:{get:()=>new Date,enumerable:!0},"common.timesincesessionstart":{get:()=>Date.now()-u,enumerable:!0},"common.sequence":{get:()=>c++,enumerable:!0}}),s.readFile(a,"utf8").then(e=>(l["common.source"]=e.slice(0,30),l),e=>l)}}),
define(e[44],t([1,0,60,2,23,27,10,88,87,8]),function(e,t,n,i,r,s,o,a,l,c){"use strict";function u(e,t,a,l){let u=s.createCancelablePromise(()=>Promise.resolve()),d=0;return c.Event.once(l.onCancellationRequested)(()=>{u.cancel(),e.close()}),new Promise((h,g)=>{const p=new s.Sequencer,m=t=>{t.isCancellationRequested||(d++,e.readEntry())};e.once("error",g),e.once("close",()=>u.then(()=>{l.isCancellationRequested||e.entryCount===d?h():g(new f("Incomplete",new Error(n.localize(1,null,d,e.entryCount))))},g)),e.readEntry(),e.on("entry",d=>{if(l.isCancellationRequested)return;if(!a.sourcePathRegex.test(d.fileName))return void m(l);const h=d.fileName.replace(a.sourcePathRegex,"");if(/\/$/.test(h)){const e=i.join(t,h);return void(u=s.createCancelablePromise(t=>o.mkdirp(e,void 0,t).then(()=>m(t)).then(void 0,g)))}const f=s.ninvoke(e,e.openReadStream,d),v=function(e){let t=e.externalFileAttributes>>16||33188;return[448,56,7].map(e=>t&e).reduce((e,t)=>e+t,61440&t)}(d)
;u=s.createCancelablePromise(e=>p.queue(()=>f.then(s=>(function(e,t,s,a,l,u){const d=i.dirname(t),h=i.join(a,d);if(0!==h.indexOf(a))return Promise.reject(new Error(n.localize(0,null,t)));const f=i.join(a,t);let g;return c.Event.once(u.onCancellationRequested)(()=>{g&&g.destroy()}),Promise.resolve(o.mkdirp(h,void 0,u)).then(()=>new Promise((t,n)=>{if(!u.isCancellationRequested)try{(g=r.createWriteStream(f,{mode:s})).once("close",()=>t()),g.once("error",n),e.once("error",n),e.pipe(g)}catch(e){n(e)}}))})(s,h,v,t,0,e).then(()=>m(e)))).then(null,g))})})}function d(e,t=!1){return s.nfcall(a.open,e,t?{lazyEntries:!0}:void 0).then(void 0,e=>Promise.reject(function(e){if(e instanceof f)return e;let t=void 0;return/end of central directory record signature not found/.test(e.message)&&(t="CorruptZip"),new f(t,e)}(e)))}function h(e,t){return function(e,t){return d(e).then(e=>new Promise((i,r)=>{e.on("entry",n=>{n.fileName===t&&s.ninvoke(e,e.openReadStream,n).then(e=>i(e),e=>r(e))}),
e.once("close",()=>r(new Error(n.localize(2,null,t))))}))}(e,t).then(e=>new Promise((t,n)=>{const i=[];e.once("error",n),e.on("data",e=>i.push(e)),e.on("end",()=>t(Buffer.concat(i)))}))}Object.defineProperty(t,"__esModule",{value:!0});class f extends Error{constructor(e,t){let n=t.message;switch(e){case"CorruptZip":n=`Corrupt ZIP: ${n}`}super(n),this.type=e,this.cause=t}}t.ExtractError=f,t.zip=function(e,t){return new Promise((n,i)=>{const s=new l.ZipFile;t.forEach(e=>{e.contents?s.addBuffer("string"==typeof e.contents?Buffer.from(e.contents,"utf8"):e.contents,e.path):e.localPath&&s.addFile(e.localPath,e.path)}),s.end();const o=r.createWriteStream(e);s.outputStream.pipe(o),s.outputStream.once("error",i),o.once("error",i),o.once("finish",()=>n(e))})},t.extract=function(e,t,n={},i){const r=new RegExp(n.sourcePath?`^${n.sourcePath}`:"");let s=d(e,!0);return n.overwrite&&(s=s.then(e=>o.rimraf(t).then(()=>e))),s.then(e=>u(e,t,{sourcePathRegex:r},i))},t.buffer=h}),define(e[45],t([1,0,44,65]),function(e,t,n,i){
"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getManifest=function(e){return n.buffer(e,"extension/package.json").then(e=>{try{return JSON.parse(e.toString("utf8"))}catch(e){throw new Error(i.localize(0,null))}})}}),define(e[85],t([1,0,64,2,10,5,11,17,44,26,19,74,16,27,8,81,20,22,15,9,47,77,35,28,31,24,43,50,3,32,33,37,45,29,12,36]),function(e,t,s,o,a,l,c,u,d,h,f,g,p,m,v,y,E,S,x,C,b,_,P,w,I,k,O,D,T,j,L,M,A,R,U,N){"use strict";function F(e){return new Promise((t,n)=>{try{const i=JSON.parse(e),r=i.__metadata||null;delete i.__metadata,t({manifest:i,metadata:r})}catch(e){n(new Error(s.localize(0,null)))}})}Object.defineProperty(t,"__esModule",{value:!0});class z extends Error{constructor(e,t){super(e),this.code=t}}t.ExtensionManagementError=z;let $=class extends c.Disposable{constructor(e,t,n,i,r,s,a){super(),this.remote=e,this.environmentService=t,this.configurationService=n,this.galleryService=i,this.logService=r,this.downloadService=s,this.telemetryService=a,this.lastReportTimestamp=0,
this.installingExtensions=new Map,this.uninstallingExtensions=new Map,this._onInstallExtension=new v.Emitter,this.onInstallExtension=this._onInstallExtension.event,this._onDidInstallExtension=new v.Emitter,this.onDidInstallExtension=this._onDidInstallExtension.event,this._onUninstallExtension=new v.Emitter,this.onUninstallExtension=this._onUninstallExtension.event,this._onDidUninstallExtension=new v.Emitter,this.onDidUninstallExtension=this._onDidUninstallExtension.event,this._devSystemExtensionsPath=null,this._devSystemExtensionsFilePath=null,this.systemExtensionsPath=t.builtinExtensionsPath,this.extensionsPath=t.extensionsPath,this.uninstalledPath=o.join(this.extensionsPath,".obsolete"),this.uninstalledFileLimiter=new m.Queue,this.manifestCache=this._register(new b.ExtensionsManifestCache(t,this)),this.extensionLifecycle=this._register(new _.ExtensionsLifecycle(t,this.logService)),this._register(c.toDisposable(()=>{this.installingExtensions.forEach(e=>e.cancel()),
this.uninstallingExtensions.forEach(e=>e.cancel()),this.installingExtensions.clear(),this.uninstallingExtensions.clear()}))}zip(e){return this.logService.trace("ExtensionManagementService#zip",e.identifier.id),this.collectFiles(e).then(e=>d.zip(o.join(k.tmpdir(),O.generateUuid()),e)).then(e=>E.URI.file(e))}unzip(e,t){return this.logService.trace("ExtensionManagementService#unzip",e.toString()),this.install(e,t)}collectFiles(e){const t=e=>n(this,void 0,void 0,function*(){let n=yield a.readdir(e);n=n.map(t=>o.join(e,t));const i=yield Promise.all(n.map(e=>a.stat(e)));let r=Promise.resolve([]);return i.forEach((e,i)=>{const s=n[i];e.isFile()&&(r=r.then(e=>[...e,s])),e.isDirectory()&&(r=r.then(e=>t(s).then(t=>[...e,...t])))}),r});return t(e.location.fsPath).then(t=>t.map(t=>({path:`extension/${o.relative(e.location.fsPath,t)}`,localPath:t})))}install(e,t=1){return this.logService.trace("ExtensionManagementService#install",e.toString()),m.createCancelablePromise(n=>this.downloadVsix(e).then(e=>{
const i=o.resolve(e.fsPath);return A.getManifest(i).then(e=>{const r={id:f.getGalleryExtensionId(e.publisher,e.name)};let o=1;if(e.engines&&e.engines.vscode&&!I.isEngineValid(e.engines.vscode))return Promise.reject(new Error(s.localize(1,null,r.id,S.default.version)));const a=new R.ExtensionIdentifierWithVersion(r,e.version);return this.getInstalled(1).then(t=>{const n=t.filter(e=>f.areSameExtensions(r,e.identifier))[0];if(n){if(o=2,a.equals(new R.ExtensionIdentifierWithVersion(n.identifier,n.manifest.version)))return this.removeExtension(n,"existing").then(null,t=>Promise.reject(new Error(s.localize(2,null,e.displayName||e.name))));if(y.gt(n.manifest.version,e.version))return this.uninstall(n,!0)}}).then(()=>(this.logService.info("Installing the extension:",r.id),this._onInstallExtension.fire({identifier:r,zipPath:i}),
this.getMetadata(f.getGalleryExtensionId(e.publisher,e.name)).then(e=>this.installFromZipPath(a,i,e,t,o,n),()=>this.installFromZipPath(a,i,null,t,o,n)).then(()=>(this.logService.info("Successfully installed the extension:",r.id),r),e=>(this.logService.error("Failed to install the extension:",r.id,e.message),Promise.reject(e)))))})}))}downloadVsix(e){if(e.scheme===j.Schemas.file)return Promise.resolve(e);if(!this.downloadService)throw new Error("Download service is not available");const t=o.join(k.tmpdir(),O.generateUuid());return this.downloadService.download(e,t).then(()=>E.URI.file(t))}installFromZipPath(e,t,n,i,r,s){return this.toNonCancellablePromise(this.installExtension({zipPath:t,identifierWithVersion:e,metadata:n},i,s).then(e=>this.installDependenciesAndPackExtensions(e,null).then(()=>e,t=>this.uninstall(e,!0).then(()=>Promise.reject(t),()=>Promise.reject(t)))).then(n=>(this._onDidInstallExtension.fire({identifier:e.identifier,zipPath:t,local:n,operation:r}),n),n=>(this._onDidInstallExtension.fire({
identifier:e.identifier,zipPath:t,operation:r,error:n}),Promise.reject(n))))}installFromGallery(e){return n(this,void 0,void 0,function*(){const t=(new Date).getTime();this.logService.info("Installing extension:",e.identifier.id),this._onInstallExtension.fire({identifier:e.identifier,gallery:e});const n=(e,n,i)=>{const r=i&&i.code?i.code:"unknown";this.logService.error("Failed to install extension:",e.identifier.id,i?i.message:r),this._onDidInstallExtension.fire({identifier:e.identifier,gallery:e,operation:n,error:r}),this.reportTelemetry(this.getTelemetryEvent(n),f.getGalleryExtensionTelemetryData(e),(new Date).getTime()-t,i),i instanceof Error&&(i.name=r)};try{e=yield this.checkAndGetCompatibleVersion(e)}catch(t){return n(e,1,t),Promise.reject(t)}const i=new R.ExtensionIdentifierWithVersion(e.identifier,e.version).key();let r=this.installingExtensions.get(i);if(!r){let s,o,l,c=1;r=m.createCancelablePromise(e=>(s=e,new Promise((e,t)=>{o=e,l=t}))),this.installingExtensions.set(i,r);try{
const r=(yield this.getInstalled(1)).filter(t=>f.areSameExtensions(t.identifier,e.identifier))[0];r&&(c=2,y.gt(r.manifest.version,e.version)&&(yield this.uninstall(r,!0))),this.downloadInstallableExtension(e,c).then(e=>this.installExtension(e,1,s).then(t=>a.rimraf(e.zipPath).finally(()=>null).then(()=>t))).then(e=>this.installDependenciesAndPackExtensions(e,r).then(()=>e,t=>this.uninstall(e,!0).then(()=>Promise.reject(t),()=>Promise.reject(t)))).then(n=>{this.installingExtensions.delete(i),((e,n,i)=>{this.logService.info("Extensions installed successfully:",e.identifier.id),this._onDidInstallExtension.fire({identifier:e.identifier,gallery:e,local:i,operation:n}),this.reportTelemetry(this.getTelemetryEvent(n),f.getGalleryExtensionTelemetryData(e),(new Date).getTime()-t,void 0)})(e,c,n),o(null)},t=>{this.installingExtensions.delete(i),n(e,c,t),l(t)})}catch(t){return this.installingExtensions.delete(i),n(e,c,t),Promise.reject(t)}}return r})}checkAndGetCompatibleVersion(e){return n(this,void 0,void 0,function*(){
if(yield this.isMalicious(e))return Promise.reject(new z(s.localize(3,null),h.INSTALL_ERROR_MALICIOUS));const t=yield this.galleryService.getCompatibleExtension(e);if(!t)return Promise.reject(new z(s.localize(4,null,e.identifier.id,S.default.version),h.INSTALL_ERROR_INCOMPATIBLE));if(this.remote){const t=yield this.galleryService.getManifest(e,L.CancellationToken.None);if(t&&N.isUIExtension(t,this.configurationService)&&!R.isLanguagePackExtension(t))return Promise.reject(new Error(s.localize(5,null,e.identifier.id)))}return t})}reinstallFromGallery(e){return this.logService.trace("ExtensionManagementService#reinstallFromGallery",e.identifier.id),this.galleryService.isEnabled()?this.findGalleryExtension(e).then(t=>t?this.setUninstalled(e).then(()=>this.removeUninstalledExtension(e).then(()=>this.installFromGallery(t),e=>Promise.reject(new Error(s.localize(7,null,P.toErrorMessage(e)))))):Promise.reject(new Error(s.localize(8,null)))):Promise.reject(new Error(s.localize(6,null)))}getTelemetryEvent(e){
return 2===e?"extensionGallery:update":"extensionGallery:install"}isMalicious(e){return this.getExtensionsReport().then(t=>f.getMaliciousExtensionsSet(t).has(e.identifier.id))}downloadInstallableExtension(e,t){const n={id:e.identifier.uuid,publisherId:e.publisherId,publisherDisplayName:e.publisherDisplayName};return this.logService.trace("Started downloading extension:",e.identifier.id),this.galleryService.download(e,t).then(t=>(this.logService.info("Downloaded extension:",e.identifier.id,t),A.getManifest(t).then(i=>({zipPath:t,identifierWithVersion:new R.ExtensionIdentifierWithVersion(e.identifier,i.version),metadata:n}),e=>Promise.reject(new z(this.joinErrors(e).message,"validating")))),e=>Promise.reject(new z(this.joinErrors(e).message,"downloading")))}installExtension(e,t,n){
return this.unsetUninstalledAndGetLocal(e.identifierWithVersion).then(i=>i||this.extractAndInstall(e,t,n),e=>x.isMacintosh?Promise.reject(new z(s.localize(9,null),"unsetUninstalled")):Promise.reject(new z(s.localize(10,null),"unsetUninstalled")))}unsetUninstalledAndGetLocal(e){return this.isUninstalled(e).then(t=>t?(this.logService.trace("Removing the extension from uninstalled list:",e.identifier.id),this.unsetUninstalled(e).then(()=>(this.logService.info("Removed the extension from uninstalled list:",e.identifier.id),this.getInstalled(1))).then(t=>t.filter(t=>new R.ExtensionIdentifierWithVersion(t.identifier,t.manifest.version).equals(e))[0])):null)}extractAndInstall({zipPath:e,identifierWithVersion:t,metadata:n},i,r){const{identifier:l}=t,c=1===i?this.extensionsPath:this.systemExtensionsPath,u=t.key(),d=o.join(c,`.${u}`),h=o.join(c,u)
;return a.rimraf(h).then(()=>this.extractAndRename(l,e,d,h,r),e=>Promise.reject(new z(s.localize(11,null,h,l.id),"deleting"))).then(()=>this.scanExtension(u,c,i)).then(e=>e?(this.logService.info("Installation completed.",l.id),n?(e.metadata=n,this.saveMetadataForLocalExtension(e)):e):Promise.reject(s.localize(12,null,c)),e=>a.rimraf(h).then(()=>Promise.reject(e),()=>Promise.reject(e)))}extractAndRename(e,t,n,i,r){return this.extract(e,t,n,r).then(()=>this.rename(e,n,i,Date.now()+12e4).then(()=>this.logService.info("Renamed to",i),e=>(this.logService.info("Rename failed. Deleting from extracted location",n),a.rimraf(n).finally(()=>null).then(()=>Promise.reject(e)))))}extract(e,t,n,i){return this.logService.trace(`Started extracting the extension from ${t} to ${n}`),a.rimraf(n).then(()=>d.extract(t,n,{sourcePath:"extension",overwrite:!0
},i).then(()=>this.logService.info(`Extracted extension to ${n}:`,e.id),e=>a.rimraf(n).finally(()=>null).then(()=>Promise.reject(new z(e.message,e instanceof d.ExtractError&&e.type?e.type:"extracting")))),e=>Promise.reject(new z(this.joinErrors(e).message,"deleting")))}rename(e,t,n,i){return a.rename(t,n).then(void 0,r=>x.isWindows&&r&&"EPERM"===r.code&&Date.now()<i?(this.logService.info(`Failed renaming ${t} to ${n} with 'EPERM' error. Trying again...`,e.id),this.rename(e,t,n,i)):Promise.reject(new z(r.message||s.localize(13,null,t,n),r.code||"renaming")))}installDependenciesAndPackExtensions(e,t){return n(this,void 0,void 0,function*(){if(this.galleryService.isEnabled()){const i=e.manifest.extensionDependencies||[];if(e.manifest.extensionPack)for(const n of e.manifest.extensionPack)t&&t.manifest.extensionPack&&t.manifest.extensionPack.some(e=>f.areSameExtensions({id:e},{id:n}))||i.every(e=>!f.areSameExtensions({id:e},{id:n}))&&i.push(n);if(i.length)return this.getInstalled().then(e=>{
const t=i.filter(t=>e.every(({identifier:e})=>!f.areSameExtensions(e,{id:t})));return t.length?this.galleryService.query({names:t,pageSize:i.length}).then(e=>{const t=e.firstPage;return Promise.all(t.map(e=>n(this,void 0,void 0,function*(){if(this.remote){const t=yield this.galleryService.getManifest(e,L.CancellationToken.None);if(t&&N.isUIExtension(t,this.configurationService)&&!R.isLanguagePackExtension(t))return void this.logService.info("Ignored installing the UI dependency",e.identifier.id)}return this.installFromGallery(e)}))).then(()=>null,e=>this.rollback(t).then(()=>Promise.reject(e),()=>Promise.reject(e)))}):null})}return Promise.resolve(void 0)})}rollback(e){return this.getInstalled(1).then(t=>Promise.all(t.filter(t=>e.some(e=>new R.ExtensionIdentifierWithVersion(t.identifier,t.manifest.version).equals(new R.ExtensionIdentifierWithVersion(e.identifier,e.version)))).map(e=>this.uninstall(e,!0)))).then(()=>void 0,()=>void 0)}uninstall(e,t=!1){
return this.logService.trace("ExtensionManagementService#uninstall",e.identifier.id),this.toNonCancellablePromise(this.getInstalled(1).then(t=>{const n=t.filter(t=>f.areSameExtensions(t.identifier,e.identifier))[0];return n?this.checkForDependenciesAndUninstall(n,t).then(()=>null,e=>Promise.reject(this.joinErrors(e))):Promise.reject(new Error(s.localize(14,null,e.manifest.displayName||e.manifest.name)))}))}updateMetadata(e,t){return this.logService.trace("ExtensionManagementService#updateMetadata",e.identifier.id),e.metadata=t,this.saveMetadataForLocalExtension(e).then(e=>(this.manifestCache.invalidate(),e))}saveMetadataForLocalExtension(e){if(!e.metadata)return Promise.resolve(e);const t=o.join(e.location.fsPath,"package.json");return a.readFile(t,"utf8").then(e=>F(e)).then(({manifest:t})=>l.assign(t,{__metadata:e.metadata})).then(e=>a.writeFile(t,JSON.stringify(e,null,"\t"))).then(()=>e)}getMetadata(e){return this.findGalleryExtensionByName(e).then(e=>e?{id:e.identifier.uuid,
publisherDisplayName:e.publisherDisplayName,publisherId:e.publisherId}:null)}findGalleryExtension(e){return e.identifier.uuid?this.findGalleryExtensionById(e.identifier.uuid).then(t=>t||this.findGalleryExtensionByName(e.identifier.id)):this.findGalleryExtensionByName(e.identifier.id)}findGalleryExtensionById(e){return this.galleryService.query({ids:[e],pageSize:1}).then(e=>e.firstPage[0])}findGalleryExtensionByName(e){return this.galleryService.query({names:[e],pageSize:1}).then(e=>e.firstPage[0])}joinErrors(e){const t=Array.isArray(e)?e:[e];return 1===t.length?t[0]instanceof Error?t[0]:new Error(t[0]):t.reduce((e,t)=>new Error(`${e.message}${e.message?",":""}${t instanceof Error?t.message:t}`),new Error(""))}checkForDependenciesAndUninstall(e,t){return this.preUninstallExtension(e).then(()=>{const n=this.getAllPackExtensionsToUninstall(e,t);return n.length?this.uninstallExtensions(e,n,t):this.uninstallExtensions(e,[],t)
}).then(()=>this.postUninstallExtension(e),t=>(this.postUninstallExtension(e,new z(t instanceof Error?t.message:t,"local")),Promise.reject(t)))}uninstallExtensions(e,t,n){const i=this.getDependents(e,n);if(i.length){const n=i.filter(n=>e!==n&&-1===t.indexOf(n));if(n.length)return Promise.reject(new Error(this.getDependentsErrorMessage(e,n)))}return Promise.all([this.uninstallExtension(e),...t.map(e=>this.doUninstall(e))]).then(()=>void 0)}getDependentsErrorMessage(e,t){return 1===t.length?s.localize(15,null,e.manifest.displayName||e.manifest.name,t[0].manifest.displayName||t[0].manifest.name):2===t.length?s.localize(16,null,e.manifest.displayName||e.manifest.name,t[0].manifest.displayName||t[0].manifest.name,t[1].manifest.displayName||t[1].manifest.name):s.localize(17,null,e.manifest.displayName||e.manifest.name,t[0].manifest.displayName||t[0].manifest.name,t[1].manifest.displayName||t[1].manifest.name)}getAllPackExtensionsToUninstall(e,t,n=[]){if(-1!==n.indexOf(e))return[];n.push(e)
;const i=e.manifest.extensionPack?e.manifest.extensionPack:[];if(i.length){const e=t.filter(e=>i.some(t=>f.areSameExtensions({id:t},e.identifier))),r=[];for(const i of e)r.push(...this.getAllPackExtensionsToUninstall(i,t,n));return[...e,...r]}return[]}getDependents(e,t){return t.filter(t=>t.manifest.extensionDependencies&&t.manifest.extensionDependencies.some(t=>f.areSameExtensions({id:t},e.identifier)))}doUninstall(e){return this.preUninstallExtension(e).then(()=>this.uninstallExtension(e)).then(()=>this.postUninstallExtension(e),t=>(this.postUninstallExtension(e,new z(t instanceof Error?t.message:t,"local")),Promise.reject(t)))}preUninstallExtension(e){return Promise.resolve(a.exists(e.location.fsPath)).then(e=>e?null:Promise.reject(new Error(s.localize(18,null)))).then(()=>{this.logService.info("Uninstalling extension:",e.identifier.id),this._onUninstallExtension.fire(e.identifier)})}uninstallExtension(e){let t=this.uninstallingExtensions.get(e.identifier.id)
;return t||(t=m.createCancelablePromise(t=>this.scanUserExtensions(!1).then(t=>this.setUninstalled(...t.filter(t=>f.areSameExtensions(t.identifier,e.identifier)))).then(()=>{this.uninstallingExtensions.delete(e.identifier.id)})),this.uninstallingExtensions.set(e.identifier.id,t)),t}postUninstallExtension(e,t){return n(this,void 0,void 0,function*(){t?this.logService.error("Failed to uninstall extension:",e.identifier.id,t.message):(this.logService.info("Successfully uninstalled extension:",e.identifier.id),e.identifier.uuid&&(yield this.galleryService.reportStatistic(e.manifest.publisher,e.manifest.name,e.manifest.version,"uninstall"))),this.reportTelemetry("extensionGallery:uninstall",f.getLocalExtensionTelemetryData(e),void 0,t);const n=t?t instanceof z?t.code:"unknown":void 0;this._onDidUninstallExtension.fire({identifier:e.identifier,error:n})})}getInstalled(e=null){const t=[]
;return null!==e&&0!==e||t.push(this.scanSystemExtensions().then(null,e=>Promise.reject(new z(this.joinErrors(e).message,"scanningSystem")))),null!==e&&1!==e||t.push(this.scanUserExtensions(!0).then(null,e=>Promise.reject(new z(this.joinErrors(e).message,"scanningUser")))),Promise.all(t).then(u.flatten,e=>Promise.reject(this.joinErrors(e)))}scanSystemExtensions(){this.logService.trace("Started scanning system extensions");const e=this.scanExtensions(this.systemExtensionsPath,0).then(e=>(this.logService.info("Scanned system extensions:",e.length),e));if(this.environmentService.isBuilt)return e;const t=this.getDevSystemExtensionsList().then(e=>e.length?this.scanExtensions(this.devSystemExtensionsPath,0).then(t=>(this.logService.info("Scanned dev system extensions:",t.length),t.filter(t=>e.some(e=>f.areSameExtensions(t.identifier,{id:e}))))):[]);return Promise.all([e,t]).then(([e,t])=>[...e,...t])}scanUserExtensions(e){return this.logService.trace("Started scanning user extensions"),
Promise.all([this.getUninstalledExtensions(),this.scanExtensions(this.extensionsPath,1)]).then(([t,n])=>{if(n=n.filter(e=>!t[new R.ExtensionIdentifierWithVersion(e.identifier,e.manifest.version).key()]),e){n=f.groupByExtension(n,e=>e.identifier).map(e=>e.sort((e,t)=>y.rcompare(e.manifest.version,t.manifest.version))[0])}return this.logService.info("Scanned user extensions:",n.length),n})}scanExtensions(e,t){const n=new m.Limiter(10);return a.readdir(e).then(i=>Promise.all(i.map(i=>n.queue(()=>this.scanExtension(i,e,t))))).then(e=>e.filter(e=>e&&e.identifier))}scanExtension(e,t,n){if(1===n&&0===e.indexOf("."))return Promise.resolve(null);const i=o.join(t,e);return a.readdir(i).then(e=>(function(e){const t=[a.readFile(o.join(e,"package.json"),"utf8").then(e=>F(e)),a.readFile(o.join(e,"package.nls.json"),"utf8").then(void 0,e=>"ENOENT"!==e.code?Promise.reject(e):"{}").then(e=>JSON.parse(e))];return Promise.all(t).then(([{manifest:e,metadata:t},n])=>({manifest:g.localizeManifest(e,n),metadata:t}))
})(i).then(({manifest:t,metadata:r})=>{const s=e.filter(e=>/^readme(\.txt|\.md|)$/i.test(e))[0],a=s?E.URI.file(o.join(i,s)):null,l=e.filter(e=>/^changelog(\.txt|\.md|)$/i.test(e))[0],c=l?E.URI.file(o.join(i,l)):null,u={id:f.getGalleryExtensionId(t.publisher,t.name),uuid:r?r.id:null};return{type:n,identifier:u,manifest:t,metadata:r,location:E.URI.file(i),readmeUrl:a,changelogUrl:c}})).then(void 0,()=>null)}removeDeprecatedExtensions(){return this.removeUninstalledExtensions().then(()=>this.removeOutdatedExtensions())}removeUninstalledExtensions(){return this.getUninstalledExtensions().then(e=>this.scanExtensions(this.extensionsPath,1).then(t=>{const n=t.filter(t=>e[new R.ExtensionIdentifierWithVersion(t.identifier,t.manifest.version).key()]);return Promise.all(n.map(e=>this.extensionLifecycle.postUninstall(e).then(()=>this.removeUninstalledExtension(e))))})).then(()=>void 0)}removeOutdatedExtensions(){return this.scanExtensions(this.extensionsPath,1).then(e=>{const t=[],n=f.groupByExtension(e,e=>e.identifier)
;return t.push(...u.flatten(n.map(e=>e.sort((e,t)=>y.rcompare(e.manifest.version,t.manifest.version)).slice(1)))),Promise.all(t.map(e=>this.removeExtension(e,"outdated")))}).then(()=>void 0)}removeUninstalledExtension(e){return this.removeExtension(e,"uninstalled").then(()=>this.withUninstalledExtensions(t=>delete t[new R.ExtensionIdentifierWithVersion(e.identifier,e.manifest.version).key()])).then(()=>void 0)}removeExtension(e,t){return this.logService.trace(`Deleting ${t} extension from disk`,e.identifier.id,e.location.fsPath),a.rimraf(e.location.fsPath).then(()=>this.logService.info("Deleted from disk",e.identifier.id,e.location.fsPath))}isUninstalled(e){return this.filterUninstalled(e).then(e=>1===e.length)}filterUninstalled(...e){return this.withUninstalledExtensions(t=>{const n=[];for(const i of e)t[i.key()]&&n.push(i.key());return n})}setUninstalled(...e){const t=e.map(e=>new R.ExtensionIdentifierWithVersion(e.identifier,e.manifest.version))
;return this.withUninstalledExtensions(e=>l.assign(e,t.reduce((e,t)=>(e[t.key()]=!0,e),{})))}unsetUninstalled(e){return this.withUninstalledExtensions(t=>delete t[e.key()])}getUninstalledExtensions(){return this.withUninstalledExtensions(e=>e)}withUninstalledExtensions(e){return n(this,void 0,void 0,function*(){return yield this.uninstalledFileLimiter.queue(()=>{let t=null;return a.readFile(this.uninstalledPath,"utf8").then(void 0,e=>"ENOENT"===e.code?Promise.resolve("{}"):Promise.reject(e)).then(e=>{try{return JSON.parse(e)}catch(e){return{}}}).then(n=>(t=e(n),n)).then(e=>{if(0===Object.keys(e).length)return a.rimraf(this.uninstalledPath);{const t=JSON.stringify(e);return a.writeFile(this.uninstalledPath,t)}}).then(()=>t)})})}getExtensionsReport(){const e=(new Date).getTime();return(!this.reportedExtensions||e-this.lastReportTimestamp>3e5)&&(this.reportedExtensions=this.updateReportCache(),this.lastReportTimestamp=e),this.reportedExtensions}updateReportCache(){
return this.logService.trace("ExtensionManagementService.refreshReportedCache"),this.galleryService.getExtensionsReport().then(e=>(this.logService.trace(`ExtensionManagementService.refreshReportedCache - got ${e.length} reported extensions from service`),e),e=>(this.logService.trace("ExtensionManagementService.refreshReportedCache - failed to get extension report"),[]))}get devSystemExtensionsPath(){return this._devSystemExtensionsPath||(this._devSystemExtensionsPath=o.normalize(o.join(M.getPathFromAmdModule(e,""),"..",".build","builtInExtensions"))),this._devSystemExtensionsPath}get devSystemExtensionsFilePath(){return this._devSystemExtensionsFilePath||(this._devSystemExtensionsFilePath=o.normalize(o.join(M.getPathFromAmdModule(e,""),"..","build","builtInExtensions.json"))),this._devSystemExtensionsFilePath}getDevSystemExtensionsList(){return a.readFile(this.devSystemExtensionsFilePath,"utf8").then(e=>{return JSON.parse(e).map(({name:e})=>e)})}toNonCancellablePromise(e){
return new Promise((t,n)=>e.then(e=>t(e),e=>n(e)))}reportTelemetry(e,t,n,i){const r=i?i instanceof z?i.code:"unknown":void 0;this.telemetryService.publicLog(e,l.assign(t,{success:!i,duration:n,errorcode:r}))}};$=i([r(1,p.IEnvironmentService),r(2,U.IConfigurationService),r(3,h.IExtensionGalleryService),r(4,C.ILogService),r(5,T.optional(D.IDownloadService)),r(6,w.ITelemetryService)],$),t.ExtensionManagementService=$}),define(e[38],t([1,0,4,83,23,5,92,21]),function(e,t,i,r,s,o,a,l){"use strict";function c(t,s){let u;return(t.getRawRequest?Promise.resolve(t.getRawRequest(t)):Promise.resolve(function(t){return n(this,void 0,void 0,function*(){return("https:"===r.parse(t.url).protocol?yield new Promise((t,n)=>{e(["https"],t,n)}):yield new Promise((t,n)=>{e(["http"],t,n)})).request})}(t))).then(e=>new Promise((n,d)=>{const h=r.parse(t.url),f={hostname:h.hostname,port:h.port?parseInt(h.port):"https:"===h.protocol?443:80,protocol:h.protocol,path:h.path,method:t.type||"GET",headers:t.headers,agent:t.agent,
rejectUnauthorized:!i.isBoolean(t.strictSSL)||t.strictSSL};if(t.user&&t.password&&(f.auth=t.user+":"+t.password),(u=e(f,e=>{const r=i.isNumber(t.followRedirects)?t.followRedirects:3;if(e.statusCode&&e.statusCode>=300&&e.statusCode<400&&r>0&&e.headers.location)c(o.assign({},t,{url:e.headers.location,followRedirects:r-1}),s).then(n,d);else{let t=e;"gzip"===e.headers["content-encoding"]&&(t=t.pipe(a.createGunzip())),n({res:e,stream:t})}})).on("error",d),t.timeout&&u.setTimeout(t.timeout),t.data){if("string"!=typeof t.data)return void t.data.pipe(u);u.write(t.data)}u.end(),s.onCancellationRequested(()=>{u.abort(),d(l.canceled())})}))}function u(e){return e.res.statusCode&&e.res.statusCode>=200&&e.res.statusCode<300||1223===e.res.statusCode}function d(e){return 204===e.res.statusCode}Object.defineProperty(t,"__esModule",{value:!0}),t.request=c,t.download=function(e,t){return new Promise((n,i)=>{const r=s.createWriteStream(e);r.once("finish",()=>n(void 0)),t.stream.once("error",i),t.stream.pipe(r)})},
t.asText=function(e){return new Promise((t,n)=>{if(!u(e))return n("Server returned "+e.res.statusCode);if(d(e))return t(null);let i=[];e.stream.on("data",e=>i.push(e)),e.stream.on("end",()=>t(i.join(""))),e.stream.on("error",n)})},t.asJson=function(e){return new Promise((t,n)=>{if(!u(e))return n("Server returned "+e.res.statusCode);if(d(e))return t(null);const i=[];e.stream.on("data",e=>i.push(e)),e.stream.on("end",()=>{try{t(JSON.parse(i.join("")))}catch(e){n(e)}}),e.stream.on("error",n)})}}),define(e[56],t([1,0,24,2,17,21,26,19,5,41,28,38,22,25,31,16,10,30,43,71,33,9]),function(e,t,n,s,o,a,l,c,u,d,h,f,g,p,m,v,y,E,S,x,C,b){"use strict";function _(...e){return String(e.reduce((e,t)=>e|t,0))}function P(e,t){const n=(e||[]).filter(e=>e.statisticName===t)[0];return n?n.value:0}function w(e,t){return e.files.filter(e=>e.assetType===t)[0]?{uri:`${e.assetUri}/${t}`,fallbackUri:`${e.fallbackAssetUri}/${t}`}:null}function I(e,t){const n=e.properties?e.properties.filter(e=>e.key===t):[],i=n.length>0&&n[0].value
;return i?i.split(",").map(e=>c.adoptToGalleryExtensionId(e)):[]}function k(e){const t=e.properties?e.properties.filter(e=>e.key===M.Engine):[];return t.length>0&&t[0].value||""}function O(t,n,i,r,s){const o={manifest:w(n,L.Manifest),readme:w(n,L.Details),changelog:w(n,L.Changelog),license:w(n,L.License),repository:function(e){if(e.properties){const t=e.properties.filter(e=>e.key===L.Repository),n=new RegExp("((git|ssh|http(s)?)|(git@[w.]+))(:(//)?)([w.@:/-~]+)(.git)(/)?"),i=t.filter(e=>n.test(e.value))[0];return i?{uri:i.value,fallbackUri:i.value}:null}return w(e,L.Repository)}(n),download:function(e){return{uri:`${e.fallbackAssetUri}/${L.VSIX}?redirect=true`,fallbackUri:`${e.fallbackAssetUri}/${L.VSIX}`}}(n),icon:function(t){const n=w(t,L.Icon);if(n)return n;const i=e.toUrl("./media/defaultIcon.png");return{uri:i,fallbackUri:i}}(n),coreTranslations:function(e){
return e.files.filter(e=>0===e.assetType.indexOf("Microsoft.VisualStudio.Code.Translation.")).reduce((t,n)=>(t[n.assetType.substring("Microsoft.VisualStudio.Code.Translation.".length)]=w(e,n.assetType),t),{})}(n)};return{identifier:{id:c.getGalleryExtensionId(t.publisher.publisherName,t.extensionName),uuid:t.extensionId},name:t.extensionName,version:n.version,date:n.lastUpdated,displayName:t.displayName,publisherId:t.publisher.publisherId,publisher:t.publisher.publisherName,publisherDisplayName:t.publisher.displayName,description:t.shortDescription||"",installCount:P(t.statistics,"install")+P(t.statistics,"updateCount"),rating:P(t.statistics,"averagerating"),ratingCount:P(t.statistics,"ratingcount"),assets:o,properties:{dependencies:I(n,M.Dependency),extensionPack:I(n,M.ExtensionPack),engine:k(n),localizedLanguages:function(e){const t=e.properties?e.properties.filter(e=>e.key===M.LocalizedLanguages):[],n=t.length>0&&t[0].value||"";return n?n.split(","):[]}(n)},telemetryData:{
index:(r.pageNumber-1)*r.pageSize+i,searchText:r.searchText,querySource:s},preview:function(e){return-1!==e.indexOf("preview")}(t.flags)}}function D(e){const t=s.join(e.userDataPath,"machineid");return y.readFile(t,"utf8").then(e=>S.isUUID(e)?e:null,()=>null).then(e=>{if(!e){e=S.generateUuid();try{E.writeFileAndFlushSync(t,e)}catch(e){}}return{"X-Market-Client-Id":`VSCode ${g.default.version}`,"User-Agent":`VSCode ${g.default.version}`,"X-Market-User-Id":e}})}Object.defineProperty(t,"__esModule",{value:!0});var T;!function(e){e[e.None=0]="None",e[e.IncludeVersions=1]="IncludeVersions",e[e.IncludeFiles=2]="IncludeFiles",e[e.IncludeCategoryAndTags=4]="IncludeCategoryAndTags",e[e.IncludeSharedAccounts=8]="IncludeSharedAccounts",e[e.IncludeVersionProperties=16]="IncludeVersionProperties",e[e.ExcludeNonValidated=32]="ExcludeNonValidated",e[e.IncludeInstallationTargets=64]="IncludeInstallationTargets",e[e.IncludeAssetUri=128]="IncludeAssetUri",e[e.IncludeStatistics=256]="IncludeStatistics",
e[e.IncludeLatestVersionOnly=512]="IncludeLatestVersionOnly",e[e.Unpublished=4096]="Unpublished"}(T||(T={}));var j;!function(e){e[e.Tag=1]="Tag",e[e.ExtensionId=4]="ExtensionId",e[e.Category=5]="Category",e[e.ExtensionName=7]="ExtensionName",e[e.Target=8]="Target",e[e.Featured=9]="Featured",e[e.SearchText=10]="SearchText",e[e.ExcludeWithFlags=12]="ExcludeWithFlags"}(j||(j={}));const L={Icon:"Microsoft.VisualStudio.Services.Icons.Default",Details:"Microsoft.VisualStudio.Services.Content.Details",Changelog:"Microsoft.VisualStudio.Services.Content.Changelog",Manifest:"Microsoft.VisualStudio.Code.Manifest",VSIX:"Microsoft.VisualStudio.Services.VSIXPackage",License:"Microsoft.VisualStudio.Services.Content.License",Repository:"Microsoft.VisualStudio.Services.Links.Source"},M={Dependency:"Microsoft.VisualStudio.Code.ExtensionDependencies",ExtensionPack:"Microsoft.VisualStudio.Code.ExtensionPack",Engine:"Microsoft.VisualStudio.Code.Engine",LocalizedLanguages:"Microsoft.VisualStudio.Code.LocalizedLanguages"},A={
pageNumber:1,pageSize:10,sortBy:0,sortOrder:0,flags:T.None,criteria:[],assetTypes:[]};class R{constructor(e=A){this.state=e}get pageNumber(){return this.state.pageNumber}get pageSize(){return this.state.pageSize}get sortBy(){return this.state.sortBy}get sortOrder(){return this.state.sortOrder}get flags(){return this.state.flags}withPage(e,t=this.state.pageSize){return new R(u.assign({},this.state,{pageNumber:e,pageSize:t}))}withFilter(e,...t){const n=[...this.state.criteria,...t.map(t=>({filterType:e,value:t}))];return new R(u.assign({},this.state,{criteria:n}))}withSortBy(e){return new R(u.assign({},this.state,{sortBy:e}))}withSortOrder(e){return new R(u.assign({},this.state,{sortOrder:e}))}withFlags(...e){return new R(u.assign({},this.state,{flags:e.reduce((e,t)=>e|t,0)}))}withAssetTypes(...e){return new R(u.assign({},this.state,{assetTypes:e}))}get raw(){const{criteria:e,pageNumber:t,pageSize:n,sortBy:i,sortOrder:r,flags:s,assetTypes:o}=this.state;return{filters:[{criteria:e,pageNumber:t,pageSize:n,
sortBy:i,sortOrder:r}],assetTypes:o,flags:s}}get searchText(){const e=this.state.criteria.filter(e=>e.filterType===j.SearchText)[0];return e&&e.value?e.value:""}}let U=class e{constructor(e,t,n,i){this.requestService=e,this.logService=t,this.environmentService=n,this.telemetryService=i;const r=p.default.extensionsGallery;this.extensionsGalleryUrl=r&&r.serviceUrl,this.extensionsControlUrl=r&&r.controlUrl,this.commonHeadersPromise=D(this.environmentService)}api(e=""){return`${this.extensionsGalleryUrl}${e}`}isEnabled(){return!!this.extensionsGalleryUrl}getCompatibleExtension(e,t){const n=l.isIExtensionIdentifier(e)?null:e;if(n&&n.properties.engine&&m.isEngineValid(n.properties.engine))return Promise.resolve(n);const{id:i,uuid:r}=n?n.identifier:e;let s=(new R).withFlags(T.IncludeAssetUri,T.IncludeStatistics,T.IncludeFiles,T.IncludeVersionProperties,T.ExcludeNonValidated).withPage(1,1).withFilter(j.Target,"Microsoft.VisualStudio.Code").withFilter(j.ExcludeWithFlags,_(T.Unpublished))
;return s=r?s.withFilter(j.ExtensionId,r):s.withFilter(j.ExtensionName,i),this.queryGallery(s,C.CancellationToken.None).then(({galleryExtensions:e})=>{const[n]=e;if(!n||!n.versions.length)return null;if(t){const e=n.versions.filter(e=>e.version===t)[0];if(e){const t=O(n,e,0,s);if(t.properties.engine&&m.isEngineValid(t.properties.engine))return t}return null}return this.getLastValidExtensionVersion(n,n.versions).then(e=>e?O(n,e,0,s):null)})}query(e={}){if(!this.isEnabled())return Promise.reject(new Error("No extension gallery service configured."));const t=e.names?"ids":e.text?"text":"all";let n=e.text||"";const i=u.getOrDefault(e,e=>e.pageSize,50);this.telemetryService.publicLog("galleryService:query",{type:t,text:n});let r=(new R).withFlags(T.IncludeLatestVersionOnly,T.IncludeAssetUri,T.IncludeStatistics,T.IncludeFiles,T.IncludeVersionProperties).withPage(1,i).withFilter(j.Target,"Microsoft.VisualStudio.Code").withFilter(j.ExcludeWithFlags,_(T.Unpublished))
;return n?((n=(n=(n=n.replace(/\bcategory:("([^"]*)"|([^"]\S*))(\s+|\b|$)/g,(e,t,n)=>(r=r.withFilter(j.Category,n||t),""))).replace(/\btag:("([^"]*)"|([^"]\S*))(\s+|\b|$)/g,(e,t,n)=>(r=r.withFilter(j.Tag,n||t),""))).trim())&&(n=n.length<200?n:n.substring(0,200),r=r.withFilter(j.SearchText,n)),r=r.withSortBy(0)):r=e.ids?r.withFilter(j.ExtensionId,...e.ids):e.names?r.withFilter(j.ExtensionName,...e.names):r.withSortBy(4),"number"==typeof e.sortBy&&(r=r.withSortBy(e.sortBy)),"number"==typeof e.sortOrder&&(r=r.withSortOrder(e.sortOrder)),this.queryGallery(r,C.CancellationToken.None).then(({galleryExtensions:t,total:n})=>{return{firstPage:t.map((t,n)=>O(t,t.versions[0],n,r,e.source)),total:n,pageSize:r.pageSize,getPage:(t,n)=>{if(n.isCancellationRequested)return Promise.reject(a.canceled());const i=r.withPage(t+1);return this.queryGallery(i,n).then(({galleryExtensions:t})=>t.map((t,n)=>O(t,t.versions[0],n,i,e.source)))}}})}queryGallery(e,t){return this.isEnabled()?this.commonHeadersPromise.then(n=>{
const i=JSON.stringify(e.raw),r=u.assign({},n,{"Content-Type":"application/json",Accept:"application/json;api-version=3.0-preview.1","Accept-Encoding":"gzip","Content-Length":i.length});return this.requestService.request({type:"POST",url:this.api("/extensionquery"),data:i,headers:r},t).then(e=>e.res.statusCode&&e.res.statusCode>=400&&e.res.statusCode<500?{galleryExtensions:[],total:0}:f.asJson(e).then(e=>{if(e){const t=e.results[0],n=t.extensions,i=t.resultMetadata&&t.resultMetadata.filter(e=>"ResultCount"===e.metadataType)[0];return{galleryExtensions:n,total:i&&i.metadataItems.filter(e=>"TotalCount"===e.name)[0].count||0}}return{galleryExtensions:[],total:0}}))}):Promise.reject(new Error("No extension gallery service configured."))}reportStatistic(e,t,n,i){return this.isEnabled()?this.commonHeadersPromise.then(r=>{const s=Object.assign({},r,{Accept:"*/*;api-version=4.0-preview.1"});return this.requestService.request({type:"POST",url:this.api(`/publishers/${e}/extensions/${t}/${n}/stats?statType=${i}`),
headers:s},C.CancellationToken.None).then(void 0,()=>void 0)}):Promise.resolve(void 0)}download(e,t){this.logService.trace("ExtensionGalleryService#download",e.identifier.id);const i=s.join(n.tmpdir(),S.generateUuid()),r=c.getGalleryExtensionTelemetryData(e),o=(new Date).getTime(),a=1===t?"install":2===t?"update":"",l=a?{uri:`${e.assets.download.uri}&${a}=true`,fallbackUri:`${e.assets.download.fallbackUri}?${a}=true`}:e.assets.download;return this.getAsset(l).then(e=>f.download(i,e)).then(()=>(e=>this.telemetryService.publicLog("galleryService:downloadVSIX",u.assign(r,{duration:e})))((new Date).getTime()-o)).then(()=>i)}getReadme(e,t){return e.assets.readme?this.getAsset(e.assets.readme,{},t).then(e=>f.asText(e)).then(e=>e||""):Promise.resolve("")}getManifest(e,t){return e.assets.manifest?this.getAsset(e.assets.manifest,{},t).then(f.asText).then(JSON.parse):Promise.resolve(null)}getCoreTranslation(e,t){const n=e.assets.coreTranslations[t.toUpperCase()]
;return n?this.getAsset(n).then(f.asText).then(JSON.parse):Promise.resolve(null)}getChangelog(e,t){return e.assets.changelog?this.getAsset(e.assets.changelog,{},t).then(e=>f.asText(e)).then(e=>e||""):Promise.resolve("")}loadAllDependencies(e,t){return this.getDependenciesReccursively(e.map(e=>e.id),[],t)}getAllVersions(e,t){let n=(new R).withFlags(T.IncludeVersions,T.IncludeFiles,T.IncludeVersionProperties,T.ExcludeNonValidated).withPage(1,1).withFilter(j.Target,"Microsoft.VisualStudio.Code").withFilter(j.ExcludeWithFlags,_(T.Unpublished));return n=e.identifier.uuid?n.withFilter(j.ExtensionId,e.identifier.uuid):n.withFilter(j.ExtensionName,e.identifier.id),this.queryGallery(n,C.CancellationToken.None).then(({galleryExtensions:e})=>e.length?t?Promise.all(e[0].versions.map(e=>this.getEngine(e).then(t=>m.isEngineValid(t)?e:null))).then(e=>e.filter(e=>!!e).map(e=>({version:e.version,date:e.lastUpdated}))):e[0].versions.map(e=>({version:e.version,date:e.lastUpdated})):[])}loadDependencies(e,t){
if(!e||0===e.length)return Promise.resolve([]);let n=(new R).withFlags(T.IncludeLatestVersionOnly,T.IncludeAssetUri,T.IncludeStatistics,T.IncludeFiles,T.IncludeVersionProperties).withPage(1,e.length).withFilter(j.Target,"Microsoft.VisualStudio.Code").withFilter(j.ExcludeWithFlags,_(T.Unpublished)).withAssetTypes(L.Icon,L.License,L.Details,L.Manifest,L.VSIX).withFilter(j.ExtensionName,...e);return this.queryGallery(n,t).then(e=>{const t=[],i=[];for(let r=0;r<e.galleryExtensions.length;r++){const s=e.galleryExtensions[r];-1===i.indexOf(s.extensionId)&&(t.push(O(s,s.versions[0],r,n,"dependencies")),i.push(s.extensionId))}return t})}getDependenciesReccursively(t,n,i){return t&&t.length&&(t=n.length?t.filter(t=>!e.hasExtensionByName(n,t)):t).length?this.loadDependencies(t,i).then(t=>{const r=new Set;for(const e of t)e.properties.dependencies&&e.properties.dependencies.forEach(e=>r.add(e));n=o.distinct(n.concat(t),e=>e.identifier.uuid);const s=[];return r.forEach(t=>!e.hasExtensionByName(n,t)&&s.push(t)),
this.getDependenciesReccursively(s,n,i)}):Promise.resolve(n)}getAsset(e,t={},n=C.CancellationToken.None){return this.commonHeadersPromise.then(i=>{const r=u.assign({},i,t.headers||{});t=u.assign({},t,{type:"GET"},{headers:r});const s=e.uri,o=e.fallbackUri,l=u.assign({},t,{url:s});return this.requestService.request(l,n).then(e=>200===e.res.statusCode?Promise.resolve(e):f.asText(e).then(t=>Promise.reject(new Error(`Expected 200, got back ${e.res.statusCode} instead.\n\n${t}`)))).then(void 0,e=>{if(a.isPromiseCanceledError(e))return Promise.reject(e);const i=a.getErrorMessage(e);this.telemetryService.publicLog("galleryService:requestError",{url:s,cdn:!0,message:i}),this.telemetryService.publicLog("galleryService:cdnFallback",{url:s,message:i});const r=u.assign({},t,{url:o});return this.requestService.request(r,n).then(void 0,e=>{if(a.isPromiseCanceledError(e))return Promise.reject(e);const t=a.getErrorMessage(e);return this.telemetryService.publicLog("galleryService:requestError",{url:o,cdn:!1,message:t}),
Promise.reject(e)})})})}getLastValidExtensionVersion(e,t){const n=this.getLastValidExtensionVersionFromProperties(e,t);return n||this.getLastValidExtensionVersionReccursively(e,t)}getLastValidExtensionVersionFromProperties(e,t){for(const e of t){const t=k(e);if(!t)return null;if(m.isEngineValid(t))return Promise.resolve(e)}return null}getEngine(e){const t=k(e);if(t)return Promise.resolve(t);const n=w(e,L.Manifest);if(!n)return Promise.reject("Manifest was not found");return this.getAsset(n,{headers:{"Accept-Encoding":"gzip"}}).then(e=>f.asJson(e)).then(e=>e?e.engines.vscode:Promise.reject("Error while reading manifest"))}getLastValidExtensionVersionReccursively(e,t){if(!t.length)return Promise.resolve(null);const n=t[0];return this.getEngine(n).then(i=>m.isEngineValid(i)?(n.properties=n.properties||[],n.properties.push({key:M.Engine,value:i}),n):this.getLastValidExtensionVersionReccursively(e,t.slice(1)))}static hasExtensionByName(e,t){for(const n of e)if(`${n.publisher}.${n.name}`===t)return!0;return!1}
getExtensionsReport(){return this.isEnabled()?this.extensionsControlUrl?this.requestService.request({type:"GET",url:this.extensionsControlUrl},C.CancellationToken.None).then(e=>200!==e.res.statusCode?Promise.reject(new Error("Could not get extensions report.")):f.asJson(e).then(e=>{const t=new Map;if(e)for(const n of e.malicious){const e=t.get(n)||{id:{id:n},malicious:!0,slow:!1};e.malicious=!0,t.set(n,e)}return Promise.resolve(x.values(t))})):Promise.resolve([]):Promise.reject(new Error("No extension gallery service configured."))}};U=i([r(0,d.IRequestService),r(1,b.ILogService),r(2,v.IEnvironmentService),r(3,h.ITelemetryService)],U),t.ExtensionGalleryService=U,t.resolveMarketplaceHeaders=D}),define(e[46],t([1,0,5,38,70,12,9]),function(e,t,n,s,o,a,l){"use strict";Object.defineProperty(t,"__esModule",{value:!0});let c=class{constructor(e,t){this.logService=t,this.disposables=[],this.configure(e.getValue()),e.onDidChangeConfiguration(()=>this.configure(e.getValue()),this,this.disposables)}configure(e){
this.proxyUrl=e.http&&e.http.proxy,this.strictSSL=!(!e.http||!e.http.proxyStrictSSL),this.authorization=e.http&&e.http.proxyAuthorization}request(e,t,i=s.request){this.logService.trace("RequestService#request",e.url);const{proxyUrl:r,strictSSL:a}=this;return(e.agent?Promise.resolve(e.agent):Promise.resolve(o.getProxyAgent(e.url||"",{proxyUrl:r,strictSSL:a}))).then(r=>(e.agent=r,e.strictSSL=a,this.authorization&&(e.headers=n.assign(e.headers||{},{"Proxy-Authorization":this.authorization})),i(e,t)))}};c=i([r(0,a.IConfigurationService),r(1,l.ILogService)],c),t.RequestService=c}),define(e[95],t([1,0,6,25,22,2,81,27,39,34,55,16,61,26,85,56,28,79,78,82,41,46,12,73,80,10,48,75,76,58,9,21,19,20,45,36,33]),function(e,t,s,o,a,l,c,u,d,h,f,g,p,m,v,y,E,S,x,C,b,_,P,w,I,k,O,D,T,j,L,M,A,R,U,N,F){"use strict";function z(e,t){return t?`${e.publisher}.${e.name}@${e.version}`:`${e.publisher}.${e.name}`}function $(e){const t=B.exec(e);return t&&t[1]?[A.adoptToGalleryExtensionId(t[1]),t[2]]:[A.adoptToGalleryExtensionId(e),void 0]}
Object.defineProperty(t,"__esModule",{value:!0});const V=s.localize(2,null,"ms-vscode.csharp"),B=/^([^.]+\..+)@(\d+\.\d+\.\d+(-.*)?)$/;t.getIdAndVersion=$;let W=class{constructor(e,t,n,i,r){this.remote=e,this.environmentService=t,this.configurationService=n,this.extensionManagementService=i,this.extensionGalleryService=r}run(e){return n(this,void 0,void 0,function*(){if(e["install-source"])yield this.setInstallSource(e["install-source"]);else if(e["list-extensions"])yield this.listExtensions(!!e["show-versions"]);else if(e["install-extension"]){const t=e["install-extension"],n="string"==typeof t?[t]:t;yield this.installExtensions(n,e.force)}else if(e["uninstall-extension"]){const t=e["uninstall-extension"],n="string"==typeof t?[t]:t;yield this.uninstallExtension(n)}})}setInstallSource(e){return k.writeFile(this.environmentService.installSourcePath,e.slice(0,30))}listExtensions(e){return n(this,void 0,void 0,function*(){
(yield this.extensionManagementService.getInstalled(1)).forEach(t=>console.log(z(t.manifest,e)))})}installExtensions(e,t){return n(this,void 0,void 0,function*(){let n=[];for(const i of e)try{yield this.installExtension(i,t)}catch(e){console.error(e.message||e.stack||e),n.push(i)}return n.length?Promise.reject(s.localize(3,null,n.join(", "))):Promise.resolve()})}installExtension(e,t){return n(this,void 0,void 0,function*(){if(/\.vsix$/i.test(e)){e=l.isAbsolute(e)?e:l.join(process.cwd(),e);const n=yield U.getManifest(e);if(this.remote&&N.isUIExtension(n,this.configurationService))return console.log(s.localize(4,null,O.getBaseLabel(e))),null;return(yield this.validate(n,t))?this.extensionManagementService.install(R.URI.file(e)).then(()=>{console.log(s.localize(5,null,O.getBaseLabel(e)))},t=>M.isPromiseCanceledError(t)?(console.log(s.localize(6,null,O.getBaseLabel(e))),null):Promise.reject(t)):null}const[i,r]=$(e)
;return this.extensionManagementService.getInstalled(1).then(e=>this.extensionGalleryService.getCompatibleExtension({id:i},r).then(null,e=>{if(e.responseText)try{const t=JSON.parse(e.responseText);return Promise.reject(t.message)}catch(e){}return Promise.reject(e)}).then(o=>n(this,void 0,void 0,function*(){if(!o)return Promise.reject(new Error(`${(e=>s.localize(0,null,e))(r?`${i}@${r}`:i)}\n${V}`));const n=yield this.extensionGalleryService.getManifest(o,F.CancellationToken.None);if(this.remote&&n&&N.isUIExtension(n,this.configurationService))return console.log(s.localize(7,null,o.identifier.id)),null;const[a]=e.filter(e=>A.areSameExtensions(e.identifier,{id:i}));return a?o.version!==a.manifest.version?r||t?(console.log(s.localize(8,null,i,o.version)),this.installFromGallery(i,o)):(console.log(s.localize(9,null,i,a.manifest.version,o.version)),Promise.resolve(null)):(console.log(s.localize(10,null,r?`${i}@${r}`:i)),Promise.resolve(null)):(console.log(s.localize(11,null,i)),this.installFromGallery(i,o))})))})}
validate(e,t){return n(this,void 0,void 0,function*(){if(!e)throw new Error("Invalid vsix");const n={id:A.getGalleryExtensionId(e.publisher,e.name)},i=(yield this.extensionManagementService.getInstalled(1)).filter(t=>A.areSameExtensions(n,t.identifier)&&c.gt(t.manifest.version,e.version))[0];return!(i&&!t)||(console.log(s.localize(12,null,i.identifier.id,i.manifest.version,e.version)),!1)})}installFromGallery(e,t){return n(this,void 0,void 0,function*(){console.log(s.localize(13,null));try{yield this.extensionManagementService.installFromGallery(t),console.log(s.localize(14,null,e,t.version))}catch(t){if(!M.isPromiseCanceledError(t))throw t;console.log(s.localize(15,null,e))}})}uninstallExtension(e){return u.sequence(e.map(e=>()=>(function(e){return n(this,void 0,void 0,function*(){if(!/\.vsix$/i.test(e))return e;const t=l.isAbsolute(e)?e:l.join(process.cwd(),e);return z(yield U.getManifest(t))})})(e).then(e=>this.extensionManagementService.getInstalled(1).then(t=>{
const[n]=t.filter(t=>A.areSameExtensions(t.identifier,{id:e}));return n?(console.log(s.localize(16,null,e)),this.extensionManagementService.uninstall(n,!0).then(()=>console.log(s.localize(17,null,e)))):Promise.reject(new Error(`${(e=>s.localize(1,null,e))(e)}\n${V}`))}))))}};W=i([r(1,g.IEnvironmentService),r(2,P.IConfigurationService),r(3,m.IExtensionManagementService),r(4,m.IExtensionGalleryService)],W),t.Main=W;const q="monacoworkbench";t.main=function(e){const t=new d.ServiceCollection,n=new p.EnvironmentService(e,process.execPath),i=j.createSpdLogService("cli",L.getLogLevel(n),n.logsPath);process.once("exit",()=>i.dispose()),i.info("main",e),t.set(g.IEnvironmentService,n),t.set(L.ILogService,i),t.set(D.IStateService,new h.SyncDescriptor(T.StateService));const r=new f.InstantiationService(t);return r.invokeFunction(t=>{const n=t.get(g.IEnvironmentService),s=t.get(D.IStateService);return Promise.all([n.appSettingsHome,n.extensionsPath].map(e=>k.mkdirp(e))).then(()=>{
const{appRoot:t,extensionsPath:l,extensionDevelopmentLocationURI:c,isBuilt:u,installSourcePath:f}=n,g=new d.ServiceCollection;g.set(P.IConfigurationService,new h.SyncDescriptor(w.ConfigurationService)),g.set(b.IRequestService,new h.SyncDescriptor(_.RequestService)),g.set(m.IExtensionManagementService,new h.SyncDescriptor(v.ExtensionManagementService,[!1])),g.set(m.IExtensionGalleryService,new h.SyncDescriptor(y.ExtensionGalleryService));const p=[];if(u&&!c&&!n.args["disable-telemetry"]&&o.default.enableTelemetry){o.default.aiConfig&&o.default.aiConfig.asimovKey&&p.push(new I.AppInsightsAppender(q,null,o.default.aiConfig.asimovKey,i));const e={appender:S.combinedAppender(...p),commonProperties:C.resolveCommonProperties(o.default.commit,a.default.version,s.getItem("telemetry.machineId"),f),piiPaths:[t,l]};g.set(E.ITelemetryService,new h.SyncDescriptor(x.TelemetryService,[e]))}else g.set(E.ITelemetryService,S.NullTelemetryService)
;return r.createChild(g).createInstance(W,!1).run(e).then(()=>S.combinedAppender(...p).dispose())})})}})}).call(this);
//# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/05f146c7a8f7f78e80261aa3b2a2e642586f9eb3/core/vs/code/node/cliProcessMain.js.map
