diff --git a/dist/debug.js b/dist/debug.js index b77088d..554aa14 100644 --- a/dist/debug.js +++ b/dist/debug.js @@ -1,7 +1,7 @@ var Dr=Object.create,ie=Object.defineProperty,$r=Object.getPrototypeOf,Gr=Object.prototype.hasOwnProperty,jr=Object.getOwnPropertyNames,Ur=Object.getOwnPropertyDescriptor;var me=r=>ie(r,"__esModule",{value:!0});var w=(r,e)=>()=>(e||(e={exports:{}},r(e.exports,e)),e.exports),qe=(r,e)=>{for(var t in e)ie(r,t,{get:e[t],enumerable:!0})},Br=(r,e,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of jr(e))!Gr.call(r,n)&&n!=="default"&&ie(r,n,{get:()=>e[n],enumerable:!(t=Ur(e,n))||t.enumerable});return r},O=r=>Br(me(ie(r!=null?Dr($r(r)):{},"default",r&&r.__esModule&&"default"in r?{get:()=>r.default,enumerable:!0}:{value:r,enumerable:!0})),r);var Ye=w(ve=>{var We="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");ve.encode=function(r){if(0<=r&&r{var Ve=Ye(),ye=5,ze=1<>1;return e?-t:t}_e.encode=function(e){var t="",n,o=qr(e);do n=o&Qe,o>>>=ye,o>0&&(n|=Je),t+=Ve.encode(n);while(o>0);return t};_e.decode=function(e,t,n){var o=e.length,i=0,s=0,u,a;do{if(t>=o)throw new Error("Expected more digits in base 64 VLQ value.");if(a=Ve.decode(e.charCodeAt(t++)),a===-1)throw new Error("Invalid base64 digit: "+e.charAt(t-1));u=!!(a&Je),a&=Qe,i=i+(a<{function Yr(r,e,t){if(e in r)return r[e];if(arguments.length===3)return t;throw new Error('"'+e+'" is a required argument.')}S.getArg=Yr;var Xe=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,Vr=/^data:.+\,.+$/;function J(r){var e=r.match(Xe);return e?{scheme:e[1],auth:e[2],host:e[3],port:e[4],path:e[5]}:null}S.urlParse=J;function U(r){var e="";return r.scheme&&(e+=r.scheme+":"),e+="//",r.auth&&(e+=r.auth+"@"),r.host&&(e+=r.host),r.port&&(e+=":"+r.port),r.path&&(e+=r.path),e}S.urlGenerate=U;function Ee(r){var e=r,t=J(r);if(t){if(!t.path)return r;e=t.path}for(var n=S.isAbsolute(e),o=e.split(/\/+/),i,s=0,u=o.length-1;u>=0;u--)i=o[u],i==="."?o.splice(u,1):i===".."?s++:s>0&&(i===""?(o.splice(u+1,s),s=0):(o.splice(u,2),s--));return e=o.join("/"),e===""&&(e=n?"/":"."),t?(t.path=e,U(t)):e}S.normalize=Ee;function He(r,e){r===""&&(r="."),e===""&&(e=".");var t=J(e),n=J(r);if(n&&(r=n.path||"/"),t&&!t.scheme)return n&&(t.scheme=n.scheme),U(t);if(t||e.match(Vr))return e;if(n&&!n.host&&!n.path)return n.host=e,U(n);var o=e.charAt(0)==="/"?e:Ee(r.replace(/\/+$/,"")+"/"+e);return n?(n.path=o,U(n)):o}S.join=He;S.isAbsolute=function(r){return r.charAt(0)==="/"||Xe.test(r)};function zr(r,e){r===""&&(r="."),r=r.replace(/\/$/,"");for(var t=0;e.indexOf(r+"/")!==0;){var n=r.lastIndexOf("/");if(n<0||(r=r.slice(0,n),r.match(/^([^\/]+:\/)?\/*$/)))return e;++t}return Array(t+1).join("../")+e.substr(r.length+1)}S.relative=zr;var Ke=function(){var r=Object.create(null);return!("__proto__"in r)}();function Ze(r){return r}function Qr(r){return er(r)?"$"+r:r}S.toSetString=Ke?Ze:Qr;function Jr(r){return er(r)?r.slice(1):r}S.fromSetString=Ke?Ze:Jr;function er(r){if(!r)return!1;var e=r.length;if(e<9||r.charCodeAt(e-1)!==95||r.charCodeAt(e-2)!==95||r.charCodeAt(e-3)!==111||r.charCodeAt(e-4)!==116||r.charCodeAt(e-5)!==111||r.charCodeAt(e-6)!==114||r.charCodeAt(e-7)!==112||r.charCodeAt(e-8)!==95||r.charCodeAt(e-9)!==95)return!1;for(var t=e-10;t>=0;t--)if(r.charCodeAt(t)!==36)return!1;return!0}function Xr(r,e,t){var n=B(r.source,e.source);return n!==0||(n=r.originalLine-e.originalLine,n!==0)||(n=r.originalColumn-e.originalColumn,n!==0||t)||(n=r.generatedColumn-e.generatedColumn,n!==0)||(n=r.generatedLine-e.generatedLine,n!==0)?n:B(r.name,e.name)}S.compareByOriginalPositions=Xr;function Hr(r,e,t){var n=r.generatedLine-e.generatedLine;return n!==0||(n=r.generatedColumn-e.generatedColumn,n!==0||t)||(n=B(r.source,e.source),n!==0)||(n=r.originalLine-e.originalLine,n!==0)||(n=r.originalColumn-e.originalColumn,n!==0)?n:B(r.name,e.name)}S.compareByGeneratedPositionsDeflated=Hr;function B(r,e){return r===e?0:r===null?1:e===null?-1:r>e?1:-1}function Kr(r,e){var t=r.generatedLine-e.generatedLine;return t!==0||(t=r.generatedColumn-e.generatedColumn,t!==0)||(t=B(r.source,e.source),t!==0)||(t=r.originalLine-e.originalLine,t!==0)||(t=r.originalColumn-e.originalColumn,t!==0)?t:B(r.name,e.name)}S.compareByGeneratedPositionsInflated=Kr;function Zr(r){return JSON.parse(r.replace(/^\)]}'[^\n]*\n/,""))}S.parseSourceMapInput=Zr;function et(r,e,t){if(e=e||"",r&&(r[r.length-1]!=="/"&&e[0]!=="/"&&(r+="/"),e=r+e),t){var n=J(t);if(!n)throw new Error("sourceMapURL could not be parsed");if(n.path){var o=n.path.lastIndexOf("/");o>=0&&(n.path=n.path.substring(0,o+1))}e=He(U(n),e)}return Ee(e)}S.computeSourceURL=et});var Ce=w(rr=>{var we=q(),be=Object.prototype.hasOwnProperty,k=typeof Map!="undefined";function R(){this._array=[],this._set=k?new Map:Object.create(null)}R.fromArray=function(e,t){for(var n=new R,o=0,i=e.length;o=0)return t}else{var n=we.toSetString(e);if(be.call(this._set,n))return this._set[n]}throw new Error('"'+e+'" is not in the set.')};R.prototype.at=function(e){if(e>=0&&e{var nr=q();function rt(r,e){var t=r.generatedLine,n=e.generatedLine,o=r.generatedColumn,i=e.generatedColumn;return n>t||n==t&&i>=o||nr.compareByGeneratedPositionsInflated(r,e)<=0}function se(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}se.prototype.unsortedForEach=function(e,t){this._array.forEach(e,t)};se.prototype.add=function(e){rt(this._last,e)?(this._last=e,this._array.push(e)):(this._sorted=!1,this._array.push(e))};se.prototype.toArray=function(){return this._sorted||(this._array.sort(nr.compareByGeneratedPositionsInflated),this._sorted=!0),this._array};tr.MappingList=se});var Me=w(ir=>{var X=Se(),m=q(),ae=Ce().ArraySet,tt=or().MappingList;function A(r){r||(r={}),this._file=m.getArg(r,"file",null),this._sourceRoot=m.getArg(r,"sourceRoot",null),this._skipValidation=m.getArg(r,"skipValidation",!1),this._sources=new ae,this._names=new ae,this._mappings=new tt,this._sourcesContents=null}A.prototype._version=3;A.fromSourceMap=function(e){var t=e.sourceRoot,n=new A({file:e.file,sourceRoot:t});return e.eachMapping(function(o){var i={generated:{line:o.generatedLine,column:o.generatedColumn}};o.source!=null&&(i.source=o.source,t!=null&&(i.source=m.relative(t,i.source)),i.original={line:o.originalLine,column:o.originalColumn},o.name!=null&&(i.name=o.name)),n.addMapping(i)}),e.sources.forEach(function(o){var i=o;t!==null&&(i=m.relative(t,o)),n._sources.has(i)||n._sources.add(i);var s=e.sourceContentFor(o);s!=null&&n.setSourceContent(o,s)}),n};A.prototype.addMapping=function(e){var t=m.getArg(e,"generated"),n=m.getArg(e,"original",null),o=m.getArg(e,"source",null),i=m.getArg(e,"name",null);this._skipValidation||this._validateMapping(t,n,o,i),o!=null&&(o=String(o),this._sources.has(o)||this._sources.add(o)),i!=null&&(i=String(i),this._names.has(i)||this._names.add(i)),this._mappings.add({generatedLine:t.line,generatedColumn:t.column,originalLine:n!=null&&n.line,originalColumn:n!=null&&n.column,source:o,name:i})};A.prototype.setSourceContent=function(e,t){var n=e;this._sourceRoot!=null&&(n=m.relative(this._sourceRoot,n)),t!=null?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[m.toSetString(n)]=t):this._sourcesContents&&(delete this._sourcesContents[m.toSetString(n)],Object.keys(this._sourcesContents).length===0&&(this._sourcesContents=null))};A.prototype.applySourceMap=function(e,t,n){var o=t;if(t==null){if(e.file==null)throw new Error(`SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's "file" property. Both were omitted.`);o=e.file}var i=this._sourceRoot;i!=null&&(o=m.relative(i,o));var s=new ae,u=new ae;this._mappings.unsortedForEach(function(a){if(a.source===o&&a.originalLine!=null){var l=e.originalPositionFor({line:a.originalLine,column:a.originalColumn});l.source!=null&&(a.source=l.source,n!=null&&(a.source=m.join(n,a.source)),i!=null&&(a.source=m.relative(i,a.source)),a.originalLine=l.line,a.originalColumn=l.column,l.name!=null&&(a.name=l.name))}var c=a.source;c!=null&&!s.has(c)&&s.add(c);var d=a.name;d!=null&&!u.has(d)&&u.add(d)},this),this._sources=s,this._names=u,e.sources.forEach(function(a){var l=e.sourceContentFor(a);l!=null&&(n!=null&&(a=m.join(n,a)),i!=null&&(a=m.relative(i,a)),this.setSourceContent(a,l))},this)};A.prototype._validateMapping=function(e,t,n,o){if(t&&typeof t.line!="number"&&typeof t.column!="number")throw new Error("original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.");if(!(e&&"line"in e&&"column"in e&&e.line>0&&e.column>=0&&!t&&!n&&!o)){if(e&&"line"in e&&"column"in e&&t&&"line"in t&&"column"in t&&e.line>0&&e.column>=0&&t.line>0&&t.column>=0&&n)return;throw new Error("Invalid mapping: "+JSON.stringify({generated:e,source:n,original:t,name:o}))}};A.prototype._serializeMappings=function(){for(var e=0,t=1,n=0,o=0,i=0,s=0,u="",a,l,c,d,p=this._mappings.toArray(),g=0,M=p.length;g0){if(!m.compareByGeneratedPositionsInflated(l,p[g-1]))continue;a+=","}a+=X.encode(l.generatedColumn-e),e=l.generatedColumn,l.source!=null&&(d=this._sources.indexOf(l.source),a+=X.encode(d-s),s=d,a+=X.encode(l.originalLine-1-o),o=l.originalLine-1,a+=X.encode(l.originalColumn-n),n=l.originalColumn,l.name!=null&&(c=this._names.indexOf(l.name),a+=X.encode(c-i),i=c)),u+=a}return u};A.prototype._generateSourcesContent=function(e,t){return e.map(function(n){if(!this._sourcesContents)return null;t!=null&&(n=m.relative(t,n));var o=m.toSetString(n);return Object.prototype.hasOwnProperty.call(this._sourcesContents,o)?this._sourcesContents[o]:null},this)};A.prototype.toJSON=function(){var e={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return this._file!=null&&(e.file=this._file),this._sourceRoot!=null&&(e.sourceRoot=this._sourceRoot),this._sourcesContents&&(e.sourcesContent=this._generateSourcesContent(e.sources,e.sourceRoot)),e};A.prototype.toString=function(){return JSON.stringify(this.toJSON())};ir.SourceMapGenerator=A});var sr=w(D=>{D.GREATEST_LOWER_BOUND=1;D.LEAST_UPPER_BOUND=2;function Oe(r,e,t,n,o,i){var s=Math.floor((e-r)/2)+r,u=o(t,n[s],!0);return u===0?s:u>0?e-s>1?Oe(s,e,t,n,o,i):i==D.LEAST_UPPER_BOUND?e1?Oe(r,s,t,n,o,i):i==D.LEAST_UPPER_BOUND?s:r<0?-1:r}D.search=function(e,t,n,o){if(t.length===0)return-1;var i=Oe(-1,t.length,e,t,n,o||D.GREATEST_LOWER_BOUND);if(i<0)return-1;for(;i-1>=0&&n(t[i],t[i-1],!0)===0;)--i;return i}});var ur=w(ar=>{function Ae(r,e,t){var n=r[e];r[e]=r[t],r[t]=n}function nt(r,e){return Math.round(r+Math.random()*(e-r))}function xe(r,e,t,n){if(t{var f=q(),Le=sr(),W=Ce().ArraySet,ot=Se(),H=ur().quickSort;function h(r,e){var t=r;return typeof r=="string"&&(t=f.parseSourceMapInput(r)),t.sections!=null?new L(t,e):new v(t,e)}h.fromSourceMap=function(r,e){return v.fromSourceMap(r,e)};h.prototype._version=3;h.prototype.__generatedMappings=null;Object.defineProperty(h.prototype,"_generatedMappings",{configurable:!0,enumerable:!0,get:function(){return this.__generatedMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__generatedMappings}});h.prototype.__originalMappings=null;Object.defineProperty(h.prototype,"_originalMappings",{configurable:!0,enumerable:!0,get:function(){return this.__originalMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__originalMappings}});h.prototype._charIsMappingSeparator=function(e,t){var n=e.charAt(t);return n===";"||n===","};h.prototype._parseMappings=function(e,t){throw new Error("Subclasses must implement _parseMappings")};h.GENERATED_ORDER=1;h.ORIGINAL_ORDER=2;h.GREATEST_LOWER_BOUND=1;h.LEAST_UPPER_BOUND=2;h.prototype.eachMapping=function(e,t,n){var o=t||null,i=n||h.GENERATED_ORDER,s;switch(i){case h.GENERATED_ORDER:s=this._generatedMappings;break;case h.ORIGINAL_ORDER:s=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}var u=this.sourceRoot;s.map(function(a){var l=a.source===null?null:this._sources.at(a.source);return l=f.computeSourceURL(u,l,this._sourceMapURL),{source:l,generatedLine:a.generatedLine,generatedColumn:a.generatedColumn,originalLine:a.originalLine,originalColumn:a.originalColumn,name:a.name===null?null:this._names.at(a.name)}},this).forEach(e,o)};h.prototype.allGeneratedPositionsFor=function(e){var t=f.getArg(e,"line"),n={source:f.getArg(e,"source"),originalLine:t,originalColumn:f.getArg(e,"column",0)};if(n.source=this._findSourceIndex(n.source),n.source<0)return[];var o=[],i=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",f.compareByOriginalPositions,Le.LEAST_UPPER_BOUND);if(i>=0){var s=this._originalMappings[i];if(e.column===void 0)for(var u=s.originalLine;s&&s.originalLine===u;)o.push({line:f.getArg(s,"generatedLine",null),column:f.getArg(s,"generatedColumn",null),lastColumn:f.getArg(s,"lastGeneratedColumn",null)}),s=this._originalMappings[++i];else for(var a=s.originalColumn;s&&s.originalLine===t&&s.originalColumn==a;)o.push({line:f.getArg(s,"generatedLine",null),column:f.getArg(s,"generatedColumn",null),lastColumn:f.getArg(s,"lastGeneratedColumn",null)}),s=this._originalMappings[++i]}return o};ue.SourceMapConsumer=h;function v(r,e){var t=r;typeof r=="string"&&(t=f.parseSourceMapInput(r));var n=f.getArg(t,"version"),o=f.getArg(t,"sources"),i=f.getArg(t,"names",[]),s=f.getArg(t,"sourceRoot",null),u=f.getArg(t,"sourcesContent",null),a=f.getArg(t,"mappings"),l=f.getArg(t,"file",null);if(n!=this._version)throw new Error("Unsupported version: "+n);s&&(s=f.normalize(s)),o=o.map(String).map(f.normalize).map(function(c){return s&&f.isAbsolute(s)&&f.isAbsolute(c)?f.relative(s,c):c}),this._names=W.fromArray(i.map(String),!0),this._sources=W.fromArray(o,!0),this._absoluteSources=this._sources.toArray().map(function(c){return f.computeSourceURL(s,c,e)}),this.sourceRoot=s,this.sourcesContent=u,this._mappings=a,this._sourceMapURL=e,this.file=l}v.prototype=Object.create(h.prototype);v.prototype.consumer=h;v.prototype._findSourceIndex=function(r){var e=r;if(this.sourceRoot!=null&&(e=f.relative(this.sourceRoot,e)),this._sources.has(e))return this._sources.indexOf(e);var t;for(t=0;t1&&(E.source=u+y[1],u+=y[1],E.originalLine=i+y[2],i=E.originalLine,E.originalLine+=1,E.originalColumn=s+y[3],s=E.originalColumn,y.length>4&&(E.name=a+y[4],a+=y[4])),M.push(E),typeof E.originalLine=="number"&&g.push(E)}H(M,f.compareByGeneratedPositionsDeflated),this.__generatedMappings=M,H(g,f.compareByOriginalPositions),this.__originalMappings=g};v.prototype._findMapping=function(e,t,n,o,i,s){if(e[n]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+e[n]);if(e[o]<0)throw new TypeError("Column must be greater than or equal to 0, got "+e[o]);return Le.search(e,t,i,s)};v.prototype.computeColumnSpans=function(){for(var e=0;e=0){var o=this._generatedMappings[n];if(o.generatedLine===t.generatedLine){var i=f.getArg(o,"source",null);i!==null&&(i=this._sources.at(i),i=f.computeSourceURL(this.sourceRoot,i,this._sourceMapURL));var s=f.getArg(o,"name",null);return s!==null&&(s=this._names.at(s)),{source:i,line:f.getArg(o,"originalLine",null),column:f.getArg(o,"originalColumn",null),name:s}}}return{source:null,line:null,column:null,name:null}};v.prototype.hasContentsOfAllSources=function(){return this.sourcesContent?this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(e){return e==null}):!1};v.prototype.sourceContentFor=function(e,t){if(!this.sourcesContent)return null;var n=this._findSourceIndex(e);if(n>=0)return this.sourcesContent[n];var o=e;this.sourceRoot!=null&&(o=f.relative(this.sourceRoot,o));var i;if(this.sourceRoot!=null&&(i=f.urlParse(this.sourceRoot))){var s=o.replace(/^file:\/\//,"");if(i.scheme=="file"&&this._sources.has(s))return this.sourcesContent[this._sources.indexOf(s)];if((!i.path||i.path=="/")&&this._sources.has("/"+o))return this.sourcesContent[this._sources.indexOf("/"+o)]}if(t)return null;throw new Error('"'+o+'" is not in the SourceMap.')};v.prototype.generatedPositionFor=function(e){var t=f.getArg(e,"source");if(t=this._findSourceIndex(t),t<0)return{line:null,column:null,lastColumn:null};var n={source:t,originalLine:f.getArg(e,"line"),originalColumn:f.getArg(e,"column")},o=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",f.compareByOriginalPositions,f.getArg(e,"bias",h.GREATEST_LOWER_BOUND));if(o>=0){var i=this._originalMappings[o];if(i.source===n.source)return{line:f.getArg(i,"generatedLine",null),column:f.getArg(i,"generatedColumn",null),lastColumn:f.getArg(i,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}};ue.BasicSourceMapConsumer=v;function L(r,e){var t=r;typeof r=="string"&&(t=f.parseSourceMapInput(r));var n=f.getArg(t,"version"),o=f.getArg(t,"sections");if(n!=this._version)throw new Error("Unsupported version: "+n);this._sources=new W,this._names=new W;var i={line:-1,column:0};this._sections=o.map(function(s){if(s.url)throw new Error("Support for url field in sections not implemented.");var u=f.getArg(s,"offset"),a=f.getArg(u,"line"),l=f.getArg(u,"column");if(a{var it=Me().SourceMapGenerator,le=q(),st=/(\r?\n)/,at=10,Y="$$$isSourceNode$$$";function b(r,e,t,n,o){this.children=[],this.sourceContents={},this.line=r==null?null:r,this.column=e==null?null:e,this.source=t==null?null:t,this.name=o==null?null:o,this[Y]=!0,n!=null&&this.add(n)}b.fromStringWithSourceMap=function(e,t,n){var o=new b,i=e.split(st),s=0,u=function(){var p=M(),g=M()||"";return p+g;function M(){return s=0;t--)this.prepend(e[t]);else if(e[Y]||typeof e=="string")this.children.unshift(e);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);return this};b.prototype.walk=function(e){for(var t,n=0,o=this.children.length;n0){for(t=[],n=0;n{ce.SourceMapGenerator=Me().SourceMapGenerator;ce.SourceMapConsumer=cr().SourceMapConsumer;ce.SourceNode=pr().SourceNode});var hr=w((qt,gr)=>{var ut=Object.prototype.toString,Te=typeof Buffer.alloc=="function"&&typeof Buffer.allocUnsafe=="function"&&typeof Buffer.from=="function";function lt(r){return ut.call(r).slice(8,-1)==="ArrayBuffer"}function ct(r,e,t){e>>>=0;var n=r.byteLength-e;if(n<0)throw new RangeError("'offset' is out of bounds");if(t===void 0)t=n;else if(t>>>=0,t>n)throw new RangeError("'length' is out of bounds");return Te?Buffer.from(r.slice(e,e+t)):new Buffer(new Uint8Array(r.slice(e,e+t)))}function ft(r,e){if((typeof e!="string"||e==="")&&(e="utf8"),!Buffer.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');return Te?Buffer.from(r,e):new Buffer(r,e)}function pt(r,e,t){if(typeof r=="number")throw new TypeError('"value" argument must not be a number');return lt(r)?ct(r,e,t):typeof r=="string"?ft(r,e):Te?Buffer.from(r):new Buffer(r)}gr.exports=pt});var br=w(($,Ne)=>{var dt=dr().SourceMapConsumer,Re=require("path"),N;try{N=require("fs"),(!N.existsSync||!N.readFileSync)&&(N=null)}catch(r){}var gt=hr();function mr(r,e){return r.require(e)}var vr=!1,_r=!1,Ie=!1,K="auto",G={},Z={},ht=/^data:application\/json[^,]+base64,/,P=[],F=[];function Pe(){return K==="browser"?!0:K==="node"?!1:typeof window!="undefined"&&typeof XMLHttpRequest=="function"&&!(window.require&&window.module&&window.process&&window.process.type==="renderer")}function mt(){return typeof process=="object"&&process!==null&&typeof process.on=="function"}function fe(r){return function(e){for(var t=0;t";var t=this.getLineNumber();if(t!=null){e+=":"+t;var n=this.getColumnNumber();n&&(e+=":"+n)}}var o="",i=this.getFunctionName(),s=!0,u=this.isConstructor(),a=!(this.isToplevel()||u);if(a){var l=this.getTypeName();l==="[object Object]"&&(l="null");var c=this.getMethodName();i?(l&&i.indexOf(l)!=0&&(o+=l+"."),o+=i,c&&i.indexOf("."+c)!=i.length-c.length-1&&(o+=" [as "+c+"]")):o+=l+"."+(c||"")}else u?o+="new "+(i||""):i?o+=i:(o+=e,s=!1);return s&&(o+=" ("+e+")"),o}function Sr(r){var e={};return Object.getOwnPropertyNames(Object.getPrototypeOf(r)).forEach(function(t){e[t]=/^(?:is|get)/.test(t)?function(){return r[t].call(r)}:r[t]}),e.toString=_t,e}function Er(r,e){if(e===void 0&&(e={nextPosition:null,curPosition:null}),r.isNative())return e.curPosition=null,r;var t=r.getFileName()||r.getScriptNameOrSourceURL();if(t){var n=r.getLineNumber(),o=r.getColumnNumber()-1,i=/^v(10\.1[6-9]|10\.[2-9][0-9]|10\.[0-9]{3,}|1[2-9]\d*|[2-9]\d|\d{3,}|11\.11)/,s=i.test(process.version)?0:62;n===1&&o>s&&!Pe()&&!r.isEval()&&(o-=s);var u=$e({source:t,line:n,column:o});e.curPosition=u,r=Sr(r);var a=r.getFunctionName;return r.getFunctionName=function(){return e.nextPosition==null?a():e.nextPosition.name||a()},r.getFileName=function(){return u.source},r.getLineNumber=function(){return u.line},r.getColumnNumber=function(){return u.column+1},r.getScriptNameOrSourceURL=function(){return u.source},r}var l=r.isEval()&&r.getEvalOrigin();return l&&(l=yr(l),r=Sr(r),r.getEvalOrigin=function(){return l}),r}function yt(r,e){Ie&&(G={},Z={});for(var t=r.name||"Error",n=r.message||"",o=t+": "+n,i={nextPosition:null,curPosition:null},s=[],u=e.length-1;u>=0;u--)s.push(` at `+Er(e[u],i)),i.nextPosition=i.curPosition;return i.curPosition=i.nextPosition=null,o+s.reverse().join("")}function wr(r){var e=/\n at [^(]+ \((.*):(\d+):(\d+)\)/.exec(r.stack);if(e){var t=e[1],n=+e[2],o=+e[3],i=G[t];if(!i&&N&&N.existsSync(t))try{i=N.readFileSync(t,"utf8")}catch(u){i=""}if(i){var s=i.split(/(?:\r\n|\r|\n)/)[n-1];if(s)return t+":"+n+` `+s+` -`+new Array(o).join(" ")+"^"}}return null}function St(r){var e=wr(r);process.stderr._handle&&process.stderr._handle.setBlocking&&process.stderr._handle.setBlocking(!0),e&&(console.error(),console.error(e)),console.error(r.stack),process.exit(1)}function Et(){var r=process.emit;process.emit=function(e){if(e==="uncaughtException"){var t=arguments[1]&&arguments[1].stack,n=this.listeners(e).length>0;if(t&&!n)return St(arguments[1])}return r.apply(this,arguments)}}var wt=P.slice(0),bt=F.slice(0);$.wrapCallSite=Er;$.getErrorSource=wr;$.mapSourcePosition=$e;$.retrieveSourceMap=De;$.install=function(r){if(r=r||{},r.environment&&(K=r.environment,["node","browser","auto"].indexOf(K)===-1))throw new Error("environment "+K+" was unknown. Available options are {auto, browser, node}");if(r.retrieveFile&&(r.overrideRetrieveFile&&(P.length=0),P.unshift(r.retrieveFile)),r.retrieveSourceMap&&(r.overrideRetrieveSourceMap&&(F.length=0),F.unshift(r.retrieveSourceMap)),r.hookRequire&&!Pe()){var e=mr(Ne,"module"),t=e.prototype._compile;t.__sourceMapSupport||(e.prototype._compile=function(i,s){return G[s]=i,Z[s]=void 0,t.call(this,i,s)},e.prototype._compile.__sourceMapSupport=!0)}if(Ie||(Ie="emptyCacheBetweenOperations"in r?r.emptyCacheBetweenOperations:!1),vr||(vr=!0,Error.prepareStackTrace=yt),!_r){var n="handleUncaughtExceptions"in r?r.handleUncaughtExceptions:!0;try{var o=mr(Ne,"worker_threads");o.isMainThread===!1&&(n=!1)}catch(i){}n&&mt()&&(_r=!0,Et())}};$.resetRetrieveHandlers=function(){P.length=0,F.length=0,P=wt.slice(0),F=bt.slice(0),De=fe(F),Fe=fe(P)}});var pe=w(exports=>{me(exports);qe(exports,{TYPE:()=>TYPE,clock:()=>clock,expandTildePath:()=>expandTildePath,findInPATH:()=>findInPATH,fmtByteSize:()=>fmtByteSize,fmtDuration:()=>fmtDuration,getModulePackageJSON:()=>getModulePackageJSON,isWindows:()=>isWindows,json:()=>json,jsonparse:()=>jsonparse,jsonparseFile:()=>jsonparseFile,repr:()=>repr,resolveModulePackageFile:()=>resolveModulePackageFile,runtimeRequire:()=>runtimeRequire,tildePath:()=>tildePath,tmpdir:()=>tmpdir});var T=O(require("fs")),_=O(require("path")),re=O(require("os")),Ar=O(require("perf_hooks")),xr=O(require("util")),json=(r,e,t)=>JSON.stringify(r,t,e),clock=()=>Ar.performance.now(),isWindows=process.platform.startsWith("win"),TYPE=Symbol("TYPE"),runtimeRequire=eval("require");function repr(r,e){let t={colors:ee.ncolors>0};return typeof e=="object"?t={...e}:e!==void 0&&(t.compact=!e),(0,xr.inspect)(r,t)}function resolveModulePackageFile(r){let e=runtimeRequire.resolve(r),t=_.dirname(_.resolve(e)),n=_.sep;for(;t!=n;){let o=_.join(t,"package.json");if(T.existsSync(o))return o;t=_.dirname(t)}throw new Error(`package.json not found for module ${r}`)}function getModulePackageJSON(r){let e=resolveModulePackageFile(r);return jsonparseFile(e)}var _tmpdir="";function tmpdir(){return _tmpdir||(_tmpdir=T.realpathSync.native(re.tmpdir())),_tmpdir}function fmtDuration(r){return r>=59500?(r/6e4).toFixed(0)+"min":r>=999.5?(r/1e3).toFixed(1)+"s":r.toFixed(2)+"ms"}function fmtByteSize(r){return r>=1024*1e3?(r/(1024*1e3)).toFixed(1)+"MB":r>=1e3?(r/1024).toFixed(1)+"kB":r+"B"}function findInPATH(r){let e=isWindows?4294967295:T.constants.X_OK,t=new Set((process.env.PATH||"").split(_.delimiter));for(let n of t){let o=_.join(_.resolve(n),r);for(isWindows&&(o+=".cmd");;){try{let i=T.statSync(o);if(i.isSymbolicLink()){o=T.realpathSync.native(o);continue}else if(i.isFile()&&i.mode&e)return o}catch(i){if(isWindows&&o.endsWith(".cmd")){o=_.join(_.resolve(n),r)+".exe";continue}}break}}return null}function jsonparse(r,e){try{return JSON.parse(json)}catch(t){return require("vm").runInNewContext("("+r+")",{},{filename:e,displayErrors:!0})}}function jsonparseFile(r){let e=T.readFileSync(r,"utf8");try{return jsonparse(e)}catch(t){throw new Error(`failed to parse ${r}: ${t.message||t}`)}}function expandTildePath(r){let e=re.homedir();return r=="~"?e:r.startsWith("~"+_.sep)?e+r.substr(1):r}function tildePath(r){let e=_.resolve(r),t=re.homedir();return e.startsWith(t)?"~"+e.substr(t.length):e}});me(exports);qe(exports,{bugReportMessage:()=>kr,getErrorSource:()=>te.getErrorSource,initModule:()=>At,installSourceMapSupport:()=>te.install,libuv_errors:()=>Tt,printErrorAndExit:()=>Lt});var ge=O(require("fs")),Q=O(require("os")),he=O(require("path")),te=O(br());function Cr(r,e){let t=0;if(e===!0){let n=process.env.TERM||"";t=n&&["xterm","screen","vt100"].some(o=>n.indexOf(o)!=-1)?n.indexOf("256color")!=-1?8:4:2}else e!==!1&&r.isTTY&&(t=r.getColorDepth());return t}function Or(r,e){return Mr(Cr(r,e),e)}function Mr(r,e){let t=i=>`[${i}m`,n=r>0||e?(i,s)=>{let u=t(i),a=t(s);return l=>u+l+a}:i=>s=>s,o=r>=8?(i,s,u)=>{let a="["+s+"m",l="["+u+"m";return c=>a+c+l}:r>0?(i,s,u)=>{let a="["+i+"m",l="["+u+"m";return c=>a+c+l}:(i,s,u)=>a=>a;return{_hint:e,ncolors:r,reset:e||r>0?"e[0m":"",bold:n("1","22"),italic:n("3","23"),underline:n("4","24"),inverse:n("7","27"),white:o("37","38;2;255;255;255","39"),grey:o("90","38;5;244","39"),black:o("30","38;5;16","39"),blue:o("34","38;5;75","39"),cyan:o("36","38;5;87","39"),green:o("32","38;5;84","39"),magenta:o("35","38;5;213","39"),purple:o("35","38;5;141","39"),pink:o("35","38;5;211","39"),red:o("31","38;2;255;110;80","39"),yellow:o("33","38;5;227","39"),lightyellow:o("93","38;5;229","39"),orange:o("33","38;5;215","39"),reconfigure(i,s){let u=Cr(i,s);return u!=this.ncolors&&s!=this._hint&&Object.assign(this,Mr(u,s)),this}}}var ee=Or(process.stdout),V=Or(process.stderr);var ne=pe();var Lr={version:"0.9.0",BuildOptions:new Set(["sourcemap","sourcesContent","format","globalName","target","minify","minifyWhitespace","minifyIdentifiers","minifySyntax","charset","treeShaking","jsxFactory","jsxFragment","define","pure","keepNames","color","logLevel","logLimit","bundle","splitting","preserveSymlinks","outfile","metafile","outdir","outbase","platform","external","loader","resolveExtensions","mainFields","conditions","write","tsconfig","outExtension","publicPath","chunkNames","assetNames","inject","banner","footer","incremental","entryPoints","stdin","plugins","absWorkingDir","nodePaths","watch"])},zt={BuildConfig:new Set(["entry","debug","watch","cwd","quiet","silent","clear","tslint","onStart","onEnd","outfileMode","run","tsc","tsrules","title"])};var Fr=O(require("console"));var C=O(require("path")),Ct=pe(),Ge=(()=>{let r=process.env._,e=process.argv[1];if(!e)return r||process.argv[0];if(r&&!C.isAbsolute(r))return r;let t="";if(r){let n=C.basename(process.execPath);r.endsWith(C.sep+n)&&(t=n+" ")}if(e.startsWith(process.cwd())){let n=C.relative(process.cwd(),e);if(!n.startsWith("node_modules"+C.sep)&&n.indexOf(C.sep+"node_modules"+C.sep)==-1)return C.sep=="/"&&(n="./"+n),n}return t+C.basename(e)})();var Tr=O(require("path")),Nr=pe();var Mt=__dirname;function Rr(r){let e=null;return function(){return e||(I.debug(`loading ${r} module`),e=(0,Nr.runtimeRequire)(Tr.join(Mt,r)),e.initModule(I.level)),e}}var je=Rr("debug.js"),Kt=Rr("watch.js");function Ir(r,e){return je().printErrorAndExit(r,e)}function Pr(r,e){Error.prepareStackTrace=void 0;try{if(je().installSourceMapSupport(),Error.prepareStackTrace!==Pr)return Error.prepareStackTrace(r,e)}catch(t){}return r.stack||String(r)}Error.prepareStackTrace=Pr;process.on("uncaughtException",Ir);process.on("unhandledRejection",(r,e)=>{Ir(r||"PromiseRejection","unhandledRejection")});var x;(function(r){r[r.Silent=-1]="Silent",r[r.Error=0]="Error",r[r.Warn=1]="Warn",r[r.Info=2]="Info",r[r.Debug=3]="Debug"})(x||(x={}));var z=console,Ue,I=new class{constructor(){this.SILENT=-1;this.ERROR=0;this.WARN=1;this.INFO=2;this.DEBUG=3;this.level=2;this.infoOnce=this.info;this.debug=Ot}error(...e){I.level>=0&&(de(e),z.error(V.red(`${Ge}:`),...e))}warn(...e){I.level>=1&&(de(e),z.error(V.magenta(`${Ge}:`),...e))}info(...e){I.level>=2&&(de(e),z.log(...e))}get colorMode(){return Ue}set colorMode(e){Ue!==e&&(Ue=e,e===void 0?z=console:z=new Fr.Console({stdout:process.stdout,stderr:process.stderr,colorMode:e}))}};function de(r){typeof r[0]=="function"&&(r[0]=r[0]())}function Ot(...r){if(I.level>=3){let e="";if(de(r),r.length==0||r.length==1&&(r[0]===""||r[0]===void 0))return;z.log(ee.bold(ee.blue(`[DEBUG${e}]`)),...r)}}function At(r){I.level=r}function kr(r,e){let t={platform:`${Q.platform()}; ${Q.arch()}; v${Q.release()}`,time:new Date().toISOString(),estrella:`v1.3.2 (${(0,ne.tildePath)(__dirname)}) for esbuild v${Lr.version}`,esbuild:"(not found)"};for(let i of["esbuild","chokidar","typescript"])try{let s=(0,ne.resolveModulePackageFile)(i),u=JSON.parse(ge.readFileSync(s,"utf8"));t[i]=`v${u.version} (${he.dirname((0,ne.tildePath)(s))})`}catch(s){}e&&(t.context=e);let n=(r=="guess"?"If you think this is a bug in Estrella, please":V.yellow("Looks like you found a bug in Estrella!")+` +`+new Array(o).join(" ")+"^"}}return null}function St(r){var e=wr(r);process.stderr._handle&&process.stderr._handle.setBlocking&&process.stderr._handle.setBlocking(!0),e&&(console.error(),console.error(e)),console.error(r.stack),process.exit(1)}function Et(){var r=process.emit;process.emit=function(e){if(e==="uncaughtException"){var t=arguments[1]&&arguments[1].stack,n=this.listeners(e).length>0;if(t&&!n)return St(arguments[1])}return r.apply(this,arguments)}}var wt=P.slice(0),bt=F.slice(0);$.wrapCallSite=Er;$.getErrorSource=wr;$.mapSourcePosition=$e;$.retrieveSourceMap=De;$.install=function(r){if(r=r||{},r.environment&&(K=r.environment,["node","browser","auto"].indexOf(K)===-1))throw new Error("environment "+K+" was unknown. Available options are {auto, browser, node}");if(r.retrieveFile&&(r.overrideRetrieveFile&&(P.length=0),P.unshift(r.retrieveFile)),r.retrieveSourceMap&&(r.overrideRetrieveSourceMap&&(F.length=0),F.unshift(r.retrieveSourceMap)),r.hookRequire&&!Pe()){var e=mr(Ne,"module"),t=e.prototype._compile;t.__sourceMapSupport||(e.prototype._compile=function(i,s){return G[s]=i,Z[s]=void 0,t.call(this,i,s)},e.prototype._compile.__sourceMapSupport=!0)}if(Ie||(Ie="emptyCacheBetweenOperations"in r?r.emptyCacheBetweenOperations:!1),vr||(vr=!0,Error.prepareStackTrace=yt),!_r){var n="handleUncaughtExceptions"in r?r.handleUncaughtExceptions:!0;try{var o=mr(Ne,"worker_threads");o.isMainThread===!1&&(n=!1)}catch(i){}n&&mt()&&(_r=!0,Et())}};$.resetRetrieveHandlers=function(){P.length=0,F.length=0,P=wt.slice(0),F=bt.slice(0),De=fe(F),Fe=fe(P)}});var pe=w(exports=>{me(exports);qe(exports,{TYPE:()=>TYPE,clock:()=>clock,expandTildePath:()=>expandTildePath,findInPATH:()=>findInPATH,fmtByteSize:()=>fmtByteSize,fmtDuration:()=>fmtDuration,getModulePackageJSON:()=>getModulePackageJSON,isWindows:()=>isWindows,json:()=>json,jsonparse:()=>jsonparse,jsonparseFile:()=>jsonparseFile,repr:()=>repr,resolveModulePackageFile:()=>resolveModulePackageFile,runtimeRequire:()=>runtimeRequire,tildePath:()=>tildePath,tmpdir:()=>tmpdir});var T=O(require("fs")),_=O(require("path")),re=O(require("os")),Ar=O(require("perf_hooks")),xr=O(require("util")),json=(r,e,t)=>JSON.stringify(r,t,e),clock=()=>Ar.performance.now(),isWindows=process.platform.startsWith("win"),TYPE=Symbol("TYPE"),runtimeRequire=eval("require");function repr(r,e){let t={colors:ee.ncolors>0};return typeof e=="object"?t={...e}:e!==void 0&&(t.compact=!e),(0,xr.inspect)(r,t)}function resolveModulePackageFile(r){let e=runtimeRequire.resolve(r),t=_.dirname(_.resolve(e)),n=_.sep;for(;t!=n;){let o=_.join(t,"package.json");if(T.existsSync(o))return o;t=_.dirname(t)}throw new Error(`package.json not found for module ${r}`)}function getModulePackageJSON(r){let e=resolveModulePackageFile(r);return jsonparseFile(e)}var _tmpdir="";function tmpdir(){return _tmpdir||(_tmpdir=T.realpathSync.native(re.tmpdir())),_tmpdir}function fmtDuration(r){return r>=59500?(r/6e4).toFixed(0)+"min":r>=999.5?(r/1e3).toFixed(1)+"s":r.toFixed(2)+"ms"}function fmtByteSize(r){return r>=1024*1e3?(r/(1024*1e3)).toFixed(1)+"MB":r>=1e3?(r/1024).toFixed(1)+"kB":r+"B"}function findInPATH(r){let e=isWindows?4294967295:T.constants.X_OK,t=new Set((process.env.PATH||"").split(_.delimiter));for(let n of t){let o=_.join(_.resolve(n),r);for(isWindows&&(o+=".cmd");;){try{let i=T.statSync(o);if(i.isSymbolicLink()){o=T.realpathSync.native(o);continue}else if(i.isFile()&&i.mode&e)return o}catch(i){if(isWindows&&o.endsWith(".cmd")){o=_.join(_.resolve(n),r)+".exe";continue}}break}}return null}function jsonparse(r,e){try{return JSON.parse(json)}catch(t){return require("vm").runInNewContext("("+r+")",{},{filename:e,displayErrors:!0})}}function jsonparseFile(r){let e=T.readFileSync(r,"utf8");try{return jsonparse(e)}catch(t){throw new Error(`failed to parse ${r}: ${t.message||t}`)}}function expandTildePath(r){let e=re.homedir();return r=="~"?e:r.startsWith("~"+_.sep)?e+r.substr(1):r}function tildePath(r){let e=_.resolve(r),t=re.homedir();return e.startsWith(t)?"~"+e.substr(t.length):e}});me(exports);qe(exports,{bugReportMessage:()=>kr,getErrorSource:()=>te.getErrorSource,initModule:()=>At,installSourceMapSupport:()=>te.install,libuv_errors:()=>Tt,printErrorAndExit:()=>Lt});var ge=O(require("fs")),Q=O(require("os")),he=O(require("path")),te=O(br());function Cr(r,e){let t=0;if(e===!0){let n=process.env.TERM||"";t=n&&["xterm","screen","vt100"].some(o=>n.indexOf(o)!=-1)?n.indexOf("256color")!=-1?8:4:2}else e!==!1&&r.isTTY&&(t=r.getColorDepth());return t}function Or(r,e){return Mr(Cr(r,e),e)}function Mr(r,e){let t=i=>`[${i}m`,n=r>0||e?(i,s)=>{let u=t(i),a=t(s);return l=>u+l+a}:i=>s=>s,o=r>=8?(i,s,u)=>{let a="["+s+"m",l="["+u+"m";return c=>a+c+l}:r>0?(i,s,u)=>{let a="["+i+"m",l="["+u+"m";return c=>a+c+l}:(i,s,u)=>a=>a;return{_hint:e,ncolors:r,reset:e||r>0?"e[0m":"",bold:n("1","22"),italic:n("3","23"),underline:n("4","24"),inverse:n("7","27"),white:o("37","38;2;255;255;255","39"),grey:o("90","38;5;244","39"),black:o("30","38;5;16","39"),blue:o("34","38;5;75","39"),cyan:o("36","38;5;87","39"),green:o("32","38;5;84","39"),magenta:o("35","38;5;213","39"),purple:o("35","38;5;141","39"),pink:o("35","38;5;211","39"),red:o("31","38;2;255;110;80","39"),yellow:o("33","38;5;227","39"),lightyellow:o("93","38;5;229","39"),orange:o("33","38;5;215","39"),reconfigure(i,s){let u=Cr(i,s);return u!=this.ncolors&&s!=this._hint&&Object.assign(this,Mr(u,s)),this}}}var ee=Or(process.stdout),V=Or(process.stderr);var ne=pe();var Lr={version:"0.9.0",BuildOptions:new Set(["sourcemap","sourcesContent","format","globalName","target","minify","minifyWhitespace","minifyIdentifiers","minifySyntax","charset","treeShaking","jsxFactory","jsxFragment","define","pure","keepNames","color","logLevel","logLimit","bundle","splitting","preserveSymlinks","outfile","metafile","outdir","outbase","platform","external","loader","resolveExtensions","mainFields","conditions","write","tsconfig","outExtension","publicPath","chunkNames","assetNames","inject","banner","footer","incremental","entryPoints","stdin","plugins","absWorkingDir","nodePaths","watch"])},zt={BuildConfig:new Set(["entry","debug","watch","cwd","quiet","silent","clear","tslint","onStart","onEnd","outfileMode","run","tsc","tsrules","title"])};var Fr=O(require("console"));var C=O(require("path")),Ct=pe(),Ge=(()=>{let r=process.env._,e=process.argv[1];if(!e)return r||process.argv[0];if(r&&!C.isAbsolute(r))return r;let t="";if(r){let n=C.basename(process.execPath);r.endsWith(C.sep+n)&&(t=n+" ")}if(e.startsWith(process.cwd())){let n=C.relative(process.cwd(),e);if(!n.startsWith("node_modules"+C.sep)&&n.indexOf(C.sep+"node_modules"+C.sep)==-1)return C.sep=="/"&&(n="./"+n),n}return t+C.basename(e)})();var Tr=O(require("path")),Nr=pe();var Mt=__dirname;function Rr(r){let e=null;return function(){return e||(I.debug(`loading ${r} module`),e=(0,Nr.runtimeRequire)(Tr.join(Mt,r)),e.initModule(I.level)),e}}var je=Rr("debug.js"),Kt=Rr("watch.js");function Ir(r,e){return je().printErrorAndExit(r,e)}function Pr(r,e){Error.prepareStackTrace=void 0;try{if(je().installSourceMapSupport(),Error.prepareStackTrace!==Pr)return Error.prepareStackTrace(r,e)}catch(t){}return r.stack||String(r)}Error.prepareStackTrace=Pr;process.on("uncaughtException",Ir);process.on("unhandledRejection",(r,e)=>{Ir(r||"PromiseRejection","unhandledRejection")});var x;(function(r){r[r.Silent=-1]="Silent",r[r.Error=0]="Error",r[r.Warn=1]="Warn",r[r.Info=2]="Info",r[r.Debug=3]="Debug"})(x||(x={}));var z=console,Ue,I=new class{constructor(){this.SILENT=-1;this.ERROR=0;this.WARN=1;this.INFO=2;this.DEBUG=3;this.level=2;this.infoOnce=this.info;this.debug=Ot}error(...e){I.level>=0&&(de(e),z.error(V.red(`${Ge}:`),...e))}warn(...e){I.level>=1&&(de(e),z.error(V.magenta(`${Ge}:`),...e))}info(...e){I.level>=2&&(de(e),z.log(...e))}get colorMode(){return Ue}set colorMode(e){Ue!==e&&(Ue=e,e===void 0?z=console:z=new Fr.Console({stdout:process.stdout,stderr:process.stderr,colorMode:e}))}};function de(r){typeof r[0]=="function"&&(r[0]=r[0]())}function Ot(...r){if(I.level>=3){let e="";if(de(r),r.length==0||r.length==1&&(r[0]===""||r[0]===void 0))return;z.log(ee.bold(ee.blue(`[DEBUG${e}]`)),...r)}}function At(r){I.level=r}function kr(r,e){let t={platform:`${Q.platform()}; ${Q.arch()}; v${Q.release()}`,time:new Date().toISOString(),estrella:`v1.3.3 (${(0,ne.tildePath)(__dirname)}) for esbuild v${Lr.version}`,esbuild:"(not found)"};for(let i of["esbuild","chokidar","typescript"])try{let s=(0,ne.resolveModulePackageFile)(i),u=JSON.parse(ge.readFileSync(s,"utf8"));t[i]=`v${u.version} (${he.dirname((0,ne.tildePath)(s))})`}catch(s){}e&&(t.context=e);let n=(r=="guess"?"If you think this is a bug in Estrella, please":V.yellow("Looks like you found a bug in Estrella!")+` Please`)+` file an issue at: https://github.com/rsms/estrella/issues Include the following information in the report along with the stack trace:`,o=Object.keys(t).reduce((i,s)=>Math.max(i,s.length),0);for(let i of Object.keys(t))n+=` diff --git a/dist/estrella.js b/dist/estrella.js index b6403a6..053b641 100755 --- a/dist/estrella.js +++ b/dist/estrella.js @@ -8,7 +8,7 @@ ${t.stack||t}`),this._reject(t)};this._onexit=(t,r)=>{let n=this;a.debug(()=>`${ `+c),new Error(`command exited with status ${l}${c}`)}let u=i.buffer();return t?u.toString(t):u})}wait(t,r){return t===void 0||t<=0?this.promise:this._waitTimeout(t,(n,o,i)=>(a.debug(()=>`${this} wait timeout reached; killing process`),n.message="Cmd.wait timeout",this.kill(r).then(()=>i(n))))}signal(t,r){let n=this._checkproc();if(r=="group")try{return process.kill(-n.pid,t),!0}catch(o){}return n.kill(t)}async kill(t="SIGTERM",r=500,n){let o=this._checkproc();return this.signal(t,n||"group")?r<=0?this.promise:this._waitTimeout(r,(i,s)=>(a.debug(()=>`${this} kill timeout reached; sending SIGKILL`),o.kill("SIGKILL"),this.promise.then(s))):o.exitCode||0}toString(){return this.process?`Cmd[${this.pid}]`:"Cmd"}_checkproc(){if(!this.process)throw new Error(lr);return this.process}_rejectAndKill(t){this._reject(t)}_waitTimeout(t,r){return new Promise((n,o)=>{let i=!1;return this.promise.then(s=>{i||n(s)}),nr(this.promise,t,s=>{i=!0,r(s,n,o)})})}};$e.prototype.start=function(){let t=this;if(t.running)throw new Error("start() called while command is running");t.exitCode=-1,t.promise=new Promise((l,u)=>{t._resolve=l,t._reject=u});let r=null,n=null;t.stdin instanceof Buffer?r="pipe":Qt(t.stdin)?typeof t.stdin.stream.fd=="string"?r=t.stdin.stream:(r="pipe",n=t.stdin.stream):r=t.stdin;let o={stdio:[r||"ignore",t.stdout===process.stdout?1:t.stdout||"ignore",t.stderr===process.stderr?2:t.stderr?t.stderr:"ignore",...t.extraFiles],cwd:t.dir?(0,de.expandTildePath)(t.dir):void 0,env:t.env,shell:t.shell,windowsHide:t.windowsHide,detached:!de.isWindows},i=ir.spawn(t.command,t.args,o);if(i.pid===void 0){t.process=null,t.pid=0;let l=yn(t);throw t._reject(l),l}if(t.running=!0,t.process=i,t.pid=i.pid,i.on("exit",t._onexit),i.on("error",t._reject),a.debug(()=>`${t} started (${(0,de.repr)(t.command)})`),i.stdin)if(t.stdin instanceof Buffer){let l=new sr.PassThrough;l.end(t.stdin),l.pipe(i.stdin),i.stdin=null}else n&&(n.pipe(i.stdin),i.stdin=null);return!i.stdin&&!i.stdout&&!i.stderr&&i.stdio.length<4?null:{stdin:i.stdin?it(i.stdin):null,stdout:i.stdout?je(i.stdout):null,stderr:i.stderr?je(i.stderr):null,extraFiles:i.stdio.slice(3).map(l=>Xt(l)?je(l):Zt(l)?it(l):null)}};function yn(e){let t="",r="unspecified error";if(e.shell==!1){try{Q.accessSync(e.dir,Q.constants.R_OK|Q.constants.X_OK),(Q.statSync(e.command).mode&Q.constants.S_IFREG)==0?t="EACCES":t="EIO"}catch(o){t=o.code||"ENOENT"}r=lt(t)||r}if(!t){try{Q.accessSync(e.dir,Q.constants.R_OK|Q.constants.X_OK),t="EIO"}catch(o){t=o.code||"ENOENT"}r=lt(t)||r,t&&(r=r+"; cmd.dir="+(0,de.repr)(e.dir))}t||(t="UNKNOWN");let n=new Error(`failed to spawn process ${(0,de.repr)(e.command)} (${t} ${r})`);return n.code=t,n}var at=P(require("fs")),ar=P(require("os")),ur=new Map;function Te(e,t){let r=o=>at.writeSync(process.stderr.fd,o+` `),n=ur.get(e);if(n)n.listeners.add(t);else{let o=new Set([t]),i=s=>{s=="SIGINT"&&at.writeSync(1,` `);try{for(let l of o)l(s)}catch(l){r(`error in signal listener: ${l.stack||l}`)}process.exit(-(ar.constants.signals[s]||1))};process.on(e,i),ur.set(e,{rootListener:i,listeners:o})}}var dr=!1,fr=!1,Re=new Set;function xn(){if(dr)return;dr=!0,process.on("beforeExit",t=>ct(!1)),process.on("exit",t=>ct(!1));let e=t=>ct(!1);Te("SIGINT",e),Te("SIGHUP",e),Te("SIGTERM",e),Te("SIGPIPE",e)}function ct(e){if(fr)return;fr=!0;let t=r=>cr.writeSync(process.stderr.fd,r+` -`);try{for(let r of Re)if(r.cmd.running)try{r.cmd.signal("SIGTERM")}catch(n){}Re.clear()}catch(r){t(`ignoring error in run.atexit: ${r.stack||r}`)}}function mr(e){if(!e.run)return;a.debug(()=>`run.configure run=${(0,ut.repr)(e.run)}`);let t=new pr(e);Re.add(t);let r=e.onEnd;e.onEnd=async(n,o,i)=>{if(await t.onEndBuild(o),typeof r=="function")return r(n,o,i)},xn()}function gr(){return Promise.all(Array.from(Re).map(e=>e.cmd.promise)).then(e=>e.reduce((t,r)=>Math.max(t,r),0))}var pr=class{constructor(t){this._logOnExit=!0;if(this.config=t,this.cmd=new $e(""),this.cmd.stdout="inherit",this.cmd.stderr="inherit",this.cmd.env.ESTRELLA_PATH=__filename,this.cmd.env.ESTRELLA_VERSION="1.3.2",typeof t.run=="string")this.cmd.command=t.run,this.cmd.shell=!0,this.cmdname=t.run;else if(typeof t.run=="boolean"){if(!t.outfile)throw new ce("please set config.outfile= or config.run=");this.cmd.command=process.execPath,this.cmd.args=[t.outfileAbs],this.cmdname=t.outfile}else{if(!t.run||t.run.length==0)throw new ce("config.run is an empty list");this.cmd.command=t.run[0],this.cmd.args=t.run.slice(1),this.cmdname=t.run.join(" "),this.cmdname.length>60&&(this.cmdname=this.cmdname.substr(0,57)+"...")}}async onEndBuild(t){if(t.errors.length>0)return;let r=this.cmd,n=$.pink,o=r.running;r.running&&(this._logOnExit=!1,a.debug(()=>`Stopping ${this.cmdname} [${r.pid}] ...`),await r.kill()),a.debug(()=>`Starting command ${(0,ut.repr)([r.command,...r.args])}`),r.start(),this.config.watch&&(a.info(()=>n(`${o?"Restarted":"Running"} ${this.cmdname} [${r.pid}]`)),this._logOnExit=!0,r.promise.then(i=>{this._logOnExit&&a.info(()=>n(`${this.cmdname} exited (${i})`))}))}};var Ae=G();function hr(e){let t=e;if(!t){a.debug("typescript API requested; attempting to load typescript module");try{let p=require;if(t=p("typescript"),parseFloat(t.versionMajorMinor)<3.5)return a.warn(`typescript ${t.version} is too old; disabling "ts" API. +`);try{for(let r of Re)if(r.cmd.running)try{r.cmd.signal("SIGTERM")}catch(n){}Re.clear()}catch(r){t(`ignoring error in run.atexit: ${r.stack||r}`)}}function mr(e){if(!e.run)return;a.debug(()=>`run.configure run=${(0,ut.repr)(e.run)}`);let t=new pr(e);Re.add(t);let r=e.onEnd;e.onEnd=async(n,o,i)=>{if(await t.onEndBuild(o),typeof r=="function")return r(n,o,i)},xn()}function gr(){return Promise.all(Array.from(Re).map(e=>e.cmd.promise)).then(e=>e.reduce((t,r)=>Math.max(t,r),0))}var pr=class{constructor(t){this._logOnExit=!0;if(this.config=t,this.cmd=new $e(""),this.cmd.stdout="inherit",this.cmd.stderr="inherit",this.cmd.env.ESTRELLA_PATH=__filename,this.cmd.env.ESTRELLA_VERSION="1.3.3",typeof t.run=="string")this.cmd.command=t.run,this.cmd.shell=!0,this.cmdname=t.run;else if(typeof t.run=="boolean"){if(!t.outfile)throw new ce("please set config.outfile= or config.run=");this.cmd.command=process.execPath,this.cmd.args=[t.outfileAbs],this.cmdname=t.outfile}else{if(!t.run||t.run.length==0)throw new ce("config.run is an empty list");this.cmd.command=t.run[0],this.cmd.args=t.run.slice(1),this.cmdname=t.run.join(" "),this.cmdname.length>60&&(this.cmdname=this.cmdname.substr(0,57)+"...")}}async onEndBuild(t){if(t.errors.length>0)return;let r=this.cmd,n=$.pink,o=r.running;r.running&&(this._logOnExit=!1,a.debug(()=>`Stopping ${this.cmdname} [${r.pid}] ...`),await r.kill()),a.debug(()=>`Starting command ${(0,ut.repr)([r.command,...r.args])}`),r.start(),this.config.watch&&(a.info(()=>n(`${o?"Restarted":"Running"} ${this.cmdname} [${r.pid}]`)),this._logOnExit=!0,r.promise.then(i=>{this._logOnExit&&a.info(()=>n(`${this.cmdname} exited (${i})`))}))}};var Ae=G();function hr(e){let t=e;if(!t){a.debug("typescript API requested; attempting to load typescript module");try{let p=require;if(t=p("typescript"),parseFloat(t.versionMajorMinor)<3.5)return a.warn(`typescript ${t.version} is too old; disabling "ts" API. You are seeing this message because you are importing the ts API. Either install a more recent version of typescript or remove the ts import.`),null;a.debug(()=>`loaded typescript ${t.version} from ${(0,Ae.tildePath)(p.resolve("typescript"))}`)}catch(p){return a.debug(()=>"failed to load typescript; module unavailable"),null}}let r=new Map;function n(p){let h=(0,Ae.json)(Object.keys(p).sort().map(T=>[T,p[T]])),S=r.get(h);if(S)return a.debug("ts.getCompilerHost cache hit"),S;p={newLine:t.NewLineKind.LineFeed,...p};let I=[t.createCompilerHost(p,!0),p];return r.set(h,I),a.debug("ts.getCompilerHost cache miss"),I}async function o(p,h){let S=typeof p=="string"?{"//a.ts":p}:p,k=Object.keys(S),[I,T]=n(h||{}),E=I.readFile;I.readFile=d=>d in S?S[d]:E(d);let B=t.createProgram(k,T,I);if(typeof p=="string")return B.getSourceFile(k[0]);let L={};for(let d of k)L[d]=B.getSourceFile(d);return L}async function i(p,h){return s(p,h)}function s(p,h){let[S,k]=n(h||{}),T=t.createProgram([p],k,S).getSourceFile(p);if(!T)throw new Error(`${p}: file not found`);return T}function l(p,h,S){return u(p,[h],S).then(k=>k[0])}async function u(p,h,S){let k=s(p,S);return c(k,h)}function c(p,h){let S=_(p),k=new Map,I=[];for(let T of h||S.keys()){let E=S.get(T);if(!E){I.push(null);continue}I.push(g(p,E,S,k))}return I}function g(p,h,S,k){let I=k.get(h);if(I)return I;let T={heritage:[],name:h.name.escapedText,props:{},computedProps(){let E={};for(let B of T.heritage)Object.assign(E,B.props);return Object.assign(E,T.props),E},lookupProp(E){let B=T.props[E];if(!B){for(let L of T.heritage)if(B=L.lookupProp(E))break}return B}};if(k.set(h,T),h.heritageClauses)for(let E of h.heritageClauses)for(let B of E.types){let L=B.expression;if(t.isIdentifier(L)){let d=S.get(L.escapedText);d&&T.heritage.push(g(p,d,S,k))}}return h.forEachChild(E=>{if(t.isPropertySignature(E)){let B=f(E,p,T);T.props[B.name]=B}}),T}function f(p,h,S){let k=t.getLineAndCharacterOfPosition(h,p.pos),I=null,T=p.type,B={name:w(p.name),type:T,get typestr(){return I===null&&(I=T?M(T,h):"any"),Object.defineProperty(B,"typestr",{enumerable:!0,value:I}),I},srcfile:h.fileName,srcline:k.line,srccol:k.character,parent:S};return B}function w(p){switch(p.kind){case t.SyntaxKind.Identifier:case t.SyntaxKind.PrivateIdentifier:return p.escapedText;case t.SyntaxKind.StringLiteral:case t.SyntaxKind.NumericLiteral:return p.text;case t.SyntaxKind.ComputedPropertyName:return"[computed]";default:return"?"}}function _(p){let h=new Map;return t.forEachChild(p,S=>{S.kind==t.SyntaxKind.InterfaceDeclaration&&h.set(S.name.escapedText,S)}),h}let j=t.createPrinter({removeComments:!0,newLine:t.NewLineKind.LineFeed,omitTrailingSemicolon:!0,noEmitHelpers:!0});function M(p,h){if(!h){let S=p;for(;S.kind!=t.SyntaxKind.SourceFile;)if(S=S.parent,!S)throw new Error("node without SourceFile parent (provide file to ts.fmt)");h=S}return j.printNode(t.EmitHint.Unspecified,p,h)}return{ts:t,getCompilerHost:n,parse:o,parseFile:i,interfaceInfo:l,interfacesInfo:u,interfacesInfoAST:c,fmt:M}}var D=P(require("fs")),Y=P(require("path")),wr=P(require("crypto"));var re=P(require("fs")),Me=G(),br=String.fromCharCode,wn=(e,t)=>e.charCodeAt(t||0);function yr(e,t){if(typeof t=="number")return re.chmodSync(e,t),t;let r=re.statSync(e).mode,n=Ne(r,t);return r!=n&&re.chmodSync(e,n),n}function xr(e,t){return new Promise((r,n)=>{if(typeof t=="number")return re.chmod(e,t,o=>{o?n(o):r(t)});re.stat(e,(o,i)=>{if(o)return n(o);let s=Ne(i.mode,t);if(i.mode==s)return r(s);re.chmod(e,s,l=>{l?n(l):r(s)})})})}function Ne(e,t){let r="Expected format: [ugoa]*[+-=][rwx]+",n=(i,s)=>new Error(`${i} in modifier ${(0,Me.json)(s)}. ${r}`),o=[];for(let i of Array.isArray(t)?t:[t])o=o.concat(i.trim().split(/\s*,+\s*/));for(let i of o){let s=[],l=!1,u=0,c=0;for(let f=0;f(Le(e),xr(e,t));function Pn(e,t){return ee.readFile(e,t)}A.read=Pn;function Cn(e,t){return D.readFileSync(e,t)}A.readSync=Cn;A.stat=ee.stat;function _n(...e){return Promise.all(e.map(t=>ee.stat(t).then(r=>r.mtimeMs).catch(r=>null))).then(t=>t.length==1?t[0]:t)}A.mtime=_n;A.readall=(...e)=>Promise.all(e.map(t=>ee.readFile(t)));A.readallText=(e,...t)=>Promise.all(t.map(r=>ee.readFile(r,{encoding:e||"utf8"})));A.write=async(e,t,r)=>{Le(e);let n=r&&typeof r=="object"?r:{};try{await ee.writeFile(e,t,r)}catch(o){if(!n.mkdirOff&&o.code=="ENOENT")await A.mkdirs(Y.dirname(String(e)),n.mkdirMode),await ee.writeFile(e,t,r);else throw o}if(n.log){let o=Y.relative(process.cwd(),String(e));o.startsWith(".."+Y.sep)&&(o=(0,We.tildePath)(e)),a.info($.green(`Wrote ${o}`))}};A.writeSync=(e,t,r)=>{D.writeFileSync(e,t,r)};function Tn(e,t){return new Promise((r,n)=>{let o=D.createReadStream(e),i=wr.createHash("sha1");o.on("error",n),o.on("end",()=>{i.end(),r(t?i.digest(t):i.digest())}),o.pipe(i)})}A.sha1=Tn;A.copy=(e,t,r)=>{let n=D.constants.COPYFILE_FICLONE;return r&&(n|=D.constants.COPYFILE_EXCL),Le(t),ee.copyFile(e,t,n)};A.move=(e,t)=>(Le(t),ee.rename(e,t));A.mkdirs=(e,t)=>ee.mkdir(e,{recursive:!0,mode:t}).then(r=>!!r&&r.length>0);async function Sr(e,t,r){if(r||(r={}),!D.promises||!D.promises.opendir)throw new Error("scandir not implemented for nodejs <12.12.0");let n=[],o=new Set,i=r.recursive!==void 0?r.recursive?Infinity:0:r.depth!==void 0?r.depth:Infinity;async function s(u,c,g){if(o.has(u))return;o.add(u);let f=await D.promises.opendir(u);for await(let w of f){let _=w.name;w.isDirectory()?is(Y.resolve(u),".",0))).then(()=>n.sort())}var Pr={version:"0.9.0",BuildOptions:new Set(["sourcemap","sourcesContent","format","globalName","target","minify","minifyWhitespace","minifyIdentifiers","minifySyntax","charset","treeShaking","jsxFactory","jsxFragment","define","pure","keepNames","color","logLevel","logLimit","bundle","splitting","preserveSymlinks","outfile","metafile","outdir","outbase","platform","external","loader","resolveExtensions","mainFields","conditions","write","tsconfig","outExtension","publicPath","chunkNames","assetNames","inject","banner","footer","incremental","entryPoints","stdin","plugins","absWorkingDir","nodePaths","watch"])},Cr={BuildConfig:new Set(["entry","debug","watch","cwd","quiet","silent","clear","tslint","onStart","onEnd","outfileMode","run","tsc","tsrules","title"])};var Ee=P(require("path"));var _r=P(require("crypto"));function De(e,t){let r=_r.createHash("sha1").update(e);return t?r.digest(t):r.digest()}function Tr(e,t){let r=e.cwd||"?",n=!1,o=!1,i=!1,s=!1,l="";function u(f){let w=[f.cwd,f.outfile||"",...Array.isArray(f.entryPoints)?f.entryPoints:f.entryPoints?[f.entryPoints]:[]].join(Ee.delimiter);return En(De(Buffer.from(w,"utf8")))}let c=e.cwd?Ee.resolve(e.cwd):t,g=Object.create({get outfileAbs(){return l},setOutfile(f){g.outfile=f,l=f&&f!="-"?Ee.resolve(g.cwd,f):""},get projectID(){return r},updateProjectID(){return r=u(g),r},get buildIsCancelled(){return n},set buildIsCancelled(f){n=f},get outfileIsTemporary(){return o},set outfileIsTemporary(f){o=f},get outfileCopyToStdout(){return i},set outfileCopyToStdout(f){i=f},get metafileIsTemporary(){return s},set metafileIsTemporary(f){s=f}});return Object.assign(g,e),g.cwd=c,g.setOutfile(e.outfile||""),g}function En(e){let t="";for(let r=0;r ...",flags:we.flags.concat([["-o, outfile","Write output to instead of stdout.",""],["-bundle","Include all dependencies."],["-minify","Simplify and compress generated code."],["-outdir","Write output to instead of stdout.",""],["-esbuild","Pass arbitrary JSON to esbuild's build function.",""]]),trailer:` Example of using estrella without a build script: @@ -35,5 +35,5 @@ See https://github.com/rsms/estrella#readme for documentation. Tried the following filenames:${Array.from(Ze(m,e.cwd)).map(b=>` ${(0,x.tildePath)(b)}`)}`}),u="off"):e.tslint!==void 0&&e.tslint!=="auto"&&(u=e.tslint)),e.run&&mr(e);let c=0;function g(){te.clear(),c=(0,x.clock)()}let f=!1,w=e.onEnd,_=w?async(d,m)=>{f=!0;let C;try{let F=w(e,d,t);C=F instanceof Promise?await F:F}catch(F){throw a.debug(()=>`error in onEnd handler: ${F.stack||F}`),F}finally{f=!1}return C===void 0?m:!!C}:(d,m)=>m;function j(d){let m=_;_=async(C,b)=>{let F=await d(C,b);return F!==void 0&&(b=F),m(C,b)}}e.outfileMode&&e.outfile&&j(async(d,m)=>{if(a.debug("onEnd chmod"),d.errors.length==0)try{yr(e.outfileAbs,e.outfileMode)}catch(C){a.error("configuration error: outfileMode: "+C.message),Fr(1)}}),e.outfileCopyToStdout&&!e.run&&e.write!==!1&&j(async(d,m)=>{if(a.debug("onEnd copyToStdout"),d.errors.length==0)return new Promise((C,b)=>{let F=ne.createReadStream(e.outfileAbs);F.on("end",()=>C(m)),F.on("error",b),F.pipe(process.stdout)})}),e.outfileIsTemporary&&!e.outfileCopyToStdout&&e.write!==!1&&j(async(d,m)=>{if(a.debug("onEnd load results"),d.js=ne.readFileSync(e.outfile,{encoding:"utf8"}),e.sourcemap===!0){try{d.map=ne.readFileSync(e.outfile+".map",{encoding:"utf8"})}catch(b){a.debug(`failed to load temporary source map at ${e.outfile}.map: ${b.stack||b}`)}let C=d.js.lastIndexOf(` //# sourceMappingURL`);C!=-1&&(d.js=d.js.substr(0,C+1))}}),e.watch&&j(async(d,m)=>{Bn("Watching files for changes...")});let M={DEBUG:i,...e.define||{}};for(let d in M)M[d]=(0,x.json)(M[d]);let p={minify:!i,sourcemap:e.sourcemap,color:le.ncolors>0,logLevel:e.silent?"silent":e.quiet?"error":"warning",...On(e),define:M};if(e.watch){let d=e.projectID;p.metafile=!0,(!p.outfile&&!p.outdir||p.write===!1)&&(p.outfile=J.join((0,x.tmpdir)(),`esbuild.${d}.out.js`),e.outfileIsTemporary=!0,delete p.write)}t.rebuild=()=>I([]).then(d=>(f&&a.warn("waiting for rebuild() inside onEnd handler may cause a deadlock"),d));let h={warnings:[],errors:[]};function S(d,m){a.debug("esbuild finished with result",m),jr(m.warnings||[]);let C=(0,x.fmtDuration)((0,x.clock)()-d);if(!e.outfile)a.info($.green(e.outdir?`Wrote to dir ${e.outdir} (${C})`:`Finished (write=false, ${C})`));else{let b=e.outfile;if(e.sourcemap&&e.sourcemap!="inline"&&e.write!==!1){let oe=J.extname(e.outfile);b=`${J.join(J.dirname(e.outfile),J.basename(e.outfile,oe))}.{${oe.substr(1)},${oe.substr(1)}.map}`;let pe={sourcesContent:void 0,sourceRoot:J.relative(J.dirname(e.outfile),e.cwd)};e.outfileIsTemporary&&(pe.sourceRoot=".",pe.sources=me=>me&&me.map(Ge=>J.relative(process.cwd(),Ge))),Fn(e.outfileAbs+".map",pe)}let F=0;try{F=ne.statSync(e.outfileAbs).size}catch(oe){}e.outfileIsTemporary||a.info($.green(`Wrote ${b}`)+` (${(0,x.fmtByteSize)(F)}, ${C})`)}return h.warnings=m.warnings,h.errors=[],m.metafile&&(h.metafile=m.metafile),_(h,!0)}function k(d,m){a.debug("esbuild finished with error:",m?m.stack||m:null);let C=m.warnings||[],b=m.errors||[];return b.length==0&&(a.error(m.message),b.push({text:String(m),location:null})),jr(C),h.warnings=C,h.errors=b,_(h,!1)}async function I(d){if(e.watch&&e.clear&&g(),e.onStart)try{let b=e.onStart(e,d,t);b instanceof Promise&&await b}catch(b){throw a.debug(()=>`error in onStart handler: ${b.stack||b}`),b}if(e.isCancelled)return;a.debug(()=>`invoking esbuild.build() in ${process.cwd()} with options: ${(0,x.repr)(p)}`);let m=process.cwd();process.chdir(e.cwd);let C=Er.build(p);return process.chdir(m),C.then(S.bind(null,(0,x.clock)()),k.bind(null,(0,x.clock)()))}let T=n.diag?null:I([]),[E,B]=u!=="off"?jn(u,n,e):[null,!1];E&&!B&&(E.catch(d=>(a.error(d.stack||String(d)),!1)),t.addCancelCallback(()=>{E.cancel()}),R.diag&&e.watch&&e.clear&&te.clear());let L=!0;if(T&&(a.debug("awaiting esbuild"),L=await T,e.isCancelled))return!1;if(e.watch){let d=function(){let m=h.metafile||{};if(!m.inputs||Object.keys(m.inputs).length==0){m.inputs={};for(let C of e.entryPoints)m.inputs[C]={bytes:0,imports:[]}}return m};return await Xe().watchFiles(e,d,t,m=>{let C=m.map(F=>J.relative(e.cwd,F)),b=m.length;return a.info(`${b} ${b>1?"files":"file"} changed: ${C.join(", ")}`),I(m)}),a.debug("fswatch ended"),!0}if(E){let d=null;L?(a.debug("awaiting eslint"),!B&&!n.diag&&(d=setTimeout(()=>a.info("Waiting for TypeScript... (^C to skip)"),1e3)),L=await E.catch(()=>!1)):(a.debug("cancelling eslint since esbuild reported an error"),E.cancel()),clearTimeout(d)}if(!e.isCancelled&&!L&&Fr(),L){let d=await gr();process.exitCode=d}return L}var $r=new Map;function jn(e,t,r){let n=e,o={};if(e&&typeof e=="object"&&(n=void 0,o=e,o.mode=="off"))return a.debug(()=>'tslint disabled by tslint config {mode:"off"}'),[null,!1];r.tsrules&&r.tsrules.length&&(a.info("The 'tsrules' property is deprecated. Please use 'tslint.rules' instead"),o.rules={...r.tsrules,...o.rules});let i=t.diag&&r.watch&&r.clear,s=be(r),l=`${s||r.cwd}`,u=$r.get(l);if(u)return a.debug(()=>"tslint sharing process (no new process created)"),[u,!0];let c={colors:$.ncolors>0,quiet:r.quiet,mode:n,...o,watch:r.watch,cwd:r.cwd,clearScreen:i,srcdir:dt(r.entryPoints[0]),tsconfigFile:s,onRestart(){a.debug("tsc restarting")}};a.debug(()=>`starting tslint with options ${(0,x.repr)(c)}`);let g=nt(c);return $r.set(l,g),[g,!1]}function jr(e){e.length>0&&a.warn("[warn] "+e.map(t=>t.text).join(` -`))}function $n(){return vr({[Ue]:1}).catch(e=>{console.error(le.red(K+": "+(e?e.stack||e:"error")));let t=process.exitCode||0;process.exit(t>0?t:1)}).then(e=>{let t=process.exitCode||0;process.exit(e||t>0?t:1)})}function Rr(){R["no-color"]&&(R.color=!1),R["no-diag"]&&(R.diag=!1),a.colorMode=R.color,$.reconfigure(process.stdout,R.color),le.reconfigure(process.stderr,R.color),R.color!==void 0,R["estrella-version"]&&(console.log("estrella 1.3.2"),process.exit(0)),R["estrella-debug"]&&(a.level=a.DEBUG),R.diag&&R.run&&(a.info("Disabling -run since -diag is set"),R.run=void 0),a.debug(()=>`Parsed initial CLI arguments: ${(0,x.repr)({options:R,args:V},2)}`)}module.id=="."||process.mainModule&&Ir(process.mainModule.filename||"")=="estrella.js"?([R,V]=Oe(process.argv.slice(2),In),Rr(),$n()):([R,V]=Oe(process.argv.slice(2),{...we,unknownFlagAsArg:!0,help(e,t,r){ft=new Promise(n=>{process.nextTick(()=>{console.log(Je(e,we.usage,we.trailer)),process.exit(0),n()})})}}),Rr(),V.length>0&&ft.then(()=>{V.length>0&&ze(V)}),R.parse=(...e)=>{a.debug(()=>`Parsing custom CLI arguments ${(0,x.json)(V.join)} via cliopts.parse(`+(0,x.repr)(e)+")");let t=Oe(V,{...we,flags:we.flags.concat(e)});return a.debug(()=>"Parsed extra CLI arguments: "+(0,x.json)({options:t[0],args:t[1]},2)),V.splice(0,V.length),t});function Ar(e,t,r){return Xe().watch(e,t,r)}function Rn(e,t,r,n){return a.info(()=>"estrella.watchdir is deprecated. Please use estrella.watch instead"),n===void 0&&(r===void 0?(n=t,r={}):(n=r,r={...r,filter:t},r.recursive!==void 0&&(r.recursive||(r.depth=0),delete r.recursive))),Ar(e,r,n)}var pt;module.exports={version:"1.3.2",prog:K,cliopts:R,cliargs:V,dirname:dt,basename:Ir,watch:Ar,watchdir:Rn,scandir:Sr,tslint:nt,defaultTSRules:rt,termStyle:ke,stdoutStyle:$,stderrStyle:le,chmod:A.chmod,editFileMode:A.editMode,fmtDuration:x.fmtDuration,tildePath:x.tildePath,findInPATH:x.findInPATH,tsconfig:_e,tsconfigFile:be,glob:fe.glob,globmatch:fe.match,file:A,sha1:De,log:a,get ts(){return pt===void 0&&(pt=hr()),pt},build:vr}; +`))}function $n(){return vr({[Ue]:1}).catch(e=>{console.error(le.red(K+": "+(e?e.stack||e:"error")));let t=process.exitCode||0;process.exit(t>0?t:1)}).then(e=>{let t=process.exitCode||0;process.exit(e||t>0?t:1)})}function Rr(){R["no-color"]&&(R.color=!1),R["no-diag"]&&(R.diag=!1),a.colorMode=R.color,$.reconfigure(process.stdout,R.color),le.reconfigure(process.stderr,R.color),R.color!==void 0,R["estrella-version"]&&(console.log("estrella 1.3.3"),process.exit(0)),R["estrella-debug"]&&(a.level=a.DEBUG),R.diag&&R.run&&(a.info("Disabling -run since -diag is set"),R.run=void 0),a.debug(()=>`Parsed initial CLI arguments: ${(0,x.repr)({options:R,args:V},2)}`)}module.id=="."||process.mainModule&&Ir(process.mainModule.filename||"")=="estrella.js"?([R,V]=Oe(process.argv.slice(2),In),Rr(),$n()):([R,V]=Oe(process.argv.slice(2),{...we,unknownFlagAsArg:!0,help(e,t,r){ft=new Promise(n=>{process.nextTick(()=>{console.log(Je(e,we.usage,we.trailer)),process.exit(0),n()})})}}),Rr(),V.length>0&&ft.then(()=>{V.length>0&&ze(V)}),R.parse=(...e)=>{a.debug(()=>`Parsing custom CLI arguments ${(0,x.json)(V.join)} via cliopts.parse(`+(0,x.repr)(e)+")");let t=Oe(V,{...we,flags:we.flags.concat(e)});return a.debug(()=>"Parsed extra CLI arguments: "+(0,x.json)({options:t[0],args:t[1]},2)),V.splice(0,V.length),t});function Ar(e,t,r){return Xe().watch(e,t,r)}function Rn(e,t,r,n){return a.info(()=>"estrella.watchdir is deprecated. Please use estrella.watch instead"),n===void 0&&(r===void 0?(n=t,r={}):(n=r,r={...r,filter:t},r.recursive!==void 0&&(r.recursive||(r.depth=0),delete r.recursive))),Ar(e,r,n)}var pt;module.exports={version:"1.3.3",prog:K,cliopts:R,cliargs:V,dirname:dt,basename:Ir,watch:Ar,watchdir:Rn,scandir:Sr,tslint:nt,defaultTSRules:rt,termStyle:ke,stdoutStyle:$,stderrStyle:le,chmod:A.chmod,editFileMode:A.editMode,fmtDuration:x.fmtDuration,tildePath:x.tildePath,findInPATH:x.findInPATH,tsconfig:_e,tsconfigFile:be,glob:fe.glob,globmatch:fe.match,file:A,sha1:De,log:a,get ts(){return pt===void 0&&(pt=hr()),pt},build:vr}; //# sourceMappingURL=estrella.js.map