(function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/",n(n.s="f19f")})({"30db":function(e,t,n){"use strict";(function(e,r){n.d(t,"c",function(){return m}),n.d(t,"b",function(){return g}),n.d(t,"a",function(){return y});var i="en",o=!1,a=!1,s=!1,u=!1,c=void 0,l=void 0,f="undefined"!==typeof e&&"undefined"!==typeof e.versions&&"undefined"!==typeof e.versions.electron&&"renderer"===e.type;if("object"!==typeof navigator||f){if("object"===typeof e){o="win32"===e.platform,a="darwin"===e.platform,s="linux"===e.platform,c=i,i;var h=Object({VUE_APP_BUILD_ENV:"emqx",NODE_ENV:"production",BASE_URL:"/"})["VSCODE_NLS_CONFIG"];if(h)try{var d=JSON.parse(h),p=d.availableLanguages["*"];c=d.locale,p||i,d._translationsConfigFile}catch(b){}!0}}else l=navigator.userAgent,o=l.indexOf("Windows")>=0,a=l.indexOf("Macintosh")>=0,s=l.indexOf("Linux")>=0,u=!0,c=navigator.language,c;var m=o,g=u,v="object"===typeof self?self:"object"===typeof r?r:{},y=v}).call(this,n("f28c"),n("c8ba"))},5110:function(e,t,n){(function(e){ /*! Copyright (c) 2014 Taylor Hakes Copyright (c) 2014 Forbes Lindesay */ (function(e,t){t()})(0,function(){"use strict";function t(e){var t=this.constructor;return this.then(function(n){return t.resolve(e()).then(function(){return n})},function(n){return t.resolve(e()).then(function(){return t.reject(n)})})}var n=setTimeout;function r(){}function i(e,t){return function(){e.apply(t,arguments)}}function o(e){if(!(this instanceof o))throw new TypeError("Promises must be constructed via new");if("function"!==typeof e)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],f(e,this)}function a(e,t){while(3===e._state)e=e._value;0!==e._state?(e._handled=!0,o._immediateFn(function(){var n=1===e._state?t.onFulfilled:t.onRejected;if(null!==n){var r;try{r=n(e._value)}catch(i){return void u(t.promise,i)}s(t.promise,r)}else(1===e._state?s:u)(t.promise,e._value)})):e._deferreds.push(t)}function s(e,t){try{if(t===e)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"===typeof t||"function"===typeof t)){var n=t.then;if(t instanceof o)return e._state=3,e._value=t,void c(e);if("function"===typeof n)return void f(i(n,t),e)}e._state=1,e._value=t,c(e)}catch(r){u(e,r)}}function u(e,t){e._state=2,e._value=t,c(e)}function c(e){2===e._state&&0===e._deferreds.length&&o._immediateFn(function(){e._handled||o._unhandledRejectionFn(e._value)});for(var t=0,n=e._deferreds.length;t=0}var a=/^\w[\w\d+.-]*$/,s=/^\//,u=/^\/\//,c=!0;function l(e,t){if(!e.scheme&&(t||c))throw new Error('[UriError]: Scheme is missing: {scheme: "", authority: "'+e.authority+'", path: "'+e.path+'", query: "'+e.query+'", fragment: "'+e.fragment+'"}');if(e.scheme&&!a.test(e.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(e.path)if(e.authority){if(!s.test(e.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(u.test(e.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}function f(e,t){return t||c?e||p:(e||(e="file"),e)}function h(e,t){switch(e){case"https":case"http":case"file":t?t[0]!==m&&(t=m+t):t=m;break}return t}var d,p="",m="/",g=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/,v=function(){function e(e,t,n,r,i,o){void 0===o&&(o=!1),"object"===typeof e?(this.scheme=e.scheme||p,this.authority=e.authority||p,this.path=e.path||p,this.query=e.query||p,this.fragment=e.fragment||p):(this.scheme=f(e,o),this.authority=t||p,this.path=h(this.scheme,n||p),this.query=r||p,this.fragment=i||p,l(this,o))}return e.isUri=function(t){return t instanceof e||!!t&&("string"===typeof t.authority&&"string"===typeof t.fragment&&"string"===typeof t.path&&"string"===typeof t.query&&"string"===typeof t.scheme&&"function"===typeof t.fsPath&&"function"===typeof t.with&&"function"===typeof t.toString)},Object.defineProperty(e.prototype,"fsPath",{get:function(){return E(this)},enumerable:!0,configurable:!0}),e.prototype.with=function(e){if(!e)return this;var t=e.scheme,n=e.authority,r=e.path,i=e.query,o=e.fragment;return void 0===t?t=this.scheme:null===t&&(t=p),void 0===n?n=this.authority:null===n&&(n=p),void 0===r?r=this.path:null===r&&(r=p),void 0===i?i=this.query:null===i&&(i=p),void 0===o?o=this.fragment:null===o&&(o=p),t===this.scheme&&n===this.authority&&r===this.path&&i===this.query&&o===this.fragment?this:new b(t,n,r,i,o)},e.parse=function(e,t){void 0===t&&(t=!1);var n=g.exec(e);return n?new b(n[2]||p,decodeURIComponent(n[4]||p),decodeURIComponent(n[5]||p),decodeURIComponent(n[7]||p),decodeURIComponent(n[9]||p),t):new b(p,p,p,p,p)},e.file=function(e){var t=p;if(r&&(e=e.replace(/\\/g,m)),e[0]===m&&e[1]===m){var n=e.indexOf(m,2);-1===n?(t=e.substring(2),e=m):(t=e.substring(2,n),e=e.substring(n)||m)}return new b("file",t,e,p,p)},e.from=function(e){return new b(e.scheme,e.authority,e.path,e.query,e.fragment)},e.prototype.toString=function(e){return void 0===e&&(e=!1),w(this,e)},e.prototype.toJSON=function(){return this},e.revive=function(t){if(t){if(t instanceof e)return t;var n=new b(t);return n._formatted=t.external,n._fsPath=t._sep===y?t.fsPath:null,n}return t},e}(),y=r?1:void 0,b=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._formatted=null,t._fsPath=null,t}return i(t,e),Object.defineProperty(t.prototype,"fsPath",{get:function(){return this._fsPath||(this._fsPath=E(this)),this._fsPath},enumerable:!0,configurable:!0}),t.prototype.toString=function(e){return void 0===e&&(e=!1),e?w(this,!0):(this._formatted||(this._formatted=w(this,!1)),this._formatted)},t.prototype.toJSON=function(){var e={$mid:1};return this._fsPath&&(e.fsPath=this._fsPath,e._sep=y),this._formatted&&(e.external=this._formatted),this.path&&(e.path=this.path),this.scheme&&(e.scheme=this.scheme),this.authority&&(e.authority=this.authority),this.query&&(e.query=this.query),this.fragment&&(e.fragment=this.fragment),e},t}(v),_=(d={},d[58]="%3A",d[47]="%2F",d[63]="%3F",d[35]="%23",d[91]="%5B",d[93]="%5D",d[64]="%40",d[33]="%21",d[36]="%24",d[38]="%26",d[39]="%27",d[40]="%28",d[41]="%29",d[42]="%2A",d[43]="%2B",d[44]="%2C",d[59]="%3B",d[61]="%3D",d[32]="%20",d);function C(e,t){for(var n=void 0,r=-1,i=0;i=97&&o<=122||o>=65&&o<=90||o>=48&&o<=57||45===o||46===o||95===o||126===o||t&&47===o)-1!==r&&(n+=encodeURIComponent(e.substring(r,i)),r=-1),void 0!==n&&(n+=e.charAt(i));else{void 0===n&&(n=e.substr(0,i));var a=_[o];void 0!==a?(-1!==r&&(n+=encodeURIComponent(e.substring(r,i)),r=-1),n+=a):-1===r&&(r=i)}}return-1!==r&&(n+=encodeURIComponent(e.substring(r))),void 0!==n?n:e}function S(e){for(var t=void 0,n=0;n1&&"file"===e.scheme?"//"+e.authority+e.path:47===e.path.charCodeAt(0)&&(e.path.charCodeAt(1)>=65&&e.path.charCodeAt(1)<=90||e.path.charCodeAt(1)>=97&&e.path.charCodeAt(1)<=122)&&58===e.path.charCodeAt(2)?e.path[1].toLowerCase()+e.path.substr(2):e.path,r&&(t=t.replace(/\//g,"\\")),t}function w(e,t){var n=t?S:C,r="",i=e.scheme,o=e.authority,a=e.path,s=e.query,u=e.fragment;if(i&&(r+=i,r+=":"),(o||"file"===i)&&(r+=m,r+=m),o){var c=o.indexOf("@");if(-1!==c){var l=o.substr(0,c);o=o.substr(c+1),c=l.indexOf(":"),-1===c?r+=n(l,!1):(r+=n(l.substr(0,c),!1),r+=":",r+=n(l.substr(c+1),!1)),r+="@"}o=o.toLowerCase(),c=o.indexOf(":"),-1===c?r+=n(o,!1):(r+=n(o.substr(0,c),!1),r+=o.substr(c))}if(a){if(a.length>=3&&47===a.charCodeAt(0)&&58===a.charCodeAt(2)){var f=a.charCodeAt(1);f>=65&&f<=90&&(a="/"+String.fromCharCode(f+32)+":"+a.substr(3))}else if(a.length>=2&&58===a.charCodeAt(1)){f=a.charCodeAt(0);f>=65&&f<=90&&(a=String.fromCharCode(f+32)+":"+a.substr(2))}r+=n(a,!0)}return s&&(r+="?",r+=n(s,!1)),u&&(r+="#",r+=t?u:C(u,!1)),r}}).call(this,n("f28c"))},c8ba:function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(r){"object"===typeof window&&(n=window)}e.exports=n},f19f:function(e,t,n){"use strict";n.r(t);var r=function(){function e(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(function(){if(e.stack)throw new Error(e.message+"\n\n"+e.stack);throw e},0)}}return e.prototype.emit=function(e){this.listeners.forEach(function(t){t(e)})},e.prototype.onUnexpectedError=function(e){this.unexpectedErrorHandler(e),this.emit(e)},e.prototype.onUnexpectedExternalError=function(e){this.unexpectedErrorHandler(e)},e}(),i=new r;function o(e){u(e)||i.onUnexpectedError(e)}function a(e){if(e instanceof Error){var t=e.name,n=e.message,r=e.stacktrace||e.stack;return{$isError:!0,name:t,message:n,stack:r}}return e}var s="Canceled";function u(e){return e instanceof Error&&e.name===s&&e.message===s}function c(e){return e?new Error("Illegal argument: "+e):new Error("Illegal argument")}var l=!1,f="__is_disposable_tracked__";function h(e){if(l&&e&&e!==y.None)try{e[f]=!0}catch(t){}}function d(e){if(!l)return e;var t=new Error("Potentially leaked disposable").stack;return setTimeout(function(){e[f]||console.log(t)},3e3),e}function p(e){return Array.isArray(e)?(e.forEach(function(e){e&&(h(e),e.dispose())}),[]):e?(h(e),e.dispose(),e):void 0}function m(){for(var e=[],t=0;tr?e[u]=o[s++]:s>i?e[u]=o[a++]:t(o[s],o[a])<0?e[u]=o[s++]:e[u]=o[a++]}function k(e,t,n,r,i){if(!(r<=n)){var o=n+(r-n)/2|0;k(e,t,n,o,i),k(e,t,o+1,r,i),t(e[o],e[o+1])<=0||L(e,t,n,o,r,i)}}var T=function(){function e(e,t,n,r){this.originalStart=e,this.originalLength=t,this.modifiedStart=n,this.modifiedLength=r}return e.prototype.getOriginalEnd=function(){return this.originalStart+this.originalLength},e.prototype.getModifiedEnd=function(){return this.modifiedStart+this.modifiedLength},e}();function O(e){return{getLength:function(){return e.length},getElementAtIndex:function(t){return e.charCodeAt(t)}}}function P(e,t,n){return new V(O(e),O(t)).ComputeDiff(n)}var I,M=function(){function e(){}return e.Assert=function(e,t){if(!e)throw new Error(t)},e}(),R=function(){function e(){}return e.Copy=function(e,t,n,r,i){for(var o=0;o0||this.m_modifiedCount>0)&&this.m_changes.push(new T(this.m_originalStart,this.m_originalCount,this.m_modifiedStart,this.m_modifiedCount)),this.m_originalCount=0,this.m_modifiedCount=0,this.m_originalStart=Number.MAX_VALUE,this.m_modifiedStart=Number.MAX_VALUE},e.prototype.AddOriginalElement=function(e,t){this.m_originalStart=Math.min(this.m_originalStart,e),this.m_modifiedStart=Math.min(this.m_modifiedStart,t),this.m_originalCount++},e.prototype.AddModifiedElement=function(e,t){this.m_originalStart=Math.min(this.m_originalStart,e),this.m_modifiedStart=Math.min(this.m_modifiedStart,t),this.m_modifiedCount++},e.prototype.getChanges=function(){return(this.m_originalCount>0||this.m_modifiedCount>0)&&this.MarkNextChange(),this.m_changes},e.prototype.getReverseChanges=function(){return(this.m_originalCount>0||this.m_modifiedCount>0)&&this.MarkNextChange(),this.m_changes.reverse(),this.m_changes},e}(),V=function(){function e(e,t,n){void 0===n&&(n=null),this.OriginalSequence=e,this.ModifiedSequence=t,this.ContinueProcessingPredicate=n,this.m_forwardHistory=[],this.m_reverseHistory=[]}return e.prototype.ElementsAreEqual=function(e,t){return this.OriginalSequence.getElementAtIndex(e)===this.ModifiedSequence.getElementAtIndex(t)},e.prototype.OriginalElementsAreEqual=function(e,t){return this.OriginalSequence.getElementAtIndex(e)===this.OriginalSequence.getElementAtIndex(t)},e.prototype.ModifiedElementsAreEqual=function(e,t){return this.ModifiedSequence.getElementAtIndex(e)===this.ModifiedSequence.getElementAtIndex(t)},e.prototype.ComputeDiff=function(e){return this._ComputeDiff(0,this.OriginalSequence.getLength()-1,0,this.ModifiedSequence.getLength()-1,e)},e.prototype._ComputeDiff=function(e,t,n,r,i){var o=[!1],a=this.ComputeDiffRecursive(e,t,n,r,o);return i?this.PrettifyChanges(a):a},e.prototype.ComputeDiffRecursive=function(e,t,n,r,i){i[0]=!1;while(e<=t&&n<=r&&this.ElementsAreEqual(e,n))e++,n++;while(t>=e&&r>=n&&this.ElementsAreEqual(t,r))t--,r--;if(e>t||n>r){var o=void 0;return n<=r?(M.Assert(e===t+1,"originalStart should only be one more than originalEnd"),o=[new T(e,0,n,r-n+1)]):e<=t?(M.Assert(n===r+1,"modifiedStart should only be one more than modifiedEnd"),o=[new T(e,t-e+1,n,0)]):(M.Assert(e===t+1,"originalStart should only be one more than originalEnd"),M.Assert(n===r+1,"modifiedStart should only be one more than modifiedEnd"),o=[]),o}var a=[0],s=[0],u=this.ComputeRecursionPoint(e,t,n,r,a,s,i),c=a[0],l=s[0];if(null!==u)return u;if(!i[0]){var f=this.ComputeDiffRecursive(e,c,n,l,i),h=[];return h=i[0]?[new T(c+1,t-(c+1)+1,l+1,r-(l+1)+1)]:this.ComputeDiffRecursive(c+1,t,l+1,r,i),this.ConcatenateChanges(f,h)}return[new T(e,t-e+1,n,r-n+1)]},e.prototype.WALKTRACE=function(e,t,n,r,i,o,a,s,u,c,l,f,h,d,p,m,g,v){var y,b=null,_=null,C=new F,S=t,E=n,w=h[0]-m[0]-r,x=Number.MIN_VALUE,N=this.m_forwardHistory.length-1;do{y=w+e,y===S||y=0&&(u=this.m_forwardHistory[N],e=u[0],S=1,E=u.length-1)}while(--N>=-1);if(b=C.getReverseChanges(),v[0]){var A=h[0]+1,L=m[0]+1;if(null!==b&&b.length>0){var k=b[b.length-1];A=Math.max(A,k.getOriginalEnd()),L=Math.max(L,k.getModifiedEnd())}_=[new T(A,f-A+1,L,p-L+1)]}else{C=new F,S=o,E=a,w=h[0]-m[0]-s,x=Number.MAX_VALUE,N=g?this.m_reverseHistory.length-1:this.m_reverseHistory.length-2;do{y=w+i,y===S||y=c[y+1]?(l=c[y+1]-1,d=l-w-s,l>x&&C.MarkNextChange(),x=l+1,C.AddOriginalElement(l+1,d+1),w=y+1-i):(l=c[y-1],d=l-w-s,l>x&&C.MarkNextChange(),x=l,C.AddModifiedElement(l+1,d+1),w=y-1-i),N>=0&&(c=this.m_reverseHistory[N],i=c[0],S=1,E=c.length-1)}while(--N>=-1);_=C.getChanges()}return this.ConcatenateChanges(b,_)},e.prototype.ComputeRecursionPoint=function(e,t,n,r,i,o,a){var s,u=0,c=0,l=0,f=0,h=0,d=0;e--,n--,i[0]=0,o[0]=0,this.m_forwardHistory=[],this.m_reverseHistory=[];var p,m,g=t-e+(r-n),v=g+1,y=new Array(v),b=new Array(v),_=r-n,C=t-e,S=e-n,E=t-r,w=C-_,x=w%2===0;for(y[_]=e,b[C]=t,a[0]=!1,s=1;s<=g/2+1;s++){var N=0,A=0;for(l=this.ClipDiagonalBound(_-s,s,_,v),f=this.ClipDiagonalBound(_+s,s,_,v),p=l;p<=f;p+=2){u=p===l||pN+A&&(N=u,A=c),!x&&Math.abs(p-C)<=s-1&&u>=b[p])return i[0]=u,o[0]=c,m<=b[p]&&j>0&&s<=j+1?this.WALKTRACE(_,l,f,S,C,h,d,E,y,b,u,t,i,c,r,o,x,a):null}var L=(N-e+(A-n)-s)/2;if(null!==this.ContinueProcessingPredicate&&!this.ContinueProcessingPredicate(N,this.OriginalSequence,L))return a[0]=!0,i[0]=N,o[0]=A,L>0&&j>0&&s<=j+1?this.WALKTRACE(_,l,f,S,C,h,d,E,y,b,u,t,i,c,r,o,x,a):(e++,n++,[new T(e,t-e+1,n,r-n+1)]);for(h=this.ClipDiagonalBound(C-s,s,C,v),d=this.ClipDiagonalBound(C+s,s,C,v),p=h;p<=d;p+=2){u=p===h||p=b[p+1]?b[p+1]-1:b[p-1],c=u-(p-C)-E,m=u;while(u>e&&c>n&&this.ElementsAreEqual(u,c))u--,c--;if(b[p]=u,x&&Math.abs(p-_)<=s&&u<=y[p])return i[0]=u,o[0]=c,m>=y[p]&&j>0&&s<=j+1?this.WALKTRACE(_,l,f,S,C,h,d,E,y,b,u,t,i,c,r,o,x,a):null}if(s<=j){var k=new Array(f-l+2);k[0]=_-l+1,R.Copy(y,l,k,1,f-l+1),this.m_forwardHistory.push(k),k=new Array(d-h+2),k[0]=C-h+1,R.Copy(b,h,k,1,d-h+1),this.m_reverseHistory.push(k)}}return this.WALKTRACE(_,l,f,S,C,h,d,E,y,b,u,t,i,c,r,o,x,a)},e.prototype.PrettifyChanges=function(e){for(var t=0;t0,a=n.modifiedLength>0;while(n.originalStart+n.originalLength=0;t--){n=e[t],r=0,i=0;if(t>0){var u=e[t-1];u.originalLength>0&&(r=u.originalStart+u.originalLength),u.modifiedLength>0&&(i=u.modifiedStart+u.modifiedLength)}o=n.originalLength>0,a=n.modifiedLength>0;for(var c=0,l=this._boundaryScore(n.originalStart,n.originalLength,n.modifiedStart,n.modifiedLength),f=1;;f++){var h=n.originalStart-f,d=n.modifiedStart-f;if(hl&&(l=p,c=f)}n.originalStart-=c,n.modifiedStart-=c}return e},e.prototype._OriginalIsBoundary=function(e){if(e<=0||e>=this.OriginalSequence.getLength()-1)return!0;var t=this.OriginalSequence.getElementAtIndex(e);return"string"===typeof t&&/^\s*$/.test(t)},e.prototype._OriginalRegionIsBoundary=function(e,t){if(this._OriginalIsBoundary(e)||this._OriginalIsBoundary(e-1))return!0;if(t>0){var n=e+t;if(this._OriginalIsBoundary(n-1)||this._OriginalIsBoundary(n))return!0}return!1},e.prototype._ModifiedIsBoundary=function(e){if(e<=0||e>=this.ModifiedSequence.getLength()-1)return!0;var t=this.ModifiedSequence.getElementAtIndex(e);return"string"===typeof t&&/^\s*$/.test(t)},e.prototype._ModifiedRegionIsBoundary=function(e,t){if(this._ModifiedIsBoundary(e)||this._ModifiedIsBoundary(e-1))return!0;if(t>0){var n=e+t;if(this._ModifiedIsBoundary(n-1)||this._ModifiedIsBoundary(n))return!0}return!1},e.prototype._boundaryScore=function(e,t,n,r){var i=this._OriginalRegionIsBoundary(e,t)?1:0,o=this._ModifiedRegionIsBoundary(n,r)?1:0;return i+o},e.prototype.ConcatenateChanges=function(e,t){var n=[];if(0===e.length||0===t.length)return t.length>0?t:e;if(this.ChangesOverlap(e[e.length-1],t[0],n)){var r=new Array(e.length+t.length-1);return R.Copy(e,0,r,0,e.length-1),r[e.length-1]=n[0],R.Copy(t,1,r,e.length,t.length-1),r}r=new Array(e.length+t.length);return R.Copy(e,0,r,0,e.length),R.Copy(t,0,r,e.length,t.length),r},e.prototype.ChangesOverlap=function(e,t,n){if(M.Assert(e.originalStart<=t.originalStart,"Left change is not less than or equal to right change"),M.Assert(e.modifiedStart<=t.modifiedStart,"Left change is not less than or equal to right change"),e.originalStart+e.originalLength>=t.originalStart||e.modifiedStart+e.modifiedLength>=t.modifiedStart){var r=e.originalStart,i=e.originalLength,o=e.modifiedStart,a=e.modifiedLength;return e.originalStart+e.originalLength>=t.originalStart&&(i=t.originalStart+t.originalLength-e.originalStart),e.modifiedStart+e.modifiedLength>=t.modifiedStart&&(a=t.modifiedStart+t.modifiedLength-e.modifiedStart),n[0]=new T(r,i,o,a),!0}return n[0]=null,!1},e.prototype.ClipDiagonalBound=function(e,t,n,r){if(e>=0&&e=n?U:{done:!1,value:e[t++]}}}}function o(t){return t?Array.isArray(t)?e.fromArray(t):t:e.empty()}function a(e,t){return{next:function(){var n=e.next();return n.done?U:{done:!1,value:t(n.value)}}}}function s(e,t){return{next:function(){while(1){var n=e.next();if(n.done)return U;if(t(n.value))return{done:!1,value:n.value}}}}}function u(e,t){for(var n=e.next();!n.done;n=e.next())t(n.value)}function c(e,t){void 0===t&&(t=Number.POSITIVE_INFINITY);var n=[];if(0===t)return n;for(var r=0,i=e.next();!i.done;i=e.next())if(n.push(i.value),++r>=t)break;return n}function l(){for(var e=[],t=0;t=e.length)return U;var t=e[n],r=t.next();return r.done?(n++,this.next()):r}}}e.empty=n,e.single=r,e.fromArray=i,e.from=o,e.map=a,e.filter=s,e.forEach=u,e.collect=c,e.concat=l})(I||(I={}));var q,K=function(){function e(e,t,n,r){void 0===t&&(t=0),void 0===n&&(n=e.length),void 0===r&&(r=t-1),this.items=e,this.start=t,this.end=n,this.index=r}return e.prototype.first=function(){return this.index=this.start,this.current()},e.prototype.next=function(){return this.index=Math.min(this.index+1,this.end),this.current()},e.prototype.current=function(){return this.index===this.start-1||this.index===this.end?null:this.items[this.index]},e}(),W=(function(e){function t(t,n,r,i){return void 0===n&&(n=0),void 0===r&&(r=t.length),void 0===i&&(i=n-1),e.call(this,t,n,r,i)||this}D(t,e),t.prototype.current=function(){return e.prototype.current.call(this)},t.prototype.previous=function(){return this.index=Math.max(this.index-1,this.start-1),this.current()},t.prototype.first=function(){return this.index=this.start,this.current()},t.prototype.last=function(){return this.index=this.end-1,this.current()},t.prototype.parent=function(){return null}}(K),function(){function e(e,t){this.iterator=e,this.fn=t}e.prototype.next=function(){return this.fn(this.iterator.next())}}(),function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),B=/^\w[\w\d+.-]*$/,$=/^\//,Y=/^\/\//,H=!0;function z(e,t){if(!e.scheme){if(t||H)throw new Error('[UriError]: Scheme is missing: {scheme: "", authority: "'+e.authority+'", path: "'+e.path+'", query: "'+e.query+'", fragment: "'+e.fragment+'"}');console.warn('[UriError]: Scheme is missing: {scheme: "", authority: "'+e.authority+'", path: "'+e.path+'", query: "'+e.query+'", fragment: "'+e.fragment+'"}')}if(e.scheme&&!B.test(e.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(e.path)if(e.authority){if(!$.test(e.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(Y.test(e.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}function G(e,t){return t||H?e||Q:(e||(console.trace("BAD uri lacks scheme, falling back to file-scheme."),e="file"),e)}function J(e,t){switch(e){case"https":case"http":case"file":t?t[0]!==X&&(t=X+t):t=X;break}return t}var Q="",X="/",Z=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/,ee=function(){function e(e,t,n,r,i,o){void 0===o&&(o=!1),"object"===typeof e?(this.scheme=e.scheme||Q,this.authority=e.authority||Q,this.path=e.path||Q,this.query=e.query||Q,this.fragment=e.fragment||Q):(this.scheme=G(e,o),this.authority=t||Q,this.path=J(this.scheme,n||Q),this.query=r||Q,this.fragment=i||Q,z(this,o))}return e.isUri=function(t){return t instanceof e||!!t&&("string"===typeof t.authority&&"string"===typeof t.fragment&&"string"===typeof t.path&&"string"===typeof t.query&&"string"===typeof t.scheme&&"function"===typeof t.fsPath&&"function"===typeof t.with&&"function"===typeof t.toString)},Object.defineProperty(e.prototype,"fsPath",{get:function(){return ae(this)},enumerable:!0,configurable:!0}),e.prototype.with=function(e){if(!e)return this;var t=e.scheme,n=e.authority,r=e.path,i=e.query,o=e.fragment;return void 0===t?t=this.scheme:null===t&&(t=Q),void 0===n?n=this.authority:null===n&&(n=Q),void 0===r?r=this.path:null===r&&(r=Q),void 0===i?i=this.query:null===i&&(i=Q),void 0===o?o=this.fragment:null===o&&(o=Q),t===this.scheme&&n===this.authority&&r===this.path&&i===this.query&&o===this.fragment?this:new ne(t,n,r,i,o)},e.parse=function(e,t){void 0===t&&(t=!1);var n=Z.exec(e);return n?new ne(n[2]||Q,decodeURIComponent(n[4]||Q),decodeURIComponent(n[5]||Q),decodeURIComponent(n[7]||Q),decodeURIComponent(n[9]||Q),t):new ne(Q,Q,Q,Q,Q)},e.file=function(e){var t=Q;if(b["c"]&&(e=e.replace(/\\/g,X)),e[0]===X&&e[1]===X){var n=e.indexOf(X,2);-1===n?(t=e.substring(2),e=X):(t=e.substring(2,n),e=e.substring(n)||X)}return new ne("file",t,e,Q,Q)},e.from=function(e){return new ne(e.scheme,e.authority,e.path,e.query,e.fragment)},e.prototype.toString=function(e){return void 0===e&&(e=!1),se(this,e)},e.prototype.toJSON=function(){return this},e.revive=function(t){if(t){if(t instanceof e)return t;var n=new ne(t);return n._formatted=t.external,n._fsPath=t._sep===te?t.fsPath:null,n}return t},e}(),te=b["c"]?1:void 0,ne=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._formatted=null,t._fsPath=null,t}return W(t,e),Object.defineProperty(t.prototype,"fsPath",{get:function(){return this._fsPath||(this._fsPath=ae(this)),this._fsPath},enumerable:!0,configurable:!0}),t.prototype.toString=function(e){return void 0===e&&(e=!1),e?se(this,!0):(this._formatted||(this._formatted=se(this,!1)),this._formatted)},t.prototype.toJSON=function(){var e={$mid:1};return this._fsPath&&(e.fsPath=this._fsPath,e._sep=te),this._formatted&&(e.external=this._formatted),this.path&&(e.path=this.path),this.scheme&&(e.scheme=this.scheme),this.authority&&(e.authority=this.authority),this.query&&(e.query=this.query),this.fragment&&(e.fragment=this.fragment),e},t}(ee),re=(q={},q[58]="%3A",q[47]="%2F",q[63]="%3F",q[35]="%23",q[91]="%5B",q[93]="%5D",q[64]="%40",q[33]="%21",q[36]="%24",q[38]="%26",q[39]="%27",q[40]="%28",q[41]="%29",q[42]="%2A",q[43]="%2B",q[44]="%2C",q[59]="%3B",q[61]="%3D",q[32]="%20",q);function ie(e,t){for(var n=void 0,r=-1,i=0;i=97&&o<=122||o>=65&&o<=90||o>=48&&o<=57||45===o||46===o||95===o||126===o||t&&47===o)-1!==r&&(n+=encodeURIComponent(e.substring(r,i)),r=-1),void 0!==n&&(n+=e.charAt(i));else{void 0===n&&(n=e.substr(0,i));var a=re[o];void 0!==a?(-1!==r&&(n+=encodeURIComponent(e.substring(r,i)),r=-1),n+=a):-1===r&&(r=i)}}return-1!==r&&(n+=encodeURIComponent(e.substring(r))),void 0!==n?n:e}function oe(e){for(var t=void 0,n=0;n1&&"file"===e.scheme?"//"+e.authority+e.path:47===e.path.charCodeAt(0)&&(e.path.charCodeAt(1)>=65&&e.path.charCodeAt(1)<=90||e.path.charCodeAt(1)>=97&&e.path.charCodeAt(1)<=122)&&58===e.path.charCodeAt(2)?e.path[1].toLowerCase()+e.path.substr(2):e.path,b["c"]&&(t=t.replace(/\//g,"\\")),t}function se(e,t){var n=t?oe:ie,r="",i=e.scheme,o=e.authority,a=e.path,s=e.query,u=e.fragment;if(i&&(r+=i,r+=":"),(o||"file"===i)&&(r+=X,r+=X),o){var c=o.indexOf("@");if(-1!==c){var l=o.substr(0,c);o=o.substr(c+1),c=l.indexOf(":"),-1===c?r+=n(l,!1):(r+=n(l.substr(0,c),!1),r+=":",r+=n(l.substr(c+1),!1)),r+="@"}o=o.toLowerCase(),c=o.indexOf(":"),-1===c?r+=n(o,!1):(r+=n(o.substr(0,c),!1),r+=o.substr(c))}if(a){if(a.length>=3&&47===a.charCodeAt(0)&&58===a.charCodeAt(2)){var f=a.charCodeAt(1);f>=65&&f<=90&&(a="/"+String.fromCharCode(f+32)+":"+a.substr(3))}else if(a.length>=2&&58===a.charCodeAt(1)){f=a.charCodeAt(0);f>=65&&f<=90&&(a=String.fromCharCode(f+32)+":"+a.substr(2))}r+=n(a,!0)}return s&&(r+="?",r+=n(s,!1)),u&&(r+="#",r+=t?u:ie(u,!1)),r}var ue=function(){function e(e,t){this.lineNumber=e,this.column=t}return e.prototype.with=function(t,n){return void 0===t&&(t=this.lineNumber),void 0===n&&(n=this.column),t===this.lineNumber&&n===this.column?this:new e(t,n)},e.prototype.delta=function(e,t){return void 0===e&&(e=0),void 0===t&&(t=0),this.with(this.lineNumber+e,this.column+t)},e.prototype.equals=function(t){return e.equals(this,t)},e.equals=function(e,t){return!e&&!t||!!e&&!!t&&e.lineNumber===t.lineNumber&&e.column===t.column},e.prototype.isBefore=function(t){return e.isBefore(this,t)},e.isBefore=function(e,t){return e.lineNumbern||e===n&&t>r?(this.startLineNumber=n,this.startColumn=r,this.endLineNumber=e,this.endColumn=t):(this.startLineNumber=e,this.startColumn=t,this.endLineNumber=n,this.endColumn=r)}return e.prototype.isEmpty=function(){return e.isEmpty(this)},e.isEmpty=function(e){return e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn},e.prototype.containsPosition=function(t){return e.containsPosition(this,t)},e.containsPosition=function(e,t){return!(t.lineNumbere.endLineNumber)&&(!(t.lineNumber===e.startLineNumber&&t.columne.endColumn))},e.prototype.containsRange=function(t){return e.containsRange(this,t)},e.containsRange=function(e,t){return!(t.startLineNumbere.endLineNumber||t.endLineNumber>e.endLineNumber)&&(!(t.startLineNumber===e.startLineNumber&&t.startColumne.endColumn)))},e.prototype.strictContainsRange=function(t){return e.strictContainsRange(this,t)},e.strictContainsRange=function(e,t){return!(t.startLineNumbere.endLineNumber||t.endLineNumber>e.endLineNumber)&&(!(t.startLineNumber===e.startLineNumber&&t.startColumn<=e.startColumn)&&!(t.endLineNumber===e.endLineNumber&&t.endColumn>=e.endColumn)))},e.prototype.plusRange=function(t){return e.plusRange(this,t)},e.plusRange=function(t,n){var r,i,o,a;return n.startLineNumbert.endLineNumber?(o=n.endLineNumber,a=n.endColumn):n.endLineNumber===t.endLineNumber?(o=n.endLineNumber,a=Math.max(n.endColumn,t.endColumn)):(o=t.endLineNumber,a=t.endColumn),new e(r,i,o,a)},e.prototype.intersectRanges=function(t){return e.intersectRanges(this,t)},e.intersectRanges=function(t,n){var r=t.startLineNumber,i=t.startColumn,o=t.endLineNumber,a=t.endColumn,s=n.startLineNumber,u=n.startColumn,c=n.endLineNumber,l=n.endColumn;return rc?(o=c,a=l):o===c&&(a=Math.min(a,l)),r>o?null:r===o&&i>a?null:new e(r,i,o,a)},e.prototype.equalsRange=function(t){return e.equalsRange(this,t)},e.equalsRange=function(e,t){return!!e&&!!t&&e.startLineNumber===t.startLineNumber&&e.startColumn===t.startColumn&&e.endLineNumber===t.endLineNumber&&e.endColumn===t.endColumn},e.prototype.getEndPosition=function(){return new ue(this.endLineNumber,this.endColumn)},e.prototype.getStartPosition=function(){return new ue(this.startLineNumber,this.startColumn)},e.prototype.toString=function(){return"["+this.startLineNumber+","+this.startColumn+" -> "+this.endLineNumber+","+this.endColumn+"]"},e.prototype.setEndPosition=function(t,n){return new e(this.startLineNumber,this.startColumn,t,n)},e.prototype.setStartPosition=function(t,n){return new e(t,n,this.endLineNumber,this.endColumn)},e.prototype.collapseToStart=function(){return e.collapseToStart(this)},e.collapseToStart=function(t){return new e(t.startLineNumber,t.startColumn,t.startLineNumber,t.startColumn)},e.fromPositions=function(t,n){return void 0===n&&(n=t),new e(t.lineNumber,t.column,n.lineNumber,n.column)},e.lift=function(t){return t?new e(t.startLineNumber,t.startColumn,t.endLineNumber,t.endColumn):null},e.isIRange=function(e){return e&&"number"===typeof e.startLineNumber&&"number"===typeof e.startColumn&&"number"===typeof e.endLineNumber&&"number"===typeof e.endColumn},e.areIntersectingOrTouching=function(e,t){return!(e.endLineNumbere.startLineNumber},e}();function le(e){for(var t=0,n=e.length;t=0;n--){var r=e.charCodeAt(n);if(32!==r&&9!==r)return n}return-1}String.fromCharCode(65279);var he=5e3,de=3;function pe(e,t,n,r){var i=new V(e,t,n);return i.ComputeDiff(r)}var me=function(){function e(t){for(var n=[],r=[],i=0,o=t.length;i1&&p>1){var m=f.charCodeAt(d-2),g=h.charCodeAt(p-2);if(m!==g)break;d--,p--}(d>1||p>1)&&this._pushTrimWhitespaceCharChange(i,o+1,1,d,a+1,1,p);var v=me._getLastNonBlankColumn(f,1),y=me._getLastNonBlankColumn(h,1),b=f.length+1,_=h.length+1;while(v255?255:0|e}function Ee(e){return e<0?0:e>4294967295?4294967295:0|e}var we=function(){function e(e,t){this.index=e,this.remainder=t}return e}(),xe=function(){function e(e){this.values=e,this.prefixSum=new Uint32Array(e.length),this.prefixSumValidIndex=new Int32Array(1),this.prefixSumValidIndex[0]=-1}return e.prototype.getCount=function(){return this.values.length},e.prototype.insertValues=function(e,t){e=Ee(e);var n=this.values,r=this.prefixSum,i=t.length;return 0!==i&&(this.values=new Uint32Array(n.length+i),this.values.set(n.subarray(0,e),0),this.values.set(n.subarray(e),e+i),this.values.set(t,e),e-1=0&&this.prefixSum.set(r.subarray(0,this.prefixSumValidIndex[0]+1)),!0)},e.prototype.changeValue=function(e,t){return e=Ee(e),t=Ee(t),this.values[e]!==t&&(this.values[e]=t,e-1=n.length)return!1;var i=n.length-e;return t>=i&&(t=i),0!==t&&(this.values=new Uint32Array(n.length-t),this.values.set(n.subarray(0,e),0),this.values.set(n.subarray(e+t),e),this.prefixSum=new Uint32Array(this.values.length),e-1=0&&this.prefixSum.set(r.subarray(0,this.prefixSumValidIndex[0]+1)),!0)},e.prototype.getTotalValue=function(){return 0===this.values.length?0:this._getAccumulatedValue(this.values.length-1)},e.prototype.getAccumulatedValue=function(e){return e<0?0:(e=Ee(e),this._getAccumulatedValue(e))},e.prototype._getAccumulatedValue=function(e){if(e<=this.prefixSumValidIndex[0])return this.prefixSum[e];var t=this.prefixSumValidIndex[0]+1;0===t&&(this.prefixSum[0]=this.values[0],t++),e>=this.values.length&&(e=this.values.length-1);for(var n=t;n<=e;n++)this.prefixSum[n]=this.prefixSum[n-1]+this.values[n];return this.prefixSumValidIndex[0]=Math.max(this.prefixSumValidIndex[0],e),this.prefixSum[e]},e.prototype.getIndexOf=function(e){e=Math.floor(e),this.getTotalValue();var t=0,n=this.values.length-1,r=0,i=0,o=0;while(t<=n)if(r=t+(n-t)/2|0,i=this.prefixSum[r],o=i-this.values[r],e=i))break;t=r+1}return new we(r,e-o)},e}(),Ne=(function(){function e(e){this._cacheAccumulatedValueStart=0,this._cache=null,this._actual=new xe(e),this._bustCache()}e.prototype._bustCache=function(){this._cacheAccumulatedValueStart=0,this._cache=null},e.prototype.insertValues=function(e,t){this._actual.insertValues(e,t)&&this._bustCache()},e.prototype.changeValue=function(e,t){this._actual.changeValue(e,t)&&this._bustCache()},e.prototype.removeValues=function(e,t){this._actual.removeValues(e,t)&&this._bustCache()},e.prototype.getTotalValue=function(){return this._actual.getTotalValue()},e.prototype.getAccumulatedValue=function(e){return this._actual.getAccumulatedValue(e)},e.prototype.getIndexOf=function(e){if(e=Math.floor(e),null!==this._cache){var t=e-this._cacheAccumulatedValueStart;if(t>=0&&t/?";function Le(e){void 0===e&&(e="");for(var t="(-?\\d*\\.\\d\\w*)|([^",n=0,r=Ae;n=0||(t+="\\"+i)}return t+="\\s]+)",new RegExp(t,"g")}var ke=Le();function Te(e){var t=ke;if(e&&e instanceof RegExp)if(e.global)t=e;else{var n="g";e.ignoreCase&&(n+="i"),e.multiline&&(n+="m"),e.unicode&&(n+="u"),t=new RegExp(e.source,n)}return t.lastIndex=0,t}function Oe(e,t,n,r){var i,o=e-1-r,a=n.lastIndexOf(" ",o-1)+1;t.lastIndex=a;while(i=t.exec(n)){var s=i.index||0;if(s<=o&&t.lastIndex>=o)return{word:i[0],startColumn:r+1+s,endColumn:r+1+t.lastIndex}}return null}function Pe(e,t,n,r){var i,o=e-1-r;t.lastIndex=0;while(i=t.exec(n)){var a=i.index||0;if(a>o)return null;if(t.lastIndex>=o)return{word:i[0],startColumn:r+1+a,endColumn:r+1+t.lastIndex}}return null}function Ie(e,t,n,r){t.lastIndex=0;var i=t.exec(n);if(!i)return null;var o=i[0].indexOf(" ")>=0?Pe(e,t,n,r):Oe(e,t,n,r);return t.lastIndex=0,o}var Me=function(){function e(t){var n=Se(t);this._defaultValue=n,this._asciiMap=e._createAsciiMap(n),this._map=new Map}return e._createAsciiMap=function(e){for(var t=new Uint8Array(256),n=0;n<256;n++)t[n]=e;return t},e.prototype.set=function(e,t){var n=Se(t);e>=0&&e<256?this._asciiMap[e]=n:this._map.set(e,n)},e.prototype.get=function(e){return e>=0&&e<256?this._asciiMap[e]:this._map.get(e)||this._defaultValue},e}(),Re=(function(){function e(){this._actual=new Me(0)}e.prototype.add=function(e){this._actual.set(e,1)},e.prototype.has=function(e){return 1===this._actual.get(e)}}(),function(){function e(e){for(var t=0,n=0,r=0,i=e.length;rt&&(t=s),a>n&&(n=a),u>n&&(n=u)}t++,n++;var c=new Ce(n,t,0);for(r=0,i=e.length;r=this._maxCharCode?0:this._states.get(e,t)},e}()),je=null;function Fe(){return null===je&&(je=new Re([[1,104,2],[1,72,2],[1,102,6],[1,70,6],[2,116,3],[2,84,3],[3,116,4],[3,84,4],[4,112,5],[4,80,5],[5,115,9],[5,83,9],[5,58,10],[6,105,7],[6,73,7],[7,108,8],[7,76,8],[8,101,9],[8,69,9],[9,58,10],[10,47,11],[11,47,12]])),je}var Ve=null;function De(){if(null===Ve){Ve=new Me(0);for(var e=" \t<>'\"、。。、,.:;?!@#$%&*‘“〈《「『【〔([{「」}])〕】』」》〉”’`~…",t=0;tr);if(r>0){var u=t.charCodeAt(r-1),c=t.charCodeAt(o);(40===u&&41===c||91===u&&93===c||123===u&&125===c)&&o--}return{range:{startLineNumber:n,startColumn:r+1,endLineNumber:n,endColumn:o+2},url:t.substring(r,o+1)}},e.computeLinks=function(t,n){void 0===n&&(n=Fe());for(var r=De(),i=[],o=1,a=t.getLineCount();o<=a;o++){var s=t.getLineContent(o),u=s.length,c=0,l=0,f=0,h=1,d=!1,p=!1,m=!1;while(c=0?(r+=n?1:-1,r<0?r=e.length-1:r%=e.length,e[r]):null},e.INSTANCE=new e,e}();n("5110");function We(e){var t,n=this,r=!1;return function(){return r?t:(r=!0,t=e.apply(n,arguments),t)}}var Be,$e=function(){function e(t){this.element=t,this.next=e.Undefined,this.prev=e.Undefined}return e.Undefined=new e(void 0),e}(),Ye=function(){function e(){this._first=$e.Undefined,this._last=$e.Undefined,this._size=0}return Object.defineProperty(e.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),e.prototype.isEmpty=function(){return this._first===$e.Undefined},e.prototype.clear=function(){this._first=$e.Undefined,this._last=$e.Undefined,this._size=0},e.prototype.unshift=function(e){return this._insert(e,!1)},e.prototype.push=function(e){return this._insert(e,!0)},e.prototype._insert=function(e,t){var n=this,r=new $e(e);if(this._first===$e.Undefined)this._first=r,this._last=r;else if(t){var i=this._last;this._last=r,r.prev=i,i.next=r}else{var o=this._first;this._first=r,r.next=o,o.prev=r}this._size+=1;var a=!1;return function(){a||(a=!0,n._remove(r))}},e.prototype.shift=function(){if(this._first!==$e.Undefined){var e=this._first.element;return this._remove(this._first),e}},e.prototype.pop=function(){if(this._last!==$e.Undefined){var e=this._last.element;return this._remove(this._last),e}},e.prototype._remove=function(e){if(e.prev!==$e.Undefined&&e.next!==$e.Undefined){var t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===$e.Undefined&&e.next===$e.Undefined?(this._first=$e.Undefined,this._last=$e.Undefined):e.next===$e.Undefined?(this._last=this._last.prev,this._last.next=$e.Undefined):e.prev===$e.Undefined&&(this._first=this._first.next,this._first.prev=$e.Undefined);this._size-=1},e.prototype.iterator=function(){var e,t=this._first;return{next:function(){return t===$e.Undefined?U:(e?e.value=t.element:e={done:!1,value:t.element},t=t.next,e)}}},e.prototype.toArray=function(){for(var e=[],t=this._first;t!==$e.Undefined;t=t.next)e.push(t.element);return e},e}(),He=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();(function(e){function t(e){return function(t,n,r){void 0===n&&(n=null);var i,o=!1;return i=e(function(e){if(!o)return i?i.dispose():o=!0,t.call(n,e)},null,r),o&&i.dispose(),i}}function n(e,t){return u(function(n,r,i){return void 0===r&&(r=null),e(function(e){return n.call(r,t(e))},null,i)})}function r(e,t){return u(function(n,r,i){return void 0===r&&(r=null),e(function(e){t(e),n.call(r,e)},null,i)})}function i(e,t){return u(function(n,r,i){return void 0===r&&(r=null),e(function(e){return t(e)&&n.call(r,e)},null,i)})}function o(e){return e}function a(){for(var e=[],t=0;t1)&&c.fire(e),u=0},n)})},onLastListenerRemove:function(){o.dispose()}});return c.event}function l(e){var r=(new Date).getTime();return n(t(e),function(e){return(new Date).getTime()-r})}function f(e){var t,n=!0;return i(e,function(e){var r=n||e!==t;return n=!1,t=e,r})}function h(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=[]);var r=n.slice(),i=e(function(e){r?r.push(e):a.fire(e)}),o=function(){r&&r.forEach(function(e){return a.fire(e)}),r=null},a=new Qe({onFirstListenerAdd:function(){i||(i=e(function(e){return a.fire(e)}))},onFirstListenerDidAdd:function(){r&&(t?setTimeout(o):o())},onLastListenerRemove:function(){i&&i.dispose(),i=null}});return a.event}e.None=function(){return y.None},e.once=t,e.map=n,e.forEach=r,e.filter=i,e.signal=o,e.any=a,e.reduce=s,e.snapshot=u,e.debounce=c,e.stopwatch=l,e.latch=f,e.buffer=h;var d=function(){function e(e){this.event=e}return e.prototype.map=function(t){return new e(n(this.event,t))},e.prototype.forEach=function(t){return new e(r(this.event,t))},e.prototype.filter=function(t){return new e(i(this.event,t))},e.prototype.reduce=function(t,n){return new e(s(this.event,t,n))},e.prototype.latch=function(){return new e(f(this.event))},e.prototype.on=function(e,t,n){return this.event(e,t,n)},e.prototype.once=function(e,n,r){return t(this.event)(e,n,r)},e}();function p(e){return new d(e)}function g(e,t,n){void 0===n&&(n=function(e){return e});var r=function(){for(var e=[],t=0;t0?new Je(this._options&&this._options.leakWarningThreshold):void 0}return Object.defineProperty(e.prototype,"event",{get:function(){var t=this;return this._event||(this._event=function(n,r,i){t._listeners||(t._listeners=new Ye);var o=t._listeners.isEmpty();o&&t._options&&t._options.onFirstListenerAdd&&t._options.onFirstListenerAdd(t);var a,s,u=t._listeners.push(r?[n,r]:n);return o&&t._options&&t._options.onFirstListenerDidAdd&&t._options.onFirstListenerDidAdd(t),t._options&&t._options.onListenerDidAdd&&t._options.onListenerDidAdd(t,n,r),t._leakageMon&&(a=t._leakageMon.check(t._listeners.size)),s={dispose:function(){if(a&&a(),s.dispose=e._noop,!t._disposed&&(u(),t._options&&t._options.onLastListenerRemove)){var n=t._listeners&&!t._listeners.isEmpty();n||t._options.onLastListenerRemove(t)}}},i instanceof v?i.add(s):Array.isArray(i)&&i.push(s),s}),this._event},enumerable:!0,configurable:!0}),e.prototype.fire=function(e){if(this._listeners){this._deliveryQueue||(this._deliveryQueue=new Ye);for(var t=this._listeners.iterator(),n=t.next();!n.done;n=t.next())this._deliveryQueue.push([n.value,e]);while(this._deliveryQueue.size>0){var r=this._deliveryQueue.shift(),i=r[0],a=r[1];try{"function"===typeof i?i.call(void 0,a):i[0].call(i[1],a)}catch(n){o(n)}}}},e.prototype.dispose=function(){this._listeners&&this._listeners.clear(),this._deliveryQueue&&this._deliveryQueue.clear(),this._leakageMon&&this._leakageMon.dispose(),this._disposed=!0},e._noop=function(){},e}(),Xe=(function(e){function t(t){var n=e.call(this,t)||this;return n._isPaused=0,n._eventQueue=new Ye,n._mergeFn=t&&t.merge,n}He(t,e),t.prototype.pause=function(){this._isPaused++},t.prototype.resume=function(){if(0!==this._isPaused&&0===--this._isPaused)if(this._mergeFn){var t=this._eventQueue.toArray();this._eventQueue.clear(),e.prototype.fire.call(this,this._mergeFn(t))}else while(!this._isPaused&&0!==this._eventQueue.size)e.prototype.fire.call(this,this._eventQueue.shift())},t.prototype.fire=function(t){this._listeners&&(0!==this._isPaused?this._eventQueue.push(t):e.prototype.fire.call(this,t))}}(Qe),function(){function e(){var e=this;this.hasListeners=!1,this.events=[],this.emitter=new Qe({onFirstListenerAdd:function(){return e.onFirstListenerAdd()},onLastListenerRemove:function(){return e.onLastListenerRemove()}})}Object.defineProperty(e.prototype,"event",{get:function(){return this.emitter.event},enumerable:!0,configurable:!0}),e.prototype.add=function(e){var t=this,n={event:e,listener:null};this.events.push(n),this.hasListeners&&this.hook(n);var r=function(){t.hasListeners&&t.unhook(n);var e=t.events.indexOf(n);t.events.splice(e,1)};return g(We(r))},e.prototype.onFirstListenerAdd=function(){var e=this;this.hasListeners=!0,this.events.forEach(function(t){return e.hook(t)})},e.prototype.onLastListenerRemove=function(){var e=this;this.hasListeners=!1,this.events.forEach(function(t){return e.unhook(t)})},e.prototype.hook=function(e){var t=this;e.listener=e.event(function(e){return t.emitter.fire(e)})},e.prototype.unhook=function(e){e.listener&&e.listener.dispose(),e.listener=null},e.prototype.dispose=function(){this.emitter.dispose()}}(),function(){function e(){this.buffers=[]}e.prototype.wrapEvent=function(e){var t=this;return function(n,r,i){return e(function(e){var i=t.buffers[t.buffers.length-1];i?i.push(function(){return n.call(r,e)}):n.call(r,e)},void 0,i)}},e.prototype.bufferEvents=function(e){var t=[];this.buffers.push(t);var n=e();return this.buffers.pop(),t.forEach(function(e){return e()}),n}}(),function(){function e(){var e=this;this.listening=!1,this.inputEvent=Be.None,this.inputEventListener=y.None,this.emitter=new Qe({onFirstListenerDidAdd:function(){e.listening=!0,e.inputEventListener=e.inputEvent(e.emitter.fire,e.emitter)},onLastListenerRemove:function(){e.listening=!1,e.inputEventListener.dispose()}}),this.event=this.emitter.event}Object.defineProperty(e.prototype,"input",{set:function(e){this.inputEvent=e,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=e(this.emitter.fire,this.emitter))},enumerable:!0,configurable:!0}),e.prototype.dispose=function(){this.inputEventListener.dispose(),this.emitter.dispose()}}(),Object.freeze(function(e,t){var n=setTimeout(e.bind(t),0);return{dispose:function(){clearTimeout(n)}}}));(function(e){function t(t){return t===e.None||t===e.Cancelled||(t instanceof et||!(!t||"object"!==typeof t)&&("boolean"===typeof t.isCancellationRequested&&"function"===typeof t.onCancellationRequested))}e.isCancellationToken=t,e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:Be.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:Xe})})(ze||(ze={}));var Ze,et=function(){function e(){this._isCancelled=!1,this._emitter=null}return e.prototype.cancel=function(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))},Object.defineProperty(e.prototype,"isCancellationRequested",{get:function(){return this._isCancelled},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onCancellationRequested",{get:function(){return this._isCancelled?Xe:(this._emitter||(this._emitter=new Qe),this._emitter.event)},enumerable:!0,configurable:!0}),e.prototype.dispose=function(){this._emitter&&(this._emitter.dispose(),this._emitter=null)},e}(),tt=function(){function e(e){this._token=void 0,this._parentListener=void 0,this._parentListener=e&&e.onCancellationRequested(this.cancel,this)}return Object.defineProperty(e.prototype,"token",{get:function(){return this._token||(this._token=new et),this._token},enumerable:!0,configurable:!0}),e.prototype.cancel=function(){this._token?this._token instanceof et&&this._token.cancel():this._token=ze.Cancelled},e.prototype.dispose=function(){this._parentListener&&this._parentListener.dispose(),this._token?this._token instanceof et&&this._token.dispose():this._token=ze.None},e}(),nt=function(){function e(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}return e.prototype.define=function(e,t){this._keyCodeToStr[e]=t,this._strToKeyCode[t.toLowerCase()]=e},e.prototype.keyCodeToStr=function(e){return this._keyCodeToStr[e]},e.prototype.strToKeyCode=function(e){return this._strToKeyCode[e.toLowerCase()]||0},e}(),rt=new nt,it=new nt,ot=new nt;function at(e,t){var n=(65535&t)<<16>>>0;return(e|n)>>>0}(function(){function e(e,t,n,r){void 0===n&&(n=t),void 0===r&&(r=n),rt.define(e,t),it.define(e,n),ot.define(e,r)}e(0,"unknown"),e(1,"Backspace"),e(2,"Tab"),e(3,"Enter"),e(4,"Shift"),e(5,"Ctrl"),e(6,"Alt"),e(7,"PauseBreak"),e(8,"CapsLock"),e(9,"Escape"),e(10,"Space"),e(11,"PageUp"),e(12,"PageDown"),e(13,"End"),e(14,"Home"),e(15,"LeftArrow","Left"),e(16,"UpArrow","Up"),e(17,"RightArrow","Right"),e(18,"DownArrow","Down"),e(19,"Insert"),e(20,"Delete"),e(21,"0"),e(22,"1"),e(23,"2"),e(24,"3"),e(25,"4"),e(26,"5"),e(27,"6"),e(28,"7"),e(29,"8"),e(30,"9"),e(31,"A"),e(32,"B"),e(33,"C"),e(34,"D"),e(35,"E"),e(36,"F"),e(37,"G"),e(38,"H"),e(39,"I"),e(40,"J"),e(41,"K"),e(42,"L"),e(43,"M"),e(44,"N"),e(45,"O"),e(46,"P"),e(47,"Q"),e(48,"R"),e(49,"S"),e(50,"T"),e(51,"U"),e(52,"V"),e(53,"W"),e(54,"X"),e(55,"Y"),e(56,"Z"),e(57,"Meta"),e(58,"ContextMenu"),e(59,"F1"),e(60,"F2"),e(61,"F3"),e(62,"F4"),e(63,"F5"),e(64,"F6"),e(65,"F7"),e(66,"F8"),e(67,"F9"),e(68,"F10"),e(69,"F11"),e(70,"F12"),e(71,"F13"),e(72,"F14"),e(73,"F15"),e(74,"F16"),e(75,"F17"),e(76,"F18"),e(77,"F19"),e(78,"NumLock"),e(79,"ScrollLock"),e(80,";",";","OEM_1"),e(81,"=","=","OEM_PLUS"),e(82,",",",","OEM_COMMA"),e(83,"-","-","OEM_MINUS"),e(84,".",".","OEM_PERIOD"),e(85,"/","/","OEM_2"),e(86,"`","`","OEM_3"),e(110,"ABNT_C1"),e(111,"ABNT_C2"),e(87,"[","[","OEM_4"),e(88,"\\","\\","OEM_5"),e(89,"]","]","OEM_6"),e(90,"'","'","OEM_7"),e(91,"OEM_8"),e(92,"OEM_102"),e(93,"NumPad0"),e(94,"NumPad1"),e(95,"NumPad2"),e(96,"NumPad3"),e(97,"NumPad4"),e(98,"NumPad5"),e(99,"NumPad6"),e(100,"NumPad7"),e(101,"NumPad8"),e(102,"NumPad9"),e(103,"NumPad_Multiply"),e(104,"NumPad_Add"),e(105,"NumPad_Separator"),e(106,"NumPad_Subtract"),e(107,"NumPad_Decimal"),e(108,"NumPad_Divide")})(),function(e){function t(e){return rt.keyCodeToStr(e)}function n(e){return rt.strToKeyCode(e)}function r(e){return it.keyCodeToStr(e)}function i(e){return ot.keyCodeToStr(e)}function o(e){return it.strToKeyCode(e)||ot.strToKeyCode(e)}e.toString=t,e.fromString=n,e.toUserSettingsUS=r,e.toUserSettingsGeneral=i,e.fromUserSettings=o}(Ze||(Ze={}));(function(){function e(e,t,n,r,i){this.ctrlKey=e,this.shiftKey=t,this.altKey=n,this.metaKey=r,this.keyCode=i}e.prototype.equals=function(e){return this.ctrlKey===e.ctrlKey&&this.shiftKey===e.shiftKey&&this.altKey===e.altKey&&this.metaKey===e.metaKey&&this.keyCode===e.keyCode},e.prototype.isModifierKey=function(){return 0===this.keyCode||5===this.keyCode||57===this.keyCode||6===this.keyCode||4===this.keyCode},e.prototype.toChord=function(){return new Ft([this])},e.prototype.isDuplicateModifierCase=function(){return this.ctrlKey&&5===this.keyCode||this.shiftKey&&4===this.keyCode||this.altKey&&6===this.keyCode||this.metaKey&&57===this.keyCode}})();var st,ut,ct,lt,ft,ht,dt,pt,mt,gt,vt,yt,bt,_t,Ct,St,Et,wt,xt,Nt,At,Lt,kt,Tt,Ot,Pt,It,Mt,Rt,jt,Ft=function(){function e(e){if(0===e.length)throw c("parts");this.parts=e}return e.prototype.equals=function(e){if(null===e)return!1;if(this.parts.length!==e.parts.length)return!1;for(var t=0;t "+this.positionLineNumber+","+this.positionColumn+"]"},t.prototype.equalsSelection=function(e){return t.selectionsEqual(this,e)},t.selectionsEqual=function(e,t){return e.selectionStartLineNumber===t.selectionStartLineNumber&&e.selectionStartColumn===t.selectionStartColumn&&e.positionLineNumber===t.positionLineNumber&&e.positionColumn===t.positionColumn},t.prototype.getDirection=function(){return this.selectionStartLineNumber===this.startLineNumber&&this.selectionStartColumn===this.startColumn?0:1},t.prototype.setEndPosition=function(e,n){return 0===this.getDirection()?new t(this.startLineNumber,this.startColumn,e,n):new t(e,n,this.startLineNumber,this.startColumn)},t.prototype.getPosition=function(){return new ue(this.positionLineNumber,this.positionColumn)},t.prototype.setStartPosition=function(e,n){return 0===this.getDirection()?new t(e,n,this.endLineNumber,this.endColumn):new t(this.endLineNumber,this.endColumn,e,n)},t.fromPositions=function(e,n){return void 0===n&&(n=e),new t(e.lineNumber,e.column,n.lineNumber,n.column)},t.liftSelection=function(e){return new t(e.selectionStartLineNumber,e.selectionStartColumn,e.positionLineNumber,e.positionColumn)},t.selectionsArrEqual=function(e,t){if(e&&!t||!e&&t)return!1;if(!e&&!t)return!0;if(e.length!==t.length)return!1;for(var n=0,r=e.length;n=r._lines.length?U:(n=r._lines[i],a=r._wordenize(n,e),o=0,i+=1,s())};return{next:s}},t.prototype.getLineWords=function(e,t){for(var n=this._lines[e-1],r=this._wordenize(n,t),i=[],o=0,a=r;othis._lines.length)t=this._lines.length,n=this._lines[t-1].length+1,r=!0;else{var i=this._lines[t-1].length+1;n<1?(n=1,r=!0):n>i&&(n=i,r=!0)}return r?{lineNumber:t,column:n}:e},t}(Ne),$t=function(){function e(e,t){this._host=e,this._models=Object.create(null),this._foreignModuleFactory=t,this._foreignModule=null}return e.prototype.dispose=function(){this._models=Object.create(null)},e.prototype._getModel=function(e){return this._models[e]},e.prototype._getModels=function(){var e=this,t=[];return Object.keys(this._models).forEach(function(n){return t.push(e._models[n])}),t},e.prototype.acceptNewModel=function(e){this._models[e.url]=new Bt(ee.parse(e.url),e.lines,e.EOL,e.versionId)},e.prototype.acceptModelChanged=function(e,t){if(this._models[e]){var n=this._models[e];n.onEvents(t)}},e.prototype.acceptRemovedModel=function(e){this._models[e]&&delete this._models[e]},e.prototype.computeDiff=function(e,t,n){var r=this._getModel(e),i=this._getModel(t);if(!r||!i)return Promise.resolve(null);var o=r.getLinesContent(),a=i.getLinesContent(),s=new _e(o,a,{shouldComputeCharChanges:!0,shouldPostProcessCharChanges:!0,shouldIgnoreTrimWhitespace:n,shouldMakePrettyDiff:!0}),u=s.computeDiff(),c=!(u.length>0)&&this._modelsAreIdentical(r,i);return Promise.resolve({identical:c,changes:u})},e.prototype._modelsAreIdentical=function(e,t){var n=e.getLineCount(),r=t.getLineCount();if(n!==r)return!1;for(var i=1;i<=n;i++){var o=e.getLineContent(i),a=t.getLineContent(i);if(o!==a)return!1}return!0},e.prototype.computeMoreMinimalEdits=function(t,n){var r=this._getModel(t);if(!r)return Promise.resolve(n);var i=[],o=void 0;n=A(n,function(e,t){if(e.range&&t.range)return ce.compareRangesUsingStarts(e.range,t.range);var n=e.range?0:1,r=t.range?0:1;return n-r});for(var a=0,s=n;ae._diffLimit)i.push({range:c,text:l});else for(var d=P(h,l,!1),p=r.offsetAt(ce.lift(c).getStartPosition()),m=0,g=d;m0&&(i.arguments=n),i}function n(e){var t=e;return Wn.defined(t)&&Wn.string(t.title)&&Wn.string(t.command)}e.create=t,e.is=n}(an||(an={})),function(e){function t(e,t){return{range:e,newText:t}}function n(e,t){return{range:{start:e,end:e},newText:t}}function r(e){return{range:e,newText:""}}function i(e){var t=e;return Wn.objectLiteral(t)&&Wn.string(t.newText)&&Ht.is(t.range)}e.replace=t,e.insert=n,e.del=r,e.is=i}(sn||(sn={})),function(e){function t(e,t){return{textDocument:e,edits:t}}function n(e){var t=e;return Wn.defined(t)&&gn.is(t.textDocument)&&Array.isArray(t.edits)}e.create=t,e.is=n}(un||(un={})),function(e){function t(e,t){var n={kind:"create",uri:e};return void 0===t||void 0===t.overwrite&&void 0===t.ignoreIfExists||(n.options=t),n}function n(e){var t=e;return t&&"create"===t.kind&&Wn.string(t.uri)&&(void 0===t.options||(void 0===t.options.overwrite||Wn.boolean(t.options.overwrite))&&(void 0===t.options.ignoreIfExists||Wn.boolean(t.options.ignoreIfExists)))}e.create=t,e.is=n}(cn||(cn={})),function(e){function t(e,t,n){var r={kind:"rename",oldUri:e,newUri:t};return void 0===n||void 0===n.overwrite&&void 0===n.ignoreIfExists||(r.options=n),r}function n(e){var t=e;return t&&"rename"===t.kind&&Wn.string(t.oldUri)&&Wn.string(t.newUri)&&(void 0===t.options||(void 0===t.options.overwrite||Wn.boolean(t.options.overwrite))&&(void 0===t.options.ignoreIfExists||Wn.boolean(t.options.ignoreIfExists)))}e.create=t,e.is=n}(ln||(ln={})),function(e){function t(e,t){var n={kind:"delete",uri:e};return void 0===t||void 0===t.recursive&&void 0===t.ignoreIfNotExists||(n.options=t),n}function n(e){var t=e;return t&&"delete"===t.kind&&Wn.string(t.uri)&&(void 0===t.options||(void 0===t.options.recursive||Wn.boolean(t.options.recursive))&&(void 0===t.options.ignoreIfNotExists||Wn.boolean(t.options.ignoreIfNotExists)))}e.create=t,e.is=n}(fn||(fn={})),function(e){function t(e){var t=e;return t&&(void 0!==t.changes||void 0!==t.documentChanges)&&(void 0===t.documentChanges||t.documentChanges.every(function(e){return Wn.string(e.kind)?cn.is(e)||ln.is(e)||fn.is(e):un.is(e)}))}e.is=t}(hn||(hn={}));var mn,gn,vn,yn,bn,_n,Cn,Sn,En,wn,xn,Nn,An,Ln,kn,Tn,On,Pn=function(){function e(e){this.edits=e}return e.prototype.insert=function(e,t){this.edits.push(sn.insert(e,t))},e.prototype.replace=function(e,t){this.edits.push(sn.replace(e,t))},e.prototype.delete=function(e){this.edits.push(sn.del(e))},e.prototype.add=function(e){this.edits.push(e)},e.prototype.all=function(){return this.edits},e.prototype.clear=function(){this.edits.splice(0,this.edits.length)},e}();(function(){function e(e){var t=this;this._textEditChanges=Object.create(null),e&&(this._workspaceEdit=e,e.documentChanges?e.documentChanges.forEach(function(e){if(un.is(e)){var n=new Pn(e.edits);t._textEditChanges[e.textDocument.uri]=n}}):e.changes&&Object.keys(e.changes).forEach(function(n){var r=new Pn(e.changes[n]);t._textEditChanges[n]=r}))}Object.defineProperty(e.prototype,"edit",{get:function(){return this._workspaceEdit},enumerable:!0,configurable:!0}),e.prototype.getTextEditChange=function(e){if(gn.is(e)){if(this._workspaceEdit||(this._workspaceEdit={documentChanges:[]}),!this._workspaceEdit.documentChanges)throw new Error("Workspace edit is not configured for document changes.");var t=e,n=this._textEditChanges[t.uri];if(!n){var r=[],i={textDocument:t,edits:r};this._workspaceEdit.documentChanges.push(i),n=new Pn(r),this._textEditChanges[t.uri]=n}return n}if(this._workspaceEdit||(this._workspaceEdit={changes:Object.create(null)}),!this._workspaceEdit.changes)throw new Error("Workspace edit is not configured for normal text edit changes.");n=this._textEditChanges[e];if(!n){r=[];this._workspaceEdit.changes[e]=r,n=new Pn(r),this._textEditChanges[e]=n}return n},e.prototype.createFile=function(e,t){this.checkDocumentChanges(),this._workspaceEdit.documentChanges.push(cn.create(e,t))},e.prototype.renameFile=function(e,t,n){this.checkDocumentChanges(),this._workspaceEdit.documentChanges.push(ln.create(e,t,n))},e.prototype.deleteFile=function(e,t){this.checkDocumentChanges(),this._workspaceEdit.documentChanges.push(fn.create(e,t))},e.prototype.checkDocumentChanges=function(){if(!this._workspaceEdit||!this._workspaceEdit.documentChanges)throw new Error("Workspace edit is not configured for document changes.")}})();(function(e){function t(e){return{uri:e}}function n(e){var t=e;return Wn.defined(t)&&Wn.string(t.uri)}e.create=t,e.is=n})(mn||(mn={})),function(e){function t(e,t){return{uri:e,version:t}}function n(e){var t=e;return Wn.defined(t)&&Wn.string(t.uri)&&(null===t.version||Wn.number(t.version))}e.create=t,e.is=n}(gn||(gn={})),function(e){function t(e,t,n,r){return{uri:e,languageId:t,version:n,text:r}}function n(e){var t=e;return Wn.defined(t)&&Wn.string(t.uri)&&Wn.string(t.languageId)&&Wn.number(t.version)&&Wn.string(t.text)}e.create=t,e.is=n}(vn||(vn={})),function(e){e.PlainText="plaintext",e.Markdown="markdown"}(yn||(yn={})),function(e){function t(t){var n=t;return n===e.PlainText||n===e.Markdown}e.is=t}(yn||(yn={})),function(e){function t(e){var t=e;return Wn.objectLiteral(e)&&yn.is(t.kind)&&Wn.string(t.value)}e.is=t}(bn||(bn={})),function(e){e.Text=1,e.Method=2,e.Function=3,e.Constructor=4,e.Field=5,e.Variable=6,e.Class=7,e.Interface=8,e.Module=9,e.Property=10,e.Unit=11,e.Value=12,e.Enum=13,e.Keyword=14,e.Snippet=15,e.Color=16,e.File=17,e.Reference=18,e.Folder=19,e.EnumMember=20,e.Constant=21,e.Struct=22,e.Event=23,e.Operator=24,e.TypeParameter=25}(_n||(_n={})),function(e){e.PlainText=1,e.Snippet=2}(Cn||(Cn={})),function(e){function t(e){return{label:e}}e.create=t}(Sn||(Sn={})),function(e){function t(e,t){return{items:e||[],isIncomplete:!!t}}e.create=t}(En||(En={})),function(e){function t(e){return e.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}function n(e){var t=e;return Wn.string(t)||Wn.objectLiteral(t)&&Wn.string(t.language)&&Wn.string(t.value)}e.fromPlainText=t,e.is=n}(wn||(wn={})),function(e){function t(e){var t=e;return!!t&&Wn.objectLiteral(t)&&(bn.is(t.contents)||wn.is(t.contents)||Wn.typedArray(t.contents,wn.is))&&(void 0===e.range||Ht.is(e.range))}e.is=t}(xn||(xn={})),function(e){function t(e,t){return t?{label:e,documentation:t}:{label:e}}e.create=t}(Nn||(Nn={})),function(e){function t(e,t){for(var n=[],r=2;r=0;a--){var s=r[a],u=e.offsetAt(s.range.start),c=e.offsetAt(s.range.end);if(!(c<=o))throw new Error("Overlapping edit");n=n.substring(0,u)+s.newText+n.substring(c,n.length),o=u}return n}function i(e,t){if(e.length<=1)return e;var n=e.length/2|0,r=e.slice(0,n),o=e.slice(n);i(r,t),i(o,t);var a=0,s=0,u=0;while(a0&&e.push(t.length),this._lineOffsets=e}return this._lineOffsets},e.prototype.positionAt=function(e){e=Math.max(Math.min(e,this._content.length),0);var t=this.getLineOffsets(),n=0,r=t.length;if(0===r)return Yt.create(0,e);while(ne?r=i:n=i+1}var o=n-1;return Yt.create(o,e-t[o])},e.prototype.offsetAt=function(e){var t=this.getLineOffsets();if(e.line>=t.length)return this._content.length;if(e.line<0)return 0;var n=t[e.line],r=e.line+1=48&&a<=57)o=16*o+a-48;else if(a>=65&&a<=70)o=16*o+a-65+10;else{if(!(a>=97&&a<=102))break;o=16*o+a-97+10}n++,i++}return i=r){t+=e.substring(i,n),f=2;break}var o=e.charCodeAt(n);if(34===o){t+=e.substring(i,n),n++;break}if(92!==o){if(o>=0&&o<=31){if(zn(o)){t+=e.substring(i,n),f=2;break}f=6}n++}else{if(t+=e.substring(i,n),n++,n>=r){f=2;break}switch(o=e.charCodeAt(n++),o){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:var a=h(4,!0);a>=0?t+=String.fromCharCode(a):f=4;break;default:f=5}i=n}}return t}function g(){if(i="",f=0,o=n,u=s,l=c,n>=r)return o=r,a=17;var t=e.charCodeAt(n);if(Hn(t)){do{n++,i+=String.fromCharCode(t),t=e.charCodeAt(n)}while(Hn(t));return a=15}if(zn(t))return n++,i+=String.fromCharCode(t),13===t&&10===e.charCodeAt(n)&&(n++,i+="\n"),s++,c=n,a=14;switch(t){case 123:return n++,a=1;case 125:return n++,a=2;case 91:return n++,a=3;case 93:return n++,a=4;case 58:return n++,a=6;case 44:return n++,a=5;case 34:return n++,i=m(),a=10;case 47:var h=n-1;if(47===e.charCodeAt(n+1)){n+=2;while(n=12&&e<=15);return e}return{setPosition:d,getPosition:function(){return n},scan:t?y:g,getToken:function(){return a},getTokenValue:function(){return i},getTokenOffset:function(){return o},getTokenLength:function(){return n-o},getTokenStartLine:function(){return u},getTokenStartCharacter:function(){return o-l},getTokenError:function(){return f}}}function Hn(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 zn(e){return 10===e||13===e||8232===e||8233===e}function Gn(e){return e>=48&&e<=57}function Jn(e,t,n){var r,i,o,a,s;if(t){a=t.offset,s=a+t.length,o=a;while(o>0&&!er(e,o-1))o--;var u=s;while(ua&&e.substring(n,r)!==t&&v.push({offset:n,length:r-n,content:t})}var b=g();if(17!==b){var _=d.getTokenOffset()+o,C=Qn(c,r);y(C,o,_)}while(17!==b){var S=d.getTokenOffset()+d.getTokenLength()+o,E=g(),w="";while(!f&&(12===E||13===E)){var x=d.getTokenOffset()+o;y(" ",S,x),S=d.getTokenOffset()+d.getTokenLength()+o,w=12===E?m():"",E=g()}if(2===E)1!==b&&(h--,w=m());else if(4===E)3!==b&&(h--,w=m());else{switch(b){case 3:case 1:h++,w=m();break;case 5:case 12:w=m();break;case 13:w=f?m():" ";break;case 6:w=" ";break;case 10:if(6===E){w="";break}case 7:case 8:case 9:case 11:case 2:case 4:12===E||13===E?w=" ":5!==E&&17!==E&&(p=!0);break;case 16:p=!0;break}!f||12!==E&&13!==E||(w=m())}var N=d.getTokenOffset()+o;y(w,S,N),b=E}return v}function Qn(e,t){for(var n="",r=0;r=e.offset&&t0){var i=r.getToken();while(17!==i){if(-1!==t.indexOf(i)){v();break}if(-1!==n.indexOf(i))break;i=v()}}}function b(e){var t=r.getTokenValue();return e?f(t):s(t),v(),!0}function _(){switch(r.getToken()){case 11:var e=0;try{e=JSON.parse(r.getTokenValue()),"number"!==typeof e&&(y(2),e=0)}catch(t){y(2)}f(e);break;case 7:f(null);break;case 8:f(!0);break;case 9:f(!1);break;default:return!1}return v(),!0}function C(){return 10!==r.getToken()?(y(3,[],[2,5]),!1):(b(!1),6===r.getToken()?(h(":"),v(),w()||y(4,[],[2,5])):y(5,[],[2,5]),!0)}function S(){a(),v();var e=!1;while(2!==r.getToken()&&17!==r.getToken()){if(5===r.getToken()){if(e||y(4,[],[]),h(","),v(),2===r.getToken()&&g)break}else e&&y(6,[],[]);C()||y(4,[],[2,5]),e=!0}return u(),2!==r.getToken()?y(7,[2],[]):v(),!0}function E(){c(),v();var e=!1;while(4!==r.getToken()&&17!==r.getToken()){if(5===r.getToken()){if(e||y(4,[],[]),h(","),v(),4===r.getToken()&&g)break}else e&&y(6,[],[]);w()||y(4,[],[4,5]),e=!0}return l(),4!==r.getToken()?y(8,[4],[]):v(),!0}function w(){switch(r.getToken()){case 3:return E();case 1:return S();case 10:return b(!0);default:return _()}}return v(),17===r.getToken()||(w()?(17!==r.getToken()&&y(9,[],[]),!0):(y(4,[],[]),!1))}(function(e){var t=Object.prototype.toString;function n(e){return"undefined"!==typeof e}function r(e){return"undefined"===typeof e}function i(e){return!0===e||!1===e}function o(e){return"[object String]"===t.call(e)}function a(e){return"[object Number]"===t.call(e)}function s(e){return"[object Function]"===t.call(e)}function u(e){return null!==e&&"object"===typeof e}function c(e,t){return Array.isArray(e)&&e.every(t)}e.defined=n,e.undefined=r,e.boolean=i,e.string=o,e.number=a,e.func=s,e.objectLiteral=u,e.typedArray=c})(Wn||(Wn={})),function(e){e.DEFAULT={allowTrailingComma:!1}}(Bn||(Bn={}));var sr,ur,cr=Yn,lr=tr,fr=or,hr=nr,dr=rr;function pr(e,t,n){return Jn(e,t,n)}function mr(e,t){if(e===t)return!0;if(null===e||void 0===e||null===t||void 0===t)return!1;if(typeof e!==typeof t)return!1;if("object"!==typeof e)return!1;if(Array.isArray(e)!==Array.isArray(t))return!1;var n,r;if(Array.isArray(e)){if(e.length!==t.length)return!1;for(n=0;n()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/}},Ar=function(){function e(e,t,n){this.offset=t,this.length=n,this.parent=e}return Object.defineProperty(e.prototype,"children",{get:function(){return[]},enumerable:!0,configurable:!0}),e.prototype.toString=function(){return"type: "+this.type+" ("+this.offset+"/"+this.length+")"+(this.parent?" parent: {"+this.parent.toString()+"}":"")},e}(),Lr=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.type="null",r.value=null,r}return wr(t,e),t}(Ar),kr=function(e){function t(t,n,r){var i=e.call(this,t,r)||this;return i.type="boolean",i.value=n,i}return wr(t,e),t}(Ar),Tr=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.type="array",r.items=[],r}return wr(t,e),Object.defineProperty(t.prototype,"children",{get:function(){return this.items},enumerable:!0,configurable:!0}),t}(Ar),Or=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.type="number",r.isInteger=!0,r.value=Number.NaN,r}return wr(t,e),t}(Ar),Pr=function(e){function t(t,n,r){var i=e.call(this,t,n,r)||this;return i.type="string",i.value="",i}return wr(t,e),t}(Ar),Ir=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.type="property",r.colonOffset=-1,r}return wr(t,e),Object.defineProperty(t.prototype,"children",{get:function(){return this.valueNode?[this.keyNode,this.valueNode]:[this.keyNode]},enumerable:!0,configurable:!0}),t}(Ar),Mr=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.type="object",r.properties=[],r}return wr(t,e),Object.defineProperty(t.prototype,"children",{get:function(){return this.properties},enumerable:!0,configurable:!0}),t}(Ar);function Rr(e){return yr(e)?e?{}:{not:{}}:e}(function(e){e[e["Key"]=0]="Key",e[e["Enum"]=1]="Enum"})(Er||(Er={}));var jr=function(){function e(e,t){void 0===e&&(e=-1),void 0===t&&(t=null),this.focusOffset=e,this.exclude=t,this.schemas=[]}return e.prototype.add=function(e){this.schemas.push(e)},e.prototype.merge=function(e){var t;(t=this.schemas).push.apply(t,e.schemas)},e.prototype.include=function(e){return(-1===this.focusOffset||Kr(e,this.focusOffset))&&e!==this.exclude},e.prototype.newSub=function(){return new e(-1,this.exclude)},e}(),Fr=function(){function e(){}return Object.defineProperty(e.prototype,"schemas",{get:function(){return[]},enumerable:!0,configurable:!0}),e.prototype.add=function(e){},e.prototype.merge=function(e){},e.prototype.include=function(e){return!0},e.prototype.newSub=function(){return this},e.instance=new e,e}(),Vr=function(){function e(){this.problems=[],this.propertiesMatches=0,this.propertiesValueMatches=0,this.primaryValueMatches=0,this.enumValueMatch=!1,this.enumValues=null}return e.prototype.hasProblems=function(){return!!this.problems.length},e.prototype.mergeAll=function(e){for(var t=0,n=e;t=e.offset&&t0?a={schema:l,validationResult:f,matchingSchemas:h}:0===d&&(a.matchingSchemas.merge(h),a.validationResult.mergeEnumValues(f))}else a.matchingSchemas.merge(h),a.validationResult.propertiesMatches+=f.propertiesMatches,a.validationResult.propertiesValueMatches+=f.propertiesValueMatches;else a={schema:l,validationResult:f,matchingSchemas:h}}return o.length>1&&i&&n.problems.push({location:{offset:e.offset,length:1},severity:nn.Warning,message:xr("oneOfWarning","Matches multiple schemas when only one must validate.")}),null!==a&&(n.merge(a.validationResult),n.propertiesMatches+=a.validationResult.propertiesMatches,n.propertiesValueMatches+=a.validationResult.propertiesValueMatches,r.merge(a.matchingSchemas)),o.length};Array.isArray(t.anyOf)&&p(t.anyOf,!1),Array.isArray(t.oneOf)&&p(t.oneOf,!0);var m=function(t){var i=new Vr,o=r.newSub();Br(e,Rr(t),i,o),n.merge(i),n.propertiesMatches+=i.propertiesMatches,n.propertiesValueMatches+=i.propertiesValueMatches,r.merge(o)},g=function(t,n,i){var o=Rr(t),a=new Vr,s=r.newSub();Br(e,o,a,s),r.merge(s),a.hasProblems()?i&&m(i):n&&m(n)},v=Rr(t.if);if(v&&g(v,Rr(t.then),Rr(t.else)),Array.isArray(t.enum)){for(var y=Ur(e),b=!1,_=0,C=t.enum;_=u&&n.problems.push({location:{offset:e.offset,length:e.length},severity:nn.Warning,message:xr("exclusiveMaximumWarning","Value is above the exclusive maximum of {0}.",u)});var c=a(t.minimum,t.exclusiveMinimum);gr(c)&&il&&n.problems.push({location:{offset:e.offset,length:e.length},severity:nn.Warning,message:xr("maximumWarning","Value is above the maximum of {0}.",l)})}function a(e,t,n,r){if(gr(t.minLength)&&e.value.lengtht.maxLength&&n.problems.push({location:{offset:e.offset,length:e.length},severity:nn.Warning,message:xr("maxLengthWarning","String is longer than the maximum length of {0}.",t.maxLength)}),br(t.pattern)){var i=new RegExp(t.pattern);i.test(e.value)||n.problems.push({location:{offset:e.offset,length:e.length},severity:nn.Warning,message:t.patternErrorMessage||t.errorMessage||xr("patternWarning",'String does not match the pattern of "{0}".',t.pattern)})}if(t.format)switch(t.format){case"uri":case"uri-reference":var o=void 0;if(e.value){var a=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/.exec(e.value);a?a[2]||"uri"!==t.format||(o=xr("uriSchemeMissing","URI with a scheme is expected.")):o=xr("uriMissing","URI is expected.")}else o=xr("uriEmpty","URI expected.");o&&n.problems.push({location:{offset:e.offset,length:e.length},severity:nn.Warning,message:t.patternErrorMessage||t.errorMessage||xr("uriFormatWarning","String is not a URI: {0}",o)});break;case"color-hex":case"date-time":case"date":case"time":case"email":var s=Nr[t.format];e.value&&s.pattern.exec(e.value)||n.problems.push({location:{offset:e.offset,length:e.length},severity:nn.Warning,message:t.patternErrorMessage||t.errorMessage||s.errorMessage});default:}}function s(e,t,n,r){if(Array.isArray(t.items)){for(var i=t.items,o=0;o=i.length&&n.propertiesValueMatches++}if(e.items.length>i.length)if("object"===typeof t.additionalItems)for(var l=i.length;lt.maxItems&&n.problems.push({location:{offset:e.offset,length:e.length},severity:nn.Warning,message:xr("maxItemsWarning","Array has too many items. Expected {0} or fewer.",t.maxItems)}),!0===t.uniqueItems){var g=Ur(e),v=g.some(function(e,t){return t!==g.lastIndexOf(e)});v&&n.problems.push({location:{offset:e.offset,length:e.length},severity:nn.Warning,message:xr("uniqueItemsWarning","Array has duplicate items.")})}}function u(e,t,n,r){for(var i=Object.create(null),o=[],a=0,s=e.properties;a=0)o.splice(t,1),t=o.indexOf(e)};if(t.properties)for(var g=0,v=Object.keys(t.properties);g0)for(var k=0,T=o;kt.maxProperties&&n.problems.push({location:{offset:e.offset,length:e.length},severity:nn.Warning,message:xr("MaxPropWarning","Object has more properties than limit of {0}.",t.maxProperties)}),gr(t.minProperties)&&e.properties.length0){c--;while(c>0&&/\s/.test(i.charAt(c)))c--;l=c+1}if(u(e,t,c,l),n&&f(n,!1),r.length+a.length>0){var h=o.getToken();while(17!==h){if(-1!==r.indexOf(h)){s();break}if(-1!==a.indexOf(h))break;h=s()}}return n}function l(){switch(o.getTokenError()){case 4:return c(xr("InvalidUnicode","Invalid unicode sequence in string."),sr.InvalidUnicode),!0;case 5:return c(xr("InvalidEscapeCharacter","Invalid escape character in string."),sr.InvalidEscapeCharacter),!0;case 3:return c(xr("UnexpectedEndOfNumber","Unexpected end of number."),sr.UnexpectedEndOfNumber),!0;case 1:return c(xr("UnexpectedEndOfComment","Unexpected end of comment."),sr.UnexpectedEndOfComment),!0;case 2:return c(xr("UnexpectedEndOfString","Unexpected end of string."),sr.UnexpectedEndOfString),!0;case 6:return c(xr("InvalidCharacter","Invalid characters in string. Control characters must be escaped."),sr.InvalidCharacter),!0}return!1}function f(e,t){return e.length=o.getTokenOffset()+o.getTokenLength()-e.offset,t&&s(),e}function h(e){if(3!==o.getToken())return null;var t=new Tr(e,o.getTokenOffset());s();var n=0,r=!1;while(4!==o.getToken()&&17!==o.getToken()){if(5===o.getToken()){r||c(xr("ValueExpected","Value expected"),sr.ValueExpected);var i=o.getTokenOffset();if(s(),4===o.getToken()){r&&u(xr("TrailingComma","Trailing comma"),sr.TrailingComma,i,i+1);continue}}else r&&c(xr("ExpectedComma","Expected comma"),sr.CommaExpected);var a=y(t,n++);a?t.items.push(a):c(xr("PropertyExpected","Value expected"),sr.ValueExpected,null,[],[4,5]),r=!0}return 4!==o.getToken()?c(xr("ExpectedCloseBracket","Expected comma or closing bracket"),sr.CommaOrCloseBacketExpected,t):f(t,!0)}function d(t,n){var r=new Ir(t,o.getTokenOffset()),i=m(r);if(!i){if(16!==o.getToken())return null;c(xr("DoubleQuotesExpected","Property keys must be doublequoted"),sr.Undefined);var a=new Pr(r,o.getTokenOffset(),o.getTokenLength());a.value=o.getTokenValue(),i=a,s()}r.keyNode=i;var l=n[i.value];if(l?(u(xr("DuplicateKeyWarning","Duplicate object key"),sr.DuplicateKey,r.keyNode.offset,r.keyNode.offset+r.keyNode.length,nn.Warning),"object"===typeof l&&u(xr("DuplicateKeyWarning","Duplicate object key"),sr.DuplicateKey,l.keyNode.offset,l.keyNode.offset+l.keyNode.length,nn.Warning),n[i.value]=!0):n[i.value]=r,6===o.getToken())r.colonOffset=o.getTokenOffset(),s();else if(c(xr("ColonExpected","Colon expected"),sr.ColonExpected),10===o.getToken()&&e.positionAt(i.offset+i.length).line0?e.lastIndexOf(t)===n:0===n&&e===t}function Gr(e){return e.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}var Jr=Sr(),Qr=function(){function e(e,t,n,r){void 0===t&&(t=[]),void 0===n&&(n=Promise),void 0===r&&(r={}),this.schemaService=e,this.contributions=t,this.promiseConstructor=n,this.clientCapabilities=r,this.templateVarIdCounter=0}return e.prototype.doResolve=function(e){for(var t=this.contributions.length-1;t>=0;t--)if(this.contributions[t].resolveCompletion){var n=this.contributions[t].resolveCompletion(e);if(n)return n}return this.promiseConstructor.resolve(e)},e.prototype.doComplete=function(e,t,n){var r=this,i={items:[],isIncomplete:!1},o=e.offsetAt(t),a=n.getNodeFromOffset(o,!0);if(this.isInComment(e,a?a.offset:0,o))return Promise.resolve(i);var s=this.getCurrentWord(e,o),u=null;if(!a||"string"!==a.type&&"number"!==a.type&&"boolean"!==a.type&&"null"!==a.type){var c=o-s.length;c>0&&'"'===e.getText()[c-1]&&c--,u=Ht.create(e.positionAt(c),t)}else u=Ht.create(e.positionAt(a.offset),e.positionAt(a.offset+a.length));var l={},f={add:function(e){var t=l[e.label];t?t.documentation||(t.documentation=e.documentation):(l[e.label]=e,u&&(e.textEdit=sn.replace(u,e.insertText)),i.items.push(e))},setAsIncomplete:function(){i.isIncomplete=!0},error:function(e){console.error(e)},log:function(e){console.log(e)},getNumberOfProposals:function(){return i.items.length}};return this.schemaService.getSchemaForResource(e.uri,n).then(function(t){var c=[],h=!0,d="",p=null;if(a&&"string"===a.type){var m=a.parent;m&&"property"===m.type&&m.keyNode===a&&(h=!m.valueNode,p=m,d=e.getText().substr(a.offset+1,a.length-2),m&&(a=m.parent))}if(a&&"object"===a.type){if(a.offset===o)return i;var g=a.properties;g.forEach(function(e){p&&p===e||(l[e.keyNode.value]=Sn.create("__"))});var v="";h&&(v=r.evaluateSeparatorAfter(e,e.offsetAt(u.end))),t?r.getPropertyCompletions(t,n,a,h,v,f):r.getSchemaLessPropertyCompletions(n,a,d,f);var y=qr(a);r.contributions.forEach(function(t){var n=t.collectPropertyCompletions(e.uri,y,s,h,""===v,f);n&&c.push(n)}),!t&&s.length>0&&'"'!==e.getText().charAt(o-s.length-1)&&(f.add({kind:_n.Property,label:r.getLabelForValue(s),insertText:r.getInsertTextForProperty(s,null,!1,v),insertTextFormat:Cn.Snippet,documentation:""}),f.setAsIncomplete())}var b={};return t?r.getValueCompletions(t,n,a,o,e,f,b):r.getSchemaLessValueCompletions(n,a,o,e,f),r.contributions.length>0&&r.getContributedValueCompletions(n,a,o,e,f,c),r.promiseConstructor.all(c).then(function(){if(0===f.getNumberOfProposals()){var t=o;!a||"string"!==a.type&&"number"!==a.type&&"boolean"!==a.type&&"null"!==a.type||(t=a.offset+a.length);var n=r.evaluateSeparatorAfter(e,t);r.addFillerValueCompletions(b,n,f)}return i})})},e.prototype.getPropertyCompletions=function(e,t,n,r,i,o){var a=this,s=t.getMatchingSchemas(e.schema,n.offset);s.forEach(function(e){if(e.node===n&&!e.inverted){var t=e.schema.properties;t&&Object.keys(t).forEach(function(e){var n=t[e];if("object"===typeof n&&!n.deprecationMessage&&!n.doNotSuggest){var s={kind:_n.Property,label:a.sanitizeLabel(e),insertText:a.getInsertTextForProperty(e,n,r,i),insertTextFormat:Cn.Snippet,filterText:a.getFilterTextForValue(e),documentation:a.fromMarkup(n.markdownDescription)||n.description||""};zr(s.insertText,"$1"+i)&&(s.command={title:"Suggest",command:"editor.action.triggerSuggest"}),o.add(s)}})}})},e.prototype.getSchemaLessPropertyCompletions=function(e,t,n,r){var i=this,o=function(e){e.properties.forEach(function(e){var t=e.keyNode.value;r.add({kind:_n.Property,label:i.sanitizeLabel(t),insertText:i.getInsertTextForValue(t,""),insertTextFormat:Cn.Snippet,filterText:i.getFilterTextForValue(t),documentation:""})})};if(t.parent)if("property"===t.parent.type){var a=t.parent.keyNode.value;e.visit(function(e){return"property"===e.type&&e!==t.parent&&e.keyNode.value===a&&e.valueNode&&"object"===e.valueNode.type&&o(e.valueNode),!0})}else"array"===t.parent.type&&t.parent.items.forEach(function(e){"object"===e.type&&e!==t&&o(e)});else"object"===t.type&&r.add({kind:_n.Property,label:"$schema",insertText:this.getInsertTextForProperty("$schema",null,!0,""),insertTextFormat:Cn.Snippet,documentation:"",filterText:this.getFilterTextForValue("$schema")})},e.prototype.getSchemaLessValueCompletions=function(e,t,n,r,i){var o=this,a=n;if(!t||"string"!==t.type&&"number"!==t.type&&"boolean"!==t.type&&"null"!==t.type||(a=t.offset+t.length,t=t.parent),!t)return i.add({kind:this.getSuggestionKind("object"),label:"Empty object",insertText:this.getInsertTextForValue({},""),insertTextFormat:Cn.Snippet,documentation:""}),void i.add({kind:this.getSuggestionKind("array"),label:"Empty array",insertText:this.getInsertTextForValue([],""),insertTextFormat:Cn.Snippet,documentation:""});var s=this.evaluateSeparatorAfter(r,a),u=function(e){Kr(e.parent,n,!0)||i.add({kind:o.getSuggestionKind(e.type),label:o.getLabelTextForMatchingNode(e,r),insertText:o.getInsertTextForMatchingNode(e,r,s),insertTextFormat:Cn.Snippet,documentation:""}),"boolean"===e.type&&o.addBooleanValueCompletion(!e.value,s,i)};if("property"===t.type&&n>t.colonOffset){var c=t.valueNode;if(c&&(n>c.offset+c.length||"object"===c.type||"array"===c.type))return;var l=t.keyNode.value;e.visit(function(e){return"property"===e.type&&e.keyNode.value===l&&e.valueNode&&u(e.valueNode),!0}),"$schema"===l&&t.parent&&!t.parent.parent&&this.addDollarSchemaCompletions(s,i)}if("array"===t.type)if(t.parent&&"property"===t.parent.type){var f=t.parent.keyNode.value;e.visit(function(e){return"property"===e.type&&e.keyNode.value===f&&e.valueNode&&"array"===e.valueNode.type&&e.valueNode.items.forEach(u),!0})}else t.items.forEach(u)},e.prototype.getValueCompletions=function(e,t,n,r,i,o,a){var s=this,u=r,c=null,l=null;if(!n||"string"!==n.type&&"number"!==n.type&&"boolean"!==n.type&&"null"!==n.type||(u=n.offset+n.length,l=n,n=n.parent),n){if("property"===n.type&&r>n.colonOffset){var f=n.valueNode;if(f&&r>f.offset+f.length)return;c=n.keyNode.value,n=n.parent}if(n&&(null!==c||"array"===n.type)){var h=this.evaluateSeparatorAfter(i,u),d=t.getMatchingSchemas(e.schema,n.offset,l);d.forEach(function(e){if(e.node===n&&!e.inverted&&e.schema){if("array"===n.type&&e.schema.items)if(Array.isArray(e.schema.items)){var t=s.findItemAtOffset(n,i,r);tt.colonOffset){var a=t.keyNode.value,s=t.valueNode;if(!s||n<=s.offset+s.length){var u=qr(t.parent);this.contributions.forEach(function(e){var t=e.collectValueCompletions(r.uri,u,a,i);t&&o.push(t)})}}}else this.contributions.forEach(function(e){var t=e.collectDefaultCompletions(r.uri,i);t&&o.push(t)})},e.prototype.addSchemaValueCompletions=function(e,t,n,r){var i=this;"object"===typeof e&&(this.addEnumValueCompletions(e,t,n),this.addDefaultValueCompletions(e,t,n),this.collectTypes(e,r),Array.isArray(e.allOf)&&e.allOf.forEach(function(e){return i.addSchemaValueCompletions(e,t,n,r)}),Array.isArray(e.anyOf)&&e.anyOf.forEach(function(e){return i.addSchemaValueCompletions(e,t,n,r)}),Array.isArray(e.oneOf)&&e.oneOf.forEach(function(e){return i.addSchemaValueCompletions(e,t,n,r)}))},e.prototype.addDefaultValueCompletions=function(e,t,n,r){var i=this;void 0===r&&(r=0);var o=!1;if(vr(e.default)){for(var a=e.type,s=e.default,u=r;u>0;u--)s=[s],a="array";n.add({kind:this.getSuggestionKind(a),label:this.getLabelForValue(s),insertText:this.getInsertTextForValue(s,t),insertTextFormat:Cn.Snippet,detail:Jr("json.suggest.default","Default value")}),o=!0}Array.isArray(e.examples)&&e.examples.forEach(function(a){for(var s=e.type,u=a,c=r;c>0;c--)u=[u],s="array";n.add({kind:i.getSuggestionKind(s),label:i.getLabelForValue(u),insertText:i.getInsertTextForValue(u,t),insertTextFormat:Cn.Snippet}),o=!0}),Array.isArray(e.defaultSnippets)&&e.defaultSnippets.forEach(function(a){var s,u,c=e.type,l=a.body,f=a.label;if(vr(l)){e.type;for(var h=r;h>0;h--)l=[l],"array";s=i.getInsertTextForSnippetValue(l,t),u=i.getFilterTextForSnippetValue(l),f=f||i.getLabelForSnippetValue(l)}else if("string"===typeof a.bodyText){var d="",p="",m="";for(h=r;h>0;h--)d=d+m+"[\n",p=p+"\n"+m+"]",m+="\t",c="array";s=d+m+a.bodyText.split("\n").join("\n"+m)+p+t,f=f||i.sanitizeLabel(s),u=s.replace(/[\n]/g,"")}n.add({kind:i.getSuggestionKind(c),label:f,documentation:i.fromMarkup(a.markdownDescription)||a.description,insertText:s,insertTextFormat:Cn.Snippet,filterText:u}),o=!0}),o||"object"!==typeof e.items||Array.isArray(e.items)||this.addDefaultValueCompletions(e.items,t,n,r+1)},e.prototype.addEnumValueCompletions=function(e,t,n){if(vr(e.const)&&n.add({kind:this.getSuggestionKind(e.type),label:this.getLabelForValue(e.const),insertText:this.getInsertTextForValue(e.const,t),insertTextFormat:Cn.Snippet,documentation:this.fromMarkup(e.markdownDescription)||e.description}),Array.isArray(e.enum))for(var r=0,i=e.enum.length;r57&&(e=e.substr(0,57).trim()+"..."),e},e.prototype.getLabelForValue=function(e){return this.sanitizeLabel(JSON.stringify(e))},e.prototype.getFilterTextForValue=function(e){return JSON.stringify(e)},e.prototype.getFilterTextForSnippetValue=function(e){return JSON.stringify(e).replace(/\$\{\d+:([^}]+)\}|\$\d+/g,"$1")},e.prototype.getLabelForSnippetValue=function(e){var t=JSON.stringify(e);return t=t.replace(/\$\{\d+:([^}]+)\}|\$\d+/g,"$1"),this.sanitizeLabel(t)},e.prototype.getInsertTextForPlainText=function(e){return e.replace(/[\\\$\}]/g,"\\$&")},e.prototype.getInsertTextForValue=function(e,t){var n=JSON.stringify(e,null,"\t");return"{}"===n?"{$1}"+t:"[]"===n?"[$1]"+t:this.getInsertTextForPlainText(n+t)},e.prototype.getInsertTextForSnippetValue=function(e,t){var n=function(e){return"string"===typeof e&&"^"===e[0]?e.substr(1):JSON.stringify(e)};return Yr(e,"",n)+t},e.prototype.getInsertTextForGuessedValue=function(e,t){switch(typeof e){case"object":return null===e?"${1:null}"+t:this.getInsertTextForValue(e,t);case"string":var n=JSON.stringify(e);return n=n.substr(1,n.length-2),n=this.getInsertTextForPlainText(n),'"${1:'+n+'}"'+t;case"number":case"boolean":return"${1:"+JSON.stringify(e)+"}"+t}return this.getInsertTextForValue(e,t)},e.prototype.getSuggestionKind=function(e){if(Array.isArray(e)){var t=e;e=t.length>0?t[0]:null}if(!e)return _n.Value;switch(e){case"string":return _n.Value;case"object":return _n.Module;case"property":return _n.Property;default:return _n.Value}},e.prototype.getLabelTextForMatchingNode=function(e,t){switch(e.type){case"array":return"[]";case"object":return"{}";default:var n=t.getText().substr(e.offset,e.length);return n}},e.prototype.getInsertTextForMatchingNode=function(e,t,n){switch(e.type){case"array":return this.getInsertTextForValue([],n);case"object":return this.getInsertTextForValue({},n);default:var r=t.getText().substr(e.offset,e.length)+n;return this.getInsertTextForPlainText(r)}},e.prototype.getInsertTextForProperty=function(e,t,n,r){var i=this.getInsertTextForValue(e,"");if(!n)return i;var o,a=i+": ",s=0;if(t){if(Array.isArray(t.defaultSnippets)){if(1===t.defaultSnippets.length){var u=t.defaultSnippets[0].body;vr(u)&&(o=this.getInsertTextForSnippetValue(u,""))}s+=t.defaultSnippets.length}if(t.enum&&(o||1!==t.enum.length||(o=this.getInsertTextForGuessedValue(t.enum[0],"")),s+=t.enum.length),vr(t.default)&&(o||(o=this.getInsertTextForGuessedValue(t.default,"")),s++),0===s){var c=Array.isArray(t.type)?t.type[0]:t.type;switch(c||(t.properties?c="object":t.items&&(c="array")),c){case"boolean":o="$1";break;case"string":o='"$1"';break;case"object":o="{$1}";break;case"array":o="[$1]";break;case"number":case"integer":o="${1:0}";break;case"null":o="${1:null}";break;default:return i}}}return(!o||s>1)&&(o="$1"),a+o+r},e.prototype.getCurrentWord=function(e,t){var n=t-1,r=e.getText();while(n>=0&&-1===' \t\n\r\v":{[,]}'.indexOf(r.charAt(n)))n--;return r.substring(n+1,t)},e.prototype.evaluateSeparatorAfter=function(e,t){var n=cr(e.getText(),!0);n.setPosition(t);var r=n.scan();switch(r){case 5:case 2:case 4:case 17:return"";default:return","}},e.prototype.findItemAtOffset=function(e,t,n){for(var r=cr(t.getText(),!0),i=e.items,o=i.length-1;o>=0;o--){var a=i[o];if(n>a.offset+a.length){r.setPosition(a.offset+a.length);var s=r.scan();return 5===s&&n>=r.getTokenOffset()+r.getTokenLength()?o+1:o}if(n>=a.offset)return o}return 0},e.prototype.isInComment=function(e,t,n){var r=cr(e.getText(),!1);r.setPosition(t);var i=r.scan();while(17!==i&&r.getTokenOffset()+r.getTokenLength()i.offset+1&&r=0;l--){var f=this.contributions[l],h=f.getInfoContribution(e.uri,c);if(h)return h.then(function(e){return u(e)})}return this.schemaService.getSchemaForResource(e.uri,n).then(function(e){if(e){var t=n.getMatchingSchemas(e.schema,i.offset),r=null,o=null,a=null,s=null;t.every(function(e){if(e.node===i&&!e.inverted&&e.schema&&(r=r||e.schema.title,o=o||e.schema.markdownDescription||Zr(e.schema.description),e.schema.enum)){var t=e.schema.enum.indexOf(Ur(i));e.schema.markdownEnumDescriptions?a=e.schema.markdownEnumDescriptions[t]:e.schema.enumDescriptions&&(a=Zr(e.schema.enumDescriptions[t])),a&&(s=e.schema.enum[t],"string"!==typeof s&&(s=JSON.stringify(s)))}return!0});var c="";return r&&(c=Zr(r)),o&&(c.length>0&&(c+="\n\n"),c+=o),a&&(c.length>0&&(c+="\n\n"),c+="`"+ei(s)+"`: "+a),u([c])}return null})},e}();function Zr(e){if(e){var t=e.replace(/([^\n\r])(\r?\n)([^\n\r])/gm,"$1\n\n$3");return t.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}}function ei(e){return-1!==e.indexOf("`")?"`` "+e+" ``":e}var ti=n("c623"),ni=Sr(),ri=function(){function e(e){try{this.patternRegExp=new RegExp(Gr(e)+"$")}catch(t){this.patternRegExp=null}this.schemas=[]}return e.prototype.addSchema=function(e){this.schemas.push(e)},e.prototype.matchesPattern=function(e){return this.patternRegExp&&this.patternRegExp.test(e)},e.prototype.getSchemas=function(){return this.schemas},e}(),ii=function(){function e(e,t,n){this.service=e,this.url=t,this.dependencies={},n&&(this.unresolvedSchema=this.service.promise.resolve(new oi(n)))}return e.prototype.getUnresolvedSchema=function(){return this.unresolvedSchema||(this.unresolvedSchema=this.service.loadSchema(this.url)),this.unresolvedSchema},e.prototype.getResolvedSchema=function(){var e=this;return this.resolvedSchema||(this.resolvedSchema=this.getUnresolvedSchema().then(function(t){return e.service.resolveSchemaContent(t,e.url,e.dependencies)})),this.resolvedSchema},e.prototype.clearSchema=function(){this.resolvedSchema=null,this.unresolvedSchema=null,this.dependencies={}},e}(),oi=function(){function e(e,t){void 0===t&&(t=[]),this.schema=e,this.errors=t}return e}(),ai=function(){function e(e,t){void 0===t&&(t=[]),this.schema=e,this.errors=t}return e.prototype.getSection=function(e){return Rr(this.getSectionRecursive(e,this.schema))},e.prototype.getSectionRecursive=function(e,t){if(!t||"boolean"===typeof t||0===e.length)return t;var n=e.shift();if(t.properties&&(t.properties[n],1))return this.getSectionRecursive(e,t.properties[n]);if(t.patternProperties)for(var r=0,i=Object.keys(t.patternProperties);r0)this.callOnDispose.pop()()},e.prototype.onResourceChange=function(e){var t=this,n=!1;e=this.normalizeId(e);var r=[e],i=Object.keys(this.schemasById).map(function(e){return t.schemasById[e]});while(r.length)for(var o=r.pop(),a=0;a1&&(t=n[1]),new oi({},[t])})},e.prototype.resolveSchemaContent=function(e,t,n){var r=this,i=e.errors.slice(0),o=e.schema,a=this.contextService,s=function(e,t){if(!t)return e;var n=e;return"/"===t[0]&&(t=t.substr(1)),t.split("/").some(function(e){return n=n[e],!n}),n},u=function(e,t,n,r){var o=s(t,r);if(o)for(var a in o)o.hasOwnProperty(a)&&!e.hasOwnProperty(a)&&(e[a]=o[a]);else i.push(ni("json.schema.invalidref","$ref '{0}' in '{1}' can not be resolved.",r,n))},c=function(e,t,n,o,s){a&&!/^\w+:\/\/.*/.test(t)&&(t=a.resolveRelativePath(t,o)),t=r.normalizeId(t);var c=r.getOrAddSchemaHandle(t);return c.getUnresolvedSchema().then(function(r){if(s[t]=!0,r.errors.length){var o=n?t+"#"+n:t;i.push(ni("json.schema.problemloadingref","Problems loading reference '{0}': {1}",o,r.errors[0]))}return u(e,r.schema,t,n),l(e,r.schema,t,c.dependencies)})},l=function(e,t,n,i){if(!e||"object"!==typeof e)return Promise.resolve(null);var o=[e],a=[],s=[],l=function(){for(var e=[],t=0;t0)return void s.push(c(e,a[0],a[1],n,i));-1===r.indexOf(o)&&(u(e,t,n,a[1]),r.push(o))}l(e.items,e.additionalProperties,e.not,e.contains,e.propertyNames,e.if,e.then,e.else),f(e.definitions,e.properties,e.patternProperties,e.dependencies),h(e.anyOf,e.allOf,e.oneOf,e.items)};while(o.length){var p=o.pop();a.indexOf(p)>=0||(a.push(p),d(p))}return r.promise.all(s)};return l(o,o,t,n).then(function(e){return new ai(o,i)})},e.prototype.getSchemaForResource=function(e,t){if(t&&t.root&&"object"===t.root.type){var n=t.root.properties.filter(function(e){return"$schema"===e.keyNode.value&&e.valueNode&&"string"===e.valueNode.type});if(n.length>0){var r=Ur(n[0].valueNode);if(r&&Hr(r,".")&&this.contextService&&(r=this.contextService.resolveRelativePath(r,e)),r){var i=this.normalizeId(r);return this.getOrAddSchemaHandle(i).getResolvedSchema()}}}for(var o=Object.create(null),a=[],s=0,u=this.filePatternAssociations;s0?this.createCombinedSchema(e,a).getResolvedSchema():this.promise.resolve(null)},e.prototype.createCombinedSchema=function(e,t){if(1===t.length)return this.getOrAddSchemaHandle(t[0]);var n="schemaservice://combinedSchema/"+encodeURIComponent(e),r={allOf:t.map(function(e){return{$ref:e}})};return this.addSchemaHandle(n,r)},e}();function ui(e){try{var t=ti["a"].parse(e);if("file"===t.scheme)return t.fsPath}catch(n){}return e}var ci=Sr(),li=function(){function e(e,t){this.jsonSchemaService=e,this.promise=t,this.validationEnabled=!0}return e.prototype.configure=function(e){e&&(this.validationEnabled=e.validate,this.commentSeverity=e.allowComments?void 0:nn.Error)},e.prototype.doValidation=function(e,t,n,r){var i=this;if(!this.validationEnabled)return this.promise.resolve([]);var o=[],a={},s=function(e){var t=e.range.start.line+" "+e.range.start.character+" "+e.message;a[t]||(a[t]=!0,o.push(e))},u=function(r){var a=n?pi(n.trailingCommas):nn.Error,u=n?pi(n.comments):i.commentSeverity;if(r){if(r.errors.length&&t.root){var c=t.root,l="object"===c.type?c.properties[0]:null;if(l&&"$schema"===l.keyNode.value){var f=l.valueNode||l,h=Ht.create(e.positionAt(f.offset),e.positionAt(f.offset+f.length));s(on.create(h,r.errors[0],nn.Warning,sr.SchemaResolveError))}else{h=Ht.create(e.positionAt(c.offset),e.positionAt(c.offset+1));s(on.create(h,r.errors[0],nn.Warning,sr.SchemaResolveError))}}else{var d=t.validate(e,r.schema);d&&d.forEach(s)}hi(r.schema)&&(u=void 0),di(r.schema)&&(a=void 0)}for(var p=0,m=t.syntaxErrors;p=yi&&e<=bi?e-yi+10:0)}function Ci(e){if("#"!==e[0])return null;switch(e.length){case 4:return{red:17*_i(e.charCodeAt(1))/255,green:17*_i(e.charCodeAt(2))/255,blue:17*_i(e.charCodeAt(3))/255,alpha:1};case 5:return{red:17*_i(e.charCodeAt(1))/255,green:17*_i(e.charCodeAt(2))/255,blue:17*_i(e.charCodeAt(3))/255,alpha:17*_i(e.charCodeAt(4))/255};case 7:return{red:(16*_i(e.charCodeAt(1))+_i(e.charCodeAt(2)))/255,green:(16*_i(e.charCodeAt(3))+_i(e.charCodeAt(4)))/255,blue:(16*_i(e.charCodeAt(5))+_i(e.charCodeAt(6)))/255,alpha:1};case 9:return{red:(16*_i(e.charCodeAt(1))+_i(e.charCodeAt(2)))/255,green:(16*_i(e.charCodeAt(3))+_i(e.charCodeAt(4)))/255,blue:(16*_i(e.charCodeAt(5))+_i(e.charCodeAt(6)))/255,alpha:(16*_i(e.charCodeAt(7))+_i(e.charCodeAt(8)))/255}}return null}var Si=function(){function e(e){this.schemaService=e}return e.prototype.findDocumentSymbols=function(e,t){var n=this,r=t.root;if(!r)return null;var i=e.uri;if(("vscode://defaultsettings/keybindings.json"===i||zr(i.toLowerCase(),"/user/keybindings.json"))&&"array"===r.type){var o=[];return r.items.forEach(function(t){if("object"===t.type)for(var n=0,r=t.properties;n0&&i[i.length-1].kind===f){l=i.pop();var h=e.positionAt(a.getTokenOffset()).line;l&&h>l.startLine+1&&o!==l.startLine&&(l.endLine=h-1,u(l),o=l.startLine)}break;case 13:c=e.positionAt(a.getTokenOffset()).line;var d=e.positionAt(a.getTokenOffset()+a.getTokenLength()).line;1===a.getTokenError()&&c+1=0&&i[g].kind!==Zt.Region)g--;if(g>=0){l=i[g];i.length=g,h>l.startLine&&o!==l.startLine&&(l.endLine=h,u(l),o=l.startLine)}}}break}s=a.scan()}var v=t&&t.rangeLimit;if("number"!==typeof v||n.length<=v)return n;for(var y=[],b=0,_=r;b<_.length;b++){var C=_[b];C<30&&(y[C]=(y[C]||0)+1)}var S=0,E=0;for(g=0;gv){E=g;break}S+=w}}var x=[];for(g=0;g=u&&r<=c&&s.push(i(u,c)),s.push(i(o.offset,o.offset+o.length));break;case"number":case"boolean":case"null":case"property":s.push(i(o.offset,o.offset+o.length));break}if("property"===o.type||o.parent&&"array"===o.parent.type){var l=a(o.offset+o.length,5);-1!==l&&s.push(i(o.offset,l))}o=o.parent}for(var f=void 0,h=s.length-1;h>=0;h--)f=Dn.create(s[h],f);return f||(f=Dn.create(Ht.create(t,t))),f}function i(t,n){return Ht.create(e.positionAt(t),e.positionAt(n))}var o=cr(e.getText(),!0);function a(e,t){o.setPosition(e);var n=o.scan();return n===t?o.getTokenOffset()+o.getTokenLength():-1}return t.map(r)}function Zi(e){var t=e.promiseConstructor||Promise,n=new si(e.schemaRequestService,e.workspaceContext,t);n.setSchemaContributions(Bi);var r=new Qr(n,e.contributions,t,e.clientCapabilities),i=new Xr(n,e.contributions,t),o=new Si(n),a=new li(n,t);return{configure:function(e){n.clearExternalSchemas(),e.schemas&&e.schemas.forEach(function(e){n.registerExternalSchema(e.uri,e.fileMatch,e.schema)}),a.configure(e)},resetSchema:function(e){return n.onResourceChange(e)},doValidation:a.doValidation.bind(a),parseJSONDocument:function(e){return $r(e,{collectComments:!0})},newJSONDocument:function(e,t){return Dr(e,t)},doResolve:r.doResolve.bind(r),doComplete:r.doComplete.bind(r),findDocumentSymbols:o.findDocumentSymbols.bind(o),findDocumentSymbols2:o.findDocumentSymbols2.bind(o),findColorSymbols:function(e,t){return o.findDocumentColors(e,t).then(function(e){return e.map(function(e){return e.range})})},findDocumentColors:o.findDocumentColors.bind(o),getColorPresentations:o.getColorPresentations.bind(o),doHover:i.doHover.bind(i),getFoldingRanges:Qi,getSelectionRanges:Xi,format:function(e,t,n){var r=void 0;if(t){var i=e.offsetAt(t.start),o=e.offsetAt(t.end)-i;r={offset:i,length:o}}var a={tabSize:n?n.tabSize:4,insertSpaces:!n||n.insertSpaces,eol:"\n"};return pr(e.getText(),r,a).map(function(t){return sn.replace(Ht.create(e.positionAt(t.offset),e.positionAt(t.offset+t.length)),t.content)})}}}(function(e){function t(e,t){return{line:e,character:t}}function n(e){var t=e;return Lo.objectLiteral(t)&&Lo.number(t.line)&&Lo.number(t.character)}e.create=t,e.is=n})(wi||(wi={})),function(e){function t(e,t,n,r){if(Lo.number(e)&&Lo.number(t)&&Lo.number(n)&&Lo.number(r))return{start:wi.create(e,t),end:wi.create(n,r)};if(wi.is(e)&&wi.is(t))return{start:e,end:t};throw new Error("Range#create called with invalid arguments["+e+", "+t+", "+n+", "+r+"]")}function n(e){var t=e;return Lo.objectLiteral(t)&&wi.is(t.start)&&wi.is(t.end)}e.create=t,e.is=n}(xi||(xi={})),function(e){function t(e,t){return{uri:e,range:t}}function n(e){var t=e;return Lo.defined(t)&&xi.is(t.range)&&(Lo.string(t.uri)||Lo.undefined(t.uri))}e.create=t,e.is=n}(Ni||(Ni={})),function(e){function t(e,t,n,r){return{targetUri:e,targetRange:t,targetSelectionRange:n,originSelectionRange:r}}function n(e){var t=e;return Lo.defined(t)&&xi.is(t.targetRange)&&Lo.string(t.targetUri)&&(xi.is(t.targetSelectionRange)||Lo.undefined(t.targetSelectionRange))&&(xi.is(t.originSelectionRange)||Lo.undefined(t.originSelectionRange))}e.create=t,e.is=n}(Ai||(Ai={})),function(e){function t(e,t,n,r){return{red:e,green:t,blue:n,alpha:r}}function n(e){var t=e;return Lo.number(t.red)&&Lo.number(t.green)&&Lo.number(t.blue)&&Lo.number(t.alpha)}e.create=t,e.is=n}(Li||(Li={})),function(e){function t(e,t){return{range:e,color:t}}function n(e){var t=e;return xi.is(t.range)&&Li.is(t.color)}e.create=t,e.is=n}(ki||(ki={})),function(e){function t(e,t,n){return{label:e,textEdit:t,additionalTextEdits:n}}function n(e){var t=e;return Lo.string(t.label)&&(Lo.undefined(t.textEdit)||Fi.is(t))&&(Lo.undefined(t.additionalTextEdits)||Lo.typedArray(t.additionalTextEdits,Fi.is))}e.create=t,e.is=n}(Ti||(Ti={})),function(e){e["Comment"]="comment",e["Imports"]="imports",e["Region"]="region"}(Oi||(Oi={})),function(e){function t(e,t,n,r,i){var o={startLine:e,endLine:t};return Lo.defined(n)&&(o.startCharacter=n),Lo.defined(r)&&(o.endCharacter=r),Lo.defined(i)&&(o.kind=i),o}function n(e){var t=e;return Lo.number(t.startLine)&&Lo.number(t.startLine)&&(Lo.undefined(t.startCharacter)||Lo.number(t.startCharacter))&&(Lo.undefined(t.endCharacter)||Lo.number(t.endCharacter))&&(Lo.undefined(t.kind)||Lo.string(t.kind))}e.create=t,e.is=n}(Pi||(Pi={})),function(e){function t(e,t){return{location:e,message:t}}function n(e){var t=e;return Lo.defined(t)&&Ni.is(t.location)&&Lo.string(t.message)}e.create=t,e.is=n}(Ii||(Ii={})),function(e){e.Error=1,e.Warning=2,e.Information=3,e.Hint=4}(Mi||(Mi={})),function(e){function t(e,t,n,r,i,o){var a={range:e,message:t};return Lo.defined(n)&&(a.severity=n),Lo.defined(r)&&(a.code=r),Lo.defined(i)&&(a.source=i),Lo.defined(o)&&(a.relatedInformation=o),a}function n(e){var t=e;return Lo.defined(t)&&xi.is(t.range)&&Lo.string(t.message)&&(Lo.number(t.severity)||Lo.undefined(t.severity))&&(Lo.number(t.code)||Lo.string(t.code)||Lo.undefined(t.code))&&(Lo.string(t.source)||Lo.undefined(t.source))&&(Lo.undefined(t.relatedInformation)||Lo.typedArray(t.relatedInformation,Ii.is))}e.create=t,e.is=n}(Ri||(Ri={})),function(e){function t(e,t){for(var n=[],r=2;r0&&(i.arguments=n),i}function n(e){var t=e;return Lo.defined(t)&&Lo.string(t.title)&&Lo.string(t.command)}e.create=t,e.is=n}(ji||(ji={})),function(e){function t(e,t){return{range:e,newText:t}}function n(e,t){return{range:{start:e,end:e},newText:t}}function r(e){return{range:e,newText:""}}function i(e){var t=e;return Lo.objectLiteral(t)&&Lo.string(t.newText)&&xi.is(t.range)}e.replace=t,e.insert=n,e.del=r,e.is=i}(Fi||(Fi={})),function(e){function t(e,t){return{textDocument:e,edits:t}}function n(e){var t=e;return Lo.defined(t)&&to.is(t.textDocument)&&Array.isArray(t.edits)}e.create=t,e.is=n}(Vi||(Vi={})),function(e){function t(e,t){var n={kind:"create",uri:e};return void 0===t||void 0===t.overwrite&&void 0===t.ignoreIfExists||(n.options=t),n}function n(e){var t=e;return t&&"create"===t.kind&&Lo.string(t.uri)&&(void 0===t.options||(void 0===t.options.overwrite||Lo.boolean(t.options.overwrite))&&(void 0===t.options.ignoreIfExists||Lo.boolean(t.options.ignoreIfExists)))}e.create=t,e.is=n}(Di||(Di={})),function(e){function t(e,t,n){var r={kind:"rename",oldUri:e,newUri:t};return void 0===n||void 0===n.overwrite&&void 0===n.ignoreIfExists||(r.options=n),r}function n(e){var t=e;return t&&"rename"===t.kind&&Lo.string(t.oldUri)&&Lo.string(t.newUri)&&(void 0===t.options||(void 0===t.options.overwrite||Lo.boolean(t.options.overwrite))&&(void 0===t.options.ignoreIfExists||Lo.boolean(t.options.ignoreIfExists)))}e.create=t,e.is=n}(Ui||(Ui={})),function(e){function t(e,t){var n={kind:"delete",uri:e};return void 0===t||void 0===t.recursive&&void 0===t.ignoreIfNotExists||(n.options=t),n}function n(e){var t=e;return t&&"delete"===t.kind&&Lo.string(t.uri)&&(void 0===t.options||(void 0===t.options.recursive||Lo.boolean(t.options.recursive))&&(void 0===t.options.ignoreIfNotExists||Lo.boolean(t.options.ignoreIfNotExists)))}e.create=t,e.is=n}(qi||(qi={})),function(e){function t(e){var t=e;return t&&(void 0!==t.changes||void 0!==t.documentChanges)&&(void 0===t.documentChanges||t.documentChanges.every(function(e){return Lo.string(e.kind)?Di.is(e)||Ui.is(e)||qi.is(e):Vi.is(e)}))}e.is=t}(Ki||(Ki={}));var eo,to,no,ro,io,oo,ao,so,uo,co,lo,fo,ho,po,mo,go,vo,yo=function(){function e(e){this.edits=e}return e.prototype.insert=function(e,t){this.edits.push(Fi.insert(e,t))},e.prototype.replace=function(e,t){this.edits.push(Fi.replace(e,t))},e.prototype.delete=function(e){this.edits.push(Fi.del(e))},e.prototype.add=function(e){this.edits.push(e)},e.prototype.all=function(){return this.edits},e.prototype.clear=function(){this.edits.splice(0,this.edits.length)},e}();(function(){function e(e){var t=this;this._textEditChanges=Object.create(null),e&&(this._workspaceEdit=e,e.documentChanges?e.documentChanges.forEach(function(e){if(Vi.is(e)){var n=new yo(e.edits);t._textEditChanges[e.textDocument.uri]=n}}):e.changes&&Object.keys(e.changes).forEach(function(n){var r=new yo(e.changes[n]);t._textEditChanges[n]=r}))}Object.defineProperty(e.prototype,"edit",{get:function(){return this._workspaceEdit},enumerable:!0,configurable:!0}),e.prototype.getTextEditChange=function(e){if(to.is(e)){if(this._workspaceEdit||(this._workspaceEdit={documentChanges:[]}),!this._workspaceEdit.documentChanges)throw new Error("Workspace edit is not configured for document changes.");var t=e,n=this._textEditChanges[t.uri];if(!n){var r=[],i={textDocument:t,edits:r};this._workspaceEdit.documentChanges.push(i),n=new yo(r),this._textEditChanges[t.uri]=n}return n}if(this._workspaceEdit||(this._workspaceEdit={changes:Object.create(null)}),!this._workspaceEdit.changes)throw new Error("Workspace edit is not configured for normal text edit changes.");n=this._textEditChanges[e];if(!n){r=[];this._workspaceEdit.changes[e]=r,n=new yo(r),this._textEditChanges[e]=n}return n},e.prototype.createFile=function(e,t){this.checkDocumentChanges(),this._workspaceEdit.documentChanges.push(Di.create(e,t))},e.prototype.renameFile=function(e,t,n){this.checkDocumentChanges(),this._workspaceEdit.documentChanges.push(Ui.create(e,t,n))},e.prototype.deleteFile=function(e,t){this.checkDocumentChanges(),this._workspaceEdit.documentChanges.push(qi.create(e,t))},e.prototype.checkDocumentChanges=function(){if(!this._workspaceEdit||!this._workspaceEdit.documentChanges)throw new Error("Workspace edit is not configured for document changes.")}})();(function(e){function t(e){return{uri:e}}function n(e){var t=e;return Lo.defined(t)&&Lo.string(t.uri)}e.create=t,e.is=n})(eo||(eo={})),function(e){function t(e,t){return{uri:e,version:t}}function n(e){var t=e;return Lo.defined(t)&&Lo.string(t.uri)&&(null===t.version||Lo.number(t.version))}e.create=t,e.is=n}(to||(to={})),function(e){function t(e,t,n,r){return{uri:e,languageId:t,version:n,text:r}}function n(e){var t=e;return Lo.defined(t)&&Lo.string(t.uri)&&Lo.string(t.languageId)&&Lo.number(t.version)&&Lo.string(t.text)}e.create=t,e.is=n}(no||(no={})),function(e){e.PlainText="plaintext",e.Markdown="markdown"}(ro||(ro={})),function(e){function t(t){var n=t;return n===e.PlainText||n===e.Markdown}e.is=t}(ro||(ro={})),function(e){function t(e){var t=e;return Lo.objectLiteral(e)&&ro.is(t.kind)&&Lo.string(t.value)}e.is=t}(io||(io={})),function(e){e.Text=1,e.Method=2,e.Function=3,e.Constructor=4,e.Field=5,e.Variable=6,e.Class=7,e.Interface=8,e.Module=9,e.Property=10,e.Unit=11,e.Value=12,e.Enum=13,e.Keyword=14,e.Snippet=15,e.Color=16,e.File=17,e.Reference=18,e.Folder=19,e.EnumMember=20,e.Constant=21,e.Struct=22,e.Event=23,e.Operator=24,e.TypeParameter=25}(oo||(oo={})),function(e){e.PlainText=1,e.Snippet=2}(ao||(ao={})),function(e){function t(e){return{label:e}}e.create=t}(so||(so={})),function(e){function t(e,t){return{items:e||[],isIncomplete:!!t}}e.create=t}(uo||(uo={})),function(e){function t(e){return e.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}function n(e){var t=e;return Lo.string(t)||Lo.objectLiteral(t)&&Lo.string(t.language)&&Lo.string(t.value)}e.fromPlainText=t,e.is=n}(co||(co={})),function(e){function t(e){var t=e;return!!t&&Lo.objectLiteral(t)&&(io.is(t.contents)||co.is(t.contents)||Lo.typedArray(t.contents,co.is))&&(void 0===e.range||xi.is(e.range))}e.is=t}(lo||(lo={})),function(e){function t(e,t){return t?{label:e,documentation:t}:{label:e}}e.create=t}(fo||(fo={})),function(e){function t(e,t){for(var n=[],r=2;r=0;a--){var s=r[a],u=e.offsetAt(s.range.start),c=e.offsetAt(s.range.end);if(!(c<=o))throw new Error("Overlapping edit");n=n.substring(0,u)+s.newText+n.substring(c,n.length),o=u}return n}function i(e,t){if(e.length<=1)return e;var n=e.length/2|0,r=e.slice(0,n),o=e.slice(n);i(r,t),i(o,t);var a=0,s=0,u=0;while(a0&&e.push(t.length),this._lineOffsets=e}return this._lineOffsets},e.prototype.positionAt=function(e){e=Math.max(Math.min(e,this._content.length),0);var t=this.getLineOffsets(),n=0,r=t.length;if(0===r)return wi.create(0,e);while(ne?r=i:n=i+1}var o=n-1;return wi.create(o,e-t[o])},e.prototype.offsetAt=function(e){var t=this.getLineOffsets();if(e.line>=t.length)return this._content.length;if(e.line<0)return 0;var n=t[e.line],r=e.line+11)for(var n=1;n