UNPKG

cloudstudio

Version:

Run VS Code on a remote server.

1 lines 334 kB
(()=>{var p={96:(p,e,a)=>{function d(p){return p&&p.default||p}p.exports=global.fetch=global.fetch||("undefined"==typeof process?d(a(762)):function(p,e){return d(a(482))(String(p).replace(/^\/\//g,"https://"),e)})},159:(p,e,a)=>{"use strict";var d=a(477),m=a(941),i={TRANSITIONAL:0,NONTRANSITIONAL:1};function l(p){return p.split("\0").map((function(p){return p.normalize("NFC")})).join("\0")}function t(p){for(var e=0,a=m.length-1;e<=a;){var d=Math.floor((e+a)/2),i=m[d];if(i[0][0]<=p&&i[0][1]>=p)return i;i[0][0]>p?a=d-1:e=d+1}return null}var s=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g;function o(p){return p.replace(s,"_").length}var r=/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08E4-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C03\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D01-\u0D03\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u18A9\u1920-\u192B\u1930-\u193B\u19B0-\u19C0\u19C8\u19C9\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF8\u1CF9\u1DC0-\u1DF5\u1DFC-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C4\uA8E0-\uA8F1\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2D]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD804[\uDC00-\uDC02\uDC38-\uDC46\uDC7F-\uDC82\uDCB0-\uDCBA\uDD00-\uDD02\uDD27-\uDD34\uDD73\uDD80-\uDD82\uDDB3-\uDDC0\uDE2C-\uDE37\uDEDF-\uDEEA\uDF01-\uDF03\uDF3C\uDF3E-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF57\uDF62\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDCB0-\uDCC3\uDDAF-\uDDB5\uDDB8-\uDDC0\uDE30-\uDE40\uDEAB-\uDEB7]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF51-\uDF7E\uDF8F-\uDF92]|\uD82F[\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD83A[\uDCD0-\uDCD6]|\uDB40[\uDD00-\uDDEF]/;function n(p,e){"xn--"===p.substr(0,4)&&(p=d.toUnicode(p));var a=!1;(l(p)!==p||"-"===p[3]&&"-"===p[4]||"-"===p[0]||"-"===p[p.length-1]||-1!==p.indexOf(".")||0===p.search(r))&&(a=!0);for(var m=o(p),s=0;s<m;++s){var n=t(p.codePointAt(s));if(v===i.TRANSITIONAL&&"valid"!==n[1]||v===i.NONTRANSITIONAL&&"valid"!==n[1]&&"deviation"!==n[1]){a=!0;break}}return{label:p,error:a}}function v(p,e,a){var d=function(p,e,a){for(var d=!1,m="",l=o(p),s=0;s<l;++s){var r=p.codePointAt(s),n=t(r);switch(n[1]){case"disallowed":d=!0,m+=String.fromCodePoint(r);break;case"ignored":break;case"mapped":m+=String.fromCodePoint.apply(String,n[2]);break;case"deviation":m+=a===i.TRANSITIONAL?String.fromCodePoint.apply(String,n[2]):String.fromCodePoint(r);break;case"valid":m+=String.fromCodePoint(r);break;case"disallowed_STD3_mapped":e?(d=!0,m+=String.fromCodePoint(r)):m+=String.fromCodePoint.apply(String,n[2]);break;case"disallowed_STD3_valid":e&&(d=!0),m+=String.fromCodePoint(r)}}return{string:m,error:d}}(p,e,a);d.string=l(d.string);for(var m=d.string.split("."),s=0;s<m.length;++s)try{var r=n(m[s]);m[s]=r.label,d.error=d.error||r.error}catch(p){d.error=!0}return{string:m.join("."),error:d.error}}p.exports.toASCII=function(p,e,a,m){var i=v(p,e,a),l=i.string.split(".");if(l=l.map((function(p){try{return d.toASCII(p)}catch(e){return i.error=!0,p}})),m){var t=l.slice(0,l.length-1).join(".").length;(t.length>253||0===t.length)&&(i.error=!0);for(var s=0;s<l.length;++s)if(l.length>63||0===l.length){i.error=!0;break}}return i.error?null:l.join(".")},p.exports.toUnicode=function(p,e){var a=v(p,e,i.NONTRANSITIONAL);return{domain:a.string,error:a.error}},p.exports.PROCESSING_OPTIONS=i},762:(p,e,a)=>{"use strict";function d(p,e){return e=e||{},new Promise((function(a,d){var m=new XMLHttpRequest,i=[],l=[],t={},s=function(){return{ok:2==(m.status/100|0),statusText:m.statusText,status:m.status,url:m.responseURL,text:function(){return Promise.resolve(m.responseText)},json:function(){return Promise.resolve(m.responseText).then(JSON.parse)},blob:function(){return Promise.resolve(new Blob([m.response]))},clone:s,headers:{keys:function(){return i},entries:function(){return l},get:function(p){return t[p.toLowerCase()]},has:function(p){return p.toLowerCase()in t}}}};for(var o in m.open(e.method||"get",p,!0),m.onload=function(){m.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,(function(p,e,a){i.push(e=e.toLowerCase()),l.push([e,a]),t[e]=t[e]?t[e]+","+a:a})),a(s())},m.onerror=d,m.withCredentials="include"==e.credentials,e.headers)m.setRequestHeader(o,e.headers[o]);m.send(e.body||null)}))}a.r(e),a.d(e,{default:()=>d})},824:p=>{"use strict";var e={};function a(p){return p<0?-1:1}function d(p,e){e.unsigned||--p;const d=e.unsigned?0:-Math.pow(2,p),m=Math.pow(2,p)-1,i=e.moduloBitLength?Math.pow(2,e.moduloBitLength):Math.pow(2,p),l=e.moduloBitLength?Math.pow(2,e.moduloBitLength-1):Math.pow(2,p-1);return function(p,t){t||(t={});let s=+p;if(t.enforceRange){if(!Number.isFinite(s))throw new TypeError("Argument is not a finite number");if(s=a(s)*Math.floor(Math.abs(s)),s<d||s>m)throw new TypeError("Argument is not in byte range");return s}if(!isNaN(s)&&t.clamp)return s=function(p){return p%1==.5&&0==(1&p)?Math.floor(p):Math.round(p)}(s),s<d&&(s=d),s>m&&(s=m),s;if(!Number.isFinite(s)||0===s)return 0;if(s=a(s)*Math.floor(Math.abs(s)),s%=i,!e.unsigned&&s>=l)return s-i;if(e.unsigned)if(s<0)s+=i;else if(-0===s)return 0;return s}}p.exports=e,e.void=function(){},e.boolean=function(p){return!!p},e.byte=d(8,{unsigned:!1}),e.octet=d(8,{unsigned:!0}),e.short=d(16,{unsigned:!1}),e["unsigned short"]=d(16,{unsigned:!0}),e.long=d(32,{unsigned:!1}),e["unsigned long"]=d(32,{unsigned:!0}),e["long long"]=d(32,{unsigned:!1,moduloBitLength:64}),e["unsigned long long"]=d(32,{unsigned:!0,moduloBitLength:64}),e.double=function(p){const e=+p;if(!Number.isFinite(e))throw new TypeError("Argument is not a finite floating-point value");return e},e["unrestricted double"]=function(p){const e=+p;if(isNaN(e))throw new TypeError("Argument is NaN");return e},e.float=e.double,e["unrestricted float"]=e["unrestricted double"],e.DOMString=function(p,e){return e||(e={}),e.treatNullAsEmptyString&&null===p?"":String(p)},e.ByteString=function(p,e){const a=String(p);let d;for(let p=0;void 0!==(d=a.codePointAt(p));++p)if(d>255)throw new TypeError("Argument is not a valid bytestring");return a},e.USVString=function(p){const e=String(p),a=e.length,d=[];for(let p=0;p<a;++p){const m=e.charCodeAt(p);if(m<55296||m>57343)d.push(String.fromCodePoint(m));else if(56320<=m&&m<=57343)d.push(String.fromCodePoint(65533));else if(p===a-1)d.push(String.fromCodePoint(65533));else{const a=e.charCodeAt(p+1);if(56320<=a&&a<=57343){const e=1023&m,i=1023&a;d.push(String.fromCodePoint(65536+1024*e+i)),++p}else d.push(String.fromCodePoint(65533))}}return d.join("")},e.Date=function(p,e){if(!(p instanceof Date))throw new TypeError("Argument is not a Date object");if(!isNaN(p))return p},e.RegExp=function(p,e){return p instanceof RegExp||(p=new RegExp(p)),p}},557:(p,e,a)=>{"use strict";const d=a(216);e.implementation=class{constructor(p){const e=p[0],a=p[1];let m=null;if(void 0!==a&&(m=d.basicURLParse(a),"failure"===m))throw new TypeError("Invalid base URL");const i=d.basicURLParse(e,{baseURL:m});if("failure"===i)throw new TypeError("Invalid URL");this._url=i}get href(){return d.serializeURL(this._url)}set href(p){const e=d.basicURLParse(p);if("failure"===e)throw new TypeError("Invalid URL");this._url=e}get origin(){return d.serializeURLOrigin(this._url)}get protocol(){return this._url.scheme+":"}set protocol(p){d.basicURLParse(p+":",{url:this._url,stateOverride:"scheme start"})}get username(){return this._url.username}set username(p){d.cannotHaveAUsernamePasswordPort(this._url)||d.setTheUsername(this._url,p)}get password(){return this._url.password}set password(p){d.cannotHaveAUsernamePasswordPort(this._url)||d.setThePassword(this._url,p)}get host(){const p=this._url;return null===p.host?"":null===p.port?d.serializeHost(p.host):d.serializeHost(p.host)+":"+d.serializeInteger(p.port)}set host(p){this._url.cannotBeABaseURL||d.basicURLParse(p,{url:this._url,stateOverride:"host"})}get hostname(){return null===this._url.host?"":d.serializeHost(this._url.host)}set hostname(p){this._url.cannotBeABaseURL||d.basicURLParse(p,{url:this._url,stateOverride:"hostname"})}get port(){return null===this._url.port?"":d.serializeInteger(this._url.port)}set port(p){d.cannotHaveAUsernamePasswordPort(this._url)||(""===p?this._url.port=null:d.basicURLParse(p,{url:this._url,stateOverride:"port"}))}get pathname(){return this._url.cannotBeABaseURL?this._url.path[0]:0===this._url.path.length?"":"/"+this._url.path.join("/")}set pathname(p){this._url.cannotBeABaseURL||(this._url.path=[],d.basicURLParse(p,{url:this._url,stateOverride:"path start"}))}get search(){return null===this._url.query||""===this._url.query?"":"?"+this._url.query}set search(p){const e=this._url;if(""===p)return void(e.query=null);const a="?"===p[0]?p.substring(1):p;e.query="",d.basicURLParse(a,{url:e,stateOverride:"query"})}get hash(){return null===this._url.fragment||""===this._url.fragment?"":"#"+this._url.fragment}set hash(p){if(""===p)return void(this._url.fragment=null);const e="#"===p[0]?p.substring(1):p;this._url.fragment="",d.basicURLParse(e,{url:this._url,stateOverride:"fragment"})}toJSON(){return this.href}}},29:(p,e,a)=>{"use strict";const d=a(824),m=a(587),i=a(557),l=m.implSymbol;function t(e){if(!this||this[l]||!(this instanceof t))throw new TypeError("Failed to construct 'URL': Please use the 'new' operator, this DOM object constructor cannot be called as a function.");if(arguments.length<1)throw new TypeError("Failed to construct 'URL': 1 argument required, but only "+arguments.length+" present.");const a=[];for(let p=0;p<arguments.length&&p<2;++p)a[p]=arguments[p];a[0]=d.USVString(a[0]),void 0!==a[1]&&(a[1]=d.USVString(a[1])),p.exports.setup(this,a)}t.prototype.toJSON=function(){if(!this||!p.exports.is(this))throw new TypeError("Illegal invocation");const e=[];for(let p=0;p<arguments.length&&p<0;++p)e[p]=arguments[p];return this[l].toJSON.apply(this[l],e)},Object.defineProperty(t.prototype,"href",{get(){return this[l].href},set(p){p=d.USVString(p),this[l].href=p},enumerable:!0,configurable:!0}),t.prototype.toString=function(){if(!this||!p.exports.is(this))throw new TypeError("Illegal invocation");return this.href},Object.defineProperty(t.prototype,"origin",{get(){return this[l].origin},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"protocol",{get(){return this[l].protocol},set(p){p=d.USVString(p),this[l].protocol=p},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"username",{get(){return this[l].username},set(p){p=d.USVString(p),this[l].username=p},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"password",{get(){return this[l].password},set(p){p=d.USVString(p),this[l].password=p},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"host",{get(){return this[l].host},set(p){p=d.USVString(p),this[l].host=p},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"hostname",{get(){return this[l].hostname},set(p){p=d.USVString(p),this[l].hostname=p},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"port",{get(){return this[l].port},set(p){p=d.USVString(p),this[l].port=p},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"pathname",{get(){return this[l].pathname},set(p){p=d.USVString(p),this[l].pathname=p},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"search",{get(){return this[l].search},set(p){p=d.USVString(p),this[l].search=p},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"hash",{get(){return this[l].hash},set(p){p=d.USVString(p),this[l].hash=p},enumerable:!0,configurable:!0}),p.exports={is:p=>!!p&&p[l]instanceof i.implementation,create(p,e){let a=Object.create(t.prototype);return this.setup(a,p,e),a},setup(p,e,a){a||(a={}),a.wrapper=p,p[l]=new i.implementation(e,a),p[l][m.wrapperSymbol]=p},interface:t,expose:{Window:{URL:t},Worker:{URL:t}}}},658:(p,e,a)=>{"use strict";e.URL=a(29).interface,a(216).serializeURL,a(216).serializeURLOrigin,a(216).basicURLParse,a(216).setTheUsername,a(216).setThePassword,a(216).serializeHost,a(216).serializeInteger,a(216).parseURL},216:(p,e,a)=>{"use strict";const d=a(477),m=a(159),i={ftp:21,file:null,gopher:70,http:80,https:443,ws:80,wss:443},l=Symbol("failure");function t(p){return d.ucs2.decode(p).length}function s(p,e){const a=p[e];return isNaN(a)?void 0:String.fromCodePoint(a)}function o(p){return p>=48&&p<=57}function r(p){return p>=65&&p<=90||p>=97&&p<=122}function n(p){return o(p)||p>=65&&p<=70||p>=97&&p<=102}function v(p){return"."===p||"%2e"===p.toLowerCase()}function u(p){return 2===p.length&&r(p.codePointAt(0))&&(":"===p[1]||"|"===p[1])}function c(p){return void 0!==i[p]}function h(p){return c(p.scheme)}function w(p){let e=p.toString(16).toUpperCase();return 1===e.length&&(e="0"+e),"%"+e}function f(p){return p<=31||p>126}const _=new Set([32,34,35,60,62,63,96,123,125]);function N(p){return f(p)||_.has(p)}const b=new Set([47,58,59,61,64,91,92,93,94,124]);function g(p){return N(p)||b.has(p)}function D(p,e){const a=String.fromCodePoint(p);return e(p)?function(p){const e=new Buffer(p);let a="";for(let p=0;p<e.length;++p)a+=w(e[p]);return a}(a):a}function V(p){let e=10;return p.length>=2&&"0"===p.charAt(0)&&"x"===p.charAt(1).toLowerCase()?(p=p.substring(2),e=16):p.length>=2&&"0"===p.charAt(0)&&(p=p.substring(1),e=8),""===p?0:(10===e?/[^0-9]/:16===e?/[^0-9A-Fa-f]/:/[^0-7]/).test(p)?l:parseInt(p,e)}function S(p,e){if("["===p[0])return"]"!==p[p.length-1]?l:function(p){const e=[0,0,0,0,0,0,0,0];let a=0,m=null,i=0;if(58===(p=d.ucs2.decode(p))[i]){if(58!==p[i+1])return l;i+=2,++a,m=a}for(;i<p.length;){if(8===a)return l;if(58===p[i]){if(null!==m)return l;++i,++a,m=a;continue}let d=0,t=0;for(;t<4&&n(p[i]);)d=16*d+parseInt(s(p,i),16),++i,++t;if(46===p[i]){if(0===t)return l;if(i-=t,a>6)return l;let d=0;for(;void 0!==p[i];){let m=null;if(d>0){if(!(46===p[i]&&d<4))return l;++i}if(!o(p[i]))return l;for(;o(p[i]);){const e=parseInt(s(p,i));if(null===m)m=e;else{if(0===m)return l;m=10*m+e}if(m>255)return l;++i}e[a]=256*e[a]+m,++d,2!==d&&4!==d||++a}if(4!==d)return l;break}if(58===p[i]){if(++i,void 0===p[i])return l}else if(void 0!==p[i])return l;e[a]=d,++a}if(null!==m){let p=a-m;for(a=7;0!==a&&p>0;){const d=e[m+p-1];e[m+p-1]=e[a],e[a]=d,--a,--p}}else if(null===m&&8!==a)return l;return e}(p.substring(1,p.length-1));if(!e)return function(p){if(-1!==p.search(/\u0000|\u0009|\u000A|\u000D|\u0020|#|\/|:|\?|@|\[|\\|\]/))return l;let e="";const a=d.ucs2.decode(p);for(let p=0;p<a.length;++p)e+=D(a[p],f);return e}(p);const a=function(p){const e=new Buffer(p),a=[];for(let p=0;p<e.length;++p)37!==e[p]?a.push(e[p]):37===e[p]&&n(e[p+1])&&n(e[p+2])?(a.push(parseInt(e.slice(p+1,p+3).toString(),16)),p+=2):a.push(e[p]);return new Buffer(a).toString()}(p),i=m.toASCII(a,!1,m.PROCESSING_OPTIONS.NONTRANSITIONAL,!1);if(null===i)return l;if(-1!==i.search(/\u0000|\u0009|\u000A|\u000D|\u0020|#|%|\/|:|\?|@|\[|\\|\]/))return l;const t=function(p){const e=p.split(".");if(""===e[e.length-1]&&e.length>1&&e.pop(),e.length>4)return p;const a=[];for(const d of e){if(""===d)return p;const e=V(d);if(e===l)return p;a.push(e)}for(let p=0;p<a.length-1;++p)if(a[p]>255)return l;if(a[a.length-1]>=Math.pow(256,5-a.length))return l;let d=a.pop(),m=0;for(const p of a)d+=p*Math.pow(256,3-m),++m;return d}(i);return"number"==typeof t||t===l?t:i}function y(p){return"number"==typeof p?function(p){let e="",a=p;for(let p=1;p<=4;++p)e=String(a%256)+e,4!==p&&(e="."+e),a=Math.floor(a/256);return e}(p):p instanceof Array?"["+function(p){let e="";const a=function(p){let e=null,a=1,d=null,m=0;for(let i=0;i<p.length;++i)0!==p[i]?(m>a&&(e=d,a=m),d=null,m=0):(null===d&&(d=i),++m);return m>a&&(e=d,a=m),{idx:e,len:a}}(p).idx;let d=!1;for(let m=0;m<=7;++m)d&&0===p[m]||(d&&(d=!1),a!==m?(e+=p[m].toString(16),7!==m&&(e+=":")):(e+=0===m?"::":":",d=!0));return e}(p)+"]":p}function T(p){const e=p.path;var a;0!==e.length&&("file"===p.scheme&&1===e.length&&(a=e[0],/^[A-Za-z]:$/.test(a))||e.pop())}function P(p){return""!==p.username||""!==p.password}function C(p,e,a,m,i){if(this.pointer=0,this.input=p,this.base=e||null,this.encodingOverride=a||"utf-8",this.stateOverride=i,this.url=m,this.failure=!1,this.parseError=!1,!this.url){this.url={scheme:"",username:"",password:"",host:null,port:null,path:[],query:null,fragment:null,cannotBeABaseURL:!1};const p=function(p){return p.replace(/^[\u0000-\u001F\u0020]+|[\u0000-\u001F\u0020]+$/g,"")}(this.input);p!==this.input&&(this.parseError=!0),this.input=p}const t=function(p){return p.replace(/\u0009|\u000A|\u000D/g,"")}(this.input);for(t!==this.input&&(this.parseError=!0),this.input=t,this.state=i||"scheme start",this.buffer="",this.atFlag=!1,this.arrFlag=!1,this.passwordTokenSeenFlag=!1,this.input=d.ucs2.decode(this.input);this.pointer<=this.input.length;++this.pointer){const p=this.input[this.pointer],e=isNaN(p)?void 0:String.fromCodePoint(p),a=this["parse "+this.state](p,e);if(!a)break;if(a===l){this.failure=!0;break}}}C.prototype["parse scheme start"]=function(p,e){if(r(p))this.buffer+=e.toLowerCase(),this.state="scheme";else{if(this.stateOverride)return this.parseError=!0,l;this.state="no scheme",--this.pointer}return!0},C.prototype["parse scheme"]=function(p,e){if(function(p){return r(p)||o(p)}(p)||43===p||45===p||46===p)this.buffer+=e.toLowerCase();else if(58===p){if(this.stateOverride){if(h(this.url)&&!c(this.buffer))return!1;if(!h(this.url)&&c(this.buffer))return!1;if((P(this.url)||null!==this.url.port)&&"file"===this.buffer)return!1;if("file"===this.url.scheme&&(""===this.url.host||null===this.url.host))return!1}if(this.url.scheme=this.buffer,this.buffer="",this.stateOverride)return!1;"file"===this.url.scheme?(47===this.input[this.pointer+1]&&47===this.input[this.pointer+2]||(this.parseError=!0),this.state="file"):h(this.url)&&null!==this.base&&this.base.scheme===this.url.scheme?this.state="special relative or authority":h(this.url)?this.state="special authority slashes":47===this.input[this.pointer+1]?(this.state="path or authority",++this.pointer):(this.url.cannotBeABaseURL=!0,this.url.path.push(""),this.state="cannot-be-a-base-URL path")}else{if(this.stateOverride)return this.parseError=!0,l;this.buffer="",this.state="no scheme",this.pointer=-1}return!0},C.prototype["parse no scheme"]=function(p){return null===this.base||this.base.cannotBeABaseURL&&35!==p?l:(this.base.cannotBeABaseURL&&35===p?(this.url.scheme=this.base.scheme,this.url.path=this.base.path.slice(),this.url.query=this.base.query,this.url.fragment="",this.url.cannotBeABaseURL=!0,this.state="fragment"):"file"===this.base.scheme?(this.state="file",--this.pointer):(this.state="relative",--this.pointer),!0)},C.prototype["parse special relative or authority"]=function(p){return 47===p&&47===this.input[this.pointer+1]?(this.state="special authority ignore slashes",++this.pointer):(this.parseError=!0,this.state="relative",--this.pointer),!0},C.prototype["parse path or authority"]=function(p){return 47===p?this.state="authority":(this.state="path",--this.pointer),!0},C.prototype["parse relative"]=function(p){return this.url.scheme=this.base.scheme,isNaN(p)?(this.url.username=this.base.username,this.url.password=this.base.password,this.url.host=this.base.host,this.url.port=this.base.port,this.url.path=this.base.path.slice(),this.url.query=this.base.query):47===p?this.state="relative slash":63===p?(this.url.username=this.base.username,this.url.password=this.base.password,this.url.host=this.base.host,this.url.port=this.base.port,this.url.path=this.base.path.slice(),this.url.query="",this.state="query"):35===p?(this.url.username=this.base.username,this.url.password=this.base.password,this.url.host=this.base.host,this.url.port=this.base.port,this.url.path=this.base.path.slice(),this.url.query=this.base.query,this.url.fragment="",this.state="fragment"):h(this.url)&&92===p?(this.parseError=!0,this.state="relative slash"):(this.url.username=this.base.username,this.url.password=this.base.password,this.url.host=this.base.host,this.url.port=this.base.port,this.url.path=this.base.path.slice(0,this.base.path.length-1),this.state="path",--this.pointer),!0},C.prototype["parse relative slash"]=function(p){return!h(this.url)||47!==p&&92!==p?47===p?this.state="authority":(this.url.username=this.base.username,this.url.password=this.base.password,this.url.host=this.base.host,this.url.port=this.base.port,this.state="path",--this.pointer):(92===p&&(this.parseError=!0),this.state="special authority ignore slashes"),!0},C.prototype["parse special authority slashes"]=function(p){return 47===p&&47===this.input[this.pointer+1]?(this.state="special authority ignore slashes",++this.pointer):(this.parseError=!0,this.state="special authority ignore slashes",--this.pointer),!0},C.prototype["parse special authority ignore slashes"]=function(p){return 47!==p&&92!==p?(this.state="authority",--this.pointer):this.parseError=!0,!0},C.prototype["parse authority"]=function(p,e){if(64===p){this.parseError=!0,this.atFlag&&(this.buffer="%40"+this.buffer),this.atFlag=!0;const p=t(this.buffer);for(let e=0;e<p;++e){const p=this.buffer.codePointAt(e);if(58===p&&!this.passwordTokenSeenFlag){this.passwordTokenSeenFlag=!0;continue}const a=D(p,g);this.passwordTokenSeenFlag?this.url.password+=a:this.url.username+=a}this.buffer=""}else if(isNaN(p)||47===p||63===p||35===p||h(this.url)&&92===p){if(this.atFlag&&""===this.buffer)return this.parseError=!0,l;this.pointer-=t(this.buffer)+1,this.buffer="",this.state="host"}else this.buffer+=e;return!0},C.prototype["parse hostname"]=C.prototype["parse host"]=function(p,e){if(this.stateOverride&&"file"===this.url.scheme)--this.pointer,this.state="file host";else if(58!==p||this.arrFlag)if(isNaN(p)||47===p||63===p||35===p||h(this.url)&&92===p){if(--this.pointer,h(this.url)&&""===this.buffer)return this.parseError=!0,l;if(this.stateOverride&&""===this.buffer&&(P(this.url)||null!==this.url.port))return this.parseError=!0,!1;const p=S(this.buffer,h(this.url));if(p===l)return l;if(this.url.host=p,this.buffer="",this.state="path start",this.stateOverride)return!1}else 91===p?this.arrFlag=!0:93===p&&(this.arrFlag=!1),this.buffer+=e;else{if(""===this.buffer)return this.parseError=!0,l;const p=S(this.buffer,h(this.url));if(p===l)return l;if(this.url.host=p,this.buffer="",this.state="port","hostname"===this.stateOverride)return!1}return!0},C.prototype["parse port"]=function(p,e){if(o(p))this.buffer+=e;else{if(!(isNaN(p)||47===p||63===p||35===p||h(this.url)&&92===p||this.stateOverride))return this.parseError=!0,l;if(""!==this.buffer){const p=parseInt(this.buffer);if(p>Math.pow(2,16)-1)return this.parseError=!0,l;this.url.port=p===(a=this.url.scheme,i[a])?null:p,this.buffer=""}if(this.stateOverride)return!1;this.state="path start",--this.pointer}var a;return!0};const A=new Set([47,92,63,35]);C.prototype["parse file"]=function(p){var e,a;return this.url.scheme="file",47===p||92===p?(92===p&&(this.parseError=!0),this.state="file slash"):null!==this.base&&"file"===this.base.scheme?isNaN(p)?(this.url.host=this.base.host,this.url.path=this.base.path.slice(),this.url.query=this.base.query):63===p?(this.url.host=this.base.host,this.url.path=this.base.path.slice(),this.url.query="",this.state="query"):35===p?(this.url.host=this.base.host,this.url.path=this.base.path.slice(),this.url.query=this.base.query,this.url.fragment="",this.state="fragment"):(this.input.length-this.pointer-1==0||(e=p,a=this.input[this.pointer+1],!r(e)||58!==a&&124!==a)||this.input.length-this.pointer-1>=2&&!A.has(this.input[this.pointer+2])?(this.url.host=this.base.host,this.url.path=this.base.path.slice(),T(this.url)):this.parseError=!0,this.state="path",--this.pointer):(this.state="path",--this.pointer),!0},C.prototype["parse file slash"]=function(p){var e;return 47===p||92===p?(92===p&&(this.parseError=!0),this.state="file host"):(null!==this.base&&"file"===this.base.scheme&&(2===(e=this.base.path[0]).length&&r(e.codePointAt(0))&&":"===e[1]?this.url.path.push(this.base.path[0]):this.url.host=this.base.host),this.state="path",--this.pointer),!0},C.prototype["parse file host"]=function(p,e){if(isNaN(p)||47===p||92===p||63===p||35===p)if(--this.pointer,!this.stateOverride&&u(this.buffer))this.parseError=!0,this.state="path";else if(""===this.buffer){if(this.url.host="",this.stateOverride)return!1;this.state="path start"}else{let p=S(this.buffer,h(this.url));if(p===l)return l;if("localhost"===p&&(p=""),this.url.host=p,this.stateOverride)return!1;this.buffer="",this.state="path start"}else this.buffer+=e;return!0},C.prototype["parse path start"]=function(p){return h(this.url)?(92===p&&(this.parseError=!0),this.state="path",47!==p&&92!==p&&--this.pointer):this.stateOverride||63!==p?this.stateOverride||35!==p?void 0!==p&&(this.state="path",47!==p&&--this.pointer):(this.url.fragment="",this.state="fragment"):(this.url.query="",this.state="query"),!0},C.prototype["parse path"]=function(p){if(isNaN(p)||47===p||h(this.url)&&92===p||!this.stateOverride&&(63===p||35===p)){if(h(this.url)&&92===p&&(this.parseError=!0),".."===(e=(e=this.buffer).toLowerCase())||"%2e."===e||".%2e"===e||"%2e%2e"===e?(T(this.url),47===p||h(this.url)&&92===p||this.url.path.push("")):!v(this.buffer)||47===p||h(this.url)&&92===p?v(this.buffer)||("file"===this.url.scheme&&0===this.url.path.length&&u(this.buffer)&&(""!==this.url.host&&null!==this.url.host&&(this.parseError=!0,this.url.host=""),this.buffer=this.buffer[0]+":"),this.url.path.push(this.buffer)):this.url.path.push(""),this.buffer="","file"===this.url.scheme&&(void 0===p||63===p||35===p))for(;this.url.path.length>1&&""===this.url.path[0];)this.parseError=!0,this.url.path.shift();63===p&&(this.url.query="",this.state="query"),35===p&&(this.url.fragment="",this.state="fragment")}else 37!==p||n(this.input[this.pointer+1])&&n(this.input[this.pointer+2])||(this.parseError=!0),this.buffer+=D(p,N);var e;return!0},C.prototype["parse cannot-be-a-base-URL path"]=function(p){return 63===p?(this.url.query="",this.state="query"):35===p?(this.url.fragment="",this.state="fragment"):(isNaN(p)||37===p||(this.parseError=!0),37!==p||n(this.input[this.pointer+1])&&n(this.input[this.pointer+2])||(this.parseError=!0),isNaN(p)||(this.url.path[0]=this.url.path[0]+D(p,f))),!0},C.prototype["parse query"]=function(p,e){if(isNaN(p)||!this.stateOverride&&35===p){h(this.url)&&"ws"!==this.url.scheme&&"wss"!==this.url.scheme||(this.encodingOverride="utf-8");const e=new Buffer(this.buffer);for(let p=0;p<e.length;++p)e[p]<33||e[p]>126||34===e[p]||35===e[p]||60===e[p]||62===e[p]?this.url.query+=w(e[p]):this.url.query+=String.fromCodePoint(e[p]);this.buffer="",35===p&&(this.url.fragment="",this.state="fragment")}else 37!==p||n(this.input[this.pointer+1])&&n(this.input[this.pointer+2])||(this.parseError=!0),this.buffer+=e;return!0},C.prototype["parse fragment"]=function(p){return isNaN(p)||(0===p?this.parseError=!0:(37!==p||n(this.input[this.pointer+1])&&n(this.input[this.pointer+2])||(this.parseError=!0),this.url.fragment+=D(p,f))),!0},p.exports.serializeURL=function(p,e){let a=p.scheme+":";if(null!==p.host?(a+="//",""===p.username&&""===p.password||(a+=p.username,""!==p.password&&(a+=":"+p.password),a+="@"),a+=y(p.host),null!==p.port&&(a+=":"+p.port)):null===p.host&&"file"===p.scheme&&(a+="//"),p.cannotBeABaseURL)a+=p.path[0];else for(const e of p.path)a+="/"+e;return null!==p.query&&(a+="?"+p.query),e||null===p.fragment||(a+="#"+p.fragment),a},p.exports.serializeURLOrigin=function(e){switch(e.scheme){case"blob":try{return p.exports.serializeURLOrigin(p.exports.parseURL(e.path[0]))}catch(p){return"null"}case"ftp":case"gopher":case"http":case"https":case"ws":case"wss":return function(p){let e=p.scheme+"://";return e+=y(p.host),null!==p.port&&(e+=":"+p.port),e}({scheme:e.scheme,host:e.host,port:e.port});case"file":return"file://";default:return"null"}},p.exports.basicURLParse=function(p,e){void 0===e&&(e={});const a=new C(p,e.baseURL,e.encodingOverride,e.url,e.stateOverride);return a.failure?"failure":a.url},p.exports.setTheUsername=function(p,e){p.username="";const a=d.ucs2.decode(e);for(let e=0;e<a.length;++e)p.username+=D(a[e],g)},p.exports.setThePassword=function(p,e){p.password="";const a=d.ucs2.decode(e);for(let e=0;e<a.length;++e)p.password+=D(a[e],g)},p.exports.serializeHost=y,p.exports.cannotHaveAUsernamePasswordPort=function(p){return null===p.host||""===p.host||p.cannotBeABaseURL||"file"===p.scheme},p.exports.serializeInteger=function(p){return String(p)},p.exports.parseURL=function(e,a){return void 0===a&&(a={}),p.exports.basicURLParse(e,{baseURL:a.baseURL,encodingOverride:a.encodingOverride})}},587:p=>{"use strict";p.exports.mixin=function(p,e){const a=Object.getOwnPropertyNames(e);for(let d=0;d<a.length;++d)Object.defineProperty(p,a[d],Object.getOwnPropertyDescriptor(e,a[d]))},p.exports.wrapperSymbol=Symbol("wrapper"),p.exports.implSymbol=Symbol("impl"),p.exports.wrapperForImpl=function(e){return e[p.exports.wrapperSymbol]},p.exports.implForWrapper=function(e){return e[p.exports.implSymbol]}},132:(p,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.once=e.toggleInSet=e.removeFromSet=e.addToSet=e.binarySearch=void 0,e.binarySearch=function(p,e){let a=0,d=p.length-1;for(;a<=d;){const m=(a+d)/2|0,i=e(p[m]);if(i<0)a=m+1;else{if(!(i>0))return m;d=m-1}}return-(a+1)},e.addToSet=(p,e)=>{const a=new Set([...p,e]);return a.add(e),a},e.removeFromSet=(p,e)=>{const a=new Set([...p]);return a.delete(e),a},e.toggleInSet=(p,e)=>{const a=new Set([...p]);return a.has(e)?a.delete(e):a.add(e),a};const a=Symbol("unset");e.once=p=>{let e=a;return()=>(e===a&&(e=p()),e)}},85:(p,e,a)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.bundlePage=void 0;const d=a(412);e.bundlePage=async(p,e)=>{const a=(0,d.makeNonce)();return`<!DOCTYPE html>\n <html lang="en">\n <head>\n <meta charset="UTF-8">\n <meta name="viewport" content="width=device-width, initial-scale=1.0">\n ${(0,d.nonceHeader)(a)}\n <title>Profile Custom Editor</title>\n </head>\n <body>\n <script type="text/javascript" nonce="${a}">\n ${Object.entries(e).map((([p,e])=>`globalThis.${p} = ${JSON.stringify(e)}`)).join(";")}\n <\/script>\n <script nonce="${a}" src="${p}"><\/script>\n </body>\n </html>\n `}},639:(p,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.categorize=void 0,e.categorize=(p,e)=>(p.functionName=p.functionName||"(anonymous)",p.lineNumber<0?0:p.url.includes("node_modules")||!e?2:1)},49:(p,e,a)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.CpuProfileAnnotations=void 0;const d=a(496),m=a(561),i=a(127),l=a(65);class t extends i.ProfileAnnotations{constructor(){super(...arguments),this.data=new Map}set(p,e,a){var i;let l=this.data.get((0,m.lowerCaseInsensitivePath)(p));l||(l=[],this.data.set((0,m.lowerCaseInsensitivePath)(p),l));let t=0;for(;t<l.length&&l[t].position.line<e.line;)t++;if((null===(i=l[t])||void 0===i?void 0:i.position.line)===e.line){const p=l[t];e.character<p.position.character&&(p.position=new d.Position(e.line,e.character)),p.data.aggregateTime+=a.aggregateTime,p.data.selfTime+=a.selfTime,p.data.ticks+=a.ticks}else l.splice(t,0,{position:new d.Position(e.line,e.character),data:{aggregateTime:a.aggregateTime,selfTime:a.selfTime,ticks:a.ticks}})}getLensesForFile(p){var e,a;return this.expandForFile(p),null!==(a=null===(e=this.data.get((0,m.lowerCaseInsensitivePath)(p)))||void 0===e?void 0:e.map((({position:p,data:e})=>{if(0===e.aggregateTime&&0===e.selfTime)return[];const a=new d.Range(p,p);return[new d.CodeLens(a,{title:`${l.decimalFormat.format(e.selfTime/1e3)}ms Self Time, ${l.decimalFormat.format(e.aggregateTime/1e3)}ms Total`,command:""}),new d.CodeLens(a,{title:"Clear",command:"extension.jsProfileVisualizer.table.clearCodeLenses"})]})).reduce(((p,e)=>[...p,...e]),[]))&&void 0!==a?a:[]}}e.CpuProfileAnnotations=t},65:(p,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.decimalFormat=void 0,e.decimalFormat=new Intl.NumberFormat(void 0,{maximumFractionDigits:2,minimumFractionDigits:2})},577:function(p,e,a){"use strict";var d=this&&this.__createBinding||(Object.create?function(p,e,a,d){void 0===d&&(d=a);var m=Object.getOwnPropertyDescriptor(e,a);m&&!("get"in m?!e.__esModule:m.writable||m.configurable)||(m={enumerable:!0,get:function(){return e[a]}}),Object.defineProperty(p,d,m)}:function(p,e,a,d){void 0===d&&(d=a),p[d]=e[a]}),m=this&&this.__setModuleDefault||(Object.create?function(p,e){Object.defineProperty(p,"default",{enumerable:!0,value:e})}:function(p,e){p.default=e}),i=this&&this.__importStar||function(p){if(p&&p.__esModule)return p;var e={};if(null!=p)for(var a in p)"default"!==a&&Object.prototype.hasOwnProperty.call(p,a)&&d(e,p,a);return m(e,p),e};Object.defineProperty(e,"__esModule",{value:!0}),e.CpuProfileEditorProvider=void 0;const l=i(a(496)),t=a(85),s=a(650),o=a(79),r=a(802),n=a(49),v=a(864);e.CpuProfileEditorProvider=class{constructor(p,e,a={}){this.lens=p,this.bundle=e,this.extraConsts=a,this.onDidChangeCustomDocument=(new l.EventEmitter).event}async openCustomDocument(p){const e=await l.workspace.fs.readFile(p),a=JSON.parse((new TextDecoder).decode(e)),d=new o.ReadonlyCustomDocument(p,(0,v.buildModel)(a)),m=new n.CpuProfileAnnotations,i=d.userData.rootPath;for(const p of d.userData.locations)m.add(i,p);return this.lens.registerLenses(m),d}async resolveCustomEditor(p,e){e.webview.onDidReceiveMessage((e=>{var a;switch(e.type){case"openDocument":return void(0,s.openLocation)({rootPath:null===(a=p.userData)||void 0===a?void 0:a.rootPath,viewColumn:e.toSide?l.ViewColumn.Beside:l.ViewColumn.Active,callFrame:e.callFrame,location:e.location});case"reopenWith":return void(0,r.reopenWithEditor)(p.uri,e.viewType,e.requireExtension);default:console.warn(`Unknown request from webview: ${JSON.stringify(e)}`)}})),e.webview.options={enableScripts:!0},e.webview.html=await(0,t.bundlePage)(e.webview.asWebviewUri(this.bundle),{MODEL:p.userData,...this.extraConsts})}async saveCustomDocument(){}async revertCustomDocument(){}async backupCustomDocument(){return{id:"",delete:()=>{}}}saveCustomDocumentAs(p,e){return l.workspace.fs.copy(p.uri,e,{overwrite:!0})}}},864:(p,e,a)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.buildModel=void 0;const d=a(639),m=a(460),i=a(561),l=(p,e)=>{const a=e[p];if(a.aggregateTime)return a.aggregateTime;let d=a.selfTime;for(const p of a.children)d+=l(p,e);return a.aggregateTime=d};e.buildModel=p=>{var e,a,t;if(!p.timeDeltas||!p.samples)return{nodes:[],locations:[],samples:p.samples||[],timeDeltas:p.timeDeltas||[],rootPath:null===(e=p.$vscode)||void 0===e?void 0:e.rootPath,duration:p.endTime-p.startTime};const{samples:s,timeDeltas:o}=p,r=(p=>{var e;if(p.$vscode)return p.$vscode.locations;let a=0;const d=new Map,m=p=>{const e=[p.functionName,p.url,p.scriptId,p.lineNumber,p.columnNumber].join(":"),m=d.get(e);if(m)return m.id;const l=a++;return d.set(e,{id:l,callFrame:p,location:{lineNumber:p.lineNumber+1,columnNumber:p.columnNumber+1,source:{name:(0,i.maybeFileUrlToPath)(p.url),path:(0,i.maybeFileUrlToPath)(p.url),sourceReference:0}}}),l};for(const a of p.nodes)a.locationId=m(a.callFrame),a.positionTicks=null===(e=a.positionTicks)||void 0===e?void 0:e.map((p=>({...p,startLocationId:m({...a.callFrame,lineNumber:p.line-1,columnNumber:0}),endLocationId:m({...a.callFrame,lineNumber:p.line,columnNumber:0})})));return[...d.values()].sort(((p,e)=>p.id-e.id)).map((p=>({locations:[p.location],callFrame:p.callFrame})))})(p),n=r.map(((e,a)=>{const i=(0,m.getBestLocation)(p,e.locations);return{id:a,selfTime:0,aggregateTime:0,ticks:0,category:(0,d.categorize)(e.callFrame,i),callFrame:e.callFrame,src:i}})),v=new Map,u=p=>{let e=v.get(p);return void 0===e&&(e=v.size,v.set(p,e)),e},c=new Array(p.nodes.length);for(let e=0;e<p.nodes.length;e++){const d=p.nodes[e],m=u(d.id);c[m]={id:m,selfTime:0,aggregateTime:0,locationId:d.locationId,children:(null===(a=d.children)||void 0===a?void 0:a.map(u))||[]};for(const p of d.positionTicks||[])p.startLocationId&&(n[p.startLocationId].ticks+=p.ticks)}for(const p of c)for(const e of p.children)c[e].parent=p.id;const h=p.endTime-p.startTime;let w=h-o[0];for(let p=0;p<o.length-1;p++){const e=o[p+1];c[u(s[p])].selfTime+=e,w-=e}c.length&&(c[u(s[o.length-1])].selfTime+=w,o.push(w));for(let p=0;p<c.length;p++){const e=c[p],a=n[e.locationId];a.aggregateTime+=l(p,c),a.selfTime+=e.selfTime}return{nodes:c,locations:n,samples:s.map(u),timeDeltas:o,rootPath:null===(t=p.$vscode)||void 0===t?void 0:t.rootPath,duration:h}}},354:function(p,e,a){"use strict";var d=this&&this.__createBinding||(Object.create?function(p,e,a,d){void 0===d&&(d=a);var m=Object.getOwnPropertyDescriptor(e,a);m&&!("get"in m?!e.__esModule:m.writable||m.configurable)||(m={enumerable:!0,get:function(){return e[a]}}),Object.defineProperty(p,d,m)}:function(p,e,a,d){void 0===d&&(d=a),p[d]=e[a]}),m=this&&this.__setModuleDefault||(Object.create?function(p,e){Object.defineProperty(p,"default",{enumerable:!0,value:e})}:function(p,e){p.default=e}),i=this&&this.__importStar||function(p){if(p&&p.__esModule)return p;var e={};if(null!=p)for(var a in p)"default"!==a&&Object.prototype.hasOwnProperty.call(p,a)&&d(e,p,a);return m(e,p),e},l=this&&this.__importDefault||function(p){return p&&p.__esModule?p:{default:p}};Object.defineProperty(e,"__esModule",{value:!0}),e.DownloadFileProvider=void 0;const t=i(a(496)),s=l(a(96));class o{async provideTextDocumentContent(p){return t.window.withProgress({location:t.ProgressLocation.Notification,title:`Retrieving ${p.query}...`},(async()=>{try{const e=await(0,s.default)(p.query,{}),a=await e.text();return e.ok?a:`Unexpected ${e.status} from ${p.query}: ${a}`}catch(p){return p.message}}))}}e.DownloadFileProvider=o,o.scheme="js-viz-download"},460:(p,e,a)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getBestLocation=void 0;const d=a(59);e.getBestLocation=(p,e=[])=>{var a;if(!(null===(a=p.$vscode)||void 0===a?void 0:a.rootPath))return e[0];for(const a of e){const e=(0,d.addRelativeDiskPath)(p.$vscode.rootPath,a);if(e.relativePath)return e}return e[0]}},583:(p,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.decimalFormat=void 0,e.decimalFormat=new Intl.NumberFormat(void 0,{maximumFractionDigits:0,minimumFractionDigits:0})},849:function(p,e,a){"use strict";var d=this&&this.__createBinding||(Object.create?function(p,e,a,d){void 0===d&&(d=a);var m=Object.getOwnPropertyDescriptor(e,a);m&&!("get"in m?!e.__esModule:m.writable||m.configurable)||(m={enumerable:!0,get:function(){return e[a]}}),Object.defineProperty(p,d,m)}:function(p,e,a,d){void 0===d&&(d=a),p[d]=e[a]}),m=this&&this.__setModuleDefault||(Object.create?function(p,e){Object.defineProperty(p,"default",{enumerable:!0,value:e})}:function(p,e){p.default=e}),i=this&&this.__importStar||function(p){if(p&&p.__esModule)return p;var e={};if(null!=p)for(var a in p)"default"!==a&&Object.prototype.hasOwnProperty.call(p,a)&&d(e,p,a);return m(e,p),e};Object.defineProperty(e,"__esModule",{value:!0}),e.HeapProfileEditorProvider=void 0;const l=i(a(496)),t=a(85),s=a(650),o=a(79),r=a(802),n=a(227),v=a(970),u=a(242);e.HeapProfileEditorProvider=class{constructor(p,e,a={}){this.lens=p,this.bundle=e,this.extraConsts=a,this.onDidChangeCustomDocument=(new l.EventEmitter).event}async openCustomDocument(p){const e=await l.workspace.fs.readFile(p),a=JSON.parse((new TextDecoder).decode(e)),d=new o.ReadonlyCustomDocument(p,(0,v.buildModel)(a)),m=(0,u.createTree)(d.userData),i=[m];let t=[m];for(;t.length;){const p=t.pop();p&&(i.push(p),t=t.concat(Object.values(p.children)))}const s=new n.HeapProfileAnnotations,r=d.userData.rootPath;for(const p of i)s.add(r,p);return this.lens.registerLenses(s),d}async resolveCustomEditor(p,e){e.webview.onDidReceiveMessage((e=>{switch(e.type){case"openDocument":return void(0,s.openLocation)({rootPath:void 0,viewColumn:e.toSide?l.ViewColumn.Beside:l.ViewColumn.Active,callFrame:e.callFrame,location:e.location});case"reopenWith":return void(0,r.reopenWithEditor)(p.uri,e.viewType,e.requireExtension);default:console.warn(`Unknown request from webview: ${JSON.stringify(e)}`)}})),e.webview.options={enableScripts:!0},e.webview.html=await(0,t.bundlePage)(e.webview.asWebviewUri(this.bundle),{MODEL:p.userData,...this.extraConsts})}async saveCustomDocument(){}async revertCustomDocument(){}async backupCustomDocument(){return{id:"",delete:()=>{}}}saveCustomDocumentAs(p,e){return l.workspace.fs.copy(p.uri,e,{overwrite:!0})}}},227:(p,e,a)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.HeapProfileAnnotations=void 0;const d=a(496),m=a(561),i=a(127),l=a(583);class t extends i.ProfileAnnotations{constructor(){super(...arguments),this.data=new Map}set(p,e,a){var i;let l=this.data.get((0,m.lowerCaseInsensitivePath)(p));l||(l=[],this.data.set((0,m.lowerCaseInsensitivePath)(p),l));let t=0;for(;t<l.length&&l[t].position.line<e.line;)t++;if((null===(i=l[t])||void 0===i?void 0:i.position.line)===e.line){const p=l[t];e.character<p.position.character&&(p.position=new d.Position(e.line,e.character)),p.data.totalSize+=a.totalSize,p.data.selfSize+=a.selfSize}else l.splice(t,0,{position:new d.Position(e.line,e.character),data:{totalSize:a.totalSize,selfSize:a.selfSize}})}getLensesForFile(p){var e,a;return this.expandForFile(p),null!==(a=null===(e=this.data.get((0,m.lowerCaseInsensitivePath)(p)))||void 0===e?void 0:e.map((({position:p,data:e})=>{if(0===e.totalSize&&0===e.selfSize)return[];const a=new d.Range(p,p);return[new d.CodeLens(a,{title:`${l.decimalFormat.format(e.selfSize/1e3)}kB Self Size, ${l.decimalFormat.format(e.totalSize/1e3)}kB Total Size`,command:""}),new d.CodeLens(a,{title:"Clear",command:"extension.jsProfileVisualizer.table.clearCodeLenses"})]})).reduce(((p,e)=>[...p,...e]),[]))&&void 0!==a?a:[]}}e.HeapProfileAnnotations=t},970:(p,e,a)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.buildModel=void 0;const d=a(460),m=a(561);e.buildModel=p=>{var e;let a=[p.head];const i=(p=>{if(p.$vscode)return p.$vscode.locations;let e=0;const a=new Map,d=p=>{const d=[p.functionName,p.url,p.scriptId,p.lineNumber,p.columnNumber].join(":"),i=a.get(d);if(i)return i.id;const l=e++;return a.set(d,{id:l,callFrame:p,location:{lineNumber:p.lineNumber+1,columnNumber:p.columnNumber+1,source:{name:(0,m.maybeFileUrlToPath)(p.url),path:(0,m.maybeFileUrlToPath)(p.url),sourceReference:0}}}),l};let i=[p.head];for(;i.length;){const p=i.pop();if(p){const{callFrame:e}=p;p.locationId=d(e),i=i.concat(p.children)}}return[...a.values()].sort(((p,e)=>p.id-e.id)).map((p=>({locations:[p.location],callFrame:p.callFrame})))})(p);for(;a.length;){const e=a.pop();e&&(e.locationId&&(e.src=(0,d.getBestLocation)(p,i[e.locationId].locations)),a=a.concat(e.children))}return{head:p.head,samples:p.samples,rootPath:null===(e=p.$vscode)||void 0===e?void 0:e.rootPath}}},242:(p,e,a)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.createTree=e.TreeNode=void 0;const d=a(639);class m{constructor(p,e){this.node=p,this.parent=e,this.children={},this.totalSize=0,this.selfSize=0,this.childrenSize=0,this.category=(0,d.categorize)(p.callFrame,void 0)}static root(){return new m({id:-1,selfSize:0,children:[],callFrame:{functionName:"(root)",lineNumber:-1,columnNumber:-1,scriptId:"0",url:""}})}get id(){return this.node.id}get callFrame(){return this.node.callFrame}get src(){return this.node.src}toJSON(){return{category:this.category,children:this.children,childrenSize:this.childrenSize,selfSize:this.selfSize,totalSize:this.totalSize,id:this.id,callFrame:this.callFrame,src:this.src}}}e.TreeNode=m;const i=(p,e)=>{const a=new m(p,e);p.children.forEach((p=>{const e=i(p,a);a.children[e.id]=e,a.childrenSize++})),a.selfSize=p.selfSize,a.totalSize=p.selfSize;for(const p in a.children)a.totalSize+=a.children[p].totalSize;return a};e.createTree=p=>{const e=m.root();for(const a of p.head.children){const p=i(a,e);e.children[p.id]=p,e.childrenSize++}for(const p in e.children)e.totalSize+=e.children[p].totalSize;return e}},59:(p,e,a)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.addRelativeDiskPath=void 0;const d=a(561);e.addRelativeDiskPath=(p,e)=>e.source.path&&0===e.source.sourceReference?{...e,relativePath:(0,d.properRelative)(p,e.source.path)}:e},412:(p,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.nonceHeader=e.makeNonce=void 0;const a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";e.makeNonce=function(p=32){let e="";for(let d=0;d<p;d++)e+=a[Math.floor(Math.random()*a.length)];return e},e.nonceHeader=p=>`<meta http-equiv="Content-Security-Policy" content="default-src 'none'; style-src 'unsafe-inline'; script-src 'nonce-${p}';">`},650:function(p,e,a){"use strict";var d=this&&this.__createBinding||(Object.create?function(p,e,a,d){void 0===d&&(d=a);var m=Object.getOwnPropertyDescriptor(e,a);m&&!("get"in m?!e.__esModule:m.writable||m.configurable)||(m={enumerable:!0,get:function(){return e[a]}}),Object.defineProperty(p,d,m)}:function(p,e,a,d){void 0===d&&(d=a),p[d]=e[a]}),m=this&&this.__setModuleDefault||(Object.create?function(p,e){Object.defineProperty(p,"default",{enumerable:!0,value:e})}:function(p,e){p.default=e}),i=this&&this.__importStar||function(p){if(p&&p.__esModule)return p;var e={};if(null!=p)for(var a in p)"default"!==a&&Object.prototype.hasOwnProperty.call(p,a)&&d(e,p,a);return m(e,p),e};Object.defineProperty(e,"__esModule",{value:!0}),e.getCandidateDiskPaths=e.openLocation=void 0;const l=a(37),t=a(17),s=i(a(496)),o=a(354),r=a(561),n=async p=>{try{return await s.workspace.fs.stat(s.Uri.file(p)),!0}catch{return!1}};e.openLocation=async({rootPath:p,location:e,viewColumn:a,callFrame:d})=>{e&&await u(p,e,a)||d&&await c(d,a)||s.window.showErrorMessage("Could not find the file in your workspace")};const v=async(p,e,a,d)=>{const m=new s.Position(Math.max(0,e-1),Math.max(0,a-1));await s.window.showTextDocument(p,{viewColumn:d,selection:new s.Range(m,m)})},u=async(p,a,d)=>{const m=(0,e.getCandidateDiskPaths)(p,a.source),i=(await Promise.all(m.map(n))).findIndex((p=>p));if(-1===i)return!1;const l=await s.workspace.openTextDocument(s.Uri.file(m[i]));return await v(l,a.lineNumber,a.columnNumber,d),!0},c=async({url:p,lineNumber:e,columnNumber:a},d)=>{var m,i;let r;try{r=new URL(p)}catch{return!1}if("http:"!==r.protocol&&"https:"!==r.protocol)return!1;const n=(0,t.resolve)(null!==(i=null===(m=s.workspace.workspaceFolders)||void 0===m?void 0:m[0].uri.fsPath)&&void 0!==i?i:(0,l.tmpdir)(),r.pathname.slice(1)||"index.js"),u=await s.workspace.openTextDocument(s.Uri.file(n).with({scheme:o.DownloadFileProvider.scheme,query:p}));return await v(u,e+1,a+1,d),!0};e.getCandidateDiskPaths=(p,e)=>{var a;if(!e.path)return[];const d=[e.path];if(!p)return d;for(const m of null!==(a=s.workspace.workspaceFolders)&&void 0!==a?a:[])d.push((0,t.resolve)(m.uri.fsPath,(0,r.properRelative)(p,e.path)));return d}},561:function(p,e,a){"use strict";var d=this&&this.__createBinding||(Object.create?function(p,e,a,d){void 0===d&&(d=a);var m=Object.getOwnPropertyDescriptor(e,a);m&&!("get"in m?!e.__esModule:m.writable||m.configurable)||(m={enumerable:!0,get:function(){return e[a]}}),Object.defineProperty(p,d,m)}:function(p,e,a,d){void 0===d&&(d=a),p[d]=e[a]}),m=this&&this.__setModuleDefault||(Object.create?function(p,e){Object.defineProperty(p,"default",{enumerable:!0,value:e})}:function(p,e){p.default=e}),i=this&&this.__importStar||function(p){if(p&&p.__esModule)return p;var e={};if(null!=p)for(var a in p)"default"!==a&&Object.prototype.hasOwnProperty.call(p,a)&&d(e,p,a);return m(e,p),e};Object.defineProperty(e,"__esModule",{value:!0}),e.isWindowsPath=e.maybeFileUrlToPath=e.lowerCaseInsensitivePath=e.getCaseSensitivePaths=e.setCaseSensitivePaths=e.resetCaseSensitivePaths=e.properRelative=void 0;const l=i(a(17));e.properRelative=function(p,e){var a,d;return(null===(a=l.posix)||void 0===a?void 0:a.isAbsolute(p))?l.posix.relative(p,e):(null===(d=l.win32)||void 0===d?void 0:d.isAbsolute(p))?l.win32.relative(p,e):l.relative(p,e)};let t="win32"!==process.platform;e.resetCaseSensitivePaths=function(){t="win32"!==process.platform},e.setCaseSensitivePaths=function(p){t=p},e.getCaseSensitivePaths=function(){return t},e.lowerCaseInsensitivePath=function(p){return t?p:p.toLowerCase()},e.maybeFileUrlToPath=function(p){return p.startsWith("file:///")?(p=p.replace("file:///",""),"/"===(p=decodeURIComponent(p))[0]||p.match(/^[A-Za-z]:/)||(p="/"+p),